+
+
+diff --git a/module/programplan/control.php b/module/programplan/control.php index 2c66ab4dfa..efb2988be9 100644 --- a/module/programplan/control.php +++ b/module/programplan/control.php @@ -64,14 +64,6 @@ class programplan extends control $products = $this->loadModel('product')->getProducts($projectID); $this->lang->modulePageNav = $this->product->select($products, $this->productID, 'programplan', 'browse', $type, 0, 0, '', false); - $this->lang->TRActions = ""; - $this->lang->TRActions .= "
"; - - if(common::hasPriv('programplan', 'create')) $this->lang->TRActions .= html::a($this->createLink('programplan', 'create', "projectID=$projectID"), " " . $this->lang->programplan->create, '', "class='btn btn-primary'"); - $selectCustom = 0; // Display date and task settings. $dateDetails = 1; // Gantt chart detail date display. if($type == 'gantt') @@ -119,6 +111,7 @@ class programplan extends control $this->view->position[] = $this->lang->programplan->browse; $this->view->projectID = $projectID; $this->view->productID = $this->productID; + $this->view->productList = $this->loadModel('product')->getProductPairsByProject($projectID); $this->view->type = $type; $this->view->plans = $plans; $this->view->orderBy = $orderBy; @@ -245,19 +238,40 @@ class programplan extends control */ public function ajaxCustom() { - $data = fixer::input('post')->get(); - $owner = $this->app->user->account; - $module = 'programplan'; - $section = 'browse'; - $object = 'stageCustom'; - $setting = $this->loadModel('setting'); - $custom = empty($data->stageCustom) ? '' : implode(',', $data->stageCustom); - $setting->setItem("$owner.$module.$section.$object", $custom); + $owner = $this->app->user->account; + $module = 'programplan'; + $this->app->loadLang('execution'); + $this->loadModel('datatable'); + $this->loadModel('setting'); - $response = array(); - $response['result'] = 'success'; - $response['message'] = ''; - return $this->send($response); + $stageCustom = $this->setting->getItem("owner=$owner&module=$module§ion=browse&key=stageCustom"); + $ganttFields = $this->setting->getItem("owner=$owner&module=$module§ion=ganttCustom&key=ganttFields"); + $zooming = $this->setting->getItem("owner=$owner&module=$module§ion=ganttCustom&key=zooming"); + + if($_POST) + { + $data = fixer::input('post')->get(); + $zooming = empty($data->zooming) ? '' : $data->zooming; + $stageCustom = empty($data->stageCustom) ? '' : implode(',', $data->stageCustom); + $ganttFields = empty($data->ganttFields) ? '' : implode(',', $data->ganttFields); + + $this->setting->setItem("$owner.$module.browse.stageCustom", $stageCustom); + $this->setting->setItem("$owner.$module.ganttCustom.ganttFields", $ganttFields); + $this->setting->setItem("$owner.$module.ganttCustom.zooming", $zooming); + + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); + } + + /* Set Custom. */ + foreach(explode(',', $this->config->programplan->custom->customGanttFields) as $field) $customFields[$field] = $this->lang->programplan->ganttCustom[$field]; + + $this->view->zooming = $zooming; + $this->view->customFields = $customFields; + $this->view->showFields = $this->config->programplan->ganttCustom->ganttFields; + $this->view->ganttFields = $ganttFields; + $this->view->stageCustom = $stageCustom; + + $this->display(); } /** diff --git a/module/programplan/lang/de.php b/module/programplan/lang/de.php index 889b03bcaa..a186daf4c5 100644 --- a/module/programplan/lang/de.php +++ b/module/programplan/lang/de.php @@ -62,6 +62,8 @@ $lang->programplan->hideCriticalPath = 'Hide Critical Path'; $lang->programplan->showCriticalPath = 'Show Critical Path'; $lang->programplan->delay = 'Delay'; $lang->programplan->delayDays = 'Delay days'; +$lang->programplan->settingGantt = 'Gantt Setting'; +$lang->programplan->viewSetting = 'Setting'; $lang->programplan->errorBegin = "Project begin date: %s, begin date should be >= project begin date."; $lang->programplan->errorEnd = "Project end date: %s, end date should be <= project end date."; diff --git a/module/programplan/lang/en.php b/module/programplan/lang/en.php index 6ed9867b61..b2084c75f4 100644 --- a/module/programplan/lang/en.php +++ b/module/programplan/lang/en.php @@ -62,6 +62,8 @@ $lang->programplan->hideCriticalPath = 'Hide Critical Path'; $lang->programplan->showCriticalPath = 'Show Critical Path'; $lang->programplan->delay = 'Delay'; $lang->programplan->delayDays = 'Delay days'; +$lang->programplan->settingGantt = 'Gantt Setting'; +$lang->programplan->viewSetting = 'Setting'; $lang->programplan->errorBegin = "Project begin date: %s, begin date should be >= project begin date."; $lang->programplan->errorEnd = "Project end date: %s, end date should be <= project end date."; diff --git a/module/programplan/lang/fr.php b/module/programplan/lang/fr.php index 889b03bcaa..a186daf4c5 100644 --- a/module/programplan/lang/fr.php +++ b/module/programplan/lang/fr.php @@ -62,6 +62,8 @@ $lang->programplan->hideCriticalPath = 'Hide Critical Path'; $lang->programplan->showCriticalPath = 'Show Critical Path'; $lang->programplan->delay = 'Delay'; $lang->programplan->delayDays = 'Delay days'; +$lang->programplan->settingGantt = 'Gantt Setting'; +$lang->programplan->viewSetting = 'Setting'; $lang->programplan->errorBegin = "Project begin date: %s, begin date should be >= project begin date."; $lang->programplan->errorEnd = "Project end date: %s, end date should be <= project end date."; diff --git a/module/programplan/lang/zh-cn.php b/module/programplan/lang/zh-cn.php index 1e4fdfbacd..b3f4b04429 100644 --- a/module/programplan/lang/zh-cn.php +++ b/module/programplan/lang/zh-cn.php @@ -62,6 +62,8 @@ $lang->programplan->hideCriticalPath = '隐藏关键路径'; $lang->programplan->showCriticalPath = '显示关键路径'; $lang->programplan->delay = '是否延期'; $lang->programplan->delayDays = '延期天数'; +$lang->programplan->settingGantt = '设置甘特图'; +$lang->programplan->viewSetting = '显示设置'; $lang->programplan->errorBegin = '阶段的开始时间不能小于所属项目的开始时间%s'; $lang->programplan->errorEnd = '阶段的结束时间不能大于所属项目的结束时间%s'; diff --git a/module/programplan/view/ajaxcustom.html.php b/module/programplan/view/ajaxcustom.html.php new file mode 100644 index 0000000000..dd0e8c015c --- /dev/null +++ b/module/programplan/view/ajaxcustom.html.php @@ -0,0 +1,44 @@ + + * @package programplan + * @version $Id: ajaxcustom.html.php 935 2022-10-25 16:15:24Z $ + * @link https://www.zentao.net + */ +?> + + + +