[open-ils-commits] r9731 - in branches/acq-experiment: .
Evergreen/conf Evergreen/src/javascript/backend/circ
Open-ILS/src/perlmods/OpenILS/Application/Circ
Open-ILS/web/js/dojo/fieldmapper Open-ILS/web/js/dojo/openils
Open-ILS/xul/staff_client/server/cat
Open-ILS/xul/staff_client/server/main
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu May 29 18:27:12 EDT 2008
Author: erickson
Date: 2008-05-29 18:27:08 -0400 (Thu, 29 May 2008)
New Revision: 9731
Modified:
branches/acq-experiment/
branches/acq-experiment/Evergreen/conf/lib_ips.txt
branches/acq-experiment/Evergreen/src/javascript/backend/circ/circ_item_config.js
branches/acq-experiment/Evergreen/src/javascript/backend/circ/circ_permit_hold.js
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
branches/acq-experiment/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js
branches/acq-experiment/Open-ILS/web/js/dojo/openils/User.js
branches/acq-experiment/Open-ILS/xul/staff_client/server/cat/copy_browser.xul
branches/acq-experiment/Open-ILS/xul/staff_client/server/main/ws_info.xul
Log:
Merged revisions 9714-9715,9718,9721,9723,9726,9728,9730 via svnmerge from
svn://svn.open-ils.org/ILS/trunk
........
r9714 | erickson | 2008-05-27 22:55:59 -0400 (Tue, 27 May 2008) | 1 line
added function to return a flat list of org + descendants
........
r9715 | erickson | 2008-05-27 22:56:35 -0400 (Tue, 27 May 2008) | 1 line
retrieving high perm org IDs instead of objects now and taking advantage of existing org tree
........
r9718 | erickson | 2008-05-28 09:18:20 -0400 (Wed, 28 May 2008) | 1 line
gapines rule for eventpass
........
r9721 | erickson | 2008-05-28 16:44:58 -0400 (Wed, 28 May 2008) | 1 line
updated policy name
........
r9723 | dbs | 2008-05-28 23:42:15 -0400 (Wed, 28 May 2008) | 2 lines
Fix a broken entity
........
r9726 | erickson | 2008-05-29 11:15:39 -0400 (Thu, 29 May 2008) | 1 line
added org unit setting to force patron penalty checks on renewals
........
r9728 | phasefx | 2008-05-29 11:18:05 -0400 (Thu, 29 May 2008) | 1 line
just in case JSON returns that value as a string instead of a number
........
r9730 | erickson | 2008-05-29 18:23:31 -0400 (Thu, 29 May 2008) | 1 line
adding Davids org perm store caching with some slight modification. using existing perm_org_set function instead of manually invoking
........
Property changes on: branches/acq-experiment
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-9707
+ /trunk:1-9730
Modified: branches/acq-experiment/Evergreen/conf/lib_ips.txt
===================================================================
--- branches/acq-experiment/Evergreen/conf/lib_ips.txt 2008-05-29 22:23:31 UTC (rev 9730)
+++ branches/acq-experiment/Evergreen/conf/lib_ips.txt 2008-05-29 22:27:08 UTC (rev 9731)
@@ -101,7 +101,7 @@
MGRL-MA 168.10.139.64 168.10.139.127
MGRL-MO 168.10.129.193 168.10.129.255
MGRL-OG 168.10.139.128 168.10.139.191
-MGRL-RC 168.10.132.65 168.10.132.128
+MGRL-LC 168.10.132.65 168.10.132.128
MGRL-RV 168.10.132.0 168.10.132.64
MGRL-SH 168.10.132.129 168.10.132.191
MGRL-TW 168.10.139.192 168.10.139.255
@@ -311,7 +311,7 @@
MGRL-MA 168.13.136.1 168.13.136.254
MGRL-MO 168.13.137.1 168.13.137.254
MGRL-OG 168.13.138.1 168.13.138.254
-MGRL-RC 168.13.140.1 168.13.140.254
+MGRL-LC 168.13.140.1 168.13.140.254
MGRL-RO 168.13.131.1 168.13.131.254
MGRL-RV 168.13.139.1 168.13.139.254
MGRL-SH 168.13.141.1 168.13.141.254
Modified: branches/acq-experiment/Evergreen/src/javascript/backend/circ/circ_item_config.js
===================================================================
--- branches/acq-experiment/Evergreen/src/javascript/backend/circ/circ_item_config.js 2008-05-29 22:23:31 UTC (rev 9730)
+++ branches/acq-experiment/Evergreen/src/javascript/backend/circ/circ_item_config.js 2008-05-29 22:27:08 UTC (rev 9731)
@@ -360,7 +360,7 @@
SIPMediaType : '005',
magneticMedia : 'f',
durationRule : '14_days_2_renew',
- recurringFinesRule : '10_cent_per_day',
+ recurringFinesRule : '10_cent_per_day',
maxFine : 'overdue_mid'
},
@@ -377,10 +377,17 @@
SIPMediaType : '001',
magneticMedia : 'f',
durationRule : '7_days_2_renew',
- recurringFinesRule : '10_cent_per_day',
+ recurringFinesRule : '10_cent_per_day',
maxFine : 'overdue_mid'
},
+ 'eventpass' : {
+ SIPMediaType : '001',
+ magneticMedia : 'f',
+ durationRule : '7_day_1_renew',
+ recurringFinesRule : '3_dollar_per_day',
+ maxFine : 'overdue_mid'
+ },
}
Modified: branches/acq-experiment/Evergreen/src/javascript/backend/circ/circ_permit_hold.js
===================================================================
--- branches/acq-experiment/Evergreen/src/javascript/backend/circ/circ_permit_hold.js 2008-05-29 22:23:31 UTC (rev 9730)
+++ branches/acq-experiment/Evergreen/src/javascript/backend/circ/circ_permit_hold.js 2008-05-29 22:27:08 UTC (rev 9731)
@@ -43,7 +43,7 @@
log_info("marc-type = "+marcItemType);
-if( mod == 'bestsellernh' )
+if(mod == 'bestsellernh' || mod == 'eventpass')
result.events.push('ITEM_NOT_HOLDABLE');
Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2008-05-29 22:23:31 UTC (rev 9730)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2008-05-29 22:27:08 UTC (rev 9731)
@@ -5,6 +5,8 @@
use OpenSRF::Utils::SettingsClient;
use OpenSRF::Utils::Logger qw(:logger);
use OpenILS::Const qw/:const/;
+use OpenILS::Application::AppUtils;
+my $U = "OpenILS::Application::AppUtils";
my %scripts;
my $script_libs;
@@ -154,6 +156,9 @@
# --------------------------------------------------------------------------
$circulator->is_renewal(1) if $api =~ /renew/;
$circulator->is_checkin(1) if $api =~ /checkin/;
+ $circulator->check_penalty_on_renew(1) if
+ $circulator->is_renewal and $U->ou_ancestor_setting_value(
+ $circulator->editor->requestor->ws_ou, 'circ.renew.check_penalty', $circulator->editor);
$circulator->mk_script_runner;
return circ_events($circulator) if $circulator->bail_out;
@@ -284,7 +289,6 @@
use OpenILS::Application::Circ::ScriptBuilder;
use OpenILS::Const qw/:const/;
-my $U = "OpenILS::Application::AppUtils";
my $holdcode = "OpenILS::Application::Circ::Holds";
my $transcode = "OpenILS::Application::Circ::Transit";
@@ -309,6 +313,7 @@
volume
title
is_renewal
+ check_penalty_on_renew
is_noncat
is_precat
is_checkin
@@ -548,7 +553,8 @@
$self->run_patron_permit_scripts();
$self->run_copy_permit_scripts()
unless $self->is_precat or $self->is_noncat;
- $self->override_events() unless $self->is_renewal;
+ $self->override_events() unless
+ $self->is_renewal and not $self->check_penalty_on_renew;
return if $self->bail_out;
if( $self->is_precat ) {
@@ -659,8 +665,10 @@
my $runner = $self->script_runner;
my $patronid = $self->patron->id;
- $self->send_penalty_request() unless $self->is_renewal;
+ $self->send_penalty_request() unless
+ $self->is_renewal and not $self->check_penalty_on_renew;
+
# ---------------------------------------------------------------------
# Now run the patron permit script
# ---------------------------------------------------------------------
@@ -671,14 +679,9 @@
my $patron_events = $result->{events};
my @allevents;
+ my $penalties = ($self->is_renewal and not $self->check_penalty_on_renew) ?
+ [] : $self->gather_penalty_request();
- # ---------------------------------------------------------------------
- # this is policy directly in the code, not a good idea in general, but
- # the penalty server doesn't know anything about renewals, so we
- # have to strip the event out here
- my $penalties = ($self->is_renewal) ? [] : $self->gather_penalty_request();
- # ---------------------------------------------------------------------
-
push( @allevents, OpenILS::Event->new($_)) for (@$penalties, @$patron_events);
$logger->info("circulator: permit_patron script returned events: @allevents") if @allevents;
Modified: branches/acq-experiment/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js 2008-05-29 22:23:31 UTC (rev 9730)
+++ branches/acq-experiment/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js 2008-05-29 22:27:08 UTC (rev 9731)
@@ -185,6 +185,23 @@
return false;
}
+ /** Given an org id, returns an array of org units including
+ * the org for the ID provided and all descendant orgs */
+ fieldmapper.aou.descendantNodeList = function(orgId) {
+ var list = [];
+ function addNode(node) {
+ if(!node) return;
+ list.push(node);
+ var children = node.children();
+ if(children) {
+ for(var i = 0; i < children.length; i++)
+ addNode(children[i]);
+ }
+ }
+ addNode(fieldmapper.aou.findOrgUnit(orgId));
+ return list;
+ }
+
dojo.addOnUnload( function () {
for (var i in fieldmapper.aou.OrgCache) {
x=fieldmapper.aou.OrgCache[i].treePtr;
Modified: branches/acq-experiment/Open-ILS/web/js/dojo/openils/User.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/js/dojo/openils/User.js 2008-05-29 22:23:31 UTC (rev 9730)
+++ branches/acq-experiment/Open-ILS/web/js/dojo/openils/User.js 2008-05-29 22:27:08 UTC (rev 9731)
@@ -42,7 +42,7 @@
this.login_type = kwargs.login_type;
this.location = kwargs.location;
this.authcookie = kwargs.authcookie || openils.User.authcookie;
- this.orgCache = {perm: null, store: null};
+ this.permOrgStoreCache = {}; /* permName => permOrgUnitStore map */
if (this.id && this.authtoken) this.user = this.getById( this.id );
else if (this.authtoken) this.getBySession();
@@ -170,17 +170,16 @@
* has the given permission.
*/
getPermOrgList : function(perm, onload) {
-
- var req = OpenSRF.CachedClientSession('open-ils.actor').request(
- 'open-ils.actor.user.work_perm.highest_org_set',
- this.authtoken, perm);
-
- req.oncomplete = function(r) {
- org_list = r.recv().content();
- onload(org_list);
- }
-
- req.send();
+ fieldmapper.standardRequest(
+ ['open-ils.actor', 'open-ils.actor.user.work_perm.highest_org_set'],
+ { async: true,
+ params: [this.authtoken, perm],
+ oncomplete: function(r) {
+ org_list = r.recv().content();
+ onload(org_list);
+ }
+ }
+ );
},
/**
@@ -230,33 +229,28 @@
dojo.require('dojo.data.ItemFileReadStore');
- function hookupStore(store) {
- selector.store = store;
+ function hookupStore(store) {
+ selector.store = store;
selector.startup();
selector.setValue(_u.user.ws_ou());
- }
+ }
- function buildTreePicker(r) {
- var orgList = r.recv().content();
- var store = new dojo.data.ItemFileReadStore({data:aou.toStoreData(orgList)});
- hookupStore(store);
- _u.orgCache.perm = perm;
- _u.orgCache.orgStore = store;
+ function buildTreePicker(orgList) {
+ var orgNodeList = [];
+ for(var i = 0; i < orgList.length; i++)
+ orgNodeList = orgNodeList.concat(
+ fieldmapper.aou.descendantNodeList(orgList[i]));
+
+ var store = new dojo.data.ItemFileReadStore({data:aou.toStoreData(orgNodeList)});
+ hookupStore(store);
+ _u.permOrgStoreCache[perm] = store;
}
- if (this.orgCache.orgStore && (perm == this.orgCache.perm)) {
- hookupStore(this.orgCache.orgStore);
- } else {
- fieldmapper.standardRequest(
- ['open-ils.actor', 'open-ils.actor.user.work_perm.org_unit_list'],
- { params: [this.authtoken, perm],
- oncomplete: buildTreePicker,
- async: true
- }
- )
- }
- },
-
+ if (_u.permOrgStoreCache[perm])
+ hookupStore(_u.permOrgStoreCache[perm]);
+ else
+ _u.getPermOrgList(perm, buildTreePicker);
+ }
});
openils.User.user = null;
Modified: branches/acq-experiment/Open-ILS/xul/staff_client/server/cat/copy_browser.xul
===================================================================
--- branches/acq-experiment/Open-ILS/xul/staff_client/server/cat/copy_browser.xul 2008-05-29 22:23:31 UTC (rev 9730)
+++ branches/acq-experiment/Open-ILS/xul/staff_client/server/cat/copy_browser.xul 2008-05-29 22:27:08 UTC (rev 9731)
@@ -130,7 +130,7 @@
</popupset>
<groupbox flex="1" class="my_overflow">
- <caption label="staff.cat.copy_browser.holdings_maintenance.caption"/>
+ <caption label="&staff.cat.copy_browser.holdings_maintenance.caption;"/>
<hbox><label id="legend" style="font-size: large" class="has_copies" value="&staff.cat.copy_browser.holdings_maintenance.legend;" hidden="true"/></hbox>
<hbox>
<hbox id="x_lib_menu"/>
Modified: branches/acq-experiment/Open-ILS/xul/staff_client/server/main/ws_info.xul
===================================================================
--- branches/acq-experiment/Open-ILS/xul/staff_client/server/main/ws_info.xul 2008-05-29 22:23:31 UTC (rev 9730)
+++ branches/acq-experiment/Open-ILS/xul/staff_client/server/main/ws_info.xul 2008-05-29 22:27:08 UTC (rev 9731)
@@ -77,7 +77,7 @@
'PERM_RETRIEVE_HIGHEST_ORG',
[ xulG.auth.session.key, g.user.id(), 'REGISTER_WORKSTATION']
);
- if (highest_org_id == -1) {
+ if (highest_org_id == -1 || highest_org_id == '-1') {
alert(document.getElementById('commonStrings').getString('staff.main.gen_offline_widgets.workstation_registration_denied'));
xulG.auth.logoff();
return;
More information about the open-ils-commits
mailing list