* change for save effort with comment.
This commit is contained in:
+13
-18
@@ -7,7 +7,7 @@ $(function()
|
||||
function replaceExample()
|
||||
{
|
||||
var html = '';
|
||||
var startTask = $('[id*=start').val().split(';');
|
||||
var startTask = $('[id*=start]').val().split(';');
|
||||
var taskModule = $('[id*=module][id*=task]').val().split(';');
|
||||
var idMark = $('[id*=id][id*=mark]').val().split(';');
|
||||
var idSplit = $('[id*=id][id*=split]').val().split(';');
|
||||
@@ -45,9 +45,9 @@ function replaceExample()
|
||||
for(q in cunits)
|
||||
{
|
||||
cunit = cunits[q];
|
||||
for(r in cunits)
|
||||
for(r in lunits)
|
||||
{
|
||||
lunit = lunits[q];
|
||||
lunit = lunits[r];
|
||||
html += '<br />' + rulesExample['task']['start'].replace('%start%', start)
|
||||
.replace('%task%', task)
|
||||
.replace('%id%', id)
|
||||
@@ -69,7 +69,7 @@ function replaceExample()
|
||||
}
|
||||
}
|
||||
|
||||
var finishTask = $('[id*=finish').val().split(';');
|
||||
var finishTask = $('[id*=finish]').val().split(';');
|
||||
for(i in finishTask)
|
||||
{
|
||||
finish = finishTask[i];
|
||||
@@ -91,18 +91,13 @@ function replaceExample()
|
||||
for(o in cunits)
|
||||
{
|
||||
cunit = cunits[o];
|
||||
for(p in cunits)
|
||||
{
|
||||
lunit = lunits[p];
|
||||
html += '<br />' + rulesExample['task']['finish'].replace('%finish%', finish)
|
||||
.replace('%task%', task)
|
||||
.replace('%id%', id)
|
||||
.replace('%split%', split)
|
||||
.replace('%cost%', cost)
|
||||
.replace('%consumedmark%', consumed)
|
||||
.replace('%cunit%', cunit)
|
||||
.replace('%lunit%', lunit);
|
||||
}
|
||||
html += '<br />' + rulesExample['task']['finish'].replace('%finish%', finish)
|
||||
.replace('%task%', task)
|
||||
.replace('%id%', id)
|
||||
.replace('%split%', split)
|
||||
.replace('%cost%', cost)
|
||||
.replace('%consumedmark%', consumed)
|
||||
.replace('%cunit%', cunit);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,7 +106,7 @@ function replaceExample()
|
||||
}
|
||||
}
|
||||
|
||||
var effortTask = $('[id*=logEfforts').val().split(';');
|
||||
var effortTask = $('[id*=logEfforts]').val().split(';');
|
||||
for(i in effortTask)
|
||||
{
|
||||
effort = effortTask[i];
|
||||
@@ -139,7 +134,7 @@ function replaceExample()
|
||||
for(q in cunits)
|
||||
{
|
||||
cunit = cunits[q];
|
||||
for(r in cunits)
|
||||
for(r in lunits)
|
||||
{
|
||||
lunit = lunits[r];
|
||||
html += '<br />' + rulesExample['task']['effort'].replace('%effort%', effort)
|
||||
|
||||
@@ -1278,6 +1278,7 @@ class repoModel extends model
|
||||
$action->objectID = $taskID;
|
||||
$action->product = $productsAndProjects[$taskID]['product'];
|
||||
$action->project = $productsAndProjects[$taskID]['project'];
|
||||
$action->comment = $this->lang->repo->revisionA . ': #' . $action->extra . "<br />" . $action->comment;
|
||||
foreach($taskActions as $taskAction => $params)
|
||||
{
|
||||
$_POST = array();
|
||||
@@ -1298,13 +1299,16 @@ class repoModel extends model
|
||||
}
|
||||
elseif($taskAction == 'effort')
|
||||
{
|
||||
unset($_POST['consumed']);
|
||||
unset($_POST['left']);
|
||||
|
||||
$_POST['id'][1] = 1;
|
||||
$_POST['dates'][1] = date('Y-m-d');
|
||||
$_POST['consumed'][1] = $params['consumed'];
|
||||
$_POST['left'][1] = $params['left'];
|
||||
$_POST['objectType'][1] = 'task';
|
||||
$_POST['objectID'][1] = $taskID;
|
||||
$_POST['work'][1] = $action->comment;
|
||||
$_POST['work'][1] = str_replace('<br />', "\n", $action->comment);
|
||||
if(is_dir($this->app->getModuleRoot() . 'effort'))
|
||||
{
|
||||
$this->loadModel('effort')->batchCreate();
|
||||
@@ -1438,6 +1442,9 @@ class repoModel extends model
|
||||
*/
|
||||
public function saveRecord($action, $changes)
|
||||
{
|
||||
/* Remove sql error. */
|
||||
dao::getError();
|
||||
|
||||
$record = $this->dao->select('*')->from(TABLE_ACTION)
|
||||
->where('objectType')->eq($action->objectType)
|
||||
->andWhere('objectID')->eq($action->objectID)
|
||||
|
||||
Reference in New Issue
Block a user