+
-
-
-
-
-
-
-
-
-
0 ? $lang->api->apiList : $lang->api->pageTitle;?>
-
-
-
-
api->noLib : $lang->api->noApi;?>
-
- ' . $lang->api->createApi, '', 'class="btn btn-info btn-wide"');
- }
- ?>
-
-
+
+ createLink('api', 'struct', "libID=$libID"), " " . $lang->api->struct, '', "class='btn btn-link'");
+ if($libTree and common::hasPriv('api', 'releases')) echo html::a($this->createLink('api', 'releases', "libID=$libID", 'html', true), " " . $lang->api->releases, '', "class='btn btn-link iframe' data-width='800px'");
+ if($libTree and common::hasPriv('api', 'createRelease')) echo html::a($this->createLink('api', 'createRelease', "libID=$libID"), " " . $lang->api->createRelease, '', "class='btn btn-link iframe' data-width='800px'");
+ //if($config->edition != 'open' and $libTree and common::hasPriv('api', 'export')) echo html::a($this->createLink('api', 'export', "libID=$libID", 'html', true), " " . $lang->export, '', "class='btn btn-link export' id='export'");
+ if(common::hasPriv('api', 'createLib')) echo html::a($this->createLink('api', 'createLib', "type=" . ($objectType == 'project' ? 'project' : 'product') . "&objectID=$objectID"), ' ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
+ if($libTree and common::hasPriv('api', 'create')) echo html::a($this->createLink('api', 'create', "libID=$libID&moduleID=$moduleID"), ' ' . $lang->api->createApi, '', 'class="btn btn-primary"');
+ ?>
-
-
-
-
api->baseUrl . ': ' . $lib->baseUrl;?>
-
-
+
+
+
+
+
+ doc->noLib;?>
+ ' . $lang->api->createLib, '', 'class="btn btn-info iframe" data-width="800px"');
+ ?>
+
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/module/api/view/view.html.php b/module/api/view/view.html.php
new file mode 100644
index 0000000000..bba2365fc8
--- /dev/null
+++ b/module/api/view/view.html.php
@@ -0,0 +1,58 @@
+
+ * @package doc
+ * @version $Id$
+ * @link http://www.zentao.net
+ */
+?>
+
+api->confirmDelete);?>
+
>
+
+
+
+
+
+
+
+ ";
+ echo html::a('javascript:;', "", '', "data-toggle='dropdown' class='btn btn-link'");
+ echo "
';
+ }
+ ?>
+
+
+
+
+
api->noModule;?>
+
+
+
+
+
+
+
+
+
diff --git a/module/common/lang/de.php b/module/common/lang/de.php
index 06dc89b1a2..35c547a68a 100644
--- a/module/common/lang/de.php
+++ b/module/common/lang/de.php
@@ -276,17 +276,22 @@ $lang->project->kanban = $lang->projectCommon . ' Kanban';
$lang->execution->executionKanban = "{$lang->execution->common} Kanban";
$lang->execution->all = "{$lang->execution->common} List";
-$lang->doc->recent = 'Recent';
-$lang->doc->my = 'My';
-$lang->doc->favorite = 'Favorite';
-$lang->doc->product = $lang->productCommon;
-$lang->doc->project = $lang->projectCommon;
-$lang->doc->api = 'API';
-$lang->doc->execution = $lang->execution->common;
-$lang->doc->custom = 'Custom';
-$lang->doc->wiki = 'WIKI';
-$lang->doc->apiDoc = 'API Docuemnt';
-$lang->doc->apiStruct = 'Data Structure';
+$lang->doc->recent = 'Recent';
+$lang->doc->my = 'My';
+$lang->doc->favorite = 'Favorite';
+$lang->doc->product = $lang->productCommon;
+$lang->doc->project = $lang->projectCommon;
+$lang->doc->api = 'API';
+$lang->doc->execution = $lang->execution->common;
+$lang->doc->custom = 'Custom';
+$lang->doc->wiki = 'WIKI';
+$lang->doc->apiDoc = 'API Docuemnt';
+$lang->doc->apiStruct = 'Data Structure';
+$lang->doc->mySpace = 'My Space';
+$lang->doc->productSpace = "{$lang->productCommon} Space";
+$lang->doc->projectSpace = "{$lang->projectCommon} Space";
+$lang->doc->apiSpace = 'API Space';
+$lang->doc->teamSpace = 'Team Space';
$lang->product->list = $lang->productCommon . ' List';
$lang->product->kanban = $lang->productCommon . ' Kanban';
diff --git a/module/common/lang/en.php b/module/common/lang/en.php
index 53474264fb..d22f365c38 100644
--- a/module/common/lang/en.php
+++ b/module/common/lang/en.php
@@ -276,17 +276,22 @@ $lang->project->kanban = $lang->projectCommon . ' Kanban';
$lang->execution->executionKanban = "{$lang->execution->common} Kanban";
$lang->execution->all = "{$lang->execution->common} List";
-$lang->doc->recent = 'Recent';
-$lang->doc->my = 'My';
-$lang->doc->favorite = 'Favorite';
-$lang->doc->product = $lang->productCommon;
-$lang->doc->project = $lang->projectCommon;
-$lang->doc->api = 'API';
-$lang->doc->execution = $lang->execution->common;
-$lang->doc->custom = 'Custom';
-$lang->doc->wiki = 'WIKI';
-$lang->doc->apiDoc = 'API Docuemnt';
-$lang->doc->apiStruct = 'Data Structure';
+$lang->doc->recent = 'Recent';
+$lang->doc->my = 'My';
+$lang->doc->favorite = 'Favorite';
+$lang->doc->product = $lang->productCommon;
+$lang->doc->project = $lang->projectCommon;
+$lang->doc->api = 'API';
+$lang->doc->execution = $lang->execution->common;
+$lang->doc->custom = 'Custom';
+$lang->doc->wiki = 'WIKI';
+$lang->doc->apiDoc = 'API Docuemnt';
+$lang->doc->apiStruct = 'Data Structure';
+$lang->doc->mySpace = 'My Space';
+$lang->doc->productSpace = "{$lang->productCommon} Space";
+$lang->doc->projectSpace = "{$lang->projectCommon} Space";
+$lang->doc->apiSpace = 'API Space';
+$lang->doc->teamSpace = 'Team Space';
$lang->product->list = $lang->productCommon . ' List';
$lang->product->kanban = $lang->productCommon . ' Kanban';
diff --git a/module/common/lang/fr.php b/module/common/lang/fr.php
index 84325ad6e2..fcc0933c1f 100644
--- a/module/common/lang/fr.php
+++ b/module/common/lang/fr.php
@@ -276,17 +276,22 @@ $lang->project->kanban = $lang->projectCommon . ' Kanban';
$lang->execution->executionKanban = "{$lang->execution->common} Kanban";
$lang->execution->all = "{$lang->execution->common} List";
-$lang->doc->recent = 'Recent';
-$lang->doc->my = 'My';
-$lang->doc->favorite = 'Favorite';
-$lang->doc->product = $lang->productCommon;
-$lang->doc->project = $lang->projectCommon;
-$lang->doc->api = 'API';
-$lang->doc->execution = $lang->execution->common;
-$lang->doc->custom = 'Custom';
-$lang->doc->wiki = 'WIKI';
-$lang->doc->apiDoc = 'API Docuemnt';
-$lang->doc->apiStruct = 'Data Structure';
+$lang->doc->recent = 'Recent';
+$lang->doc->my = 'My';
+$lang->doc->favorite = 'Favorite';
+$lang->doc->product = $lang->productCommon;
+$lang->doc->project = $lang->projectCommon;
+$lang->doc->api = 'API';
+$lang->doc->execution = $lang->execution->common;
+$lang->doc->custom = 'Custom';
+$lang->doc->wiki = 'WIKI';
+$lang->doc->apiDoc = 'API Docuemnt';
+$lang->doc->apiStruct = 'Data Structure';
+$lang->doc->mySpace = 'My Space';
+$lang->doc->productSpace = "{$lang->productCommon} Space";
+$lang->doc->projectSpace = "{$lang->projectCommon} Space";
+$lang->doc->apiSpace = 'API Space';
+$lang->doc->teamSpace = 'Team Space';
$lang->product->list = $lang->productCommon . ' List';
$lang->product->kanban = $lang->productCommon . ' Kanban';
diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php
index a5a63465ec..8e5aefcb74 100644
--- a/module/common/lang/menu.php
+++ b/module/common/lang/menu.php
@@ -187,8 +187,6 @@ $lang->product->menuOrder[55] = 'settings';
$lang->product->menuOrder[60] = 'create';
$lang->product->menuOrder[65] = 'all';
-$lang->product->menu->doc['subMenu'] = new stdclass();
-
$lang->product->menu->settings['subMenu'] = new stdclass();
$lang->product->menu->settings['subMenu']->view = array('link' => "{$lang->overview}|product|view|productID=%s", 'alias' => 'edit');
$lang->product->menu->settings['subMenu']->module = array('link' => "{$lang->module}|tree|browse|product=%s&view=story", 'subModule' => 'tree');
@@ -237,8 +235,6 @@ $lang->scrum->menuOrder[40] = 'release';
$lang->scrum->menuOrder[45] = 'dynamic';
$lang->scrum->menuOrder[55] = 'settings';
-$lang->scrum->menu->doc['subMenu'] = new stdclass();
-
$lang->scrum->menu->qa['subMenu'] = new stdclass();
//$lang->scrum->menu->qa['subMenu']->index = array('link' => "$lang->dashboard|project|qa|projectID=%s");
$lang->scrum->menu->qa['subMenu']->bug = array('link' => "{$lang->bug->common}|project|bug|projectID=%s", 'subModule' => 'bug');
@@ -289,8 +285,6 @@ $lang->waterfall->menuOrder[65] = 'build';
$lang->waterfall->menuOrder[70] = 'release';
$lang->waterfall->menuOrder[80] = 'dynamic';
-$lang->waterfall->menu->doc['subMenu'] = new stdclass();
-
$lang->waterfall->menu->programplan['subMenu'] = new stdclass();
$lang->waterfall->menu->programplan['subMenu']->lists = array('link' => "{$lang->stage->list}|programplan|browse|projectID=%s&productID=0&type=lists", 'alias' => 'create');
@@ -372,8 +366,6 @@ $lang->execution->menuOrder[60] = 'release';
$lang->execution->menuOrder[65] = 'action';
$lang->execution->menuOrder[70] = 'settings';
-$lang->execution->menu->doc['subMenu'] = new stdclass();
-
$lang->execution->menu->view['subMenu'] = new stdclass();
$lang->execution->menu->view['subMenu']->groupTask = "$lang->groupView|execution|grouptask|executionID=%s";
$lang->execution->menu->view['subMenu']->tree = "$lang->treeView|execution|tree|executionID=%s";
@@ -507,36 +499,21 @@ $lang->kanban->menu = new stdclass();
/* Doc menu. */
$lang->doc->menu = new stdclass();
$lang->doc->menu->dashboard = array('link' => "{$lang->dashboard}|doc|index");
-$lang->doc->menu->recent = array('link' => "{$lang->doc->recent}|doc|browse|browseTyp=byediteddate", 'alias' => 'recent');
-$lang->doc->menu->my = array('link' => "{$lang->doc->my}|doc|browse|browseTyp=openedbyme", 'alias' => 'my');
-$lang->doc->menu->collect = array('link' => "{$lang->doc->favorite}|doc|browse|browseTyp=collectedbyme", 'alias' => 'collect');
-$lang->doc->menu->product = array('link' => "{$lang->doc->product}|doc|tableContents|type=product", 'alias' => 'showfiles,product');
-$lang->doc->menu->api = array('link' => "{$lang->doc->api}|api|index", 'alias' => 'api');
-$lang->doc->menu->project = array('link' => "{$lang->doc->project}|doc|tableContents|type=project", 'alias' => 'showfiles,project');
-$lang->doc->menu->execution = array('link' => "{$lang->doc->execution}|doc|tableContents|type=execution", 'alias' => 'showfiles,execution');
-$lang->doc->menu->custom = array('link' => "{$lang->doc->custom}|doc|tableContents|type=custom", 'alias' => 'custom');
+$lang->doc->menu->my = array('link' => "{$lang->doc->mySpace}|doc|browse|browseTyp=openedbyme", 'alias' => 'my');
+$lang->doc->menu->product = array('link' => "{$lang->doc->productSpace}|doc|tableContents|type=product", 'alias' => 'showfiles,product');
+$lang->doc->menu->project = array('link' => "{$lang->doc->projectSpace}|doc|tableContents|type=project", 'alias' => 'showfiles,project');
+$lang->doc->menu->api = array('link' => "{$lang->doc->apiSpace}|api|index", 'alias' => 'api');
+$lang->doc->menu->custom = array('link' => "{$lang->doc->teamSpace}|doc|tableContents|type=custom", 'alias' => 'custom');
$lang->doc->dividerMenu = ',product,';
/* Doc menu order. */
$lang->doc->menuOrder[5] = 'dashboard';
-$lang->doc->menuOrder[10] = 'recent';
-$lang->doc->menuOrder[15] = 'my';
-$lang->doc->menuOrder[20] = 'collect';
-$lang->doc->menuOrder[25] = 'product';
-$lang->doc->menuOrder[30] = 'project';
-$lang->doc->menuOrder[35] = 'execution';
-$lang->doc->menuOrder[36] = 'api';
-$lang->doc->menuOrder[40] = 'custom';
-
-$lang->doc->menu->product['subMenu'] = new stdclass();
-$lang->doc->menu->project['subMenu'] = new stdclass();
-$lang->doc->menu->execution['subMenu'] = new stdclass();
-$lang->doc->menu->custom['subMenu'] = new stdclass();
-
-$lang->doc->menu->api['subMenu'] = new stdclass();
-$lang->doc->menu->api['subMenu']->index = array('link' => "{$lang->doc->apiDoc}|api|index|libID=%s", 'alias' => 'create,edit');
-$lang->doc->menu->api['subMenu']->struct = array('link' => "{$lang->doc->apiStruct}|api|struct|libID=%s", 'alias' => 'createstruct,editstruct');
+$lang->doc->menuOrder[10] = 'my';
+$lang->doc->menuOrder[15] = 'product';
+$lang->doc->menuOrder[20] = 'project';
+$lang->doc->menuOrder[25] = 'api';
+$lang->doc->menuOrder[30] = 'custom';
/* Report menu.*/
$lang->report->menu = new stdclass();
diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php
index 188b8d98e3..cdcbed17b7 100644
--- a/module/common/lang/zh-cn.php
+++ b/module/common/lang/zh-cn.php
@@ -276,17 +276,22 @@ $lang->project->kanban = $lang->projectCommon . '看板';
$lang->execution->executionKanban = "{$lang->execution->common}看板";
$lang->execution->all = "{$lang->execution->common}列表";
-$lang->doc->recent = '最近文档';
-$lang->doc->my = '我的文档';
-$lang->doc->favorite = '我的收藏';
-$lang->doc->product = $lang->productCommon . '库';
-$lang->doc->project = $lang->projectCommon . '库';
-$lang->doc->api = '接口库';
-$lang->doc->execution = "{$lang->execution->common}库";
-$lang->doc->custom = '自定义库';
-$lang->doc->wiki = 'WIKI';
-$lang->doc->apiDoc = '文档';
-$lang->doc->apiStruct = '数据结构';
+$lang->doc->recent = '最近文档';
+$lang->doc->my = '我的文档';
+$lang->doc->favorite = '我的收藏';
+$lang->doc->product = $lang->productCommon . '库';
+$lang->doc->project = $lang->projectCommon . '库';
+$lang->doc->api = '接口库';
+$lang->doc->execution = "{$lang->execution->common}库";
+$lang->doc->custom = '自定义库';
+$lang->doc->wiki = 'WIKI';
+$lang->doc->apiDoc = '文档';
+$lang->doc->apiStruct = '数据结构';
+$lang->doc->mySpace = '我的空间';
+$lang->doc->productSpace = "{$lang->productCommon}空间";
+$lang->doc->projectSpace = "{$lang->projectCommon}空间";
+$lang->doc->apiSpace = '接口空间';
+$lang->doc->teamSpace = '团队空间';
$lang->product->list = $lang->productCommon . '列表';
$lang->product->kanban = $lang->productCommon . '看板';
diff --git a/module/custom/model.php b/module/custom/model.php
index 78bbd24fb1..94f2ca30c4 100644
--- a/module/custom/model.php
+++ b/module/custom/model.php
@@ -285,6 +285,7 @@ class customModel extends model
foreach($item['subMenu'] as $subMenu)
{
if(!isset($subMenu['link']) or strpos($subMenu['link'], '|') === false) continue;
+ if(strpos("|program|product|project|execution|qa|", "|{$app->tab}|") === false and strpos($subMenu['link'], '%s') !== false) continue;
list($subLabel, $module, $method) = explode('|', $subMenu['link']);
if(count(explode('|', $subMenu['link'])) > 3) list($subLabel, $module, $method, $vars) = explode('|', $subMenu['link']);
diff --git a/module/doc/config.php b/module/doc/config.php
index 1d3d7bf145..f16bf98786 100644
--- a/module/doc/config.php
+++ b/module/doc/config.php
@@ -44,23 +44,25 @@ $config->doc->search['fields']['product'] = $lang->doc->product;
if($app->rawMethod == 'contribute') $config->doc->search['fields']['project'] = $lang->doc->project;
$config->doc->search['fields']['execution'] = $lang->doc->execution;
$config->doc->search['fields']['lib'] = $lang->doc->lib;
+$config->doc->search['fields']['status'] = $lang->doc->status;
$config->doc->search['fields']['module'] = $lang->doc->module;
-$config->doc->search['fields']['keywords'] = $lang->doc->keywords;
-$config->doc->search['fields']['addedBy'] = $lang->doc->addedBy;
+$config->doc->search['fields']['addedBy'] = $lang->doc->addedByAB;
$config->doc->search['fields']['addedDate'] = $lang->doc->addedDate;
$config->doc->search['fields']['editedBy'] = $lang->doc->editedBy;
$config->doc->search['fields']['editedDate'] = $lang->doc->editedDate;
+$config->doc->search['fields']['keywords'] = $lang->doc->keywords;
$config->doc->search['fields']['version'] = $lang->doc->version;
$config->doc->search['params']['title'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
-$config->doc->search['params']['keywords'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
$config->doc->search['params']['product'] = array('operator' => '=', 'control' => 'select', 'values' => '');
+$config->doc->search['params']['lib'] = array('operator' => '=', 'control' => 'select', 'values' => '');
+$config->doc->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->doc->statusList);
$config->doc->search['params']['module'] = array('operator' => 'belong', 'control' => 'select', 'values' => '');
if($app->rawMethod == 'contribute') $config->doc->search['params']['project'] = array('operator' => '=', 'control' => 'select', 'values' => '');
$config->doc->search['params']['execution'] = array('operator' => '=', 'control' => 'select', 'values' => '');
-$config->doc->search['params']['lib'] = array('operator' => '=', 'control' => 'select', 'values' => '' );
$config->doc->search['params']['addedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
$config->doc->search['params']['addedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->doc->search['params']['editedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
$config->doc->search['params']['editedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
+$config->doc->search['params']['keywords'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
$config->doc->search['params']['version'] = array('operator' => '=', 'control' => 'input', 'values' => '');
diff --git a/module/doc/control.php b/module/doc/control.php
index 11b4a8c5f7..2768945fd4 100755
--- a/module/doc/control.php
+++ b/module/doc/control.php
@@ -40,9 +40,6 @@ class doc extends control
$this->app->loadClass('pager', $static = true);
$pager = new pager(0, 5, 1);
- $actionURL = $this->createLink('doc', 'browse', "lib=0&browseType=bySearch&queryID=myQueryID");
- $this->doc->buildSearchForm(0, array(), 0, $actionURL, 'index');
-
$this->view->title = $this->lang->doc->common . $this->lang->colon . $this->lang->doc->index;
$this->view->position[] = $this->lang->doc->index;
@@ -132,72 +129,60 @@ class doc extends control
$libID = $this->doc->createlib();
if(!dao::isError())
{
- $objectType = $this->post->type;
- if($objectType == 'project' and $this->post->project) $objectID = $this->post->project;
- if($objectType == 'product' and $this->post->product) $objectID = $this->post->product;
- if($objectType == 'execution' and $this->post->execution) $objectID = $this->post->execution;
- if($objectType == 'custom' or $objectType == 'book') $objectID = 0;
+ if($type == 'project' and $this->post->project) $objectID = $this->post->project;
+ if($type == 'product' and $this->post->product) $objectID = $this->post->product;
+ if($type == 'execution' and $this->post->execution) $objectID = $this->post->execution;
+ if($type == 'custom') $objectID = 0;
$this->action->create('docLib', $libID, 'Created');
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $libID));
- return print(js::locate($this->createLink('doc', 'objectLibs', "type=$objectType&objectID=$objectID&libID=$libID"), 'parent.parent'));
+ return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.locateNewLib(\"$type\", \"$objectID\", \"$libID\")"));
}
else
{
- echo js::error(dao::getError());
+ return $this->send(array('result' => 'fail', 'message' => dao::getError()));
}
}
- $products = $this->product->getPairs();
- $projects = $this->project->getPairsByProgram('', 'all', true);
- $executions = $this->execution->getList();
+ if(in_array($type, array('product', 'project'))) $this->app->loadLang('api');
- /* Splice project name. */
- foreach($executions as $executionID => $execution)
+ $objects = array();
+ if($type == 'product') $objects = $this->product->getPairs();
+ if($type == 'project')
{
- if($execution->multiple)
+ $objects = $this->project->getPairsByProgram();
+ if($this->app->tab == 'doc')
{
- if($execution->type == 'stage' and $execution->grade > 1)
- {
- $parentExecutions = $this->dao->select('id,name')->from(TABLE_EXECUTION)->where('id')->in(trim($execution->path, ','))->andWhere('type')->in('stage,kanban,sprint')->orderBy('grade')->fetchPairs();
- $execution->name = implode('/', $parentExecutions);
- }
-
- $executionPrefix = isset($projects[$execution->project]) ? $projects[$execution->project] . '/' : '';
- $executions[$executionID] = $executionPrefix . $execution->name;
- }
- else
- {
- unset($executions[$executionID]);
+ $this->view->executionPairs = array(0 => '') + $this->execution->getPairs($objectID, 'all', 'multiple,leaf,noprefix');
+ $this->view->project = $this->project->getById($objectID);
}
}
- /* Get the project that has permission to view. */
- foreach($projects as $projectID => $project) if(!$this->app->user->admin and strpos(',' . $this->app->user->view->projects . ',', ',' . $projectID . ',') === false) unset($projects[$projectID]);
+ if($type == 'execution') $objects = $this->execution->getPairs(0, 'all', 'multiple,leaf,noprefix');
if($type == 'execution')
{
$execution = $this->execution->getByID($objectID);
if($execution->type == 'stage') $this->lang->doc->execution = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->doc->execution);
- if($execution->type == 'stage') $this->lang->doc->libTypeList['execution'] = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->doc->libTypeList['execution']);
}
- $libTypeList = $this->lang->doc->libTypeList;
- if(empty($products)) unset($libTypeList['product']);
- if(empty($projects)) unset($libTypeList['project']);
- if(empty($executions)) unset($libTypeList['execution']);
+ if($type == 'custom') unset($this->lang->doclib->aclList['default']);
+ if($type != 'custom')
+ {
+ $this->lang->doclib->aclList['default'] = sprintf($this->lang->doclib->aclList['default'], $this->lang->{$type}->common);
+ $this->lang->doclib->aclList['private'] = sprintf($this->lang->doclib->privateACL, $this->lang->{$type}->common);
+ unset($this->lang->doclib->aclList['open']);
+ }
$this->app->loadLang('api');
+ $this->lang->api->aclList['default'] = sprintf($this->lang->api->aclList['default'], $this->lang->{$type}->common);
- $this->view->groups = $this->loadModel('group')->getPairs();
- $this->view->users = $this->user->getPairs('nocode|noclosed');
- $this->view->products = $products;
- $this->view->projects = $projects;
- $this->view->executions = $executions;
- $this->view->type = $type;
- $this->view->libTypeList = $libTypeList;
- $this->view->objectID = $objectID;
+ $this->view->groups = $this->loadModel('group')->getPairs();
+ $this->view->users = $this->user->getPairs('nocode|noclosed');
+ $this->view->objects = $objects;
+ $this->view->type = $type;
+ $this->view->objectID = $objectID;
$this->display();
}
@@ -241,7 +226,8 @@ class doc extends control
}
$lib = $this->doc->getLibByID($libID);
- if(!empty($lib->product)) $this->view->product = $this->dao->select('id,name')->from(TABLE_PRODUCT)->where('id')->eq($lib->product)->fetch();
+ if(!empty($lib->product)) $this->view->object = $this->product->getByID($lib->product);
+ if(!empty($lib->project) and empty($lib->execution)) $this->view->object = $this->project->getById($lib->project);
if(!empty($lib->execution))
{
$execution = $this->execution->getByID($lib->execution);
@@ -256,8 +242,25 @@ class doc extends control
$this->lang->doc->execution = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->doc->execution);
}
- $this->view->execution = $execution;
+ $this->view->object = $execution;
}
+
+ if($lib->type == 'custom') unset($this->lang->doclib->aclList['default']);
+ if($lib->type == 'api')
+ {
+ $this->app->loadLang('api');
+ $type = !empty($lib->product) ? 'product' : 'project';
+ $this->lang->api->aclList['default'] = sprintf($this->lang->api->aclList['default'], $this->lang->{$type}->common);
+ }
+ if($lib->type != 'custom')
+ {
+ $type = isset($type) ? $type : $lib->type;
+ $this->lang->doclib->aclList['default'] = sprintf($this->lang->doclib->aclList['default'], $this->lang->{$type}->common);
+ $this->lang->doclib->aclList['private'] = sprintf($this->lang->doclib->privateACL, $this->lang->{$type}->common);
+ unset($this->lang->doclib->aclList['open']);
+ }
+ if(!empty($lib->main)) unset($this->lang->doclib->aclList['private'], $this->lang->doclib->aclList['open']);
+
$this->view->lib = $lib;
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->users = $this->user->getPairs('noletter|noclosed', $lib->users);
@@ -276,7 +279,7 @@ class doc extends control
* @access public
* @return void
*/
- public function deleteLib($libID, $confirm = 'no', $type = 'lib', $from = 'objectLibs')
+ public function deleteLib($libID, $confirm = 'no', $type = 'lib', $from = 'tableContents')
{
if($libID == 'product' or $libID == 'execution') return;
if($confirm == 'no')
@@ -295,9 +298,15 @@ class doc extends control
unset($_GET['onlybody']);
return print(js::locate($this->createLink('doc', 'objectLibs', 'type=book'), 'parent.parent'));
}
+ if($this->app->tab == 'doc' and $from == 'tableContents') return print(js::reload('parent'));
$objectType = $lib->type;
$objectID = strpos(',product,project,execution,', ",$objectType,") !== false ? $lib->{$objectType} : 0;
+ if(in_array($this->app->tab, array('project', 'doc')) and $objectType == 'execution')
+ {
+ $objectType = 'project';
+ $objectID = $lib->project;
+ }
$browseLink = $this->createLink('doc', $from, "type=$objectType&objectID=$objectID");
return print(js::locate($browseLink, 'parent'));
@@ -307,27 +316,33 @@ class doc extends control
/**
* Create a doc.
*
- * @param string $objectType
+ * @param string $objectType product|project|execution|custom
* @param int $objectID
* @param int|string $libID
* @param int $moduleID
- * @param string $docType
- * @param bool $fromGlobal
+ * @param string $docType html|word|ppt|excel
* @param string $from
* @access public
* @return void
*/
- public function create($objectType, $objectID, $libID, $moduleID = 0, $docType = '', $fromGlobal = false, $from = 'doc')
+ public function create($objectType, $objectID, $libID, $moduleID = 0, $docType = '', $from = 'doc')
{
+ $linkType = $objectType;
+ if($objectType == 'execution' and $this->app->tab != 'execution') $linkType = 'project';
+
if(!empty($_POST))
{
- setcookie('lastDocModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false);
+ $libID = $this->post->lib;
+ $moduleID = $this->post->module;
+ if(empty($libID) and strpos($this->post->module, '_') !== false) list($libID, $moduleID) = explode('_', $this->post->module);
+ setcookie('lastDocModule', $moduleID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false);
+
$docResult = $this->doc->create();
if(!$docResult or dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
$docID = $docResult['id'];
$files = zget($docResult, 'files', '');
- $lib = $this->doc->getLibByID($this->post->lib);
+ $lib = $this->doc->getLibByID($libID);
if($docResult['status'] == 'exists')
{
return $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->duplicate, $this->lang->doc->common), 'locate' => $this->createLink('doc', 'view', "docID=$docID")));
@@ -339,66 +354,75 @@ class doc extends control
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $docID));
$objectID = zget($lib, $lib->type, 0);
- $params = "type={$lib->type}&objectID=$objectID&libID={$lib->id}&docID=" . $docResult['id'];
+ $params = "type=$linkType&objectID=$objectID&libID={$lib->id}&docID=" . $docResult['id'];
$link = isonlybody() ? 'parent' : $this->createLink('doc', 'objectLibs', $params);
$response = array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link);
return $this->send($response);
}
- unset($_GET['onlybody']);
-
if($this->app->tab == 'product')
{
$this->product->setMenu($objectID);
- unset($this->lang->product->menu->doc['subMenu']);
}
- else if($this->app->tab == 'project')
+ elseif($this->app->tab == 'project')
{
- $this->project->setMenu($objectID);
- unset($this->lang->project->menu->doc['subMenu']);
+ $this->project->setMenu($this->session->project);
}
- else if($this->app->tab == 'execution')
+ elseif($this->app->tab == 'execution')
{
$this->execution->setMenu($objectID);
- unset($this->lang->execution->menu->doc['subMenu']);
}
else
{
$this->app->rawMethod = $objectType;
- unset($this->lang->doc->menu->product['subMenu']);
- unset($this->lang->doc->menu->custom['subMenu']);
- unset($this->lang->doc->menu->execution['subMenu']);
- unset($this->lang->doc->menu->project['subMenu']);
}
+ unset($_GET['onlybody']);
$this->config->showMainMenu = (strpos($this->config->doc->textTypes, $docType) === false or $from == 'template');
/* Get libs and the default lib id. */
- $gobackLink = ($objectID == 0 and $libID == 0) ? $this->createLink('doc', 'tableContents', "type=$objectType") : '';
+ $gobackLink = ($objectID == 0 and $libID == 0) ? $this->createLink('doc', 'tableContents', "type=$linkType") : '';
$unclosed = strpos($this->config->doc->custom->showLibs, 'unclosed') !== false ? 'unclosedProject' : '';
$libs = $this->doc->getLibs($objectType, $extra = "withObject,$unclosed", $libID, $objectID);
if(!$libID and !empty($libs)) $libID = key($libs);
- $lib = $this->doc->getLibByID($libID);
- $type = isset($lib->type) ? $lib->type : 'product';
- $libName = isset($lib->name) ? $lib->name . $this->lang->colon : '';
+ $lib = $this->doc->getLibByID($libID);
+ $objects = array();
+ if($objectType == 'project')
+ {
+ $objects = $this->loadModel('project')->getPairs();
+ $this->view->executions = array(0 => '') + $this->loadModel('execution')->getPairs($objectID, 'all', 'multiple,leaf,noprefix');
+ }
+ elseif($objectType == 'execution')
+ {
+ $execution = $this->loadModel('execution')->getById($objectID);
+ $objects = $this->execution->getPairs($execution->project, 'all', "multiple,leaf,noprefix");
+ }
+ elseif($objectType == 'product')
+ {
+ $objects = $this->loadModel('product')->getPairs();
+ }
+ $moduleOptionMenu = $this->doc->getLibsOptionMenu($libs);
- $this->view->title = $libName . $this->lang->doc->create;
+ $moduleID = $moduleID ? (int)$moduleID : (int)$this->cookie->lastDocModule;
+ $moduleID = $libID . '_' . $moduleID;
+ $this->view->title = zget($lib, 'name', '', $lib->name . $this->lang->colon) . $this->lang->doc->create;
+ $this->view->linkType = $linkType;
$this->view->objectType = $objectType;
$this->view->objectID = zget($lib, $lib->type, 0);
$this->view->libID = $libID;
$this->view->lib = $lib;
$this->view->libs = $libs;
+ $this->view->objects = $objects;
$this->view->gobackLink = $gobackLink;
- $this->view->libName = $this->dao->findByID($libID)->from(TABLE_DOCLIB)->fetch('name');
- $this->view->moduleOptionMenu = $this->tree->getOptionMenu($libID, 'doc', $startModuleID = 0);
- $this->view->moduleID = $moduleID ? (int)$moduleID : (int)$this->cookie->lastDocModule;
+ $this->view->libName = zget($lib, 'name', '');
+ $this->view->moduleOptionMenu = $moduleOptionMenu;
+ $this->view->moduleID = $moduleID;
$this->view->docType = $docType;
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->users = $this->user->getPairs('nocode|noclosed|nodeleted');
- $this->view->fromGlobal = $fromGlobal;
$this->view->from = $from;
$this->display();
@@ -495,24 +519,22 @@ class doc extends control
if($doc->contentType == 'markdown') $this->config->doc->markdown->edit = array('id' => 'content', 'tools' => 'toolbar');
- $lib = $this->doc->getLibByID($libID);
- $type = $lib->type;
+ $lib = $this->doc->getLibByID($libID);
+ $objectType = $lib->type;
+ $objectID = zget($lib, $objectType, 0);
/* Set menus. */
if($this->app->tab == 'product')
{
$this->product->setMenu($objectID);
- unset($this->lang->product->menu->doc['subMenu']);
}
else if($this->app->tab == 'project')
{
$this->project->setMenu($objectID);
- unset($this->lang->project->menu->doc['subMenu']);
}
else if($this->app->tab == 'execution')
{
$this->execution->setMenu($objectID);
- unset($this->lang->execution->menu->doc['subMenu']);
}
else if($this->app->tab == 'my')
{
@@ -523,45 +545,43 @@ class doc extends control
}
else
{
- $this->app->rawMethod = $objectType;
-
- unset($this->lang->doc->menu->product['subMenu']);
- unset($this->lang->doc->menu->custom['subMenu']);
- unset($this->lang->doc->menu->project['subMenu']);
- unset($this->lang->doc->menu->execution['subMenu']);
-
- /* High light menu. */
- if(strpos(',product,project,execution,custom,book,', ",$objectType,") !== false)
- {
- $menu = $this->lang->doc->menu->$objectType;
- $menu['alias'] .= ',edit';
- $menu['subModule'] = 'doc';
- $this->lang->doc->menu->$objectType = $menu;
- }
+ $this->app->rawMethod = $objectType == 'execution' ? 'project' : $objectType;
}
- $this->config->showMainMenu = strpos(',html,markdown,text,', ",{$doc->type},") === false;
+ $libs = $this->doc->getLibs($objectType, 'withObject', $libID, $objectID);
+ $objects = array();
+ if($objectType == 'project')
+ {
+ $objects = $this->loadModel('project')->getPairs();
+ }
+ elseif($objectType == 'execution')
+ {
+ $execution = $this->loadModel('execution')->getById($objectID);
+ $objects = $this->execution->getPairs($execution->project, 'all', "multiple,leaf,noprefix");
+ }
+ elseif($objectType == 'product')
+ {
+ $objects = $this->loadModel('product')->getPairs();
+ }
+ $moduleOptionMenu = $this->doc->getLibsOptionMenu($libs);
- $objects = $this->doc->getOrderedObjects($objectType);
- $appendLib = (!empty($lib) and $lib->deleted == '1') ? $libID : 0;
- $libs = $this->doc->getLibsByObject($objectType, $objectID, '', $appendLib);
- $this->lang->modulePageNav = $this->doc->select($objectType, $objects, $objectID, $libs, $libID);
- $this->lang->TRActions = common::hasPriv('doc', 'create') ? $this->doc->buildCreateButton4Doc($objectType, $objectID, $libID) : '';
+ $this->config->showMainMenu = strpos(',html,markdown,text,', ",{$doc->type},") === false;
$this->view->title = $lib->name . $this->lang->colon . $this->lang->doc->edit;
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$libID"), $lib->name);
$this->view->position[] = $this->lang->doc->edit;
$this->view->doc = $doc;
- $this->view->moduleOptionMenu = $this->tree->getOptionMenu($libID, 'doc', $startModuleID = 0);
- $this->view->type = $type;
- $this->view->libs = $this->doc->getLibs('all', 'withObject', $libID, $objectID, 'book');
+ $this->view->moduleOptionMenu = $moduleOptionMenu;
+ $this->view->type = $objectType;
+ $this->view->libs = $libs;
+ $this->view->objects = $objects;
$this->view->lib = $lib;
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->users = $this->user->getPairs('noletter|noclosed|nodeleted', $doc->users);
$this->view->from = $from;
$this->view->files = $this->loadModel('file')->getByObject('doc', $docID);
- $this->view->objectID = zget($lib, $type, 0);
+ $this->view->objectID = $objectID;
$this->display();
}
@@ -802,16 +822,19 @@ class doc extends control
}
/**
- * Ajax get modules by libID.
+ * Ajax get modules by object.
*
- * @param int $libID
+ * @param string $objectType
+ * @param int $objectID
* @access public
* @return void
*/
- public function ajaxGetModules($libID)
+ public function ajaxGetModules($objectType, $objectID)
{
- $moduleOptionMenu = $this->tree->getOptionMenu($libID, 'doc', $startModuleID = 0);
- return print(html::select('module', $moduleOptionMenu, 0, "class='form-control'"));
+ $unclosed = strpos($this->config->doc->custom->showLibs, 'unclosed') !== false ? 'unclosedProject' : '';
+ $libs = $this->doc->getLibs($objectType, $extra = "withObject,$unclosed", '', $objectID);
+ $moduleOptionMenu = $this->doc->getLibsOptionMenu($libs);
+ return print(html::select('module', $moduleOptionMenu, '', "class='form-control'"));
}
/**
@@ -945,7 +968,7 @@ class doc extends control
public function ajaxGetWhitelist($doclibID, $acl = '', $control = '', $docID = 0)
{
$doclib = $this->doc->getLibById($doclibID);
- $doc = $this->doc->getById($docID);
+ $doc = $docID ? $this->doc->getById($docID) : null;
$users = $this->user->getPairs('noletter|noempty|noclosed');
$selectedUser = $docID ? $doc->users : $doclib->users;
$selectedGroup = $docID ? $doc->groups : $doclib->groups;
@@ -958,7 +981,7 @@ class doc extends control
{
foreach($groups as $groupID => $group)
{
- if(strpos($doclib->groups, (string)$groupID) === false) unset($groups[$groupID]);
+ if(strpos(",{$doclib->groups},", ",{$groupID},") === false) unset($groups[$groupID]);
}
return print(html::select('groups[]', $groups, $selectedGroup, "class='form-control picker-select' multiple $dropDirection"));
}
@@ -976,21 +999,10 @@ class doc extends control
if(($doclib->acl == 'custom' or $doclib->acl == 'private') and strpos($doclib->users, (string)$account) === false ) unset($users[$account]);
}
- if($doclib->acl == 'custom')
- {
- return print(html::select('users[]', $users, $selectedUser, "multiple class='form-control picker-select' $dropDirection"));
- }
+ if($doclib->acl == 'custom') return print(html::select('users[]', $users, $selectedUser, "multiple class='form-control picker-select' $dropDirection"));
if($doclib->acl == 'open') return print(html::select('users[]', $users, $selectedUser, "multiple class='form-control picker-select' $dropDirection"));
if($doclib->acl == 'default') return print(html::select('users[]', $users, $selectedUser, "multiple class='form-control picker-select' $dropDirection"));
- if($doclib->acl == 'private' and $doclib->type == 'project')
- {
- echo 'project';
- }
- else
- {
- echo 'private';
- }
-
+ if($doclib->acl == 'private') echo 'private';
return false;
}
@@ -1001,7 +1013,6 @@ class doc extends control
$projectTeams = $this->loadModel('user')->getTeamMemberPairs($doclib->project);
$stakeholders = $this->loadModel('stakeholder')->getStakeHolderPairs($doclib->project);
$whitelist = implode(',', array_keys($projectTeams + $stakeholders)) . $project->whitelist . ',' . $project->PM . ',' . $doclib->users;
-
$selectedUser = $whitelist;
}
@@ -1023,49 +1034,47 @@ class doc extends control
* @access public
* @return void
*/
- public function showFiles($type, $objectID, $viewType = '', $orderBy = 't1.id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $searchTitle = '')
+ public function showFiles($type, $objectID, $viewType = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $searchTitle = '')
{
- if(empty($viewType)) $viewType = !empty($_COOKIE['docFilesViewType']) ? $this->cookie->docFilesViewType : 'card';
+ $this->loadModel('file');
+ if(empty($viewType)) $viewType = !empty($_COOKIE['docFilesViewType']) ? $this->cookie->docFilesViewType : 'list';
setcookie('docFilesViewType', $viewType, $this->config->cookieLife, $this->config->webRoot, '', false, true);
- $objects = $this->doc->getOrderedObjects($type);
- $objectID = $this->{$type}->saveState($objectID, $objects);
- $libs = $this->doc->getLibsByObject($type, $objectID);
- $this->lang->modulePageNav = $this->doc->select($type, $objects, $objectID, $libs);
-
- $tab = strpos('doc,product,project,execution', $this->app->tab) !== false ? $this->app->tab : 'doc';
- if($tab != 'doc') $this->loadModel($tab)->setMenu($objectID);
+ $objects = $this->doc->getOrderedObjects($type);
+ list($libs, $libID, $object, $objectID, $objectDropdown) = $this->doc->setMenuByType($type, $objectID, 0);
$table = $this->config->objectTables[$type];
$object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch();
- if(!empty($_POST)) $searchTitle = $this->post->title;
if(empty($_POST) and !empty($searchTitle)) $this->post->title = $searchTitle;
- $this->lang->TRActions = $this->doc->buildCollectButton4Doc();
- $this->lang->TRActions .= $this->doc->buildBrowseSwitch($type, $objectID, $viewType, $orderBy, $recTotal, $recPerPage, $pageID, $searchTitle);
-
/* Load pager. */
+ $rawMethod = $this->app->rawMethod;
+ $this->app->rawMethod = 'showFiles';
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
+ $this->app->rawMethod = $rawMethod;
$files = $this->doc->getLibFiles($type, $objectID, $orderBy, $pager);
$this->view->title = $object->name;
$this->view->position[] = $object->name;
- $this->view->type = $type;
- $this->view->object = $object;
- $this->view->files = $files;
- $this->view->users = $this->loadModel('user')->getPairs('noletter');
- $this->view->pager = $pager;
- $this->view->viewType = $viewType;
- $this->view->orderBy = $orderBy;
- $this->view->objectID = $objectID;
- $this->view->canBeChanged = common::canModify($type, $object); // Determines whether an object is editable.
- $this->view->summary = $this->doc->summary($files);
- $this->view->sourcePairs = $this->doc->getFileSourcePairs($files);
- $this->view->fileIcon = $this->doc->getFileIcon($files);
+ $this->view->type = $type;
+ $this->view->object = $object;
+ $this->view->files = $files;
+ $this->view->users = $this->loadModel('user')->getPairs('noletter');
+ $this->view->pager = $pager;
+ $this->view->viewType = $viewType;
+ $this->view->orderBy = $orderBy;
+ $this->view->objectID = $objectID;
+ $this->view->canBeChanged = common::canModify($type, $object); // Determines whether an object is editable.
+ $this->view->summary = $this->doc->summary($files);
+ $this->view->sourcePairs = $this->doc->getFileSourcePairs($files);
+ $this->view->fileIcon = $this->doc->getFileIcon($files);
+ $this->view->libTree = $this->doc->getLibTree(0, $libs, $type, 0, $objectID);
+ $this->view->objectDropdown = $objectDropdown;
+ $this->view->searchTitle = $searchTitle;
$this->display();
}
@@ -1157,9 +1166,6 @@ class doc extends control
/* Set Custom. */
foreach(explode(',', $this->config->doc->customObjectLibs) as $libType) $customObjectLibs[$libType] = $this->lang->doc->customObjectLibs[$libType];
- $actionURL = $this->createLink('doc', 'tableContents', "type=$type&objectID=$objectID&libID=$libID&browseType=bySearch¶m=myQueryID");
- $this->doc->buildSearchForm(0, array(), 0, $actionURL, $type);
-
$moduleTree = $type == 'book' ? $this->doc->getBookStructure($libID) : $this->doc->getTreeMenu($type, $objectID, $libID, 0, $docID);
/* Get doc. */
@@ -1273,7 +1279,9 @@ class doc extends control
* @param string $type
* @param int $objectID
* @param int $libID
- * @param string $browseType
+ * @param int $moduleID
+ * @param string $browseType all|draft|bysearch
+ * @param string $orderBy
* @param int $param
* @param int $recTotal
* @param int $recPerPage
@@ -1281,50 +1289,81 @@ class doc extends control
* @access public
* @return void
*/
- public function tableContents($type, $objectID = 0, $libID = 0, $browseType = '', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
+ public function tableContents($type, $objectID = 0, $libID = 0, $moduleID = 0, $browseType = 'all', $orderBy = 'status,id_desc', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
- list($libs, $libID, $object, $objectID) = $this->doc->setMenuByType($type, $objectID, $libID);
$this->session->set('createProjectLocate', $this->app->getURI(true), 'doc');
- $libID = (int)$libID;
+ 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);
- $title = ($type == 'book' or $type == 'custom') ? $this->lang->doc->tableContents : $object->name . $this->lang->colon . $this->lang->doc->tableContents;
+ $libTree = $this->doc->getLibTree($libID, $libs, $type, $moduleID, $objectID, $browseType);
+
+ $title = ($type == 'book' or $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;
- $actionURL = $this->createLink('doc', 'tableContents', "type=$type&objectID=$objectID&libID=$libID&browseType=bySearch¶m=myQueryID");
- $this->doc->buildSearchForm($libID, $libs, $queryID, $actionURL, $type);
-
- $this->view->title = $title;
- $this->view->type = $type;
- $this->view->browseType = $browseType;
- $this->view->param = $queryID;
- $this->view->users = $this->user->getPairs('noletter');
- if($browseType == 'bySearch')
+ $actionURL = $this->createLink('doc', 'tableContents', "type=$type&objectID=$objectID&libID=$libID&moduleID=0&browseType=bySearch&orderBy=$orderBy¶m=myQueryID");
+ if($libType == 'api')
{
- /* Load pager. */
- $rawMethod = $this->app->rawMethod;
- $this->app->rawMethod = 'tableContents';
- $this->app->loadClass('pager', $static = true);
- $pager = new pager($recTotal, $recPerPage, $pageID);
- $this->app->rawMethod = $rawMethod;
-
- $this->view->docs = $this->doc->getDocsBySearch($type, $objectID, $libID, $queryID, $pager);
- $this->view->browseType = 'bySearch';
- $this->view->pager = $pager;
- $this->display('doc', 'browse', "browseType=bySearch¶m=$queryID");
+ $this->loadModel('api')->buildSearchForm($lib, $queryID, $actionURL, $libs, $type);
}
else
{
- $this->view->libs = $libs;
- $this->view->objectID = $objectID;
- $this->view->libID = $libID;
- $this->view->moduleTree = $moduleTree;
-
- $this->display();
+ $this->doc->buildSearchForm($libID, $libs, $queryID, $actionURL, $type);
}
+
+ /* Load pager. */
+ $rawMethod = $this->app->rawMethod;
+ $this->app->rawMethod = 'tableContents';
+ $this->app->loadClass('pager', $static = true);
+ $pager = new pager($recTotal, $recPerPage, $pageID);
+ $this->app->rawMethod = $rawMethod;
+
+ if($libType == 'api')
+ {
+ $this->loadModel('api');
+ $this->session->set('objectName', $this->lang->doc->api, 'admin');
+
+ $this->view->libs = $libs;
+ $this->view->apiID = 0;
+ $this->view->release = 0;
+ $this->view->apiList = $browseType == 'bySearch' ? $this->api->getApiListBySearch($libID, $queryID, $type, array_keys($libs)) : $this->api->getListByModuleId($libID, $moduleID, 0, $pager);
+ }
+ else
+ {
+ if(in_array($type, array('product', 'project'))) $this->session->set('objectName', $this->lang->doc->common, 'admin');
+ if($this->config->vision == 'lite' or in_array($type, array('execution', 'custom'))) $this->session->set('objectName', '', 'admin');
+ $this->view->docs = $browseType == 'bySearch' ? $this->doc->getDocsBySearch($type, $objectID, $libID, $queryID, $orderBy, $pager) : $this->doc->getDocs($libID, $moduleID, $browseType, $orderBy, $pager);
+ }
+
+ $apiObjectType = $type == 'product' || $type == 'project' ? $type : '';
+ $apiObjectID = $apiObjectType ? $objectID : 0;
+ $apiLibs = $apiObjectType ? $this->doc->getApiLibs(0, $apiObjectType, $apiObjectID) : array();
+
+ $this->view->title = $title;
+ $this->view->type = $type;
+ $this->view->objectType = $type;
+ $this->view->browseType = $browseType;
+ $this->view->param = $queryID;
+ $this->view->users = $this->user->getPairs('noletter');
+ $this->view->libTree = $libTree;
+ $this->view->libID = $libID;
+ $this->view->moduleID = $moduleID;
+ $this->view->objectDropdown = $objectDropdown;
+ $this->view->lib = $lib;
+ $this->view->libType = $libType;
+ $this->view->pager = $pager;
+ $this->view->objectID = $objectID;
+ $this->view->orderBy = $orderBy;
+ $this->view->exportMethod = $type . '2export';
+ $this->view->canExport = common::hasPriv('doc', $type . '2export');
+ $this->view->apiLibID = key($apiLibs);
+
+ $this->display();
}
/**
@@ -1379,4 +1418,46 @@ class doc extends control
$this->view->libs = $this->doc->getLibs($type, '', '', $objectID);
$this->display();
}
+
+ /**
+ * Ajax get objectType drop menu.
+ *
+ * @param string $objectType
+ * @param int $objectID
+ * @param string $module
+ * @param string $method
+ * @access public
+ * @return void
+ */
+ public function ajaxGetDropMenu($objectType, $objectID, $module, $method)
+ {
+ list($myObjects, $normalObjects, $closedObjects) = $this->doc->getOrderedObjects($objectType, 'nomerge');
+
+ $this->view->objectType = $objectType;
+ $this->view->objectID = $objectID;
+ $this->view->module = $module;
+ $this->view->method = $method;
+ $this->view->normalObjects = $myObjects + $normalObjects;
+ $this->view->closedObjects = $closedObjects;
+ $this->view->objectsPinYin = common::convert2Pinyin($myObjects + $normalObjects + $closedObjects);
+
+ $this->display();
+ }
+
+ /**
+ * Ajax Get the execution drop down by the projectID.
+ *
+ * @param int $projectID
+ * @access public
+ * @return string
+ */
+ public function ajaxGetExecution($projectID)
+ {
+ $executions = $this->execution->getList($projectID);
+ $executionPairs = array(0 => '') + $this->execution->getPairs($projectID, 'all', 'multiple,leaf,noprefix');
+
+ $project = $this->project->getById($projectID);
+ $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'"));
+ }
}
diff --git a/module/doc/css/browse.css b/module/doc/css/browse.css
index 9f08480a4a..2d5431227c 100644
--- a/module/doc/css/browse.css
+++ b/module/doc/css/browse.css
@@ -1,2 +1,3 @@
-#mainContent .c-id {width: 70px;}
#mainContent .c-id > a {color: #0c60e1;}
+.btn.ajaxCollect {width: 20px; padding: 0px;}
+.btn.ajaxCollect > img {width: 20px;}
diff --git a/module/doc/css/common.css b/module/doc/css/common.css
index ac104128cb..8f07a8858b 100644
--- a/module/doc/css/common.css
+++ b/module/doc/css/common.css
@@ -104,3 +104,6 @@ ol, ul {margin-bottom: 0}
#subHeader .list-group>a.selected {color: #e9f2fb !important;}
#pageNav #dropMenu .table-col .list-group .icon-move {display:block; float: left; font-size: 12px; padding: 3px 4px 3px 1px;}
+
+#aclBox .acl-tip {color: #838a9d;}
+.ajaxCollect > img.star-empty {margin-right: 0px;}
diff --git a/module/doc/css/create.css b/module/doc/css/create.css
index 2371fb6c58..1cca647104 100644
--- a/module/doc/css/create.css
+++ b/module/doc/css/create.css
@@ -1,2 +1,42 @@
+.doc-title {width:400px;}
+.doc-title input {border: unset; font-size: 18px; font-weight: bold; color: #3c4353; padding-left: 16px;}
+.doc-title .form-control:focus {border: unset; box-shadow: unset;}
+.doc-title input::-webkit-input-placeholder {color: #D8DBDE;}
+.doc-title.required:after {top: 4px; right: 0; left: 12px; display: inline-table;}
+#savePath {display:inline-block; width:320px; overflow:hidden; white-space: nowrap; height: 19px; padding-top: 4px; padding-right:8px;}
+.contentmarkdown.required:after, .contenthtml.required:after {right:3px;}
+#headerBox {border-bottom: 1px solid #e3e3e3;}
+#headerBox td:last-child {padding-right: 24px;}
+#editorContent {padding: 0;}
+
+#contentBox {padding: 0; width: 100%;}
+#contentBox .ke-container {overflow: visible;}
+#contentBox .ke-container, #contentBox .contenthtml {border: unset; background: #efefef;}
+#contentBox .ke-container.focus {box-shadow: unset; border-color: unset;}
+#contentBox .ke-toolbar {padding-left: 20px; width: 100%; height: 30px;}
+#contentBox .ke-edit {border-top: 1px solid rgb(220, 220, 220)}
+#contentBox .ke-edit, #contentBox .CodeMirror {margin: 8px 200px 0 200px; background: #fff;}
+#contentBox .kindeditor-ph {padding: 20px 20px 0 20px !important;}
+#contentBox .editor-toolbar {background: #fff; padding-left: 20px; border-right: unset; border-top: unset; height: 30px;}
+#contentBox .CodeMirror {padding: 20px 20px 0 20px;}
+#contentBox .CodeMirror.CodeMirror-wrap {border-left: 0; border-right: 0; border-bottom: 0;}
+#contentBox .ke-statusbar {display: none;}
+#contentBox .contentmarkdown {background: #efefef;}
+
+.article-content {padding: 8px 20px;}
+
+#noticeAcl {margin-left: 10px; vertical-align: middle;}
+
+#basicInfoLink {border: unset;}
+
+#modalBasicInfo .modal-dialog {width:800px;}
+#modalBasicInfo .modal-content {padding:0px;}
+#modalBasicInfo .modal-body {padding:10px 30px 10px 10px; overflow-x: hidden !important;}
+#modalBasicInfo .modal-body .close {position:fixed; right:15px; top:15px}
+#basicInfoBox{margin-bottom: 10px;}
+#basicInfoBox tfoot td {padding-bottom: 0;}
+.aclBox .radio-inline{display:block; padding-bottom:5px;}
+.aclBox .radio-inline+.radio-inline {margin-left: 0px !important;}
+
#whiteListBox .input-group:last-child {margin-top: 10px;}
.fullscreen-save, .markdown-fullscreen-save {position: fixed; top: 10px; right: 30px; z-index: 999999;}
diff --git a/module/doc/css/createlib.css b/module/doc/css/createlib.css
index 7a5b6bbfba..bd883f57fb 100644
--- a/module/doc/css/createlib.css
+++ b/module/doc/css/createlib.css
@@ -1,10 +1,9 @@
.modal-dialog {width: 75%;}
-form {margin-bottom: 100px; padding-left: 65px;}
+form {margin-bottom: 50px;}
table {width: 90% !important;}
+#mainContent table th {width: 70px;}
#whiteListBox div.input-group {margin-bottom: 2px;}
-#product_chosen {width: 50% !important;}
-#execution_chosen {width: 50% !important;}
-
#groups_chosen.chosen-container .chosen-results, #users_chosen.chosen-container .chosen-results {max-height: 160px;}
+#aclBox > th {vertical-align: top; padding-top: 17px;}
diff --git a/module/doc/css/edit.css b/module/doc/css/edit.css
index 0863577432..8c7f6a87c8 100644
--- a/module/doc/css/edit.css
+++ b/module/doc/css/edit.css
@@ -1,3 +1,41 @@
+.doc-title {width:400px;}
+.doc-title input {border: unset; font-size: 18px; font-weight: bold; color: #3c4353; padding-left: 16px;}
+.doc-title .form-control:focus {border: unset; box-shadow: unset;}
+.doc-title input::-webkit-input-placeholder {color: #D8DBDE;}
+.doc-title.required:after {top: 4px; right: 0; left: 12px; display: inline-table;}
+#savePath {display:inline-block; width:320px; overflow:hidden; white-space: nowrap; height: 19px; padding-top: 4px; padding-right:8px;}
+.contenthtml.required:after {right:3px;}
+#headerBox {border-bottom: 1px solid #e3e3e3;}
+#headerBox td:last-child {padding-right: 24px;}
+#editorContent {padding: 0;}
+
+#contentBox {padding: 0; width: 100%;}
+#contentBox .ke-container {overflow: visible;}
+#contentBox .ke-container, #contentBox .contenthtml {border: unset; background: #efefef;}
+#contentBox .ke-container.focus {box-shadow: unset; border-color: unset;}
+#contentBox .ke-toolbar {padding-left: 20px; width: 100%; height: 30px;}
+#contentBox .ke-edit {border-top: 1px solid rgb(220, 220, 220)}
+#contentBox .ke-edit, #contentBox .CodeMirror {margin: 8px 200px 0 200px; background: #fff;}
+#contentBox .kindeditor-ph {padding: 20px 20px 0 20px !important;}
+#contentBox .editor-toolbar {background: #fff; padding-left: 20px; border-right: unset; border-top: unset; height: 30px;}
+#contentBox .CodeMirror {padding: 20px 20px 0 20px;}
+#contentBox .CodeMirror.CodeMirror-wrap {border-left: 0; border-right: 0; border-bottom: 0;}
+#contentBox .ke-statusbar {display: none;}
+
+.article-content {padding: 8px 20px;}
+
+#noticeAcl {margin-left: 10px; vertical-align: middle;}
+
+#basicInfoLink {border: unset;}
+
+#modalBasicInfo .modal-dialog {width:800px;}
+#modalBasicInfo .modal-content {padding:0px;}
+#modalBasicInfo .modal-body {padding:10px 30px 10px 10px; overflow-x: hidden !important;}
+#basicInfoBox{margin-bottom: 10px;}
+#basicInfoBox tfoot td {padding-bottom: 0;}
+.aclBox .radio-inline{display:block; padding-bottom:5px;}
+.aclBox .radio-inline+.radio-inline {margin-left: 0px !important;}
+
#whiteListBox .input-group:last-child {margin-top: 10px;}
#mainContent .main-header h2 {width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
.fullscreen-save, .markdown-fullscreen-save {position: fixed; top: 10px; right: 30px; z-index: 999999;}
diff --git a/module/doc/css/editlib.css b/module/doc/css/editlib.css
index 2acde0e1ba..d10167622b 100644
--- a/module/doc/css/editlib.css
+++ b/module/doc/css/editlib.css
@@ -3,5 +3,5 @@ form {margin-right: 30px;}
#whiteListBox div.input-group {margin-bottom: 2px;}
#whiteListBox .input-group:last-child {margin-top: 10px;}
-.center-block {margin-top: 20px;}
#groups_chosen.chosen-container .chosen-results, #users_chosen.chosen-container .chosen-results {max-height: 160px;}
+#aclBox > th {vertical-align: top; padding-top: 17px;}
diff --git a/module/doc/css/showfiles.css b/module/doc/css/showfiles.css
index 13a4255177..2c732fce6d 100644
--- a/module/doc/css/showfiles.css
+++ b/module/doc/css/showfiles.css
@@ -1,3 +1,57 @@
.c-id {width: 80px;}
.c-source {width: 300px;}
.c-size {width: 100px;}
+.c-type {width: 90px;}
+
+.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;}
+.img-lib {width: 14px; height: 14px; margin-bottom: 2px; flex: 0 0 14px;}
+#mainContent {padding-top: 0; padding-bottom: 0;}
+#mainContent #createDropdown {display: inline-block;}
+#mainContent #createDropdown ul {position: absolute;}
+#pageNav .dropdown-menu {max-height: inherit;}
+#mainContent > .panel {margin-bottom: 0; height: calc(100vh - 125px); overflow-y: auto;}
+#mainContent > .main-col {padding-left: 0;}
+
+.no-content {width: 100px; height: 100px; margin: 0 auto;}
+.notice {text-align: center; padding-left: 15px; padding-top: 20px;}
+.no-content-button {text-align: center; padding-top: 20px;}
+.no-content-button a:nth-child(2) {margin-left: 20px;}
+
+.cell .detail .detail-title {padding-left: 5px; list-style: none;}
+.menu-actions {position: absolute; top: 7px; right: 45px; padding: 7px 8px;}
+.detail ul {position: relative;}
+.tail-info {position: absolute; right: 0; padding-left: 10px; padding-top: 1px;}
+.tail-info, .doc-title, span.item {background: #fff;}
+span.item>a {padding-left: 6px;}
+span.dotted-line+a {display: block;}
+#modules li.doc:before, .chapterNode:before, .independent:before {content: " "; width: 100%; border-bottom: 1px dashed #b5b9c5; position: absolute; top: 13px; right: 0; left: 30px;}
+.doc-title ,.item{display: inline-block !important; position: relative; padding-right: 10px; max-width:80%; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;}
+#modules i.icon-file-text {color: #D0D2D6; font-size: 14px;}
+
+.sortable-sorting .module-name > a {cursor: move;}
+.sortable-sorting li >.tree-group {opacity: .5;}
+.sortable-sorting li:before {opacity: .3;}
+.sortable-sorting .drop-here .tree-group {background-color: #fff3e0;}
+.sortable-sorting .drop-here .tree-group > * {opacity: .1;}
+.sortable-sorting .drag-shadow .tree-group {opacity: 1!important;}
+.sortable-sorting .drag-shadow .tree-actions {visibility: hidden;}
+.is-sorting > li:before {opacity: 1;}
+.is-sorting > li > .tree-group {opacity: 1; border-radius: 4px;}
+.is-sorting > li ul {display: none!important;}
+li.drag-shadow ul {display: none!important;}
+
+#bysearchTab::before {display: none;}
+#leftBar .selectBox #currentItem {width: 150px; display: flex; align-items: center;}
+[lang^=zh] #leftBar .selectBox #currentItem {width: 180px;}
+#leftBar .selectBox #currentItem > .text {overflow: hidden; text-align: left; flex: 0 1 100%;}
+#leftBar .selectBox + .searchBox {padding-left: 5px;}
diff --git a/module/doc/css/tablecontents.css b/module/doc/css/tablecontents.css
index 8e12dc7d0f..871ee3c37b 100644
--- a/module/doc/css/tablecontents.css
+++ b/module/doc/css/tablecontents.css
@@ -1,7 +1,22 @@
-.main-content {padding-top: 0; padding-bottom: 0;}
-.main-content #createDropdown {display: inline-block;}
-.main-content #createDropdown ul {position: absolute;}
+.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;}
+#main {padding-bottom: 0;}
+.img-lib {width: 14px; height: 14px; margin-bottom: 2px; flex: 0 0 14px;}
+#mainContent {padding-top: 0; padding-bottom: 0;}
+#mainContent #createDropdown {display: inline-block;}
+#mainContent #createDropdown ul {position: absolute;}
#pageNav .dropdown-menu {max-height: inherit;}
+#mainContent > .panel {margin-bottom: 0; height: calc(100vh - 125px); overflow-y: auto;}
+#mainContent > .main-col {padding-left: 0;}
.no-content {width: 100px; height: 100px; margin: 0 auto;}
.notice {text-align: center; padding-left: 15px; padding-top: 20px;}
@@ -17,9 +32,7 @@ span.item>a {padding-left: 6px;}
span.dotted-line+a {display: block;}
#modules li.doc:before, .chapterNode:before, .independent:before {content: " "; width: 100%; border-bottom: 1px dashed #b5b9c5; position: absolute; top: 13px; right: 0; left: 30px;}
.doc-title ,.item{display: inline-block !important; position: relative; padding-right: 10px; max-width:80%; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;}
-.tree li.has-list.open:before {content: unset;}
#modules i.icon-file-text {color: #D0D2D6; font-size: 14px;}
-.tree li>a {max-width: 80%;}
.sortable-sorting .module-name > a {cursor: move;}
.sortable-sorting li >.tree-group {opacity: .5;}
@@ -33,6 +46,10 @@ span.dotted-line+a {display: block;}
.is-sorting > li ul {display: none!important;}
li.drag-shadow ul {display: none!important;}
-.tree-group {position: relative;}
-.tree-group > .module-name {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; display: block;}
-.tree li.has-list.open:before {left: 6px;}
+.table .c-name > .doc-title {display: inline-block; max-width: 90%; overflow: hidden; background: transparent; padding-right:0px;}
+.table .c-name > .draft {background-color:rgba(129, 102, 238, 0.12); color:#8166EE;}
+.table .c-name > .ajaxCollect {float: right; position: relative; right: 10px; top: 0px;}
+table.table > thead > tr {height: 32px;}
+
+#bysearchTab::before {display: none;}
+#queryBox #groupAndOr {min-width: 60px;}
diff --git a/module/doc/js/common.js b/module/doc/js/common.js
index be9b87367f..4d81139b9f 100644
--- a/module/doc/js/common.js
+++ b/module/doc/js/common.js
@@ -1,16 +1,31 @@
/**
- * Load modules by libID.
+ * Load modules by objectID and objectType.
*
- * @param int $libID
+ * @param string $objectType
+ * @param int $objectID
* @access public
* @return void
*/
-function loadModules(libID)
+function loadObjectModules(objectType, objectID)
{
- var link = createLink('doc', 'ajaxGetModules', 'libID=' + libID);
+ var link = createLink('doc', 'ajaxGetModules', 'objectType=' + objectType + '&objectID=' + objectID);
$('#moduleBox').load(link, function(){$('#moduleBox').find('select').chosen()});
}
+/**
+ * Load executions.
+ *
+ * @param int $projectID
+ * @access public
+ * @return void
+ */
+function loadExecutions(projectID)
+{
+ var link = createLink('project', 'ajaxGetExecutions', "projectID=" + projectID + "&executionID=0&mode=multiple,leaf,noprefix");
+ $('#executionBox').load(link, function(){$('#executionBox').find('select').attr('data-placeholder', holders.execution).attr('onchange', "loadObjectModules('execution', this.value)").chosen()});
+ loadObjectModules('project', projectID);
+}
+
/**
* Toggle acl.
*
@@ -22,35 +37,25 @@ function loadModules(libID)
function toggleAcl(acl, type)
{
var libID = $('#lib').val();
- if(acl == 'custom')
+ if($('#lib').length == 0 && $('#module').length > 0)
+ {
+ var moduleID = $('#module').val();
+ if(moduleID.indexOf('_') >= 0) libID = moduleID.substr(0, moduleID.indexOf('_'));
+ }
+ if(acl == 'private')
{
$('#whiteListBox').removeClass('hidden');
$('#groupBox').removeClass('hidden');
- if(type == 'doc') loadWhitelist(libID);
- }
- else if(acl == 'private')
- {
- $('#whiteListBox').removeClass('hidden');
- $('#groupBox').addClass('hidden');
- if(type == 'doc')
- {
- loadWhitelist(libID);
- $('#whiteListBox').addClass('hidden');
- }
}
else
{
$('#whiteListBox').addClass('hidden');
- if(type == 'doc') loadWhitelist(libID);
+ $('#groupBox').addClass('hidden');
}
if(type == 'lib')
{
- var libType = $('input[name="type"]:checked').val();
- var notice = typeof(noticeAcl[libType][acl]) != 'undefined' ? noticeAcl[libType][acl] : '';
- $('#noticeAcl').html(notice);
-
- if((libType == 'custom' || libType == 'api' || libType == 'book') && acl == 'private') $('#whiteListBox').addClass('hidden');
+ if(libType == 'book' && acl == 'private') $('#whiteListBox').addClass('hidden');
if(libType == 'project' && typeof(doclibID) != 'undefined')
{
@@ -63,10 +68,11 @@ function toggleAcl(acl, type)
})
}
}
- else
+ else if(type == 'doc')
{
- var notice = typeof(noticeAcl[acl]) != 'undefined' ? noticeAcl[acl] : '';
- $('#noticeAcl').html(notice);
+ $('#whiteListBox').toggleClass('hidden', acl == 'open');
+ $('#groupBox').toggleClass('hidden', acl == 'open');
+ loadWhitelist(libID);
}
}
@@ -82,9 +88,8 @@ function loadDocModule(libID)
var link = createLink('doc', 'ajaxGetChild', 'libID=' + libID);
$.post(link, function(data)
{
- $('#module').replaceWith(data);
- $('#module_chosen').remove();
- $('#module').chosen();
+ $('#moduleBox').html(data);
+ $('#module').picker();
});
loadWhitelist(libID);
@@ -279,23 +284,74 @@ $(document).ready(function()
}).on('click', function(e){e.stopPropagation()});
}
- $(document).on('mousedown', '.ajaxCollect', function (event) {
+ $(document).on('mousedown', '.ajaxCollect', function (event)
+ {
var obj = $(this);
var url = obj.data('url');
$.get(url, function(response)
{
if(response.status == 'yes')
{
- obj.children('i').removeClass().addClass('icon icon-star text-yellow');
+ obj.children('img').attr('src', 'static/svg/star.svg');
obj.parent().prev().children('.file-name').children('i').remove('.icon');
obj.parent().prev().children('.file-name').prepend('
');
}
else
{
- obj.children('i').removeClass().addClass('icon icon-star-empty');
+ obj.children('img').attr('src', 'static/svg/star-empty.svg');
obj.parent().prev().children('.file-name').children('i').remove(".icon");
}
}, 'json');
return false;
});
});
+
+function locateNewLib(type, objectID, libID)
+{
+ location.href = createLink('doc', 'tableContents', 'type=' + type + '&objectID=' + objectID + '&libID=' + libID);
+}
+
+/**
+ * Set save path.
+ *
+ * @access public
+ * @return void
+ */
+function setSavePath()
+{
+ savePath = defaultSave;
+ if($('#modalBasicInfo #product').length == 1)
+ {
+ savePath += $('#modalBasicInfo #product option:checked').text() + '/';
+ }
+ else if($('#modalBasicInfo #project').length == 1 && $('#modalBasicInfo #execution').length == 0)
+ {
+ savePath += $('#modalBasicInfo #project option:checked').text() + '/';
+ }
+ else if($('#modalBasicInfo #project').length == 1 && $('#modalBasicInfo #execution').length == 1)
+ {
+ if($('#modalBasicInfo #execution').val() == '') savePath += $('#modalBasicInfo #project option:checked').text() + '/';
+ if($('#modalBasicInfo #execution').val() != '') savePath += $('#modalBasicInfo #execution option:checked').text() + '/';
+ }
+ else if($('#modalBasicInfo #execution').length == 1)
+ {
+ savePath += $('#modalBasicInfo #execution option:checked').text() + '/';
+ }
+ savePath += $('#modalBasicInfo #module option:checked').text();
+
+ $('#savePath').html(savePath).attr('title', savePath);
+}
+
+/**
+ * Submit form.
+ *
+ * @param object $object
+ * @access public
+ * @return void
+ */
+function submit(object)
+{
+ $(object).attr('type', 'submit');
+ $('#dataform').submit();
+ setTimeout(function(){$(object).attr('type', 'button').removeAttr('disabled')}, 2000);
+}
diff --git a/module/doc/js/create.js b/module/doc/js/create.js
index 9745391a60..9fecfc5fec 100644
--- a/module/doc/js/create.js
+++ b/module/doc/js/create.js
@@ -1,21 +1,56 @@
$(function()
{
- toggleAcl($('input[name="acl"]:checked').val(), 'doc');
- setTimeout(function(){initPage(docType)}, 50);
- $('input[name="type"]').change(function()
+ /* Set editor content height. */
+ var contentHeight = $(document).height() - 92;
+ setTimeout(function(){$('.ke-edit-iframe, .ke-edit, .ke-edit-textarea').height(contentHeight);}, 100);
+ setTimeout(function(){$('.CodeMirror').height($(document).height() - 112);}, 100);
+ $('iframe.ke-edit-iframe').contents().find('.article-content').css('padding', '20px 20px 0 20px');
+
+ setSavePath();
+
+ /* Change for show create error. */
+ $('#contentBox #content').attr('id', 'contentHTML');
+ /* Copy doc title to modal title. */
+ $('#modalBasicInfo').on('show.zui.modal', function()
{
- var type = $(this).val();
- if(type == 'text')
- {
- $('#contentBox').removeClass('hidden');
- $('#urlBox').addClass('hidden');
- }
- else if(type == 'url')
- {
- $('#contentBox').addClass('hidden');
- $('#urlBox').removeClass('hidden');
- }
+ $('#modalBasicInfo #copyTitle').html($('.doc-title #editorTitle').val().replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"));
});
+ $('#modalBasicInfo').on('hide.zui.modal', function(){setSavePath();});
+
+ $('#saveDraft').click(function()
+ {
+ if($('#editorTitle').val() == '')
+ {
+ bootbox.alert(titleNotEmpty);
+ return false;
+ }
+ $('#status').val('draft');
+ submit(this);
+ });
+ $('#releaseBtn').click(function(){submit(this);});
+ $('#basicInfoLink').click(function()
+ {
+ if($('#editorTitle').val() == '')
+ {
+ bootbox.alert(titleNotEmpty);
+ return false;
+ }
+ if(requiredFields.indexOf('content') >= 0)
+ {
+ var contentType = $('#contentType').val();
+ var content = '';
+ if(contentType == 'html') content = $('#contentHTML').val();
+ if(contentType == 'markdown')content = $('#contentMarkdown').val();
+ if(content == '')
+ {
+ bootbox.alert(contentNotEmpty);
+ return false;
+ }
+ }
+ $('#status').val('normal');
+ });
+
+ setTimeout(function(){initPage(docType)}, 50);
if(typeof(window.editor) != 'undefined')
{
$('.ke-toolbar .ke-outline:last').after("
Markdown");
@@ -61,68 +96,6 @@ $(function()
});
if($(".createCustomLib").length == 1) $(".createCustomLib").click(); // Fix bug #15139.
-
- if(!fromGlobal && textType.indexOf(docType) != -1 && from == 'doc')
- {
- var basicInfo = JSON.parse(sessionStorage.getItem('docBasicInfo'));
-
- var libID = 0;
- var moduleID = 0;
- var title = '';
- var keywords = '';
- var type = '';
- var acl = '';
- var contentType = '';
- var fileNames = [];
- var mailto = [];
- var groups = [];
- var users = [];
-
- $.each(basicInfo, function(index, value)
- {
- switch(value.name)
- {
- case 'lib':
- libID = value.value;
- break;
- case 'module':
- moduleID = value.value;
- break;
- case 'title':
- title = value.value;
- break;
- case 'keywords':
- keywords = value.value;
- break;
- case 'type':
- type = value.value;
- break;
- case 'acl':
- acl = value.value;
- break;
- case 'contentType':
- contentType = value.value;
- break;
- case 'mailto[]':
- mailto.push(value.value);
- break;
- case 'groups[]':
- groups.push(value.value);
- break;
- case 'users[]':
- users.push(value.value);
- break;
- }
- })
-
- $('#title').val(title);
- $('#modalBasicInfo #keywords').val(keywords);
- $('#modalBasicInfo #mailto').data('zui.picker').setValue(mailto);
- $('#modalBasicInfo input:radio[value='+ acl +']').attr('checked', 'checked');
- toggleAcl($('input[name="acl"]:checked').val(), 'doc');
- setTimeout(function(){$('#modalBasicInfo #groups').data('zui.picker').setValue(groups)}, 1000);
- setTimeout(function(){$('#modalBasicInfo #users').data('zui.picker').setValue(users)}, 1000);
- }
})
function toggleEditor(type)
@@ -187,25 +160,8 @@ function loadWhitelist(libID)
$.post(userLink, function(users)
{
- if(users == 'private')
+ if(users != 'private')
{
- $('#aclopen').parent('.radio-inline').addClass('hidden');
- $('#aclcustom').parent('.radio-inline').addClass('hidden');
- $('#whiteListBox').addClass('hidden');
- $('#aclprivate').prop('checked', true);
- }
- else if(users == 'project')
- {
- $('#aclprivate').parent('.radio-inline').addClass('hidden');
- $('#aclcustom').parent('.radio-inline').addClass('hidden');
- $('#whiteListBox').addClass('hidden');
- $('#aclopen').prop('checked', true);
- }
- else
- {
- $('#aclopen').parent('.radio-inline').removeClass('hidden');
- $('#aclcustom').parent('.radio-inline').removeClass('hidden');
-
$('#users').replaceWith(users);
$('#users').next('.picker').remove();
$('#users').picker();
diff --git a/module/doc/js/createlib.js b/module/doc/js/createlib.js
index 109cb8c86a..0d3ada2de4 100644
--- a/module/doc/js/createlib.js
+++ b/module/doc/js/createlib.js
@@ -1,143 +1,33 @@
-$(function()
+$('#project').change(function()
{
- $('input[name="type"]').change(function()
+ $.get(createLink('doc', 'ajaxGetExecution', 'projectID=' + $(this).val()), function(data)
{
- var libType = $(this).val();
- changeByLibType(libType);
- })
- changeByLibType($('input[name="type"]:checked').val());
- toggleAcl($('form [name=acl]:checked').val(), 'lib');
+ if(data)
+ {
+ $('#execution').replaceWith(data);
+ $('#execution_chosen').remove();
+ $('#execution').chosen();
+ }
+ });
});
-/**
- * Change form by lib type.
- *
- * @param string libType
- * @access public
- * @return void
- */
-function changeByLibType(libType)
-{
- if(libType == 'product')
- {
- $('table tr.product').removeClass('hidden');
- $('#product').attr('disabled', false);
-
- $('table tr.project').addClass('hidden');
- $('#project').attr('disabled', true);
-
- $('table tr.execution').addClass('hidden');
- $('#execution').attr('disabled', true);
-
- $('.normalLib').removeClass('hidden');
- $('.normalLib input').attr('disabled', false);
-
- $('table tr.apilib').addClass('hidden');
- $('.apilib input, #desc, #baseUrl').attr('disabled', true);
-
- $('form').removeAttr('action');
-
- changeDoclibAcl(libType);
- }
- else if(libType == 'project')
- {
- $('table tr.project').removeClass('hidden');
- $('#project').attr('disabled', false);
-
- $('table tr.product').addClass('hidden');
- $('#product').attr('disabled', true);
-
- $('table tr.execution').addClass('hidden');
- $('#execution').attr('disabled', true);
-
- $('.normalLib').removeClass('hidden');
- $('.normalLib input').attr('disabled', false);
-
- $('table tr.apilib').addClass('hidden');
- $('.apilib input, #desc, #baseUrl').attr('disabled', true);
-
- $('form').removeAttr('action');
-
- changeDoclibAcl(libType);
- }
- else if(libType == 'execution')
- {
- $('table tr.execution').removeClass('hidden');
- $('#execution').attr('disabled', false);
-
- $('table tr.product').addClass('hidden');
- $('#product').attr('disabled', true);
-
- $('table tr.project').addClass('hidden');
- $('#project').attr('disabled', true);
-
- $('.normalLib').removeClass('hidden');
- $('.normalLib input').attr('disabled', false);
-
- $('table tr.apilib').addClass('hidden');
- $('.apilib input, #desc, #baseUrl').attr('disabled', true);
-
- $('form').removeAttr('action');
-
- changeDoclibAcl(libType);
- }
- else if(libType == 'api')
- {
- $('table tr.product').addClass('hidden');
- $('#product').attr('disabled', true);
-
- $('table tr.project').addClass('hidden');
- $('#project').attr('disabled', true);
-
- $('table tr.execution').addClass('hidden');
- $('#execution').attr('disabled', true);
-
- $('.normalLib').addClass('hidden');
- $('.normalLib input').attr('disabled', true);
-
- $('table tr.apilib').removeClass('hidden');
- $('.apilib input, #desc, #baseUrl').attr('disabled', false);
-
- $('form').attr('action', createLink('api', 'createLib'));
-
- changeDoclibAcl(libType);
- }
- else
- {
- $('table tr.product').addClass('hidden');
- $('#product').attr('disabled', true);
-
- $('table tr.project').addClass('hidden');
- $('#project').attr('disabled', true);
-
- $('table tr.execution').addClass('hidden');
- $('#execution').attr('disabled', true);
-
- $('.normalLib').removeClass('hidden');
- $('.normalLib input').attr('disabled', false);
-
- $('table tr.apilib').addClass('hidden');
- $('.apilib input, #desc, #baseUrl').attr('disabled', true);
-
- $('form').removeAttr('action');
-
- changeDoclibAcl(libType);
- }
-
- var acl = $('form [name=acl]').val();
- var notice = typeof(noticeAcl[libType][acl]) != 'undefined' ? noticeAcl[libType][acl] : '';
- $('#noticeAcl').html(notice);
- $('#whiteListBox').addClass('hidden');
-}
-
function changeDoclibAcl(libType)
{
- if(libType == 'product' || libType == 'execution')
+ if(libType == 'api')
{
- $('form input[name="acl"]').closest('td').find('span:first').html($('#aclBoxA td').html());
+ $('.apilib').removeClass('hidden');
+ $('#mainContent table th').css('width', '100px');
+ $('#aclBox').find('td').html($('#aclAPIBox td').html());
+
+ $('.executionBox').addClass('hidden');
}
else
{
- $('form input[name="acl"]').closest('td').find('span:first').html($('#aclBoxB td').html());
+ $('.apilib').addClass('hidden');
+ $('#mainContent table th').css('width', '70px');
+ $('#aclBox').find('td').html($('#aclOtherBox td').html());
+
+ $('.executionBox').removeClass('hidden');
}
+ $('#whiteListBox').addClass('hidden');
}
diff --git a/module/doc/js/edit.js b/module/doc/js/edit.js
index c5c0f24b49..83e3d51d72 100644
--- a/module/doc/js/edit.js
+++ b/module/doc/js/edit.js
@@ -1,5 +1,31 @@
$(function()
{
+ /* Set editor content height. */
+ var contentHeight = $(document).height() - 92;
+ setTimeout(function(){$('.ke-edit-iframe, .ke-edit, .ke-edit-textarea').height(contentHeight);}, 100);
+ setTimeout(function(){$('.CodeMirror').height($(document).height() - 112);}, 100);
+ $('iframe.ke-edit-iframe').contents().find('.article-content').css('padding', '20px 20px 0 20px');
+
+ setSavePath();
+ $('#modalBasicInfo').on('hide.zui.modal', function(){setSavePath();});
+
+ $('#saveDraft').click(function()
+ {
+ if($('#editorTitle').val() == '')
+ {
+ bootbox.alert(titleNotEmpty);
+ return false;
+ }
+
+ $('#status').val('draft');
+ submit(this);
+ });
+ $('#saveRelease').click(function()
+ {
+ $('#status').val('normal');
+ submit(this);
+ });
+
setTimeout(function()
{
if(needUpdateContent && confirm(confirmUpdateContent))
@@ -16,21 +42,6 @@ $(function()
$(this).addClass('disabled');
$('form').submit();
})
- toggleAcl($('input[name="acl"]:checked').val(), 'doc');
- $('input[name="type"]').change(function()
- {
- var type = $(this).val();
- if(type == 'text')
- {
- $('#contentBox').removeClass('hidden');
- $('#urlBox').addClass('hidden');
- }
- else if(type == 'url')
- {
- $('#contentBox').addClass('hidden');
- $('#urlBox').removeClass('hidden');
- }
- });
$('#subNavbar li[data-id="doc"]').addClass('active');
@@ -149,25 +160,8 @@ function loadWhitelist(libID)
$.post(userLink, function(users)
{
- if(users == 'private')
+ if(users != 'private')
{
- $('#aclopen').parent('.radio-inline').addClass('hidden');
- $('#aclcustom').parent('.radio-inline').addClass('hidden');
- $('#whiteListBox').addClass('hidden');
- $('#aclprivate').prop('checked', true);
- }
- else if(users == 'project')
- {
- $('#aclprivate').parent('.radio-inline').addClass('hidden');
- $('#aclcustom').parent('.radio-inline').addClass('hidden');
- $('#whiteListBox').addClass('hidden');
- $('#aclopen').prop('checked', true);
- }
- else
- {
- $('#aclopen').parent('.radio-inline').removeClass('hidden');
- $('#aclcustom').parent('.radio-inline').removeClass('hidden');
-
$('#users').replaceWith(users);
$('#users').next('.picker').remove();
$('#users').picker();
diff --git a/module/doc/js/selectlibtype.js b/module/doc/js/selectlibtype.js
index 4ca7d52cb6..e8b8ae5c76 100644
--- a/module/doc/js/selectlibtype.js
+++ b/module/doc/js/selectlibtype.js
@@ -14,15 +14,20 @@ $(function()
*/
function redirectParentWindow(objectType, libID, docType)
{
- config.onlybody = 'no';
if(objectType == 'api')
{
- var link = createLink('api', 'create', 'libID=' + libID) + '#app=doc';
- }
- else
- {
- var link = createLink('doc', 'create', 'objectType=' + objectType + '&objectID=0&libID=' + libID + '&moduleID=0&docType=' + docType + '&fromGlobal=true') + '#app=doc';
+ parent.$.closeModal(function()
+ {
+ new parent.$.zui.ModalTrigger({
+ iframe : createLink('api', 'create', 'libID=' + libID),
+ width: '85%'
+ }).show();
+ });
+ return false;
}
+
+ config.onlybody = 'no';
+ var link = createLink('doc', 'create', 'objectType=' + objectType + '&objectID=0&libID=' + libID + '&moduleID=0&docType=' + docType) + '#app=doc';
window.parent.$.apps.open(link);
}
diff --git a/module/doc/js/showfiles.js b/module/doc/js/showfiles.js
index 0061aba87c..a990cd5a83 100644
--- a/module/doc/js/showfiles.js
+++ b/module/doc/js/showfiles.js
@@ -1,7 +1,16 @@
$(function()
{
- if(tab != 'doc') return;
+ $('#leftBar .searchBox #title').keypress(function(e)
+ {
+ if(e.which == 13)
+ {
+ $(this).closest('form').attr('action', searchLink.replace('%s', $(this).val()));
+ }
+ });
- $('#navbar .nav li').removeClass('active');
- $("#navbar .nav li[data-id=" + type + ']').addClass('active');
-});
+ $('#leftBar .searchBox #submit').click(function(e)
+ {
+ var searchTitle = $(this).prev('#title').val();
+ $(this).closest('form').attr('action', searchLink.replace('%s', searchTitle));
+ });
+})
diff --git a/module/doc/js/tablecontents.js b/module/doc/js/tablecontents.js
index d11c77d92a..f41f3c5a5e 100644
--- a/module/doc/js/tablecontents.js
+++ b/module/doc/js/tablecontents.js
@@ -1,98 +1,11 @@
$(function()
{
- if(!moduleTree || moduleTree.length == 0)
+ $('#docListForm .table .c-name').each(function()
{
- var contentHeight = $('.no-content').parent().innerHeight();
- var titleHeight = $('.cell div:nth-child(1)').innerHeight();
-
- var height = $(document).height() - $('#header').height() - parent.$('#appsBar').height() - (2 * parseInt($('#main').css('padding-top')));
- $('.main-content .cell').height(height);
- $('.no-content').parent().css('padding-top', (height - contentHeight)/2 - titleHeight + 'px');
- }
-
- $('#main .main-content li.has-list').addClass('open in');
-
- $('.menu-actions > a').click(function()
- {
- $(this).parent().hasClass('open') ? $(this).css('background', 'none') : $(this).css('background', '#f1f1f1');
- })
-
- $('.menu-actions > a').blur(function() {$(this).css('background', 'none');})
-
- /* Make modules tree sortable. */
- $('#modules').sortable(
- {
- trigger: '.module-name>a.sort-module, .tree-actions>.sortModule>.icon-move, a.sortDoc, .tree-actions>.sortDoc>.icon-move',
- dropToClass: 'sort-to',
- stopPropagation: true,
- nested: true,
- selector: 'li',
- dragCssClass: 'drop-here',
- canMoveHere: function($ele, $target)
- {
- var maxTop = $('.side-col > .cell > ul').height() - $ele.height();
- if(parseFloat($('.drag-shadow').css('top')) < 0) $('.drag-shadow').css('top', '0');
- if(parseFloat($('.drag-shadow').css('left')) != 0) $('.drag-shadow').css('left', '0');
- if(parseFloat($('.drag-shadow').css('top')) > maxTop) $('.drag-shadow').css('top', maxTop + 'px');
- return true;
- },
- targetSelector: function($ele, $root)
- {
- var $ul = $ele.closest('ul');
- setTimeout(function()
- {
- if($('#modules').hasClass('sortable-sorting')) $ul.addClass('is-sorting');
- }, 100);
-
- if($ele.hasClass('sortDoc'))
- {
- return $ul.children('li.sortDoc');
- }
- else
- {
- return $ul.children('li.catalog');
- }
- },
- always: function()
- {
- $('#modules,#modules .is-sorting').removeClass('is-sorting');
- },
- finish: function(e)
- {
- if(!e.changed) return;
-
- var orders = {};
- var link = '';
- var elementClass = e.list.context.className;
- if(elementClass.indexOf('sortDoc') >= 0)
- {
- $('#modules').find('li.sortDoc').each(function()
- {
- var $li = $(this);
-
- var item = $li.data();
- orders['orders[' + item.id + ']'] = $li.attr('data-order') || item.order;
- });
-
- link = createLink('doc', 'updateOrder');
- }
- else
- {
- $('#modules').find('li.can-sort').each(function()
- {
- var $li = $(this);
-
- var item = $li.data();
- '' == 'book' ? orders['sort[' + item.id + ']'] = $li.attr('data-order') || item.order : orders['orders[' + item.id + ']'] = $li.attr('data-order') || item.order;
- });
-
- link = createLink('tree', 'updateOrder');
- }
-
- $.post(link, orders, function(data){}).error(function()
- {
- bootbox.alert(lang.timeout);
- });
- }
- });
-})
+ var $this = $(this);
+ if($this.find('.draft').length > 0)
+ {
+ $this.find('.doc-title').css('max-width', parseInt($this.width()) - parseInt($this.find('.draft').width()) - parseInt($this.find('.ajaxCollect').width()) - parseInt($this.find('.file-icon').width()) - 24);
+ }
+ });
+});
diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php
index ae37b277a0..595e9e7264 100644
--- a/module/doc/lang/de.php
+++ b/module/doc/lang/de.php
@@ -19,7 +19,14 @@ $lang->doclib->all = 'Alle Bibliotheken';
$lang->doclib->select = 'Auswahl';
$lang->doclib->execution = $lang->executionCommon . ' Bibliothek';
$lang->doclib->product = $lang->productCommon . ' Bibliothek';
-$lang->doclib->apiLibName = 'Api Library Name';
+$lang->doclib->apiLibName = 'Library Name';
+$lang->doclib->privateACL = "Private
(Only creators and whitelisted users with %s permissions can access it)";
+
+$lang->doclib->tip = new stdclass();
+$lang->doclib->tip->selectExecution = "When execution is empty, the library created is the {$lang->projectCommon} library";
+
+$lang->doclib->type['wiki'] = 'WIKI';
+$lang->doclib->type['api'] = 'API';
$lang->doclib->aclListA = array();
$lang->doclib->aclListA['default'] = 'Default';
@@ -29,6 +36,11 @@ $lang->doclib->aclListB['open'] = 'Public';
$lang->doclib->aclListB['custom'] = 'Custom';
$lang->doclib->aclListB['private'] = 'Private';
+$lang->doclib->aclList = array();
+$lang->doclib->aclList['open'] = "Public
(Users who can access doccan access it)";
+$lang->doclib->aclList['default'] = "Default
(Users who can access the selected %s or users in the whiltelist can access it)";
+$lang->doclib->aclList['private'] = "Private
(Only the one who created it or users in the whiltelist can access it)";
+
$lang->doclib->create['product'] = 'Create ' . $lang->productCommon . ' Library';
$lang->doclib->create['execution'] = 'Create ' . $lang->executionCommon . ' Library';
$lang->doclib->create['custom'] = 'Create Custom Library';
@@ -43,6 +55,11 @@ $lang->doclib->tabList['custom'] = 'Custom';
$lang->doclib->nameList['custom'] = 'Custom Name';
+$lang->doclib->apiNameUnique = array();
+$lang->doclib->apiNameUnique['product'] = 'In the api library of the same ' . $lang->productCommon . ', ';
+$lang->doclib->apiNameUnique['project'] = 'In the api library of the same ' . $lang->projectCommon . ', ';
+$lang->doclib->apiNameUnique['nolink'] = 'In the no linked api library, ';
+
/* Fields. */
$lang->doc->common = 'Dok';
$lang->doc->id = 'ID';
@@ -51,6 +68,7 @@ $lang->doc->project = $lang->projectCommon;
$lang->doc->execution = $lang->execution->common;
$lang->doc->lib = 'Bibliothek';
$lang->doc->module = 'Modul';
+$lang->doc->libAndModule = 'Bibliothek & Modul';
$lang->doc->object = 'Object';
$lang->doc->title = 'Titel';
$lang->doc->digest = 'Zusammenfassung';
@@ -58,13 +76,14 @@ $lang->doc->comment = 'Bemerkung';
$lang->doc->type = 'Typ';
$lang->doc->content = 'Text';
$lang->doc->keywords = 'Tags';
+$lang->doc->status = 'Status';
$lang->doc->url = 'URL';
$lang->doc->files = 'Datei';
$lang->doc->addedBy = 'Angelegt von';
-$lang->doc->addedByAB = 'Added';
-$lang->doc->addedDate = 'Angelegt am';
+$lang->doc->addedByAB = 'CreatedBy';
+$lang->doc->addedDate = 'CreatedDate';
$lang->doc->editedBy = 'Bearbeitet von';
-$lang->doc->editedDate = 'Bearbeitet am';
+$lang->doc->editedDate = 'UpdatedDate';
$lang->doc->lastEditedBy = 'Last Editor';
$lang->doc->version = 'Version';
$lang->doc->basicInfo = 'Basis Info';
@@ -97,6 +116,9 @@ $lang->doc->order = 'Order';
$lang->doc->doc = 'Document';
$lang->doc->updateOrder = 'Update Order';
$lang->doc->nextStep = 'Next';
+$lang->doc->closed = 'Closed';
+$lang->doc->saveDraft = 'Save Draft';
+$lang->doc->defaultSave = 'Default Save: ';
$lang->doc->moduleDoc = 'Nach Modulen';
$lang->doc->searchDoc = 'Suche';
@@ -136,27 +158,30 @@ $lang->doc->collect = 'Favorit hinzufügen';
$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->libName = 'Name';
-$lang->doc->libType = 'Kategorie';
-$lang->doc->custom = 'Eigene Dok Bibliothek';
-$lang->doc->customAB = 'Eigene Bibliothek';
-$lang->doc->createLib = 'Document Library';
-$lang->doc->allLibs = 'Bibliothek';
-$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->executionCommon} Bibliothek Liste";
-$lang->doc->showFiles = 'Dok Bibliothek';
-$lang->doc->editLib = 'Edit Document Library';
-$lang->doc->deleteLib = 'Bibliothek löschen';
-$lang->doc->fixedMenu = 'Im Menü fixieren';
-$lang->doc->removeMenu = 'Vom Menü entfernen';
-$lang->doc->search = 'Suche';
-$lang->doc->allCollections = 'All Collections';
-$lang->doc->keywordsTips = 'Please use commas to separate multiple keywords.';
-$lang->doc->sortLibs = 'Sort Libs';
-$lang->doc->titlePlaceholder = 'Please enter the title';
-$lang->doc->confirm = 'Confirm';
+$lang->doc->libName = 'Name';
+$lang->doc->libType = 'Kategorie';
+$lang->doc->custom = 'Eigene Dok Bibliothek';
+$lang->doc->customAB = 'Eigene Bibliothek';
+$lang->doc->createLib = 'Create Library';
+$lang->doc->allLibs = 'Bibliothek';
+$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->executionCommon} Bibliothek Liste";
+$lang->doc->showFiles = 'Dok Bibliothek';
+$lang->doc->editLib = 'Edit Document Library';
+$lang->doc->deleteLib = 'Bibliothek löschen';
+$lang->doc->fixedMenu = 'Im Menü fixieren';
+$lang->doc->removeMenu = 'Vom Menü entfernen';
+$lang->doc->search = 'Suche';
+$lang->doc->allCollections = 'All Collections';
+$lang->doc->keywordsTips = 'Please use commas to separate multiple keywords.';
+$lang->doc->sortLibs = 'Sort Libs';
+$lang->doc->titlePlaceholder = 'Please enter the title';
+$lang->doc->confirm = 'Confirm';
+$lang->doc->docSummary = 'Total:
%s.';
+$lang->doc->docCheckedSummary = 'Seleted:
%total%.';
global $config;
/* Query condition list. */
@@ -179,9 +204,12 @@ $lang->doc->libIconList['custom'] = 'icon-folder-o';
$lang->doc->systemLibs['product'] = $lang->productCommon . 'Dok Bibliothek';
$lang->doc->systemLibs['execution'] = $lang->executionCommon . 'Dok Bibliothek';
-$lang->doc->aclList['open'] = 'Öffentlich';
-$lang->doc->aclList['custom'] = 'Eigene';
-$lang->doc->aclList['private'] = 'Privat';
+$lang->doc->statusList[''] = "";
+$lang->doc->statusList['normal'] = "Released";
+$lang->doc->statusList['draft'] = "Draft";
+
+$lang->doc->aclList['open'] = "Öffentlich
(Access with library permissions)";
+$lang->doc->aclList['private'] = "Privat
(Only creators and whitelist users can access)";
$lang->doc->typeList['html'] = 'Html';
$lang->doc->typeList['markdown'] = 'Markdown';
@@ -190,6 +218,12 @@ $lang->doc->typeList['word'] = 'Word';
$lang->doc->typeList['ppt'] = 'PPT';
$lang->doc->typeList['excel'] = 'Excel';
+$lang->doc->createList['html'] = 'Create Document';
+$lang->doc->createList['template'] = 'Create By Template';
+$lang->doc->createList['word'] = 'Word';
+$lang->doc->createList['ppt'] = 'PPT';
+$lang->doc->createList['excel'] = 'Excel';
+
$lang->doc->types['text'] = 'Text';
$lang->doc->types['url'] = 'URL';
@@ -237,7 +271,7 @@ $lang->doc->accessDenied = "Zugriff verweigert!";
$lang->doc->versionNotFount = 'Existiert nicht in diesem Build.';
$lang->doc->noDoc = 'Keine Dokumente. ';
$lang->doc->noArticle = 'No articles.';
-$lang->doc->noLib = 'No libraries. ';
+$lang->doc->noLib = 'No libraries.';
$lang->doc->noBook = 'The WIKI library has not created a manual, please create a new one :)';
$lang->doc->cannotCreateOffice = 'Sorry, %s file can only be created in ZenTao Biz Series or above. Contact Philip@easysoft.ltd to know more about ZenTao Biz Series and ZenTao Max Series.';
$lang->doc->notSetOffice = "
To create a %s document, you need to configure office convert.
";
@@ -271,8 +305,20 @@ $lang->doc->noticeAcl['doc']['custom'] = 'Users in the whiltelist can access it
$lang->doc->noticeAcl['doc']['private'] = 'Only the one who created it can access it.';
$lang->doc->placeholder = new stdclass();
-$lang->doc->placeholder->url = 'Url';
+$lang->doc->placeholder->url = 'URL';
+$lang->doc->placeholder->execution = 'When the execution is empty, the document is created in the project library';
$lang->doc->summary = "Total files on this page: %s , total size: %s, %s.";
$lang->doc->ge = ':';
$lang->doc->point = '.';
+
+$lang->doc->libDropdown['editLib'] = 'Edit Library';
+$lang->doc->libDropdown['deleteLib'] = 'Delete Library';
+$lang->doc->libDropdown['addModule'] = 'Add Directory';
+$lang->doc->libDropdown['addSameModule'] = 'Add Same Directory';
+$lang->doc->libDropdown['addSubModule'] = 'Add Sub Directory';
+$lang->doc->libDropdown['editModule'] = 'Edit Directory';
+$lang->doc->libDropdown['delModule'] = 'Delete Directory';
+
+$lang->doc->featureBar['tableContents']['all'] = 'All';
+$lang->doc->featureBar['tableContents']['draft'] = 'Draft';
diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php
index 134e0dda8e..cbf0de56ac 100644
--- a/module/doc/lang/en.php
+++ b/module/doc/lang/en.php
@@ -19,7 +19,14 @@ $lang->doclib->all = 'All Libraries';
$lang->doclib->select = 'Select';
$lang->doclib->execution = $lang->executionCommon . ' Library';
$lang->doclib->product = $lang->productCommon . ' Library';
-$lang->doclib->apiLibName = 'Api Library Name';
+$lang->doclib->apiLibName = 'Library Name';
+$lang->doclib->privateACL = "Private (Only creators and whitelisted users with %s permissions can access it)";
+
+$lang->doclib->tip = new stdclass();
+$lang->doclib->tip->selectExecution = "When execution is empty, the library created is the {$lang->projectCommon} library";
+
+$lang->doclib->type['wiki'] = 'WIKI';
+$lang->doclib->type['api'] = 'API';
$lang->doclib->aclListA = array();
$lang->doclib->aclListA['default'] = 'Default';
@@ -29,6 +36,11 @@ $lang->doclib->aclListB['open'] = 'Public';
$lang->doclib->aclListB['custom'] = 'Custom';
$lang->doclib->aclListB['private'] = 'Private';
+$lang->doclib->aclList = array();
+$lang->doclib->aclList['open'] = "Public (Users who can access doccan access it)";
+$lang->doclib->aclList['default'] = "Default (Users who can access the selected %s or users in the whiltelist can access it)";
+$lang->doclib->aclList['private'] = "Private (Only the one who created it or users in the whiltelist can access it)";
+
$lang->doclib->create['product'] = 'Create ' . $lang->productCommon . ' Library';
$lang->doclib->create['execution'] = 'Create ' . $lang->executionCommon . ' Library';
$lang->doclib->create['custom'] = 'Create Custom Library';
@@ -43,6 +55,11 @@ $lang->doclib->tabList['custom'] = 'Custom';
$lang->doclib->nameList['custom'] = 'Custom Name';
+$lang->doclib->apiNameUnique = array();
+$lang->doclib->apiNameUnique['product'] = 'In the api library of the same ' . $lang->productCommon . ', ';
+$lang->doclib->apiNameUnique['project'] = 'In the api library of the same ' . $lang->projectCommon . ', ';
+$lang->doclib->apiNameUnique['nolink'] = 'In the no linked api library, ';
+
/* Fields. */
$lang->doc->common = 'Document';
$lang->doc->id = 'ID';
@@ -51,6 +68,7 @@ $lang->doc->project = $lang->projectCommon;
$lang->doc->execution = $lang->execution->common;
$lang->doc->lib = 'Library';
$lang->doc->module = 'Catalog';
+$lang->doc->libAndModule = 'Library & Catalog';
$lang->doc->object = 'Object';
$lang->doc->title = 'Name';
$lang->doc->digest = 'Summary';
@@ -58,13 +76,14 @@ $lang->doc->comment = 'Comment';
$lang->doc->type = 'Type';
$lang->doc->content = 'Text';
$lang->doc->keywords = 'Tags';
+$lang->doc->status = 'Status';
$lang->doc->url = 'URL';
$lang->doc->files = 'Files';
$lang->doc->addedBy = 'Author';
-$lang->doc->addedByAB = 'Added';
-$lang->doc->addedDate = 'Added';
+$lang->doc->addedByAB = 'CreatedBy';
+$lang->doc->addedDate = 'CreatedDate';
$lang->doc->editedBy = 'UpdatedBy';
-$lang->doc->editedDate = 'Updated';
+$lang->doc->editedDate = 'UpdatedDate';
$lang->doc->lastEditedBy = 'Last Editor';
$lang->doc->version = 'Version';
$lang->doc->basicInfo = 'Basic Information';
@@ -97,6 +116,9 @@ $lang->doc->order = 'Order';
$lang->doc->doc = 'Document';
$lang->doc->updateOrder = 'Update Order';
$lang->doc->nextStep = 'Next';
+$lang->doc->closed = 'Closed';
+$lang->doc->saveDraft = 'Save Draft';
+$lang->doc->defaultSave = 'Default Save: ';
$lang->doc->moduleDoc = 'By Module';
$lang->doc->searchDoc = 'Search';
@@ -136,27 +158,30 @@ $lang->doc->collect = 'Add Favorite';
$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->libName = 'Document Library';
-$lang->doc->libType = 'Category';
-$lang->doc->custom = 'Custom Document Library';
-$lang->doc->customAB = 'Custom Doc Lib';
-$lang->doc->createLib = 'Document Library';
-$lang->doc->allLibs = 'Library List';
-$lang->doc->objectLibs = "Document View of Library";
-$lang->doc->showFiles = 'Attachments';
-$lang->doc->editLib = 'Edit Document Library';
-$lang->doc->deleteLib = 'Delete Document Library';
-$lang->doc->fixedMenu = 'Fix to Menu';
-$lang->doc->removeMenu = 'Remove from Menu';
-$lang->doc->search = 'Search';
-$lang->doc->allCollections = 'All Collections';
-$lang->doc->keywordsTips = 'Please use commas to separate keywords.';
-$lang->doc->sortLibs = 'Sort Libs';
-$lang->doc->titlePlaceholder = 'Please enter the title';
-$lang->doc->confirm = 'Confirm';
+$lang->doc->libName = 'Document Library';
+$lang->doc->libType = 'Category';
+$lang->doc->custom = 'Custom Document Library';
+$lang->doc->customAB = 'Custom Doc Lib';
+$lang->doc->createLib = 'Create Library';
+$lang->doc->allLibs = 'Library List';
+$lang->doc->objectLibs = "Document View of Library";
+$lang->doc->showFiles = 'Attachments';
+$lang->doc->editLib = 'Edit Document Library';
+$lang->doc->deleteLib = 'Delete Document Library';
+$lang->doc->fixedMenu = 'Fix to Menu';
+$lang->doc->removeMenu = 'Remove from Menu';
+$lang->doc->search = 'Search';
+$lang->doc->allCollections = 'All Collections';
+$lang->doc->keywordsTips = 'Please use commas to separate keywords.';
+$lang->doc->sortLibs = 'Sort Libs';
+$lang->doc->titlePlaceholder = 'Please enter the title';
+$lang->doc->confirm = 'Confirm';
+$lang->doc->docSummary = 'Total: %s.';
+$lang->doc->docCheckedSummary = 'Seleted: %total%.';
global $config;
/* Query condition list. */
@@ -179,9 +204,12 @@ $lang->doc->libIconList['custom'] = 'icon-folder-o';
$lang->doc->systemLibs['product'] = $lang->productCommon;
$lang->doc->systemLibs['execution'] = $lang->executionCommon;
-$lang->doc->aclList['open'] = 'Public';
-$lang->doc->aclList['custom'] = 'Custom';
-$lang->doc->aclList['private'] = 'Private';
+$lang->doc->statusList[''] = "";
+$lang->doc->statusList['normal'] = "Released";
+$lang->doc->statusList['draft'] = "Draft";
+
+$lang->doc->aclList['open'] = "Public (Access with library permissions)";
+$lang->doc->aclList['private'] = "Private (Only creators and whitelist users can access)";
$lang->doc->typeList['html'] = 'Html';
$lang->doc->typeList['markdown'] = 'Markdown';
@@ -190,6 +218,12 @@ $lang->doc->typeList['word'] = 'Word';
$lang->doc->typeList['ppt'] = 'PPT';
$lang->doc->typeList['excel'] = 'Excel';
+$lang->doc->createList['html'] = 'Create Document';
+$lang->doc->createList['template'] = 'Create By Template';
+$lang->doc->createList['word'] = 'Word';
+$lang->doc->createList['ppt'] = 'PPT';
+$lang->doc->createList['excel'] = 'Excel';
+
$lang->doc->types['text'] = 'Text';
$lang->doc->types['url'] = 'URL';
@@ -237,7 +271,7 @@ $lang->doc->accessDenied = "Access is denied!";
$lang->doc->versionNotFount = 'It does not exist in this build.';
$lang->doc->noDoc = 'No documents. ';
$lang->doc->noArticle = 'No articles.';
-$lang->doc->noLib = 'No libraries. ';
+$lang->doc->noLib = 'No libraries.';
$lang->doc->noBook = 'The WIKI library has not created a manual, please create a new one :)';
$lang->doc->cannotCreateOffice = 'Sorry, %s file can only be created in ZenTao Biz Series or above. Contact Philip@easysoft.ltd to know more about ZenTao Biz Series and ZenTao Max Series.';
$lang->doc->notSetOffice = "
To create a %s document, you need to configure office convert.
";
@@ -271,8 +305,20 @@ $lang->doc->noticeAcl['doc']['custom'] = 'Users in the whiltelist can access it
$lang->doc->noticeAcl['doc']['private'] = 'Only the one who created it can access it.';
$lang->doc->placeholder = new stdclass();
-$lang->doc->placeholder->url = 'URL';
+$lang->doc->placeholder->url = 'URL';
+$lang->doc->placeholder->execution = 'When the execution is empty, the document is created in the project library';
$lang->doc->summary = "Total files on this page: %s , total size: %s, %s.";
$lang->doc->ge = ':';
$lang->doc->point = '.';
+
+$lang->doc->libDropdown['editLib'] = 'Edit Library';
+$lang->doc->libDropdown['deleteLib'] = 'Delete Library';
+$lang->doc->libDropdown['addModule'] = 'Add Directory';
+$lang->doc->libDropdown['addSameModule'] = 'Add Same Directory';
+$lang->doc->libDropdown['addSubModule'] = 'Add Sub Directory';
+$lang->doc->libDropdown['editModule'] = 'Edit Directory';
+$lang->doc->libDropdown['delModule'] = 'Delete Directory';
+
+$lang->doc->featureBar['tableContents']['all'] = 'All';
+$lang->doc->featureBar['tableContents']['draft'] = 'Draft';
diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php
index d88ae22836..f8f8f89e14 100644
--- a/module/doc/lang/fr.php
+++ b/module/doc/lang/fr.php
@@ -19,7 +19,14 @@ $lang->doclib->all = 'Toutes les Libraries';
$lang->doclib->select = 'Sélect.';
$lang->doclib->execution = 'Bibliothèque ' . $lang->executionCommon;
$lang->doclib->product = $lang->productCommon . ' Library';
-$lang->doclib->apiLibName = 'Api Library Name';
+$lang->doclib->apiLibName = 'Library Name';
+$lang->doclib->privateACL = "Private (Only creators and whitelisted users with %s permissions can access it)";
+
+$lang->doclib->tip = new stdclass();
+$lang->doclib->tip->selectExecution = "When execution is empty, the library created is the {$lang->projectCommon} library";
+
+$lang->doclib->type['wiki'] = 'WIKI';
+$lang->doclib->type['api'] = 'API';
$lang->doclib->aclListA = array();
$lang->doclib->aclListA['default'] = 'Défaut';
@@ -29,6 +36,11 @@ $lang->doclib->aclListB['open'] = 'Public';
$lang->doclib->aclListB['custom'] = 'Person.';
$lang->doclib->aclListB['private'] = 'Privée';
+$lang->doclib->aclList = array();
+$lang->doclib->aclList['open'] = "Public (Users who can access doccan access it)";
+$lang->doclib->aclList['default'] = "Default (Users who can access the selected %s or users in the whiltelist can access it)";
+$lang->doclib->aclList['private'] = "Private (Only the one who created it or users in the whiltelist can access it)";
+
$lang->doclib->create['product'] = 'Créer ' . $lang->productCommon . ' Library';
$lang->doclib->create['execution'] = 'Créer ' . 'Bibliothèque ' . $lang->executionCommon;
$lang->doclib->create['custom'] = 'Créer Bibliothèque Personnelle';
@@ -43,6 +55,11 @@ $lang->doclib->tabList['custom'] = 'Personnelle';
$lang->doclib->nameList['custom'] = 'Nom personnalisé';
+$lang->doclib->apiNameUnique = array();
+$lang->doclib->apiNameUnique['product'] = 'In the api library of the same ' . $lang->productCommon . ', ';
+$lang->doclib->apiNameUnique['project'] = 'In the api library of the same ' . $lang->projectCommon . ', ';
+$lang->doclib->apiNameUnique['nolink'] = 'In the no linked api library, ';
+
/* Fields. */
$lang->doc->common = 'Gestion Documentaire';
$lang->doc->id = 'ID';
@@ -51,6 +68,7 @@ $lang->doc->project = $lang->projectCommon;
$lang->doc->execution = $lang->execution->common;
$lang->doc->lib = 'Bibliothèque';
$lang->doc->module = 'Catégorie';
+$lang->doc->libAndModule = 'Library & Catalog';
$lang->doc->object = 'Object';
$lang->doc->title = 'Nom';
$lang->doc->digest = 'Résumé';
@@ -58,13 +76,14 @@ $lang->doc->comment = 'Commentaire';
$lang->doc->type = 'Type';
$lang->doc->content = 'Texte';
$lang->doc->keywords = 'Tags';
+$lang->doc->status = 'Status';
$lang->doc->url = 'URL';
$lang->doc->files = 'Fichiers';
$lang->doc->addedBy = 'Auteur';
-$lang->doc->addedByAB = 'Added';
-$lang->doc->addedDate = 'Ajouté le';
+$lang->doc->addedByAB = 'CreatedBy';
+$lang->doc->addedDate = 'CreatedDate';
$lang->doc->editedBy = 'Màj par';
-$lang->doc->editedDate = 'Màj le';
+$lang->doc->editedDate = 'UpdatedDate';
$lang->doc->lastEditedBy = 'Last Editor';
$lang->doc->version = 'Version';
$lang->doc->basicInfo = 'Infos de Base';
@@ -97,6 +116,9 @@ $lang->doc->order = 'Order';
$lang->doc->doc = 'Document';
$lang->doc->updateOrder = 'Update Order';
$lang->doc->nextStep = 'Next';
+$lang->doc->closed = 'Closed';
+$lang->doc->saveDraft = 'Save Draft';
+$lang->doc->defaultSave = 'Default Save: ';
$lang->doc->moduleDoc = 'Par Module';
$lang->doc->searchDoc = 'Rechercher';
@@ -136,27 +158,30 @@ $lang->doc->collect = 'Ajouter aux Favoris';
$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->libName = 'Bibliothèque de Documents';
-$lang->doc->libType = 'Catégorie';
-$lang->doc->custom = 'Personnaliser Bibliothèque de Documents';
-$lang->doc->customAB = 'Person. Bib Doc';
-$lang->doc->createLib = 'Document Library';
-$lang->doc->allLibs = 'Liste des Bibliothèque';
-$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->executionCommon} Bibliothèque";
-$lang->doc->showFiles = 'Pièces Jointes';
-$lang->doc->editLib = 'Edit Document Library';
-$lang->doc->deleteLib = 'Supprimer Bibliothèque';
-$lang->doc->fixedMenu = 'Coller au Menu';
-$lang->doc->removeMenu = 'Décoller du Menu';
-$lang->doc->search = 'Rechercher';
-$lang->doc->allCollections = 'All Collections';
-$lang->doc->keywordsTips = 'Please use commas to separate multiple keywords.';
-$lang->doc->sortLibs = 'Sort Libs';
-$lang->doc->titlePlaceholder = 'Veuillez saisir le titre';
-$lang->doc->confirm = 'Confirm';
+$lang->doc->libName = 'Bibliothèque de Documents';
+$lang->doc->libType = 'Catégorie';
+$lang->doc->custom = 'Personnaliser Bibliothèque de Documents';
+$lang->doc->customAB = 'Person. Bib Doc';
+$lang->doc->createLib = 'Create Library';
+$lang->doc->allLibs = 'Liste des Bibliothèque';
+$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->executionCommon} Bibliothèque";
+$lang->doc->showFiles = 'Pièces Jointes';
+$lang->doc->editLib = 'Edit Document Library';
+$lang->doc->deleteLib = 'Supprimer Bibliothèque';
+$lang->doc->fixedMenu = 'Coller au Menu';
+$lang->doc->removeMenu = 'Décoller du Menu';
+$lang->doc->search = 'Rechercher';
+$lang->doc->allCollections = 'All Collections';
+$lang->doc->keywordsTips = 'Please use commas to separate multiple keywords.';
+$lang->doc->sortLibs = 'Sort Libs';
+$lang->doc->titlePlaceholder = 'Veuillez saisir le titre';
+$lang->doc->confirm = 'Confirm';
+$lang->doc->docSummary = 'Total: %s.';
+$lang->doc->docCheckedSummary = 'Seleted: %total%.';
global $config;
/* Query condition list. */
@@ -179,9 +204,12 @@ $lang->doc->libIconList['custom'] = 'icon-folder-o';
$lang->doc->systemLibs['product'] = $lang->productCommon;
$lang->doc->systemLibs['execution'] = $lang->executionCommon;
-$lang->doc->aclList['open'] = 'Public';
-$lang->doc->aclList['custom'] = 'Person.';
-$lang->doc->aclList['private'] = 'Privé';
+$lang->doc->statusList[''] = "";
+$lang->doc->statusList['normal'] = "Released";
+$lang->doc->statusList['draft'] = "Draft";
+
+$lang->doc->aclList['open'] = "Public (Access with library permissions)";
+$lang->doc->aclList['private'] = "Privé (Only creators and whitelist users can access)";
$lang->doc->typeList['html'] = 'Html';
$lang->doc->typeList['markdown'] = 'Markdown';
@@ -190,6 +218,13 @@ $lang->doc->typeList['word'] = 'Word';
$lang->doc->typeList['ppt'] = 'PPT';
$lang->doc->typeList['excel'] = 'Excel';
+$lang->doc->createList['html'] = 'Create Document';
+$lang->doc->createList['api'] = 'Create API';
+$lang->doc->createList['template'] = 'Create By Template';
+$lang->doc->createList['word'] = 'Word';
+$lang->doc->createList['ppt'] = 'PPT';
+$lang->doc->createList['excel'] = 'Excel';
+
$lang->doc->types['text'] = 'Text';
$lang->doc->types['url'] = 'URL';
@@ -237,7 +272,7 @@ $lang->doc->accessDenied = "Access is denied !";
$lang->doc->versionNotFount = "N'existe pas dans ce build.";
$lang->doc->noDoc = 'Aucun documents. ';
$lang->doc->noArticle = 'No articles.';
-$lang->doc->noLib = 'No libraries. ';
+$lang->doc->noLib = 'No libraries.';
$lang->doc->noBook = 'The WIKI library has not created a manual, please create a new one :)';
$lang->doc->cannotCreateOffice = 'Désolé, %s peut seulement être créé dans Série ZenTao Biz ou plus. Coordonnées Philip@easysoft.ltd En savoir plus sur les séries zentao biz et zentao Max.';
$lang->doc->notSetOffice = "
To create a %s document, you need to configure office convert.
";
@@ -271,8 +306,20 @@ $lang->doc->noticeAcl['doc']['custom'] = 'Les utilisateurs de la Liste Blanche
$lang->doc->noticeAcl['doc']['private'] = 'Seulement celui qui a ajouté le document peut y accéder.';
$lang->doc->placeholder = new stdclass();
-$lang->doc->placeholder->url = 'URL';
+$lang->doc->placeholder->url = 'URL';
+$lang->doc->placeholder->execution = 'When the execution is empty, the document is created in the project library';
$lang->doc->summary = "Total files on this page: %s , total size: %s, %s.";
$lang->doc->ge = ':';
$lang->doc->point = '.';
+
+$lang->doc->libDropdown['editLib'] = 'Edit Library';
+$lang->doc->libDropdown['deleteLib'] = 'Delete Library';
+$lang->doc->libDropdown['addModule'] = 'Add Directory';
+$lang->doc->libDropdown['addSameModule'] = 'Add Same Directory';
+$lang->doc->libDropdown['addSubModule'] = 'Add Sub Directory';
+$lang->doc->libDropdown['editModule'] = 'Edit Directory';
+$lang->doc->libDropdown['delModule'] = 'Delete Directory';
+
+$lang->doc->featureBar['tableContents']['all'] = 'All';
+$lang->doc->featureBar['tableContents']['draft'] = 'Draft';
diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php
index 8633007239..9b3fc6ee4b 100644
--- a/module/doc/lang/zh-cn.php
+++ b/module/doc/lang/zh-cn.php
@@ -10,7 +10,7 @@
* @link http://www.zentao.net
*/
$lang->doclib = new stdclass();
-$lang->doclib->name = '文档库名称';
+$lang->doclib->name = '库名称';
$lang->doclib->control = '访问控制';
$lang->doclib->group = '分组';
$lang->doclib->user = '用户';
@@ -19,7 +19,14 @@ $lang->doclib->all = '所有文档库';
$lang->doclib->select = '选择文档库';
$lang->doclib->execution = $lang->executionCommon . '库';
$lang->doclib->product = $lang->productCommon . '库';
-$lang->doclib->apiLibName = '接口库名称';
+$lang->doclib->apiLibName = '库名称';
+$lang->doclib->privateACL = "私有 (仅创建者和有%s权限的白名单用户可访问)";
+
+$lang->doclib->tip = new stdclass();
+$lang->doclib->tip->selectExecution = "执行为空时,创建的库为{$lang->projectCommon}库";
+
+$lang->doclib->type['wiki'] = 'WIKI文档库';
+$lang->doclib->type['api'] = '接口库';
$lang->doclib->aclListA = array();
$lang->doclib->aclListA['default'] = '默认';
@@ -29,6 +36,11 @@ $lang->doclib->aclListB['open'] = '公开';
$lang->doclib->aclListB['custom'] = '自定义';
$lang->doclib->aclListB['private'] = '私有';
+$lang->doclib->aclList = array();
+$lang->doclib->aclList['open'] = "公开 (有文档视图权限即可访问)";
+$lang->doclib->aclList['default'] = "默认 (有所选%s访问权限用户可以访问)";
+$lang->doclib->aclList['private'] = "私有 (仅创建者和白名单用户可访问)";
+
$lang->doclib->create['product'] = '创建' . $lang->productCommon . '文档库';
$lang->doclib->create['execution'] = '创建' . $lang->executionCommon . '文档库';
$lang->doclib->create['custom'] = '创建自定义文档库';
@@ -43,14 +55,20 @@ $lang->doclib->tabList['custom'] = '自定义';
$lang->doclib->nameList['custom'] = '自定义文档库名称';
+$lang->doclib->apiNameUnique = array();
+$lang->doclib->apiNameUnique['product'] = '同一' . $lang->productCommon . '下的接口库中';
+$lang->doclib->apiNameUnique['project'] = '同一' . $lang->projectCommon . '下的接口库中';
+$lang->doclib->apiNameUnique['nolink'] = '无关联接口库中';
+
/* 字段列表。*/
$lang->doc->common = '文档';
-$lang->doc->id = '文档编号';
+$lang->doc->id = 'ID';
$lang->doc->product = '所属' . $lang->productCommon;
$lang->doc->project = "所属{$lang->projectCommon}";
$lang->doc->execution = '所属' . $lang->execution->common;
-$lang->doc->lib = '所属文档库';
+$lang->doc->lib = '所属库';
$lang->doc->module = '所属目录';
+$lang->doc->libAndModule = '所属库&目录';
$lang->doc->object = '所属对象';
$lang->doc->title = '文档标题';
$lang->doc->digest = '文档摘要';
@@ -58,13 +76,14 @@ $lang->doc->comment = '文档备注';
$lang->doc->type = '文档类型';
$lang->doc->content = '文档正文';
$lang->doc->keywords = '关键字';
+$lang->doc->status = '文档状态';
$lang->doc->url = '文档URL';
$lang->doc->files = '附件';
$lang->doc->addedBy = '由谁添加';
$lang->doc->addedByAB = '创建者';
-$lang->doc->addedDate = '添加时间';
-$lang->doc->editedBy = '由谁更新';
-$lang->doc->editedDate = '更新时间';
+$lang->doc->addedDate = '创建时间';
+$lang->doc->editedBy = '修改者';
+$lang->doc->editedDate = '修改日期';
$lang->doc->lastEditedBy = '最后更新者';
$lang->doc->version = '版本号';
$lang->doc->basicInfo = '基本信息';
@@ -97,6 +116,9 @@ $lang->doc->order = '排序';
$lang->doc->doc = '文档';
$lang->doc->updateOrder = '更新排序';
$lang->doc->nextStep = '下一步';
+$lang->doc->closed = '已关闭';
+$lang->doc->saveDraft = '存为草稿';
+$lang->doc->defaultSave = '默认存入:';
$lang->doc->moduleDoc = '按模块浏览';
$lang->doc->searchDoc = '搜索';
@@ -136,27 +158,30 @@ $lang->doc->collect = '收藏';
$lang->doc->cancelCollection = '取消收藏';
$lang->doc->deleteFile = '删除附件';
$lang->doc->menuTitle = '目录';
+$lang->doc->api = '接口';
$lang->doc->collectAction = '收藏文档';
-$lang->doc->libName = '文档库名称';
-$lang->doc->libType = '文档库类型';
-$lang->doc->custom = '自定义文档库';
-$lang->doc->customAB = '自定义库';
-$lang->doc->createLib = '创建文档库';
-$lang->doc->allLibs = '文档库列表';
-$lang->doc->objectLibs = "文档库文档详情";
-$lang->doc->showFiles = '附件库';
-$lang->doc->editLib = '编辑文档库';
-$lang->doc->deleteLib = '删除文档库';
-$lang->doc->fixedMenu = '固定到菜单栏';
-$lang->doc->removeMenu = '从菜单栏移除';
-$lang->doc->search = '搜索';
-$lang->doc->allCollections = '查看全部收藏文档';
-$lang->doc->keywordsTips = '多个关键字请用逗号分隔。';
-$lang->doc->sortLibs = '文档库排序';
-$lang->doc->titlePlaceholder = '请输入标题';
-$lang->doc->confirm = '确认';
+$lang->doc->libName = '库名称';
+$lang->doc->libType = '库类型';
+$lang->doc->custom = '自定义文档库';
+$lang->doc->customAB = '自定义库';
+$lang->doc->createLib = '创建库';
+$lang->doc->allLibs = '库列表';
+$lang->doc->objectLibs = "库文档详情";
+$lang->doc->showFiles = '附件库';
+$lang->doc->editLib = '编辑库';
+$lang->doc->deleteLib = '删除库';
+$lang->doc->fixedMenu = '固定到菜单栏';
+$lang->doc->removeMenu = '从菜单栏移除';
+$lang->doc->search = '搜索';
+$lang->doc->allCollections = '查看全部收藏文档';
+$lang->doc->keywordsTips = '多个关键字请用逗号分隔。';
+$lang->doc->sortLibs = '文档库排序';
+$lang->doc->titlePlaceholder = '请输入标题';
+$lang->doc->confirm = '确认';
+$lang->doc->docSummary = '本页共 %s 个文档。';
+$lang->doc->docCheckedSummary = '共选中 %total% 个文档。';
global $config;
/* 查询条件列表 */
@@ -179,9 +204,12 @@ $lang->doc->libIconList['custom'] = 'icon-folder-o';
$lang->doc->systemLibs['product'] = $lang->productCommon;
$lang->doc->systemLibs['execution'] = $lang->executionCommon;
-$lang->doc->aclList['open'] = '公开';
-$lang->doc->aclList['custom'] = '自定义';
-$lang->doc->aclList['private'] = '私有';
+$lang->doc->statusList[''] = "";
+$lang->doc->statusList['normal'] = "已发布";
+$lang->doc->statusList['draft'] = "草稿";
+
+$lang->doc->aclList['open'] = "公开(有所属库权限即可访问)";
+$lang->doc->aclList['private'] = "私有(仅创建者和白名单用户可访问)";
$lang->doc->typeList['html'] = '富文本';
$lang->doc->typeList['markdown'] = 'Markdown';
@@ -190,6 +218,12 @@ $lang->doc->typeList['word'] = 'Word';
$lang->doc->typeList['ppt'] = 'PPT';
$lang->doc->typeList['excel'] = 'Excel';
+$lang->doc->createList['html'] = '创建文档';
+$lang->doc->createList['template'] = '由模板创建';
+$lang->doc->createList['word'] = 'Word';
+$lang->doc->createList['ppt'] = 'PPT';
+$lang->doc->createList['excel'] = 'Excel';
+
$lang->doc->types['text'] = '文档';
$lang->doc->types['url'] = '链接';
@@ -237,7 +271,7 @@ $lang->doc->accessDenied = "您没有权限访问!";
$lang->doc->versionNotFount = '该版本文档不存在';
$lang->doc->noDoc = '暂时没有文档。';
$lang->doc->noArticle = '暂时没有文章。';
-$lang->doc->noLib = '暂时没有文档库。';
+$lang->doc->noLib = '暂时没有库。';
$lang->doc->noBook = 'WIKI库还未创建手册,请新建 :)';
$lang->doc->cannotCreateOffice = '
对不起,企业版才能创建%s文档。
试用企业版,请联系我们:4006-8899-23 0532-86893032。
';
$lang->doc->notSetOffice = "创建%s文档,需要配置
Office转换设置。";
@@ -271,8 +305,20 @@ $lang->doc->noticeAcl['doc']['custom'] = '白名单的用户可以访问。';
$lang->doc->noticeAcl['doc']['private'] = '只有创建者自己可以访问。';
$lang->doc->placeholder = new stdclass();
-$lang->doc->placeholder->url = '相应的链接地址';
+$lang->doc->placeholder->url = '相应的链接地址';
+$lang->doc->placeholder->execution = '执行为空时,创建文件在项目库下';
$lang->doc->summary = "本页共
%s 个附件,共计
%s,其中
%s。";
$lang->doc->ge = '个';
$lang->doc->point = '、';
+
+$lang->doc->libDropdown['editLib'] = '编辑库';
+$lang->doc->libDropdown['deleteLib'] = '删除库';
+$lang->doc->libDropdown['addModule'] = '添加目录';
+$lang->doc->libDropdown['addSameModule'] = '添加同级目录';
+$lang->doc->libDropdown['addSubModule'] = '添加子目录';
+$lang->doc->libDropdown['editModule'] = '编辑目录';
+$lang->doc->libDropdown['delModule'] = '删除目录';
+
+$lang->doc->featureBar['tableContents']['all'] = '全部';
+$lang->doc->featureBar['tableContents']['draft'] = '草稿';
diff --git a/module/doc/model.php b/module/doc/model.php
index 1e566b743b..11e1b82821 100644
--- a/module/doc/model.php
+++ b/module/doc/model.php
@@ -9,8 +9,6 @@
* @version $Id: model.php 881 2010-06-22 06:50:32Z chencongzhi520 $
* @link http://www.zentao.net
*/
-?>
-dao->select('*')->from(TABLE_DOCLIB)
->where('deleted')->eq(0)
->andWhere('type')->eq('api')
->beginIF(!empty($appendLib))->orWhere('id')->eq($appendLib)->fi()
+ ->beginIF(!empty($objectType) && $objectID > 0 and $objectType != 'nolink')->andWhere($objectType)->eq($objectID)->fi()
+ ->beginIF($objectType == 'nolink')
+ ->andWhere('product')->eq(0)
+ ->andWhere('project')->eq(0)
+ ->fi()
->orderBy('`order`_asc, id_desc')
->fetchAll('id');
+
$libs = array_filter($libs, array($this, 'checkPrivLib'));
return $libs;
}
@@ -75,7 +80,7 @@ class docModel extends model
->beginIF($type == 'all')->andWhere('deleted')->eq(0)->fi()
->beginIF($excludeType)->andWhere('type')->notin($excludeType)->fi()
->andWhere('vision')->eq($this->config->vision)
- ->orderBy('`order` asc, id_desc')
+ ->orderBy('`order`_asc, id_asc')
->query();
}
else
@@ -86,12 +91,12 @@ class docModel extends model
->beginIF($type)->andWhere('type')->eq($type)->fi()
->beginIF(!$type)->andWhere('type')->ne('api')->fi()
->beginIF($objectID and strpos(',product,project,execution,', ",$type,") !== false)->andWhere($type)->eq($objectID)->fi()
- ->orderBy("`order` asc, id_desc")->query();
+ ->orderBy("`order`_asc, id_asc")->query();
}
$products = $this->loadModel('product')->getPairs();
$projects = $this->loadModel('project')->getPairsByProgram();
- $executions = $this->loadModel('execution')->getPairs(0, 'all', 'multiple');
+ $executions = $this->loadModel('execution')->getPairs(0, 'all', 'multiple,leaf');
$waterfalls = array();
if(empty($objectID) and $type != 'product' and $type != 'project' and $type != 'custom')
{
@@ -132,7 +137,7 @@ class docModel extends model
if(!empty($appendLibs))
{
- $stmt = $this->dao->select('*')->from(TABLE_DOCLIB)->where('id')->in($appendLibs)->orderBy("`order` asc, id_desc")->query();
+ $stmt = $this->dao->select('*')->from(TABLE_DOCLIB)->where('id')->in($appendLibs)->orderBy("`order`_asc, id_asc")->query();
while($lib = $stmt->fetch())
{
if(!isset($libPairs[$lib->id]) and $this->checkPrivLib($lib, $extra)) $libPairs[$lib->id] = $lib->name;
@@ -158,13 +163,13 @@ class docModel extends model
$account = ",{$this->app->user->account},";
$userGroups = $this->app->user->groups;
- while ($lib = $stmt->fetch())
+ while($lib = $stmt->fetch())
{
if(strpos(",$lib->users,", $account) !== false)
{
$libs[$lib->lib] = $lib->lib;
}
- else
+ elseif($lib->groups)
{
foreach($userGroups as $groupID)
{
@@ -189,22 +194,26 @@ class docModel extends model
public function createLib()
{
$lib = fixer::input('post')
- ->setForce('product', $this->post->type == 'product' ? $this->post->product : 0)
- ->setForce('execution', $this->post->type == 'execution' ? $this->post->execution : 0)
+ ->setForce('product', ($this->post->type == 'product' and !empty($_POST['product'])) ? $this->post->product : 0)
+ ->setForce('project', ($this->post->type == 'project' and !empty($_POST['project'])) ? $this->post->project : 0)
+ ->setForce('execution', ($this->post->libType != 'api' and !empty($_POST['execution'])) ? $this->post->execution : 0)
->join('groups', ',')
->join('users', ',')
+ ->add('addedBy', $this->app->user->account)
+ ->add('addedDate', helper::now())
+ ->remove('uid,contactListMenu,libType')
->get();
- if($lib->type == 'execution' and $lib->execution)
+ if($lib->execution) $lib->type = 'execution';
+ if($lib->type == 'execution' and $lib->execution and !$lib->project)
{
$execution = $this->loadModel('execution')->getByID($lib->execution);
$lib->project = $execution->project;
}
-
- if($lib->acl == 'custom' or $lib->acl == 'private')
+ if($this->post->libType == 'api')
{
- $trimedUsers = ',' . trim($lib->users, ',') . ',';
- if(strpos($trimedUsers, ',' . $this->app->user->account . ',') === false) $lib->users .= ',' . $this->app->user->account;
+ $lib->type = 'api';
+ $this->checkApiLibName($lib, $this->post->type);
}
$lib->name = trim($lib->name); //Temporary treatment: Code for bug #15528.
@@ -223,22 +232,38 @@ class docModel extends model
*/
public function createApiLib()
{
- /* Replace doc library name. */
- $this->lang->doclib->name = $this->lang->doclib->apiLibName;
+ $libType = $this->post->libType;
$data = fixer::input('post')
->trim('name')
->join('groups', ',')
->join('users', ',')
+ ->setForce('product', ($libType == 'product' and !empty($_POST['product'])) ? $this->post->product : 0)
+ ->setForce('project', ($libType == 'project' and !empty($_POST['project'])) ? $this->post->project : 0)
+ ->setForce('execution', ($libType == 'project' and !empty($_POST['execution'])) ? $this->post->execution : 0)
+ ->add('addedBy', $this->app->user->account)
+ ->add('addedDate', helper::now())
+ ->remove('uid,contactListMenu,libType')
->get();
- if($data->acl == 'private') $data->users = $this->app->user->account;
- if($data->acl == 'custom' && strpos($data->users, $this->app->user->account) === false) $data->users .= ',' . $this->app->user->account;
+ $this->app->loadLang('api');
+
+ /* Replace doc library name. */
+ $this->lang->doclib->name = $this->lang->doclib->apiLibName;
+ $this->lang->doclib->baseUrl = $this->lang->api->baseUrl;
+ $this->lang->doclib->project = $this->lang->api->project;
+ $this->lang->doclib->product = $this->lang->api->product;
+
+ if($libType == 'product') $this->config->api->createlib->requiredFields .= ',product';
+ if($libType == 'project') $this->config->api->createlib->requiredFields .= ',project';
+
+ $this->checkApiLibName($data, $libType);
+
+ if(dao::isError()) return false;
$data->type = static::DOC_TYPE_API;
$this->dao->insert(TABLE_DOCLIB)->data($data)->autoCheck()
->batchCheck($this->config->api->createlib->requiredFields, 'notempty')
- ->check('name', 'unique', "`type` = '" . static::DOC_TYPE_API . "'")
->exec();
return $this->dao->lastInsertID();
@@ -247,16 +272,32 @@ class docModel extends model
/**
* Update api lib.
*
- * @param int $id
- * @param stdClass $oldDoc
- * @param array $data
+ * @param int $id
* @access public
* @return array|int
*/
- public function updateApiLib($id, $oldDoc, $data)
+ public function updateApiLib($id)
{
+ $oldLib = $this->getLibById($id);
+
+ $data = fixer::input('post')
+ ->trim('name')
+ ->join('groups', ',')
+ ->join('users', ',')
+ ->remove('uid,contactListMenu,type')
+ ->get();
+
+ $this->app->loadLang('api');
+
/* Replace doc library name. */
- $this->lang->doclib->name = $this->lang->doclib->apiLibName;
+ $this->lang->doclib->name = $this->lang->doclib->apiLibName;
+ $this->lang->doclib->baseUrl = $this->lang->api->baseUrl;
+ $this->lang->doclib->project = $this->lang->api->project;
+ $this->lang->doclib->product = $this->lang->api->product;
+
+ $this->checkApiLibName($data, $this->post->type, $id);
+
+ if(dao::isError()) return false;
$data->type = static::DOC_TYPE_API;
$this->dao->update(TABLE_DOCLIB)->data($data)->autoCheck()
@@ -291,24 +332,28 @@ class docModel extends model
->setDefault('groups', '')
->join('groups', ',')
->join('users', ',')
+ ->remove('uid,contactListMenu')
->get();
- if($oldLib->type == 'project' or $oldLib->type == 'custom')
+ if($oldLib->type == 'project')
{
$libCreatedBy = $this->dao->select('*')->from(TABLE_ACTION)->where('objectType')->eq('doclib')->andWhere('objectID')->eq($libID)->andWhere('action')->eq('created')->fetch('actor');
- if($oldLib->type == 'custom')
- {
- if($lib->acl == 'private') $lib->users = $libCreatedBy ? $libCreatedBy : $this->app->user->account;
- }
- else
- {
- $openedBy = $this->dao->findById($oldLib->project)->from(TABLE_PROJECT)->fetch('openedBy');
- if($lib->acl == 'private' and $lib->acl == 'custom') $lib->users .= ',' . $libCreatedBy ? $libCreatedBy : $openedBy;
- }
+ $openedBy = $this->dao->findById($oldLib->project)->from(TABLE_PROJECT)->fetch('openedBy');
+ if($lib->acl == 'private' and $lib->acl == 'custom') $lib->users .= ',' . $libCreatedBy ? $libCreatedBy : $openedBy;
}
if($oldLib->acl != $lib->acl and $lib->acl == 'open') $lib->users = '';
+ if($oldLib->type == 'api')
+ {
+ $type = 'nolink';
+ if(!empty($oldLib->product)) $type = 'product';
+ if(!empty($oldLib->project)) $type = 'project';
+ $lib->product = $oldLib->product;
+ $lib->project = $oldLib->project;
+ $this->checkApiLibName($lib, $type, $libID);
+ }
+
$lib->name = trim($lib->name); //Temporary treatment: Code for bug #15528.
$this->dao->update(TABLE_DOCLIB)->data($lib)->autoCheck()
->batchCheck($this->config->doc->editlib->requiredFields, 'notempty')
@@ -340,7 +385,7 @@ class docModel extends model
if($browseType == "all")
{
- $docs = $this->getDocs(0, 0, $sort, $pager);
+ $docs = $this->getDocs(0, 0, $browseType, $sort, $pager);
}
elseif($browseType == 'bySearch')
{
@@ -571,13 +616,15 @@ class docModel extends model
* @access public
* @return void
*/
- public function getDocs($libID, $module, $orderBy, $pager = null)
+ public function getDocs($libID, $module, $browseType, $orderBy, $pager = null)
{
- $docIdList = $this->getPrivDocs($libID, $module);
+ $docIdList = $this->getPrivDocs($libID, $module, 'children');
return $this->dao->select('*')->from(TABLE_DOC)
->where('deleted')->eq(0)
->andWhere('vision')->eq($this->config->vision)
->andWhere('id')->in($docIdList)
+ ->beginIF($browseType == 'all')->andWhere("(status = 'normal' or (status = 'draft' and addedBy='{$this->app->user->account}'))")->fi()
+ ->beginIF($browseType == 'draft')->andWhere('status')->eq('draft')->fi()
->orderBy($orderBy)
->page($pager)
->fetchAll('id');
@@ -594,13 +641,13 @@ class docModel extends model
*/
public function getPrivDocs($libIdList = array(), $module = 0, $mode = 'normal')
{
+ $modules = $module && $mode == 'children' ? $this->loadModel('tree')->getAllChildID($module) : $module;
$stmt = $this->dao->select('*')->from(TABLE_DOC)
->where('1=1')
+ ->beginIF(!empty($modules))->andWhere('module')->in($modules)->fi()
->beginIF($mode == 'normal')->andWhere('deleted')->eq(0)->fi()
->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi()
->beginIF($libIdList)->andWhere('lib')->in($libIdList)->fi()
- ->beginIF(strpos($this->config->doc->custom->showLibs, 'children') === false)->andWhere('module')->in($module)->fi()
- ->beginIF(!empty($module) and strpos($this->config->doc->custom->showLibs, 'children') !== false)->andWhere('module')->in($module)->fi()
->query();
$docIdList = array();
@@ -705,6 +752,7 @@ class docModel extends model
*/
public function create()
{
+ if(!isset($_POST['lib']) and strpos($_POST['module'], '_') !== false) list($_POST['lib'], $_POST['module']) = explode('_', $_POST['module']);
$now = helper::now();
$doc = fixer::input('post')
->callFunc('title', 'trim')
@@ -723,16 +771,10 @@ class docModel extends model
->remove('files,labels,uid,contactListMenu')
->get();
- if(empty($doc->lib))
- {
- dao::$errors['lib'] = sprintf($this->lang->error->notempty, $this->lang->doc->lib);
- return false;
- }
-
- /* Fix bug #2929. strip_tags($this->post->contentMarkdown, $this->config->allowedTags)*/
- $doc = $this->loadModel('file')->processImgURL($doc, $this->config->doc->editor->create['id'], $this->post->uid);
$doc->contentMarkdown = $this->post->contentMarkdown;
- if($doc->acl == 'private') $doc->users = $this->app->user->account;
+ if($doc->acl == 'open') $doc->users = $doc->groups = '';
+ if(empty($doc->lib) and strpos($doc->module, '_') !== false) list($doc->lib, $doc->module) = explode('_', $doc->module);
+ if(empty($doc->lib)) return dao::$errors['lib'] = sprintf($this->lang->error->notempty, $this->lang->doc->lib);
if($doc->title)
{
@@ -741,26 +783,23 @@ class docModel extends model
if($result['stop']) return array('status' => 'exists', 'id' => $result['duplicate']);
}
- $lib = $this->getLibByID($doc->lib);
+ /* Fix bug #2929. strip_tags($this->post->contentMarkdown, $this->config->allowedTags)*/
+ $lib = $this->getLibByID($doc->lib);
+ $doc = $this->loadModel('file')->processImgURL($doc, $this->config->doc->editor->create['id'], $this->post->uid);
+
$doc->product = $lib->product;
$doc->project = $lib->project;
$doc->execution = $lib->execution;
- if($doc->type == 'url')
- {
- $doc->content = $doc->url;
- $doc->contentType = 'html';
- }
$docContent = new stdclass();
$docContent->title = $doc->title;
$docContent->content = $doc->contentType == 'html' ? $doc->content : $doc->contentMarkdown;
$docContent->type = $doc->contentType;
$docContent->version = 1;
- unset($doc->contentMarkdown);
- unset($doc->contentType);
- unset($doc->url);
+ unset($doc->contentMarkdown, $doc->contentType, $doc->url);
$requiredFields = $this->config->doc->create->requiredFields;
+ if($doc->status == 'draft') $requiredFields = '';
if(strpos("url|word|ppt|excel", $this->post->type) !== false) $requiredFields = trim(str_replace(",content,", ",", ",{$requiredFields},"), ',');
$checkContent = strpos(",$requiredFields,", ',content,') !== false;
@@ -805,7 +844,7 @@ class docModel extends model
return false;
}
- $now = helper::now();
+ if(!isset($_POST['lib']) and strpos($_POST['module'], '_') !== false) list($_POST['lib'], $_POST['module']) = explode('_', $_POST['module']);
$doc = fixer::input('post')->setDefault('module', 0)
->callFunc('title', 'trim')
->stripTags($this->config->doc->editor->edit['id'], $this->config->allowedTags)
@@ -815,14 +854,15 @@ class docModel extends model
->setDefault('execution', 0)
->setDefault('mailto', '')
->add('editedBy', $this->app->user->account)
- ->add('editedDate', $now)
- ->cleanInt('module')
+ ->add('editedDate', helper::now())
+ ->cleanInt('project,product,execution,lib,module')
->join('groups', ',')
->join('users', ',')
->join('mailto', ',')
->remove('comment,files,labels,uid,contactListMenu')
->get();
+ if($doc->acl == 'open') $doc->users = $doc->groups = '';
if($doc->type == 'chapter' and $doc->parent)
{
$parentDoc = $this->dao->select('*')->from(TABLE_DOC)->where('id')->eq((int)$doc->parent)->fetch();
@@ -833,8 +873,6 @@ class docModel extends model
}
}
- if(!empty($doc->acl) and $doc->acl == 'private') $doc->users = $oldDoc->addedBy;
-
$oldDocContent = $this->dao->select('*')->from(TABLE_DOCCONTENT)->where('doc')->eq($docID)->andWhere('version')->eq($oldDoc->version)->fetch();
if($oldDocContent)
{
@@ -854,8 +892,13 @@ class docModel extends model
$doc->execution = $lib->execution;
}
- if(isset($doc->type) and $doc->type == 'url') $doc->content = $doc->url;
- unset($doc->url);
+ $requiredFields = $this->config->doc->edit->requiredFields;
+ if($doc->status == 'draft') $requiredFields = '';
+ if(strpos(",$requiredFields,", ',content,') !== false)
+ {
+ $requiredFields = trim(str_replace(',content,', ',', ",$requiredFields,"), ',');
+ if(isset($doc->content) and empty($doc->content)) return dao::$errors['content'] = sprintf($this->lang->error->notempty, $this->lang->doc->content);
+ }
$files = $this->file->saveUpload('doc', $docID);
$changes = common::createChanges($oldDoc, $doc);
@@ -866,28 +909,26 @@ class docModel extends model
if($change['field'] == 'content' or $change['field'] == 'title') $changed = true;
}
- $requiredFields = $this->config->doc->edit->requiredFields;
- $checkContent = strpos(",$requiredFields,", ',content,') !== false;
- if($checkContent)
- {
- $requiredFields = trim(str_replace(',content,', ',', ",$requiredFields,"), ',');
- if(isset($doc->content) and empty($doc->content)) return dao::$errors['content'] = sprintf($this->lang->error->notempty, $this->lang->doc->content);
- }
-
if($changed)
{
- $doc->version = $oldDoc->version + 1;
$docContent = new stdclass();
- $docContent->doc = $docID;
$docContent->title = $doc->title;
$docContent->content = isset($doc->content) ? $doc->content : '';
- $docContent->version = $doc->version;
- $docContent->type = $oldDocContent->type;
$docContent->files = $oldDocContent->files;
- if(isset($doc->digest)) $docContent->digest = $doc->digest;
if($files) $docContent->files .= ',' . join(',', array_keys($files));
$docContent->files = trim($docContent->files, ',');
- $this->dao->replace(TABLE_DOCCONTENT)->data($docContent)->exec();
+ if(isset($doc->digest)) $docContent->digest = $doc->digest;
+ if($doc->status == 'draft')
+ {
+ $this->dao->update(TABLE_DOCCONTENT)->data($docContent)->where('id')->eq($oldDocContent->id)->exec();
+ }
+ else
+ {
+ $doc->version = $oldDoc->version + 1;
+ $docContent->version = $doc->version;
+ $docContent->type = $oldDocContent->type;
+ $this->dao->replace(TABLE_DOCCONTENT)->data($docContent)->exec();
+ }
}
unset($doc->contentType);
@@ -914,10 +955,8 @@ class docModel extends model
*/
public function saveDraft($docID)
{
- $data = fixer::input('post')
- ->stripTags($this->config->doc->editor->edit['id'], $this->config->allowedTags)
- ->get();
- $doc = new stdclass();
+ $data = fixer::input('post')->stripTags($this->config->doc->editor->edit['id'], $this->config->allowedTags)->get();
+ $doc = new stdclass();
$doc->draft = $data->content;
$docType = $this->dao->select('type')->from(TABLE_DOCCONTENT)->where('doc')->eq((int)$docID)->orderBy('version_desc')->fetch();
@@ -946,7 +985,7 @@ class docModel extends model
$products = $this->product->getPairs();
$this->config->doc->search['params']['project']['values'] = array('' => '') + $this->loadModel('project')->getPairsByProgram() + array('all' => $this->lang->doc->allProjects);
- $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs() + array('all' => $this->lang->doc->allExecutions);
+ $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs(0, 'all', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions);
$this->config->doc->search['params']['lib']['values'] = array('' => '') + $this->loadModel('doc')->getLibs('all', 'withObject') + array('all' => $this->lang->doclib->all);
$this->config->doc->search['params']['product']['values'] = array('' => '') + $products + array('all' => $this->lang->doc->allProduct);
@@ -954,17 +993,36 @@ class docModel extends model
}
elseif(in_array($type, array('product', 'project', 'execution', 'custom', 'book')))
{
- $queryName = $type . 'Doc';
- $this->config->doc->search['module'] = $queryName;
- $this->config->doc->search['params']['lib']['values'] = array('' => '', $libID => (isset($libs[$libID]) ? $libs[$libID]->name : $libID), 'all' => $this->lang->doclib->all);
+ if(!isset($libs[$libID])) $libs[$libID] = $this->getLibById($libID);
+
+ $libPairs = array('' => '');
+ $queryName = $type . 'libDoc';
+ foreach($libs as $lib)
+ {
+ if(empty($lib)) continue;
+ if($lib->type == 'api') continue;
+ $libPairs[$lib->id] = $lib->name;
+ }
+
+ if($type == 'project')
+ {
+ $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project, 'all', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions);
+ }
+ else
+ {
+ unset($this->config->doc->search['fields']['execution']);
+ }
+
+
+ $this->config->doc->search['module'] = $queryName;
+ $this->config->doc->search['params']['lib']['values'] = $libPairs + array('all' => $this->lang->doclib->all);
unset($this->config->doc->search['fields']['product']);
- unset($this->config->doc->search['fields']['execution']);
unset($this->config->doc->search['fields']['module']);
}
else
{
$products = $this->product->getPairs('nocode', $this->session->project);
- $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project, 'all', 'noclosed') + array('all' => $this->lang->doc->allExecutions);
+ $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project, 'all', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions);
$this->config->doc->search['params']['lib']['values'] = array('' => '', $libID => ($libID ? $libs[$libID] : 0), 'all' => $this->lang->doclib->all);
$this->config->doc->search['params']['product']['values'] = array('' => '') + $products + array('all' => $this->lang->doc->allProduct);
}
@@ -1088,7 +1146,16 @@ class docModel extends model
if(isset($object->addedBy) and $object->addedBy == $this->app->user->account) return true;
if(isset($object->users) and strpos(",{$object->users},", $account) !== false) return true;
- if($object->project and $object->acl == 'private')
+ if(!empty($object->groups))
+ {
+ $userGroups = $this->app->user->groups;
+ foreach($userGroups as $groupID)
+ {
+ if(strpos(",$object->groups,", ",$groupID,") !== false) return true;
+ }
+ }
+
+ if($object->project and !$object->execution and $object->acl == 'default')
{
$stakeHolders = array();
$project = $this->loadModel('project')->getById($object->project);
@@ -1097,20 +1164,9 @@ class docModel extends model
$authorizedUsers = $this->user->getProjectAuthedUsers($project, $stakeHolders, $projectTeams, array_flip(explode(",", $project->whitelist)));
- if(strpos(",{$object->users},", $account) !== false) return true;
if(array_key_exists($this->app->user->account, array_filter($authorizedUsers))) return true;
}
- if($object->acl == 'custom')
- {
- $userGroups = $this->app->user->groups;
- foreach($userGroups as $groupID)
- {
- if(strpos(",$object->groups,", ",$groupID,") !== false) return true;
- }
- if(strpos(",{$object->users},", $account) !== false) return true;
- }
-
if(strpos($extra, 'notdoc') !== false)
{
static $extraDocLibs;
@@ -1118,7 +1174,7 @@ class docModel extends model
if(isset($extraDocLibs[$object->id])) return true;
}
- if(!empty($object->product) or !empty($object->execution))
+ if($object->acl == 'default' and (!empty($object->product) or !empty($object->execution)))
{
$acls = $this->app->user->rights['acls'];
if(!empty($object->product) and !empty($acls['products']) and !in_array($object->product, $acls['products'])) return false;
@@ -1148,16 +1204,15 @@ class docModel extends model
if($libs === null) $libs = $this->getLibs('all');
if(isset($libs[$object->lib]) and isset($extraDocLibs[$object->lib])) unset($extraDocLibs[$object->lib]);
- if($object->acl == 'open' and !isset($extraDocLibs[$object->lib])) return true;
+ if($object->acl == 'open' and !isset($extraDocLibs[$object->lib])) return true;
if($object->acl == 'public' and !isset($extraDocLibs[$object->lib])) return true;
- $account = ',' . $this->app->user->account . ',';
+ $account = ",{$this->app->user->account},";
if(isset($object->addedBy) and $object->addedBy == $this->app->user->account) return true;
if(strpos(",$object->users,", $account) !== false) return true;
- if($object->acl == 'custom')
+ if($object->groups)
{
- $userGroups = $this->app->user->groups;
- foreach($userGroups as $groupID)
+ foreach($this->app->user->groups as $groupID)
{
if(strpos(",$object->groups,", ",$groupID,") !== false) return true;
}
@@ -1428,8 +1483,8 @@ class docModel extends model
->andWhere('vision')->eq($this->config->vision)
->andWhere('type')->eq($type)
->beginIF(!empty($appendLib))->orWhere('id')->eq($appendLib)->fi()
- ->beginIF($type == 'custom')->orderBy('`order` asc, id_desc')->fi()
- ->beginIF($type == 'book')->orderBy('`order` asc, id_desc')->fi()
+ ->beginIF($type == 'custom')->orderBy('`order` asc, id_asc')->fi()
+ ->beginIF($type == 'book')->orderBy('`order` asc, id_asc')->fi()
->fetchAll('id');
}
elseif($type != 'product' and $type != 'project' and $type != 'execution')
@@ -1438,14 +1493,28 @@ class docModel extends model
}
else
{
+ $executionIDList = array();
+ if($type == 'project') $executionIDList = $this->loadModel('execution')->getPairs($objectID, 'all', 'multiple,leaf');
+
$objectLibs = $this->dao->select('*')->from(TABLE_DOCLIB)
->where('deleted')->eq(0)
->andWhere('vision')->eq($this->config->vision)
->andWhere($type)->eq($objectID)
+ ->beginIF($type == 'project')->andWhere('type')->in('api,project')->fi()
->beginIF(!empty($appendLib))->orWhere('id')->eq($appendLib)->fi()
- ->beginIF($type == 'project')->andWhere('execution')->eq(0)->fi()
- ->orderBy('`order` asc, id_desc')
+ ->orderBy('`order` asc, id_asc')
->fetchAll('id');
+ if($executionIDList)
+ {
+ $objectLibs += $this->dao->select('*')->from(TABLE_DOCLIB)
+ ->where('deleted')->eq(0)
+ ->andWhere('vision')->eq($this->config->vision)
+ ->andWhere('execution')->in(array_keys($executionIDList))
+ ->andWhere('type')->eq('execution')
+ ->beginIF(!empty($appendLib))->orWhere('id')->eq($appendLib)->fi()
+ ->orderBy('`order` asc, id_asc')
+ ->fetchAll('id');
+ }
}
if($type == 'product')
@@ -1459,24 +1528,10 @@ class docModel extends model
->fetchPairs('product', 'projectCount');
}
- $docCountPairs = $this->dao->select('lib, count(id) as docCount')->from(TABLE_DOC)
- ->where('lib')->in(array_keys($objectLibs))
- ->andWhere('vision')->eq($this->config->vision)
- ->andWhere('type')->notin('chapter')
- ->andWhere('deleted')->eq(0)
- ->groupBy('lib')
- ->fetchPairs('lib');
-
$libs = array();
foreach($objectLibs as $lib)
{
- if($this->checkPrivLib($lib))
- {
- $docCount = zget($docCountPairs, $lib->id, 0);
- $lib->docCount = $docCount > 99 ? '99+' : $docCount;
-
- $libs[$lib->id] = $lib;
- }
+ if($this->checkPrivLib($lib)) $libs[$lib->id] = $lib;
}
$itemCounts = $this->statLibCounts(array_keys($libs));
@@ -1489,10 +1544,11 @@ class docModel extends model
* Get ordered objects for dic.
*
* @param string $objectType
+ * @param string $returnType nomerge|merge
* @access public
* @return array
*/
- public function getOrderedObjects($objectType = 'product')
+ public function getOrderedObjects($objectType = 'product', $returnType = 'merge')
{
$myObjects = $normalObjects = $closedObjects = array();
if($objectType == 'product')
@@ -1603,6 +1659,7 @@ class docModel extends model
}
}
+ if($returnType == 'nomerge') return array($myObjects, $normalObjects, $closedObjects);
return $myObjects + $normalObjects + $closedObjects;
}
@@ -1975,7 +2032,7 @@ class docModel extends model
public function getLibIdListByProject($projectID = 0)
{
$products = $this->loadModel('product')->getProductIDByProject($projectID, false);
- $executions = $this->loadModel('execution')->getPairs($projectID, 'all', 'noclosed');
+ $executions = $this->loadModel('execution')->getPairs($projectID, 'all', 'noclosed,leaf');
$executionLibs = array();
$productLibs = array();
@@ -2121,123 +2178,6 @@ class docModel extends model
return $title;
}
- /**
- * Build document module index page create document button.
- *
- * @param string $objectType
- * @param int $objectID
- * @param int $libID
- * @access public
- * @return string
- */
- public function buildCreateButton4Doc($objectType, $objectID, $libID)
- {
- if(!common::hasPriv('doc', 'create') and !common::hasPriv('doc', 'createLib')) return '';
-
- if($objectType == 'book')
- {
- $html = html::a(helper::createLink('doc', 'createLib', "type=$objectType&objectID=$objectID"), '
' . $this->lang->doc->createBook, '', 'class="btn btn-secondary iframe"');
- }
- elseif($libID)
- {
- $html = "
";
- $html .= "";
- $html .= "
";
- }
- else
- {
- $html = html::a(helper::createLink('doc', 'createLib', "type=$objectType&objectID=$objectID"), '
' . $this->lang->doc->createLib, '', 'class="btn btn-secondary iframe"');
- }
-
- return $html;
- }
-
- /**
- * Build collect button from document.
- *
- * @access public
- * @return string
- */
- public function buildCollectButton4Doc()
- {
- $favoritesLimit = 10;
- $allLibs = array_keys($this->getLibs('all'));
- $docs = $this->dao->select('t1.id,t1.title,t1.lib,t2.type,t2.product,t2.project,t2.execution')->from(TABLE_DOC)->alias('t1')
- ->leftJoin(TABLE_DOCLIB)->alias('t2')->on('t1.lib=t2.id')
- ->where('t1.deleted')->eq(0)
- ->andWhere('t1.lib')->in($allLibs)
- ->beginIF($this->config->doc->notArticleType)->andWhere('t1.type')->notIN($this->config->doc->notArticleType)->fi()
- ->andWhere('t1.collector')->like("%,{$this->app->user->account},%")
- ->orderBy('t1.id_desc')
- ->limit($favoritesLimit)
- ->fetchAll();
-
- $html = '';
- $rawMethod = $this->app->rawMethod;
- if($this->app->rawMethod == 'showfiles')
- {
- $html = '
';
- $html .= '
';
- }
- elseif(in_array($rawMethod, array('tablecontents', 'objectlibs', 'product', 'project', 'execution', 'book', 'custom')))
- {
- $html = '
' . $this->lang->doc->search . '';
- }
- $html .= "
';
- return $html;
- }
-
/**
* Build browse switch button.
*
@@ -2321,128 +2261,24 @@ class docModel extends model
* Create the select code of doc.
*
* @param string $type
- * @param array $objects
+ * @param string $objectTitle
* @param int $objectID
* @param array $libs
* @param int $libID
* @access public
* @return string
*/
- public function select($type, $objects, $objectID, $libs, $libID = 0)
+ public function select($type, $objectTitle, $objectID)
{
- if($type != 'custom' and $type != 'book' and empty($objects)) return '';
-
- $output = '';
- $closedObjectsHtml = '';
- $closedObjects = array();
- $maxHeight = (in_array($type, array('project', 'execution')) and $this->app->tab == 'doc') ? '260px' : '290px';
- $class = (in_array($type, array('project', 'execution')) and $this->app->tab == 'doc') ? 'col-left' : '';
+ if(!in_array($type, array('product', 'project'))) return '';
+ $currentModule = $this->app->getModuleName();
$currentMethod = $this->app->getMethodName();
- $methodName = in_array($currentMethod, array('tablecontents', 'showfiles')) ? 'tablecontents' : 'objectLibs';
-
- if($this->app->tab == 'doc' and $type != 'custom' and $type != 'book')
- {
- $objectTitle = $type == 'execution' ? substr($objects[$objectID], strpos($objects[$objectID], '/') + 1) : $objects[$objectID];
-
- $output = <<
-
-
-
-
-EOT;
- }
- else
- {
- $output .= "