[evolvis-commits] r17278: - Added basic design↵ - Added Info about the time left for one sprint.

messer at evolvis.org messer at evolvis.org
Mon May 30 13:22:56 CEST 2011


Author: messer
Date: 2011-05-30 13:22:56 +0200 (Mon, 30 May 2011)
New Revision: 17278

Added:
   trunk/plugins/scrum/plugins/scrum/include/SprintAttributeProvider.class.php
   trunk/plugins/scrum/plugins/scrum/include/interfaces/IAttributeProvider.php
   trunk/plugins/scrum/www/plugins/scrum/media/placeholder_ganttchart.png
Modified:
   trunk/plugins/scrum/plugins/scrum/common/scrum-init.php
   trunk/plugins/scrum/plugins/scrum/include/FusionForgeTableRenderer.class.php
   trunk/plugins/scrum/plugins/scrum/include/SprintDataProvider.class.php
   trunk/plugins/scrum/plugins/scrum/include/Table.class.php
   trunk/plugins/scrum/plugins/scrum/include/interfaces/ITableRenderer.php
   trunk/plugins/scrum/www/plugins/scrum/scrum.php
Log:
- Added basic design
- Added Info about the time left for one sprint.

Modified: trunk/plugins/scrum/plugins/scrum/common/scrum-init.php
===================================================================
--- trunk/plugins/scrum/plugins/scrum/common/scrum-init.php	2011-05-26 12:07:47 UTC (rev 17277)
+++ trunk/plugins/scrum/plugins/scrum/common/scrum-init.php	2011-05-30 11:22:56 UTC (rev 17278)
@@ -27,8 +27,10 @@
 require_once $gfplugins.'scrum/include/interfaces/IDataProvider.php';
 require_once $gfplugins.'scrum/include/interfaces/ITableRenderer.php';
 require_once $gfplugins.'scrum/include/interfaces/IFactory.php';
+require_once $gfplugins.'scrum/include/interfaces/IAttributeProvider.php';
 require_once $gfplugins.'scrum/include/Sprint.class.php';
 require_once $gfplugins.'scrum/include/SprintDataProvider.class.php';
+require_once $gfplugins.'scrum/include/SprintAttributeProvider.class.php';
 require_once $gfplugins.'scrum/include/Table.class.php';
 require_once $gfplugins.'scrum/include/FusionForgeTableRenderer.class.php';
 

Modified: trunk/plugins/scrum/plugins/scrum/include/FusionForgeTableRenderer.class.php
===================================================================
--- trunk/plugins/scrum/plugins/scrum/include/FusionForgeTableRenderer.class.php	2011-05-26 12:07:47 UTC (rev 17277)
+++ trunk/plugins/scrum/plugins/scrum/include/FusionForgeTableRenderer.class.php	2011-05-30 11:22:56 UTC (rev 17278)
@@ -1,5 +1,6 @@
 <?php
-/*-
+
+/* -
  * SCRUM plugin for FusionForge
  *
  * Copyright © 2011
@@ -20,35 +21,43 @@
  * You should have received a copy of the GNU General Public License along
  * with FusionForge; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *-
+ * -
  * Implements a Table Renderer for fusion forge tables.
  */
 
 class FusionForgeTableRenderer implements ITableRenderer {
+
     private $provider;
+    private $attributeProvider;
     
     public function RenderTableTop() {
         $titles = $this->provider->GetColumns();
-        
+
         echo $GLOBALS['HTML']->listTableTop($titles);
     }
-    
+
     public function RenderRow($rowIndex) {
         echo '<tr class="bgcolor-white">';
-        echo '<td><a href="#">'.$this->provider->Get($rowIndex, 0).'</a></td>';
-        echo '<td>'.$this->provider->Get($rowIndex, 1).'</td>';
-        echo '<td>'.$this->provider->Get($rowIndex, 2).'</td>';
-        echo '<td>'.$this->provider->Get($rowIndex, 3).'</td>';
+        
+        for ($i = 0; $i < $this->provider->GetNumCols(); $i++) {
+            echo '<td ' .$this->attributeProvider->GetAttributeString($i).'>'. $this->provider->Get($rowIndex, $i) . '</td>';
+        }
+        
         echo '</tr>';
     }
-    
+
     public function RenderTableBottom() {
         echo $GLOBALS['HTML']->listTableBottom();
     }
-    
+
     public function SetDataProvider($provider) {
         $this->provider = $provider;
     }
+    
+    public function SetAttributeProvider($attributeProvider) {
+        $this->attributeProvider = $attributeProvider;
+    }
+
 }
 
 ?>

