Koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl
Joe Atzberger 31b3746ea9 viewlog.tmpl + calendar.inc: builds Date_from_syspref javascript function.
This is likely the durable fix to bridge the gap between syspref on the server
and client side validation scripts.  It may be useful to separate Date_from_syspref
from the calendar js, but at this time their applicability is 1-to-1.
Note also js debug variable and CGI param('debug') responsiveness.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-19 18:54:52 -06:00

206 lines
7.6 KiB
Cheetah

<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha &rsaquo; Tools &rsaquo; Logs</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<!-- TMPL_INCLUDE NAME="calendar.inc" -->
</head>
<body>
<!-- TMPL_INCLUDE NAME="header.inc" -->
<!-- TMPL_INCLUDE NAME="cat-search.inc" -->
<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>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<h1>Browse system logs</h1>
<form method="post" action="/cgi-bin/koha/tools/viewlog.pl">
<fieldset>
<legend>Additional parameters</legend>
<p>
<label for="from"> Display from</label> <input type="text" size="10" id="from" name="from" value="<!-- TMPL_VAR NAME="datefrom"-->" />
<img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" border="0" alt="Show Calendar" id="openCalendarFrom" style="cursor: pointer;" />
<label for="to">to</label> <input size="10" id="to" name="to" type="text" value="<!-- TMPL_VAR NAME="dateto"-->" />
<img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="openCalendarTo" alt="Show Calendar" style="cursor: pointer;" border="0" />
<script type="text/javascript">
// function submit_check (from_id,to_id) {
// var dateFrom = Date_from_syspref(document.getElementById(from_id).value);
// var dateTo = Date_from_syspref(document.getElementById( to_id).value);
// var today = new Date();
// if (dateFrom < dateTo) {
// alert("The starting date cannot be after the ending date.");
// document.getElementById(to_id).select();
// return false;
// }
// if (dateFrom > today) {
// alert("The starting date cannot be in the future.");
// document.getElementById(from_id).select();
// return false;
// }
// }
function get_limit (date,did) {
var dvalue = document.getElementById(did).value;
if (dvalue == "") { return false; }
var limitDate = Date_from_syspref(dvalue);
if (debug && debug > 5) {
var month = date.getMonth() + 1;
var dateString = date.getFullYear() + '-' + month + '-' + date.getDate();
alert("comparing to " + did + " date:\n"
+ (limitDate > date) + "\n date: " + date
+ "\nincoming:\n" + dateString + "\nlimitdate: " + limitDate
);
}
return limitDate;
}
function validatefrom(date) {return (get_limit(date,'to' ) < date);} // true or false
function validateto (date) {return (get_limit(date,'from') > date);} // true or false
Calendar.setup(
{
inputField : "from",
ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
button : "openCalendarFrom",
disableFunc : validatefrom,
dateStatusFunc : validatefrom
}
);
Calendar.setup(
{
inputField : "to",
ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
button : "openCalendarTo",
disableFunc : validateto,
dateStatusFunc : validateto
}
);
</script>
</p>
<p><b>Export</b></p>
<p><input id="screen" type="radio" checked="checked" name="output" value="screen" />
<label for="screen" >To screen in the browser</label></p>
<p>
<input id="file" type="radio" name="output" value="file" />
<label for="file">To file</label>
<input type="text" name="basename" value="Export" /> into an application
<!-- TMPL_VAR NAME="CGIextChoice" -->
<!-- TMPL_VAR NAME="CGIsepChoice" -->
<input type="hidden" name="report_name" value="<!--TMPL_VAR NAME="report_name" -->" />
<input type="submit" value=" GO " />
</p>
</fieldset>
<!-- TMPL_IF NAME="do_it" -->
<p>
<!-- TMPL_IF NAME="total" -->
<b><!-- TMPL_VAR NAME="total" --> lines found.</b>
<!-- TMPL_ELSE -->
<b><span class="problem">No log found.</span></b>
<!-- /TMPL_IF -->
</p>
<!-- /TMPL_IF -->
<table>
<tr>
<th>Date</th>
<th>Librarian</th>
<th>Module</th>
<th>Action</th>
<th>Object</th>
<th>Info</th>
</tr>
<tr>
<td>
<input type="submit" value="filter" />
<input type="hidden" name="do_it" value="1" />
</td>
<td>
<input type="text" name="user" value="<!-- TMPL_VAR NAME="user"-->" />
</td>
<td>
<select name="module">
<option value="" selected="selected">All</option>
<option value ="CATALOGUING">Catalogue</option>
<option value ="MEMBERS">Members</option>
<option value ="ACQUISITION">Acquisitions</option>
<option value ="SERIAL">Serial</option>
<option value="CIRCULATION">Circulation</option>
<option value="LETTER">Letter</option>
<option value="FINES">Fines</option>
</select>
</td>
<td>
<select name="action">
<option value ="">All</option>
<option value ="add">Add</option>
<option value ="del">Delete</option>
<option value ="mod">Modify</option>
<option value="issue">Issue</option>
<option value="return">Return</option>
</select>
</td>
<td>
<input type="text" name="object" value="<!-- TMPL_VAR NAME="object"-->" />
</td>
<td>
<input type="text" name="info" value="<!-- TMPL_VAR NAME="info"-->" />
</td>
</tr>
<!-- TMPL_LOOP NAME="looprow" -->
<tr>
<td><!-- TMPL_VAR NAME="timestamp" --></td>
<td>
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="user" -->" title="display detail for this librarian.">
<!-- TMPL_VAR NAME="user" -->
</a>
</td>
<td><!-- TMPL_VAR NAME="module" --></td>
<td><!-- TMPL_VAR NAME="action" --></td>
<td>
<!-- TMPL_IF NAME="MEMBERS"-->
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="object" -->" title="display detail for this member." title="Display member details.">
member <!-- TMPL_VAR NAME="object" -->
</a>
<!-- TMPL_ELSE -->
<!-- TMPL_IF NAME="CIRCULATION" -->
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="object" -->" title="display detail for this member." title="Display member details.">
<!-- TMPL_IF NAME="object"-->member <!-- TMPL_VAR NAME="object" --><!-- /TMPL_IF -->
</a>
<!-- TMPL_ELSE -->
<!-- TMPL_IF NAME="CATALOGUING" -->
<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>
<!-- TMPL_ELSE-->
<!-- TMPL_IF NAME="SERIAL"-->
<a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=<!-- TMPL_VAR NAME="object" -->">
<!-- TMPL_VAR NAME="object" -->
</a>
<!-- TMPL_ELSE -->
<!-- TMPL_VAR NAME="object" -->
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
</td>
<td>
<!-- TMPL_IF NAME="CIRCULATION" -->
<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>
<!-- TMPL_ELSE -->
<!-- TMPL_VAR NAME="info" -->
<!-- /TMPL_IF -->
</td>
</tr>
<!-- /TMPL_LOOP -->
</table>
</form>
</div>
</div>
<div class="yui-b">
<!-- TMPL_INCLUDE NAME="tools-menu.inc" -->
</div>
</div>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->