* Task#3586.
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
ALTER TABLE `zt_story` CHANGE `stage` `stage` ENUM('','wait','planned','projected','developing','developed','testing','tested','verified','released','closed') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'wait';
|
||||
ALTER TABLE `zt_todo` ADD `config` varchar(255) NOT NULL;
|
||||
ALTER TABLE `zt_todo` ADD `cycle` tinyint unsigned NOT NULL DEFAULT '0' AFTER `type`;
|
||||
ALTER TABLE `zt_todo` ADD `assignedTo` VARCHAR(30) NOT NULL DEFAULT '' AFTER `config`;
|
||||
ALTER TABLE `zt_todo` ADD `assignedBy` VARCHAR(30) NOT NULL DEFAULT '' AFTER `assignedTo`;
|
||||
ALTER TABLE `zt_todo` ADD `assignedDate` DATETIME NOT NULL AFTER `assignedBy`;
|
||||
ALTER TABLE `zt_todo` ADD `finishedBy` VARCHAR(30) NOT NULL DEFAULT '' AFTER `assignedDate`;
|
||||
ALTER TABLE `zt_todo` ADD `finishedDate` DATETIME NOT NULL AFTER `finishedBy`;
|
||||
ALTER TABLE `zt_todo` ADD `closedBy` VARCHAR(30) NOT NULL DEFAULT '' AFTER `finishedDate`;
|
||||
ALTER TABLE `zt_todo` ADD `closedDate` DATETIME NOT NULL AFTER `closedBy`;
|
||||
ALTER TABLE `zt_todo` CHANGE `status` `status` ENUM('wait','doing','done','closed') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'wait';
|
||||
|
||||
INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`, `lastTime`) VALUES
|
||||
('1', '1', '*', '*', '*', 'moduleName=todo&methodName=createCycle', '生成周期性待办', 'zentao', 1, 'normal', '0000-00-00 00:00:00');
|
||||
|
||||
|
||||
@@ -742,21 +742,30 @@ CREATE TABLE IF NOT EXISTS `zt_testtask` (
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_todo`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_todo` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`account` char(30) NOT NULL,
|
||||
`date` date NOT NULL,
|
||||
`begin` smallint(4) unsigned zerofill NOT NULL,
|
||||
`end` smallint(4) unsigned zerofill NOT NULL,
|
||||
`type` char(10) NOT NULL,
|
||||
`idvalue` mediumint(8) unsigned NOT NULL default '0',
|
||||
`cycle` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`idvalue` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||
`pri` tinyint(3) unsigned NOT NULL,
|
||||
`name` char(150) NOT NULL,
|
||||
`desc` text NOT NULL,
|
||||
`status` enum('wait','doing','done') NOT NULL DEFAULT 'wait',
|
||||
`status` enum('wait','doing','done','closed') NOT NULL DEFAULT 'wait',
|
||||
`private` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
`config` varchar(255) NOT NULL,
|
||||
`assignedTo` varchar(30) NOT NULL DEFAULT '',
|
||||
`assignedBy` varchar(30) NOT NULL DEFAULT '',
|
||||
`assignedDate` datetime NOT NULL,
|
||||
`finishedBy` varchar(30) NOT NULL DEFAULT '',
|
||||
`finishedDate` datetime NOT NULL,
|
||||
`closedBy` varchar(30) NOT NULL DEFAULT '',
|
||||
`closedDate` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `todo` (`account`,`date`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_user`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_user` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
@@ -787,7 +796,7 @@ CREATE TABLE IF NOT EXISTS `zt_user` (
|
||||
`fails` tinyint(5) NOT NULL default '0',
|
||||
`locked` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`ranzhi` char(30) NOT NULL default '',
|
||||
`score` INT(12) NOT NULL DEFAULT '0',
|
||||
`score` INT(11) NOT NULL DEFAULT '0',
|
||||
`scoreLevel` INT(11) NOT NULL DEFAULT '0',
|
||||
`deleted` enum('0','1') NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
|
||||
@@ -108,6 +108,9 @@ class my extends control
|
||||
$this->view->account = $this->app->user->account;
|
||||
$this->view->orderBy = $orderBy == 'date_desc,status,begin,id_desc' ? '' : $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->times = date::buildTimeList($this->config->todo->times->begin, $this->config->todo->times->end, $this->config->todo->times->delta);
|
||||
$this->view->time = date::now();
|
||||
$this->view->members = $this->loadModel('user')->getPairs();
|
||||
$this->view->importFuture = ($type != 'today');
|
||||
|
||||
$this->display();
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<?php js::set('confirmDelete', $lang->todo->confirmDelete)?>
|
||||
<div id='featurebar'>
|
||||
<ul class='nav'>
|
||||
<?php
|
||||
<?php
|
||||
foreach($lang->todo->periods as $period => $label)
|
||||
{
|
||||
$vars = "date=$period";
|
||||
@@ -24,20 +24,20 @@
|
||||
}
|
||||
echo "<li id='byDate'>" . html::input('date', $date,"class='form-control form-date' onchange='changeDate(this.value)' autocomplete='off'") . '</li>';
|
||||
|
||||
if(is_numeric($type))
|
||||
if(is_numeric($type))
|
||||
{
|
||||
if($date == date('Y-m-d'))
|
||||
{
|
||||
$type = 'today';
|
||||
$type = 'today';
|
||||
}
|
||||
else if($date == date('Y-m-d', strtotime('-1 day')))
|
||||
{
|
||||
$type = 'yesterday';
|
||||
$type = 'yesterday';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<script>$('#<?php echo $type;?>').addClass('active')</script>
|
||||
</ul>
|
||||
</ul>
|
||||
<div class='actions'>
|
||||
<?php echo html::a(helper::createLink('todo', 'export', "account=$account&orderBy=id_desc"), "<i class='icon-download-alt'></i> " . $lang->todo->export, '', "class='btn export'") ?>
|
||||
<?php echo html::a(helper::createLink('todo', 'batchCreate', "date=" . str_replace('-', '', $date)), "<i class='icon-plus-sign'></i> " . $lang->todo->batchCreate, '', "class='btn'") ?>
|
||||
@@ -57,7 +57,7 @@
|
||||
<th class='w-hour'> <?php common::printOrderLink('begin', $orderBy, $vars, $lang->todo->beginAB);?></th>
|
||||
<th class='w-hour'> <?php common::printOrderLink('end', $orderBy, $vars, $lang->todo->endAB);?></th>
|
||||
<th class='w-status'><?php common::printOrderLink('status', $orderBy, $vars, $lang->todo->status);?></th>
|
||||
<th class='w-80px {sorter:false}'><?php echo $lang->actions;?></th>
|
||||
<th class='w-100px {sorter:false}'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -77,8 +77,11 @@
|
||||
<td><?php echo $todo->end;?></td>
|
||||
<td class='<?php echo $todo->status;?>'><?php echo $lang->todo->statusList[$todo->status];?></td>
|
||||
<td class='text-right'>
|
||||
<?php
|
||||
common::printIcon('todo', 'finish', "id=$todo->id", $todo, 'list', 'ok-sign', 'hiddenwin');
|
||||
<?php
|
||||
if($todo->status != 'done') echo html::a(helper::createLink('todo', 'assignto', "todoID=$todo->id"), '<i class="icon icon-hand-right"></i>', '', "data-toggle='assigntoModal' class='btn-icon'");
|
||||
if($todo->status == 'done') common::printIcon('todo', 'activate', "id=$todo->id", $todo, 'list', 'magic', 'hiddenwin');
|
||||
if($todo->status != 'done') common::printIcon('todo', 'finish', "id=$todo->id", $todo, 'list', 'ok-sign', 'hiddenwin');
|
||||
if($todo->status == 'done') common::printIcon('todo', 'close', "id=$todo->id", $todo, 'list', 'off', 'hiddenwin');
|
||||
common::printIcon('todo', 'edit', "id=$todo->id", '', 'list', 'pencil', '', 'iframe', true);
|
||||
|
||||
if(common::hasPriv('todo', 'delete'))
|
||||
@@ -97,7 +100,7 @@
|
||||
<td colspan='9' align='left'>
|
||||
<?php if($type != 'cycle'):?>
|
||||
<div class='table-actions clearfix'>
|
||||
<?php
|
||||
<?php
|
||||
if(common::hasPriv('todo', 'batchEdit') or (common::hasPriv('todo', 'import2Today') and $importFuture))
|
||||
{
|
||||
echo html::selectButton();
|
||||
@@ -134,5 +137,6 @@
|
||||
<?php endif;?>
|
||||
</table>
|
||||
</form>
|
||||
<?php include '../../todo/view/assignto.html.php';?>
|
||||
<?php js::set('listName', 'todoList')?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -13,7 +13,7 @@ class todo extends control
|
||||
{
|
||||
/**
|
||||
* Construct function, load model of task, bug, my.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -28,9 +28,9 @@ class todo extends control
|
||||
|
||||
/**
|
||||
* Create a todo.
|
||||
*
|
||||
* @param string|date $date
|
||||
* @param string $account
|
||||
*
|
||||
* @param string|date $date
|
||||
* @param string $account
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -46,11 +46,11 @@ class todo extends control
|
||||
$date = str_replace('-', '', $this->post->date);
|
||||
if($date == '')
|
||||
{
|
||||
$date = 'future';
|
||||
$date = 'future';
|
||||
}
|
||||
elseif($date == date('Ymd'))
|
||||
{
|
||||
$date = 'today';
|
||||
$date = 'today';
|
||||
}
|
||||
|
||||
if(!empty($_POST['idvalue'])) $this->send(array('result' => 'success'));
|
||||
@@ -64,14 +64,14 @@ class todo extends control
|
||||
$this->view->date = date("Y-m-d", strtotime($date));
|
||||
$this->view->times = date::buildTimeList($this->config->todo->times->begin, $this->config->todo->times->end, $this->config->todo->times->delta);
|
||||
$this->view->time = date::now();
|
||||
$this->display();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch create todo
|
||||
*
|
||||
* @param string $date
|
||||
* @param string $account
|
||||
*
|
||||
* @param string $date
|
||||
* @param string $account
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -87,11 +87,11 @@ class todo extends control
|
||||
$date = str_replace('-', '', $this->post->date);
|
||||
if($date == '')
|
||||
{
|
||||
$date = 'future';
|
||||
$date = 'future';
|
||||
}
|
||||
else if($date == date('Ymd'))
|
||||
{
|
||||
$date= 'today';
|
||||
$date= 'today';
|
||||
}
|
||||
die(js::locate($this->createLink('my', 'todo', "type=$date"), 'parent'));
|
||||
}
|
||||
@@ -114,8 +114,8 @@ class todo extends control
|
||||
|
||||
/**
|
||||
* Edit a todo.
|
||||
*
|
||||
* @param int $todoID
|
||||
*
|
||||
* @param int $todoID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -137,7 +137,7 @@ class todo extends control
|
||||
/* Judge a private todo or not, If private, die. */
|
||||
$todo = $this->todo->getById($todoID);
|
||||
if($todo->private and $this->app->user->account != $todo->account) die('private');
|
||||
|
||||
|
||||
$todo->date = date("Y-m-d", strtotime($todo->date));
|
||||
$this->view->title = $this->lang->todo->common . $this->lang->colon . $this->lang->todo->edit;
|
||||
$this->view->position[] = $this->lang->todo->common;
|
||||
@@ -149,11 +149,11 @@ class todo extends control
|
||||
|
||||
/**
|
||||
* Batch edit todo.
|
||||
*
|
||||
*
|
||||
* @param string $from example:myTodo, todoBatchEdit.
|
||||
* @param string $type
|
||||
* @param string $account
|
||||
* @param string $status
|
||||
* @param string $type
|
||||
* @param string $account
|
||||
* @param string $status
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -174,14 +174,14 @@ class todo extends control
|
||||
if($this->post->todoIDList) $todoIDList = $this->post->todoIDList;
|
||||
|
||||
/* Initialize todos whose need to edited. */
|
||||
foreach($allTodos as $todo)
|
||||
foreach($allTodos as $todo)
|
||||
{
|
||||
if(in_array($todo->id, $todoIDList))
|
||||
{
|
||||
$editedTodos[$todo->id] = $todo;
|
||||
}
|
||||
}
|
||||
foreach($editedTodos as $todo)
|
||||
foreach($editedTodos as $todo)
|
||||
{
|
||||
if($todo->type == 'story') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_STORY)->fetch('title');
|
||||
if($todo->type == 'task') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TASK)->fetch('name');
|
||||
@@ -233,10 +233,61 @@ class todo extends control
|
||||
}
|
||||
|
||||
/**
|
||||
* View a todo.
|
||||
*
|
||||
* @param int $todoID
|
||||
* @param string $from my|company
|
||||
* Activated todo.
|
||||
*
|
||||
* @param $todoID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function activate($todoID)
|
||||
{
|
||||
$todo = $this->todo->getById($todoID);
|
||||
if($todo->status == 'done') $this->todo->activate($todoID);
|
||||
if(isonlybody()) die(js::reload('parent.parent'));
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Closed todo.
|
||||
*
|
||||
* @param $todoID
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function close($todoID)
|
||||
{
|
||||
$todo = $this->todo->getById($todoID);
|
||||
if($todo->status == 'done') $this->todo->close($todoID);
|
||||
if(isonlybody()) die(js::reload('parent.parent'));
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign.
|
||||
*
|
||||
* @param $todoID
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function assignTo($todoID)
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
if(empty($_POST['assignedTo'])) die(js::error($this->lang->todo->noAssignedTo));
|
||||
$this->todo->assignTo($todoID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* View a todo.
|
||||
*
|
||||
* @param int $todoID
|
||||
* @param string $from my|company
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -288,8 +339,8 @@ class todo extends control
|
||||
|
||||
/**
|
||||
* Delete a todo.
|
||||
*
|
||||
* @param int $todoID
|
||||
*
|
||||
* @param int $todoID
|
||||
* @param string $confirm yes|no
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -327,8 +378,8 @@ class todo extends control
|
||||
|
||||
/**
|
||||
* Finish a todo.
|
||||
*
|
||||
* @param int $todoID
|
||||
*
|
||||
* @param int $todoID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -349,7 +400,7 @@ class todo extends control
|
||||
|
||||
/**
|
||||
* Batch finish todos.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -357,7 +408,7 @@ class todo extends control
|
||||
{
|
||||
if(!empty($_POST['todoIDList']))
|
||||
{
|
||||
foreach($_POST['todoIDList'] as $todoID)
|
||||
foreach($_POST['todoIDList'] as $todoID)
|
||||
{
|
||||
$todo = $this->todo->getById($todoID);
|
||||
if($todo->status != 'done') $this->todo->finish($todoID);
|
||||
@@ -368,7 +419,7 @@ class todo extends control
|
||||
|
||||
/**
|
||||
* Import selected todoes to today.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -381,10 +432,10 @@ class todo extends control
|
||||
}
|
||||
|
||||
/**
|
||||
* Get data to export
|
||||
*
|
||||
* @param string $productID
|
||||
* @param string $orderBy
|
||||
* Get data to export
|
||||
*
|
||||
* @param string $productID
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -446,8 +497,8 @@ class todo extends control
|
||||
|
||||
/**
|
||||
* AJAX: get actions of a todo. for web app.
|
||||
*
|
||||
* @param int $todoID
|
||||
*
|
||||
* @param int $todoID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -459,7 +510,7 @@ class todo extends control
|
||||
|
||||
/**
|
||||
* Create cycle.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@@ -12,8 +12,11 @@
|
||||
$lang->todo->common = 'Todo';
|
||||
$lang->todo->index = "Home";
|
||||
$lang->todo->create = "Create Todo";
|
||||
$lang->todo->assignTo = "Assign";
|
||||
$lang->todo->activate = "Activate";
|
||||
$lang->todo->batchCreate = "Batch Create";
|
||||
$lang->todo->edit = "Edit";
|
||||
$lang->todo->close = "Close";
|
||||
$lang->todo->batchEdit = "Batch Edit";
|
||||
$lang->todo->view = "Overview";
|
||||
$lang->todo->finish = "Finish";
|
||||
@@ -59,9 +62,10 @@ $lang->todo->confirmBug = 'This Todo is related to Bug #%s. Do you want to edi
|
||||
$lang->todo->confirmTask = 'This Todo is related to Task #%s,Do you want to edit it?';
|
||||
$lang->todo->confirmStory = 'This Todo is related to Story #%s,Do you want to edit it?';
|
||||
|
||||
$lang->todo->statusList['wait'] = 'Wait';
|
||||
$lang->todo->statusList['doing'] = 'Doing';
|
||||
$lang->todo->statusList['done'] = 'Done';
|
||||
$lang->todo->statusList['wait'] = 'Wait';
|
||||
$lang->todo->statusList['doing'] = 'Doing';
|
||||
$lang->todo->statusList['done'] = 'Done';
|
||||
$lang->todo->statusList['closed'] = 'Closed';
|
||||
//$lang->todo->statusList['cancel'] = 'Cancelled';
|
||||
//$lang->todo->statusList['postpone'] = 'Delayed';
|
||||
|
||||
@@ -86,6 +90,7 @@ $lang->todo->thisIsPrivate = 'This is a private Todo';
|
||||
$lang->todo->lblDisableDate = 'Set later.';
|
||||
$lang->todo->lblBeforeDays = "%s early in advance to be done";
|
||||
$lang->todo->noTodo = 'No this type of Todo.';
|
||||
$lang->todo->noAssignedTo = "The AssignedTo user can't be empty.";
|
||||
|
||||
$lang->todo->periods['today'] = 'Today';
|
||||
$lang->todo->periods['yesterday'] = 'Yesterday';
|
||||
|
||||
@@ -12,14 +12,17 @@
|
||||
$lang->todo->common = '待办';
|
||||
$lang->todo->index = "待办一览";
|
||||
$lang->todo->create = "新增";
|
||||
$lang->todo->assignTo = "指派";
|
||||
$lang->todo->activate = "激活";
|
||||
$lang->todo->batchCreate = "批量添加";
|
||||
$lang->todo->edit = "更新待办";
|
||||
$lang->todo->edit = "编辑";
|
||||
$lang->todo->close = "关闭";
|
||||
$lang->todo->batchEdit = "批量编辑";
|
||||
$lang->todo->view = "待办详情";
|
||||
$lang->todo->finish = "完成";
|
||||
$lang->todo->batchFinish = "批量完成";
|
||||
$lang->todo->export = "导出";
|
||||
$lang->todo->delete = "删除待办";
|
||||
$lang->todo->delete = "删除";
|
||||
$lang->todo->import2Today = "导入到今天";
|
||||
$lang->todo->import = "导入";
|
||||
$lang->todo->legendBasic = "基本信息";
|
||||
@@ -59,9 +62,10 @@ $lang->todo->confirmBug = '该Todo关联的是Bug #%s,需要修改它吗?'
|
||||
$lang->todo->confirmTask = '该Todo关联的是Task #%s,需要修改它吗?';
|
||||
$lang->todo->confirmStory = '该Todo关联的是Story #%s,需要修改它吗?';
|
||||
|
||||
$lang->todo->statusList['wait'] = '未开始';
|
||||
$lang->todo->statusList['doing'] = '进行中';
|
||||
$lang->todo->statusList['done'] = '已完成';
|
||||
$lang->todo->statusList['wait'] = '未开始';
|
||||
$lang->todo->statusList['doing'] = '进行中';
|
||||
$lang->todo->statusList['done'] = '已完成';
|
||||
$lang->todo->statusList['closed'] = '已关闭';
|
||||
//$lang->todo->statusList['cancel'] = '已取消';
|
||||
//$lang->todo->statusList['postpone'] = '已延期';
|
||||
|
||||
@@ -86,6 +90,7 @@ $lang->todo->thisIsPrivate = '这是一条私人事务。:)';
|
||||
$lang->todo->lblDisableDate = '暂时不设定时间';
|
||||
$lang->todo->lblBeforeDays = "提前%s天生成待办";
|
||||
$lang->todo->noTodo = '该类型没有待办事务';
|
||||
$lang->todo->noAssignedTo = '被指派人不能为空';
|
||||
|
||||
$lang->todo->periods['today'] = '今日';
|
||||
$lang->todo->periods['yesterday'] = '昨日';
|
||||
|
||||
@@ -15,9 +15,9 @@ class todoModel extends model
|
||||
{
|
||||
/**
|
||||
* Create a todo.
|
||||
*
|
||||
* @param date $date
|
||||
* @param string $account
|
||||
*
|
||||
* @param date $date
|
||||
* @param string $account
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -81,7 +81,7 @@ class todoModel extends model
|
||||
|
||||
/**
|
||||
* Create batch todo
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -116,7 +116,7 @@ class todoModel extends model
|
||||
if($todo->type == 'story') $todo->idvalue = isset($todos->storys[$i + 1]) ? $todos->storys[$i + 1] : 0;
|
||||
|
||||
$this->dao->insert(TABLE_TODO)->data($todo)->autoCheck()->exec();
|
||||
if(dao::isError())
|
||||
if(dao::isError())
|
||||
{
|
||||
echo js::error(dao::getError());
|
||||
die(js::reload('parent'));
|
||||
@@ -139,8 +139,8 @@ class todoModel extends model
|
||||
|
||||
/**
|
||||
* update a todo.
|
||||
*
|
||||
* @param int $todoID
|
||||
*
|
||||
* @param int $todoID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -198,7 +198,7 @@ class todoModel extends model
|
||||
|
||||
/**
|
||||
* Batch update todos.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -235,7 +235,7 @@ class todoModel extends model
|
||||
if($oldTodo->type == 'bug' or $oldTodo->type == 'task') $oldTodo->name = '';
|
||||
$this->dao->update(TABLE_TODO)->data($todo)
|
||||
->autoCheck()
|
||||
->checkIF($todo->type == 'custom', $this->config->todo->edit->requiredFields, 'notempty')
|
||||
->checkIF($todo->type == 'custom', $this->config->todo->edit->requiredFields, 'notempty')
|
||||
->checkIF($todo->type == 'bug', 'idvalue', 'notempty')
|
||||
->checkIF($todo->type == 'task', 'idvalue', 'notempty')
|
||||
->where('id')->eq($todoID)
|
||||
@@ -243,7 +243,7 @@ class todoModel extends model
|
||||
|
||||
if($oldTodo->status != 'done' and $todo->status == 'done') $this->loadModel('action')->create('todo', $todoID, 'finished', '', 'done');
|
||||
|
||||
if(!dao::isError())
|
||||
if(!dao::isError())
|
||||
{
|
||||
$allChanges[$todoID] = common::createChanges($oldTodo, $todo);
|
||||
}
|
||||
@@ -259,23 +259,28 @@ class todoModel extends model
|
||||
|
||||
/**
|
||||
* Change the status of a todo.
|
||||
*
|
||||
* @param string $todoID
|
||||
* @param string $status
|
||||
*
|
||||
* @param string $todoID
|
||||
* @param string $status
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function finish($todoID)
|
||||
{
|
||||
$this->dao->update(TABLE_TODO)->set('status')->eq('done')->where('id')->eq((int)$todoID)->exec();
|
||||
$this->dao->update(TABLE_TODO)
|
||||
->set('status')->eq('done')
|
||||
->set('finishedBy')->eq($this->app->user->account)
|
||||
->set('finishedDate')->eq(helper::now())
|
||||
->where('id')->eq((int)$todoID)
|
||||
->exec();
|
||||
$this->loadModel('action')->create('todo', $todoID, 'finished', '', 'done');
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get info of a todo.
|
||||
*
|
||||
* @param int $todoID
|
||||
*
|
||||
* @param int $todoID
|
||||
* @param bool $setImgSize
|
||||
* @access public
|
||||
* @return object|bool
|
||||
@@ -295,11 +300,11 @@ class todoModel extends model
|
||||
|
||||
/**
|
||||
* Get todo list of a user.
|
||||
*
|
||||
* @param date $date
|
||||
* @param string $account
|
||||
*
|
||||
* @param date $date
|
||||
* @param string $account
|
||||
* @param string $status all|today|thisweek|lastweek|before, or a date.
|
||||
* @param int $limit
|
||||
* @param int $limit
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -309,12 +314,12 @@ class todoModel extends model
|
||||
$todos = array();
|
||||
$date = strtolower($date);
|
||||
|
||||
if($date == 'today')
|
||||
if($date == 'today')
|
||||
{
|
||||
$begin = date::today();
|
||||
$end = $begin;
|
||||
}
|
||||
elseif($date == 'yesterday')
|
||||
elseif($date == 'yesterday')
|
||||
{
|
||||
$begin = date::yesterday();
|
||||
$end = $begin;
|
||||
@@ -381,7 +386,7 @@ class todoModel extends model
|
||||
->beginIF($limit > 0)->limit($limit)->fi()
|
||||
->page($pager)
|
||||
->query();
|
||||
|
||||
|
||||
/* Set session. */
|
||||
$sql = explode('WHERE', $this->dao->get());
|
||||
$sql = explode('ORDER', $sql[1]);
|
||||
@@ -409,9 +414,9 @@ class todoModel extends model
|
||||
|
||||
/**
|
||||
* Judge an action is clickable or not.
|
||||
*
|
||||
* @param object $todo
|
||||
* @param string $action
|
||||
*
|
||||
* @param object $todo
|
||||
* @param string $action
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -429,9 +434,9 @@ class todoModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* CreateByCycle
|
||||
*
|
||||
* @param int $todoList
|
||||
* CreateByCycle
|
||||
*
|
||||
* @param int $todoList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -495,4 +500,55 @@ class todoModel extends model
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate todo.
|
||||
*
|
||||
* @param $todoID
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function activate($todoID)
|
||||
{
|
||||
$this->dao->update(TABLE_TODO)->set('status')->eq('wait')->where('id')->eq((int)$todoID)->exec();
|
||||
$this->loadModel('action')->create('todo', $todoID, 'activated', '', 'wait');
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Closed todo.
|
||||
*
|
||||
* @param $todoID
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function close($todoID)
|
||||
{
|
||||
$this->dao->update(TABLE_TODO)
|
||||
->set('status')->eq('closed')
|
||||
->set('closedBy')->eq($this->app->user->account)
|
||||
->set('closedDate')->eq(helper::now())
|
||||
->where('id')->eq((int)$todoID)
|
||||
->exec();
|
||||
$this->loadModel('action')->create('todo', $todoID, 'closed', '', 'closed');
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
public function assignTo($todoID)
|
||||
{
|
||||
$todo = fixer::input('post')
|
||||
->add('assignedBy', $this->app->user->account)
|
||||
->add('assignedDate', helper::now())
|
||||
->setIF(isset($_POST['future']), 'date', '2030-01-01')
|
||||
->setIF(isset($_POST['lblDisableDate']), 'begin', '2400')
|
||||
->setIF(isset($_POST['lblDisableDate']), 'end', '2400')
|
||||
->remove('future,lblDisableDate')
|
||||
->get();
|
||||
|
||||
$this->dao->update(TABLE_TODO)->data($todo)->where('id')->eq((int)$todoID)->exec();
|
||||
$this->loadModel('action')->create('todo', $todoID, 'assigned', '', 'assigned');
|
||||
return !dao::isError();
|
||||
}
|
||||
}
|
||||
|
||||
88
module/todo/view/assignto.html.php
Executable file
88
module/todo/view/assignto.html.php
Executable file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* The batch create view of todo module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Congzhi Chen <congzhi@cnezsoft.com>
|
||||
* @package todo
|
||||
* @version $Id: create.html.php 2741 2012-04-07 07:24:21 $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<div class="modal fade" id="assigntoModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title"><i class="icon-file-text"></i> <?php echo $lang->todo->assignTo;?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class='form-condensed' method='post' target='hiddenwin' id="todoAssignForm">
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->todo->assignTo;?></th>
|
||||
<td class='w-p25-f'>
|
||||
<?php echo html::select('assignedTo', $members, '', "class='form-control chosen'");?>
|
||||
</td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->date;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::input('date', $date, "class='form-control form-date' id='todoDate'");?>
|
||||
<span class='input-group-addon'><input type='checkbox' name="future" id='switchDate' onclick='switchDateTodo(this);'> <?php echo $lang->todo->periods['future'];?></span>
|
||||
</div>
|
||||
</td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->beginAndEnd;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('begin', $times, date('Y-m-d') != $date ? key($times) : $time, 'onchange=selectNext(); class="form-control chosen" style="width: 50%;"') . html::select('end', $times, '', 'class="form-control chosen" style="width: 50%; margin-left:-1px"');?>
|
||||
</div>
|
||||
</td>
|
||||
<td><input type='checkbox' id='switchDate' onclick='switchDateFeature(this);' name="lblDisableDate"> <?php echo $lang->todo->lblDisableDate;?></td>
|
||||
</tr>
|
||||
<tfoot>
|
||||
<tr><td colspan='3'><?php echo html::submitButton();?></td></tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$("a[data-toggle='assigntoModal']").on('click', function(){
|
||||
$('#assigntoModal').modal('show');
|
||||
$('#todoAssignForm').attr('action', $(this).attr('href'));
|
||||
return false;
|
||||
});
|
||||
function switchDateTodo(switcher)
|
||||
{
|
||||
if(switcher.checked)
|
||||
{
|
||||
$('#todoDate').attr('disabled','disabled');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#todoDate').removeAttr('disabled');
|
||||
}
|
||||
}
|
||||
|
||||
function switchDateFeature(switcher)
|
||||
{
|
||||
if(switcher.checked)
|
||||
{
|
||||
$('#begin').attr('disabled','disabled').trigger('chosen:updated');
|
||||
$('#end').attr('disabled','disabled').trigger('chosen:updated');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#begin').removeAttr('disabled').trigger('chosen:updated');
|
||||
$('#end').removeAttr('disabled').trigger('chosen:updated');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -24,7 +24,7 @@
|
||||
<div class='main'>
|
||||
<fieldset>
|
||||
<legend>
|
||||
<?php
|
||||
<?php
|
||||
echo $lang->todo->desc;
|
||||
if($todo->type == 'bug') echo html::a($this->createLink('bug', 'view', "id={$todo->idvalue}"), ' BUG#' . $todo->idvalue);
|
||||
if($todo->type == 'task') echo html::a($this->createLink('task', 'view', "id={$todo->idvalue}"), ' TASK#' . $todo->idvalue);
|
||||
@@ -40,7 +40,7 @@
|
||||
<div class='main main-side'>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->todo->legendBasic;?></legend>
|
||||
<table class='table table-data table-condensed table-borderless'>
|
||||
<table class='table table-data table-condensed table-borderless'>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->pri;?></th>
|
||||
<td><?php echo $lang->todo->priList[$todo->pri];?></td>
|
||||
@@ -71,7 +71,7 @@
|
||||
<?php $todo->config = json_decode($todo->config);?>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->todo->cycle;?></legend>
|
||||
<table class='table table-data table-condensed table-borderless'>
|
||||
<table class='table table-data table-condensed table-borderless'>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->todo->beginAndEnd?></th>
|
||||
<td><?php echo $todo->config->begin . " ~ " . $todo->config->end;?></td>
|
||||
@@ -105,6 +105,15 @@
|
||||
</div>
|
||||
<div class='panel-footer text-center'>
|
||||
<?php
|
||||
if($todo->account == $app->user->account)
|
||||
{
|
||||
//if($todo->status != 'done') echo html::a($this->createLink('todo', 'assignTo', "todoID=$todo->id"), "<i class='icon icon-hand-right'></i> " . $lang->todo->assignTo, '', "class='btn showinonlybody'");
|
||||
if($todo->status != 'closed') echo html::a($this->createLink('todo', 'edit', "todoID=$todo->id"), "<i class='icon icon-edit'></i> " . $lang->todo->edit, '', "class='btn showinonlybody'");
|
||||
if($todo->status == 'done' || $todo->status == 'closed') echo html::a($this->createLink('todo', 'activate', "todoID=$todo->id"), "<i class='icon icon-magic'></i> " . $lang->todo->activate, 'hiddenwin', "class='btn showinonlybody'");
|
||||
if($todo->status == 'done') echo html::a($this->createLink('todo', 'close', "todoID=$todo->id"), "<i class='icon icon-off'></i> " . $lang->todo->close, 'hiddenwin', "class='btn showinonlybody'");
|
||||
echo html::a($this->createLink('todo', 'delete', "todoID=$todo->id"), "<i class='icon icon-remove'></i> " . $lang->todo->delete, 'hiddenwin', "class='btn showinonlybody'");
|
||||
}
|
||||
|
||||
if($this->session->todoList)
|
||||
{
|
||||
$browseLink = $this->session->todoList;
|
||||
@@ -118,7 +127,7 @@
|
||||
$browseLink = $this->createLink('user', 'todo', "account=$todo->account");
|
||||
}
|
||||
|
||||
if($todo->status != 'done')
|
||||
if($todo->status != 'done' && $todo->status != 'closed')
|
||||
{
|
||||
echo "<div class='btn-group dropup'>";
|
||||
echo html::a($this->createLink('todo', 'finish', "id=$todo->id", 'html', true), "<i class='icon icon-ok'></i> " . $lang->todo->finish, 'hiddenwin', "class='btn showinonlybody btn-success'");
|
||||
@@ -140,11 +149,6 @@
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
if($todo->account == $app->user->account)
|
||||
{
|
||||
common::printIcon('todo', 'edit', "todoID=$todo->id");
|
||||
common::printIcon('todo', 'delete', "todoID=$todo->id", '', 'button', '', 'hiddenwin');
|
||||
}
|
||||
common::printRPN($browseLink);
|
||||
?>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user