Added: trunk/plugins/scrum/plugins/scrum/include/SprintAttributeProvider.class.php
===================================================================
--- trunk/plugins/scrum/plugins/scrum/include/SprintAttributeProvider.class.php	                        (rev 0)
+++ trunk/plugins/scrum/plugins/scrum/include/SprintAttributeProvider.class.php	2011-05-30 11:22:56 UTC (rev 17278)
@@ -0,0 +1,68 @@
+<?php
+
+/* -
+ * SCRUM plugin for FusionForge
+ *
+ * Copyright © 2011
+ *      Mike Esser <m.esser at tarent.de>
+ * All rights reserved.
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * -
+ * Adds some special attributes for sprint tables.
+ */
+
+class SprintAttributeProvider implements IAttributeProvider {
+
+    protected $attributes = array();
+    protected $globalAttributes;
+
+    public function SetAttribute($name, $value, $colIndex = -1) {
+        if ($colIndex !== -1) {
+            $this->attributes[$colIndex][$name] = $value;
+        } else {
+            $this->globalAttributes[$name] = $value;
+        }
+    }
+
+    public function GetAttributeString($colIndex) {
+        /*$attString = '';
+
+        while ($curAtt = current($this->globalAttributes)) {
+            $attString .= key($this->globalAttributes) . '="' . $curAtt . '" ';
+
+            next($this->globalAttributes);
+        }
+
+        while ($curCol = current($this->attributes)) {
+            
+            if(key($this->attributes) == $colIndex) {
+                while ($curAtt = current($curCol)) {
+                    $attString .= key($curCol) . '="' . $curAtt . '" ';
+
+                    next($curCol);
+                }
+            }
+            
+            next($this->attributes);
+        }
+        
+        return $attString;*/
+    }
+
+}
+
+?>

