* finish task#1686.

This commit is contained in:
azhi
2013-08-08 11:39:58 +08:00
parent a087704212
commit 3b74f6ad70
16 changed files with 40 additions and 99 deletions

View File

@@ -2,9 +2,3 @@ $(function()
{
if(typeof(listName) != 'undefined') setModal4List('iframe', listName, function(){$(".colorbox").colorbox({width:960, height:550, iframe:true, transition:'none'});});
});
function changeAction(formName, actionName, actionLink)
{
if(formName =='myTaskForm' && actionName == 'batchClose') $('#' + formName).attr('target', 'hiddenwin');
$('#' + formName).attr('action', actionLink).submit();
}

View File

@@ -5,19 +5,4 @@ function changeDate(date)
location.href=link;
}
/**
* Change form action.
*
* @param formName $formName
* @param actionName $actionName
* @param actionLink $actionLink
* @access public
* @return void
*/
function changeAction(formName, actionName, actionLink)
{
if(actionName == 'batchFinish') $('#' + formName).attr('target', 'hiddenwin');
$('#' + formName).attr('action', actionLink).submit();
}
$(".colorbox").colorbox({width:960, height:550, iframe:true, transition:'none'});

View File

@@ -85,12 +85,12 @@
if($canBatchEdit)
{
$actionLink = $this->createLink('story', 'batchEdit');
echo html::commonButton($lang->edit, "onclick=\"changeAction('myStoryForm', 'batchEdit', '$actionLink')\"");
echo html::commonButton($lang->edit, "onclick=\"setFormAction('$actionLink')\"");
}
if($canBatchClose)
{
$actionLink = $this->createLink('story', 'batchClose');
echo html::commonButton($lang->close, "onclick=\"changeAction('myStoryForm', 'batchClose', '$actionLink')\"");
echo html::commonButton($lang->close, "onclick=\"setFormAction('$actionLink')\"");
}
}
?>

View File

@@ -83,12 +83,12 @@
if($canBatchEdit)
{
$actionLink = $this->createLink('task', 'batchEdit', "projectID=0&orderBy=$orderBy");
echo html::commonButton($lang->edit, "onclick=\"changeAction('myTaskForm', 'batchEdit', '$actionLink')\"");
echo html::commonButton($lang->edit, "onclick=\"setFormAction('$actionLink')\"");
}
if($canBatchClose)
{
$actionLink = $this->createLink('task', 'batchClose');
echo html::commonButton($lang->close, "onclick=\"changeAction('myTaskForm', 'batchClose', '$actionLink')\"");
echo html::commonButton($lang->close, "onclick=\"setFormAction('$actionLink','hiddenwin')\"");
}
?>
</div>

View File

@@ -89,12 +89,12 @@
if($canBatchEdit)
{
$actionLink = $this->createLink('testcase', 'batchEdit');
echo html::submitButton($lang->edit, "onclick=changeAction('myCaseForm','batchEdit','$actionLink')");
echo html::submitButton($lang->edit, "onclick=setFormAction('$actionLink')");
}
if($canBatchRun)
{
$actionLink = $this->createLink('testtask', 'batchRun', "productID=0&orderBy=$orderBy&from=testcase");
echo html::submitButton($lang->testtask->runCase, "onclick=changeAction('myCaseForm','batchEdit','$actionLink')");
echo html::submitButton($lang->testtask->runCase, "onclick=setFormAction('$actionLink')");
}
?>
</div>

View File

@@ -104,19 +104,19 @@
if(common::hasPriv('todo', 'batchEdit'))
{
$actionLink = $this->createLink('todo', 'batchEdit', "from=myTodo&type=$type&account=$account&status=$status");
echo html::commonButton($lang->edit, "onclick=\"changeAction('todoform', 'batchEdit', '$actionLink')\"");
echo html::commonButton($lang->edit, "onclick=\"setFormAction('$actionLink')\"");
}
if(common::hasPriv('todo', 'batchFinish'))
{
$actionLink = $this->createLink('todo', 'batchFinish');
echo html::commonButton($lang->todo->finish, "onclick=\"changeAction('todoform', 'batchFinish', '$actionLink')\"");
echo html::commonButton($lang->todo->finish, "onclick=\"setFormAction('$actionLink','hiddenwin')\"");
}
if(common::hasPriv('todo', 'import2Today') and $importFuture)
{
$actionLink = $this->createLink('todo', 'import2Today');
echo html::commonButton($lang->todo->import, "onclick=\"changeAction('todoform', 'import2Today', '$actionLink')\"");
echo html::commonButton($lang->todo->import, "onclick=\"setFormAction('$actionLink')\"");
echo html::input('date', date('Y-m-d'), "class='date w-80px'");
}
?>

View File

