Merge branch 'kanban' into 'sprint/177_tianshujie_card'
# Conflicts: # module/kanban/lang/en.php # module/kanban/lang/zh-cn.php
This commit is contained in:
@@ -244,6 +244,7 @@ define('TABLE_KANBANLANE', '`' . $config->db->prefix . 'kanbanlane`');
|
||||
define('TABLE_KANBANCOLUMN', '`' . $config->db->prefix . 'kanbancolumn`');
|
||||
define('TABLE_KANBANORDER', '`' . $config->db->prefix . 'kanbanorder`');
|
||||
define('TABLE_KANBANGROUP', '`' . $config->db->prefix . 'kanbangroup`');
|
||||
define('TABLE_KANBANCARD', '`' . $config->db->prefix . 'kanbancard`');
|
||||
if(!defined('TABLE_LANG')) define('TABLE_LANG', '`' . $config->db->prefix . 'lang`');
|
||||
if(!defined('TABLE_PROJECTSPEC')) define('TABLE_PROJECTSPEC', '`' . $config->db->prefix . 'projectspec`');
|
||||
|
||||
|
||||
@@ -57,6 +57,9 @@ CREATE TABLE `zt_kanbanregion` (
|
||||
-- DROP TABLE IF EXISTS `zt_kanbancard`;
|
||||
CREATE TABLE `zt_kanbancard` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`kanban` mediumint(8) unsigned NOT NULL,
|
||||
`region` mediumint(8) unsigned NOT NULL,
|
||||
`group` mediumint(8) unsigned NOT NULL,
|
||||
`lane` mediumint(8) unsigned NOT NULL,
|
||||
`column` mediumint(8) unsigned NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
|
||||
@@ -699,6 +699,9 @@ CREATE TABLE `zt_kanbanregion` (
|
||||
-- DROP TABLE IF EXISTS `zt_kanbancard`;
|
||||
CREATE TABLE `zt_kanbancard` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`kanban` mediumint(8) unsigned NOT NULL,
|
||||
`region` mediumint(8) unsigned NOT NULL,
|
||||
`group` mediumint(8) unsigned NOT NULL,
|
||||
`lane` mediumint(8) unsigned NOT NULL,
|
||||
`column` mediumint(8) unsigned NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
|
||||
@@ -14,6 +14,7 @@ $config->kanban->create = new stdclass();
|
||||
$config->kanban->edit = new stdclass();
|
||||
$config->kanban->createspace = new stdclass();
|
||||
$config->kanban->editspace = new stdclass();
|
||||
$config->kanban->createcard = new stdclass();
|
||||
|
||||
$config->kanban->editcard = new stdclass();
|
||||
|
||||
@@ -24,6 +25,7 @@ $config->kanban->create->requiredFields = 'space,name';
|
||||
$config->kanban->edit->requiredFields = 'space,name';
|
||||
$config->kanban->createspace->requiredFields = 'name,owner';
|
||||
$config->kanban->editspace->requiredFields = 'name,owner';
|
||||
$config->kanban->createcard->requiredFields = 'name';
|
||||
|
||||
$config->kanban->editcard->requiredFields = 'name';
|
||||
|
||||
@@ -32,6 +34,7 @@ $config->kanban->editor->create = array('id' => 'desc', 'tools' => 'simpleT
|
||||
$config->kanban->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->kanban->editor->createspace = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->kanban->editor->editspace = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->kanban->editor->createcard = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->kanban->editor->close = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
|
||||
$config->kanban->editor->editcard = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
|
||||
@@ -258,8 +258,18 @@ class kanban extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createCard($kanbanID, $regionID, $groupID, $laneID, $columnID)
|
||||
public function createCard($kanbanID = 0, $regionID = 0, $groupID = 0, $laneID = 0, $columnID = 0)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$cardID = $this->kanban->createCard($kanbanID, $regionID, $groupID, $laneID, $columnID);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->loadModel('action')->create('kanbancard', $cardID, 'created');
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
}
|
||||
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted');
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -219,3 +219,28 @@ $lang->kanbancard->create = 'Create Card';
|
||||
$lang->kanbancard->name = 'Card Name';
|
||||
$lang->kanbancard->legendBasicInfo = 'Basic Info';
|
||||
$lang->kanbancard->legendLifeTime = 'Card Life';
|
||||
$lang->kanbancard->space = 'Space';
|
||||
$lang->kanbancard->lane = 'Lane';
|
||||
$lang->kanbancard->column = 'Column';
|
||||
$lang->kanbancard->assignedTo = 'Assignee';
|
||||
$lang->kanbancard->beginAndEnd = 'Begin And End';
|
||||
$lang->kanbancard->begin = 'Begin';
|
||||
$lang->kanbancard->end = 'End';
|
||||
$lang->kanbancard->pri = 'Priority';
|
||||
$lang->kanbancard->desc = 'Description';
|
||||
$lang->kanbancard->estimate = 'Estimate';
|
||||
$lang->kanbancard->createdBy = 'Created By';
|
||||
$lang->kanbancard->createdDate = 'Created Date';
|
||||
$lang->kanbancard->lastEditedBy = 'Last Edited By';
|
||||
$lang->kanbancard->lastEditedDate = 'Last Edited Date';
|
||||
$lang->kanbancard->lblHour = 'h';
|
||||
|
||||
$lang->kanbancard->priList[1] = 1;
|
||||
$lang->kanbancard->priList[2] = 2;
|
||||
$lang->kanbancard->priList[3] = 3;
|
||||
$lang->kanbancard->priList[4] = 4;
|
||||
|
||||
$lang->kanbancard->error = new stdClass();
|
||||
$lang->kanbancard->error->recordMinus = 'Estimate cannot be negative!';
|
||||
$lang->kanbancard->error->endSmall = '"End Date" cannot be less than "Begin Date"';
|
||||
>>>>>>> module/kanban/lang/en.php
|
||||
|
||||
@@ -219,3 +219,29 @@ $lang->kanbancard->create = '创建卡片';
|
||||
$lang->kanbancard->name = '卡片名称';
|
||||
$lang->kanbancard->legendBasicInfo = '基本信息';
|
||||
$lang->kanbancard->legendLifeTime = '卡片的一生';
|
||||
$lang->kanbancard->name = '卡片名称';
|
||||
$lang->kanbancard->space = '所属空间';
|
||||
$lang->kanbancard->lane = '所属泳道';
|
||||
$lang->kanbancard->column = '所属看板列';
|
||||
$lang->kanbancard->assignedTo = '指派给';
|
||||
$lang->kanbancard->beginAndEnd = '起止日期';
|
||||
$lang->kanbancard->begin = '预计开始';
|
||||
$lang->kanbancard->end = '截止日期';
|
||||
$lang->kanbancard->pri = '优先级';
|
||||
$lang->kanbancard->desc = '描述';
|
||||
$lang->kanbancard->estimate = '预计';
|
||||
$lang->kanbancard->createdBy = '由谁创建';
|
||||
$lang->kanbancard->createdDate = '由谁创建';
|
||||
$lang->kanbancard->lastEditedBy = '由谁编辑';
|
||||
$lang->kanbancard->lastEditedDate = '最后编辑时间';
|
||||
$lang->kanbancard->lblHour = 'h';
|
||||
|
||||
$lang->kanbancard->priList[1] = 1;
|
||||
$lang->kanbancard->priList[2] = 2;
|
||||
$lang->kanbancard->priList[3] = 3;
|
||||
$lang->kanbancard->priList[4] = 4;
|
||||
|
||||
$lang->kanbancard->error = new stdClass();
|
||||
$lang->kanbancard->error->recordMinus = '预计不能为负数!';
|
||||
$lang->kanbancard->error->endSmall = '"截止日期"不能小于"预计开始"!';
|
||||
>>>>>>> module/kanban/lang/zh-cn.php
|
||||
|
||||
@@ -281,6 +281,66 @@ class kanbanModel extends model
|
||||
return $columnID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a kanban card.
|
||||
*
|
||||
* @param int $kanbanID
|
||||
* @param int $regionID
|
||||
* @param int $groupID
|
||||
* @param int $laneID
|
||||
* @param int $columnID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createCard($kanbanID, $regionID, $groupID, $laneID, $columnID)
|
||||
{
|
||||
if($this->post->estimate < 0)
|
||||
{
|
||||
dao::$errors[] = $this->lang->kanbancard->error->recordMinus;
|
||||
return false;
|
||||
}
|
||||
|
||||
if($this->post->begin > $this->post->end)
|
||||
{
|
||||
dao::$errors[] = $this->lang->kanbancard->error->endSmall;
|
||||
return false;
|
||||
}
|
||||
|
||||
$now = helper::now();
|
||||
$card = fixer::input('post')
|
||||
->add('kanban', $kanbanID)
|
||||
->add('region', $regionID)
|
||||
->add('group', $groupID)
|
||||
->add('lane', $laneID)
|
||||
->add('column', $columnID)
|
||||
->add('createdBy', $this->app->user->account)
|
||||
->add('createdDate', $now)
|
||||
->add('assignedDate', $now)
|
||||
->setDefault('estimate', 0)
|
||||
->setIF(is_numeric($this->post->estimate), 'estimate', (float)$this->post->estimate)
|
||||
->remove('uid')
|
||||
->get();
|
||||
|
||||
$card = $this->loadModel('file')->processImgURL($card, $this->config->kanban->editor->createcard['id'], $this->post->uid);
|
||||
|
||||
$this->dao->insert(TABLE_KANBANCARD)->data($card)->autoCheck()
|
||||
->checkIF($card->estimate != '', 'estimate', 'float')
|
||||
->batchCheck($this->config->kanban->createcard->requiredFields, 'notempty')
|
||||
->exec();
|
||||
|
||||
if(!dao::isError())
|
||||
{
|
||||
$cardID = $this->dao->lastInsertID();
|
||||
$this->file->saveUpload('kanbancard', $cardID);
|
||||
$this->file->updateObjectID($this->post->uid, $cardID, 'kanbancard');
|
||||
|
||||
return $cardID;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Save kanban object order.
|
||||
*
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
@@ -18,9 +19,41 @@
|
||||
</div>
|
||||
<form class='main-form form-ajax' method='post' enctype='multipart/form-data' id='dataform'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->kanbancard->estimate;?></th>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<input type="text" name="estimate" id="estimate" value="" class="form-control" autocomplete="off">
|
||||
<span class="input-group-addon"><?php echo $lang->kanbancard->lblHour;?></span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->kanbancard->assignedTo;?></th>
|
||||
<td>
|
||||
<?php echo html::select('assignedTo', $users, $app->user->account, "class='form-control chosen'");?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->kanbancard->beginAndEnd;?></th>
|
||||
<td colspan='2'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::input('begin', '', "class='form-control form-date form-datetime' placeholder='{$lang->kanbancard->begin}'");?>
|
||||
<span class='input-group-addon fix-border'>~</span>
|
||||
<?php echo html::input('end', '', "class='form-control form-date form-datetime' placeholder='{$lang->kanbancard->end}'");?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->kanbancard->name;?></th>
|
||||
<td><?php echo html::input('name', '', "class='form-control'");?></td><td></td>
|
||||
<td colspan='2'>
|
||||
<div class='required required-wrapper'></div>
|
||||
<?php echo html::input('name', '', "class='form-control'");?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->kanbancard->desc;?></th>
|
||||
<td colspan='3'><?php echo html::textarea('desc', '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='4' class='text-center form-actions'>
|
||||
|
||||
Reference in New Issue
Block a user