Koha/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt
Jonathan Druart c39380ed4e Bug 8782: Close a subscription
If a subscription is no longer enough published (or we are not waiting
for a new periodical) we are allowed to close it.
If a subscription is closed, we are not able to receive or generate a
new serial.

On the serial module, we can now
- close a subscriptionn
- reopen a closed subscription

On serial search 2 tabs is displayed (opened and closed subscriptions).

This patch adds:
- a new field subscription.closed in DB
- a new status for serials (8 = stopped)

Test plan:
- search subscriptions
- close a subscription and check that you cannot receive or generate a
  new serial
- launch another search and check that the closed serial is into the "closed"
  tab.
- You are allowed to reopen a subscription on the subscription detail
  page and on the subscription result page. A javascript alert ask you
  if are certain to do this operation.
- Check the serial status "stopped" everywhere the status is
  displayed (catalogue/detail.pl, serials/claims.pl,
  serials/serial-issues-full.pl, serials/serials-collection.pl,
  serials/serials-edit.pl, serials/serials-recieve.pl,
  serials/subscription-detail.pl and opac-full-serial-issues.pl)
- The report statistics does not include the closed subscriptions if you
  don't check the "Include expired subscriptions" checkbox.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 8782: Followup: add some minor modifications

- Show 'closed' information in biblio detail page
- Add a column in serials report table
- Search subscriptions on title words instead of string
- Prevent serials editing when subscription is closed
- Don't change status of "disabled" serials

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 8782 - Close a subscription - Followup - Fix updatedatabase.pl

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-11-30 08:14:24 -05:00

