Bugzilla – Attachment 63486 Details for
Bug 18613
Deleting a Letter from a library as superlibrarian deletes the "All libraries" rule
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18613: Correct behaviour
Bug-18613-Correct-behaviour.patch (text/plain), 2.67 KB, created by
Baptiste Wojtkowski (bwoj)
on 2017-05-16 13:56:29 UTC
(
hide
)
Description:
Bug 18613: Correct behaviour
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2017-05-16 13:56:29 UTC
Size:
2.67 KB
patch
obsolete
>From 8a1090fc976d66aea7ee2e32b4529e59d2e0501f Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Tue, 16 May 2017 13:48:01 +0000 >Subject: [PATCH] Bug 18613: Correct behaviour > >Remove a part of the code which automatically redirects on the library of logged-in user ( not ergonomic behaviour ). > >TEST PLAN: >1- Connect as superlibrarian. >2- Create a rule for all libraries in tools/letter.pl >3- Copy this letter on a precise library, different from the one you are registred on >4- Try to delete the letter => it wants to delete the one from all libraries >5- Apply Patch >6- Try again to delete the letter => it proposes you the good letter >--- > C4/Letters.pm | 13 +++++++------ > koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt | 6 +++++- > 2 files changed, 12 insertions(+), 7 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index cf13bae..2256512 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -203,12 +203,6 @@ sub getletter { > my ( $module, $code, $branchcode, $message_transport_type ) = @_; > $message_transport_type //= '%'; > >- if ( C4::Context->preference('IndependentBranches') >- and $branchcode >- and C4::Context->userenv ) { >- >- $branchcode = C4::Context->userenv->{'branch'}; >- } > $branchcode //= ''; > > my $dbh = C4::Context->dbh; >@@ -223,6 +217,13 @@ sub getletter { > my $line = $sth->fetchrow_hashref > or return; > $line->{'content-type'} = 'text/html; charset="UTF-8"' if $line->{is_html}; >+ >+ if ( C4::Context->preference('IndependentBranches') >+ and ( (not $line->{'branchcode'}) or ( not ($line->{'branchcode'} eq C4::Context->userenv->{'branch'}) ) ) >+ and not C4::Context->IsSuperLibrarian() ){ >+ return; >+ } >+ > return { %$line }; > } > >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 129e1bf..f16e7ce 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -453,7 +453,7 @@ $(document).ready(function() { > </form> > [% END %] > >-[% IF ( delete_confirm ) %] >+[% IF ( delete_confirm and letter ) %] > <div class="dialog alert"> > <h3>Delete notice?</h3> > <table> >@@ -484,6 +484,10 @@ $(document).ready(function() { > <button type="submit" class="deny"><i class="fa fa-times"></i> No, do not delete</button> > </form> > </div> >+[% ELSIF delete_confirm %] >+ <div class="dialog alert"> >+ <h3> You are not allowed to delete this letter </h3> >+ </div> > [% END %] > > [% IF ( delete_confirmed ) %] >-- >2.7.4
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 18613
:
63484
|
63485
|
63486
|
63578
|
64616
|
64912
|
64914
|
64987