Merge branch 'zentaopms_252'

This commit is contained in:
wangyidong
2022-11-08 09:23:23 +08:00
47 changed files with 453 additions and 90 deletions
+42 -21
View File
@@ -66,23 +66,19 @@ class programplan extends control
$products = $this->loadModel('product')->getProducts($projectID);
if($this->session->hasProduct) $this->lang->modulePageNav = $this->product->select($products, $this->productID, 'programplan', 'browse', $type, 0, 0, '', false);
$this->lang->TRActions = "<button class='btn btn-link' data-toggle='dropdown'><i class='icon icon-export muted'></i> <span class='text'>" . $this->lang->export . "</span> <span class='caret'></span></button>";
$this->lang->TRActions .= "<ul class='dropdown-menu' id='exportActionMenu'>";
$this->lang->TRActions .= "<li><a href='javascript:exportGantt()'>" . $this->lang->execution->gantt->exportImg . "</a></li>";
$this->lang->TRActions .= "<li><a href='javascript:exportGantt(" . '"pdf"' . ")'>" . $this->lang->execution->gantt->exportPDF . "</a></li>";
$this->lang->TRActions .= "</ul>";
if(common::hasPriv('programplan', 'create')) $this->lang->TRActions .= html::a($this->createLink('programplan', 'create', "projectID=$projectID"), "<i class='icon icon-sm icon-plus'></i> " . $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')
{
$this->loadModel('setting');
$owner = $this->app->user->account;
$module = 'programplan';
$section = 'browse';
$object = 'stageCustom';
$selectCustom = $this->loadModel('setting')->getItem("owner={$owner}&module={$module}&section={$section}&key={$object}");
if(!isset($this->config->programplan->browse->stageCustom)) $this->setting->setItem("$owner.$module.browse.stageCustom", 'date,task');
$selectCustom = $this->setting->getItem("owner={$owner}&module={$module}&section={$section}&key={$object}");
if(strpos($selectCustom, 'date') !== false) $dateDetails = 0;
$plans = $this->programplan->getDataForGantt($projectID, $this->productID, $baselineID, $selectCustom, false);
@@ -117,16 +113,20 @@ class programplan extends control
$plans = $this->programplan->getPlans($projectID, $this->productID, $sort);
}
$zooming = !empty($this->config->programplan->ganttCustom->zooming) ? $this->config->programplan->ganttCustom->zooming : 'day';
$this->view->title = $this->lang->programplan->browse;
$this->view->position[] = $this->lang->programplan->browse;
$this->view->projectID = $projectID;
$this->view->project = $this->project->getByID($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;
$this->view->selectCustom = $selectCustom;
$this->view->dateDetails = $dateDetails;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->zooming = $zooming;
$this->view->ganttType = $type;
$this->display();
}
@@ -248,19 +248,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&section=browse&key=stageCustom");
$ganttFields = $this->setting->getItem("owner=$owner&module=$module&section=ganttCustom&key=ganttFields");
$zooming = $this->setting->getItem("owner=$owner&module=$module&section=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();
}
/**