Bugzilla – Attachment 30953 Details for
Bug 8587
Add a serial lifespan to serial subscriptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8587 - Follow-up to Comment 22
Bug-8587---Follow-up-to-Comment-22.patch (text/plain), 23.45 KB, created by
Maxime Beaulieu
on 2014-08-18 20:26:21 UTC
(
hide
)
Description:
Bug 8587 - Follow-up to Comment 22
Filename:
MIME Type:
Creator:
Maxime Beaulieu
Created:
2014-08-18 20:26:21 UTC
Size:
23.45 KB
patch
obsolete
>From 97d16ad40c9495c836ea18665f3682d17d841691 Mon Sep 17 00:00:00 2001 >From: mbeaulieu <mbeaulieu@inlibro.com> >Date: Mon, 18 Aug 2014 16:20:18 -0400 >Subject: [PATCH] Bug 8587 - Follow-up to Comment 22 > >1) Removed all useless code. >2) Bug number added in updatadatabase.pl . >3) I've reworked the input form. There is now a select box with 'Permanent' and 'Years' as values. > A number input field appears when 'Years' is selected. Range is from 1 to n years. >4) Help message added in the intranet help. > > modified: installer/data/mysql/updatedatabase.pl > modified: koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-add.tt > modified: koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt > modified: koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >--- > installer/data/mysql/updatedatabase.pl | 2 +- > .../en/modules/help/serials/subscription-add.tt | 1 + > .../prog/en/modules/serials/subscription-add.tt | 292 +++----------------- > .../prog/en/modules/serials/subscription-detail.tt | 54 +--- > 4 files changed, 49 insertions(+), 300 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index d967dbc..bd176f3 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -8616,7 +8616,7 @@ if ( CheckVersion($DBversion) ) { > $DBversion = 'XXX'; > if ( CheckVersion($DBversion) ) { > $dbh->do("ALTER TABLE subscription ADD `serial_lifespan` TINYINT(1) DEFAULT -1"); >- print "Upgrade to $DBversion done (Add serial_lifespan to subscription)\n"; >+ print "Upgrade to $DBversion done (Bug 8587 - Add serial_lifespan to subscription)\n"; > SetVersion ($DBversion); > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-add.tt >index 0a4b54a..aafd56f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-add.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-add.tt >@@ -42,6 +42,7 @@ > <li>If no values are entered in these fields, they will use the OPACSerialIssueDisplayCount and StaffSerialIssueDisplayCount system preference values</li> > </ul> > </li> >+ <li>Serial lifespan: A serial will be considered "out of date" after the chosen time period. This field is not tied to any functionality, and is only used in reports.</li> > <li>In 'First issue publication date' you want to enter the date of the issue you have in your hand, the date from which the prediction pattern will start</li> > <li>There are several pre-defined options for the 'Frequency' of publication > <ul> >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 41bd892..1063ed3 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 >@@ -7,7 +7,7 @@ > <style type="text/css"> > fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ > .yui-u li p label.widelabel { >- width: 300px; /* not enough for IE7 apparently */ >+ width: 300px; /* not enough for IE7 apparently */ > } > </style> > <script type="text/javascript"> >@@ -433,6 +433,22 @@ $(document).ready(function() { > if($("#numberpattern").val() != ""){ > numberpatternload(); > } >+ $("#lifespan_type").change(function(){ >+ if($(this).val() > 0){ >+ $("#serial_lifespan").show(); >+ [% IF serial_lifespan > 0 %] >+ $("#serial_lifespan").val([% serial_lifespan %]); >+ [% ELSE %] >+ $("#serial_lifespan").val(1); >+ [% END %] >+ >+ } >+ else{ >+ $("#serial_lifespan").hide(); >+ $("#serial_lifespan").val(-1); >+ } >+ }); >+ $("#lifespan_type").change(); > > var node; > [% FOREACH field IN dont_export_field_loop %] >@@ -460,261 +476,9 @@ $(document).ready(function() { > <div class="yui-g"> > <h1>[% IF ( modify ) %] Modify subscription for <i>[% bibliotitle |html %]</i>[% ELSE %]Add a new subscription[% END %] (<span id="page_number">1/2</span>)</h1> > <form method="post" name="f" action="/cgi-bin/koha/serials/subscription-add.pl" class="validated" onsubmit="return Check_page2();" > >- >-[% IF ( modify ) %] >- <input type="hidden" name="op" value="modsubscription" /> >- <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" /> >-[% ELSE %] >- <input type="hidden" name="op" value="addsubscription" /> >-[% END %] >-<input type="hidden" name="user" value="[% loggedinusername %]" /> >-<input type="hidden" name="irreg_check" value="0" /> >-<input type="hidden" name="issuesexpected1" id="issuesexpected1" value="0" /> >- >- <div class="yui-u first"> >- <fieldset id="subscription_add_information" class="rows"> >- <legend>Subscription details</legend> >- <ol> >- [% IF ( subscriptionid ) %] >- <li><span class="label">Subscription #</span> [% subscriptionid %]</li> >- [% END %] >- <li> >- <label for="aqbooksellerid">Vendor: </label> >- <input type="text" name="aqbooksellerid" id="aqbooksellerid" value="[% aqbooksellerid %]" size="8" /> (<input type="text" name="aqbooksellername" value="[% aqbooksellername %]" disabled="disabled" readonly="readonly" />) <a href="#" onclick="FindAcqui(f)">Search for a vendor</a> >- </li> >- <li> >- <label for="biblionumber" class="required" title="Subscriptions must be associated with a bibliographic record">Biblio:</label> >- >- <input type="text" name="biblionumber" id="biblionumber" value="[% bibnum %]" size="8" /> >- (<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 ( modify ) %] >- | <a href="#" onclick="addbiblioPopup([% bibnum %]); return false;">Edit biblio</a> >- [% ELSE %] >- | <a href="#" onclick="addbiblioPopup(); return false;">Create Biblio</a> >- [% END %] >- [% END %] >- </div> >- >- </li> >- <li class="radio"> >- [% IF ( serialsadditems ) %] >- <p><input type="radio" id="serialsadditems-yes" name="serialsadditems" value="1" checked="checked" /><label class="widelabel" for="serialsadditems-yes">create an item record when receiving this serial</label></p> >- <p><input type="radio" id="serialsadditems-no" name="serialsadditems" value="0" /><label class="widelabel" for="serialsadditems-no">do not create an item record when receiving this serial </label></p> >- [% ELSE %] >- <p><input type="radio" id="serialsadditems-yes" name="serialsadditems" value="1"/><label class="widelabel" for="serialsadditems-yes">create an item record when receiving this serial</label></p> >- <p><input type="radio" id="serialsadditems-no" name="serialsadditems" value="0" checked="checked" /><label class="widelabel" for="serialsadditems-no">do not create an item record when receiving this serial</label></p> >- [% END %] >- </li> >- <li> >- <label for="serial_lifespan">Serial lifespan:</label> >- <select name="serial_lifespan" id="serial_lifespan"> >- [% IF ( serial_lifespan == -1 ) %] >- <option value="-1" selected="selected">Permanent</option> >- [% ELSE %] >- <option value="-1">Permanent</option> >- [% END %] >- [% IF ( serial_lifespan == 1 ) %] >- <option value="1" selected="selected">1 year</option> >- [% ELSE %] >- <option value="1">1 year</option> >- [% END %] >- [% IF ( serial_lifespan == 2 ) %] >- <option value="2" selected="selected">2 years</option> >- [% ELSE %] >- <option value="2">2 years</option> >- [% END %] >- [% IF ( serial_lifespan == 3 ) %] >- <option value="3" selected="selected">3 years</option> >- [% ELSE %] >- <option value="3">3 years</option> >- [% END %] >- [% IF ( serial_lifespan == 4 ) %] >- <option value="4" selected="selected">4 years</option> >- [% ELSE %] >- <option value="4">4 years</option> >- [% END %] >- [% IF ( serial_lifespan == 5 ) %] >- <option value="5" selected="selected">5 years</option> >- [% ELSE %] >- <option value="5">5 years</option> >- [% END %] >- [% IF ( serial_lifespan == 6 ) %] >- <option value="6" selected="selected">6 years</option> >- [% ELSE %] >- <option value="6">6 years</option> >- [% END %] >- [% IF ( serial_lifespan == 7 ) %] >- <option value="7" selected="selected">7 years</option> >- [% ELSE %] >- <option value="7">7 years</option> >- [% END %] >- [% IF ( serial_lifespan == 8 ) %] >- <option value="8" selected="selected">8 years</option> >- [% ELSE %] >- <option value="8">8 years</option> >- [% END %] >- [% IF ( serial_lifespan == 9 ) %] >- <option value="9" selected="selected">9 years</option> >- [% ELSE %] >- <option value="9">9 years</option> >- [% END %] >- [% IF ( serial_lifespan == 10 ) %] >- <option value="10" selected="selected">10 years</option> >- [% ELSE %] >- <option value="10">10 years</option> >- [% END %] >- </select> >- <div class="hint">Set the subscription's serial lifespan. A serial will be considered "out of date" after the chosen time period.</div> >- </li> >- <li> >- <label for="branchcode">Library:</label> >- >- <select name="branchcode" id="branchcode" style="width: 20em;"> >- [% UNLESS ( IndependentBranches ) %]<option value="">None</option>[% END %] >- [% FOREACH branchloo IN branchloop %][% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option> >- [% ELSE %] >- <option value="[% branchloo.value %]">[% branchloo.branchname %]</option> >- [% END %] >- [% END %] >- </select> (select a library) >- >- </li> >- <li> >- <label for="location">Location:</label> >- <select name="location" id="location"> >- <option value="">None</option> >- [% FOREACH locations_loo IN locations_loop %][% IF ( locations_loo.selected ) %]<option value="[% locations_loo.authorised_value %]" selected="selected">[% locations_loo.lib %]</option>[% ELSE %]<option value="[% locations_loo.authorised_value %]">[% locations_loo.lib %]</option>[% END %][% END %] >- </select> >- </li> >- <li> >- <label for="callnumber">Call number:</label> >- <input type="text" name="callnumber" id="callnumber" value="[% callnumber %]" size="20" /> >- </li> >- <li> >- <label for="graceperiod">Grace period:</label> <input type="text" name="graceperiod" id="graceperiod" value="[% graceperiod %]" size="5"/> day(s) >- </li> >- <li> >- <label for="notes">OPAC note:</label> >- <textarea name="notes" id="notes" cols="30" rows="2">[% notes %]</textarea> >- </li> >- <li> >- <label for="internalnotes">Nonpublic note:</label> >- <textarea name="internalnotes" id="internalnotes" cols="30" rows="2">[% internalnotes %]</textarea> >- </li> >- <li> >- >- [% IF ( letterloop ) %] >- <label for="letter">Patron notification: </label> >- <select name="letter" id="letter"> >- <option value="">None</option> >- [% FOREACH letterloo IN letterloop %] >- [% IF ( letterloo.selected ) %] >- <option value="[% letterloo.value %]" selected="selected">[% letterloo.lettername %]</option> >-[% ELSE %] >- <option value="[% letterloo.value %]">[% letterloo.lettername %]</option> >-[% END %] >- [% END %] >- </select> >- <div class="hint">Select a notice and subscribers will be notified when new issues are received.</div> >- [% ELSE %] >- <span class="label">Patron notification: </span> >- <div class="hint">To notify patrons of new serial issues, you must <a href="/cgi-bin/koha/tools/letter.pl">define a notice</a>.</div> >- [% END %] >- </li> >- <li> >- <label class="widelabel" for="staffdisplaycount">Number of issues to display to staff: </label> >- <input type="text" name="staffdisplaycount" id="staffdisplaycount" value="[% staffdisplaycount %]" size="4"/> >- </li> >- <li> >- <label class="widelabel" for="opacdisplaycount">Number of issues to display in OPAC: </label> >- <input type="text" name="opacdisplaycount" id="opacdisplaycount" value="[% opacdisplaycount %]" size="4"/> >- </li> >- </ol> >- </fieldset> >- </div> >- >-<div class="yui-u"> >-<div id="subscription_form_history" style="display:none"><h3 style="display:inline">Subscription history</h3> <a href="#" id="cancel_manual_history">[cancel manual history]</a> >- <p>Hint: you can update the serial history manually. This can be useful for an old subscription or to clean the existing history. Modify these fields with care, as future serial receive will continue to update them automatically.</p> >- <fieldset class="rows"> >- <ol> >- <li> >- <label for="histstartdate">Subscription start date: </label> >- <input type="text" name="histstartdate" id="histstartdate" value="[% histstartdate %]" /><div class="hint"> (start date of the 1st subscription)</div> >- </li> >- <li> >- <label for="histenddate">Subscription end date: </label> >- <input type="text" name="histenddate" id="histenddate" value="[% histenddate %]" /> <div class="hint">(if empty, subscription is still active)</div> >- </li> >- <li> >- <label for="recievedlist">Received issues: </label> >- <textarea name="recievedlist" id="recievedlist" cols="60" rows="5">[% recievedlist %]</textarea> >- </li> >- <li> >- <label for="missinglist">Missing issues: </label> >- <textarea name="missinglist" id="missinglist" cols="60" rows="5">[% missinglist %]</textarea> >- </li> >- <li> >- <label for="opacnote">Note for OPAC: </label> >- <textarea name="opacnote" id="opacnote" cols="60" rows="5">[% opacnote %]</textarea> >- </li> >- <li> >- <label for="librariannote">Note for staff: </label> >- <textarea name="librariannote" id="librariannote" cols="60" rows="5">[% librariannote %]</textarea> >- </li> >- </ol> >- </fieldset> >- <fieldset class="action"><input type="submit" value="Save subscription history" /></fieldset> >-</div> >- >-<div id="subscription_form_planning"> >- <fieldset class="rows"> >- <legend>Serials planning</legend> >- <ol> >- <li> >- <label for="acqui_date"> First issue publication date:</label> >- [% IF ( modify ) %]<input type="text" name="firstacquidate" value="[% firstacquidate %]" size="13" maxlength="10" id="acqui_date" disabled="disabled" /> >- [% ELSE %]<input type="text" name="firstacquidate" value="[% firstacquidate %]" size="13" maxlength="10" id="acqui_date" class="datepicker" />[% END %] >- </li> >- [% IF ( modify ) %]<li><label for="next_acqui_date"> Next issue publication date:</label> >- <input type="text" name="nextacquidate" value="[% nextacquidate %]" size="13" maxlength="10" id="next_acqui_date" class="datepicker" /> >- </li>[% END %] >- >- <li> >- <label for="periodicity" class="required">Frequency:</label> >- <select name="periodicity" size="1" id="periodicity" onchange="javascript:document.getElementsByName('manualhist')[0].checked=(this.value==1); reset_num_pattern();"> >- <option value="" selected="selected">-- please choose --</option> >- [% IF ( periodicity16 ) %] >- <option value="16" selected="selected">Without periodicity</option> >- [% ELSE %] >- <option value="16">Without periodicity</option> >- [% END %] >- [% IF ( periodicity48 ) %] >- <option value="48" selected="selected">Unknown</option> >- [% ELSE %] >- <option value="48">Unknown</option> >- [% END %] >- [% IF ( periodicity32 ) %] >- <option value="32" selected="selected">Irregular</option> >- [% ELSE %] >- <option value="32">Irregular</option> >- [% END %] >- >- [% IF ( periodicity12 ) %] >- <option value="12" selected="selected">2/day</option> >- [% ELSE %] >- <option value="12">2/day</option> >- [% END %] >- [% IF ( periodicity1 ) %] >- <option value="1" selected="selected">daily (n/week)</option> >- [% ELSE %] >- <option value="1">daily (n/week)</option> >- [% END %] >- [% IF ( periodicity2 ) %] >- <option value="2" selected="selected">1/week</option> >->>>>>>> Bug 8587 - Add a serial lifespan field to serial subscriptions >+ [% IF ( modify ) %] >+ <input type="hidden" name="op" value="modsubscription" /> >+ <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" /> > [% ELSE %] > <input type="hidden" name="op" value="addsubscription" /> > [% END %] >@@ -872,6 +636,22 @@ $(document).ready(function() { > <legend>Serials planning</legend> > <ol> > <li> >+ <label for="serial_lifespan">Serial lifespan:</label> >+ <select id="lifespan_type"> >+ [% IF ( !serial_lifespan || serial_lifespan < 1 ) %] >+ <option value="-1" selected="selected">Permanent</option> >+ <option value="1">Years</option> >+ [% ELSE %] >+ <option value="-1">Permanent</option> >+ <option value="1" selected="selected">Years</option> >+ [% END %] >+ </select> >+ >+ <input name="serial_lifespan" id="serial_lifespan" type="number" min="1" >+ value="[% IF serial_lifespan %][% serial_lifespan %][% ELSE %]-1[% END %]"/> >+ <div class="hint">Set the subscription's serial lifespan. A serial will be considered "out of date" after the chosen time period.</div> >+ </li> >+ <li> > <label for="firstacquidate" class="required">First issue publication date:</label> > [% UNLESS (more_than_one_serial) %] > <input type="text" size="10" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]" class="datepicker required" required="required" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >index a605550..1c6436c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >@@ -181,29 +181,13 @@ $(document).ready(function() { > [% IF ( weeklength ) %]<li><span class="label">Number of weeks:</span> [% weeklength %]</li>[% END %] > [% IF ( monthlength ) %]<li><span class="label">Number of months:</span> [% monthlength %]</li>[% END %] > <li><span class="label">Serial lifespan:</span> >- [% IF serial_lifespan == -1 %] >- <span>Permanent</span> >- [% ELSIF ( serial_lifespan == 1 ) %] >- <span>1 year</span> >- [% ELSIF ( serial_lifespan == 2 ) %] >- <span>2 years</span> >- [% ELSIF ( serial_lifespan == 3 ) %] >- <span>3 years</span> >- [% ELSIF ( serial_lifespan == 4 ) %] >- <span>4 years</span> >- [% ELSIF ( serial_lifespan == 5 ) %] >- <span>5 years</span> >- [% ELSIF ( serial_lifespan == 6 ) %] >- <span>6 years</span> >- [% ELSIF ( serial_lifespan == 7 ) %] >- <span>7 years</span> >- [% ELSIF ( serial_lifespan == 8 ) %] >- <span>8 years</span> >- [% ELSIF ( serial_lifespan == 9 ) %] >- <span>9 years</span> >- [% ELSIF ( serial_lifespan == 10 ) %] >- <span>10 years</span> >- [% END %] >+ [% IF serial_lifespan == -1 %] >+ <span>Permanent</span> >+ [% ELSIF serial_lifespan == 1%] >+ <span>[% serial_lifespan %] year</span> >+ [% ELSE %] >+ <span>[% serial_lifespan %] years</span> >+ [% END %] > </li> > </ol> > </div> >@@ -276,26 +260,10 @@ $(document).ready(function() { > <label>Serial lifespan :</label> > [% IF serial_lifespan == -1 %] > <span>Permanent</span> >- [% ELSIF ( serial_lifespan == 1 ) %] >- <span>1 year</span> >- [% ELSIF ( serial_lifespan == 2 ) %] >- <span>2 years</span> >- [% ELSIF ( serial_lifespan == 3 ) %] >- <span>3 years</span> >- [% ELSIF ( serial_lifespan == 4 ) %] >- <span>4 years</span> >- [% ELSIF ( serial_lifespan == 5 ) %] >- <span>5 years</span> >- [% ELSIF ( serial_lifespan == 6 ) %] >- <span>6 years</span> >- [% ELSIF ( serial_lifespan == 7 ) %] >- <span>7 years</span> >- [% ELSIF ( serial_lifespan == 8 ) %] >- <span>8 years</span> >- [% ELSIF ( serial_lifespan == 9 ) %] >- <span>9 years</span> >- [% ELSIF ( serial_lifespan == 10 ) %] >- <span>10 years</span> >+ [% ELSIF serial_lifespan == 1%] >+ <span>[% serial_lifespan %] year</span> >+ [% ELSE %] >+ <span>[% serial_lifespan %] years</span> > [% END %] > </p> > <table> >-- >1.7.9.5
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 8587
:
11424
|
11437
|
11447
|
11513
|
17600
|
19415
|
19416
|
30636
|
30637
|
30953
|
41217