@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $head = array(); |
48 | 48 | |
49 | 49 | // $head[$h][0] = DOL_URL_ROOT . '/user/card.php?id=' . $object->id; |
50 | - $head[$h][0] = BASE_URI . '?controller=user&method=card&id=' . $object->id; |
|
50 | + $head[$h][0] = BASE_URI.'?controller=user&method=card&id='.$object->id; |
|
51 | 51 | $head[$h][1] = $langs->trans("UserCard"); |
52 | 52 | $head[$h][2] = 'user'; |
53 | 53 | $h++; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | if ((!empty($conf->ldap->enabled) && !empty($conf->global->LDAP_SYNCHRO_ACTIVE)) && (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || !empty($user->admin))) { |
56 | 56 | $langs->load("ldap"); |
57 | 57 | // $head[$h][0] = DOL_URL_ROOT . '/user/ldap.php?id=' . $object->id; |
58 | - $head[$h][0] = BASE_URI . '?controller=user&method=ldap&id=' . $object->id; |
|
58 | + $head[$h][0] = BASE_URI.'?controller=user&method=ldap&id='.$object->id; |
|
59 | 59 | $head[$h][1] = $langs->trans("LDAPCard"); |
60 | 60 | $head[$h][2] = 'ldap'; |
61 | 61 | $h++; |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | |
64 | 64 | if ($canreadperms) { |
65 | 65 | // $head[$h][0] = DOL_URL_ROOT . '/user/perms.php?id=' . $object->id; |
66 | - $head[$h][0] = BASE_URI . '?controller=user&method=perms&id=' . $object->id; |
|
67 | - $head[$h][1] = $langs->trans("Rights") . ' <span class="badge">' . ($object->nb_rights) . '</span>'; |
|
66 | + $head[$h][0] = BASE_URI.'?controller=user&method=perms&id='.$object->id; |
|
67 | + $head[$h][1] = $langs->trans("Rights").' <span class="badge">'.($object->nb_rights).'</span>'; |
|
68 | 68 | $head[$h][2] = 'rights'; |
69 | 69 | $h++; |
70 | 70 | } |
71 | 71 | |
72 | 72 | // $head[$h][0] = DOL_URL_ROOT . '/user/param_ihm.php?id=' . $object->id; |
73 | - $head[$h][0] = BASE_URI . '?controller=user&method=param_ihm&id=' . $object->id; |
|
73 | + $head[$h][0] = BASE_URI.'?controller=user&method=param_ihm&id='.$object->id; |
|
74 | 74 | $head[$h][1] = $langs->trans("UserGUISetup"); |
75 | 75 | $head[$h][2] = 'guisetup'; |
76 | 76 | $h++; |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | $nbagenda = 0; |
86 | 86 | while ($i <= $MAXAGENDA) { |
87 | 87 | $key = $i; |
88 | - $name = 'AGENDA_EXT_NAME_' . $object->id . '_' . $key; |
|
89 | - $src = 'AGENDA_EXT_SRC_' . $object->id . '_' . $key; |
|
90 | - $offsettz = 'AGENDA_EXT_OFFSETTZ_' . $object->id . '_' . $key; |
|
91 | - $color = 'AGENDA_EXT_COLOR_' . $object->id . '_' . $key; |
|
88 | + $name = 'AGENDA_EXT_NAME_'.$object->id.'_'.$key; |
|
89 | + $src = 'AGENDA_EXT_SRC_'.$object->id.'_'.$key; |
|
90 | + $offsettz = 'AGENDA_EXT_OFFSETTZ_'.$object->id.'_'.$key; |
|
91 | + $color = 'AGENDA_EXT_COLOR_'.$object->id.'_'.$key; |
|
92 | 92 | $i++; |
93 | 93 | |
94 | 94 | if (!empty($object->conf->$name)) { |
@@ -97,15 +97,15 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | // $head[$h][0] = DOL_URL_ROOT . '/user/agenda_extsites.php?id=' . $object->id; |
100 | - $head[$h][0] = BASE_URI . '?controller=user&method=agenda_extsites&id=' . $object->id; |
|
101 | - $head[$h][1] = $langs->trans("ExtSites") . ($nbagenda ? ' <span class="badge">' . $nbagenda . '</span>' : ''); |
|
100 | + $head[$h][0] = BASE_URI.'?controller=user&method=agenda_extsites&id='.$object->id; |
|
101 | + $head[$h][1] = $langs->trans("ExtSites").($nbagenda ? ' <span class="badge">'.$nbagenda.'</span>' : ''); |
|
102 | 102 | $head[$h][2] = 'extsites'; |
103 | 103 | $h++; |
104 | 104 | } |
105 | 105 | |
106 | 106 | if (!empty($conf->clicktodial->enabled)) { |
107 | 107 | // $head[$h][0] = DOL_URL_ROOT . '/user/clicktodial.php?id=' . $object->id; |
108 | - $head[$h][0] = BASE_URI . '?controller=user&method=clicktodial&id=' . $object->id; |
|
108 | + $head[$h][0] = BASE_URI.'?controller=user&method=clicktodial&id='.$object->id; |
|
109 | 109 | $head[$h][1] = $langs->trans("ClickToDial"); |
110 | 110 | $head[$h][2] = 'clicktodial'; |
111 | 111 | $h++; |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | if ($user->societe_id == 0 && !empty($conf->notification->enabled)) { |
116 | 116 | $nbNote = 0; |
117 | 117 | $sql = "SELECT COUNT(n.rowid) as nb"; |
118 | - $sql .= " FROM " . MAIN_DB_PREFIX . "notify_def as n"; |
|
119 | - $sql .= " WHERE fk_user = " . $object->id; |
|
118 | + $sql .= " FROM ".MAIN_DB_PREFIX."notify_def as n"; |
|
119 | + $sql .= " WHERE fk_user = ".$object->id; |
|
120 | 120 | $resql = $db->query($sql); |
121 | 121 | if ($resql) { |
122 | 122 | $num = $db->num_rows($resql); |
@@ -131,10 +131,10 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | // $head[$h][0] = DOL_URL_ROOT . '/user/notify/card.php?id=' . $object->id; |
134 | - $head[$h][0] = BASE_URI . '?controller=user/notify&method=card&id=' . $object->id; |
|
134 | + $head[$h][0] = BASE_URI.'?controller=user/notify&method=card&id='.$object->id; |
|
135 | 135 | $head[$h][1] = $langs->trans("Notifications"); |
136 | 136 | if ($nbNote > 0) { |
137 | - $head[$h][1] .= ' <span class="badge">' . $nbNote . '</span>'; |
|
137 | + $head[$h][1] .= ' <span class="badge">'.$nbNote.'</span>'; |
|
138 | 138 | } |
139 | 139 | $head[$h][2] = 'notify'; |
140 | 140 | $h++; |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | // $this->tabs = array('entity:-tabname); to remove a tab |
147 | 147 | complete_head_from_modules($conf, $langs, $object, $head, $h, 'user'); |
148 | 148 | |
149 | - if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) || (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read)) || (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire) && $user->id == $object->id) || (!empty($conf->holiday->enabled) && !empty($user->rights->holiday->read) && $user->id == $object->id ) |
|
149 | + if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) || (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read)) || (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire) && $user->id == $object->id) || (!empty($conf->holiday->enabled) && !empty($user->rights->holiday->read) && $user->id == $object->id) |
|
150 | 150 | ) { |
151 | 151 | // Bank |
152 | 152 | // $head[$h][0] = DOL_URL_ROOT . '/user/bank.php?id=' . $object->id; |
153 | - $head[$h][0] = BASE_URI . '?controller=user&method=bank&id=' . $object->id; |
|
153 | + $head[$h][0] = BASE_URI.'?controller=user&method=bank&id='.$object->id; |
|
154 | 154 | $head[$h][1] = $langs->trans("HRAndBank"); |
155 | 155 | $head[$h][2] = 'bank'; |
156 | 156 | $h++; |
@@ -164,33 +164,33 @@ discard block |
||
164 | 164 | $nbNote++; |
165 | 165 | } |
166 | 166 | // $head[$h][0] = DOL_URL_ROOT . '/user/note.php?id=' . $object->id; |
167 | - $head[$h][0] = BASE_URI . '?controller=user&method=note&id=' . $object->id; |
|
167 | + $head[$h][0] = BASE_URI.'?controller=user&method=note&id='.$object->id; |
|
168 | 168 | $head[$h][1] = $langs->trans("Note"); |
169 | 169 | if ($nbNote > 0) { |
170 | - $head[$h][1] .= ' <span class="badge">' . $nbNote . '</span>'; |
|
170 | + $head[$h][1] .= ' <span class="badge">'.$nbNote.'</span>'; |
|
171 | 171 | } |
172 | 172 | $head[$h][2] = 'note'; |
173 | 173 | $h++; |
174 | 174 | |
175 | 175 | // Attached files |
176 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
177 | - require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; |
|
176 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
177 | + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
|
178 | 178 | |
179 | - $upload_dir = $conf->user->dir_output . "/" . $object->id; |
|
179 | + $upload_dir = $conf->user->dir_output."/".$object->id; |
|
180 | 180 | $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); |
181 | 181 | $nbLinks = Link::count($db, $object->element, $object->id); |
182 | 182 | |
183 | 183 | // $head[$h][0] = DOL_URL_ROOT . '/user/document.php?userid=' . $object->id; |
184 | - $head[$h][0] = BASE_URI . '?controller=user&method=document&userid=' . $object->id; |
|
184 | + $head[$h][0] = BASE_URI.'?controller=user&method=document&userid='.$object->id; |
|
185 | 185 | $head[$h][1] = $langs->trans("Documents"); |
186 | 186 | if (($nbFiles + $nbLinks) > 0) { |
187 | - $head[$h][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>'; |
|
187 | + $head[$h][1] .= ' <span class="badge">'.($nbFiles + $nbLinks).'</span>'; |
|
188 | 188 | } |
189 | 189 | $head[$h][2] = 'document'; |
190 | 190 | $h++; |
191 | 191 | |
192 | 192 | // $head[$h][0] = DOL_URL_ROOT . '/user/info.php?id=' . $object->id; |
193 | - $head[$h][0] = BASE_URI . '?controller=user&method=info&id=' . $object->id; |
|
193 | + $head[$h][0] = BASE_URI.'?controller=user&method=info&id='.$object->id; |
|
194 | 194 | $head[$h][1] = $langs->trans("Info"); |
195 | 195 | $head[$h][2] = 'info'; |
196 | 196 | $h++; |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $head = array(); |
221 | 221 | |
222 | 222 | // $head[$h][0] = DOL_URL_ROOT . '/user/group/card.php?id=' . $object->id; |
223 | - $head[$h][0] = BASE_URI . '?controller=user/group&method=card&id=' . $object->id; |
|
223 | + $head[$h][0] = BASE_URI.'?controller=user/group&method=card&id='.$object->id; |
|
224 | 224 | $head[$h][1] = $langs->trans("GroupCard"); |
225 | 225 | $head[$h][2] = 'group'; |
226 | 226 | $h++; |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | if ((!empty($conf->ldap->enabled) && !empty($conf->global->LDAP_SYNCHRO_ACTIVE)) && (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || !empty($user->admin))) { |
229 | 229 | $langs->load("ldap"); |
230 | 230 | // $head[$h][0] = DOL_URL_ROOT . '/user/group/ldap.php?id=' . $object->id; |
231 | - $head[$h][0] = BASE_URI . '?controller=user/group&method=ldap&id=' . $object->id; |
|
231 | + $head[$h][0] = BASE_URI.'?controller=user/group&method=ldap&id='.$object->id; |
|
232 | 232 | $head[$h][1] = $langs->trans("LDAPCard"); |
233 | 233 | $head[$h][2] = 'ldap'; |
234 | 234 | $h++; |
@@ -236,8 +236,8 @@ discard block |
||
236 | 236 | |
237 | 237 | if ($canreadperms) { |
238 | 238 | // $head[$h][0] = DOL_URL_ROOT . '/user/group/perms.php?id=' . $object->id; |
239 | - $head[$h][0] = BASE_URI . '?controller=user/group&method=perms&id=' . $object->id; |
|
240 | - $head[$h][1] = $langs->trans("GroupRights") . ' <span class="badge">' . ($object->nb_rights) . '</span>'; |
|
239 | + $head[$h][0] = BASE_URI.'?controller=user/group&method=perms&id='.$object->id; |
|
240 | + $head[$h][1] = $langs->trans("GroupRights").' <span class="badge">'.($object->nb_rights).'</span>'; |
|
241 | 241 | $head[$h][2] = 'rights'; |
242 | 242 | $h++; |
243 | 243 | } |
@@ -266,26 +266,26 @@ discard block |
||
266 | 266 | $h = 0; |
267 | 267 | |
268 | 268 | // $head[$h][0] = DOL_URL_ROOT . '/admin/user.php'; |
269 | - $head[$h][0] = BASE_URI . '?controller=admin&method=user'; |
|
269 | + $head[$h][0] = BASE_URI.'?controller=admin&method=user'; |
|
270 | 270 | $head[$h][1] = $langs->trans("Parameters"); |
271 | 271 | $head[$h][2] = 'card'; |
272 | 272 | $h++; |
273 | 273 | |
274 | 274 | // $head[$h][0] = DOL_URL_ROOT . '/admin/usergroup.php'; |
275 | - $head[$h][0] = BASE_URI . '?controller=admin&method=usergroup'; |
|
275 | + $head[$h][0] = BASE_URI.'?controller=admin&method=usergroup'; |
|
276 | 276 | $head[$h][1] = $langs->trans("Group"); |
277 | 277 | $head[$h][2] = 'usergroupcard'; |
278 | 278 | $h++; |
279 | 279 | |
280 | 280 | // $head[$h][0] = DOL_URL_ROOT . '/user/admin/user_extrafields.php'; |
281 | - $head[$h][0] = BASE_URI . '?controller=user/admin&method=user_extrafields'; |
|
281 | + $head[$h][0] = BASE_URI.'?controller=user/admin&method=user_extrafields'; |
|
282 | 282 | $head[$h][1] = $langs->trans("ExtraFields"); |
283 | 283 | $head[$h][2] = 'attributes'; |
284 | 284 | $h++; |
285 | 285 | |
286 | 286 | // $head[$h][0] = DOL_URL_ROOT . '/user/admin/group_extrafields.php'; |
287 | - $head[$h][0] = BASE_URI . '?controller=user/admin&method=group_extrafields'; |
|
288 | - $head[$h][1] = $langs->trans("ExtraFields") . " " . $langs->trans("Groups"); |
|
287 | + $head[$h][0] = BASE_URI.'?controller=user/admin&method=group_extrafields'; |
|
288 | + $head[$h][1] = $langs->trans("ExtraFields")." ".$langs->trans("Groups"); |
|
289 | 289 | $head[$h][2] = 'attributes_group'; |
290 | 290 | $h++; |
291 | 291 | |
@@ -313,14 +313,14 @@ discard block |
||
313 | 313 | global $conf, $langs, $db, $form; |
314 | 314 | global $bc; |
315 | 315 | |
316 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
|
316 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
317 | 317 | |
318 | 318 | $formother = new FormOther($db); |
319 | 319 | |
320 | 320 | $dirthemes = array('/theme'); |
321 | 321 | if (!empty($conf->modules_parts['theme'])) { // Using this feature slow down application |
322 | 322 | foreach ($conf->modules_parts['theme'] as $reldir) { |
323 | - $dirthemes = array_merge($dirthemes, (array) ($reldir . 'theme')); |
|
323 | + $dirthemes = array_merge($dirthemes, (array) ($reldir.'theme')); |
|
324 | 324 | } |
325 | 325 | } |
326 | 326 | $dirthemes = array_unique($dirthemes); |
@@ -357,40 +357,40 @@ discard block |
||
357 | 357 | |
358 | 358 | // Title |
359 | 359 | if ($foruserprofile) { |
360 | - print '<tr class="liste_titre"><th class="titlefield">' . $langs->trans("Parameter") . '</th><th>' . $langs->trans("DefaultValue") . '</th>'; |
|
360 | + print '<tr class="liste_titre"><th class="titlefield">'.$langs->trans("Parameter").'</th><th>'.$langs->trans("DefaultValue").'</th>'; |
|
361 | 361 | print '<th colspan="2"> </th>'; |
362 | 362 | print '</tr>'; |
363 | 363 | |
364 | 364 | print '<tr>'; |
365 | - print '<td>' . $langs->trans("DefaultSkin") . '</td>'; |
|
366 | - print '<td>' . $conf->global->MAIN_THEME . '</td>'; |
|
367 | - print '<td align="left" class="nowrap" width="20%"><input id="check_MAIN_THEME" name="check_MAIN_THEME"' . ($edit ? '' : ' disabled') . ' type="checkbox" ' . ($selected_theme ? " checked" : "") . '> ' . $langs->trans("UsePersonalValue") . '</td>'; |
|
365 | + print '<td>'.$langs->trans("DefaultSkin").'</td>'; |
|
366 | + print '<td>'.$conf->global->MAIN_THEME.'</td>'; |
|
367 | + print '<td align="left" class="nowrap" width="20%"><input id="check_MAIN_THEME" name="check_MAIN_THEME"'.($edit ? '' : ' disabled').' type="checkbox" '.($selected_theme ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>'; |
|
368 | 368 | print '<td> </td>'; |
369 | 369 | print '</tr>'; |
370 | 370 | } else { |
371 | - print '<tr class="liste_titre"><th class="titlefield">' . $langs->trans("DefaultSkin") . '</th>'; |
|
371 | + print '<tr class="liste_titre"><th class="titlefield">'.$langs->trans("DefaultSkin").'</th>'; |
|
372 | 372 | print '<th align="right">'; |
373 | 373 | $url = 'https://www.dolistore.com/lang-en/4-skins'; |
374 | 374 | if (preg_match('/fr/i', $langs->defaultlang)) { |
375 | 375 | $url = 'https://www.dolistore.com/fr/4-themes'; |
376 | 376 | } |
377 | 377 | //if (preg_match('/es/i',$langs->defaultlang)) $url='http://www.dolistore.com/lang-es/4-themes'; |
378 | - print '<a href="' . $url . '" target="_blank">'; |
|
378 | + print '<a href="'.$url.'" target="_blank">'; |
|
379 | 379 | print $langs->trans('DownloadMoreSkins'); |
380 | 380 | print '</a>'; |
381 | 381 | print '</th></tr>'; |
382 | 382 | |
383 | 383 | print '<tr>'; |
384 | - print '<td>' . $langs->trans("ThemeDir") . '</td>'; |
|
384 | + print '<td>'.$langs->trans("ThemeDir").'</td>'; |
|
385 | 385 | print '<td>'; |
386 | 386 | foreach ($dirthemes as $dirtheme) { |
387 | - echo '"' . $dirtheme . '" '; |
|
387 | + echo '"'.$dirtheme.'" '; |
|
388 | 388 | } |
389 | 389 | print '</td>'; |
390 | 390 | print '</tr>'; |
391 | 391 | } |
392 | 392 | |
393 | - print '<tr><td colspan="' . $colspan . '">'; |
|
393 | + print '<tr><td colspan="'.$colspan.'">'; |
|
394 | 394 | |
395 | 395 | print '<table class="nobordernopadding" width="100%"><tr><td><div align="center">'; |
396 | 396 | |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | $handle = opendir($dirtheme); |
405 | 405 | if (is_resource($handle)) { |
406 | 406 | while (($subdir = readdir($handle)) !== false) { |
407 | - if (is_dir($dirtheme . "/" . $subdir) && substr($subdir, 0, 1) <> '.' && substr($subdir, 0, 3) <> 'CVS' && !preg_match('/common|phones/i', $subdir)) { |
|
407 | + if (is_dir($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.' && substr($subdir, 0, 3) <> 'CVS' && !preg_match('/common|phones/i', $subdir)) { |
|
408 | 408 | // Disable not stable themes (dir ends with _exp or _dev) |
409 | 409 | if ($conf->global->MAIN_FEATURES_LEVEL < 2 && preg_match('/_dev$/i', $subdir)) { |
410 | 410 | continue; |
@@ -414,23 +414,23 @@ discard block |
||
414 | 414 | } |
415 | 415 | |
416 | 416 | print '<div class="inline-block" style="margin-top: 10px; margin-bottom: 10px; margin-right: 20px; margin-left: 20px;">'; |
417 | - $file = $dirtheme . "/" . $subdir . "/thumb.png"; |
|
418 | - $url = $urltheme . "/" . $subdir . "/thumb.png"; |
|
417 | + $file = $dirtheme."/".$subdir."/thumb.png"; |
|
418 | + $url = $urltheme."/".$subdir."/thumb.png"; |
|
419 | 419 | if (!file_exists($file)) { |
420 | - $url = DOL_URL_ROOT . '/public/theme/common/nophoto.png'; |
|
420 | + $url = DOL_URL_ROOT.'/public/theme/common/nophoto.png'; |
|
421 | 421 | } |
422 | - print '<a href="' . $_SERVER["PHP_SELF"] . ($edit ? '?action=edit&theme=' : '?theme=') . $subdir . (GETPOST('optioncss', 'alpha', 1) ? '&optioncss=' . GETPOST('optioncss', 'alpha', 1) : '') . ($fuser ? '&id=' . $fuser->id : '') . '" style="font-weight: normal;" alt="' . $langs->trans("Preview") . '">'; |
|
422 | + print '<a href="'.$_SERVER["PHP_SELF"].($edit ? '?action=edit&theme=' : '?theme=').$subdir.(GETPOST('optioncss', 'alpha', 1) ? '&optioncss='.GETPOST('optioncss', 'alpha', 1) : '').($fuser ? '&id='.$fuser->id : '').'" style="font-weight: normal;" alt="'.$langs->trans("Preview").'">'; |
|
423 | 423 | if ($subdir == $conf->global->MAIN_THEME) { |
424 | 424 | $title = $langs->trans("ThemeCurrentlyActive"); |
425 | 425 | } else { |
426 | 426 | $title = $langs->trans("ShowPreview"); |
427 | 427 | } |
428 | - print '<img src="' . $url . '" border="0" width="80" height="60" alt="' . $title . '" title="' . $title . '" style="margin-bottom: 5px;">'; |
|
428 | + print '<img src="'.$url.'" border="0" width="80" height="60" alt="'.$title.'" title="'.$title.'" style="margin-bottom: 5px;">'; |
|
429 | 429 | print '</a><br>'; |
430 | 430 | if ($subdir == $selected_theme) { |
431 | - print '<input ' . ($edit ? '' : 'disabled') . ' type="radio" class="themethumbs" style="border: 0px;" checked name="main_theme" value="' . $subdir . '"> <b>' . $subdir . '</b>'; |
|
431 | + print '<input '.($edit ? '' : 'disabled').' type="radio" class="themethumbs" style="border: 0px;" checked name="main_theme" value="'.$subdir.'"> <b>'.$subdir.'</b>'; |
|
432 | 432 | } else { |
433 | - print '<input ' . ($edit ? '' : 'disabled') . ' type="radio" class="themethumbs" style="border: 0px;" name="main_theme" value="' . $subdir . '"> ' . $subdir; |
|
433 | + print '<input '.($edit ? '' : 'disabled').' type="radio" class="themethumbs" style="border: 0px;" name="main_theme" value="'.$subdir.'"> '.$subdir; |
|
434 | 434 | } |
435 | 435 | print '</div>'; |
436 | 436 | |
@@ -470,15 +470,15 @@ discard block |
||
470 | 470 | } else { |
471 | 471 | $default = $langs->trans('No'); |
472 | 472 | print '<tr class="oddeven">'; |
473 | - print '<td>' . $langs->trans("TopMenuDisableImages") . '</td>'; |
|
474 | - print '<td colspan="' . ($colspan - 1) . '">'; |
|
473 | + print '<td>'.$langs->trans("TopMenuDisableImages").'</td>'; |
|
474 | + print '<td colspan="'.($colspan - 1).'">'; |
|
475 | 475 | if ($edit) { |
476 | 476 | print $form->selectyesno('THEME_TOPMENU_DISABLE_IMAGE', $conf->global->THEME_TOPMENU_DISABLE_IMAGE, 1); |
477 | 477 | } else { |
478 | 478 | print yn($conf->global->THEME_TOPMENU_DISABLE_IMAGE); |
479 | 479 | } |
480 | - print ' <span class="nowraponall">(' . $langs->trans("Default") . ': <strong>' . $default . '</strong>) '; |
|
481 | - print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes") . ', ' . $langs->trans("PressF5AfterChangingThis")); |
|
480 | + print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>'.$default.'</strong>) '; |
|
481 | + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
|
482 | 482 | print '</span>'; |
483 | 483 | print '</td>'; |
484 | 484 | } |
@@ -507,21 +507,21 @@ discard block |
||
507 | 507 | print '</td>'; */ |
508 | 508 | } else { |
509 | 509 | print '<tr class="oddeven">'; |
510 | - print '<td>' . $langs->trans("BackgroundColor") . '</td>'; |
|
511 | - print '<td colspan="' . ($colspan - 1) . '">'; |
|
510 | + print '<td>'.$langs->trans("BackgroundColor").'</td>'; |
|
511 | + print '<td colspan="'.($colspan - 1).'">'; |
|
512 | 512 | //var_dump($conf->global->THEME_ELDY_BACKBODY); |
513 | 513 | if ($edit) { |
514 | - print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY, array()), ''), 'THEME_ELDY_BACKBODY', 'formcolor', 1) . ' '; |
|
514 | + print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY, array()), ''), 'THEME_ELDY_BACKBODY', 'formcolor', 1).' '; |
|
515 | 515 | } else { |
516 | 516 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY, array()), ''); |
517 | 517 | if ($color) { |
518 | - print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #' . $color . '" value="' . $color . '">'; |
|
518 | + print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
|
519 | 519 | } else { |
520 | 520 | print $langs->trans("Default"); |
521 | 521 | } |
522 | 522 | } |
523 | - print ' <span class="nowraponall">(' . $langs->trans("Default") . ': <strong>ffffff</strong>) '; |
|
524 | - print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes") . ', ' . $langs->trans("PressF5AfterChangingThis")); |
|
523 | + print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>ffffff</strong>) '; |
|
524 | + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
|
525 | 525 | print '</span>'; |
526 | 526 | print '</td>'; |
527 | 527 | } |
@@ -555,20 +555,20 @@ discard block |
||
555 | 555 | } |
556 | 556 | |
557 | 557 | print '<tr class="oddeven">'; |
558 | - print '<td>' . $langs->trans("TopMenuBackgroundColor") . '</td>'; |
|
559 | - print '<td colspan="' . ($colspan - 1) . '">'; |
|
558 | + print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>'; |
|
559 | + print '<td colspan="'.($colspan - 1).'">'; |
|
560 | 560 | if ($edit) { |
561 | - print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1, array()), ''), 'THEME_ELDY_TOPMENU_BACK1', 'formcolor', 1) . ' '; |
|
561 | + print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1, array()), ''), 'THEME_ELDY_TOPMENU_BACK1', 'formcolor', 1).' '; |
|
562 | 562 | } else { |
563 | 563 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1, array()), ''); |
564 | 564 | if ($color) { |
565 | - print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #' . $color . '" value="' . $color . '">'; |
|
565 | + print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
|
566 | 566 | } else { |
567 | 567 | print $langs->trans("Default"); |
568 | 568 | } |
569 | 569 | } |
570 | - print ' <span class="nowraponall">(' . $langs->trans("Default") . ': <strong>' . $default . '</strong>) '; |
|
571 | - print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes") . ', ' . $langs->trans("PressF5AfterChangingThis")); |
|
570 | + print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>'.$default.'</strong>) '; |
|
571 | + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
|
572 | 572 | print '</span>'; |
573 | 573 | print '</td>'; |
574 | 574 | } |
@@ -602,20 +602,20 @@ discard block |
||
602 | 602 | } |
603 | 603 | |
604 | 604 | print '<tr class="oddeven">'; |
605 | - print '<td>' . $langs->trans("LeftMenuBackgroundColor") . '</td>'; |
|
606 | - print '<td colspan="' . ($colspan - 1) . '">'; |
|
605 | + print '<td>'.$langs->trans("LeftMenuBackgroundColor").'</td>'; |
|
606 | + print '<td colspan="'.($colspan - 1).'">'; |
|
607 | 607 | if ($edit) { |
608 | - print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1, array()), ''), 'THEME_ELDY_VERMENU_BACK1', 'formcolor', 1) . ' '; |
|
608 | + print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1, array()), ''), 'THEME_ELDY_VERMENU_BACK1', 'formcolor', 1).' '; |
|
609 | 609 | } else { |
610 | 610 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1, array()), ''); |
611 | 611 | if ($color) { |
612 | - print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #' . $color . '" value="' . $color . '">'; |
|
612 | + print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
|
613 | 613 | } else { |
614 | 614 | print $langs->trans("Default"); |
615 | 615 | } |
616 | 616 | } |
617 | - print ' <span class="nowraponall">(' . $langs->trans("Default") . ': <strong>' . $default . '</strong>) '; |
|
618 | - print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes") . ', ' . $langs->trans("PressF5AfterChangingThis")); |
|
617 | + print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>'.$default.'</strong>) '; |
|
618 | + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
|
619 | 619 | print '</span>'; |
620 | 620 | print '</td>'; |
621 | 621 | } |
@@ -625,15 +625,15 @@ discard block |
||
625 | 625 | |
626 | 626 | } else { |
627 | 627 | print '<tr class="oddeven">'; |
628 | - print '<td>' . $langs->trans("TextTitleColor") . '</td>'; |
|
629 | - print '<td colspan="' . ($colspan - 1) . '">'; |
|
628 | + print '<td>'.$langs->trans("TextTitleColor").'</td>'; |
|
629 | + print '<td colspan="'.($colspan - 1).'">'; |
|
630 | 630 | if ($edit) { |
631 | - print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLENOTAB, array()), ''), 'THEME_ELDY_TEXTTITLENOTAB', 'formcolor', 1) . ' '; |
|
631 | + print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLENOTAB, array()), ''), 'THEME_ELDY_TEXTTITLENOTAB', 'formcolor', 1).' '; |
|
632 | 632 | } else { |
633 | 633 | print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLENOTAB, $langs->trans("Default")); |
634 | 634 | } |
635 | - print ' <span class="nowraponall">(' . $langs->trans("Default") . ': <strong><span style="color: #643c14">643c14</span></strong>) '; |
|
636 | - print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes") . ', ' . $langs->trans("PressF5AfterChangingThis")); |
|
635 | + print ' <span class="nowraponall">('.$langs->trans("Default").': <strong><span style="color: #643c14">643c14</span></strong>) '; |
|
636 | + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
|
637 | 637 | print '</span>'; |
638 | 638 | print '</td>'; |
639 | 639 | |
@@ -645,15 +645,15 @@ discard block |
||
645 | 645 | |
646 | 646 | } else { |
647 | 647 | print '<tr class="oddeven">'; |
648 | - print '<td>' . $langs->trans("BackgroundTableTitleColor") . '</td>'; |
|
649 | - print '<td colspan="' . ($colspan - 1) . '">'; |
|
648 | + print '<td>'.$langs->trans("BackgroundTableTitleColor").'</td>'; |
|
649 | + print '<td colspan="'.($colspan - 1).'">'; |
|
650 | 650 | if ($edit) { |
651 | - print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKTITLE1, array()), ''), 'THEME_ELDY_BACKTITLE1', 'formcolor', 1) . ' '; |
|
651 | + print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKTITLE1, array()), ''), 'THEME_ELDY_BACKTITLE1', 'formcolor', 1).' '; |
|
652 | 652 | } else { |
653 | 653 | print $formother->showColor($conf->global->THEME_ELDY_BACKTITLE1, $langs->trans("Default")); |
654 | 654 | } |
655 | - print ' <span class="nowraponall">(' . $langs->trans("Default") . ': <strong>f0f0f0</strong>) '; // $colorbacktitle1 in CSS |
|
656 | - print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes") . ', ' . $langs->trans("PressF5AfterChangingThis")); |
|
655 | + print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>f0f0f0</strong>) '; // $colorbacktitle1 in CSS |
|
656 | + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
|
657 | 657 | print '</span>'; |
658 | 658 | print '</td>'; |
659 | 659 | |
@@ -665,15 +665,15 @@ discard block |
||
665 | 665 | |
666 | 666 | } else { |
667 | 667 | print '<tr class="oddeven">'; |
668 | - print '<td>' . $langs->trans("BackgroundTableTitleTextColor") . '</td>'; |
|
669 | - print '<td colspan="' . ($colspan - 1) . '">'; |
|
668 | + print '<td>'.$langs->trans("BackgroundTableTitleTextColor").'</td>'; |
|
669 | + print '<td colspan="'.($colspan - 1).'">'; |
|
670 | 670 | if ($edit) { |
671 | - print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLE, array()), ''), 'THEME_ELDY_TEXTTITLE', 'formcolor', 1) . ' '; |
|
671 | + print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLE, array()), ''), 'THEME_ELDY_TEXTTITLE', 'formcolor', 1).' '; |
|
672 | 672 | } else { |
673 | 673 | print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLE, $langs->trans("Default")); |
674 | 674 | } |
675 | - print ' <span class="nowraponall">(' . $langs->trans("Default") . ': <strong><span style="color: #000000">000000</span></strong>) '; |
|
676 | - print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes") . ', ' . $langs->trans("PressF5AfterChangingThis")); |
|
675 | + print ' <span class="nowraponall">('.$langs->trans("Default").': <strong><span style="color: #000000">000000</span></strong>) '; |
|
676 | + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
|
677 | 677 | print '</span>'; |
678 | 678 | print '</td>'; |
679 | 679 | |
@@ -690,20 +690,20 @@ discard block |
||
690 | 690 | } |
691 | 691 | |
692 | 692 | print '<tr class="oddeven">'; |
693 | - print '<td>' . $langs->trans("BackgroundTableLineOddColor") . '</td>'; |
|
694 | - print '<td colspan="' . ($colspan - 1) . '">'; |
|
693 | + print '<td>'.$langs->trans("BackgroundTableLineOddColor").'</td>'; |
|
694 | + print '<td colspan="'.($colspan - 1).'">'; |
|
695 | 695 | if ($edit) { |
696 | - print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEIMPAIR1, array()), ''), 'THEME_ELDY_LINEIMPAIR1', 'formcolor', 1) . ' '; |
|
696 | + print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEIMPAIR1, array()), ''), 'THEME_ELDY_LINEIMPAIR1', 'formcolor', 1).' '; |
|
697 | 697 | } else { |
698 | 698 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEIMPAIR1, array()), ''); |
699 | 699 | if ($color) { |
700 | - print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #' . $color . '" value="' . $color . '">'; |
|
700 | + print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
|
701 | 701 | } else { |
702 | 702 | print $langs->trans("Default"); |
703 | 703 | } |
704 | 704 | } |
705 | - print ' <span class="nowraponall">(' . $langs->trans("Default") . ': <strong>' . $default . '</strong>) '; |
|
706 | - print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes") . ', ' . $langs->trans("PressF5AfterChangingThis")); |
|
705 | + print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>'.$default.'</strong>) '; |
|
706 | + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
|
707 | 707 | print '</span>'; |
708 | 708 | print '</td>'; |
709 | 709 | } |
@@ -718,20 +718,20 @@ discard block |
||
718 | 718 | } |
719 | 719 | |
720 | 720 | print '<tr class="oddeven">'; |
721 | - print '<td>' . $langs->trans("BackgroundTableLineEvenColor") . '</td>'; |
|
722 | - print '<td colspan="' . ($colspan - 1) . '">'; |
|
721 | + print '<td>'.$langs->trans("BackgroundTableLineEvenColor").'</td>'; |
|
722 | + print '<td colspan="'.($colspan - 1).'">'; |
|
723 | 723 | if ($edit) { |
724 | - print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEPAIR1, array()), ''), 'THEME_ELDY_LINEPAIR1', 'formcolor', 1) . ' '; |
|
724 | + print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEPAIR1, array()), ''), 'THEME_ELDY_LINEPAIR1', 'formcolor', 1).' '; |
|
725 | 725 | } else { |
726 | 726 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEPAIR1, array()), ''); |
727 | 727 | if ($color) { |
728 | - print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #' . $color . '" value="' . $color . '">'; |
|
728 | + print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
|
729 | 729 | } else { |
730 | 730 | print $langs->trans("Default"); |
731 | 731 | } |
732 | 732 | } |
733 | - print ' <span class="nowraponall">(' . $langs->trans("Default") . ': <strong>' . $default . '</strong>) '; |
|
734 | - print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes") . ', ' . $langs->trans("PressF5AfterChangingThis")); |
|
733 | + print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>'.$default.'</strong>) '; |
|
734 | + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
|
735 | 735 | print '</span>'; |
736 | 736 | print '</td>'; |
737 | 737 | } |
@@ -760,22 +760,22 @@ discard block |
||
760 | 760 | print '</td>'; */ |
761 | 761 | } else { |
762 | 762 | print '<tr class="oddeven">'; |
763 | - print '<td>' . $langs->trans("LinkColor") . '</td>'; |
|
764 | - print '<td colspan="' . ($colspan - 1) . '">'; |
|
763 | + print '<td>'.$langs->trans("LinkColor").'</td>'; |
|
764 | + print '<td colspan="'.($colspan - 1).'">'; |
|
765 | 765 | if ($edit) { |
766 | - print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK, array()), ''), 'THEME_ELDY_TEXTLINK', 'formcolor', 1) . ' '; |
|
766 | + print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK, array()), ''), 'THEME_ELDY_TEXTLINK', 'formcolor', 1).' '; |
|
767 | 767 | } else { |
768 | 768 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK, array()), ''); |
769 | 769 | if ($color) { |
770 | - print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #' . $color . '" value="' . $color . '">'; |
|
770 | + print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
|
771 | 771 | } else { |
772 | 772 | //print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$defaultcolor.'" value="'.$langs->trans("Default").'">'; |
773 | 773 | //print '<span style="color: #000078">'.$langs->trans("Default").'</span>'; |
774 | 774 | print $langs->trans("Default"); |
775 | 775 | } |
776 | 776 | } |
777 | - print ' <span class="nowraponall">(' . $langs->trans("Default") . ': <strong><span style="color: #000078">000078</span></strong>) '; |
|
778 | - print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes") . ', ' . $langs->trans("PressF5AfterChangingThis")); |
|
777 | + print ' <span class="nowraponall">('.$langs->trans("Default").': <strong><span style="color: #000078">000078</span></strong>) '; |
|
778 | + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
|
779 | 779 | print '</span>'; |
780 | 780 | print '</td>'; |
781 | 781 | } |
@@ -794,8 +794,8 @@ discard block |
||
794 | 794 | */ |
795 | 795 | } else { |
796 | 796 | print '<tr class="oddeven">'; |
797 | - print '<td>' . $langs->trans("HighlightLinesColor") . '</td>'; |
|
798 | - print '<td colspan="' . ($colspan - 1) . '">'; |
|
797 | + print '<td>'.$langs->trans("HighlightLinesColor").'</td>'; |
|
798 | + print '<td colspan="'.($colspan - 1).'">'; |
|
799 | 799 | //print '<input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled').' type="checkbox" '.($hoverdisabled?"":" checked").'>'; |
800 | 800 | //print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; |
801 | 801 | if ($edit) { |
@@ -804,7 +804,7 @@ discard block |
||
804 | 804 | } else { |
805 | 805 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER, array()), ''); |
806 | 806 | } |
807 | - print $formother->selectColor($color, 'THEME_ELDY_USE_HOVER', 'formcolor', 1) . ' '; |
|
807 | + print $formother->selectColor($color, 'THEME_ELDY_USE_HOVER', 'formcolor', 1).' '; |
|
808 | 808 | } else { |
809 | 809 | if ($conf->global->THEME_ELDY_USE_HOVER == '1') { |
810 | 810 | $color = 'e6edf0'; |
@@ -812,7 +812,7 @@ discard block |
||
812 | 812 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER, array()), ''); |
813 | 813 | if ($color) { |
814 | 814 | if ($color != 'e6edf0') { |
815 | - print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #' . $color . '" value="' . $color . '">'; |
|
815 | + print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
|
816 | 816 | } else { |
817 | 817 | print $langs->trans("Default"); |
818 | 818 | } |
@@ -820,8 +820,8 @@ discard block |
||
820 | 820 | print $langs->trans("None"); |
821 | 821 | } |
822 | 822 | } |
823 | - print ' <span class="nowraponall">(' . $langs->trans("Default") . ': <strong>e6edf0</strong>) '; |
|
824 | - print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes") . ', ' . $langs->trans("PressF5AfterChangingThis")); |
|
823 | + print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>e6edf0</strong>) '; |
|
824 | + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
|
825 | 825 | print '</span>'; |
826 | 826 | print '</td>'; |
827 | 827 | } |
@@ -840,8 +840,8 @@ discard block |
||
840 | 840 | */ |
841 | 841 | } else { |
842 | 842 | print '<tr class="oddeven">'; |
843 | - print '<td>' . $langs->trans("HighlightLinesChecked") . '</td>'; |
|
844 | - print '<td colspan="' . ($colspan - 1) . '">'; |
|
843 | + print '<td>'.$langs->trans("HighlightLinesChecked").'</td>'; |
|
844 | + print '<td colspan="'.($colspan - 1).'">'; |
|
845 | 845 | //print '<input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled').' type="checkbox" '.($hoverdisabled?"":" checked").'>'; |
846 | 846 | //print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; |
847 | 847 | if ($edit) { |
@@ -850,7 +850,7 @@ discard block |
||
850 | 850 | } else { |
851 | 851 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_CHECKED, array()), ''); |
852 | 852 | } |
853 | - print $formother->selectColor($color, 'THEME_ELDY_USE_CHECKED', 'formcolor', 1) . ' '; |
|
853 | + print $formother->selectColor($color, 'THEME_ELDY_USE_CHECKED', 'formcolor', 1).' '; |
|
854 | 854 | } else { |
855 | 855 | if ($conf->global->THEME_ELDY_USE_CHECKED == '1') { |
856 | 856 | $color = 'e6edf0'; |
@@ -859,15 +859,15 @@ discard block |
||
859 | 859 | } |
860 | 860 | if ($color) { |
861 | 861 | if ($color != 'e6edf0') { |
862 | - print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #' . $color . '" value="' . $color . '">'; |
|
862 | + print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
|
863 | 863 | } else { |
864 | 864 | print $langs->trans("Default"); |
865 | 865 | } |
866 | 866 | } else |
867 | 867 | print $langs->trans("None"); |
868 | 868 | } |
869 | - print ' <span class="nowraponall">(' . $langs->trans("Default") . ': <strong>e6edf0</strong>) '; |
|
870 | - print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes") . ', ' . $langs->trans("PressF5AfterChangingThis")); |
|
869 | + print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>e6edf0</strong>) '; |
|
870 | + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
|
871 | 871 | print '</span>'; |
872 | 872 | print '</td>'; |
873 | 873 | print '</tr>'; |
@@ -808,8 +808,9 @@ discard block |
||
808 | 808 | } else { |
809 | 809 | if ($conf->global->THEME_ELDY_USE_HOVER == '1') { |
810 | 810 | $color = 'e6edf0'; |
811 | - } else |
|
812 | - $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER, array()), ''); |
|
811 | + } else { |
|
812 | + $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER, array()), ''); |
|
813 | + } |
|
813 | 814 | if ($color) { |
814 | 815 | if ($color != 'e6edf0') { |
815 | 816 | print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #' . $color . '" value="' . $color . '">'; |
@@ -863,8 +864,9 @@ discard block |
||
863 | 864 | } else { |
864 | 865 | print $langs->trans("Default"); |
865 | 866 | } |
866 | - } else |
|
867 | - print $langs->trans("None"); |
|
867 | + } else { |
|
868 | + print $langs->trans("None"); |
|
869 | + } |
|
868 | 870 | } |
869 | 871 | print ' <span class="nowraponall">(' . $langs->trans("Default") . ': <strong>e6edf0</strong>) '; |
870 | 872 | print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes") . ', ' . $langs->trans("PressF5AfterChangingThis")); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * \file htdocs/core/menus/standard/eldy.lib.php |
29 | 29 | * \brief Library for file eldy menus |
30 | 30 | */ |
31 | -require_once DOL_DOCUMENT_ROOT . '/core/class/menubase.class.php'; |
|
31 | +require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Core function to output top menu eldy |
@@ -406,14 +406,14 @@ discard block |
||
406 | 406 | $param = (isset($tmp[1]) ? $tmp[1] : ''); |
407 | 407 | |
408 | 408 | if (!preg_match('/mainmenu/i', $param) || !preg_match('/leftmenu/i', $param)) { |
409 | - $param .= ($param ? '&' : '') . 'mainmenu=' . $newTabMenu[$i]['mainmenu'] . '&leftmenu='; |
|
409 | + $param .= ($param ? '&' : '').'mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu='; |
|
410 | 410 | } |
411 | 411 | //$url.="idmenu=".$newTabMenu[$i]['rowid']; // Already done by menuLoad |
412 | - $url = dol_buildpath($url, 1) . ($param ? '?' . $param : ''); |
|
412 | + $url = dol_buildpath($url, 1).($param ? '?'.$param : ''); |
|
413 | 413 | //$shorturl = $shorturl.($param?'?'.$param:''); |
414 | 414 | $shorturl = $url; |
415 | 415 | if (DOL_URL_ROOT) { |
416 | - $shorturl = preg_replace('/^' . preg_quote(DOL_URL_ROOT, '/') . '/', '', $shorturl); |
|
416 | + $shorturl = preg_replace('/^'.preg_quote(DOL_URL_ROOT, '/').'/', '', $shorturl); |
|
417 | 417 | } |
418 | 418 | } |
419 | 419 | |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | if (empty($noout)) { |
440 | 440 | foreach ($menu->liste as $menkey => $menuval) { |
441 | 441 | print_start_menu_entry($menuval['idsel'], $menuval['classname'], $menuval['enabled']); |
442 | - print_text_menu_entry($menuval['titre'], $menuval['enabled'], (($menuval['url'] != '#' && !preg_match('/^(http:\/\/|https:\/\/)/i', $menuval['url'])) ? DOL_URL_ROOT : '') . $menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target'] ? $menuval['target'] : $atarget)); |
|
442 | + print_text_menu_entry($menuval['titre'], $menuval['enabled'], (($menuval['url'] != '#' && !preg_match('/^(http:\/\/|https:\/\/)/i', $menuval['url'])) ? DOL_URL_ROOT : '').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target'] ? $menuval['target'] : $atarget)); |
|
443 | 443 | print_end_menu_entry($menuval['enabled']); |
444 | 444 | } |
445 | 445 | } |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | global $conf; |
465 | 465 | |
466 | 466 | print '<div class="tmenudiv">'; |
467 | - print '<ul class="tmenu"' . (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' title="Top menu"') . '>'; |
|
467 | + print '<ul class="tmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' title="Top menu"').'>'; |
|
468 | 468 | } |
469 | 469 | |
470 | 470 | /** |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | function print_start_menu_entry($idsel, $classname, $showmode) |
479 | 479 | { |
480 | 480 | if ($showmode) { |
481 | - print '<li ' . $classname . ' id="mainmenutd_' . $idsel . '">'; |
|
481 | + print '<li '.$classname.' id="mainmenutd_'.$idsel.'">'; |
|
482 | 482 | //print '<div class="tmenuleft tmenusep"></div>'; |
483 | 483 | print '<div class="tmenucenter">'; |
484 | 484 | } |
@@ -501,17 +501,17 @@ discard block |
||
501 | 501 | global $langs; |
502 | 502 | |
503 | 503 | if ($showmode == 1) { |
504 | - print '<a class="tmenuimage" tabindex="-1" href="' . $url . '"' . ($atarget ? ' target="' . $atarget . '"' : '') . '>'; |
|
505 | - print '<div class="' . $id . ' ' . $idsel . ' topmenuimage"><span class="' . $id . ' tmenuimage" id="mainmenuspan_' . $idsel . '"></span></div>'; |
|
504 | + print '<a class="tmenuimage" tabindex="-1" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').'>'; |
|
505 | + print '<div class="'.$id.' '.$idsel.' topmenuimage"><span class="'.$id.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>'; |
|
506 | 506 | print '</a>'; |
507 | - print '<a ' . $classname . ' id="mainmenua_' . $idsel . '" href="' . $url . '"' . ($atarget ? ' target="' . $atarget . '"' : '') . '>'; |
|
507 | + print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').'>'; |
|
508 | 508 | print '<span class="mainmenuaspan">'; |
509 | 509 | print $text; |
510 | 510 | print '</span>'; |
511 | 511 | print '</a>'; |
512 | 512 | } elseif ($showmode == 2) { |
513 | - print '<div class="' . $id . ' ' . $idsel . ' topmenuimage tmenudisabled"><span class="' . $id . '" id="mainmenuspan_' . $idsel . '"></span></div>'; |
|
514 | - print '<a class="tmenudisabled" id="mainmenua_' . $idsel . '" href="#" title="' . dol_escape_htmltag($langs->trans("NotAllowed")) . '">'; |
|
513 | + print '<div class="'.$id.' '.$idsel.' topmenuimage tmenudisabled"><span class="'.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>'; |
|
514 | + print '<a class="tmenudisabled" id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'; |
|
515 | 515 | print '<span class="mainmenuaspan">'; |
516 | 516 | print $text; |
517 | 517 | print '</span>'; |
@@ -576,38 +576,38 @@ discard block |
||
576 | 576 | // Show logo company |
577 | 577 | if (empty($conf->global->MAIN_MENU_INVERT) && empty($noout) && !empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { |
578 | 578 | $mysoc->logo_mini = $conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; |
579 | - if (!empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output . '/logos/thumbs/' . $mysoc->logo_mini)) { |
|
580 | - $urllogo = DOL_BASE_URI . '/viewimage.php?cache=1&modulepart=mycompany&file=' . urlencode('logos/thumbs/' . $mysoc->logo_mini); |
|
579 | + if (!empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { |
|
580 | + $urllogo = DOL_BASE_URI.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); |
|
581 | 581 | } else { |
582 | - $urllogo = DOL_BASE_URI . '/theme/dolibarr_logo.png'; |
|
582 | + $urllogo = DOL_BASE_URI.'/theme/dolibarr_logo.png'; |
|
583 | 583 | } |
584 | 584 | $title = $langs->trans("GoIntoSetupToChangeLogo"); |
585 | - print "\n" . '<!-- Show logo on menu -->' . "\n"; |
|
586 | - print '<div class="blockvmenuimpair blockvmenulogo">' . "\n"; |
|
585 | + print "\n".'<!-- Show logo on menu -->'."\n"; |
|
586 | + print '<div class="blockvmenuimpair blockvmenulogo">'."\n"; |
|
587 | 587 | print '<div class="menu_titre" id="menu_titre_logo"></div>'; |
588 | 588 | print '<div class="menu_top" id="menu_top_logo"></div>'; |
589 | 589 | print '<div class="menu_contenu" id="menu_contenu_logo">'; |
590 | - print '<div class="center"><img class="mycompany" title="' . dol_escape_htmltag($title) . '" alt="" src="' . $urllogo . '" style="max-width: 70%"></div>' . "\n"; |
|
590 | + print '<div class="center"><img class="mycompany" title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 70%"></div>'."\n"; |
|
591 | 591 | print '</div>'; |
592 | 592 | print '<div class="menu_end" id="menu_end_logo"></div>'; |
593 | - print '</div>' . "\n"; |
|
593 | + print '</div>'."\n"; |
|
594 | 594 | } |
595 | 595 | |
596 | 596 | if (is_array($moredata) && !empty($moredata['searchform'])) { // searchform can contains select2 code or link to show old search form or link to switch on search page |
597 | 597 | print "\n"; |
598 | 598 | print "<!-- Begin SearchForm -->\n"; |
599 | - print '<div id="blockvmenusearch" class="blockvmenusearch">' . "\n"; |
|
599 | + print '<div id="blockvmenusearch" class="blockvmenusearch">'."\n"; |
|
600 | 600 | print $moredata['searchform']; |
601 | - print '</div>' . "\n"; |
|
601 | + print '</div>'."\n"; |
|
602 | 602 | print "<!-- End SearchForm -->\n"; |
603 | 603 | } |
604 | 604 | |
605 | 605 | if (is_array($moredata) && !empty($moredata['bookmarks'])) { |
606 | 606 | print "\n"; |
607 | 607 | print "<!-- Begin Bookmarks -->\n"; |
608 | - print '<div id="blockvmenubookmarks" class="blockvmenubookmarks">' . "\n"; |
|
608 | + print '<div id="blockvmenubookmarks" class="blockvmenubookmarks">'."\n"; |
|
609 | 609 | print $moredata['bookmarks']; |
610 | - print '</div>' . "\n"; |
|
610 | + print '</div>'."\n"; |
|
611 | 611 | print "<!-- End Bookmarks -->\n"; |
612 | 612 | } |
613 | 613 | |
@@ -624,11 +624,11 @@ discard block |
||
624 | 624 | |
625 | 625 | // Home - dashboard |
626 | 626 | //$newmenu->add("/index.php?mainmenu=home&leftmenu=home", $langs->trans("MyDashboard"), 0, 1, '', $mainmenu, 'home', 0, '', '', '', '<i class="fa fa-bar-chart fa-fw paddingright"></i>'); |
627 | - $newmenu->add(BASE_URI . "?controller=home&method=home&mainmenu=home&leftmenu=home", $langs->trans("MyDashboard"), 0, 1, '', $mainmenu, 'home', 0, '', '', '', '<i class="fa fa-bar-chart fa-fw paddingright"></i>'); |
|
627 | + $newmenu->add(BASE_URI."?controller=home&method=home&mainmenu=home&leftmenu=home", $langs->trans("MyDashboard"), 0, 1, '', $mainmenu, 'home', 0, '', '', '', '<i class="fa fa-bar-chart fa-fw paddingright"></i>'); |
|
628 | 628 | |
629 | 629 | // Setup |
630 | 630 | //$newmenu->add("/admin/index.php?mainmenu=home&leftmenu=setup", $langs->trans("Setup"), 0, $user->admin, '', $mainmenu, 'setup', 0, '', '', '', '<i class="fa fa-wrench fa-fw paddingright"></i>'); |
631 | - $newmenu->add(BASE_URI . "?controller=admin&method=index&mainmenu=home&leftmenu=setup", $langs->trans("Setup"), 0, $user->admin, '', $mainmenu, 'setup', 0, '', '', '', '<i class="fa fa-wrench fa-fw paddingright"></i>'); |
|
631 | + $newmenu->add(BASE_URI."?controller=admin&method=index&mainmenu=home&leftmenu=setup", $langs->trans("Setup"), 0, $user->admin, '', $mainmenu, 'setup', 0, '', '', '', '<i class="fa fa-wrench fa-fw paddingright"></i>'); |
|
632 | 632 | |
633 | 633 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "setup") { |
634 | 634 | // Load translation files required by the page |
@@ -637,14 +637,14 @@ discard block |
||
637 | 637 | $warnpicto = ''; |
638 | 638 | if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) { |
639 | 639 | $langs->load("errors"); |
640 | - $warnpicto = ' ' . img_warning($langs->trans("WarningMandatorySetupNotComplete")); |
|
640 | + $warnpicto = ' '.img_warning($langs->trans("WarningMandatorySetupNotComplete")); |
|
641 | 641 | } |
642 | 642 | //$newmenu->add("/admin/company.php?mainmenu=home", $langs->trans("MenuCompanySetup") . $warnpicto, 1); |
643 | - $newmenu->add(BASE_URI . "?controller=admin&method=company&mainmenu=home", $langs->trans("MenuCompanySetup") . $warnpicto, 1); |
|
643 | + $newmenu->add(BASE_URI."?controller=admin&method=company&mainmenu=home", $langs->trans("MenuCompanySetup").$warnpicto, 1); |
|
644 | 644 | $warnpicto = ''; |
645 | 645 | if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) { // If only user module enabled |
646 | 646 | $langs->load("errors"); |
647 | - $warnpicto = ' ' . img_warning($langs->trans("WarningMandatorySetupNotComplete")); |
|
647 | + $warnpicto = ' '.img_warning($langs->trans("WarningMandatorySetupNotComplete")); |
|
648 | 648 | } |
649 | 649 | /* |
650 | 650 | $newmenu->add("/admin/modules.php?mainmenu=home", $langs->trans("Modules") . $warnpicto, 1); |
@@ -663,42 +663,42 @@ discard block |
||
663 | 663 | $newmenu->add("/admin/dict.php?mainmenu=home", $langs->trans("Dictionary"), 1); |
664 | 664 | $newmenu->add("/admin/const.php?mainmenu=home", $langs->trans("OtherSetup"), 1); |
665 | 665 | */ |
666 | - $newmenu->add(BASE_URI . "?controller=admin&method=modules&mainmenu=home", $langs->trans("Modules") . $warnpicto, 1); |
|
667 | - $newmenu->add(BASE_URI . "?controller=admin&method=menus&mainmenu=home", $langs->trans("Menus"), 1); |
|
668 | - $newmenu->add(BASE_URI . "?controller=admin&method=ihm&mainmenu=home", $langs->trans("GUISetup"), 1); |
|
669 | - |
|
670 | - $newmenu->add(BASE_URI . "?controller=admin&method=translation&mainmenu=home", $langs->trans("Translation"), 1); |
|
671 | - $newmenu->add(BASE_URI . "?controller=admin&method=defaultvalues&mainmenu=home", $langs->trans("DefaultValues"), 1); |
|
672 | - $newmenu->add(BASE_URI . "?controller=admin&method=boxes&mainmenu=home", $langs->trans("Boxes"), 1); |
|
673 | - $newmenu->add(BASE_URI . "?controller=admin&method=delais&mainmenu=home", $langs->trans("MenuWarnings"), 1); |
|
674 | - $newmenu->add(BASE_URI . "?controller=admin&method=security_other&mainmenu=home", $langs->trans("Security"), 1); |
|
675 | - $newmenu->add(BASE_URI . "?controller=admin&method=limits&mainmenu=home", $langs->trans("MenuLimits"), 1); |
|
676 | - $newmenu->add(BASE_URI . "?controller=admin&method=pdf&mainmenu=home", $langs->trans("PDF"), 1); |
|
677 | - $newmenu->add(BASE_URI . "?controller=admin&method=mails&mainmenu=home", $langs->trans("Emails"), 1); |
|
678 | - $newmenu->add(BASE_URI . "?controller=admin&method=sms&mainmenu=home", $langs->trans("SMS"), 1); |
|
679 | - $newmenu->add(BASE_URI . "?controller=admin&method=dict&mainmenu=home", $langs->trans("Dictionary"), 1); |
|
680 | - $newmenu->add(BASE_URI . "?controller=admin&method=const&mainmenu=home", $langs->trans("OtherSetup"), 1); |
|
666 | + $newmenu->add(BASE_URI."?controller=admin&method=modules&mainmenu=home", $langs->trans("Modules").$warnpicto, 1); |
|
667 | + $newmenu->add(BASE_URI."?controller=admin&method=menus&mainmenu=home", $langs->trans("Menus"), 1); |
|
668 | + $newmenu->add(BASE_URI."?controller=admin&method=ihm&mainmenu=home", $langs->trans("GUISetup"), 1); |
|
669 | + |
|
670 | + $newmenu->add(BASE_URI."?controller=admin&method=translation&mainmenu=home", $langs->trans("Translation"), 1); |
|
671 | + $newmenu->add(BASE_URI."?controller=admin&method=defaultvalues&mainmenu=home", $langs->trans("DefaultValues"), 1); |
|
672 | + $newmenu->add(BASE_URI."?controller=admin&method=boxes&mainmenu=home", $langs->trans("Boxes"), 1); |
|
673 | + $newmenu->add(BASE_URI."?controller=admin&method=delais&mainmenu=home", $langs->trans("MenuWarnings"), 1); |
|
674 | + $newmenu->add(BASE_URI."?controller=admin&method=security_other&mainmenu=home", $langs->trans("Security"), 1); |
|
675 | + $newmenu->add(BASE_URI."?controller=admin&method=limits&mainmenu=home", $langs->trans("MenuLimits"), 1); |
|
676 | + $newmenu->add(BASE_URI."?controller=admin&method=pdf&mainmenu=home", $langs->trans("PDF"), 1); |
|
677 | + $newmenu->add(BASE_URI."?controller=admin&method=mails&mainmenu=home", $langs->trans("Emails"), 1); |
|
678 | + $newmenu->add(BASE_URI."?controller=admin&method=sms&mainmenu=home", $langs->trans("SMS"), 1); |
|
679 | + $newmenu->add(BASE_URI."?controller=admin&method=dict&mainmenu=home", $langs->trans("Dictionary"), 1); |
|
680 | + $newmenu->add(BASE_URI."?controller=admin&method=const&mainmenu=home", $langs->trans("OtherSetup"), 1); |
|
681 | 681 | } |
682 | 682 | |
683 | 683 | // System tools |
684 | 684 | //$newmenu->add("/admin/tools/index.php?mainmenu=home&leftmenu=admintools", $langs->trans("AdminTools"), 0, $user->admin, '', $mainmenu, 'admintools', 0, '', '', '', '<i class="fa fa-server fa-fw paddingright"></i>'); |
685 | - $newmenu->add(BASE_URI . "?controller=admin/tools&method=index&mainmenu=home&leftmenu=admintools", $langs->trans("AdminTools"), 0, $user->admin, '', $mainmenu, 'admintools', 0, '', '', '', '<i class="fa fa-server fa-fw paddingright"></i>'); |
|
685 | + $newmenu->add(BASE_URI."?controller=admin/tools&method=index&mainmenu=home&leftmenu=admintools", $langs->trans("AdminTools"), 0, $user->admin, '', $mainmenu, 'admintools', 0, '', '', '', '<i class="fa fa-server fa-fw paddingright"></i>'); |
|
686 | 686 | |
687 | 687 | if ($usemenuhider || empty($leftmenu) || preg_match('/^admintools/', $leftmenu)) { |
688 | 688 | // Load translation files required by the page |
689 | 689 | $langs->loadLangs(array('admin', 'help')); |
690 | 690 | |
691 | 691 | //$newmenu->add('/admin/system/dolibarr.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('InfoDolibarr'), 1); |
692 | - $newmenu->add(BASE_URI . "?controller=admin/system&method=dolibarr&mainmenu=home&leftmenu=admintools_info", $langs->trans('InfoDolibarr'), 1); |
|
692 | + $newmenu->add(BASE_URI."?controller=admin/system&method=dolibarr&mainmenu=home&leftmenu=admintools_info", $langs->trans('InfoDolibarr'), 1); |
|
693 | 693 | if ($usemenuhider || empty($leftmenu) || $leftmenu == 'admintools_info') { |
694 | 694 | /* |
695 | 695 | $newmenu->add('/admin/system/modules.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('Modules'), 2); |
696 | 696 | $newmenu->add('/admin/triggers.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('Triggers'), 2); |
697 | 697 | $newmenu->add('/admin/system/filecheck.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('FileCheck'), 2); |
698 | 698 | */ |
699 | - $newmenu->add(BASE_URI . '?controller=admin/system&method=modules&mainmenu=home&leftmenu=admintools_info', $langs->trans('Modules'), 2); |
|
700 | - $newmenu->add(BASE_URI . '?controller=admin&method=triggers&mainmenu=home&leftmenu=admintools_info', $langs->trans('Triggers'), 2); |
|
701 | - $newmenu->add(BASE_URI . '?controller=admin/system&method=filecheck&mainmenu=home&leftmenu=admintools_info', $langs->trans('FileCheck'), 2); |
|
699 | + $newmenu->add(BASE_URI.'?controller=admin/system&method=modules&mainmenu=home&leftmenu=admintools_info', $langs->trans('Modules'), 2); |
|
700 | + $newmenu->add(BASE_URI.'?controller=admin&method=triggers&mainmenu=home&leftmenu=admintools_info', $langs->trans('Triggers'), 2); |
|
701 | + $newmenu->add(BASE_URI.'?controller=admin/system&method=filecheck&mainmenu=home&leftmenu=admintools_info', $langs->trans('FileCheck'), 2); |
|
702 | 702 | } |
703 | 703 | /* |
704 | 704 | $newmenu->add('/admin/system/browser.php?mainmenu=home&leftmenu=admintools', $langs->trans('InfoBrowser'), 1); |
@@ -718,33 +718,33 @@ discard block |
||
718 | 718 | $newmenu->add("/admin/tools/listsessions.php?mainmenu=home&leftmenu=admintools", $langs->trans("Sessions"), 1); |
719 | 719 | $newmenu->add('/admin/system/about.php?mainmenu=home&leftmenu=admintools', $langs->trans('ExternalResources'), 1); |
720 | 720 | */ |
721 | - $newmenu->add(BASE_URI . '?controller=admin/system&method=browser&mainmenu=home&leftmenu=admintools', $langs->trans('InfoBrowser'), 1); |
|
722 | - $newmenu->add(BASE_URI . '?controller=admin/system&method=os&mainmenu=home&leftmenu=admintools', $langs->trans('InfoOS'), 1); |
|
723 | - $newmenu->add(BASE_URI . '?controller=admin/system&method=web&mainmenu=home&leftmenu=admintools', $langs->trans('InfoWebServer'), 1); |
|
724 | - $newmenu->add(BASE_URI . '?controller=admin/system&method=phpinfo&mainmenu=home&leftmenu=admintools', $langs->trans('InfoPHP'), 1); |
|
721 | + $newmenu->add(BASE_URI.'?controller=admin/system&method=browser&mainmenu=home&leftmenu=admintools', $langs->trans('InfoBrowser'), 1); |
|
722 | + $newmenu->add(BASE_URI.'?controller=admin/system&method=os&mainmenu=home&leftmenu=admintools', $langs->trans('InfoOS'), 1); |
|
723 | + $newmenu->add(BASE_URI.'?controller=admin/system&method=web&mainmenu=home&leftmenu=admintools', $langs->trans('InfoWebServer'), 1); |
|
724 | + $newmenu->add(BASE_URI.'?controller=admin/system&method=phpinfo&mainmenu=home&leftmenu=admintools', $langs->trans('InfoPHP'), 1); |
|
725 | 725 | //if (function_exists('xdebug_is_enabled')) $newmenu->add('/admin/system/xdebug.php', $langs->trans('XDebug'),1); |
726 | - $newmenu->add(BASE_URI . '?controller=admin/system&method=database&mainmenu=home&leftmenu=admintools', $langs->trans('InfoDatabase'), 1); |
|
726 | + $newmenu->add(BASE_URI.'?controller=admin/system&method=database&mainmenu=home&leftmenu=admintools', $langs->trans('InfoDatabase'), 1); |
|
727 | 727 | if (function_exists('eaccelerator_info')) { |
728 | - $newmenu->add(BASE_URI . "?controller=admin/tools&method=eaccelerator&mainmenu=home&leftmenu=admintools", $langs->trans("EAccelerator"), 1); |
|
728 | + $newmenu->add(BASE_URI."?controller=admin/tools&method=eaccelerator&mainmenu=home&leftmenu=admintools", $langs->trans("EAccelerator"), 1); |
|
729 | 729 | } |
730 | 730 | //$newmenu->add("/admin/system/perf.php?mainmenu=home&leftmenu=admintools", $langs->trans("InfoPerf"),1); |
731 | - $newmenu->add(BASE_URI . "?controller=admin/tools&method=dolibarr_export&mainmenu=home&leftmenu=admintools", $langs->trans("Backup"), 1); |
|
732 | - $newmenu->add(BASE_URI . "?controller=admin/tools&method=dolibarr_import&mainmenu=home&leftmenu=admintools", $langs->trans("Restore"), 1); |
|
733 | - $newmenu->add(BASE_URI . "?controller=admin/tools&method=update&mainmenu=home&leftmenu=admintools", $langs->trans("MenuUpgrade"), 1); |
|
734 | - $newmenu->add(BASE_URI . "?controller=admin/tools&method=purge&mainmenu=home&leftmenu=admintools", $langs->trans("Purge"), 1); |
|
735 | - $newmenu->add(BASE_URI . "?controller=admin/tools&method=listevents&mainmenu=home&leftmenu=admintools", $langs->trans("Audit"), 1); |
|
736 | - $newmenu->add(BASE_URI . "?controller=admin/tools&method=listsessions&mainmenu=home&leftmenu=admintools", $langs->trans("Sessions"), 1); |
|
737 | - $newmenu->add(BASE_URI . '?controller=admin/system&method=about&mainmenu=home&leftmenu=admintools', $langs->trans('ExternalResources'), 1); |
|
731 | + $newmenu->add(BASE_URI."?controller=admin/tools&method=dolibarr_export&mainmenu=home&leftmenu=admintools", $langs->trans("Backup"), 1); |
|
732 | + $newmenu->add(BASE_URI."?controller=admin/tools&method=dolibarr_import&mainmenu=home&leftmenu=admintools", $langs->trans("Restore"), 1); |
|
733 | + $newmenu->add(BASE_URI."?controller=admin/tools&method=update&mainmenu=home&leftmenu=admintools", $langs->trans("MenuUpgrade"), 1); |
|
734 | + $newmenu->add(BASE_URI."?controller=admin/tools&method=purge&mainmenu=home&leftmenu=admintools", $langs->trans("Purge"), 1); |
|
735 | + $newmenu->add(BASE_URI."?controller=admin/tools&method=listevents&mainmenu=home&leftmenu=admintools", $langs->trans("Audit"), 1); |
|
736 | + $newmenu->add(BASE_URI."?controller=admin/tools&method=listsessions&mainmenu=home&leftmenu=admintools", $langs->trans("Sessions"), 1); |
|
737 | + $newmenu->add(BASE_URI.'?controller=admin/system&method=about&mainmenu=home&leftmenu=admintools', $langs->trans('ExternalResources'), 1); |
|
738 | 738 | |
739 | 739 | if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { |
740 | 740 | $langs->load("products"); |
741 | 741 | //$newmenu->add("/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools", $langs->trans("ProductVatMassChange"), 1, $user->admin); |
742 | - $newmenu->add(BASE_URI . "?controller=product/admin&method=product_tools&mainmenu=home&leftmenu=admintools", $langs->trans("ProductVatMassChange"), 1, $user->admin); |
|
742 | + $newmenu->add(BASE_URI."?controller=product/admin&method=product_tools&mainmenu=home&leftmenu=admintools", $langs->trans("ProductVatMassChange"), 1, $user->admin); |
|
743 | 743 | } |
744 | 744 | } |
745 | 745 | |
746 | 746 | //$newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, $user->rights->user->user->lire, '', $mainmenu, 'users', 0, '', '', '', '<i class="fa fa-users fa-fw paddingright"></i>'); |
747 | - $newmenu->add(BASE_URI . "?controller=user&method=home&leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, $user->rights->user->user->lire, '', $mainmenu, 'users', 0, '', '', '', '<i class="fa fa-users fa-fw paddingright"></i>'); |
|
747 | + $newmenu->add(BASE_URI."?controller=user&method=home&leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, $user->rights->user->user->lire, '', $mainmenu, 'users', 0, '', '', '', '<i class="fa fa-users fa-fw paddingright"></i>'); |
|
748 | 748 | if ($user->rights->user->user->lire) { |
749 | 749 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "users") { |
750 | 750 | $newmenu->add("", $langs->trans("Users"), 1, $user->rights->user->user->lire || $user->admin); |
@@ -760,16 +760,16 @@ discard block |
||
760 | 760 | $newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, (($conf->global->MAIN_USE_ADVANCED_PERMS ? $user->rights->user->group_advance->write : $user->rights->user->user->creer) || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); |
761 | 761 | $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, (($conf->global->MAIN_USE_ADVANCED_PERMS ? $user->rights->user->group_advance->read : $user->rights->user->user->lire) || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); |
762 | 762 | */ |
763 | - $newmenu->add(BASE_URI . "?controller=user&method=card&leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->rights->user->user->creer || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE), '', 'home'); |
|
764 | - $newmenu->add(BASE_URI . "?controller=user&method=list&leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->rights->user->user->lire || $user->admin); |
|
765 | - $newmenu->add(BASE_URI . "?controller=user&method=hierarchy&leftmenu=users", $langs->trans("HierarchicView"), 2, $user->rights->user->user->lire || $user->admin); |
|
763 | + $newmenu->add(BASE_URI."?controller=user&method=card&leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->rights->user->user->creer || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE), '', 'home'); |
|
764 | + $newmenu->add(BASE_URI."?controller=user&method=list&leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->rights->user->user->lire || $user->admin); |
|
765 | + $newmenu->add(BASE_URI."?controller=user&method=hierarchy&leftmenu=users", $langs->trans("HierarchicView"), 2, $user->rights->user->user->lire || $user->admin); |
|
766 | 766 | if (!empty($conf->categorie->enabled)) { |
767 | 767 | $langs->load("categories"); |
768 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
|
768 | + $newmenu->add(BASE_URI."?controller=categories&method=index&leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
|
769 | 769 | } |
770 | 770 | $newmenu->add("", $langs->trans("Groups"), 1, ($user->rights->user->user->lire || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); |
771 | - $newmenu->add(BASE_URI . "?controller=user/group&method=card&leftmenu=users&action=create", $langs->trans("NewGroup"), 2, (($conf->global->MAIN_USE_ADVANCED_PERMS ? $user->rights->user->group_advance->write : $user->rights->user->user->creer) || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); |
|
772 | - $newmenu->add(BASE_URI . "?controller=user/group&method=list&leftmenu=users", $langs->trans("ListOfGroups"), 2, (($conf->global->MAIN_USE_ADVANCED_PERMS ? $user->rights->user->group_advance->read : $user->rights->user->user->lire) || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); |
|
771 | + $newmenu->add(BASE_URI."?controller=user/group&method=card&leftmenu=users&action=create", $langs->trans("NewGroup"), 2, (($conf->global->MAIN_USE_ADVANCED_PERMS ? $user->rights->user->group_advance->write : $user->rights->user->user->creer) || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); |
|
772 | + $newmenu->add(BASE_URI."?controller=user/group&method=list&leftmenu=users", $langs->trans("ListOfGroups"), 2, (($conf->global->MAIN_USE_ADVANCED_PERMS ? $user->rights->user->group_advance->read : $user->rights->user->user->lire) || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); |
|
773 | 773 | } |
774 | 774 | } |
775 | 775 | } |
@@ -782,26 +782,26 @@ discard block |
||
782 | 782 | if (!empty($conf->societe->enabled)) { |
783 | 783 | $langs->load("companies"); |
784 | 784 | //$newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->rights->societe->lire, '', $mainmenu, 'thirdparties'); |
785 | - $newmenu->add(BASE_URI . "?controller=societe&method=index&leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->rights->societe->lire, '', $mainmenu, 'thirdparties'); |
|
785 | + $newmenu->add(BASE_URI."?controller=societe&method=index&leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->rights->societe->lire, '', $mainmenu, 'thirdparties'); |
|
786 | 786 | |
787 | 787 | if ($user->rights->societe->creer) { |
788 | 788 | //$newmenu->add("/societe/card.php?action=create", $langs->trans("MenuNewThirdParty"), 1); |
789 | - $newmenu->add(BASE_URI . "?controller=societe&method=card&action=create", $langs->trans("MenuNewThirdParty"), 1); |
|
789 | + $newmenu->add(BASE_URI."?controller=societe&method=card&action=create", $langs->trans("MenuNewThirdParty"), 1); |
|
790 | 790 | if (!$conf->use_javascript_ajax) { |
791 | 791 | //$newmenu->add("/societe/card.php?action=create&private=1", $langs->trans("MenuNewPrivateIndividual"), 1); |
792 | - $newmenu->add(BASE_URI . "?controller=societe&method=card&action=create&private=1", $langs->trans("MenuNewPrivateIndividual"), 1); |
|
792 | + $newmenu->add(BASE_URI."?controller=societe&method=card&action=create&private=1", $langs->trans("MenuNewPrivateIndividual"), 1); |
|
793 | 793 | } |
794 | 794 | } |
795 | 795 | } |
796 | 796 | |
797 | 797 | //$newmenu->add("/societe/list.php?leftmenu=thirdparties", $langs->trans("List"), 1); |
798 | - $newmenu->add(BASE_URI . "?controller=societe&method=list&leftmenu=thirdparties", $langs->trans("List"), 1); |
|
798 | + $newmenu->add(BASE_URI."?controller=societe&method=list&leftmenu=thirdparties", $langs->trans("List"), 1); |
|
799 | 799 | |
800 | 800 | // Prospects |
801 | 801 | if (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { |
802 | 802 | $langs->load("commercial"); |
803 | 803 | //$newmenu->add("/societe/list.php?type=p&leftmenu=prospects", $langs->trans("ListProspectsShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'prospects'); |
804 | - $newmenu->add(BASE_URI . "?controller=societe&method=list&type=p&leftmenu=prospects", $langs->trans("ListProspectsShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'prospects'); |
|
804 | + $newmenu->add(BASE_URI."?controller=societe&method=list&type=p&leftmenu=prospects", $langs->trans("ListProspectsShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'prospects'); |
|
805 | 805 | /* no more required, there is a filter that can do more |
806 | 806 | if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->rights->societe->lire); |
807 | 807 | if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->rights->societe->lire); |
@@ -810,7 +810,7 @@ discard block |
||
810 | 810 | if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->rights->societe->lire); |
811 | 811 | */ |
812 | 812 | //$newmenu->add("/societe/card.php?leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 2, $user->rights->societe->creer); |
813 | - $newmenu->add(BASE_URI . "?controller=societe&method=card&leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 2, $user->rights->societe->creer); |
|
813 | + $newmenu->add(BASE_URI."?controller=societe&method=card&leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 2, $user->rights->societe->creer); |
|
814 | 814 | //$newmenu->add("/contact/list.php?leftmenu=customers&type=p", $langs->trans("Contacts"), 2, $user->rights->societe->contact->lire); |
815 | 815 | } |
816 | 816 | |
@@ -818,10 +818,10 @@ discard block |
||
818 | 818 | if (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { |
819 | 819 | $langs->load("commercial"); |
820 | 820 | //$newmenu->add("/societe/list.php?type=c&leftmenu=customers", $langs->trans("ListCustomersShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'customers'); |
821 | - $newmenu->add(BASE_URI . "?controller=societe&method=list&type=c&leftmenu=customers", $langs->trans("ListCustomersShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'customers'); |
|
821 | + $newmenu->add(BASE_URI."?controller=societe&method=list&type=c&leftmenu=customers", $langs->trans("ListCustomersShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'customers'); |
|
822 | 822 | |
823 | 823 | //$newmenu->add("/societe/card.php?leftmenu=customers&action=create&type=c", $langs->trans("MenuNewCustomer"), 2, $user->rights->societe->creer); |
824 | - $newmenu->add(BASE_URI . "?controller=societe&method=card&leftmenu=customers&action=create&type=c", $langs->trans("MenuNewCustomer"), 2, $user->rights->societe->creer); |
|
824 | + $newmenu->add(BASE_URI."?controller=societe&method=card&leftmenu=customers&action=create&type=c", $langs->trans("MenuNewCustomer"), 2, $user->rights->societe->creer); |
|
825 | 825 | //$newmenu->add("/contact/list.php?leftmenu=customers&type=c", $langs->trans("Contacts"), 2, $user->rights->societe->contact->lire); |
826 | 826 | } |
827 | 827 | |
@@ -830,8 +830,8 @@ discard block |
||
830 | 830 | $langs->load("suppliers"); |
831 | 831 | //$newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 1, ($user->rights->fournisseur->lire || $user->rights->supplier_proposal->lire), '', $mainmenu, 'suppliers'); |
832 | 832 | //$newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 2, $user->rights->societe->creer && ($user->rights->fournisseur->lire || $user->rights->supplier_proposal->lire)); |
833 | - $newmenu->add(BASE_URI . "?controller=societe&method=list&type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 1, ($user->rights->fournisseur->lire || $user->rights->supplier_proposal->lire), '', $mainmenu, 'suppliers'); |
|
834 | - $newmenu->add(BASE_URI . "?controller=societe&method=card&leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 2, $user->rights->societe->creer && ($user->rights->fournisseur->lire || $user->rights->supplier_proposal->lire)); |
|
833 | + $newmenu->add(BASE_URI."?controller=societe&method=list&type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 1, ($user->rights->fournisseur->lire || $user->rights->supplier_proposal->lire), '', $mainmenu, 'suppliers'); |
|
834 | + $newmenu->add(BASE_URI."?controller=societe&method=card&leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 2, $user->rights->societe->creer && ($user->rights->fournisseur->lire || $user->rights->supplier_proposal->lire)); |
|
835 | 835 | } |
836 | 836 | |
837 | 837 | // Categories |
@@ -847,12 +847,12 @@ discard block |
||
847 | 847 | $menutoshow = $langs->trans("ProspectsCategoriesShort"); |
848 | 848 | } |
849 | 849 | //$newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
850 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&leftmenu=cat&type=2", $menutoshow, 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
|
850 | + $newmenu->add(BASE_URI."?controller=categories&method=index&leftmenu=cat&type=2", $menutoshow, 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
|
851 | 851 | } |
852 | 852 | // Categories suppliers |
853 | 853 | if (!empty($conf->fournisseur->enabled)) { |
854 | 854 | //$newmenu->add("/categories/index.php?leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->rights->categorie->lire); |
855 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->rights->categorie->lire); |
|
855 | + $newmenu->add(BASE_URI."?controller=categories&method=index&leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->rights->categorie->lire); |
|
856 | 856 | } |
857 | 857 | } |
858 | 858 | |
@@ -860,30 +860,30 @@ discard block |
||
860 | 860 | //$newmenu->add("/societe/index.php?leftmenu=thirdparties", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->rights->societe->contact->lire, '', $mainmenu, 'contacts'); |
861 | 861 | //$newmenu->add("/contact/card.php?leftmenu=contacts&action=create", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->rights->societe->contact->creer); |
862 | 862 | //$newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire); |
863 | - $newmenu->add(BASE_URI . "?controller=societe&method=index&leftmenu=thirdparties", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->rights->societe->contact->lire, '', $mainmenu, 'contacts'); |
|
864 | - $newmenu->add(BASE_URI . "?controller=contact&method=card&leftmenu=contacts&action=create", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->rights->societe->contact->creer); |
|
865 | - $newmenu->add(BASE_URI . "?controller=contact&method=list&leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire); |
|
863 | + $newmenu->add(BASE_URI."?controller=societe&method=index&leftmenu=thirdparties", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->rights->societe->contact->lire, '', $mainmenu, 'contacts'); |
|
864 | + $newmenu->add(BASE_URI."?controller=contact&method=card&leftmenu=contacts&action=create", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->rights->societe->contact->creer); |
|
865 | + $newmenu->add(BASE_URI."?controller=contact&method=list&leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire); |
|
866 | 866 | if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { |
867 | 867 | //$newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->rights->societe->contact->lire); |
868 | - $newmenu->add(BASE_URI . "?controller=contact&method=list&leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->rights->societe->contact->lire); |
|
868 | + $newmenu->add(BASE_URI."?controller=contact&method=list&leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->rights->societe->contact->lire); |
|
869 | 869 | } |
870 | 870 | if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { |
871 | 871 | //$newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire); |
872 | - $newmenu->add(BASE_URI . "?controller=contact&method=list&leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire); |
|
872 | + $newmenu->add(BASE_URI."?controller=contact&method=list&leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire); |
|
873 | 873 | } |
874 | 874 | if (!empty($conf->fournisseur->enabled)) { |
875 | 875 | //$newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire); |
876 | - $newmenu->add(BASE_URI . "?controller=contact&method=list&leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire); |
|
876 | + $newmenu->add(BASE_URI."?controller=contact&method=list&leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire); |
|
877 | 877 | } |
878 | 878 | //$newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->rights->societe->contact->lire); |
879 | - $newmenu->add(BASE_URI . "?controller=contact&methos=list&leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->rights->societe->contact->lire); |
|
879 | + $newmenu->add(BASE_URI."?controller=contact&methos=list&leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->rights->societe->contact->lire); |
|
880 | 880 | //$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->rights->societe->contact->lire); |
881 | 881 | // Categories |
882 | 882 | if (!empty($conf->categorie->enabled)) { |
883 | 883 | $langs->load("categories"); |
884 | 884 | // Categories Contact |
885 | 885 | //$newmenu->add("/categories/index.php?leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
886 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
|
886 | + $newmenu->add(BASE_URI."?controller=categories&method=index&leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
|
887 | 887 | } |
888 | 888 | } |
889 | 889 | |
@@ -899,9 +899,9 @@ discard block |
||
899 | 899 | //$newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals', 100); |
900 | 900 | //$newmenu->add("/comm/propal/card.php?action=create&leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer); |
901 | 901 | //$newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->rights->propale->lire); |
902 | - $newmenu->add(BASE_URI . "?controller=comm/propal&method=index&leftmenu=propals", $langs->trans("Proposals"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals', 100); |
|
903 | - $newmenu->add(BASE_URI . "?controller=comm/propal&method=card&action=create&leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer); |
|
904 | - $newmenu->add(BASE_URI . "?controller=comm/propal&method=list&leftmenu=propals", $langs->trans("List"), 1, $user->rights->propale->lire); |
|
902 | + $newmenu->add(BASE_URI."?controller=comm/propal&method=index&leftmenu=propals", $langs->trans("Proposals"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals', 100); |
|
903 | + $newmenu->add(BASE_URI."?controller=comm/propal&method=card&action=create&leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer); |
|
904 | + $newmenu->add(BASE_URI."?controller=comm/propal&method=list&leftmenu=propals", $langs->trans("List"), 1, $user->rights->propale->lire); |
|
905 | 905 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "propals") { |
906 | 906 | /* |
907 | 907 | $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=0", $langs->trans("PropalsDraft"), 2, $user->rights->propale->lire); |
@@ -910,15 +910,15 @@ discard block |
||
910 | 910 | $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=3", $langs->trans("PropalStatusNotSigned"), 2, $user->rights->propale->lire); |
911 | 911 | $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=4", $langs->trans("PropalStatusBilled"), 2, $user->rights->propale->lire); |
912 | 912 | */ |
913 | - $newmenu->add(BASE_URI . "?controller=comm/propal&method=list&leftmenu=propals&viewstatut=0", $langs->trans("PropalsDraft"), 2, $user->rights->propale->lire); |
|
914 | - $newmenu->add(BASE_URI . "?controller=comm/propal&method=list&leftmenu=propals&viewstatut=1", $langs->trans("PropalsOpened"), 2, $user->rights->propale->lire); |
|
915 | - $newmenu->add(BASE_URI . "?controller=comm/propal&method=list&leftmenu=propals&viewstatut=2", $langs->trans("PropalStatusSigned"), 2, $user->rights->propale->lire); |
|
916 | - $newmenu->add(BASE_URI . "?controller=comm/propal&method=list&leftmenu=propals&viewstatut=3", $langs->trans("PropalStatusNotSigned"), 2, $user->rights->propale->lire); |
|
917 | - $newmenu->add(BASE_URI . "?controller=comm/propal&method=list&leftmenu=propals&viewstatut=4", $langs->trans("PropalStatusBilled"), 2, $user->rights->propale->lire); |
|
913 | + $newmenu->add(BASE_URI."?controller=comm/propal&method=list&leftmenu=propals&viewstatut=0", $langs->trans("PropalsDraft"), 2, $user->rights->propale->lire); |
|
914 | + $newmenu->add(BASE_URI."?controller=comm/propal&method=list&leftmenu=propals&viewstatut=1", $langs->trans("PropalsOpened"), 2, $user->rights->propale->lire); |
|
915 | + $newmenu->add(BASE_URI."?controller=comm/propal&method=list&leftmenu=propals&viewstatut=2", $langs->trans("PropalStatusSigned"), 2, $user->rights->propale->lire); |
|
916 | + $newmenu->add(BASE_URI."?controller=comm/propal&method=list&leftmenu=propals&viewstatut=3", $langs->trans("PropalStatusNotSigned"), 2, $user->rights->propale->lire); |
|
917 | + $newmenu->add(BASE_URI."?controller=comm/propal&method=list&leftmenu=propals&viewstatut=4", $langs->trans("PropalStatusBilled"), 2, $user->rights->propale->lire); |
|
918 | 918 | //$newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->rights->propale->lire); |
919 | 919 | } |
920 | 920 | //$newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->rights->propale->lire); |
921 | - $newmenu->add(BASE_URI . "?controller=comm/propal/stats&method=index&leftmenu=propals", $langs->trans("Statistics"), 1, $user->rights->propale->lire); |
|
921 | + $newmenu->add(BASE_URI."?controller=comm/propal/stats&method=index&leftmenu=propals", $langs->trans("Statistics"), 1, $user->rights->propale->lire); |
|
922 | 922 | } |
923 | 923 | |
924 | 924 | // Customers orders |
@@ -927,26 +927,26 @@ discard block |
||
927 | 927 | //$newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 200); |
928 | 928 | //$newmenu->add("/commande/card.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer); |
929 | 929 | //$newmenu->add("/commande/list.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire); |
930 | - $newmenu->add(BASE_URI . "?controller=commande&method=index&leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 200); |
|
931 | - $newmenu->add(BASE_URI . "?controller=commande&method=card&action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer); |
|
932 | - $newmenu->add(BASE_URI . "?controller=commande&method=list&leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire); |
|
930 | + $newmenu->add(BASE_URI."?controller=commande&method=index&leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 200); |
|
931 | + $newmenu->add(BASE_URI."?controller=commande&method=card&action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer); |
|
932 | + $newmenu->add(BASE_URI."?controller=commande&method=list&leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire); |
|
933 | 933 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders") { |
934 | 934 | //$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); |
935 | 935 | //$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); |
936 | - $newmenu->add(BASE_URI . "?controller=commande&method=list&leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); |
|
937 | - $newmenu->add(BASE_URI . "?controller=commande&method=list&leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); |
|
936 | + $newmenu->add(BASE_URI."?controller=commande&method=list&leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); |
|
937 | + $newmenu->add(BASE_URI."?controller=commande&method=list&leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); |
|
938 | 938 | if (!empty($conf->expedition->enabled)) { |
939 | 939 | //$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderSentShort"), 2, $user->rights->commande->lire); |
940 | - $newmenu->add(BASE_URI . "?controller=commande&method=list&leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderSentShort"), 2, $user->rights->commande->lire); |
|
940 | + $newmenu->add(BASE_URI."?controller=commande&method=list&leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderSentShort"), 2, $user->rights->commande->lire); |
|
941 | 941 | } |
942 | 942 | //$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=3", $langs->trans("StatusOrderDelivered"), 2, $user->rights->commande->lire); |
943 | - $newmenu->add(BASE_URI . "?controller=commande&method=list&leftmenu=orders&viewstatut=3", $langs->trans("StatusOrderDelivered"), 2, $user->rights->commande->lire); |
|
943 | + $newmenu->add(BASE_URI."?controller=commande&method=list&leftmenu=orders&viewstatut=3", $langs->trans("StatusOrderDelivered"), 2, $user->rights->commande->lire); |
|
944 | 944 | //$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire); |
945 | 945 | //$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire); |
946 | - $newmenu->add(BASE_URI . "?controller=commande&method=list&leftmenu=orders&viewstatut=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire); |
|
946 | + $newmenu->add(BASE_URI."?controller=commande&method=list&leftmenu=orders&viewstatut=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire); |
|
947 | 947 | } |
948 | 948 | //$newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire); |
949 | - $newmenu->add(BASE_URI . "?controller=commande/stats&method=index&leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire); |
|
949 | + $newmenu->add(BASE_URI."?controller=commande/stats&method=index&leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire); |
|
950 | 950 | } |
951 | 951 | |
952 | 952 | // Suppliers orders |
@@ -955,16 +955,16 @@ discard block |
||
955 | 955 | //$newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers', 400); |
956 | 956 | //$newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer); |
957 | 957 | //$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire); |
958 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=index&leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers', 400); |
|
959 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=card&action=create&leftmenu=orders_suppliers", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer); |
|
960 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire); |
|
958 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=index&leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers', 400); |
|
959 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=card&action=create&leftmenu=orders_suppliers", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer); |
|
960 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire); |
|
961 | 961 | |
962 | 962 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders_suppliers") { |
963 | 963 | //$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->fournisseur->commande->lire); |
964 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->fournisseur->commande->lire); |
|
964 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->fournisseur->commande->lire); |
|
965 | 965 | if (empty($conf->global->SUPPLIER_ORDER_HIDE_VALIDATED)) { |
966 | 966 | //$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->fournisseur->commande->lire); |
967 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->fournisseur->commande->lire); |
|
967 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->fournisseur->commande->lire); |
|
968 | 968 | } |
969 | 969 | /* |
970 | 970 | $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans("StatusOrderApprovedShort"), 2, $user->rights->fournisseur->commande->lire); |
@@ -974,16 +974,16 @@ discard block |
||
974 | 974 | $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusOrderCanceled"), 2, $user->rights->fournisseur->commande->lire); |
975 | 975 | $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusOrderRefused"), 2, $user->rights->fournisseur->commande->lire); |
976 | 976 | */ |
977 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=2", $langs->trans("StatusOrderApprovedShort"), 2, $user->rights->fournisseur->commande->lire); |
|
978 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=3", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->fournisseur->commande->lire); |
|
979 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=4", $langs->trans("StatusOrderReceivedPartiallyShort"), 2, $user->rights->fournisseur->commande->lire); |
|
980 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=5", $langs->trans("StatusOrderReceivedAll"), 2, $user->rights->fournisseur->commande->lire); |
|
981 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusOrderCanceled"), 2, $user->rights->fournisseur->commande->lire); |
|
982 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=9", $langs->trans("StatusOrderRefused"), 2, $user->rights->fournisseur->commande->lire); |
|
977 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=2", $langs->trans("StatusOrderApprovedShort"), 2, $user->rights->fournisseur->commande->lire); |
|
978 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=3", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->fournisseur->commande->lire); |
|
979 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=4", $langs->trans("StatusOrderReceivedPartiallyShort"), 2, $user->rights->fournisseur->commande->lire); |
|
980 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=5", $langs->trans("StatusOrderReceivedAll"), 2, $user->rights->fournisseur->commande->lire); |
|
981 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusOrderCanceled"), 2, $user->rights->fournisseur->commande->lire); |
|
982 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=9", $langs->trans("StatusOrderRefused"), 2, $user->rights->fournisseur->commande->lire); |
|
983 | 983 | } |
984 | 984 | // Billed is another field. We should add instead a dedicated filter on list. if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&billed=1", $langs->trans("StatusOrderBilled"), 2, $user->rights->fournisseur->commande->lire); |
985 | 985 | //$newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); |
986 | - $newmenu->add(BASE_URI . "?controller=commande/stats&method=index&leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); |
|
986 | + $newmenu->add(BASE_URI."?controller=commande/stats&method=index&leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); |
|
987 | 987 | } |
988 | 988 | |
989 | 989 | // Contrat |
@@ -995,10 +995,10 @@ discard block |
||
995 | 995 | $newmenu->add("/contrat/list.php?leftmenu=contracts", $langs->trans("List"), 1, $user->rights->contrat->lire); |
996 | 996 | $newmenu->add("/contrat/services_list.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->rights->contrat->lire); |
997 | 997 | */ |
998 | - $newmenu->add(BASE_URI . "?controller=contrat&method=index&leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->rights->contrat->lire, '', $mainmenu, 'contracts', 2000); |
|
999 | - $newmenu->add(BASE_URI . "?controller=contrat&method=card&action=create&leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->rights->contrat->creer); |
|
1000 | - $newmenu->add(BASE_URI . "?controller=contrat&method=list&leftmenu=contracts", $langs->trans("List"), 1, $user->rights->contrat->lire); |
|
1001 | - $newmenu->add(BASE_URI . "?controller=contrat&method=services_list&leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->rights->contrat->lire); |
|
998 | + $newmenu->add(BASE_URI."?controller=contrat&method=index&leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->rights->contrat->lire, '', $mainmenu, 'contracts', 2000); |
|
999 | + $newmenu->add(BASE_URI."?controller=contrat&method=card&action=create&leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->rights->contrat->creer); |
|
1000 | + $newmenu->add(BASE_URI."?controller=contrat&method=list&leftmenu=contracts", $langs->trans("List"), 1, $user->rights->contrat->lire); |
|
1001 | + $newmenu->add(BASE_URI."?controller=contrat&method=services_list&leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->rights->contrat->lire); |
|
1002 | 1002 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "contracts") { |
1003 | 1003 | /* |
1004 | 1004 | $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=0", $langs->trans("MenuInactiveServices"), 2, $user->rights->contrat->lire); |
@@ -1006,10 +1006,10 @@ discard block |
||
1006 | 1006 | $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->rights->contrat->lire); |
1007 | 1007 | $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=5", $langs->trans("MenuClosedServices"), 2, $user->rights->contrat->lire); |
1008 | 1008 | */ |
1009 | - $newmenu->add(BASE_URI . "?controller=contrat&method=services_list&leftmenu=contracts&mode=0", $langs->trans("MenuInactiveServices"), 2, $user->rights->contrat->lire); |
|
1010 | - $newmenu->add(BASE_URI . "?controller=contrat&method=services_list&leftmenu=contracts&mode=4", $langs->trans("MenuRunningServices"), 2, $user->rights->contrat->lire); |
|
1011 | - $newmenu->add(BASE_URI . "?controller=contrat&method=services_list&leftmenu=contracts&mode=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->rights->contrat->lire); |
|
1012 | - $newmenu->add(BASE_URI . "?controller=contrat&method=services_list&leftmenu=contracts&mode=5", $langs->trans("MenuClosedServices"), 2, $user->rights->contrat->lire); |
|
1009 | + $newmenu->add(BASE_URI."?controller=contrat&method=services_list&leftmenu=contracts&mode=0", $langs->trans("MenuInactiveServices"), 2, $user->rights->contrat->lire); |
|
1010 | + $newmenu->add(BASE_URI."?controller=contrat&method=services_list&leftmenu=contracts&mode=4", $langs->trans("MenuRunningServices"), 2, $user->rights->contrat->lire); |
|
1011 | + $newmenu->add(BASE_URI."?controller=contrat&method=services_list&leftmenu=contracts&mode=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->rights->contrat->lire); |
|
1012 | + $newmenu->add(BASE_URI."?controller=contrat&method=services_list&leftmenu=contracts&mode=5", $langs->trans("MenuClosedServices"), 2, $user->rights->contrat->lire); |
|
1013 | 1013 | } |
1014 | 1014 | } |
1015 | 1015 | |
@@ -1023,11 +1023,11 @@ discard block |
||
1023 | 1023 | $newmenu->add("/fichinter/card-red.php?leftmenu=ficheinter", $langs->trans("ModelList"), 1, $user->rights->ficheinter->lire, '', '', '', 203); |
1024 | 1024 | $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); |
1025 | 1025 | */ |
1026 | - $newmenu->add(BASE_URI . "?controller=fichinter&method=index&leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200); |
|
1027 | - $newmenu->add(BASE_URI . "?controller=fichinter&method=card&action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201); |
|
1028 | - $newmenu->add(BASE_URI . "?controller=fichinter&method=list&leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202); |
|
1029 | - $newmenu->add(BASE_URI . "?controller=fichinter&method=card-red&leftmenu=ficheinter", $langs->trans("ModelList"), 1, $user->rights->ficheinter->lire, '', '', '', 203); |
|
1030 | - $newmenu->add(BASE_URI . "?controller=fichinter/stats&method=index&leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); |
|
1026 | + $newmenu->add(BASE_URI."?controller=fichinter&method=index&leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200); |
|
1027 | + $newmenu->add(BASE_URI."?controller=fichinter&method=card&action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201); |
|
1028 | + $newmenu->add(BASE_URI."?controller=fichinter&method=list&leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202); |
|
1029 | + $newmenu->add(BASE_URI."?controller=fichinter&method=card-red&leftmenu=ficheinter", $langs->trans("ModelList"), 1, $user->rights->ficheinter->lire, '', '', '', 203); |
|
1030 | + $newmenu->add(BASE_URI."?controller=fichinter/stats&method=index&leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); |
|
1031 | 1031 | } |
1032 | 1032 | } |
1033 | 1033 | |
@@ -1045,9 +1045,9 @@ discard block |
||
1045 | 1045 | $newmenu->add("/compta/facture/card.php?action=create", $langs->trans("NewBill"), 1, $user->rights->facture->creer); |
1046 | 1046 | $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills", $langs->trans("List"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_list'); |
1047 | 1047 | */ |
1048 | - $newmenu->add(BASE_URI . "?controller=compta/facture&method=list&leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->rights->facture->lire, '', $mainmenu, 'customers_bills'); |
|
1049 | - $newmenu->add(BASE_URI . "?controller=compta/facture&method=card&action=create", $langs->trans("NewBill"), 1, $user->rights->facture->creer); |
|
1050 | - $newmenu->add(BASE_URI . "?controller=compta/facture&method=list&leftmenu=customers_bills", $langs->trans("List"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_list'); |
|
1048 | + $newmenu->add(BASE_URI."?controller=compta/facture&method=list&leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->rights->facture->lire, '', $mainmenu, 'customers_bills'); |
|
1049 | + $newmenu->add(BASE_URI."?controller=compta/facture&method=card&action=create", $langs->trans("NewBill"), 1, $user->rights->facture->creer); |
|
1050 | + $newmenu->add(BASE_URI."?controller=compta/facture&method=list&leftmenu=customers_bills", $langs->trans("List"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_list'); |
|
1051 | 1051 | |
1052 | 1052 | if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills(|_draft|_notpaid|_paid|_canceled)$/', $leftmenu)) { |
1053 | 1053 | /* |
@@ -1056,24 +1056,24 @@ discard block |
||
1056 | 1056 | $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->rights->facture->lire); |
1057 | 1057 | $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3", $langs->trans("BillShortStatusCanceled"), 2, $user->rights->facture->lire); |
1058 | 1058 | */ |
1059 | - $newmenu->add(BASE_URI . "?controller=compta/facture&method=list&leftmenu=customers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->rights->facture->lire); |
|
1060 | - $newmenu->add(BASE_URI . "?controller=compta/facture&method=list&leftmenu=customers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->rights->facture->lire); |
|
1061 | - $newmenu->add(BASE_URI . "?controller=compta/facture&method=list&leftmenu=customers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->rights->facture->lire); |
|
1062 | - $newmenu->add(BASE_URI . "?controller=compta/facture&method=list&leftmenu=customers_bills_canceled&search_status=3", $langs->trans("BillShortStatusCanceled"), 2, $user->rights->facture->lire); |
|
1059 | + $newmenu->add(BASE_URI."?controller=compta/facture&method=list&leftmenu=customers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->rights->facture->lire); |
|
1060 | + $newmenu->add(BASE_URI."?controller=compta/facture&method=list&leftmenu=customers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->rights->facture->lire); |
|
1061 | + $newmenu->add(BASE_URI."?controller=compta/facture&method=list&leftmenu=customers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->rights->facture->lire); |
|
1062 | + $newmenu->add(BASE_URI."?controller=compta/facture&method=list&leftmenu=customers_bills_canceled&search_status=3", $langs->trans("BillShortStatusCanceled"), 2, $user->rights->facture->lire); |
|
1063 | 1063 | } |
1064 | 1064 | //$newmenu->add("/compta/facture/invoicetemplate_list.php?leftmenu=customers_bills_templates", $langs->trans("ListOfTemplates"), 1, $user->rights->facture->creer, '', $mainmenu, 'customers_bills_templates'); // No need to see recurring invoices, if user has no permission to create invoice. |
1065 | 1065 | //$newmenu->add("/compta/paiement/list.php?leftmenu=customers_bills_payment", $langs->trans("Payments"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_payment'); |
1066 | - $newmenu->add(BASE_URI . "?controller=compta/facture&method=invoicetemplate_list&leftmenu=customers_bills_templates", $langs->trans("ListOfTemplates"), 1, $user->rights->facture->creer, '', $mainmenu, 'customers_bills_templates'); // No need to see recurring invoices, if user has no permission to create invoice. |
|
1067 | - $newmenu->add(BASE_URI . "?controller=compta/paiement&method=list&leftmenu=customers_bills_payment", $langs->trans("Payments"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_payment'); |
|
1066 | + $newmenu->add(BASE_URI."?controller=compta/facture&method=invoicetemplate_list&leftmenu=customers_bills_templates", $langs->trans("ListOfTemplates"), 1, $user->rights->facture->creer, '', $mainmenu, 'customers_bills_templates'); // No need to see recurring invoices, if user has no permission to create invoice. |
|
1067 | + $newmenu->add(BASE_URI."?controller=compta/paiement&method=list&leftmenu=customers_bills_payment", $langs->trans("Payments"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_payment'); |
|
1068 | 1068 | |
1069 | 1069 | if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { |
1070 | 1070 | //$newmenu->add("/compta/paiement/tovalidate.php?leftmenu=customers_bills_tovalid", $langs->trans("MenuToValid"), 2, $user->rights->facture->lire, '', $mainmenu, 'customer_bills_tovalid'); |
1071 | - $newmenu->add(BASE_URI . "?controller=compta/paiement&method=tovalidate&leftmenu=customers_bills_tovalid", $langs->trans("MenuToValid"), 2, $user->rights->facture->lire, '', $mainmenu, 'customer_bills_tovalid'); |
|
1071 | + $newmenu->add(BASE_URI."?controller=compta/paiement&method=tovalidate&leftmenu=customers_bills_tovalid", $langs->trans("MenuToValid"), 2, $user->rights->facture->lire, '', $mainmenu, 'customer_bills_tovalid'); |
|
1072 | 1072 | } |
1073 | 1073 | //$newmenu->add("/compta/paiement/rapport.php?leftmenu=customers_bills_reports", $langs->trans("Reportings"), 2, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_reports'); |
1074 | 1074 | //$newmenu->add("/compta/facture/stats/index.php?leftmenu=customers_bills_stats", $langs->trans("Statistics"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_stats'); |
1075 | - $newmenu->add(BASE_URI . "?controller=compta/paiement&method=rapport&leftmenu=customers_bills_reports", $langs->trans("Reportings"), 2, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_reports'); |
|
1076 | - $newmenu->add(BASE_URI . "?controller=compta/facture/stats&method=index&leftmenu=customers_bills_stats", $langs->trans("Statistics"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_stats'); |
|
1075 | + $newmenu->add(BASE_URI."?controller=compta/paiement&method=rapport&leftmenu=customers_bills_reports", $langs->trans("Reportings"), 2, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_reports'); |
|
1076 | + $newmenu->add(BASE_URI."?controller=compta/facture/stats&method=index&leftmenu=customers_bills_stats", $langs->trans("Statistics"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_stats'); |
|
1077 | 1077 | } |
1078 | 1078 | |
1079 | 1079 | // Suppliers invoices |
@@ -1082,25 +1082,25 @@ discard block |
||
1082 | 1082 | //$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills'); |
1083 | 1083 | //$newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, $user->rights->fournisseur->facture->creer, '', $mainmenu, 'suppliers_bills_create'); |
1084 | 1084 | //$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_list'); |
1085 | - $newmenu->add(BASE_URI . "?controller=fourn/facture&method=list&leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills'); |
|
1086 | - $newmenu->add(BASE_URI . "?controller=fourn/facture&method=card&leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, $user->rights->fournisseur->facture->creer, '', $mainmenu, 'suppliers_bills_create'); |
|
1087 | - $newmenu->add(BASE_URI . "?controller=fourn/facture&method=list&leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_list'); |
|
1085 | + $newmenu->add(BASE_URI."?controller=fourn/facture&method=list&leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills'); |
|
1086 | + $newmenu->add(BASE_URI."?controller=fourn/facture&method=card&leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, $user->rights->fournisseur->facture->creer, '', $mainmenu, 'suppliers_bills_create'); |
|
1087 | + $newmenu->add(BASE_URI."?controller=fourn/facture&method=list&leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_list'); |
|
1088 | 1088 | |
1089 | 1089 | if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) { |
1090 | 1090 | //$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_draft'); |
1091 | 1091 | //$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_notpaid'); |
1092 | 1092 | //$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_paid'); |
1093 | - $newmenu->add(BASE_URI . "?controller=fourn/facture&method=list&leftmenu=suppliers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_draft'); |
|
1094 | - $newmenu->add(BASE_URI . "?controller=fourn/facture&method=list&leftmenu=suppliers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_notpaid'); |
|
1095 | - $newmenu->add(BASE_URI . "?controller=fourn/facture&method=list&leftmenu=suppliers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_paid'); |
|
1093 | + $newmenu->add(BASE_URI."?controller=fourn/facture&method=list&leftmenu=suppliers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_draft'); |
|
1094 | + $newmenu->add(BASE_URI."?controller=fourn/facture&method=list&leftmenu=suppliers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_notpaid'); |
|
1095 | + $newmenu->add(BASE_URI."?controller=fourn/facture&method=list&leftmenu=suppliers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_paid'); |
|
1096 | 1096 | } |
1097 | 1097 | |
1098 | 1098 | //$newmenu->add("/fourn/facture/paiement.php?leftmenu=suppliers_bills_payment", $langs->trans("Payments"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_payment'); |
1099 | 1099 | //$newmenu->add("/fourn/facture/rapport.php?leftmenu=suppliers_bills_report", $langs->trans("Reportings"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_report'); |
1100 | 1100 | //$newmenu->add("/compta/facture/stats/index.php?mode=supplier&leftmenu=suppliers_bills_stats", $langs->trans("Statistics"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_stats'); |
1101 | - $newmenu->add(BASE_URI . "?controller=fourn/facture&method=paiement&leftmenu=suppliers_bills_payment", $langs->trans("Payments"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_payment'); |
|
1102 | - $newmenu->add(BASE_URI . "?controller=fourn/facture&method=rapport&leftmenu=suppliers_bills_report", $langs->trans("Reportings"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_report'); |
|
1103 | - $newmenu->add(BASE_URI . "?controller=compta/facture/stats&method=index&mode=supplier&leftmenu=suppliers_bills_stats", $langs->trans("Statistics"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_stats'); |
|
1101 | + $newmenu->add(BASE_URI."?controller=fourn/facture&method=paiement&leftmenu=suppliers_bills_payment", $langs->trans("Payments"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_payment'); |
|
1102 | + $newmenu->add(BASE_URI."?controller=fourn/facture&method=rapport&leftmenu=suppliers_bills_report", $langs->trans("Reportings"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_report'); |
|
1103 | + $newmenu->add(BASE_URI."?controller=compta/facture/stats&method=index&mode=supplier&leftmenu=suppliers_bills_stats", $langs->trans("Statistics"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_stats'); |
|
1104 | 1104 | } |
1105 | 1105 | |
1106 | 1106 | // Orders |
@@ -1108,7 +1108,7 @@ discard block |
||
1108 | 1108 | $langs->load("orders"); |
1109 | 1109 | if (!empty($conf->facture->enabled)) { |
1110 | 1110 | //$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); |
1111 | - $newmenu->add(BASE_URI . "?controller=commande&method=list&leftmenu=orders&viewstatut=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); |
|
1111 | + $newmenu->add(BASE_URI."?controller=commande&method=list&leftmenu=orders&viewstatut=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); |
|
1112 | 1112 | } |
1113 | 1113 | // if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire); |
1114 | 1114 | } |
@@ -1118,7 +1118,7 @@ discard block |
||
1118 | 1118 | if (!empty($conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE)) { |
1119 | 1119 | $langs->load("supplier"); |
1120 | 1120 | //$newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); |
1121 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders&search_status=5&billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); |
|
1121 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders&search_status=5&billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); |
|
1122 | 1122 | // if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire); |
1123 | 1123 | } |
1124 | 1124 | } |
@@ -1128,12 +1128,12 @@ discard block |
||
1128 | 1128 | if (!empty($conf->don->enabled)) { |
1129 | 1129 | $langs->load("donations"); |
1130 | 1130 | //$newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing", $langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations'); |
1131 | - $newmenu->add(BASE_URI . "?controller=don&method=index&leftmenu=donations&mainmenu=billing", $langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations'); |
|
1131 | + $newmenu->add(BASE_URI."?controller=don&method=index&leftmenu=donations&mainmenu=billing", $langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations'); |
|
1132 | 1132 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "donations") { |
1133 | 1133 | //$newmenu->add("/don/card.php?leftmenu=donations&action=create", $langs->trans("NewDonation"), 1, $user->rights->don->creer); |
1134 | 1134 | //$newmenu->add("/don/list.php?leftmenu=donations", $langs->trans("List"), 1, $user->rights->don->lire); |
1135 | - $newmenu->add(BASE_URI . "?controller=don&method=card&leftmenu=donations&action=create", $langs->trans("NewDonation"), 1, $user->rights->don->creer); |
|
1136 | - $newmenu->add(BASE_URI . "?controller=don&method=list&leftmenu=donations", $langs->trans("List"), 1, $user->rights->don->lire); |
|
1135 | + $newmenu->add(BASE_URI."?controller=don&method=card&leftmenu=donations&action=create", $langs->trans("NewDonation"), 1, $user->rights->don->creer); |
|
1136 | + $newmenu->add(BASE_URI."?controller=don&method=list&leftmenu=donations", $langs->trans("List"), 1, $user->rights->don->lire); |
|
1137 | 1137 | } |
1138 | 1138 | // if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",$langs->trans("Statistics"), 1, $user->rights->don->lire); |
1139 | 1139 | } |
@@ -1144,24 +1144,24 @@ discard block |
||
1144 | 1144 | |
1145 | 1145 | $permtoshowmenu = ((!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) || (!empty($conf->loan->enabled) && $user->rights->loan->read) || (!empty($conf->banque->enabled) && $user->rights->banque->lire)); |
1146 | 1146 | //$newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax'); |
1147 | - $newmenu->add(BASE_URI . "?controller=compta/charges&method=index&leftmenu=tax&mainmenu=billing", $langs->trans("MenuSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax'); |
|
1147 | + $newmenu->add(BASE_URI."?controller=compta/charges&method=index&leftmenu=tax&mainmenu=billing", $langs->trans("MenuSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax'); |
|
1148 | 1148 | |
1149 | 1149 | // Social contributions |
1150 | 1150 | if (!empty($conf->tax->enabled)) { |
1151 | 1151 | //$newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->rights->tax->charges->lire); |
1152 | - $newmenu->add(BASE_URI . "?controller=compta/sociales&method=list&leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->rights->tax->charges->lire); |
|
1152 | + $newmenu->add(BASE_URI."?controller=compta/sociales&method=list&leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->rights->tax->charges->lire); |
|
1153 | 1153 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i', $leftmenu)) { |
1154 | 1154 | //$newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create", $langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer); |
1155 | 1155 | //$newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("List"), 2, $user->rights->tax->charges->lire); |
1156 | 1156 | //$newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing&mode=sconly", $langs->trans("Payments"), 2, $user->rights->tax->charges->lire); |
1157 | - $newmenu->add(BASE_URI . "?controller=compta/sociales&method=card&leftmenu=tax_social&action=create", $langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer); |
|
1158 | - $newmenu->add(BASE_URI . "?controller=compta/sociales&method=list&leftmenu=tax_social", $langs->trans("List"), 2, $user->rights->tax->charges->lire); |
|
1159 | - $newmenu->add(BASE_URI . "?controller=compta/sociales&method=payments&leftmenu=tax_social&mainmenu=billing&mode=sconly", $langs->trans("Payments"), 2, $user->rights->tax->charges->lire); |
|
1157 | + $newmenu->add(BASE_URI."?controller=compta/sociales&method=card&leftmenu=tax_social&action=create", $langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer); |
|
1158 | + $newmenu->add(BASE_URI."?controller=compta/sociales&method=list&leftmenu=tax_social", $langs->trans("List"), 2, $user->rights->tax->charges->lire); |
|
1159 | + $newmenu->add(BASE_URI."?controller=compta/sociales&method=payments&leftmenu=tax_social&mainmenu=billing&mode=sconly", $langs->trans("Payments"), 2, $user->rights->tax->charges->lire); |
|
1160 | 1160 | } |
1161 | 1161 | // VAT |
1162 | 1162 | if (empty($conf->global->TAX_DISABLE_VAT_MENUS)) { |
1163 | 1163 | //$newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing", $langs->transcountry("VAT", $mysoc->country_code), 1, $user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat'); |
1164 | - $newmenu->add(BASE_URI . "?controller=compta/tva&method=list&leftmenu=tax_vat&mainmenu=billing", $langs->transcountry("VAT", $mysoc->country_code), 1, $user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat'); |
|
1164 | + $newmenu->add(BASE_URI."?controller=compta/tva&method=list&leftmenu=tax_vat&mainmenu=billing", $langs->transcountry("VAT", $mysoc->country_code), 1, $user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat'); |
|
1165 | 1165 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i', $leftmenu)) { |
1166 | 1166 | /* |
1167 | 1167 | $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create", $langs->trans("New"), 2, $user->rights->tax->charges->creer); |
@@ -1170,18 +1170,18 @@ discard block |
||
1170 | 1170 | $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); |
1171 | 1171 | $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); |
1172 | 1172 | */ |
1173 | - $newmenu->add(BASE_URI . "?controller=compta/tva&method=card&leftmenu=tax_vat&action=create", $langs->trans("New"), 2, $user->rights->tax->charges->creer); |
|
1174 | - $newmenu->add(BASE_URI . "?controller=compta/tva&method=list&leftmenu=tax_vat", $langs->trans("List"), 2, $user->rights->tax->charges->lire); |
|
1175 | - $newmenu->add(BASE_URI . "?controller=compta/tva&method=index&leftmenu=tax_vat", $langs->trans("ReportByMonth"), 2, $user->rights->tax->charges->lire); |
|
1176 | - $newmenu->add(BASE_URI . "?controller=compta/tva&method=clients&leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); |
|
1177 | - $newmenu->add(BASE_URI . "?controller=compta/tva&method=quadri_detail&leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); |
|
1173 | + $newmenu->add(BASE_URI."?controller=compta/tva&method=card&leftmenu=tax_vat&action=create", $langs->trans("New"), 2, $user->rights->tax->charges->creer); |
|
1174 | + $newmenu->add(BASE_URI."?controller=compta/tva&method=list&leftmenu=tax_vat", $langs->trans("List"), 2, $user->rights->tax->charges->lire); |
|
1175 | + $newmenu->add(BASE_URI."?controller=compta/tva&method=index&leftmenu=tax_vat", $langs->trans("ReportByMonth"), 2, $user->rights->tax->charges->lire); |
|
1176 | + $newmenu->add(BASE_URI."?controller=compta/tva&method=clients&leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); |
|
1177 | + $newmenu->add(BASE_URI."?controller=compta/tva&method=quadri_detail&leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); |
|
1178 | 1178 | } |
1179 | 1179 | global $mysoc; |
1180 | 1180 | |
1181 | 1181 | //Local Taxes 1 |
1182 | 1182 | if ($mysoc->useLocalTax(1) && (isset($mysoc->localtax1_assuj) && $mysoc->localtax1_assuj == "1")) { |
1183 | 1183 | //$newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1", $langs->transcountry("LT1", $mysoc->country_code), 1, $user->rights->tax->charges->lire); |
1184 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=list&leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1", $langs->transcountry("LT1", $mysoc->country_code), 1, $user->rights->tax->charges->lire); |
|
1184 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=list&leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1", $langs->transcountry("LT1", $mysoc->country_code), 1, $user->rights->tax->charges->lire); |
|
1185 | 1185 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i', $leftmenu)) { |
1186 | 1186 | /* |
1187 | 1187 | $newmenu->add("/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&localTaxType=1", $langs->trans("New"), 2, $user->rights->tax->charges->creer); |
@@ -1190,17 +1190,17 @@ discard block |
||
1190 | 1190 | $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); |
1191 | 1191 | $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); |
1192 | 1192 | */ |
1193 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=card&leftmenu=tax_1_vat&action=create&localTaxType=1", $langs->trans("New"), 2, $user->rights->tax->charges->creer); |
|
1194 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=list&leftmenu=tax_1_vat&localTaxType=1", $langs->trans("List"), 2, $user->rights->tax->charges->lire); |
|
1195 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=index&leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByMonth"), 2, $user->rights->tax->charges->lire); |
|
1196 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=clients&leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); |
|
1197 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=quadri_detail&leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); |
|
1193 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=card&leftmenu=tax_1_vat&action=create&localTaxType=1", $langs->trans("New"), 2, $user->rights->tax->charges->creer); |
|
1194 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=list&leftmenu=tax_1_vat&localTaxType=1", $langs->trans("List"), 2, $user->rights->tax->charges->lire); |
|
1195 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=index&leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByMonth"), 2, $user->rights->tax->charges->lire); |
|
1196 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=clients&leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); |
|
1197 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=quadri_detail&leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); |
|
1198 | 1198 | } |
1199 | 1199 | } |
1200 | 1200 | //Local Taxes 2 |
1201 | 1201 | if ($mysoc->useLocalTax(2) && (isset($mysoc->localtax2_assuj) && $mysoc->localtax2_assuj == "1")) { |
1202 | 1202 | //$newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2", $langs->transcountry("LT2", $mysoc->country_code), 1, $user->rights->tax->charges->lire); |
1203 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=list&leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2", $langs->transcountry("LT2", $mysoc->country_code), 1, $user->rights->tax->charges->lire); |
|
1203 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=list&leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2", $langs->transcountry("LT2", $mysoc->country_code), 1, $user->rights->tax->charges->lire); |
|
1204 | 1204 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i', $leftmenu)) { |
1205 | 1205 | /* |
1206 | 1206 | $newmenu->add("/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&localTaxType=2", $langs->trans("New"), 2, $user->rights->tax->charges->creer); |
@@ -1209,11 +1209,11 @@ discard block |
||
1209 | 1209 | $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); |
1210 | 1210 | $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); |
1211 | 1211 | */ |
1212 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=card&leftmenu=tax_2_vat&action=create&localTaxType=2", $langs->trans("New"), 2, $user->rights->tax->charges->creer); |
|
1213 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=list&leftmenu=tax_2_vat&localTaxType=2", $langs->trans("List"), 2, $user->rights->tax->charges->lire); |
|
1214 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=index&leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByMonth"), 2, $user->rights->tax->charges->lire); |
|
1215 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=clients&leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); |
|
1216 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=quadri_detail&leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); |
|
1212 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=card&leftmenu=tax_2_vat&action=create&localTaxType=2", $langs->trans("New"), 2, $user->rights->tax->charges->creer); |
|
1213 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=list&leftmenu=tax_2_vat&localTaxType=2", $langs->trans("List"), 2, $user->rights->tax->charges->lire); |
|
1214 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=index&leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByMonth"), 2, $user->rights->tax->charges->lire); |
|
1215 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=clients&leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); |
|
1216 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=quadri_detail&leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); |
|
1217 | 1217 | } |
1218 | 1218 | } |
1219 | 1219 | } |
@@ -1223,14 +1223,14 @@ discard block |
||
1223 | 1223 | if (!empty($conf->salaries->enabled)) { |
1224 | 1224 | $langs->load("salaries"); |
1225 | 1225 | //$newmenu->add("/compta/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 1, $user->rights->salaries->read, '', $mainmenu, 'tax_salary'); |
1226 | - $newmenu->add(BASE_URI . "?controller=compta/salaries&method=list&leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 1, $user->rights->salaries->read, '', $mainmenu, 'tax_salary'); |
|
1226 | + $newmenu->add(BASE_URI."?controller=compta/salaries&method=list&leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 1, $user->rights->salaries->read, '', $mainmenu, 'tax_salary'); |
|
1227 | 1227 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i', $leftmenu)) { |
1228 | 1228 | //$newmenu->add("/compta/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("NewPayment"), 2, $user->rights->salaries->write); |
1229 | 1229 | //$newmenu->add("/compta/salaries/list.php?leftmenu=tax_salary", $langs->trans("Payments"), 2, $user->rights->salaries->read); |
1230 | 1230 | //$newmenu->add("/compta/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 2, $user->rights->salaries->read); |
1231 | - $newmenu->add(BASE_URI . "?controller=compta/salaries&method=card&leftmenu=tax_salary&action=create", $langs->trans("NewPayment"), 2, $user->rights->salaries->write); |
|
1232 | - $newmenu->add(BASE_URI . "?controller=compta/salaries&method=list&leftmenu=tax_salary", $langs->trans("Payments"), 2, $user->rights->salaries->read); |
|
1233 | - $newmenu->add(BASE_URI . "?controller=compta/salaries/stats&method=index&leftmenu=tax_salary", $langs->trans("Statistics"), 2, $user->rights->salaries->read); |
|
1231 | + $newmenu->add(BASE_URI."?controller=compta/salaries&method=card&leftmenu=tax_salary&action=create", $langs->trans("NewPayment"), 2, $user->rights->salaries->write); |
|
1232 | + $newmenu->add(BASE_URI."?controller=compta/salaries&method=list&leftmenu=tax_salary", $langs->trans("Payments"), 2, $user->rights->salaries->read); |
|
1233 | + $newmenu->add(BASE_URI."?controller=compta/salaries/stats&method=index&leftmenu=tax_salary", $langs->trans("Statistics"), 2, $user->rights->salaries->read); |
|
1234 | 1234 | } |
1235 | 1235 | } |
1236 | 1236 | |
@@ -1238,10 +1238,10 @@ discard block |
||
1238 | 1238 | if (!empty($conf->loan->enabled)) { |
1239 | 1239 | $langs->load("loan"); |
1240 | 1240 | //$newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 1, $user->rights->loan->read, '', $mainmenu, 'tax_loan'); |
1241 | - $newmenu->add(BASE_URI . "?controller=loan&method=list&leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 1, $user->rights->loan->read, '', $mainmenu, 'tax_loan'); |
|
1241 | + $newmenu->add(BASE_URI."?controller=loan&method=list&leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 1, $user->rights->loan->read, '', $mainmenu, 'tax_loan'); |
|
1242 | 1242 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i', $leftmenu)) { |
1243 | 1243 | //$newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 2, $user->rights->loan->write); |
1244 | - $newmenu->add(BASE_URI . "?controller=loan&method=card&leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 2, $user->rights->loan->write); |
|
1244 | + $newmenu->add(BASE_URI."?controller=loan&method=card&leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 2, $user->rights->loan->write); |
|
1245 | 1245 | //$newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->rights->loan->read); |
1246 | 1246 | } |
1247 | 1247 | } |
@@ -1250,12 +1250,12 @@ discard block |
||
1250 | 1250 | if (!empty($conf->banque->enabled) && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) { |
1251 | 1251 | $langs->load("banks"); |
1252 | 1252 | //$newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 1, $user->rights->banque->lire, '', $mainmenu, 'tax_various'); |
1253 | - $newmenu->add(BASE_URI . "?controller=compta/bank/various_payment&method=list&leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 1, $user->rights->banque->lire, '', $mainmenu, 'tax_various'); |
|
1253 | + $newmenu->add(BASE_URI."?controller=compta/bank/various_payment&method=list&leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 1, $user->rights->banque->lire, '', $mainmenu, 'tax_various'); |
|
1254 | 1254 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i', $leftmenu)) { |
1255 | 1255 | //$newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans("New"), 2, $user->rights->banque->modifier); |
1256 | 1256 | //$newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans("List"), 2, $user->rights->banque->lire); |
1257 | - $newmenu->add(BASE_URI . "?controller=compta/bank/various_payment&method=card&leftmenu=tax_various&action=create", $langs->trans("New"), 2, $user->rights->banque->modifier); |
|
1258 | - $newmenu->add(BASE_URI . "?controller=compta/bank/various_payment&method=list&leftmenu=tax_various", $langs->trans("List"), 2, $user->rights->banque->lire); |
|
1257 | + $newmenu->add(BASE_URI."?controller=compta/bank/various_payment&method=card&leftmenu=tax_various&action=create", $langs->trans("New"), 2, $user->rights->banque->modifier); |
|
1258 | + $newmenu->add(BASE_URI."?controller=compta/bank/various_payment&method=list&leftmenu=tax_various", $langs->trans("List"), 2, $user->rights->banque->lire); |
|
1259 | 1259 | } |
1260 | 1260 | } |
1261 | 1261 | } |
@@ -1273,11 +1273,11 @@ discard block |
||
1273 | 1273 | |
1274 | 1274 | $permtoshowmenu = (!empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire); |
1275 | 1275 | //$newmenu->add("/accountancy/index.php?leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy'); |
1276 | - $newmenu->add(BASE_URI . "?controller=accountancy&method=index&leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy'); |
|
1276 | + $newmenu->add(BASE_URI."?controller=accountancy&method=index&leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy'); |
|
1277 | 1277 | |
1278 | 1278 | // Chart of account |
1279 | 1279 | //$newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1); |
1280 | - $newmenu->add(BASE_URI . "?controller=accountancy&method=index&leftmenu=accountancy_admin", $langs->trans("Setup"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1); |
|
1280 | + $newmenu->add(BASE_URI."?controller=accountancy&method=index&leftmenu=accountancy_admin", $langs->trans("Setup"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1); |
|
1281 | 1281 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/', $leftmenu)) { |
1282 | 1282 | /* |
1283 | 1283 | $newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_general', 10); |
@@ -1287,71 +1287,71 @@ discard block |
||
1287 | 1287 | $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41); |
1288 | 1288 | $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50); |
1289 | 1289 | */ |
1290 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=index&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_general', 10); |
|
1291 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=journals_list&id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_journal', 20); |
|
1292 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=accountmodel&id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 30); |
|
1293 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=account&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 40); |
|
1294 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=categories_list&id=32&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41); |
|
1295 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=defaultaccounts&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50); |
|
1290 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=index&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_general', 10); |
|
1291 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=journals_list&id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_journal', 20); |
|
1292 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=accountmodel&id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 30); |
|
1293 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=account&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 40); |
|
1294 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=categories_list&id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41); |
|
1295 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=defaultaccounts&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50); |
|
1296 | 1296 | if (!empty($conf->banque->enabled)) { |
1297 | 1297 | //$newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51); |
1298 | - $newmenu->add(BASE_URI . "?controller=compta/bank&method=list&mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51); |
|
1298 | + $newmenu->add(BASE_URI."?controller=compta/bank&method=list&mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51); |
|
1299 | 1299 | } |
1300 | 1300 | if (!empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled)) { |
1301 | 1301 | //$newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 52); |
1302 | - $newmenu->add(BASE_URI . "?controller=admin&method=dict&id=10&from=accountancy&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 52); |
|
1302 | + $newmenu->add(BASE_URI."?controller=admin&method=dict&id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 52); |
|
1303 | 1303 | } |
1304 | 1304 | if (!empty($conf->tax->enabled)) { |
1305 | 1305 | //$newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 53); |
1306 | - $newmenu->add(BASE_URI . "?controller=admin&method=dict&id=7&from=accountancy&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 53); |
|
1306 | + $newmenu->add(BASE_URI."?controller=admin&method=dict&id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 53); |
|
1307 | 1307 | } |
1308 | 1308 | if (!empty($conf->expensereport->enabled)) { |
1309 | 1309 | //$newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 54); |
1310 | - $newmenu->add(BASE_URI . "?controller=admin&method=dict&id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 54); |
|
1310 | + $newmenu->add(BASE_URI."?controller=admin&method=dict&id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 54); |
|
1311 | 1311 | } |
1312 | 1312 | //$newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 55); |
1313 | 1313 | //$newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60); |
1314 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=productaccount&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 55); |
|
1315 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=export&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60); |
|
1314 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=productaccount&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 55); |
|
1315 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=export&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60); |
|
1316 | 1316 | |
1317 | 1317 | // Fiscal year |
1318 | 1318 | if ($conf->global->MAIN_FEATURES_LEVEL > 1) { |
1319 | 1319 | // Not yet used. In a future will lock some periods. |
1320 | 1320 | //$newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 2, $user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); |
1321 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=fiscalyear&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 2, $user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); |
|
1321 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=fiscalyear&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 2, $user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); |
|
1322 | 1322 | } |
1323 | 1323 | } |
1324 | 1324 | |
1325 | 1325 | // Binding |
1326 | 1326 | if (!empty($conf->facture->enabled)) { |
1327 | 1327 | //$newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); |
1328 | - $newmenu->add(BASE_URI . "?controller=accountancy/customer&method=index&leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); |
|
1328 | + $newmenu->add(BASE_URI."?controller=accountancy/customer&method=index&leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); |
|
1329 | 1329 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/', $leftmenu)) { |
1330 | 1330 | //$newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); |
1331 | 1331 | //$newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); |
1332 | - $newmenu->add(BASE_URI . "?controller=accountancy/customer&method=list&mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); |
|
1333 | - $newmenu->add(BASE_URI . "?controller=accountancy/customer&method=lines&mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); |
|
1332 | + $newmenu->add(BASE_URI."?controller=accountancy/customer&method=list&mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); |
|
1333 | + $newmenu->add(BASE_URI."?controller=accountancy/customer&method=lines&mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); |
|
1334 | 1334 | } |
1335 | 1335 | } |
1336 | 1336 | if (!empty($conf->supplier_invoice->enabled)) { |
1337 | 1337 | //$newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", $langs->trans("SuppliersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier'); |
1338 | - $newmenu->add(BASE_URI . "?controller=accountancy/supplier&method=index&leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", $langs->trans("SuppliersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier'); |
|
1338 | + $newmenu->add(BASE_URI."?controller=accountancy/supplier&method=index&leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", $langs->trans("SuppliersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier'); |
|
1339 | 1339 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/', $leftmenu)) { |
1340 | 1340 | //$newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); |
1341 | 1341 | //$newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); |
1342 | - $newmenu->add(BASE_URI . "?controller=accountancy/supplier&method=list&mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); |
|
1343 | - $newmenu->add(BASE_URI . "?controller=accountancy/supplier&method=lines&mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); |
|
1342 | + $newmenu->add(BASE_URI."?controller=accountancy/supplier&method=list&mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); |
|
1343 | + $newmenu->add(BASE_URI."?controller=accountancy/supplier&method=lines&mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); |
|
1344 | 1344 | } |
1345 | 1345 | } |
1346 | 1346 | |
1347 | 1347 | if (!empty($conf->expensereport->enabled)) { |
1348 | 1348 | //$newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport'); |
1349 | - $newmenu->add(BASE_URI . "?controller=accountancy/expensereport&method=index&leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport'); |
|
1349 | + $newmenu->add(BASE_URI."?controller=accountancy/expensereport&method=index&leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport'); |
|
1350 | 1350 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/', $leftmenu)) { |
1351 | 1351 | //$newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); |
1352 | 1352 | //$newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); |
1353 | - $newmenu->add(BASE_URI . "?controller=accountancy/expensereport&method=list&mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); |
|
1354 | - $newmenu->add(BASE_URI . "?controller=accountancy/expensereport&method=lines&mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); |
|
1353 | + $newmenu->add(BASE_URI."?controller=accountancy/expensereport&method=list&mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); |
|
1354 | + $newmenu->add(BASE_URI."?controller=accountancy/expensereport&method=lines&mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); |
|
1355 | 1355 | } |
1356 | 1356 | } |
1357 | 1357 | |
@@ -1361,8 +1361,8 @@ discard block |
||
1361 | 1361 | |
1362 | 1362 | // Multi journal |
1363 | 1363 | $sql = "SELECT rowid, code, label, nature"; |
1364 | - $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_journal"; |
|
1365 | - $sql .= " WHERE entity = " . $conf->entity; |
|
1364 | + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_journal"; |
|
1365 | + $sql .= " WHERE entity = ".$conf->entity; |
|
1366 | 1366 | $sql .= " AND active = 1"; |
1367 | 1367 | $sql .= " ORDER BY label DESC"; |
1368 | 1368 | |
@@ -1403,7 +1403,7 @@ discard block |
||
1403 | 1403 | $langs->load('accountancy'); |
1404 | 1404 | $journallabel = $langs->transnoentities($objp->label); // Labels in this table are set by loading llx_accounting_abc.sql. Label can be 'ACCOUNTING_SELL_JOURNAL', 'InventoryJournal', ... |
1405 | 1405 | //$newmenu->add('/accountancy/journal/' . $nature . 'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=' . $objp->rowid, $journallabel, 2, $user->rights->accounting->comptarapport->lire); |
1406 | - $newmenu->add(BASE_URI . '?controller=accountancy/journal&method=' . $nature . 'journal&mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=' . $objp->rowid, $journallabel, 2, $user->rights->accounting->comptarapport->lire); |
|
1406 | + $newmenu->add(BASE_URI.'?controller=accountancy/journal&method='.$nature.'journal&mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $journallabel, 2, $user->rights->accounting->comptarapport->lire); |
|
1407 | 1407 | } |
1408 | 1408 | $i++; |
1409 | 1409 | } |
@@ -1418,31 +1418,31 @@ discard block |
||
1418 | 1418 | |
1419 | 1419 | // General Ledger |
1420 | 1420 | //$newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_generalledger", $langs->trans("Bookkeeping"), 1, $user->rights->accounting->mouvements->lire); |
1421 | - $newmenu->add(BASE_URI . "?controller=accountancy/bookkeeping&method=list&mainmenu=accountancy&leftmenu=accountancy_generalledger", $langs->trans("Bookkeeping"), 1, $user->rights->accounting->mouvements->lire); |
|
1421 | + $newmenu->add(BASE_URI."?controller=accountancy/bookkeeping&method=list&mainmenu=accountancy&leftmenu=accountancy_generalledger", $langs->trans("Bookkeeping"), 1, $user->rights->accounting->mouvements->lire); |
|
1422 | 1422 | |
1423 | 1423 | // Balance |
1424 | 1424 | //$newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance", $langs->trans("AccountBalance"), 1, $user->rights->accounting->mouvements->lire); |
1425 | - $newmenu->add(BASE_URI . "?controller=accountancy/bookkeeping&method=balance&mainmenu=accountancy&leftmenu=accountancy_balance", $langs->trans("AccountBalance"), 1, $user->rights->accounting->mouvements->lire); |
|
1425 | + $newmenu->add(BASE_URI."?controller=accountancy/bookkeeping&method=balance&mainmenu=accountancy&leftmenu=accountancy_balance", $langs->trans("AccountBalance"), 1, $user->rights->accounting->mouvements->lire); |
|
1426 | 1426 | |
1427 | 1427 | // Files |
1428 | 1428 | if (!empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL > 2) { |
1429 | 1429 | //$newmenu->add("/compta/compta-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->rights->accounting->mouvements->lire); |
1430 | - $newmenu->add(BASE_URI . "?controller=compta&method=compta-files&mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->rights->accounting->mouvements->lire); |
|
1430 | + $newmenu->add(BASE_URI."?controller=compta&method=compta-files&mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->rights->accounting->mouvements->lire); |
|
1431 | 1431 | } |
1432 | 1432 | |
1433 | 1433 | // Reports |
1434 | 1434 | $langs->load("compta"); |
1435 | 1435 | |
1436 | 1436 | //$newmenu->add("/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); |
1437 | - $newmenu->add(BASE_URI . "?controller=compta/resultat&method=index&mainmenu=accountancy&leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); |
|
1437 | + $newmenu->add(BASE_URI."?controller=compta/resultat&method=index&mainmenu=accountancy&leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); |
|
1438 | 1438 | |
1439 | 1439 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { |
1440 | 1440 | //$newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report", $langs->trans("MenuReportInOut"), 2, $user->rights->accounting->comptarapport->lire); |
1441 | 1441 | //$newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report", $langs->trans("ByPredefinedAccountGroups"), 3, $user->rights->accounting->comptarapport->lire); |
1442 | 1442 | //$newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->rights->accounting->comptarapport->lire); |
1443 | - $newmenu->add(BASE_URI . "?controller=compta/resultat&method=index&leftmenu=accountancy_report", $langs->trans("MenuReportInOut"), 2, $user->rights->accounting->comptarapport->lire); |
|
1444 | - $newmenu->add(BASE_URI . "?controller=compta/resultat&method=clientfourn&leftmenu=accountancy_report", $langs->trans("ByPredefinedAccountGroups"), 3, $user->rights->accounting->comptarapport->lire); |
|
1445 | - $newmenu->add(BASE_URI . "?controller=compta/resultat&method=result&leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->rights->accounting->comptarapport->lire); |
|
1443 | + $newmenu->add(BASE_URI."?controller=compta/resultat&method=index&leftmenu=accountancy_report", $langs->trans("MenuReportInOut"), 2, $user->rights->accounting->comptarapport->lire); |
|
1444 | + $newmenu->add(BASE_URI."?controller=compta/resultat&method=clientfourn&leftmenu=accountancy_report", $langs->trans("ByPredefinedAccountGroups"), 3, $user->rights->accounting->comptarapport->lire); |
|
1445 | + $newmenu->add(BASE_URI."?controller=compta/resultat&method=result&leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->rights->accounting->comptarapport->lire); |
|
1446 | 1446 | } |
1447 | 1447 | |
1448 | 1448 | $modecompta = 'CREANCES-DETTES'; |
@@ -1457,11 +1457,11 @@ discard block |
||
1457 | 1457 | $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta = " . $modecompta, $langs->trans("ByProductsAndServices"), 3, $user->rights->accounting->comptarapport->lire); |
1458 | 1458 | $newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta = " . $modecompta, $langs->trans("ByVatRate"), 3, $user->rights->accounting->comptarapport->lire); |
1459 | 1459 | */ |
1460 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=index&leftmenu=accountancy_report&modecompta = " . $modecompta, $langs->trans("ReportTurnover"), 2, $user->rights->accounting->comptarapport->lire); |
|
1461 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=casoc&leftmenu=accountancy_report&modecompta = " . $modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); |
|
1462 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=cabyuser&leftmenu=accountancy_report&modecompta = " . $modecompta, $langs->trans("ByUsers"), 3, $user->rights->accounting->comptarapport->lire); |
|
1463 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=cabyprodserv&leftmenu=accountancy_report&modecompta = " . $modecompta, $langs->trans("ByProductsAndServices"), 3, $user->rights->accounting->comptarapport->lire); |
|
1464 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=byratecountry&leftmenu=accountancy_report&modecompta = " . $modecompta, $langs->trans("ByVatRate"), 3, $user->rights->accounting->comptarapport->lire); |
|
1460 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=index&leftmenu=accountancy_report&modecompta = ".$modecompta, $langs->trans("ReportTurnover"), 2, $user->rights->accounting->comptarapport->lire); |
|
1461 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=casoc&leftmenu=accountancy_report&modecompta = ".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); |
|
1462 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=cabyuser&leftmenu=accountancy_report&modecompta = ".$modecompta, $langs->trans("ByUsers"), 3, $user->rights->accounting->comptarapport->lire); |
|
1463 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=cabyprodserv&leftmenu=accountancy_report&modecompta = ".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->rights->accounting->comptarapport->lire); |
|
1464 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=byratecountry&leftmenu=accountancy_report&modecompta = ".$modecompta, $langs->trans("ByVatRate"), 3, $user->rights->accounting->comptarapport->lire); |
|
1465 | 1465 | } |
1466 | 1466 | } |
1467 | 1467 | |
@@ -1472,9 +1472,9 @@ discard block |
||
1472 | 1472 | //$newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta = " . $modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); |
1473 | 1473 | //$newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta = " . $modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); |
1474 | 1474 | //$newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta = " . $modecompta, $langs->trans("ByUsers"), 3, $user->rights->accounting->comptarapport->lire); |
1475 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=index&leftmenu=accountancy_report&modecompta = " . $modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); |
|
1476 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=casoc&leftmenu=accountancy_report&modecompta = " . $modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); |
|
1477 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=cabyuser&leftmenu=accountancy_report&modecompta = " . $modecompta, $langs->trans("ByUsers"), 3, $user->rights->accounting->comptarapport->lire); |
|
1475 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=index&leftmenu=accountancy_report&modecompta = ".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); |
|
1476 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=casoc&leftmenu=accountancy_report&modecompta = ".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); |
|
1477 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=cabyuser&leftmenu=accountancy_report&modecompta = ".$modecompta, $langs->trans("ByUsers"), 3, $user->rights->accounting->comptarapport->lire); |
|
1478 | 1478 | //$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta = ".$modecompta, $langs->trans("ByProductsAndServices"),3,$user->rights->accounting->comptarapport->lire); |
1479 | 1479 | //$newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta = ".$modecompta, $langs->trans("ByVatRate"),3,$user->rights->accounting->comptarapport->lire); |
1480 | 1480 | } |
@@ -1487,19 +1487,19 @@ discard block |
||
1487 | 1487 | |
1488 | 1488 | // Bilan, resultats |
1489 | 1489 | //$newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca'); |
1490 | - $newmenu->add(BASE_URI . "?controller=compta/resultat&method=index&leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca'); |
|
1490 | + $newmenu->add(BASE_URI."?controller=compta/resultat&method=index&leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca'); |
|
1491 | 1491 | |
1492 | 1492 | if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) { |
1493 | 1493 | //$newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->rights->compta->resultat->lire); |
1494 | 1494 | //$newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); |
1495 | - $newmenu->add(BASE_URI . "?controller=compta/resultat&method=index&leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->rights->compta->resultat->lire); |
|
1496 | - $newmenu->add(BASE_URI . "?controller=compta/resultat&method=clientfourn&leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); |
|
1495 | + $newmenu->add(BASE_URI."?controller=compta/resultat&method=index&leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->rights->compta->resultat->lire); |
|
1496 | + $newmenu->add(BASE_URI."?controller=compta/resultat&method=clientfourn&leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); |
|
1497 | 1497 | /* On verra ca avec module compabilite expert |
1498 | 1498 | $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->rights->compta->resultat->lire); |
1499 | 1499 | $newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->rights->compta->resultat->lire); |
1500 | 1500 | */ |
1501 | 1501 | //$newmenu->add("/compta/stats/index.php?leftmenu=report", $langs->trans("ReportTurnover"), 1, $user->rights->compta->resultat->lire); |
1502 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=index&leftmenu=report", $langs->trans("ReportTurnover"), 1, $user->rights->compta->resultat->lire); |
|
1502 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=index&leftmenu=report", $langs->trans("ReportTurnover"), 1, $user->rights->compta->resultat->lire); |
|
1503 | 1503 | |
1504 | 1504 | /* |
1505 | 1505 | $newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->rights->compta->resultat->lire); |
@@ -1512,16 +1512,16 @@ discard block |
||
1512 | 1512 | //$newmenu->add("/compta/stats/cabyuser.php?leftmenu=report", $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); |
1513 | 1513 | //$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); |
1514 | 1514 | //$newmenu->add("/compta/stats/byratecountry.php?leftmenu=report", $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire); |
1515 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=casoc&leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); |
|
1516 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=cabyuser&leftmenu=report", $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); |
|
1517 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=cabyprodserv&leftmenu=report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); |
|
1518 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=byratecountry&leftmenu=report", $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire); |
|
1515 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=casoc&leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); |
|
1516 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=cabyuser&leftmenu=report", $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); |
|
1517 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=cabyprodserv&leftmenu=report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); |
|
1518 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=byratecountry&leftmenu=report", $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire); |
|
1519 | 1519 | |
1520 | 1520 | // Journaux |
1521 | 1521 | //$newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 50); |
1522 | 1522 | //$newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 51); |
1523 | - $newmenu->add(BASE_URI . "?controller=compta/journal&method=sellsjournal&leftmenu=report", $langs->trans("SellsJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 50); |
|
1524 | - $newmenu->add(BASE_URI . "?controller=compta/journal&method=purchasesjournal&leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 51); |
|
1523 | + $newmenu->add(BASE_URI."?controller=compta/journal&method=sellsjournal&leftmenu=report", $langs->trans("SellsJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 50); |
|
1524 | + $newmenu->add(BASE_URI."?controller=compta/journal&method=purchasesjournal&leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 51); |
|
1525 | 1525 | } |
1526 | 1526 | //if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journaux"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire); |
1527 | 1527 | } |
@@ -1533,15 +1533,15 @@ discard block |
||
1533 | 1533 | //$newmenu->add("/asset/card.php?action=create", $langs->trans("MenuNewAsset"), 1, $user->rights->asset->write); |
1534 | 1534 | //$newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->rights->asset->read); |
1535 | 1535 | //$newmenu->add("/asset/type.php?leftmenu=asset_type", $langs->trans("MenuTypeAssets"), 1, $user->rights->asset->read, '', $mainmenu, 'asset_type'); |
1536 | - $newmenu->add(BASE_URI . "?controller=asset&method=list&leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->rights->asset->read, '', $mainmenu, 'asset'); |
|
1537 | - $newmenu->add(BASE_URI . "?controller=asset&method=card&action=create", $langs->trans("MenuNewAsset"), 1, $user->rights->asset->write); |
|
1538 | - $newmenu->add(BASE_URI . "?controller=asset&method=list&leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->rights->asset->read); |
|
1539 | - $newmenu->add(BASE_URI . "?controller=asset&method=type&leftmenu=asset_type", $langs->trans("MenuTypeAssets"), 1, $user->rights->asset->read, '', $mainmenu, 'asset_type'); |
|
1536 | + $newmenu->add(BASE_URI."?controller=asset&method=list&leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->rights->asset->read, '', $mainmenu, 'asset'); |
|
1537 | + $newmenu->add(BASE_URI."?controller=asset&method=card&action=create", $langs->trans("MenuNewAsset"), 1, $user->rights->asset->write); |
|
1538 | + $newmenu->add(BASE_URI."?controller=asset&method=list&leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->rights->asset->read); |
|
1539 | + $newmenu->add(BASE_URI."?controller=asset&method=type&leftmenu=asset_type", $langs->trans("MenuTypeAssets"), 1, $user->rights->asset->read, '', $mainmenu, 'asset_type'); |
|
1540 | 1540 | if ($usemenuhider || empty($leftmenu) || preg_match('/asset_type/', $leftmenu)) { |
1541 | 1541 | //$newmenu->add("/asset/type.php?leftmenu=asset_type&action=create", $langs->trans("MenuNewTypeAssets"), 2, $user->rights->asset->write); |
1542 | 1542 | //$newmenu->add("/asset/type.php?leftmenu=asset_type", $langs->trans("MenuListTypeAssets"), 2, $user->rights->asset->read); |
1543 | - $newmenu->add(BASE_URI . "?controller=asset&method=type&leftmenu=asset_type&action=create", $langs->trans("MenuNewTypeAssets"), 2, $user->rights->asset->write); |
|
1544 | - $newmenu->add(BASE_URI . "?controller=asset&mtehod=type&leftmenu=asset_type", $langs->trans("MenuListTypeAssets"), 2, $user->rights->asset->read); |
|
1543 | + $newmenu->add(BASE_URI."?controller=asset&method=type&leftmenu=asset_type&action=create", $langs->trans("MenuNewTypeAssets"), 2, $user->rights->asset->write); |
|
1544 | + $newmenu->add(BASE_URI."?controller=asset&mtehod=type&leftmenu=asset_type", $langs->trans("MenuListTypeAssets"), 2, $user->rights->asset->read); |
|
1545 | 1545 | } |
1546 | 1546 | } |
1547 | 1547 | } |
@@ -1566,28 +1566,28 @@ discard block |
||
1566 | 1566 | |
1567 | 1567 | $newmenu->add("/compta/bank/transfer.php", $langs->trans("MenuBankInternalTransfer"), 1, $user->rights->banque->transfer); |
1568 | 1568 | */ |
1569 | - $newmenu->add(BASE_URI . "?controller=compta/bank&method=list&leftmenu=bank&mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->rights->banque->lire, '', $mainmenu, 'bank'); |
|
1569 | + $newmenu->add(BASE_URI."?controller=compta/bank&method=list&leftmenu=bank&mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->rights->banque->lire, '', $mainmenu, 'bank'); |
|
1570 | 1570 | |
1571 | - $newmenu->add(BASE_URI . "?controller=compta/bank&method=card&action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->rights->banque->configurer); |
|
1572 | - $newmenu->add(BASE_URI . "?controller=compta/bank&method=list&leftmenu=bank&mainmenu=bank", $langs->trans("List"), 1, $user->rights->banque->lire, '', $mainmenu, 'bank'); |
|
1573 | - $newmenu->add(BASE_URI . "?controller=compta/bank&method=bankentries_list", $langs->trans("ListTransactions"), 1, $user->rights->banque->lire); |
|
1574 | - $newmenu->add(BASE_URI . "?controller=compta/bank&method=budget", $langs->trans("ListTransactionsByCategory"), 1, $user->rights->banque->lire); |
|
1571 | + $newmenu->add(BASE_URI."?controller=compta/bank&method=card&action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->rights->banque->configurer); |
|
1572 | + $newmenu->add(BASE_URI."?controller=compta/bank&method=list&leftmenu=bank&mainmenu=bank", $langs->trans("List"), 1, $user->rights->banque->lire, '', $mainmenu, 'bank'); |
|
1573 | + $newmenu->add(BASE_URI."?controller=compta/bank&method=bankentries_list", $langs->trans("ListTransactions"), 1, $user->rights->banque->lire); |
|
1574 | + $newmenu->add(BASE_URI."?controller=compta/bank&method=budget", $langs->trans("ListTransactionsByCategory"), 1, $user->rights->banque->lire); |
|
1575 | 1575 | |
1576 | - $newmenu->add(BASE_URI . "?controller=compta/bank&method=transfer", $langs->trans("MenuBankInternalTransfer"), 1, $user->rights->banque->transfer); |
|
1576 | + $newmenu->add(BASE_URI."?controller=compta/bank&method=transfer", $langs->trans("MenuBankInternalTransfer"), 1, $user->rights->banque->transfer); |
|
1577 | 1577 | } |
1578 | 1578 | |
1579 | 1579 | if (!empty($conf->categorie->enabled)) { |
1580 | 1580 | $langs->load("categories"); |
1581 | 1581 | //$newmenu->add("/categories/index.php?type = 5", $langs->trans("Rubriques"), 1, $user->rights->categorie->creer, '', $mainmenu, 'tags'); |
1582 | 1582 | //$newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->rights->categorie->creer, '', $mainmenu, 'tags'); |
1583 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&type=5", $langs->trans("Rubriques"), 1, $user->rights->categorie->creer, '', $mainmenu, 'tags'); |
|
1584 | - $newmenu->add(BASE_URI . "?controller=compta/bank&method=categ", $langs->trans("RubriquesTransactions"), 1, $user->rights->categorie->creer, '', $mainmenu, 'tags'); |
|
1583 | + $newmenu->add(BASE_URI."?controller=categories&method=index&type=5", $langs->trans("Rubriques"), 1, $user->rights->categorie->creer, '', $mainmenu, 'tags'); |
|
1584 | + $newmenu->add(BASE_URI."?controller=compta/bank&method=categ", $langs->trans("RubriquesTransactions"), 1, $user->rights->categorie->creer, '', $mainmenu, 'tags'); |
|
1585 | 1585 | } |
1586 | 1586 | |
1587 | 1587 | // Prelevements |
1588 | 1588 | if (!empty($conf->prelevement->enabled)) { |
1589 | 1589 | //$newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank", $langs->trans("StandingOrders"), 0, $user->rights->prelevement->bons->lire, '', $mainmenu, 'withdraw'); |
1590 | - $newmenu->add(BASE_URI . "?controller=compta/prelevement&method=index&leftmenu=withdraw&mainmenu=bank", $langs->trans("StandingOrders"), 0, $user->rights->prelevement->bons->lire, '', $mainmenu, 'withdraw'); |
|
1590 | + $newmenu->add(BASE_URI."?controller=compta/prelevement&method=index&leftmenu=withdraw&mainmenu=bank", $langs->trans("StandingOrders"), 0, $user->rights->prelevement->bons->lire, '', $mainmenu, 'withdraw'); |
|
1591 | 1591 | |
1592 | 1592 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "withdraw") { |
1593 | 1593 | //$newmenu->add("/compta/prelevement/demandes.php?status = 0&mainmenu=bank",$langs->trans("StandingOrderToProcess"),1,$user->rights->prelevement->bons->lire); |
@@ -1600,12 +1600,12 @@ discard block |
||
1600 | 1600 | $newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->prelevement->bons->lire); |
1601 | 1601 | $newmenu->add("/compta/prelevement/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->prelevement->bons->lire); |
1602 | 1602 | */ |
1603 | - $newmenu->add(BASE_URI . "?controller=compta/prelevement&method=create&mainmenu=bank", $langs->trans("NewStandingOrder"), 1, $user->rights->prelevement->bons->creer); |
|
1603 | + $newmenu->add(BASE_URI."?controller=compta/prelevement&method=create&mainmenu=bank", $langs->trans("NewStandingOrder"), 1, $user->rights->prelevement->bons->creer); |
|
1604 | 1604 | |
1605 | - $newmenu->add(BASE_URI . "?controller=compta/prelevement&method=bons&mainmenu=bank", $langs->trans("WithdrawalsReceipts"), 1, $user->rights->prelevement->bons->lire); |
|
1606 | - $newmenu->add(BASE_URI . "?controller=compta/prelevement&method=list&mainmenu=bank", $langs->trans("WithdrawalsLines"), 1, $user->rights->prelevement->bons->lire); |
|
1607 | - $newmenu->add(BASE_URI . "?controller=compta/prelevement&method=rejets&mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->prelevement->bons->lire); |
|
1608 | - $newmenu->add(BASE_URI . "?controller=compta/prelevement&method=stats&mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->prelevement->bons->lire); |
|
1605 | + $newmenu->add(BASE_URI."?controller=compta/prelevement&method=bons&mainmenu=bank", $langs->trans("WithdrawalsReceipts"), 1, $user->rights->prelevement->bons->lire); |
|
1606 | + $newmenu->add(BASE_URI."?controller=compta/prelevement&method=list&mainmenu=bank", $langs->trans("WithdrawalsLines"), 1, $user->rights->prelevement->bons->lire); |
|
1607 | + $newmenu->add(BASE_URI."?controller=compta/prelevement&method=rejets&mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->prelevement->bons->lire); |
|
1608 | + $newmenu->add(BASE_URI."?controller=compta/prelevement&method=stats&mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->prelevement->bons->lire); |
|
1609 | 1609 | |
1610 | 1610 | //$newmenu->add("/compta/prelevement/config.php",$langs->trans("Setup"),1,$user->rights->prelevement->bons->configurer); |
1611 | 1611 | } |
@@ -1614,12 +1614,12 @@ discard block |
||
1614 | 1614 | // Gestion cheques |
1615 | 1615 | if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && !empty($conf->banque->enabled) && (!empty($conf->facture->enabled) || !empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))) { |
1616 | 1616 | //$newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->rights->banque->cheque, '', $mainmenu, 'checks'); |
1617 | - $newmenu->add(BASE_URI . "?controller=compta/paiement/cheque&method=index&leftmenu=checks&mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->rights->banque->cheque, '', $mainmenu, 'checks'); |
|
1617 | + $newmenu->add(BASE_URI."?controller=compta/paiement/cheque&method=index&leftmenu=checks&mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->rights->banque->cheque, '', $mainmenu, 'checks'); |
|
1618 | 1618 | if (preg_match('/checks/', $leftmenu)) { |
1619 | 1619 | //$newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->rights->banque->cheque); |
1620 | 1620 | //$newmenu->add("/compta/paiement/cheque/list.php?leftmenu=checks_bis&mainmenu=bank", $langs->trans("List"), 1, $user->rights->banque->cheque); |
1621 | - $newmenu->add(BASE_URI . "?controller=compta/paiement/cheque&method=card&leftmenu=checks_bis&action=new&mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->rights->banque->cheque); |
|
1622 | - $newmenu->add(BASE_URI . "?controller=compta/paiement/cheque&method=list&leftmenu=checks_bis&mainmenu=bank", $langs->trans("List"), 1, $user->rights->banque->cheque); |
|
1621 | + $newmenu->add(BASE_URI."?controller=compta/paiement/cheque&method=card&leftmenu=checks_bis&action=new&mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->rights->banque->cheque); |
|
1622 | + $newmenu->add(BASE_URI."?controller=compta/paiement/cheque&method=list&leftmenu=checks_bis&mainmenu=bank", $langs->trans("List"), 1, $user->rights->banque->cheque); |
|
1623 | 1623 | } |
1624 | 1624 | } |
1625 | 1625 | |
@@ -1629,9 +1629,9 @@ discard block |
||
1629 | 1629 | //$newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list", $langs->trans("POS"), 0, $permtomakecashfence, '', $mainmenu, 'cashcontrol'); |
1630 | 1630 | //$newmenu->add("/compta/cashcontrol/cashcontrol_card.php?action=create", $langs->trans("NewCashFence"), 1, $permtomakecashfence); |
1631 | 1631 | //$newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list", $langs->trans("List"), 1, $permtomakecashfence); |
1632 | - $newmenu->add(BASE_URI . "?controller=compta/cashcontrol&method=cashcontrol_list&action=list", $langs->trans("POS"), 0, $permtomakecashfence, '', $mainmenu, 'cashcontrol'); |
|
1633 | - $newmenu->add(BASE_URI . "?controller=compta/cashcontrol&method=cashcontrol_card&action=create", $langs->trans("NewCashFence"), 1, $permtomakecashfence); |
|
1634 | - $newmenu->add(BASE_URI . "?controller=compta/cashcontrol&method=cashcontrol_list&action=list", $langs->trans("List"), 1, $permtomakecashfence); |
|
1632 | + $newmenu->add(BASE_URI."?controller=compta/cashcontrol&method=cashcontrol_list&action=list", $langs->trans("POS"), 0, $permtomakecashfence, '', $mainmenu, 'cashcontrol'); |
|
1633 | + $newmenu->add(BASE_URI."?controller=compta/cashcontrol&method=cashcontrol_card&action=create", $langs->trans("NewCashFence"), 1, $permtomakecashfence); |
|
1634 | + $newmenu->add(BASE_URI."?controller=compta/cashcontrol&method=cashcontrol_list&action=list", $langs->trans("List"), 1, $permtomakecashfence); |
|
1635 | 1635 | } |
1636 | 1636 | } |
1637 | 1637 | |
@@ -1644,34 +1644,34 @@ discard block |
||
1644 | 1644 | //$newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->rights->produit->lire, '', $mainmenu, 'product'); |
1645 | 1645 | //$newmenu->add("/product/card.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer); |
1646 | 1646 | //$newmenu->add("/product/list.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->rights->produit->lire); |
1647 | - $newmenu->add(BASE_URI . "?controller=product&method=index&leftmenu=product&type=0", $langs->trans("Products"), 0, $user->rights->produit->lire, '', $mainmenu, 'product'); |
|
1648 | - $newmenu->add(BASE_URI . "?controller=product&method=card&leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer); |
|
1649 | - $newmenu->add(BASE_URI . "?controller=product&method=list&leftmenu=product&type=0", $langs->trans("List"), 1, $user->rights->produit->lire); |
|
1647 | + $newmenu->add(BASE_URI."?controller=product&method=index&leftmenu=product&type=0", $langs->trans("Products"), 0, $user->rights->produit->lire, '', $mainmenu, 'product'); |
|
1648 | + $newmenu->add(BASE_URI."?controller=product&method=card&leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer); |
|
1649 | + $newmenu->add(BASE_URI."?controller=product&method=list&leftmenu=product&type=0", $langs->trans("List"), 1, $user->rights->produit->lire); |
|
1650 | 1650 | if (!empty($conf->stock->enabled)) { |
1651 | 1651 | //$newmenu->add("/product/reassort.php?type = 0", $langs->trans("Stocks"), 1, $user->rights->produit->lire && $user->rights->stock->lire); |
1652 | - $newmenu->add(BASE_URI . "?controller=product&method=reassort&type=0", $langs->trans("Stocks"), 1, $user->rights->produit->lire && $user->rights->stock->lire); |
|
1652 | + $newmenu->add(BASE_URI."?controller=product&method=reassort&type=0", $langs->trans("Stocks"), 1, $user->rights->produit->lire && $user->rights->stock->lire); |
|
1653 | 1653 | } |
1654 | 1654 | if (!empty($conf->productbatch->enabled)) { |
1655 | 1655 | $langs->load("stocks"); |
1656 | 1656 | //$newmenu->add("/product/reassortlot.php?type = 0", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); |
1657 | 1657 | //$newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); |
1658 | - $newmenu->add(BASE_URI . "?controller=product&method=reassortlot&type=0", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); |
|
1659 | - $newmenu->add(BASE_URI . "?controller=product/stock&method=productlot_list", $langs->trans("LotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); |
|
1658 | + $newmenu->add(BASE_URI."?controller=product&method=reassortlot&type=0", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); |
|
1659 | + $newmenu->add(BASE_URI."?controller=product/stock&method=productlot_list", $langs->trans("LotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); |
|
1660 | 1660 | } |
1661 | 1661 | if (!empty($conf->variants->enabled)) { |
1662 | 1662 | //$newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->rights->produit->lire); |
1663 | - $newmenu->add(BASE_URI . "?controller=variants&method=list", $langs->trans("VariantAttributes"), 1, $user->rights->produit->lire); |
|
1663 | + $newmenu->add(BASE_URI."?controller=variants&method=list", $langs->trans("VariantAttributes"), 1, $user->rights->produit->lire); |
|
1664 | 1664 | } |
1665 | 1665 | if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) { |
1666 | 1666 | // $newmenu->add("/product/stats/card.php?id = all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire && $user->rights->propale->lire); |
1667 | - $newmenu->add(BASE_URI . "?controller=product/stats&method=card&id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire && $user->rights->propale->lire); |
|
1667 | + $newmenu->add(BASE_URI."?controller=product/stats&method=card&id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire && $user->rights->propale->lire); |
|
1668 | 1668 | } |
1669 | 1669 | |
1670 | 1670 | // Categories |
1671 | 1671 | if (!empty($conf->categorie->enabled)) { |
1672 | 1672 | $langs->load("categories"); |
1673 | 1673 | //$newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
1674 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
|
1674 | + $newmenu->add(BASE_URI."?controller=categories&method=index&leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
|
1675 | 1675 | //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->rights->categorie->lire); |
1676 | 1676 | } |
1677 | 1677 | } |
@@ -1681,18 +1681,18 @@ discard block |
||
1681 | 1681 | //$newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service'); |
1682 | 1682 | //$newmenu->add("/product/card.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->rights->service->creer); |
1683 | 1683 | //$newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->rights->service->lire); |
1684 | - $newmenu->add(BASE_URI . "?controller=product&method=index&leftmenu=service&type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service'); |
|
1685 | - $newmenu->add(BASE_URI . "?controller=product&method=card&leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->rights->service->creer); |
|
1686 | - $newmenu->add(BASE_URI . "?controller=product&method=list&leftmenu=service&type=1", $langs->trans("List"), 1, $user->rights->service->lire); |
|
1684 | + $newmenu->add(BASE_URI."?controller=product&method=index&leftmenu=service&type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service'); |
|
1685 | + $newmenu->add(BASE_URI."?controller=product&method=card&leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->rights->service->creer); |
|
1686 | + $newmenu->add(BASE_URI."?controller=product&method=list&leftmenu=service&type=1", $langs->trans("List"), 1, $user->rights->service->lire); |
|
1687 | 1687 | if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) { |
1688 | 1688 | //$newmenu->add("/product/stats/card.php?id = all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire && $user->rights->propale->lire); |
1689 | - $newmenu->add(BASE_URI . "?controller=product/stats&method=card&id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire && $user->rights->propale->lire); |
|
1689 | + $newmenu->add(BASE_URI."?controller=product/stats&method=card&id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire && $user->rights->propale->lire); |
|
1690 | 1690 | } |
1691 | 1691 | // Categories |
1692 | 1692 | if (!empty($conf->categorie->enabled)) { |
1693 | 1693 | $langs->load("categories"); |
1694 | 1694 | //$newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
1695 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
|
1695 | + $newmenu->add(BASE_URI."?controller=categories&method=index&leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
|
1696 | 1696 | //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->rights->categorie->lire); |
1697 | 1697 | } |
1698 | 1698 | } |
@@ -1708,15 +1708,15 @@ discard block |
||
1708 | 1708 | |
1709 | 1709 | $newmenu->add("/product/stock/massstockmove.php", $langs->trans("MassStockTransferShort"), 1, $user->rights->stock->mouvement->creer); |
1710 | 1710 | */ |
1711 | - $newmenu->add(BASE_URI . "?controller=product/stock&method=index&leftmenu=stock", $langs->trans("Warehouses"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock'); |
|
1712 | - $newmenu->add(BASE_URI . "?controller=product/stock&method=card&action=create", $langs->trans("MenuNewWarehouse"), 1, $user->rights->stock->creer); |
|
1713 | - $newmenu->add(BASE_URI . "?controller=product/stock&method=list", $langs->trans("List"), 1, $user->rights->stock->lire); |
|
1714 | - $newmenu->add(BASE_URI . "?controller=product/stock&method=movement_list", $langs->trans("Movements"), 1, $user->rights->stock->mouvement->lire); |
|
1711 | + $newmenu->add(BASE_URI."?controller=product/stock&method=index&leftmenu=stock", $langs->trans("Warehouses"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock'); |
|
1712 | + $newmenu->add(BASE_URI."?controller=product/stock&method=card&action=create", $langs->trans("MenuNewWarehouse"), 1, $user->rights->stock->creer); |
|
1713 | + $newmenu->add(BASE_URI."?controller=product/stock&method=list", $langs->trans("List"), 1, $user->rights->stock->lire); |
|
1714 | + $newmenu->add(BASE_URI."?controller=product/stock&method=movement_list", $langs->trans("Movements"), 1, $user->rights->stock->mouvement->lire); |
|
1715 | 1715 | |
1716 | - $newmenu->add(BASE_URI . "?controller=product/stock&method=massstockmove", $langs->trans("MassStockTransferShort"), 1, $user->rights->stock->mouvement->creer); |
|
1716 | + $newmenu->add(BASE_URI."?controller=product/stock&method=massstockmove", $langs->trans("MassStockTransferShort"), 1, $user->rights->stock->mouvement->creer); |
|
1717 | 1717 | if ($conf->supplier_order->enabled) { |
1718 | 1718 | //$newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire); |
1719 | - $newmenu->add(BASE_URI . "?controller=product/stock&method=replenish", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire); |
|
1719 | + $newmenu->add(BASE_URI."?controller=product/stock&method=replenish", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire); |
|
1720 | 1720 | } |
1721 | 1721 | } |
1722 | 1722 | |
@@ -1728,16 +1728,16 @@ discard block |
||
1728 | 1728 | //$newmenu->add("/product/inventory/list.php?leftmenu=stock", $langs->trans("Inventory"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock'); |
1729 | 1729 | //$newmenu->add("/product/inventory/card.php?action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->creer); |
1730 | 1730 | //$newmenu->add("/product/inventory/list.php", $langs->trans("List"), 1, $user->rights->stock->lire); |
1731 | - $newmenu->add(BASE_URI . "?controller=product/inventory&method=list&leftmenu=stock", $langs->trans("Inventory"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock'); |
|
1732 | - $newmenu->add(BASE_URI . "?controller=product/inventory&method=card&action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->creer); |
|
1733 | - $newmenu->add(BASE_URI . "?controller=product/inventory&method=list", $langs->trans("List"), 1, $user->rights->stock->lire); |
|
1731 | + $newmenu->add(BASE_URI."?controller=product/inventory&method=list&leftmenu=stock", $langs->trans("Inventory"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock'); |
|
1732 | + $newmenu->add(BASE_URI."?controller=product/inventory&method=card&action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->creer); |
|
1733 | + $newmenu->add(BASE_URI."?controller=product/inventory&method=list", $langs->trans("List"), 1, $user->rights->stock->lire); |
|
1734 | 1734 | } else { |
1735 | 1735 | //$newmenu->add("/product/inventory/list.php?leftmenu=stock", $langs->trans("Inventory"), 0, $user->rights->stock->inventory_advance->read, '', $mainmenu, 'stock'); |
1736 | 1736 | //$newmenu->add("/product/inventory/card.php?action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->inventory_advance->write); |
1737 | 1737 | //$newmenu->add("/product/inventory/list.php", $langs->trans("List"), 1, $user->rights->stock->inventory_advance->read); |
1738 | - $newmenu->add(BASE_URI . "?controller=product/inventory&method=list&leftmenu=stock", $langs->trans("Inventory"), 0, $user->rights->stock->inventory_advance->read, '', $mainmenu, 'stock'); |
|
1739 | - $newmenu->add(BASE_URI . "?controller=product/inventory&method=card&action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->inventory_advance->write); |
|
1740 | - $newmenu->add(BASE_URI . "?controller=product/inventory&method=list", $langs->trans("List"), 1, $user->rights->stock->inventory_advance->read); |
|
1738 | + $newmenu->add(BASE_URI."?controller=product/inventory&method=list&leftmenu=stock", $langs->trans("Inventory"), 0, $user->rights->stock->inventory_advance->read, '', $mainmenu, 'stock'); |
|
1739 | + $newmenu->add(BASE_URI."?controller=product/inventory&method=card&action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->inventory_advance->write); |
|
1740 | + $newmenu->add(BASE_URI."?controller=product/inventory&method=list", $langs->trans("List"), 1, $user->rights->stock->inventory_advance->read); |
|
1741 | 1741 | } |
1742 | 1742 | } |
1743 | 1743 | } |
@@ -1748,19 +1748,19 @@ discard block |
||
1748 | 1748 | //$newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->rights->expedition->lire, '', $mainmenu, 'sendings'); |
1749 | 1749 | //$newmenu->add("/expedition/card.php?action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->rights->expedition->creer); |
1750 | 1750 | //$newmenu->add("/expedition/list.php?leftmenu=sendings", $langs->trans("List"), 1, $user->rights->expedition->lire); |
1751 | - $newmenu->add(BASE_URI . "?controller=expedition&method=index&leftmenu=sendings", $langs->trans("Shipments"), 0, $user->rights->expedition->lire, '', $mainmenu, 'sendings'); |
|
1752 | - $newmenu->add(BASE_URI . "?controller=expedition&method=card&action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->rights->expedition->creer); |
|
1753 | - $newmenu->add(BASE_URI . "?controller=expedition&method=list&leftmenu=sendings", $langs->trans("List"), 1, $user->rights->expedition->lire); |
|
1751 | + $newmenu->add(BASE_URI."?controller=expedition&method=index&leftmenu=sendings", $langs->trans("Shipments"), 0, $user->rights->expedition->lire, '', $mainmenu, 'sendings'); |
|
1752 | + $newmenu->add(BASE_URI."?controller=expedition&method=card&action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->rights->expedition->creer); |
|
1753 | + $newmenu->add(BASE_URI."?controller=expedition&method=list&leftmenu=sendings", $langs->trans("List"), 1, $user->rights->expedition->lire); |
|
1754 | 1754 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "sendings") { |
1755 | 1755 | //$newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=0", $langs->trans("StatusSendingDraftShort"), 2, $user->rights->expedition->lire); |
1756 | 1756 | //$newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=1", $langs->trans("StatusSendingValidatedShort"), 2, $user->rights->expedition->lire); |
1757 | 1757 | //$newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->rights->expedition->lire); |
1758 | - $newmenu->add(BASE_URI . "?controller=expedition&method=list&leftmenu=sendings&viewstatut=0", $langs->trans("StatusSendingDraftShort"), 2, $user->rights->expedition->lire); |
|
1759 | - $newmenu->add(BASE_URI . "?controller=expedition&method=list&leftmenu=sendings&viewstatut=1", $langs->trans("StatusSendingValidatedShort"), 2, $user->rights->expedition->lire); |
|
1760 | - $newmenu->add(BASE_URI . "?controller=expedition&method=list&leftmenu=sendings&viewstatut=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->rights->expedition->lire); |
|
1758 | + $newmenu->add(BASE_URI."?controller=expedition&method=list&leftmenu=sendings&viewstatut=0", $langs->trans("StatusSendingDraftShort"), 2, $user->rights->expedition->lire); |
|
1759 | + $newmenu->add(BASE_URI."?controller=expedition&method=list&leftmenu=sendings&viewstatut=1", $langs->trans("StatusSendingValidatedShort"), 2, $user->rights->expedition->lire); |
|
1760 | + $newmenu->add(BASE_URI."?controller=expedition&method=list&leftmenu=sendings&viewstatut=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->rights->expedition->lire); |
|
1761 | 1761 | } |
1762 | 1762 | //$newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->rights->expedition->lire); |
1763 | - $newmenu->add(BASE_URI . "?controller=expedition/stats&method=index&leftmenu=sendings", $langs->trans("Statistics"), 1, $user->rights->expedition->lire); |
|
1763 | + $newmenu->add(BASE_URI."?controller=expedition/stats&method=index&leftmenu=sendings", $langs->trans("Statistics"), 1, $user->rights->expedition->lire); |
|
1764 | 1764 | } |
1765 | 1765 | |
1766 | 1766 | // Receptions |
@@ -1769,23 +1769,23 @@ discard block |
||
1769 | 1769 | //$newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->rights->reception->lire, '', $mainmenu, 'receptions'); |
1770 | 1770 | //$newmenu->add("/reception/card.php?action=create2&leftmenu=receptions", $langs->trans("NewReception"), 1, $user->rights->reception->creer); |
1771 | 1771 | //$newmenu->add("/reception/list.php?leftmenu=receptions", $langs->trans("List"), 1, $user->rights->reception->lire); |
1772 | - $newmenu->add(BASE_URI . "?controller=reception&method=index&leftmenu=receptions", $langs->trans("Receptions"), 0, $user->rights->reception->lire, '', $mainmenu, 'receptions'); |
|
1773 | - $newmenu->add(BASE_URI . "?controller=reception&method=card&action=create2&leftmenu=receptions", $langs->trans("NewReception"), 1, $user->rights->reception->creer); |
|
1774 | - $newmenu->add(BASE_URI . "?controller=reception&method=list&leftmenu=receptions", $langs->trans("List"), 1, $user->rights->reception->lire); |
|
1772 | + $newmenu->add(BASE_URI."?controller=reception&method=index&leftmenu=receptions", $langs->trans("Receptions"), 0, $user->rights->reception->lire, '', $mainmenu, 'receptions'); |
|
1773 | + $newmenu->add(BASE_URI."?controller=reception&method=card&action=create2&leftmenu=receptions", $langs->trans("NewReception"), 1, $user->rights->reception->creer); |
|
1774 | + $newmenu->add(BASE_URI."?controller=reception&method=list&leftmenu=receptions", $langs->trans("List"), 1, $user->rights->reception->lire); |
|
1775 | 1775 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") { |
1776 | 1776 | //$newmenu->add("/reception/list.php?leftmenu=receptions&viewstatut=0", $langs->trans("StatusReceptionDraftShort"), 2, $user->rights->reception->lire); |
1777 | - $newmenu->add(BASE_URI . "?controller=reception&method=list&leftmenu=receptions&viewstatut=0", $langs->trans("StatusReceptionDraftShort"), 2, $user->rights->reception->lire); |
|
1777 | + $newmenu->add(BASE_URI."?controller=reception&method=list&leftmenu=receptions&viewstatut=0", $langs->trans("StatusReceptionDraftShort"), 2, $user->rights->reception->lire); |
|
1778 | 1778 | } |
1779 | 1779 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") { |
1780 | 1780 | //$newmenu->add("/reception/list.php?leftmenu=receptions&viewstatut=1", $langs->trans("StatusReceptionValidatedShort"), 2, $user->rights->reception->lire); |
1781 | - $newmenu->add(BASE_URI . "?controller=reception&method=list&leftmenu=receptions&viewstatut=1", $langs->trans("StatusReceptionValidatedShort"), 2, $user->rights->reception->lire); |
|
1781 | + $newmenu->add(BASE_URI."?controller=reception&method=list&leftmenu=receptions&viewstatut=1", $langs->trans("StatusReceptionValidatedShort"), 2, $user->rights->reception->lire); |
|
1782 | 1782 | } |
1783 | 1783 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") { |
1784 | 1784 | //$newmenu->add("/reception/list.php?leftmenu=receptions&viewstatut=2", $langs->trans("StatusReceptionProcessedShort"), 2, $user->rights->reception->lire); |
1785 | - $newmenu->add(BASE_URI . "?controller=reception&method=list&leftmenu=receptions&viewstatut=2", $langs->trans("StatusReceptionProcessedShort"), 2, $user->rights->reception->lire); |
|
1785 | + $newmenu->add(BASE_URI."?controller=reception&method=list&leftmenu=receptions&viewstatut=2", $langs->trans("StatusReceptionProcessedShort"), 2, $user->rights->reception->lire); |
|
1786 | 1786 | } |
1787 | 1787 | //$newmenu->add("/reception/stats/index.php?leftmenu=receptions", $langs->trans("Statistics"), 1, $user->rights->reception->lire); |
1788 | - $newmenu->add(BASE_URI . "?controller=reception/stats&method=index&leftmenu=receptions", $langs->trans("Statistics"), 1, $user->rights->reception->lire); |
|
1788 | + $newmenu->add(BASE_URI."?controller=reception/stats&method=index&leftmenu=receptions", $langs->trans("Statistics"), 1, $user->rights->reception->lire); |
|
1789 | 1789 | } |
1790 | 1790 | } |
1791 | 1791 | |
@@ -1819,32 +1819,32 @@ discard block |
||
1819 | 1819 | // Project assigned to user |
1820 | 1820 | //$newmenu->add("/projet/index.php?leftmenu=projects" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects'); |
1821 | 1821 | //$newmenu->add("/projet/card.php?leftmenu=projects&action=create" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $titlenew, 1, $user->rights->projet->creer); |
1822 | - $newmenu->add(BASE_URI . "?controller=projet&method=index&leftmenu=projects" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects'); |
|
1823 | - $newmenu->add(BASE_URI . "?controller=projet&method=card&leftmenu=projects&action=create" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $titlenew, 1, $user->rights->projet->creer); |
|
1822 | + $newmenu->add(BASE_URI."?controller=projet&method=index&leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects'); |
|
1823 | + $newmenu->add(BASE_URI."?controller=projet&method=card&leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->rights->projet->creer); |
|
1824 | 1824 | |
1825 | 1825 | if ($conf->global->PROJECT_USE_OPPORTUNITIES == 0) { |
1826 | 1826 | //$newmenu->add("/projet/list.php?leftmenu=projets" . ($search_project_user ? '&search_project_user=' . $search_project_user : '') . '&search_status=99', $langs->trans("List"), 1, $showmode, '', 'project', 'list'); |
1827 | - $newmenu->add(BASE_URI . "?controller=projet&method=list&leftmenu=projets" . ($search_project_user ? '&search_project_user=' . $search_project_user : '') . '&search_status=99', $langs->trans("List"), 1, $showmode, '', 'project', 'list'); |
|
1827 | + $newmenu->add(BASE_URI."?controller=projet&method=list&leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : '').'&search_status=99', $langs->trans("List"), 1, $showmode, '', 'project', 'list'); |
|
1828 | 1828 | } elseif ($conf->global->PROJECT_USE_OPPORTUNITIES == 1) { |
1829 | 1829 | //$newmenu->add("/projet/list.php?leftmenu=projets" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $langs->trans("List"), 1, $showmode, '', 'project', 'list'); |
1830 | 1830 | //$newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99&contextpage=lead', $langs->trans("ListOpenLeads"), 2, $showmode); |
1831 | 1831 | //$newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project', $langs->trans("ListOpenProjects"), 2, $showmode); |
1832 | - $newmenu->add(BASE_URI . "?controller=projet&method=list&leftmenu=projets" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $langs->trans("List"), 1, $showmode, '', 'project', 'list'); |
|
1833 | - $newmenu->add(BASE_URI . '?controller=projet&method=list&mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99&contextpage=lead', $langs->trans("ListOpenLeads"), 2, $showmode); |
|
1834 | - $newmenu->add(BASE_URI . '?controller=projet&method=list&mainmenu=project&leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project', $langs->trans("ListOpenProjects"), 2, $showmode); |
|
1832 | + $newmenu->add(BASE_URI."?controller=projet&method=list&leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $showmode, '', 'project', 'list'); |
|
1833 | + $newmenu->add(BASE_URI.'?controller=projet&method=list&mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99&contextpage=lead', $langs->trans("ListOpenLeads"), 2, $showmode); |
|
1834 | + $newmenu->add(BASE_URI.'?controller=projet&method=list&mainmenu=project&leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project', $langs->trans("ListOpenProjects"), 2, $showmode); |
|
1835 | 1835 | } elseif ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only |
1836 | 1836 | //$newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99', $langs->trans("List"), 2, $showmode); |
1837 | - $newmenu->add(BASE_URI . '?controller=projet&method=list&mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99', $langs->trans("List"), 2, $showmode); |
|
1837 | + $newmenu->add(BASE_URI.'?controller=projet&method=list&mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99', $langs->trans("List"), 2, $showmode); |
|
1838 | 1838 | } |
1839 | 1839 | |
1840 | 1840 | //$newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); |
1841 | - $newmenu->add(BASE_URI . "?controller=projet/stats&method=index&leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); |
|
1841 | + $newmenu->add(BASE_URI."?controller=projet/stats&method=index&leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); |
|
1842 | 1842 | |
1843 | 1843 | // Categories |
1844 | 1844 | if (!empty($conf->categorie->enabled)) { |
1845 | 1845 | $langs->load("categories"); |
1846 | 1846 | //$newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
1847 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
|
1847 | + $newmenu->add(BASE_URI."?controller=categories&method=index&leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
|
1848 | 1848 | } |
1849 | 1849 | |
1850 | 1850 | if (empty($conf->global->PROJECT_HIDE_TASKS)) { |
@@ -1857,12 +1857,12 @@ discard block |
||
1857 | 1857 | |
1858 | 1858 | $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire); |
1859 | 1859 | */ |
1860 | - $newmenu->add(BASE_URI . "?controller=projet/activity&method=index&leftmenu=tasks" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $langs->trans("Activities"), 0, $user->rights->projet->lire); |
|
1861 | - $newmenu->add(BASE_URI . "?controller=projet&method=tasks&leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer); |
|
1862 | - $newmenu->add(BASE_URI . "?controller=projet/tasks&method=list&leftmenu=tasks" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $langs->trans("List"), 1, $user->rights->projet->lire); |
|
1863 | - $newmenu->add(BASE_URI . "?controller=projet/tasks/stats&method=index&leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); |
|
1860 | + $newmenu->add(BASE_URI."?controller=projet/activity&method=index&leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->rights->projet->lire); |
|
1861 | + $newmenu->add(BASE_URI."?controller=projet&method=tasks&leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer); |
|
1862 | + $newmenu->add(BASE_URI."?controller=projet/tasks&method=list&leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->rights->projet->lire); |
|
1863 | + $newmenu->add(BASE_URI."?controller=projet/tasks/stats&method=index&leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); |
|
1864 | 1864 | |
1865 | - $newmenu->add(BASE_URI . "?controller=projet/activity&method=perweek&leftmenu=tasks" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire); |
|
1865 | + $newmenu->add(BASE_URI."?controller=projet/activity&method=perweek&leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire); |
|
1866 | 1866 | } |
1867 | 1867 | } |
1868 | 1868 | } |
@@ -1878,9 +1878,9 @@ discard block |
||
1878 | 1878 | //$newmenu->add("/user/list.php?leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->hrm->employee->read, '', $mainmenu, 'hrm'); |
1879 | 1879 | //$newmenu->add("/user/card.php?action=create&employee = 1", $langs->trans("NewEmployee"), 1, $user->rights->hrm->employee->write); |
1880 | 1880 | //$newmenu->add("/user/list.php?leftmenu=hrm&mode=employee&contextpage = employeelist", $langs->trans("List"), 1, $user->rights->hrm->employee->read); |
1881 | - $newmenu->add(BASE_URI . "?controller=user&method=list&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->hrm->employee->read, '', $mainmenu, 'hrm'); |
|
1882 | - $newmenu->add(BASE_URI . "?controller=user&method=card&action=create&employee = 1", $langs->trans("NewEmployee"), 1, $user->rights->hrm->employee->write); |
|
1883 | - $newmenu->add(BASE_URI . "?controller=user&method=list&leftmenu=hrm&mode=employee&contextpage = employeelist", $langs->trans("List"), 1, $user->rights->hrm->employee->read); |
|
1881 | + $newmenu->add(BASE_URI."?controller=user&method=list&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->hrm->employee->read, '', $mainmenu, 'hrm'); |
|
1882 | + $newmenu->add(BASE_URI."?controller=user&method=card&action=create&employee = 1", $langs->trans("NewEmployee"), 1, $user->rights->hrm->employee->write); |
|
1883 | + $newmenu->add(BASE_URI."?controller=user&method=list&leftmenu=hrm&mode=employee&contextpage = employeelist", $langs->trans("List"), 1, $user->rights->hrm->employee->read); |
|
1884 | 1884 | } |
1885 | 1885 | |
1886 | 1886 | // Leave/Holiday/Vacation module |
@@ -1891,9 +1891,9 @@ discard block |
||
1891 | 1891 | //$newmenu->add("/holiday/list.php?leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm'); |
1892 | 1892 | //$newmenu->add("/holiday/card.php?action=request", $langs->trans("New"), 1, $user->rights->holiday->write); |
1893 | 1893 | //$newmenu->add("/holiday/list.php?leftmenu=hrm", $langs->trans("List"), 1, $user->rights->holiday->read); |
1894 | - $newmenu->add(BASE_URI . "?controller=holiday&method=list&leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm'); |
|
1895 | - $newmenu->add(BASE_URI . "?controller=holiday&method=card&action=request", $langs->trans("New"), 1, $user->rights->holiday->write); |
|
1896 | - $newmenu->add(BASE_URI . "?controller=holiday&method=list&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->holiday->read); |
|
1894 | + $newmenu->add(BASE_URI."?controller=holiday&method=list&leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm'); |
|
1895 | + $newmenu->add(BASE_URI."?controller=holiday&method=card&action=request", $langs->trans("New"), 1, $user->rights->holiday->write); |
|
1896 | + $newmenu->add(BASE_URI."?controller=holiday&method=list&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->holiday->read); |
|
1897 | 1897 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "hrm") { |
1898 | 1898 | /* |
1899 | 1899 | $newmenu->add("/holiday/list.php?search_statut = 1&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read); |
@@ -1902,18 +1902,18 @@ discard block |
||
1902 | 1902 | $newmenu->add("/holiday/list.php?search_statut = 4&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read); |
1903 | 1903 | $newmenu->add("/holiday/list.php?search_statut = 5&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read); |
1904 | 1904 | */ |
1905 | - $newmenu->add(BASE_URI . "?controller=holiday&method=list&search_statut=1&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read); |
|
1906 | - $newmenu->add(BASE_URI . "?controller=holiday&method=list&search_statut=2&leftmenu=hrm", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read); |
|
1907 | - $newmenu->add(BASE_URI . "?controller=holiday&method=list&search_statut=3&leftmenu=hrm", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read); |
|
1908 | - $newmenu->add(BASE_URI . "?controller=holiday&method=list&search_statut=4&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read); |
|
1909 | - $newmenu->add(BASE_URI . "?controller=holiday&method=list&search_statut=5&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read); |
|
1905 | + $newmenu->add(BASE_URI."?controller=holiday&method=list&search_statut=1&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read); |
|
1906 | + $newmenu->add(BASE_URI."?controller=holiday&method=list&search_statut=2&leftmenu=hrm", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read); |
|
1907 | + $newmenu->add(BASE_URI."?controller=holiday&method=list&search_statut=3&leftmenu=hrm", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read); |
|
1908 | + $newmenu->add(BASE_URI."?controller=holiday&method=list&search_statut=4&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read); |
|
1909 | + $newmenu->add(BASE_URI."?controller=holiday&method=list&search_statut=5&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read); |
|
1910 | 1910 | } |
1911 | 1911 | //$newmenu->add("/holiday/define_holiday.php?action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->read); |
1912 | 1912 | //$newmenu->add("/holiday/month_report.php", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->read_all); |
1913 | 1913 | //$newmenu->add("/holiday/view_log.php?action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->define_holiday); |
1914 | - $newmenu->add(BASE_URI . "?controller=holiday&method=define_holiday&action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->read); |
|
1915 | - $newmenu->add(BASE_URI . "?controller=holiday&method=month_report", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->read_all); |
|
1916 | - $newmenu->add(BASE_URI . "?controller=holiday&method=view_log&action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->define_holiday); |
|
1914 | + $newmenu->add(BASE_URI."?controller=holiday&method=define_holiday&action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->read); |
|
1915 | + $newmenu->add(BASE_URI."?controller=holiday&method=month_report", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->read_all); |
|
1916 | + $newmenu->add(BASE_URI."?controller=holiday&method=view_log&action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->define_holiday); |
|
1917 | 1917 | } |
1918 | 1918 | |
1919 | 1919 | // Trips and expenses (old module) |
@@ -1925,10 +1925,10 @@ discard block |
||
1925 | 1925 | $newmenu->add("/compta/deplacement/list.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("List"), 1, $user->rights->deplacement->lire); |
1926 | 1926 | $newmenu->add("/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->deplacement->lire); |
1927 | 1927 | */ |
1928 | - $newmenu->add(BASE_URI . "?controller=compta/deplacement&method=index&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->rights->deplacement->lire, '', $mainmenu, 'tripsandexpenses'); |
|
1929 | - $newmenu->add(BASE_URI . "?controller=compta/deplacement&method=card&action=create&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->deplacement->creer); |
|
1930 | - $newmenu->add(BASE_URI . "?controller=compta/deplacement&method=list&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("List"), 1, $user->rights->deplacement->lire); |
|
1931 | - $newmenu->add(BASE_URI . "?controller=compta/deplacement/stats&method=index&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->deplacement->lire); |
|
1928 | + $newmenu->add(BASE_URI."?controller=compta/deplacement&method=index&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->rights->deplacement->lire, '', $mainmenu, 'tripsandexpenses'); |
|
1929 | + $newmenu->add(BASE_URI."?controller=compta/deplacement&method=card&action=create&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->deplacement->creer); |
|
1930 | + $newmenu->add(BASE_URI."?controller=compta/deplacement&method=list&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("List"), 1, $user->rights->deplacement->lire); |
|
1931 | + $newmenu->add(BASE_URI."?controller=compta/deplacement/stats&method=index&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->deplacement->lire); |
|
1932 | 1932 | } |
1933 | 1933 | |
1934 | 1934 | // Expense report |
@@ -1948,18 +1948,18 @@ discard block |
||
1948 | 1948 | } |
1949 | 1949 | $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->expensereport->lire); |
1950 | 1950 | */ |
1951 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=index&leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->rights->expensereport->lire, '', $mainmenu, 'expensereport'); |
|
1952 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=card&action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->expensereport->creer); |
|
1953 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=list&leftmenu=expensereport&mainmenu=hrm", $langs->trans("List"), 1, $user->rights->expensereport->lire); |
|
1951 | + $newmenu->add(BASE_URI."?controller=expensereport&method=index&leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->rights->expensereport->lire, '', $mainmenu, 'expensereport'); |
|
1952 | + $newmenu->add(BASE_URI."?controller=expensereport&method=card&action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->expensereport->creer); |
|
1953 | + $newmenu->add(BASE_URI."?controller=expensereport&method=list&leftmenu=expensereport&mainmenu=hrm", $langs->trans("List"), 1, $user->rights->expensereport->lire); |
|
1954 | 1954 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "expensereport") { |
1955 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=list&search_status=0&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Draft"), 2, $user->rights->expensereport->lire); |
|
1956 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=list&search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Validated"), 2, $user->rights->expensereport->lire); |
|
1957 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=list&search_status=5&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Approved"), 2, $user->rights->expensereport->lire); |
|
1958 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=list&search_status=6&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Paid"), 2, $user->rights->expensereport->lire); |
|
1959 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=list&search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Canceled"), 2, $user->rights->expensereport->lire); |
|
1960 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=list&search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Refused"), 2, $user->rights->expensereport->lire); |
|
1961 | - } |
|
1962 | - $newmenu->add(BASE_URI . "?controller=expensereport/stats&method=index&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->expensereport->lire); |
|
1955 | + $newmenu->add(BASE_URI."?controller=expensereport&method=list&search_status=0&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Draft"), 2, $user->rights->expensereport->lire); |
|
1956 | + $newmenu->add(BASE_URI."?controller=expensereport&method=list&search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Validated"), 2, $user->rights->expensereport->lire); |
|
1957 | + $newmenu->add(BASE_URI."?controller=expensereport&method=list&search_status=5&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Approved"), 2, $user->rights->expensereport->lire); |
|
1958 | + $newmenu->add(BASE_URI."?controller=expensereport&method=list&search_status=6&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Paid"), 2, $user->rights->expensereport->lire); |
|
1959 | + $newmenu->add(BASE_URI."?controller=expensereport&method=list&search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Canceled"), 2, $user->rights->expensereport->lire); |
|
1960 | + $newmenu->add(BASE_URI."?controller=expensereport&method=list&search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Refused"), 2, $user->rights->expensereport->lire); |
|
1961 | + } |
|
1962 | + $newmenu->add(BASE_URI."?controller=expensereport/stats&method=index&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->expensereport->lire); |
|
1963 | 1963 | } |
1964 | 1964 | |
1965 | 1965 | if (!empty($conf->projet->enabled)) { |
@@ -1969,7 +1969,7 @@ discard block |
||
1969 | 1969 | $search_project_user = GETPOST('search_project_user', 'int'); |
1970 | 1970 | |
1971 | 1971 | //$newmenu->add("/projet/activity/perweek.php?leftmenu=tasks" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire); |
1972 | - $newmenu->add(BASE_URI . "?controller=projet/activity&method=perweek&leftmenu=tasks" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire); |
|
1972 | + $newmenu->add(BASE_URI."?controller=projet/activity&method=perweek&leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire); |
|
1973 | 1973 | } |
1974 | 1974 | } |
1975 | 1975 | } |
@@ -1982,24 +1982,24 @@ discard block |
||
1982 | 1982 | if (empty($user->socid)) { // limit to internal users |
1983 | 1983 | $langs->load("mails"); |
1984 | 1984 | //$newmenu->add("/admin/mails_templates.php?leftmenu=email_templates", $langs->trans("EMailTemplates"), 0, 1, '', $mainmenu, 'email_templates'); |
1985 | - $newmenu->add(BASE_URI . "?controller=admin&method=mails_templates&leftmenu=email_templates", $langs->trans("EMailTemplates"), 0, 1, '', $mainmenu, 'email_templates'); |
|
1985 | + $newmenu->add(BASE_URI."?controller=admin&method=mails_templates&leftmenu=email_templates", $langs->trans("EMailTemplates"), 0, 1, '', $mainmenu, 'email_templates'); |
|
1986 | 1986 | } |
1987 | 1987 | |
1988 | 1988 | if (!empty($conf->mailing->enabled)) { |
1989 | 1989 | //$newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire, '', $mainmenu, 'mailing'); |
1990 | 1990 | //$newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->rights->mailing->creer); |
1991 | 1991 | //$newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->rights->mailing->lire); |
1992 | - $newmenu->add(BASE_URI . "?controller=comm/mailing&method=index&leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire, '', $mainmenu, 'mailing'); |
|
1993 | - $newmenu->add(BASE_URI . "?controller=comm/mailing&method=card&leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->rights->mailing->creer); |
|
1994 | - $newmenu->add(BASE_URI . "?controller=comm/mailing&method=list&leftmenu=mailing", $langs->trans("List"), 1, $user->rights->mailing->lire); |
|
1992 | + $newmenu->add(BASE_URI."?controller=comm/mailing&method=index&leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire, '', $mainmenu, 'mailing'); |
|
1993 | + $newmenu->add(BASE_URI."?controller=comm/mailing&method=card&leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->rights->mailing->creer); |
|
1994 | + $newmenu->add(BASE_URI."?controller=comm/mailing&method=list&leftmenu=mailing", $langs->trans("List"), 1, $user->rights->mailing->lire); |
|
1995 | 1995 | } |
1996 | 1996 | |
1997 | 1997 | if (!empty($conf->export->enabled)) { |
1998 | 1998 | $langs->load("exports"); |
1999 | 1999 | //$newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->rights->export->lire, '', $mainmenu, 'export'); |
2000 | 2000 | //$newmenu->add("/exports/export.php?leftmenu=export", $langs->trans("NewExport"), 1, $user->rights->export->creer); |
2001 | - $newmenu->add(BASE_URI . "?controller=exports&methodindex&leftmenu=export", $langs->trans("FormatedExport"), 0, $user->rights->export->lire, '', $mainmenu, 'export'); |
|
2002 | - $newmenu->add(BASE_URI . "?controller=exports&method=export&leftmenu=export", $langs->trans("NewExport"), 1, $user->rights->export->creer); |
|
2001 | + $newmenu->add(BASE_URI."?controller=exports&methodindex&leftmenu=export", $langs->trans("FormatedExport"), 0, $user->rights->export->lire, '', $mainmenu, 'export'); |
|
2002 | + $newmenu->add(BASE_URI."?controller=exports&method=export&leftmenu=export", $langs->trans("NewExport"), 1, $user->rights->export->creer); |
|
2003 | 2003 | //$newmenu->add("/exports/export.php?leftmenu=export",$langs->trans("List"),1, $user->rights->export->lire); |
2004 | 2004 | } |
2005 | 2005 | |
@@ -2007,8 +2007,8 @@ discard block |
||
2007 | 2007 | $langs->load("exports"); |
2008 | 2008 | //$newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->rights->import->run, '', $mainmenu, 'import'); |
2009 | 2009 | //$newmenu->add("/imports/import.php?leftmenu=import", $langs->trans("NewImport"), 1, $user->rights->import->run); |
2010 | - $newmenu->add(BASE_URI . "?controller=imports&method=index&leftmenu=import", $langs->trans("FormatedImport"), 0, $user->rights->import->run, '', $mainmenu, 'import'); |
|
2011 | - $newmenu->add(BASE_URI . "?controller=imports&method=import&leftmenu=import", $langs->trans("NewImport"), 1, $user->rights->import->run); |
|
2010 | + $newmenu->add(BASE_URI."?controller=imports&method=index&leftmenu=import", $langs->trans("FormatedImport"), 0, $user->rights->import->run, '', $mainmenu, 'import'); |
|
2011 | + $newmenu->add(BASE_URI."?controller=imports&method=import&leftmenu=import", $langs->trans("NewImport"), 1, $user->rights->import->run); |
|
2012 | 2012 | } |
2013 | 2013 | } |
2014 | 2014 | |
@@ -2051,30 +2051,30 @@ discard block |
||
2051 | 2051 | $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members&action=create", $langs->trans("New"), 1, $user->rights->adherent->configurer); |
2052 | 2052 | $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans("List"), 1, $user->rights->adherent->configurer); |
2053 | 2053 | */ |
2054 | - $newmenu->add(BASE_URI . "?controller=adherents&method=index&leftmenu=members&mainmenu=members", $langs->trans("Members"), 0, $user->rights->adherent->lire, '', $mainmenu, 'members'); |
|
2055 | - $newmenu->add(BASE_URI . "?controller=adherents&method=card&leftmenu=members&action=create", $langs->trans("NewMember"), 1, $user->rights->adherent->creer); |
|
2056 | - $newmenu->add(BASE_URI . "?controller=adherents&method=list&leftmenu=members", $langs->trans("List"), 1, $user->rights->adherent->lire); |
|
2057 | - $newmenu->add(BASE_URI . "?controller=adherents&method=list&leftmenu=members&statut=-1", $langs->trans("MenuMembersToValidate"), 2, $user->rights->adherent->lire); |
|
2058 | - $newmenu->add(BASE_URI . "?controller=adherents&method=list&leftmenu=members&statut=1", $langs->trans("MenuMembersValidated"), 2, $user->rights->adherent->lire); |
|
2059 | - $newmenu->add(BASE_URI . "?controller=adherents&method=list&leftmenu=members&statut=1&filter = uptodate", $langs->trans("MenuMembersUpToDate"), 2, $user->rights->adherent->lire); |
|
2060 | - $newmenu->add(BASE_URI . "?controller=adherents&method=list&leftmenu=members&statut=1&filter = outofdate", $langs->trans("MenuMembersNotUpToDate"), 2, $user->rights->adherent->lire); |
|
2061 | - $newmenu->add(BASE_URI . "?controller=adherents&method=list&leftmenu=members&statut=0", $langs->trans("MenuMembersResiliated"), 2, $user->rights->adherent->lire); |
|
2062 | - $newmenu->add(BASE_URI . "?controller=adherents/stats&method=index&leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->rights->adherent->lire); |
|
2063 | - $newmenu->add(BASE_URI . "?controller=adherents/cartes&method=carte&leftmenu=export", $langs->trans("MembersCards"), 1, $user->rights->adherent->export); |
|
2054 | + $newmenu->add(BASE_URI."?controller=adherents&method=index&leftmenu=members&mainmenu=members", $langs->trans("Members"), 0, $user->rights->adherent->lire, '', $mainmenu, 'members'); |
|
2055 | + $newmenu->add(BASE_URI."?controller=adherents&method=card&leftmenu=members&action=create", $langs->trans("NewMember"), 1, $user->rights->adherent->creer); |
|
2056 | + $newmenu->add(BASE_URI."?controller=adherents&method=list&leftmenu=members", $langs->trans("List"), 1, $user->rights->adherent->lire); |
|
2057 | + $newmenu->add(BASE_URI."?controller=adherents&method=list&leftmenu=members&statut=-1", $langs->trans("MenuMembersToValidate"), 2, $user->rights->adherent->lire); |
|
2058 | + $newmenu->add(BASE_URI."?controller=adherents&method=list&leftmenu=members&statut=1", $langs->trans("MenuMembersValidated"), 2, $user->rights->adherent->lire); |
|
2059 | + $newmenu->add(BASE_URI."?controller=adherents&method=list&leftmenu=members&statut=1&filter = uptodate", $langs->trans("MenuMembersUpToDate"), 2, $user->rights->adherent->lire); |
|
2060 | + $newmenu->add(BASE_URI."?controller=adherents&method=list&leftmenu=members&statut=1&filter = outofdate", $langs->trans("MenuMembersNotUpToDate"), 2, $user->rights->adherent->lire); |
|
2061 | + $newmenu->add(BASE_URI."?controller=adherents&method=list&leftmenu=members&statut=0", $langs->trans("MenuMembersResiliated"), 2, $user->rights->adherent->lire); |
|
2062 | + $newmenu->add(BASE_URI."?controller=adherents/stats&method=index&leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->rights->adherent->lire); |
|
2063 | + $newmenu->add(BASE_URI."?controller=adherents/cartes&method=carte&leftmenu=export", $langs->trans("MembersCards"), 1, $user->rights->adherent->export); |
|
2064 | 2064 | if (!empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && ($usemenuhider || empty($leftmenu) || $leftmenu == 'none' || $leftmenu == "members" || $leftmenu == "export")) { |
2065 | - $newmenu->add(BASE_URI . "?controller=adherents&method=htpasswd&leftmenu=export", $langs->trans("Filehtpasswd"), 1, $user->rights->adherent->export); |
|
2065 | + $newmenu->add(BASE_URI."?controller=adherents&method=htpasswd&leftmenu=export", $langs->trans("Filehtpasswd"), 1, $user->rights->adherent->export); |
|
2066 | 2066 | } |
2067 | 2067 | if (!empty($conf->categorie->enabled)) { |
2068 | 2068 | $langs->load("categories"); |
2069 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&leftmenu=cat&type=3", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
|
2070 | - } |
|
2071 | - $newmenu->add(BASE_URI . "?controller=adherents&method=index&leftmenu=members&mainmenu=members", $langs->trans("Subscriptions"), 0, $user->rights->adherent->cotisation->lire); |
|
2072 | - $newmenu->add(BASE_URI . "?controller=adherents&methodlist&leftmenu=members&statut=-1,1&mainmenu=members", $langs->trans("NewSubscription"), 1, $user->rights->adherent->cotisation->creer); |
|
2073 | - $newmenu->add(BASE_URI . "?controller=adherents/subscription&method=list&leftmenu=members", $langs->trans("List"), 1, $user->rights->adherent->cotisation->lire); |
|
2074 | - $newmenu->add(BASE_URI . "?controller=adherents/stats&method=index&leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->rights->adherent->lire); |
|
2075 | - $newmenu->add(BASE_URI . "?controller=adherents&method=type&leftmenu=setup&mainmenu=members", $langs->trans("MembersTypes"), 0, $user->rights->adherent->configurer, '', $mainmenu, 'setup'); |
|
2076 | - $newmenu->add(BASE_URI . "?controller=adherents&method=type&leftmenu=setup&mainmenu=members&action=create", $langs->trans("New"), 1, $user->rights->adherent->configurer); |
|
2077 | - $newmenu->add(BASE_URI . "?controller=adherents&method=type&leftmenu=setup&mainmenu=members", $langs->trans("List"), 1, $user->rights->adherent->configurer); |
|
2069 | + $newmenu->add(BASE_URI."?controller=categories&method=index&leftmenu=cat&type=3", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); |
|
2070 | + } |
|
2071 | + $newmenu->add(BASE_URI."?controller=adherents&method=index&leftmenu=members&mainmenu=members", $langs->trans("Subscriptions"), 0, $user->rights->adherent->cotisation->lire); |
|
2072 | + $newmenu->add(BASE_URI."?controller=adherents&methodlist&leftmenu=members&statut=-1,1&mainmenu=members", $langs->trans("NewSubscription"), 1, $user->rights->adherent->cotisation->creer); |
|
2073 | + $newmenu->add(BASE_URI."?controller=adherents/subscription&method=list&leftmenu=members", $langs->trans("List"), 1, $user->rights->adherent->cotisation->lire); |
|
2074 | + $newmenu->add(BASE_URI."?controller=adherents/stats&method=index&leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->rights->adherent->lire); |
|
2075 | + $newmenu->add(BASE_URI."?controller=adherents&method=type&leftmenu=setup&mainmenu=members", $langs->trans("MembersTypes"), 0, $user->rights->adherent->configurer, '', $mainmenu, 'setup'); |
|
2076 | + $newmenu->add(BASE_URI."?controller=adherents&method=type&leftmenu=setup&mainmenu=members&action=create", $langs->trans("New"), 1, $user->rights->adherent->configurer); |
|
2077 | + $newmenu->add(BASE_URI."?controller=adherents&method=type&leftmenu=setup&mainmenu=members", $langs->trans("List"), 1, $user->rights->adherent->configurer); |
|
2078 | 2078 | } |
2079 | 2079 | } |
2080 | 2080 | |
@@ -2085,11 +2085,11 @@ discard block |
||
2085 | 2085 | //var_dump($newmenu->liste); // |
2086 | 2086 | // We update newmenu for special dynamic menus |
2087 | 2087 | if (!empty($user->rights->banque->lire) && $mainmenu == 'bank') { // Entry for each bank account |
2088 | - require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
2088 | + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
2089 | 2089 | |
2090 | 2090 | $sql = "SELECT rowid, label, courant, rappro"; |
2091 | - $sql .= " FROM " . MAIN_DB_PREFIX . "bank_account"; |
|
2092 | - $sql .= " WHERE entity = " . $conf->entity; |
|
2091 | + $sql .= " FROM ".MAIN_DB_PREFIX."bank_account"; |
|
2092 | + $sql .= " WHERE entity = ".$conf->entity; |
|
2093 | 2093 | $sql .= " AND clos = 0"; |
2094 | 2094 | $sql .= " ORDER BY label"; |
2095 | 2095 | |
@@ -2100,16 +2100,16 @@ discard block |
||
2100 | 2100 | |
2101 | 2101 | if ($numr > 0) { |
2102 | 2102 | //$newmenu->add('/compta/bank/list.php', $langs->trans("BankAccounts"), 0, $user->rights->banque->lire); |
2103 | - $newmenu->add(BASE_URI . '?controller=compta/bank?method=list', $langs->trans("BankAccounts"), 0, $user->rights->banque->lire); |
|
2103 | + $newmenu->add(BASE_URI.'?controller=compta/bank?method=list', $langs->trans("BankAccounts"), 0, $user->rights->banque->lire); |
|
2104 | 2104 | } |
2105 | 2105 | |
2106 | 2106 | while ($i < $numr) { |
2107 | 2107 | $objp = $db->fetch_object($resql); |
2108 | 2108 | //$newmenu->add('/compta/bank/card.php?id=' . $objp->rowid, $objp->label, 1, $user->rights->banque->lire); |
2109 | - $newmenu->add(BASE_URI . '?controller=compta/bank&method=card&id=' . $objp->rowid, $objp->label, 1, $user->rights->banque->lire); |
|
2109 | + $newmenu->add(BASE_URI.'?controller=compta/bank&method=card&id='.$objp->rowid, $objp->label, 1, $user->rights->banque->lire); |
|
2110 | 2110 | if ($objp->rappro && $objp->courant != Account::TYPE_CASH && empty($objp->clos)) { // If not cash account and not closed and can be reconciliate |
2111 | 2111 | //$newmenu->add('/compta/bank/bankentries_list.php?action=reconcile&contextpage=banktransactionlist-' . $objp->rowid . '&account=' . $objp->rowid . '&id=' . $objp->rowid . '&search_conciliated=0', $langs->trans("Conciliate"), 2, $user->rights->banque->consolidate); |
2112 | - $newmenu->add(BASE_URI . '?controller=compta/bank&method=bankentries_list&action=reconcile&contextpage=banktransactionlist-' . $objp->rowid . '&account=' . $objp->rowid . '&id=' . $objp->rowid . '&search_conciliated=0', $langs->trans("Conciliate"), 2, $user->rights->banque->consolidate); |
|
2112 | + $newmenu->add(BASE_URI.'?controller=compta/bank&method=bankentries_list&action=reconcile&contextpage=banktransactionlist-'.$objp->rowid.'&account='.$objp->rowid.'&id='.$objp->rowid.'&search_conciliated=0', $langs->trans("Conciliate"), 2, $user->rights->banque->consolidate); |
|
2113 | 2113 | } |
2114 | 2114 | $i++; |
2115 | 2115 | } |
@@ -2123,11 +2123,11 @@ discard block |
||
2123 | 2123 | $MAXFTP = 20; |
2124 | 2124 | $i = 1; |
2125 | 2125 | while ($i <= $MAXFTP) { |
2126 | - $paramkey = 'FTP_NAME_' . $i; |
|
2126 | + $paramkey = 'FTP_NAME_'.$i; |
|
2127 | 2127 | //print $paramkey; |
2128 | 2128 | if (!empty($conf->global->$paramkey)) { |
2129 | 2129 | //$link = "/ftp/index.php?idmenu = " . $_SESSION["idmenu"] . "&numero_ftp = " . $i; |
2130 | - $link = BASE_URI . "?controller=ftp&method=index&idmenu=" . $_SESSION["idmenu"] . "&numero_ftp=" . $i; |
|
2130 | + $link = BASE_URI."?controller=ftp&method=index&idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i; |
|
2131 | 2131 | |
2132 | 2132 | $newmenu->add($link, dol_trunc($conf->global->$paramkey, 24)); |
2133 | 2133 | } |
@@ -2188,9 +2188,9 @@ discard block |
||
2188 | 2188 | } |
2189 | 2189 | } |
2190 | 2190 | if ($altok % 2 == 0) { |
2191 | - print '<div class="blockvmenu blockvmenuimpair' . $invert . ($lastopened ? ' blockvmenulast' : '') . ($altok == 1 ? ' blockvmenufirst' : '') . '">' . "\n"; |
|
2191 | + print '<div class="blockvmenu blockvmenuimpair'.$invert.($lastopened ? ' blockvmenulast' : '').($altok == 1 ? ' blockvmenufirst' : '').'">'."\n"; |
|
2192 | 2192 | } else { |
2193 | - print '<div class="blockvmenu blockvmenupair' . $invert . ($lastopened ? ' blockvmenulast' : '') . ($altok == 1 ? ' blockvmenufirst' : '') . '">' . "\n"; |
|
2193 | + print '<div class="blockvmenu blockvmenupair'.$invert.($lastopened ? ' blockvmenulast' : '').($altok == 1 ? ' blockvmenufirst' : '').'">'."\n"; |
|
2194 | 2194 | } |
2195 | 2195 | } |
2196 | 2196 | |
@@ -2212,48 +2212,48 @@ discard block |
||
2212 | 2212 | if (!preg_match("/^(http:\/\/|https:\/\/)/i", $menu_array[$i]['url'])) { |
2213 | 2213 | $tmp = explode('?', $menu_array[$i]['url'], 2); |
2214 | 2214 | $url = $shorturl = $tmp[0]; |
2215 | - $param = (isset($tmp[1]) ? $tmp[1] : ''); // params in url of the menu link |
|
2215 | + $param = (isset($tmp[1]) ? $tmp[1] : ''); // params in url of the menu link |
|
2216 | 2216 | // Complete param to force leftmenu to '' to close open menu when we click on a link with no leftmenu defined. |
2217 | 2217 | if ((!preg_match('/mainmenu/i', $param)) && (!preg_match('/leftmenu/i', $param)) && !empty($menu_array[$i]['mainmenu'])) { |
2218 | - $param .= ($param ? '&' : '') . 'mainmenu=' . $menu_array[$i]['mainmenu'] . '&leftmenu='; |
|
2218 | + $param .= ($param ? '&' : '').'mainmenu='.$menu_array[$i]['mainmenu'].'&leftmenu='; |
|
2219 | 2219 | } |
2220 | 2220 | if ((!preg_match('/mainmenu/i', $param)) && (!preg_match('/leftmenu/i', $param)) && empty($menu_array[$i]['mainmenu'])) { |
2221 | - $param .= ($param ? '&' : '') . 'leftmenu='; |
|
2221 | + $param .= ($param ? '&' : '').'leftmenu='; |
|
2222 | 2222 | } |
2223 | 2223 | //$url.="idmenu = ".$menu_array[$i]['rowid']; // Already done by menuLoad |
2224 | - $url = dol_buildpath($url, 1) . ($param ? '?' . $param : ''); |
|
2224 | + $url = dol_buildpath($url, 1).($param ? '?'.$param : ''); |
|
2225 | 2225 | $shorturlwithoutparam = $shorturl; |
2226 | - $shorturl = $shorturl . ($param ? '?' . $param : ''); |
|
2226 | + $shorturl = $shorturl.($param ? '?'.$param : ''); |
|
2227 | 2227 | } |
2228 | 2228 | |
2229 | 2229 | |
2230 | - print '<!-- Process menu entry with mainmenu=' . $menu_array[$i]['mainmenu'] . ', leftmenu=' . $menu_array[$i]['leftmenu'] . ', level=' . $menu_array[$i]['level'] . ' enabled=' . $menu_array[$i]['enabled'] . ', position=' . $menu_array[$i]['position'] . ' -->' . "\n"; |
|
2230 | + print '<!-- Process menu entry with mainmenu='.$menu_array[$i]['mainmenu'].', leftmenu='.$menu_array[$i]['leftmenu'].', level='.$menu_array[$i]['level'].' enabled='.$menu_array[$i]['enabled'].', position='.$menu_array[$i]['position'].' -->'."\n"; |
|
2231 | 2231 | |
2232 | 2232 | // Menu level 0 |
2233 | 2233 | if ($menu_array[$i]['level'] == 0) { |
2234 | 2234 | if ($menu_array[$i]['enabled']) { // Enabled so visible |
2235 | - print '<div class="menu_titre">' . $tabstring; |
|
2235 | + print '<div class="menu_titre">'.$tabstring; |
|
2236 | 2236 | if ($shorturlwithoutparam) { |
2237 | - print '<a class="vmenu" href="' . $url . '"' . ($menu_array[$i]['target'] ? ' target="' . $menu_array[$i]['target'] . '"' : '') . '>'; |
|
2237 | + print '<a class="vmenu" href="'.$url.'"'.($menu_array[$i]['target'] ? ' target="'.$menu_array[$i]['target'].'"' : '').'>'; |
|
2238 | 2238 | } else { |
2239 | 2239 | print '<span class="vmenu">'; |
2240 | 2240 | } |
2241 | - print ($menu_array[$i]['prefix'] ? $menu_array[$i]['prefix'] : '') . $menu_array[$i]['titre']; |
|
2241 | + print ($menu_array[$i]['prefix'] ? $menu_array[$i]['prefix'] : '').$menu_array[$i]['titre']; |
|
2242 | 2242 | if ($shorturlwithoutparam) { |
2243 | 2243 | print '</a>'; |
2244 | 2244 | } else { |
2245 | 2245 | print '</span>'; |
2246 | 2246 | } |
2247 | - print '</div>' . "\n"; |
|
2247 | + print '</div>'."\n"; |
|
2248 | 2248 | $lastlevel0 = 'enabled'; |
2249 | 2249 | } else if ($showmenu) { // Not enabled but visible (so greyed) |
2250 | - print '<div class="menu_titre">' . $tabstring . '<font class="vmenudisabled">' . $menu_array[$i]['titre'] . '</font></div>' . "\n"; |
|
2250 | + print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$menu_array[$i]['titre'].'</font></div>'."\n"; |
|
2251 | 2251 | $lastlevel0 = 'greyed'; |
2252 | 2252 | } else { |
2253 | 2253 | $lastlevel0 = 'hidden'; |
2254 | 2254 | } |
2255 | 2255 | if ($showmenu) { |
2256 | - print '<div class="menu_top"></div>' . "\n"; |
|
2256 | + print '<div class="menu_top"></div>'."\n"; |
|
2257 | 2257 | } |
2258 | 2258 | } |
2259 | 2259 | |
@@ -2261,13 +2261,13 @@ discard block |
||
2261 | 2261 | if ($menu_array[$i]['level'] > 0) { |
2262 | 2262 | $cssmenu = ''; |
2263 | 2263 | if ($menu_array[$i]['url']) { |
2264 | - $cssmenu = ' menu_contenu' . dol_string_nospecial(preg_replace('/\.php.*$/', '', $menu_array[$i]['url'])); |
|
2264 | + $cssmenu = ' menu_contenu'.dol_string_nospecial(preg_replace('/\.php.*$/', '', $menu_array[$i]['url'])); |
|
2265 | 2265 | } |
2266 | 2266 | |
2267 | 2267 | if ($menu_array[$i]['enabled'] && $lastlevel0 == 'enabled') { // Enabled so visible, except if parent was not enabled. |
2268 | - print '<div class="menu_contenu' . $cssmenu . '">' . $tabstring; |
|
2268 | + print '<div class="menu_contenu'.$cssmenu.'">'.$tabstring; |
|
2269 | 2269 | if ($shorturlwithoutparam) { |
2270 | - print '<a class="vsmenu" href="' . $url . '"' . ($menu_array[$i]['target'] ? ' target="' . $menu_array[$i]['target'] . '"' : '') . '>'; |
|
2270 | + print '<a class="vsmenu" href="'.$url.'"'.($menu_array[$i]['target'] ? ' target="'.$menu_array[$i]['target'].'"' : '').'>'; |
|
2271 | 2271 | } else { |
2272 | 2272 | print '<span class="vsmenu">'; |
2273 | 2273 | } |
@@ -2281,26 +2281,26 @@ discard block |
||
2281 | 2281 | if (!strstr($menu_array[$i]['titre'], '<table')) { |
2282 | 2282 | print '<br>'; |
2283 | 2283 | } |
2284 | - print '</div>' . "\n"; |
|
2284 | + print '</div>'."\n"; |
|
2285 | 2285 | } else if ($showmenu && $lastlevel0 == 'enabled') { // Not enabled but visible (so greyed), except if parent was not enabled. |
2286 | - print '<div class="menu_contenu' . $cssmenu . '">' . $tabstring . '<font class="vsmenudisabled vsmenudisabledmargin">' . $menu_array[$i]['titre'] . '</font><br></div>' . "\n"; |
|
2286 | + print '<div class="menu_contenu'.$cssmenu.'">'.$tabstring.'<font class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</font><br></div>'."\n"; |
|
2287 | 2287 | } |
2288 | 2288 | } |
2289 | 2289 | |
2290 | 2290 | // If next is a new block or if there is nothing after |
2291 | 2291 | if (empty($menu_array[$i + 1]['level'])) { // End menu block |
2292 | 2292 | if ($showmenu) { |
2293 | - print '<div class="menu_end"></div>' . "\n"; |
|
2293 | + print '<div class="menu_end"></div>'."\n"; |
|
2294 | 2294 | } |
2295 | 2295 | if ($blockvmenuopened) { |
2296 | - print '</div>' . "\n"; |
|
2296 | + print '</div>'."\n"; |
|
2297 | 2297 | $blockvmenuopened = false; |
2298 | 2298 | } |
2299 | 2299 | } |
2300 | 2300 | } |
2301 | 2301 | |
2302 | 2302 | if ($altok) { |
2303 | - print '<div class="blockvmenuend"></div>'; // End menu block |
|
2303 | + print '<div class="blockvmenuend"></div>'; // End menu block |
|
2304 | 2304 | } |
2305 | 2305 | } |
2306 | 2306 |
@@ -297,8 +297,9 @@ discard block |
||
297 | 297 | if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "bank") { |
298 | 298 | $classname = 'class="tmenusel"'; |
299 | 299 | $_SESSION['idmenu'] = ''; |
300 | - } else |
|
301 | - $classname = 'class="tmenu"'; |
|
300 | + } else { |
|
301 | + $classname = 'class="tmenu"'; |
|
302 | + } |
|
302 | 303 | $idsel = 'bank'; |
303 | 304 | |
304 | 305 | //$menu->add('/compta/bank/list.php?mainmenu=bank&leftmenu=', $langs->trans("MenuBankCash"), 0, $showmode, $atarget, "bank", '', 52, $id, $idsel, $classname); |
@@ -1378,25 +1379,33 @@ discard block |
||
1378 | 1379 | $nature = ''; |
1379 | 1380 | |
1380 | 1381 | // Must match array $sourceList defined into journals_list.php |
1381 | - if ($objp->nature == 2 && !empty($conf->facture->enabled)) |
|
1382 | - $nature = "sells"; |
|
1383 | - if ($objp->nature == 3 && !empty($conf->fournisseur->enabled)) |
|
1384 | - $nature = "purchases"; |
|
1385 | - if ($objp->nature == 4 && !empty($conf->banque->enabled)) |
|
1386 | - $nature = "bank"; |
|
1387 | - if ($objp->nature == 5 && !empty($conf->expensereport->enabled)) |
|
1388 | - $nature = "expensereports"; |
|
1389 | - if ($objp->nature == 1) |
|
1390 | - $nature = "various"; |
|
1391 | - if ($objp->nature == 8) |
|
1392 | - $nature = "inventory"; |
|
1393 | - if ($objp->nature == 9) |
|
1394 | - $nature = "hasnew"; |
|
1382 | + if ($objp->nature == 2 && !empty($conf->facture->enabled)) { |
|
1383 | + $nature = "sells"; |
|
1384 | + } |
|
1385 | + if ($objp->nature == 3 && !empty($conf->fournisseur->enabled)) { |
|
1386 | + $nature = "purchases"; |
|
1387 | + } |
|
1388 | + if ($objp->nature == 4 && !empty($conf->banque->enabled)) { |
|
1389 | + $nature = "bank"; |
|
1390 | + } |
|
1391 | + if ($objp->nature == 5 && !empty($conf->expensereport->enabled)) { |
|
1392 | + $nature = "expensereports"; |
|
1393 | + } |
|
1394 | + if ($objp->nature == 1) { |
|
1395 | + $nature = "various"; |
|
1396 | + } |
|
1397 | + if ($objp->nature == 8) { |
|
1398 | + $nature = "inventory"; |
|
1399 | + } |
|
1400 | + if ($objp->nature == 9) { |
|
1401 | + $nature = "hasnew"; |
|
1402 | + } |
|
1395 | 1403 | |
1396 | 1404 | // To enable when page exists |
1397 | 1405 | if (empty($conf->global->ACCOUNTANCY_SHOW_DEVELOP_JOURNAL)) { |
1398 | - if ($nature == 'various' || $nature == 'hasnew' || $nature == 'inventory') |
|
1399 | - $nature = ''; |
|
1406 | + if ($nature == 'various' || $nature == 'hasnew' || $nature == 'inventory') { |
|
1407 | + $nature = ''; |
|
1408 | + } |
|
1400 | 1409 | } |
1401 | 1410 | |
1402 | 1411 | if ($nature) { |
@@ -1411,8 +1420,9 @@ discard block |
||
1411 | 1420 | // Should not happend. Entries are added |
1412 | 1421 | $newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->rights->accounting->comptarapport->lire); |
1413 | 1422 | } |
1414 | - } else |
|
1415 | - dol_print_error($db); |
|
1423 | + } else { |
|
1424 | + dol_print_error($db); |
|
1425 | + } |
|
1416 | 1426 | $db->free($resql); |
1417 | 1427 | } |
1418 | 1428 | |
@@ -1446,8 +1456,10 @@ discard block |
||
1446 | 1456 | } |
1447 | 1457 | |
1448 | 1458 | $modecompta = 'CREANCES-DETTES'; |
1449 | - if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') |
|
1450 | - $modecompta = 'BOOKKEEPING'; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED |
|
1459 | + if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { |
|
1460 | + $modecompta = 'BOOKKEEPING'; |
|
1461 | + } |
|
1462 | + // Not yet implemented. Should be BOOKKEEPINGCOLLECTED |
|
1451 | 1463 | if ($modecompta) { |
1452 | 1464 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { |
1453 | 1465 | /* |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | // Security check |
40 | 40 | if ($user->societe_id > 0) |
41 | 41 | { |
42 | - $socid = $user->societe_id; |
|
42 | + $socid = $user->societe_id; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | $backtopage = GETPOST('backtopage','alpha'); |
@@ -51,40 +51,40 @@ discard block |
||
51 | 51 | |
52 | 52 | if (GETPOST('cancel','alpha') && ! empty($backtopage)) |
53 | 53 | { |
54 | - header("Location: ".$backtopage); |
|
55 | - exit; |
|
54 | + header("Location: ".$backtopage); |
|
55 | + exit; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | if (GETPOST('action','aZ09') == 'setremise') |
59 | 59 | { |
60 | - $object = new Societe($db); |
|
61 | - $object->fetch($id); |
|
62 | - |
|
63 | - $discount_type = GETPOST('discount_type', 'int'); |
|
64 | - |
|
65 | - if(! empty($discount_type)) { |
|
66 | - $result=$object->set_remise_supplier(price2num(GETPOST("remise")),GETPOST("note"),$user); |
|
67 | - } else { |
|
68 | - $result=$object->set_remise_client(price2num(GETPOST("remise")),GETPOST("note"),$user); |
|
69 | - } |
|
70 | - |
|
71 | - if ($result > 0) |
|
72 | - { |
|
73 | - if (! empty($backtopage)) |
|
74 | - { |
|
75 | - header("Location: ".$backtopage); |
|
76 | - exit; |
|
77 | - } |
|
78 | - else |
|
79 | - { |
|
80 | - header("Location: remise.php?id=".$_GET["id"]); |
|
81 | - exit; |
|
82 | - } |
|
83 | - } |
|
84 | - else |
|
85 | - { |
|
86 | - setEventMessages($object->error, $object->errors, 'errors'); |
|
87 | - } |
|
60 | + $object = new Societe($db); |
|
61 | + $object->fetch($id); |
|
62 | + |
|
63 | + $discount_type = GETPOST('discount_type', 'int'); |
|
64 | + |
|
65 | + if(! empty($discount_type)) { |
|
66 | + $result=$object->set_remise_supplier(price2num(GETPOST("remise")),GETPOST("note"),$user); |
|
67 | + } else { |
|
68 | + $result=$object->set_remise_client(price2num(GETPOST("remise")),GETPOST("note"),$user); |
|
69 | + } |
|
70 | + |
|
71 | + if ($result > 0) |
|
72 | + { |
|
73 | + if (! empty($backtopage)) |
|
74 | + { |
|
75 | + header("Location: ".$backtopage); |
|
76 | + exit; |
|
77 | + } |
|
78 | + else |
|
79 | + { |
|
80 | + header("Location: remise.php?id=".$_GET["id"]); |
|
81 | + exit; |
|
82 | + } |
|
83 | + } |
|
84 | + else |
|
85 | + { |
|
86 | + setEventMessages($object->error, $object->errors, 'errors'); |
|
87 | + } |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | |
@@ -104,21 +104,21 @@ discard block |
||
104 | 104 | *********************************************************************************/ |
105 | 105 | if ($socid > 0) |
106 | 106 | { |
107 | - // On recupere les donnees societes par l'objet |
|
108 | - $object = new Societe($db); |
|
109 | - $object->fetch($socid); |
|
107 | + // On recupere les donnees societes par l'objet |
|
108 | + $object = new Societe($db); |
|
109 | + $object->fetch($socid); |
|
110 | 110 | |
111 | - $head = societe_prepare_head($object); |
|
111 | + $head = societe_prepare_head($object); |
|
112 | 112 | |
113 | - $isCustomer = $object->client == 1 || $object->client == 3; |
|
114 | - $isSupplier = $object->fournisseur == 1; |
|
113 | + $isCustomer = $object->client == 1 || $object->client == 3; |
|
114 | + $isSupplier = $object->fournisseur == 1; |
|
115 | 115 | |
116 | - print '<form method="POST" action="remise.php?id='.$object->id.'">'; |
|
117 | - print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; |
|
118 | - print '<input type="hidden" name="action" value="setremise">'; |
|
116 | + print '<form method="POST" action="remise.php?id='.$object->id.'">'; |
|
117 | + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; |
|
118 | + print '<input type="hidden" name="action" value="setremise">'; |
|
119 | 119 | print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
120 | 120 | |
121 | - dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"), -1, 'company'); |
|
121 | + dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"), -1, 'company'); |
|
122 | 122 | |
123 | 123 | dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); |
124 | 124 | |
@@ -127,208 +127,208 @@ discard block |
||
127 | 127 | print '<div class="underbanner clearboth"></div>'; |
128 | 128 | |
129 | 129 | if(! $isCustomer && ! $isSupplier) { |
130 | - print '<p class="opacitymedium">'.$langs->trans('ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts').'</p>'; |
|
130 | + print '<p class="opacitymedium">'.$langs->trans('ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts').'</p>'; |
|
131 | 131 | |
132 | - dol_fiche_end(); |
|
132 | + dol_fiche_end(); |
|
133 | 133 | |
134 | - print '</form>'; |
|
134 | + print '</form>'; |
|
135 | 135 | |
136 | - // End of page |
|
136 | + // End of page |
|
137 | 137 | llxFooter(); |
138 | 138 | $db->close(); |
139 | - exit; |
|
139 | + exit; |
|
140 | 140 | } |
141 | 141 | |
142 | - print '<table class="border centpercent">'; |
|
142 | + print '<table class="border centpercent">'; |
|
143 | 143 | |
144 | - if($isCustomer) { |
|
145 | - // Customer discount |
|
146 | - print '<tr><td class="titlefield">'; |
|
147 | - print $langs->trans("CustomerRelativeDiscount").'</td><td>'.price2num($object->remise_percent)."%</td></tr>"; |
|
148 | - } |
|
144 | + if($isCustomer) { |
|
145 | + // Customer discount |
|
146 | + print '<tr><td class="titlefield">'; |
|
147 | + print $langs->trans("CustomerRelativeDiscount").'</td><td>'.price2num($object->remise_percent)."%</td></tr>"; |
|
148 | + } |
|
149 | 149 | |
150 | - if($isSupplier) { |
|
151 | - // Supplier discount |
|
152 | - print '<tr><td class="titlefield">'; |
|
153 | - print $langs->trans("SupplierRelativeDiscount").'</td><td>'.price2num($object->remise_supplier_percent)."%</td></tr>"; |
|
154 | - } |
|
150 | + if($isSupplier) { |
|
151 | + // Supplier discount |
|
152 | + print '<tr><td class="titlefield">'; |
|
153 | + print $langs->trans("SupplierRelativeDiscount").'</td><td>'.price2num($object->remise_supplier_percent)."%</td></tr>"; |
|
154 | + } |
|
155 | 155 | |
156 | - print '</table>'; |
|
157 | - print '<br>'; |
|
156 | + print '</table>'; |
|
157 | + print '<br>'; |
|
158 | 158 | |
159 | - print load_fiche_titre($langs->trans("NewRelativeDiscount"),'',''); |
|
159 | + print load_fiche_titre($langs->trans("NewRelativeDiscount"),'',''); |
|
160 | 160 | |
161 | - print '<div class="underbanner clearboth"></div>'; |
|
161 | + print '<div class="underbanner clearboth"></div>'; |
|
162 | 162 | |
163 | - if($isCustomer && ! $isSupplier) { |
|
164 | - print '<input type="hidden" name="discount_type" value="0" />'; |
|
165 | - } |
|
163 | + if($isCustomer && ! $isSupplier) { |
|
164 | + print '<input type="hidden" name="discount_type" value="0" />'; |
|
165 | + } |
|
166 | 166 | |
167 | - if(! $isCustomer && $isSupplier) { |
|
168 | - print '<input type="hidden" name="discount_type" value="1" />'; |
|
169 | - } |
|
167 | + if(! $isCustomer && $isSupplier) { |
|
168 | + print '<input type="hidden" name="discount_type" value="1" />'; |
|
169 | + } |
|
170 | 170 | |
171 | - print '<table class="border centpercent">'; |
|
171 | + print '<table class="border centpercent">'; |
|
172 | 172 | |
173 | - if($isCustomer && $isSupplier) { |
|
174 | - // Discount type |
|
175 | - print '<tr><td class="titlefield fieldrequired">'.$langs->trans('DiscountType').'</td>'; |
|
176 | - print '<td><input type="radio" name="discount_type" id="discount_type_0" selected value="0"/> <label for="discount_type_0">'.$langs->trans('Customer').'</label>'; |
|
177 | - print ' <input type="radio" name="discount_type" id="discount_type_1" selected value="1"/> <label for="discount_type_1">'.$langs->trans('Supplier').'</label>'; |
|
178 | - print '</td></tr>'; |
|
179 | - } |
|
173 | + if($isCustomer && $isSupplier) { |
|
174 | + // Discount type |
|
175 | + print '<tr><td class="titlefield fieldrequired">'.$langs->trans('DiscountType').'</td>'; |
|
176 | + print '<td><input type="radio" name="discount_type" id="discount_type_0" selected value="0"/> <label for="discount_type_0">'.$langs->trans('Customer').'</label>'; |
|
177 | + print ' <input type="radio" name="discount_type" id="discount_type_1" selected value="1"/> <label for="discount_type_1">'.$langs->trans('Supplier').'</label>'; |
|
178 | + print '</td></tr>'; |
|
179 | + } |
|
180 | 180 | |
181 | - // New value |
|
182 | - print '<tr><td class="titlefield fieldrequired">'; |
|
183 | - print $langs->trans("NewValue").'</td><td><input type="text" size="5" name="remise" value="'.dol_escape_htmltag(GETPOST("remise")).'">%</td></tr>'; |
|
181 | + // New value |
|
182 | + print '<tr><td class="titlefield fieldrequired">'; |
|
183 | + print $langs->trans("NewValue").'</td><td><input type="text" size="5" name="remise" value="'.dol_escape_htmltag(GETPOST("remise")).'">%</td></tr>'; |
|
184 | 184 | |
185 | - // Motif/Note |
|
186 | - print '<tr><td class="fieldrequired">'; |
|
187 | - print $langs->trans("NoteReason").'</td><td><input type="text" size="60" name="note" value="'.dol_escape_htmltag(GETPOST("note")).'"></td></tr>'; |
|
185 | + // Motif/Note |
|
186 | + print '<tr><td class="fieldrequired">'; |
|
187 | + print $langs->trans("NoteReason").'</td><td><input type="text" size="60" name="note" value="'.dol_escape_htmltag(GETPOST("note")).'"></td></tr>'; |
|
188 | 188 | |
189 | - print "</table>"; |
|
189 | + print "</table>"; |
|
190 | 190 | |
191 | - print '</div>'; |
|
191 | + print '</div>'; |
|
192 | 192 | |
193 | - dol_fiche_end(); |
|
193 | + dol_fiche_end(); |
|
194 | 194 | |
195 | - print '<div class="center">'; |
|
196 | - print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; |
|
195 | + print '<div class="center">'; |
|
196 | + print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; |
|
197 | 197 | if (! empty($backtopage)) |
198 | 198 | { |
199 | 199 | print ' '; |
200 | - print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
200 | + print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
201 | 201 | } |
202 | - print '</div>'; |
|
202 | + print '</div>'; |
|
203 | 203 | |
204 | - print "</form>"; |
|
204 | + print "</form>"; |
|
205 | 205 | |
206 | - print '<br>'; |
|
206 | + print '<br>'; |
|
207 | 207 | |
208 | - if($isCustomer) { |
|
209 | - if($isSupplier) { |
|
210 | - print '<div class="fichecenter">'; |
|
211 | - print '<div class="fichehalfleft">'; |
|
212 | - print load_fiche_titre($langs->trans("CustomerDiscounts"), '', ''); |
|
213 | - } |
|
208 | + if($isCustomer) { |
|
209 | + if($isSupplier) { |
|
210 | + print '<div class="fichecenter">'; |
|
211 | + print '<div class="fichehalfleft">'; |
|
212 | + print load_fiche_titre($langs->trans("CustomerDiscounts"), '', ''); |
|
213 | + } |
|
214 | 214 | |
215 | - /* |
|
215 | + /* |
|
216 | 216 | * List log of all customer percent discounts |
217 | 217 | */ |
218 | - $sql = "SELECT rc.rowid, rc.remise_client as remise_percent, rc.note, rc.datec as dc,"; |
|
219 | - $sql.= " u.login, u.rowid as user_id"; |
|
220 | - $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise as rc, ".MAIN_DB_PREFIX."user as u"; |
|
221 | - $sql.= " WHERE rc.fk_soc = " . $object->id; |
|
222 | - $sql.= " AND rc.entity = " . $conf->entity; |
|
223 | - $sql.= " AND u.rowid = rc.fk_user_author"; |
|
224 | - $sql.= " ORDER BY rc.datec DESC"; |
|
225 | - |
|
226 | - $resql=$db->query($sql); |
|
227 | - if ($resql) |
|
228 | - { |
|
229 | - print '<table class="noborder" width="100%">'; |
|
230 | - $tag = !$tag; |
|
231 | - print '<tr class="liste_titre">'; |
|
232 | - print '<td width="160">'.$langs->trans("Date").'</td>'; |
|
233 | - print '<td width="160" align="center">'.$langs->trans("CustomerRelativeDiscountShort").'</td>'; |
|
234 | - print '<td align="left">'.$langs->trans("NoteReason").'</td>'; |
|
235 | - print '<td align="center">'.$langs->trans("User").'</td>'; |
|
236 | - print '</tr>'; |
|
237 | - $num = $db->num_rows($resql); |
|
238 | - if ($num > 0) |
|
239 | - { |
|
240 | - $i = 0; |
|
241 | - while ($i < $num) |
|
242 | - { |
|
243 | - $obj = $db->fetch_object($resql); |
|
244 | - print '<tr class="oddeven">'; |
|
245 | - print '<td>'.dol_print_date($db->jdate($obj->dc),"dayhour").'</td>'; |
|
246 | - print '<td align="center">'.price2num($obj->remise_percent).'%</td>'; |
|
247 | - print '<td align="left">'.$obj->note.'</td>'; |
|
248 | - // print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>'; |
|
218 | + $sql = "SELECT rc.rowid, rc.remise_client as remise_percent, rc.note, rc.datec as dc,"; |
|
219 | + $sql.= " u.login, u.rowid as user_id"; |
|
220 | + $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise as rc, ".MAIN_DB_PREFIX."user as u"; |
|
221 | + $sql.= " WHERE rc.fk_soc = " . $object->id; |
|
222 | + $sql.= " AND rc.entity = " . $conf->entity; |
|
223 | + $sql.= " AND u.rowid = rc.fk_user_author"; |
|
224 | + $sql.= " ORDER BY rc.datec DESC"; |
|
225 | + |
|
226 | + $resql=$db->query($sql); |
|
227 | + if ($resql) |
|
228 | + { |
|
229 | + print '<table class="noborder" width="100%">'; |
|
230 | + $tag = !$tag; |
|
231 | + print '<tr class="liste_titre">'; |
|
232 | + print '<td width="160">'.$langs->trans("Date").'</td>'; |
|
233 | + print '<td width="160" align="center">'.$langs->trans("CustomerRelativeDiscountShort").'</td>'; |
|
234 | + print '<td align="left">'.$langs->trans("NoteReason").'</td>'; |
|
235 | + print '<td align="center">'.$langs->trans("User").'</td>'; |
|
236 | + print '</tr>'; |
|
237 | + $num = $db->num_rows($resql); |
|
238 | + if ($num > 0) |
|
239 | + { |
|
240 | + $i = 0; |
|
241 | + while ($i < $num) |
|
242 | + { |
|
243 | + $obj = $db->fetch_object($resql); |
|
244 | + print '<tr class="oddeven">'; |
|
245 | + print '<td>'.dol_print_date($db->jdate($obj->dc),"dayhour").'</td>'; |
|
246 | + print '<td align="center">'.price2num($obj->remise_percent).'%</td>'; |
|
247 | + print '<td align="left">'.$obj->note.'</td>'; |
|
248 | + // print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>'; |
|
249 | 249 | print '<td align="center"><a href="' . BASE_URI . '?controller=user&method=card&id=' . $obj->user_id . '">' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $obj->login . '</a></td>'; |
250 | 250 | print '</tr>'; |
251 | - $i++; |
|
252 | - } |
|
253 | - } |
|
254 | - else |
|
255 | - { |
|
256 | - print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; |
|
257 | - } |
|
258 | - $db->free($resql); |
|
259 | - print "</table>"; |
|
260 | - } |
|
261 | - else |
|
262 | - { |
|
263 | - dol_print_error($db); |
|
264 | - } |
|
265 | - } |
|
266 | - |
|
267 | - if($isSupplier) { |
|
268 | - if($isCustomer) { |
|
269 | - print '</div>'; // class="fichehalfleft" |
|
270 | - print '<div class="fichehalfright">'; |
|
271 | - print '<div class="ficheaddleft">'; |
|
272 | - print load_fiche_titre($langs->trans("SupplierDiscounts"), '', ''); |
|
273 | - } |
|
274 | - |
|
275 | - /* |
|
251 | + $i++; |
|
252 | + } |
|
253 | + } |
|
254 | + else |
|
255 | + { |
|
256 | + print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; |
|
257 | + } |
|
258 | + $db->free($resql); |
|
259 | + print "</table>"; |
|
260 | + } |
|
261 | + else |
|
262 | + { |
|
263 | + dol_print_error($db); |
|
264 | + } |
|
265 | + } |
|
266 | + |
|
267 | + if($isSupplier) { |
|
268 | + if($isCustomer) { |
|
269 | + print '</div>'; // class="fichehalfleft" |
|
270 | + print '<div class="fichehalfright">'; |
|
271 | + print '<div class="ficheaddleft">'; |
|
272 | + print load_fiche_titre($langs->trans("SupplierDiscounts"), '', ''); |
|
273 | + } |
|
274 | + |
|
275 | + /* |
|
276 | 276 | * List log of all supplier percent discounts |
277 | 277 | */ |
278 | - $sql = "SELECT rc.rowid, rc.remise_supplier as remise_percent, rc.note, rc.datec as dc,"; |
|
279 | - $sql.= " u.login, u.rowid as user_id"; |
|
280 | - $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_supplier as rc, ".MAIN_DB_PREFIX."user as u"; |
|
281 | - $sql.= " WHERE rc.fk_soc = " . $object->id; |
|
282 | - $sql.= " AND rc.entity = " . $conf->entity; |
|
283 | - $sql.= " AND u.rowid = rc.fk_user_author"; |
|
284 | - $sql.= " ORDER BY rc.datec DESC"; |
|
285 | - |
|
286 | - $resql=$db->query($sql); |
|
287 | - if ($resql) |
|
288 | - { |
|
289 | - print '<table class="noborder" width="100%">'; |
|
290 | - $tag = !$tag; |
|
291 | - print '<tr class="liste_titre">'; |
|
292 | - print '<td width="160">'.$langs->trans("Date").'</td>'; |
|
293 | - print '<td width="160" align="center">'.$langs->trans("CustomerRelativeDiscountShort").'</td>'; |
|
294 | - print '<td align="left">'.$langs->trans("NoteReason").'</td>'; |
|
295 | - print '<td align="center">'.$langs->trans("User").'</td>'; |
|
296 | - print '</tr>'; |
|
297 | - $num = $db->num_rows($resql); |
|
298 | - if ($num > 0) |
|
299 | - { |
|
300 | - $i = 0; |
|
301 | - while ($i < $num) |
|
302 | - { |
|
303 | - $obj = $db->fetch_object($resql); |
|
304 | - print '<tr class="oddeven">'; |
|
305 | - print '<td>'.dol_print_date($db->jdate($obj->dc),"dayhour").'</td>'; |
|
306 | - print '<td align="center">'.price2num($obj->remise_percent).'%</td>'; |
|
307 | - print '<td align="left">'.$obj->note.'</td>'; |
|
308 | - // print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>'; |
|
278 | + $sql = "SELECT rc.rowid, rc.remise_supplier as remise_percent, rc.note, rc.datec as dc,"; |
|
279 | + $sql.= " u.login, u.rowid as user_id"; |
|
280 | + $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_supplier as rc, ".MAIN_DB_PREFIX."user as u"; |
|
281 | + $sql.= " WHERE rc.fk_soc = " . $object->id; |
|
282 | + $sql.= " AND rc.entity = " . $conf->entity; |
|
283 | + $sql.= " AND u.rowid = rc.fk_user_author"; |
|
284 | + $sql.= " ORDER BY rc.datec DESC"; |
|
285 | + |
|
286 | + $resql=$db->query($sql); |
|
287 | + if ($resql) |
|
288 | + { |
|
289 | + print '<table class="noborder" width="100%">'; |
|
290 | + $tag = !$tag; |
|
291 | + print '<tr class="liste_titre">'; |
|
292 | + print '<td width="160">'.$langs->trans("Date").'</td>'; |
|
293 | + print '<td width="160" align="center">'.$langs->trans("CustomerRelativeDiscountShort").'</td>'; |
|
294 | + print '<td align="left">'.$langs->trans("NoteReason").'</td>'; |
|
295 | + print '<td align="center">'.$langs->trans("User").'</td>'; |
|
296 | + print '</tr>'; |
|
297 | + $num = $db->num_rows($resql); |
|
298 | + if ($num > 0) |
|
299 | + { |
|
300 | + $i = 0; |
|
301 | + while ($i < $num) |
|
302 | + { |
|
303 | + $obj = $db->fetch_object($resql); |
|
304 | + print '<tr class="oddeven">'; |
|
305 | + print '<td>'.dol_print_date($db->jdate($obj->dc),"dayhour").'</td>'; |
|
306 | + print '<td align="center">'.price2num($obj->remise_percent).'%</td>'; |
|
307 | + print '<td align="left">'.$obj->note.'</td>'; |
|
308 | + // print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>'; |
|
309 | 309 | print '<td align="center"><a href="' . BASE_URI . '?controller=user&method=card&id=' . $obj->user_id . '">' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $obj->login . '</a></td>'; |
310 | 310 | print '</tr>'; |
311 | - $i++; |
|
312 | - } |
|
313 | - } |
|
314 | - else |
|
315 | - { |
|
316 | - print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; |
|
317 | - } |
|
318 | - $db->free($resql); |
|
319 | - print "</table>"; |
|
320 | - } |
|
321 | - else |
|
322 | - { |
|
323 | - dol_print_error($db); |
|
324 | - } |
|
325 | - |
|
326 | - if($isCustomer) { |
|
327 | - print '</div>'; // class="ficheaddleft" |
|
328 | - print '</div>'; // class="fichehalfright" |
|
329 | - print '</div>'; // class="fichecenter" |
|
330 | - } |
|
331 | - } |
|
311 | + $i++; |
|
312 | + } |
|
313 | + } |
|
314 | + else |
|
315 | + { |
|
316 | + print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; |
|
317 | + } |
|
318 | + $db->free($resql); |
|
319 | + print "</table>"; |
|
320 | + } |
|
321 | + else |
|
322 | + { |
|
323 | + dol_print_error($db); |
|
324 | + } |
|
325 | + |
|
326 | + if($isCustomer) { |
|
327 | + print '</div>'; // class="ficheaddleft" |
|
328 | + print '</div>'; // class="fichehalfright" |
|
329 | + print '</div>'; // class="fichecenter" |
|
330 | + } |
|
331 | + } |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | // End of page |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | |
27 | 27 | |
28 | -require DOL_BASE_PATH . '/main.inc.php'; |
|
28 | +require DOL_BASE_PATH.'/main.inc.php'; |
|
29 | 29 | |
30 | 30 | require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
31 | 31 | require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
@@ -33,44 +33,44 @@ discard block |
||
33 | 33 | // Load translation files required by the page |
34 | 34 | $langs->loadLangs(array('companies', 'orders', 'bills')); |
35 | 35 | |
36 | -$id=GETPOST("id",'int'); |
|
36 | +$id = GETPOST("id", 'int'); |
|
37 | 37 | |
38 | -$socid = GETPOST('id','int')?GETPOST('id','int'):GETPOST('socid','int'); |
|
38 | +$socid = GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('socid', 'int'); |
|
39 | 39 | // Security check |
40 | 40 | if ($user->societe_id > 0) |
41 | 41 | { |
42 | 42 | $socid = $user->societe_id; |
43 | 43 | } |
44 | 44 | |
45 | -$backtopage = GETPOST('backtopage','alpha'); |
|
45 | +$backtopage = GETPOST('backtopage', 'alpha'); |
|
46 | 46 | |
47 | 47 | |
48 | 48 | /* |
49 | 49 | * Actions |
50 | 50 | */ |
51 | 51 | |
52 | -if (GETPOST('cancel','alpha') && ! empty($backtopage)) |
|
52 | +if (GETPOST('cancel', 'alpha') && !empty($backtopage)) |
|
53 | 53 | { |
54 | 54 | header("Location: ".$backtopage); |
55 | 55 | exit; |
56 | 56 | } |
57 | 57 | |
58 | -if (GETPOST('action','aZ09') == 'setremise') |
|
58 | +if (GETPOST('action', 'aZ09') == 'setremise') |
|
59 | 59 | { |
60 | 60 | $object = new Societe($db); |
61 | 61 | $object->fetch($id); |
62 | 62 | |
63 | 63 | $discount_type = GETPOST('discount_type', 'int'); |
64 | 64 | |
65 | - if(! empty($discount_type)) { |
|
66 | - $result=$object->set_remise_supplier(price2num(GETPOST("remise")),GETPOST("note"),$user); |
|
65 | + if (!empty($discount_type)) { |
|
66 | + $result = $object->set_remise_supplier(price2num(GETPOST("remise")), GETPOST("note"), $user); |
|
67 | 67 | } else { |
68 | - $result=$object->set_remise_client(price2num(GETPOST("remise")),GETPOST("note"),$user); |
|
68 | + $result = $object->set_remise_client(price2num(GETPOST("remise")), GETPOST("note"), $user); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | if ($result > 0) |
72 | 72 | { |
73 | - if (! empty($backtopage)) |
|
73 | + if (!empty($backtopage)) |
|
74 | 74 | { |
75 | 75 | header("Location: ".$backtopage); |
76 | 76 | exit; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * View |
93 | 93 | */ |
94 | 94 | |
95 | -$form=new Form($db); |
|
95 | +$form = new Form($db); |
|
96 | 96 | |
97 | 97 | llxHeader(); |
98 | 98 | |
@@ -120,13 +120,13 @@ discard block |
||
120 | 120 | |
121 | 121 | dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"), -1, 'company'); |
122 | 122 | |
123 | - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); |
|
123 | + dol_banner_tab($object, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom'); |
|
124 | 124 | |
125 | 125 | print '<div class="fichecenter">'; |
126 | 126 | |
127 | 127 | print '<div class="underbanner clearboth"></div>'; |
128 | 128 | |
129 | - if(! $isCustomer && ! $isSupplier) { |
|
129 | + if (!$isCustomer && !$isSupplier) { |
|
130 | 130 | print '<p class="opacitymedium">'.$langs->trans('ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts').'</p>'; |
131 | 131 | |
132 | 132 | dol_fiche_end(); |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | |
142 | 142 | print '<table class="border centpercent">'; |
143 | 143 | |
144 | - if($isCustomer) { |
|
144 | + if ($isCustomer) { |
|
145 | 145 | // Customer discount |
146 | 146 | print '<tr><td class="titlefield">'; |
147 | 147 | print $langs->trans("CustomerRelativeDiscount").'</td><td>'.price2num($object->remise_percent)."%</td></tr>"; |
148 | 148 | } |
149 | 149 | |
150 | - if($isSupplier) { |
|
150 | + if ($isSupplier) { |
|
151 | 151 | // Supplier discount |
152 | 152 | print '<tr><td class="titlefield">'; |
153 | 153 | print $langs->trans("SupplierRelativeDiscount").'</td><td>'.price2num($object->remise_supplier_percent)."%</td></tr>"; |
@@ -156,21 +156,21 @@ discard block |
||
156 | 156 | print '</table>'; |
157 | 157 | print '<br>'; |
158 | 158 | |
159 | - print load_fiche_titre($langs->trans("NewRelativeDiscount"),'',''); |
|
159 | + print load_fiche_titre($langs->trans("NewRelativeDiscount"), '', ''); |
|
160 | 160 | |
161 | 161 | print '<div class="underbanner clearboth"></div>'; |
162 | 162 | |
163 | - if($isCustomer && ! $isSupplier) { |
|
163 | + if ($isCustomer && !$isSupplier) { |
|
164 | 164 | print '<input type="hidden" name="discount_type" value="0" />'; |
165 | 165 | } |
166 | 166 | |
167 | - if(! $isCustomer && $isSupplier) { |
|
167 | + if (!$isCustomer && $isSupplier) { |
|
168 | 168 | print '<input type="hidden" name="discount_type" value="1" />'; |
169 | 169 | } |
170 | 170 | |
171 | 171 | print '<table class="border centpercent">'; |
172 | 172 | |
173 | - if($isCustomer && $isSupplier) { |
|
173 | + if ($isCustomer && $isSupplier) { |
|
174 | 174 | // Discount type |
175 | 175 | print '<tr><td class="titlefield fieldrequired">'.$langs->trans('DiscountType').'</td>'; |
176 | 176 | print '<td><input type="radio" name="discount_type" id="discount_type_0" selected value="0"/> <label for="discount_type_0">'.$langs->trans('Customer').'</label>'; |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | |
195 | 195 | print '<div class="center">'; |
196 | 196 | print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; |
197 | - if (! empty($backtopage)) |
|
197 | + if (!empty($backtopage)) |
|
198 | 198 | { |
199 | 199 | print ' '; |
200 | 200 | print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; |
@@ -205,8 +205,8 @@ discard block |
||
205 | 205 | |
206 | 206 | print '<br>'; |
207 | 207 | |
208 | - if($isCustomer) { |
|
209 | - if($isSupplier) { |
|
208 | + if ($isCustomer) { |
|
209 | + if ($isSupplier) { |
|
210 | 210 | print '<div class="fichecenter">'; |
211 | 211 | print '<div class="fichehalfleft">'; |
212 | 212 | print load_fiche_titre($langs->trans("CustomerDiscounts"), '', ''); |
@@ -215,15 +215,15 @@ discard block |
||
215 | 215 | /* |
216 | 216 | * List log of all customer percent discounts |
217 | 217 | */ |
218 | - $sql = "SELECT rc.rowid, rc.remise_client as remise_percent, rc.note, rc.datec as dc,"; |
|
219 | - $sql.= " u.login, u.rowid as user_id"; |
|
220 | - $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise as rc, ".MAIN_DB_PREFIX."user as u"; |
|
221 | - $sql.= " WHERE rc.fk_soc = " . $object->id; |
|
222 | - $sql.= " AND rc.entity = " . $conf->entity; |
|
223 | - $sql.= " AND u.rowid = rc.fk_user_author"; |
|
224 | - $sql.= " ORDER BY rc.datec DESC"; |
|
225 | - |
|
226 | - $resql=$db->query($sql); |
|
218 | + $sql = "SELECT rc.rowid, rc.remise_client as remise_percent, rc.note, rc.datec as dc,"; |
|
219 | + $sql .= " u.login, u.rowid as user_id"; |
|
220 | + $sql .= " FROM ".MAIN_DB_PREFIX."societe_remise as rc, ".MAIN_DB_PREFIX."user as u"; |
|
221 | + $sql .= " WHERE rc.fk_soc = ".$object->id; |
|
222 | + $sql .= " AND rc.entity = ".$conf->entity; |
|
223 | + $sql .= " AND u.rowid = rc.fk_user_author"; |
|
224 | + $sql .= " ORDER BY rc.datec DESC"; |
|
225 | + |
|
226 | + $resql = $db->query($sql); |
|
227 | 227 | if ($resql) |
228 | 228 | { |
229 | 229 | print '<table class="noborder" width="100%">'; |
@@ -242,11 +242,11 @@ discard block |
||
242 | 242 | { |
243 | 243 | $obj = $db->fetch_object($resql); |
244 | 244 | print '<tr class="oddeven">'; |
245 | - print '<td>'.dol_print_date($db->jdate($obj->dc),"dayhour").'</td>'; |
|
245 | + print '<td>'.dol_print_date($db->jdate($obj->dc), "dayhour").'</td>'; |
|
246 | 246 | print '<td align="center">'.price2num($obj->remise_percent).'%</td>'; |
247 | 247 | print '<td align="left">'.$obj->note.'</td>'; |
248 | 248 | // print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>'; |
249 | - print '<td align="center"><a href="' . BASE_URI . '?controller=user&method=card&id=' . $obj->user_id . '">' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $obj->login . '</a></td>'; |
|
249 | + print '<td align="center"><a href="'.BASE_URI.'?controller=user&method=card&id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.'</a></td>'; |
|
250 | 250 | print '</tr>'; |
251 | 251 | $i++; |
252 | 252 | } |
@@ -264,8 +264,8 @@ discard block |
||
264 | 264 | } |
265 | 265 | } |
266 | 266 | |
267 | - if($isSupplier) { |
|
268 | - if($isCustomer) { |
|
267 | + if ($isSupplier) { |
|
268 | + if ($isCustomer) { |
|
269 | 269 | print '</div>'; // class="fichehalfleft" |
270 | 270 | print '<div class="fichehalfright">'; |
271 | 271 | print '<div class="ficheaddleft">'; |
@@ -275,15 +275,15 @@ discard block |
||
275 | 275 | /* |
276 | 276 | * List log of all supplier percent discounts |
277 | 277 | */ |
278 | - $sql = "SELECT rc.rowid, rc.remise_supplier as remise_percent, rc.note, rc.datec as dc,"; |
|
279 | - $sql.= " u.login, u.rowid as user_id"; |
|
280 | - $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_supplier as rc, ".MAIN_DB_PREFIX."user as u"; |
|
281 | - $sql.= " WHERE rc.fk_soc = " . $object->id; |
|
282 | - $sql.= " AND rc.entity = " . $conf->entity; |
|
283 | - $sql.= " AND u.rowid = rc.fk_user_author"; |
|
284 | - $sql.= " ORDER BY rc.datec DESC"; |
|
285 | - |
|
286 | - $resql=$db->query($sql); |
|
278 | + $sql = "SELECT rc.rowid, rc.remise_supplier as remise_percent, rc.note, rc.datec as dc,"; |
|
279 | + $sql .= " u.login, u.rowid as user_id"; |
|
280 | + $sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_supplier as rc, ".MAIN_DB_PREFIX."user as u"; |
|
281 | + $sql .= " WHERE rc.fk_soc = ".$object->id; |
|
282 | + $sql .= " AND rc.entity = ".$conf->entity; |
|
283 | + $sql .= " AND u.rowid = rc.fk_user_author"; |
|
284 | + $sql .= " ORDER BY rc.datec DESC"; |
|
285 | + |
|
286 | + $resql = $db->query($sql); |
|
287 | 287 | if ($resql) |
288 | 288 | { |
289 | 289 | print '<table class="noborder" width="100%">'; |
@@ -302,11 +302,11 @@ discard block |
||
302 | 302 | { |
303 | 303 | $obj = $db->fetch_object($resql); |
304 | 304 | print '<tr class="oddeven">'; |
305 | - print '<td>'.dol_print_date($db->jdate($obj->dc),"dayhour").'</td>'; |
|
305 | + print '<td>'.dol_print_date($db->jdate($obj->dc), "dayhour").'</td>'; |
|
306 | 306 | print '<td align="center">'.price2num($obj->remise_percent).'%</td>'; |
307 | 307 | print '<td align="left">'.$obj->note.'</td>'; |
308 | 308 | // print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>'; |
309 | - print '<td align="center"><a href="' . BASE_URI . '?controller=user&method=card&id=' . $obj->user_id . '">' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $obj->login . '</a></td>'; |
|
309 | + print '<td align="center"><a href="'.BASE_URI.'?controller=user&method=card&id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.'</a></td>'; |
|
310 | 310 | print '</tr>'; |
311 | 311 | $i++; |
312 | 312 | } |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | dol_print_error($db); |
324 | 324 | } |
325 | 325 | |
326 | - if($isCustomer) { |
|
326 | + if ($isCustomer) { |
|
327 | 327 | print '</div>'; // class="ficheaddleft" |
328 | 328 | print '</div>'; // class="fichehalfright" |
329 | 329 | print '</div>'; // class="fichecenter" |
@@ -74,14 +74,12 @@ discard block |
||
74 | 74 | { |
75 | 75 | header("Location: ".$backtopage); |
76 | 76 | exit; |
77 | - } |
|
78 | - else |
|
77 | + } else |
|
79 | 78 | { |
80 | 79 | header("Location: remise.php?id=".$_GET["id"]); |
81 | 80 | exit; |
82 | 81 | } |
83 | - } |
|
84 | - else |
|
82 | + } else |
|
85 | 83 | { |
86 | 84 | setEventMessages($object->error, $object->errors, 'errors'); |
87 | 85 | } |
@@ -250,15 +248,13 @@ discard block |
||
250 | 248 | print '</tr>'; |
251 | 249 | $i++; |
252 | 250 | } |
253 | - } |
|
254 | - else |
|
251 | + } else |
|
255 | 252 | { |
256 | 253 | print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; |
257 | 254 | } |
258 | 255 | $db->free($resql); |
259 | 256 | print "</table>"; |
260 | - } |
|
261 | - else |
|
257 | + } else |
|
262 | 258 | { |
263 | 259 | dol_print_error($db); |
264 | 260 | } |
@@ -310,15 +306,13 @@ discard block |
||
310 | 306 | print '</tr>'; |
311 | 307 | $i++; |
312 | 308 | } |
313 | - } |
|
314 | - else |
|
309 | + } else |
|
315 | 310 | { |
316 | 311 | print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; |
317 | 312 | } |
318 | 313 | $db->free($resql); |
319 | 314 | print "</table>"; |
320 | - } |
|
321 | - else |
|
315 | + } else |
|
322 | 316 | { |
323 | 317 | dol_print_error($db); |
324 | 318 | } |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | * \ingroup societe |
25 | 25 | * \brief Page to edit absolute discounts for a customer |
26 | 26 | */ |
27 | -require DOL_BASE_PATH . '/main.inc.php'; |
|
27 | +require DOL_BASE_PATH.'/main.inc.php'; |
|
28 | 28 | |
29 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
30 | -require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
31 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; |
|
32 | -require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; |
|
29 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
30 | +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
31 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; |
|
33 | 33 | |
34 | 34 | // Load translation files required by the page |
35 | 35 | $langs->loadLangs(array('orders', 'bills', 'companies')); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | |
53 | 53 | if (GETPOST('cancel', 'alpha') && !empty($backtopage)) { |
54 | - header("Location: " . $backtopage); |
|
54 | + header("Location: ".$backtopage); |
|
55 | 55 | exit; |
56 | 56 | } |
57 | 57 | |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | $newdiscount1->description = $discount->description; |
98 | 98 | $newdiscount2->description = $discount->description; |
99 | 99 | } else { |
100 | - $newdiscount1->description = $discount->description . ' (1)'; |
|
101 | - $newdiscount2->description = $discount->description . ' (2)'; |
|
100 | + $newdiscount1->description = $discount->description.' (1)'; |
|
101 | + $newdiscount2->description = $discount->description.' (2)'; |
|
102 | 102 | } |
103 | 103 | $newdiscount1->fk_user = $discount->fk_user; |
104 | 104 | $newdiscount2->fk_user = $discount->fk_user; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $newid2 = $newdiscount2->create($user); |
125 | 125 | if ($res > 0 && $newid1 > 0 && $newid2 > 0) { |
126 | 126 | $db->commit(); |
127 | - header("Location: " . $_SERVER["PHP_SELF"] . '?id=' . $id . ($backtopage ? '&backtopage=' . urlencode($backtopage) : '')); // To avoid pb whith back |
|
127 | + header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id.($backtopage ? '&backtopage='.urlencode($backtopage) : '')); // To avoid pb whith back |
|
128 | 128 | exit; |
129 | 129 | } else { |
130 | 130 | $db->rollback(); |
@@ -155,10 +155,10 @@ discard block |
||
155 | 155 | |
156 | 156 | if ($discountid > 0) { |
157 | 157 | if (!empty($backtopage)) { |
158 | - header("Location: " . $backtopage . '&discountid=' . $discountid); |
|
158 | + header("Location: ".$backtopage.'&discountid='.$discountid); |
|
159 | 159 | exit; |
160 | 160 | } else { |
161 | - header("Location: remx.php?id=" . $id); |
|
161 | + header("Location: remx.php?id=".$id); |
|
162 | 162 | exit; |
163 | 163 | } |
164 | 164 | } else { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $result = $discount->delete($user); |
183 | 183 | if ($result > 0) { |
184 | 184 | $db->commit(); |
185 | - header("Location: " . $_SERVER["PHP_SELF"] . '?id=' . $id); // To avoid pb whith back |
|
185 | + header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id); // To avoid pb whith back |
|
186 | 186 | exit; |
187 | 187 | } else { |
188 | 188 | setEventMessages($discount->error, $discount->errors, 'errors'); |
@@ -214,10 +214,10 @@ discard block |
||
214 | 214 | */ |
215 | 215 | $head = societe_prepare_head($object); |
216 | 216 | |
217 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '">'; |
|
218 | - print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; |
|
217 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">'; |
|
218 | + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; |
|
219 | 219 | print '<input type="hidden" name="action" value="setremise">'; |
220 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
220 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
221 | 221 | |
222 | 222 | dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"), 0, 'company'); |
223 | 223 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | print '<div class="underbanner clearboth"></div>'; |
229 | 229 | |
230 | 230 | if (!$isCustomer && !$isSupplier) { |
231 | - print '<p class="opacitymedium">' . $langs->trans('ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts') . '</p>'; |
|
231 | + print '<p class="opacitymedium">'.$langs->trans('ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts').'</p>'; |
|
232 | 232 | |
233 | 233 | dol_fiche_end(); |
234 | 234 | |
@@ -245,9 +245,9 @@ discard block |
||
245 | 245 | if ($isCustomer) { // Calcul avoirs client en cours |
246 | 246 | $remise_all = $remise_user = 0; |
247 | 247 | $sql = "SELECT SUM(rc.amount_ht) as amount, rc.fk_user"; |
248 | - $sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as rc"; |
|
249 | - $sql .= " WHERE rc.fk_soc = " . $object->id; |
|
250 | - $sql .= " AND rc.entity = " . $conf->entity; |
|
248 | + $sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_except as rc"; |
|
249 | + $sql .= " WHERE rc.fk_soc = ".$object->id; |
|
250 | + $sql .= " AND rc.entity = ".$conf->entity; |
|
251 | 251 | $sql .= " AND discount_type = 0"; // Exclude supplier discounts |
252 | 252 | $sql .= " AND (fk_facture_line IS NULL AND fk_facture IS NULL)"; |
253 | 253 | $sql .= " GROUP BY rc.fk_user"; |
@@ -262,12 +262,12 @@ discard block |
||
262 | 262 | dol_print_error($db); |
263 | 263 | } |
264 | 264 | |
265 | - print '<tr><td class="titlefield">' . $langs->trans("CustomerAbsoluteDiscountAllUsers") . '</td>'; |
|
266 | - print '<td>' . $remise_all . ' ' . $langs->trans("Currency" . $conf->currency) . ' ' . $langs->trans("HT") . '</td></tr>'; |
|
265 | + print '<tr><td class="titlefield">'.$langs->trans("CustomerAbsoluteDiscountAllUsers").'</td>'; |
|
266 | + print '<td>'.$remise_all.' '.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").'</td></tr>'; |
|
267 | 267 | |
268 | 268 | if (!empty($user->fk_soc)) { // No need to show this for external users |
269 | - print '<tr><td>' . $langs->trans("CustomerAbsoluteDiscountMy") . '</td>'; |
|
270 | - print '<td>' . $remise_user . ' ' . $langs->trans("Currency" . $conf->currency) . ' ' . $langs->trans("HT") . '</td></tr>'; |
|
269 | + print '<tr><td>'.$langs->trans("CustomerAbsoluteDiscountMy").'</td>'; |
|
270 | + print '<td>'.$remise_user.' '.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").'</td></tr>'; |
|
271 | 271 | } |
272 | 272 | } |
273 | 273 | |
@@ -275,9 +275,9 @@ discard block |
||
275 | 275 | // Calcul avoirs fournisseur en cours |
276 | 276 | $remise_all = $remise_user = 0; |
277 | 277 | $sql = "SELECT SUM(rc.amount_ht) as amount, rc.fk_user"; |
278 | - $sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as rc"; |
|
279 | - $sql .= " WHERE rc.fk_soc = " . $object->id; |
|
280 | - $sql .= " AND rc.entity = " . $conf->entity; |
|
278 | + $sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_except as rc"; |
|
279 | + $sql .= " WHERE rc.fk_soc = ".$object->id; |
|
280 | + $sql .= " AND rc.entity = ".$conf->entity; |
|
281 | 281 | $sql .= " AND discount_type = 1"; // Exclude customer discounts |
282 | 282 | $sql .= " AND (fk_invoice_supplier_line IS NULL AND fk_invoice_supplier IS NULL)"; |
283 | 283 | $sql .= " GROUP BY rc.fk_user"; |
@@ -292,12 +292,12 @@ discard block |
||
292 | 292 | dol_print_error($db); |
293 | 293 | } |
294 | 294 | |
295 | - print '<tr><td class="titlefield">' . $langs->trans("SupplierAbsoluteDiscountAllUsers") . '</td>'; |
|
296 | - print '<td>' . $remise_all . ' ' . $langs->trans("Currency" . $conf->currency) . ' ' . $langs->trans("HT") . '</td></tr>'; |
|
295 | + print '<tr><td class="titlefield">'.$langs->trans("SupplierAbsoluteDiscountAllUsers").'</td>'; |
|
296 | + print '<td>'.$remise_all.' '.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").'</td></tr>'; |
|
297 | 297 | |
298 | 298 | if (!empty($user->fk_soc)) { // No need to show this for external users |
299 | - print '<tr><td>' . $langs->trans("SupplierAbsoluteDiscountMy") . '</td>'; |
|
300 | - print '<td>' . $remise_user . ' ' . $langs->trans("Currency" . $conf->currency) . ' ' . $langs->trans("HT") . '</td></tr>'; |
|
299 | + print '<tr><td>'.$langs->trans("SupplierAbsoluteDiscountMy").'</td>'; |
|
300 | + print '<td>'.$remise_user.' '.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").'</td></tr>'; |
|
301 | 301 | } |
302 | 302 | } |
303 | 303 | |
@@ -322,20 +322,20 @@ discard block |
||
322 | 322 | |
323 | 323 | print '<table class="border" width="100%">'; |
324 | 324 | if ($isCustomer && $isSupplier) { |
325 | - print '<tr><td class="titlefield fieldrequired">' . $langs->trans('DiscountType') . '</td>'; |
|
326 | - print '<td><input type="radio" name="discount_type" id="discount_type_0" checked="checked" value="0"/> <label for="discount_type_0">' . $langs->trans('Customer') . '</label>'; |
|
327 | - print ' <input type="radio" name="discount_type" id="discount_type_1" value="1"/> <label for="discount_type_1">' . $langs->trans('Supplier') . '</label>'; |
|
325 | + print '<tr><td class="titlefield fieldrequired">'.$langs->trans('DiscountType').'</td>'; |
|
326 | + print '<td><input type="radio" name="discount_type" id="discount_type_0" checked="checked" value="0"/> <label for="discount_type_0">'.$langs->trans('Customer').'</label>'; |
|
327 | + print ' <input type="radio" name="discount_type" id="discount_type_1" value="1"/> <label for="discount_type_1">'.$langs->trans('Supplier').'</label>'; |
|
328 | 328 | print '</td></tr>'; |
329 | 329 | } |
330 | - print '<tr><td class="titlefield fieldrequired">' . $langs->trans("AmountHT") . '</td>'; |
|
331 | - print '<td><input type="text" size="5" name="amount_ht" value="' . price2num(GETPOST("amount_ht")) . '">'; |
|
332 | - print '<span class="hideonsmartphone"> ' . $langs->trans("Currency" . $conf->currency) . '</span></td></tr>'; |
|
333 | - print '<tr><td>' . $langs->trans("VAT") . '</td>'; |
|
330 | + print '<tr><td class="titlefield fieldrequired">'.$langs->trans("AmountHT").'</td>'; |
|
331 | + print '<td><input type="text" size="5" name="amount_ht" value="'.price2num(GETPOST("amount_ht")).'">'; |
|
332 | + print '<span class="hideonsmartphone"> '.$langs->trans("Currency".$conf->currency).'</span></td></tr>'; |
|
333 | + print '<tr><td>'.$langs->trans("VAT").'</td>'; |
|
334 | 334 | print '<td>'; |
335 | 335 | print $form->load_tva('tva_tx', GETPOST('tva_tx'), $mysoc, $object); |
336 | 336 | print '</td></tr>'; |
337 | - print '<tr><td class="fieldrequired" >' . $langs->trans("NoteReason") . '</td>'; |
|
338 | - print '<td><input type="text" class="quatrevingtpercent" name="desc" value="' . GETPOST('desc', 'none') . '"></td></tr>'; |
|
337 | + print '<tr><td class="fieldrequired" >'.$langs->trans("NoteReason").'</td>'; |
|
338 | + print '<td><input type="text" class="quatrevingtpercent" name="desc" value="'.GETPOST('desc', 'none').'"></td></tr>'; |
|
339 | 339 | |
340 | 340 | print "</table>"; |
341 | 341 | } |
@@ -344,10 +344,10 @@ discard block |
||
344 | 344 | |
345 | 345 | if ($user->rights->societe->creer) { |
346 | 346 | print '<div class="center">'; |
347 | - print '<input type="submit" class="button" name="submit" value="' . $langs->trans("AddGlobalDiscount") . '">'; |
|
347 | + print '<input type="submit" class="button" name="submit" value="'.$langs->trans("AddGlobalDiscount").'">'; |
|
348 | 348 | if (!empty($backtopage)) { |
349 | 349 | print ' '; |
350 | - print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
350 | + print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
351 | 351 | } |
352 | 352 | print '</div>'; |
353 | 353 | } |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | print '<br>'; |
359 | 359 | |
360 | 360 | if ($_GET['action'] == 'remove') { |
361 | - print $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&remid=' . GETPOST('remid'), $langs->trans('RemoveDiscount'), $langs->trans('ConfirmRemoveDiscount'), 'confirm_remove', '', 0, 1); |
|
361 | + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.GETPOST('remid'), $langs->trans('RemoveDiscount'), $langs->trans('ConfirmRemoveDiscount'), 'confirm_remove', '', 0, 1); |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | |
@@ -380,10 +380,10 @@ discard block |
||
380 | 380 | $sql .= " rc.fk_facture_source,"; |
381 | 381 | $sql .= " u.login, u.rowid as user_id,"; |
382 | 382 | $sql .= " fa.ref as ref, fa.type as type"; |
383 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user as u, " . MAIN_DB_PREFIX . "societe_remise_except as rc"; |
|
384 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as fa ON rc.fk_facture_source = fa.rowid"; |
|
385 | - $sql .= " WHERE rc.fk_soc = " . $object->id; |
|
386 | - $sql .= " AND rc.entity = " . $conf->entity; |
|
383 | + $sql .= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."societe_remise_except as rc"; |
|
384 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid"; |
|
385 | + $sql .= " WHERE rc.fk_soc = ".$object->id; |
|
386 | + $sql .= " AND rc.entity = ".$conf->entity; |
|
387 | 387 | $sql .= " AND u.rowid = rc.fk_user"; |
388 | 388 | $sql .= " AND rc.discount_type = 0"; // Eliminate supplier discounts |
389 | 389 | $sql .= " AND (rc.fk_facture_line IS NULL AND rc.fk_facture IS NULL)"; |
@@ -394,13 +394,13 @@ discard block |
||
394 | 394 | print '<div class="div-table-responsive-no-min">'; |
395 | 395 | print '<table width="100%" class="noborder">'; |
396 | 396 | print '<tr class="liste_titre">'; |
397 | - print '<td class="widthdate">' . $langs->trans("Date") . '</td>'; // Need 120+ for format with AM/PM |
|
398 | - print '<td>' . $langs->trans("ReasonDiscount") . '</td>'; |
|
399 | - print '<td width="150" class="nowrap">' . $langs->trans("ConsumedBy") . '</td>'; |
|
400 | - print '<td width="120" align="right">' . $langs->trans("AmountHT") . '</td>'; |
|
401 | - print '<td width="80" align="right">' . $langs->trans("VATRate") . '</td>'; |
|
402 | - print '<td width="120" align="right">' . $langs->trans("AmountTTC") . '</td>'; |
|
403 | - print '<td width="100" align="center">' . $langs->trans("DiscountOfferedBy") . '</td>'; |
|
397 | + print '<td class="widthdate">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM |
|
398 | + print '<td>'.$langs->trans("ReasonDiscount").'</td>'; |
|
399 | + print '<td width="150" class="nowrap">'.$langs->trans("ConsumedBy").'</td>'; |
|
400 | + print '<td width="120" align="right">'.$langs->trans("AmountHT").'</td>'; |
|
401 | + print '<td width="80" align="right">'.$langs->trans("VATRate").'</td>'; |
|
402 | + print '<td width="120" align="right">'.$langs->trans("AmountTTC").'</td>'; |
|
403 | + print '<td width="100" align="center">'.$langs->trans("DiscountOfferedBy").'</td>'; |
|
404 | 404 | print '<td width="50"> </td>'; |
405 | 405 | print '</tr>'; |
406 | 406 | |
@@ -413,48 +413,48 @@ discard block |
||
413 | 413 | $obj = $db->fetch_object($resql); |
414 | 414 | |
415 | 415 | print '<tr class="oddeven">'; |
416 | - print '<td>' . dol_print_date($db->jdate($obj->dc), 'dayhour') . '</td>'; |
|
416 | + print '<td>'.dol_print_date($db->jdate($obj->dc), 'dayhour').'</td>'; |
|
417 | 417 | if (preg_match('/\(CREDIT_NOTE\)/', $obj->description)) { |
418 | 418 | print '<td class="nowrap">'; |
419 | 419 | $facturestatic->id = $obj->fk_facture_source; |
420 | 420 | $facturestatic->ref = $obj->ref; |
421 | 421 | $facturestatic->type = $obj->type; |
422 | - print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description) . ' ' . $facturestatic->getNomURl(1); |
|
422 | + print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturestatic->getNomURl(1); |
|
423 | 423 | print '</td>'; |
424 | 424 | } elseif (preg_match('/\(DEPOSIT\)/', $obj->description)) { |
425 | 425 | print '<td class="nowrap">'; |
426 | 426 | $facturestatic->id = $obj->fk_facture_source; |
427 | 427 | $facturestatic->ref = $obj->ref; |
428 | 428 | $facturestatic->type = $obj->type; |
429 | - print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description) . ' ' . $facturestatic->getNomURl(1); |
|
429 | + print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturestatic->getNomURl(1); |
|
430 | 430 | print '</td>'; |
431 | 431 | } elseif (preg_match('/\(EXCESS RECEIVED\)/', $obj->description)) { |
432 | 432 | print '<td class="nowrap">'; |
433 | 433 | $facturestatic->id = $obj->fk_facture_source; |
434 | 434 | $facturestatic->ref = $obj->ref; |
435 | 435 | $facturestatic->type = $obj->type; |
436 | - print preg_replace('/\(EXCESS RECEIVED\)/', $langs->trans("ExcessReceived"), $obj->description) . ' ' . $facturestatic->getNomURl(1); |
|
436 | + print preg_replace('/\(EXCESS RECEIVED\)/', $langs->trans("ExcessReceived"), $obj->description).' '.$facturestatic->getNomURl(1); |
|
437 | 437 | print '</td>'; |
438 | 438 | } else { |
439 | 439 | print '<td>'; |
440 | 440 | print $obj->description; |
441 | 441 | print '</td>'; |
442 | 442 | } |
443 | - print '<td class="nowrap">' . $langs->trans("NotConsumed") . '</td>'; |
|
444 | - print '<td align="right">' . price($obj->amount_ht) . '</td>'; |
|
445 | - print '<td align="right">' . price2num($obj->tva_tx, 'MU') . '%</td>'; |
|
446 | - print '<td align="right">' . price($obj->amount_ttc) . '</td>'; |
|
443 | + print '<td class="nowrap">'.$langs->trans("NotConsumed").'</td>'; |
|
444 | + print '<td align="right">'.price($obj->amount_ht).'</td>'; |
|
445 | + print '<td align="right">'.price2num($obj->tva_tx, 'MU').'%</td>'; |
|
446 | + print '<td align="right">'.price($obj->amount_ttc).'</td>'; |
|
447 | 447 | print '<td align="center">'; |
448 | 448 | // print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a>'; |
449 | - print '<a href="' . BASE_URI . '?controller=user&method=card&id=' . $obj->user_id . '">' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $obj->login . '</a>'; |
|
449 | + print '<a href="'.BASE_URI.'?controller=user&method=card&id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.'</a>'; |
|
450 | 450 | print '</td>'; |
451 | 451 | if ($user->rights->societe->creer || $user->rights->facture->creer) { |
452 | 452 | print '<td class="nowrap">'; |
453 | 453 | // print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=split&remid=' . $obj->rowid . ($backtopage ? '&backtopage=' . urlencode($backtopage) : '') . '">' . img_split($langs->trans("SplitDiscount")) . '</a>'; |
454 | - print '<a href="' . BASE_URI . 'controller=comm&method=remx&id=' . $object->id . '&action=split&remid=' . $obj->rowid . ($backtopage ? '&backtopage=' . urlencode($backtopage) : '') . '">' . img_split($langs->trans("SplitDiscount")) . '</a>'; |
|
454 | + print '<a href="'.BASE_URI.'controller=comm&method=remx&id='.$object->id.'&action=split&remid='.$obj->rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_split($langs->trans("SplitDiscount")).'</a>'; |
|
455 | 455 | print ' '; |
456 | 456 | // print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=remove&remid=' . $obj->rowid . ($backtopage ? '&backtopage=' . urlencode($backtopage) : '') . '">' . img_delete($langs->trans("RemoveDiscount")) . '</a>'; |
457 | - print '<a href="' . BASE_URI . 'controller=comm&method=remx&id=' . $object->id . '&action=remove&remid=' . $obj->rowid . ($backtopage ? '&backtopage=' . urlencode($backtopage) : '') . '">' . img_delete($langs->trans("RemoveDiscount")) . '</a>'; |
|
457 | + print '<a href="'.BASE_URI.'controller=comm&method=remx&id='.$object->id.'&action=remove&remid='.$obj->rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_delete($langs->trans("RemoveDiscount")).'</a>'; |
|
458 | 458 | print '</td>'; |
459 | 459 | } else |
460 | 460 | print '<td> </td>'; |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | $i++; |
468 | 468 | } |
469 | 469 | } else { |
470 | - print '<tr><td colspan="8" class="opacitymedium">' . $langs->trans("None") . '</td></tr>'; |
|
470 | + print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; |
|
471 | 471 | } |
472 | 472 | $db->free($resql); |
473 | 473 | print "</table>"; |
@@ -478,11 +478,11 @@ discard block |
||
478 | 478 | $amount2 = ($showconfirminfo['amount_ttc'] - $amount1); |
479 | 479 | $formquestion = array( |
480 | 480 | 'text' => $langs->trans('TypeAmountOfEachNewDiscount'), |
481 | - array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC") . ' 1', 'value' => $amount1, 'size' => '5'), |
|
482 | - array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC") . ' 2', 'value' => $amount2, 'size' => '5') |
|
481 | + array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC").' 1', 'value' => $amount1, 'size' => '5'), |
|
482 | + array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5') |
|
483 | 483 | ); |
484 | 484 | $langs->load("dict"); |
485 | - print $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&remid=' . $showconfirminfo['rowid'] . ($backtopage ? '&backtopage=' . urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency" . $conf->currency)), 'confirm_split', $formquestion, 0, 0); |
|
485 | + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); |
|
486 | 486 | } |
487 | 487 | } else { |
488 | 488 | dol_print_error($db); |
@@ -505,10 +505,10 @@ discard block |
||
505 | 505 | $sql .= " rc.fk_invoice_supplier_source,"; |
506 | 506 | $sql .= " u.login, u.rowid as user_id,"; |
507 | 507 | $sql .= " fa.ref, fa.type as type"; |
508 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user as u, " . MAIN_DB_PREFIX . "societe_remise_except as rc"; |
|
509 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as fa ON rc.fk_invoice_supplier_source = fa.rowid"; |
|
510 | - $sql .= " WHERE rc.fk_soc = " . $object->id; |
|
511 | - $sql .= " AND rc.entity = " . $conf->entity; |
|
508 | + $sql .= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."societe_remise_except as rc"; |
|
509 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as fa ON rc.fk_invoice_supplier_source = fa.rowid"; |
|
510 | + $sql .= " WHERE rc.fk_soc = ".$object->id; |
|
511 | + $sql .= " AND rc.entity = ".$conf->entity; |
|
512 | 512 | $sql .= " AND u.rowid = rc.fk_user"; |
513 | 513 | $sql .= " AND rc.discount_type = 1"; // Eliminate customer discounts |
514 | 514 | $sql .= " AND (rc.fk_invoice_supplier IS NULL AND rc.fk_invoice_supplier_line IS NULL)"; |
@@ -519,13 +519,13 @@ discard block |
||
519 | 519 | print '<div class="div-table-responsive-no-min">'; |
520 | 520 | print '<table width="100%" class="noborder">'; |
521 | 521 | print '<tr class="liste_titre">'; |
522 | - print '<td class="widthdate">' . $langs->trans("Date") . '</td>'; // Need 120+ for format with AM/PM |
|
523 | - print '<td>' . $langs->trans("ReasonDiscount") . '</td>'; |
|
524 | - print '<td width="150" class="nowrap">' . $langs->trans("ConsumedBy") . '</td>'; |
|
525 | - print '<td width="120" align="right">' . $langs->trans("AmountHT") . '</td>'; |
|
526 | - print '<td width="80" align="right">' . $langs->trans("VATRate") . '</td>'; |
|
527 | - print '<td width="120" align="right">' . $langs->trans("AmountTTC") . '</td>'; |
|
528 | - print '<td width="100" align="center">' . $langs->trans("DiscountOfferedBy") . '</td>'; |
|
522 | + print '<td class="widthdate">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM |
|
523 | + print '<td>'.$langs->trans("ReasonDiscount").'</td>'; |
|
524 | + print '<td width="150" class="nowrap">'.$langs->trans("ConsumedBy").'</td>'; |
|
525 | + print '<td width="120" align="right">'.$langs->trans("AmountHT").'</td>'; |
|
526 | + print '<td width="80" align="right">'.$langs->trans("VATRate").'</td>'; |
|
527 | + print '<td width="120" align="right">'.$langs->trans("AmountTTC").'</td>'; |
|
528 | + print '<td width="100" align="center">'.$langs->trans("DiscountOfferedBy").'</td>'; |
|
529 | 529 | print '<td width="50"> </td>'; |
530 | 530 | print '</tr>'; |
531 | 531 | |
@@ -538,48 +538,48 @@ discard block |
||
538 | 538 | $obj = $db->fetch_object($resql); |
539 | 539 | |
540 | 540 | print '<tr class="oddeven">'; |
541 | - print '<td>' . dol_print_date($db->jdate($obj->dc), 'dayhour') . '</td>'; |
|
541 | + print '<td>'.dol_print_date($db->jdate($obj->dc), 'dayhour').'</td>'; |
|
542 | 542 | if (preg_match('/\(CREDIT_NOTE\)/', $obj->description)) { |
543 | 543 | print '<td class="nowrap">'; |
544 | 544 | $facturefournstatic->id = $obj->fk_invoice_supplier_source; |
545 | 545 | $facturefournstatic->ref = $obj->ref; |
546 | 546 | $facturefournstatic->type = $obj->type; |
547 | - print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description) . ' ' . $facturefournstatic->getNomURl(1); |
|
547 | + print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturefournstatic->getNomURl(1); |
|
548 | 548 | print '</td>'; |
549 | 549 | } elseif (preg_match('/\(DEPOSIT\)/', $obj->description)) { |
550 | 550 | print '<td class="nowrap">'; |
551 | 551 | $facturefournstatic->id = $obj->fk_invoice_supplier_source; |
552 | 552 | $facturefournstatic->ref = $obj->ref; |
553 | 553 | $facturefournstatic->type = $obj->type; |
554 | - print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description) . ' ' . $facturefournstatic->getNomURl(1); |
|
554 | + print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturefournstatic->getNomURl(1); |
|
555 | 555 | print '</td>'; |
556 | 556 | } elseif (preg_match('/\(EXCESS PAID\)/', $obj->description)) { |
557 | 557 | print '<td class="nowrap">'; |
558 | 558 | $facturefournstatic->id = $obj->fk_invoice_supplier_source; |
559 | 559 | $facturefournstatic->ref = $obj->ref; |
560 | 560 | $facturefournstatic->type = $obj->type; |
561 | - print preg_replace('/\(EXCESS PAID\)/', $langs->trans("ExcessPaid"), $obj->description) . ' ' . $facturefournstatic->getNomURl(1); |
|
561 | + print preg_replace('/\(EXCESS PAID\)/', $langs->trans("ExcessPaid"), $obj->description).' '.$facturefournstatic->getNomURl(1); |
|
562 | 562 | print '</td>'; |
563 | 563 | } else { |
564 | 564 | print '<td>'; |
565 | 565 | print $obj->description; |
566 | 566 | print '</td>'; |
567 | 567 | } |
568 | - print '<td class="nowrap">' . $langs->trans("NotConsumed") . '</td>'; |
|
569 | - print '<td align="right">' . price($obj->amount_ht) . '</td>'; |
|
570 | - print '<td align="right">' . price2num($obj->tva_tx, 'MU') . '%</td>'; |
|
571 | - print '<td align="right">' . price($obj->amount_ttc) . '</td>'; |
|
568 | + print '<td class="nowrap">'.$langs->trans("NotConsumed").'</td>'; |
|
569 | + print '<td align="right">'.price($obj->amount_ht).'</td>'; |
|
570 | + print '<td align="right">'.price2num($obj->tva_tx, 'MU').'%</td>'; |
|
571 | + print '<td align="right">'.price($obj->amount_ttc).'</td>'; |
|
572 | 572 | print '<td align="center">'; |
573 | 573 | // print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a>'; |
574 | - print '<a href="' . BASE_URI . '?controller=user&method=card&id=' . $obj->user_id . '">' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $obj->login . '</a>'; |
|
574 | + print '<a href="'.BASE_URI.'?controller=user&method=card&id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.'</a>'; |
|
575 | 575 | print '</td>'; |
576 | 576 | if ($user->rights->societe->creer || $user->rights->facture->creer) { |
577 | 577 | print '<td class="nowrap">'; |
578 | 578 | // print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=split&remid=' . $obj->rowid . ($backtopage ? '&backtopage=' . urlencode($backtopage) : '') . '">' . img_split($langs->trans("SplitDiscount")) . '</a>'; |
579 | - print '<a href="' . BASE_URI . 'controller=comm&method=remx&id=' . $object->id . '&action=split&remid=' . $obj->rowid . ($backtopage ? '&backtopage=' . urlencode($backtopage) : '') . '">' . img_split($langs->trans("SplitDiscount")) . '</a>'; |
|
579 | + print '<a href="'.BASE_URI.'controller=comm&method=remx&id='.$object->id.'&action=split&remid='.$obj->rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_split($langs->trans("SplitDiscount")).'</a>'; |
|
580 | 580 | print ' '; |
581 | 581 | // print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=remove&remid=' . $obj->rowid . ($backtopage ? '&backtopage=' . urlencode($backtopage) : '') . '">' . img_delete($langs->trans("RemoveDiscount")) . '</a>'; |
582 | - print '<a href="' . BASE_URI . 'controller=comm&method=remx&id=' . $object->id . '&action=remove&remid=' . $obj->rowid . ($backtopage ? '&backtopage=' . urlencode($backtopage) : '') . '">' . img_delete($langs->trans("RemoveDiscount")) . '</a>'; |
|
582 | + print '<a href="'.BASE_URI.'controller=comm&method=remx&id='.$object->id.'&action=remove&remid='.$obj->rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_delete($langs->trans("RemoveDiscount")).'</a>'; |
|
583 | 583 | print '</td>'; |
584 | 584 | } else |
585 | 585 | print '<td> </td>'; |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | $i++; |
593 | 593 | } |
594 | 594 | } else { |
595 | - print '<tr><td colspan="8" class="opacitymedium">' . $langs->trans("None") . '</td></tr>'; |
|
595 | + print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; |
|
596 | 596 | } |
597 | 597 | $db->free($resql); |
598 | 598 | print "</table>"; |
@@ -603,11 +603,11 @@ discard block |
||
603 | 603 | $amount2 = ($showconfirminfo['amount_ttc'] - $amount1); |
604 | 604 | $formquestion = array( |
605 | 605 | 'text' => $langs->trans('TypeAmountOfEachNewDiscount'), |
606 | - array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC") . ' 1', 'value' => $amount1, 'size' => '5'), |
|
607 | - array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC") . ' 2', 'value' => $amount2, 'size' => '5') |
|
606 | + array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC").' 1', 'value' => $amount1, 'size' => '5'), |
|
607 | + array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5') |
|
608 | 608 | ); |
609 | 609 | $langs->load("dict"); |
610 | - print $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&remid=' . $showconfirminfo['rowid'] . ($backtopage ? '&backtopage=' . urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency" . $conf->currency)), 'confirm_split', $formquestion, 0, 0); |
|
610 | + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); |
|
611 | 611 | } |
612 | 612 | } else { |
613 | 613 | dol_print_error($db); |
@@ -642,12 +642,12 @@ discard block |
||
642 | 642 | $sql .= " u.login, u.rowid as user_id,"; |
643 | 643 | $sql .= " f.rowid, f.ref,"; |
644 | 644 | $sql .= " fa.ref as ref, fa.type as type"; |
645 | - $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f"; |
|
646 | - $sql .= " , " . MAIN_DB_PREFIX . "user as u"; |
|
647 | - $sql .= " , " . MAIN_DB_PREFIX . "facturedet as fc"; |
|
648 | - $sql .= " , " . MAIN_DB_PREFIX . "societe_remise_except as rc"; |
|
649 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as fa ON rc.fk_facture_source = fa.rowid"; |
|
650 | - $sql .= " WHERE rc.fk_soc =" . $object->id; |
|
645 | + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; |
|
646 | + $sql .= " , ".MAIN_DB_PREFIX."user as u"; |
|
647 | + $sql .= " , ".MAIN_DB_PREFIX."facturedet as fc"; |
|
648 | + $sql .= " , ".MAIN_DB_PREFIX."societe_remise_except as rc"; |
|
649 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid"; |
|
650 | + $sql .= " WHERE rc.fk_soc =".$object->id; |
|
651 | 651 | $sql .= " AND rc.fk_facture_line = fc.rowid"; |
652 | 652 | $sql .= " AND fc.fk_facture = f.rowid"; |
653 | 653 | $sql .= " AND rc.fk_user = u.rowid"; |
@@ -661,11 +661,11 @@ discard block |
||
661 | 661 | $sql2 .= " u.login, u.rowid as user_id,"; |
662 | 662 | $sql2 .= " f.rowid, f.ref,"; |
663 | 663 | $sql2 .= " fa.ref as ref, fa.type as type"; |
664 | - $sql2 .= " FROM " . MAIN_DB_PREFIX . "facture as f"; |
|
665 | - $sql2 .= " , " . MAIN_DB_PREFIX . "user as u"; |
|
666 | - $sql2 .= " , " . MAIN_DB_PREFIX . "societe_remise_except as rc"; |
|
667 | - $sql2 .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as fa ON rc.fk_facture_source = fa.rowid"; |
|
668 | - $sql2 .= " WHERE rc.fk_soc =" . $object->id; |
|
664 | + $sql2 .= " FROM ".MAIN_DB_PREFIX."facture as f"; |
|
665 | + $sql2 .= " , ".MAIN_DB_PREFIX."user as u"; |
|
666 | + $sql2 .= " , ".MAIN_DB_PREFIX."societe_remise_except as rc"; |
|
667 | + $sql2 .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid"; |
|
668 | + $sql2 .= " WHERE rc.fk_soc =".$object->id; |
|
669 | 669 | $sql2 .= " AND rc.fk_facture = f.rowid"; |
670 | 670 | $sql2 .= " AND rc.fk_user = u.rowid"; |
671 | 671 | $sql2 .= " AND rc.discount_type = 0"; // Eliminate supplier discounts |
@@ -680,13 +680,13 @@ discard block |
||
680 | 680 | print '<div class="div-table-responsive-no-min">'; |
681 | 681 | print '<table class="noborder" width="100%">'; |
682 | 682 | print '<tr class="liste_titre">'; |
683 | - print '<td class="widthdate">' . $langs->trans("Date") . '</td>'; // Need 120+ for format with AM/PM |
|
684 | - print '<td>' . $langs->trans("ReasonDiscount") . '</td>'; |
|
685 | - print '<td width="150" class="nowrap">' . $langs->trans("ConsumedBy") . '</td>'; |
|
686 | - print '<td width="120" align="right">' . $langs->trans("AmountHT") . '</td>'; |
|
687 | - print '<td width="80" align="right">' . $langs->trans("VATRate") . '</td>'; |
|
688 | - print '<td width="120" align="right">' . $langs->trans("AmountTTC") . '</td>'; |
|
689 | - print '<td width="100" align="center">' . $langs->trans("Author") . '</td>'; |
|
683 | + print '<td class="widthdate">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM |
|
684 | + print '<td>'.$langs->trans("ReasonDiscount").'</td>'; |
|
685 | + print '<td width="150" class="nowrap">'.$langs->trans("ConsumedBy").'</td>'; |
|
686 | + print '<td width="120" align="right">'.$langs->trans("AmountHT").'</td>'; |
|
687 | + print '<td width="80" align="right">'.$langs->trans("VATRate").'</td>'; |
|
688 | + print '<td width="120" align="right">'.$langs->trans("AmountTTC").'</td>'; |
|
689 | + print '<td width="100" align="center">'.$langs->trans("Author").'</td>'; |
|
690 | 690 | print '<td width="50"> </td>'; |
691 | 691 | print '</tr>'; |
692 | 692 | |
@@ -717,27 +717,27 @@ discard block |
||
717 | 717 | while ($i < $num) { |
718 | 718 | $obj = array_shift($tab_sqlobj); |
719 | 719 | print '<tr class="oddeven">'; |
720 | - print '<td>' . dol_print_date($db->jdate($obj->dc), 'dayhour') . '</td>'; |
|
720 | + print '<td>'.dol_print_date($db->jdate($obj->dc), 'dayhour').'</td>'; |
|
721 | 721 | if (preg_match('/\(CREDIT_NOTE\)/', $obj->description)) { |
722 | 722 | print '<td class="nowrap">'; |
723 | 723 | $facturestatic->id = $obj->fk_facture_source; |
724 | 724 | $facturestatic->ref = $obj->ref; |
725 | 725 | $facturestatic->type = $obj->type; |
726 | - print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description) . ' ' . $facturestatic->getNomURl(1); |
|
726 | + print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturestatic->getNomURl(1); |
|
727 | 727 | print '</td>'; |
728 | 728 | } elseif (preg_match('/\(DEPOSIT\)/', $obj->description)) { |
729 | 729 | print '<td class="nowrap">'; |
730 | 730 | $facturestatic->id = $obj->fk_facture_source; |
731 | 731 | $facturestatic->ref = $obj->ref; |
732 | 732 | $facturestatic->type = $obj->type; |
733 | - print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description) . ' ' . $facturestatic->getNomURl(1); |
|
733 | + print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturestatic->getNomURl(1); |
|
734 | 734 | print '</td>'; |
735 | 735 | } elseif (preg_match('/\(EXCESS RECEIVED\)/', $obj->description)) { |
736 | 736 | print '<td class="nowrap">'; |
737 | 737 | $facturestatic->id = $obj->fk_facture_source; |
738 | 738 | $facturestatic->ref = $obj->ref; |
739 | 739 | $facturestatic->type = $obj->type; |
740 | - print preg_replace('/\(EXCESS RECEIVED\)/', $langs->trans("Invoice"), $obj->description) . ' ' . $facturestatic->getNomURl(1); |
|
740 | + print preg_replace('/\(EXCESS RECEIVED\)/', $langs->trans("Invoice"), $obj->description).' '.$facturestatic->getNomURl(1); |
|
741 | 741 | print '</td>'; |
742 | 742 | } else { |
743 | 743 | print '<td>'; |
@@ -745,20 +745,20 @@ discard block |
||
745 | 745 | print '</td>'; |
746 | 746 | } |
747 | 747 | // print '<td align="left" class="nowrap"><a href="' . DOL_URL_ROOT . '/compta/facture/card.php?facid=' . $obj->rowid . '">' . img_object($langs->trans("ShowBill"), 'bill') . ' ' . $obj->ref . '</a></td>'; |
748 | - print '<td align="left" class="nowrap"><a href="' . BASE_URI . 'controller=compta/facture&method=card&facid=' . $obj->rowid . '">' . img_object($langs->trans("ShowBill"), 'bill') . ' ' . $obj->ref . '</a></td>'; |
|
749 | - print '<td align="right">' . price($obj->amount_ht) . '</td>'; |
|
750 | - print '<td align="right">' . price2num($obj->tva_tx, 'MU') . '%</td>'; |
|
751 | - print '<td align="right">' . price($obj->amount_ttc) . '</td>'; |
|
748 | + print '<td align="left" class="nowrap"><a href="'.BASE_URI.'controller=compta/facture&method=card&facid='.$obj->rowid.'">'.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.'</a></td>'; |
|
749 | + print '<td align="right">'.price($obj->amount_ht).'</td>'; |
|
750 | + print '<td align="right">'.price2num($obj->tva_tx, 'MU').'%</td>'; |
|
751 | + print '<td align="right">'.price($obj->amount_ttc).'</td>'; |
|
752 | 752 | print '<td align="center">'; |
753 | 753 | // print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a>'; |
754 | - print '<a href="' . BASE_URI . '?controller=user&method=card&id=' . $obj->user_id . '">' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $obj->login . '</a>'; |
|
754 | + print '<a href="'.BASE_URI.'?controller=user&method=card&id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.'</a>'; |
|
755 | 755 | print '</td>'; |
756 | 756 | print '<td> </td>'; |
757 | 757 | print '</tr>'; |
758 | 758 | $i++; |
759 | 759 | } |
760 | 760 | } else { |
761 | - print '<tr><td colspan="8" class="opacitymedium">' . $langs->trans("None") . '</td></tr>'; |
|
761 | + print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; |
|
762 | 762 | } |
763 | 763 | |
764 | 764 | print "</table>"; |
@@ -783,12 +783,12 @@ discard block |
||
783 | 783 | $sql .= " u.login, u.rowid as user_id,"; |
784 | 784 | $sql .= " f.rowid, f.ref as ref,"; |
785 | 785 | $sql .= " fa.ref, fa.type as type"; |
786 | - $sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f"; |
|
787 | - $sql .= " , " . MAIN_DB_PREFIX . "user as u"; |
|
788 | - $sql .= " , " . MAIN_DB_PREFIX . "facture_fourn_det as fc"; |
|
789 | - $sql .= " , " . MAIN_DB_PREFIX . "societe_remise_except as rc"; |
|
790 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as fa ON rc.fk_invoice_supplier_source = fa.rowid"; |
|
791 | - $sql .= " WHERE rc.fk_soc =" . $object->id; |
|
786 | + $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; |
|
787 | + $sql .= " , ".MAIN_DB_PREFIX."user as u"; |
|
788 | + $sql .= " , ".MAIN_DB_PREFIX."facture_fourn_det as fc"; |
|
789 | + $sql .= " , ".MAIN_DB_PREFIX."societe_remise_except as rc"; |
|
790 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as fa ON rc.fk_invoice_supplier_source = fa.rowid"; |
|
791 | + $sql .= " WHERE rc.fk_soc =".$object->id; |
|
792 | 792 | $sql .= " AND rc.fk_invoice_supplier_line = fc.rowid"; |
793 | 793 | $sql .= " AND fc.fk_facture_fourn = f.rowid"; |
794 | 794 | $sql .= " AND rc.fk_user = u.rowid"; |
@@ -802,11 +802,11 @@ discard block |
||
802 | 802 | $sql2 .= " u.login, u.rowid as user_id,"; |
803 | 803 | $sql2 .= " f.rowid, f.ref as ref,"; |
804 | 804 | $sql2 .= " fa.ref, fa.type as type"; |
805 | - $sql2 .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f"; |
|
806 | - $sql2 .= " , " . MAIN_DB_PREFIX . "user as u"; |
|
807 | - $sql2 .= " , " . MAIN_DB_PREFIX . "societe_remise_except as rc"; |
|
808 | - $sql2 .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as fa ON rc.fk_invoice_supplier_source = fa.rowid"; |
|
809 | - $sql2 .= " WHERE rc.fk_soc =" . $object->id; |
|
805 | + $sql2 .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; |
|
806 | + $sql2 .= " , ".MAIN_DB_PREFIX."user as u"; |
|
807 | + $sql2 .= " , ".MAIN_DB_PREFIX."societe_remise_except as rc"; |
|
808 | + $sql2 .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as fa ON rc.fk_invoice_supplier_source = fa.rowid"; |
|
809 | + $sql2 .= " WHERE rc.fk_soc =".$object->id; |
|
810 | 810 | $sql2 .= " AND rc.fk_invoice_supplier = f.rowid"; |
811 | 811 | $sql2 .= " AND rc.fk_user = u.rowid"; |
812 | 812 | $sql2 .= " AND rc.discount_type = 1"; // Eliminate customer discounts |
@@ -821,13 +821,13 @@ discard block |
||
821 | 821 | print '<div class="div-table-responsive-no-min">'; |
822 | 822 | print '<table class="noborder" width="100%">'; |
823 | 823 | print '<tr class="liste_titre">'; |
824 | - print '<td class="widthdate">' . $langs->trans("Date") . '</td>'; // Need 120+ for format with AM/PM |
|
825 | - print '<td>' . $langs->trans("ReasonDiscount") . '</td>'; |
|
826 | - print '<td width="150" class="nowrap">' . $langs->trans("ConsumedBy") . '</td>'; |
|
827 | - print '<td width="120" align="right">' . $langs->trans("AmountHT") . '</td>'; |
|
828 | - print '<td width="80" align="right">' . $langs->trans("VATRate") . '</td>'; |
|
829 | - print '<td width="120" align="right">' . $langs->trans("AmountTTC") . '</td>'; |
|
830 | - print '<td width="100" align="center">' . $langs->trans("Author") . '</td>'; |
|
824 | + print '<td class="widthdate">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM |
|
825 | + print '<td>'.$langs->trans("ReasonDiscount").'</td>'; |
|
826 | + print '<td width="150" class="nowrap">'.$langs->trans("ConsumedBy").'</td>'; |
|
827 | + print '<td width="120" align="right">'.$langs->trans("AmountHT").'</td>'; |
|
828 | + print '<td width="80" align="right">'.$langs->trans("VATRate").'</td>'; |
|
829 | + print '<td width="120" align="right">'.$langs->trans("AmountTTC").'</td>'; |
|
830 | + print '<td width="100" align="center">'.$langs->trans("Author").'</td>'; |
|
831 | 831 | print '<td width="50"> </td>'; |
832 | 832 | print '</tr>'; |
833 | 833 | |
@@ -858,27 +858,27 @@ discard block |
||
858 | 858 | while ($i < $num) { |
859 | 859 | $obj = array_shift($tab_sqlobj); |
860 | 860 | print '<tr class="oddeven">'; |
861 | - print '<td>' . dol_print_date($db->jdate($obj->dc), 'dayhour') . '</td>'; |
|
861 | + print '<td>'.dol_print_date($db->jdate($obj->dc), 'dayhour').'</td>'; |
|
862 | 862 | if (preg_match('/\(CREDIT_NOTE\)/', $obj->description)) { |
863 | 863 | print '<td class="nowrap">'; |
864 | 864 | $facturefournstatic->id = $obj->fk_invoice_supplier_source; |
865 | 865 | $facturefournstatic->ref = $obj->ref; |
866 | 866 | $facturefournstatic->type = $obj->type; |
867 | - print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description) . ' ' . $facturefournstatic->getNomURl(1); |
|
867 | + print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturefournstatic->getNomURl(1); |
|
868 | 868 | print '</td>'; |
869 | 869 | } elseif (preg_match('/\(DEPOSIT\)/', $obj->description)) { |
870 | 870 | print '<td class="nowrap">'; |
871 | 871 | $facturefournstatic->id = $obj->fk_invoice_supplier_source; |
872 | 872 | $facturefournstatic->ref = $obj->ref; |
873 | 873 | $facturefournstatic->type = $obj->type; |
874 | - print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description) . ' ' . $facturefournstatic->getNomURl(1); |
|
874 | + print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturefournstatic->getNomURl(1); |
|
875 | 875 | print '</td>'; |
876 | 876 | } elseif (preg_match('/\(EXCESS PAID\)/', $obj->description)) { |
877 | 877 | print '<td class="nowrap">'; |
878 | 878 | $facturefournstatic->id = $obj->fk_invoice_supplier_source; |
879 | 879 | $facturefournstatic->ref = $obj->ref; |
880 | 880 | $facturefournstatic->type = $obj->type; |
881 | - print preg_replace('/\(EXCESS PAID\)/', $langs->trans("Invoice"), $obj->description) . ' ' . $facturefournstatic->getNomURl(1); |
|
881 | + print preg_replace('/\(EXCESS PAID\)/', $langs->trans("Invoice"), $obj->description).' '.$facturefournstatic->getNomURl(1); |
|
882 | 882 | print '</td>'; |
883 | 883 | } else { |
884 | 884 | print '<td>'; |
@@ -886,20 +886,20 @@ discard block |
||
886 | 886 | print '</td>'; |
887 | 887 | } |
888 | 888 | // print '<td align="left" class="nowrap"><a href="' . DOL_URL_ROOT . '/fourn/facture/card.php?facid=' . $obj->rowid . '">' . img_object($langs->trans("ShowBill"), 'bill') . ' ' . $obj->ref . '</a></td>'; |
889 | - print '<td align="left" class="nowrap"><a href="' . BASE_URI . 'controller=fourn/facture&method=card&facid=' . $obj->rowid . '">' . img_object($langs->trans("ShowBill"), 'bill') . ' ' . $obj->ref . '</a></td>'; |
|
890 | - print '<td align="right">' . price($obj->amount_ht) . '</td>'; |
|
891 | - print '<td align="right">' . price2num($obj->tva_tx, 'MU') . '%</td>'; |
|
892 | - print '<td align="right">' . price($obj->amount_ttc) . '</td>'; |
|
889 | + print '<td align="left" class="nowrap"><a href="'.BASE_URI.'controller=fourn/facture&method=card&facid='.$obj->rowid.'">'.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.'</a></td>'; |
|
890 | + print '<td align="right">'.price($obj->amount_ht).'</td>'; |
|
891 | + print '<td align="right">'.price2num($obj->tva_tx, 'MU').'%</td>'; |
|
892 | + print '<td align="right">'.price($obj->amount_ttc).'</td>'; |
|
893 | 893 | print '<td align="center">'; |
894 | 894 | // print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a>'; |
895 | - print '<a href="' . BASE_URI . '?controller=user&method=card&id=' . $obj->user_id . '">' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $obj->login . '</a>'; |
|
895 | + print '<a href="'.BASE_URI.'?controller=user&method=card&id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.'</a>'; |
|
896 | 896 | print '</td>'; |
897 | 897 | print '<td> </td>'; |
898 | 898 | print '</tr>'; |
899 | 899 | $i++; |
900 | 900 | } |
901 | 901 | } else { |
902 | - print '<tr><td colspan="8" class="opacitymedium">' . $langs->trans("None") . '</td></tr>'; |
|
902 | + print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; |
|
903 | 903 | } |
904 | 904 | |
905 | 905 | print "</table>"; |
@@ -255,10 +255,10 @@ discard block |
||
255 | 255 | if ($resql) { |
256 | 256 | $obj = $db->fetch_object($resql); |
257 | 257 | $remise_all += $obj->amount; |
258 | - if ($obj->fk_user == $user->id) |
|
259 | - $remise_user += $obj->amount; |
|
260 | - } |
|
261 | - else { |
|
258 | + if ($obj->fk_user == $user->id) { |
|
259 | + $remise_user += $obj->amount; |
|
260 | + } |
|
261 | + } else { |
|
262 | 262 | dol_print_error($db); |
263 | 263 | } |
264 | 264 | |
@@ -285,10 +285,10 @@ discard block |
||
285 | 285 | if ($resql) { |
286 | 286 | $obj = $db->fetch_object($resql); |
287 | 287 | $remise_all += $obj->amount; |
288 | - if ($obj->fk_user == $user->id) |
|
289 | - $remise_user += $obj->amount; |
|
290 | - } |
|
291 | - else { |
|
288 | + if ($obj->fk_user == $user->id) { |
|
289 | + $remise_user += $obj->amount; |
|
290 | + } |
|
291 | + } else { |
|
292 | 292 | dol_print_error($db); |
293 | 293 | } |
294 | 294 | |
@@ -456,8 +456,9 @@ discard block |
||
456 | 456 | // print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=remove&remid=' . $obj->rowid . ($backtopage ? '&backtopage=' . urlencode($backtopage) : '') . '">' . img_delete($langs->trans("RemoveDiscount")) . '</a>'; |
457 | 457 | print '<a href="' . BASE_URI . 'controller=comm&method=remx&id=' . $object->id . '&action=remove&remid=' . $obj->rowid . ($backtopage ? '&backtopage=' . urlencode($backtopage) : '') . '">' . img_delete($langs->trans("RemoveDiscount")) . '</a>'; |
458 | 458 | print '</td>'; |
459 | - } else |
|
460 | - print '<td> </td>'; |
|
459 | + } else { |
|
460 | + print '<td> </td>'; |
|
461 | + } |
|
461 | 462 | print '</tr>'; |
462 | 463 | |
463 | 464 | if ($_GET["action"] == 'split' && GETPOST('remid') == $obj->rowid) { |
@@ -581,8 +582,9 @@ discard block |
||
581 | 582 | // print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=remove&remid=' . $obj->rowid . ($backtopage ? '&backtopage=' . urlencode($backtopage) : '') . '">' . img_delete($langs->trans("RemoveDiscount")) . '</a>'; |
582 | 583 | print '<a href="' . BASE_URI . 'controller=comm&method=remx&id=' . $object->id . '&action=remove&remid=' . $obj->rowid . ($backtopage ? '&backtopage=' . urlencode($backtopage) : '') . '">' . img_delete($langs->trans("RemoveDiscount")) . '</a>'; |
583 | 584 | print '</td>'; |
584 | - } else |
|
585 | - print '<td> </td>'; |
|
585 | + } else { |
|
586 | + print '<td> </td>'; |
|
587 | + } |
|
586 | 588 | print '</tr>'; |
587 | 589 | |
588 | 590 | if ($_GET["action"] == 'split' && GETPOST('remid') == $obj->rowid) { |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * \ingroup Expense Report |
24 | 24 | * \brief File of class to manage payment of expense report |
25 | 25 | */ |
26 | -require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; |
|
26 | +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; |
|
27 | 27 | |
28 | 28 | /** \class PaymentExpenseReport |
29 | 29 | * \brief Class to manage payments of expense report |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | public $datec = ''; |
59 | 59 | public $tms = ''; |
60 | 60 | public $datep = ''; |
61 | - public $amount; // Total amount of payment |
|
62 | - public $amounts = array(); // Array of amounts |
|
61 | + public $amount; // Total amount of payment |
|
62 | + public $amounts = array(); // Array of amounts |
|
63 | 63 | |
64 | 64 | /** |
65 | 65 | * @var int ID |
@@ -161,18 +161,18 @@ discard block |
||
161 | 161 | $this->db->begin(); |
162 | 162 | |
163 | 163 | if ($totalamount != 0) { |
164 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "payment_expensereport (fk_expensereport, datec, datep, amount,"; |
|
164 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_expensereport (fk_expensereport, datec, datep, amount,"; |
|
165 | 165 | $sql .= " fk_typepayment, num_payment, note, fk_user_creat, fk_bank)"; |
166 | - $sql .= " VALUES ($this->chid, '" . $this->db->idate($now) . "',"; |
|
167 | - $sql .= " '" . $this->db->idate($this->datepaid) . "',"; |
|
168 | - $sql .= " " . $totalamount . ","; |
|
169 | - $sql .= " " . $this->fk_typepayment . ", '" . $this->db->escape($this->num_payment) . "', '" . $this->db->escape($this->note) . "', " . $user->id . ","; |
|
166 | + $sql .= " VALUES ($this->chid, '".$this->db->idate($now)."',"; |
|
167 | + $sql .= " '".$this->db->idate($this->datepaid)."',"; |
|
168 | + $sql .= " ".$totalamount.","; |
|
169 | + $sql .= " ".$this->fk_typepayment.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".$user->id.","; |
|
170 | 170 | $sql .= " 0)"; |
171 | 171 | |
172 | - dol_syslog(get_class($this) . "::create", LOG_DEBUG); |
|
172 | + dol_syslog(get_class($this)."::create", LOG_DEBUG); |
|
173 | 173 | $resql = $this->db->query($sql); |
174 | 174 | if ($resql) { |
175 | - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "payment_expensereport"); |
|
175 | + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_expensereport"); |
|
176 | 176 | } else { |
177 | 177 | $error++; |
178 | 178 | } |
@@ -213,12 +213,12 @@ discard block |
||
213 | 213 | $sql .= " t.fk_user_modif,"; |
214 | 214 | $sql .= " pt.code as type_code, pt.libelle as type_libelle,"; |
215 | 215 | $sql .= ' b.fk_account'; |
216 | - $sql .= " FROM " . MAIN_DB_PREFIX . "payment_expensereport as t"; |
|
217 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_paiement as pt ON t.fk_typepayment = pt.id"; |
|
218 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank as b ON t.fk_bank = b.rowid'; |
|
219 | - $sql .= " WHERE t.rowid = " . $id; |
|
216 | + $sql .= " FROM ".MAIN_DB_PREFIX."payment_expensereport as t"; |
|
217 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pt ON t.fk_typepayment = pt.id"; |
|
218 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid'; |
|
219 | + $sql .= " WHERE t.rowid = ".$id; |
|
220 | 220 | |
221 | - dol_syslog(get_class($this) . "::fetch", LOG_DEBUG); |
|
221 | + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); |
|
222 | 222 | $resql = $this->db->query($sql); |
223 | 223 | if ($resql) { |
224 | 224 | if ($this->db->num_rows($resql)) { |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | return 1; |
251 | 251 | } else { |
252 | - $this->error = "Error " . $this->db->lasterror(); |
|
252 | + $this->error = "Error ".$this->db->lasterror(); |
|
253 | 253 | return -1; |
254 | 254 | } |
255 | 255 | } |
@@ -297,30 +297,30 @@ discard block |
||
297 | 297 | // Check parameters |
298 | 298 | // Put here code to add control on parameters values |
299 | 299 | // Update request |
300 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "payment_expensereport SET"; |
|
300 | + $sql = "UPDATE ".MAIN_DB_PREFIX."payment_expensereport SET"; |
|
301 | 301 | |
302 | - $sql .= " fk_expensereport=" . (isset($this->fk_expensereport) ? $this->fk_expensereport : "null") . ","; |
|
303 | - $sql .= " datec=" . (dol_strlen($this->datec) != 0 ? "'" . $this->db->idate($this->datec) . "'" : 'null') . ","; |
|
304 | - $sql .= " tms=" . (dol_strlen($this->tms) != 0 ? "'" . $this->db->idate($this->tms) . "'" : 'null') . ","; |
|
305 | - $sql .= " datep=" . (dol_strlen($this->datep) != 0 ? "'" . $this->db->idate($this->datep) . "'" : 'null') . ","; |
|
306 | - $sql .= " amount=" . (isset($this->amount) ? $this->amount : "null") . ","; |
|
307 | - $sql .= " fk_typepayment=" . (isset($this->fk_typepayment) ? $this->fk_typepayment : "null") . ","; |
|
308 | - $sql .= " num_payment=" . (isset($this->num_payment) ? "'" . $this->db->escape($this->num_payment) . "'" : "null") . ","; |
|
309 | - $sql .= " note=" . (isset($this->note) ? "'" . $this->db->escape($this->note) . "'" : "null") . ","; |
|
310 | - $sql .= " fk_bank=" . (isset($this->fk_bank) ? $this->fk_bank : "null") . ","; |
|
311 | - $sql .= " fk_user_creat=" . (isset($this->fk_user_creat) ? $this->fk_user_creat : "null") . ","; |
|
312 | - $sql .= " fk_user_modif=" . (isset($this->fk_user_modif) ? $this->fk_user_modif : "null") . ""; |
|
302 | + $sql .= " fk_expensereport=".(isset($this->fk_expensereport) ? $this->fk_expensereport : "null").","; |
|
303 | + $sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').","; |
|
304 | + $sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').","; |
|
305 | + $sql .= " datep=".(dol_strlen($this->datep) != 0 ? "'".$this->db->idate($this->datep)."'" : 'null').","; |
|
306 | + $sql .= " amount=".(isset($this->amount) ? $this->amount : "null").","; |
|
307 | + $sql .= " fk_typepayment=".(isset($this->fk_typepayment) ? $this->fk_typepayment : "null").","; |
|
308 | + $sql .= " num_payment=".(isset($this->num_payment) ? "'".$this->db->escape($this->num_payment)."'" : "null").","; |
|
309 | + $sql .= " note=".(isset($this->note) ? "'".$this->db->escape($this->note)."'" : "null").","; |
|
310 | + $sql .= " fk_bank=".(isset($this->fk_bank) ? $this->fk_bank : "null").","; |
|
311 | + $sql .= " fk_user_creat=".(isset($this->fk_user_creat) ? $this->fk_user_creat : "null").","; |
|
312 | + $sql .= " fk_user_modif=".(isset($this->fk_user_modif) ? $this->fk_user_modif : "null").""; |
|
313 | 313 | |
314 | 314 | |
315 | - $sql .= " WHERE rowid=" . $this->id; |
|
315 | + $sql .= " WHERE rowid=".$this->id; |
|
316 | 316 | |
317 | 317 | $this->db->begin(); |
318 | 318 | |
319 | - dol_syslog(get_class($this) . "::update", LOG_DEBUG); |
|
319 | + dol_syslog(get_class($this)."::update", LOG_DEBUG); |
|
320 | 320 | $resql = $this->db->query($sql); |
321 | 321 | if (!$resql) { |
322 | 322 | $error++; |
323 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
323 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
324 | 324 | } |
325 | 325 | |
326 | 326 | if (!$error) { |
@@ -339,8 +339,8 @@ discard block |
||
339 | 339 | // Commit or rollback |
340 | 340 | if ($error) { |
341 | 341 | foreach ($this->errors as $errmsg) { |
342 | - dol_syslog(get_class($this) . "::update " . $errmsg, LOG_ERR); |
|
343 | - $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); |
|
342 | + dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); |
|
343 | + $this->error .= ($this->error ? ', '.$errmsg : $errmsg); |
|
344 | 344 | } |
345 | 345 | $this->db->rollback(); |
346 | 346 | return -1 * $error; |
@@ -365,26 +365,26 @@ discard block |
||
365 | 365 | $this->db->begin(); |
366 | 366 | |
367 | 367 | if (!$error) { |
368 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "bank_url"; |
|
369 | - $sql .= " WHERE type='payment_expensereport' AND url_id=" . $this->id; |
|
368 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url"; |
|
369 | + $sql .= " WHERE type='payment_expensereport' AND url_id=".$this->id; |
|
370 | 370 | |
371 | - dol_syslog(get_class($this) . "::delete", LOG_DEBUG); |
|
371 | + dol_syslog(get_class($this)."::delete", LOG_DEBUG); |
|
372 | 372 | $resql = $this->db->query($sql); |
373 | 373 | if (!$resql) { |
374 | 374 | $error++; |
375 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
375 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
376 | 376 | } |
377 | 377 | } |
378 | 378 | |
379 | 379 | if (!$error) { |
380 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "payment_expensereport"; |
|
381 | - $sql .= " WHERE rowid=" . $this->id; |
|
380 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_expensereport"; |
|
381 | + $sql .= " WHERE rowid=".$this->id; |
|
382 | 382 | |
383 | - dol_syslog(get_class($this) . "::delete", LOG_DEBUG); |
|
383 | + dol_syslog(get_class($this)."::delete", LOG_DEBUG); |
|
384 | 384 | $resql = $this->db->query($sql); |
385 | 385 | if (!$resql) { |
386 | 386 | $error++; |
387 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
387 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
388 | 388 | } |
389 | 389 | } |
390 | 390 | |
@@ -404,8 +404,8 @@ discard block |
||
404 | 404 | // Commit or rollback |
405 | 405 | if ($error) { |
406 | 406 | foreach ($this->errors as $errmsg) { |
407 | - dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR); |
|
408 | - $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); |
|
407 | + dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); |
|
408 | + $this->error .= ($this->error ? ', '.$errmsg : $errmsg); |
|
409 | 409 | } |
410 | 410 | $this->db->rollback(); |
411 | 411 | return -1 * $error; |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | $error = 0; |
536 | 536 | |
537 | 537 | if (!empty($conf->banque->enabled)) { |
538 | - include_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
538 | + include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
539 | 539 | |
540 | 540 | $acc = new Account($this->db); |
541 | 541 | $acc->fetch($accountid); |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | $url = ''; |
568 | 568 | if ($mode == 'payment_expensereport') { |
569 | 569 | // $url = DOL_URL_ROOT . '/expensereport/payment/card.php?rowid='; |
570 | - $url = BASE_URI . '?controller=expensereport/payment&method=card&rowid='; |
|
570 | + $url = BASE_URI.'?controller=expensereport/payment&method=card&rowid='; |
|
571 | 571 | } |
572 | 572 | if ($url) { |
573 | 573 | $result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode); |
@@ -587,11 +587,11 @@ discard block |
||
587 | 587 | $result = $acc->add_url_line( |
588 | 588 | $bank_line_id, $fuser->id, |
589 | 589 | //DOL_URL_ROOT.'/user/card.php?id=', |
590 | - BASE_URI . '?controller=user&method=card&id=', $fuser->getFullName($langs), 'user' |
|
590 | + BASE_URI.'?controller=user&method=card&id=', $fuser->getFullName($langs), 'user' |
|
591 | 591 | ); |
592 | 592 | if ($result <= 0) { |
593 | 593 | $this->error = $this->db->lasterror(); |
594 | - dol_syslog(get_class($this) . '::addPaymentToBank ' . $this->error); |
|
594 | + dol_syslog(get_class($this).'::addPaymentToBank '.$this->error); |
|
595 | 595 | $error++; |
596 | 596 | } |
597 | 597 | } |
@@ -620,9 +620,9 @@ discard block |
||
620 | 620 | function update_fk_bank($id_bank) |
621 | 621 | { |
622 | 622 | // phpcs:enable |
623 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "payment_expensereport SET fk_bank = " . $id_bank . " WHERE rowid = " . $this->id; |
|
623 | + $sql = "UPDATE ".MAIN_DB_PREFIX."payment_expensereport SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id; |
|
624 | 624 | |
625 | - dol_syslog(get_class($this) . "::update_fk_bank", LOG_DEBUG); |
|
625 | + dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG); |
|
626 | 626 | $result = $this->db->query($sql); |
627 | 627 | if ($result) { |
628 | 628 | return 1; |
@@ -648,20 +648,20 @@ discard block |
||
648 | 648 | if (empty($this->ref)) { |
649 | 649 | $this->ref = $this->lib; |
650 | 650 | } |
651 | - $label = $langs->trans("ShowPayment") . ': ' . $this->ref; |
|
651 | + $label = $langs->trans("ShowPayment").': '.$this->ref; |
|
652 | 652 | |
653 | 653 | if (!empty($this->id)) { |
654 | - $link = '<a href="' . DOL_URL_ROOT . '/expensereport/payment/card.php?id=' . $this->id . '" title="' . dol_escape_htmltag($label, 1) . '" class="classfortooltip">'; |
|
654 | + $link = '<a href="'.DOL_URL_ROOT.'/expensereport/payment/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; |
|
655 | 655 | $linkend = '</a>'; |
656 | 656 | |
657 | 657 | if ($withpicto) { |
658 | - $result .= ($link . img_object($label, 'payment', 'class="classfortooltip"') . $linkend . ' '); |
|
658 | + $result .= ($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' '); |
|
659 | 659 | } |
660 | 660 | if ($withpicto && $withpicto != 2) { |
661 | 661 | $result .= ' '; |
662 | 662 | } |
663 | 663 | if ($withpicto != 2) { |
664 | - $result .= $link . ($maxlen ? dol_trunc($this->ref, $maxlen) : $this->ref) . $linkend; |
|
664 | + $result .= $link.($maxlen ? dol_trunc($this->ref, $maxlen) : $this->ref).$linkend; |
|
665 | 665 | } |
666 | 666 | } |
667 | 667 | |
@@ -677,10 +677,10 @@ discard block |
||
677 | 677 | function info($id) |
678 | 678 | { |
679 | 679 | $sql = 'SELECT e.rowid, e.datec, e.fk_user_creat, e.fk_user_modif, e.tms'; |
680 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'payment_expensereport as e'; |
|
681 | - $sql .= ' WHERE e.rowid = ' . $id; |
|
680 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'payment_expensereport as e'; |
|
681 | + $sql .= ' WHERE e.rowid = '.$id; |
|
682 | 682 | |
683 | - dol_syslog(get_class($this) . '::info', LOG_DEBUG); |
|
683 | + dol_syslog(get_class($this).'::info', LOG_DEBUG); |
|
684 | 684 | $result = $this->db->query($sql); |
685 | 685 | |
686 | 686 | if ($result) { |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | * \file htdocs/user/class/usergroup.class.php |
28 | 28 | * \brief File of class to manage user groups |
29 | 29 | */ |
30 | -require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; |
|
30 | +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; |
|
31 | 31 | if (!empty($conf->ldap->enabled)) { |
32 | - require_once DOL_DOCUMENT_ROOT . "/core/class/ldap.class.php"; |
|
32 | + require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -70,15 +70,15 @@ discard block |
||
70 | 70 | /** |
71 | 71 | * @var string name |
72 | 72 | */ |
73 | - public $name; // Name of group |
|
73 | + public $name; // Name of group |
|
74 | 74 | public $globalgroup; // Global group |
75 | - public $datec; // Creation date of group |
|
76 | - public $datem; // Modification date of group |
|
77 | - public $note; // Description |
|
75 | + public $datec; // Creation date of group |
|
76 | + public $datem; // Modification date of group |
|
77 | + public $note; // Description |
|
78 | 78 | public $members = array(); // Array of users |
79 | - public $nb_rights; // Number of rights granted to the user |
|
80 | - private $_tab_loaded = array(); // Array of cache of already loaded permissions |
|
81 | - public $oldcopy; // To contains a clone of this when we need to save old properties of object |
|
79 | + public $nb_rights; // Number of rights granted to the user |
|
80 | + private $_tab_loaded = array(); // Array of cache of already loaded permissions |
|
81 | + public $oldcopy; // To contains a clone of this when we need to save old properties of object |
|
82 | 82 | |
83 | 83 | /** |
84 | 84 | * Constructor de la classe |
@@ -105,14 +105,14 @@ discard block |
||
105 | 105 | global $conf; |
106 | 106 | |
107 | 107 | $sql = "SELECT g.rowid, g.entity, g.nom as name, g.note, g.datec, g.tms as datem"; |
108 | - $sql .= " FROM " . MAIN_DB_PREFIX . "usergroup as g"; |
|
108 | + $sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g"; |
|
109 | 109 | if ($groupname) { |
110 | - $sql .= " WHERE g.nom = '" . $this->db->escape($groupname) . "'"; |
|
110 | + $sql .= " WHERE g.nom = '".$this->db->escape($groupname)."'"; |
|
111 | 111 | } else { |
112 | - $sql .= " WHERE g.rowid = " . $id; |
|
112 | + $sql .= " WHERE g.rowid = ".$id; |
|
113 | 113 | } |
114 | 114 | |
115 | - dol_syslog(get_class($this) . "::fetch", LOG_DEBUG); |
|
115 | + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); |
|
116 | 116 | $result = $this->db->query($sql); |
117 | 117 | if ($result) { |
118 | 118 | if ($this->db->num_rows($result)) { |
@@ -162,18 +162,18 @@ discard block |
||
162 | 162 | $ret = array(); |
163 | 163 | |
164 | 164 | $sql = "SELECT g.rowid, ug.entity as usergroup_entity"; |
165 | - $sql .= " FROM " . MAIN_DB_PREFIX . "usergroup as g,"; |
|
166 | - $sql .= " " . MAIN_DB_PREFIX . "usergroup_user as ug"; |
|
165 | + $sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g,"; |
|
166 | + $sql .= " ".MAIN_DB_PREFIX."usergroup_user as ug"; |
|
167 | 167 | $sql .= " WHERE ug.fk_usergroup = g.rowid"; |
168 | - $sql .= " AND ug.fk_user = " . $userid; |
|
168 | + $sql .= " AND ug.fk_user = ".$userid; |
|
169 | 169 | if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) { |
170 | 170 | $sql .= " AND g.entity IS NOT NULL"; |
171 | 171 | } else { |
172 | - $sql .= " AND g.entity IN (0," . $conf->entity . ")"; |
|
172 | + $sql .= " AND g.entity IN (0,".$conf->entity.")"; |
|
173 | 173 | } |
174 | 174 | $sql .= " ORDER BY g.nom"; |
175 | 175 | |
176 | - dol_syslog(get_class($this) . "::listGroupsForUser", LOG_DEBUG); |
|
176 | + dol_syslog(get_class($this)."::listGroupsForUser", LOG_DEBUG); |
|
177 | 177 | $result = $this->db->query($sql); |
178 | 178 | if ($result) { |
179 | 179 | while ($obj = $this->db->fetch_object($result)) { |
@@ -212,29 +212,29 @@ discard block |
||
212 | 212 | if (!empty($this->id)) { |
213 | 213 | $sql .= ", ug.entity as usergroup_entity"; |
214 | 214 | } |
215 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user as u"; |
|
215 | + $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; |
|
216 | 216 | if (!empty($this->id)) { |
217 | - $sql .= ", " . MAIN_DB_PREFIX . "usergroup_user as ug"; |
|
217 | + $sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; |
|
218 | 218 | } |
219 | 219 | $sql .= " WHERE 1 = 1"; |
220 | 220 | if (!empty($this->id)) { |
221 | 221 | $sql .= " AND ug.fk_user = u.rowid"; |
222 | 222 | } |
223 | 223 | if (!empty($this->id)) { |
224 | - $sql .= " AND ug.fk_usergroup = " . $this->id; |
|
224 | + $sql .= " AND ug.fk_usergroup = ".$this->id; |
|
225 | 225 | } |
226 | 226 | if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) { { |
227 | 227 | $sql .= " AND u.entity IS NOT NULL"; |
228 | 228 | } |
229 | 229 | } else { { |
230 | - $sql .= " AND u.entity IN (0," . $conf->entity . ")"; |
|
230 | + $sql .= " AND u.entity IN (0,".$conf->entity.")"; |
|
231 | 231 | } |
232 | 232 | } |
233 | 233 | if (!empty($excludefilter)) { |
234 | - $sql .= ' AND (' . $excludefilter . ')'; |
|
234 | + $sql .= ' AND ('.$excludefilter.')'; |
|
235 | 235 | } |
236 | 236 | |
237 | - dol_syslog(get_class($this) . "::listUsersForGroup", LOG_DEBUG); |
|
237 | + dol_syslog(get_class($this)."::listUsersForGroup", LOG_DEBUG); |
|
238 | 238 | $resql = $this->db->query($sql); |
239 | 239 | if ($resql) { |
240 | 240 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | |
276 | 276 | $entity = (!empty($entity) ? $entity : $conf->entity); |
277 | 277 | |
278 | - dol_syslog(get_class($this) . "::addrights $rid, $allmodule, $allperms, $entity"); |
|
278 | + dol_syslog(get_class($this)."::addrights $rid, $allmodule, $allperms, $entity"); |
|
279 | 279 | $error = 0; |
280 | 280 | $whereforadd = ''; |
281 | 281 | |
@@ -285,9 +285,9 @@ discard block |
||
285 | 285 | // Si on a demande ajout d'un droit en particulier, on recupere |
286 | 286 | // les caracteristiques (module, perms et subperms) de ce droit. |
287 | 287 | $sql = "SELECT module, perms, subperms"; |
288 | - $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def"; |
|
289 | - $sql .= " WHERE id = '" . $this->db->escape($rid) . "'"; |
|
290 | - $sql .= " AND entity = " . $entity; |
|
288 | + $sql .= " FROM ".MAIN_DB_PREFIX."rights_def"; |
|
289 | + $sql .= " WHERE id = '".$this->db->escape($rid)."'"; |
|
290 | + $sql .= " AND entity = ".$entity; |
|
291 | 291 | |
292 | 292 | $result = $this->db->query($sql); |
293 | 293 | if ($result) { |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | } |
302 | 302 | |
303 | 303 | // Where pour la liste des droits a ajouter |
304 | - $whereforadd = "id=" . $this->db->escape($rid); |
|
304 | + $whereforadd = "id=".$this->db->escape($rid); |
|
305 | 305 | // Ajout des droits induits |
306 | 306 | if ($subperms) { |
307 | 307 | $whereforadd .= " OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))"; |
@@ -318,9 +318,9 @@ discard block |
||
318 | 318 | if ($allmodule == 'allmodules') { |
319 | 319 | $whereforadd = 'allmodules'; |
320 | 320 | } else { |
321 | - $whereforadd = "module='" . $this->db->escape($allmodule) . "'"; |
|
321 | + $whereforadd = "module='".$this->db->escape($allmodule)."'"; |
|
322 | 322 | if (!empty($allperms)) { |
323 | - $whereforadd .= " AND perms='" . $this->db->escape($allperms) . "'"; |
|
323 | + $whereforadd .= " AND perms='".$this->db->escape($allperms)."'"; |
|
324 | 324 | } |
325 | 325 | } |
326 | 326 | } |
@@ -330,10 +330,10 @@ discard block |
||
330 | 330 | if (!empty($whereforadd)) { |
331 | 331 | //print "$module-$perms-$subperms"; |
332 | 332 | $sql = "SELECT id"; |
333 | - $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def"; |
|
334 | - $sql .= " WHERE entity = " . $entity; |
|
333 | + $sql .= " FROM ".MAIN_DB_PREFIX."rights_def"; |
|
334 | + $sql .= " WHERE entity = ".$entity; |
|
335 | 335 | if (!empty($whereforadd) && $whereforadd != 'allmodules') { |
336 | - $sql .= " AND " . $whereforadd; |
|
336 | + $sql .= " AND ".$whereforadd; |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | $result = $this->db->query($sql); |
@@ -344,11 +344,11 @@ discard block |
||
344 | 344 | $obj = $this->db->fetch_object($result); |
345 | 345 | $nid = $obj->id; |
346 | 346 | |
347 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "usergroup_rights WHERE fk_usergroup = $this->id AND fk_id=" . $nid . " AND entity = " . $entity; |
|
347 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."usergroup_rights WHERE fk_usergroup = $this->id AND fk_id=".$nid." AND entity = ".$entity; |
|
348 | 348 | if (!$this->db->query($sql)) { |
349 | 349 | $error++; |
350 | 350 | } |
351 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "usergroup_rights (entity, fk_usergroup, fk_id) VALUES (" . $entity . ", " . $this->id . ", " . $nid . ")"; |
|
351 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."usergroup_rights (entity, fk_usergroup, fk_id) VALUES (".$entity.", ".$this->id.", ".$nid.")"; |
|
352 | 352 | if (!$this->db->query($sql)) { |
353 | 353 | $error++; |
354 | 354 | } |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | |
363 | 363 | if (!$error) { |
364 | 364 | $langs->load("other"); |
365 | - $this->context = array('audit' => $langs->trans("PermissionsAdd") . ($rid ? ' (id=' . $rid . ')' : '')); |
|
365 | + $this->context = array('audit' => $langs->trans("PermissionsAdd").($rid ? ' (id='.$rid.')' : '')); |
|
366 | 366 | |
367 | 367 | // Call trigger |
368 | 368 | $result = $this->call_trigger('GROUP_MODIFY', $user); |
@@ -406,9 +406,9 @@ discard block |
||
406 | 406 | // Si on a demande supression d'un droit en particulier, on recupere |
407 | 407 | // les caracteristiques module, perms et subperms de ce droit. |
408 | 408 | $sql = "SELECT module, perms, subperms"; |
409 | - $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def"; |
|
410 | - $sql .= " WHERE id = '" . $this->db->escape($rid) . "'"; |
|
411 | - $sql .= " AND entity = " . $entity; |
|
409 | + $sql .= " FROM ".MAIN_DB_PREFIX."rights_def"; |
|
410 | + $sql .= " WHERE id = '".$this->db->escape($rid)."'"; |
|
411 | + $sql .= " AND entity = ".$entity; |
|
412 | 412 | |
413 | 413 | $result = $this->db->query($sql); |
414 | 414 | if ($result) { |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | } |
423 | 423 | |
424 | 424 | // Where pour la liste des droits a supprimer |
425 | - $wherefordel = "id=" . $this->db->escape($rid); |
|
425 | + $wherefordel = "id=".$this->db->escape($rid); |
|
426 | 426 | // Suppression des droits induits |
427 | 427 | if ($subperms == 'lire' || $subperms == 'read') { |
428 | 428 | $wherefordel .= " OR (module='$module' AND perms='$perms' AND subperms IS NOT NULL)"; |
@@ -440,9 +440,9 @@ discard block |
||
440 | 440 | if ($allmodule == 'allmodules') { |
441 | 441 | $wherefordel = 'allmodules'; |
442 | 442 | } else { |
443 | - $wherefordel = "module='" . $this->db->escape($allmodule) . "'"; |
|
443 | + $wherefordel = "module='".$this->db->escape($allmodule)."'"; |
|
444 | 444 | if (!empty($allperms)) |
445 | - $whereforadd .= " AND perms='" . $this->db->escape($allperms) . "'"; |
|
445 | + $whereforadd .= " AND perms='".$this->db->escape($allperms)."'"; |
|
446 | 446 | } |
447 | 447 | } |
448 | 448 | } |
@@ -451,10 +451,10 @@ discard block |
||
451 | 451 | if (!empty($wherefordel)) { |
452 | 452 | //print "$module-$perms-$subperms"; |
453 | 453 | $sql = "SELECT id"; |
454 | - $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def"; |
|
455 | - $sql .= " WHERE entity = " . $entity; |
|
454 | + $sql .= " FROM ".MAIN_DB_PREFIX."rights_def"; |
|
455 | + $sql .= " WHERE entity = ".$entity; |
|
456 | 456 | if (!empty($wherefordel) && $wherefordel != 'allmodules') { |
457 | - $sql .= " AND " . $wherefordel; |
|
457 | + $sql .= " AND ".$wherefordel; |
|
458 | 458 | } |
459 | 459 | |
460 | 460 | $result = $this->db->query($sql); |
@@ -465,9 +465,9 @@ discard block |
||
465 | 465 | $obj = $this->db->fetch_object($result); |
466 | 466 | $nid = $obj->id; |
467 | 467 | |
468 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "usergroup_rights"; |
|
469 | - $sql .= " WHERE fk_usergroup = $this->id AND fk_id=" . $nid; |
|
470 | - $sql .= " AND entity = " . $entity; |
|
468 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."usergroup_rights"; |
|
469 | + $sql .= " WHERE fk_usergroup = $this->id AND fk_id=".$nid; |
|
470 | + $sql .= " AND entity = ".$entity; |
|
471 | 471 | if (!$this->db->query($sql)) { |
472 | 472 | $error++; |
473 | 473 | } |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | |
482 | 482 | if (!$error) { |
483 | 483 | $langs->load("other"); |
484 | - $this->context = array('audit' => $langs->trans("PermissionsDelete") . ($rid ? ' (id=' . $rid . ')' : '')); |
|
484 | + $this->context = array('audit' => $langs->trans("PermissionsDelete").($rid ? ' (id='.$rid.')' : '')); |
|
485 | 485 | |
486 | 486 | // Call trigger |
487 | 487 | $result = $this->call_trigger('GROUP_MODIFY', $user); |
@@ -525,17 +525,17 @@ discard block |
||
525 | 525 | * Recuperation des droits |
526 | 526 | */ |
527 | 527 | $sql = "SELECT r.module, r.perms, r.subperms "; |
528 | - $sql .= " FROM " . MAIN_DB_PREFIX . "usergroup_rights as u, " . MAIN_DB_PREFIX . "rights_def as r"; |
|
528 | + $sql .= " FROM ".MAIN_DB_PREFIX."usergroup_rights as u, ".MAIN_DB_PREFIX."rights_def as r"; |
|
529 | 529 | $sql .= " WHERE r.id = u.fk_id"; |
530 | - $sql .= " AND r.entity = " . $conf->entity; |
|
531 | - $sql .= " AND u.entity = " . $conf->entity; |
|
532 | - $sql .= " AND u.fk_usergroup = " . $this->id; |
|
530 | + $sql .= " AND r.entity = ".$conf->entity; |
|
531 | + $sql .= " AND u.entity = ".$conf->entity; |
|
532 | + $sql .= " AND u.fk_usergroup = ".$this->id; |
|
533 | 533 | $sql .= " AND r.perms IS NOT NULL"; |
534 | 534 | if ($moduletag) { |
535 | - $sql .= " AND r.module = '" . $this->db->escape($moduletag) . "'"; |
|
535 | + $sql .= " AND r.module = '".$this->db->escape($moduletag)."'"; |
|
536 | 536 | } |
537 | 537 | |
538 | - dol_syslog(get_class($this) . '::getrights', LOG_DEBUG); |
|
538 | + dol_syslog(get_class($this).'::getrights', LOG_DEBUG); |
|
539 | 539 | $resql = $this->db->query($sql); |
540 | 540 | if ($resql) { |
541 | 541 | $num = $this->db->num_rows($resql); |
@@ -600,12 +600,12 @@ discard block |
||
600 | 600 | |
601 | 601 | $this->db->begin(); |
602 | 602 | |
603 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "usergroup_rights"; |
|
604 | - $sql .= " WHERE fk_usergroup = " . $this->id; |
|
603 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."usergroup_rights"; |
|
604 | + $sql .= " WHERE fk_usergroup = ".$this->id; |
|
605 | 605 | $this->db->query($sql); |
606 | 606 | |
607 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "usergroup_user"; |
|
608 | - $sql .= " WHERE fk_usergroup = " . $this->id; |
|
607 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."usergroup_user"; |
|
608 | + $sql .= " WHERE fk_usergroup = ".$this->id; |
|
609 | 609 | $this->db->query($sql); |
610 | 610 | |
611 | 611 | // Remove extrafields |
@@ -613,12 +613,12 @@ discard block |
||
613 | 613 | $result = $this->deleteExtraFields(); |
614 | 614 | if ($result < 0) { |
615 | 615 | $error++; |
616 | - dol_syslog(get_class($this) . "::delete error -4 " . $this->error, LOG_ERR); |
|
616 | + dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); |
|
617 | 617 | } |
618 | 618 | } |
619 | 619 | |
620 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "usergroup"; |
|
621 | - $sql .= " WHERE rowid = " . $this->id; |
|
620 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."usergroup"; |
|
621 | + $sql .= " WHERE rowid = ".$this->id; |
|
622 | 622 | $result = $this->db->query($sql); |
623 | 623 | if ($result) { |
624 | 624 | // Call trigger |
@@ -662,20 +662,20 @@ discard block |
||
662 | 662 | |
663 | 663 | $this->db->begin(); |
664 | 664 | |
665 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "usergroup ("; |
|
665 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."usergroup ("; |
|
666 | 666 | $sql .= "datec"; |
667 | 667 | $sql .= ", nom"; |
668 | 668 | $sql .= ", entity"; |
669 | 669 | $sql .= ") VALUES ("; |
670 | - $sql .= "'" . $this->db->idate($now) . "'"; |
|
671 | - $sql .= ",'" . $this->db->escape($this->nom) . "'"; |
|
672 | - $sql .= "," . $this->db->escape($entity); |
|
670 | + $sql .= "'".$this->db->idate($now)."'"; |
|
671 | + $sql .= ",'".$this->db->escape($this->nom)."'"; |
|
672 | + $sql .= ",".$this->db->escape($entity); |
|
673 | 673 | $sql .= ")"; |
674 | 674 | |
675 | - dol_syslog(get_class($this) . "::create", LOG_DEBUG); |
|
675 | + dol_syslog(get_class($this)."::create", LOG_DEBUG); |
|
676 | 676 | $result = $this->db->query($sql); |
677 | 677 | if ($result) { |
678 | - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "usergroup"); |
|
678 | + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."usergroup"); |
|
679 | 679 | |
680 | 680 | if ($this->update(1) < 0) { |
681 | 681 | return -2; |
@@ -737,13 +737,13 @@ discard block |
||
737 | 737 | |
738 | 738 | $this->db->begin(); |
739 | 739 | |
740 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "usergroup SET "; |
|
741 | - $sql .= " nom = '" . $this->db->escape($this->name) . "'"; |
|
742 | - $sql .= ", entity = " . $this->db->escape($entity); |
|
743 | - $sql .= ", note = '" . $this->db->escape($this->note) . "'"; |
|
744 | - $sql .= " WHERE rowid = " . $this->id; |
|
740 | + $sql = "UPDATE ".MAIN_DB_PREFIX."usergroup SET "; |
|
741 | + $sql .= " nom = '".$this->db->escape($this->name)."'"; |
|
742 | + $sql .= ", entity = ".$this->db->escape($entity); |
|
743 | + $sql .= ", note = '".$this->db->escape($this->note)."'"; |
|
744 | + $sql .= " WHERE rowid = ".$this->id; |
|
745 | 745 | |
746 | - dol_syslog(get_class($this) . "::update", LOG_DEBUG); |
|
746 | + dol_syslog(get_class($this)."::update", LOG_DEBUG); |
|
747 | 747 | $resql = $this->db->query($sql); |
748 | 748 | if ($resql) { |
749 | 749 | $action = 'update'; |
@@ -834,12 +834,12 @@ discard block |
||
834 | 834 | $linkend = ''; |
835 | 835 | |
836 | 836 | $label .= '<div class="centpercent">'; |
837 | - $label .= '<u>' . $langs->trans("Group") . '</u><br>'; |
|
838 | - $label .= '<b>' . $langs->trans('Name') . ':</b> ' . $this->name; |
|
839 | - $label .= '<br><b>' . $langs->trans("Description") . ':</b> ' . $this->note; |
|
837 | + $label .= '<u>'.$langs->trans("Group").'</u><br>'; |
|
838 | + $label .= '<b>'.$langs->trans('Name').':</b> '.$this->name; |
|
839 | + $label .= '<br><b>'.$langs->trans("Description").':</b> '.$this->note; |
|
840 | 840 | $label .= '</div>'; |
841 | 841 | |
842 | - $url = DOL_URL_ROOT . '/user/group/card.php?id=' . $this->id; |
|
842 | + $url = DOL_URL_ROOT.'/user/group/card.php?id='.$this->id; |
|
843 | 843 | |
844 | 844 | if ($option != 'nolink') { |
845 | 845 | // Add param to save lastsearch_values or not |
@@ -857,10 +857,10 @@ discard block |
||
857 | 857 | if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { |
858 | 858 | $langs->load("users"); |
859 | 859 | $label = $langs->trans("ShowGroup"); |
860 | - $linkclose .= ' alt="' . dol_escape_htmltag($label, 1, 1) . '"'; |
|
860 | + $linkclose .= ' alt="'.dol_escape_htmltag($label, 1, 1).'"'; |
|
861 | 861 | } |
862 | - $linkclose .= ' title="' . dol_escape_htmltag($label, 1, 1) . '"'; |
|
863 | - $linkclose .= ' class="classfortooltip' . ($morecss ? ' ' . $morecss : '') . '"'; |
|
862 | + $linkclose .= ' title="'.dol_escape_htmltag($label, 1, 1).'"'; |
|
863 | + $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; |
|
864 | 864 | |
865 | 865 | /* |
866 | 866 | $hookmanager->initHooks(array('groupdao')); |
@@ -870,13 +870,13 @@ discard block |
||
870 | 870 | */ |
871 | 871 | } |
872 | 872 | |
873 | - $linkstart = '<a href="' . $url . '"'; |
|
874 | - $linkstart .= $linkclose . '>'; |
|
873 | + $linkstart = '<a href="'.$url.'"'; |
|
874 | + $linkstart .= $linkclose.'>'; |
|
875 | 875 | $linkend = '</a>'; |
876 | 876 | |
877 | 877 | $result = $linkstart; |
878 | 878 | if ($withpicto) { |
879 | - $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="' . (($withpicto != 2) ? 'paddingright ' : '') . 'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); |
|
879 | + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); |
|
880 | 880 | } |
881 | 881 | if ($withpicto != 2) { |
882 | 882 | $result .= $this->name; |
@@ -886,7 +886,7 @@ discard block |
||
886 | 886 | global $action; |
887 | 887 | $hookmanager->initHooks(array('groupdao')); |
888 | 888 | $parameters = array('id' => $this->id, 'getnomurl' => $result); |
889 | - $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
|
889 | + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
|
890 | 890 | if ($reshook > 0) { |
891 | 891 | $result = $hookmanager->resPrint; |
892 | 892 | } else { |
@@ -911,13 +911,13 @@ discard block |
||
911 | 911 | global $conf; |
912 | 912 | $dn = ''; |
913 | 913 | if ($mode == 0) { |
914 | - $dn = $conf->global->LDAP_KEY_GROUPS . "=" . $info[$conf->global->LDAP_KEY_GROUPS] . "," . $conf->global->LDAP_GROUP_DN; |
|
914 | + $dn = $conf->global->LDAP_KEY_GROUPS."=".$info[$conf->global->LDAP_KEY_GROUPS].",".$conf->global->LDAP_GROUP_DN; |
|
915 | 915 | } |
916 | 916 | if ($mode == 1) { |
917 | 917 | $dn = $conf->global->LDAP_GROUP_DN; |
918 | 918 | } |
919 | 919 | if ($mode == 2) { |
920 | - $dn = $conf->global->LDAP_KEY_GROUPS . "=" . $info[$conf->global->LDAP_KEY_GROUPS]; |
|
920 | + $dn = $conf->global->LDAP_KEY_GROUPS."=".$info[$conf->global->LDAP_KEY_GROUPS]; |
|
921 | 921 | } |
922 | 922 | return $dn; |
923 | 923 | } |
@@ -243,8 +243,9 @@ discard block |
||
243 | 243 | $newuser = new User($this->db); |
244 | 244 | $newuser->fetch($obj->rowid); |
245 | 245 | $ret[$obj->rowid] = $newuser; |
246 | - } else |
|
247 | - $ret[$obj->rowid] = $obj->rowid; |
|
246 | + } else { |
|
247 | + $ret[$obj->rowid] = $obj->rowid; |
|
248 | + } |
|
248 | 249 | } |
249 | 250 | if ($mode != 1 && !empty($obj->usergroup_entity)) { |
250 | 251 | $ret[$obj->rowid]->usergroup_entity[] = $obj->usergroup_entity; |
@@ -441,8 +442,9 @@ discard block |
||
441 | 442 | $wherefordel = 'allmodules'; |
442 | 443 | } else { |
443 | 444 | $wherefordel = "module='" . $this->db->escape($allmodule) . "'"; |
444 | - if (!empty($allperms)) |
|
445 | - $whereforadd .= " AND perms='" . $this->db->escape($allperms) . "'"; |
|
445 | + if (!empty($allperms)) { |
|
446 | + $whereforadd .= " AND perms='" . $this->db->escape($allperms) . "'"; |
|
447 | + } |
|
446 | 448 | } |
447 | 449 | } |
448 | 450 | } |
@@ -80,18 +80,18 @@ discard block |
||
80 | 80 | //$socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $societe; |
81 | 81 | |
82 | 82 | $sql = "SELECT t.rowid"; |
83 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user as t"; |
|
84 | - $sql .= ' WHERE t.entity IN (' . getEntity('user') . ')'; |
|
83 | + $sql .= " FROM ".MAIN_DB_PREFIX."user as t"; |
|
84 | + $sql .= ' WHERE t.entity IN ('.getEntity('user').')'; |
|
85 | 85 | if ($user_ids) { |
86 | - $sql .= " AND t.rowid IN (" . $user_ids . ")"; |
|
86 | + $sql .= " AND t.rowid IN (".$user_ids.")"; |
|
87 | 87 | } |
88 | 88 | // Add sql filters |
89 | 89 | if ($sqlfilters) { |
90 | 90 | if (!DolibarrApi::_checkFilters($sqlfilters)) { |
91 | - throw new RestException(503, 'Error when validating parameter sqlfilters ' . $sqlfilters); |
|
91 | + throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); |
|
92 | 92 | } |
93 | 93 | $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; |
94 | - $sql .= " AND (" . preg_replace_callback('/' . $regexstring . '/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters) . ")"; |
|
94 | + $sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | $sql .= $db->order($sortfield, $sortorder); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $i++; |
119 | 119 | } |
120 | 120 | } else { |
121 | - throw new RestException(503, 'Error when retrieve User list : ' . $db->lasterror()); |
|
121 | + throw new RestException(503, 'Error when retrieve User list : '.$db->lasterror()); |
|
122 | 122 | } |
123 | 123 | if (!count($obj_ret)) { |
124 | 124 | throw new RestException(404, 'No User found'); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } |
149 | 149 | |
150 | 150 | if (!DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user')) { |
151 | - throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); |
|
151 | + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | return $this->_cleanObjectDatas($this->useraccount); |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | if (!DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user')) { |
206 | - throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); |
|
206 | + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | foreach ($request_data as $field => $value) { |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | } |
245 | 245 | |
246 | 246 | if (!DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user')) { |
247 | - throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); |
|
247 | + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && !empty(DolibarrApiAccess::$user->admin) && empty(DolibarrApiAccess::$user->entity)) { |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | } |
281 | 281 | |
282 | 282 | if (!DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user')) { |
283 | - throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); |
|
283 | + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | return $this->useraccount->delete($id); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * \brief File of class to manage users |
35 | 35 | * \ingroup core |
36 | 36 | */ |
37 | -require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * Class to manage Dolibarr users |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | public $skype; |
74 | 74 | public $twitter; |
75 | 75 | public $facebook; |
76 | - public $job; // job position |
|
76 | + public $job; // job position |
|
77 | 77 | public $signature; |
78 | 78 | |
79 | 79 | /** |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | public $address; |
83 | 83 | public $zip; |
84 | 84 | public $town; |
85 | - public $state_id; // The state/department |
|
85 | + public $state_id; // The state/department |
|
86 | 86 | public $state_code; |
87 | 87 | public $state; |
88 | 88 | public $office_phone; |
@@ -136,26 +136,26 @@ discard block |
||
136 | 136 | public $datepreviouslogin; |
137 | 137 | public $photo; |
138 | 138 | public $lang; |
139 | - public $rights; // Array of permissions user->rights->permx |
|
140 | - public $all_permissions_are_loaded; // All permission are loaded |
|
141 | - public $nb_rights; // Number of rights granted to the user |
|
142 | - private $_tab_loaded = array(); // Cache array of already loaded permissions |
|
143 | - public $conf; // To store personal config |
|
144 | - public $default_values; // To store default values for user |
|
145 | - public $lastsearch_values_tmp; // To store current search criterias for user |
|
146 | - public $lastsearch_values; // To store last saved search criterias for user |
|
147 | - public $users = array(); // To store all tree of users hierarchy |
|
148 | - public $parentof; // To store an array of all parents for all ids. |
|
139 | + public $rights; // Array of permissions user->rights->permx |
|
140 | + public $all_permissions_are_loaded; // All permission are loaded |
|
141 | + public $nb_rights; // Number of rights granted to the user |
|
142 | + private $_tab_loaded = array(); // Cache array of already loaded permissions |
|
143 | + public $conf; // To store personal config |
|
144 | + public $default_values; // To store default values for user |
|
145 | + public $lastsearch_values_tmp; // To store current search criterias for user |
|
146 | + public $lastsearch_values; // To store last saved search criterias for user |
|
147 | + public $users = array(); // To store all tree of users hierarchy |
|
148 | + public $parentof; // To store an array of all parents for all ids. |
|
149 | 149 | private $cache_childids; |
150 | - public $accountancy_code; // Accountancy code in prevision of the complete accountancy module |
|
151 | - public $thm; // Average cost of employee - Used for valuation of time spent |
|
152 | - public $tjm; // Average cost of employee |
|
153 | - public $salary; // Monthly salary - Denormalized value from llx_user_employment |
|
154 | - public $salaryextra; // Monthly salary extra - Denormalized value from llx_user_employment |
|
155 | - public $weeklyhours; // Weekly hours - Denormalized value from llx_user_employment |
|
156 | - public $color; // Define background color for user in agenda |
|
157 | - public $dateemployment; // Define date of employment by company |
|
158 | - public $dateemploymentend; // Define date of employment end by company |
|
150 | + public $accountancy_code; // Accountancy code in prevision of the complete accountancy module |
|
151 | + public $thm; // Average cost of employee - Used for valuation of time spent |
|
152 | + public $tjm; // Average cost of employee |
|
153 | + public $salary; // Monthly salary - Denormalized value from llx_user_employment |
|
154 | + public $salaryextra; // Monthly salary extra - Denormalized value from llx_user_employment |
|
155 | + public $weeklyhours; // Weekly hours - Denormalized value from llx_user_employment |
|
156 | + public $color; // Define background color for user in agenda |
|
157 | + public $dateemployment; // Define date of employment by company |
|
158 | + public $dateemploymentend; // Define date of employment end by company |
|
159 | 159 | public $default_c_exp_tax_cat; |
160 | 160 | public $default_range; |
161 | 161 | public $fields = array( |
@@ -233,35 +233,35 @@ discard block |
||
233 | 233 | $sql .= " u.color,"; |
234 | 234 | $sql .= " u.dateemployment, u.dateemploymentend,"; |
235 | 235 | $sql .= " u.ref_int, u.ref_ext,"; |
236 | - $sql .= " u.default_range, u.default_c_exp_tax_cat,"; // Expense report default mode |
|
236 | + $sql .= " u.default_range, u.default_c_exp_tax_cat,"; // Expense report default mode |
|
237 | 237 | $sql .= " c.code as country_code, c.label as country,"; |
238 | 238 | $sql .= " d.code_departement as state_code, d.nom as state"; |
239 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user as u"; |
|
240 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as c ON u.fk_country = c.rowid"; |
|
241 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_departements as d ON u.fk_state = d.rowid"; |
|
239 | + $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; |
|
240 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON u.fk_country = c.rowid"; |
|
241 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d ON u.fk_state = d.rowid"; |
|
242 | 242 | |
243 | 243 | if ($entity < 0) { |
244 | 244 | if ((empty($conf->multicompany->enabled) || empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) && (!empty($user->entity))) { |
245 | - $sql .= " WHERE u.entity IN (0," . $conf->entity . ")"; |
|
245 | + $sql .= " WHERE u.entity IN (0,".$conf->entity.")"; |
|
246 | 246 | } else { |
247 | - $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database |
|
247 | + $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database |
|
248 | 248 | } |
249 | 249 | } else { // The fetch was forced on an entity |
250 | 250 | if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { |
251 | - $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database |
|
251 | + $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database |
|
252 | 252 | } else { |
253 | - $sql .= " WHERE u.entity IN (0, " . (($entity != '' && $entity >= 0) ? $entity : $conf->entity) . ")"; // search in entity provided in parameter |
|
253 | + $sql .= " WHERE u.entity IN (0, ".(($entity != '' && $entity >= 0) ? $entity : $conf->entity).")"; // search in entity provided in parameter |
|
254 | 254 | } |
255 | 255 | } |
256 | 256 | |
257 | 257 | if ($sid) { // permet une recherche du user par son SID ActiveDirectory ou Samba |
258 | - $sql .= " AND (u.ldap_sid = '" . $this->db->escape($sid) . "' OR u.login = '" . $this->db->escape($login) . "') LIMIT 1"; |
|
258 | + $sql .= " AND (u.ldap_sid = '".$this->db->escape($sid)."' OR u.login = '".$this->db->escape($login)."') LIMIT 1"; |
|
259 | 259 | } else if ($login) { |
260 | - $sql .= " AND u.login = '" . $this->db->escape($login) . "'"; |
|
260 | + $sql .= " AND u.login = '".$this->db->escape($login)."'"; |
|
261 | 261 | } else { |
262 | - $sql .= " AND u.rowid = " . $id; |
|
262 | + $sql .= " AND u.rowid = ".$id; |
|
263 | 263 | } |
264 | - $sql .= " ORDER BY u.entity ASC"; // Avoid random result when there is 2 login in 2 different entities |
|
264 | + $sql .= " ORDER BY u.entity ASC"; // Avoid random result when there is 2 login in 2 different entities |
|
265 | 265 | |
266 | 266 | $result = $this->db->query($sql); |
267 | 267 | if ($result) { |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | $this->datelastlogin = $this->db->jdate($obj->datel); |
332 | 332 | $this->datepreviouslogin = $this->db->jdate($obj->datep); |
333 | 333 | |
334 | - $this->societe_id = $obj->fk_soc; // deprecated |
|
334 | + $this->societe_id = $obj->fk_soc; // deprecated |
|
335 | 335 | $this->contact_id = $obj->fk_socpeople; // deprecated |
336 | 336 | $this->socid = $obj->fk_soc; |
337 | 337 | $this->contactid = $obj->fk_socpeople; |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $this->db->free($result); |
355 | 355 | } else { |
356 | 356 | $this->error = "USERNOTFOUND"; |
357 | - dol_syslog(get_class($this) . "::fetch user not found", LOG_DEBUG); |
|
357 | + dol_syslog(get_class($this)."::fetch user not found", LOG_DEBUG); |
|
358 | 358 | |
359 | 359 | $this->db->free($result); |
360 | 360 | return 0; |
@@ -367,9 +367,9 @@ discard block |
||
367 | 367 | // To get back the global configuration unique to the user |
368 | 368 | if ($loadpersonalconf) { |
369 | 369 | // Load user->conf for user |
370 | - $sql = "SELECT param, value FROM " . MAIN_DB_PREFIX . "user_param"; |
|
371 | - $sql .= " WHERE fk_user = " . $this->id; |
|
372 | - $sql .= " AND entity = " . $conf->entity; |
|
370 | + $sql = "SELECT param, value FROM ".MAIN_DB_PREFIX."user_param"; |
|
371 | + $sql .= " WHERE fk_user = ".$this->id; |
|
372 | + $sql .= " AND entity = ".$conf->entity; |
|
373 | 373 | //dol_syslog(get_class($this).'::fetch load personalized conf', LOG_DEBUG); |
374 | 374 | $resql = $this->db->query($sql); |
375 | 375 | if ($resql) { |
@@ -411,9 +411,9 @@ discard block |
||
411 | 411 | |
412 | 412 | // Load user->default_values for user. TODO Save this in memcached ? |
413 | 413 | $sql = "SELECT rowid, entity, type, page, param, value"; |
414 | - $sql .= " FROM " . MAIN_DB_PREFIX . "default_values"; |
|
415 | - $sql .= " WHERE entity IN (" . ($this->entity > 0 ? $this->entity . ", " : "") . $conf->entity . ")"; // Entity of user (if defined) + current entity |
|
416 | - $sql .= " AND user_id IN (0" . ($this->id > 0 ? ", " . $this->id : "") . ")"; // User 0 (all) + me (if defined) |
|
414 | + $sql .= " FROM ".MAIN_DB_PREFIX."default_values"; |
|
415 | + $sql .= " WHERE entity IN (".($this->entity > 0 ? $this->entity.", " : "").$conf->entity.")"; // Entity of user (if defined) + current entity |
|
416 | + $sql .= " AND user_id IN (0".($this->id > 0 ? ", ".$this->id : "").")"; // User 0 (all) + me (if defined) |
|
417 | 417 | $resql = $this->db->query($sql); |
418 | 418 | if ($resql) { |
419 | 419 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | |
466 | 466 | $entity = (!empty($entity) ? $entity : $conf->entity); |
467 | 467 | |
468 | - dol_syslog(get_class($this) . "::addrights $rid, $allmodule, $allperms, $entity"); |
|
468 | + dol_syslog(get_class($this)."::addrights $rid, $allmodule, $allperms, $entity"); |
|
469 | 469 | $error = 0; |
470 | 470 | $whereforadd = ''; |
471 | 471 | |
@@ -475,9 +475,9 @@ discard block |
||
475 | 475 | // Si on a demande ajout d'un droit en particulier, on recupere |
476 | 476 | // les caracteristiques (module, perms et subperms) de ce droit. |
477 | 477 | $sql = "SELECT module, perms, subperms"; |
478 | - $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def"; |
|
479 | - $sql .= " WHERE id = '" . $this->db->escape($rid) . "'"; |
|
480 | - $sql .= " AND entity = " . $entity; |
|
478 | + $sql .= " FROM ".MAIN_DB_PREFIX."rights_def"; |
|
479 | + $sql .= " WHERE id = '".$this->db->escape($rid)."'"; |
|
480 | + $sql .= " AND entity = ".$entity; |
|
481 | 481 | |
482 | 482 | $result = $this->db->query($sql); |
483 | 483 | if ($result) { |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | } |
492 | 492 | |
493 | 493 | // Where pour la liste des droits a ajouter |
494 | - $whereforadd = "id=" . $this->db->escape($rid); |
|
494 | + $whereforadd = "id=".$this->db->escape($rid); |
|
495 | 495 | // Ajout des droits induits |
496 | 496 | if (!empty($subperms)) { |
497 | 497 | $whereforadd .= " OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))"; |
@@ -508,9 +508,9 @@ discard block |
||
508 | 508 | if ($allmodule == 'allmodules') { |
509 | 509 | $whereforadd = 'allmodules'; |
510 | 510 | } else { |
511 | - $whereforadd = "module='" . $this->db->escape($allmodule) . "'"; |
|
511 | + $whereforadd = "module='".$this->db->escape($allmodule)."'"; |
|
512 | 512 | if (!empty($allperms)) { |
513 | - $whereforadd .= " AND perms='" . $this->db->escape($allperms) . "'"; |
|
513 | + $whereforadd .= " AND perms='".$this->db->escape($allperms)."'"; |
|
514 | 514 | } |
515 | 515 | } |
516 | 516 | } |
@@ -520,10 +520,10 @@ discard block |
||
520 | 520 | if (!empty($whereforadd)) { |
521 | 521 | //print "$module-$perms-$subperms"; |
522 | 522 | $sql = "SELECT id"; |
523 | - $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def"; |
|
524 | - $sql .= " WHERE entity = " . $entity; |
|
523 | + $sql .= " FROM ".MAIN_DB_PREFIX."rights_def"; |
|
524 | + $sql .= " WHERE entity = ".$entity; |
|
525 | 525 | if (!empty($whereforadd) && $whereforadd != 'allmodules') { |
526 | - $sql .= " AND " . $whereforadd; |
|
526 | + $sql .= " AND ".$whereforadd; |
|
527 | 527 | } |
528 | 528 | |
529 | 529 | $result = $this->db->query($sql); |
@@ -534,10 +534,10 @@ discard block |
||
534 | 534 | $obj = $this->db->fetch_object($result); |
535 | 535 | $nid = $obj->id; |
536 | 536 | |
537 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_rights WHERE fk_user = " . $this->id . " AND fk_id=" . $nid . " AND entity = " . $entity; |
|
537 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_rights WHERE fk_user = ".$this->id." AND fk_id=".$nid." AND entity = ".$entity; |
|
538 | 538 | if (!$this->db->query($sql)) |
539 | 539 | $error++; |
540 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "user_rights (entity, fk_user, fk_id) VALUES (" . $entity . ", " . $this->id . ", " . $nid . ")"; |
|
540 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."user_rights (entity, fk_user, fk_id) VALUES (".$entity.", ".$this->id.", ".$nid.")"; |
|
541 | 541 | if (!$this->db->query($sql)) |
542 | 542 | $error++; |
543 | 543 | |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | |
553 | 553 | if (!$error && !$notrigger) { |
554 | 554 | $langs->load("other"); |
555 | - $this->context = array('audit' => $langs->trans("PermissionsAdd") . ($rid ? ' (id=' . $rid . ')' : '')); |
|
555 | + $this->context = array('audit' => $langs->trans("PermissionsAdd").($rid ? ' (id='.$rid.')' : '')); |
|
556 | 556 | |
557 | 557 | // Call trigger |
558 | 558 | $result = $this->call_trigger('USER_MODIFY', $user); |
@@ -596,9 +596,9 @@ discard block |
||
596 | 596 | // Si on a demande supression d'un droit en particulier, on recupere |
597 | 597 | // les caracteristiques module, perms et subperms de ce droit. |
598 | 598 | $sql = "SELECT module, perms, subperms"; |
599 | - $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def"; |
|
600 | - $sql .= " WHERE id = '" . $this->db->escape($rid) . "'"; |
|
601 | - $sql .= " AND entity = " . $entity; |
|
599 | + $sql .= " FROM ".MAIN_DB_PREFIX."rights_def"; |
|
600 | + $sql .= " WHERE id = '".$this->db->escape($rid)."'"; |
|
601 | + $sql .= " AND entity = ".$entity; |
|
602 | 602 | |
603 | 603 | $result = $this->db->query($sql); |
604 | 604 | if ($result) { |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | } |
613 | 613 | |
614 | 614 | // Where pour la liste des droits a supprimer |
615 | - $wherefordel = "id=" . $this->db->escape($rid); |
|
615 | + $wherefordel = "id=".$this->db->escape($rid); |
|
616 | 616 | // Suppression des droits induits |
617 | 617 | if ($subperms == 'lire' || $subperms == 'read') { |
618 | 618 | $wherefordel .= " OR (module='$module' AND perms='$perms' AND subperms IS NOT NULL)"; |
@@ -627,9 +627,9 @@ discard block |
||
627 | 627 | if ($allmodule == 'allmodules') { |
628 | 628 | $wherefordel = 'allmodules'; |
629 | 629 | } else { |
630 | - $wherefordel = "module='" . $this->db->escape($allmodule) . "'"; |
|
630 | + $wherefordel = "module='".$this->db->escape($allmodule)."'"; |
|
631 | 631 | if (!empty($allperms)) { |
632 | - $whereforadd .= " AND perms='" . $this->db->escape($allperms) . "'"; |
|
632 | + $whereforadd .= " AND perms='".$this->db->escape($allperms)."'"; |
|
633 | 633 | } |
634 | 634 | } |
635 | 635 | } |
@@ -639,10 +639,10 @@ discard block |
||
639 | 639 | if (!empty($wherefordel)) { |
640 | 640 | //print "$module-$perms-$subperms"; |
641 | 641 | $sql = "SELECT id"; |
642 | - $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def"; |
|
643 | - $sql .= " WHERE entity = " . $entity; |
|
642 | + $sql .= " FROM ".MAIN_DB_PREFIX."rights_def"; |
|
643 | + $sql .= " WHERE entity = ".$entity; |
|
644 | 644 | if (!empty($wherefordel) && $wherefordel != 'allmodules') { |
645 | - $sql .= " AND " . $wherefordel; |
|
645 | + $sql .= " AND ".$wherefordel; |
|
646 | 646 | } |
647 | 647 | |
648 | 648 | $result = $this->db->query($sql); |
@@ -653,9 +653,9 @@ discard block |
||
653 | 653 | $obj = $this->db->fetch_object($result); |
654 | 654 | $nid = $obj->id; |
655 | 655 | |
656 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_rights"; |
|
657 | - $sql .= " WHERE fk_user = " . $this->id . " AND fk_id=" . $nid; |
|
658 | - $sql .= " AND entity = " . $entity; |
|
656 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_rights"; |
|
657 | + $sql .= " WHERE fk_user = ".$this->id." AND fk_id=".$nid; |
|
658 | + $sql .= " AND entity = ".$entity; |
|
659 | 659 | if (!$this->db->query($sql)) { |
660 | 660 | $error++; |
661 | 661 | } |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | |
671 | 671 | if (!$error && !$notrigger) { |
672 | 672 | $langs->load("other"); |
673 | - $this->context = array('audit' => $langs->trans("PermissionsDelete") . ($rid ? ' (id=' . $rid . ')' : '')); |
|
673 | + $this->context = array('audit' => $langs->trans("PermissionsDelete").($rid ? ' (id='.$rid.')' : '')); |
|
674 | 674 | |
675 | 675 | // Call trigger |
676 | 676 | $result = $this->call_trigger('USER_MODIFY', $user); |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | */ |
698 | 698 | function clearrights() |
699 | 699 | { |
700 | - dol_syslog(get_class($this) . "::clearrights reset user->rights"); |
|
700 | + dol_syslog(get_class($this)."::clearrights reset user->rights"); |
|
701 | 701 | $this->rights = ''; |
702 | 702 | $this->all_permissions_are_loaded = false; |
703 | 703 | $this->_tab_loaded = array(); |
@@ -730,18 +730,18 @@ discard block |
||
730 | 730 | // Recuperation des droits utilisateurs + recuperation des droits groupes |
731 | 731 | // D'abord les droits utilisateurs |
732 | 732 | $sql = "SELECT DISTINCT r.module, r.perms, r.subperms"; |
733 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user_rights as ur"; |
|
734 | - $sql .= ", " . MAIN_DB_PREFIX . "rights_def as r"; |
|
733 | + $sql .= " FROM ".MAIN_DB_PREFIX."user_rights as ur"; |
|
734 | + $sql .= ", ".MAIN_DB_PREFIX."rights_def as r"; |
|
735 | 735 | $sql .= " WHERE r.id = ur.fk_id"; |
736 | 736 | if (!empty($conf->global->MULTICOMPANY_BACKWARD_COMPATIBILITY)) { |
737 | - $sql .= " AND r.entity IN (0," . (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) ? "1," : "") . $conf->entity . ")"; |
|
737 | + $sql .= " AND r.entity IN (0,".(!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) ? "1," : "").$conf->entity.")"; |
|
738 | 738 | } else { |
739 | - $sql .= " AND ur.entity = " . $conf->entity; |
|
739 | + $sql .= " AND ur.entity = ".$conf->entity; |
|
740 | 740 | } |
741 | - $sql .= " AND ur.fk_user= " . $this->id; |
|
741 | + $sql .= " AND ur.fk_user= ".$this->id; |
|
742 | 742 | $sql .= " AND r.perms IS NOT NULL"; |
743 | 743 | if ($moduletag) { |
744 | - $sql .= " AND r.module = '" . $this->db->escape($moduletag) . "'"; |
|
744 | + $sql .= " AND r.module = '".$this->db->escape($moduletag)."'"; |
|
745 | 745 | } |
746 | 746 | |
747 | 747 | $resql = $this->db->query($sql); |
@@ -786,25 +786,25 @@ discard block |
||
786 | 786 | |
787 | 787 | // Maintenant les droits groupes |
788 | 788 | $sql = "SELECT DISTINCT r.module, r.perms, r.subperms"; |
789 | - $sql .= " FROM " . MAIN_DB_PREFIX . "usergroup_rights as gr,"; |
|
790 | - $sql .= " " . MAIN_DB_PREFIX . "usergroup_user as gu,"; |
|
791 | - $sql .= " " . MAIN_DB_PREFIX . "rights_def as r"; |
|
789 | + $sql .= " FROM ".MAIN_DB_PREFIX."usergroup_rights as gr,"; |
|
790 | + $sql .= " ".MAIN_DB_PREFIX."usergroup_user as gu,"; |
|
791 | + $sql .= " ".MAIN_DB_PREFIX."rights_def as r"; |
|
792 | 792 | $sql .= " WHERE r.id = gr.fk_id"; |
793 | 793 | if (!empty($conf->global->MULTICOMPANY_BACKWARD_COMPATIBILITY)) { |
794 | 794 | if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { |
795 | - $sql .= " AND gu.entity IN (0," . $conf->entity . ")"; |
|
795 | + $sql .= " AND gu.entity IN (0,".$conf->entity.")"; |
|
796 | 796 | } else { |
797 | - $sql .= " AND r.entity = " . $conf->entity; |
|
797 | + $sql .= " AND r.entity = ".$conf->entity; |
|
798 | 798 | } |
799 | 799 | } else { |
800 | - $sql .= " AND gr.entity = " . $conf->entity; |
|
801 | - $sql .= " AND r.entity = " . $conf->entity; |
|
800 | + $sql .= " AND gr.entity = ".$conf->entity; |
|
801 | + $sql .= " AND r.entity = ".$conf->entity; |
|
802 | 802 | } |
803 | 803 | $sql .= " AND gr.fk_usergroup = gu.fk_usergroup"; |
804 | - $sql .= " AND gu.fk_user = " . $this->id; |
|
804 | + $sql .= " AND gu.fk_user = ".$this->id; |
|
805 | 805 | $sql .= " AND r.perms IS NOT NULL"; |
806 | 806 | if ($moduletag) { |
807 | - $sql .= " AND r.module = '" . $this->db->escape($moduletag) . "'"; |
|
807 | + $sql .= " AND r.module = '".$this->db->escape($moduletag)."'"; |
|
808 | 808 | } |
809 | 809 | |
810 | 810 | $resql = $this->db->query($sql); |
@@ -888,12 +888,12 @@ discard block |
||
888 | 888 | $this->db->begin(); |
889 | 889 | |
890 | 890 | // Deactivate user |
891 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user"; |
|
892 | - $sql .= " SET statut = " . $this->statut; |
|
893 | - $sql .= " WHERE rowid = " . $this->id; |
|
891 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user"; |
|
892 | + $sql .= " SET statut = ".$this->statut; |
|
893 | + $sql .= " WHERE rowid = ".$this->id; |
|
894 | 894 | $result = $this->db->query($sql); |
895 | 895 | |
896 | - dol_syslog(get_class($this) . "::setstatus", LOG_DEBUG); |
|
896 | + dol_syslog(get_class($this)."::setstatus", LOG_DEBUG); |
|
897 | 897 | if ($result) { |
898 | 898 | // Call trigger |
899 | 899 | $result = $this->call_trigger('USER_ENABLEDISABLE', $user); |
@@ -930,7 +930,7 @@ discard block |
||
930 | 930 | } |
931 | 931 | |
932 | 932 | // Get current categories |
933 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
933 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
934 | 934 | $c = new Categorie($this->db); |
935 | 935 | $existing = $c->containing($this->id, Categorie::TYPE_USER, 'id'); |
936 | 936 | |
@@ -973,10 +973,10 @@ discard block |
||
973 | 973 | |
974 | 974 | $this->fetch($this->id); |
975 | 975 | |
976 | - dol_syslog(get_class($this) . "::delete", LOG_DEBUG); |
|
976 | + dol_syslog(get_class($this)."::delete", LOG_DEBUG); |
|
977 | 977 | |
978 | 978 | // Remove rights |
979 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_rights WHERE fk_user = " . $this->id; |
|
979 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_rights WHERE fk_user = ".$this->id; |
|
980 | 980 | |
981 | 981 | if (!$error && !$this->db->query($sql)) { |
982 | 982 | $error++; |
@@ -984,7 +984,7 @@ discard block |
||
984 | 984 | } |
985 | 985 | |
986 | 986 | // Remove group |
987 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "usergroup_user WHERE fk_user = " . $this->id; |
|
987 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."usergroup_user WHERE fk_user = ".$this->id; |
|
988 | 988 | if (!$error && !$this->db->query($sql)) { |
989 | 989 | $error++; |
990 | 990 | $this->error = $this->db->lasterror(); |
@@ -992,7 +992,7 @@ discard block |
||
992 | 992 | |
993 | 993 | // If contact, remove link |
994 | 994 | if ($this->contact_id) { |
995 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "socpeople SET fk_user_creat = null WHERE rowid = " . $this->contact_id; |
|
995 | + $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET fk_user_creat = null WHERE rowid = ".$this->contact_id; |
|
996 | 996 | if (!$error && !$this->db->query($sql)) { |
997 | 997 | $error++; |
998 | 998 | $this->error = $this->db->lasterror(); |
@@ -1004,14 +1004,14 @@ discard block |
||
1004 | 1004 | $result = $this->deleteExtraFields(); |
1005 | 1005 | if ($result < 0) { |
1006 | 1006 | $error++; |
1007 | - dol_syslog(get_class($this) . "::delete error -4 " . $this->error, LOG_ERR); |
|
1007 | + dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); |
|
1008 | 1008 | } |
1009 | 1009 | } |
1010 | 1010 | |
1011 | 1011 | // Remove user |
1012 | 1012 | if (!$error) { |
1013 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user WHERE rowid = " . $this->id; |
|
1014 | - dol_syslog(get_class($this) . "::delete", LOG_DEBUG); |
|
1013 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".$this->id; |
|
1014 | + dol_syslog(get_class($this)."::delete", LOG_DEBUG); |
|
1015 | 1015 | if (!$this->db->query($sql)) { |
1016 | 1016 | $error++; |
1017 | 1017 | $this->error = $this->db->lasterror(); |
@@ -1053,7 +1053,7 @@ discard block |
||
1053 | 1053 | if (!isset($this->entity)) { |
1054 | 1054 | $this->entity = $conf->entity; // If not defined, we use default value |
1055 | 1055 | } |
1056 | - dol_syslog(get_class($this) . "::create login=" . $this->login . ", user=" . (is_object($user) ? $user->id : ''), LOG_DEBUG); |
|
1056 | + dol_syslog(get_class($this)."::create login=".$this->login.", user=".(is_object($user) ? $user->id : ''), LOG_DEBUG); |
|
1057 | 1057 | |
1058 | 1058 | // Check parameters |
1059 | 1059 | if (!empty($conf->global->USER_MAIL_REQUIRED) && !isValidEMail($this->email)) { |
@@ -1072,11 +1072,11 @@ discard block |
||
1072 | 1072 | $error = 0; |
1073 | 1073 | $this->db->begin(); |
1074 | 1074 | |
1075 | - $sql = "SELECT login FROM " . MAIN_DB_PREFIX . "user"; |
|
1076 | - $sql .= " WHERE login ='" . $this->db->escape($this->login) . "'"; |
|
1077 | - $sql .= " AND entity IN (0," . $this->db->escape($conf->entity) . ")"; |
|
1075 | + $sql = "SELECT login FROM ".MAIN_DB_PREFIX."user"; |
|
1076 | + $sql .= " WHERE login ='".$this->db->escape($this->login)."'"; |
|
1077 | + $sql .= " AND entity IN (0,".$this->db->escape($conf->entity).")"; |
|
1078 | 1078 | |
1079 | - dol_syslog(get_class($this) . "::create", LOG_DEBUG); |
|
1079 | + dol_syslog(get_class($this)."::create", LOG_DEBUG); |
|
1080 | 1080 | $resql = $this->db->query($sql); |
1081 | 1081 | if ($resql) { |
1082 | 1082 | $num = $this->db->num_rows($resql); |
@@ -1084,17 +1084,17 @@ discard block |
||
1084 | 1084 | |
1085 | 1085 | if ($num) { |
1086 | 1086 | $this->error = 'ErrorLoginAlreadyExists'; |
1087 | - dol_syslog(get_class($this) . "::create " . $this->error, LOG_WARNING); |
|
1087 | + dol_syslog(get_class($this)."::create ".$this->error, LOG_WARNING); |
|
1088 | 1088 | $this->db->rollback(); |
1089 | 1089 | return -6; |
1090 | 1090 | } else { |
1091 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "user (datec,login,ldap_sid,entity)"; |
|
1092 | - $sql .= " VALUES('" . $this->db->idate($this->datec) . "','" . $this->db->escape($this->login) . "','" . $this->db->escape($this->ldap_sid) . "'," . $this->db->escape($this->entity) . ")"; |
|
1091 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."user (datec,login,ldap_sid,entity)"; |
|
1092 | + $sql .= " VALUES('".$this->db->idate($this->datec)."','".$this->db->escape($this->login)."','".$this->db->escape($this->ldap_sid)."',".$this->db->escape($this->entity).")"; |
|
1093 | 1093 | $result = $this->db->query($sql); |
1094 | 1094 | |
1095 | - dol_syslog(get_class($this) . "::create", LOG_DEBUG); |
|
1095 | + dol_syslog(get_class($this)."::create", LOG_DEBUG); |
|
1096 | 1096 | if ($result) { |
1097 | - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "user"); |
|
1097 | + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."user"); |
|
1098 | 1098 | |
1099 | 1099 | // Set default rights |
1100 | 1100 | if ($this->set_default_rights() < 0) { |
@@ -1111,7 +1111,7 @@ discard block |
||
1111 | 1111 | } |
1112 | 1112 | |
1113 | 1113 | if (!empty($conf->global->STOCK_USERSTOCK_AUTOCREATE)) { |
1114 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
1114 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
1115 | 1115 | $langs->load("stocks"); |
1116 | 1116 | $entrepot = new Entrepot($this->db); |
1117 | 1117 | $entrepot->libelle = $langs->trans("PersonalStock", $this->getFullName($langs)); |
@@ -1135,7 +1135,7 @@ discard block |
||
1135 | 1135 | return $this->id; |
1136 | 1136 | } else { |
1137 | 1137 | //$this->error=$interface->error; |
1138 | - dol_syslog(get_class($this) . "::create " . $this->error, LOG_ERR); |
|
1138 | + dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); |
|
1139 | 1139 | $this->db->rollback(); |
1140 | 1140 | return -3; |
1141 | 1141 | } |
@@ -1188,7 +1188,7 @@ discard block |
||
1188 | 1188 | $this->employee = 0; |
1189 | 1189 | |
1190 | 1190 | if (empty($login)) { |
1191 | - $login = strtolower(substr($contact->firstname, 0, 4)) . strtolower(substr($contact->lastname, 0, 4)); |
|
1191 | + $login = strtolower(substr($contact->firstname, 0, 4)).strtolower(substr($contact->lastname, 0, 4)); |
|
1192 | 1192 | } |
1193 | 1193 | $this->login = $login; |
1194 | 1194 | |
@@ -1197,15 +1197,15 @@ discard block |
||
1197 | 1197 | // Cree et positionne $this->id |
1198 | 1198 | $result = $this->create($user); |
1199 | 1199 | if ($result > 0) { |
1200 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user"; |
|
1201 | - $sql .= " SET fk_socpeople=" . $contact->id; |
|
1200 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user"; |
|
1201 | + $sql .= " SET fk_socpeople=".$contact->id; |
|
1202 | 1202 | if ($contact->socid) { |
1203 | - $sql .= ", fk_soc=" . $contact->socid; |
|
1203 | + $sql .= ", fk_soc=".$contact->socid; |
|
1204 | 1204 | } |
1205 | - $sql .= " WHERE rowid=" . $this->id; |
|
1205 | + $sql .= " WHERE rowid=".$this->id; |
|
1206 | 1206 | $resql = $this->db->query($sql); |
1207 | 1207 | |
1208 | - dol_syslog(get_class($this) . "::create_from_contact", LOG_DEBUG); |
|
1208 | + dol_syslog(get_class($this)."::create_from_contact", LOG_DEBUG); |
|
1209 | 1209 | if ($resql) { |
1210 | 1210 | $this->context['createfromcontact'] = 'createfromcontact'; |
1211 | 1211 | |
@@ -1228,7 +1228,7 @@ discard block |
||
1228 | 1228 | } |
1229 | 1229 | } else { |
1230 | 1230 | // $this->error deja positionne |
1231 | - dol_syslog(get_class($this) . "::create_from_contact - 0"); |
|
1231 | + dol_syslog(get_class($this)."::create_from_contact - 0"); |
|
1232 | 1232 | |
1233 | 1233 | $this->db->rollback(); |
1234 | 1234 | return $result; |
@@ -1263,7 +1263,7 @@ discard block |
||
1263 | 1263 | $this->country_id = $member->country_id; |
1264 | 1264 | |
1265 | 1265 | if (empty($login)) { |
1266 | - $login = strtolower(substr($member->firstname, 0, 4)) . strtolower(substr($member->lastname, 0, 4)); |
|
1266 | + $login = strtolower(substr($member->firstname, 0, 4)).strtolower(substr($member->lastname, 0, 4)); |
|
1267 | 1267 | } |
1268 | 1268 | $this->login = $login; |
1269 | 1269 | |
@@ -1278,11 +1278,11 @@ discard block |
||
1278 | 1278 | } |
1279 | 1279 | |
1280 | 1280 | if ($result > 0 && $member->fk_soc) { // If member is linked to a thirdparty |
1281 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user"; |
|
1282 | - $sql .= " SET fk_soc=" . $member->fk_soc; |
|
1283 | - $sql .= " WHERE rowid=" . $this->id; |
|
1281 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user"; |
|
1282 | + $sql .= " SET fk_soc=".$member->fk_soc; |
|
1283 | + $sql .= " WHERE rowid=".$this->id; |
|
1284 | 1284 | |
1285 | - dol_syslog(get_class($this) . "::create_from_member", LOG_DEBUG); |
|
1285 | + dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG); |
|
1286 | 1286 | $resql = $this->db->query($sql); |
1287 | 1287 | if ($resql) { |
1288 | 1288 | $this->db->commit(); |
@@ -1317,9 +1317,9 @@ discard block |
||
1317 | 1317 | // phpcs:enable |
1318 | 1318 | global $conf; |
1319 | 1319 | |
1320 | - $sql = "SELECT id FROM " . MAIN_DB_PREFIX . "rights_def"; |
|
1320 | + $sql = "SELECT id FROM ".MAIN_DB_PREFIX."rights_def"; |
|
1321 | 1321 | $sql .= " WHERE bydefault = 1"; |
1322 | - $sql .= " AND entity = " . $conf->entity; |
|
1322 | + $sql .= " AND entity = ".$conf->entity; |
|
1323 | 1323 | |
1324 | 1324 | $resql = $this->db->query($sql); |
1325 | 1325 | if ($resql) { |
@@ -1336,10 +1336,10 @@ discard block |
||
1336 | 1336 | $i = 0; |
1337 | 1337 | while ($i < $num) { |
1338 | 1338 | |
1339 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_rights WHERE fk_user = $this->id AND fk_id=$rd[$i]"; |
|
1339 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_rights WHERE fk_user = $this->id AND fk_id=$rd[$i]"; |
|
1340 | 1340 | $result = $this->db->query($sql); |
1341 | 1341 | |
1342 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "user_rights (fk_user, fk_id) VALUES ($this->id, $rd[$i])"; |
|
1342 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."user_rights (fk_user, fk_id) VALUES ($this->id, $rd[$i])"; |
|
1343 | 1343 | $result = $this->db->query($sql); |
1344 | 1344 | if (!$result) { |
1345 | 1345 | return -1; |
@@ -1367,7 +1367,7 @@ discard block |
||
1367 | 1367 | $nbrowsaffected = 0; |
1368 | 1368 | $error = 0; |
1369 | 1369 | |
1370 | - dol_syslog(get_class($this) . "::update notrigger=" . $notrigger . ", nosyncmember=" . $nosyncmember . ", nosyncmemberpass=" . $nosyncmemberpass); |
|
1370 | + dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncmember=".$nosyncmember.", nosyncmemberpass=".$nosyncmemberpass); |
|
1371 | 1371 | |
1372 | 1372 | // Clean parameters |
1373 | 1373 | $this->lastname = trim($this->lastname); |
@@ -1395,7 +1395,7 @@ discard block |
||
1395 | 1395 | $this->job = trim($this->job); |
1396 | 1396 | $this->signature = trim($this->signature); |
1397 | 1397 | $this->note = trim($this->note); |
1398 | - $this->openid = trim(empty($this->openid) ? '' : $this->openid); // Avoid warning |
|
1398 | + $this->openid = trim(empty($this->openid) ? '' : $this->openid); // Avoid warning |
|
1399 | 1399 | $this->admin = $this->admin ? $this->admin : 0; |
1400 | 1400 | $this->address = empty($this->address) ? '' : $this->address; |
1401 | 1401 | $this->zip = empty($this->zip) ? '' : $this->zip; |
@@ -1420,59 +1420,59 @@ discard block |
||
1420 | 1420 | $this->db->begin(); |
1421 | 1421 | |
1422 | 1422 | // Update datas |
1423 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user SET"; |
|
1424 | - $sql .= " lastname = '" . $this->db->escape($this->lastname) . "'"; |
|
1425 | - $sql .= ", firstname = '" . $this->db->escape($this->firstname) . "'"; |
|
1426 | - $sql .= ", employee = " . $this->employee; |
|
1427 | - $sql .= ", login = '" . $this->db->escape($this->login) . "'"; |
|
1428 | - $sql .= ", api_key = " . ($this->api_key ? "'" . $this->db->escape($this->api_key) . "'" : "null"); |
|
1429 | - $sql .= ", gender = " . ($this->gender != -1 ? "'" . $this->db->escape($this->gender) . "'" : "null"); // 'man' or 'woman' |
|
1430 | - $sql .= ", birth=" . (strval($this->birth) != '' ? "'" . $this->db->idate($this->birth) . "'" : 'null'); |
|
1423 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user SET"; |
|
1424 | + $sql .= " lastname = '".$this->db->escape($this->lastname)."'"; |
|
1425 | + $sql .= ", firstname = '".$this->db->escape($this->firstname)."'"; |
|
1426 | + $sql .= ", employee = ".$this->employee; |
|
1427 | + $sql .= ", login = '".$this->db->escape($this->login)."'"; |
|
1428 | + $sql .= ", api_key = ".($this->api_key ? "'".$this->db->escape($this->api_key)."'" : "null"); |
|
1429 | + $sql .= ", gender = ".($this->gender != -1 ? "'".$this->db->escape($this->gender)."'" : "null"); // 'man' or 'woman' |
|
1430 | + $sql .= ", birth=".(strval($this->birth) != '' ? "'".$this->db->idate($this->birth)."'" : 'null'); |
|
1431 | 1431 | if (!empty($user->admin)) { |
1432 | - $sql .= ", admin = " . $this->admin; // admin flag can be set/unset only by an admin user |
|
1433 | - } |
|
1434 | - $sql .= ", address = '" . $this->db->escape($this->address) . "'"; |
|
1435 | - $sql .= ", zip = '" . $this->db->escape($this->zip) . "'"; |
|
1436 | - $sql .= ", town = '" . $this->db->escape($this->town) . "'"; |
|
1437 | - $sql .= ", fk_state = " . ((!empty($this->state_id) && $this->state_id > 0) ? "'" . $this->db->escape($this->state_id) . "'" : "null"); |
|
1438 | - $sql .= ", fk_country = " . ((!empty($this->country_id) && $this->country_id > 0) ? "'" . $this->db->escape($this->country_id) . "'" : "null"); |
|
1439 | - $sql .= ", office_phone = '" . $this->db->escape($this->office_phone) . "'"; |
|
1440 | - $sql .= ", office_fax = '" . $this->db->escape($this->office_fax) . "'"; |
|
1441 | - $sql .= ", user_mobile = '" . $this->db->escape($this->user_mobile) . "'"; |
|
1442 | - $sql .= ", email = '" . $this->db->escape($this->email) . "'"; |
|
1443 | - $sql .= ", skype = '" . $this->db->escape($this->skype) . "'"; |
|
1444 | - $sql .= ", twitter = '" . $this->db->escape($this->twitter) . "'"; |
|
1445 | - $sql .= ", facebook = '" . $this->db->escape($this->facebook) . "'"; |
|
1446 | - $sql .= ", job = '" . $this->db->escape($this->job) . "'"; |
|
1447 | - $sql .= ", signature = '" . $this->db->escape($this->signature) . "'"; |
|
1448 | - $sql .= ", accountancy_code = '" . $this->db->escape($this->accountancy_code) . "'"; |
|
1449 | - $sql .= ", color = '" . $this->db->escape($this->color) . "'"; |
|
1450 | - $sql .= ", dateemployment=" . (strval($this->dateemployment) != '' ? "'" . $this->db->idate($this->dateemployment) . "'" : 'null'); |
|
1451 | - $sql .= ", dateemploymentend=" . (strval($this->dateemploymentend) != '' ? "'" . $this->db->idate($this->dateemploymentend) . "'" : 'null'); |
|
1452 | - $sql .= ", note = '" . $this->db->escape($this->note) . "'"; |
|
1453 | - $sql .= ", photo = " . ($this->photo ? "'" . $this->db->escape($this->photo) . "'" : "null"); |
|
1454 | - $sql .= ", openid = " . ($this->openid ? "'" . $this->db->escape($this->openid) . "'" : "null"); |
|
1455 | - $sql .= ", fk_user = " . ($this->fk_user > 0 ? "'" . $this->db->escape($this->fk_user) . "'" : "null"); |
|
1432 | + $sql .= ", admin = ".$this->admin; // admin flag can be set/unset only by an admin user |
|
1433 | + } |
|
1434 | + $sql .= ", address = '".$this->db->escape($this->address)."'"; |
|
1435 | + $sql .= ", zip = '".$this->db->escape($this->zip)."'"; |
|
1436 | + $sql .= ", town = '".$this->db->escape($this->town)."'"; |
|
1437 | + $sql .= ", fk_state = ".((!empty($this->state_id) && $this->state_id > 0) ? "'".$this->db->escape($this->state_id)."'" : "null"); |
|
1438 | + $sql .= ", fk_country = ".((!empty($this->country_id) && $this->country_id > 0) ? "'".$this->db->escape($this->country_id)."'" : "null"); |
|
1439 | + $sql .= ", office_phone = '".$this->db->escape($this->office_phone)."'"; |
|
1440 | + $sql .= ", office_fax = '".$this->db->escape($this->office_fax)."'"; |
|
1441 | + $sql .= ", user_mobile = '".$this->db->escape($this->user_mobile)."'"; |
|
1442 | + $sql .= ", email = '".$this->db->escape($this->email)."'"; |
|
1443 | + $sql .= ", skype = '".$this->db->escape($this->skype)."'"; |
|
1444 | + $sql .= ", twitter = '".$this->db->escape($this->twitter)."'"; |
|
1445 | + $sql .= ", facebook = '".$this->db->escape($this->facebook)."'"; |
|
1446 | + $sql .= ", job = '".$this->db->escape($this->job)."'"; |
|
1447 | + $sql .= ", signature = '".$this->db->escape($this->signature)."'"; |
|
1448 | + $sql .= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; |
|
1449 | + $sql .= ", color = '".$this->db->escape($this->color)."'"; |
|
1450 | + $sql .= ", dateemployment=".(strval($this->dateemployment) != '' ? "'".$this->db->idate($this->dateemployment)."'" : 'null'); |
|
1451 | + $sql .= ", dateemploymentend=".(strval($this->dateemploymentend) != '' ? "'".$this->db->idate($this->dateemploymentend)."'" : 'null'); |
|
1452 | + $sql .= ", note = '".$this->db->escape($this->note)."'"; |
|
1453 | + $sql .= ", photo = ".($this->photo ? "'".$this->db->escape($this->photo)."'" : "null"); |
|
1454 | + $sql .= ", openid = ".($this->openid ? "'".$this->db->escape($this->openid)."'" : "null"); |
|
1455 | + $sql .= ", fk_user = ".($this->fk_user > 0 ? "'".$this->db->escape($this->fk_user)."'" : "null"); |
|
1456 | 1456 | if (isset($this->thm) || $this->thm != '') { |
1457 | - $sql .= ", thm= " . ($this->thm != '' ? "'" . $this->db->escape($this->thm) . "'" : "null"); |
|
1457 | + $sql .= ", thm= ".($this->thm != '' ? "'".$this->db->escape($this->thm)."'" : "null"); |
|
1458 | 1458 | } |
1459 | 1459 | if (isset($this->tjm) || $this->tjm != '') { |
1460 | - $sql .= ", tjm= " . ($this->tjm != '' ? "'" . $this->db->escape($this->tjm) . "'" : "null"); |
|
1460 | + $sql .= ", tjm= ".($this->tjm != '' ? "'".$this->db->escape($this->tjm)."'" : "null"); |
|
1461 | 1461 | } |
1462 | 1462 | if (isset($this->salary) || $this->salary != '') { |
1463 | - $sql .= ", salary= " . ($this->salary != '' ? "'" . $this->db->escape($this->salary) . "'" : "null"); |
|
1463 | + $sql .= ", salary= ".($this->salary != '' ? "'".$this->db->escape($this->salary)."'" : "null"); |
|
1464 | 1464 | } |
1465 | 1465 | if (isset($this->salaryextra) || $this->salaryextra != '') { |
1466 | - $sql .= ", salaryextra= " . ($this->salaryextra != '' ? "'" . $this->db->escape($this->salaryextra) . "'" : "null"); |
|
1466 | + $sql .= ", salaryextra= ".($this->salaryextra != '' ? "'".$this->db->escape($this->salaryextra)."'" : "null"); |
|
1467 | 1467 | } |
1468 | - $sql .= ", weeklyhours= " . ($this->weeklyhours != '' ? "'" . $this->db->escape($this->weeklyhours) . "'" : "null"); |
|
1469 | - $sql .= ", entity = '" . $this->db->escape($this->entity) . "'"; |
|
1470 | - $sql .= ", default_range = " . ($this->default_range > 0 ? $this->default_range : 'null'); |
|
1471 | - $sql .= ", default_c_exp_tax_cat = " . ($this->default_c_exp_tax_cat > 0 ? $this->default_c_exp_tax_cat : 'null'); |
|
1468 | + $sql .= ", weeklyhours= ".($this->weeklyhours != '' ? "'".$this->db->escape($this->weeklyhours)."'" : "null"); |
|
1469 | + $sql .= ", entity = '".$this->db->escape($this->entity)."'"; |
|
1470 | + $sql .= ", default_range = ".($this->default_range > 0 ? $this->default_range : 'null'); |
|
1471 | + $sql .= ", default_c_exp_tax_cat = ".($this->default_c_exp_tax_cat > 0 ? $this->default_c_exp_tax_cat : 'null'); |
|
1472 | 1472 | |
1473 | - $sql .= " WHERE rowid = " . $this->id; |
|
1473 | + $sql .= " WHERE rowid = ".$this->id; |
|
1474 | 1474 | |
1475 | - dol_syslog(get_class($this) . "::update", LOG_DEBUG); |
|
1475 | + dol_syslog(get_class($this)."::update", LOG_DEBUG); |
|
1476 | 1476 | $resql = $this->db->query($sql); |
1477 | 1477 | if ($resql) { |
1478 | 1478 | $nbrowsaffected += $this->db->affected_rows($resql); |
@@ -1490,8 +1490,8 @@ discard block |
||
1490 | 1490 | |
1491 | 1491 | // If user is linked to a member, remove old link to this member |
1492 | 1492 | if ($this->fk_member > 0) { |
1493 | - dol_syslog(get_class($this) . "::update remove link with member. We will recreate it later", LOG_DEBUG); |
|
1494 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user SET fk_member = NULL where fk_member = " . $this->fk_member; |
|
1493 | + dol_syslog(get_class($this)."::update remove link with member. We will recreate it later", LOG_DEBUG); |
|
1494 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member = NULL where fk_member = ".$this->fk_member; |
|
1495 | 1495 | $resql = $this->db->query($sql); |
1496 | 1496 | if (!$resql) { |
1497 | 1497 | $this->error = $this->db->error(); |
@@ -1500,8 +1500,8 @@ discard block |
||
1500 | 1500 | } |
1501 | 1501 | } |
1502 | 1502 | // Set link to user |
1503 | - dol_syslog(get_class($this) . "::update set link with member", LOG_DEBUG); |
|
1504 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user SET fk_member =" . ($this->fk_member > 0 ? $this->fk_member : 'null') . " where rowid = " . $this->id; |
|
1503 | + dol_syslog(get_class($this)."::update set link with member", LOG_DEBUG); |
|
1504 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member =".($this->fk_member > 0 ? $this->fk_member : 'null')." where rowid = ".$this->id; |
|
1505 | 1505 | $resql = $this->db->query($sql); |
1506 | 1506 | if (!$resql) { |
1507 | 1507 | $this->error = $this->db->error(); |
@@ -1511,9 +1511,9 @@ discard block |
||
1511 | 1511 | |
1512 | 1512 | if ($nbrowsaffected) { // If something has changed in data |
1513 | 1513 | if ($this->fk_member > 0 && !$nosyncmember) { |
1514 | - dol_syslog(get_class($this) . "::update user is linked with a member. We try to update member too.", LOG_DEBUG); |
|
1514 | + dol_syslog(get_class($this)."::update user is linked with a member. We try to update member too.", LOG_DEBUG); |
|
1515 | 1515 | |
1516 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
1516 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
1517 | 1517 | |
1518 | 1518 | // This user is linked with a member, so we also update member information |
1519 | 1519 | // if this is an update. |
@@ -1553,7 +1553,7 @@ discard block |
||
1553 | 1553 | if ($result < 0) { |
1554 | 1554 | $this->error = $adh->error; |
1555 | 1555 | $this->errors = $adh->errors; |
1556 | - dol_syslog(get_class($this) . "::update error after calling adh->update to sync it with user: " . $this->error, LOG_ERR); |
|
1556 | + dol_syslog(get_class($this)."::update error after calling adh->update to sync it with user: ".$this->error, LOG_ERR); |
|
1557 | 1557 | $error++; |
1558 | 1558 | } |
1559 | 1559 | } else { |
@@ -1564,9 +1564,9 @@ discard block |
||
1564 | 1564 | } |
1565 | 1565 | |
1566 | 1566 | if ($this->contact_id > 0 && !$nosynccontact) { |
1567 | - dol_syslog(get_class($this) . "::update user is linked with a contact. We try to update contact too.", LOG_DEBUG); |
|
1567 | + dol_syslog(get_class($this)."::update user is linked with a contact. We try to update contact too.", LOG_DEBUG); |
|
1568 | 1568 | |
1569 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
1569 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
1570 | 1570 | |
1571 | 1571 | // This user is linked with a contact, so we also update contact information |
1572 | 1572 | // if this is an update. |
@@ -1606,7 +1606,7 @@ discard block |
||
1606 | 1606 | if ($result < 0) { |
1607 | 1607 | $this->error = $tmpobj->error; |
1608 | 1608 | $this->errors = $tmpobj->errors; |
1609 | - dol_syslog(get_class($this) . "::update error after calling adh->update to sync it with user: " . $this->error, LOG_ERR); |
|
1609 | + dol_syslog(get_class($this)."::update error after calling adh->update to sync it with user: ".$this->error, LOG_ERR); |
|
1610 | 1610 | $error++; |
1611 | 1611 | } |
1612 | 1612 | } else { |
@@ -1640,7 +1640,7 @@ discard block |
||
1640 | 1640 | $this->db->commit(); |
1641 | 1641 | return $nbrowsaffected; |
1642 | 1642 | } else { |
1643 | - dol_syslog(get_class($this) . "::update error=" . $this->error, LOG_ERR); |
|
1643 | + dol_syslog(get_class($this)."::update error=".$this->error, LOG_ERR); |
|
1644 | 1644 | $this->db->rollback(); |
1645 | 1645 | return -1; |
1646 | 1646 | } |
@@ -1663,20 +1663,20 @@ discard block |
||
1663 | 1663 | // phpcs:enable |
1664 | 1664 | $now = dol_now(); |
1665 | 1665 | |
1666 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user SET"; |
|
1666 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user SET"; |
|
1667 | 1667 | $sql .= " datepreviouslogin = datelastlogin,"; |
1668 | - $sql .= " datelastlogin = '" . $this->db->idate($now) . "',"; |
|
1669 | - $sql .= " tms = tms"; // La date de derniere modif doit changer sauf pour la mise a jour de date de derniere connexion |
|
1670 | - $sql .= " WHERE rowid = " . $this->id; |
|
1668 | + $sql .= " datelastlogin = '".$this->db->idate($now)."',"; |
|
1669 | + $sql .= " tms = tms"; // La date de derniere modif doit changer sauf pour la mise a jour de date de derniere connexion |
|
1670 | + $sql .= " WHERE rowid = ".$this->id; |
|
1671 | 1671 | |
1672 | - dol_syslog(get_class($this) . "::update_last_login_date user->id=" . $this->id . " " . $sql, LOG_DEBUG); |
|
1672 | + dol_syslog(get_class($this)."::update_last_login_date user->id=".$this->id." ".$sql, LOG_DEBUG); |
|
1673 | 1673 | $resql = $this->db->query($sql); |
1674 | 1674 | if ($resql) { |
1675 | 1675 | $this->datepreviouslogin = $this->datelastlogin; |
1676 | 1676 | $this->datelastlogin = $now; |
1677 | 1677 | return 1; |
1678 | 1678 | } else { |
1679 | - $this->error = $this->db->lasterror() . ' sql=' . $sql; |
|
1679 | + $this->error = $this->db->lasterror().' sql='.$sql; |
|
1680 | 1680 | return -1; |
1681 | 1681 | } |
1682 | 1682 | } |
@@ -1694,11 +1694,11 @@ discard block |
||
1694 | 1694 | function setPassword($user, $password = '', $changelater = 0, $notrigger = 0, $nosyncmember = 0) |
1695 | 1695 | { |
1696 | 1696 | global $conf, $langs; |
1697 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php'; |
|
1697 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; |
|
1698 | 1698 | |
1699 | 1699 | $error = 0; |
1700 | 1700 | |
1701 | - dol_syslog(get_class($this) . "::setPassword user=" . $user->id . " password=" . preg_replace('/./i', '*', $password) . " changelater=" . $changelater . " notrigger=" . $notrigger . " nosyncmember=" . $nosyncmember, LOG_DEBUG); |
|
1701 | + dol_syslog(get_class($this)."::setPassword user=".$user->id." password=".preg_replace('/./i', '*', $password)." changelater=".$changelater." notrigger=".$notrigger." nosyncmember=".$nosyncmember, LOG_DEBUG); |
|
1702 | 1702 | |
1703 | 1703 | // If new password not provided, we generate one |
1704 | 1704 | if (!$password) { |
@@ -1716,17 +1716,17 @@ discard block |
||
1716 | 1716 | |
1717 | 1717 | $this->db->begin(); |
1718 | 1718 | |
1719 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user"; |
|
1720 | - $sql .= " SET pass_crypted = '" . $this->db->escape($password_crypted) . "',"; |
|
1719 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user"; |
|
1720 | + $sql .= " SET pass_crypted = '".$this->db->escape($password_crypted)."',"; |
|
1721 | 1721 | $sql .= " pass_temp = null"; |
1722 | 1722 | if (!empty($conf->global->DATABASE_PWD_ENCRYPTED)) { |
1723 | 1723 | $sql .= ", pass = null"; |
1724 | 1724 | } else { |
1725 | - $sql .= ", pass = '" . $this->db->escape($password) . "'"; |
|
1725 | + $sql .= ", pass = '".$this->db->escape($password)."'"; |
|
1726 | 1726 | } |
1727 | - $sql .= " WHERE rowid = " . $this->id; |
|
1727 | + $sql .= " WHERE rowid = ".$this->id; |
|
1728 | 1728 | |
1729 | - dol_syslog(get_class($this) . "::setPassword", LOG_DEBUG); |
|
1729 | + dol_syslog(get_class($this)."::setPassword", LOG_DEBUG); |
|
1730 | 1730 | $result = $this->db->query($sql); |
1731 | 1731 | if ($result) { |
1732 | 1732 | if ($this->db->affected_rows($result)) { |
@@ -1735,7 +1735,7 @@ discard block |
||
1735 | 1735 | $this->pass_indatabase_crypted = $password_crypted; |
1736 | 1736 | |
1737 | 1737 | if ($this->fk_member && !$nosyncmember) { |
1738 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
1738 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
1739 | 1739 | |
1740 | 1740 | // This user is linked with a member, so we also update members informations |
1741 | 1741 | // if this is an update. |
@@ -1746,7 +1746,7 @@ discard block |
||
1746 | 1746 | $result = $adh->setPassword($user, $this->pass, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1); // Cryptage non gere dans module adherent |
1747 | 1747 | if ($result < 0) { |
1748 | 1748 | $this->error = $adh->error; |
1749 | - dol_syslog(get_class($this) . "::setPassword " . $this->error, LOG_ERR); |
|
1749 | + dol_syslog(get_class($this)."::setPassword ".$this->error, LOG_ERR); |
|
1750 | 1750 | $error++; |
1751 | 1751 | } |
1752 | 1752 | } else { |
@@ -1755,7 +1755,7 @@ discard block |
||
1755 | 1755 | } |
1756 | 1756 | } |
1757 | 1757 | |
1758 | - dol_syslog(get_class($this) . "::setPassword notrigger=" . $notrigger . " error=" . $error, LOG_DEBUG); |
|
1758 | + dol_syslog(get_class($this)."::setPassword notrigger=".$notrigger." error=".$error, LOG_DEBUG); |
|
1759 | 1759 | |
1760 | 1760 | if (!$error && !$notrigger) { |
1761 | 1761 | // Call trigger |
@@ -1782,11 +1782,11 @@ discard block |
||
1782 | 1782 | } else { |
1783 | 1783 | // We store clear password in password temporary field. |
1784 | 1784 | // After receiving confirmation link, we will crypt it and store it in pass_crypted |
1785 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user"; |
|
1786 | - $sql .= " SET pass_temp = '" . $this->db->escape($password) . "'"; |
|
1787 | - $sql .= " WHERE rowid = " . $this->id; |
|
1785 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user"; |
|
1786 | + $sql .= " SET pass_temp = '".$this->db->escape($password)."'"; |
|
1787 | + $sql .= " WHERE rowid = ".$this->id; |
|
1788 | 1788 | |
1789 | - dol_syslog(get_class($this) . "::setPassword", LOG_DEBUG); // No log |
|
1789 | + dol_syslog(get_class($this)."::setPassword", LOG_DEBUG); // No log |
|
1790 | 1790 | $result = $this->db->query($sql); |
1791 | 1791 | if ($result) { |
1792 | 1792 | return $password; |
@@ -1812,7 +1812,7 @@ discard block |
||
1812 | 1812 | global $conf, $langs; |
1813 | 1813 | global $dolibarr_main_url_root; |
1814 | 1814 | |
1815 | - require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; |
|
1815 | + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; |
|
1816 | 1816 | |
1817 | 1817 | $msgishtml = 0; |
1818 | 1818 | |
@@ -1837,36 +1837,36 @@ discard block |
||
1837 | 1837 | $subject = $outputlangs->transnoentitiesnoconv("SubjectNewPassword", $appli); |
1838 | 1838 | |
1839 | 1839 | // Define $urlwithroot |
1840 | - $urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root)); |
|
1841 | - $urlwithroot = $urlwithouturlroot . DOL_URL_ROOT; // This is to use external domain name found into config file |
|
1840 | + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); |
|
1841 | + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file |
|
1842 | 1842 | |
1843 | 1843 | if (!$changelater) { |
1844 | - $url = $urlwithroot . '/'; |
|
1844 | + $url = $urlwithroot.'/'; |
|
1845 | 1845 | |
1846 | - $mesg .= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived") . ".\n"; |
|
1847 | - $mesg .= $outputlangs->transnoentitiesnoconv("NewKeyIs") . " :\n\n"; |
|
1848 | - $mesg .= $outputlangs->transnoentitiesnoconv("Login") . " = " . $this->login . "\n"; |
|
1849 | - $mesg .= $outputlangs->transnoentitiesnoconv("Password") . " = " . $password . "\n\n"; |
|
1846 | + $mesg .= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived").".\n"; |
|
1847 | + $mesg .= $outputlangs->transnoentitiesnoconv("NewKeyIs")." :\n\n"; |
|
1848 | + $mesg .= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n"; |
|
1849 | + $mesg .= $outputlangs->transnoentitiesnoconv("Password")." = ".$password."\n\n"; |
|
1850 | 1850 | $mesg .= "\n"; |
1851 | 1851 | |
1852 | - $mesg .= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $appli) . ': ' . $url . "\n\n"; |
|
1852 | + $mesg .= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $appli).': '.$url."\n\n"; |
|
1853 | 1853 | $mesg .= "--\n"; |
1854 | 1854 | $mesg .= $user->getFullName($outputlangs); // Username that make then sending |
1855 | 1855 | |
1856 | - dol_syslog(get_class($this) . "::send_password changelater is off, url=" . $url); |
|
1856 | + dol_syslog(get_class($this)."::send_password changelater is off, url=".$url); |
|
1857 | 1857 | } else { |
1858 | - $url = $urlwithroot . '/user/passwordforgotten.php?action=validatenewpassword&username=' . $this->login . "&passwordhash=" . dol_hash($password); |
|
1858 | + $url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordhash=".dol_hash($password); |
|
1859 | 1859 | |
1860 | - $mesg .= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived") . "\n"; |
|
1861 | - $mesg .= $outputlangs->transnoentitiesnoconv("NewKeyWillBe") . " :\n\n"; |
|
1862 | - $mesg .= $outputlangs->transnoentitiesnoconv("Login") . " = " . $this->login . "\n"; |
|
1863 | - $mesg .= $outputlangs->transnoentitiesnoconv("Password") . " = " . $password . "\n\n"; |
|
1860 | + $mesg .= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived")."\n"; |
|
1861 | + $mesg .= $outputlangs->transnoentitiesnoconv("NewKeyWillBe")." :\n\n"; |
|
1862 | + $mesg .= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n"; |
|
1863 | + $mesg .= $outputlangs->transnoentitiesnoconv("Password")." = ".$password."\n\n"; |
|
1864 | 1864 | $mesg .= "\n"; |
1865 | - $mesg .= $outputlangs->transnoentitiesnoconv("YouMustClickToChange") . " :\n"; |
|
1866 | - $mesg .= $url . "\n\n"; |
|
1867 | - $mesg .= $outputlangs->transnoentitiesnoconv("ForgetIfNothing") . "\n\n"; |
|
1865 | + $mesg .= $outputlangs->transnoentitiesnoconv("YouMustClickToChange")." :\n"; |
|
1866 | + $mesg .= $url."\n\n"; |
|
1867 | + $mesg .= $outputlangs->transnoentitiesnoconv("ForgetIfNothing")."\n\n"; |
|
1868 | 1868 | |
1869 | - dol_syslog(get_class($this) . "::send_password changelater is on, url=" . $url); |
|
1869 | + dol_syslog(get_class($this)."::send_password changelater is on, url=".$url); |
|
1870 | 1870 | } |
1871 | 1871 | |
1872 | 1872 | $mailfile = new CMailFile( |
@@ -1877,7 +1877,7 @@ discard block |
||
1877 | 1877 | return 1; |
1878 | 1878 | } else { |
1879 | 1879 | $langs->trans("errors"); |
1880 | - $this->error = $langs->trans("ErrorFailedToSendPassword") . ' ' . $mailfile->error; |
|
1880 | + $this->error = $langs->trans("ErrorFailedToSendPassword").' '.$mailfile->error; |
|
1881 | 1881 | return -1; |
1882 | 1882 | } |
1883 | 1883 | } |
@@ -1902,8 +1902,8 @@ discard block |
||
1902 | 1902 | { |
1903 | 1903 | // phpcs:enable |
1904 | 1904 | $sql = "SELECT url, login, pass, poste "; |
1905 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user_clicktodial as u"; |
|
1906 | - $sql .= " WHERE u.fk_user = " . $this->id; |
|
1905 | + $sql .= " FROM ".MAIN_DB_PREFIX."user_clicktodial as u"; |
|
1906 | + $sql .= " WHERE u.fk_user = ".$this->id; |
|
1907 | 1907 | |
1908 | 1908 | $resql = $this->db->query($sql); |
1909 | 1909 | if ($resql) { |
@@ -1937,21 +1937,21 @@ discard block |
||
1937 | 1937 | // phpcs:enable |
1938 | 1938 | $this->db->begin(); |
1939 | 1939 | |
1940 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_clicktodial"; |
|
1941 | - $sql .= " WHERE fk_user = " . $this->id; |
|
1940 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_clicktodial"; |
|
1941 | + $sql .= " WHERE fk_user = ".$this->id; |
|
1942 | 1942 | |
1943 | - dol_syslog(get_class($this) . '::update_clicktodial', LOG_DEBUG); |
|
1943 | + dol_syslog(get_class($this).'::update_clicktodial', LOG_DEBUG); |
|
1944 | 1944 | $result = $this->db->query($sql); |
1945 | 1945 | |
1946 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "user_clicktodial"; |
|
1946 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."user_clicktodial"; |
|
1947 | 1947 | $sql .= " (fk_user,url,login,pass,poste)"; |
1948 | - $sql .= " VALUES (" . $this->id; |
|
1949 | - $sql .= ", '" . $this->db->escape($this->clicktodial_url) . "'"; |
|
1950 | - $sql .= ", '" . $this->db->escape($this->clicktodial_login) . "'"; |
|
1951 | - $sql .= ", '" . $this->db->escape($this->clicktodial_password) . "'"; |
|
1952 | - $sql .= ", '" . $this->db->escape($this->clicktodial_poste) . "')"; |
|
1948 | + $sql .= " VALUES (".$this->id; |
|
1949 | + $sql .= ", '".$this->db->escape($this->clicktodial_url)."'"; |
|
1950 | + $sql .= ", '".$this->db->escape($this->clicktodial_login)."'"; |
|
1951 | + $sql .= ", '".$this->db->escape($this->clicktodial_password)."'"; |
|
1952 | + $sql .= ", '".$this->db->escape($this->clicktodial_poste)."')"; |
|
1953 | 1953 | |
1954 | - dol_syslog(get_class($this) . '::update_clicktodial', LOG_DEBUG); |
|
1954 | + dol_syslog(get_class($this).'::update_clicktodial', LOG_DEBUG); |
|
1955 | 1955 | $result = $this->db->query($sql); |
1956 | 1956 | if ($result) { |
1957 | 1957 | $this->db->commit(); |
@@ -1981,20 +1981,20 @@ discard block |
||
1981 | 1981 | |
1982 | 1982 | $this->db->begin(); |
1983 | 1983 | |
1984 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "usergroup_user"; |
|
1985 | - $sql .= " WHERE fk_user = " . $this->id; |
|
1986 | - $sql .= " AND fk_usergroup = " . $group; |
|
1987 | - $sql .= " AND entity = " . $entity; |
|
1984 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."usergroup_user"; |
|
1985 | + $sql .= " WHERE fk_user = ".$this->id; |
|
1986 | + $sql .= " AND fk_usergroup = ".$group; |
|
1987 | + $sql .= " AND entity = ".$entity; |
|
1988 | 1988 | |
1989 | 1989 | $result = $this->db->query($sql); |
1990 | 1990 | |
1991 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "usergroup_user (entity, fk_user, fk_usergroup)"; |
|
1992 | - $sql .= " VALUES (" . $entity . "," . $this->id . "," . $group . ")"; |
|
1991 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."usergroup_user (entity, fk_user, fk_usergroup)"; |
|
1992 | + $sql .= " VALUES (".$entity.",".$this->id.",".$group.")"; |
|
1993 | 1993 | |
1994 | 1994 | $result = $this->db->query($sql); |
1995 | 1995 | if ($result) { |
1996 | 1996 | if (!$error && !$notrigger) { |
1997 | - $this->newgroupid = $group; // deprecated. Remove this. |
|
1997 | + $this->newgroupid = $group; // deprecated. Remove this. |
|
1998 | 1998 | $this->context = array('audit' => $langs->trans("UserSetInGroup"), 'newgroupid' => $group); |
1999 | 1999 | |
2000 | 2000 | // Call trigger |
@@ -2009,7 +2009,7 @@ discard block |
||
2009 | 2009 | $this->db->commit(); |
2010 | 2010 | return 1; |
2011 | 2011 | } else { |
2012 | - dol_syslog(get_class($this) . "::SetInGroup " . $this->error, LOG_ERR); |
|
2012 | + dol_syslog(get_class($this)."::SetInGroup ".$this->error, LOG_ERR); |
|
2013 | 2013 | $this->db->rollback(); |
2014 | 2014 | return -2; |
2015 | 2015 | } |
@@ -2038,15 +2038,15 @@ discard block |
||
2038 | 2038 | |
2039 | 2039 | $this->db->begin(); |
2040 | 2040 | |
2041 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "usergroup_user"; |
|
2042 | - $sql .= " WHERE fk_user = " . $this->id; |
|
2043 | - $sql .= " AND fk_usergroup = " . $group; |
|
2044 | - $sql .= " AND entity = " . $entity; |
|
2041 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."usergroup_user"; |
|
2042 | + $sql .= " WHERE fk_user = ".$this->id; |
|
2043 | + $sql .= " AND fk_usergroup = ".$group; |
|
2044 | + $sql .= " AND entity = ".$entity; |
|
2045 | 2045 | |
2046 | 2046 | $result = $this->db->query($sql); |
2047 | 2047 | if ($result) { |
2048 | 2048 | if (!$error && !$notrigger) { |
2049 | - $this->oldgroupid = $group; // deprecated. Remove this. |
|
2049 | + $this->oldgroupid = $group; // deprecated. Remove this. |
|
2050 | 2050 | $this->context = array('audit' => $langs->trans("UserRemovedFromGroup"), 'oldgroupid' => $group); |
2051 | 2051 | |
2052 | 2052 | // Call trigger |
@@ -2062,7 +2062,7 @@ discard block |
||
2062 | 2062 | return 1; |
2063 | 2063 | } else { |
2064 | 2064 | $this->error = $interface->error; |
2065 | - dol_syslog(get_class($this) . "::RemoveFromGroup " . $this->error, LOG_ERR); |
|
2065 | + dol_syslog(get_class($this)."::RemoveFromGroup ".$this->error, LOG_ERR); |
|
2066 | 2066 | $this->db->rollback(); |
2067 | 2067 | return -2; |
2068 | 2068 | } |
@@ -2086,7 +2086,7 @@ discard block |
||
2086 | 2086 | function getPhotoUrl($width, $height, $cssclass = '', $imagesize = '') |
2087 | 2087 | { |
2088 | 2088 | // $result = '<a href="' . DOL_URL_ROOT . '/user/card.php?id=' . $this->id . '">'; |
2089 | - $result = '<a href="' . BASE_URI . '?controller=user&method=card&id=' . $this->id . '">'; |
|
2089 | + $result = '<a href="'.BASE_URI.'?controller=user&method=card&id='.$this->id.'">'; |
|
2090 | 2090 | $result .= Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass, $imagesize); |
2091 | 2091 | $result .= '</a>'; |
2092 | 2092 | |
@@ -2136,49 +2136,49 @@ discard block |
||
2136 | 2136 | |
2137 | 2137 | // Info Login |
2138 | 2138 | $label .= '<div class="centpercent">'; |
2139 | - $label .= '<u>' . $langs->trans("User") . '</u><br>'; |
|
2140 | - $label .= '<b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs, ''); |
|
2139 | + $label .= '<u>'.$langs->trans("User").'</u><br>'; |
|
2140 | + $label .= '<b>'.$langs->trans('Name').':</b> '.$this->getFullName($langs, ''); |
|
2141 | 2141 | if (!empty($this->login)) { |
2142 | - $label .= '<br><b>' . $langs->trans('Login') . ':</b> ' . $this->login; |
|
2142 | + $label .= '<br><b>'.$langs->trans('Login').':</b> '.$this->login; |
|
2143 | 2143 | } |
2144 | - $label .= '<br><b>' . $langs->trans("EMail") . ':</b> ' . $this->email; |
|
2144 | + $label .= '<br><b>'.$langs->trans("EMail").':</b> '.$this->email; |
|
2145 | 2145 | if (!empty($this->admin)) { |
2146 | - $label .= '<br><b>' . $langs->trans("Administrator") . '</b>: ' . yn($this->admin); |
|
2146 | + $label .= '<br><b>'.$langs->trans("Administrator").'</b>: '.yn($this->admin); |
|
2147 | 2147 | } |
2148 | 2148 | if (!empty($this->socid)) { // Add thirdparty for external users |
2149 | 2149 | $thirdpartystatic = new Societe($db); |
2150 | 2150 | $thirdpartystatic->fetch($this->socid); |
2151 | 2151 | if (empty($hidethirdpartylogo)) { |
2152 | - $companylink = ' ' . $thirdpartystatic->getNomUrl(2, (($option == 'nolink') ? 'nolink' : '')); // picto only of company |
|
2152 | + $companylink = ' '.$thirdpartystatic->getNomUrl(2, (($option == 'nolink') ? 'nolink' : '')); // picto only of company |
|
2153 | 2153 | } |
2154 | - $company = ' (' . $langs->trans("Company") . ': ' . $thirdpartystatic->name . ')'; |
|
2154 | + $company = ' ('.$langs->trans("Company").': '.$thirdpartystatic->name.')'; |
|
2155 | 2155 | } |
2156 | - $type = ($this->socid ? $langs->trans("External") . $company : $langs->trans("Internal")); |
|
2157 | - $label .= '<br><b>' . $langs->trans("Type") . ':</b> ' . $type; |
|
2158 | - $label .= '<br><b>' . $langs->trans("Status") . '</b>: ' . $this->getLibStatut(0); |
|
2156 | + $type = ($this->socid ? $langs->trans("External").$company : $langs->trans("Internal")); |
|
2157 | + $label .= '<br><b>'.$langs->trans("Type").':</b> '.$type; |
|
2158 | + $label .= '<br><b>'.$langs->trans("Status").'</b>: '.$this->getLibStatut(0); |
|
2159 | 2159 | $label .= '</div>'; |
2160 | 2160 | if ($infologin > 0) { |
2161 | 2161 | $label .= '<br>'; |
2162 | - $label .= '<br><u>' . $langs->trans("Connection") . '</u>'; |
|
2163 | - $label .= '<br><b>' . $langs->trans("IPAddress") . '</b>: ' . $_SERVER["REMOTE_ADDR"]; |
|
2162 | + $label .= '<br><u>'.$langs->trans("Connection").'</u>'; |
|
2163 | + $label .= '<br><b>'.$langs->trans("IPAddress").'</b>: '.$_SERVER["REMOTE_ADDR"]; |
|
2164 | 2164 | if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY)) { |
2165 | - $label .= '<br><b>' . $langs->trans("ConnectedOnMultiCompany") . ':</b> ' . $conf->entity . ' (user entity ' . $this->entity . ')'; |
|
2165 | + $label .= '<br><b>'.$langs->trans("ConnectedOnMultiCompany").':</b> '.$conf->entity.' (user entity '.$this->entity.')'; |
|
2166 | 2166 | } |
2167 | - $label .= '<br><b>' . $langs->trans("AuthenticationMode") . ':</b> ' . $_SESSION["dol_authmode"] . (empty($dolibarr_main_demo) ? '' : ' (demo)'); |
|
2168 | - $label .= '<br><b>' . $langs->trans("ConnectedSince") . ':</b> ' . dol_print_date($this->datelastlogin, "dayhour", 'tzuser'); |
|
2169 | - $label .= '<br><b>' . $langs->trans("PreviousConnexion") . ':</b> ' . dol_print_date($this->datepreviouslogin, "dayhour", 'tzuser'); |
|
2170 | - $label .= '<br><b>' . $langs->trans("CurrentTheme") . ':</b> ' . $conf->theme; |
|
2171 | - $label .= '<br><b>' . $langs->trans("CurrentMenuManager") . ':</b> ' . $menumanager->name; |
|
2167 | + $label .= '<br><b>'.$langs->trans("AuthenticationMode").':</b> '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo) ? '' : ' (demo)'); |
|
2168 | + $label .= '<br><b>'.$langs->trans("ConnectedSince").':</b> '.dol_print_date($this->datelastlogin, "dayhour", 'tzuser'); |
|
2169 | + $label .= '<br><b>'.$langs->trans("PreviousConnexion").':</b> '.dol_print_date($this->datepreviouslogin, "dayhour", 'tzuser'); |
|
2170 | + $label .= '<br><b>'.$langs->trans("CurrentTheme").':</b> '.$conf->theme; |
|
2171 | + $label .= '<br><b>'.$langs->trans("CurrentMenuManager").':</b> '.$menumanager->name; |
|
2172 | 2172 | $s = picto_from_langcode($langs->getDefaultLang()); |
2173 | - $label .= '<br><b>' . $langs->trans("CurrentUserLanguage") . ':</b> ' . ($s ? $s . ' ' : '') . $langs->getDefaultLang(); |
|
2174 | - $label .= '<br><b>' . $langs->trans("Browser") . ':</b> ' . $conf->browser->name . ($conf->browser->version ? ' ' . $conf->browser->version : '') . ' (' . $_SERVER['HTTP_USER_AGENT'] . ')'; |
|
2175 | - $label .= '<br><b>' . $langs->trans("Layout") . ':</b> ' . $conf->browser->layout; |
|
2176 | - $label .= '<br><b>' . $langs->trans("Screen") . ':</b> ' . $_SESSION['dol_screenwidth'] . ' x ' . $_SESSION['dol_screenheight']; |
|
2173 | + $label .= '<br><b>'.$langs->trans("CurrentUserLanguage").':</b> '.($s ? $s.' ' : '').$langs->getDefaultLang(); |
|
2174 | + $label .= '<br><b>'.$langs->trans("Browser").':</b> '.$conf->browser->name.($conf->browser->version ? ' '.$conf->browser->version : '').' ('.$_SERVER['HTTP_USER_AGENT'].')'; |
|
2175 | + $label .= '<br><b>'.$langs->trans("Layout").':</b> '.$conf->browser->layout; |
|
2176 | + $label .= '<br><b>'.$langs->trans("Screen").':</b> '.$_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight']; |
|
2177 | 2177 | if ($conf->browser->layout == 'phone') { |
2178 | - $label .= '<br><b>' . $langs->trans("Phone") . ':</b> ' . $langs->trans("Yes"); |
|
2178 | + $label .= '<br><b>'.$langs->trans("Phone").':</b> '.$langs->trans("Yes"); |
|
2179 | 2179 | } |
2180 | 2180 | if (!empty($_SESSION["disablemodules"])) { |
2181 | - $label .= '<br><b>' . $langs->trans("DisabledModules") . ':</b> <br>' . join(', ', explode(',', $_SESSION["disablemodules"])); |
|
2181 | + $label .= '<br><b>'.$langs->trans("DisabledModules").':</b> <br>'.join(', ', explode(',', $_SESSION["disablemodules"])); |
|
2182 | 2182 | } |
2183 | 2183 | } |
2184 | 2184 | if ($infologin < 0) { |
@@ -2186,10 +2186,10 @@ discard block |
||
2186 | 2186 | } |
2187 | 2187 | |
2188 | 2188 | // $url = DOL_URL_ROOT . '/user/card.php?id=' . $this->id; |
2189 | - $url = BASE_URI . '?controller=user&method=card&id=' . $this->id; |
|
2189 | + $url = BASE_URI.'?controller=user&method=card&id='.$this->id; |
|
2190 | 2190 | if ($option == 'leave') { |
2191 | 2191 | //$url = DOL_URL_ROOT . '/holiday/list.php?id=' . $this->id; |
2192 | - $url = BASE_URI . '?controller=holiday&method=list&id=' . $this->id; |
|
2192 | + $url = BASE_URI.'?controller=holiday&method=list&id='.$this->id; |
|
2193 | 2193 | } |
2194 | 2194 | if ($option != 'nolink') { |
2195 | 2195 | // Add param to save lastsearch_values or not |
@@ -2202,16 +2202,16 @@ discard block |
||
2202 | 2202 | } |
2203 | 2203 | } |
2204 | 2204 | |
2205 | - $linkstart = '<a href="' . $url . '"'; |
|
2205 | + $linkstart = '<a href="'.$url.'"'; |
|
2206 | 2206 | $linkclose = ""; |
2207 | 2207 | if (empty($notooltip)) { |
2208 | 2208 | if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { |
2209 | 2209 | $langs->load("users"); |
2210 | 2210 | $label = $langs->trans("ShowUser"); |
2211 | - $linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"'; |
|
2211 | + $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
|
2212 | 2212 | } |
2213 | - $linkclose .= ' title="' . dol_escape_htmltag($label, 1) . '"'; |
|
2214 | - $linkclose .= ' class="classfortooltip' . ($morecss ? ' ' . $morecss : '') . '"'; |
|
2213 | + $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; |
|
2214 | + $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; |
|
2215 | 2215 | |
2216 | 2216 | /* |
2217 | 2217 | $hookmanager->initHooks(array('userdao')); |
@@ -2221,7 +2221,7 @@ discard block |
||
2221 | 2221 | */ |
2222 | 2222 | } |
2223 | 2223 | |
2224 | - $linkstart .= $linkclose . '>'; |
|
2224 | + $linkstart .= $linkclose.'>'; |
|
2225 | 2225 | $linkend = '</a>'; |
2226 | 2226 | |
2227 | 2227 | //if ($withpictoimg == -1) $result.='<div class="nowrap">'; |
@@ -2233,15 +2233,15 @@ discard block |
||
2233 | 2233 | } |
2234 | 2234 | // Only picto |
2235 | 2235 | if ($withpictoimg > 0) { |
2236 | - $picto = '<!-- picto user --><div class="inline-block nopadding userimg' . ($morecss ? ' ' . $morecss : '') . '">' . img_object('', 'user', $paddafterimage . ' ' . ($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1) . '</div>'; |
|
2236 | + $picto = '<!-- picto user --><div class="inline-block nopadding userimg'.($morecss ? ' '.$morecss : '').'">'.img_object('', 'user', $paddafterimage.' '.($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1).'</div>'; |
|
2237 | 2237 | } else { // Picto must be a photo |
2238 | - $picto = '<!-- picto photo user --><div class="inline-block nopadding userimg' . ($morecss ? ' ' . $morecss : '') . '"' . ($paddafterimage ? ' ' . $paddafterimage : '') . '>' . Form::showphoto('userphoto', $this, 0, 0, 0, 'userphoto' . ($withpictoimg == -3 ? 'small' : ''), 'mini', 0, 1) . '</div>'; |
|
2238 | + $picto = '<!-- picto photo user --><div class="inline-block nopadding userimg'.($morecss ? ' '.$morecss : '').'"'.($paddafterimage ? ' '.$paddafterimage : '').'>'.Form::showphoto('userphoto', $this, 0, 0, 0, 'userphoto'.($withpictoimg == -3 ? 'small' : ''), 'mini', 0, 1).'</div>'; |
|
2239 | 2239 | } |
2240 | 2240 | $result .= $picto; |
2241 | 2241 | } |
2242 | 2242 | if ($withpictoimg > -2 && $withpictoimg != 2) { |
2243 | 2243 | if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { |
2244 | - $result .= '<div class="inline-block nopadding valignmiddle usertext' . ((!isset($this->statut) || $this->statut) ? '' : ' strikefordisabled') . ($morecss ? ' ' . $morecss : '') . '">'; |
|
2244 | + $result .= '<div class="inline-block nopadding valignmiddle usertext'.((!isset($this->statut) || $this->statut) ? '' : ' strikefordisabled').($morecss ? ' '.$morecss : '').'">'; |
|
2245 | 2245 | } |
2246 | 2246 | if ($mode == 'login') { |
2247 | 2247 | $result .= dol_trunc($this->login, $maxlen); |
@@ -2259,7 +2259,7 @@ discard block |
||
2259 | 2259 | global $action; |
2260 | 2260 | $hookmanager->initHooks(array('userdao')); |
2261 | 2261 | $parameters = array('id' => $this->id, 'getnomurl' => $result); |
2262 | - $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
|
2262 | + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
|
2263 | 2263 | if ($reshook > 0) { |
2264 | 2264 | $result = $hookmanager->resPrint; |
2265 | 2265 | } else { |
@@ -2283,7 +2283,7 @@ discard block |
||
2283 | 2283 | $result = ''; |
2284 | 2284 | |
2285 | 2285 | // $linkstart = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'">'; |
2286 | - $linkstart = '<a href="' . BASE_URI . '?controller=user&method=card&id=' . $this->id . '">'; |
|
2286 | + $linkstart = '<a href="'.BASE_URI.'?controller=user&method=card&id='.$this->id.'">'; |
|
2287 | 2287 | $linkend = '</a>'; |
2288 | 2288 | |
2289 | 2289 | //Check user's rights to see an other user |
@@ -2293,7 +2293,7 @@ discard block |
||
2293 | 2293 | |
2294 | 2294 | if ($option == 'xxx') { |
2295 | 2295 | //$linkstart = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'">'; |
2296 | - $linkstart = '<a href="' . BASE_URI . '?controller=user&method=card.php&id=' . $this->id . '">'; |
|
2296 | + $linkstart = '<a href="'.BASE_URI.'?controller=user&method=card.php&id='.$this->id.'">'; |
|
2297 | 2297 | $linkend = '</a>'; |
2298 | 2298 | } |
2299 | 2299 | |
@@ -2350,9 +2350,9 @@ discard block |
||
2350 | 2350 | } |
2351 | 2351 | } elseif ($mode == 2) { |
2352 | 2352 | if ($statut == 1) { |
2353 | - return img_picto($langs->trans('Enabled'), 'statut4', 'class="pictostatus"') . ' ' . $langs->trans('Enabled'); |
|
2353 | + return img_picto($langs->trans('Enabled'), 'statut4', 'class="pictostatus"').' '.$langs->trans('Enabled'); |
|
2354 | 2354 | } elseif ($statut == 0) { |
2355 | - return img_picto($langs->trans('Disabled'), 'statut5', 'class="pictostatus"') . ' ' . $langs->trans('Disabled'); |
|
2355 | + return img_picto($langs->trans('Disabled'), 'statut5', 'class="pictostatus"').' '.$langs->trans('Disabled'); |
|
2356 | 2356 | } |
2357 | 2357 | } elseif ($mode == 3) { |
2358 | 2358 | if ($statut == 1) { |
@@ -2362,15 +2362,15 @@ discard block |
||
2362 | 2362 | } |
2363 | 2363 | } elseif ($mode == 4) { |
2364 | 2364 | if ($statut == 1) { |
2365 | - return img_picto($langs->trans('Enabled'), 'statut4', 'class="pictostatus"') . ' ' . $langs->trans('Enabled'); |
|
2365 | + return img_picto($langs->trans('Enabled'), 'statut4', 'class="pictostatus"').' '.$langs->trans('Enabled'); |
|
2366 | 2366 | } elseif ($statut == 0) { |
2367 | - return img_picto($langs->trans('Disabled'), 'statut5', 'class="pictostatus"') . ' ' . $langs->trans('Disabled'); |
|
2367 | + return img_picto($langs->trans('Disabled'), 'statut5', 'class="pictostatus"').' '.$langs->trans('Disabled'); |
|
2368 | 2368 | } |
2369 | 2369 | } elseif ($mode == 5) { |
2370 | 2370 | if ($statut == 1) { |
2371 | - return $langs->trans('Enabled') . ' ' . img_picto($langs->trans('Enabled'), 'statut4', 'class="pictostatus"'); |
|
2371 | + return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4', 'class="pictostatus"'); |
|
2372 | 2372 | } elseif ($statut == 0) { |
2373 | - return $langs->trans('Disabled') . ' ' . img_picto($langs->trans('Disabled'), 'statut5', 'class="pictostatus"'); |
|
2373 | + return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5', 'class="pictostatus"'); |
|
2374 | 2374 | } |
2375 | 2375 | } |
2376 | 2376 | } |
@@ -2391,11 +2391,11 @@ discard block |
||
2391 | 2391 | global $conf; |
2392 | 2392 | $dn = ''; |
2393 | 2393 | if ($mode == 0) { |
2394 | - $dn = $conf->global->LDAP_KEY_USERS . "=" . $info[$conf->global->LDAP_KEY_USERS] . "," . $conf->global->LDAP_USER_DN; |
|
2394 | + $dn = $conf->global->LDAP_KEY_USERS."=".$info[$conf->global->LDAP_KEY_USERS].",".$conf->global->LDAP_USER_DN; |
|
2395 | 2395 | } elseif ($mode == 1) { |
2396 | 2396 | $dn = $conf->global->LDAP_USER_DN; |
2397 | 2397 | } elseif ($mode == 2) { |
2398 | - $dn = $conf->global->LDAP_KEY_USERS . "=" . $info[$conf->global->LDAP_KEY_USERS]; |
|
2398 | + $dn = $conf->global->LDAP_KEY_USERS."=".$info[$conf->global->LDAP_KEY_USERS]; |
|
2399 | 2399 | } |
2400 | 2400 | return $dn; |
2401 | 2401 | } |
@@ -2593,8 +2593,8 @@ discard block |
||
2593 | 2593 | { |
2594 | 2594 | $sql = "SELECT u.rowid, u.login as ref, u.datec,"; |
2595 | 2595 | $sql .= " u.tms as date_modification, u.entity"; |
2596 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user as u"; |
|
2597 | - $sql .= " WHERE u.rowid = " . $id; |
|
2596 | + $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; |
|
2597 | + $sql .= " WHERE u.rowid = ".$id; |
|
2598 | 2598 | |
2599 | 2599 | $result = $this->db->query($sql); |
2600 | 2600 | if ($result) { |
@@ -2623,9 +2623,9 @@ discard block |
||
2623 | 2623 | function getNbOfEMailings() |
2624 | 2624 | { |
2625 | 2625 | $sql = "SELECT count(mc.email) as nb"; |
2626 | - $sql .= " FROM " . MAIN_DB_PREFIX . "mailing_cibles as mc"; |
|
2627 | - $sql .= " WHERE mc.email = '" . $this->db->escape($this->email) . "'"; |
|
2628 | - $sql .= " AND mc.statut NOT IN (-1,0)"; // -1 erreur, 0 non envoye, 1 envoye avec succes |
|
2626 | + $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc"; |
|
2627 | + $sql .= " WHERE mc.email = '".$this->db->escape($this->email)."'"; |
|
2628 | + $sql .= " AND mc.statut NOT IN (-1,0)"; // -1 erreur, 0 non envoye, 1 envoye avec succes |
|
2629 | 2629 | |
2630 | 2630 | $resql = $this->db->query($sql); |
2631 | 2631 | if ($resql) { |
@@ -2653,19 +2653,19 @@ discard block |
||
2653 | 2653 | global $conf; |
2654 | 2654 | |
2655 | 2655 | $sql = "SELECT count(rowid) as nb"; |
2656 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user"; |
|
2656 | + $sql .= " FROM ".MAIN_DB_PREFIX."user"; |
|
2657 | 2657 | if ($option == 'superadmin') { |
2658 | 2658 | $sql .= " WHERE entity = 0"; |
2659 | 2659 | if ($admin >= 0) { |
2660 | - $sql .= " AND admin = " . $admin; |
|
2660 | + $sql .= " AND admin = ".$admin; |
|
2661 | 2661 | } |
2662 | 2662 | } else { |
2663 | - $sql .= " WHERE entity IN (" . getEntity('user', 0) . ")"; |
|
2663 | + $sql .= " WHERE entity IN (".getEntity('user', 0).")"; |
|
2664 | 2664 | if ($limitTo == 'active') { |
2665 | 2665 | $sql .= " AND statut = 1"; |
2666 | 2666 | } |
2667 | 2667 | if ($admin >= 0) { |
2668 | - $sql .= " AND admin = " . $admin; |
|
2668 | + $sql .= " AND admin = ".$admin; |
|
2669 | 2669 | } |
2670 | 2670 | } |
2671 | 2671 | |
@@ -2716,7 +2716,7 @@ discard block |
||
2716 | 2716 | |
2717 | 2717 | $result = $this->update($user); |
2718 | 2718 | |
2719 | - dol_syslog(get_class($this) . "::update_ldap2dolibarr result=" . $result, LOG_DEBUG); |
|
2719 | + dol_syslog(get_class($this)."::update_ldap2dolibarr result=".$result, LOG_DEBUG); |
|
2720 | 2720 | |
2721 | 2721 | return $result; |
2722 | 2722 | } |
@@ -2731,10 +2731,10 @@ discard block |
||
2731 | 2731 | function get_children() |
2732 | 2732 | { |
2733 | 2733 | // phpcs:enable |
2734 | - $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "user"; |
|
2735 | - $sql .= " WHERE fk_user = " . $this->id; |
|
2734 | + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."user"; |
|
2735 | + $sql .= " WHERE fk_user = ".$this->id; |
|
2736 | 2736 | |
2737 | - dol_syslog(get_class($this) . "::get_children result=" . $result, LOG_DEBUG); |
|
2737 | + dol_syslog(get_class($this)."::get_children result=".$result, LOG_DEBUG); |
|
2738 | 2738 | $res = $this->db->query($sql); |
2739 | 2739 | if ($res) { |
2740 | 2740 | $users = array(); |
@@ -2763,11 +2763,11 @@ discard block |
||
2763 | 2763 | |
2764 | 2764 | // Load array[child]=parent |
2765 | 2765 | $sql = "SELECT fk_user as id_parent, rowid as id_son"; |
2766 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user"; |
|
2766 | + $sql .= " FROM ".MAIN_DB_PREFIX."user"; |
|
2767 | 2767 | $sql .= " WHERE fk_user <> 0"; |
2768 | - $sql .= " AND entity IN (" . getEntity('user') . ")"; |
|
2768 | + $sql .= " AND entity IN (".getEntity('user').")"; |
|
2769 | 2769 | |
2770 | - dol_syslog(get_class($this) . "::loadParentOf", LOG_DEBUG); |
|
2770 | + dol_syslog(get_class($this)."::loadParentOf", LOG_DEBUG); |
|
2771 | 2771 | $resql = $this->db->query($sql); |
2772 | 2772 | if ($resql) { |
2773 | 2773 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -2810,20 +2810,20 @@ discard block |
||
2810 | 2810 | |
2811 | 2811 | // Init $this->users array |
2812 | 2812 | $sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.fk_soc, u.login, u.email, u.gender, u.admin, u.statut, u.photo, u.entity"; // Distinct reduce pb with old tables with duplicates |
2813 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user as u"; |
|
2813 | + $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; |
|
2814 | 2814 | // Add fields from hooks |
2815 | 2815 | $parameters = array(); |
2816 | - $reshook = $hookmanager->executeHooks('printUserListWhere', $parameters); // Note that $action and $object may have been modified by hook |
|
2816 | + $reshook = $hookmanager->executeHooks('printUserListWhere', $parameters); // Note that $action and $object may have been modified by hook |
|
2817 | 2817 | if ($reshook > 0) { |
2818 | 2818 | $sql .= $hookmanager->resPrint; |
2819 | 2819 | } else { |
2820 | - $sql .= " WHERE u.entity IN (" . getEntity('user') . ")"; |
|
2820 | + $sql .= " WHERE u.entity IN (".getEntity('user').")"; |
|
2821 | 2821 | } |
2822 | 2822 | if ($filter) { |
2823 | - $sql .= " AND " . $filter; |
|
2823 | + $sql .= " AND ".$filter; |
|
2824 | 2824 | } |
2825 | 2825 | |
2826 | - dol_syslog(get_class($this) . "::get_full_tree get user list", LOG_DEBUG); |
|
2826 | + dol_syslog(get_class($this)."::get_full_tree get user list", LOG_DEBUG); |
|
2827 | 2827 | $resql = $this->db->query($sql); |
2828 | 2828 | if ($resql) { |
2829 | 2829 | $i = 0; |
@@ -2849,7 +2849,7 @@ discard block |
||
2849 | 2849 | } |
2850 | 2850 | |
2851 | 2851 | // We add the fullpath property to each elements of first level (no parent exists) |
2852 | - dol_syslog(get_class($this) . "::get_full_tree call to build_path_from_id_user", LOG_DEBUG); |
|
2852 | + dol_syslog(get_class($this)."::get_full_tree call to build_path_from_id_user", LOG_DEBUG); |
|
2853 | 2853 | foreach ($this->users as $key => $val) { |
2854 | 2854 | $result = $this->build_path_from_id_user($key, 0); // Process a branch from the root user key (this user has no parent) |
2855 | 2855 | if ($result < 0) { |
@@ -2861,18 +2861,18 @@ discard block |
||
2861 | 2861 | // Exclude leaf including $deleteafterid from tree |
2862 | 2862 | if ($deleteafterid) { |
2863 | 2863 | //print "Look to discard user ".$deleteafterid."\n"; |
2864 | - $keyfilter1 = '^' . $deleteafterid . '$'; |
|
2865 | - $keyfilter2 = '_' . $deleteafterid . '$'; |
|
2866 | - $keyfilter3 = '^' . $deleteafterid . '_'; |
|
2867 | - $keyfilter4 = '_' . $deleteafterid . '_'; |
|
2864 | + $keyfilter1 = '^'.$deleteafterid.'$'; |
|
2865 | + $keyfilter2 = '_'.$deleteafterid.'$'; |
|
2866 | + $keyfilter3 = '^'.$deleteafterid.'_'; |
|
2867 | + $keyfilter4 = '_'.$deleteafterid.'_'; |
|
2868 | 2868 | foreach ($this->users as $key => $val) { |
2869 | - if (preg_match('/' . $keyfilter1 . '/', $val['fullpath']) || preg_match('/' . $keyfilter2 . '/', $val['fullpath']) || preg_match('/' . $keyfilter3 . '/', $val['fullpath']) || preg_match('/' . $keyfilter4 . '/', $val['fullpath'])) { |
|
2869 | + if (preg_match('/'.$keyfilter1.'/', $val['fullpath']) || preg_match('/'.$keyfilter2.'/', $val['fullpath']) || preg_match('/'.$keyfilter3.'/', $val['fullpath']) || preg_match('/'.$keyfilter4.'/', $val['fullpath'])) { |
|
2870 | 2870 | unset($this->users[$key]); |
2871 | 2871 | } |
2872 | 2872 | } |
2873 | 2873 | } |
2874 | 2874 | |
2875 | - dol_syslog(get_class($this) . "::get_full_tree dol_sort_array", LOG_DEBUG); |
|
2875 | + dol_syslog(get_class($this)."::get_full_tree dol_sort_array", LOG_DEBUG); |
|
2876 | 2876 | $this->users = dol_sort_array($this->users, 'fullname', 'asc', true, false); |
2877 | 2877 | |
2878 | 2878 | //var_dump($this->users); |
@@ -2900,10 +2900,10 @@ discard block |
||
2900 | 2900 | |
2901 | 2901 | $idtoscan = $this->id; |
2902 | 2902 | |
2903 | - dol_syslog("Build childid for id = " . $idtoscan); |
|
2903 | + dol_syslog("Build childid for id = ".$idtoscan); |
|
2904 | 2904 | foreach ($this->users as $id => $val) { |
2905 | 2905 | //var_dump($val['fullpath']); |
2906 | - if (preg_match('/_' . $idtoscan . '_/', $val['fullpath'])) { |
|
2906 | + if (preg_match('/_'.$idtoscan.'_/', $val['fullpath'])) { |
|
2907 | 2907 | $childids[$val['id']] = $val['id']; |
2908 | 2908 | } |
2909 | 2909 | } |
@@ -2929,16 +2929,16 @@ discard block |
||
2929 | 2929 | function build_path_from_id_user($id_user, $protection = 0) |
2930 | 2930 | { |
2931 | 2931 | // phpcs:enable |
2932 | - dol_syslog(get_class($this) . "::build_path_from_id_user id_user=" . $id_user . " protection=" . $protection, LOG_DEBUG); |
|
2932 | + dol_syslog(get_class($this)."::build_path_from_id_user id_user=".$id_user." protection=".$protection, LOG_DEBUG); |
|
2933 | 2933 | |
2934 | 2934 | if (!empty($this->users[$id_user]['fullpath'])) { |
2935 | 2935 | // Already defined |
2936 | - dol_syslog(get_class($this) . "::build_path_from_id_user fullpath and fullname already defined", LOG_WARNING); |
|
2936 | + dol_syslog(get_class($this)."::build_path_from_id_user fullpath and fullname already defined", LOG_WARNING); |
|
2937 | 2937 | return 0; |
2938 | 2938 | } |
2939 | 2939 | |
2940 | 2940 | // Define fullpath and fullname |
2941 | - $this->users[$id_user]['fullpath'] = '_' . $id_user; |
|
2941 | + $this->users[$id_user]['fullpath'] = '_'.$id_user; |
|
2942 | 2942 | $this->users[$id_user]['fullname'] = $this->users[$id_user]['lastname']; |
2943 | 2943 | $i = 0; |
2944 | 2944 | $cursor_user = $id_user; |
@@ -2947,11 +2947,11 @@ discard block |
||
2947 | 2947 | while (!empty($this->parentof[$cursor_user])) { |
2948 | 2948 | if (in_array($this->parentof[$cursor_user], $useridfound)) { |
2949 | 2949 | dol_syslog("The hierarchy of user has a recursive loop", LOG_WARNING); |
2950 | - return -1; // Should not happen. Protection against looping hierarchy |
|
2950 | + return -1; // Should not happen. Protection against looping hierarchy |
|
2951 | 2951 | } |
2952 | 2952 | $useridfound[] = $this->parentof[$cursor_user]; |
2953 | - $this->users[$id_user]['fullpath'] = '_' . $this->parentof[$cursor_user] . $this->users[$id_user]['fullpath']; |
|
2954 | - $this->users[$id_user]['fullname'] = $this->users[$this->parentof[$cursor_user]]['lastname'] . ' >> ' . $this->users[$id_user]['fullname']; |
|
2953 | + $this->users[$id_user]['fullpath'] = '_'.$this->parentof[$cursor_user].$this->users[$id_user]['fullpath']; |
|
2954 | + $this->users[$id_user]['fullname'] = $this->users[$this->parentof[$cursor_user]]['lastname'].' >> '.$this->users[$id_user]['fullname']; |
|
2955 | 2955 | $i++; |
2956 | 2956 | $cursor_user = $this->parentof[$cursor_user]; |
2957 | 2957 | } |
@@ -2993,10 +2993,10 @@ discard block |
||
2993 | 2993 | $this->nb = array(); |
2994 | 2994 | |
2995 | 2995 | $sql = "SELECT count(u.rowid) as nb"; |
2996 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user as u"; |
|
2996 | + $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; |
|
2997 | 2997 | $sql .= " WHERE u.statut > 0"; |
2998 | 2998 | //$sql.= " AND employee != 0"; |
2999 | - $sql .= " AND u.entity IN (" . getEntity('user') . ")"; |
|
2999 | + $sql .= " AND u.entity IN (".getEntity('user').")"; |
|
3000 | 3000 | |
3001 | 3001 | $resql = $this->db->query($sql); |
3002 | 3002 | if ($resql) { |
@@ -3061,8 +3061,8 @@ discard block |
||
3061 | 3061 | } |
3062 | 3062 | |
3063 | 3063 | $sql = "SELECT rowid, email, user_mobile, civility, lastname, firstname"; |
3064 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user"; |
|
3065 | - $sql .= " WHERE rowid = '" . $rowid . "'"; |
|
3064 | + $sql .= " FROM ".MAIN_DB_PREFIX."user"; |
|
3065 | + $sql .= " WHERE rowid = '".$rowid."'"; |
|
3066 | 3066 | |
3067 | 3067 | $resql = $this->db->query($sql); |
3068 | 3068 | if ($resql) { |
@@ -3072,7 +3072,7 @@ discard block |
||
3072 | 3072 | $obj = $this->db->fetch_object($resql); |
3073 | 3073 | |
3074 | 3074 | if ($mode == 'email') { |
3075 | - $user_property = dolGetFirstLastname($obj->firstname, $obj->lastname) . " <" . $obj->email . ">"; |
|
3075 | + $user_property = dolGetFirstLastname($obj->firstname, $obj->lastname)." <".$obj->email.">"; |
|
3076 | 3076 | } else if ($mode == 'mobile') { |
3077 | 3077 | $user_property = $obj->user_mobile; |
3078 | 3078 | } |
@@ -3099,7 +3099,7 @@ discard block |
||
3099 | 3099 | global $conf; |
3100 | 3100 | |
3101 | 3101 | $sql = "SELECT t.rowid"; |
3102 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t '; |
|
3102 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t '; |
|
3103 | 3103 | $sql .= " WHERE 1"; |
3104 | 3104 | |
3105 | 3105 | // Manage filter |
@@ -3107,25 +3107,25 @@ discard block |
||
3107 | 3107 | if (!empty($filter)) { |
3108 | 3108 | foreach ($filter as $key => $value) { |
3109 | 3109 | if ($key == 't.rowid') { |
3110 | - $sqlwhere[] = $key . '=' . $value; |
|
3110 | + $sqlwhere[] = $key.'='.$value; |
|
3111 | 3111 | } elseif (strpos($key, 'date') !== false) { |
3112 | - $sqlwhere[] = $key . ' = \'' . $this->db->idate($value) . '\''; |
|
3112 | + $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; |
|
3113 | 3113 | } elseif ($key == 'customsql') { |
3114 | 3114 | $sqlwhere[] = $value; |
3115 | 3115 | } else { |
3116 | - $sqlwhere[] = $key . ' LIKE \'%' . $this->db->escape($value) . '%\''; |
|
3116 | + $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; |
|
3117 | 3117 | } |
3118 | 3118 | } |
3119 | 3119 | } |
3120 | 3120 | if (count($sqlwhere) > 0) { |
3121 | - $sql .= ' AND (' . implode(' ' . $filtermode . ' ', $sqlwhere) . ')'; |
|
3121 | + $sql .= ' AND ('.implode(' '.$filtermode.' ', $sqlwhere).')'; |
|
3122 | 3122 | } |
3123 | 3123 | $sql .= $this->db->order($sortfield, $sortorder); |
3124 | 3124 | if ($limit) { |
3125 | 3125 | $sql .= $this->db->plimit($limit + 1, $offset); |
3126 | 3126 | } |
3127 | 3127 | |
3128 | - dol_syslog(get_class($this) . "::" . __METHOD__, LOG_DEBUG); |
|
3128 | + dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG); |
|
3129 | 3129 | |
3130 | 3130 | $resql = $this->db->query($sql); |
3131 | 3131 | if ($resql) { |
@@ -378,13 +378,13 @@ discard block |
||
378 | 378 | while ($i < $num) { |
379 | 379 | $obj = $this->db->fetch_object($resql); |
380 | 380 | $p = (!empty($obj->param) ? $obj->param : ''); |
381 | - if (!empty($p)) |
|
382 | - $this->conf->$p = $obj->value; |
|
381 | + if (!empty($p)) { |
|
382 | + $this->conf->$p = $obj->value; |
|
383 | + } |
|
383 | 384 | $i++; |
384 | 385 | } |
385 | 386 | $this->db->free($resql); |
386 | - } |
|
387 | - else { |
|
387 | + } else { |
|
388 | 388 | $this->error = $this->db->lasterror(); |
389 | 389 | return -2; |
390 | 390 | } |
@@ -535,16 +535,17 @@ discard block |
||
535 | 535 | $nid = $obj->id; |
536 | 536 | |
537 | 537 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_rights WHERE fk_user = " . $this->id . " AND fk_id=" . $nid . " AND entity = " . $entity; |
538 | - if (!$this->db->query($sql)) |
|
539 | - $error++; |
|
538 | + if (!$this->db->query($sql)) { |
|
539 | + $error++; |
|
540 | + } |
|
540 | 541 | $sql = "INSERT INTO " . MAIN_DB_PREFIX . "user_rights (entity, fk_user, fk_id) VALUES (" . $entity . ", " . $this->id . ", " . $nid . ")"; |
541 | - if (!$this->db->query($sql)) |
|
542 | - $error++; |
|
542 | + if (!$this->db->query($sql)) { |
|
543 | + $error++; |
|
544 | + } |
|
543 | 545 | |
544 | 546 | $i++; |
545 | 547 | } |
546 | - } |
|
547 | - else { |
|
548 | + } else { |
|
548 | 549 | $error++; |
549 | 550 | dol_print_error($this->db); |
550 | 551 | } |
@@ -2248,8 +2249,9 @@ discard block |
||
2248 | 2249 | } else { |
2249 | 2250 | $result .= $this->getFullName($langs, '', ($mode == 'firstname' ? 2 : -1), $maxlen); |
2250 | 2251 | } |
2251 | - if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) |
|
2252 | - $result .= '</div>'; |
|
2252 | + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { |
|
2253 | + $result .= '</div>'; |
|
2254 | + } |
|
2253 | 2255 | } |
2254 | 2256 | $result .= (($option == 'nolink') ? '' : $linkend); |
2255 | 2257 | //if ($withpictoimg == -1) $result.='</div>'; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * \ingroup user |
28 | 28 | * \brief File of class to manage bank accounts description of users |
29 | 29 | */ |
30 | -require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
30 | +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
31 | 31 | |
32 | 32 | /** |
33 | 33 | * Class to manage bank accounts description of third parties |
@@ -64,12 +64,12 @@ discard block |
||
64 | 64 | { |
65 | 65 | $now = dol_now(); |
66 | 66 | |
67 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "user_rib (fk_user, datec)"; |
|
68 | - $sql .= " VALUES (" . $this->userid . ", '" . $this->db->idate($now) . "')"; |
|
67 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."user_rib (fk_user, datec)"; |
|
68 | + $sql .= " VALUES (".$this->userid.", '".$this->db->idate($now)."')"; |
|
69 | 69 | $resql = $this->db->query($sql); |
70 | 70 | if ($resql) { |
71 | 71 | if ($this->db->affected_rows($resql)) { |
72 | - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "user_rib"); |
|
72 | + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."user_rib"); |
|
73 | 73 | |
74 | 74 | return $this->update($user); |
75 | 75 | } |
@@ -94,24 +94,24 @@ discard block |
||
94 | 94 | $this->create(); |
95 | 95 | } |
96 | 96 | |
97 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user_rib SET"; |
|
98 | - $sql .= " bank = '" . $this->db->escape($this->bank) . "'"; |
|
99 | - $sql .= ",code_banque='" . $this->db->escape($this->code_banque) . "'"; |
|
100 | - $sql .= ",code_guichet='" . $this->db->escape($this->code_guichet) . "'"; |
|
101 | - $sql .= ",number='" . $this->db->escape($this->number) . "'"; |
|
102 | - $sql .= ",cle_rib='" . $this->db->escape($this->cle_rib) . "'"; |
|
103 | - $sql .= ",bic='" . $this->db->escape($this->bic) . "'"; |
|
104 | - $sql .= ",iban_prefix = '" . $this->db->escape($this->iban) . "'"; |
|
105 | - $sql .= ",domiciliation='" . $this->db->escape($this->domiciliation) . "'"; |
|
106 | - $sql .= ",proprio = '" . $this->db->escape($this->proprio) . "'"; |
|
107 | - $sql .= ",owner_address = '" . $this->db->escape($this->owner_address) . "'"; |
|
97 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user_rib SET"; |
|
98 | + $sql .= " bank = '".$this->db->escape($this->bank)."'"; |
|
99 | + $sql .= ",code_banque='".$this->db->escape($this->code_banque)."'"; |
|
100 | + $sql .= ",code_guichet='".$this->db->escape($this->code_guichet)."'"; |
|
101 | + $sql .= ",number='".$this->db->escape($this->number)."'"; |
|
102 | + $sql .= ",cle_rib='".$this->db->escape($this->cle_rib)."'"; |
|
103 | + $sql .= ",bic='".$this->db->escape($this->bic)."'"; |
|
104 | + $sql .= ",iban_prefix = '".$this->db->escape($this->iban)."'"; |
|
105 | + $sql .= ",domiciliation='".$this->db->escape($this->domiciliation)."'"; |
|
106 | + $sql .= ",proprio = '".$this->db->escape($this->proprio)."'"; |
|
107 | + $sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'"; |
|
108 | 108 | |
109 | 109 | if (trim($this->label) != '') { |
110 | - $sql .= ",label = '" . $this->db->escape($this->label) . "'"; |
|
110 | + $sql .= ",label = '".$this->db->escape($this->label)."'"; |
|
111 | 111 | } else { |
112 | 112 | $sql .= ",label = NULL"; |
113 | 113 | } |
114 | - $sql .= " WHERE rowid = " . $this->id; |
|
114 | + $sql .= " WHERE rowid = ".$this->id; |
|
115 | 115 | |
116 | 116 | $result = $this->db->query($sql); |
117 | 117 | if ($result) { |
@@ -138,15 +138,15 @@ discard block |
||
138 | 138 | |
139 | 139 | $sql = "SELECT rowid, fk_user, entity, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban, domiciliation, proprio,"; |
140 | 140 | $sql .= " owner_address, label, datec, tms as datem"; |
141 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user_rib"; |
|
141 | + $sql .= " FROM ".MAIN_DB_PREFIX."user_rib"; |
|
142 | 142 | if ($id) { |
143 | - $sql .= " WHERE rowid = " . $id; |
|
143 | + $sql .= " WHERE rowid = ".$id; |
|
144 | 144 | } |
145 | 145 | if ($ref) { |
146 | - $sql .= " WHERE label = '" . $this->db->escape($ref) . "'"; |
|
146 | + $sql .= " WHERE label = '".$this->db->escape($ref)."'"; |
|
147 | 147 | } |
148 | 148 | if ($userid) { |
149 | - $sql .= " WHERE fk_user = '" . $userid . "'"; |
|
149 | + $sql .= " WHERE fk_user = '".$userid."'"; |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | $resql = $this->db->query($sql); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | if ($this->code_banque || $this->code_guichet || $this->number || $this->cle_rib) { |
193 | 193 | |
194 | 194 | if ($this->label && $displayriblabel) { |
195 | - $rib = $this->label . " : "; |
|
195 | + $rib = $this->label." : "; |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | $rib .= (string) $this; |