+
+function print_profiles_list_row($label, $name, $selected_id=null, $spec_opt=false,
+ $submit_on_change=true)
+{
+ $sql = "SELECT profile FROM ".TB_PREF."print_profiles"
+ ." GROUP BY profile";
+ $result = db_query($sql, 'cannot get all profile names');
+ $profiles = array();
+ while($myrow=db_fetch($result)) {
+ $profiles[$myrow['profile']] = $myrow['profile'];
+ }
+
+ echo "<tr>";
+ if ($label != null)
+ echo "<td>$label</td>\n";
+ echo "<td>";
+
+ array_selector($name, $selected_id, $profiles,
+ array( 'select_submit'=> $submit_on_change,
+ 'spec_option'=>$spec_opt,
+ 'spec_id' => ''
+ ));
+
+ echo "</td></tr>\n";
+}
+
+function printers_list($name, $selected_id=null, $spec_opt=false, $submit_on_change=false)
+{
+ static $printers; // query only once for page display
+
+ if (!$printers) {
+ $sql = "SELECT id, name, description FROM ".TB_PREF."printers";
+ $result = db_query($sql, 'cannot get all printers');
+ $printers = array();
+ while($myrow=db_fetch($result)) {
+ $printers[$myrow['id']] = $myrow['name'].' - '.$myrow['description'];
+ }
+ }
+ array_selector($name, $selected_id, $printers,
+ array( 'select_submit'=> $submit_on_change,
+ 'spec_option'=>$spec_opt,
+ 'spec_id' => ''
+ ));
+}
+
+//------------------------------------------------------------------------------------------------
+
+function quick_entries_list($name, $selected_id=null, $type=null, $submit_on_change=false)
+{
+ $where = false;
+ $sql = "SELECT id, description FROM ".TB_PREF."quick_entries";
+ if ($type != null)
+ $sql .= " WHERE type=$type";
+
+ combo_input($name, $selected_id, $sql, 'id', 'description',
+ array(
+ 'spec_id' => '',
+ 'order' => 'description',
+ 'select_submit'=> $submit_on_change,
+ 'async' => false
+ ) );
+
+}
+
+function quick_entries_list_cells($label, $name, $selected_id=null, $type, $submit_on_change=false)
+{
+ echo "<td>$label</td><td>\n";
+ quick_entries_list($name, $selected_id, $type, $submit_on_change);
+ echo "</td>";
+}
+
+function quick_entries_list_row($label, $name, $selected_id=null, $type, $submit_on_change=false)
+{
+ echo "<tr>\n";
+ quick_entries_list_cells($label, $name, $selected_id, $type, $submit_on_change);
+ echo "</tr>\n";
+}
+
+
+function quick_actions_list_row($label, $name, $selected_id=null, $submit_on_change=false)
+{
+ global $quick_actions;
+
+ echo "<tr><td>$label</td><td>";
+ array_selector($name, $selected_id, $quick_actions,
+ array(
+ 'select_submit'=> $submit_on_change
+ ) );
+ echo "</td></tr>\n";
+}
+
+function quick_entry_types_list_row($label, $name, $selected_id=null, $submit_on_change=false)
+{
+ global $quick_entry_types;
+
+ echo "<tr><td>$label</td><td>";
+ array_selector($name, $selected_id, $quick_entry_types,
+ array(
+ 'select_submit'=> $submit_on_change
+ ) );
+ echo "</td></tr>\n";
+}
+
+function record_status_list_row($label, $name) {
+ return yesno_list_row($label, $name, null, _('Inactive'), _('Active'));
+}
+
+function class_types_list_row($label, $name, $selected_id=null, $submit_on_change=false)
+{
+ global $class_types;
+
+ echo "<tr><td>$label</td><td>";
+ array_selector($name, $selected_id, $class_types,
+ array(
+ 'select_submit'=> $submit_on_change
+ ) );
+ 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";
+}
+
+//---------------------------------------------------------------------------------------------
+// List of sets of active extensions
+//
+function extset_list($name, $value=null, $submit_on_change=false)
+{
+ global $db_connections;
+
+ $items = array();
+ foreach ($db_connections as $comp)
+ $items[] = sprintf(_("Activated for '%s'"), $comp['name']);
+ array_selector( $name, $value, $items,
+ array(
+ 'spec_option'=> _("Installed on system"),
+ 'spec_id' => -1,
+ 'select_submit'=> $submit_on_change,
+ 'async' => true
+ ));
+}
+