From ca5110623e9d72ef02a8401e2b9a3e30a0eb502c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=BB=B6=E4=B9=89?= Date: Wed, 28 Sep 2022 10:09:32 +0800 Subject: [PATCH] * Add project checkbox style. --- config/filter.php | 15 ++++++++------- module/program/control.php | 13 +++++++------ module/program/js/project.js | 21 +++++++++++++++++++++ module/program/view/project.html.php | 3 ++- module/project/js/browse.js | 6 ++++++ 5 files changed, 44 insertions(+), 14 deletions(-) create mode 100644 module/program/js/project.js diff --git a/config/filter.php b/config/filter.php index b740cdafc0..bc8f6b2d2a 100755 --- a/config/filter.php +++ b/config/filter.php @@ -249,13 +249,14 @@ $filter->product->dynamic->cookie['preBranch'] = 'reg::word'; $filter->branch->default->cookie['preBranch'] = 'reg::word'; -$filter->program->default->cookie['lastPGM'] = 'int'; -$filter->program->default->cookie['lastPRJ'] = 'int'; -$filter->program->prjbrowse->cookie['programType'] = 'code'; -$filter->program->project->cookie['involved'] = 'code'; -$filter->program->browse->cookie['showClosed'] = 'code'; -$filter->program->export->cookie['checkedItem'] = 'reg::checked'; -$filter->program->ajaxgetdropmenu->cookie['showClosed'] = 'code'; +$filter->program->default->cookie['lastPGM'] = 'int'; +$filter->program->default->cookie['lastPRJ'] = 'int'; +$filter->program->prjbrowse->cookie['programType'] = 'code'; +$filter->program->project->cookie['involved'] = 'code'; +$filter->program->project->cookie['showProjectBatchEdit'] = 'int'; +$filter->program->browse->cookie['showClosed'] = 'code'; +$filter->program->export->cookie['checkedItem'] = 'reg::checked'; +$filter->program->ajaxgetdropmenu->cookie['showClosed'] = 'code'; $filter->project->default->cookie['lastProject'] = 'int'; $filter->project->default->cookie['lastPRJ'] = 'int'; diff --git a/module/program/control.php b/module/program/control.php index ba80180d95..2a15648ef4 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -479,12 +479,13 @@ class program extends control $this->view->title = $this->lang->program->project; $this->view->position[] = $this->lang->program->project; - $this->view->projectStats = $projectStats; - $this->view->pager = $pager; - $this->view->programID = $programID; - $this->view->users = $this->loadModel('user')->getPairs('noletter|pofirst|nodeleted'); - $this->view->browseType = $browseType; - $this->view->orderBy = $orderBy; + $this->view->projectStats = $projectStats; + $this->view->pager = $pager; + $this->view->programID = $programID; + $this->view->users = $this->loadModel('user')->getPairs('noletter|pofirst|nodeleted'); + $this->view->browseType = $browseType; + $this->view->orderBy = $orderBy; + $this->view->showBatchEdit = $this->cookie->showProjectBatchEdit; $this->display(); } diff --git a/module/program/js/project.js b/module/program/js/project.js new file mode 100644 index 0000000000..bb39b7a7fa --- /dev/null +++ b/module/program/js/project.js @@ -0,0 +1,21 @@ +$(function() +{ + $('input[name^="showEdit"]').click(function() + { + $.cookie('showProjectBatchEdit', $(this).is(':checked') ? 1 : 0, {expires: config.cookieLife, path: config.webRoot}); + setCheckbox(); + }); + setCheckbox(); +}); + +/** + * Set batch edit checkbox. + * + * @access public + * @return void + */ +function setCheckbox() +{ + $('#projectsForm .checkbox-primary').hide(); + if($.cookie('showProjectBatchEdit') == 1) $('#projectsForm .checkbox-primary').show(); +} diff --git a/module/program/view/project.html.php b/module/program/view/project.html.php index 64c96fc921..3f18a3b0b4 100644 --- a/module/program/view/project.html.php +++ b/module/program/view/project.html.php @@ -14,6 +14,7 @@