@@ -53,25 +53,25 @@ discard block |
||
53 | 53 | if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) |
54 | 54 | || ($action == 'updateedit') ) |
55 | 55 | { |
56 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NAME", GETPOST("nom",'nohtml'),'chaine',0,'',$conf->entity); |
|
57 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ADDRESS", GETPOST("address",'nohtml'),'chaine',0,'',$conf->entity); |
|
58 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_TOWN", GETPOST("town",'nohtml'),'chaine',0,'',$conf->entity); |
|
59 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ZIP", GETPOST("zipcode",'alpha'),'chaine',0,'',$conf->entity); |
|
60 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOST("state_id",'alpha'),'chaine',0,'',$conf->entity); |
|
61 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_REGION", GETPOST("region_code",'alpha'),'chaine',0,'',$conf->entity); |
|
62 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOST('country_id','int'), 'chaine',0,'',$conf->entity); |
|
63 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("tel",'alpha'),'chaine',0,'',$conf->entity); |
|
64 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_FAX", GETPOST("fax",'alpha'),'chaine',0,'',$conf->entity); |
|
65 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_MAIL", GETPOST("mail",'alpha'),'chaine',0,'',$conf->entity); |
|
66 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_WEB", GETPOST("web",'alpha'),'chaine',0,'',$conf->entity); |
|
67 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_CODE", GETPOST("code",'nohtml'),'chaine',0,'',$conf->entity); |
|
68 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NOTE", GETPOST("note",'none'),'chaine',0,'',$conf->entity); |
|
69 | - |
|
70 | - if ($action != 'updateedit' && ! $error) |
|
71 | - { |
|
72 | - header("Location: ".$_SERVER["PHP_SELF"]); |
|
73 | - exit; |
|
74 | - } |
|
56 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NAME", GETPOST("nom",'nohtml'),'chaine',0,'',$conf->entity); |
|
57 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ADDRESS", GETPOST("address",'nohtml'),'chaine',0,'',$conf->entity); |
|
58 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_TOWN", GETPOST("town",'nohtml'),'chaine',0,'',$conf->entity); |
|
59 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ZIP", GETPOST("zipcode",'alpha'),'chaine',0,'',$conf->entity); |
|
60 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOST("state_id",'alpha'),'chaine',0,'',$conf->entity); |
|
61 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_REGION", GETPOST("region_code",'alpha'),'chaine',0,'',$conf->entity); |
|
62 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOST('country_id','int'), 'chaine',0,'',$conf->entity); |
|
63 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("tel",'alpha'),'chaine',0,'',$conf->entity); |
|
64 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_FAX", GETPOST("fax",'alpha'),'chaine',0,'',$conf->entity); |
|
65 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_MAIL", GETPOST("mail",'alpha'),'chaine',0,'',$conf->entity); |
|
66 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_WEB", GETPOST("web",'alpha'),'chaine',0,'',$conf->entity); |
|
67 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_CODE", GETPOST("code",'nohtml'),'chaine',0,'',$conf->entity); |
|
68 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NOTE", GETPOST("note",'none'),'chaine',0,'',$conf->entity); |
|
69 | + |
|
70 | + if ($action != 'updateedit' && ! $error) |
|
71 | + { |
|
72 | + header("Location: ".$_SERVER["PHP_SELF"]); |
|
73 | + exit; |
|
74 | + } |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /* |
@@ -98,155 +98,155 @@ discard block |
||
98 | 98 | |
99 | 99 | if ($action == 'edit' || $action == 'updateedit') |
100 | 100 | { |
101 | - /** |
|
102 | - * Edit parameters |
|
103 | - */ |
|
104 | - print "\n".'<script type="text/javascript" language="javascript">'; |
|
105 | - print '$(document).ready(function () { |
|
101 | + /** |
|
102 | + * Edit parameters |
|
103 | + */ |
|
104 | + print "\n".'<script type="text/javascript" language="javascript">'; |
|
105 | + print '$(document).ready(function () { |
|
106 | 106 | $("#selectcountry_id").change(function() { |
107 | 107 | document.form_index.action.value="updateedit"; |
108 | 108 | document.form_index.submit(); |
109 | 109 | }); |
110 | 110 | });'; |
111 | - print '</script>'."\n"; |
|
111 | + print '</script>'."\n"; |
|
112 | 112 | |
113 | - //print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="form_index">'; |
|
113 | + //print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="form_index">'; |
|
114 | 114 | print '<form method="POST" href="' . BASE_URI . '?controller=admin&method=accountant" name="form_index">'; |
115 | 115 | print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; |
116 | - print '<input type="hidden" name="action" value="update">'; |
|
116 | + print '<input type="hidden" name="action" value="update">'; |
|
117 | 117 | |
118 | - print '<table class="noborder" width="100%">'; |
|
119 | - print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n"; |
|
118 | + print '<table class="noborder" width="100%">'; |
|
119 | + print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n"; |
|
120 | 120 | |
121 | - // Name |
|
122 | - print '<tr class="oddeven"><td class="fieldrequired"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>'; |
|
123 | - print '<input name="nom" id="name" class="minwidth200" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_NAME?$conf->global->MAIN_INFO_ACCOUNTANT_NAME: GETPOST("nom",'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n"; |
|
121 | + // Name |
|
122 | + print '<tr class="oddeven"><td class="fieldrequired"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>'; |
|
123 | + print '<input name="nom" id="name" class="minwidth200" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_NAME?$conf->global->MAIN_INFO_ACCOUNTANT_NAME: GETPOST("nom",'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n"; |
|
124 | 124 | |
125 | - // Address |
|
126 | - print '<tr class="oddeven"><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>'; |
|
127 | - print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS?$conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS: GETPOST("address",'nohtml')) . '</textarea></td></tr>'."\n"; |
|
125 | + // Address |
|
126 | + print '<tr class="oddeven"><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>'; |
|
127 | + print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS?$conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS: GETPOST("address",'nohtml')) . '</textarea></td></tr>'."\n"; |
|
128 | 128 | |
129 | - print '<tr class="oddeven"><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>'; |
|
130 | - print '<input class="minwidth100" name="zipcode" id="zipcode" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_ZIP?$conf->global->MAIN_INFO_ACCOUNTANT_ZIP: GETPOST("zipcode",'alpha')) . '"></td></tr>'."\n"; |
|
129 | + print '<tr class="oddeven"><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>'; |
|
130 | + print '<input class="minwidth100" name="zipcode" id="zipcode" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_ZIP?$conf->global->MAIN_INFO_ACCOUNTANT_ZIP: GETPOST("zipcode",'alpha')) . '"></td></tr>'."\n"; |
|
131 | 131 | |
132 | - print '<tr class="oddeven"><td><label for="town">'.$langs->trans("CompanyTown").'</label></td><td>'; |
|
133 | - print '<input name="town" class="minwidth100" id="town" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_TOWN?$conf->global->MAIN_INFO_ACCOUNTANT_TOWN: GETPOST("town",'nohtml')) . '"></td></tr>'."\n"; |
|
132 | + print '<tr class="oddeven"><td><label for="town">'.$langs->trans("CompanyTown").'</label></td><td>'; |
|
133 | + print '<input name="town" class="minwidth100" id="town" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_TOWN?$conf->global->MAIN_INFO_ACCOUNTANT_TOWN: GETPOST("town",'nohtml')) . '"></td></tr>'."\n"; |
|
134 | 134 | |
135 | - // Country |
|
136 | - print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">'; |
|
137 | - //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization |
|
138 | - print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id'); |
|
139 | - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); |
|
140 | - print '</td></tr>'."\n"; |
|
135 | + // Country |
|
136 | + print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">'; |
|
137 | + //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization |
|
138 | + print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id'); |
|
139 | + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); |
|
140 | + print '</td></tr>'."\n"; |
|
141 | 141 | |
142 | - print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">'; |
|
143 | - $formcompany->select_departement($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'state_id'); |
|
144 | - print '</td></tr>'."\n"; |
|
142 | + print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">'; |
|
143 | + $formcompany->select_departement($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'state_id'); |
|
144 | + print '</td></tr>'."\n"; |
|
145 | 145 | |
146 | - print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>'; |
|
147 | - print '<input name="tel" id="phone" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_PHONE . '"></td></tr>'; |
|
148 | - print '</td></tr>'."\n"; |
|
146 | + print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>'; |
|
147 | + print '<input name="tel" id="phone" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_PHONE . '"></td></tr>'; |
|
148 | + print '</td></tr>'."\n"; |
|
149 | 149 | |
150 | - print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>'; |
|
151 | - print '<input name="fax" id="fax" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_FAX . '"></td></tr>'; |
|
152 | - print '</td></tr>'."\n"; |
|
150 | + print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>'; |
|
151 | + print '<input name="fax" id="fax" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_FAX . '"></td></tr>'; |
|
152 | + print '</td></tr>'."\n"; |
|
153 | 153 | |
154 | - print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>'; |
|
155 | - print '<input name="mail" id="email" class="minwidth200" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_MAIL . '"></td></tr>'; |
|
156 | - print '</td></tr>'."\n"; |
|
154 | + print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>'; |
|
155 | + print '<input name="mail" id="email" class="minwidth200" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_MAIL . '"></td></tr>'; |
|
156 | + print '</td></tr>'."\n"; |
|
157 | 157 | |
158 | - // Web |
|
159 | - print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>'; |
|
160 | - print '<input name="web" id="web" class="minwidth300" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_WEB . '"></td></tr>'; |
|
161 | - print '</td></tr>'."\n"; |
|
158 | + // Web |
|
159 | + print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>'; |
|
160 | + print '<input name="web" id="web" class="minwidth300" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_WEB . '"></td></tr>'; |
|
161 | + print '</td></tr>'."\n"; |
|
162 | 162 | |
163 | - // Code |
|
164 | - print '<tr class="oddeven"><td><label for="code">'.$langs->trans("AccountantFileNumber").'</label></td><td>'; |
|
165 | - print '<input name="code" id="code" class="minwidth100" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_CODE?$conf->global->MAIN_INFO_ACCOUNTANT_CODE: GETPOST("code",'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n"; |
|
163 | + // Code |
|
164 | + print '<tr class="oddeven"><td><label for="code">'.$langs->trans("AccountantFileNumber").'</label></td><td>'; |
|
165 | + print '<input name="code" id="code" class="minwidth100" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_CODE?$conf->global->MAIN_INFO_ACCOUNTANT_CODE: GETPOST("code",'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n"; |
|
166 | 166 | |
167 | - // Note |
|
168 | - print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>'; |
|
169 | - print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOST('note','none') ? GETPOST('note','none') : $conf->global->MAIN_INFO_ACCOUNTANT_NOTE).'</textarea></td></tr>'; |
|
170 | - print '</td></tr>'; |
|
167 | + // Note |
|
168 | + print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>'; |
|
169 | + print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOST('note','none') ? GETPOST('note','none') : $conf->global->MAIN_INFO_ACCOUNTANT_NOTE).'</textarea></td></tr>'; |
|
170 | + print '</td></tr>'; |
|
171 | 171 | |
172 | - print '</table>'; |
|
172 | + print '</table>'; |
|
173 | 173 | |
174 | - print '<br><div class="center">'; |
|
175 | - print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; |
|
176 | - print ' '; |
|
177 | - print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
178 | - print '</div>'; |
|
179 | - print '<br>'; |
|
174 | + print '<br><div class="center">'; |
|
175 | + print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; |
|
176 | + print ' '; |
|
177 | + print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
178 | + print '</div>'; |
|
179 | + print '<br>'; |
|
180 | 180 | |
181 | - print '</form>'; |
|
181 | + print '</form>'; |
|
182 | 182 | } |
183 | 183 | else |
184 | 184 | { |
185 | - /* |
|
185 | + /* |
|
186 | 186 | * Show parameters |
187 | 187 | */ |
188 | 188 | |
189 | - // Actions buttons |
|
190 | - //print '<div class="tabsAction">'; |
|
191 | - //print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>'; |
|
192 | - //print '</div><br>'; |
|
189 | + // Actions buttons |
|
190 | + //print '<div class="tabsAction">'; |
|
191 | + //print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>'; |
|
192 | + //print '</div><br>'; |
|
193 | 193 | |
194 | - print '<div class="div-table-responsive-no-min">'; |
|
195 | - print '<table class="noborder" width="100%">'; |
|
196 | - print '<tr class="liste_titre"><td>'.$langs->trans("CompanyInfo").'</td><td>'.$langs->trans("Value").'</td></tr>'; |
|
194 | + print '<div class="div-table-responsive-no-min">'; |
|
195 | + print '<table class="noborder" width="100%">'; |
|
196 | + print '<tr class="liste_titre"><td>'.$langs->trans("CompanyInfo").'</td><td>'.$langs->trans("Value").'</td></tr>'; |
|
197 | 197 | |
198 | 198 | |
199 | - print '<tr class="oddeven"><td class="titlefield wordbreak">'.$langs->trans("CompanyName").'</td><td>'; |
|
200 | - print $conf->global->MAIN_INFO_ACCOUNTANT_NAME; |
|
201 | - print '</td></tr>'; |
|
199 | + print '<tr class="oddeven"><td class="titlefield wordbreak">'.$langs->trans("CompanyName").'</td><td>'; |
|
200 | + print $conf->global->MAIN_INFO_ACCOUNTANT_NAME; |
|
201 | + print '</td></tr>'; |
|
202 | 202 | |
203 | 203 | |
204 | - print '<tr class="oddeven"><td>'.$langs->trans("CompanyAddress").'</td><td>' . nl2br(empty($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS) . '</td></tr>'; |
|
204 | + print '<tr class="oddeven"><td>'.$langs->trans("CompanyAddress").'</td><td>' . nl2br(empty($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS) . '</td></tr>'; |
|
205 | 205 | |
206 | 206 | |
207 | - print '<tr class="oddeven"><td>'.$langs->trans("CompanyZip").'</td><td>' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_ZIP)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ZIP) . '</td></tr>'; |
|
207 | + print '<tr class="oddeven"><td>'.$langs->trans("CompanyZip").'</td><td>' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_ZIP)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ZIP) . '</td></tr>'; |
|
208 | 208 | |
209 | 209 | |
210 | - print '<tr class="oddeven"><td>'.$langs->trans("CompanyTown").'</td><td>' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_TOWN)?'':$conf->global->MAIN_INFO_ACCOUNTANT_TOWN) . '</td></tr>'; |
|
210 | + print '<tr class="oddeven"><td>'.$langs->trans("CompanyTown").'</td><td>' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_TOWN)?'':$conf->global->MAIN_INFO_ACCOUNTANT_TOWN) . '</td></tr>'; |
|
211 | 211 | |
212 | 212 | |
213 | - print '<tr class="oddeven"><td>'.$langs->trans("CompanyCountry").'</td><td>'; |
|
214 | - if (! empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY)) |
|
215 | - { |
|
216 | - $code = getCountry($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 2); |
|
217 | - $img=picto_from_langcode($code); |
|
218 | - print $img?$img.' ':''; |
|
219 | - print getCountry($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY,1); |
|
220 | - } |
|
221 | - print '</td></tr>'; |
|
213 | + print '<tr class="oddeven"><td>'.$langs->trans("CompanyCountry").'</td><td>'; |
|
214 | + if (! empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY)) |
|
215 | + { |
|
216 | + $code = getCountry($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 2); |
|
217 | + $img=picto_from_langcode($code); |
|
218 | + print $img?$img.' ':''; |
|
219 | + print getCountry($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY,1); |
|
220 | + } |
|
221 | + print '</td></tr>'; |
|
222 | 222 | |
223 | 223 | |
224 | - if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print '<tr class="oddeven"><td>'.$langs->trans("Region-State").'</td><td>'; |
|
225 | - else print '<tr class="oddeven"><td>'.$langs->trans("State").'</td><td>'; |
|
226 | - if (! empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE)) print getState($conf->global->MAIN_INFO_ACCOUNTANT_STATE,$conf->global->MAIN_SHOW_STATE_CODE,0,$conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT); |
|
227 | - else print ' '; |
|
228 | - print '</td></tr>'; |
|
224 | + if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print '<tr class="oddeven"><td>'.$langs->trans("Region-State").'</td><td>'; |
|
225 | + else print '<tr class="oddeven"><td>'.$langs->trans("State").'</td><td>'; |
|
226 | + if (! empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE)) print getState($conf->global->MAIN_INFO_ACCOUNTANT_STATE,$conf->global->MAIN_SHOW_STATE_CODE,0,$conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT); |
|
227 | + else print ' '; |
|
228 | + print '</td></tr>'; |
|
229 | 229 | |
230 | - print '<tr class="oddeven"><td>'.$langs->trans("Phone").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_PHONE,$mysoc->country_code) . '</td></tr>'; |
|
230 | + print '<tr class="oddeven"><td>'.$langs->trans("Phone").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_PHONE,$mysoc->country_code) . '</td></tr>'; |
|
231 | 231 | |
232 | - print '<tr class="oddeven"><td>'.$langs->trans("Fax").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_FAX,$mysoc->country_code) . '</td></tr>'; |
|
232 | + print '<tr class="oddeven"><td>'.$langs->trans("Fax").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_FAX,$mysoc->country_code) . '</td></tr>'; |
|
233 | 233 | |
234 | - print '<tr class="oddeven"><td>'.$langs->trans("Mail").'</td><td>' . dol_print_email($conf->global->MAIN_INFO_ACCOUNTANT_MAIL,0,0,0,80) . '</td></tr>'; |
|
234 | + print '<tr class="oddeven"><td>'.$langs->trans("Mail").'</td><td>' . dol_print_email($conf->global->MAIN_INFO_ACCOUNTANT_MAIL,0,0,0,80) . '</td></tr>'; |
|
235 | 235 | |
236 | - print '<tr class="oddeven"><td>'.$langs->trans("Web").'</td><td>' . dol_print_url($conf->global->MAIN_INFO_ACCOUNTANT_WEB,'_blank',80) . '</td></tr>'; |
|
236 | + print '<tr class="oddeven"><td>'.$langs->trans("Web").'</td><td>' . dol_print_url($conf->global->MAIN_INFO_ACCOUNTANT_WEB,'_blank',80) . '</td></tr>'; |
|
237 | 237 | |
238 | - print '<tr class="oddeven"><td>'.$langs->trans("AccountantFileNumber").'</td><td>' . $conf->global->MAIN_INFO_ACCOUNTANT_CODE . '</td></tr>'; |
|
238 | + print '<tr class="oddeven"><td>'.$langs->trans("AccountantFileNumber").'</td><td>' . $conf->global->MAIN_INFO_ACCOUNTANT_CODE . '</td></tr>'; |
|
239 | 239 | |
240 | - print '<tr class="oddeven"><td class="tdtop">'.$langs->trans("Note").'</td><td>' . (! empty($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) ? nl2br($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) : '') . '</td></tr>'; |
|
240 | + print '<tr class="oddeven"><td class="tdtop">'.$langs->trans("Note").'</td><td>' . (! empty($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) ? nl2br($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) : '') . '</td></tr>'; |
|
241 | 241 | |
242 | - print '</table>'; |
|
243 | - print "</div>"; |
|
242 | + print '</table>'; |
|
243 | + print "</div>"; |
|
244 | 244 | |
245 | - print '</form>'; |
|
245 | + print '</form>'; |
|
246 | 246 | |
247 | - // Actions buttons |
|
248 | - print '<div class="tabsAction">'; |
|
249 | - // print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a></div>'; |
|
247 | + // Actions buttons |
|
248 | + print '<div class="tabsAction">'; |
|
249 | + // print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a></div>'; |
|
250 | 250 | print '<div class="inline-block divButAction"><a class="butAction" href="' . BASE_URI . '?controller=admin&method=accountant&action=edit">' . $langs->trans("Modify") . '</a></div>'; |
251 | 251 | print '</div>'; |
252 | 252 | } |
@@ -69,47 +69,47 @@ discard block |
||
69 | 69 | $this->hidden = ! ($user->rights->projet->lire); |
70 | 70 | } |
71 | 71 | |
72 | - /** |
|
73 | - * Load data for box to show them later |
|
74 | - * |
|
75 | - * @param int $max Maximum number of records to load |
|
76 | - * @return void |
|
77 | - */ |
|
78 | - function loadBox($max=5) |
|
79 | - { |
|
80 | - global $conf, $user, $langs, $db; |
|
81 | - |
|
82 | - $this->max=$max; |
|
83 | - |
|
84 | - $totalMnt = 0; |
|
85 | - $totalnb = 0; |
|
86 | - $totalDuree=0; |
|
87 | - $totalplannedtot=0; |
|
88 | - $totaldurationtot=0; |
|
72 | + /** |
|
73 | + * Load data for box to show them later |
|
74 | + * |
|
75 | + * @param int $max Maximum number of records to load |
|
76 | + * @return void |
|
77 | + */ |
|
78 | + function loadBox($max=5) |
|
79 | + { |
|
80 | + global $conf, $user, $langs, $db; |
|
81 | + |
|
82 | + $this->max=$max; |
|
83 | + |
|
84 | + $totalMnt = 0; |
|
85 | + $totalnb = 0; |
|
86 | + $totalDuree=0; |
|
87 | + $totalplannedtot=0; |
|
88 | + $totaldurationtot=0; |
|
89 | 89 | |
90 | - include_once DOL_DOCUMENT_ROOT."/projet/class/task.class.php"; |
|
91 | - $taskstatic=new Task($db); |
|
92 | - |
|
93 | - |
|
94 | - $textHead = $langs->trans("Tasks")." ".date("Y"); |
|
95 | - $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); |
|
96 | - |
|
97 | - // list the summary of the orders |
|
98 | - if ($user->rights->projet->lire) { |
|
99 | - // FIXME fk_statut on a task is not be used. We use the percent. This means this box is useless. |
|
100 | - $sql = "SELECT pt.fk_statut, count(DISTINCT pt.rowid) as nb, sum(ptt.task_duration) as durationtot, sum(pt.planned_workload) as plannedtot"; |
|
101 | - $sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet_task_time as ptt"; |
|
102 | - $sql.= " WHERE pt.datec BETWEEN '".$this->db->idate(dol_get_first_day(date("Y"), 1))."' AND '".$this->db->idate(dol_get_last_day(date("Y"), 12))."'"; |
|
103 | - $sql.= " AND pt.rowid = ptt.fk_task"; |
|
104 | - $sql.= " GROUP BY pt.fk_statut "; |
|
105 | - $sql.= " ORDER BY pt.fk_statut DESC"; |
|
106 | - $sql.= $db->plimit($max, 0); |
|
107 | - |
|
108 | - $result = $db->query($sql); |
|
109 | - if ($result) |
|
110 | - { |
|
111 | - $num = $db->num_rows($result); |
|
112 | - $i = 0; |
|
90 | + include_once DOL_DOCUMENT_ROOT."/projet/class/task.class.php"; |
|
91 | + $taskstatic=new Task($db); |
|
92 | + |
|
93 | + |
|
94 | + $textHead = $langs->trans("Tasks")." ".date("Y"); |
|
95 | + $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); |
|
96 | + |
|
97 | + // list the summary of the orders |
|
98 | + if ($user->rights->projet->lire) { |
|
99 | + // FIXME fk_statut on a task is not be used. We use the percent. This means this box is useless. |
|
100 | + $sql = "SELECT pt.fk_statut, count(DISTINCT pt.rowid) as nb, sum(ptt.task_duration) as durationtot, sum(pt.planned_workload) as plannedtot"; |
|
101 | + $sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet_task_time as ptt"; |
|
102 | + $sql.= " WHERE pt.datec BETWEEN '".$this->db->idate(dol_get_first_day(date("Y"), 1))."' AND '".$this->db->idate(dol_get_last_day(date("Y"), 12))."'"; |
|
103 | + $sql.= " AND pt.rowid = ptt.fk_task"; |
|
104 | + $sql.= " GROUP BY pt.fk_statut "; |
|
105 | + $sql.= " ORDER BY pt.fk_statut DESC"; |
|
106 | + $sql.= $db->plimit($max, 0); |
|
107 | + |
|
108 | + $result = $db->query($sql); |
|
109 | + if ($result) |
|
110 | + { |
|
111 | + $num = $db->num_rows($result); |
|
112 | + $i = 0; |
|
113 | 113 | while ($i < $num) |
114 | 114 | { |
115 | 115 | $objp = $db->fetch_object($result); |
@@ -124,39 +124,39 @@ discard block |
||
124 | 124 | //'url' => DOL_URL_ROOT."/projet/tasks/list.php?leftmenu=projects&viewstatut=".$objp->fk_statut, |
125 | 125 | 'url' => BASE_URI . "?controller=projet/tasks&method=list&leftmenu=projects&viewstatut=" . $objp->fk_statut, |
126 | 126 | ); |
127 | - $totalnb += $objp->nb; |
|
128 | - $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5)); |
|
129 | - $totalplannedtot += $objp->plannedtot; |
|
130 | - $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => ConvertSecondToTime($objp->durationtot,'all',25200,5)); |
|
131 | - $totaldurationtot += $objp->durationtot; |
|
132 | - |
|
133 | - $this->info_box_contents[$i][] = array('td' => 'align="right" width="18"', 'text' => $taskstatic->LibStatut($objp->fk_statut,3)); |
|
134 | - |
|
135 | - $i++; |
|
136 | - } |
|
137 | - } |
|
138 | - else dol_print_error($this->db); |
|
139 | - } |
|
140 | - |
|
141 | - |
|
142 | - // Add the sum at the bottom of the boxes |
|
143 | - $this->info_box_contents[$i][] = array('tr' => 'class="liste_total"', 'td' => '', 'text' => $langs->trans("Total")." ".$textHead); |
|
144 | - $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks")); |
|
145 | - $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5)); |
|
146 | - $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5)); |
|
147 | - $this->info_box_contents[$i][] = array('td' => '', 'text' => ""); |
|
148 | - } |
|
149 | - |
|
150 | - /** |
|
151 | - * Method to show box |
|
152 | - * |
|
153 | - * @param array $head Array with properties of box title |
|
154 | - * @param array $contents Array with properties of box lines |
|
155 | - * @param int $nooutput No print, only return string |
|
156 | - * @return string |
|
157 | - */ |
|
158 | - function showBox($head = null, $contents = null, $nooutput=0) |
|
159 | - { |
|
160 | - return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); |
|
161 | - } |
|
127 | + $totalnb += $objp->nb; |
|
128 | + $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5)); |
|
129 | + $totalplannedtot += $objp->plannedtot; |
|
130 | + $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => ConvertSecondToTime($objp->durationtot,'all',25200,5)); |
|
131 | + $totaldurationtot += $objp->durationtot; |
|
132 | + |
|
133 | + $this->info_box_contents[$i][] = array('td' => 'align="right" width="18"', 'text' => $taskstatic->LibStatut($objp->fk_statut,3)); |
|
134 | + |
|
135 | + $i++; |
|
136 | + } |
|
137 | + } |
|
138 | + else dol_print_error($this->db); |
|
139 | + } |
|
140 | + |
|
141 | + |
|
142 | + // Add the sum at the bottom of the boxes |
|
143 | + $this->info_box_contents[$i][] = array('tr' => 'class="liste_total"', 'td' => '', 'text' => $langs->trans("Total")." ".$textHead); |
|
144 | + $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks")); |
|
145 | + $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5)); |
|
146 | + $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5)); |
|
147 | + $this->info_box_contents[$i][] = array('td' => '', 'text' => ""); |
|
148 | + } |
|
149 | + |
|
150 | + /** |
|
151 | + * Method to show box |
|
152 | + * |
|
153 | + * @param array $head Array with properties of box title |
|
154 | + * @param array $contents Array with properties of box lines |
|
155 | + * @param int $nooutput No print, only return string |
|
156 | + * @return string |
|
157 | + */ |
|
158 | + function showBox($head = null, $contents = null, $nooutput=0) |
|
159 | + { |
|
160 | + return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); |
|
161 | + } |
|
162 | 162 | } |
@@ -6000,6 +6000,6 @@ |
||
6000 | 6000 | |
6001 | 6001 | <?php |
6002 | 6002 | if (is_object($db)) |
6003 | - { |
|
6003 | + { |
|
6004 | 6004 | $db->close(); |
6005 | 6005 | } |
@@ -80,14 +80,14 @@ |
||
80 | 80 | */ |
81 | 81 | |
82 | 82 | if (!is_object($form)) |
83 | - { |
|
83 | + { |
|
84 | 84 | $form = new Form($db); |
85 | 85 | } |
86 | 86 | |
87 | 87 | // Title |
88 | 88 | $title = $langs->trans("HomeArea") . ' - Dolibarr ' . DOL_VERSION; |
89 | 89 | if (!empty($conf->global->MAIN_APPLICATION_TITLE)) |
90 | - { |
|
90 | + { |
|
91 | 91 | $title = $langs->trans("HomeArea") . ' - ' . $conf->global->MAIN_APPLICATION_TITLE; |
92 | 92 | } |
93 | 93 |