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

Evergreen Git git at git.evergreen-ils.org
Wed Feb 24 23:49:17 EST 2016


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  6687b1bc4bd4c4039e31bd758f6bd7d9ba3dbfbd (commit)
       via  bdc60fc0b64c0de6c6616376efb9fe5e850700e0 (commit)
       via  0bd362eaf2d7404e53c44f4a9a859f48b3cd060d (commit)
      from  b4415faed29799de99ac901cdb852ffce9ec9748 (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 6687b1bc4bd4c4039e31bd758f6bd7d9ba3dbfbd
Author: Kathy Lussier <klussier at masslnc.org>
Date:   Wed Feb 24 23:33:51 2016 -0500

    LP1402770: Do not show Holds Count by default in most item screens
    
    The Holds Count columns was displaying by default in many xul item interfaces
    where this info may not be as useful for staff. Let's hide them by default
    in most column pickers, and only display it by default in the patron's Items
    Out tab.
    
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Ben Shum <ben at evergreener.net>

diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js
index 3c9bff8..d2db606 100644
--- a/Open-ILS/xul/staff_client/server/circ/util.js
+++ b/Open-ILS/xul/staff_client/server/circ/util.js
@@ -598,7 +598,7 @@ circ.util.columns = function(modify,params) {
             'label' : 'Holds Count',
             'flex' : 1,
             'primary' : false,
-            'hidden' : false,
+            'hidden' : true,
             'editable' : false, 'render' : function(my) {
 		return network.simple_request("FM_CIRC_HAS_HOLDS_COUNT_RETRIEVE_VIA_COPY",[ ses(), my.acp.id() ] );
 		}

commit bdc60fc0b64c0de6c6616376efb9fe5e850700e0
Author: Kathy Lussier <klussier at masslnc.org>
Date:   Wed Feb 24 22:49:17 2016 -0500

    LP1402770: Release notes entry for holds count column picker
    
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Ben Shum <ben at evergreener.net>

diff --git a/docs/RELEASE_NOTES_NEXT/Client/column-picker-holds-count.adoc b/docs/RELEASE_NOTES_NEXT/Client/column-picker-holds-count.adoc
new file mode 100644
index 0000000..feadc17
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Client/column-picker-holds-count.adoc
@@ -0,0 +1,11 @@
+Holds Count Column Picker Option
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+A new column picker option showing the number of holds for a given item will
+now be available in various interfaces displaying item information, including
+the patron's Items Out tab and the Item Status, Check Out, Check In, Renew
+Item and Record In-House Use screens.
+
+Note: Because the holds count is generated from the hold_copy_map, newly-added
+items and items in a non-holdable status will not display accurate hold counts
+until 24 hours after they have been added to the system or moved to a holdable
+copy status.

commit 0bd362eaf2d7404e53c44f4a9a859f48b3cd060d
Author: blake <blake at mobiusconsortium.org>
Date:   Mon Jul 20 10:11:22 2015 -0500

    LP1402770_column_picker_option_for_number_of_holds
    
    Added a virtual IDL defintion. Added a OpenSRF method to return
    the number of holds that a copy is a member of action.hold_copy_map.
    Added javascript column definition to surface this in the xul staff client.
    Added the column in the web based staff client as well.
    
    Signed-off-by: blake <blake at mobiusconsortium.org>
    Signed-off-by: Andrea Neiman <aneiman at kent.lib.md.us>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Ben Shum <ben at evergreener.net>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index 42b66f2..981ccbb 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -6674,6 +6674,7 @@ SELECT  usr,
 			<field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
+			<field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
 		</fields>
 		<links>
 			<link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
@@ -6698,6 +6699,7 @@ SELECT  usr,
 			<link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
 			<link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
 			<link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
+			<link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
 		</links>
         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
             <actions>
@@ -11346,6 +11348,29 @@ SELECT  usr,
 			</actions>
 		</permacrud>
 	</class>
+	<class id="hasholdscount" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::has_holds_count" reporter:label="Copy Has Holds Count" oils_persist:readonly="true">
+        <oils_persist:source_definition>
+	SELECT ahcm.target_copy AS "id",count(*) AS "count"
+	 FROM
+	 action.hold_request ahr,
+	 action.hold_copy_map ahcm
+	 WHERE
+	 ahr.cancel_time IS NULL AND
+	 ahr.fulfillment_time IS NULL AND
+	 ahr.capture_time IS NULL AND
+	 ahr.id = ahcm.hold
+	 GROUP BY ahcm.target_copy
+        </oils_persist:source_definition>
+        <fields oils_persist:primary="id">
+            <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
+            <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
+        </fields>
+	<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+            <actions>
+               <retrieve/>
+            </actions>
+	</permacrud>
+        </class>
 
 	<!-- ********************************************************************************************************************* -->
 
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
index a859f11..65c3a6f 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
@@ -4410,4 +4410,40 @@ sub mr_hold_filter_attrs {
     return;
 }
 
+__PACKAGE__->register_method(
+    method        => "copy_has_holds_count",
+    api_name      => "open-ils.circ.copy.has_holds_count",
+    authoritative => 1,
+    signature     => {
+        desc => q/
+            Returns the number of holds a paticular copy has
+        /,
+        params => [
+            { desc => 'Authentication Token', type => 'string'},
+            { desc => 'Copy ID', type => 'number'}
+        ],
+        return => {
+            desc => q/
+                Simple count value
+            /,
+            type => 'number'
+        }
+    }
+);
+
+sub copy_has_holds_count {
+    my( $self, $conn, $auth, $copyid ) = @_;
+    my $e = new_editor(authtoken=>$auth);
+    return $e->event unless $e->checkauth;
+
+    if( $copyid && $copyid > 0 ) {
+        my $meth = 'retrieve_action_has_holds_count';
+        my $data = $e->$meth($copyid);
+        if($data){
+                return $data->count();
+        }
+    }
+    return 0;
+}
+
 1;
diff --git a/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2
index 24b4e0e..270ef90 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2
@@ -90,6 +90,7 @@
     </a>
   </eg-grid-field>
   <eg-grid-field path="*" hidden></eg-grid-field>
+  <eg-grid-field path="target_copy.holds_count.count" hidden></eg-grid-field>
   <eg-grid-field path="target_copy.circ_modifier" hidden></eg-grid-field>
   <eg-grid-field path="target_copy.*" hidden></eg-grid-field>
   <eg-grid-field path="target_copy.call_number.*" hidden></eg-grid-field>
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
index 3bd2b2a..380c42c 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
@@ -98,7 +98,7 @@ function($scope,  $q,  $routeParams,  $timeout,  egCore , egUser,  patronSvc , $
             {   flesh : 4,
                 flesh_fields : {
                     circ : ['target_copy', 'workstation', 'checkin_workstation'],
-                    acp : ['call_number'],
+                    acp : ['call_number', 'holds_count'],
                     acn : ['record'],
                     bre : ['simple_record']
                 },
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js
index e17a897..0165ec5 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js
+++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js
@@ -243,6 +243,7 @@ var api = {
     'FM_CIRC_RETRIEVE_VIA_USER.authoritative' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.checked_out.authoritative' },
     'FM_CIRC_RETRIEVE_VIA_COPY' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.copy_checkout_history.retrieve' },
     /*'FM_CIRC_COUNT_RETRIEVE_VIA_USER' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.checked_out.count' },*/
+    'FM_CIRC_HAS_HOLDS_COUNT_RETRIEVE_VIA_COPY' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.copy.has_holds_count', 'secure' : true },
     'FM_CIRC_COUNT_RETRIEVE_VIA_USER' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.checked_out.count', 'cacheable' : true, 'ttl' : 60000 },
     'FM_CIRC_COUNT_RETRIEVE_VIA_USER.authoritative' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.checked_out.count.authoritative', 'cacheable' : true, 'ttl' : 60000 },
     'FM_CIRC_COUNT_RETRIEVE_VIA_COPY' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.circulation.count' },
diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js
index 1af3646..3c9bff8 100644
--- a/Open-ILS/xul/staff_client/server/circ/util.js
+++ b/Open-ILS/xul/staff_client/server/circ/util.js
@@ -592,6 +592,17 @@ circ.util.columns = function(modify,params) {
                 }
             }
         },
+	{
+            'id' : 'ahhc',
+            'fm_class' : 'hasholdscount',
+            'label' : 'Holds Count',
+            'flex' : 1,
+            'primary' : false,
+            'hidden' : false,
+            'editable' : false, 'render' : function(my) {
+		return network.simple_request("FM_CIRC_HAS_HOLDS_COUNT_RETRIEVE_VIA_COPY",[ ses(), my.acp.id() ] );
+		}
+        },
         {
             'id' : 'prefix',
             'fm_class' : 'acn',

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

Summary of changes:
 Open-ILS/examples/fm_IDL.xml                       |   25 ++++++++++++++
 .../perlmods/lib/OpenILS/Application/Circ/Holds.pm |   36 ++++++++++++++++++++
 .../templates/staff/circ/patron/t_items_out.tt2    |    1 +
 .../js/ui/default/staff/circ/patron/items_out.js   |    2 +-
 .../staff_client/chrome/content/main/constants.js  |    1 +
 Open-ILS/xul/staff_client/server/circ/util.js      |   11 ++++++
 .../Client/column-picker-holds-count.adoc          |   11 ++++++
 7 files changed, 86 insertions(+), 1 deletions(-)
 create mode 100644 docs/RELEASE_NOTES_NEXT/Client/column-picker-holds-count.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list