[open-ils-commits] r15077 - in trunk/Open-ILS: examples src/perlmods/OpenILS/Application src/sql/Pg src/sql/Pg/upgrade web/opac/locale/en-US web/templates/default/conify/global web/templates/default/conify/global/booking xul/staff_client/chrome/content/main xul/staff_client/server/cat xul/staff_client/server/locale/en-US (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Dec 4 10:37:22 EST 2009
Author: miker
Date: 2009-12-04 10:37:19 -0500 (Fri, 04 Dec 2009)
New Revision: 15077
Added:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Booking.pm
trunk/Open-ILS/src/sql/Pg/upgrade/0106.booking.admin_permissions.sql
trunk/Open-ILS/web/templates/default/conify/global/booking/
trunk/Open-ILS/web/templates/default/conify/global/booking/reservation.tt2
trunk/Open-ILS/web/templates/default/conify/global/booking/reservation_attr_value_map.tt2
trunk/Open-ILS/web/templates/default/conify/global/booking/resource.tt2
trunk/Open-ILS/web/templates/default/conify/global/booking/resource_attr.tt2
trunk/Open-ILS/web/templates/default/conify/global/booking/resource_attr_map.tt2
trunk/Open-ILS/web/templates/default/conify/global/booking/resource_attr_value.tt2
trunk/Open-ILS/web/templates/default/conify/global/booking/resource_type.tt2
Modified:
trunk/Open-ILS/examples/fm_IDL.xml
trunk/Open-ILS/examples/opensrf.xml.example
trunk/Open-ILS/examples/opensrf_core.xml.example
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js
trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js
trunk/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
trunk/Open-ILS/xul/staff_client/server/cat/copy_browser.js
trunk/Open-ILS/xul/staff_client/server/cat/copy_browser.xul
trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
Log:
Patch from Lebbeous Fogle-Weekley which implements the configuration interfaces required
to support bookable resources, including the addition of cataloged materials as bookable
items. Thus spake Lebbeous:
Here it is at last. The only entry point (for now) to these interfaces
besides the "admin" menu is in the holdings maintenance / copy browser
context menu. There you can select items and create bookable resources
out of them (basically), and upon that creation you get a new tab open
in the staff client where you could further edit (in a basic, conify
way) that resource.
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2009-12-04 15:34:10 UTC (rev 15076)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2009-12-04 15:37:19 UTC (rev 15077)
@@ -2352,7 +2352,7 @@
</class>
<class id="brt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_type" oils_persist:tablename="booking.resource_type" reporter:label="Resource Type">
- <fields oils_persist:primary="id" oils_persist:sequence="booking.booking.resource_type_id_seq">
+ <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
<field reporter:label="Resource Type ID" name="id" reporter:datatype="id"/>
<field reporter:label="Resource Type Name" name="name" reporter:datatype="text"/>
<field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
@@ -2374,11 +2374,17 @@
<link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="ADMIN_BOOKING_RESOURCE_TYPE" global_required='true'/>
+ <retrieve />
+ <update permission="ADMIN_BOOKING_RESOURCE_TYPE" global_required='true'/>
+ <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" global_required='true'/>
+ </actions>
</permacrud>
</class>
<class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
- <fields oils_persist:primary="id" oils_persist:sequence="schema.booking.resource_id_seq">
+ <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
<field reporter:label="Resource ID" name="id" reporter:datatype="id"/>
<field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
<field reporter:label="Resource Type" name="type" reporter:datatype="link"/>
@@ -2399,11 +2405,17 @@
<link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="ADMIN_BOOKING_RESOURCE" global_required='true'/>
+ <retrieve />
+ <update permission="ADMIN_BOOKING_RESOURCE" global_required='true'/>
+ <delete permission="ADMIN_BOOKING_RESOURCE" global_required='true'/>
+ </actions>
</permacrud>
</class>
<class id="bra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_attr" oils_persist:tablename="booking.resource_attr" reporter:label="Resource Attribute">
- <fields oils_persist:primary="id" oils_persist:sequence="schema.booking.resource_attr_id_seq">
+ <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
<field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id"/>
<field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
<field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text"/>
@@ -2419,11 +2431,17 @@
<link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="ADMIN_BOOKING_RESOURCE_ATTR" global_required='true'/>
+ <retrieve />
+ <update permission="ADMIN_BOOKING_RESOURCE_ATTR" global_required='true'/>
+ <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" global_required='true'/>
+ </actions>
</permacrud>
</class>
<class id="brav" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_attr_value" oils_persist:tablename="booking.resource_attr_value" reporter:label="Resource Attribute Value">
- <fields oils_persist:primary="id" oils_persist:sequence="schema.booking.resource_attr_value_id_seq">
+ <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
<field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id"/>
<field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
<field reporter:label="Resource Attribute" name="attr" reporter:datatype="link"/>
@@ -2438,11 +2456,17 @@
<link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" global_required='true'/>
+ <retrieve />
+ <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" global_required='true'/>
+ <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" global_required='true'/>
+ </actions>
</permacrud>
</class>
<class id="bram" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_attr_map" oils_persist:tablename="booking.resource_attr_map" reporter:label="Resource Attribute Map">
- <fields oils_persist:primary="id" oils_persist:sequence="schema.booking.resource_attr_map_id_seq">
+ <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
<field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
<field reporter:label="Resource" name="resource" reporter:datatype="link"/>
<field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link"/>
@@ -2454,11 +2478,17 @@
<link field="value" reltype="has_a" key="id" map="" class="brav"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP" global_required='true'/>
+ <retrieve />
+ <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP" global_required='true'/>
+ <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP" global_required='true'/>
+ </actions>
</permacrud>
</class>
<class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
- <fields oils_persist:primary="id" oils_persist:sequence="schema.money.billable_xact_id_seq">
+ <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
<field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
<field reporter:label="User" name="usr" reporter:datatype="link"/>
<field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
@@ -2504,11 +2534,17 @@
<link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
+ <retrieve />
+ <update permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
+ <delete permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
+ </actions>
</permacrud>
</class>
<class id="bravm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation_attr_value_map" oils_persist:tablename="booking.reservation_attr_value_map" reporter:label="Reservation Attribute Value Map">
- <fields oils_persist:primary="id" oils_persist:sequence="schema.booking.reservation_attr_value_map_id_seq">
+ <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
<field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
<field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
<field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
@@ -2518,6 +2554,12 @@
<link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
+ <retrieve />
+ <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
+ <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
+ </actions>
</permacrud>
</class>
Modified: trunk/Open-ILS/examples/opensrf.xml.example
===================================================================
--- trunk/Open-ILS/examples/opensrf.xml.example 2009-12-04 15:34:10 UTC (rev 15076)
+++ trunk/Open-ILS/examples/opensrf.xml.example 2009-12-04 15:37:19 UTC (rev 15077)
@@ -435,6 +435,28 @@
</open-ils.actor>
+ <open-ils.booking>
+ <keepalive>5</keepalive>
+ <stateless>1</stateless>
+ <language>perl</language>
+ <implementation>OpenILS::Application::Booking</implementation>
+ <max_requests>199</max_requests>
+ <unix_config>
+ <unix_sock>open-ils.booking_unix.sock</unix_sock>
+ <unix_pid>open-ils.booking_unix.pid</unix_pid>
+ <max_requests>1000</max_requests>
+ <unix_log>open-ils.booking_unix.log</unix_log>
+ <min_children>1</min_children>
+ <max_children>15</max_children>
+ <min_spare_children>1</min_spare_children>
+ <max_spare_children>5</max_spare_children>
+ </unix_config>
+ <app_settings>
+ <marctemplates>
+ <K_book>LOCALSTATEDIR/templates/marc/k_book.xml</K_book>
+ </marctemplates>
+ </app_settings>
+ </open-ils.booking>
<open-ils.cat>
<keepalive>5</keepalive>
@@ -951,6 +973,7 @@
<appname>opensrf.math</appname>
<appname>opensrf.dbmath</appname>
<appname>open-ils.acq</appname>
+ <appname>open-ils.booking</appname>
<appname>open-ils.cat</appname>
<appname>open-ils.supercat</appname>
<appname>open-ils.search</appname>
Modified: trunk/Open-ILS/examples/opensrf_core.xml.example
===================================================================
--- trunk/Open-ILS/examples/opensrf_core.xml.example 2009-12-04 15:34:10 UTC (rev 15076)
+++ trunk/Open-ILS/examples/opensrf_core.xml.example 2009-12-04 15:37:19 UTC (rev 15077)
@@ -22,6 +22,7 @@
<service>open-ils.actor</service>
<service>open-ils.acq</service>
<service>open-ils.auth</service>
+ <service>open-ils.booking</service>
<service>open-ils.cat</service>
<service>open-ils.circ</service>
<service>open-ils.collections</service>
Added: trunk/Open-ILS/src/perlmods/OpenILS/Application/Booking.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Booking.pm (rev 0)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Booking.pm 2009-12-04 15:37:19 UTC (rev 15077)
@@ -0,0 +1,148 @@
+package OpenILS::Application::Booking;
+
+use strict;
+use warnings;
+
+use OpenILS::Application;
+use base qw/OpenILS::Application/;
+
+use OpenILS::Utils::CStoreEditor qw/:funcs/;
+use OpenILS::Utils::Fieldmapper;
+use OpenILS::Application::AppUtils;
+my $U = "OpenILS::Application::AppUtils";
+
+use OpenSRF::Utils::Logger qw/$logger/;
+
+sub prepare_new_brt {
+ my ($record_id, $owning_lib, $mvr) = @_;
+
+ my $brt = new Fieldmapper::booking::resource_type;
+ $brt->isnew(1);
+ $brt->name($mvr->title);
+ $brt->record($record_id);
+ $brt->catalog_item('t');
+ $brt->owner($owning_lib);
+
+ return $brt;
+}
+
+sub get_existing_brt {
+ my ($e, $record_id, $owning_lib, $mvr) = @_;
+ my $results = $e->search_booking_resource_type(
+ {name => $mvr->title, owner => $owning_lib, record => $record_id}
+ );
+
+ return $results->[0] if (length @$results > 0);
+ return undef;
+}
+
+sub get_mvr {
+ return $U->simplereq(
+ 'open-ils.search',
+ 'open-ils.search.biblio.record.mods_slim.retrieve.authoritative',
+ shift # record id
+ );
+}
+
+sub get_unique_owning_libs {
+ my %hash = ();
+ $hash{$_->call_number->owning_lib} = 1 foreach (@_); # @_ are copies
+ return keys %hash;
+}
+
+sub fetch_copies_by_ids {
+ my ($e, $copy_ids) = @_;
+ my $results = $e->search_asset_copy([
+ {id => $copy_ids},
+ {flesh => 1, flesh_fields => {acp => ['call_number']}}
+ ]);
+ return $results if ref($results) eq 'ARRAY';
+ return [];
+}
+
+sub get_single_record_id {
+ my $record_id = undef;
+ foreach (@_) { # @_ are copies
+ return undef if
+ (defined $record_id && $record_id != $_->call_number->record);
+ $record_id = $_->call_number->record;
+ }
+ return $record_id;
+}
+
+__PACKAGE__->register_method(
+ method => "create_brt_and_brsrc",
+ api_name => "open-ils.booking.create_brt_and_brsrc_from_copies",
+ signature => {
+ params => [
+ {type => 'string', desc => 'Authentication token'},
+ {type => 'array', desc => 'Copy IDs'},
+ ],
+ return => { desc => "A two-element hash. The 'brt' element " .
+ "is a list of created booking resource types described by " .
+ "id/copyid pairs. The 'brsrc' element is a similar " .
+ "list of created booking resources described by copy/recordid " .
+ "pairs"}
+ }
+);
+
+sub create_brt_and_brsrc {
+ my ($self, $conn, $authtoken, $copy_ids) = @_;
+ my (@created_brt, @created_brsrc);
+ my %brt_table = ();
+
+ my $e = new_editor(xact => 1, authtoken => $authtoken);
+ return $e->die_event unless $e->checkauth;
+
+ my @copies = @{fetch_copies_by_ids($e, $copy_ids)};
+ my $record_id = get_single_record_id(@copies) or return $e->die_event;
+ my $mvr = get_mvr($record_id) or return $e->die_event;
+
+ foreach (get_unique_owning_libs(@copies)) {
+ $brt_table{$_} = get_existing_brt($e, $record_id, $_, $mvr) ||
+ prepare_new_brt($record_id, $_, $mvr);
+ }
+
+ while (my ($owning_lib, $brt) = each %brt_table) {
+ if ($brt->isnew) {
+ if ($e->allowed('CREATE_BOOKING_RESOURCE_TYPE', $owning_lib)) {
+ # We can/should abort if this creation fails, because the
+ # logic isn't going to be trying to create any redundnat
+ # brt's, therefore any error will be more serious than
+ # that. See the different take on creating brsrc's below.
+ return $e->die_event unless (
+ # v-- Important: assignment modifies original hash
+ $brt = $e->create_booking_resource_type($brt)
+ );
+ }
+ push @created_brt, [$brt->id, $brt->record];
+ }
+ }
+
+ foreach (@copies) {
+ if (
+ $e->allowed('CREATE_BOOKING_RESOURCE', $_->call_number->owning_lib)
+ ) {
+ my $brsrc = new Fieldmapper::booking::resource;
+ $brsrc->isnew(1);
+ $brsrc->type($brt_table{$_->call_number->owning_lib}->id);
+ $brsrc->owner($_->call_number->owning_lib);
+ $brsrc->barcode($_->barcode);
+
+ # We don't want to abort the transaction or do anything dramatic if
+ # this fails, because quite possibly a user selected many copies on
+ # which to perform this "create booking resource" operation, and
+ # among those copies there may be some that we still need to
+ # create, and some that we don't. So we just do what we can.
+ push @created_brsrc, [$brsrc->id, $_->id] if
+ ($brsrc = $e->create_booking_resource($brsrc));
+ # ^--- Important: assignment.
+ }
+ }
+
+ $e->commit and
+ return {brt => \@created_brt, brsrc => \@created_brsrc} or
+ return $e->die_event;
+}
+
+1;
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2009-12-04 15:34:10 UTC (rev 15076)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2009-12-04 15:37:19 UTC (rev 15077)
@@ -51,7 +51,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0105'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0106'); -- senator
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2009-12-04 15:34:10 UTC (rev 15076)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2009-12-04 15:37:19 UTC (rev 15077)
@@ -1239,8 +1239,19 @@
(350, 'ADMIN_COPY_LOCATION_ORDER', oils_i18n_gettext(350, 'Allow a user to create/view/update/delete a copy location order', 'ppl', 'description')),
-- additional permissions
- (351, 'HOLD_LOCAL_AVAIL_OVERRIDE', oils_i18n_gettext(351, 'Allow a user to place a hold despite the availability of a local copy', 'ppl', 'description'));
+ (351, 'HOLD_LOCAL_AVAIL_OVERRIDE', oils_i18n_gettext(351, 'Allow a user to place a hold despite the availability of a local copy', 'ppl', 'description')),
+ (352, 'ADMIN_BOOKING_RESOURCE', oils_i18n_gettext(352, 'Enables the user to create/update/delete booking resources', 'ppl', 'description')),
+ (353, 'ADMIN_BOOKING_RESOURCE_TYPE', oils_i18n_gettext(353, 'Enables the user to create/update/delete booking resource types', 'ppl', 'description')),
+ (354, 'ADMIN_BOOKING_RESOURCE_ATTR', oils_i18n_gettext(354, 'Enables the user to create/update/delete booking resource attributes', 'ppl', 'description')),
+ (355, 'ADMIN_BOOKING_RESOURCE_ATTR_MAP', oils_i18n_gettext(355, 'Enables the user to create/update/delete booking resource attribute maps', 'ppl', 'description')),
+ (356, 'ADMIN_BOOKING_RESOURCE_ATTR_VALUE', oils_i18n_gettext(356, 'Enables the user to create/update/delete booking resource attribute values', 'ppl', 'description')),
+ (357, 'ADMIN_BOOKING_RESERVATION', oils_i18n_gettext(357, 'Enables the user to create/update/delete booking reservations', 'ppl', 'description')),
+ (358, 'ADMIN_BOOKING_RESERVATION_ATTR_VALUE_MAP', oils_i18n_gettext(358, 'Enables the user to create/update/delete booking reservation attribute value maps', 'ppl', 'description'))
+;
+
+ ;
+
SELECT SETVAL('permission.perm_list_id_seq'::TEXT, 1000);
INSERT INTO permission.grp_tree (id, name, parent, description, perm_interval, usergroup, application_perm) VALUES
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0106.booking.admin_permissions.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0106.booking.admin_permissions.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0106.booking.admin_permissions.sql 2009-12-04 15:37:19 UTC (rev 15077)
@@ -0,0 +1,15 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0106'); -- senator
+
+INSERT INTO permission.perm_list (id, code, description) VALUES
+ (352, 'ADMIN_BOOKING_RESOURCE', oils_i18n_gettext(352, 'Enables the user to create/update/delete booking resources', 'ppl', 'description')),
+ (353, 'ADMIN_BOOKING_RESOURCE_TYPE', oils_i18n_gettext(353, 'Enables the user to create/update/delete booking resource types', 'ppl', 'description')),
+ (354, 'ADMIN_BOOKING_RESOURCE_ATTR', oils_i18n_gettext(354, 'Enables the user to create/update/delete booking resource attributes', 'ppl', 'description')),
+ (355, 'ADMIN_BOOKING_RESOURCE_ATTR_MAP', oils_i18n_gettext(355, 'Enables the user to create/update/delete booking resource attribute maps', 'ppl', 'description')),
+ (356, 'ADMIN_BOOKING_RESOURCE_ATTR_VALUE', oils_i18n_gettext(356, 'Enables the user to create/update/delete booking resource attribute values', 'ppl', 'description')),
+ (357, 'ADMIN_BOOKING_RESERVATION', oils_i18n_gettext(357, 'Enables the user to create/update/delete booking reservations', 'ppl', 'description')),
+ (358, 'ADMIN_BOOKING_RESERVATION_ATTR_VALUE_MAP', oils_i18n_gettext(358, 'Enables the user to create/update/delete booking reservation attribute value maps', 'ppl', 'description'))
+;
+
+COMMIT;
Modified: trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2009-12-04 15:34:10 UTC (rev 15076)
+++ trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2009-12-04 15:37:19 UTC (rev 15077)
@@ -272,6 +272,8 @@
<!ENTITY staff.cat.opac.delete_record.label "Delete Record">
<!ENTITY staff.cat.opac.undelete_record.accesskey "U">
<!ENTITY staff.cat.opac.undelete_record.label "Undelete Record">
+<!ENTITY staff.cat.opac.create_brt_from_record.accesskey "T">
+<!ENTITY staff.cat.opac.create_brt_from_record.label "Create Booking Resource From Copy">
<!ENTITY staff.cat.opac.menu.accesskey "A">
<!ENTITY staff.cat.opac.menu.label "Actions for this Record">
<!ENTITY staff.cat.opac.opac_view.accesskey "O">
@@ -666,6 +668,22 @@
<!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.booking.label "Booking">
+<!ENTITY staff.main.menu.admin.server_admin.booking.accesskey "B">
+<!ENTITY staff.main.menu.admin.server_admin.booking.resource.label "Resources">
+<!ENTITY staff.main.menu.admin.server_admin.booking.resource.accesskey "R">
+<!ENTITY staff.main.menu.admin.server_admin.booking.resource_type.label "Resource Types">
+<!ENTITY staff.main.menu.admin.server_admin.booking.resource_type.accesskey "T">
+<!ENTITY staff.main.menu.admin.server_admin.booking.resource_attr.label "Resource Attributes">
+<!ENTITY staff.main.menu.admin.server_admin.booking.resource_attr.accesskey "A">
+<!ENTITY staff.main.menu.admin.server_admin.booking.resource_attr_value.label "Resource Attribute Values">
+<!ENTITY staff.main.menu.admin.server_admin.booking.resource_attr_value.accesskey "V">
+<!ENTITY staff.main.menu.admin.server_admin.booking.resource_attr_map.label "Resource Attribute Maps">
+<!ENTITY staff.main.menu.admin.server_admin.booking.resource_attr_map.accesskey "M">
+<!ENTITY staff.main.menu.admin.server_admin.booking.reservation.label "Reservations">
+<!ENTITY staff.main.menu.admin.server_admin.booking.reservation.accesskey "N">
+<!ENTITY staff.main.menu.admin.server_admin.booking.reservation_attr_value_map.label "Reservation Attribute Value Maps">
+<!ENTITY staff.main.menu.admin.server_admin.booking.reservation_attr_value_map.accesskey "B">
<!ENTITY staff.main.menu.admin.developer.label "For developers...">
<!ENTITY staff.main.menu.admin.download_patrons.accesskey "D">
@@ -2115,6 +2133,8 @@
<!ENTITY staff.cat.copy_browser.actions.cmd_add_items_to_buckets.accesskey "B">
<!ENTITY staff.cat.copy_browser.actions.sel_copy_details.label "Show Item Details">
<!ENTITY staff.cat.copy_browser.actions.sel_copy_details.accesskey "I">
+<!ENTITY staff.cat.copy_browser.actions.cmd_create_brt.label "Create Booking Resource Type from this Record">
+<!ENTITY staff.cat.copy_browser.actions.cmd_create_brt.accesskey "Y">
<!ENTITY staff.cat.copy_browser.actions.sel_patron.label "Show Last Few Circulations">
<!ENTITY staff.cat.copy_browser.actions.sel_patron.accesskey "L">
<!ENTITY staff.cat.copy_browser.actions.cmd_edit_items.label "Edit Item Attributes">
@@ -2162,6 +2182,9 @@
<!ENTITY staff.cat.copy_browser.holdings_maintenance.add_items_to_bucket.accesskey "B">
<!ENTITY staff.cat.copy_browser.holdings_maintenance.sel_copy_details.label "Show Item Details">
<!ENTITY staff.cat.copy_browser.holdings_maintenance.sel_copy_details.accesskey "I">
+<!ENTITY staff.cat.copy_browser.holdings_maintenance.cmd_create_brt.label "Create Booking Resource Type from this Record">
+<!ENTITY staff.cat.copy_browser.holdings_maintenance.cmd_create_brt.accesskey "Y">
+
<!ENTITY staff.cat.copy_browser.holdings_maintenance.sel_patron.label "Show Last Few Circulations">
<!ENTITY staff.cat.copy_browser.holdings_maintenance.sel_patron.accesskey "L">
<!ENTITY staff.cat.copy_browser.holdings_maintenance.cmd_edit_items.label "Edit Item Attributes">
Added: trunk/Open-ILS/web/templates/default/conify/global/booking/reservation.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/booking/reservation.tt2 (rev 0)
+++ trunk/Open-ILS/web/templates/default/conify/global/booking/reservation.tt2 2009-12-04 15:37:19 UTC (rev 15077)
@@ -0,0 +1,39 @@
+[% WRAPPER default/base.tt2 %]
+[% ctx.page_title = 'Reservations' %]
+
+<script type ="text/javascript">
+ dojo.require('dijit.form.FilteringSelect');
+ dojo.require('openils.widget.AutoGrid');
+
+ openils.Util.addOnLoad(
+ function() {
+ ustGrid.loadAll({order_by:{bresv : 'name'}});
+ }
+ );
+</script>
+
+
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
+ <div>Reservations</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='ustGrid.showCreateDialog()'>New Reservation</button>
+ <button dojoType='dijit.form.Button' onClick='ustGrid.deleteSelected()'>Delete Selected</button>
+ </div>
+</div>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <table jsId="ustGrid"
+ autoHeight='true'
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['name', 'fine_interval', 'fine_amount',
+ 'owner', 'catalog_item', 'transferable', 'record']"
+ query="{name: '*'}"
+ defaultCellWidth='"auto"'
+ fmClass='bresv'
+ showPaginator='true'
+ editOnEnter='true'>
+ </table>
+ </div>
+
+[% END %]
Added: trunk/Open-ILS/web/templates/default/conify/global/booking/reservation_attr_value_map.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/booking/reservation_attr_value_map.tt2 (rev 0)
+++ trunk/Open-ILS/web/templates/default/conify/global/booking/reservation_attr_value_map.tt2 2009-12-04 15:37:19 UTC (rev 15077)
@@ -0,0 +1,39 @@
+[% WRAPPER default/base.tt2 %]
+[% ctx.page_title = 'Reservation Attribute Value Maps' %]
+
+<script type ="text/javascript">
+ dojo.require('dijit.form.FilteringSelect');
+ dojo.require('openils.widget.AutoGrid');
+
+ openils.Util.addOnLoad(
+ function() {
+ ustGrid.loadAll({order_by:{bravm : 'name'}});
+ }
+ );
+</script>
+
+
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
+ <div>Reservation Attribute Value Maps</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='ustGrid.showCreateDialog()'>New Reservation Attribute Value Map</button>
+ <button dojoType='dijit.form.Button' onClick='ustGrid.deleteSelected()'>Delete Selected</button>
+ </div>
+</div>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <table jsId="ustGrid"
+ autoHeight='true'
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['name', 'fine_interval', 'fine_amount',
+ 'owner', 'catalog_item', 'transferable', 'record']"
+ query="{name: '*'}"
+ defaultCellWidth='"auto"'
+ fmClass='bravm'
+ showPaginator='true'
+ editOnEnter='true'>
+ </table>
+ </div>
+
+[% END %]
Added: trunk/Open-ILS/web/templates/default/conify/global/booking/resource.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/booking/resource.tt2 (rev 0)
+++ trunk/Open-ILS/web/templates/default/conify/global/booking/resource.tt2 2009-12-04 15:37:19 UTC (rev 15077)
@@ -0,0 +1,57 @@
+[% WRAPPER default/base.tt2 %]
+[% ctx.page_title = 'Resources' %]
+
+<script src="/opac/common/js/CGI.js" type="text/javascript"></script>
+<script type ="text/javascript">
+ dojo.require('dijit.form.FilteringSelect');
+ dojo.require('openils.widget.AutoGrid');
+ dojo.require('openils.XUL');
+
+ function get_brsrc_ids() {
+ var cgi = new CGI();
+ var results = JSON2js(cgi.param('results'));
+ if (!results) return undefined;
+ var brsrc_ids = [];
+ for (var i in results) {
+ brsrc_ids.push(results[i][0]);
+ }
+ return brsrc_ids;
+ }
+
+ openils.Util.addOnLoad(
+ function() {
+ var search = undefined; // default to all objs
+ var brsrc_ids = get_brsrc_ids();
+ if (brsrc_ids) {
+ search = {id: brsrc_ids};
+ }
+ ustGrid.loadAll({order_by:{brsrc : 'barcode'}}, search);
+ }
+ );
+</script>
+
+
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
+ <div>Resources</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='ustGrid.showCreateDialog()'>New Resource</button>
+ <button dojoType='dijit.form.Button' onClick='ustGrid.deleteSelected()'>Delete Selected</button>
+ </div>
+</div>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <table jsId="ustGrid"
+ autoHeight='true'
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['owner', 'type', 'barcode',
+ 'overbook', 'deposit', 'deposit_amount', 'user_fee']"
+ query="{name: '*'}"
+ defaultCellWidth='"auto"'
+ fmClass='brsrc'
+ showPaginator='true'
+ editOnEnter='true'>
+ </table>
+ </div>
+
+[% END %]
Added: trunk/Open-ILS/web/templates/default/conify/global/booking/resource_attr.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/booking/resource_attr.tt2 (rev 0)
+++ trunk/Open-ILS/web/templates/default/conify/global/booking/resource_attr.tt2 2009-12-04 15:37:19 UTC (rev 15077)
@@ -0,0 +1,39 @@
+[% WRAPPER default/base.tt2 %]
+[% ctx.page_title = 'Resource Attributes' %]
+
+<script type ="text/javascript">
+ dojo.require('dijit.form.FilteringSelect');
+ dojo.require('openils.widget.AutoGrid');
+
+ openils.Util.addOnLoad(
+ function() {
+ ustGrid.loadAll({order_by:{bra : 'name'}});
+ }
+ );
+</script>
+
+
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
+ <div>Resource Attributes</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='ustGrid.showCreateDialog()'>New Resource Attribute</button>
+ <button dojoType='dijit.form.Button' onClick='ustGrid.deleteSelected()'>Delete Selected</button>
+ </div>
+</div>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <table jsId="ustGrid"
+ autoHeight='true'
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['name', 'fine_interval', 'fine_amount',
+ 'owner', 'catalog_item', 'transferable', 'record']"
+ query="{name: '*'}"
+ defaultCellWidth='"auto"'
+ fmClass='bra'
+ showPaginator='true'
+ editOnEnter='true'>
+ </table>
+ </div>
+
+[% END %]
Added: trunk/Open-ILS/web/templates/default/conify/global/booking/resource_attr_map.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/booking/resource_attr_map.tt2 (rev 0)
+++ trunk/Open-ILS/web/templates/default/conify/global/booking/resource_attr_map.tt2 2009-12-04 15:37:19 UTC (rev 15077)
@@ -0,0 +1,39 @@
+[% WRAPPER default/base.tt2 %]
+[% ctx.page_title = 'Resource Attribute Maps' %]
+
+<script type ="text/javascript">
+ dojo.require('dijit.form.FilteringSelect');
+ dojo.require('openils.widget.AutoGrid');
+
+ openils.Util.addOnLoad(
+ function() {
+ ustGrid.loadAll({order_by:{bram : 'name'}});
+ }
+ );
+</script>
+
+
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
+ <div>Resource Attribute Maps</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='ustGrid.showCreateDialog()'>New Resource Attribute Map</button>
+ <button dojoType='dijit.form.Button' onClick='ustGrid.deleteSelected()'>Delete Selected</button>
+ </div>
+</div>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <table jsId="ustGrid"
+ autoHeight='true'
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['name', 'fine_interval', 'fine_amount',
+ 'owner', 'catalog_item', 'transferable', 'record']"
+ query="{name: '*'}"
+ defaultCellWidth='"auto"'
+ fmClass='bram'
+ showPaginator='true'
+ editOnEnter='true'>
+ </table>
+ </div>
+
+[% END %]
Added: trunk/Open-ILS/web/templates/default/conify/global/booking/resource_attr_value.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/booking/resource_attr_value.tt2 (rev 0)
+++ trunk/Open-ILS/web/templates/default/conify/global/booking/resource_attr_value.tt2 2009-12-04 15:37:19 UTC (rev 15077)
@@ -0,0 +1,39 @@
+[% WRAPPER default/base.tt2 %]
+[% ctx.page_title = 'Resource Attribute Values' %]
+
+<script type ="text/javascript">
+ dojo.require('dijit.form.FilteringSelect');
+ dojo.require('openils.widget.AutoGrid');
+
+ openils.Util.addOnLoad(
+ function() {
+ ustGrid.loadAll({order_by:{brav : 'name'}});
+ }
+ );
+</script>
+
+
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
+ <div>Resource Attribute Values</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='ustGrid.showCreateDialog()'>New Resource Attribute Value</button>
+ <button dojoType='dijit.form.Button' onClick='ustGrid.deleteSelected()'>Delete Selected</button>
+ </div>
+</div>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <table jsId="ustGrid"
+ autoHeight='true'
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['name', 'fine_interval', 'fine_amount',
+ 'owner', 'catalog_item', 'transferable', 'record']"
+ query="{name: '*'}"
+ defaultCellWidth='"auto"'
+ fmClass='brav'
+ showPaginator='true'
+ editOnEnter='true'>
+ </table>
+ </div>
+
+[% END %]
Added: trunk/Open-ILS/web/templates/default/conify/global/booking/resource_type.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/booking/resource_type.tt2 (rev 0)
+++ trunk/Open-ILS/web/templates/default/conify/global/booking/resource_type.tt2 2009-12-04 15:37:19 UTC (rev 15077)
@@ -0,0 +1,39 @@
+[% WRAPPER default/base.tt2 %]
+[% ctx.page_title = 'Resource Types' %]
+
+<script type ="text/javascript">
+ dojo.require('dijit.form.FilteringSelect');
+ dojo.require('openils.widget.AutoGrid');
+
+ openils.Util.addOnLoad(
+ function() {
+ ustGrid.loadAll({order_by:{brt : 'name'}});
+ }
+ );
+</script>
+
+
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
+ <div>Resource Types</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='ustGrid.showCreateDialog()'>New Resource Type</button>
+ <button dojoType='dijit.form.Button' onClick='ustGrid.deleteSelected()'>Delete Selected</button>
+ </div>
+</div>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <table jsId="ustGrid"
+ autoHeight='true'
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['name', 'fine_interval', 'fine_amount',
+ 'owner', 'catalog_item', 'transferable', 'record']"
+ query="{name: '*'}"
+ defaultCellWidth='"auto"'
+ fmClass='brt'
+ showPaginator='true'
+ editOnEnter='true'>
+ </table>
+ </div>
+
+[% END %]
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js 2009-12-04 15:34:10 UTC (rev 15076)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js 2009-12-04 15:37:19 UTC (rev 15077)
@@ -174,6 +174,7 @@
'FM_AUSP_REMOVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.penalty.remove' },
'FM_AUSP_PCRUD_UPDATE' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.update.ausp', 'secure' : false },
'FM_AUSP_UPDATE_NOTE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.penalty.note.update' },
+ 'FM_BOOKING_CREATE_BRT_AND_BRSRC' : { 'app' : 'open-ils.booking', 'method' : 'open-ils.booking.create_brt_and_brsrc_from_copies' },
'FM_BRE_RETRIEVE_VIA_ID' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record.metadata.retrieve', 'secure' : false },
'FM_BRE_RETRIEVE_VIA_ID.authoritative' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record.metadata.retrieve.authoritative', 'secure' : false },
'FM_BRE_ID_SEARCH_VIA_BARCODE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.find_by_barcode', 'secure' : false },
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js 2009-12-04 15:34:10 UTC (rev 15076)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js 2009-12-04 15:37:19 UTC (rev 15077)
@@ -626,6 +626,34 @@
['oncommand'],
function() { open_eg_web_page('conify/global/config/usr_setting_type'); }
],
+ 'cmd_server_admin_booking_resource': [
+ ['oncommand'],
+ function() { open_eg_web_page('conify/global/booking/resource'); }
+ ],
+ 'cmd_server_admin_booking_resource_type': [
+ ['oncommand'],
+ function() { open_eg_web_page('conify/global/booking/resource_type'); }
+ ],
+ 'cmd_server_admin_booking_resource_attr': [
+ ['oncommand'],
+ function() { open_eg_web_page('conify/global/booking/resource_attr'); }
+ ],
+ 'cmd_server_admin_booking_resource_attr_value': [
+ ['oncommand'],
+ function() { open_eg_web_page('conify/global/booking/resource_attr_value'); }
+ ],
+ 'cmd_server_admin_booking_resource_attr_map': [
+ ['oncommand'],
+ function() { open_eg_web_page('conify/global/booking/resource_attr_map'); }
+ ],
+ 'cmd_server_admin_booking_reservation': [
+ ['oncommand'],
+ function() { open_eg_web_page('conify/global/booking/reservation'); }
+ ],
+ 'cmd_server_admin_booking_reservation_attr_value_map': [
+ ['oncommand'],
+ function() { open_eg_web_page('conify/global/booking/reservation_attr_value_map'); }
+ ],
'cmd_acq_view_picklist' : [
['oncommand'],
function() { open_eg_web_page('acq/picklist/list', 'menu.cmd_acq_view_picklist.tab'); }
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul 2009-12-04 15:34:10 UTC (rev 15076)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul 2009-12-04 15:37:19 UTC (rev 15077)
@@ -122,6 +122,13 @@
<command id="cmd_server_admin_circ_mod"/>
<command id="cmd_server_admin_org_unit_setting_type"/>
<command id="cmd_server_admin_usr_setting_type"/>
+ <command id="cmd_server_admin_booking_resource" />
+ <command id="cmd_server_admin_booking_resource_type" />
+ <command id="cmd_server_admin_booking_resource_attr" />
+ <command id="cmd_server_admin_booking_resource_attr_value" />
+ <command id="cmd_server_admin_booking_resource_attr_map" />
+ <command id="cmd_server_admin_booking_reservation" />
+ <command id="cmd_server_admin_booking_reservation_attr_value_map" />
</commandset>
@@ -317,6 +324,17 @@
<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;">
+ <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;"/>
+ <menuitem label="&staff.main.menu.admin.server_admin.booking.resource_attr.label;" command="cmd_server_admin_booking_resource_attr" accesskey="&staff.main.menu.admin.server_admin.booking.resource_attr.accesskey;"/>
+ <menuitem label="&staff.main.menu.admin.server_admin.booking.resource_attr_value.label;" command="cmd_server_admin_booking_resource_attr_value" accesskey="&staff.main.menu.admin.server_admin.booking.resource_attr_value.accesskey;"/>
+ <menuitem label="&staff.main.menu.admin.server_admin.booking.resource_attr_map.label;" command="cmd_server_admin_booking_resource_attr_map" accesskey="&staff.main.menu.admin.server_admin.booking.resource_attr_map.accesskey;"/>
+ <menuitem label="&staff.main.menu.admin.server_admin.booking.reservation.label;" command="cmd_server_admin_booking_reservation" accesskey="&staff.main.menu.admin.server_admin.booking.reservation.accesskey;"/>
+ <menuitem label="&staff.main.menu.admin.server_admin.booking.reservation_attr_value_map.label;" command="cmd_server_admin_booking_reservation_attr_value_map" accesskey="&staff.main.menu.admin.server_admin.booking.reservation_attr_value_map.accesskey;"/>
+ </menupopup>
+ </menu>
</menupopup>
</menu>
Modified: trunk/Open-ILS/xul/staff_client/server/cat/copy_browser.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/copy_browser.js 2009-12-04 15:34:10 UTC (rev 15076)
+++ trunk/Open-ILS/xul/staff_client/server/cat/copy_browser.js 2009-12-04 15:37:19 UTC (rev 15077)
@@ -142,6 +142,69 @@
);
}
],
+ 'cmd_create_brt' : [
+ ['command'],
+ function() {
+ JSAN.use('util.functional');
+ var cs = document.getElementById('catStrings');
+ // Filter out selected rows that aren't copies.
+ var list = util.functional.filter_list(
+ obj.sel_list,
+ function (o) {
+ return o.split(/_/)[0] == 'acp';
+ }
+ );
+ // Get the IDs of all copy rows.
+ var copy_ids = util.functional.map_list(
+ list, function (o) {
+ return obj.map_acp[o].id();
+ }
+ );
+ // Ask the ML to create brt's and brsrc's.
+ var results = fieldmapper.standardRequest(
+ ['open-ils.booking', 'open-ils.booking.create_brt_and_brsrc_from_copies'],
+ [ses(), copy_ids]
+ );
+ if (results == null) {
+ alert(cs.getString('staff.cat.copy_browser.brt_and_brsrc.create_failed_silent'));
+ }
+ else if (typeof results.ilsevent != 'undefined') {
+ // FIXME Isn't there a more standardized
+ // way to show this error?
+ alert(cs.getFormattedString(
+ 'staff.cat.copy_browser.brt_and_brsrc.create_failed',
+ [results.ilsevent, results.textcode,
+ results.desc, results.debug]
+ ));
+ } else {
+ // Spawn new tab to allow editing new
+ // resources.
+ try {
+ var url = urls.XUL_BROWSER + '?url=' +
+ window.escape(
+ xulG.url_prefix(urls.EG_WEB_BASE) +
+ '/conify/global/booking/resource?results=' +
+ window.escape(js2JSON(results['brsrc']))
+ );
+ // Sorry about the CGI params, but I
+ // don't see another choice for
+ // passing data to conify pages. This
+ // has the obvious problem of a
+ // character length limit. FIXME
+ xulG.new_tab(url,
+ {'tab_name': cs.getString('staff.cat.copy_browser.brt_and_brsrc.newtab_name'),
+ 'browser' : false},
+ {'no_xulG' : false}
+ );
+ } catch(E) {
+ JSAN.use('util.error');
+ var error = new util.error;
+ var f = error.standard_unexpected_error_alert;
+ f(cs.getString('staff.cat.copy_browser.brt_and_brsrc.newtab_failed'), E);
+ }
+ }
+ }
+ ],
'cmd_add_items' : [
['command'],
function() {
@@ -1613,6 +1676,7 @@
obj.controller.view.cmd_transfer_volume.setAttribute('disabled','true');
obj.controller.view.cmd_transfer_items.setAttribute('disabled','true');
obj.controller.view.sel_copy_details.setAttribute('disabled','true');
+ obj.controller.view.cmd_create_brt.setAttribute('disabled','true');
obj.controller.view.sel_patron.setAttribute('disabled','true');
obj.controller.view.sel_mark_items_damaged.setAttribute('disabled','true');
obj.controller.view.sel_mark_items_missing.setAttribute('disabled','true');
@@ -1637,6 +1701,7 @@
obj.controller.view.cmd_print_spine_labels.setAttribute('disabled','false');
obj.controller.view.cmd_transfer_items.setAttribute('disabled','false');
obj.controller.view.sel_copy_details.setAttribute('disabled','false');
+ obj.controller.view.cmd_create_brt.setAttribute('disabled','false');
obj.controller.view.sel_patron.setAttribute('disabled','false');
}
} catch(E) {
Modified: trunk/Open-ILS/xul/staff_client/server/cat/copy_browser.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/copy_browser.xul 2009-12-04 15:34:10 UTC (rev 15076)
+++ trunk/Open-ILS/xul/staff_client/server/cat/copy_browser.xul 2009-12-04 15:37:19 UTC (rev 15077)
@@ -72,6 +72,7 @@
<command id="save_columns" />
<command id="cmd_broken" />
<command id="sel_copy_details"/>
+ <command id="cmd_create_brt"/>
<command id="sel_patron"/>
<command id="sel_clip" />
<command id="cmd_clear" />
@@ -102,6 +103,7 @@
<menuitem command="sel_clip" label="&staff.cat.copy_browser.actions.sel_clip.label;" accesskey="&staff.cat.copy_browser.actions.sel_clip.accesskey;"/>
<menuitem command="cmd_add_items_to_buckets" label="&staff.cat.copy_browser.actions.cmd_add_items_to_buckets.label;" accesskey="&staff.cat.copy_browser.actions.cmd_add_items_to_buckets.accesskey;"/>
<menuitem command="sel_copy_details" label="&staff.cat.copy_browser.actions.sel_copy_details.label;" accesskey="&staff.cat.copy_browser.actions.sel_copy_details.label;" />
+ <menuitem command="cmd_create_brt" label="&staff.cat.copy_browser.actions.cmd_create_brt.label;" accesskey="&staff.cat.copy_browser.actions.cmd_create_brt.accesskey;" />
<menuitem command="sel_patron" label="&staff.cat.copy_browser.actions.sel_patron.label;" accesskey="&staff.cat.copy_browser.actions.sel_patron.accesskey;"/>
<menuseparator/>
<menuitem command="cmd_edit_items" label="&staff.cat.copy_browser.actions.cmd_edit_items.label;" accesskey="&staff.cat.copy_browser.actions.cmd_edit_items.accesskey;"/>
@@ -153,6 +155,7 @@
<menuitem command="sel_clip" label="&staff.cat.copy_browser.holdings_maintenance.sel_clip.label;" accesskey="&staff.cat.copy_browser.holdings_maintenance.sel_clip.accesskey;"/>
<menuitem command="cmd_add_items_to_buckets" label="&staff.cat.copy_browser.holdings_maintenance.add_items_to_bucket.label;" accesskey="&staff.cat.copy_browser.holdings_maintenance.add_items_to_bucket.accesskey;"/>
<menuitem command="sel_copy_details" label="&staff.cat.copy_browser.holdings_maintenance.sel_copy_details.label;" accesskey="&staff.cat.copy_browser.holdings_maintenance.sel_copy_details.accesskey;" />
+ <menuitem command="cmd_create_brt" label="&staff.cat.copy_browser.holdings_maintenance.cmd_create_brt.label;" accesskey="&staff.cat.copy_browser.holdings_maintenance.cmd_create_brt.accesskey;" />
<menuitem command="sel_patron" label="&staff.cat.copy_browser.holdings_maintenance.sel_patron.label;" accesskey="&staff.cat.copy_browser.holdings_maintenance.sel_patron.accesskey;"/>
<menuseparator/>
<menuitem command="cmd_edit_items" label="&staff.cat.copy_browser.holdings_maintenance.cmd_edit_items.label;" accesskey="&staff.cat.copy_browser.holdings_maintenance.cmd_edit_items.accesskey;"/>
Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties 2009-12-04 15:34:10 UTC (rev 15076)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties 2009-12-04 15:37:19 UTC (rev 15077)
@@ -12,6 +12,10 @@
staff.cat.copy_browser.add_item.title=Add Item
staff.cat.copy_browser.add_item.error=copy browser -> add copies
staff.cat.copy_browser.add_items_bucket.error=copy browser -> add copies to bucket
+staff.cat.copy_browser.brt_and_brsrc.create_failed_silent=No response from server
+staff.cat.copy_browser.brt_and_brsrc.create_failed=Error from server: %1$d %2$s\n%3$s\n%4$s
+staff.cat.copy_browser.brt_and_brsrc.newtab_failed=Could not launch Booking Resource Editor: %1$s
+staff.cat.copy_browser.brt_and_brsrc.newtab_name=Resources
staff.cat.copy_browser.replace_barcode.failed=Barcode %1$s not likely replaced.
staff.cat.copy_browser.replace_barcode.error=copy browser -> replace barcode
staff.cat.copy_browser.edit_items.error=Copy Browser -> Edit Items
More information about the open-ils-commits
mailing list