Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
VERSION = $(shell head -n 1 VERSION)
|
||||
LITEVERSION = $(shell head -n 1 extension/lite/LITEVERSION)
|
||||
XUANVERSION = $(shell head -n 1 xuanxuan/XUANVERSION)
|
||||
XVERSION = $(shell head -n 1 xuanxuan/XVERSION)
|
||||
|
||||
@@ -20,6 +21,8 @@ clean:
|
||||
rm -rf buildroot/
|
||||
rm -fr lampp
|
||||
rm -fr zentaoxx
|
||||
rm -fr tmp/
|
||||
rm -f *.sh
|
||||
common:
|
||||
mkdir zentaopms
|
||||
cp -fr api zentaopms/
|
||||
@@ -132,7 +135,8 @@ zentaoxx:
|
||||
sed -i 's/commonModel::getLicensePropertyValue/extCommonModel::getLicensePropertyValue/g' zentaoxx/extension/xuan/im/model/conference.php
|
||||
sed -i 's/xxb_/zt_/g' zentaoxx/db/*.sql
|
||||
sed -i "s#\$this->app->getModuleRoot() . 'im/apischeme.json'#\$this->app->getExtensionRoot() . 'xuan/im/apischeme.json'#g" zentaoxx/extension/xuan/im/model.php
|
||||
sed -i "/getModuleExtPath(/ r tools/fixxuan" zentaoxx/framework/xuanxuan.class.php
|
||||
sed -i "s/'..\/..\/common\/view\/header.html.php'/\$$app->getModuleRoot() . 'common\/view\/header.html.php'/g" zentaoxx/extension/xuan/conference/view/admin.html.php
|
||||
sed -i "s/'..\/..\/common\/view\/footer.html.php'/\$$app->getModuleRoot() . 'common\/view\/footer.html.php'/g" zentaoxx/extension/xuan/conference/view/admin.html.php
|
||||
echo "ALTER TABLE \`zt_user\` ADD \`pinyin\` varchar(255) NOT NULL DEFAULT '' AFTER \`realname\`;" >> zentaoxx/db/xuanxuan.sql
|
||||
mkdir zentaoxx/tools; cp tools/cn2tw.php zentaoxx/tools; cd zentaoxx/tools; php cn2tw.php
|
||||
cp tools/en2de.php zentaoxx/tools; cd zentaoxx/tools; php en2de.php ../
|
||||
@@ -232,7 +236,7 @@ enrpm:
|
||||
rpmbuild -ba ~/rpmbuild/SPECS/zentaopms.spec
|
||||
cp ~/rpmbuild/RPMS/noarch/zentaoalm-${VERSION}-1.noarch.rpm ./
|
||||
rm -rf ~/rpmbuild
|
||||
ci:
|
||||
ciCommon:
|
||||
git pull
|
||||
make common
|
||||
|
||||
@@ -247,7 +251,23 @@ ci:
|
||||
rm -fr zentaopms zentaoxx zentaoxx.*.zip
|
||||
make en
|
||||
rm -fr zentaopms zentaoxx zentaoxx.*.zip
|
||||
php tools/mergezentaopms.php $(VERSION)
|
||||
rm -f zentaobiz*.zip zentaomax*.zip $(BUILD_PATH)/ZenTaoPMS.$(VERSION).zip $(RELEASE_PATH)/ZenTaoALM.$(VERSION)*.zip $(RELEASE_PATH)/ZenTaoPMS.$(VERSION)*.zip $(RELEASE_PATH)/*.deb $(RELEASE_PATH)/*.rpm
|
||||
cp ZenTaoPMS.$(VERSION).zip $(BUILD_PATH)
|
||||
ci:
|
||||
make ciCommon
|
||||
php tools/packZip.php $(VERSION)
|
||||
sh zip.sh
|
||||
rm -rf tmp/
|
||||
php tools/packDeb.php $(VERSION)
|
||||
sh deb.sh
|
||||
rm -rf tmp/
|
||||
php tools/packRpm.php $(VERSION)
|
||||
sh rpm.sh
|
||||
rm -rf tmp/
|
||||
rm -f zentaobiz*.zip zentaomax*.zip $(BUILD_PATH)/ZenTaoPMS.$(VERSION).zip $(RELEASE_PATH)/ZenTaoALM.$(VERSION)*.zip $(RELEASE_PATH)/ZenTaoPMS.$(VERSION)*.zip $(RELEASE_PATH)/*.deb $(RELEASE_PATH)/*.rpm *.sh
|
||||
cp ZenTaoPMS.$(VERSION).zip $(BUILD_PATH)
|
||||
mv *.zip *.deb *.rpm $(RELEASE_PATH)
|
||||
lite:
|
||||
make ciCommon
|
||||
php tools/packZip.php $(VERSION) $(LITEVERSION)
|
||||
rm -f zentaobiz*.zip zentaomax*.zip $(BUILD_PATH)/ZenTaoPMS.$(VERSION).zip $(RELEASE_PATH)/ZenTaoALM.$(VERSION)*.zip $(RELEASE_PATH)/ZenTaoPMS.$(VERSION)*.zip $(RELEASE_PATH)/ZenTaoALM.$(LITEVERSION)*.zip $(RELEASE_PATH)/ZenTaoPMS.$(LITEVERSION)*.zip *.sh
|
||||
cp ZenTaoPMS.$(VERSION).zip $(BUILD_PATH)
|
||||
mv *.zip $(RELEASE_PATH)
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* The story recordEstimate entry point of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package entries
|
||||
* @version 1
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class storyRecordEstimateEntry extends Entry
|
||||
{
|
||||
/**
|
||||
* GET method.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function get($storyID)
|
||||
{
|
||||
if($this->config->edition == 'open') return $this->send400('ZenTaoPMS does not have story effort function.');
|
||||
|
||||
$control = $this->loadController('effort', 'createForObject');
|
||||
$control->createForObject('story', $storyID);
|
||||
|
||||
$data = $this->getData();
|
||||
if(!$data) return $this->error('error');
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$effort = $data->data->efforts;
|
||||
|
||||
$this->send(200, array('effort' => $effort));
|
||||
}
|
||||
|
||||
/**
|
||||
* POST method.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function post($storyID)
|
||||
{
|
||||
if($this->config->edition == 'open') return $this->send400('ZenTaoPMS does not have story effort function.');
|
||||
|
||||
$fields = 'id,dates,consumed,objectType,objectID,work';
|
||||
$this->batchSetPost($fields);
|
||||
$control = $this->loadController('effort', 'createForObject');
|
||||
$control->createForObject('story', $storyID);
|
||||
|
||||
$data = $this->getData();
|
||||
if(!$data) return $this->send400('error');
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$story = $this->loadModel('story')->getById($storyID);
|
||||
|
||||
$this->send(200, $this->format($story, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList'));
|
||||
}
|
||||
}
|
||||
@@ -82,5 +82,4 @@ class taskBatchCreateEntry extends Entry
|
||||
$task = $this->loadModel('task')->getById($taskID);
|
||||
return $this->send(200, array('task' => $task));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ class taskRecordEstimateEntry extends Entry
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$effort = array();
|
||||
if($this->config->edition != 'open' and $data->data->efforts) $effort = $data->data->efforts;
|
||||
if($this->config->edition == 'open' and $data->data->esitimates) $effort = $data->data->esitimates;
|
||||
if($this->config->edition != 'open' and $data->data->efforts) $effort = $data->data->efforts;
|
||||
if($this->config->edition == 'open' and $data->data->estimates) $effort = $data->data->estimates;
|
||||
$this->send(200, array('effort' => $effort));
|
||||
|
||||
}
|
||||
@@ -71,6 +71,7 @@ class taskRecordEstimateEntry extends Entry
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$task = $this->loadModel('task')->getById($taskID);
|
||||
|
||||
$this->send(200, $this->format($task, 'deadline:date,openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,realStarted:time,finishedBy:user,finishedDate:time,closedBy:user,closedDate:time,canceledBy:user,canceledDate:time,lastEditedBy:user,lastEditedDate:time,deleted:bool,mailto:userList'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
%define __os_install_post %{nil}
|
||||
|
||||
Name:zentaopms
|
||||
Version:7.1.stable
|
||||
Release:1
|
||||
|
||||
+22
-23
@@ -39,19 +39,19 @@ $routes['/products/:id/releases'] = 'releases';
|
||||
$routes['/projects/:id/releases'] = 'projectReleases';
|
||||
$routes['/releases/:id'] = 'release';
|
||||
|
||||
$routes['/stories'] = 'stories';
|
||||
$routes['/products/:id/stories'] = 'stories';
|
||||
$routes['/projects/:id/stories'] = 'projectStories';
|
||||
$routes['/executions/:id/stories'] = 'executionStories';
|
||||
$routes['/stories/:id'] = 'story';
|
||||
$routes['/stories/:id/change'] = 'storyChange';
|
||||
$routes['/stories/:id/close'] = 'storyClose';
|
||||
$routes['/stories/:id/active'] = 'storyActive';
|
||||
$routes['/stories/:id/assign'] = 'storyAssignto';
|
||||
$routes['/stories/:id/recordEstimate'] = 'storyRecordEstimate';
|
||||
$routes['/stories/:id/child'] = 'storyChild';
|
||||
$routes['/stories/:id/recall'] = 'storyRecall';
|
||||
$routes['/stories/:id/review'] = 'storyReview';
|
||||
$routes['/stories'] = 'stories';
|
||||
$routes['/products/:id/stories'] = 'stories';
|
||||
$routes['/projects/:id/stories'] = 'projectStories';
|
||||
$routes['/executions/:id/stories'] = 'executionStories';
|
||||
$routes['/stories/:id'] = 'story';
|
||||
$routes['/stories/:id/change'] = 'storyChange';
|
||||
$routes['/stories/:id/close'] = 'storyClose';
|
||||
$routes['/stories/:id/active'] = 'storyActive';
|
||||
$routes['/stories/:id/assign'] = 'storyAssignto';
|
||||
$routes['/stories/:id/estimate'] = 'storyRecordEstimate';
|
||||
$routes['/stories/:id/child'] = 'storyChild';
|
||||
$routes['/stories/:id/recall'] = 'storyRecall';
|
||||
$routes['/stories/:id/review'] = 'storyReview';
|
||||
|
||||
$routes['/module/:id/stories'] = 'moduleStories';
|
||||
|
||||
@@ -73,16 +73,15 @@ $routes['/executions/:id'] = 'execution';
|
||||
$routes['/executions/:id/tasks/batchCreate'] = 'taskBatchCreate';
|
||||
$routes['/tasks/batchCreate'] = 'taskBatchCreate';
|
||||
|
||||
$routes['/executions/:id/tasks'] = 'tasks';
|
||||
$routes['/tasks'] = 'tasks';
|
||||
$routes['/tasks/:id'] = 'task';
|
||||
$routes['/tasks/:id/assignto'] = 'taskAssignTo';
|
||||
$routes['/tasks/:id/start'] = 'taskStart';
|
||||
$routes['/tasks/:id/pause'] = 'taskPause';
|
||||
$routes['/tasks/:id/finish'] = 'taskFinish';
|
||||
$routes['/tasks/:id/close'] = 'taskClose';
|
||||
$routes['/tasks/:id/recordEstimate'] = 'taskRecordEstimate';
|
||||
$routes['/tasks/:id/getEstimate'] = 'taskRecordEstimate';
|
||||
$routes['/executions/:id/tasks'] = 'tasks';
|
||||
$routes['/tasks'] = 'tasks';
|
||||
$routes['/tasks/:id'] = 'task';
|
||||
$routes['/tasks/:id/assignto'] = 'taskAssignTo';
|
||||
$routes['/tasks/:id/start'] = 'taskStart';
|
||||
$routes['/tasks/:id/pause'] = 'taskPause';
|
||||
$routes['/tasks/:id/finish'] = 'taskFinish';
|
||||
$routes['/tasks/:id/close'] = 'taskClose';
|
||||
$routes['/tasks/:id/estimate'] = 'taskRecordEstimate';
|
||||
|
||||
$routes['/users'] = 'users';
|
||||
$routes['/users/:id'] = 'user';
|
||||
|
||||
@@ -217,6 +217,7 @@ $config->openMethods[] = 'kanban.importbuild';
|
||||
$config->openMethods[] = 'kanban.activatecard';
|
||||
$config->openMethods[] = 'kanban.finishcard';
|
||||
$config->openMethods[] = 'kanban.deleteobjectcard';
|
||||
$config->openMethods[] = 'admin.ignore';
|
||||
|
||||
/* Define the tables. */
|
||||
define('TABLE_COMPANY', '`' . $config->db->prefix . 'company`');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
$lang->project->leftStories = '剩余目标';
|
||||
$lang->project->doingExecutions = '进行中的看板';
|
||||
$lang->project->doingExecutions = '进行中的看板(最近1个)';
|
||||
$lang->project->select = "请选择{$lang->project->common}";
|
||||
$lang->project->noProject = "暂时没有{$lang->project->common}。";
|
||||
|
||||
|
||||
@@ -431,7 +431,7 @@ class actionModel extends model
|
||||
$name = $this->dao->select('name')->from(TABLE_TESTTASK)->where('id')->eq($action->extra)->fetch('name');
|
||||
if($name) $action->extra = common::hasPriv('testtask', 'view') ? html::a(helper::createLink('testtask', 'view', "taskID=$action->extra"), $name) : $name;
|
||||
}
|
||||
elseif($actionName == 'tostory')
|
||||
elseif($action->objectType != 'feedback' and $actionName == 'tostory')
|
||||
{
|
||||
$title = $this->dao->select('title')->from(TABLE_STORY)->where('id')->eq($action->extra)->fetch('title');
|
||||
if($title) $action->extra = common::hasPriv('story', 'view') ? html::a(helper::createLink('story', 'view', "storyID=$action->extra"), "#$action->extra " . $title) : "#$action->extra " . $title;
|
||||
@@ -462,7 +462,7 @@ class actionModel extends model
|
||||
}
|
||||
$action->extra = trim(trim($action->extra), ',');
|
||||
}
|
||||
elseif($actionName == 'totask' or $actionName == 'linkchildtask' or $actionName == 'unlinkchildrentask' or $actionName == 'linkparenttask' or $actionName == 'unlinkparenttask' or $actionName == 'deletechildrentask')
|
||||
elseif($action->objectType != 'feedback' and (strpos(',totask,linkchildtask,unlinkchildrentask,linkparenttask,unlinkparenttask,deletechildrentask,', ",$actionName,") !== false))
|
||||
{
|
||||
$name = $this->dao->select('name')->from(TABLE_TASK)->where('id')->eq($action->extra)->fetch('name');
|
||||
if($name) $action->extra = common::hasPriv('task', 'view') ? html::a(helper::createLink('task', 'view', "taskID=$action->extra"), "#$action->extra " . $name) : "#$action->extra " . $name;
|
||||
|
||||
@@ -47,10 +47,10 @@ class admin extends control
|
||||
*/
|
||||
public function ignore()
|
||||
{
|
||||
$account = $this->app->user->account;
|
||||
$this->loadModel('setting');
|
||||
$this->setting->deleteItems('owner=system&module=common§ion=global&key=community');
|
||||
$this->setting->deleteItems('owner=system&module=common§ion=global&key=ztPrivateKey');
|
||||
$this->setting->setItem('system.common.global.community', 'na');
|
||||
$this->setting->setItem("$account.common.global.community", 'na');
|
||||
echo js::locate(inlink('index'), 'parent');
|
||||
}
|
||||
|
||||
|
||||
@@ -113,3 +113,12 @@
|
||||
|
||||
.paramsTable th {text-align: left!important; font-size: 14px;}
|
||||
.paramsTable td {text-align: left;}
|
||||
|
||||
.tree-group {position: relative;}
|
||||
.tree-group > .module-name {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; display: block;}
|
||||
.tree li.active > .tree-group a {font-weight: 700; color: #0c64eb;}
|
||||
.tree-actions {display: inline-block; margin-left: 5px; vertical-align: middle;}
|
||||
.tree-group .tree-actions {display: none; position: absolute; right: 0; top: 0; background-color: #fff; white-space: nowrap;}
|
||||
.tree-group:hover .tree-actions {display: block}
|
||||
.tree-actions a {display: inline-block; margin-left: 5px; font-size: 13px; opacity: .6;}
|
||||
.tree li.active > .tree-group a {font-weight: 700; color: #0c64eb;}
|
||||
|
||||
@@ -1705,11 +1705,11 @@ class block extends control
|
||||
$hasViewPriv = array();
|
||||
if(common::hasPriv('todo', 'view')) $hasViewPriv['todo'] = true;
|
||||
if(common::hasPriv('task', 'view')) $hasViewPriv['task'] = true;
|
||||
if(common::hasPriv('bug', 'view')) $hasViewPriv['bug'] = true;
|
||||
if(common::hasPriv('story', 'view')) $hasViewPriv['story'] = true;
|
||||
if(common::hasPriv('risk', 'view') and $this->config->edition == 'max') $hasViewPriv['risk'] = true;
|
||||
if(common::hasPriv('issue', 'view') and $this->config->edition == 'max') $hasViewPriv['issue'] = true;
|
||||
if(common::hasPriv('meeting', 'view') and $this->config->edition == 'max') $hasViewPriv['meeting'] = true;
|
||||
if(common::hasPriv('bug', 'view') and $this->config->vision != 'lite') $hasViewPriv['bug'] = true;
|
||||
if(common::hasPriv('story', 'view') and $this->config->vision != 'lite') $hasViewPriv['story'] = true;
|
||||
if(common::hasPriv('risk', 'view') and $this->config->edition == 'max' and $this->config->vision != 'lite') $hasViewPriv['risk'] = true;
|
||||
if(common::hasPriv('issue', 'view') and $this->config->edition == 'max' and $this->config->vision != 'lite') $hasViewPriv['issue'] = true;
|
||||
if(common::hasPriv('meeting', 'view') and $this->config->edition == 'max' and $this->config->vision != 'lite') $hasViewPriv['meeting'] = true;
|
||||
|
||||
$params = $this->get->param;
|
||||
$params = json_decode(base64_decode($params));
|
||||
|
||||
@@ -1783,6 +1783,8 @@ class bugModel extends model
|
||||
|
||||
public function getProductMemberPairs($productID)
|
||||
{
|
||||
if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getTeamMembersPairs();
|
||||
|
||||
$projects = $this->loadModel('product')->getProjectPairsByProduct($productID);
|
||||
|
||||
$users = $this->dao->select("t2.id, t2.account, t2.realname")->from(TABLE_TEAM)->alias('t1')
|
||||
|
||||
@@ -485,8 +485,6 @@ class commonModel extends model
|
||||
/* The standalone lite version removes the lite interface button */
|
||||
if(trim($config->visions, ',') == 'lite') return true;
|
||||
|
||||
if($app->config->systemMode != 'new') return print("<div>{$lang->visionList['rnd']}</div>");
|
||||
|
||||
if(count($userVisions) < 2) return print("<div>{$lang->visionList[$currentVision]}</div>");
|
||||
if(count($configVisions) < 2) return print("<div>{$lang->visionList[$currentVision]}</div>");
|
||||
|
||||
@@ -579,7 +577,7 @@ class commonModel extends model
|
||||
$params = "objectType=&objectID=0&libID=0";
|
||||
$createMethod = 'selectLibType';
|
||||
$isOnlyBody = true;
|
||||
$attr = "class='iframe' data-width='650px'";
|
||||
$attr = "class='iframe' data-width='700px'";
|
||||
break;
|
||||
case 'project':
|
||||
if($config->vision == 'lite')
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#createForm table th {width: 125px;}
|
||||
@@ -121,7 +121,7 @@ $lang->convert->jira->next = 'Next';
|
||||
$lang->convert->jira->importFromDB = 'Import From Database';
|
||||
$lang->convert->jira->importFromFile = 'Import From File';
|
||||
$lang->convert->jira->mapJira2Zentao = 'Map Jira To Zentao';
|
||||
$lang->convert->jira->dbNameNotice = "Database";
|
||||
$lang->convert->jira->dbNameNotice = "Please enter the Jira database name.";
|
||||
$lang->convert->jira->importNotice = 'Notice: Importing data is risky! Make sure to complete the following steps in sequence before merging.';
|
||||
$lang->convert->jira->dbDesc = '<p>If your Jira uses MySQL database, please choose this way.</p>';
|
||||
$lang->convert->jira->fileDesc = '<p>Choose this method if your Jira uses a non-MySQL database.</p>';
|
||||
|
||||
@@ -35,7 +35,7 @@ li .form-control {margin-top: 10px}
|
||||
<li>
|
||||
<?php echo $lang->convert->jira->importSteps[$method][5];?>
|
||||
<?php if($method == 'db'):?>
|
||||
<?php echo html::input('dbName', '', "class='form-control w-200px' placeholder={$lang->convert->jira->dbNameNotice}");?>
|
||||
<div class='required w-250px'><?php echo html::input('dbName', '', "class='form-control' placeholder='{$lang->convert->jira->dbNameNotice}'");?></div>
|
||||
<?php endif;?>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
<td>
|
||||
<input type='password' style="display:none"> <!-- for disable autocomplete all browser -->
|
||||
<span class='input-group'>
|
||||
<?php echo html::password('password1', '', "class='form-control'");?>
|
||||
<?php echo html::password('password1', '', "class='form-control' required");?>
|
||||
</span>
|
||||
</td>
|
||||
<td><?php echo $lang->convert->jira->passwordNotice;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->password2;?></th>
|
||||
<td><?php echo html::password('password2', '', "class='form-control'");?></td>
|
||||
<td><?php echo html::password('password2', '', "class='form-control' required");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->group;?></th>
|
||||
|
||||
@@ -26,19 +26,9 @@
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
</ul>
|
||||
<div class='btn-toolbar pull-right'>
|
||||
<?php
|
||||
if($step != 1)
|
||||
{
|
||||
$preStep = $step - 1;
|
||||
echo html::a(inlink('mapJira2Zentao', "method=$method&dnname=$dbName&preStep=$preStep"), $lang->goback, '', "class='btn btn-wide'");
|
||||
}
|
||||
?>
|
||||
<?php echo html::submitButton($lang->convert->jira->next, "data-placement='bottom'");?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($step == 1):?>
|
||||
<table class='table table-form'>
|
||||
<?php if($step == 1):?>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
<th><?php echo $lang->convert->jira->jiraObject;?></th>
|
||||
@@ -54,11 +44,8 @@
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr />
|
||||
<?php endif;?>
|
||||
<?php if($step == 2):?>
|
||||
<table class='table table-form'>
|
||||
<?php endif;?>
|
||||
<?php if($step == 2):?>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
<th><?php echo $lang->convert->jira->jiraLinkType;?></th>
|
||||
@@ -74,11 +61,8 @@
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr />
|
||||
<?php endif;?>
|
||||
<?php if($step == 3):?>
|
||||
<table class='table table-form'>
|
||||
<?php endif;?>
|
||||
<?php if($step == 3):?>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
<th><?php echo $lang->convert->jira->jiraResolution;?></th>
|
||||
@@ -96,11 +80,8 @@
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr />
|
||||
<?php endif;?>
|
||||
<?php if($step == 4):?>
|
||||
<table class='table table-form'>
|
||||
<?php endif;?>
|
||||
<?php if($step == 4):?>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
<th><?php echo $lang->convert->jira->jiraStatus;?></th>
|
||||
@@ -122,7 +103,21 @@
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
<?php endif;?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan='<?php echo $step == 1 ? 2 : ($step == 4 ? 5 : $step);?>' class='text-center form-actions'>
|
||||
<?php echo html::submitButton($lang->convert->jira->next, "data-placement='bottom'");?>
|
||||
<?php
|
||||
if($step != 1)
|
||||
{
|
||||
$preStep = $step - 1;
|
||||
echo html::a(inlink('mapJira2Zentao', "method=$method&dnname=$dbName&preStep=$preStep"), $lang->goback, '', "class='btn btn-wide'");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -351,6 +351,8 @@ class doc extends control
|
||||
|
||||
$this->view->title = $libName . $this->lang->doc->create;
|
||||
|
||||
$this->view->objectType = $objectType;
|
||||
$this->view->objectID = $objectID;
|
||||
$this->view->libID = $libID;
|
||||
$this->view->libs = $libs;
|
||||
$this->view->gobackLink = $gobackLink;
|
||||
|
||||
@@ -59,6 +59,8 @@ $(function()
|
||||
}
|
||||
}, 200);
|
||||
});
|
||||
|
||||
if($(".createCustomLib").length == 1) $(".createCustomLib").click(); // Fix bug #15139.
|
||||
})
|
||||
|
||||
function toggleEditor(type)
|
||||
|
||||
@@ -8,6 +8,13 @@
|
||||
function redirectParentWindow(objectType)
|
||||
{
|
||||
config.onlybody = 'no';
|
||||
var link = createLink('doc', 'create', 'objectType=' + objectType + '&objectID=0&libID=0') + '#app=doc';
|
||||
if(objectType == 'api')
|
||||
{
|
||||
var link = createLink('api', 'create', 'libID=0') + '#app=doc';
|
||||
}
|
||||
else
|
||||
{
|
||||
var link = createLink('doc', 'create', 'objectType=' + objectType + '&objectID=0&libID=0') + '#app=doc';
|
||||
}
|
||||
window.parent.$.apps.open(link);
|
||||
}
|
||||
|
||||
@@ -127,6 +127,8 @@ if($config->systemMode == 'new') $lang->doc->libTypeList['project'] = 'Project L
|
||||
$lang->doc->libTypeList['execution'] = $lang->execution->common . ' Library';
|
||||
$lang->doc->libTypeList['custom'] = 'Custom Library';
|
||||
|
||||
$lang->doc->libGlobalList['api'] = 'Api Libray';
|
||||
|
||||
$lang->doc->libIconList['product'] = 'icon-product';
|
||||
$lang->doc->libIconList['execution'] = 'icon-stack';
|
||||
$lang->doc->libIconList['custom'] = 'icon-folder-o';
|
||||
|
||||
@@ -127,6 +127,8 @@ if($config->systemMode == 'new') $lang->doc->libTypeList['project'] = '项目文
|
||||
$lang->doc->libTypeList['execution'] = $lang->execution->common . '文档库';
|
||||
$lang->doc->libTypeList['custom'] = '自定义文档库';
|
||||
|
||||
$lang->doc->libGlobalList['api'] = '接口文档库';
|
||||
|
||||
$lang->doc->libIconList['product'] = 'icon-product';
|
||||
$lang->doc->libIconList['execution'] = 'icon-stack';
|
||||
$lang->doc->libIconList['custom'] = 'icon-folder-o';
|
||||
|
||||
@@ -2305,10 +2305,16 @@ EOT;
|
||||
foreach($moduleDocs[0] as $doc)
|
||||
{
|
||||
$treeMenu[0] .= '<li' . ($doc->id == $docID ? ' class="active"' : ' class="independent"') . '>';
|
||||
$treeMenu[0] .= "<div class='tree-group'><span class='module-name'>" . html::a(inlink('index', "libID=$rootID&moduelID=0&apiID={$doc->id}"), "<i class='icon icon-file-text text-muted'></i> " . $doc->title, '', "data-app='{$this->app->tab}' class='doc-title' title='{$doc->title}'") . '</span>';
|
||||
|
||||
$treeMenu[0] .= html::a(inlink('index', "libID=$rootID&moduelID=0&apiID={$doc->id}"), "<i class='icon icon-file-text text-muted'></i> " . $doc->title, '', "data-app='{$this->app->tab}' class='doc-title' title='{$doc->title}'");
|
||||
if(common::hasPriv('api', 'edit'))
|
||||
{
|
||||
$treeMenu[0] .= "<div class='tree-actions'>";
|
||||
$treeMenu[0] .= html::a(helper::createLink('api', 'edit', "docID={$doc->id}"), "<i class='icon icon-edit'></i>", '', "title={$this->lang->doc->edit} data-app='{$this->app->tab}'");
|
||||
$treeMenu[0] .= '</div>';
|
||||
}
|
||||
|
||||
$treeMenu[0] .= '</li>';
|
||||
$treeMenu[0] .= '</div></li>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,16 +19,7 @@
|
||||
<div class="panel block-files block-sm no-margin">
|
||||
<?php if(empty($docs)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p>
|
||||
<span class="text-muted"><?php echo $lang->doc->noDoc;?></span>
|
||||
<?php if($browseType == 'byediteddate'):?>
|
||||
<span class="text-muted"><?php echo $lang->doc->noEditedDoc;?></span>
|
||||
<?php elseif($browseType == 'openedbyme'):?>
|
||||
<span class="text-muted"><?php echo $lang->doc->noOpenedDoc;?></span>
|
||||
<?php elseif($browseType == 'collectedbyme'):?>
|
||||
<span class="text-muted"><?php echo $lang->doc->noCollectedDoc;?></span>
|
||||
<?php endif;?>
|
||||
</p>
|
||||
<p><span class="text-muted"><?php echo $lang->doc->noDoc;?></span></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class="panel-body">
|
||||
|
||||
@@ -45,6 +45,9 @@ $("a[href^='###']").click(function()
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->doc->create;?></h2>
|
||||
</div>
|
||||
<?php if($objectType == 'custom' and empty($libs)):?>
|
||||
<?php echo html::a(helper::createLink('doc', 'createLib', "type=custom&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->doc->createLib, '', 'class="iframe hidden createCustomLib"');?>
|
||||
<?php endif;?>
|
||||
<form class="load-indicator main-form form-ajax" id="dataform" method='post' enctype='multipart/form-data'>
|
||||
<table class='table table-form'>
|
||||
<tbody>
|
||||
|
||||
@@ -23,6 +23,11 @@
|
||||
<li><?php echo html::a($this->createLink('doc', 'browse', "browseType=byediteddate"), '<i class="icon icon-more icon-sm"></i>', '', "title='{$lang->more}'");?></li>
|
||||
</nav>
|
||||
</div>
|
||||
<?php if(empty($latestEditedDocs)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->doc->noDoc;?></span></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class="panel-body has-table">
|
||||
<table class="table table-borderless table-fixed-head table-hover">
|
||||
<thead>
|
||||
@@ -45,6 +50,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
@@ -129,6 +135,11 @@
|
||||
<li><?php echo html::a($this->createLink('doc', 'browse', "browseType=openedbyme"), '<i class="icon icon-more icon-sm"></i>', '', "title='{$lang->more}'");?></li>
|
||||
</nav>
|
||||
</div>
|
||||
<?php if(!empty($myDocs)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->doc->noDoc;?></span></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class="panel-body has-table">
|
||||
<table class="table table-borderless table-fixed-head table-hover">
|
||||
<thead>
|
||||
@@ -151,6 +162,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
@@ -161,6 +173,11 @@
|
||||
<li><?php echo html::a($this->createLink('doc', 'browse', "browseType=collectedbyme"), '<i class="icon icon-more icon-sm"></i>', '', "title='{$lang->more}'");?></li>
|
||||
</nav>
|
||||
</div>
|
||||
<?php if(empty($collectedDocs)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->doc->noDoc;?></span></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class="panel-body has-table">
|
||||
<table class="table table-borderless table-fixed-head table-hover">
|
||||
<thead>
|
||||
@@ -181,6 +198,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->doc->libType;?></th>
|
||||
<td class='w-p85'><?php echo html::radio('objectType', $lang->doc->libTypeList, key($lang->doc->libTypeList));?></td>
|
||||
<?php $globalList = $lang->doc->libTypeList + $lang->doc->libGlobalList;?>
|
||||
<td class='w-p90'><?php echo html::radio('objectType', $globalList, key($globalList));?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'><?php echo html::submitButton($lang->confirm);?></td>
|
||||
|
||||
@@ -613,7 +613,7 @@ class execution extends control
|
||||
$bugModules = array();
|
||||
foreach($products as $productID => $productName)
|
||||
{
|
||||
$productModules = $this->tree->getOptionMenu($productID, 'bug', 0);
|
||||
$productModules = $this->tree->getOptionMenu($productID, 'bug', 0, 'all');
|
||||
foreach($productModules as $moduleID => $moduleName)
|
||||
{
|
||||
if(empty($moduleID))
|
||||
@@ -2549,8 +2549,6 @@ class execution extends control
|
||||
if($executionType == 'stage')
|
||||
{
|
||||
if(!isset($_POST['products'])) return print(js::alert($this->lang->execution->noLinkProduct) . js::locate($this->createLink('execution', 'manageProducts', "executionID=$executionID&from=$from")));
|
||||
|
||||
if(count($_POST['products']) > 1) return print(js::alert($this->lang->execution->oneProduct) . js::locate($this->createLink('execution', 'manageProducts', "executionID=$executionID&from=$from")));
|
||||
}
|
||||
|
||||
$oldProducts = $this->product->getProducts($executionID);
|
||||
|
||||
@@ -1020,6 +1020,7 @@ function updateKanban(kanbanData, regionID = 0)
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
$.zui.closeModal();
|
||||
if(regionID)
|
||||
{
|
||||
updateRegion(regionID, kanbanData[regionID]);
|
||||
|
||||
@@ -267,6 +267,7 @@
|
||||
var $bar = $('#appBar-' + appCode);
|
||||
if(!$bar.length)
|
||||
{
|
||||
if (typeof(app.text) == 'undefined') return false;
|
||||
var $link= $('<a data-pos="bar"></a>')
|
||||
.attr('data-app', appCode)
|
||||
.attr('class', 'show-in-app')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
body {background: #f1f1f1;}
|
||||
.container {padding: 0;}
|
||||
.modal-dialog {width: 100%;}
|
||||
.modal-dialog {width: 100%; margin-top: 20px;}
|
||||
.modal-footer {text-align: center; margin-top: 0;}
|
||||
.w-350px {width: 350px;}
|
||||
|
||||
|
||||
@@ -502,10 +502,14 @@ class installModel extends model
|
||||
*/
|
||||
public function grantPriv()
|
||||
{
|
||||
$data = fixer::input('post')
|
||||
->stripTags('company')
|
||||
->get();
|
||||
|
||||
$requiredFields = explode(',', $this->config->install->step5RequiredFields);
|
||||
foreach($requiredFields as $field)
|
||||
{
|
||||
if(empty($this->post->{$field}))
|
||||
if(empty($data->{$field}))
|
||||
{
|
||||
dao::$errors[] = $this->lang->install->errorEmpty[$field];
|
||||
return false;
|
||||
@@ -514,7 +518,7 @@ class installModel extends model
|
||||
|
||||
/* Insert a company. */
|
||||
$company = new stdclass();
|
||||
$company->name = $this->post->company;
|
||||
$company->name = $data->company;
|
||||
$company->admins = ",{$this->post->account},";
|
||||
$this->dao->insert(TABLE_COMPANY)->data($company)->autoCheck()->exec();
|
||||
if(!dao::isError())
|
||||
|
||||
@@ -867,6 +867,7 @@ class kanban extends control
|
||||
$this->view->card = $card;
|
||||
$this->view->actions = $this->action->getList('kanbancard', $cardID);
|
||||
$this->view->users = $users;
|
||||
$this->view->kanban = $kanban;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -1317,6 +1318,9 @@ class kanban extends control
|
||||
*/
|
||||
public function viewArchivedCard($regionID)
|
||||
{
|
||||
$region = $this->kanban->getRegionByID($regionID);
|
||||
|
||||
$this->view->kanban = $this->kanban->getByID($region->kanban);
|
||||
$this->view->cards = $this->kanban->getCardsByObject('region', $regionID, 1);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted');
|
||||
$this->view->userIdPairs = $this->user->getPairs('noletter|nodeleted|showid');
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
.region .kanban .form-actions .btn {margin-right: 10px; min-width: 50px;}
|
||||
|
||||
.region .kanban-board + .kanban-board {margin-top: 20px;}
|
||||
.region .kanban-board > .kanban-header > .kanban-group-header {padding: 8px 2px; width: 20px;}
|
||||
.region .kanban-board > .kanban-header > .kanban-group-header {padding: 7px 0; width: 20px; text-align: center;}
|
||||
.region .kanban-board > .kanban-header > .kanban-group-header:hover {cursor: move;}
|
||||
.region .kanban-board.sort > .kanban-header {padding-left: 0;}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
.region .kanban-header-col > .title > .count {opacity: .5; font-weight: bold; color: #8b91a2;}
|
||||
.region .kanban-header-col > .title > .error {color: #333333; padding-left: 2px; font-size: 10px; padding-top: 1px; padding-right: 2px;}
|
||||
.kanban-affixed .kanban-header-col > .title > .text {color: #fff!important}
|
||||
.region .kanban-header-col > .actions {position: relative; right: -5px;}
|
||||
.region .kanban-header-col > .actions {position: relative;}
|
||||
.region .kanban-header-parent-col > .actions {position: absolute; right: 0px;}
|
||||
.region .kanban-header-sub-cols .actions {position: absolute; right: 0px;}
|
||||
|
||||
@@ -56,8 +56,6 @@
|
||||
.region .kanban-lane-col {max-height: unset !important; overflow: auto; position: relative;}
|
||||
.region .kanban-lane-col.has-scrollbar > .kanban-lane-actions {position: absolute; background-color: inherit; bottom: 0; left: 0; right: 0;}
|
||||
|
||||
.region .kanban-lane-items {overflow: overlay !important; padding-bottom: 10px;}
|
||||
|
||||
.kanban-item {position: relative}
|
||||
.kanban-item > .kanban-card > .title {display: block; line-height: 18px;}
|
||||
.kanban-item > .kanban-card > .title:hover {color: #2272eb}
|
||||
@@ -79,7 +77,7 @@
|
||||
.kanban-item .has-color .actions .icon-more-v,
|
||||
.kanban-item .has-color .info > .label-pri,
|
||||
.kanban-item .has-color .info > .estimate,
|
||||
.kanban-item .has-color .info > .user .lable-teamSumCount,
|
||||
.kanban-item .has-color .info > .user .label-teamSumCount,
|
||||
.kanban-item .has-color .info > .label-light {color: #FFFFFF;}
|
||||
.kanban-item .has-color .info > .label-pri {border-color: #FFFFFF;}
|
||||
.kanban-item .has-color .progress-box > .progress-number {color: #FFFFFF;}
|
||||
@@ -100,8 +98,14 @@
|
||||
.kanban-col[data-type=ADD] {display: none;}
|
||||
.kanban-col[data-type=EMPTY] {display: none;}
|
||||
.kanban-col {padding-right: 0px !important;}
|
||||
.kanban-col.drag-shadow {background-color: #ededed !important; border-color: #ededed!important; box-shadow: 0 4px 10px 0 rgb(0,0,0, 0.05), 0 4px 20px 0 rgb(0,0,0, .3); min-height: 30px!important;}
|
||||
.kanban-col.drag-shadow .kanban-header-col {min-height: 30px!important;}
|
||||
.kanban-header-has-parent .kanban-header-cols > .kanban-col.drag-shadow,
|
||||
.kanban-col.kanban-header-parent-col.drag-shadow {min-height: 64px!important;}
|
||||
.kanban-col.drag-shadow > .actions {visibility: hidden!important;}
|
||||
.kanban-item .title {padding-right: 10px;}
|
||||
.gray .actions {display:none;}
|
||||
.kanban-cols-sorting .kanban-item {visibility: hidden!important;}
|
||||
|
||||
.kanban-card .header .executionName {display: flex; width: 100%; float: left;}
|
||||
.kanban-card .header .executionName .title {padding-right: 0px; margin-right: 5px; overflow: hidden; white-space: nowrap;}
|
||||
|
||||
+55
-54
@@ -40,7 +40,7 @@ function fullScreen()
|
||||
$('.action').hide();
|
||||
$('.kanban-group-header').hide();
|
||||
$(".title").attr("disabled", true).css("pointer-events", "none");
|
||||
$('#kanban').sortable('destroy');
|
||||
window.sortableDisabled = true;
|
||||
$.cookie('isFullScreen', 1);
|
||||
};
|
||||
|
||||
@@ -82,7 +82,7 @@ function exitFullScreen()
|
||||
$('.action').show();
|
||||
$('.kanban-group-header').show();
|
||||
$(".title").attr("disabled", false).css("pointer-events", "auto");
|
||||
initSortable();
|
||||
window.sortableDisabled = false;
|
||||
$.cookie('isFullScreen', 0);
|
||||
}
|
||||
|
||||
@@ -130,10 +130,7 @@ function renderHeaderCol($column, column, $header, kanbanData)
|
||||
}
|
||||
}
|
||||
|
||||
var regionID = $column.closest('.kanban').data('id');
|
||||
var groupID = $column.closest('.kanban-board').data('id');
|
||||
var laneID = column.$kanbanData.lanes[0].id ? column.$kanbanData.lanes[0].id : 0;
|
||||
var columnID = $column.closest('.kanban-col').data('id');
|
||||
var printMoreBtn = (columnPrivs.includes('setColumn') || columnPrivs.includes('setWIP') || columnPrivs.includes('createColumn') || columnPrivs.includes('copyColumn') || columnPrivs.includes('archiveColumn') || columnPrivs.includes('deleteColumn') || columnPrivs.includes('splitColumn'));
|
||||
|
||||
/* Render more menu. */
|
||||
@@ -146,7 +143,7 @@ function renderHeaderCol($column, column, $header, kanbanData)
|
||||
var $actions = $column.children('.actions');
|
||||
if(column.parent != -1)
|
||||
{
|
||||
addItemBtn = ['<a data-contextmenu="columnCreate" data-action="addItem" data-column="' + column.id + '" data-lane="' + laneID + '" class="text-primary">', '<i class="icon icon-expand-alt"></i>', '</a>'].join('');
|
||||
addItemBtn = ['<button data-contextmenu="columnCreate" data-action="addItem" data-column="' + column.id + '" data-lane="' + laneID + '" class="btn btn-link">', '<i class="icon icon-expand-alt text-primary"></i>', '</button>'].join('');
|
||||
}
|
||||
|
||||
var moreAction = ' <button class="btn btn-link action" title="' + kanbanLang.moreAction + '" data-contextmenu="column" data-column="' + column.id + '"><i class="icon icon-ellipsis-v"></i></button>';
|
||||
@@ -238,7 +235,6 @@ function renderLaneName($lane, lane, $kanban, columns, kanban)
|
||||
function renderUsersAvatar(users, itemID, size)
|
||||
{
|
||||
var avatarSizeClass = 'avatar-' + (size || 'md');
|
||||
//var link = createLink('kanban', 'assigncard', 'id=' + itemID, '', true);
|
||||
|
||||
if(users.length == 0 || (users.length == 1 && users[0] == ''))
|
||||
{
|
||||
@@ -1019,19 +1015,20 @@ function handleKanbanAction(action, $element, event, kanban)
|
||||
|
||||
function processMinusBtn()
|
||||
{
|
||||
var columnCount = $('#splitTable .child-column').size();
|
||||
var $table = $('#splitTable');
|
||||
var columnCount = $table.find('.child-column').length;
|
||||
if(columnCount > 2 && columnCount < 10)
|
||||
{
|
||||
$('#splitTable .btn-plus').show();
|
||||
$('#splitTable .btn-close').show();
|
||||
$table.find('.btn-plus').show();
|
||||
$table.find('.btn-close').show();
|
||||
}
|
||||
else if(columnCount <= 2)
|
||||
{
|
||||
$('#splitTable .btn-close').hide();
|
||||
$table.find('.btn-close').hide();
|
||||
}
|
||||
else if(columnCount >= 10)
|
||||
{
|
||||
$('#splitTable .btn-plus').hide();
|
||||
$table.find('.btn-plus').hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1192,6 +1189,28 @@ function calcColHeight(col, lane, colCards, colHeight, kanban)
|
||||
return (displayCards * (options.cardHeight + options.cardSpace) + options.cardSpace);
|
||||
}
|
||||
|
||||
/** Handle sort cards */
|
||||
function handleSortCards(event)
|
||||
{
|
||||
var newLaneID = event.element.closest('.kanban-lane').data('id');
|
||||
var newColID = event.element.closest('.kanban-col').data('id');
|
||||
var orders = [];
|
||||
event.list.each(function(_, item){orders.push(item.item.data('id'));});
|
||||
var url = createLink('kanban', 'sortCard', 'kanbanID=' + kanbanID + '&laneID=' + newLaneID + '&columnID=' + newColID + '&cards=' + orders.join(','));
|
||||
|
||||
$.getJSON(url, function(response)
|
||||
{
|
||||
if(response.result === 'fail')
|
||||
{
|
||||
if(typeof response.message === 'string' && response.message.length)
|
||||
{
|
||||
bootbox.alert(response.message);
|
||||
}
|
||||
setTimeout(function(){return location.reload()}, 3000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* Define menu creators */
|
||||
window.menuCreators =
|
||||
{
|
||||
@@ -1228,12 +1247,13 @@ function initKanban($kanban)
|
||||
onRenderLaneName: renderLaneName,
|
||||
onRenderHeaderCol: renderHeaderCol,
|
||||
onRenderCount: renderCount,
|
||||
sortable: handleSortCards,
|
||||
droppable:
|
||||
{
|
||||
target: findDropColumns,
|
||||
finish: handleFinishDrop,
|
||||
mouseButton: 'left'
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
$kanban.on('click', '.action-cancel', hideKanbanAction);
|
||||
@@ -1354,7 +1374,6 @@ $(function()
|
||||
$('.color0 .cardcolor').css('border', '1px solid #fff');
|
||||
});
|
||||
|
||||
|
||||
/* Init sortable */
|
||||
initSortable();
|
||||
|
||||
@@ -1364,31 +1383,30 @@ $(function()
|
||||
function initSortable()
|
||||
{
|
||||
var sortType = '';
|
||||
var oldLaneID = '';
|
||||
var oldColID = '';
|
||||
var $cards = null;
|
||||
$('#kanban').sortable(
|
||||
{
|
||||
selector: '.region, .kanban-board, .kanban-lane, .kanban-item.sort, .kanban-col',
|
||||
trigger: '.region.sort > .region-header, .kanban-board.sort > .kanban-header > .kanban-group-header, .kanban-lane.sort > .kanban-lane-name, .kanban-item.sort, .kanban-header-col.sort',
|
||||
selector: '.region, .kanban-board, .kanban-lane, .kanban-col',
|
||||
trigger: '.region.sort > .region-header, .kanban-board.sort > .kanban-header > .kanban-group-header, .kanban-lane.sort > .kanban-lane-name, .kanban-header-col.sort',
|
||||
container: function($ele)
|
||||
{
|
||||
return $ele.parent();
|
||||
},
|
||||
targetSelector: function($ele)
|
||||
{
|
||||
var $parent = $ele.parent();
|
||||
/* Sort regions. */
|
||||
if($ele.hasClass('region'))
|
||||
{
|
||||
sortType = 'region';
|
||||
return $ele.parent().children('.region');
|
||||
return $parent.children('.region');
|
||||
}
|
||||
|
||||
/* Sort boards. */
|
||||
if($ele.hasClass('kanban-board'))
|
||||
{
|
||||
sortType = 'board';
|
||||
return $ele.parent().children('.kanban-board');
|
||||
return $parent.children('.kanban-board');
|
||||
}
|
||||
|
||||
/* Sort lanes. */
|
||||
@@ -1397,23 +1415,19 @@ function initSortable()
|
||||
sortType = 'lane';
|
||||
$cards = $ele.find('.kanban-item');
|
||||
|
||||
return $ele.parent().children('.kanban-lane');
|
||||
return $parent.children('.kanban-lane');
|
||||
}
|
||||
|
||||
/* Sort columns. */
|
||||
if($ele.hasClass('kanban-col'))
|
||||
{
|
||||
sortType = 'column';
|
||||
return $ele.parent().children('.kanban-col');
|
||||
}
|
||||
|
||||
/* Sort cards. */
|
||||
if($ele.hasClass('kanban-item'))
|
||||
{
|
||||
sortType = 'card';
|
||||
return $ele.parent().children('.kanban-item');
|
||||
return $parent.children('.kanban-col');
|
||||
}
|
||||
},
|
||||
before: function() {
|
||||
return !window.sortableDisabled;
|
||||
},
|
||||
start: function(e)
|
||||
{
|
||||
if(sortType == 'region')
|
||||
@@ -1428,17 +1442,11 @@ function initSortable()
|
||||
$('.region').find('.kanban').hide();
|
||||
hideKanbanAction();
|
||||
}
|
||||
|
||||
if(sortType == 'column')
|
||||
else if(sortType === 'column')
|
||||
{
|
||||
$('.kanban-item').addClass('hidden');
|
||||
}
|
||||
|
||||
if(sortType == 'card')
|
||||
{
|
||||
oldLaneID = e.element.closest('.kanban-lane').data('id');
|
||||
oldColID = e.element.closest('.kanban-col').data('id');
|
||||
e.element.closest('.kanban-board').addClass('kanban-cols-sorting');
|
||||
}
|
||||
$('#kanban').attr('data-sort-by', sortType);
|
||||
},
|
||||
finish: function(e)
|
||||
{
|
||||
@@ -1464,7 +1472,7 @@ function initSortable()
|
||||
|
||||
url = createLink('kanban', 'sortRegion', 'regions=' + orders.join(','));
|
||||
}
|
||||
if(sortType == 'board')
|
||||
else if(sortType == 'board')
|
||||
{
|
||||
regionID = e.element.closest('.region').data('id');
|
||||
e.list.each(function(index, data)
|
||||
@@ -1474,7 +1482,7 @@ function initSortable()
|
||||
|
||||
url = createLink('kanban', 'sortGroup', 'region=' + regionID + '&groups=' + orders.join(','));
|
||||
}
|
||||
if(sortType == 'lane')
|
||||
else if(sortType == 'lane')
|
||||
{
|
||||
var groupID = e.element.closest('.kanban-board').data('id');
|
||||
e.list.each(function(index, data)
|
||||
@@ -1485,7 +1493,7 @@ function initSortable()
|
||||
regionID = e.element.closest('.region').data('id');
|
||||
url = createLink('kanban', 'sortLane', 'region=' + regionID + '&lanes=' + orders.join(','));
|
||||
}
|
||||
if(sortType == 'column')
|
||||
else if(sortType == 'column')
|
||||
{
|
||||
var groupID = e.element.closest('.kanban-board').data('id');
|
||||
e.list.each(function(index, data)
|
||||
@@ -1496,35 +1504,28 @@ function initSortable()
|
||||
regionID = e.element.closest('.region').data('id');
|
||||
url = createLink('kanban', 'sortColumn', 'region=' + regionID + '&kanbanID=' + kanban.id + '&columns=' + orders.join(','));
|
||||
}
|
||||
if(sortType == 'card')
|
||||
{
|
||||
var newLaneID = e.element.closest('.kanban-lane').data('id');
|
||||
var newColID = e.element.closest('.kanban-col').data('id');
|
||||
e.list.each(function(index, data)
|
||||
{
|
||||
if(data.item.data('item') != undefined && data.item.data('item').column == newColID && data.item.data('item').lane == newLaneID) orders.push(data.item.data('item').id);
|
||||
});
|
||||
if(newLaneID == oldLaneID && newColID == oldColID && orders.length > 0) url = createLink('kanban', 'sortCard', 'kanbanID=' + kanbanID + '&laneID=' + newLaneID + '&columnID=' + newColID + '&cards=' + orders.join(','));
|
||||
}
|
||||
if(!url) return true;
|
||||
|
||||
$.getJSON(url, function(response)
|
||||
{
|
||||
if(response.result == 'fail' && response.message.length)
|
||||
if(response.result == 'fail')
|
||||
{
|
||||
bootbox.alert(response.message);
|
||||
if(typeof response.message === 'string' && response.message.length)
|
||||
{
|
||||
bootbox.alert(response.message);
|
||||
}
|
||||
setTimeout(function(){return location.reload()}, 3000);
|
||||
}
|
||||
else if (sortType == 'column')
|
||||
{
|
||||
updateRegion(regionID, response[regionID]);
|
||||
}
|
||||
$('.kanban-item').removeClass('hidden');
|
||||
});
|
||||
},
|
||||
always: function(e)
|
||||
{
|
||||
if(sortType == 'lane') $cards.show();
|
||||
$('#kanban').find('.kanban-cols-sorting').removeClass('kanban-cols-sorting');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2507,8 +2507,7 @@ class kanbanModel extends model
|
||||
$otherCardList = '';
|
||||
$otherLanes = $this->dao->select('t2.id, t2.cards')->from(TABLE_KANBANLANE)->alias('t1')
|
||||
->leftJoin(TABLE_KANBANCELL)->alias('t2')->on('t1.id=t2.lane')
|
||||
->where('t1.deleted')->eq(0)
|
||||
->andWhere('t1.id')->ne($lane->id)
|
||||
->where('t1.id')->ne($lane->id)
|
||||
->andWhere('t1.execution')->eq($executionID)
|
||||
->andWhere('t2.`type`')->eq($lane->type)
|
||||
->fetchPairs();
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if($card->progress):?>
|
||||
<?php if($kanban->performable):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->kanbancard->progress;?></th>
|
||||
<td>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
[lang^='en'] #archivedCards .card-actions > .btn {width: 55px;}
|
||||
#archivedCards .card-actions > .btn + .btn {margin-top: 10px;}
|
||||
#archivedCards .info > .time {background-color: rgba(0, 0, 0, 0.15);}
|
||||
#archivedCards .info > .users {padding-right: 10px;}
|
||||
#archivedCards .info > .users > span {display: inline-block; color: transparent; width: 2px; height: 2px; background-color: #8990a2; position:sticky; top: 3px; margin: 0 7px; border-radius: 50%; line-height: 32px;}
|
||||
#archivedCards .info > .users > span:before {left: -4px; content: ''; display: block; position: absolute; width: 2px; height: 2px; background-color: #8990a2; top: 0px; border-radius: 50%;}
|
||||
#archivedCards .info > .users > span:after {right: -4px; content: ''; display: block; position: absolute; width: 2px; height: 2px; background-color: #8990a2; top: 0px; border-radius: 50%;}
|
||||
@@ -40,6 +41,8 @@
|
||||
#archivedCards .card-item .has-color .info > .estimate,
|
||||
#archivedCards .card-item .has-color .info > .label-light {color: #FFFFFF;}
|
||||
#archivedCards .card-item .has-color .info > .label-pri {border-color: #FFFFFF;}
|
||||
#archivedCards .progress-box {width: 97%;}
|
||||
#performable {padding: 25px 10px !important;}
|
||||
</style>
|
||||
<div class='panel'>
|
||||
<div class='panel-heading text-center'>
|
||||
@@ -117,9 +120,17 @@
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php if($kanban->performable):?>
|
||||
<div class='progress-box'>
|
||||
<div class='progress'>
|
||||
<div class="progress-bar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo round($card->progress, 2) . '%';?>"></div>
|
||||
</div>
|
||||
<div class='progress-number'><?php echo round($card->progress, 2) . ' %';?></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-xs-2 card-actions'>
|
||||
<div class='col-xs-2 card-actions' <?php if($kanban->performable) echo "id='performable'";?>>
|
||||
<?php
|
||||
$canRestore = commonModel::hasPriv('kanban', 'restoreCard');
|
||||
$canDelete = commonModel::hasPriv('kanban', 'deleteCard');
|
||||
|
||||
@@ -44,11 +44,11 @@
|
||||
echo "<div class='divider'></div>";
|
||||
}
|
||||
|
||||
common::printLink('kanban', 'editCard', "cardID=$card->id", '<i class="icon icon-edit"></i>', '', "class='btn btn-link iframe' data-width='80%' title='{$lang->kanbancard->edit}'", true, true);
|
||||
common::printLink('kanban', 'editCard', "cardID=$card->id", '<i class="icon icon-edit"></i>', '', "class='btn btn-link' data-width='80%' title='{$lang->kanbancard->edit}'", true, true);
|
||||
|
||||
if($kanban->performable)
|
||||
{
|
||||
if($card->status == 'done') echo html::a(helper::createLink('kanban', 'activateCard', "cardID={$card->id}&kanbanID={$kanban->id}"), '<i class="icon icon-magic"></i>', '', "class='btn btn-link iframe' title='{$lang->kanban->activateCard}'");
|
||||
if($card->status == 'done') echo html::a(helper::createLink('kanban', 'activateCard', "cardID={$card->id}&kanbanID={$kanban->id}"), '<i class="icon icon-magic"></i>', '', "class='btn btn-link' title='{$lang->kanban->activateCard}'");
|
||||
if($card->status == 'doing') echo html::a(helper::createLink('kanban', 'finishCard', "cardID={$card->id}&kanbanID={$kanban->id}"), '<i class="icon icon-checked"></i>', '', "class='btn btn-link iframe' title='{$lang->kanban->finishCard}'");
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
<th><?php echo $lang->kanbancard->estimate;?></th>
|
||||
<td><?php echo round($card->estimate, 2) . ' ' . $lang->kanbancard->lblHour;?></td>
|
||||
</tr>
|
||||
<?php if($card->progress):?>
|
||||
<?php if($kanban->performable):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->kanbancard->progress;?></th>
|
||||
<td><?php echo round($card->progress, 2) . ' %';?></td>
|
||||
|
||||
@@ -449,7 +449,7 @@ class productplanModel extends model
|
||||
$stories = $this->dao->select('*')->from(TABLE_STORY)->where("CONCAT(',', plan, ',')")->like("%,{$plan->parent},%")->fetchAll('id');
|
||||
foreach($stories as $storyID => $story)
|
||||
{
|
||||
$storyPlan = str_replace(",{$plan->parent},", ",$planID,", ",$storyPlan,");
|
||||
$storyPlan = str_replace(",{$plan->parent},", ",$planID,", ",$story->plan,");
|
||||
$storyPlan = trim($storyPlan, ',');
|
||||
|
||||
$this->dao->update(TABLE_STORY)->set('plan')->eq($storyPlan)->where('id')->eq($storyID)->exec();
|
||||
|
||||
@@ -167,7 +167,7 @@ $lang->project->typeList['other'] = '其他项目';
|
||||
|
||||
$lang->project->waitProjects = '未开始的项目';
|
||||
$lang->project->doingProjects = '进行中的项目';
|
||||
$lang->project->doingExecutions = '进行中的执行';
|
||||
$lang->project->doingExecutions = '进行中的执行(最近1个)';
|
||||
$lang->project->closedProjects = '已关闭的项目(最近2个)';
|
||||
$lang->project->noProgram = '无项目集归属项目';
|
||||
|
||||
|
||||
@@ -70,15 +70,22 @@ class stakeholder extends control
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate));
|
||||
}
|
||||
|
||||
$members = array();
|
||||
if($this->app->tab == 'program')
|
||||
{
|
||||
$this->loadModel('program')->setMenu($objectID);
|
||||
$this->view->members = $this->loadModel('program')->getTeamMemberPairs($objectID);
|
||||
$members = $this->loadModel('program')->getTeamMemberPairs($objectID);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->loadModel('project')->setMenu($objectID);
|
||||
$this->view->members = $this->loadModel('user')->getTeamMemberPairs($objectID, 'project');
|
||||
$members = $this->loadModel('user')->getTeamMemberPairs($objectID, 'project');
|
||||
}
|
||||
|
||||
$stakeholders = $this->loadModel('stakeholder')->getStakeHolderPairs($objectID);
|
||||
foreach($members as $account => $realname)
|
||||
{
|
||||
if(isset($stakeholders[$account])) unset($members[$account]);
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->stakeholder->create;
|
||||
@@ -86,6 +93,7 @@ class stakeholder extends control
|
||||
$this->view->companys = $this->loadModel('company')->getOutsideCompanies();
|
||||
$this->view->programID = $this->app->tab == 'program' ? $objectID : 0;
|
||||
$this->view->projectID = $this->app->tab == 'project' ? $objectID : 0;
|
||||
$this->view->members = $members;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -206,6 +214,12 @@ class stakeholder extends control
|
||||
{
|
||||
$members = $this->loadModel('user')->getTeamMemberPairs($projectID, 'project');
|
||||
}
|
||||
$stakeholders = $this->loadModel('stakeholder')->getStakeHolderPairs($programID ? $programID : $projectID);
|
||||
foreach($members as $account => $realname)
|
||||
{
|
||||
if(isset($stakeholders[$account])) unset($members[$account]);
|
||||
}
|
||||
|
||||
echo html::select('user', $members, $user, "class='form-control chosen'");
|
||||
}
|
||||
|
||||
@@ -229,8 +243,13 @@ class stakeholder extends control
|
||||
$members = $this->loadModel('user')->getTeamMemberPairs($projectID, 'project');
|
||||
}
|
||||
|
||||
$users = $this->loadModel('user')->getPairs('noclosed');
|
||||
$users = $this->loadModel('user')->getPairs('noclosed');
|
||||
$companyUsers = array('' => '') + array_diff($users, $members);
|
||||
$stakeholders = $this->loadModel('stakeholder')->getStakeHolderPairs($programID ? $programID : $projectID);
|
||||
foreach($companyUsers as $account => $realname)
|
||||
{
|
||||
if(isset($stakeholders[$account])) unset($companyUsers[$account]);
|
||||
}
|
||||
|
||||
echo html::select('user', $companyUsers, $user, "class='form-control chosen'");
|
||||
}
|
||||
@@ -241,9 +260,14 @@ class stakeholder extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetOutsideUser()
|
||||
public function ajaxGetOutsideUser($objectID = 0)
|
||||
{
|
||||
$users = $this->loadModel('user')->getPairs('noclosed|outside|noletter');
|
||||
$users = $this->loadModel('user')->getPairs('noclosed|outside|noletter');
|
||||
$stakeholders = $this->loadModel('stakeholder')->getStakeHolderPairs($objectID);
|
||||
foreach($users as $account => $realname)
|
||||
{
|
||||
if(isset($stakeholders[$account])) unset($users[$account]);
|
||||
}
|
||||
|
||||
echo html::select('user', $users, '', "class='form-control chosen' onchange=changeUser(this.value);");
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@ $(function()
|
||||
var link = createLink('stakeholder', 'ajaxGetMembers', 'user=&program=' + programID + '&projectID=' + projectID);
|
||||
$.post(link, function(data)
|
||||
{
|
||||
$('#user').replaceWith(data);
|
||||
$('#user').replaceWith(data);
|
||||
$('#user_chosen').remove();
|
||||
$('#user').chosen();
|
||||
$('#user').chosen();
|
||||
})
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ $(function()
|
||||
var link = createLink('stakeholder', 'ajaxGetCompanyUser', 'user=&programID=' + programID + '&projectID=' + projectID);
|
||||
$.post(link, function(data)
|
||||
{
|
||||
$('#user').replaceWith(data);
|
||||
$('#user').replaceWith(data);
|
||||
$('#user_chosen').remove();
|
||||
$('#user').chosen();
|
||||
$('#user').chosen();
|
||||
})
|
||||
}
|
||||
|
||||
@@ -32,19 +32,20 @@ $(function()
|
||||
{
|
||||
$('#user').closest('tr').find('.input-group-addon').removeClass('hidden');
|
||||
if($('input[name*=newUser]').prop('checked')) $('.user-info').removeClass('hidden');
|
||||
var link = createLink('stakeholder', 'ajaxGetOutsideUser');
|
||||
var objectID = programID ? programID : projectID;
|
||||
var link = createLink('stakeholder', 'ajaxGetOutsideUser', 'objectID=' + objectID);
|
||||
$.post(link, function(data)
|
||||
{
|
||||
$('#user').replaceWith(data);
|
||||
$('#user').replaceWith(data);
|
||||
$('#user_chosen').remove();
|
||||
$('#user').chosen();
|
||||
$('#user').chosen();
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
$("input[name='new[]']").change(function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
$('#company').replaceWith("<input name='company' id='company' class='form-control'/>");
|
||||
$('#company_chosen').remove();
|
||||
@@ -54,15 +55,15 @@ $(function()
|
||||
var link = createLink('company', 'ajaxGetOutsideCompany');
|
||||
$.post(link, function(data)
|
||||
{
|
||||
$('#company').replaceWith(data);
|
||||
$('#company').chosen();
|
||||
$('#company').replaceWith(data);
|
||||
$('#company').chosen();
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
$('input[name*=newUser]').change(function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
$('#user').attr('disabled', true).trigger("chosen:updated");
|
||||
$('.user-info').removeClass('hidden');
|
||||
|
||||
@@ -28,7 +28,7 @@ include '../../common/view/chart.html.php';
|
||||
<?php foreach($tasks as $key => $task):?>
|
||||
<tr class='text-center'>
|
||||
<td><?php echo $task->id;?></td>
|
||||
<td class='text-left' title="<?php echo $task->name?>"><?php echo $task->name;?></td>
|
||||
<td title="<?php echo $task->name?>"><?php echo $task->name;?></td>
|
||||
<td><span class='<?php echo 'pri' . zget($lang->task->priList, $task->pri, $task->pri)?>'><?php echo $task->pri == '0' ? '' : zget($lang->task->priList, $task->pri, $task->pri);?></span></td>
|
||||
<td><?php echo $this->processStatus('task', $task);?></td>
|
||||
<td><?php echo zget($users, $task->assignedTo, $task->assignedTo);?></td>
|
||||
|
||||
@@ -486,7 +486,7 @@
|
||||
$class = isonlybody() ? 'showinonlybody' : 'iframe';
|
||||
echo "<li title='$task->name'>" . html::a($this->createLink('task', 'view', "taskID=$task->id", '', true), $taskInfo, '', "class=$class data-width='80%'");
|
||||
$execution = isset($story->executions[$task->execution]) ? $story->executions[$task->execution] : '';
|
||||
$execName = (isset($execution->type) and $execution->type == 'kanban' and isonlybody()) ? $executionName : html::a($this->createLink('execution', 'view', "executionID=$executionID"), $executionName, '', "class='text-muted'");
|
||||
$execName = (isset($execution->type) and $execution->type == 'kanban' and isonlybody()) ? $executionName : html::a($this->createLink('execution', 'view', "executionID=$task->execution"), $executionName, '', "class='text-muted'");
|
||||
echo $execName . '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<?php foreach($stories as $story):?>
|
||||
<tr>
|
||||
<td><?php echo sprintf('%03d', $story->id) . html::hidden('stories[]', $story->id)?></td>
|
||||
<td><span class='label-pri lable-pri-<?php echo $story->pri?>' title='<?php echo zget($lang->story->priList, $story->pri);?>'><?php echo zget($lang->story->priList, $story->pri);?></span></td>
|
||||
<td><span class='label-pri label-pri-<?php echo $story->pri?>' title='<?php echo zget($lang->story->priList, $story->pri);?>'><?php echo zget($lang->story->priList, $story->pri);?></span></td>
|
||||
<td class='text-left c-name' title='<?php echo $story->title?>'><?php echo html::a($sysURL . $this->createLink('story', 'view', "storyID=$story->id", '', true), $story->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?></td>
|
||||
<td><?php echo zget($users, $story->openedBy);?></td>
|
||||
<td><?php echo zget($users, $story->assignedTo);?></td>
|
||||
|
||||
@@ -127,6 +127,8 @@ class tutorial extends control
|
||||
if(($module == 'story' or $module == 'task' or $module == 'bug') and $method == 'create') $target = 'self';
|
||||
if($module == 'execution' and $method == 'linkStory') $target = 'self';
|
||||
if($module == 'execution' and $method == 'managemembers') $target = 'self';
|
||||
|
||||
if(helper::isAjaxRequest()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => helper::createLink('tutorial', 'wizard', "module=$module&method=$method¶ms=" . helper::safe64Encode($params))));
|
||||
return print(js::locate(helper::createLink('tutorial', 'wizard', "module=$module&method=$method¶ms=" . helper::safe64Encode($params)), $target));
|
||||
}
|
||||
echo $this->fetch($module, $method, $params);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
body {background: #f1f1f1; padding: 0;}
|
||||
.container {padding: 0;}
|
||||
.modal-dialog {width: 800px;}
|
||||
.modal-dialog {width: 800px; margin-top: 20px;}
|
||||
.modal-footer {text-align: center; margin-top: 0;}
|
||||
|
||||
.table,.alert {margin: 0;}
|
||||
|
||||
@@ -1260,7 +1260,7 @@ class upgradeModel extends model
|
||||
if(file_exists($fullPath))
|
||||
{
|
||||
$isDir = is_dir($fullPath);
|
||||
if(($isDir and !$zfile->removeDir($fullPath)) or
|
||||
if(!is_writable($fullPath) or ($isDir and !$zfile->removeDir($fullPath)) or
|
||||
(!$isDir and !$zfile->removeFile($fullPath)))
|
||||
{
|
||||
$result[] = 'rm -f ' . ($isDir ? '-r ' : '') . $fullPath;
|
||||
@@ -3774,7 +3774,7 @@ class upgradeModel extends model
|
||||
|
||||
$this->dao->update(TABLE_CONFIG)->set('module')->eq('common')->set('section')->eq('xuanxuan')->where('id')->eq($keyID)->exec();
|
||||
$this->saveLogs($this->dao->get());
|
||||
$this->setting->setItem('system.common.xuanxuan.turnon', '1');
|
||||
$this->setting->setItem('system.common.xuanxuan.turnon', '0');
|
||||
$this->setting->setItem('system.common.xxserver.noticed', '1');
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ class userModel extends model
|
||||
}
|
||||
else
|
||||
{
|
||||
$firstLetter = ucfirst(substr($user->account, 0, 1)) . ':';
|
||||
$firstLetter = ucfirst(mb_substr($user->account, 0, 1)) . ':';
|
||||
if(strpos($params, 'noletter') !== false or !empty($this->config->isINT)) $firstLetter = '';
|
||||
$users[$account] = $firstLetter . (($user->deleted and strpos($params, 'realname') === false) ? $user->account : ($user->realname ? $user->realname : $user->account));
|
||||
}
|
||||
|
||||
+99
-33
@@ -209,6 +209,14 @@ class deptTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* function getAllChildId test by dept
|
||||
*
|
||||
* @param string $deptID
|
||||
* @param string $count
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getAllChildIdTest($deptID, $count)
|
||||
{
|
||||
$objects = $this->objectModel->getAllChildId($deptID);
|
||||
@@ -219,74 +227,132 @@ class deptTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getParentsTest($deptID)
|
||||
/**
|
||||
* function getParents test by dept
|
||||
*
|
||||
* @param string $deptID
|
||||
* @param string $count
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getParentsTest($deptID, $count)
|
||||
{
|
||||
$objects = $this->objectModel->getParents($deptID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
if($count == '1') return count($objects);
|
||||
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* function updateOrder test by dept
|
||||
*
|
||||
* @param array $orders
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function updateOrderTest($orders)
|
||||
{
|
||||
global $tester;
|
||||
|
||||
$objects = $this->objectModel->updateOrder($orders);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$objects = $tester->dao->select('*')->from(TABLE_DEPT)->where('id')->eq($orders[0])->fetchAll('id');
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function manageChildTest($parentDeptID, $childs)
|
||||
/**
|
||||
* function manageChild test by dept
|
||||
*
|
||||
* @param string $parentDeptID
|
||||
* @param array $childs
|
||||
* @param string $count
|
||||
* @access public
|
||||
* @return arrray
|
||||
*/
|
||||
public function manageChildTest($parentDeptID, $childs, $count)
|
||||
{
|
||||
$objects = $this->objectModel->manageChild($parentDeptID, $childs);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
if($count == '1') return count($objects);
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getUsersTest($browseType = 'inside', $deptID = 0, $pager = null, $orderBy = 'id')
|
||||
/**
|
||||
* function getUsers test by dept
|
||||
*
|
||||
* @param string $browseType
|
||||
* @param string $deptID
|
||||
* @param string $count
|
||||
* @param string $orderBy
|
||||
* @param null $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUsersTest($browseType = 'inside', $deptID = 0, $count, $orderBy = 'id', $pager = null)
|
||||
{
|
||||
$objects = $this->objectModel->getUsers($browseType = 'inside', $deptID = 0, $pager = null, $orderBy = 'id');
|
||||
$objects = $this->objectModel->getUsers($browseType, $deptID, $pager, $orderBy);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
if($count == '1') return count($objects);
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* function getDeptUserPairs test by dept
|
||||
*
|
||||
* @param int $deptID
|
||||
* @param int $count
|
||||
* @param string $key
|
||||
* @param string $type
|
||||
* @param string $params
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDeptUserPairsTest($deptID = 0, $count, $key = 'account', $type = 'inside', $params = '')
|
||||
{
|
||||
$objects = $this->objectModel->getDeptUserPairs($deptID, $key, $type, $params);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
if($count == '1') return count($objects);
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* function delete test by dept
|
||||
*
|
||||
* @param int $deptID
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function deleteTest($deptID)
|
||||
{
|
||||
global $tester;
|
||||
|
||||
$this->objectModel->delete($deptID);
|
||||
|
||||
$objects = $tester->dao->select('*')->from(TABLE_DEPT)->fetchAll();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
return count($objects);
|
||||
}
|
||||
|
||||
public function getDeptUserPairsTest($deptID = 0, $key = 'account', $type = 'inside', $params = '')
|
||||
{
|
||||
$objects = $this->objectModel->getDeptUserPairs($deptID = 0, $key = 'account', $type = 'inside', $params = '');
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function deleteTest($deptID, $null = null)
|
||||
{
|
||||
$objects = $this->objectModel->delete($deptID, $null = null);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function fixDeptPathTest()
|
||||
{
|
||||
$objects = $this->objectModel->fixDeptPath();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getDataStructureTest()
|
||||
public function getDataStructureTest($count)
|
||||
{
|
||||
$objects = $this->objectModel->getDataStructure();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
if($count == '1') return count($objects);
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
+32
-16
@@ -210,28 +210,35 @@ class storyTest
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
global $tester;
|
||||
return $tester->loadModel('story')->getById($storyID);
|
||||
}
|
||||
|
||||
public function updateStoryVersionTest($story)
|
||||
{
|
||||
$objects = $this->objectModel->updateStoryVersion($story);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
return $this->objectModel->getById($storyID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update story order of plan.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @param string $planIDList
|
||||
* @param string $oldPlanIDList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function updateStoryOrderOfPlanTest($storyID, $planIDList = '', $oldPlanIDList = '')
|
||||
{
|
||||
$objects = $this->objectModel->updateStoryOrderOfPlan($storyID, $planIDList = '', $oldPlanIDList = '');
|
||||
$this->objectModel->updateStoryOrderOfPlan($storyID, $planIDList, $oldPlanIDList);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
global $tester;
|
||||
return $tester->dao->select('*')->from(TABLE_PLANSTORY)->where('plan')->in($planIDList)->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test compute estimate.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function computeEstimateTest($storyID)
|
||||
{
|
||||
$objects = $this->objectModel->computeEstimate($storyID);
|
||||
@@ -241,13 +248,22 @@ class storyTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function batchUpdateTest()
|
||||
/**
|
||||
* Test batch update stories.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchUpdateTest($params)
|
||||
{
|
||||
$objects = $this->objectModel->batchUpdate();
|
||||
$_POST = $params;
|
||||
$allStories = $this->objectModel->batchUpdate();
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$storyIdList = array_keys($allStories);
|
||||
return $this->objectModel->getByList($storyIdList);
|
||||
}
|
||||
|
||||
public function reviewTest($storyID)
|
||||
|
||||
Executable
+362
@@ -0,0 +1,362 @@
|
||||
<?php
|
||||
class todoTest
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
global $tester;
|
||||
$this->objectModel = $tester->loadModel('todo');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test create a todo.
|
||||
*
|
||||
* @param string $account
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function createTest($account, $param = array())
|
||||
{
|
||||
$config = array('day' => '', 'specify' => array('month' => 0, 'day' => 1), 'type' => 'day', 'beforeDays' => 0, 'end' => '');
|
||||
if(isset($param->date)) $param->date = $param->date == 'today' ? date('Y-m-d',time()) : date('Y-m-d',strtotime('+3 days'));
|
||||
|
||||
$createFields['config'] = $config;
|
||||
$createFields['type'] = 'custom';
|
||||
$createFields['name'] = '';
|
||||
$createFields['pri'] = 3;
|
||||
$createFields['desc'] = '';
|
||||
$createFields['status'] = 'wait';
|
||||
$createFields['begin'] = '0830';
|
||||
$createFields['end'] = '0900';
|
||||
|
||||
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
|
||||
|
||||
foreach($param as $key => $value) $_POST[$key] = $value;
|
||||
|
||||
$objectID = $this->objectModel->create(date('Y').date('m'), $account);
|
||||
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return array_values(dao::getError())[0][0];
|
||||
|
||||
$object = $objectID ? $this->objectModel->getByID($objectID) : 0;
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test batch create todos.
|
||||
*
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function batchCreateTest($param = array())
|
||||
{
|
||||
$createFields['date'] = date('Y-m-d',time());
|
||||
|
||||
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
|
||||
|
||||
foreach($param as $key => $value) $_POST[$key] = $value;
|
||||
|
||||
$objects = $this->objectModel->batchCreate();
|
||||
|
||||
$todos = $this->objectModel->getByList($objects);
|
||||
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $todos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update a todo.
|
||||
*
|
||||
* @param int $todoID
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function updateTest($todoID, $param)
|
||||
{
|
||||
global $tester;
|
||||
$object = $tester->dbh->query("SELECT * FROM " . TABLE_TODO ." WHERE id = $todoID")->fetch();
|
||||
|
||||
foreach($object as $field => $value)
|
||||
{
|
||||
if(in_array($field, array_keys($param)))
|
||||
{
|
||||
$_POST[$field] = $param[$field];
|
||||
}
|
||||
else
|
||||
{
|
||||
$_POST[$field] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$change = $this->objectModel->update($todoID);
|
||||
if($change == array()) $change = '没有数据更新';
|
||||
|
||||
unset($_POST);
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $change;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test batch update todos.
|
||||
*
|
||||
* @param array $param
|
||||
* @param int $todoID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function batchUpdateTest($param, $todoID)
|
||||
{
|
||||
$todoIDList = array('1' => '1', '2' => '2', '3' => '3');
|
||||
$dates = array('1' => date('Y-m-d',strtotime('+1 month')), '2' => date('Y-m-d',strtotime('-1 month +1 day')), '3' => date('Y-m-d',strtotime('-1 month +2 day')));
|
||||
$types = array('1' => 'custom', '2' => 'bug', '3' => 'task');
|
||||
$pris = array('1' => '1', '2' => '2', '3' => '3');
|
||||
$names = array('1' => '自定义1的待办', '2' => 'BUG2的待办', '3' => '任务3的待办');
|
||||
$descs = array('1' => '这是一个待办的描述1', '2' => '这是一个待办的描述2', '3' => '这是一个待办的描述3');
|
||||
$begins = array('1' => '1000', '2' => '1002', '3' => '1004');
|
||||
$ends = array('1' => '1400', '2' => '1402', '3' => '1404');
|
||||
$status = array('1' => 'wait', '2' => 'doing', '3' => 'done');
|
||||
|
||||
$batchUpdateFields['todoIDList'] = $todoIDList;
|
||||
$batchUpdateFields['dates'] = $dates;
|
||||
$batchUpdateFields['types'] = $types;
|
||||
$batchUpdateFields['pris'] = $pris;
|
||||
$batchUpdateFields['names'] = $names;
|
||||
$batchUpdateFields['descs'] = $descs;
|
||||
$batchUpdateFields['begins'] = $begins;
|
||||
$batchUpdateFields['ends'] = $ends;
|
||||
$batchUpdateFields['status'] = $status;
|
||||
|
||||
foreach($batchUpdateFields as $field => $value) $_POST[$field] = $value;
|
||||
|
||||
foreach($param as $key => $value) $_POST[$key] = $value;
|
||||
|
||||
$changes = $this->objectModel->batchUpdate();
|
||||
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $changes[$todoID];
|
||||
}
|
||||
|
||||
/**
|
||||
* Test start a todo.
|
||||
*
|
||||
* @param int $todoID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function startTest($todoID)
|
||||
{
|
||||
$this->objectModel->start($todoID);
|
||||
$object = $this->objectModel->getByID($todoID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test finish a todo.
|
||||
*
|
||||
* @param int $todoID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function finishTest($todoID)
|
||||
{
|
||||
$this->objectModel->finish($todoID);
|
||||
$object = $this->objectModel->getByID($todoID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get info of a todo.
|
||||
*
|
||||
* @param int $todoID
|
||||
* @param bool $setImgSize
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getByIdTest($todoID, $setImgSize = false)
|
||||
{
|
||||
$object = $this->objectModel->getById($todoID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get todo list of a user.
|
||||
*
|
||||
* @param string $type
|
||||
* @param string $account
|
||||
* @param string $status
|
||||
* @param int $limit
|
||||
* @param mixed $pager
|
||||
* @param string $orderBy
|
||||
* @param status $status
|
||||
* @param begin" $begin"
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getListTest($type = 'today', $account = '', $status = 'all', $limit = 0, $pager = null, $orderBy = "date, status, begin")
|
||||
{
|
||||
$objects = $this->objectModel->getList($type, $account, $status, $limit, $pager, $orderBy);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return count($objects);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get todo by id list.
|
||||
*
|
||||
* @parami array $todoIDList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getByListTest($todoIDList = 0)
|
||||
{
|
||||
$objects = $this->objectModel->getByList($todoIDList);
|
||||
|
||||
$name = '';
|
||||
foreach($objects as $todo) $name .= ',' . $todo->name;
|
||||
$name = trim($name, ',');
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* isClickableTest
|
||||
*
|
||||
* @param object $todo
|
||||
* @param string $action
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function isClickableTest($todo, $action)
|
||||
{
|
||||
$object = $this->objectModel->isClickable($todo, $action);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $object ? 1 : 2;
|
||||
}
|
||||
|
||||
public function createByCycleTest($todo)
|
||||
{
|
||||
$todo->cycle = '1';
|
||||
$todo->type = 'cycle';
|
||||
$todo->pri = 3;
|
||||
$todo->desc = '';
|
||||
$todo->status = 'wait';
|
||||
$todo->begin = '0830';
|
||||
$todo->end = '0900';
|
||||
$todo->account = 'admin';
|
||||
$todo->idvalue = '0';
|
||||
$todo->vision = 'rnd';
|
||||
$todo->assignedTo = 'admin';
|
||||
$todo->assignedBy = 'admin';
|
||||
$todo->assignedDate = date('Y-m-d', time());
|
||||
$todo->date = date('Y-m-d', time());
|
||||
|
||||
$todo->config = str_replace('2022-03-23', date('Y-m-d', time()), $todo->config);
|
||||
|
||||
$this->objectModel->createByCycle(array('1' => $todo));
|
||||
|
||||
global $tester;
|
||||
$objects = $tester->dao->select('id')->from(TABLE_TODO)->where('idvalue')->eq('100001')->andWhere('name')->eq($todo->name)->andWhere('config')->eq($todo->config)->andWhere('deleted')->eq('0')->fetchAll();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return count($objects);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test activate todo.
|
||||
*
|
||||
* @param int $todoID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function activateTest($todoID)
|
||||
{
|
||||
$this->objectModel->activate($todoID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$object = $this->objectModel->getById($todoID);
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test close a todo.
|
||||
*
|
||||
* @param int $todoID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function closeTest($todoID)
|
||||
{
|
||||
$this->objectModel->close($todoID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$object = $this->objectModel->getById($todoID);
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test assign todo.
|
||||
*
|
||||
* @param int $todoID
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function assignToTest($todoID, $param = array())
|
||||
{
|
||||
foreach($param as $key => $value) $_POST[$key] = $value;
|
||||
|
||||
if(!isset($_POST['future']) and !isset($_POST['date'])) $_POST['date'] = date('Y-m-d', time());
|
||||
|
||||
$this->objectModel->assignTo($todoID);
|
||||
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$object = $this->objectModel->getById($todoID);
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get todo count.
|
||||
*
|
||||
* @param string $account
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function getCountTest($account = '')
|
||||
{
|
||||
$count = $this->objectModel->getCount($account);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,283 @@
|
||||
title: table zt_story
|
||||
desc: "需求"
|
||||
author: automated export
|
||||
version: "1.0"
|
||||
fields:
|
||||
- field: id
|
||||
range: 401-10000
|
||||
- field: parent
|
||||
note: "父需求ID"
|
||||
range: 351-400
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: product
|
||||
note: "所属产品"
|
||||
range: 88{2},89-100{4}
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: branch
|
||||
note: "分支/平台"
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: module
|
||||
note: "所属模块"
|
||||
range: 2171-10000
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: plan
|
||||
note: "所属计划"
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: source
|
||||
note: "需求来源"
|
||||
range: customer,user,po,market,service,operation,support,competitor,partner,dev,tester,bug,forum,other
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: sourceNote
|
||||
note: "来源备注"
|
||||
range: 1-10000
|
||||
prefix: "这里是需求来源备注"
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: fromBug
|
||||
note: "来源Bug"
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: title
|
||||
note: "需求名称"
|
||||
fields:
|
||||
- field: field1
|
||||
range: [用户子需求,软件子需求]
|
||||
- field: field2
|
||||
range: 1-10000
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: keywords
|
||||
note: "关键词"
|
||||
range: 1-10000
|
||||
prefix: "关键词"
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: type
|
||||
note: "需求类型"
|
||||
range: requirement,story
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: pri
|
||||
note: "优先级"
|
||||
range: 1-4
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: estimate
|
||||
note: "预计工时"
|
||||
range: 0-20:2
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: status
|
||||
note: "当前状态"
|
||||
range: draft,active,closed,changed
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: subStatus
|
||||
note: "子状态"
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: color
|
||||
note: "标题颜色"
|
||||
from: common.color.v1.yaml
|
||||
use: color
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: stage
|
||||
note: "所处阶段"
|
||||
range: wait,planned,projected,developing,developed,testing,tested,verified,released,closed
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: stagedBy
|
||||
note: "设置阶段者"
|
||||
from: common.user.v1.yaml
|
||||
use: user
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: mailto
|
||||
note: "抄送给"
|
||||
from: common.user.v1.yaml
|
||||
use: user
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: openedBy
|
||||
note: "由谁创建"
|
||||
from: common.user.v1.yaml
|
||||
use: user
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: openedDate
|
||||
note: "创建日期"
|
||||
from: common.date.v1.yaml
|
||||
use: dateA
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: assignedTo
|
||||
note: "指派给"
|
||||
from: common.user.v1.yaml
|
||||
use: user
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: assignedDate
|
||||
note: "指派日期"
|
||||
from: common.date.v1.yaml
|
||||
use: dateA
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: lastEditedBy
|
||||
note: "最后修改者"
|
||||
from: common.user.v1.yaml
|
||||
use: user
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: lastEditedDate
|
||||
note: "最后修改日期"
|
||||
from: common.date.v1.yaml
|
||||
use: dateA
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: reviewedBy
|
||||
note: "评审者"
|
||||
from: common.user.v1.yaml
|
||||
use: user
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: reviewedDate
|
||||
note: "评审日期"
|
||||
from: common.date.v1.yaml
|
||||
use: dateA
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: closedBy
|
||||
note: "关闭者"
|
||||
from: common.user.v1.yaml
|
||||
use: user
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: closedDate
|
||||
note: "关闭日期"
|
||||
from: common.date.v1.yaml
|
||||
use: dateA
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: closedReason
|
||||
note: "关闭原因"
|
||||
range: done,subdivided,duplicate,postponed,willnotdo,cancel,bydesign
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: toBug
|
||||
note: "转Bug"
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: childStories
|
||||
note: "细分需求"
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: linkStories
|
||||
note: "相关需求"
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: duplicateStory
|
||||
note: "重复需求ID"
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: version
|
||||
note: "版本号"
|
||||
range: 1{50}
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: URChanged
|
||||
note: "用户需求变更"
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: deleted
|
||||
note: "是否删除"
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
@@ -5,14 +5,14 @@ version: "1.0"
|
||||
fields:
|
||||
- field: story
|
||||
note: "需求ID"
|
||||
range: 1-20
|
||||
range: 1-30
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: version
|
||||
note: "版本"
|
||||
range: 1{20},2{20},3{20}
|
||||
range: 1{30},2{30},3{20}
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
|
||||
+6
-5
@@ -23,10 +23,11 @@ fields:
|
||||
format: ""
|
||||
- field: date
|
||||
note: "日期"
|
||||
range: "(M)-(w)"
|
||||
type: timestamp
|
||||
prefix: "DateTime"
|
||||
range: "(-1M)-(+1w):-1D"
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
type: timestamp
|
||||
format: "YY/MM/DD"
|
||||
- field: begin
|
||||
note: "开始"
|
||||
@@ -125,9 +126,9 @@ fields:
|
||||
note: "指派日期"
|
||||
range: "(M)-(w):60m"
|
||||
type: timestamp
|
||||
prefix: "DateTime"
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
format: "YY/MM/DD hh:mm:ss"
|
||||
format: "YY-MM-DD hh:mm:ss"
|
||||
- field: finishedBy
|
||||
note: "由谁完成"
|
||||
from: common.user.v1.yaml
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
title: table zt_todo
|
||||
desc: "待办"
|
||||
author: ly
|
||||
version: "1.0"
|
||||
fields:
|
||||
- field: id
|
||||
note: "ID"
|
||||
range: 2001-10000
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: account
|
||||
note: "用户名"
|
||||
range: admin
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: date
|
||||
note: "日期"
|
||||
range: "(M)-(w)"
|
||||
type: timestamp
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
format: "YY-MM-DD"
|
||||
- field: begin
|
||||
note: "开始"
|
||||
range: "1000-1059:2"
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: end
|
||||
note: "结束"
|
||||
range: "1400-1459:2"
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: type
|
||||
note: "类型"
|
||||
range: cycle
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
- field: cycle
|
||||
note: "周期"
|
||||
range: 1,0
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
- field: idvalue
|
||||
note: "关联编号"
|
||||
range: 0,2001,0,2003,0
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: pri
|
||||
note: "优先级"
|
||||
range: 3
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: name
|
||||
note: "待办名称"
|
||||
range: 天周期{2},周周期{2},月周期
|
||||
prefix: ""
|
||||
postfix: "待办"
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: desc
|
||||
note: "描述"
|
||||
range: 1-10000
|
||||
prefix: "这是一个待办的描述"
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: status
|
||||
note: "状态"
|
||||
range: wait
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: private
|
||||
note: "私人事务"
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: config
|
||||
note: "配置"
|
||||
range: ""
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
format: ""
|
||||
- field: assignedTo
|
||||
note: "指派给"
|
||||
range: admin
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
format: ""
|
||||
- field: assignedBy
|
||||
note: "由谁指派"
|
||||
range: admin
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
format: ""
|
||||
- field: assignedDate
|
||||
note: "指派日期"
|
||||
range: "(M)-(w):60m"
|
||||
type: timestamp
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
format: "YY/MM/DD hh:mm:ss"
|
||||
- field: finishedBy
|
||||
note: "由谁完成"
|
||||
from: common.user.v1.yaml
|
||||
use: user
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: finishedDate
|
||||
note: "完成时间"
|
||||
from: common.date.v1.yaml
|
||||
use: dateA
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: closedBy
|
||||
note: "由谁关闭"
|
||||
from: common.user.v1.yaml
|
||||
use: user
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: closedDate
|
||||
note: "关闭时间"
|
||||
from: common.date.v1.yaml
|
||||
use: dateA
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
@@ -4,6 +4,7 @@ $builder = new stdclass();
|
||||
$builder->company = array('rows' => 2, 'extends' => array('company'));
|
||||
$builder->user = array('rows' => 1000, 'extends' => array('user'));
|
||||
$builder->todo = array('rows' => 2000, 'extends' => array('todo'));
|
||||
$builder->todocycle = array('rows' => 5, 'extends' => array('todo','todocycle'));
|
||||
$builder->effort = array('rows' => 100, 'extends' => array('effort'));
|
||||
$builder->usergroup = array('rows' => 600, 'extends' => array('usergroup'));
|
||||
$builder->usercontact = array('rows' => 61, 'extends' => array('usercontact'));
|
||||
@@ -16,9 +17,10 @@ $builder->project = array('rows' => 90, 'extends' => array('project', 'pro
|
||||
$builder->sprint = array('rows' => 600, 'extends' => array('project', 'execution'));
|
||||
|
||||
$builder->story = array('rows' => 400, 'extends' => array('story'));
|
||||
$builder->childstory = array('rows' => 50, 'extends' => array('story','childstory'));
|
||||
$builder->storymodule = array('rows' => 800, 'extends' => array('module','storymodule'));
|
||||
$builder->storyplan = array('rows' => 400, 'extends' => array('planstory'));
|
||||
$builder->storyspec = array('rows' => 60, 'extends' => array('storyspec'));
|
||||
$builder->storyspec = array('rows' => 80, 'extends' => array('storyspec'));
|
||||
$builder->relation = array('rows' => 12, 'extends' => array('relation'));
|
||||
$builder->task = array('rows' => 600, 'extends' => array('task','task'));
|
||||
$builder->taskmore = array('rows' => 300, 'extends' => array('task','moretask'));
|
||||
|
||||
@@ -48,6 +48,7 @@ class Processor
|
||||
$this->initStory();
|
||||
$this->initBug();
|
||||
$this->initTest();
|
||||
$this->initTodo();
|
||||
|
||||
$this->dao->commit();
|
||||
}
|
||||
@@ -313,6 +314,22 @@ class Processor
|
||||
$this->dao->query("INSERT INTO `zt_userquery` (`id`, `account`, `module`, `title`, `form`, `sql`, `shortcut`) VALUES (3, 'admin', 'user', '用户测试条件', 'a:48:{s:13:\"fieldrealname\";s:0:\"\";s:10:\"fieldemail\";s:0:\"\";s:9:\"fielddept\";s:0:\"\";s:12:\"fieldaccount\";s:0:\"\";s:9:\"fieldrole\";s:0:\"\";s:10:\"fieldphone\";s:0:\"\";s:9:\"fieldjoin\";s:0:\"\";s:12:\"fieldvisions\";s:3:\"rnd\";s:7:\"fieldid\";s:0:\"\";s:13:\"fieldcommiter\";s:1:\"0\";s:11:\"fieldgender\";s:1:\"m\";s:7:\"fieldqq\";s:0:\"\";s:10:\"fieldskype\";s:0:\"\";s:13:\"fielddingding\";s:0:\"\";s:11:\"fieldweixin\";s:0:\"\";s:10:\"fieldslack\";s:0:\"\";s:13:\"fieldwhatsapp\";s:0:\"\";s:12:\"fieldaddress\";s:0:\"\";s:12:\"fieldzipcode\";s:0:\"\";s:6:\"andOr1\";s:3:\"AND\";s:6:\"field1\";s:8:\"realname\";s:9:\"operator1\";s:7:\"include\";s:6:\"value1\";s:9:\"白名单\";s:6:\"andOr2\";s:3:\"and\";s:6:\"field2\";s:5:\"email\";s:9:\"operator2\";s:7:\"include\";s:6:\"value2\";s:0:\"\";s:6:\"andOr3\";s:3:\"and\";s:6:\"field3\";s:4:\"dept\";s:9:\"operator3\";s:6:\"belong\";s:6:\"value3\";s:0:\"\";s:10:\"groupAndOr\";s:3:\"and\";s:6:\"andOr4\";s:3:\"AND\";s:6:\"field4\";s:7:\"account\";s:9:\"operator4\";s:7:\"include\";s:6:\"value4\";s:0:\"\";s:6:\"andOr5\";s:3:\"and\";s:6:\"field5\";s:4:\"role\";s:9:\"operator5\";s:1:\"=\";s:6:\"value5\";s:0:\"\";s:6:\"andOr6\";s:3:\"and\";s:6:\"field6\";s:5:\"phone\";s:9:\"operator6\";s:7:\"include\";s:6:\"value6\";s:0:\"\";s:6:\"module\";s:4:\"user\";s:9:\"actionURL\";s:74:\"/index.php?m=company&f=browse&browseType=all¶m=myQueryID&type=bysearch\";s:10:\"groupItems\";s:1:\"3\";s:8:\"formType\";s:4:\"lite\";}', '(( 1 AND `realname` LIKE \'%白名单%\' ) AND ( 1 ))', '0');");
|
||||
}
|
||||
|
||||
private function initTodo()
|
||||
{
|
||||
$toDay = date('y-m-d');
|
||||
$addDay = date('Y-m-d',strtotime("+1 day"));
|
||||
|
||||
$str = '{"day":"1","specify":{"month":"0","day":"1"},"type":"day","beforeDays":1,"end":"","begin":"'.$toDay.'"}';
|
||||
$str2 = '{"specify":{"month":"0","day":"1"},"week":"3","type":"week","beforeDays":1,"end":"","begin":"'.$toDay.'"}';
|
||||
$str3 = '{"specify":{"month":"0","day":"1"},"month":"17","type":"month","beforeDays":0,"end":"","begin":"'.$toDay.'"}';
|
||||
|
||||
$this->dao->update(TABLE_TODO)->SET('config')->eq($str)->where('id')->eq('2001')->exec();
|
||||
$this->dao->update(TABLE_TODO)->SET('date')->eq($addDay)->where('id')->eq('2002')->exec();
|
||||
$this->dao->update(TABLE_TODO)->SET('config')->eq($str2)->where('id')->eq('2003')->exec();
|
||||
$this->dao->update(TABLE_TODO)->SET('config')->eq($str3)->where('id')->eq('2005')->exec();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Init initUpdateKanban.
|
||||
*
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,10 +10,13 @@ title=测试 deptModel->buildMenuQuery();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
不输入部门id >> SELECT * FROM `zt_dept` ORDER BY `grade` desc,`order`
|
||||
输入部门id >> ,2,
|
||||
|
||||
*/
|
||||
|
||||
$deptIDList = array('', '2');
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->buildMenuQueryTest($deptIDList[0])) && p() && e('SELECT * FROM `zt_dept` ORDER BY `grade` desc,`order` '); //不输入部门id
|
||||
r($dept->buildMenuQueryTest($deptIDList[1])) && p() && e(',2,'); //输入部门id
|
||||
r($dept->buildMenuQueryTest($deptIDList[1])) && p() && e(',2,'); //输入部门id
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,11 +10,12 @@ title=测试 deptModel->createGroupManageMemberLink();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
权限分组2开发部链接组成 >> dept2
|
||||
|
||||
*/
|
||||
|
||||
$deptIDList = array('2', '5');
|
||||
$groupIDList = array('2', '12');
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->createGroupManageMemberLinkTest($deptIDList[0], $groupIDList[0])) && p() && e('>开发部<'); //权限分组2开发部链接组成
|
||||
r($dept->createGroupManageMemberLinkTest($deptIDList[1], $groupIDList[1])) && p() && e('>开发部1<'); //权限分组12开发部1链接组成
|
||||
r($dept->createGroupManageMemberLinkTest($deptIDList[0], $groupIDList[0])) && p() && e('dept2'); //权限分组2开发部链接组成
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,12 +10,17 @@ title=测试 deptModel->createManageLink();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
编辑链接 >> 编辑
|
||||
下级部门 >> 下级部门
|
||||
删除链接 >> 删除
|
||||
数量 >> orders[5]
|
||||
|
||||
*/
|
||||
|
||||
$deptID = '5';
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->createManageLinkTest($deptID)) && p() && e('编辑'); //编辑链接
|
||||
r($dept->createManageLinkTest($deptID)) && p() && e('删除'); //删除链接
|
||||
r($dept->createManageLinkTest($deptID)) && p() && e('下级部门'); //下级部门
|
||||
r($dept->createManageLinkTest($deptID)) && p() && e('orders[5]'); //数量
|
||||
r($dept->createManageLinkTest($deptID)) && p() && e('删除'); //删除链接
|
||||
r($dept->createManageLinkTest($deptID)) && p() && e('orders[5]'); //数量
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,12 +10,12 @@ title=测试 deptModel->createManageProjectAdminLink();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
权限分组2开发部链接组成 >> dept2
|
||||
|
||||
*/
|
||||
|
||||
$deptIDList = array('2', '5');
|
||||
$groupIDList = array('2', '12');
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->createManageProjectAdminLinkTest($deptIDList[0], $groupIDList[0])) && p() && e('开发部'); //权限分组2开发部链接组成
|
||||
r($dept->createManageProjectAdminLinkTest($deptIDList[1], $groupIDList[1])) && p() && e('开发部1'); //权限分组2开发部链接组成
|
||||
|
||||
r($dept->createManageProjectAdminLinkTest($deptIDList[0], $groupIDList[0])) && p() && e('dept2'); //权限分组2开发部链接组成
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,9 +10,11 @@ title=测试 deptModel->createMemberLink();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
>> >开发部<
|
||||
|
||||
*/
|
||||
|
||||
$deptID = '2';
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->createMemberLinkTest($deptID)) && p() && e('>开发部<');
|
||||
r($dept->createMemberLinkTest($deptID)) && p() && e('>开发部<');
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,8 +10,13 @@ title=测试 deptModel->delete();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
删除后统计数量 >> 99
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
$deptID = '11';
|
||||
|
||||
r() && p() && e();
|
||||
$dept = new deptTest();
|
||||
r($dept->deleteTest($deptID)) && p() && e('99'); //删除后统计数量
|
||||
|
||||
system("./ztest init");
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->fixDeptPath();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
|
||||
r() && p() && e();
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,6 +10,11 @@ title=测试 deptModel->getAllChildId();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
有子部门查询 >> 5
|
||||
无子部门查询 >> 5
|
||||
子部门数量统计 >> 3
|
||||
无子部门数量统计 >> 1
|
||||
|
||||
*/
|
||||
|
||||
$deptIDList = array('2', '5');
|
||||
@@ -18,4 +24,4 @@ $dept = new deptTest();
|
||||
r($dept->getAllChildIdTest($deptIDList[0], $count[0])) && p('1') && e('5'); //有子部门查询
|
||||
r($dept->getAllChildIdTest($deptIDList[1], $count[0])[0]) && p() && e('5'); //无子部门查询
|
||||
r($dept->getAllChildIdTest($deptIDList[0], $count[1])) && p() && e('3'); //子部门数量统计
|
||||
r($dept->getAllChildIdTest($deptIDList[1], $count[1])) && p() && e('1'); //无子部门数量统计
|
||||
r($dept->getAllChildIdTest($deptIDList[1], $count[1])) && p() && e('1'); //无子部门数量统计
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,10 +10,13 @@ title=测试 deptModel->getByID();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
查找id为1的部门 >> 产品部
|
||||
查找id不存在的部门 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$deptIDList = array('1','0');
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->getByIDTest($deptIDList[0])) && p('name') && e('产品部'); //查找id为1的部门
|
||||
r($dept->getByIDTest($deptIDList[1])) && p() && e('0'); //查找id不存在的部门
|
||||
r($dept->getByIDTest($deptIDList[1])) && p() && e('0'); //查找id不存在的部门
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,8 +10,13 @@ title=测试 deptModel->getDataStructure();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
全部查询 >> 100,其他部门63
|
||||
全部查询统计 >> 78
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
$count = array('0', '1');
|
||||
|
||||
r() && p() && e();
|
||||
$dept = new deptTest();
|
||||
r($dept->getDataStructureTest($count[0])) && p('77:id,name') && e('100,其他部门63'); //全部查询
|
||||
r($dept->getDataStructureTest($count[1])) && p() && e('78'); //全部查询统计
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,6 +10,10 @@ title=测试 deptModel->getDeptPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
查询全部部门统计 >> 100
|
||||
查询id为2的部门 >> 开发部
|
||||
查询id为2的部门数量 >> 100
|
||||
|
||||
*/
|
||||
|
||||
$deptIDlist = array('0', '2');
|
||||
@@ -17,4 +22,4 @@ $count = array('0', '1');
|
||||
$dept = new deptTest();
|
||||
r($dept->getDeptPairsTest($deptIDlist[0], $count[1])) && p() && e('100'); //查询全部部门统计
|
||||
r($dept->getDeptPairsTest($deptIDlist[1], $count[0])) && p('2') && e('开发部'); //查询id为2的部门
|
||||
r($dept->getDeptPairsTest($deptIDlist[1], $count[1])) && p() && e('100'); //查询id为2的部门数量
|
||||
r($dept->getDeptPairsTest($deptIDlist[1], $count[1])) && p() && e('100'); //查询id为2的部门数量
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,8 +10,33 @@ title=测试 deptModel->getDeptUserPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
查询所有内部用户 >> 测试1
|
||||
查询所有外部用户 >> 用户1
|
||||
根据部门查询用户 >> 测试10
|
||||
键值为account查询 >> 测试40
|
||||
键值为out查询 >> 测试10
|
||||
type为out查询 >> 测试10
|
||||
查询所有内部用户统计 >> 999
|
||||
查询所有外部用户统计 >> 1
|
||||
根据部门查询用户统计 >> 30
|
||||
查询全部用户统计 >> 1000
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
$deptIDList = array('0', '2', '5');
|
||||
$key = array('id', 'account', 'out');
|
||||
$type = array('inside', 'outside', 'out');
|
||||
$count = array('0', '1');
|
||||
$params = 'all';
|
||||
|
||||
r() && p() && e();
|
||||
$dept = new deptTest();
|
||||
r($dept->getDeptUserPairsTest($deptIDList[0], $count[0], $key[0], $type[0])) && p('101') && e('测试1'); //查询所有内部用户
|
||||
r($dept->getDeptUserPairsTest($deptIDList[0], $count[0], $key[0], $type[1])) && p('901') && e('用户1'); //查询所有外部用户
|
||||
r($dept->getDeptUserPairsTest($deptIDList[1], $count[0], $key[0], $type[0])) && p('11') && e('测试10'); //根据部门查询用户
|
||||
r($dept->getDeptUserPairsTest($deptIDList[2], $count[0], $key[1], $type[0])) && p('user40') && e('测试40'); //键值为account查询
|
||||
r($dept->getDeptUserPairsTest($deptIDList[1], $count[0], $key[2], $type[0])) && p('user10') && e('测试10'); //键值为out查询
|
||||
r($dept->getDeptUserPairsTest($deptIDList[1], $count[0], $key[1], $type[2])) && p('user10') && e('测试10'); //type为out查询
|
||||
r($dept->getDeptUserPairsTest($deptIDList[0], $count[1], $key[0], $type[0])) && p() && e('999'); //查询所有内部用户统计
|
||||
r($dept->getDeptUserPairsTest($deptIDList[0], $count[1], $key[0], $type[1])) && p() && e('1'); //查询所有外部用户统计
|
||||
r($dept->getDeptUserPairsTest($deptIDList[1], $count[1], $key[0], $type[0])) && p() && e('30'); //根据部门查询用户统计
|
||||
r($dept->getDeptUserPairsTest($deptIDList[0], $count[1], $key[0], $type[0], $params)) && p() && e('1000'); //查询全部用户统计
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,6 +10,13 @@ title=测试 deptModel->getOptionMenu();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
父级部门查询 >> /产品部
|
||||
多级部门查询 >> 开发部
|
||||
全部部门查询 >> /开发部/开发部1
|
||||
父级部门查询统计 >> 2
|
||||
多级部门查询统计 >> 4
|
||||
全部部门查询统计 >> 101
|
||||
|
||||
*/
|
||||
|
||||
$deptIDList = array('0', '1', '2');
|
||||
@@ -20,4 +28,4 @@ r($dept->getOptionMenuTest($deptIDList[2], $count[0])) && p('2') && e('开发部
|
||||
r($dept->getOptionMenuTest($deptIDList[0], $count[0])) && p('5') && e('/开发部/开发部1'); //全部部门查询
|
||||
r($dept->getOptionMenuTest($deptIDList[1], $count[1])) && p() && e('2'); //父级部门查询统计
|
||||
r($dept->getOptionMenuTest($deptIDList[2], $count[1])) && p() && e('4'); //多级部门查询统计
|
||||
r($dept->getOptionMenuTest($deptIDList[0], $count[1])) && p() && e('101'); //全部部门查询统计
|
||||
r($dept->getOptionMenuTest($deptIDList[0], $count[1])) && p() && e('101'); //全部部门查询统计
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,8 +10,18 @@ title=测试 deptModel->getParents();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
父级部门查询父级 >> 2,开发部,0
|
||||
子级部门查询父级 >> 2,开发部,0
|
||||
父级部门查询父级统计 >> 1
|
||||
子级部门查询父级统计 >> 2
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
$deptIDList = array('2', '5');
|
||||
$count = array('0', '1');
|
||||
|
||||
r() && p() && e();
|
||||
$dept = new deptTest();
|
||||
r($dept->getParentsTest($deptIDList[0], $count[0])) && p('0:id,name,parent') && e('2,开发部,0'); //父级部门查询父级
|
||||
r($dept->getParentsTest($deptIDList[1], $count[0])) && p('0:id,name,parent') && e('2,开发部,0'); //子级部门查询父级
|
||||
r($dept->getParentsTest($deptIDList[0], $count[1])) && p() && e('1'); //父级部门查询父级统计
|
||||
r($dept->getParentsTest($deptIDList[1], $count[1])) && p() && e('2'); //子级部门查询父级统计
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,6 +10,10 @@ title=测试 deptModel->getSons();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
有子部门查询 >> 开发部1,2,,2,5,
|
||||
无子部门查询 >> 0
|
||||
子部门数量统计 >> 2
|
||||
|
||||
*/
|
||||
|
||||
$deptIDList = array('2', '5');
|
||||
@@ -17,4 +22,4 @@ $count = array('0', '1');
|
||||
$dept = new deptTest();
|
||||
r($dept->getSonsTest($deptIDList[0], $count[0])) && p('0:name,parent,path') && e('开发部1,2,,2,5,'); //有子部门查询
|
||||
r($dept->getSonsTest($deptIDList[1], $count[0])) && p() && e('0'); //无子部门查询
|
||||
r($dept->getSonsTest($deptIDList[0], $count[1])) && p() && e('2'); //子部门数量统计
|
||||
r($dept->getSonsTest($deptIDList[0], $count[1])) && p() && e('2'); //子部门数量统计
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,12 +10,16 @@ title=测试 deptModel->getTreeMenu();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
全部部门树结构查询 >> 产品部
|
||||
无子部门树结构查询 >> 下级部门
|
||||
有子部门树结构查询 >> 删除
|
||||
|
||||
*/
|
||||
|
||||
$deptIDList = array('0', '1', '2');
|
||||
$userFunc = array('deptmodel', 'createManageLink');
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->getTreeMenuTest($deptIDList[0], $userFunc)) && p() && e('<li>开发部 <a'); //全部部门树结构查询
|
||||
r($dept->getTreeMenuTest($deptIDList[1], $userFunc)) && p() && e('<li>产品部 <a'); //无子部门树结构查询
|
||||
r($dept->getTreeMenuTest($deptIDList[2], $userFunc)) && p() && e('<li>开发部部1 <a'); //有子部门树结构查询
|
||||
r($dept->getTreeMenuTest($deptIDList[0], $userFunc)) && p() && e('产品部'); //全部部门树结构查询
|
||||
r($dept->getTreeMenuTest($deptIDList[1], $userFunc)) && p() && e('下级部门'); //无子部门树结构查询
|
||||
r($dept->getTreeMenuTest($deptIDList[2], $userFunc)) && p() && e('删除'); //有子部门树结构查询
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,8 +10,26 @@ title=测试 deptModel->getUsers();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
全部用户查询 >> outside100,100,其他100
|
||||
外部用户查询 >> outside1,91,用户1
|
||||
根据部门查询用户 >> user10,2,测试10
|
||||
根据account排序 >> user40,5,测试40
|
||||
全部用户查询统计 >> 999
|
||||
外部用户查询统计 >> 1
|
||||
根据部门查询用户统计 >> 10
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
$deptIDList = array('0', '2', '5');
|
||||
$browseType = array('inside', 'outside');
|
||||
$count = array('0', '1');
|
||||
$orderBy = array('id', 'account');
|
||||
|
||||
r() && p() && e();
|
||||
$dept = new deptTest();
|
||||
r($dept->getUsersTest($browseType[0], $deptIDList[0], $count[0], $orderBy[0])) && p('998:account,dept,realname') && e('outside100,100,其他100'); //全部用户查询
|
||||
r($dept->getUsersTest($browseType[1], $deptIDList[0], $count[0], $orderBy[0])) && p('0:account,dept,realname') && e('outside1,91,用户1'); //外部用户查询
|
||||
r($dept->getUsersTest($browseType[0], $deptIDList[1], $count[0], $orderBy[0])) && p('0:account,dept,realname') && e('user10,2,测试10'); //根据部门查询用户
|
||||
r($dept->getUsersTest($browseType[0], $deptIDList[2], $count[0], $orderBy[1])) && p('0:account,dept,realname') && e('user40,5,测试40'); //根据account排序
|
||||
r($dept->getUsersTest($browseType[0], $deptIDList[0], $count[1], $orderBy[0])) && p() && e('999'); //全部用户查询统计
|
||||
r($dept->getUsersTest($browseType[1], $deptIDList[0], $count[1], $orderBy[0])) && p() && e('1'); //外部用户查询统计
|
||||
r($dept->getUsersTest($browseType[0], $deptIDList[1], $count[1], $orderBy[0])) && p() && e('10'); //根据部门查询用户统计
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,8 +10,22 @@ title=测试 deptModel->manageChild();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
三级部门下添加四级部门 >> 102
|
||||
三级部门下添加四级部门统计 >> 3
|
||||
无父级部门下添加子级部门 >> 108
|
||||
无父级部门下添加子级部门统计 >> 3
|
||||
无部门名称 >> 0
|
||||
|
||||
*/
|
||||
$parentDeptID = '28';
|
||||
$depts = array('四级部门一', '四级部门二', '四级部门三');
|
||||
$count = array('0', '1');
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->manageChildTest($parentDeptID, $depts, $count[0])) && p('1') && e('102'); //三级部门下添加四级部门
|
||||
r($dept->manageChildTest($parentDeptID, $depts, $count[1])) && p() && e('3'); //三级部门下添加四级部门统计
|
||||
r($dept->manageChildTest('', $depts, $count[0])) && p('1') && e('108'); //无父级部门下添加子级部门
|
||||
r($dept->manageChildTest('', $depts, $count[1])) && p() && e('3'); //无父级部门下添加子级部门统计
|
||||
r($dept->manageChildTest($parentDeptID, $depts = array(), $count[0])) && p() && e('0'); //无部门名称
|
||||
|
||||
r() && p() && e();
|
||||
system("./ztest init");
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,6 +10,12 @@ title=测试 deptModel->update();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
修改父级 >> 修改后部门,0,,16,,dev1
|
||||
修改子级 >> 子级部门修改,1,,1,18,,dev2
|
||||
不输入上级部门 >> 『上级部门』应当是数字。
|
||||
部门名称为空 >> 『部门名称』不能为空。
|
||||
无负责人 >> 无负责人部门,1,,1,20,,
|
||||
|
||||
*/
|
||||
|
||||
$deptIDList = array('16', '17', '18', '19', '20');
|
||||
@@ -20,10 +27,10 @@ $noName = array('parent' => '0', 'manager' => 'test2');
|
||||
$noManager = array('parent' => '1', 'name' => '无负责人部门');
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->updateTest($deptIDList[0], $parentDept)) && p('16:name,parent,path,manager') && e('修改后部门,0,,16,,dev1');
|
||||
r($dept->updateTest($deptIDList[2], $childDept)) && p('18:name,parent,path,manager') && e('子级部门修改,1,,1,18,,dev2');
|
||||
r($dept->updateTest($deptIDList[1], $noParent)) && p('parent:0') && e('『上级部门』应当是数字。');
|
||||
r($dept->updateTest($deptIDList[3], $noName)) && p('name:0') && e('『部门名称』不能为空。');
|
||||
r($dept->updateTest($deptIDList[4], $noManager)) && p('20:name,parent,path,manager') && e('无负责人部门,1,,1,20,,');
|
||||
r($dept->updateTest($deptIDList[0], $parentDept)) && p('16:name,parent,path,manager') && e('修改后部门,0,,16,,dev1'); //修改父级
|
||||
r($dept->updateTest($deptIDList[2], $childDept)) && p('18:name,parent,path,manager') && e('子级部门修改,1,,1,18,,dev2'); //修改子级
|
||||
r($dept->updateTest($deptIDList[1], $noParent)) && p('parent:0') && e('『上级部门』应当是数字。'); //不输入上级部门
|
||||
r($dept->updateTest($deptIDList[3], $noName)) && p('name:0') && e('『部门名称』不能为空。'); //部门名称为空
|
||||
r($dept->updateTest($deptIDList[4], $noManager)) && p('20:name,parent,path,manager') && e('无负责人部门,1,,1,20,,'); //无负责人
|
||||
|
||||
system("./ztest init");
|
||||
system("./ztest init");
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
@@ -9,8 +10,11 @@ title=测试 deptModel->updateOrder();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
修改部门排序 >> 17
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
$orders = array('17');
|
||||
|
||||
r() && p() && e();
|
||||
$dept = new deptTest();
|
||||
r($dept->updateOrderTest($orders)) && p('17:order') && e('17'); //修改部门排序
|
||||
@@ -22,13 +22,13 @@ $story2['reviewer'] = array('admin', 'test2');
|
||||
$story2['title'] = '';
|
||||
|
||||
$story3 = $story1;
|
||||
$story3['reviewer'] = array('admin', 'test2');
|
||||
$story3['needNotReview'] = true;
|
||||
|
||||
$result1 = $story->changeTest(1, $story1);
|
||||
$result2 = $story->changeTest(2, $story2);
|
||||
$result3 = $story->changeTest(3, $story3);
|
||||
$result1 = $story->changeTest(1, $story1);
|
||||
$result2 = $story->changeTest(2, $story2);
|
||||
$result3 = $story->changeTest(26, $story3);
|
||||
|
||||
r($result1[0]) && p() && e('『由谁评审』不能为空。'); // 不勾选【不需要评审】,不传入由谁评审时的变更,给出提示
|
||||
r($result2) && p('title:0') && e('『研发需求名称』不能为空。'); // 变更时不填写需求名称,给出提示
|
||||
r($result3) && p('status,title,spec,verify,estimate,lastEditedBy') && e('changed,测试需求1变更标题,测试需求1的变更描述,测试需求1的变更验收标准,1,admin'); // 正常变更需求,判断返回的status、title等信息
|
||||
r($result3) && p('status,title,spec,verify,estimate,lastEditedBy,version') && e('changed,测试需求1变更标题,测试需求1的变更描述,测试需求1的变更验收标准,1,admin,3'); // 正常变更需求,判断返回的status、title等信息
|
||||
system("./ztest init");
|
||||
|
||||
@@ -12,5 +12,11 @@ pid=1
|
||||
*/
|
||||
|
||||
$story = new storyTest();
|
||||
$planStories1 = $story->updateStoryOrderOfPlanTest(1, 1);
|
||||
$planStories2 = $story->updateStoryOrderOfPlanTest(1, 2, 1);
|
||||
|
||||
r() && p() && e();
|
||||
r($planStories1) && p("0:plan,story,order") && e('1,1,21'); // 把需求1迁移到计划1下,获取更新后的planstory
|
||||
r(count($planStories1)) && p() && e('4'); // 把需求1迁移到计划1下,获取更新后的planstory数量
|
||||
r($planStories2) && p("0:plan,story,order") && e('2,1,1'); // 把需求1迁移到计划2下,获取更新后的planstory
|
||||
r(count($planStories2)) && p() && e('1'); // 把需求1迁移到计划2下,获取更新后的planstory数量
|
||||
system("./ztest init");
|
||||
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/todo.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 todoModel->activate();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
激活一个状态为wait的todo >> wait
|
||||
激活一个状态为doing的todo >> wait
|
||||
激活一个状态为done的todo >> wait
|
||||
*/
|
||||
|
||||
$todoIDList = array('1', '2', '3');
|
||||
|
||||
$todo = new todoTest();
|
||||
|
||||
r($todo->activateTest($todoIDList[0])) && p('status') && e('wait'); // 激活一个状态为wait的todo
|
||||
r($todo->activateTest($todoIDList[1])) && p('status') && e('wait'); // 激活一个状态为doing的todo
|
||||
r($todo->activateTest($todoIDList[2])) && p('status') && e('wait'); // 激活一个状态为done的todo
|
||||
system("./ztest init");
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/todo.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 todoModel->assignTo();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
指派todo 1给test1 >> test1,20300101,1000,1400
|
||||
指派todo 2给test1 >> test1,2400,2400
|
||||
指派todo 3给test1 >> test1,1002,1402
|
||||
|
||||
*/
|
||||
|
||||
$todoIDList = array('1', '2', '3');
|
||||
|
||||
$todo1 = new stdclass();
|
||||
$todo1->assignedTo = 'test1';
|
||||
$todo1->future = 'on';
|
||||
$todo1->begin = 1000;
|
||||
$todo1->end = 1400;
|
||||
|
||||
$todo2 = new stdclass();
|
||||
$todo2->assignedTo = 'test1';
|
||||
$todo2->lblDisableDate = 'on';
|
||||
|
||||
$todo3 = new stdclass();
|
||||
$todo3->assignedTo = 'test1';
|
||||
$todo3->begin = 1002;
|
||||
$todo3->end = 1402;
|
||||
|
||||
$todo = new todoTest();
|
||||
|
||||
r($todo->assignToTest($todoIDList[0], $todo1)) && p('assignedTo,date,begin,end') && e('test1,20300101,1000,1400'); // 指派todo 1给test1
|
||||
r($todo->assignToTest($todoIDList[1], $todo2)) && p('assignedTo,begin,end') && e('test1,2400,2400'); // 指派todo 2给test1
|
||||
r($todo->assignToTest($todoIDList[2], $todo3)) && p('assignedTo,begin,end') && e('test1,1002,1402'); // 指派todo 3给test1
|
||||
system("./ztest init");
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/todo.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 todoModel->batchCreate();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
批量创建有个没有名字的待办 >> 批量创建待办1,desc1,1,custom,0;批量创建待办2,desc2,2,custom,0;批量创建待办3,desc4,4,custom,0
|
||||
批量创建的待办 >> 测试单转Bug13,desc1,1,bug,313;用户需求版本三41,desc2,2,story,1;开发任务11,desc3,3,task,1;测试单1,desc4,4,testtask,1
|
||||
|
||||
*/
|
||||
|
||||
$names = array('批量创建待办1','批量创建待办2','', '批量创建待办3', '', '', '', '');
|
||||
$types = array('custom', 'custom', 'custom', 'custom', 'custom', 'custom', 'custom', 'custom');
|
||||
$pris = array('1', '2', '3', '4', '1', '2', '3', '4');
|
||||
$descs = array('desc1', 'desc2', 'desc3', 'desc4', '' , '', '', '');
|
||||
$begins = array('0830', '0900', '0930', '1000', '1030', '1100', '1130', '1200');
|
||||
$ends = array('0900', '0930', '1000','1030', '1100', '1130', '1200', '1230');
|
||||
$bugs = array('2' => '313');
|
||||
|
||||
$noname_create = array('types' => $types, 'pris' => $pris, 'names' => $names, 'descs' => $descs, 'begins' => $begins, 'ends' => $ends);
|
||||
|
||||
$names = array('批量创建待办4','批量创建待办5','批量创建待办6', '批量创建待办7', '', '', '', '');
|
||||
$types = array('bug', 'story', 'task', 'testtask', 'custom', 'custom', 'custom', 'custom');
|
||||
$bugs = array('1' => '313');
|
||||
$stories = array('2' => '1');
|
||||
$tasks = array('3' => '1');
|
||||
$testtasks = array('4' => '1');
|
||||
|
||||
$except_create = array('types' => $types, 'pris' => $pris, 'names' => $names, 'descs' => $descs, 'begins' => $begins, 'ends' => $ends, 'bugs' => $bugs, 'stories' => $stories, 'tasks' => $tasks, 'testtasks' => $testtasks);
|
||||
|
||||
$todo = new todoTest();
|
||||
|
||||
r($todo->batchCreateTest($noname_create)) && p('2001:name,desc,pri,type,idvalue;2002:name,desc,pri,type,idvalue;2003:name,desc,pri,type,idvalue') && e(''); // 批量创建有个没有名字的待办
|
||||
r($todo->batchCreateTest($except_create)) && p('2004:name,desc,pri,type,idvalue;2005:name,desc,pri,type,idvalue;2006:name,desc,pri,type,idvalue;2007:name,desc,pri,type,idvalue') && e(''); // 批量创建的待办
|
||||
system("./ztest init");
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/todo.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 todoModel->batchUpdate();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
批量修改todo类型 >> type,task,custom
|
||||
批量修改todo优先级 >> pri,2,1
|
||||
批量修改todo状态 >> status,wait,doing
|
||||
|
||||
*/
|
||||
|
||||
$types = array('1' => 'custom', '2' => 'bug', '3' => 'custom');
|
||||
$pris = array('1' => '1', '2' => '1', '3' => '3');
|
||||
$status = array('1' => 'doing', '2' => 'doing', '3' => 'done');
|
||||
$bugs = array('2' => '1');
|
||||
$tasks = array('3' => '2');
|
||||
|
||||
$changeType = array('types' => $types, 'bugs' => $bugs);
|
||||
$changePri = array('pris' => $pris, 'bugs' => $bugs, 'tasks' => $tasks);
|
||||
$changeStatus = array('status' => $status, 'bugs' => $bugs, 'tasks' => $tasks);
|
||||
|
||||
$todo = new todoTest();
|
||||
|
||||
r($todo->batchUpdateTest($changeType, '3')) && p('0:field,old,new') && e('type,task,custom'); // 批量修改todo类型
|
||||
r($todo->batchUpdateTest($changePri, '2')) && p('0:field,old,new') && e('pri,2,1'); // 批量修改todo优先级
|
||||
r($todo->batchUpdateTest($changeStatus, '1')) && p('0:field,old,new') && e('status,wait,doing'); // 批量修改todo状态
|
||||
system("./ztest init");
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/todo.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 todoModel->close();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
关闭一个状态为wait的todo >> closed
|
||||
关闭一个状态为doing的todo >> closed
|
||||
关闭一个状态为done的todo >> closed
|
||||
|
||||
*/
|
||||
|
||||
$todoIDList = array('1', '2', '3');
|
||||
|
||||
$todo = new todoTest();
|
||||
|
||||
r($todo->closeTest($todoIDList[0])) && p('status') && e('closed'); // 关闭一个状态为wait的todo
|
||||
r($todo->closeTest($todoIDList[1])) && p('status') && e('closed'); // 关闭一个状态为doing的todo
|
||||
r($todo->closeTest($todoIDList[2])) && p('status') && e('closed'); // 关闭一个状态为done的todo
|
||||
system("./ztest init");
|
||||
Executable
+65
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/todo.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 todoModel->create();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
创建没有名字的待办 >> 『待办名称』不能为空。
|
||||
创建自定义待办 >> 时间待定的月周期待办,custom,wait
|
||||
创建bug待办 >> 测试单转Bug13,bug,doing
|
||||
创建task待办 >> 开发任务11,task,done
|
||||
创建story待办 >> 用户需求1,story,closed
|
||||
|
||||
*/
|
||||
|
||||
$accountList = array('admin', 'dev1', 'test1');
|
||||
|
||||
$b_noname = new stdclass();
|
||||
$b_noname->name = '';
|
||||
$b_noname->date = 'today';
|
||||
$b_noname->type = 'custom';
|
||||
|
||||
$todo1 = new stdclass();
|
||||
$todo1->name = '时间待定的月周期待办';
|
||||
$todo1->type = 'custom';
|
||||
$todo1->date = '+3 days';
|
||||
$todo1->config = array('day' => '', 'specify' => array('month' => 0, 'day' => 1), 'month' => array(1,3,5), 'type' => 'month', 'beforeDays' => 2, 'end' => '2025-01-01');
|
||||
|
||||
$todo2 = new stdclass();
|
||||
$todo2->name = 'bug待办';
|
||||
$todo2->type = 'bug';
|
||||
$todo2->date = 'today';
|
||||
$todo2->bug = '313';
|
||||
$todo2->status = 'doing';
|
||||
$todo2->uid = '313';
|
||||
|
||||
$todo3 = new stdclass();
|
||||
$todo3->name = 'task待办';
|
||||
$todo3->type = 'task';
|
||||
$todo3->date = 'today';
|
||||
$todo3->task = '1';
|
||||
$todo3->status = 'done';
|
||||
$todo3->uid = '1';
|
||||
|
||||
$todo4 = new stdclass();
|
||||
$todo4->name = 'story待办';
|
||||
$todo4->type = 'story';
|
||||
$todo4->date = 'today';
|
||||
$todo4->story = '1';
|
||||
$todo4->status = 'closed';
|
||||
$todo4->uid = '1';
|
||||
|
||||
$todo = new todoTest();
|
||||
|
||||
r($todo->createTest($accountList[0], $b_noname)) && p() && e('『待办名称』不能为空。'); //创建没有名字的待办
|
||||
r($todo->createTest($accountList[1], $todo1)) && p('name,type,status') && e('时间待定的月周期待办,custom,wait'); //创建自定义待办
|
||||
r($todo->createTest($accountList[2], $todo2)) && p('name,type,status') && e('测试单转Bug13,bug,doing'); //创建bug待办
|
||||
r($todo->createTest($accountList[0], $todo3)) && p('name,type,status') && e('开发任务11,task,done'); //创建task待办
|
||||
r($todo->createTest($accountList[0], $todo4)) && p('name,type,status') && e('用户需求1,story,closed'); //创建story待办
|
||||
system("./ztest init");
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/todo.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 todoModel->createByCycle();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$todo1 = new stdclass();
|
||||
$todo1->name = 'cycle生成的待办1';
|
||||
$todo1->config = '{"specify":{"month":"0","day":"1"},"days":"1","type":"day","beforeDays":11,"end":"","begin":"2022-03-23"}';
|
||||
|
||||
$todo2 = new stdclass();
|
||||
$todo2->name = 'cycle生成的待办2';
|
||||
$todo2->config = '{"specify":{"month":"0","day":"1"},"week":"2,4,7","type":"week","beforeDays":31,"end":"","begin":"2022-03-23"}';
|
||||
|
||||
$todo3 = new stdclass();
|
||||
$todo3->name = 'cycle生成的待办3';
|
||||
$todo3->config = '{"specify":{"month":"0","day":"1"},"month":"1,8,13,15,27,29,30","type":"month","beforeDays":301,"end":"","begin":"2022-03-23"}';
|
||||
|
||||
$todo = new todoTest();
|
||||
|
||||
r($todo->createByCycleTest($todo1)) && p() && e('');
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/todo.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 todoModel->finish();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
结束一个状态为wait的todo >> done
|
||||
结束一个状态为doing的todo >> done
|
||||
结束一个状态为done的todo >> done
|
||||
|
||||
*/
|
||||
|
||||
$todoIDList = array('1', '2', '3');
|
||||
|
||||
$todo = new todoTest();
|
||||
|
||||
r($todo->finishTest($todoIDList[0])) && p('status') && e('done'); // 结束一个状态为wait的todo
|
||||
r($todo->finishTest($todoIDList[1])) && p('status') && e('done'); // 结束一个状态为doing的todo
|
||||
r($todo->finishTest($todoIDList[2])) && p('status') && e('done'); // 结束一个状态为done的todo
|
||||
system("./ztest init");
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/todo.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 todoModel->getById();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取id为1的todo信息 >> 自定义1的待办,custom,wait
|
||||
获取id为2的todo信息 >> BUG1,bug,doing
|
||||
获取id为3的todo信息 >> 开发任务12,task,done
|
||||
获取id为4的todo信息 >> 用户需求3,story,closed
|
||||
获取id不存在的todo信息 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$todoIDList = array('1', '2', '3', '4', '100001');
|
||||
|
||||
$todo = new todoTest();
|
||||
|
||||
r($todo->getByIdTest($todoIDList[0])) && p('name,type,status') && e('自定义1的待办,custom,wait'); // 获取id为1的todo信息
|
||||
r($todo->getByIdTest($todoIDList[1])) && p('name,type,status') && e('BUG1,bug,doing'); // 获取id为2的todo信息
|
||||
r($todo->getByIdTest($todoIDList[2])) && p('name,type,status') && e('开发任务12,task,done'); // 获取id为3的todo信息
|
||||
r($todo->getByIdTest($todoIDList[3])) && p('name,type,status') && e('用户需求3,story,closed'); // 获取id为4的todo信息
|
||||
r($todo->getByIdTest($todoIDList[4])) && p('name,type,status') && e('0'); // 获取id不存在的todo信息
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/todo.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 todoModel->getByList();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取todo 1 2 3 4的名称 >> 自定义1的待办,BUG2的待办,任务3的待办,需求4的待办
|
||||
获取todo 5 6 7 8的名称 >> 测试单5的待办,自定义6的待办,BUG7的待办,任务8的待办
|
||||
获取todo 9 10 11 12的名称 >> 需求9的待办,测试单10的待办,自定义11的待办,BUG12的待办
|
||||
|
||||
*/
|
||||
|
||||
$todoIDList1 = array('1', '2', '3', '4');
|
||||
$todoIDList2 = array('5', '6', '7', '8');
|
||||
$todoIDList3 = array('9', '10', '11', '12');
|
||||
|
||||
$todo = new todoTest();
|
||||
|
||||
r($todo->getByListTest($todoIDList1)) && p() && e('自定义1的待办,BUG2的待办,任务3的待办,需求4的待办'); // 获取todo 1 2 3 4的名称
|
||||
r($todo->getByListTest($todoIDList2)) && p() && e('测试单5的待办,自定义6的待办,BUG7的待办,任务8的待办'); // 获取todo 5 6 7 8的名称
|
||||
r($todo->getByListTest($todoIDList3)) && p() && e('需求9的待办,测试单10的待办,自定义11的待办,BUG12的待办'); // 获取todo 9 10 11 12的名称
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/todo.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 todoModel->getCount();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取用户admin的所有待办个数 >> 2
|
||||
获取用户user1的所有待办个数 >> 2
|
||||
获取用户user2的所有待办个数 >> 2
|
||||
获取用户user3的所有待办个数 >> 2
|
||||
获取不存在的用户所有待办个数 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$accountList = array('admin', 'user1', 'user2', 'user3', 'user10001');
|
||||
|
||||
$todo = new todoTest();
|
||||
|
||||
r($todo->getCountTest($accountList[0])) && p() && e('2'); // 获取用户admin的所有待办个数
|
||||
r($todo->getCountTest($accountList[1])) && p() && e('2'); // 获取用户user1的所有待办个数
|
||||
r($todo->getCountTest($accountList[2])) && p() && e('2'); // 获取用户user2的所有待办个数
|
||||
r($todo->getCountTest($accountList[3])) && p() && e('2'); // 获取用户user3的所有待办个数
|
||||
r($todo->getCountTest($accountList[4])) && p() && e('0'); // 获取不存在的用户所有待办个数
|
||||
Executable
+64
@@ -0,0 +1,64 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/todo.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 todoModel->getList();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取type为today 当前用户的代办数量 >> 0
|
||||
获取type为yesterday 当前用户的代办数量 >> 0
|
||||
获取type为thisweek 当前用户的代办数量 >> 0
|
||||
获取type为lastweek 当前用户的代办数量 >> 1
|
||||
获取type为thismonth 当前用户的代办数量 >> 1
|
||||
获取type为lastmonth 当前用户的代办数量 >> 1
|
||||
获取type为thisseason 当前用户的代办数量 >> 2
|
||||
获取type为thisyear 当前用户的代办数量 >> 2
|
||||
获取type为future 当前用户的代办数量 >> 0
|
||||
获取type为before 当前用户的代办数量 >> 2
|
||||
获取type为cycle 当前用户的代办数量 >> 0
|
||||
获取type为today user1的代办数量 >> 0
|
||||
获取type为yesterday user1的代办数量 >> 0
|
||||
获取type为thisweek user1的代办数量 >> 0
|
||||
获取type为lastweek user1的代办数量 >> 1
|
||||
获取type为thismonth user1的代办数量 >> 1
|
||||
获取type为lastmonth user1的代办数量 >> 1
|
||||
获取type为thisseason user1的代办数量 >> 2
|
||||
获取type为thisyear user1的代办数量 >> 2
|
||||
获取type为future user1的代办数量 >> 0
|
||||
获取type为before user1的代办数量 >> 2
|
||||
获取type为cycle user1的代办数量 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$typeList = array('today', 'yesterday', 'thisweek', 'lastweek', 'thismonth', 'lastmonth', 'thisseason', 'thisyear', 'future', 'before', 'cycle');
|
||||
$account = 'user1';
|
||||
|
||||
$todo = new todoTest();
|
||||
|
||||
r($todo->getListTest($typeList[0])) && p() && e('0'); // 获取type为today 当前用户的代办数量
|
||||
r($todo->getListTest($typeList[1])) && p() && e('0'); // 获取type为yesterday 当前用户的代办数量
|
||||
r($todo->getListTest($typeList[2])) && p() && e('0'); // 获取type为thisweek 当前用户的代办数量
|
||||
r($todo->getListTest($typeList[3])) && p() && e('1'); // 获取type为lastweek 当前用户的代办数量
|
||||
r($todo->getListTest($typeList[4])) && p() && e('1'); // 获取type为thismonth 当前用户的代办数量
|
||||
r($todo->getListTest($typeList[5])) && p() && e('1'); // 获取type为lastmonth 当前用户的代办数量
|
||||
r($todo->getListTest($typeList[6])) && p() && e('2'); // 获取type为thisseason 当前用户的代办数量
|
||||
r($todo->getListTest($typeList[7])) && p() && e('2'); // 获取type为thisyear 当前用户的代办数量
|
||||
r($todo->getListTest($typeList[8])) && p() && e('0'); // 获取type为future 当前用户的代办数量
|
||||
r($todo->getListTest($typeList[9])) && p() && e('2'); // 获取type为before 当前用户的代办数量
|
||||
r($todo->getListTest($typeList[10])) && p() && e('0'); // 获取type为cycle 当前用户的代办数量
|
||||
r($todo->getListTest($typeList[0], $account)) && p() && e('0'); // 获取type为today user1的代办数量
|
||||
r($todo->getListTest($typeList[1], $account)) && p() && e('0'); // 获取type为yesterday user1的代办数量
|
||||
r($todo->getListTest($typeList[2], $account)) && p() && e('0'); // 获取type为thisweek user1的代办数量
|
||||
r($todo->getListTest($typeList[3], $account)) && p() && e('1'); // 获取type为lastweek user1的代办数量
|
||||
r($todo->getListTest($typeList[4], $account)) && p() && e('1'); // 获取type为thismonth user1的代办数量
|
||||
r($todo->getListTest($typeList[5], $account)) && p() && e('1'); // 获取type为lastmonth user1的代办数量
|
||||
r($todo->getListTest($typeList[6], $account)) && p() && e('2'); // 获取type为thisseason user1的代办数量
|
||||
r($todo->getListTest($typeList[7], $account)) && p() && e('2'); // 获取type为thisyear user1的代办数量
|
||||
r($todo->getListTest($typeList[8], $account)) && p() && e('0'); // 获取type为future user1的代办数量
|
||||
r($todo->getListTest($typeList[9], $account)) && p() && e('2'); // 获取type为before user1的代办数量
|
||||
r($todo->getListTest($typeList[10], $account)) && p() && e('0'); // 获取type为cycle user1的代办数量
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/todo.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 todoModel->start();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
开始一个状态为wait的todo >> doing
|
||||
开始一个状态为doing的todo >> doing
|
||||
开始一个状态为done的todo >> doing
|
||||
|
||||
*/
|
||||
|
||||
$todoIDList = array('1', '2', '3');
|
||||
|
||||
$todo = new todoTest();
|
||||
|
||||
r($todo->startTest($todoIDList[0])) && p('status') && e('doing'); // 开始一个状态为wait的todo
|
||||
r($todo->startTest($todoIDList[1])) && p('status') && e('doing'); // 开始一个状态为doing的todo
|
||||
r($todo->startTest($todoIDList[2])) && p('status') && e('doing'); // 开始一个状态为done的todo
|
||||
system("./ztest init");
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/todo.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 todoModel->update();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试更新todo名称 >> name,自定义1的待办,john
|
||||
测试更新todo类型 >> type,custom,bug
|
||||
测试更新todo名称和类型 >> type,bug,custom;name,BUG2的待办,jack
|
||||
测试不更新todo任何数据 >> 没有数据更新
|
||||
|
||||
*/
|
||||
|
||||
$todoIDList = array('1', '2');
|
||||
|
||||
$t_upname = array('name' => 'john');
|
||||
$t_uptype = array('type' => 'bug', 'idvalue' => '1');
|
||||
$t_typename = array('name' => 'jack', 'type' => 'custom');
|
||||
$t_unname = array('name' => 'john');
|
||||
|
||||
|
||||
$todo = new todoTest();
|
||||
|
||||
r($todo->updateTest($todoIDList[0], $t_upname)) && p('0:field,old,new') && e('name,自定义1的待办,john'); // 测试更新todo名称
|
||||
r($todo->updateTest($todoIDList[0], $t_uptype)) && p('0:field,old,new') && e('type,custom,bug'); // 测试更新todo类型
|
||||
r($todo->updateTest($todoIDList[1], $t_typename)) && p('0:field,old,new;1:field,old,new') && e('type,bug,custom;name,BUG2的待办,jack'); // 测试更新todo名称和类型
|
||||
r($todo->updateTest($todoIDList[0], $t_unname)) && p() && e('没有数据更新'); // 测试不更新todo任何数据
|
||||
system("./ztest init");
|
||||
@@ -43,6 +43,11 @@ switch($argv[1])
|
||||
case 'company':
|
||||
ztfRun('model/company');
|
||||
break;
|
||||
case 'todo':
|
||||
ztfRun('model/todo');
|
||||
case 'dept':
|
||||
ztfRun('model/dept');
|
||||
break;
|
||||
case 'model':
|
||||
ztfRun('model');
|
||||
break;
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ use PHP_CodeSniffer_Tokens as Tokens;
|
||||
*
|
||||
* PHP version 7.1
|
||||
*
|
||||
* @link https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.nullable-types
|
||||
* @link https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.nullabel-types
|
||||
* @link https://wiki.php.net/rfc/nullable_types
|
||||
* @link https://www.php.net/manual/en/functions.arguments.php#example-146
|
||||
*
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
if(!empty($moduleExtPaths))
|
||||
{
|
||||
$extActionFile = $moduleExtPaths['common'] . $methodName . '.php';
|
||||
if(file_exists($extActionFile))
|
||||
{
|
||||
$control = $extActionFile;
|
||||
}
|
||||
else
|
||||
{
|
||||
$extActionFile = $moduleExtPaths['xuan'] . $methodName . '.php';
|
||||
if(file_exists($extActionFile)) $control = $extActionFile;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user