Fixes for Bug 3089, Date entry fields should indicate required date format
[koha_gimpoz] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / histsearch.tmpl
index 8247d8b..d83516b 100644 (file)
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<title>Koha &rsaquo; Acquisitions order search</title>
-<!-- TMPL_INCLUDE NAME="doc-head-calendar.inc" -->
+<title>Koha &rsaquo; Acquisitions &rsaquo; <!-- TMPL_IF NAME="suggestions_loop" -->Orders search &rsaquo; Search Results<!-- TMPL_ELSE -->Order search<!-- /TMPL_IF --></title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<!-- TMPL_INCLUDE NAME="calendar.inc" -->
+</head>
+<body>
 <!-- TMPL_INCLUDE NAME="header.inc" -->
-<!-- TMPL_INCLUDE NAME="menu-acqui.inc" -->
+<!-- TMPL_INCLUDE NAME="acquisitions-history-search.inc" -->
+
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <!-- TMPL_IF NAME="suggestions_loop" --><a href="/cgi-bin/koha/acqui/histsearch.pl">Orders search</a> &rsaquo; Search Results<!-- TMPL_ELSE -->Order search<!-- /TMPL_IF --></div>
 
 <div id="doc3" class="yui-t2">
    
    <div id="bd">
        <div id="yui-main">
-       <div class="yui-b"><div class="yui-g">
+       <div class="yui-b">
        
-<!-- Additions to enable Calendar system -->
-<link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/lib/calendar/calendar-system.css" />
-<!-- End of additions -->
-
-<!-- Additions to enable Calendar system -->
-<script type="text/javascript" src="/intranet-tmpl/prog/en/lib/calendar/calendar.js"></script>
-<script type="text/javascript" src="/intranet-tmpl/prog/en/lib/calendar/calendar-en.js"></script>
-<script type="text/javascript" src="/intranet-tmpl/prog/en/lib/calendar/calendar-setup.js"></script>
-<!-- End of additions -->
-
-       <h1>Order search</h1>
+               <!-- TMPL_UNLESS NAME="suggestions_loop" --><form action="/cgi-bin/koha/acqui/histsearch.pl" method="post">
+<fieldset class="rows">
+       <legend>Search Orders</legend>
+               <ol>
+               <li><label for="title">Title: </label> <input type="text" name="title" id="title" value="<!-- TMPL_VAR name="title"-->" /></li>
+               <li><label for="author">Author: </label> <input type="text" name="author" id="author" value="<!-- TMPL_VAR name="author" -->" /></li>
+               <li><label for="name">Vendor: </label> <input type="text" name="name" id="name" value="<!-- TMPL_VAR name="name" -->" /></li>
+               <li><label for="from">From: </label> 
+                       <input type="text" size="10" id="from" name="from" value="<!-- TMPL_VAR name="from_placed_on" -->" />
+                       <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="openCalendarFrom" style="cursor: pointer;" alt="Show Calendar" />
+                               <div class="hint"><!-- TMPL_INCLUDE NAME="date-format.inc" --></div>
+               </li>
+               <li><label for="to">To: </label> 
+                       <input type="text" size="10" id="to" name="to" value="<!-- TMPL_VAR name="to_placed_on" -->" />
+                       <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="openCalendarTo" style="cursor: pointer;" alt="Show Calendar" />
+                       <script type="text/javascript">
+                               // return true if the date is blocked.
+                               function disable_from(date) {var limit = get_Calendar_limit(date,'to'  ); return (limit && limit < date);}  // true or false
+                               function disable_to  (date) {var limit = get_Calendar_limit(date,'from'); return (limit && limit > date);}  // true or false
+                               Calendar.setup({
+                                       inputField : "from",
+                                       ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                                       button : "openCalendarFrom",
+                                       disableFunc : disable_from,
+                                       dateStatusFunc : disable_from
+                               });
+                               Calendar.setup({
+                                       inputField : "to",
+                                       ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                                       button : "openCalendarTo",
+                                       disableFunc : disable_to,
+                                       dateStatusFunc : disable_to
+                    });
+                       </script>
+                               <div class="hint"><!-- TMPL_INCLUDE NAME="date-format.inc" --></div>
+               </li>
+               </ol>
+       </fieldset>
+       <fieldset class="action"><input type="submit" value="Search" /></fieldset>
+       </form><!-- /TMPL_UNLESS -->
+       <!-- TMPL_IF NAME="suggestions_loop" --><h1>Search Results</h1>
        <div id="acqui_histsearch">
-               <form action="/cgi-bin/koha/acqui/histsearch.pl" method="post">
                <table>
                        <tr>
-                               <th>&nbsp;</th>
-                               <th>Title</th>
-                               <th>Author</th>
-                               <th>Supplier</th>
+                               <th>Basket</th>
+                               <th>Invoice Number</th>
+                               <th>Summary</th>
+                               <th>Vendor</th>
                                <th>Placed on</th>
-                               <th>Recieved on</th>
+                               <th>Received on</th>
                                <th>Quantity ordered</th>
                                <th>Unit cost</th>
