* Fix programplan::create error.

This commit is contained in:
tanghucheng
2024-04-02 14:14:19 +08:00
parent 07bb538bfa
commit eb286f7eb5
3 changed files with 4 additions and 1 deletions
+2
View File
@@ -5,6 +5,8 @@ window.onRenderRow = function(row, rowIdx, data)
if(project.model == 'ipd')
{
$('thead [data-name="ACTIONS"]').css('display', 'none');
row.find('[data-name="ACTIONS"]').css('display', 'none');
row.find('[data-name="attribute"]').find('.picker-box').on('inited', function(e, info)
{
let $attributePicker = info[0];
-1
View File
@@ -259,5 +259,4 @@ formBatchPanel
set::items($fnGenerateFields()),
set::data($fnGenerateDefaultData()),
$project->model == 'ipd' ? set::maxRows(count($fnGenerateDefaultData())) : null,
$project->model == 'ipd' ? set::mode('edit') : null
);
+2
View File
@@ -48,6 +48,7 @@ class programplanZen extends programplan
{
$project = $this->loadModel('project')->getByID($projectID);
if($parentID) $parentStage = $this->programplan->getByID($parentID);
if(!$parentID) $oldPlans = $this->programplan->getStage($projectID);
$fields = $this->config->programplan->form->create;
foreach(explode(',', $this->config->programplan->create->requiredFields) as $field)
@@ -62,6 +63,7 @@ class programplanZen extends programplan
$orders = $this->programplan->computeOrders(array(), $plans);
foreach($plans as $rowID => $plan)
{
if(empty($parentID) and empty($oldPlans)) $plan->id = '';
$plan->days = helper::diffDate($plan->end, $plan->begin) + 1;
$plan->project = $projectID;
$plan->parent = $parentID ? $parentID : $projectID;