diff --git a/module/execution/js/common.js b/module/execution/js/common.js index 70b25619db..1ede120620 100644 --- a/module/execution/js/common.js +++ b/module/execution/js/common.js @@ -63,9 +63,7 @@ function computeWorkDays(currentID) isBactchEdit = false; if(currentID) { - index = currentID.replace('begins[', ''); - index = index.replace('ends[', ''); - index = index.replace(']', ''); + index = currentID.replace(/\w*\[|\]/g, ''); if(!isNaN(index)) isBactchEdit = true; } diff --git a/module/execution/lang/de.php b/module/execution/lang/de.php index d7c4b8a112..853272afe3 100644 --- a/module/execution/lang/de.php +++ b/module/execution/lang/de.php @@ -387,8 +387,8 @@ $lang->execution->errorSameProducts = "{$lang->executionCommon} Kann n $lang->execution->errorSameBranches = "{$lang->executionCommon} cannot be linked to the same branch twice"; $lang->execution->errorBegin = "The start time of {$lang->executionCommon} cannot be less than the start time of the project %s."; $lang->execution->errorEnd = "The end time of {$lang->executionCommon} cannot be greater than the end time %s of the project."; -$lang->execution->errorLetterProject = "The start time of stage cannot be less than the start time of the project %s."; -$lang->execution->errorGreaterProject = "The end time of stage cannot be greater than the end time %s of the project."; +$lang->execution->errorLetterProject = "The start time of {$lang->executionCommon} cannot be less than the start time of the project %s."; +$lang->execution->errorGreaterProject = "The end time of {$lang->executionCommon} cannot be greater than the end time %s of the project."; $lang->execution->errorCommonBegin = 'The start date of ' . $lang->executionCommon . ' should be ≥ the start date of project : %s.'; $lang->execution->errorCommonEnd = 'The deadline of ' . $lang->executionCommon . ' should be ≤ the deadline of project : %s.'; $lang->execution->accessDenied = "Zugriff zu {$lang->executionCommon} verweigert!"; diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index f9adc1fed0..1a5bb94f77 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -387,8 +387,8 @@ $lang->execution->errorSameProducts = "{$lang->executionCommon} cannot $lang->execution->errorSameBranches = "{$lang->executionCommon} cannot be linked to the same branch twice"; $lang->execution->errorBegin = "The start time of {$lang->executionCommon} cannot be less than the start time of the project %s."; $lang->execution->errorEnd = "The end time of {$lang->executionCommon} cannot be greater than the end time %s of the project."; -$lang->execution->errorLetterProject = "The start time of stage cannot be less than the start time of the project %s."; -$lang->execution->errorGreaterProject = "The end time of stage cannot be greater than the end time %s of the project."; +$lang->execution->errorLetterProject = "The start time of {$lang->executionCommon} cannot be less than the start time of the project %s."; +$lang->execution->errorGreaterProject = "The end time of {$lang->executionCommon} cannot be greater than the end time %s of the project."; $lang->execution->errorCommonBegin = 'The start date of ' . $lang->executionCommon . ' should be ≥ the start date of project : %s.'; $lang->execution->errorCommonEnd = 'The deadline of ' . $lang->executionCommon . ' should be ≤ the deadline of project : %s.'; $lang->execution->accessDenied = "Your access to {$lang->executionCommon} is denied!"; diff --git a/module/execution/lang/fr.php b/module/execution/lang/fr.php index bae0166bcd..068d55bd72 100644 --- a/module/execution/lang/fr.php +++ b/module/execution/lang/fr.php @@ -387,8 +387,8 @@ $lang->execution->errorSameProducts = "Ce {$lang->executionCommon} ne $lang->execution->errorSameBranches = "{$lang->executionCommon} cannot be linked to the same branch twice"; $lang->execution->errorBegin = "The start time of {$lang->executionCommon} cannot be less than the start time of the project %s."; $lang->execution->errorEnd = "The end time of {$lang->executionCommon} cannot be greater than the end time %s of the project."; -$lang->execution->errorLetterProject = "The start time of stage cannot be less than the start time of the project %s."; -$lang->execution->errorGreaterProject = "The end time of stage cannot be greater than the end time %s of the project."; +$lang->execution->errorLetterProject = "The start time of {$lang->executionCommon} cannot be less than the start time of the project %s."; +$lang->execution->errorGreaterProject = "The end time of {$lang->executionCommon} cannot be greater than the end time %s of the project."; $lang->execution->errorCommonBegin = 'The start date of ' . $lang->executionCommon . ' should be ≥ the start date of project : %s.'; $lang->execution->errorCommonEnd = 'The deadline of ' . $lang->executionCommon . ' should be ≤ the deadline of project : %s.'; $lang->execution->accessDenied = "Votre accès au {$lang->executionCommon} est refusé ! Désolé."; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 9b308c85be..87c8b9fac9 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -387,8 +387,8 @@ $lang->execution->errorSameProducts = "{$lang->executionCommon}不能 $lang->execution->errorSameBranches = "{$lang->executionCommon}不能关联多个相同的分支。"; $lang->execution->errorBegin = "{$lang->executionCommon}的开始时间不能小于所属项目的开始时间%s。"; $lang->execution->errorEnd = "{$lang->executionCommon}的截止时间不能大于所属项目的结束时间%s。"; -$lang->execution->errorLetterProject = "阶段的计划开始时间不能小于所属项目的计划开始时间%s。"; -$lang->execution->errorGreaterProject = "阶段的计划完成时间不能大于所属项目的计划完成时间%s。"; +$lang->execution->errorLetterProject = "{$lang->executionCommon}的计划开始时间不能小于所属项目的计划开始时间%s。"; +$lang->execution->errorGreaterProject = "{$lang->executionCommon}的计划完成时间不能大于所属项目的计划完成时间%s。"; $lang->execution->errorCommonBegin = $lang->executionCommon . '开始日期应大于等于项目的开始日期:%s。'; $lang->execution->errorCommonEnd = $lang->executionCommon . '截止日期应小于等于项目的截止日期:%s。'; $lang->execution->accessDenied = "您无权访问该{$lang->executionCommon}!"; diff --git a/module/execution/view/batchedit.html.php b/module/execution/view/batchedit.html.php index b132bc9fbe..00dd365a63 100755 --- a/module/execution/view/batchedit.html.php +++ b/module/execution/view/batchedit.html.php @@ -85,7 +85,7 @@ systemMode == 'new' and isset($project) and $project->model == 'scrum'):?> project, "class='form-control picker-select' data-lastselected='{$executions[$executionID]->project}' onchange='changeProject(this, $executionID, {$executions[$executionID]->project})'");?> - name, "id='names{$executionID}' class='form-control'");?> + name, "class='form-control'");?> setCode) or $config->setCode == 1):?> code, "class='form-control'");?> @@ -106,8 +106,8 @@ ?> '>execution->statusList, $executions[$executionID]->status, 'class=form-control');?> - begin, "id='begins{$executionID}' class='form-control form-date' onchange='computeWorkDays(this.id)'");?> - end, "id='ends{$executionID}' class='form-control form-date' onchange='computeWorkDays(this.id)'");?> + begin, "class='form-control form-date' onchange='computeWorkDays(this.id)'");?> + end, "class='form-control form-date' onchange='computeWorkDays(this.id)'");?> '> desc, "rows='1' class='form-control autosize'");?> '>team, "class='form-control'");?> '> @@ -154,26 +154,22 @@ $('#executionForm').submit(function() /* Clear all error messages. */ $('input[name^=begins]').each(function() { - var beginDateID = $(this).attr('id'); - var endDateID = beginDateID.replace('begins', 'ends'); - $('#help' + beginDateID).remove(); - $('#help' + endDateID).remove(); + var executionID = $(this).attr('id').replace(/\w*\[|\]/g, ''); + $('#helpbegins' + executionID).remove(); + $('#helpends' + executionID).remove(); }); var submitForm = true; $('input[name^=begins]').each(function() { var beginDate = $(this).val(); - var beginDateID = $(this).attr('id'); + var executionID = $(this).attr('id').replace(/\w*\[|\]/g, ''); - var nameID = beginDateID.replace('begins', 'names'); - var endDateID = beginDateID.replace('begins', 'ends'); - var executionID = beginDateID.replace('begins', ''); - $('#help' + beginDateID).remove(); - $('#help' + endDateID).remove(); + $('#helpbegins' + executionID).remove(); + $('#helpends' + executionID).remove(); /* Invalid data is skipped. */ - var nameVal = $('#' + nameID).val() + var nameVal = $("[name='names[" + executionID + "]']").val() if(!nameVal) return; var projectBeginDate = '0000-00-00'; @@ -199,18 +195,18 @@ $('#executionForm').submit(function() if(!beginDate) { submitForm = false; - var emptyBeginHtml = '
' + emptyBegin + '
'; + var emptyBeginHtml = '
' + emptyBegin + '
'; $(this).after(emptyBeginHtml); alert(emptyBegin); return false; } - var endDate = $('#' + endDateID).val(); + var endDate = $("[name='ends[" + executionID + "]']").val(); if(!endDate) { submitForm = false; - var emptyEndHtml = '
' + emptyEnd + '
'; - $('#' + endDateID).after(emptyEndHtml); + var emptyEndHtml = '
' + emptyEnd + '
'; + $("[name='ends[" + executionID + "]']").after(emptyEndHtml); alert(emptyEnd); return false; } @@ -218,8 +214,8 @@ $('#executionForm').submit(function() if(endDate < beginDate) { submitForm = false; - var emptyEndHtml = '
' + planFinishSmall + '
'; - $('#' + endDateID).after(emptyEndHtml); + var emptyEndHtml = '
' + planFinishSmall + '
'; + $("[name='ends[" + executionID + "]']").after(emptyEndHtml); alert(planFinishSmall); return false; } @@ -228,8 +224,8 @@ $('#executionForm').submit(function() { submitForm = false; var errorBeginTip = errorBegin.replace('%s', projectBeginDate); - var errorBeginHtml = '
' + errorBeginTip + '
'; - $('#' + beginDateID).after(errorBeginHtml); + var errorBeginHtml = '
' + errorBeginTip + '
'; + $("[name='begins[" + executionID + "]']").after(errorBeginHtml); alert(errorBeginTip); return false; } @@ -238,8 +234,8 @@ $('#executionForm').submit(function() { submitForm = false; var errorEndTip = errorEnd.replace('%s', projectEndDate); - var errorEndHtml = '
' + errorEndTip + '
'; - $('#' + endDateID).after(errorEndHtml); + var errorEndHtml = '
' + errorEndTip + '
'; + $("[name='ends[" + executionID + "]']").after(errorEndHtml); alert(errorEndTip); return false; }