return {complete => 1};
}
+__PACKAGE__->register_method(
+ method => 'ranged_line_item_alert_text',
+ api_name => 'open-ils.acq.line_item_alert_text.ranged.retrieve.all');
+
+sub ranged_line_item_alert_text {
+ my($self, $conn, $auth, $org_id, $depth) = @_;
+ my $e = new_editor(authtoken => $auth);
+ return $e->event unless $e->checkauth;
+ return $e->event unless $e->allowed('ADMIN_ACQ_LINEITEM_ALERT_TEXT', $org_id);
+ return $e->search_acq_lineitem_alert_text(
+ {owning_lib => $U->get_org_full_path($org_id, $depth)});
+}
+
+
1;
--- /dev/null
+dojo.require('dojox.grid.DataGrid');
+dojo.require('openils.widget.AutoGrid');
+dojo.require('dojox.grid.cells.dijit');
+dojo.require('dojo.data.ItemFileWriteStore');
+dojo.require('dijit.form.CurrencyTextBox');
+dojo.require('dijit.Dialog');
+dojo.require('dojox.widget.PlaceholderMenuItem');
+dojo.require('fieldmapper.OrgUtils');
+dojo.require('dijit.form.FilteringSelect');
+dojo.require('openils.PermaCrud');
+dojo.require('openils.widget.OrgUnitFilteringSelect');
+
+var alertContextOrg;
+var alertList;
+
+function alertInit() {
+
+ buildAlertGrid();
+ var connect = function() {
+ dojo.connect(alertContextOrgSelect, 'onChange',
+ function() {
+ alertContextOrg = this.getValue();
+ alertGrid.resetStore();
+ buildAlertGrid();
+ }
+ );
+ };
+ new openils.User().buildPermOrgSelector('ADMIN_ACQ_LINEITEM_ALERT_TEXT', alertContextOrgSelect, null, connect);
+}
+
+function buildAlertGrid() {
+ if(alertContextOrg == null)
+ alertContextOrg = openils.User.user.ws_ou();
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.line_item_alert_text.ranged.retrieve.all'],
+ { async: true,
+ params: [openils.User.authtoken, alertContextOrg, fieldmapper.aou.findOrgDepth(alertContextOrg)],
+ oncomplete: function(r) {
+ if(alertList = openils.Util.readResponse(r)) {
+ alertList = openils.Util.objectSort(alertList);
+ dojo.forEach(alertList,
+ function(e) {
+ alertGrid.store.newItem(acqliat.toStoreItem(e));
+ }
+ );
+ }
+ }
+ }
+ );
+}
+
+openils.Util.addOnLoad(alertInit);
+
+
<!ENTITY staff.main.menu.admin.server_admin.conify.org_unit_setting_type "Organization Unit Setting Types">
<!ENTITY staff.main.menu.admin.server_admin.conify.usr_setting_type "User Setting Types">
+<!ENTITY staff.main.menu.admin.server_admin.acq.label "Acquisitions">
+<!ENTITY staff.main.menu.admin.server_admin.acq.accesskey "A">
+<!ENTITY staff.main.menu.admin.server_admin.acq.lineitem_alert.label "Line Item Alerts">
+<!ENTITY staff.main.menu.admin.server_admin.acq.lineitem_alert.accesskey "L">
+
<!ENTITY staff.main.menu.admin.server_admin.booking.label "Booking">
<!ENTITY staff.main.menu.admin.server_admin.booking.accesskey "B">
<!ENTITY staff.main.menu.admin.server_admin.booking.resource.label "Resources">
--- /dev/null
+[% WRAPPER default/base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/conify/global/acq/lineitem_alert.js'> </script>
+
+<!-- grid -->
+
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+ <div>Line Item Alert Text</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='alertGrid.showCreateDialog()'>New Line Item Alert Text</button>
+ <button dojoType='dijit.form.Button' onClick='alertGrid.deleteSelected()'>Delete Selected</button>
+ </div>
+ </div>
+ <div>
+ <span>Context Org Unit</span>
+ <select dojoType="openils.widget.OrgUnitFilteringSelect" jsId='alertContextOrgSelect'
+ searchAttr='shortname' labelAttr='shortname'> </select>
+ </div>
+ <table jsId="alertGrid"
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['id', 'code', 'description', 'owning_lib']"
+ query="{id: '*'}"
+ defaultCellWidth='20'
+ fmClass='acqliat'
+ editOnEnter='true'>
+ </table>
+ </div>
+</div>
+[% END %]
+
+
['oncommand'],
function() { open_eg_web_page('conify/global/config/billing_type'); }
],
+ 'cmd_server_admin_acq_lineitem_alert' : [
+ ['oncommand'],
+ function() { open_eg_web_page('conify/global/acq/lineitem_alert'); }
+ ],
'cmd_server_admin_z39_source' : [
['oncommand'],
function() { open_eg_web_page('conify/global/config/z3950_source'); }
<command id="cmd_server_admin_copy_status"/>
<command id="cmd_server_admin_marc_code"/>
<command id="cmd_server_admin_billing_type"/>
+ <command id="cmd_server_admin_acq_lineitem_alert"/>
<command id="cmd_server_admin_z39_source"/>
<command id="cmd_server_admin_circ_mod"/>
<command id="cmd_server_admin_org_unit_setting_type"/>
<menuitem label="&staff.main.menu.admin.server_admin.conify.circulation_modifier.label;" command="cmd_server_admin_circ_mod"/>
<menuitem label="&staff.main.menu.admin.server_admin.conify.org_unit_setting_type;" command="cmd_server_admin_org_unit_setting_type"/>
<menuitem label="&staff.main.menu.admin.server_admin.conify.usr_setting_type;" command="cmd_server_admin_usr_setting_type"/>
- <menu id="main.menu.admin.server.booking" label="&staff.main.menu.admin.server_admin.booking.label;" accesskey="&staff.main.menu.admin.server_admin.booking.label;">
+ <menu id="main.menu.admin.server.acq" label="&staff.main.menu.admin.server_admin.acq.label;" accesskey="&staff.main.menu.admin.server_admin.acq.accesskey;">
+ <menupopup id="main.menu.admin.server.acq.popup">
+ <menuitem label="&staff.main.menu.admin.server_admin.acq.lineitem_alert.label;" accesskey="&staff.main.menu.admin.server_admin.acq.lineitem_alert.accesskey;" command="cmd_server_admin_acq_lineitem_alert"/>
+ </menupopup>
+ </menu>
+ <menu id="main.menu.admin.server.booking" label="&staff.main.menu.admin.server_admin.booking.label;" accesskey="&staff.main.menu.admin.server_admin.booking.accesskey;">
<menupopup id="main.menu.admin.server.booking.popup">
<menuitem label="&staff.main.menu.admin.server_admin.booking.resource.label;" command="cmd_server_admin_booking_resource" accesskey="&staff.main.menu.admin.server_admin.booking.resource.accesskey;"/>
<menuitem label="&staff.main.menu.admin.server_admin.booking.resource_type.label;" command="cmd_server_admin_booking_resource_type" accesskey="&staff.main.menu.admin.server_admin.booking.resource_type.accesskey;"/>