Owen Leonard
6fa2b03097
The logic for displaying a useful title did not take all cases into account. This patch adds the missing case. The patch also fixes problems with the "Cancel" link on update and delete operations. Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
230 lines
14 KiB
Cheetah
230 lines
14 KiB
Cheetah
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
|
|
<title>Koha › Acquisitions › Contracts ›
|
|
<!-- TMPL_IF NAME="add_form" -->
|
|
<!-- TMPL_IF NAME="contractnumber" -->Modify contract '<!-- TMPL_VAR NAME="contractname" -->'
|
|
<!-- TMPL_ELSE -->New contract<!-- /TMPL_IF -->
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF NAME="else" -->Contracts of <!-- TMPL_VAR NAME="booksellername" --><!-- /TMPL_IF -->
|
|
<!-- TMPL_IF NAME="add_validate" -->Data recorded<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF NAME="delete_confirm" -->Confirm Deletion of Contract '<!-- TMPL_VAR NAME="contractnumber" -->'<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF NAME="delete_confirmed" -->Contract Deleted<!-- /TMPL_IF --></title>
|
|
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
|
<!-- TMPL_INCLUDE NAME="calendar.inc" -->
|
|
<script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/acq.js"></script>
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
// to check if the data are correctly entered.
|
|
function Check(ff) {
|
|
var ok=0;
|
|
var _alertString=_("Form not submitted because of the following problem(s)");
|
|
_alertString +="\n-------------------------------------------------------------------\n\n";
|
|
if (!(isNotNull(ff.contractname,0))){
|
|
ok=1;
|
|
_alertString += _("- Name missing") + "\n";
|
|
}
|
|
var startDate = Date_from_syspref($("#contractstartdate").val());
|
|
var endDate = Date_from_syspref($("#contractenddate").val());
|
|
if (!parseInt(startDate.getTime())) {
|
|
ok=1;
|
|
_alertString += _("- Start date missing or invalid.") + "\n";
|
|
}
|
|
if (!parseInt(endDate.getTime())) {
|
|
ok=1;
|
|
_alertString += _("- End date missing or invalid.") + "\n";
|
|
}
|
|
|
|
if (startDate > endDate) {
|
|
ok=1;
|
|
_alertString += _("Wrong date! start date cannot be after end date.") + "\n";
|
|
}
|
|
if (endDate < (new Date)) {
|
|
ok=1;
|
|
_alertString += _("End date before today, Invalid end date!") + "\n";
|
|
}
|
|
if (ok) { // if there is a problem
|
|
alert(_alertString);
|
|
return false;
|
|
}
|
|
// if all is good
|
|
ff.submit();
|
|
}
|
|
//]]>
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<!-- TMPL_INCLUDE NAME="header.inc" -->
|
|
<!-- TMPL_INCLUDE NAME="contracts-admin-search.inc" -->
|
|
|
|
<div id="breadcrumbs">
|
|
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
|
|
›
|
|
<a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
|
|
›
|
|
<a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=<!--TMPL_VAR name="booksellerid" -->"><!-- TMPL_VAR name="booksellername" --></a>
|
|
›
|
|
<!-- TMPL_IF NAME="add_form" -->
|
|
<a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->">Contracts</a>
|
|
›
|
|
<!-- TMPL_IF NAME="contractnumber" -->Modify contract '<!-- TMPL_VAR NAME="contractname" -->'
|
|
<!-- TMPL_ELSE -->New contract
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF NAME="add_validate" -->
|
|
<a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->">Contracts</a>
|
|
› Data recorded
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF NAME="delete_confirm" -->
|
|
<a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->">Contracts</a>
|
|
› Confirm Deletion of Contract <!-- TMPL_VAR NAME="contractnumber" -->
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF NAME="delete_confirmed" -->
|
|
<a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->">Contracts</a> › Contract Deleted
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF NAME="else" -->Contracts<!-- /TMPL_IF -->
|
|
</div>
|
|
|
|
<div id="doc" class="yui-t7">
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<!-- TMPL_IF NAME="add_form" -->
|
|
<form name="Aform" action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
|
|
<input type="hidden" name="op" value="add_validate" />
|
|
<input type="hidden" name="booksellerid" value="<!-- TMPL_VAR NAME="booksellerid" -->" />
|
|
<input type="hidden" name="checked" value="0" />
|
|
<!-- TMPL_IF NAME="contractnumber" -->
|
|
<h1>Modify contract <!-- TMPL_VAR NAME="contractname" --> for <!-- TMPL_VAR NAME="booksellername" --></h1>
|
|
<!-- TMPL_ELSE -->
|
|
<h1>New contract for <!-- TMPL_VAR NAME="booksellername" --></h1>
|
|
<!-- /TMPL_IF -->
|
|
<fieldset class="rows">
|
|
<ol>
|
|
<!-- TMPL_IF NAME="contractnumber" -->
|
|
<li><span class="label">Contract id </span><!-- TMPL_VAR NAME="contractnumber" -->
|
|
<input type="hidden" name="contractnumber" value="<!-- TMPL_VAR NAME="contractnumber" -->" />
|
|
<input type="hidden" name="is_a_modif" value="1" />
|
|
</li>
|
|
<!-- /TMPL_IF -->
|
|
<li><label for="contractname" class="required">Name *</label>
|
|
<input type="text" name="contractname" id="contractname" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="contractname" -->" />
|
|
</li>
|
|
<li><label for="contractdescription">Description</label>
|
|
<input type="text" name="contractdescription" id="contractdescription" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="contractdescription" -->" />
|
|
</li>
|
|
<li><label for="contractstartdate" class="required">Start date *</label>
|
|
<input type="text" name="contractstartdate" id="contractstartdate" value="<!-- TMPL_VAR NAME="contractstartdate" -->" maxlength="10" size="10"/>
|
|
<img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="contractstartdate_button" alt="Show Calendar" />
|
|
<script language="JavaScript" type="text/javascript">
|
|
Calendar.setup(
|
|
{
|
|
inputField : "contractstartdate",
|
|
ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
|
|
button : "contractstartdate_button"
|
|
}
|
|
);
|
|
</script>
|
|
<div class="hint"><!-- TMPL_INCLUDE NAME="date-format.inc" --></div>
|
|
</li>
|
|
<li><label for="contractenddate" class="required">End date *</label>
|
|
<input type="text" name="contractenddate" id="contractenddate" value="<!-- TMPL_VAR NAME="contractenddate" -->" maxlength="10" size="10" />
|
|
<img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="contractenddate_button" alt="Show Calendar" />
|
|
<script language="JavaScript" type="text/javascript">
|
|
Calendar.setup(
|
|
{
|
|
inputField : "contractenddate",
|
|
ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
|
|
button : "contractenddate_button"
|
|
}
|
|
);
|
|
</script>
|
|
<div class="hint"><!-- TMPL_INCLUDE NAME="date-format.inc" --></div>
|
|
</li>
|
|
</ol>
|
|
</fieldset>
|
|
<fieldset class="action">
|
|
<input type="button" value="Save" onclick="Check(this.form);" /> <a class="cancel" href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->&contractnumber=<!-- TMPL_VAR NAME="contractnumber" -->">Cancel</a>
|
|
</fieldset>
|
|
</form>
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF NAME="add_validate" -->
|
|
<h3>Data recorded</h3>
|
|
<form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
|
|
<input type="submit" value="OK" />
|
|
</form>
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF NAME="delete_confirm" -->
|
|
<form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
|
|
<fieldset>
|
|
<legend>Confirm Deletion of Contract <!-- TMPL_VAR NAME="contractnumber" --></legend>
|
|
<table>
|
|
<tr><th scope="row">Contract number:</th><td><!-- TMPL_VAR NAME="contractnumber" --></td></tr>
|
|
<tr><th scope="row">Contract name:</th><td><!-- TMPL_VAR NAME="contractname" --></td></tr>
|
|
<tr><th scope="row">Contract description:</th><td><!-- TMPL_VAR NAME="contractdescription" --></td></tr>
|
|
<tr><th scope="row">Contract start date:</th><td><!-- TMPL_VAR NAME="contractstartdate" --></td></tr>
|
|
<tr><th scope="row">Contract end date:</th><td><!-- TMPL_VAR NAME="contractenddate" --></td></tr>
|
|
<tr><th scope="row">Vendor:</th><td><!-- TMPL_VAR NAME="booksellername" --></td></tr>
|
|
</table>
|
|
<fieldset class="action">
|
|
<input type="hidden" name="op" value="delete_confirmed" />
|
|
<input type="hidden" name="booksellerid" value="<!-- TMPL_VAR name="booksellerid" -->" />
|
|
<input type="hidden" name="contractnumber" value="<!-- TMPL_VAR NAME="contractnumber" -->" />
|
|
<input type="submit" value="Delete this Contract" />
|
|
<a class="cancel" href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->&contractnumber=<!-- TMPL_VAR NAME="contractnumber" -->">Cancel</a>
|
|
</fieldset>
|
|
</fieldset>
|
|
</form>
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF NAME="delete_confirmed" -->
|
|
<h3>Contract Deleted</h3>
|
|
<form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
|
|
<input type="hidden" name="booksellerid" value="<!-- TMPL_VAR name="booksellerid" -->" />
|
|
<input type="submit" value="OK" />
|
|
</form>
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF NAME="else" -->
|
|
<div id="toolbar">
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
// prepare DOM for YUI Toolbar
|
|
$(document).ready(function() {
|
|
yuiToolbar();
|
|
});
|
|
// YUI Toolbar Functions
|
|
function yuiToolbar() {
|
|
new YAHOO.widget.Button("newcontract");
|
|
}
|
|
//]]>
|
|
</script>
|
|
<ul class="toolbar">
|
|
<li><a id="newcontract" href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&booksellerid=<!-- TMPL_VAR name="booksellerid" -->">New Contract</a></li>
|
|
</ul>
|
|
</div>
|
|
<h2>Contract(s) of <!-- TMPL_VAR name="booksellername" --></h2>
|
|
<!-- TMPL_IF name="loop" -->
|
|
<table>
|
|
<tr>
|
|
<th scope="col">Name</th>
|
|
<th scope="col">Description</th>
|
|
<th scope="col">Start date</th>
|
|
<th scope="col">End date</th>
|
|
<th scope="col" colspan="2"> </th>
|
|
</tr>
|
|
<!-- TMPL_LOOP NAME="loop" -->
|
|
<!-- TMPL_IF NAME="__even__" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_IF -->
|
|
<td>
|
|
<a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->&contractnumber=<!-- TMPL_VAR NAME="contractnumber" -->"><!-- TMPL_VAR NAME="contractname" --></a>
|
|
</td>
|
|
<td><!-- TMPL_VAR NAME="contractdescription" --></td>
|
|
<td><!-- TMPL_VAR NAME="contractstartdate" --></td>
|
|
<td><!-- TMPL_VAR NAME="contractenddate" --></td>
|
|
<td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&contractnumber=<!-- TMPL_VAR NAME="contractnumber" -->&booksellerid=<!-- TMPL_VAR name="booksellerid" -->">Edit</a></td>
|
|
<td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=delete_confirm&contractnumber=<!-- TMPL_VAR NAME="contractnumber" -->&booksellerid=<!-- TMPL_VAR name="booksellerid" -->">Delete</a></td>
|
|
</tr>
|
|
<!-- /TMPL_LOOP -->
|
|
</table>
|
|
<!-- TMPL_ELSE -->
|
|
<div class="dialog message">There are no contracts with this vendor.</div>
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_IF -->
|
|
</div>
|
|
</div>
|
|
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
|