Moved tab_list_row to ui_lists.inc and changed the global $tabs to be in types.inc
25-Aug-2009 Joe Hunt
+ Added reference number in report List of Journal Entries.
$ /reporting/rep702.php
+! Changed default startup_up app to be in user preferences. Default 'Sales'.
+ Moved tab_list_row to ui_lists.inc and changed the global $tabs to be in types.inc
+$ config.php
+ /admin/display_prefs.php
+ /admin/inst_module.php
+ /admin/db/users_db.inc
+ /includes/current_user.inc
+ /includes/types.inc
+ /includes/page/header.inc
+ /includes/prefs/userprefs.inc
+ /includes/ui/ui_lists.inc
+ /sql/alter2.2.sql
+ /sql/en_US-demo.sql
+ /sql/en_US-new.sql
+
24-Aug-2009 Janusz Dobrowolski
# Fixed warning displayed before db upgrade.
function update_user_display_prefs($id, $price_dec, $qty_dec, $exrate_dec,
$percent_dec, $showgl, $showcodes, $date_format, $date_sep, $tho_sep,
$dec_sep, $theme, $pagesize, $show_hints, $profile, $rep_popup, $query_size,
- $graphic_links, $lang, $stickydate)
+ $graphic_links, $lang, $stickydate, $startup_tab)
{
$sql = "UPDATE ".TB_PREF."users SET
prices_dec=".db_escape($price_dec).",
query_size=$query_size,
graphic_links=$graphic_links,
language=".db_escape($lang).",
- sticky_doc_date=".db_escape($stickydate)."
+ sticky_doc_date=".db_escape($stickydate).",
+ startup_tab=".db_escape($startup_tab)."
WHERE id = ".db_escape($id);
db_query($sql, "could not update user display prefs for $id");
$_POST['theme'], $_POST['page_size'], check_value('show_hints'),
$_POST['profile'], check_value('rep_popup'),
(int)($_POST['query_size']), check_value('graphic_links'),
- $_POST['language'], check_value('sticky_doc_date'));
+ $_POST['language'], check_value('sticky_doc_date'), $_POST['startup_tab']);
if ($chg_lang)
language::set_language($_POST['language']);
pagesizes_list_row(_("Page Size:"), "page_size", user_pagesize());
+tab_list_row(_("Start-up Tab"), 'startup_tab', user_startup_tab());
+
/* The array $pagesizes is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
include_once($path_to_root . "/modules/installed_modules.php");
include_once($path_to_root . "/includes/ui.inc");
-$tabs = array('orders', 'AP', 'stock', 'manuf', 'proj', 'GL', 'system');
-$names = array(_("Sales"), _("Purchases"), _("Items and Inventory"), _("Manufacturing"),
- _("Dimensions"), _("Banking and General Ledger"), _("Setup"));
-
//---------------------------------------------------------------------------------------------
if (isset($_GET['selected_id']))
//---------------------------------------------------------------------------------------------
-function get_tab_title($tab)
-{
- global $tabs, $names;
- for ($i = 0; $i < count($tabs); $i++)
- {
- if ($tabs[$i] == $tab)
- return $names[$i];
- }
- return "";
-}
-
-function tab_list_row($label, $name, $selected)
-{
- global $tabs, $names;
- echo "<tr>\n";
- if ($label != null)
- echo "<td>$label</td>\n";
- if ($selected == null)
- $selected = (!isset($_POST[$name]) ? "orders" : $_POST[$name]);
- echo "<td><select name='$name'>";
- for ($i = 0; $i < count($tabs); $i++)
- {
- if ($selected == $tabs[$i])
- echo "<option selected value='".$tabs[$i]."'>" . $names[$i]. "</option>\n";
- else
- echo "<option value='".$tabs[$i]."'>" . $names[$i]. "</option>\n";
- }
- echo "</select></td>\n";
- echo "</tr>\n";
-}
-
-//---------------------------------------------------------------------------------------------
-
function check_data()
{
if ($_POST['name'] == "" || $_POST['path'] == "")
function display_modules()
{
- global $table_style, $installed_modules;
+ global $table_style, $installed_modules, $tabs;
echo "
<script language='javascript'>
{
alt_table_row_color($k);
- label_cell(get_tab_title($mods[$i]['tab']));
+ label_cell($tabs[$mods[$i]['tab']]);
label_cell($mods[$i]['name']);
label_cell($mods[$i]['path']);
label_cell($mods[$i]['filename']);
array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,20),
);
- /* default start-up tab (orders/AP/stock/manuf/proj/GL/system) */
- $def_app = "orders";
-
//MySQL Backup and Restore Settings
if(isset($_SESSION["wa_current_user"])) {
function update_prefs($price_dec, $qty_dec, $exrate_dec, $percent_dec,
$showgl, $showcodes, $date_format, $date_sep, $tho_sep, $dec_sep,
$theme, $pagesize, $show_hints, $profile, $rep_popup, $query_size,
- $graphic_links, $lang, $stickydate) {
+ $graphic_links, $lang, $stickydate, $startup_tab) {
update_user_display_prefs($this->user, $price_dec,
$qty_dec, $exrate_dec, $percent_dec, $showgl, $showcodes,
$date_format, $date_sep, $tho_sep, $dec_sep, $theme, $pagesize,
- $show_hints, $profile, $rep_popup, $query_size, $graphic_links, $lang, $stickydate);
+ $show_hints, $profile, $rep_popup, $query_size, $graphic_links, $lang, $stickydate, $startup_tab);
// re-read the prefs
$user = get_user($this->user);
return $_SESSION["wa_current_user"]->prefs->sticky_date();
}
+function user_startup_tab()
+{
+ return $_SESSION["wa_current_user"]->prefs->start_up_tab();
+}
+
function set_user_prefs($price_dec, $qty_dec, $exrate_dec, $percent_dec, $showgl, $showcodes,
$date_format, $date_sep, $tho_sep, $dec_sep, $theme, $pagesize, $show_hints,
- $print_profile, $rep_popup, $query_size, $graphic_links, $lang, $stickydate)
+ $print_profile, $rep_popup, $query_size, $graphic_links, $lang, $stickydate, $startup_tab)
{
$_SESSION["wa_current_user"]->update_prefs($price_dec, $qty_dec, $exrate_dec, $percent_dec, $showgl, $showcodes,
$date_format, $date_sep, $tho_sep, $dec_sep, $theme, $pagesize, $show_hints,
- $print_profile, $rep_popup, $query_size, $graphic_links, $lang, $stickydate);
+ $print_profile, $rep_popup, $query_size, $graphic_links, $lang, $stickydate, $startup_tab);
}
function add_user_js_data() {
elseif (isset($_SESSION["sel_app"]) && $_SESSION["sel_app"] != "")
$sel_app = $_SESSION["sel_app"];
else
- $sel_app = $def_app;
+ $sel_app = user_startup_tab();
$_SESSION["sel_app"] = $sel_app;
if (isset($_SESSION["App"]) && is_object($_SESSION["App"]))
$_SESSION["App"]->selected_application = $sel_app;
var $query_size; // table pager page length
var $graphic_links; // use graphic links
var $sticky_date; // save date on subsequent document entry
+ var $startup_tab; // default start-up menu tab
function user_prefs($user=null)
{
$this->query_size = $user["query_size"];
$this->graphic_links = $user["graphic_links"];
$this->sticky_date = $user["sticky_doc_date"];
+ $this->startup_tab = $user['startup_tab'];
}
}
return $this->sticky_date;
}
+ function start_up_tab()
+ {
+ return $this->startup_tab;
+ }
+
function set_dec($price_dec, $qty_dec, $exrate_dec, $percent_dec, $showgl, $showcodes)
{
$this->price_dec = $price_dec;
return $bank_account_types_array[$index]['ptype'];
}
}
+
+/* Menu tabs */
+$tabs = array('orders'=>_("Sales"), 'AP'=>_("Purchases"), 'stock'=>_("Items and Inventory"), 'manuf'=>_("Manufacturing"),
+ 'proj'=>_("Dimensions"), 'GL'=>_("Banking and General Ledger"), 'system'=>_("Setup"));
+
//----------------------------------------------------------------------------------
include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
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
ALTER TABLE `0_stock_category` ADD COLUMN `dflt_no_sale` tinyint(1) NOT NULL default '0';
ALTER TABLE `0_users` ADD COLUMN `sticky_doc_date` TINYINT(1) DEFAULT '0';
+ALTER TABLE `0_users` ADD COLUMN `startup_tab` VARCHAR(20) NOT NULL default '' AFTER sticky_doc_date;
ALTER TABLE `0_debtors_master` MODIFY COLUMN `name` varchar(100) NOT NULL default '';
`print_profile` varchar(30) NOT NULL default '1',
`rep_popup` tinyint(1) default '1',
`sticky_doc_date` tinyint(1) default '0',
+ `startup_tab` varchar(20) NOT NULL default '',
`inactive` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY (`user_id`)
### Data of table `0_users` ###
-INSERT INTO `0_users` VALUES ('1', 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', '2', '', 'adm@adm.com', 'en_US', '0', '0', '0', '0', 'default', 'Letter', '2', '2', '4', '1', '1', '0', '0', '2009-01-30 09:39:03', '10', '1', '1', '1', '1', '0', '0');
-INSERT INTO `0_users` VALUES ('2', 'demouser', '5f4dcc3b5aa765d61d8327deb882cf99', 'Demo User', '1', '999-999-999', 'demo@demo.nu', 'en_US', '0', '0', '0', '0', 'default', 'Letter', '2', '2', '3', '1', '1', '0', '0', '2008-02-06 19:02:35', '10', '1', '1', '1', '1', '0', '0');
+INSERT INTO `0_users` VALUES ('1', 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', '2', '', 'adm@adm.com', 'en_US', '0', '0', '0', '0', 'default', 'Letter', '2', '2', '4', '1', '1', '0', '0', '2009-01-30 09:39:03', '10', '1', '1', '1', '1', '0', 'orders', '0');
+INSERT INTO `0_users` VALUES ('2', 'demouser', '5f4dcc3b5aa765d61d8327deb882cf99', 'Demo User', '1', '999-999-999', 'demo@demo.nu', 'en_US', '0', '0', '0', '0', 'default', 'Letter', '2', '2', '3', '1', '1', '0', '0', '2008-02-06 19:02:35', '10', '1', '1', '1', '1', '0', 'orders', '0');
### Structure of table `0_voided` ###
`print_profile` varchar(30) NOT NULL default '1',
`rep_popup` tinyint(1) default '1',
`sticky_doc_date` tinyint(1) default '0',
+ `startup_tab` varchar(20) NOT NULL default '',
`inactive` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY (`user_id`)
### Data of table `0_users` ###
-INSERT INTO `0_users` VALUES ('1', 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', '2', '', 'adm@adm.com', 'en_US', '0', '0', '0', '0', 'default', 'Letter', '2', '2', '4', '1', '1', '0', '0', '2008-04-04 12:34:29', '10', '1', '1', '1', '1', '0', '0');
+INSERT INTO `0_users` VALUES ('1', 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', '2', '', 'adm@adm.com', 'en_US', '0', '0', '0', '0', 'default', 'Letter', '2', '2', '4', '1', '1', '0', '0', '2008-04-04 12:34:29', '10', '1', '1', '1', '1', '0', 'orders', '0');
### Structure of table `0_voided` ###