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

Evergreen Git git at git.evergreen-ils.org
Fri Sep 13 16:39:35 EDT 2013


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  1ade5922c3b35c69621c083337808e5e9a8c20d2 (commit)
       via  09cf487b30cc458a2975e0c6b7d3a13addbcc65e (commit)
       via  eb647e5354db7d76f7fec3c75b0493913fc93466 (commit)
      from  33584305c66c9343e64246174cb2b38b53b6db5d (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 1ade5922c3b35c69621c083337808e5e9a8c20d2
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Fri Sep 13 16:35:31 2013 -0400

    Stamping upgrade for 'my list' lists-per-page
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 2277d81..577e6d6 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -91,7 +91,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 ('0829', :eg_version); -- ktomita/dbwells
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0830', :eg_version); -- ktomita/dbwells
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.add_setting_for_selecting_lists_per_page_for_my_list.sql b/Open-ILS/src/sql/Pg/upgrade/0830.data.my_list_lists_per_page_setting.sql
similarity index 81%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.add_setting_for_selecting_lists_per_page_for_my_list.sql
rename to Open-ILS/src/sql/Pg/upgrade/0830.data.my_list_lists_per_page_setting.sql
index 3af2a12..d6dd771 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.add_setting_for_selecting_lists_per_page_for_my_list.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0830.data.my_list_lists_per_page_setting.sql
@@ -1,11 +1,10 @@
--- Evergreen DB patch XXXX.add_setting_for_selecting_lists_per_page_for_my_list.sql
 --
 -- Adds a setting for selecting the number of lists per page for my list.
 --
 BEGIN;
 
 -- check whether patch can be applied
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('0830', :eg_version);
 
 INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype)
     VALUES (

commit 09cf487b30cc458a2975e0c6b7d3a13addbcc65e
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Fri Sep 13 16:30:55 2013 -0400

    Trivial changes to configurable bookbag paging
    
    1) use class for highlight styling of current page
    2) correct minor logic error ('<=' should be '<')
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/templates/opac/myopac/lists.tt2 b/Open-ILS/src/templates/opac/myopac/lists.tt2
index 22b3bd9..392a528 100644
--- a/Open-ILS/src/templates/opac/myopac/lists.tt2
+++ b/Open-ILS/src/templates/opac/myopac/lists.tt2
@@ -86,18 +86,18 @@
                     offset => (offset - limit)
                 }) %]'>[% ((offset - limit) / limit) + 1 %]</a>
             [%- END; -%]
-            <span style="color:red;" >[% (offset / limit) + 1 %]</span>
-            [%- IF (offset + limit) <= ctx.bookbag_count -%]
+            <span class="bookbag-paginator-selected" >[% (offset / limit) + 1 %]</span>
+            [%- IF (offset + limit) < ctx.bookbag_count -%]
                 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
                     offset => (offset + limit)
                 }) %]'>[% ((offset + limit) / limit) + 1 %]</a>
             [%- END; -%]
-            [%- IF (offset + (limit * 2)) <= ctx.bookbag_count -%]
+            [%- IF (offset + (limit * 2)) < ctx.bookbag_count -%]
                 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
                     offset => (offset + (limit * 2))
                 }) %]'>[% ((offset + (limit * 2)) / limit) + 1 %]</a>
             [%- END; -%]
-            [%- IF (offset + (limit * 3)) <= ctx.bookbag_count -%]
+            [%- IF (offset + (limit * 3)) < ctx.bookbag_count -%]
                 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
                     offset => (offset + (limit * 3))
                 }) %]'>[% ((offset + (limit * 3)) / limit) + 1 %]</a>

commit eb647e5354db7d76f7fec3c75b0493913fc93466
Author: Kyle Tomita <ktomita at catalystitservices.com>
Date:   Wed Apr 3 17:07:51 2013 -0700

    LP1164197 - Add page number navigation to my lists and setting for number of lists per page
    
    Added a user setting for the number of lists per page.
    Added code for page number navigation.
    
    Signed-off-by: Kyle Tomita <ktomita at catalystitservices.com>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
