Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into zentaopms_304
This commit is contained in:
+20
-2
@@ -199,12 +199,13 @@ UPDATE `zt_grouppriv` SET `module` = 'pivot', `method` = 'browse' WHERE `module`
|
||||
UPDATE `zt_grouppriv` SET `module` = 'screen' WHERE `module` = 'report' AND `method` IN ('annualData','allAnnualData');
|
||||
DELETE FROM `zt_grouppriv` WHERE `module` = 'report' AND `method` = 'index';
|
||||
|
||||
REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) SELECT `group`, `module`, 'view' FROM `zt_grouppriv` WHERE `module` = 'chart' AND `method` = 'browse';
|
||||
REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) SELECT `group`, `module`, 'preview' FROM `zt_grouppriv` WHERE `module` = 'chart' AND `method` = 'browse';
|
||||
REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) SELECT `group`, `module`, 'export' FROM `zt_grouppriv` WHERE `module` = 'chart' AND `method` IN ('browse', 'design');
|
||||
|
||||
REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) SELECT `group`, 'screen', `method` FROM `zt_grouppriv` WHERE `module` = 'dashboard';
|
||||
REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) SELECT `group`, 'screen', 'publish' FROM `zt_grouppriv` WHERE `module` = 'screen' AND `method` = 'design';
|
||||
|
||||
REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) SELECT `group`, 'dataview', 'design' FROM `zt_grouppriv` WHERE `module` = 'dataset' AND `method` IN ('create', 'edit');
|
||||
REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) SELECT `group`, 'dataview', 'query' FROM `zt_grouppriv` WHERE `module` = 'dataset' AND `method` IN ('create', 'edit');
|
||||
UPDATE `zt_grouppriv` SET `module` = 'dataview' WHERE `module` = 'dataset' AND `method` IN ('browse', 'create', 'edit', 'delete');
|
||||
DELETE FROM `zt_grouppriv` WHERE `module` = 'dataset' AND `method` = 'view';
|
||||
DELETE FROM `zt_grouppriv` WHERE `module` = 'dashboard';
|
||||
@@ -273,6 +274,9 @@ SELECT t1.`group`, t1.`module`, 'myCollection' FROM `zt_grouppriv` AS t1 WHERE t
|
||||
INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`)
|
||||
SELECT t1.`group`, t1.`module`, 'myCreation' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'browse';
|
||||
|
||||
INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`)
|
||||
SELECT t1.`group`, t1.`module`, 'myEdited' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'browse';
|
||||
|
||||
INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`)
|
||||
SELECT t1.`group`, t1.`module`, 'productSpace' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'tableContents';
|
||||
|
||||
@@ -288,6 +292,9 @@ SELECT t1.`group`, t1.`module`, 'addCatalog' FROM `zt_grouppriv` AS t1 WHERE t1.
|
||||
INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`)
|
||||
SELECT t1.`group`, t1.`module`, 'editCatalog' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'catalog';
|
||||
|
||||
INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`)
|
||||
SELECT t1.`group`, t1.`module`, 'sortCatalog' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'catalog';
|
||||
|
||||
INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`)
|
||||
SELECT t1.`group`, t1.`module`, 'deleteCatalog' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'catalog';
|
||||
|
||||
@@ -297,6 +304,9 @@ SELECT t1.`group`, 'api', 'addCatalog' FROM `zt_grouppriv` AS t1 WHERE t1.`modul
|
||||
INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`)
|
||||
SELECT t1.`group`, 'api', 'editCatalog' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'catalog';
|
||||
|
||||
INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`)
|
||||
SELECT t1.`group`, 'api', 'sortCatalog' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'catalog';
|
||||
|
||||
INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`)
|
||||
SELECT t1.`group`, 'api', 'deleteCatalog' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'catalog';
|
||||
|
||||
@@ -477,6 +487,10 @@ ALTER TABLE `zt_entry`
|
||||
CHANGE `editedBy` `editedBy` varchar(30) NOT NULL DEFAULT '',
|
||||
CHANGE `editedDate` `editedDate` datetime NULL;
|
||||
|
||||
ALTER TABLE `zt_extension`
|
||||
CHANGE `dirs` `dirs` mediumtext NULL,
|
||||
CHANGE `files` `files` mediumtext NULL;
|
||||
|
||||
ALTER TABLE `zt_feedback`
|
||||
CHANGE `reviewedBy` `reviewedBy` varchar(255) NOT NULL DEFAULT '',
|
||||
CHANGE `reviewedDate` `reviewedDate` datetime NULL,
|
||||
@@ -880,6 +894,10 @@ ALTER TABLE `zt_taskspec`
|
||||
CHANGE `estStarted` `estStarted` date NULL,
|
||||
CHANGE `deadline` `deadline` date NULL;
|
||||
|
||||
ALTER TABLE `zt_taskteam`
|
||||
CHANGE `transfer` `transfer` char(30) NOT NULL DEFAULT '',
|
||||
CHANGE `order` `order` tinyint NOT NULL DEFAULT '0';
|
||||
|
||||
ALTER TABLE `zt_team`
|
||||
CHANGE `position` `position` varchar(30) NOT NULL DEFAULT '',
|
||||
CHANGE `join` `join` date NULL;
|
||||
|
||||
+15
-4
@@ -806,8 +806,8 @@ CREATE TABLE IF NOT EXISTS `zt_extension` (
|
||||
`zentaoCompatible` varchar(100) NOT NULL,
|
||||
`installedTime` datetime NOT NULL,
|
||||
`depends` varchar(100) NOT NULL,
|
||||
`dirs` mediumtext NOT NULL,
|
||||
`files` mediumtext NOT NULL,
|
||||
`dirs` mediumtext NULL,
|
||||
`files` mediumtext NULL,
|
||||
`status` varchar(20) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `name` (`name`),
|
||||
@@ -1790,9 +1790,9 @@ CREATE TABLE `zt_taskteam` (
|
||||
`estimate` decimal(12,2) NOT NULL,
|
||||
`consumed` decimal(12,2) NOT NULL,
|
||||
`left` decimal(12,2) NOT NULL,
|
||||
`transfer` char(30) NOT NULL,
|
||||
`transfer` char(30) NOT NULL DEFAULT '',
|
||||
`status` enum('wait','doing','done') NOT NULL DEFAULT 'wait',
|
||||
`order` tinyint(3) NOT NULL,
|
||||
`order` tinyint(3) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `task` (`task`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
@@ -3462,6 +3462,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(1, 'doc', 'manageBook'),
|
||||
(1, 'doc', 'myCollection'),
|
||||
(1, 'doc', 'myCreation'),
|
||||
(1, 'doc', 'myEdited'),
|
||||
(1, 'doc', 'mySpace'),
|
||||
(1, 'doc', 'myView'),
|
||||
(1, 'doc', 'productSpace'),
|
||||
@@ -4816,6 +4817,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(2, 'doc', 'index'),
|
||||
(2, 'doc', 'myCollection'),
|
||||
(2, 'doc', 'myCreation'),
|
||||
(2, 'doc', 'myEdited'),
|
||||
(2, 'doc', 'mySpace'),
|
||||
(2, 'doc', 'myView'),
|
||||
(2, 'doc', 'productSpace'),
|
||||
@@ -5544,6 +5546,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(3, 'doc', 'index'),
|
||||
(3, 'doc', 'myCollection'),
|
||||
(3, 'doc', 'myCreation'),
|
||||
(3, 'doc', 'myEdited'),
|
||||
(3, 'doc', 'mySpace'),
|
||||
(3, 'doc', 'myView'),
|
||||
(3, 'doc', 'productSpace'),
|
||||
@@ -6224,6 +6227,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(4, 'doc', 'manageBook'),
|
||||
(4, 'doc', 'myCollection'),
|
||||
(4, 'doc', 'myCreation'),
|
||||
(4, 'doc', 'myEdited'),
|
||||
(4, 'doc', 'mySpace'),
|
||||
(4, 'doc', 'myView'),
|
||||
(4, 'doc', 'productSpace'),
|
||||
@@ -7259,6 +7263,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(5, 'doc', 'index'),
|
||||
(5, 'doc', 'myCollection'),
|
||||
(5, 'doc', 'myCreation'),
|
||||
(5, 'doc', 'myEdited'),
|
||||
(5, 'doc', 'mySpace'),
|
||||
(5, 'doc', 'myView'),
|
||||
(5, 'doc', 'productSpace'),
|
||||
@@ -8178,6 +8183,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(6, 'doc', 'index'),
|
||||
(6, 'doc', 'myCollection'),
|
||||
(6, 'doc', 'myCreation'),
|
||||
(6, 'doc', 'myEdited'),
|
||||
(6, 'doc', 'mySpace'),
|
||||
(6, 'doc', 'myView'),
|
||||
(6, 'doc', 'productSpace'),
|
||||
@@ -8975,6 +8981,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(7, 'doc', 'index'),
|
||||
(7, 'doc', 'myCollection'),
|
||||
(7, 'doc', 'myCreation'),
|
||||
(7, 'doc', 'myEdited'),
|
||||
(7, 'doc', 'mySpace'),
|
||||
(7, 'doc', 'myView'),
|
||||
(7, 'doc', 'productSpace'),
|
||||
@@ -9787,6 +9794,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(8, 'doc', 'index'),
|
||||
(8, 'doc', 'myCollection'),
|
||||
(8, 'doc', 'myCreation'),
|
||||
(8, 'doc', 'myEdited'),
|
||||
(8, 'doc', 'mySpace'),
|
||||
(8, 'doc', 'myView'),
|
||||
(8, 'doc', 'productSpace'),
|
||||
@@ -10628,6 +10636,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(9, 'doc', 'index'),
|
||||
(9, 'doc', 'myCollection'),
|
||||
(9, 'doc', 'myCreation'),
|
||||
(9, 'doc', 'myEdited'),
|
||||
(9, 'doc', 'mySpace'),
|
||||
(9, 'doc', 'myView'),
|
||||
(9, 'doc', 'productSpace'),
|
||||
@@ -11295,6 +11304,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(10, 'doc', 'index'),
|
||||
(10, 'doc', 'myCollection'),
|
||||
(10, 'doc', 'myCreation'),
|
||||
(10, 'doc', 'myEdited'),
|
||||
(10, 'doc', 'mySpace'),
|
||||
(10, 'doc', 'myView'),
|
||||
(10, 'doc', 'productSpace'),
|
||||
@@ -11798,6 +11808,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(11, 'doc', 'index'),
|
||||
(11, 'doc', 'myCollection'),
|
||||
(11, 'doc', 'myCreation'),
|
||||
(11, 'doc', 'myEdited'),
|
||||
(11, 'doc', 'mySpace'),
|
||||
(11, 'doc', 'myView'),
|
||||
(11, 'doc', 'productSpace'),
|
||||
|
||||
@@ -619,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);
|
||||
@@ -1788,22 +1788,23 @@ class baseSQL
|
||||
{
|
||||
if($this->inCondition and !$this->conditionIsTrue) return $this;
|
||||
|
||||
if($this->method == 'update')
|
||||
if($this->method == 'insert')
|
||||
{
|
||||
$this->setField = $value;
|
||||
$this->data->$value = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 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;
|
||||
}
|
||||
|
||||
@@ -311,7 +311,11 @@ class dm extends dao
|
||||
{
|
||||
$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'))";
|
||||
|
||||
return $this->dbh->query($sql)->fetchAll();
|
||||
$columns = $this->dbh->query($sql)->fetchAll();
|
||||
|
||||
$cols = array();
|
||||
foreach($columns as $col) $cols[$col->COLUMN_NAME] = $col;
|
||||
return $cols;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -345,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);
|
||||
@@ -361,10 +365,9 @@ class dm extends dao
|
||||
if(empty($cols)) return false;
|
||||
|
||||
$conditions = array();
|
||||
foreach($cols as $col)
|
||||
foreach($cols as $colName => $col)
|
||||
{
|
||||
$pk = $col->COLUMN_NAME;
|
||||
if(isset($this->sqlobj->data->{$pk})) $conditions[] = " \"{$pk}\" = '{$this->sqlobj->data->{$pk}}'";
|
||||
if(isset($this->sqlobj->data->{$colName})) $conditions[] = " \"{$colName}\" = '{$this->sqlobj->data->{$colName}}'";
|
||||
}
|
||||
if(!empty($conditions)) $updateSql .= ' WHERE ' . implode(' AND ', $conditions);
|
||||
|
||||
@@ -374,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 ';
|
||||
|
||||
@@ -926,6 +926,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. */
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -84,3 +84,4 @@ $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|';
|
||||
|
||||
@@ -2149,6 +2149,31 @@ class block extends control
|
||||
*/
|
||||
public function printProductDocBlock()
|
||||
{
|
||||
$this->loadModel('doc');
|
||||
|
||||
/* Set project status and count. */
|
||||
$count = isset($this->params->count) ? (int)$this->params->count : 15;
|
||||
$products = $this->loadModel('product')->getList(0, 'all');
|
||||
$involveds = $this->product->getList(0, 'involved');
|
||||
$productIdList = array_merge(array_keys($products), array_keys($involveds));
|
||||
|
||||
$stmt = $this->dao->select('*')->from(TABLE_DOC)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('product')->in($productIdList)
|
||||
->orderBy('product,editedDate_desc')
|
||||
->query();
|
||||
$docGroup = array();
|
||||
while($doc = $stmt->fetch())
|
||||
{
|
||||
if(!isset($docGroup[$doc->product])) $docGroup[$doc->product] = array();
|
||||
if(count($docGroup[$doc->product]) > $count) break;
|
||||
if($this->doc->checkPrivDoc($doc)) $docGroup[$doc->product][$doc->id] = $doc;
|
||||
}
|
||||
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->products = $products;
|
||||
$this->view->involveds = $involveds;
|
||||
$this->view->docGroup = $docGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -357,6 +357,7 @@ if($config->vision == 'rnd')
|
||||
{
|
||||
$lang->block->default['doc']['6']['title'] = $lang->productCommon . '文档';
|
||||
$lang->block->default['doc']['6']['block'] = 'productdoc';
|
||||
$lang->block->default['doc']['6']['params']['count'] = '20';
|
||||
$lang->block->default['doc']['6']['grid'] = 8;
|
||||
}
|
||||
|
||||
@@ -366,6 +367,7 @@ $lang->block->default['doc']['7']['grid'] = 4;
|
||||
|
||||
$lang->block->default['doc']['8']['title'] = $lang->projectCommon . '文档';
|
||||
$lang->block->default['doc']['8']['block'] = 'projectdoc';
|
||||
$lang->block->default['doc']['8']['params']['count'] = '20';
|
||||
$lang->block->default['doc']['8']['grid'] = 8;
|
||||
|
||||
$lang->block->count = '数量';
|
||||
|
||||
@@ -1125,7 +1125,8 @@ class blockModel extends model
|
||||
*/
|
||||
public function getProductDocParams()
|
||||
{
|
||||
return false;
|
||||
$params = $this->appendCountParams();
|
||||
return json_encode($params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
<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; overflow-x:hidden !important;}
|
||||
.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: 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; background: transparent; 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 {padding-bottom: 10px; position: relative; padding-top: 45px; border-radius: 3px; height:275px;}
|
||||
.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;}
|
||||
.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%;}
|
||||
|
||||
.block-productdoc #productType {position: absolute;top: 6px;left: 120px;}
|
||||
.block-productdoc #productType .btn {border:0px;}
|
||||
</style>
|
||||
<script>
|
||||
<?php $blockNavId = 'nav-' . uniqid(); ?>
|
||||
$(function()
|
||||
{
|
||||
<?php if(!$longBlock):?>
|
||||
$(document).on('click', '.col-nav .switch-icon', function(e)
|
||||
{
|
||||
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) $next.find('a[data-toggle="tab"]').trigger('click');
|
||||
else $nav.children('li:not(.switch-icon)')[isPrev ? 'last' : 'first']().find('a[data-toggle="tab"]').trigger('click');
|
||||
e.preventDefault();
|
||||
});
|
||||
<?php endif;?>
|
||||
|
||||
if($('.block-productdoc #productType').length > 1);
|
||||
{
|
||||
count = $('.block-productdoc #productType').length;
|
||||
$('.block-productdoc #productType').each(function()
|
||||
{
|
||||
if(count == 1) return;
|
||||
$(this).remove();
|
||||
count --;
|
||||
})
|
||||
}
|
||||
|
||||
var $productList = $('#activeProduct');
|
||||
if($productList.length)
|
||||
{
|
||||
var productList = $productList[0];
|
||||
$(".col ul.nav").animate({scrollTop: productList.offsetTop}, "slow");
|
||||
}
|
||||
});
|
||||
|
||||
function changeProductType(type)
|
||||
{
|
||||
$('.nav.products').toggleClass('hidden', type != 'all');
|
||||
$('.nav.involveds').toggleClass('hidden', type != 'involved');
|
||||
$('#productType .btn').html($('#productType [data-type=' + type + ']').html() + " <span class='caret'></span>");
|
||||
var name = type == 'all' ? '.products' : '.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 .tab-pane').removeClass('active').removeClass('in');
|
||||
$('.block-productdoc .tab-pane' + $obj.data('target')).addClass('active').addClass('in');
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="dropdown" id='productType'>
|
||||
<button class="btn" type="button" data-toggle="dropdown"><?php echo $lang->product->all;?> <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="javascript:changeProductType('all')" data-type='all'><?php echo $lang->product->all;?></a></li>
|
||||
<li><a href="javascript:changeProductType('involved')" data-type='involved'><?php echo $lang->product->involved;?></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 products">
|
||||
<li class='switch-icon prev'><a><i class='icon icon-arrow-left'></i></a></li>
|
||||
<?php $selected = key($products);?>
|
||||
<?php foreach($products 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>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
<li class='switch-icon next'><a><i class='icon icon-arrow-right'></i></a></li>
|
||||
</ul>
|
||||
<ul class="nav nav-stacked nav-secondary scrollbar-hover involveds hidden">
|
||||
<li class='switch-icon prev'><a><i class='icon icon-arrow-left'></i></a></li>
|
||||
<?php foreach($involveds 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>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
<li class='switch-icon next'><a><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'>
|
||||
<?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>";
|
||||
}
|
||||
?>
|
||||
</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>
|
||||
|
||||
@@ -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)');
|
||||
}
|
||||
|
||||
|
||||
+44
-42
@@ -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)
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -1261,6 +1261,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();
|
||||
}
|
||||
|
||||
@@ -78,3 +78,21 @@
|
||||
#outlineMenu::-moz-scrollbar,
|
||||
#hostory::-moz-scrollbar {height: 0px; width: 0px; background: transparent;}
|
||||
.main-col iframe {min-height: unset;}
|
||||
|
||||
#editorBox > .btn-group > button {margin: 2px 6px 0 4px; color: #838A9D;}
|
||||
#editorMenu {max-height: 200px; overflow: auto;}
|
||||
#editorMenu > li {color: #838A9D; font-weight: 400; padding: 5px 12px;}
|
||||
.doc-version-menu {padding: 10px 5px;}
|
||||
#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;}
|
||||
#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;}
|
||||
|
||||
|
||||
+21
-5
@@ -166,6 +166,25 @@ $(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', '#docVersionMenu .drop-bottom', function(e)
|
||||
{
|
||||
var data = $(e.target).data();
|
||||
e.stopPropagation();
|
||||
if(data.id == 'cancel')
|
||||
{
|
||||
$('#docVersionMenu').removeClass('diff');
|
||||
}
|
||||
else if(data.id == 'confirm')
|
||||
{
|
||||
$(this.closest('.open .btn-group')).removeClass('open');
|
||||
}
|
||||
});
|
||||
|
||||
$('#outline li.has-list').addClass('open in');
|
||||
@@ -198,10 +217,10 @@ $(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()
|
||||
{
|
||||
@@ -226,9 +245,6 @@ $(function()
|
||||
$('#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");
|
||||
})
|
||||
|
||||
@@ -125,6 +125,7 @@ $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';
|
||||
@@ -147,6 +148,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';
|
||||
@@ -169,6 +171,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';
|
||||
|
||||
@@ -125,6 +125,7 @@ $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';
|
||||
@@ -147,6 +148,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';
|
||||
@@ -169,6 +171,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';
|
||||
|
||||
@@ -125,6 +125,7 @@ $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';
|
||||
@@ -147,6 +148,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';
|
||||
@@ -169,6 +171,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';
|
||||
|
||||
@@ -78,6 +78,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';
|
||||
|
||||
@@ -125,6 +125,7 @@ $lang->doc->position = '所在位置';
|
||||
$lang->doc->person = '个人';
|
||||
$lang->doc->team = '团队';
|
||||
$lang->doc->manage = '文档管理';
|
||||
$lang->doc->release = '发布';
|
||||
|
||||
$lang->doc->moduleDoc = '按模块浏览';
|
||||
$lang->doc->searchDoc = '搜索';
|
||||
@@ -147,6 +148,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 = '编辑的文档';
|
||||
@@ -169,6 +171,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 = '维护目录';
|
||||
|
||||
+58
-10
@@ -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)
|
||||
@@ -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);
|
||||
@@ -2914,6 +2928,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 +2999,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;
|
||||
@@ -3132,21 +3148,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;
|
||||
}
|
||||
|
||||
@@ -3409,4 +3427,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,10 +19,14 @@
|
||||
#<?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; ?>
|
||||
<ul id="docVersionMenu" class='dropdown-menu doc-version-menu' style='width: 250px; overflow-y:auto'>
|
||||
<li class="drop-title flex-between"><div><?php echo $lang->doc->allDoc?></div> <div id="changeBtn" class="text-primary" style="cursor: pointer; display: flex; align-items: center;"><i class="icon icon-exchange"></i><?php echo $lang->doc->diff?></div></li>
|
||||
<div class="drop-body menu-active-primary menu-hover-primary">
|
||||
<?php for($version = $doc->version; $version > 0; $version--):?>
|
||||
<li class="li-item"><div class="checkbox-primary"><input type="checkbox"></input><label for=""></label></div><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;?>
|
||||
</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,11 +73,42 @@
|
||||
?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php if(!empty($editors)):?>
|
||||
<div id='editorBox'>
|
||||
<div class="btn-group">
|
||||
<?php
|
||||
$space = common::checkNotCN() ? ' ' : '';
|
||||
$firstEditor = current($editors);
|
||||
$editorInfo = zget($users, $firstEditor->account) . ' ' . substr($firstEditor->date, 0, 10) . $space . $lang->doc->update;
|
||||
|
||||
array_shift($editors);
|
||||
?>
|
||||
<button class="btn pull-right btn-link" data-toggle="dropdown">
|
||||
<span class="text"><?php echo $editorInfo;?></span>
|
||||
<?php if(!empty($editors)):?>
|
||||
<span class="caret"></span>
|
||||
<?php endif;?>
|
||||
</button>
|
||||
<?php if(!empty($editors)):?>
|
||||
<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>$editorInfo</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div class="">
|
||||
<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>
|
||||
<?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 icon-contacts'></i> <?php echo $createInfo;?></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> -->
|
||||
<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>
|
||||
|
||||
@@ -57,6 +57,17 @@ i.btn-info, i.btn-info:hover {border: none; background: #fff; box-shadow: unset;
|
||||
#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; 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;}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
@@ -70,6 +81,7 @@ 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('canSortCatalog', common::hasPriv('doc', 'sortCatalog'));
|
||||
?>
|
||||
|
||||
<div id="fileTree" class="file-tree menu-active-primary menu-hover-primary">
|
||||
@@ -253,11 +265,13 @@ $(function()
|
||||
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 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 objectType = config.currentModule == 'api' ? item.objectType : item.type;
|
||||
var libClass = ['lib', 'annex', 'api', 'execution'].indexOf(objectType) !== -1 ? 'lib' : '';
|
||||
var moduleClass = item.type == 'doc' ? 'catalog' : '';
|
||||
var sortClass = item.type == 'doc' && canSortCatalog ? ' 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 + 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,9 +298,9 @@ $(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);
|
||||
if(item.active) $li.addClass('active');
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
if(isFirstLoad) ele.data('zui.tree').collapse();
|
||||
@@ -630,5 +644,38 @@ $(function()
|
||||
{
|
||||
if(e.keyCode == 13) $(this).trigger('blur');
|
||||
});
|
||||
|
||||
/* Make modules tree sortable */
|
||||
$('#fileTree').sortable(
|
||||
{
|
||||
trigger: 'a.sort-module',
|
||||
dropToClass: 'sort-to',
|
||||
stopPropagation: true,
|
||||
nested: true,
|
||||
selector: 'li',
|
||||
dragCssClass: 'drop-here',
|
||||
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)
|
||||
{
|
||||
if(!e.changed) return;
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1367,6 +1367,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';
|
||||
@@ -1382,6 +1383,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';
|
||||
|
||||
@@ -1390,23 +1392,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();
|
||||
@@ -1916,32 +1920,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';
|
||||
|
||||
@@ -296,12 +296,13 @@ class install extends control
|
||||
*/
|
||||
public function step6()
|
||||
{
|
||||
$installFileDeleted = unlink($this->app->getAppRoot() . 'www/install.php');
|
||||
$canDelFile = is_writable($this->app->getAppRoot() . 'www');
|
||||
$installFileDeleted = $canDelFile ? unlink($this->app->getAppRoot() . 'www/install.php') : false;
|
||||
$this->view->installFileDeleted = $installFileDeleted;
|
||||
$this->view->title = $this->lang->install->success;
|
||||
$this->display();
|
||||
|
||||
unlink($this->app->getAppRoot() . 'www/upgrade.php');
|
||||
if($canDelFile) 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>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<?php js::set('jkTask', $job->pipeline);?>
|
||||
<?php js::set('job', $job);?>
|
||||
<?php js::set('frameList', $lang->job->frameList);?>
|
||||
<?php js::set('jenkinsPipeline', $job->engine == 'jenkins' ? $job->pipeline : '');?>
|
||||
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-content'>
|
||||
@@ -128,13 +129,17 @@
|
||||
<?php if($job->engine == 'jenkins'):?>
|
||||
<tr id="jenkinsServerTR">
|
||||
<th><?php echo $lang->job->server;?></th>
|
||||
<td colspan='2' class='required'>
|
||||
<td colspan='2'>
|
||||
<div class='table-row'>
|
||||
<div class='table-col'><?php echo html::select('jkServer', $jenkinsServerList, $job->server, "class='form-control chosen'");?></div>
|
||||
<div class='table-col'><?php echo html::select('jkServer', $jenkinsServerList, $job->server, "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('' => ''), $job->pipeline, "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'><?php echo $job->pipeline;?></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>
|
||||
|
||||
@@ -90,8 +90,8 @@
|
||||
<td class="c-date"><?php echo formatTime($doc->editedDate, 'Y-m-d');?></td>
|
||||
<td class="c-actions">
|
||||
<?php if(common::canBeChanged('doc', $doc)):?>
|
||||
<?php common::printLink('doc', 'edit', "docID=$doc->id&comment=false&from={$lang->navGroup->doc}", "<i class='icon icon-edit'></i>", '', "title='{$lang->edit}' class='btn btn-link' data-app='doc'", true, false)?>
|
||||
<?php common::printLink('doc', 'delete', "docID=$doc->id&confirm=no&from={$lang->navGroup->doc}", "<i class='icon icon-trash'></i>", 'hiddenwin', "title='{$lang->delete}' class='btn btn-link'")?>
|
||||
<?php common::printLink('doc', 'edit', "docID=$doc->id&comment=false&from={$lang->navGroup->doc}", "<i class='icon icon-edit'></i>", '', "title='{$lang->edit}' class='btn' data-app='doc'", true, false)?>
|
||||
<?php common::printLink('doc', 'delete', "docID=$doc->id&confirm=no&from={$lang->navGroup->doc}", "<i class='icon icon-trash'></i>", 'hiddenwin', "title='{$lang->delete}' class='btn'")?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -27,6 +27,7 @@ $lang->product->closed = '已关闭';
|
||||
$lang->product->closedProduct = "已关闭的{$lang->productCommon}";
|
||||
$lang->product->updateOrder = '排序';
|
||||
$lang->product->all = "所有{$lang->productCommon}";
|
||||
$lang->product->involved = "我参与的{$lang->productCommon}";
|
||||
$lang->product->manageLine = "维护产品线";
|
||||
$lang->product->newLine = "新建产品线";
|
||||
$lang->product->export = '导出数据';
|
||||
|
||||
@@ -276,8 +276,10 @@ class productModel extends model
|
||||
*/
|
||||
public function getList($programID = 0, $status = 'all', $limit = 0, $line = 0, $shadow = 0)
|
||||
{
|
||||
$products = $this->dao->select('t1.*')->from(TABLE_PRODUCT)->alias('t1')
|
||||
$products = $this->dao->select('DISTINCT t1.*')->from(TABLE_PRODUCT)->alias('t1')
|
||||
->leftJoin(TABLE_PROGRAM)->alias('t2')->on('t1.program = t2.id')
|
||||
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t3')->on('t3.product = t1.id')
|
||||
->leftJoin(TABLE_TEAM)->alias('t4')->on("t4.root = t3.project && t4.type='project'")
|
||||
->where('t1.deleted')->eq(0)
|
||||
->beginIF($shadow !== 'all')->andWhere('t1.shadow')->eq((int)$shadow)->fi()
|
||||
->beginIF($programID)->andWhere('t1.program')->eq($programID)->fi()
|
||||
@@ -291,6 +293,7 @@ class productModel extends model
|
||||
->orWhere('t1.QD')->eq($this->app->user->account)
|
||||
->orWhere('t1.RD')->eq($this->app->user->account)
|
||||
->orWhere('t1.createdBy')->eq($this->app->user->account)
|
||||
->orWhere('t4.account')->eq($this->app->user->account)
|
||||
->markRight(1)
|
||||
->fi()
|
||||
->beginIF($status == 'review')
|
||||
|
||||
@@ -1669,7 +1669,7 @@ class programModel extends model
|
||||
if($program) return $program->id;
|
||||
|
||||
$account = isset($this->app->user->account) ? $this->app->user->account : '';
|
||||
$minBegin = $this->dao->select('min(begin) as min')->from(TABLE_PROJECT)->where('deleted')->eq(0)->fetch('min');
|
||||
$minBegin = $this->dao->select('min(`begin`) as min')->from(TABLE_PROJECT)->where('deleted')->eq(0)->fetch('min');
|
||||
|
||||
$program = new stdclass();
|
||||
$program->name = $this->lang->program->defaultProgram;
|
||||
|
||||
+34
-16
@@ -20,30 +20,48 @@ class screen extends control
|
||||
*/
|
||||
public function browse($dimensionID = 0)
|
||||
{
|
||||
$this->app->loadLang('admin');
|
||||
$this->loadModel('setting');
|
||||
|
||||
$dimensionID = $this->loadModel('dimension')->setSwitcherMenu($dimensionID);
|
||||
$this->checkShowGuide();
|
||||
|
||||
/* BI guide. */
|
||||
$lang = (strpos($this->app->getClientLang(), 'zh') !== false) ? 'zh' : 'en';
|
||||
$version = ($this->config->edition == 'biz' or $this->config->edition == 'max') ? 'biz' : 'pms';
|
||||
$imageURL = "static/images/bi_guide_{$version}_{$lang}.png";
|
||||
|
||||
$currentUser = $this->app->user->account;
|
||||
$moduleKey = $version . 'firstGuide';
|
||||
$firstGuide = $this->setting->getItem("owner={$currentUser}&module=bi&key={$moduleKey}");
|
||||
if(empty($firstGuide)) $this->setting->setItem("{$currentUser}.bi.{$moduleKey}", 1);
|
||||
|
||||
$this->view->firstGuide = !empty($firstGuide);
|
||||
$this->view->imageURL = $imageURL;
|
||||
$this->view->version = $version;
|
||||
$this->view->title = $this->lang->screen->common;
|
||||
$this->view->screens = $this->screen->getList($dimensionID);
|
||||
$this->view->dimension = $dimensionID;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether show guide.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkShowGuide()
|
||||
{
|
||||
$this->app->loadLang('admin');
|
||||
$this->loadModel('setting');
|
||||
|
||||
$isUpdate = $this->setting->getItem("owner=system&module=bi&key=update2BI");
|
||||
if(empty($isUpdate))
|
||||
{
|
||||
$this->view->showGuide = false;
|
||||
return;
|
||||
}
|
||||
|
||||
$lang = (strpos($this->app->getClientLang(), 'zh') !== false) ? 'zh' : 'en';
|
||||
$version = ($this->config->edition == 'biz' or $this->config->edition == 'max') ? 'biz' : 'pms';
|
||||
$imageURL = "static/images/bi_guide_{$version}_{$lang}.png";
|
||||
|
||||
$moduleKey = $version . 'Guide';
|
||||
$guides = $this->setting->getItem("owner=system&module=bi&key={$moduleKey}");
|
||||
$haveSeen = explode(',', $guides);
|
||||
$afterSeen = array_merge($haveSeen, array($this->app->user->account));
|
||||
$this->setting->setItem("system.bi.{$moduleKey}", implode(',', array_unique($afterSeen)));
|
||||
|
||||
$this->view->showGuide = in_array($this->app->user->account, $haveSeen) ? false : true;
|
||||
$this->view->imageURL = $imageURL;
|
||||
$this->view->version = $version;
|
||||
}
|
||||
|
||||
/**
|
||||
* View screen.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
$(function()
|
||||
{
|
||||
if(!firstGuide) $('#firstGuide').modal();
|
||||
if(showGuide) $('#firstGuide').modal();
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
|
||||
<?php js::set('firstGuide', $firstGuide);?>
|
||||
<?php js::set('showGuide', $showGuide ? 1 : 0);?>
|
||||
<div id="mainContent">
|
||||
<?php if(empty($screens)):?>
|
||||
<div class="table-empty-tip">
|
||||
|
||||
@@ -375,7 +375,7 @@ class searchModel extends model
|
||||
*/
|
||||
public function getQuery($queryID)
|
||||
{
|
||||
$query = $this->dao->findByID($queryID)->from(TABLE_USERQUERY)->fetch();
|
||||
$query = $this->dao->findByID((int)$queryID)->from(TABLE_USERQUERY)->fetch();
|
||||
if(!$query) return false;
|
||||
|
||||
/* Decode html encode. */
|
||||
|
||||
@@ -4170,9 +4170,12 @@ class storyModel extends model
|
||||
*/
|
||||
public function getDataOfStorysPerModule()
|
||||
{
|
||||
$datas = $this->dao->select('module as name, count(module) as value, product, branch')->from(TABLE_STORY)
|
||||
$datas = $this->dao->select('module as name, count(module) as value, product, branch')
|
||||
->from(TABLE_STORY)
|
||||
->where($this->reportCondition())
|
||||
->groupBy('module')->orderBy('value DESC')->fetchAll('name');
|
||||
->groupBy('module,product,branch')
|
||||
->orderBy('value DESC')
|
||||
->fetchAll('name');
|
||||
if(!$datas) return array();
|
||||
|
||||
$branchIDList = array();
|
||||
|
||||
@@ -944,8 +944,8 @@ class taskModel extends model
|
||||
$member->order = $row;
|
||||
$member->account = $account;
|
||||
$member->estimate = zget($this->post->teamEstimate, $row, 0);
|
||||
$member->consumed = zget($this->post->teamConsumed, $row, 0);
|
||||
$member->left = zget($this->post->teamLeft, $row, 0);
|
||||
$member->consumed = $this->post->teamConsumed ? zget($this->post->teamConsumed, $row, 0) : 0;
|
||||
$member->left = $this->post->teamLeft ? zget($this->post->teamLeft, $row, 0) : 0;
|
||||
$member->status = 'wait';
|
||||
if($taskStatus == 'wait' and $member->estimate > 0 and $member->left == 0) $member->left = $member->estimate;
|
||||
if($taskStatus == 'done') $member->left = 0;
|
||||
|
||||
@@ -437,21 +437,62 @@ $config->delete['18_4'][] = 'module/report/view/productsummary.html.php';
|
||||
$config->delete['18_4'][] = 'module/report/view/projectdeviation.html.php';
|
||||
$config->delete['18_4'][] = 'module/report/view/workload.html.php';
|
||||
$config->delete['18_4'][] = 'module/report/zen.php';
|
||||
$config->delete['18_4'][] = 'extension/max/report/ext/control/instancetemplate.php';
|
||||
$config->delete['18_4'][] = 'extension/max/report/ext/view/programsummary.html.php';
|
||||
$config->delete['18_4'][] = 'extension/max/report/ext/view/programworkload.html.php';
|
||||
$config->delete['18_4'][] = 'extension/max/report/ext/view/instancetemplate.html.php';
|
||||
$config->delete['18_4'][] = 'extension/max/report/ext/view/blockreportlist.html.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/common/ext/lang/zh-cn/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/common/ext/lang/en/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/common/ext/lang/de/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/common/ext/lang/fr/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/common/ext/lang/zh-tw/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/common/ext/lang/zh-cn/report.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/common/ext/lang/en/report.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/common/ext/lang/de/report.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/common/ext/lang/fr/report.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/common/ext/lang/zh-tw/report.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/chart/config.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/chart/control.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/chart/css';
|
||||
$config->delete['18_4'][] = 'extension/biz/chart/js/create.js';
|
||||
$config->delete['18_4'][] = 'extension/biz/chart/js/design.js';
|
||||
$config->delete['18_4'][] = 'extension/biz/chart/lang';
|
||||
$config->delete['18_4'][] = 'extension/biz/chart/model.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/chart/view';
|
||||
$config->delete['18_4'][] = 'extension/biz/group/ext/lang/zh-cn/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/group/ext/lang/en/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/group/ext/lang/de/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/group/ext/lang/fr/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/group/ext/lang/zh-tw/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/group/ext/lang/zh-cn/report.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/group/ext/lang/en/report.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/group/ext/lang/de/report.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/group/ext/lang/fr/report.php';
|
||||
$config->delete['18_4'][] = 'extension/biz/group/ext/lang/zh-tw/report.php';
|
||||
$config->delete['18_4'][] = 'extension/max/common/ext/lang/zh-cn/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/max/common/ext/lang/en/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/max/common/ext/lang/de/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/max/common/ext/lang/fr/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/max/common/ext/lang/zh-tw/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/max/common/ext/lang/zh-cn/report.php';
|
||||
$config->delete['18_4'][] = 'extension/max/common/ext/lang/en/report.php';
|
||||
$config->delete['18_4'][] = 'extension/max/common/ext/lang/de/report.php';
|
||||
$config->delete['18_4'][] = 'extension/max/common/ext/lang/fr/report.php';
|
||||
$config->delete['18_4'][] = 'extension/max/common/ext/lang/zh-tw/report.php';
|
||||
$config->delete['18_4'][] = 'extension/max/chart/config.php';
|
||||
$config->delete['18_4'][] = 'extension/max/chart/control.php';
|
||||
$config->delete['18_4'][] = 'extension/max/chart/css';
|
||||
$config->delete['18_4'][] = 'extension/max/chart/js/create.js';
|
||||
$config->delete['18_4'][] = 'extension/max/chart/js/design.js';
|
||||
$config->delete['18_4'][] = 'extension/max/chart/lang';
|
||||
$config->delete['18_4'][] = 'extension/max/chart/model.php';
|
||||
$config->delete['18_4'][] = 'extension/max/chart/view';
|
||||
$config->delete['18_4'][] = 'extension/max/group/ext/lang/zh-cn/report.php';
|
||||
$config->delete['18_4'][] = 'extension/max/group/ext/lang/en/report.php';
|
||||
$config->delete['18_4'][] = 'extension/max/group/ext/lang/de/report.php';
|
||||
$config->delete['18_4'][] = 'extension/max/group/ext/lang/fr/report.php';
|
||||
$config->delete['18_4'][] = 'extension/max/group/ext/lang/zh-tw/report.php';
|
||||
$config->delete['18_4'][] = 'extension/max/report/ext/control/instancetemplate.php';
|
||||
$config->delete['18_4'][] = 'extension/max/report/ext/view/programsummary.html.php';
|
||||
$config->delete['18_4'][] = 'extension/max/report/ext/view/programworkload.html.php';
|
||||
$config->delete['18_4'][] = 'extension/max/report/ext/view/instancetemplate.html.php';
|
||||
$config->delete['18_4'][] = 'extension/max/report/ext/view/blockreportlist.html.php';
|
||||
|
||||
$config->upgrade->openModules = array('action', 'admin', 'api', 'automation', 'backup', 'block', 'branch', 'budget', 'bug', 'build', 'caselib', 'chart', 'ci', 'client', 'common', 'company', 'compile', 'convert', 'cron', 'custom', 'datatable', 'dataview', 'dept', 'design', 'dev', 'dimension', 'doc', 'durationestimation', 'entry', 'execution', 'extension', 'file', 'git', 'gitlab', 'group', 'holiday', 'im', 'index', 'index.html', 'install', 'issue', 'jenkins', 'job', 'kanban', 'license', 'mail', 'message', 'misc', 'mr', 'my', 'personnel', 'pipeline', 'product', 'productplan', 'productset', 'program', 'programplan', 'project', 'projectbuild', 'projectplan', 'projectrelease', 'projectstory', 'pivot', 'qa', 'release', 'repo', 'report', 'risk', 'score', 'screen', 'search', 'setting', 'sonarqube', 'sso', 'stage', 'stakeholder', 'story', 'subject', 'svn', 'task', 'testcase', 'testreport', 'testsuite', 'testtask', 'todo', 'tree', 'tutorial', 'upgrade', 'user', 'webhook', 'weekly', 'workestimation', 'gitea', 'gogs', 'transfer', 'zahost', 'zanode', 'editor');
|
||||
|
||||
|
||||
@@ -597,6 +597,7 @@ class upgradeModel extends model
|
||||
$this->changeBookToCustomLib();
|
||||
$this->createDefaultDimension();
|
||||
$this->convertDocCollect();
|
||||
$this->addBIUpdateMark();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -8203,7 +8204,6 @@ class upgradeModel extends model
|
||||
/**
|
||||
* Process report modules.
|
||||
*
|
||||
* @param array $modules
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -8230,6 +8230,17 @@ class upgradeModel extends model
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add update2BI mark to zt_config.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function addBIUpdateMark()
|
||||
{
|
||||
$this->loadModel('setting')->setItem("system.bi.update2BI", 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Xuan: Set mute and freeze for hidden groups.
|
||||
*
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user