Bugzilla – Attachment 38093 Details for
Bug 11625
Default to logged in library for circ rules and notices & slips
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11625 - Default to logged in library for circ rules and notices & slips
Bug-11625---Default-to-logged-in-library-for-circ-.patch (text/plain), 4.19 KB, created by
Kyle M Hall (khall)
on 2015-04-17 16:35:17 UTC
(
hide
)
Description:
Bug 11625 - Default to logged in library for circ rules and notices & slips
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-04-17 16:35:17 UTC
Size:
4.19 KB
patch
obsolete
>From b818cf7eb5d0ac8f3a6457a38a88f5718281426c Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 28 Jan 2014 10:27:07 -0500 >Subject: [PATCH] Bug 11625 - Default to logged in library for circ rules and notices & slips > >This patch makes the default circ rules and notices/slips to edit >the logged in branch, if one is set. > >Test Plan: >1) Apply this patch >2) Log into staff side, and set your library >3) Browse to Administration/Circulation and fines rules >4) Note the rule set selected is for your library >5) Select "All libraries" >6) Note the rule set selected is for "All libraries" >7) Browse to Toos/Notices & slips >8) Note the notice set selected is for your library >9) Select "All libraries" >10) Not the rule set selected is for "All libraries" >11) Click "New Notice" >12) Note the Library field is set to "All libraries" > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Passes QA script and tests. >Small ergonomic improvement, no regressions found. >--- > admin/smart-rules.pl | 2 +- > .../intranet-tmpl/prog/en/modules/tools/letter.tt | 2 +- > tools/letter.pl | 26 +++++++++++++------- > 3 files changed, 19 insertions(+), 11 deletions(-) > >diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl >index 34efefb..3efa2d2 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -44,7 +44,7 @@ my ($template, $loggedinuser, $cookie) > }); > > my $type=$input->param('type'); >-my $branch = $input->param('branch') || ( C4::Branch::onlymine() ? ( C4::Branch::mybranch() || '*' ) : '*' ); >+my $branch = $input->param('branch') || C4::Branch::mybranch(); > my $op = $input->param('op') || q{}; > > if ($op eq 'delete') { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >index 3106498..1c7e46f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -162,7 +162,7 @@ $(document).ready(function() { > <p> > Select a library : > <select name="branchcode" id="branch" style="width:20em;"> >- <option value="">All libraries</option> >+ <option value="*">All libraries</option> > [% FOREACH branchloo IN branchloop %] > [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %] > [% END %] >diff --git a/tools/letter.pl b/tools/letter.pl >index 06f7ae5..7ad55cf 100755 >--- a/tools/letter.pl >+++ b/tools/letter.pl >@@ -58,15 +58,7 @@ sub protected_letters { > return { map { $_->[0] => 1 } @{$codes} }; > } > >-our $input = new CGI; >-my $searchfield = $input->param('searchfield'); >-my $script_name = '/cgi-bin/koha/tools/letter.pl'; >-our $branchcode = $input->param('branchcode'); >-my $code = $input->param('code'); >-my $module = $input->param('module') || ''; >-my $content = $input->param('content'); >-my $op = $input->param('op') || ''; >-my $dbh = C4::Context->dbh; >+our $input = new CGI; > > our ( $template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user( > { >@@ -79,6 +71,22 @@ our ( $template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user > } > ); > >+my $searchfield = $input->param('searchfield'); >+my $script_name = '/cgi-bin/koha/tools/letter.pl'; >+my $code = $input->param('code'); >+my $module = $input->param('module'); >+my $content = $input->param('content'); >+my $op = $input->param('op') || ''; >+ >+# Default to logged in branch for notice list only >+our $branchcode = >+ $input->param('branchcode') eq '*' ? undef >+ : $input->param('branchcode') ? $input->param('branchcode') >+ : $op ? $input->param('branchcode') >+ : C4::Branch::mybranch(); >+ >+my $dbh = C4::Context->dbh; >+ > our $my_branch = C4::Context->preference("IndependentBranches") && !$staffflags->{'superlibrarian'} > ? C4::Context->userenv()->{'branch'} > : undef; >-- >1.7.2.5
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 11625
:
24845
|
24861
|
24941
|
24984
|
24985
|
25839
|
25840
|
35460
|
35461
|
35462
|
35463
|
37055
|
37056
|
37057
|
37058
|
38093
|
38094
|
38095
|
38096
|
38276
|
38277
|
38278
|
38422
|
38424
|
41795
|
41796
|
41797
|
43496
|
43497
|
43498