* ajusted layout of 'story/review'.

* added location param to the function 'closeModal' in my.js and front.class.php.
This commit is contained in:
Catouse
2014-04-28 15:27:08 +08:00
parent f4e0c5a8cb
commit 87cf62ca03
7 changed files with 82 additions and 96 deletions

View File

@@ -815,11 +815,11 @@ EOT;
* @access public
* @return void
*/
static public function closeModal($window = 'self')
static public function closeModal($window = 'self', $location)
{
$js = self::start();
$js .= "if($window.location.href == self.location.href){ $window.window.close();}";
$js .= "else{ $window.$.cookie('selfClose', 1);$window.$.closeModal();}";
$js .= "else{ $window.$.cookie('selfClose', 1);$window.$.closeModal(null, '$location');}";
$js .= self::end();
return $js;
}

View File

@@ -153,8 +153,8 @@ $lang->my->menu->testtask = array('link' => '测试|my|testtask|', 'subMod
$lang->my->menu->story = array('link' => '需求|my|story|', 'subModule' => 'story');
$lang->my->menu->myProject = '项目|my|project|';
$lang->my->menu->dynamic = '动态|my|dynamic|';
$lang->my->menu->profile = array('link' => '档案|my|profile|onlybody=yes', 'alias' => 'editprofile');
$lang->my->menu->changePassword = '密码|my|changepassword|onlybody=yes';
$lang->my->menu->profile = array('link' => '档案|my|profile', 'alias' => 'editprofile');
$lang->my->menu->changePassword = '密码|my|changepassword';
$lang->todo = new stdclass();
$lang->todo->menu = $lang->my->menu;

View File

@@ -107,6 +107,7 @@ class group extends control
{
$this->group->copy($groupID);
if(dao::isError()) die(js::error(dao::getError()));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('group', 'browse'), 'parent'));
}
@@ -198,6 +199,7 @@ class group extends control
if(!empty($_POST))
{
$this->group->updateUser($groupID);
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('group', 'browse'), 'parent'));
}
$group = $this->group->getById($groupID);

View File

@@ -1,5 +1,6 @@
$(function()
{
$('#submenuprofile').modalTrigger({width:600, type:'iframe'});
$('#submenuchangePassword').modalTrigger({width:500, type:'iframe'});
var sp = $('#submenuprofile'), scp = $('#submenuchangePassword');
sp.attr('href', sp.attr('href') + '?onlybody=yes').modalTrigger({width:600, type:'iframe'});
scp.attr('href', scp.attr('href') + '?onlybody=yes').modalTrigger({width:500, type:'iframe'});
});

View File

@@ -15,7 +15,7 @@
<div id='titlebar'>
<div class='heading'><?php echo html::icon($lang->icons['user']);?> <?php echo $lang->my->profile;?></div>
<div class='actions'>
<?php echo html::a($this->createLink('my', 'editprofile', '', '', true), $lang->user->editProfile, '', "class='btn btn-primary'");?>
<?php echo html::a($this->createLink('my', 'editprofile'), $lang->user->editProfile, '', "class='btn btn-primary'");?>
</div>
</div>
<table class='table table-borderless table-data'>

View File

