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

Evergreen Git git at git.evergreen-ils.org
Wed Dec 21 17:16:55 EST 2011


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  b68d391e7f60162551443d10b99f343039e271ee (commit)
       via  69e67ef6482442e2a67cc21359e6d4a44e41c228 (commit)
      from  e981f761f16dcad55276b4df65303ae7ed40df3e (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 b68d391e7f60162551443d10b99f343039e271ee
Author: Dan Scott <dscott at laurentian.ca>
Date:   Wed Dec 21 17:13:49 2011 -0500

    Wrap upgrade for "Tag previously circulated items" YAOUS
    
    Also fix a typo ("currenlty") and use the full "circulation" for easier
    translation.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 863045b..8eba8b3 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -86,7 +86,7 @@ CREATE TRIGGER no_overlapping_deps
     BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0660', :eg_version); -- berick/senator
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0661', :eg_version); -- berick/dbs
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index 48a5783..50b7192 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -4507,7 +4507,7 @@ INSERT into config.org_unit_setting_type
     ),
     oils_i18n_gettext(
         'opac.search.tag_circulated_items',
-        'When a user is both logged in and has opted in to circ history tracking, turning on this setting will cause previous (or currenlty) circulated items to be highlighted in search results',
+        'When a user is both logged in and has opted in to circulation history tracking, turning on this setting will cause previous (or currently) circulated items to be highlighted in search results',
         'coust', 'description'
     ),
     'bool', null)
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.yaous-opac-tag-circed-items.sql b/Open-ILS/src/sql/Pg/upgrade/0661.data.yaous-opac-tag-circed-items.sql
similarity index 57%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.data.yaous-opac-tag-circed-items.sql
rename to Open-ILS/src/sql/Pg/upgrade/0661.data.yaous-opac-tag-circed-items.sql
index be200f7..2c74d57 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.yaous-opac-tag-circed-items.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0661.data.yaous-opac-tag-circed-items.sql
@@ -1,10 +1,13 @@
--- Evergreen DB patch XXXX.data.yaous-opac-tag-circed-items.sql
+-- Evergreen DB patch 0661.data.yaous-opac-tag-circed-items.sql
+--
+-- Add org unit setting that enables users who have opted in to
+-- tracking their circulation history to see which items they
+-- have previously checked out in search results.
 --
 BEGIN;
 
-
 -- check whether patch can be applied
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('0661', :eg_version);
 
 INSERT into config.org_unit_setting_type 
     (name, grp, label, description, datatype) 
@@ -19,7 +22,7 @@ INSERT into config.org_unit_setting_type
         ),
         oils_i18n_gettext(
             'opac.search.tag_circulated_items',
-            'When a user is both logged in and has opted in to circ history tracking, turning on this setting will cause previous (or currenlty) circulated items to be highlighted in search results',
+            'When a user is both logged in and has opted in to circulation history tracking, turning on this setting will cause previous (or currently) circulated items to be highlighted in search results',
             'coust', 
             'description'
         ),

commit 69e67ef6482442e2a67cc21359e6d4a44e41c228
Author: Bill Erickson <berick at esilibrary.com>
Date:   Tue Nov 29 16:54:52 2011 -0500

    TPac; indicate search results previously checked out
    
    When a user is logged in to the tpac and performs a search, indicate in
    the results set when any of the result items were ever checked out by
    the logged in user.
    
    Items will only be tagged when the related org setting is enabled and
    the user has opted-in to circ history tracking.
    
    New org unit setting is "opac.search.tag_circulated_items" /
    "Tag Circulated Items in Results"
    
    In the search results, just below title/author/callnumber/copy-count, a
    new line is displayed that says "I have checked out this item before"
    with a purdy little checkmark.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm
index dc45d3b..eb166a6 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm
@@ -1292,14 +1292,14 @@ sub staged_search {
                 $results = [map {[$_->{id}]} @$results];
             }
 
-            tag_circulated_records($search_hash->{authtoken}, $results, $IAmMetabib) 
-                if $search_hash->{tag_circulated_records} and $search_hash->{authtoken};
-
             push @$new_ids, grep {defined($_)} map {$_->[0]} @$results;
             $results = [grep {defined $_->[0]} @$results];
             cache_staged_search_page($key, $page, $summary, $results) if $docache;
         }
 
+        tag_circulated_records($search_hash->{authtoken}, $results, $IAmMetabib) 
+            if $search_hash->{tag_circulated_records} and $search_hash->{authtoken};
+
         $current_page_summary = $summary;
 
         # add the new set of results to the set under construction
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
index cfaef71..f803f7f 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
@@ -138,6 +138,28 @@ sub _get_search_limit {
     return 10; # default
 }
 
+sub tag_circed_items {
+    my $self = shift;
+    my $e = $self->editor;
+
+    return 0 unless $e->requestor;
+    return 0 unless $self->ctx->{get_org_setting}->(
+        $e->requestor->home_ou, 
+        'opac.search.tag_circulated_items');
+
+    # user has to be opted-in to circ history in some capacity
+    my $sets = $e->search_actor_user_setting({
+        usr => $e->requestor->id, 
+        name => [
+            'history.circ.retention_age', 
+            'history.circ.retention_start'
+        ]
+    });
+
+    return 0 unless @$sets;
+    return 1;
+}
+
 # context additions: 
 #   page_size
 #   hit_count
