Merge branch 'master' of github.com:easysoft/zentaopms
This commit is contained in:
@@ -100,4 +100,18 @@ class action extends control
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit comment of a action.
|
||||
*
|
||||
* @param int $actionID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function editComment($actionID)
|
||||
{
|
||||
if(!strip_tags($this->post->lastComment)) die(js::locate($this->server->http_referer, 'parent'));
|
||||
$this->action->updateComment($actionID);
|
||||
die(js::locate($this->server->http_referer, 'parent'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -669,4 +669,20 @@ class actionModel extends model
|
||||
->andWhere('extra')->eq(self::CAN_UNDELETED)
|
||||
->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update comment of a action.
|
||||
*
|
||||
* @param int $actionID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function updateComment($actionID)
|
||||
{
|
||||
$this->dao->update(TABLE_ACTION)
|
||||
->set('date')->eq(helper::now())
|
||||
->set('comment')->eq($this->post->lastComment)
|
||||
->where('id')->eq($actionID)
|
||||
->exec();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ $config->bug->list->exportFields = 'id, product, module, project, story, task,
|
||||
$config->bug->editor = new stdclass();
|
||||
$config->bug->editor->create = array('id' => 'steps', 'tools' => 'bugTools');
|
||||
$config->bug->editor->edit = array('id' => 'steps,comment', 'tools' => 'bugTools');
|
||||
$config->bug->editor->view = array('id' => 'comment', 'tools' => 'bugTools');
|
||||
$config->bug->editor->view = array('id' => 'comment,lastComment', 'tools' => 'bugTools');
|
||||
$config->bug->editor->confirmbug = array('id' => 'comment', 'tools' => 'bugTools');
|
||||
$config->bug->editor->assignto = array('id' => 'comment', 'tools' => 'bugTools');
|
||||
$config->bug->editor->resolve = array('id' => 'comment', 'tools' => 'bugTools');
|
||||
|
||||
@@ -75,6 +75,13 @@ function toggleOrder(obj)
|
||||
$("#historyItem li").reverseOrder();
|
||||
}
|
||||
|
||||
function toggleComment(actionID)
|
||||
{
|
||||
$('.comment' + actionID).toggle();
|
||||
$('#lastCommentBox').toggle();
|
||||
$('.ke-container').css('width', '100%');
|
||||
}
|
||||
|
||||
$(function(){
|
||||
var diffButton = "<span onclick='toggleStripTags(this)' class='hidden changeDiff diff-all hand' title='<?php echo $lang->action->original?>'> </span>";
|
||||
var newBoxID = ''
|
||||
@@ -114,6 +121,7 @@ $(function(){
|
||||
<ol id='historyItem'>
|
||||
<?php $i = 1; ?>
|
||||
<?php foreach($actions as $action):?>
|
||||
<?php $canEditComment = (end($actions) == $action and $action->comment and $this->methodName == 'view' and $action->actor == $this->app->user->account);?>
|
||||
<li value='<?php echo $i ++;?>'>
|
||||
<?php
|
||||
if(isset($users[$action->actor])) $action->actor = $users[$action->actor];
|
||||
@@ -124,13 +132,35 @@ $(function(){
|
||||
<?php $this->action->printAction($action);?>
|
||||
<?php if(!empty($action->history)) echo "<span id='switchButton$i' class='hand change-show' onclick=switchChange($i)> </span>";?>
|
||||
</span>
|
||||
<?php if($canEditComment):?>
|
||||
<span class='link-button f-right comment<?php echo $action->id;?>'><?php echo html::a('#lastCommentBox', ' ', '', "class='icon-green-common-edit' onclick='toggleComment($action->id)'")?></span>
|
||||
<?php endif;?>
|
||||
<?php if(!empty($action->comment) or !empty($action->history)):?>
|
||||
<?php if(!empty($action->comment)) echo "<div class='history'>";?>
|
||||
<div class='changes hidden' id='changeBox<?php echo $i;?>'>
|
||||
<?php echo $this->action->printChanges($action->objectType, $action->history);?>
|
||||
</div>
|
||||
<?php if($action->comment) echo strip_tags($action->comment) == $action->comment ? nl2br($action->comment) : $action->comment; ?>
|
||||
<?php if(!empty($action->comment)) echo "</div>";?>
|
||||
<?php
|
||||
if($action->comment)
|
||||
{
|
||||
echo "<div class='comment$action->id'>";
|
||||
echo strip_tags($action->comment) == $action->comment ? nl2br($action->comment) : $action->comment;
|
||||
echo "</div>";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if($canEditComment):?>
|
||||
<div class='hidden' id='lastCommentBox'>
|
||||
<form method='post' action='<?php echo $this->createLink('action', 'editComment', "actionID=$action->id")?>'>
|
||||
<table align='center' class='table-1'>
|
||||
<tr><td><?php echo html::textarea('lastComment', $action->comment,"rows='5' class='w-p100'");?></td></tr>
|
||||
<tr><td><?php echo html::submitButton() . html::commonButton($lang->goback, "onclick='toggleComment($action->id)' class='button-s'");?></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if(!empty($action->comment)) echo "</div>";?>
|
||||
<?php endif;?>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
|
||||
@@ -179,7 +179,11 @@ class fileModel extends model
|
||||
public function setSavePath()
|
||||
{
|
||||
$savePath = $this->app->getAppRoot() . "www/data/upload/{$this->app->company->id}/" . date('Ym/', $this->now);
|
||||
if(!file_exists($savePath)) @mkdir($savePath, 0777, true);
|
||||
if(!file_exists($savePath))
|
||||
{
|
||||
@mkdir($savePath, 0777, true);
|
||||
touch($savePath . 'index.html');
|
||||
}
|
||||
$this->savePath = dirname($savePath) . '/';
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,8 @@
|
||||
if(common::hasPriv('todo', 'import2Today') and $importFuture)
|
||||
{
|
||||
$actionLink = $this->createLink('todo', 'import2Today');
|
||||
echo html::commonButton($lang->todo->import2Today, "onclick=\"changeAction('todoform', 'import2Today', '$actionLink')\"");
|
||||
echo html::commonButton($lang->todo->import, "onclick=\"changeAction('todoform', 'import2Today', '$actionLink')\"");
|
||||
echo html::input('date', date('Y-m-d'), "class='date w-80px'");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
@@ -112,6 +112,7 @@ function computeEndDate(delta)
|
||||
/* Auto compute the work days. */
|
||||
$(function()
|
||||
{
|
||||
$(".chosenBox select").chosen({no_results_text: noResultsMatch});
|
||||
setModal4List('iframe', 'taskList');
|
||||
$(".date").bind('dateSelected', function()
|
||||
{
|
||||
|
||||
@@ -78,7 +78,7 @@ $(document).ready(function()
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->manageProducts;?></th>
|
||||
<td id='productsBox'><?php echo html::checkbox("products", $allProducts, $products);?></td>
|
||||
<td class='a-left chosenBox' id='productsBox'><?php echo html::select("products[]", $allProducts, $products, "class='select-1' multiple");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->goal;?></th>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->manageProducts;?></th>
|
||||
<td id='productsBox'><?php echo html::checkbox("products", $allProducts, $linkedProducts);?></td>
|
||||
<td class='a-left chosenBox' id='productsBox'><?php echo html::select("products[]", $allProducts, $linkedProducts, "class='select-1' multiple");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->goal;?></th>
|
||||
|
||||
@@ -22,12 +22,13 @@ $config->story->close->requiredFields = 'closedReason';
|
||||
$config->story->review->requiredFields = 'assignedTo,reviewedBy,result';
|
||||
|
||||
$config->story->editor = new stdclass();
|
||||
$config->story->editor->create = array('id' => 'spec,verify', 'tools' => 'simpleTools');
|
||||
$config->story->editor->change = array('id' => 'spec,verify,comment', 'tools' => 'simpleTools');
|
||||
$config->story->editor->edit = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
$config->story->editor->view = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
$config->story->editor->close = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
$config->story->editor->review = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
$config->story->editor->create = array('id' => 'spec,verify', 'tools' => 'simpleTools');
|
||||
$config->story->editor->change = array('id' => 'spec,verify,comment', 'tools' => 'simpleTools');
|
||||
$config->story->editor->edit = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
$config->story->editor->view = array('id' => 'comment,lastComment', 'tools' => 'simpleTools');
|
||||
$config->story->editor->close = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
$config->story->editor->review = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
$config->story->editor->activate = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
|
||||
$config->story->list = new stdclass();
|
||||
$config->story->list->exportFields = '
|
||||
|
||||
@@ -20,7 +20,7 @@ $config->task->batchEdit->columns = 13;
|
||||
$config->task->editor = new stdclass();
|
||||
$config->task->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->task->editor->edit = array('id' => 'desc,comment', 'tools' => 'simpleTools');
|
||||
$config->task->editor->view = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
$config->task->editor->view = array('id' => 'comment,lastComment', 'tools' => 'simpleTools');
|
||||
$config->task->editor->assignto = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
$config->task->editor->start = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
$config->task->editor->finish = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/form.html.php';?>
|
||||
<?php include '../../common/view/datepicker.html.php';?>
|
||||
<?php include '../../common/view/chosen.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php js::set('holders', $lang->task->placeholder);?>
|
||||
<?php js::set('mailto', $lang->task->chosen->mailto);?>
|
||||
|
||||
@@ -12,7 +12,7 @@ $config->testcase->batchEdit->columns = 7;
|
||||
|
||||
$config->testcase->editor = new stdclass();
|
||||
$config->testcase->editor->edit = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
$config->testcase->editor->view = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
$config->testcase->editor->view = array('id' => 'comment,lastComment', 'tools' => 'simpleTools');
|
||||
|
||||
$config->testcase->export = new stdclass();
|
||||
$config->testcase->export->listFields = array('type', 'stage', 'pri', 'status');
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<td><?php echo $users[$case->lastRunner];?></td>
|
||||
<td><?php if(!helper::isZeroDate($case->lastRunDate)) echo date(DT_MONTHTIME1, strtotime($case->lastRunDate));?></td>
|
||||
<td class='<?php echo $case->lastRunResult;?>'><?php if($case->lastRunResult) echo $lang->testcase->resultList[$case->lastRunResult];?></td>
|
||||
<td class='<?php echo $run->status;?>'><?php echo $lang->testcase->statusList[$case->status];?></td>
|
||||
<td class='<?php if(isset($run)) echo $run->status;?>'><?php echo $lang->testcase->statusList[$case->status];?></td>
|
||||
<td class='a-right'>
|
||||
<?php
|
||||
common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", '', 'list', '', '', 'runCase');
|
||||
|
||||
@@ -8,5 +8,6 @@ $config->testtask->edit->requiredFields = 'project,build,begin,end,name';
|
||||
$config->testtask->editor = new stdclass();
|
||||
$config->testtask->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->testtask->editor->edit = array('id' => 'desc,report', 'tools' => 'simpleTools');
|
||||
$config->testtask->editor->view = array('id' => 'lastComment', 'tools' => 'simpleTools');
|
||||
$config->testtask->editor->start = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
$config->testtask->editor->close = array('id' => 'report,comment', 'tools' => 'simpleTools');
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<div id='titlebar'>
|
||||
<div id='main' <?php if($task->deleted) echo "class='deleted'";?>>TESTTASK #<?php echo $task->id . ' ' . $task->title;?></div>
|
||||
<div>
|
||||
|
||||
@@ -333,8 +333,8 @@ class todo extends control
|
||||
public function import2Today($todoID = 0)
|
||||
{
|
||||
$todoIDList = $_POST ? $this->post->todoIDList : array($todoID);
|
||||
$today = date::today();
|
||||
$this->dao->update(TABLE_TODO)->set('date')->eq($today)->where('id')->in($todoIDList)->exec();
|
||||
$date = !empty($_POST['date']) ? $_POST['date'] : date::today();
|
||||
$this->dao->update(TABLE_TODO)->set('date')->eq($date)->where('id')->in($todoIDList)->exec();
|
||||
$this->locate($this->session->todoList);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ $lang->todo->export = "Export";
|
||||
$lang->todo->delete = "Delete";
|
||||
$lang->todo->browse = "Browse";
|
||||
$lang->todo->import2Today = "Import to today";
|
||||
$lang->todo->import = "Import to";
|
||||
$lang->todo->changeStatus = "Change";
|
||||
|
||||
$lang->todo->id = 'ID';
|
||||
|
||||
@@ -23,6 +23,7 @@ $lang->todo->export = "导出";
|
||||
$lang->todo->delete = "删除待办";
|
||||
$lang->todo->browse = "浏览待办";
|
||||
$lang->todo->import2Today = "导入到今天";
|
||||
$lang->todo->import = "导入到";
|
||||
$lang->todo->changeStatus = "更改";
|
||||
|
||||
$lang->todo->id = '编号';
|
||||
|
||||
@@ -255,6 +255,7 @@ class webappModel extends model
|
||||
{
|
||||
$webapp = $this->getLocalAppByID($webappID);
|
||||
$data = fixer::input('post')->remove('files,customWidth,customHeight')->get();
|
||||
if(strpos($data->url, 'http://') !== 0) $data->url = 'http://' . $data->url;
|
||||
if($data->size == 'custom') $data->size = (float)$this->post->customWidth . 'x' . (float)$this->post->customHeight;
|
||||
|
||||
$this->dao->update(TABLE_WEBAPP)->data($data)->where('id')->eq($webappID)->check('url', 'unique', "id != $webappID")->exec();
|
||||
@@ -291,6 +292,7 @@ class webappModel extends model
|
||||
->add('addedDate', helper::now())
|
||||
->add('author', $this->app->user->account)
|
||||
->remove('files,customWidth,customHeight')->get();
|
||||
if(strpos($data->url, 'http://') !== 0) $data->url = 'http://' . $data->url;
|
||||
if($data->size == 'custom') $data->size = (float)$this->post->customWidth . 'x' . (float)$this->post->customHeight;
|
||||
$this->dao->insert(TABLE_WEBAPP)->data($data)
|
||||
->autocheck()
|
||||
|
||||
Reference in New Issue
Block a user