diff --git a/module/project/control.php b/module/project/control.php index f0e94e3fdb..afe76cb27d 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -37,7 +37,7 @@ class project extends control * @access public * @return void */ - public function index($locate = 'yes', $status = 'undone', $projectID = 0, $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 10, $pageID = 1) + public function index($locate = 'yes', $status = 'undone', $projectID = 0, $orderBy = 'order_desc', $productID = 0, $recTotal = 0, $recPerPage = 10, $pageID = 1) { if($locate == 'yes') $this->locate($this->createLink('project', 'task')); @@ -51,8 +51,9 @@ class project extends control $this->app->loadLang('my'); $this->view->title = $this->lang->project->allProject; $this->view->position[] = $this->lang->project->allProject; - $this->view->projectStats = $this->project->getProjectStats($status, 0, 30, $orderBy, $pager); + $this->view->projectStats = $this->project->getProjectStats($status == 'byproduct' ? 'all' : $status, $productID, 30, $orderBy, $pager); $this->view->products = $this->loadModel('product')->getPairs(); + $this->view->productID = $productID; $this->view->projectID = $projectID; $this->view->pager = $pager; $this->view->recTotal = $pager->recTotal; diff --git a/module/project/css/index.css b/module/project/css/index.css new file mode 100644 index 0000000000..98b9589316 --- /dev/null +++ b/module/project/css/index.css @@ -0,0 +1,2 @@ +#product_chosen .chosen-single{width:180px;} +#product_chosen .chosen-drop {min-width: 300px;!important} diff --git a/module/project/js/index.js b/module/project/js/index.js index df267020ce..257d1b8979 100644 --- a/module/project/js/index.js +++ b/module/project/js/index.js @@ -8,3 +8,8 @@ $(function() $.post(createLink('project', 'ajaxOrder'), {'projects' : list, 'orderBy' : orderBy}); }); }); + +function byProduct(productID, projectID) +{ + location.href = createLink('project', 'index', "locate=no&status=byproduct&project=" + projectID + "&orderBy=" + orderBy + '&productID=' + productID); +} diff --git a/module/project/view/index.html.php b/module/project/view/index.html.php index 1a090718bd..8bc9a639dd 100644 --- a/module/project/view/index.html.php +++ b/module/project/view/index.html.php @@ -23,11 +23,12 @@ " . html::a(inlink("index", "locate=no&status=doing&projectID=$project->id"), $lang->project->statusList['doing']) . '';?> " . html::a(inlink("index", "locate=no&status=suspended&projectID=$project->id"), $lang->project->statusList['suspended']) . '';?> " . html::a(inlink("index", "locate=no&status=done&projectID=$project->id"), $lang->project->statusList['done']) . '';?> + " . html::select('product', $products, $productID, "class='chosen' onchange='byProduct(this.value, $projectID)'") . '';?>
'> - recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> + recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>