template to edit the item subcategory table.
This commit is contained in:
parent
e77d06e4ef
commit
c9276aa1c6
1 changed files with 130 additions and 0 deletions
|
@ -0,0 +1,130 @@
|
|||
<!-- TMPL_INCLUDE NAME="parameters-top.inc" -->
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
function _(s) { return s } // dummy function for gettext
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
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.subcategorycode.value.length==0) {
|
||||
_alertString += "\n- " + _("Subcategorycode missing");
|
||||
}
|
||||
if (!(isNotNull(window.document.Aform.description,1))) {
|
||||
_alertString += "\n- " + _("Description missing");
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div id="mainbloc">
|
||||
<!-- TMPL_IF NAME="add_form" -->
|
||||
<!-- TMPL_IF NAME="itemtype" -->
|
||||
<h1 class="parameters">Modify Subcategory</h1>
|
||||
<!-- TMPL_ELSE -->
|
||||
<h1 class="parameters">Add Subcategory</h1>
|
||||
<!-- /TMPL_IF -->
|
||||
<form action="<!-- TMPL_VAR NAME="script_name" -->" name="Aform" method="post">
|
||||
<input type="hidden" name="op" value="add_validate">
|
||||
<input type="hidden" name="checked" value="0">
|
||||
<!-- TMPL_IF NAME="subcategorycode" -->
|
||||
<p><label class="label100">Subcategory Code<label><input type="hidden" name="subcategorycode" value="<!-- TMPL_VAR NAME="subcategorycode" -->"><!-- TMPL_VAR NAME="subcategorycode" --></p>
|
||||
<!-- TMPL_ELSE -->
|
||||
<p><label class="label100">Subcategory Code<label><input type="text" name="subcategorycode" size="6" maxlength="4" onblur="toUC(this)"></p>
|
||||
<!-- /TMPL_IF -->
|
||||
<p>
|
||||
<label class="label100">Description</label>
|
||||
<input type="text" name="description" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="description" escape=HTML -->">
|
||||
</p>
|
||||
<p>
|
||||
<label class="label100">Itemtypes assigned</label>
|
||||
<!-- TMPL_VAR NAME="itemtypes" -->
|
||||
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<input type="button" value="OK" class="button" onclick="Check(this.form)">
|
||||
</p>
|
||||
</form>
|
||||
<!-- /TMPL_IF -->
|
||||
|
||||
<!-- TMPL_IF NAME="delete_confirm" -->
|
||||
<p><label>Subcategory Code</label><!-- TMPL_VAR NAME="subcategorycode" --></p>
|
||||
<form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
|
||||
<input type="hidden" name="op" value="delete_confirmed"><input type="hidden" name="subcategorycode" value="<!-- TMPL_VAR NAME="subcategorycode" -->">
|
||||
<p><label>Description</label><!-- TMPL_VAR NAME="description" --></p>
|
||||
<p>CONFIRM DELETION</p>
|
||||
<p>
|
||||
<input type="submit" value="YES" class="button parameters"></form>
|
||||
<form action="<!-- TMPL_VAR NAME="script_name" -->" method="post"><input type="submit" value="NO" class="button parameters"></form>
|
||||
</p>
|
||||
|
||||
|
||||
<!-- /TMPL_IF -->
|
||||
|
||||
<!-- TMPL_IF NAME="else" -->
|
||||
<h1 class="parameters">Subcategory Admin</h1>
|
||||
<table>
|
||||
<tr>
|
||||
<th class="parameters">Code</th>
|
||||
<th class="parameters">Description</th>
|
||||
<th class="parameters">Itemtype codes</th>
|
||||
<th class="parameters">Edit</th>
|
||||
<th class="parameters">Delete</th>
|
||||
</tr>
|
||||
<!-- TMPL_LOOP NAME="loop" -->
|
||||
<tr>
|
||||
<td><!-- TMPL_VAR NAME="subcategorycode" --></td>
|
||||
<td><!-- TMPL_VAR NAME="description" --></td>
|
||||
<td><!-- TMPL_VAR NAME="itemtypecodes" --></td>
|
||||
<td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&subcategorycode=<!-- TMPL_VAR NAME="subcategorycode" escape="HTML" -->"><img src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/fileopen.png" width="32" hspace="0" vspace="0" border="0"></a></td>
|
||||
<td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=delete_confirm&subcategorycode=<!-- TMPL_VAR NAME="subcategorycode" escape="HTML" -->"><img src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/edittrash.png" width="32" hspace="0" vspace="0" border="0"></a></td>
|
||||
</tr>
|
||||
<!-- /TMPL_LOOP -->
|
||||
</table>
|
||||
<form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
|
||||
<input type="hidden" name="op" value="add_form">
|
||||
<input type="submit" class="button parameters" value="Add Subcategory" title="Add Subcategory" alt="Add Subcategory" >
|
||||
<td width="33%"><!-- TMPL_IF NAME="previous" --><a href="<!-- TMPL_VAR NAME="previous" -->"><input type="image" src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/1leftarrow.png" title="previous" alt="previous" border="0"></a><!-- /TMPL_IF --></td>
|
||||
<td width="33%"><!-- TMPL_IF NAME="next" --><a href="<!-- TMPL_VAR NAME="next" -->"><input type="image" src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/1rightarrow.png" title="next" alt="next" border="0"></a><!-- /TMPL_IF --></td>
|
||||
</form>
|
||||
</div>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_INCLUDE NAME="parameters-bottom.inc" -->
|
Loading…
Reference in a new issue