@@ -174,6 +196,7 @@ sub load_rresults {
     my $offset = $page * $limit;
     my $metarecord = $cgi->param('metarecord');
     my $results; 
+    my $tag_circs = $self->tag_circed_items;
 
     $ctx->{page_size} = $limit;
     $ctx->{search_page} = $page;
@@ -226,6 +249,11 @@ sub load_rresults {
         # the query string, not special args.
         my $args = {'limit' => $limit, 'offset' => $offset};
 
+        if ($tag_circs) {
+            $args->{tag_circulated_records} = 1;
+            $args->{authtoken} = $self->editor->authtoken;
+        }
+
         # Stuff these into the TT context so that templates can use them in redrawing forms
         $ctx->{processed_search_query} = $query;
 
@@ -276,6 +304,16 @@ sub load_rresults {
         );
     }
 
+    if ($tag_circs) {
+        for my $rec (@{$ctx->{records}}) {
+            my ($res_rec) = grep { $_->[0] == $rec->{id} } @{$results->{ids}};
+            # index 1 in the per-record result array is a boolean which
+            # indicates whether the record in question is in the users
+            # accessible circ history list
+            $rec->{user_circulated} = 1 if $res_rec->[1];
+        }
+    }
+
     $ctx->{search_facets} = $facets;
 
     return Apache2::Const::OK;
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index e23ceac..48a5783 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -4499,6 +4499,19 @@ INSERT into config.org_unit_setting_type
         'coust', 'description'),
     'bool', null)
 
+,( 'opac.search.tag_circulated_items', 'opac',
+    oils_i18n_gettext(
+        'opac.search.tag_circulated_items',
+        'Tag Circulated Items in Results',
+        'coust', 'label'
+    ),
+    oils_i18n_gettext(
+        'opac.search.tag_circulated_items',
+        'When a user is both logged in and has opted in to circ history tracking, turning on this setting will cause previous (or currenlty) circulated items to be highlighted in search results',
+        'coust', 'description'
+    ),
+    'bool', null)
+
 ;
 
 UPDATE config.org_unit_setting_type
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.yaous-opac-tag-circed-items.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.yaous-opac-tag-circed-items.sql
new file mode 100644
index 0000000..be200f7
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.yaous-opac-tag-circed-items.sql
@@ -0,0 +1,30 @@
+-- Evergreen DB patch XXXX.data.yaous-opac-tag-circed-items.sql
+--
+BEGIN;
+
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT into config.org_unit_setting_type 
+    (name, grp, label, description, datatype) 
+    VALUES ( 
+        'opac.search.tag_circulated_items', 
+        'opac',
+        oils_i18n_gettext(
+            'opac.search.tag_circulated_items',
+            'Tag Circulated Items in Results',
+            'coust', 
+            'label'
+        ),
+        oils_i18n_gettext(
+            'opac.search.tag_circulated_items',
+            'When a user is both logged in and has opted in to circ history tracking, turning on this setting will cause previous (or currenlty) circulated items to be highlighted in search results',
+            'coust', 
+            'description'
+        ),
+        'bool'
+    );
+
+
+COMMIT;
diff --git a/Open-ILS/src/templates/opac/parts/result/table.tt2 b/Open-ILS/src/templates/opac/parts/result/table.tt2
index 6be3122..83a877f 100644
--- a/Open-ILS/src/templates/opac/parts/result/table.tt2
+++ b/Open-ILS/src/templates/opac/parts/result/table.tt2
@@ -42,9 +42,7 @@
                                                         src='[% ctx.media_prefix %]/opac/extras/ac/jacket/small/[% ident | uri %]' /></a><br />
                                                 [% END %]
                                             </td>
-                                            <td class='result_table_title_cell'
-                                                name='result_table_title_cell'
-                                                valign="top">
+                                            <td class='result_table_title_cell' name='result_table_title_cell' valign="top">
                                                 <div class="bold">
                                                     <a name='record_[% rec.id %]' name='item_title'
                                                         href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"
@@ -161,6 +159,12 @@
                                                         [% END %] <!-- END detail_record_view -->
                                                     </table>
                                                     [% PROCESS "opac/parts/result/copy_counts.tt2" %]
+                                                    [% IF rec.user_circulated %]
+                                                    <div class="result_item_circulated">
+                                                        <img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('Checked Out Before') %]"/>
+                                                        <span>[% l('I have checked this item out before') %]</span>
+                                                    </div>
+                                                    [% END %]
                                                 </div>
                                             </td>
 
@@ -179,7 +183,6 @@
                                                         class='classic_link hide_me'
                                                         name="googleBooks-link">[% l("Browse in Google Books Search") %]</a>
                                                 </span>
-
                                             </td>
                                             <td nowrap='nowrap' width="1" align="right">
                                                 <div class="result_table_utils_cont">
diff --git a/Open-ILS/web/css/skin/default/opac/style.css b/Open-ILS/web/css/skin/default/opac/style.css
index 2d03d68..4fddfe3 100644
--- a/Open-ILS/web/css/skin/default/opac/style.css
+++ b/Open-ILS/web/css/skin/default/opac/style.css
@@ -1326,3 +1326,12 @@ table.bookbag-specific {
 #staff-saved-search { /* wraps .saved-searches-header and .saved-searches on the record page */
     border-right: 1px solid #333;
 }
+.result_item_circulated {
+    padding-top: 4px;
+}
+
+.result_item_circulated span {
+    position: relative;
+    top:-3px;
+    left:3px;
+}

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

Summary of changes:
 .../lib/OpenILS/Application/Search/Biblio.pm       |    6 ++--
 .../perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm |   38 ++++++++++++++++++++
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 Open-ILS/src/sql/Pg/950.data.seed-values.sql       |   13 +++++++
 .../0661.data.yaous-opac-tag-circed-items.sql      |   33 +++++++++++++++++
 Open-ILS/src/templates/opac/parts/result/table.tt2 |   11 ++++--
 Open-ILS/web/css/skin/default/opac/style.css       |    9 +++++
 7 files changed, 104 insertions(+), 8 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0661.data.yaous-opac-tag-circed-items.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list