Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into cyy_fixbug

This commit is contained in:
caoyanyi
2023-04-18 15:58:28 +08:00
7 changed files with 39 additions and 46 deletions
+3
View File
@@ -229,6 +229,9 @@ $config->openMethods[] = 'task.editteam';
$config->openMethods[] = 'feedback.mergeproductmodule';
$config->openMethods[] = 'zanode.nodelist';
$config->openMethods[] = 'action.restoreStages';
$config->openMethods[] = 'testcase.getXmindImport';
$config->openMethods[] = 'testcase.showXMindImport';
$config->openMethods[] = 'testcase.saveXmindImport';
$config->openModules = array();
$config->openModules[] = 'install';
+5
View File
@@ -341,6 +341,11 @@ CHANGE `editedBy` `editedBy` varchar(30) NOT NULL DEFAULT '',
CHANGE `editedDate` `editedDate` datetime NULL;
ALTER TABLE `zt_attend`
CHANGE `signIn` `signIn` time NULL,
CHANGE `signOut` `signOut` time NULL,
CHANGE `manualIn` `manualIn` time NULL,
CHANGE `manualOut` `manualOut` time NULL,
CHANGE `desc` `desc` text NULL,
CHANGE `reviewedBy` `reviewedBy` char(30) NULL DEFAULT '',
CHANGE `reviewedDate` `reviewedDate` datetime NULL;
+5 -5
View File
@@ -2711,16 +2711,16 @@ CREATE TABLE IF NOT EXISTS `zt_attend` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`account` char(30) NOT NULL,
`date` date NOT NULL,
`signIn` time NOT NULL,
`signOut` time NOT NULL,
`signIn` time NULL,
`signOut` time NULL,
`status` varchar(30) NOT NULL DEFAULT '',
`ip` varchar(15) NOT NULL,
`device` varchar(30) NOT NULL,
`client` varchar(20) NOT NULL,
`manualIn` time NOT NULL,
`manualOut` time NOT NULL,
`manualIn` time NULL,
`manualOut` time NULL,
`reason` varchar(30) NOT NULL DEFAULT '',
`desc` text NOT NULL,
`desc` text NULL,
`reviewStatus` varchar(30) NULL,
`reviewedBy` char(30) NOT NULL DEFAULT '',
`reviewedDate` datetime NULL,
+3 -22
View File
@@ -540,10 +540,10 @@ class doc extends control
if(!empty($changes))
{
$newType = $_POST['status'];
if($doc->status == 'draft' and $newType == 'draft') $action = 'savedDraft';
if($doc->status == 'draft' and $newType == 'normal') $action = 'releasedDoc';
if($doc->status == 'normal' and $newType == 'normal') $action = 'Edited';
if($doc->status == $newType) $action = 'Edited';
}
$fileAction = '';
if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n";
$actionID = $this->action->create('doc', $docID, $action, $fileAction . $this->post->comment);
@@ -1221,26 +1221,7 @@ class doc extends control
}
}
$doc = $docID ? $doc : '';
/* Crumbs links array. */
$moduleName = 'doc';
$methodName = in_array($type, array('product', 'project')) ? $objectType . 'Space' : 'teamSpace';
$linkParams = "objectID={$objectID}&libID={$lib->id}";
if($this->app->tab == 'execution')
{
$moduleName = 'execution';
$methodName = 'doc';
$linkParams = "executionID=$objectID";
}
elseif($type == 'mine')
{
$linkParams = "type=mine&libID={$lib->id}";
$methodName = 'mySpace';
}
$spaceType = $objectType . 'Space';
$this->view->title = isset($this->lang->doc->{$spaceType}) ? $this->lang->doc->{$spaceType} : $this->lang->doc->common;
$this->view->title = $this->lang->doc->common . $this->lang->colon . $doc->title;
$this->view->docID = $docID;
$this->view->doc = $doc;
$this->view->version = $version;
+19 -12
View File
@@ -735,7 +735,7 @@ class docModel extends model
{
$modules = $module && $mode == 'children' ? $this->loadModel('tree')->getAllChildID($module) : $module;
$stmt = $this->dao->select('*')->from(TABLE_DOC)
->where('1=1')
->where('vision')->eq($this->config->vision)
->beginIF(!empty($modules))->andWhere('module')->in($modules)->fi()
->beginIF($mode == 'normal')->andWhere('deleted')->eq(0)->fi()
->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi()
@@ -2161,19 +2161,26 @@ class docModel extends model
*/
public function getStatisticInfo()
{
$allLibs = array_keys($this->getLibs('all'));
$docIdList = $this->getPrivDocs($allLibs);
$myDocList = $this->dao->select('id')->from(TABLE_DOC)->where('addedBy')->eq($this->app->user->account)->fetchPairs('id');
$today = date('Y-m-d');
$statistic = $this->dao->select("count(id) as totalDocs, count(IF(editedDate like '{$today}%', 1, null)) as todayEditedDocs,
count(IF(editedBy = '{$this->app->user->account}', 1, null)) as myEditedDocs, count(IF(addedBy = '{$this->app->user->account}', 1, null)) as myDocs")->from(TABLE_DOC)
->where('deleted')->eq(0)
->andWhere('vision')->eq($this->config->vision)
->andWhere('id')->in($docIdList)
->fetch();
$statistic = new stdclass();
$statistic->totalDocs = $this->dao->select('count(*) as count')->from(TABLE_DOC)->where('deleted')->eq('0')->fetch('count');
$statistic->todayEditedDocs = $this->dao->select('count(DISTINCT objectID) as count')->from(TABLE_ACTION)
->where('objectType')->eq('doc')
->andWhere('action')->eq('edited')
->andWhere('actor')->eq($this->app->user->account)
->andWhere('LEFT(date, 10)')->eq($today)
->fetch('count');
$statistic->myEditedDocs = $this->dao->select('count(DISTINCT objectID) as count')->from(TABLE_ACTION)
->where('objectType')->eq('doc')
->andWhere('action')->eq('edited')
->andWhere('actor')->eq($this->app->user->account)
->fetch('count');
$statistic->myDoc = $this->dao->select("count(IF(`action` = 'view', 1, null)) as docViews, count(IF(`action` = 'collect', 1, null)) as docCollects")->from(TABLE_DOCACTION)->where('doc')->in($myDocList)->fetch();
$my = $this->dao->select("count(*) as myDocs, SUM(views) as docViews, SUM(collects) as docCollects")->from(TABLE_DOC)->where('addedBy')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->fetch();
$statistic->myDocs = $my->myDocs;
$statistic->myDoc = new stdclass();
$statistic->myDoc->docViews = $my->docViews;
$statistic->myDoc->docCollects = $my->docCollects;
return $statistic;
}
+1 -7
View File
@@ -1098,10 +1098,7 @@ $lang->resource->testcase->batchChangeScene = 'batchChangeScene';
$lang->resource->testcase->updateOrder = 'updateOrder';
$lang->resource->testcase->importXmind = 'importXmind';
$lang->resource->testcase->saveXmindImport = 'saveXmindImport';
$lang->resource->testcase->exportXmind = 'exportXmind';
$lang->resource->testcase->getXmindImport = 'getXmindImport';
$lang->resource->testcase->showXMindImport = 'showXMindImport';
$lang->testcase->methodOrder[0] = 'index';
$lang->testcase->methodOrder[5] = 'browse';
@@ -1142,10 +1139,7 @@ $lang->testcase->methodOrder[170] = 'changeScene';
$lang->testcase->methodOrder[175] = 'batchChangeScene';
$lang->testcase->methodOrder[180] = 'updateOrder';
$lang->testcase->methodOrder[185] = 'importXmind';
$lang->testcase->methodOrder[190] = 'getXmindImport';
$lang->testcase->methodOrder[195] = 'showXMindImport';
$lang->testcase->methodOrder[200] = 'exportXmind';
$lang->testcase->methodOrder[205] = 'saveXmindImport';
$lang->testcase->methodOrder[190] = 'exportXmind';
/* Test task. */
$lang->resource->testtask = new stdclass();
+3
View File
@@ -3208,6 +3208,7 @@ class testcase extends control
*/
public function getXmindImport()
{
if(!commonModel::hasPriv("testcase", "importXmind")) $this->loadModel('common')->deny('testcase', 'importXmind');
$folder = $this->session->xmindImport;
$type = $this->session->xmindImportType;
@@ -3407,6 +3408,7 @@ class testcase extends control
*/
public function saveXmindImport()
{
if(!commonModel::hasPriv("testcase", "importXmind")) $this->loadModel('common')->deny('testcase', 'importXmind');
if(!empty($_POST))
{
$result = $this->testcase->saveXmindImport();
@@ -3426,6 +3428,7 @@ class testcase extends control
*/
public function showXMindImport($productID,$branch)
{
if(!commonModel::hasPriv("testcase", "importXmind")) $this->loadModel('common')->deny('testcase', 'importXmind');
$product = $this->product->getById($productID);
$branches = (isset($product->type) and $product->type != 'normal') ? $this->loadModel('branch')->getPairs($productID, 'active') : array();
$config = $this->testcase->getXmindConfig();