@@ -11,76 +11,72 @@
*/
?>
<?php include './header.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<script language='Javascript'>
var assignedTo = '<?php $story->lastEditedBy ? print($story->lastEditedBy) : print($story->openedBy);?>';
</script>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['story']);?> <strong><?php echo $story->id;?></strong></span>
<strong><?php echo html::a($this->createLink('story', 'view', "storyID=$story->id"), $story->title);?></strong>
<small><?php echo html::icon($lang->icons['review']) . ' ' . $lang->story->review;?></small>
</div>
</div>
<div class='row'>
<div class='col-md-8'>
<div class='main'>
<form method='post' target='hiddenwin' class='form-condensed'>
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->story->reviewedDate;?></th>
<td class='w-p25-f'><?php echo html::input('reviewedDate', helper::today(), 'class=form-control');?></td><td></td>
</tr>
<tr>
<th><?php echo $lang->story->reviewResult;?></th>
<td><?php echo html::select('result', $lang->story->reviewResultList, '', 'class=form-control onchange="switchShow(this.value)"');?></td><td></td>
</tr>
<tr id='rejectedReasonBox' class='hidden'>
<th><?php echo $lang->story->rejectedReason;?></th>
<td><?php echo html::select('closedReason', $lang->story->reasonList, '', 'class=form-control onchange="setStory(this.value)"');?></td><td></td>
</tr>
<tr id='duplicateStoryBox' class='hidden'>
<th><?php echo $lang->story->duplicateStory;?></th>
<td><?php echo html::input('duplicateStory', '', 'class=form-control');?></td><td></td>
</tr>
<tr id='childStoriesBox' class='hidden'>
<th><?php echo $lang->story->childStories;?></th>
<td><?php echo html::input('childStories', '', 'class=form-control');?></td><td></td>
</tr>
<?php if($story->status == 'changed' or ($story->status == 'draft' and $story->version > 1)):?>
<tr id='preVersionBox' class='hidden'>
<th><?php echo $lang->story->preVersion;?></th>
<td colspan='2'><?php echo html::radio('preVersion', array_combine(range($story->version - 1, 1), range($story->version - 1, 1)), $story->version - 1);?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->story->assignedTo;?></th>
<td><?php echo html::select('assignedTo', $users, $story->lastEditedBy ? $story->lastEditedBy : $story->openedBy, 'class=form-control');?></td><td></td>
</tr>
<tr>
<th><?php echo $lang->story->reviewedBy;?></th>
<td colspan='2'><?php echo html::select('reviewedBy[]', $users, $app->user->account, "class='form-control' multiple data-placeholder='{$lang->story->chosen->reviewedBy}'");?></td>
</tr>
<tr>
<th><?php echo $lang->story->comment;?></th>
<td colspan='2'><?php echo html::textarea('comment', '', "rows='8' class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->story->checkAffection;?></th>
<td colspan='2'><?php include './affected.html.php';?></td>
</tr>
<tr>
<td></td>
<td colspan='2'>
<?php echo html::submitButton();?>
<?php echo html::linkButton($lang->goback, $app->session->storyList ? $app->session->storyList : inlink('view', "storyID=$story->id"));?>
</td>
</tr>
</table>
</form>
<div class='container'>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['story']);?> <strong><?php echo $story->id;?></strong></span>
<strong><?php echo html::a($this->createLink('story', 'view', "storyID=$story->id"), $story->title);?></strong>
<small><?php echo html::icon($lang->icons['review']) . ' ' . $lang->story->review;?></small>
</div>
</div>
<div class='col-md-4'>
<div class='main main-side'><?php include '../../common/view/action.html.php';?></div>
</div>
<form method='post' target='hiddenwin' class='form-condensed'>
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->story->reviewedDate;?></th>
<td class='w-p25-f'><?php echo html::input('reviewedDate', helper::today(), "class='form-control form-date'");?></td><td></td>
</tr>
<tr>
<th><?php echo $lang->story->reviewResult;?></th>
<td><?php echo html::select('result', $lang->story->reviewResultList, '', 'class=form-control onchange="switchShow(this.value)"');?></td><td></td>
</tr>
<tr id='rejectedReasonBox' class='hidden'>
<th><?php echo $lang->story->rejectedReason;?></th>
<td><?php echo html::select('closedReason', $lang->story->reasonList, '', 'class=form-control onchange="setStory(this.value)"');?></td><td></td>
</tr>
<tr id='duplicateStoryBox' class='hidden'>
<th><?php echo $lang->story->duplicateStory;?></th>
<td><?php echo html::input('duplicateStory', '', 'class=form-control');?></td><td></td>
</tr>
<tr id='childStoriesBox' class='hidden'>
<th><?php echo $lang->story->childStories;?></th>
<td><?php echo html::input('childStories', '', 'class=form-control');?></td><td></td>
</tr>
<?php if($story->status == 'changed' or ($story->status == 'draft' and $story->version > 1)):?>
<tr id='preVersionBox' class='hidden'>
<th><?php echo $lang->story->preVersion;?></th>
<td colspan='2'><?php echo html::radio('preVersion', array_combine(range($story->version - 1, 1), range($story->version - 1, 1)), $story->version - 1);?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->story->assignedTo;?></th>
<td><?php echo html::select('assignedTo', $users, $story->lastEditedBy ? $story->lastEditedBy : $story->openedBy, 'class=form-control');?></td><td></td>
</tr>
<tr>
<th><?php echo $lang->story->reviewedBy;?></th>
<td colspan='2'><?php echo html::select('reviewedBy[]', $users, $app->user->account, "class='form-control' multiple data-placeholder='{$lang->story->chosen->reviewedBy}'");?></td>
</tr>
<tr>
<th><?php echo $lang->story->comment;?></th>
<td colspan='2'><?php echo html::textarea('comment', '', "rows='8' class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->story->checkAffection;?></th>
<td colspan='2'><?php include './affected.html.php';?></td>
</tr>
<tr>
<td></td>
<td colspan='2'>
<?php echo html::submitButton();?>
<?php echo html::linkButton($lang->goback, $app->session->storyList ? $app->session->storyList : inlink('view', "storyID=$story->id"));?>
</td>
</tr>
</table>
</form>
<hr class='small'>
<div class='main'><?php include '../../common/view/action.html.php';?></div>
</div>
<?php include '../../common/view/footer.html.php';?>

View File

@@ -965,9 +965,17 @@ function setModal()
}
$ajaxModal = $('#ajaxModal');
$.extend({'closeModal':function(callback)
$.extend({'closeModal':function(callback, location)
{
$ajaxModal.on('hidden.bs.modal', callback);
$ajaxModal.on('hidden.bs.modal', function()
{
if(location)
{
if(location == 'this') window.location.reload();
else window.location = location;
}
callback();
});
$ajaxModal.modal('hide');
}});
@@ -1056,25 +1064,6 @@ function condensedForm()
});
}
/**
* Update data to the target element synchronous.
*
* @access public
* @return void
*/
function setSyncTrigger()
{
$("[data-sync-target]").on('input propertychange', function()
{
var $this = $(this);
var val = $this.prop('tagName') == 'INPUT' ? $this.val() : $this.html();
var target = $($this.attr('data-sync-target'));
if(target.prop('tagName') == 'INPUT') target.val(val);
else target.html(val);
});
}
/* Ping the server every some minutes to keep the session. */
needPing = true;
@@ -1099,8 +1088,6 @@ $(document).ready(function()
toggleSearch();
toggleTreeBox();
setSyncTrigger();
hideClearDataLink();
$(window).resize(saveWindowSize); // When window resized, call it again.