diff --git a/.gitignore b/.gitignore index 5529453cfe..69e739d7de 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,7 @@ tmp/cache/* tmp/extension/* .gitkeep .bak +.idea +.gitignore +.DS_Store +framework/ diff --git a/config/zentaopms.php b/config/zentaopms.php index 3e192df98c..e5dc9271ee 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -129,3 +129,5 @@ $config->objectTables['custom'] = TABLE_LANG; $config->objectTables['branch'] = TABLE_BRANCH; $config->objectTables['module'] = TABLE_MODULE; $config->objectTables['caselib'] = TABLE_TESTSUITE; +$config->objectTables['entry'] = TABLE_ENTRY; +$config->objectTables['webhook'] = TABLE_WEBHOOK; diff --git a/db/update9.5.1.sql b/db/update9.5.1.sql index 6368a5b6fe..eac3c36827 100644 --- a/db/update9.5.1.sql +++ b/db/update9.5.1.sql @@ -58,3 +58,32 @@ CREATE TABLE IF NOT EXISTS `zt_log` ( KEY `objectType` (`objectType`), KEY `obejctID` (`objectID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +ALTER TABLE `zt_task` ADD `parent` INT(11) NULL DEFAULT '0' AFTER `deleted`; +ALTER TABLE `zt_team` ADD `task` INT(11) NULL DEFAULT '0' AFTER `project`; +ALTER TABLE `zt_team` ADD `estimate` DECIMAL(12,2) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `zt_team` ADD `consumed` DECIMAL(12,2) UNSIGNED NOT NULL DEFAULT '0' AFTER `estimate`; +ALTER TABLE `zt_team` ADD `left` DECIMAL(12,2) UNSIGNED NOT NULL DEFAULT '0' AFTER `consumed`; +ALTER TABLE `zt_team` ADD `order` TINYINT(3) NOT NULL DEFAULT '0' AFTER `left`; +ALTER TABLE `zt_team` CHANGE `days` `days` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'; + +ALTER TABLE `zt_team` DROP PRIMARY KEY; +ALTER TABLE `zt_team` ADD PRIMARY KEY (`project`, `task`, `account`); + +ALTER TABLE `zt_user` ADD `score` DECIMAL(12,1) NOT NULL DEFAULT '0' AFTER `deleted`; +ALTER TABLE `zt_user` ADD `score_level` DECIMAL(12,1) NOT NULL DEFAULT '0' AFTER `score`; + +CREATE TABLE `zt_score` ( + `id` bigint(12) unsigned NOT NULL AUTO_INCREMENT, + `userID` int(11) NOT NULL DEFAULT '0', + `account` varchar(30) NOT NULL, + `model` varchar(30) NOT NULL, + `method` varchar(30) NOT NULL, + `score` decimal(12,1) NOT NULL DEFAULT '0.0', + `type` enum('repeat','one') NOT NULL DEFAULT 'repeat', + `time` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `model` (`model`), + KEY `method` (`method`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/framework/helper.class.php b/framework/helper.class.php index 165ba1bab1..39a7629714 100644 --- a/framework/helper.class.php +++ b/framework/helper.class.php @@ -140,4 +140,4 @@ function formatTime($time, $format = '') if(trim($time) == '') return ; if($format) return date($format, strtotime($time)); return trim($time); -} +} \ No newline at end of file diff --git a/module/action/ext/config/.gitkeep b/module/action/ext/config/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/action/ext/control/.gitkeep b/module/action/ext/control/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/action/ext/css/.gitkeep b/module/action/ext/css/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/action/ext/js/.gitkeep b/module/action/ext/js/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/action/ext/lang/en/.gitkeep b/module/action/ext/lang/en/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/action/ext/lang/zh-cn/.gitkeep b/module/action/ext/lang/zh-cn/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/action/ext/lang/zh-tw/.gitkeep b/module/action/ext/lang/zh-tw/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/action/ext/model/.gitkeep b/module/action/ext/model/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/action/ext/view/.gitkeep b/module/action/ext/view/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/admin/ext/config/.gitkeep b/module/admin/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/admin/ext/control/.gitkeep b/module/admin/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/admin/ext/css/.gitkeep b/module/admin/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/admin/ext/js/.gitkeep b/module/admin/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/admin/ext/lang/en/.gitkeep b/module/admin/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/admin/ext/lang/zh-cn/.gitkeep b/module/admin/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/admin/ext/lang/zh-tw/.gitkeep b/module/admin/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/admin/ext/model/.gitkeep b/module/admin/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/admin/ext/view/.gitkeep b/module/admin/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/api/ext/config/.gitkeep b/module/api/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/api/ext/control/.gitkeep b/module/api/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/api/ext/css/.gitkeep b/module/api/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/api/ext/js/.gitkeep b/module/api/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/api/ext/lang/en/.gitkeep b/module/api/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/api/ext/lang/zh-cn/.gitkeep b/module/api/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/api/ext/lang/zh-tw/.gitkeep b/module/api/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/api/ext/model/.gitkeep b/module/api/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/api/ext/view/.gitkeep b/module/api/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/bug/config.php b/module/bug/config.php index ed27b6af24..c9596cd8ac 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -165,7 +165,7 @@ $config->bug->search['params']['lastEditedDate']= array('operator' => '=', $config->bug->search['params']['deadline'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); $config->bug->datatable = new stdclass(); -$config->bug->datatable->defaultField = array('id', 'severity', 'pri', 'title', 'status', 'openedBy', 'openedDate', 'assignedTo', 'resolvedBy', 'resolution', 'resolvedDate', 'actions'); +$config->bug->datatable->defaultField = array('id', 'severity', 'pri', 'title', 'status', 'openedBy', 'openedDate', 'assignedTo', 'resolvedBy', 'resolution', 'actions'); $config->bug->datatable->fieldList['id']['title'] = 'idAB'; $config->bug->datatable->fieldList['id']['fixed'] = 'left'; @@ -174,7 +174,7 @@ $config->bug->datatable->fieldList['id']['required'] = 'yes'; $config->bug->datatable->fieldList['severity']['title'] = 'severityAB'; $config->bug->datatable->fieldList['severity']['fixed'] = 'left'; -$config->bug->datatable->fieldList['severity']['width'] = '50'; +$config->bug->datatable->fieldList['severity']['width'] = '40'; $config->bug->datatable->fieldList['severity']['required'] = 'no'; $config->bug->datatable->fieldList['pri']['title'] = 'P'; diff --git a/module/bug/model.php b/module/bug/model.php index 33e52442e6..8aa51a3250 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2310,8 +2310,9 @@ class bugModel extends model * @access public * @return void */ - public function printCell($col, $bug, $users, $builds, $branches, $modulePairs, $projects = array(), $plans = array(), $stories = array(), $tasks = array()) + public function printCell($col, $bug, $users, $builds, $branches, $modulePairs, $projects = array(), $plans = array(), $stories = array(), $tasks = array(), $mode = 'datatable') { + $canView = common::hasPriv('bug', 'view'); $bugLink = inlink('view', "bugID=$bug->id"); $account = $this->app->user->account; $id = $col->id; @@ -2319,15 +2320,17 @@ class bugModel extends model { $class = ''; if($id == 'status') $class .= ' bug-' . $bug->status; - if($id == 'title') $class .= ' text-left'; + if($id == 'title') $class .= ' text-left'; + if($id == 'id') $class .= ' cell-id'; if($id == 'assignedTo' && $bug->assignedTo == $account) $class .= ' red'; if($id == 'deadline' && isset($bug->delay)) $class .= ' delayed'; echo ""; - switch ($id) + switch($id) { case 'id': - echo html::a($bugLink, sprintf('%03d', $bug->id)); + if($mode == 'table') echo " "; + echo $canView ? html::a($bugLink, sprintf('%03d', $bug->id)) : sprintf('%03d', $bug->id); break; case 'severity': echo ""; @@ -2344,7 +2347,7 @@ class bugModel extends model echo "[{$this->lang->bug->confirmedList[$bug->confirmed]}] "; if($bug->branch)echo "{$branches[$bug->branch]} "; if($modulePairs and $bug->module)echo "{$modulePairs[$bug->module]} "; - echo html::a($bugLink, $bug->title, null, "style='color: $bug->color'"); + echo $canView ? html::a($bugLink, $bug->title, null, "style='color: $bug->color'") : "{$bug->title}"; break; case 'branch': echo $branches[$bug->branch]; @@ -2401,7 +2404,7 @@ class bugModel extends model echo substr($bug->openedDate, 5, 11); break; case 'openedBuild': - foreach(explode(',', $bug->openedBuild) as $build) echo zget($builds, $build) . '
'; + foreach(explode(',', $bug->openedBuild) as $build) echo zget($builds, $build) . ' '; break; case 'assignedTo': echo zget($users, $bug->assignedTo, $bug->assignedTo); diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index d2443e5a5e..85ea8cc01b 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -168,16 +168,37 @@ js::set('branch', $branch); moduleName . ucfirst($this->methodName); $useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable'); - $file2Include = $useDatatable ? dirname(__FILE__) . '/datatabledata.html.php' : dirname(__FILE__) . '/browsedata.html.php'; $vars = "productID=$productID&branch=$branch&browseType=$browseType¶m=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; - include $file2Include; + if($useDatatable) include '../../common/view/datatable.html.php'; + + $setting = $this->datatable->getSetting('bug'); + $widths = $this->datatable->setFixedFieldWidth($setting); + $columns = 0; ?> + ' id='bugList' data-checkable='true' data-fixed-left-width='' data-fixed-right-width='' data-custom-menu='true' data-checkbox-name='bugIDList[]'> + + + $value) + { + if($value->show) + { + $this->datatable->printHead($value, $orderBy, $vars); + $columns ++; + } + } + ?> + + + + + + $value) $this->bug->printCell($value, $bug, $users, $builds, $branches, $modulePairs, $projects, $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table');?> + + + - cookie->windowWidth >= $this->config->wideSize ? 13 : 11; - if($browseType == 'needconfirm') $columns = 8; - ?> + ' id='teamTr'> + + + + children)):?> + @@ -168,5 +182,56 @@ +
diff --git a/module/bug/view/browsedata.html.php b/module/bug/view/browsedata.html.php deleted file mode 100644 index 46c59e165b..0000000000 --- a/module/bug/view/browsedata.html.php +++ /dev/null @@ -1,114 +0,0 @@ - - * @package bug - * @version $Id$ - * @link http://www.zentao.net - */ -?> - - - - - - - - - - - - - - - - - cookie->windowWidth >= $this->config->wideSize):?> - - - - - - - - cookie->windowWidth >= $this->config->wideSize):?> - - - - - - - - - - - id");?> - - - - - - confirmed;?> - - - - - - - - - - cookie->windowWidth >= $this->config->wideSize):?> - - - - - - - - cookie->windowWidth >= $this->config->wideSize):?> - - - - - - - - - diff --git a/module/bug/view/datatabledata.html.php b/module/bug/view/datatabledata.html.php deleted file mode 100644 index 47be55c06c..0000000000 --- a/module/bug/view/datatabledata.html.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @package bug - * @version $Id$ - * @link http://www.zentao.net - */ -?> -datatable->getSetting('bug'); -$widths = $this->datatable->setFixedFieldWidth($setting); -extract($widths); -?> -
idAB);?> bug->severityAB);?> priAB);?> bug->title);?> bug->statusAB);?> bug->deadline);?>bug->story);?>actions;?>openedByAB);?>bug->openedDateAB);?>assignedToAB);?>bug->resolvedByAB);?>bug->resolutionAB);?>bug->resolvedDateAB);?>actions;?>
- - id));?> - bug->severityList, $bug->severity, $bug->severity);?>'>bug->severityList, $bug->severity, $bug->severity);?>bug->priList, $bug->pri, $bug->pri);?>'>bug->priList, $bug->pri, $bug->pri);?> - [{$lang->bug->confirmedList[$bug->confirmed]}] "; - if($bug->branch)echo "{$branches[$bug->branch]} "; - if($modulePairs and $bug->module)echo "{$modulePairs[$bug->module]} "; - echo html::a($bugLink, $bug->title, null, "style='color: $bug->color'"); - ?> - - needconfirm) - { - echo "({$lang->story->changed} "; - echo html::a($this->createLink('bug', 'confirmStoryChange', "bugID=$bug->id"), $lang->confirm, 'hiddenwin'); - echo ")"; - } - else - { - echo $lang->bug->statusList[$bug->status]; - } - ?> - deadline, 0, 4) > 0) echo substr($bug->deadline, 5, 6)?>createLink('story', 'view', "stoyID=$bug->story"), $bug->storyTitle, '_blank');?>bug->confirmStoryChange = $lang->confirm; common::printIcon('bug', 'confirmStoryChange', "bugID=$bug->id", '', 'list', '', 'hiddenwin')?>openedBy, $bug->openedBy);?>openedDate, 5, 11)?>assignedTo == $this->app->user->account) echo 'class="red"';?>>assignedTo, $bug->assignedTo);?>resolvedBy, $bug->resolvedBy)?>bug->resolutionList, $bug->resolution);?>resolvedDate, 5, 11)?> - id"; - common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'search', '', 'iframe', true); - common::printIcon('bug', 'assignTo', $params, $bug, 'list', '', '', 'iframe', true); - common::printIcon('bug', 'resolve', $params, $bug, 'list', '', '', 'iframe', true); - common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); - common::printIcon('bug', 'edit', $params, $bug, 'list'); - common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=bugID=$bug->id", $bug, 'list', 'copy'); - ?> -
- - $value) $this->datatable->printHead($value, $orderBy, $vars);?> - - - - - $value) $this->bug->printCell($value, $bug, $users, $builds, $branches, $modulePairs, $projects, $plans, $stories, $tasks);?> - - - diff --git a/module/build/ext/config/.gitkeep b/module/build/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/build/ext/control/.gitkeep b/module/build/ext/control/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/build/ext/css/.gitkeep b/module/build/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/build/ext/js/.gitkeep b/module/build/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/build/ext/lang/en/.gitkeep b/module/build/ext/lang/en/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/build/ext/lang/zh-cn/.gitkeep b/module/build/ext/lang/zh-cn/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/build/ext/lang/zh-tw/.gitkeep b/module/build/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/build/ext/model/.gitkeep b/module/build/ext/model/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/build/ext/view/.gitkeep b/module/build/ext/view/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/common/ext/config/.gitkeep b/module/common/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/common/ext/control/.gitkeep b/module/common/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/common/ext/css/.gitkeep b/module/common/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/common/ext/js/.gitkeep b/module/common/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/common/ext/lang/en/.gitkeep b/module/common/ext/lang/en/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/common/ext/lang/zh-cn/.gitkeep b/module/common/ext/lang/zh-cn/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/common/ext/lang/zh-tw/.gitkeep b/module/common/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/common/ext/model/.gitkeep b/module/common/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/common/ext/view/.gitkeep b/module/common/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/common/lang/en.php b/module/common/lang/en.php index c5197e1709..4be2bdbdcc 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -342,6 +342,7 @@ $lang->admin->menu->cron = array('link' => 'Cron|cron|index', 'subModule' = $lang->admin->menu->trashes = array('link' => 'Recycle|action|trash', 'subModule' => 'action'); $lang->admin->menu->dev = array('link' => 'Develop|dev|api', 'alias' => 'db', 'subModule' => 'dev,editor'); $lang->admin->menu->entry = array('link' => 'API|entry|browse', 'alias' => 'create,edit', 'subModule' => 'entry,webhook'); +$lang->admin->menu->score = array('link' => 'Score|score|browse', 'subModule' => 'score'); $lang->admin->menu->sso = 'RangerTeam|admin|sso'; $lang->convert = new stdclass(); @@ -354,6 +355,7 @@ $lang->editor = new stdclass(); $lang->mail = new stdclass(); $lang->cron = new stdclass(); $lang->dev = new stdclass(); +$lang->score = new stdclass(); $lang->entry = new stdclass(); $lang->webhook = new stdclass(); $lang->search = new stdclass(); @@ -368,6 +370,7 @@ $lang->custom->menu = $lang->admin->menu; $lang->editor->menu = $lang->admin->menu; $lang->mail->menu = $lang->admin->menu; $lang->dev->menu = $lang->admin->menu; +$lang->score->menu = $lang->admin->menu; $lang->webhook->menu = $lang->admin->menu; /* 菜单分组。*/ @@ -399,6 +402,7 @@ $lang->menugroup->custom = 'admin'; $lang->menugroup->editor = 'admin'; $lang->menugroup->mail = 'admin'; $lang->menugroup->dev = 'admin'; +$lang->menugroup->score = 'admin'; $lang->menugroup->entry = 'admin'; $lang->menugroup->webhook = 'admin'; @@ -519,44 +523,45 @@ $lang->icons['trash'] = 'trash'; $lang->icons['extension'] = 'th-large'; $lang->icons['app'] = 'th-large'; -$lang->icons['results'] = 'list-alt'; -$lang->icons['create'] = 'plus'; -$lang->icons['post'] = 'edit'; -$lang->icons['batchCreate'] = 'plus-sign'; -$lang->icons['batchEdit'] = 'edit-sign'; -$lang->icons['batchClose'] = 'off'; -$lang->icons['edit'] = 'pencil'; -$lang->icons['delete'] = 'remove'; -$lang->icons['copy'] = 'copy'; -$lang->icons['report'] = 'bar-chart'; -$lang->icons['export'] = 'download-alt'; -$lang->icons['report-file'] = 'file-powerpoint'; -$lang->icons['import'] = 'upload-alt'; -$lang->icons['finish'] = 'ok-sign'; -$lang->icons['resolve'] = 'ok-sign'; -$lang->icons['start'] = 'play'; -$lang->icons['restart'] = 'play'; -$lang->icons['run'] = 'play'; -$lang->icons['runCase'] = 'play'; -$lang->icons['batchRun'] = 'play-sign'; -$lang->icons['assign'] = 'hand-right'; -$lang->icons['assignTo'] = 'hand-right'; -$lang->icons['change'] = 'random'; -$lang->icons['link'] = 'link'; -$lang->icons['close'] = 'off'; -$lang->icons['activate'] = 'magic'; -$lang->icons['review'] = 'review'; -$lang->icons['confirm'] = 'search'; -$lang->icons['confirmBug'] = 'search'; -$lang->icons['putoff'] = 'calendar'; -$lang->icons['suspend'] = 'pause'; -$lang->icons['pause'] = 'pause'; -$lang->icons['cancel'] = 'ban-circle'; -$lang->icons['recordEstimate'] = 'time'; -$lang->icons['customFields'] = 'cogs'; -$lang->icons['manage'] = 'cog'; -$lang->icons['unlock'] = 'unlock-alt'; +$lang->icons['results'] = 'list-alt'; +$lang->icons['create'] = 'plus'; +$lang->icons['post'] = 'edit'; +$lang->icons['batchCreate'] = 'plus-sign'; +$lang->icons['batchEdit'] = 'edit-sign'; +$lang->icons['batchClose'] = 'off'; +$lang->icons['edit'] = 'pencil'; +$lang->icons['delete'] = 'remove'; +$lang->icons['copy'] = 'copy'; +$lang->icons['report'] = 'bar-chart'; +$lang->icons['export'] = 'download-alt'; +$lang->icons['report-file'] = 'file-powerpoint'; +$lang->icons['import'] = 'upload-alt'; +$lang->icons['finish'] = 'ok-sign'; +$lang->icons['resolve'] = 'ok-sign'; +$lang->icons['start'] = 'play'; +$lang->icons['restart'] = 'play'; +$lang->icons['run'] = 'play'; +$lang->icons['runCase'] = 'play'; +$lang->icons['batchRun'] = 'play-sign'; +$lang->icons['assign'] = 'hand-right'; +$lang->icons['assignTo'] = 'hand-right'; +$lang->icons['change'] = 'random'; +$lang->icons['link'] = 'link'; +$lang->icons['close'] = 'off'; +$lang->icons['activate'] = 'magic'; +$lang->icons['review'] = 'review'; +$lang->icons['confirm'] = 'search'; +$lang->icons['confirmBug'] = 'search'; +$lang->icons['putoff'] = 'calendar'; +$lang->icons['suspend'] = 'pause'; +$lang->icons['pause'] = 'pause'; +$lang->icons['cancel'] = 'ban-circle'; +$lang->icons['recordEstimate'] = 'time'; +$lang->icons['customFields'] = 'cogs'; +$lang->icons['manage'] = 'cog'; +$lang->icons['unlock'] = 'unlock-alt'; $lang->icons['confirmStoryChange'] = 'search'; +$lang->icons['score'] = 'tint'; include (dirname(__FILE__) . '/menuOrder.php'); diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index b55ab98d6b..6cd145fdb4 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -342,6 +342,7 @@ $lang->admin->menu->cron = array('link' => '计划任务|cron|index', 'subM $lang->admin->menu->trashes = array('link' => '回收站|action|trash', 'subModule' => 'action'); $lang->admin->menu->dev = array('link' => '二次开发|dev|api', 'alias' => 'db', 'subModule' => 'dev,editor'); $lang->admin->menu->entry = array('link' => '接口|entry|browse', 'alias' => 'create,edit', 'subModule' => 'entry,webhook'); +$lang->admin->menu->score = array('link' => '积分|score|browse', 'subModule' => 'score'); $lang->admin->menu->sso = '然之集成|admin|sso'; $lang->convert = new stdclass(); @@ -357,6 +358,7 @@ $lang->dev = new stdclass(); $lang->entry = new stdclass(); $lang->webhook = new stdclass(); $lang->search = new stdclass(); +$lang->score = new stdclass(); $lang->convert->menu = $lang->admin->menu; $lang->upgrade->menu = $lang->admin->menu; @@ -368,6 +370,7 @@ $lang->custom->menu = $lang->admin->menu; $lang->editor->menu = $lang->admin->menu; $lang->mail->menu = $lang->admin->menu; $lang->dev->menu = $lang->admin->menu; +$lang->score->menu = $lang->admin->menu; $lang->entry->menu = $lang->admin->menu; $lang->webhook->menu = $lang->admin->menu; @@ -400,6 +403,7 @@ $lang->menugroup->custom = 'admin'; $lang->menugroup->editor = 'admin'; $lang->menugroup->mail = 'admin'; $lang->menugroup->dev = 'admin'; +$lang->menugroup->score = 'admin'; $lang->menugroup->entry = 'admin'; $lang->menugroup->webhook = 'admin'; @@ -521,44 +525,45 @@ $lang->icons['trash'] = 'trash'; $lang->icons['extension'] = 'th-large'; $lang->icons['app'] = 'th-large'; -$lang->icons['results'] = 'list-alt'; -$lang->icons['create'] = 'plus'; -$lang->icons['post'] = 'edit'; -$lang->icons['batchCreate'] = 'plus-sign'; -$lang->icons['batchEdit'] = 'edit-sign'; -$lang->icons['batchClose'] = 'off'; -$lang->icons['edit'] = 'pencil'; -$lang->icons['delete'] = 'remove'; -$lang->icons['copy'] = 'copy'; -$lang->icons['report'] = 'bar-chart'; -$lang->icons['export'] = 'download-alt'; -$lang->icons['report-file'] = 'file-powerpoint'; -$lang->icons['import'] = 'upload-alt'; -$lang->icons['finish'] = 'ok-sign'; -$lang->icons['resolve'] = 'ok-sign'; -$lang->icons['start'] = 'play'; -$lang->icons['restart'] = 'play'; -$lang->icons['run'] = 'play'; -$lang->icons['runCase'] = 'play'; -$lang->icons['batchRun'] = 'play-sign'; -$lang->icons['assign'] = 'hand-right'; -$lang->icons['assignTo'] = 'hand-right'; -$lang->icons['change'] = 'random'; -$lang->icons['link'] = 'link'; -$lang->icons['close'] = 'off'; -$lang->icons['activate'] = 'magic'; -$lang->icons['review'] = 'review'; -$lang->icons['confirm'] = 'search'; -$lang->icons['confirmBug'] = 'search'; -$lang->icons['putoff'] = 'calendar'; -$lang->icons['suspend'] = 'pause'; -$lang->icons['pause'] = 'pause'; -$lang->icons['cancel'] = 'ban-circle'; -$lang->icons['recordEstimate'] = 'time'; -$lang->icons['customFields'] = 'cogs'; -$lang->icons['manage'] = 'cog'; -$lang->icons['unlock'] = 'unlock-alt'; +$lang->icons['results'] = 'list-alt'; +$lang->icons['create'] = 'plus'; +$lang->icons['post'] = 'edit'; +$lang->icons['batchCreate'] = 'plus-sign'; +$lang->icons['batchEdit'] = 'edit-sign'; +$lang->icons['batchClose'] = 'off'; +$lang->icons['edit'] = 'pencil'; +$lang->icons['delete'] = 'remove'; +$lang->icons['copy'] = 'copy'; +$lang->icons['report'] = 'bar-chart'; +$lang->icons['export'] = 'download-alt'; +$lang->icons['report-file'] = 'file-powerpoint'; +$lang->icons['import'] = 'upload-alt'; +$lang->icons['finish'] = 'ok-sign'; +$lang->icons['resolve'] = 'ok-sign'; +$lang->icons['start'] = 'play'; +$lang->icons['restart'] = 'play'; +$lang->icons['run'] = 'play'; +$lang->icons['runCase'] = 'play'; +$lang->icons['batchRun'] = 'play-sign'; +$lang->icons['assign'] = 'hand-right'; +$lang->icons['assignTo'] = 'hand-right'; +$lang->icons['change'] = 'random'; +$lang->icons['link'] = 'link'; +$lang->icons['close'] = 'off'; +$lang->icons['activate'] = 'magic'; +$lang->icons['review'] = 'review'; +$lang->icons['confirm'] = 'search'; +$lang->icons['confirmBug'] = 'search'; +$lang->icons['putoff'] = 'calendar'; +$lang->icons['suspend'] = 'pause'; +$lang->icons['pause'] = 'pause'; +$lang->icons['cancel'] = 'ban-circle'; +$lang->icons['recordEstimate'] = 'time'; +$lang->icons['customFields'] = 'cogs'; +$lang->icons['manage'] = 'cog'; +$lang->icons['unlock'] = 'unlock-alt'; $lang->icons['confirmStoryChange'] = 'search'; +$lang->icons['score'] = 'tint'; include (dirname(__FILE__) . '/menuOrder.php'); diff --git a/module/common/lang/zh-tw.php b/module/common/lang/zh-tw.php index ec34be2292..d05ad0e980 100644 --- a/module/common/lang/zh-tw.php +++ b/module/common/lang/zh-tw.php @@ -341,6 +341,7 @@ $lang->admin->menu->safe = array('link' => '安全|admin|safe', 'alias' => $lang->admin->menu->cron = array('link' => '計劃任務|cron|index', 'subModule' => 'cron'); $lang->admin->menu->trashes = array('link' => '資源回收筒|action|trash', 'subModule' => 'action'); $lang->admin->menu->dev = array('link' => '二次開發|dev|api', 'alias' => 'db', 'subModule' => 'dev,editor'); +$lang->admin->menu->score = array('link' => '積分|score|browse', 'subModule' => 'score'); $lang->admin->menu->sso = '然之整合|admin|sso'; $lang->convert = new stdclass(); @@ -354,6 +355,7 @@ $lang->mail = new stdclass(); $lang->cron = new stdclass(); $lang->dev = new stdclass(); $lang->search = new stdclass(); +$lang->score = new stdclass(); $lang->convert->menu = $lang->admin->menu; $lang->upgrade->menu = $lang->admin->menu; @@ -365,6 +367,7 @@ $lang->custom->menu = $lang->admin->menu; $lang->editor->menu = $lang->admin->menu; $lang->mail->menu = $lang->admin->menu; $lang->dev->menu = $lang->admin->menu; +$lang->scoret->menu = $lang->admin->menu; /* 菜單分組。*/ $lang->menugroup = new stdclass(); @@ -395,6 +398,7 @@ $lang->menugroup->custom = 'admin'; $lang->menugroup->editor = 'admin'; $lang->menugroup->mail = 'admin'; $lang->menugroup->dev = 'admin'; +$lang->menugroup->score = 'admin'; /* 錯誤提示信息。*/ $lang->error = new stdclass(); @@ -513,44 +517,45 @@ $lang->icons['trash'] = 'trash'; $lang->icons['extension'] = 'th-large'; $lang->icons['app'] = 'th-large'; -$lang->icons['results'] = 'list-alt'; -$lang->icons['create'] = 'plus'; -$lang->icons['post'] = 'edit'; -$lang->icons['batchCreate'] = 'plus-sign'; -$lang->icons['batchEdit'] = 'edit-sign'; -$lang->icons['batchClose'] = 'off'; -$lang->icons['edit'] = 'pencil'; -$lang->icons['delete'] = 'remove'; -$lang->icons['copy'] = 'copy'; -$lang->icons['report'] = 'bar-chart'; -$lang->icons['export'] = 'download-alt'; -$lang->icons['report-file'] = 'file-powerpoint'; -$lang->icons['import'] = 'upload-alt'; -$lang->icons['finish'] = 'ok-sign'; -$lang->icons['resolve'] = 'ok-sign'; -$lang->icons['start'] = 'play'; -$lang->icons['restart'] = 'play'; -$lang->icons['run'] = 'play'; -$lang->icons['runCase'] = 'play'; -$lang->icons['batchRun'] = 'play-sign'; -$lang->icons['assign'] = 'hand-right'; -$lang->icons['assignTo'] = 'hand-right'; -$lang->icons['change'] = 'random'; -$lang->icons['link'] = 'link'; -$lang->icons['close'] = 'off'; -$lang->icons['activate'] = 'magic'; -$lang->icons['review'] = 'review'; -$lang->icons['confirm'] = 'search'; -$lang->icons['confirmBug'] = 'search'; -$lang->icons['putoff'] = 'calendar'; -$lang->icons['suspend'] = 'pause'; -$lang->icons['pause'] = 'pause'; -$lang->icons['cancel'] = 'ban-circle'; -$lang->icons['recordEstimate'] = 'time'; -$lang->icons['customFields'] = 'cogs'; -$lang->icons['manage'] = 'cog'; -$lang->icons['unlock'] = 'unlock-alt'; +$lang->icons['results'] = 'list-alt'; +$lang->icons['create'] = 'plus'; +$lang->icons['post'] = 'edit'; +$lang->icons['batchCreate'] = 'plus-sign'; +$lang->icons['batchEdit'] = 'edit-sign'; +$lang->icons['batchClose'] = 'off'; +$lang->icons['edit'] = 'pencil'; +$lang->icons['delete'] = 'remove'; +$lang->icons['copy'] = 'copy'; +$lang->icons['report'] = 'bar-chart'; +$lang->icons['export'] = 'download-alt'; +$lang->icons['report-file'] = 'file-powerpoint'; +$lang->icons['import'] = 'upload-alt'; +$lang->icons['finish'] = 'ok-sign'; +$lang->icons['resolve'] = 'ok-sign'; +$lang->icons['start'] = 'play'; +$lang->icons['restart'] = 'play'; +$lang->icons['run'] = 'play'; +$lang->icons['runCase'] = 'play'; +$lang->icons['batchRun'] = 'play-sign'; +$lang->icons['assign'] = 'hand-right'; +$lang->icons['assignTo'] = 'hand-right'; +$lang->icons['change'] = 'random'; +$lang->icons['link'] = 'link'; +$lang->icons['close'] = 'off'; +$lang->icons['activate'] = 'magic'; +$lang->icons['review'] = 'review'; +$lang->icons['confirm'] = 'search'; +$lang->icons['confirmBug'] = 'search'; +$lang->icons['putoff'] = 'calendar'; +$lang->icons['suspend'] = 'pause'; +$lang->icons['pause'] = 'pause'; +$lang->icons['cancel'] = 'ban-circle'; +$lang->icons['recordEstimate'] = 'time'; +$lang->icons['customFields'] = 'cogs'; +$lang->icons['manage'] = 'cog'; +$lang->icons['unlock'] = 'unlock-alt'; $lang->icons['confirmStoryChange'] = 'search'; +$lang->icons['score'] = 'tint'; include (dirname(__FILE__) . '/menuOrder.php'); diff --git a/module/common/model.php b/module/common/model.php index 797fdfdd13..941b993d29 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -817,7 +817,7 @@ class commonModel extends model if(strtolower($key) == 'closeddate' && $value == '') continue; if($magicQuote) $value = stripslashes($value); - if($value != stripslashes($old->$key)) + if(isset($old->$key) and $value != stripslashes($old->$key)) { $diff = ''; if(substr_count($value, "\n") > 1 or diff --git a/module/company/ext/config/.gitkeep b/module/company/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/company/ext/control/.gitkeep b/module/company/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/company/ext/css/.gitkeep b/module/company/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/company/ext/js/.gitkeep b/module/company/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/company/ext/lang/en/.gitkeep b/module/company/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/company/ext/lang/zh-cn/.gitkeep b/module/company/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/company/ext/lang/zh-tw/.gitkeep b/module/company/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/company/ext/model/.gitkeep b/module/company/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/company/ext/view/.gitkeep b/module/company/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/company/lang/en.php b/module/company/lang/en.php index 1f65792ae8..2404d5a94e 100644 --- a/module/company/lang/en.php +++ b/module/company/lang/en.php @@ -31,5 +31,5 @@ $lang->company->product = $lang->productCommon; $lang->company->project = $lang->projectCommon; $lang->company->user = 'User'; -$lang->company->guestList[0] = 'On'; -$lang->company->guestList[1] = 'Off'; +$lang->company->guestList[0] = 'Off'; +$lang->company->guestList[1] = 'On'; diff --git a/module/convert/ext/config/.gitkeep b/module/convert/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/convert/ext/control/.gitkeep b/module/convert/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/convert/ext/css/.gitkeep b/module/convert/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/convert/ext/js/.gitkeep b/module/convert/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/convert/ext/lang/en/.gitkeep b/module/convert/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/convert/ext/lang/zh-cn/.gitkeep b/module/convert/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/convert/ext/lang/zh-tw/.gitkeep b/module/convert/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/convert/ext/model/.gitkeep b/module/convert/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/convert/ext/view/.gitkeep b/module/convert/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/custom/config.php b/module/custom/config.php index 68704b8316..ac2db60060 100644 --- a/module/custom/config.php +++ b/module/custom/config.php @@ -8,3 +8,40 @@ $config->custom->canAdd['testtask'] = 'priList'; $config->custom->canAdd['todo'] = 'priList,typeList'; $config->custom->canAdd['user'] = 'roleList'; $config->custom->canAdd['block'] = ''; + +$config->custom->requiredModules[10] = 'todo'; + +$config->custom->requiredModules[15] = 'product'; +$config->custom->requiredModules[20] = 'story'; +$config->custom->requiredModules[25] = 'productplan'; +$config->custom->requiredModules[30] = 'release'; + +$config->custom->requiredModules[35] = 'project'; +$config->custom->requiredModules[40] = 'task'; +$config->custom->requiredModules[45] = 'build'; + +$config->custom->requiredModules[50] = 'bug'; +$config->custom->requiredModules[55] = 'testcase'; +$config->custom->requiredModules[60] = 'testsuite'; +$config->custom->requiredModules[65] = 'testreport'; +$config->custom->requiredModules[70] = 'testtask'; + +$config->custom->requiredModules[75] = 'doc'; + +$config->custom->requiredModules[80] = 'group'; +$config->custom->requiredModules[85] = 'user'; + +$config->custom->requiredModules[95] = 'entry'; +$config->custom->requiredModules[100] = 'webhook'; + +$config->custom->fieldList['group'] = 'name,desc'; + +$config->custom->excludeFieldList['product'] = 'order'; +$config->custom->excludeFieldList['story'] = 'version,duplicateStory,linkStories,childStories,toBug,fromBug'; +$config->custom->excludeFieldList['project'] = 'order'; +$config->custom->excludeFieldList['task'] = 'fromBug'; +$config->custom->excludeFieldList['bug'] = 'storyVersion,toTask,toStory,hardware,found,confirmed,activatedCount,activatedDate,linkBug,case,caseVersion,result,testtask,repo'; +$config->custom->excludeFieldList['testcase'] = 'version,lastRunResult,lastRunDate,lastRunner,linkCase,fromBug'; +$config->custom->excludeFieldList['testreport'] = 'objectType'; +$config->custom->excludeFieldList['doc'] = 'version'; +$config->custom->excludeFieldList['user'] = 'ranzhi,visits,ip,last'; diff --git a/module/custom/control.php b/module/custom/control.php index bede50f426..f6d9afdd76 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -230,6 +230,51 @@ class custom extends control $this->display(); } + /** + * Set Required. + * + * @param string $moduleName + * @access public + * @return void + */ + public function required($moduleName = '') + { + if($_POST) + { + $this->custom->saveRequiredFields($moduleName); + die(js::reload('parent.parent')); + } + + if(empty($moduleName)) $moduleName = current($this->config->custom->requiredModules); + + foreach($this->config->custom->requiredModules as $requiredModule) $this->app->loadLang($requiredModule); + + /* Get this module requiredFields. */ + $this->loadModel($moduleName); + $requiredFields = $this->custom->getRequiredFields($this->config->$moduleName); + + if($moduleName == 'doc') + { + unset($requiredFields['createLib']); + unset($requiredFields['editLib']); + } + + $fields = $this->custom->getDBFields($moduleName); + if($moduleName == 'testsuite') + { + $this->app->loadLang('testcase'); + $this->view->caseFields = $this->custom->getDBFields('testcase'); + } + + $this->view->title = $this->lang->custom->required; + $this->view->position[] = $this->lang->custom->required; + + $this->view->requiredFields = $requiredFields; + $this->view->moduleName = $moduleName; + $this->view->fields = $fields; + $this->display(); + } + /** * Ajax save custom fields. * @@ -310,7 +355,7 @@ class custom extends control if(is_array($menus)) { - foreach ($menus as $menu) + foreach($menus as $menu) { $menu = json_decode($menu); $this->custom->saveCustomMenu($menu->value, $menu->module, isset($menu->method) ? $menu->method : ''); @@ -374,11 +419,29 @@ class custom extends control * @access public * @return void */ - public function ajaxRestoreMenu($confirm = 'no') + public function ajaxRestoreMenu($setPublic = 0, $confirm = 'no') { - if($confirm == 'no') die(js::confirm($this->lang->custom->confirmRestore, inlink('ajaxRestoreMenu', "confirm=yes"))); + if($confirm == 'no') die(js::confirm($this->lang->custom->confirmRestore, inlink('ajaxRestoreMenu', "setPublic=$setPublic&confirm=yes"))); - $this->loadModel('setting')->deleteItems("owner={$this->app->user->account}&module=common§ion=customMenu"); + $account = $this->app->user->account; + if($setPublic) $account = 'system'; + $this->loadModel('setting')->deleteItems("owner={$account}&module=common§ion=customMenu"); + die(js::reload('parent.parent')); + } + + /** + * Reset required. + * + * @param srting $module + * @param string $confirm + * @access public + * @return void + */ + public function resetRequired($module, $confirm = 'no') + { + if($confirm == 'no') die(js::confirm($this->lang->custom->confirmRestore, inlink('resetRequired', "module=$module&confirm=yes"))); + + $this->loadModel('setting')->deleteItems("owner=system&module={$module}&key=requiredFields"); die(js::reload('parent.parent')); } } diff --git a/module/custom/js/ajaxmenu.js b/module/custom/js/ajaxmenu.js index 5d28e83f53..44655c78a8 100644 --- a/module/custom/js/ajaxmenu.js +++ b/module/custom/js/ajaxmenu.js @@ -217,9 +217,10 @@ $(function() }); }); - postData = $.map(postData, JSON.stringify); + postData = $.map(postData, JSON.stringify); + setPublic = $('#setPublic1').prop('checked') ? 1 : 0; - $.post(createLink('custom', 'ajaxSetMenu'), {menus: postData}, function(data) + $.post(createLink('custom', 'ajaxSetMenu'), {menus: postData, setPublic: setPublic}, function(data) { if(data.result === 'success') window.parent.location.reload() if(data.message) alert(data.message); @@ -242,4 +243,10 @@ $(function() { window.parent.$.closeModal(); }); + + $('#resetMenuBtn').click(function() + { + var setPublic = $('#setPublic1').prop('checked') ? 1 : 0; + hiddenwin.location.href = createLink('custom', 'ajaxRestoreMenu', "public=" + setPublic); + }); }); diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index 0e45826aab..e8e23962d1 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -13,6 +13,8 @@ $lang->custom->owner = 'Owner'; $lang->custom->module = 'Module'; $lang->custom->section = 'Section'; $lang->custom->lang = 'Language'; +$lang->custom->setPublic = 'Set Public'; +$lang->custom->required = 'Required'; $lang->custom->object['story'] = 'Story'; $lang->custom->object['task'] = 'Task'; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index 914abf963f..fad9789299 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -13,6 +13,8 @@ $lang->custom->owner = '所有者'; $lang->custom->module = '模块'; $lang->custom->section = '附加部分'; $lang->custom->lang = '所属语言'; +$lang->custom->setPublic = '设为公共'; +$lang->custom->required = '必填项'; $lang->custom->object['story'] = '需求'; $lang->custom->object['task'] = '任务'; diff --git a/module/custom/model.php b/module/custom/model.php index dae69c8b3f..56357abac1 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -359,6 +359,8 @@ class customModel extends model $account = $this->app->user->account; $settingKey = ''; + $setPublic = $this->post->setPublic; + if($setPublic) $account = 'system'; if(!is_string($menu)) $menu = json_encode($menu); $flow = $this->config->global->flow; @@ -373,4 +375,100 @@ class customModel extends model $this->loadModel('setting')->setItem($settingKey, $menu); } + + /** + * Get required fields by config. + * + * @param object $moduleConfig + * @access public + * @return array + */ + public function getRequiredFields($moduleConfig) + { + $requiredFields = array(); + foreach($moduleConfig as $method => $subConfig) + { + if(is_object($subConfig) and isset($subConfig->requiredFields)) $requiredFields[$method] = trim(str_replace(' ', '', $subConfig->requiredFields)); + } + + return $requiredFields; + } + + /** + * Get module fields. + * + * @param string $moduleName + * @param string $method + * @access public + * @return array + */ + public function getDBFields($moduleName, $method = '') + { + $fields = array(); + $moduleLang = $this->lang->$moduleName; + $customFields = $this->config->custom->fieldList; + if(isset($customFields[$moduleName])) + { + $fieldList = isset($customFields[$moduleName][$method]) ? $customFields[$moduleName][$method] : $customFields[$moduleName]; + foreach(explode(',', $fieldList) as $fieldName) + { + if(isset($moduleLang->$fieldName) and is_string($moduleLang->$fieldName)) $fields[$fieldName] = $moduleLang->$fieldName; + } + } + else + { + $table = zget($this->config->objectTables, $moduleName, ''); + if($table) + { + $excludeFieldList = zget($this->config->custom->excludeFieldList, $moduleName, ''); + foreach($this->dao->query("DESC $table")->fetchAll() as $field) + { + $fieldName = $field->Field; + if($fieldName == 'id' or $fieldName == 'deleted') continue; + if($fieldName == 'openedBy' or $fieldName == 'createdBy' or $fieldName == 'addedBy') continue; + if($fieldName == 'openedDate' or $fieldName == 'createdDate' or $fieldName == 'addedDate') continue; + if($fieldName == 'lastEditedBy' or $fieldName == 'editedBy') continue; + if($fieldName == 'lastEditedDate' or $fieldName == 'editedDate') continue; + if(isset($excludeFieldList) and strpos(",{$excludeFieldList},", ",$fieldName,") !== false) continue; + if(isset($moduleLang->$fieldName) and is_string($moduleLang->$fieldName)) $fields[$fieldName] = $moduleLang->$fieldName; + } + } + } + return $fields; + } + + /** + * Save required fields. + * + * @param int $moduleName + * @access public + * @return void + */ + public function saveRequiredFields($moduleName) + { + if(isset($this->config->system->$moduleName)) unset($this->config->system->$moduleName); + if(isset($this->config->personal->$moduleName)) unset($this->config->personal->$moduleName); + + $this->loadModel($moduleName); + $systemFields = $this->getRequiredFields($this->config->$moduleName); + + $data = fixer::input('post')->get(); + $requiredFields = array(); + foreach($data->requiredFields as $method => $fields) + { + $method = strtolower($method); + $systemField = $this->config->$moduleName->$method->requiredFields; + + $fields = join(',', $fields); + foreach(explode(',', $systemField) as $field) + { + $field = trim($field); + if(strpos(",$fields,", ",$field,") === false) $fields .= ",$field"; + } + + $requiredFields[$method]['requiredFields'] = $fields; + } + + $this->loadModel('setting')->setItems("system.{$moduleName}", $requiredFields); + } } diff --git a/module/custom/view/ajaxmenu.html.php b/module/custom/view/ajaxmenu.html.php index 3377f6b564..fdb196964d 100644 --- a/module/custom/view/ajaxmenu.html.php +++ b/module/custom/view/ajaxmenu.html.php @@ -32,9 +32,10 @@
+ $lang->custom->setPublic));?>     - custom->restore, 'hiddenwin', "class='btn'")?> +     custom->menuTip ?>
diff --git a/module/custom/view/flow.html.php b/module/custom/view/flow.html.php index 136f901914..b906fd201d 100644 --- a/module/custom/view/flow.html.php +++ b/module/custom/view/flow.html.php @@ -10,24 +10,7 @@ * @link http://www.zentao.net */ ?> - -
- -
+
@@ -49,4 +32,10 @@
+ diff --git a/module/custom/view/header.html.php b/module/custom/view/header.html.php new file mode 100644 index 0000000000..53e96d64b7 --- /dev/null +++ b/module/custom/view/header.html.php @@ -0,0 +1,20 @@ + +
+ +
diff --git a/module/custom/view/required.html.php b/module/custom/view/required.html.php new file mode 100644 index 0000000000..71161126a7 --- /dev/null +++ b/module/custom/view/required.html.php @@ -0,0 +1,69 @@ + + * @package custom + * @version $Id$ + * @link http://www.zentao.net + */ +?> + +
+
+ custom->requiredModules as $requiredModule) + { + echo "
  • " . html::a(inlink('required', "module=$requiredModule"), $lang->$requiredModule->common) . "
  • "; + } + ?> +
    +
    +
    +
    +
    +
    + $moduleName->common?> +
    + + $requiredField):?> + + + + + + + + + + +
    + $moduleName->$method; + ?> +
    + custom->restore, 'hiddenwin', "class='btn'"); + ?> +
    +
    +
    +
    + + diff --git a/module/custom/view/set.html.php b/module/custom/view/set.html.php index baafa0006d..726474c997 100644 --- a/module/custom/view/set.html.php +++ b/module/custom/view/set.html.php @@ -10,7 +10,7 @@ * @link http://www.zentao.net */ ?> - + @@ -31,23 +31,6 @@ EOT; -
    - -
    - -
    - -
    +
    @@ -39,4 +22,10 @@
    + diff --git a/module/datatable/control.php b/module/datatable/control.php index 02391e4667..bfcbd6fea0 100644 --- a/module/datatable/control.php +++ b/module/datatable/control.php @@ -62,11 +62,12 @@ class datatable extends control $this->loadModel('testcase'); $this->app->loadConfig('testtask'); $this->config->testcase->datatable->defaultField = $this->config->testtask->datatable->defaultField; - $this->config->testcase->datatable->fieldList['assignedTo']['title'] = 'assignedTo'; - $this->config->testcase->datatable->fieldList['assignedTo']['fixed'] = 'no'; - $this->config->testcase->datatable->fieldList['assignedTo']['width'] = '80'; - $this->config->testcase->datatable->fieldList['assignedTo']['required'] = 'no'; - $this->config->testcase->datatable->fieldList['actions']['width'] = '100'; + $this->config->testcase->datatable->fieldList['actions']['width'] = '100'; + } + if($module == 'testcase') + { + $this->loadModel('testcase'); + unset($this->config->testcase->datatable->fieldList['assignedTo']); } $this->view->module = $module; diff --git a/module/datatable/model.php b/module/datatable/model.php index 28d2e68fbf..342778e247 100644 --- a/module/datatable/model.php +++ b/module/datatable/model.php @@ -72,6 +72,7 @@ class datatableModel extends model $set->fixed = $fieldList[$id]['fixed']; $set->title = $fieldList[$id]['title']; $set->sort = isset($fieldList[$id]['sort']) ? $fieldList[$id]['sort'] : 'yes'; + $set->name = isset($fieldList[$id]['name']) ? $fieldList[$id]['name'] : ''; $setting[$key] = $set; } } @@ -123,7 +124,12 @@ class datatableModel extends model $id = $col->id; if($col->show) { - echo "
    "; + $fixed = $col->fixed == 'no' ? 'true': 'false'; + $width = is_numeric($col->width) ? "{$col->width}px" : $col->width; + $sorter = (isset($col->sort) and $col->sort == 'no') ? '' : '{sorter:false}'; + $title = isset($col->name) ? "title='$col->name'" : ''; + + echo ""; if($id == 'actions') { echo $this->lang->actions; diff --git a/module/datatable/view/ajaxcustom.html.php b/module/datatable/view/ajaxcustom.html.php index ea1c2686d3..37f34fcdcd 100644 --- a/module/datatable/view/ajaxcustom.html.php +++ b/module/datatable/view/ajaxcustom.html.php @@ -62,7 +62,8 @@
    ' data-key='' data-fixed='' data-width=''>   ({$lang->datatable->required})"?>
    - datatable->width?> '> + + datatable->width?> '>
    @@ -179,8 +180,9 @@ $(function() var setting = $('.col').map(function(index) { var $col = $(this); - var sets = {id: $col.data('key'), order: index + 1, show: !$col.hasClass('disabled'), width: $col.find('input').val(), fixed: $col.data('fixed')}; + var sets = {id: $col.data('key'), order: index + 1, show: !$col.hasClass('disabled'), width: $col.find('input#width').val(), fixed: $col.data('fixed')}; if(sets.width !== 'auto') sets.width += 'px'; + if($col.find('#name').size() > 0) sets.name = $col.find('#name').val(); return sets; }).get(); diff --git a/module/dept/ext/config/.gitkeep b/module/dept/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/dept/ext/control/.gitkeep b/module/dept/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/dept/ext/css/.gitkeep b/module/dept/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/dept/ext/js/.gitkeep b/module/dept/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/dept/ext/lang/en/.gitkeep b/module/dept/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/dept/ext/lang/zh-cn/.gitkeep b/module/dept/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/dept/ext/lang/zh-tw/.gitkeep b/module/dept/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/dept/ext/model/.gitkeep b/module/dept/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/dept/ext/view/.gitkeep b/module/dept/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/doc/ext/config/.gitkeep b/module/doc/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/doc/ext/control/.gitkeep b/module/doc/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/doc/ext/css/.gitkeep b/module/doc/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/doc/ext/js/.gitkeep b/module/doc/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/doc/ext/lang/en/.gitkeep b/module/doc/ext/lang/en/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/doc/ext/lang/zh-cn/.gitkeep b/module/doc/ext/lang/zh-cn/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/doc/ext/lang/zh-tw/.gitkeep b/module/doc/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/doc/ext/model/.gitkeep b/module/doc/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/doc/ext/view/.gitkeep b/module/doc/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/doc/model.php b/module/doc/model.php index b28231f121..499aeb7f9e 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -457,8 +457,17 @@ class docModel extends model ->remove('comment,files,labels,uid') ->get(); if($doc->acl == 'private') $doc->users = $oldDoc->addedBy; + $oldDocContent = $this->dao->select('files,type')->from(TABLE_DOCCONTENT)->where('doc')->eq($docID)->andWhere('version')->eq($oldDoc->version)->fetch(); - if($oldDocContent->type == 'markdown') $doc->content = str_replace('>', '>', $doc->content); + if($oldDocContent) + { + $oldDoc->title = $oldDocContent->title; + $oldDoc->digest = $oldDocContent->digest; + $oldDoc->content = $oldDocContent->content; + $oldDoc->contentType = $oldDocContent->type; + + if($oldDocContent->type == 'markdown') $doc->content = str_replace('>', '>', $doc->content); + } $lib = $this->getLibByID($doc->lib); $doc = $this->loadModel('file')->processImgURL($doc, $this->config->doc->editor->edit['id'], $this->post->uid); @@ -484,9 +493,9 @@ class docModel extends model $docContent->title = $doc->title; $docContent->content = $doc->content; $docContent->version = $doc->version; - $docContent->digest = $doc->digest; $docContent->type = $oldDocContent->type; $docContent->files = $oldDocContent->files; + if(isset($doc->digest)) $docContent->digest = $doc->digest; if($files) $docContent->files .= ',' . join(',', array_keys($files)); $docContent->files = trim($docContent->files, ','); $this->dao->insert(TABLE_DOCCONTENT)->data($docContent)->exec(); diff --git a/module/editor/ext/config/.gitkeep b/module/editor/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/editor/ext/control/.gitkeep b/module/editor/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/editor/ext/css/.gitkeep b/module/editor/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/editor/ext/js/.gitkeep b/module/editor/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/editor/ext/lang/en/.gitkeep b/module/editor/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/editor/ext/lang/zh-cn/.gitkeep b/module/editor/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/editor/ext/lang/zh-tw/.gitkeep b/module/editor/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/editor/ext/model/.gitkeep b/module/editor/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/editor/ext/view/.gitkeep b/module/editor/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/extension/ext/config/.gitkeep b/module/extension/ext/config/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/extension/ext/control/.gitkeep b/module/extension/ext/control/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/extension/ext/css/.gitkeep b/module/extension/ext/css/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/extension/ext/js/.gitkeep b/module/extension/ext/js/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/extension/ext/lang/en/.gitkeep b/module/extension/ext/lang/en/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/extension/ext/lang/zh-cn/.gitkeep b/module/extension/ext/lang/zh-cn/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/extension/ext/lang/zh-tw/.gitkeep b/module/extension/ext/lang/zh-tw/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/extension/ext/model/.gitkeep b/module/extension/ext/model/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/extension/ext/view/.gitkeep b/module/extension/ext/view/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/file/ext/config/.gitkeep b/module/file/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/file/ext/control/.gitkeep b/module/file/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/file/ext/css/.gitkeep b/module/file/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/file/ext/js/.gitkeep b/module/file/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/file/ext/lang/en/.gitkeep b/module/file/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/file/ext/lang/zh-cn/.gitkeep b/module/file/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/file/ext/lang/zh-tw/.gitkeep b/module/file/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/file/ext/model/.gitkeep b/module/file/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/file/ext/view/.gitkeep b/module/file/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/git/ext/config/.gitkeep b/module/git/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/git/ext/control/.gitkeep b/module/git/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/git/ext/css/.gitkeep b/module/git/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/git/ext/js/.gitkeep b/module/git/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/git/ext/lang/.gitkeep b/module/git/ext/lang/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/git/ext/model/.gitkeep b/module/git/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/git/ext/view/.gitkeep b/module/git/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/group/ext/config/.gitkeep b/module/group/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/group/ext/control/.gitkeep b/module/group/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/group/ext/css/.gitkeep b/module/group/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/group/ext/js/.gitkeep b/module/group/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/group/ext/lang/en/.gitkeep b/module/group/ext/lang/en/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/group/ext/lang/zh-cn/.gitkeep b/module/group/ext/lang/zh-cn/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/group/ext/lang/zh-tw/.gitkeep b/module/group/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/group/ext/model/.gitkeep b/module/group/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/group/ext/view/.gitkeep b/module/group/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 05bde960eb..23ef7835c1 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -321,6 +321,8 @@ $lang->resource->project->kanban = 'kanban'; $lang->resource->project->printKanban = 'printKanban'; $lang->resource->project->tree = 'tree'; $lang->resource->project->all = 'all'; +$lang->resource->project->kanbanHideCols = 'kanbanHideCols'; +$lang->resource->project->kanbanColsColor = 'kanbanColsColor'; $lang->project->methodOrder[0] = 'index'; $lang->project->methodOrder[5] = 'view'; @@ -360,6 +362,8 @@ $lang->project->methodOrder[175] = 'kanban'; $lang->project->methodOrder[180] = 'printKanban'; $lang->project->methodOrder[185] = 'tree'; $lang->project->methodOrder[190] = 'all'; +$lang->project->methodOrder[195] = 'kanbanHideCols'; +$lang->project->methodOrder[200] = 'kanbanColsColor'; /* Task. */ $lang->resource->task = new stdclass(); @@ -714,17 +718,24 @@ $lang->mail->methodOrder[60] = 'sendcloudUser'; /* custom. */ $lang->resource->custom = new stdclass(); -$lang->resource->custom->index = 'index'; -$lang->resource->custom->set = 'set'; -$lang->resource->custom->restore = 'restore'; -$lang->resource->custom->flow = 'flow'; -$lang->resource->custom->working = 'working'; +$lang->resource->custom->index = 'index'; +$lang->resource->custom->set = 'set'; +$lang->resource->custom->restore = 'restore'; +$lang->resource->custom->flow = 'flow'; +$lang->resource->custom->working = 'working'; +$lang->resource->custom->setPublic = 'setPublic'; $lang->custom->methodOrder[5] = 'index'; $lang->custom->methodOrder[10] = 'set'; $lang->custom->methodOrder[15] = 'restore'; $lang->custom->methodOrder[20] = 'flow'; $lang->custom->methodOrder[25] = 'working'; +$lang->custom->methodOrder[30] = 'setPublic'; + +$lang->resource->datatable = new stdclass(); +$lang->resource->datatable->setGlobal = 'setGlobal'; + +$lang->datatable->methodOrder[5] = 'setGlobal'; /* Subversion. */ $lang->resource->svn = new stdclass(); @@ -1327,6 +1338,9 @@ $lang->changelog['9.2'][] = 'testsuite-import'; $lang->changelog['9.2'][] = 'testsuite-showImport'; $lang->changelog['9.5'][] = 'bug-batchActivate'; +$lang->changelog['9.6'][] = 'custom-setPublic'; +$lang->changelog['9.6'][] = 'datatable-setGlobal'; + global $config; if($config->global->flow != 'full') { diff --git a/module/index/ext/config/.gitkeep b/module/index/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/index/ext/control/.gitkeep b/module/index/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/index/ext/css/.gitkeep b/module/index/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/index/ext/js/.gitkeep b/module/index/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/index/ext/lang/en/.gitkeep b/module/index/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/index/ext/lang/zh-cn/.gitkeep b/module/index/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/index/ext/lang/zh-tw/.gitkeep b/module/index/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/index/ext/model/.gitkeep b/module/index/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/index/ext/view/.gitkeep b/module/index/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/install/ext/config/.gitkeep b/module/install/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/install/ext/control/.gitkeep b/module/install/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/install/ext/css/.gitkeep b/module/install/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/install/ext/js/.gitkeep b/module/install/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/install/ext/lang/en/.gitkeep b/module/install/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/install/ext/lang/zh-cn/.gitkeep b/module/install/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/install/ext/lang/zh-tw/.gitkeep b/module/install/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/install/ext/model/.gitkeep b/module/install/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/install/ext/view/.gitkeep b/module/install/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/mail/ext/config/.gitkeep b/module/mail/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/mail/ext/control/.gitkeep b/module/mail/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/mail/ext/css/.gitkeep b/module/mail/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/mail/ext/js/.gitkeep b/module/mail/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/mail/ext/lang/en/.gitkeep b/module/mail/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/mail/ext/lang/zh-cn/.gitkeep b/module/mail/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/mail/ext/lang/zh-tw/.gitkeep b/module/mail/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/mail/ext/model/.gitkeep b/module/mail/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/mail/ext/view/.gitkeep b/module/mail/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/misc/ext/config/.gitkeep b/module/misc/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/misc/ext/control/.gitkeep b/module/misc/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/misc/ext/css/.gitkeep b/module/misc/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/misc/ext/js/.gitkeep b/module/misc/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/misc/ext/lang/en/.gitkeep b/module/misc/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/misc/ext/lang/zh-cn/.gitkeep b/module/misc/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/misc/ext/lang/zh-tw/.gitkeep b/module/misc/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/misc/ext/model/.gitkeep b/module/misc/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/misc/ext/view/.gitkeep b/module/misc/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/my/ext/config/.gitkeep b/module/my/ext/config/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/my/ext/control/.gitkeep b/module/my/ext/control/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/my/ext/css/.gitkeep b/module/my/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/my/ext/js/.gitkeep b/module/my/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/my/ext/lang/en/.gitkeep b/module/my/ext/lang/en/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/my/ext/lang/zh-cn/.gitkeep b/module/my/ext/lang/zh-cn/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/my/ext/lang/zh-tw/.gitkeep b/module/my/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/my/ext/model/.gitkeep b/module/my/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/my/ext/view/.gitkeep b/module/my/ext/view/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/product/ext/config/.gitkeep b/module/product/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/product/ext/control/.gitkeep b/module/product/ext/control/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/product/ext/css/.gitkeep b/module/product/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/product/ext/js/.gitkeep b/module/product/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/product/ext/lang/en/.gitkeep b/module/product/ext/lang/en/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/product/ext/lang/zh-cn/.gitkeep b/module/product/ext/lang/zh-cn/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/product/ext/lang/zh-tw/.gitkeep b/module/product/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/product/ext/model/.gitkeep b/module/product/ext/model/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/product/ext/view/.gitkeep b/module/product/ext/view/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 098c419bbf..156487f5db 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -104,13 +104,39 @@ moduleName . ucfirst($this->methodName); $useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable'); - $file2Include = $useDatatable ? dirname(__FILE__) . '/datatabledata.html.php' : dirname(__FILE__) . '/browsedata.html.php'; $vars = "productID=$productID&branch=$branch&browseType=$browseType¶m=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; - include $file2Include; + + if($useDatatable) include '../../common/view/datatable.html.php'; + if(!$useDatatable) include '../../common/view/tablesorter.html.php'; + $setting = $this->datatable->getSetting('product'); + $widths = $this->datatable->setFixedFieldWidth($setting); + $columns = 0; ?> + ' id='storyList' data-checkable='true' data-fixed-left-width='' data-fixed-right-width='' data-custom-menu='true' data-checkbox-name='storyIDList[]'> + + + $value) + { + if($value->show) + { + $this->datatable->printHead($value, $orderBy, $vars); + $columns ++; + } + } + ?> + + + + + + $value) $this->story->printCell($value, $story, $users, $branches, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table');?> + + + - - - + + - + @@ -175,6 +184,37 @@
    +
    diff --git a/module/product/view/browsedata.html.php b/module/product/view/browsedata.html.php deleted file mode 100644 index fe73a5445a..0000000000 --- a/module/product/view/browsedata.html.php +++ /dev/null @@ -1,103 +0,0 @@ - - * @package product - * @version $Id$ - * @link http://www.zentao.net - */ -?> - - - - - - - - - - - - - - - - - - - - - - $story):?> - createLink('story', 'view', "storyID=$story->id"); - $canView = common::hasPriv('story', 'view'); - ?> - - - - - - - - - - - - - - - - - - diff --git a/module/product/view/datatabledata.html.php b/module/product/view/datatabledata.html.php deleted file mode 100644 index 5d1aacadda..0000000000 --- a/module/product/view/datatabledata.html.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @package product - * @version $Id$ - * @link http://www.zentao.net - */ -?> -datatable->getSetting('product'); -$widths = $this->datatable->setFixedFieldWidth($setting); -extract($widths); -?> -
    idAB);?> priAB);?> story->title);?>story->planAB);?>openedByAB);?>assignedToAB);?>story->estimateAB);?>statusAB);?>story->stageAB);?>story->taskCountAB;?>story->bugCountAB;?>story->caseCountAB;?>actions;?>
    - - id)): sprintf('%03d', $story->id);?> - story->priList, $story->pri, $story->pri);?>'>story->priList, $story->pri, $story->pri)?> - branch) echo "{$branches[$story->branch]}"?> - module) echo "{$modulePairs[$story->module]} "?> - title, null, "style='color: $story->color'");?> - planTitle;?>openedBy, $story->openedBy);?>assignedTo, $story->assignedTo);?>estimate;?>story->statusList[$story->status];?> - id]) ? " class='popoverStage' data-toggle='popover' data-placement='bottom' data-target='\$next'" : '') . "'>"; - echo $lang->story->stageList[$story->stage]; - if(isset($storyStages[$story->id])) echo ""; - echo ''; - if(isset($storyStages[$story->id])) - { - echo "
    "; - foreach($storyStages[$story->id] as $storyBranch => $storyStage) echo $branches[$storyBranch] . ": " . $lang->story->stageList[$storyStage->stage] . '
    '; - echo "
    "; - } - ?> -
    - id}"; - common::printIcon('story', 'change', $vars, $story, 'list', 'random'); - common::printIcon('story', 'review', $vars, $story, 'list', 'review'); - common::printIcon('story', 'close', $vars, $story, 'list', 'off', '', 'iframe', true); - common::printIcon('story', 'edit', $vars, $story, 'list', 'pencil'); - if($this->config->global->flow != 'onlyStory') - { - common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap'); - } - ?> -
    - - $value) $this->datatable->printHead($value, $orderBy, $vars);?> - - - - - $value) $this->story->printCell($value, $story, $users, $branches, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases);?> - - - diff --git a/module/productplan/ext/config/.gitkeep b/module/productplan/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/productplan/ext/control/.gitkeep b/module/productplan/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/productplan/ext/css/.gitkeep b/module/productplan/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/productplan/ext/js/.gitkeep b/module/productplan/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/productplan/ext/lang/en/.gitkeep b/module/productplan/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/productplan/ext/lang/zh-cn/.gitkeep b/module/productplan/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/productplan/ext/lang/zh-tw/.gitkeep b/module/productplan/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/productplan/ext/model/.gitkeep b/module/productplan/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/productplan/ext/view/.gitkeep b/module/productplan/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/project/config.php b/module/project/config.php index ddd4c26299..471dc898f3 100644 --- a/module/project/config.php +++ b/module/project/config.php @@ -99,3 +99,11 @@ $config->printKanban->col['wait'] = 2; $config->printKanban->col['doing'] = 3; $config->printKanban->col['done'] = 4; $config->printKanban->col['closed'] = 5; + +$config->project->kanbanSetting = new stdclass(); +$config->project->kanbanSetting->colorList['wait'] = '#2b529c'; +$config->project->kanbanSetting->colorList['doing'] = '#d2323d'; +$config->project->kanbanSetting->colorList['pause'] = '#e48600'; +$config->project->kanbanSetting->colorList['done'] = '#229f24'; +$config->project->kanbanSetting->colorList['cancel'] = '#333'; +$config->project->kanbanSetting->colorList['closed'] = '#777'; diff --git a/module/project/control.php b/module/project/control.php index 32f1389fab..f4eb10402b 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1273,6 +1273,13 @@ class project extends control $this->view->orderBy = $orderBy; $this->view->projectID = $projectID; $this->view->project = $project; + + $kanbanSetting = $this->project->getKanbanSetting($projectID); + + $this->view->allCols = $kanbanSetting->allCols; + $this->view->showOption = $kanbanSetting->showOption; + $this->view->colorList = $kanbanSetting->colorList; + $this->display(); } @@ -1992,4 +1999,75 @@ class project extends control { $this->locate($this->createLink('doc', 'objectLibs', "type=project&objectID=$projectID&from=project")); } + + /** + * Kanban setting. + * + * @param int $projectID + * @access public + * @return void + */ + public function ajaxKanbanSetting($projectID) + { + if($_POST) + { + $this->loadModel('setting'); + $data = fixer::input('post')->get(); + if(common::hasPriv('project', 'kanbanHideCols')) + { + $allCols = array(); + if(isset($this->config->project->kanbanSetting->allCols)) + { + $allCols = json_decode($this->config->project->kanbanSetting->allCols, true); + } + $allCols[$projectID] = $data->allCols; + $this->setting->setItem("system.project.kanbanSetting.allCols", json_encode($allCols)); + } + + $account = $this->app->user->account; + $this->setting->setItem("{$account}.project.kanbanSetting.showOption", $data->showOption); + + if(common::hasPriv('project', 'kanbanColsColor')) $this->setting->setItem("system.project.kanbanSetting.colorList", json_encode($data->colorList)); + + die(js::reload('parent.parent')); + } + + $this->app->loadLang('task'); + $kanbanSetting = $this->project->getKanbanSetting($projectID); + + $this->view->allCols = $kanbanSetting->allCols; + $this->view->showOption = $kanbanSetting->showOption; + $this->view->colorList = $kanbanSetting->colorList; + $this->view->projectID = $projectID; + $this->display(); + } + + /** + * Ajax reset kanban setting + * + * @param int $projectID + * @param string $confirm + * @access public + * @return void + */ + public function ajaxResetKanban($projectID, $confirm = 'no') + { + if($confirm != 'yes')die(js::confirm($this->lang->kanbanSetting->noticeReset, inlink('ajaxResetKanban', "projectID=$projectID&confirm=yes"))); + + $this->loadModel('setting'); + + if(common::hasPriv('project', 'kanbanHideCols') and isset($this->config->project->kanbanSetting->allCols)) + { + $allCols = json_decode($this->config->project->kanbanSetting->allCols, true); + unset($allCols[$projectID]); + $this->setting->setItem("system.project.kanbanSetting.allCols", json_encode($allCols)); + } + + $account = $this->app->user->account; + $this->setting->deleteItems("owner={$account}&module=project§ion=kanbanSetting&key=showOption"); + + if(common::hasPriv('project', 'kanbanColsColor')) $this->setting->deleteItems("owner=system&module=project§ion=kanbanSetting&key=colorList"); + + die(js::reload('parent.parent')); + } } diff --git a/module/project/css/kanban.css b/module/project/css/kanban.css index 5a13b4fbe6..cae429cd04 100644 --- a/module/project/css/kanban.css +++ b/module/project/css/kanban.css @@ -1,8 +1,8 @@ -table th.col-closed {width:15%} +table th.col-closed {width:14%} #kanbanHeader th{border: 1px solid #ddd; padding:8px;} -#kanbanHeader .dropdown {display: inline-block; margin-left: 10px;} +#kanbanHeader .dropdown {display: inline-block;} #kanbanHeader .dropdown > a {color: #036} -#kanbanHeader th.col-closed {position: relative} +#kanbanHeader th{position: relative} #kanbanHeader .actions {position: absolute; right: 0; top: 0; padding: 0px; background: #f1f1f1; border-left: 1px solid #ccc} #kanbanHeader .actions .btn {display: block; border-radius: 0; width: 34px; height: 36px; position: relative; text-align: center; padding: 5px 0; color: #036} #kanbanHeader .actions .btn-text {display: none} @@ -39,7 +39,8 @@ table th.col-closed {width:15%} .board .dropdown-menu > a {display: block; padding: 3px 15px; color: #333; font-size: 12px} .board .dropdown-menu > a:hover {background: #f1f1f1; color: #1a53ff; text-decoration: none} .board .dropdown-menu > a.disabled, .board .dropdown-menu > a.disabled:hover, .board .dropdown-menu > a.active {color: #aaa; background: none} -.board .board-footer {display: none; opacity: 0.9} +.board .board-footer {display: none; opacity: 0.6} +.board.inverse .board-footer {display: none; opacity: 0.9} .board.show-info .board-footer {display: block; margin: 0 -6px -3px -6px; padding: 5px; background: rgba(0,0,0,0.07);} .board-footer .board-id {display: inline-block; border: 1px solid #aaa; font-weight: normal; padding: 0px 4px; text-align: center; min-width: 20px; line-height: 16px; height: 17px; margin-right: 10px; font-size: 12px;} .board-bug-closed .board-footer .bug-pri, .board-task-closed .board-footer .task-pri {border-color: #666} @@ -60,12 +61,21 @@ table th.col-closed {width:15%} .story-pri.pri-3 {background-color:#b56a00;} .story-pri.pri-4 {background-color:#795523;} -.board {background: #ddd; color: #444; outline: 1px solid rgba(0,0,0,.1); outline-offset: -1px;} -.board-bug-wait,.board-task-wait {color: #2b529c; background-color: #E8EAF6} -.board-bug-doing,.board-task-doing {color: #D2322D; background-color: #FFEBEE;} -.board-bug-done,.board-task-done {color: #229F24; background-color: #E8F5E9;} -.board-bug-closed,.board-task-closed {color: #666; background-color: #ccc;} -.board:hover {outline: 1px solid rgba(0,0,0,.3);} +.board {background: #333; color: #f1f1f1; outline: 1px solid rgba(0,0,0,.1); outline-offset: -1px;} +.board:hover {outline: 1px solid rgba(0,0,0,.3); color:#fff} +.board-bug-cancel, .board-task-cancel {background: #333; opacity: 0.7;} +.board-bug-wait, .board-task-wait {background: #2b529c;opacity: 0.7;} +.board-task-pause {background: #E48600;opacity: 0.7;} +.board-bug-doing, .board-task-doing {background: #D2322D;opacity: 0.7;} +.board-bug-done, .board-task-done {background: #229F24;opacity: 0.7;} +.board-bug-closed, .board-task-closed {background: #777; opacity: 0.7;} + +.board-bug-cancel.inverse, .board-task-cancel.inverse {opacity: 1;} +.board-bug-wait.inverse, .board-task-wait.inverse {opacity: 1} +.board-task-pause.inverse {opacity: 1} +.board-bug-doing.inverse, .board-task-doing.inverse {opacity: 1} +.board-bug-done.inverse, .board-task-done.inverse {opacity: 1} +.board-bug-closed.inverse, .board-task-closed.inverse {opacity: 1} .board-story {color: #dd7503; background-color: #FFF3E0;} .board-story.stage-projected {color:#777;} @@ -75,14 +85,6 @@ table th.col-closed {width:15%} .board-story.stage-tested {color:#827717; background-color: #F9FBE7} .board-story.stage-released {color:#9C27B0; background-color: #F3E5F5} -.board.inverse {background: #333; color: #f1f1f1;} -.board.inverse:hover {color: #fff;} -.board-bug-cancel.inverse, .board-task-cancel.inverse {background: #333;} -.board-bug-wait.inverse, .board-task-wait.inverse {background: #2b529c} -.board-bug-doing.inverse, .board-task-doing.inverse {background: #D2322D} -.board-bug-done.inverse, .board-task-done.inverse {background: #229F24} -.board-bug-closed.inverse, .board-task-closed.inverse {background: #777;} - .board-story.inverse {background: #dd7503} .board-story.stage-projected.inverse {background-color:#777;} .board-story.stage-developing.inverse {background-color:#D2322D;} diff --git a/module/project/css/task.css b/module/project/css/task.css index 12b48fcf8a..6713024ae5 100644 --- a/module/project/css/task.css +++ b/module/project/css/task.css @@ -24,3 +24,11 @@ .pl-5px{padding-left:5px;} tbody > tr > td > .btn-icon {margin-right: 2px} +.table-children > td:first-child{border-left:2px solid #ccc} +.table-children > td:last-child{;border-right:2px solid #ccc;} +.fixed-left .table-children > td{border-right:none;} +.flexarea .table-children > td{border-left:none;border-right:none;} +.fixed-right .table-children > td{border-left:none;} +.table-children.table-child-top{border-top:2px solid #ccc;} +.table-children.table-child-bottom{border-bottom:2px solid #ccc;} +.table-children td{background-color:#fff!important;} diff --git a/module/project/ext/config/.gitkeep b/module/project/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/project/ext/control/.gitkeep b/module/project/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/project/ext/css/.gitkeep b/module/project/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/project/ext/js/.gitkeep b/module/project/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/project/ext/lang/en/.gitkeep b/module/project/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/project/ext/lang/zh-cn/.gitkeep b/module/project/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/project/ext/lang/zh-tw/.gitkeep b/module/project/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/project/ext/model/.gitkeep b/module/project/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/project/ext/view/.gitkeep b/module/project/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/project/js/common.js b/module/project/js/common.js index dc3a24d66a..24c3c6b85f 100644 --- a/module/project/js/common.js +++ b/module/project/js/common.js @@ -174,3 +174,20 @@ $(function() computeWorkDays(this.id); }) }); + +$('.task-toggle').click(function() +{ + var obj = $(this).find('i'); + var id = $(this).data('id'); + if(obj.hasClass('icon-plus')) + { + $('tr.parent-'+id).show(); + obj.removeClass('icon-plus').addClass('icon-minus'); + } + else if(obj.hasClass('icon-minus')) + { + $('tr.parent-'+id).hide(); + obj.removeClass('icon-minus').addClass('icon-plus'); + } + return false; +}); diff --git a/module/project/js/kanban.js b/module/project/js/kanban.js index 91b0dcd287..85e1e007e5 100644 --- a/module/project/js/kanban.js +++ b/module/project/js/kanban.js @@ -17,7 +17,8 @@ $(function() task: { wait : {doing: 'start', done: 'finish', cancel: 'cancel'}, - doing : {done: 'finish'}, + doing : {done: 'finish', pause: 'pause'}, + pause : {doing: 'activate', done: 'finish', cancel: 'cancel'}, done : {doing: 'activate', closed: 'close'}, cancel : {doing: 'activate', closed: 'close'}, closed : {doing: 'activate'} diff --git a/module/project/js/task.js b/module/project/js/task.js index e464c5916e..7089e6548f 100644 --- a/module/project/js/task.js +++ b/module/project/js/task.js @@ -20,6 +20,9 @@ $(function() $option.toggleClass('hide', $option.text().toString().toLowerCase().indexOf(val) < 0 && $option.data('key').toString().toLowerCase().indexOf(val) < 0); }); }); + + $(".table-children > td.check-btn").html('') + }); function setQueryBar(queryID, title) diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 449372822c..415eb80747 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -242,9 +242,20 @@ $lang->project->orderList['id_desc'] = "ID Desc"; $lang->project->orderList['stage_asc'] = "Stage Asc"; $lang->project->orderList['stage_desc'] = "Stage Desc"; -$lang->project->kanban = "Kanban"; -$lang->project->printKanban = "Print Kanban"; -$lang->project->bugList = "Bugs"; +$lang->project->kanban = "Kanban"; +$lang->project->kanbanSetting = "Kanban Setting"; +$lang->project->resetKanban = "Reset Setting"; +$lang->project->printKanban = "Print Kanban"; +$lang->project->bugList = "Bugs"; + +$lang->project->kanbanHideCols = 'Kanban hidden has been closed and canceled columns'; +$lang->project->kanbanShowOption = 'Display folding information'; +$lang->project->kanbanColsColor = 'Custom color for Kanban column'; + +$lang->kanbanSetting = new stdclass(); +$lang->kanbanSetting->noticeReset = 'Do you want to restore the Kanban default settings?'; +$lang->kanbanSetting->optionList['0'] = 'Hidden'; +$lang->kanbanSetting->optionList['1'] = 'Show'; $lang->printKanban = new stdclass(); $lang->printKanban->common = 'Print Kanban'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 832032b3a9..f35ba6f90a 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -242,9 +242,20 @@ $lang->project->orderList['id_desc'] = "需求ID倒序"; $lang->project->orderList['stage_asc'] = "需求阶段正序"; $lang->project->orderList['stage_desc'] = "需求阶段倒序"; -$lang->project->kanban = "看板"; -$lang->project->printKanban = "打印看板"; -$lang->project->bugList = "Bug列表"; +$lang->project->kanban = "看板"; +$lang->project->kanbanSetting = "看板设置"; +$lang->project->resetKanban = "恢复默认"; +$lang->project->printKanban = "打印看板"; +$lang->project->bugList = "Bug列表"; + +$lang->project->kanbanHideCols = '看板隐藏已关闭、已取消列'; +$lang->project->kanbanShowOption = '显示折叠信息'; +$lang->project->kanbanColsColor = '看板列自定义颜色'; + +$lang->kanbanSetting = new stdclass(); +$lang->kanbanSetting->noticeReset = '是否恢复看板默认设置?'; +$lang->kanbanSetting->optionList['0'] = '隐藏'; +$lang->kanbanSetting->optionList['1'] = '显示'; $lang->printKanban = new stdclass(); $lang->printKanban->common = '看板打印'; diff --git a/module/project/model.php b/module/project/model.php index 9bdb76f892..fe0ffdee9b 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2124,6 +2124,39 @@ class projectModel extends model return json_decode($prevKanbans, true); } + /** + * Get kanban setting. + * + * @param int $projectID + * @access public + * @return object + */ + public function getKanbanSetting($projectID) + { + $allCols = '1'; + $showOption = '0'; + if(isset($this->config->project->kanbanSetting->allCols)) + { + $allColPairs = json_decode($this->config->project->kanbanSetting->allCols, true); + if(isset($allColPairs[$projectID])) $allCols = $allColPairs[$projectID]; + } + + if(isset($this->config->project->kanbanSetting->showOption)) + { + $showOption = $this->config->project->kanbanSetting->showOption; + } + + $colorList = $this->config->project->kanbanSetting->colorList; + if(!is_array($colorList)) $colorList = json_decode($colorList, true); + + $kanbanSetting = new stdclass(); + $kanbanSetting->allCols = $allCols; + $kanbanSetting->showOption = $showOption; + $kanbanSetting->colorList = $colorList; + + return $kanbanSetting; + } + /** * Build burn data. * diff --git a/module/project/view/ajaxkanbansetting.html.php b/module/project/view/ajaxkanbansetting.html.php new file mode 100644 index 0000000000..00d64aa0d9 --- /dev/null +++ b/module/project/view/ajaxkanbansetting.html.php @@ -0,0 +1,62 @@ + + * @package project + * @version $Id$ + * @link http://www.zentao.net + */ +?> + +
    +
    + project->kanbanSetting;?> +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    project->kanbanHideCols?>kanbanSetting->optionList, $allCols)?>
    project->kanbanShowOption?>kanbanSetting->optionList, $showOption)?>
    project->kanbanColsColor?> +
    + $color):?> +
    + task->statusList[$status];?> + +
    + +
    +
    + project->resetKanban, 'hiddenwin', "class='btn'"); + ?> +
    + + + diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index b49659195f..6ff45fae47 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -44,8 +44,8 @@ branchName) echo "{$build->branchName}"?> createLink('build', 'view', "build=$build->id"), $build->name);?>
    scmPath, 'http') === 0 ? printf(html::a($build->scmPath)) : printf($build->scmPath);?>filePath, 'http') === 0 ? printf(html::a($build->filePath)) : printf($build->filePath);?>scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath;?>filePath, 'http') === 0 ? html::a($build->filePath):$build->filePath;?> date?> builder]?> diff --git a/module/project/view/datatabledata.html.php b/module/project/view/datatabledata.html.php deleted file mode 100644 index ad92507c5d..0000000000 --- a/module/project/view/datatabledata.html.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @package project - * @version $Id$ - * @link http://www.zentao.net - */ -?> -datatable->getSetting('project'); -$widths = $this->datatable->setFixedFieldWidth($setting); -$columns = 0; -extract($widths); -?> - - - $value) - { - if($value->show) - { - $this->datatable->printHead($value, $orderBy, $vars); - $columns++; - } - } - ?> - - - - - $value) $this->task->printCell($value, $task, $users, $browseType, $branchGroups, $modulePairs);?> - - - diff --git a/module/project/view/kanban.html.php b/module/project/view/kanban.html.php index 90c02ea77b..a8e56ac739 100644 --- a/module/project/view/kanban.html.php +++ b/module/project/view/kanban.html.php @@ -10,7 +10,16 @@ ?> - + +app->user->account +?>
    @@ -34,7 +43,15 @@ @@ -47,7 +64,7 @@ - + @@ -58,7 +75,7 @@ '; @@ -1796,9 +2016,9 @@ class taskModel extends model /** * Send mail. - * - * @param int $taskID - * @param int $actionID + * + * @param int $taskID + * @param int $actionID * @access public * @return void */ @@ -1859,4 +2079,51 @@ class taskModel extends model $this->mail->send($toList, 'TASK#' . $task->id . ' ' . $task->name . ' - ' . $projectName, $mailContent, $ccList); if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError())); } + + /** + * Get next user. + * + * @param string $users + * @param string $current + * @access public + * @return void + */ + public function getNextUser($users, $current) + { + /* Process user */ + if(!is_array($users)) $users = explode(',', trim($users, ',')); + if(!$current) return reset($users); + $hit = false; + $next = ''; + foreach($users as $key => $account) + { + if($hit) + { + $next = $account; + break; + } + + if($account == $current) $hit = true; + } + if($next == '') return reset($users); + return $next; + } + + /** + * Get task's team member pairs. + * + * @param object $task + * @access public + * @return array + */ + public function getMemberPairs($task) + { + $users = $this->loadModel('user')->getPairs('noletter'); + $members = array(); + foreach($task->team as $member) + { + $members[$member->account] = $users[$member->account]; + } + return array('' => '') + $members; + } } diff --git a/module/task/view/assignto.html.php b/module/task/view/assignto.html.php index 166f610599..2b80014f08 100644 --- a/module/task/view/assignto.html.php +++ b/module/task/view/assignto.html.php @@ -16,14 +16,14 @@
    icons['task']);?> id;?> createLink('task', 'view', 'task=' . $task->id), $task->name, '_blank');?> - task->assign;?> + team) ? $lang->task->assign : $lang->task->transmit;?>
    task->statusList[$endCol];?>
    - " . $lang->project->printKanban . '', "id='printKanban' title='" . $lang->project->printKanban . "'", 'btn btn-sm btn-link');?> +
    id)):?> -
    ' data-id='id?>'> +
    assignedTo == $account) echo ' inverse';?>' data-id='id?>'>
    createLink('story', 'view', "storyID=$story->id", '', true), $story->title, '', 'class="kanbanFrame" title="' . $story->title . '"');?>
    @@ -67,7 +84,7 @@ -
    tasks[$col])):?> tasks[$col] as $task):?> -
    ' data-id='id?>' id='task-id?>'> +
    assignedTo == $account) echo ' inverse';?>' data-id='id?>' id='task-id?>'>
    delay)) @@ -109,7 +126,7 @@ -
    "; - switch ($id) + switch($id) { case 'id': - echo html::a($storyLink, sprintf('%03d', $story->id)); + if($mode == 'table') echo " "; + echo $canView ? html::a($storyLink, sprintf('%03d', $story->id)) : sprintf('%03d', $story->id); break; case 'pri': echo ""; @@ -2277,7 +2280,7 @@ class storyModel extends model case 'title': if($story->branch) echo "{$branches[$story->branch]} "; if($modulePairs and $story->module) echo "{$modulePairs[$story->module]} "; - echo html::a($storyLink, $story->title, null, "style='color: $story->color'"); + echo $canView ? html::a($storyLink, $story->title, '', "style='color: $story->color'") : "{$story->title}"; break; case 'plan': echo $story->planTitle; diff --git a/module/svn/ext/config/.gitkeep b/module/svn/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/svn/ext/control/.gitkeep b/module/svn/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/svn/ext/css/.gitkeep b/module/svn/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/svn/ext/js/.gitkeep b/module/svn/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/svn/ext/lang/en/.gitkeep b/module/svn/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/svn/ext/lang/zh-cn/.gitkeep b/module/svn/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/svn/ext/lang/zh-tw/.gitkeep b/module/svn/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/svn/ext/model/.gitkeep b/module/svn/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/svn/ext/view/.gitkeep b/module/svn/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/task/config.php b/module/task/config.php index eb91526364..200c71b7e2 100644 --- a/module/task/config.php +++ b/module/task/config.php @@ -58,7 +58,7 @@ if($config->global->flow == 'onlyTask') } $config->task->datatable = new stdclass(); -$config->task->datatable->defaultField = array('id', 'pri', 'name', 'status', 'deadline', 'openedDate', 'assignedTo', 'finishedBy', 'finishedDate', 'estimate', 'consumed', 'left', 'story', 'actions'); +$config->task->datatable->defaultField = array('id', 'pri', 'name', 'status', 'deadline', 'openedDate', 'assignedTo', 'finishedBy', 'estimate', 'consumed', 'left', 'story', 'actions'); $config->task->datatable->fieldList['id']['title'] = 'idAB'; $config->task->datatable->fieldList['id']['fixed'] = 'left'; @@ -198,5 +198,5 @@ $config->task->datatable->fieldList['lastEditedDate']['required'] = 'no'; $config->task->datatable->fieldList['actions']['title'] = 'actions'; $config->task->datatable->fieldList['actions']['fixed'] = 'right'; -$config->task->datatable->fieldList['actions']['width'] = '140'; +$config->task->datatable->fieldList['actions']['width'] = '180'; $config->task->datatable->fieldList['actions']['required'] = 'yes'; diff --git a/module/task/control.php b/module/task/control.php index 4beb48389d..c3865d194d 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -169,12 +169,15 @@ class task extends control /** * Batch create task. * - * @param int $projectID - * @param int $storyID + * @param int $projectID + * @param int $storyID + * @param int $iframe + * @param int $taskID + * * @access public - * @return void + * @return mixed */ - public function batchCreate($projectID = 0, $storyID = 0, $iframe = 0) + public function batchCreate($projectID = 0, $storyID = 0, $iframe = 0, $taskID = 0) { $project = $this->project->getById($projectID); $taskLink = $this->createLink('project', 'browse', "projectID=$projectID&tab=task"); @@ -213,6 +216,7 @@ class task extends control $this->view->project = $project; $this->view->stories = $stories; $this->view->modules = $modules; + $this->view->parent = $taskID; $this->view->storyID = $storyID; $this->view->story = $this->story->getByID($storyID); $this->view->storyTasks = $this->task->getStoryTaskCounts(array_keys($stories), $projectID); @@ -229,7 +233,8 @@ class task extends control */ public function commonAction($taskID) { - $this->view->task = $this->loadModel('task')->getByID($taskID); + $task=$this->loadModel('task')->getByID($taskID); + $this->view->task = $task; $this->view->project = $this->project->getById($this->view->task->project); $this->view->members = $this->project->getTeamMemberPairs($this->view->project->id ,'nodeleted'); $this->view->actions = $this->loadModel('action')->getList('task', $taskID); @@ -426,10 +431,20 @@ class task extends control die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } + $task = $this->task->getByID($taskID); + + $members = $this->project->getTeamMemberPairs($projectID, 'nodeleted'); + /* Compute next assignedTo. */ + if(!empty($task->team)) + { + $task->assignedTo = $this->task->getNextUser(array_keys($task->team), $task->assignedTo); + $members = $this->task->getMemberPairs($task); + } + $this->view->title = $this->view->project->name . $this->lang->colon . $this->lang->task->assign; $this->view->position[] = $this->lang->task->assign; - - $this->view->users = $this->project->getTeamMemberPairs($projectID, 'nodeleted'); + $this->view->task = $task; + $this->view->users = $members; $this->display(); } @@ -518,6 +533,8 @@ class task extends control $task->storyFiles = $this->loadModel('file')->getByObject('story', $task->story); } + if($task->team) $this->lang->task->assign = $this->lang->task->transmit; + /* Update action. */ if($task->assignedTo == $this->app->user->account) $this->loadModel('action')->read('task', $taskID); diff --git a/module/task/css/create.css b/module/task/css/create.css index 1e089a7841..21e7dcdaab 100644 --- a/module/task/css/create.css +++ b/module/task/css/create.css @@ -14,3 +14,4 @@ #taskPlanCol, #mailCol {width: 50%} #planAndMailCell.has-mail-col #taskPlanCol {padding-right: 5px;} #planAndMailCell.has-mail-col #taskPlanCol + #mailCol {padding-left: 5px;} +.input-group-addon input[type='checkBox']{} \ No newline at end of file diff --git a/module/task/js/batchcreate.js b/module/task/js/batchcreate.js index 97e0603d71..13ca2c9e8f 100755 --- a/module/task/js/batchcreate.js +++ b/module/task/js/batchcreate.js @@ -153,3 +153,11 @@ $(function() if(storyID != 0) setStoryRelated(0); }) + +// if(projectType == 'ops') +// { +// $("#tableBody th").eq(2).addClass('hidden'); +// $("#tableBody tr").each(function() { +// $(this).find('td').eq(2).addClass('hidden'); +// }); +// } diff --git a/module/task/js/common.js b/module/task/js/common.js index f6b1f07a1c..140db4051e 100644 --- a/module/task/js/common.js +++ b/module/task/js/common.js @@ -14,3 +14,46 @@ function checkLeft() } } } + +$('.btn-move-up, .btn-move-down').click(function() +{ + var $this = $(this); + if($this.hasClass('btn-move-up')) + { + $(this).parents('tr').prev().before($(this).parents('tr')); + } + else + { + $this.parents('tr').next().after($(this).parents('tr')); + } + $('.btn-move-up, .btn-move-down').removeClass('disabled').removeAttr('disabled'); + + adjustSortBtn(); +}); +function adjustSortBtn() +{ + $('.btn-move-up:first').addClass('disabled').attr('disabled', 'disabled'); + $('.btn-move-down:last').addClass('disabled').attr('disabled', 'disabled'); +} + +$('#modalTeam .btn').click(function() +{ + var team = ''; + var time = 0; + $('[name*=team]').each(function() + { + if($(this).find('option:selected').text() != '') + { + team += ' ' + $(this).find('option:selected').text(); + } + + estimate = parseFloat($(this).parents('td').next('td').find('[name*=teamEstimate]').val()); + if(!isNaN(estimate)) + { + time += estimate; + } + + $('#teamMember').val(team); + $('#estimate').val(time); + }) +}) diff --git a/module/task/js/create.js b/module/task/js/create.js index e50bb46e83..0129013f0b 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -20,11 +20,16 @@ function copyStoryTitle() /* Set the assignedTos field. */ function setOwners(result) { + $("#multipleBox").removeAttr("checked"); + $('.team-group').addClass('hidden'); + $('#assignedTo, #assignedTo_chosen').removeClass('hidden'); if(result == 'affair') { $('#assignedTo').attr('multiple', 'multiple'); $('#assignedTo').chosen('destroy'); $('#assignedTo').chosen(defaultChosenOptions); + $('.affair').hide(); + $('.team-group').addClass('hidden'); $('#selectAllUser').removeClass('hidden'); } else if($('#assignedTo').attr('multiple') == 'multiple') @@ -32,6 +37,7 @@ function setOwners(result) $('#assignedTo').removeAttr('multiple'); $('#assignedTo').chosen('destroy'); $('#assignedTo').chosen(defaultChosenOptions); + $('.affair').show(); $('#selectAllUser').addClass('hidden'); } } @@ -202,3 +208,26 @@ $(document).ready(function() return false; }); }); + +/* show team menu. */ +$('[name^=multiple]').change(function() +{ + if($(this).prop('checked')) + { + $('#assignedTo, #assignedTo_chosen').addClass('hidden'); + $('.team-group').removeClass('hidden'); + $('#estimate').attr('readonly', true); + } + else + { + $('#assignedTo, #assignedTo_chosen').removeClass('hidden'); + $('.team-group').addClass('hidden'); + $('#estimate').attr('readonly', false); + } +}); +$(".team-group[data-toggle='modalTeam']").css('cursor', 'pointer'); +$(".team-group[data-toggle='modalTeam']").click(function() +{ + $('#modalTeam').modal('show'); + adjustSortBtn(); +}); diff --git a/module/task/js/edit.js b/module/task/js/edit.js index 6ed08f4209..72e23de445 100644 --- a/module/task/js/edit.js +++ b/module/task/js/edit.js @@ -67,3 +67,25 @@ function loadProjectMembers(projectID) /* empty function. */ function setPreview(){} +$(".btn[data-toggle='modalTeam']").click(function() +{ + $('#modalTeam').modal('show') + adjustSortBtn(); +}); + +$(document).ready(function() +{ + /* show team menu. */ + $('[name=multiple]').change(function() + { + var checked = $(this).prop('checked'); + if(checked) + { + $('#teamTr').removeClass('hidden'); + } + else + { + $('#teamTr').addClass('hidden'); + } + }); +}); diff --git a/module/task/lang/en.php b/module/task/lang/en.php index 94cbe81964..14e2109520 100644 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -95,6 +95,17 @@ $lang->task->deleteEstimate = 'Delete Man-Hour'; $lang->task->colorTag = 'Color Tag'; $lang->task->files = 'Files'; $lang->task->hasConsumed = 'Consumed'; +$lang->task->multiple = 'Multiple Tasks'; +$lang->task->multipleAB = 'Multiple'; +$lang->task->team = 'Team'; +$lang->task->transmit = 'Transfer'; +$lang->task->transmitTo = 'Transfer To'; +$lang->task->children = 'Child'; +$lang->task->childrenAB = 'Child'; +$lang->task->parent = 'Parent Task'; +$lang->task->unfinished = 'Unfinished'; +$lang->task->lblPri = 'P'; +$lang->task->lblHour = '(h)'; $lang->task->ditto = 'Ditto'; $lang->task->dittoNotice = "This Task does not belong to the Project as the previous one does!"; diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index 60e5fd64a1..1c7ad02246 100644 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -39,62 +39,72 @@ $lang->task->progess = '进度'; $lang->task->progessTips = '已消耗/(已消耗+剩余)'; $lang->task->copy = '复制任务'; -$lang->task->common = '任务'; -$lang->task->id = '编号'; -$lang->task->project = '所属' . $lang->projectCommon; -$lang->task->module = '所属模块'; -$lang->task->moduleAB = '模块'; -$lang->task->story = '相关需求'; -$lang->task->storySpec = '需求描述'; -$lang->task->storyVerify = '验收标准'; -$lang->task->name = '任务名称'; -$lang->task->type = '任务类型'; -$lang->task->pri = '优先级'; -$lang->task->mailto = '抄送给'; -$lang->task->estimate = '最初预计'; -$lang->task->estimateAB = '预'; -$lang->task->left = '预计剩余'; -$lang->task->leftAB = '剩'; -$lang->task->consumed = '总消耗'; -$lang->task->consumedAB = '消耗'; -$lang->task->hour = '小时'; -$lang->task->consumedThisTime = '工时'; -$lang->task->leftThisTime = '剩余'; -$lang->task->datePlan = '日程规划'; -$lang->task->estStarted = '预计开始'; -$lang->task->realStarted = '实际开始'; -$lang->task->date = '日期'; -$lang->task->deadline = '截止日期'; -$lang->task->deadlineAB = '截止'; -$lang->task->status = '任务状态'; -$lang->task->desc = '任务描述'; -$lang->task->assign = '指派'; -$lang->task->assignTo = $lang->task->assign; -$lang->task->batchAssignTo = '批量指派'; -$lang->task->assignedTo = '指派给'; -$lang->task->assignedToAB = '指派给'; -$lang->task->assignedDate = '指派日期'; -$lang->task->openedBy = '由谁创建'; -$lang->task->openedDate = '创建日期'; -$lang->task->openedDateAB = '创建'; -$lang->task->finishedBy = '由谁完成'; -$lang->task->finishedByAB = '完成者'; -$lang->task->finishedDate = '完成时间'; -$lang->task->finishedDateAB = '完成'; -$lang->task->canceledBy = '由谁取消'; -$lang->task->canceledDate = '取消时间'; -$lang->task->closedBy = '由谁关闭'; -$lang->task->closedDate = '关闭时间'; -$lang->task->closedReason = '关闭原因'; -$lang->task->lastEditedBy = '最后修改'; -$lang->task->lastEditedDate = '最后修改日期'; -$lang->task->lastEdited = '最后编辑'; -$lang->task->recordEstimate = '工时'; -$lang->task->editEstimate = '编辑工时'; -$lang->task->deleteEstimate = '删除工时'; -$lang->task->colorTag = '颜色标签'; -$lang->task->files = '附件'; -$lang->task->hasConsumed = '已消耗'; +$lang->task->common = '任务'; +$lang->task->id = '编号'; +$lang->task->project = '所属' . $lang->projectCommon; +$lang->task->module = '所属模块'; +$lang->task->moduleAB = '模块'; +$lang->task->story = '相关需求'; +$lang->task->storySpec = '需求描述'; +$lang->task->storyVerify = '验收标准'; +$lang->task->name = '任务名称'; +$lang->task->type = '任务类型'; +$lang->task->pri = '优先级'; +$lang->task->mailto = '抄送给'; +$lang->task->estimate = '最初预计'; +$lang->task->estimateAB = '预'; +$lang->task->left = '预计剩余'; +$lang->task->leftAB = '剩'; +$lang->task->consumed = '总消耗'; +$lang->task->consumedAB = '消耗'; +$lang->task->hour = '小时'; +$lang->task->consumedThisTime = '工时'; +$lang->task->leftThisTime = '剩余'; +$lang->task->datePlan = '日程规划'; +$lang->task->estStarted = '预计开始'; +$lang->task->realStarted = '实际开始'; +$lang->task->date = '日期'; +$lang->task->deadline = '截止日期'; +$lang->task->deadlineAB = '截止'; +$lang->task->status = '任务状态'; +$lang->task->desc = '任务描述'; +$lang->task->assign = '指派'; +$lang->task->assignTo = $lang->task->assign; +$lang->task->batchAssignTo = '批量指派'; +$lang->task->assignedTo = '指派给'; +$lang->task->assignedToAB = '指派给'; +$lang->task->assignedDate = '指派日期'; +$lang->task->openedBy = '由谁创建'; +$lang->task->openedDate = '创建日期'; +$lang->task->openedDateAB = '创建'; +$lang->task->finishedBy = '由谁完成'; +$lang->task->finishedByAB = '完成者'; +$lang->task->finishedDate = '完成时间'; +$lang->task->finishedDateAB = '完成'; +$lang->task->canceledBy = '由谁取消'; +$lang->task->canceledDate = '取消时间'; +$lang->task->closedBy = '由谁关闭'; +$lang->task->closedDate = '关闭时间'; +$lang->task->closedReason = '关闭原因'; +$lang->task->lastEditedBy = '最后修改'; +$lang->task->lastEditedDate = '最后修改日期'; +$lang->task->lastEdited = '最后编辑'; +$lang->task->recordEstimate = '工时'; +$lang->task->editEstimate = '编辑工时'; +$lang->task->deleteEstimate = '删除工时'; +$lang->task->colorTag = '颜色标签'; +$lang->task->files = '附件'; +$lang->task->hasConsumed = '已消耗'; +$lang->task->multiple = '多人任务'; +$lang->task->multipleAB = '多人'; +$lang->task->team = '团队'; +$lang->task->transmit = '转交'; +$lang->task->transmitTo = '转交给'; +$lang->task->children = '子任务'; +$lang->task->childrenAB = '子'; +$lang->task->parent = '父任务'; +$lang->task->lblPri = 'P'; +$lang->task->lblHour = '(h)'; $lang->task->ditto = '同上'; $lang->task->dittoNotice = "该任务与上一任务不属于同一项目!"; @@ -104,13 +114,13 @@ $lang->task->noAssigned = '未指派'; $lang->task->noFinished = '未完成'; $lang->task->noClosed = '未关闭'; -$lang->task->statusList[''] = ''; -$lang->task->statusList['wait'] = '未开始'; -$lang->task->statusList['doing'] = '进行中'; -$lang->task->statusList['done'] = '已完成'; -$lang->task->statusList['pause'] = '已暂停'; -$lang->task->statusList['cancel'] = '已取消'; -$lang->task->statusList['closed'] = '已关闭'; +$lang->task->statusList[''] = ''; +$lang->task->statusList['wait'] = '未开始'; +$lang->task->statusList['doing'] = '进行中'; +$lang->task->statusList['done'] = '已完成'; +$lang->task->statusList['pause'] = '已暂停'; +$lang->task->statusList['cancel'] = '已取消'; +$lang->task->statusList['closed'] = '已关闭'; $lang->task->typeList[''] = ''; $lang->task->typeList['design'] = '设计'; @@ -122,11 +132,11 @@ $lang->task->typeList['ui'] = '界面'; $lang->task->typeList['affair'] = '事务'; $lang->task->typeList['misc'] = '其他'; -$lang->task->priList[0] = ''; -$lang->task->priList[3] = '3'; -$lang->task->priList[1] = '1'; -$lang->task->priList[2] = '2'; -$lang->task->priList[4] = '4'; +$lang->task->priList[0] = ''; +$lang->task->priList[3] = '3'; +$lang->task->priList[1] = '1'; +$lang->task->priList[2] = '2'; +$lang->task->priList[4] = '4'; $lang->task->reasonList[''] = ''; $lang->task->reasonList['done'] = '已完成'; @@ -155,7 +165,7 @@ $lang->task->noticeLinkStory = "没有可关联的相关需求,您可以 $lang->task->noticeSaveRecord = '您有尚未保存的工时记录,请先将其保存。'; $lang->task->commentActions = '%s. %s, 由 %s 添加备注。'; -$lang->task->error = new stdclass(); +$lang->task->error = new stdclass(); $lang->task->error->consumedNumber = '"已经消耗"必须为数字'; $lang->task->error->estimateNumber = '"预计剩余"必须为数字'; $lang->task->error->consumedSmall = '"已经消耗"必须大于之前消耗'; @@ -166,7 +176,7 @@ $lang->task->error->skipClose = '任务:%s 不是“已完成”或“ $lang->task->error->consumed = '任务:%s工时不能小于0,忽略该任务工时的改动'; /* 统计报表。*/ -$lang->task->report = new stdclass(); +$lang->task->report = new stdclass(); $lang->task->report->common = '报表'; $lang->task->report->select = '请选择报表类型'; $lang->task->report->create = '生成报表'; @@ -186,8 +196,8 @@ $lang->task->report->charts['tasksPerFinishedBy'] = '由谁完成统计'; $lang->task->report->charts['tasksPerClosedReason'] = '关闭原因统计'; $lang->task->report->charts['finishedTasksPerDay'] = '每天完成统计'; -$lang->task->report->options = new stdclass(); -$lang->task->report->options->graph = new stdclass(); +$lang->task->report->options = new stdclass(); +$lang->task->report->options->graph = new stdclass(); $lang->task->report->options->type = 'pie'; $lang->task->report->options->width = 500; $lang->task->report->options->height = 140; @@ -247,5 +257,5 @@ $lang->task->report->tasksPerConsumed->graph->xAxisName = '时间'; $lang->task->report->tasksPerFinishedBy->graph->xAxisName = '用户'; $lang->task->report->tasksPerClosedReason->graph->xAxisName = '关闭原因'; -$lang->task->report->finishedTasksPerDay->type = 'bar'; -$lang->task->report->finishedTasksPerDay->graph->xAxisName = '日期'; +$lang->task->report->finishedTasksPerDay->type = 'bar'; +$lang->task->report->finishedTasksPerDay->graph->xAxisName = '日期'; diff --git a/module/task/lang/zh-tw.php b/module/task/lang/zh-tw.php index 3533c2bc56..ca94dd8de4 100644 --- a/module/task/lang/zh-tw.php +++ b/module/task/lang/zh-tw.php @@ -95,6 +95,17 @@ $lang->task->deleteEstimate = '刪除工時'; $lang->task->colorTag = '顏色標籤'; $lang->task->files = '附件'; $lang->task->hasConsumed = '已消耗'; +$lang->task->multiple = '多人任務'; +$lang->task->multipleAB = '多人'; +$lang->task->team = '團隊'; +$lang->task->transmit = '轉交'; +$lang->task->transmitTo = '轉交給'; +$lang->task->children = '子任務'; +$lang->task->childrenAB = '子'; +$lang->task->parent = '父任務'; +$lang->task->unfinished = '未完成'; +$lang->task->lblPri = 'P'; +$lang->task->lblHour = '(h)'; $lang->task->ditto = '同上'; $lang->task->dittoNotice = "該任務與上一任務不屬於同一項目!"; diff --git a/module/task/model.php b/module/task/model.php index 22acfe5d28..9056c23929 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -15,8 +15,8 @@ class taskModel extends model { /** * Create a task. - * - * @param int $projectID + * + * @param int $projectID * @access public * @return void */ @@ -37,9 +37,11 @@ class taskModel extends model ->setDefault('openedDate', helper::now()) ->stripTags($this->config->task->editor->create['id'], $this->config->allowedTags) ->join('mailto', ',') - ->remove('after,files,labels,assignedTo,uid,storyEstimate,storyDesc,storyPri') + ->remove('after,files,labels,assignedTo,uid,storyEstimate,storyDesc,storyPri,team,teamEstimate,teamMember,multiple,teams') ->get(); + + foreach($this->post->assignedTo as $assignedTo) { /* When type is affair and has assigned then ignore none. */ @@ -48,6 +50,38 @@ class taskModel extends model $task->assignedTo = $assignedTo; if($assignedTo) $task->assignedDate = helper::now(); + $teams = array(); + if($this->post->multiple) + { + $estimate = 0; + $left = 0; + foreach($this->post->team as $row => $account) + { + if(empty($account) or isset($team[$account])) continue; + $member = new stdClass(); + $member->project = 0; + $member->account = $account; + $member->role = $assignedTo; + $member->join = helper::today(); + $member->estimate = $this->post->teamEstimate[$row] ? (float)$this->post->teamEstimate[$row] : 0; + $member->left = $member->estimate; + $member->order = $row; + + $teams[$account] = $member; + $estimate += (float)$member->estimate; + $left += (float)$member->left; + } + + if(!empty($teams)) + { + $firstMember = reset($teams); + $task->assignedTo = $firstMember->account; + $task->assignedDate = helper::today(); + $task->estimate = $estimate; + $task->left = $left; + } + } + /* Check duplicate task. */ if($task->type != 'affair') { @@ -67,31 +101,33 @@ class taskModel extends model ->checkIF($task->deadline != '0000-00-00', 'deadline', 'ge', $task->estStarted) ->exec(); - if(!dao::isError()) + if(dao::isError()) return false; + + $taskID = $this->dao->lastInsertID(); + if($this->post->story) $this->loadModel('story')->setStage($this->post->story); + $this->file->updateObjectID($this->post->uid, $taskID, 'task'); + if(!empty($taskFiles)) { - $taskID = $this->dao->lastInsertID(); - if($this->post->story) $this->loadModel('story')->setStage($this->post->story); - $this->file->updateObjectID($this->post->uid, $taskID, 'task'); - if(!empty($taskFiles)) + foreach($taskFiles as $taskFile) { - foreach($taskFiles as $taskFile) - { - $taskFile->objectID = $taskID; - $this->dao->insert(TABLE_FILE)->data($taskFile)->exec(); - } + $taskFile->objectID = $taskID; + $this->dao->insert(TABLE_FILE)->data($taskFile)->exec(); } - else - { - $taskFileTitle = $this->file->saveUpload('task', $taskID); - $taskFiles = $this->dao->select('*')->from(TABLE_FILE)->where('id')->in(array_keys($taskFileTitle))->fetchAll('id'); - foreach($taskFiles as $fileID => $taskFile) unset($taskFiles[$fileID]->id); - } - $tasksID[$assignedTo] = array('status' => 'created', 'id' => $taskID); } else { - return false; + $taskFileTitle = $this->file->saveUpload('task', $taskID); + $taskFiles = $this->dao->select('*')->from(TABLE_FILE)->where('id')->in(array_keys($taskFileTitle))->fetchAll('id'); + foreach($taskFiles as $fileID => $taskFile) unset($taskFiles[$fileID]->id); } + + if(!empty($teams)) foreach($teams as $team) + { + $team->task = $taskID; + $this->dao->insert(TABLE_TEAM)->data($team)->autoCheck()->exec(); + } + + $tasksID[$assignedTo] = array('status' => 'created', 'id' => $taskID); } return $tasksID; } @@ -111,7 +147,7 @@ class taskModel extends model $tasks = fixer::input('post')->get(); $batchNum = count(reset($tasks)); - $storyIDs = array(); + $storyIDs = array(); $taskNames = array(); foreach($tasks->story as $key => $storyID) { @@ -120,7 +156,7 @@ class taskModel extends model $inNames = in_array($tasks->name[$key], $taskNames); if(!$inNames || $inNames && !in_array($storyID, $storyIDs)) { - $storyIDs[] = $storyID; + $storyIDs[] = $storyID; $taskNames[] = $tasks->name[$key]; } else @@ -141,47 +177,41 @@ class taskModel extends model { die(js::alert($this->lang->task->error->estimateNumber)); } - if(!empty($tasks->name[$i]) and empty($tasks->type[$i]))die(js::alert(sprintf($this->lang->error->notempty, $this->lang->task->type))); + if(!empty($tasks->name[$i]) and empty($tasks->type[$i])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->task->type))); } $story = 0; $module = 0; $type = ''; $assignedTo = ''; - for($i = 0; $i < $batchNum; $i++) - { - $story = $tasks->story[$i] == 'ditto' ? $story : $tasks->story[$i]; - $module = $tasks->module[$i] == 'ditto' ? $module : $tasks->module[$i]; - $type = $tasks->type[$i] == 'ditto' ? $type : $tasks->type[$i]; - $assignedTo = $tasks->assignedTo[$i] == 'ditto' ? $assignedTo: $tasks->assignedTo[$i]; - - $tasks->story[$i] = (int)$story; - $tasks->module[$i] = (int)$module; - $tasks->type[$i] = $type; - $tasks->assignedTo[$i] = $assignedTo; - } for($i = 0; $i < $batchNum; $i++) { + $story = !isset($tasks->story[$i]) || $tasks->story[$i] == 'ditto' ? $story : $tasks->story[$i]; + $module = !isset($tasks->module[$i]) || $tasks->module[$i] == 'ditto' ? $module : $tasks->module[$i]; + $type = !isset($tasks->type[$i]) || $tasks->type[$i] == 'ditto' ? $type : $tasks->type[$i]; + $assignedTo = !isset($tasks->assignedTo[$i]) || $tasks->assignedTo[$i] == 'ditto' ? $assignedTo: $tasks->assignedTo[$i]; + if(empty($tasks->name[$i])) continue; - $data[$i] = new stdclass(); - $data[$i]->story = $tasks->story[$i]; - $data[$i]->type = $tasks->type[$i]; - $data[$i]->module = $tasks->module[$i]; - $data[$i]->assignedTo = $tasks->assignedTo[$i]; - $data[$i]->color = $tasks->color[$i]; - $data[$i]->name = $tasks->name[$i]; - $data[$i]->desc = nl2br($tasks->desc[$i]); - $data[$i]->pri = $tasks->pri[$i]; - $data[$i]->estimate = $tasks->estimate[$i]; - $data[$i]->left = $tasks->estimate[$i]; - $data[$i]->project = $projectID; - $data[$i]->estStarted = empty($tasks->estStarted[$i]) ? '0000-00-00' : $tasks->estStarted[$i]; - $data[$i]->deadline = empty($tasks->deadline[$i]) ? '0000-00-00' : $tasks->deadline[$i]; - $data[$i]->status = 'wait'; - $data[$i]->openedBy = $this->app->user->account; - $data[$i]->openedDate = $now; + $data[$i] = new stdclass(); + $data[$i]->story = (int)$story; + $data[$i]->type = $type; + $data[$i]->module = (int)$module; + $data[$i]->assignedTo = $assignedTo; + $data[$i]->color = $tasks->color[$i]; + $data[$i]->name = $tasks->name[$i]; + $data[$i]->desc = nl2br($tasks->desc[$i]); + $data[$i]->pri = $tasks->pri[$i]; + $data[$i]->estimate = $tasks->estimate[$i]; + $data[$i]->left = $tasks->estimate[$i]; + $data[$i]->project = $projectID; + $data[$i]->estStarted = empty($tasks->estStarted[$i]) ? '0000-00-00' : $tasks->estStarted[$i]; + $data[$i]->deadline = empty($tasks->deadline[$i]) ? '0000-00-00' : $tasks->deadline[$i]; + $data[$i]->status = 'wait'; + $data[$i]->openedBy = $this->app->user->account; + $data[$i]->openedDate = $now; + $data[$i]->parent = $tasks->parent[$i]; if($tasks->story[$i] != '') $data[$i]->storyVersion = $this->loadModel('story')->getVersion($data[$i]->story); if($tasks->assignedTo[$i] != '') $data[$i]->assignedDate = $now; @@ -202,13 +232,71 @@ class taskModel extends model $mails[$i]->actionID = $actionID; } + $this->countTime($tasks->parent[0]); return $mails; } + /** + * count parent task estimate and left value + * + * @param $taskID + * + * @access private + * @return void + */ + private function countTime($taskID) + { + if(!$taskID) return true; + + $tasks = $this->dao->select('`id`,`estimate`,`consumed`,`left`')->from(TABLE_TASK)->where('parent')->eq($taskID)->fetchAll('id'); + + if(empty($tasks)) return true; + + $estimate = 0; + $consumed = 0; + $left = 0; + foreach($tasks as $task) + { + $estimate += $task->estimate; + $consumed += $task->consumed; + $left += $task->left; + } + + $newTask = new stdClass(); + $newTask->estimate = $estimate; + $newTask->consumed = $consumed; + $newTask->left = $left; + + $this->dao->update(TABLE_TASK)->data($newTask)->autoCheck()->where('id')->eq($taskID)->exec(); + } + + /** + * Check that all child status + * + * @param $parentID + * @param $status + * + * @access private + * @return bool + */ + private function parentStatus($parentID, $status = 'done') + { + if(!$parentID) return true; + $data = new stdClass(); + $children = $this->dao->select('id,status')->from(TABLE_TASK)->where('parent')->eq($parentID)->fetchPairs('id', 'status'); + $values = array_values(array_unique($children)); + if((count($values) == 1 && $values[0] == $status) || (count($values) == 2 && in_array('closed', $values) && $status == 'done')) + { + $data->status = $status; + $this->dao->update(TABLE_TASK)->data($data)->autoCheck()->where('id')->eq($parentID)->exec(); + } + } + + /** * Update a task. - * - * @param int $taskID + * + * @param int $taskID * @access public * @return void */ @@ -248,10 +336,46 @@ class taskModel extends model ->add('lastEditedDate', $now) ->stripTags($this->config->task->editor->edit['id'], $this->config->allowedTags) ->join('mailto', ',') - ->remove('comment,files,labels,uid') + ->remove('comment,files,labels,uid,multiple,team,teamEstimate,teamConsumed,teamLeft') ->get(); - if($task->consumed < $oldTask->consumed) + $teams = array(); + if($this->post->multiple) + { + $estimate = 0; + $left = 0; + foreach($this->post->team as $row => $account) + { + if(empty($account) or isset($team[$account])) continue; + $member = new stdClass(); + $member->project = 0; + $member->account = $account; + $member->role = $task->assignedTo; + $member->join = helper::today(); + $member->task = $taskID; + $member->estimate = $this->post->teamEstimate[$row] ? $this->post->teamEstimate[$row] : 0; + $member->consumed = $this->post->teamConsumed[$row] ? $this->post->teamConsumed[$row] : 0; + $member->left = $member->estimate - $member->consumed; + $member->order = $row; + + $teams[$account] = $member; + $estimate += (float)$member->eatimate; + $left += (float)$member->left; + } + + if(!empty($teams)) + { + $task->estimate = $estimate; + $task->left = $left; + if(!isset($task->assignedTo)) + { + $firstMember = reset($teams); + $task->assignedTo = $firstMember->account; + } + } + } + + if($task->consumed < $oldTask->consumed) { die(js::error($this->lang->task->error->consumedSmall)); } @@ -287,6 +411,12 @@ class taskModel extends model ->batchCheckIF($task->closedReason == 'cancel', 'finishedBy, finishedDate', 'empty') ->where('id')->eq((int)$taskID)->exec(); + $this->countTime($oldTask->parent); + + /* Save team. */ + $this->dao->delete()->from(TABLE_TEAM)->where('task')->eq($taskID)->exec(); + if(!empty($teams)) foreach($teams as $member) $this->dao->insert(TABLE_TEAM)->data($member)->autoCheck()->exec(); + if($this->post->story != false) $this->loadModel('story')->setStage($this->post->story); if(!dao::isError()) { @@ -297,7 +427,7 @@ class taskModel extends model /** * Batch update task. - * + * * @access public * @return void */ @@ -432,7 +562,7 @@ class taskModel extends model break; case 'pause': { - $task->finishedDate = ''; + $task->finishedDate = ''; } default:break; @@ -462,7 +592,7 @@ class taskModel extends model if($task->status == 'done' and $task->closedReason) $this->dao->update(TABLE_TASK)->set('status')->eq('closed')->where('id')->eq($taskID)->exec(); if($oldTask->story != false) $this->loadModel('story')->setStage($oldTask->story); - if(!dao::isError()) + if(!dao::isError()) { $allChanges[$taskID] = common::createChanges($oldTask, $task); } @@ -506,8 +636,8 @@ class taskModel extends model /** * Assign a task to a user again. - * - * @param int $taskID + * + * @param int $taskID * @access public * @return void */ @@ -527,15 +657,15 @@ class taskModel extends model ->data($task) ->autoCheck() ->check('left', 'float') - ->where('id')->eq($taskID)->exec(); + ->where('id')->eq($taskID)->exec(); if(!dao::isError()) return common::createChanges($oldTask, $task); } /** * Start a task. - * - * @param int $taskID + * + * @param int $taskID * @access public * @return void */ @@ -547,12 +677,12 @@ class taskModel extends model $task = fixer::input('post') ->setDefault('assignedTo', $this->app->user->account) ->setDefault('lastEditedBy', $this->app->user->account) - ->setDefault('lastEditedDate', $now) + ->setDefault('lastEditedDate', $now) ->setIF($oldTask->assignedTo != $this->app->user->account, 'assignedDate', $now) ->remove('comment')->get(); if($this->post->left == 0) { - $task->status = 'done'; + $task->status = 'done'; $task->finishedBy = $this->app->user->account; $task->finishedDate = helper::now(); } @@ -563,11 +693,11 @@ class taskModel extends model /* Record consumed and left. */ $estimate = fixer::input('post') - ->setDefault('account', $this->app->user->account) - ->setDefault('task', $taskID) - ->setDefault('date', $task->realStarted) + ->setDefault('account', $this->app->user->account) + ->setDefault('task', $taskID) + ->setDefault('date', $task->realStarted) ->remove('realStarted,comment')->get(); - $estimate->consumed = $estimate->consumed - $oldTask->consumed; + $estimate->consumed = $estimate->consumed - $oldTask->consumed; $this->addTaskEstimate($estimate); $this->dao->update(TABLE_TASK)->data($task) @@ -575,14 +705,31 @@ class taskModel extends model ->check('consumed,left', 'float') ->where('id')->eq((int)$taskID)->exec(); + if($oldTask->parent) + { + switch($task->status) + { + case 'doing': + $status = new stdClass(); + $status->status = 'doing'; + $this->dao->update(TABLE_TASK)->data($status)->autoCheck()->where('id')->eq((int)$oldTask->parent)->exec(); + break; + case 'done': + $this->parentStatus($oldTask->parent,'done'); + break; + } + } + + $this->countTime($oldTask->parent); + if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story); if(!dao::isError()) return common::createChanges($oldTask, $task); } /** - * Record estimate and left of task. - * - * @param int $taskID + * Record estimate and left of task. + * + * @param int $taskID * @access public * @return void */ @@ -649,7 +796,7 @@ class taskModel extends model $data->lastEditedDate = $now; if($left == 0) { - $task->status = 'done'; + $task->status = 'done'; $data->status = $task->status; $data->assignedTo = $task->openedBy; $data->assignedDate = $now; @@ -658,7 +805,7 @@ class taskModel extends model } else if($task->status == 'wait') { - $task->status = 'doing'; + $task->status = 'doing'; $data->status = $task->status; $data->assignedTo = $this->app->user->account; $data->assignedDate = $now; @@ -666,7 +813,7 @@ class taskModel extends model } else if($task->status == 'pause') { - $task->status = 'doing'; + $task->status = 'doing'; $data->status = $task->status; $data->assignedTo = $this->app->user->account; $data->assignedDate = $now; @@ -687,13 +834,16 @@ class taskModel extends model if(!empty($actionID)) $this->action->logHistory($actionID, $changes); if($task->story) $this->loadModel('story')->setStage($task->story); + if($task->status == 'done') $this->parentStatus($task->parent, 'done'); + $this->countTime($task->parent); + return $changes; } /** * Finish a task. - * - * @param int $taskID + * + * @param int $taskID * @access public * @return void */ @@ -707,7 +857,7 @@ class taskModel extends model ->setDefault('assignedDate', $now) ->setDefault('status', 'done') ->setDefault('finishedBy, lastEditedBy', $this->app->user->account) - ->setDefault('finishedDate, lastEditedDate', $now) + ->setDefault('finishedDate, lastEditedDate', $now) ->remove('comment,files,labels') ->get(); if($task->finishedDate == substr($now, 0, 10)) $task->finishedDate = $now; @@ -718,13 +868,13 @@ class taskModel extends model $consumed = $task->consumed - $oldTask->consumed; if($consumed < 0) die(js::error($this->lang->task->error->consumedSmall)); $estimate = fixer::input('post') - ->setDefault('account', $this->app->user->account) - ->setDefault('task', $taskID) - ->setDefault('date', date(DT_DATE1)) + ->setDefault('account', $this->app->user->account) + ->setDefault('task', $taskID) + ->setDefault('date', date(DT_DATE1)) ->setDefault('left', 0) ->remove('finishedDate,comment,assignedTo,files,labels,consumed') ->get(); - $estimate->consumed = $consumed; + $estimate->consumed = $consumed; if($estimate->consumed) $this->addTaskEstimate($estimate); $this->dao->update(TABLE_TASK)->data($task) @@ -732,14 +882,17 @@ class taskModel extends model ->check('consumed', 'notempty') ->where('id')->eq((int)$taskID)->exec(); + if($task->status == 'done') $this->parentStatus($oldTask->parent, 'done'); + $this->countTime($oldTask->parent); + if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story); if(!dao::isError()) return common::createChanges($oldTask, $task); } /** - * Pause task - * - * @param int $taskID + * Pause task + * + * @param int $taskID * @access public * @return array */ @@ -750,18 +903,18 @@ class taskModel extends model $task = fixer::input('post') ->setDefault('status', 'pause') ->setDefault('lastEditedBy', $this->app->user->account) - ->setDefault('lastEditedDate', $now) + ->setDefault('lastEditedDate', $now) ->remove('comment')->get(); $this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('id')->eq((int)$taskID)->exec(); if(!dao::isError()) return common::createChanges($oldTask, $task); } - + /** * Close a task. - * - * @param int $taskID + * + * @param int $taskID * @access public * @return void */ @@ -774,13 +927,19 @@ class taskModel extends model ->setDefault('assignedTo', 'closed') ->setDefault('assignedDate', $now) ->setDefault('closedBy, lastEditedBy', $this->app->user->account) - ->setDefault('closedDate, lastEditedDate', $now) - ->setIF($oldTask->status == 'done', 'closedReason', 'done') - ->setIF($oldTask->status == 'cancel', 'closedReason', 'cancel') + ->setDefault('closedDate, lastEditedDate', $now) + ->setIF($oldTask->status == 'done', 'closedReason', 'done') + ->setIF($oldTask->status == 'cancel', 'closedReason', 'cancel') ->remove('_recPerPage') ->remove('comment')->get(); $this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('id')->eq((int)$taskID)->exec(); + $this->parentStatus($oldTask->parent,'closed'); + $this->countTime($oldTask->parent); + + $data = new stdClass(); + $data->status = 'closed'; + $this->dao->update(TABLE_TASK)->data($data)->autoCheck()->where('parent')->eq($taskID)->exec(); if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story); if(!dao::isError()) return common::createChanges($oldTask, $task); @@ -788,8 +947,8 @@ class taskModel extends model /** * Cancel a task. - * - * @param int $taskID + * + * @param int $taskID * @access public * @return void */ @@ -804,7 +963,7 @@ class taskModel extends model ->setDefault('finishedBy', '') ->setDefault('finishedDate', '0000-00-00') ->setDefault('canceledBy, lastEditedBy', $this->app->user->account) - ->setDefault('canceledDate, lastEditedDate', $now) + ->setDefault('canceledDate, lastEditedDate', $now) ->remove('comment')->get(); $this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('id')->eq((int)$taskID)->exec(); @@ -815,8 +974,8 @@ class taskModel extends model /** * Activate a task. - * - * @param int $taskID + * + * @param int $taskID * @access public * @return void */ @@ -837,6 +996,13 @@ class taskModel extends model ->check('left', 'notempty') ->where('id')->eq((int)$taskID)->exec(); + $this->countTime($oldTask->parent); + + $data = new stdClass(); + $data->status = 'doing'; + $this->dao->update(TABLE_TASK)->data($data)->autoCheck()->where('parent')->eq($taskID)->exec(); + if($oldTask->parent) $this->dao->update(TABLE_TASK)->data($data)->autoCheck()->where('id')->eq((int)$oldTask->parent)->exec(); + if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story); if(!dao::isError()) return common::createChanges($oldTask, $task); @@ -844,8 +1010,8 @@ class taskModel extends model /** * Get task info by Id. - * - * @param int $taskID + * + * @param int $taskID * @param bool $setImgSize * @access public * @return object|bool @@ -862,6 +1028,14 @@ class taskModel extends model ->fetch(); if(!$task) return false; + $children = $this->dao->select('*')->from(TABLE_TASK)->where('parent')->eq($taskID)->andWhere('deleted')->eq(0)->fetchAll('id'); + $task->children = $children; + + $teams = $this->dao->select('*')->from(TABLE_TEAM)->where('task')->eq($taskID)->orderBy('order_desc')->fetchGroup('task', 'account'); + foreach($teams as $key => $team) $teams[$key] = array_reverse($team); + $task->team = isset($teams[$taskID]) ? $teams[$taskID] : array(); + foreach($children as $child) $child->team = isset($teams[$child->id]) ? $teams[$child->id] : array(); + $task = $this->loadModel('file')->replaceImgURL($task, 'desc'); if($setImgSize) $task->desc = $this->file->setImgSize($task->desc); if($task->assignedTo == 'closed') $task->assignedToRealName = 'Closed'; @@ -876,8 +1050,8 @@ class taskModel extends model /** * Get task list. - * - * @param int|array|string $taskIDList + * + * @param int|array|string $taskIDList * @access public * @return array */ @@ -922,13 +1096,15 @@ class taskModel extends model /** * Get tasks of a project. * - * @param int $projectID - * @param string $status all|needConfirm|wait|doing|done|cancel - * @param string $type - * @param array|string $modules - * @param object $pager + * @param $projectID + * @param int $productID + * @param string $type + * @param int $modules + * @param string $orderBy + * @param null $pager + * * @access public - * @return array + * @return array|void */ public function getProjectTasks($projectID, $productID = 0, $type = 'all', $modules = 0, $orderBy = 'status_asc, id_desc', $pager = null) { @@ -939,6 +1115,7 @@ class taskModel extends model ->leftJoin(TABLE_USER)->alias('t3')->on('t1.assignedTo = t3.account') ->where('t1.project')->eq((int)$projectID) ->andWhere('t1.deleted')->eq(0) + ->andWhere('t1.parent')->eq(0) ->beginIF($productID)->andWhere('t2.product')->eq((int)$productID)->fi() ->beginIF($type == 'undone')->andWhere("(t1.status = 'wait' or t1.status ='doing')")->fi() ->beginIF($type == 'needconfirm')->andWhere('t2.version > t1.storyVersion')->andWhere("t2.status = 'active'")->fi() @@ -949,10 +1126,26 @@ class taskModel extends model ->beginIF($modules)->andWhere('t1.module')->in($modules)->fi() ->orderBy($orderBy) ->page($pager) - ->fetchAll(); + ->fetchAll('id'); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'task', ($productID or $type == 'needconfirm') ? false : true); + $taskList = array_keys($tasks); + if(!empty($taskList)) + { + $children = $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName') + ->from(TABLE_TASK)->alias('t1') + ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') + ->leftJoin(TABLE_USER)->alias('t3')->on('t1.assignedTo = t3.account') + ->where('t1.parent')->in($taskList) + ->andWhere('t1.deleted')->eq(0) + ->orderBy('id_desc') + ->fetchGroup('parent'); + if(!empty($children)) foreach($children as $key => $child) $tasks[$key]->children = $child; + $teams = $this->dao->select('*')->from(TABLE_TEAM)->where('task')->in($taskList)->fetchGroup('task'); + if($teams) foreach($teams as $key => $team) if(!empty($team)) $tasks[$key]->team = $team; + } + if($tasks) return $this->processTasks($tasks); return array(); } @@ -960,9 +1153,9 @@ class taskModel extends model /** * Get project tasks pairs. * - * @param int $projectID + * @param int $projectID * @param string $status - * @param string $orderBy + * @param string $orderBy * @access public * @return array */ @@ -983,11 +1176,11 @@ class taskModel extends model /** * Get tasks of a user. - * - * @param string $account - * @param string $type the query type - * @param int $limit - * @param object $pager + * + * @param string $account + * @param string $type the query type + * @param int $limit + * @param object $pager * @access public * @return array */ @@ -1013,9 +1206,9 @@ class taskModel extends model /** * Get tasks pairs of a user. - * - * @param string $account - * @param string $status + * + * @param string $account + * @param string $status * @access public * @return array */ @@ -1038,9 +1231,9 @@ class taskModel extends model /** * Get task pairs of a story. - * - * @param int $storyID - * @param int $projectID + * + * @param int $storyID + * @param int $projectID * @access public * @return array */ @@ -1075,9 +1268,9 @@ class taskModel extends model /** * Get counts of some stories' tasks. - * - * @param array $stories - * @param int $projectID + * + * @param array $stories + * @param int $projectID * @access public * @return int */ @@ -1095,30 +1288,30 @@ class taskModel extends model } /** - * Get task estimate. - * - * @param int $taskID + * Get task estimate. + * + * @param int $taskID * @access public - * @return object + * @return object */ public function getTaskEstimate($taskID) { - return $this->dao->select('*')->from(TABLE_TASKESTIMATE) + return $this->dao->select('*')->from(TABLE_TASKESTIMATE) ->where('task')->eq($taskID) ->orderBy('date,id') ->fetchAll(); } /** - * Get estimate by id. - * - * @param int $estimateID + * Get estimate by id. + * + * @param int $estimateID * @access public - * @return object. + * @return object. */ public function getEstimateById($estimateID) { - $estimate = $this->dao->select('*')->from(TABLE_TASKESTIMATE) + $estimate = $this->dao->select('*')->from(TABLE_TASKESTIMATE) ->where('id')->eq($estimateID) ->fetch(); @@ -1127,14 +1320,14 @@ class taskModel extends model ->where('task')->eq($estimate->task) ->andWhere('id')->gt($estimate->id) ->fetch('id'); - $estimate->isLast = $lastID ? false :true; + $estimate->isLast = $lastID ? false :true; return $estimate; } /** - * Update estimate. - * - * @param int $estimateID + * Update estimate. + * + * @param int $estimateID * @access public * @return void */ @@ -1152,7 +1345,7 @@ class taskModel extends model $consumed = $task->consumed + $estimate->consumed - $oldEstimate->consumed; $lastEstimate = $this->dao->select('*')->from(TABLE_TASKESTIMATE)->where('task')->eq($task->id)->orderBy('id desc')->fetch(); - $left = ($lastEstimate and $estimateID == $lastEstimate->id) ? $estimate->left : $task->left; + $left = ($lastEstimate and $estimateID == $lastEstimate->id) ? $estimate->left : $task->left; if($left == 0) $task->status = 'done'; $now = helper::now(); @@ -1162,7 +1355,7 @@ class taskModel extends model $data->status = $task->status; $data->lastEditedBy = $this->app->user->account; $data->lastEditedDate = $now; - if(!$left) + if(!$left) { $data->finishedBy = $this->app->user->account; $data->finishedDate = $now; @@ -1183,9 +1376,9 @@ class taskModel extends model } /** - * Delete estimate. - * - * @param int $estimateID + * Delete estimate. + * + * @param int $estimateID * @access public * @return void */ @@ -1198,7 +1391,7 @@ class taskModel extends model $consumed = $task->consumed - $estimate->consumed; $left = $lastEstimate->left ? $lastEstimate->left : $estimate->left; $oldStatus = $task->status; - if($left == 0 and $consumed != 0) $task->status = 'done'; + if($left == 0 and $consumed != 0) $task->status = 'done'; $this->dao->update(TABLE_TASK) ->set("consumed")->eq($consumed) ->set('`left`')->eq($left) @@ -1219,8 +1412,8 @@ class taskModel extends model /** * Batch process tasks. - * - * @param int $tasks + * + * @param int $tasks * @access private * @return void */ @@ -1229,6 +1422,10 @@ class taskModel extends model foreach($tasks as $task) { $task = $this->processTask($task); + if(!empty($task->children)) + { + foreach($task->children as $child) $task = $this->processTask($child); + } } return $tasks; } @@ -1256,7 +1453,7 @@ class taskModel extends model /* Story changed or not. */ $task->needConfirm = false; - if($task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion) $task->needConfirm = true; + if(!empty($task->storyStatus) and $task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion) $task->needConfirm = true; /* Set product type for task. */ if(isset($task->product)) @@ -1303,7 +1500,7 @@ class taskModel extends model return true; } - + /** * Get story comments. * @@ -1322,8 +1519,8 @@ class taskModel extends model /** * Merge the default chart settings and the settings of current chart. - * - * @param string $chartType + * + * @param string $chartType * @access public * @return void */ @@ -1340,10 +1537,10 @@ class taskModel extends model /* merge configuration */ foreach($commonOption->graph as $key => $value) if(!isset($chartOption->graph->$key)) $chartOption->graph->$key = $value; } - + /** - * Get report data of tasks per project - * + * Get report data of tasks per project + * * @access public * @return array */ @@ -1362,8 +1559,8 @@ class taskModel extends model } /** - * Get report data of tasks per module - * + * Get report data of tasks per module + * * @access public * @return array */ @@ -1383,8 +1580,8 @@ class taskModel extends model } /** - * Get report data of tasks per assignedTo - * + * Get report data of tasks per assignedTo + * * @access public * @return array */ @@ -1403,8 +1600,8 @@ class taskModel extends model } /** - * Get report data of tasks per type - * + * Get report data of tasks per type + * * @access public * @return array */ @@ -1423,7 +1620,7 @@ class taskModel extends model /** * Get report data of tasks per priority - * + * * @access public * @return array */ @@ -1445,8 +1642,8 @@ class taskModel extends model } /** - * Get report data of tasks per deadline - * + * Get report data of tasks per deadline + * * @access public * @return array */ @@ -1461,8 +1658,8 @@ class taskModel extends model } /** - * Get report data of tasks per estimate - * + * Get report data of tasks per estimate + * * @access public * @return array */ @@ -1478,7 +1675,7 @@ class taskModel extends model /** * Get report data of tasks per left - * + * * @access public * @return array */ @@ -1494,7 +1691,7 @@ class taskModel extends model /** * Get report data of tasks per consumed - * + * * @access public * @return array */ @@ -1509,8 +1706,8 @@ class taskModel extends model } /** - * Get report data of tasks per finishedBy - * + * Get report data of tasks per finishedBy + * * @access public * @return array */ @@ -1530,8 +1727,8 @@ class taskModel extends model } /** - * Get report data of tasks per closed reason - * + * Get report data of tasks per closed reason + * * @access public * @return array */ @@ -1556,7 +1753,7 @@ class taskModel extends model /** * Get report data of finished tasks per day - * + * * @access public * @return array */ @@ -1581,7 +1778,7 @@ class taskModel extends model /** * Get report data of status - * + * * @access public * @return array */ @@ -1613,6 +1810,14 @@ class taskModel extends model { $action = strtolower($action); + if($action == 'start' and !empty($task->children)) return false; + if($action == 'recordestimate' and !empty($task->children)) return false; + if($action == 'finish' and !empty($task->children)) return false; + if($action == 'cancel' and !empty($task->children)) return false; + if($action == 'pause' and !empty($task->children)) return false; + if($action == 'batchcreate' and !empty($task->team)) return false; + if($action == 'batchcreate' and $task->parent) return false; + if($action == 'assignto') return $task->status != 'closed' and $task->status != 'cancel'; if($action == 'start') return $task->status == 'wait'; if($action == 'restart') return $task->status == 'pause'; @@ -1622,12 +1827,14 @@ class taskModel extends model if($action == 'cancel') return $task->status != 'done' and $task->status != 'closed' and $task->status != 'cancel'; if($action == 'pause') return $task->status == 'doing'; + + return true; } /** * Get report condition from session. - * + * * @access public * @return void */ @@ -1643,8 +1850,8 @@ class taskModel extends model /** * Add task estimate. - * - * @param object $data + * + * @param object $data * @access public * @return void */ @@ -1655,16 +1862,22 @@ class taskModel extends model /** * Print cell data. - * - * @param object $col - * @param object $task - * @param array $users - * @param string $browseType + * + * @param $col + * @param $task + * @param $users + * @param $browseType + * @param $branchGroups + * @param array $modulePairs + * @param string $mode + * @param bool $child + * * @access public * @return void */ - public function printCell($col, $task, $users, $browseType, $branchGroups, $modulePairs = array()) + public function printCell($col, $task, $users, $browseType, $branchGroups, $modulePairs = array(), $mode = 'datatable', $child = false) { + $canView = common::hasPriv('task', 'view'); $taskLink = helper::createLink('task', 'view', "taskID=$task->id"); $account = $this->app->user->account; $id = $col->id; @@ -1672,15 +1885,18 @@ class taskModel extends model { $class = ''; if($id == 'status') $class .= ' task-' . $task->status; + if($id == 'id') $class .= ' cell-id'; if($id == 'name' or $id == 'story') $class .= ' text-left'; if($id == 'deadline' and isset($task->delay)) $class .= ' delayed'; if($id == 'assignedTo' && $task->assignedTo == $account) $class .= ' red'; echo ""; - switch ($id) + switch($id) { case 'id': - echo html::a($taskLink, sprintf('%03d', $task->id)); + if($mode == 'table' && $child == false) echo " "; + if($mode == 'table' && $child) echo '    '; + echo $canView ? html::a($taskLink, sprintf('%03d', $task->id)) : sprintf('%03d', $task->id); break; case 'pri': echo ""; @@ -1688,16 +1904,19 @@ class taskModel extends model echo ""; break; case 'name': - if(isset($branchGroups[$task->product][$task->branch])) echo "" . $branchGroups[$task->product][$task->branch] . ' '; + if(!empty($task->product) && isset($branchGroups[$task->product][$task->branch])) echo "" . $branchGroups[$task->product][$task->branch] . ' '; if($modulePairs and $task->module) echo "" . $modulePairs[$task->module] . ' '; - echo html::a($taskLink, $task->name, null, "style='color: $task->color'"); + if($child) echo ''.$this->lang->task->childrenAB.' '; + if(!empty($task->team)) echo ''.$this->lang->task->multipleAB.' '; + echo $canView ? html::a($taskLink, $task->name, null, "style='color: $task->color'") : "$task->name"; if($task->fromBug) echo html::a(helper::createLink('bug', 'view', "id=$task->fromBug"), "[BUG#$task->fromBug]", '_blank', "class='bug'"); + if(!empty($task->children)) echo '    '; break; case 'type': echo $this->lang->task->typeList[$task->type]; break; case 'status': - $storyChanged = ($task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion); + $storyChanged = (!empty($task->storyStatus) and $task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion); $storyChanged ? print("{$this->lang->story->changed} ") : print($this->lang->task->statusList[$task->status]); break; case 'estimate': @@ -1755,7 +1974,7 @@ class taskModel extends model echo $this->lang->task->reasonList[$task->closedReason]; break; case 'story': - if($task->storyID) + if(!empty($task->storyID)) { if(!common::printLink('story', 'view', "storyid=$task->storyID", $task->storyTitle)) print $task->storyTitle; } @@ -1788,6 +2007,7 @@ class taskModel extends model common::printIcon('task', 'finish', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); common::printIcon('task', 'edit',"taskID=$task->id", $task, 'list'); + if(empty($task->team) or empty($task->children)) common::printIcon('task', 'batchCreate', "project=$task->project&storyID=$task->story&moduleID=$task->module&taskID=$task->id", $task, 'list','plus','','','','',$this->lang->task->children); break; } echo '
    - - + + diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index f58f2670f5..ab74f65672 100644 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -34,12 +34,12 @@ $hiddenStory = ((isonlybody() and $storyID) || $this->config->global->flow == 'o if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1; ?> -
    task->assignedTo;?>team) ? $lang->task->assign : $lang->task->transmitTo;?>assignedTo, "class='form-control chosen'");?>
    task->left;?>
    +
    - + type != 'ops'):?> @@ -56,6 +56,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1; $lang->task->typeList['ditto'] = $lang->task->ditto; $members['ditto'] = $lang->task->ditto; $modules['ditto'] = $lang->task->ditto; + if($project->type == 'ops') $colspan = $colspan-1; ?> task->batchCreate; $i++):?> - + - +
    idAB;?> '>task->module?>'>task->story;?>'>task->story;?> task->name;?> typeAB;?> '>task->assignedTo;?>
    style='overflow:visible'>id, $i)'")?> style='overflow: visible'> + type != 'ops'):?> style='overflow: visible'>
    @@ -83,7 +84,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
    -
    task->colorTag}' data-update-text='#name\\[{$i}\\]'");?> @@ -131,6 +132,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
    +type);?> task->ditto);?> diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index b36c445810..bdd3991996 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -38,7 +38,16 @@
    task->assignedTo;?>assignedTo, "class='form-control chosen'");?> +
    + assignedTo, "class='form-control chosen'");?> + type == 'ops') :?> + + + + +
    +
    + createLink('custom', 'ajaxSaveCustomFields', 'module=task§ion=custom&key=createFields')?> diff --git a/module/task/view/edit.html.php b/module/task/view/edit.html.php index 04e7086b73..015d52aa9b 100644 --- a/module/task/view/edit.html.php +++ b/module/task/view/edit.html.php @@ -35,6 +35,14 @@
    name, 'class="form-control" autocomplete="off" placeholder="' . $lang->task->name . '"');?> + children) and empty($task->parent)):?> + + + +
    @@ -81,14 +89,20 @@
    task->assignedTo;?> assignedTo, "class='form-control chosen'");?>
    task->team;?>task->team,'', "class='form-control btn' data-toggle='modalTeam'");?>
    task->type;?> task->typeList, $task->type, 'class=form-control');?>
    task->status;?> task->statusList, $task->status, 'class=form-control');?>
    task->pri;?> task->priList, $task->pri, 'class=form-control');?>
    + team as $member):?> + + + + + + + + + + + + + + +
    account, "class='form-control chosen'")?> +
    + task->estimate?> + estimate, "class='form-control text-center' placeholder='{$lang->task->hour}'")?> + task->consumed?> + consumed, "class='form-control text-center' placeholder='{$lang->task->hour}'")?> + task->left?> + left, "class='form-control text-center' placeholder='{$lang->task->hour}'")?> +
    +
    + + +
    +
    + task->estimate?> + task->hour}'")?> + task->consumed?> + task->hour}'")?> + task->left?> + task->hour}'")?> +
    +
    + + +
    confirm, '',"class='btn btn-primary' data-dismiss='modal'") ?>
    + + + diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php index e7cec9645a..bda27633c6 100644 --- a/module/task/view/view.html.php +++ b/module/task/view/view.html.php @@ -31,7 +31,7 @@ { ob_start(); echo "
    "; - common::printIcon('task', 'assignTo', "projectID=$task->project&taskID=$task->id", $task, 'button', '', '', 'iframe', true); + common::printIcon('task', 'assignTo', "projectID=$task->project&taskID=$task->id", $task, 'button', '', '', 'iframe', true); common::printIcon('task', 'start', "taskID=$task->id", $task, 'button', '', '', 'iframe', true); common::printIcon('task', 'restart', "taskID=$task->id", $task, 'button', '', '', 'iframe', true); common::printIcon('task', 'recordEstimate', "taskID=$task->id", $task, 'button', '', '', 'iframe', true); @@ -43,6 +43,7 @@ echo '
    '; echo "
    "; + if(empty($task->team) or empty($task->children)) common::printIcon('task', 'batchCreate', "project=$task->project&storyID=$task->story&moduleID=$task->module&taskID=$task->id", $task, 'button','plus','','','','',' '); common::printIcon('task', 'edit', "taskID=$task->id", $task); common::printCommentIcon('task', $task); common::printIcon('task', 'create', "productID=0&storyID=0&moduleID=0&taskID=$task->id", $task, 'button', 'copy'); @@ -87,7 +88,6 @@
    storyVerify;?>
    - cases) and $task->cases):?>
    task->case;?> @@ -98,7 +98,52 @@
    - + children)):?> +
    + lang->task->children;?> + + + + + + + + + + + + + children as $child):?> + + + + + + + + + + + + +
    task->id;?> task->lblPri;?> task->name;?>task->deadline;?> task->assignedTo;?> task->status;?> task->consumedAB . $lang->task->lblHour;?>task->leftAB . $lang->task->lblHour;?>actions;?>
    id;?> + lang->task->priList, $child->pri, $child->pri) . "'>"; + echo $child->pri == '0' ? '' : zget($this->lang->task->priList, $child->pri, $child->pri); + echo ""; + ?> + id"); ?>">name;?>deadline;?>assignedTo])) echo $users[$child->assignedTo];?>task->statusList, $child->status);?>consumed;?>left;?> + project&taskID=$child->id", $child, 'list', '', '', 'iframe', true); + common::printIcon('task', 'start', "taskID=$child->id", $child, 'list', '', '', 'iframe', true); + common::printIcon('task', 'recordEstimate', "taskID=$child->id", $child, 'list', 'time', '', 'iframe', true); + common::printIcon('task', 'finish', "taskID=$child->id", $child, 'list', '', '', 'iframe', true); + common::printIcon('task', 'close', "taskID=$child->id", $child, 'list', '', '', 'iframe', true); + common::printIcon('task', 'edit',"taskID=$child->id", $child, 'list'); + ?> +
    +
    + fetch('file', 'printFiles', array('files' => $task->files, 'fieldset' => 'true'));?>
    deleted) echo $actionLinks;?>
    @@ -175,7 +220,7 @@ task->assignedTo;?> - assignedTo ? $task->assignedToRealName . $lang->at . $task->assignedDate : '';?> + assignedTo ? $task->assignedToRealName . $lang->at . $task->assignedDate : '';?> task->type;?> @@ -195,6 +240,29 @@ + team)) :?> +
    + task->team;?> + + + + + + + + + + team as $member):?> + + + + + + + +
    task->team?>task->estimate?>task->consumed?>task->left?>
    account)?>estimate?>consumed?>left?>
    +
    +
    task->legendEffort;?> diff --git a/module/testcase/config.php b/module/testcase/config.php index d0bd0f68e2..40c08e6a09 100644 --- a/module/testcase/config.php +++ b/module/testcase/config.php @@ -91,9 +91,14 @@ $config->testcase->datatable->fieldList['title']['fixed'] = 'left'; $config->testcase->datatable->fieldList['title']['width'] = 'auto'; $config->testcase->datatable->fieldList['title']['required'] = 'yes'; +$config->testcase->datatable->fieldList['branch']['title'] = 'branch'; +$config->testcase->datatable->fieldList['branch']['fixed'] = 'left'; +$config->testcase->datatable->fieldList['branch']['width'] = '100'; +$config->testcase->datatable->fieldList['branch']['required'] = 'no'; + $config->testcase->datatable->fieldList['type']['title'] = 'type'; $config->testcase->datatable->fieldList['type']['fixed'] = 'no'; -$config->testcase->datatable->fieldList['type']['width'] = '90'; +$config->testcase->datatable->fieldList['type']['width'] = '80'; $config->testcase->datatable->fieldList['type']['required'] = 'no'; $config->testcase->datatable->fieldList['stage']['title'] = 'stage'; @@ -101,11 +106,6 @@ $config->testcase->datatable->fieldList['stage']['fixed'] = 'no'; $config->testcase->datatable->fieldList['stage']['width'] = '110'; $config->testcase->datatable->fieldList['stage']['required'] = 'no'; -$config->testcase->datatable->fieldList['status']['title'] = 'statusAB'; -$config->testcase->datatable->fieldList['status']['fixed'] = 'no'; -$config->testcase->datatable->fieldList['status']['width'] = '80'; -$config->testcase->datatable->fieldList['status']['required'] = 'no'; - $config->testcase->datatable->fieldList['precondition']['title'] = 'precondition'; $config->testcase->datatable->fieldList['precondition']['fixed'] = 'no'; $config->testcase->datatable->fieldList['precondition']['width'] = '120'; @@ -116,6 +116,11 @@ $config->testcase->datatable->fieldList['keywords']['fixed'] = 'no'; $config->testcase->datatable->fieldList['keywords']['width'] = '100'; $config->testcase->datatable->fieldList['keywords']['required'] = 'no'; +$config->testcase->datatable->fieldList['assignedTo']['title'] = 'assignedTo'; +$config->testcase->datatable->fieldList['assignedTo']['fixed'] = 'no'; +$config->testcase->datatable->fieldList['assignedTo']['width'] = '80'; +$config->testcase->datatable->fieldList['assignedTo']['required'] = 'no'; + $config->testcase->datatable->fieldList['openedBy']['title'] = 'openedByAB'; $config->testcase->datatable->fieldList['openedBy']['fixed'] = 'no'; $config->testcase->datatable->fieldList['openedBy']['width'] = '80'; @@ -143,7 +148,7 @@ $config->testcase->datatable->fieldList['lastRunner']['required'] = 'no'; $config->testcase->datatable->fieldList['lastRunDate']['title'] = 'lastRunDate'; $config->testcase->datatable->fieldList['lastRunDate']['fixed'] = 'no'; -$config->testcase->datatable->fieldList['lastRunDate']['width'] = '90'; +$config->testcase->datatable->fieldList['lastRunDate']['width'] = '120'; $config->testcase->datatable->fieldList['lastRunDate']['required'] = 'no'; $config->testcase->datatable->fieldList['lastRunResult']['title'] = 'lastRunResult'; @@ -151,6 +156,11 @@ $config->testcase->datatable->fieldList['lastRunResult']['fixed'] = 'no'; $config->testcase->datatable->fieldList['lastRunResult']['width'] = '80'; $config->testcase->datatable->fieldList['lastRunResult']['required'] = 'no'; +$config->testcase->datatable->fieldList['status']['title'] = 'statusAB'; +$config->testcase->datatable->fieldList['status']['fixed'] = 'no'; +$config->testcase->datatable->fieldList['status']['width'] = '100'; +$config->testcase->datatable->fieldList['status']['required'] = 'no'; + $config->testcase->datatable->fieldList['lastEditedBy']['title'] = 'lastEditedBy'; $config->testcase->datatable->fieldList['lastEditedBy']['fixed'] = 'no'; $config->testcase->datatable->fieldList['lastEditedBy']['width'] = '80'; @@ -171,31 +181,29 @@ $config->testcase->datatable->fieldList['story']['fixed'] = 'no'; $config->testcase->datatable->fieldList['story']['width'] = '90'; $config->testcase->datatable->fieldList['story']['required'] = 'no'; +$config->testcase->datatable->fieldList['bugs']['title'] = 'B'; +$config->testcase->datatable->fieldList['bugs']['fixed'] = 'no'; +$config->testcase->datatable->fieldList['bugs']['width'] = '30'; +$config->testcase->datatable->fieldList['bugs']['required'] = 'no'; +$config->testcase->datatable->fieldList['bugs']['sort'] = 'no'; +$config->testcase->datatable->fieldList['bugs']['name'] = $lang->testcase->bugs; + +$config->testcase->datatable->fieldList['results']['title'] = 'R'; +$config->testcase->datatable->fieldList['results']['fixed'] = 'no'; +$config->testcase->datatable->fieldList['results']['width'] = '30'; +$config->testcase->datatable->fieldList['results']['required'] = 'no'; +$config->testcase->datatable->fieldList['results']['sort'] = 'no'; +$config->testcase->datatable->fieldList['results']['name'] = $lang->testcase->results; + +$config->testcase->datatable->fieldList['stepNumber']['title'] = 'S'; +$config->testcase->datatable->fieldList['stepNumber']['fixed'] = 'no'; +$config->testcase->datatable->fieldList['stepNumber']['width'] = '30'; +$config->testcase->datatable->fieldList['stepNumber']['required'] = 'no'; +$config->testcase->datatable->fieldList['stepNumber']['sort'] = 'no'; +$config->testcase->datatable->fieldList['stepNumber']['name'] = $lang->testcase->stepNumber; + $config->testcase->datatable->fieldList['actions']['title'] = 'actions'; $config->testcase->datatable->fieldList['actions']['fixed'] = 'right'; $config->testcase->datatable->fieldList['actions']['width'] = '140'; $config->testcase->datatable->fieldList['actions']['required'] = 'yes'; $config->testcase->datatable->fieldList['actions']['sort'] = 'no'; - -$config->testcase->datatable->fieldList['branch']['title'] = 'branch'; -$config->testcase->datatable->fieldList['branch']['fixed'] = 'left'; -$config->testcase->datatable->fieldList['branch']['width'] = '100'; -$config->testcase->datatable->fieldList['branch']['required'] = 'no'; - -$config->testcase->datatable->fieldList['bugs']['title'] = 'bugs'; -$config->testcase->datatable->fieldList['bugs']['fixed'] = 'no'; -$config->testcase->datatable->fieldList['bugs']['width'] = '80'; -$config->testcase->datatable->fieldList['bugs']['required'] = 'no'; -$config->testcase->datatable->fieldList['bugs']['sort'] = 'no'; - -$config->testcase->datatable->fieldList['results']['title'] = 'results'; -$config->testcase->datatable->fieldList['results']['fixed'] = 'no'; -$config->testcase->datatable->fieldList['results']['width'] = '80'; -$config->testcase->datatable->fieldList['results']['required'] = 'no'; -$config->testcase->datatable->fieldList['results']['sort'] = 'no'; - -$config->testcase->datatable->fieldList['stepNumber']['title'] = 'stepNumber'; -$config->testcase->datatable->fieldList['stepNumber']['fixed'] = 'no'; -$config->testcase->datatable->fieldList['stepNumber']['width'] = '80'; -$config->testcase->datatable->fieldList['stepNumber']['required'] = 'no'; -$config->testcase->datatable->fieldList['stepNumber']['sort'] = 'no'; diff --git a/module/testcase/control.php b/module/testcase/control.php index bcbadf5123..c6ad633bcb 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -503,6 +503,7 @@ class testcase extends control $caseFails = $this->dao->select('COUNT(*) AS count')->from(TABLE_TESTRESULT)->where('caseResult')->eq('fail')->andwhere('`case`')->eq($caseID) ->beginIF($from == 'testtask')->andwhere('`run`')->eq($taskID)->fi() ->fetch('count'); + $case->caseFails = $caseFails; $this->view->position[] = $this->lang->testcase->common; $this->view->position[] = $this->lang->testcase->view; diff --git a/module/testcase/ext/config/.gitkeep b/module/testcase/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/testcase/ext/control/.gitkeep b/module/testcase/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/testcase/ext/css/.gitkeep b/module/testcase/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/testcase/ext/js/.gitkeep b/module/testcase/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/testcase/ext/lang/en/.gitkeep b/module/testcase/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/testcase/ext/lang/zh-cn/.gitkeep b/module/testcase/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/testcase/ext/lang/zh-tw/.gitkeep b/module/testcase/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/testcase/ext/model/.gitkeep b/module/testcase/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/testcase/ext/view/.gitkeep b/module/testcase/ext/view/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/testcase/model.php b/module/testcase/model.php index d8970b9ff6..1d01119a47 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -1232,8 +1232,9 @@ class testcaseModel extends model * @access public * @return void */ - public function printCell($col, $case, $users, $branches, $modulePairs = array(), $browseType = '') + public function printCell($col, $case, $users, $branches, $modulePairs = array(), $browseType = '', $mode = 'datatable') { + $canView = common::hasPriv('testcase', 'view'); $caseLink = helper::createLink('testcase', 'view', "caseID=$case->id&version=$case->version"); $account = $this->app->user->account; $id = $col->id; @@ -1241,14 +1242,16 @@ class testcaseModel extends model { $class = ''; if($id == 'status') $class .= $case->status; - if($id == 'title') $class .= ' text-left'; + if($id == 'title') $class .= ' text-left'; + if($id == 'id') $class .= ' cell-id'; if($id == 'lastRunResult') $class .= $case->lastRunResult; echo "
    "; - switch ($id) + switch($id) { case 'id': - echo html::a($caseLink, sprintf('%03d', $case->id)); + if($mode == 'table') echo " "; + echo $canView ? html::a($caseLink, sprintf('%03d', $case->id)) : sprintf('%03d', $case->id); break; case 'pri': echo ""; @@ -1258,7 +1261,7 @@ class testcaseModel extends model case 'title': if($case->branch) echo "{$branches[$case->branch]} "; if($modulePairs and $case->module) echo "{$modulePairs[$case->module]} "; - echo html::a($caseLink, $case->title, null, "style='color: $case->color'"); + echo $canView ? html::a($caseLink, $case->title, null, "style='color: $case->color'") : "$case->title"; break; case 'branch': echo $branches[$case->branch]; diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php index 003eaa50a9..7a2d74378d 100644 --- a/module/testcase/view/browse.html.php +++ b/module/testcase/view/browse.html.php @@ -43,14 +43,39 @@ js::set('branch', $branch); moduleName . ucfirst($this->methodName); $useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable'); - $file2Include = $useDatatable ? dirname(__FILE__) . '/datatabledata.html.php' : dirname(__FILE__) . '/browsedata.html.php'; $vars = "productID=$productID&branch=$branch&browseType=$browseType¶m=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; - include $file2Include; + + if($useDatatable) include '../../common/view/datatable.html.php'; + if(!$useDatatable) include '../../common/view/tablesorter.html.php'; + $setting = $this->datatable->getSetting('testcase'); + $widths = $this->datatable->setFixedFieldWidth($setting); + $columns = 0; ?> + ' id='caseList' data-checkable='true' data-fixed-left-width='' data-fixed-right-width='' data-custom-menu='true' data-checkbox-name='caseIDList[]'> + + + $value) + { + if($value->show) + { + $this->datatable->printHead($value, $orderBy, $vars); + $columns ++; + } + } + ?> + + + + + + $value) $this->testcase->printCell($value, $case, $users, $branches, $modulePairs, $browseType, $useDatatable ? 'datatable' : 'table');?> + + + - -
    +
    diff --git a/module/testcase/view/browsedata.html.php b/module/testcase/view/browsedata.html.php deleted file mode 100644 index 121fbd0548..0000000000 --- a/module/testcase/view/browsedata.html.php +++ /dev/null @@ -1,99 +0,0 @@ - - * @package testcase - * @version $Id$ - * @link http://www.zentao.net - */ -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id&version=$case->version");?> - - - - - - - - - - - - - - - - - - - - - - diff --git a/module/testcase/view/datatabledata.html.php b/module/testcase/view/datatabledata.html.php deleted file mode 100644 index 01713084e1..0000000000 --- a/module/testcase/view/datatabledata.html.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @package testcase - * @version $Id$ - * @link http://www.zentao.net - */ -?> -datatable->getSetting('testcase'); -$widths = $this->datatable->setFixedFieldWidth($setting); -extract($widths); -?> -
    idAB);?> priAB);?> testcase->title);?> testcase->story);?> actions;?> typeAB);?> openedByAB);?> testtask->lastRunAccount);?> testtask->lastRunTime);?> testtask->lastRunResult);?> statusAB);?> testcase->bugsAB;?> testcase->resultsAB;?> testcase->stepNumberAB;?> {sorter:false}'>actions;?>
    - - id));?> - testcase->priList, $case->pri, $case->pri)?>'>testcase->priList, $case->pri, $case->pri);?> - branch) echo "{$branches[$case->branch]} "?> - module) echo "{$modulePairs[$case->module]} "?> - title, null, "style='color: $case->color'");?> - createLink('story', 'view', "storyID=$case->story"), $case->storyTitle, '_blank');?>testcase->confirmStoryChange = $lang->confirm; common::printIcon('testcase', 'confirmStoryChange', "caseID=$case->id", '', 'list', '', 'hiddenwin');?>testcase->typeList[$case->type];?>openedBy];?>lastRunner];?>lastRunDate)) echo date(DT_MONTHTIME1, strtotime($case->lastRunDate));?>lastRunResult) echo $lang->testcase->resultList[$case->lastRunResult];?> - needconfirm) - { - echo "({$lang->story->changed} "; - echo html::a($this->createLink('testcase', 'confirmStoryChange', "caseID=$case->id"), $lang->confirm, 'hiddenwin'); - echo ")"; - } - else - { - echo $lang->testcase->statusList[$case->status]; - } - ?> - bugs) ? html::a(inlink('bugs', "runID=0&caseID={$case->id}"), $case->bugs, '', "class='iframe'") : $case->bugs;?>results) ? html::a($this->createLink('testtask', 'results', "runID=0&caseID={$case->id}"), $case->results, '', "class='iframe'") : $case->results;?>stepNumber;?> - id&version=$case->version", $case, 'list', 'play', '', 'runCase iframe', false, "data-width='95%'"); - common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", $case, 'list', 'list-alt', '', 'results iframe', false, "data-width='95%'"); - if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'review', '', 'iframe'); - common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list'); - common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'list', 'copy'); - - if(common::hasPriv('testcase', 'delete', $case)) - { - $deleteURL = $this->createLink('testcase', 'delete', "caseID=$case->id&confirm=yes"); - echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"caseList\",confirmDelete)", '', '', "title='{$lang->testcase->delete}' class='btn-icon'"); - } - - common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=", $case, 'list', 'bug', '', 'iframe',false,"data-width='95%'"); - ?> -
    - - $value) $this->datatable->printHead($value, $orderBy, $vars);?> - - - - - $value) $this->testcase->printCell($value, $case, $users, $branches, $modulePairs, $browseType);?> - - - diff --git a/module/testreport/model.php b/module/testreport/model.php index af9306e8df..b33faad021 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -186,7 +186,7 @@ class testreportModel extends model */ public function getBugInfo($tasks, $productIdList, $begin, $end, $builds) { - $bugsByTask = $this->dao->select('*')->from(TABLE_BUG)->where('testtask')->in(array_keys($tasks))->andWhere('testtask')->ne(0)->andWhere('deleted')->eq(0)->fetchAll('id'); + $bugsByTask = $this->dao->select('*')->from(TABLE_BUG)->where('testtask')->in(array_keys($tasks))->andWhere('testtask')->ne(0)->andWhere('`case`')->ne(0)->andWhere('deleted')->eq(0)->fetchAll('id'); $severityGroups = $statusGroups = $openedByGroups = $resolvedByGroups = $resolutionGroups = $moduleGroups = $typeGroups = array(); $resolvedBugs = 0; foreach($bugsByTask as $bug) diff --git a/module/testtask/config.php b/module/testtask/config.php index e56adeac74..130f031c8d 100644 --- a/module/testtask/config.php +++ b/module/testtask/config.php @@ -15,4 +15,4 @@ $config->testtask->editor->block = array('id' => 'comment', 'tools' => 'simple $config->testtask->editor->activate= array('id' => 'comment', 'tools' => 'simpleTools'); $config->testtask->datatable = new stdclass(); -$config->testtask->datatable->defaultField = array('id', 'pri', 'title', 'type', 'assignedTo', 'lastRunner', 'lastRunDate', 'lastRunResult', 'status', 'bugs', 'results', 'actions'); +$config->testtask->datatable->defaultField = array('id', 'pri', 'title', 'type', 'assignedTo', 'lastRunner', 'lastRunDate', 'lastRunResult', 'status', 'bugs', 'results', 'stepNumber','actions'); diff --git a/module/testtask/ext/config/.gitkeep b/module/testtask/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/testtask/ext/control/.gitkeep b/module/testtask/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/testtask/ext/css/.gitkeep b/module/testtask/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/testtask/ext/js/.gitkeep b/module/testtask/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/testtask/ext/lang/en/.gitkeep b/module/testtask/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/testtask/ext/lang/zh-cn/.gitkeep b/module/testtask/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/testtask/ext/lang/zh-tw/.gitkeep b/module/testtask/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/testtask/ext/model/.gitkeep b/module/testtask/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/testtask/ext/view/.gitkeep b/module/testtask/ext/view/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/testtask/model.php b/module/testtask/model.php index 200ec43d55..ad83c3fc21 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1118,8 +1118,9 @@ class testtaskModel extends model * @access public * @return void */ - public function printCell($col, $run, $users, $task, $branches) + public function printCell($col, $run, $users, $task, $branches, $mode = 'datatable') { + $canView = common::hasPriv('testcase', 'view'); $caseLink = helper::createLink('testcase', 'view', "caseID=$run->case&version=$run->version&from=testtask&taskID=$run->task"); $account = $this->app->user->account; $id = $col->id; @@ -1127,7 +1128,8 @@ class testtaskModel extends model { $class = ''; if($id == 'status') $class .= $run->status; - if($id == 'title') $class .= ' text-left'; + if($id == 'title') $class .= ' text-left'; + if($id == 'id') $class .= ' cell-id'; if($id == 'lastRunResult') $class .= " $run->lastRunResult"; if($id == 'assignedTo' && $run->assignedTo == $account) $class .= ' red'; @@ -1135,7 +1137,8 @@ class testtaskModel extends model switch ($id) { case 'id': - echo html::a($caseLink, sprintf('%03d', $run->case)); + if($mode == 'table') echo " "; + echo $canView ? html::a($caseLink, sprintf('%03d', $run->case)) : sprintf('%03d', $run->case); break; case 'pri': echo ""; @@ -1144,7 +1147,7 @@ class testtaskModel extends model break; case 'title': if($run->branch) echo "{$branches[$run->branch]}"; - echo html::a($caseLink, $run->title); + echo $canView ? html::a($caseLink, $run->title) : $run->title; break; case 'branch': echo $branches[$run->branch]; diff --git a/module/testtask/view/cases.html.php b/module/testtask/view/cases.html.php index 997fee9970..e80785bfb0 100644 --- a/module/testtask/view/cases.html.php +++ b/module/testtask/view/cases.html.php @@ -37,17 +37,47 @@ var moduleID = ''; $vars = "taskID=$task->id&browseType=$browseType¶m=$param&orderBy=%s&recToal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; $datatableId = $this->moduleName . ucfirst($this->methodName); $useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable'); - $file2Include = $useDatatable ? dirname(__FILE__) . '/datatabledata.html.php' : dirname(__FILE__) . '/casesdata.html.php'; $canBatchEdit = common::hasPriv('testcase', 'batchEdit'); $canBatchAssign = common::hasPriv('testtask', 'batchAssign'); $canBatchRun = common::hasPriv('testtask', 'batchRun'); $hasCheckbox = ($canBatchEdit or $canBatchAssign or $canBatchRun); - include $file2Include; + + if($useDatatable) include '../../common/view/datatable.html.php'; + if(!$useDatatable) include '../../common/view/tablesorter.html.php'; + + $this->config->testcase->datatable->defaultField = $this->config->testtask->datatable->defaultField; + $this->config->testcase->datatable->fieldList['actions']['width'] = '100'; + + $setting = $this->datatable->getSetting('testtask'); + $widths = $this->datatable->setFixedFieldWidth($setting); + $columns = 0; ?> +
    ' id='caseList' data-checkable='' data-fixed-left-width='' data-fixed-right-width='' data-custom-menu='true' data-checkbox-name='caseIDList[]'> + + + $value) + { + if($value->show) + { + $this->datatable->printHead($value, $orderBy, $vars); + $columns ++; + } + } + ?> + + + + + + $value) $this->testtask->printCell($value, $run, $users, $task, $branches, $useDatatable ? 'datatable' : 'table');?> + + + -
    +
    diff --git a/module/testtask/view/casesdata.html.php b/module/testtask/view/casesdata.html.php deleted file mode 100644 index a172a05b70..0000000000 --- a/module/testtask/view/casesdata.html.php +++ /dev/null @@ -1,79 +0,0 @@ - - * @package testtask - * @version $Id$ - * @link http://www.zentao.net - */ -?> - - id&browseType=$browseType¶m=$param&orderBy=%s&recToal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/module/testtask/view/datatabledata.html.php b/module/testtask/view/datatabledata.html.php deleted file mode 100644 index f4264a1116..0000000000 --- a/module/testtask/view/datatabledata.html.php +++ /dev/null @@ -1,36 +0,0 @@ - - * @package testtask - * @version $Id$ - * @link http://www.zentao.net - */ -?> -config->testcase->datatable->defaultField = $this->config->testtask->datatable->defaultField; -$this->config->testcase->datatable->fieldList['assignedTo']['title'] = 'assignedTo'; -$this->config->testcase->datatable->fieldList['assignedTo']['fixed'] = 'no'; -$this->config->testcase->datatable->fieldList['assignedTo']['width'] = '80'; -$this->config->testcase->datatable->fieldList['assignedTo']['required'] = 'no'; -$this->config->testcase->datatable->fieldList['actions']['width'] = '100'; - -$setting = $this->datatable->getSetting('testtask'); -$widths = $this->datatable->setFixedFieldWidth($setting); -extract($widths); -?> -
    idAB);?> priAB);?> testcase->title);?> testcase->type);?> testtask->assignedTo);?> testtask->lastRunAccount);?> testtask->lastRunTime);?> testtask->lastRunResult);?> statusAB);?> testcase->bugsAB;?> testcase->resultsAB;?> testcase->stepNumberAB;?>actions;?>
    - - - - case);?> - testcase->priList, $run->pri, $run->pri)?>'>testcase->priList, $run->pri, $run->pri)?> - branch) echo "{$branches[$run->branch]}"?> - createLink('testcase', 'view', "caseID=$run->case&version=$run->version&from=testtask&taskID=$run->task"), $run->title);?> - testcase->typeList[$run->type];?>assignedTo]; echo substr($assignedTo, strpos($assignedTo, ':') + 1);?>lastRunner]; echo substr($lastRunner, strpos($lastRunner, ':') + 1);?>lastRunDate)) echo date(DT_MONTHTIME1, strtotime($run->lastRunDate));?>lastRunResult) echo $lang->testcase->resultList[$run->lastRunResult];?>version < $run->caseVersion) ? "{$lang->testcase->changed}" : $lang->testtask->statusList[$run->status];?>bugs) ? html::a($this->createLink('testcase', 'bugs', "runID={$run->id}&caseID={$run->case}"), $run->bugs, '', "class='iframe'") : $run->bugs;?>results) ? html::a($this->createLink('testtask', 'results', "runID={$run->id}&caseID={$run->case}"), $run->results, '', "class='iframe'") : $run->results;?>stepNumber;?> - id", $run, 'list', '', '', 'runCase iframe', false, "data-width='95%'"); - common::printIcon('testtask', 'results', "id=$run->id", $run, 'list', '', '', 'iframe', '', "data-width='90%'"); - - if(common::hasPriv('testtask', 'unlinkCase', $run)) - { - $unlinkURL = $this->createLink('testtask', 'unlinkCase', "caseID=$run->id&confirm=yes"); - echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"caseList\",confirmUnlink)", '', '', "title='{$lang->testtask->unlinkCase}' class='btn-icon'"); - } - - common::printIcon('testcase', 'createBug', "product=$productID&branch=$task->branch&extra=projectID=$task->project,buildID=$task->build,caseID=$run->case,version=$run->version,runID=$run->id,testtask=$taskID", $run, 'list', 'bug', '', 'iframe', '', "data-width='90%'"); - ?> -
    - - $value) $this->datatable->printHead($value, $orderBy, $vars);?> - - - - - $value) $this->testtask->printCell($value, $run, $users, $task, $branches);?> - - - diff --git a/module/todo/ext/config/.gitkeep b/module/todo/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/todo/ext/control/.gitkeep b/module/todo/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/todo/ext/css/.gitkeep b/module/todo/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/todo/ext/js/.gitkeep b/module/todo/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/todo/ext/lang/en/.gitkeep b/module/todo/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/todo/ext/lang/zh-cn/.gitkeep b/module/todo/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/todo/ext/lang/zh-tw/.gitkeep b/module/todo/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/todo/ext/model/.gitkeep b/module/todo/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/todo/ext/view/.gitkeep b/module/todo/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/tree/ext/config/.gitkeep b/module/tree/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/tree/ext/control/.gitkeep b/module/tree/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/tree/ext/css/.gitkeep b/module/tree/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/tree/ext/js/.gitkeep b/module/tree/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/tree/ext/lang/en/.gitkeep b/module/tree/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/tree/ext/lang/zh-cn/.gitkeep b/module/tree/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/tree/ext/lang/zh-tw/.gitkeep b/module/tree/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/tree/ext/model/.gitkeep b/module/tree/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/tree/ext/view/.gitkeep b/module/tree/ext/view/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/tree/model.php b/module/tree/model.php index 4de81d4574..669cf08aca 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -1135,7 +1135,11 @@ class treeModel extends model $branchs = $this->dao->select('id, name')->from(TABLE_BRANCH)->where('id')->in($branchIDList)->andWhere('deleted')->eq(0)->fetchALL('id'); foreach($modules as $module) { - if(isset($modulePairs[$module->id])) $modulePairs[$module->id] = '/' . $branchs[$module->branch]->name . $modulePairs[$module->id]; + if(isset($modulePairs[$module->id])) + { + $branchName = isset($branchs[$module->branch]) ? '/' . $branchs[$module->branch]->name : ''; + $modulePairs[$module->id] = $branchName . $modulePairs[$module->id]; + } } return $modulePairs; diff --git a/module/upgrade/ext/config/.gitkeep b/module/upgrade/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/upgrade/ext/control/.gitkeep b/module/upgrade/ext/control/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/upgrade/ext/css/.gitkeep b/module/upgrade/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/upgrade/ext/js/.gitkeep b/module/upgrade/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/upgrade/ext/lang/en/.gitkeep b/module/upgrade/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/upgrade/ext/lang/zh-cn/.gitkeep b/module/upgrade/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/upgrade/ext/lang/zh-tw/.gitkeep b/module/upgrade/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/upgrade/ext/model/.gitkeep b/module/upgrade/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/upgrade/ext/view/.gitkeep b/module/upgrade/ext/view/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/user/ext/config/.gitkeep b/module/user/ext/config/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/user/ext/control/.gitkeep b/module/user/ext/control/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/module/user/ext/css/.gitkeep b/module/user/ext/css/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/user/ext/js/.gitkeep b/module/user/ext/js/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/user/ext/lang/en/.gitkeep b/module/user/ext/lang/en/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/user/ext/lang/zh-cn/.gitkeep b/module/user/ext/lang/zh-cn/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/user/ext/lang/zh-tw/.gitkeep b/module/user/ext/lang/zh-tw/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/user/ext/model/.gitkeep b/module/user/ext/model/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/module/user/ext/view/.gitkeep b/module/user/ext/view/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/tmp/cache/.gitkeep b/tmp/cache/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/tmp/extension/.gitkeep b/tmp/extension/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/tmp/log/.gitkeep b/tmp/log/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/tmp/model/.gitkeep b/tmp/model/.gitkeep deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/tools/check.php b/tools/check.php deleted file mode 100755 index 419e1eb2cc..0000000000 --- a/tools/check.php +++ /dev/null @@ -1,259 +0,0 @@ -global = new stdclass(); -$config->global->flow = 'full'; - -/* set module root path and included the resource of group module. */ -$moduleRoot = '../module/'; -include $moduleRoot . '/group/lang/resource.php'; -foreach(glob($moduleRoot . '/group/ext/lang/zh-cn/*.php') as $resourceFile) -{ - include $resourceFile; -} - -$lang->productCommon = ''; -$lang->projectCommon = ''; - -$whiteList[] = 'api-getsessionid'; -$whiteList[] = 'admin-setflow'; -$whiteList[] = 'bug-buildtemplates'; -$whiteList[] = 'bug-sendmail'; -$whiteList[] = 'board-managechild'; -$whiteList[] = 'custom-menu'; -$whiteList[] = 'company-create'; -$whiteList[] = 'company-delete'; -$whiteList[] = 'file-buildexporttpl'; -$whiteList[] = 'file-buildform'; -$whiteList[] = 'file-printfiles'; -$whiteList[] = 'file-export2csv'; -$whiteList[] = 'file-export2xml'; -$whiteList[] = 'file-export2html'; -$whiteList[] = 'file-export2excel'; -$whiteList[] = 'file-export2word'; -$whiteList[] = 'file-senddownheader'; -$whiteList[] = 'file-read'; -$whiteList[] = 'help-field'; -$whiteList[] = 'index-testext'; -$whiteList[] = 'productplan-commonaction'; -$whiteList[] = 'project-managechilds'; -$whiteList[] = 'project-tips'; -$whiteList[] = 'project-commonaction'; -$whiteList[] = 'project-sendmail'; -$whiteList[] = 'release-commonaction'; -$whiteList[] = 'task-commonaction'; -$whiteList[] = 'task-sendmail'; -$whiteList[] = 'testtask-sendmail'; -$whiteList[] = 'user-login'; -$whiteList[] = 'user-deny'; -$whiteList[] = 'user-logout'; -$whiteList[] = 'user-setreferer'; -$whiteList[] = 'svn-run'; -$whiteList[] = 'git-run'; -$whiteList[] = 'admin-ignore'; -$whiteList[] = 'admin-register'; -$whiteList[] = 'admin-win2unix'; -$whiteList[] = 'admin-bind'; -$whiteList[] = 'admin-certifyztemail'; -$whiteList[] = 'admin-certifyztmobile'; -$whiteList[] = 'admin-ztcompany'; -$whiteList[] = 'story-commonaction'; -$whiteList[] = 'story-sendmail'; -$whiteList[] = 'webapp-ajaxaddview'; -$whiteList[] = 'report-remind'; -$whiteList[] = 'sso-auth'; -$whiteList[] = 'sso-depts'; -$whiteList[] = 'sso-users'; -$whiteList[] = 'sso-login'; -$whiteList[] = 'sso-logout'; -$whiteList[] = 'sso-bind'; -$whiteList[] = 'sso-getuserpairs'; -$whiteList[] = 'sso-getbindusers'; -$whiteList[] = 'sso-binduser'; -$whiteList[] = 'sso-createuser'; -$whiteList[] = 'sso-gettodolist'; -$whiteList[] = 'mail-asyncsend'; -$whiteList[] = 'user-reset'; -$whiteList[] = 'product-showerrornone'; -$whiteList[] = 'tutorial-start'; -$whiteList[] = 'tutorial-index'; -$whiteList[] = 'tutorial-quit'; -$whiteList[] = 'tutorial-wizard'; -$whiteList[] = 'my-buildcontactlists'; -$whiteList[] = 'mail-ztcloud'; -$whiteList[] = 'doc-diff'; -$whiteList[] = 'testreport-commonaction'; -$whiteList[] = 'testsuite-library'; -$whiteList[] = 'testsuite-createlib'; -$whiteList[] = 'testsuite-createcase'; -$whiteList[] = 'testsuite-libview'; - - -/* checking actions of every module. */ -echo '-------------action checking-----------------' . "\n"; -foreach(glob($moduleRoot . '*') as $modulePath) -{ - $moduleName = basename($modulePath); - if(strpos('install|upgrade|convert|common|misc|editor', $moduleName) !== false) continue; - $controlFile = $modulePath . '/control.php'; - if(file_exists($controlFile)) - { - include $controlFile; - if(class_exists($moduleName)) - { - if($moduleName == 'block') continue; - $class = new ReflectionClass($moduleName); - $methods = $class->getMethods(); - foreach($methods as $method) - { - $methodRef = new ReflectionMethod($method->class, $method->name); - if($methodRef->isPublic() and strpos($method->name, '__') === false) - { - $methodName = $method->name; - if(in_array($moduleName . '-' . strtolower($method->name), $whiteList)) continue; - if(strpos($methodName, 'ajax') !== false) continue; - - $exits = false; - if(isset($lang->resource->$moduleName)) - { - foreach($lang->resource->$moduleName as $key => $label) - { - if(strtolower($methodName) == strtolower($key)) $exits = true; - } - } - if(!$exits) echo $moduleName . "\t" . $methodName . " not in the list. \n"; - } - } - } - } - - /* Checking extension files. */ - $extControlFiles = glob($modulePath . '/ext/control/*.php'); - if($extControlFiles) - { - foreach($extControlFiles as $extControlFile) - { - $methodFile = substr($extControlFile, strrpos($extControlFile, '/') + 1); - $methodName = substr($methodFile, 0, strpos($methodFile, '.')); - if(in_array($moduleName . '-' . strtolower($methodName), $whiteList)) continue; - if(strpos($methodName, 'ajax') !== false) continue; - - $exits = false; - foreach($lang->resource->$moduleName as $key => $label) - { - if(strtolower($methodName) == strtolower($key)) $exits = true; - } - if(!$exits) echo $moduleName . "\t" . $methodName . " not in the list. \n"; - } - } -} - -/* checking actions of every module. */ -echo '-------------lang checking-----------------' . "\n"; -include '../module/common/lang/zh-cn.php'; -include '../config/config.php'; -foreach(glob($moduleRoot . '*') as $modulePath) -{ - unset($lang); - $moduleName = basename($modulePath); - $mainLangFile = $modulePath . '/lang/zh-cn.php'; - if(!file_exists($mainLangFile)) continue; - $mainLines = file($mainLangFile); - - foreach($config->langs as $langKey => $langName) - { - if($langKey == 'zh-cn' or $langKey == 'zh-tw') continue; - $langFile = $modulePath . '/lang/' . $langKey . '.php'; - if(!file_exists($langFile)) continue; - $lines = file($langFile); - foreach($mainLines as $lineNO => $line) - { - if(strpos($line, '$lang') === false) - { - //if($line != $lines[$lineNO]) echo $moduleName . ' ' . $langKey . ' ' . $lineNO . "\n"; - } - else - { - if(strpos($line, '=') !== false) - { - list($mainKey, $mainValue) = explode('=', $line); - list($key, $value) = explode('=', $lines[$lineNO]); - } - if((strpos($line, '=') === false and $line != $lines[$lineNO]) or trim($mainKey) != trim($key)) - { - $key = trim($key); - $lineNO = $lineNO + 1; - echo "module $moduleName need checking, command is:"; - echo " vim -O +$lineNO ../module/$moduleName/lang/zh-cn.php +$lineNO ../module/$moduleName/lang/en.php \n"; - break; - } - } - } - } - - foreach(glob($modulePath . '/ext/lang/zh-cn/*.php') as $extMainLangFile) - { - $extMainLines = file($extMainLangFile); - $extLangFile = basename($extMainLangFile); - $extEnFile = $modulePath . '/ext/lang/en/' . $extLangFile; - $extLines = file($extEnFile); - foreach($extMainLines as $lineNO => $line) - { - if(strpos($line, '$lang') === false) - { - //if($line != $lines[$lineNO]) echo $moduleName . ' ' . $langKey . ' ' . $lineNO . "\n"; - } - else - { - list($mainKey, $mainValue) = explode('=', $line); - list($key, $value) = explode('=', $extLines[$lineNO]); - if(trim($mainKey) != trim($key)) - { - $key = trim($key); - $lineNO = $lineNO + 1; - echo "module $moduleName need checking, command is:"; - echo " vim -O +$lineNO ../../module/$moduleName/ext/lang/zh-cn/$extLangFile +$lineNO ../../module/$moduleName/ext/lang/en/$extLangFile \n"; - break; - } - } - } - } -} - -echo '-------------php5.4 synatax checking-----------------' . "\n"; -class app {function loadLang() {}} -$app = new app; -$lang = new stdclass(); - -error_reporting(E_WARNING | E_STRICT ); -foreach(glob($moduleRoot . '*') as $modulePath) -{ - $moduleName = basename($modulePath); - $cnLangFile = $modulePath . '/lang/zh-cn.php'; - $enLangFile = $modulePath . '/lang/en.php'; - $configFile = $modulePath . '/config.php'; - - if(!isset($lang->$moduleName)) $lang->$moduleName = new stdclass(); - if(!isset($config->$moduleName)) $config->$moduleName = new stdclass(); - if(file_exists($cnLangFile)) include $cnLangFile; - if(file_exists($enLangFile)) include $enLangFile; - if(file_exists($configFile)) include $configFile; -} - -echo '-------------demo data checking. -----------------' . "\n"; -$demoSQL = file("../db/demo.sql"); -foreach($demoSQL as $line => $sql) -{ - if(strpos($sql, 'INSERT') === false) continue; - - if(strpos($sql, $config->db->prefix . 'config') !== false or - strpos($sql, $config->db->prefix . 'company') !== false or - strpos($sql, $config->db->prefix . 'group') !== false) - { - die('line ' . ($line + 1) . " has error\n"); - } -} diff --git a/tools/cn2tw.php b/tools/cn2tw.php deleted file mode 100755 index 8af43a45b4..0000000000 --- a/tools/cn2tw.php +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env php - $targetLangFile"); - $defaultLang = file_get_contents($targetLangFile); - $targetLang = str_replace('zh-cn', $langDesc, $defaultLang); - file_put_contents($targetLangFile, $targetLang); -} -?> diff --git a/tools/copylang.php b/tools/copylang.php deleted file mode 100755 index 8f7d1a34ce..0000000000 --- a/tools/copylang.php +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env php - diff --git a/tools/exportactions.php b/tools/exportactions.php deleted file mode 100755 index 3bf58bdd0b..0000000000 --- a/tools/exportactions.php +++ /dev/null @@ -1,29 +0,0 @@ -getMethods(); - foreach($methods as $method) - { - $methodRef = new ReflectionMethod($method->class, $method->name); - if($methodRef->isPublic() and strpos($method->name, '__') === false) - { - echo "\$lang['action']['$moduleName']['$method->name'] = '$method->name';\n"; - } - } - echo "\n"; - } - } -} -?> diff --git a/tools/getallcommon.php b/tools/getallcommon.php deleted file mode 100755 index 6bea6b1765..0000000000 --- a/tools/getallcommon.php +++ /dev/null @@ -1,28 +0,0 @@ - $maxLength) $maxLength = strlen($moduleName); -} - -foreach($modules as $modulePath) -{ - $moduleName = basename($modulePath); - if($moduleName == 'help' or $moduleName == 'editor') continue; - $langFile = $modulePath . "/lang/$langType.php"; - if(!file_exists($langFile)) continue; - include $langFile; - - $moduleTitle = ''; - if(isset($lang->$moduleName->common)) - { - $moduleTitle = $lang->$moduleName->common; - } - - echo "\$lang->editor->modules['$moduleName'] " . str_pad('', $maxLength - strlen($moduleName)) . "= '$moduleTitle';\n"; - -} diff --git a/tools/initext.php b/tools/initext.php deleted file mode 100755 index be9f06a725..0000000000 --- a/tools/initext.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @package common - * @version $Id$ - * @link http://www.zentao.net - */ -include '../config/config.php'; - -$modules = array(); -$moduleRoot = realpath('../module/') . '/'; - -if(is_dir($moduleRoot)) -{ - if($dh = opendir($moduleRoot)) - { - while($module = readdir($dh)) - { - if(strpos(basename($module), '.') === false) $modules[] = $module; - } - closedir($dh); - } -} -else -{ - die("The module you input does not exist. \n"); -} - -foreach($modules as $module) -{ - /* 设定各个目录。*/ - $extRoot = $moduleRoot . DIRECTORY_SEPARATOR. $module . DIRECTORY_SEPARATOR . 'ext'; - $extControl = $extRoot . DIRECTORY_SEPARATOR . 'control'; - $extModel = $extRoot . DIRECTORY_SEPARATOR . 'model'; - $extView = $extRoot . DIRECTORY_SEPARATOR . 'view'; - $extCSS = $extRoot . DIRECTORY_SEPARATOR . 'css'; - $extJS = $extRoot . DIRECTORY_SEPARATOR . 'js'; - $extConfig = $extRoot . DIRECTORY_SEPARATOR . 'config'; - $extLang = $extRoot . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR; - - /* 建立各个扩展目录 */ - if(!file_exists($extRoot)) mkdir($extRoot, 0777); - if(!file_exists($extControl)) mkdir($extControl, 0777); - if(!file_exists($extModel)) mkdir($extModel, 0777); - if(!file_exists($extView)) mkdir($extView, 0777); - if(!file_exists($extCSS)) mkdir($extCSS, 0777); - if(!file_exists($extJS)) mkdir($extJS, 0777); - if(!file_exists($extConfig)) mkdir($extConfig, 0777); - if(!file_exists($extLang)) mkdir($extLang, 0777); - - /* Touch .gitkeep file. */ - touch($extControl . '/.gitkeep'); - touch($extModel . '/.gitkeep'); - touch($extView . '/.gitkeep'); - touch($extCSS . '/.gitkeep'); - touch($extJS . '/.gitkeep'); - touch($extConfig . '/.gitkeep'); - - /* 创建语言目录。*/ - $langs = array_keys($config->langs); - foreach($langs as $lang) - { - $langPath = $extLang . $lang; - if(!file_exists($langPath)) mkdir($langPath, 0777); - touch($langPath . '/.gitkeep'); - } - - echo "init $module ... \n"; -} diff --git a/tools/minifyfront.php b/tools/minifyfront.php deleted file mode 100755 index d8eaa75ead..0000000000 --- a/tools/minifyfront.php +++ /dev/null @@ -1,74 +0,0 @@ -productCommon = ''; -$lang->projectCommon = ''; -include $baseDir . '/module/common/lang/zh-cn.php'; -$langs = array_keys($config->langs); -$themes = array_keys($lang->themes); - -/* Create css files for every them and every lang. */ -$zuiCode = str_replace('../fonts', '../zui/fonts', file_get_contents($themeRoot . 'zui/css/min.css')); -foreach($langs as $lang) -{ - foreach($themes as $theme) - { - /* Common css files. */ - $cssCode = $zuiCode; - $cssCode .= file_get_contents($themeRoot . 'default/style.css'); - $cssCode .= file_get_contents($jqueryRoot . 'chosen/min.css'); - $cssCode .= file_get_contents($themeRoot . 'default/treeview.css'); - $cssCode .= file_get_contents($jqueryRoot . 'datetimepicker/min.css'); - - /* Css file for current lang and current them. */ - $cssCode .= file_get_contents($themeRoot . "lang/$lang.css"); - if($theme != 'default') - { - $themCode = file_get_contents($themeRoot . $theme . '/style.css'); - $cssCode .= str_replace('./images', "../$theme/images", $themCode); - } - - /* Combine them. */ - $cssFile = $themeRoot . "default/$lang.$theme.css"; - file_put_contents($cssFile, $cssCode); - - /* Compress it. */ - `java -jar ~/bin/yuicompressor/build/yuicompressor.jar --type css $cssFile -o $cssFile`; - } -} diff --git a/tools/preparetest.php b/tools/preparetest.php deleted file mode 100755 index bce62e92d7..0000000000 --- a/tools/preparetest.php +++ /dev/null @@ -1,60 +0,0 @@ - $database.sql;\n"; - $cmd .= "mysql -uroot $backupDatabase < $database.sql;\n"; - $cmd .= "rm -fr $database.sql"; - system($cmd); - } -} - -/* Restore stored backup databases. */ -function restore() -{ - global $databases; - foreach($databases as $database) - { - $backupDatabase = "back_$database"; - mysql_query("DROP DATABASE $database"); - mysql_query("CREATE DATABASE $database"); - $cmd = "mysqldump -u root $backupDatabase > $database.sql;\n"; - $cmd .= "mysql -uroot $database < $database.sql;\n"; - $cmd .= "rm -fr $database.sql"; - system($cmd); - } -} - -/* Connect to database. */ -function connectDB() -{ - global $config; - mysql_connect($config->db->host, $config->db->user, $config->db->password); -} diff --git a/tools/replace.sh b/tools/replace.sh deleted file mode 100755 index 8536f5eb8b..0000000000 --- a/tools/replace.sh +++ /dev/null @@ -1,17 +0,0 @@ -#replace title -foreachd(){ - for file in `ls $1` - do - if [ -d $1/$file ] - then - echo "into dir $1/$file" - foreachd $1/$file - elif [ -f $1/$file ] - then -# sed -i '1,11s/\@license.*$/\@license ZPL \(http:\/\/zpl\.pub\/page\/zplv11\.html\)/g' $1/$file - sed -i '1,11s/\@copyright.*$/\@copyright Copyright 2009-2015 青岛易软天创网络科技有限公司\(QingDao Nature Easy Soft Network Technology Co,LTD, www\.cnezsoft\.com\)/g' $1/$file - fi - done -} - -foreachd $1 diff --git a/tools/syncext.php b/tools/syncext.php deleted file mode 100755 index cad41b07ce..0000000000 --- a/tools/syncext.php +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env php - -# @author yidong wang -# - -# Judge the params, must give $src and $dest. -if [ $# -lt 2 ]; then - echo './syncext.sh src dest' - exit 1 -fi - -# Judge inotifywait tool exists or not. -which inotifywait > /dev/null -if [ $? -ne 0 ]; then - echo 'No inotifywait. Please install inotify-tools, for debian or ubuntun run apt-get install inotify-tools.'; - exit 1 -fi - -# Get $src and $dest. -src=$1/ -dest=$2/ - -# Rsync when the shell load first. -rsync -aqP --exclude="db/" $src $dest -echo `date "+%H:%M:%S"` sync $src to $dest succssfully. - -# Watch the $src directory, and sync files to destination. -inotifywait -mrq --event create,modify,delete,move --format '%w %e %f' $src |\ -while read watcher event file ; do - - # compute the $path2process. - path2process=$watcher$file - path2process=${path2process/$src/$dest} - - # Delete a file or a directory. - if [ "$event" == "DELETE" -o "$event" == "DELETE,ISDIR" ]; then - - # If delete a file, use rm -fr, directory, use rmdir for security. - if [ "$event" == "DELETE" ]; then - rm -fr $path2process - else - rmdir $path2process - fi - - echo `date "+%H:%M:%S"` $path2process deleted.; - - # If event is ngnored, continue. - elif [ "$event" == "IGNORED" ]; then - - continue - - # Sync files. - else - - echo `date "+%H:%M:%S"` $path2process copied. - rsync -aqP --exclude='db/' $src/ $dest - fi - -done diff --git a/tools/zdog.sh b/tools/zdog.sh deleted file mode 100755 index e0e6354df7..0000000000 --- a/tools/zdog.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# -# Watch a upload directory and remove dangder files. -# -# @author chunsheng wang - -# Judge the params, must give $dir -if [ $# -lt 1 ]; then - echo './zdog.sh directory' - exit 1 -fi - -# Judge inotifywait tool exists or not. -which inotifywait > /dev/null -if [ $? -ne 0 ]; then - echo 'No inotifywait. Please install inotify-tools, for debian or ubuntun run apt-get install inotify-tools.'; - exit 1 -fi - -# Get the directory to watch. -dir=$@ - -# Watch the $dir directory -if [ ! -d "/tmp/zdog" ]; then - mkdir -v /tmp/zdog; -fi -echo `date "+%H:%M:%S"` begin watching $dir > /tmp/zdog/zdog.log -inotifywait -mrq --event create,modify --format '%w %e %f' $dir |\ -while read watcher event file ; do - - # compute the $path2process. - path2process=$watcher$file - targetfile=/tmp/zdog/$file; - echo $path2process | grep -q '.php'; - if [ $? -eq 0 ] && [ -s $path2process ]; then - sudo mv -f $path2process $targetfile; - echo `date "+%H:%M:%S"` $path2process moved to $targetfile >> /tmp/zdog/zdog.log 2>&1; - fi -done