Koha/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt
Nick Clemens a05c1cb9a6 Bug 21526: (RM follow-up) Fix merge markers and a few extra filters
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-10-26 19:43:20 +00:00

457 lines
25 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE AuthorisedValues %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Serials &rsaquo; Serial edition [% bibliotitle | html %]</title>
[% INCLUDE 'doc-head-close.inc' %]
[% Asset.js("js/cataloging.js") | $raw %]
[% Asset.js("js/prevent_submit.js") | $raw %]
[% INCLUDE 'calendar.inc' %]
<script>
//<![CDATA[
$(document).ready(function() {
$('#multi_receiving').on('show', function () {
$(this).find(".modal-body").html($(".serials_multi_receiving")[0].outerHTML);
});
});
function popup(subscriptionid) {
window.open("subscription-renew.pl?subscriptionid="+subscriptionid,"subscription_renewal",'width=700,height=400,toolbar=false,scrollbars=yes');
}
function unHideItems(index,labelindex, serialId) {
subfield = document.getElementById(index);
subfield.style.display = 'block';
label = document.getElementById(labelindex);
label.style.display='none';
// Prefilling enumcron subfield with serial enumeration/issue number
// Getting item div
item_div = $("fieldset#" + index + " div.cataloguing_additem_itemlist div.items");
// Getting subfield with enumcron mapping
subfield_div = $(item_div).find("input[name='kohafield'][value='items.enumchron']").parent();
// Setting text field if no saved default value
if(! $(subfield_div).children("input[type='text'][name='field_value']").val() ){
$(subfield_div).children("input[type='text'][name='field_value']").val($("#serialseq" + serialId).val());
}
}
function HideItems(index,labelindex) {
subfield = document.getElementById(index);
subfield.style.display = 'none';
label = document.getElementById(labelindex);
label.style.display='block';
}
function setStatus(serialid){
$("#status"+serialid).val("2").attr("selected","selected");
}
function changeDate(elem, adate) {
$(elem).closest('tr').find('[name=planneddate]').val(adate);
}
$(document).ready(function() {
$("form#serials_edit").submit(function() {
var total_errors = 0;
$(this).find(".cataloguing_additem_itemlist:visible").each(function(){
total_errors = total_errors + CheckMandatorySubfields(this);
});
if ( total_errors > 0 ) {
var mes = _("Form not submitted because of the following problem(s)");
mes += "\n------------------------------------------------------------------------------------\n";
mes += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
alert(mes);
return false;
}
return true;
});
$(".datepicker").datepicker();
});
//]]>
</script>
<style>#serials_edit fieldset.rows label, #serials_edit fieldset.rows span.label {
font-size : 100%;
width : 25%;
}
#serials_edit fieldset.rows select { max-width : 15em; }
#serials_edit fieldset.rows li {
padding-bottom : 3px;
}
#serials_edit .input_marceditor {
width : auto;
}</style>
</head>
<body id="ser_serials-edit" 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; Serial edition <i>[% bibliotitle | html %] [% IF ( callnumber ) %]([% callnumber | html %])[% END %]</i></div>
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
[% INCLUDE 'modals/serials_multi_receiving.inc' %]
<h1>Serial edition <i>[% bibliotitle | html %]</i>
[% IF location %] ([% AuthorisedValues.GetByCode('LOC', location) | html %])[% END %]
[% IF ( callnumber ) %] callnumber: [% callnumber | html %][% END %]</h1>
[% IF internalnotes %]<p>Nonpublic note: [% internalnotes | html %]</p>[% END %]
<form method="post" name="f" action="serials-edit.pl" id="serials_edit">
[% IF ( Errors ) %]
<div class="dialog alert">
<ul>
[% IF ( barcode_not_unique ) %]<li>Error: Barcode not unique for [% FOREACH errse IN errseq %]serialseq [% errse.serialseq | html %]<br/>[% END %]</li>[% END %]
</ul>
</div>
[% END %]
<input type="hidden" name="op" value="serialchangestatus" />
[% FOREACH subscription IN subscriptions %]
<input type="hidden" name="subscriptionid" value="[% subscription.subscriptionid | html %]" />
[% END %]
<table>
<tr>
<th>Numbered</th>
<th>Published on</th>
<th>Published on (text)</th>
<th>Expected on</th>
<th>Status</th>
<th>Notes</th>
</tr>
[% FOREACH serialslis IN serialslist %]
<tr>
<td>
<input type="hidden" name="serialid" value="[% serialslis.serialid | html %]" />
<input type="hidden" name="biblionumber" value="[% serialslis.biblionumber | html %]" />
<input type="hidden" name="itemcount" value="[% serialslis.issuesatonce | html %]" />
<input type="hidden" name="user" value="[% serialslis.librarian | html %]" />
Issue <input type="text" name="serialseq" id="serialseq[% serialslis.serialid | html %]" value="[% serialslis.serialseq | html %]" size="20" maxlength="100" />
</td>
<td>
<input type="text" name="publisheddate" value="[% serialslis.publisheddate | html %]" size="10" maxlength="15" class="datepicker" />
</td>
<td>
<input type="text" name="publisheddatetext" value="[% serialslis.publisheddatetext | html %]" size="10" maxlength="100" />
</td>
<td>
<input type="text" name="planneddate" value="[% serialslis.planneddate | html %]" size="10" maxlength="15" class="datepicker" />
</td>
<td>
[% IF ( serialslis.editdisable ) %]
<input type="hidden" name="status" id="status[% serialslis.serialid | html %]" value="[% serialslis.serstatus | html %]">
<select name="status" size="1" disabled="disabled">
[% ELSE %]
[% IF ( serialslis.serialsadditems ) %]
<select name="status" size="1" id="status[% serialslis.serialid | html %]" onchange="if (this.value==2){unHideItems('items'+[% serialslis.subscriptionid | html %][% serialslis.serialid | html %],'label[% serialslis.subscriptionid | html %][% serialslis.serialid | html %]','[% serialslis.serialid | html %]'); changeDate(this, '[% serialslis.arriveddate | html %]')} else if (this.value==7){changeDate(this, '[% serialslis.arriveddate | html %]')} else { HideItems('items'+[% serialslis.subscriptionid | html %]+[% serialslis.serialid | html %],'label[% serialslis.subscriptionid | html %][% serialslis.serialid | html %]'); changeDate(this, '[% serialslis.planneddate | html %]')}" >
[% ELSE %]
<select name="status" size="1" id="status[% serialslis.serialid | html %]" onchange="if (this.value==2 || this.value==7){changeDate(this, '[% serialslis.arriveddate | html %]')} else {changeDate(this, '[% serialslis.planneddate | html %]')}" >
[% END %]
[% END %]
[% IF ( serialslis.status1 ) %]
<option value="1" selected="selected">Expected</option>
[% ELSE %]
<option value="1">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.status41 ) %]
<option value="41" selected="selected">Missing (never received)</option>
[% ELSE %]
<option value="41">Missing (never received)</option>
[% END %]
[% IF ( serialslis.status42 ) %]
<option value="42" selected="selected">Missing (sold out)</option>
[% ELSE %]
<option value="42">Missing (sold out)</option>
[% END %]
[% IF ( serialslis.status43 ) %]
<option value="43" selected="selected">Missing (damaged)</option>
[% ELSE %]
<option value="43">Missing (damaged)</option>
[% END %]
[% IF ( serialslis.status44 ) %]
<option value="44" selected="selected">Missing (lost)</option>
[% ELSE %]
<option value="44">Missing (lost)</option>
[% END %]
[% IF ( serialslis.status7 ) %]
<option value="7" selected="selected">Claimed</option>
[% ELSE %]
<option value="7">Claimed</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>
</td>
<td>
<input type="text" name="notes" value="[% serialslis.sernotes | html %]" size="20" maxlength="255" />
</td>
</tr>
[% UNLESS ( serialslis.subscriptionexpired ) %]
[% IF ( serialslis.serialsadditems ) %]
<tr>
<td colspan="6">
<a id="label[% serialslis.subscriptionid | html %][% serialslis.serialid | html %]" style="color: grey; font-size: 80%; cursor: pointer;" onclick="unHideItems('items[% serialslis.subscriptionid | html %][% serialslis.serialid | html %]','label[% serialslis.subscriptionid | html %][% serialslis.serialid | html %]', '[% serialslis.serialid | html %]');setStatus([% serialslis.serialid | html %]);">
Click to add item</a>
<fieldset class="rows" style="display:none;" id="items[% serialslis.subscriptionid | html %][% serialslis.serialid | html %]">
<legend><a style="cursor: pointer;" onclick="HideItems('items[% serialslis.subscriptionid | html %][% serialslis.serialid | html %]','label[% serialslis.subscriptionid | html %][% serialslis.serialid | html %]')">
Item</a>
</legend>
<div class="cataloguing_additem_itemlist">
[% FOREACH item IN serialslis.items %]
<div id="item[% item.serialid | html %][% item.countitems | html %]" class="items">
<ol>[% FOREACH iteminformatio IN item.iteminformation %]<li>
<div class="subfield_line" style="[% iteminformatio.hidden | html %]" id="subfield[% item.serialid | html %][% item.countitems | html %][% iteminformatio.subfield | html %][% iteminformatio.random | html %]">
[% IF (iteminformatio.mandatory) %]
<label class="required">[% iteminformatio.subfield | html %] - [% iteminformatio.marc_lib | $raw %]</label>
[% ELSE %]
<label>[% iteminformatio.subfield | html %] - [% iteminformatio.marc_lib | $raw %]</label>
[% END %]
[% IF ( iteminformatio.marc_value.type == 'select' ) %]
<select name="field_value" size="1">
[% FOREACH value IN iteminformatio.marc_value.values %]
[% IF ( value == iteminformatio.marc_value.default ) %]
<option value="[% value | html %]" selected="selected">[% iteminformatio.marc_value.labels.$value | html %]</option>
[% ELSE %]
<option value="[% value | html %]">[% iteminformatio.marc_value.labels.$value | html %]</option>
[% END %]
[% END %]
</select>
[% ELSE %]
[% iteminformatio.marc_value | $raw %]
[% END %]
<input type="hidden" name="itemid" value="[% item.itemid | html %]" />
<input type="hidden" name="kohafield" value="[% iteminformatio.kohafield | html %]" />
<input type="hidden" name="tag" value="[% iteminformatio.tag | html %]" />
<input type="hidden" name="subfield" value="[% iteminformatio.subfield | html %]" />
<input type="hidden" name="mandatory" value="[% iteminformatio.mandatory | html %]" />
[% IF ( iteminformatio.repeatable ) %]
<a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
<img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
</a>
[% END %]
[% IF ( iteminformatio.mandatory ) %] <span class="required">Required</span>[% END %]
</div></li>
[% END %]</ol></div><!-- /iteminformation -->
<input type="hidden" name="moditem" value="" />
<input type="hidden" name="tag" value="[% item.itemtagfield | html %]" />
<input type="hidden" name="subfield" value="[% item.itemtagsubfield | html %]" />
<input type="hidden" name="serial" value="[% item.serialid | html %]" />
<input type="hidden" name="bibnum" value="[% item.biblionumber | html %]" />
<input type="hidden" name="itemid" value="[% item.itemid | html %]" />
<input type="hidden" name="field_value" value="[% item.itemnumber | html %]" />
[% END %] <!-- /items -->
</div>
</fieldset>
</td>
</tr>
[% END %]
[% END %]
[% END %]
[% FOREACH newserialloo IN newserialloop %]
[% UNLESS ( newserialloo.subscriptionexpired ) %]
<tr>
<td>
<input type="hidden" name="serialid" value="NEW" />
<input type="hidden" name="biblionumber" value="[% newserialloo.biblionumber | html %]" />
<input type="hidden" name="itemcount" value="[% newserialloo.issuesatonce | html %]" />
<input type="hidden" name="user" value="[% newserialloo.librarian | html %]" />
Supplemental issue <input type="text" name="serialseq" id="serialseq[% newserialloo.serialid | html %]" value="" size="20" maxlength="100" onchange="if (this.value!=''){unHideItems('items[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]','label[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]', '[% newserialloo.serialid | html %]')} else {HideItems('items[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]','label[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]')}" />
</td>
<td>
<input type="text" name="publisheddate" value="[% newserialloo.publisheddate | html %]" size="10" maxlength="15" class="datepicker" />
</td>
<td>
<input type="text" name="publisheddatetext" value="[% newserialloo.publisheddatetext | html %]" size="10" maxlength="100" />
</td>
<td>
<input type="text" name="planneddate" value="[% newserialloo.planneddate | html %]" size="10" maxlength="15" class="datepicker" />
</td>
<td>
<select name="status" size="1" id="addstatus[% newserialloo.serialid | html %]" onchange="if (this.value==2){unHideItems('items'+'[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]','label[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]','[% newserialloo.serialid | html %]'); changeDate(this, '[% newserialloo.arriveddate | html %]')} else if (this.value==7){changeDate(this, '[% newserialloo.arriveddate | html %]')} else { HideItems('items'+'[% newserialloo.subscriptionid | html %]'+[% newserialloo.serialid | html %],'label[% serialslis.subscriptionid | html %][% serialslis.serialid | html %]'); changeDate(this, '[% serialslis.planneddate | html %]')}" >
<option value="">----</option>
[% IF ( newserialloo.status1 ) %]
<option value="1" selected="selected">Expected</option>
[% END %]
[% IF ( newserialloo.status2 ) %]
<option value="2" selected="selected">Arrived</option>
[% ELSE %]
<option value="2">Arrived</option>
[% END %]
[% IF ( newserialloo.status3 ) %]
<option value="3" selected="selected">Late</option>
[% ELSE %]
<option value="3">Late</option>
[% END %]
[% IF ( newserialloo.status4 ) %]
<option value="4" selected="selected">Missing</option>
[% ELSE %]
<option value="4">Missing</option>
[% END %]
[% IF ( newserialloo.status41 ) %]
<option value="41" selected="selected">Missing (never received)</option>
[% ELSE %]
<option value="41">Missing (never received)</option>
[% END %]
[% IF ( newserialloo.status42 ) %]
<option value="42" selected="selected">Missing (sold out)</option>
[% ELSE %]
<option value="42">Missing (sold out)</option>
[% END %]
[% IF ( newserialloo.status43 ) %]
<option value="43" selected="selected">Missing (damaged)</option>
[% ELSE %]
<option value="43">Missing (damaged)</option>
[% END %]
[% IF ( newserialloo.status44 ) %]
<option value="44" selected="selected">Missing (lost)</option>
[% ELSE %]
<option value="44">Missing (lost)</option>
[% END %]
[% IF ( newserialloo.status7 ) %]
<option value="7" selected="selected">Claimed</option>
[% ELSE %]
<option value="7">Claimed</option>
[% END %]
[% IF ( newserialloo.status5 ) %]
<option value="5" selected="selected">Not available</option>
[% ELSE %]
<option value="5">Not available</option>
[% END %]
[% IF ( newserialloo.status6 ) %]
<option value="6" selected="selected">Delete</option>
[% ELSE %]
<option value="6">Delete</option>
[% END %]
[% IF newserialloo.status8 %]
<option value="8" selected="selected">Stopped</option>
[% END %]
</select>
</td>
<td>
<input type="text" name="notes" value="" size="20" maxlength="255" />
</td>
</tr>
[% IF ( newserialloo.serialsadditems ) %]
<tr>
<td colspan="6">
<a id="label[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]" style="color: grey; font-size: 80%; cursor: pointer;" onclick="unHideItems('items[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]','label[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]', '[% newserialloo.serialid | html %]')">
Click to add item</a>
<fieldset class="rows" style="display:none;" id="items[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]">
<legend><a style="cursor: pointer;" onclick="HideItems('items[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]','label[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]')">
Item</a>
</legend>
<div class="cataloguing_additem_itemlist">
<div id="item[% newserialloo.serialid | html %][% newserialloo.countitems | html %]" class="items">
<ol>[% FOREACH iteminformatio IN newserialloo.iteminformation %]<li>
<div class="subfield_line" style="[% iteminformatio.hidden | html %]" id="subfield[% newserialloo.serialid | html %][% newserialloo.countitems | html %][% iteminformatio.subfield | html %][% iteminformatio.random | html %]">
[% IF (iteminformatio.mandatory) %]
<label class="required">[% iteminformatio.subfield | html %] - [% iteminformatio.marc_lib | $raw %]</label>
[% ELSE %]
<label>[% iteminformatio.subfield | html %] - [% iteminformatio.marc_lib | $raw %]</label>
[% END %]
[% IF ( iteminformatio.marc_value.type == 'select' ) %]
<select name="field_value" size="1">
[% FOREACH value IN iteminformatio.marc_value.values %]
[% IF ( value == iteminformatio.marc_value.default ) %]
<option value="[% value | html %]" selected="selected">[% iteminformatio.marc_value.labels.$value | html %]</option>
[% ELSE %]
<option value="[% value | html %]">[% iteminformatio.marc_value.labels.$value | html %]</option>
[% END %]
[% END %]
</select>
[% ELSE %]
[% iteminformatio.marc_value | $raw %]
[% END %]
<input type="hidden" name="itemid" value="[% newserialloo.itemid | html %]" />
<input type="hidden" name="kohafield" value="[% iteminformatio.kohafield | html %]" />
<input type="hidden" name="tag" value="[% iteminformatio.tag | html %]" />
<input type="hidden" name="subfield" value="[% iteminformatio.subfield | html %]" />
<input type="hidden" name="mandatory" value="[% iteminformatio.mandatory | html %]" />
[% IF ( iteminformatio.repeatable ) %]
<a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
<img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
</a>
[% END %]
[% IF ( iteminformatio.mandatory ) %] <span class="required">Required</span>[% END %]
</div>
</li>[% END %]</ol>
<input type="hidden" name="moditem" value="" />
<input type="hidden" name="tag" value="[% newserialloo.itemtagfield | html %]" />
<input type="hidden" name="subfield" value="[% newserialloo.itemtagsubfield | html %]" />
<input type="hidden" name="serial" value="[% newserialloo.serialid | html %]" />
<input type="hidden" name="bibnum" value="[% newserialloo.biblionumber | html %]" />
<input type="hidden" name="itemid" value="[% newserialloo.itemid | html %]" />
<input type="hidden" name="field_value" value="[% newserialloo.itemnumber | html %]" />
</div>
</div>
</fieldset>
</td>
</tr>
[% END %]
[% END %]
[% END %]
</table>
<fieldset class="action">
<div class="btn-group"><input type="submit" value="Save" class="btn btn-default btn-sm" accesskey="w" /></div>
[% UNLESS ( serialsadditems ) %]&nbsp;&nbsp;
<div class="btn-group"><a href="#multi_receiving" role="button" class="btn btn-default btn-sm" data-toggle="modal"><i class="fa fa-plus"></i> Multi receiving</a></div>
[% END %]
</fieldset>
</form>
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'serials-menu.inc' %]
<ul>
[% FOREACH subscription IN subscriptions %]
<li><a href="serials-collection.pl?subscriptionid=[% subscription.subscriptionid | uri %]" title="serial collection for [% subscription.bibliotitle | uri %]">Serial collection #[% subscription.subscriptionid | html %]</a></li>
<li><a href="subscription-detail.pl?subscriptionid=[% subscription.subscriptionid | uri %]" title="detail of the subscription">Subscription #[% subscription.subscriptionid | html %]</a></li>
[% IF ( subscription.abouttoexpire ) %]
[% UNLESS subscription.closed %]
<li><a href="#" onclick="javascript:popup([% subscription.subscriptionid | html %])">Renew #[% subscription.subscriptionid | html %]</a></li>
[% END %]
[% END %]
[% END %]
<li><a href="/cgi-bin/koha/catalogue/[% default_bib_view | uri %].pl?biblionumber=[% biblionumber | uri %]" title="go to [% bibliotitle | html %]">Show biblio</a></li></ul>
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% INCLUDE 'intranet-bottom.inc' %]