343 lines
12 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Serials &rsaquo; Check in subscription for [% bibliotitle %]</title>
[% INCLUDE 'doc-head-close.inc' %]
<script language="JavaScript" type="text/javascript">
//<![CDATA[
function popup() {
window.open("subscription-renew.pl?subscriptionid=[% subscriptionid %]","subscription_renewal",'width=700,height=400,toolbar=false,scrollbars=yes');
}
function barcode_check(){
[% IF ( count ) %]
var count = '[% count %]';
for(var i=1;i<=count;i++){
var barcodenum = "barcode"+i;
var statusnum = "status"+i;
var elembarcode = "document.getElementById('"+barcodenum+"')";
var elemstatus = "document.getElementById('"+statusnum+"')";
// alert(elembarcode+"\n"+eval(elembarcode+".value));
// alert(elemstatus+"\n"+eval(elemstatus+".value"));
if(eval(elembarcode+".value") =='' && eval(elemstatus+".value") == 2){
var answer = confirm("Leave barcode blank?\n - Note: unable to change this later");
if (answer){
document.f.submit();
} else {
return false;
}
}
if(eval(elembarcode+".value".indexOf('TEMP')) > 0 && eval(elemstatus+".value") == 2){
var answer = confirm("A barcode was not entered.\nDo you want to put in a barcode\nor do you want to use a system generated barcode?");
if (answer){
document.f.submit();
} else {
return false;
}
}
}
[% END %]
}
//]]>
</script>
</head>
<body id="ser_serials-recieve" class="ser">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'serials-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Check in subscription for <i>[% bibliotitle %]</i></div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<h1>Check In subscription for <i>[% bibliotitle %]</i></h1>
<div id="action">
<a href="subscription-detail.pl?subscriptionid=[% subscriptionid %]" title="detail of the subscription">Subscription Details</a>
<!-- <a href="/cgi-bin/koha/serials/serials-home.pl?biblionumber=[% biblionumber %]" class="button" title="all subscriptions on [% bibliotitle %]">Search all subscriptions</a> -->
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]" title="go to [% bibliotitle %]">Show biblio</a>
[% IF ( routing ) %]
<a href="routing.pl?subscriptionid=[% subscriptionid %]" title="subscription routing list">Routing list</a>
[% END %]
</div>
<h2>Expected or late</h2>
<form method="post" name="f" action="serials-recieve.pl" onsubmit="return barcode_check()">
<input type="hidden" name="op" value="serialchangestatus" />
<input type="hidden" name="serial" value="[% serial %]" />
<input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
<input type="hidden" name="user" value="[% user %]" />
<table>
<tr>
<th>Numbered</th>
<th>Published on</th>
<th>Planned for</th>
<th>Status</th>
<th>Notes</th>
</tr>
[% FOREACH serialslis IN serialslist %]
<tr>
<td>
Issue <input type="text" name="serialseq" value="[% serialslis.serialseq %]" size="20" maxlength="100" />
[% IF ( serialslis.serialadditems ) %]
<br /><br />
Call number <input type="text" name="itemcallnumber" value="[% serialslis.callnumber %]" size="15" maxlength="100" />
Barcode <input type="text" name="barcode" value="[% serialslis.barcode %]" id="barcode[% serialslis.num %]" size="20" maxlength="20" />
[% END %]
</td>
<td>
<input type="text" name="publisheddate" value="[% serialslis.publisheddate %]" size="10" maxlength="15" />
[% IF ( serialslis.serialadditems ) %]
<br /><br />&nbsp;
[% END %]
</td>
<td>
<input type="text" name="planneddate" value="[% serialslis.planneddate %]" size="10" maxlength="15" />
[% IF ( serialslis.serialadditems ) %]
<br /><br />
<select name="branch">
<option value="">Library</option>
[% FOREACH branchloo IN serialslis.branchloop %][% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
[% ELSE %]
<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
[% END %]
[% END %]
</select>
[% END %]
</td>
<td>
<input type="hidden" name="serialid" value="[% serialslis.serialid %]" />
<select name="status" id="status[% serialslis.num %]">
[% IF ( serialslis.status1 ) %]
<option value="1" selected="selected">Expected</option>
[% END %]
[% IF ( serialslis.status2 ) %]
<option value="2" selected="selected">Arrived</option>
[% ELSE %]
<option value="2">Arrived</option>
[% END %]
[% IF ( serialslis.status3 ) %]
<option value="3" selected="selected">Late</option>
[% ELSE %]
<option value="3">Late</option>
[% END %]
[% IF ( serialslis.status4 ) %]
<option value="4" selected="selected">Missing</option>
[% ELSE %]
<option value="4">Missing</option>
[% END %]
[% IF ( serialslis.status5 ) %]
<option value="5" selected="selected">Not available</option>
[% ELSE %]
<option value="5">Not available</option>
[% END %]
[% IF ( serialslis.status6 ) %]
<option value="6" selected="selected">Delete</option>
[% ELSE %]
<option value="6">Delete</option>
[% END %]
[% IF serialslis.status8 %]
<option value="8" selected="selected">Stopped</option>
[% END %]
</select>
[% IF ( serialslis.serialadditems ) %]
<br /><br />
[% IF ( serialslis.itemstatus ) %]
[% IF ( serialslis.choice ) %]
[% FOREACH itemstatusloo IN serialslis.itemstatusloop %]
[% itemstatusloo.itemlib %]:
[% IF ( itemstatusloo.selected ) %]
<input type="checkbox" name="itemstatus" value="[% itemstatusloo.itemval %]" checked="checked" />
[% ELSE %]
<input type="checkbox" name="itemstatus" value="[% itemstatusloo.itemval %]" />
[% END %]
[% END %]
[% ELSE %]
<select name="itemstatus">
<option value="">Item status</option>
[% FOREACH itemstatusloo IN serialslis.itemstatusloop %]
[% IF ( itemstatusloo.selected ) %]
<option value="[% itemstatusloo.itemval %]" selected="selected">[% itemstatusloo.itemlib %]</option>
[% ELSE %]
<option value="[% itemstatusloo.itemval %]">[% itemstatusloo.itemlib %]</option>
[% END %]
[% END %]
</select>
[% END %]
[% ELSE %]
&nbsp;
[% END %]
[% END %]
</td>
<td>
<input type="text" name="notes" value="[% serialslis.notes %]" size="20" maxlength="255" />
[% IF ( serialslis.serialadditems ) %]
<br /><br />
[% IF ( serialslis.itemlocation ) %]
<select name="location">
<option value="">Location</option>
[% FOREACH itemlocationloo IN serialslis.itemlocationloop %]
[% IF ( itemlocationloo.selected ) %]
<option value="[% itemlocationloo.value %]" selected="selected">[% itemlocationloo.itemlocationname %]</option>
[% ELSE %]
<option value="[% itemlocationloo.value %]">[% itemlocationloo.itemlocationname %]</option>
[% END %]
[% END %]
</select>
[% ELSE %]
&nbsp;
[% END %]
[% END %]
</td>
</tr>
[% END %]
[% UNLESS ( hassubscriptionexpired ) %]
<tr>
<td>
Manual issue <input type="text" name="serialseq" size="30" maxlength="100" value="[% missingseq %]" />
[% IF ( serialadditems ) %]
<br /><br />
Call number <input type="text" name="itemcallnumber" value="" size="10" maxlength="15" />
Barcode <input type="text" name="barcode" value="" size="20" maxlength="20" />
[% END %]
</td>
<td>
<input type="text" name="publisheddate" value="[% publisheddate %]" size="10" maxlength="15" />
[% IF ( serialadditems ) %]
<br /><br />&nbsp;
[% END %]
</td>
<td>
<input type="text" name="planneddate" size="10" maxlength="15" value="[% missingdate %]" />
[% IF ( serialadditems ) %]
<br /><br />
<select name="branch">
<option value="">Library</option>
[% 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>
[% END %]
</td>
<td>
[% IF ( frommissing ) %]
<input type="hidden" name="serialid" value="[% missingid %]" />
[% ELSE %]
<input type="hidden" name="serialid" value="0" />
[% END %]
<select name="status">
[% IF ( frommissing ) %]
<option value="2" selected="selected">Arrived</option>
[% ELSE %]
<option value="2">Arrived</option>
[% END %]
[% IF ( frommissing ) %]
<option value="3">Late</option>
[% ELSE %]
<option value="3" selected="selected">Late</option>
[% END %]
<option value="4">Missing</option>
<option value="5">Not available</option>
</select>
[% IF ( serialadditems ) %]
<br /><br />
[% IF ( itemstatus ) %]
[% IF ( choice ) %]
[% FOREACH itemstatusloo IN itemstatusloop %]
[% itemstatusloo.itemlib %]:
[% IF ( itemstatusloo.selected ) %]
<input type="checkbox" name="itemstatus" value="[% itemstatusloo.itemval %]" checked="checked" />
[% ELSE %]
<input type="checkbox" name="itemstatus" value="[% itemstatusloo.itemval %]" />
[% END %]
[% END %]
[% ELSE %]
<select name="itemstatus">
<option value="">Item status</option>
[% FOREACH itemstatusloo IN itemstatusloop %]
[% IF ( itemstatusloo.selected ) %]
<option value="[% itemstatusloo.itemval %]" selected="selected">[% itemstatusloo.itemlib %]</option>
[% ELSE %]
<option value="[% itemstatusloo.itemval %]">[% itemstatusloo.itemlib %]</option>
[% END %]
[% END %]
</select>
[% END %]
[% ELSE %]
&nbsp;
[% END %]
[% END %]
</td>
<td>
&nbsp;
[% IF ( serialadditems ) %]
<br /><br />
[% IF ( itemlocation ) %]
<select name="location">
<option value="">Location</option>
[% FOREACH itemlocationloo IN itemlocationloop %]
[% IF ( itemlocationloo.selected ) %]
<option value="[% itemlocationloo.value %]" selected="selected">[% itemlocationloo.itemlocationname %]</option>
[% ELSE %]
<option value="[% itemlocationloo.value %]">[% itemlocationloo.itemlocationname %]</option>
[% END %]
[% END %]
</select>
[% ELSE %]
&nbsp;
[% END %]
[% END %]
</td>
</tr>
[% END %]
</table>
<input type="submit" value="Save changes" accesskey="w" class="button" />
[% IF ( hassubscriptionexpired ) %]
<h3>Subscription has expired.</h3>
<p><b>Expected issue status can't be changed. <a href="#" onclick="popup()" class="button">Renew</a> your subscription</b></p>
[% END %]
[% IF ( abouttoexpire ) %]
<h3>Note: Subscription is about to expire next issue.</h3>
<script type="text/javascript">
<!--
alert(_("Subscription is about to expire next issue"));
//-->
</script>
[% END %]
</form>
<h2>Subscription summary</h2>
<form method="post" name="f2" action="serials-recieve.pl">
<input type="hidden" name="op" value="modsubscriptionhistory" />
<input type="hidden" name="serial" value="[% serial %]" />
<input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
<input type="hidden" name="user" value="[% user %]" />
<p><label>Librarian</label>[% user %]</p>
<p><label>Starting date:</label><input type="text" name="histstartdate" value="[% histstartdate %]" /> (the date of the 1st subscription)</p>
<p><label>Ending date:</label><input type="text" name="enddate" value="[% enddate %]" />(if empty subscription is still active)</p>
<p>Received issues</p>
<p><textarea name="recievedlist" cols="60" rows="5">[% recievedlist %]</textarea></p>
<p>Missing issues</p>
<p><textarea name="missinglist" cols="60" rows="2">[% missinglist %]</textarea></p>
<p>OPAC note</p>
<p><textarea name="opacnote" cols="60" rows="5">[% opacnote %]</textarea></p>
<input type="submit" value="Save changes" class="button" />
</form>
</div>
</div>
<div class="yui-b">
[% INCLUDE 'serials-menu.inc' %]
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]