Bugzilla – Attachment 39272 Details for
Bug 14206
notices using non email templates can't be deleted from the staff client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14206 - Fixes deletion issue for non-email notices
Bug-14206---Fixes-deletion-issue-for-non-email-not.patch (text/plain), 5.00 KB, created by
Indranil Das Gupta
on 2015-05-18 01:03:03 UTC
(
hide
)
Description:
Bug 14206 - Fixes deletion issue for non-email notices
Filename:
MIME Type:
Creator:
Indranil Das Gupta
Created:
2015-05-18 01:03:03 UTC
Size:
5.00 KB
patch
obsolete
>From acc2c6f788f96325644c8313db0ebac3577a33c2 Mon Sep 17 00:00:00 2001 >From: Indranil Das Gupta <indradg@gmail.com> >Date: Mon, 18 May 2015 06:20:59 +0530 >Subject: [PATCH] Bug 14206 - Fixes deletion issue for non-email notices > >message_transport_type was not being passed to routine in letter.pl >routines, so notices that did not include an email template couldn't >be deleted from Tools -> Notices & Slips page. This patch fixes that >issue. > >Test plan >========= > >1/ Go to Tools -> Notices & Slips. Add a new notice only for print, > leave 'Library' and 'Koha module' options as default selections. > Enter 'KOHA_14206' and 'Koha Test 14206' against Code and Name > respectively, and 'Test' and 'Test Message' for subject and body. > Leave the Email, Phone and SMS tabs blank. Save the notice. >2/ On the notices listing page the new notice will be listed. Try to > delete it. It will load the 'Delete notice' dialog form, but the > table will not show any data under <th>s - 'Library', 'Module', > 'Code' or 'Name'. >3/ Click the "Yes, delete" button. The page will be submitted and the > Notices listing reloaded. The print-only KOHA_14206 notice should > continue to exist. This is *wrong*. >4/ Apply the patch >5/ Reload the listings page and click on the 'Delete' link for Notice > KOHA_14206. This time, it should show the data under 'Module', > 'Code' or 'Name' at least. >6/ Click on 'Yes, delete'. The page should submit and the listing page > reload. This time KOHA_14206 will be gone. >7/ Run sql statement SELECT * FROM `letter` WHERE `code` = 'KOHA_14206' > to check actual deletion from the database. No record should be > returned. >8/ Re-add notice KOHA_14206, but this time also add fill in print, > email, phone and sms delivery options. >9/ Delete the newly re-added notice KOHA_14206. It should no longer > be shown in the listing. Confirm deletion by running step #7. > No record should be returned. >10/ run koha qa test tools >--- > koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt | 4 ++-- > tools/letter.pl | 9 +++++---- > 2 files changed, 7 insertions(+), 6 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 3106498..f842060 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -231,7 +231,7 @@ $(document).ready(function() { > </td> > <td> > [% IF !lette.protected && can_edit %] >- <a href="/cgi-bin/koha/tools/letter.pl?op=delete_confirm&branchcode=[%lette.branchcode %]&module=[% lette.module %]&code=[% lette.code %]">Delete</a> >+ <a href="/cgi-bin/koha/tools/letter.pl?op=delete_confirm&branchcode=[%lette.branchcode %]&module=[% lette.module %]&code=[% lette.code %]&mtt=[% lette.message_transport_type %]">Delete</a> > [% END %] > </td> > </tr> >@@ -444,7 +444,7 @@ $(document).ready(function() { > </tr> > </thead> > <tr> >- <td>[% Branches.GetName( letter.branchcode ) %]</td> >+ <td>[% IF letter.branchcode %][% Branches.GetName( letter.branchcode ) %][% ELSE %](All libraries)[% END %]</td> > <td>[% letter.module %]</td> > <td>[% letter.code %]</td> > <td>[% letter.name %]</td> >diff --git a/tools/letter.pl b/tools/letter.pl >index e9f39d9..82316fe 100755 >--- a/tools/letter.pl >+++ b/tools/letter.pl >@@ -66,6 +66,7 @@ my $code = $input->param('code'); > my $module = $input->param('module') || ''; > my $content = $input->param('content'); > my $op = $input->param('op') || ''; >+my $mtt = $input->param('mtt') || ''; > my $dbh = C4::Context->dbh; > > our ( $template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user( >@@ -112,7 +113,7 @@ elsif ( $op eq 'add_form' ) { > add_form($branchcode, $module, $code); > } > elsif ( $op eq 'delete_confirm' ) { >- delete_confirm($branchcode, $module, $code); >+ delete_confirm($branchcode, $module, $code, $mtt); > } > elsif ( $op eq 'delete_confirmed' ) { > delete_confirmed($branchcode, $module, $code); >@@ -293,9 +294,9 @@ sub add_validate { > } > > sub delete_confirm { >- my ($branchcode, $module, $code) = @_; >+ my ($branchcode, $module, $code, $mtt) = @_; > my $dbh = C4::Context->dbh; >- my $letter = C4::Letters::getletter($module, $code, $branchcode); >+ my $letter = C4::Letters::getletter($module, $code, $branchcode, $mtt); > my @values = values %$letter; > $template->param( > letter => $letter, >@@ -325,7 +326,7 @@ sub retrieve_letters { > > my $dbh = C4::Context->dbh; > my ($sql, @where, @args); >- $sql = "SELECT branchcode, module, code, name, branchname >+ $sql = "SELECT branchcode, module, code, name, branchname, message_transport_type > FROM letter > LEFT OUTER JOIN branches USING (branchcode) > "; >-- >1.9.1
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 14206
:
39270
|
39272
|
39283
|
39315
|
39316
|
39321
|
39342
|
39353
|
39354
|
39376
|
39380
|
39467
|
39512
|
39522
|
39523