r474: Updating custom fields to work with the <div> system
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 2 Oct 2005 18:58:24 +0000 (18:58 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 2 Oct 2005 18:58:24 +0000 (18:58 +0000)
showreport.php
templates/bugfield_input_checkbox.tpl
templates/bugfield_input_text.tpl
templates/bugfield_select_single.tpl
templates/bugfield_static_text.tpl
templates/customfield_bit.tpl [deleted file]
templates/showreport.tpl

index 1f63d99806b7f84e92eab642a4d06eeaccf39682..a52665e8e3407445e6d20263c1742f562b234e96 100644 (file)
@@ -16,7 +16,6 @@ $fetchtemplates = array(
        'showreport_comment',
        'quicksearch',
        'pcv_select_row',
-       'customfield_bit',
        'bugfield_static_text'
 );
 
@@ -197,31 +196,23 @@ else
 $fields = construct_custom_fields($bug);
 $show['customfields'] = ($fields ? true : false);
 
-$bugsys->debug(count($fields) % 2);
+$bugsys->debug('fields modulo: ' . count($fields) % 2);
 $i = 1;
 foreach ($fields AS $field)
 {
        $bugsys->debug("i = $i");
        if ($i == 1)
        {
-               $left = $field;
+               $customfields['right'] .= $field;
        }
        else if ($i == 2)
        {
-               $right = $field;
-               eval('$customfields .= "' . $template->fetch('customfield_bit') . '";');
+               $customfields['left'] .= $field;
                $i = 0;
        }
        $i++;
 }
 
-if ((count($fields) % 2) != 0)
-{
-       $bugsys->debug('no modulo for you');
-       $right = '';
-       eval('$customfields .= "' . $template->fetch('customfield_bit') . '";');
-}
-
 // ###################################################################
 // other elements
 
index 856f4d635aad3d8b96b9ac5e72817d77a57f0b21..43df667f95f941be9fa955c6e921c76db82ee78b 100644 (file)
@@ -1,4 +1,6 @@
        <!-- custom field$field[fieldid] -->
-       <td class="tlabel">$field[name]</td>
-       <td class="tdata"><input name="<if condition="$show['search']">custom[$field[fieldid]]<else />field$field[fieldid]</if>" type="checkbox" value="1"$selected /></td>
+       <fieldset>
+               <legend>$field[name]</legend>
+               <div class="field"><input name="<if condition="$show['search']">custom[$field[fieldid]]<else />field$field[fieldid]</if>" type="checkbox" value="1"$selected /></div>
+       </fieldset>
        <!-- / custom field$field[fieldid] -->
\ No newline at end of file
index ea4e601d9628c841fc0e66e551d5d28d7d8bd445..c7e6a8b2e6c9d4d556f593eda61ccf9a41a41a6e 100644 (file)
@@ -1,4 +1,6 @@
        <!-- custom field$field[fieldid] -->
-       <td class="tlabel">$field[name]</td>
-       <td class="tdata"><input name="<if condition="$show['search']">custom[$field[fieldid]]<else />field$field[fieldid]</if>" type="text" value="$value" size="35"<if condition="$field['maxlength']">maxlength="$field[maxlength]</if> /></td>
+       <fieldset>
+               <legend>$field[name]</legend>
+               <div class="field"><input name="<if condition="$show['search']">custom[$field[fieldid]]<else />field$field[fieldid]</if>" type="text" value="$value" size="35"<if condition="$field['maxlength']">maxlength="$field[maxlength]</if> /></div>
+       </fieldset>
        <!-- / custom field$field[fieldid] -->
index 4b39074517d9c151ce920758562ee6fecc3b3a18..aec275133fcc50cf8de06aef0cce243fc6a2c44d 100644 (file)
@@ -1,4 +1,6 @@
        <!-- custom field$field[fieldid] -->
-       <td class="tlabel">$field[name]</td>
-       <td class="tdata"><select name="<if condition="$show['search']">custom[$field[fieldid]]<else />field$field[fieldid]</if>">$options</select></td>
+       <fieldset>
+               <legend>$field[name]</legend>
+               <div class="field"><select name="<if condition="$show['search']">custom[$field[fieldid]]<else />field$field[fieldid]</if>">$options</select></div>
+       </fieldset>
        <!-- / custom field$field[fieldid] -->
\ No newline at end of file
index 47aac797d89f8e27c4343d2b4a54f5dd87aa380b..6f88e540e0f7b07978ed6851cacf713bf729f8dc 100644 (file)
@@ -1,4 +1,6 @@
        <!-- custom field$field[fieldid] -->
-       <td class="tlabel">$field[name]</td>
-       <td class="tdata">$field[value]</td>
+       <fieldset>
+               <legend>$field[name]</legend>
+               <div class="field">$field[value]</div>
+       </fieldset>
        <!-- / custom field$field[fieldid] -->
diff --git a/templates/customfield_bit.tpl b/templates/customfield_bit.tpl
deleted file mode 100644 (file)
index 9034c8b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<tr>
-$left
-       
-<if condition="$right">$right<else />  <!-- EMPTY CUSTOM FIELD -->
-       <td class="tlabel" colspan="2">&nbsp;</td>
-       <!-- / EMPTY CUSTOM FIELD --></if>
-</tr>
index f0e9cc18fc8e89f1ac0efcd74de0923eca598019..22a49bec83e45d9b7a7b23708ace1de80aefc422 100644 (file)
@@ -86,7 +86,9 @@ $header
                </div>
                </fieldset>
                <!-- / duplicate -->
-
+               
+               $customfields[left]
+               
        </div>
        <!-- / LEFT COLUMN -->
        
@@ -170,28 +172,13 @@ $header
                </div>
                </fieldset>
                <!-- / dependencies -->
-       
+               
+               $customfields[right]
        </div>
        <!-- / RIGHT COLUMN -->
 </div>
 
 <table width="100%" cellspasing="$stylevar[spacing]" cellpadding="$stylevar[padding]px" border="$stylevar[border]" class="tborder">
-<if condition="$show['customfields']">
-       <!-- spacer -->
-       <tr>
-               <td colspan="4" style="height: 1px"></td>
-       </tr>
-       <!-- / spacer -->
-       
-       $customfields
-</if>
-
-<!-- spacer -->
-<tr>
-       <td colspan="4" style="height: 1px"></td>
-</tr>
-<!-- / spacer -->
-
 <!-- new comment & controls -->
 <tr>
        <td class="tlabel" colspan="<if condition="$show['newreply']">2<else />4</if>" style="vertical-align: top">