* Fix details.
This commit is contained in:
@@ -26,7 +26,7 @@ class design extends control
|
||||
parent::__construct($moduleName, $methodName);
|
||||
$products = array();
|
||||
$this->loadModel('product');
|
||||
$this->view->products = $this->products = $this->product->getPairs('nocode', $this->session->PRJ);
|
||||
$this->view->products = $this->products = $this->product->getProductsByProject($this->session->PRJ);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,7 +46,6 @@ class design extends control
|
||||
{
|
||||
/* Save session for design list and process product id. */
|
||||
$this->session->set('designList', $this->app->getURI(true));
|
||||
$productID = $this->product->saveState($productID, $this->products);
|
||||
$this->design->setProductMenu($productID);
|
||||
|
||||
/* Build the search form. */
|
||||
|
||||
@@ -393,14 +393,11 @@ class designModel extends model
|
||||
*/
|
||||
public function setProductMenu($productID = 0)
|
||||
{
|
||||
$programID = $this->session->PRJ;
|
||||
$program = $this->loadModel('project')->getByID($programID);
|
||||
$products = $this->loadModel('product')->getPairs('', $programID);
|
||||
if(empty($products)) die(js::locate(helper::createLink('product', 'create')));
|
||||
$products = $this->loadModel('product')->getPairs();
|
||||
$productID = in_array($productID, array_keys($products)) ? $productID : key($products);
|
||||
|
||||
$productID = $this->loadModel('product')->saveState($productID, $products);
|
||||
if($program->product == 'multiple') $this->loadModel('product')->setMenu($products, $productID);
|
||||
$this->loadModel('product')->setMenu($products, $productID);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -63,9 +63,9 @@
|
||||
<td class='c-actions text-center'>
|
||||
<?php
|
||||
$vars = "design={$design->id}";
|
||||
common::printIcon('design', 'edit', $vars, $design, 'list', 'fork', '', '', '', '', '', $design->program);
|
||||
common::printIcon('design', 'edit', $vars, $design, 'list', 'fork', '', '', '', '', '', $design->PRJ);
|
||||
common::printIcon('design', 'viewCommit', $vars, $design, 'list', 'list-alt', '', 'iframe showinonlybody', true);
|
||||
common::printIcon('design', 'delete', $vars, $design, 'list', 'trash', 'hiddenwin', '', '', '', '', $design->program);
|
||||
common::printIcon('design', 'delete', $vars, $design, 'list', 'trash', 'hiddenwin', '', '', '', '', $design->PRJ);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -700,9 +700,10 @@ class product extends control
|
||||
$this->view->module = $module;
|
||||
$this->view->method = $method;
|
||||
$this->view->extra = $extra;
|
||||
$products = $this->product->getProductsByProject($this->session->PRJ);
|
||||
|
||||
$product = $this->product->getByID($productID);
|
||||
$this->view->products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('id')->in(array_keys($this->products))->orderBy('`order` desc')->fetchAll('id');
|
||||
$this->view->products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('id')->in(array_keys($products))->orderBy('`order` desc')->fetchAll('id');
|
||||
$this->view->programID = $product->program;
|
||||
|
||||
$this->display();
|
||||
|
||||
@@ -88,18 +88,15 @@ class productModel extends model
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isset($project->product) and $project->product == 'multiple')
|
||||
{
|
||||
$label = $this->lang->product->index;
|
||||
$pageNav = '<div class="btn-group angle-btn' . ($currentMethod == 'index' ? ' active' : '') . '"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $label . ' <span class="caret"></span></button>';
|
||||
$pageNav .= '<ul class="dropdown-menu">';
|
||||
if($this->config->global->flow == 'full' && common::hasPriv('product', 'index')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'index', 'locate=no'), '<i class="icon icon-home"></i> ' . $this->lang->product->index) . '</li>';
|
||||
if(common::hasPriv('product', 'all')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'all'), '<i class="icon icon-cards-view"></i> ' . $this->lang->product->all) . '</li>';
|
||||
if(common::hasPriv('product', 'create')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'create'), '<i class="icon icon-plus"></i> ' . $this->lang->product->create) . '</li>';
|
||||
$label = $this->lang->product->index;
|
||||
$pageNav = '<div class="btn-group angle-btn' . ($currentMethod == 'index' ? ' active' : '') . '"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $label . ' <span class="caret"></span></button>';
|
||||
$pageNav .= '<ul class="dropdown-menu">';
|
||||
if($this->config->global->flow == 'full' && common::hasPriv('product', 'index')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'index', 'locate=no'), '<i class="icon icon-home"></i> ' . $this->lang->product->index) . '</li>';
|
||||
if(common::hasPriv('product', 'all')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'all'), '<i class="icon icon-cards-view"></i> ' . $this->lang->product->all) . '</li>';
|
||||
if(common::hasPriv('product', 'create')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'create'), '<i class="icon icon-plus"></i> ' . $this->lang->product->create) . '</li>';
|
||||
|
||||
$pageNav .= '</ul></div></div>';
|
||||
$pageNav .= $selectHtml;
|
||||
}
|
||||
$pageNav .= '</ul></div></div>';
|
||||
$pageNav .= $selectHtml;
|
||||
}
|
||||
|
||||
return $pageNav;
|
||||
|
||||
@@ -320,7 +320,7 @@ class programModel extends model
|
||||
$groupPriv = new stdclass();
|
||||
$groupPriv->account = $this->app->user->account;
|
||||
$groupPriv->group = $PRJAdminID;
|
||||
$groupPriv->program = $programID;
|
||||
$groupPriv->PRJ = $programID;
|
||||
$this->dao->insert(TABLE_USERGROUP)->data($groupPriv)->exec();
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<td class='c-name text-left pgm-title table-nest-title' title='<?php echo $program->name?>'>
|
||||
<span class="table-nest-icon icon <?php if($program->type == 'program') echo ' table-nest-toggle' ?>"></span>
|
||||
<?php if($program->type == 'program'):?>
|
||||
<?php echo html::a($this->createLink('program', 'pgmview', "programID=$program->id"), "<i class='icon icon-folder-open-o'></i>" . $program->name);?>
|
||||
<?php echo html::a($this->createLink('program', 'pgmview', "programID=$program->id"), "<i class='icon icon-folder-open-o'></i> " . $program->name);?>
|
||||
<?php else:?>
|
||||
<?php echo html::a($this->createLink('program', 'index', "programID=$program->id", '', '', $program->id), "<i class='icon icon-file'></i> " . $program->name);?>
|
||||
<?php endif;?>
|
||||
|
||||
@@ -36,7 +36,7 @@ class programplan extends control
|
||||
*/
|
||||
public function commonAction($projectID, $productID = 0, $extra = '')
|
||||
{
|
||||
$products = $this->loadModel('product')->getProductsByProject('', $projectID);
|
||||
$products = $this->loadModel('product')->getProductsByProject($projectID);
|
||||
$productID = $this->product->saveState($productID, $products);
|
||||
$this->productID = $productID;
|
||||
$this->product->setMenu($products, $productID, 0, 0, '', $extra);
|
||||
|
||||
@@ -25,7 +25,6 @@ class project extends control
|
||||
{
|
||||
$this->projects = $this->project->getPairs('nocode', $this->session->PRJ);
|
||||
if(!$this->projects and $this->methodName != 'index' and $this->methodName != 'create' and $this->app->getViewType() != 'mhtml') $this->locate($this->createLink('project', 'create'));
|
||||
if(!$this->projects and $this->methodName != 'index' and $this->methodName != 'create' and $this->app->getViewType() == 'mhtml') $this->locate($this->createLink('project', 'index'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ class repoModel extends model
|
||||
{
|
||||
$repos = $this->dao->select('*')->from(TABLE_REPO)
|
||||
->where('deleted')->eq('0')
|
||||
->andWhere("CONCAT(',', program, ',')")->like("%,{$programID},%")
|
||||
->andWhere("CONCAT(',', PRJ, ',')")->like("%,{$programID},%")
|
||||
->orderBy($orderBy)
|
||||
->page($pager)->fetchAll('id');
|
||||
|
||||
@@ -195,7 +195,7 @@ class repoModel extends model
|
||||
if(!$this->checkConnection()) return false;
|
||||
$data = fixer::input('post')
|
||||
->skipSpecial('path,client,account,password')
|
||||
->join('program', ',')
|
||||
->join('PRJ', ',')
|
||||
->get();
|
||||
|
||||
$data->acl = empty($data->acl) ? '' : json_encode($data->acl);
|
||||
@@ -237,7 +237,7 @@ class repoModel extends model
|
||||
->setDefault('prefix', $repo->prefix)
|
||||
->setIF($this->post->path != $repo->path, 'synced', 0)
|
||||
->skipSpecial('path,client,account,password')
|
||||
->join('program', ',')
|
||||
->join('PRJ', ',')
|
||||
->get();
|
||||
$data->acl = empty($data->acl) ? '' : json_encode($data->acl);
|
||||
|
||||
@@ -286,7 +286,7 @@ class repoModel extends model
|
||||
{
|
||||
$repos = $this->dao->select('*')->from(TABLE_REPO)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere("CONCAT(',', program, ',')")->like("%,{$programID},%")
|
||||
->andWhere("CONCAT(',', PRJ, ',')")->like("%,{$programID},%")
|
||||
->fetchAll();
|
||||
|
||||
$repoPairs = array();
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->repo->program; ?></th>
|
||||
<td class='required'><?php echo html::select('program[]', $programs, $this->session->PRJ, "class='form-control chosen' multiple"); ?></td>
|
||||
<td class='required'><?php echo html::select('PRJ[]', $programs, $this->session->PRJ, "class='form-control chosen' multiple"); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='thWidth'><?php echo $lang->repo->type; ?></th>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->repo->program; ?></th>
|
||||
<td class='required'><?php echo html::select('program[]', $programs, $repo->program, "class='form-control chosen' multiple"); ?></td>
|
||||
<td class='required'><?php echo html::select('PRJ[]', $programs, $repo->program, "class='form-control chosen' multiple"); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='thWidth'><?php echo $lang->repo->type; ?></th>
|
||||
|
||||
Reference in New Issue
Block a user