Bugzilla – Attachment 24861 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]
[SIGNED-OFF] Bug 11625 - Default to logged in library for circ rules and notices & slips
SIGNED-OFF-Bug-11625---Default-to-logged-in-librar.patch (text/plain), 4.11 KB, created by
Owen Leonard
on 2014-01-29 12:45:18 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 11625 - Default to logged in library for circ rules and notices & slips
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2014-01-29 12:45:18 UTC
Size:
4.11 KB
patch
obsolete
>From 83c0e66990ea448486f0f5b471f64fbc61ec4b76 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] [SIGNED-OFF] Bug 11625 - Default to logged in library for > circ rules and notices & slips >Content-Type: text/plain; charset="utf-8" > >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> >--- > 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 5d4166d..68c5d42 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -43,7 +43,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 52e2b83..3f4480c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -143,7 +143,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 7582e66..9de95fb 100755 >--- a/tools/letter.pl >+++ b/tools/letter.pl >@@ -85,15 +85,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( > { >@@ -106,6 +98,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.9.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