* Fix doc.

This commit is contained in:
Yagami
2021-04-02 14:58:20 +08:00
parent 054cb8a1ab
commit 7e7af669a5
6 changed files with 22 additions and 17 deletions
+6 -3
View File
@@ -259,7 +259,10 @@ class doc extends control
$actionID = $this->action->create('docLib', $libID, 'edited');
$this->action->logHistory($actionID, $changes);
}
die(js::locate($this->createLink($this->moduleName, 'browse', "libID=$libID"), 'parent.parent'));
$response['message'] = $this->lang->saveSuccess;
$response['result'] = 'success';
$response['locate'] = 'parent';
$this->send($response);
}
$lib = $this->doc->getLibByID($libID);
@@ -294,7 +297,7 @@ class doc extends control
if(!empty($lib->main)) die(js::alert($this->lang->doc->errorMainSysLib));
$this->doc->delete(TABLE_DOCLIB, $libID);
die(js::locate($this->createLink('doc', 'browse'), 'parent'));
die(js::locate($this->createLink('doc', 'index'), 'parent'));
}
}
@@ -947,7 +950,7 @@ class doc extends control
$this->view->type = $type;
$this->view->object = $object;
$this->view->libID = $libID;
$this->view->lib = $libs[$libID];
$this->view->lib = isset($libs[$libID]) ? $libs[$libID] : array();
$this->view->libs = $this->doc->getLibsByObject($type, $objectID);
$this->view->moduleTree = $moduleTree;
$this->view->canBeChanged = common::canModify($type, $object); // Determines whether an object is editable.
+9 -8
View File
@@ -1857,7 +1857,6 @@ EOF;
if(empty($objects)) return '';
$output = '';
$dropMenuLink = helper::createLink('repo', 'ajaxGetDropMenu');
$output = "<div class='btn-group angle-btn'><div class='btn-group'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem' title='{$objects[$objectID]}'><span class='text'>{$objects[$objectID]}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList'>";
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
@@ -1868,15 +1867,17 @@ EOF;
}
$output .= "</div></div></div></div></div>";
$dropMenuLink = helper::createLink('repo', 'ajaxGetBranchDropMenu');
$output .= "<div class='btn-group angle-btn'><div class='btn-group'><button id='currentBranch' data-toggle='dropdown' type='button' class='btn btn-limit'>{$libs[$libID]->name} <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList'>";
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
$output .= "<div class='table-col'><div class='list-group'>";
foreach($libs as $key => $lib)
if(!empty($libs))
{
$output .= html::a(inlink('objectLibs', "type=$type&objectID=$objectID&libID=$key"), $lib->name);
$output .= "<div class='btn-group angle-btn'><div class='btn-group'><button id='currentBranch' data-toggle='dropdown' type='button' class='btn btn-limit'>{$libs[$libID]->name} <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList'>";
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
$output .= "<div class='table-col'><div class='list-group'>";
foreach($libs as $key => $lib)
{
$output .= html::a(inlink('objectLibs', "type=$type&objectID=$objectID&libID=$key"), $lib->name);
}
$output .= "</div></div></div></div></div>";
}
$output .= "</div></div></div></div></div>";
return $output;
}
+1 -1
View File
@@ -17,7 +17,7 @@
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
<h2><?php echo $lang->doc->createlib;?></h2>
<h2><?php echo $lang->doc->createLib;?></h2>
</div>
<form method='post' target='hiddenwin' >
<table class='table table-form'>
+2 -2
View File
@@ -17,10 +17,10 @@
<div class='main-header'>
<h2>
<span class='prefix'><?php echo html::icon($lang->icons['doclib']);?></span>
<?php echo $lang->doc->editlib;?>
<?php echo $lang->doc->editLib;?>
</h2>
</div>
<form method='post' target='hiddenwin'>
<form method='post' class='form-ajax'>
<table class='table table-form'>
<?php if(!empty($lib->product)):?>
<tr>
+3 -3
View File
@@ -25,9 +25,9 @@ $sideWidth = common::checkNotCN() ? '270' : '238';
<?php endif;?>
<?php echo $moduleTree;?>
<div class="text-center action">
<?php common::printLink('tree', 'browse', "rootID=$libID&view=doc", $lang->doc->manageType, '', "class='btn btn-info btn-wide'");?>
<?php common::printLink('tree', 'browse', "rootID=0&view=doc", $lang->doc->editLib, '', "class='btn btn-info btn-wide'");?>
<?php common::printLink('tree', 'browse', "rootID=0&view=doc", $lang->doc->deleteLib, '', "class='btn btn-info btn-wide'");?>
<?php common::printLink('tree', 'browse', "rootID=$libID&view=doc", $lang->doc->manageType, '', "class='btn btn-info btn-wide iframe'", '', true);?>
<?php common::printLink('doc', 'editLib', "rootID=$libID", $lang->doc->editLib, '', "class='btn btn-info btn-wide iframe'", '', true);?>
<?php common::printLink('doc', 'deleteLib', "rootID=$libID", $lang->doc->deleteLib, 'hiddenwin', "class='btn btn-info btn-wide'");?>
<hr class="space-sm" />
</div>
</div>
+1
View File
@@ -374,6 +374,7 @@ class tree extends control
{
$this->tree->manageChild($rootID, $viewType);
if($viewType == 'doc' and isonlybody()) die(js::reload('parent.parent'));
if(isonlybody()) die(js::closeModal('parent.parent', '', "function(){parent.parent.$('a.refresh').click()}"));
die(js::reload('parent'));