From d8c016a22e46464bfc99a0cab9cc7af065a916f6 Mon Sep 17 00:00:00 2001 From: "chencongzhi520@gmail.com" Date: Sat, 13 Jul 2013 08:28:14 +0000 Subject: [PATCH] * finish task#1513. --- module/product/control.php | 11 ++- module/product/css/browse.css | 108 +++++++++++++++++++++++++ module/product/js/browse.js | 66 +++++++++++++++ module/product/view/storylist.html.php | 93 ++++++++++++++++----- module/story/control.php | 9 +++ 5 files changed, 267 insertions(+), 20 deletions(-) create mode 100644 module/product/css/browse.css diff --git a/module/product/control.php b/module/product/control.php index 79a12899d7..860d628ab9 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -465,10 +465,17 @@ class product extends control * @access public * @return void */ - public function ajaxGetPlans($productID, $planID = 0) + public function ajaxGetPlans($productID, $planID = 0, $dropMenu = false) { $plans = $this->loadModel('productplan')->getPairs($productID); - die(html::select('plan', $plans, $planID)); + if(!$dropMenu) die(html::select('plan', $plans, $planID)); + + echo ""; } /** diff --git a/module/product/css/browse.css b/module/product/css/browse.css new file mode 100644 index 0000000000..078cf9606a --- /dev/null +++ b/module/product/css/browse.css @@ -0,0 +1,108 @@ +.listMenu +{ + position:absolute; + background:#fff; + border: 1px solid rgba(0,0,0,0.2); + border-radius: 6px 6px 6px 6px; + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); +} + +.listMenu ul +{ + margin:5px 0px; +} + +.listMenu ul li +{ + padding:3px 0px; + height:20px; + font-size:14px; + list-style-type:none; +} + +.listMenu ul li:hover +{ + background:#1AA8D2; + cursor:pointer; +} + +.listMenu ul li a +{ + padding:0px 20px; + float:left; + clear: both; + color: #333333; + display: block; + font-weight: normal; + line-height: 20px; + white-space: nowrap; +} + +.listMenu ul li a[id$='Item']:after +{ + border-color: transparent transparent transparent #CCCCCC; + border-style: solid; + border-width: 5px 0 5px 5px; + content: " "; + display: block; + float: right; + height: 0; + margin-right: -10px; + margin-top: 5px; + width: 0; +} + +.groupButton +{ + display:inline-block; +} + +.groupButton > input[type='button'], #allchecker, #reversechecker +{ + -moz-border-bottom-colors: none; + -moz-border-left-colors: none; + -moz-border-right-colors: none; + -moz-border-top-colors: none; + background-color: #F5F5F5; + background-image: linear-gradient(to bottom, #FFFFFF, #E6E6E6); + background-repeat: repeat-x; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) #B3B3B3; + border-image: none; + border-radius: 4px 4px 4px 4px; + border-style: solid; + border-width: 1px; + box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); + color: #333333; + cursor: pointer; + display: inline-block; + font-size: 14px; + line-height: 20px; + margin-bottom: 0; + padding: 4px 12px; + margin-right:5px; + text-align: center; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + vertical-align: middle; +} + +.groupButton > input[type='button'] +{ + border-radius: 0px; +} + +.groupButton > input[type='button']:first-child +{ + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; + margin-right: 0; +} + +.groupButton > input[type='button'] + input[type='button'] +{ + box-shadow: 1px 0 0 rgba(255, 255, 255, 0.125) inset, 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; + padding-left: 8px; + padding-right: 8px; + margin-left:-5px; +} diff --git a/module/product/js/browse.js b/module/product/js/browse.js index 90d847e8bf..29ed9bf1b8 100644 --- a/module/product/js/browse.js +++ b/module/product/js/browse.js @@ -22,6 +22,72 @@ function changeAction(formName, actionName, actionLink) $('#' + formName).attr('action', actionLink).submit(); } +/** + * Toggle sub menu. + * + * @param string $currentID + * @param string position = 'right' | 'top' + * @param bool entry + * @access public + * @return void + */ +function toggleSubMenu(currentID, position = 'right', menuIndex = 1) +{ + if(menuIndex) + { + currentMenu = $('#' + currentID).parent().parent().parent().attr('id'); + $('#' + currentID + 'Menu').bind('mouseover', + function(){ + $('#' + currentMenu).show(); + return $('#' + currentID + 'Menu').show() + }); + + $('#' + currentID).parent().bind('mouseleave', + function(){ + return $('#' + currentID + 'Menu').hide() + }); + + $('#' + currentID + 'Menu').bind('mouseleave', + function(){ + return $('#' + currentID + 'Menu').hide() + }); + } + + var offset = $('#' + currentID).offset(); + var topOffset = 0; + var leftOffset = 0; + if(position == 'top') + { + topOffset = offset.top - $('#' + currentID + 'Menu').height() + 'px'; + leftOffset = offset.left; + $('#' + currentID + 'Menu').css({top: topOffset, left: leftOffset}); + } + if(position == 'right') + { + if(menuIndex == 1) + { + topOffset = offset.top - $('#' + currentID + 'Menu').height() + $('#' + currentID).parent().height() + "px"; + leftOffset = offset.left + $('#' + currentID).parent().width(); + $('#' + currentID + 'Menu').css({top: topOffset, left: leftOffset}); + } + else if(menuIndex == 2) + { + currentMenu = $('#' + currentID).parent().parent().parent().attr('id'); + rootID = currentMenu.replace('Menu', ''); + topOffset = $('#' + rootID).offset().top - $('#' + currentMenu).height(); + leftOffset = $('#' + rootID).offset().left + $('#' + rootID).width() + $('#' + currentMenu).width() + 30; + $('#' + currentID + 'Menu').css({top: topOffset, left:leftOffset}); + } + } + $('#' + currentID + 'Menu').toggle(); +} + +function ajaxShowMenu(currentID, productID) +{ + $.get(createLink('product', 'ajaxGetPlans', "productID=" + productID + "&plan=0&showMenu=true"), function(data){ $('#' + currentID + 'Menu').html(data);}); + toggleSubMenu(currentID); +} + $(function() { if(browseType == 'bysearch') ajaxGetSearchForm(); diff --git a/module/product/view/storylist.html.php b/module/product/view/storylist.html.php index 446b429980..ede11b83be 100644 --- a/module/product/view/storylist.html.php +++ b/module/product/view/storylist.html.php @@ -17,10 +17,6 @@ - $story):?> createLink('story', 'view', "storyID=$story->id"); @@ -28,9 +24,7 @@ ?> - - id)); else printf('%03d', $story->id);?> story->priList[$story->pri];?>'>story->priList[$story->pri]?> @@ -62,19 +56,18 @@ createLink('story', 'batchEdit', "productID=$productID&projectID=0"); - echo html::commonButton($lang->edit, "onclick=\"changeAction('productStoryForm', 'batchEdit', '$actionLink')\""); - } - if($canBatchClose) - { - $actionLink = $this->createLink('story', 'batchClose', "productID=$productID&projectID=0"); - echo html::commonButton($lang->close, "onclick=\"changeAction('productStoryForm', 'batchClose', '$actionLink')\""); - } + echo html::selectAll() . html::selectReverse(); + + $canBatchEdit = common::hasPriv('story', 'batchEdit'); + $disabled = $canBatchEdit ? '' : 'disabled'; + $actionLink = $this->createLink('story', 'batchEdit', "productID=$productID&projectID=0"); + + echo "
"; + echo html::commonButton($lang->edit, "onclick=\"changeAction('productStoryForm', 'batchEdit', '$actionLink')\" $disabled"); + echo html::commonButton($lang->more, "onclick=\"toggleSubMenu(this.id, 'top', 0)\" id='moreAction'"); + echo "
"; } + echo $summary; ?> @@ -83,3 +76,67 @@ + + + + + + + + + + diff --git a/module/story/control.php b/module/story/control.php index 4c178e30f5..d04c355f3f 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -568,6 +568,15 @@ class story extends control $this->display(); } + function batchReview($result, $reason = '') + { + $storyIDList = $this->post->storyIDList ? $this->post->storyIDList : die(js::locate($this->session->storyList, 'parent')); + foreach($storyIDList as $storyID) + { + // $this->story->review($storyID); + } + } + /** * Close a story. *