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);?>