Merge branch dev/task-146631 of zentao/zentaopms (#10475)
This commit is contained in:
@@ -392,9 +392,15 @@ class tree extends control
|
||||
*/
|
||||
public function delete(int $moduleID, string $confirm = 'no')
|
||||
{
|
||||
$module = $this->tree->getByID($moduleID);
|
||||
if($module->type == 'deliverable')
|
||||
{
|
||||
$this->app->loadLang('deliverable');
|
||||
foreach($this->lang->deliverable->moduleLang as $langCode => $langLabel) $this->lang->tree->{$langCode} = $langLabel;
|
||||
}
|
||||
|
||||
if($confirm == 'no')
|
||||
{
|
||||
$module = $this->tree->getByID($moduleID);
|
||||
$confirmLang = $this->lang->tree->confirmDelete;
|
||||
if($module->type == 'doc' or $module->type == 'api') $confirmLang = $this->lang->tree->confirmDeleteMenu;
|
||||
if($module->type == 'line') $confirmLang = $this->lang->tree->confirmDeleteLine;
|
||||
|
||||
@@ -1992,7 +1992,7 @@ class treeModel extends model
|
||||
*/
|
||||
public function update(int $moduleID, string $type = ''): bool
|
||||
{
|
||||
$module = fixer::input('post')->cleanInt('branch')->get();
|
||||
$module = fixer::input('post')->cleanInt('branch')->setDefault('parent', 0)->get();
|
||||
$self = $this->getById($moduleID);
|
||||
$changes = common::createChanges($self, $module);
|
||||
if(!isset($_POST['branch'])) $module->branch = $self->branch;
|
||||
@@ -2183,9 +2183,10 @@ class treeModel extends model
|
||||
$objectType = (!empty($module->type) && strpos($this->config->tree->groupTypes, ",$module->type,") !== false) ? 'chartgroup' : 'module';
|
||||
/* Mark deletion when delete a module. */
|
||||
$this->dao->update(TABLE_MODULE)->set('deleted')->eq(1)->where('id')->in($childs)->exec();
|
||||
foreach($childs as $childID)
|
||||
|
||||
if($module->type != 'deliverable')
|
||||
{
|
||||
$this->loadModel('action')->create($objectType, $childID, 'deleted', '', actionModel::CAN_UNDELETED);
|
||||
foreach($childs as $childID) $this->loadModel('action')->create($objectType, $childID, 'deleted', '', actionModel::CAN_UNDELETED);
|
||||
}
|
||||
|
||||
$this->fixModulePath($module->root, $module->type);
|
||||
|
||||
Reference in New Issue
Block a user