* Fix bug #34337.
This commit is contained in:
@@ -1054,7 +1054,7 @@ class doc extends control
|
||||
if(empty($viewType)) $viewType = !empty($_COOKIE['docFilesViewType']) ? $this->cookie->docFilesViewType : 'list';
|
||||
setcookie('docFilesViewType', $viewType, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
|
||||
$objects = $this->doc->getOrderedObjects($type);
|
||||
$objects = $this->doc->getOrderedObjects($type, 'nomerge', $objectID);
|
||||
list($libs, $libID, $object, $objectID, $objectDropdown) = $this->doc->setMenuByType($type, $objectID, 0);
|
||||
|
||||
$table = $this->config->objectTables[$type];
|
||||
@@ -1145,8 +1145,6 @@ class doc extends control
|
||||
$objectID = zget($doc, $type, 0);
|
||||
list($libs, $libID, $object, $objectID, $objectDropdown) = $this->doc->setMenuByType($type, $objectID, $doc->lib, $appendLib);
|
||||
|
||||
$moduleTree = $this->doc->getTreeMenu($type, $objectID, $libID, 0, $docID);
|
||||
|
||||
/* Get doc. */
|
||||
if($docID)
|
||||
{
|
||||
@@ -1223,6 +1221,8 @@ class doc extends control
|
||||
}
|
||||
}
|
||||
|
||||
if($this->app->tab != 'execution' and !empty($doc->execution)) $object = $this->execution->getByID($doc->execution);
|
||||
|
||||
$this->view->title = $this->lang->doc->common . $this->lang->colon . $doc->title;
|
||||
$this->view->docID = $docID;
|
||||
$this->view->doc = $doc;
|
||||
@@ -1473,7 +1473,7 @@ class doc extends control
|
||||
*/
|
||||
public function ajaxGetDropMenu($objectType, $objectID, $module, $method)
|
||||
{
|
||||
list($myObjects, $normalObjects, $closedObjects) = $this->doc->getOrderedObjects($objectType, 'nomerge');
|
||||
list($myObjects, $normalObjects, $closedObjects) = $this->doc->getOrderedObjects($objectType, 'nomerge', $objectID);
|
||||
|
||||
$this->view->objectType = $objectType;
|
||||
$this->view->objectID = $objectID;
|
||||
|
||||
+11
-5
@@ -1683,15 +1683,17 @@ class docModel extends model
|
||||
*
|
||||
* @param string $objectType
|
||||
* @param string $returnType nomerge|merge
|
||||
* @param int $append
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getOrderedObjects($objectType = 'product', $returnType = 'merge')
|
||||
public function getOrderedObjects($objectType = 'product', $returnType = 'merge', $append = 0)
|
||||
{
|
||||
$myObjects = $normalObjects = $closedObjects = array();
|
||||
if($objectType == 'product')
|
||||
{
|
||||
$products = $this->loadModel('product')->getList();
|
||||
if($append and !isset($products[$append])) $products[$append] = $this->product->getByID($append);
|
||||
foreach($products as $id => $product)
|
||||
{
|
||||
if($product->status == 'normal' and $product->PO == $this->app->user->account)
|
||||
@@ -1723,8 +1725,9 @@ class docModel extends model
|
||||
->leftjoin(TABLE_DOCLIB)->alias('t2')->on('t2.project=t1.id')
|
||||
->where("CONCAT(',', t2.users, ',')")->like("%,{$this->app->user->account},%")
|
||||
->andWhere('t1.vision')->eq($this->config->vision)
|
||||
->beginIF($this->config->vision == 'rnd')->andWhere('model')->ne('kanban')->fi()
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->beginIF($this->config->vision == 'rnd')->andWhere('model')->ne('kanban')->fi()
|
||||
->beginIF($append)->orWhere('t1.id')->eq($append)->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->projects)->fi()
|
||||
->fetchPairs();
|
||||
}
|
||||
@@ -1735,6 +1738,7 @@ class docModel extends model
|
||||
->andWhere('deleted')->eq(0)
|
||||
->beginIF($this->config->vision == 'rnd')->andWhere('model')->ne('kanban')->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
|
||||
->beginIF($append)->orWhere('id')->eq($append)->fi()
|
||||
->orderBy('order_asc')
|
||||
->fetchAll('id');
|
||||
|
||||
@@ -1771,6 +1775,7 @@ class docModel extends model
|
||||
->andWhere('multiple')->eq('1')
|
||||
->andWhere('vision')->eq($this->config->vision)
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi()
|
||||
->beginIF($append)->orWhere('id')->eq($append)->fi()
|
||||
->orderBy('order_asc')
|
||||
->fetchAll('id');
|
||||
|
||||
@@ -2773,10 +2778,11 @@ class docModel extends model
|
||||
if($this->app->tab == 'doc' and $type == 'execution') $type = 'project';
|
||||
|
||||
$objectDropdown = '';
|
||||
$appendObject = $objectID;
|
||||
if(in_array($type, array('project', 'product', 'execution')))
|
||||
{
|
||||
$table = $this->config->objectTables[$type];
|
||||
$object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch();
|
||||
$object = $this->dao->select('id,name,status,deleted')->from($table)->where('id')->eq($objectID)->fetch();
|
||||
|
||||
if(empty($object))
|
||||
{
|
||||
@@ -2785,7 +2791,7 @@ class docModel extends model
|
||||
return print(js::locate(helper::createLink($type, $methodName, $param)));
|
||||
}
|
||||
|
||||
$objects = $this->getOrderedObjects($type);
|
||||
$objects = $this->getOrderedObjects($type, 'merge', $objectID);
|
||||
$objectID = $this->loadModel($type)->saveState($objectID, $objects);
|
||||
$libs = $this->getLibsByObject($type, $objectID, '', $appendLib);
|
||||
if(($libID == 0 or !isset($libs[$libID])) and !empty($libs)) $libID = reset($libs)->id;
|
||||
@@ -2798,7 +2804,7 @@ class docModel extends model
|
||||
}
|
||||
else
|
||||
{
|
||||
$objectDropdown = $this->select($type, $objectTitle, $objectID);
|
||||
$objectDropdown = $this->select($type, $objectTitle, $appendObject);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<?php $gobackLink = $this->session->docList ? $this->session->docList : inlink('teamSpace', "objectID=0&libID=$libID");?>
|
||||
<?php echo html::a($gobackLink, "<i class='icon-back'></i> " . $lang->goback, '', "class='btn btn-link'");?>
|
||||
</div>
|
||||
<?php if(empty($object->deleted)):?>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php
|
||||
if($canExport) echo html::a($this->createLink('doc', $exportMethod, "libID=$libID&moduleID=0&docID=$docID"), "<i class='icon-export muted'> </i>" . $lang->export, 'hiddenwin', "class='btn btn-link' id='docExport'");
|
||||
@@ -34,13 +35,16 @@
|
||||
if(common::hasPriv('doc', 'create')) echo $this->doc->printCreateBtn($lib, $moduleID);
|
||||
?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div id='mainContent'class="fade flex">
|
||||
<?php if($libID):?>
|
||||
<?php if(empty($object->deleted)):?>
|
||||
<div id='sideBar' class="panel side side-col col overflow-auto h-full-adjust">
|
||||
<?php include 'lefttree.html.php';?>
|
||||
</div>
|
||||
<div class="sidebar-toggle flex-center"><i class="icon icon-angle-left"></i></div>
|
||||
<?php endif;?>
|
||||
<div class="main-col h-full-adjust" data-min-width="400">
|
||||
<?php if($docID):?>
|
||||
<?php include './content.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user