diff --git a/module/company/control.php b/module/company/control.php index be57833a37..ca4c93f11c 100644 --- a/module/company/control.php +++ b/module/company/control.php @@ -167,10 +167,11 @@ class company extends control * @param int $productID * @param int $projectID * @param int $executionID + * @param string $orderBy * @access public * @return void */ - public function dynamic($browseType = 'today', $param = '', $recTotal = 0, $date = '', $direction = 'next', $userID = '', $productID = 0, $projectID = 0, $executionID = 0) + public function dynamic($browseType = 'today', $param = '', $recTotal = 0, $date = '', $direction = 'next', $userID = '', $productID = 0, $projectID = 0, $executionID = 0, $orderBy = 'date_desc') { $this->company->setMenu(); $this->app->loadLang('user'); @@ -203,7 +204,6 @@ class company extends control $pager = new pager($recTotal, $recPerPage = 50, $pageID = 1); /* Append id for secend sort. */ - $orderBy = $direction == 'next' ? 'date_desc' : 'date_asc'; $sort = $this->loadModel('common')->appendOrder($orderBy); $queryID = ($browseType == 'bysearch') ? (int)$param : 0; diff --git a/module/company/css/dynamic.css b/module/company/css/dynamic.css index a26a494018..92562b88b3 100644 --- a/module/company/css/dynamic.css +++ b/module/company/css/dynamic.css @@ -18,5 +18,6 @@ .dynamic.collapsed .timeline > li + li {display: none;} .dynamic.collapsed .dynamic-btn > .icon:before {content: '\f0d8';} -.c-user, .c-project, .c-product, .c-execution {width: 150px !important; overflow: unset;} +.c-project, .c-product, .c-execution {width: 150px !important; overflow: unset;} +.c-user,.c-order {width: 100px !important; overflow: unset;} .c-date {width: 200px;} diff --git a/module/company/js/dynamic.js b/module/company/js/dynamic.js index d03c9031c6..1e6de4d1fa 100644 --- a/module/company/js/dynamic.js +++ b/module/company/js/dynamic.js @@ -1,11 +1,12 @@ -$('#account, #product, #project, #execution').change(function() +$('#account, #product, #project, #execution, #orderBy').change(function() { var userID = $('#account').val(); var productID = $('#product').val(); var projectID = systemMode == 'new' ? $('#project').val() : 0; var executionID = $('#execution').val(); + var orderBy = $('#orderBy').val(); browseType = browseType == 'bysearch' ? 'all' : browseType; - link = createLink('company', 'dynamic', 'browseType=' + browseType + '¶m=&recTotal=0&date=&direction=next&userID=' + userID + '&productID=' + productID + '&projectID=' + projectID + '&executionID=' + executionID); + link = createLink('company', 'dynamic', 'browseType=' + browseType + '¶m=&recTotal=0&date=&direction=next&userID=' + userID + '&productID=' + productID + '&projectID=' + projectID + '&executionID=' + executionID + '&orderBy=' + orderBy); location.href = link; }) diff --git a/module/company/lang/en.php b/module/company/lang/en.php index 893dd3ff15..5a3b707db8 100644 --- a/module/company/lang/en.php +++ b/module/company/lang/en.php @@ -37,3 +37,6 @@ $lang->company->user = 'User'; $lang->company->guestOptions[0] = 'Deny'; $lang->company->guestOptions[1] = 'Allow'; + +$lang->company->order['date_desc'] = 'Descending'; +$lang->company->order['date_asc'] = 'Ascending'; diff --git a/module/company/lang/zh-cn.php b/module/company/lang/zh-cn.php index 796c839ba4..61147a7092 100644 --- a/module/company/lang/zh-cn.php +++ b/module/company/lang/zh-cn.php @@ -37,3 +37,6 @@ $lang->company->user = '用户'; $lang->company->guestOptions[0] = '不允许'; $lang->company->guestOptions[1] = '允许'; + +$lang->company->order['date_desc'] = '倒序排列'; +$lang->company->order['date_asc'] = '正序排列'; diff --git a/module/company/view/dynamic.html.php b/module/company/view/dynamic.html.php index 6e2a4f9711..3c5bc77f7e 100644 --- a/module/company/view/dynamic.html.php +++ b/module/company/view/dynamic.html.php @@ -24,7 +24,7 @@ $active = 'btn-active-text'; $label .= " {$pager->recTotal}"; } - echo html::a(inlink('dynamic', "browseType=$period¶m=&recTotal=0&date=&direction=next&userID=$userID&productID=$productID&projectID=$projectID&executionID=$executionID"), $label, '', "class='btn btn-link $active' id='{$period}'") + echo html::a(inlink('dynamic', "browseType=$period¶m=&recTotal=0&date=&direction=next&userID=$userID&productID=$productID&projectID=$projectID&executionID=$executionID&orderBy=$orderBy"), $label, '', "class='btn btn-link $active' id='{$period}'") ?>
@@ -33,6 +33,7 @@ +