@@ -1,17 +1,3 @@
/**
* Change form action.
*
* @param url $actionLink
* @param bool $hiddenwin
* @access public
* @return void
*/
function changeAction(actionLink, hiddenwin)
{
if(hiddenwin) $('form').attr('target', 'hiddenwin');
$('form').attr('action', actionLink).submit();
}
$(function()
{
if(browseType == 'bysearch') ajaxGetSearchForm();

View File

@@ -119,7 +119,7 @@
$actionLink = $this->createLink('story', 'batchEdit', "productID=$productID&projectID=0");
echo "<div class='groupButton dropButton'>";
echo html::commonButton($lang->edit, "onclick=\"changeAction('$actionLink')\" $disabled");
echo html::commonButton($lang->edit, "onclick=\"setFormAction('$actionLink')\" $disabled");
echo "<button id='moreAction' type='button' onclick=\"toggleSubMenu(this.id, 'top', 0)\"><span class='caret'></span></button>";
echo "</div>";
}
@@ -140,7 +140,7 @@
$canBatchClose = common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory';
$actionLink = $this->createLink('story', 'batchClose', "productID=$productID&projectID=0");
$misc = $canBatchClose ? "onclick=changeAction('$actionLink')" : $class;
$misc = $canBatchClose ? "onclick=setFormAction('$actionLink')" : $class;
echo "<li>" . html::a('#', $lang->close, '', $misc) . "</li>";
$misc = common::hasPriv('story', 'batchReview') ? "onmouseover='toggleSubMenu(this.id)' onmouseout='toggleSubMenu(this.id)' id='reviewItem'" : $class;
@@ -170,7 +170,7 @@
}
else
{
echo html::a('#', $result, '', "onclick=\"changeAction('$actionLink',true)\"");
echo html::a('#', $result, '', "onclick=\"setFormAction('$actionLink','hiddenwin')\"");
}
echo "</li>";
}
@@ -189,7 +189,7 @@
{
$actionLink = $this->createLink('story', 'batchReview', "result=reject&reason=$key");
echo "<li>";
echo html::a('#', $reason, '', "onclick=\"changeAction('$actionLink',true)\"");
echo html::a('#', $reason, '', "onclick=\"setFormAction('$actionLink','hiddenwin')\"");
echo "</li>";
}
?>
@@ -204,7 +204,7 @@
foreach($plans as $planID => $plan)
{
$actionLink = $this->createLink('story', 'batchChangePlan', "planID=$planID");
echo "<li>" . html::a('#', $plan, '', "onclick=\"changeAction('$actionLink',true)\"") . "</li>";
echo "<li>" . html::a('#', $plan, '', "onclick=\"setFormAction('$actionLink','hiddenwin')\"") . "</li>";
}
?>
</ul>
@@ -217,7 +217,7 @@
foreach($lang->story->stageList as $key => $stage)
{
$actionLink = $this->createLink('story', 'batchChangeStage', "stage=$key");
echo "<li>" . html::a('#', $stage, '', "onclick=\"changeAction('$actionLink',true)\"") . "</li>";
echo "<li>" . html::a('#', $stage, '', "onclick=\"setFormAction('$actionLink','hiddenwin')\"") . "</li>";
}
?>
</ul>

View File

@@ -2,17 +2,3 @@ $(document).ready(function()
{
$("a.iframe").colorbox({width:640, height:480, iframe:true, transition:'none'});
});
/**
* Change form action.
*
* @param formName $formName
* @param actionName $actionName
* @param actionLink $actionLink
* @access public
* @return void
*/
function changeAction(formName, actionName, actionLink)
{
$('#' + formName).attr('action', actionLink).submit();
}

View File

@@ -4,10 +4,5 @@ $(function()
if(browseType == 'bysearch') ajaxGetSearchForm();
});
function changeAction(formName, actionName, actionLink)
{
if(actionName == 'batchClose') $('#' + formName).attr('target', 'hiddenwin');
$('#' + formName).attr('action', actionLink).submit();
}
$('#module' + moduleID).addClass('active');
$('#product' + productID).addClass('active');

View File

@@ -106,12 +106,12 @@
if($canBatchEdit)
{
$actionLink = $this->createLink('story', 'batchEdit', "productID=0&projectID=$project->id");
echo html::commonButton($lang->edit, "onclick=\"changeAction('projectStoryForm', 'batchEdit', '$actionLink')\"");
echo html::commonButton($lang->edit, "onclick=\"setFormAction('$actionLink')\"");
}
if($canBatchClose)
{
$actionLink = $this->createLink('story', 'batchClose', "productID=0&projectID=$project->id");
echo html::commonButton($lang->close, "onclick=\"changeAction('projectStoryForm', 'batchClose', '$actionLink')\"");
echo html::commonButton($lang->close, "onclick=\"setFormAction('$actionLink')\"");
}
}
echo $summary;

View File

