Koha/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tmpl
Katrin Fischer a0c6ebbe90 Bug 4399 Untranslated link 'Export selected items data' in claims.tmpl
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-04-23 06:40:11 -04:00

381 lines
14 KiB
Cheetah

<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<!-- TMPL_INCLUDE NAME="calendar.inc" -->
<title>Koha &rsaquo; Serials &rsaquo; Claims</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
<script type="text/JavaScript" language="JavaScript">
//<![CDATA[
$(document).ready(function() {
<!-- TMPL_UNLESS NAME="preview" -->$("#claimst").tablesorter({<!-- TMPL_IF EXPR="dateformat eq 'metric'" -->
dateFormat: 'uk',<!-- /TMPL_IF -->
headers: { 0: { sorter: false },1:{sorter:false}}
});<!-- /TMPL_UNLESS -->
$('#supplierid').change(function() {
$('#claims').submit();
});
// Case-insensitive version of jquery's contains function
jQuery.extend(
jQuery.expr[':'], {
icontains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0"
}
);
// Checkboxes : Select All / None
$("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check All"));
$("span.exportSelected").html("<a id=\"ExportSelected\" href=\"/cgi-bin/koha/serials/claims.pl\"> "+_("Export selected items data") +"<\/a>");
$("#CheckAll").click(function(){
$("#claimst :checkbox").attr('checked', $("#CheckAll").is(':checked'));
});
// Generates a dynamic link for exporting the selection's data as CSV
$("#ExportSelected").click(function() {
// We use input:checked because it's faster, but if there must new checkboxes
// used for other purpose on this page, please use [name=serialid]:checked instead
var selected = $("input:checked");
if (selected.length == 0) {
alert(_('Please select at least one item to export.'));
return false;
}
// Building the url from currently checked boxes
var url = '/cgi-bin/koha/serials/lateissues-excel.pl?supplierid=&amp;op=claims';
for (var i = 0; i < selected.length; i++) {
url += '&amp;serialid=' + selected[i].value;
}
// And redirecting to the CSV page
location.href = url;
return false;
});
});
// Checks if the form can be sent (at least one checkbox must be checked)
function checkForm() {
if ($("input:checked").length == 0) {
alert(_('Please select at least one item.'));
return false;
}
}
// Filter by status
function filterByStatus() {
selectedStatus = $("#statusfilter").val();
if (selectedStatus == "all") {
clearFilters();
} else {
$("table#claimst tbody tr").hide();
$("table#claimst tbody tr:contains(" + selectedStatus + ")").show();
}
}
// Filter by title
function filterByTitle() {
var title = $("#titlefilter").val();
$("table#claimst tbody tr").hide();
$("table#claimst tbody tr:icontains(" + title + ")").show();
}
// Filter by date
function filterByDate() {
var beginDate = Date_from_syspref($("#begindate").val()).getTime();
var endDate = Date_from_syspref($("#enddate").val()).getTime();
// Checks if the beginning date is valid
if (!parseInt(beginDate)) {
alert(_('The beginning date is missing or invalid.'));
return false;
}
// Checks if the ending date is valid
if (!parseInt(endDate)) {
alert(_('The ending date is missing or invalid.'));
return false;
}
// Checks if beginning date is before ending date
if (beginDate > endDate) {
// If not, we swap them
var tmpDate = endDate;
endDate = beginDate;
beginDate = tmpDate;
}
// We hide everything
$("table#claimst tbody tr").hide();
// For each date in the table
$(".planneddate").each(function() {
// We make a JS Date Object, according to the locale
var pdate = Date_from_syspref($(this).text()).getTime();
// And checks if the date is between the beginning and ending dates
if (pdate > beginDate &&
pdate < endDate) {
// If so, we can show the row
$(this).parent().show();
}
});
}
// Clears filters : shows everything
function clearFilters() {
$("table#claimst tbody tr").show();
}
function popup(supplierid,serialid){
window.open('claims.pl?supplierid='+ supplierid +'&amp;serialid='+ serialid +'&amp;op=preview' ,'popup', 'width=600,height=400,toolbar=no,scrollbars=yes');
}
//]]>
</script>
</head>
<body>
<!-- TMPL_INCLUDE NAME="header.inc" -->
<!-- TMPL_UNLESS NAME="preview" -->
<!--TMPL_INCLUDE NAME="serials-search.inc" -->
<!-- /TMPL_UNLESS -->
<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; Claims</div>
<!-- TMPL_UNLESS NAME="preview" -->
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<h1>Claims</h1>
<!-- TMPL_IF NAME="letter" --><!-- TMPL_UNLESS NAME="missingissues" --><!-- TMPL_IF NAME="supplierid" --> <div class="dialog alert">No missing issues found.</div><!-- TMPL_ELSE --><div class="dialog message">Please choose a vendor.</div><!-- /TMPL_IF --><!-- /TMPL_UNLESS --><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="SHOWCONFIRMATION" -->
<div class="dialog alert">Your notification has been sent.</div>
<!-- /TMPL_IF -->
<!-- TMPL_UNLESS NAME="letter" --><div class="dialog alert">No claims notice defined. <a href="/cgi-bin/koha/tools/letter.pl">Please define one</a>.</div><!-- /TMPL_UNLESS -->
<form id="claims" name="claims" action="claims.pl" method="post">
<fieldset><label for="supplierid">View: </label>
<select id="supplierid" size="1" name="supplierid">
<!-- TMPL_LOOP NAME="supplier_loop" -->
<option value="<!-- TMPL_VAR NAME="id" -->"<!-- TMPL_IF NAME="selected" --> selected="yes" <!-- /TMPL_IF -->><!-- TMPL_VAR NAME="name" -->
</option>
<!-- /TMPL_LOOP -->
</select>
<input type="submit" value="OK" />
<!-- TMPL_IF name="phone" -->Phone: <!-- TMPL_VAR name="phone" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="booksellerfax" -->Fax: <!-- TMPL_VAR name="booksellerfax" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="bookselleremail" --></p><p><a href="mailto:<!-- TMPL_VAR name="bookselleremail" -->"><!-- TMPL_VAR name="bookselleremail" --></a><!-- /TMPL_IF -->
</fieldset>
</form>
<!-- TMPL_IF NAME="missingissues" -->
<h3>Missing Issues</h3>
<form action="claims.pl" onsubmit="filterByTitle(); return false;">
<fieldset class="rows">
<legend>Filters :</legend>
<ol>
<li>
<label for="statusfilter">Status : </label>
<select id="statusfilter" onchange="filterByStatus();">
<option value="all" selected="selected">(All)</option>
<option>Expected</option>
<option>Arrived</option>
<option>Late</option>
<option>Missing</option>
<option>Claimed</option>
</select>
</li>
<li>
<label for="titlefilter">Title : </label>
<input id="titlefilter" type="text" />
<input type="submit" value="OK" />
</li>
<li>
<label for="begindate">From</label>
<img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="begindatebutton" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
<input type="text" name="begindate" id="begindate" value="<!-- TMPL_VAR name="begindate" -->" size="10" maxlength="10" />
<script type="text/javascript">
//<![CDATA[
Calendar.setup({
inputField : "begindate",
button : "begindatebutton",
ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->"
});
//]]>
</script>
<label for="enddate" style="float:none;">To</label>
<img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="enddatebutton" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
<input type="text" name="enddate" id="enddate" value="<!-- TMPL_VAR name="enddate" -->" size="10" maxlength="10" />
<script type="text/javascript">
//<![CDATA[
Calendar.setup({
inputField : "enddate",
button : "enddatebutton",
ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->"
});
//]]>
</script> <span class="hint"><!-- TMPL_INCLUDE NAME="date-format.inc" --></span>
<input type="button" value="OK" onclick="filterByDate();" />
</li>
<li>
<input type="reset" value="Clear Filters" onclick="clearFilters();" />
</li>
</ol>
</fieldset>
</form>
<form action="claims.pl" method="post" class="checkboxed" onsubmit="return checkForm()">
<input type="hidden" name="order" value="<!--TMPL_VAR Name="order"-->" />
<p><span class="checkall"></span><span class="clearall"></span></p>
<table id="claimst">
<thead><tr>
<!--TMPL_IF NAME="letter"-->
<th>Claim</th>
<!--/TMPL_IF-->
<th>Vendor</th>
<th>Title</th>
<th>Issue number</th>
<th>Status</th>
<th>Since</th>
<th>Claim Date</th>
<th>Begin Claim</th>
</tr></thead>
<tbody><!-- TMPL_LOOP name="missingissues" -->
<tr>
<!--TMPL_IF NAME="letter" -->
<td>
<input type="checkbox" name="serialid" value="<!-- TMPL_VAR NAME="serialid"-->" />
</td>
<!--/TMPL_IF-->
<td>
<!-- TMPL_VAR name="name" -->
</td>
<td>
<a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=<!-- TMPL_VAR NAME="subscriptionid" -->"><!-- TMPL_VAR name="title" escape="html" --></a>
</td>
<td>
<!-- TMPL_VAR name="serialseq" -->
</td>
<td>
<!-- TMPL_IF Name="status1" -->Expected<!-- /TMPL_IF -->
<!-- TMPL_IF Name="status2" -->Arrived<!-- /TMPL_IF -->
<!-- TMPL_IF Name="status3" -->Late<!-- /TMPL_IF -->
<!-- TMPL_IF Name="status4" -->Missing<!-- /TMPL_IF -->
<!-- TMPL_IF Name="status7" -->Claimed<!-- /TMPL_IF -->
</td>
<td class="planneddate">
<!-- TMPL_VAR name="planneddate" -->
</td>
<td>
<!-- TMPL_VAR name="claimdate" -->
</td>
<td>
<a href="/cgi-bin/koha/serials/lateissues-excel.pl?supplierid=<!-- TMPL_VAR name="supplieri" -->&amp;serialid=<!-- TMPL_VAR name="serialid" -->&amp;op=claims">Export item data</a>
</td>
</tr>
<!-- /TMPL_LOOP --></tbody>
</table>
<p><span class="exportSelected"></span></p>
<!--TMPL_IF Name="letter" -->
<fieldset class="action"> <label for="letter_code">Select notice:</label>
<select name="letter_code" id="letter_code">
<!-- TMPL_LOOP name="letters" -->
<option value="<!--TMPL_VAR Name="code"-->"><!--TMPL_VAR Name="name"--></option>
<!--/TMPL_LOOP-->
</select>
<input type="hidden" name="op" value="send_alert" /><input type="submit" name="submit" class="button" value="Send notification" /></fieldset>
<!--/TMPL_IF-->
</form>
<!-- /TMPL_IF -->
<!-- TMPL_ELSE -->
<div id="doc" class="yui-t7">
<div id="bd">
<!-- TMPL_IF Name="supplierloop"-->
<!-- TMPL_LOOP Name="supplierloop"-->
<!-- TMPL_IF NAME="name" -->
<p><b><!-- TMPL_VAR NAME="name" --></b><br />
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="postal" -->
<!-- TMPL_VAR NAME="postal" --><br />
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="contphone" -->
Ph: <!-- TMPL_VAR NAME="contphone" --><br />
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="contfax" -->
Fax: <!-- TMPL_VAR NAME="contfax" --><br />
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="contemail" -->
Email: <!-- TMPL_VAR NAME="contemail" --><br />
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="accountnumber" -->
A/C: <!-- TMPL_VAR NAME="accountnumber" --></p>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="contact" -->
<p>Dear <!-- TMPL_VAR NAME="contact" --></p>
<!-- TMPL_ELSE -->
<p>To whom it may concern</p>
<!-- /TMPL_IF -->
<p>The following items have not been received from you and are now considered missing:</p>
<!-- /TMPL_LOOP -->
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="missingissues" -->
<h3>Missing Issues</h3>
<table>
<tr>
<td><b>Vendor<b></td>
<td><b>Title</b></td>
<td><b>Issue number</b></td>
<td><b>Missing since</b></td>
</tr>
<!-- TMPL_LOOP name="missingissues" -->
<tr>
<td>
<!-- TMPL_VAR name="name" -->
</td>
<td>
<!-- TMPL_VAR name="Title" escape="html" -->
</td>
<td>
<!-- TMPL_VAR name="serialseq" -->
</td>
<td>
<!-- TMPL_VAR name="planneddate" -->
</td>
</tr>
<!-- /TMPL_LOOP -->
</table>
<!-- /TMPL_IF -->
<p class="noprint"><a href="#" onclick="window.print(); return false;">Print</a> &nbsp; <a href="#" class="close">Close</a></p>
<!-- /TMPL_UNLESS -->
</div>
</div>
<!-- TMPL_UNLESS NAME="preview" -->
<div class="yui-b">
<!-- TMPL_INCLUDE NAME="serials-menu.inc" -->
</div>
<!-- /TMPL_UNLESS -->
</div>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->