This commit is contained in:
hufangzhou
2021-12-08 16:20:08 +08:00
parent 687ebe8a5d
commit 6da1c0d285
3 changed files with 12 additions and 4 deletions
+8 -2
View File
@@ -201,13 +201,19 @@ class doc extends control
$actionID = $this->action->create('docLib', $libID, 'edited');
$this->action->logHistory($actionID, $changes);
}
$docLib = $this->doc->getLibById($libID);
$docLib = $this->doc->getLibById($libID);
$objectID = 0;
if(strpos('product,project,execution', $docLib->type) !== false)
{
$libType = $docLib->type;
$objectID = $docLib->$libType;
}
$hasLibPriv = $this->doc->checkPrivLib($docLib) ? 1 : 0;
$response['message'] = $this->lang->saveSuccess;
$response['result'] = 'success';
$response['closeModal'] = true;
$response['callback'] = "redirectParentWindow($hasLibPriv, $libID)";
$response['callback'] = "redirectParentWindow($hasLibPriv, $libID, $objectID)";
return $this->send($response);
}
+3 -2
View File
@@ -8,11 +8,12 @@ $(function()
*
* @param int hasLibPriv
* @param int libID
* @param int objectID
* @access public
* @return void
*/
function redirectParentWindow(hasLibPriv, libID)
function redirectParentWindow(hasLibPriv, libID, objectID)
{
var link = hasLibPriv ? createLink('doc', 'tableContents', 'type=' + libType + '&objectID=0&libID=' + libID) : createLink('doc', 'tableContents', 'type=' + libType);
var link = hasLibPriv ? createLink('doc', 'tableContents', 'type=' + libType + '&objectID=' + objectID + '&libID=' + libID) : createLink('doc', 'tableContents', 'type=' + libType);
parent.location.href = link;
}
+1
View File
@@ -2562,6 +2562,7 @@ EOT;
if($this->app->tab == 'doc') $this->app->rawMethod = $type;
$object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch();
if(empty($object)) die(js::locate(helper::createLink($type, 'create')));
}