Koha/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tmpl
Paul Poulain 34f1987dcb fix for #2884: Add error management to branches
While trying to add a new Branch with an existing Branch code, the UI says "Library saved" instead of something such as "Please select a unique branch code".
2009-09-30 11:30:14 +02:00

333 lines
18 KiB
Cheetah

<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha &rsaquo; Administration &rsaquo; Libraries and Groups
<!-- TMPL_IF NAME="editcategory" -->
&rsaquo;<!-- TMPL_IF NAME="categorycode" -->Edit Group <!-- TMPL_VAR NAME="categorycode" --><!-- TMPL_ELSE -->New Group<!-- /TMPL_IF -->
<!-- TMPL_ELSIF NAME="delete_category" -->
&rsaquo; Confirm Deletion of Group <!-- TMPL_VAR name="categorycode" -->
<!-- TMPL_ELSIF name="add" -->
&rsaquo;<!-- TMPL_IF name="heading-branches-add-branch-p" -->New library<!-- TMPL_ELSE -->Modify library <!-- TMPL_VAR name="branchcode" --><!-- /TMPL_IF -->
<!-- TMPL_ELSIF name="delete_confirm" -->
&rsaquo; Confirm deletion of library '<!-- TMPL_VAR NAME="branchcode" -->'
<!-- /TMPL_IF -->
</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
</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/admin/admin-home.pl">Administration</a>
&rsaquo; <a href="/cgi-bin/koha/admin/branches.pl">Libraries and Groups</a>
<!-- TMPL_IF NAME="editcategory" -->
&rsaquo; <!-- TMPL_IF NAME="categorycode" -->Edit Group <!-- TMPL_VAR NAME="categorycode" --><!-- TMPL_ELSE -->New Group<!-- /TMPL_IF -->
<!-- TMPL_ELSIF NAME="delete_category" -->
&rsaquo; Confirm Deletion of Group <!-- TMPL_VAR name="categorycode" -->
<!-- TMPL_ELSIF name="add" -->
&rsaquo; <!-- TMPL_IF name="heading-branches-add-branch-p" -->New library<!-- TMPL_ELSE -->Modify library <!-- TMPL_VAR name="branchcode" --><!-- /TMPL_IF -->
<!-- TMPL_ELSIF name="delete_confirm" -->
&rsaquo; Confirm deletion of library '<!-- TMPL_VAR NAME="branchcode" -->'
<!-- /TMPL_IF -->
</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<!-- TMPL_IF name="else" -->
<div id="toolbar">
<script type="text/javascript">
//<![CDATA[
// prepare DOM for YUI Toolbar
$(document).ready(function() {
yuiToolbar();
$.tablesorter.defaults.widgets = ['zebra'];
$("#branchest").tablesorter({
sortList: [[0,0]],
headers: { 3:{sorter:false},4:{sorter:false},5:{sorter:false},6:{sorter:false}}
});
});
// YUI Toolbar Functions
function yuiToolbar() {
new YAHOO.widget.Button("newbranch");
new YAHOO.widget.Button("newcategory");
}
//]]>
</script>
<ul class="toolbar">
<li><a id="newbranch" href="/cgi-bin/koha/admin/branches.pl?op=add">New Library</a></li>
<li><a id="newcategory" href="/cgi-bin/koha/admin/branches.pl?op=editcategory">New Group</a></li>
</ul></div>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="add" -->
<!-- TMPL_IF name="ERROR1" --><div class="dialog message">Code already exists &mdash; Please enter a unique code</div><!-- /TMPL_IF -->
<h3><!-- TMPL_IF name="heading-branches-add-branch-p" -->New library<!-- TMPL_ELSE -->Modify library<!-- /TMPL_IF --></h3>
<form action="<!-- TMPL_VAR name="action" -->" name="Aform" method="post">
<fieldset class="rows">
<input type="hidden" name="op" value="add_validate" />
<!-- TMPL_IF name="heading-branches-add-branch-p" -->
<input type="hidden" name="add" value="1" />
<!-- TMPL_ELSE -->
<input type="hidden" name="add" value="0" />
<!-- /TMPL_IF -->
<ol><li>
<!-- TMPL_IF name="heading-branches-add-branch-p" -->
<label for="branchcode">Library code</label>
<input type="text" name="branchcode" id="branchcode" size="10" maxlength="10" value="<!-- TMPL_VAR name="branchcode" escape="HTML" -->" />
<!-- TMPL_ELSE -->
<label for="branchcode">Library code</label>
<input type="hidden" name="branchcode" value="<!-- TMPL_VAR name="branchcode" escape="HTML" -->" />
<!-- TMPL_VAR name="branchcode" -->
<!-- /TMPL_IF -->
</li>
<li>
<label for="branchname">Name</label>
<input type="text" name="branchname" id="branchname" size="40" maxlength="80" value="<!-- TMPL_VAR name="branch_name" escape="HTML" -->" />&nbsp;
</li>
</ol>
</fieldset>
<!-- TMPL_IF NAME="categoryloop" --><fieldset class="rows"><legend>Group(s):</legend>
<ol>
<!-- TMPL_LOOP name="categoryloop" -->
<li><label for="<!-- TMPL_VAR name="categorycode" -->"><!-- TMPL_VAR name="categoryname" --></label>
<input type="checkbox" id="<!-- TMPL_VAR name="categorycode" -->" name="<!-- TMPL_VAR name="categorycode" -->" <!-- TMPL_VAR name="checked" --> /> <span class="hint"><!-- TMPL_VAR name="codedescription" --></span>
</li>
<!-- /TMPL_LOOP -->
</ol>
</fieldset><!-- /TMPL_IF -->
<fieldset class="rows">
<ol>
<li><label for="branchaddress1">Address Line 1</label><input type="text" name="branchaddress1" id="branchaddress1" value="<!-- TMPL_VAR name="branchaddress1" escape="HTML" -->" /></li>
<li><label for="branchaddress2">Address Line 2</label><input type="text" name="branchaddress2" id="branchaddress2" value="<!-- TMPL_VAR name="branchaddress2" escape="HTML" -->" /></li>
<li><label for="branchaddress3">Address Line 3</label><input type="text" name="branchaddress3" id="branchaddress3" value="<!-- TMPL_VAR name="branchaddress3" escape="HTML" -->" /></li>
<li><label for="branchzip">Zip/Postal Code</label><input type="text" name="branchzip" id="branchzip" value="<!-- TMPL_VAR name="branchzip" escape="HTML" -->" /></li>
<li><label for="branchcity">City</label><input type="text" name="branchcity" id="branchcity" value="<!-- TMPL_VAR name="branchcity" escape="HTML" -->" /></li>
<li><label for="branchcountry">Country</label><input type="text" name="branchcountry" id="branchcountry" value="<!-- TMPL_VAR name="branchcountry" escape="HTML" -->" /></li>
<li><label for="branchphone">Phone</label><input type="text" name="branchphone" id="branchphone" value="<!-- TMPL_VAR name="branchphone" escape="HTML" -->" /></li>
<li><label for="branchfax">Fax</label><input type="text" name="branchfax" id="branchfax" value="<!-- TMPL_VAR name="branchfax" escape="HTML" -->" /></li>
<li><label for="branchemail">Email</label><input type="text" name="branchemail" id="branchemail" value="<!-- TMPL_VAR name="branchemail" escape="HTML" -->" /></li>
<li><label for="branchurl">URL</label><input type="text" name="branchurl" id="branchurl" value="<!-- TMPL_VAR name="branchurl" escape="HTML" -->" /></li>
<li><label for="branchip">IP</label><input type="text" name="branchip" id="branchip" value="<!-- TMPL_VAR name="branchip" escape="HTML" -->" /> <span class="hint">Can be entered as a single IP, or a subnet such as 192.168.1.*</span></li>
<!--
<li><label for="branchprinter">Library Printer</label>
<select id="branchprinter" name="branchprinter">
<option value="">None</option>
<!-- TMPL_LOOP NAME="printerloop" -->
<!-- TMPL_IF NAME="selected" -->
<option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchprinter" --></option>
<!-- TMPL_ELSE -->
<option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchprinter" --></option>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</select></li>
-->
<li><label for="branchnotes">Notes</label><input type="text" name="branchnotes" id="branchnotes" value="<!-- TMPL_VAR name="branchnotes" escape="HTML" -->" /></li>
</ol>
</fieldset>
<fieldset class="action"><input type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/admin/branches.pl">Cancel</a></fieldset>
</form>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="delete_confirm" -->
<form action="<!-- TMPL_VAR name="action" -->" method="post">
<fieldset><legend>Confirm deletion of <!-- TMPL_VAR NAME="branchname" --> (<!-- TMPL_VAR NAME="branchcode" -->)?</legend><input type="hidden" name="op" value="delete_confirmed" />
<input type="hidden" name="branchcode" value="<!-- TMPL_VAR name="branchcode" escape="HTML" -->" />
<input type="hidden" name="branchname" value="<!-- TMPL_VAR NAME="branchname" escape="HTML" -->">
<fieldset class="action"><input type="submit" value="Delete Library" /> <a class="cancel" href="/cgi-bin/koha/admin/branches.pl">Cancel</a></fieldset>
</fieldset></form>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="else" -->
<h3>Libraries</h3>
<!-- TMPL_IF NAME="message" --><div class="dialog message">
<!-- TMPL_VAR name="message" --></div><!-- /TMPL_IF -->
<!-- TMPL_IF name="MESSAGE1" --><div class="dialog message">Library not saved &mdash; code and/or name missing</div><!-- /TMPL_IF -->
<!-- TMPL_IF name="MESSAGE2" --><div class="dialog message">Library saved</div><!-- /TMPL_IF -->
<!-- TMPL_IF name="MESSAGE3" --><div class="dialog message">Library deleted</div><!-- /TMPL_IF -->
<!-- TMPL_IF name="MESSAGE4" --><div class="dialog message">Library category added</div><!-- /TMPL_IF -->
<!-- TMPL_IF name="MESSAGE5" --><div class="dialog message">Library category modified</div><!-- /TMPL_IF -->
<!-- TMPL_IF name="MESSAGE6" --><div class="dialog message">Library category deleted</div><!-- /TMPL_IF -->
<!-- TMPL_IF name="MESSAGE7" --><div class="dialog message">Library cannot be deleted because there are patrons using that library</div><!-- /TMPL_IF -->
<!-- TMPL_IF name="MESSAGE8" --><div class="dialog message">Category cannot be deleted because there are libraries using that category</div><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="branches" -->
<table id="branchest">
<thead><tr>
<th>Name</th>
<th>Code</th>
<th>Address</th>
<th>Properties</th>
<th>IP</th>
<!-- <th>Printer</th> -->
<th colspan="2">&nbsp;</th>
</tr></thead><tbody>
<!-- TMPL_LOOP name="branches" -->
<!-- TMPL_IF NAME="__odd__" -->
<tr>
<!-- TMPL_ELSE -->
<tr class="highlight">
<!-- /TMPL_IF -->
<td><!-- TMPL_VAR name="branch_name" escape="HTML" --></td>
<td><!-- TMPL_VAR name="branch_code" escape="HTML" --></td>
<td>
<!-- TMPL_IF name="address-empty-p" -->
(nothing entered)
<!-- TMPL_ELSE -->
<!-- TMPL_IF name="branchaddress1" -->
<!-- TMPL_VAR name="branchaddress1" escape="HTML" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="branchaddress2" -->
<br /><!-- TMPL_VAR name="branchaddress2" escape="HTML" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="branchaddress3" -->
<br /><!-- TMPL_VAR name="branchaddress3" escape="HTML" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="branchzip" -->
<br /><!-- TMPL_VAR name="branchzip" escape="HTML" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="branchcity" -->
<br /><!-- TMPL_VAR name="branchcity" escape="HTML" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="branchcountry" -->
<br /><!-- TMPL_VAR name="branchcountry" escape="HTML" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="branchphone" -->
<br />Ph: <!-- TMPL_VAR name="branchphone" escape="HTML" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="branchfax" -->
<br />Fax: <!-- TMPL_VAR name="branchfax" escape="HTML" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="branchemail" -->
<br />Email: <!-- TMPL_VAR name="branchemail" escape="HTML" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="branchurl" -->
<br />URL: <!-- TMPL_VAR name="branchurl" escape="HTML" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="branchnotes" -->
<br />Notes: <!-- TMPL_VAR name="branchnotesl" escape="HTML" --><!-- /TMPL_IF -->
<!-- /TMPL_IF -->
</td>
<td>
<!-- TMPL_UNLESS name="no-categories-p" -->
<!-- TMPL_LOOP name="category_list" -->
<!-- TMPL_VAR name="categoryname" --><br />
<!-- /TMPL_LOOP -->
<!-- /TMPL_UNLESS -->
</td>
<td>
<!-- TMPL_VAR NAME="branchip" -->
</td>
<!-- <td>
<!-- TMPL_VAR NAME="branchprinter" -->
</td> -->
<td>
<a href="<!-- TMPL_VAR name="action" -->?op=edit&amp;branchcode=<!-- TMPL_VAR name="value" escape="url" -->">Edit</a>
</td>
<td>
<a href="<!-- TMPL_VAR name="action" -->?branchcode=<!-- TMPL_VAR name="value" escape="url" -->&amp;branchname=<!-- TMPL_VAR NAME="branch_name" escape="url" -->&amp;op=delete">Delete</a>
</td>
</tr>
<!-- /TMPL_LOOP --></tbody>
</table>
<!-- TMPL_ELSE -->
<div class="dialog message">There are no libraries defined. <a href="/cgi-bin/koha/admin/branches.pl?op=add">Start defining libraries</a>.</div>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="branchcategories" -->
<!-- TMPL_LOOP NAME="branchcategories" -->
<h3>Group(s): <!-- TMPL_IF NAME="properties" -->Properties<!-- TMPL_ELSE --><!-- TMPL_IF NAME="searchdomain" -->Search Domain<!-- /TMPL_IF --><!-- /TMPL_IF --></h3>
<table>
<tr>
<th>Name</th>
<th>Code</th>
<th>Description</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
<!-- TMPL_IF NAME="catloop" --><!-- TMPL_LOOP name="catloop" -->
<tr>
<td><!-- TMPL_VAR name="categoryname" --></td>
<td><!-- TMPL_VAR name="categorycode" --></td>
<td><!-- TMPL_VAR name="codedescription" --></td>
<td><a href="<!-- TMPL_VAR name="action" -->?op=editcategory&amp;categorycode=<!-- TMPL_VAR name="categorycode" escape="url" -->">Edit</a>
</td>
<td><a href="<!-- TMPL_VAR name="action" -->?op=delete_category&amp;categorycode=<!-- TMPL_VAR name="categorycode" escape="url" -->">Delete</a>
</td>
</tr>
<!-- /TMPL_LOOP --><!-- TMPL_ELSE --><tr><td colspan="5">No <!-- TMPL_IF NAME="properties" -->Properties<!-- TMPL_ELSIF NAME="searchdomain" -->Search Domain<!-- /TMPL_IF --> Defined</td></tr><!-- /TMPL_IF -->
</table>
<!-- /TMPL_LOOP -->
<!-- TMPL_ELSE -->
<p>No Groups defined.</p>
<!-- /TMPL_IF --> <!-- NAME="branchcategories" -->
<!-- /TMPL_IF -->
<!-- TMPL_IF name="editcategory" -->
<h3><!-- TMPL_IF NAME="categorycode" -->Edit Group <!-- TMPL_VAR NAME="categorycode" --><!-- TMPL_ELSE -->Add Group<!-- /TMPL_IF --></h3>
<form action="<!-- TMPL_VAR name="action" -->" name="Aform" method="post">
<input type="hidden" name="op" value="addcategory_validate" />
<!-- TMPL_IF NAME="categorycode" -->
<input type="hidden" name="add" value="0">
<!-- TMPL_ELSE -->
<input type="hidden" name="add" value="1">
<!-- /TMPL_IF -->
<fieldset class="rows">
<ol><li>
<!-- TMPL_IF name="categorycode" -->
<span class="label">Category code: </span>
<input type="hidden" name="categorycode" id="categorycode" value="<!-- TMPL_VAR name="categorycode" escape="HTML" -->" />
<!-- TMPL_VAR name="categorycode" -->
<!-- TMPL_ELSE -->
<label for="categorycode">Category code:</label>
<input type="text" name="categorycode" id="categorycode" size="11" maxlength="10" value="<!-- TMPL_VAR name="categorycode" escape="HTML" -->" />
<!-- /TMPL_IF -->
</li>
<li>
<label for="categoryname">Name: </label>
<input type="text" name="categoryname" id="categoryname" size="40" maxlength="80" value="<!-- TMPL_VAR name="categoryname" escape="HTML" -->" />
</li>
<li>
<label for="codedescription">Description: </label>
<input type="text" name="codedescription" id="codedescription" size="70" maxlength="80" value="<!-- TMPL_VAR name="codedescription" escape="HTML" -->" />
</li>
<li>
<label for="categorytype">Category Type: </label>
<select id="categorytype" name="categorytype">
<!-- TMPL_LOOP NAME="categorytype" -->
<!-- TMPL_IF NAME="selected" -->
<option value="<!-- TMPL_VAR NAME="type" -->" selected="selected">
<!-- TMPL_ELSE -->
<option value="<!-- TMPL_VAR NAME="type" -->">
<!-- /TMPL_IF --> <!-- TMPL_VAR NAME="type" --></option>
<!-- /TMPL_LOOP -->
</select>
</li>
</ol>
</fieldset>
<fieldset class="action"><input type="submit" value="Update" /></fieldset>
</form>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="delete_category" -->
<!-- TMPL_UNLESS name="MESSAGE8" -->
<div class="dialog message">
Confirm delete:
<form action="<!-- TMPL_VAR name="action" -->" method="post">
<input type="hidden" name="op" value="categorydelete_confirmed" />
<input type="hidden" name="categorycode" value="<!-- TMPL_VAR name="categorycode" escape="HTML" -->" />
<input type="submit" value="YES" />
</form>
<form action="<!-- TMPL_VAR name="action" -->" method="post"><input type="hidden" name="op" value="">
<input type="submit" value="NO" />
</form>
</div>
<!-- /TMPL_UNLESS -->
<!-- /TMPL_IF -->
</div>
</div>
<div class="yui-b">
<!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
</div>
</div>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->