From bf98e28eb4f0a9aa85de107428f76aa118b4ff02 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Sat, 8 Jul 2023 15:53:17 +0800 Subject: [PATCH] * Adjust for program dropmenu. --- lib/zin/wg/dropmenu/v1.php | 9 +- module/index/config.php | 2 + module/personnel/control.php | 7 +- module/personnel/ui/whitelist.html.php | 4 +- module/product/model.php | 1 + module/program/config/dtable.php | 133 +------------------------ 6 files changed, 18 insertions(+), 138 deletions(-) diff --git a/lib/zin/wg/dropmenu/v1.php b/lib/zin/wg/dropmenu/v1.php index 57f35a65a2..8572f3bb5d 100644 --- a/lib/zin/wg/dropmenu/v1.php +++ b/lib/zin/wg/dropmenu/v1.php @@ -53,10 +53,15 @@ class dropmenu extends wg $app = data('app'); if(empty($tab)) $tab = $app->tab; - if(empty($module)) $module = $app->moduleName; - if(empty($method)) $method = $app->methodName; + if(empty($module)) $module = $app->rawModule; + if(empty($method)) $method = $app->rawMethod; if(empty($extra)) $extra = ''; if(empty($objectID)) $objectID = data($tab . 'ID'); + if(empty($objectID)) + { + $object = data($tab); + if(isset($object->id)) $objectID = $object->id; + } if(empty($url) && empty($data)) $url = createLink($tab, 'ajaxGetDropMenu', "objectID=$objectID&module=$module&method=$method&extra=$extra"); if(empty($text) && !empty($tab)) diff --git a/module/index/config.php b/module/index/config.php index 125241b5e4..90d1bf0f3b 100644 --- a/module/index/config.php +++ b/module/index/config.php @@ -24,6 +24,7 @@ $config->index->appGroup['user'] = 'admin'; $config->index->oldPages = array(); $config->index->oldPages[] = 'my-dynamic'; +$config->index->oldPages[] = 'product-dynamic'; $config->index->oldPages[] = 'product-roadmap'; $config->index->oldPages[] = 'program-kanban'; $config->index->oldPages[] = 'project-kanban'; @@ -66,3 +67,4 @@ $config->index->oldPages[] = 'stage-settype'; $config->index->oldPages[] = 'action-trash'; $config->index->oldPages[] = 'dept-browse'; $config->index->oldPages[] = 'story-report'; +$config->index->oldPages[] = 'tree-browse'; diff --git a/module/personnel/control.php b/module/personnel/control.php index d62b1f4418..0261b91d7d 100644 --- a/module/personnel/control.php +++ b/module/personnel/control.php @@ -117,7 +117,7 @@ class personnel extends control if($from == 'program') $goback = $this->createLink('program', 'browse'); if($from == 'programproject') $goback = $this->session->programProject ? $this->session->programProject : $this->createLink('program', 'project', "programID=$programID"); - $this->view->title = $this->lang->personnel->whitelist; + $this->view->title = $this->lang->personnel->whitelist; $this->view->pager = $pager; $this->view->objectID = $objectID; @@ -125,9 +125,12 @@ class personnel extends control $this->view->depts = $this->loadModel('dept')->getOptionMenu(); $this->view->module = $module; $this->view->goback = $goback; - $this->view->programID = $programID; $this->view->from = $from; + $dropMenuObjectID = $objectType . 'ID'; + $this->view->{$dropMenuObjectID} = $objectID; + $this->view->projectProgramID = $programID; + $this->display(); } diff --git a/module/personnel/ui/whitelist.html.php b/module/personnel/ui/whitelist.html.php index b4221ebe57..49ea0045fb 100644 --- a/module/personnel/ui/whitelist.html.php +++ b/module/personnel/ui/whitelist.html.php @@ -25,8 +25,8 @@ featureBar set::linkParams("objectID={$objectID}&module=whitelist&objectType={$objectType}"), ); -$whitelistVars = $module == 'program' ? "objectID={$objectID}&programID={$programID}&module={$module}&from={$from}" : "objectID={$objectID}"; -$addWhitelistVars = $module == 'program' ? "objectID={$objectID}&deptID=0©ID=0&programID={$programID}&from={$from}" : "objectID={$objectID}"; +$whitelistVars = $module == 'program' ? "objectID={$objectID}&programID={$projectProgramID}&module={$module}&from={$from}" : "objectID={$objectID}"; +$addWhitelistVars = $module == 'program' ? "objectID={$objectID}&deptID=0©ID=0&programID={$projectProgramID}&from={$from}" : "objectID={$objectID}"; toolbar ( btngroup diff --git a/module/product/model.php b/module/product/model.php index 18e224f568..c3acb1a480 100755 --- a/module/product/model.php +++ b/module/product/model.php @@ -1709,6 +1709,7 @@ class productModel extends model $item->releases = $product->releases; $item->latestReleaseDate = $product->latestReleaseDate; $item->latestRelease = $product->latestRelease; + if(isset($product->actions)) $item->actions = $product->actions; return $item; } diff --git a/module/program/config/dtable.php b/module/program/config/dtable.php index f104d7af4a..68f1592e0f 100644 --- a/module/program/config/dtable.php +++ b/module/program/config/dtable.php @@ -187,140 +187,9 @@ $config->program->productview->dtable->fieldList['latestRelease']['type'] $config->program->productview->dtable->fieldList['latestRelease']['filterType'] = true; $config->program->productview->dtable->fieldList['latestRelease']['group'] = 'g8'; -/* DataTable fields of Project View. */ -$config->program->projectView = new stdClass(); -$config->program->projectView->dtable = new stdClass(); -$config->program->projectView->dtable->fieldList = array(); - -$config->program->projectView->dtable->fieldList['name']['name'] = 'name'; -$config->program->projectView->dtable->fieldList['name']['title'] = $lang->nameAB; -$config->program->projectView->dtable->fieldList['name']['width'] = 200; -$config->program->projectView->dtable->fieldList['name']['type'] = 'link'; -$config->program->projectView->dtable->fieldList['name']['link'] = "RAWJSprogram->projectView->dtable->fieldList['name']['nestedToggle'] = true; -$config->program->projectView->dtable->fieldList['name']['checkbox'] = true; -$config->program->projectView->dtable->fieldList['name']['sortType'] = true; -$config->program->projectView->dtable->fieldList['name']['iconRender'] = 'RAWJSRAWJS'; -$config->program->projectView->dtable->fieldList['name']['show'] = true; -$config->program->projectView->dtable->fieldList['name']['group'] = 1; - -$config->program->projectView->dtable->fieldList['status']['name'] = 'status'; -$config->program->projectView->dtable->fieldList['status']['title'] = $lang->program->status; -$config->program->projectView->dtable->fieldList['status']['minWidth'] = 60; -$config->program->projectView->dtable->fieldList['status']['type'] = 'status'; -$config->program->projectView->dtable->fieldList['status']['sortType'] = true; -$config->program->projectView->dtable->fieldList['status']['statusMap'] = $lang->program->statusList; -$config->program->projectView->dtable->fieldList['status']['show'] = true; -$config->program->projectView->dtable->fieldList['status']['group'] = 2; - -$config->program->projectView->dtable->fieldList['PM']['name'] = 'PM'; -$config->program->projectView->dtable->fieldList['PM']['title'] = $lang->program->PM; -$config->program->projectView->dtable->fieldList['PM']['minWidth'] = 80; -$config->program->projectView->dtable->fieldList['PM']['type'] = 'avatarBtn'; -$config->program->projectView->dtable->fieldList['PM']['sortType'] = true; -$config->program->projectView->dtable->fieldList['PM']['show'] = true; -$config->program->projectView->dtable->fieldList['PM']['group'] = 3; - -$config->program->projectView->dtable->fieldList['budget']['name'] = 'budget'; -$config->program->projectView->dtable->fieldList['budget']['title'] = $lang->program->budget; -$config->program->projectView->dtable->fieldList['budget']['width'] = 90; -$config->program->projectView->dtable->fieldList['budget']['type'] = 'format'; -$config->program->projectView->dtable->fieldList['budget']['sortType'] = true; -$config->program->projectView->dtable->fieldList['budget']['show'] = true; -$config->program->projectView->dtable->fieldList['budget']['group'] = 4; - -$config->program->projectView->dtable->fieldList['invested']['name'] = 'invested'; -$config->program->projectView->dtable->fieldList['invested']['title'] = $lang->program->invested; -$config->program->projectView->dtable->fieldList['invested']['minWidth'] = 70; -$config->program->projectView->dtable->fieldList['invested']['type'] = 'format'; -$config->program->projectView->dtable->fieldList['invested']['sortType'] = true; -$config->program->projectView->dtable->fieldList['invested']['show'] = true; -$config->program->projectView->dtable->fieldList['invested']['group'] = 4; - -$config->program->projectView->dtable->fieldList['openedDate']['name'] = 'openedDate'; -$config->program->projectView->dtable->fieldList['openedDate']['title'] = $lang->program->openedDate; -$config->program->projectView->dtable->fieldList['openedDate']['type'] = 'date'; -$config->program->projectView->dtable->fieldList['openedDate']['sortType'] = true; -$config->program->projectView->dtable->fieldList['openedDate']['minWidth'] = 90; -$config->program->projectView->dtable->fieldList['openedDate']['group'] = 5; - -$config->program->projectView->dtable->fieldList['openedBy']['name'] = 'openedBy'; -$config->program->projectView->dtable->fieldList['openedBy']['title'] = $lang->program->openedBy; -$config->program->projectView->dtable->fieldList['openedBy']['type'] = 'user'; -$config->program->projectView->dtable->fieldList['openedBy']['sortType'] = true; -$config->program->projectView->dtable->fieldList['openedBy']['minWidth'] = 80; -$config->program->projectView->dtable->fieldList['openedBy']['group'] = 5; - -$config->program->projectView->dtable->fieldList['begin']['name'] = 'begin'; -$config->program->projectView->dtable->fieldList['begin']['title'] = $lang->program->begin; -$config->program->projectView->dtable->fieldList['begin']['minWidth'] = 90; -$config->program->projectView->dtable->fieldList['begin']['type'] = 'date'; -$config->program->projectView->dtable->fieldList['begin']['sortType'] = true; -$config->program->projectView->dtable->fieldList['begin']['show'] = true; -$config->program->projectView->dtable->fieldList['begin']['group'] = 6; - -$config->program->projectView->dtable->fieldList['end']['name'] = 'end'; -$config->program->projectView->dtable->fieldList['end']['title'] = $lang->program->end; -$config->program->projectView->dtable->fieldList['end']['minWidth'] = 90; -$config->program->projectView->dtable->fieldList['end']['type'] = 'date'; -$config->program->projectView->dtable->fieldList['end']['sortType'] = true; -$config->program->projectView->dtable->fieldList['end']['show'] = true; -$config->program->projectView->dtable->fieldList['end']['group'] = 6; - -$config->program->projectView->dtable->fieldList['realBegan']['name'] = 'realBegan'; -$config->program->projectView->dtable->fieldList['realBegan']['title'] = $lang->program->realBeganAB; -$config->program->projectView->dtable->fieldList['realBegan']['minWidth'] = 90; -$config->program->projectView->dtable->fieldList['realBegan']['type'] = 'date'; -$config->program->projectView->dtable->fieldList['realBegan']['sortType'] = true; -$config->program->projectView->dtable->fieldList['realBegan']['group'] = 7; - -$config->program->projectView->dtable->fieldList['realEnd']['name'] = 'realEnd'; -$config->program->projectView->dtable->fieldList['realEnd']['title'] = $lang->program->realEndAB; -$config->program->projectView->dtable->fieldList['realEnd']['minWidth'] = 90; -$config->program->projectView->dtable->fieldList['realEnd']['type'] = 'date'; -$config->program->projectView->dtable->fieldList['realEnd']['sortType'] = true; -$config->program->projectView->dtable->fieldList['realEnd']['group'] = 7; - -$config->program->projectView->dtable->fieldList['progress']['name'] = 'progress'; -$config->program->projectView->dtable->fieldList['progress']['title'] = $lang->program->progressAB; -$config->program->projectView->dtable->fieldList['progress']['minWidth'] = 100; -$config->program->projectView->dtable->fieldList['progress']['type'] = 'progress'; -$config->program->projectView->dtable->fieldList['progress']['show'] = true; -$config->program->projectView->dtable->fieldList['progress']['group'] = 8; - global $app; $app->loadLang('project'); -$config->program->projectView->dtable->fieldList['actions']['name'] = 'actions'; -$config->program->projectView->dtable->fieldList['actions']['title'] = $lang->actions; -$config->program->projectView->dtable->fieldList['actions']['width'] = 160; -$config->program->projectView->dtable->fieldList['actions']['type'] = 'actions'; -$config->program->projectView->dtable->fieldList['actions']['fixed'] = 'right'; -$config->program->projectView->dtable->fieldList['actions']['actionsMap'] = array -( - 'program_start' => array('icon' => 'icon-start', 'hint' => $lang->program->start), - 'program_suspend' => array('icon' => 'icon-pause', 'hint' => $lang->program->suspend), - 'program_close' => array('icon' => 'icon-off', 'hint' => $lang->program->close), - 'program_activate' => array('icon' => 'icon-active', 'hint' => $lang->program->activate), - 'program_other' => array('caret' => true, 'hint' => $lang->other, 'type' => 'dropdown'), - 'program_edit' => array('icon' => 'icon-edit', 'hint' => $lang->program->edit), - 'program_create' => array('icon' => 'icon-split', 'hint' => $lang->program->create), - 'program_delete' => array('icon' => 'icon-trash', 'hint' => $lang->program->delete), - 'project_start' => array('icon' => 'icon-start', 'hint' => $lang->project->start), - 'project_suspend' => array('icon' => 'icon-pause', 'hint' => $lang->project->suspend), - 'project_close' => array('icon' => 'icon-off', 'hint' => $lang->project->close), - 'project_activate' => array('icon' => 'icon-active', 'hint' => $lang->project->activate), - 'project_other' => array('caret' => true, 'hint' => $lang->project->other, 'type' => 'dropdown'), - 'project_edit' => array('icon' => 'icon-edit', 'hint' => $lang->project->edit), - 'project_team' => array('icon' => 'icon-groups', 'hint' => $lang->project->manageMembers), - 'project_group' => array('icon' => 'icon-lock', 'hint' => $lang->project->group), - 'project_more' => array('icon' => 'icon-ellipsis-v', 'hint' => $lang->project->moreActions, 'type' => 'dropdown', 'caret' => false), - 'project_link' => array('icon' => 'icon-link', 'hint' => $lang->project->manageProducts), - 'project_whitelist' => array('icon' => 'icon-shield-check', 'hint' => $lang->project->whitelist), - 'project_delete' => array('icon' => 'icon-trash', 'hint' => $lang->project->delete) -); - /* DataTable fields of browse View. */ $config->program->browse = new stdClass(); $config->program->browse->dtable = new stdClass(); @@ -330,7 +199,7 @@ $config->program->browse->dtable->fieldList['name']['name'] = 'name'; $config->program->browse->dtable->fieldList['name']['title'] = $lang->nameAB; $config->program->browse->dtable->fieldList['name']['width'] = 200; $config->program->browse->dtable->fieldList['name']['type'] = 'link'; -$config->program->browse->dtable->fieldList['name']['link'] = "RAWJSprogram->browse->dtable->fieldList['name']['flex'] = 1; $config->program->browse->dtable->fieldList['name']['nestedToggle'] = true; $config->program->browse->dtable->fieldList['name']['checkbox'] = true;