Merge commit 'kc/master'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / aqcontract.tmpl
index d1823fa..43ffa38 100644 (file)
@@ -1,5 +1,5 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<title>Koha &rsaquo; Administration &rsaquo; Contracts &rsaquo;
+<title>Koha &rsaquo; Acquisitions &rsaquo; Contracts &rsaquo;
 <!-- TMPL_IF NAME="add_form" -->
     <!-- TMPL_IF NAME="contractnumber" -->Modify contract '<!-- TMPL_VAR NAME="contractname" -->'
 <!-- TMPL_ELSE -->New contract<!-- /TMPL_IF -->
 // 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)\n");
-    _alertString +="-------------------------------------------------------------------\n\n";
+    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");
+        _alertString += _("- Name missing") + "\n";
     }
-    if (!(CheckDate(ff.contractstartdate))){
+    var startDate = Date_from_syspref($("#contractstartdate").val());
+    var endDate   = Date_from_syspref($("#contractenddate").val());
+    if (!parseInt(startDate.getTime())) {
         ok=1;
-        _alertString += _("- Start date missing\n");
+        _alertString += _("- Start date missing or invalid.") + "\n";
     }
-    if (!(CheckDate(ff.contractenddate))){
+    if (!parseInt(endDate.getTime())) {
         ok=1;
-        _alertString += _("- End date missing\n");
+        _alertString += _("- End date missing or invalid.") + "\n";
     }
     
-    if (!CompareDate(ff.contractstartdate.value, ff.contractenddate.value)) {
+    if (startDate > endDate) {
         ok=1;
-        _alertString += _("Wrong date! start date can not be after end date.\n");
+        _alertString += _("Wrong date! start date cannot be after end date.") + "\n";
     }
-    if (! CheckEndDate(ff.contractenddate.value)) {
+    if (endDate < (new Date)) {
         ok=1;
-        _alertString += _("End date before today, Invalid end date!\n");
+        _alertString += _("End date before today, Invalid end date!") + "\n";
     }
     if (ok) { // if there is a problem
         alert(_alertString);
@@ -55,38 +57,38 @@ function Check(ff) {
 <div id="breadcrumbs">
     <a href="/cgi-bin/koha/mainpage.pl">Home</a>
     &rsaquo;
-    <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
+    <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
     &rsaquo;
-    <a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=<!--TMPL_VAR name="booksellerid" -->"><!-- TMPL_VAR name="name" --></a>
+    <a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=<!--TMPL_VAR name="booksellerid" -->"><!-- TMPL_VAR name="booksellername" --></a>
     &rsaquo;
     <!-- TMPL_IF NAME="add_form" -->
-        <a href="/cgi-bin/koha/admin/aqcontract.pl">Contracts</a>
+        <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR  NAME="booksellerid" -->">Contracts</a>
         &rsaquo;
         <!-- 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">Contracts</a>
+        <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR  NAME="booksellerid" -->">Contracts</a>
         &rsaquo; Data recorded
     <!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="delete_confirm" -->
-        <a href="/cgi-bin/koha/admin/aqcontract.pl">Contracts</a>
+        <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR  NAME="booksellerid" -->">Contracts</a>
         &rsaquo; Confirm Deletion of Contract <!-- TMPL_VAR NAME="contractnumber" -->
     <!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="delete_confirmed" -->
-        <a href="/cgi-bin/koha/admin/aqcontract.pl">Contracts</a> &rsaquo; Contract Deleted
+        <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR  NAME="booksellerid" -->">Contracts</a> &rsaquo; Contract Deleted
     <!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="else" -->Contracts<!-- /TMPL_IF -->
 </div>
 
-<div id="doc3" class="yui-t2">
+<div id="doc" class="yui-t7">
     <div id="bd">
         <div id="yui-main">
-            <div class="yui-b">
                 <!-- 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>
@@ -107,17 +109,6 @@ function Check(ff) {
                                 <li><label for="contractdescription">Description</label> &nbsp;
                                         <input type="text" name="contractdescription" id="contractdescription" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="contractdescription" -->" />
                                 </li>
-                                <li><label for="booksellerid">Vendor</label>
-                                <select id="booksellerid" name="booksellerid">
-                                <!-- TMPL_LOOP NAME="booksellerloop" -->
-                                    <!-- TMPL_IF NAME="selected" -->
-                                        <option value="<!-- TMPL_VAR NAME="id" -->" selected="selected"><!-- TMPL_VAR NAME="name" --></option>
-                                    <!-- TMPL_ELSE -->
-                                        <option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="name" --></option>
-                                    <!-- /TMPL_IF -->
-                                <!-- /TMPL_LOOP -->
-                                </select>
-                                </li>
                                 <li><label for="contractstartdate" class="required">Start date *</label> &nbsp;
                                         <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" />
@@ -130,6 +121,7 @@ function Check(ff) {
                                             }
                                             );
                                         </script>
+                               <div class="hint"><!-- TMPL_INCLUDE NAME="date-format.inc" --></div>
                                 </li>
                                 <li><label for="contractenddate" class="required">End date *</label> &nbsp;
                                         <input type="text" name="contractenddate" id="contractenddate" value="<!-- TMPL_VAR NAME="contractenddate" -->" maxlength="10"  size="10" />
@@ -143,11 +135,12 @@ function Check(ff) {
                                             }
                                             );
                                         </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);" />
+                            <input type="button" value="Save" onclick="Check(this.form);" /> <a class="cancel" href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->&amp;contractnumber=<!-- TMPL_VAR NAME="contractnumber" -->">Cancel</a>
                         </fieldset>
                     </form>
             <!-- /TMPL_IF -->
@@ -182,7 +175,7 @@ function Check(ff) {
             <!-- 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="hidden" name="booksellerid" value="<!-- TMPL_VAR name="booksellerid" -->/>
                     <input type="submit" value="OK" />
                 </form>
             <!-- /TMPL_IF -->
@@ -204,7 +197,7 @@ function Check(ff) {
                         <li><a id="newcontract" href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;booksellerid=<!-- TMPL_VAR name="booksellerid" -->">New Contract</a></li>
                     </ul>
                 </div>
-                <h2>Contract(s) of <!-- TMPL_VAR name="name" --></h2>
+                <h2>Contract(s) of <!-- TMPL_VAR name="booksellername" --></h2>
                 <!-- TMPL_IF name="loop" -->
                     <table>
                         <tr>
@@ -215,13 +208,9 @@ function Check(ff) {
                             <th scope="col" colspan="2">&nbsp; </th>
                         </tr>
                     <!-- TMPL_LOOP NAME="loop" -->
-                        <!-- TMPL_IF NAME="toggle" -->
-                            <tr class="highlight">
-                        <!-- TMPL_ELSE -->
-                            <tr>
-                        <!-- /TMPL_IF -->
-                            <td>
-                                <a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&amp;contractnumber=<!-- TMPL_VAR NAME="contractnumber" -->"><!-- TMPL_VAR NAME="contractname" --></a>
+                        <!-- TMPL_IF NAME="__even__" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_IF -->
+                        <td>
+                            <a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&amp;contractnumber=<!-- TMPL_VAR NAME="contractnumber" -->"><!-- TMPL_VAR NAME="contractname" --></a>
                         </td>
                         <td><!-- TMPL_VAR NAME="contractdescription" --></td>
                         <td><!-- TMPL_VAR NAME="contractstartdate" --></td>
@@ -231,12 +220,10 @@ function Check(ff) {
                         </tr>
                     <!-- /TMPL_LOOP -->
                 </table>
+                <!-- TMPL_ELSE -->
+                <div class="dialog message">There are no contracts with this vendor.</div>
                 <!-- /TMPL_IF -->
             <!-- /TMPL_IF -->
         </div>
-    </div>
-    <div class="yui-b">
-        <!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
-    </div>
 </div>
 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->