Bugzilla – Attachment 5135 Details for
Bug 4419
Cannot change module for notice templates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Fix for Bug 4419 - cannot change module for notice templates
SIGNED-OFF-Fix-for-Bug-4419---cannot-change-module.patch (text/plain), 2.92 KB, created by
Nicole C. Engard
on 2011-08-25 00:12:24 UTC
(
hide
)
Description:
[SIGNED-OFF] Fix for Bug 4419 - cannot change module for notice templates
Filename:
MIME Type:
Creator:
Nicole C. Engard
Created:
2011-08-25 00:12:24 UTC
Size:
2.92 KB
patch
obsolete
>From 9a78ac3ca4d97f1cf8ca647fd2f2ad9c4081257c Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 22 Aug 2011 11:08:59 -0400 >Subject: [PATCH] [SIGNED-OFF] Fix for Bug 4419 - cannot change module for notice templates > >Adding a hidden form field to contain the original module >so that it can be used in the check for an existing entry. > >Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com> >--- > .../intranet-tmpl/prog/en/modules/tools/letter.tt | 1 + > tools/letter.pl | 18 ++++++++++-------- > 2 files changed, 11 insertions(+), 8 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 1ec73c5..063236e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -184,6 +184,7 @@ $(document).ready(function() { > <ol> > <li> > <label for="module">Koha module:</label> >+ <input type="hidden" name="oldmodule" value="[% module %]" /> > [% IF ( modify ) %]<select name="module" id="module">[% END %] [% IF ( adding ) %] <select name="module" id="module" onchange="javascript:window.location.href = unescape(window.location.pathname)+'?op=add_form&module='+this.value+'&content='+window.document.forms['Aform'].elements['content'].value;">[% END %] > [% IF ( catalogue ) %] > <option value="catalogue" selected="selected">Catalog</option> >diff --git a/tools/letter.pl b/tools/letter.pl >index 39c2ffb..f5dc0c6 100755 >--- a/tools/letter.pl >+++ b/tools/letter.pl >@@ -179,6 +179,7 @@ sub add_form { > name => $letter->{name}, > title => $letter->{title}, > content => $letter->{content}, >+ module => $module, > $module => 1, > SQLfieldname => $field_selection, > ); >@@ -186,18 +187,19 @@ sub add_form { > } > > sub add_validate { >- my $dbh = C4::Context->dbh; >- my $module = $input->param('module'); >- my $code = $input->param('code'); >- my $name = $input->param('name'); >- my $title = $input->param('title'); >- my $content = $input->param('content'); >- if (letter_exists($module, $code)) { >+ my $dbh = C4::Context->dbh; >+ my $module = $input->param('module'); >+ my $oldmodule = $input->param('oldmodule'); >+ my $code = $input->param('code'); >+ my $name = $input->param('name'); >+ my $title = $input->param('title'); >+ my $content = $input->param('content'); >+ if (letter_exists($oldmodule, $code)) { > $dbh->do( > q{UPDATE letter SET module = ?, code = ?, name = ?, title = ?, content = ? WHERE module = ? AND code = ?}, > undef, > $module, $code, $name, $title, $content, >- $module, $code >+ $oldmodule, $code > ); > } else { > $dbh->do( >-- >1.7.2.3
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 4419
:
5086
| 5135