Koha/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt
Owen Leonard 5e1bcc4aa7 Bug 16242 - Move staff client JavaScript out of language directory
This patch moves the JavaScript files in prog/en/js to prog/js.
JavaScript files do not need to be in the directory which is processed
by the translator.

To test, apply the patch and visit various pages in the staff client to
confirm that JavaScript files are still loading correctly.

Revised: I intended for this to be built on top of Bug 15883 as well as
Bug 16242. Now it is.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
On top of 15883 and 16241
All seems to work, js files pulled from new dir.
No errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-04-29 14:32:42 +00:00

447 lines
23 KiB
Text

[% USE AuthorisedValues %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Serials &rsaquo; Serial edition [% bibliotitle %]</title>
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript" src="[% interface %]/[% theme %]/js/cataloging.js"></script>
<script type="text/javascript" src="[% interface %]/[% theme %]/js/prevent_submit.js"></script>
[% INCLUDE 'calendar.inc' %]
<script language="JavaScript" type="text/javascript">
//<![CDATA[
function generateReceive() {
var subscriptionid = document.getElementsByName("subscriptionid")[0].value;
if(nbissues=prompt(_("How many issues do you want to receive ?"))){
document.location = 'serials-collection.pl?op=gennext&subscriptionid='+subscriptionid+'&nbissues='+nbissues;
}
}
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
$(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 type="text/css">#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 %] [% IF ( callnumber ) %]([% callnumber %])[% END %]</i></div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<h1>Serial edition <i>[% bibliotitle %]</i>
[% IF location %] ([% AuthorisedValues.GetByCode('LOC', location) %])[% END %]
[% IF ( callnumber ) %] callnumber: [% callnumber %][% END %]</h1>
[% IF internalnotes %]<p>Nonpublic note: [% internalnotes %]</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 %]<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 %]" />
[% 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 %]" />
<input type="hidden" name="biblionumber" value="[% serialslis.biblionumber %]" />
<input type="hidden" name="itemcount" value="[% serialslis.issuesatonce %]" />
<input type="hidden" name="user" value="[% serialslis.librarian %]" />
Issue <input type="text" name="serialseq" id="serialseq[% serialslis.serialid %]" value="[% serialslis.serialseq %]" size="20" maxlength="100" />
</td>
<td>
<input type="text" name="publisheddate" value="[% serialslis.publisheddate %]" size="10" maxlength="15" class="datepicker" />
</td>
<td>
<input type="text" name="publisheddatetext" value="[% serialslis.publisheddatetext %]" size="10" maxlength="100" />
</td>
<td>
<input type="text" name="planneddate" value="[% serialslis.planneddate %]" size="10" maxlength="15" class="datepicker" />
</td>
<td>
[% IF ( serialslis.editdisable ) %]
<input type="hidden" name="status" id="status[% serialslis.serialid %]" value="[% serialslis.serstatus %]">
<select name="status" size="1" disabled="disabled">
[% ELSE %]
[% IF ( serialslis.serialsadditems ) %]
<select name="status" size="1" id="status[% serialslis.serialid %]" onchange="if (this.value==2){unHideItems('items'+[% serialslis.subscriptionid %][% serialslis.serialid %],'label[% serialslis.subscriptionid %][% serialslis.serialid %]','[% serialslis.serialid %]'); changeDate(this, '[% serialslis.arriveddate %]')} else if (this.value==7){changeDate(this, '[% serialslis.arriveddate %]')} else { HideItems('items'+[% serialslis.subscriptionid %]+[% serialslis.serialid %],'label[% serialslis.subscriptionid %][% serialslis.serialid %]'); changeDate(this, '[% serialslis.planneddate %]')}" >
[% ELSE %]
<select name="status" size="1" id="status[% serialslis.serialid %]" onchange="if (this.value==2 || this.value==7){changeDate(this, '[% serialslis.arriveddate %]')} else {changeDate(this, '[% serialslis.planneddate %]')}" >
[% 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 %]" size="20" maxlength="255" />
</td>
</tr>
[% UNLESS ( serialslis.subscriptionexpired ) %]
[% IF ( serialslis.serialsadditems ) %]
<tr>
<td colspan="6">
<a id="label[% serialslis.subscriptionid %][% serialslis.serialid %]" style="color: grey; font-size: 80%; cursor: pointer;" onclick="unHideItems('items[% serialslis.subscriptionid %][% serialslis.serialid %]','label[% serialslis.subscriptionid %][% serialslis.serialid %]', '[% serialslis.serialid %]');setStatus([% serialslis.serialid %]);">
Click to add item</a>
<fieldset class="rows" style="display:none;" id="items[% serialslis.subscriptionid %][% serialslis.serialid %]">
<legend><a style="cursor: pointer;" onclick="HideItems('items[% serialslis.subscriptionid %][% serialslis.serialid %]','label[% serialslis.subscriptionid %][% serialslis.serialid %]')">
Item</a>
</legend>
<div class="cataloguing_additem_itemlist">
[% FOREACH item IN serialslis.items %]
<div id="item[% item.serialid %][% item.countitems %]" class="items">
<ol>[% FOREACH iteminformatio IN item.iteminformation %]<li>
<div class="subfield_line" style="[% iteminformatio.hidden %]" id="subfield[% item.serialid %][% item.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
[% IF (iteminformatio.mandatory) %]
<label class="required">[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</label>
[% ELSE %]
<label>[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</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 %]" selected="selected">[% iteminformatio.marc_value.labels.$value %]</option>
[% ELSE %]
<option value="[% value %]">[% iteminformatio.marc_value.labels.$value %]</option>
[% END %]
[% END %]
</select>
[% ELSE %]
[% iteminformatio.marc_value %]
[% END %]
<input type="hidden" name="itemid" value="[% item.itemid %]" />
<input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
<input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
<input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
<input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
[% IF ( iteminformatio.repeatable ) %]
<a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
<img src="[% interface %]/[% theme %]/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 %]" />
<input type="hidden" name="subfield" value="[% item.itemtagsubfield %]" />
<input type="hidden" name="serial" value="[% item.serialid %]" />
<input type="hidden" name="bibnum" value="[% item.biblionumber %]" />
<input type="hidden" name="itemid" value="[% item.itemid %]" />
<input type="hidden" name="field_value" value="[% item.itemnumber %]" />
[% 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 %]" />
<input type="hidden" name="itemcount" value="[% newserialloo.issuesatonce %]" />
<input type="hidden" name="user" value="[% newserialloo.librarian %]" />
Supplemental issue <input type="text" name="serialseq" id="serialseq[% newserialloo.serialid %]" value="" size="20" maxlength="100" onchange="if (this.value!=''){unHideItems('items[% newserialloo.subscriptionid %][% newserialloo.serialid %]','label[% newserialloo.subscriptionid %][% newserialloo.serialid %]', '[% newserialloo.serialid %]')} else {HideItems('items[% newserialloo.subscriptionid %][% newserialloo.serialid %]','label[% newserialloo.subscriptionid %][% newserialloo.serialid %]')}" />
</td>
<td>
<input type="text" name="publisheddate" value="[% newserialloo.publisheddate %]" size="10" maxlength="15" class="datepicker" />
</td>
<td>
<input type="text" name="publisheddatetext" value="[% newserialloo.publisheddatetext %]" size="10" maxlength="100" />
</td>
<td>
<input type="text" name="planneddate" value="[% newserialloo.planneddate %]" size="10" maxlength="15" class="datepicker" />
</td>
<td>
<select name="status" size="1" id="addstatus[% newserialloo.serialid %]" onchange="if (this.value==2){unHideItems('items'+'[% newserialloo.subscriptionid %][% newserialloo.serialid %]','label[% newserialloo.subscriptionid %][% newserialloo.serialid %]','[% newserialloo.serialid %]'); changeDate(this, '[% newserialloo.arriveddate %]')} else if (this.value==7){changeDate(this, '[% newserialloo.arriveddate %]')} else { HideItems('items'+'[% newserialloo.subscriptionid %]'+[% newserialloo.serialid %],'label[% serialslis.subscriptionid %][% serialslis.serialid %]'); changeDate(this, '[% serialslis.planneddate %]')}" >
<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 %][% newserialloo.serialid %]" style="color: grey; font-size: 80%; cursor: pointer;" onclick="unHideItems('items[% newserialloo.subscriptionid %][% newserialloo.serialid %]','label[% newserialloo.subscriptionid %][% newserialloo.serialid %]', '[% newserialloo.serialid %]')">
Click to add item</a>
<fieldset class="rows" style="display:none;" id="items[% newserialloo.subscriptionid %][% newserialloo.serialid %]">
<legend><a style="cursor: pointer;" onclick="HideItems('items[% newserialloo.subscriptionid %][% newserialloo.serialid %]','label[% newserialloo.subscriptionid %][% newserialloo.serialid %]')">
Item</a>
</legend>
<div class="cataloguing_additem_itemlist">
<div id="item[% newserialloo.serialid %][% newserialloo.countitems %]" class="items">
<ol>[% FOREACH iteminformatio IN newserialloo.iteminformation %]<li>
<div class="subfield_line" style="[% iteminformatio.hidden %]" id="subfield[% newserialloo.serialid %][% newserialloo.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
[% IF (iteminformatio.mandatory) %]
<label class="required">[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</label>
[% ELSE %]
<label>[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</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 %]" selected="selected">[% iteminformatio.marc_value.labels.$value %]</option>
[% ELSE %]
<option value="[% value %]">[% iteminformatio.marc_value.labels.$value %]</option>
[% END %]
[% END %]
</select>
[% ELSE %]
[% iteminformatio.marc_value %]
[% END %]
<input type="hidden" name="itemid" value="[% newserialloo.itemid %]" />
<input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
<input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
<input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
<input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
[% IF ( iteminformatio.repeatable ) %]
<a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
<img src="[% interface %]/[% theme %]/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 %]" />
<input type="hidden" name="subfield" value="[% newserialloo.itemtagsubfield %]" />
<input type="hidden" name="serial" value="[% newserialloo.serialid %]" />
<input type="hidden" name="bibnum" value="[% newserialloo.biblionumber %]" />
<input type="hidden" name="itemid" value="[% newserialloo.itemid %]" />
<input type="hidden" name="field_value" value="[% newserialloo.itemnumber %]" />
</div>
</div>
</fieldset>
</td>
</tr>
[% END %]
[% END %]
[% END %]
</table>
<fieldset class="action">
<input type="submit" value="Save" class="button" accesskey="w" />
[% UNLESS ( serialsadditems ) %]&nbsp;&nbsp;<input type="button" onclick="javascript:generateReceive()" value="Multi receiving">[% END %]
</fieldset>
</form>
</div>
</div>
<div class="yui-b">
[% INCLUDE 'serials-menu.inc' %]
<ul>
[% FOREACH subscription IN subscriptions %]
<li><a href="serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]" title="serial collection for [% subscription.bibliotitle %]">Serial collection #[% subscription.subscriptionid %]</a></li>
<li><a href="subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" title="detail of the subscription">Subscription #[% subscription.subscriptionid %]</a></li>
[% IF ( subscription.abouttoexpire ) %]
[% UNLESS subscription.closed %]
<li><a href="#" onclick="javascript:popup([% subscription.subscriptionid %])">Renew #[% subscription.subscriptionid %]</a></li>
[% END %]
[% END %]
[% END %]
<li><a href="/cgi-bin/koha/catalogue/[% default_bib_view %].pl?biblionumber=[% biblionumber %]" title="go to [% bibliotitle %]">Show biblio</a></li></ul>
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]