Modified: trunk/plugins/scrum/plugins/scrum/include/SprintDataProvider.class.php
===================================================================
--- trunk/plugins/scrum/plugins/scrum/include/SprintDataProvider.class.php	2011-05-26 12:07:47 UTC (rev 17277)
+++ trunk/plugins/scrum/plugins/scrum/include/SprintDataProvider.class.php	2011-05-30 11:22:56 UTC (rev 17278)
@@ -25,7 +25,7 @@
  */
 
 class SprintDataProvider implements IDataProvider {
-    private $columns = array('Name', 'Started', 'Due Date', 'Completed');
+    private $columns = array('Name', 'Started', 'Due Date', 'Days left', 'Completed');
     
     private $data;
     
@@ -36,7 +36,7 @@
     public function Get($rowIndex, $colIndex) {
         switch($colIndex) {
             case 0:
-                return $this->data[$rowIndex]->GetName();
+                return '<a href="#">'. $this->data[$rowIndex]->GetName(). '</a>';
                 break;
             case 1:
                 return $this->data[$rowIndex]->GetFrom();
@@ -45,7 +45,16 @@
                 return $this->data[$rowIndex]->GetTo();
                 break;
             case 3:
-                return "PercentValue";
+                //Returns the days left for the sprint. 0 indicates the due date is within 24 hours.
+                $timeLeft = number_format(((strtotime($this->data[$rowIndex]->GetTo()) - strtotime('now')) / (60*60*24)), 2);
+                
+                if($timeLeft < 0) {
+                    $timeLeft = _("Due");
+                }
+                
+                return $timeLeft;
+            case 4:
+                return "20%";
                 break;
             default:
                 return "Invalid column index";
@@ -54,7 +63,7 @@
     }
     
     public function GetNumCols() {
-        return count(SprintDataProvider::$columns);
+        return 5;
     }
     
     public function GetNumRows() {
@@ -77,7 +86,7 @@
     public function FillTestData() {
         for($i = 0; $i < 20; $i++) {
             $this->data[$i] = new Sprint();
-            $this->data[$i]->Initialize($i, "TestSprint $i", "foo", "bar", null);
+            $this->data[$i]->Initialize($i, "TestSprint $i", "2011-04-25 08:00:00", "2011-05-29 07:00:00", null);
         }
     }
 }

Modified: trunk/plugins/scrum/plugins/scrum/include/Table.class.php
===================================================================
--- trunk/plugins/scrum/plugins/scrum/include/Table.class.php	2011-05-26 12:07:47 UTC (rev 17277)
+++ trunk/plugins/scrum/plugins/scrum/include/Table.class.php	2011-05-30 11:22:56 UTC (rev 17278)
@@ -26,11 +26,13 @@
 
 class Table {
     protected $dataProvider;
+    protected $attributeProvider;
     protected $tableRenderer;
     protected $maxRows;
     
     public function RenderTable() {
         $this->tableRenderer->SetDataProvider($this->dataProvider);
+        $this->tableRenderer->SetAttributeProvider($this->attributeProvider);
         $this->tableRenderer->RenderTableTop();
         
         for($i = 0; $i < $this->dataProvider->GetNumRows(); $i++) {
@@ -47,6 +49,9 @@
         $this->dataProvider = $provider;
     }
     
+    public function SetAttributeProvider($attributeProvider) {
+        $this->attributeProvider = $attributeProvider;
+    }
     public function SetMaxRows($maxRows) {
         $this->maxRows = $maxRows;
     }

Added: trunk/plugins/scrum/plugins/scrum/include/interfaces/IAttributeProvider.php
===================================================================
--- trunk/plugins/scrum/plugins/scrum/include/interfaces/IAttributeProvider.php	                        (rev 0)
+++ trunk/plugins/scrum/plugins/scrum/include/interfaces/IAttributeProvider.php	2011-05-30 11:22:56 UTC (rev 17278)
@@ -0,0 +1,32 @@
+<?php
+/*-
+ * SCRUM plugin for FusionForge
+ *
+ * Copyright © 2011
+ *      Mike Esser <m.esser at tarent.de>
+ * All rights reserved.
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *-
+ * The IAttributeProvider interface is used by TableRenderer to set different
+ * attributes for table rows.
+ */
+
+interface IAttributeProvider {
+    public function GetAttributeString($colIndex);
+    public function SetAttribute($name, $value, $colIndex = -1);
+}
+?>

Modified: trunk/plugins/scrum/plugins/scrum/include/interfaces/ITableRenderer.php
===================================================================
--- trunk/plugins/scrum/plugins/scrum/include/interfaces/ITableRenderer.php	2011-05-26 12:07:47 UTC (rev 17277)
+++ trunk/plugins/scrum/plugins/scrum/include/interfaces/ITableRenderer.php	2011-05-30 11:22:56 UTC (rev 17278)
@@ -27,6 +27,7 @@
 
 interface ITableRenderer {
     public function SetDataProvider($provider);
+    public function SetAttributeProvider($attributeProvider);
     public function RenderTableTop();
     public function RenderRow($rowIndex);
     public function RenderTableBottom();

Added: trunk/plugins/scrum/www/plugins/scrum/media/placeholder_ganttchart.png
===================================================================
(Binary files differ)


Property changes on: trunk/plugins/scrum/www/plugins/scrum/media/placeholder_ganttchart.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: trunk/plugins/scrum/www/plugins/scrum/scrum.php
===================================================================
--- trunk/plugins/scrum/www/plugins/scrum/scrum.php	2011-05-26 12:07:47 UTC (rev 17277)
+++ trunk/plugins/scrum/www/plugins/scrum/scrum.php	2011-05-30 11:22:56 UTC (rev 17278)
@@ -1,4 +1,5 @@
 <?php
+
 /*-
  * SCRUM plugin for FusionForge
  *
@@ -25,6 +26,9 @@
 require_once("../../env.inc.php");
 require_once $gfcommon . 'include/pre.php';
 
+//require_once(forge_get_config('jpgraph_path').'/jpgraph.php');
+//require_once(forge_get_config('jpgraph_path').'/jpgraph_gantt.php');
+
 $group_id = getIntFromRequest('group_id');
 $pluginname = 'scrum';
 
@@ -46,19 +50,43 @@
 
 site_project_header($params);
 
-echo "NOTE: This is a Development Snapshot! Currently the Focus is on data management and data algorithms. UI is designed in a later point
-      of development. If you have questions or suggestions feel free to Contact me (Mike Esser => messer).<br /><br />";
+echo "NOTE: This is a Development Snapshot! <a href=\"https://messer-ff-dev.tarent.de/plugins/scrum/roadmap.php\">Click here</a> to see the current Roadmap.<br /><br />
+      <b>WICHTIG: Das CSS, welches dieses Layout erzeugt ist noch nicht fertig. Es hat noch eine Menge Fehler welche ausgemerzt werden müssen. Es zeigt lediglich
+      die grobe Anordnung der Elemente.</b><br /><br />";
+?>
+<div id="layout_2col" style="width:100%;margin:0 auto;">
+    <div id="layout_2col_left" style="float:left;width:29%; padding-right:10px;">
+        <img src="media//placeholder_ganttchart.png" alt="GANTT PLACEHOLDER" /><br />
+        NOTE: Redebedarf über Art des Graphen! Mehr interaktiv = javascript oder statisch = jpgraph (nur zum gucken keinerlei interaktion!)<br />
+        <br /><br />
+            PercentValue kann (und wird) durch eine progress bar ersetzt. Just Eye Candy, aber für die gefuehlte
+            useability und die Akzeptanz unerlässlich.
+   
+        <div style="border: solid 1px black;margin-top:10%;">
+        <div style="background-color: white; height:250px;">
+        </div>
+        </div>
+    </div>
+    <div id="layout_2col_right" style="float:right;width:70%;">
+        <?php
+        $provider          = new SprintDataProvider();
+        $attributeProvider = new SprintAttributeProvider();
+        
+        $table = new Table();
 
-$provider = new SprintDataProvider();
+        $provider->FillTestData();
 
-$table = new Table();
+        $table->SetDataProvider($provider);
+        $table->SetAttributeProvider($attributeProvider);
+        $table->SetTableRenderer(new FusionForgeTableRenderer());
 
-$provider->FillTestData();
+        $table->RenderTable();
+        ?>
+    </div>
+    <div id="layout_2col_footer" style="clear:both;">
 
-$table->SetDataProvider($provider);
-$table->SetTableRenderer(new FusionForgeTableRenderer());
-
-$table->RenderTable();
-
+    </div>
+</div>
+<?php
 $HTML->footer(array());
 ?>



More information about the evolvis-commits mailing list