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

Evergreen Git git at git.evergreen-ils.org
Fri Jul 27 12:16:39 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  6517e6fbeb80601a8aab8478484f6dbd22e3b001 (commit)
       via  8c79b3cecf8bbd977c864a0ba72435374e01cf4c (commit)
      from  bc84c7b6d47e1fdfe381ce96e2d2fb78a3d9907f (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 6517e6fbeb80601a8aab8478484f6dbd22e3b001
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Fri Jun 22 17:42:57 2012 -0400

    Fix some failings of the Triggered Event Viewer
    
    1) give choices in a dropdown for the Reactor field
    
    2) like searching automatically wraps search terms in % except when at
    least one % is already present.
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
index 966a991..50cff13 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
@@ -4605,4 +4605,43 @@ sub mark_users_contact_invalid {
     );
 }
 
+# Putting the following method in open-ils.actor is a bad fit, except in that
+# it serves an interface that lives under 'actor' in the templates directory,
+# and in that there's nowhere else obvious to put it (open-ils.trigger is
+# private).
+__PACKAGE__->register_method(
+    api_name => "open-ils.actor.action_trigger.reactors.all_in_use",
+    method   => "get_all_at_reactors_in_use",
+    api_level=> 1,
+    argc     => 1,
+    signature=> {
+        params => [
+            { name => 'authtoken', type => 'string' }
+        ],
+        return => {
+            desc => 'list of reactor names', type => 'array'
+        }
+    }
+);
+
+sub get_all_at_reactors_in_use {
+    my ($self, $conn, $auth) = @_;
+
+    my $e = new_editor(authtoken => $auth);
+    $e->checkauth or return $e->die_event;
+    return $e->die_event unless $e->allowed('VIEW_TRIGGER_EVENT_DEF');
+
+    my $reactors = $e->json_query({
+        select => {
+            atevdef => [{column => "reactor", transform => "distinct"}]
+        },
+        from => {atevdef => {}}
+    });
+
+    return $e->die_event unless ref $reactors eq "ARRAY";
+    $e->disconnect;
+
+    return [ map { $_->{reactor} } @$reactors ];
+}
+
 1;
diff --git a/Open-ILS/src/templates/actor/user/event_log.tt2 b/Open-ILS/src/templates/actor/user/event_log.tt2
index 9f745ca..b5e3d0d 100644
--- a/Open-ILS/src/templates/actor/user/event_log.tt2
+++ b/Open-ILS/src/templates/actor/user/event_log.tt2
@@ -51,6 +51,8 @@
         grid.filterUi.doApply();
     }
 
