Warning: This page has not been updated in over over a year and may be outdated or deprecated.
expanded_driver_func
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
expanded_driver_func [2010/02/11 12:07] – l.osullivan | expanded_driver_func [2010/02/11 12:21] – l.osullivan | ||
---|---|---|---|
Line 5: | Line 5: | ||
**%%https:// | **%%https:// | ||
+ | |||
+ | |||
+ | |||
===== Purpose ===== | ===== Purpose ===== | ||
- | To create a flexible and gracefully degrading solution for the Item Loan Renewals, Placing Hold and cancelling Holds. | + | To create a flexible and gracefully degrading solution for Item Loan Renewals, Placing Hold and cancelling Holds. |
- | // | + | //**NB:**// |
- | driver.ini refers to the ILS-specific configuration file found in the config directory. E.g. voyager.ini | + | //driver.ini refers to the ILS-specific configuration file found in the config directory. E.g. voyager.ini// |
- | driver.php refers to the ILS-specific driver e.g. Voyager.php// | + | //driver.php refers to the ILS-specific driver e.g. Voyager.php// |
===== New Functions ===== | ===== New Functions ===== | ||
Line 207: | Line 210: | ||
NB: Hypertext link could be converted to form element in order to provide a POST option for continuity between methods. | NB: Hypertext link could be converted to form element in order to provide a POST option for continuity between methods. | ||
+ | |||
Line 374: | Line 378: | ||
</ | </ | ||
=== Hold.php === | === Hold.php === | ||
- | |||
Hold.php first checks if Holds are enabled. If they are, it registers the function to be used . If they are not, the user is directed back to the holdings page. | Hold.php first checks if Holds are enabled. If they are, it registers the function to be used . If they are not, the user is directed back to the holdings page. | ||
Line 560: | Line 563: | ||
This sub template contains the form required for POSTing data back to Hold.php. It first displays any status messages which can only have been assigned if an error has occurred. | This sub template contains the form required for POSTing data back to Hold.php. It first displays any status messages which can only have been assigned if an error has occurred. | ||
+ | < | ||
{if $results.sysmessage} | {if $results.sysmessage} | ||
<p class=" | <p class=" | ||
{/if} | {/if} | ||
+ | </ | ||
The form action is generated using the variables passed from Holdings.php and view-holdings-holds.tpl. | The form action is generated using the variables passed from Holdings.php and view-holdings-holds.tpl. | ||
+ | < | ||
<div class=" | <div class=" | ||
Line 615: | Line 621: | ||
| | ||
</ | </ | ||
+ | </ | ||
=== New Smarty Variables / Text === | === New Smarty Variables / Text === | ||
Line 628: | Line 635: | ||
Place a Hold | Place a Hold | ||
- | == hold-submit.tpl = | + | == hold-submit.tpl |
Comments | Comments | ||
Line 648: | Line 655: | ||
If enabled, the Cancel Holds method allows vufind users to cancel their holds. If it is not enabled, then none of the functionality is displayed. | If enabled, the Cancel Holds method allows vufind users to cancel their holds. If it is not enabled, then none of the functionality is displayed. | ||
+ | |||
+ | |||
==== Process ==== | ==== Process ==== | ||
Line 654: | Line 663: | ||
[cancelHolds] | [cancelHolds] | ||
+ | |||
enabled = true | enabled = true | ||
+ | |||
link = item_id: | link = item_id: | ||
- | opacurl = http:// | + | |
+ | opacurl = %%http:// | ||
The enabled field determines whether or not Cancel Holds is in use. | The enabled field determines whether or not Cancel Holds is in use. | ||
Line 667: | Line 680: | ||
A call is made to checkFunction and the response is assigned to $cancelHolds. | A call is made to checkFunction and the response is assigned to $cancelHolds. | ||
+ | < | ||
// Is Cancelling Holds allowed? | // Is Cancelling Holds allowed? | ||
$this-> | $this-> | ||
+ | </ | ||
=== Holds.php === | === Holds.php === | ||
Holds.php begins as usual by confirming that the user is signed in: | Holds.php begins as usual by confirming that the user is signed in: | ||
+ | < | ||
// Get My Holds | // Get My Holds | ||
Line 681: | Line 696: | ||
if (PEAR:: | if (PEAR:: | ||
PEAR:: | PEAR:: | ||
+ | </ | ||
It then proceeds to determine if cancelling holds is enabled and retrieves any messages received from services/ | It then proceeds to determine if cancelling holds is enabled and retrieves any messages received from services/ | ||
+ | < | ||
// Is cancelling Holds Available | // Is cancelling Holds Available | ||
if($this-> | if($this-> | ||
Line 693: | Line 710: | ||
$cancelResults[' | $cancelResults[' | ||
} | } | ||
+ | </ | ||
Holds.php then checks if any data has been submitted. If it has, it assigns it to the cancelDetails variable, adds the patron array, calls the required function and assigns the results to the cancelResults array. The cancelResults variable is then assigned to hold.tpl. | Holds.php then checks if any data has been submitted. If it has, it assigns it to the cancelDetails variable, adds the patron array, calls the required function and assigns the results to the cancelResults array. The cancelResults variable is then assigned to hold.tpl. | ||
+ | < | ||
// Process Submitted Form | // Process Submitted Form | ||
Line 710: | Line 729: | ||
$interface-> | $interface-> | ||
} | } | ||
+ | </ | ||
A call is then made to the getMyHolds function: | A call is then made to the getMyHolds function: | ||
+ | < | ||
$result = $this-> | $result = $this-> | ||
Line 723: | Line 744: | ||
$db-> | $db-> | ||
} | } | ||
+ | </ | ||
Holds.php then loops through each result item and assigns the details to the recordList array, If cancel holds is enabled and the function is set as “getcancelHoldLink” , an OPAC url will be added to the cancel_link key in the ils_details array. If no opacurl key is present, the link field in the driver.ini is used to assign an associate array of values to the cancel_details key of the ils_details array. | Holds.php then loops through each result item and assigns the details to the recordList array, If cancel holds is enabled and the function is set as “getcancelHoldLink” , an OPAC url will be added to the cancel_link key in the ils_details array. If no opacurl key is present, the link field in the driver.ini is used to assign an associate array of values to the cancel_details key of the ils_details array. | ||
+ | < | ||
// Get BIB Details and add " | // Get BIB Details and add " | ||
// Addition of values like "date created" | // Addition of values like "date created" | ||
Line 768: | Line 791: | ||
$recordList[] = $record; | $recordList[] = $record; | ||
} | } | ||
+ | </ | ||
Finally, the recordList array is assigned to holds.tpl and the page is displayed. | Finally, the recordList array is assigned to holds.tpl and the page is displayed. | ||
+ | < | ||
$interface-> | $interface-> | ||
| | ||
Line 784: | Line 809: | ||
$interface-> | $interface-> | ||
} | } | ||
+ | </ | ||
=== Holds.tpl === | === Holds.tpl === | ||
Line 795: | Line 821: | ||
Next, if recordList is an array, holds.tpl first determines if vufind is being used to cancel holds. If it is, it will create two forms which POST data back to holds.php. The first cancels all items and uses information in the ils_details array assigned by the driver: | Next, if recordList is an array, holds.tpl first determines if vufind is being used to cancel holds. If it is, it will create two forms which POST data back to holds.php. The first cancels all items and uses information in the ils_details array assigned by the driver: | ||
+ | < | ||
{if is_array($recordList)} | {if is_array($recordList)} | ||
Line 810: | Line 836: | ||
<form name=" | <form name=" | ||
{/if} | {/if} | ||
+ | </ | ||
The second uses checkboxes to give users the option of selecting individual holds to cancel. It is generated as part of the recordList | The second uses checkboxes to give users the option of selecting individual holds to cancel. It is generated as part of the recordList | ||
+ | < | ||
<ul class=" | <ul class=" | ||
{foreach from=$recordList item=resource name=" | {foreach from=$recordList item=resource name=" | ||
Line 867: | Line 895: | ||
{/foreach} | {/foreach} | ||
</ul> | </ul> | ||
+ | </ | ||
holds.tpl finally determines if vufind is being used to cancel holds, supplies a submit button and finishes the form. | holds.tpl finally determines if vufind is being used to cancel holds, supplies a submit button and finishes the form. | ||
+ | < | ||
{if $cancelOption} | {if $cancelOption} | ||
<br /> | <br /> | ||
Line 875: | Line 905: | ||
</ | </ | ||
{/if} | {/if} | ||
+ | </ | ||
+ | |||
==== New Smarty Variables / Text ==== | ==== New Smarty Variables / Text ==== | ||
Cancel All Holds | Cancel All Holds | ||
+ | |||
Cancel Selected Holds | Cancel Selected Holds | ||
+ | |||
Cancel Hold | Cancel Hold | ||
Line 896: | Line 930: | ||
If enabled, the Renew Items method allows vufind users to renew their transactions. If it is not enabled, then none of the functionality is displayed. | If enabled, the Renew Items method allows vufind users to renew their transactions. If it is not enabled, then none of the functionality is displayed. | ||
+ | |||
==== Process ==== | ==== Process ==== | ||
Line 901: | Line 936: | ||
conf/ | conf/ | ||
- | Renewals] | + | [Renewals] |
enabled = true | enabled = true | ||
+ | |||
link = item_id | link = item_id | ||
- | opacurl = http:// | + | |
+ | opacurl = %%http:// | ||
The enabled field determines whether or not Renewals is in use. | The enabled field determines whether or not Renewals is in use. | ||
Line 918: | Line 956: | ||
// Is Renewing Items allowed? | // Is Renewing Items allowed? | ||
$this-> | $this-> | ||
+ | |||
==== CheckedOut.php ==== | ==== CheckedOut.php ==== | ||
Line 923: | Line 962: | ||
CheckedOut.php begins as usual by confirming that the driver is available and that the user is logged | CheckedOut.php begins as usual by confirming that the driver is available and that the user is logged | ||
+ | <code | ||
// Get My Transactions | // Get My Transactions | ||
if ($this-> | if ($this-> | ||
Line 929: | Line 969: | ||
if (PEAR:: | if (PEAR:: | ||
PEAR:: | PEAR:: | ||
+ | </ | ||
It then proceeds to get a list of user transactions. All the data assigned by the driver (duedate and item_id in this instance) is stored in an array with a key of “ils_details” so that system specific values will not have to be added to CheckedOut.php: | It then proceeds to get a list of user transactions. All the data assigned by the driver (duedate and item_id in this instance) is stored in an array with a key of “ils_details” so that system specific values will not have to be added to CheckedOut.php: | ||
- | + | ||
+ | < | ||
$result = $this-> | $result = $this-> | ||
if (!PEAR:: | if (!PEAR:: | ||
Line 946: | Line 988: | ||
| | ||
} | } | ||
+ | </ | ||
Once the transaction list has been established, | Once the transaction list has been established, | ||
+ | < | ||
if($this-> | if($this-> | ||
| | ||
Line 987: | Line 1031: | ||
} | } | ||
} | } | ||
+ | </ | ||
If renewals are enabled, it then checks to see if it has received any POST data. If it has, it adds it to the $gatheredDetails[' | If renewals are enabled, it then checks to see if it has received any POST data. If it has, it adds it to the $gatheredDetails[' | ||
+ | < | ||
// Rewew Items | // Rewew Items | ||
| | ||
Line 1010: | Line 1056: | ||
$interface-> | $interface-> | ||
} | } | ||
+ | </ | ||
In this instance, the $_POST data is an array of item ids. The driver returns an array with two main keys. The first, “details” contains an array of details for each renew attempt. In this instance, that includes a Boolean success key (true or false), the item_id and a sysmessage key which holds any message returned by the system (e.g. Items with hold requests may not be renewed.) The second main key is id_array which contains a list of all the item_ids for which a renewal has been attempted. It is included for convenient use in the checkedout template. | In this instance, the $_POST data is an array of item ids. The driver returns an array with two main keys. The first, “details” contains an array of details for each renew attempt. In this instance, that includes a Boolean success key (true or false), the item_id and a sysmessage key which holds any message returned by the system (e.g. Items with hold requests may not be renewed.) The second main key is id_array which contains a list of all the item_ids for which a renewal has been attempted. It is included for convenient use in the checkedout template. | ||
- | checkedout.tpl | + | ==== checkedout.tpl |
checkedout.tpl first determines if vufind is being used to renew items. If it is, it will create two forms which POST data back to checkedout.php. The first renews all items and uses information in the ils_details array assigned by the driver: | checkedout.tpl first determines if vufind is being used to renew items. If it is, it will create two forms which POST data back to checkedout.php. The first renews all items and uses information in the ils_details array assigned by the driver: | ||
+ | < | ||
{if $renewOption == " | {if $renewOption == " | ||
<form name=" | <form name=" | ||
Line 1033: | Line 1081: | ||
<form name=" | <form name=" | ||
{/if} | {/if} | ||
+ | </ | ||
The second uses checkboxes to give users the option of selecting individual items to renew. It is generated as part of the transaction list operation. | The second uses checkboxes to give users the option of selecting individual items to renew. It is generated as part of the transaction list operation. | ||
+ | < | ||
<ul class=" | <ul class=" | ||
{foreach from=$transList item=resource name=" | {foreach from=$transList item=resource name=" | ||
Line 1115: | Line 1165: | ||
{/foreach} | {/foreach} | ||
</ul> | </ul> | ||
+ | </ | ||
checkedout.tpl finally determines if vufind is being to renew items, supplies a submit button and finishes the form. | checkedout.tpl finally determines if vufind is being to renew items, supplies a submit button and finishes the form. | ||
- | | + | |
+ | < | ||
{if $renewOption == " | {if $renewOption == " | ||
<br /> | <br /> | ||
Line 1123: | Line 1175: | ||
</ | </ | ||
{/if} | {/if} | ||
+ | </ | ||
==== New Smarty Variables / Text ==== | ==== New Smarty Variables / Text ==== |
expanded_driver_func.txt · Last modified: 2014/06/13 13:14 by 127.0.0.1