Bugzilla – Attachment 4426 Details for
Bug 6305
The serials are not working properly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6305: Subscriptions can not be edited
Bug-6305-Subscriptions-can-not-be-edited.patch (text/plain), 11.70 KB, created by
Katrin Fischer
on 2011-06-07 21:51:25 UTC
(
hide
)
Description:
Bug 6305: Subscriptions can not be edited
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2011-06-07 21:51:25 UTC
Size:
11.70 KB
patch
obsolete
>From 409c43a221b44d9bd753ce658994ebedd23a7122 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <Katrin.Fischer.83@web.de> >Date: Tue, 7 Jun 2011 23:50:05 +0200 >Subject: [PATCH] Bug 6305: Subscriptions can not be edited >Content-Type: text/plain; charset="utf-8" > >This seems to fix the problem with editing existing subscriptions. Please test. >--- > .../prog/en/includes/serials-toolbar.inc | 4 +- > .../prog/en/modules/serials/subscription-add.tt | 28 ++++++++++---------- > serials/subscription-add.pl | 12 ++++---- > 3 files changed, 22 insertions(+), 22 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc >index a330601..3e22038 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc >@@ -18,7 +18,7 @@ > [% IF ( subscriptionid ) %] > var editmenu = [ > [% IF ( CAN_user_serials_edit_subscription ) %] >- { text: _("Edit Subscription"), [% IF ( cannotedit ) %]disabled: true, [% END %] url: "/cgi-bin/koha/serials/subscription-add.pl?op=mod&subscriptionid=[% subscriptionid %]" }, >+ { text: _("Edit Subscription"), [% IF ( cannotedit ) %]disabled: true, [% END %] url: "/cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=[% subscriptionid %]" }, > [% END %] > [% IF ( CAN_user_serials_create_subscription ) %] > { text: _("Edit as New (Duplicate)"), [% IF ( cannotedit ) %]disabled: true, [% END %] url: "/cgi-bin/koha/serials/subscription-add.pl?op=dup&subscriptionid=[% subscriptionid %]" }, >@@ -69,7 +69,7 @@ onclick: {fn:function(){popup([% subscriptionid %])}} > > [% IF ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription ) %] > [% UNLESS ( cannotedit ) %] >- <li id="editmenuc"><a id="edit" href="/cgi-bin/koha/serials/subscription-add.pl?op=mod&subscriptionid=[% subscriptionid %]">Edit</a></li> >+ <li id="editmenuc"><a id="edit" href="/cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=[% subscriptionid %]">Edit</a></li> > [% END %] > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >index b20ced4..d5d1615 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >@@ -1,5 +1,5 @@ > [% INCLUDE 'doc-head-open.inc' %] >-<title>Koha › Serials › [% IF ( modname ) %][% bibliotitle |html %] › Modify subscription[% ELSE %]New subscription[% END %]</title> >+<title>Koha › Serials › [% IF ( modify ) %][% bibliotitle |html %] › Modify subscription[% ELSE %]New subscription[% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'calendar.inc' %] > >@@ -931,7 +931,7 @@ $(document).ready(function() { > } > ); > // $(".widelabel").attr("width", "300px"); // labels stay skinny in IE7 anyway. >-[% IF ( modname ) %] >+[% IF ( modify ) %] > set_num_pattern_from_template_vars(); > [% IF ( hemisphere ) %] > is_hemisphere = [% hemisphere %] ; >@@ -952,15 +952,15 @@ $(document).ready(function() { > [% INCLUDE 'header.inc' %] > [% INCLUDE 'serials-search.inc' %] > >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> › [% IF ( modname ) %]<a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid %]"><i>[% bibliotitle |html %]</i></a> › Modify subscription[% ELSE %]New subscription[% END %]</div> >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> › [% IF ( modify ) %]<a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid %]"><i>[% bibliotitle |html %]</i></a> › Modify subscription[% ELSE %]New subscription[% END %]</div> > > <div id="doc3" class="yui-t7"> > > <div id="bd"> >-<h1>[% IF ( modname ) %] Modify subscription for <i>[% bibliotitle |html %]</i>[% ELSE %]Add a new subscription[% END %]</h1> >+<h1>[% IF ( modify ) %] Modify subscription for <i>[% bibliotitle |html %]</i>[% ELSE %]Add a new subscription[% END %]</h1> > <div class="yui-g"> > <form method="post" name="f" action="/cgi-bin/koha/serials/subscription-add.pl"> >-[% IF ( modname ) %] >+[% IF ( modify ) %] > <input type="hidden" name="op" value="modsubscription" /> > <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" /> > [% ELSE %] >@@ -988,7 +988,7 @@ $(document).ready(function() { > (<input type="text" name="title" value="[% bibliotitle %]" disabled="disabled" readonly="readonly" />) <span class="required" title="Subscriptions must be associated with a bibliographic record">Required</span> > <div class="inputnote"> <a href="#" onclick="Plugin(f)">Search for Biblio</a> > [% IF ( CAN_user_editcatalogue ) %] >- [% IF ( modname ) %] >+ [% IF ( modify ) %] > | <a href="#" onclick="addbiblioPopup([% bibnum %]); return false;">Edit biblio</a> > [% ELSE %] > | <a href="#" onclick="addbiblioPopup(); return false;">Create Biblio</a> >@@ -1107,10 +1107,10 @@ $(document).ready(function() { > <ol> > <li> > <label for="acqui_date"> First issue publication date:</label> >- [% UNLESS ( modname ) %]<img src="[% themelang %]/lib/calendar/cal.gif" id="acqui_button" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />[% END %] >- <input type="text" name="firstacquidate" value="[% firstacquidate %]" size="13" maxlength="10" id="acqui_date" [% IF ( modname ) %]disabled="disabled"[% END %] style="border-width: 0px;" /> >+ [% UNLESS ( modify ) %]<img src="[% themelang %]/lib/calendar/cal.gif" id="acqui_button" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />[% END %] >+ <input type="text" name="firstacquidate" value="[% firstacquidate %]" size="13" maxlength="10" id="acqui_date" [% IF ( modify ) %]disabled="disabled"[% END %] style="border-width: 0px;" /> > </li> >- [% IF ( modname ) %]<li><label for="next_acqui_date"> Next issue publication date:</label> >+ [% IF ( modify ) %]<li><label for="next_acqui_date"> Next issue publication date:</label> > <img src="[% themelang %]/lib/calendar/cal.gif" id="next_acqui_button" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" /> > <input type="text" name="nextacquidate" value="[% nextacquidate %]" size="13" maxlength="10" id="next_acqui_date" style="border-width: 0px;" /> > </li>[% END %] >@@ -1118,9 +1118,9 @@ $(document).ready(function() { > <li><!-- both scripts for calendar must follow the input field --> > <script type="text/javascript"> > Calendar.setup({ >- inputField : "[% IF ( modname ) %]next_[% END %]acqui_date", >+ inputField : "[% IF ( modify ) %]next_[% END %]acqui_date", > ifFormat : "[% DHTMLcalendar_dateformat %]", >- button : "[% IF ( modname ) %]next_[% END %]acqui_button", >+ button : "[% IF ( modify ) %]next_[% END %]acqui_button", > align : "Tl", > onUpdate : function(cal) { > irregular_issues.weeks = getWeeksArray(cal.date); >@@ -1134,9 +1134,9 @@ $(document).ready(function() { > } > }); > Calendar.setup({ >- inputField : "[% IF ( modname ) %]next_[% END %]acqui_date", >+ inputField : "[% IF ( modify ) %]next_[% END %]acqui_date", > ifFormat : "[% DHTMLcalendar_dateformat %]", >- button : "[% IF ( modname ) %]next_[% END %]acqui_date", >+ button : "[% IF ( modify ) %]next_[% END %]acqui_date", > align : "Tl", > onUpdate : function(cal) { irregular_issues.weeks = getWeeksArray(cal.date); > irregular_issues.firstissue = cal.date; >@@ -1404,7 +1404,7 @@ $(document).ready(function() { > </tr> > <tr> > <td> >- [% IF ( modname ) %] >+ [% IF ( modify ) %] > Last value > [% ELSE %] > Begins with >diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl >index 7fcccdf..9acee7b 100755 >--- a/serials/subscription-add.pl >+++ b/serials/subscription-add.pl >@@ -43,7 +43,7 @@ my @budgets; > > # Permission needed if it is a modification : edit_subscription > # Permission needed otherwise (nothing or dup) : create_subscription >-my $permission = ($op eq "mod") ? "edit_subscription" : "create_subscription"; >+my $permission = ($op eq "modify") ? "edit_subscription" : "create_subscription"; > > my ($template, $loggedinuser, $cookie) > = get_template_and_user({template_name => "serials/subscription-add.tmpl", >@@ -66,12 +66,12 @@ my $subs; > my $firstissuedate; > my $nextexpected; > >-if ($op eq 'mod' || $op eq 'dup' || $op eq 'modsubscription') { >+if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') { > > my $subscriptionid = $query->param('subscriptionid'); > $subs = GetSubscription($subscriptionid); > ## FIXME : Check rights to edit if mod. Could/Should display an error message. >- if ($subs->{'cannotedit'} && $op eq 'mod'){ >+ if ($subs->{'cannotedit'} && $op eq 'modify'){ > carp "Attempt to modify subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed"; > print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); > } >@@ -91,7 +91,7 @@ if ($op eq 'mod' || $op eq 'dup' || $op eq 'modsubscription') { > letter_loop($subs->{'letter'}, $template); > $nextexpected = GetNextExpected($subscriptionid); > $nextexpected->{'isfirstissue'} = $nextexpected->{planneddate}->output('iso') eq $firstissuedate ; >- $subs->{nextacquidate} = $nextexpected->{planneddate}->output() if($op eq 'mod'); >+ $subs->{nextacquidate} = $nextexpected->{planneddate}->output() if($op eq 'modify'); > unless($op eq 'modsubscription') { > foreach my $length_unit qw(numberlength weeklength monthlength){ > if ($subs->{$length_unit}){ >@@ -107,7 +107,7 @@ if ($op eq 'mod' || $op eq 'dup' || $op eq 'modsubscription') { > $op => 1, > "subtype_$sub_on" => 1, > sublength =>$sub_length, >- history => ($op eq 'mod'), >+ history => ($op eq 'modify'), > "periodicity".$subs->{'periodicity'} => 1, > "numberpattern".$subs->{'numberpattern'} => 1, > firstacquiyear => substr($firstissuedate,0,4), >@@ -160,7 +160,7 @@ if ($op eq 'addsubscription') { > } > $template->param(subtype => \@sub_type_data); > >- letter_loop( '', $template ) if ($op ne 'modsubscription' && $op ne 'dup' && $op ne 'mod'); >+ letter_loop( '', $template ) if ($op ne 'modsubscription' && $op ne 'dup' && $op ne 'modify'); > > my $new_biblionumber = $query->param('biblionumber_for_new_subscription'); > if (defined $new_biblionumber) { >-- >1.7.4.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 6305
: 4426 |
4427
|
4566