From: Joe Hunt Date: Fri, 21 Nov 2008 10:43:35 +0000 (+0000) Subject: Preparing for Graphic Links instead of Text Links (user display option, default) X-Git-Tag: v2.4.2~19^2~1733 X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=e33b5bd92cdff724ad4f561a6fdd8fa6246cdbac Preparing for Graphic Links instead of Text Links (user display option, default) (new field in 0_users, graphic_links) --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 145869d2..2cac1a7f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,7 +2,7 @@ * @version $Id$ * @package FrontAccounting * @copyright (C) 2005 - 2008 FrontAccounting -* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL +* @license http://www.gnu.org/copyleft/agpl-3.0.html GNU/AGPL * FrontAccounting is Free Software */ @@ -19,6 +19,23 @@ Legend: ! -> Note $ -> Affected files +21-Nov-2008 Joe Hunt ++ Preparing for Graphic Links instead of Text Links (user display option, default) + (new field in 0_users, graphic_links) +$ config.php + /admin/display_prefs.php + /admin/db/users_db.inc + /includes/current_user.inc + /includes/prefs/userprefs.inc + /includes/ui/ui_controls.inc + /sql/alter2.1.sql + /themes/default/images/add.png, credit.gif, delete.gif, download.gif, edit.gif, gl.png, + invoice.gif, money.png, pdf.gif, print.png, remove.png, report.png, view.gif + /themes/aqua/images/add.png, credit.gif, delete.gif, download.gif, edit.gif, gl.png, + invoice.gif, money.png, pdf.gif, print.png, remove.png, report.png, view.gif + /themes/cool/images/add.png, credit.gif, delete.gif, download.gif, edit.gif, gl.png, + invoice.gif, money.png, pdf.gif, print.png, remove.png, report.png, view.gif + 20-Nov-2008 Joe Hunt + Added new AGPL license file $ /doc/license.txt (new file) @@ -3045,5 +3062,5 @@ $ /admin/gl_setup.php 2. Copyright and disclaimer --------------------------- -This application is opensource software released under the GPL. Please +This application is opensource software released under the AGPL. Please see source code and the LICENSE file \ No newline at end of file diff --git a/admin/db/users_db.inc b/admin/db/users_db.inc index 8515a9bd..876f183f 100644 --- a/admin/db/users_db.inc +++ b/admin/db/users_db.inc @@ -1,4 +1,14 @@ . +***********************************************************************/ function add_user($user_id, $real_name, $password, $phone, $email, $full_access, $language, $profile, $rep_popup, $pos) @@ -44,7 +54,7 @@ function update_user($user_id, $real_name, $phone, $email, $full_access, function update_user_display_prefs($user_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) + $dec_sep, $theme, $pagesize, $show_hints, $profile, $rep_popup, $query_size, $graphic_links) { $sql = "UPDATE ".TB_PREF."users SET prices_dec=".db_escape($price_dec).", @@ -62,7 +72,8 @@ function update_user_display_prefs($user_id, $price_dec, $qty_dec, $exrate_dec, show_hints=$show_hints, print_profile=".db_escape($profile).", rep_popup=$rep_popup, - query_size=$query_size + query_size=$query_size, + graphic_links=$graphic_links WHERE user_id = ".db_escape($user_id); db_query($sql, "could not update user display prefs for $user_id"); diff --git a/admin/display_prefs.php b/admin/display_prefs.php index 35a1c636..384c0e5b 100644 --- a/admin/display_prefs.php +++ b/admin/display_prefs.php @@ -1,5 +1,14 @@ . +***********************************************************************/ $page_security =10; $path_to_root=".."; include($path_to_root . "/includes/session.inc"); @@ -29,7 +38,7 @@ if (isset($_POST['setprefs'])) $_POST['date_format'], $_POST['date_sep'], $_POST['tho_sep'], $_POST['dec_sep'], $_POST['theme'], $_POST['page_size'], check_value('show_hints'), - $_POST['profile'], check_value('rep_popup'), (int)($_POST['query_size'])); + $_POST['profile'], check_value('rep_popup'), (int)($_POST['query_size']), check_value('graphic_links')); language::set_language($_POST['language']); @@ -98,6 +107,9 @@ print_profiles_list_row(_("Printing profile"). ':', 'profile', check_row(_("Use popup window to display reports:"), 'rep_popup', user_rep_popup(), false, _('Set this option to on if your browser directly supports pdf files')); +check_row(_("Use icons instead of text links:"), 'graphic_links', user_graphic_links(), + false, _('Set this option to on for using icons instead of text links')); + text_row_ex(_("Query page size:"), 'query_size', 5, 5, '', user_query_size()); table_section_title(_("Language")); diff --git a/config.php b/config.php index 331a2931..29d13bc4 100644 --- a/config.php +++ b/config.php @@ -1,15 +1,15 @@ . +***********************************************************************/ + //-------------------------------------------------- // User configurable variables //--------------------------------------------------- @@ -180,4 +180,20 @@ if(isset($_SESSION["wa_current_user"])) { // additional js source included in header $js_lib = $js_userlib = array(); +if (!defined('ICON_EDIT')) +{ + define("ICON_EDIT", "edit.gif"); + define("ICON_DELETE", "delete.gif"); + define("ICON_ADD", "add.png"); + define("ICON_GL", "gl.png"); + define("ICON_PRINT", "print.png"); + define("ICON_PDF", "pdf.gif"); + define("ICON_DOC", "invoice.gif"); + define("ICON_CREDIT", "credit.gif"); + define("ICON_DOWN", "download.gif"); + define("ICON_MONEY", "money.png"); + define("ICON_REMOVE", "remove.png"); + define("ICON_REPORT", "report.png"); + define("ICON_VIEW", "view.gif"); +} ?> \ No newline at end of file diff --git a/gl/manage/gl_quick_entries.php b/gl/manage/gl_quick_entries.php index fd18e11b..10e38ec2 100644 --- a/gl/manage/gl_quick_entries.php +++ b/gl/manage/gl_quick_entries.php @@ -1,5 +1,14 @@ . +***********************************************************************/ $page_security = 3; $path_to_root="../.."; include($path_to_root . "/includes/session.inc"); @@ -159,8 +168,8 @@ while ($myrow = db_fetch($result)) label_cell($myrow['description']); label_cell($deposit_text); label_cell($bank_text); - edit_button_cell("Edit".$myrow["id"], _("Edit")); - edit_button_cell("Delete".$myrow["id"], _("Delete")); + edit_button_cell("Edit".$myrow["id"], _("Edit"), false, ICON_EDIT); + edit_button_cell("Delete".$myrow["id"], _("Delete"), false, ICON_DELETE); end_row(); } @@ -227,8 +236,8 @@ if ($selected_id != -1) label_cell(get_dimension_string($myrow['dimension_id'], true)); if ($dim > 1) label_cell(get_dimension_string($myrow['dimension2_id'], true)); - edit_button_cell("BEd".$myrow["id"], _("Edit")); - edit_button_cell("BDel".$myrow["id"], _("Delete")); + edit_button_cell("BEd".$myrow["id"], _("Edit"), false, ICON_EDIT); + edit_button_cell("BDel".$myrow["id"], _("Delete"), false, ICON_DELETE); end_row(); } end_table(); diff --git a/includes/current_user.inc b/includes/current_user.inc index 4d2d2081..1a9396d3 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -1,5 +1,14 @@ . +***********************************************************************/ include_once($path_to_root . "/includes/prefs/userprefs.inc"); //-------------------------------------------------------------------------- @@ -100,11 +109,11 @@ class 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) { + $theme, $pagesize, $show_hints, $profile, $rep_popup, $query_size, $graphic_links) { update_user_display_prefs($this->username, $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); + $show_hints, $profile, $rep_popup, $query_size, $graphic_links); // re-read the prefs $user = get_user($this->username); @@ -279,14 +288,19 @@ function user_query_size() return $_SESSION["wa_current_user"]->prefs->query_size(); } +function user_graphic_links() +{ + return $_SESSION["wa_current_user"]->prefs->graphic_links(); +} + 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) + $print_profile, $rep_popup, $query_size, $graphic_links) { $_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); + $print_profile, $rep_popup, $query_size, $graphic_links); } function add_user_js_data() { diff --git a/includes/prefs/userprefs.inc b/includes/prefs/userprefs.inc index c24fa01f..8bad1168 100644 --- a/includes/prefs/userprefs.inc +++ b/includes/prefs/userprefs.inc @@ -1,5 +1,14 @@ . +***********************************************************************/ class user_prefs { @@ -23,6 +32,7 @@ class user_prefs var $pagesize; // for printing var $show_hints; var $query_size; // table pager page length + var $graphic_links; // use graphic links function user_prefs(&$user) { @@ -47,6 +57,7 @@ class user_prefs $this->print_profile = $user["print_profile"]; $this->rep_popup = $user["rep_popup"]; $this->query_size = $user["query_size"]; + $this->graphic_links = $user["graphic_links"]; } function language() @@ -146,6 +157,11 @@ class user_prefs return $this->query_size; } + function graphic_links() + { + return $this->graphic_links; + } + function set_dec($price_dec, $qty_dec, $exrate_dec, $percent_dec, $showgl, $showcodes) { $this->price_dec = $price_dec; diff --git a/includes/ui/ui_controls.inc b/includes/ui/ui_controls.inc index 2693b079..fd2fefb3 100644 --- a/includes/ui/ui_controls.inc +++ b/includes/ui/ui_controls.inc @@ -1,5 +1,14 @@ . +***********************************************************************/ //--------------------------------------------------------------------------------- function start_form($multi=false, $sid=false, $action="", $name="") @@ -188,20 +197,28 @@ function delete_link_cell($param, $title=false) .($title ? " title='$title'":'') .">" . _("Delete") . "", "nowrap"); } -function edit_button($name, $value, $title=false) +function edit_button($name, $value, $title=false, $icon=false) { -// php silently changes dots,spaces,'[' and characters 128-159 -// to underscore in POST names, to maintain compatibility with register_globals - echo "'=2E',' '=>'=20','='=>'=3D','['=>'=5B'))) - ."\" value=\"$value\"" - .($title ? " title='$title'":'')." />\n"; + // php silently changes dots,spaces,'[' and characters 128-159 + // to underscore in POST names, to maintain compatibility with register_globals + if (user_graphic_links() && $icon) + { + global $path_to_root; + $name = htmlentities(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B'))); + echo "