you couldn't edit a process category, you can do it now

This commit is contained in:
Carlos Pacha
2010-12-22 20:52:58 +00:00
parent 11b1bfb213
commit 668aef173d
4 changed files with 106 additions and 8 deletions

View File

@@ -22,6 +22,6 @@ if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVAN
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processCategory/processCategoryEdit', '', $fields, 'processCategorySave' ); $G_PUBLISH->AddContent('xmlform', 'xmlform', 'processCategory/processCategoryNew', '', $fields, 'processCategorySave' );
G::RenderPage('publishBlank', 'blank'); G::RenderPage('publishBlank', 'blank');
?> ?>

View File

@@ -35,12 +35,6 @@
var verifyName = function(oForm) { var verifyName = function(oForm) {
var categoryName = trim(getField('CATEGORY_NAME').value); var categoryName = trim(getField('CATEGORY_NAME').value);
if (categoryName != '') { if (categoryName != '') {
var answer;
answer = ajax_function(@G::encryptlink('processCategoryAjax'), 'checkCategoryName', 'CategoryName='+categoryName, 'POST');
if(answer == '1'){
new leimnud.module.app.alert().make({label: '@G::LoadTranslation(ID_DUPLICATE_CATEGORY_NAME)' });
return false;
}
oForm.submit(); oForm.submit();
} }
else { else {

View File

@@ -0,0 +1,48 @@
<form id="{$form_id}" name="{$form_name}" action="{$form_action}" class="{$form_className}" method="post" encType="multipart/form-data" style="margin:0px;" onsubmit='return validateForm("{$form_objectRequiredFields}".parseJSON());'>
<div class="borderForm" style="padding-left: 80pt; padding-right: 80pt;">
<div class="boxTop"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="content" style="">
<table width="80%">
<tbody><tr>
<td valign="top">
<input class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="" type="hidden">
<input name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" type="hidden">
<table style="width: 1000px; height: 116px;" border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
<td class="FormTitle" colspan="2" align="">{$form.title1}</td>
</tr>
<tr style="display: none;">
<td colspan="2">{$form.CATEGORY_UID }</td>
</tr>
<tr style="display: none;">
<td colspan="2">{$form.CATEGORY_PARENT}</td>
</tr>
<tr>
<td class="FormLabel" width="{$form_labelWidth}"><font color="red">* </font>{$CATEGORY_NAME }</td>
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.CATEGORY_NAME }</td>
</tr>
<tr style="display: none;">
<td colspan="2">{$form.CATEGORY_ICON}</td>
</tr>
<tr>
<td class="FormButton" colspan="2" align="center"> <br/> {$form.BTN_SUBMIT} &nbsp; {$form.BTN_CANCEL } </td>
</tr>
<tr><td class="FormButton" colspan="2" align="center">
<div id = "REQUIRED"><font color="red">* </font>{php}echo (G::LoadTranslation('ID_REQUIRED_FIELD'));{/php}
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody></table>
</div>
<div class="boxBottom"><div class="a"></div><div class="b"></div><div class="c"></div></div>
</div>
<script type="text/javascript">
{$form.JS}
</script>
</form>

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="ProcessCategory" width="600" mode="edit" enableTemplate="1" border="0">
<title1 type="title">
<en>Process Category form</en>
<es><![CDATA[Formulario de categoría del proceso]]></es>
</title1>
<CATEGORY_UID type="hidden" colWidth="32">
<en>category Uid</en>
</CATEGORY_UID>
<CATEGORY_PARENT type="hidden" size="32" maxlength="32">
<en>Gory Parent </en>
</CATEGORY_PARENT>
<CATEGORY_NAME type="text" size="60" maxlength="100">
<en>Category Name
</en>
<es><![CDATA[Nombre de la categoria]]></es>
</CATEGORY_NAME>
<CATEGORY_ICON type="hidden" size="60" maxlength="100">
<en>Category Icon
</en>
</CATEGORY_ICON>
<BTN_SUBMIT type="button" onclick="javascript:verifyName(this.form);">
<en>save</en>
<es><![CDATA[Guardar]]></es>
</BTN_SUBMIT>
<BTN_CANCEL type="button" onclick="cancel();">
<en>Cancel</en>
<es><![CDATA[Cancelar]]></es>
</BTN_CANCEL>
<JS type="javascript" replacetags="1"><![CDATA[
function trim(stringToTrim) {
return stringToTrim.replace(/^\s+|\s+$/g,"");
}
var verifyName = function(oForm) {
var categoryName = trim(getField('CATEGORY_NAME').value);
if (categoryName != '') {
var answer;
answer = ajax_function(@G::encryptlink('processCategoryAjax'), 'checkCategoryName', 'CategoryName='+categoryName, 'POST');
if(answer == '1'){
new leimnud.module.app.alert().make({label: '@G::LoadTranslation(ID_DUPLICATE_CATEGORY_NAME)' });
return false;
}
oForm.submit();
}
else {
msgBox('@G::LoadTranslation(ID_PLEASE_ENTER_REQUIRED_FIELDS)', 'alert');
}
};
function cancel(){
window.location = 'processCategoryList';
}
]]></JS>
</dynaForm>