* Finish task #73236.
This commit is contained in:
Regular → Executable
+32
-6
@@ -39,8 +39,12 @@ class design extends control
|
||||
*/
|
||||
public function commonAction($projectID = 0, $productID = 0, $designID = 0)
|
||||
{
|
||||
$products = $this->product->getProductPairsByProject($projectID);
|
||||
$productID = $this->product->saveState($productID, $products);
|
||||
$products = $this->product->getProductPairsByProject($projectID);
|
||||
$products[0] = $this->lang->product->all;
|
||||
|
||||
ksort($products);
|
||||
|
||||
$productID = $this->product->saveState($productID, $products);
|
||||
|
||||
$this->lang->modulePageNav = $this->design->setMenu($projectID, $products, $productID);
|
||||
$this->project->setMenu($projectID);
|
||||
@@ -158,11 +162,14 @@ class design extends control
|
||||
return $this->send($response);
|
||||
}
|
||||
|
||||
$products = $this->product->getProductPairsByProject($projectID);
|
||||
$productIdList = $productID ? $productID : array_keys($products);
|
||||
|
||||
$this->view->title = $this->lang->design->common . $this->lang->colon . $this->lang->design->create;
|
||||
$this->view->position[] = $this->lang->design->create;
|
||||
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed');
|
||||
$this->view->stories = $this->loadModel('story')->getProductStoryPairs($productID);
|
||||
$this->view->stories = $this->loadModel('story')->getProductStoryPairs($productIdList);
|
||||
$this->view->productID = $productID;
|
||||
$this->view->type = $type;
|
||||
$this->view->project = $this->loadModel('project')->getByID($projectID);
|
||||
@@ -201,10 +208,13 @@ class design extends control
|
||||
return $this->send($response);
|
||||
}
|
||||
|
||||
$products = $this->product->getProductPairsByProject($projectID);
|
||||
$productIdList = $productID ? $productID : array_keys($products);
|
||||
|
||||
$this->view->title = $this->lang->design->common . $this->lang->colon . $this->lang->design->batchCreate;
|
||||
$this->view->position[] = $this->lang->design->batchCreate;
|
||||
|
||||
$this->view->stories = $this->loadModel('story')->getProductStoryPairs($productID);
|
||||
$this->view->stories = $this->loadModel('story')->getProductStoryPairs($productIdList);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed');
|
||||
$this->view->type = $type;
|
||||
|
||||
@@ -226,11 +236,14 @@ class design extends control
|
||||
$this->session->set('revisionList', $this->app->getURI(true));
|
||||
$this->session->set('storyList', $this->app->getURI(true), 'product');
|
||||
|
||||
$products = $this->product->getProductPairsByProject($design->project);
|
||||
$productIdList = $design->product ? $design->product : array_keys($products);
|
||||
|
||||
$this->view->title = $this->lang->design->common . $this->lang->colon . $this->lang->design->view;
|
||||
$this->view->position[] = $this->lang->design->view;
|
||||
|
||||
$this->view->design = $design;
|
||||
$this->view->stories = $this->loadModel('story')->getProductStoryPairs($design->product);
|
||||
$this->view->stories = $this->loadModel('story')->getProductStoryPairs($productIdList);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->actions = $this->loadModel('action')->getList('design', $design->id);
|
||||
$this->view->repos = $this->loadModel('repo')->getRepoPairs('project', $design->project);
|
||||
@@ -274,12 +287,15 @@ class design extends control
|
||||
return $this->send($response);
|
||||
}
|
||||
|
||||
$products = $this->product->getProductPairsByProject($design->project);
|
||||
$productIdList = $design->product ? $design->product : array_keys($products);
|
||||
|
||||
$this->view->title = $this->lang->design->common . $this->lang->colon . $this->lang->design->edit;
|
||||
$this->view->position[] = $this->lang->design->edit;
|
||||
|
||||
$this->view->design = $design;
|
||||
$this->view->project = $this->loadModel('project')->getByID($design->project);
|
||||
$this->view->stories = $this->loadModel('story')->getProductStoryPairs($design->product);
|
||||
$this->view->stories = $this->loadModel('story')->getProductStoryPairs($productIdList);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed');
|
||||
|
||||
$this->display();
|
||||
@@ -449,6 +465,16 @@ class design extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
public function ajaxGetProductStories($productID, $projectID)
|
||||
{
|
||||
$products = $this->product->getProductPairsByProject($projectID);
|
||||
$productIdList = $productID ? $productID : array_keys($products);
|
||||
|
||||
$stories = $this->loadModel('story')->getProductStoryPairs($productIdList);
|
||||
|
||||
return print(html::select('story', $stories, '', "class='form-control'"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a design.
|
||||
*
|
||||
|
||||
Regular → Executable
+1
-1
@@ -6,7 +6,7 @@ $(document).on('click', '.ajaxPager', function()
|
||||
$('#product').change(function()
|
||||
{
|
||||
productID = $(this).val();
|
||||
var link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID);
|
||||
var link = createLink('design', 'ajaxGetProductStories', 'productID=' + productID + '&projectID=' + projectID);
|
||||
$.post(link, function(data)
|
||||
{
|
||||
$('#story').replaceWith(data);
|
||||
|
||||
Regular → Executable
+14
-6
@@ -317,7 +317,7 @@ class designModel extends model
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF($projectID)->andWhere('project')->eq($projectID)->fi()
|
||||
->beginIF($type != 'all')->andWhere('type')->in($type)->fi()
|
||||
->andWhere('product')->eq($productID)
|
||||
->beginIF($productID)->andWhere('product')->eq($productID)->fi()
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
@@ -376,11 +376,11 @@ class designModel extends model
|
||||
|
||||
$designQuery = $this->session->designQuery;
|
||||
|
||||
$designs = $this->dao->select('*')->from(TABLE_DESIGN)
|
||||
$designs = $this->dao->select('*')->from(TABLE_DESIGN)
|
||||
->where($designQuery)
|
||||
->andWhere('deleted')->eq('0')
|
||||
->andWhere('project')->eq($projectID)
|
||||
->andWhere('product')->eq($productID)
|
||||
->beginIF($productID)->andWhere('product')->eq($productID)->fi()
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
@@ -424,9 +424,17 @@ class designModel extends model
|
||||
|
||||
if($this->app->rawMethod == 'browse') $this->lang->waterfall->menu->design['subMenu']->bysearch = array('link' => '<a href="javascript:;" class="querybox-toggle"><i class="icon-search icon"></i> ' . $this->lang->searchAB . '</a>');
|
||||
|
||||
if(empty($products) || !$productID) return '';
|
||||
$currentProduct = $this->loadModel('product')->getById($productID);
|
||||
setCookie("lastProduct", $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
if(empty($products)) return '';
|
||||
if($productID)
|
||||
{
|
||||
$currentProduct = $this->loadModel('product')->getById($productID);
|
||||
setCookie("lastProduct", $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$currentProduct = new stdclass();
|
||||
$currentProduct->name = $this->lang->product->all;
|
||||
}
|
||||
|
||||
$output = '';
|
||||
if(!empty($products))
|
||||
|
||||
Regular → Executable
+3
@@ -41,6 +41,9 @@ foreach($products as $product)
|
||||
<div class="table-col col-left">
|
||||
<div class='list-group'>
|
||||
<?php
|
||||
$selected = $productID ? '' : 'selected';
|
||||
echo html::a($this->createLink('design', 'browse', "projectID=$projectID"), $lang->product->all, '', "class=$selected data-app='$tab'");
|
||||
|
||||
if(!empty($myProductsHtml))
|
||||
{
|
||||
echo "<div class='heading'>{$lang->product->mine}</div>";
|
||||
|
||||
Regular → Executable
+1
@@ -13,6 +13,7 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php js::set('type', $type);?>
|
||||
<?php js::set('projectID', $projectID);?>
|
||||
<div id="mainContent" class="main-content fade">
|
||||
<div class="center-block">
|
||||
<div class="main-header">
|
||||
|
||||
Regular → Executable
+1
@@ -13,6 +13,7 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php js::set('type', $design->type);?>
|
||||
<?php js::set('projectID', $design->project);?>
|
||||
<div id="mainContent" class="main-content fade">
|
||||
<div class="center-block">
|
||||
<div class="main-header">
|
||||
|
||||
Regular → Executable
Reference in New Issue
Block a user