Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
wangyidong
2019-08-12 10:39:24 +08:00
16 changed files with 149 additions and 108 deletions
+1
View File
@@ -45,6 +45,7 @@ class doc extends control
$this->lang->modulePageActions = $this->doc->setFastMenu($this->lang->doc->fast);
$this->lang->modulePageActions .= common::hasPriv('doc', 'createLib') ? html::a(helper::createLink('doc', 'createLib'), "<i class='icon icon-plus'></i> " . $this->lang->doc->createLib, '', "class='btn btn-secondary iframe' data-width='70%'") : '';
$this->lang->modulePageActions .= common::hasPriv('doc', 'create') ? $this->doc->setCreateDocMenu() : '';
$actionURL = $this->createLink('doc', 'browse', "lib=0&browseType=bySearch&queryID=myQueryID");
$this->doc->buildSearchForm(0, array(), 0, $actionURL, 'index');
-1
View File
@@ -52,7 +52,6 @@ $(document).ready(function()
$('#module').trigger('chosen:close');
});
$('#pageActions ul.dropdown-menu').css('left', '67px');
$('.libs-group.sort').sortable(
{
trigger: '.lib',
+36 -3
View File
@@ -147,7 +147,13 @@ class docModel extends model
}
elseif($type == 'all')
{
$stmt = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->orderBy('`order`, id desc')->query();
/* Associated display Settings -> shows only unclosed projects.*/
$stmt = $this->dao->select('distinct t1.*')->from(TABLE_DOCLIB)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on("t1.project = '' || t1.project = t2.id")
->where('t1.deleted')->eq(0)
->beginIF(strpos($this->config->doc->custom->showLibs,'unclosed') !== false)->andWhere('t2.status')->notin('done,closed')->fi()
->orderBy('t1.order,t1.id desc')
->query();
}
else
{
@@ -174,7 +180,7 @@ class docModel extends model
if($lib->project != 0) $lib->name = zget($projects, $lib->project, '') . '/' . $lib->name;
}
$libPairs[$lib->id] = $lib->name;
$libPairs[$lib->id] = '/' . $lib->name;
}
}
@@ -183,7 +189,7 @@ class docModel extends model
$stmt = $this->dao->select('*')->from(TABLE_DOCLIB)->where('id')->in($appendLibs)->orderBy('`order`, id desc')->query();
while($lib = $stmt->fetch())
{
if(!isset($libPairs[$lib->id]) and $this->checkPrivLib($lib, $extra)) $libPairs[$lib->id] = $lib->name;
if(!isset($libPairs[$lib->id]) and $this->checkPrivLib($lib, $extra)) $libPairs[$lib->id] = '/' . $lib->name;
}
}
@@ -1603,6 +1609,33 @@ class docModel extends model
return $title;
}
/**
* Set document module index page create document button.
*
* @access public
* @return void
*/
public function setCreateDocMenu()
{
$libID = $this->dao->select('id')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->orderBy('id desc')->limit('1')->fetch('id');
$actions = "";
if($libID)
{
$actions .= "<div class='dropdown' id='createDropdown'>";
$actions .= "<button class='btn btn-primary' type='button' data-toggle='dropdown'><i class='icon icon-plus'></i>" . $this->lang->doc->create . "<span class='caret'></span></button>";
$actions .= "<ul class='dropdown-menu' style='left:0px'>";
foreach($this->lang->doc->typeList as $typeKey => $typeName)
{
$class = strpos($this->config->doc->officeTypes, $typeKey) !== false ? 'iframe' : '';
$actions .= "<li>";
$actions .= html::a(helper::createLink('doc', 'create', "libID=$libID&moduleID=0&type=$typeKey"), $typeName, '', "class='$class'");
$actions .= "</li>";
}
$actions .="</ul></div>";
}
return $actions;
}
public function setFastMenu($fastLib)
{
$actions = '';