+[% USE EncodeUTF8 %]
+[% USE AuthorisedValues %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Administration › Item types [% IF ( add_form ) %]›
[% IF ( itemtype ) %]
[% END %]
</title>
[% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
-<script type="text/javascript" id="js">$(document).ready(function() {
- // call the tablesorter plugin
- $("#table_item_type").tablesorter({
- sortList: [[1,0]],
- headers: { 0: { sorter: false},5: { sorter: false}}
- }).tablesorterPager({container: $("#pagertable_item_type"),positionFixed: false,size: 10});
-
-}); </script>
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
//<![CDATA[
-
-function isNotNull(f,noalert) {
- if (f.value.length ==0) {
- return false;
- }
- return true;
-}
-
-function toUC(f) {
- var x=f.value.toUpperCase();
- f.value=x;
- return true;
-}
-
-function isNum(v,maybenull) {
-var n = new Number(v.value);
-if (isNaN(n)) {
- return false;
- }
-if (maybenull==0 && v.value=='') {
- return false;
-}
-return true;
-}
-
-function isDate(f) {
- var t = Date.parse(f.value);
- if (isNaN(t)) {
- return false;
- }
-}
-
-function Check(f) {
- var ok=1;
- var _alertString="";
- var alertString2;
- if (f.itemtype.value.length==0) {
- _alertString += "\n- " + _("Itemtype missing");
- }
- if (!(isNotNull(window.document.Aform.description,1))) {
- _alertString += "\n- " + _("Description missing");
- }
- if ((!isNum(f.rentalcharge,0)) && f.rentalcharge.value.length > 0) {
- _alertString += "\n- " + _("Rental charge is not a number");
- }
- if (_alertString.length==0) {
- document.Aform.submit();
- } else {
- alertString2 = _("Form not submitted because of the following problem(s)");
- alertString2 += "\n------------------------------------------------------------------------------------\n";
- alertString2 += _alertString;
- alert(alertString2);
- }
-}
$(document).ready(function() {
$('#icons').tabs();
+ $("#table_item_type").dataTable($.extend(true, {}, dataTablesDefaults, {
+ "aoColumnDefs": [
+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
+ ],
+ "aaSorting": [[ 2, "asc" ]],
+ "iDisplayLength": 10
+ }));
+ $( "#itemtypeentry" ).validate({
+ rules: {
+ itemtype: { required: true },
+ description: { required: true },
+ rentalcharge: { number: true }
+ }
+ });
});
//]]>
</script>
<style type="text/css">
fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
- fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-selected {background-color : #F4F8F9; }
+ fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-active {background-color : #F4F8F9; }
fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
fieldset.rows .ui-tabs-nav { margin-left : 10px; }
</style>
<div id="yui-main">
<div class="yui-b">
-[% IF ( 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("newitemtype");
- }
-
- //]]>
- </script>
- <ul class="toolbar">
- <li><a id="newitemtype" href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form">New item type</a></li>
-</ul></div>[% ELSE %] [% END %]
+[% IF ( else ) %]<div id="toolbar" class="btn-toolbar">
+ <a class="btn btn-small" id="newitemtype" href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form"><i class="icon-plus"></i> New item type</a>
+</div>[% END %]
[% IF ( add_form ) %]
[% IF ( itemtype ) %]
[% ELSE %]
<h3>Add item type</h3>
[% END %]
-<form action="[% script_name %]" name="Aform" method="post">
+<form action="[% script_name %]" name="Aform" method="post" id="itemtypeentry">
<input type="hidden" name="op" value="add_validate" />
<input type="hidden" name="checked" value="0" />
<ol>
[% IF ( itemtype ) %]
<li>
- <span class="label">Item type</span> <input type="hidden" name="itemtype" value="[% itemtype %]" />
+ <span class="label">Item type: </span> <input type="hidden" name="itemtype" value="[% itemtype %]" />
[% itemtype %]
</li>
[% ELSE %]
<li>
- <label for="itemtype">Item type</label> <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" class="focus" />
+ <label for="itemtype" class="required">Item type: </label> <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" required="required" /> <span class="required">Required</span>
</li>
[% END %]
<li>
- [% IF ( itemtype ) %]
- <label for="description">Description</label><input type="text" id="description" name="description" size="48" value="[% description |html %]" class="focus" /></li>
- [% ELSE %]
- <label for="description">Description</label><input type="text" id="description" name="description" size="48" value="[% description |html %]" /></li>
- [% END %]
+ <label for="description" class="required">Description: </label><input type="text" id="description" name="description" size="48" value="[% description |html %]" required="required" /> <span class="required">Required</span></li>
[% IF ( noItemTypeImages ) %]
<li><span class="label">Image: </span>Item type images are disabled. To enable them, turn off the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=noItemTypeImages">noItemTypeImages system preference</a></li></ol>
[% ELSE %]</ol>
<ul>
<li><a href="#none">None</a></li>
[% FOREACH imageset IN imagesets %]
- [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-selected">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a></li>
+ [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a></li>
[% END %]
- [% IF ( remote_image ) %]<li class="ui-tabs-selected">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
+ [% IF ( remote_image ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
</ul>
<div id="none"><ul>
<li><label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" /></li>
[% FOREACH imageset IN imagesets %]
<div id="[% imageset.imagesetname %]"><ul>
[% FOREACH image IN imageset.images %]
- <li style="float: none; display: inline; clear : none; width: auto;">
+ <li style="float: none; display: inline-block; clear : none; width: auto;">
<label> [% IF ( image.StaffImageUrl ) %]
<img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
[% ELSE %]
</ul>
<br class="clear" />
</div>
-[% END %]
</div>
+[% END %]
<ol>
<li>
- <label for="notforloan">Not for loan</label> [% IF ( notforloan ) %]
+ <label for="notforloan">Not for loan: </label> [% IF ( notforloan ) %]
<input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
[% ELSE %]
<input type="checkbox" id="notforloan" name="notforloan" value="1" />
<label for="rentalcharge">Rental charge: </label>
<input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% rentalcharge %]" />
</li>
+ <li>
+ <label for="checkinmsg">Checkin message: </label>
+ <textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% checkinmsg %]</textarea>
+ </li>
+ <li>
+ <label for="checkinmsgtype">Checkin message type: </label>
+ <select type="text" id="checkinmsgtype" name="checkinmsgtype">
+ [% IF ( checkinmsgtype == 'message' ) %]
+ <option value="message" selected="selected">Message</option>
+ [% ELSE %]
+ <option value="message">Message</option>
+ [% END %]
+ [% IF ( checkinmsgtype == 'alert' ) %]
+ <option value="alert" selected="selected">Alert</option>
+ [% ELSE %]
+ <option value="alert">Alert</option>
+ [% END %]
+ </select>
+ </li>
+ <li>
+ <label for="sip_media_type">SIP media type: </label>
+ <select id="sip_media_type" name="sip_media_type">
+ <option value=""></option>
+ [% FOREACH a IN AuthorisedValues.Get('SIP_MEDIA_TYPE', sip_media_type ) %]
+ [% IF a.selected %]
+ <option value="[% a.authorised_value %]" selected="selected">[% a.lib | $EncodeUTF8 %]</option>
+ [% ELSE %]
+ <option value="[% a.authorised_value %]">[% a.lib | $EncodeUTF8 %]</option>
+ [% END %]
+ [% END %]
+ </select>
+ </li>
<li>
<label for="summary">Summary: </label>
<textarea id="summary" name="summary" cols="55" rows="5">[% summary %]</textarea>
</fieldset>
<fieldset class="action">
- <input type="button" value="Save Changes" onclick="Check(this.form)" />
+ <input type="submit" value="Save changes" />
<a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
</fieldset>
</form>
[% IF ( else ) %]
<h2>Item types administration</h2>
-[% IF ( loop ) %]<div id="pagertable_item_type">
-[% INCLUDE 'table-pager.inc' perpage='10' %]
-</div>
+[% IF ( loop ) %]
<table id="table_item_type">
<thead>
[% UNLESS ( noItemTypeImages ) %]<th>Image</th>[% END %]
<th>Description</th>
<th>Not for loan</th>
<th>Charge</th>
+ <th>Checkin message</th>
<th>Actions</th>
</thead>
[% FOREACH loo IN loop %]
- [% UNLESS ( loop.odd ) %]
- <tr class="highlight">
- [% ELSE %]
- <tr>
- [% END %]
+ <tr>
[% UNLESS ( noItemTypeImages ) %] <td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt="" />[% ELSE %] [% END %]</td>[% END %]
<td>
<a href="[% loo.script_name %]?op=add_form&itemtype=[% loo.itemtype |html %]">
[% loo.rentalcharge %]
[% END %]
</td>
+ <td>[% loo.checkinmsg | html_line_break %]</td>
<td>
<a href="[% loo.script_name %]?op=add_form&itemtype=[% loo.itemtype |html %]">Edit</a>
<a href="[% loo.script_name %]?op=delete_confirm&itemtype=[% loo.itemtype |html %]">Delete</a>