@@ -150,7 +150,7 @@ var browseType = '<?php echo $browseType;?>';
echo "</div>";
$actionLink = $this->createLink('task', 'batchEdit', "projectID=$projectID");
$misc = $canBatchEdit ? "onclick=changeAction('projectTaskForm','batchEdit','$actionLink')" : "disabled='disabled'";
$misc = $canBatchEdit ? "onclick=setFormAction('$actionLink')" : "disabled='disabled'";
echo "<div class='groupButton dropButton'>";
echo html::commonButton($lang->edit, $misc);
echo "<button id='moreAction' type='button' onclick=\"toggleSubMenu(this.id, 'top', 0)\"><span class='caret'></span></button>";
@@ -173,7 +173,7 @@ var browseType = '<?php echo $browseType;?>';
<ul>
<?php
$actionLink = $this->createLink('task', 'batchClose');
$misc = $canBatchClose ? "onclick=changeAction('projectTaskForm','batchClose','$actionLink')" : "class='disabled'";
$misc = $canBatchClose ? "onclick=setFormAction('$actionLink','hiddenwin')" : "class='disabled'";
echo "<li>" . html::a('#', $lang->close, '', $misc) . "</li>";
?>
</ul>

View File

@@ -9,11 +9,6 @@ function browseBySearch(active)
$('#bymoduleTab').removeClass('active');
}
function changeAction(url)
{
$('#batchForm').attr('action', url);
}
$(document).ready(function()
{
setModal4List('runCase', 'caseList', function(){$(".results").colorbox({width:900, height:550, iframe:true, transition:'none'});});

View File

@@ -123,8 +123,8 @@ js::set('confirmDelete', $lang->testcase->confirmDelete);
<div class='f-left'>
<?php
if($canBatchEdit or $canBatchRun) echo html::selectAll() . html::selectReverse();
if($canBatchEdit) echo html::submitButton($lang->edit, "onclick='changeAction(\"" . inLink('batchEdit', "productID=$productID") . "\")'");
if($canBatchRun) echo html::submitButton($lang->testtask->runCase, "onclick='changeAction(\"" . $this->createLink('testtask', 'batchRun', "productID=$productID&orderBy=$orderBy") . "\")'");
if($canBatchEdit) echo html::submitButton($lang->edit, "onclick='setFormAction(\"" . inLink('batchEdit', "productID=$productID") . "\")'");
if($canBatchRun) echo html::submitButton($lang->testtask->runCase, "onclick='setFormAction(\"" . $this->createLink('testtask', 'batchRun', "productID=$productID&orderBy=$orderBy") . "\")'");
?>
</div>
<?php endif?>

View File

@@ -18,11 +18,6 @@ function browseBySearch(active)
$('#bymoduleTab').removeClass('active');
}
function changeAction(url)
{
$('#batchForm').attr('action', url);
}
$(document).ready(function()
{
setModal4List('runCase', 'caseList', function(){$(".results").colorbox({width:900, height:550, iframe:true, transition:'none'});});

View File

@@ -106,20 +106,25 @@ var moduleID = '<?php echo $moduleID;?>';
<?php if($runs):?>
<div class='f-left'>
<?php if($canBatchEdit or $canBatchAssign or $canBatchRun) echo html::selectAll() . html::selectReverse(); ?>
<?php if($canBatchEdit):?>
<input class='button-s' value="<?php echo $lang->edit; ?>" type="button" onclick="casesform.action='<?php echo $this->createLink('testcase', 'batchEdit', "from=testtaskCases&productID=$productID");?>';casesform.submit();">
<?php endif;?>
<?php if($canBatchAssign):?>
<?php echo html::select('assignedTo', $users);?>
<input class='button-s' value="<?php echo $lang->testtask->assign; ?>" type="button" onclick="casesform.action='<?php echo inLink('batchAssign', "taskID=$task->id");?>';casesform.submit();">
<?php endif;?>
<?php if($canBatchRun):?>
<input class='button-s' value="<?php echo $lang->testtask->runCase; ?>" type="button" onclick="casesform.action='<?php echo inLink('batchRUN', "productID=$productID&orderBy=id_desc&from=testtask");?>';casesform.submit();">
<?php endif;?>
<?php
if($canBatchEdit or $canBatchAssign or $canBatchRun) echo html::selectAll() . html::selectReverse();
if($canBatchEdit)
{
$actionLink = $this->createLink('testcase', 'batchEdit', "productID=$productID");
echo html::commonButton($lang->edit, "onclick=\"setFormAction('$actionLink')\"");
}
if($canBatchAssign)
{
$actionLink = inLink('batchAssign', "taskID=$task->id");
echo html::select('assignedTo', $users);
echo html::commonButton($lang->testtask->assign, "onclick=\"setFormAction('$actionLink')\"");
}
if($canBatchRun)
{
$actionLink = inLink('batchRUN', "productID=$productID&orderBy=id_desc&from=testtask");
echo html::commonButton($lang->testtask->runCase, "onclick=\"setFormAction('$actionLink')\"");
}
?>
</div>
<?php endif;?>