From 660c80f4e91d9cae14e97adb6f896ee0a652c460 Mon Sep 17 00:00:00 2001 From: jengo Date: Thu, 12 Oct 2000 17:36:47 +0000 Subject: [PATCH] Working on changing all of the preferecnes to work of a new type of array. I added a column for appname --- addressbook/inc/preferences.inc.php | 2 +- addressbook/index.php | 54 +++++----- addressbook/preferences.php | 4 +- calendar/inc/footer.inc.php | 157 ++++++++++++++-------------- calendar/inc/header.inc.php | 7 ++ calendar/inc/preferences.inc.php | 32 ++++++ calendar/preferences.php | 100 ++++++++++++++++++ preferences/changetheme.php | 12 +-- preferences/settings.php | 132 +++++++---------------- 9 files changed, 287 insertions(+), 213 deletions(-) create mode 100644 calendar/inc/preferences.inc.php create mode 100644 calendar/preferences.php diff --git a/addressbook/inc/preferences.inc.php b/addressbook/inc/preferences.inc.php index 26df85fea6..fdb0b8676e 100644 --- a/addressbook/inc/preferences.inc.php +++ b/addressbook/inc/preferences.inc.php @@ -25,7 +25,7 @@ section_start("Address Book",$img); $pg = $phpgw->link($phpgw_info["server"]["webserver_url"]."/addressbook/preferences.php"); - echo "Select columns to display"; + echo "" . lang("Select columns to display") . ""; section_end(); } diff --git a/addressbook/index.php b/addressbook/index.php index 51939b01eb..913a3144fb 100755 --- a/addressbook/index.php +++ b/addressbook/index.php @@ -75,16 +75,17 @@ $phpgw->db->query("select count(*) from addressbook where $filtermethod"); $phpgw->db->next_record(); } - if($phpgw_info["apps"]["timetrack"]["enabled"]) - $company_sortorder = "c.company_name"; - else - $company_sortorder = "ab_company"; + if ($phpgw_info["apps"]["timetrack"]["enabled"]) { + $company_sortorder = "c.company_name"; + } else { + $company_sortorder = "ab_company"; + } //$phpgw->db->next_record(); - if ($phpgw->db->f(0) > $phpgw_info["user"]["preferences"]["maxmatchs"]) + if ($phpgw->db->f(0) > $phpgw_info["user"]["preferences"]["common"]["maxmatchs"]) echo "
" . lang("showing x - x of x",($start + 1), - ($start + $phpgw_info["user"]["preferences"]["maxmatchs"]),$phpgw->db->f(0)); + ($start + $phpgw_info["user"]["preferences"]["common"]["maxmatchs"]),$phpgw->db->f(0)); else echo "
" . lang("showing x",$phpgw->db->f(0)); ?> @@ -97,34 +98,34 @@ "> '; echo ''; echo $phpgw->nextmatchs->show_sort_order($sort,$company_sortorder,$order,"index.php",lang("Company Name")); echo ''; } - if ( $phpgw_info["user"]["preferences"]["addressbook_view_lastname"] == "True" ) { + if ($phpgw_info["user"]["preferences"]["addressbook"]["lastname"]) { echo ''; } - if ( $phpgw_info["user"]["preferences"]["addressbook_view_firstname"] == "True" ) { + if ($phpgw_info["user"]["preferences"]["addressbook"]["firstname"]) { echo ''; } - if ( $phpgw_info["user"]["preferences"]["addressbook_view_email"] == "True" ) { + if ($phpgw_info["user"]["preferences"]["addressbook"]["email"]) { echo ''; } - if ( $phpgw_info["user"]["preferences"]["addressbook_view_wphone"] == "True" ) { + if ($phpgw_info["user"]["preferences"]["addressbook"]["wphone"]) { echo ''; }; - if ( $phpgw_info["user"]["preferences"]["addressbook_view_lastname"] == 'True' ) { + if ($phpgw_info["user"]["preferences"]["addressbook"]["lastname"]) { echo ''; }; - if ( $phpgw_info["user"]["preferences"]["addressbook_view_firstname"] == 'True' ) { + if ($phpgw_info["user"]["preferences"]["addressbook"]["firstname"]) { echo ''; }; - if ( $phpgw_info["user"]["preferences"]["addressbook_view_email"] == 'True' ) { + if ($phpgw_info["user"]["preferences"]["addressbook"]["email"]) { echo ''; }; - if ( $phpgw_info["user"]["preferences"]["addressbook_view_wphone"] == 'True' ) { + if ($phpgw_info["user"]["preferences"]["addressbook"]["wphone"]) { echo ''; if ($i ==3) { diff --git a/calendar/inc/footer.inc.php b/calendar/inc/footer.inc.php index c38cb0074a..a8260d4e3d 100644 --- a/calendar/inc/footer.inc.php +++ b/calendar/inc/footer.inc.php @@ -16,88 +16,83 @@ exit; } -?> + if (! $phpgw_info["flags"]["nocalendarfooter"]) { + ?> +
+
+ -
-
- -
'; echo ''; echo $phpgw->nextmatchs->show_sort_order($sort,"ab_lastname",$order,"index.php", lang("Last Name")); echo ''; echo ''; echo $phpgw->nextmatchs->show_sort_order($sort,"ab_firstname",$order,"index.php", lang("First Name")); echo ''; echo ''; echo $phpgw->nextmatchs->show_sort_order($sort,"ab_email",$order,"index.php", lang("Email")); echo ''; echo ''; echo $phpgw->nextmatchs->show_sort_order($sort,"ab_wphone",$order,"index.php", @@ -187,48 +188,49 @@ $firstname = $phpgw->db->f("ab_firstname"); $lastname = $phpgw->db->f("ab_lastname"); - $email = $phpgw->db->f("ab_email"); - if($phpgw_info["apps"]["timetrack"]["enabled"]) + $email = $phpgw->db->f("ab_email"); + if ($phpgw_info["apps"]["timetrack"]["enabled"]) { $company = $phpgw->db->f("company_name"); - else + } else { $company = $phpgw->db->f("company"); - $wphone = $phpgw->db->f("ab_wphone"); - $ab_id = $phpgw->db->f("ab_id"); + } + $wphone = $phpgw->db->f("ab_wphone"); + $ab_id = $phpgw->db->f("ab_id"); - if($firstname == "") $firstname = " "; - if($lastname == "") $lastname = " "; - if($email == "") $email = " "; - if($company == "") $company = " "; - if($wphone == "") $wphone = " "; + if ($firstname == "") $firstname = " "; + if ($lastname == "") $lastname = " "; + if ($email == "") $email = " "; + if ($company == "") $company = " "; + if ($wphone == "") $wphone = " "; ?> '; - if ( $phpgw_info["user"]["preferences"]["addressbook_view_company"] == 'True' ) { + if ($phpgw_info["user"]["preferences"]["addressbook"]["company"]) { echo ''; echo ''; echo $company; echo ''; echo ''; echo $lastname; echo ''; echo ''; echo $firstname; echo ''; echo ''; echo '' . $email . ''; echo ''; echo ''; echo $wphone; diff --git a/addressbook/preferences.php b/addressbook/preferences.php index 635eb5b069..5c3638bf14 100644 --- a/addressbook/preferences.php +++ b/addressbook/preferences.php @@ -23,7 +23,7 @@ if (! $totalerrors) { $phpgw->common->preferences_delete("byapp",$phpgw_info["user"]["userid"],"addressbook"); while ($pref = each($ab_selected)) { - $phpgw->common->preferences_add($phpgw_info["user"]["userid"],$pref[0],"addressbook",$pref[1]); + $phpgw->common->preferences_add($phpgw_info["user"]["userid"],$pref[0],"addressbook","addressbook_" . $pref[1]); } Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/index.php")); } @@ -51,7 +51,7 @@ while (list($col, $descr) = each($abc)) { $i++; $j++; echo '' . $descr + . ($phpgw_info["user"]["preferences"]["addressbook"][$col]?" checked":"") . '>' . $descr . '
-
" method="post" name="SelectMonth"> +
+ " method="post" name="SelectMonth"> + + + +
" method="post" name="SelectWeek"> +
- - -
" method="post" name="SelectWeek"> - -
- + + + @@ -128,3 +123,7 @@
+ : + + + : -
-: + - - - - -: - - - - -
+ + \ No newline at end of file diff --git a/calendar/inc/header.inc.php b/calendar/inc/header.inc.php index 623683c665..96edfa19ac 100644 --- a/calendar/inc/header.inc.php +++ b/calendar/inc/header.inc.php @@ -1,3 +1,7 @@ + +
@@ -31,3 +35,6 @@
+ \ No newline at end of file diff --git a/calendar/inc/preferences.inc.php b/calendar/inc/preferences.inc.php new file mode 100644 index 0000000000..8e2e96c567 --- /dev/null +++ b/calendar/inc/preferences.inc.php @@ -0,0 +1,32 @@ +link($phpgw_info["server"]["webserver_url"]."/calendar/preferences.php"); + echo "" . lang("Calendar preferences") . ""; + + section_end(); +} +?> diff --git a/calendar/preferences.php b/calendar/preferences.php new file mode 100644 index 0000000000..b66eb71ac2 --- /dev/null +++ b/calendar/preferences.php @@ -0,0 +1,100 @@ + True, "nonavbar" => True, "currentapp" => "calendar", + "nocalendarheader" => True, "nocalendarfooter" => True); + include("../header.inc.php"); + + if ($submit) { + $phpgw->common->preferences_delete("byapp",$phpgw_info["user"]["userid"],"calendar"); + + $phpgw->common->preferences_add($phpgw_info["user"]["userid"],"weekdaystarts","calendar"); + $phpgw->common->preferences_add($phpgw_info["user"]["userid"],"workdaystarts","calendar"); + $phpgw->common->preferences_add($phpgw_info["user"]["userid"],"workdayends","calendar"); + if ($mainscreen_showevents) { + $phpgw->common->preferences_add($phpgw_info["user"]["userid"],"mainscreen_showevents","calendar"); + } + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/index.php")); + exit; + } + + $phpgw->common->phpgw_header(); + $phpgw->common->navbar(); + + if ($totalerrors) { + echo "

" . $phpgw->common->error_list($errors) . "
"; + } + + echo "

" . lang("Calendar preferences") . ":" . "


"; +?> +

+ + "> + + + nextmatchs->alternate_row_color($tr_color); ?> + + + + + + nextmatchs->alternate_row_color($tr_color); + ?> + + + +nextmatchs->alternate_row_color($tr_color); +?> + + + + + nextmatchs->alternate_row_color($tr_color); + ?> + + + + + +
 
?>
+ +
+ +
+ +
">
+
+ + \ No newline at end of file diff --git a/preferences/changetheme.php b/preferences/changetheme.php index c75a508407..32e65f7afa 100755 --- a/preferences/changetheme.php +++ b/preferences/changetheme.php @@ -12,19 +12,13 @@ /* $Id$ */ - $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True); + $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "preferences"); - $phpgw_info["flags"]["currentapp"] = "preferences"; include("../header.inc.php"); - - if ($phpgw_info["user"]["permissions"]["anonymous"]) { - Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/")); - exit; - } - + if ($ntheme) { $theme = $ntheme; - $phpgw->common->preferences_update($phpgw_info["user"]["userid"],"theme"); + $phpgw->common->preferences_update($phpgw_info["user"]["userid"],"theme","common"); Header("location: " . $phpgw->link("changetheme.php")); exit; } diff --git a/preferences/settings.php b/preferences/settings.php index 7039d34685..533f6a37f9 100755 --- a/preferences/settings.php +++ b/preferences/settings.php @@ -149,81 +149,35 @@ - - ? - > - - - - - - - - - - - - - - - - - - - - - - - - - - + + accounts->read_apps($phpgw_info["user"]["userid"]); + while ($permission = each($db_perms)) { + if ($phpgw_info["apps"][$permission[0]]["enabled"]) { echo ""; - } - } - ?> - + } + } + ?> + + - - + + + $default_order_display[$phpgw_info["user"]["preferences"]["default_sorting"]] = " selected"; ?>