From 8bd86c4d9faec617e767ff7309a4d9c548627d6e Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Tue, 5 Jul 2022 14:39:39 +0800 Subject: [PATCH 001/706] * Init port module. --- module/port/config.php | 13 +++++++++++ module/port/control.php | 44 ++++++++++++++++++++++++++++++++++++++ module/port/lang/zh-cn.php | 11 ++++++++++ module/port/model.php | 0 4 files changed, 68 insertions(+) create mode 100644 module/port/config.php create mode 100644 module/port/control.php create mode 100644 module/port/lang/zh-cn.php create mode 100644 module/port/model.php diff --git a/module/port/config.php b/module/port/config.php new file mode 100644 index 0000000000..8fe827b3aa --- /dev/null +++ b/module/port/config.php @@ -0,0 +1,13 @@ +port = new stdclass(); + +$config->port->fieldList['title'] = ''; +$config->port->fieldList['width'] = ''; +$config->port->fieldList['required'] = ''; +$config->port->fieldList['fixed'] = ''; +$config->port->fieldList['control'] = ''; +$config->port->fieldList['values'] = ''; +$config->port->fieldList['class'] = ''; +$config->port->fieldList['sort'] = ''; + + diff --git a/module/port/control.php b/module/port/control.php new file mode 100644 index 0000000000..7a76856d4e --- /dev/null +++ b/module/port/control.php @@ -0,0 +1,44 @@ +importexport = new stdclass(); + +$lang->importexport->default->key['id'] = '编号'; +$lang->importexport->default->key['type'] = '类型'; +$lang->importexport->default->key['project'] = '所属项目'; +$lang->importexport->default->key['execution'] = '所属执行'; +$lang->importexport->default->key['product'] = '所属产品'; +$lang->importexport->default->key['code'] = '代号'; +$lang->importexport->default->key['name'] = '名称'; +$lang->importexport->default->key['title'] = '标题'; diff --git a/module/port/model.php b/module/port/model.php new file mode 100644 index 0000000000..e69de29bb2 From 030fa6d1bd97b19693bb88675682db3567d59237 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Tue, 5 Jul 2022 17:24:15 +0800 Subject: [PATCH 002/706] * Finish initFieldList. --- module/port/control.php | 120 ++++++++++++++++++++++++------------- module/port/lang/zh-cn.php | 19 +++--- module/port/model.php | 84 ++++++++++++++++++++++++++ 3 files changed, 174 insertions(+), 49 deletions(-) diff --git a/module/port/control.php b/module/port/control.php index 7a76856d4e..2f11b54bb6 100644 --- a/module/port/control.php +++ b/module/port/control.php @@ -1,44 +1,84 @@ initFieldList($model); + } + /** + * Init FieldList . + * + * @param int $model + * @access public + * @return void + */ + public function initFieldList($model) + { + $portFieldList = $this->config->port->fieldList; + + $this->loadModel($model); + $fields = isset($this->config->$model->exportFields) ? $this->config->$model->exportFields : ''; + + if(empty($fields)) return false; + + $fields = explode(',', $fields); + + /* build module fieldList. */ + foreach ($fields as $field) + { + $field = trim($field); + + $modelFieldList = isset($this->config->$model->fieldList[$field]) ? $this->config->$model->fieldList[$field] : array(); + + foreach ($portFieldList as $portField => $value) + { + $funcName = 'init' . ucfirst($portField); + if(!array_key_exists($portField, $modelFieldList)) $modelFieldList[$portField] = $this->port->$funcName($model, $field); + } + + $this->config->$model->fieldList[$field] = $modelFieldList; + } + + a($this->config->$model->fieldList); + } + + /** + * Export Template. + * + * @access public + * @return void + */ + public function exportTemplate() + { + + } + + /** + * Import. + * + * @access public + * @return void + */ + public function import() + { + + } + + /** + * Show Import datas . + * + * @access public + * @return void + */ + public function showImport() + { + + } } diff --git a/module/port/lang/zh-cn.php b/module/port/lang/zh-cn.php index 40ecba9e68..8495e3d8f4 100644 --- a/module/port/lang/zh-cn.php +++ b/module/port/lang/zh-cn.php @@ -1,11 +1,12 @@ importexport = new stdclass(); +$lang->port = new stdclass(); -$lang->importexport->default->key['id'] = '编号'; -$lang->importexport->default->key['type'] = '类型'; -$lang->importexport->default->key['project'] = '所属项目'; -$lang->importexport->default->key['execution'] = '所属执行'; -$lang->importexport->default->key['product'] = '所属产品'; -$lang->importexport->default->key['code'] = '代号'; -$lang->importexport->default->key['name'] = '名称'; -$lang->importexport->default->key['title'] = '标题'; +$lang->port->reservedWord['id'] = '编号'; +$lang->port->reservedWord['type'] = '类型'; +$lang->port->reservedWord['project'] = '所属项目'; +$lang->port->reservedWord['execution'] = '所属执行'; +$lang->port->reservedWord['product'] = '所属产品'; +$lang->port->reservedWord['code'] = '代号'; +$lang->port->reservedWord['name'] = '名称'; +$lang->port->reservedWord['title'] = '标题'; +$lang->port->reservedWord['asdawdadw'] = '测试字段'; diff --git a/module/port/model.php b/module/port/model.php index e69de29bb2..37e0db4076 100644 --- a/module/port/model.php +++ b/module/port/model.php @@ -0,0 +1,84 @@ +app->loadLang($model); + + if(array_key_exists($field, $this->lang->$model)) + { + $title = $this->lang->$model->$field; + } + elseif(array_key_exists($field . 'AB', $this->lang->$model)) + { + $title = $this->lang->$model->$field . 'AB'; + } + elseif(array_key_exists($field, $this->lang->port->reservedWord)) + { + $title = $this->lang->port->reservedWord[$field]; + } + + return $title; + } + + public function initWidth($model, $field) + { + return '120px'; + + } + + public function initControl($model, $field) + { + return 'select'; + } + + public function initValues($model, $field) + { + return 'value'; + } + + public function initSort($model, $field) + { + return 'no'; + } + + /** + * Init Required. + * + * @param int $model + * @param int $field + * @access public + * @return void + */ + public function initRequired($model, $field) + { + if(empty($this->config->$model->create->requiredFields)) return 'no'; + + $requiredFields = "," . $this->config->$model->create->requiredFields . ","; + + if(strpos($requiredFields, $field) !== false) return 'yes'; + return 'no'; + } + + public function initFixed($model, $field) + { + return 'left'; + } + + public function initClass($model, $field) + { + return ''; + } +} + From e9fc3638e296d7fd9759fb8b134629281f060ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Tue, 5 Jul 2022 21:11:03 +0800 Subject: [PATCH 003/706] * Code for CFD. --- module/execution/control.php | 18 +------------ module/execution/css/cfd.css | 9 ++----- module/execution/model.php | 30 ++++++++++++++++++++++ module/execution/view/cfd.html.php | 41 +++++++++++++++--------------- 4 files changed, 53 insertions(+), 45 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index f4c5fe7fe6..10357a5a01 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1321,23 +1321,7 @@ class execution extends control $this->loadModel('kanban'); $this->app->loadClass('date'); - $end = helper::today() > $execution->end ? $execution->end : helper::today(); - if(helper::today() > $execution->end) - { - if(date($execution->end, strtotime('-14 days')) > $execution->begin) - { - $begin = date($execution->end, strtotime('-14 days')); - } - else - { - $begin = $execution->begin; - } - } - elseif(($execution->begin < helper::today()) and (helper::today() < $execution->end)) - { - $begin = (date('Y-m-d', strtotime('-14 days')) < $execution->begin) ? $execution->begin : date('Y-m-d', strtotime('-14 days')); - } - + list($begin, $end) = $this->execution->getBeginEnd4CFD($execution); $dateList = date::getDateList($begin, $end, 'Y-m-d', ''); $this->view->title = $this->lang->execution->CFD; diff --git a/module/execution/css/cfd.css b/module/execution/css/cfd.css index 3e705de6b9..fd514e009f 100644 --- a/module/execution/css/cfd.css +++ b/module/execution/css/cfd.css @@ -1,11 +1,6 @@ .main-content > h2 {font-size: 16px;} #cfdWrapper {max-width: 1400px; margin: 0 auto; padding: 25px 100px 10px; position: relative;} -#cfdYUnit {position: absolute; color: #CBD0DB; top: 0; left: 90px;} -#cfdXUnit {position: absolute; color: #CBD0DB; bottom: 20px; right: 60px;} -#cfdLegend {position: absolute; right: 0; width: 80px; height: 60px; top: 50%; margin-top: -30px; line-height: 30px; color: #838A9D; font-size: 12px;} -#cfdLegend > div {position: relative; padding-left: 30px;} -#cfdLegend > div > .barline {position: absolute; width: 20px; left: 0; top: 13px; height: 3px; background: #EEEEEE;} -#cfdLegend .line-real .bg-primary {background: #1183fb;} -#cfdLegend .line-real .bg-delay {background: red;} +#cfdYUnit {position: absolute; color: #CBD0DB; top: 27px; left: 130px;} +#cfdXUnit {position: absolute; color: #CBD0DB; bottom: 35px; right: 60px;} .pull-left .input-control {margin-right: 10px;} diff --git a/module/execution/model.php b/module/execution/model.php index 5b81211999..0a9f3f00d2 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -3092,6 +3092,36 @@ class executionModel extends model $this->dao->replace(TABLE_BURN)->data($data)->exec(); } + /** + * Get begin and end for CFD. + * + * @param object $execution + * @access public + * @return void + */ + public function getBeginEnd4CFD($execution) + { + $begin = $execution->begin; + $end = $execution->end; + if(helper::today() < $execution->begin) + { + $begin = helper::today(); + $end = helper::today(); + } + elseif((helper::today() >= $execution->begin) and (helper::today() <= $execution->end)) + { + $begin = (date('Y-m-d', strtotime('-14 days')) < $execution->begin) ? $execution->begin : date('Y-m-d', strtotime('-14 days')); + $end = helper::today(); + } + elseif((helper::today() > $execution->end)) + { + $begin = date($execution->end, strtotime('-14 days')) > $execution->begin ? date($execution->end, strtotime('-14 days')) : $execution->begin; + $end = $execution->end; + } + + return array($begin, $end); + } + /** * Get burn data for flot * diff --git a/module/execution/view/cfd.html.php b/module/execution/view/cfd.html.php index 1fbde9ec04..f48acea755 100644 --- a/module/execution/view/cfd.html.php +++ b/module/execution/view/cfd.html.php @@ -11,11 +11,6 @@ */ ?> - -name);?> -execution->watermark);?> -execution->burnXUnit);?> -execution->burnYUnit);?>