Bugzilla – Attachment 5086 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]
Proposed fix
0001-Fix-for-Bug-4419-cannot-change-module-for-notice-tem.patch (text/plain), 2.88 KB, created by
Owen Leonard
on 2011-08-22 15:13:48 UTC
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2011-08-22 15:13:48 UTC
Size:
2.88 KB
patch
obsolete
>From 9adee439b5b5e72533f99f847e6f364d7d06f659 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 22 Aug 2011 11:08:59 -0400 >Subject: [PATCH] Fix for Bug 4419 - cannot change module for notice templates >Content-Type: text/plain; charset="utf-8" > >Adding a hidden form field to contain the original module >so that it can be used in the check for an existing entry. >--- > .../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.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