viewlog.tmpl + calendar.inc: builds Date_from_syspref javascript function.
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / viewlog.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Tools &rsaquo; Logs</title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
5 </head>
6 <body>
7 <!-- TMPL_INCLUDE NAME="header.inc" -->
8 <!-- TMPL_INCLUDE NAME="cat-search.inc" -->
9
10 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; Logs</div>
11
12 <div id="doc3" class="yui-t2">
13    
14    <div id="bd">
15         <div id="yui-main">
16         <div class="yui-b">
17
18 <h1>Browse system logs</h1>
19
20 <form method="post" action="/cgi-bin/koha/tools/viewlog.pl">
21
22 <fieldset>
23     <legend>Additional parameters</legend>
24         <p>
25         <label for="from"> Display from</label> <input type="text" size="10" id="from" name="from" value="<!-- TMPL_VAR NAME="datefrom"-->" />
26                 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" border="0" alt="Show Calendar" id="openCalendarFrom" style="cursor: pointer;" />
27                 <label for="to">to</label> <input size="10" id="to" name="to" type="text" value="<!-- TMPL_VAR NAME="dateto"-->" />
28                 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="openCalendarTo" alt="Show Calendar" style="cursor: pointer;" border="0" />
29                         <script type="text/javascript">
30                                 // function submit_check (from_id,to_id) {
31                                 //      var dateFrom = Date_from_syspref(document.getElementById(from_id).value);
32                                 //      var dateTo   = Date_from_syspref(document.getElementById(  to_id).value);
33                                 //      var today = new Date();
34                                 //      if (dateFrom < dateTo) { 
35                                 //              alert("The starting date cannot be after the ending date.");
36                                 //              document.getElementById(to_id).select();
37                                 //              return false;
38                                 //      }
39                                 //      if (dateFrom > today) { 
40                                 //              alert("The starting date cannot be in the future.");
41                                 //              document.getElementById(from_id).select();
42                                 //              return false;
43                                 //      }
44                                 // }
45
46                                 function get_limit (date,did) {
47                                         var dvalue = document.getElementById(did).value;
48                                         if (dvalue == "") { return false; }
49                                         var limitDate = Date_from_syspref(dvalue);
50                                         if (debug && debug > 5) {
51                                                 var month = date.getMonth() + 1;
52                                                 var dateString = date.getFullYear() + '-' + month + '-' + date.getDate();
53                                                 alert("comparing to " + did + " date:\n" 
54                                                                 + (limitDate > date) + "\n    date: " + date 
55                                                                 + "\nincoming:\n" + dateString + "\nlimitdate: " + limitDate
56                                                 );
57                                         }
58                                         return limitDate;
59                                 }
60
61                                 function validatefrom(date) {return (get_limit(date,'to'  ) < date);}  // true or false
62                                 function validateto  (date) {return (get_limit(date,'from') > date);}  // true or false
63
64                                 Calendar.setup(
65                                 {
66                                         inputField : "from",
67                                         ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
68                                         button : "openCalendarFrom",
69                                         disableFunc : validatefrom,
70                                         dateStatusFunc : validatefrom
71                                 }
72                                 );
73                                 Calendar.setup(
74                                 {
75                                         inputField : "to",
76                                         ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
77                                         button : "openCalendarTo",
78                                         disableFunc : validateto,
79                                         dateStatusFunc : validateto
80                                 }
81                                 );
82                     </script>
83                 </p>
84
85                 <p><b>Export</b></p>
86         <p><input id="screen" type="radio" checked="checked" name="output" value="screen" />
87         <label for="screen" >To screen in the browser</label></p>
88                 <p>
89                 <input id="file" type="radio" name="output" value="file" />
90                  <label for="file">To file</label>
91                 <input type="text" name="basename" value="Export" /> into an application  
92                 <!-- TMPL_VAR NAME="CGIextChoice" -->
93                 <!-- TMPL_VAR NAME="CGIsepChoice" -->
94             <input type="hidden" name="report_name" value="<!--TMPL_VAR NAME="report_name" -->" />
95             <input type="submit" value=" GO " />
96             </p>
97 </fieldset>
98     
99     <!-- TMPL_IF NAME="do_it" -->
100         <p>
101         <!-- TMPL_IF NAME="total" -->
102             <b><!-- TMPL_VAR NAME="total" --> lines found.</b>
103         <!-- TMPL_ELSE -->
104             <b><span class="problem">No log found.</span></b>
105         <!-- /TMPL_IF -->
106         </p>
107     <!-- /TMPL_IF -->
108     <table>
109     <tr>
110         <th>Date</th>
111         <th>Librarian</th>
112         <th>Module</th>
113         <th>Action</th>
114                 <th>Object</th>
115                 <th>Info</th>
116         </tr>
117         <tr>
118             <td>
119             <input type="submit" value="filter" />
120             <input type="hidden" name="do_it" value="1" />
121             </td>
122             <td>
123                 <input type="text" name="user" value="<!-- TMPL_VAR NAME="user"-->" />
124             </td>
125             <td>
126                 <select name="module">
127                             <option value="" selected="selected">All</option>
128                             <option value ="CATALOGUING">Catalogue</option>
129                                 <option value ="MEMBERS">Members</option>
130                                 <option value ="ACQUISITION">Acquisitions</option>
131                                 <option value ="SERIAL">Serial</option>
132                                 <option value="CIRCULATION">Circulation</option>
133                                 <option value="LETTER">Letter</option>
134                                 <option value="FINES">Fines</option>
135                         </select>
136             </td>
137             <td>
138                 <select name="action">
139                         <option value ="">All</option>
140                                 <option value ="add">Add</option>
141                                 <option value ="del">Delete</option>
142                                 <option value ="mod">Modify</option>
143                                 <option value="issue">Issue</option>
144                                 <option value="return">Return</option>
145                         </select>
146             </td>
147             <td>
148                 <input type="text" name="object" value="<!-- TMPL_VAR NAME="object"-->" />
149             </td>
150             <td>
151                 <input type="text" name="info" value="<!-- TMPL_VAR NAME="info"-->" />
152             </td>
153         </tr>
154             <!-- TMPL_LOOP NAME="looprow" -->
155                                         <tr>
156                                                 <td><!-- TMPL_VAR NAME="timestamp" --></td>
157                                                 <td>
158                                                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="user" -->" title="display detail for this librarian.">
159                                                         <!-- TMPL_VAR NAME="user" -->
160                                                     </a>
161                                                 </td>
162                                                 <td><!-- TMPL_VAR NAME="module" --></td>
163                                                 <td><!-- TMPL_VAR NAME="action" --></td>
164                                                 <td>
165                                                     <!-- TMPL_IF NAME="MEMBERS"-->
166                                                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="object" -->" title="display detail for this member." title="Display member details.">
167                                                             member <!-- TMPL_VAR NAME="object" -->
168                                                         </a>
169                                                     <!-- TMPL_ELSE -->
170                                                     <!-- TMPL_IF NAME="CIRCULATION" -->
171                                                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="object" -->" title="display detail for this member." title="Display member details.">
172                                                             <!-- TMPL_IF NAME="object"-->member <!-- TMPL_VAR NAME="object" --><!-- /TMPL_IF -->
173                                                         </a>
174                                                     <!-- TMPL_ELSE -->
175                                                     <!-- TMPL_IF NAME="CATALOGUING" -->
176                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="object" -->" title="Display detail for this biblio">biblio <!-- TMPL_VAR NAME="object" --></a>
177                                                     <!-- TMPL_ELSE-->
178                                                     <!-- TMPL_IF NAME="SERIAL"-->
179                                                         <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=<!-- TMPL_VAR NAME="object" -->">
180                                                             <!-- TMPL_VAR NAME="object" -->
181                                                         </a>
182                                                     <!-- TMPL_ELSE -->
183                                                     <!-- TMPL_VAR NAME="object" -->
184                                                 <!-- /TMPL_IF -->
185                                                 <!-- /TMPL_IF -->
186                                                 <!-- /TMPL_IF -->
187                                                 <!-- /TMPL_IF -->
188                                                 </td>
189                                                 <td>
190                                                     <!-- TMPL_IF NAME="CIRCULATION" -->
191                                                          <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="info" -->" title="Display detail for this biblio">biblio <!-- TMPL_VAR NAME="info" --></a>
192                                                 <!-- TMPL_ELSE -->
193                                                     <!-- TMPL_VAR NAME="info" -->
194                                                 <!-- /TMPL_IF -->
195                                                 </td>
196                                         </tr>
197                 <!-- /TMPL_LOOP -->
198     </table>
199         </form>
200 </div>
201 </div>
202 <div class="yui-b">
203 <!-- TMPL_INCLUDE NAME="tools-menu.inc" -->
204 </div>
205 </div>
206 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->