|
From: <gem...@li...> - 2013-04-10 08:33:12
|
Revision: 1216
http://sourceforge.net/p/gemstracker/code/1216
Author: mennodekker
Date: 2013-04-10 08:33:06 +0000 (Wed, 10 Apr 2013)
Log Message:
-----------
Fixed layout for compliance overview with round descriptions/icons
Modified Paths:
--------------
trunk/library/classes/Gems/Default/ComplianceAction.php
trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php
Modified: trunk/library/classes/Gems/Default/ComplianceAction.php
===================================================================
--- trunk/library/classes/Gems/Default/ComplianceAction.php 2013-04-09 14:36:33 UTC (rev 1215)
+++ trunk/library/classes/Gems/Default/ComplianceAction.php 2013-04-10 08:33:06 UTC (rev 1216)
@@ -107,7 +107,7 @@
}
$select = $this->db->select();
- $select->from('gems__rounds', array('gro_id_round', 'gro_id_order', 'gro_round_description'))
+ $select->from('gems__rounds', array('gro_id_round', 'gro_id_order', 'gro_round_description', 'gro_icon_file'))
->joinInner('gems__surveys', 'gro_id_survey = gsu_id_survey', array('gsu_survey_name'))
->where('gro_id_track = ?', $filter['gr2t_id_track'])
->order('gro_id_order');
@@ -147,7 +147,8 @@
$transformer->set($name, 'label', MUtil_Lazy::call('substr', $row['gsu_survey_name'], 0, 2),
'description', sprintf("%s\n[%s]", $row['gsu_survey_name'], $row['gro_round_description']),
'noSort', true,
- 'round', $row['gro_round_description']
+ 'round', $row['gro_round_description'],
+ 'roundIcon', $row['gro_icon_file']
);
$transformer->set('tok_' . $row['gro_id_round']);
}
Modified: trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php
===================================================================
--- trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php 2013-04-09 14:36:33 UTC (rev 1215)
+++ trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php 2013-04-10 08:33:06 UTC (rev 1216)
@@ -78,6 +78,9 @@
if ($showMenuItem = $this->getShowMenuItem()) {
$bridge->addItemLink($showMenuItem->toActionLinkLower($this->request, $bridge));
}
+
+ // Initialize alter
+ $alternateClass = new MUtil_Lazy_Alternate(array('odd', 'even'));
foreach($model->getItemsOrdered() as $name) {
if ($label = $model->get($name, 'label')) {
@@ -86,13 +89,26 @@
$span++;
$class = null;
} else {
- $th->append($cRound);
+ // If the round has an icon, show the icon else just 'R' since
+ // complete round description messes up the display
+ if (!empty($cIcon)) {
+ $content = MUtil_Html_ImgElement::imgFile($cIcon, array(
+ 'alt' => $cRound,
+ 'title' => $cRound
+ ));
+ } else {
+ $content = 'R';
+ }
+ $th->append($content);
+ $th->title = $cRound;
$th->colspan = $span;
- $span = 1;
- $cRound = $round;
- $class = 'newRound';
- $th = $th_row->td(array('class' => $class));
+ $span = 1;
+ $cRound = $round;
+ $cIcon = $model->get($name, 'roundIcon');
+ $class = 'newRound';
+ $thClass = $class .' ' . $alternateClass; // Add alternate class only for th
+ $th = $th_row->td(array('class' => $thClass));
}
if ($model->get($name, 'noSort')) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|