[open-ils-commits] r15127 - in trunk/Open-ILS/web: js/dojo/openils/circ/nls js/ui/default/circ/selfcheck templates/default/circ/selfcheck (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Dec 9 16:11:03 EST 2009
Author: erickson
Date: 2009-12-09 16:10:58 -0500 (Wed, 09 Dec 2009)
New Revision: 15127
Modified:
trunk/Open-ILS/web/js/dojo/openils/circ/nls/selfcheck.js
trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
trunk/Open-ILS/web/templates/default/circ/selfcheck/banner.tt2
trunk/Open-ILS/web/templates/default/circ/selfcheck/circ_page.tt2
trunk/Open-ILS/web/templates/default/circ/selfcheck/holds_page.tt2
trunk/Open-ILS/web/templates/default/circ/selfcheck/main.tt2
Log:
added a workstation registration wizard to selfcheck. this will come in handy when an org requires a workstation for selfcheck. some other minor cleanup
Modified: trunk/Open-ILS/web/js/dojo/openils/circ/nls/selfcheck.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/circ/nls/selfcheck.js 2009-12-09 21:09:28 UTC (rev 15126)
+++ trunk/Open-ILS/web/js/dojo/openils/circ/nls/selfcheck.js 2009-12-09 21:10:58 UTC (rev 15127)
@@ -15,6 +15,7 @@
'UNKNOWN_ERROR' : 'An unhandled exception occurred with error code ${0}',
'MAX_RENEWALS' : 'No more renewals allowed for item ${0}',
'ITEM_NOT_CATALOGED' : 'Item ${0} was not found in the system. Try re-scanning the item.',
- 'WORKSTATION_REQUIRED' : 'Workstation is required. Set the workstation name with URL param "ws"'
+ 'WORKSTATION_REQUIRED' : 'A workstation is required to log in to selfcheck. You can set the workstation name with URL param "ws". \n\nWould you like to register a new workstation for this self-check interface?',
+ 'WORKSTATION_EXISTS' : 'This workstation has already been registered. Would you like to use it for this self-check station?'
}
Modified: trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js 2009-12-09 21:09:28 UTC (rev 15126)
+++ trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js 2009-12-09 21:10:58 UTC (rev 15127)
@@ -5,6 +5,7 @@
dojo.require('openils.User');
dojo.require('openils.Event');
dojo.require('openils.widget.ProgressDialog');
+dojo.require('openils.widget.OrgUnitFilteringSelect');
dojo.requireLocalization('openils.circ', 'selfcheck');
var localeStrings = dojo.i18n.getLocalization('openils.circ', 'selfcheck');
@@ -83,7 +84,9 @@
// workstation is required but none provided
if(this.orgSettings[SET_WORKSTATION_REQUIRED] && !this.workstation) {
- alert(dojo.string.substitute(localeStrings.WORKSTATION_REQUIRED));
+ if(confirm(dojo.string.substitute(localeStrings.WORKSTATION_REQUIRED))) {
+ this.registerWorkstation();
+ }
return;
}
@@ -125,7 +128,55 @@
}
}
+
/**
+ * Registers a new workstion
+ */
+SelfCheckManager.prototype.registerWorkstation = function() {
+
+ oilsSelfckWsDialog.show();
+
+ new openils.User().buildPermOrgSelector(
+ 'REGISTER_WORKSTATION',
+ oilsSelfckWsLocSelector,
+ this.staff.home_ou()
+ );
+
+
+ var self = this;
+ dojo.connect(oilsSelfckWsSubmit, 'onClick',
+
+ function() {
+ oilsSelfckWsDialog.hide();
+ var name = oilsSelfckWsLocSelector.attr('displayedValue') + '-' + oilsSelfckWsName.attr('value');
+
+ var res = fieldmapper.standardRequest(
+ ['open-ils.actor', 'open-ils.actor.workstation.register'],
+ { params : [
+ self.authtoken, name, oilsSelfckWsLocSelector.attr('value')
+ ]
+ }
+ );
+
+ if(evt = openils.Event.parse(res)) {
+ if(evt.textcode == 'WORKSTATION_NAME_EXISTS') {
+ if(confirm(localeStrings.WORKSTATION_EXISTS)) {
+ location.href = location.href.replace(/\?.*/, '') + '?ws=' + name;
+ } else {
+ self.registerWorkstation();
+ }
+ return;
+ } else {
+ alert(evt);
+ }
+ } else {
+ location.href = location.href.replace(/\?.*/, '') + '?ws=' + name;
+ }
+ }
+ );
+}
+
+/**
* Loads the org unit settings
*/
SelfCheckManager.prototype.loadOrgSettings = function() {
Modified: trunk/Open-ILS/web/templates/default/circ/selfcheck/banner.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/circ/selfcheck/banner.tt2 2009-12-09 21:09:28 UTC (rev 15126)
+++ trunk/Open-ILS/web/templates/default/circ/selfcheck/banner.tt2 2009-12-09 21:10:58 UTC (rev 15127)
@@ -4,7 +4,7 @@
</div>
<div id='oils-selfck-scan-div'>
<div id='oils-selfck-scan-text'></div>
- <input jsId='selfckScanBox' dojoType='dijit.form.TextBox'></input>
+ <input jsId='selfckScanBox' dojoType='dijit.form.TextBox'/>
</div>
<div id='oils-selfck-status-div'></div>
Modified: trunk/Open-ILS/web/templates/default/circ/selfcheck/circ_page.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/circ/selfcheck/circ_page.tt2 2009-12-09 21:09:28 UTC (rev 15126)
+++ trunk/Open-ILS/web/templates/default/circ/selfcheck/circ_page.tt2 2009-12-09 21:10:58 UTC (rev 15127)
@@ -13,7 +13,7 @@
</thead>
<tbody id='oils-selfck-circ-tbody'>
<tr id='oils-selfck-circ-row'>
- <td><img class='oils-selfck-jacket' name='jacket'></img></td>
+ <td><img class='oils-selfck-jacket' name='jacket'/></td>
<td name='barcode'></td>
<td name='title'></td>
<td name='author'></td>
@@ -25,6 +25,6 @@
</td>
</tr>
</tbody>
- <tbody id='oils-selfck-circ-out-tbody' class='oils-selfck-item-table'/>
+ <tbody id='oils-selfck-circ-out-tbody' class='oils-selfck-item-table'></tbody>
</table>
</div>
Modified: trunk/Open-ILS/web/templates/default/circ/selfcheck/holds_page.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/circ/selfcheck/holds_page.tt2 2009-12-09 21:09:28 UTC (rev 15126)
+++ trunk/Open-ILS/web/templates/default/circ/selfcheck/holds_page.tt2 2009-12-09 21:10:58 UTC (rev 15127)
@@ -10,7 +10,7 @@
</thead>
<tbody id='oils-selfck-hold-tbody'>
<tr id='oils-selfck-hold-row'>
- <td><img class='oils-selfck-jacket' name='jacket'></img></td>
+ <td><img class='oils-selfck-jacket' name='jacket'/></td>
<td name='title'></td>
<td name='author'></td>
<td name='status'></td>
Modified: trunk/Open-ILS/web/templates/default/circ/selfcheck/main.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/circ/selfcheck/main.tt2 2009-12-09 21:09:28 UTC (rev 15126)
+++ trunk/Open-ILS/web/templates/default/circ/selfcheck/main.tt2 2009-12-09 21:10:58 UTC (rev 15127)
@@ -29,7 +29,27 @@
[% INCLUDE 'default/circ/selfcheck/summary.tt2' %]
</div>
</div>
-<div dojoType='openils.widget.ProgressDialog' jsId='progressDialog'/>
+<div dojoType='openils.widget.ProgressDialog' jsId='progressDialog'></div>
+<div dojoType="dijit.Dialog" jsId='oilsSelfckWsDialog' class='oils-login-dialog' style='display:none;'>
+ <form>
+ <table>
+ <tr>
+ <td>Choose a location</td>
+ <td><div dojoType='openils.widget.OrgUnitFilteringSelect' jsId='oilsSelfckWsLocSelector'
+ searchAttr='shortname' labelAttr='shortname'/></td>
+ </tr>
+ <tr>
+ <td>Enter a workstation name</td>
+ <td><input dojoType='dijit.form.TextBox' jsId='oilsSelfckWsName'/></td>
+ </tr>
+ <tr>
+ <td colspan='2' align='center'>
+ <button jsId='oilsSelfckWsSubmit' dojoType='dijit.form.Button'>Submit</button>
+ </td>
+ </tr>
+ </table>
+ </form>
+</div>
[% END %]
More information about the open-ils-commits
mailing list