gforge-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gforge-commits] gforge/www/tracker/include ArtifactTypeHtml.class, 1.17


From: tperdue
Subject: [Gforge-commits] gforge/www/tracker/include ArtifactTypeHtml.class, 1.17, 1.18
Date: Thu, 07 Oct 2004 14:30:55 -0500

Update of /cvsroot/gforge/gforge/www/tracker/include
In directory 
db.perdue.net:/home/tperdue/share/dev.gforge.org/www/tracker/include

Modified Files:
        ArtifactTypeHtml.class 
Log Message:
Massive tracker reorg and cleanup

Index: ArtifactTypeHtml.class
===================================================================
RCS file: /cvsroot/gforge/gforge/www/tracker/include/ArtifactTypeHtml.class,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- ArtifactTypeHtml.class      6 Oct 2004 16:27:13 -0000       1.17
+++ ArtifactTypeHtml.class      7 Oct 2004 19:30:52 -0000       1.18
@@ -13,6 +13,8 @@
 
 
 require_once('common/tracker/ArtifactType.class');
+require_once('common/tracker/ArtifactExtraField.class');
+require_once('common/tracker/ArtifactExtraFieldElement.class');
 
 class ArtifactTypeHtml extends ArtifactType {
 
@@ -43,24 +45,19 @@
                $labels = array();
                $links  = array();
 
-               $labels[] = $Language->getText('group','short_tracker');
-               $links[]  = '/tracker/?group_id='.$group_id;
-
+               $labels[] = $this->getName().': 
'.$Language->getText('tracker_artifacttype','browse');
+               $links[]  = 
'/tracker/?func=browse&group_id='.$group_id.'&atid='. $this->getID();
                $labels[] = 
$Language->getText('tracker_artifacttype','submit_new');
                $links[]  = '/tracker/?func=add&group_id='.$group_id.'&atid='. 
$this->getID();
-               $labels[] = $Language->getText('tracker_artifacttype','browse');
-               $links[]  = 
'/tracker/?func=browse&group_id='.$group_id.'&atid='. $this->getID();
 
                if (session_loggedin()) {
                        $labels[] = 
$Language->getText('tracker_artifacttype','reporting');
                        $links[]  = 
'/tracker/reporting/?group_id='.$group_id.'&atid='. $this->getID();
                }
                $labels[] = $Language->getText('tracker_artifacttype','admin');
-               $links[]  = '/tracker/admin/?group_id='.$group_id;
+               $links[]  = 
'/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID();
 
                echo $HTML->subMenu($labels,$links);
-
-               echo '<h3>'.$Language->getText('tracker', 'pagetitle').': <a 
href="/tracker/?group_id='.$group_id.'&atid='.$this->getID().'">'.$this->getName().'</a></h3><p>';
        }
 
        function footer($params) {
@@ -70,47 +67,74 @@
        function adminHeader($params) {
                global $Language;
                echo $this->header($params);
-               $group_id= $this->Group->getID();
-               echo 
'<strong>'.$Language->getText('tracker_artifacttype','admin_functions').': <a 
href="/tracker/admin/?group_id='.$group_id.'">'.$Language->getText('tracker_artifacttype','add_artifact_types').'</a>';
-               echo ' | <a 
href="/tracker/admin/?group_id='.$group_id.'&atid='. $this->getID() 
.'">'.$Language->getText('tracker_artifacttype','edit_options').': '. 
$this->getName() .'</a></strong>';
+//             $group_id= $this->Group->getID();
+//             echo 
'<strong>'.$Language->getText('tracker_artifacttype','admin_functions').': <a 
href="/tracker/admin/?group_id='.$group_id.'">'.$Language->getText('tracker_artifacttype','add_artifact_types').'</a>';
+//             echo ' | <a 
href="/tracker/admin/?group_id='.$group_id.'&atid='. $this->getID() 
.'">'.$Language->getText('tracker_artifacttype','edit_options').': '. 
$this->getName() .'</a></strong>';
        }
-       /**
-        *      buildPopUpBoxes - presents the pop-up boxes and choices  
-        *      configured by the admin
-        */
-               function buildPopUpBoxes () {
-                       global $Language, $group_id;
-                       $result=$this->getSelectionBoxes(); 
-                       echo "<p>&nbsp;</p>";
-                       $rows=db_numrows($result);
-                       if ($result &&$rows > 0) {
-                               echo '<tr>';
-                               for ($i=0; $i < $rows; $i++) {
-                               $newrow= is_integer($i/2);
-                               echo 
'<td><strong>'.db_result($result,$i,'selection_box_name').'</strong><br \>';
-                               echo 
$this->selectionBox(db_result($result,$i,'id'));
-                               echo '&nbsp;<a 
href="/tracker/admin/?group_id='.$group_id.'&amp;atid='. $this->getID() . 
'&amp;build_box=1">('.$Language->getText('tracker','admin').')</a>';
-                               if (!$newrow) {
-                                       echo '</tr><tr>';
-                               }
+
+       function 
renderExtraFields($selected=array(),$show_100=false,$text_100='none') {
+               $efarr =& $this->getExtraFields();
+               $count=count($efarr);
+               //each two columns, we'll reset this and start a new row
+
+//TODO - add code for "display only" such as mod-limited and detail.php pages
+
+               $col_count=0;
+               for ($i=0; $i<$count; $i++) {
+                       if ($efarr[$i]['field_type'] == 
ARTIFACT_EXTRAFIELDTYPE_SELECT) {
+
+                               echo '
+                                       <td 
width="50%"><strong>'.$efarr[$i]['field_name'].'</strong><br />'.
+                                               
$this->renderSelect($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$show_100,$text_100).'</td>';
+
+
+                       } elseif ($efarr[$i]['field_type'] == 
ARTIFACT_EXTRAFIELDTYPE_CHECKBOX) {
+//TODO
+
+                       } elseif ($efarr[$i]['field_type'] == 
ARTIFACT_EXTRAFIELDTYPE_RADIO) {
+//TODO
+
+                       } elseif ($efarr[$i]['field_type'] == 
ARTIFACT_EXTRAFIELDTYPE_TEXT) {
+//TODO
+
+                       } elseif ($efarr[$i]['field_type'] == 
ARTIFACT_EXTRAFIELDTYPE_TEXTAREA) {
+//TODO
+
+                       } elseif ($efarr[$i]['field_type'] == 
ARTIFACT_EXTRAFIELDTYPE_MULTISELECT) {
+//TODO
+
+                       }
+                       $col_count++;
+                       //we've done two columns - if there are more to do, 
start a new row
+                       if (($col_count == 2) && ($i != $count-1)) {
+                               echo '
+                               </tr>
+                               <tr>';
                        }
                }
        }
+
        /**
-        *      selectionBox - this function builds pop up
+        *      renderSelect - this function builds pop up
         *      box with choices.
         *      
-        *      @param          int     The result set
+        *      @param          int     The ID of this field.
         *      @param          string  The item that should be checked
+        *      @param          string  Whether to show the '100 row'
         *      @param          string  What to call the '100 row'
         *      @return         box and choices 
         */     
-       function selectionBox ($name,$checked='xzxz',$text_100='none') {
+       function renderSelect 
($extra_field_id,$checked='xzxz',$show_100=false,$text_100='none') {
                global $Language;
                if ($text_100 == 'none'){
                        
$text_100=$Language->getText('tracker_artifacttype','none');
                }
-               return html_build_select_box 
($this->getSelectionBoxOptions($name),'extra_fields_choice[]',$checked,true,$text_100);
+               $arr =& $this->getExtraFieldElements($extra_field_id);
+               for ($i=0; $i<count($arr); $i++) {
+                       $keys[$i]=$arr[$i]['element_id'];
+                       $vals[$i]=$arr[$i]['element_name'];
+               }
+               return html_build_select_box_from_arrays 
($keys,$vals,'extra_fields['.$extra_field_id.']',$checked,$show_100,$text_100);
        }
 
        function categoryBox 
($name='category_id',$checked='xzxz',$text_100='none') {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]