Merge branch 'tsj_docTree' into 'master'

* Code for task #89915.

See merge request easycorp/zentaopms!7316
This commit is contained in:
王怡栋
2023-04-06 00:52:45 +00:00
31 changed files with 464 additions and 280 deletions
+34 -48
View File
@@ -41,12 +41,16 @@ class api extends control
*/
public function index($libID = 0, $moduleID = 0, $apiID = 0, $version = 0, $release = 0, $appendLib = 0, $browseType = '', $param = 0)
{
$objectType = $this->objectType;
$objectID = $this->objectID;
$this->session->set('spaceType', 'api', 'doc');
$this->session->set('structList', $this->app->getURI(true), 'doc');
$this->setMenu($libID);
$objectType = $this->objectType;
$objectID = $this->objectID;
$isFirstLoad = $libID ? false : true;
/* Get all api doc libraries. */
$loadLib = false;
$libs = $this->doc->getApiLibs($appendLib, $objectType, $objectID);
$libs = $this->doc->getApiLibs($appendLib, $objectType, $objectID);
if(empty($libs) and $objectType != 'nolink')
{
$objectType = 'nolink';
@@ -78,7 +82,6 @@ class api extends control
$libID = $lib->id;
$objectType = $lib->product ? 'product' : ($lib->project ? 'project' : '');
$objectID = $lib->product ? $lib->product : $lib->project;
if($loadLib) $libs = $this->doc->getApiLibs($appendLib);
}
/* Get an api doc. */
@@ -112,6 +115,7 @@ class api extends control
$this->view->lib = $lib;
$this->view->release = $release;
$this->view->isFirstLoad = $isFirstLoad;
$this->view->title = $this->lang->api->pageTitle;
$this->view->libID = $libID;
$this->view->apiID = $apiID;
@@ -141,10 +145,11 @@ class api extends control
*/
public function view($libID, $apiID, $moduleID = 0, $release = 0, $version = 0)
{
$this->setMenu($libID);
/* Get all api doc libraries. */
$libs = $this->doc->getApiLibs($libID);
$api = $this->api->getLibById($apiID, $version, $release);
$api = $this->api->getLibById($apiID, $version, $release);
if($api)
{
$moduleID = $api->module;
@@ -244,7 +249,7 @@ class api extends control
$this->api->publishLib($data);
if(dao::isError()) return $this->sendError(dao::getError());
return $this->sendSuccess(array('locate' => $this->createLink('api', 'index', "libID=$libID")));
return $this->sendSuccess(array('locate' => 'parent'));
}
$libName = isset($lib->name) ? $lib->name : '';
@@ -265,16 +270,14 @@ class api extends control
* @access public
* @return void
*/
public function struct($libID = 0, $releaseID = 0, $orderBy = 'id', $recTotal = 0, $recPerPage = 15, $pageID = 1)
public function struct($libID = 0, $releaseID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
{
$libs = $this->doc->getApiLibs();
$this->app->loadClass('pager', $static = true);
$this->lang->modulePageNav = $this->generateLibsDropMenu($libs[$libID], $releaseID);
$pager = new pager($recTotal, $recPerPage, $pageID);
$this->setMenu($libID);
/* Append id for secend sort. */
$sort = common::appendOrder($orderBy);
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
if($releaseID)
{
@@ -306,6 +309,8 @@ class api extends control
public function createStruct($libID = 0)
{
common::setMenuVars('doc', $libID);
$this->setMenu($libID);
if(!empty($_POST))
{
$now = helper::now();
@@ -351,6 +356,8 @@ class api extends control
public function editStruct($libID, $structID)
{
common::setMenuVars('doc', $libID);
$this->setMenu($libID);
$struct = $this->api->getStructByID($structID);
if(!empty($_POST))
@@ -621,7 +628,7 @@ class api extends control
}
else
{
$this->sendSuccess(array('locate' => $this->createLink('api', 'index', "libID=$api->lib&module=$api->module")));
return print(js::locate(inlink('index', "libID=$api->lib&module=$api->module"), 'parent'));
}
}
}
@@ -695,53 +702,32 @@ class api extends control
}
/**
* Set doc menu by method name.
* Set api menu by method name.
*
* @param int $libID
* @param int $moduleID
* @access public
* @return void
*/
private function setMenu($libID = 0, $moduleID = 0)
private function setMenu($libID = 0)
{
common::setMenuVars('doc', '');
/* Global struct link. */
$menu = '';
if($libID and common::hasPriv('api', 'createRelease'))
$lib = $this->loadModel('doc')->getLibByID($libID);
if($this->app->tab == 'product')
{
$menu .= html::a(helper::createLink('api', 'createRelease', "libID=$libID"), $this->lang->api->createRelease, '', 'class="btn btn-link iframe"');
$this->loadModel('product')->setMenu($lib->product);
}
elseif($this->app->tab == 'project')
{
$this->loadModel('project')->setMenu($lib->project);
}
/* page of index menu. */
if(common::hasPriv('api', 'create') or common::hasPriv('api', 'createLib'))
if(in_array($this->session->spaceType, array('product', 'project')))
{
$menu .= "<div class='dropdown' id='createDropdown'>";
$menu .= "<button class='btn btn-primary' type='button' data-toggle='dropdown'><i class='icon icon-plus'></i> " . $this->lang->api->createAB . " <span class='caret'></span></button>";
$menu .= "<ul class='dropdown-menu pull-right'>";
/* check has permission create api doc */
if(intval($libID) > 0 and common::hasPriv('api', 'create'))
{
$menu .= "<li>";
$menu .= html::a(helper::createLink('api', 'create', "libID=$libID&moduleID=$moduleID"), "<i class='icon-rich-text icon'></i> " . $this->lang->api->createApi, '', "data-app='{$this->app->tab}'");
$menu .= "</li>";
}
/* check has permission create api doc lib */
if(common::hasPriv('api', 'createLib'))
{
$menu .= '<li>' . html::a(helper::createLink('api', 'createLib'), "<i class='icon-doc-lib icon'></i> " . $this->lang->api->createLib, '', "class='iframe' data-width='70%'") . '</li>';
$menu .= '<li class="divider"></li>';
$menu .= '<li>' . html::a(helper::createLink('api', 'createLib', 'type=demo'), "<i class='icon-zentao icon'></i> " . $this->lang->api->createDemo, '', "class='iframe' data-width='70%'") . '</li>';
}
$menu .= "</ul></div>";
$this->lang->doc->menu->api['exclude'] = 'api-' . $this->app->rawMethod;
$this->lang->doc->menu->{$this->session->spaceType}['subModule'] = 'api';
}
$this->lang->TRActions = $menu;
}
/**
+1 -1
View File
@@ -119,7 +119,7 @@ form .table-data, #content .table-data {border: 1px solid #e2e2e3;}
.main-col .doc-title .info {flex: 1 1 0;}
.main-col .doc-title .version a {font-size: 13px; color: #8c8c8c;}
.main-col .doc-title .version .dropdown-menu a:hover {color: #ffffff;}
.main-col .doc-title .actions {min-width: 120px; display: inline-block;}
.main-col .doc-title .actions {display: inline-block;}
.main-col .doc-title .actions a + a {margin-left: 8px;}
.main-col .doc-title .actions i {font-size: 15px; color: #8c8c8c;}
#content h2.title {margin: 0; font-size: 17px;}
+5 -12
View File
@@ -1,12 +1,5 @@
.col-attr {
vertical-align: middle;
margin-bottom: 8px;
}
.tree {
padding-left: 30px!important;
}
.c-date {
width: 200px;
}
.col-attr {vertical-align: middle; margin-bottom: 8px;}
.tree {padding-left: 30px!important;}
.leftBar > .btn {margin-right: 0px;}
.leftBar > .divider {color: #D9D9D9;}
.leftBar > .page-title > .text {font-weight: 400;}
-13
View File
@@ -1,13 +0,0 @@
$(document).ready(function()
{
$('#apiForm').ajaxForm({
success: (data) => {
if (data.result == 'success') {
if (data.locate) {
window.parent.location.href = data.locate
}
$.zui.closeModal()
}
}
})
});
-96
View File
@@ -1,96 +0,0 @@
/**
* Ajax delete api doc.
*
* @param string $link
* @param int $replaceID
* @param stirng $notice
* @access public
* @return void
*/
function ajaxDeleteApi(link, replaceID)
{
if(confirm(confirmDelete))
{
$.get(link, function(data)
{
location.href = JSON.parse(data).locate;
});
}
}
/**
* Display the document in full screen.
*
* @access public
* @return void
*/
function fullScreen()
{
var element = document.getElementById('content');
var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;
if(requestMethod)
{
var afterEnterFullscreen = function()
{
$('#mainActions').removeClass('hidden');
$('#content').addClass('scrollbar-hover');
$('#content .actions').addClass('hidden');
$.cookie('isFullScreen', 1);
};
var whenFailEnterFullscreen = function(error)
{
$.cookie('isFullScreen', 0);
};
try
{
var result = requestMethod.call(element);
if(result && (typeof result.then === 'function' || result instanceof window.Promise))
{
result.then(afterEnterFullscreen).catch(whenFailEnterFullscreen);
}
else
{
afterEnterFullscreen();
}
}
catch (error)
{
whenFailEnterFullscreen(error);
}
}
}
/**
* Exit full screen.
*
* @access public
* @return void
*/
function exitFullScreen()
{
$('#mainActions').addClass('hidden');
$('#content').removeClass('scrollbar-hover');
$('#content .actions').removeClass('hidden');
$.cookie('isFullScreen', 0);
}
document.addEventListener('fullscreenchange', function (e)
{
if(!document.fullscreenElement) exitFullScreen();
});
document.addEventListener('webkitfullscreenchange', function (e)
{
if(!document.webkitFullscreenElement) exitFullScreen();
});
document.addEventListener('mozfullscreenchange', function (e)
{
if(!document.mozFullScreenElement) exitFullScreen();
});
document.addEventListener('msfullscreenChange', function (e)
{
if(!document.msfullscreenElement) exitFullScreen();
});
+1
View File
@@ -87,6 +87,7 @@ $lang->struct->desc = 'Description';
$lang->struct->descPlaceholder = 'Parameter Description';
$lang->struct->action = 'Action';
$lang->struct->addSubField = 'Add Subfield';
$lang->struct->list = 'Data Structure List';
$lang->struct->typeOptions = array(
'formData' => 'FormData',
+1
View File
@@ -87,6 +87,7 @@ $lang->struct->desc = 'Description';
$lang->struct->descPlaceholder = 'Parameter Description';
$lang->struct->action = 'Action';
$lang->struct->addSubField = 'Add Subfield';
$lang->struct->list = 'Data Structure List';
$lang->struct->typeOptions = array(
'formData' => 'FormData',
+1
View File
@@ -87,6 +87,7 @@ $lang->struct->desc = 'Description';
$lang->struct->descPlaceholder = 'Parameter Description';
$lang->struct->action = 'Action';
$lang->struct->addSubField = 'Add Subfield';
$lang->struct->list = 'Data Structure List';
$lang->struct->typeOptions = array(
'formData' => 'FormData',
+1
View File
@@ -87,6 +87,7 @@ $lang->struct->desc = '描述';
$lang->struct->descPlaceholder = '参数说明';
$lang->struct->action = '操作';
$lang->struct->addSubField = '添加子字段';
$lang->struct->list = '数据结构列表';
$lang->struct->typeOptions = array(
'formData' => 'FormData',
+2 -2
View File
@@ -93,7 +93,7 @@
{
if($app->rawModule == 'doc')
{
echo html::a($this->createLink('api', 'create', "libID=$libID&moduleID=$moduleID", '', true), '<i class="icon icon-plus"></i> ' . $lang->api->createApi, '', 'class="btn btn-info iframe" data-width="95%"');
echo html::a($this->createLink('api', 'create', "libID=$libID&moduleID=$moduleID", '', true), '<i class="icon icon-plus"></i> ' . $lang->api->createApi, '', 'class="btn btn-info iframe" data-width="95%"');
}
else
{
@@ -115,7 +115,7 @@
<?php foreach($apiList as $api):?>
<li class="list-group-item">
<div class="heading <?php echo $api->method;?>">
<a href="<?php echo helper::createLink('api', 'index', "libID={$api->lib}&moduleID=0&apiID={$api->id}&version=0&release=$release");?>">
<a href="<?php echo helper::createLink('api', 'index', "libID={$api->lib}&moduleID=0&apiID={$api->id}&version=0&release=$release");?>" data-app="<?php echo $app->tab;?>">
<span class="label label-primary"><?php echo $api->method;?></span>
<span class="path" title="<?php echo $api->path;?>"><?php echo $api->path;?></span>
<span class="desc" title="<?php echo $api->title;?>"><?php echo $api->title;?></span>
+2 -3
View File
@@ -23,14 +23,13 @@
</div>
<div class="actions">
<?php
echo html::a("javascript:fullScreen()", '<i class="icon-fullscreen"></i>', '', "title='{$lang->fullscreen}' class='btn btn-link fullscreen-btn'");
if(!$isRelease)
{
if(common::hasPriv('api', 'edit')) echo html::a(inlink('edit', "apiID=$api->id"), '<i class="icon-edit"></i>', '', "title='{$lang->api->edit}' class='btn btn-link' data-app='{$this->app->tab}'");
if(common::hasPriv('api', 'delete'))
{
$deleteURL = $this->createLink('api', 'delete', "apiID=$api->id&confirm=yes");
echo html::a("javascript:ajaxDeleteApi(\"$deleteURL\", confirmDelete)", '<i class="icon-trash"></i>', '', "title='{$lang->api->delete}' class='btn btn-link'");
$deleteURL = $this->createLink('api', 'delete', "apiID=$api->id");
echo html::a($deleteURL, '<i class="icon-trash"></i>', '', "title='{$lang->api->delete}' class='btn btn-link' target='hiddenwin'");
}
}
?>
+1
View File
@@ -52,6 +52,7 @@
<?php endforeach;?>
</tbody>
</table>
<div class='table-footer'><?php $pager->show('right', 'pagerjs');?></div>
</form>
<?php endif;?>
</div>
+14 -3
View File
@@ -15,6 +15,14 @@
<div class='main-col'>
<div class="cell" id="queryBox" data-module='user'></div>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left leftBar'>
<?php $gobackLink = $this->session->structList ? $this->session->structList : inlink('struct', "libID=$libID");?>
<?php echo html::a($gobackLink, "<i class='icon-back'></i> " . $lang->goback, '', "class='btn btn-link'");?>
<div class='divider'></div>
<div class='page-title'>
<span class='text'><?php echo $lang->struct->list;?></span>
</div>
</div>
<div class='btn-toolbar pull-right'>
<?php common::printLink('api', 'createStruct', "libID=$libID", "<i class='icon icon-plus'></i> " . $lang->api->createStruct, '', "class='btn btn-primary create-user-btn'");?>
</div>
@@ -36,7 +44,7 @@
<th class='c-name'><?php echo $lang->api->structName;?></th>
<th class='c-user'><?php common::printOrderLink('addedBy', $orderBy, $vars, $lang->api->structAddedBy);?></th>
<th class='c-date'><?php common::printOrderLink('addedDate', $orderBy, $vars, $lang->api->structAddedDate);?></th>
<th class='c-actions'><?php echo $lang->actions;?></th>
<th class='c-actions-2'><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
@@ -44,9 +52,9 @@
<tr>
<td><?php printf('%03d', $struct->id);?></td>
<td><?php echo $struct->type;?></td>
<td><?php echo $struct->name;?></td>
<td class='c-name' title="<?php echo $struct->name;?>"><?php echo $struct->name;?></td>
<td><?php echo $struct->addedName;?></td>
<td class="c-date"><?php echo $struct->addedDate;?></td>
<td><?php echo formatTime($struct->addedDate, 'Y-m-d');?></td>
<td class='c-actions'>
<?php
if(common::hasPriv('api', 'editStruct')) echo html::a($this->createLink('api', 'editStruct', "libID=$libID&structID=$struct->id"), '<i class="icon-edit"></i>', '', "title='{$lang->api->editStruct}' class='btn'");
@@ -57,6 +65,9 @@
<?php endforeach;?>
</tbody>
</table>
<div class='table-footer'>
<?php $pager->show('right', 'pagerjs');?>
</div>
</form>
<?php endif;?>
</div>
+2 -2
View File
@@ -168,7 +168,7 @@ $lang->product->menu->release = array('link' => "{$lang->release->common}|re
$lang->product->menu->roadmap = array('link' => "{$lang->roadmap}|product|roadmap|productID=%s");
$lang->product->menu->requirement = array('link' => "{$lang->URCommon}|product|browse|productID=%s&branch=&browseType=unclosed&param=0&storyType=requirement", 'alias' => 'batchedit', 'subModule' => 'story');
$lang->product->menu->track = array('link' => "{$lang->track}|product|track|productID=%s");
$lang->product->menu->doc = array('link' => "{$lang->doc->common}|doc|productSpace|objectID=%s", 'subModule' => 'doc');
$lang->product->menu->doc = array('link' => "{$lang->doc->common}|doc|productSpace|objectID=%s", 'subModule' => 'doc,api');
$lang->product->menu->dynamic = array('link' => "{$lang->dynamic}|product|dynamic|productID=%s");
$lang->product->menu->settings = array('link' => "{$lang->settings}|product|view|productID=%s", 'subModule' => 'tree,branch', 'alias' => 'edit,whitelist,addwhitelist');
@@ -207,7 +207,7 @@ $lang->scrum->menu->execution = array('link' => "$lang->executionCommon|projec
$lang->scrum->menu->storyGroup = array('link' => "{$lang->common->story}|projectstory|story|projectID=%s&product=%s",'class' => 'dropdown dropdown-hover', 'exclude' => 'tree-browse');
$lang->scrum->menu->story = array('link' => "$lang->SRCommon|projectstory|story|projectID=%s", 'subModule' => 'projectstory,tree', 'alias' => 'story,track');
$lang->scrum->menu->projectplan = array('link' => "{$lang->productplan->shortCommon}|projectplan|browse|productID=%s", 'subModule' => 'productplan');
$lang->scrum->menu->doc = array('link' => "{$lang->doc->common}|doc|projectSpace|objectID=%s", 'subModule' => 'doc');
$lang->scrum->menu->doc = array('link' => "{$lang->doc->common}|doc|projectSpace|objectID=%s", 'subModule' => 'doc,api');
$lang->scrum->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport', 'alias' => 'bug,testtask,testcase,testreport', 'exclude' => 'execution-create,execution-batchedit');
$lang->scrum->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo');
$lang->scrum->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s", 'subModule' => 'projectbuild');
+70 -25
View File
@@ -1059,16 +1059,20 @@ class doc extends control
public function view($docID = 0, $version = 0, $appendLib = 0)
{
$doc = $this->doc->getById($docID);
if(!$doc)
{
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => '404 Not found'));
return print(js::error($this->lang->notFound) . js::locate($this->inlink('index')));
}
$lib = $this->doc->getLibById($doc->lib);
if(!empty($lib) and $lib->deleted == '1') $appendLib = $doc->id;
$type = isset($lib->type) ? $lib->type : 'custom';
$objectID = isset($doc->{$type}) ? $doc->{$type} : 0;
$objectType = isset($lib->type) ? $lib->type : 'custom';
$type = $objectType == 'execution' && $this->app->tab != 'execution' ? 'project' : $objectType;
$objectID = isset($doc->{$type}) ? $doc->{$type} : 0;
list($libs, $libID, $object, $objectID) = $this->doc->setMenuByType($type, $objectID, $doc->lib, $appendLib);
/* Set Custom. */
foreach(explode(',', $this->config->doc->customObjectLibs) as $libType) $customObjectLibs[$libType] = $this->lang->doc->customObjectLibs[$libType];
$moduleTree = $this->doc->getTreeMenu($type, $objectID, $libID, 0, $docID);
/* Get doc. */
@@ -1084,7 +1088,7 @@ class doc extends control
}
}
if(isset($doc) and ($doc->type == 'text' || $doc->type == 'article'))
if(isset($doc) and $doc->type == 'text')
{
/* Split content into an array. */
$content = explode("\n", $doc->content);
@@ -1150,28 +1154,22 @@ class doc extends control
$doc = $docID ? $doc : '';
$this->view->customObjectLibs = $customObjectLibs;
$this->view->showLibs = $this->config->doc->custom->objectLibs;
$this->view->title = ($type == 'book' or $type == 'custom') ? $this->lang->doc->customAB : $object->name;
$this->view->position[] = ($type == 'book' or $type == 'custom') ? $this->lang->doc->customAB : $object->name;
$this->view->title = $type == 'custom' ? $this->lang->doc->customAB : $object->name;
$this->view->docID = $docID;
$this->view->doc = $doc;
$this->view->type = $type;
$this->view->version = $version;
$this->view->object = $object;
$this->view->objectID = $objectID;
$this->view->objectType = $type;
$this->view->objectType = $objectType;
$this->view->type = $type;
$this->view->libID = $libID;
$this->view->lib = isset($libs[$libID]) ? $libs[$libID] : new stdclass();
$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.
$this->view->actions = $docID ? $this->action->getList('doc', $docID) : array();
$this->view->users = $this->user->getPairs('noclosed,noletter');
$this->view->preAndNext = $this->doc->getPreAndNextDoc($docID, $libID);
$this->view->autoloadPage = $this->doc->checkAutoloadPage($doc);
$this->view->libTree = $this->doc->getLibTree($libID, $libs, $type, $doc->module, $objectID);
$this->display();
}
@@ -1194,24 +1192,22 @@ class doc extends control
*/
public function tableContents($type = 'custom', $objectID = 0, $libID = 0, $moduleID = 0, $browseType = 'all', $orderBy = 'status,id_desc', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->view->isFirstLoad = $objectID == 0 ? 'true' : 'false';
$isFirstLoad = $libID == 0 ? true : false;
$this->session->set('createProjectLocate', $this->app->getURI(true), 'doc');
$this->session->set('structList', $this->app->getURI(true), 'doc');
$this->session->set('spaceType', $type, 'doc');
if(empty($browseType)) $browseType = 'all';
list($libs, $libID, $object, $objectID, $objectDropdown) = $this->doc->setMenuByType($type, $objectID, $libID);
$libID = (int)$libID;
$moduleTree = $type == 'book' ? $this->doc->getBookStructure($libID) : $this->doc->getTreeMenu($type, $objectID, $libID);
$libTree = $this->doc->getLibTree($libID, $libs, $type, $moduleID, $objectID, $browseType);
$libID = (int)$libID;
$title = $type == 'custom' ? $this->lang->doc->tableContents : $object->name . $this->lang->colon . $this->lang->doc->tableContents;
$lib = $this->doc->getLibById($libID);
$libType = isset($lib->type) && $lib->type == 'api' ? 'api' : 'lib';
/* Build the search form. */
$queryID = $browseType == 'bySearch' ? (int)$param : 0;
$params = "objectID=$objectID&libID=$libID&moduleID=0&browseType=bySearch&orderBy=$orderBy&param=myQueryID";
$queryID = $browseType == 'bySearch' ? (int)$param : 0;
$params = "objectID=$objectID&libID=$libID&moduleID=0&browseType=bySearch&orderBy=$orderBy&param=myQueryID";
if($this->app->rawMethod == 'tablecontents') $params = "type=$type&" . $params;
$actionURL = $this->createLink('doc', $this->app->rawMethod, $params);
if($libType == 'api')
@@ -1252,9 +1248,10 @@ class doc extends control
$this->view->type = $type;
$this->view->objectType = $type;
$this->view->browseType = $browseType;
$this->view->isFirstLoad = $isFirstLoad;
$this->view->param = $queryID;
$this->view->users = $this->user->getPairs('noletter');
$this->view->libTree = $libTree;
$this->view->libTree = $this->doc->getLibTree($libID, $libs, $type, $moduleID, $objectID, $browseType);
$this->view->libID = $libID;
$this->view->moduleID = $moduleID;
$this->view->objectDropdown = $objectDropdown;
@@ -1385,4 +1382,52 @@ class doc extends control
$disabled = $project->multiple ? '' : 'disabled';
return print(html::select('execution', $executionPairs, 0, "class='form-control' data-placeholder='{$this->lang->doclib->tip->selectExecution}' $disabled data-drop_direction='down' data-drop-direction='down'"));
}
/**
* Edit a catalog.
*
* @param int $moduleID
* @param string $type doc|api
* @access public
* @return void
*/
public function editCatalog($moduleID, $type)
{
echo $this->fetch('tree', 'edit', "moduleID=$moduleID&type=$type");
}
/**
* Delete a catalog.
*
* @param int $rootID
* @param int $moduleID
* @param string $confirm yes|no
* @access public
* @return void
*/
public function deleteCatalog($rootID, $moduleID, $confirm = 'no')
{
echo $this->fetch('tree', 'delete', "rootID=$rootID&moduleID=$moduleID&confirm=$confirm");
}
/**
* Display setting.
*
* @access public
* @return void
*/
public function displaySetting()
{
$this->loadModel('setting');
if($_POST)
{
$this->setting->setItem($this->app->user->account . '.doc.showDoc', $this->post->showDoc);
return print(js::reload('parent.parent'));
}
$showDoc = $this->setting->getItem('owner=' . $this->app->user->account . '&module=doc&key=showDoc');
$this->view->showDoc = $showDoc === '0' ? '0' : '1';
$this->display();
}
}
+2
View File
@@ -0,0 +1,2 @@
td.titleBox {width: 100px;}
td.titleBox + td > .radio-inline + .radio-inline{margin-left: 30px;}
+12 -16
View File
@@ -1,13 +1,5 @@
.lib {width: 130px; margin-bottom: 10px;}
.addbtn {padding-top: 22px; height: 63px; border: 1px dashed #ddd; width: 60px;}
.addbtn .icon-plus {font-size: 18px; display: block; opacity: 0.5; transition: opacity .2s; text-shadow: 1px 1px 3px rgba(0,0,0,.2);}
.addbtn:hover .icon-plus {opacity: .9; animation: flash-icon 1s linear alternate infinite;}
#subHeader #dropMenu {min-width: 250px; box-sizing: inherit; max-height: inherit;}
#subHeader #dropMenu .table-col .list-group {padding-top: 10px;}
.main-col .block-files .panel-heading {padding-right: 20px;}
.main-col .block-files .panel-heading .panel-title {height: 35px; line-height: 30px;}
.side-col .action a {margin: 0 auto 3px; display: block; max-width: 200px;}
.side-col .tips {padding: 0 10px;}
.main-col .doc-title {display: flex; font-size: 16px; margin-bottom: 15px;}
.main-col .doc-title .title {margin-right: 10px; line-height: 32px; font-size: 25px;}
.main-col .doc-title .info {flex: 1 1 0;}
@@ -26,7 +18,6 @@
.hide-sidebar #sidebar>.cell {display: none;}
.hide-sidebar #sidebar>.sidebar-toggle>.icon:before {content: "\e314";}
.detail.empty {line-height: 200px;}
.main-col+.side-col {padding-left: 16px;}
.main-col iframe {min-height: 380px;}
.article-content .keywords {margin-bottom: 15px;}
@@ -44,10 +35,15 @@
.title {font-size: 20px !important;}
.article-content.comment {width: 100% !important;}
.tree-group {position: relative;}
.tree-group > .module-name {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; display: block;}
.tree-group .tree-actions {display: none; position: absolute; right: 0; top: 0; background-color: #fff; white-space: nowrap;}
.tree-group:hover > .module-name {width: calc(100% - 20px);}
.tree-group:hover .tree-actions {display: block}
.tree li.has-list.open:before {left: 6px;}
.sortable-sorting .tree-group:hover .tree-actions {display: none;}
.flex {display: flex;}
.flex-none {flex: none;}
.flex-auto {flex: auto;}
.flex-full > .panel {box-shadow: none;}
.float-r {float: right;}
.h-full {height: 100%;}
.w-full {width: 100%;}
.overflow-x-auto {overflow-x: auto;}
.overflow-auto {overflow: auto;}
.overflow-visible {overflow: visible;}
.overflow-hidden {overflow: hidden;}
#mainContent > .panel {margin-bottom: 0; height: calc(100vh - 125px); overflow-y: auto;}
+6 -2
View File
@@ -164,8 +164,8 @@ $lang->doc->cancelCollection = 'Favorit entfernen';
$lang->doc->deleteFile = 'Delete File';
$lang->doc->menuTitle = 'Menu';
$lang->doc->api = 'API';
$lang->doc->collectAction = 'Add Favorite';
$lang->doc->displaySetting = 'Display Settings';
$lang->doc->collectAction = 'Add Favorite';
$lang->doc->libName = 'Name';
$lang->doc->libType = 'Kategorie';
@@ -187,6 +187,7 @@ $lang->doc->titlePlaceholder = 'Please enter the title';
$lang->doc->confirm = 'Confirm';
$lang->doc->docSummary = 'Total: <strong>%s</strong>.';
$lang->doc->docCheckedSummary = 'Seleted: <strong>%total%</strong>.';
$lang->doc->showDoc = 'Whether to display documents';
global $config;
/* Query condition list. */
@@ -327,3 +328,6 @@ $lang->doc->libDropdown['delModule'] = 'Delete Directory';
$lang->doc->featureBar['tableContents']['all'] = 'All';
$lang->doc->featureBar['tableContents']['draft'] = 'Draft';
$lang->doc->showDocList[1] = 'Yes';
$lang->doc->showDocList[0] = 'No';
+6 -2
View File
@@ -164,8 +164,8 @@ $lang->doc->cancelCollection = 'Remove Favorite';
$lang->doc->deleteFile = 'Delete File';
$lang->doc->menuTitle = 'Direcotory';
$lang->doc->api = 'API';
$lang->doc->collectAction = 'Add Favorite';
$lang->doc->displaySetting = 'Display Settings';
$lang->doc->collectAction = 'Add Favorite';
$lang->doc->libName = 'Document Library';
$lang->doc->libType = 'Category';
@@ -187,6 +187,7 @@ $lang->doc->titlePlaceholder = 'Please enter the title';
$lang->doc->confirm = 'Confirm';
$lang->doc->docSummary = 'Total: <strong>%s</strong>.';
$lang->doc->docCheckedSummary = 'Seleted: <strong>%total%</strong>.';
$lang->doc->showDoc = 'Whether to display documents';
global $config;
/* Query condition list. */
@@ -327,3 +328,6 @@ $lang->doc->libDropdown['delModule'] = 'Delete Directory';
$lang->doc->featureBar['tableContents']['all'] = 'All';
$lang->doc->featureBar['tableContents']['draft'] = 'Draft';
$lang->doc->showDocList[1] = 'Yes';
$lang->doc->showDocList[0] = 'No';
+6 -2
View File
@@ -164,8 +164,8 @@ $lang->doc->cancelCollection = 'Retirer des Favoris';
$lang->doc->deleteFile = 'Supprimer Fichier';
$lang->doc->menuTitle = 'Menu';
$lang->doc->api = 'API';
$lang->doc->collectAction = 'Add Favorite';
$lang->doc->displaySetting = 'Display Settings';
$lang->doc->collectAction = 'Add Favorite';
$lang->doc->libName = 'Bibliothèque de Documents';
$lang->doc->libType = 'Catégorie';
@@ -187,6 +187,7 @@ $lang->doc->titlePlaceholder = 'Veuillez saisir le titre';
$lang->doc->confirm = 'Confirm';
$lang->doc->docSummary = 'Total: <strong>%s</strong>.';
$lang->doc->docCheckedSummary = 'Seleted: <strong>%total%</strong>.';
$lang->doc->showDoc = 'Whether to display documents';
global $config;
/* Query condition list. */
@@ -328,3 +329,6 @@ $lang->doc->libDropdown['delModule'] = 'Delete Directory';
$lang->doc->featureBar['tableContents']['all'] = 'All';
$lang->doc->featureBar['tableContents']['draft'] = 'Draft';
$lang->doc->showDocList[1] = 'Yes';
$lang->doc->showDocList[0] = 'No';
+6 -2
View File
@@ -164,8 +164,8 @@ $lang->doc->cancelCollection = '取消收藏';
$lang->doc->deleteFile = '删除附件';
$lang->doc->menuTitle = '目录';
$lang->doc->api = '接口';
$lang->doc->collectAction = '收藏文档';
$lang->doc->displaySetting = '显示设置';
$lang->doc->collectAction = '收藏文档';
$lang->doc->libName = '库名称';
$lang->doc->libType = '库类型';
@@ -187,6 +187,7 @@ $lang->doc->titlePlaceholder = '请输入标题';
$lang->doc->confirm = '确认';
$lang->doc->docSummary = '本页共 <strong>%s</strong> 个文档。';
$lang->doc->docCheckedSummary = '共选中 <strong>%total%</strong> 个文档。';
$lang->doc->showDoc = '是否显示文档';
global $config;
/* 查询条件列表 */
@@ -327,3 +328,6 @@ $lang->doc->libDropdown['delModule'] = '删除目录';
$lang->doc->featureBar['tableContents']['all'] = '全部';
$lang->doc->featureBar['tableContents']['draft'] = '草稿';
$lang->doc->showDocList[1] = '是';
$lang->doc->showDocList[0] = '否';
+31
View File
@@ -2810,6 +2810,21 @@ class docModel extends model
$item->type = $module->type == 'api' ? 'apiDoc' : $module->type;
$item->active = $module->id == $moduleID ? 1 : 0;
$item->children = $this->getModuleTree($rootID, $moduleID, $type, $module->id, $modules);
$showDoc = $this->loadModel('setting')->getItem('owner=' . $this->app->user->account . '&module=doc&key=showDoc');
$showDoc = $showDoc === '0' ? 0 : 1;
if($this->app->rawMethod == 'view' and $module->type != 'api' and $showDoc)
{
$docIDList = $this->getPrivDocs($rootID, $module->id);
$docs = $this->dao->select('*, title as name')->from(TABLE_DOC)
->where('id')->in($docIDList)
->andWhere('deleted')->eq(0)
->fetchAll('id');
if(!empty($docs))
{
$docs = array_values($docs);
$item->children = array_merge($docs, $item->children);
}
}
$moduleTree[$module->id] = $item;
}
@@ -2858,6 +2873,22 @@ class docModel extends model
$item->objectID = $objectID;
$item->active = $lib->id == $libID && $browseType != 'bySearch' ? 1 : 0;
$item->children = $this->getModuleTree($lib->id, $moduleID, $lib->type == 'api' ? 'api' : 'doc');
$showDoc = $this->loadModel('setting')->getItem('owner=' . $this->app->user->account . '&module=doc&key=showDoc');
$showDoc = $showDoc === '0' ? 0 : 1;
if($this->app->rawMethod == 'view' and $lib->type != 'api' and $showDoc)
{
$docIDList = $this->getPrivDocs($lib->id);
$docs = $this->dao->select('*, title as name')->from(TABLE_DOC)
->where('id')->in($docIDList)
->andWhere('deleted')->eq(0)
->andWhere('module')->eq(0)
->fetchAll('id');
if(!empty($docs))
{
$docs = array_values($docs);
$item->children = array_merge($docs, $item->children);
}
}
if(($type == 'project' and $lib->type != 'execution') or $type != 'project')
{
if($item->type == 'lib') $libTree[$lib->type][$lib->id] = $item;
+1 -1
View File
@@ -31,7 +31,7 @@
<div class="sidebar-toggle flex-center"><i class="icon icon-angle-left"></i></div>
<div class="main-col flex-full overflow-visible flex-auto">
<div class="cell<?php if($browseType == 'bySearch') echo ' show';?>" style="min-width: 400px" id="queryBox" data-module=<?php echo $type . $libType . 'Doc';?>></div>
<?php include 'doclist.html.php'; ?>
<?php include 'mydoclist.html.php'; ?>
</div>
<?php endif;?>
</div>
+32
View File
@@ -0,0 +1,32 @@
<?php
/**
* The displaysetting view file of doc module of ZenTaoPMS.
*
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Shujie Tian <tianshujie@easycorp.ltd>
* @package doc
* @version $Id: displaysetting.html.php 4769 2023-04-05 14:24:21Z $
* @link https://www.zentao.net
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<div class="modal-header">
<h4 class="modal-title"><i class="icon-cog"></i> <?php echo $lang->doc->displaySetting;?></h4>
</div>
<div class="modal-body" style="max-height: 564px; overflow: visible;">
<form class="form-condensed no-stash" method="post" target="hiddenwin">
<table class="table table-form">
<tbody>
<tr>
<td class='titleBox'><?php echo $lang->doc->showDoc;?></td>
<td><?php echo html::radio('showDoc', $lang->doc->showDocList, $showDoc);?></td>
</tr>
<tr>
<td colspan="2" class="text-center"><?php echo html::submitButton();?></td>
</tr>
</tbody>
</table>
</form>
</div>
<?php include '../../common/view/footer.html.php';?>
+38 -19
View File
@@ -30,7 +30,7 @@
.tree li.has-input {overflow: hidden;}
.tree-text {margin-left: 5px; overflow: hidden;}
i.btn-info, i.btn-info:hover {border: none; background: #fff; box-shadow: unset;}
.tree-version-trigger {padding: 0 10px; width: 54px; border-radius: 5px; background: #F9F9F9; display: flex;}
.tree-version-trigger {padding: 0 10px; width: 54px; border-radius: 5px; background: #F9F9F9; display: flex; align-items: center;}
.tree-version-trigger > .text {overflow: hidden; flex: 0 0 30px;}
.file-tree > .bd-b {border-bottom: 1px solid #EDEEF2;}
.file-tree > .tree-child {padding: 5px 0; position: relative;}
@@ -38,7 +38,7 @@ i.btn-info, i.btn-info:hover {border: none; background: #fff; box-shadow: unset;
/* css for sidebar */
.sidebar-toggle {flex: 0 0 16px;}
.sidebar-toggle > .icon {width: 12px; height: 30px; margin-top: -10px; line-height: 30px; color: #fff; text-align: center; background: #7dcdfe; border-radius: 6px; cursor: pointer; padding-left: 0; padding-top: 0;}
.bottom-btn-tree {position: fixed; width: 150px; bottom: 40px;}
.bottom-btn-tree {position: fixed; bottom: 66px; left: 48px;}
.spliter {flex: 0 0 12px;}
.spliter-btn {height: 28px; width: 10px; background: #fff; position: absolute; top: 30%; left: -1px; border: 1px solid #D9D9D9; border-radius: 2px;}
@@ -60,32 +60,34 @@ i.btn-info, i.btn-info:hover {border: none; background: #fff; box-shadow: unset;
js::set('release', isset($release) ? $release : 0);
js::set('versionLang', $lang->build->common);
/* ObjectType and objectID used for other space. */
js::set('objectType', isset($type) ? $type : '');
js::set('objectID', isset($objectID) ? $objectID : '');
js::set('isFirstLoad', isset($isFirstLoad) ? $isFirstLoad: '');
js::set('canViewFiles', common::hasPriv('doc', 'showfiles'));
?>
<div id="fileTree" class="file-tree menu-active-primary menu-hover-primary">
<?php if(isset($type) and $type == 'project'):?>
<div class="project-tree bd-b tree-child">
<div class="project-tree bd-b tree-child">
<div class="title"><i class="icon icon-project btn-info"> </i><?php echo $lang->projectCommon?></div>
<div id="projectTree" data-id="project"></div>
</div>
<div class="execution-tree bd-b tree-child">
</div>
<div class="execution-tree bd-b tree-child">
<div class="title"><i class="icon icon-run btn-info"> </i><?php echo $lang->execution->common?></div>
<div id="executionTree" data-id="execution"></div>
</div>
<div class="annex-tree tree-child">
</div>
<div class="annex-tree tree-child">
<div class="title"><i class="icon icon-paper-clip btn-info"> </i><?php echo $lang->files?></div>
<div id="annexTree" data-id="annex"></div>
</div>
</div>
<?php endif;?>
</div>
<div class="text-center bottom-btn-tree hidden">
<?php common::printLink('project', 'programTitle', '', $lang->doc->customShowLibs, '', "class='btn btn-info btn-wide iframe'", true, true);?>
<?php if($app->rawMethod == 'view' and common::hasPriv('doc', 'displaySetting')):?>
<div class="text-center bottom-btn-tree">
<?php common::printLink('doc', 'displaySetting', '', $lang->doc->displaySetting, '', "class='btn btn-info btn-wide iframe' data-width='400px'", true, true);?>
</div>
<?php endif;?>
<!-- Code for dropdown menu. -->
<?php $canAddCatalog = common::hasPriv('doc', 'addCatalog');?>
@@ -115,10 +117,10 @@ js::set('isFirstLoad', isset($isFirstLoad) ? $isFirstLoad: '');
<li data-method="addCataChild" data-type="add" data-id="%moduleID%" data-has-children='%hasChildren%'><a><i class="icon icon-icon-add-directory"></i><?php echo $lang->doc->libDropdown['addSubModule'];?></a></li>
<?php endif;?>
<?php if($canEditCatalog):?>
<li data-method="editCata" class='edit-module'><a data-href='<?php echo helper::createLink('tree', 'edit', "moduleID=%moduleID%&type=$app->rawModule");?>'><i class="icon icon-edit"></i><?php echo $lang->doc->libDropdown['editModule'];?></a></li>
<li data-method="editCata" class='edit-module'><a data-href='<?php echo helper::createLink('doc', 'editCatalog', "moduleID=%moduleID%&type=$app->rawModule");?>'><i class="icon icon-edit"></i><?php echo $lang->doc->libDropdown['editModule'];?></a></li>
<?php endif;?>
<?php if($canDeleteCatalog):?>
<li data-method="deleteCata"><a href='<?php echo helper::createLink('tree', 'delete', 'rootID=%libID%&moduleID=%moduleID%');?>' target='hiddenwin'><i class="icon icon-trash"></i><?php echo $lang->doc->libDropdown['delModule'];?></a></li>
<li data-method="deleteCata"><a href='<?php echo helper::createLink('doc', 'deleteCatalog', 'rootID=%libID%&moduleID=%moduleID%');?>' target='hiddenwin'><i class="icon icon-trash"></i><?php echo $lang->doc->libDropdown['delModule'];?></a></li>
<?php endif;?>
</ul>
</div>
@@ -212,7 +214,11 @@ $(function()
'annex': 'annex',
'api': 'interface',
'lib': 'wiki-file-lib',
'execution': 'wiki-file-lib'
'execution': 'wiki-file-lib',
'text': 'wiki-file',
'word': 'word',
'ppt': 'ppt',
'excel': 'excel'
};
ele.tree(
{
@@ -221,6 +227,8 @@ $(function()
itemCreator: function($li, item)
{
if(typeof item.hasAction == 'undefined') item.hasAction = true;
if(typeof item.active == 'undefined') item.active = 0;
if(typeof docID != 'undefined' && item.id == docID) item.active = 1;
var objectType = config.currentModule == 'api' ? item.objectType : item.type;
var libClass = ['lib', 'annex', 'api', 'execution'].indexOf(objectType) !== -1 ? 'lib' : '';
@@ -230,6 +238,7 @@ $(function()
$item += '<div class="text h-full w-full flex-start overflow-hidden">';
if((libClass == 'lib' && item.type != 'execution') || (item.type == 'execution' && item.hasAction)) $item += '<div class="img-lib" style="background-image:url(static/svg/' + imgObj[item.type || 'lib'] + '.svg)"></div>';
if(['text', 'word', 'ppt', 'excel'].indexOf(item.type) !== -1) $item += '<div class="img-lib" style="background-image:url(static/svg/' + imgObj[item.type] + '.svg)"></div>';
$item += '<div class="tree-text">';
$item += item.name;
$item += '</div>';
@@ -243,7 +252,7 @@ $(function()
}
$item += '<div class="tree-version-trigger" data-id="' + item.id + '"><div class="text">' + (versionName || versionLang) + '</div><div class="caret"></div></div>';
}
if((libClass != 'lib' && hasModulePriv) || (libClass == 'lib' && hasLibPriv)) $item += '<i class="icon icon-drop icon-ellipsis-v hidden tree-icon" data-isCatalogue="' + (libClass ? false : true) + '"></i>';
if(['text', 'word', 'ppt', 'excel'].indexOf(item.type) === -1 && ((libClass != 'lib' && hasModulePriv) || (libClass == 'lib' && hasLibPriv))) $item += '<i class="icon icon-drop icon-ellipsis-v hidden tree-icon" data-isCatalogue="' + (libClass ? false : true) + '"></i>';
$item += '</div>';
$item += '</a>';
if(item.versions) versionsData[item.id] = item.versions;
@@ -253,7 +262,9 @@ $(function()
if(item.active) $li.addClass('active');
}
});
if(isFirstLoad !== 'false') ele.data('zui.tree').collapse();
if(isFirstLoad) ele.data('zui.tree').collapse();
var $leaf = ele.find('li.active');
if($leaf.length) $leaf[$leaf.length - 1].scrollIntoView(false);
@@ -394,6 +405,11 @@ $(function()
methodName = 'showFiles';
linkParams = 'type=' + objectType + '&objectID=' + objectID;
}
else if(['text', 'word', 'ppt', 'excel'].indexOf(type) !== -1)
{
methodName = 'view';
linkParams = 'docID=' + moduleID;
}
else
{
methodName = objectType == 'execution' || objectType == 'custom' ? 'tableContents' : objectType + 'Space';
@@ -422,9 +438,12 @@ $(function()
$('#sideBar').addClass('hidden');
}
var $docListForm = $('#docListForm').data('zui.table');
$docListForm.fixHeader();
$docListForm.fixFooter();
if($('#docListForm').length > 0)
{
var $docListForm = $('#docListForm').data('zui.table');
$docListForm.fixHeader();
$docListForm.fixFooter();
}
}).on('click', '.dropdown-in-tree li', function(e)
{
var item = $(this).data();
+151
View File
@@ -0,0 +1,151 @@
<?php
/**
* The allLibs view file of doc module of ZenTaoPMS.
*
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Shujie Tian <tianshujie@easycorp.ltd>
* @package doc
* @version $Id$
* @link https://www.zentao.net
*/
?>
<style>
body {margin-bottom: 25px;}
#docListForm th.c-id {width: 72px;}
#docListForm th.c-user {width: 80px;}
#docListForm th.c-actions {width: 84px; padding-left: 15px;}
#docListForm .checkbox-primary {line-height: 16px;}
#docListForm .checkbox-primary > label {height: 16px; line-height: 16px; padding-left: 16px;}
#docListForm .checkbox-primary > label:before {left: -1px; font-size: 10px;}
#docListForm .checkbox-primary > label:after {width: 12px; height: 12px;}
</style>
<?php if(common::checkNotCN()):?>
<style>
#docListForm th.c-date {width: 108px;}
#docListForm th.c-user {width: 102px !important;}
</style>
<?php endif;?>
<?php if(empty($docs)):?>
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $lang->doc->noDoc;?></span>
<?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');
}
?>
</p>
</div>
<?php else:?>
<?php $vars = "objectID=$objectID&$libID=$libID&moduleID=$moduleID&browseType=$browseType&orderBy=%s&param=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<?php if($app->rawMethod == 'tablecontents') $vars = "type=$type&" . $vars;?>
<div>
<form class='main-table' method='post' id='docListForm'>
<table class="table table-files has-sort-head">
<thead>
<tr>
<th class="c-id">
<?php if($canExport):?>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
<label></label>
</div>
<?php endif;?>
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
</th>
<th class="c-name"><?php common::printOrderLink('title', $orderBy, $vars, $lang->doc->title);?></th>
<th class="c-user"><?php common::printOrderLink('addedBy', $orderBy, $vars, $lang->doc->addedByAB);?></th>
<th class="c-date"><?php common::printOrderLink('addedDate', $orderBy, $vars, $lang->doc->addedDate);?></th>
<th class="c-user"><?php common::printOrderLink('editedBy', $orderBy, $vars, $lang->doc->editedBy);?></th>
<th class="c-date"><?php common::printOrderLink('editedDate', $orderBy, $vars, $lang->doc->editedDate);?></th>
<th class="c-actions"><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php foreach($docs as $doc):?>
<?php $star = strpos($doc->collector, ',' . $this->app->user->account . ',') !== false ? 'star' : 'star-empty';?>
<?php $collectTitle = strpos($doc->collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?>
<tr>
<?php $objectID = isset($doc->{$type}) ? $doc->{$type} : 0;?>
<td class="c-id" title='<?php echo $doc->id?>'>
<?php if($canExport):?>
<div class="checkbox-primary">
<input type='checkbox' name='docIDList[]' value='<?php echo $doc->id;?>'/>
<label></label>
</div>
<?php endif;?>
<?php printf('%03d', $doc->id);?>
</td>
</td>
<td class="c-name" title='<?php echo $doc->title;?>'>
<?php
$docType = $doc->type == 'text' ? 'wiki-file' : $doc->type;
$icon = html::image("static/svg/{$docType}.svg", "class='file-icon'");
if(common::hasPriv('doc', 'view'))
{
echo html::a($this->createLink('doc', 'view', "docID=$doc->id"), $icon . $doc->title, '', "title='{$doc->title}' class='doc-title' data-app='{$this->app->tab}'");
}
else
{
echo "<span class='doc-title'>$icon {$doc->title}</span>";
}
?>
<?php if($doc->status == 'draft') echo "<span class='label label-badge draft'>{$lang->doc->draft}</span>";?>
<?php if(common::canBeChanged('doc', $doc) and common::hasPriv('doc', 'collect') and $libType and $libType != 'api'):?>
<a data-url="<?php echo $this->createLink('doc', 'collect', "objectID=$doc->id&objectType=doc");?>" title="<?php echo $collectTitle;?>" class='btn btn-link ajaxCollect'><?php echo html::image("static/svg/{$star}.svg", "class='$star'");?></a>
<?php endif;?>
</td>
<td class="c-user"><?php echo zget($users, $doc->addedBy);?></td>
<td class="c-datetime"><?php echo formatTime($doc->addedDate, 'Y-m-d');?></td>
<td class="c-user"><?php echo zget($users, $doc->editedBy);?></td>
<td class="c-datetime"><?php echo formatTime($doc->editedDate, 'Y-m-d');?></td>
<td class="c-actions">
<?php if(common::canBeChanged('doc', $doc)):?>
<?php
$iframe = '';
$onlybody = false;
if($doc->type != 'text' or isonlybody())
{
$iframe = 'iframe';
$onlybody = true;
}
?>
<?php common::printLink('doc', 'edit', "docID=$doc->id&comment=false", "<i class='icon icon-edit'></i>", '', "title='{$lang->edit}' class='btn $iframe'", true, $onlybody);?>
<?php common::printLink('doc', 'delete', "docID=$doc->id&confirm=no", "<i class='icon icon-trash'></i>", 'hiddenwin', "title='{$lang->delete}' class='btn'")?>
<?php endif;?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php if(!empty($docs)):?>
<div class='table-footer'>
<?php if($canExport):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<?php endif;?>
<div class="table-statistic"><?php echo sprintf($lang->doc->docSummary, count($docs));?></div>
<?php $pager->show('right', 'pagerjs');?>
</div>
<?php endif;?>
<form>
</div>
<?php endif;?>
<script>
$(function()
{
var pageSummary = '<?php echo sprintf($lang->doc->docSummary, count($docs));?>';
var checkedSummary = '<?php echo $lang->doc->docCheckedSummary?>';
$('#docListForm').table(
{
replaceId: 'docIDList',
statisticCreator: function(table)
{
var $table = table.getTable();
var $checkedRows = $table.find('tbody>tr.checked');
var checkedTotal = $checkedRows.length;
return checkedTotal ? checkedSummary.replace('%total%', checkedTotal) : pageSummary;
}
});
});
</script>
-1
View File
@@ -15,7 +15,6 @@
<?php js::set('linkParams', "objectID=$objectID&%s&browseType=&orderBy=$orderBy");?>
<?php js::set('docLang', $lang->doc);?>
<?php js::set('libType', $libType);?>
<?php js::set('canViewFiles', common::hasPriv('doc', 'showfiles'));?>
<div id="mainMenu" class="clearfix">
<div id="leftBar" class="btn-toolbar pull-left">
<?php echo $objectDropdown;?>
+12 -6
View File
@@ -12,20 +12,26 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::set('treeData', $libTree);?>
<?php js::set('docID', $docID);?>
<?php js::set('linkParams', "objectID=$objectID&%s");?>
<?php js::set('docLang', $lang->doc);?>
<?php if($app->tab == 'execution'):;?>
<style>.panel-body{min-height: 180px}</style>
<?php endif;?>
<div class="cell<?php if($type == 'bySearch') echo ' show';?>" id="queryBox" data-module=<?php echo $type . 'Doc';?>></div>
<div class="fade main-row split-row" id="mainRow">
<div id='mainContent'class="fade flex">
<?php if($libID):?>
<?php include './side.html.php';?>
<div id='sideBar' class="panel side side-col col overflow-auto">
<?php include 'lefttree.html.php';?>
</div>
<div class="sidebar-toggle flex-center"><i class="icon icon-angle-left"></i></div>
<div class="main-col" data-min-width="400">
<?php if($docID):?>
<?php include './content.html.php';?>
<?php else:?>
<div class="cell">
<div class="detail empty text-center">
<?php echo $type == 'book' ? $lang->doc->noArticle : $lang->doc->noDoc;?>
<?php echo $lang->doc->noDoc;?>
</div>
</div>
<?php endif;?>
@@ -33,8 +39,8 @@
<?php else:?>
<div class="cell">
<div class="detail empty text-center">
<?php echo $type == 'book' ? $lang->doc->noBook : $lang->doc->noLib;?>
<?php if($type != 'book') echo html::a($this->createLink('doc', 'createLib', "type={$objectType}&objectID=$object->id"), "<i class='icon icon-plus'></i> " . $lang->doc->createLib, '', "class='btn btn-info iframe'");?>
<?php echo $lang->doc->noLib;?>
<?php echo html::a($this->createLink('doc', 'createLib', "type={$objectType}&objectID=$object->id"), "<i class='icon icon-plus'></i> " . $lang->doc->createLib, '', "class='btn btn-info iframe'");?>
</div>
</div>
<?php endif;?>
+23 -21
View File
@@ -1368,27 +1368,28 @@ $lang->job->methodOrder[25] = 'exec';
/* Doc. */
$lang->resource->doc = new stdclass();
$lang->resource->doc->index = 'index';
$lang->resource->doc->browse = 'mySpace';
$lang->resource->doc->myView = 'myView';
$lang->resource->doc->myCollection = 'myCollection';
$lang->resource->doc->myCreation = 'myCreation';
$lang->resource->doc->createLib = 'createLib';
$lang->resource->doc->editLib = 'editLib';
$lang->resource->doc->deleteLib = 'deleteLib';
$lang->resource->doc->create = 'create';
$lang->resource->doc->edit = 'edit';
$lang->resource->doc->view = 'view';
$lang->resource->doc->delete = 'delete';
$lang->resource->doc->deleteFile = 'deleteFile';
$lang->resource->doc->collect = 'collectAction';
$lang->resource->doc->productSpace = 'productSpace';
$lang->resource->doc->projectSpace = 'projectSpace';
$lang->resource->doc->tableContents = 'teamSpace';
$lang->resource->doc->showFiles = 'showFiles';
$lang->resource->doc->addCatalog = 'addCatalog';
$lang->resource->doc->editCatalog = 'editCatalog';
$lang->resource->doc->deleteCatalog = 'deleteCatalog';
$lang->resource->doc->index = 'index';
$lang->resource->doc->browse = 'mySpace';
$lang->resource->doc->myView = 'myView';
$lang->resource->doc->myCollection = 'myCollection';
$lang->resource->doc->myCreation = 'myCreation';
$lang->resource->doc->createLib = 'createLib';
$lang->resource->doc->editLib = 'editLib';
$lang->resource->doc->deleteLib = 'deleteLib';
$lang->resource->doc->create = 'create';
$lang->resource->doc->edit = 'edit';
$lang->resource->doc->view = 'view';
$lang->resource->doc->delete = 'delete';
$lang->resource->doc->deleteFile = 'deleteFile';
$lang->resource->doc->collect = 'collectAction';
$lang->resource->doc->productSpace = 'productSpace';
$lang->resource->doc->projectSpace = 'projectSpace';
$lang->resource->doc->tableContents = 'teamSpace';
$lang->resource->doc->showFiles = 'showFiles';
$lang->resource->doc->addCatalog = 'addCatalog';
$lang->resource->doc->editCatalog = 'editCatalog';
$lang->resource->doc->deleteCatalog = 'deleteCatalog';
$lang->resource->doc->displaySetting = 'displaySetting';
$lang->doc->methodOrder[5] = 'index';
$lang->doc->methodOrder[10] = 'browse';
@@ -1411,6 +1412,7 @@ $lang->doc->methodOrder[90] = 'showFiles';
$lang->doc->methodOrder[95] = 'addCatalog';
$lang->doc->methodOrder[100] = 'editCatalog';
$lang->doc->methodOrder[105] = 'deleteCatalog';
$lang->doc->methodOrder[110] = 'displaySetting';
/* Mail. */
$lang->resource->mail = new stdclass();
+2 -2
View File
@@ -387,7 +387,7 @@ class tree extends control
if(!empty($_POST))
{
$this->tree->update($moduleID);
die(js::reload('parent'));
return print(js::reload('parent'));
}
$module = $this->tree->getById($moduleID);
@@ -509,7 +509,7 @@ class tree extends control
if($module->type == 'line') $confirmLang = $this->lang->tree->confirmDeleteLine;
if($module->type == 'host') $confirmLang = $this->lang->tree->confirmDeleteHost;
if(strpos($this->config->tree->groupTypes, ",$module->type,") !== false) $confirmLang = $this->lang->tree->confirmDeleteGroup;
die(js::confirm($confirmLang, $this->createLink('tree', 'delete', "rootID=$rootID&moduleID=$moduleID&confirm=yes")));
return print(js::confirm($confirmLang, $this->createLink($this->app->rawModule, $this->app->rawMethod, "rootID=$rootID&moduleID=$moduleID&confirm=yes")));
}
else
{
+1 -1
View File
@@ -36,7 +36,7 @@ if(isset($pageCSS)) css::internal($pageCSS);
</h4>
</div>
<div class='modal-body'>
<form action="<?php echo inlink('edit', 'module=' . $module->id .'&type=' .$type);?>" target='hiddenwin' method='post' class='mt-10px' id='dataform'>
<form action="<?php echo helper::createLink($app->rawModule, $app->rawMethod, 'module=' . $module->id .'&type=' .$type);?>" target='hiddenwin' method='post' class='mt-10px' id='dataform'>
<table class='table table-form'>
<?php if($showProduct):?>
<tr class="<?php if($hiddenProduct) echo 'hidden';?>">