index 6acb39e..c9d53ae 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
@@ -470,6 +470,7 @@ sub load_myopac_prefs_my_lists {
     my $self = shift;
 
     my @user_prefs = qw/
+        opac.lists_per_page
         opac.list_items_per_page
     /;
 
@@ -1737,6 +1738,22 @@ sub _update_bookbag_metadata {
     return 0;
 }
 
+sub _get_lists_per_page {
+    my $self = shift;
+
+    if($self->editor->requestor) {
+        $self->timelog("Checking for opac.lists_per_page preference");
+        # See if the user has a lists per page preference
+        my $ipp = $self->editor->search_actor_user_setting({
+            usr => $self->editor->requestor->id,
+            name => 'opac.lists_per_page'
+        })->[0];
+        $self->timelog("Got opac.lists_per_page preference");
+        return OpenSRF::Utils::JSON->JSON2perl($ipp->value) if $ipp;
+    }
+    return 10; # default
+}
+
 sub _get_items_per_page {
     my $self = shift;
 
@@ -1757,7 +1774,7 @@ sub load_myopac_bookbags {
     my $self = shift;
     my $e = $self->editor;
     my $ctx = $self->ctx;
-    my $limit = $self->cgi->param('limit') || 10;
+    my $limit = $self->_get_lists_per_page || 10;
     my $offset = $self->cgi->param('offset') || 0;
 
     $ctx->{bookbags_limit} = $limit;
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 77cdf76..328ce33 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -2558,6 +2558,25 @@ INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatyp
 
 INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype)
     VALUES (
+        'opac.lists_per_page',
+        TRUE,
+        oils_i18n_gettext(
+            'opac.lists_per_page',
+            'Lists per Page',
+            'cust',
+            'label'
+        ),
+        oils_i18n_gettext(
+            'opac.lists_per_page',
+            'A number designating the amount of lists displayed per page.',
+            'cust',
+            'description'
+        ),
+        'string'
+    );
+
+INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype)
+    VALUES (
         'opac.list_items_per_page',
         TRUE,
         oils_i18n_gettext(
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.add_setting_for_selecting_lists_per_page_for_my_list.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.add_setting_for_selecting_lists_per_page_for_my_list.sql
new file mode 100644
index 0000000..3af2a12
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.add_setting_for_selecting_lists_per_page_for_my_list.sql
@@ -0,0 +1,29 @@
+-- Evergreen DB patch XXXX.add_setting_for_selecting_lists_per_page_for_my_list.sql
+--
+-- Adds a setting for selecting the number of lists per page for my list.
+--
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype)
+    VALUES (
+        'opac.lists_per_page',
+        TRUE,
+        oils_i18n_gettext(
+            'opac.lists_per_page',
+            'Lists per Page',
+            'cust',
+            'label'
+        ),
+        oils_i18n_gettext(
+            'opac.lists_per_page',
+            'A number designating the amount of lists displayed per page.',
+            'cust',
+            'description'
+        ),
+        'string'
+    );
+    
+COMMIT;
diff --git a/Open-ILS/src/templates/opac/myopac/lists.tt2 b/Open-ILS/src/templates/opac/myopac/lists.tt2
index 3be190f..22b3bd9 100644
--- a/Open-ILS/src/templates/opac/myopac/lists.tt2
+++ b/Open-ILS/src/templates/opac/myopac/lists.tt2
@@ -68,12 +68,43 @@
         <span class='float-left' style='padding-left: 10px;'>
             [%- IF offset > 0 -%]
                 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
-                    limit => limit, offset => (offset - limit)
+                    offset => (offset - limit)
                 }) %]'><span class="nav_arrow_fix">&#9668;</span>[% l('Previous') %]</a>
             [%- END; -%]