-                               <th>&nbsp;</th>
-                       </tr>
-                       <tr>
-                                       <th>Filter By:</th>
-                                       <th><input type="text" name="title" value="<!-- TMPL_VAR name="title"-->" /></th>
-                                       <th><input type="text" name="author" value="<!-- TMPL_VAR name="author" -->" /></th>
-                                       <th><input type="text" name="name" value="<!-- TMPL_VAR name="name" -->" /></th>
-                                       <th>From <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" border="0" hspace="0" vspace="0" id="openCalendarFrom" style="cursor: pointer;" alt="calendar" />
-                                               <input type="text" readonly="readonly" size="10" id="from" name="fromplacedon" value="<!-- TMPL_VAR name="from_placed_on" -->" />
-                                               <script language="JavaScript" type="text/javascript">
-                                                       function validate1(date) {
-                                                               var day = date.getDate();
-                                                               var month = date.getMonth() + 1;
-                                                               var year = date.getFullYear();
-                                                               var weekDay = date.getDay();
-                                                               var dayMonth = month + '-' + day;
-                                                               var dateString = year + '-' + month + '-' + day;
-                                                               var dateTo = document.getElementById('to').value.split("-");
-                                                               var limitDate = new Date(dateTo[0], (dateTo[1] - 1), dateTo[2]);
-                                                               if (date > limitDate) {
-                                                                       return true;
-                                                               } else {
-                                                                       return false;
-                                                               }
-                                                       }
-                                                       Calendar.setup(
-                                                               {
-                                                                       inputField : "from",
-                                                                       ifFormat : "%Y-%m-%d",
-                                                                       button : "openCalendarFrom",
-                                                                       disableFunc : validate1,
-                                                                       dateStatusFunc : validate1
-                                                               }
-                                                       );
-                                               </script>
-                                               To <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="openCalendarTo" style="cursor: pointer;" alt="calendar" />
-                                               <input readonly="readonly" size="10" id="to" name="toplacedon" value="<!-- TMPL_VAR name="to_placed_on" -->" type="text" />
-                                               <script type="text/javascript">
-                                                       function validate2(date) {
-                                                               var day = date.getDate();
-                                                               var month = date.getMonth() + 1;
-                                                               var year = date.getFullYear();
-                                                               var weekDay = date.getDay();
-                                                               var dayMonth = month + '-' + day;
-                                                               var dateString = year + '-' + month + '-' + day;
-                                                               var dateFrom = document.getElementById('from').value.split("-");
-                                                               var limitDate = new Date(dateFrom[0], (dateFrom[1] - 1), dateFrom[2]);
-                                                               if (limitDate > date) {
-                                                                       return true;
-                                                               } else {
-                                                                       return false;
-                                                               }
-                                                       }
-       
-                                                       Calendar.setup(
-                                                               {
-                                                                       inputField : "to",
-                                                                       ifFormat : "%Y-%m-%d",
-                                                                       button : "openCalendarTo",
-                                                                       disableFunc : validate2,
-                                                                       dateStatusFunc : validate2
-                                                               }
-                                                       );
-                                               </script></th>
-                                       <th>&nbsp;</th>
-                                       <th>&nbsp;</th>
-                                       <th>&nbsp;</th>
-                                       <th><input type="submit" value="Set Filter" /></th>
                        </tr>
+                       
                        <!-- TMPL_LOOP NAME="suggestions_loop" -->
                                <tr>
-                                       <td>
-                                           <!-- TMPL_IF NAME="invoicenumber" -->
-                                               <a href="/cgi-bin/koha/acqui/parcel.pl?invoice=<!-- TMPL_VAR NAME="invoicenumber"-->&amp;supplierid=<!-- TMPL_VAR NAME="id"-->&amp;datereceived=<!-- TMPL_VAR NAME="datereceived" -->">Parcel</a>
+                    <td><a href="basket.pl?basketno=<!-- TMPL_VAR name="basketno" -->"><!-- TMPL_VAR name="basketno" --></a></td>
+                                       <td><!-- TMPL_IF NAME="invoicenumber" -->
+                                               <a href="/cgi-bin/koha/acqui/parcel.pl?invoice=<!-- TMPL_VAR NAME="invoicenumber"-->&amp;supplierid=<!-- TMPL_VAR NAME="id"-->&amp;datereceived=<!-- TMPL_VAR NAME="datereceived" -->"><!-- TMPL_VAR NAME="invoicenumber"--></a>
                                            <!-- TMPL_ELSE -->
                                                &nbsp;
                                            <!-- /TMPL_IF -->
                                        </td>
-                                       <td><a href="basket.pl?basketno=<!-- TMPL_VAR name="basketno" -->"><!-- TMPL_VAR NAME="title" --></a></td>
-                                       <td><!-- TMPL_VAR NAME="author" --></td>
-                                       <td><!-- TMPL_VAR NAME="name" --></td>
+                                       <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->"><!-- TMPL_VAR NAME="title" escape="html" --></a>
+                        <br /><!-- TMPL_VAR NAME="author" --></td>
+                                       <td><a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=<!-- TMPL_VAR name="id" -->"><!-- TMPL_VAR NAME="name" --></a></td>
                                        <td><!-- TMPL_VAR name="creationdate" --></td>
                                        <td><!-- TMPL_VAR name="datereceived" --></td>
                                        <td><!-- TMPL_VAR name="quantity" --></td>
                                        <td><!-- TMPL_VAR name="ecost" --></td>
-                                       <td>&nbsp;</td>
                                </tr>
                        <!-- /TMPL_LOOP -->
                </table>
-               </form>
-       </div>
+       </div><!-- TMPL_ELSE --><!-- /TMPL_IF -->
 
 </div>
 </div>
+<div class="yui-b">
+<!-- TMPL_INCLUDE NAME="acquisitions-menu.inc" -->
 </div>
-
-<!-- TMPL_INCLUDE NAME="mainmenu.inc" -->
-<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
\ No newline at end of file
+</div>
+<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->