* fix bug #33745.
This commit is contained in:
@@ -3144,17 +3144,16 @@ class docModel extends model
|
||||
* Print create document button.
|
||||
*
|
||||
* @param object $lib
|
||||
* @param type $type project|product|custom
|
||||
* @param int $objectID
|
||||
* @param int $moduleID
|
||||
* @param string $from list
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function printCreateBtn($lib, $type, $objectID, $moduleID, $from = '')
|
||||
public function printCreateBtn($lib, $moduleID, $from = '')
|
||||
{
|
||||
if(!common::hasPriv('doc', 'create') or !isset($lib->id)) return null;
|
||||
|
||||
$objectID = zget($lib, $lib->type, 0);
|
||||
$class = $from == 'list' ? 'btn-info' : 'btn-primary';
|
||||
$html = "<div class='dropdown btn-group createDropdown'>";
|
||||
$html .= html::a(helper::createLink('doc', 'create', "objectType={$lib->type}&objectID=$objectID&libID={$lib->id}&moduleID=$moduleID&type=html"), "<i class='icon icon-plus'></i> {$this->lang->doc->create}", '', "class='btn $class'");
|
||||
@@ -3168,7 +3167,7 @@ class docModel extends model
|
||||
$attr = "data-app='{$this->app->tab}'";
|
||||
$class = strpos($this->config->doc->officeTypes, $typeKey) !== false ? 'iframe' : '';
|
||||
$params = "objectType={$lib->type}&objectID=$objectID&libID={$lib->id}&moduleID=$moduleID&type=$typeKey";
|
||||
if($typeKey == 'template') $params = "objectType=$type&objectID=$objectID&libID={$lib->id}&moduleID=$moduleID&type=html&from=template";
|
||||
if($typeKey == 'template') $params = "objectType={$lib->type}&objectID=$objectID&libID={$lib->id}&moduleID=$moduleID&type=html&from=template";
|
||||
|
||||
$html .= "<li>";
|
||||
$html .= html::a(helper::createLink('doc', 'create', $params, '', $class ? true : false), $typeName, '', "class='$class' $attr");
|
||||
|
||||
@@ -35,7 +35,7 @@ body {margin-bottom: 25px;}
|
||||
<?php
|
||||
if($browseType != 'bySearch' and $libID and (common::hasPriv('doc', 'create') or (common::hasPriv('api', 'create') and !$apiLibID)))
|
||||
{
|
||||
echo $this->doc->printCreateBtn($lib, $type, $objectID, $moduleID, 'list');
|
||||
echo $this->doc->printCreateBtn($lib, $moduleID, 'list');
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
|
||||
@@ -41,7 +41,7 @@ body {margin-bottom: 25px;}
|
||||
<?php
|
||||
if($browseType != 'bysearch' and $libID and common::hasPriv('doc', 'create'))
|
||||
{
|
||||
echo $this->doc->printCreateBtn($lib, $type, $objectID, $moduleID, 'list');
|
||||
echo $this->doc->printCreateBtn($lib, $moduleID, 'list');
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
echo html::a(helper::createLink('doc', 'createLib', "type=mine"), '<i class="icon icon-plus"></i> ' . $this->lang->doc->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
|
||||
}
|
||||
|
||||
if($libID and common::hasPriv('doc', 'create')) echo $this->doc->printCreateBtn($lib, 'mine', 0, $moduleID);
|
||||
if($libID and common::hasPriv('doc', 'create')) echo $this->doc->printCreateBtn($lib, $moduleID);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
}
|
||||
elseif($libID and common::hasPriv('doc', 'create'))
|
||||
{
|
||||
echo $this->doc->printCreateBtn($lib, $type, $objectID, $moduleID);
|
||||
echo $this->doc->printCreateBtn($lib, $moduleID);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<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'");
|
||||
if(common::hasPriv('doc', 'create')) echo $this->doc->printCreateBtn($lib, $type, $objectID, $moduleID);
|
||||
if(common::hasPriv('doc', 'create')) echo $this->doc->printCreateBtn($lib, $moduleID);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user