+            [%- IF (offset - (limit * 3)) >= 0 -%]
+                <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
+                    offset => (offset - (limit * 3))
+                }) %]'>[% ((offset - (limit * 3)) / limit) + 1 %]</a>
+            [%- END; -%]
+            [%- IF (offset - (limit * 2)) >= 0 -%]
+                <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
+                    offset => (offset - (limit * 2))
+                }) %]'>[% ((offset - (limit * 2)) / limit) + 1 %]</a>
+            [%- END; -%]
+            [%- IF (offset - limit) >= 0 -%]
+                <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
+                    offset => (offset - limit)
+                }) %]'>[% ((offset - limit) / limit) + 1 %]</a>
+            [%- END; -%]
+            <span style="color:red;" >[% (offset / limit) + 1 %]</span>
+            [%- IF (offset + limit) <= ctx.bookbag_count -%]
+                <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
+                    offset => (offset + limit)
+                }) %]'>[% ((offset + limit) / limit) + 1 %]</a>
+            [%- END; -%]
+            [%- IF (offset + (limit * 2)) <= ctx.bookbag_count -%]
+                <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
+                    offset => (offset + (limit * 2))
+                }) %]'>[% ((offset + (limit * 2)) / limit) + 1 %]</a>
+            [%- END; -%]
+            [%- IF (offset + (limit * 3)) <= ctx.bookbag_count -%]
+                <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
+                    offset => (offset + (limit * 3))
+                }) %]'>[% ((offset + (limit * 3)) / limit) + 1 %]</a>
+            [%- END; -%]
             [%- IF (ctx.bookbag_count - offset) > limit; -%] 
                 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
-                    limit => limit, offset => (offset + limit)
+                    offset => (offset + limit)
                 }) %]'>[% l('Next') %]<span class="nav_arrow_fix">&#9658;</span></a>
             </span>
             [%- END; -%]
diff --git a/Open-ILS/src/templates/opac/myopac/prefs_my_lists.tt2 b/Open-ILS/src/templates/opac/myopac/prefs_my_lists.tt2
index 746df98..69106a4 100644
--- a/Open-ILS/src/templates/opac/myopac/prefs_my_lists.tt2
+++ b/Open-ILS/src/templates/opac/myopac/prefs_my_lists.tt2
@@ -17,6 +17,26 @@
                 </td></tr>
                 [% END %]
 
+                [%- setting = 'opac.lists_per_page' -%]
+                <tr >
+                    <td width='20%'><label for='[% setting %]'>[%l("Lists per page") %]</label></td>
+                    <td>
+                        <select id='[% setting %]' name='[% setting %]'>
+                            [%  UNLESS ctx.user_setting_map.$setting;
+                                    ctx.user_setting_map.$setting = 10;
+                                END;
+                                FOR val IN [10, 15, 20, 25] %]
+                                <option value='[% val | uri %]' 
+                                    [% IF ctx.user_setting_map.$setting == val %]
+                                        selected='selected'[% END %]>[% val | html %]</option>
+                            [% END %]
+                        </select>
+                        <img alt="[% l('List Items Help') %]"
+                            src="[% ctx.media_prefix %]/images/question-mark.png"
+                            title="[% l('The number of lists displayed per page.') %]"
+                        />
+                    </td>
+                </tr>
                 [%- setting = 'opac.list_items_per_page' -%]
                 <tr >
                     <td width='20%'><label for='[% setting %]'>[%l("List items per page") %]</label></td>

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

Summary of changes:
 .../lib/OpenILS/WWW/EGCatLoader/Account.pm         |   19 ++++++++++-
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 Open-ILS/src/sql/Pg/950.data.seed-values.sql       |   19 +++++++++++
 .../0830.data.my_list_lists_per_page_setting.sql   |   28 ++++++++++++++++
 Open-ILS/src/templates/opac/myopac/lists.tt2       |   35 ++++++++++++++++++-
 .../src/templates/opac/myopac/prefs_my_lists.tt2   |   20 +++++++++++
 6 files changed, 119 insertions(+), 4 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0830.data.my_list_lists_per_page_setting.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list