* Fix global create doc error.
This commit is contained in:
@@ -140,6 +140,7 @@ $config->openMethods[] = 'my.preference';
|
||||
$config->openMethods[] = 'my.changepassword';
|
||||
$config->openMethods[] = 'my.profile';
|
||||
$config->openMethods[] = 'my.settutorialconfig';
|
||||
$config->openMethods[] = 'doc.selectlibtype';
|
||||
|
||||
/* Define the tables. */
|
||||
define('TABLE_COMPANY', '`' . $config->db->prefix . 'company`');
|
||||
|
||||
@@ -374,7 +374,6 @@ class commonModel extends model
|
||||
|
||||
$createMethod = 'create';
|
||||
if($objectType == 'effort') $createMethod = 'batchCreate';
|
||||
if($objectType == 'doc') $createMethod = 'selectLibType';
|
||||
if(strpos('bug|execution', $objectType) !== false) $needPrintDivider = true;
|
||||
|
||||
if(common::hasPriv($objectType, $createMethod))
|
||||
@@ -397,7 +396,11 @@ class commonModel extends model
|
||||
|
||||
$params = '';
|
||||
if(strpos('bug|testcase|story', $objectType) !== false) $params = "productID=$productID";
|
||||
if($objectType == 'doc') $params = "objectType=&objectID=0&libID=0";
|
||||
if($objectType == 'doc')
|
||||
{
|
||||
$params = "objectType=&objectID=0&libID=0";
|
||||
$createMethod = 'selectLibType';
|
||||
}
|
||||
|
||||
$html .= '<li>' . html::a(helper::createLink($objectType, $createMethod, $params, '', $isOnlyBody), "<i class='icon icon-$objectIcon'></i> " . $lang->createObjects[$objectType], '', $isOnlyBody ? $attr : '') . '</li>';
|
||||
}
|
||||
|
||||
@@ -332,10 +332,11 @@ class doc extends control
|
||||
$libs = $this->doc->getLibs($objectType, $extra = "withObject,$unclosed", $libID, $objectID);
|
||||
if(!$libID and !empty($libs)) $libID = key($libs);
|
||||
|
||||
$lib = $this->doc->getLibByID($libID);
|
||||
$type = !empty($lib) ? $lib->type : 'product';
|
||||
$lib = $this->doc->getLibByID($libID);
|
||||
$type = isset($lib->type) ? $lib->type : 'product';
|
||||
$libName = isset($lib->name) ? $lib->name : 'product';
|
||||
|
||||
$this->view->title = $lib->name . $this->lang->colon . $this->lang->doc->create;
|
||||
$this->view->title = $libName . $this->lang->doc->create;
|
||||
|
||||
$this->view->libID = $libID;
|
||||
$this->view->libs = $libs;
|
||||
|
||||
Reference in New Issue
Block a user