[open-ils-commits] [GIT] Evergreen ILS branch master updated. cd8b69e427b5a85085e2082ee198c2a0e2cdf50c

Evergreen Git git at git.evergreen-ils.org
Thu Oct 18 17:05:34 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  cd8b69e427b5a85085e2082ee198c2a0e2cdf50c (commit)
      from  6df036b3b385321dea22bc0be9aa3b1c396760db (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cd8b69e427b5a85085e2082ee198c2a0e2cdf50c
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Tue Apr 24 16:54:20 2012 -0400

    Admin -> Local Admin -> Item Attribute Editor
    
    Main purpose is to allow you to spawn the Item Attribute Editor for the purpose
    of configuring templates and using the Hide Fields feature without actually
    finding an item to work and putting it at risk of accidental modification.
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd
index 1ef0eb3..70063d8 100644
--- a/Open-ILS/web/opac/locale/en-US/lang.dtd
+++ b/Open-ILS/web/opac/locale/en-US/lang.dtd
@@ -741,6 +741,8 @@
 <!ENTITY staff.main.menu.admin.local_admin.work_log.accesskey "W">
 <!ENTITY staff.main.menu.admin.local_admin.copy_template.label "Copy Template Editor">
 <!ENTITY staff.main.menu.admin.local_admin.copy_template.accesskey "T">
+<!ENTITY staff.main.menu.admin.local_admin.item_attribute_editor.label "Item Attribute Editor">
+<!ENTITY staff.main.menu.admin.local_admin.item_attribute_editor.accesskey "E">
 <!ENTITY staff.main.menu.admin.local_admin.patrons_due_refunds.label "Patrons with Negative Balances">
 <!ENTITY staff.main.menu.admin.local_admin.patrons_due_refunds.accesskey "N">
 <!ENTITY staff.main.menu.admin.local_admin.address_alert.label "Address Alerts">
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js
index 7b781a1..f94e9ed 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js
+++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js
@@ -860,6 +860,17 @@ main.menu.prototype = {
                     open_eg_web_page("conify/global/asset/copy_template");
                 }
             ],
