* finish task #4225.
This commit is contained in:
+12
-12
@@ -119,29 +119,29 @@ class custom extends control
|
||||
/* Invalid key. It should be numbers. (It includes severityList in bug module and priList in stroy, task, bug, testcasea, testtask and todo module.) */
|
||||
if($field == 'priList' or $field == 'severityList')
|
||||
{
|
||||
if(!is_numeric($key) or $key > 255) die(js::alert($this->lang->custom->notice->invalidNumberKey));
|
||||
if(!is_numeric($key) or $key > 255) $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidNumberKey));
|
||||
}
|
||||
if(!empty($key) and $key != 'n/a' and !validater::checkREG($key, '/^[a-z_0-9]+$/')) die(js::alert($this->lang->custom->notice->invalidStringKey));
|
||||
if(!empty($key) and $key != 'n/a' and !validater::checkREG($key, '/^[a-z_0-9]+$/')) $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStringKey));
|
||||
|
||||
/* The length of roleList in user module and typeList in todo module is less than 10. check it when saved. */
|
||||
if($field == 'roleList' or $module == 'todo' and $field == 'typeList')
|
||||
{
|
||||
if(strlen($key) > 10) die(js::alert($this->lang->custom->notice->invalidStrlen['ten']));
|
||||
if(strlen($key) > 10) $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['ten']));
|
||||
}
|
||||
|
||||
/* The length of sourceList in story module and typeList in task module is less than 20, check it when saved. */
|
||||
if($field == 'sourceList' or $module == 'task' and $field == 'typeList')
|
||||
{
|
||||
if(strlen($key) > 20) die(js::alert($this->lang->custom->notice->invalidStrlen['twenty']));
|
||||
if(strlen($key) > 20) $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['twenty']));
|
||||
}
|
||||
|
||||
/* The length of stageList in testcase module is less than 255, check it when saved. */
|
||||
if($module == 'testcase' and $field == 'stageList' and strlen($key) > 255) die(js::alert($this->lang->custom->notice->invalidStrlen['twoHundred']));
|
||||
if($module == 'testcase' and $field == 'stageList' and strlen($key) > 255) $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['twoHundred']));
|
||||
|
||||
/* The length of field that in bug and testcase module and reasonList in story and task module is less than 30, check it when saved. */
|
||||
if($module == 'bug' or $field == 'reasonList' or $module == 'testcase')
|
||||
{
|
||||
if(strlen($key) > 30) die(js::alert($this->lang->custom->notice->invalidStrlen['thirty']));
|
||||
if(strlen($key) > 30) $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['thirty']));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,8 +156,8 @@ class custom extends control
|
||||
$this->custom->setItem("{$lang}.{$module}.{$field}.{$key}.{$system}", $value);
|
||||
}
|
||||
}
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
die(js::locate($this->createLink('custom', 'set', "module=$module&field=$field&lang=" . str_replace('-', '_', $lang)), 'parent'));
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload'));
|
||||
}
|
||||
|
||||
/* Check whether the current language has been customized. */
|
||||
@@ -237,7 +237,7 @@ class custom extends control
|
||||
$this->dao->update(TABLE_BLOCK)->set("`title` = REPLACE(`title`, '{$projectCommonList[$oldProjectIndex]}', '{$projectCommonList[$newProjectIndex]}')")->where('source')->eq('project')->exec();
|
||||
}
|
||||
|
||||
die(js::reload('parent'));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload'));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->custom->flow;
|
||||
@@ -250,7 +250,7 @@ class custom extends control
|
||||
if($_POST)
|
||||
{
|
||||
$this->loadModel('setting')->setItem('system.common.global.flow', $this->post->flow);
|
||||
die(js::reload('parent'));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload'));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->custom->working;
|
||||
@@ -272,7 +272,7 @@ class custom extends control
|
||||
if($_POST)
|
||||
{
|
||||
$this->custom->saveRequiredFields($moduleName);
|
||||
die(js::reload('parent.parent'));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload'));
|
||||
}
|
||||
|
||||
foreach($this->config->custom->requiredModules as $requiredModule) $this->app->loadLang($requiredModule);
|
||||
@@ -306,7 +306,7 @@ class custom extends control
|
||||
if($_POST)
|
||||
{
|
||||
$this->loadModel('setting')->setItem('system.common.global.scoreStatus', $this->post->score);
|
||||
die(js::reload('parent'));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload'));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->custom->score;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='side-col' id='sidebar'></div>
|
||||
<div class='main-col main-content'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<form class="load-indicator main-form form-ajax" method='post'>
|
||||
<div class='main-header'>
|
||||
<div class='heading'>
|
||||
<strong><?php echo $lang->custom->flow?></strong>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class='main-col main-content'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<form class="load-indicator main-form form-ajax" method='post'>
|
||||
<div class='main-header'>
|
||||
<div class='heading'>
|
||||
<strong><?php echo $lang->$moduleName->common?></strong>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='side-col' id='sidebar'></div>
|
||||
<div class='main-col main-content'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<form class="load-indicator main-form form-ajax" method='post'>
|
||||
<div class='main-header'>
|
||||
<div class='heading'>
|
||||
<strong><?php echo $lang->custom->score?></strong>
|
||||
@@ -25,7 +25,7 @@
|
||||
<td>
|
||||
<?php $checkedKey = isset($config->global->scoreStatus) ? $config->global->scoreStatus : 0;?>
|
||||
<?php foreach($lang->custom->scoreStatus as $key => $value):?>
|
||||
<p><label class="radio-inline"><input type="radio" name="flow" value="<?php echo $key?>"<?php echo $key == $checkedKey ? " checked='checked'" : ''?> id="flow<?php echo $key;?>"><?php echo $value;?></label></p>
|
||||
<p><label class="radio-inline"><input type="radio" name="score" value="<?php echo $key?>"<?php echo $key == $checkedKey ? " checked='checked'" : ''?> id="score<?php echo $key;?>"><?php echo $value;?></label></p>
|
||||
<?php endforeach;?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -45,7 +45,7 @@ EOT;
|
||||
</div>
|
||||
</div>
|
||||
<div class='main-col main-content'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<form class="load-indicator main-form form-ajax" method='post'>
|
||||
<div class='main-header'>
|
||||
<div class='heading'>
|
||||
<strong><?php echo $lang->custom->object[$module] . $lang->arrow . $lang->custom->$module->fields[$field]?></strong>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='side-col' id='sidebar'></div>
|
||||
<div class='main-col main-content'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<form class="load-indicator main-form form-ajax" method='post'>
|
||||
<div class='main-header'>
|
||||
<div class='heading'>
|
||||
<strong><?php echo $lang->custom->working?></strong>
|
||||
|
||||
Reference in New Issue
Block a user