+    var _reactors_cache;
+
     /* This and its subclasses exist because *FilterPane expect things that
        act like AutoFieldWidget, which is a widget /builder/.  */
     dojo.declare(
@@ -66,7 +68,7 @@
             "build": function() {
                 var dijitArgs = dojo.mixin(
                     {
-                        "store": this.store,
+                        "store": this.store || this.storeBuilder(),
                         "query": {},
                         "labelAttr": "label",
                         "searchAttr": "label",
@@ -80,6 +82,27 @@
     );
 
     dojo.declare(
+        "openils.widget._FSBuilder.Reactor",
+        [openils.widget._FSBuilder], {
+            "storeBuilder": function() {
+                _reactors_cache = _reactors_cache ||
+                    fieldmapper.standardRequest(
+                        ["open-ils.actor", "open-ils.actor.action_trigger.reactors.all_in_use"],
+                        { "params": [openils.User.authtoken] }
+                    ).sort();
+                return new dojo.data.ItemFileReadStore({
+                    "data": {
+                        "identifier": "name",
+                        "items": _reactors_cache.map(
+                            function(o) { return {"name": o, "label": o}; }
+                        )
+                    }
+                });
+            }
+        }
+    );
+
+    dojo.declare(
         "openils.widget._FSBuilder.CoreType",
         [openils.widget._FSBuilder], {
             "store": new dojo.data.ItemFileReadStore({
@@ -132,6 +155,7 @@
     var filter_widget_builders = {
         "ath:core_type": openils.widget._FSBuilder.CoreType,
         "atul:state": openils.widget._FSBuilder.EventState,
+        "atul:reactor": openils.widget._FSBuilder.Reactor,
     };
 
     function print_all() {
diff --git a/Open-ILS/web/js/dojo/openils/widget/PCrudFilterPane.js b/Open-ILS/web/js/dojo/openils/widget/PCrudFilterPane.js
index eb34315..684980d 100644
--- a/Open-ILS/web/js/dojo/openils/widget/PCrudFilterPane.js
+++ b/Open-ILS/web/js/dojo/openils/widget/PCrudFilterPane.js
@@ -486,6 +486,11 @@ if (!dojo._hasResource['openils.widget.PCrudFilterPane']) {
                 return;
         };
 
+        /* wrap s in %'s unless it already contains at least one %. */
+        this._add_like_wildcards = function(s) {
+            return s.indexOf("%") == -1 ? ("%" + s + "%") : s;
+        };
+
         this.get_selected_operator = function() {
             if (this.operator_selector)
                 return this.operator_selector.item;
@@ -538,10 +543,15 @@ if (!dojo._hasResource['openils.widget.PCrudFilterPane']) {
                 } else {
                     var clause = {};
                     var op = this.get_selected_operator_name();
+
+                    var prep_function = function(o) { return o; /* no-op */ };
+                    if (String(op).match(/like/))
+                        prep_function = this._add_like_wildcards;
+
                     if (values.length == 1)
-                        clause[op] = values.pop();
+                        clause[op] = prep_function(values.pop());
                     else
-                        clause[op] = values;
+                        clause[op] = dojo.map(values, prep_function);
                     return clause;
                 }
             } else {

commit 8c79b3cecf8bbd977c864a0ba72435374e01cf4c
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Fri Jul 27 10:57:52 2012 -0400

    Triggered Event Log: Add title and author columns for hold-related events
    
    Correcting an omission spotted by Sally Fortin.
    
    NOTE:  This adds pcrud as a controller to ahr.  Only the retrieve
    operation is allowed at this time, and only with a VIEW_HOLD permission
    at the pickup lib (same setup as ahopl, the class powering the new pull
    list).
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index dba33cf..f56bc08 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -4958,7 +4958,7 @@ SELECT  usr,
 	</class>
 
 	<!-- A note: Please update alhr and ahopl when updating ahr -->
-	<class id="ahr" controller="open-ils.cstore" oils_obj:fieldmapper="action::hold_request" oils_persist:tablename="action.hold_request" reporter:core="true" reporter:label="Hold Request">
+	<class id="ahr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_request" oils_persist:tablename="action.hold_request" reporter:core="true" reporter:label="Hold Request">
 		<fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
 			<field reporter:label="Status" name="status" oils_persist:virtual="true" />
 			<field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
@@ -5019,6 +5019,11 @@ SELECT  usr,
 			<link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
 			<link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
 		</links>
+		<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+			<actions>
+				<retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
+			</actions>
+		</permacrud>
 	</class>
 	<class id="ahopl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_on_pull_list" reporter:label="Hold On Pull List" oils_persist:readonly="true">
 		<oils_persist:source_definition><![CDATA[
diff --git a/Open-ILS/src/templates/actor/user/event_log.tt2 b/Open-ILS/src/templates/actor/user/event_log.tt2
index 2756c7b..9f745ca 100644
--- a/Open-ILS/src/templates/actor/user/event_log.tt2
+++ b/Open-ILS/src/templates/actor/user/event_log.tt2
@@ -267,6 +267,8 @@
                         <th field="target_circ_copy_title" fpath="target_circ.target_copy.call_number.record.simple_record.title">Target Circulation - Title</th>
                         <th field="target_circ_copy_author" fpath="target_circ.target_copy.call_number.record.simple_record.author">Target Circulation - Author</th>
                         <th field="target_circ_patron_barcode" fpath="target_circ.usr.card.barcode" ffilter="true">Target Circulation - Patron Barcode</th>
+                        <th field="target_hold_copy_title" fpath="target_hold.current_copy.call_number.record.simple_record.title">Target Hold - Title</th>
+                        <th field="target_hold_copy_author" fpath="target_hold.current_copy.call_number.record.simple_record.author">Target Hold - Author</th>
                         <th field="target_hold_patron_barcode" fpath="target_hold.usr.card.barcode" ffilter="true">Target Hold - Patron Barcode</th>
                     </tr>
                 </thead>

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

Summary of changes:
 Open-ILS/examples/fm_IDL.xml                       |    7 +++-
 .../src/perlmods/lib/OpenILS/Application/Actor.pm  |   39 ++++++++++++++++++++
 Open-ILS/src/templates/actor/user/event_log.tt2    |   28 ++++++++++++++-
 .../web/js/dojo/openils/widget/PCrudFilterPane.js  |   14 ++++++-
 4 files changed, 84 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list