diff --git a/module/execution/ui/dynamic.html.php b/module/execution/ui/dynamic.html.php index bea07239c4..40e06c2170 100644 --- a/module/execution/ui/dynamic.html.php +++ b/module/execution/ui/dynamic.html.php @@ -48,9 +48,11 @@ else { $content = array(); $firstAction = ''; + $lastAction = ''; foreach($dateGroups as $date => $actions) { $isToday = date(DT_DATE4) == $date; + if(empty($firstAction)) $firstAction = reset($actions); $content[] = li ( div @@ -82,6 +84,7 @@ else ) ) ); + $lastAction = end($actions); } $content = ul @@ -97,7 +100,7 @@ panel($content); if(!empty($firstAction)) { $firstDate = date('Y-m-d', strtotime($firstAction->originalDate) + 24 * 3600); - $lastDate = substr($action->originalDate, 0, 10); + $lastDate = substr($lastAction->originalDate, 0, 10); $hasPre = $this->action->hasPreOrNext($firstDate, 'pre'); $hasNext = $this->action->hasPreOrNext($lastDate, 'next'); $preLink = $hasPre ? inlink('dynamic', "executionID=$executionID&type=$type¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($firstDate) . '&direction=pre') : 'javascript:;'; @@ -107,8 +110,8 @@ if(!empty($firstAction)) { floatPreNextBtn ( - empty($hasPre) ? null : set::preLink($preLink), - empty($hasNext) ? null : set::nextLink($nextLink) + empty($hasNext) ? null : set::preLink($nextLink), + empty($hasPre) ? null : set::nextLink($preLink) ); } } diff --git a/module/my/ui/dynamic.html.php b/module/my/ui/dynamic.html.php index 7898a6fc4e..1bfc5297b4 100644 --- a/module/my/ui/dynamic.html.php +++ b/module/my/ui/dynamic.html.php @@ -34,9 +34,11 @@ else { $content = array(); $firstAction = ''; + $lastAction = ''; foreach($dateGroups as $date => $actions) { - $isToday = date(DT_DATE3) == $date; + $isToday = date(DT_DATE3) == $date; + if(empty($firstAction)) $firstAction = reset($actions); $content[] = li ( div @@ -68,6 +70,7 @@ else ) ) ); + $lastAction = end($actions); } $content = ul @@ -83,7 +86,7 @@ panel($content); if(!empty($firstAction)) { $firstDate = date('Y-m-d', strtotime($firstAction->originalDate) + 24 * 3600); - $lastDate = substr($action->originalDate, 0, 10); + $lastDate = substr($lastAction->originalDate, 0, 10); $hasPre = $this->action->hasPreOrNext($firstDate, 'pre'); $hasNext = $this->action->hasPreOrNext($lastDate, 'next'); $preLink = $hasPre ? inlink('dynamic', "type=$type&recTotal={$pager->recTotal}&date=" . strtotime($firstDate) . '&direction=pre') : 'javascript:;'; @@ -93,8 +96,8 @@ if(!empty($firstAction)) { floatPreNextBtn ( - empty($hasPre) ? null : set::preLink($preLink), - empty($hasNext) ? null : set::nextLink($nextLink) + empty($hasNext) ? null : set::preLink($nextLink), + empty($hasPre) ? null : set::nextLink($preLink) ); } } diff --git a/module/product/ui/dynamic.html.php b/module/product/ui/dynamic.html.php index d9cd5628bf..2a0241b198 100644 --- a/module/product/ui/dynamic.html.php +++ b/module/product/ui/dynamic.html.php @@ -110,7 +110,8 @@ if($hasPre || $hasNext) { floatPreNextBtn ( - empty($hasPre) ? null : set::preLink($preLink), - empty($hasNext) ? null : set::nextLink($nextLink) + empty($hasNext) ? null : set::preLink($nextLink), + empty($hasPre) ? null : set::nextLink($preLink) + ); } diff --git a/module/project/ui/dynamic.html.php b/module/project/ui/dynamic.html.php index 3fd0c18201..3903f322a9 100644 --- a/module/project/ui/dynamic.html.php +++ b/module/project/ui/dynamic.html.php @@ -48,9 +48,11 @@ else { $content = array(); $firstAction = ''; + $lastAction = ''; foreach($dateGroups as $date => $actions) { $isToday = date(DT_DATE4) == $date; + if(empty($firstAction)) $firstAction = reset($actions); $content[] = li ( div @@ -75,6 +77,7 @@ else ) ) ); + $lastAction = end($actions); } $content = ul @@ -90,7 +93,7 @@ panel($content); if(!empty($firstAction)) { $firstDate = date('Y-m-d', strtotime($firstAction->originalDate) + 24 * 3600); - $lastDate = substr($action->originalDate, 0, 10); + $lastDate = substr($lastAction->originalDate, 0, 10); $hasPre = $this->action->hasPreOrNext($firstDate, 'pre'); $hasNext = $this->action->hasPreOrNext($lastDate, 'next'); $preLink = $hasPre ? inlink('dynamic', "projectID=$projectID&type=$type¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($firstDate) . '&direction=pre') : 'javascript:;'; @@ -100,8 +103,8 @@ if(!empty($firstAction)) { floatPreNextBtn ( - empty($hasPre) ? null : set::preLink($preLink), - empty($hasNext) ? null : set::nextLink($nextLink) + empty($hasNext) ? null : set::preLink($nextLink), + empty($hasPre) ? null : set::nextLink($preLink) ); } }