Uncheck tasks and swimlanes from project duplication and update translations
This commit is contained in:
@@ -127,7 +127,7 @@ class Notification extends Base
|
||||
*/
|
||||
private function getStandardMailSubject($label, array $data)
|
||||
{
|
||||
return e('[%s][%s] %s (#%d)', $data['task']['project_name'], $label, $data['task']['title'], $data['task']['id']);
|
||||
return sprintf('[%s][%s] %s (#%d)', $data['task']['project_name'], $label, $data['task']['title'], $data['task']['id']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,40 +141,40 @@ class Notification extends Base
|
||||
{
|
||||
switch ($template) {
|
||||
case 'file_creation':
|
||||
$subject = $this->getStandardMailSubject('New attachment', $data);
|
||||
$subject = $this->getStandardMailSubject(t('New attachment'), $data);
|
||||
break;
|
||||
case 'comment_creation':
|
||||
$subject = $this->getStandardMailSubject('New comment', $data);
|
||||
$subject = $this->getStandardMailSubject(t('New comment'), $data);
|
||||
break;
|
||||
case 'comment_update':
|
||||
$subject = $this->getStandardMailSubject('Comment updated', $data);
|
||||
$subject = $this->getStandardMailSubject(t('Comment updated'), $data);
|
||||
break;
|
||||
case 'subtask_creation':
|
||||
$subject = $this->getStandardMailSubject('New subtask', $data);
|
||||
$subject = $this->getStandardMailSubject(t('New subtask'), $data);
|
||||
break;
|
||||
case 'subtask_update':
|
||||
$subject = $this->getStandardMailSubject('Subtask updated', $data);
|
||||
$subject = $this->getStandardMailSubject(t('Subtask updated'), $data);
|
||||
break;
|
||||
case 'task_creation':
|
||||
$subject = $this->getStandardMailSubject('New task', $data);
|
||||
$subject = $this->getStandardMailSubject(t('New task'), $data);
|
||||
break;
|
||||
case 'task_update':
|
||||
$subject = $this->getStandardMailSubject('Task updated', $data);
|
||||
$subject = $this->getStandardMailSubject(t('Task updated'), $data);
|
||||
break;
|
||||
case 'task_close':
|
||||
$subject = $this->getStandardMailSubject('Task closed', $data);
|
||||
$subject = $this->getStandardMailSubject(t('Task closed'), $data);
|
||||
break;
|
||||
case 'task_open':
|
||||
$subject = $this->getStandardMailSubject('Task opened', $data);
|
||||
$subject = $this->getStandardMailSubject(t('Task opened'), $data);
|
||||
break;
|
||||
case 'task_move_column':
|
||||
$subject = $this->getStandardMailSubject('Column Change', $data);
|
||||
$subject = $this->getStandardMailSubject(t('Column Change'), $data);
|
||||
break;
|
||||
case 'task_move_position':
|
||||
$subject = $this->getStandardMailSubject('Position Change', $data);
|
||||
$subject = $this->getStandardMailSubject(t('Position Change'), $data);
|
||||
break;
|
||||
case 'task_assignee_change':
|
||||
$subject = $this->getStandardMailSubject('Assignee Change', $data);
|
||||
$subject = $this->getStandardMailSubject(t('Assignee Change'), $data);
|
||||
break;
|
||||
case 'task_due':
|
||||
$subject = e('[%s][Due tasks]', $data['project']);
|
||||
|
||||
@@ -61,7 +61,7 @@ class ProjectDuplication extends Base
|
||||
*
|
||||
* @param integer $project_id Project Id
|
||||
* @param array $part_selection Selection of optional project parts to duplicate. Possible options: 'swimlane', 'action', 'category', 'task'
|
||||
* @return integer Cloned Project Id
|
||||
* @return integer Cloned Project Id
|
||||
*/
|
||||
public function duplicate($project_id, $part_selection = array('category', 'action'))
|
||||
{
|
||||
@@ -90,16 +90,14 @@ class ProjectDuplication extends Base
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->db->closeTransaction();
|
||||
|
||||
//* Clone Tasks if in $part_selection
|
||||
|
||||
if(in_array('task', $part_selection)) {
|
||||
// Clone Tasks if in $part_selection
|
||||
if (in_array('task', $part_selection)) {
|
||||
$tasks = $this->taskFinder->getAll($project_id);
|
||||
|
||||
foreach ($tasks as $task) {
|
||||
if (!$this->taskDuplication->duplicateToProject($task['id'], $clone_project_id)) {
|
||||
if (! $this->taskDuplication->duplicateToProject($task['id'], $clone_project_id)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user