Bugzilla – Attachment 7818 Details for
Bug 7523
Templates should respect serials routing permission
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[Signed off] Bug 7523: Improve checks for routing permissions
0001-Bug-7523-Improve-checks-for-routing-permissions.patch (text/plain), 14.62 KB, created by
Julian Maurice
on 2012-02-23 09:39:35 UTC
(
hide
)
Description:
[Signed off] Bug 7523: Improve checks for routing permissions
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2012-02-23 09:39:35 UTC
Size:
14.62 KB
patch
obsolete
>From 117a0c141ceedf91b612b60846261e7d35bcd9af Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <Katrin.Fischer.83@web.de> >Date: Sun, 19 Feb 2012 09:37:14 +0100 >Subject: [PATCH] Bug 7523: Improve checks for routing permissions > >- system preference RoutingSerials and user permission routing > should be taken into account >- print routing list should be independent from routing permission > >To test, compare to master and check: > >1) If system preference RoutingSerials is OFF, routing list functionality is >not visible in the templates. > >2) If system preference RoutingSerials is ON, but user doesn't have routing >permission, routing list functionality is not visible in templates, >with exception of 'print list' on the serial collection page. > >3) If system preference RoutingSerials is ON and user has routing permissions, >all routing links are visible (serial collection, serials navigation, >result list of serial search) > >Additional changes: >Changed labels on templates to match HTML4 rule from coding guidelines. >http://wiki.koha-community.org/wiki/Coding_Guidelines#Upper_and_Lower_cases_in_strings > >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > .../prog/en/includes/serials-menu.inc | 14 ++++---- > .../prog/en/modules/serials/routing-preview.tt | 4 +- > .../prog/en/modules/serials/serials-collection.tt | 30 +++++++++++-------- > .../prog/en/modules/serials/serials-edit.tt | 10 +++--- > .../prog/en/modules/serials/serials-home.tt | 28 +++++++++--------- > serials/routing-preview.pl | 4 +- > serials/serials-collection.pl | 1 + > serials/subscription-detail.pl | 1 + > 8 files changed, 49 insertions(+), 43 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-menu.inc >index b54c842..0feafda 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-menu.inc >@@ -1,13 +1,13 @@ > [% IF ( subscriptionid ) %] > <ul> >-<li><a href="serials-collection.pl?subscriptionid=[% subscriptionid %]">Serial Collection</a></li> >- [% IF ( CAN_user_serials_routing ) %] >+<li><a href="serials-collection.pl?subscriptionid=[% subscriptionid %]">Serial collection</a></li> >+ [% IF ( routing && CAN_user_serials_routing ) %] > [% IF ( hasRouting ) %] >- <li><a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscriptionid %]">Edit Routing List</a></li> >+ <li><a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscriptionid %]">Edit routing list</a></li> > [% ELSE %] >- <li><a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscriptionid %]&op=new">Create Routing List</a></li> >- [% END %] >- [% END %] >+ <li><a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscriptionid %]&op=new">Create routing list</a></li> >+ [% END %] >+ [% END %] > </ul> > [% END %] > >@@ -16,6 +16,6 @@ > <li><a href="/cgi-bin/koha/serials/claims.pl">Claims</a></li> > [% END %] > [% IF ( CAN_user_serials_check_expiration ) %] >- <li><a href="/cgi-bin/koha/serials/checkexpiration.pl">Check Expiration</a></li> >+ <li><a href="/cgi-bin/koha/serials/checkexpiration.pl">Check expiration</a></li> > [% END %] > </ul> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview.tt >index 2cc1936..b48e902 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview.tt >@@ -24,14 +24,14 @@ function print_slip(subscriptionid,issue){ > <div id="yui-main"> > <div class="yui-b"> > >-<h2>Preview Routing List for <i>[% title |html %]</i></h2> >+<h2>Preview routing list for <i>[% title |html %]</i></h2> > > <form method="post" action="routing-preview.pl"> > <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" /> > <fieldset class="rows"> > <ol> > <li><span class="label">Issue:</span>[% issue %]</li> >- <li><span class="label">List Member:</span><table style="clear:none;margin:0;"> >+ <li><span class="label">List member:</span><table style="clear:none;margin:0;"> > <tr><th>Name</th></tr> > [% FOREACH memberloo IN memberloop %] > <tr><td>[% memberloo.surname %], [% memberloo.firstname %]</td></tr> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >index 7b8efef..1db30c1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >@@ -64,7 +64,7 @@ $(document).ready(function() { > [% UNLESS ( popup ) %] > [% INCLUDE 'serials-toolbar.inc' %] > >- <h1>Serial Collection information for <i>[% bibliotitle %]</i> >+ <h1>Serial collection information for <i>[% bibliotitle %]</i> > [% IF location %] ([% location %] ) [% END %] > [% IF ( callnumber ) %]callnumber: [% callnumber %][% END %]</h1> > [% END %] >@@ -72,18 +72,18 @@ $(document).ready(function() { > [% IF ( subscriptions ) %] > <table> > [% IF ( subscriptions.size == 1 ) %] >-<caption> Subscription Summary</caption> >+<caption> Subscription summary</caption> > [% ELSE %] >-<caption> Subscription Summaries</caption> >+<caption> Subscription summaries</caption> > [% END %] > <tr> >- <th>Subscription Num. </th> >+ <th>Subscription num. </th> > <th>Frequency</th> > <th>Numbering pattern</th> > <th>Library</th> > <th>Call number</th> > <th>Notes</th> >- <th>Routing</th> >+ [% IF ( routing && CAN_user_serials_routing ) %]<th>Routing</th>[% END %] > <th>Renew</th> > </tr> > [% FOREACH subscription IN subscriptions %] >@@ -146,10 +146,14 @@ $(document).ready(function() { > [% END %]</td> > <td> [% subscription.branchcode %]</td> > <td> [% subscription.callnumber %]</td> >- <td> [% subscription.notes %] [% IF ( subscription.subscriptionexpired ) %]<br /><span class="problem"> Subscription Expired</span> >+ <td> [% subscription.notes %] [% IF ( subscription.subscriptionexpired ) %]<br /><span class="problem"> Subscription expired</span> > [% END %] > </td> >- <td><a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit Routing List</a></td> >+ [% IF ( routing && CAN_user_serials_routing ) %] >+ <td> >+ <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit routing list</a> >+ </td> >+ [% END %] > [% IF ( subscription.abouttoexpire ) %]<td class="problem"> <a href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscription.subscriptionid %]" onclick="popup([% subscription.subscriptionid %]); return false;">Renew</a></td> > [% ELSE %] > [% IF ( subscription.subscriptionexpired ) %]<td class="problem"> <a href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscription.subscriptionid %]" onclick="popup([% subscription.subscriptionid %]); return false;">Renew</a></td> >@@ -199,9 +203,7 @@ $(document).ready(function() { > </th> > <th>Branch > </th> >- <th>Routing >- </th> >- >+ [% IF ( routing ) %]<th>Routing</th>[% END %] > [% IF ( CAN_user_serials_receive_serials ) %]<th>Edit</th>[% END %] > </tr> > [% FOREACH serial IN year.serials %] >@@ -227,9 +229,11 @@ $(document).ready(function() { > <td> > [% serial.branchcode %] > </td> >- <td> >- <a href="" onclick="print_slip([% serial.subscriptionid |html %], '[% serial.serialseq |html %]'); return false" >Print list</a> >- </td> >+ [% IF ( routing ) %] >+ <td> >+ <a href="" onclick="print_slip([% serial.subscriptionid |html %], '[% serial.serialseq |html %]'); return false" >Print list</a> >+ </td> >+ [% END %] > [% IF ( CAN_user_serials_receive_serials ) %] > <td> > [% IF ( serial.cannotedit ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >index f82f791..083580b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >@@ -431,12 +431,12 @@ $(document).ready(function() { > [% INCLUDE 'serials-menu.inc' %] > <ul> > [% FOREACH subscription IN subscriptions %] >- >- <li><a href="serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]" title="serial collection for [% subscription.bibliotitle %]">Serial collection</a></li> >- <li><a href="subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" title="detail of the subscription">Subscription #[% subscription.subscriptionid %]</a></li> >- [% IF ( subscription.abouttoexpire ) %]<a href="#" onclick="javascript:popup([% subscription.subscriptionid %])">Renew [% subscription.subscriptionid %]</a> >+ <li><a href="serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]" title="serial collection for [% subscription.bibliotitle %]">Serial collection #[% subscription.subscriptionid %]</a></li> >+ <li><a href="subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" title="detail of the subscription">Subscription #[% subscription.subscriptionid %]</a></li> >+ [% IF ( subscription.abouttoexpire ) %] >+ <li><a href="#" onclick="javascript:popup([% subscription.subscriptionid %])">Renew #[% subscription.subscriptionid %]</a></li> > [% END %] >- [% END %] >+ [% END %] > <li><a href="/cgi-bin/koha/catalogue/[% default_bib_view %].pl?biblionumber=[% biblionumber %]" title="go to [% bibliotitle %]">Show Biblio</a></li></ul> > </div> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt >index ec1faf3..8c50a17 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt >@@ -84,9 +84,9 @@ Serials updated : > <th>Title</th> > <th> Notes </th> > <th> >- Library (Callnumber) >+ Library (callnumber) > </th> >- [% IF ( routing ) %] >+ [% IF ( routing && CAN_user_serials_routing ) %] > <th>Routing list</th> > [% END %] > <th> </th> >@@ -99,7 +99,7 @@ Serials updated : > <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td> > <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td> > <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td> >- <td></td> >+ [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %] > <td></td> > <td></td> > </tr> >@@ -120,20 +120,20 @@ Serials updated : > [% IF ( subscription.branchcode ) %][% subscription.branchcode %][% END %] > [% IF ( subscription.callnumber ) %]([% subscription.callnumber %])[% END %] > </td> >- [% IF ( routing ) %] >+ [% IF ( routing && CAN_user_serials_routing ) %] > <td> >- [% IF ( subscription.cannotedit ) %] >- >- [% ELSE %] >- [% IF ( subscription.routingedit ) %] >- <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a> >- [% ELSE %] >- <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&op=new">New</a> >- [% END %] >- [% END %] >+ [% IF ( subscription.cannotedit ) %] >+ >+ [% ELSE %] >+ [% IF ( subscription.routingedit ) %] >+ <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&op=new">New</a> >+ [% END %] >+ [% END %] > </td> > [% END %] >- <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue History</a> >+ <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a> > </td> > <td> > [% IF ( subscription.cannotedit ) %] >diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl >index 6746f53..6c8f184 100755 >--- a/serials/routing-preview.pl >+++ b/serials/routing-preview.pl >@@ -99,7 +99,7 @@ if($ok){ > query => $query, > type => "intranet", > authnotrequired => 0, >- flagsrequired => {serials => 'routing'}, >+ flagsrequired => {serials => '*'}, > debug => 1, > }); > $template->param("libraryname"=>$branchname); >@@ -109,7 +109,7 @@ if($ok){ > query => $query, > type => "intranet", > authnotrequired => 0, >- flagsrequired => {serials => 'routing'}, >+ flagsrequired => {serials => '*'}, > debug => 1, > }); > } >diff --git a/serials/serials-collection.pl b/serials/serials-collection.pl >index 4fe55f0..7453e86 100755 >--- a/serials/serials-collection.pl >+++ b/serials/serials-collection.pl >@@ -158,6 +158,7 @@ $template->param( > bibliotitle => $title, > suggestion => C4::Context->preference("suggestion"), > virtualshelves => C4::Context->preference("virtualshelves"), >+ routing => C4::Context->preference("RoutingSerials"), > subscr=>$query->param('subscriptionid'), > subscriptioncount => $subscriptioncount, > location => $locationlib, >diff --git a/serials/subscription-detail.pl b/serials/subscription-detail.pl >index 0b6d35a..afe633e 100755 >--- a/serials/subscription-detail.pl >+++ b/serials/subscription-detail.pl >@@ -124,6 +124,7 @@ $template->param( > subscriptionid => $subscriptionid, > serialslist => \@serialslist, > hasRouting => $hasRouting, >+ routing => C4::Context->preference("RoutingSerials"), > totalissues => $totalissues, > hemisphere => $hemisphere, > cannotedit =>(C4::Context->preference('IndependantBranches') && >-- >1.7.9 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7523
:
7755
| 7818