+            "cmd_local_admin_item_attribute_editor": [
+                ["oncommand"],
+                function(event) {
+                    obj.command_tab(
+                        event,
+                        urls.XUL_COPY_EDITOR,
+                        { 'tab_name' : offlineStrings.getString('menu.local_admin.item_attribute_editor.tab') },
+                        { 'admin' : true, 'not_modal' : true }
+                    );
+                }
+            ],
             'cmd_local_admin_patrons_due_refunds' : [
                 ['oncommand'],
                 function(event) {
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
index 58caf07..2e984d7 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
+++ b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
@@ -149,6 +149,7 @@
     <command id="cmd_local_admin_work_log" />
     <command id="cmd_local_admin_patrons_due_refunds" />
     <command id="cmd_local_admin_copy_template" />
+    <command id="cmd_local_admin_item_attribute_editor" />
     <command id="cmd_local_admin_address_alert"
              perm="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT" />
     <command id="cmd_local_admin_circ_limit_set"
@@ -510,6 +511,7 @@
                 <menuitem label="&staff.main.menu.admin.local_admin.conify.copy_location_order.label;" command="cmd_local_admin_copy_location_order"/>
                 <menuitem label="&staff.main.menu.admin.local_admin.copy_location_group.label;" command="cmd_local_admin_copy_location_group"/>
                 <menuitem label="&staff.main.menu.admin.local_admin.copy_template.label;" accesskey="&staff.main.menu.admin.local_admin.copy_template.accesskey;" command="cmd_local_admin_copy_template"/>
+                <menuitem label="&staff.main.menu.admin.local_admin.item_attribute_editor.label;" accesskey="&staff.main.menu.admin.local_admin.item_attribute_editor.accesskey;" command="cmd_local_admin_item_attribute_editor"/>
                 <menuitem label="&staff.main.menu.admin.local_admin.conify.idl_field_doc.label;" command="cmd_local_admin_idl_field_doc"/>
                 <menuitem label="&staff.main.menu.admin.local_admin.conify.grp_penalty_threshold.label;" command="cmd_local_admin_grp_penalty_threshold"/>
                 <menuitem label="&staff.main.menu.admin.local_admin.hold_matrix_matchpoint.label;" command="cmd_local_admin_hold_matrix_matchpoint"/>
diff --git a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
index 8a44950..2405b95 100644
--- a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
+++ b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
@@ -261,6 +261,7 @@ menu.cmd_search_prefs.tab=Search Preferences
 menu.local_admin.barcode_completion.tab=Barcode Completion
 menu.local_admin.circ_matrix_matchpoint.tab=Circulation Policies
 menu.local_admin.hold_matrix_matchpoint.tab=Hold Policies
+menu.local_admin.item_attribute_editor.tab=Admin Item Attribute Editor
 menu.local_admin.work_log.tab=Work Log
 menu.local_admin.patrons_due_refunds.tab=Patrons With Negative Balances
 menu.circulation.staged_patrons.tab=Pending Patrons
diff --git a/Open-ILS/xul/staff_client/server/cat/copy_editor.js b/Open-ILS/xul/staff_client/server/cat/copy_editor.js
index e430b8e..3e701ec 100644
--- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js
+++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js
@@ -53,6 +53,36 @@ function my_init() {
         g.callnumbers = xul_param('callnumbers',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xpcom':true,'stash_name':'temp_callnumbers','clear_xpcom':true});
 
         /******************************************************************************************************/
+        /* If invoked from the Local Admin menu, rig up a fake item and disable save/create functionality */
+
+        if (xulG.admin) {
+            xulG.edit = 1;
+            var fake_item = new acp();
+            fake_item.id( -1 );
+            fake_item.barcode( 'fake_item' );
+            fake_item.call_number( -1 );
+            fake_item.circ_lib(ses('ws_ou'));
+            /* FIXME -- use constants; really, refactor this into a library somewhere that can be used by chrome and
+               remote xul for new copies */
+            fake_item.deposit(0);
+            fake_item.price(0);
+            fake_item.deposit_amount(0);
+            fake_item.fine_level(2); // Normal
+            fake_item.loan_duration(2); // Normal
+            fake_item.location(1); // Stacks
+            fake_item.status(0);
+            fake_item.circulate(get_db_true());
+            fake_item.holdable(get_db_true());
+            fake_item.opac_visible(get_db_true());
+            fake_item.ref(get_db_false());
+            fake_item.mint_condition(get_db_true());
+            g.copies = [ fake_item ];
+            $('save').hidden = true;
+            $('save').disabled = true;
+            $('non_unified_buttons').hidden = true;
+        }
+
+        /******************************************************************************************************/
         /* Get preference (if it exists) for copy location label order */
 
         g.cl_first = false; // Default to legacy OU first mode
@@ -609,10 +639,15 @@ g.apply_owning_lib = function(ou_id) {
                 g.map_acn[copy.call_number()] = volume;
             }
             var old_volume = g.map_acn[copy.call_number()];
-            var acn_blob = g.network.simple_request(
-                'FM_ACN_FIND_OR_CREATE',
-                [ses(),old_volume.label(),old_volume.record(),ou_id,old_volume.prefix().id(),old_volume.suffix().id(),old_volume.label_class().id()]
-            );
+            var acn_blob;
+            if (! xulG.admin) {
+                acn_blob = g.network.simple_request(
+                    'FM_ACN_FIND_OR_CREATE',
+                    [ses(),old_volume.label(),old_volume.record(),ou_id,old_volume.prefix().id(),old_volume.suffix().id(),old_volume.label_class().id()]
+                );
+            } else {
+                acn_blob = { 'acn_id' : -1 }; // spawned from Local Admin menu, so fake item and call number
+            }
             if (typeof acn_blob.ilsevent != 'undefined') {
                 g.error.standard_unexpected_error_alert($('catStrings').getFormattedString('staff.cat.copy_editor.apply_owning_lib.call_number.error', [copy.barcode()]), acn_blob);
                 continue;
@@ -633,6 +668,7 @@ g.apply_owning_lib = function(ou_id) {
 g.safe_to_change_owning_lib = function() {
     try {
         if (xulG.unified_interface) { return false; }
+        if (xulG.admin) { return false; }
         var safe = true;
         for (var i = 0; i < g.copies.length; i++) {
             var cn = g.copies[i].call_number();

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/web/opac/locale/en-US/lang.dtd            |    2 +
 .../xul/staff_client/chrome/content/main/menu.js   |   11 +++++
 .../chrome/content/main/menu_frame_menus.xul       |    2 +
 .../chrome/locale/en-US/offline.properties         |    1 +
 .../xul/staff_client/server/cat/copy_editor.js     |   44 ++++++++++++++++++--
 5 files changed, 56 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list