Bugzilla – Attachment 41797 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: Implement DefaultToLoggedInLibraryNoticesSlips
SIGNED-OFF-Bug-11625-Implement-DefaultToLoggedInLi.patch (text/plain), 4.55 KB, created by
Kyle M Hall (khall)
on 2015-08-21 19:01:20 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 11625: Implement DefaultToLoggedInLibraryNoticesSlips
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-08-21 19:01:20 UTC
Size:
4.55 KB
patch
obsolete
>From 3818f4895d93696e2a6b541d16ce3872ee2d54fe Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 23 Apr 2015 15:41:17 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 11625: Implement DefaultToLoggedInLibraryNoticesSlips > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../intranet-tmpl/prog/en/modules/tools/letter.tt | 2 +- > tools/letter.pl | 19 +++++++++++++------ > 2 files changed, 14 insertions(+), 7 deletions(-) > >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 1d4bfbc..da066c8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -166,7 +166,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 bb54d7e..1cf6a30 100755 >--- a/tools/letter.pl >+++ b/tools/letter.pl >@@ -62,6 +62,7 @@ our $input = new CGI; > my $searchfield = $input->param('searchfield'); > my $script_name = '/cgi-bin/koha/tools/letter.pl'; > our $branchcode = $input->param('branchcode'); >+$branchcode = '' if defined $branchcode and $branchcode eq '*'; > my $code = $input->param('code'); > my $module = $input->param('module') || ''; > my $content = $input->param('content'); >@@ -98,7 +99,7 @@ if ( $op eq 'add_validate' or $op eq 'copy_validate' ) { > } > if ($op eq 'copy_form') { > my $oldbranchcode = $input->param('oldbranchcode') || q||; >- my $branchcode = $input->param('branchcode') || q||; >+ my $branchcode = $input->param('branchcode'); > add_form($oldbranchcode, $module, $code); > $template->param( > oldbranchcode => $oldbranchcode, >@@ -244,7 +245,7 @@ sub add_form { > > sub add_validate { > my $dbh = C4::Context->dbh; >- my $branchcode = $input->param('branchcode') || ''; >+ my $branchcode = $input->param('branchcode'); > my $module = $input->param('module'); > my $oldmodule = $input->param('oldmodule'); > my $code = $input->param('code'); >@@ -260,7 +261,7 @@ sub add_validate { > > # getletter can return the default letter even if we pass a branchcode > # If we got the default one and we needed the specific one, we didn't get the one we needed! >- if ( $letter and $branchcode ne $letter->{branchcode} ) { >+ if ( $letter and $branchcode and $branchcode ne $letter->{branchcode} ) { > $letter = undef; > } > unless ( $title and $content ) { >@@ -276,14 +277,14 @@ sub add_validate { > WHERE branchcode = ? AND module = ? AND code = ? AND message_transport_type = ? > }, > undef, >- $branchcode, $module, $name, $is_html || 0, $title, $content, >+ $branchcode || '', $module, $name, $is_html || 0, $title, $content, > $branchcode, $oldmodule, $code, $mtt > ); > } else { > $dbh->do( > q{INSERT INTO letter (branchcode,module,code,name,is_html,title,content,message_transport_type) VALUES (?,?,?,?,?,?,?,?)}, > undef, >- $branchcode, $module, $code, $name, $is_html || 0, $title, $content, $mtt >+ $branchcode || '', $module, $code, $name, $is_html || 0, $title, $content, $mtt > ); > } > } >@@ -307,7 +308,7 @@ sub delete_confirmed { > my ($branchcode, $module, $code, $mtt) = @_; > C4::Letters::DelLetter( > { >- branchcode => $branchcode, >+ branchcode => $branchcode || '', > module => $module, > code => $code, > mtt => $mtt >@@ -353,6 +354,12 @@ sub retrieve_letters { > sub default_display { > my ($branchcode, $searchfield) = @_; > >+ unless ( defined $branchcode ) { >+ if ( C4::Context->preference('DefaultToLoggedInLibraryNoticesSlips') ) { >+ $branchcode = C4::Branch::mybranch(); >+ } >+ } >+ > if ( $searchfield ) { > $template->param( search => 1 ); > } >-- >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