* finish task #3442.
This commit is contained in:
@@ -104,6 +104,23 @@ class action extends control
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Comment.
|
||||
*
|
||||
* @param string $objectType
|
||||
* @param int $objectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function comment($objectType, $objectID)
|
||||
{
|
||||
$actionID = $this->action->create($objectType, $objectID, 'Commented', $this->post->comment);
|
||||
|
||||
$moduleName = $objectType == 'case' ? 'testcase' : $objectType;
|
||||
$this->loadModel($moduleName)->sendmail($objectID, $actionID);
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit comment of a action.
|
||||
*
|
||||
|
||||
@@ -25,6 +25,7 @@ $lang->action->undelete = 'Restore';
|
||||
$lang->action->hideOne = 'Hide';
|
||||
$lang->action->hideAll = 'Hide All';
|
||||
$lang->action->editComment = 'Edit';
|
||||
$lang->action->comment = 'Comment';
|
||||
|
||||
$lang->action->trashTips = 'Note: Delete in ZenTao is logic.';
|
||||
$lang->action->textDiff = 'Text Format';
|
||||
|
||||
@@ -25,6 +25,7 @@ $lang->action->undelete = '还原';
|
||||
$lang->action->hideOne = '隐藏';
|
||||
$lang->action->hideAll = '全部隐藏';
|
||||
$lang->action->editComment = '修改备注';
|
||||
$lang->action->comment = '备注';
|
||||
|
||||
$lang->action->trashTips = '提示:为了保证系统的完整性,禅道系统的删除都是标记删除。';
|
||||
$lang->action->textDiff = '文本格式';
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
<div class='actions'><?php if(!$bug->deleted) echo $actionLinks;?></div>
|
||||
<fieldset id='commentBox' class='hide'>
|
||||
<legend><?php echo $lang->comment;?></legend>
|
||||
<form method='post' action='<?php echo inlink('edit', "bugID=$bug->id&comment=true")?>'>
|
||||
<form method='post' action='<?php echo $this->createLink('action', 'comment', "objectType=bug&objectID=$bug->id")?>' target='hiddenwin'>
|
||||
<div class="form-group"><?php echo html::textarea('comment', '',"rows='5' class='w-p100'");?></div>
|
||||
<?php echo html::submitButton() . html::backButton();?>
|
||||
</form>
|
||||
|
||||
@@ -631,7 +631,7 @@ class commonModel extends model
|
||||
|
||||
global $lang;
|
||||
|
||||
if(!commonModel::hasPriv($module, 'edit', $object)) return false;
|
||||
if(!commonModel::hasPriv('action', 'comment', $object)) return false;
|
||||
echo html::a('#commentBox', '<i class="icon-comment-alt"></i>', '', "title='$lang->comment' onclick='setComment()' class='btn'");
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
<?php include '../../common/view/action.html.php';?>
|
||||
<fieldset id='commentBox' class='hide'>
|
||||
<legend><?php echo $lang->comment;?></legend>
|
||||
<form method='post' action='<?php echo inlink('edit', "docID=$doc->id&comment=true")?>'>
|
||||
<form method='post' action='<?php echo $this->createLink('action', 'comment', "objectType=doc&objectID=$doc->id")?>' target='hiddenwin'>
|
||||
<div class="form-group"><?php echo html::textarea('comment', '',"style='width:100%;height:100px'");?></div>
|
||||
<?php echo html::submitButton() . html::backButton();?>
|
||||
</form>
|
||||
|
||||
@@ -1005,12 +1005,15 @@ $lang->resource->action->trash = 'trash';
|
||||
$lang->resource->action->undelete = 'undelete';
|
||||
$lang->resource->action->hideOne = 'hideOne';
|
||||
$lang->resource->action->hideAll = 'hideAll';
|
||||
$lang->resource->action->comment = 'comment';
|
||||
$lang->resource->action->editComment = 'editComment';
|
||||
|
||||
$lang->action->methodOrder[5] = 'trash';
|
||||
$lang->action->methodOrder[10] = 'undelete';
|
||||
$lang->action->methodOrder[15] = 'hideOne';
|
||||
$lang->action->methodOrder[20] = 'hideAll';
|
||||
$lang->action->methodOrder[25] = 'comment';
|
||||
$lang->action->methodOrder[30] = 'editComment';
|
||||
|
||||
$lang->resource->backup = new stdclass();
|
||||
$lang->resource->backup->index = 'index';
|
||||
|
||||
@@ -479,7 +479,7 @@ class storyModel extends model
|
||||
->join('mailto', ',')
|
||||
->remove('linkStories,childStories,files,labels,comment')
|
||||
->get();
|
||||
if(is_array($story->plan)) $story->plan = trim(join(',', $story->plan), ',');
|
||||
if(isset($story->plan) and is_array($story->plan)) $story->plan = trim(join(',', $story->plan), ',');
|
||||
if(empty($_POST['product'])) $story->branch = $oldStory->branch;
|
||||
|
||||
$this->dao->update(TABLE_STORY)
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
</div>
|
||||
<fieldset id='commentBox' class='hide'>
|
||||
<legend><?php echo $lang->comment;?></legend>
|
||||
<form method='post' action='<?php echo inlink('edit', "storyID=$story->id")?>'>
|
||||
<form method='post' action='<?php echo $this->createLink('action', 'comment', "objectType=story&objectID=$story->id")?>' target='hiddenwin'>
|
||||
<div class="form-group"><?php echo html::textarea('comment', '',"rows='5' class='w-p100'");?></div>
|
||||
<?php echo html::submitButton() . html::backButton();?>
|
||||
</form>
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
<div class='actions'> <?php if(!$task->deleted) echo $actionLinks;?></div>
|
||||
<fieldset id='commentBox' class='hide'>
|
||||
<legend><?php echo $lang->comment;?></legend>
|
||||
<form method='post' action='<?php echo inlink('edit', "taskID=$task->id&comment=true")?>'>
|
||||
<form method='post' action='<?php echo $this->createLink('action', 'comment', "objectType=task&objectID=$task->id")?>' target='hiddenwin'>
|
||||
<div class="form-group"><?php echo html::textarea('comment', '',"rows='5' class='w-p100'");?></div>
|
||||
<?php echo html::submitButton() . html::backButton();?>
|
||||
</form>
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
<div class='actions'><?php echo $actionLinks;?></div>
|
||||
<fieldset id='commentBox' class='hide'>
|
||||
<legend><?php echo $lang->comment;?></legend>
|
||||
<form method='post' action='<?php echo inlink('edit', "caseID=$case->id&comment=true")?>'>
|
||||
<form method='post' action='<?php echo $this->creatLink('action', 'comment', "objectType=case&objectID=$case->id")?>' target='hiddenwin'>
|
||||
<div class="form-group"><?php echo html::textarea('comment', '',"rows='5' class='w-p100'");?></div>
|
||||
<?php echo html::submitButton() . html::backButton();?>
|
||||
</form>
|
||||
|
||||
@@ -1918,4 +1918,24 @@ class upgradeModel extends model
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust Priv for 9.7
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function adjustPriv9_7()
|
||||
{
|
||||
$groups = $this->dao->select('*')->from(TABLE_GROUPPRIV)->where('method')->eq('edit')->andWhere('module')->in('story,task,bug,testcase')->fetchPairs('group', 'group');
|
||||
foreach($groups as $groupID)
|
||||
{
|
||||
$groupPriv = new stdclass();
|
||||
$groupPriv->group = $groupID;
|
||||
$groupPriv->module = 'action';
|
||||
$groupPriv->method = 'comment';
|
||||
$this->dao->replace(TABLE_GROUPPRIV)->data($groupPriv)->exec();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user