Bugzilla – Attachment 43498 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: Implement DefaultToLoggedInLibraryNoticesSlips
Bug-11625-Implement-DefaultToLoggedInLibraryNotice.patch (text/plain), 4.61 KB, created by
Jonathan Druart
on 2015-10-16 11:50:10 UTC
(
hide
)
Description:
Bug 11625: Implement DefaultToLoggedInLibraryNoticesSlips
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-10-16 11:50:10 UTC
Size:
4.61 KB
patch
obsolete
>From 109f51ce1e83df2db10caa8646d0f268d9810b09 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] Bug 11625: Implement DefaultToLoggedInLibraryNoticesSlips > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../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 804ebe4..f4a31eb 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 f4173dc..8467e0f 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, >@@ -248,7 +249,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'); >@@ -264,7 +265,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 ) { >@@ -280,14 +281,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 > ); > } > } >@@ -311,7 +312,7 @@ sub delete_confirmed { > my ($branchcode, $module, $code, $mtt) = @_; > C4::Letters::DelLetter( > { >- branchcode => $branchcode, >+ branchcode => $branchcode || '', > module => $module, > code => $code, > mtt => $mtt >@@ -357,6 +358,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 ); > } >-- >2.1.0
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