See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
include_once($path_to_root . "/includes/banking.inc");
-include_once($path_to_root . "/includes/reserved.inc");
include_once($path_to_root . "/includes/types.inc");
include_once($path_to_root . "/includes/current_user.inc");
$_select_button = "<input %s type='submit' class='combo_select' style='border:0;background:url($path_to_root/themes/"
."%s/images/button_ok.png) no-repeat;%s' aspect='fallback' name='%s' value=' ' title='"._("Select")."'> ";
-$all_items = reserved_words::get_all();
+$all_items = ALL_TEXT;
//----------------------------------------------------------------------------
// Universal sql combo generator
return combo_input($name, $selected_id, $sql, 'supplier_id', 'supp_name',
array(
'format' => '_format_add_curr',
+ 'order' => array('supp_ref'),
'search_box' => $mode!=0,
'type' => 1,
'spec_option' => $spec_option === true ? _("All Suppliers") : $spec_option,
return combo_input($name, $selected_id, $sql, 'debtor_no', 'name',
array(
'format' => '_format_add_curr',
+ 'order' => array('debtor_ref'),
'search_box' => $mode!=0,
'type' => 1,
'size' => 20,
return combo_input($name, $selected_id, $sql, 'branch_code', 'br_name',
array(
'where' => $where,
+ 'order' => array('branch_ref'),
'spec_option' => $spec_option === true ? _('All branches') : $spec_option,
'spec_id' => $all_items,
'select_submit'=> $submit_on_change,
return combo_input($name, $selected_id, $sql, 'id', 'name',
array(
'spec_option' => $none_option,
- 'spec_id' => reserved_words::get_all_numeric(),
+ 'spec_id' => ALL_NUMERIC,
'select_submit'=> $submit_on_change,
'async' => false,
) );
array(
'order' => 'id',
'spec_option' => $none_option,
- 'spec_id' => reserved_words::get_all_numeric(),
+ 'spec_id' => ALL_NUMERIC,
'select_submit'=> $submit_on_change,
'async' => false,
) );
function shippers_list($name, $selected_id=null)
{
$sql = "SELECT shipper_id, shipper_name, inactive FROM ".TB_PREF."shippers";
- combo_input($name, $selected_id, $sql, 'shipper_id', 'shipper_name', array());
+ combo_input($name, $selected_id, $sql, 'shipper_id', 'shipper_name',
+ array('order'=>array('shipper_name')));
}
function shippers_list_cells($label, $name, $selected_id=null)
function sales_persons_list($name, $selected_id=null)
{
$sql = "SELECT salesman_code, salesman_name, inactive FROM ".TB_PREF."salesman";
- combo_input($name, $selected_id, $sql, 'salesman_code', 'salesman_name', array());
+ combo_input($name, $selected_id, $sql, 'salesman_code', 'salesman_name',
+ array('order'=>array('salesman_name')));
}
function sales_persons_list_cells($label, $name, $selected_id=null)
'async' => true,
'spec_option' =>$spec_option,
'spec_id' => -1,
+ 'order'=> array('pos_name')
) );
echo "</td></tr>\n";
$cells=false, $all_option=false, $submit_on_change=false, $all=false)
{
if ($skip_bank_accounts)
- $sql = "SELECT chart.account_code, chart.account_name, type.name, chart.inactive
+ $sql = "SELECT chart.account_code, chart.account_name, type.name, chart.inactive, type.id
FROM (".TB_PREF."chart_master chart,".TB_PREF."chart_types type) "
."LEFT JOIN ".TB_PREF."bank_accounts acc "
."ON chart.account_code=acc.account_code
WHERE acc.account_code IS NULL
AND chart.account_type=type.id";
else
- $sql = "SELECT chart.account_code, chart.account_name, type.name, chart.inactive
+ $sql = "SELECT chart.account_code, chart.account_name, type.name, chart.inactive, type.id
FROM ".TB_PREF."chart_master chart,".TB_PREF."chart_types type
WHERE chart.account_type=type.id";
'format' => '_format_account',
'spec_option' => $all_option===true ? _("Use Item Sales Accounts") : $all_option,
'spec_id' => '',
- 'order' => array('name','account_code'),
+ 'order' => array('type.id','account_code'),
'search_box' => $cells,
'search_submit' => false,
'size' => 12,
function bank_account_types_list($name, $selected_id=null)
{
- $types = bank_account_types::get_all();
+ global $bank_account_types;
- $items = array();
- foreach ($types as $type)
- {
- $items[$type['id']] = $type['name'];
- }
-
- return array_selector($name, $selected_id, $items );
+ return array_selector($name, $selected_id, $bank_account_types);
}
function bank_account_types_list_cells($label, $name, $selected_id=null)
//------------------------------------------------------------------------------------------------
function payment_person_types_list($name, $selected_id=null, $submit_on_change=false)
{
- $types = payment_person_types::get_all();
+ global $payment_person_types;
- $items = array();
- foreach ($types as $type)
- {
- if (payment_person_types::has_items($type['id']))
- {
- if ($type['id'] != payment_person_types::WorkOrder())
- $items[$type['id']] = $type['name'];
- }
- }
-
- return array_selector($name, $selected_id, $items,
+ return array_selector($name, $selected_id, $payment_person_types,
array( 'select_submit'=> $submit_on_change ) );
}
function wo_types_list($name, $selected_id=null)
{
- $types = wo_types::get_all();
-
- $items = array();
- foreach ($types as $type)
- $items[$type['id']] = $type['name'];
+ global $wo_types_array;
- return array_selector($name, $selected_id, $items,
+ return array_selector($name, $selected_id, $wo_types_array,
array( 'select_submit'=> true, 'async' => true ) );
}
echo "</td></tr>\n";
}
-function security_headings_list_row($label, $name, $value=null)
-{
- global $security_headings;
-
- echo "<tr><td>$label</td>\n<td>";
- array_selector( $name, $value, $security_headings );
- echo "</td></tr>\n";
-}
-
function systypes_list_cells($label, $name, $value=null, $submit_on_change=false)
{
global $systypes_array;
return array_selector($name, $selected, $items,
array( 'spec_option' => $no_option,
- 'spec_id' => reserved_words::get_all_numeric()) );
+ 'spec_id' => ALL_NUMERIC) );
}
function number_list_cells($label, $name, $selected, $from, $to, $no_option=false)
echo "</td></tr>\n";
}
+//------------------------------------------------------------------------------------------------
+
+function security_roles_list($name, $selected_id=null, $new_item=false, $submit_on_change=false,
+ $show_inactive = false)
+{
+ global $all_items;
+
+ $sql = "SELECT id, role, inactive FROM ".TB_PREF."security_roles";
+
+return combo_input($name, $selected_id, $sql, 'id', 'description',
+ array(
+ 'spec_option'=>$new_item ? _("New role") : false,
+ 'spec_id' => '',
+ 'select_submit'=> $submit_on_change,
+ 'show_inactive' => $show_inactive
+ ) );
+}
+
+function security_roles_list_cells($label, $name, $selected_id=null, $new_item=false, $submit_on_change=false,
+ $show_inactive = false)
+{
+ if ($label != null)
+ echo "<td>$label</td>\n";
+ echo "<td>";
+ $str = security_roles_list($name, $selected_id, $new_item, $submit_on_change, $show_inactive);
+ echo "</td>\n";
+ return $str;
+}
+
+function security_roles_list_row($label, $name, $selected_id=null, $new_item=false, $submit_on_change=false,
+ $show_inactive = false)
+{
+ echo "<tr>";
+ $str = security_roles_list_cells($label, $name, $selected_id, $new_item, $submit_on_change, $show_inactive);
+ echo "</tr>\n";
+ return $str;
+}
+
+function tab_list_row($label, $name, $selected_id=null)
+{
+ global $tabs;
+ echo "<tr>\n";
+ echo "<td>$label</td><td>\n";
+
+ $items = array();
+
+ array_selector($name, $selected_id, $tabs);
+
+ echo "</td></tr>\n";
+}
+
?>
\ No newline at end of file