X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_lists.inc;h=d2be5fab97aec7eebcf1a62c3218e4d348e14f2a;hb=5d3fcb9c57e586c20651594edf91a2dccb08df00;hp=1a1e658b17d5c2718fef8d9ce740011b701ce433;hpb=c7863c71d0ea360d7b4d4e923841b7febd629100;p=fa-stable.git diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 1a1e658b..d2be5fab 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -417,33 +417,19 @@ function _format_add_curr($row) '' : (" - " . $row[2])); } -function add_edit_combo($combo_name,$url,$key_param='',$restrict_pages='') +function add_edit_combo($type) { - global $path_to_root, $page_security; + global $path_to_root, $popup_editors, $use_icon_for_editkey; + if (!isset($use_icon_for_editkey) || $use_icon_for_editkey==0) + return ""; // Derive theme path $theme_path = $path_to_root . '/themes/' . user_theme(); - // Check if $url already has other parameters - if ($key_param) { - $key_param = ((strpos($url,'?')) ? '&' : '?') . $key_param; - } - - $href1 = "href='$url${key_param}='"; - $href2 = "href='$url${key_param}'"; - $onclick1 = "onclick=\"javascript:var sel=(document.forms[0].$combo_name.selectedIndex == -1 ? '' : document.forms[0].$combo_name.options[document.forms[0].$combo_name.selectedIndex].value);openWindow(this.href+sel,this.target); return false;\""; - $onclick2 = "onclick=\"javascript:openWindow(this.href,this.target); return false;\""; + $key = $popup_editors[$type][1]; + $onclick = "onclick=\"javascript:callEditor($key); return false;\""; $img = "Add/Edit"; - $return_url = ($key_param) ? - "$img" : - "$img"; - - // Don't pass edit button code If restrict_pages contains instructions but fails security check - if ($restrict_pages && strpos($restrict_pages, $page_security) === false) { - return ''; - } - - return $return_url; + return "$img"; } function supplier_list($name, $selected_id=null, $spec_option=false, $submit_on_change=false, @@ -473,10 +459,7 @@ function supplier_list($name, $selected_id=null, $spec_option=false, $submit_on_ 'show_inactive'=>$all )); if ($editkey) - { - global $path_to_root; - $ret .= add_edit_combo('supplier_id',"$path_to_root/purchasing/manage/suppliers.php?popup=1",'supplier_id'); - } + $ret .= add_edit_combo('supplier'); return $ret; } @@ -528,10 +511,7 @@ function customer_list($name, $selected_id=null, $spec_option=false, $submit_on_ 'show_inactive' => $show_inactive ) ); if ($editkey) - { - global $path_to_root; - $ret .= add_edit_combo('customer_id',"$path_to_root/sales/manage/customers.php?popup=1", "debtor_no"); - } + $ret .= add_edit_combo('customer'); return $ret; } @@ -582,8 +562,7 @@ function customer_branches_list($customer_id, $name, $selected_id=null, ) ); if ($editkey) { - global $path_to_root; - $ret .= add_edit_combo('branch_id',"$path_to_root/sales/manage/customer_branches.php?popup=1",'SelectedBranch'); + $ret .= add_edit_combo('branch'); } return $ret; } @@ -730,7 +709,7 @@ $options = array( if (!$showclosed) $options['where'][] = "closed=0"; if($showtype) - $options['where'][] = "type_=$showtype"; + $options['where'][] = "type_=".db_escape($showtype); return combo_input($name, $selected_id, $sql, 'id', 'ref', $options); } @@ -782,10 +761,7 @@ function stock_items_list($name, $selected_id=null, $all_option=false, 'order' => array('c.description','stock_id') ), $opts) ); if ($editkey) - { - global $path_to_root; - $ret .= add_edit_combo('stock_id',"$path_to_root/inventory/manage/items.php?popup=1",'stock_id'); - } + $ret .= add_edit_combo('item'); return $ret; } @@ -913,7 +889,7 @@ function stock_component_items_list($name, $parent_stock_id, $selected_id=null, $all_option=false, $submit_on_change=false, $editkey = false) { return stock_items_list($name, $selected_id, $all_option, $submit_on_change, - array('where'=>array("stock_id != '$parent_stock_id'")), $editkey); + array('where'=>array("stock_id != ".db_escape($parent_stock_id))), $editkey); } function stock_component_items_list_cells($label, $name, $parent_stock_id, @@ -922,7 +898,7 @@ function stock_component_items_list_cells($label, $name, $parent_stock_id, if ($label != null) echo "$label\n"; echo stock_items_list($name, $selected_id, $all_option, $submit_on_change, - array('where'=>array("stock_id != '$parent_stock_id'"), 'cells'=>true), + array('where'=>array("stock_id != ".db_escape($parent_stock_id)), 'cells'=>true), $editkey); } //------------------------------------------------------------------------------------ @@ -1935,7 +1911,7 @@ function journal_types_list_cells($label, $name, $value=null, $submit_on_change= // exclude quotes, orders and dimensions foreach (array(ST_PURCHORDER, ST_WORKORDER, ST_SALESORDER, ST_DIMENSION, - ST_SALESQUOTE) as $excl) + ST_SALESQUOTE, ST_LOCTRANSFER) as $excl) unset($items[$excl]); echo array_selector($name, $value, $items, @@ -2224,7 +2200,7 @@ function security_roles_list_row($label, $name, $selected_id=null, $new_item=fal echo "\n"; } -function tab_list_row($label, $name, $selected_id=null, $all = false) +function tab_list_row($label, $name, $selected_id=null) { global $installed_extensions; @@ -2232,12 +2208,6 @@ function tab_list_row($label, $name, $selected_id=null, $all = false) foreach ($_SESSION['App']->applications as $app) { $tabs[$app->id] = access_string($app->name, true); } - if ($all) { // add also not active ext. modules - foreach ($installed_extensions as $ext) { - if ($ext['type'] == 'module' && !$ext['active']) - $tabs[$ext['tab']] = access_string($ext['title'], true); - } - } echo "\n"; echo "$label\n"; echo array_selector($name, $selected_id, $tabs);