diff --git a/module/action/model.php b/module/action/model.php index d182353308..ac1f99b42a 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -396,7 +396,7 @@ class actionModel extends model } elseif(($actionName == 'opened' or $actionName == 'managed' or $actionName == 'edited') and ($objectType == 'execution' || $objectType == 'project')) { - $this->app->loadLang('executon'); + $this->app->loadLang('execution'); $linkedProducts = $this->dao->select('id,name')->from(TABLE_PRODUCT)->where('id')->in($action->extra)->fetchPairs('id', 'name'); $action->extra = ''; if($linkedProducts) diff --git a/module/extension/control.php b/module/extension/control.php index 8086d2aad8..3d7e51b94e 100644 --- a/module/extension/control.php +++ b/module/extension/control.php @@ -162,7 +162,7 @@ class extension extends control /* Checking the extension pathes. */ $return = $this->extension->checkExtensionPathes($extension); - if($this->session->dirs2Created == false) $this->session->set('dirs2Created', $return->dirs2Created); // Save the dirs to be created. + if($this->session->dirs2Created == false) $this->session->set('dirs2Created', $return->dirs2Created, 'admin'); // Save the dirs to be created. if($return->result != 'ok') { $this->view->error = $return->errors; @@ -302,7 +302,7 @@ class extension extends control $data->dirs = $this->session->dirs2Created; $data->files = $this->view->files; $data->installedTime = helper::now(); - $this->session->set('dirs2Created', array()); // clean the session. + $this->session->set('dirs2Created', array(), 'admin'); // clean the session. /* Execute the install.sql. */ if($upgrade == 'no' and $this->extension->needExecuteDB($extension, 'install')) diff --git a/module/my/control.php b/module/my/control.php index 4892da56aa..164bc3237e 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -515,7 +515,7 @@ class my extends control $this->app->loadLang('project'); $this->app->session->set('programList', $this->app->getURI(true), 'program'); - $this->app->session->set('projectBrowse', $this->app->getURI(true), 'project'); + $this->app->session->set('projectList', $this->app->getURI(true), 'project'); /* Set the pager. */ $this->app->loadClass('pager', $static = true); diff --git a/module/my/css/project.css b/module/my/css/project.css index 27e3b8117d..16862f86fc 100644 --- a/module/my/css/project.css +++ b/module/my/css/project.css @@ -1,3 +1,3 @@ -#programTableList > tr.drop-not-allowed {opacity: 0.1 !important;} -#programList .c-actions {overflow: visible;} -#programTableList > tr:last-child .c-actions .dropdown-menu {top: auto; bottom: 100%; margin-bottom: -5px;} +#projectTableList > tr.drop-not-allowed {opacity: 0.1 !important;} +#projectList .c-actions {overflow: visible;} +#projectTableList > tr:last-child .c-actions .dropdown-menu {top: auto; bottom: 100%; margin-bottom: -5px;} diff --git a/module/personnel/control.php b/module/personnel/control.php index 2cd479b6ed..0da871438b 100644 --- a/module/personnel/control.php +++ b/module/personnel/control.php @@ -116,7 +116,7 @@ class personnel extends control $pager = pager::init($recTotal, $recPerPage, $pageID); /* Set back link. */ - $goback = $this->session->projectBrowse ? $this->session->projectBrowse : $this->createLink('program', 'whitelist', "projectID=$objectID"); + $goback = $this->session->projectList ? $this->session->projectList : $this->createLink('program', 'whitelist', "projectID=$objectID"); if($from == 'program') $goback = $this->createLink('program', 'browse'); if($from == 'programproject') $goback = $this->session->programProject ? $this->session->programProject : $this->createLink('program', 'project', "programID=$programID"); diff --git a/module/product/control.php b/module/product/control.php index b5e89ef6b1..f19dad53df 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -1019,8 +1019,6 @@ class product extends control */ public function all($browseType = 'noclosed', $orderBy = 'program_asc') { - if($this->session->moreProductLink) $this->lang->product->mainMenuAction = html::a($this->session->moreProductLink, ' ' . $this->lang->goback, '', "class='btn btn-link'"); - /* Load module and set session. */ $this->loadModel('program'); $this->session->set('productList', $this->app->getURI(true)); diff --git a/module/program/control.php b/module/program/control.php index 9e515e8d08..78fb4f8f60 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -43,11 +43,10 @@ class program extends control */ public function browse($status = 'all', $orderBy = 'order_asc') { - $this->lang->program->mainMenuAction = html::a('javascript:history.go(-1);', ' ' . $this->lang->goback, '', "class='btn btn-link'"); - if(common::hasPriv('program', 'create')) $this->lang->pageActions = html::a($this->createLink('program', 'create'), " " . $this->lang->program->create, '', "class='btn btn-secondary'"); - $this->session->set('programList', $this->app->getURI(true)); + $this->session->set('programList', $this->app->getURI(true), 'program'); + $this->session->set('projectList', $this->app->getURI(true), 'project'); $programType = $this->cookie->programType ? $this->cookie->programType : 'bylist'; diff --git a/module/project/control.php b/module/project/control.php index 4db998a531..46337e4e7c 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -10,14 +10,6 @@ */ class project extends control { - public function __construct($moduleName = '', $methodName = '') - { - parent::__construct($moduleName, $methodName); - $this->loadModel('program'); - $this->loadModel('execution'); - $this->loadModel('group'); - } - /** * Project create guide. * @@ -206,10 +198,9 @@ class project extends control */ public function browse($programID = 0, $browseType = 'doing', $param = 0, $orderBy = 'order_asc', $recTotal = 0, $recPerPage = 15, $pageID = 1) { - if($this->session->moreProjectLink) $this->lang->project->mainMenuAction = html::a($this->session->moreProjectLink, ' ' . $this->lang->goback, '', "class='btn btn-link'"); - $this->app->session->set('projectBrowse', $this->app->getURI(true)); $this->loadModel('datatable'); - $this->session->set('projectList', $this->app->getURI(true)); + $this->loadModel('execution'); + $this->session->set('projectList', $this->app->getURI(true), 'project'); /* Load pager and get tasks. */ $this->app->loadClass('pager', $static = true); @@ -217,7 +208,7 @@ class project extends control $queryID = ($browseType == 'bysearch') ? (int)$param : 0; $projectTitle = $this->loadModel('setting')->getItem('owner=' . $this->app->user->account . '&module=project&key=projectTitle'); - $projectStats = $this->program->getProjectStats($programID, $browseType, $queryID, $orderBy, $pager, $projectTitle); + $projectStats = $this->loadModel('program')->getProjectStats($programID, $browseType, $queryID, $orderBy, $pager, $projectTitle); $this->view->title = $this->lang->project->browse; $this->view->position[] = $this->lang->project->browse; @@ -267,6 +258,8 @@ class project extends control */ public function create($model = 'waterfall', $programID = 0, $copyProjectID = 0) { + $this->loadModel('execution'); + if($_POST) { $projectID = $this->project->create(); @@ -361,13 +354,16 @@ class project extends control */ public function edit($projectID = 0, $from = 'project') { - $this->app->loadLang('custom'); - $this->app->loadLang('project'); - $this->loadModel('productplan'); $this->loadModel('action'); + $this->loadModel('custom'); + $this->loadModel('productplan'); + $this->loadModel('user'); + $this->loadModel('program'); + $this->loadModel('execution'); $project = $this->project->getByID($projectID); $programID = $project->parent; + $this->project->setMenu($projectID); if($_POST) { @@ -380,13 +376,12 @@ class project extends control $this->action->logHistory($actionID, $changes); } - $locateLink = $this->session->projectBrowse ? $this->session->projectBrowse : inLink('view', "projectID=$projectID"); - if($from == 'program') $locateLink = $this->createLink('program', 'browse'); + $locateLink = $this->session->projectList ? $this->session->projectList : inLink('view', "projectID=$projectID"); + if($from == 'program') $locateLink = $this->createLink('program', 'browse'); if($from == 'programProject') $locateLink = $this->session->programProject ? $this->session->programProject : $this->createLink('program', 'project', "projectID=$projectID"); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locateLink)); } - $linkedBranches = array(); $productPlans = array(0 => ''); $allProducts = $this->program->getProductPairs($project->parent, 'assign', 'noclosed'); @@ -415,7 +410,7 @@ class project extends control $this->view->title = $this->lang->project->edit; $this->view->position[] = $this->lang->project->edit; - $this->view->PMUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $project->PM); + $this->view->PMUsers = $this->user->getPairs('noclosed|nodeleted|pmfirst', $project->PM); $this->view->users = $this->user->getPairs('noclosed|nodeleted'); $this->view->project = $project; $this->view->programList = $this->program->getParentPairs(); @@ -425,10 +420,10 @@ class project extends control $this->view->linkedProducts = $linkedProducts; $this->view->unmodifiableProducts = $unmodifiableProducts; $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($linkedProducts), '', $linkedBranches); - $this->view->URSRPairs = $this->loadModel('custom')->getURSRPairs(); + $this->view->URSRPairs = $this->custom->getURSRPairs(); $this->view->from = $from; $this->view->parentProject = $parentProject; - $this->view->parentProgram = $this->loadModel('program')->getByID($project->parent); + $this->view->parentProgram = $this->program->getByID($project->parent); $this->view->availableBudget = $this->program->getBudgetLeft($parentProject) + (float)$project->budget; $this->view->budgetUnitList = $this->project->getBudgetUnitList(); @@ -446,6 +441,7 @@ class project extends control public function batchEdit($from = 'browse', $projectID = 0) { $this->loadModel('action'); + $this->loadModel('execution'); if($this->post->names) { @@ -493,7 +489,7 @@ class project extends control $this->project->setMenu($projectID); - $this->app->session->set('projectBrowse', $this->app->getURI(true)); + $this->app->session->set('projectList', $this->app->getURI(true)); $products = $this->loadModel('product')->getProducts($projectID); $linkedBranches = array(); @@ -984,6 +980,10 @@ class project extends control */ public function manageMembers($projectID, $dept = '') { + /* Load model. */ + $this->loadModel('user'); + $this->loadModel('dept'); + $this->loadModel('execution'); $this->project->setMenu($projectID); if(!empty($_POST)) @@ -993,10 +993,6 @@ class project extends control $this->send(array('message' => $this->lang->saveSuccess, 'result' => 'success', 'locate' => $link)); } - /* Load model. */ - $this->loadModel('user'); - $this->loadModel('dept'); - $project = $this->project->getById($projectID); $users = $this->user->getPairs('noclosed|nodeleted|devfirst|nofeedback'); $roles = $this->user->getUserRoles(array_keys($users)); @@ -1389,6 +1385,9 @@ class project extends control */ public function manageProducts($projectID, $programID = 0, $from = 'project') { + $this->loadModel('product'); + $this->loadModel('program'); + if(!empty($_POST)) { if(!isset($_POST['products'])) @@ -1413,8 +1412,6 @@ class project extends control $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locateLink)); } - $this->loadModel('product'); - $project = $this->project->getById($projectID); if($this->app->openApp == 'program') { diff --git a/module/project/lang/de.php b/module/project/lang/de.php index 8fd6ee210d..c54215f0a2 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -45,6 +45,8 @@ $lang->project->errorSameProducts = 'Project cannot be associated with multiple $lang->project->errorNoProducts = 'At least one product is associated'; $lang->project->copyNoProject = 'There are no items available to copy.'; $lang->project->searchByName = 'Enter the project name to search'; +$lang->project->linkedProducts = "Linked {$lang->productCommon}s"; +$lang->project->unlinkedProducts = "Unlinked {$lang->productCommon}s"; /* Fields. */ $lang->project->common = 'Program'; diff --git a/module/project/lang/en.php b/module/project/lang/en.php index af784d8ae2..5f8178025b 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -45,6 +45,8 @@ $lang->project->errorSameProducts = 'Project cannot be associated with multiple $lang->project->errorNoProducts = 'At least one product is associated'; $lang->project->copyNoProject = 'There are no items available to copy.'; $lang->project->searchByName = 'Enter the project name to retrieve'; +$lang->project->linkedProducts = "Linked {$lang->productCommon}s"; +$lang->project->unlinkedProducts = "Unlinked {$lang->productCommon}s"; /* Fields. */ $lang->project->common = 'Project'; diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index 927c1126f7..6c7a1a16a1 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -45,6 +45,8 @@ $lang->project->errorSameProducts = 'Project cannot be associated with multiple $lang->project->errorNoProducts = 'At least one product is associated'; $lang->project->copyNoProject = 'There are no items available to copy.'; $lang->project->searchByName = 'Enter the project name to retrieve'; +$lang->project->linkedProducts = "Linked {$lang->productCommon}s"; +$lang->project->unlinkedProducts = "Unlinked {$lang->productCommon}s"; /* Fields. */ $lang->project->common = 'Project'; diff --git a/module/project/lang/vi.php b/module/project/lang/vi.php index 25308caf44..9f24fc95c8 100644 --- a/module/project/lang/vi.php +++ b/module/project/lang/vi.php @@ -45,6 +45,8 @@ $lang->project->errorSameProducts = 'Project cannot be associated with multiple $lang->project->errorNoProducts = 'At least one product is associated'; $lang->project->copyNoProject = 'There are no items available to copy.'; $lang->project->searchByName = 'Enter the project name to retrieve'; +$lang->project->linkedProducts = "Linked {$lang->productCommon}s"; +$lang->project->unlinkedProducts = "Unlinked {$lang->productCommon}s"; /* Fields. */ $lang->project->common = 'Project'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index fbea88e264..b77aeb2b53 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -46,6 +46,8 @@ $lang->project->errorNoProducts = '最少关联一个产品'; $lang->project->copyNoProject = '没有可用的项目来复制'; $lang->project->searchByName = '输入项目名称进行检索'; $lang->project->deleted = '已删除'; +$lang->project->linkedProducts = '已关联'; +$lang->project->unlinkedProducts = '未关联'; /* Fields. */ $lang->project->common = '项目'; diff --git a/module/project/model.php b/module/project/model.php index d4a91117eb..1f689e5572 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -138,7 +138,6 @@ class projectModel extends model public function getSwitcher($projectID, $currentModule, $currentMethod) { if($currentModule == 'project' and $currentMethod == 'browse') return; - $this->session->set('moreProjectLink', $this->app->getURI(true)); $currentProjectName = $this->lang->project->common; if($projectID) diff --git a/module/project/view/edit.html.php b/module/project/view/edit.html.php index 3c73615844..92e42275fc 100644 --- a/module/project/view/edit.html.php +++ b/module/project/view/edit.html.php @@ -160,7 +160,8 @@ model); echo html::submitButton(); - echo html::backButton(); + $browseLink = $this->session->projectList ? $this->session->projectList : $this->createLink('project', 'browse'); + echo html::a($browseLink, $lang->goback, '', 'class="btn btn-back btn-wide"'); ?> diff --git a/module/project/view/manageproducts.html.php b/module/project/view/manageproducts.html.php index 6714dfcf68..d55f9ac8df 100644 --- a/module/project/view/manageproducts.html.php +++ b/module/project/view/manageproducts.html.php @@ -20,7 +20,7 @@
-
execution->linkedProducts;?>
+
project->linkedProducts;?>
$productName):?> @@ -43,7 +43,7 @@
-
execution->unlinkedProducts;?>
+
project->unlinkedProducts;?>
$productName):?>