Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into zentaoipd
This commit is contained in:
Vendored
+6
-6
@@ -45,13 +45,13 @@ pipeline {
|
||||
success {
|
||||
container('xuanimbot') {
|
||||
sh 'git config --global --add safe.directory $(pwd)'
|
||||
sh '/usr/local/bin/xuanimbot --users "$(git show -s --format=%cn)" --title "sonar scanner" --url "https://sonar.qc.oop.cc/dashboard?id=zentaopms&branch=${GIT_BRANCH}" --content "sonar scanner success" --debug --custom'
|
||||
sh '/usr/local/bin/xuanimbot --users "$(git show -s --format=%an)" --title "sonar scanner" --url "https://sonar.qc.oop.cc/dashboard?id=zentaopms&branch=${GIT_BRANCH}" --content "sonar scanner success" --debug --custom'
|
||||
}
|
||||
}
|
||||
failure {
|
||||
container('xuanimbot') {
|
||||
sh 'git config --global --add safe.directory $(pwd)'
|
||||
sh '/usr/local/bin/xuanimbot --users "$(git show -s --format=%cn)" --title "sonar scanner" --url "https://sonar.qc.oop.cc/dashboard?id=zentaopms&branch=${GIT_BRANCH}" --content "sonar scanner failure" --debug --custom'
|
||||
sh '/usr/local/bin/xuanimbot --users "$(git show -s --format=%an)" --title "sonar scanner" --url "https://sonar.qc.oop.cc/dashboard?id=zentaopms&branch=${GIT_BRANCH}" --content "sonar scanner failure" --debug --custom'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ pipeline {
|
||||
failure {
|
||||
container('xuanimbot') {
|
||||
sh 'git config --global --add safe.directory $(pwd)'
|
||||
sh '/usr/local/bin/xuanimbot --users "$(git show -s --format=%cn)" --title "build image" --url "${RUN_DISPLAY_URL}" --content "Build unit test image failure" --debug --custom'
|
||||
sh '/usr/local/bin/xuanimbot --users "$(git show -s --format=%an)" --title "build image" --url "${RUN_DISPLAY_URL}" --content "Build unit test image failure" --debug --custom'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -107,7 +107,7 @@ pipeline {
|
||||
failure {
|
||||
container('xuanimbot') {
|
||||
sh 'git config --global --add safe.directory $(pwd)'
|
||||
sh '/usr/local/bin/xuanimbot --users "$(git show -s --format=%cn)" --title "unittest init" --url "${RUN_DISPLAY_URL}" --content "Unit test database initialization failed" --debug --custom'
|
||||
sh '/usr/local/bin/xuanimbot --users "$(git show -s --format=%an)" --title "unittest init" --url "${RUN_DISPLAY_URL}" --content "Unit test database initialization failed" --debug --custom'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -284,13 +284,13 @@ pipeline {
|
||||
success{
|
||||
container('xuanimbot') {
|
||||
sh 'git config --global --add safe.directory /home/jenkins/agent/workspace/pangu_pangu_xuanimbot_master'
|
||||
sh '/usr/local/bin/xuanimbot --users "$(git show -s --format=%cn)" --title "unittest" --url "${RUN_DISPLAY_URL}" --content "Unit test passed" --debug --custom'
|
||||
sh '/usr/local/bin/xuanimbot --users "$(git show -s --format=%an)" --title "unittest" --url "${RUN_DISPLAY_URL}" --content "Unit test passed" --debug --custom'
|
||||
}
|
||||
}
|
||||
failure{
|
||||
container('xuanimbot') {
|
||||
sh 'git config --global --add safe.directory $(pwd)'
|
||||
sh '/usr/local/bin/xuanimbot --users "$(git show -s --format=%cn)" --title "unittest" --url "${RUN_DISPLAY_URL}" --content "Unit test failed" --debug --custom'
|
||||
sh '/usr/local/bin/xuanimbot --users "$(git show -s --format=%an)" --title "unittest" --url "${RUN_DISPLAY_URL}" --content "Unit test failed" --debug --custom'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,10 @@ VERSION = $(shell head -n 1 VERSION)
|
||||
XUANVERSION = $(shell head -n 1 xuanxuan/XUANVERSION)
|
||||
XVERSION = $(shell head -n 1 xuanxuan/XVERSION)
|
||||
|
||||
#XUANPATH := $(XUANXUAN_SRC_PATH)
|
||||
#BUILD_PATH := $(if $(ZENTAO_BUILD_PATH),$(ZENTAO_BUILD_PATH),$(shell pwd))
|
||||
#RELEASE_PATH := $(if $(ZENTAO_RELEASE_PATH),$(ZENTAO_RELEASE_PATH),$(shell pwd))
|
||||
XUANPATH := /home/gitlab-runner/ci/gitlab/xuan/
|
||||
XUAN_WEB_PATH := /home/gitlab-runner/ci/packages/web
|
||||
BUILD_PATH := /home/z/ci/pip_build/
|
||||
RELEASE_PATH := /home/z/ci/pip_release/
|
||||
XUANPATH := $(XUANXUAN_SRC_PATH)
|
||||
BUILD_PATH := $(if $(ZENTAO_BUILD_PATH),$(ZENTAO_BUILD_PATH),$(shell pwd))
|
||||
RELEASE_PATH := $(if $(ZENTAO_RELEASE_PATH),$(ZENTAO_RELEASE_PATH),$(shell pwd))
|
||||
XUAN_WEB_PATH := $(ZENTAO_BUILD_PATH)/web
|
||||
|
||||
all:
|
||||
make clean
|
||||
@@ -257,6 +254,7 @@ enrpm:
|
||||
cp ~/rpmbuild/RPMS/noarch/zentaoalm-${VERSION}-1.noarch.rpm ./
|
||||
rm -rf ~/rpmbuild
|
||||
ciCommon:
|
||||
make clean
|
||||
git pull
|
||||
make common
|
||||
|
||||
@@ -307,19 +305,45 @@ cizip:
|
||||
rm -rf tmp/ *.sh zentaobiz* zentaomax* $(RELEASE_PATH)/ZenTaoALM.$(VERSION)*.zip $(RELEASE_PATH)/ZenTaoPMS.$(VERSION)*.zip $(RELEASE_PATH)/pmsPack/*.zip
|
||||
mv ZenTaoPMS.$(VERSION).zip ZenTaoALM.$(VERSION).int.zip $(RELEASE_PATH)
|
||||
mv ZenTaoALM.$(VERSION).int.php*.zip ZenTaoPMS.$(VERSION).php*.zip $(RELEASE_PATH)/pmsPack
|
||||
ci:
|
||||
syspack:
|
||||
php tools/packDeb.php $(VERSION)
|
||||
sh deb.sh
|
||||
rm -rf tmp/ deb.sh
|
||||
php tools/packRpm.php $(VERSION)
|
||||
sh rpm.sh
|
||||
rm -rf tmp/ rpm.sh
|
||||
commitBuild:
|
||||
make ciCommon
|
||||
php tools/packZip.php $(VERSION)
|
||||
sh zip.sh
|
||||
rm -rf tmp/
|
||||
php tools/packDeb.php $(VERSION)
|
||||
sh deb.sh
|
||||
rm -rf tmp/
|
||||
php tools/packRpm.php $(VERSION)
|
||||
sh rpm.sh
|
||||
rm -rf tmp/
|
||||
rm -rf tmp/ zip.sh
|
||||
commitClear:
|
||||
rm -rf zentaobiz* zentaomax* $(RELEASE_PATH)/pmsPack/*.zip
|
||||
commitMove:
|
||||
mv ZenTaoALM.$(VERSION).int.php*.zip ZenTaoPMS.$(VERSION).php*.zip $(RELEASE_PATH)/pmsPack
|
||||
releaseBuild:
|
||||
make commitBuild
|
||||
make syspack
|
||||
releaseClear:
|
||||
make commitClear
|
||||
rm -rf $(RELEASE_PATH)/pmsPack/deb/* $(RELEASE_PATH)/pmsPack/rpm/*
|
||||
releaseMove:
|
||||
make commitMove
|
||||
mv *.deb $(RELEASE_PATH)/pmsPack/deb/
|
||||
mv *.rpm $(RELEASE_PATH)/pmsPack/rpm/
|
||||
commitCi:
|
||||
make commitBuild
|
||||
make commitClear
|
||||
make commitMove
|
||||
releaseCi:
|
||||
make releaseBuild
|
||||
make releaseClear
|
||||
make releaseMove
|
||||
ci:
|
||||
make commitBuild
|
||||
make syspack
|
||||
rm -rf zentaobiz* zentaomax* $(RELEASE_PATH)/ZenTaoALM.$(VERSION)*.zip $(RELEASE_PATH)/ZenTaoPMS.$(VERSION)*.zip $(RELEASE_PATH)/*.deb $(RELEASE_PATH)/*.rpm *.sh $(RELEASE_PATH)/pmsPack/*.zip $(RELEASE_PATH)/pmsPack/deb/* $(RELEASE_PATH)/pmsPack/rpm/*
|
||||
mv ZenTaoPMS.$(VERSION).zip ZenTaoALM.$(VERSION).int.zip $(RELEASE_PATH)
|
||||
mv ZenTaoALM.$(VERSION).int.php*.zip ZenTaoPMS.$(VERSION).php*.zip $(RELEASE_PATH)/pmsPack
|
||||
mv *.deb $(RELEASE_PATH)/pmsPack/deb
|
||||
mv *.rpm $(RELEASE_PATH)/pmsPack/rpm
|
||||
mv *.deb $(RELEASE_PATH)/pmsPack/deb/
|
||||
mv *.rpm $(RELEASE_PATH)/pmsPack/rpm/
|
||||
|
||||
+14
-12
@@ -224,24 +224,26 @@ $filter->doc->default->cookie['from'] = 'code';
|
||||
$filter->doc->default->cookie['product'] = 'int';
|
||||
$filter->doc->default->cookie['preProductID'] = 'int';
|
||||
$filter->doc->default->cookie['lastProject'] = 'int';
|
||||
$filter->doc->default->cookie['docSpaceParam'] = 'string';
|
||||
$filter->doc->showfiles->cookie['docFilesViewType'] = 'code';
|
||||
$filter->doc->tablecontents->cookie['preProductID'] = 'int';
|
||||
$filter->doc->tablecontents->cookie['preBranch'] = 'reg::word';
|
||||
$filter->doc->productspace->cookie['pagerDocTablecontents'] = 'int';
|
||||
$filter->doc->projectspace->cookie['pagerDocTablecontents'] = 'int';
|
||||
|
||||
$filter->api->default->cookie['objectType'] = 'string';
|
||||
$filter->api->default->cookie['objectID'] = 'int';
|
||||
$filter->api->index->get['libID'] = 'int';
|
||||
$filter->api->index->get['module'] = 'int';
|
||||
$filter->api->index->get['apiID'] = 'int';
|
||||
$filter->api->index->get['version'] = 'int';
|
||||
$filter->api->create->get['libID'] = 'int';
|
||||
$filter->api->create->get['module'] = 'int';
|
||||
$filter->api->create->get['apiID'] = 'int';
|
||||
$filter->api->edit->get['libID'] = 'int';
|
||||
$filter->api->edit->get['module'] = 'int';
|
||||
$filter->api->edit->get['apiID'] = 'int';
|
||||
$filter->api->default->cookie['objectType'] = 'string';
|
||||
$filter->api->default->cookie['objectID'] = 'int';
|
||||
$filter->api->default->cookie['docSpaceParam'] = 'string';
|
||||
$filter->api->index->get['libID'] = 'int';
|
||||
$filter->api->index->get['module'] = 'int';
|
||||
$filter->api->index->get['apiID'] = 'int';
|
||||
$filter->api->index->get['version'] = 'int';
|
||||
$filter->api->create->get['libID'] = 'int';
|
||||
$filter->api->create->get['module'] = 'int';
|
||||
$filter->api->create->get['apiID'] = 'int';
|
||||
$filter->api->edit->get['libID'] = 'int';
|
||||
$filter->api->edit->get['module'] = 'int';
|
||||
$filter->api->edit->get['apiID'] = 'int';
|
||||
|
||||
$filter->file->download->cookie[$config->sessionVar] = 'code';
|
||||
|
||||
|
||||
@@ -229,6 +229,9 @@ $config->openMethods[] = 'task.editteam';
|
||||
$config->openMethods[] = 'feedback.mergeproductmodule';
|
||||
$config->openMethods[] = 'zanode.nodelist';
|
||||
$config->openMethods[] = 'action.restoreStages';
|
||||
$config->openMethods[] = 'testcase.getXmindImport';
|
||||
$config->openMethods[] = 'testcase.showXMindImport';
|
||||
$config->openMethods[] = 'testcase.saveXmindImport';
|
||||
|
||||
$config->openModules = array();
|
||||
$config->openModules[] = 'install';
|
||||
|
||||
+244
-81
File diff suppressed because one or more lines are too long
+224
-191
File diff suppressed because one or more lines are too long
+31
-11
@@ -327,6 +327,21 @@ class baseDAO
|
||||
return $this->query("SHOW TABLES")->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get table engines.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getTableEngines()
|
||||
{
|
||||
$tables = $this->query("SHOW TABLE STATUS WHERE `Engine` is not null")->fetchAll();
|
||||
$tableEngines = array();
|
||||
foreach($tables as $table) $tableEngines[$table->Name] = $table->Engine;
|
||||
|
||||
return $tableEngines;
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc table, show fields.
|
||||
*
|
||||
@@ -604,7 +619,7 @@ class baseDAO
|
||||
{
|
||||
if(strpos($skipFields, ",$field,") !== false) continue;
|
||||
$fields .= "`{$field}`,";
|
||||
if(is_string($value)) $value = $this->sqlobj->quote($value);
|
||||
if(is_string($value) or $value === null) $value = $this->sqlobj->quote($value);
|
||||
$values .= $value . ',';
|
||||
}
|
||||
$fields = substr($fields, 0, -1);
|
||||
@@ -1586,6 +1601,7 @@ class baseSQL
|
||||
{
|
||||
global $dbh;
|
||||
$this->dbh = $dbh;
|
||||
$this->data = new stdclass();
|
||||
$this->magicQuote = (version_compare(phpversion(), '5.4', '<') and function_exists('get_magic_quotes_gpc') and get_magic_quotes_gpc());
|
||||
}
|
||||
|
||||
@@ -1773,22 +1789,25 @@ class baseSQL
|
||||
{
|
||||
if($this->inCondition and !$this->conditionIsTrue) return $this;
|
||||
|
||||
if($this->method == 'update')
|
||||
/* DMDB replace will use $this->data. */
|
||||
if($this->method == 'insert' or $this->method == 'replace')
|
||||
{
|
||||
$this->setField = $set;
|
||||
$this->data->$set = '';
|
||||
}
|
||||
|
||||
if($this->method != 'insert')
|
||||
{
|
||||
/* Add ` to avoid keywords of mysql. */
|
||||
if(strpos($set, '=') ===false)
|
||||
if(strpos($set, '=') === false)
|
||||
{
|
||||
$set = str_replace(',', '', $set);
|
||||
$set = '`' . str_replace('`', '', $set) . '`';
|
||||
}
|
||||
|
||||
$this->sql .= $this->isFirstSet ? " $set" : ", $set";
|
||||
if($this->isFirstSet) $this->isFirstSet = false;
|
||||
}
|
||||
elseif($this->method == 'insert')
|
||||
{
|
||||
$this->setField = $value;
|
||||
$this->data->$value = '';
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -1960,12 +1979,13 @@ class baseSQL
|
||||
{
|
||||
if($this->inCondition and !$this->conditionIsTrue) return $this;
|
||||
|
||||
if($this->method == 'insert')
|
||||
if($this->method == 'insert' or $this->method == 'replace')
|
||||
{
|
||||
$field = $this->setField;
|
||||
$this->data->$field = $value;
|
||||
}
|
||||
else
|
||||
|
||||
if($this->method != 'insert')
|
||||
{
|
||||
$this->sql .= " = " . $this->quote($value);
|
||||
}
|
||||
@@ -2077,7 +2097,7 @@ class baseSQL
|
||||
public function in($ids)
|
||||
{
|
||||
if($this->inCondition and !$this->conditionIsTrue) return $this;
|
||||
$this->sql .= helper::dbIN($ids);
|
||||
$this->sql .= $ids === NULL ? ' IS NULL' : helper::dbIN($ids);
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
+47
-16
@@ -44,6 +44,22 @@ class dm extends dao
|
||||
return $this->query($sql)->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get table engines.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getTableEngines()
|
||||
{
|
||||
$tables = $this->query("SELECT \"table_name\" FROM all_tables WHERE OWNER = '{$this->config->db->name}'")->fetchAll();
|
||||
|
||||
$tableEngines = array();
|
||||
foreach($tables as $table) $tableEngines[$table->table_name] = 'InnoDB';
|
||||
|
||||
return $tableEngines;
|
||||
}
|
||||
|
||||
/**
|
||||
* 类MySQL的DESC语法。
|
||||
* Desc table, show fields.
|
||||
@@ -54,8 +70,10 @@ class dm extends dao
|
||||
*/
|
||||
public function descTable($tableName)
|
||||
{
|
||||
$this->dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
|
||||
$sql = "select * from all_tab_columns where table_name = '$tableName'";
|
||||
$rawFields = $this->dbh->rawQuery($sql)->fetchAll();
|
||||
$this->dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL);
|
||||
|
||||
$fields = array();
|
||||
foreach($rawFields as $rawField)
|
||||
@@ -118,7 +136,7 @@ class dm extends dao
|
||||
|
||||
if(stripos($originField, 'if(') !== false)
|
||||
{
|
||||
$originField = $this->formatIfFunction($originField);
|
||||
$originField = $this->dbh->formatDmIfFunction($originField);
|
||||
}
|
||||
elseif(strcasecmp($originField, 'distinct') !== 0)
|
||||
{
|
||||
@@ -147,6 +165,7 @@ class dm extends dao
|
||||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
/*
|
||||
private function formatIfFunction($field)
|
||||
{
|
||||
preg_match('/if\(.+\)+/i', $field, $matches);
|
||||
@@ -158,7 +177,7 @@ class dm extends dao
|
||||
$if = substr($if, 0, $pos+1);
|
||||
}
|
||||
|
||||
/* fix sum(if(..., 1, 0)) , count(if(..., 1, 0)) */
|
||||
// * fix sum(if(..., 1, 0)) , count(if(..., 1, 0)) * //
|
||||
if(substr($if, strlen($if)-2) == '))' and (stripos($field, 'sum(') == 0 or stripos($field, 'count(') == 0)) $if = substr($if, 0, strlen($if)-1);
|
||||
|
||||
$parts = explode(',', substr($if, 3, strlen($if)-4)); // remove 'if(' and ')'
|
||||
@@ -167,6 +186,7 @@ class dm extends dao
|
||||
|
||||
return $field;
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* 创建WHERE部分。
|
||||
@@ -280,12 +300,22 @@ class dm extends dao
|
||||
return parent::on($condition);
|
||||
}
|
||||
|
||||
public function getPKColumns()
|
||||
/**
|
||||
* 获取唯一索引的列。
|
||||
* Get unique columns.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUniqueColumns()
|
||||
{
|
||||
$sql = "SELECT A.OWNER, A.TABLE_NAME, WM_CONCAT(B.COLUMN_NAME) PK_COLUMNS FROM ALL_CONSTRAINTS A, ALL_CONS_COLUMNS B where A.CONSTRAINT_type = 'P' AND A.OWNER = '{$this->config->db->name}' AND A.TABLE_NAME = '{$this->table}' AND B.OWNER = A.OWNER AND A.TABLE_NAME = B.TABLE_NAME GROUP BY A.OWNER, A.TABLE_NAME;";
|
||||
$sql = "SELECT * from dba_ind_columns WHERE index_owner = '{$this->config->db->name}' AND index_name IN (SELECT index_name FROM dba_indexes WHERE table_name='{$this->table}' AND INDEX_TYPE = 'NORMAL' AND UNIQUENESS = 'UNIQUE' AND INDEX_NAME NOT IN (SELECT INDEX_NAME FROM DBA_CONSTRAINTS WHERE CONSTRAINT_TYPE = 'P'))";
|
||||
|
||||
$content = $this->dbh->query($sql)->fetch();
|
||||
return empty($content) ? false : $content->PK_COLUMNS;
|
||||
$columns = $this->dbh->query($sql)->fetchAll();
|
||||
|
||||
$cols = array();
|
||||
foreach($columns as $col) $cols[$col->COLUMN_NAME] = $col;
|
||||
return $cols;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -319,7 +349,7 @@ class dm extends dao
|
||||
foreach($this->sqlobj->data as $field => $value)
|
||||
{
|
||||
$fields .= "`{$field}`,";
|
||||
if(is_string($value)) $value = $this->sqlobj->quote($value);
|
||||
if(is_string($value) or $value === null) $value = $this->sqlobj->quote($value);
|
||||
$values .= $value . ',';
|
||||
}
|
||||
$fields = substr($fields, 0, -1);
|
||||
@@ -329,17 +359,17 @@ class dm extends dao
|
||||
$insertSql .= $fields . ' ' . $values;
|
||||
|
||||
$updateSql = str_replace('REPLACE', 'UPDATE', $sql);
|
||||
$pks = $this->getPKColumns();
|
||||
if(!empty($pks))
|
||||
$cols = $this->getUniqueColumns();
|
||||
|
||||
/* No unique keys, no replace. */
|
||||
if(empty($cols)) return false;
|
||||
|
||||
$conditions = array();
|
||||
foreach($cols as $colName => $col)
|
||||
{
|
||||
$pks = explode(',', $pks);
|
||||
$conditions = array();
|
||||
foreach($pks as $pk)
|
||||
{
|
||||
if(isset($this->sqlobj->data->{$pk})) $conditions[] = " \"{$pk}\" = '{$this->sqlobj->data->{$pk}}'";
|
||||
}
|
||||
if(!empty($conditions)) $updateSql .= ' WHERE ' . implode(' AND ', $conditions);
|
||||
if(isset($this->sqlobj->data->{$colName})) $conditions[] = " \"{$colName}\" = '{$this->sqlobj->data->{$colName}}'";
|
||||
}
|
||||
if(!empty($conditions)) $updateSql .= ' WHERE ' . implode(' AND ', $conditions);
|
||||
|
||||
$deleteSql = "DELETE FROM \"{$this->table}\" WHERE ";
|
||||
$ingore = array();
|
||||
@@ -347,6 +377,7 @@ class dm extends dao
|
||||
foreach($this->sqlobj->data as $field => $value)
|
||||
{
|
||||
if(isset($ingore[$this->table]) and in_array($field, $ingore[$this->table])) continue;
|
||||
if(!isset($cols[$field])) continue;
|
||||
$deleteSql .= "`{$field}` = ";
|
||||
$deleteSql .= is_string($value) ? "'{$value}'" : $value;
|
||||
$deleteSql .= ' AND ';
|
||||
|
||||
+56
-2
@@ -277,10 +277,36 @@ class dbh
|
||||
if(strpos($sql, '\\\\') !== FALSE) $sql = str_replace('\\\\', '\\', $sql);
|
||||
break;
|
||||
case 'CREATE':
|
||||
if(stripos($sql, 'CREATE OR REPLACE VIEW ') === 0) return '';
|
||||
if(stripos($sql, 'CREATE VIEW') === 0) return '';
|
||||
if(stripos($sql, 'CREATE FUNCTION') === 0) return '';
|
||||
if(stripos($sql, 'CREATE UNIQUE INDEX') === 0)
|
||||
|
||||
if(stripos($sql, 'CREATE OR REPLACE VIEW ') === 0)
|
||||
{
|
||||
// Modify if function.
|
||||
$fieldsBegin = stripos($sql, 'select');
|
||||
$fieldsEnd = stripos($sql, 'from');
|
||||
$fields = substr($sql, $fieldsBegin+6, $fieldsEnd-$fieldsBegin-6);
|
||||
$fieldList = preg_split("/,(?![^(]+\))/", $fields);
|
||||
foreach($fieldList as $key => $field)
|
||||
{
|
||||
$aliasPos = stripos($field, ' AS ');
|
||||
$subField = substr($field, 0, $aliasPos);
|
||||
if(stripos($field, 'SUM(') === 0) $subField = substr($subField, 4, -1);
|
||||
|
||||
$fieldParts = preg_split("/\+(?![^(]+\))/", $subField);
|
||||
foreach($fieldParts as $pkey => $fieldPart)
|
||||
{
|
||||
$originField = trim($fieldPart);
|
||||
if(stripos($originField, 'if(') === false) continue;
|
||||
$fieldParts[$pkey] = $this->formatDmIfFunction($originField);
|
||||
}
|
||||
$fieldList[$key] = str_replace($subField, implode(' + ', $fieldParts), $field);
|
||||
}
|
||||
$fields = implode(',', $fieldList);
|
||||
$sql = substr($sql, 0, $fieldsBegin+6) . $fields . substr($sql, $fieldsEnd);
|
||||
return str_replace('CREATE OR REPLACE VIEW ', 'CREATE VIEW ', $sql);
|
||||
}
|
||||
elseif(stripos($sql, 'CREATE UNIQUE INDEX') === 0)
|
||||
{
|
||||
preg_match('/ON\ +[0-9a-zA-Z\_\.]+\`([0-9a-zA-Z\_]+)\`/', $sql, $matches);
|
||||
$tableName = explode('_', $matches[1]);
|
||||
@@ -337,6 +363,34 @@ class dbh
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Format if function of dmdb.
|
||||
*
|
||||
* @param string $field
|
||||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
public function formatDmIfFunction($field)
|
||||
{
|
||||
preg_match('/if\(.+\)+/i', $field, $matches);
|
||||
|
||||
$if = $matches[0];
|
||||
if(substr_count($if, '(') == 1)
|
||||
{
|
||||
$pos = strpos($if, ')');
|
||||
$if = substr($if, 0, $pos+1);
|
||||
}
|
||||
|
||||
/* fix sum(if(..., 1, 0)) , count(if(..., 1, 0)) */
|
||||
if(substr($if, strlen($if)-2) == '))' and (stripos($field, 'sum(') == 0 or stripos($field, 'count(') == 0)) $if = substr($if, 0, strlen($if)-1);
|
||||
|
||||
$parts = explode(',', substr($if, 3, strlen($if)-4)); // remove 'if(' and ')'
|
||||
$case = 'CASE WHEN ' . implode(',', array_slice($parts, 0, count($parts)-2)) . ' THEN ' . $parts[count($parts)-2] . ' ELSE ' . $parts[count($parts)-1] . ' END';
|
||||
$field = str_ireplace($if, $case, $field);
|
||||
|
||||
return $field;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format attribute of field.
|
||||
*
|
||||
|
||||
@@ -769,7 +769,7 @@ $lang->action->label->risk = 'Risk|risk|view|riskID=%s';
|
||||
$lang->action->label->issue = 'Issue|issue|view|issueID=%s';
|
||||
$lang->action->label->design = 'Design|design|view|designID=%s';
|
||||
$lang->action->label->stakeholder = 'Stakeholder|stakeholder|view|userID=%s';
|
||||
$lang->action->label->api = 'Interface|api|index|libID=%s&moduleID=%s&apiID=%s';
|
||||
$lang->action->label->api = 'Interface|api|view|libID=%s&apiID=%s&moduleID=%s';
|
||||
$lang->action->label->kanbanspace = 'Kanban Space|kanban|space|browseType=%s';
|
||||
$lang->action->label->kanbanregion = 'Kanban Region|kanban|view|kanbanID=%s';
|
||||
$lang->action->label->kanban = 'Kanban|kanban|view|kanbanID=%s';
|
||||
|
||||
@@ -769,7 +769,7 @@ $lang->action->label->risk = 'Risk|risk|view|riskID=%s';
|
||||
$lang->action->label->issue = 'Issue|issue|view|issueID=%s';
|
||||
$lang->action->label->design = 'Design|design|view|designID=%s';
|
||||
$lang->action->label->stakeholder = 'Stakeholder|stakeholder|view|userID=%s';
|
||||
$lang->action->label->api = 'Interface|api|index|libID=%s&moduleID=%s&apiID=%s';
|
||||
$lang->action->label->api = 'Interface|api|view|libID=%s&apiID=%s&moduleID=%s';
|
||||
$lang->action->label->kanbanspace = 'Kanban Space|kanban|space|browseType=%s';
|
||||
$lang->action->label->kanbanregion = 'Kanban Region|kanban|view|kanbanID=%s';
|
||||
$lang->action->label->kanban = 'Kanban|kanban|view|kanbanID=%s';
|
||||
|
||||
@@ -769,7 +769,7 @@ $lang->action->label->risk = 'Risk|risk|view|riskID=%s';
|
||||
$lang->action->label->issue = 'Issue|issue|view|issueID=%s';
|
||||
$lang->action->label->design = 'Design|design|view|designID=%s';
|
||||
$lang->action->label->stakeholder = 'Stakeholder|stakeholder|view|userID=%s';
|
||||
$lang->action->label->api = 'Interface|api|index|libID=%s&moduleID=%s&apiID=%s';
|
||||
$lang->action->label->api = 'Interface|api|view|libID=%s&apiID=%s&moduleID=%s';
|
||||
$lang->action->label->kanbanspace = 'Kanban Space|kanban|space|browseType=%s';
|
||||
$lang->action->label->kanbanregion = 'Kanban Region|kanban|view|kanbanID=%s';
|
||||
$lang->action->label->kanban = 'Kanban|kanban|view|kanbanID=%s';
|
||||
|
||||
@@ -770,7 +770,7 @@ $lang->action->label->risk = '风险|risk|view|riskID=%s';
|
||||
$lang->action->label->issue = '问题|issue|view|issueID=%s';
|
||||
$lang->action->label->design = '设计|design|view|designID=%s';
|
||||
$lang->action->label->stakeholder = '干系人|stakeholder|view|userID=%s';
|
||||
$lang->action->label->api = '接口|api|index|libID=%s&moduleID=%s&apiID=%s';
|
||||
$lang->action->label->api = '接口|api|view|libID=%s&apiID=%s&moduleID=%s';
|
||||
$lang->action->label->kanbanspace = '看板空间|kanban|space|browseType=%s';
|
||||
$lang->action->label->kanbanregion = '看板区域|kanban|view|kanbanID=%s';
|
||||
$lang->action->label->kanban = '看板|kanban|view|kanbanID=%s';
|
||||
|
||||
@@ -951,6 +951,7 @@ class actionModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
$action->date = substr($action->date, 0, 19);
|
||||
if($this->app->getViewType() == 'mhtml') $action->date = date('m-d H:i', strtotime($action->date));
|
||||
|
||||
/* Cycle actions, replace vars. */
|
||||
@@ -1645,7 +1646,7 @@ class actionModel extends model
|
||||
elseif($action->objectType == 'api')
|
||||
{
|
||||
$api = $this->dao->select('id,lib,module')->from(TABLE_API)->where('id')->eq($action->objectID)->fetch();
|
||||
$params = sprintf($vars, $api->lib, $api->module, $api->id);
|
||||
$params = sprintf($vars, $api->lib, $api->id, $api->module);
|
||||
}
|
||||
elseif($action->objectType == 'branch')
|
||||
{
|
||||
|
||||
@@ -477,7 +477,7 @@ class admin extends control
|
||||
public function tableEngine()
|
||||
{
|
||||
$this->view->title = $this->lang->admin->tableEngine;
|
||||
$this->view->tableEngines = $this->loadModel('misc')->getTableEngines();
|
||||
$this->view->tableEngines = $this->dao->getTableEngines();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -45,16 +45,16 @@ $lang->admin->menuList->convert['link'] = 'convert|convertjira';
|
||||
$lang->admin->menuList->convert['order'] = 50;
|
||||
|
||||
$lang->admin->menuList->system['subMenu']['mode'] = array('link' => "{$lang->custom->mode}|custom|mode|");
|
||||
$lang->admin->menuList->system['subMenu']['backup'] = array('link' => "{$lang->backup->common}|backup|index|");
|
||||
$lang->admin->menuList->system['subMenu']['trash'] = array('link' => "{$lang->action->trash}|action|trash|");
|
||||
$lang->admin->menuList->system['subMenu']['safe'] = array('link' => "{$lang->security}|admin|safe|", 'alias' => 'checkweak,resetpwdsetting', 'links' => array('admin|resetpwdsetting|', 'admin|checkweak|'));
|
||||
$lang->admin->menuList->system['subMenu']['cron'] = array('link' => "{$lang->admin->cron}|cron|index|", 'subModule' => 'cron');
|
||||
$lang->admin->menuList->system['subMenu']['timezone'] = array('link' => "{$lang->timezone}|custom|timezone|");
|
||||
$lang->admin->menuList->system['subMenu']['buildindex'] = array('link' => "{$lang->admin->buildIndex}|search|buildindex|");
|
||||
$lang->admin->menuList->system['subMenu']['tableengine'] = array('link' => "{$lang->admin->tableEngine}|admin|tableengine|");
|
||||
if($this->config->db->driver == 'mysql') $lang->admin->menuList->system['subMenu']['backup'] = array('link' => "{$lang->backup->common}|backup|index|");
|
||||
|
||||
$lang->admin->menuList->system['menuOrder']['5'] = 'mode';
|
||||
$lang->admin->menuList->system['menuOrder']['10'] = 'backup';
|
||||
if($this->config->db->driver == 'mysql') $lang->admin->menuList->system['menuOrder']['10'] = 'backup';
|
||||
$lang->admin->menuList->system['menuOrder']['15'] = 'trash';
|
||||
$lang->admin->menuList->system['menuOrder']['30'] = 'safe';
|
||||
$lang->admin->menuList->system['menuOrder']['35'] = 'cron';
|
||||
|
||||
@@ -24,6 +24,7 @@ $config->api->editor->createlib = array('id' => 'desc', 'tools' => 'simpleTo
|
||||
$config->api->editor->editlib = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->api->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->api->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->api->editor->view = array('id' => 'comment,lastComment', 'tools' => 'simple');
|
||||
$config->api->editor->createRelease = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->api->editor->createstruct = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->api->editor->editstruct = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
|
||||
+59
-16
@@ -41,8 +41,12 @@ class api extends control
|
||||
*/
|
||||
public function index($libID = 0, $moduleID = 0, $apiID = 0, $version = 0, $release = 0, $appendLib = 0, $browseType = '', $param = 0)
|
||||
{
|
||||
$this->session->set('spaceType', 'api', 'doc');
|
||||
$this->session->set('structList', $this->app->getURI(true), 'doc');
|
||||
if(!$apiID)
|
||||
{
|
||||
$this->session->set('spaceType', 'api', 'doc');
|
||||
$this->session->set('structList', inLink('index', "libID=$libID&moduleID=$moduleID"), 'doc');
|
||||
setCookie("docSpaceParam", '', $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
}
|
||||
|
||||
$this->setMenu($libID);
|
||||
$objectType = $this->objectType;
|
||||
@@ -144,14 +148,14 @@ class api extends control
|
||||
* @param int $libID
|
||||
* @param int $apiID
|
||||
* @param int $moduleID
|
||||
* @param int $release
|
||||
* @param int $version
|
||||
* @param int $release
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function view($libID, $apiID, $moduleID = 0, $release = 0, $version = 0)
|
||||
public function view($libID, $apiID, $moduleID = 0, $version = 0, $release = 0)
|
||||
{
|
||||
$this->setMenu($libID);
|
||||
if(!strpos($this->server->http_referer, 'space') and !strpos($this->server->http_referer, 'api')) setCookie("docSpaceParam", '', $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
|
||||
/* Get all api doc libraries. */
|
||||
$libs = $this->doc->getApiLibs($libID);
|
||||
@@ -180,24 +184,39 @@ class api extends control
|
||||
$linkParams = "libID=$lib->id";
|
||||
if($methodName != 'index') $linkParams = "objectID=$linkObject&$linkParams";
|
||||
|
||||
$crumbs[] = html::a(inLink($methodName, $linkParams), html::image("static/svg/interface.svg") . $lib->name);
|
||||
$moduleList = $this->loadModel('tree')->getParents($api->module);
|
||||
foreach($moduleList as $module)
|
||||
$objectID = $this->objectID;
|
||||
if($this->cookie->docSpaceParam)
|
||||
{
|
||||
$linkParams .= "&moduleID=$module->id";
|
||||
$crumbs[] = html::a(inLink($methodName, $linkParams), $module->name);
|
||||
}
|
||||
$docParam = json_decode($this->cookie->docSpaceParam);
|
||||
$type = $docParam->type;
|
||||
$objectID = $docParam->objectID;
|
||||
$libID = $docParam->libID;
|
||||
$moduleID = $docParam->moduleID;
|
||||
$browseType = $docParam->browseType;
|
||||
$param = $docParam->param;
|
||||
list($libs, $libID, $object, $objectID, $objectDropdown) = $this->doc->setMenuByType($type, $objectID, $libID);
|
||||
|
||||
$libTree = $this->doc->getLibTree($libID, $libs, $type, $moduleID, $objectID, $browseType, $param);
|
||||
}
|
||||
else
|
||||
{
|
||||
$objectDropdown = $this->generateLibsDropMenu($libs[$libID], $release);
|
||||
$libTree = $this->doc->getLibTree($libID, $libs, 'api', $moduleID);
|
||||
}
|
||||
$this->view->title = $this->lang->api->pageTitle;
|
||||
$this->view->libs = $libs;
|
||||
$this->view->isRelease = $release > 0;
|
||||
$this->view->release = $release;
|
||||
$this->view->version = $version;
|
||||
$this->view->libID = $libID;
|
||||
$this->view->apiID = $apiID;
|
||||
$this->view->crumbs = $crumbs;
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->objectType = $type;
|
||||
$this->view->type = $type;
|
||||
$this->view->objectID = $objectID;
|
||||
$this->view->users = $this->user->getPairs('noclosed,noletter');
|
||||
$this->view->moduleTree = $this->doc->getApiModuleTree($libID, $apiID, $release, $moduleID);
|
||||
$this->view->objectDropdown = $this->generateLibsDropMenu($libs[$libID], $release);
|
||||
$this->view->libTree = $libTree;
|
||||
$this->view->objectDropdown = $objectDropdown;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -653,7 +672,7 @@ class api extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
return print(js::locate(inlink('index', "libID=$api->lib&module=$api->module"), 'parent'));
|
||||
return print(js::locate($this->session->structList ? $this->session->structList : inlink('index', "libID=$api->lib&module=$api->module"), 'parent'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -752,7 +771,10 @@ class api extends control
|
||||
$this->lang->doc->menu->api['exclude'] = 'api-' . $this->app->rawMethod;
|
||||
$this->lang->doc->menu->{$this->session->spaceType}['subModule'] = 'api';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$this->lang->doc->menu->{$this->session->spaceType}['alias'] .= ',' . $this->app->rawMethod;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -983,4 +1005,25 @@ class api extends control
|
||||
{
|
||||
echo $this->fetch('tree', 'delete', "rootID=$rootID&moduleID=$moduleID&confirm=$confirm");
|
||||
}
|
||||
|
||||
/**
|
||||
* Catalog sort.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function sortCatalog()
|
||||
{
|
||||
if($_SERVER['REQUEST_METHOD'] == 'POST')
|
||||
{
|
||||
foreach($_POST['orders'] as $id => $order)
|
||||
{
|
||||
$this->dao->update(TABLE_MODULE)->set('`order`')->eq($order)->where('id')->eq($id)->andWhere('type')->eq('api')->exec();
|
||||
}
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success'));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,3 +163,23 @@ form .table-data, #content .table-data {border: 1px solid #e2e2e3;}
|
||||
.info .version, .info .crumbs {float: left;}
|
||||
.info .crumbs {font-size: 13px; margin-top: 5px; font-weight: normal;}
|
||||
.info .crumbs img {margin-right: 3px;}
|
||||
|
||||
.lib {width: unset; margin-bottom: unset;}
|
||||
.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;}
|
||||
|
||||
@@ -1,24 +1,4 @@
|
||||
.lib {width: unset; margin-bottom: unset;}
|
||||
.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;}
|
||||
.cell {padding: 0;}
|
||||
#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;}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
.flex-content #content {flex: auto; overflow-y: auto; height: calc(100vh - 125px);}
|
||||
.flex-content #history {flex: 0 0 302px; position: relative; overflow: auto;}
|
||||
.flex-content #history > #closeBtn {position: absolute; right: 10px; top: 10px;}
|
||||
|
||||
#content .detail-content.article-content::-webkit-scrollbar,
|
||||
#outlineMenu::-webkit-scrollbar,
|
||||
#history::-webkit-scrollbar {height: 0px; width: 0px; background: transparent;}
|
||||
#content .detail-content.article-content::-moz-scrollbar,
|
||||
#outlineMenu::-moz-scrollbar,
|
||||
#hostory::-moz-scrollbar {height: 0px; width: 0px; background: transparent;}
|
||||
.main-col iframe {min-height: unset;}
|
||||
.bottom-btn-tree {display: none;}
|
||||
+39
-1
@@ -104,7 +104,7 @@ $(function()
|
||||
$('.menu-actions > a').blur(function() {$(this).css('background', 'none');})
|
||||
|
||||
/* Update doc content silently on switch doc version, story #40503 */
|
||||
$(document).on('click', '.api-version-menu a, #mainActions .container a', function(event)
|
||||
$('body').on('click', '.api-version-menu a, #mainActions .container a', function(event)
|
||||
{
|
||||
var $tmpDiv = $('<div>');
|
||||
$tmpDiv.load($(this).data('url') + ' #mainContent', function()
|
||||
@@ -117,5 +117,43 @@ $(function()
|
||||
$('#outline li.has-list').addClass('open in');
|
||||
$('#outline li.has-list>i+ul').prev('i').remove();
|
||||
});
|
||||
}).on('click', '.comment-edit-form .btn-hide-form', function()
|
||||
{
|
||||
$('.comment-edit-form #submit').attr('disabled', false);
|
||||
}).on('click', '#docVersionMenu.diff > .drop-body > li', function(e)
|
||||
{
|
||||
e.stopPropagation();
|
||||
}).on('click', '#docVersionMenu #changeBtn', function(e)
|
||||
{
|
||||
$('#docVersionMenu').addClass('diff');
|
||||
e.stopPropagation();
|
||||
}).on('click', '#hisTrigger', function()
|
||||
{
|
||||
var $history = $('#history');
|
||||
var $icon = $(this);
|
||||
if($history.hasClass('hidden'))
|
||||
{
|
||||
$history.removeClass('hidden');
|
||||
$icon.addClass('text-primary');
|
||||
}
|
||||
else
|
||||
{
|
||||
$history.addClass('hidden');
|
||||
$icon.removeClass('text-primary');
|
||||
}
|
||||
}).on('click', '#closeBtn', function()
|
||||
{
|
||||
$('#history').addClass('hidden');
|
||||
$('#hisTrigger').removeClass('text-primary');
|
||||
});
|
||||
|
||||
$('#history').append('<a id="closeBtn" href="###" class="btn btn-link"><i class="icon icon-close"></i></a>');
|
||||
|
||||
$('#history').find('.btn.pull-right').removeClass('pull-right');
|
||||
|
||||
$('.comment-edit-form').ajaxForm({
|
||||
success: function(data) {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
@@ -64,6 +64,7 @@ $lang->api->allLibs = "AllLibs";
|
||||
$lang->api->noLinked = "No Linked {$lang->productCommon} and {$lang->projectCommon}";
|
||||
$lang->api->addCatalog = 'Add Catalog';
|
||||
$lang->api->editCatalog = 'Edit Catalog';
|
||||
$lang->api->sortCatalog = 'Catalog Sorting';
|
||||
$lang->api->deleteCatalog = 'Delete Catalog';
|
||||
|
||||
/* Common access control lang. */
|
||||
|
||||
@@ -64,6 +64,7 @@ $lang->api->allLibs = "AllLibs";
|
||||
$lang->api->noLinked = "No Linked {$lang->productCommon} and {$lang->projectCommon}";
|
||||
$lang->api->addCatalog = 'Add Catalog';
|
||||
$lang->api->editCatalog = 'Edit Catalog';
|
||||
$lang->api->sortCatalog = 'Catalog Sorting';
|
||||
$lang->api->deleteCatalog = 'Delete Catalog';
|
||||
|
||||
/* Common access control lang. */
|
||||
|
||||
@@ -64,6 +64,7 @@ $lang->api->allLibs = "AllLibs";
|
||||
$lang->api->noLinked = "No Linked {$lang->productCommon} and {$lang->projectCommon}";
|
||||
$lang->api->addCatalog = 'Add Catalog';
|
||||
$lang->api->editCatalog = 'Edit Catalog';
|
||||
$lang->api->sortCatalog = 'Catalog Sorting';
|
||||
$lang->api->deleteCatalog = 'Delete Catalog';
|
||||
|
||||
/* Common access control lang. */
|
||||
|
||||
@@ -64,6 +64,7 @@ $lang->api->allLibs = "全部库";
|
||||
$lang->api->noLinked = "未关联{$lang->productCommon}和{$lang->projectCommon}";
|
||||
$lang->api->addCatalog = '添加目录';
|
||||
$lang->api->editCatalog = '编辑目录';
|
||||
$lang->api->sortCatalog = '目录排序';
|
||||
$lang->api->deleteCatalog = '删除目录';
|
||||
|
||||
/* Common access control lang. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="main-col" data-min-width="500">
|
||||
<div id="mainContent" class="main-row in">
|
||||
<div id="mainContent" class="main-row in flex-content">
|
||||
<div class="main-col col-8">
|
||||
<div class="cell" id="content">
|
||||
<div class="no-padding">
|
||||
@@ -20,15 +20,14 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="crumbs"><?php echo implode(' > ', $crumbs);?></div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<?php echo html::a("javascript:fullScreen()", '<span class="icon-fullscreen"></span>', '', "title='{$lang->fullscreen}' class='btn btn-link fullscreen-btn'");?>
|
||||
<?php
|
||||
if(!$isRelease)
|
||||
{
|
||||
if(common::hasPriv('api', 'edit')) echo html::a(inlink('edit', "apiID=$api->id"), '<i class="icon-edit"></i>', '', "title='{$lang->api->edit}' class='btn btn-link' data-app='{$this->app->tab}'");
|
||||
if(common::hasPriv('api', 'delete')) echo html::a(inLink('api', 'delete', "apiID=$api->id"), '<i class="icon-trash"></i>', '', "title='{$lang->api->delete}' class='btn btn-link' target='hiddenwin'");
|
||||
if(common::hasPriv('api', 'edit')) echo html::a($this->createLink('api', 'edit', "apiID=$api->id"), '<i class="icon-edit"></i>', '', "title='{$lang->api->edit}' class='btn btn-link' data-app='{$this->app->tab}'");
|
||||
if(common::hasPriv('api', 'delete')) echo html::a($this->createLink('api', 'delete', "apiID=$api->id"), '<i class="icon-trash"></i>', '', "title='{$lang->api->delete}' class='btn btn-link' target='hiddenwin'");
|
||||
}
|
||||
?>
|
||||
<a id="hisTrigger" href="###" class="btn btn-link" title=<?php echo $lang->history?>><span class="icon icon-clock"></span></a>
|
||||
@@ -57,8 +56,7 @@
|
||||
<td><?php echo $lang->api->boolList[$param['required']];?></td>
|
||||
<td><?php echo $param['desc'];?></td>
|
||||
<tr>
|
||||
<?php endforeach;
|
||||
;?>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
@@ -148,53 +146,12 @@
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 历史记录 -->
|
||||
<div class='cell'>
|
||||
<?php
|
||||
$canBeChanged = common::canBeChanged('api', $api);
|
||||
if($canBeChanged) $actionFormLink = $this->createLink('action', 'comment', "objectType=api&objectID=$api->id");?>
|
||||
<?php include '../../common/view/action.html.php';?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="side-col col-2" id="sidebar">
|
||||
<div class="sidebar-toggle">
|
||||
<i class="icon icon-angle-right"></i>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<details class="detail" open>
|
||||
<summary class="detail-title"><?php echo $lang->api->basicInfo;?></summary>
|
||||
<div class="detail-content">
|
||||
<table class="table table-data">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class='c-lib'><?php echo $lang->api->lib;?></th>
|
||||
<td><?php echo $api->libName;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->module;?></th>
|
||||
<td><?php echo $api->moduleName ? $api->moduleName : '/';?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->addedDate;?></th>
|
||||
<td><?php echo $api->addedDate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->api->owner;?></th>
|
||||
<td><?php echo zget($users, $api->owner, '');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->editedBy;?></th>
|
||||
<td><?php echo zget($users, $api->editedBy, '');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->editedDate;?></th>
|
||||
<td><?php echo $api->editedDate;?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
<div id="history" class='panel hidden' style="margin-left: 2px;">
|
||||
<?php
|
||||
$canBeChanged = common::canBeChanged('api', $api);
|
||||
if($canBeChanged) $actionFormLink = $this->createLink('action', 'comment', "objectType=api&objectID=$api->id");?>
|
||||
<?php include '../../common/view/action.html.php';?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<div class="sidebar-toggle flex-center"><i class="icon icon-angle-left"></i></div>
|
||||
<div class="main-col flex-full overflow-visible flex-auto overflow-visible" data-min-width="500">
|
||||
<div class="cell<?php if($browseType == 'bySearch') echo ' show';?>" style="min-width: 400px" id="queryBox" data-module='api'></div>
|
||||
<?php include 'apilist.html.php';?>
|
||||
<?php include 'apilist.html.php';?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
@@ -11,48 +11,36 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php js::set('confirmDelete', $lang->api->confirmDelete);?>
|
||||
<div class="cell<?php if($browseType == 'bySearch') echo ' show';?>" id="queryBox" data-module=<?php echo 'api';?>></div>
|
||||
<div class="fade main-row split-row" id="mainRow">
|
||||
<?php if($libID):?>
|
||||
<?php $sideWidth = common::checkNotCN() ? '270' : '238';?>
|
||||
<div class="side-col" style="width:<?php echo $sideWidth;?>px" data-min-width="<?php echo $sideWidth;?>">
|
||||
<div class="cell" style="min-height: 286px; overflow: visible;">
|
||||
<div id='title'>
|
||||
<li class='menu-title'>
|
||||
<div class="title"><?php echo $this->lang->api->module;?></div>
|
||||
</li>
|
||||
<?php
|
||||
$canTreeBrowse = common::hasPriv('tree', 'browse');
|
||||
$canViewReleases = common::hasPriv('api', 'releases');
|
||||
$canEditLib = common::hasPriv('api', 'editLib');
|
||||
$canDeleteLib = common::hasPriv('api', 'deleteLib');
|
||||
$haveMoreButton = ($canTreeBrowse or $canViewReleases or $canEditLib or $canDeleteLib);
|
||||
|
||||
if(!$isRelease and $haveMoreButton)
|
||||
{
|
||||
echo "<div class='menu-actions'>";
|
||||
echo html::a('javascript:;', "<i class='icon icon-ellipsis-v'></i>", '', "data-toggle='dropdown' class='btn btn-link'");
|
||||
echo "<ul class='dropdown-menu pull-right'>";
|
||||
if($canTreeBrowse) echo '<li>' . html::a($this->createLink('tree', 'browse', "rootID=$libID&view=api", '', true), '<i class="icon-cog-outline"></i> ' . $this->lang->api->manageType, '', "class='iframe' data-width='1200px'") . '</li>';
|
||||
if($canViewReleases) echo '<li>' . html::a($this->createLink('api', 'releases', "libID=$libID", '', true), '<i class="icon-version"></i> ' . $this->lang->api->managePublish, '', "class='iframe'") . '</li>';
|
||||
echo "<li class='divider'></li>";
|
||||
if($canEditLib) echo '<li>' . html::a($this->createLink('api', 'editLib', "rootID=$libID"), '<i class="icon-edit"></i> ' . $lang->api->editLib, '', "class='iframe'") . '</li>';
|
||||
if($canDeleteLib) echo '<li>' . html::a($this->createLink('api', 'deleteLib', "rootID=$libID"), '<i class="icon-trash"></i> ' . $lang->api->deleteLib, 'hiddenwin') . '</li>';
|
||||
echo '</ul></div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php if(!$moduleTree):?>
|
||||
<hr class="space">
|
||||
<?php if(!$isRelease):?>
|
||||
<div class="text-center text-muted tips"><?php echo $lang->api->noModule;?></div>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
<?php echo $moduleTree;?>
|
||||
</div>
|
||||
<?php js::set('treeData', $libTree);?>
|
||||
<?php js::set('apiID', $apiID);?>
|
||||
<style>.panel-body{min-height: 180px}</style>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div id="leftBar" class="btn-toolbar pull-left">
|
||||
<?php echo $objectDropdown;?>
|
||||
<?php $gobackLink = $this->session->structList ? $this->session->structList : inlink('index', "libID=$libID&moduleID=$moduleID");?>
|
||||
<?php echo html::a($gobackLink, "<i class='icon-back'></i> " . $lang->goback, '', "class='btn btn-link'");?>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php
|
||||
if($libTree and common::hasPriv('api', 'struct')) echo html::a($this->createLink('api', 'struct', "libID=$libID"), "<i class='icon-treemap muted'> </i>" . $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), "<i class='icon-version muted'> </i>" . $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"), "<i class='icon-publish muted'> </i>" . $lang->api->createRelease, '', "class='btn btn-link iframe' data-width='800px'");
|
||||
if($objectType == 'api' and common::hasPriv('api', 'createLib')) echo html::a($this->createLink('api', 'createLib', "type=" . ($objectType ? $objectType : 'nolink') . "&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
|
||||
if($objectType != 'api' and common::hasPriv('doc', 'createLib')) echo html::a($this->createLink('doc', 'createLib', "type=" . ($objectType ? $objectType : 'nolink') . "&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $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"), '<i class="icon icon-plus"></i> ' . $lang->api->createApi, '', 'class="btn btn-primary"');
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class="fade flex">
|
||||
<div id='sideBar' class="panel side side-col col overflow-auto" data-min-width="150">
|
||||
<?php include '../../doc/view/lefttree.html.php';?>
|
||||
</div>
|
||||
<div class="sidebar-toggle flex-center"><i class="icon icon-angle-left"></i></div>
|
||||
<div class="main-col flex-full overflow-visible flex-auto overflow-visible" data-min-width="500">
|
||||
<div class="cell<?php if($browseType == 'bySearch') echo ' show';?>" style="min-width: 400px" id="queryBox" data-module='api'></div>
|
||||
<?php include 'apilist.html.php';?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php include 'apilist.html.php';?>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -84,3 +84,5 @@ $config->block->modules['common']->moreLinkList->dynamic = 'company|dynamic|';
|
||||
$config->block->modules['doc'] = new stdclass();
|
||||
$config->block->modules['doc']->moreLinkList = new stdclass();
|
||||
$config->block->modules['doc']->moreLinkList->docmycollection = 'doc|myspace|type=collect&libID=0&moduleID=0&browseType=all¶m=0&orderBy=editedDate_desc';
|
||||
$config->block->modules['doc']->moreLinkList->productdoc = 'doc|productspace|';
|
||||
$config->block->modules['doc']->moreLinkList->projectdoc = 'doc|projectspace|';
|
||||
|
||||
@@ -2119,6 +2119,11 @@ class block extends control
|
||||
*/
|
||||
public function printDocViewListBlock()
|
||||
{
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager(0, 6, 1);
|
||||
|
||||
$this->view->docList = $this->loadModel('doc')->getDocsByBrowseType('all', 0, 0,'views_desc', $pager);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2129,6 +2134,11 @@ class block extends control
|
||||
*/
|
||||
public function printDocCollectListBlock()
|
||||
{
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager(0, 6, 1);
|
||||
|
||||
$this->view->docList = $this->loadModel('doc')->getDocsByBrowseType('all', 0, 0, 'collects_desc', $pager);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2139,6 +2149,42 @@ class block extends control
|
||||
*/
|
||||
public function printProductDocBlock()
|
||||
{
|
||||
$this->loadModel('doc');
|
||||
$this->session->set('docList', $this->createLink('doc', 'index'), 'doc');
|
||||
|
||||
/* Set project status and count. */
|
||||
$count = isset($this->params->count) ? (int)$this->params->count : 15;
|
||||
$products = $this->loadModel('product')->getOrderedProducts('all');
|
||||
$involveds = $this->product->getOrderedProducts('involved');
|
||||
$productIdList = array_merge(array_keys($products), array_keys($involveds));
|
||||
|
||||
$stmt = $this->dao->select('id,product,lib,title,type,addedBy,addedDate,editedDate,status,acl,groups,users,deleted')->from(TABLE_DOC)->alias('t1')
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('product')->in($productIdList)
|
||||
->orderBy('product,status,editedDate_desc')
|
||||
->query();
|
||||
$docGroup = array();
|
||||
while($doc = $stmt->fetch())
|
||||
{
|
||||
if(!isset($docGroup[$doc->product])) $docGroup[$doc->product] = array();
|
||||
if(count($docGroup[$doc->product]) >= $count) continue;
|
||||
if($this->doc->checkPrivDoc($doc)) $docGroup[$doc->product][$doc->id] = $doc;
|
||||
}
|
||||
|
||||
$hasDataProducts = $hasDataInvolveds = array();
|
||||
foreach($products as $productID => $product)
|
||||
{
|
||||
if(isset($docGroup[$productID]) and count($docGroup[$productID]) > 0)
|
||||
{
|
||||
$hasDataProducts[$productID] = $product;
|
||||
if(isset($involveds[$productID])) $hasDataInvolveds[$productID] = $product;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->products = $hasDataProducts;
|
||||
$this->view->involveds = $hasDataInvolveds;
|
||||
$this->view->docGroup = $docGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2149,6 +2195,71 @@ class block extends control
|
||||
*/
|
||||
public function printProjectDocBlock()
|
||||
{
|
||||
$this->loadModel('doc');
|
||||
$this->app->loadLang('project');
|
||||
$this->session->set('docList', $this->createLink('doc', 'index'), 'doc');
|
||||
|
||||
/* Set project status and count. */
|
||||
$count = isset($this->params->count) ? (int)$this->params->count : 15;
|
||||
$projects = $this->dao->select('*')->from(TABLE_PROJECT)
|
||||
->where('deleted')->eq('0')
|
||||
->andWhere('vision')->eq($this->config->vision)
|
||||
->andWhere('type')->eq('project')
|
||||
->andWhere('model')->ne('kanban')
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
|
||||
->orderBy('order_asc,id_desc')
|
||||
->fetchAll('id');
|
||||
|
||||
$involveds = $this->dao->select('t1.*')->from(TABLE_PROJECT)->alias('t1')
|
||||
->leftJoin(TABLE_TEAM)->alias('t2')->on('t1.id=t2.root')
|
||||
->where('t1.deleted')->eq('0')
|
||||
->andWhere('t1.vision')->eq($this->config->vision)
|
||||
->andWhere('t1.type')->eq('project')
|
||||
->andWhere('t1.model')->ne('kanban')
|
||||
->andWhere('t2.type')->eq('project')
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->projects)->fi()
|
||||
->andWhere('t1.openedBy', true)->eq($this->app->user->account)
|
||||
->orWhere('t1.PM')->eq($this->app->user->account)
|
||||
->orWhere('t2.account')->eq($this->app->user->account)
|
||||
->markRight(1)
|
||||
->orderBy('t1.order_asc,t1.id_desc')
|
||||
->fetchAll('id');
|
||||
|
||||
$projectIdList = array_keys($projects);
|
||||
|
||||
$stmt = $this->dao->select('t1.id,t1.lib,t1.title,t1.type,t1.addedBy,t1.addedDate,t1.editedDate,t1.status,t1.acl,t1.groups,t1.users,t1.deleted,if(t1.project = 0, t2.project, t1.project) as project')->from(TABLE_DOC)->alias('t1')
|
||||
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution=t2.id')
|
||||
->where('t1.deleted')->eq(0)
|
||||
->andWhere('t2.deleted', true)->eq(0)
|
||||
->orWhere('t2.deleted is null')
|
||||
->markRight(1)
|
||||
->andWhere('t1.project', true)->in($projectIdList)
|
||||
->orWhere('t2.project')->in($projectIdList)
|
||||
->markRight(1)
|
||||
->orderBy('project,t1.status,t1.editedDate_desc')
|
||||
->query();
|
||||
$docGroup = array();
|
||||
while($doc = $stmt->fetch())
|
||||
{
|
||||
if(!isset($docGroup[$doc->project])) $docGroup[$doc->project] = array();
|
||||
if(count($docGroup[$doc->project]) >= $count) continue;
|
||||
if($this->doc->checkPrivDoc($doc)) $docGroup[$doc->project][$doc->id] = $doc;
|
||||
}
|
||||
|
||||
$hasDataProjects = $hasDataInvolveds = array();
|
||||
foreach($projects as $projectID => $project)
|
||||
{
|
||||
if(isset($docGroup[$projectID]) and count($docGroup[$projectID]) > 0)
|
||||
{
|
||||
$hasDataProjects[$projectID] = $project;
|
||||
if(isset($involveds[$projectID])) $hasDataInvolveds[$projectID] = $project;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->projects = $hasDataProjects;
|
||||
$this->view->involveds = $hasDataInvolveds;
|
||||
$this->view->docGroup = $docGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -355,19 +355,23 @@ $lang->block->default['doc']['5']['grid'] = 4;
|
||||
|
||||
if($config->vision == 'rnd')
|
||||
{
|
||||
$lang->block->default['doc']['6']['title'] = $lang->productCommon . 'Document';
|
||||
$lang->block->default['doc']['6']['title'] = $lang->productCommon . ' Document';
|
||||
$lang->block->default['doc']['6']['block'] = 'productdoc';
|
||||
$lang->block->default['doc']['6']['grid'] = 8;
|
||||
|
||||
$lang->block->default['doc']['6']['params']['count'] = '20';
|
||||
}
|
||||
|
||||
$lang->block->default['doc']['7']['title'] = 'Favorite Leaderboard';
|
||||
$lang->block->default['doc']['7']['block'] = 'doccollectlist';
|
||||
$lang->block->default['doc']['7']['grid'] = 4;
|
||||
|
||||
$lang->block->default['doc']['8']['title'] = $lang->projectCommon . 'Document';
|
||||
$lang->block->default['doc']['8']['title'] = $lang->projectCommon . ' Document';
|
||||
$lang->block->default['doc']['8']['block'] = 'projectdoc';
|
||||
$lang->block->default['doc']['8']['grid'] = 8;
|
||||
|
||||
$lang->block->default['doc']['8']['params']['count'] = '20';
|
||||
|
||||
$lang->block->count = 'Count';
|
||||
$lang->block->type = 'Type';
|
||||
$lang->block->orderBy = 'Order by';
|
||||
@@ -458,7 +462,7 @@ $lang->block->modules['doc']->availableBlocks->docdynamic = 'Dynamic';
|
||||
$lang->block->modules['doc']->availableBlocks->mycollection = 'My Collection';
|
||||
$lang->block->modules['doc']->availableBlocks->recentupdate = 'Recently Update';
|
||||
$lang->block->modules['doc']->availableBlocks->viewlist = 'Browse Leaderboard';
|
||||
$lang->block->modules['doc']->availableBlocks->productdoc = $lang->productCommon . 'Document';
|
||||
if($config->vision == 'rnd') $lang->block->modules['doc']->availableBlocks->productdoc = $lang->productCommon . 'Document';
|
||||
$lang->block->modules['doc']->availableBlocks->collectlist = 'Favorite Leaderboard';
|
||||
$lang->block->modules['doc']->availableBlocks->projectdoc = $lang->projectCommon . 'Document';
|
||||
|
||||
|
||||
@@ -355,19 +355,23 @@ $lang->block->default['doc']['5']['grid'] = 4;
|
||||
|
||||
if($config->vision == 'rnd')
|
||||
{
|
||||
$lang->block->default['doc']['6']['title'] = $lang->productCommon . 'Document';
|
||||
$lang->block->default['doc']['6']['title'] = $lang->productCommon . ' Document';
|
||||
$lang->block->default['doc']['6']['block'] = 'productdoc';
|
||||
$lang->block->default['doc']['6']['grid'] = 8;
|
||||
|
||||
$lang->block->default['doc']['6']['params']['count'] = '20';
|
||||
}
|
||||
|
||||
$lang->block->default['doc']['7']['title'] = 'Favorite Leaderboard';
|
||||
$lang->block->default['doc']['7']['block'] = 'doccollectlist';
|
||||
$lang->block->default['doc']['7']['grid'] = 4;
|
||||
|
||||
$lang->block->default['doc']['8']['title'] = $lang->projectCommon . 'Document';
|
||||
$lang->block->default['doc']['8']['title'] = $lang->projectCommon . ' Document';
|
||||
$lang->block->default['doc']['8']['block'] = 'projectdoc';
|
||||
$lang->block->default['doc']['8']['grid'] = 8;
|
||||
|
||||
$lang->block->default['doc']['8']['params']['count'] = '20';
|
||||
|
||||
$lang->block->count = 'Count';
|
||||
$lang->block->type = 'Type';
|
||||
$lang->block->orderBy = 'Order by';
|
||||
@@ -458,7 +462,7 @@ $lang->block->modules['doc']->availableBlocks->docdynamic = 'Dynamic';
|
||||
$lang->block->modules['doc']->availableBlocks->docmycollection = 'My Collection';
|
||||
$lang->block->modules['doc']->availableBlocks->docrecentupdate = 'Recently Update';
|
||||
$lang->block->modules['doc']->availableBlocks->docviewlist = 'Browse Leaderboard';
|
||||
$lang->block->modules['doc']->availableBlocks->productdoc = $lang->productCommon . 'Document';
|
||||
if($config->vision == 'rnd')$lang->block->modules['doc']->availableBlocks->productdoc = $lang->productCommon . 'Document';
|
||||
$lang->block->modules['doc']->availableBlocks->doccollectlist = 'Favorite Leaderboard';
|
||||
$lang->block->modules['doc']->availableBlocks->projectdoc = $lang->projectCommon . 'Document';
|
||||
|
||||
|
||||
@@ -355,19 +355,23 @@ $lang->block->default['doc']['5']['grid'] = 4;
|
||||
|
||||
if($config->vision == 'rnd')
|
||||
{
|
||||
$lang->block->default['doc']['6']['title'] = $lang->productCommon . 'Document';
|
||||
$lang->block->default['doc']['6']['title'] = $lang->productCommon . ' Document';
|
||||
$lang->block->default['doc']['6']['block'] = 'productdoc';
|
||||
$lang->block->default['doc']['6']['grid'] = 8;
|
||||
|
||||
$lang->block->default['doc']['6']['params']['count'] = '20';
|
||||
}
|
||||
|
||||
$lang->block->default['doc']['7']['title'] = 'Favorite Leaderboard';
|
||||
$lang->block->default['doc']['7']['block'] = 'doccollectlist';
|
||||
$lang->block->default['doc']['7']['grid'] = 4;
|
||||
|
||||
$lang->block->default['doc']['8']['title'] = $lang->projectCommon . 'Document';
|
||||
$lang->block->default['doc']['8']['title'] = $lang->projectCommon . ' Document';
|
||||
$lang->block->default['doc']['8']['block'] = 'projectdoc';
|
||||
$lang->block->default['doc']['8']['grid'] = 8;
|
||||
|
||||
$lang->block->default['doc']['8']['params']['count'] = '20';
|
||||
|
||||
$lang->block->count = 'Numéro';
|
||||
$lang->block->type = 'Type';
|
||||
$lang->block->orderBy = 'Trié par';
|
||||
@@ -458,7 +462,7 @@ $lang->block->modules['doc']->availableBlocks->docdynamic = 'Dynamic';
|
||||
$lang->block->modules['doc']->availableBlocks->docmycollection = 'My Collection';
|
||||
$lang->block->modules['doc']->availableBlocks->docrecentupdate = 'Recently Update';
|
||||
$lang->block->modules['doc']->availableBlocks->docviewlist = 'Browse Leaderboard';
|
||||
$lang->block->modules['doc']->availableBlocks->productdoc = $lang->productCommon . 'Document';
|
||||
if($config->vision == 'rnd') $lang->block->modules['doc']->availableBlocks->productdoc = $lang->productCommon . 'Document';
|
||||
$lang->block->modules['doc']->availableBlocks->doccollectlist = 'Favorite Leaderboard';
|
||||
$lang->block->modules['doc']->availableBlocks->projectdoc = $lang->projectCommon . 'Document';
|
||||
|
||||
|
||||
@@ -358,6 +358,8 @@ if($config->vision == 'rnd')
|
||||
$lang->block->default['doc']['6']['title'] = $lang->productCommon . '文档';
|
||||
$lang->block->default['doc']['6']['block'] = 'productdoc';
|
||||
$lang->block->default['doc']['6']['grid'] = 8;
|
||||
|
||||
$lang->block->default['doc']['6']['params']['count'] = '20';
|
||||
}
|
||||
|
||||
$lang->block->default['doc']['7']['title'] = '收藏排行榜';
|
||||
@@ -368,6 +370,8 @@ $lang->block->default['doc']['8']['title'] = $lang->projectCommon . '文档';
|
||||
$lang->block->default['doc']['8']['block'] = 'projectdoc';
|
||||
$lang->block->default['doc']['8']['grid'] = 8;
|
||||
|
||||
$lang->block->default['doc']['8']['params']['count'] = '20';
|
||||
|
||||
$lang->block->count = '数量';
|
||||
$lang->block->type = '类型';
|
||||
$lang->block->orderBy = '排序';
|
||||
@@ -458,7 +462,7 @@ $lang->block->modules['doc']->availableBlocks->docdynamic = '文档动态';
|
||||
$lang->block->modules['doc']->availableBlocks->docmycollection = '我的收藏';
|
||||
$lang->block->modules['doc']->availableBlocks->docrecentupdate = '最近更新';
|
||||
$lang->block->modules['doc']->availableBlocks->docviewlist = '浏览排行榜';
|
||||
$lang->block->modules['doc']->availableBlocks->productdoc = $lang->productCommon . '文档';
|
||||
if($config->vision == 'rnd') $lang->block->modules['doc']->availableBlocks->productdoc = $lang->productCommon . '文档';
|
||||
$lang->block->modules['doc']->availableBlocks->doccollectlist = '收藏排行榜';
|
||||
$lang->block->modules['doc']->availableBlocks->projectdoc = $lang->projectCommon . '文档';
|
||||
|
||||
|
||||
@@ -1125,7 +1125,8 @@ class blockModel extends model
|
||||
*/
|
||||
public function getProductDocParams()
|
||||
{
|
||||
return false;
|
||||
$params = $this->appendCountParams();
|
||||
return json_encode($params);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1147,7 +1148,8 @@ class blockModel extends model
|
||||
*/
|
||||
public function getProjectDocParams()
|
||||
{
|
||||
return false;
|
||||
$params = $this->appendCountParams();
|
||||
return json_encode($params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* The doccollectlistblock view file of block module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
|
||||
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Shujie Tian <tianshujie@easycorp.ltd>
|
||||
* @package block
|
||||
* @version $Id$
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<style>
|
||||
.block-doccollectlist .panel-body {padding-top: 0px;}
|
||||
.block-doccollectlist .doc-list > .doc-title {display: flex; overflow: hidden; text-overflow: clip; white-space: nowrap; padding: 8px 0;}
|
||||
.block-doccollectlist .doc-list > .doc-title > .label-rank {margin-right: 10px; padding-top: 1px; border: unset; color: #2E7FFF; background-color: #D5E5FF;}
|
||||
.block-doccollectlist .doc-list > .doc-title > .label-rank-1 {color: #FC5959; background-color: #FFE2D9;}
|
||||
.block-doccollectlist .doc-list > .doc-title > .label-rank-2 {color: #FF8058; background-color: #FFE2D9;}
|
||||
.block-doccollectlist .doc-list > .doc-title > .label-rank-3 {color: #FF9F46; background-color: #FFECDB;}
|
||||
.block-doccollectlist .doc-list > .doc-title > .doc-name {overflow: hidden; max-width: calc(100% - 130px);}
|
||||
[lang^=zh] .block-doccollectlist .doc-list > .doc-title > .doc-name {max-width: calc(100% - 110px);}
|
||||
.block-doccollectlist .doc-list > .doc-title > .label-collect-count {margin-left: 10px;}
|
||||
.block-doccollectlist .doc-list > .doc-title > .label-collect-count > .icon-flame {margin-bottom: 3px;}
|
||||
.block-doccollectlist .doc-list > .doc-title > .label-collect-count > .icon-flame.gray {filter: grayscale(100%);}
|
||||
.block-doccollectlist .doc-list > .doc-title > .label-collect-count > .view-text {color: #838A9D;}
|
||||
</style>
|
||||
<div class="panel-body">
|
||||
<?php if(empty($docList)):?>
|
||||
<div class='table-empty-tip'><p><span class='text-muted'><?php echo $lang->doc->noDoc;?></p></span></div>
|
||||
<?php else:?>
|
||||
<div class="doc-list table-row">
|
||||
<?php $rank = 1;?>
|
||||
<?php foreach($docList as $doc):?>
|
||||
<div class='doc-title'>
|
||||
<span class="label-pri label-rank label-rank-<?php echo $rank;?>"><?php echo $rank;?></span>
|
||||
<?php
|
||||
if(common::hasPriv('doc', 'view'))
|
||||
{
|
||||
echo html::a($this->createLink('doc', 'view', "docID=$doc->id"), $doc->title, '', "title='{$doc->title}' class='doc-name' data-app='{$this->app->tab}'");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<span class='doc-name' title='{$doc->title}'>{$doc->title}</span>";
|
||||
}
|
||||
?>
|
||||
<div class='label-collect-count'>
|
||||
<?php $flameClass = $rank < 4 ? '' : 'gray';?>
|
||||
<?php echo html::image("static/svg/flame.svg", "class='icon-flame $flameClass'");?>
|
||||
<span class='view-text'><?php echo sprintf($lang->doc->collectCount, $doc->collects);?></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php $rank ++;?>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
.block-docmycollection .doc-list > .doc-box > .btn.no-priv p {pointer-events: none;}
|
||||
.block-docmycollection .doc-list > .doc-box .date-interval {float: right; padding: 8px 0 8px 12px;}
|
||||
.block-docmycollection .doc-list > .doc-box > .btn > h4 {padding-right: 5px;}
|
||||
.block-docmycollection .doc-list > .doc-box .file-icon {margin-right: 2px; width: 14px;}
|
||||
.block-docmycollection .doc-list > .doc-box .file-icon {margin-right: 2px; margin-bottom: 2px;}
|
||||
.block-docmycollection .doc-list > .doc-box .plug-title {height: 16px; overflow: hidden;}
|
||||
|
||||
.block-docmycollection.block-sm .doc-list > .doc-box {flex: 0 1 100%;}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
.block-docrecentupdate .doc-list > .doc-box > .btn.no-priv p {pointer-events: none;}
|
||||
.block-docrecentupdate .doc-list > .doc-box .date-interval {float: right; padding: 8px 0 8px 12px;}
|
||||
.block-docrecentupdate .doc-list > .doc-box > .btn > h4 {padding-right: 5px;}
|
||||
.block-docrecentupdate .doc-list > .doc-box .file-icon {margin-right: 2px; width: 14px;}
|
||||
.block-docrecentupdate .doc-list > .doc-box .file-icon {margin-right: 2px; margin-bottom: 2px;}
|
||||
.block-docrecentupdate .doc-list > .doc-box .plug-title {height: 16px; overflow: hidden;}
|
||||
|
||||
.block-docrecentupdate.block-sm .doc-list > .doc-box {flex: 0 1 100%;}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* The docviewlistblock view file of block module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
|
||||
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Shujie Tian <tianshujie@easycorp.ltd>
|
||||
* @package block
|
||||
* @version $Id$
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<style>
|
||||
.block-docviewlist .panel-body {padding-top: 0px;}
|
||||
.block-docviewlist .doc-list > .doc-title {display: flex; overflow: hidden; text-overflow: clip; white-space: nowrap; padding: 8px 0;}
|
||||
.block-docviewlist .doc-list > .doc-title > .label-rank {margin-right: 10px; padding-top: 1px; border: unset; color: #2E7FFF; background-color: #D5E5FF;}
|
||||
.block-docviewlist .doc-list > .doc-title > .label-rank-1 {color: #FC5959; background-color: #FFE2D9;}
|
||||
.block-docviewlist .doc-list > .doc-title > .label-rank-2 {color: #FF8058; background-color: #FFE2D9;}
|
||||
.block-docviewlist .doc-list > .doc-title > .label-rank-3 {color: #FF9F46; background-color: #FFECDB;}
|
||||
.block-docviewlist .doc-list > .doc-title > .doc-name {overflow: hidden; max-width: calc(100% - 110px);}
|
||||
.block-docviewlist .doc-list > .doc-title > .label-view-count {margin-left: 10px;}
|
||||
.block-docviewlist .doc-list > .doc-title > .label-view-count > .icon-flame {margin-bottom: 3px;}
|
||||
.block-docviewlist .doc-list > .doc-title > .label-view-count > .icon-flame.gray {filter: grayscale(100%);}
|
||||
.block-docviewlist .doc-list > .doc-title > .label-view-count > .view-text {color: #838A9D;}
|
||||
</style>
|
||||
<div class="panel-body">
|
||||
<?php if(empty($docList)):?>
|
||||
<div class='table-empty-tip'><p><span class='text-muted'><?php echo $lang->doc->noDoc;?></p></span></div>
|
||||
<?php else:?>
|
||||
<div class="doc-list table-row">
|
||||
<?php $rank = 1;?>
|
||||
<?php foreach($docList as $doc):?>
|
||||
<div class='doc-title'>
|
||||
<span class="label-pri label-rank label-rank-<?php echo $rank;?>"><?php echo $rank;?></span>
|
||||
<?php
|
||||
if(common::hasPriv('doc', 'view'))
|
||||
{
|
||||
echo html::a($this->createLink('doc', 'view', "docID=$doc->id"), $doc->title, '', "title='{$doc->title}' class='doc-name' data-app='{$this->app->tab}'");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<span class='doc-name' title='{$doc->title}'>{$doc->title}</span>";
|
||||
}
|
||||
?>
|
||||
<div class='label-view-count'>
|
||||
<?php $flameClass = $rank < 4 ? '' : 'gray';?>
|
||||
<?php echo html::image("static/svg/flame.svg", "class='icon-flame $flameClass'");?>
|
||||
<span class='view-text'><?php echo sprintf($lang->doc->viewCount, $doc->views);?></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php $rank ++;?>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,195 @@
|
||||
<style>
|
||||
.block-productdoc .nav-stacked {overflow:auto; height:220px; max-height:220px; }
|
||||
.block-productdoc .panel-heading {border-bottom:1px solid #ddd;}
|
||||
.block-productdoc .panel-body {padding-top: 0; height:240px; padding-right:0px; padding-bottom:0px;}
|
||||
.block-productdoc .tab-content {padding-right:0px;}
|
||||
.block-productdoc .tab-pane {max-height:220px; overflow:auto;}
|
||||
.block-productdoc table.tablesorter th{border-bottom:0px !important;}
|
||||
.block-productdoc .tile {margin-bottom: 30px;}
|
||||
.block-productdoc .tile-title {font-size: 18px; color: #A6AAB8;}
|
||||
.block-productdoc .tile-amount {font-size: 48px; margin-bottom: 10px;}
|
||||
.block-productdoc .col-nav {border-right: 1px solid #EBF2FB; width: 210px; padding: 5px 0 0 0; }
|
||||
.block-productdoc .nav-secondary > li {position: relative;}
|
||||
.block-productdoc .nav-secondary > li > a {font-size: 14px; color: #838A9D; position: relative; box-shadow: none; padding-left: 20px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; transition: all .2s;}
|
||||
.block-productdoc .nav-secondary > li > a:first-child {padding-right: 36px;}
|
||||
.block-productdoc .nav-secondary > li.active > a:first-child {color: #3C4353; box-shadow: none;}
|
||||
.block-productdoc .nav-secondary > li.active > a:first-child:hover,
|
||||
.block-productdoc .nav-secondary > li.active > a:first-child:focus,
|
||||
.block-productdoc .nav-secondary > li > a:first-child:hover {box-shadow: none; border-radius: 4px 0 0 4px;}
|
||||
.block-productdoc .nav-secondary > li.active > a:first-child:before {content: ' '; display: block; left: -1px; top: 10px; bottom: 10px; width: 4px; background: #006af1; position: absolute;}
|
||||
.block-productdoc .nav-secondary > li > a.btn-view {position: absolute; top: 0; right: 0; bottom: 0; padding: 8px; width: 36px; text-align: center; opacity: 0;}
|
||||
.block-productdoc .nav-secondary > li:hover > a.btn-view {opacity: 1;}
|
||||
.block-productdoc .nav-secondary > li.active > a.btn-view {box-shadow: none;}
|
||||
.block-productdoc .nav-secondary > li.switch-icon {display: none;}
|
||||
.block-productdoc.block-sm .nav-stacked {height:auto;}
|
||||
.block-productdoc.block-sm .panel-body {position: relative; border-radius: 3px; height:275px; padding: 45px 8px 10px 8px}
|
||||
.block-productdoc.block-sm .panel-body > .table-row,
|
||||
.block-productdoc.block-sm .panel-body > .table-row > .col {display: block; width: auto;}
|
||||
.block-productdoc.block-sm .panel-body > .table-row > .tab-content {padding: 0; margin: 0 -5px;}
|
||||
.block-productdoc.block-sm .tab-pane > .table-row > .col-5 {width: 125px;}
|
||||
.block-productdoc.block-sm .tab-pane > .table-row > .col-5 > .table-row {padding: 5px 0;}
|
||||
.block-productdoc.block-sm .col-nav {border-left: none; position: absolute; top: 0; left: 15px; right: 15px; background: #f5f5f5; padding: 0px; margin-top:5px;}
|
||||
.block-productdoc.block-sm .nav-secondary {display: table; width: 100%; padding: 0; table-layout: fixed;}
|
||||
.block-productdoc.block-sm .nav-secondary > li {display: none;}
|
||||
.block-productdoc.block-sm .nav-secondary > li.switch-icon,
|
||||
.block-productdoc.block-sm .nav-secondary > li.active {display: table-cell; width: 100%; text-align: center;}
|
||||
.block-productdoc.block-sm .nav-secondary > li.active > a:hover {cursor: default; background: none;}
|
||||
.block-productdoc.block-sm .nav-secondary > li.switch-icon > a:hover {background: rgba(0, 0, 0, 0.07);}
|
||||
.block-productdoc.block-sm .nav-secondary > li > a {padding: 5px 10px; border-radius: 4px;}
|
||||
.block-productdoc.block-sm .nav-secondary > li > a:before {display: none;}
|
||||
.block-productdoc.block-sm .nav-secondary > li.switch-icon {width: 40px;}
|
||||
.block-productdoc.block-sm .nav-secondary > li.active > a:first-child:before {display: none}
|
||||
.block-productdoc.block-sm .nav-secondary > li.active > a.btn-view {width: auto; left: 0; right: 0;}
|
||||
.block-productdoc.block-sm .nav-secondary > li.active > a.btn-view > i {display: none;}
|
||||
.block-productdoc.block-sm .nav-secondary > li.active > a.btn-view:hover {cursor: pointer; background: rgba(0,0,0,.1);}
|
||||
|
||||
.block-productdoc .data {width: 40%; text-align: left; padding: 10px 0px; font-size: 14px; font-weight: 700;}
|
||||
.block-productdoc .dataTitle {width: 60%; text-align: right; padding: 10px 0px; font-size: 14px;}
|
||||
.block-productdoc .executionName {padding: 2px 10px; font-size: 14px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
|
||||
.block-productdoc .lastIteration {padding-top: 6px;}
|
||||
|
||||
.forty-percent {width: 40%;}
|
||||
html[lang="de"] .block-productdoc .c-user{width: 105px;}
|
||||
|
||||
.block-productdoc #productType {position: absolute;top: 6px;left: 120px;}
|
||||
.block-productdoc #productType .btn {border:0px;}
|
||||
.block-productdoc #productType .btn:hover {background-color:#f5f5f5;}
|
||||
|
||||
.block-productdoc .table .c-name > .doc-title {display: inline-block; overflow: hidden; background: transparent; padding-right:0px;}
|
||||
.block-productdoc .table .c-name > span.doc-title {line-height: 0; vertical-align: inherit;}
|
||||
.block-productdoc .table .c-name[data-status=draft] > .doc-title {max-width: calc(100% - 35px);}
|
||||
.block-productdoc .table .c-name > .draft {background-color:rgba(129, 102, 238, 0.12); color:#8166EE;}
|
||||
</style>
|
||||
<?php $blockNavId = 'nav-' . uniqid(); ?>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
if($('.block-productdoc<?php echo "#block{$block->id}";?> #productType').length > 1);
|
||||
{
|
||||
count = $('.block-productdoc<?php echo "#block{$block->id}";?> #productType').length;
|
||||
$('.block-productdoc<?php echo "#block{$block->id}";?> #productType').each(function()
|
||||
{
|
||||
if(count == 1) return;
|
||||
$(this).remove();
|
||||
count --;
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
function switch<?php echo "block{$block->id}";?>Product(obj)
|
||||
{
|
||||
var $this = $(obj);
|
||||
var $nav = $this.closest('.nav');
|
||||
var isPrev = $this.is('.prev');
|
||||
var $activeItem = $nav.children('.active');
|
||||
var $next = $activeItem[isPrev ? 'prev' : 'next']('li:not(.switch-icon)');
|
||||
if($next.length > 0) $next.find('a[data-toggle="tab"]').trigger('click');
|
||||
if($next.length == 0) $nav.children('li:not(.switch-icon)')[isPrev ? 'last' : 'first']().find('a[data-toggle="tab"]').trigger('click');
|
||||
return false;
|
||||
}
|
||||
|
||||
function change<?php echo "block{$block->id}";?>ProductType(type)
|
||||
{
|
||||
$('.block-productdoc<?php echo "#block{$block->id}";?> .nav.products').toggleClass('hidden', type != 'all');
|
||||
$('.block-productdoc<?php echo "#block{$block->id}";?> .nav.involveds').toggleClass('hidden', type != 'involved');
|
||||
$('.block-productdoc<?php echo "#block{$block->id}";?> #productType .btn').html($('.block-productdoc<?php echo "#block{$block->id}";?> #productType [data-type=' + type + ']').html() + " <span class='caret'></span>");
|
||||
var name = type == 'all' ? '.block-productdoc<?php echo "#block{$block->id}";?> .products' : '.block-productdoc<?php echo "#block{$block->id}";?> .involveds';
|
||||
var $obj = $(name + ' li.active').length > 0 ? $(name + ' .active:first').find('a') : $(name + ' li:not(.switch-icon):first').find('a');
|
||||
$(name + ' li').removeClass('active');
|
||||
$obj.closest('li').addClass('active');
|
||||
$('.block-productdoc<?php echo "#block{$block->id}";?> .tab-pane').removeClass('active').removeClass('in');
|
||||
$('.block-productdoc<?php echo "#block{$block->id}";?> .tab-pane' + $obj.data('target')).addClass('active').addClass('in');
|
||||
|
||||
$('.block-productdoc<?php echo "#block{$block->id}";?> #productType .dropdown-menu li').removeClass('active');
|
||||
$('.block-productdoc<?php echo "#block{$block->id}";?> #productType .dropdown-menu li a[data-type=' + type + ']').closest('li').addClass('active');
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="dropdown" id='productType'>
|
||||
<button class="btn" type="button" data-toggle="dropdown"><?php echo $lang->product->involved;?> <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li class='active'><a href="javascript:change<?php echo "block{$block->id}";?>ProductType('involved')" data-type='involved'><?php echo $lang->product->involved;?></a></li>
|
||||
<li><a href="javascript:change<?php echo "block{$block->id}";?>ProductType('all')" data-type='all'><?php echo $lang->product->all;?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="table-row">
|
||||
<?php if(empty($products) and empty($involveds)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->block->emptyTip;?></span></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class="col col-nav">
|
||||
<ul class="nav nav-stacked nav-secondary scrollbar-hover involveds">
|
||||
<li class='switch-icon prev'><a href='###' onclick='switch<?php echo "block{$block->id}";?>Product(this)'><i class='icon icon-arrow-left'></i></a></li>
|
||||
<?php $selected = key($involveds);?>
|
||||
<?php foreach($involveds as $product):?>
|
||||
<li <?php if($product->id == $selected) echo "class='active' id='activeProduct'";?> productid='<?php echo $product->id;?>'>
|
||||
<a href="###" title="<?php echo $product->name?>" data-target='<?php echo "#tab3{$blockNavId}Content{$product->id}";?>' data-toggle="tab"><?php echo $product->name;?></a>
|
||||
<?php echo html::a(helper::createLink('doc', 'productSpace', "productID=$product->id"), "<i class='icon-arrow-right text-primary'></i>", '', "class='btn-view'");?>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
<li class='switch-icon next'><a href='###' onclick='switch<?php echo "block{$block->id}";?>Product(this)'><i class='icon icon-arrow-right'></i></a></li>
|
||||
</ul>
|
||||
<ul class="nav nav-stacked nav-secondary scrollbar-hover products hidden">
|
||||
<li class='switch-icon prev'><a href='###' onclick='switch<?php echo "block{$block->id}";?>Product(this)'><i class='icon icon-arrow-left'></i></a></li>
|
||||
<?php foreach($products as $product):?>
|
||||
<li productid='<?php echo $product->id;?>'>
|
||||
<a href="###" title="<?php echo $product->name?>" data-target='<?php echo "#tab3{$blockNavId}Content{$product->id}";?>' data-toggle="tab"><?php echo $product->name;?></a>
|
||||
<?php echo html::a(helper::createLink('doc', 'productSpace', "productID=$product->id"), "<i class='icon-arrow-right text-primary'></i>", '', "class='btn-view'");?>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
<li class='switch-icon next'><a href='###' onclick='switch<?php echo "block{$block->id}";?>Product(this)'><i class='icon icon-arrow-right'></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col tab-content">
|
||||
<?php foreach($products as $product):?>
|
||||
<div class="tab-pane fade<?php if($product->id == $selected) echo ' active in';?>" id='<?php echo "tab3{$blockNavId}Content{$product->id}";?>'>
|
||||
<?php if(isset($docGroup[$product->id])):?>
|
||||
<div class="table-row">
|
||||
<table class='table table-borderless table-hover table-fixed table-fixed-head tablesorter'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='c-name'><?php echo $lang->doc->title?></th>
|
||||
<th class='c-user'><?php echo $lang->doc->addedBy?></th>
|
||||
<th class='c-date'><?php echo $lang->doc->addedDate?></th>
|
||||
<th class='c-date'><?php echo $lang->doc->editedDate?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($docGroup[$product->id] as $doc):?>
|
||||
<tr>
|
||||
<td class='c-name' data-status='<?php echo $doc->status?>'>
|
||||
<?php
|
||||
$docType = zget($config->doc->iconList, $doc->type);
|
||||
$icon = html::image("static/svg/{$docType}.svg", "class='file-icon'");
|
||||
if(common::hasPriv('doc', 'view'))
|
||||
{
|
||||
echo html::a($this->createLink('doc', 'view', "docID=$doc->id"), $icon . $doc->title, '', "title='{$doc->title}' class='doc-title' data-app='{$this->app->tab}'");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<span class='doc-title' title='{$doc->title}'>$icon {$doc->title}</span>";
|
||||
}
|
||||
if($doc->status == 'draft') echo "<span class='label label-badge draft'>{$lang->doc->draft}</span>";
|
||||
?>
|
||||
</td>
|
||||
<td class='c-user'><?php echo zget($users, $doc->addedBy);?></td>
|
||||
<td class='c-date'><?php echo substr($doc->addedDate, 0, 10);?></td>
|
||||
<td class='c-date'><?php echo substr($doc->editedDate, 0, 10);?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->block->emptyTip;?></span></p>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,195 @@
|
||||
<style>
|
||||
.block-projectdoc .nav-stacked {overflow:auto; height:220px; max-height:220px; }
|
||||
.block-projectdoc .panel-heading {border-bottom:1px solid #ddd;}
|
||||
.block-projectdoc .panel-body {padding-top: 0; height:240px; padding-right:0px; padding-bottom:0px;}
|
||||
.block-projectdoc .tab-content {padding-right:0px;}
|
||||
.block-projectdoc .tab-pane {max-height:220px; overflow:auto;}
|
||||
.block-projectdoc table.tablesorter th{border-bottom:0px !important;}
|
||||
.block-projectdoc .tile {margin-bottom: 30px;}
|
||||
.block-projectdoc .tile-title {font-size: 18px; color: #A6AAB8;}
|
||||
.block-projectdoc .tile-amount {font-size: 48px; margin-bottom: 10px;}
|
||||
.block-projectdoc .col-nav {border-right: 1px solid #EBF2FB; width: 210px; padding: 8px 0 0 0;}
|
||||
.block-projectdoc .nav-secondary > li {position: relative;}
|
||||
.block-projectdoc .nav-secondary > li > a {font-size: 14px; color: #838A9D; position: relative; box-shadow: none; padding-left: 20px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; transition: all .2s;}
|
||||
.block-projectdoc .nav-secondary > li > a:first-child {padding-right: 36px;}
|
||||
.block-projectdoc .nav-secondary > li.active > a:first-child {color: #3C4353; box-shadow: none;}
|
||||
.block-projectdoc .nav-secondary > li.active > a:first-child:hover,
|
||||
.block-projectdoc .nav-secondary > li.active > a:first-child:focus,
|
||||
.block-projectdoc .nav-secondary > li > a:first-child:hover {box-shadow: none; border-radius: 4px 0 0 4px;}
|
||||
.block-projectdoc .nav-secondary > li.active > a:first-child:before {content: ' '; display: block; left: -1px; top: 10px; bottom: 10px; width: 4px; background: #006af1; position: absolute;}
|
||||
.block-projectdoc .nav-secondary > li > a.btn-view {position: absolute; top: 0; right: 0; bottom: 0; padding: 8px; width: 36px; text-align: center; opacity: 0;}
|
||||
.block-projectdoc .nav-secondary > li:hover > a.btn-view {opacity: 1;}
|
||||
.block-projectdoc .nav-secondary > li.active > a.btn-view {box-shadow: none;}
|
||||
.block-projectdoc .nav-secondary > li.switch-icon {display: none;}
|
||||
.block-projectdoc.block-sm .nav-stacked {height:auto;}
|
||||
.block-projectdoc.block-sm .panel-body {padding: 45px 8px 10px 8px; position: relative; border-radius: 3px; height:275px;}
|
||||
.block-projectdoc.block-sm .panel-body > .table-row,
|
||||
.block-projectdoc.block-sm .panel-body > .table-row > .col {display: block; width: auto;}
|
||||
.block-projectdoc.block-sm .panel-body > .table-row > .tab-content {padding: 0; margin: 0 -5px;}
|
||||
.block-projectdoc.block-sm .tab-pane > .table-row > .col-5 {width: 125px;}
|
||||
.block-projectdoc.block-sm .tab-pane > .table-row > .col-5 > .table-row {padding: 5px 0;}
|
||||
.block-projectdoc.block-sm .col-nav {border-left: none; position: absolute; top: 0; left: 15px; right: 15px; background: #f5f5f5; padding:0px; margin-top:5px;}
|
||||
.block-projectdoc.block-sm .nav-secondary {display: table; width: 100%; padding: 0; table-layout: fixed;}
|
||||
.block-projectdoc.block-sm .nav-secondary > li {display: none;}
|
||||
.block-projectdoc.block-sm .nav-secondary > li.switch-icon,
|
||||
.block-projectdoc.block-sm .nav-secondary > li.active {display: table-cell; width: 100%; text-align: center;}
|
||||
.block-projectdoc.block-sm .nav-secondary > li.active > a:hover {cursor: default; background: none;}
|
||||
.block-projectdoc.block-sm .nav-secondary > li.switch-icon > a:hover {background: rgba(0, 0, 0, 0.07);}
|
||||
.block-projectdoc.block-sm .nav-secondary > li > a {padding: 5px 10px; border-radius: 4px;}
|
||||
.block-projectdoc.block-sm .nav-secondary > li > a:before {display: none;}
|
||||
.block-projectdoc.block-sm .nav-secondary > li.switch-icon {width: 40px;}
|
||||
.block-projectdoc.block-sm .nav-secondary > li.active > a:first-child:before {display: none}
|
||||
.block-projectdoc.block-sm .nav-secondary > li.active > a.btn-view {width: auto; left: 0; right: 0;}
|
||||
.block-projectdoc.block-sm .nav-secondary > li.active > a.btn-view > i {display: none;}
|
||||
.block-projectdoc.block-sm .nav-secondary > li.active > a.btn-view:hover {cursor: pointer; background: rgba(0,0,0,.1);}
|
||||
|
||||
.block-projectdoc .data {width: 40%; text-align: left; padding: 10px 0px; font-size: 14px; font-weight: 700;}
|
||||
.block-projectdoc .dataTitle {width: 60%; text-align: right; padding: 10px 0px; font-size: 14px;}
|
||||
.block-projectdoc .executionName {padding: 2px 10px; font-size: 14px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
|
||||
.block-projectdoc .lastIteration {padding-top: 6px;}
|
||||
|
||||
.forty-percent {width: 40%;}
|
||||
html[lang="de"] .block-projectdoc .c-user{width: 105px;}
|
||||
|
||||
.block-projectdoc #projectType {position: absolute;top: 6px;left: 120px;}
|
||||
.block-projectdoc #projectType .btn {border:0px;}
|
||||
.block-projectdoc #projectType .btn:hover {background-color:#f5f5f5;}
|
||||
|
||||
.block-projectdoc .table .c-name > .doc-title {display: inline-block; overflow: hidden; background: transparent; padding-right:0px;}
|
||||
.block-projectdoc .table .c-name > span.doc-title {line-height: 0; vertical-align: inherit;}
|
||||
.block-projectdoc .table .c-name[data-status=draft] > .doc-title {max-width: calc(100% - 35px);}
|
||||
.block-projectdoc .table .c-name > .draft {background-color:rgba(129, 102, 238, 0.12); color:#8166EE;}
|
||||
</style>
|
||||
<script>
|
||||
<?php $blockNavId = 'nav-' . uniqid(); ?>
|
||||
$(function()
|
||||
{
|
||||
if($('.block-projectdoc<?php echo "#block{$block->id}";?> #projectType').length > 1);
|
||||
{
|
||||
count = $('.block-projectdoc<?php echo "#block{$block->id}";?> #projectType').length;
|
||||
$('.block-projectdoc<?php echo "#block{$block->id}";?> #projectType').each(function()
|
||||
{
|
||||
if(count == 1) return;
|
||||
$(this).remove();
|
||||
count --;
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
function switch<?php echo "block{$block->id}";?>Project(obj)
|
||||
{
|
||||
var $this = $(obj);
|
||||
var $nav = $this.closest('.nav');
|
||||
var isPrev = $this.is('.prev');
|
||||
var $activeItem = $nav.children('.active');
|
||||
var $next = $activeItem[isPrev ? 'prev' : 'next']('li:not(.switch-icon)');
|
||||
if($next.length > 0) $next.find('a[data-toggle="tab"]').trigger('click');
|
||||
if($next.length == 0) $nav.children('li:not(.switch-icon)')[isPrev ? 'last' : 'first']().find('a[data-toggle="tab"]').trigger('click');
|
||||
return false;
|
||||
}
|
||||
|
||||
function change<?php echo "block{$block->id}";?>ProjectType(type)
|
||||
{
|
||||
$('.block-projectdoc<?php echo "#block{$block->id}";?> .nav.projects').toggleClass('hidden', type != 'all');
|
||||
$('.block-projectdoc<?php echo "#block{$block->id}";?> .nav.involveds').toggleClass('hidden', type != 'involved');
|
||||
$('.block-projectdoc<?php echo "#block{$block->id}";?> #projectType .btn').html($('.block-projectdoc<?php echo "#block{$block->id}";?> #projectType [data-type=' + type + ']').html() + " <span class='caret'></span>");
|
||||
var name = type == 'all' ? '.block-projectdoc<?php echo "#block{$block->id}";?> .projects' : '.block-projectdoc<?php echo "#block{$block->id}";?> .involveds';
|
||||
var $obj = $(name + ' li.active').length > 0 ? $(name + ' .active:first').find('a') : $(name + ' li:not(.switch-icon):first').find('a');
|
||||
$(name + ' li').removeClass('active');
|
||||
$obj.closest('li').addClass('active');
|
||||
$('.block-projectdoc<?php echo "#block{$block->id}";?> .tab-pane').removeClass('active').removeClass('in');
|
||||
$('.block-projectdoc<?php echo "#block{$block->id}";?> .tab-pane' + $obj.data('target')).addClass('active').addClass('in');
|
||||
|
||||
$('.block-projectdoc<?php echo "#block{$block->id}";?> #projectType .dropdown-menu li').removeClass('active');
|
||||
$('.block-projectdoc<?php echo "#block{$block->id}";?> #projectType .dropdown-menu li a[data-type=' + type + ']').closest('li').addClass('active');
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="dropdown" id='projectType'>
|
||||
<button class="btn" type="button" data-toggle="dropdown"><?php echo $lang->project->involved;?> <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li class='active'><a href="javascript:change<?php echo "block{$block->id}";?>ProjectType('involved')" data-type='involved'><?php echo $lang->project->involved;?></a></li>
|
||||
<li><a href="javascript:change<?php echo "block{$block->id}";?>ProjectType('all')" data-type='all'><?php echo $lang->project->all;?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="table-row">
|
||||
<?php if(empty($projects) and empty($involveds)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->block->emptyTip;?></span></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class="col col-nav">
|
||||
<ul class="nav nav-stacked nav-secondary scrollbar-hover involveds">
|
||||
<li class='switch-icon prev'><a href='###' onclick='switch<?php echo "block{$block->id}";?>Project(this)'><i class='icon icon-arrow-left'></i></a></li>
|
||||
<?php $selected = key($involveds);?>
|
||||
<?php foreach($involveds as $project):?>
|
||||
<li <?php if($project->id == $selected) echo "class='active' id='activeProject'";?> projectid='<?php echo $project->id;?>'>
|
||||
<a href="###" title="<?php echo $project->name?>" data-target='<?php echo "#tab3{$blockNavId}Content{$project->id}";?>' data-toggle="tab"><?php echo $project->name;?></a>
|
||||
<?php echo html::a(helper::createLink('doc', 'projectSpace', "projectID=$project->id"), "<i class='icon-arrow-right text-primary'></i>", '', "class='btn-view'");?>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
<li class='switch-icon next'><a href='###' onclick='switch<?php echo "block{$block->id}";?>Project(this)'><i class='icon icon-arrow-right'></i></a></li>
|
||||
</ul>
|
||||
<ul class="nav nav-stacked nav-secondary scrollbar-hover projects hidden">
|
||||
<li class='switch-icon prev'><a href='###' onclick='switch<?php echo "block{$block->id}";?>Project(this)'><i class='icon icon-arrow-left'></i></a></li>
|
||||
<?php foreach($projects as $project):?>
|
||||
<li projectid='<?php echo $project->id;?>'>
|
||||
<a href="###" title="<?php echo $project->name?>" data-target='<?php echo "#tab3{$blockNavId}Content{$project->id}";?>' data-toggle="tab"><?php echo $project->name;?></a>
|
||||
<?php echo html::a(helper::createLink('doc', 'projectSpace', "projectID=$project->id"), "<i class='icon-arrow-right text-primary'></i>", '', "class='btn-view'");?>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
<li class='switch-icon next'><a href='###' onclick='switch<?php echo "block{$block->id}";?>Project(this)'><i class='icon icon-arrow-right'></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col tab-content">
|
||||
<?php foreach($projects as $project):?>
|
||||
<div class="tab-pane fade<?php if($project->id == $selected) echo ' active in';?>" id='<?php echo "tab3{$blockNavId}Content{$project->id}";?>'>
|
||||
<?php if(isset($docGroup[$project->id])):?>
|
||||
<div class="table-row">
|
||||
<table class='table table-borderless table-hover table-fixed table-fixed-head tablesorter'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='c-name'><?php echo $lang->doc->title?></th>
|
||||
<th class='c-user'><?php echo $lang->doc->addedBy?></th>
|
||||
<th class='c-date'><?php echo $lang->doc->addedDate?></th>
|
||||
<th class='c-date'><?php echo $lang->doc->editedDate?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($docGroup[$project->id] as $doc):?>
|
||||
<tr>
|
||||
<td class='c-name' data-status='<?php echo $doc->status?>'>
|
||||
<?php
|
||||
$docType = zget($config->doc->iconList, $doc->type);
|
||||
$icon = html::image("static/svg/{$docType}.svg", "class='file-icon'");
|
||||
if(common::hasPriv('doc', 'view'))
|
||||
{
|
||||
echo html::a($this->createLink('doc', 'view', "docID=$doc->id"), $icon . $doc->title, '', "title='{$doc->title}' class='doc-title' data-app='{$this->app->tab}'");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<span class='doc-title' title='{$doc->title}'>$icon {$doc->title}</span>";
|
||||
}
|
||||
if($doc->status == 'draft') echo "<span class='label label-badge draft'>{$lang->doc->draft}</span>";
|
||||
?>
|
||||
</td>
|
||||
<td class='c-user'><?php echo zget($users, $doc->addedBy);?></td>
|
||||
<td class='c-date'><?php echo substr($doc->addedDate, 0, 10);?></td>
|
||||
<td class='c-date'><?php echo substr($doc->editedDate, 0, 10);?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->block->emptyTip;?></span></p>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -60,14 +60,14 @@ class bug extends control
|
||||
else
|
||||
{
|
||||
$mode = ($this->app->methodName == 'create' and empty($this->config->CRProduct)) ? 'noclosed' : '';
|
||||
$products = $this->product->getPairs($mode, 0, 'program_asc', 'all');
|
||||
$products = $this->product->getPairs($mode, 0, '', 'all');
|
||||
}
|
||||
if(empty($products) and !helper::isAjaxRequest()) return print($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$tab&activeMenu=bug&objectID=$objectID")));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mode = (empty($this->config->CRProduct)) ? 'noclosed' : '';
|
||||
$products = $this->product->getPairs($mode, 0, 'program_asc', 'all');
|
||||
$products = $this->product->getPairs($mode, 0, '', 'all');
|
||||
}
|
||||
$this->view->products = $this->products = $products;
|
||||
}
|
||||
@@ -581,7 +581,7 @@ class bug extends control
|
||||
if(empty($moduleOptionMenu)) return print(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story")));
|
||||
|
||||
/* Get products and projects. */
|
||||
$products = $this->config->CRProduct ? $this->products : $this->product->getPairs('noclosed', 0, 'program_asc', 'all');
|
||||
$products = $this->config->CRProduct ? $this->products : $this->product->getPairs('noclosed', 0, '', 'all');
|
||||
$projects = array(0 => '');
|
||||
if($executionID)
|
||||
{
|
||||
|
||||
@@ -827,6 +827,7 @@ class bugModel extends model
|
||||
/* Process the data if the value is 'ditto'. */
|
||||
foreach($bugIDList as $bugID)
|
||||
{
|
||||
if(!isset($data->assignedTos[$bugID])) $data->assignedTos[$bugID] = 'closed';
|
||||
if($data->types[$bugID] == 'ditto') $data->types[$bugID] = isset($prev['type']) ? $prev['type'] : '';
|
||||
if($data->severities[$bugID] == 'ditto') $data->severities[$bugID] = isset($prev['severity']) ? $prev['severity'] : 3;
|
||||
if($data->pris[$bugID] == 'ditto') $data->pris[$bugID] = isset($prev['pri']) ? $prev['pri'] : 0;
|
||||
@@ -869,7 +870,7 @@ class bugModel extends model
|
||||
$bug->plan = empty($data->plans[$bugID]) ? 0 : $data->plans[$bugID];
|
||||
$bug->branch = empty($data->branches[$bugID]) ? 0 : $data->branches[$bugID];
|
||||
$bug->module = $data->modules[$bugID];
|
||||
$bug->assignedTo = $bug->status == 'closed' ? $oldBug->assignedTo : $data->assignedTos[$bugID];
|
||||
$bug->assignedTo = $oldBug->status == 'closed' ? $oldBug->assignedTo : $data->assignedTos[$bugID];
|
||||
$bug->deadline = $data->deadlines[$bugID];
|
||||
$bug->resolvedBy = $data->resolvedBys[$bugID];
|
||||
$bug->keywords = $data->keywords[$bugID];
|
||||
@@ -929,7 +930,7 @@ class bugModel extends model
|
||||
|
||||
if(!dao::isError())
|
||||
{
|
||||
if(!empty($bug->resolvedBy)) $this->loadModel('score')->create('bug', 'resolve', $bugID);
|
||||
if(!empty($bug->resolvedBy)) $this->loadModel('score')->create('bug', 'resolve', $bug);
|
||||
|
||||
$this->executeHooks($bugID);
|
||||
|
||||
@@ -1215,7 +1216,7 @@ class bugModel extends model
|
||||
if($bug->resolvedBuild and $bug->resolvedBuild != 'trunk')
|
||||
{
|
||||
$testtaskID = (int) $this->dao->select('id')->from(TABLE_TESTTASK)->where('build')->eq($bug->resolvedBuild)->orderBy('id_desc')->limit(1)->fetch('id');
|
||||
if($testtaskID and empty($oldBug->testtask)) $bug->testtask = $testtask;
|
||||
if($testtaskID and empty($oldBug->testtask)) $bug->testtask = $testtaskID;
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_BUG)->data($bug, 'buildName,createBuild,buildExecution,comment')
|
||||
|
||||
@@ -248,11 +248,13 @@ class buildModel extends model
|
||||
$selectedBuilds = array();
|
||||
if(strpos($params, 'noempty') === false) $sysBuilds = array('' => '');
|
||||
if(strpos($params, 'notrunk') === false) $sysBuilds = $sysBuilds + array('trunk' => $this->lang->trunk);
|
||||
$productIdList = is_array($products) ? array_keys($products) : $products;
|
||||
if($buildIdList)
|
||||
{
|
||||
$buildIdList = str_replace('trunk', '0', $buildIdList);
|
||||
$selectedBuilds = $this->dao->select('id, name')->from(TABLE_BUILD)
|
||||
->where('id')->in($buildIdList)
|
||||
->beginIF($products)->andWhere('product')->in($products)->fi()
|
||||
->beginIF($products)->andWhere('product')->in($productIdList)->fi()
|
||||
->beginIF($objectType === 'execution' and $objectID)->andWhere('execution')->eq($objectID)->fi()
|
||||
->beginIF($objectType === 'project' and $objectID)->andWhere('project')->eq($objectID)->fi()
|
||||
->beginIF(strpos($params, 'hasdeleted') === false)->andWhere('deleted')->eq(0)->fi()
|
||||
@@ -260,7 +262,7 @@ class buildModel extends model
|
||||
}
|
||||
$branchPairs = $this->dao->select('id,name')->from(TABLE_BRANCH)->fetchPairs();
|
||||
|
||||
$shadows = $this->dao->select('shadow')->from(TABLE_RELEASE)->where('product')->in($products)->fetchPairs('shadow', 'shadow');
|
||||
$shadows = $this->dao->select('shadow')->from(TABLE_RELEASE)->where('product')->in($productIdList)->fetchPairs('shadow', 'shadow');
|
||||
$branchs = strpos($params, 'separate') === false ? "0,$branch" : $branch;
|
||||
$allBuilds = $this->dao->select('t1.id, t1.name, t1.branch, t1.execution, t1.date, t1.deleted, t2.status as objectStatus, t3.id as releaseID, t3.status as releaseStatus, t4.type as productType')->from(TABLE_BUILD)->alias('t1')
|
||||
->beginIF($objectType === 'execution')->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id')->fi()
|
||||
@@ -268,11 +270,11 @@ class buildModel extends model
|
||||
->leftJoin(TABLE_RELEASE)->alias('t3')->on("FIND_IN_SET(t1.id,t3.build)")
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t4')->on('t1.product = t4.id')
|
||||
->where('1=1')
|
||||
->andWhere('t1.id')->notIN($shadows)
|
||||
->beginIf(!empty($shaows))->andWhere('t1.id')->notIN($shadows)->fi()
|
||||
->beginIF(strpos($params, 'hasdeleted') === false)->andWhere('t1.deleted')->eq(0)->fi()
|
||||
->beginIF(strpos($params, 'hasproject') !== false)->andWhere('t1.project')->ne(0)->fi()
|
||||
->beginIF(strpos($params, 'singled') !== false)->andWhere('t1.execution')->ne(0)->fi()
|
||||
->beginIF($products)->andWhere('t1.product')->in($products)->fi()
|
||||
->beginIF($products)->andWhere('t1.product')->in($productIdList)->fi()
|
||||
->beginIF($objectType === 'execution' and $objectID)->andWhere('t1.execution')->eq($objectID)->fi()
|
||||
->beginIF($objectType === 'project' and $objectID)->andWhere('t1.project')->eq($objectID)->fi()
|
||||
->orderBy('t1.date desc, t1.id desc')->fetchAll('id');
|
||||
@@ -333,7 +335,7 @@ class buildModel extends model
|
||||
->leftJoin(TABLE_BRANCH)->alias('t3')->on('FIND_IN_SET(t3.id, t1.branch)')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t4')->on('t1.product=t4.id')
|
||||
->where('t2.id')->in($buildIdList)
|
||||
->andWhere('t1.product')->in($products)
|
||||
->andWhere('t1.product')->in($productIdList)
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->andWhere('t1.shadow')->ne(0)
|
||||
->fetchAll('id');
|
||||
|
||||
@@ -5,3 +5,4 @@
|
||||
.header:hover .header-config {display: inline-block;}
|
||||
.label-outline.label-info {border: unset; line-height: 14px;}
|
||||
.border-bottom {border-bottom: 1px solid #f4f5f7;}
|
||||
.visibility-hidden{visibility: hidden;}
|
||||
|
||||
@@ -87,3 +87,17 @@ function initDatepicker($obj, callback)
|
||||
|
||||
if(typeof callback == 'function') callback($obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attr date check.
|
||||
*
|
||||
* @param object $obj
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function attrDateCheck($obj)
|
||||
{
|
||||
$obj.find('.form-date').attr('onchange', 'checkDate(this, this.value)');
|
||||
$obj.find('.form-datetime').attr('onchange', 'checkDate(this, this.value)');
|
||||
}
|
||||
|
||||
|
||||
+47
-45
@@ -1,10 +1,8 @@
|
||||
$(function()
|
||||
{
|
||||
initCheckBox();
|
||||
initQueryBtn();
|
||||
$('#exportchart').modalTrigger();
|
||||
|
||||
chartMap = new Map();
|
||||
if(charts.length > 0)
|
||||
{
|
||||
var chartPros = charts.map(function(chart)
|
||||
@@ -12,7 +10,6 @@ $(function()
|
||||
var echartDom = $('#chartDraw' + chart.currentGroup + '_' + chart.id).get(0);
|
||||
var echart = echarts.init(echartDom);
|
||||
ajaxGetChart(false, chart, echart);
|
||||
chartMap.set(chart.cudrrentGroup + chart.id, chart);
|
||||
return renderFilters(chart);
|
||||
});
|
||||
|
||||
@@ -21,9 +18,14 @@ $(function()
|
||||
calcPreviewGrowFilter();
|
||||
$('body').resize(() => {calcPreviewGrowFilter(true);});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
chartMap = new Map();
|
||||
charts.forEach(function(chart)
|
||||
{
|
||||
chartMap.set(chart.currentGroup + '_' + chart.id, chart);
|
||||
});
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
})
|
||||
|
||||
@@ -73,53 +75,53 @@ function initCheckBox()
|
||||
/**
|
||||
* Init query button.
|
||||
*
|
||||
* @param object $obj
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function initQueryBtn()
|
||||
function queryData(obj)
|
||||
{
|
||||
$('.btn-query').click(function()
|
||||
var chartID = $(obj).parents('.filterBox').attr('data-chart');
|
||||
var chartInfo = chartMap.get(chartID);
|
||||
chartInfo.searchFilters = JSON.parse(JSON.stringify(chartInfo.filters));
|
||||
|
||||
// Foreach filters and set current value in searchFilters. */
|
||||
$('#filterItems' + chartID + ' .filter-items').children().each(function(index)
|
||||
{
|
||||
var chartID = $(this).attr('data-chart');
|
||||
var chartInfo = chartMap.get(chartID);
|
||||
chartInfo.searchFilters = JSON.parse(JSON.stringify(chartInfo.filters));
|
||||
var $child = $(this);
|
||||
if(!$child.hasClass('filter-item')) return;
|
||||
|
||||
// Foreach filters and set current value in searchFilters. */
|
||||
$('#filterItems' + chartID + ' .filter-items').children().each(function(index)
|
||||
var filter = chartInfo.searchFilters[index];
|
||||
var type = filter.type;
|
||||
var value = null;
|
||||
|
||||
if(type == 'input' || type == 'select')
|
||||
{
|
||||
var $child = $(this);
|
||||
var filter = chartInfo.searchFilters[index];
|
||||
var type = filter.type;
|
||||
var value = null;
|
||||
var value = $child.find('#default').val();
|
||||
chartInfo.searchFilters[index].default = value;
|
||||
}
|
||||
else if(type == 'date' || type == 'datetime')
|
||||
{
|
||||
var begin = $child.find('input').first().val();
|
||||
var end = $child.find('input').last().val();
|
||||
|
||||
if(type == 'input' || type == 'select')
|
||||
{
|
||||
var value = $child.find('#default').val();
|
||||
chartInfo.searchFilters[index].default = value;
|
||||
}
|
||||
else if(type == 'date' || type == 'datetime')
|
||||
{
|
||||
var begin = $child.find('input').first().val();
|
||||
var end = $child.find('input').last().val();
|
||||
var value = {"begin":begin, "end":end};
|
||||
chartInfo.searchFilters[index].default = value;
|
||||
}
|
||||
else if(type == 'condition')
|
||||
{
|
||||
var operator = $child.find('#operator').data('zui.picker').getValue();
|
||||
var value = $child.find('#value').val();
|
||||
|
||||
var value = {"begin":begin, "end":end};
|
||||
chartInfo.searchFilters[index].default = value;
|
||||
}
|
||||
else if(type == 'condition')
|
||||
{
|
||||
var operator = $child.find('#operator').data('zui.picker').getValue();
|
||||
var value = $child.find('#value').val();
|
||||
|
||||
chartInfo.searchFilters[index].operator = operator;
|
||||
chartInfo.searchFilters[index].value = value;
|
||||
}
|
||||
});
|
||||
|
||||
//* Reload echart. */
|
||||
var echartDom = $('#chartDraw' + chartID).get(0);
|
||||
var echartInfo = echarts.init(echartDom);
|
||||
ajaxGetChart(false, chartInfo, echartInfo);
|
||||
chartInfo.searchFilters[index].operator = operator;
|
||||
chartInfo.searchFilters[index].value = value;
|
||||
}
|
||||
});
|
||||
|
||||
//* Reload echart. */
|
||||
var echartDom = $('#chartDraw' + chartID).get(0);
|
||||
var echartInfo = echarts.init(echartDom);
|
||||
ajaxGetChart(false, chartInfo, echartInfo);
|
||||
}
|
||||
|
||||
function calcPreviewGrowFilter(resize = false)
|
||||
@@ -155,7 +157,7 @@ function calcPreviewGrowFilter(resize = false)
|
||||
var canGrowTotal = 0;
|
||||
|
||||
$filterBox.find('.query-inside').addClass('hidden');
|
||||
$filterBox.find('.query-outside').addClass('hidden');
|
||||
$filterBox.find('.query-outside').addClass('visibility-hidden');
|
||||
chart.filters.forEach(function(filter, index)
|
||||
{
|
||||
var nowItem = '.filter-item-' + index;
|
||||
@@ -191,8 +193,8 @@ function calcPreviewGrowFilter(resize = false)
|
||||
if(filter.type == 'select' && $nowDom.find('.picker').length) $nowDom.find('.picker').find('.picker-selections').css('width', WIDTH_INPUT);
|
||||
});
|
||||
|
||||
var queryType =(!lineWrap && nowWidth >= 60) ? '.query-inside' : '.query-outside';
|
||||
$filterBox.find(queryType).removeClass('hidden');
|
||||
if(!lineWrap && nowWidth >= 60) $filterBox.find('.query-inside').removeClass('hidden');
|
||||
else $filterBox.find('.query-outside').removeClass('visibility-hidden');
|
||||
|
||||
/* Set picker-selection width, default 128px. */
|
||||
waitForRepaint(function()
|
||||
@@ -247,6 +249,6 @@ function renderFilterItem(filter, resp, index, step)
|
||||
};
|
||||
var html = $($.zui.formatString(tpl, data))
|
||||
initPicker(html, 'picker-select', true);
|
||||
initDatepicker(html);
|
||||
initDatepicker(html, attrDateCheck);
|
||||
return html;
|
||||
}
|
||||
|
||||
@@ -538,7 +538,7 @@ class chartModel extends model
|
||||
$wheres = array();
|
||||
foreach($filters as $field => $filter)
|
||||
{
|
||||
$wheres[] = "$field {$filter['operator']} {$filter['value']}";
|
||||
$wheres[] = "`$field` {$filter['operator']} {$filter['value']}";
|
||||
}
|
||||
|
||||
$whereStr = implode(' and ', $wheres);
|
||||
@@ -570,6 +570,8 @@ class chartModel extends model
|
||||
*/
|
||||
public static function isClickable($chart, $action)
|
||||
{
|
||||
global $config;
|
||||
if($chart->builtin and in_array($chart->id, $config->screen->builtinChart)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -604,8 +606,9 @@ class chartModel extends model
|
||||
if($field)
|
||||
{
|
||||
$path = $this->app->getModuleRoot() . 'dataview' . DS . 'table' . DS . "$object.php";
|
||||
include $path;
|
||||
if(!is_file($path)) return;
|
||||
|
||||
include $path;
|
||||
$options = $schema->fields[$field]['options'];
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<?php js::set('WIDTH_INPUT', $config->chart->widthInput);?>
|
||||
<?php js::set('WIDTH_DATE', $config->chart->widthDate);?>
|
||||
<?php js::set('pickerHeight', $config->bi->pickerHeight);?>
|
||||
<?php $queryDom = "<div class='queryBtn query-inside hidden'> <button type='submit' id='submit' class='btn btn-primary btn-query' data-loading='Loading...'>{$lang->chart->query}</button></div>";?>
|
||||
<?php $queryDom = "<div class='queryBtn query-inside hidden'> <button type='submit' id='submit' onclick='queryData(this)' class='btn btn-primary btn-query' data-loading='Loading...'>{$lang->chart->query}</button></div>";?>
|
||||
<?php js::set('queryDom', $queryDom);?>
|
||||
|
||||
<div id='mainMenu' class='clearfix main-position'>
|
||||
@@ -36,7 +36,7 @@
|
||||
</div>
|
||||
<?php if($this->config->edition == 'biz' or $this->config->edition == 'max'):?>
|
||||
<div class='btn-toolbar pull-right child-position'>
|
||||
<?php common::printLink('chart', 'exportChart', '', "<i class='icon icon-export muted'> </i> " . $lang->export, '', "class='btn btn-link btn-export' id='exportchart'");?>
|
||||
<?php common::printLink('chart', 'export', '', "<i class='icon icon-export muted'> </i> " . $lang->export, '', "class='btn btn-link btn-export' id='exportchart'");?>
|
||||
<?php common::printLink('chart', 'browse', '', $lang->chart->toDesign, '', "class='btn btn-primary '");?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
@@ -94,10 +94,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<div id="filterItems<?php echo $chart->currentGroup . '_';?><?php echo $chart->id;?>" class='filterBox'>
|
||||
<div id="filterItems<?php echo $chart->currentGroup . '_';?><?php echo $chart->id;?>" data-chart="<?php echo $chart->currentGroup . '_' . $chart->id?>"class='filterBox'>
|
||||
<div class='filter-items'></div>
|
||||
<?php if(!empty($chart->filters)):?>
|
||||
<div class='queryBtn query-outside'><?php echo html::submitButton($lang->chart->query, "data-chart={$chart->currentGroup}{$chart->id}", 'btn btn-primary btn-query');?></div>
|
||||
<div class='queryBtn query-outside'><?php echo html::submitButton($lang->chart->query, "onclick='queryData(this)'", 'btn btn-primary btn-query');?></div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div id="chartDraw<?php echo $chart->currentGroup . '_';?><?php echo $chart->id;?>" data-group="<?php echo $chart->currentGroup;?>" data-id="<?php echo $chart->id;?>" class='echart-content'></div>
|
||||
|
||||
@@ -502,7 +502,7 @@ $lang->doc->menu->dashboard = array('link' => "{$lang->dashboard}|doc|index");
|
||||
$lang->doc->menu->my = array('link' => "{$lang->doc->mySpace}|doc|mySpace|type=mine", 'alias' => 'myspace');
|
||||
$lang->doc->menu->product = array('link' => "{$lang->doc->productSpace}|doc|productSpace|", 'alias' => 'productspace');
|
||||
$lang->doc->menu->project = array('link' => "{$lang->doc->projectSpace}|doc|projectSpace|", 'alias' => 'projectspace');
|
||||
$lang->doc->menu->api = array('link' => "{$lang->doc->apiSpace}|api|index", 'alias' => 'api');
|
||||
$lang->doc->menu->api = array('link' => "{$lang->doc->apiSpace}|api|index", 'alias' => '', 'exclude' => 'index');
|
||||
$lang->doc->menu->custom = array('link' => "{$lang->doc->teamSpace}|doc|teamSpace|", 'alias' => 'teamspace');
|
||||
|
||||
$lang->doc->dividerMenu = ',product,';
|
||||
|
||||
@@ -1182,7 +1182,7 @@ class commonModel extends model
|
||||
if(isset($menuItem->link['module'])) $module = $menuItem->link['module'];
|
||||
if(isset($menuItem->link['method'])) $method = $menuItem->link['method'];
|
||||
}
|
||||
if($module == $currentModule and ($method == $currentMethod or strpos(",$alias,", ",$currentMethod,") !== false) and strpos(",$exclude,", ",$currentMethod,") === false)
|
||||
if($module == $currentModule and ($method == $currentMethod or strpos(",$alias,", ",$currentMethod,") !== false) and strpos(",$exclude,", ",$currentModule-$currentMethod,") === false)
|
||||
{
|
||||
$activeMenu = $menuItem->name;
|
||||
$active = 'active';
|
||||
@@ -1871,7 +1871,7 @@ EOF;
|
||||
if(empty($types)) return;
|
||||
$condition .= ' AND `type` in (' . trim($types, ',') . ')';
|
||||
}
|
||||
$pipelineList = $app->dbh->query("SELECT type,name,url FROM " . TABLE_PIPELINE . " WHERE `deleted` = '0' $condition order by type")->fetchAll();
|
||||
$pipelineList = $app->dbh->query("SELECT `type`,name,url FROM " . TABLE_PIPELINE . " WHERE `deleted` = '0' $condition order by type")->fetchAll();
|
||||
if(empty($pipelineList)) return;
|
||||
|
||||
$appCommon = isset($lang->db->custom['devopsMenu']['menu']['app']) ? $lang->db->custom['devopsMenu']['menu']['app'] : $lang->app->common;
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<td><?php echo $cron->dow;?></td>
|
||||
<td class='text-left' title='<?php echo $cron->command?>'><?php echo $cron->command;?></td>
|
||||
<td class='text-left' title='<?php echo $cron->remark?>'><?php echo $cron->remark;?></td>
|
||||
<td><?php echo substr($cron->lastTime, 2);?></td>
|
||||
<td><?php echo substr($cron->lastTime, 2, 17);?></td>
|
||||
<td><?php echo zget($lang->cron->statusList, $cron->status, '');?></td>
|
||||
<td class='text-center'>
|
||||
<?php
|
||||
|
||||
@@ -31,6 +31,7 @@ $schema->fields['id'] = array('type' => 'number', 'name' => $this->lan
|
||||
$schema->fields['title'] = array('type' => 'string', 'name' => $this->lang->bug->title);
|
||||
$schema->fields['steps'] = array('type' => 'text', 'name' => $this->lang->bug->steps);
|
||||
$schema->fields['status'] = array('type' => 'option', 'name' => $this->lang->bug->status, 'options' => $this->lang->bug->statusList);
|
||||
$schema->fields['type'] = array('type' => 'option', 'name' => $this->lang->bug->type, 'options' => $this->lang->bug->typeList);
|
||||
$schema->fields['confirmed'] = array('type' => 'option', 'name' => $this->lang->bug->confirmed, 'options' => $this->lang->bug->confirmedList);
|
||||
$schema->fields['severity'] = array('type' => 'option', 'name' => $this->lang->bug->severity, 'options' => $this->lang->bug->severityList);
|
||||
$schema->fields['product'] = array('type' => 'object', 'name' => $this->lang->bug->product, 'object' => 'product', 'show' => 'product.name');
|
||||
@@ -38,11 +39,15 @@ $schema->fields['project'] = array('type' => 'object', 'name' => $this->lan
|
||||
$schema->fields['bugmodule'] = array('type' => 'object', 'name' => $this->lang->bug->module, 'object' => 'bugmodule', 'show' => 'bugmodule.name');
|
||||
$schema->fields['story'] = array('type' => 'object', 'name' => $this->lang->story->common, 'object' => 'story', 'show' => 'story.title');
|
||||
$schema->fields['pri'] = array('type' => 'option', 'name' => $this->lang->bug->pri, 'options' => $this->lang->bug->priList);
|
||||
$schema->fields['assignedTo'] = array('type' => 'user', 'name' => $this->lang->bug->assignedTo);
|
||||
$schema->fields['assignedDate'] = array('type' => 'date', 'name' => $this->lang->bug->assignedDate);
|
||||
$schema->fields['openedBy'] = array('type' => 'user', 'name' => $this->lang->bug->openedBy);
|
||||
$schema->fields['openedDate'] = array('type' => 'date', 'name' => $this->lang->bug->openedDate);
|
||||
$schema->fields['resolvedBy'] = array('type' => 'user', 'name' => $this->lang->bug->resolvedBy);
|
||||
$schema->fields['resolution'] = array('type' => 'option', 'name' => $this->lang->bug->resolution, 'options' => $this->lang->bug->resolutionList);
|
||||
$schema->fields['resolvedDate'] = array('type' => 'date', 'name' => $this->lang->bug->resolvedDate);
|
||||
$schema->fields['closedBy'] = array('type' => 'user', 'name' => $this->lang->bug->closedBy);
|
||||
$schema->fields['closedDate'] = array('type' => 'date', 'name' => $this->lang->bug->closedDate);
|
||||
|
||||
$schema->objects = array();
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ $schema->tables['project'] = 'zt_project';
|
||||
$schema->joins = array();
|
||||
|
||||
$schema->fields = array();
|
||||
$schema->fields['id'] = array('type' => 'number', 'name' => $this->lang->project->id);
|
||||
$schema->fields['name'] = array('type' => 'string', 'name' => $this->lang->project->name);
|
||||
$schema->fields['code'] = array('type' => 'string', 'name' => $this->lang->project->code);
|
||||
$schema->fields['model'] = array('type' => 'option', 'name' => $this->lang->project->model, 'options' => $this->lang->project->modelList);
|
||||
@@ -26,5 +27,9 @@ $schema->fields['QD'] = array('type' => 'user', 'name' => $this->lang
|
||||
$schema->fields['RD'] = array('type' => 'user', 'name' => $this->lang->project->RD);
|
||||
$schema->fields['openedBy'] = array('type' => 'user', 'name' => $this->lang->project->openedBy);
|
||||
$schema->fields['openedDate'] = array('type' => 'date', 'name' => $this->lang->project->openedDate);
|
||||
$schema->fields['realBegan'] = array('type' => 'date', 'name' => $this->lang->project->realBegan);
|
||||
$schema->fields['realEnd'] = array('type' => 'date', 'name' => $this->lang->project->realEnd);
|
||||
$schema->fields['closedBy'] = array('type' => 'user', 'name' => $this->lang->project->closedBy);
|
||||
$schema->fields['closedDate'] = array('type' => 'date', 'name' => $this->lang->project->closedDate);
|
||||
|
||||
$schema->objects = array();
|
||||
|
||||
@@ -20,6 +20,7 @@ $schema->joins['project'] = 'release.project = project.id';
|
||||
$schema->joins['build'] = 'release.build = build.id';
|
||||
|
||||
$schema->fields = array();
|
||||
$schema->fields['id'] = array('type' => 'number', 'name' => $this->lang->release->id);
|
||||
$schema->fields['product'] = array('type' => 'object', 'name' => $this->lang->release->product, 'object' => 'product', 'show' => 'product.name');
|
||||
$schema->fields['project'] = array('type' => 'object', 'name' => $this->lang->release->project, 'object' => 'project', 'show' => 'project.name');
|
||||
$schema->fields['build'] = array('type' => 'object', 'name' => $this->lang->release->build, 'object' => 'build', 'show' => 'build.name');
|
||||
|
||||
@@ -31,12 +31,17 @@ $schema->fields['title'] = array('type' => 'string', 'name' => $this->lan
|
||||
$schema->fields['status'] = array('type' => 'option', 'name' => $this->lang->story->status, 'options' => $this->lang->story->statusList);
|
||||
$schema->fields['stage'] = array('type' => 'option', 'name' => $this->lang->story->stage, 'options' => $this->lang->story->stageList);
|
||||
$schema->fields['pri'] = array('type' => 'option', 'name' => $this->lang->story->pri, 'options' => $this->lang->story->priList);
|
||||
$schema->fields['source'] = array('type' => 'option', 'name' => $this->lang->story->source, 'options' => $this->lang->story->sourceList);
|
||||
$schema->fields['category'] = array('type' => 'option', 'name' => $this->lang->story->category, 'options' => $this->lang->story->categoryList);
|
||||
$schema->fields['product'] = array('type' => 'object', 'name' => $this->lang->story->product, 'object' => 'product', 'show' => 'product.name');
|
||||
$schema->fields['storymodule'] = array('type' => 'object', 'name' => $this->lang->story->module, 'object' => 'storymodule', 'show' => 'storymodule.name');
|
||||
$schema->fields['closedDate'] = array('type' => 'date', 'name' => $this->lang->story->closedDate);
|
||||
$schema->fields['closedReason'] = array('type' => 'option', 'name' => $this->lang->story->closedReason, 'options' => $this->lang->story->reasonList);
|
||||
$schema->fields['openedBy'] = array('type' => 'user', 'name' => $this->lang->story->openedBy);
|
||||
$schema->fields['openedDate'] = array('type' => 'date', 'name' => $this->lang->story->openedDate);
|
||||
$schema->fields['assignedTo'] = array('type' => 'user', 'name' => $this->lang->story->assignedTo);
|
||||
$schema->fields['changedBy'] = array('type' => 'user', 'name' => $this->lang->story->changedBy);
|
||||
$schema->fields['closedBy'] = array('type' => 'user', 'name' => $this->lang->story->closedBy);
|
||||
|
||||
$schema->objects = array();
|
||||
|
||||
|
||||
@@ -24,25 +24,27 @@ $schema->joins['story'] = 'task.story = story.id';
|
||||
$schema->joins['taskmodule'] = 'task.module = taskmodule.id';
|
||||
|
||||
$schema->fields = array();
|
||||
$schema->fields['project'] = array('type' => 'object', 'name' => $this->lang->task->project, 'object' => 'project', 'show' => 'project.name');
|
||||
$schema->fields['execution'] = array('type' => 'object', 'name' => $this->lang->task->execution, 'object' => 'execution', 'show' => 'execution.name');
|
||||
$schema->fields['story'] = array('type' => 'object', 'name' => $this->lang->task->story, 'object' => 'story', 'show' => 'story.title');
|
||||
$schema->fields['taskmodule'] = array('type' => 'object', 'name' => $this->lang->task->module, 'object' => 'taskmodule', 'show' => 'taskmodule.name');
|
||||
$schema->fields['name'] = array('type' => 'string', 'name' => $this->lang->task->name);
|
||||
$schema->fields['pri'] = array('type' => 'option', 'name' => $this->lang->task->pri, 'options' => $this->lang->task->priList);
|
||||
$schema->fields['type'] = array('type' => 'option', 'name' => $this->lang->task->type, 'options' => $this->lang->task->typeList);
|
||||
$schema->fields['status'] = array('type' => 'option', 'name' => $this->lang->task->status, 'options' => $this->lang->task->statusList);
|
||||
$schema->fields['desc'] = array('type' => 'string', 'name' => $this->lang->task->desc);
|
||||
$schema->fields['estimate'] = array('type' => 'string', 'name' => $this->lang->task->estimate);
|
||||
$schema->fields['consumed'] = array('type' => 'string', 'name' => $this->lang->task->consumed);
|
||||
$schema->fields['left'] = array('type' => 'string', 'name' => $this->lang->task->left);
|
||||
$schema->fields['estStarted'] = array('type' => 'date', 'name' => $this->lang->task->estStarted);
|
||||
$schema->fields['deadline'] = array('type' => 'date', 'name' => $this->lang->task->deadline);
|
||||
$schema->fields['assignedTo'] = array('type' => 'user', 'name' => $this->lang->task->assignedTo);
|
||||
$schema->fields['finishedBy'] = array('type' => 'user', 'name' => $this->lang->task->finishedBy);
|
||||
$schema->fields['closedBy'] = array('type' => 'user', 'name' => $this->lang->task->closedBy);
|
||||
$schema->fields['openedBy'] = array('type' => 'user', 'name' => $this->lang->task->openedBy);
|
||||
$schema->fields['openedDate'] = array('type' => 'date', 'name' => $this->lang->task->openedDate);
|
||||
$schema->fields['project'] = array('type' => 'object', 'name' => $this->lang->task->project, 'object' => 'project', 'show' => 'project.name');
|
||||
$schema->fields['execution'] = array('type' => 'object', 'name' => $this->lang->task->execution, 'object' => 'execution', 'show' => 'execution.name');
|
||||
$schema->fields['story'] = array('type' => 'object', 'name' => $this->lang->task->story, 'object' => 'story', 'show' => 'story.title');
|
||||
$schema->fields['taskmodule'] = array('type' => 'object', 'name' => $this->lang->task->module, 'object' => 'taskmodule', 'show' => 'taskmodule.name');
|
||||
$schema->fields['name'] = array('type' => 'string', 'name' => $this->lang->task->name);
|
||||
$schema->fields['pri'] = array('type' => 'option', 'name' => $this->lang->task->pri, 'options' => $this->lang->task->priList);
|
||||
$schema->fields['type'] = array('type' => 'option', 'name' => $this->lang->task->type, 'options' => $this->lang->task->typeList);
|
||||
$schema->fields['status'] = array('type' => 'option', 'name' => $this->lang->task->status, 'options' => $this->lang->task->statusList);
|
||||
$schema->fields['desc'] = array('type' => 'string', 'name' => $this->lang->task->desc);
|
||||
$schema->fields['estimate'] = array('type' => 'string', 'name' => $this->lang->task->estimate);
|
||||
$schema->fields['consumed'] = array('type' => 'string', 'name' => $this->lang->task->consumed);
|
||||
$schema->fields['left'] = array('type' => 'string', 'name' => $this->lang->task->left);
|
||||
$schema->fields['estStarted'] = array('type' => 'date', 'name' => $this->lang->task->estStarted);
|
||||
$schema->fields['deadline'] = array('type' => 'date', 'name' => $this->lang->task->deadline);
|
||||
$schema->fields['assignedTo'] = array('type' => 'user', 'name' => $this->lang->task->assignedTo);
|
||||
$schema->fields['finishedBy'] = array('type' => 'user', 'name' => $this->lang->task->finishedBy);
|
||||
$schema->fields['closedBy'] = array('type' => 'user', 'name' => $this->lang->task->closedBy);
|
||||
$schema->fields['openedBy'] = array('type' => 'user', 'name' => $this->lang->task->openedBy);
|
||||
$schema->fields['openedDate'] = array('type' => 'date', 'name' => $this->lang->task->openedDate);
|
||||
$schema->fields['canceledBy'] = array('type' => 'user', 'name' => $this->lang->task->canceledBy);
|
||||
$schema->fields['closedReason'] = array('type' => 'option', 'name' => $this->lang->task->closedReason, 'options' => $this->lang->task->reasonList);
|
||||
|
||||
$schema->objects = array();
|
||||
|
||||
|
||||
+111
-1
@@ -4,4 +4,114 @@ $config->dimension->changeDimensionLink['screen-browse'] = 'screen|browse|dimens
|
||||
$config->dimension->changeDimensionLink['pivot-preview'] = 'pivot|preview|dimensionID=%s';
|
||||
$config->dimension->changeDimensionLink['chart-preview'] = 'chart|preview|dimensionID=%s';
|
||||
|
||||
$config->dimension->defaultDimension = array('efficiency', 'quality');
|
||||
$config->dimension->defaultDimension = array('macro', 'efficiency', 'quality');
|
||||
|
||||
/* Pivot second module list. */
|
||||
$config->dimension->pivotModuleList = array();
|
||||
$config->dimension->pivotModuleList['macro'] = array();
|
||||
$config->dimension->pivotModuleList['macro']['staff'] = 'program';
|
||||
$config->dimension->pivotModuleList['macro']['product'] = 'product';
|
||||
|
||||
$config->dimension->pivotModuleList['efficiency'] = array();
|
||||
$config->dimension->pivotModuleList['efficiency']['project'] = 'project,progress,cost,timelimit';
|
||||
|
||||
$config->dimension->pivotModuleList['quality'] = array();
|
||||
$config->dimension->pivotModuleList['quality']['test'] = 'bug';
|
||||
|
||||
/* Chart second module list. */
|
||||
$config->dimension->chartModuleList = array();
|
||||
$config->dimension->chartModuleList['macro'] = array();
|
||||
$config->dimension->chartModuleList['macro']['staff'] = 'program,project,product,plan,execution,release,story,task,bug,doc,cost,personnel,effort,behavior';
|
||||
$config->dimension->chartModuleList['macro']['product'] = 'story,release';
|
||||
$config->dimension->chartModuleList['macro']['test'] = 'bug';
|
||||
$config->dimension->chartModuleList['macro']['project'] = 'project,task,execution,cost,timelimit,story';
|
||||
|
||||
$config->dimension->chartModuleList['efficiency'] = array();
|
||||
$config->dimension->chartModuleList['efficiency']['staff'] = 'project,execution,release,story,task,bug,cost';
|
||||
$config->dimension->chartModuleList['efficiency']['project'] = 'progress,cost,timelimit';
|
||||
|
||||
$config->dimension->chartModuleList['quality'] = array();
|
||||
$config->dimension->chartModuleList['quality']['staff'] = 'story,bug,testcase';
|
||||
$config->dimension->chartModuleList['quality']['test'] = 'bug,testcase';
|
||||
|
||||
/* Pivot upgrade group. */
|
||||
$config->dimension->pivotUpgrade = array();
|
||||
$config->dimension->pivotUpgrade['macro'] = array();
|
||||
$config->dimension->pivotUpgrade['macro']['staff'] = array();
|
||||
$config->dimension->pivotUpgrade['macro']['staff']['program'] = array('chart' => '1041,1073,1074');
|
||||
$config->dimension->pivotUpgrade['macro']['product'] = array();
|
||||
$config->dimension->pivotUpgrade['macro']['product']['product'] = array('chart' => '1045,1075,1076');
|
||||
|
||||
$config->dimension->pivotUpgrade['efficiency'] = array();
|
||||
$config->dimension->pivotUpgrade['efficiency']['project'] = array();
|
||||
$config->dimension->pivotUpgrade['efficiency']['project']['project'] = array('chart' => '10118,10119');
|
||||
$config->dimension->pivotUpgrade['efficiency']['project']['progress'] = array('chart' => '10116,10117');
|
||||
$config->dimension->pivotUpgrade['efficiency']['project']['cost'] = array('pivot' => '1001');
|
||||
$config->dimension->pivotUpgrade['efficiency']['project']['timelimit'] = array('pivot' => '1000');
|
||||
|
||||
$config->dimension->pivotUpgrade['quality'] = array();
|
||||
$config->dimension->pivotUpgrade['quality']['test'] = array();
|
||||
$config->dimension->pivotUpgrade['quality']['test']['bug'] = array('pivot' => '1002');
|
||||
|
||||
/* Chart upgrade group. */
|
||||
$config->dimension->chartUpgrade['macro'] = array();
|
||||
$config->dimension->chartUpgrade['macro']['staff'] = array();
|
||||
$config->dimension->chartUpgrade['macro']['staff']['program'] = array('chart' => '1018,1033,1042,1043,1055,1083');
|
||||
$config->dimension->chartUpgrade['macro']['staff']['project'] = array('chart' => '1019,1036,1060,1066');
|
||||
$config->dimension->chartUpgrade['macro']['staff']['product'] = array('chart' => '1020,1035,1056');
|
||||
$config->dimension->chartUpgrade['macro']['staff']['plan'] = array('chart' => '1021,1037,1059');
|
||||
$config->dimension->chartUpgrade['macro']['staff']['execution'] = array('chart' => '1022,1038,1061,1067');
|
||||
$config->dimension->chartUpgrade['macro']['staff']['release'] = array('chart' => '1023,1064,1068');
|
||||
$config->dimension->chartUpgrade['macro']['staff']['story'] = array('chart' => '1024,1034,1057,1069');
|
||||
$config->dimension->chartUpgrade['macro']['staff']['task'] = array('chart' => '1025,1040,1062,1071');
|
||||
$config->dimension->chartUpgrade['macro']['staff']['bug'] = array('chart' => '1026,1039,1058,1070');
|
||||
$config->dimension->chartUpgrade['macro']['staff']['doc'] = array('chart' => '1027,1063');
|
||||
$config->dimension->chartUpgrade['macro']['staff']['cost'] = array('chart' => '1028,1029');
|
||||
$config->dimension->chartUpgrade['macro']['staff']['personnel'] = array('chart' => '1049,1050,1051,1065,1105,1106,1107,1108,1109,1110');
|
||||
$config->dimension->chartUpgrade['macro']['staff']['effort'] = array('chart' => '1072');
|
||||
$config->dimension->chartUpgrade['macro']['staff']['behavior'] = array('chart' => '1030');
|
||||
|
||||
$config->dimension->chartUpgrade['macro']['product'] = array();
|
||||
$config->dimension->chartUpgrade['macro']['product']['story'] = array('chart' => '1031,1046,1077,1088,1089,1091,1092,1099,1101,1102');
|
||||
$config->dimension->chartUpgrade['macro']['product']['release'] = array('chart' => '1082');
|
||||
|
||||
$config->dimension->chartUpgrade['macro']['test'] = array();
|
||||
$config->dimension->chartUpgrade['macro']['test']['bug'] = array('chart' => '1032,1047,1078,1090,1093,1103,1104');
|
||||
|
||||
$config->dimension->chartUpgrade['macro']['project'] = array();
|
||||
$config->dimension->chartUpgrade['macro']['project']['project'] = array('chart' => '1044,1080');
|
||||
$config->dimension->chartUpgrade['macro']['project']['task'] = array('chart' => '1079');
|
||||
$config->dimension->chartUpgrade['macro']['project']['execution'] = array('chart' => '1081');
|
||||
$config->dimension->chartUpgrade['macro']['project']['cost'] = array('chart' => '1085,1086,1097,1087,1098');
|
||||
$config->dimension->chartUpgrade['macro']['project']['timelimit'] = array('chart' => '1094,1096');
|
||||
$config->dimension->chartUpgrade['macro']['project']['story'] = array('chart' => '1091,1100');
|
||||
|
||||
$config->dimension->chartUpgrade['efficiency'] = array();
|
||||
$config->dimension->chartUpgrade['efficiency']['staff'] = array();
|
||||
$config->dimension->chartUpgrade['efficiency']['staff']['project'] = array('chart' => '10000,10001,10002,10101,10103,10105,10107');
|
||||
$config->dimension->chartUpgrade['efficiency']['staff']['execution'] = array('chart' => '10007,10008,10009,10102,10104,10106,10107');
|
||||
$config->dimension->chartUpgrade['efficiency']['staff']['release'] = array('chart' => '10005');
|
||||
$config->dimension->chartUpgrade['efficiency']['staff']['story'] = array('chart' => '10003,10004,10109,10111');
|
||||
$config->dimension->chartUpgrade['efficiency']['staff']['task'] = array('chart' => '10010,10110');
|
||||
$config->dimension->chartUpgrade['efficiency']['staff']['bug'] = array('chart' => '1070');
|
||||
$config->dimension->chartUpgrade['efficiency']['staff']['cost'] = array('chart' => '10011,10012,10013,10112,10113');
|
||||
|
||||
$config->dimension->chartUpgrade['efficiency']['project'] = array();
|
||||
$config->dimension->chartUpgrade['efficiency']['project']['progress'] = array('chart' => '10114,10115');
|
||||
$config->dimension->chartUpgrade['efficiency']['project']['cost'] = array();
|
||||
$config->dimension->chartUpgrade['efficiency']['project']['timelimit'] = array('chart' => '10014,10015,10016,10017,10020,10021,10018,10019');
|
||||
|
||||
$config->dimension->chartUpgrade['quality'] = array();
|
||||
$config->dimension->chartUpgrade['quality']['staff'] = array();
|
||||
$config->dimension->chartUpgrade['quality']['staff']['story'] = array('chart' => '10201,10202');
|
||||
$config->dimension->chartUpgrade['quality']['staff']['bug'] = array('chart' => '10204,10205,10206');
|
||||
$config->dimension->chartUpgrade['quality']['staff']['testcase'] = array('chart' => '10203');
|
||||
|
||||
$config->dimension->chartUpgrade['quality']['test'] = array();
|
||||
$config->dimension->chartUpgrade['quality']['test']['bug'] = array('chart' => '10209,10210,1014,10211,10219,10212,10218,10214,10220,10213,10216');
|
||||
$config->dimension->chartUpgrade['quality']['test']['testcase'] = array('chart' => '10208,10215');
|
||||
|
||||
$config->dimension->secondModuleList = array();
|
||||
$config->dimension->secondModuleList['macro'] = array('pivot' => $config->dimension->pivotModuleList['macro'], 'pivotUpgrade' => $config->dimension->pivotUpgrade['macro'], 'chart' => $config->dimension->chartModuleList['macro'], 'chartUpgrade' => $config->dimension->chartUpgrade['macro']);
|
||||
$config->dimension->secondModuleList['efficiency'] = array('pivot' => $config->dimension->pivotModuleList['efficiency'], 'pivotUpgrade' => $config->dimension->pivotUpgrade['efficiency'], 'chart' => $config->dimension->chartModuleList['efficiency'], 'chartUpgrade' => $config->dimension->chartUpgrade['efficiency']);
|
||||
$config->dimension->secondModuleList['quality'] = array('pivot' => $config->dimension->pivotModuleList['quality'], 'pivotUpgrade' => $config->dimension->pivotUpgrade['quality'], 'chart' => $config->dimension->chartModuleList['quality'], 'chartUpgrade' => $config->dimension->chartUpgrade['quality']);
|
||||
|
||||
@@ -1,10 +1,30 @@
|
||||
<?php
|
||||
$lang->dimension->common = 'Dimension';
|
||||
$lang->dimension->efficiency = 'Efficiency';
|
||||
$lang->dimension->quality = 'Quality';
|
||||
$lang->dimension->macro = 'Macro management';
|
||||
$lang->dimension->efficiency = 'Efficiency management';
|
||||
$lang->dimension->quality = 'Quality management';
|
||||
|
||||
$lang->dimension->moduleList[''] = '';
|
||||
$lang->dimension->moduleList['product'] = $lang->productCommon;
|
||||
$lang->dimension->moduleList['project'] = $lang->projectCommon;
|
||||
$lang->dimension->moduleList['test'] = 'QA';
|
||||
$lang->dimension->moduleList['staff'] = 'Company';
|
||||
|
||||
$lang->dimension->modules = array();
|
||||
$lang->dimension->modules['program'] = $lang->program->common;
|
||||
$lang->dimension->modules['project'] = $lang->projectCommon;
|
||||
$lang->dimension->modules['product'] = $lang->productCommon;
|
||||
$lang->dimension->modules['plan'] = 'Plan';
|
||||
$lang->dimension->modules['execution'] = $lang->executionCommon;
|
||||
$lang->dimension->modules['release'] = $lang->release->common;
|
||||
$lang->dimension->modules['story'] = $lang->SRCommon;
|
||||
$lang->dimension->modules['task'] = $lang->task->common;
|
||||
$lang->dimension->modules['bug'] = $lang->bug->common;
|
||||
$lang->dimension->modules['doc'] = $lang->doc->common;
|
||||
$lang->dimension->modules['cost'] = 'Cost';
|
||||
$lang->dimension->modules['personnel'] = 'Personnel';
|
||||
$lang->dimension->modules['effort'] = 'Effort';
|
||||
$lang->dimension->modules['timelimit'] = 'Time limit';
|
||||
$lang->dimension->modules['progress'] = 'Progress';
|
||||
$lang->dimension->modules['testcase'] = $lang->testcase->common;
|
||||
$lang->dimension->modules['behavior'] = 'Behavior';
|
||||
|
||||
@@ -1,10 +1,30 @@
|
||||
<?php
|
||||
$lang->dimension->common = 'Dimension';
|
||||
$lang->dimension->efficiency = 'Efficiency';
|
||||
$lang->dimension->quality = 'Quality';
|
||||
$lang->dimension->macro = 'Macro management';
|
||||
$lang->dimension->efficiency = 'Efficiency management';
|
||||
$lang->dimension->quality = 'Quality management';
|
||||
|
||||
$lang->dimension->moduleList[''] = '';
|
||||
$lang->dimension->moduleList['product'] = $lang->productCommon;
|
||||
$lang->dimension->moduleList['project'] = $lang->projectCommon;
|
||||
$lang->dimension->moduleList['test'] = 'QA';
|
||||
$lang->dimension->moduleList['staff'] = 'Company';
|
||||
|
||||
$lang->dimension->modules = array();
|
||||
$lang->dimension->modules['program'] = $lang->program->common;
|
||||
$lang->dimension->modules['project'] = $lang->projectCommon;
|
||||
$lang->dimension->modules['product'] = $lang->productCommon;
|
||||
$lang->dimension->modules['plan'] = 'Plan';
|
||||
$lang->dimension->modules['execution'] = $lang->executionCommon;
|
||||
$lang->dimension->modules['release'] = $lang->release->common;
|
||||
$lang->dimension->modules['story'] = $lang->SRCommon;
|
||||
$lang->dimension->modules['task'] = $lang->task->common;
|
||||
$lang->dimension->modules['bug'] = $lang->bug->common;
|
||||
$lang->dimension->modules['doc'] = $lang->doc->common;
|
||||
$lang->dimension->modules['cost'] = 'Cost';
|
||||
$lang->dimension->modules['personnel'] = 'Personnel';
|
||||
$lang->dimension->modules['effort'] = 'Effort';
|
||||
$lang->dimension->modules['timelimit'] = 'Time limit';
|
||||
$lang->dimension->modules['progress'] = 'Progress';
|
||||
$lang->dimension->modules['testcase'] = $lang->testcase->common;
|
||||
$lang->dimension->modules['behavior'] = 'Behavior';
|
||||
|
||||
@@ -1,10 +1,30 @@
|
||||
<?php
|
||||
$lang->dimension->common = 'Dimension';
|
||||
$lang->dimension->efficiency = 'Efficiency';
|
||||
$lang->dimension->quality = 'Quality';
|
||||
$lang->dimension->macro = 'Macro management';
|
||||
$lang->dimension->efficiency = 'Efficiency management';
|
||||
$lang->dimension->quality = 'Quality management';
|
||||
|
||||
$lang->dimension->moduleList[''] = '';
|
||||
$lang->dimension->moduleList['product'] = $lang->productCommon;
|
||||
$lang->dimension->moduleList['project'] = $lang->projectCommon;
|
||||
$lang->dimension->moduleList['test'] = 'QA';
|
||||
$lang->dimension->moduleList['staff'] = 'Company';
|
||||
|
||||
$lang->dimension->modules = array();
|
||||
$lang->dimension->modules['program'] = $lang->program->common;
|
||||
$lang->dimension->modules['project'] = $lang->projectCommon;
|
||||
$lang->dimension->modules['product'] = $lang->productCommon;
|
||||
$lang->dimension->modules['plan'] = 'Plan';
|
||||
$lang->dimension->modules['execution'] = $lang->executionCommon;
|
||||
$lang->dimension->modules['release'] = $lang->release->common;
|
||||
$lang->dimension->modules['story'] = $lang->SRCommon;
|
||||
$lang->dimension->modules['task'] = $lang->task->common;
|
||||
$lang->dimension->modules['bug'] = $lang->bug->common;
|
||||
$lang->dimension->modules['doc'] = $lang->doc->common;
|
||||
$lang->dimension->modules['cost'] = 'Cost';
|
||||
$lang->dimension->modules['personnel'] = 'Personnel';
|
||||
$lang->dimension->modules['effort'] = 'Effort';
|
||||
$lang->dimension->modules['timelimit'] = 'Time limit';
|
||||
$lang->dimension->modules['progress'] = 'Progress';
|
||||
$lang->dimension->modules['testcase'] = $lang->testcase->common;
|
||||
$lang->dimension->modules['behavior'] = 'Behavior';
|
||||
|
||||
@@ -1,10 +1,30 @@
|
||||
<?php
|
||||
$lang->dimension->common = '维度';
|
||||
$lang->dimension->efficiency = '效能';
|
||||
$lang->dimension->quality = '质量';
|
||||
$lang->dimension->macro = '宏观管理维度';
|
||||
$lang->dimension->efficiency = '效能管理维度';
|
||||
$lang->dimension->quality = '质量管理维度';
|
||||
|
||||
$lang->dimension->moduleList[''] = '';
|
||||
$lang->dimension->moduleList['product'] = $lang->productCommon;
|
||||
$lang->dimension->moduleList['project'] = $lang->projectCommon;
|
||||
$lang->dimension->moduleList['test'] = '测试';
|
||||
$lang->dimension->moduleList['staff'] = '组织';
|
||||
|
||||
$lang->dimension->modules = array();
|
||||
$lang->dimension->modules['program'] = $lang->program->common;
|
||||
$lang->dimension->modules['project'] = $lang->projectCommon;
|
||||
$lang->dimension->modules['product'] = $lang->productCommon;
|
||||
$lang->dimension->modules['plan'] = '计划';
|
||||
$lang->dimension->modules['execution'] = $lang->executionCommon;
|
||||
$lang->dimension->modules['release'] = $lang->release->common;
|
||||
$lang->dimension->modules['story'] = $lang->SRCommon;
|
||||
$lang->dimension->modules['task'] = $lang->task->common;
|
||||
$lang->dimension->modules['bug'] = $lang->bug->common;
|
||||
$lang->dimension->modules['doc'] = $lang->doc->common;
|
||||
$lang->dimension->modules['cost'] = '成本';
|
||||
$lang->dimension->modules['personnel'] = '人员';
|
||||
$lang->dimension->modules['effort'] = '工时';
|
||||
$lang->dimension->modules['timelimit'] = '工期';
|
||||
$lang->dimension->modules['progress'] = '进度';
|
||||
$lang->dimension->modules['testcase'] = $lang->testcase->common;
|
||||
$lang->dimension->modules['behavior'] = '行为';
|
||||
|
||||
@@ -50,6 +50,7 @@ $config->doc->spaceMethod['mine'] = 'myspace';
|
||||
$config->doc->spaceMethod['view'] = 'myspace';
|
||||
$config->doc->spaceMethod['collect'] = 'myspace';
|
||||
$config->doc->spaceMethod['createdby'] = 'myspace';
|
||||
$config->doc->spaceMethod['editedby'] = 'myspace';
|
||||
$config->doc->spaceMethod['product'] = 'productspace';
|
||||
$config->doc->spaceMethod['project'] = 'projectspace';
|
||||
$config->doc->spaceMethod['execution'] = 'projectspace';
|
||||
|
||||
+47
-33
@@ -158,6 +158,7 @@ class doc extends control
|
||||
|
||||
if($type == 'execution' and $this->post->execution) $objectID = $this->post->execution;
|
||||
if($type == 'custom') $objectID = 0;
|
||||
$type = $type == 'execution' && $this->app->tab != 'execution' ? 'project' : $type;
|
||||
|
||||
$this->action->create('docLib', $libID, 'Created');
|
||||
|
||||
@@ -185,7 +186,6 @@ class doc extends control
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($type == 'execution')
|
||||
{
|
||||
$objects = $this->execution->getPairs(0, 'sprint,stage', 'multiple,leaf,noprefix,withobject');
|
||||
@@ -328,7 +328,7 @@ class doc extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteLib($libID, $confirm = 'no', $type = 'lib', $from = 'tableContents')
|
||||
public function deleteLib($libID, $confirm = 'no', $type = 'lib', $from = 'teamSpace')
|
||||
{
|
||||
if($libID == 'product' or $libID == 'execution') return;
|
||||
if($confirm == 'no')
|
||||
@@ -341,16 +341,18 @@ class doc extends control
|
||||
if(!empty($lib->main)) return print(js::alert($this->lang->doc->errorMainSysLib));
|
||||
|
||||
$this->doc->delete(TABLE_DOCLIB, $libID);
|
||||
if($this->app->tab == 'doc' and $from == 'tableContents') return print(js::reload('parent'));
|
||||
if($this->app->tab == 'doc' and $from == 'teamSpace') 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')
|
||||
$moduleName = 'doc';
|
||||
$methodName = zget($this->config->doc->spaceMethod, $objectType);
|
||||
if($this->app->tab == 'execution' and $objectType == 'execution')
|
||||
{
|
||||
$objectType = 'project';
|
||||
$objectID = $lib->project;
|
||||
$moduleName = 'execution';
|
||||
$methodName = 'doc';
|
||||
}
|
||||
$browseLink = $this->createLink('doc', $from, "type=$objectType&objectID=$objectID");
|
||||
$browseLink = $this->createLink($moduleName, $methodName, "objectID=$objectID");
|
||||
|
||||
return print(js::locate($browseLink, 'parent'));
|
||||
}
|
||||
@@ -540,17 +542,17 @@ class doc extends control
|
||||
if(!empty($changes))
|
||||
{
|
||||
$newType = $_POST['status'];
|
||||
if($doc->status == 'draft' and $newType == 'draft') $action = 'savedDraft';
|
||||
if($doc->status == 'draft' and $newType == 'normal') $action = 'releasedDoc';
|
||||
if($doc->status == 'normal' and $newType == 'normal') $action = 'Edited';
|
||||
if($doc->status == $newType) $action = 'Edited';
|
||||
}
|
||||
|
||||
$fileAction = '';
|
||||
if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n";
|
||||
$actionID = $this->action->create('doc', $docID, $action, $fileAction . $this->post->comment);
|
||||
if(!empty($changes)) $this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$link = $this->createLink('doc', 'view', "docID={$docID}") . "#app={$this->app->tab}";
|
||||
$link = $this->createLink('doc', 'view', "docID={$docID}");
|
||||
$oldLib = $doc->lib;
|
||||
$doc = $this->doc->getById($docID);
|
||||
$lib = $this->doc->getLibById($doc->lib);
|
||||
@@ -1052,7 +1054,7 @@ class doc extends control
|
||||
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);
|
||||
$objects = $this->doc->getOrderedObjects($type, 'nomerge', $objectID);
|
||||
list($libs, $libID, $object, $objectID, $objectDropdown) = $this->doc->setMenuByType($type, $objectID, 0);
|
||||
|
||||
$table = $this->config->objectTables[$type];
|
||||
@@ -1143,8 +1145,6 @@ class doc extends control
|
||||
$objectID = zget($doc, $type, 0);
|
||||
list($libs, $libID, $object, $objectID, $objectDropdown) = $this->doc->setMenuByType($type, $objectID, $doc->lib, $appendLib);
|
||||
|
||||
$moduleTree = $this->doc->getTreeMenu($type, $objectID, $libID, 0, $docID);
|
||||
|
||||
/* Get doc. */
|
||||
if($docID)
|
||||
{
|
||||
@@ -1221,26 +1221,9 @@ class doc extends control
|
||||
}
|
||||
}
|
||||
|
||||
$doc = $docID ? $doc : '';
|
||||
if($this->app->tab != 'execution' and !empty($doc->execution)) $object = $this->execution->getByID($doc->execution);
|
||||
|
||||
/* Crumbs links array. */
|
||||
$moduleName = 'doc';
|
||||
$methodName = in_array($type, array('product', 'project')) ? $objectType . 'Space' : 'teamSpace';
|
||||
$linkParams = "objectID={$objectID}&libID={$lib->id}";
|
||||
if($this->app->tab == 'execution')
|
||||
{
|
||||
$moduleName = 'execution';
|
||||
$methodName = 'doc';
|
||||
$linkParams = "executionID=$objectID";
|
||||
}
|
||||
elseif($type == 'mine')
|
||||
{
|
||||
$linkParams = "type=mine&libID={$lib->id}";
|
||||
$methodName = 'mySpace';
|
||||
}
|
||||
|
||||
$spaceType = $objectType . 'Space';
|
||||
$this->view->title = isset($this->lang->doc->{$spaceType}) ? $this->lang->doc->{$spaceType} : $this->lang->doc->common;
|
||||
$this->view->title = $this->lang->doc->common . $this->lang->colon . $doc->title;
|
||||
$this->view->docID = $docID;
|
||||
$this->view->doc = $doc;
|
||||
$this->view->version = $version;
|
||||
@@ -1261,6 +1244,7 @@ class doc extends control
|
||||
$this->view->objectDropdown = $objectDropdown;
|
||||
$this->view->canExport = ($this->config->edition != 'open' && common::hasPriv('doc', $type . '2export'));
|
||||
$this->view->exportMethod = $type . '2export';
|
||||
$this->view->editors = $this->doc->getEditors($docID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -1289,6 +1273,15 @@ class doc extends control
|
||||
$this->session->set('spaceType', $type, 'doc');
|
||||
$this->session->set('docList', $uri, 'doc');
|
||||
|
||||
$docSpaceParam = new stdclass();
|
||||
$docSpaceParam->type = $type;
|
||||
$docSpaceParam->objectID = $objectID;
|
||||
$docSpaceParam->libID = $libID;
|
||||
$docSpaceParam->moduleID = $moduleID;
|
||||
$docSpaceParam->browseType = $browseType;
|
||||
$docSpaceParam->param = $param;
|
||||
setCookie("docSpaceParam", json_encode($docSpaceParam), $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
|
||||
if($moduleID) $libID = $this->tree->getById($moduleID)->root;
|
||||
$isFirstLoad = $libID == 0 ? true : false;
|
||||
if(empty($browseType)) $browseType = 'all';
|
||||
@@ -1489,7 +1482,7 @@ class doc extends control
|
||||
*/
|
||||
public function ajaxGetDropMenu($objectType, $objectID, $module, $method)
|
||||
{
|
||||
list($myObjects, $normalObjects, $closedObjects) = $this->doc->getOrderedObjects($objectType, 'nomerge');
|
||||
list($myObjects, $normalObjects, $closedObjects) = $this->doc->getOrderedObjects($objectType, 'nomerge', $objectID);
|
||||
|
||||
$this->view->objectType = $objectType;
|
||||
$this->view->objectID = $objectID;
|
||||
@@ -1566,4 +1559,25 @@ class doc extends control
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Catalog sort.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function sortCatalog()
|
||||
{
|
||||
if($_SERVER['REQUEST_METHOD'] == 'POST')
|
||||
{
|
||||
foreach($_POST['orders'] as $id => $order)
|
||||
{
|
||||
$this->dao->update(TABLE_MODULE)->set('`order`')->eq($order)->where('id')->eq($id)->andWhere('type')->eq('doc')->exec();
|
||||
}
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success'));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
.drop-title {padding: 0 15px!important;}
|
||||
.split-row > .side-col,
|
||||
.split-row > .main-col {padding: 0;}
|
||||
.col-spliter {width: 20px; position: relative; z-index: 10; cursor: ew-resize;}
|
||||
@@ -107,6 +108,7 @@ ol, ul {margin-bottom: 0}
|
||||
#pageNav #dropMenu .table-col .list-group .icon-move {display:block; float: left; font-size: 12px; padding: 3px 4px 3px 1px;}
|
||||
|
||||
#content .detail-content.article-content {overflow-y: auto; height: calc(100vh - 200px); padding-right: 20px;}
|
||||
#content.scrollbar-hover .detail-content.article-content {height: 100%;}
|
||||
#aclBox .acl-tip {color: #838a9d;}
|
||||
.ajaxCollect > img.star-empty {margin-right: 0px;}
|
||||
#outlineMenu {background: #fff; position: absolute; height: calc(100vh - 180px)!important; overflow-y: auto; top: 50px; right: 25px;}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
.modal-dialog {width: 75%;}
|
||||
form {margin-bottom: 50px;}
|
||||
table {width: 90% !important;}
|
||||
#mainContent table th {width: 70px;}
|
||||
|
||||
#whiteListBox div.input-group {margin-bottom: 2px;}
|
||||
|
||||
#groups_chosen.chosen-container .chosen-results, #users_chosen.chosen-container .chosen-results {max-height: 160px;}
|
||||
#aclBox > th {vertical-align: top; padding-top: 17px;}
|
||||
tr.executionBox > td {display: flex; width: 103%;}
|
||||
tr.executionBox > td > .icon-help {margin: 8px 0 0 5px;}
|
||||
|
||||
@@ -46,8 +46,9 @@ span.dotted-line+a {display: block;}
|
||||
.is-sorting > li ul {display: none!important;}
|
||||
li.drag-shadow ul {display: none!important;}
|
||||
|
||||
.table .c-name > .doc-title {display: inline-block; max-width: calc(100% - 80px); overflow: hidden; background: transparent; padding-right:0px;}
|
||||
.table .c-name > .doc-title {display: inline-block; overflow: hidden; background: transparent; padding-right:0px; max-width: calc(100% - 40px);}
|
||||
.table .c-name > span.doc-title {line-height: 0; vertical-align: inherit;}
|
||||
.table .c-name[data-status=draft] > .doc-title {max-width: calc(100% - 80px);}
|
||||
.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; padding: 0 6px;}
|
||||
table.table > thead > tr {height: 32px;}
|
||||
|
||||
+34
-4
@@ -8,7 +8,8 @@
|
||||
.main-col .doc-title .version .dropdown-menu a:hover {color: #ffffff;}
|
||||
.main-col .doc-title .actions a + a {margin-left: 0px;}
|
||||
.main-col .doc-title .actions i {font-size: 15px; color: #8c8c8c;}
|
||||
#content .title {max-width: 54%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
|
||||
#content .title {max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
|
||||
.main-col .doc-title .actions a > span {color: #9EA3B0;}
|
||||
#mainContent .scrollbar-hover {max-height: 2000px; overflow: scroll;}
|
||||
#content .editor-preview {background: #fff}
|
||||
#content .CodeMirror{border: none}
|
||||
@@ -22,17 +23,17 @@
|
||||
.article-content {margin-top: 0px}
|
||||
.article-content .info {margin-bottom: 15px; width:100%; overflow:hidden;}
|
||||
.article-content .info .user-time{margin-right: 4px}
|
||||
.article-content .info .keywords .label {padding-right:8px; padding-left:8px; color:#18A6FD; border-color:rgba(24, 166, 253, 0.25); height:22px; line-height:14px; margin-right:4px;}
|
||||
.article-content .info .keywords .label {padding: 2px 8px; color:#18A6FD; border-color:rgba(24, 166, 253, 0.25); height: 18px; line-height:14px; margin-right:4px;}
|
||||
|
||||
.article-content {width: 100%; display: inline-block;}
|
||||
.article-content img {margin: 0;}
|
||||
.article-content.comment .comment-content {width: 94%;}
|
||||
#outlineMenu {max-width: 200px;}
|
||||
#outlineMenu {max-width: 200px; overflow-x: auto;}
|
||||
#outlineMenu .tree li > a {text-overflow: clip;}
|
||||
.outline-toggle {position: absolute; right: 20px; top: 50px;}
|
||||
.outline-toggle i.icon-angle-right:before {content: "\e314"; cursor: pointer;}
|
||||
.outline-toggle i.icon-angle-left:before {content: "\e315"; cursor: pointer;}
|
||||
.outline-toggle {position: absolute; right: 55px; top: 50px;}
|
||||
.outline-toggle {position: absolute; right: 55px; top: 50px; background: #fff;}
|
||||
.outline ul li {list-style: none;}
|
||||
.outline-content {display: none; padding-top: 18px;}
|
||||
.outline-content a {color: #838A9D;}
|
||||
@@ -78,3 +79,32 @@
|
||||
#outlineMenu::-moz-scrollbar,
|
||||
#hostory::-moz-scrollbar {height: 0px; width: 0px; background: transparent;}
|
||||
.main-col iframe {min-height: unset;}
|
||||
|
||||
#editorBox > .btn-group.noDropdown {top: 2px; overflow: hidden;}
|
||||
#editorBox > .btn-group > button {margin: 2px 12px 0 4px; color: #838A9D;}
|
||||
#editorBox > .btn-group > span.text {color: #838A9D; font-weight: 400; padding: 5px 12px; overflow: hidden; text-overflow: clip; white-space: nowrap; font-size: 13px;}
|
||||
#editorMenu {max-height: 200px; overflow-y: auto; overflow-x: hidden; margin-left: 4px; max-width: 100%;}
|
||||
[lang^=zh] #editorMenu {max-width: calc(100% - 10px);}
|
||||
#editorMenu > li {color: #838A9D; font-weight: 400; padding: 5px 12px; text-overflow: clip; white-space: nowrap;}
|
||||
.doc-version-menu {padding: 10px 0;}
|
||||
#changeBtn > i {font-size: 24px;}
|
||||
|
||||
#docVersionMenu > .drop-body {max-height: 200px; overflow-y: auto;}
|
||||
#docVersionMenu > .drop-body > li.li-item {display: flex; position: relative;}
|
||||
#docVersionMenu > .drop-body > li.li-item > .checkbox-primary {display: none; position: absolute; top: 4px; left: 10px; width: 230px;}
|
||||
#docVersionMenu > .drop-body > li > a {flex: 1; padding-left: 20px; height: 30px; display: flex; align-items: center;}
|
||||
#docVersionMenu > .drop-bottom > button {margin-right: 10px; display: none;}
|
||||
|
||||
#docVersionMenu.diff > .drop-body > li.li-item > .checkbox-primary {display: unset!important;}
|
||||
#docVersionMenu.diff > .drop-body > li > a {padding-left:30px!important;}
|
||||
#docVersionMenu.diff > .drop-title > #changeBtn {opacity: 0;}
|
||||
#docVersionMenu.diff > .drop-bottom > button {display: unset!important;}
|
||||
|
||||
.user-time .icon-star {font-size: 12px; line-height: 1.8;}
|
||||
.user-time .icon-star:before {vertical-align: top;}
|
||||
.btn-limit {position: relative;}
|
||||
.btn-group {display: flex; align-items: center;}
|
||||
#exchangeDiffBtn {font-size: 24px;}
|
||||
.exchangeDiffGroup .right-dom {display: none;}
|
||||
.exchangeDiffGroup.show-diff .right-dom {display: unset;}
|
||||
.btn-limit {padding-left: 10px; padding-right: 20px;}
|
||||
|
||||
+11
-4
@@ -15,8 +15,10 @@ function loadObjectModules(objectType, objectID, docType)
|
||||
objectID = $('#project').val();
|
||||
}
|
||||
if(objectID == undefined) objectID = 0;
|
||||
var link = createLink('doc', 'ajaxGetModules', 'objectType=' + objectType + '&objectID=' + objectID + '&type=' + docType);
|
||||
$('#moduleBox').load(link, function(){$('#moduleBox').find('select').picker(); $('#moduleLabel').remove();});
|
||||
|
||||
var link = createLink('doc', 'ajaxGetModules', 'objectType=' + objectType + '&objectID=' + objectID + '&type=' + docType);
|
||||
var selected = $('#module').val();
|
||||
$('#moduleBox').load(link, function(){$('#moduleBox').find('select').val(selected).picker(); $('#moduleLabel').remove();});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -333,17 +335,23 @@ function locateNewLib(type, objectID, libID)
|
||||
{
|
||||
var method = 'teamSpace';
|
||||
var params = 'objectID=' + objectID + '&libID=' + libID;
|
||||
var module = 'doc';
|
||||
if(type == 'product' || type == 'project')
|
||||
{
|
||||
method = type + 'Space';
|
||||
}
|
||||
else if(type == 'execution')
|
||||
{
|
||||
module = 'execution';
|
||||
method = 'doc';
|
||||
}
|
||||
else if(type == 'mine')
|
||||
{
|
||||
method = 'mySpace';
|
||||
params = 'type=mine&libID=' + libID;
|
||||
}
|
||||
|
||||
location.href = createLink('doc', method, params);
|
||||
location.href = createLink(module, method, params);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -359,4 +367,3 @@ function submit(object)
|
||||
$('#dataform').submit();
|
||||
setTimeout(function(){$(object).attr('type', 'button').removeAttr('disabled')}, 2000);
|
||||
}
|
||||
|
||||
|
||||
+30
-28
@@ -136,6 +136,7 @@ document.addEventListener('msfullscreenChange', function (e)
|
||||
|
||||
$(function()
|
||||
{
|
||||
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
if($.cookie('isFullScreen') == 1)
|
||||
@@ -166,10 +167,35 @@ $(function()
|
||||
}).on('click', '.comment-edit-form .btn-hide-form', function()
|
||||
{
|
||||
$('.comment-edit-form #submit').attr('disabled', false);
|
||||
}).on('click', '#docVersionMenu.diff > .drop-body > li', function(e)
|
||||
{
|
||||
e.stopPropagation();
|
||||
}).on('click', '#docVersionMenu #changeBtn', function(e)
|
||||
{
|
||||
$('#docVersionMenu').addClass('diff');
|
||||
e.stopPropagation();
|
||||
}).on('click', '#hisTrigger', function()
|
||||
{
|
||||
var $history = $('#history');
|
||||
var $icon = $(this);
|
||||
if($history.hasClass('hidden'))
|
||||
{
|
||||
$history.removeClass('hidden');
|
||||
$icon.addClass('text-primary');
|
||||
}
|
||||
else
|
||||
{
|
||||
$history.addClass('hidden');
|
||||
$icon.removeClass('text-primary');
|
||||
}
|
||||
}).on('click', '#closeBtn', function()
|
||||
{
|
||||
$('#history').addClass('hidden');
|
||||
$('#hisTrigger').removeClass('text-primary');
|
||||
});
|
||||
|
||||
$('#outline li.has-list').addClass('open in');
|
||||
$('#outline li.has-list>i+ul').prev('i').remove();
|
||||
$('#outline li.has-list > i + ul').prev('i').remove();
|
||||
$('.outline-toggle i.icon-menu-arrow-left').trigger('click');
|
||||
|
||||
$(document).on('click', '.detail-content a', function(event)
|
||||
@@ -190,7 +216,7 @@ $(function()
|
||||
if($.cookie('isFullScreen') == 1) fullScreen();
|
||||
$('#content [data-ride="tree"]').tree();
|
||||
$('#outline li.has-list').addClass('open in');
|
||||
$('#outline li.has-list>i+ul').prev('i').remove();
|
||||
$('#outline li.has-list > i + ul').prev('i').remove();
|
||||
if($('#markdownContent').val())
|
||||
{
|
||||
var simplemde = new SimpleMDE({element: $("#markdownContent")[0],toolbar:false, status: false});
|
||||
@@ -198,37 +224,13 @@ $(function()
|
||||
simplemde.togglePreview();
|
||||
}
|
||||
$('#docExport').attr('href', createLink('doc', exportMethod, 'libID=' + libID + '&moduleID=0&docID=' + docID + '&version=' + $('#content .doc-title .version').data('version')));
|
||||
if($('.files-list').length) $('#content .detail-content.article-content').css('height', 'calc(100vh - 300px)');
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
$('#history').append('<a id="closeBtn" href="###" class="btn btn-link"><i class="icon icon-close"></i></a>');
|
||||
$('#hisTrigger').on('click', function()
|
||||
{
|
||||
var $history = $('#history');
|
||||
var $icon = $(this);
|
||||
if($history.hasClass('hidden'))
|
||||
{
|
||||
$history.removeClass('hidden');
|
||||
$icon.addClass('text-primary');
|
||||
}
|
||||
else
|
||||
{
|
||||
$history.addClass('hidden');
|
||||
$icon.removeClass('text-primary');
|
||||
}
|
||||
})
|
||||
|
||||
$('#history').find('.btn.pull-right').removeClass('pull-right');
|
||||
$('#closeBtn').on('click', function()
|
||||
{
|
||||
$('#history').addClass('hidden');
|
||||
$('#hisTrigger').removeClass('text-primary');
|
||||
})
|
||||
$('#history').find('.btn.pull-right').removeClass('pull-right');
|
||||
if($('.files-list').length)
|
||||
{
|
||||
$('#content .detail-content.article-content').css('height', 'calc(100vh - 300px)');
|
||||
}
|
||||
if($('.files-list').length) $('#content .detail-content.article-content').css('height', 'calc(100vh - 300px)');
|
||||
$('.outline .outline-toggle i.icon-menu-arrow-left').trigger("click");
|
||||
})
|
||||
|
||||
@@ -86,6 +86,7 @@ $lang->doc->addedByAB = 'CreatedBy';
|
||||
$lang->doc->addedDate = 'CreatedDate';
|
||||
$lang->doc->editedBy = 'Bearbeitet von';
|
||||
$lang->doc->editedDate = 'UpdatedDate';
|
||||
$lang->doc->editingDate = 'Editing user and time';
|
||||
$lang->doc->lastEditedBy = 'Last Editor';
|
||||
$lang->doc->version = 'Version';
|
||||
$lang->doc->basicInfo = 'Basis Info';
|
||||
@@ -125,11 +126,13 @@ $lang->doc->position = 'Position';
|
||||
$lang->doc->person = 'Person';
|
||||
$lang->doc->team = 'Team';
|
||||
$lang->doc->manage = 'Document Management';
|
||||
$lang->doc->release = 'Release';
|
||||
|
||||
$lang->doc->moduleDoc = 'Nach Modulen';
|
||||
$lang->doc->searchDoc = 'Suche';
|
||||
$lang->doc->fast = 'Schnelleintrag';
|
||||
$lang->doc->allDoc = 'Alle Doks';
|
||||
$lang->doc->allVersion = 'All Versions';
|
||||
$lang->doc->openedByMe = 'Meine';
|
||||
$lang->doc->editedByMe = 'Edited By Me';
|
||||
$lang->doc->orderByOpen = 'Zuletzt hinzugefügt';
|
||||
@@ -147,6 +150,7 @@ $lang->doc->tableContents = 'Catalog';
|
||||
$lang->doc->addCatalog = 'Add Catalog';
|
||||
$lang->doc->editCatalog = 'Edit Catalog';
|
||||
$lang->doc->deleteCatalog = 'Delete Catalog';
|
||||
$lang->doc->sortCatalog = 'Catalog Sorting';
|
||||
$lang->doc->docStatistic = 'Statistic';
|
||||
$lang->doc->docCreated = 'Created Documents';
|
||||
$lang->doc->docEdited = 'Edited Documents';
|
||||
@@ -156,6 +160,8 @@ $lang->doc->todayUpdated = "Today's update";
|
||||
$lang->doc->daysUpdated = 'Updated %s days ago';
|
||||
$lang->doc->monthsUpdated = 'Updated %s months ago';
|
||||
$lang->doc->yearsUpdated = 'Updated %s years ago';
|
||||
$lang->doc->viewCount = '%s Visits';
|
||||
$lang->doc->collectCount = '%s Collections';
|
||||
|
||||
/* Methods list */
|
||||
$lang->doc->index = 'Dashboard';
|
||||
@@ -167,6 +173,7 @@ $lang->doc->createBook = 'Create Book';
|
||||
$lang->doc->browse = 'Liste';
|
||||
$lang->doc->view = 'Details';
|
||||
$lang->doc->diff = 'Diff';
|
||||
$lang->doc->cancelDiff = 'Cancel diff';
|
||||
$lang->doc->diffAction = 'Diff Document';
|
||||
$lang->doc->sort = 'Sortierung';
|
||||
$lang->doc->manageType = 'Kategorie verwalten';
|
||||
|
||||
@@ -86,6 +86,7 @@ $lang->doc->addedByAB = 'CreatedBy';
|
||||
$lang->doc->addedDate = 'CreatedDate';
|
||||
$lang->doc->editedBy = 'UpdatedBy';
|
||||
$lang->doc->editedDate = 'UpdatedDate';
|
||||
$lang->doc->editingDate = 'Editing user and time';
|
||||
$lang->doc->lastEditedBy = 'Last Editor';
|
||||
$lang->doc->version = 'Version';
|
||||
$lang->doc->basicInfo = 'Basic Information';
|
||||
@@ -125,11 +126,13 @@ $lang->doc->position = 'Position';
|
||||
$lang->doc->person = 'Person';
|
||||
$lang->doc->team = 'Team';
|
||||
$lang->doc->manage = 'Document Management';
|
||||
$lang->doc->release = 'Release';
|
||||
|
||||
$lang->doc->moduleDoc = 'By Module';
|
||||
$lang->doc->searchDoc = 'Search';
|
||||
$lang->doc->fast = 'Quick Entry';
|
||||
$lang->doc->allDoc = 'All Documents';
|
||||
$lang->doc->allVersion = 'All Versions';
|
||||
$lang->doc->openedByMe = 'My';
|
||||
$lang->doc->editedByMe = 'Edited By Me';
|
||||
$lang->doc->orderByOpen = 'Recent Added';
|
||||
@@ -147,6 +150,7 @@ $lang->doc->tableContents = 'Directory';
|
||||
$lang->doc->addCatalog = 'Add Catalog';
|
||||
$lang->doc->editCatalog = 'Edit Catalog';
|
||||
$lang->doc->deleteCatalog = 'Delete Catalog';
|
||||
$lang->doc->sortCatalog = 'Catalog Sorting';
|
||||
$lang->doc->docStatistic = 'Statistic';
|
||||
$lang->doc->docCreated = 'Created Documents';
|
||||
$lang->doc->docEdited = 'Edited Documents';
|
||||
@@ -156,6 +160,8 @@ $lang->doc->todayUpdated = "Today's update";
|
||||
$lang->doc->daysUpdated = 'Updated %s days ago';
|
||||
$lang->doc->monthsUpdated = 'Updated %s months ago';
|
||||
$lang->doc->yearsUpdated = 'Updated %s years ago';
|
||||
$lang->doc->viewCount = '%s Visits';
|
||||
$lang->doc->collectCount = '%s Collections';
|
||||
|
||||
/* Methods list */
|
||||
$lang->doc->index = 'Dashboard';
|
||||
@@ -167,6 +173,7 @@ $lang->doc->createBook = 'Create Book';
|
||||
$lang->doc->browse = 'Document List';
|
||||
$lang->doc->view = 'Document Detail';
|
||||
$lang->doc->diff = 'Diff';
|
||||
$lang->doc->cancelDiff = 'Cancel diff';
|
||||
$lang->doc->diffAction = 'Diff Document';
|
||||
$lang->doc->sort = 'Rank Document';
|
||||
$lang->doc->manageType = 'Manage Category';
|
||||
|
||||
@@ -86,6 +86,7 @@ $lang->doc->addedByAB = 'CreatedBy';
|
||||
$lang->doc->addedDate = 'CreatedDate';
|
||||
$lang->doc->editedBy = 'Màj par';
|
||||
$lang->doc->editedDate = 'UpdatedDate';
|
||||
$lang->doc->editingDate = 'Editing user and time';
|
||||
$lang->doc->lastEditedBy = 'Last Editor';
|
||||
$lang->doc->version = 'Version';
|
||||
$lang->doc->basicInfo = 'Infos de Base';
|
||||
@@ -125,11 +126,13 @@ $lang->doc->position = 'Position';
|
||||
$lang->doc->person = 'Person';
|
||||
$lang->doc->team = 'Team';
|
||||
$lang->doc->manage = 'Document Management';
|
||||
$lang->doc->release = 'Release';
|
||||
|
||||
$lang->doc->moduleDoc = 'Par Module';
|
||||
$lang->doc->searchDoc = 'Rechercher';
|
||||
$lang->doc->fast = 'Saisie rapide';
|
||||
$lang->doc->allDoc = 'Tous les Documents';
|
||||
$lang->doc->allVersion = 'All Versions';
|
||||
$lang->doc->openedByMe = 'Mes';
|
||||
$lang->doc->editedByMe = 'Edited By Me';
|
||||
$lang->doc->orderByOpen = 'Récemment Ajoutés';
|
||||
@@ -147,6 +150,7 @@ $lang->doc->tableContents = 'Catalog';
|
||||
$lang->doc->addCatalog = 'Add Catalog';
|
||||
$lang->doc->editCatalog = 'Edit Catalog';
|
||||
$lang->doc->deleteCatalog = 'Delete Catalog';
|
||||
$lang->doc->sortCatalog = 'Catalog Sorting';
|
||||
$lang->doc->docStatistic = 'Statistic';
|
||||
$lang->doc->docCreated = 'Created Documents';
|
||||
$lang->doc->docEdited = 'Edited Documents';
|
||||
@@ -156,6 +160,8 @@ $lang->doc->todayUpdated = "Today's update";
|
||||
$lang->doc->daysUpdated = 'Updated %s days ago';
|
||||
$lang->doc->monthsUpdated = 'Updated %s months ago';
|
||||
$lang->doc->yearsUpdated = 'Updated %s years ago';
|
||||
$lang->doc->viewCount = '%s Visits';
|
||||
$lang->doc->collectCount = '%s Collections';
|
||||
|
||||
/* Methods list */
|
||||
$lang->doc->index = 'Dashboard';
|
||||
@@ -167,6 +173,7 @@ $lang->doc->createBook = 'Create Book';
|
||||
$lang->doc->browse = 'Liste Documents';
|
||||
$lang->doc->view = 'Détail Document';
|
||||
$lang->doc->diff = 'Diff';
|
||||
$lang->doc->cancelDiff = 'Cancel diff';
|
||||
$lang->doc->diffAction = 'Document Diff';
|
||||
$lang->doc->sort = 'Rang Document';
|
||||
$lang->doc->manageType = 'Gérer Catégories';
|
||||
|
||||
@@ -57,6 +57,7 @@ $lang->doc->moduleDoc = 'By Module';
|
||||
$lang->doc->searchDoc = 'Tìm kiếm';
|
||||
$lang->doc->fast = 'Quick Entry';
|
||||
$lang->doc->allDoc = 'Tất cả tài liệu';
|
||||
$lang->doc->allVersion = 'All Versions';
|
||||
$lang->doc->openedByMe = 'Của bạn';
|
||||
$lang->doc->editedByMe = 'Edited By Me';
|
||||
$lang->doc->orderByOpen = 'Recent Added';
|
||||
@@ -78,6 +79,7 @@ $lang->doc->createBook = 'Create Book';
|
||||
$lang->doc->browse = 'Document danh sách';
|
||||
$lang->doc->view = 'Document Detail';
|
||||
$lang->doc->diff = 'Diff';
|
||||
$lang->doc->cancelDiff = 'Cancel diff';
|
||||
$lang->doc->diffAction = 'Diff tài liệu';
|
||||
$lang->doc->sort = 'Đánh giá tài liệu';
|
||||
$lang->doc->manageType = 'Quản lý danh mục';
|
||||
|
||||
@@ -60,7 +60,7 @@ $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->doclib->apiNameUnique['nolink'] = '独立接口库中';
|
||||
|
||||
/* 字段列表。*/
|
||||
$lang->doc->common = '文档';
|
||||
@@ -86,6 +86,7 @@ $lang->doc->addedByAB = '创建者';
|
||||
$lang->doc->addedDate = '创建日期';
|
||||
$lang->doc->editedBy = '修改者';
|
||||
$lang->doc->editedDate = '修改日期';
|
||||
$lang->doc->editingDate = '正在修改者和时间';
|
||||
$lang->doc->lastEditedBy = '最后更新者';
|
||||
$lang->doc->version = '版本号';
|
||||
$lang->doc->basicInfo = '基本信息';
|
||||
@@ -125,11 +126,13 @@ $lang->doc->position = '所在位置';
|
||||
$lang->doc->person = '个人';
|
||||
$lang->doc->team = '团队';
|
||||
$lang->doc->manage = '文档管理';
|
||||
$lang->doc->release = '发布';
|
||||
|
||||
$lang->doc->moduleDoc = '按模块浏览';
|
||||
$lang->doc->searchDoc = '搜索';
|
||||
$lang->doc->fast = '快速访问';
|
||||
$lang->doc->allDoc = '全部文档';
|
||||
$lang->doc->allVersion = '全部版本';
|
||||
$lang->doc->openedByMe = '我的创建';
|
||||
$lang->doc->editedByMe = '我的编辑';
|
||||
$lang->doc->orderByOpen = '最近添加';
|
||||
@@ -147,6 +150,7 @@ $lang->doc->tableContents = '目录';
|
||||
$lang->doc->addCatalog = '添加目录';
|
||||
$lang->doc->editCatalog = '编辑目录';
|
||||
$lang->doc->deleteCatalog = '删除目录';
|
||||
$lang->doc->sortCatalog = '目录排序';
|
||||
$lang->doc->docStatistic = '文档统计';
|
||||
$lang->doc->docCreated = '创建的文档';
|
||||
$lang->doc->docEdited = '编辑的文档';
|
||||
@@ -156,6 +160,8 @@ $lang->doc->todayUpdated = '今天更新';
|
||||
$lang->doc->daysUpdated = '%s天前更新';
|
||||
$lang->doc->monthsUpdated = '%s月前更新';
|
||||
$lang->doc->yearsUpdated = '%s年前更新';
|
||||
$lang->doc->viewCount = '%s次浏览';
|
||||
$lang->doc->collectCount = '%s次收藏';
|
||||
|
||||
/* 方法列表。*/
|
||||
$lang->doc->index = '仪表盘';
|
||||
@@ -167,6 +173,7 @@ $lang->doc->createBook = '创建手册';
|
||||
$lang->doc->browse = '文档列表';
|
||||
$lang->doc->view = '文档详情';
|
||||
$lang->doc->diff = '对比';
|
||||
$lang->doc->cancelDiff = '取消对比';
|
||||
$lang->doc->diffAction = '对比文档';
|
||||
$lang->doc->sort = '文档排序';
|
||||
$lang->doc->manageType = '维护目录';
|
||||
@@ -244,7 +251,7 @@ $lang->doc->spaceList['custom'] = '团队空间';
|
||||
$lang->doc->apiType = '接口类型';
|
||||
$lang->doc->apiTypeList['product'] = $lang->productCommon . '接口';
|
||||
$lang->doc->apiTypeList['project'] = $lang->projectCommon . '接口';
|
||||
$lang->doc->apiTypeList['nolink'] = '无关联接口';
|
||||
$lang->doc->apiTypeList['nolink'] = '独立接口';
|
||||
|
||||
$lang->doc->typeList['html'] = '富文本';
|
||||
$lang->doc->typeList['markdown'] = 'Markdown';
|
||||
|
||||
+120
-42
@@ -411,6 +411,7 @@ class docModel extends model
|
||||
}
|
||||
|
||||
$query = $this->getDocQuery($this->session->contributeDocQuery);
|
||||
$query = preg_replace('/(`\w+`)/', 't1.$1', $query);
|
||||
$docIDList = $this->dao->select('objectID')->from(TABLE_ACTION)
|
||||
->where('objectType')->eq('doc')
|
||||
->andWhere('objectID')->in($hasPrivDocIdList)
|
||||
@@ -422,6 +423,7 @@ class docModel extends model
|
||||
->where('t1.deleted')->eq(0)
|
||||
->andWhere($query)
|
||||
->andWhere('t1.lib')->in($allLibIDList)
|
||||
->andWhere('t1.vision')->in($this->config->vision)
|
||||
->beginIF($this->config->doc->notArticleType)->andWhere('t1.type')->notIN($this->config->doc->notArticleType)->fi()
|
||||
->andWhere('t1.addedBy', 1)->eq($this->app->user->account)
|
||||
->orWhere('t1.id')->in(array_keys($docIDList))
|
||||
@@ -439,6 +441,7 @@ class docModel extends model
|
||||
->andWhere('t1.id')->in($hasPrivDocIdList)
|
||||
->beginIF($this->config->doc->notArticleType)->andWhere('t1.type')->notIN($this->config->doc->notArticleType)->fi()
|
||||
->andWhere('t1.addedBy')->eq($this->app->user->account)
|
||||
->andWhere('t1.vision')->in($this->config->vision)
|
||||
->orderBy($sort)
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
@@ -457,6 +460,7 @@ class docModel extends model
|
||||
->where('t1.deleted')->eq(0)
|
||||
->andWhere('t1.id')->in(array_keys($docIDList))
|
||||
->andWhere('t1.lib')->in($allLibIDList)
|
||||
->andWhere('t1.vision')->in($this->config->vision)
|
||||
->beginIF($this->config->doc->notArticleType)->andWhere('t1.type')->notIN($this->config->doc->notArticleType)->fi()
|
||||
->orderBy($sort)
|
||||
->page($pager)
|
||||
@@ -469,6 +473,7 @@ class docModel extends model
|
||||
->andWhere('id')->in($hasPrivDocIdList)
|
||||
->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi()
|
||||
->andWhere('lib')->in($allLibIDList)
|
||||
->andWhere('vision')->in($this->config->vision)
|
||||
->orderBy('editedDate_desc')
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
@@ -482,6 +487,7 @@ class docModel extends model
|
||||
->andWhere('t1.id')->in($hasPrivDocIdList)
|
||||
->beginIF($this->config->doc->notArticleType)->andWhere('t1.type')->notIN($this->config->doc->notArticleType)->fi()
|
||||
->andWhere('t2.actor')->eq($this->app->user->account)
|
||||
->andWhere('t1.vision')->in($this->config->vision)
|
||||
->orderBy($sort)
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
@@ -633,8 +639,6 @@ class docModel extends model
|
||||
$query = preg_replace('/(`\w+`)/', 't1.$1', $query);
|
||||
}
|
||||
|
||||
$libs = $this->getLibs();
|
||||
$docIDList = $this->getPrivDocs(array_keys($libs));
|
||||
if($type == 'view' or $type == 'collect')
|
||||
{
|
||||
$docs = $this->dao->select('t1.*,t3.name as libName,t3.type as objectType,max(t2.`date`) as date')->from(TABLE_DOC)->alias('t1')
|
||||
@@ -643,7 +647,6 @@ class docModel extends model
|
||||
->where('t1.deleted')->eq(0)
|
||||
->andWhere('t1.lib')->ne('')
|
||||
->andWhere('t1.vision')->eq($this->config->vision)
|
||||
->andWhere('t1.id')->in(array_keys($docIDList))
|
||||
->andWhere('t2.action')->eq($type)
|
||||
->andWhere('t2.actor')->eq($this->app->user->account)
|
||||
->beginIF(!common::hasPriv('doc', 'productSpace'))->andWhere('t3.type')->ne('product')->fi()
|
||||
@@ -659,26 +662,24 @@ class docModel extends model
|
||||
}
|
||||
elseif($type == 'createdby' || $type == 'editedby')
|
||||
{
|
||||
$docIDList = array_keys($docIDList);
|
||||
$docIdList = array();
|
||||
if($type == 'editedby')
|
||||
{
|
||||
$editDocs = $this->dao->select('objectID')->from(TABLE_ACTION)
|
||||
$docIdList = $this->dao->select('objectID')->from(TABLE_ACTION)
|
||||
->where('objectType')->eq('doc')
|
||||
->andWhere('action')->eq('edited')
|
||||
->andWhere('action')->in('edited')
|
||||
->andWhere('actor')->eq($this->app->user->account)
|
||||
->andWhere('vision')->eq($this->config->vision)
|
||||
->fetchPairs();
|
||||
|
||||
$docIDList = array_intersect($docIDList, $editDocs);
|
||||
}
|
||||
|
||||
$docs = $this->dao->select('t1.*,t2.name as libName,t2.type as objectType')->from(TABLE_DOC)->alias('t1')
|
||||
->leftJoin(TABLE_DOCLIB)->alias('t2')->on("t1.lib=t2.id")
|
||||
->where('t1.deleted')->eq(0)
|
||||
->andWhere('t1.lib')->ne('')
|
||||
->andWhere('t1.id')->in($docIDList)
|
||||
->andWhere('t1.vision')->eq($this->config->vision)
|
||||
->andWhere('t1.addedBy')->eq($this->app->user->account)
|
||||
->beginIF($type == 'createdby')->andWhere('t1.addedBy')->eq($this->app->user->account)->fi()
|
||||
->beginIF($type == 'editedby')->andWhere('t1.id')->in($docIdList)->fi()
|
||||
->beginIF(!common::hasPriv('doc', 'productSpace'))->andWhere('t2.type')->ne('product')->fi()
|
||||
->beginIF(!common::hasPriv('doc', 'projectSpace'))->andWhere('t2.type')->notIN('project,execution')->fi()
|
||||
->beginIF(!common::hasPriv('doc', 'teamSpace'))->andWhere('t2.type')->ne('custom')->fi()
|
||||
@@ -729,7 +730,7 @@ class docModel extends model
|
||||
{
|
||||
$modules = $module && $mode == 'children' ? $this->loadModel('tree')->getAllChildID($module) : $module;
|
||||
$stmt = $this->dao->select('*')->from(TABLE_DOC)
|
||||
->where('1=1')
|
||||
->where('vision')->eq($this->config->vision)
|
||||
->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()
|
||||
@@ -737,7 +738,7 @@ class docModel extends model
|
||||
->query();
|
||||
|
||||
$docIdList = array();
|
||||
while ($doc = $stmt->fetch())
|
||||
while($doc = $stmt->fetch())
|
||||
{
|
||||
if($this->checkPrivDoc($doc)) $docIdList[$doc->id] = $doc->id;
|
||||
}
|
||||
@@ -768,6 +769,19 @@ class docModel extends model
|
||||
$version = $version ? $version : $doc->version;
|
||||
$docContent = $this->dao->select('*')->from(TABLE_DOCCONTENT)->where('doc')->eq($doc->id)->andWhere('version')->eq($version)->fetch();
|
||||
|
||||
$doc->releasedBy = '';
|
||||
$doc->releasedDate = '';
|
||||
if($doc->status == 'normal')
|
||||
{
|
||||
$releaseInfo = $this->dao->select('*')->from(TABLE_ACTION)
|
||||
->where('objectType')->eq('doc')
|
||||
->andWhere('objectID')->eq($docID)
|
||||
->andWhere('action')->eq('releaseddoc')
|
||||
->fetch();
|
||||
$doc->releasedBy = $releaseInfo ? $releaseInfo->actor : $doc->addedBy;
|
||||
$doc->releasedDate = $releaseInfo ? $releaseInfo->date : $doc->addedDate;
|
||||
}
|
||||
|
||||
/* When file change then version add one. */
|
||||
$files = $this->loadModel('file')->getByObject('doc', $docID);
|
||||
$docFiles = array();
|
||||
@@ -1113,7 +1127,7 @@ class docModel extends model
|
||||
unset($this->config->doc->search['fields']['execution']);
|
||||
}
|
||||
|
||||
if(in_array($type, array('view', 'collect', 'createdby'))) $libPairs = array('' => '') + $this->getLibs('all', 'withObject');
|
||||
if(in_array($type, array('view', 'collect', 'createdby', 'editedby'))) $libPairs = array('' => '') + $this->getLibs('all', 'withObject');
|
||||
|
||||
$this->config->doc->search['module'] = $queryName;
|
||||
$this->config->doc->search['params']['lib']['values'] = $libPairs + array('all' => $this->lang->doclib->all);
|
||||
@@ -1321,8 +1335,9 @@ class docModel extends model
|
||||
if($object->status == 'draft' and $object->addedBy != $this->app->user->account) return false;
|
||||
if($object->status == 'normal' and $this->app->user->admin) return true;
|
||||
|
||||
$lib = $this->getLibById($object->lib);
|
||||
if(!$this->checkPrivLib($lib)) return false;
|
||||
static $libs = array();
|
||||
if(!isset($libs[$object->lib])) $libs[$object->lib] = $this->getLibById($object->lib);
|
||||
if(!$this->checkPrivLib($libs[$object->lib])) return false;
|
||||
if(in_array($object->acl, array('open', 'public'))) return true;
|
||||
|
||||
$account = ",{$this->app->user->account},";
|
||||
@@ -1663,15 +1678,17 @@ class docModel extends model
|
||||
*
|
||||
* @param string $objectType
|
||||
* @param string $returnType nomerge|merge
|
||||
* @param int $append
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getOrderedObjects($objectType = 'product', $returnType = 'merge')
|
||||
public function getOrderedObjects($objectType = 'product', $returnType = 'merge', $append = 0)
|
||||
{
|
||||
$myObjects = $normalObjects = $closedObjects = array();
|
||||
if($objectType == 'product')
|
||||
{
|
||||
$products = $this->loadModel('product')->getList();
|
||||
if($append and !isset($products[$append])) $products[$append] = $this->product->getByID($append);
|
||||
foreach($products as $id => $product)
|
||||
{
|
||||
if($product->status == 'normal' and $product->PO == $this->app->user->account)
|
||||
@@ -1703,8 +1720,9 @@ class docModel extends model
|
||||
->leftjoin(TABLE_DOCLIB)->alias('t2')->on('t2.project=t1.id')
|
||||
->where("CONCAT(',', t2.users, ',')")->like("%,{$this->app->user->account},%")
|
||||
->andWhere('t1.vision')->eq($this->config->vision)
|
||||
->beginIF($this->config->vision == 'rnd')->andWhere('model')->ne('kanban')->fi()
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->beginIF($this->config->vision == 'rnd')->andWhere('model')->ne('kanban')->fi()
|
||||
->beginIF($append)->orWhere('t1.id')->eq($append)->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->projects)->fi()
|
||||
->fetchPairs();
|
||||
}
|
||||
@@ -1715,6 +1733,7 @@ class docModel extends model
|
||||
->andWhere('deleted')->eq(0)
|
||||
->beginIF($this->config->vision == 'rnd')->andWhere('model')->ne('kanban')->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
|
||||
->beginIF($append)->orWhere('id')->eq($append)->fi()
|
||||
->orderBy('order_asc')
|
||||
->fetchAll('id');
|
||||
|
||||
@@ -1751,6 +1770,7 @@ class docModel extends model
|
||||
->andWhere('multiple')->eq('1')
|
||||
->andWhere('vision')->eq($this->config->vision)
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi()
|
||||
->beginIF($append)->orWhere('id')->eq($append)->fi()
|
||||
->orderBy('order_asc')
|
||||
->fetchAll('id');
|
||||
|
||||
@@ -2141,19 +2161,32 @@ class docModel extends model
|
||||
*/
|
||||
public function getStatisticInfo()
|
||||
{
|
||||
$allLibs = array_keys($this->getLibs('all'));
|
||||
$docIdList = $this->getPrivDocs($allLibs);
|
||||
$myDocList = $this->dao->select('id')->from(TABLE_DOC)->where('addedBy')->eq($this->app->user->account)->fetchPairs('id');
|
||||
|
||||
$today = date('Y-m-d');
|
||||
$statistic = $this->dao->select("count(id) as totalDocs, count(IF(editedDate like '{$today}%', 1, null)) as todayEditedDocs,
|
||||
count(IF(editedBy = '{$this->app->user->account}', 1, null)) as myEditedDocs, count(IF(addedBy = '{$this->app->user->account}', 1, null)) as myDocs")->from(TABLE_DOC)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('vision')->eq($this->config->vision)
|
||||
->andWhere('id')->in($docIdList)
|
||||
->fetch();
|
||||
$statistic = new stdclass();
|
||||
$statistic->totalDocs = $this->dao->select('count(*) as count')->from(TABLE_DOC)->where('deleted')->eq('0')->andWhere('vision')->eq($this->config->vision)->fetch('count');
|
||||
$statistic->todayEditedDocs = $this->dao->select('count(DISTINCT objectID) as count')->from(TABLE_ACTION)->alias('t1')
|
||||
->leftJoin(TABLE_DOC)->alias('t2')->on("t1.objectID=t2.id and t1.objectType='doc'")
|
||||
->where('t1.objectType')->eq('doc')
|
||||
->andWhere('t1.action')->eq('edited')
|
||||
->andWhere('t1.actor')->eq($this->app->user->account)
|
||||
->andWhere('t1.vision')->eq($this->config->vision)
|
||||
->andWhere('LEFT(t1.date, 10)')->eq($today)
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->fetch('count');
|
||||
$statistic->myEditedDocs = $this->dao->select('count(DISTINCT objectID) as count')->from(TABLE_ACTION)->alias('t1')
|
||||
->leftJoin(TABLE_DOC)->alias('t2')->on("t1.objectID=t2.id and t1.objectType='doc'")
|
||||
->where('t1.objectType')->eq('doc')
|
||||
->andWhere('t1.action')->eq('edited')
|
||||
->andWhere('t1.actor')->eq($this->app->user->account)
|
||||
->andWhere('t1.vision')->eq($this->config->vision)
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->fetch('count');
|
||||
|
||||
$statistic->myDoc = $this->dao->select("count(IF(`action` = 'view', 1, null)) as docViews, count(IF(`action` = 'collect', 1, null)) as docCollects")->from(TABLE_DOCACTION)->where('doc')->in($myDocList)->fetch();
|
||||
$my = $this->dao->select("count(*) as myDocs, SUM(views) as docViews, SUM(collects) as docCollects")->from(TABLE_DOC)->where('addedBy')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->andWhere('vision')->eq($this->config->vision)->andWhere('lib')->ne(0)->fetch();
|
||||
$statistic->myDocs = $my->myDocs;
|
||||
$statistic->myDoc = new stdclass();
|
||||
$statistic->myDoc->docViews = $my->docViews;
|
||||
$statistic->myDoc->docCollects = $my->docCollects;
|
||||
|
||||
return $statistic;
|
||||
}
|
||||
@@ -2358,6 +2391,11 @@ class docModel extends model
|
||||
|
||||
$currentModule = $this->app->rawModule;
|
||||
$currentMethod = $this->app->rawMethod;
|
||||
if($currentModule == 'api' and $currentMethod == 'index')
|
||||
{
|
||||
$currentModule = 'doc';
|
||||
$currentMethod = $type . 'Space';
|
||||
}
|
||||
|
||||
$dropMenuLink = helper::createLink('doc', 'ajaxGetDropMenu', "objectType=$type&objectID=$objectID&module=$currentModule&method=$currentMethod");
|
||||
$output = "<div class='btn-group selectBox' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$objectTitle}'><span class='text'>{$objectTitle}</span> <span class='caret' style='margin-bottom: -1px'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
|
||||
@@ -2746,10 +2784,11 @@ class docModel extends model
|
||||
if($this->app->tab == 'doc' and $type == 'execution') $type = 'project';
|
||||
|
||||
$objectDropdown = '';
|
||||
$appendObject = $objectID;
|
||||
if(in_array($type, array('project', 'product', 'execution')))
|
||||
{
|
||||
$table = $this->config->objectTables[$type];
|
||||
$object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch();
|
||||
$object = $this->dao->select('id,name,status,deleted')->from($table)->where('id')->eq($objectID)->fetch();
|
||||
|
||||
if(empty($object))
|
||||
{
|
||||
@@ -2758,7 +2797,7 @@ class docModel extends model
|
||||
return print(js::locate(helper::createLink($type, $methodName, $param)));
|
||||
}
|
||||
|
||||
$objects = $this->getOrderedObjects($type);
|
||||
$objects = $this->getOrderedObjects($type, 'merge', $objectID);
|
||||
$objectID = $this->loadModel($type)->saveState($objectID, $objects);
|
||||
$libs = $this->getLibsByObject($type, $objectID, '', $appendLib);
|
||||
if(($libID == 0 or !isset($libs[$libID])) and !empty($libs)) $libID = reset($libs)->id;
|
||||
@@ -2771,7 +2810,7 @@ class docModel extends model
|
||||
}
|
||||
else
|
||||
{
|
||||
$objectDropdown = $this->select($type, $objectTitle, $objectID);
|
||||
$objectDropdown = $this->select($type, $objectTitle, $appendObject);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2914,6 +2953,7 @@ class docModel extends model
|
||||
$item->name = $module->name;
|
||||
$item->type = $module->type == 'api' ? 'apiDoc' : $module->type;
|
||||
$item->active = $module->id == $moduleID ? 1 : 0;
|
||||
$item->order = $module->order;
|
||||
$item->children = $this->getModuleTree($rootID, $moduleID, $type, $module->id, $modules);
|
||||
$showDoc = $this->loadModel('setting')->getItem('owner=' . $this->app->user->account . '&module=doc&key=showDoc');
|
||||
$showDoc = $showDoc === '0' ? 0 : 1;
|
||||
@@ -2984,6 +3024,7 @@ class docModel extends model
|
||||
$item->id = $lib->id;
|
||||
$item->type = $lib->type == 'api' ? 'api' : 'lib';
|
||||
$item->name = $lib->name;
|
||||
$item->order = $lib->order;
|
||||
$item->objectType = $type;
|
||||
$item->objectID = $objectID;
|
||||
$item->active = $lib->id == $libID && $browseType != 'bysearch' ? 1 : 0;
|
||||
@@ -3091,7 +3132,7 @@ class docModel extends model
|
||||
if($type != 'project') $libTree = array_values($libTree[$type]);
|
||||
if($type == 'mine')
|
||||
{
|
||||
$libType = zget($this->app->rawParams, 'type', '');
|
||||
$libType = $this->app->rawMethod == 'view' ? 'mine' : zget($this->app->rawParams, 'type', '');
|
||||
$libType = strtolower($libType);
|
||||
|
||||
$myLib = new stdclass();
|
||||
@@ -3102,7 +3143,7 @@ class docModel extends model
|
||||
$myLib->objectID = 0;
|
||||
$myLib->active = 0;
|
||||
$myLib->hasAction = false;
|
||||
$myLib->active = $libType == 'mine' ? 1 : 0;
|
||||
$myLib->active = $libType == 'mine' ? 1 : 0;
|
||||
$myLib->children = $libTree;
|
||||
|
||||
$myView = new stdclass();
|
||||
@@ -3132,21 +3173,23 @@ class docModel extends model
|
||||
$myCreation->hasAction = false;
|
||||
$myCreation->active = $libType == 'createdby' ? 1 : 0;
|
||||
|
||||
$myCreation = new stdclass();
|
||||
$myCreation->id = 0;
|
||||
$myCreation->name = $this->lang->doc->myEdited;
|
||||
$myCreation->type = 'editedBy';
|
||||
$myCreation->objectType = 'doc';
|
||||
$myCreation->objectID = 0;
|
||||
$myCreation->hasAction = false;
|
||||
$myCreation->active = $libType == 'editedby' ? 1 : 0;
|
||||
$myEdited = new stdclass();
|
||||
$myEdited->id = 0;
|
||||
$myEdited->name = $this->lang->doc->myEdited;
|
||||
$myEdited->type = 'editedBy';
|
||||
$myEdited->objectType = 'doc';
|
||||
$myEdited->objectID = 0;
|
||||
$myEdited->hasAction = false;
|
||||
$myEdited->active = $libType == 'editedby' ? 1 : 0;
|
||||
|
||||
$libTree = array();
|
||||
$libTree[] = $myLib;
|
||||
if(common::hasPriv('doc', 'myView')) $libTree[] = $myView;
|
||||
if(common::hasPriv('doc', 'myCollection')) $libTree[] = $myCollection;
|
||||
if(common::hasPriv('doc', 'myCreation')) $libTree[] = $myCreation;
|
||||
if(common::hasPriv('doc', 'myEdited')) $libTree[] = $myEdited;
|
||||
}
|
||||
|
||||
return $libTree;
|
||||
}
|
||||
|
||||
@@ -3166,7 +3209,7 @@ class docModel extends model
|
||||
$objectID = zget($lib, $lib->type, 0);
|
||||
$class = $from == 'list' ? 'btn-info' : 'btn-primary';
|
||||
$html = "<div class='dropdown btn-group createDropdown'>";
|
||||
$html .= html::a(helper::createLink('doc', 'create', "objectType={$lib->type}&objectID=$objectID&libID={$lib->id}&moduleID=$moduleID&type=html"), "<i class='icon icon-plus'></i> {$this->lang->doc->create}", '', "class='btn $class'");
|
||||
$html .= html::a(helper::createLink('doc', 'create', "objectType={$lib->type}&objectID=$objectID&libID={$lib->id}&moduleID=$moduleID&type=html"), "<i class='icon icon-plus'></i> {$this->lang->doc->create}", '', "class='btn $class' data-app='{$this->app->tab}'");
|
||||
$html .= "<button type='button' class='btn $class dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>";
|
||||
$html .= "<ul class='dropdown-menu pull-right'>";
|
||||
|
||||
@@ -3258,6 +3301,11 @@ class docModel extends model
|
||||
if(empty($account))$account = $this->app->user->account;
|
||||
if($action == 'collect') $this->dao->delete()->from(TABLE_DOCACTION)->where('doc')->eq($docID)->andWhere('action')->eq('collect')->andWhere('actor')->eq($account)->exec();
|
||||
|
||||
if($action == 'view')
|
||||
{
|
||||
$lastView = $this->dao->select('date')->from(TABLE_DOCACTION)->where('doc')->eq($docID)->andWhere('action')->eq('view')->andWhere('actor')->eq($account)->orderBy('id_desc')->fetch('date');
|
||||
if($lastView and (time() - strtotime($lastView) < 4)) return false;
|
||||
}
|
||||
$data = new stdclass();
|
||||
$data->doc = $docID;
|
||||
$data->action = $action;
|
||||
@@ -3409,4 +3457,34 @@ class docModel extends model
|
||||
unset($editingDate[$account]);
|
||||
$this->dao->update(TABLE_DOC)->set('editingDate')->eq(json_encode($editingDate))->where('id')->eq($doc->id)->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get editors by doc id.
|
||||
*
|
||||
* @param int $docID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getEditors($docID = 0)
|
||||
{
|
||||
if(!$docID) return array();
|
||||
$actions = $this->dao->select('*')->from(TABLE_ACTION)
|
||||
->where('objectType')->eq('doc')
|
||||
->andWhere('objectID')->eq((int)$docID)
|
||||
->andWhere('action')->in('edited')
|
||||
->orderBy('date_desc')
|
||||
->fetchAll('id');
|
||||
|
||||
$editors = array();
|
||||
foreach($actions as $action)
|
||||
{
|
||||
$editor = new stdclass();
|
||||
$editor->account = $action->actor;
|
||||
$editor->date = $action->date;
|
||||
|
||||
$editors[] = $editor;
|
||||
}
|
||||
|
||||
return $editors;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,15 +14,23 @@
|
||||
<div class="info">
|
||||
<?php $version = $version ? $version : $doc->version;?>
|
||||
<div class="version" data-version='<?php echo $version;?>'>
|
||||
<div class='btn-group'>
|
||||
<a href='javascript:;' class='btn btn-link btn-limit text-ellipsis' data-toggle='dropdown' style="max-width: 120px;">
|
||||
#<?php echo $version;?>
|
||||
<div id="diffBtnGroup" class='btn-group exchangeDiffGroup'>
|
||||
<a href='javascript:;' class='btn btn-link btn-limit text-ellipsis left-dom' data-toggle='dropdown' style="max-width: 120px;">
|
||||
V<?php echo $version;?>
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class='dropdown-menu doc-version-menu' style='max-height:240px; max-width: 300px; overflow-y:auto'>
|
||||
<?php for($version = $doc->version; $version > 0; $version--): ?>
|
||||
<li><a href='javascript:void(0)' data-url='<?php echo $this->createLink('doc', 'view', "docID=$doc->id&version=$version"); ?>'>#<?php echo $version; ?></a></li>
|
||||
<?php endfor; ?>
|
||||
<i id="exchangeDiffBtn" class="icon icon-exchange right-dom"></i>
|
||||
<a href='javascript:;' class='btn btn-link btn-limit text-ellipsis right-dom' data-toggle='dropdown' style="max-width: 120px;">
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul id="docVersionMenu" class='dropdown-menu doc-version-menu' style='width: 250px; overflow-y:auto'>
|
||||
<li class="drop-title flex-between dropdown-header not-clear-menu"><div><?php echo $lang->doc->allVersion?></div></li>
|
||||
<div class="drop-body menu-active-primary menu-hover-primary">
|
||||
<?php for($itemVersion = $doc->version; $itemVersion > 0; $itemVersion--):?>
|
||||
<li class="li-item <?php if($itemVersion == $version) echo 'active';?>"><div class="checkbox-primary"><input type="checkbox" <?php echo "data-id=".$doc->id." data-version=".$itemVersion;?> ></input><label for=""></label></div><a href='javascript:void(0)' data-url='<?php echo $this->createLink('doc', 'view', "docID=$doc->id&version=$itemVersion"); ?>'>#<?php echo $itemVersion;?></a></li>
|
||||
<?php endfor;?>
|
||||
</div>
|
||||
<li class="drop-bottom"><button data-id="confirm" class="btn btn-primary"><?php echo $lang->confirm?></button><button data-id="cancel" class="btn"><?php echo $lang->doc->cancelDiff?></button></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -69,12 +77,43 @@
|
||||
?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php if(!empty($editors)):?>
|
||||
<div id='editorBox'>
|
||||
<?php $groupClass = count($editors) == 1 ? 'noDropdown' : '';?>
|
||||
<div class="btn-group <?php echo $groupClass;?>">
|
||||
<?php
|
||||
$space = common::checkNotCN() ? ' ' : '';
|
||||
$firstEditor = current($editors);
|
||||
$editorInfo = zget($users, $firstEditor->account) . ' ' . substr($firstEditor->date, 0, 10) . $space . $lang->doc->update;
|
||||
|
||||
array_shift($editors);
|
||||
?>
|
||||
<?php if(!empty($editors)):?>
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="text" title='<?php echo $editorInfo;?>'><?php echo $editorInfo;?></span>
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" id='editorMenu'>
|
||||
<?php
|
||||
foreach($editors as $editor)
|
||||
{
|
||||
$editorInfo = zget($users, $editor->account) . ' ' . substr($editor->date, 0, 10) . $space . $lang->doc->update;
|
||||
echo "<li title='$editorInfo'>$editorInfo</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php else:?>
|
||||
<span class="text" title='<?php echo $editorInfo;?>'><?php echo $editorInfo;?></span>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div class="">
|
||||
<div id="diffContain">
|
||||
<div class="detail-content article-content table-col">
|
||||
<div class='info'>
|
||||
<span class='user-time text-muted'><i class='icon icon-contacts'></i> <?php echo zget($users, $doc->addedBy) . " {$lang->colon} " . substr($doc->addedDate, 0, 10) . (common::checkNotCN() ? ' ' : '') . $lang->doc->createAB;?></span>
|
||||
<!-- <span data-url="<?php echo $this->createLink('doc', 'collect', "objectID=$doc->id&objectType=doc");?>" title="<?php echo $lang->doc->collect;?>" class='user-time ajaxCollect text-muted'><?php echo html::image("static/svg/{$star}.svg", "class='$star'");?> <?php echo $doc->collects;?></span> -->
|
||||
<?php $createInfo = $doc->status == 'draft' ? zget($users, $doc->addedBy) . " {$lang->colon} " . substr($doc->addedDate, 0, 10) . (common::checkNotCN() ? ' ' : '') . $lang->doc->createAB : zget($users, $doc->releasedBy) . " {$lang->colon} " . substr($doc->releasedDate, 0, 10) . (common::checkNotCN() ? ' ' : '') . $lang->doc->release;?>
|
||||
<span class='user-time text-muted'><i class='icon-contacts'></i> <?php echo $createInfo;?></span>
|
||||
<span class='user-time text-muted'><i class='icon-star'></i> <?php echo $doc->collects;?></span>
|
||||
<span class='user-time text-muted'><i class='icon-eye'></i> <?php echo $doc->views;?></span>
|
||||
<?php if($doc->keywords):?>
|
||||
|
||||
@@ -36,7 +36,8 @@
|
||||
<th><?php echo $lang->doc->execution?></th>
|
||||
<td>
|
||||
<?php $disabled = $project->multiple ? '' : 'disabled';?>
|
||||
<?php echo html::select('execution', $executionPairs, 0, "class='form-control chosen' data-drop-direction='down' data-placeholder='{$lang->doclib->tip->selectExecution}' $disabled")?>
|
||||
<?php echo html::select('execution', $executionPairs, 0, "class='form-control chosen' data-drop-direction='down' $disabled")?>
|
||||
<i class='icon icon-help' title='<?php echo $lang->doclib->tip->selectExecution;?>'></i>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<tbody>
|
||||
<tr id='headerBox'>
|
||||
<td width='90px'><?php echo html::backButton("<i class='icon icon-back icon-sm'></i> " . $lang->goback, "id='backBtn'", 'btn btn-secondary');?></td>
|
||||
<td class="doc-title" colspan='3'><?php echo html::input('title', '', "placeholder='{$lang->doc->titlePlaceholder}' id='editorTitle' class='form-control' required");?></td>
|
||||
<td class="doc-title" colspan='3'><?php echo html::input('title', '', "placeholder='{$lang->doc->titlePlaceholder}' id='editorTitle' class='form-control' required maxlength='100'");?></td>
|
||||
<td class="text-right btn-tools">
|
||||
<?php echo html::commonButton($lang->doc->saveDraft, "id='saveDraft' data-placement='bottom'", "btn btn-secondary");?>
|
||||
<?php echo html::a('#modalBasicInfo', $lang->release->common, '', "data-toggle='modal' id='basicInfoLink' class='btn btn-primary'");?>
|
||||
|
||||
@@ -79,7 +79,7 @@ body {margin-bottom: 25px;}
|
||||
<?php printf('%03d', $doc->id);?>
|
||||
</td>
|
||||
</td>
|
||||
<td class="c-name" title='<?php echo $doc->title;?>'>
|
||||
<td class="c-name" title='<?php echo $doc->title;?>' data-status='<?php echo $doc->status?>'>
|
||||
<?php
|
||||
$docType = zget($config->doc->iconList, $doc->type);
|
||||
$icon = html::image("static/svg/{$docType}.svg", "class='file-icon'");
|
||||
|
||||
@@ -8,26 +8,25 @@
|
||||
#main {margin-bottom: 0;}
|
||||
|
||||
/* css for mian */
|
||||
#mainContent > #sideBar {flex: 0 0 150px; overflow-x: auto; padding-right: 5px;}
|
||||
[lang^=zh] #mainContent > #sideBar {flex: 0 0 180px;}
|
||||
#mainContent > #sideBar {flex: 0 0 180px; overflow-x: auto; padding-right: 5px;}
|
||||
|
||||
/* css for tree */
|
||||
#fileTree .title {font-size: 16px; height: 20px; margin-top: 5px; margin-bottom: 5px;}
|
||||
.tree li.has-list.open:before {content: unset;}
|
||||
.tree li > a {max-width: 100%; padding: 2px;}
|
||||
#fileTree.tree li.has-list.open:before {content: unset;}
|
||||
#fileTree.tree li > a {max-width: 100%; padding: 2px;}
|
||||
.file-tree a {height: 30px;}
|
||||
.flex-between {display: flex; align-items: center; justify-content: space-between;}
|
||||
.flex-center {display: flex; align-items: center; justify-content: center;}
|
||||
.flex-start {display: flex; align-items: center;}
|
||||
.tree li > .list-toggle {top: 4px;}
|
||||
#fileTree.tree li > .list-toggle {top: 4px;}
|
||||
.input-tree {width: 120px;}
|
||||
.tree-icon {position: absolute; right: 0;}
|
||||
.tree li.has-input {overflow: hidden;}
|
||||
.tree li.has-input > input.input-bro {margin-left: 15px;}
|
||||
#fileTree.tree li.has-input {overflow: hidden;}
|
||||
#fileTree.tree li.has-input > input.input-bro {margin-left: 15px;}
|
||||
.img-lib {flex: 0 0 14px; height: 14px; margin-right: 5px; margin-bottom: 2px;}
|
||||
.file-icon {width: 14px; margin-bottom: 4px;}
|
||||
.tree-icon {position: absolute; right: 0;}
|
||||
.tree li > a {max-width: 100%; padding: 2px;}
|
||||
#fileTree.tree li > a {max-width: 100%; padding: 2px;}
|
||||
.file-tree a.show-icon > div,
|
||||
.file-tree a.hover > div {padding-right: 15px;}
|
||||
.tree-text {overflow: hidden; min-width: 50px;}
|
||||
@@ -56,7 +55,19 @@ i.btn-info, i.btn-info:hover {border: none; background: #fff; box-shadow: unset;
|
||||
[lang^=zh] #leftBar .selectBox #currentItem {width: 180px;}
|
||||
#leftBar .selectBox #currentItem > .text {overflow: hidden; text-align: left; flex: 0 1 100%;}
|
||||
.dropdown-in-tree {max-height: 293px; overflow-y: auto;}
|
||||
.before-tree-item {flex: 0 0 14px; margin-right: 5px;}
|
||||
.before-tree-item {flex: 0 0 14px; margin-right: 5px; margin-bottom: 2px;}
|
||||
|
||||
/* Catalog sort style. */
|
||||
.sortable-sorting .catalog > a {cursor: move;}
|
||||
.sortable-sorting li .flex-start {opacity: 0.5;}
|
||||
.sortable-sorting .drop-here .flex-start {background-color: #fff3e0;}
|
||||
.sortable-sorting .drop-here .flex-start > * {opacity: 0.1;}
|
||||
.sortable-sorting .drag-shadow .flex-start {opacity: 1 !important;}
|
||||
.sortable-sorting .drag-shadow .icon-drop {visibility: hidden;}
|
||||
.is-sorting > li .flex-start {opacity: 1; border-radius: 4px;}
|
||||
.is-sorting > li ul {display: none !important;}
|
||||
li.drag-shadow ul {display: none !important;}
|
||||
#fileTree a.dragging-shadow {box-shadow: 0 1px 1px rgba(0,0,0,.05), 0 2px 6px 0 rgba(0,0,0,0.1);}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
@@ -70,6 +81,8 @@ js::set('objectID', isset($objectID) ? $objectID : '');
|
||||
js::set('isFirstLoad', isset($isFirstLoad) ? $isFirstLoad: '');
|
||||
js::set('canViewFiles', common::hasPriv('doc', 'showfiles'));
|
||||
js::set('spaceMethod', $config->doc->spaceMethod);
|
||||
js::set('canSortDocCatalog', common::hasPriv('doc', 'sortCatalog'));
|
||||
js::set('canSortAPICatalog', common::hasPriv('api', 'sortCatalog'));
|
||||
?>
|
||||
|
||||
<div id="fileTree" class="file-tree menu-active-primary menu-hover-primary">
|
||||
@@ -169,6 +182,7 @@ $(function()
|
||||
};
|
||||
|
||||
var versionsData = {};
|
||||
var visibleSort = false;
|
||||
|
||||
/**
|
||||
* Render Dropdown dom.
|
||||
@@ -233,31 +247,37 @@ $(function()
|
||||
function initTree(ele, treeData)
|
||||
{
|
||||
var imgObj = {
|
||||
'annex': 'annex',
|
||||
'api': 'interface',
|
||||
'lib': 'wiki',
|
||||
'execution': 'wiki-file-lib',
|
||||
'text': 'wiki-file',
|
||||
'word': 'word',
|
||||
'ppt': 'ppt',
|
||||
'excel': 'excel'
|
||||
'annex' : 'annex',
|
||||
'api' : 'interface',
|
||||
'lib' : 'wiki',
|
||||
'execution' : 'wiki-file-lib',
|
||||
'text' : 'wiki-file',
|
||||
'word' : 'word',
|
||||
'ppt' : 'ppt',
|
||||
'excel' : 'excel'
|
||||
};
|
||||
|
||||
ele.tree(
|
||||
{
|
||||
data: treeData,
|
||||
initialState: 'active',
|
||||
itemCreator: function($li, item)
|
||||
{
|
||||
if(item.type == 'apiDoc' && release) item.hasAction = false;
|
||||
if(typeof item.hasAction == 'undefined') item.hasAction = true;
|
||||
if(typeof item.active == 'undefined') item.active = 0;
|
||||
if(typeof docID != 'undefined' && item.id == docID) item.active = 1;
|
||||
if(['text', 'word', 'ppt', 'excel'].indexOf(item.type) !== -1) item.hasAction = false;
|
||||
|
||||
var objectType = config.currentModule == 'api' ? item.objectType : item.type;
|
||||
var libClass = ['lib', 'annex', 'api', 'execution'].indexOf(objectType) !== -1 ? 'lib' : '';
|
||||
var objectType = config.currentModule == 'api' && ['project', 'product', 'execution'].indexOf(item.objectType) === false ? item.objectType : item.type;
|
||||
var libClass = ['lib', 'annex', 'api', 'execution'].indexOf(objectType) !== -1 ? 'lib' : '';
|
||||
var moduleClass = item.type == 'doc' || item.type == 'apiDoc' ? 'catalog' : '';
|
||||
var sortClass = '';
|
||||
if(config.currentMethod != 'view' && ((item.type == 'doc' && canSortDocCatalog) || (item.type == 'apiDoc' && canSortAPICatalog && !release))) sortClass = 'sort-module';
|
||||
|
||||
var hasChild = item.children ? !!item.children.length : false;
|
||||
var link = item.type != 'execution' || item.hasAction ? '###' : '#';
|
||||
var $item = '<a href="' + link + '" style="position: relative" data-has-children="' + hasChild + '" title="' + item.name + '" data-id="' + item.id + '" class="' + libClass + '" data-type="' + item.type + '" data-action="' + item.hasAction + '">';
|
||||
var $item = '<a href="' + link + '" style="position: relative" data-has-children="' + hasChild + '" title="' + item.name + '" data-id="' + item.id + '" class="' + libClass + sortClass + '" data-type="' + item.type + '" data-action="' + item.hasAction + '">';
|
||||
|
||||
$item += '<div class="text h-full w-full flex-start overflow-hidden">';
|
||||
if((libClass == 'lib' && item.type != 'execution') || (item.type == 'execution' && item.hasAction)) $item += '<i class="before-tree-item icon icon-' + imgObj[item.type] +'-lib"></i>';
|
||||
@@ -284,15 +304,15 @@ $(function()
|
||||
if(item.versions) versionsData[item.id] = item.versions;
|
||||
|
||||
$li.append($item);
|
||||
$li.addClass(libClass);
|
||||
$li.addClass(libClass).addClass(moduleClass).attr('data-order', item.order).attr('data-type', item.type);
|
||||
if(item.active) $li.addClass('active');
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
if(isFirstLoad) ele.data('zui.tree').collapse();
|
||||
|
||||
var $leaf = ele.find('li.active > a');
|
||||
if($leaf.length && $('#fileTree').height() >= $('#sideBar').height()) $('#sideBar')[0].scrollTop = $($leaf[$leaf.length - 1]).offset().top - 100;
|
||||
if($leaf.length && $('#fileTree').height() >= $('#sideBar').height() && $($leaf[$leaf.length - 1]).offset().top > $('#sideBar').height()) $('#sideBar')[0].scrollTop = $($leaf[$leaf.length - 1]).offset().top - 200;
|
||||
|
||||
ele.on('click', '.icon-drop', function(e)
|
||||
{
|
||||
@@ -385,6 +405,18 @@ $(function()
|
||||
}
|
||||
|
||||
return locatePage(libID, moduleID, $(this).data('type'));
|
||||
}).on('mousedown', 'a.sort-module', function()
|
||||
{
|
||||
visibleSort = true;
|
||||
var $element = $(this);
|
||||
setTimeout(function()
|
||||
{
|
||||
if(visibleSort) $element.addClass('dragging-shadow');
|
||||
}, 500);
|
||||
}).on('mouseup', 'a.sort-module', function()
|
||||
{
|
||||
visibleSort = false;
|
||||
$('a.sort-module').removeClass('dragging-shadow');
|
||||
}).on('click', '.tree-version-trigger', function(e)
|
||||
{
|
||||
$('.dropdown-in-tree').remove();
|
||||
@@ -411,6 +443,8 @@ $(function()
|
||||
}
|
||||
else
|
||||
{
|
||||
config.currentModule = 'doc';
|
||||
config.currentMethod = 'projectspace';
|
||||
initTree($('#projectTree'), treeData.project);
|
||||
initTree($('#annexTree'), treeData.annex);
|
||||
if(treeData.execution&& treeData.execution.length)
|
||||
@@ -458,7 +492,6 @@ $(function()
|
||||
{
|
||||
moduleName = 'execution';
|
||||
methodName = 'doc';
|
||||
linkParams = 'executionID=0';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -466,8 +499,9 @@ $(function()
|
||||
if(['mine', 'view', 'collect', 'createdby', 'editedby'].indexOf(objectType) !== -1)
|
||||
{
|
||||
type = ['view', 'collect', 'createdby', 'editedby'].indexOf(type.toLowerCase()) !== -1 ? type.toLowerCase() : 'mine';
|
||||
linkParams = 'type=' + type + '&' + linkParams;
|
||||
linkParams = 'type=' + type + '&libID=' + libID + '&moduleID=' + moduleID;
|
||||
}
|
||||
if(type == 'apiDoc') linkParams = linkParams.replace('browseType=&', 'browseType=byrelease&').replace('param=0', 'param=<?php echo isset($release) ? $release : 0;?>');
|
||||
}
|
||||
|
||||
location.href = createLink(moduleName, methodName, linkParams);
|
||||
@@ -475,6 +509,7 @@ $(function()
|
||||
|
||||
$('body').on('click', function()
|
||||
{
|
||||
$('a.sort-module').removeClass('dragging-shadow');
|
||||
var $dropdown = $('.dropdown-in-tree');
|
||||
if($dropdown.length)
|
||||
{
|
||||
@@ -489,7 +524,7 @@ $(function()
|
||||
}
|
||||
}).on('click', '.sidebar-toggle', function()
|
||||
{
|
||||
var $icon = $(this).find('.icon-drop');
|
||||
var $icon = $(this).find('.icon');
|
||||
if($('#sideBar').hasClass('hidden'))
|
||||
{
|
||||
$icon.addClass('icon-angle-left');
|
||||
@@ -588,7 +623,8 @@ $(function()
|
||||
var methodName = config.currentMethod;
|
||||
if(config.currentModule == 'doc')
|
||||
{
|
||||
params = linkParams.replace('%s', 'libID=' + libID + '&moduleID=' + moduleID).replace('browseType=&', 'browseType=byrelease&').replace('param=0', 'param=' + moduleID);
|
||||
params = linkParams.replace('%s', 'libID=' + libID + '&moduleID=0').replace('browseType=&', 'browseType=byrelease&').replace('param=0', 'param=' + moduleID);
|
||||
if(methodName == 'view') params = linkParams.replace('%s', 'libID=' + libID + '&moduleID=0&browseType=byrelease&orderBy=&status,id_desc¶m=' + moduleID);
|
||||
methodName = objectType + 'Space';
|
||||
}
|
||||
location.href = createLink(config.currentModule, methodName, params);
|
||||
@@ -630,5 +666,69 @@ $(function()
|
||||
{
|
||||
if(e.keyCode == 13) $(this).trigger('blur');
|
||||
});
|
||||
|
||||
/* Make modules tree sortable */
|
||||
var $treeDom = objectType == 'project' ? $('#projectTree, #executionTree') :$('#fileTree');
|
||||
$treeDom.sortable(
|
||||
{
|
||||
trigger: 'a.sort-module',
|
||||
dropToClass: 'sort-to',
|
||||
stopPropagation: true,
|
||||
nested: true,
|
||||
selector: 'li',
|
||||
dragCssClass: 'drop-here',
|
||||
noShadow: false,
|
||||
start: function()
|
||||
{
|
||||
visibleSort = false;
|
||||
$('#dropDownCatalogue').remove();
|
||||
$('a.sort-module').removeClass('dragging-shadow');
|
||||
},
|
||||
canMoveHere: function($ele, $target)
|
||||
{
|
||||
if($ele && $target && $ele.parent().closest('li').attr('data-id') !== $target.parent().closest('li').attr('data-id')) return false;
|
||||
},
|
||||
targetSelector: function($ele, $root)
|
||||
{
|
||||
var $ul = $ele.closest('ul');
|
||||
setTimeout(function()
|
||||
{
|
||||
if($('#fileTree').hasClass('sortable-sorting')) $ul.addClass('is-sorting');
|
||||
}, 100);
|
||||
|
||||
return $ul.children('li.catalog');
|
||||
},
|
||||
always: function()
|
||||
{
|
||||
$('#fileTree,#fileTree .is-sorting').removeClass('is-sorting');
|
||||
},
|
||||
finish: function(e)
|
||||
{
|
||||
visibleSort = false;
|
||||
e.target.siblings().find('a.sort-module').removeClass('dragging-shadow');
|
||||
|
||||
if(!e.changed) return;
|
||||
|
||||
var orders = {};
|
||||
var link = '';
|
||||
var module = e.list.context;
|
||||
var moduleType = $(module).attr('data-type');
|
||||
$('#fileTree').find("li[data-type='" + moduleType + "'].catalog").each(function()
|
||||
{
|
||||
var $li = $(this);
|
||||
var item = $li.data();
|
||||
orders['orders[' + item.id + ']'] = $li.attr('data-order') || item.order;
|
||||
});
|
||||
|
||||
var moduleName = moduleType == 'apiDoc' ? 'api' : 'doc';
|
||||
link = createLink(moduleName, 'sortCatalog');
|
||||
|
||||
$.post(link, orders, function(data){}).error(function()
|
||||
{
|
||||
bootbox.alert(lang.timeout);
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -17,8 +17,9 @@ body {margin-bottom: 25px;}
|
||||
#docListForm th.c-actions {width: 84px; padding-left: 15px;}
|
||||
#docListForm .c-module, #docListForm .c-object {width: 120px; overflow: hidden; white-space: nowrap; text-overflow: clip;}
|
||||
#docListForm .c-object {width: 180px;}
|
||||
#docListForm .table .c-name > .doc-title {display: inline-block; max-width: calc(100% - 80px); overflow: hidden; background: transparent; padding-right:0px;}
|
||||
#docListForm .table .c-name > .doc-title {display: inline-block; overflow: hidden; background: transparent; padding-right:0px; max-width: calc(100% - 40px);}
|
||||
#docListForm .table .c-name > span.doc-title {line-height: 0; vertical-align: inherit;}
|
||||
#docListForm .table .c-name[data-status=draft] > .doc-title {max-width: calc(100% - 80px);}
|
||||
#docListForm .table .c-name > .draft {background-color:rgba(129, 102, 238, 0.12); color:#8166EE;}
|
||||
#docListForm .table .c-name > .ajaxCollect {float: right; position: relative; right: 10px; top: 0px; padding: 0 6px;}
|
||||
#docListForm table.table > thead > tr {height: 32px;}
|
||||
@@ -95,24 +96,23 @@ body {margin-bottom: 25px;}
|
||||
<?php endif;?>
|
||||
<?php printf('%03d', $doc->id);?>
|
||||
</td>
|
||||
</td>
|
||||
<td class="c-name" title='<?php echo $doc->title;?>'>
|
||||
<?php
|
||||
$docType = zget($config->doc->iconList, $doc->type);
|
||||
$icon = html::image("static/svg/{$docType}.svg", "class='file-icon'");
|
||||
if(common::hasPriv('doc', 'view'))
|
||||
{
|
||||
echo html::a($this->createLink('doc', 'view', "docID=$doc->id"), $icon . $doc->title, '', "title='{$doc->title}' class='doc-title' data-app='{$this->app->tab}'");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<span class='doc-title'>$icon {$doc->title}</span>";
|
||||
}
|
||||
?>
|
||||
<?php if($doc->status == 'draft') echo "<span class='label label-badge draft'>{$lang->doc->draft}</span>";?>
|
||||
<?php if(common::canBeChanged('doc', $doc) and common::hasPriv('doc', 'collect') and $libType and $libType != 'api'):?>
|
||||
<td class="c-name" title='<?php echo $doc->title;?>' data-status='<?php echo $doc->status?>'>
|
||||
<?php
|
||||
$docType = zget($config->doc->iconList, $doc->type);
|
||||
$icon = html::image("static/svg/{$docType}.svg", "class='file-icon'");
|
||||
if(common::hasPriv('doc', 'view'))
|
||||
{
|
||||
echo html::a($this->createLink('doc', 'view', "docID=$doc->id"), $icon . $doc->title, '', "title='{$doc->title}' class='doc-title' data-app='{$this->app->tab}'");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<span class='doc-title'>$icon {$doc->title}</span>";
|
||||
}
|
||||
?>
|
||||
<?php if($doc->status == 'draft') echo "<span class='label label-badge draft'>{$lang->doc->draft}</span>";?>
|
||||
<?php if(common::canBeChanged('doc', $doc) and common::hasPriv('doc', 'collect') and $libType and $libType != 'api'):?>
|
||||
<a data-url="<?php echo $this->createLink('doc', 'collect', "objectID=$doc->id&objectType=doc");?>" title="<?php echo $collectTitle;?>" class='btn btn-link ajaxCollect'><?php echo html::image("static/svg/{$star}.svg", "class='$star'");?></a>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<?php if($type != 'mine'):?>
|
||||
<td class="c-object" title='<?php echo $doc->objectName;?>'>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<?php foreach($lang->doc->featureBar['tableContents'] as $barType => $barName):?>
|
||||
<?php $active = $barType == $browseType ? 'btn-active-text' : '';?>
|
||||
<?php $linkParams = "objectID=$objectID&libID=$libID&moduleID=$moduleID&browseType=$barType";?>
|
||||
<?php echo html::a($this->createLink('doc', $app->rawMethod, $linkParams), "<span class='text'>{$barName}</span>" . ($active ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>" : ''), '', "class='btn btn-link $active' id='{$barType}Tab'");?>
|
||||
<?php echo html::a($this->createLink($app->rawModule, $app->rawMethod, $linkParams), "<span class='text'>{$barName}</span>" . ($active ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>" : ''), '', "class='btn btn-link $active' id='{$barType}Tab'");?>
|
||||
<?php endforeach;?>
|
||||
<?php endif;?>
|
||||
<a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->doc->searchDoc;?></a>
|
||||
@@ -41,7 +41,7 @@
|
||||
if($canExport)
|
||||
{
|
||||
$exportLink = $this->createLink('doc', $exportMethod, "libID=$libID&moduleID=$moduleID", 'html', true);
|
||||
if($libType == 'api') $exportLink = $this->createLink('api', $exportMethod, "libID=$libID", 'html', true);
|
||||
if($libType == 'api') $exportLink = $this->createLink('api', $exportMethod, "libID=$libID&version=0&release=$release&moduleID=$moduleID", 'html', true);
|
||||
echo html::a($exportLink, "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export' data-width='480px' id='{$exportMethod}'");
|
||||
}
|
||||
|
||||
|
||||
@@ -23,24 +23,28 @@
|
||||
<?php endif;?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div id="leftBar" class="btn-toolbar pull-left">
|
||||
<?php echo $objectDropdown;?>
|
||||
<?php $gobackLink = $this->session->docList ? $this->session->docList : inlink('teamSpace', "objectID=0&libID=$libID");?>
|
||||
<?php echo html::a($gobackLink, "<i class='icon-back'></i> " . $lang->goback, '', "class='btn btn-link'");?>
|
||||
<?php echo $objectDropdown;?>
|
||||
<?php $gobackLink = $this->session->docList ? $this->session->docList : inlink('teamSpace', "objectID=0&libID=$libID");?>
|
||||
<?php echo html::a($gobackLink, "<i class='icon-back'></i> " . $lang->goback, '', "class='btn btn-link'");?>
|
||||
</div>
|
||||
<?php if(empty($object->deleted)):?>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php
|
||||
if($canExport) echo html::a($this->createLink('doc', $exportMethod, "libID=$libID&moduleID=0&docID=$docID"), "<i class='icon-export muted'> </i>" . $lang->export, 'hiddenwin', "class='btn btn-link' id='docExport'");
|
||||
if(common::hasPriv('api', 'createLib')) echo html::a($this->createLink('api', 'createLib', "type=" . ($objectType ? $objectType : 'nolink') . "&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
|
||||
if(common::hasPriv('doc', 'createLib')) echo html::a($this->createLink('doc', 'createLib', "type=" . ($objectType ? $objectType : 'nolink') . "&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
|
||||
if(common::hasPriv('doc', 'create')) echo $this->doc->printCreateBtn($lib, $moduleID);
|
||||
?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div id='mainContent'class="fade flex">
|
||||
<?php if($libID):?>
|
||||
<?php if(empty($object->deleted)):?>
|
||||
<div id='sideBar' class="panel side side-col col overflow-auto h-full-adjust">
|
||||
<?php include 'lefttree.html.php';?>
|
||||
</div>
|
||||
<div class="sidebar-toggle flex-center"><i class="icon icon-angle-left"></i></div>
|
||||
<?php endif;?>
|
||||
<div class="main-col h-full-adjust" data-min-width="400">
|
||||
<?php if($docID):?>
|
||||
<?php include './content.html.php';?>
|
||||
|
||||
@@ -2783,7 +2783,7 @@ class executionModel extends model
|
||||
*/
|
||||
public function getToImport($executionIds, $type, $model = '')
|
||||
{
|
||||
return $this->dao->select('t1.id,concat_ws(" / ", t2.name, t1.name) as name')->from(TABLE_EXECUTION)->alias('t1')
|
||||
return $this->dao->select("t1.id,concat_ws(' / ', t2.name, t1.name) as name")->from(TABLE_EXECUTION)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t2.id=t1.project')
|
||||
->where('t1.id')->in($executionIds)
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi()
|
||||
|
||||
@@ -778,9 +778,10 @@ class extensionModel extends model
|
||||
{
|
||||
$code = $extension;
|
||||
$extension = $this->getInfoFromPackage($extension);
|
||||
$extension->status = 'available';
|
||||
$extension->code = $code;
|
||||
$extension->type = empty($type) ? $extension->type : $type;
|
||||
$extension->status = 'available';
|
||||
$extension->code = $code;
|
||||
$extension->type = empty($type) ? $extension->type : $type;
|
||||
$extension->installedTime = helper::now();
|
||||
|
||||
$this->dao->replace(TABLE_EXTENSION)->data($extension)->exec();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ js::set('maxUploadSize', $maxUploadSize);
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var totalSize = 0;
|
||||
maxUploadSize = unitConversion(maxUploadSize);
|
||||
|
||||
/**
|
||||
@@ -50,20 +49,43 @@ function unitConversion(maxUploadSize)
|
||||
return parseFloat(maxUploadSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all files total size.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function getTotalSize()
|
||||
{
|
||||
var totalSize = 0;
|
||||
|
||||
$('input[type="file"]').each(function(index, element)
|
||||
{
|
||||
if (element.multiple) return;
|
||||
|
||||
if (!element.files) return;
|
||||
|
||||
if (!element.files[0]) return;
|
||||
|
||||
totalSize += element.files[0].size;
|
||||
});
|
||||
|
||||
return totalSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check danger extension and file size.
|
||||
*
|
||||
* TODO Rename.
|
||||
* @param object $file
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function checkDangerExtension(file)
|
||||
{
|
||||
var fileName = $(file).val();
|
||||
var index = fileName.lastIndexOf(".");
|
||||
var fileSize = $(file)[0].files[0].size;
|
||||
|
||||
totalSize += fileSize;
|
||||
var fileName = $(file).val();
|
||||
var index = fileName.lastIndexOf(".");
|
||||
var fileSize = $(file)[0].files[0].size;
|
||||
var totalSize = getTotalSize();
|
||||
|
||||
if(index >= 0)
|
||||
{
|
||||
@@ -85,7 +107,6 @@ function checkDangerExtension(file)
|
||||
if(totalSize >= maxUploadSize)
|
||||
{
|
||||
alert(<?php echo json_encode(sprintf($lang->file->errorFileSize, $maxUploadSize));?>);
|
||||
totalSize -= fileSize;
|
||||
$(file).val('');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1100,10 +1100,7 @@ $lang->resource->testcase->batchChangeScene = 'batchChangeScene';
|
||||
$lang->resource->testcase->updateOrder = 'updateOrder';
|
||||
|
||||
$lang->resource->testcase->importXmind = 'importXmind';
|
||||
$lang->resource->testcase->saveXmindImport = 'saveXmindImport';
|
||||
$lang->resource->testcase->exportXmind = 'exportXmind';
|
||||
$lang->resource->testcase->getXmindImport = 'getXmindImport';
|
||||
$lang->resource->testcase->showXMindImport = 'showXMindImport';
|
||||
|
||||
$lang->testcase->methodOrder[0] = 'index';
|
||||
$lang->testcase->methodOrder[5] = 'browse';
|
||||
@@ -1144,10 +1141,7 @@ $lang->testcase->methodOrder[170] = 'changeScene';
|
||||
$lang->testcase->methodOrder[175] = 'batchChangeScene';
|
||||
$lang->testcase->methodOrder[180] = 'updateOrder';
|
||||
$lang->testcase->methodOrder[185] = 'importXmind';
|
||||
$lang->testcase->methodOrder[190] = 'getXmindImport';
|
||||
$lang->testcase->methodOrder[195] = 'showXMindImport';
|
||||
$lang->testcase->methodOrder[200] = 'exportXmind';
|
||||
$lang->testcase->methodOrder[205] = 'saveXmindImport';
|
||||
$lang->testcase->methodOrder[190] = 'exportXmind';
|
||||
|
||||
/* Test task. */
|
||||
$lang->resource->testtask = new stdclass();
|
||||
@@ -1403,6 +1397,7 @@ $lang->resource->doc->mySpace = 'mySpace';
|
||||
$lang->resource->doc->myView = 'myView';
|
||||
$lang->resource->doc->myCollection = 'myCollection';
|
||||
$lang->resource->doc->myCreation = 'myCreation';
|
||||
$lang->resource->doc->myEdited = 'myEdited';
|
||||
$lang->resource->doc->createLib = 'createLib';
|
||||
$lang->resource->doc->editLib = 'editLib';
|
||||
$lang->resource->doc->deleteLib = 'deleteLib';
|
||||
@@ -1418,6 +1413,7 @@ $lang->resource->doc->teamSpace = 'teamSpace';
|
||||
$lang->resource->doc->showFiles = 'showFiles';
|
||||
$lang->resource->doc->addCatalog = 'addCatalog';
|
||||
$lang->resource->doc->editCatalog = 'editCatalog';
|
||||
$lang->resource->doc->sortCatalog = 'sortCatalog';
|
||||
$lang->resource->doc->deleteCatalog = 'deleteCatalog';
|
||||
$lang->resource->doc->displaySetting = 'displaySetting';
|
||||
|
||||
@@ -1426,23 +1422,25 @@ $lang->doc->methodOrder[10] = 'mySpace';
|
||||
$lang->doc->methodOrder[15] = 'myView';
|
||||
$lang->doc->methodOrder[20] = 'myCollection';
|
||||
$lang->doc->methodOrder[25] = 'myCreation';
|
||||
$lang->doc->methodOrder[30] = 'createLib';
|
||||
$lang->doc->methodOrder[35] = 'editLib';
|
||||
$lang->doc->methodOrder[40] = 'deleteLib';
|
||||
$lang->doc->methodOrder[45] = 'create';
|
||||
$lang->doc->methodOrder[50] = 'edit';
|
||||
$lang->doc->methodOrder[55] = 'view';
|
||||
$lang->doc->methodOrder[60] = 'delete';
|
||||
$lang->doc->methodOrder[65] = 'deleteFile';
|
||||
$lang->doc->methodOrder[70] = 'collect';
|
||||
$lang->doc->methodOrder[75] = 'productSpace';
|
||||
$lang->doc->methodOrder[80] = 'projectSpace';
|
||||
$lang->doc->methodOrder[85] = 'teamSpace';
|
||||
$lang->doc->methodOrder[90] = 'showFiles';
|
||||
$lang->doc->methodOrder[95] = 'addCatalog';
|
||||
$lang->doc->methodOrder[100] = 'editCatalog';
|
||||
$lang->doc->methodOrder[105] = 'deleteCatalog';
|
||||
$lang->doc->methodOrder[110] = 'displaySetting';
|
||||
$lang->doc->methodOrder[30] = 'myEdited';
|
||||
$lang->doc->methodOrder[35] = 'createLib';
|
||||
$lang->doc->methodOrder[40] = 'editLib';
|
||||
$lang->doc->methodOrder[45] = 'deleteLib';
|
||||
$lang->doc->methodOrder[50] = 'create';
|
||||
$lang->doc->methodOrder[55] = 'edit';
|
||||
$lang->doc->methodOrder[60] = 'view';
|
||||
$lang->doc->methodOrder[65] = 'delete';
|
||||
$lang->doc->methodOrder[70] = 'deleteFile';
|
||||
$lang->doc->methodOrder[75] = 'collect';
|
||||
$lang->doc->methodOrder[80] = 'productSpace';
|
||||
$lang->doc->methodOrder[85] = 'projectSpace';
|
||||
$lang->doc->methodOrder[90] = 'teamSpace';
|
||||
$lang->doc->methodOrder[95] = 'showFiles';
|
||||
$lang->doc->methodOrder[100] = 'addCatalog';
|
||||
$lang->doc->methodOrder[105] = 'editCatalog';
|
||||
$lang->doc->methodOrder[110] = 'sortCatalog';
|
||||
$lang->doc->methodOrder[115] = 'deleteCatalog';
|
||||
$lang->doc->methodOrder[120] = 'displaySetting';
|
||||
|
||||
/* Mail. */
|
||||
$lang->resource->mail = new stdclass();
|
||||
@@ -1939,32 +1937,34 @@ $lang->resource->api->edit = 'edit';
|
||||
$lang->resource->api->delete = 'delete';
|
||||
$lang->resource->api->addCatalog = 'addCatalog';
|
||||
$lang->resource->api->editCatalog = 'editCatalog';
|
||||
$lang->resource->api->sortCatalog = 'sortCatalog';
|
||||
$lang->resource->api->deleteCatalog = 'deleteCatalog';
|
||||
|
||||
$lang->resource->api->getModel = 'getModel';
|
||||
$lang->resource->api->debug = 'debug';
|
||||
$lang->resource->api->sql = 'sql';
|
||||
|
||||
$lang->api->methodOrder[0] = 'index';
|
||||
$lang->api->methodOrder[5] = 'createLib';
|
||||
$lang->api->methodOrder[10] = 'editLib';
|
||||
$lang->api->methodOrder[15] = 'deleteLib';
|
||||
$lang->api->methodOrder[20] = 'createRelease';
|
||||
$lang->api->methodOrder[25] = 'releases';
|
||||
$lang->api->methodOrder[30] = 'deleteRelease';
|
||||
$lang->api->methodOrder[35] = 'struct';
|
||||
$lang->api->methodOrder[40] = 'createStruct';
|
||||
$lang->api->methodOrder[45] = 'editStruct';
|
||||
$lang->api->methodOrder[50] = 'deleteStruct';
|
||||
$lang->api->methodOrder[55] = 'create';
|
||||
$lang->api->methodOrder[60] = 'edit';
|
||||
$lang->api->methodOrder[65] = 'delete';
|
||||
$lang->api->methodOrder[0] = 'index';
|
||||
$lang->api->methodOrder[5] = 'createLib';
|
||||
$lang->api->methodOrder[10] = 'editLib';
|
||||
$lang->api->methodOrder[15] = 'deleteLib';
|
||||
$lang->api->methodOrder[20] = 'createRelease';
|
||||
$lang->api->methodOrder[25] = 'releases';
|
||||
$lang->api->methodOrder[30] = 'deleteRelease';
|
||||
$lang->api->methodOrder[35] = 'struct';
|
||||
$lang->api->methodOrder[40] = 'createStruct';
|
||||
$lang->api->methodOrder[45] = 'editStruct';
|
||||
$lang->api->methodOrder[50] = 'deleteStruct';
|
||||
$lang->api->methodOrder[55] = 'create';
|
||||
$lang->api->methodOrder[60] = 'edit';
|
||||
$lang->api->methodOrder[65] = 'delete';
|
||||
$lang->api->methodOrder[70] = 'addCatalog';
|
||||
$lang->api->methodOrder[75] = 'editCatalog';
|
||||
$lang->api->methodOrder[80] = 'deleteCatalog';
|
||||
$lang->api->methodOrder[85] = 'getModel';
|
||||
$lang->api->methodOrder[90] = 'debug';
|
||||
$lang->api->methodOrder[95] = 'sql';
|
||||
$lang->api->methodOrder[75] = 'editCatalog';
|
||||
$lang->api->methodOrder[80] = 'sortCatalog';
|
||||
$lang->api->methodOrder[85] = 'deleteCatalog';
|
||||
$lang->api->methodOrder[90] = 'getModel';
|
||||
$lang->api->methodOrder[95] = 'debug';
|
||||
$lang->api->methodOrder[100] = 'sql';
|
||||
|
||||
$lang->resource->file = new stdclass();
|
||||
$lang->resource->file->download = 'download';
|
||||
|
||||
+37
-6
@@ -81,11 +81,11 @@ class groupModel extends model
|
||||
public function copyPriv($fromGroup, $toGroup)
|
||||
{
|
||||
$privs = $this->dao->findByGroup($fromGroup)->from(TABLE_GROUPPRIV)->fetchAll();
|
||||
foreach($privs as $priv)
|
||||
foreach($privs as $key => $priv)
|
||||
{
|
||||
$priv->group = $toGroup;
|
||||
$this->dao->replace(TABLE_GROUPPRIV)->data($priv)->exec();
|
||||
$privs[$key]->group = $toGroup;
|
||||
}
|
||||
$this->insertPrivs($privs);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -439,6 +439,7 @@ class groupModel extends model
|
||||
/* Insert new. */
|
||||
if($this->post->actions)
|
||||
{
|
||||
$privs = array();
|
||||
foreach($this->post->actions as $moduleName => $moduleActions)
|
||||
{
|
||||
foreach($moduleActions as $actionName)
|
||||
@@ -447,13 +448,41 @@ class groupModel extends model
|
||||
$data->group = $groupID;
|
||||
$data->module = $moduleName;
|
||||
$data->method = $actionName;
|
||||
$this->dao->replace(TABLE_GROUPPRIV)->data($data)->exec();
|
||||
$privs[] = $data;
|
||||
}
|
||||
}
|
||||
$this->insertPrivs($privs);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert privs.
|
||||
*
|
||||
* @param array $privs
|
||||
* @access protected
|
||||
* @return bool
|
||||
*/
|
||||
protected function insertPrivs($privs)
|
||||
{
|
||||
$groups = array();
|
||||
foreach($privs as $priv) $groups[$priv->group] = $priv->group;
|
||||
|
||||
$privMap = array();
|
||||
$privList = $this->dao->select('group,module,method')->from(TABLE_GROUPPRIV)->where('group')->in($groups)->fetchAll();
|
||||
foreach($privList as $priv) $privMap[$priv->group . '-' . $priv->module . '-' . $priv->method] = true;
|
||||
|
||||
foreach($privs as $priv)
|
||||
{
|
||||
if(!isset($privMap[$priv->group . '-' . $priv->module . '-' . $priv->method]))
|
||||
{
|
||||
$this->dao->insert(TABLE_GROUPPRIV)->data($priv)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update view priv.
|
||||
*
|
||||
@@ -519,6 +548,7 @@ class groupModel extends model
|
||||
{
|
||||
if($this->post->module == false or $this->post->actions == false or $this->post->groups == false) return false;
|
||||
|
||||
$privs = array();
|
||||
foreach($this->post->actions as $action)
|
||||
{
|
||||
foreach($this->post->groups as $group)
|
||||
@@ -527,10 +557,11 @@ class groupModel extends model
|
||||
$data->group = $group;
|
||||
$data->module = $this->post->module;
|
||||
$data->method = $action;
|
||||
$this->dao->replace(TABLE_GROUPPRIV)->data($data)->exec();
|
||||
$privs[] = $data;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
return $this->insertPrivs($privs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -441,6 +441,8 @@
|
||||
var iframe = app.$iframe[0];
|
||||
var isSameUrl = iframe && url && iframe.contentWindow.location.href.endsWith(url);
|
||||
|
||||
app.$app.trigger('beforereloadapp');
|
||||
|
||||
/* Add hook to page before reload it */
|
||||
if (iframe && iframe.contentWindow.beforeAppReload)
|
||||
{
|
||||
|
||||
@@ -296,13 +296,17 @@ class install extends control
|
||||
*/
|
||||
public function step6()
|
||||
{
|
||||
$installFileDeleted = unlink($this->app->getAppRoot() . 'www/install.php');
|
||||
$canDelFile = is_writable($this->app->getAppRoot() . 'www');
|
||||
$installFile = $this->app->getAppRoot() . 'www/install.php';
|
||||
$upgradeFile = $this->app->getAppRoot() . 'www/upgrade.php';
|
||||
$installFileDeleted = $canDelFile && is_writable($installFile) ? unlink($installFile) : false;
|
||||
|
||||
if($canDelFile and is_writable($upgradeFile)) unlink($upgradeFile);
|
||||
unset($_SESSION['installing']);
|
||||
session_destroy();
|
||||
|
||||
$this->view->installFileDeleted = $installFileDeleted;
|
||||
$this->view->title = $this->lang->install->success;
|
||||
$this->display();
|
||||
|
||||
unlink($this->app->getAppRoot() . 'www/upgrade.php');
|
||||
unset($_SESSION['installing']);
|
||||
session_destroy();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ $lang->install->chmodLinux = '需要修改目录 "%s" 的权限。<br />命令
|
||||
|
||||
$lang->install->timezone = '时区设置';
|
||||
$lang->install->defaultLang = '默认语言';
|
||||
$lang->install->dbDriver = 'Database Driver';
|
||||
$lang->install->dbDriver = '数据库类型';
|
||||
$lang->install->dbHost = '数据库服务器';
|
||||
$lang->install->dbHostNote = '如果127.0.0.1无法访问,尝试使用localhost';
|
||||
$lang->install->dbPort = '服务器端口';
|
||||
|
||||
@@ -125,9 +125,9 @@ class jenkins extends control
|
||||
*/
|
||||
public function ajaxGetJenkinsTasks($id)
|
||||
{
|
||||
if(empty($id)) return print(json_encode(array('' => '')));
|
||||
if(empty($id)) return print('');
|
||||
|
||||
$tasks = $this->jenkins->getTasks($id);
|
||||
echo json_encode($tasks);
|
||||
$this->view->tasks = $this->jenkins->getTasks($id, 3);
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
</li>
|
||||
<?php else:?>
|
||||
<li data-idx='<?php echo $task;?>' data-id='<?php echo $task;?>'>
|
||||
<a href='###' id='<?php echo $task;?>' class='text-ellipsis' onclick='setJenkinsJob("<?php echo $task;?>","<?php echo $groupName;?>")' title='<?php echo $task;?>' data-key='<?php echo $task;?>' ><?php echo $task;?></a>
|
||||
<a href='###' id='<?php echo $groupName;?>' class='text-ellipsis' onclick='setJenkinsJob("<?php echo $task;?>","<?php echo $groupName;?>")' title='<?php echo $task;?>' data-key='<?php echo $task;?>' ><?php echo $task;?></a>
|
||||
</li>
|
||||
<?php endif;?>
|
||||
<?php endforeach;?>
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
.only-pick-time thead th, .only-pick-time tfoot th {color: transparent !important;}
|
||||
.checkbox-primary.checkbox-inline {display: inline-block !important;}
|
||||
.checkbox-primary.checkbox-inline label {padding-left: 5px !important;}
|
||||
.jktask-label {min-width: 50px; max-width: 300px; border-radius: 0px 4px 4px 0px;}
|
||||
.jktask-label {width: 326px; border-radius: 0px 4px 4px 0px;}
|
||||
.search-list {max-width: 500px;}
|
||||
.input-group-addon {border-radius: 2px 0px 0px 2px !important;}
|
||||
button.text-right {min-width: 100px; text-align: right;}
|
||||
#server_chosen .chosen-single {border-right: 0px;}
|
||||
@@ -10,6 +11,12 @@ button.text-right {min-width: 100px; text-align: right;}
|
||||
#svnDirBox .input-group {width: unset !important;}
|
||||
#jenkinsServerTR .input-group-addon {border-left-width: 0 !important;}
|
||||
#jenkinsServerTR .dropdown {position: relative;}
|
||||
#jenkinsServerTR .table-col:first-child {width: 375.5px;}
|
||||
#jenkinsServerTR .table-col:first-child {width: 375px;}
|
||||
|
||||
.chosen-container .chosen-drop{z-index: 1100;} /* from c20b7e7a5 */
|
||||
|
||||
#dropMenuTasks>.table-row {width: unset;}
|
||||
|
||||
#paramName {width: 324px;}
|
||||
#paramValue {width: 181px;}
|
||||
#paramDiv .table-row {table-layout: unset;}
|
||||
|
||||
@@ -6,3 +6,11 @@
|
||||
#pipelineBox {width: 385px;}
|
||||
#svnDirBox .input-group {width: unset !important;}
|
||||
#jenkinsServerTR .input-group-addon {border-left-width: 0 !important;}
|
||||
#jenkinsServerTR .dropdown {position: relative;}
|
||||
#jenkinsServerTR .table-col:first-child {width: 375px;}
|
||||
|
||||
#paramName {width: 324px;}
|
||||
#paramValue {width: 181px;}
|
||||
#paramDiv .table-row {table-layout: unset;}
|
||||
.jktask-label {width: 326px; border-radius: 0px 4px 4px 0px;}
|
||||
.search-list {max-width: 500px;}
|
||||
|
||||
+25
-16
@@ -18,7 +18,7 @@ $(document).ready(function()
|
||||
$('#frameBox .loading').remove();
|
||||
$('#frameBox .input-group').append(html);
|
||||
$('#frameBox #frame').chosen();
|
||||
|
||||
|
||||
$('#frame').change();
|
||||
}
|
||||
getFrameSelect('');
|
||||
@@ -171,26 +171,20 @@ $(document).ready(function()
|
||||
$('#jkServer').change(function()
|
||||
{
|
||||
var jenkinsID = $(this).val();
|
||||
$('#jenkinsServerTR #jkTask').remove();
|
||||
$('#jenkinsServerTR #jkTask_chosen').remove();
|
||||
$('#jenkinsServerTR .dropdown,#jenkinsServerTR .input-group-addon').hide();
|
||||
$('#jenkinsServerTR .input-group').append("<div class='load-indicator loading'></div>");
|
||||
$.getJSON(createLink('jenkins', 'ajaxGetJenkinsTasks', 'jenkinsID=' + jenkinsID), function(tasks)
|
||||
{
|
||||
html = "<select id='jkTask' name='jkTask' class='form-control'>";
|
||||
for(taskKey in tasks)
|
||||
{
|
||||
var task = tasks[taskKey];
|
||||
html += "<option value='" + taskKey + "'>" + task + "</option>";
|
||||
}
|
||||
html += '</select>';
|
||||
$('#jenkinsServerTR .loading').remove();
|
||||
$('#jenkinsServerTR .input-group').append(html);
|
||||
setJenkinsJob('', '');
|
||||
|
||||
$('#jenkinsServerTR #jkTask').chosen({drop_direction: 'auto'});
|
||||
})
|
||||
$.get(createLink('jenkins', 'ajaxGetJenkinsTasks', 'jenkinsID=' + jenkinsID), function(tasks)
|
||||
{
|
||||
$('#jenkinsServerTR .loading').remove();
|
||||
$('#dropMenuTasks').html(tasks);
|
||||
$('#jenkinsServerTR .dropdown,.input-group-addon').show();
|
||||
});
|
||||
|
||||
/* There has been a problem with handling the prompt label. */
|
||||
$('#jkTaskLabel').remove();
|
||||
$('.jktask-label').addClass('text-right');
|
||||
})
|
||||
|
||||
$(document).on('change', '#frame', function()
|
||||
@@ -253,3 +247,18 @@ $(document).ready(function()
|
||||
$('#engine').change();
|
||||
$('#triggerType').change();
|
||||
});
|
||||
|
||||
/**
|
||||
* Set jenkins job.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $task
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setJenkinsJob(name, task)
|
||||
{
|
||||
if(name) $('.jktask-label').removeClass('text-right');
|
||||
$('#jkTask').val(task);
|
||||
$('.jktask-label .text').html(name);
|
||||
}
|
||||
|
||||
+32
-16
@@ -11,7 +11,7 @@ $(document).ready(function()
|
||||
var html = "<select id='frame' name='frame' class='form-control chosen'>";
|
||||
for(frame in frameList)
|
||||
{
|
||||
if(job.engine == 'jenkins' || frame != 'sonarqube')
|
||||
if(job.engine == 'jenkins' || frame != 'sonarqube')
|
||||
{
|
||||
html += "<option value='" + frame + "'";
|
||||
if(frame == job.frame) html += " selected";
|
||||
@@ -157,26 +157,27 @@ $(document).ready(function()
|
||||
$('#jkServer').change(function()
|
||||
{
|
||||
var jenkinsID = $(this).val();
|
||||
$('#jenkinsServerTR #jkTask').remove();
|
||||
$('#jenkinsServerTR #jkTask_chosen').remove();
|
||||
$('#jenkinsServerTR .dropdown,#jenkinsServerTR .input-group-addon').hide();
|
||||
$('#jenkinsServerTR .input-group').append("<div class='load-indicator loading'></div>");
|
||||
$.getJSON(createLink('jenkins', 'ajaxGetJenkinsTasks', 'jenkinsID=' + jenkinsID), function(tasks)
|
||||
{
|
||||
html = "<select id='jkTask' name='jkTask' class='form-control'>";
|
||||
for(taskKey in tasks)
|
||||
{
|
||||
var task = tasks[taskKey];
|
||||
html += "<option value='" + taskKey + "'>" + task + "</option>";
|
||||
}
|
||||
html += '</select>';
|
||||
$('#jenkinsServerTR .loading').remove();
|
||||
$('#jenkinsServerTR .input-group').append(html);
|
||||
setJenkinsJob('', '');
|
||||
|
||||
$('#jenkinsServerTR #jkTask').val(jkTask).chosen();
|
||||
})
|
||||
$.get(createLink('jenkins', 'ajaxGetJenkinsTasks', 'jenkinsID=' + jenkinsID), function(tasks)
|
||||
{
|
||||
$('#jenkinsServerTR .loading').remove();
|
||||
$('#dropMenuTasks').html(tasks);
|
||||
$('#jenkinsServerTR .dropdown,.input-group-addon').show();
|
||||
|
||||
if(jenkinsPipeline)
|
||||
{
|
||||
if(jenkinsPipeline.substr(0, 5) != '/job/') jenkinsPipeline = '/job/' + jenkinsPipeline + '/';
|
||||
document.getElementById(jenkinsPipeline).click();
|
||||
jenkinsPipeline = '';
|
||||
}
|
||||
});
|
||||
|
||||
/* There has been a problem with handling the prompt label. */
|
||||
$('#jkTaskLabel').remove();
|
||||
$('.jktask-label').addClass('text-right');
|
||||
})
|
||||
|
||||
$(document).on('change', '#frame', function()
|
||||
@@ -260,3 +261,18 @@ $(document).ready(function()
|
||||
$('#sonarqubeServer').change();
|
||||
$('#triggerType').change();
|
||||
});
|
||||
|
||||
/**
|
||||
* Set jenkins job.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $task
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setJenkinsJob(name, task)
|
||||
{
|
||||
if(name) $('.jktask-label').removeClass('text-right');
|
||||
$('#jkTask').val(task);
|
||||
$('.jktask-label .text').html(name);
|
||||
}
|
||||
|
||||
@@ -106,13 +106,17 @@
|
||||
</tr>
|
||||
<tr id="jenkinsServerTR">
|
||||
<th><?php echo $lang->job->jkHost; ?></th>
|
||||
<td colspan='2' class='required'>
|
||||
<td colspan='2'>
|
||||
<div class='table-row'>
|
||||
<div class='table-col'><?php echo html::select('jkServer', $jenkinsServerList, '', "class='form-control chosen'"); ?></div>
|
||||
<div class='table-col'>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->job->pipeline;?></span>
|
||||
<?php echo html::select('jkTask', array('' => ''), '', "class='form-control chosen'"); ?>
|
||||
<div class='dropdown'>
|
||||
<?php echo html::hidden('jkTask');?>
|
||||
<button data-toggle='dropdown' type='button' class='btn jktask-label required text-right' title=''><span class='text'></span> <span class='caret' style='margin-bottom: -1px'></span></button>
|
||||
<div id='dropMenuTasks' class='dropdown-menu search-list' data-ride='searchList' data-url=''></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user