Merging version 2.1 RC to main trunk.
[fa-stable.git] / config.php
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU General Public License, GPL, 
5         as published by the Free Software Foundation, either version 3 
6         of the License, or (at your option) any later version.
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
10     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12     //--------------------------------------------------
13
14         // User configurable variables
15         //---------------------------------------------------
16
17         /*Show debug messages returned from an error on the page.
18         Debugging info level also determined by settings in PHP.ini
19         if $debug=1 show debugging info, dont show if $debug=0 */
20
21 if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_to_root']))
22         die("Restricted access");
23
24         $debug                  = 1;
25         $show_sql               = 0;
26         $go_debug               = 0;
27         $pdf_debug              = 0;
28         // set $sql_trail to 1 only if you want to perform bugtracking sql trail
29         // Warning: this produces huge amount of data in sql_trail table.
30         // Don't forget switch the option off and flush the table manually after 
31         // trail, or your future backup files are overloaded with unneeded data.
32         //
33         $sql_trail              = 0; // save all sql queries in sql_trail
34         $select_trail   = 0; // track also SELECT queries
35         if ($go_debug == 1)
36         {
37                 error_reporting(E_ALL);
38                 ini_set("display_errors", "On");
39         }
40         else
41         {
42                 error_reporting(E_USER_WARNING|E_USER_ERROR|E_USER_NOTICE);
43                 // ini_alter("error_reporting","E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR|E_PARSE");
44                 ini_set("display_errors", "On");
45         }
46         // Main Title
47         $app_title = "FrontAccounting";
48         // application version
49         $version                = "2.1.0 RC";
50
51         // Build for development purposes
52         $build_version  = date("d.m.Y", filemtime("$path_to_root/CHANGELOG.txt"));
53
54         // Powered by
55         $power_by               = "FrontAccounting";
56         $power_url              = "http://frontaccounting.net";
57
58         /* use popup windows for views */
59         $use_popup_windows = 1;
60
61         /* use date picker for all date fields */
62         $use_date_picker = 1;
63
64         /* use Audit Trails in GL */
65         $use_audit_trail = 0;
66
67         /* Integrated base Wiki Help URL or null if not used */
68         //$help_base_url = $path_to_root.'/modules/wiki/index.php?n='._('Help').'.';
69         $help_base_url = null;
70
71         /* per user data/cache directory */
72         $comp_path = $path_to_root.'/company';
73
74         /* allow alpha characters in accounts. 0 = numeric, 1 = alpha numeric, 2 = uppercase alpha numeric */
75         $accounts_alpha = 0;
76
77         /* Date systems. 0 = traditional, 1 = Jalali used by Iran, nabour countries, Afghanistan and some other Central Asian nations,
78         2 = Islamic used by other arabic nations */
79         $date_system = 0;
80
81         /* email stock location if order below reorder-level */
82         $loc_notification = 0;
83
84         /* print_invoice_no. 0 = print reference number, 1 = print invoice number */
85         $print_invoice_no = 0;
86
87         $dateformats    = array("MMDDYYYY", "DDMMYYYY", "YYYYMMDD");
88         $dateseps               = array("/", ".", "-", " ");
89         $thoseps                = array(",", ".", " ");
90         $decseps                = array(".", ",");
91
92         $pagesizes              = array("Letter", "A4"); // default PDF pagesize
93
94         /* Default border and spacing for tables */
95         /* Should be moved to CSS */
96
97         $table_style    = "cellpadding=3 border=1 bordercolor='#8cacbb' style='border-collapse: collapse'";
98         $table_style2   = "cellpadding=3 border=1 bordercolor='#cccccc' style='border-collapse: collapse'";
99
100         /* Accounts Payable */
101         /* System check to see if quantity charged on purchase invoices exceeds the quantity received.
102         If this parameter is checked the proportion by which the purchase invoice is an overcharge
103         referred to before reporting an error */
104
105         $check_qty_charged_vs_del_qty = true;
106
107         /* System check to see if price charged on purchase invoices exceeds the purchase order price.
108         If this parameter is checked the proportion by which the purchase invoice is an overcharge
109         referred to before reporting an error */
110
111         $check_price_charged_vs_order_price = True;
112
113         $config_allocation_settled_allowance = 0.005;
114
115         // Internal configurable variables
116         //-----------------------------------------------------------------------------------
117
118         /* Whether to display the demo login and password or not */
119
120         $allow_demo_mode = false;
121
122         /* for uploaded item pictures */
123         $pic_width              = 80;
124         $pic_height     = 50;
125         $max_image_size = 500;
126
127         /* skin for Business Graphics, 1, 2 or 3 */
128         $graph_skin     = 1;
129
130         /*Security Group definitions - Depending on the AccessLevel of the user defined in the user set up
131         the areas of functionality accessible can be modified.
132         Each AccessLevel is associated with an array containing the security categories that the user is entitled to access
133         Each script has a particular security category associated with it.
134         If the security setting of the page is contained in the security group as determined by the access level then the user will be allowed access.
135         Each page has a $page_security = x; variable
136         This value is compared to contents of the array applicable which is based on the access level of the user.
137         Access authorisation is checked in session.inc. If you wish to add more security groups
138         with then you must add a new SecurityHeading to the security_headings array
139         and a new array of Security categories to the Security Groups _at_the_end_ of the array
140         This mechanism allows more fine grained control of access
141         security_groups is an array of arrays
142         The index is the order in which the array of allowed pages is defined new ones can be defined at will
143         or by changing the numbers in each array the security access can be tailored. These numbers need to read
144         in conjunction with the Page Security index
145         Special case is security level 20 which is reserved for admins of first
146         registered company (site admins). All potentially dangerous for whole FA
147         site operations like installing addon modules require access level 20.
148         */
149
150         $security_headings = array(
151                         _("Inquiries"),
152                         _("Accountant"),
153                         _("System Administrator"),
154         );
155
156         $security_groups = array(
157                         array(1,2),
158                         array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,16),
159                         array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,20),
160         );
161
162         /* default start-up tab (orders/AP/stock/manuf/proj/GL/system) */
163         $def_app = "orders";
164
165         //MySQL Backup and Restore Settings
166
167 if(isset($_SESSION["wa_current_user"])) {
168         define("BACKUP_PATH", $comp_path.'/'.user_company()."/backup/");
169 }
170         // static js files path
171         $js_path = $path_to_root.'/js/';
172         // standard external js scripts included in all files
173         $js_static = array('JsHttpRequest.js', 'behaviour.js', 'utils.js', 'inserts.js');
174         // additional js source included in header
175         $js_lib = $js_userlib = array();
176
177 if (!defined('ICON_EDIT'))
178 {
179         define("ICON_EDIT", "edit.gif");        
180         define("ICON_DELETE", "delete.gif");    
181         define("ICON_ADD", "ok.gif");   
182         define("ICON_UPDATE", "ok.gif");        
183         define("ICON_OK", "ok.gif");    
184         define("ICON_CANCEL", "cancel.png");    
185         define("ICON_GL", "gl.png");    
186         define("ICON_PRINT", "print.png");      
187         define("ICON_PDF", "pdf.gif");  
188         define("ICON_DOC", "invoice.gif");      
189         define("ICON_CREDIT", "credit.gif");    
190         define("ICON_RECEIVE", "receive.gif");  
191         define("ICON_DOWN", "download.gif");    
192         define("ICON_MONEY", "money.png");      
193         define("ICON_REMOVE", "remove.png");    
194         define("ICON_REPORT", "report.png");    
195         define("ICON_VIEW", "view.gif");        
196 }
197 ?>