X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_lists.inc;h=d2be5fab97aec7eebcf1a62c3218e4d348e14f2a;hb=063c5f22068dbbd6adccacaf5bd0f66b2eda8e4f;hp=cae9efbc5f16a34b74f1827e7f395965d515e3a7;hpb=46c5f7a65a7659a44ae8254c63152074363d3987;p=fa-stable.git
diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc
index cae9efbc..d2be5fab 100644
--- a/includes/ui/ui_lists.inc
+++ b/includes/ui/ui_lists.inc
@@ -417,6 +417,21 @@ function _format_add_curr($row)
'' : (" - " . $row[2]));
}
+function add_edit_combo($type)
+{
+ 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();
+
+ $key = $popup_editors[$type][1];
+ $onclick = "onclick=\"javascript:callEditor($key); return false;\"";
+ $img = "";
+ return "$img";
+}
+
function supplier_list($name, $selected_id=null, $spec_option=false, $submit_on_change=false,
$all=false, $editkey = false)
{
@@ -429,7 +444,7 @@ function supplier_list($name, $selected_id=null, $spec_option=false, $submit_on_
if ($editkey)
set_editor('supplier', $name, $editkey);
- return combo_input($name, $selected_id, $sql, 'supplier_id', 'supp_name',
+ $ret = combo_input($name, $selected_id, $sql, 'supplier_id', 'supp_name',
array(
'format' => '_format_add_curr',
'order' => array('supp_ref'),
@@ -443,6 +458,9 @@ function supplier_list($name, $selected_id=null, $spec_option=false, $submit_on_
_('Select supplier'),
'show_inactive'=>$all
));
+ if ($editkey)
+ $ret .= add_edit_combo('supplier');
+ return $ret;
}
function supplier_list_cells($label, $name, $selected_id=null, $all_option=false,
@@ -477,7 +495,7 @@ function customer_list($name, $selected_id=null, $spec_option=false, $submit_on_
if ($editkey)
set_editor('customer', $name, $editkey);
- return combo_input($name, $selected_id, $sql, 'debtor_no', 'name',
+ $ret = combo_input($name, $selected_id, $sql, 'debtor_no', 'debtor_ref',
array(
'format' => '_format_add_curr',
'order' => array('debtor_ref'),
@@ -492,6 +510,9 @@ function customer_list($name, $selected_id=null, $spec_option=false, $submit_on_
_('Select customer'),
'show_inactive' => $show_inactive
) );
+ if ($editkey)
+ $ret .= add_edit_combo('customer');
+ return $ret;
}
function customer_list_cells($label, $name, $selected_id=null, $all_option=false,
@@ -508,6 +529,8 @@ function customer_list_cells($label, $name, $selected_id=null, $all_option=false
function customer_list_row($label, $name, $selected_id=null, $all_option = false,
$submit_on_change=false, $show_inactive=false, $editkey = false)
{
+ global $path_to_root;
+
echo "
$label | ";
echo customer_list($name, $selected_id, $all_option, $submit_on_change,
$show_inactive, $editkey);
@@ -528,7 +551,7 @@ function customer_branches_list($customer_id, $name, $selected_id=null,
set_editor('branch', $name, $editkey);
$where = $enabled ? array("disable_trans = 0") : array();
- return combo_input($name, $selected_id, $sql, 'branch_code', 'br_name',
+ $ret = combo_input($name, $selected_id, $sql, 'branch_code', 'branch_ref',
array(
'where' => $where,
'order' => array('branch_ref'),
@@ -537,6 +560,11 @@ function customer_branches_list($customer_id, $name, $selected_id=null,
'select_submit'=> $submit_on_change,
'sel_hint' => _('Select customer branch')
) );
+ if ($editkey)
+ {
+ $ret .= add_edit_combo('branch');
+ }
+ return $ret;
}
//------------------------------------------------------------------------------------------------
@@ -681,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);
}
@@ -718,7 +746,7 @@ function stock_items_list($name, $selected_id=null, $all_option=false,
if ($editkey)
set_editor('item', $name, $editkey);
- return combo_input($name, $selected_id, $sql, 'stock_id', 's.description',
+ $ret = combo_input($name, $selected_id, $sql, 'stock_id', 's.description',
array_merge(
array(
'format' => '_format_stock_items',
@@ -732,6 +760,10 @@ function stock_items_list($name, $selected_id=null, $all_option=false,
'category' => 2,
'order' => array('c.description','stock_id')
), $opts) );
+ if ($editkey)
+ $ret .= add_edit_combo('item');
+ return $ret;
+
}
function _format_stock_items($row)
@@ -857,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,
@@ -866,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);
}
//------------------------------------------------------------------------------------
@@ -1835,11 +1867,13 @@ function pagesizes_list_row($label, $name, $value=null)
echo "
\n";
}
-function systypes_list($name, $value=null, $spec_opt=false, $submit_on_change=false)
+function systypes_list($name, $value=null, $spec_opt=false, $submit_on_change=false, $exclude=array())
{
global $systypes_array;
- return array_selector($name, $value, $systypes_array,
+ // emove non-voidable transactions if needed
+ $systypes = array_diff_key($systypes_array, array_flip($exclude));
+ return array_selector($name, $value, $systypes,
array(
'spec_option'=> $spec_opt,
'spec_id' => ALL_NUMERIC,
@@ -1849,19 +1883,19 @@ function systypes_list($name, $value=null, $spec_opt=false, $submit_on_change=fa
);
}
-function systypes_list_cells($label, $name, $value=null, $submit_on_change=false)
+function systypes_list_cells($label, $name, $value=null, $submit_on_change=false, $exclude=array())
{
if ($label != null)
echo "$label | \n";
echo "";
- echo systypes_list($name, $value, false, $submit_on_change);
+ echo systypes_list($name, $value, false, $submit_on_change, $exclude);
echo " | \n";
}
-function systypes_list_row($label, $name, $value=null, $submit_on_change=false)
+function systypes_list_row($label, $name, $value=null, $submit_on_change=false, $exclude=array())
{
echo "$label | ";
- systypes_list_cells(null, $name, $value, $submit_on_change);
+ systypes_list_cells(null, $name, $value, $submit_on_change, $exclude);
echo "
\n";
}
@@ -1877,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,
@@ -2166,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;
@@ -2174,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);
@@ -2325,4 +2353,17 @@ function coa_list_row($label, $name, $value=null)
echo array_selector( $name, $value, $coas );
echo " |
\n";
}
-?>
\ No newline at end of file
+
+function payment_services($name)
+{
+ global $payment_services;
+
+ $services = array_combine(array_keys($payment_services), array_keys($payment_services));
+
+ return array_selector($name, null, $services, array(
+ 'spec_option'=> _("No payment Link"),
+ 'spec_id' => '',
+ ));
+}
+
+?>