Fixed many issues in output HTML code according to HTML 4.01 Transitional format.
[fa-stable.git] / includes / ui / ui_lists.inc
index a3b5cf88e7ba7a0d273a754e4bcd7bbba3665445..456f01938aa6e5e5c76162e69a6984327d1713a1 100644 (file)
@@ -214,11 +214,15 @@ $opts = array(            // default options
                        }
                        $cat = $contact_row[$opts['category']];
                        if ($opts['category'] !== false && $cat != $lastcat){
+                               if ($lastcat!==null)
+                                       $selector .= "</optgroup>";
                                $selector .= "<optgroup label='".$cat."'>\n";
                                $lastcat = $cat;
                        }
                        $selector .= "<option $sel $optclass value='$value'>$descr</option>\n";
                }
+               if ($lastcat!==null)
+                       $selector .= "</optgroup>";
                db_free_result($result);
        }
 
@@ -368,7 +372,6 @@ $opts = array(              // default options
 
        if ($first_id!==false) {
                $sel = ($found===$first_id) || ($found===false && ($spec_option===false)) ? "selected='selected'" : '';
-               $selector = sprintf($first_opt, $sel).$selector;
        }
        // Prepend special option.
        if ($spec_option !== false) { // if special option used - add it
@@ -450,6 +453,7 @@ function supplier_list($name, $selected_id=null, $spec_option=false, $submit_on_
            'order' => array('supp_ref'),
                'search_box' => $mode!=0,
                'type' => 1,
+        'search' => array("supp_ref","supp_name","gst_no"),        
                'spec_option' => $spec_option === true ? _("All Suppliers") : $spec_option,
                'spec_id' => $all_items,
                'select_submit'=> $submit_on_change,
@@ -502,6 +506,7 @@ function customer_list($name, $selected_id=null, $spec_option=false, $submit_on_
                'search_box' => $mode!=0,
                'type' => 1,
                'size' => 20,
+        'search' => array("debtor_ref","name","tax_id"),        
                'spec_option' => $spec_option === true ? _("All Customers") : $spec_option,
                'spec_id' => $all_items,
                'select_submit'=> $submit_on_change,
@@ -833,8 +838,11 @@ function sales_items_list($name, $selected_id=null, $all_option=false,
          ), $opts) );
 }
 
-function sales_items_list_cells($label, $name, $selected_id=null, $all_option=false, $submit_on_change=false)
+function sales_items_list_cells($label, $name, $selected_id=null, $all_option=false, $submit_on_change=false, $editkey=false)
 {
+       if ($editkey)
+               set_editor('item', $name, $editkey);
+
        if ($label != null)
                echo "<td>$label</td>\n";
        echo sales_items_list($name, $selected_id, $all_option, $submit_on_change,