* Fix project set menu.

This commit is contained in:
sgm0422
2020-06-15 14:35:21 +08:00
parent 1f162f9c35
commit ca21685f4b
4 changed files with 21 additions and 21 deletions
+1
View File
@@ -300,6 +300,7 @@ class productModel extends model
$products = $this->dao->select('*, IF(INSTR(" closed", status) < 2, 0, 1) AS isClosed')
->from(TABLE_PRODUCT)
->where('deleted')->eq(0)
->andWhere('program')->eq($this->session->program)
->beginIF(strpos($mode, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->products)->fi()
->orderBy($orderBy)
+4
View File
@@ -81,6 +81,10 @@
<?php echo html::textarea('desc', $project->desc, "rows='6' class='form-control kindeditor' hidefocus='true'");?>
</td>
</tr>
<tr>
<th><?php echo $lang->program->privway;?></th>
<td colspan='3'><?php echo html::radio('privway', $lang->program->privwayList, $project->privway, '', 'block');?></td>
</tr>
<tr>
<th><?php echo $lang->project->acl;?></th>
<td colspan='3'><?php echo nl2br(html::radio('acl', $lang->program->aclList, $project->acl, "onclick='setWhite(this.value);'", 'block'));?></td>
+13 -14
View File
@@ -118,8 +118,7 @@ class projectModel extends model
}
$projectIndex .= '</ul></div></div>';
$this->lang->programSwapper = $selectHtml;
$projectIndex .= $selectHtml;
}
$this->lang->modulePageNav = $projectIndex;
@@ -169,23 +168,18 @@ class projectModel extends model
*/
public function select($projects, $projectID, $buildID, $currentModule, $currentMethod, $extra = '')
{
if(!$projectID) return;
$isMobile = $this->app->viewType == 'mhtml';
$currentProjectName = '';
if($projectID)
{
setCookie("lastProject", $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$currentProject = $this->getById($projectID);
$currentProjectName = $currentProject->name;
}
else if($isMobile) return;
else $currentProjectName = $this->lang->project->allProjects;
setCookie("lastProject", $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$currentProject = $this->getById($projectID);
$dropMenuLink = helper::createLink('project', 'ajaxGetDropMenu', "objectID=$projectID&module=$currentModule&method=$currentMethod&extra=$extra");
$output = "<div class='btn-group' id='swapper'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem' title='{$currentProjectName}'>{$currentProjectName} <i class='icon icon-swap'></i></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
$output = "<div class='btn-group angle-btn'><div class='btn-group'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem' title='{$currentProject->name}'>{$currentProject->name} <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
$output .= "</div></div>";
if($isMobile) $output = "<a id='currentItem' href=\"javascript:showSearchMenu('project', '$projectID', '$currentModule', '$currentMethod', '$extra')\">{$currentProjectName} <span class='icon-caret-down'></span></a><div id='currentItemDropMenu' class='hidden affix enter-from-bottom layer'></div>";
$output .= "</div></div></div>";
if($isMobile) $output = "<a id='currentItem' href=\"javascript:showSearchMenu('project', '$projectID', '$currentModule', '$currentMethod', '$extra')\">{$currentProject->name} <span class='icon-caret-down'></span></a><div id='currentItemDropMenu' class='hidden affix enter-from-bottom layer'></div>";
return $output;
}
@@ -682,6 +676,7 @@ class projectModel extends model
/* Order by status's content whether or not done */
$projects = $this->dao->select('*, IF(INSTR(" done,closed", status) < 2, 0, 1) AS isDone')->from(TABLE_PROJECT)
->where('iscat')->eq(0)
->andWhere('program')->eq($this->session->program)
->beginIF(strpos($mode, 'withdelete') === false)->andWhere('deleted')->eq(0)->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
->orderBy($orderBy)
@@ -736,6 +731,8 @@ class projectModel extends model
->where('t1.product')->eq($productID)
->andWhere('t2.deleted')->eq(0)
->andWhere('t2.iscat')->eq(0)
->andWhere('t2.program')->eq($this->session->program)
->andWhere('t2.template')->eq('')
->beginIF($status == 'undone')->andWhere('t2.status')->notIN('done,closed')->fi()
->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi()
@@ -751,6 +748,8 @@ class projectModel extends model
->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
->andWhere('deleted')->eq(0)
->andWhere('program')->eq($this->session->program)
->andWhere('t2.template')->eq('')
->orderBy('order_desc')
->beginIF($limit)->limit($limit)->fi()
->fetchAll('id');
+3 -7
View File
@@ -49,16 +49,12 @@ foreach($projects as $project)
?>
</div>
<div class="col-footer">
<?php echo html::a(helper::createLink('program', 'createguide'), '<i class="icon icon-plus"></i>' . $lang->project->create, '', 'class="not-list-item text-primary" data-toggle="modal" data-type="ajax"'); ?>
<div class='pull-right'>
<?php echo html::a(helper::createLink('program', 'index', 'status=all'), '<i class="icon icon-cards-view muted"></i> ' . $lang->project->all, '', 'class="not-list-item"'); ?>
<span class='text-muted muted'> &nbsp; | &nbsp; </span>
<a class='toggle-right-col not-list-item'><?php echo $lang->project->doneProjects?><i class='icon icon-angle-right'></i></a>
</div>
<?php echo html::a(helper::createLink('project', 'all'), '<i class="icon icon-cards-view muted"></i> ' . $lang->project->all, '', 'class="not-list-item"'); ?>
<a class='pull-right toggle-right-col not-list-item'><?php echo $lang->project->doneProjects?><i class='icon icon-angle-right'></i></a>
</div>
</div>
<div class="table-col col-right">
<div class='list-group'>
<div class='list-group'>
<?php
echo $closedProjectsHtml;
?>