Merge branch 'master' of git@github.com:easysoft/zentaopms
This commit is contained in:
+11
-9
@@ -161,8 +161,9 @@ class task extends control
|
||||
die(js::locate($storyLink, 'parent'));
|
||||
}
|
||||
|
||||
$stories = $this->story->getProjectStoryPairs($projectID);
|
||||
$stories = $this->story->getProjectStoryPairs($projectID, 0, 0, 'short');
|
||||
$members = $this->project->getTeamMemberPairs($projectID, 'nodeleted');
|
||||
$modules = $this->loadModel('tree')->getTaskOptionMenu($projectID);
|
||||
$title = $project->name . $this->lang->colon . $this->lang->task->batchCreate;
|
||||
$position[] = html::a($taskLink, $project->name);
|
||||
$position[] = $this->lang->task->common;
|
||||
@@ -172,6 +173,7 @@ class task extends control
|
||||
$this->view->position = $position;
|
||||
$this->view->project = $project;
|
||||
$this->view->stories = $stories;
|
||||
$this->view->modules = $modules;
|
||||
$this->view->storyID = $storyID;
|
||||
$this->view->members = $members;
|
||||
$this->display();
|
||||
@@ -226,7 +228,7 @@ class task extends control
|
||||
$fileAction = '';
|
||||
if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ;
|
||||
$actionID = $this->action->create('task', $taskID, $action, $fileAction . $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
if(!empty($changes)) $this->action->logHistory($actionID, $changes);
|
||||
$this->sendmail($taskID, $actionID);
|
||||
}
|
||||
|
||||
@@ -313,7 +315,7 @@ class task extends control
|
||||
$this->view->title = $project->name . $this->lang->colon . $this->lang->task->batchEdit;
|
||||
$this->view->position[] = html::a($this->createLink('project', 'browse', "project=$project->id"), $project->name);
|
||||
$this->view->project = $project;
|
||||
$this->view->modules = $this->tree->getOptionMenu($projectID, $viewType = 'task');
|
||||
$this->view->modules = $this->tree->getTaskOptionMenu($projectID);
|
||||
$this->view->members = $members;
|
||||
}
|
||||
/* The tasks of my. */
|
||||
@@ -323,8 +325,9 @@ class task extends control
|
||||
$this->lang->set('menugroup.task', 'my');
|
||||
$this->lang->task->menuOrder = $this->lang->my->menuOrder;
|
||||
$this->loadModel('my')->setMenu();
|
||||
$this->view->title = $this->lang->task->batchEdit;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->position[] = html::a($this->createLink('my', 'task'), $this->lang->my->task);
|
||||
$this->view->title = $this->lang->task->batchEdit;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
}
|
||||
|
||||
/* Get edited tasks. */
|
||||
@@ -586,7 +589,6 @@ class task extends control
|
||||
|
||||
$this->view->title = $this->view->project->name . $this->lang->colon .$this->lang->task->finish;
|
||||
$this->view->position[] = $this->lang->task->finish;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('nodeleted|noletter', $this->view->task->openedBy);
|
||||
$this->view->date = strftime("%Y-%m-%d %X", strtotime('now'));
|
||||
|
||||
$this->display();
|
||||
@@ -947,14 +949,14 @@ class task extends control
|
||||
}
|
||||
|
||||
/* fill some field with useful value. */
|
||||
$task->story = isset($relatedStories[$task->story]) ? $relatedStories[$task->story] : '';
|
||||
$task->story = isset($relatedStories[$task->story]) ? $relatedStories[$task->story] . "(#$task->story)" : '';
|
||||
|
||||
if(isset($projects[$task->project])) $task->project = $projects[$task->project];
|
||||
if(isset($projects[$task->project])) $task->project = $projects[$task->project] . "(#$task->project)";
|
||||
if(isset($taskLang->typeList[$task->type])) $task->type = $taskLang->typeList[$task->type];
|
||||
if(isset($taskLang->priList[$task->pri])) $task->pri = $taskLang->priList[$task->pri];
|
||||
if(isset($taskLang->statusList[$task->status])) $task->status = $taskLang->statusList[$task->status];
|
||||
if(isset($taskLang->reasonList[$task->closedReason])) $task->closedReason = $taskLang->reasonList[$task->closedReason];
|
||||
if(isset($relatedModules[$task->module])) $task->module = $relatedModules[$task->module];
|
||||
if(isset($relatedModules[$task->module])) $task->module = $relatedModules[$task->module] . "(#$task->module)";
|
||||
|
||||
if(isset($users[$task->openedBy])) $task->openedBy = $users[$task->openedBy];
|
||||
if(isset($users[$task->assignedTo])) $task->assignedTo = $users[$task->assignedTo];
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
textarea {height:16px}
|
||||
.icon-green-same:before {content: "\f105";}
|
||||
.sameAsStory{float:right;}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.button-c {padding:2px}
|
||||
#mailto {width:90.5%}
|
||||
#preview{display: inline-block; line-height: 24px;position: relative;top: -10px;+top:0;}
|
||||
#preview{line-height: 24px;position: relative;top: -10px;+top:0;}
|
||||
caption .f-right a{color:red}
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
$(function() {
|
||||
for(i=0; i<batchCreateNum; i++) $("#story" + i).chosen({no_results_text: noResultsMatch});
|
||||
})
|
||||
|
||||
/* Copy story title as task title. */
|
||||
function copyStoryTitle(num)
|
||||
{
|
||||
var storyTitle = $('#story' + num).find('option:selected').text();
|
||||
startPosition = storyTitle.indexOf(':') + 1;
|
||||
endPosition = storyTitle.lastIndexOf('[');
|
||||
storyTitle = storyTitle.substr(startPosition, endPosition - startPosition);
|
||||
$('#story' + num).parent().next().find('input:first').val(storyTitle);
|
||||
}
|
||||
|
||||
@@ -89,9 +89,10 @@ function setStories(moduleID, projectID)
|
||||
$.get(link, function(stories)
|
||||
{
|
||||
var storyID = $('#story').val();
|
||||
if(!stories) stories = '<select id="story" name="story"></select>';
|
||||
if(!stories) stories = '<select id="story" name="story" class="select-1"></select>';
|
||||
$('#story').replaceWith(stories);
|
||||
$('#story').val(storyID);
|
||||
setPreview();
|
||||
$('#story_chzn').remove();
|
||||
$("#story").chosen({no_results_text: ''});
|
||||
});
|
||||
|
||||
@@ -66,31 +66,5 @@ function loadProjectMembers(projectID)
|
||||
$('#assignedToIdBox').load(link);
|
||||
}
|
||||
|
||||
/**
|
||||
* load stories of module.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function loadModuleRelated()
|
||||
{
|
||||
moduleID = $('#module').val();
|
||||
projectID = $('#project').val();
|
||||
setStories(moduleID, projectID);
|
||||
}
|
||||
|
||||
/* Get select of stories.*/
|
||||
function setStories(moduleID, projectID)
|
||||
{
|
||||
link = createLink('story', 'ajaxGetProjectStories', 'projectID=' + projectID + '&productID=0&moduleID=' + moduleID);
|
||||
$.get(link, function(stories)
|
||||
{
|
||||
if(!stories) stories = '<select id="story" name="story"></select>';
|
||||
$('#story').replaceWith(stories);
|
||||
$('#story_chzn').remove();
|
||||
$("#story").chosen({no_results_text: ''});
|
||||
});
|
||||
}
|
||||
|
||||
/* empty function. */
|
||||
function setPreview(){}
|
||||
|
||||
@@ -107,11 +107,12 @@ class taskModel extends model
|
||||
if(empty($tasks->name[$i])) continue;
|
||||
|
||||
$data[$i] = new stdclass();
|
||||
$data[$i]->story = $tasks->story[$i] == 'ditto' ? (isset($data[$i-1]) ? $data[$i-1]->story : 0) : ($tasks->story[$i] ? $tasks->story[$i] : 0);
|
||||
$data[$i]->type = $tasks->type[$i] == 'ditto' ? (isset($data[$i-1]) ? $data[$i-1]->type : 0) : $tasks->type[$i];
|
||||
$data[$i]->story = $tasks->story[$i] == 'ditto' ? (isset($data[$i-1]) ? $data[$i-1]->story : 0) : ($tasks->story[$i] ? $tasks->story[$i] : 0);
|
||||
$data[$i]->type = $tasks->type[$i] == 'ditto' ? (isset($data[$i-1]) ? $data[$i-1]->type : 0) : $tasks->type[$i];
|
||||
$data[$i]->module = $tasks->module[$i] == 'ditto' ? (isset($data[$i-1]) ? $data[$i-1]->module : 0) : $tasks->module[$i];
|
||||
$data[$i]->assignedTo = $tasks->assignedTo[$i] == 'ditto' ? (isset($data[$i-1]) ? $data[$i-1]->assignedTo : 0) : $tasks->assignedTo[$i];
|
||||
$data[$i]->name = htmlspecialchars($tasks->name[$i]);
|
||||
$data[$i]->desc = htmlspecialchars($tasks->desc[$i]);
|
||||
$data[$i]->desc = str_replace(array("\r\n", "\n"), '<br />', htmlspecialchars($tasks->desc[$i]));
|
||||
$data[$i]->pri = $tasks->pri[$i];
|
||||
$data[$i]->estimate = $tasks->estimate[$i];
|
||||
$data[$i]->left = $tasks->estimate[$i];
|
||||
@@ -943,6 +944,7 @@ class taskModel extends model
|
||||
{
|
||||
$data->finishedBy = $this->app->user->account;
|
||||
$data->finishedDate = $now;
|
||||
$data->assignedTo = $task->openedBy;
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($data)->where('id')->eq($task->id)->exec();
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<caption><?php echo $task->name;?></caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->task->assignedTo;?></th>
|
||||
<td><?php echo html::select('assignedTo', $users, '', "class='text-3'");?></td>
|
||||
<td><?php echo html::select('assignedTo', $users, '', "class='text-3 chosen'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->task->left;?></th>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<th><?php echo $lang->task->story;?></th>
|
||||
<th class='red'><?php echo $lang->task->name;?></th>
|
||||
<th class='w-60px red'><?php echo $lang->typeAB;?></th>
|
||||
<th class='w-80px'><?php echo $lang->task->module?></th>
|
||||
<th class='w-80px'><?php echo $lang->task->assignedTo;?></th>
|
||||
<th class='w-50px'><?php echo $lang->task->estimateAB;?></th>
|
||||
<th class='w-200px'><?php echo $lang->task->desc;?></th>
|
||||
@@ -31,6 +32,7 @@
|
||||
$stories['ditto'] = $this->lang->task->ditto;
|
||||
$lang->task->typeList['ditto'] = $lang->task->ditto;
|
||||
$members['ditto'] = $lang->task->ditto;
|
||||
$modules['ditto'] = $lang->task->ditto;
|
||||
?>
|
||||
<?php for($i = 0; $i < $config->task->batchCreate; $i++):?>
|
||||
<?php
|
||||
@@ -39,18 +41,25 @@
|
||||
$story = $storyID;
|
||||
$type = '';
|
||||
$member = '';
|
||||
$module = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$story = $type = $member = 'ditto';
|
||||
$story = $type = $member = $module = 'ditto';
|
||||
}
|
||||
?>
|
||||
<?php $pri = 3;?>
|
||||
<tr class='a-center'>
|
||||
<td><?php echo $i+1;?></td>
|
||||
<td class='a-left' style='overflow:visible'><?php echo html::select("story[$i]", $stories, $story, "class='select-1'");?></td>
|
||||
<td class='a-left' style='overflow:visible'>
|
||||
<?php
|
||||
echo html::select("story[$i]", $stories, $story, "class='select-1'");
|
||||
echo html::a("javascript:copyStoryTitle($i)", "<i class='icon-green-same'></i>", '', "class='sameAsStory' title='{$lang->task->copyStoryTitle}'");
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo html::input("name[$i]", '', 'class=text-1');?></td>
|
||||
<td><?php echo html::select("type[$i]", $lang->task->typeList, $type, 'class=select-1');?></td>
|
||||
<td><?php echo html::select("module[$i]", $modules, $module, 'class=select-1')?></td>
|
||||
<td><?php echo html::select("assignedTo[$i]", $members, $member, 'class=select-1');?></td>
|
||||
<td><?php echo html::input("estimate[$i]", '', 'class=text-1');?></td>
|
||||
<td><?php echo html::textarea("desc[$i]", '', "rows='1' class=text-1");?></td>
|
||||
|
||||
@@ -17,13 +17,12 @@
|
||||
<tr>
|
||||
<th class='w-30px'><?php echo $lang->idAB;?></th>
|
||||
<th class='red'> <?php echo $lang->task->name?></th>
|
||||
<th class='w-80px'><?php echo $lang->task->module?></th>
|
||||
<th class='w-150px'><?php echo $lang->task->module?></th>
|
||||
<th class='w-80px'><?php echo $lang->task->assignedTo;?></th>
|
||||
<th class='w-60px red'><?php echo $lang->typeAB;?></th>
|
||||
<th class='w-70px'><?php echo $lang->task->status;?></th>
|
||||
<th class='w-50px'><?php echo $lang->task->pri;?></th>
|
||||
<th class='w-30px red'><?php echo $lang->task->estimateAB;?></th>
|
||||
<th class='w-70px'><?php echo $lang->task->consumed;?></th>
|
||||
<th class='w-60px red'><?php echo $lang->task->consumedThisTime?></th>
|
||||
<th class='w-30px red'><?php echo $lang->task->leftAB?></th>
|
||||
<th class='w-80px'><?php echo $lang->task->finishedBy;?></th>
|
||||
@@ -41,13 +40,12 @@
|
||||
<tr class='a-center'>
|
||||
<td><?php echo $taskID . html::hidden("taskIDList[$taskID]", $taskID);?></td>
|
||||
<td><?php echo html::input("names[$taskID]", $tasks[$taskID]->name, 'class=text-1');?></td>
|
||||
<td><?php echo html::select("modules[$taskID]", $modules, $tasks[$taskID]->module, 'class=select-1')?></td>
|
||||
<td><?php echo html::select("modules[$taskID]", $modules, $tasks[$taskID]->module, 'class=select-1')?></td>
|
||||
<td><?php echo html::select("assignedTos[$taskID]", $members, $tasks[$taskID]->assignedTo, 'class=select-1');?></td>
|
||||
<td><?php echo html::select("types[$taskID]", $lang->task->typeList, $tasks[$taskID]->type, 'class=select-1');?></td>
|
||||
<td><?php echo html::select("statuses[$taskID]", $lang->task->statusList, $tasks[$taskID]->status, 'class=select-1');?></td>
|
||||
<td><?php echo html::select("pris[$taskID]", (array)$lang->task->priList, $tasks[$taskID]->pri, 'class=select-1');?></td>
|
||||
<td><?php echo html::input("estimates[$taskID]", $tasks[$taskID]->estimate, "class='text-1 a-center'");?></td>
|
||||
<td><?php echo html::input("", $tasks[$taskID]->consumed, "class='text-1 a-center' disabled");?></td>
|
||||
<td><?php echo html::input("consumeds[$taskID]", '', "class='text-1 a-center'");?></td>
|
||||
<td><?php echo html::input("lefts[$taskID]", $tasks[$taskID]->left, "class='text-1 a-center'");?></td>
|
||||
<td><?php echo html::select("finishedBys[$taskID]", $members, $tasks[$taskID]->finishedBy, 'class=select-1');?></td>
|
||||
@@ -57,13 +55,12 @@
|
||||
<?php endforeach;?>
|
||||
|
||||
<?php if(isset($suhosinInfo)):?>
|
||||
<tr><td colspan='<?php echo $this->config->task->batchEdit->columns + 1;?>'>
|
||||
<tr><td colspan='<?php echo $this->config->task->batchEdit->columns;?>'>
|
||||
<div class='f-left blue'><?php echo $suhosinInfo;?></div>
|
||||
</td></tr>
|
||||
<?php endif;?>
|
||||
|
||||
<?php $colspan = (!isset($project) or (isset($project) and $project->type != 'sprint')) ? $this->config->task->batchEdit->columns + 1 : $this->config->task->batchEdit->columns;?>
|
||||
<tr><td colspan='<?php echo $colspan;?>' class='a-center'>
|
||||
<tr><td colspan='<?php echo $this->config->task->batchEdit->columns;?>' class='a-center'>
|
||||
<?php echo html::submitButton();?>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->task->assignedTo;?></th>
|
||||
<td><?php echo html::select('assignedTo[]', $members, $task->assignedTo, 'class=select-3');?></td>
|
||||
<td><?php echo html::select('assignedTo[]', $members, $task->assignedTo, "class='select-3 chosen'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->task->type;?></th>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead w-p20'><?php echo $lang->task->module;?></th>
|
||||
<td><span id="moduleIdBox"><?php echo html::select('module', $modules, $task->module, 'class="select-1" onchange="loadModuleRelated()"');?></span></td>
|
||||
<td><span id="moduleIdBox"><?php echo html::select('module', $modules, $task->module, 'class="select-1"');?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->task->story;?></th>
|
||||
@@ -64,7 +64,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->task->assignedTo;?></th>
|
||||
<td><span id="assignedToIdBox"><?php echo html::select('assignedTo', $members, $task->assignedTo, 'class=select-1');?></span></td>
|
||||
<td><span id="assignedToIdBox"><?php echo html::select('assignedTo', $members, $task->assignedTo, "class='select-1 chosen'");?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->task->type;?></th>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->task->assignedTo;?></td>
|
||||
<td><?php echo html::select('assignedTo', $users, $task->openedBy, "class='select-3'");?></td>
|
||||
<td><?php echo html::select('assignedTo', $members, $task->openedBy, "class='select-3 chosen'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->task->finishedDate;?></td>
|
||||
|
||||
Reference in New Issue
Block a user