@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | // html header |
| 117 | 117 | $this->top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); |
| 118 | 118 | |
| 119 | - print '<body id="mainbody"' . ($morecssonbody ? ' class="' . $morecssonbody . '"' : '') . '>' . "\n"; |
|
| 119 | + print '<body id="mainbody"'.($morecssonbody ? ' class="'.$morecssonbody.'"' : '').'>'."\n"; |
|
| 120 | 120 | |
| 121 | 121 | // top menu and left menu area |
| 122 | 122 | if (empty(Globals::$conf->dol_hide_topmenu) || GETPOST('dol_invisible_topmenu', 'int')) { |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (empty(Globals::$conf->dol_hide_leftmenu)) { |
| 127 | - $this->left_menu('', $help_url, '', '', 1, $title, 1); // $menumanager is retreived with a global $menumanager inside this function |
|
| 127 | + $this->left_menu('', $help_url, '', '', 1, $title, 1); // $menumanager is retreived with a global $menumanager inside this function |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | // main area |
@@ -175,13 +175,13 @@ discard block |
||
| 175 | 175 | * Top menu |
| 176 | 176 | */ |
| 177 | 177 | if ((empty(Globals::$conf->dol_hide_topmenu) || GETPOST('dol_invisible_topmenu', 'int')) && (!defined('NOREQUIREMENU') || !constant('NOREQUIREMENU'))) { |
| 178 | - print "\n" . '<!-- Start top horizontal -->' . "\n"; |
|
| 178 | + print "\n".'<!-- Start top horizontal -->'."\n"; |
|
| 179 | 179 | |
| 180 | - print '<div class="side-nav-vert' . (DolUtils::GETPOST('dol_invisible_topmenu', 'int') ? ' hidden' : '') . '"><div id="id-top">'; // dol_invisible_topmenu differs from dol_hide_topmenu: dol_invisible_topmenu means we output menu but we make it invisible. |
|
| 180 | + print '<div class="side-nav-vert'.(DolUtils::GETPOST('dol_invisible_topmenu', 'int') ? ' hidden' : '').'"><div id="id-top">'; // dol_invisible_topmenu differs from dol_hide_topmenu: dol_invisible_topmenu means we output menu but we make it invisible. |
|
| 181 | 181 | // Show menu entries |
| 182 | - print '<div id="tmenu_tooltip' . (empty(Globals::$conf->global->MAIN_MENU_INVERT) ? '' : 'invert') . '" class="tmenu">' . "\n"; |
|
| 182 | + print '<div id="tmenu_tooltip'.(empty(Globals::$conf->global->MAIN_MENU_INVERT) ? '' : 'invert').'" class="tmenu">'."\n"; |
|
| 183 | 183 | Globals::$menuManager->atarget = $target; |
| 184 | - Globals::$menuManager->showmenu('top', array('searchform' => $searchform, 'bookmarks' => $bookmarks)); // This contains a \n |
|
| 184 | + Globals::$menuManager->showmenu('top', array('searchform' => $searchform, 'bookmarks' => $bookmarks)); // This contains a \n |
|
| 185 | 185 | print "</div>\n"; |
| 186 | 186 | |
| 187 | 187 | // Define link to login card |
@@ -189,36 +189,36 @@ discard block |
||
| 189 | 189 | if (!empty(Globals::$conf->global->MAIN_APPLICATION_TITLE)) { |
| 190 | 190 | $appli = Globals::$conf->global->MAIN_APPLICATION_TITLE; |
| 191 | 191 | if (preg_match('/\d\.\d/', $appli)) { |
| 192 | - if (!preg_match('/' . preg_quote(DOL_VERSION) . '/', $appli)) |
|
| 193 | - $appli .= " (" . DOL_VERSION . ")"; // If new title contains a version that is different than core |
|
| 192 | + if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) |
|
| 193 | + $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core |
|
| 194 | 194 | } else |
| 195 | - $appli .= " " . DOL_VERSION; |
|
| 195 | + $appli .= " ".DOL_VERSION; |
|
| 196 | 196 | } else |
| 197 | - $appli .= " " . DOL_VERSION; |
|
| 197 | + $appli .= " ".DOL_VERSION; |
|
| 198 | 198 | |
| 199 | 199 | if (!empty(Globals::$conf->global->MAIN_FEATURES_LEVEL)) |
| 200 | - $appli .= "<br>" . Globals::$langs->trans("LevelOfFeature") . ': ' . Globals::$conf->global->MAIN_FEATURES_LEVEL; |
|
| 200 | + $appli .= "<br>".Globals::$langs->trans("LevelOfFeature").': '.Globals::$conf->global->MAIN_FEATURES_LEVEL; |
|
| 201 | 201 | |
| 202 | 202 | $logouttext = ''; |
| 203 | 203 | if (empty(Globals::$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { |
| 204 | 204 | //$logouthtmltext=$appli.'<br>'; |
| 205 | 205 | $logouthtmltext = ''; |
| 206 | 206 | if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') { { |
| 207 | - $logouthtmltext .= Globals::$langs->trans("Logout") . '<br>'; |
|
| 207 | + $logouthtmltext .= Globals::$langs->trans("Logout").'<br>'; |
|
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | //$logouttext .='<a accesskey="l" href="'.DOL_BASE_URI.'/user/logout.php">'; |
| 211 | - $logouttext .= '<a accesskey="l" href="' . BASE_URI . '?controller=user&method=logout">'; |
|
| 211 | + $logouttext .= '<a accesskey="l" href="'.BASE_URI.'?controller=user&method=logout">'; |
|
| 212 | 212 | //$logouttext .= img_picto(Globals::$langs->trans('Logout').":".Globals::$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); |
| 213 | 213 | $logouttext .= '<span class="fa fa-sign-out atoplogin"></span>'; |
| 214 | 214 | $logouttext .= '</a>'; |
| 215 | 215 | } else { |
| 216 | 216 | $logouthtmltext .= Globals::$langs->trans("NoLogoutProcessWithAuthMode", $_SESSION["dol_authmode"]); |
| 217 | - $logouttext .= img_picto(Globals::$langs->trans('Logout') . ":" . Globals::$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); |
|
| 217 | + $logouttext .= img_picto(Globals::$langs->trans('Logout').":".Globals::$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); |
|
| 218 | 218 | } |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | - print '<div class="login_block">' . "\n"; |
|
| 221 | + print '<div class="login_block">'."\n"; |
|
| 222 | 222 | |
| 223 | 223 | // Add login user link |
| 224 | 224 | $toprightmenu .= '<div class="login_block_user">'; |
@@ -229,18 +229,18 @@ discard block |
||
| 229 | 229 | $toprightmenu .= Globals::$user->getNomUrl($mode, '', 1, 0, 11, 0, (Globals::$user->firstname ? 'firstname' : -1), 'atoplogin'); |
| 230 | 230 | $toprightmenu .= '</div></div>'; |
| 231 | 231 | |
| 232 | - $toprightmenu .= '</div>' . "\n"; |
|
| 232 | + $toprightmenu .= '</div>'."\n"; |
|
| 233 | 233 | |
| 234 | 234 | $toprightmenu .= '<div class="login_block_other">'; |
| 235 | 235 | |
| 236 | 236 | // Execute hook printTopRightMenu (hooks should output string like '<div class="login"><a href="">mylink</a></div>') |
| 237 | 237 | $parameters = array(); |
| 238 | - $result = Globals::$hookManager->executeHooks('printTopRightMenu', $parameters); // Note that $action and $object may have been modified by some hooks |
|
| 238 | + $result = Globals::$hookManager->executeHooks('printTopRightMenu', $parameters); // Note that $action and $object may have been modified by some hooks |
|
| 239 | 239 | if (is_numeric($result)) { |
| 240 | 240 | if ($result == 0) |
| 241 | - $toprightmenu .= Globals::$hookManager->resPrint; // add |
|
| 241 | + $toprightmenu .= Globals::$hookManager->resPrint; // add |
|
| 242 | 242 | else |
| 243 | - $toprightmenu = Globals::$hookManager->resPrint; // replace |
|
| 243 | + $toprightmenu = Globals::$hookManager->resPrint; // replace |
|
| 244 | 244 | } |
| 245 | 245 | else { |
| 246 | 246 | $toprightmenu .= $result; // For backward compatibility |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | // Link to module builder |
| 250 | 250 | if (!empty(Globals::$conf->modulebuilder->enabled)) { |
| 251 | 251 | //$text = '<a href="' . DOL_BASE_URI . '/modulebuilder/index.php?mainmenu=home&leftmenu=admintools" target="_modulebuilder">'; |
| 252 | - $text = '<a href="' . BASE_URI . '?controller=modulebuilder&method=index&mainmenu=home&leftmenu=admintools" target="_modulebuilder">'; |
|
| 252 | + $text = '<a href="'.BASE_URI.'?controller=modulebuilder&method=index&mainmenu=home&leftmenu=admintools" target="_modulebuilder">'; |
|
| 253 | 253 | //$text.= img_picto(":".Globals::$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"'); |
| 254 | 254 | $text .= '<span class="fa fa-bug atoplogin"></span>'; |
| 255 | 255 | $text .= '</a>'; |
@@ -263,12 +263,12 @@ discard block |
||
| 263 | 263 | if (is_array($_POST)) { |
| 264 | 264 | foreach ($_POST as $key => $value) { |
| 265 | 265 | if ($key !== 'action' && $key !== 'password' && !is_array($value)) { |
| 266 | - $qs .= '&' . $key . '=' . urlencode($value); |
|
| 266 | + $qs .= '&'.$key.'='.urlencode($value); |
|
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | - $qs .= (($qs && $morequerystring) ? '&' : '') . $morequerystring; |
|
| 271 | - $text = '<a href="' . dol_escape_htmltag($_SERVER["PHP_SELF"]) . '?' . $qs . ($qs ? '&' : '') . 'optioncss=print" target="_blank">'; |
|
| 270 | + $qs .= (($qs && $morequerystring) ? '&' : '').$morequerystring; |
|
| 271 | + $text = '<a href="'.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.$qs.($qs ? '&' : '').'optioncss=print" target="_blank">'; |
|
| 272 | 272 | //$text.= img_picto(":".Globals::$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"'); |
| 273 | 273 | $text .= '<span class="fa fa-print atoplogin"></span>'; |
| 274 | 274 | $text .= '</a>'; |
@@ -297,12 +297,12 @@ discard block |
||
| 297 | 297 | $text = ''; |
| 298 | 298 | if (!empty(Globals::$conf->global->MAIN_SHOWDATABASENAMEINHELPPAGESLINK)) { |
| 299 | 299 | Globals::$langs->load('admin'); |
| 300 | - $appli .= '<br>' . Globals::$langs->trans("Database") . ': ' . $db->database_name; |
|
| 300 | + $appli .= '<br>'.Globals::$langs->trans("Database").': '.$db->database_name; |
|
| 301 | 301 | } |
| 302 | - $title = $appli . '<br>'; |
|
| 302 | + $title = $appli.'<br>'; |
|
| 303 | 303 | $title .= Globals::$langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage' : 'GoToHelpPage'); |
| 304 | 304 | if ($mode == 'wiki') { |
| 305 | - $title .= ' - ' . Globals::$langs->trans("PageWiki") . ' "' . dol_escape_htmltag(strtr($helppage, '_', ' ')) . '"'; |
|
| 305 | + $title .= ' - '.Globals::$langs->trans("PageWiki").' "'.dol_escape_htmltag(strtr($helppage, '_', ' ')).'"'; |
|
| 306 | 306 | } |
| 307 | 307 | $text .= '<a class="help" target="_blank" rel="noopener" href="'; |
| 308 | 308 | if ($mode == 'wiki') { |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | |
| 329 | 329 | print $toprightmenu; |
| 330 | 330 | |
| 331 | - print "</div>\n"; // end div class="login_block" |
|
| 331 | + print "</div>\n"; // end div class="login_block" |
|
| 332 | 332 | |
| 333 | 333 | print '</div></div>'; |
| 334 | 334 | |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | if (empty(Globals::$conf->dol_hide_leftmenu) && empty(Globals::$conf->dol_use_jmobile)) |
| 340 | - print '<!-- Begin div id-container --><div id="id-container" class="id-container' . ($morecss ? ' ' . $morecss : '') . '">'; |
|
| 340 | + print '<!-- Begin div id-container --><div id="id-container" class="id-container'.($morecss ? ' '.$morecss : '').'">'; |
|
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | /** |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | // Instantiate hooks of thirdparty module |
| 370 | 370 | Globals::$hookManager->initHooks(array('searchform', 'leftblock')); |
| 371 | 371 | |
| 372 | - print "\n" . '<!-- Begin side-nav id-left -->' . "\n" . '<div class="side-nav"><div id="id-left">' . "\n"; |
|
| 372 | + print "\n".'<!-- Begin side-nav id-left -->'."\n".'<div class="side-nav"><div id="id-left">'."\n"; |
|
| 373 | 373 | |
| 374 | 374 | if (Globals::$conf->browser->layout == 'phone') |
| 375 | 375 | Globals::$conf->global->MAIN_USE_OLD_SEARCH_FORM = 1; // Select into select2 is awfull on smartphone. TODO Is this still true with select2 v4 ? |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | } |
| 382 | 382 | $selected = -1; |
| 383 | 383 | $usedbyinclude = 1; |
| 384 | - include_once DOL_BASE_PATH . '/core/ajax/selectsearchbox.php'; // This set $arrayresult |
|
| 384 | + include_once DOL_BASE_PATH.'/core/ajax/selectsearchbox.php'; // This set $arrayresult |
|
| 385 | 385 | |
| 386 | 386 | if (Globals::$conf->use_javascript_ajax && empty(Globals::$conf->global->MAIN_USE_OLD_SEARCH_FORM)) { |
| 387 | 387 | //$searchform.=$form->selectArrayAjax('searchselectcombo', DOL_BASE_URI.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'vmenusearchselectcombo', 1, Globals::$langs->trans("Search"), 1); |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | // Execute hook printSearchForm |
| 397 | 397 | $parameters = array('searchform' => $searchform); |
| 398 | 398 | |
| 399 | - $reshook = Globals::$hookManager->executeHooks('printSearchForm', $parameters); // Note that $action and $object may have been modified by some hooks |
|
| 399 | + $reshook = Globals::$hookManager->executeHooks('printSearchForm', $parameters); // Note that $action and $object may have been modified by some hooks |
|
| 400 | 400 | if (empty($reshook)) { |
| 401 | 401 | $searchform .= Globals::$hookManager->resPrint; |
| 402 | 402 | } else |
@@ -404,10 +404,10 @@ discard block |
||
| 404 | 404 | |
| 405 | 405 | // Force special value for $searchform |
| 406 | 406 | if (!empty(Globals::$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) || empty(Globals::$conf->use_javascript_ajax)) { |
| 407 | - $urltosearch = DOL_BASE_URI . '/core/search_page.php?showtitlebefore=1'; |
|
| 408 | - $searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="' . $urltosearch . '" alt="' . dol_escape_htmltag(Globals::$langs->trans("ShowSearchFields")) . '">' . Globals::$langs->trans("Search") . '...</a></div></div>'; |
|
| 407 | + $urltosearch = DOL_BASE_URI.'/core/search_page.php?showtitlebefore=1'; |
|
| 408 | + $searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="'.$urltosearch.'" alt="'.dol_escape_htmltag(Globals::$langs->trans("ShowSearchFields")).'">'.Globals::$langs->trans("Search").'...</a></div></div>'; |
|
| 409 | 409 | } elseif (Globals::$conf->use_javascript_ajax && !empty(Globals::$conf->global->MAIN_USE_OLD_SEARCH_FORM)) { |
| 410 | - $searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="#" alt="' . dol_escape_htmltag(Globals::$langs->trans("ShowSearchFields")) . '">' . Globals::$langs->trans("Search") . '...</a></div><div id="divsearchforms2" style="display: none">' . $searchform . '</div>'; |
|
| 410 | + $searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="#" alt="'.dol_escape_htmltag(Globals::$langs->trans("ShowSearchFields")).'">'.Globals::$langs->trans("Search").'...</a></div><div id="divsearchforms2" style="display: none">'.$searchform.'</div>'; |
|
| 411 | 411 | $searchform .= '<script type="text/javascript"> |
| 412 | 412 | jQuery(document).ready(function () { |
| 413 | 413 | jQuery("#divsearchforms1").click(function(){ |
@@ -420,16 +420,16 @@ discard block |
||
| 420 | 420 | |
| 421 | 421 | // Define $bookmarks |
| 422 | 422 | if (!empty(Globals::$conf->bookmark->enabled) && Globals::$user->rights->bookmark->lire) { |
| 423 | - include_once DOL_BASE_PATH . '/bookmarks/bookmarks.lib.php'; |
|
| 423 | + include_once DOL_BASE_PATH.'/bookmarks/bookmarks.lib.php'; |
|
| 424 | 424 | Globals::$langs->load("bookmarks"); |
| 425 | 425 | |
| 426 | 426 | $bookmarks = printBookmarksList($db, Globals::$langs); |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | // Left column |
| 430 | - print '<!-- Begin left menu -->' . "\n"; |
|
| 430 | + print '<!-- Begin left menu -->'."\n"; |
|
| 431 | 431 | |
| 432 | - print '<div class="vmenu"' . (empty(Globals::$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' title="Left menu"') . '>' . "\n\n"; |
|
| 432 | + print '<div class="vmenu"'.(empty(Globals::$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' title="Left menu"').'>'."\n\n"; |
|
| 433 | 433 | |
| 434 | 434 | // Show left menu with other forms |
| 435 | 435 | Globals::$menuManager->menu_array = $menu_array_before; |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | // Dolibarr version + help + bug report link |
| 439 | 439 | print "\n"; |
| 440 | 440 | print "<!-- Begin Help Block-->\n"; |
| 441 | - print '<div id="blockvmenuhelp" class="blockvmenuhelp">' . "\n"; |
|
| 441 | + print '<div id="blockvmenuhelp" class="blockvmenuhelp">'."\n"; |
|
| 442 | 442 | |
| 443 | 443 | // Version |
| 444 | 444 | if (empty(Globals::$conf->global->MAIN_HIDE_VERSION)) { // Version is already on help picto and on login page. |
@@ -460,15 +460,15 @@ discard block |
||
| 460 | 460 | $appli = Globals::$conf->global->MAIN_APPLICATION_TITLE; |
| 461 | 461 | $doliurl = ''; |
| 462 | 462 | if (preg_match('/\d\.\d/', $appli)) { |
| 463 | - if (!preg_match('/' . preg_quote(DOL_VERSION) . '/', $appli)) |
|
| 464 | - $appli .= " (" . DOL_VERSION . ")"; // If new title contains a version that is different than core |
|
| 463 | + if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) |
|
| 464 | + $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core |
|
| 465 | 465 | } else |
| 466 | - $appli .= " " . DOL_VERSION; |
|
| 466 | + $appli .= " ".DOL_VERSION; |
|
| 467 | 467 | } else |
| 468 | - $appli .= " " . DOL_VERSION; |
|
| 468 | + $appli .= " ".DOL_VERSION; |
|
| 469 | 469 | print '<div id="blockvmenuhelpapp" class="blockvmenuhelp">'; |
| 470 | 470 | if ($doliurl) |
| 471 | - print '<a class="help" target="_blank" rel="noopener" href="' . $doliurl . '">'; |
|
| 471 | + print '<a class="help" target="_blank" rel="noopener" href="'.$doliurl.'">'; |
|
| 472 | 472 | else |
| 473 | 473 | print '<span class="help">'; |
| 474 | 474 | print $appli; |
@@ -476,12 +476,12 @@ discard block |
||
| 476 | 476 | print '</a>'; |
| 477 | 477 | else |
| 478 | 478 | print '</span>'; |
| 479 | - print '</div>' . "\n"; |
|
| 479 | + print '</div>'."\n"; |
|
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | // Link to bugtrack |
| 483 | 483 | if (!empty(Globals::$conf->global->MAIN_BUGTRACK_ENABLELINK)) { |
| 484 | - require_once DOL_BASE_PATH . '/core/lib/functions2.lib.php'; |
|
| 484 | + require_once DOL_BASE_PATH.'/core/lib/functions2.lib.php'; |
|
| 485 | 485 | |
| 486 | 486 | $bugbaseurl = 'https://github.com/Dolibarr/dolibarr/issues/new'; |
| 487 | 487 | $bugbaseurl .= '?title='; |
@@ -490,16 +490,16 @@ discard block |
||
| 490 | 490 | $bugbaseurl .= urlencode("# Bug\n"); |
| 491 | 491 | $bugbaseurl .= urlencode("\n"); |
| 492 | 492 | $bugbaseurl .= urlencode("## Environment\n"); |
| 493 | - $bugbaseurl .= urlencode("- **Version**: " . DOL_VERSION . "\n"); |
|
| 494 | - $bugbaseurl .= urlencode("- **OS**: " . php_uname('s') . "\n"); |
|
| 495 | - $bugbaseurl .= urlencode("- **Web server**: " . $_SERVER["SERVER_SOFTWARE"] . "\n"); |
|
| 496 | - $bugbaseurl .= urlencode("- **PHP**: " . php_sapi_name() . ' ' . phpversion() . "\n"); |
|
| 497 | - $bugbaseurl .= urlencode("- **Database**: " . $db::LABEL . ' ' . $db->getVersion() . "\n"); |
|
| 498 | - $bugbaseurl .= urlencode("- **URL**: " . $_SERVER["REQUEST_URI"] . "\n"); |
|
| 493 | + $bugbaseurl .= urlencode("- **Version**: ".DOL_VERSION."\n"); |
|
| 494 | + $bugbaseurl .= urlencode("- **OS**: ".php_uname('s')."\n"); |
|
| 495 | + $bugbaseurl .= urlencode("- **Web server**: ".$_SERVER["SERVER_SOFTWARE"]."\n"); |
|
| 496 | + $bugbaseurl .= urlencode("- **PHP**: ".php_sapi_name().' '.phpversion()."\n"); |
|
| 497 | + $bugbaseurl .= urlencode("- **Database**: ".$db::LABEL.' '.$db->getVersion()."\n"); |
|
| 498 | + $bugbaseurl .= urlencode("- **URL**: ".$_SERVER["REQUEST_URI"]."\n"); |
|
| 499 | 499 | $bugbaseurl .= urlencode("\n"); |
| 500 | 500 | $bugbaseurl .= urlencode("## Report\n"); |
| 501 | 501 | print '<div id="blockvmenuhelpbugreport" class="blockvmenuhelp">'; |
| 502 | - print '<a class="help" target="_blank" rel="noopener" href="' . $bugbaseurl . '">' . Globals::$langs->trans("FindBug") . '</a>'; |
|
| 502 | + print '<a class="help" target="_blank" rel="noopener" href="'.$bugbaseurl.'">'.Globals::$langs->trans("FindBug").'</a>'; |
|
| 503 | 503 | print '</div>'; |
| 504 | 504 | } |
| 505 | 505 | |
@@ -513,14 +513,14 @@ discard block |
||
| 513 | 513 | |
| 514 | 514 | // Execute hook printLeftBlock |
| 515 | 515 | $parameters = array(); |
| 516 | - $reshook = Globals::$hookManager->executeHooks('printLeftBlock', $parameters); // Note that $action and $object may have been modified by some hooks |
|
| 516 | + $reshook = Globals::$hookManager->executeHooks('printLeftBlock', $parameters); // Note that $action and $object may have been modified by some hooks |
|
| 517 | 517 | print Globals::$hookManager->resPrint; |
| 518 | 518 | |
| 519 | 519 | print '</div></div> <!-- End side-nav id-left -->'; // End div id="side-nav" div id="id-left" |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | print "\n"; |
| 523 | - print '<!-- Begin right area -->' . "\n"; |
|
| 523 | + print '<!-- Begin right area -->'."\n"; |
|
| 524 | 524 | |
| 525 | 525 | if (empty($leftmenuwithoutmainarea)) |
| 526 | 526 | main_area($title); |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | |
| 542 | 542 | print "\n"; |
| 543 | 543 | |
| 544 | - print '<!-- Begin div class="fiche" -->' . "\n" . '<div class="fiche">' . "\n"; |
|
| 544 | + print '<!-- Begin div class="fiche" -->'."\n".'<div class="fiche">'."\n"; |
|
| 545 | 545 | |
| 546 | 546 | if (!empty(Globals::$conf->global->MAIN_ONLY_LOGIN_ALLOWED)) |
| 547 | 547 | print info_admin(Globals::$langs->trans("WarningYouAreInMaintenanceMode", Globals::$conf->global->MAIN_ONLY_LOGIN_ALLOWED)); |
@@ -607,17 +607,17 @@ discard block |
||
| 607 | 607 | // global Globals::$conf, Globals::$langs, Globals::$user; |
| 608 | 608 | |
| 609 | 609 | $ret = ''; |
| 610 | - $ret .= '<form action="' . $urlaction . '" method="post" class="searchform">'; |
|
| 611 | - $ret .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; |
|
| 610 | + $ret .= '<form action="'.$urlaction.'" method="post" class="searchform">'; |
|
| 611 | + $ret .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; |
|
| 612 | 612 | $ret .= '<input type="hidden" name="mode" value="search">'; |
| 613 | - $ret .= '<input type="hidden" name="savelogin" value="' . dol_escape_htmltag(Globals::$user->login) . '">'; |
|
| 613 | + $ret .= '<input type="hidden" name="savelogin" value="'.dol_escape_htmltag(Globals::$user->login).'">'; |
|
| 614 | 614 | if ($showtitlebefore) |
| 615 | - $ret .= $title . ' '; |
|
| 616 | - $ret .= '<input type="text" class="flat ' . $htmlmorecss . '"'; |
|
| 617 | - $ret .= ' style="text-indent: 22px; background-image: url(\'' . $img . '\'); background-repeat: no-repeat; background-position: 3px;"'; |
|
| 618 | - $ret .= ($accesskey ? ' accesskey="' . $accesskey . '"' : ''); |
|
| 619 | - $ret .= ' placeholder="' . strip_tags($title) . '"'; |
|
| 620 | - $ret .= ' name="' . $htmlinputname . '" id="' . $prefhtmlinputname . $htmlinputname . '" />'; |
|
| 615 | + $ret .= $title.' '; |
|
| 616 | + $ret .= '<input type="text" class="flat '.$htmlmorecss.'"'; |
|
| 617 | + $ret .= ' style="text-indent: 22px; background-image: url(\''.$img.'\'); background-repeat: no-repeat; background-position: 3px;"'; |
|
| 618 | + $ret .= ($accesskey ? ' accesskey="'.$accesskey.'"' : ''); |
|
| 619 | + $ret .= ' placeholder="'.strip_tags($title).'"'; |
|
| 620 | + $ret .= ' name="'.$htmlinputname.'" id="'.$prefhtmlinputname.$htmlinputname.'" />'; |
|
| 621 | 621 | //$ret.='<input type="submit" class="button" style="padding-top: 4px; padding-bottom: 4px; padding-left: 6px; padding-right: 6px" value="'.Globals::$langs->trans("Go").'">'; |
| 622 | 622 | $ret .= '<button type="submit" class="button" style="padding-top: 4px; padding-bottom: 4px; padding-left: 6px; padding-right: 6px">'; |
| 623 | 623 | $ret .= '<span class="fa fa-search"></span>'; |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | // global $delayedhtmlcontent; |
| 643 | 643 | // global $contextpage, $page, $limit; |
| 644 | 644 | |
| 645 | - $ext = 'layout=' . Globals::$conf->browser->layout . '&version=' . urlencode(DOL_VERSION); |
|
| 645 | + $ext = 'layout='.Globals::$conf->browser->layout.'&version='.urlencode(DOL_VERSION); |
|
| 646 | 646 | |
| 647 | 647 | // Global html output events ($mesgs, $errors, $warnings) |
| 648 | 648 | dol_htmloutput_events($disabledoutputofmessages); |
@@ -652,15 +652,15 @@ discard block |
||
| 652 | 652 | if (is_object(Globals::$user) && !empty(Globals::$user->lastsearch_values_tmp) && is_array(Globals::$user->lastsearch_values_tmp)) { |
| 653 | 653 | // Clean and save data |
| 654 | 654 | foreach (Globals::$user->lastsearch_values_tmp as $key => $val) { |
| 655 | - unset($_SESSION['lastsearch_values_tmp_' . $key]); // Clean array to rebuild it just after |
|
| 655 | + unset($_SESSION['lastsearch_values_tmp_'.$key]); // Clean array to rebuild it just after |
|
| 656 | 656 | if (count($val) && empty($_POST['button_removefilter'])) { // If there is search criteria to save and we did not click on 'Clear filter' button |
| 657 | 657 | if (empty($val['sortfield'])) |
| 658 | 658 | unset($val['sortfield']); |
| 659 | 659 | if (empty($val['sortorder'])) |
| 660 | 660 | unset($val['sortorder']); |
| 661 | - dol_syslog('Save lastsearch_values_tmp_' . $key . '=' . json_encode($val, 0) . " (systematic recording of last search criterias)"); |
|
| 662 | - $_SESSION['lastsearch_values_tmp_' . $key] = json_encode($val); |
|
| 663 | - unset($_SESSION['lastsearch_values_' . $key]); |
|
| 661 | + dol_syslog('Save lastsearch_values_tmp_'.$key.'='.json_encode($val, 0)." (systematic recording of last search criterias)"); |
|
| 662 | + $_SESSION['lastsearch_values_tmp_'.$key] = json_encode($val); |
|
| 663 | + unset($_SESSION['lastsearch_values_'.$key]); |
|
| 664 | 664 | } |
| 665 | 665 | } |
| 666 | 666 | } |
@@ -669,37 +669,37 @@ discard block |
||
| 669 | 669 | $relativepathstring = $_SERVER["PHP_SELF"]; |
| 670 | 670 | // Clean $relativepathstring |
| 671 | 671 | if (constant('DOL_BASE_URI')) |
| 672 | - $relativepathstring = preg_replace('/^' . preg_quote(constant('DOL_BASE_URI'), '/') . '/', '', $relativepathstring); |
|
| 672 | + $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_BASE_URI'), '/').'/', '', $relativepathstring); |
|
| 673 | 673 | $relativepathstring = preg_replace('/^\//', '', $relativepathstring); |
| 674 | 674 | $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring); |
| 675 | 675 | if (preg_match('/list\.php$/', $relativepathstring)) { |
| 676 | - unset($_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring]); |
|
| 677 | - unset($_SESSION['lastsearch_page_tmp_' . $relativepathstring]); |
|
| 678 | - unset($_SESSION['lastsearch_limit_tmp_' . $relativepathstring]); |
|
| 676 | + unset($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]); |
|
| 677 | + unset($_SESSION['lastsearch_page_tmp_'.$relativepathstring]); |
|
| 678 | + unset($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]); |
|
| 679 | 679 | |
| 680 | 680 | if (!empty($contextpage)) |
| 681 | - $_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring] = $contextpage; |
|
| 681 | + $_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring] = $contextpage; |
|
| 682 | 682 | if (!empty($page) && $page > 1) |
| 683 | - $_SESSION['lastsearch_page_tmp_' . $relativepathstring] = $page; |
|
| 683 | + $_SESSION['lastsearch_page_tmp_'.$relativepathstring] = $page; |
|
| 684 | 684 | if (!empty($limit) && $limit != Globals::$conf->limit) |
| 685 | - $_SESSION['lastsearch_limit_tmp_' . $relativepathstring] = $limit; |
|
| 685 | + $_SESSION['lastsearch_limit_tmp_'.$relativepathstring] = $limit; |
|
| 686 | 686 | |
| 687 | - unset($_SESSION['lastsearch_contextpage_' . $relativepathstring]); |
|
| 688 | - unset($_SESSION['lastsearch_page_' . $relativepathstring]); |
|
| 689 | - unset($_SESSION['lastsearch_limit_' . $relativepathstring]); |
|
| 687 | + unset($_SESSION['lastsearch_contextpage_'.$relativepathstring]); |
|
| 688 | + unset($_SESSION['lastsearch_page_'.$relativepathstring]); |
|
| 689 | + unset($_SESSION['lastsearch_limit_'.$relativepathstring]); |
|
| 690 | 690 | } |
| 691 | 691 | |
| 692 | 692 | // Core error message |
| 693 | 693 | if (!empty(Globals::$conf->global->MAIN_CORE_ERROR)) { |
| 694 | 694 | // Ajax version |
| 695 | 695 | if (Globals::$conf->use_javascript_ajax) { |
| 696 | - $title = img_warning() . ' ' . Globals::$langs->trans('CoreErrorTitle'); |
|
| 696 | + $title = img_warning().' '.Globals::$langs->trans('CoreErrorTitle'); |
|
| 697 | 697 | print ajax_dialog($title, Globals::$langs->trans('CoreErrorMessage')); |
| 698 | 698 | } |
| 699 | 699 | // html version |
| 700 | 700 | else { |
| 701 | - $msg = img_warning() . ' ' . Globals::$langs->trans('CoreErrorMessage'); |
|
| 702 | - print '<div class="error">' . $msg . '</div>'; |
|
| 701 | + $msg = img_warning().' '.Globals::$langs->trans('CoreErrorMessage'); |
|
| 702 | + print '<div class="error">'.$msg.'</div>'; |
|
| 703 | 703 | } |
| 704 | 704 | |
| 705 | 705 | //define("MAIN_CORE_ERROR",0); // Constant was defined and we can't change value of a constant |
@@ -707,17 +707,17 @@ discard block |
||
| 707 | 707 | |
| 708 | 708 | print "\n\n"; |
| 709 | 709 | |
| 710 | - print '</div> <!-- End div class="fiche" -->' . "\n"; // End div fiche |
|
| 710 | + print '</div> <!-- End div class="fiche" -->'."\n"; // End div fiche |
|
| 711 | 711 | |
| 712 | 712 | if (empty(Globals::$conf->dol_hide_leftmenu)) |
| 713 | - print '</div> <!-- End div id-right -->' . "\n"; // End div id-right |
|
| 713 | + print '</div> <!-- End div id-right -->'."\n"; // End div id-right |
|
| 714 | 714 | |
| 715 | 715 | if (empty(Globals::$conf->dol_hide_leftmenu) && empty(Globals::$conf->dol_use_jmobile)) |
| 716 | - print '</div> <!-- End div id-container -->' . "\n"; // End div container |
|
| 716 | + print '</div> <!-- End div id-container -->'."\n"; // End div container |
|
| 717 | 717 | |
| 718 | 718 | print "\n"; |
| 719 | 719 | if ($comment) |
| 720 | - print '<!-- ' . $comment . ' -->' . "\n"; |
|
| 720 | + print '<!-- '.$comment.' -->'."\n"; |
|
| 721 | 721 | |
| 722 | 722 | printCommonFooter($zone); |
| 723 | 723 | |
@@ -725,8 +725,8 @@ discard block |
||
| 725 | 725 | print $delayedhtmlcontent; |
| 726 | 726 | |
| 727 | 727 | if (!empty(Globals::$conf->use_javascript_ajax)) { |
| 728 | - print "\n" . '<!-- Includes JS Footer of Dolibarr -->' . "\n"; |
|
| 729 | - print '<script type="text/javascript" src="' . BASE_URI . '?controller=core/js/&method=lib_foot.js&lang=' . Globals::$langs->defaultlang . ($ext ? '&' . $ext : '') . '"></script>' . "\n"; |
|
| 728 | + print "\n".'<!-- Includes JS Footer of Dolibarr -->'."\n"; |
|
| 729 | + print '<script type="text/javascript" src="'.BASE_URI.'?controller=core/js/&method=lib_foot.js&lang='.Globals::$langs->defaultlang.($ext ? '&'.$ext : '').'"></script>'."\n"; |
|
| 730 | 730 | } |
| 731 | 731 | |
| 732 | 732 | // Wrapper to add log when clicking on download or preview |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | <script type="text/javascript"> |
| 739 | 739 | jQuery(document).ready(function () { |
| 740 | 740 | $('a.documentpreview').click(function () { |
| 741 | - $.post('<?php echo DOL_BASE_URI . "/blockedlog/ajax/block-add.php" ?>' |
|
| 741 | + $.post('<?php echo DOL_BASE_URI."/blockedlog/ajax/block-add.php" ?>' |
|
| 742 | 742 | , { |
| 743 | 743 | id:<?php echo $object->id; ?> |
| 744 | 744 | , element: '<?php echo $object->element ?>' |
@@ -747,7 +747,7 @@ discard block |
||
| 747 | 747 | ); |
| 748 | 748 | }); |
| 749 | 749 | $('a.documentdownload').click(function () { |
| 750 | - $.post('<?php echo DOL_BASE_URI . "/blockedlog/ajax/block-add.php" ?>' |
|
| 750 | + $.post('<?php echo DOL_BASE_URI."/blockedlog/ajax/block-add.php" ?>' |
|
| 751 | 751 | , { |
| 752 | 752 | id:<?php echo $object->id; ?> |
| 753 | 753 | , element: '<?php echo $object->element ?>' |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | |
| 764 | 764 | // A div for the address popup |
| 765 | 765 | print "\n<!-- A div to allow dialog popup -->\n"; |
| 766 | - print '<div id="dialogforpopup" style="display: none;"></div>' . "\n"; |
|
| 766 | + print '<div id="dialogforpopup" style="display: none;"></div>'."\n"; |
|
| 767 | 767 | |
| 768 | 768 | print "</body>\n"; |
| 769 | 769 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | public $skype; |
| 56 | 56 | public $twitter; |
| 57 | 57 | public $facebook; |
| 58 | - public $job; // job position |
|
| 58 | + public $job; // job position |
|
| 59 | 59 | public $signature; |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | public $address; |
| 65 | 65 | public $zip; |
| 66 | 66 | public $town; |
| 67 | - public $state_id; // The state/department |
|
| 67 | + public $state_id; // The state/department |
|
| 68 | 68 | public $state_code; |
| 69 | 69 | public $state; |
| 70 | 70 | public $office_phone; |
@@ -118,26 +118,26 @@ discard block |
||
| 118 | 118 | public $datepreviouslogin; |
| 119 | 119 | public $photo; |
| 120 | 120 | public $lang; |
| 121 | - public $rights; // Array of permissions user->rights->permx |
|
| 122 | - public $all_permissions_are_loaded; // All permission are loaded |
|
| 123 | - public $nb_rights; // Number of rights granted to the user |
|
| 124 | - private $_tab_loaded = array(); // Cache array of already loaded permissions |
|
| 125 | - public $conf; // To store personal config |
|
| 126 | - public $default_values; // To store default values for user |
|
| 127 | - public $lastsearch_values_tmp; // To store current search criterias for user |
|
| 128 | - public $lastsearch_values; // To store last saved search criterias for user |
|
| 129 | - public $users = array(); // To store all tree of users hierarchy |
|
| 130 | - public $parentof; // To store an array of all parents for all ids. |
|
| 121 | + public $rights; // Array of permissions user->rights->permx |
|
| 122 | + public $all_permissions_are_loaded; // All permission are loaded |
|
| 123 | + public $nb_rights; // Number of rights granted to the user |
|
| 124 | + private $_tab_loaded = array(); // Cache array of already loaded permissions |
|
| 125 | + public $conf; // To store personal config |
|
| 126 | + public $default_values; // To store default values for user |
|
| 127 | + public $lastsearch_values_tmp; // To store current search criterias for user |
|
| 128 | + public $lastsearch_values; // To store last saved search criterias for user |
|
| 129 | + public $users = array(); // To store all tree of users hierarchy |
|
| 130 | + public $parentof; // To store an array of all parents for all ids. |
|
| 131 | 131 | private $cache_childids; |
| 132 | - public $accountancy_code; // Accountancy code in prevision of the complete accountancy module |
|
| 133 | - public $thm; // Average cost of employee - Used for valuation of time spent |
|
| 134 | - public $tjm; // Average cost of employee |
|
| 135 | - public $salary; // Monthly salary - Denormalized value from llx_user_employment |
|
| 136 | - public $salaryextra; // Monthly salary extra - Denormalized value from llx_user_employment |
|
| 137 | - public $weeklyhours; // Weekly hours - Denormalized value from llx_user_employment |
|
| 138 | - public $color; // Define background color for user in agenda |
|
| 139 | - public $dateemployment; // Define date of employment by company |
|
| 140 | - public $dateemploymentend; // Define date of employment end by company |
|
| 132 | + public $accountancy_code; // Accountancy code in prevision of the complete accountancy module |
|
| 133 | + public $thm; // Average cost of employee - Used for valuation of time spent |
|
| 134 | + public $tjm; // Average cost of employee |
|
| 135 | + public $salary; // Monthly salary - Denormalized value from llx_user_employment |
|
| 136 | + public $salaryextra; // Monthly salary extra - Denormalized value from llx_user_employment |
|
| 137 | + public $weeklyhours; // Weekly hours - Denormalized value from llx_user_employment |
|
| 138 | + public $color; // Define background color for user in agenda |
|
| 139 | + public $dateemployment; // Define date of employment by company |
|
| 140 | + public $dateemploymentend; // Define date of employment end by company |
|
| 141 | 141 | public $default_c_exp_tax_cat; |
| 142 | 142 | public $default_range; |
| 143 | 143 | public $fields = array( |
@@ -212,37 +212,37 @@ discard block |
||
| 212 | 212 | $sql .= " u.color,"; |
| 213 | 213 | $sql .= " u.dateemployment, u.dateemploymentend,"; |
| 214 | 214 | $sql .= " u.ref_int, u.ref_ext,"; |
| 215 | - $sql .= " u.default_range, u.default_c_exp_tax_cat,"; // Expense report default mode |
|
| 215 | + $sql .= " u.default_range, u.default_c_exp_tax_cat,"; // Expense report default mode |
|
| 216 | 216 | $sql .= " c.code as country_code, c.label as country,"; |
| 217 | 217 | $sql .= " d.code_departement as state_code, d.nom as state"; |
| 218 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user as u"; |
|
| 219 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as c ON u.fk_country = c.rowid"; |
|
| 220 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_departements as d ON u.fk_state = d.rowid"; |
|
| 218 | + $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; |
|
| 219 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON u.fk_country = c.rowid"; |
|
| 220 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d ON u.fk_state = d.rowid"; |
|
| 221 | 221 | |
| 222 | 222 | if ($entity < 0) {
|
| 223 | 223 | if ((empty($conf->multicompany->enabled) || empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) && (!empty(Globals::$user->entity))) {
|
| 224 | - $sql .= " WHERE u.entity IN (0," . Globals::$conf->entity . ")"; |
|
| 224 | + $sql .= " WHERE u.entity IN (0,".Globals::$conf->entity.")"; |
|
| 225 | 225 | } else {
|
| 226 | - $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 |
|
| 226 | + $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 |
|
| 227 | 227 | } |
| 228 | 228 | } else { // The fetch was forced on an entity
|
| 229 | 229 | if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
| 230 | - $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 |
|
| 230 | + $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 |
|
| 231 | 231 | } else {
|
| 232 | - $sql .= " WHERE u.entity IN (0, " . (($entity != '' && $entity >= 0) ? $entity : Globals::$conf->entity) . ")"; // search in entity provided in parameter |
|
| 232 | + $sql .= " WHERE u.entity IN (0, ".(($entity != '' && $entity >= 0) ? $entity : Globals::$conf->entity).")"; // search in entity provided in parameter |
|
| 233 | 233 | } |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | if ($sid) { // permet une recherche du user par son SID ActiveDirectory ou Samba
|
| 237 | 237 | //$sql .= " AND (u.ldap_sid = '" . Config::$dbEngine->escape($sid) . "' OR u.login = '" . Config::$dbEngine->escape($login) . "') LIMIT 1"; |
| 238 | - $sql .= " AND (u.ldap_sid = '" . $sid . "' OR u.login = '" . Config::$dbEngine->escape($login) . "') LIMIT 1"; |
|
| 238 | + $sql .= " AND (u.ldap_sid = '".$sid."' OR u.login = '".Config::$dbEngine->escape($login)."') LIMIT 1"; |
|
| 239 | 239 | } else if ($login) {
|
| 240 | 240 | // $sql .= " AND u.login = '" . Config::$dbEngine->escape($login) . "'"; |
| 241 | - $sql .= " AND u.login = '" . $login . "'"; |
|
| 241 | + $sql .= " AND u.login = '".$login."'"; |
|
| 242 | 242 | } else {
|
| 243 | - $sql .= " AND u.rowid = " . $id; |
|
| 243 | + $sql .= " AND u.rowid = ".$id; |
|
| 244 | 244 | } |
| 245 | - $sql .= " ORDER BY u.entity ASC"; // Avoid random result when there is 2 login in 2 different entities |
|
| 245 | + $sql .= " ORDER BY u.entity ASC"; // Avoid random result when there is 2 login in 2 different entities |
|
| 246 | 246 | |
| 247 | 247 | $result = Config::$dbEngine->select($sql); |
| 248 | 248 | // echo "<p>SQL in 2477 of User: '$sql'</p>"; |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | $this->datelastlogin = $obj->datel; |
| 329 | 329 | $this->datepreviouslogin = $obj->datep; |
| 330 | 330 | |
| 331 | - $this->societe_id = $obj->fk_soc; // deprecated |
|
| 331 | + $this->societe_id = $obj->fk_soc; // deprecated |
|
| 332 | 332 | $this->contact_id = $obj->fk_socpeople; // deprecated |
| 333 | 333 | $this->socid = $obj->fk_soc; |
| 334 | 334 | $this->contactid = $obj->fk_socpeople; |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | $this->fetch_optionals(); |
| 350 | 350 | } else {
|
| 351 | 351 | $this->error = "USERNOTFOUND"; |
| 352 | - DolUtils::dol_syslog(get_class($this) . "::fetch user not found", LOG_DEBUG); |
|
| 352 | + DolUtils::dol_syslog(get_class($this)."::fetch user not found", LOG_DEBUG); |
|
| 353 | 353 | return 0; |
| 354 | 354 | } |
| 355 | 355 | } else {
|
@@ -360,9 +360,9 @@ discard block |
||
| 360 | 360 | // To get back the global configuration unique to the user |
| 361 | 361 | if ($loadpersonalconf) {
|
| 362 | 362 | // Load user->conf for user |
| 363 | - $sql = "SELECT param, value FROM " . MAIN_DB_PREFIX . "user_param"; |
|
| 364 | - $sql .= " WHERE fk_user = " . $this->id; |
|
| 365 | - $sql .= " AND entity = " . Globals::$conf->entity; |
|
| 363 | + $sql = "SELECT param, value FROM ".MAIN_DB_PREFIX."user_param"; |
|
| 364 | + $sql .= " WHERE fk_user = ".$this->id; |
|
| 365 | + $sql .= " AND entity = ".Globals::$conf->entity; |
|
| 366 | 366 | //DolUtils::dol_syslog(get_class($this).'::fetch load personalized conf', LOG_DEBUG); |
| 367 | 367 | $resql = Config::$dbEngine->select($sql); |
| 368 | 368 | if (is_array($resql)) {
|
@@ -400,9 +400,9 @@ discard block |
||
| 400 | 400 | // global $conf; |
| 401 | 401 | // Load user->default_values for user. TODO Save this in memcached ? |
| 402 | 402 | $sql = "SELECT rowid, entity, type, page, param, value"; |
| 403 | - $sql .= " FROM " . MAIN_DB_PREFIX . "default_values"; |
|
| 404 | - $sql .= " WHERE entity IN (" . ($this->entity > 0 ? $this->entity . ", " : "") . Globals::$conf->entity . ")"; // Entity of user (if defined) + current entity
|
|
| 405 | - $sql .= " AND user_id IN (0" . ($this->id > 0 ? ", " . $this->id : "") . ")"; // User 0 (all) + me (if defined) |
|
| 403 | + $sql .= " FROM ".MAIN_DB_PREFIX."default_values"; |
|
| 404 | + $sql .= " WHERE entity IN (".($this->entity > 0 ? $this->entity.", " : "").Globals::$conf->entity.")"; // Entity of user (if defined) + current entity
|
|
| 405 | + $sql .= " AND user_id IN (0".($this->id > 0 ? ", ".$this->id : "").")"; // User 0 (all) + me (if defined) |
|
| 406 | 406 | $resql = Config::$dbEngine->select($sql); |
| 407 | 407 | if (is_array($resql)) {
|
| 408 | 408 | foreach ($resql as $array) {
|
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | |
| 451 | 451 | $entity = (!empty($entity) ? $entity : Globals::$conf->entity); |
| 452 | 452 | |
| 453 | - DolUtils::dol_syslog(get_class($this) . "::addrights $rid, $allmodule, $allperms, $entity"); |
|
| 453 | + DolUtils::dol_syslog(get_class($this)."::addrights $rid, $allmodule, $allperms, $entity"); |
|
| 454 | 454 | $error = 0; |
| 455 | 455 | $whereforadd = ''; |
| 456 | 456 | |
@@ -460,9 +460,9 @@ discard block |
||
| 460 | 460 | // Si on a demande ajout d'un droit en particulier, on recupere |
| 461 | 461 | // les caracteristiques (module, perms et subperms) de ce droit. |
| 462 | 462 | $sql = "SELECT module, perms, subperms"; |
| 463 | - $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def"; |
|
| 464 | - $sql .= " WHERE id = '" . Config::$dbEngine->escape($rid) . "'"; |
|
| 465 | - $sql .= " AND entity = " . $entity; |
|
| 463 | + $sql .= " FROM ".MAIN_DB_PREFIX."rights_def"; |
|
| 464 | + $sql .= " WHERE id = '".Config::$dbEngine->escape($rid)."'"; |
|
| 465 | + $sql .= " AND entity = ".$entity; |
|
| 466 | 466 | |
| 467 | 467 | $result = Config::$dbEngine->query($sql); |
| 468 | 468 | if ($result) {
|
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | // Where pour la liste des droits a ajouter |
| 479 | - $whereforadd = "id=" . Config::$dbEngine->escape($rid); |
|
| 479 | + $whereforadd = "id=".Config::$dbEngine->escape($rid); |
|
| 480 | 480 | // Ajout des droits induits |
| 481 | 481 | if (!empty($subperms)) {
|
| 482 | 482 | $whereforadd .= " OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))"; |
@@ -493,9 +493,9 @@ discard block |
||
| 493 | 493 | if ($allmodule == 'allmodules') {
|
| 494 | 494 | $whereforadd = 'allmodules'; |
| 495 | 495 | } else {
|
| 496 | - $whereforadd = "module='" . Config::$dbEngine->escape($allmodule) . "'"; |
|
| 496 | + $whereforadd = "module='".Config::$dbEngine->escape($allmodule)."'"; |
|
| 497 | 497 | if (!empty($allperms)) {
|
| 498 | - $whereforadd .= " AND perms='" . Config::$dbEngine->escape($allperms) . "'"; |
|
| 498 | + $whereforadd .= " AND perms='".Config::$dbEngine->escape($allperms)."'"; |
|
| 499 | 499 | } |
| 500 | 500 | } |
| 501 | 501 | } |
@@ -505,10 +505,10 @@ discard block |
||
| 505 | 505 | if (!empty($whereforadd)) {
|
| 506 | 506 | //print "$module-$perms-$subperms"; |
| 507 | 507 | $sql = "SELECT id"; |
| 508 | - $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def"; |
|
| 509 | - $sql .= " WHERE entity = " . $entity; |
|
| 508 | + $sql .= " FROM ".MAIN_DB_PREFIX."rights_def"; |
|
| 509 | + $sql .= " WHERE entity = ".$entity; |
|
| 510 | 510 | if (!empty($whereforadd) && $whereforadd != 'allmodules') {
|
| 511 | - $sql .= " AND " . $whereforadd; |
|
| 511 | + $sql .= " AND ".$whereforadd; |
|
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | $result = Config::$dbEngine->query($sql); |
@@ -519,10 +519,10 @@ discard block |
||
| 519 | 519 | $obj = Config::$dbEngine->fetch_object($result); |
| 520 | 520 | $nid = $obj->id; |
| 521 | 521 | |
| 522 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_rights WHERE fk_user = " . $this->id . " AND fk_id=" . $nid . " AND entity = " . $entity; |
|
| 522 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_rights WHERE fk_user = ".$this->id." AND fk_id=".$nid." AND entity = ".$entity; |
|
| 523 | 523 | if (!Config::$dbEngine->query($sql)) |
| 524 | 524 | $error++; |
| 525 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "user_rights (entity, fk_user, fk_id) VALUES (" . $entity . ", " . $this->id . ", " . $nid . ")";
|
|
| 525 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."user_rights (entity, fk_user, fk_id) VALUES (".$entity.", ".$this->id.", ".$nid.")";
|
|
| 526 | 526 | if (!Config::$dbEngine->query($sql)) |
| 527 | 527 | $error++; |
| 528 | 528 | |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | |
| 538 | 538 | if (!$error && !$notrigger) {
|
| 539 | 539 | Globals::$langs->load("other");
|
| 540 | - $this->context = array('audit' => Globals::$langs->trans("PermissionsAdd") . ($rid ? ' (id=' . $rid . ')' : ''));
|
|
| 540 | + $this->context = array('audit' => Globals::$langs->trans("PermissionsAdd").($rid ? ' (id='.$rid.')' : ''));
|
|
| 541 | 541 | |
| 542 | 542 | // Call trigger |
| 543 | 543 | $result = $this->call_trigger('USER_MODIFY', Globals::$user);
|
@@ -581,9 +581,9 @@ discard block |
||
| 581 | 581 | // Si on a demande supression d'un droit en particulier, on recupere |
| 582 | 582 | // les caracteristiques module, perms et subperms de ce droit. |
| 583 | 583 | $sql = "SELECT module, perms, subperms"; |
| 584 | - $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def"; |
|
| 585 | - $sql .= " WHERE id = '" . Config::$dbEngine->escape($rid) . "'"; |
|
| 586 | - $sql .= " AND entity = " . $entity; |
|
| 584 | + $sql .= " FROM ".MAIN_DB_PREFIX."rights_def"; |
|
| 585 | + $sql .= " WHERE id = '".Config::$dbEngine->escape($rid)."'"; |
|
| 586 | + $sql .= " AND entity = ".$entity; |
|
| 587 | 587 | |
| 588 | 588 | $result = Config::$dbEngine->query($sql); |
| 589 | 589 | if ($result) {
|
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | } |
| 598 | 598 | |
| 599 | 599 | // Where pour la liste des droits a supprimer |
| 600 | - $wherefordel = "id=" . Config::$dbEngine->escape($rid); |
|
| 600 | + $wherefordel = "id=".Config::$dbEngine->escape($rid); |
|
| 601 | 601 | // Suppression des droits induits |
| 602 | 602 | if ($subperms == 'lire' || $subperms == 'read') {
|
| 603 | 603 | $wherefordel .= " OR (module='$module' AND perms='$perms' AND subperms IS NOT NULL)"; |
@@ -612,9 +612,9 @@ discard block |
||
| 612 | 612 | if ($allmodule == 'allmodules') {
|
| 613 | 613 | $wherefordel = 'allmodules'; |
| 614 | 614 | } else {
|
| 615 | - $wherefordel = "module='" . Config::$dbEngine->escape($allmodule) . "'"; |
|
| 615 | + $wherefordel = "module='".Config::$dbEngine->escape($allmodule)."'"; |
|
| 616 | 616 | if (!empty($allperms)) {
|
| 617 | - $whereforadd .= " AND perms='" . Config::$dbEngine->escape($allperms) . "'"; |
|
| 617 | + $whereforadd .= " AND perms='".Config::$dbEngine->escape($allperms)."'"; |
|
| 618 | 618 | } |
| 619 | 619 | } |
| 620 | 620 | } |
@@ -624,10 +624,10 @@ discard block |
||
| 624 | 624 | if (!empty($wherefordel)) {
|
| 625 | 625 | //print "$module-$perms-$subperms"; |
| 626 | 626 | $sql = "SELECT id"; |
| 627 | - $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def"; |
|
| 628 | - $sql .= " WHERE entity = " . $entity; |
|
| 627 | + $sql .= " FROM ".MAIN_DB_PREFIX."rights_def"; |
|
| 628 | + $sql .= " WHERE entity = ".$entity; |
|
| 629 | 629 | if (!empty($wherefordel) && $wherefordel != 'allmodules') {
|
| 630 | - $sql .= " AND " . $wherefordel; |
|
| 630 | + $sql .= " AND ".$wherefordel; |
|
| 631 | 631 | } |
| 632 | 632 | |
| 633 | 633 | $result = Config::$dbEngine->query($sql); |
@@ -638,9 +638,9 @@ discard block |
||
| 638 | 638 | $obj = Config::$dbEngine->fetch_object($result); |
| 639 | 639 | $nid = $obj->id; |
| 640 | 640 | |
| 641 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_rights"; |
|
| 642 | - $sql .= " WHERE fk_user = " . $this->id . " AND fk_id=" . $nid; |
|
| 643 | - $sql .= " AND entity = " . $entity; |
|
| 641 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_rights"; |
|
| 642 | + $sql .= " WHERE fk_user = ".$this->id." AND fk_id=".$nid; |
|
| 643 | + $sql .= " AND entity = ".$entity; |
|
| 644 | 644 | if (!Config::$dbEngine->query($sql)) {
|
| 645 | 645 | $error++; |
| 646 | 646 | } |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | |
| 656 | 656 | if (!$error && !$notrigger) {
|
| 657 | 657 | Globals::$langs->load("other");
|
| 658 | - $this->context = array('audit' => Globals::$langs->trans("PermissionsDelete") . ($rid ? ' (id=' . $rid . ')' : ''));
|
|
| 658 | + $this->context = array('audit' => Globals::$langs->trans("PermissionsDelete").($rid ? ' (id='.$rid.')' : ''));
|
|
| 659 | 659 | |
| 660 | 660 | // Call trigger |
| 661 | 661 | $result = $this->call_trigger('USER_MODIFY', Globals::$user);
|
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | */ |
| 683 | 683 | function clearrights() |
| 684 | 684 | {
|
| 685 | - DolUtils::dol_syslog(get_class($this) . "::clearrights reset user->rights"); |
|
| 685 | + DolUtils::dol_syslog(get_class($this)."::clearrights reset user->rights"); |
|
| 686 | 686 | $this->rights = ''; |
| 687 | 687 | $this->all_permissions_are_loaded = false; |
| 688 | 688 | $this->_tab_loaded = array(); |
@@ -715,19 +715,19 @@ discard block |
||
| 715 | 715 | // Recuperation des droits utilisateurs + recuperation des droits groupes |
| 716 | 716 | // D'abord les droits utilisateurs |
| 717 | 717 | $sql = "SELECT DISTINCT r.module, r.perms, r.subperms"; |
| 718 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user_rights as ur"; |
|
| 719 | - $sql .= ", " . MAIN_DB_PREFIX . "rights_def as r"; |
|
| 718 | + $sql .= " FROM ".MAIN_DB_PREFIX."user_rights as ur"; |
|
| 719 | + $sql .= ", ".MAIN_DB_PREFIX."rights_def as r"; |
|
| 720 | 720 | $sql .= " WHERE r.id = ur.fk_id"; |
| 721 | 721 | if (!empty($conf->global->MULTICOMPANY_BACKWARD_COMPATIBILITY)) {
|
| 722 | - $sql .= " AND r.entity IN (0," . (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) ? "1," : "") . Globals::$conf->entity . ")"; |
|
| 722 | + $sql .= " AND r.entity IN (0,".(!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) ? "1," : "").Globals::$conf->entity.")"; |
|
| 723 | 723 | } else {
|
| 724 | - $sql .= " AND ur.entity = " . Globals::$conf->entity; |
|
| 724 | + $sql .= " AND ur.entity = ".Globals::$conf->entity; |
|
| 725 | 725 | } |
| 726 | - $sql .= " AND ur.fk_user= " . $this->id; |
|
| 726 | + $sql .= " AND ur.fk_user= ".$this->id; |
|
| 727 | 727 | $sql .= " AND r.perms IS NOT NULL"; |
| 728 | 728 | if ($moduletag) {
|
| 729 | 729 | // $sql .= " AND r.module = '" . Config::$dbEngine->escape($moduletag) . "'"; |
| 730 | - $sql .= " AND r.module = '" . $moduletag . "'"; |
|
| 730 | + $sql .= " AND r.module = '".$moduletag."'"; |
|
| 731 | 731 | } |
| 732 | 732 | |
| 733 | 733 | $resql = Config::$dbEngine->select($sql); |
@@ -768,25 +768,25 @@ discard block |
||
| 768 | 768 | |
| 769 | 769 | // Maintenant les droits groupes |
| 770 | 770 | $sql = "SELECT DISTINCT r.module, r.perms, r.subperms"; |
| 771 | - $sql .= " FROM " . MAIN_DB_PREFIX . "usergroup_rights as gr,"; |
|
| 772 | - $sql .= " " . MAIN_DB_PREFIX . "usergroup_user as gu,"; |
|
| 773 | - $sql .= " " . MAIN_DB_PREFIX . "rights_def as r"; |
|
| 771 | + $sql .= " FROM ".MAIN_DB_PREFIX."usergroup_rights as gr,"; |
|
| 772 | + $sql .= " ".MAIN_DB_PREFIX."usergroup_user as gu,"; |
|
| 773 | + $sql .= " ".MAIN_DB_PREFIX."rights_def as r"; |
|
| 774 | 774 | $sql .= " WHERE r.id = gr.fk_id"; |
| 775 | 775 | if (!empty($conf->global->MULTICOMPANY_BACKWARD_COMPATIBILITY)) {
|
| 776 | 776 | if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
| 777 | - $sql .= " AND gu.entity IN (0," . Globals::$conf->entity . ")"; |
|
| 777 | + $sql .= " AND gu.entity IN (0,".Globals::$conf->entity.")"; |
|
| 778 | 778 | } else {
|
| 779 | - $sql .= " AND r.entity = " . Globals::$conf->entity; |
|
| 779 | + $sql .= " AND r.entity = ".Globals::$conf->entity; |
|
| 780 | 780 | } |
| 781 | 781 | } else {
|
| 782 | - $sql .= " AND gr.entity = " . Globals::$conf->entity; |
|
| 783 | - $sql .= " AND r.entity = " . Globals::$conf->entity; |
|
| 782 | + $sql .= " AND gr.entity = ".Globals::$conf->entity; |
|
| 783 | + $sql .= " AND r.entity = ".Globals::$conf->entity; |
|
| 784 | 784 | } |
| 785 | 785 | $sql .= " AND gr.fk_usergroup = gu.fk_usergroup"; |
| 786 | - $sql .= " AND gu.fk_user = " . $this->id; |
|
| 786 | + $sql .= " AND gu.fk_user = ".$this->id; |
|
| 787 | 787 | $sql .= " AND r.perms IS NOT NULL"; |
| 788 | 788 | if ($moduletag) {
|
| 789 | - $sql .= " AND r.module = '" . $moduletag . "'"; |
|
| 789 | + $sql .= " AND r.module = '".$moduletag."'"; |
|
| 790 | 790 | } |
| 791 | 791 | |
| 792 | 792 | $resql = Config::$dbEngine->select($sql); |
@@ -866,12 +866,12 @@ discard block |
||
| 866 | 866 | Config::$dbEngine->begin(); |
| 867 | 867 | |
| 868 | 868 | // Deactivate user |
| 869 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user"; |
|
| 870 | - $sql .= " SET statut = " . $this->statut; |
|
| 871 | - $sql .= " WHERE rowid = " . $this->id; |
|
| 869 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user"; |
|
| 870 | + $sql .= " SET statut = ".$this->statut; |
|
| 871 | + $sql .= " WHERE rowid = ".$this->id; |
|
| 872 | 872 | $result = Config::$dbEngine->query($sql); |
| 873 | 873 | |
| 874 | - DolUtils::dol_syslog(get_class($this) . "::setstatus", LOG_DEBUG); |
|
| 874 | + DolUtils::dol_syslog(get_class($this)."::setstatus", LOG_DEBUG); |
|
| 875 | 875 | if ($result) {
|
| 876 | 876 | // Call trigger |
| 877 | 877 | $result = $this->call_trigger('USER_ENABLEDISABLE', Globals::$user);
|
@@ -908,7 +908,7 @@ discard block |
||
| 908 | 908 | } |
| 909 | 909 | |
| 910 | 910 | // Get current categories |
| 911 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 911 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 912 | 912 | $c = new Categorie(Config::$dbEngine); |
| 913 | 913 | $existing = $c->containing($this->id, Categorie::TYPE_USER, 'id'); |
| 914 | 914 | |
@@ -951,10 +951,10 @@ discard block |
||
| 951 | 951 | |
| 952 | 952 | $this->fetch($this->id); |
| 953 | 953 | |
| 954 | - DolUtils::dol_syslog(get_class($this) . "::delete", LOG_DEBUG); |
|
| 954 | + DolUtils::dol_syslog(get_class($this)."::delete", LOG_DEBUG); |
|
| 955 | 955 | |
| 956 | 956 | // Remove rights |
| 957 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_rights WHERE fk_user = " . $this->id; |
|
| 957 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_rights WHERE fk_user = ".$this->id; |
|
| 958 | 958 | |
| 959 | 959 | if (!$error && !Config::$dbEngine->query($sql)) {
|
| 960 | 960 | $error++; |
@@ -962,7 +962,7 @@ discard block |
||
| 962 | 962 | } |
| 963 | 963 | |
| 964 | 964 | // Remove group |
| 965 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "usergroup_user WHERE fk_user = " . $this->id; |
|
| 965 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."usergroup_user WHERE fk_user = ".$this->id; |
|
| 966 | 966 | if (!$error && !Config::$dbEngine->query($sql)) {
|
| 967 | 967 | $error++; |
| 968 | 968 | $this->error = Config::$dbEngine->lasterror(); |
@@ -970,7 +970,7 @@ discard block |
||
| 970 | 970 | |
| 971 | 971 | // If contact, remove link |
| 972 | 972 | if ($this->contact_id) {
|
| 973 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "socpeople SET fk_user_creat = null WHERE rowid = " . $this->contact_id; |
|
| 973 | + $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET fk_user_creat = null WHERE rowid = ".$this->contact_id; |
|
| 974 | 974 | if (!$error && !Config::$dbEngine->query($sql)) {
|
| 975 | 975 | $error++; |
| 976 | 976 | $this->error = Config::$dbEngine->lasterror(); |
@@ -982,14 +982,14 @@ discard block |
||
| 982 | 982 | $result = $this->deleteExtraFields(); |
| 983 | 983 | if ($result < 0) {
|
| 984 | 984 | $error++; |
| 985 | - DolUtils::dol_syslog(get_class($this) . "::delete error -4 " . $this->error, LOG_ERR); |
|
| 985 | + DolUtils::dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); |
|
| 986 | 986 | } |
| 987 | 987 | } |
| 988 | 988 | |
| 989 | 989 | // Remove user |
| 990 | 990 | if (!$error) {
|
| 991 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user WHERE rowid = " . $this->id; |
|
| 992 | - DolUtils::dol_syslog(get_class($this) . "::delete", LOG_DEBUG); |
|
| 991 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".$this->id; |
|
| 992 | + DolUtils::dol_syslog(get_class($this)."::delete", LOG_DEBUG); |
|
| 993 | 993 | if (!Config::$dbEngine->query($sql)) {
|
| 994 | 994 | $error++; |
| 995 | 995 | $this->error = Config::$dbEngine->lasterror(); |
@@ -1030,7 +1030,7 @@ discard block |
||
| 1030 | 1030 | if (!isset($this->entity)) {
|
| 1031 | 1031 | $this->entity = Globals::$conf->entity; // If not defined, we use default value |
| 1032 | 1032 | } |
| 1033 | - DolUtils::dol_syslog(get_class($this) . "::create login=" . $this->login . ", user=" . (is_object(Globals::$user) ? Globals::$user->id : ''), LOG_DEBUG); |
|
| 1033 | + DolUtils::dol_syslog(get_class($this)."::create login=".$this->login.", user=".(is_object(Globals::$user) ? Globals::$user->id : ''), LOG_DEBUG); |
|
| 1034 | 1034 | |
| 1035 | 1035 | // Check parameters |
| 1036 | 1036 | if (!empty($conf->global->USER_MAIL_REQUIRED) && !isValidEMail($this->email)) {
|
@@ -1049,11 +1049,11 @@ discard block |
||
| 1049 | 1049 | $error = 0; |
| 1050 | 1050 | Config::$dbEngine->begin(); |
| 1051 | 1051 | |
| 1052 | - $sql = "SELECT login FROM " . MAIN_DB_PREFIX . "user"; |
|
| 1053 | - $sql .= " WHERE login ='" . Config::$dbEngine->escape($this->login) . "'"; |
|
| 1054 | - $sql .= " AND entity IN (0," . Config::$dbEngine->escape($conf->entity) . ")"; |
|
| 1052 | + $sql = "SELECT login FROM ".MAIN_DB_PREFIX."user"; |
|
| 1053 | + $sql .= " WHERE login ='".Config::$dbEngine->escape($this->login)."'"; |
|
| 1054 | + $sql .= " AND entity IN (0,".Config::$dbEngine->escape($conf->entity).")"; |
|
| 1055 | 1055 | |
| 1056 | - DolUtils::dol_syslog(get_class($this) . "::create", LOG_DEBUG); |
|
| 1056 | + DolUtils::dol_syslog(get_class($this)."::create", LOG_DEBUG); |
|
| 1057 | 1057 | $resql = Config::$dbEngine->query($sql); |
| 1058 | 1058 | if ($resql) {
|
| 1059 | 1059 | $num = Config::$dbEngine->num_rows($resql); |
@@ -1061,17 +1061,17 @@ discard block |
||
| 1061 | 1061 | |
| 1062 | 1062 | if ($num) {
|
| 1063 | 1063 | $this->error = 'ErrorLoginAlreadyExists'; |
| 1064 | - DolUtils::dol_syslog(get_class($this) . "::create " . $this->error, LOG_WARNING); |
|
| 1064 | + DolUtils::dol_syslog(get_class($this)."::create ".$this->error, LOG_WARNING); |
|
| 1065 | 1065 | Config::$dbEngine->rollback(); |
| 1066 | 1066 | return -6; |
| 1067 | 1067 | } else {
|
| 1068 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "user (datec,login,ldap_sid,entity)"; |
|
| 1069 | - $sql .= " VALUES('" . Config::$dbEngine->idate($this->datec) . "','" . Config::$dbEngine->escape($this->login) . "','" . Config::$dbEngine->escape($this->ldap_sid) . "'," . Config::$dbEngine->escape($this->entity) . ")";
|
|
| 1068 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."user (datec,login,ldap_sid,entity)"; |
|
| 1069 | + $sql .= " VALUES('".Config::$dbEngine->idate($this->datec)."','".Config::$dbEngine->escape($this->login)."','".Config::$dbEngine->escape($this->ldap_sid)."',".Config::$dbEngine->escape($this->entity).")";
|
|
| 1070 | 1070 | $result = Config::$dbEngine->query($sql); |
| 1071 | 1071 | |
| 1072 | - DolUtils::dol_syslog(get_class($this) . "::create", LOG_DEBUG); |
|
| 1072 | + DolUtils::dol_syslog(get_class($this)."::create", LOG_DEBUG); |
|
| 1073 | 1073 | if ($result) {
|
| 1074 | - $this->id = Config::$dbEngine->last_insert_id(MAIN_DB_PREFIX . "user"); |
|
| 1074 | + $this->id = Config::$dbEngine->last_insert_id(MAIN_DB_PREFIX."user"); |
|
| 1075 | 1075 | |
| 1076 | 1076 | // Set default rights |
| 1077 | 1077 | if ($this->set_default_rights() < 0) {
|
@@ -1088,7 +1088,7 @@ discard block |
||
| 1088 | 1088 | } |
| 1089 | 1089 | |
| 1090 | 1090 | if (!empty($conf->global->STOCK_USERSTOCK_AUTOCREATE)) {
|
| 1091 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
| 1091 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
| 1092 | 1092 | Globals::$langs->load("stocks");
|
| 1093 | 1093 | $entrepot = new Entrepot(Config::$dbEngine); |
| 1094 | 1094 | $entrepot->libelle = Globals::$langs->trans("PersonalStock", $this->getFullName(Globals::$langs));
|
@@ -1112,7 +1112,7 @@ discard block |
||
| 1112 | 1112 | return $this->id; |
| 1113 | 1113 | } else {
|
| 1114 | 1114 | //$this->error=$interface->error; |
| 1115 | - DolUtils::dol_syslog(get_class($this) . "::create " . $this->error, LOG_ERR); |
|
| 1115 | + DolUtils::dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); |
|
| 1116 | 1116 | Config::$dbEngine->rollback(); |
| 1117 | 1117 | return -3; |
| 1118 | 1118 | } |
@@ -1165,7 +1165,7 @@ discard block |
||
| 1165 | 1165 | $this->employee = 0; |
| 1166 | 1166 | |
| 1167 | 1167 | if (empty($login)) {
|
| 1168 | - $login = strtolower(substr($contact->firstname, 0, 4)) . strtolower(substr($contact->lastname, 0, 4)); |
|
| 1168 | + $login = strtolower(substr($contact->firstname, 0, 4)).strtolower(substr($contact->lastname, 0, 4)); |
|
| 1169 | 1169 | } |
| 1170 | 1170 | $this->login = $login; |
| 1171 | 1171 | |
@@ -1174,15 +1174,15 @@ discard block |
||
| 1174 | 1174 | // Cree et positionne $this->id |
| 1175 | 1175 | $result = $this->create(Globals::$user); |
| 1176 | 1176 | if ($result > 0) {
|
| 1177 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user"; |
|
| 1178 | - $sql .= " SET fk_socpeople=" . $contact->id; |
|
| 1177 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user"; |
|
| 1178 | + $sql .= " SET fk_socpeople=".$contact->id; |
|
| 1179 | 1179 | if ($contact->socid) {
|
| 1180 | - $sql .= ", fk_soc=" . $contact->socid; |
|
| 1180 | + $sql .= ", fk_soc=".$contact->socid; |
|
| 1181 | 1181 | } |
| 1182 | - $sql .= " WHERE rowid=" . $this->id; |
|
| 1182 | + $sql .= " WHERE rowid=".$this->id; |
|
| 1183 | 1183 | $resql = Config::$dbEngine->query($sql); |
| 1184 | 1184 | |
| 1185 | - DolUtils::dol_syslog(get_class($this) . "::create_from_contact", LOG_DEBUG); |
|
| 1185 | + DolUtils::dol_syslog(get_class($this)."::create_from_contact", LOG_DEBUG); |
|
| 1186 | 1186 | if ($resql) {
|
| 1187 | 1187 | $this->context['createfromcontact'] = 'createfromcontact'; |
| 1188 | 1188 | |
@@ -1205,7 +1205,7 @@ discard block |
||
| 1205 | 1205 | } |
| 1206 | 1206 | } else {
|
| 1207 | 1207 | // $this->error deja positionne |
| 1208 | - DolUtils::dol_syslog(get_class($this) . "::create_from_contact - 0"); |
|
| 1208 | + DolUtils::dol_syslog(get_class($this)."::create_from_contact - 0"); |
|
| 1209 | 1209 | |
| 1210 | 1210 | Config::$dbEngine->rollback(); |
| 1211 | 1211 | return $result; |
@@ -1239,7 +1239,7 @@ discard block |
||
| 1239 | 1239 | $this->country_id = $member->country_id; |
| 1240 | 1240 | |
| 1241 | 1241 | if (empty($login)) {
|
| 1242 | - $login = strtolower(substr($member->firstname, 0, 4)) . strtolower(substr($member->lastname, 0, 4)); |
|
| 1242 | + $login = strtolower(substr($member->firstname, 0, 4)).strtolower(substr($member->lastname, 0, 4)); |
|
| 1243 | 1243 | } |
| 1244 | 1244 | $this->login = $login; |
| 1245 | 1245 | |
@@ -1254,11 +1254,11 @@ discard block |
||
| 1254 | 1254 | } |
| 1255 | 1255 | |
| 1256 | 1256 | if ($result > 0 && $member->fk_soc) { // If member is linked to a thirdparty
|
| 1257 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user"; |
|
| 1258 | - $sql .= " SET fk_soc=" . $member->fk_soc; |
|
| 1259 | - $sql .= " WHERE rowid=" . $this->id; |
|
| 1257 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user"; |
|
| 1258 | + $sql .= " SET fk_soc=".$member->fk_soc; |
|
| 1259 | + $sql .= " WHERE rowid=".$this->id; |
|
| 1260 | 1260 | |
| 1261 | - DolUtils::dol_syslog(get_class($this) . "::create_from_member", LOG_DEBUG); |
|
| 1261 | + DolUtils::dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG); |
|
| 1262 | 1262 | $resql = Config::$dbEngine->query($sql); |
| 1263 | 1263 | if ($resql) {
|
| 1264 | 1264 | Config::$dbEngine->commit(); |
@@ -1293,9 +1293,9 @@ discard block |
||
| 1293 | 1293 | // phpcs:enable |
| 1294 | 1294 | global $conf; |
| 1295 | 1295 | |
| 1296 | - $sql = "SELECT id FROM " . MAIN_DB_PREFIX . "rights_def"; |
|
| 1296 | + $sql = "SELECT id FROM ".MAIN_DB_PREFIX."rights_def"; |
|
| 1297 | 1297 | $sql .= " WHERE bydefault = 1"; |
| 1298 | - $sql .= " AND entity = " . Globals::$conf->entity; |
|
| 1298 | + $sql .= " AND entity = ".Globals::$conf->entity; |
|
| 1299 | 1299 | |
| 1300 | 1300 | $resql = Config::$dbEngine->query($sql); |
| 1301 | 1301 | if ($resql) {
|
@@ -1312,10 +1312,10 @@ discard block |
||
| 1312 | 1312 | $i = 0; |
| 1313 | 1313 | while ($i < $num) {
|
| 1314 | 1314 | |
| 1315 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_rights WHERE fk_user = $this->id AND fk_id=$rd[$i]"; |
|
| 1315 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_rights WHERE fk_user = $this->id AND fk_id=$rd[$i]"; |
|
| 1316 | 1316 | $result = Config::$dbEngine->query($sql); |
| 1317 | 1317 | |
| 1318 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "user_rights (fk_user, fk_id) VALUES ($this->id, $rd[$i])"; |
|
| 1318 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."user_rights (fk_user, fk_id) VALUES ($this->id, $rd[$i])"; |
|
| 1319 | 1319 | $result = Config::$dbEngine->query($sql); |
| 1320 | 1320 | if (!$result) {
|
| 1321 | 1321 | return -1; |
@@ -1343,7 +1343,7 @@ discard block |
||
| 1343 | 1343 | $nbrowsaffected = 0; |
| 1344 | 1344 | $error = 0; |
| 1345 | 1345 | |
| 1346 | - DolUtils::dol_syslog(get_class($this) . "::update notrigger=" . $notrigger . ", nosyncmember=" . $nosyncmember . ", nosyncmemberpass=" . $nosyncmemberpass); |
|
| 1346 | + DolUtils::dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncmember=".$nosyncmember.", nosyncmemberpass=".$nosyncmemberpass); |
|
| 1347 | 1347 | |
| 1348 | 1348 | // Clean parameters |
| 1349 | 1349 | $this->lastname = trim($this->lastname); |
@@ -1371,7 +1371,7 @@ discard block |
||
| 1371 | 1371 | $this->job = trim($this->job); |
| 1372 | 1372 | $this->signature = trim($this->signature); |
| 1373 | 1373 | $this->note = trim($this->note); |
| 1374 | - $this->openid = trim(empty($this->openid) ? '' : $this->openid); // Avoid warning |
|
| 1374 | + $this->openid = trim(empty($this->openid) ? '' : $this->openid); // Avoid warning |
|
| 1375 | 1375 | $this->admin = $this->admin ? $this->admin : 0; |
| 1376 | 1376 | $this->address = empty($this->address) ? '' : $this->address; |
| 1377 | 1377 | $this->zip = empty($this->zip) ? '' : $this->zip; |
@@ -1396,59 +1396,59 @@ discard block |
||
| 1396 | 1396 | Config::$dbEngine->begin(); |
| 1397 | 1397 | |
| 1398 | 1398 | // Update datas |
| 1399 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user SET"; |
|
| 1400 | - $sql .= " lastname = '" . Config::$dbEngine->escape($this->lastname) . "'"; |
|
| 1401 | - $sql .= ", firstname = '" . Config::$dbEngine->escape($this->firstname) . "'"; |
|
| 1402 | - $sql .= ", employee = " . $this->employee; |
|
| 1403 | - $sql .= ", login = '" . Config::$dbEngine->escape($this->login) . "'"; |
|
| 1404 | - $sql .= ", api_key = " . ($this->api_key ? "'" . Config::$dbEngine->escape($this->api_key) . "'" : "null"); |
|
| 1405 | - $sql .= ", gender = " . ($this->gender != -1 ? "'" . Config::$dbEngine->escape($this->gender) . "'" : "null"); // 'man' or 'woman' |
|
| 1406 | - $sql .= ", birth=" . (strval($this->birth) != '' ? "'" . Config::$dbEngine->idate($this->birth) . "'" : 'null'); |
|
| 1399 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user SET"; |
|
| 1400 | + $sql .= " lastname = '".Config::$dbEngine->escape($this->lastname)."'"; |
|
| 1401 | + $sql .= ", firstname = '".Config::$dbEngine->escape($this->firstname)."'"; |
|
| 1402 | + $sql .= ", employee = ".$this->employee; |
|
| 1403 | + $sql .= ", login = '".Config::$dbEngine->escape($this->login)."'"; |
|
| 1404 | + $sql .= ", api_key = ".($this->api_key ? "'".Config::$dbEngine->escape($this->api_key)."'" : "null"); |
|
| 1405 | + $sql .= ", gender = ".($this->gender != -1 ? "'".Config::$dbEngine->escape($this->gender)."'" : "null"); // 'man' or 'woman' |
|
| 1406 | + $sql .= ", birth=".(strval($this->birth) != '' ? "'".Config::$dbEngine->idate($this->birth)."'" : 'null'); |
|
| 1407 | 1407 | if (!empty(Globals::$user->admin)) {
|
| 1408 | - $sql .= ", admin = " . $this->admin; // admin flag can be set/unset only by an admin user |
|
| 1409 | - } |
|
| 1410 | - $sql .= ", address = '" . Config::$dbEngine->escape($this->address) . "'"; |
|
| 1411 | - $sql .= ", zip = '" . Config::$dbEngine->escape($this->zip) . "'"; |
|
| 1412 | - $sql .= ", town = '" . Config::$dbEngine->escape($this->town) . "'"; |
|
| 1413 | - $sql .= ", fk_state = " . ((!empty($this->state_id) && $this->state_id > 0) ? "'" . Config::$dbEngine->escape($this->state_id) . "'" : "null"); |
|
| 1414 | - $sql .= ", fk_country = " . ((!empty($this->country_id) && $this->country_id > 0) ? "'" . Config::$dbEngine->escape($this->country_id) . "'" : "null"); |
|
| 1415 | - $sql .= ", office_phone = '" . Config::$dbEngine->escape($this->office_phone) . "'"; |
|
| 1416 | - $sql .= ", office_fax = '" . Config::$dbEngine->escape($this->office_fax) . "'"; |
|
| 1417 | - $sql .= ", user_mobile = '" . Config::$dbEngine->escape($this->user_mobile) . "'"; |
|
| 1418 | - $sql .= ", email = '" . Config::$dbEngine->escape($this->email) . "'"; |
|
| 1419 | - $sql .= ", skype = '" . Config::$dbEngine->escape($this->skype) . "'"; |
|
| 1420 | - $sql .= ", twitter = '" . Config::$dbEngine->escape($this->twitter) . "'"; |
|
| 1421 | - $sql .= ", facebook = '" . Config::$dbEngine->escape($this->facebook) . "'"; |
|
| 1422 | - $sql .= ", job = '" . Config::$dbEngine->escape($this->job) . "'"; |
|
| 1423 | - $sql .= ", signature = '" . Config::$dbEngine->escape($this->signature) . "'"; |
|
| 1424 | - $sql .= ", accountancy_code = '" . Config::$dbEngine->escape($this->accountancy_code) . "'"; |
|
| 1425 | - $sql .= ", color = '" . Config::$dbEngine->escape($this->color) . "'"; |
|
| 1426 | - $sql .= ", dateemployment=" . (strval($this->dateemployment) != '' ? "'" . Config::$dbEngine->idate($this->dateemployment) . "'" : 'null'); |
|
| 1427 | - $sql .= ", dateemploymentend=" . (strval($this->dateemploymentend) != '' ? "'" . Config::$dbEngine->idate($this->dateemploymentend) . "'" : 'null'); |
|
| 1428 | - $sql .= ", note = '" . Config::$dbEngine->escape($this->note) . "'"; |
|
| 1429 | - $sql .= ", photo = " . ($this->photo ? "'" . Config::$dbEngine->escape($this->photo) . "'" : "null"); |
|
| 1430 | - $sql .= ", openid = " . ($this->openid ? "'" . Config::$dbEngine->escape($this->openid) . "'" : "null"); |
|
| 1431 | - $sql .= ", fk_user = " . ($this->fk_user > 0 ? "'" . Config::$dbEngine->escape($this->fk_user) . "'" : "null"); |
|
| 1408 | + $sql .= ", admin = ".$this->admin; // admin flag can be set/unset only by an admin user |
|
| 1409 | + } |
|
| 1410 | + $sql .= ", address = '".Config::$dbEngine->escape($this->address)."'"; |
|
| 1411 | + $sql .= ", zip = '".Config::$dbEngine->escape($this->zip)."'"; |
|
| 1412 | + $sql .= ", town = '".Config::$dbEngine->escape($this->town)."'"; |
|
| 1413 | + $sql .= ", fk_state = ".((!empty($this->state_id) && $this->state_id > 0) ? "'".Config::$dbEngine->escape($this->state_id)."'" : "null"); |
|
| 1414 | + $sql .= ", fk_country = ".((!empty($this->country_id) && $this->country_id > 0) ? "'".Config::$dbEngine->escape($this->country_id)."'" : "null"); |
|
| 1415 | + $sql .= ", office_phone = '".Config::$dbEngine->escape($this->office_phone)."'"; |
|
| 1416 | + $sql .= ", office_fax = '".Config::$dbEngine->escape($this->office_fax)."'"; |
|
| 1417 | + $sql .= ", user_mobile = '".Config::$dbEngine->escape($this->user_mobile)."'"; |
|
| 1418 | + $sql .= ", email = '".Config::$dbEngine->escape($this->email)."'"; |
|
| 1419 | + $sql .= ", skype = '".Config::$dbEngine->escape($this->skype)."'"; |
|
| 1420 | + $sql .= ", twitter = '".Config::$dbEngine->escape($this->twitter)."'"; |
|
| 1421 | + $sql .= ", facebook = '".Config::$dbEngine->escape($this->facebook)."'"; |
|
| 1422 | + $sql .= ", job = '".Config::$dbEngine->escape($this->job)."'"; |
|
| 1423 | + $sql .= ", signature = '".Config::$dbEngine->escape($this->signature)."'"; |
|
| 1424 | + $sql .= ", accountancy_code = '".Config::$dbEngine->escape($this->accountancy_code)."'"; |
|
| 1425 | + $sql .= ", color = '".Config::$dbEngine->escape($this->color)."'"; |
|
| 1426 | + $sql .= ", dateemployment=".(strval($this->dateemployment) != '' ? "'".Config::$dbEngine->idate($this->dateemployment)."'" : 'null'); |
|
| 1427 | + $sql .= ", dateemploymentend=".(strval($this->dateemploymentend) != '' ? "'".Config::$dbEngine->idate($this->dateemploymentend)."'" : 'null'); |
|
| 1428 | + $sql .= ", note = '".Config::$dbEngine->escape($this->note)."'"; |
|
| 1429 | + $sql .= ", photo = ".($this->photo ? "'".Config::$dbEngine->escape($this->photo)."'" : "null"); |
|
| 1430 | + $sql .= ", openid = ".($this->openid ? "'".Config::$dbEngine->escape($this->openid)."'" : "null"); |
|
| 1431 | + $sql .= ", fk_user = ".($this->fk_user > 0 ? "'".Config::$dbEngine->escape($this->fk_user)."'" : "null"); |
|
| 1432 | 1432 | if (isset($this->thm) || $this->thm != '') {
|
| 1433 | - $sql .= ", thm= " . ($this->thm != '' ? "'" . Config::$dbEngine->escape($this->thm) . "'" : "null"); |
|
| 1433 | + $sql .= ", thm= ".($this->thm != '' ? "'".Config::$dbEngine->escape($this->thm)."'" : "null"); |
|
| 1434 | 1434 | } |
| 1435 | 1435 | if (isset($this->tjm) || $this->tjm != '') {
|
| 1436 | - $sql .= ", tjm= " . ($this->tjm != '' ? "'" . Config::$dbEngine->escape($this->tjm) . "'" : "null"); |
|
| 1436 | + $sql .= ", tjm= ".($this->tjm != '' ? "'".Config::$dbEngine->escape($this->tjm)."'" : "null"); |
|
| 1437 | 1437 | } |
| 1438 | 1438 | if (isset($this->salary) || $this->salary != '') {
|
| 1439 | - $sql .= ", salary= " . ($this->salary != '' ? "'" . Config::$dbEngine->escape($this->salary) . "'" : "null"); |
|
| 1439 | + $sql .= ", salary= ".($this->salary != '' ? "'".Config::$dbEngine->escape($this->salary)."'" : "null"); |
|
| 1440 | 1440 | } |
| 1441 | 1441 | if (isset($this->salaryextra) || $this->salaryextra != '') {
|
| 1442 | - $sql .= ", salaryextra= " . ($this->salaryextra != '' ? "'" . Config::$dbEngine->escape($this->salaryextra) . "'" : "null"); |
|
| 1442 | + $sql .= ", salaryextra= ".($this->salaryextra != '' ? "'".Config::$dbEngine->escape($this->salaryextra)."'" : "null"); |
|
| 1443 | 1443 | } |
| 1444 | - $sql .= ", weeklyhours= " . ($this->weeklyhours != '' ? "'" . Config::$dbEngine->escape($this->weeklyhours) . "'" : "null"); |
|
| 1445 | - $sql .= ", entity = '" . Config::$dbEngine->escape($this->entity) . "'"; |
|
| 1446 | - $sql .= ", default_range = " . ($this->default_range > 0 ? $this->default_range : 'null'); |
|
| 1447 | - $sql .= ", default_c_exp_tax_cat = " . ($this->default_c_exp_tax_cat > 0 ? $this->default_c_exp_tax_cat : 'null'); |
|
| 1444 | + $sql .= ", weeklyhours= ".($this->weeklyhours != '' ? "'".Config::$dbEngine->escape($this->weeklyhours)."'" : "null"); |
|
| 1445 | + $sql .= ", entity = '".Config::$dbEngine->escape($this->entity)."'"; |
|
| 1446 | + $sql .= ", default_range = ".($this->default_range > 0 ? $this->default_range : 'null'); |
|
| 1447 | + $sql .= ", default_c_exp_tax_cat = ".($this->default_c_exp_tax_cat > 0 ? $this->default_c_exp_tax_cat : 'null'); |
|
| 1448 | 1448 | |
| 1449 | - $sql .= " WHERE rowid = " . $this->id; |
|
| 1449 | + $sql .= " WHERE rowid = ".$this->id; |
|
| 1450 | 1450 | |
| 1451 | - DolUtils::dol_syslog(get_class($this) . "::update", LOG_DEBUG); |
|
| 1451 | + DolUtils::dol_syslog(get_class($this)."::update", LOG_DEBUG); |
|
| 1452 | 1452 | $resql = Config::$dbEngine->query($sql); |
| 1453 | 1453 | if ($resql) {
|
| 1454 | 1454 | $nbrowsaffected += Config::$dbEngine->affected_rows($resql); |
@@ -1466,8 +1466,8 @@ discard block |
||
| 1466 | 1466 | |
| 1467 | 1467 | // If user is linked to a member, remove old link to this member |
| 1468 | 1468 | if ($this->fk_member > 0) {
|
| 1469 | - DolUtils::dol_syslog(get_class($this) . "::update remove link with member. We will recreate it later", LOG_DEBUG); |
|
| 1470 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user SET fk_member = NULL where fk_member = " . $this->fk_member; |
|
| 1469 | + DolUtils::dol_syslog(get_class($this)."::update remove link with member. We will recreate it later", LOG_DEBUG); |
|
| 1470 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member = NULL where fk_member = ".$this->fk_member; |
|
| 1471 | 1471 | $resql = Config::$dbEngine->query($sql); |
| 1472 | 1472 | if (!$resql) {
|
| 1473 | 1473 | $this->error = Config::$dbEngine->error(); |
@@ -1476,8 +1476,8 @@ discard block |
||
| 1476 | 1476 | } |
| 1477 | 1477 | } |
| 1478 | 1478 | // Set link to user |
| 1479 | - DolUtils::dol_syslog(get_class($this) . "::update set link with member", LOG_DEBUG); |
|
| 1480 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user SET fk_member =" . ($this->fk_member > 0 ? $this->fk_member : 'null') . " where rowid = " . $this->id; |
|
| 1479 | + DolUtils::dol_syslog(get_class($this)."::update set link with member", LOG_DEBUG); |
|
| 1480 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member =".($this->fk_member > 0 ? $this->fk_member : 'null')." where rowid = ".$this->id; |
|
| 1481 | 1481 | $resql = Config::$dbEngine->query($sql); |
| 1482 | 1482 | if (!$resql) {
|
| 1483 | 1483 | $this->error = Config::$dbEngine->error(); |
@@ -1487,9 +1487,9 @@ discard block |
||
| 1487 | 1487 | |
| 1488 | 1488 | if ($nbrowsaffected) { // If something has changed in data
|
| 1489 | 1489 | if ($this->fk_member > 0 && !$nosyncmember) {
|
| 1490 | - DolUtils::dol_syslog(get_class($this) . "::update user is linked with a member. We try to update member too.", LOG_DEBUG); |
|
| 1490 | + DolUtils::dol_syslog(get_class($this)."::update user is linked with a member. We try to update member too.", LOG_DEBUG); |
|
| 1491 | 1491 | |
| 1492 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 1492 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 1493 | 1493 | |
| 1494 | 1494 | // This user is linked with a member, so we also update member information |
| 1495 | 1495 | // if this is an update. |
@@ -1529,7 +1529,7 @@ discard block |
||
| 1529 | 1529 | if ($result < 0) {
|
| 1530 | 1530 | $this->error = $adh->error; |
| 1531 | 1531 | $this->errors = $adh->errors; |
| 1532 | - DolUtils::dol_syslog(get_class($this) . "::update error after calling adh->update to sync it with user: " . $this->error, LOG_ERR); |
|
| 1532 | + DolUtils::dol_syslog(get_class($this)."::update error after calling adh->update to sync it with user: ".$this->error, LOG_ERR); |
|
| 1533 | 1533 | $error++; |
| 1534 | 1534 | } |
| 1535 | 1535 | } else {
|
@@ -1540,9 +1540,9 @@ discard block |
||
| 1540 | 1540 | } |
| 1541 | 1541 | |
| 1542 | 1542 | if ($this->contact_id > 0 && !$nosynccontact) {
|
| 1543 | - DolUtils::dol_syslog(get_class($this) . "::update user is linked with a contact. We try to update contact too.", LOG_DEBUG); |
|
| 1543 | + DolUtils::dol_syslog(get_class($this)."::update user is linked with a contact. We try to update contact too.", LOG_DEBUG); |
|
| 1544 | 1544 | |
| 1545 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 1545 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 1546 | 1546 | |
| 1547 | 1547 | // This user is linked with a contact, so we also update contact information |
| 1548 | 1548 | // if this is an update. |
@@ -1582,7 +1582,7 @@ discard block |
||
| 1582 | 1582 | if ($result < 0) {
|
| 1583 | 1583 | $this->error = $tmpobj->error; |
| 1584 | 1584 | $this->errors = $tmpobj->errors; |
| 1585 | - DolUtils::dol_syslog(get_class($this) . "::update error after calling adh->update to sync it with user: " . $this->error, LOG_ERR); |
|
| 1585 | + DolUtils::dol_syslog(get_class($this)."::update error after calling adh->update to sync it with user: ".$this->error, LOG_ERR); |
|
| 1586 | 1586 | $error++; |
| 1587 | 1587 | } |
| 1588 | 1588 | } else {
|
@@ -1616,7 +1616,7 @@ discard block |
||
| 1616 | 1616 | Config::$dbEngine->commit(); |
| 1617 | 1617 | return $nbrowsaffected; |
| 1618 | 1618 | } else {
|
| 1619 | - DolUtils::dol_syslog(get_class($this) . "::update error=" . $this->error, LOG_ERR); |
|
| 1619 | + DolUtils::dol_syslog(get_class($this)."::update error=".$this->error, LOG_ERR); |
|
| 1620 | 1620 | Config::$dbEngine->rollback(); |
| 1621 | 1621 | return -1; |
| 1622 | 1622 | } |
@@ -1639,20 +1639,20 @@ discard block |
||
| 1639 | 1639 | // phpcs:enable |
| 1640 | 1640 | $now = dol_now(); |
| 1641 | 1641 | |
| 1642 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user SET"; |
|
| 1642 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user SET"; |
|
| 1643 | 1643 | $sql .= " datepreviouslogin = datelastlogin,"; |
| 1644 | - $sql .= " datelastlogin = '" . Config::$dbEngine->idate($now) . "',"; |
|
| 1645 | - $sql .= " tms = tms"; // La date de derniere modif doit changer sauf pour la mise a jour de date de derniere connexion |
|
| 1646 | - $sql .= " WHERE rowid = " . $this->id; |
|
| 1644 | + $sql .= " datelastlogin = '".Config::$dbEngine->idate($now)."',"; |
|
| 1645 | + $sql .= " tms = tms"; // La date de derniere modif doit changer sauf pour la mise a jour de date de derniere connexion |
|
| 1646 | + $sql .= " WHERE rowid = ".$this->id; |
|
| 1647 | 1647 | |
| 1648 | - DolUtils::dol_syslog(get_class($this) . "::update_last_login_date user->id=" . $this->id . " " . $sql, LOG_DEBUG); |
|
| 1648 | + DolUtils::dol_syslog(get_class($this)."::update_last_login_date user->id=".$this->id." ".$sql, LOG_DEBUG); |
|
| 1649 | 1649 | $resql = Config::$dbEngine->query($sql); |
| 1650 | 1650 | if ($resql) {
|
| 1651 | 1651 | $this->datepreviouslogin = $this->datelastlogin; |
| 1652 | 1652 | $this->datelastlogin = $now; |
| 1653 | 1653 | return 1; |
| 1654 | 1654 | } else {
|
| 1655 | - $this->error = Config::$dbEngine->lasterror() . ' sql=' . $sql; |
|
| 1655 | + $this->error = Config::$dbEngine->lasterror().' sql='.$sql; |
|
| 1656 | 1656 | return -1; |
| 1657 | 1657 | } |
| 1658 | 1658 | } |
@@ -1670,11 +1670,11 @@ discard block |
||
| 1670 | 1670 | function setPassword($user, $password = '', $changelater = 0, $notrigger = 0, $nosyncmember = 0) |
| 1671 | 1671 | {
|
| 1672 | 1672 | //global $conf, Globals::$langs; |
| 1673 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php'; |
|
| 1673 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; |
|
| 1674 | 1674 | |
| 1675 | 1675 | $error = 0; |
| 1676 | 1676 | |
| 1677 | - DolUtils::dol_syslog(get_class($this) . "::setPassword user=" . Globals::$user->id . " password=" . preg_replace('/./i', '*', $password) . " changelater=" . $changelater . " notrigger=" . $notrigger . " nosyncmember=" . $nosyncmember, LOG_DEBUG);
|
|
| 1677 | + DolUtils::dol_syslog(get_class($this)."::setPassword user=".Globals::$user->id." password=".preg_replace('/./i', '*', $password)." changelater=".$changelater." notrigger=".$notrigger." nosyncmember=".$nosyncmember, LOG_DEBUG);
|
|
| 1678 | 1678 | |
| 1679 | 1679 | // If new password not provided, we generate one |
| 1680 | 1680 | if (!$password) {
|
@@ -1692,17 +1692,17 @@ discard block |
||
| 1692 | 1692 | |
| 1693 | 1693 | Config::$dbEngine->begin(); |
| 1694 | 1694 | |
| 1695 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user"; |
|
| 1696 | - $sql .= " SET pass_crypted = '" . Config::$dbEngine->escape($password_crypted) . "',"; |
|
| 1695 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user"; |
|
| 1696 | + $sql .= " SET pass_crypted = '".Config::$dbEngine->escape($password_crypted)."',"; |
|
| 1697 | 1697 | $sql .= " pass_temp = null"; |
| 1698 | 1698 | if (!empty($conf->global->DATABASE_PWD_ENCRYPTED)) {
|
| 1699 | 1699 | $sql .= ", pass = null"; |
| 1700 | 1700 | } else {
|
| 1701 | - $sql .= ", pass = '" . Config::$dbEngine->escape($password) . "'"; |
|
| 1701 | + $sql .= ", pass = '".Config::$dbEngine->escape($password)."'"; |
|
| 1702 | 1702 | } |
| 1703 | - $sql .= " WHERE rowid = " . $this->id; |
|
| 1703 | + $sql .= " WHERE rowid = ".$this->id; |
|
| 1704 | 1704 | |
| 1705 | - DolUtils::dol_syslog(get_class($this) . "::setPassword", LOG_DEBUG); |
|
| 1705 | + DolUtils::dol_syslog(get_class($this)."::setPassword", LOG_DEBUG); |
|
| 1706 | 1706 | $result = Config::$dbEngine->query($sql); |
| 1707 | 1707 | if ($result) {
|
| 1708 | 1708 | if (Config::$dbEngine->affected_rows($result)) {
|
@@ -1711,7 +1711,7 @@ discard block |
||
| 1711 | 1711 | $this->pass_indatabase_crypted = $password_crypted; |
| 1712 | 1712 | |
| 1713 | 1713 | if ($this->fk_member && !$nosyncmember) {
|
| 1714 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 1714 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 1715 | 1715 | |
| 1716 | 1716 | // This user is linked with a member, so we also update members informations |
| 1717 | 1717 | // if this is an update. |
@@ -1722,7 +1722,7 @@ discard block |
||
| 1722 | 1722 | $result = $adh->setPassword(Globals::$user, $this->pass, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1); // Cryptage non gere dans module adherent |
| 1723 | 1723 | if ($result < 0) {
|
| 1724 | 1724 | $this->error = $adh->error; |
| 1725 | - DolUtils::dol_syslog(get_class($this) . "::setPassword " . $this->error, LOG_ERR); |
|
| 1725 | + DolUtils::dol_syslog(get_class($this)."::setPassword ".$this->error, LOG_ERR); |
|
| 1726 | 1726 | $error++; |
| 1727 | 1727 | } |
| 1728 | 1728 | } else {
|
@@ -1731,7 +1731,7 @@ discard block |
||
| 1731 | 1731 | } |
| 1732 | 1732 | } |
| 1733 | 1733 | |
| 1734 | - DolUtils::dol_syslog(get_class($this) . "::setPassword notrigger=" . $notrigger . " error=" . $error, LOG_DEBUG); |
|
| 1734 | + DolUtils::dol_syslog(get_class($this)."::setPassword notrigger=".$notrigger." error=".$error, LOG_DEBUG); |
|
| 1735 | 1735 | |
| 1736 | 1736 | if (!$error && !$notrigger) {
|
| 1737 | 1737 | // Call trigger |
@@ -1758,11 +1758,11 @@ discard block |
||
| 1758 | 1758 | } else {
|
| 1759 | 1759 | // We store clear password in password temporary field. |
| 1760 | 1760 | // After receiving confirmation link, we will crypt it and store it in pass_crypted |
| 1761 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "user"; |
|
| 1762 | - $sql .= " SET pass_temp = '" . Config::$dbEngine->escape($password) . "'"; |
|
| 1763 | - $sql .= " WHERE rowid = " . $this->id; |
|
| 1761 | + $sql = "UPDATE ".MAIN_DB_PREFIX."user"; |
|
| 1762 | + $sql .= " SET pass_temp = '".Config::$dbEngine->escape($password)."'"; |
|
| 1763 | + $sql .= " WHERE rowid = ".$this->id; |
|
| 1764 | 1764 | |
| 1765 | - DolUtils::dol_syslog(get_class($this) . "::setPassword", LOG_DEBUG); // No log |
|
| 1765 | + DolUtils::dol_syslog(get_class($this)."::setPassword", LOG_DEBUG); // No log |
|
| 1766 | 1766 | $result = Config::$dbEngine->query($sql); |
| 1767 | 1767 | if ($result) {
|
| 1768 | 1768 | return $password; |
@@ -1788,7 +1788,7 @@ discard block |
||
| 1788 | 1788 | //global $conf, Globals::$langs; |
| 1789 | 1789 | //global $dolibarr_main_url_root; |
| 1790 | 1790 | |
| 1791 | - require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; |
|
| 1791 | + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; |
|
| 1792 | 1792 | |
| 1793 | 1793 | $msgishtml = 0; |
| 1794 | 1794 | |
@@ -1813,36 +1813,36 @@ discard block |
||
| 1813 | 1813 | $subject = $outputlangs->transnoentitiesnoconv("SubjectNewPassword", $appli);
|
| 1814 | 1814 | |
| 1815 | 1815 | // Define $urlwithroot |
| 1816 | - $urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root));
|
|
| 1817 | - $urlwithroot = $urlwithouturlroot . DOL_URL_ROOT; // This is to use external domain name found into config file |
|
| 1816 | + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
|
| 1817 | + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file |
|
| 1818 | 1818 | |
| 1819 | 1819 | if (!$changelater) {
|
| 1820 | - $url = $urlwithroot . '/'; |
|
| 1820 | + $url = $urlwithroot.'/'; |
|
| 1821 | 1821 | |
| 1822 | - $mesg .= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived") . ".\n";
|
|
| 1823 | - $mesg .= $outputlangs->transnoentitiesnoconv("NewKeyIs") . " :\n\n";
|
|
| 1824 | - $mesg .= $outputlangs->transnoentitiesnoconv("Login") . " = " . $this->login . "\n";
|
|
| 1825 | - $mesg .= $outputlangs->transnoentitiesnoconv("Password") . " = " . $password . "\n\n";
|
|
| 1822 | + $mesg .= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived").".\n";
|
|
| 1823 | + $mesg .= $outputlangs->transnoentitiesnoconv("NewKeyIs")." :\n\n";
|
|
| 1824 | + $mesg .= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n";
|
|
| 1825 | + $mesg .= $outputlangs->transnoentitiesnoconv("Password")." = ".$password."\n\n";
|
|
| 1826 | 1826 | $mesg .= "\n"; |
| 1827 | 1827 | |
| 1828 | - $mesg .= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $appli) . ': ' . $url . "\n\n";
|
|
| 1828 | + $mesg .= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $appli).': '.$url."\n\n";
|
|
| 1829 | 1829 | $mesg .= "--\n"; |
| 1830 | 1830 | $mesg .= Globals::$user->getFullName($outputlangs); // Username that make then sending |
| 1831 | 1831 | |
| 1832 | - DolUtils::dol_syslog(get_class($this) . "::send_password changelater is off, url=" . $url); |
|
| 1832 | + DolUtils::dol_syslog(get_class($this)."::send_password changelater is off, url=".$url); |
|
| 1833 | 1833 | } else {
|
| 1834 | - $url = $urlwithroot . '/user/passwordforgotten.php?action=validatenewpassword&username=' . $this->login . "&passwordhash=" . dol_hash($password); |
|
| 1834 | + $url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordhash=".dol_hash($password); |
|
| 1835 | 1835 | |
| 1836 | - $mesg .= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived") . "\n";
|
|
| 1837 | - $mesg .= $outputlangs->transnoentitiesnoconv("NewKeyWillBe") . " :\n\n";
|
|
| 1838 | - $mesg .= $outputlangs->transnoentitiesnoconv("Login") . " = " . $this->login . "\n";
|
|
| 1839 | - $mesg .= $outputlangs->transnoentitiesnoconv("Password") . " = " . $password . "\n\n";
|
|
| 1836 | + $mesg .= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived")."\n";
|
|
| 1837 | + $mesg .= $outputlangs->transnoentitiesnoconv("NewKeyWillBe")." :\n\n";
|
|
| 1838 | + $mesg .= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n";
|
|
| 1839 | + $mesg .= $outputlangs->transnoentitiesnoconv("Password")." = ".$password."\n\n";
|
|
| 1840 | 1840 | $mesg .= "\n"; |
| 1841 | - $mesg .= $outputlangs->transnoentitiesnoconv("YouMustClickToChange") . " :\n";
|
|
| 1842 | - $mesg .= $url . "\n\n"; |
|
| 1843 | - $mesg .= $outputlangs->transnoentitiesnoconv("ForgetIfNothing") . "\n\n";
|
|
| 1841 | + $mesg .= $outputlangs->transnoentitiesnoconv("YouMustClickToChange")." :\n";
|
|
| 1842 | + $mesg .= $url."\n\n"; |
|
| 1843 | + $mesg .= $outputlangs->transnoentitiesnoconv("ForgetIfNothing")."\n\n";
|
|
| 1844 | 1844 | |
| 1845 | - DolUtils::dol_syslog(get_class($this) . "::send_password changelater is on, url=" . $url); |
|
| 1845 | + DolUtils::dol_syslog(get_class($this)."::send_password changelater is on, url=".$url); |
|
| 1846 | 1846 | } |
| 1847 | 1847 | |
| 1848 | 1848 | $mailfile = new CMailFile( |
@@ -1853,7 +1853,7 @@ discard block |
||
| 1853 | 1853 | return 1; |
| 1854 | 1854 | } else {
|
| 1855 | 1855 | Globals::$langs->trans("errors");
|
| 1856 | - $this->error = Globals::$langs->trans("ErrorFailedToSendPassword") . ' ' . $mailfile->error;
|
|
| 1856 | + $this->error = Globals::$langs->trans("ErrorFailedToSendPassword").' '.$mailfile->error;
|
|
| 1857 | 1857 | return -1; |
| 1858 | 1858 | } |
| 1859 | 1859 | } |
@@ -1878,8 +1878,8 @@ discard block |
||
| 1878 | 1878 | {
|
| 1879 | 1879 | // phpcs:enable |
| 1880 | 1880 | $sql = "SELECT url, login, pass, poste "; |
| 1881 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user_clicktodial as u"; |
|
| 1882 | - $sql .= " WHERE u.fk_user = " . $this->id; |
|
| 1881 | + $sql .= " FROM ".MAIN_DB_PREFIX."user_clicktodial as u"; |
|
| 1882 | + $sql .= " WHERE u.fk_user = ".$this->id; |
|
| 1883 | 1883 | |
| 1884 | 1884 | $resql = Config::$dbEngine->query($sql); |
| 1885 | 1885 | if ($resql) {
|
@@ -1913,21 +1913,21 @@ discard block |
||
| 1913 | 1913 | // phpcs:enable |
| 1914 | 1914 | Config::$dbEngine->begin(); |
| 1915 | 1915 | |
| 1916 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_clicktodial"; |
|
| 1917 | - $sql .= " WHERE fk_user = " . $this->id; |
|
| 1916 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_clicktodial"; |
|
| 1917 | + $sql .= " WHERE fk_user = ".$this->id; |
|
| 1918 | 1918 | |
| 1919 | - DolUtils::dol_syslog(get_class($this) . '::update_clicktodial', LOG_DEBUG); |
|
| 1919 | + DolUtils::dol_syslog(get_class($this).'::update_clicktodial', LOG_DEBUG); |
|
| 1920 | 1920 | $result = Config::$dbEngine->query($sql); |
| 1921 | 1921 | |
| 1922 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "user_clicktodial"; |
|
| 1922 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."user_clicktodial"; |
|
| 1923 | 1923 | $sql .= " (fk_user,url,login,pass,poste)"; |
| 1924 | - $sql .= " VALUES (" . $this->id;
|
|
| 1925 | - $sql .= ", '" . Config::$dbEngine->escape($this->clicktodial_url) . "'"; |
|
| 1926 | - $sql .= ", '" . Config::$dbEngine->escape($this->clicktodial_login) . "'"; |
|
| 1927 | - $sql .= ", '" . Config::$dbEngine->escape($this->clicktodial_password) . "'"; |
|
| 1928 | - $sql .= ", '" . Config::$dbEngine->escape($this->clicktodial_poste) . "')"; |
|
| 1924 | + $sql .= " VALUES (".$this->id;
|
|
| 1925 | + $sql .= ", '".Config::$dbEngine->escape($this->clicktodial_url)."'"; |
|
| 1926 | + $sql .= ", '".Config::$dbEngine->escape($this->clicktodial_login)."'"; |
|
| 1927 | + $sql .= ", '".Config::$dbEngine->escape($this->clicktodial_password)."'"; |
|
| 1928 | + $sql .= ", '".Config::$dbEngine->escape($this->clicktodial_poste)."')"; |
|
| 1929 | 1929 | |
| 1930 | - DolUtils::dol_syslog(get_class($this) . '::update_clicktodial', LOG_DEBUG); |
|
| 1930 | + DolUtils::dol_syslog(get_class($this).'::update_clicktodial', LOG_DEBUG); |
|
| 1931 | 1931 | $result = Config::$dbEngine->query($sql); |
| 1932 | 1932 | if ($result) {
|
| 1933 | 1933 | Config::$dbEngine->commit(); |
@@ -1957,20 +1957,20 @@ discard block |
||
| 1957 | 1957 | |
| 1958 | 1958 | Config::$dbEngine->begin(); |
| 1959 | 1959 | |
| 1960 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "usergroup_user"; |
|
| 1961 | - $sql .= " WHERE fk_user = " . $this->id; |
|
| 1962 | - $sql .= " AND fk_usergroup = " . $group; |
|
| 1963 | - $sql .= " AND entity = " . $entity; |
|
| 1960 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."usergroup_user"; |
|
| 1961 | + $sql .= " WHERE fk_user = ".$this->id; |
|
| 1962 | + $sql .= " AND fk_usergroup = ".$group; |
|
| 1963 | + $sql .= " AND entity = ".$entity; |
|
| 1964 | 1964 | |
| 1965 | 1965 | $result = Config::$dbEngine->query($sql); |
| 1966 | 1966 | |
| 1967 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "usergroup_user (entity, fk_user, fk_usergroup)"; |
|
| 1968 | - $sql .= " VALUES (" . $entity . "," . $this->id . "," . $group . ")";
|
|
| 1967 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."usergroup_user (entity, fk_user, fk_usergroup)"; |
|
| 1968 | + $sql .= " VALUES (".$entity.",".$this->id.",".$group.")";
|
|
| 1969 | 1969 | |
| 1970 | 1970 | $result = Config::$dbEngine->query($sql); |
| 1971 | 1971 | if ($result) {
|
| 1972 | 1972 | if (!$error && !$notrigger) {
|
| 1973 | - $this->newgroupid = $group; // deprecated. Remove this. |
|
| 1973 | + $this->newgroupid = $group; // deprecated. Remove this. |
|
| 1974 | 1974 | $this->context = array('audit' => Globals::$langs->trans("UserSetInGroup"), 'newgroupid' => $group);
|
| 1975 | 1975 | |
| 1976 | 1976 | // Call trigger |
@@ -1985,7 +1985,7 @@ discard block |
||
| 1985 | 1985 | Config::$dbEngine->commit(); |
| 1986 | 1986 | return 1; |
| 1987 | 1987 | } else {
|
| 1988 | - DolUtils::dol_syslog(get_class($this) . "::SetInGroup " . $this->error, LOG_ERR); |
|
| 1988 | + DolUtils::dol_syslog(get_class($this)."::SetInGroup ".$this->error, LOG_ERR); |
|
| 1989 | 1989 | Config::$dbEngine->rollback(); |
| 1990 | 1990 | return -2; |
| 1991 | 1991 | } |
@@ -2014,15 +2014,15 @@ discard block |
||
| 2014 | 2014 | |
| 2015 | 2015 | Config::$dbEngine->begin(); |
| 2016 | 2016 | |
| 2017 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "usergroup_user"; |
|
| 2018 | - $sql .= " WHERE fk_user = " . $this->id; |
|
| 2019 | - $sql .= " AND fk_usergroup = " . $group; |
|
| 2020 | - $sql .= " AND entity = " . $entity; |
|
| 2017 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."usergroup_user"; |
|
| 2018 | + $sql .= " WHERE fk_user = ".$this->id; |
|
| 2019 | + $sql .= " AND fk_usergroup = ".$group; |
|
| 2020 | + $sql .= " AND entity = ".$entity; |
|
| 2021 | 2021 | |
| 2022 | 2022 | $result = Config::$dbEngine->query($sql); |
| 2023 | 2023 | if ($result) {
|
| 2024 | 2024 | if (!$error && !$notrigger) {
|
| 2025 | - $this->oldgroupid = $group; // deprecated. Remove this. |
|
| 2025 | + $this->oldgroupid = $group; // deprecated. Remove this. |
|
| 2026 | 2026 | $this->context = array('audit' => Globals::$langs->trans("UserRemovedFromGroup"), 'oldgroupid' => $group);
|
| 2027 | 2027 | |
| 2028 | 2028 | // Call trigger |
@@ -2038,7 +2038,7 @@ discard block |
||
| 2038 | 2038 | return 1; |
| 2039 | 2039 | } else {
|
| 2040 | 2040 | $this->error = $interface->error; |
| 2041 | - DolUtils::dol_syslog(get_class($this) . "::RemoveFromGroup " . $this->error, LOG_ERR); |
|
| 2041 | + DolUtils::dol_syslog(get_class($this)."::RemoveFromGroup ".$this->error, LOG_ERR); |
|
| 2042 | 2042 | Config::$dbEngine->rollback(); |
| 2043 | 2043 | return -2; |
| 2044 | 2044 | } |
@@ -2062,7 +2062,7 @@ discard block |
||
| 2062 | 2062 | function getPhotoUrl($width, $height, $cssclass = '', $imagesize = '') |
| 2063 | 2063 | {
|
| 2064 | 2064 | // $result = '<a href="' . DOL_URL_ROOT . '/user/card.php?id=' . $this->id . '">'; |
| 2065 | - $result = '<a href="' . BASE_URI . '?controller=user&method=card&id=' . $this->id . '">'; |
|
| 2065 | + $result = '<a href="'.BASE_URI.'?controller=user&method=card&id='.$this->id.'">'; |
|
| 2066 | 2066 | $result .= Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass, $imagesize);
|
| 2067 | 2067 | $result .= '</a>'; |
| 2068 | 2068 | |
@@ -2112,49 +2112,49 @@ discard block |
||
| 2112 | 2112 | |
| 2113 | 2113 | // Info Login |
| 2114 | 2114 | $label .= '<div class="centpercent">'; |
| 2115 | - $label .= '<u>' . Globals::$langs->trans("User") . '</u><br>';
|
|
| 2116 | - $label .= '<b>' . Globals::$langs->trans('Name') . ':</b> ' . $this->getFullName(Globals::$langs, '');
|
|
| 2115 | + $label .= '<u>'.Globals::$langs->trans("User").'</u><br>';
|
|
| 2116 | + $label .= '<b>'.Globals::$langs->trans('Name').':</b> '.$this->getFullName(Globals::$langs, '');
|
|
| 2117 | 2117 | if (!empty($this->login)) {
|
| 2118 | - $label .= '<br><b>' . Globals::$langs->trans('Login') . ':</b> ' . $this->login;
|
|
| 2118 | + $label .= '<br><b>'.Globals::$langs->trans('Login').':</b> '.$this->login;
|
|
| 2119 | 2119 | } |
| 2120 | - $label .= '<br><b>' . Globals::$langs->trans("EMail") . ':</b> ' . $this->email;
|
|
| 2120 | + $label .= '<br><b>'.Globals::$langs->trans("EMail").':</b> '.$this->email;
|
|
| 2121 | 2121 | if (!empty($this->admin)) {
|
| 2122 | - $label .= '<br><b>' . Globals::$langs->trans("Administrator") . '</b>: ' . DolUtils::yn($this->admin);
|
|
| 2122 | + $label .= '<br><b>'.Globals::$langs->trans("Administrator").'</b>: '.DolUtils::yn($this->admin);
|
|
| 2123 | 2123 | } |
| 2124 | 2124 | if (!empty($this->socid)) { // Add thirdparty for external users
|
| 2125 | 2125 | $thirdpartystatic = new Societe($db); |
| 2126 | 2126 | $thirdpartystatic->fetch($this->socid); |
| 2127 | 2127 | if (empty($hidethirdpartylogo)) {
|
| 2128 | - $companylink = ' ' . $thirdpartystatic->getNomUrl(2, (($option == 'nolink') ? 'nolink' : '')); // picto only of company |
|
| 2128 | + $companylink = ' '.$thirdpartystatic->getNomUrl(2, (($option == 'nolink') ? 'nolink' : '')); // picto only of company |
|
| 2129 | 2129 | } |
| 2130 | - $company = ' (' . Globals::$langs->trans("Company") . ': ' . $thirdpartystatic->name . ')';
|
|
| 2130 | + $company = ' ('.Globals::$langs->trans("Company").': '.$thirdpartystatic->name.')';
|
|
| 2131 | 2131 | } |
| 2132 | - $type = ($this->socid ? Globals::$langs->trans("External") . $company : Globals::$langs->trans("Internal"));
|
|
| 2133 | - $label .= '<br><b>' . Globals::$langs->trans("Type") . ':</b> ' . $type;
|
|
| 2134 | - $label .= '<br><b>' . Globals::$langs->trans("Status") . '</b>: ' . $this->getLibStatut(0);
|
|
| 2132 | + $type = ($this->socid ? Globals::$langs->trans("External").$company : Globals::$langs->trans("Internal"));
|
|
| 2133 | + $label .= '<br><b>'.Globals::$langs->trans("Type").':</b> '.$type;
|
|
| 2134 | + $label .= '<br><b>'.Globals::$langs->trans("Status").'</b>: '.$this->getLibStatut(0);
|
|
| 2135 | 2135 | $label .= '</div>'; |
| 2136 | 2136 | if ($infologin > 0) {
|
| 2137 | 2137 | $label .= '<br>'; |
| 2138 | - $label .= '<br><u>' . Globals::$langs->trans("Connection") . '</u>';
|
|
| 2139 | - $label .= '<br><b>' . Globals::$langs->trans("IPAddress") . '</b>: ' . $_SERVER["REMOTE_ADDR"];
|
|
| 2138 | + $label .= '<br><u>'.Globals::$langs->trans("Connection").'</u>';
|
|
| 2139 | + $label .= '<br><b>'.Globals::$langs->trans("IPAddress").'</b>: '.$_SERVER["REMOTE_ADDR"];
|
|
| 2140 | 2140 | if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY)) {
|
| 2141 | - $label .= '<br><b>' . Globals::$langs->trans("ConnectedOnMultiCompany") . ':</b> ' . Globals::$conf->entity . ' (user entity ' . $this->entity . ')';
|
|
| 2141 | + $label .= '<br><b>'.Globals::$langs->trans("ConnectedOnMultiCompany").':</b> '.Globals::$conf->entity.' (user entity '.$this->entity.')';
|
|
| 2142 | 2142 | } |
| 2143 | - $label .= '<br><b>' . Globals::$langs->trans("AuthenticationMode") . ':</b> ' . $_SESSION["dol_authmode"] . (empty($dolibarr_main_demo) ? '' : ' (demo)');
|
|
| 2144 | - $label .= '<br><b>' . Globals::$langs->trans("ConnectedSince") . ':</b> ' . DolUtils::dol_print_date($this->datelastlogin, "dayhour", 'tzuser');
|
|
| 2145 | - $label .= '<br><b>' . Globals::$langs->trans("PreviousConnexion") . ':</b> ' . DolUtils::dol_print_date($this->datepreviouslogin, "dayhour", 'tzuser');
|
|
| 2146 | - $label .= '<br><b>' . Globals::$langs->trans("CurrentTheme") . ':</b> ' . Globals::$conf->theme;
|
|
| 2147 | - $label .= '<br><b>' . Globals::$langs->trans("CurrentMenuManager") . ':</b> ' . Globals::$menuManager->name;
|
|
| 2143 | + $label .= '<br><b>'.Globals::$langs->trans("AuthenticationMode").':</b> '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo) ? '' : ' (demo)');
|
|
| 2144 | + $label .= '<br><b>'.Globals::$langs->trans("ConnectedSince").':</b> '.DolUtils::dol_print_date($this->datelastlogin, "dayhour", 'tzuser');
|
|
| 2145 | + $label .= '<br><b>'.Globals::$langs->trans("PreviousConnexion").':</b> '.DolUtils::dol_print_date($this->datepreviouslogin, "dayhour", 'tzuser');
|
|
| 2146 | + $label .= '<br><b>'.Globals::$langs->trans("CurrentTheme").':</b> '.Globals::$conf->theme;
|
|
| 2147 | + $label .= '<br><b>'.Globals::$langs->trans("CurrentMenuManager").':</b> '.Globals::$menuManager->name;
|
|
| 2148 | 2148 | $s = DolUtils::picto_from_langcode(Globals::$langs->getDefaultLang()); |
| 2149 | - $label .= '<br><b>' . Globals::$langs->trans("CurrentUserLanguage") . ':</b> ' . ($s ? $s . ' ' : '') . Globals::$langs->getDefaultLang();
|
|
| 2150 | - $label .= '<br><b>' . Globals::$langs->trans("Browser") . ':</b> ' . Globals::$conf->browser->name . ($conf->browser->version ? ' ' . Globals::$conf->browser->version : '') . ' (' . $_SERVER['HTTP_USER_AGENT'] . ')';
|
|
| 2151 | - $label .= '<br><b>' . Globals::$langs->trans("Layout") . ':</b> ' . Globals::$conf->browser->layout;
|
|
| 2152 | - $label .= '<br><b>' . Globals::$langs->trans("Screen") . ':</b> ' . $_SESSION['dol_screenwidth'] . ' x ' . $_SESSION['dol_screenheight'];
|
|
| 2149 | + $label .= '<br><b>'.Globals::$langs->trans("CurrentUserLanguage").':</b> '.($s ? $s.' ' : '').Globals::$langs->getDefaultLang();
|
|
| 2150 | + $label .= '<br><b>'.Globals::$langs->trans("Browser").':</b> '.Globals::$conf->browser->name.($conf->browser->version ? ' '.Globals::$conf->browser->version : '').' ('.$_SERVER['HTTP_USER_AGENT'].')';
|
|
| 2151 | + $label .= '<br><b>'.Globals::$langs->trans("Layout").':</b> '.Globals::$conf->browser->layout;
|
|
| 2152 | + $label .= '<br><b>'.Globals::$langs->trans("Screen").':</b> '.$_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
|
|
| 2153 | 2153 | if ($conf->browser->layout == 'phone') {
|
| 2154 | - $label .= '<br><b>' . Globals::$langs->trans("Phone") . ':</b> ' . Globals::$langs->trans("Yes");
|
|
| 2154 | + $label .= '<br><b>'.Globals::$langs->trans("Phone").':</b> '.Globals::$langs->trans("Yes");
|
|
| 2155 | 2155 | } |
| 2156 | 2156 | if (!empty($_SESSION["disablemodules"])) {
|
| 2157 | - $label .= '<br><b>' . Globals::$langs->trans("DisabledModules") . ':</b> <br>' . join(', ', explode(',', $_SESSION["disablemodules"]));
|
|
| 2157 | + $label .= '<br><b>'.Globals::$langs->trans("DisabledModules").':</b> <br>'.join(', ', explode(',', $_SESSION["disablemodules"]));
|
|
| 2158 | 2158 | } |
| 2159 | 2159 | } |
| 2160 | 2160 | if ($infologin < 0) {
|
@@ -2162,10 +2162,10 @@ discard block |
||
| 2162 | 2162 | } |
| 2163 | 2163 | |
| 2164 | 2164 | // $url = DOL_URL_ROOT . '/user/card.php?id=' . $this->id; |
| 2165 | - $url = BASE_URI . '?controller=user&method=card&id=' . $this->id; |
|
| 2165 | + $url = BASE_URI.'?controller=user&method=card&id='.$this->id; |
|
| 2166 | 2166 | if ($option == 'leave') {
|
| 2167 | 2167 | //$url = DOL_URL_ROOT . '/holiday/list.php?id=' . $this->id; |
| 2168 | - $url = BASE_URI . '?controller=holiday&method=list&id=' . $this->id; |
|
| 2168 | + $url = BASE_URI.'?controller=holiday&method=list&id='.$this->id; |
|
| 2169 | 2169 | } |
| 2170 | 2170 | if ($option != 'nolink') {
|
| 2171 | 2171 | // Add param to save lastsearch_values or not |
@@ -2178,16 +2178,16 @@ discard block |
||
| 2178 | 2178 | } |
| 2179 | 2179 | } |
| 2180 | 2180 | |
| 2181 | - $linkstart = '<a href="' . $url . '"'; |
|
| 2181 | + $linkstart = '<a href="'.$url.'"'; |
|
| 2182 | 2182 | $linkclose = ""; |
| 2183 | 2183 | if (empty($notooltip)) {
|
| 2184 | 2184 | if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
| 2185 | 2185 | Globals::$langs->load("users");
|
| 2186 | 2186 | $label = Globals::$langs->trans("ShowUser");
|
| 2187 | - $linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"'; |
|
| 2187 | + $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
|
| 2188 | 2188 | } |
| 2189 | - $linkclose .= ' title="' . dol_escape_htmltag($label, 1) . '"'; |
|
| 2190 | - $linkclose .= ' class="classfortooltip' . ($morecss ? ' ' . $morecss : '') . '"'; |
|
| 2189 | + $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; |
|
| 2190 | + $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; |
|
| 2191 | 2191 | |
| 2192 | 2192 | /* |
| 2193 | 2193 | $hookmanager->initHooks(array('userdao'));
|
@@ -2197,7 +2197,7 @@ discard block |
||
| 2197 | 2197 | */ |
| 2198 | 2198 | } |
| 2199 | 2199 | |
| 2200 | - $linkstart .= $linkclose . '>'; |
|
| 2200 | + $linkstart .= $linkclose.'>'; |
|
| 2201 | 2201 | $linkend = '</a>'; |
| 2202 | 2202 | |
| 2203 | 2203 | //if ($withpictoimg == -1) $result.='<div class="nowrap">'; |
@@ -2209,15 +2209,15 @@ discard block |
||
| 2209 | 2209 | } |
| 2210 | 2210 | // Only picto |
| 2211 | 2211 | if ($withpictoimg > 0) {
|
| 2212 | - $picto = '<!-- picto user --><div class="inline-block nopadding userimg' . ($morecss ? ' ' . $morecss : '') . '">' . img_object('', 'user', $paddafterimage . ' ' . ($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1) . '</div>';
|
|
| 2212 | + $picto = '<!-- picto user --><div class="inline-block nopadding userimg'.($morecss ? ' '.$morecss : '').'">'.img_object('', 'user', $paddafterimage.' '.($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1).'</div>';
|
|
| 2213 | 2213 | } else { // Picto must be a photo
|
| 2214 | - $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>';
|
|
| 2214 | + $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>';
|
|
| 2215 | 2215 | } |
| 2216 | 2216 | $result .= $picto; |
| 2217 | 2217 | } |
| 2218 | 2218 | if ($withpictoimg > -2 && $withpictoimg != 2) {
|
| 2219 | 2219 | if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
| 2220 | - $result .= '<div class="inline-block nopadding valignmiddle usertext' . ((!isset($this->statut) || $this->statut) ? '' : ' strikefordisabled') . ($morecss ? ' ' . $morecss : '') . '">'; |
|
| 2220 | + $result .= '<div class="inline-block nopadding valignmiddle usertext'.((!isset($this->statut) || $this->statut) ? '' : ' strikefordisabled').($morecss ? ' '.$morecss : '').'">'; |
|
| 2221 | 2221 | } |
| 2222 | 2222 | if ($mode == 'login') {
|
| 2223 | 2223 | $result .= dol_trunc($this->login, $maxlen); |
@@ -2235,7 +2235,7 @@ discard block |
||
| 2235 | 2235 | global $action; |
| 2236 | 2236 | $hookmanager->initHooks(array('userdao'));
|
| 2237 | 2237 | $parameters = array('id' => $this->id, 'getnomurl' => $result);
|
| 2238 | - $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
|
| 2238 | + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
|
| 2239 | 2239 | if ($reshook > 0) {
|
| 2240 | 2240 | $result = $hookmanager->resPrint; |
| 2241 | 2241 | } else {
|
@@ -2259,7 +2259,7 @@ discard block |
||
| 2259 | 2259 | $result = ''; |
| 2260 | 2260 | |
| 2261 | 2261 | // $linkstart = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'">'; |
| 2262 | - $linkstart = '<a href="' . BASE_URI . '?controller=user&method=card&id=' . $this->id . '">'; |
|
| 2262 | + $linkstart = '<a href="'.BASE_URI.'?controller=user&method=card&id='.$this->id.'">'; |
|
| 2263 | 2263 | $linkend = '</a>'; |
| 2264 | 2264 | |
| 2265 | 2265 | //Check user's rights to see an other user |
@@ -2269,7 +2269,7 @@ discard block |
||
| 2269 | 2269 | |
| 2270 | 2270 | if ($option == 'xxx') {
|
| 2271 | 2271 | //$linkstart = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'">'; |
| 2272 | - $linkstart = '<a href="' . BASE_URI . '?controller=user&method=card.php&id=' . $this->id . '">'; |
|
| 2272 | + $linkstart = '<a href="'.BASE_URI.'?controller=user&method=card.php&id='.$this->id.'">'; |
|
| 2273 | 2273 | $linkend = '</a>'; |
| 2274 | 2274 | } |
| 2275 | 2275 | |
@@ -2326,9 +2326,9 @@ discard block |
||
| 2326 | 2326 | } |
| 2327 | 2327 | } elseif ($mode == 2) {
|
| 2328 | 2328 | if ($statut == 1) {
|
| 2329 | - return img_picto(Globals::$langs->trans('Enabled'), 'statut4', 'class="pictostatus"') . ' ' . Globals::$langs->trans('Enabled');
|
|
| 2329 | + return img_picto(Globals::$langs->trans('Enabled'), 'statut4', 'class="pictostatus"').' '.Globals::$langs->trans('Enabled');
|
|
| 2330 | 2330 | } elseif ($statut == 0) {
|
| 2331 | - return img_picto(Globals::$langs->trans('Disabled'), 'statut5', 'class="pictostatus"') . ' ' . Globals::$langs->trans('Disabled');
|
|
| 2331 | + return img_picto(Globals::$langs->trans('Disabled'), 'statut5', 'class="pictostatus"').' '.Globals::$langs->trans('Disabled');
|
|
| 2332 | 2332 | } |
| 2333 | 2333 | } elseif ($mode == 3) {
|
| 2334 | 2334 | if ($statut == 1) {
|
@@ -2338,15 +2338,15 @@ discard block |
||
| 2338 | 2338 | } |
| 2339 | 2339 | } elseif ($mode == 4) {
|
| 2340 | 2340 | if ($statut == 1) {
|
| 2341 | - return img_picto(Globals::$langs->trans('Enabled'), 'statut4', 'class="pictostatus"') . ' ' . Globals::$langs->trans('Enabled');
|
|
| 2341 | + return img_picto(Globals::$langs->trans('Enabled'), 'statut4', 'class="pictostatus"').' '.Globals::$langs->trans('Enabled');
|
|
| 2342 | 2342 | } elseif ($statut == 0) {
|
| 2343 | - return img_picto(Globals::$langs->trans('Disabled'), 'statut5', 'class="pictostatus"') . ' ' . Globals::$langs->trans('Disabled');
|
|
| 2343 | + return img_picto(Globals::$langs->trans('Disabled'), 'statut5', 'class="pictostatus"').' '.Globals::$langs->trans('Disabled');
|
|
| 2344 | 2344 | } |
| 2345 | 2345 | } elseif ($mode == 5) {
|
| 2346 | 2346 | if ($statut == 1) {
|
| 2347 | - return Globals::$langs->trans('Enabled') . ' ' . img_picto(Globals::$langs->trans('Enabled'), 'statut4', 'class="pictostatus"');
|
|
| 2347 | + return Globals::$langs->trans('Enabled').' '.img_picto(Globals::$langs->trans('Enabled'), 'statut4', 'class="pictostatus"');
|
|
| 2348 | 2348 | } elseif ($statut == 0) {
|
| 2349 | - return Globals::$langs->trans('Disabled') . ' ' . img_picto(Globals::$langs->trans('Disabled'), 'statut5', 'class="pictostatus"');
|
|
| 2349 | + return Globals::$langs->trans('Disabled').' '.img_picto(Globals::$langs->trans('Disabled'), 'statut5', 'class="pictostatus"');
|
|
| 2350 | 2350 | } |
| 2351 | 2351 | } |
| 2352 | 2352 | } |
@@ -2367,11 +2367,11 @@ discard block |
||
| 2367 | 2367 | global $conf; |
| 2368 | 2368 | $dn = ''; |
| 2369 | 2369 | if ($mode == 0) {
|
| 2370 | - $dn = Globals::$conf->global->LDAP_KEY_USERS . "=" . $info[$conf->global->LDAP_KEY_USERS] . "," . Globals::$conf->global->LDAP_USER_DN; |
|
| 2370 | + $dn = Globals::$conf->global->LDAP_KEY_USERS."=".$info[$conf->global->LDAP_KEY_USERS].",".Globals::$conf->global->LDAP_USER_DN; |
|
| 2371 | 2371 | } elseif ($mode == 1) {
|
| 2372 | 2372 | $dn = Globals::$conf->global->LDAP_USER_DN; |
| 2373 | 2373 | } elseif ($mode == 2) {
|
| 2374 | - $dn = Globals::$conf->global->LDAP_KEY_USERS . "=" . $info[$conf->global->LDAP_KEY_USERS]; |
|
| 2374 | + $dn = Globals::$conf->global->LDAP_KEY_USERS."=".$info[$conf->global->LDAP_KEY_USERS]; |
|
| 2375 | 2375 | } |
| 2376 | 2376 | return $dn; |
| 2377 | 2377 | } |
@@ -2569,8 +2569,8 @@ discard block |
||
| 2569 | 2569 | {
|
| 2570 | 2570 | $sql = "SELECT u.rowid, u.login as ref, u.datec,"; |
| 2571 | 2571 | $sql .= " u.tms as date_modification, u.entity"; |
| 2572 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user as u"; |
|
| 2573 | - $sql .= " WHERE u.rowid = " . $id; |
|
| 2572 | + $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; |
|
| 2573 | + $sql .= " WHERE u.rowid = ".$id; |
|
| 2574 | 2574 | |
| 2575 | 2575 | $result = Config::$dbEngine->query($sql); |
| 2576 | 2576 | if ($result) {
|
@@ -2599,9 +2599,9 @@ discard block |
||
| 2599 | 2599 | function getNbOfEMailings() |
| 2600 | 2600 | {
|
| 2601 | 2601 | $sql = "SELECT count(mc.email) as nb"; |
| 2602 | - $sql .= " FROM " . MAIN_DB_PREFIX . "mailing_cibles as mc"; |
|
| 2603 | - $sql .= " WHERE mc.email = '" . Config::$dbEngine->escape($this->email) . "'"; |
|
| 2604 | - $sql .= " AND mc.statut NOT IN (-1,0)"; // -1 erreur, 0 non envoye, 1 envoye avec succes |
|
| 2602 | + $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc"; |
|
| 2603 | + $sql .= " WHERE mc.email = '".Config::$dbEngine->escape($this->email)."'"; |
|
| 2604 | + $sql .= " AND mc.statut NOT IN (-1,0)"; // -1 erreur, 0 non envoye, 1 envoye avec succes |
|
| 2605 | 2605 | |
| 2606 | 2606 | $resql = Config::$dbEngine->query($sql); |
| 2607 | 2607 | if ($resql) {
|
@@ -2629,19 +2629,19 @@ discard block |
||
| 2629 | 2629 | global $conf; |
| 2630 | 2630 | |
| 2631 | 2631 | $sql = "SELECT count(rowid) as nb"; |
| 2632 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user"; |
|
| 2632 | + $sql .= " FROM ".MAIN_DB_PREFIX."user"; |
|
| 2633 | 2633 | if ($option == 'superadmin') {
|
| 2634 | 2634 | $sql .= " WHERE entity = 0"; |
| 2635 | 2635 | if ($admin >= 0) {
|
| 2636 | - $sql .= " AND admin = " . $admin; |
|
| 2636 | + $sql .= " AND admin = ".$admin; |
|
| 2637 | 2637 | } |
| 2638 | 2638 | } else {
|
| 2639 | - $sql .= " WHERE entity IN (" . getEntity('user', 0) . ")";
|
|
| 2639 | + $sql .= " WHERE entity IN (".getEntity('user', 0).")";
|
|
| 2640 | 2640 | if ($limitTo == 'active') {
|
| 2641 | 2641 | $sql .= " AND statut = 1"; |
| 2642 | 2642 | } |
| 2643 | 2643 | if ($admin >= 0) {
|
| 2644 | - $sql .= " AND admin = " . $admin; |
|
| 2644 | + $sql .= " AND admin = ".$admin; |
|
| 2645 | 2645 | } |
| 2646 | 2646 | } |
| 2647 | 2647 | |
@@ -2692,7 +2692,7 @@ discard block |
||
| 2692 | 2692 | |
| 2693 | 2693 | $result = $this->update(Globals::$user); |
| 2694 | 2694 | |
| 2695 | - DolUtils::dol_syslog(get_class($this) . "::update_ldap2dolibarr result=" . $result, LOG_DEBUG); |
|
| 2695 | + DolUtils::dol_syslog(get_class($this)."::update_ldap2dolibarr result=".$result, LOG_DEBUG); |
|
| 2696 | 2696 | |
| 2697 | 2697 | return $result; |
| 2698 | 2698 | } |
@@ -2707,10 +2707,10 @@ discard block |
||
| 2707 | 2707 | function get_children() |
| 2708 | 2708 | {
|
| 2709 | 2709 | // phpcs:enable |
| 2710 | - $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "user"; |
|
| 2711 | - $sql .= " WHERE fk_user = " . $this->id; |
|
| 2710 | + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."user"; |
|
| 2711 | + $sql .= " WHERE fk_user = ".$this->id; |
|
| 2712 | 2712 | |
| 2713 | - DolUtils::dol_syslog(get_class($this) . "::get_children result=" . $result, LOG_DEBUG); |
|
| 2713 | + DolUtils::dol_syslog(get_class($this)."::get_children result=".$result, LOG_DEBUG); |
|
| 2714 | 2714 | $res = Config::$dbEngine->query($sql); |
| 2715 | 2715 | if ($res) {
|
| 2716 | 2716 | $this->users = array(); |
@@ -2739,11 +2739,11 @@ discard block |
||
| 2739 | 2739 | |
| 2740 | 2740 | // Load array[child]=parent |
| 2741 | 2741 | $sql = "SELECT fk_user as id_parent, rowid as id_son"; |
| 2742 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user"; |
|
| 2742 | + $sql .= " FROM ".MAIN_DB_PREFIX."user"; |
|
| 2743 | 2743 | $sql .= " WHERE fk_user <> 0"; |
| 2744 | - $sql .= " AND entity IN (" . getEntity('user') . ")";
|
|
| 2744 | + $sql .= " AND entity IN (".getEntity('user').")";
|
|
| 2745 | 2745 | |
| 2746 | - DolUtils::dol_syslog(get_class($this) . "::loadParentOf", LOG_DEBUG); |
|
| 2746 | + DolUtils::dol_syslog(get_class($this)."::loadParentOf", LOG_DEBUG); |
|
| 2747 | 2747 | $resql = Config::$dbEngine->query($sql); |
| 2748 | 2748 | if ($resql) {
|
| 2749 | 2749 | while ($obj = Config::$dbEngine->fetch_object($resql)) {
|
@@ -2785,20 +2785,20 @@ discard block |
||
| 2785 | 2785 | |
| 2786 | 2786 | // Init $this->users array |
| 2787 | 2787 | $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 |
| 2788 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user as u"; |
|
| 2788 | + $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; |
|
| 2789 | 2789 | // Add fields from hooks |
| 2790 | 2790 | $parameters = array(); |
| 2791 | - $reshook = $hookmanager->executeHooks('printUserListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
|
| 2791 | + $reshook = $hookmanager->executeHooks('printUserListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
|
| 2792 | 2792 | if ($reshook > 0) {
|
| 2793 | 2793 | $sql .= $hookmanager->resPrint; |
| 2794 | 2794 | } else {
|
| 2795 | - $sql .= " WHERE u.entity IN (" . getEntity('user') . ")";
|
|
| 2795 | + $sql .= " WHERE u.entity IN (".getEntity('user').")";
|
|
| 2796 | 2796 | } |
| 2797 | 2797 | if ($filter) {
|
| 2798 | - $sql .= " AND " . $filter; |
|
| 2798 | + $sql .= " AND ".$filter; |
|
| 2799 | 2799 | } |
| 2800 | 2800 | |
| 2801 | - DolUtils::dol_syslog(get_class($this) . "::get_full_tree get user list", LOG_DEBUG); |
|
| 2801 | + DolUtils::dol_syslog(get_class($this)."::get_full_tree get user list", LOG_DEBUG); |
|
| 2802 | 2802 | $resql = Config::$dbEngine->query($sql); |
| 2803 | 2803 | if ($resql) {
|
| 2804 | 2804 | $i = 0; |
@@ -2824,7 +2824,7 @@ discard block |
||
| 2824 | 2824 | } |
| 2825 | 2825 | |
| 2826 | 2826 | // We add the fullpath property to each elements of first level (no parent exists) |
| 2827 | - DolUtils::dol_syslog(get_class($this) . "::get_full_tree call to build_path_from_id_user", LOG_DEBUG); |
|
| 2827 | + DolUtils::dol_syslog(get_class($this)."::get_full_tree call to build_path_from_id_user", LOG_DEBUG); |
|
| 2828 | 2828 | foreach ($this->users as $key => $val) {
|
| 2829 | 2829 | $result = $this->build_path_from_id_user($key, 0); // Process a branch from the root user key (this user has no parent) |
| 2830 | 2830 | if ($result < 0) {
|
@@ -2836,18 +2836,18 @@ discard block |
||
| 2836 | 2836 | // Exclude leaf including $deleteafterid from tree |
| 2837 | 2837 | if ($deleteafterid) {
|
| 2838 | 2838 | //print "Look to discard user ".$deleteafterid."\n"; |
| 2839 | - $keyfilter1 = '^' . $deleteafterid . '$'; |
|
| 2840 | - $keyfilter2 = '_' . $deleteafterid . '$'; |
|
| 2841 | - $keyfilter3 = '^' . $deleteafterid . '_'; |
|
| 2842 | - $keyfilter4 = '_' . $deleteafterid . '_'; |
|
| 2839 | + $keyfilter1 = '^'.$deleteafterid.'$'; |
|
| 2840 | + $keyfilter2 = '_'.$deleteafterid.'$'; |
|
| 2841 | + $keyfilter3 = '^'.$deleteafterid.'_'; |
|
| 2842 | + $keyfilter4 = '_'.$deleteafterid.'_'; |
|
| 2843 | 2843 | foreach ($this->users as $key => $val) {
|
| 2844 | - if (preg_match('/' . $keyfilter1 . '/', $val['fullpath']) || preg_match('/' . $keyfilter2 . '/', $val['fullpath']) || preg_match('/' . $keyfilter3 . '/', $val['fullpath']) || preg_match('/' . $keyfilter4 . '/', $val['fullpath'])) {
|
|
| 2844 | + if (preg_match('/'.$keyfilter1.'/', $val['fullpath']) || preg_match('/'.$keyfilter2.'/', $val['fullpath']) || preg_match('/'.$keyfilter3.'/', $val['fullpath']) || preg_match('/'.$keyfilter4.'/', $val['fullpath'])) {
|
|
| 2845 | 2845 | unset($this->users[$key]); |
| 2846 | 2846 | } |
| 2847 | 2847 | } |
| 2848 | 2848 | } |
| 2849 | 2849 | |
| 2850 | - DolUtils::dol_syslog(get_class($this) . "::get_full_tree dol_sort_array", LOG_DEBUG); |
|
| 2850 | + DolUtils::dol_syslog(get_class($this)."::get_full_tree dol_sort_array", LOG_DEBUG); |
|
| 2851 | 2851 | $this->users = dol_sort_array($this->users, 'fullname', 'asc', true, false); |
| 2852 | 2852 | |
| 2853 | 2853 | //var_dump($this->users); |
@@ -2875,10 +2875,10 @@ discard block |
||
| 2875 | 2875 | |
| 2876 | 2876 | $idtoscan = $this->id; |
| 2877 | 2877 | |
| 2878 | - DolUtils::dol_syslog("Build childid for id = " . $idtoscan);
|
|
| 2878 | + DolUtils::dol_syslog("Build childid for id = ".$idtoscan);
|
|
| 2879 | 2879 | foreach ($this->users as $id => $val) {
|
| 2880 | 2880 | //var_dump($val['fullpath']); |
| 2881 | - if (preg_match('/_' . $idtoscan . '_/', $val['fullpath'])) {
|
|
| 2881 | + if (preg_match('/_'.$idtoscan.'_/', $val['fullpath'])) {
|
|
| 2882 | 2882 | $childids[$val['id']] = $val['id']; |
| 2883 | 2883 | } |
| 2884 | 2884 | } |
@@ -2904,16 +2904,16 @@ discard block |
||
| 2904 | 2904 | function build_path_from_id_user($id_user, $protection = 0) |
| 2905 | 2905 | {
|
| 2906 | 2906 | // phpcs:enable |
| 2907 | - DolUtils::dol_syslog(get_class($this) . "::build_path_from_id_user id_user=" . $id_user . " protection=" . $protection, LOG_DEBUG); |
|
| 2907 | + DolUtils::dol_syslog(get_class($this)."::build_path_from_id_user id_user=".$id_user." protection=".$protection, LOG_DEBUG); |
|
| 2908 | 2908 | |
| 2909 | 2909 | if (!empty($this->users[$id_user]['fullpath'])) {
|
| 2910 | 2910 | // Already defined |
| 2911 | - DolUtils::dol_syslog(get_class($this) . "::build_path_from_id_user fullpath and fullname already defined", LOG_WARNING); |
|
| 2911 | + DolUtils::dol_syslog(get_class($this)."::build_path_from_id_user fullpath and fullname already defined", LOG_WARNING); |
|
| 2912 | 2912 | return 0; |
| 2913 | 2913 | } |
| 2914 | 2914 | |
| 2915 | 2915 | // Define fullpath and fullname |
| 2916 | - $this->users[$id_user]['fullpath'] = '_' . $id_user; |
|
| 2916 | + $this->users[$id_user]['fullpath'] = '_'.$id_user; |
|
| 2917 | 2917 | $this->users[$id_user]['fullname'] = $this->users[$id_user]['lastname']; |
| 2918 | 2918 | $i = 0; |
| 2919 | 2919 | $cursor_user = $id_user; |
@@ -2922,11 +2922,11 @@ discard block |
||
| 2922 | 2922 | while (!empty($this->parentof[$cursor_user])) {
|
| 2923 | 2923 | if (in_array($this->parentof[$cursor_user], Globals::$useridfound)) {
|
| 2924 | 2924 | DolUtils::dol_syslog("The hierarchy of user has a recursive loop", LOG_WARNING);
|
| 2925 | - return -1; // Should not happen. Protection against looping hierarchy |
|
| 2925 | + return -1; // Should not happen. Protection against looping hierarchy |
|
| 2926 | 2926 | } |
| 2927 | 2927 | Globals::$useridfound[] = $this->parentof[$cursor_user]; |
| 2928 | - $this->users[$id_user]['fullpath'] = '_' . $this->parentof[$cursor_user] . $this->users[$id_user]['fullpath']; |
|
| 2929 | - $this->users[$id_user]['fullname'] = $this->users[$this->parentof[$cursor_user]]['lastname'] . ' >> ' . $this->users[$id_user]['fullname']; |
|
| 2928 | + $this->users[$id_user]['fullpath'] = '_'.$this->parentof[$cursor_user].$this->users[$id_user]['fullpath']; |
|
| 2929 | + $this->users[$id_user]['fullname'] = $this->users[$this->parentof[$cursor_user]]['lastname'].' >> '.$this->users[$id_user]['fullname']; |
|
| 2930 | 2930 | $i++; |
| 2931 | 2931 | $cursor_user = $this->parentof[$cursor_user]; |
| 2932 | 2932 | } |
@@ -2968,10 +2968,10 @@ discard block |
||
| 2968 | 2968 | $this->nb = array(); |
| 2969 | 2969 | |
| 2970 | 2970 | $sql = "SELECT count(u.rowid) as nb"; |
| 2971 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user as u"; |
|
| 2971 | + $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; |
|
| 2972 | 2972 | $sql .= " WHERE u.statut > 0"; |
| 2973 | 2973 | //$sql.= " AND employee != 0"; |
| 2974 | - $sql .= " AND u.entity IN (" . getEntity('user') . ")";
|
|
| 2974 | + $sql .= " AND u.entity IN (".getEntity('user').")";
|
|
| 2975 | 2975 | |
| 2976 | 2976 | $resql = Config::$dbEngine->query($sql); |
| 2977 | 2977 | if ($resql) {
|
@@ -3036,8 +3036,8 @@ discard block |
||
| 3036 | 3036 | } |
| 3037 | 3037 | |
| 3038 | 3038 | $sql = "SELECT rowid, email, user_mobile, civility, lastname, firstname"; |
| 3039 | - $sql .= " FROM " . MAIN_DB_PREFIX . "user"; |
|
| 3040 | - $sql .= " WHERE rowid = '" . $rowid . "'"; |
|
| 3039 | + $sql .= " FROM ".MAIN_DB_PREFIX."user"; |
|
| 3040 | + $sql .= " WHERE rowid = '".$rowid."'"; |
|
| 3041 | 3041 | |
| 3042 | 3042 | $resql = Config::$dbEngine->query($sql); |
| 3043 | 3043 | if ($resql) {
|
@@ -3047,7 +3047,7 @@ discard block |
||
| 3047 | 3047 | $obj = Config::$dbEngine->fetch_object($resql); |
| 3048 | 3048 | |
| 3049 | 3049 | if ($mode == 'email') {
|
| 3050 | - $this->user_property = dolGetFirstLastname($obj->firstname, $obj->lastname) . " <" . $obj->email . ">"; |
|
| 3050 | + $this->user_property = dolGetFirstLastname($obj->firstname, $obj->lastname)." <".$obj->email.">"; |
|
| 3051 | 3051 | } else if ($mode == 'mobile') {
|
| 3052 | 3052 | $this->user_property = $obj->user_mobile; |
| 3053 | 3053 | } |
@@ -3074,7 +3074,7 @@ discard block |
||
| 3074 | 3074 | global $conf; |
| 3075 | 3075 | |
| 3076 | 3076 | $sql = "SELECT t.rowid"; |
| 3077 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t '; |
|
| 3077 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t '; |
|
| 3078 | 3078 | $sql .= " WHERE 1"; |
| 3079 | 3079 | |
| 3080 | 3080 | // Manage filter |
@@ -3082,25 +3082,25 @@ discard block |
||
| 3082 | 3082 | if (!empty($filter)) {
|
| 3083 | 3083 | foreach ($filter as $key => $value) {
|
| 3084 | 3084 | if ($key == 't.rowid') {
|
| 3085 | - $sqlwhere[] = $key . '=' . $value; |
|
| 3085 | + $sqlwhere[] = $key.'='.$value; |
|
| 3086 | 3086 | } elseif (strpos($key, 'date') !== false) {
|
| 3087 | - $sqlwhere[] = $key . ' = \'' . Config::$dbEngine->idate($value) . '\''; |
|
| 3087 | + $sqlwhere[] = $key.' = \''.Config::$dbEngine->idate($value).'\''; |
|
| 3088 | 3088 | } elseif ($key == 'customsql') {
|
| 3089 | 3089 | $sqlwhere[] = $value; |
| 3090 | 3090 | } else {
|
| 3091 | - $sqlwhere[] = $key . ' LIKE \'%' . Config::$dbEngine->escape($value) . '%\''; |
|
| 3091 | + $sqlwhere[] = $key.' LIKE \'%'.Config::$dbEngine->escape($value).'%\''; |
|
| 3092 | 3092 | } |
| 3093 | 3093 | } |
| 3094 | 3094 | } |
| 3095 | 3095 | if (count($sqlwhere) > 0) {
|
| 3096 | - $sql .= ' AND (' . implode(' ' . $filtermode . ' ', $sqlwhere) . ')';
|
|
| 3096 | + $sql .= ' AND ('.implode(' '.$filtermode.' ', $sqlwhere).')';
|
|
| 3097 | 3097 | } |
| 3098 | 3098 | $sql .= Config::$dbEngine->order($sortfield, $sortorder); |
| 3099 | 3099 | if ($limit) {
|
| 3100 | 3100 | $sql .= Config::$dbEngine->plimit($limit + 1, $offset); |
| 3101 | 3101 | } |
| 3102 | 3102 | |
| 3103 | - DolUtils::dol_syslog(get_class($this) . "::" . __METHOD__, LOG_DEBUG); |
|
| 3103 | + DolUtils::dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG); |
|
| 3104 | 3104 | |
| 3105 | 3105 | $resql = Config::$dbEngine->query($sql); |
| 3106 | 3106 | if ($resql) {
|
@@ -50,13 +50,13 @@ discard block |
||
| 50 | 50 | // Note: the function dol_getprefix may have been redefined to return a different key to manage another area to protect. |
| 51 | 51 | $prefix = DolUtils::dol_getprefix(''); |
| 52 | 52 | |
| 53 | - $sessionname = 'DOLSESSID_' . $prefix; |
|
| 54 | - $sessiontimeout = 'DOLSESSTIMEOUT_' . $prefix; |
|
| 53 | + $sessionname = 'DOLSESSID_'.$prefix; |
|
| 54 | + $sessiontimeout = 'DOLSESSTIMEOUT_'.$prefix; |
|
| 55 | 55 | if (!empty($_COOKIE[$sessiontimeout])) { |
| 56 | 56 | ini_set('session.gc_maxlifetime', $_COOKIE[$sessiontimeout]); |
| 57 | 57 | } |
| 58 | 58 | session_name($sessionname); |
| 59 | - session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start. |
|
| 59 | + session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start. |
|
| 60 | 60 | // This create lock, released when session_write_close() or end of page. |
| 61 | 61 | // We need this lock as long as we read/write $_SESSION ['vars']. We can remove lock when finished. |
| 62 | 62 | if (!defined('NOSESSION')) { |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | Globals::$conf->browser->name = $tmp['browsername']; |
| 81 | 81 | Globals::$conf->browser->os = $tmp['browseros']; |
| 82 | 82 | Globals::$conf->browser->version = $tmp['browserversion']; |
| 83 | - Globals::$conf->browser->layout = $tmp['layout']; // 'classic', 'phone', 'tablet' |
|
| 83 | + Globals::$conf->browser->layout = $tmp['layout']; // 'classic', 'phone', 'tablet' |
|
| 84 | 84 | //var_dump(Globals::$conf->browser); |
| 85 | 85 | |
| 86 | 86 | if (Globals::$conf->browser->layout == 'phone') { |
@@ -101,18 +101,18 @@ discard block |
||
| 101 | 101 | $newurl = preg_replace('/^http:/i', 'https:', $_SERVER["SCRIPT_URI"]); |
| 102 | 102 | } |
| 103 | 103 | } else { // Check HTTPS environment variable (Apache/mod_ssl only) |
| 104 | - $newurl = preg_replace('/^http:/i', 'https:', DOL_MAIN_URL_ROOT) . $_SERVER["REQUEST_URI"]; |
|
| 104 | + $newurl = preg_replace('/^http:/i', 'https:', DOL_MAIN_URL_ROOT).$_SERVER["REQUEST_URI"]; |
|
| 105 | 105 | } |
| 106 | 106 | } else { |
| 107 | 107 | // Check HTTPS environment variable (Apache/mod_ssl only) |
| 108 | - $newurl = Globals::$conf->file->main_force_https . $_SERVER["REQUEST_URI"]; |
|
| 108 | + $newurl = Globals::$conf->file->main_force_https.$_SERVER["REQUEST_URI"]; |
|
| 109 | 109 | } |
| 110 | 110 | // Start redirect |
| 111 | 111 | if ($newurl) { |
| 112 | - DolUtils::dol_syslog("main.inc: dolibarr_main_force_https is on, we make a redirect to " . $newurl); |
|
| 112 | + DolUtils::dol_syslog("main.inc: dolibarr_main_force_https is on, we make a redirect to ".$newurl); |
|
| 113 | 113 | echo $newurl; |
| 114 | 114 | throw Exception('x'); |
| 115 | - header("Location: " . $newurl); |
|
| 115 | + header("Location: ".$newurl); |
|
| 116 | 116 | exit; |
| 117 | 117 | } else { |
| 118 | 118 | DolUtils::dol_syslog("main.inc: dolibarr_main_force_https is on but we failed to forge new https url so no redirect is done", LOG_WARNING); |
@@ -137,29 +137,29 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | // Loading of additional presentation includes |
| 139 | 139 | if (!defined('NOREQUIREHTML')) { |
| 140 | - require_once DOL_BASE_PATH . '/core/class/html.form.class.php'; // Need 660ko memory (800ko in 2.2) |
|
| 140 | + require_once DOL_BASE_PATH.'/core/class/html.form.class.php'; // Need 660ko memory (800ko in 2.2) |
|
| 141 | 141 | } |
| 142 | 142 | if (!defined('NOREQUIREAJAX') && Globals::$conf->use_javascript_ajax) { |
| 143 | - require_once DOL_BASE_PATH . '/core/lib/ajax.lib.php'; // Need 22ko memory |
|
| 143 | + require_once DOL_BASE_PATH.'/core/lib/ajax.lib.php'; // Need 22ko memory |
|
| 144 | 144 | } |
| 145 | 145 | // If install or upgrade process not done or not completely finished, we call the install page. |
| 146 | 146 | if (!empty(Globals::$conf->global->MAIN_NOT_INSTALLED) || !empty(Globals::$conf->global->MAIN_NOT_UPGRADED)) { |
| 147 | 147 | DolUtils::dol_syslog("main.inc: A previous install or upgrade was not complete. Redirect to install page.", LOG_WARNING); |
| 148 | 148 | throw Exception('x'); |
| 149 | - header("Location: " . DOL_BASE_URI . "/install/index.php"); |
|
| 149 | + header("Location: ".DOL_BASE_URI."/install/index.php"); |
|
| 150 | 150 | exit; |
| 151 | 151 | } |
| 152 | 152 | // If an upgrade process is required, we call the install page. |
| 153 | 153 | if ((!empty(Globals::$conf->global->MAIN_VERSION_LAST_UPGRADE) && (Globals::$conf->global->MAIN_VERSION_LAST_UPGRADE != DOL_VERSION)) || (empty(Globals::$conf->global->MAIN_VERSION_LAST_UPGRADE) && !empty(Globals::$conf->global->MAIN_VERSION_LAST_INSTALL) && (Globals::$conf->global->MAIN_VERSION_LAST_INSTALL != DOL_VERSION))) { |
| 154 | 154 | $versiontocompare = empty(Globals::$conf->global->MAIN_VERSION_LAST_UPGRADE) ? Globals::$conf->global->MAIN_VERSION_LAST_INSTALL : Globals::$conf->global->MAIN_VERSION_LAST_UPGRADE; |
| 155 | - require_once DOL_BASE_PATH . '/core/lib/admin.lib.php'; |
|
| 155 | + require_once DOL_BASE_PATH.'/core/lib/admin.lib.php'; |
|
| 156 | 156 | $dolibarrversionlastupgrade = preg_split('/[.-]/', $versiontocompare); |
| 157 | 157 | $dolibarrversionprogram = preg_split('/[.-]/', DOL_VERSION); |
| 158 | 158 | $rescomp = versioncompare($dolibarrversionprogram, $dolibarrversionlastupgrade); |
| 159 | 159 | if ($rescomp > 0) { // Programs have a version higher than database. We did not add "&& $rescomp < 3" because we want upgrade process for build upgrades |
| 160 | - DolUtils::dol_syslog("main.inc: database version " . $versiontocompare . " is lower than programs version " . DOL_VERSION . ". Redirect to install page.", LOG_WARNING); |
|
| 160 | + DolUtils::dol_syslog("main.inc: database version ".$versiontocompare." is lower than programs version ".DOL_VERSION.". Redirect to install page.", LOG_WARNING); |
|
| 161 | 161 | throw Exception('x'); |
| 162 | - header("Location: " . DOL_BASE_URI . "/install/index.php"); |
|
| 162 | + header("Location: ".DOL_BASE_URI."/install/index.php"); |
|
| 163 | 163 | exit; |
| 164 | 164 | } |
| 165 | 165 | } |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | } |
| 184 | 184 | if ($_SERVER['REQUEST_METHOD'] === 'POST') { // This test must be after loading $_SESSION['token']. |
| 185 | 185 | if (DolUtils::GETPOST('token', 'alpha') != $_SESSION['token']) { |
| 186 | - DolUtils::dol_syslog("Invalid token in " . $_SERVER['HTTP_REFERER'] . ", action=" . DolUtils::GETPOST('action', 'aZ09') . ", _POST['token']=" . DolUtils::GETPOST('token', 'alpha') . ", _SESSION['token']=" . $_SESSION['token'], LOG_WARNING); |
|
| 186 | + DolUtils::dol_syslog("Invalid token in ".$_SERVER['HTTP_REFERER'].", action=".DolUtils::GETPOST('action', 'aZ09').", _POST['token']=".DolUtils::GETPOST('token', 'alpha').", _SESSION['token']=".$_SESSION['token'], LOG_WARNING); |
|
| 187 | 187 | //print 'Unset POST by CSRF protection in main.inc.php.'; // Do not output anything because this create problems when using the BACK button on browsers. |
| 188 | 188 | unset($_POST); |
| 189 | 189 | } |
@@ -261,19 +261,19 @@ discard block |
||
| 261 | 261 | $dol_use_jmobile = DolUtils::GETPOST('dol_use_jmobile', 'int', 3); |
| 262 | 262 | //dol_syslog("POST key=".join(array_keys($_POST),',').' value='.join($_POST,',')); |
| 263 | 263 | // If in demo mode, we check we go to home page through the public/demo/index.php page |
| 264 | - if (!empty($dolibarr_main_demo) && $_SERVER['PHP_SELF'] == DOL_BASE_URI . '/index.php') { // We ask index page |
|
| 264 | + if (!empty($dolibarr_main_demo) && $_SERVER['PHP_SELF'] == DOL_BASE_URI.'/index.php') { // We ask index page |
|
| 265 | 265 | if (empty($_SERVER['HTTP_REFERER']) || !preg_match('/public/', $_SERVER['HTTP_REFERER'])) { |
| 266 | - DolUtils::dol_syslog("Call index page from another url than demo page (call is done from page " . $_SERVER['HTTP_REFERER'] . ")"); |
|
| 266 | + DolUtils::dol_syslog("Call index page from another url than demo page (call is done from page ".$_SERVER['HTTP_REFERER'].")"); |
|
| 267 | 267 | $url = ''; |
| 268 | - $url .= ($url ? '&' : '') . ($dol_hide_topmenu ? 'dol_hide_topmenu=' . $dol_hide_topmenu : ''); |
|
| 269 | - $url .= ($url ? '&' : '') . ($dol_hide_leftmenu ? 'dol_hide_leftmenu=' . $dol_hide_leftmenu : ''); |
|
| 270 | - $url .= ($url ? '&' : '') . ($dol_optimize_smallscreen ? 'dol_optimize_smallscreen=' . $dol_optimize_smallscreen : ''); |
|
| 271 | - $url .= ($url ? '&' : '') . ($dol_no_mouse_hover ? 'dol_no_mouse_hover=' . $dol_no_mouse_hover : ''); |
|
| 272 | - $url .= ($url ? '&' : '') . ($dol_use_jmobile ? 'dol_use_jmobile=' . $dol_use_jmobile : ''); |
|
| 273 | - $url = DOL_BASE_URI . '/public/demo/index.php' . ($url ? '?' . $url : ''); |
|
| 268 | + $url .= ($url ? '&' : '').($dol_hide_topmenu ? 'dol_hide_topmenu='.$dol_hide_topmenu : ''); |
|
| 269 | + $url .= ($url ? '&' : '').($dol_hide_leftmenu ? 'dol_hide_leftmenu='.$dol_hide_leftmenu : ''); |
|
| 270 | + $url .= ($url ? '&' : '').($dol_optimize_smallscreen ? 'dol_optimize_smallscreen='.$dol_optimize_smallscreen : ''); |
|
| 271 | + $url .= ($url ? '&' : '').($dol_no_mouse_hover ? 'dol_no_mouse_hover='.$dol_no_mouse_hover : ''); |
|
| 272 | + $url .= ($url ? '&' : '').($dol_use_jmobile ? 'dol_use_jmobile='.$dol_use_jmobile : ''); |
|
| 273 | + $url = DOL_BASE_URI.'/public/demo/index.php'.($url ? '?'.$url : ''); |
|
| 274 | 274 | echo $url; |
| 275 | 275 | throw Exception('x'); |
| 276 | - header("Location: " . $url); |
|
| 276 | + header("Location: ".$url); |
|
| 277 | 277 | exit; |
| 278 | 278 | } |
| 279 | 279 | } |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | $test = false; |
| 294 | 294 | |
| 295 | 295 | // Call trigger for the "security events" log |
| 296 | - Globals::$user->trigger_mesg = 'ErrorBadValueForCode - login=' . DolUtils::GETPOST("username", "alpha", 2); |
|
| 296 | + Globals::$user->trigger_mesg = 'ErrorBadValueForCode - login='.DolUtils::GETPOST("username", "alpha", 2); |
|
| 297 | 297 | // Call of triggers |
| 298 | 298 | //include_once DOL_BASE_PATH . '/core/class/interfaces.class.php'; |
| 299 | 299 | $interface = new Interfaces($db); |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | $action = ''; |
| 307 | 307 | Globals::$hookManager->initHooks(array('login')); |
| 308 | 308 | $parameters = array('dol_authmode' => $this->dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]); |
| 309 | - $reshook = Globals::$hookManager->executeHooks('afterLoginFailed', $parameters, Globals::$user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 309 | + $reshook = Globals::$hookManager->executeHooks('afterLoginFailed', $parameters, Globals::$user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 310 | 310 | if ($reshook < 0) |
| 311 | 311 | $error++; |
| 312 | 312 | |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | // Call trigger for the "security events" log |
| 384 | - Globals::$user->trigger_mesg = Globals::$langs->trans("ErrorBadLoginPassword") . ' - login=' . DolUtils::GETPOST("username", "alpha", 2); |
|
| 384 | + Globals::$user->trigger_mesg = Globals::$langs->trans("ErrorBadLoginPassword").' - login='.DolUtils::GETPOST("username", "alpha", 2); |
|
| 385 | 385 | |
| 386 | 386 | // Call of triggers |
| 387 | 387 | //include_once DOL_BASE_PATH . '/core/class/interfaces.class.php'; |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | $action = ''; |
| 396 | 396 | Globals::$hookManager->initHooks(array('login')); |
| 397 | 397 | $parameters = array('dol_authmode' => $this->dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]); |
| 398 | - $reshook = Globals::$hookManager->executeHooks('afterLoginFailed', $parameters, Globals::$user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 398 | + $reshook = Globals::$hookManager->executeHooks('afterLoginFailed', $parameters, Globals::$user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 399 | 399 | if ($reshook < 0) { |
| 400 | 400 | $error++; |
| 401 | 401 | } |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | // End test login / passwords |
| 408 | 408 | if (!$login || (in_array('ldap', $this->authmode) && empty($passwordtotest))) { // With LDAP we refused empty password because some LDAP are "opened" for anonymous access so connexion is a success. |
| 409 | 409 | // No data to test login, so we show the login page |
| 410 | - DolUtils::dol_syslog("--- Access to " . $_SERVER["PHP_SELF"] . " showing the login form and exit"); |
|
| 410 | + DolUtils::dol_syslog("--- Access to ".$_SERVER["PHP_SELF"]." showing the login form and exit"); |
|
| 411 | 411 | if (defined('NOREDIRECTBYMAINTOLOGIN')) { |
| 412 | 412 | return 'ERROR_NOT_LOGGED'; |
| 413 | 413 | } else { |
@@ -422,8 +422,8 @@ discard block |
||
| 422 | 422 | DolUtils::dol_syslog('User not found, connexion refused'); |
| 423 | 423 | session_destroy(); |
| 424 | 424 | session_name($sessionname); |
| 425 | - session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie |
|
| 426 | - session_start(); // Fixing the bug of register_globals here is useless since session is empty |
|
| 425 | + session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie |
|
| 426 | + session_start(); // Fixing the bug of register_globals here is useless since session is empty |
|
| 427 | 427 | |
| 428 | 428 | if ($resultFetchUser == 0) { |
| 429 | 429 | // Load translation files required by page |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | |
| 432 | 432 | $_SESSION["dol_loginmesg"] = Globals::$langs->trans("ErrorCantLoadUserFromDolibarrDatabase", $login); |
| 433 | 433 | |
| 434 | - Globals::$user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login=' . $login; |
|
| 434 | + Globals::$user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login='.$login; |
|
| 435 | 435 | } |
| 436 | 436 | if ($resultFetchUser < 0) { |
| 437 | 437 | $_SESSION["dol_loginmesg"] = Globals::$user->error; |
@@ -451,40 +451,40 @@ discard block |
||
| 451 | 451 | $action = ''; |
| 452 | 452 | Globals::$hookManager->initHooks(array('login')); |
| 453 | 453 | $parameters = array('dol_authmode' => $this->dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]); |
| 454 | - $reshook = Globals::$hookManager->executeHooks('afterLoginFailed', $parameters, Globals::$user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 454 | + $reshook = Globals::$hookManager->executeHooks('afterLoginFailed', $parameters, Globals::$user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 455 | 455 | if ($reshook < 0) { |
| 456 | 456 | $error++; |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | $paramsurl = array(); |
| 460 | 460 | if (DolUtils::GETPOST('textbrowser', 'int')) { |
| 461 | - $paramsurl[] = 'textbrowser=' . DolUtils::GETPOST('textbrowser', 'int'); |
|
| 461 | + $paramsurl[] = 'textbrowser='.DolUtils::GETPOST('textbrowser', 'int'); |
|
| 462 | 462 | } |
| 463 | 463 | if (DolUtils::GETPOST('nojs', 'int')) { |
| 464 | - $paramsurl[] = 'nojs=' . DolUtils::GETPOST('nojs', 'int'); |
|
| 464 | + $paramsurl[] = 'nojs='.DolUtils::GETPOST('nojs', 'int'); |
|
| 465 | 465 | } |
| 466 | 466 | if (DolUtils::GETPOST('lang', 'aZ09')) { |
| 467 | - $paramsurl[] = 'lang=' . DolUtils::GETPOST('lang', 'aZ09'); |
|
| 467 | + $paramsurl[] = 'lang='.DolUtils::GETPOST('lang', 'aZ09'); |
|
| 468 | 468 | } |
| 469 | - echo 'Location: ' . DOL_BASE_URI . '/index.php' . (count($paramsurl) ? '?' . implode('&', $paramsurl) : ''); |
|
| 469 | + echo 'Location: '.DOL_BASE_URI.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : ''); |
|
| 470 | 470 | throw Exception('x'); |
| 471 | - header('Location: ' . DOL_BASE_URI . '/index.php' . (count($paramsurl) ? '?' . implode('&', $paramsurl) : '')); |
|
| 471 | + header('Location: '.DOL_BASE_URI.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : '')); |
|
| 472 | 472 | exit; |
| 473 | 473 | } |
| 474 | 474 | } else { |
| 475 | 475 | // We are already into an authenticated session |
| 476 | 476 | $login = $_SESSION["dol_login"]; |
| 477 | 477 | $entity = $_SESSION["dol_entity"]; |
| 478 | - DolUtils::dol_syslog("- This is an already logged session. _SESSION['dol_login']=" . $login . " _SESSION['dol_entity']=" . $entity, LOG_DEBUG); |
|
| 478 | + DolUtils::dol_syslog("- This is an already logged session. _SESSION['dol_login']=".$login." _SESSION['dol_entity']=".$entity, LOG_DEBUG); |
|
| 479 | 479 | |
| 480 | 480 | $resultFetchUser = Globals::$user->fetch('', $login, '', 1, ($entity > 0 ? $entity : -1)); |
| 481 | 481 | if ($resultFetchUser <= 0) { |
| 482 | 482 | // Account has been removed after login |
| 483 | - DolUtils::dol_syslog("Can't load user even if session logged. _SESSION['dol_login']=" . $login, LOG_WARNING); |
|
| 483 | + DolUtils::dol_syslog("Can't load user even if session logged. _SESSION['dol_login']=".$login, LOG_WARNING); |
|
| 484 | 484 | session_destroy(); |
| 485 | 485 | session_name($sessionname); |
| 486 | - session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie |
|
| 487 | - session_start(); // Fixing the bug of register_globals here is useless since session is empty |
|
| 486 | + session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie |
|
| 487 | + session_start(); // Fixing the bug of register_globals here is useless since session is empty |
|
| 488 | 488 | |
| 489 | 489 | if ($resultFetchUser == 0) { |
| 490 | 490 | // Load translation files required by page |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | |
| 493 | 493 | $_SESSION["dol_loginmesg"] = Globals::$langs->trans("ErrorCantLoadUserFromDolibarrDatabase", $login); |
| 494 | 494 | |
| 495 | - Globals::$user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login=' . $login; |
|
| 495 | + Globals::$user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login='.$login; |
|
| 496 | 496 | } |
| 497 | 497 | if ($resultFetchUser < 0) { |
| 498 | 498 | $_SESSION["dol_loginmesg"] = Globals::$user->error; |
@@ -512,24 +512,24 @@ discard block |
||
| 512 | 512 | $action = ''; |
| 513 | 513 | Globals::$hookManager->initHooks(array('login')); |
| 514 | 514 | $parameters = array('dol_authmode' => $this->dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]); |
| 515 | - $reshook = Globals::$hookManager->executeHooks('afterLoginFailed', $parameters, Globals::$user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 515 | + $reshook = Globals::$hookManager->executeHooks('afterLoginFailed', $parameters, Globals::$user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 516 | 516 | if ($reshook < 0) { |
| 517 | 517 | $error++; |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | $paramsurl = array(); |
| 521 | 521 | if (DolUtils::GETPOST('textbrowser', 'int')) { |
| 522 | - $paramsurl[] = 'textbrowser=' . DolUtils::GETPOST('textbrowser', 'int'); |
|
| 522 | + $paramsurl[] = 'textbrowser='.DolUtils::GETPOST('textbrowser', 'int'); |
|
| 523 | 523 | } |
| 524 | 524 | if (DolUtils::GETPOST('nojs', 'int')) { |
| 525 | - $paramsurl[] = 'nojs=' . DolUtils::GETPOST('nojs', 'int'); |
|
| 525 | + $paramsurl[] = 'nojs='.DolUtils::GETPOST('nojs', 'int'); |
|
| 526 | 526 | } |
| 527 | 527 | if (DolUtils::GETPOST('lang', 'aZ09')) { |
| 528 | - $paramsurl[] = 'lang=' . DolUtils::GETPOST('lang', 'aZ09'); |
|
| 528 | + $paramsurl[] = 'lang='.DolUtils::GETPOST('lang', 'aZ09'); |
|
| 529 | 529 | } |
| 530 | - echo 'Location: ' . DOL_BASE_URI . '/index.php' . (count($paramsurl) ? '?' . implode('&', $paramsurl) : ''); |
|
| 530 | + echo 'Location: '.DOL_BASE_URI.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : ''); |
|
| 531 | 531 | throw Exception('x'); |
| 532 | - header('Location: ' . DOL_BASE_URI . '/index.php' . (count($paramsurl) ? '?' . implode('&', $paramsurl) : '')); |
|
| 532 | + header('Location: '.DOL_BASE_URI.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : '')); |
|
| 533 | 533 | exit; |
| 534 | 534 | } else { |
| 535 | 535 | // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
@@ -538,30 +538,30 @@ discard block |
||
| 538 | 538 | // Code for search criteria persistence. |
| 539 | 539 | if (!empty($_GET['save_lastsearch_values'])) { // We must use $_GET here |
| 540 | 540 | $relativepathstring = preg_replace('/\?.*$/', '', $_SERVER["HTTP_REFERER"]); |
| 541 | - $relativepathstring = preg_replace('/^https?:\/\/[^\/]*/', '', $relativepathstring); // Get full path except host server |
|
| 541 | + $relativepathstring = preg_replace('/^https?:\/\/[^\/]*/', '', $relativepathstring); // Get full path except host server |
|
| 542 | 542 | // Clean $relativepathstring |
| 543 | 543 | if (constant('DOL_BASE_URI')) { |
| 544 | - $relativepathstring = preg_replace('/^' . preg_quote(constant('DOL_BASE_URI'), '/') . '/', '', $relativepathstring); |
|
| 544 | + $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_BASE_URI'), '/').'/', '', $relativepathstring); |
|
| 545 | 545 | } |
| 546 | 546 | $relativepathstring = preg_replace('/^\//', '', $relativepathstring); |
| 547 | 547 | $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring); |
| 548 | 548 | //var_dump($relativepathstring); |
| 549 | 549 | // We click on a link that leave a page we have to save search criteria, contextpage, limit and page. We save them from tmp to no tmp |
| 550 | - if (!empty($_SESSION['lastsearch_values_tmp_' . $relativepathstring])) { |
|
| 551 | - $_SESSION['lastsearch_values_' . $relativepathstring] = $_SESSION['lastsearch_values_tmp_' . $relativepathstring]; |
|
| 552 | - unset($_SESSION['lastsearch_values_tmp_' . $relativepathstring]); |
|
| 550 | + if (!empty($_SESSION['lastsearch_values_tmp_'.$relativepathstring])) { |
|
| 551 | + $_SESSION['lastsearch_values_'.$relativepathstring] = $_SESSION['lastsearch_values_tmp_'.$relativepathstring]; |
|
| 552 | + unset($_SESSION['lastsearch_values_tmp_'.$relativepathstring]); |
|
| 553 | 553 | } |
| 554 | - if (!empty($_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring])) { |
|
| 555 | - $_SESSION['lastsearch_contextpage_' . $relativepathstring] = $_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring]; |
|
| 556 | - unset($_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring]); |
|
| 554 | + if (!empty($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring])) { |
|
| 555 | + $_SESSION['lastsearch_contextpage_'.$relativepathstring] = $_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]; |
|
| 556 | + unset($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]); |
|
| 557 | 557 | } |
| 558 | - if (!empty($_SESSION['lastsearch_page_tmp_' . $relativepathstring]) && $_SESSION['lastsearch_page_tmp_' . $relativepathstring] > 1) { |
|
| 559 | - $_SESSION['lastsearch_page_' . $relativepathstring] = $_SESSION['lastsearch_page_tmp_' . $relativepathstring]; |
|
| 560 | - unset($_SESSION['lastsearch_page_tmp_' . $relativepathstring]); |
|
| 558 | + if (!empty($_SESSION['lastsearch_page_tmp_'.$relativepathstring]) && $_SESSION['lastsearch_page_tmp_'.$relativepathstring] > 1) { |
|
| 559 | + $_SESSION['lastsearch_page_'.$relativepathstring] = $_SESSION['lastsearch_page_tmp_'.$relativepathstring]; |
|
| 560 | + unset($_SESSION['lastsearch_page_tmp_'.$relativepathstring]); |
|
| 561 | 561 | } |
| 562 | - if (!empty($_SESSION['lastsearch_limit_tmp_' . $relativepathstring]) && $_SESSION['lastsearch_limit_tmp_' . $relativepathstring] != Globals::$conf->liste_limit) { |
|
| 563 | - $_SESSION['lastsearch_limit_' . $relativepathstring] = $_SESSION['lastsearch_limit_tmp_' . $relativepathstring]; |
|
| 564 | - unset($_SESSION['lastsearch_limit_tmp_' . $relativepathstring]); |
|
| 562 | + if (!empty($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]) && $_SESSION['lastsearch_limit_tmp_'.$relativepathstring] != Globals::$conf->liste_limit) { |
|
| 563 | + $_SESSION['lastsearch_limit_'.$relativepathstring] = $_SESSION['lastsearch_limit_tmp_'.$relativepathstring]; |
|
| 564 | + unset($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]); |
|
| 565 | 565 | } |
| 566 | 566 | } |
| 567 | 567 | |
@@ -609,13 +609,13 @@ discard block |
||
| 609 | 609 | $_SESSION['dol_use_jmobile'] = $dol_use_jmobile; |
| 610 | 610 | } |
| 611 | 611 | |
| 612 | - DolUtils::dol_syslog("This is a new started user session. _SESSION['dol_login']=" . $_SESSION["dol_login"] . " Session id=" . session_id()); |
|
| 612 | + DolUtils::dol_syslog("This is a new started user session. _SESSION['dol_login']=".$_SESSION["dol_login"]." Session id=".session_id()); |
|
| 613 | 613 | |
| 614 | 614 | Config::$dbEngine->begin(); |
| 615 | 615 | |
| 616 | 616 | Globals::$user->update_last_login_date(); |
| 617 | 617 | |
| 618 | - $loginfo = 'TZ=' . $_SESSION["dol_tz"] . ';TZString=' . $_SESSION["dol_tz_string"] . ';Screen=' . $_SESSION["dol_screenwidth"] . 'x' . $_SESSION["dol_screenheight"]; |
|
| 618 | + $loginfo = 'TZ='.$_SESSION["dol_tz"].';TZString='.$_SESSION["dol_tz_string"].';Screen='.$_SESSION["dol_screenwidth"].'x'.$_SESSION["dol_screenheight"]; |
|
| 619 | 619 | |
| 620 | 620 | // Call triggers for the "security events" log |
| 621 | 621 | Globals::$user->trigger_mesg = $loginfo; |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | $action = ''; |
| 632 | 632 | Globals::$hookManager->initHooks(array('login')); |
| 633 | 633 | $parameters = array('dol_authmode' => $this->dol_authmode, 'dol_loginfo' => $loginfo); |
| 634 | - $reshook = Globals::$hookManager->executeHooks('afterLogin', $parameters, Globals::$user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 634 | + $reshook = Globals::$hookManager->executeHooks('afterLogin', $parameters, Globals::$user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 635 | 635 | if ($reshook < 0) { |
| 636 | 636 | $error++; |
| 637 | 637 | } |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | if ($_SERVER["PHP_SELF"] != $newpath) { // not already on landing page (avoid infinite loop) |
| 653 | 653 | echo $newpath; |
| 654 | 654 | throw Exception('x'); |
| 655 | - header('Location: ' . $newpath); |
|
| 655 | + header('Location: '.$newpath); |
|
| 656 | 656 | exit; |
| 657 | 657 | } |
| 658 | 658 | } |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | if (empty(Globals::$conf->global->MAIN_FORCETHEME) && !empty(Globals::$user->conf->MAIN_THEME)) { |
| 685 | 685 | Globals::$conf->theme = Globals::$user->conf->MAIN_THEME; |
| 686 | 686 | // Globals::$conf->css = "/theme/" . Globals::$conf->theme . "/style.css.php"; |
| 687 | - Globals::$conf->css = '?controller=theme/' . Globals::$conf->theme . '&method=style.css'; |
|
| 687 | + Globals::$conf->css = '?controller=theme/'.Globals::$conf->theme.'&method=style.css'; |
|
| 688 | 688 | } |
| 689 | 689 | } |
| 690 | 690 | |
@@ -692,7 +692,7 @@ discard block |
||
| 692 | 692 | if (DolUtils::GETPOST('theme', 'alpha')) { |
| 693 | 693 | Globals::$conf->theme = DolUtils::GETPOST('theme', 'alpha', 1); |
| 694 | 694 | // Globals::$conf->css = "/theme/" . Globals::$conf->theme . "/style.css.php"; |
| 695 | - Globals::$conf->css = '?controller=theme/' . Globals::$conf->theme . '&method=style.css'; |
|
| 695 | + Globals::$conf->css = '?controller=theme/'.Globals::$conf->theme.'&method=style.css'; |
|
| 696 | 696 | } |
| 697 | 697 | |
| 698 | 698 | |
@@ -742,7 +742,7 @@ discard block |
||
| 742 | 742 | if (!empty(Globals::$conf->dol_use_jmobile) && in_array(Globals::$conf->theme, array('bureau2crea', 'cameleo', 'amarok'))) { |
| 743 | 743 | Globals::$conf->theme = 'eldy'; |
| 744 | 744 | // Globals::$conf->css = "/theme/" . Globals::$conf->theme . "/style.css.php"; |
| 745 | - Globals::$conf->css = '?controller=theme/' . Globals::$conf->theme . '&method=style.css'; |
|
| 745 | + Globals::$conf->css = '?controller=theme/'.Globals::$conf->theme.'&method=style.css'; |
|
| 746 | 746 | } |
| 747 | 747 | |
| 748 | 748 | if (!defined('NOREQUIRETRAN')) { |
@@ -779,7 +779,7 @@ discard block |
||
| 779 | 779 | } |
| 780 | 780 | |
| 781 | 781 | |
| 782 | - DolUtils::dol_syslog("--- Access to " . $_SERVER["PHP_SELF"] . ' - action=' . DolUtils::GETPOST('action', 'az09') . ', massaction=' . DolUtils::GETPOST('massaction', 'az09')); |
|
| 782 | + DolUtils::dol_syslog("--- Access to ".$_SERVER["PHP_SELF"].' - action='.DolUtils::GETPOST('action', 'az09').', massaction='.DolUtils::GETPOST('massaction', 'az09')); |
|
| 783 | 783 | //Another call for easy debugg |
| 784 | 784 | //dol_syslog("Access to ".$_SERVER["PHP_SELF"].' GET='.join(',',array_keys($_GET)).'->'.join(',',$_GET).' POST:'.join(',',array_keys($_POST)).'->'.join(',',$_POST)); |
| 785 | 785 | // Load main languages files |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | // Define some constants used for style of arrays |
| 792 | 792 | $bc = array(0 => 'class="impair"', 1 => 'class="pair"'); |
| 793 | 793 | $bcdd = array(0 => 'class="drag drop oddeven"', 1 => 'class="drag drop oddeven"'); |
| 794 | - $bcnd = array(0 => 'class="nodrag nodrop nohover"', 1 => 'class="nodrag nodrop nohoverpair"'); // Used for tr to add new lines |
|
| 794 | + $bcnd = array(0 => 'class="nodrag nodrop nohover"', 1 => 'class="nodrag nodrop nohoverpair"'); // Used for tr to add new lines |
|
| 795 | 795 | $bctag = array(0 => 'class="impair tagtr"', 1 => 'class="pair tagtr"'); |
| 796 | 796 | |
| 797 | 797 | // Define messages variables |
@@ -839,7 +839,7 @@ discard block |
||
| 839 | 839 | // Load the menu manager (only if not already done) |
| 840 | 840 | $file_menu = Globals::$conf->standard_menu; |
| 841 | 841 | if (DolUtils::GETPOST('menu', 'alpha')) { |
| 842 | - $file_menu = DolUtils::GETPOST('menu', 'alpha'); // example: menu=eldy_menu.php |
|
| 842 | + $file_menu = DolUtils::GETPOST('menu', 'alpha'); // example: menu=eldy_menu.php |
|
| 843 | 843 | } |
| 844 | 844 | if (!class_exists('MenuManager')) { |
| 845 | 845 | $menufound = 0; |
@@ -851,7 +851,7 @@ discard block |
||
| 851 | 851 | } |
| 852 | 852 | } |
| 853 | 853 | if (!class_exists('MenuManager')) { // If failed to include, we try with standard eldy_menu.php |
| 854 | - DolUtils::dol_syslog("You define a menu manager '" . $file_menu . "' that can not be loaded.", LOG_WARNING); |
|
| 854 | + DolUtils::dol_syslog("You define a menu manager '".$file_menu."' that can not be loaded.", LOG_WARNING); |
|
| 855 | 855 | $file_menu = 'eldy_menu.php'; |
| 856 | 856 | // include_once DOL_DOCUMENT_ROOT . "/core/menus/standard/" . $file_menu; |
| 857 | 857 | } |
@@ -895,7 +895,7 @@ discard block |
||
| 895 | 895 | |
| 896 | 896 | // This is to make Dolibarr working with Plesk |
| 897 | 897 | if (!empty($_SERVER['DOCUMENT_ROOT']) && substr($_SERVER['DOCUMENT_ROOT'], -6) !== 'htdocs') { |
| 898 | - set_include_path($_SERVER['DOCUMENT_ROOT'] . '/htdocs'); |
|
| 898 | + set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs'); |
|
| 899 | 899 | } |
| 900 | 900 | |
| 901 | 901 | // If there is a POST parameter to tell to save automatically some POST parameters into cookies, we do it. |
@@ -906,7 +906,7 @@ discard block |
||
| 906 | 906 | $tmplist = explode(',', $tmpautoset[1]); |
| 907 | 907 | $cookiearrayvalue = array(); |
| 908 | 908 | foreach ($tmplist as $tmpkey) { |
| 909 | - $postkey = $tmpautoset[0] . '_' . $tmpkey; |
|
| 909 | + $postkey = $tmpautoset[0].'_'.$tmpkey; |
|
| 910 | 910 | //var_dump('tmpkey='.$tmpkey.' postkey='.$postkey.' value='.$_POST[$postkey]); |
| 911 | 911 | if (!empty($_POST[$postkey])) { |
| 912 | 912 | $cookiearrayvalue[$tmpkey] = $_POST[$postkey]; |
@@ -967,8 +967,8 @@ discard block |
||
| 967 | 967 | $inj += preg_match('/insert\s+into/i', $val); |
| 968 | 968 | $inj += preg_match('/select\s+from/i', $val); |
| 969 | 969 | $inj += preg_match('/into\s+(outfile|dumpfile)/i', $val); |
| 970 | - $inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() that return current database login |
|
| 971 | - $inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database |
|
| 970 | + $inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() that return current database login |
|
| 971 | + $inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database |
|
| 972 | 972 | } |
| 973 | 973 | if ($type == 3) { |
| 974 | 974 | $inj += preg_match('/select|update|delete|replace|group\s+by|concat|count|from/i', $val); |
@@ -992,15 +992,15 @@ discard block |
||
| 992 | 992 | $inj += preg_match('/<style/i', $val); |
| 993 | 993 | } |
| 994 | 994 | $inj += preg_match('/base[\s]+href/si', $val); |
| 995 | - $inj += preg_match('/<.*onmouse/si', $val); // onmousexxx can be set on img or any html tag like <img title='...' onmouseover=alert(1)> |
|
| 996 | - $inj += preg_match('/onerror\s*=/i', $val); // onerror can be set on img or any html tag like <img title='...' onerror = alert(1)> |
|
| 997 | - $inj += preg_match('/onfocus\s*=/i', $val); // onfocus can be set on input text html tag like <input type='text' value='...' onfocus = alert(1)> |
|
| 998 | - $inj += preg_match('/onload\s*=/i', $val); // onload can be set on svg tag <svg/onload=alert(1)> or other tag like body <body onload=alert(1)> |
|
| 999 | - $inj += preg_match('/onloadstart\s*=/i', $val); // onload can be set on audio tag <audio onloadstart=alert(1)> |
|
| 1000 | - $inj += preg_match('/onclick\s*=/i', $val); // onclick can be set on img text html tag like <img onclick = alert(1)> |
|
| 1001 | - $inj += preg_match('/onscroll\s*=/i', $val); // onscroll can be on textarea |
|
| 995 | + $inj += preg_match('/<.*onmouse/si', $val); // onmousexxx can be set on img or any html tag like <img title='...' onmouseover=alert(1)> |
|
| 996 | + $inj += preg_match('/onerror\s*=/i', $val); // onerror can be set on img or any html tag like <img title='...' onerror = alert(1)> |
|
| 997 | + $inj += preg_match('/onfocus\s*=/i', $val); // onfocus can be set on input text html tag like <input type='text' value='...' onfocus = alert(1)> |
|
| 998 | + $inj += preg_match('/onload\s*=/i', $val); // onload can be set on svg tag <svg/onload=alert(1)> or other tag like body <body onload=alert(1)> |
|
| 999 | + $inj += preg_match('/onloadstart\s*=/i', $val); // onload can be set on audio tag <audio onloadstart=alert(1)> |
|
| 1000 | + $inj += preg_match('/onclick\s*=/i', $val); // onclick can be set on img text html tag like <img onclick = alert(1)> |
|
| 1001 | + $inj += preg_match('/onscroll\s*=/i', $val); // onscroll can be on textarea |
|
| 1002 | 1002 | //$inj += preg_match('/on[A-Z][a-z]+\*=/', $val); // To lock event handlers onAbort(), ... |
| 1003 | - $inj += preg_match('/:|:|:/i', $val); // refused string ':' encoded (no reason to have it encoded) to lock 'javascript:...' |
|
| 1003 | + $inj += preg_match('/:|:|:/i', $val); // refused string ':' encoded (no reason to have it encoded) to lock 'javascript:...' |
|
| 1004 | 1004 | //if ($type == 1) |
| 1005 | 1005 | //{ |
| 1006 | 1006 | $inj += preg_match('/javascript:/i', $val); |
@@ -1008,10 +1008,10 @@ discard block |
||
| 1008 | 1008 | //} |
| 1009 | 1009 | // For XSS Injection done by adding javascript closing html tags like with onmousemove, etc... (closing a src or href tag with not cleaned param) |
| 1010 | 1010 | if ($type == 1) { |
| 1011 | - $inj += preg_match('/"/i', $val); // We refused " in GET parameters value |
|
| 1011 | + $inj += preg_match('/"/i', $val); // We refused " in GET parameters value |
|
| 1012 | 1012 | } |
| 1013 | 1013 | if ($type == 2) { |
| 1014 | - $inj += preg_match('/[;"]/', $val); // PHP_SELF is a file system path. It can contains spaces. |
|
| 1014 | + $inj += preg_match('/[;"]/', $val); // PHP_SELF is a file system path. It can contains spaces. |
|
| 1015 | 1015 | } |
| 1016 | 1016 | return $inj; |
| 1017 | 1017 | } |
@@ -1030,7 +1030,7 @@ discard block |
||
| 1030 | 1030 | if ($this->analyseVarsForSqlAndScriptsInjection($key, $type) && $this->analyseVarsForSqlAndScriptsInjection($value, $type)) { |
| 1031 | 1031 | //$var[$key] = $value; // This is useless |
| 1032 | 1032 | } else { |
| 1033 | - print 'Access refused by SQL/Script injection protection in main.inc.php (type=' . htmlentities($type) . ' key=' . htmlentities($key) . ' value=' . htmlentities($value) . ' page=' . htmlentities($_SERVER["REQUEST_URI"]) . ')'; |
|
| 1033 | + print 'Access refused by SQL/Script injection protection in main.inc.php (type='.htmlentities($type).' key='.htmlentities($key).' value='.htmlentities($value).' page='.htmlentities($_SERVER["REQUEST_URI"]).')'; |
|
| 1034 | 1034 | exit; |
| 1035 | 1035 | } |
| 1036 | 1036 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | static function getStaticMember($class, $member) |
| 54 | 54 | {
|
| 55 | - DolUtils::dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); |
|
| 55 | + DolUtils::dol_syslog(__FUNCTION__." is deprecated", LOG_WARNING); |
|
| 56 | 56 | |
| 57 | 57 | // This part is deprecated. Uncomment if for php 5.2.*, and comment next isset class::member |
| 58 | 58 | /* if (version_compare(phpversion(), '5.3.0', '<')) |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | if (isset($class::$member)) |
| 79 | 79 | return $class::$member; |
| 80 | - dol_print_error('', 'Try to get a static member "' . $member . '" in class "' . $class . '" that does not exists or is not static.');
|
|
| 80 | + dol_print_error('', 'Try to get a static member "'.$member.'" in class "'.$class.'" that does not exists or is not static.');
|
|
| 81 | 81 | return null; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -94,9 +94,9 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | static function getDoliDBInstance($type, $host, $user, $pass, $name, $port) |
| 96 | 96 | {
|
| 97 | - require_once DOL_BASE_PATH . "/core/db/" . $type . '.class.php'; |
|
| 97 | + require_once DOL_BASE_PATH."/core/db/".$type.'.class.php'; |
|
| 98 | 98 | |
| 99 | - $class = 'DoliDB' . ucfirst($type); |
|
| 99 | + $class = 'DoliDB'.ucfirst($type); |
|
| 100 | 100 | $dolidb = new $class($type, $host, $user, $pass, $name, $port); |
| 101 | 101 | return $dolidb; |
| 102 | 102 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $depth = $db->transaction_opened; |
| 266 | 266 | $disconnectdone = $db->close(); |
| 267 | 267 | } |
| 268 | - DolUtils::dol_syslog("--- End access to " . $_SERVER["PHP_SELF"] . (($disconnectdone && $depth) ? ' (Warn: db disconnection forced, transaction depth was ' . $depth . ')' : ''), (($disconnectdone && $depth) ? LOG_WARNING : LOG_INFO));
|
|
| 268 | + DolUtils::dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth) ? ' (Warn: db disconnection forced, transaction depth was '.$depth.')' : ''), (($disconnectdone && $depth) ? LOG_WARNING : LOG_INFO));
|
|
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | /** |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | if (empty($paramname)) |
| 311 | 311 | return 'BadFirstParameterForDolUtils::GETPOST'; |
| 312 | 312 | if (empty($check)) {
|
| 313 | - DolUtils::dol_syslog("Deprecated use of DolUtils::GETPOST, called with 1st param = " . $paramname . " and 2nd param is '', when calling page " . $_SERVER["PHP_SELF"], LOG_WARNING);
|
|
| 313 | + DolUtils::dol_syslog("Deprecated use of DolUtils::GETPOST, called with 1st param = ".$paramname." and 2nd param is '', when calling page ".$_SERVER["PHP_SELF"], LOG_WARNING);
|
|
| 314 | 314 | // Enable this line to know who call the DolUtils::GETPOST with '' $check parameter. |
| 315 | 315 | //var_dump(debug_backtrace()[0]); |
| 316 | 316 | } |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | $relativepathstring = $_SERVER["PHP_SELF"]; |
| 333 | 333 | // Clean $relativepathstring |
| 334 | 334 | if (constant('DOL_BASE_URI'))
|
| 335 | - $relativepathstring = preg_replace('/^' . preg_quote(constant('DOL_BASE_URI'), '/') . '/', '', $relativepathstring);
|
|
| 335 | + $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_BASE_URI'), '/').'/', '', $relativepathstring);
|
|
| 336 | 336 | $relativepathstring = preg_replace('/^\//', '', $relativepathstring);
|
| 337 | 337 | $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
|
| 338 | 338 | //var_dump($relativepathstring); |
@@ -340,8 +340,8 @@ discard block |
||
| 340 | 340 | // Code for search criteria persistence. |
| 341 | 341 | // Retrieve values if restore_lastsearch_values |
| 342 | 342 | if (!empty($_GET['restore_lastsearch_values'])) { // Use $_GET here and not DolUtils::GETPOST
|
| 343 | - if (!empty($_SESSION['lastsearch_values_' . $relativepathstring])) { // If there is saved values
|
|
| 344 | - $tmp = json_decode($_SESSION['lastsearch_values_' . $relativepathstring], true); |
|
| 343 | + if (!empty($_SESSION['lastsearch_values_'.$relativepathstring])) { // If there is saved values
|
|
| 344 | + $tmp = json_decode($_SESSION['lastsearch_values_'.$relativepathstring], true); |
|
| 345 | 345 | if (is_array($tmp)) {
|
| 346 | 346 | foreach ($tmp as $key => $val) {
|
| 347 | 347 | if ($key == $paramname) { // We are on the requested parameter
|
@@ -352,12 +352,12 @@ discard block |
||
| 352 | 352 | } |
| 353 | 353 | } |
| 354 | 354 | // If there is saved contextpage, page or limit |
| 355 | - if ($paramname == 'contextpage' && !empty($_SESSION['lastsearch_contextpage_' . $relativepathstring])) {
|
|
| 356 | - $out = $_SESSION['lastsearch_contextpage_' . $relativepathstring]; |
|
| 357 | - } elseif ($paramname == 'page' && !empty($_SESSION['lastsearch_page_' . $relativepathstring])) {
|
|
| 358 | - $out = $_SESSION['lastsearch_page_' . $relativepathstring]; |
|
| 359 | - } elseif ($paramname == 'limit' && !empty($_SESSION['lastsearch_limit_' . $relativepathstring])) {
|
|
| 360 | - $out = $_SESSION['lastsearch_limit_' . $relativepathstring]; |
|
| 355 | + if ($paramname == 'contextpage' && !empty($_SESSION['lastsearch_contextpage_'.$relativepathstring])) {
|
|
| 356 | + $out = $_SESSION['lastsearch_contextpage_'.$relativepathstring]; |
|
| 357 | + } elseif ($paramname == 'page' && !empty($_SESSION['lastsearch_page_'.$relativepathstring])) {
|
|
| 358 | + $out = $_SESSION['lastsearch_page_'.$relativepathstring]; |
|
| 359 | + } elseif ($paramname == 'limit' && !empty($_SESSION['lastsearch_limit_'.$relativepathstring])) {
|
|
| 360 | + $out = $_SESSION['lastsearch_limit_'.$relativepathstring]; |
|
| 361 | 361 | } |
| 362 | 362 | } |
| 363 | 363 | // Else, retreive default values if we are not doing a sort |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | $qualified = 1; |
| 426 | 426 | |
| 427 | 427 | if ($qualified) {
|
| 428 | - $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
|
|
| 428 | + $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
|
|
| 429 | 429 | foreach ($user->default_values[$relativepathstring]['sortorder'][$defkey] as $key => $val) {
|
| 430 | 430 | if ($out) |
| 431 | 431 | $out .= ', '; |
@@ -461,11 +461,11 @@ discard block |
||
| 461 | 461 | if (isset($_POST['sall']) || isset($_POST['search_all']) || isset($_GET['sall']) || isset($_GET['search_all'])) {
|
| 462 | 462 | // We made a search from quick search menu, do we still use default filter ? |
| 463 | 463 | if (empty(Globals::$conf->global->MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH)) {
|
| 464 | - $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
|
|
| 464 | + $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
|
|
| 465 | 465 | $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace); |
| 466 | 466 | } |
| 467 | 467 | } else {
|
| 468 | - $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
|
|
| 468 | + $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
|
|
| 469 | 469 | $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace); |
| 470 | 470 | } |
| 471 | 471 | break; |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | // We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text. |
| 484 | 484 | if (!is_array($out) && empty($_POST[$paramname]) && empty($noreplace)) {
|
| 485 | 485 | $maxloop = 20; |
| 486 | - $loopnb = 0; // Protection against infinite loop |
|
| 486 | + $loopnb = 0; // Protection against infinite loop |
|
| 487 | 487 | while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) { // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side.
|
| 488 | 488 | $loopnb++; |
| 489 | 489 | $newout = ''; |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | } elseif ($reg[1] == 'ENTITY_ID' || $reg[1] == 'ENTITYID') {
|
| 529 | 529 | $newout = Globals::$conf->entity; |
| 530 | 530 | } else |
| 531 | - $newout = ''; // Key not found, we replace with empty string |
|
| 531 | + $newout = ''; // Key not found, we replace with empty string |
|
| 532 | 532 | |
| 533 | 533 | |
| 534 | 534 | |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | |
| 564 | 564 | |
| 565 | 565 | //var_dump('__'.$reg[1].'__ -> '.$newout);
|
| 566 | - $out = preg_replace('/__' . preg_quote($reg[1], '/') . '__/', $newout, $out);
|
|
| 566 | + $out = preg_replace('/__'.preg_quote($reg[1], '/').'__/', $newout, $out);
|
|
| 567 | 567 | } |
| 568 | 568 | } |
| 569 | 569 | |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | // If prefix is for email |
| 674 | 674 | if ($mode == 'email') {
|
| 675 | 675 | if (empty(Globals::$conf->global->MAIL_PREFIX_FOR_EMAIL_ID)) {
|
| 676 | - return Security::dol_hash(DOL_DOCUMENT_ROOT . DOL_BASE_URI); |
|
| 676 | + return Security::dol_hash(DOL_DOCUMENT_ROOT.DOL_BASE_URI); |
|
| 677 | 677 | } |
| 678 | 678 | // If MAIL_PREFIX_FOR_EMAIL_ID is set (a value initialized with a random value is recommended) |
| 679 | 679 | if (Globals::$conf->global->MAIL_PREFIX_FOR_EMAIL_ID != 'SERVER_NAME') {
|
@@ -683,16 +683,16 @@ discard block |
||
| 683 | 683 | return $_SERVER["SERVER_NAME"]; |
| 684 | 684 | } |
| 685 | 685 | |
| 686 | - return Security::dol_hash(DOL_DOCUMENT_ROOT . DOL_BASE_URI); |
|
| 686 | + return Security::dol_hash(DOL_DOCUMENT_ROOT.DOL_BASE_URI); |
|
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | if (isset($_SERVER["SERVER_NAME"]) && isset($_SERVER["DOCUMENT_ROOT"])) {
|
| 690 | - return Security::dol_hash($_SERVER["SERVER_NAME"] . $_SERVER["DOCUMENT_ROOT"] . DOL_DOCUMENT_ROOT . DOL_BASE_URI); |
|
| 690 | + return Security::dol_hash($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_BASE_URI); |
|
| 691 | 691 | |
| 692 | 692 | // Use this for a "readable" cookie name |
| 693 | 693 | //return dol_sanitizeFileName($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_BASE_URI); |
| 694 | 694 | } |
| 695 | - return Security::dol_hash(DOL_DOCUMENT_ROOT . DOL_BASE_URI); |
|
| 695 | + return Security::dol_hash(DOL_DOCUMENT_ROOT.DOL_BASE_URI); |
|
| 696 | 696 | } |
| 697 | 697 | |
| 698 | 698 | /** |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | $fullpath = dol_buildpath($relpath); |
| 713 | 713 | |
| 714 | 714 | if (!file_exists($fullpath)) {
|
| 715 | - DolUtils::dol_syslog('functions::dol_include_once Tried to load unexisting file: ' . $relpath, LOG_ERR);
|
|
| 715 | + DolUtils::dol_syslog('functions::dol_include_once Tried to load unexisting file: '.$relpath, LOG_ERR);
|
|
| 716 | 716 | return false; |
| 717 | 717 | } |
| 718 | 718 | |
@@ -741,14 +741,14 @@ discard block |
||
| 741 | 741 | |
| 742 | 742 | if ($type == 0 /* empty($type) */) { // For a filesystem path
|
| 743 | 743 | //$res = DOL_BASE_PATH . '' . $path; // Standard default path |
| 744 | - $res = DOL_BASE_PATH . '/' . $path; // Standard default path |
|
| 744 | + $res = DOL_BASE_PATH.'/'.$path; // Standard default path |
|
| 745 | 745 | if (isset(Globals::$conf->file->dol_document_root)) {
|
| 746 | 746 | foreach (Globals::$conf->file->dol_document_root as $key => $dirroot) { // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...)
|
| 747 | 747 | if ($key == 'main') {
|
| 748 | 748 | continue; |
| 749 | 749 | } |
| 750 | - if (file_exists($dirroot . '/' . $path)) {
|
|
| 751 | - $res = $dirroot . '/' . $path; |
|
| 750 | + if (file_exists($dirroot.'/'.$path)) {
|
|
| 751 | + $res = $dirroot.'/'.$path; |
|
| 752 | 752 | return $res; |
| 753 | 753 | } |
| 754 | 754 | } |
@@ -765,13 +765,13 @@ discard block |
||
| 765 | 765 | // using proxy, rewriting, virtual path, etc... |
| 766 | 766 | $res = ''; |
| 767 | 767 | if ($type == 1) {
|
| 768 | - $res = /* DOL_BASE_URI */ DOL_BASE_URI . '/' . $path; // Standard value |
|
| 768 | + $res = /* DOL_BASE_URI */ DOL_BASE_URI.'/'.$path; // Standard value |
|
| 769 | 769 | } |
| 770 | 770 | if ($type == 2) {
|
| 771 | - $res = /* DOL_MAIN_URL_ROOT */ DOL_BASE_PATH . '/' . $path; // Standard value |
|
| 771 | + $res = /* DOL_MAIN_URL_ROOT */ DOL_BASE_PATH.'/'.$path; // Standard value |
|
| 772 | 772 | } |
| 773 | 773 | if ($type == 3) {
|
| 774 | - $res = DOL_BASE_URI . '/' . $path; |
|
| 774 | + $res = DOL_BASE_URI.'/'.$path; |
|
| 775 | 775 | } |
| 776 | 776 | |
| 777 | 777 | foreach (Globals::$conf->file->dol_document_root as $key => $dirroot) { // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...)
|
@@ -781,33 +781,33 @@ discard block |
||
| 781 | 781 | // Define $urlwithroot |
| 782 | 782 | |
| 783 | 783 | // $urlwithouturlroot = preg_replace('/' . preg_quote(DOL_BASE_URI, '/') . '$/i', '', trim($dolibarr_main_url_root));
|
| 784 | - $urlwithouturlroot = preg_replace('/' . preg_quote(DOL_BASE_URI, '/') . '$/i', '', trim(DOL_BASE_URI));
|
|
| 784 | + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_BASE_URI, '/').'$/i', '', trim(DOL_BASE_URI));
|
|
| 785 | 785 | |
| 786 | - $urlwithroot = $urlwithouturlroot . DOL_BASE_URI; // This is to use external domain name found into config file |
|
| 786 | + $urlwithroot = $urlwithouturlroot.DOL_BASE_URI; // This is to use external domain name found into config file |
|
| 787 | 787 | //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current |
| 788 | 788 | |
| 789 | - $res = (preg_match('/^http/i', Globals::$conf->file->dol_url_root[$key]) ? '' : $urlwithroot) . '/' . $path; // Test on start with http is for old conf syntax
|
|
| 789 | + $res = (preg_match('/^http/i', Globals::$conf->file->dol_url_root[$key]) ? '' : $urlwithroot).'/'.$path; // Test on start with http is for old conf syntax
|
|
| 790 | 790 | } |
| 791 | 791 | continue; |
| 792 | 792 | } |
| 793 | - preg_match('/^([^\?]+(\.css\.php|\.css|\.js\.php|\.js|\.png|\.jpg|\.php)?)/i', $path, $regs); // Take part before '?'
|
|
| 793 | + preg_match('/^([^\?]+(\.css\.php|\.css|\.js\.php|\.js|\.png|\.jpg|\.php)?)/i', $path, $regs); // Take part before '?'
|
|
| 794 | 794 | if (!empty($regs[1])) {
|
| 795 | 795 | //print $key.'-'.$dirroot.'/'.$path.'-'.$conf->file->dol_url_root[$type].'<br>'."\n"; |
| 796 | - if (file_exists($dirroot . '/' . $regs[1])) {
|
|
| 796 | + if (file_exists($dirroot.'/'.$regs[1])) {
|
|
| 797 | 797 | if ($type == 1) {
|
| 798 | - $res = (preg_match('/^http/i', Globals::$conf->file->dol_url_root[$key]) ? '' : DOL_BASE_URI) . Globals::$conf->file->dol_url_root[$key] . '/' . $path;
|
|
| 798 | + $res = (preg_match('/^http/i', Globals::$conf->file->dol_url_root[$key]) ? '' : DOL_BASE_URI).Globals::$conf->file->dol_url_root[$key].'/'.$path;
|
|
| 799 | 799 | } |
| 800 | 800 | if ($type == 2) {
|
| 801 | - $res = (preg_match('/^http/i', Globals::$conf->file->dol_url_root[$key]) ? '' : DOL_MAIN_URL_ROOT) . Globals::$conf->file->dol_url_root[$key] . '/' . $path;
|
|
| 801 | + $res = (preg_match('/^http/i', Globals::$conf->file->dol_url_root[$key]) ? '' : DOL_MAIN_URL_ROOT).Globals::$conf->file->dol_url_root[$key].'/'.$path;
|
|
| 802 | 802 | } |
| 803 | 803 | if ($type == 3) {
|
| 804 | 804 | // global $dolibarr_main_url_root; |
| 805 | 805 | // Define $urlwithroot |
| 806 | - $urlwithouturlroot = preg_replace('/' . preg_quote(DOL_BASE_URI, '/') . '$/i', '', trim($dolibarr_main_url_root));
|
|
| 807 | - $urlwithroot = $urlwithouturlroot . DOL_BASE_URI; // This is to use external domain name found into config file |
|
| 806 | + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_BASE_URI, '/').'$/i', '', trim($dolibarr_main_url_root));
|
|
| 807 | + $urlwithroot = $urlwithouturlroot.DOL_BASE_URI; // This is to use external domain name found into config file |
|
| 808 | 808 | //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current |
| 809 | 809 | |
| 810 | - $res = (preg_match('/^http/i', Globals::$conf->file->dol_url_root[$key]) ? '' : $urlwithroot) . Globals::$conf->file->dol_url_root[$key] . '/' . $path; // Test on start with http is for old conf syntax
|
|
| 810 | + $res = (preg_match('/^http/i', Globals::$conf->file->dol_url_root[$key]) ? '' : $urlwithroot).Globals::$conf->file->dol_url_root[$key].'/'.$path; // Test on start with http is for old conf syntax
|
|
| 811 | 811 | } |
| 812 | 812 | break; |
| 813 | 813 | } |
@@ -835,7 +835,7 @@ discard block |
||
| 835 | 835 | if (empty($native)) {
|
| 836 | 836 | $myclone = unserialize(serialize($object)); |
| 837 | 837 | } else {
|
| 838 | - $myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep references (refer to the same target/variable) |
|
| 838 | + $myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep references (refer to the same target/variable) |
|
| 839 | 839 | } |
| 840 | 840 | |
| 841 | 841 | return $myclone; |
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | */ |
| 957 | 957 | static function dol_string_nospecial($str, $newstr = '_', $badcharstoreplace = '') |
| 958 | 958 | {
|
| 959 | - $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ",", ";", "=", '°'); // more complete than dol_sanitizeFileName
|
|
| 959 | + $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ",", ";", "=", '°'); // more complete than dol_sanitizeFileName
|
|
| 960 | 960 | $forbidden_chars_to_remove = array(); |
| 961 | 961 | if (is_array($badcharstoreplace)) |
| 962 | 962 | $forbidden_chars_to_replace = $badcharstoreplace; |
@@ -1019,12 +1019,12 @@ discard block |
||
| 1019 | 1019 | static function dol_escape_htmltag($stringtoescape, $keepb = 0, $keepn = 0) |
| 1020 | 1020 | {
|
| 1021 | 1021 | // escape quotes and backslashes, newlines, etc. |
| 1022 | - $tmp = html_entity_decode($stringtoescape, ENT_COMPAT, 'UTF-8'); // TODO Use htmlspecialchars_decode instead, that make only required change for html tags |
|
| 1022 | + $tmp = html_entity_decode($stringtoescape, ENT_COMPAT, 'UTF-8'); // TODO Use htmlspecialchars_decode instead, that make only required change for html tags |
|
| 1023 | 1023 | if (!$keepb) |
| 1024 | 1024 | $tmp = strtr($tmp, array("<b>" => '', '</b>' => ''));
|
| 1025 | 1025 | if (!$keepn) |
| 1026 | 1026 | $tmp = strtr($tmp, array("\r" => '\\r', "\n" => '\\n'));
|
| 1027 | - return htmlentities($tmp, ENT_COMPAT, 'UTF-8'); // TODO Use htmlspecialchars instead, that make only required change for html tags |
|
| 1027 | + return htmlentities($tmp, ENT_COMPAT, 'UTF-8'); // TODO Use htmlspecialchars instead, that make only required change for html tags |
|
| 1028 | 1028 | } |
| 1029 | 1029 | |
| 1030 | 1030 | /** |
@@ -1094,14 +1094,14 @@ discard block |
||
| 1094 | 1094 | $message = preg_replace('/password=\'[^\']*\'/', 'password=\'hidden\'', $message); // protection to avoid to have value of password in log
|
| 1095 | 1095 | // If adding log inside HTML page is required |
| 1096 | 1096 | if (!empty($_REQUEST['logtohtml']) && (!empty(Globals::$conf->global->MAIN_ENABLE_LOG_TO_HTML) || !empty(Globals::$conf->global->MAIN_LOGTOHTML))) { // MAIN_LOGTOHTML kept for backward compatibility
|
| 1097 | - Globals::$conf->logbuffer[] = dol_print_date(time(), "%Y-%m-%d %H:%M:%S") . " " . $message; |
|
| 1097 | + Globals::$conf->logbuffer[] = dol_print_date(time(), "%Y-%m-%d %H:%M:%S")." ".$message; |
|
| 1098 | 1098 | } |
| 1099 | 1099 | |
| 1100 | 1100 | //TODO: Remove this. MAIN_ENABLE_LOG_INLINE_HTML should be deprecated and use a log handler dedicated to HTML output |
| 1101 | 1101 | // If html log tag enabled and url parameter log defined, we show output log on HTML comments |
| 1102 | 1102 | if (!empty(Globals::$conf->global->MAIN_ENABLE_LOG_INLINE_HTML) && !empty($_GET["log"])) {
|
| 1103 | 1103 | print "\n\n<!-- Log start\n"; |
| 1104 | - print $message . "\n"; |
|
| 1104 | + print $message."\n"; |
|
| 1105 | 1105 | print "Log end -->\n"; |
| 1106 | 1106 | } |
| 1107 | 1107 | |
@@ -1115,7 +1115,7 @@ discard block |
||
| 1115 | 1115 | |
| 1116 | 1116 | // This is when server run behind a reverse proxy |
| 1117 | 1117 | if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) |
| 1118 | - $data['ip'] = $_SERVER['HTTP_X_FORWARDED_FOR'] . (empty($_SERVER["REMOTE_ADDR"]) ? '' : '->' . $_SERVER['REMOTE_ADDR']); |
|
| 1118 | + $data['ip'] = $_SERVER['HTTP_X_FORWARDED_FOR'].(empty($_SERVER["REMOTE_ADDR"]) ? '' : '->'.$_SERVER['REMOTE_ADDR']); |
|
| 1119 | 1119 | // This is when server run normally on a server |
| 1120 | 1120 | else if (!empty($_SERVER["REMOTE_ADDR"])) |
| 1121 | 1121 | $data['ip'] = $_SERVER['REMOTE_ADDR']; |
@@ -1124,10 +1124,10 @@ discard block |
||
| 1124 | 1124 | $data['ip'] = $_SERVER['SERVER_ADDR']; |
| 1125 | 1125 | // This is when PHP session is ran outside a web server, like from Windows command line (Not always defined, but useful if OS defined it). |
| 1126 | 1126 | else if (!empty($_SERVER['COMPUTERNAME'])) |
| 1127 | - $data['ip'] = $_SERVER['COMPUTERNAME'] . (empty($_SERVER['USERNAME']) ? '' : '@' . $_SERVER['USERNAME']); |
|
| 1127 | + $data['ip'] = $_SERVER['COMPUTERNAME'].(empty($_SERVER['USERNAME']) ? '' : '@'.$_SERVER['USERNAME']); |
|
| 1128 | 1128 | // This is when PHP session is ran outside a web server, like from Linux command line (Not always defined, but usefull if OS defined it). |
| 1129 | 1129 | else if (!empty($_SERVER['LOGNAME'])) |
| 1130 | - $data['ip'] = '???@' . $_SERVER['LOGNAME']; |
|
| 1130 | + $data['ip'] = '???@'.$_SERVER['LOGNAME']; |
|
| 1131 | 1131 | // Loop on each log handler and send output |
| 1132 | 1132 | foreach (Globals::$conf->loghandlers as $loghandlerinstance) {
|
| 1133 | 1133 | if ($restricttologhandler && $loghandlerinstance->code != $restricttologhandler) |
@@ -1179,10 +1179,10 @@ discard block |
||
| 1179 | 1179 | {
|
| 1180 | 1180 | // global Globals::$conf, Globals::$langs, $hookmanager; |
| 1181 | 1181 | |
| 1182 | - $out = "\n" . '<div class="tabs" data-role="controlgroup" data-type="horizontal">' . "\n"; |
|
| 1182 | + $out = "\n".'<div class="tabs" data-role="controlgroup" data-type="horizontal">'."\n"; |
|
| 1183 | 1183 | |
| 1184 | 1184 | if ($morehtmlright) {
|
| 1185 | - $out .= '<div class="inline-block floatright tabsElem">' . $morehtmlright . '</div>'; // Output right area first so when space is missing, text is in front of tabs and not under. |
|
| 1185 | + $out .= '<div class="inline-block floatright tabsElem">'.$morehtmlright.'</div>'; // Output right area first so when space is missing, text is in front of tabs and not under. |
|
| 1186 | 1186 | } |
| 1187 | 1187 | |
| 1188 | 1188 | // Show title |
@@ -1193,8 +1193,8 @@ discard block |
||
| 1193 | 1193 | $limittitle = 30; |
| 1194 | 1194 | $out .= '<a class="tabTitle">'; |
| 1195 | 1195 | if ($picto) |
| 1196 | - $out .= img_picto($title, ($pictoisfullpath ? '' : 'object_') . $picto, '', $pictoisfullpath) . ' '; |
|
| 1197 | - $out .= '<span class="tabTitleText">' . dol_trunc($title, $limittitle) . '</span>'; |
|
| 1196 | + $out .= img_picto($title, ($pictoisfullpath ? '' : 'object_').$picto, '', $pictoisfullpath).' '; |
|
| 1197 | + $out .= '<span class="tabTitleText">'.dol_trunc($title, $limittitle).'</span>'; |
|
| 1198 | 1198 | $out .= '</a>'; |
| 1199 | 1199 | } |
| 1200 | 1200 | |
@@ -1234,23 +1234,23 @@ discard block |
||
| 1234 | 1234 | } |
| 1235 | 1235 | |
| 1236 | 1236 | if ($i < $limittoshow || $isactive) {
|
| 1237 | - $out .= '<div class="inline-block tabsElem' . ($isactive ? ' tabsElemActive' : '') . ((!$isactive && !empty(Globals::$conf->global->MAIN_HIDE_INACTIVETAB_ON_PRINT)) ? ' hideonprint' : '') . '"><!-- id tab = ' . (empty($links[$i][2]) ? '' : $links[$i][2]) . ' -->'; |
|
| 1237 | + $out .= '<div class="inline-block tabsElem'.($isactive ? ' tabsElemActive' : '').((!$isactive && !empty(Globals::$conf->global->MAIN_HIDE_INACTIVETAB_ON_PRINT)) ? ' hideonprint' : '').'"><!-- id tab = '.(empty($links[$i][2]) ? '' : $links[$i][2]).' -->'; |
|
| 1238 | 1238 | if (isset($links[$i][2]) && $links[$i][2] == 'image') {
|
| 1239 | 1239 | if (!empty($links[$i][0])) {
|
| 1240 | - $out .= '<a class="tabimage' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">' . $links[$i][1] . '</a>' . "\n"; |
|
| 1240 | + $out .= '<a class="tabimage'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n"; |
|
| 1241 | 1241 | } else {
|
| 1242 | - $out .= '<span class="tabspan">' . $links[$i][1] . '</span>' . "\n"; |
|
| 1242 | + $out .= '<span class="tabspan">'.$links[$i][1].'</span>'."\n"; |
|
| 1243 | 1243 | } |
| 1244 | 1244 | } else if (!empty($links[$i][1])) {
|
| 1245 | 1245 | //print "x $i $active ".$links[$i][2]." z"; |
| 1246 | 1246 | if ($isactive) {
|
| 1247 | - $out .= '<a' . (!empty($links[$i][2]) ? ' id="' . $links[$i][2] . '"' : '') . ' class="tabactive tab inline-block' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">'; |
|
| 1247 | + $out .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="tabactive tab inline-block'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'; |
|
| 1248 | 1248 | $out .= $links[$i][1]; |
| 1249 | - $out .= '</a>' . "\n"; |
|
| 1249 | + $out .= '</a>'."\n"; |
|
| 1250 | 1250 | } else {
|
| 1251 | - $out .= '<a' . (!empty($links[$i][2]) ? ' id="' . $links[$i][2] . '"' : '') . ' class="tabunactive tab inline-block' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">'; |
|
| 1251 | + $out .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="tabunactive tab inline-block'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'; |
|
| 1252 | 1252 | $out .= $links[$i][1]; |
| 1253 | - $out .= '</a>' . "\n"; |
|
| 1253 | + $out .= '</a>'."\n"; |
|
| 1254 | 1254 | } |
| 1255 | 1255 | } |
| 1256 | 1256 | $out .= '</div>'; |
@@ -1263,14 +1263,14 @@ discard block |
||
| 1263 | 1263 | $outmore .= '<div class="popuptab wordwrap" style="display:inherit;">'; |
| 1264 | 1264 | if (isset($links[$i][2]) && $links[$i][2] == 'image') {
|
| 1265 | 1265 | if (!empty($links[$i][0])) |
| 1266 | - $outmore .= '<a class="tabimage' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">' . $links[$i][1] . '</a>' . "\n"; |
|
| 1266 | + $outmore .= '<a class="tabimage'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n"; |
|
| 1267 | 1267 | else |
| 1268 | - $outmore .= '<span class="tabspan">' . $links[$i][1] . '</span>' . "\n"; |
|
| 1268 | + $outmore .= '<span class="tabspan">'.$links[$i][1].'</span>'."\n"; |
|
| 1269 | 1269 | } |
| 1270 | 1270 | else if (!empty($links[$i][1])) {
|
| 1271 | - $outmore .= '<a' . (!empty($links[$i][2]) ? ' id="' . $links[$i][2] . '"' : '') . ' class="wordwrap inline-block' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">'; |
|
| 1271 | + $outmore .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="wordwrap inline-block'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'; |
|
| 1272 | 1272 | $outmore .= preg_replace('/([a-z])\/([a-z])/i', '\\1 / \\2', $links[$i][1]); // Replace x/y with x / y to allow wrap on long composed texts.
|
| 1273 | - $outmore .= '</a>' . "\n"; |
|
| 1273 | + $outmore .= '</a>'."\n"; |
|
| 1274 | 1274 | } |
| 1275 | 1275 | $outmore .= '</div>'; |
| 1276 | 1276 | |
@@ -1286,24 +1286,24 @@ discard block |
||
| 1286 | 1286 | $right = (Globals::$langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right');
|
| 1287 | 1287 | |
| 1288 | 1288 | $tabsname = str_replace("@", "", $picto);
|
| 1289 | - $out .= '<div id="moretabs' . $tabsname . '" class="inline-block tabsElem">'; |
|
| 1290 | - $out .= '<a href="#" class="tab moretab inline-block tabunactive reposition">' . Globals::$langs->trans("More") . '... (' . $nbintab . ')</a>';
|
|
| 1291 | - $out .= '<div id="moretabsList' . $tabsname . '" style="position: absolute; ' . $left . ': -999em; text-align: ' . $left . '; margin:0px; padding:2px">'; |
|
| 1289 | + $out .= '<div id="moretabs'.$tabsname.'" class="inline-block tabsElem">'; |
|
| 1290 | + $out .= '<a href="#" class="tab moretab inline-block tabunactive reposition">'.Globals::$langs->trans("More").'... ('.$nbintab.')</a>';
|
|
| 1291 | + $out .= '<div id="moretabsList'.$tabsname.'" style="position: absolute; '.$left.': -999em; text-align: '.$left.'; margin:0px; padding:2px">'; |
|
| 1292 | 1292 | $out .= $outmore; |
| 1293 | 1293 | $out .= '</div>'; |
| 1294 | 1294 | $out .= '<div></div>'; |
| 1295 | 1295 | $out .= "</div>\n"; |
| 1296 | 1296 | |
| 1297 | 1297 | $out .= "<script>"; |
| 1298 | - $out .= "$('#moretabs" . $tabsname . "').mouseenter( function() { console.log('mouseenter " . $left . "'); $('#moretabsList" . $tabsname . "').css('" . $left . "','auto');});";
|
|
| 1299 | - $out .= "$('#moretabs" . $tabsname . "').mouseleave( function() { console.log('mouseleave " . $left . "'); $('#moretabsList" . $tabsname . "').css('" . $left . "','-999em');});";
|
|
| 1298 | + $out .= "$('#moretabs".$tabsname."').mouseenter( function() { console.log('mouseenter ".$left."'); $('#moretabsList".$tabsname."').css('".$left."','auto');});";
|
|
| 1299 | + $out .= "$('#moretabs".$tabsname."').mouseleave( function() { console.log('mouseleave ".$left."'); $('#moretabsList".$tabsname."').css('".$left."','-999em');});";
|
|
| 1300 | 1300 | $out .= "</script>"; |
| 1301 | 1301 | } |
| 1302 | 1302 | |
| 1303 | 1303 | $out .= "</div>\n"; |
| 1304 | 1304 | |
| 1305 | 1305 | if (!$notab || $notab == -1) |
| 1306 | - $out .= "\n" . '<div class="tabBar' . ($notab == -1 ? '' : ' tabBarWithBottom') . '">' . "\n"; |
|
| 1306 | + $out .= "\n".'<div class="tabBar'.($notab == -1 ? '' : ' tabBarWithBottom').'">'."\n"; |
|
| 1307 | 1307 | |
| 1308 | 1308 | $parameters = array('tabname' => $active, 'out' => $out);
|
| 1309 | 1309 | $reshook = $hookmanager->executeHooks('printTabsHead', $parameters); // This hook usage is called just before output the head of tabs. Take also a look at "completeTabsHead"
|
@@ -1412,7 +1412,7 @@ discard block |
||
| 1412 | 1412 | if (Globals::$conf->browser->layout == 'phone') |
| 1413 | 1413 | $maxvisiblephotos = 1; |
| 1414 | 1414 | if ($showimage) |
| 1415 | - $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">' . $object->show_photos('product', Globals::$conf->product->multidir_output[$entity], 'small', $maxvisiblephotos, 0, 0, 0, $width, 0) . '</div>';
|
|
| 1415 | + $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos('product', Globals::$conf->product->multidir_output[$entity], 'small', $maxvisiblephotos, 0, 0, 0, $width, 0).'</div>';
|
|
| 1416 | 1416 | else {
|
| 1417 | 1417 | if (!empty(Globals::$conf->global->PRODUCT_NODISPLAYIFNOPHOTO)) {
|
| 1418 | 1418 | $nophoto = ''; |
@@ -1421,18 +1421,18 @@ discard block |
||
| 1421 | 1421 | //elseif (Globals::$conf->browser->layout != 'phone') { // Show no photo link
|
| 1422 | 1422 | $nophoto = '/public/theme/common/nophoto.png'; |
| 1423 | 1423 | // $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="No photo" border="0"' . ($width ? ' width="' . $width . '"' : '') . ' src="' . DOL_BASE_URI . $nophoto . '"></div>'; |
| 1424 | - $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="No photo" border="0"' . ($width ? ' width="' . $width . '"' : '') . ' src="' . DOL_BASE_URI . $nophoto . '"></div>'; |
|
| 1424 | + $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="No photo" border="0"'.($width ? ' width="'.$width.'"' : '').' src="'.DOL_BASE_URI.$nophoto.'"></div>'; |
|
| 1425 | 1425 | //} |
| 1426 | 1426 | } |
| 1427 | 1427 | } elseif ($object->element == 'ticket') {
|
| 1428 | 1428 | $width = 80; |
| 1429 | 1429 | $cssclass = 'photoref'; |
| 1430 | - $showimage = $object->is_photo_available(Globals::$conf->ticket->multidir_output[$entity] . '/' . $object->track_id); |
|
| 1430 | + $showimage = $object->is_photo_available(Globals::$conf->ticket->multidir_output[$entity].'/'.$object->track_id); |
|
| 1431 | 1431 | $maxvisiblephotos = (isset(Globals::$conf->global->TICKETSUP_MAX_VISIBLE_PHOTO) ? Globals::$conf->global->TICKETSUP_MAX_VISIBLE_PHOTO : 2); |
| 1432 | 1432 | if (Globals::$conf->browser->layout == 'phone') |
| 1433 | 1433 | $maxvisiblephotos = 1; |
| 1434 | 1434 | if ($showimage) |
| 1435 | - $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">' . $object->show_photos('ticket', Globals::$conf->ticket->multidir_output[$entity], 'small', $maxvisiblephotos, 0, 0, 0, $width, 0) . '</div>';
|
|
| 1435 | + $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos('ticket', Globals::$conf->ticket->multidir_output[$entity], 'small', $maxvisiblephotos, 0, 0, 0, $width, 0).'</div>';
|
|
| 1436 | 1436 | else {
|
| 1437 | 1437 | if (!empty(Globals::$conf->global->TICKETSUP_NODISPLAYIFNOPHOTO)) {
|
| 1438 | 1438 | $nophoto = ''; |
@@ -1441,7 +1441,7 @@ discard block |
||
| 1441 | 1441 | //elseif (Globals::$conf->browser->layout != 'phone') { // Show no photo link
|
| 1442 | 1442 | $nophoto = '/public/theme/common/nophoto.png'; |
| 1443 | 1443 | //$morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="No photo" border="0"' . ($width ? ' width="' . $width . '"' : '') . ' src="' . DOL_BASE_URI . $nophoto . '"></div>'; |
| 1444 | - $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="No photo" border="0"' . ($width ? ' width="' . $width . '"' : '') . ' src="' . DOL_BASE_URI . $nophoto . '"></div>'; |
|
| 1444 | + $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="No photo" border="0"'.($width ? ' width="'.$width.'"' : '').' src="'.DOL_BASE_URI.$nophoto.'"></div>'; |
|
| 1445 | 1445 | //} |
| 1446 | 1446 | } |
| 1447 | 1447 | } else {
|
@@ -1451,25 +1451,25 @@ discard block |
||
| 1451 | 1451 | // Check if a preview file is available |
| 1452 | 1452 | if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter', 'contract', 'supplier_order', 'supplier_proposal', 'supplier_invoice', 'expensereport')) && class_exists("Imagick")) {
|
| 1453 | 1453 | $objectref = dol_sanitizeFileName($object->ref); |
| 1454 | - $dir_output = (empty(Globals::$conf->$modulepart->multidir_output[$entity]) ? Globals::$conf->$modulepart->dir_output : Globals::$conf->$modulepart->multidir_output[$entity]) . "/"; |
|
| 1454 | + $dir_output = (empty(Globals::$conf->$modulepart->multidir_output[$entity]) ? Globals::$conf->$modulepart->dir_output : Globals::$conf->$modulepart->multidir_output[$entity])."/"; |
|
| 1455 | 1455 | if (in_array($modulepart, array('invoice_supplier', 'supplier_invoice'))) {
|
| 1456 | 1456 | $subdir = get_exdir($object->id, 2, 0, 1, $object, $modulepart); |
| 1457 | - $subdir .= ((!empty($subdir) && !preg_match('/\/$/', $subdir)) ? '/' : '') . $objectref; // the objectref dir is not included into get_exdir when used with level=2, so we add it at end
|
|
| 1457 | + $subdir .= ((!empty($subdir) && !preg_match('/\/$/', $subdir)) ? '/' : '').$objectref; // the objectref dir is not included into get_exdir when used with level=2, so we add it at end
|
|
| 1458 | 1458 | } else {
|
| 1459 | 1459 | $subdir = get_exdir($object->id, 0, 0, 1, $object, $modulepart); |
| 1460 | 1460 | } |
| 1461 | 1461 | if (empty($subdir)) |
| 1462 | 1462 | $subdir = 'errorgettingsubdirofobject'; // Protection to avoid to return empty path |
| 1463 | 1463 | |
| 1464 | - $filepath = $dir_output . $subdir . "/"; |
|
| 1464 | + $filepath = $dir_output.$subdir."/"; |
|
| 1465 | 1465 | |
| 1466 | - $file = $filepath . $objectref . ".pdf"; |
|
| 1467 | - $relativepath = $subdir . '/' . $objectref . '.pdf'; |
|
| 1466 | + $file = $filepath.$objectref.".pdf"; |
|
| 1467 | + $relativepath = $subdir.'/'.$objectref.'.pdf'; |
|
| 1468 | 1468 | |
| 1469 | 1469 | // Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png") |
| 1470 | - $fileimage = $file . '_preview.png'; // If PDF has 1 page |
|
| 1471 | - $fileimagebis = $file . '_preview-0.png'; // If PDF has more than one page |
|
| 1472 | - $relativepathimage = $relativepath . '_preview.png'; |
|
| 1470 | + $fileimage = $file.'_preview.png'; // If PDF has 1 page |
|
| 1471 | + $fileimagebis = $file.'_preview-0.png'; // If PDF has more than one page |
|
| 1472 | + $relativepathimage = $relativepath.'_preview.png'; |
|
| 1473 | 1473 | |
| 1474 | 1474 | // Si fichier PDF existe |
| 1475 | 1475 | if (file_exists($file)) {
|
@@ -1478,7 +1478,7 @@ discard block |
||
| 1478 | 1478 | if ((!file_exists($fileimage) || (filemtime($fileimage) < filemtime($file))) && (!file_exists($fileimagebis) || (filemtime($fileimagebis) < filemtime($file))) |
| 1479 | 1479 | ) {
|
| 1480 | 1480 | if (empty(Globals::$conf->global->MAIN_DISABLE_PDF_THUMBS)) { // If you experienc trouble with pdf thumb generation and imagick, you can disable here.
|
| 1481 | - include_once DOL_BASE_PATH . '/core/lib/files.lib.php'; |
|
| 1481 | + include_once DOL_BASE_PATH.'/core/lib/files.lib.php'; |
|
| 1482 | 1482 | $ret = dol_convert_file($file, 'png', $fileimage); |
| 1483 | 1483 | if ($ret < 0) |
| 1484 | 1484 | $error++; |
@@ -1491,14 +1491,14 @@ discard block |
||
| 1491 | 1491 | // Si fichier png PDF d'1 page trouve |
| 1492 | 1492 | if (file_exists($fileimage)) {
|
| 1493 | 1493 | $phototoshow = '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">'; |
| 1494 | - $phototoshow .= '<img height="' . $heightforphotref . '" class="photo photowithmargin photowithborder" src="' . DOL_BASE_URI . '/viewimage.php?modulepart=apercu' . $modulepart . '&file=' . urlencode($relativepathimage) . '">'; |
|
| 1494 | + $phototoshow .= '<img height="'.$heightforphotref.'" class="photo photowithmargin photowithborder" src="'.DOL_BASE_URI.'/viewimage.php?modulepart=apercu'.$modulepart.'&file='.urlencode($relativepathimage).'">'; |
|
| 1495 | 1495 | $phototoshow .= '</div></div>'; |
| 1496 | 1496 | } |
| 1497 | 1497 | // Si fichier png PDF de plus d'1 page trouve |
| 1498 | 1498 | elseif (file_exists($fileimagebis)) {
|
| 1499 | - $preview = preg_replace('/\.png/', '', $relativepathimage) . "-0.png";
|
|
| 1499 | + $preview = preg_replace('/\.png/', '', $relativepathimage)."-0.png";
|
|
| 1500 | 1500 | $phototoshow = '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">'; |
| 1501 | - $phototoshow .= '<img height="' . $heightforphotref . '" class="photo photowithmargin photowithborder" src="' . DOL_BASE_URI . '/viewimage.php?modulepart=apercu' . $modulepart . '&file=' . urlencode($preview) . '"><p>'; |
|
| 1501 | + $phototoshow .= '<img height="'.$heightforphotref.'" class="photo photowithmargin photowithborder" src="'.DOL_BASE_URI.'/viewimage.php?modulepart=apercu'.$modulepart.'&file='.urlencode($preview).'"><p>'; |
|
| 1502 | 1502 | $phototoshow .= '</div></div>'; |
| 1503 | 1503 | } |
| 1504 | 1504 | } |
@@ -1525,10 +1525,10 @@ discard block |
||
| 1525 | 1525 | $picto = $object->picto; |
| 1526 | 1526 | if ($object->element == 'project' && !$object->public) |
| 1527 | 1527 | $picto = 'project'; // instead of projectpub |
| 1528 | - $nophoto = img_picto('', 'object_' . $picto, '', false, 1);
|
|
| 1528 | + $nophoto = img_picto('', 'object_'.$picto, '', false, 1);
|
|
| 1529 | 1529 | } |
| 1530 | 1530 | $morehtmlleft .= '<!-- No photo to show -->'; |
| 1531 | - $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="No photo" border="0"' . ($width ? ' width="' . $width . '"' : '') . ' src="' . $nophoto . '"></div></div>'; |
|
| 1531 | + $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="No photo" border="0"'.($width ? ' width="'.$width.'"' : '').' src="'.$nophoto.'"></div></div>'; |
|
| 1532 | 1532 | |
| 1533 | 1533 | $morehtmlleft .= '</div>'; |
| 1534 | 1534 | } |
@@ -1536,7 +1536,7 @@ discard block |
||
| 1536 | 1536 | } |
| 1537 | 1537 | |
| 1538 | 1538 | if ($showbarcode) |
| 1539 | - $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">' . $form->showbarcode($object) . '</div>'; |
|
| 1539 | + $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>'; |
|
| 1540 | 1540 | |
| 1541 | 1541 | if ($object->element == 'societe') {
|
| 1542 | 1542 | if (!empty(Globals::$conf->use_javascript_ajax) && $user->rights->societe->creer && !empty(Globals::$conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
@@ -1549,14 +1549,14 @@ discard block |
||
| 1549 | 1549 | if (!empty(Globals::$conf->use_javascript_ajax) && $user->rights->produit->creer && !empty(Globals::$conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
| 1550 | 1550 | $morehtmlstatus .= ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); |
| 1551 | 1551 | } else {
|
| 1552 | - $morehtmlstatus .= '<span class="statusrefsell">' . $object->getLibStatut(5, 0) . '</span>'; |
|
| 1552 | + $morehtmlstatus .= '<span class="statusrefsell">'.$object->getLibStatut(5, 0).'</span>'; |
|
| 1553 | 1553 | } |
| 1554 | 1554 | $morehtmlstatus .= ' '; |
| 1555 | 1555 | //$morehtmlstatus.=Globals::$langs->trans("Status").' ('.Globals::$langs->trans("Buy").') ';
|
| 1556 | 1556 | if (!empty(Globals::$conf->use_javascript_ajax) && $user->rights->produit->creer && !empty(Globals::$conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
| 1557 | 1557 | $morehtmlstatus .= ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); |
| 1558 | 1558 | } else {
|
| 1559 | - $morehtmlstatus .= '<span class="statusrefbuy">' . $object->getLibStatut(5, 1) . '</span>'; |
|
| 1559 | + $morehtmlstatus .= '<span class="statusrefbuy">'.$object->getLibStatut(5, 1).'</span>'; |
|
| 1560 | 1560 | } |
| 1561 | 1561 | } elseif (in_array($object->element, array('facture', 'invoice', 'invoice_supplier', 'chargesociales', 'loan'))) {
|
| 1562 | 1562 | $tmptxt = $object->getLibStatut(6, $object->totalpaye); |
@@ -1583,7 +1583,7 @@ discard block |
||
| 1583 | 1583 | if ($object->progress >= 100) |
| 1584 | 1584 | $object->fk_statut = 3; |
| 1585 | 1585 | $tmptxt = $object->getLibStatut(5); |
| 1586 | - $morehtmlstatus .= $tmptxt; // No status on task |
|
| 1586 | + $morehtmlstatus .= $tmptxt; // No status on task |
|
| 1587 | 1587 | } |
| 1588 | 1588 | else { // Generic case
|
| 1589 | 1589 | $tmptxt = $object->getLibStatut(6); |
@@ -1597,18 +1597,18 @@ discard block |
||
| 1597 | 1597 | if (method_exists($object, 'getVentilExportCompta')) {
|
| 1598 | 1598 | $accounted = $object->getVentilExportCompta(); |
| 1599 | 1599 | Globals::$langs->load("accountancy");
|
| 1600 | - $morehtmlstatus .= '</div><div class="statusref statusrefbis">' . ($accounted > 0 ? Globals::$langs->trans("Accounted") : Globals::$langs->trans("NotYetAccounted"));
|
|
| 1600 | + $morehtmlstatus .= '</div><div class="statusref statusrefbis">'.($accounted > 0 ? Globals::$langs->trans("Accounted") : Globals::$langs->trans("NotYetAccounted"));
|
|
| 1601 | 1601 | } |
| 1602 | 1602 | } |
| 1603 | 1603 | |
| 1604 | 1604 | // Add alias for thirdparty |
| 1605 | 1605 | if (!empty($object->name_alias)) |
| 1606 | - $morehtmlref .= '<div class="refidno">' . $object->name_alias . '</div>'; |
|
| 1606 | + $morehtmlref .= '<div class="refidno">'.$object->name_alias.'</div>'; |
|
| 1607 | 1607 | |
| 1608 | 1608 | // Add label |
| 1609 | 1609 | if ($object->element == 'product' || $object->element == 'bank_account' || $object->element == 'project_task') {
|
| 1610 | 1610 | if (!empty($object->label)) |
| 1611 | - $morehtmlref .= '<div class="refidno">' . $object->label . '</div>'; |
|
| 1611 | + $morehtmlref .= '<div class="refidno">'.$object->label.'</div>'; |
|
| 1612 | 1612 | } |
| 1613 | 1613 | |
| 1614 | 1614 | if (method_exists($object, 'getBannerAddress') && $object->element != 'product' && $object->element != 'bookmark' && $object->element != 'ecm_directories' && $object->element != 'ecm_files') {
|
@@ -1618,11 +1618,11 @@ discard block |
||
| 1618 | 1618 | } |
| 1619 | 1619 | if (!empty(Globals::$conf->global->MAIN_SHOW_TECHNICAL_ID) && in_array($object->element, array('societe', 'contact', 'member', 'product'))) {
|
| 1620 | 1620 | $morehtmlref .= '<div style="clear: both;"></div><div class="refidno">'; |
| 1621 | - $morehtmlref .= Globals::$langs->trans("TechnicalID") . ': ' . $object->id;
|
|
| 1621 | + $morehtmlref .= Globals::$langs->trans("TechnicalID").': '.$object->id;
|
|
| 1622 | 1622 | $morehtmlref .= '</div>'; |
| 1623 | 1623 | } |
| 1624 | 1624 | |
| 1625 | - print '<div class="' . ($onlybanner ? 'arearefnobottom ' : 'arearef ') . 'heightref valignmiddle" width="100%">'; |
|
| 1625 | + print '<div class="'.($onlybanner ? 'arearefnobottom ' : 'arearef ').'heightref valignmiddle" width="100%">'; |
|
| 1626 | 1626 | print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright); |
| 1627 | 1627 | print '</div>'; |
| 1628 | 1628 | print '<div class="underrefbanner clearboth"></div>'; |
@@ -1644,7 +1644,7 @@ discard block |
||
| 1644 | 1644 | if ($fieldrequired) |
| 1645 | 1645 | $ret .= '<span class="fieldrequired">'; |
| 1646 | 1646 | if ((Globals::$conf->dol_use_jmobile != 4)) |
| 1647 | - $ret .= '<label for="' . $fieldkey . '">'; |
|
| 1647 | + $ret .= '<label for="'.$fieldkey.'">'; |
|
| 1648 | 1648 | $ret .= Globals::$langs->trans($langkey); |
| 1649 | 1649 | if ((Globals::$conf->dol_use_jmobile != 4)) |
| 1650 | 1650 | $ret .= '</label>'; |
@@ -1663,9 +1663,9 @@ discard block |
||
| 1663 | 1663 | static function dol_bc($var, $moreclass = '') |
| 1664 | 1664 | {
|
| 1665 | 1665 | // global $bc; |
| 1666 | - $ret = ' ' . $bc[$var]; |
|
| 1666 | + $ret = ' '.$bc[$var]; |
|
| 1667 | 1667 | if ($moreclass) |
| 1668 | - $ret = preg_replace('/class=\"/', 'class="' . $moreclass . ' ', $ret);
|
|
| 1668 | + $ret = preg_replace('/class=\"/', 'class="'.$moreclass.' ', $ret);
|
|
| 1669 | 1669 | return $ret; |
| 1670 | 1670 | } |
| 1671 | 1671 | |
@@ -1685,50 +1685,50 @@ discard block |
||
| 1685 | 1685 | // global Globals::$conf, Globals::$langs; |
| 1686 | 1686 | |
| 1687 | 1687 | $ret = ''; |
| 1688 | - $countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR'); // See also MAIN_FORCE_STATE_INTO_ADDRESS
|
|
| 1688 | + $countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR'); // See also MAIN_FORCE_STATE_INTO_ADDRESS
|
|
| 1689 | 1689 | // Address |
| 1690 | 1690 | if (empty($mode)) {
|
| 1691 | 1691 | $ret .= $object->address; |
| 1692 | 1692 | } |
| 1693 | 1693 | // Zip/Town/State |
| 1694 | 1694 | if (in_array($object->country_code, array('AU', 'CA', 'US')) || !empty(Globals::$conf->global->MAIN_FORCE_STATE_INTO_ADDRESS)) { // US: title firstname name \n address lines \n town, state, zip \n country
|
| 1695 | - $ret .= ($ret ? $sep : '' ) . $object->town; |
|
| 1695 | + $ret .= ($ret ? $sep : '').$object->town; |
|
| 1696 | 1696 | if ($object->state) {
|
| 1697 | - $ret .= ($ret ? ", " : '') . $object->state; |
|
| 1697 | + $ret .= ($ret ? ", " : '').$object->state; |
|
| 1698 | 1698 | } |
| 1699 | 1699 | if ($object->zip) |
| 1700 | - $ret .= ($ret ? ", " : '') . $object->zip; |
|
| 1700 | + $ret .= ($ret ? ", " : '').$object->zip; |
|
| 1701 | 1701 | } |
| 1702 | 1702 | else if (in_array($object->country_code, array('GB', 'UK'))) { // UK: title firstname name \n address lines \n town state \n zip \n country
|
| 1703 | - $ret .= ($ret ? $sep : '' ) . $object->town; |
|
| 1703 | + $ret .= ($ret ? $sep : '').$object->town; |
|
| 1704 | 1704 | if ($object->state) {
|
| 1705 | - $ret .= ($ret ? ", " : '') . $object->state; |
|
| 1705 | + $ret .= ($ret ? ", " : '').$object->state; |
|
| 1706 | 1706 | } |
| 1707 | 1707 | if ($object->zip) |
| 1708 | - $ret .= ($ret ? $sep : '' ) . $object->zip; |
|
| 1708 | + $ret .= ($ret ? $sep : '').$object->zip; |
|
| 1709 | 1709 | } |
| 1710 | 1710 | else if (in_array($object->country_code, array('ES', 'TR'))) { // ES: title firstname name \n address lines \n zip town \n state \n country
|
| 1711 | - $ret .= ($ret ? $sep : '' ) . $object->zip; |
|
| 1712 | - $ret .= ($object->town ? (($object->zip ? ' ' : '') . $object->town) : ''); |
|
| 1711 | + $ret .= ($ret ? $sep : '').$object->zip; |
|
| 1712 | + $ret .= ($object->town ? (($object->zip ? ' ' : '').$object->town) : ''); |
|
| 1713 | 1713 | if ($object->state) {
|
| 1714 | - $ret .= "\n" . $object->state; |
|
| 1714 | + $ret .= "\n".$object->state; |
|
| 1715 | 1715 | } |
| 1716 | 1716 | } else if (in_array($object->country_code, array('IT'))) { // IT: tile firstname name\n address lines \n zip (Code Departement) \n country
|
| 1717 | - $ret .= ($ret ? $sep : '' ) . $object->zip; |
|
| 1718 | - $ret .= ($object->town ? (($object->zip ? ' ' : '') . $object->town) : ''); |
|
| 1719 | - $ret .= ($object->departement_id ? (' (' . ($object->departement_id) . ')') : '');
|
|
| 1717 | + $ret .= ($ret ? $sep : '').$object->zip; |
|
| 1718 | + $ret .= ($object->town ? (($object->zip ? ' ' : '').$object->town) : ''); |
|
| 1719 | + $ret .= ($object->departement_id ? (' ('.($object->departement_id).')') : '');
|
|
| 1720 | 1720 | } else { // Other: title firstname name \n address lines \n zip town \n country
|
| 1721 | - $ret .= $object->zip ? (($ret ? $sep : '' ) . $object->zip) : ''; |
|
| 1722 | - $ret .= ($object->town ? (($object->zip ? ' ' : ($ret ? $sep : '' )) . $object->town) : ''); |
|
| 1721 | + $ret .= $object->zip ? (($ret ? $sep : '').$object->zip) : ''; |
|
| 1722 | + $ret .= ($object->town ? (($object->zip ? ' ' : ($ret ? $sep : '')).$object->town) : ''); |
|
| 1723 | 1723 | if ($object->state && in_array($object->country_code, $countriesusingstate)) {
|
| 1724 | - $ret .= ($ret ? ", " : '') . $object->state; |
|
| 1724 | + $ret .= ($ret ? ", " : '').$object->state; |
|
| 1725 | 1725 | } |
| 1726 | 1726 | } |
| 1727 | 1727 | if (!is_object($outputlangs)) |
| 1728 | 1728 | $outputlangs = Globals::$langs; |
| 1729 | 1729 | if ($withcountry) {
|
| 1730 | 1730 | Globals::$langs->load("dict");
|
| 1731 | - $ret .= ($object->country_code ? ($ret ? $sep : '') . $outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country" . $object->country_code)) : '');
|
|
| 1731 | + $ret .= ($object->country_code ? ($ret ? $sep : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$object->country_code)) : '');
|
|
| 1732 | 1732 | } |
| 1733 | 1733 | |
| 1734 | 1734 | return $ret; |
@@ -1782,13 +1782,13 @@ discard block |
||
| 1782 | 1782 | if (is_string($tzoutput)) {
|
| 1783 | 1783 | if ($tzoutput == 'tzserver') {
|
| 1784 | 1784 | $to_gmt = false; |
| 1785 | - $offsettzstring = @date_default_timezone_get(); // Example 'Europe/Berlin' or 'Indian/Reunion' |
|
| 1785 | + $offsettzstring = @date_default_timezone_get(); // Example 'Europe/Berlin' or 'Indian/Reunion' |
|
| 1786 | 1786 | $offsettz = 0; |
| 1787 | 1787 | $offsetdst = 0; |
| 1788 | 1788 | } elseif ($tzoutput == 'tzuser' || $tzoutput == 'tzuserrel') {
|
| 1789 | 1789 | $to_gmt = true; |
| 1790 | 1790 | $offsettzstring = (empty($_SESSION['dol_tz_string']) ? 'UTC' : $_SESSION['dol_tz_string']); // Example 'Europe/Berlin' or 'Indian/Reunion' |
| 1791 | - $offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; // Will not be used anymore |
|
| 1791 | + $offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; // Will not be used anymore |
|
| 1792 | 1792 | $offsetdst = (empty($_SESSION['dol_dst']) ? 0 : $_SESSION['dol_dst']) * 60 * 60; // Will not be used anymore |
| 1793 | 1793 | } |
| 1794 | 1794 | } |
@@ -1834,9 +1834,9 @@ discard block |
||
| 1834 | 1834 | else if ($format == 'dayxcard') |
| 1835 | 1835 | $format = '%Y%m%d'; |
| 1836 | 1836 | else if ($format == 'dayrfc') |
| 1837 | - $format = '%Y-%m-%d'; // DATE_RFC3339 |
|
| 1837 | + $format = '%Y-%m-%d'; // DATE_RFC3339 |
|
| 1838 | 1838 | else if ($format == 'dayhourrfc') |
| 1839 | - $format = '%Y-%m-%dT%H:%M:%SZ'; // DATETIME RFC3339 |
|
| 1839 | + $format = '%Y-%m-%dT%H:%M:%SZ'; // DATETIME RFC3339 |
|
| 1840 | 1840 | else if ($format == 'standard') |
| 1841 | 1841 | $format = '%Y-%m-%d %H:%M:%S'; |
| 1842 | 1842 | |
@@ -1847,7 +1847,7 @@ discard block |
||
| 1847 | 1847 | |
| 1848 | 1848 | // If date undefined or "", we return "" |
| 1849 | 1849 | if (DolUtils::dol_strlen($time) == 0) |
| 1850 | - return ''; // $time=0 allowed (it means 01/01/1970 00:00:00) |
|
| 1850 | + return ''; // $time=0 allowed (it means 01/01/1970 00:00:00) |
|
| 1851 | 1851 | |
| 1852 | 1852 | |
| 1853 | 1853 | |
@@ -1898,7 +1898,7 @@ discard block |
||
| 1898 | 1898 | if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg) || preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) { // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000
|
| 1899 | 1899 | // TODO Remove this. |
| 1900 | 1900 | // This part of code should not be used. |
| 1901 | - DolUtils::dol_syslog("Functions.lib::dol_print_date static function call with deprecated value of time in page " . $_SERVER["PHP_SELF"], LOG_ERR);
|
|
| 1901 | + DolUtils::dol_syslog("Functions.lib::dol_print_date static function call with deprecated value of time in page ".$_SERVER["PHP_SELF"], LOG_ERR);
|
|
| 1902 | 1902 | // Date has format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' or 'YYYYMMDDHHMMSS' |
| 1903 | 1903 | $syear = (!empty($reg[1]) ? $reg[1] : ''); |
| 1904 | 1904 | $smonth = (!empty($reg[2]) ? $reg[2] : ''); |
@@ -1916,7 +1916,7 @@ discard block |
||
| 1916 | 1916 | |
| 1917 | 1917 | $ret = adodb_strftime($format, $timetouse, $to_gmt); |
| 1918 | 1918 | } else |
| 1919 | - $ret = 'Bad value ' . $time . ' for date'; |
|
| 1919 | + $ret = 'Bad value '.$time.' for date'; |
|
| 1920 | 1920 | } |
| 1921 | 1921 | |
| 1922 | 1922 | if (preg_match('/__b__/i', $format)) {
|
@@ -1925,11 +1925,11 @@ discard block |
||
| 1925 | 1925 | $month = adodb_strftime('%m', $timetouse);
|
| 1926 | 1926 | $month = sprintf("%02d", $month); // $month may be return with format '06' on some installation and '6' on other, so we force it to '06'.
|
| 1927 | 1927 | if ($encodetooutput) {
|
| 1928 | - $monthtext = $outputlangs->transnoentities('Month' . $month);
|
|
| 1929 | - $monthtextshort = $outputlangs->transnoentities('MonthShort' . $month);
|
|
| 1928 | + $monthtext = $outputlangs->transnoentities('Month'.$month);
|
|
| 1929 | + $monthtextshort = $outputlangs->transnoentities('MonthShort'.$month);
|
|
| 1930 | 1930 | } else {
|
| 1931 | - $monthtext = $outputlangs->transnoentitiesnoconv('Month' . $month);
|
|
| 1932 | - $monthtextshort = $outputlangs->transnoentitiesnoconv('MonthShort' . $month);
|
|
| 1931 | + $monthtext = $outputlangs->transnoentitiesnoconv('Month'.$month);
|
|
| 1932 | + $monthtextshort = $outputlangs->transnoentitiesnoconv('MonthShort'.$month);
|
|
| 1933 | 1933 | } |
| 1934 | 1934 | //print 'monthtext='.$monthtext.' monthtextshort='.$monthtextshort; |
| 1935 | 1935 | $ret = str_replace('__b__', $monthtextshort, $ret);
|
@@ -1940,8 +1940,8 @@ discard block |
||
| 1940 | 1940 | if (preg_match('/__a__/i', $format)) {
|
| 1941 | 1941 | $timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with static function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. |
| 1942 | 1942 | |
| 1943 | - $w = adodb_strftime('%w', $timetouse); // TODO Replace this with static function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
|
|
| 1944 | - $dayweek = $outputlangs->transnoentitiesnoconv('Day' . $w);
|
|
| 1943 | + $w = adodb_strftime('%w', $timetouse); // TODO Replace this with static function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
|
|
| 1944 | + $dayweek = $outputlangs->transnoentitiesnoconv('Day'.$w);
|
|
| 1945 | 1945 | $ret = str_replace('__A__', $dayweek, $ret);
|
| 1946 | 1946 | $ret = str_replace('__a__', dol_substr($dayweek, 0, 3), $ret);
|
| 1947 | 1947 | } |
@@ -1988,9 +1988,9 @@ discard block |
||
| 1988 | 1988 | |
| 1989 | 1989 | $usealternatemethod = false; |
| 1990 | 1990 | if ($timestamp <= 0) |
| 1991 | - $usealternatemethod = true; // <= 1970 |
|
| 1991 | + $usealternatemethod = true; // <= 1970 |
|
| 1992 | 1992 | if ($timestamp >= 2145913200) |
| 1993 | - $usealternatemethod = true; // >= 2038 |
|
| 1993 | + $usealternatemethod = true; // >= 2038 |
|
| 1994 | 1994 | |
| 1995 | 1995 | if ($usealternatemethod) {
|
| 1996 | 1996 | $arrayinfo = adodb_getdate($timestamp, $fast); |
@@ -2050,23 +2050,23 @@ discard block |
||
| 2050 | 2050 | |
| 2051 | 2051 | if (method_exists('DateTime', 'getTimestamp')) {
|
| 2052 | 2052 | if (empty($gm) || $gm === 'server') {
|
| 2053 | - $default_timezone = @date_default_timezone_get(); // Example 'Europe/Berlin' |
|
| 2053 | + $default_timezone = @date_default_timezone_get(); // Example 'Europe/Berlin' |
|
| 2054 | 2054 | $localtz = new \DateTimeZone($default_timezone); |
| 2055 | 2055 | } else if ($gm === 'user') {
|
| 2056 | 2056 | // We use dol_tz_string first because it is more reliable. |
| 2057 | - $default_timezone = (empty($_SESSION["dol_tz_string"]) ? @date_default_timezone_get() : $_SESSION["dol_tz_string"]); // Example 'Europe/Berlin' |
|
| 2057 | + $default_timezone = (empty($_SESSION["dol_tz_string"]) ? @date_default_timezone_get() : $_SESSION["dol_tz_string"]); // Example 'Europe/Berlin' |
|
| 2058 | 2058 | try {
|
| 2059 | 2059 | $localtz = new \DateTimeZone($default_timezone); |
| 2060 | 2060 | } catch (Exception $e) {
|
| 2061 | - DolUtils::dol_syslog("Warning dol_tz_string contains an invalid value " . $_SESSION["dol_tz_string"], LOG_WARNING);
|
|
| 2061 | + DolUtils::dol_syslog("Warning dol_tz_string contains an invalid value ".$_SESSION["dol_tz_string"], LOG_WARNING);
|
|
| 2062 | 2062 | $default_timezone = @date_default_timezone_get(); |
| 2063 | 2063 | } |
| 2064 | 2064 | } else if (strrpos($gm, "tz,") !== false) {
|
| 2065 | - $timezone = str_replace("tz,", "", $gm); // Example 'tz,Europe/Berlin'
|
|
| 2065 | + $timezone = str_replace("tz,", "", $gm); // Example 'tz,Europe/Berlin'
|
|
| 2066 | 2066 | try {
|
| 2067 | 2067 | $localtz = new \DateTimeZone($timezone); |
| 2068 | 2068 | } catch (Exception $e) {
|
| 2069 | - DolUtils::dol_syslog("Warning passed timezone contains an invalid value " . $timezone, LOG_WARNING);
|
|
| 2069 | + DolUtils::dol_syslog("Warning passed timezone contains an invalid value ".$timezone, LOG_WARNING);
|
|
| 2070 | 2070 | } |
| 2071 | 2071 | } |
| 2072 | 2072 | |
@@ -2105,8 +2105,8 @@ discard block |
||
| 2105 | 2105 | if ($mode == 'gmt') |
| 2106 | 2106 | $ret = time(); // Time for now at greenwich. |
| 2107 | 2107 | else if ($mode == 'tzserver') { // Time for now with PHP server timezone added
|
| 2108 | - require_once DOL_BASE_PATH . '/core/lib/date.lib.php'; |
|
| 2109 | - $tzsecond = getServerTimeZoneInt('now'); // Contains tz+dayling saving time
|
|
| 2108 | + require_once DOL_BASE_PATH.'/core/lib/date.lib.php'; |
|
| 2109 | + $tzsecond = getServerTimeZoneInt('now'); // Contains tz+dayling saving time
|
|
| 2110 | 2110 | $ret = (int) (dol_now('gmt') + ($tzsecond * 3600));
|
| 2111 | 2111 | } |
| 2112 | 2112 | /* else if ($mode == 'tzref') // Time for now with parent company timezone is added |
@@ -2152,9 +2152,9 @@ discard block |
||
| 2152 | 2152 | } |
| 2153 | 2153 | // Use long or short text unit |
| 2154 | 2154 | if (empty($shortunit)) {
|
| 2155 | - $ret .= ' ' . $textunitlong; |
|
| 2155 | + $ret .= ' '.$textunitlong; |
|
| 2156 | 2156 | } else {
|
| 2157 | - $ret .= ' ' . $textunitshort; |
|
| 2157 | + $ret .= ' '.$textunitshort; |
|
| 2158 | 2158 | } |
| 2159 | 2159 | |
| 2160 | 2160 | return $ret; |
@@ -2182,13 +2182,13 @@ discard block |
||
| 2182 | 2182 | $link .= $url; |
| 2183 | 2183 | $link .= '"'; |
| 2184 | 2184 | if ($target) |
| 2185 | - $link .= ' target="' . $target . '"'; |
|
| 2185 | + $link .= ' target="'.$target.'"'; |
|
| 2186 | 2186 | $link .= '>'; |
| 2187 | 2187 | if (!preg_match('/^http/i', $url))
|
| 2188 | 2188 | $link .= 'http://'; |
| 2189 | 2189 | $link .= dol_trunc($url, $max); |
| 2190 | 2190 | $link .= '</a>'; |
| 2191 | - return '<div class="nospan float" style="margin-right: 10px">' . ($withpicto ? img_picto(Globals::$langs->trans("Url"), 'object_globe.png') . ' ' : '') . $link . '</div>';
|
|
| 2191 | + return '<div class="nospan float" style="margin-right: 10px">'.($withpicto ? img_picto(Globals::$langs->trans("Url"), 'object_globe.png').' ' : '').$link.'</div>';
|
|
| 2192 | 2192 | } |
| 2193 | 2193 | |
| 2194 | 2194 | /** |
@@ -2229,9 +2229,9 @@ discard block |
||
| 2229 | 2229 | $type = 'AC_EMAIL'; |
| 2230 | 2230 | $link = ''; |
| 2231 | 2231 | if (!empty(Globals::$conf->global->AGENDA_ADDACTIONFOREMAIL)) |
| 2232 | - $link = '<a href="' . DOL_BASE_URI . '/comm/action/card.php?action=create&backtopage=1&actioncode=' . $type . '&contactid=' . $cid . '&socid=' . $socid . '">' . img_object(Globals::$langs->trans("AddAction"), "calendar") . '</a>';
|
|
| 2232 | + $link = '<a href="'.DOL_BASE_URI.'/comm/action/card.php?action=create&backtopage=1&actioncode='.$type.'&contactid='.$cid.'&socid='.$socid.'">'.img_object(Globals::$langs->trans("AddAction"), "calendar").'</a>';
|
|
| 2233 | 2233 | if ($link) |
| 2234 | - $newemail = '<div>' . $newemail . ' ' . $link . '</div>'; |
|
| 2234 | + $newemail = '<div>'.$newemail.' '.$link.'</div>'; |
|
| 2235 | 2235 | } |
| 2236 | 2236 | } |
| 2237 | 2237 | else {
|
@@ -2241,7 +2241,7 @@ discard block |
||
| 2241 | 2241 | } |
| 2242 | 2242 | } |
| 2243 | 2243 | |
| 2244 | - $rep = '<div class="nospan float" style="margin-right: 10px">' . ($withpicto ? img_picto(Globals::$langs->trans("EMail"), 'object_email.png') . ' ' : '') . $newemail . '</div>';
|
|
| 2244 | + $rep = '<div class="nospan float" style="margin-right: 10px">'.($withpicto ? img_picto(Globals::$langs->trans("EMail"), 'object_email.png').' ' : '').$newemail.'</div>';
|
|
| 2245 | 2245 | if ($hookmanager) {
|
| 2246 | 2246 | $parameters = array('cid' => $cid, 'socid' => $socid, 'addlink' => $addlink, 'picto' => $withpicto);
|
| 2247 | 2247 | $reshook = $hookmanager->executeHooks('printEmail', $parameters, $email);
|
@@ -2271,26 +2271,26 @@ discard block |
||
| 2271 | 2271 | |
| 2272 | 2272 | if (!empty($type)) {
|
| 2273 | 2273 | $newskype = '<div class="divsocialnetwork inline-block valignmiddle">'; |
| 2274 | - $newskype .= img_picto(Globals::$langs->trans(strtoupper($type)), $type . '.png', '', false, 0, 0, '', 'paddingright'); |
|
| 2274 | + $newskype .= img_picto(Globals::$langs->trans(strtoupper($type)), $type.'.png', '', false, 0, 0, '', 'paddingright'); |
|
| 2275 | 2275 | $newskype .= $value; |
| 2276 | 2276 | if ($type == 'skype') {
|
| 2277 | 2277 | $newskype .= ' '; |
| 2278 | 2278 | $newskype .= '<a href="skype:'; |
| 2279 | 2279 | $newskype .= $value; |
| 2280 | - $newskype .= '?call" alt="' . Globals::$langs->trans("Call") . ' ' . $value . '" title="' . Globals::$langs->trans("Call") . ' ' . $value . '">';
|
|
| 2281 | - $newskype .= '<img src="' . DOL_BASE_URI . '/theme/common/skype_callbutton.png" border="0">'; |
|
| 2280 | + $newskype .= '?call" alt="'.Globals::$langs->trans("Call").' '.$value.'" title="'.Globals::$langs->trans("Call").' '.$value.'">';
|
|
| 2281 | + $newskype .= '<img src="'.DOL_BASE_URI.'/theme/common/skype_callbutton.png" border="0">'; |
|
| 2282 | 2282 | $newskype .= '</a><a href="skype:'; |
| 2283 | 2283 | $newskype .= $value; |
| 2284 | - $newskype .= '?chat" alt="' . Globals::$langs->trans("Chat") . ' ' . $value . '" title="' . Globals::$langs->trans("Chat") . ' ' . $value . '">';
|
|
| 2285 | - $newskype .= '<img class="paddingleft" src="' . DOL_BASE_URI . '/theme/common/skype_chatbutton.png" border="0">'; |
|
| 2284 | + $newskype .= '?chat" alt="'.Globals::$langs->trans("Chat").' '.$value.'" title="'.Globals::$langs->trans("Chat").' '.$value.'">';
|
|
| 2285 | + $newskype .= '<img class="paddingleft" src="'.DOL_BASE_URI.'/theme/common/skype_chatbutton.png" border="0">'; |
|
| 2286 | 2286 | $newskype .= '</a>'; |
| 2287 | 2287 | } |
| 2288 | 2288 | if (($cid || $socid) && !empty(Globals::$conf->agenda->enabled) && $user->rights->agenda->myactions->create && $type == 'skype') {
|
| 2289 | 2289 | $addlink = 'AC_SKYPE'; |
| 2290 | 2290 | $link = ''; |
| 2291 | 2291 | if (!empty(Globals::$conf->global->AGENDA_ADDACTIONFORSKYPE)) |
| 2292 | - $link = '<a href="' . DOL_BASE_URI . '/comm/action/card.php?action=create&backtopage=1&actioncode=' . $addlink . '&contactid=' . $cid . '&socid=' . $socid . '">' . img_object(Globals::$langs->trans("AddAction"), "calendar") . '</a>';
|
|
| 2293 | - $newskype .= ($link ? ' ' . $link : ''); |
|
| 2292 | + $link = '<a href="'.DOL_BASE_URI.'/comm/action/card.php?action=create&backtopage=1&actioncode='.$addlink.'&contactid='.$cid.'&socid='.$socid.'">'.img_object(Globals::$langs->trans("AddAction"), "calendar").'</a>';
|
|
| 2293 | + $newskype .= ($link ? ' '.$link : ''); |
|
| 2294 | 2294 | } |
| 2295 | 2295 | $newskype .= '</div>'; |
| 2296 | 2296 | } |
@@ -2334,165 +2334,165 @@ discard block |
||
| 2334 | 2334 | if (strtoupper($countrycode) == "FR") {
|
| 2335 | 2335 | // France |
| 2336 | 2336 | if (DolUtils::dol_strlen($phone) == 10) {
|
| 2337 | - $newphone = substr($newphone, 0, 2) . $separ . substr($newphone, 2, 2) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2); |
|
| 2337 | + $newphone = substr($newphone, 0, 2).$separ.substr($newphone, 2, 2).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2); |
|
| 2338 | 2338 | } elseif (DolUtils::dol_strlen($phone) == 7) {
|
| 2339 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 2); |
|
| 2339 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 2); |
|
| 2340 | 2340 | } elseif (DolUtils::dol_strlen($phone) == 9) {
|
| 2341 | - $newphone = substr($newphone, 0, 2) . $separ . substr($newphone, 2, 3) . $separ . substr($newphone, 5, 2) . $separ . substr($newphone, 7, 2); |
|
| 2341 | + $newphone = substr($newphone, 0, 2).$separ.substr($newphone, 2, 3).$separ.substr($newphone, 5, 2).$separ.substr($newphone, 7, 2); |
|
| 2342 | 2342 | } elseif (DolUtils::dol_strlen($phone) == 11) {
|
| 2343 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 2) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2); |
|
| 2343 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 2).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2); |
|
| 2344 | 2344 | } elseif (DolUtils::dol_strlen($phone) == 12) {
|
| 2345 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2345 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2346 | 2346 | } |
| 2347 | 2347 | } elseif (strtoupper($countrycode) == "CA") {
|
| 2348 | 2348 | if (DolUtils::dol_strlen($phone) == 10) {
|
| 2349 | - $newphone = ($separ != '' ? '(' : '') . substr($newphone, 0, 3) . ($separ != '' ? ')' : '') . $separ . substr($newphone, 3, 3) . ($separ != '' ? '-' : '') . substr($newphone, 6, 4);
|
|
| 2349 | + $newphone = ($separ != '' ? '(' : '').substr($newphone, 0, 3).($separ != '' ? ')' : '').$separ.substr($newphone, 3, 3).($separ != '' ? '-' : '').substr($newphone, 6, 4);
|
|
| 2350 | 2350 | } |
| 2351 | 2351 | } elseif (strtoupper($countrycode) == "PT") {//Portugal
|
| 2352 | 2352 | if (DolUtils::dol_strlen($phone) == 13) {//ex: +351_ABC_DEF_GHI
|
| 2353 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 3); |
|
| 2353 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3); |
|
| 2354 | 2354 | } |
| 2355 | 2355 | } elseif (strtoupper($countrycode) == "SR") {//Suriname
|
| 2356 | 2356 | if (DolUtils::dol_strlen($phone) == 10) {//ex: +597_ABC_DEF
|
| 2357 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3); |
|
| 2357 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3); |
|
| 2358 | 2358 | } elseif (DolUtils::dol_strlen($phone) == 11) {//ex: +597_ABC_DEFG
|
| 2359 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 4); |
|
| 2359 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 4); |
|
| 2360 | 2360 | } |
| 2361 | 2361 | } elseif (strtoupper($countrycode) == "DE") {//Allemagne
|
| 2362 | 2362 | if (DolUtils::dol_strlen($phone) == 14) {//ex: +49_ABCD_EFGH_IJK
|
| 2363 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 4) . $separ . substr($newphone, 7, 4) . $separ . substr($newphone, 11, 3); |
|
| 2363 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 4).$separ.substr($newphone, 11, 3); |
|
| 2364 | 2364 | } elseif (DolUtils::dol_strlen($phone) == 13) {//ex: +49_ABC_DEFG_HIJ
|
| 2365 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 4) . $separ . substr($newphone, 10, 3); |
|
| 2365 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 4).$separ.substr($newphone, 10, 3); |
|
| 2366 | 2366 | } |
| 2367 | 2367 | } elseif (strtoupper($countrycode) == "ES") {//Espagne
|
| 2368 | 2368 | if (DolUtils::dol_strlen($phone) == 12) {//ex: +34_ABC_DEF_GHI
|
| 2369 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 3); |
|
| 2369 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3); |
|
| 2370 | 2370 | } |
| 2371 | 2371 | } elseif (strtoupper($countrycode) == "BF") {// Burkina Faso
|
| 2372 | 2372 | if (DolUtils::dol_strlen($phone) == 12) {//ex : +22 A BC_DE_FG_HI
|
| 2373 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 1) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2373 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2374 | 2374 | } |
| 2375 | 2375 | } elseif (strtoupper($countrycode) == "RO") {// Roumanie
|
| 2376 | 2376 | if (DolUtils::dol_strlen($phone) == 12) {//ex : +40 AB_CDE_FG_HI
|
| 2377 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2377 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2378 | 2378 | } |
| 2379 | 2379 | } elseif (strtoupper($countrycode) == "TR") {//Turquie
|
| 2380 | 2380 | if (DolUtils::dol_strlen($phone) == 13) {//ex : +90 ABC_DEF_GHIJ
|
| 2381 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 4); |
|
| 2381 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 4); |
|
| 2382 | 2382 | } |
| 2383 | 2383 | } elseif (strtoupper($countrycode) == "US") {//Etat-Unis
|
| 2384 | 2384 | if (DolUtils::dol_strlen($phone) == 12) {//ex: +1 ABC_DEF_GHIJ
|
| 2385 | - $newphone = substr($newphone, 0, 2) . $separ . substr($newphone, 2, 3) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 8, 4); |
|
| 2385 | + $newphone = substr($newphone, 0, 2).$separ.substr($newphone, 2, 3).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 4); |
|
| 2386 | 2386 | } |
| 2387 | 2387 | } elseif (strtoupper($countrycode) == "MX") {//Mexique
|
| 2388 | 2388 | if (DolUtils::dol_strlen($phone) == 12) {//ex: +52 ABCD_EFG_HI
|
| 2389 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 4) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 2); |
|
| 2389 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 2); |
|
| 2390 | 2390 | } elseif (DolUtils::dol_strlen($phone) == 11) {//ex: +52 AB_CD_EF_GH
|
| 2391 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 2) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2); |
|
| 2391 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 2).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2); |
|
| 2392 | 2392 | } elseif (DolUtils::dol_strlen($phone) == 13) {//ex: +52 ABC_DEF_GHIJ
|
| 2393 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 4); |
|
| 2393 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 4); |
|
| 2394 | 2394 | } |
| 2395 | 2395 | } elseif (strtoupper($countrycode) == "ML") {//Mali
|
| 2396 | 2396 | if (DolUtils::dol_strlen($phone) == 12) {//ex: +223 AB_CD_EF_GH
|
| 2397 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2397 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2398 | 2398 | } |
| 2399 | 2399 | } elseif (strtoupper($countrycode) == "TH") {//Thaïlande
|
| 2400 | 2400 | if (DolUtils::dol_strlen($phone) == 11) {//ex: +66_ABC_DE_FGH
|
| 2401 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 3); |
|
| 2401 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3); |
|
| 2402 | 2402 | } elseif (DolUtils::dol_strlen($phone) == 12) {//ex: +66_A_BCD_EF_GHI
|
| 2403 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 1) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 3); |
|
| 2403 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 3); |
|
| 2404 | 2404 | } |
| 2405 | 2405 | } elseif (strtoupper($countrycode) == "MU") {//Maurice
|
| 2406 | 2406 | if (DolUtils::dol_strlen($phone) == 11) {//ex: +230_ABC_DE_FG
|
| 2407 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2); |
|
| 2407 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2); |
|
| 2408 | 2408 | } elseif (DolUtils::dol_strlen($phone) == 12) {//ex: +230_ABCD_EF_GH
|
| 2409 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 4) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2409 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 4).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2410 | 2410 | } |
| 2411 | 2411 | } elseif (strtoupper($countrycode) == "ZA") {//Afrique du sud
|
| 2412 | 2412 | if (DolUtils::dol_strlen($phone) == 12) {//ex: +27_AB_CDE_FG_HI
|
| 2413 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2413 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2414 | 2414 | } |
| 2415 | 2415 | } elseif (strtoupper($countrycode) == "SY") {//Syrie
|
| 2416 | 2416 | if (DolUtils::dol_strlen($phone) == 12) {//ex: +963_AB_CD_EF_GH
|
| 2417 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2417 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2418 | 2418 | } elseif (DolUtils::dol_strlen($phone) == 13) {//ex: +963_AB_CD_EF_GHI
|
| 2419 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 3); |
|
| 2419 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 3); |
|
| 2420 | 2420 | } |
| 2421 | 2421 | } elseif (strtoupper($countrycode) == "AE") {//Emirats Arabes Unis
|
| 2422 | 2422 | if (DolUtils::dol_strlen($phone) == 12) {//ex: +971_ABC_DEF_GH
|
| 2423 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 2); |
|
| 2423 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 2); |
|
| 2424 | 2424 | } elseif (DolUtils::dol_strlen($phone) == 13) {//ex: +971_ABC_DEF_GHI
|
| 2425 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 3); |
|
| 2425 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3); |
|
| 2426 | 2426 | } elseif (DolUtils::dol_strlen($phone) == 14) {//ex: +971_ABC_DEF_GHIK
|
| 2427 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 4); |
|
| 2427 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 4); |
|
| 2428 | 2428 | } |
| 2429 | 2429 | } elseif (strtoupper($countrycode) == "DZ") {//Algérie
|
| 2430 | 2430 | if (DolUtils::dol_strlen($phone) == 13) {//ex: +213_ABC_DEF_GHI
|
| 2431 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 3); |
|
| 2431 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3); |
|
| 2432 | 2432 | } |
| 2433 | 2433 | } elseif (strtoupper($countrycode) == "BE") {//Belgique
|
| 2434 | 2434 | if (DolUtils::dol_strlen($phone) == 11) {//ex: +32_ABC_DE_FGH
|
| 2435 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 3); |
|
| 2435 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3); |
|
| 2436 | 2436 | } elseif (DolUtils::dol_strlen($phone) == 12) {//ex: +32_ABC_DEF_GHI
|
| 2437 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 3); |
|
| 2437 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3); |
|
| 2438 | 2438 | } |
| 2439 | 2439 | } elseif (strtoupper($countrycode) == "PF") {//Polynésie française
|
| 2440 | 2440 | if (DolUtils::dol_strlen($phone) == 12) {//ex: +689_AB_CD_EF_GH
|
| 2441 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2441 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2442 | 2442 | } |
| 2443 | 2443 | } elseif (strtoupper($countrycode) == "CO") {//Colombie
|
| 2444 | 2444 | if (DolUtils::dol_strlen($phone) == 13) {//ex: +57_ABC_DEF_GH_IJ
|
| 2445 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 2) . $separ . substr($newphone, 11, 2); |
|
| 2445 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2); |
|
| 2446 | 2446 | } |
| 2447 | 2447 | } elseif (strtoupper($countrycode) == "JO") {//Jordanie
|
| 2448 | 2448 | if (DolUtils::dol_strlen($phone) == 12) {//ex: +962_A_BCD_EF_GH
|
| 2449 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 1) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2); |
|
| 2449 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 1).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2); |
|
| 2450 | 2450 | } |
| 2451 | 2451 | } elseif (strtoupper($countrycode) == "MG") {//Madagascar
|
| 2452 | 2452 | if (DolUtils::dol_strlen($phone) == 13) {//ex: +261_AB_CD_EF_GHI
|
| 2453 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 3); |
|
| 2453 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 3); |
|
| 2454 | 2454 | } |
| 2455 | 2455 | } elseif (strtoupper($countrycode) == "GB") {//Royaume uni
|
| 2456 | 2456 | if (DolUtils::dol_strlen($phone) == 13) {//ex: +44_ABCD_EFG_HIJ
|
| 2457 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 4) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 3); |
|
| 2457 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3); |
|
| 2458 | 2458 | } |
| 2459 | 2459 | } elseif (strtoupper($countrycode) == "CH") {//Suisse
|
| 2460 | 2460 | if (DolUtils::dol_strlen($phone) == 12) {//ex: +41_AB_CDE_FG_HI
|
| 2461 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2461 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2462 | 2462 | } elseif (DolUtils::dol_strlen($phone) == 15) {// +41_AB_CDE_FGH_IJKL
|
| 2463 | - $newphone = $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 8, 3) . $separ . substr($newphone, 11, 4); |
|
| 2463 | + $newphone = $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 3).$separ.substr($newphone, 11, 4); |
|
| 2464 | 2464 | } |
| 2465 | 2465 | } elseif (strtoupper($countrycode) == "TN") {//Tunisie
|
| 2466 | 2466 | if (DolUtils::dol_strlen($phone) == 12) {//ex: +216_AB_CDE_FGH
|
| 2467 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 3); |
|
| 2467 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3); |
|
| 2468 | 2468 | } |
| 2469 | 2469 | } elseif (strtoupper($countrycode) == "GF") {//Guyane francaise
|
| 2470 | 2470 | if (DolUtils::dol_strlen($phone) == 13) {//ex: +594_ABC_DE_FG_HI (ABC=594 de nouveau)
|
| 2471 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2) . $separ . substr($newphone, 11, 2); |
|
| 2471 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2); |
|
| 2472 | 2472 | } |
| 2473 | 2473 | } elseif (strtoupper($countrycode) == "GP") {//Guadeloupe
|
| 2474 | 2474 | if (DolUtils::dol_strlen($phone) == 13) {//ex: +590_ABC_DE_FG_HI (ABC=590 de nouveau)
|
| 2475 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2) . $separ . substr($newphone, 11, 2); |
|
| 2475 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2); |
|
| 2476 | 2476 | } |
| 2477 | 2477 | } elseif (strtoupper($countrycode) == "MQ") {//Martinique
|
| 2478 | 2478 | if (DolUtils::dol_strlen($phone) == 13) {//ex: +596_ABC_DE_FG_HI (ABC=596 de nouveau)
|
| 2479 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2) . $separ . substr($newphone, 11, 2); |
|
| 2479 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2); |
|
| 2480 | 2480 | } |
| 2481 | 2481 | } elseif (strtoupper($countrycode) == "IT") {//Italie
|
| 2482 | 2482 | if (DolUtils::dol_strlen($phone) == 12) {//ex: +39_ABC_DEF_GHI
|
| 2483 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 3); |
|
| 2483 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3); |
|
| 2484 | 2484 | } elseif (DolUtils::dol_strlen($phone) == 13) {//ex: +39_ABC_DEF_GH_IJ
|
| 2485 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 2) . $separ . substr($newphone, 11, 2); |
|
| 2485 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2); |
|
| 2486 | 2486 | } |
| 2487 | 2487 | } elseif (strtoupper($countrycode) == "AU") {//Australie
|
| 2488 | 2488 | if (DolUtils::dol_strlen($phone) == 12) {//ex: +61_A_BCDE_FGHI
|
| 2489 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 1) . $separ . substr($newphone, 4, 4) . $separ . substr($newphone, 8, 4); |
|
| 2489 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 4).$separ.substr($newphone, 8, 4); |
|
| 2490 | 2490 | } |
| 2491 | 2491 | } |
| 2492 | 2492 | if (!empty($addlink)) { // Link on phone number (+ link to add action if conf->global->AGENDA_ADDACTIONFORPHONE set)
|
| 2493 | 2493 | if (Globals::$conf->browser->layout == 'phone' || (!empty(Globals::$conf->clicktodial->enabled) && !empty(Globals::$conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS))) { // If phone or option for, we use link of phone
|
| 2494 | - $newphone = '<a href="tel:' . $phone . '"'; |
|
| 2495 | - $newphone .= '>' . $phone . '</a>'; |
|
| 2494 | + $newphone = '<a href="tel:'.$phone.'"'; |
|
| 2495 | + $newphone .= '>'.$phone.'</a>'; |
|
| 2496 | 2496 | } else if (!empty(Globals::$conf->clicktodial->enabled) && $addlink == 'AC_TEL') { // If click to dial, we use click to dial url
|
| 2497 | 2497 | if (empty($user->clicktodial_loaded)) |
| 2498 | 2498 | $user->fetch_clicktodial(); |
@@ -2516,10 +2516,10 @@ discard block |
||
| 2516 | 2516 | '__PASS__' => $clicktodial_password); |
| 2517 | 2517 | $url = make_substitutions($url, $substitarray); |
| 2518 | 2518 | $newphonesav = $newphone; |
| 2519 | - $newphone = '<a href="' . $url . '"'; |
|
| 2519 | + $newphone = '<a href="'.$url.'"'; |
|
| 2520 | 2520 | if (!empty(Globals::$conf->global->CLICKTODIAL_FORCENEWTARGET)) |
| 2521 | 2521 | $newphone .= ' target="_blank"'; |
| 2522 | - $newphone .= '>' . $newphonesav . '</a>'; |
|
| 2522 | + $newphone .= '>'.$newphonesav.'</a>'; |
|
| 2523 | 2523 | } |
| 2524 | 2524 | |
| 2525 | 2525 | //if (($cid || $socid) && ! empty(Globals::$conf->agenda->enabled) && $user->rights->agenda->myactions->create) |
@@ -2529,9 +2529,9 @@ discard block |
||
| 2529 | 2529 | if ($addlink == 'AC_FAX') |
| 2530 | 2530 | $type = 'AC_FAX'; |
| 2531 | 2531 | if (!empty(Globals::$conf->global->AGENDA_ADDACTIONFORPHONE)) |
| 2532 | - $link = '<a href="' . DOL_BASE_URI . '/comm/action/card.php?action=create&backtopage=1&actioncode=' . $type . ($cid ? '&contactid=' . $cid : '') . ($socid ? '&socid=' . $socid : '') . '">' . img_object(Globals::$langs->trans("AddAction"), "calendar") . '</a>';
|
|
| 2532 | + $link = '<a href="'.DOL_BASE_URI.'/comm/action/card.php?action=create&backtopage=1&actioncode='.$type.($cid ? '&contactid='.$cid : '').($socid ? '&socid='.$socid : '').'">'.img_object(Globals::$langs->trans("AddAction"), "calendar").'</a>';
|
|
| 2533 | 2533 | if ($link) |
| 2534 | - $newphone = '<div>' . $newphone . ' ' . $link . '</div>'; |
|
| 2534 | + $newphone = '<div>'.$newphone.' '.$link.'</div>'; |
|
| 2535 | 2535 | } |
| 2536 | 2536 | } |
| 2537 | 2537 | |
@@ -2562,7 +2562,7 @@ discard block |
||
| 2562 | 2562 | $rep .= '<div class="nospan float" style="margin-right: 10px">'; |
| 2563 | 2563 | else |
| 2564 | 2564 | $rep .= '<span style="margin-right: 10px;">'; |
| 2565 | - $rep .= ($withpicto ? img_picto($titlealt, 'object_' . $picto . '.png') . ' ' : '') . $newphone; |
|
| 2565 | + $rep .= ($withpicto ? img_picto($titlealt, 'object_'.$picto.'.png').' ' : '').$newphone; |
|
| 2566 | 2566 | if ($adddivfloat) |
| 2567 | 2567 | $rep .= '</div>'; |
| 2568 | 2568 | else |
@@ -2589,15 +2589,15 @@ discard block |
||
| 2589 | 2589 | $ret .= $ip; |
| 2590 | 2590 | } |
| 2591 | 2591 | |
| 2592 | - echo ('<p>DOL_BASE_PATH: ' . DOL_BASE_PATH . '/DOL_BASE_URI: ' . DOL_BASE_URI . '</p>');
|
|
| 2592 | + echo ('<p>DOL_BASE_PATH: '.DOL_BASE_PATH.'/DOL_BASE_URI: '.DOL_BASE_URI.'</p>');
|
|
| 2593 | 2593 | |
| 2594 | 2594 | if ($mode != 2) {
|
| 2595 | 2595 | $countrycode = dolGetCountryCodeFromIp($ip); |
| 2596 | 2596 | if ($countrycode) { // If success, countrycode is us, fr, ...
|
| 2597 | - if (file_exists(DOL_BASE_PATH . '/theme/common/flags/' . $countrycode . '.png')) {
|
|
| 2598 | - $ret .= ' ' . img_picto($countrycode . ' ' . Globals::$langs->trans("AccordingToGeoIPDatabase"), DOL_BASE_URI . '/theme/common/flags/' . $countrycode . '.png', '', 1);
|
|
| 2597 | + if (file_exists(DOL_BASE_PATH.'/theme/common/flags/'.$countrycode.'.png')) {
|
|
| 2598 | + $ret .= ' '.img_picto($countrycode.' '.Globals::$langs->trans("AccordingToGeoIPDatabase"), DOL_BASE_URI.'/theme/common/flags/'.$countrycode.'.png', '', 1);
|
|
| 2599 | 2599 | } else |
| 2600 | - $ret .= ' (' . $countrycode . ')';
|
|
| 2600 | + $ret .= ' ('.$countrycode.')';
|
|
| 2601 | 2601 | } |
| 2602 | 2602 | } |
| 2603 | 2603 | |
@@ -2635,7 +2635,7 @@ discard block |
||
| 2635 | 2635 | //$ip='24.24.24.24'; |
| 2636 | 2636 | //$datafile='E:\Mes Sites\Web\Admin1\awstats\maxmind\GeoIP.dat'; Note that this must be downloaded datafile (not same than datafile provided with ubuntu packages) |
| 2637 | 2637 | |
| 2638 | - include_once DOL_BASE_PATH . '/core/class/dolgeoip.class.php'; |
|
| 2638 | + include_once DOL_BASE_PATH.'/core/class/dolgeoip.class.php'; |
|
| 2639 | 2639 | $geoip = new DolGeoIP('country', $datafile);
|
| 2640 | 2640 | //print 'ip='.$ip.' databaseType='.$geoip->gi->databaseType." GEOIP_CITY_EDITION_REV1=".GEOIP_CITY_EDITION_REV1."\n"; |
| 2641 | 2641 | //print "geoip_country_id_by_addr=".geoip_country_id_by_addr($geoip->gi,$ip)."\n"; |
@@ -2661,7 +2661,7 @@ discard block |
||
| 2661 | 2661 | $datafile = Globals::$conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE; |
| 2662 | 2662 | //$ip='24.24.24.24'; |
| 2663 | 2663 | //$datafile='E:\Mes Sites\Web\Admin1\awstats\maxmind\GeoIP.dat'; |
| 2664 | - include_once DOL_BASE_PATH . '/core/class/dolgeoip.class.php'; |
|
| 2664 | + include_once DOL_BASE_PATH.'/core/class/dolgeoip.class.php'; |
|
| 2665 | 2665 | $geoip = new DolGeoIP('country', $datafile);
|
| 2666 | 2666 | $countrycode = $geoip->getCountryCodeFromIP($ip); |
| 2667 | 2667 | $ret = $countrycode; |
@@ -2716,12 +2716,12 @@ discard block |
||
| 2716 | 2716 | $showomap = 1; |
| 2717 | 2717 | |
| 2718 | 2718 | if ($showgmap) {
|
| 2719 | - $url = dol_buildpath('/google/gmaps.php?mode=' . $mode . '&id=' . $id, 1);
|
|
| 2720 | - $out .= ' <a href="' . $url . '" target="_gmaps"><img id="' . $htmlid . '" class="valigntextbottom" src="' . DOL_BASE_URI . '/theme/common/gmap.png"></a>'; |
|
| 2719 | + $url = dol_buildpath('/google/gmaps.php?mode='.$mode.'&id='.$id, 1);
|
|
| 2720 | + $out .= ' <a href="'.$url.'" target="_gmaps"><img id="'.$htmlid.'" class="valigntextbottom" src="'.DOL_BASE_URI.'/theme/common/gmap.png"></a>'; |
|
| 2721 | 2721 | } |
| 2722 | 2722 | if ($showomap) {
|
| 2723 | - $url = dol_buildpath('/openstreetmap/maps.php?mode=' . $mode . '&id=' . $id, 1);
|
|
| 2724 | - $out .= ' <a href="' . $url . '" target="_gmaps"><img id="' . $htmlid . '_openstreetmap" class="valigntextbottom" src="' . DOL_BASE_URI . '/theme/common/gmap.png"></a>'; |
|
| 2723 | + $url = dol_buildpath('/openstreetmap/maps.php?mode='.$mode.'&id='.$id, 1);
|
|
| 2724 | + $out .= ' <a href="'.$url.'" target="_gmaps"><img id="'.$htmlid.'_openstreetmap" class="valigntextbottom" src="'.DOL_BASE_URI.'/theme/common/gmap.png"></a>'; |
|
| 2725 | 2725 | } |
| 2726 | 2726 | } |
| 2727 | 2727 | } |
@@ -2867,7 +2867,7 @@ discard block |
||
| 2867 | 2867 | if ($trunc == 'right') {
|
| 2868 | 2868 | $newstring = dol_textishtml($string) ? dol_string_nohtmltag($string, 1) : $string; |
| 2869 | 2869 | if (DolUtils::dol_strlen($newstring, $stringencoding) > ($size + ($nodot ? 0 : 3))) // If nodot is 0 and size is 1,2 or 3 chars more, we don't trunc and don't add ... |
| 2870 | - return dol_substr($newstring, 0, $size, $stringencoding) . ($nodot ? '' : '...'); |
|
| 2870 | + return dol_substr($newstring, 0, $size, $stringencoding).($nodot ? '' : '...'); |
|
| 2871 | 2871 | else |
| 2872 | 2872 | //return 'u'.$size.'-'.$newstring.'-'.DolUtils::dol_strlen($newstring,$stringencoding).'-'.$string; |
| 2873 | 2873 | return $string; |
@@ -2877,21 +2877,21 @@ discard block |
||
| 2877 | 2877 | if (DolUtils::dol_strlen($newstring, $stringencoding) > 2 && DolUtils::dol_strlen($newstring, $stringencoding) > ($size + 1)) {
|
| 2878 | 2878 | $size1 = round($size / 2); |
| 2879 | 2879 | $size2 = round($size / 2); |
| 2880 | - return dol_substr($newstring, 0, $size1, $stringencoding) . '...' . dol_substr($newstring, DolUtils::dol_strlen($newstring, $stringencoding) - $size2, $size2, $stringencoding); |
|
| 2880 | + return dol_substr($newstring, 0, $size1, $stringencoding).'...'.dol_substr($newstring, DolUtils::dol_strlen($newstring, $stringencoding) - $size2, $size2, $stringencoding); |
|
| 2881 | 2881 | } else |
| 2882 | 2882 | return $string; |
| 2883 | 2883 | } |
| 2884 | 2884 | elseif ($trunc == 'left') {
|
| 2885 | 2885 | $newstring = dol_textishtml($string) ? dol_string_nohtmltag($string, 1) : $string; |
| 2886 | 2886 | if (DolUtils::dol_strlen($newstring, $stringencoding) > ($size + ($nodot ? 0 : 3))) // If nodot is 0 and size is 1,2 or 3 chars more, we don't trunc and don't add ... |
| 2887 | - return '...' . dol_substr($newstring, DolUtils::dol_strlen($newstring, $stringencoding) - $size, $size, $stringencoding); |
|
| 2887 | + return '...'.dol_substr($newstring, DolUtils::dol_strlen($newstring, $stringencoding) - $size, $size, $stringencoding); |
|
| 2888 | 2888 | else |
| 2889 | 2889 | return $string; |
| 2890 | 2890 | } |
| 2891 | 2891 | elseif ($trunc == 'wrap') {
|
| 2892 | 2892 | $newstring = dol_textishtml($string) ? dol_string_nohtmltag($string, 1) : $string; |
| 2893 | 2893 | if (DolUtils::dol_strlen($newstring, $stringencoding) > ($size + 1)) |
| 2894 | - return dol_substr($newstring, 0, $size, $stringencoding) . "\n" . dol_trunc(dol_substr($newstring, $size, DolUtils::dol_strlen($newstring, $stringencoding) - $size, $stringencoding), $size, $trunc); |
|
| 2894 | + return dol_substr($newstring, 0, $size, $stringencoding)."\n".dol_trunc(dol_substr($newstring, $size, DolUtils::dol_strlen($newstring, $stringencoding) - $size, $stringencoding), $size, $trunc); |
|
| 2895 | 2895 | else |
| 2896 | 2896 | return $string; |
| 2897 | 2897 | } else |
@@ -2924,7 +2924,7 @@ discard block |
||
| 2924 | 2924 | $url = DOL_BASE_URI; |
| 2925 | 2925 | |
| 2926 | 2926 | $theme = Globals::$conf->theme; |
| 2927 | - $path = 'theme/' . $theme; |
|
| 2927 | + $path = 'theme/'.$theme; |
|
| 2928 | 2928 | |
| 2929 | 2929 | // Define fullpathpicto to use into src |
| 2930 | 2930 | if ($pictoisfullpath) {
|
@@ -2973,7 +2973,7 @@ discard block |
||
| 2973 | 2973 | $fakey = 'fa-pencil'; |
| 2974 | 2974 | $facolor = '#444'; |
| 2975 | 2975 | } elseif ($pictowithoutext == 'filter') {
|
| 2976 | - $fakey = 'fa-' . $pictowithoutext; |
|
| 2976 | + $fakey = 'fa-'.$pictowithoutext; |
|
| 2977 | 2977 | } elseif ($pictowithoutext == 'grip_title' || $pictowithoutext == 'grip') {
|
| 2978 | 2978 | $fakey = 'fa-arrows'; |
| 2979 | 2979 | } elseif ($pictowithoutext == 'listlight') {
|
@@ -3012,15 +3012,15 @@ discard block |
||
| 3012 | 3012 | } elseif ($pictowithoutext == 'jabber') {
|
| 3013 | 3013 | $fakey = 'fa-comment-o'; |
| 3014 | 3014 | } else {
|
| 3015 | - $fakey = 'fa-' . $pictowithoutext; |
|
| 3015 | + $fakey = 'fa-'.$pictowithoutext; |
|
| 3016 | 3016 | $facolor = '#444'; |
| 3017 | 3017 | $marginleftonlyshort = 0; |
| 3018 | 3018 | } |
| 3019 | 3019 | |
| 3020 | 3020 | if (preg_match('/class="([^"]+)"/', $moreatt, $reg)) {
|
| 3021 | - $morecss .= ($morecss ? ' ' : '') . $reg[1]; |
|
| 3021 | + $morecss .= ($morecss ? ' ' : '').$reg[1]; |
|
| 3022 | 3022 | } |
| 3023 | - $enabledisablehtml = '<span class="fa ' . $fakey . ' ' . ($marginleftonlyshort ? ($marginleftonlyshort == 1 ? 'marginleftonlyshort' : 'marginleftonly') : '') . ' valignmiddle' . ($morecss ? ' ' . $morecss : '') . '" style="' . ($fasize ? ('font-size: ' . $fasize . ';') : '') . ($facolor ? (' color: ' . $facolor . ';') : '') . '" alt="' . dol_escape_htmltag($titlealt) . '"' . (($notitle || empty($title)) ? '' : ' title="' . dol_escape_htmltag($title) . '"') . ($moreatt ? ' ' . $moreatt : '') . '>';
|
|
| 3023 | + $enabledisablehtml = '<span class="fa '.$fakey.' '.($marginleftonlyshort ? ($marginleftonlyshort == 1 ? 'marginleftonlyshort' : 'marginleftonly') : '').' valignmiddle'.($morecss ? ' '.$morecss : '').'" style="'.($fasize ? ('font-size: '.$fasize.';') : '').($facolor ? (' color: '.$facolor.';') : '').'" alt="'.dol_escape_htmltag($titlealt).'"'.(($notitle || empty($title)) ? '' : ' title="'.dol_escape_htmltag($title).'"').($moreatt ? ' '.$moreatt : '').'>';
|
|
| 3024 | 3024 | if (!empty(Globals::$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
| 3025 | 3025 | $enabledisablehtml .= $titlealt; |
| 3026 | 3026 | } |
@@ -3030,11 +3030,11 @@ discard block |
||
| 3030 | 3030 | } |
| 3031 | 3031 | |
| 3032 | 3032 | if (!empty(Globals::$conf->global->MAIN_OVERWRITE_THEME_PATH)) {
|
| 3033 | - $path = Globals::$conf->global->MAIN_OVERWRITE_THEME_PATH . '/theme/' . $theme; // If the theme does not have the same name as the module |
|
| 3033 | + $path = Globals::$conf->global->MAIN_OVERWRITE_THEME_PATH.'/theme/'.$theme; // If the theme does not have the same name as the module |
|
| 3034 | 3034 | } else if (!empty(Globals::$conf->global->MAIN_OVERWRITE_THEME_RES)) {
|
| 3035 | - $path = Globals::$conf->global->MAIN_OVERWRITE_THEME_RES . '/theme/' . Globals::$conf->global->MAIN_OVERWRITE_THEME_RES; // To allow an external module to overwrite image resources whatever is activated theme |
|
| 3035 | + $path = Globals::$conf->global->MAIN_OVERWRITE_THEME_RES.'/theme/'.Globals::$conf->global->MAIN_OVERWRITE_THEME_RES; // To allow an external module to overwrite image resources whatever is activated theme |
|
| 3036 | 3036 | } else if (!empty(Globals::$conf->modules_parts['theme']) && array_key_exists($theme, Globals::$conf->modules_parts['theme'])) {
|
| 3037 | - $path = $theme . '/theme/' . $theme; // If the theme have the same name as the module |
|
| 3037 | + $path = $theme.'/theme/'.$theme; // If the theme have the same name as the module |
|
| 3038 | 3038 | } |
| 3039 | 3039 | |
| 3040 | 3040 | // If we ask an image into $url/$mymodule/img (instead of default path) |
@@ -3054,15 +3054,15 @@ discard block |
||
| 3054 | 3054 | continue; |
| 3055 | 3055 | } |
| 3056 | 3056 | // This need a lot of time, that's why enabling alternative dir like "custom" dir is not recommanded |
| 3057 | - if (file_exists($dirroot . '/' . $path . '/img/' . $picto)) {
|
|
| 3057 | + if (file_exists($dirroot.'/'.$path.'/img/'.$picto)) {
|
|
| 3058 | 3058 | //$url = DOL_BASE_URI . Globals::$conf->file->dol_url_root[$type]; |
| 3059 | - $url = DOL_BASE_URI . Globals::$conf->file->dol_url_root[$type]; |
|
| 3059 | + $url = DOL_BASE_URI.Globals::$conf->file->dol_url_root[$type]; |
|
| 3060 | 3060 | break; |
| 3061 | 3061 | } |
| 3062 | 3062 | } |
| 3063 | 3063 | |
| 3064 | 3064 | // $url is '' or '/custom', $path is current theme or |
| 3065 | - $fullpathpicto = $url . '/' . $path . '/img/' . $picto; |
|
| 3065 | + $fullpathpicto = $url.'/'.$path.'/img/'.$picto; |
|
| 3066 | 3066 | } |
| 3067 | 3067 | |
| 3068 | 3068 | if ($srconly) {
|
@@ -3070,7 +3070,7 @@ discard block |
||
| 3070 | 3070 | } |
| 3071 | 3071 | |
| 3072 | 3072 | // tag title is used for tooltip on <a>, tag alt can be used with very simple text on image for bind people |
| 3073 | - return '<img src="' . $fullpathpicto . '" alt="' . dol_escape_htmltag($alt) . '"' . (($notitle || empty($titlealt)) ? '' : ' title="' . dol_escape_htmltag($titlealt) . '"') . ($moreatt ? ' ' . $moreatt : ' class="inline-block' . ($morecss ? ' ' . $morecss : '') . '"') . '>'; // Alt is used for accessibility, title for popup |
|
| 3073 | + return '<img src="'.$fullpathpicto.'" alt="'.dol_escape_htmltag($alt).'"'.(($notitle || empty($titlealt)) ? '' : ' title="'.dol_escape_htmltag($titlealt).'"').($moreatt ? ' '.$moreatt : ' class="inline-block'.($morecss ? ' '.$morecss : '').'"').'>'; // Alt is used for accessibility, title for popup |
|
| 3074 | 3074 | } |
| 3075 | 3075 | |
| 3076 | 3076 | /** |
@@ -3088,7 +3088,7 @@ discard block |
||
| 3088 | 3088 | */ |
| 3089 | 3089 | static function img_object($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $srconly = 0, $notitle = 0) |
| 3090 | 3090 | {
|
| 3091 | - return img_picto($titlealt, 'object_' . $picto, $moreatt, $pictoisfullpath, $srconly, $notitle); |
|
| 3091 | + return img_picto($titlealt, 'object_'.$picto, $moreatt, $pictoisfullpath, $srconly, $notitle); |
|
| 3092 | 3092 | } |
| 3093 | 3093 | |
| 3094 | 3094 | /** |
@@ -3109,7 +3109,7 @@ discard block |
||
| 3109 | 3109 | $picto .= '.png'; |
| 3110 | 3110 | |
| 3111 | 3111 | //$path = DOL_BASE_URI . '/theme/' . Globals::$conf->theme . '/img/weather/' . $picto; |
| 3112 | - $path = DOL_BASE_URI . '/theme/' . Globals::$conf->theme . '/img/weather/' . $picto; |
|
| 3112 | + $path = DOL_BASE_URI.'/theme/'.Globals::$conf->theme.'/img/weather/'.$picto; |
|
| 3113 | 3113 | |
| 3114 | 3114 | return img_picto($titlealt, $path, $moreatt, 1); |
| 3115 | 3115 | } |
@@ -3135,10 +3135,10 @@ discard block |
||
| 3135 | 3135 | $path = $picto; |
| 3136 | 3136 | else {
|
| 3137 | 3137 | //$path = DOL_BASE_URI . '/theme/common/' . $picto; |
| 3138 | - $path = DOL_BASE_URI . '/theme/common/' . $picto; |
|
| 3138 | + $path = DOL_BASE_URI.'/theme/common/'.$picto; |
|
| 3139 | 3139 | |
| 3140 | 3140 | if (!empty(Globals::$conf->global->MAIN_MODULE_CAN_OVERWRITE_COMMONICONS)) {
|
| 3141 | - $themepath = DOL_BASE_PATH . 'theme/' . Globals::$conf->theme . '/img/' . $picto; |
|
| 3141 | + $themepath = DOL_BASE_PATH.'theme/'.Globals::$conf->theme.'/img/'.$picto; |
|
| 3142 | 3142 | |
| 3143 | 3143 | if (file_exists($themepath)) |
| 3144 | 3144 | $path = $themepath; |
@@ -3176,14 +3176,14 @@ discard block |
||
| 3176 | 3176 | $numaction = 3; |
| 3177 | 3177 | $titlealt = Globals::$langs->transnoentitiesnoconv('ChangeContactDone');
|
| 3178 | 3178 | } else {
|
| 3179 | - $titlealt = Globals::$langs->transnoentitiesnoconv('ChangeStatus ' . $numaction);
|
|
| 3179 | + $titlealt = Globals::$langs->transnoentitiesnoconv('ChangeStatus '.$numaction);
|
|
| 3180 | 3180 | $numaction = 0; |
| 3181 | 3181 | } |
| 3182 | 3182 | } |
| 3183 | 3183 | if (!is_numeric($numaction)) |
| 3184 | 3184 | $numaction = 0; |
| 3185 | 3185 | |
| 3186 | - return img_picto($titlealt, 'stcomm' . $numaction . '.png'); |
|
| 3186 | + return img_picto($titlealt, 'stcomm'.$numaction.'.png'); |
|
| 3187 | 3187 | } |
| 3188 | 3188 | |
| 3189 | 3189 | /** |
@@ -3200,7 +3200,7 @@ discard block |
||
| 3200 | 3200 | if ($titlealt == 'default') |
| 3201 | 3201 | $titlealt = Globals::$langs->trans('Show');
|
| 3202 | 3202 | |
| 3203 | - return img_picto($titlealt, 'pdf' . $size . '.png'); |
|
| 3203 | + return img_picto($titlealt, 'pdf'.$size.'.png'); |
|
| 3204 | 3204 | } |
| 3205 | 3205 | |
| 3206 | 3206 | /** |
@@ -3252,7 +3252,7 @@ discard block |
||
| 3252 | 3252 | if ($titlealt == 'default') |
| 3253 | 3253 | $titlealt = Globals::$langs->trans('Modify');
|
| 3254 | 3254 | |
| 3255 | - return img_picto($titlealt, 'edit.png', ($float ? 'style="float: ' . (Globals::$langs->tab_translate["DIRECTION"] == 'rtl' ? 'left' : 'right') . '"' : "") . ($other ? ' ' . $other : '')); |
|
| 3255 | + return img_picto($titlealt, 'edit.png', ($float ? 'style="float: '.(Globals::$langs->tab_translate["DIRECTION"] == 'rtl' ? 'left' : 'right').'"' : "").($other ? ' '.$other : '')); |
|
| 3256 | 3256 | } |
| 3257 | 3257 | |
| 3258 | 3258 | /** |
@@ -3270,7 +3270,7 @@ discard block |
||
| 3270 | 3270 | if ($titlealt == 'default') |
| 3271 | 3271 | $titlealt = Globals::$langs->trans('View');
|
| 3272 | 3272 | |
| 3273 | - $moreatt = ($float ? 'style="float: right" ' : '') . $other; |
|
| 3273 | + $moreatt = ($float ? 'style="float: right" ' : '').$other; |
|
| 3274 | 3274 | |
| 3275 | 3275 | return img_picto($titlealt, 'view.png', $moreatt); |
| 3276 | 3276 | } |
@@ -3343,7 +3343,7 @@ discard block |
||
| 3343 | 3343 | $usealttitle = Globals::$langs->trans('Info');
|
| 3344 | 3344 | } |
| 3345 | 3345 | |
| 3346 | - return img_picto($usealttitle, 'info.png', 'style="vertical-align: middle;' . ($usehelpcursor == 1 ? ' cursor: help' : ($usehelpcursor == 2 ? ' cursor: pointer' : '')) . '"'); |
|
| 3346 | + return img_picto($usealttitle, 'info.png', 'style="vertical-align: middle;'.($usehelpcursor == 1 ? ' cursor: help' : ($usehelpcursor == 2 ? ' cursor: pointer' : '')).'"'); |
|
| 3347 | 3347 | } |
| 3348 | 3348 | |
| 3349 | 3349 | /** |
@@ -3377,7 +3377,7 @@ discard block |
||
| 3377 | 3377 | $titlealt = Globals::$langs->trans('Warning');
|
| 3378 | 3378 | |
| 3379 | 3379 | //return '<div class="imglatecoin">'.img_picto($titlealt, 'warning_white.png', 'class="pictowarning valignmiddle"'.($moreatt ? ($moreatt == '1' ? ' style="float: right"' : ' '.$moreatt): '')).'</div>'; |
| 3380 | - return img_picto($titlealt, 'warning.png', 'class="pictowarning valignmiddle"' . ($moreatt ? ($moreatt == '1' ? ' style="float: right"' : ' ' . $moreatt) : '')); |
|
| 3380 | + return img_picto($titlealt, 'warning.png', 'class="pictowarning valignmiddle"'.($moreatt ? ($moreatt == '1' ? ' style="float: right"' : ' '.$moreatt) : '')); |
|
| 3381 | 3381 | } |
| 3382 | 3382 | |
| 3383 | 3383 | /** |
@@ -3411,7 +3411,7 @@ discard block |
||
| 3411 | 3411 | $titlealt = Globals::$langs->trans('Next');
|
| 3412 | 3412 | |
| 3413 | 3413 | //return img_picto($titlealt, 'next.png', $moreatt); |
| 3414 | - return '<span class="fa fa-chevron-right paddingright paddingleft" title="' . dol_escape_htmltag($titlealt) . '"></span>'; |
|
| 3414 | + return '<span class="fa fa-chevron-right paddingright paddingleft" title="'.dol_escape_htmltag($titlealt).'"></span>'; |
|
| 3415 | 3415 | } |
| 3416 | 3416 | |
| 3417 | 3417 | /** |
@@ -3429,7 +3429,7 @@ discard block |
||
| 3429 | 3429 | $titlealt = Globals::$langs->trans('Previous');
|
| 3430 | 3430 | |
| 3431 | 3431 | //return img_picto($titlealt, 'previous.png', $moreatt); |
| 3432 | - return '<span class="fa fa-chevron-left paddingright paddingleft" title="' . dol_escape_htmltag($titlealt) . '"></span>'; |
|
| 3432 | + return '<span class="fa fa-chevron-left paddingright paddingleft" title="'.dol_escape_htmltag($titlealt).'"></span>'; |
|
| 3433 | 3433 | } |
| 3434 | 3434 | |
| 3435 | 3435 | /** |
@@ -3447,7 +3447,7 @@ discard block |
||
| 3447 | 3447 | if ($titlealt == 'default') |
| 3448 | 3448 | $titlealt = Globals::$langs->trans('Down');
|
| 3449 | 3449 | |
| 3450 | - return img_picto($titlealt, ($selected ? '1downarrow_selected.png' : '1downarrow.png'), 'class="imgdown' . ($moreclass ? " " . $moreclass : "") . '"'); |
|
| 3450 | + return img_picto($titlealt, ($selected ? '1downarrow_selected.png' : '1downarrow.png'), 'class="imgdown'.($moreclass ? " ".$moreclass : "").'"'); |
|
| 3451 | 3451 | } |
| 3452 | 3452 | |
| 3453 | 3453 | /** |
@@ -3465,7 +3465,7 @@ discard block |
||
| 3465 | 3465 | if ($titlealt == 'default') |
| 3466 | 3466 | $titlealt = Globals::$langs->trans('Up');
|
| 3467 | 3467 | |
| 3468 | - return img_picto($titlealt, ($selected ? '1uparrow_selected.png' : '1uparrow.png'), 'class="imgup' . ($moreclass ? " " . $moreclass : "") . '"'); |
|
| 3468 | + return img_picto($titlealt, ($selected ? '1uparrow_selected.png' : '1uparrow.png'), 'class="imgup'.($moreclass ? " ".$moreclass : "").'"'); |
|
| 3469 | 3469 | } |
| 3470 | 3470 | |
| 3471 | 3471 | /** |
@@ -3548,7 +3548,7 @@ discard block |
||
| 3548 | 3548 | $brand = 'credit-card'; |
| 3549 | 3549 | } |
| 3550 | 3550 | |
| 3551 | - return '<span class="fa fa-' . $brand . ' fa-2x fa-fw"></span>'; |
|
| 3551 | + return '<span class="fa fa-'.$brand.' fa-2x fa-fw"></span>'; |
|
| 3552 | 3552 | } |
| 3553 | 3553 | |
| 3554 | 3554 | /** |
@@ -3561,17 +3561,17 @@ discard block |
||
| 3561 | 3561 | */ |
| 3562 | 3562 | static function img_mime($file, $titlealt = '', $morecss = '') |
| 3563 | 3563 | {
|
| 3564 | - require_once DOL_BASE_PATH . '/core/lib/files.lib.php'; |
|
| 3564 | + require_once DOL_BASE_PATH.'/core/lib/files.lib.php'; |
|
| 3565 | 3565 | |
| 3566 | 3566 | $mimetype = dol_mimetype($file, '', 1); |
| 3567 | 3567 | $mimeimg = dol_mimetype($file, '', 2); |
| 3568 | 3568 | $mimefa = dol_mimetype($file, '', 4); |
| 3569 | 3569 | |
| 3570 | 3570 | if (empty($titlealt)) |
| 3571 | - $titlealt = 'Mime type: ' . $mimetype; |
|
| 3571 | + $titlealt = 'Mime type: '.$mimetype; |
|
| 3572 | 3572 | |
| 3573 | 3573 | //return img_picto_common($titlealt, 'mime/'.$mimeimg, 'class="'.$morecss.'"'); |
| 3574 | - return '<i class="fa fa-' . $mimefa . ' paddingright"></i>'; |
|
| 3574 | + return '<i class="fa fa-'.$mimefa.' paddingright"></i>'; |
|
| 3575 | 3575 | } |
| 3576 | 3576 | |
| 3577 | 3577 | /** |
@@ -3586,7 +3586,7 @@ discard block |
||
| 3586 | 3586 | */ |
| 3587 | 3587 | static function img_phone($titlealt = 'default', $option = 0) |
| 3588 | 3588 | {
|
| 3589 | - DolUtils::dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); |
|
| 3589 | + DolUtils::dol_syslog(__FUNCTION__." is deprecated", LOG_WARNING); |
|
| 3590 | 3590 | |
| 3591 | 3591 | // global Globals::$conf, Globals::$langs; |
| 3592 | 3592 | |
@@ -3617,8 +3617,8 @@ discard block |
||
| 3617 | 3617 | |
| 3618 | 3618 | $img = img_picto($titlealt, 'search.png', $other, false, 1); |
| 3619 | 3619 | |
| 3620 | - $input = '<input type="image" class="liste_titre" name="button_search" src="' . $img . '" '; |
|
| 3621 | - $input .= 'value="' . dol_escape_htmltag($titlealt) . '" title="' . dol_escape_htmltag($titlealt) . '" >'; |
|
| 3620 | + $input = '<input type="image" class="liste_titre" name="button_search" src="'.$img.'" '; |
|
| 3621 | + $input .= 'value="'.dol_escape_htmltag($titlealt).'" title="'.dol_escape_htmltag($titlealt).'" >'; |
|
| 3622 | 3622 | |
| 3623 | 3623 | return $input; |
| 3624 | 3624 | } |
@@ -3639,8 +3639,8 @@ discard block |
||
| 3639 | 3639 | |
| 3640 | 3640 | $img = img_picto($titlealt, 'searchclear.png', $other, false, 1); |
| 3641 | 3641 | |
| 3642 | - $input = '<input type="image" class="liste_titre" name="button_removefilter" src="' . $img . '" '; |
|
| 3643 | - $input .= 'value="' . dol_escape_htmltag($titlealt) . '" title="' . dol_escape_htmltag($titlealt) . '" >'; |
|
| 3642 | + $input = '<input type="image" class="liste_titre" name="button_removefilter" src="'.$img.'" '; |
|
| 3643 | + $input .= 'value="'.dol_escape_htmltag($titlealt).'" title="'.dol_escape_htmltag($titlealt).'" >'; |
|
| 3644 | 3644 | |
| 3645 | 3645 | return $input; |
| 3646 | 3646 | } |
@@ -3660,10 +3660,10 @@ discard block |
||
| 3660 | 3660 | // global Globals::$conf, Globals::$langs; |
| 3661 | 3661 | |
| 3662 | 3662 | if ($infoonimgalt) {
|
| 3663 | - return img_picto($text, 'info', 'class="hideonsmartphone' . ($morecss ? ' ' . $morecss : '') . '"'); |
|
| 3663 | + return img_picto($text, 'info', 'class="hideonsmartphone'.($morecss ? ' '.$morecss : '').'"'); |
|
| 3664 | 3664 | } |
| 3665 | 3665 | |
| 3666 | - return ($nodiv ? '' : '<div class="' . (empty($admin) ? '' : ($admin == '1' ? 'info' : $admin)) . ' hideonsmartphone' . ($morecss ? ' ' . $morecss : '') . '">') . '<span class="fa fa-info-circle" title="' . dol_escape_htmltag($admin ? Globals::$langs->trans('InfoAdmin') : Globals::$langs->trans('Note')) . '"></span> ' . $text . ($nodiv ? '' : '</div>');
|
|
| 3666 | + return ($nodiv ? '' : '<div class="'.(empty($admin) ? '' : ($admin == '1' ? 'info' : $admin)).' hideonsmartphone'.($morecss ? ' '.$morecss : '').'">').'<span class="fa fa-info-circle" title="'.dol_escape_htmltag($admin ? Globals::$langs->trans('InfoAdmin') : Globals::$langs->trans('Note')).'"></span> '.$text.($nodiv ? '' : '</div>');
|
|
| 3667 | 3667 | } |
| 3668 | 3668 | |
| 3669 | 3669 | /** |
@@ -3688,7 +3688,7 @@ discard block |
||
| 3688 | 3688 | |
| 3689 | 3689 | // Si erreur intervenue avant chargement langue |
| 3690 | 3690 | if (!Globals::$langs) {
|
| 3691 | - require_once DOL_BASE_PATH . '/core/class/translate.class.php'; |
|
| 3691 | + require_once DOL_BASE_PATH.'/core/class/translate.class.php'; |
|
| 3692 | 3692 | Globals::$langs = new Translate('', Globals::$conf);
|
| 3693 | 3693 | Globals::$langs->load("main");
|
| 3694 | 3694 | } |
@@ -3696,51 +3696,51 @@ discard block |
||
| 3696 | 3696 | Globals::$langs->loadLangs(array('main', 'errors'));
|
| 3697 | 3697 | |
| 3698 | 3698 | if ($_SERVER['DOCUMENT_ROOT']) { // Mode web
|
| 3699 | - $out .= Globals::$langs->trans("DolibarrHasDetectedError") . ".<br>\n";
|
|
| 3699 | + $out .= Globals::$langs->trans("DolibarrHasDetectedError").".<br>\n";
|
|
| 3700 | 3700 | if (!empty(Globals::$conf->global->MAIN_FEATURES_LEVEL)) |
| 3701 | 3701 | $out .= "You use an experimental or develop level of features, so please do NOT report any bugs, except if problem is confirmed moving option MAIN_FEATURES_LEVEL back to 0.<br>\n"; |
| 3702 | - $out .= Globals::$langs->trans("InformationToHelpDiagnose") . ":<br>\n";
|
|
| 3702 | + $out .= Globals::$langs->trans("InformationToHelpDiagnose").":<br>\n";
|
|
| 3703 | 3703 | |
| 3704 | - $out .= "<b>" . Globals::$langs->trans("Date") . ":</b> " . dol_print_date(time(), 'dayhourlog') . "<br>\n";
|
|
| 3705 | - $out .= "<b>" . Globals::$langs->trans("Dolibarr") . ":</b> " . DOL_VERSION . "<br>\n";
|
|
| 3704 | + $out .= "<b>".Globals::$langs->trans("Date").":</b> ".dol_print_date(time(), 'dayhourlog')."<br>\n";
|
|
| 3705 | + $out .= "<b>".Globals::$langs->trans("Dolibarr").":</b> ".DOL_VERSION."<br>\n";
|
|
| 3706 | 3706 | if (isset(Globals::$conf->global->MAIN_FEATURES_LEVEL)) |
| 3707 | - $out .= "<b>" . Globals::$langs->trans("LevelOfFeature") . ":</b> " . Globals::$conf->global->MAIN_FEATURES_LEVEL . "<br>\n";
|
|
| 3707 | + $out .= "<b>".Globals::$langs->trans("LevelOfFeature").":</b> ".Globals::$conf->global->MAIN_FEATURES_LEVEL."<br>\n";
|
|
| 3708 | 3708 | if (function_exists("phpversion")) {
|
| 3709 | - $out .= "<b>" . Globals::$langs->trans("PHP") . ":</b> " . phpversion() . "<br>\n";
|
|
| 3709 | + $out .= "<b>".Globals::$langs->trans("PHP").":</b> ".phpversion()."<br>\n";
|
|
| 3710 | 3710 | } |
| 3711 | - $out .= "<b>" . Globals::$langs->trans("Server") . ":</b> " . $_SERVER["SERVER_SOFTWARE"] . "<br>\n";
|
|
| 3711 | + $out .= "<b>".Globals::$langs->trans("Server").":</b> ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";
|
|
| 3712 | 3712 | if (function_exists("php_uname")) {
|
| 3713 | - $out .= "<b>" . Globals::$langs->trans("OS") . ":</b> " . php_uname() . "<br>\n";
|
|
| 3713 | + $out .= "<b>".Globals::$langs->trans("OS").":</b> ".php_uname()."<br>\n";
|
|
| 3714 | 3714 | } |
| 3715 | - $out .= "<b>" . Globals::$langs->trans("UserAgent") . ":</b> " . $_SERVER["HTTP_USER_AGENT"] . "<br>\n";
|
|
| 3715 | + $out .= "<b>".Globals::$langs->trans("UserAgent").":</b> ".$_SERVER["HTTP_USER_AGENT"]."<br>\n";
|
|
| 3716 | 3716 | $out .= "<br>\n"; |
| 3717 | - $out .= "<b>" . Globals::$langs->trans("RequestedUrl") . ":</b> " . dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT, 'UTF-8') . "<br>\n";
|
|
| 3718 | - $out .= "<b>" . Globals::$langs->trans("Referer") . ":</b> " . (isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT, 'UTF-8') : '') . "<br>\n";
|
|
| 3719 | - $out .= "<b>" . Globals::$langs->trans("MenuManager") . ":</b> " . (isset(Globals::$conf->standard_menu) ? Globals::$conf->standard_menu : '') . "<br>\n";
|
|
| 3717 | + $out .= "<b>".Globals::$langs->trans("RequestedUrl").":</b> ".dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT, 'UTF-8')."<br>\n";
|
|
| 3718 | + $out .= "<b>".Globals::$langs->trans("Referer").":</b> ".(isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT, 'UTF-8') : '')."<br>\n";
|
|
| 3719 | + $out .= "<b>".Globals::$langs->trans("MenuManager").":</b> ".(isset(Globals::$conf->standard_menu) ? Globals::$conf->standard_menu : '')."<br>\n";
|
|
| 3720 | 3720 | $out .= "<br>\n"; |
| 3721 | - $syslog .= "url=" . dol_escape_htmltag($_SERVER["REQUEST_URI"]); |
|
| 3722 | - $syslog .= ", query_string=" . dol_escape_htmltag($_SERVER["QUERY_STRING"]); |
|
| 3721 | + $syslog .= "url=".dol_escape_htmltag($_SERVER["REQUEST_URI"]); |
|
| 3722 | + $syslog .= ", query_string=".dol_escape_htmltag($_SERVER["QUERY_STRING"]); |
|
| 3723 | 3723 | } else { // Mode CLI
|
| 3724 | - $out .= '> ' . Globals::$langs->transnoentities("ErrorInternalErrorDetected") . ":\n" . $argv[0] . "\n";
|
|
| 3725 | - $syslog .= "pid=" . dol_getmypid(); |
|
| 3724 | + $out .= '> '.Globals::$langs->transnoentities("ErrorInternalErrorDetected").":\n".$argv[0]."\n";
|
|
| 3725 | + $syslog .= "pid=".dol_getmypid(); |
|
| 3726 | 3726 | } |
| 3727 | 3727 | |
| 3728 | 3728 | if (is_object($db)) {
|
| 3729 | 3729 | if ($_SERVER['DOCUMENT_ROOT']) { // Mode web
|
| 3730 | - $out .= "<b>" . Globals::$langs->trans("DatabaseTypeManager") . ":</b> " . $db->type . "<br>\n";
|
|
| 3731 | - $out .= "<b>" . Globals::$langs->trans("RequestLastAccessInError") . ":</b> " . ($db->lastqueryerror() ? dol_escape_htmltag($db->lastqueryerror()) : Globals::$langs->trans("ErrorNoRequestInError")) . "<br>\n";
|
|
| 3732 | - $out .= "<b>" . Globals::$langs->trans("ReturnCodeLastAccessInError") . ":</b> " . ($db->lasterrno() ? dol_escape_htmltag($db->lasterrno()) : Globals::$langs->trans("ErrorNoRequestInError")) . "<br>\n";
|
|
| 3733 | - $out .= "<b>" . Globals::$langs->trans("InformationLastAccessInError") . ":</b> " . ($db->lasterror() ? dol_escape_htmltag($db->lasterror()) : Globals::$langs->trans("ErrorNoRequestInError")) . "<br>\n";
|
|
| 3730 | + $out .= "<b>".Globals::$langs->trans("DatabaseTypeManager").":</b> ".$db->type."<br>\n";
|
|
| 3731 | + $out .= "<b>".Globals::$langs->trans("RequestLastAccessInError").":</b> ".($db->lastqueryerror() ? dol_escape_htmltag($db->lastqueryerror()) : Globals::$langs->trans("ErrorNoRequestInError"))."<br>\n";
|
|
| 3732 | + $out .= "<b>".Globals::$langs->trans("ReturnCodeLastAccessInError").":</b> ".($db->lasterrno() ? dol_escape_htmltag($db->lasterrno()) : Globals::$langs->trans("ErrorNoRequestInError"))."<br>\n";
|
|
| 3733 | + $out .= "<b>".Globals::$langs->trans("InformationLastAccessInError").":</b> ".($db->lasterror() ? dol_escape_htmltag($db->lasterror()) : Globals::$langs->trans("ErrorNoRequestInError"))."<br>\n";
|
|
| 3734 | 3734 | $out .= "<br>\n"; |
| 3735 | 3735 | } else { // Mode CLI
|
| 3736 | 3736 | // No dol_escape_htmltag for output, we are in CLI mode |
| 3737 | - $out .= '> ' . Globals::$langs->transnoentities("DatabaseTypeManager") . ":\n" . $db->type . "\n";
|
|
| 3738 | - $out .= '> ' . Globals::$langs->transnoentities("RequestLastAccessInError") . ":\n" . ($db->lastqueryerror() ? $db->lastqueryerror() : Globals::$langs->transnoentities("ErrorNoRequestInError")) . "\n";
|
|
| 3739 | - $out .= '> ' . Globals::$langs->transnoentities("ReturnCodeLastAccessInError") . ":\n" . ($db->lasterrno() ? $db->lasterrno() : Globals::$langs->transnoentities("ErrorNoRequestInError")) . "\n";
|
|
| 3740 | - $out .= '> ' . Globals::$langs->transnoentities("InformationLastAccessInError") . ":\n" . ($db->lasterror() ? $db->lasterror() : Globals::$langs->transnoentities("ErrorNoRequestInError")) . "\n";
|
|
| 3737 | + $out .= '> '.Globals::$langs->transnoentities("DatabaseTypeManager").":\n".$db->type."\n";
|
|
| 3738 | + $out .= '> '.Globals::$langs->transnoentities("RequestLastAccessInError").":\n".($db->lastqueryerror() ? $db->lastqueryerror() : Globals::$langs->transnoentities("ErrorNoRequestInError"))."\n";
|
|
| 3739 | + $out .= '> '.Globals::$langs->transnoentities("ReturnCodeLastAccessInError").":\n".($db->lasterrno() ? $db->lasterrno() : Globals::$langs->transnoentities("ErrorNoRequestInError"))."\n";
|
|
| 3740 | + $out .= '> '.Globals::$langs->transnoentities("InformationLastAccessInError").":\n".($db->lasterror() ? $db->lasterror() : Globals::$langs->transnoentities("ErrorNoRequestInError"))."\n";
|
|
| 3741 | 3741 | } |
| 3742 | - $syslog .= ", sql=" . $db->lastquery(); |
|
| 3743 | - $syslog .= ", db_error=" . $db->lasterror(); |
|
| 3742 | + $syslog .= ", sql=".$db->lastquery(); |
|
| 3743 | + $syslog .= ", db_error=".$db->lasterror(); |
|
| 3744 | 3744 | } |
| 3745 | 3745 | |
| 3746 | 3746 | if ($error || $errors) {
|
@@ -3760,31 +3760,31 @@ discard block |
||
| 3760 | 3760 | if (empty($msg)) |
| 3761 | 3761 | continue; |
| 3762 | 3762 | if ($_SERVER['DOCUMENT_ROOT']) { // Mode web
|
| 3763 | - $out .= "<b>" . Globals::$langs->trans("Message") . ":</b> " . dol_escape_htmltag($msg) . "<br>\n";
|
|
| 3763 | + $out .= "<b>".Globals::$langs->trans("Message").":</b> ".dol_escape_htmltag($msg)."<br>\n";
|
|
| 3764 | 3764 | } else { // Mode CLI
|
| 3765 | - $out .= '> ' . Globals::$langs->transnoentities("Message") . ":\n" . $msg . "\n";
|
|
| 3765 | + $out .= '> '.Globals::$langs->transnoentities("Message").":\n".$msg."\n";
|
|
| 3766 | 3766 | } |
| 3767 | - $syslog .= ", msg=" . $msg; |
|
| 3767 | + $syslog .= ", msg=".$msg; |
|
| 3768 | 3768 | } |
| 3769 | 3769 | } |
| 3770 | 3770 | if (empty($dolibarr_main_prod) && $_SERVER['DOCUMENT_ROOT'] && function_exists('xdebug_print_function_stack') && function_exists('xdebug_call_file')) {
|
| 3771 | 3771 | xdebug_print_function_stack(); |
| 3772 | - $out .= '<b>XDebug informations:</b>' . "<br>\n"; |
|
| 3773 | - $out .= 'File: ' . xdebug_call_file() . "<br>\n"; |
|
| 3774 | - $out .= 'Line: ' . xdebug_call_line() . "<br>\n"; |
|
| 3775 | - $out .= 'Function: ' . xdebug_call_function() . "<br>\n"; |
|
| 3772 | + $out .= '<b>XDebug informations:</b>'."<br>\n"; |
|
| 3773 | + $out .= 'File: '.xdebug_call_file()."<br>\n"; |
|
| 3774 | + $out .= 'Line: '.xdebug_call_line()."<br>\n"; |
|
| 3775 | + $out .= 'Function: '.xdebug_call_function()."<br>\n"; |
|
| 3776 | 3776 | $out .= "<br>\n"; |
| 3777 | 3777 | } |
| 3778 | 3778 | |
| 3779 | 3779 | if (empty($dolibarr_main_prod)) |
| 3780 | 3780 | print $out; |
| 3781 | 3781 | else {
|
| 3782 | - print Globals::$langs->trans("DolibarrHasDetectedError") . '. ';
|
|
| 3782 | + print Globals::$langs->trans("DolibarrHasDetectedError").'. ';
|
|
| 3783 | 3783 | print Globals::$langs->trans("YouCanSetOptionDolibarrMainProdToZero");
|
| 3784 | 3784 | define("MAIN_CORE_ERROR", 1);
|
| 3785 | 3785 | } |
| 3786 | 3786 | //else print 'Sorry, an error occured but the parameter $dolibarr_main_prod is defined in conf file so no message is reported to your browser. Please read the log file for error message.'; |
| 3787 | - DolUtils::dol_syslog("Error " . $syslog, LOG_ERR);
|
|
| 3787 | + DolUtils::dol_syslog("Error ".$syslog, LOG_ERR);
|
|
| 3788 | 3788 | } |
| 3789 | 3789 | |
| 3790 | 3790 | /** |
@@ -3807,13 +3807,13 @@ discard block |
||
| 3807 | 3807 | Globals::$langs->load("errors");
|
| 3808 | 3808 | $now = dol_now(); |
| 3809 | 3809 | |
| 3810 | - print '<br><div class="center login_main_message"><div class="' . $morecss . '">'; |
|
| 3811 | - print Globals::$langs->trans("ErrorContactEMail", $email, $prefixcode . dol_print_date($now, '%Y%m%d'));
|
|
| 3810 | + print '<br><div class="center login_main_message"><div class="'.$morecss.'">'; |
|
| 3811 | + print Globals::$langs->trans("ErrorContactEMail", $email, $prefixcode.dol_print_date($now, '%Y%m%d'));
|
|
| 3812 | 3812 | if ($errormessage) |
| 3813 | - print '<br><br>' . $errormessage; |
|
| 3813 | + print '<br><br>'.$errormessage; |
|
| 3814 | 3814 | if (is_array($errormessages) && count($errormessages)) {
|
| 3815 | 3815 | foreach ($errormessages as $mesgtoshow) {
|
| 3816 | - print '<br><br>' . $mesgtoshow; |
|
| 3816 | + print '<br><br>'.$mesgtoshow; |
|
| 3817 | 3817 | } |
| 3818 | 3818 | } |
| 3819 | 3819 | print '</div></div>'; |
@@ -3871,16 +3871,16 @@ discard block |
||
| 3871 | 3871 | } |
| 3872 | 3872 | |
| 3873 | 3873 | $tmpsortfield = explode(',', $sortfield);
|
| 3874 | - $sortfield1 = trim($tmpsortfield[0]); // If $sortfield is 'd.datep,d.id', it becomes 'd.datep' |
|
| 3874 | + $sortfield1 = trim($tmpsortfield[0]); // If $sortfield is 'd.datep,d.id', it becomes 'd.datep' |
|
| 3875 | 3875 | $tmpfield = explode(',', $field);
|
| 3876 | - $field1 = trim($tmpfield[0]); // If $field is 'd.datep,d.id', it becomes 'd.datep' |
|
| 3876 | + $field1 = trim($tmpfield[0]); // If $field is 'd.datep,d.id', it becomes 'd.datep' |
|
| 3877 | 3877 | //var_dump('field='.$field.' field1='.$field1.' sortfield='.$sortfield.' sortfield1='.$sortfield1);
|
| 3878 | 3878 | // If field is used as sort criteria we use a specific css class liste_titre_sel |
| 3879 | 3879 | // Example if (sortfield,field)=("nom","xxx.nom") or (sortfield,field)=("nom","nom")
|
| 3880 | 3880 | if ($field1 && ($sortfield1 == $field1 || $sortfield1 == preg_replace("/^[^\.]+\./", "", $field1))) {
|
| 3881 | - $out .= '<' . $tag . ' class="' . $prefix . 'liste_titre_sel" ' . $moreattrib . '>'; |
|
| 3881 | + $out .= '<'.$tag.' class="'.$prefix.'liste_titre_sel" '.$moreattrib.'>'; |
|
| 3882 | 3882 | } else {
|
| 3883 | - $out .= '<' . $tag . ' class="' . $prefix . 'liste_titre" ' . $moreattrib . '>'; |
|
| 3883 | + $out .= '<'.$tag.' class="'.$prefix.'liste_titre" '.$moreattrib.'>'; |
|
| 3884 | 3884 | } |
| 3885 | 3885 | |
| 3886 | 3886 | if (empty($thead) && $field && empty($disablesortlink)) { // If this is a sort field
|
@@ -3888,7 +3888,7 @@ discard block |
||
| 3888 | 3888 | $options = preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i', '', $options);
|
| 3889 | 3889 | $options = preg_replace('/&+/i', '&', $options);
|
| 3890 | 3890 | if (!preg_match('/^&/', $options)) {
|
| 3891 | - $options = '&' . $options; |
|
| 3891 | + $options = '&'.$options; |
|
| 3892 | 3892 | } |
| 3893 | 3893 | |
| 3894 | 3894 | $sortordertouseinlink = ''; |
@@ -3906,7 +3906,7 @@ discard block |
||
| 3906 | 3906 | } |
| 3907 | 3907 | } |
| 3908 | 3908 | $sortordertouseinlink = preg_replace('/,$/', '', $sortordertouseinlink);
|
| 3909 | - $out .= '<a class="reposition" href="' . $file . '?sortfield=' . $field . '&sortorder=' . $sortordertouseinlink . '&begin=' . $begin . $options . '">'; |
|
| 3909 | + $out .= '<a class="reposition" href="'.$file.'?sortfield='.$field.'&sortorder='.$sortordertouseinlink.'&begin='.$begin.$options.'">'; |
|
| 3910 | 3910 | } |
| 3911 | 3911 | |
| 3912 | 3912 | if ($tooltip) {
|
@@ -3924,7 +3924,7 @@ discard block |
||
| 3924 | 3924 | $options = preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i', '', $options);
|
| 3925 | 3925 | $options = preg_replace('/&+/i', '&', $options);
|
| 3926 | 3926 | if (!preg_match('/^&/', $options)) {
|
| 3927 | - $options = '&' . $options; |
|
| 3927 | + $options = '&'.$options; |
|
| 3928 | 3928 | } |
| 3929 | 3929 | |
| 3930 | 3930 | if (!$sortorder || $field1 != $sortfield1) {
|
@@ -3934,19 +3934,19 @@ discard block |
||
| 3934 | 3934 | if (preg_match('/^DESC/', $sortorder)) {
|
| 3935 | 3935 | //$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=asc&begin='.$begin.$options.'">'.img_down("A-Z",0).'</a>';
|
| 3936 | 3936 | //$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=desc&begin='.$begin.$options.'">'.img_up("Z-A",1).'</a>';
|
| 3937 | - $sortimg .= '<span class="nowrap">' . img_up("Z-A", 0) . '</span>';
|
|
| 3937 | + $sortimg .= '<span class="nowrap">'.img_up("Z-A", 0).'</span>';
|
|
| 3938 | 3938 | } |
| 3939 | 3939 | if (preg_match('/^ASC/', $sortorder)) {
|
| 3940 | 3940 | //$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=asc&begin='.$begin.$options.'">'.img_down("A-Z",1).'</a>';
|
| 3941 | 3941 | //$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=desc&begin='.$begin.$options.'">'.img_up("Z-A",0).'</a>';
|
| 3942 | - $sortimg .= '<span class="nowrap">' . img_down("A-Z", 0) . '</span>';
|
|
| 3942 | + $sortimg .= '<span class="nowrap">'.img_down("A-Z", 0).'</span>';
|
|
| 3943 | 3943 | } |
| 3944 | 3944 | } |
| 3945 | 3945 | } |
| 3946 | 3946 | |
| 3947 | 3947 | $out .= $sortimg; |
| 3948 | 3948 | |
| 3949 | - $out .= '</' . $tag . '>'; |
|
| 3949 | + $out .= '</'.$tag.'>'; |
|
| 3950 | 3950 | |
| 3951 | 3951 | return $out; |
| 3952 | 3952 | } |
@@ -3961,9 +3961,9 @@ discard block |
||
| 3961 | 3961 | */ |
| 3962 | 3962 | static function print_titre($title) |
| 3963 | 3963 | {
|
| 3964 | - DolUtils::dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); |
|
| 3964 | + DolUtils::dol_syslog(__FUNCTION__." is deprecated", LOG_WARNING); |
|
| 3965 | 3965 | |
| 3966 | - print '<div class="titre">' . $title . '</div>'; |
|
| 3966 | + print '<div class="titre">'.$title.'</div>'; |
|
| 3967 | 3967 | } |
| 3968 | 3968 | |
| 3969 | 3969 | /** |
@@ -4006,20 +4006,20 @@ discard block |
||
| 4006 | 4006 | } |
| 4007 | 4007 | |
| 4008 | 4008 | $return .= "\n"; |
| 4009 | - $return .= '<table ' . ($id ? 'id="' . $id . '" ' : '') . 'summary="" class="centpercent notopnoleftnoright' . ($morecssontable ? ' ' . $morecssontable : '') . '" style="margin-bottom: 6px;"><tr>'; // maring bottom must be same than into print_barre_list |
|
| 4009 | + $return .= '<table '.($id ? 'id="'.$id.'" ' : '').'summary="" class="centpercent notopnoleftnoright'.($morecssontable ? ' '.$morecssontable : '').'" style="margin-bottom: 6px;"><tr>'; // maring bottom must be same than into print_barre_list |
|
| 4010 | 4010 | if ($picto) {
|
| 4011 | - $return .= '<td class="nobordernopadding widthpictotitle opacityhigh" valign="middle">' . img_picto('', $picto, 'class="valignmiddle widthpictotitle pictotitle"', $pictoisfullpath) . '</td>';
|
|
| 4011 | + $return .= '<td class="nobordernopadding widthpictotitle opacityhigh" valign="middle">'.img_picto('', $picto, 'class="valignmiddle widthpictotitle pictotitle"', $pictoisfullpath).'</td>';
|
|
| 4012 | 4012 | } |
| 4013 | 4013 | $return .= '<td class="nobordernopadding valignmiddle">'; |
| 4014 | - $return .= '<div class="titre inline-block">' . $titre . '</div>'; |
|
| 4014 | + $return .= '<div class="titre inline-block">'.$titre.'</div>'; |
|
| 4015 | 4015 | $return .= '</td>'; |
| 4016 | 4016 | if (DolUtils::dol_strlen($morehtmlcenter)) {
|
| 4017 | - $return .= '<td class="nobordernopadding" align="center" valign="middle">' . $morehtmlcenter . '</td>'; |
|
| 4017 | + $return .= '<td class="nobordernopadding" align="center" valign="middle">'.$morehtmlcenter.'</td>'; |
|
| 4018 | 4018 | } |
| 4019 | 4019 | if (DolUtils::dol_strlen($morehtmlright)) {
|
| 4020 | - $return .= '<td class="nobordernopadding titre_right wordbreak" align="right" valign="middle">' . $morehtmlright . '</td>'; |
|
| 4020 | + $return .= '<td class="nobordernopadding titre_right wordbreak" align="right" valign="middle">'.$morehtmlright.'</td>'; |
|
| 4021 | 4021 | } |
| 4022 | - $return .= '</tr></table>' . "\n"; |
|
| 4022 | + $return .= '</tr></table>'."\n"; |
|
| 4023 | 4023 | |
| 4024 | 4024 | return $return; |
| 4025 | 4025 | } |
@@ -4067,29 +4067,29 @@ discard block |
||
| 4067 | 4067 | //print 'totalnboflines='.$totalnboflines.'-savlimit='.$savlimit.'-limit='.$limit.'-num='.$num.'-nextpage='.$nextpage; |
| 4068 | 4068 | |
| 4069 | 4069 | print "\n"; |
| 4070 | - print "<!-- Begin title '" . $titre . "' -->\n"; |
|
| 4071 | - print '<table border="0" class="centpercent notopnoleftnoright' . ($morecss ? ' ' . $morecss : '') . '" style="margin-bottom: 6px;"><tr>'; // maring bottom must be same than into load_fiche_tire |
|
| 4070 | + print "<!-- Begin title '".$titre."' -->\n"; |
|
| 4071 | + print '<table border="0" class="centpercent notopnoleftnoright'.($morecss ? ' '.$morecss : '').'" style="margin-bottom: 6px;"><tr>'; // maring bottom must be same than into load_fiche_tire |
|
| 4072 | 4072 | // Left |
| 4073 | 4073 | //if ($picto && $titre) print '<td class="nobordernopadding hideonsmartphone" width="40" align="left" valign="middle">'.img_picto('', $picto, 'id="pictotitle"', $pictoisfullpath).'</td>';
|
| 4074 | 4074 | print '<td class="nobordernopadding valignmiddle">'; |
| 4075 | 4075 | if ($picto && $titre) |
| 4076 | 4076 | print img_picto('', $picto, 'class="hideonsmartphone valignmiddle opacityhigh pictotitle widthpictotitle"', $pictoisfullpath);
|
| 4077 | - print '<div class="titre inline-block">' . $titre; |
|
| 4077 | + print '<div class="titre inline-block">'.$titre; |
|
| 4078 | 4078 | if (!empty($titre) && $savtotalnboflines >= 0 && (string) $savtotalnboflines != '') |
| 4079 | - print ' (' . $totalnboflines . ')';
|
|
| 4079 | + print ' ('.$totalnboflines.')';
|
|
| 4080 | 4080 | print '</div></td>'; |
| 4081 | 4081 | |
| 4082 | 4082 | // Center |
| 4083 | 4083 | if ($morehtmlcenter) {
|
| 4084 | - print '<td class="nobordernopadding center valignmiddle">' . $morehtmlcenter . '</td>'; |
|
| 4084 | + print '<td class="nobordernopadding center valignmiddle">'.$morehtmlcenter.'</td>'; |
|
| 4085 | 4085 | } |
| 4086 | 4086 | |
| 4087 | 4087 | // Right |
| 4088 | 4088 | print '<td class="nobordernopadding valignmiddle" align="right">'; |
| 4089 | 4089 | if ($sortfield) |
| 4090 | - $options .= "&sortfield=" . urlencode($sortfield); |
|
| 4090 | + $options .= "&sortfield=".urlencode($sortfield); |
|
| 4091 | 4091 | if ($sortorder) |
| 4092 | - $options .= "&sortorder=" . urlencode($sortorder); |
|
| 4092 | + $options .= "&sortorder=".urlencode($sortorder); |
|
| 4093 | 4093 | // Show navigation bar |
| 4094 | 4094 | $pagelist = ''; |
| 4095 | 4095 | if ($savlimit != 0 && ($page > 0 || $num > $limit)) {
|
@@ -4107,40 +4107,40 @@ discard block |
||
| 4107 | 4107 | } |
| 4108 | 4108 | |
| 4109 | 4109 | if ($cpt >= 1) {
|
| 4110 | - $pagelist .= '<li' . ((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><a href="' . $file . '?page=0' . $options . '">1</a></li>'; |
|
| 4110 | + $pagelist .= '<li'.((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><a href="'.$file.'?page=0'.$options.'">1</a></li>'; |
|
| 4111 | 4111 | if ($cpt > 2) |
| 4112 | - $pagelist .= '<li' . ((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><span ' . ((Globals::$conf->dol_use_jmobile != 4) ? 'class="inactive"' : '') . '>...</span></li>'; |
|
| 4112 | + $pagelist .= '<li'.((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><span '.((Globals::$conf->dol_use_jmobile != 4) ? 'class="inactive"' : '').'>...</span></li>'; |
|
| 4113 | 4113 | else if ($cpt == 2) |
| 4114 | - $pagelist .= '<li' . ((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><a href="' . $file . '?page=1' . $options . '">2</a></li>'; |
|
| 4114 | + $pagelist .= '<li'.((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><a href="'.$file.'?page=1'.$options.'">2</a></li>'; |
|
| 4115 | 4115 | } |
| 4116 | 4116 | |
| 4117 | 4117 | do {
|
| 4118 | 4118 | if ($cpt == $page) {
|
| 4119 | - $pagelist .= '<li' . ((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><span ' . ((Globals::$conf->dol_use_jmobile != 4) ? 'class="active"' : '') . '>' . ($page + 1) . '</span></li>'; |
|
| 4119 | + $pagelist .= '<li'.((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><span '.((Globals::$conf->dol_use_jmobile != 4) ? 'class="active"' : '').'>'.($page + 1).'</span></li>'; |
|
| 4120 | 4120 | } else {
|
| 4121 | - $pagelist .= '<li' . ((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><a href="' . $file . '?page=' . $cpt . $options . '">' . ($cpt + 1) . '</a></li>'; |
|
| 4121 | + $pagelist .= '<li'.((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><a href="'.$file.'?page='.$cpt.$options.'">'.($cpt + 1).'</a></li>'; |
|
| 4122 | 4122 | } |
| 4123 | 4123 | $cpt++; |
| 4124 | 4124 | } while ($cpt < $nbpages && $cpt <= $page + $maxnbofpage); |
| 4125 | 4125 | |
| 4126 | 4126 | if ($cpt < $nbpages) {
|
| 4127 | 4127 | if ($cpt < $nbpages - 2) |
| 4128 | - $pagelist .= '<li' . ((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><span ' . ((Globals::$conf->dol_use_jmobile != 4) ? 'class="inactive"' : '') . '>...</span></li>'; |
|
| 4128 | + $pagelist .= '<li'.((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><span '.((Globals::$conf->dol_use_jmobile != 4) ? 'class="inactive"' : '').'>...</span></li>'; |
|
| 4129 | 4129 | else if ($cpt == $nbpages - 2) |
| 4130 | - $pagelist .= '<li' . ((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><a href="' . $file . '?page=' . ($nbpages - 2) . $options . '">' . ($nbpages - 1) . '</a></li>'; |
|
| 4131 | - $pagelist .= '<li' . ((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><a href="' . $file . '?page=' . ($nbpages - 1) . $options . '">' . $nbpages . '</a></li>'; |
|
| 4130 | + $pagelist .= '<li'.((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><a href="'.$file.'?page='.($nbpages - 2).$options.'">'.($nbpages - 1).'</a></li>'; |
|
| 4131 | + $pagelist .= '<li'.((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><a href="'.$file.'?page='.($nbpages - 1).$options.'">'.$nbpages.'</a></li>'; |
|
| 4132 | 4132 | } |
| 4133 | 4133 | } |
| 4134 | 4134 | else {
|
| 4135 | - $pagelist .= '<li' . ((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><span ' . ((Globals::$conf->dol_use_jmobile != 4) ? 'class="active"' : '') . '>' . ($page + 1) . "</li>"; |
|
| 4135 | + $pagelist .= '<li'.((Globals::$conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><span '.((Globals::$conf->dol_use_jmobile != 4) ? 'class="active"' : '').'>'.($page + 1)."</li>"; |
|
| 4136 | 4136 | } |
| 4137 | 4137 | } |
| 4138 | 4138 | |
| 4139 | - print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtmlright, $savlimit, $totalnboflines, $hideselectlimit); // output the div and ul for previous/last completed with page numbers into $pagelist |
|
| 4139 | + print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtmlright, $savlimit, $totalnboflines, $hideselectlimit); // output the div and ul for previous/last completed with page numbers into $pagelist |
|
| 4140 | 4140 | |
| 4141 | 4141 | print '</td>'; |
| 4142 | 4142 | |
| 4143 | - print '</tr></table>' . "\n"; |
|
| 4143 | + print '</tr></table>'."\n"; |
|
| 4144 | 4144 | print "<!-- End title -->\n\n"; |
| 4145 | 4145 | } |
| 4146 | 4146 | |
@@ -4171,12 +4171,12 @@ discard block |
||
| 4171 | 4171 | $pagesizechoices = Globals::$conf->global->MAIN_PAGESIZE_CHOICES; |
| 4172 | 4172 | |
| 4173 | 4173 | print '<li class="pagination">'; |
| 4174 | - print '<select class="flat selectlimit" name="limit" title="' . dol_escape_htmltag(Globals::$langs->trans("MaxNbOfRecordPerPage")) . '">';
|
|
| 4174 | + print '<select class="flat selectlimit" name="limit" title="'.dol_escape_htmltag(Globals::$langs->trans("MaxNbOfRecordPerPage")).'">';
|
|
| 4175 | 4175 | $tmpchoice = explode(',', $pagesizechoices);
|
| 4176 | - $tmpkey = $limit . ':' . $limit; |
|
| 4176 | + $tmpkey = $limit.':'.$limit; |
|
| 4177 | 4177 | if (!in_array($tmpkey, $tmpchoice)) |
| 4178 | 4178 | $tmpchoice[] = $tmpkey; |
| 4179 | - $tmpkey = Globals::$conf->liste_limit . ':' . Globals::$conf->liste_limit; |
|
| 4179 | + $tmpkey = Globals::$conf->liste_limit.':'.Globals::$conf->liste_limit; |
|
| 4180 | 4180 | if (!in_array($tmpkey, $tmpchoice)) |
| 4181 | 4181 | $tmpchoice[] = $tmpkey; |
| 4182 | 4182 | asort($tmpchoice, SORT_NUMERIC); |
@@ -4191,7 +4191,7 @@ discard block |
||
| 4191 | 4191 | $selected = ' selected="selected"'; |
| 4192 | 4192 | $found = true; |
| 4193 | 4193 | } |
| 4194 | - print '<option name="' . $key . '"' . $selected . '>' . dol_escape_htmltag($val) . '</option>' . "\n"; |
|
| 4194 | + print '<option name="'.$key.'"'.$selected.'>'.dol_escape_htmltag($val).'</option>'."\n"; |
|
| 4195 | 4195 | } |
| 4196 | 4196 | } |
| 4197 | 4197 | print '</select>'; |
@@ -4210,20 +4210,20 @@ discard block |
||
| 4210 | 4210 | print '</li>'; |
| 4211 | 4211 | } |
| 4212 | 4212 | if ($page > 0) {
|
| 4213 | - print '<li class="pagination"><a class="paginationprevious" href="' . $file . '?page=' . ($page - 1) . $options . '"><i class="fa fa-chevron-left" title="' . dol_escape_htmltag(Globals::$langs->trans("Previous")) . '"></i></a></li>';
|
|
| 4213 | + print '<li class="pagination"><a class="paginationprevious" href="'.$file.'?page='.($page - 1).$options.'"><i class="fa fa-chevron-left" title="'.dol_escape_htmltag(Globals::$langs->trans("Previous")).'"></i></a></li>';
|
|
| 4214 | 4214 | } |
| 4215 | 4215 | if ($betweenarrows) {
|
| 4216 | 4216 | print $betweenarrows; |
| 4217 | 4217 | } |
| 4218 | 4218 | if ($nextpage > 0) {
|
| 4219 | - print '<li class="pagination"><a class="paginationnext" href="' . $file . '?page=' . ($page + 1) . $options . '"><i class="fa fa-chevron-right" title="' . dol_escape_htmltag(Globals::$langs->trans("Next")) . '"></i></a></li>';
|
|
| 4219 | + print '<li class="pagination"><a class="paginationnext" href="'.$file.'?page='.($page + 1).$options.'"><i class="fa fa-chevron-right" title="'.dol_escape_htmltag(Globals::$langs->trans("Next")).'"></i></a></li>';
|
|
| 4220 | 4220 | } |
| 4221 | 4221 | if ($afterarrows) {
|
| 4222 | 4222 | print '<li class="paginationafterarrows">'; |
| 4223 | 4223 | print $afterarrows; |
| 4224 | 4224 | print '</li>'; |
| 4225 | 4225 | } |
| 4226 | - print '</ul></div>' . "\n"; |
|
| 4226 | + print '</ul></div>'."\n"; |
|
| 4227 | 4227 | } |
| 4228 | 4228 | |
| 4229 | 4229 | /** |
@@ -4245,8 +4245,8 @@ discard block |
||
| 4245 | 4245 | $addpercent = true; |
| 4246 | 4246 | } |
| 4247 | 4247 | if (preg_match('/\((.*)\)/', $rate, $reg)) {
|
| 4248 | - $morelabel = ' (' . $reg[1] . ')';
|
|
| 4249 | - $rate = preg_replace('/\s*' . preg_quote($morelabel, '/') . '/', '', $rate);
|
|
| 4248 | + $morelabel = ' ('.$reg[1].')';
|
|
| 4249 | + $rate = preg_replace('/\s*'.preg_quote($morelabel, '/').'/', '', $rate);
|
|
| 4250 | 4250 | } |
| 4251 | 4251 | if (preg_match('/\*/', $rate)) {
|
| 4252 | 4252 | $rate = str_replace('*', '', $rate);
|
@@ -4255,10 +4255,10 @@ discard block |
||
| 4255 | 4255 | |
| 4256 | 4256 | // If rate is '9/9/9' we don't change it. If rate is '9.000' we apply price() |
| 4257 | 4257 | if (!preg_match('/\//', $rate))
|
| 4258 | - $ret = price($rate, 0, '', 0, 0) . ($addpercent ? '%' : ''); |
|
| 4258 | + $ret = price($rate, 0, '', 0, 0).($addpercent ? '%' : ''); |
|
| 4259 | 4259 | else {
|
| 4260 | 4260 | // TODO Split on / and output with a price2num to have clean numbers without ton of 000. |
| 4261 | - $ret = $rate . ($addpercent ? '%' : ''); |
|
| 4261 | + $ret = $rate.($addpercent ? '%' : ''); |
|
| 4262 | 4262 | } |
| 4263 | 4263 | if (($info_bits & 1) && $usestarfornpr >= 0) |
| 4264 | 4264 | $ret .= ' *'; |
@@ -4351,10 +4351,10 @@ discard block |
||
| 4351 | 4351 | $cursymbolbefore .= $outlangs->getCurrencySymbol($currency_code); |
| 4352 | 4352 | else {
|
| 4353 | 4353 | $tmpcur = $outlangs->getCurrencySymbol($currency_code); |
| 4354 | - $cursymbolafter .= ($tmpcur == $currency_code ? ' ' . $tmpcur : $tmpcur); |
|
| 4354 | + $cursymbolafter .= ($tmpcur == $currency_code ? ' '.$tmpcur : $tmpcur); |
|
| 4355 | 4355 | } |
| 4356 | 4356 | } |
| 4357 | - $output = $cursymbolbefore . $output . $end . ($cursymbolafter ? ' ' : '') . $cursymbolafter; |
|
| 4357 | + $output = $cursymbolbefore.$output.$end.($cursymbolafter ? ' ' : '').$cursymbolafter; |
|
| 4358 | 4358 | |
| 4359 | 4359 | return $output; |
| 4360 | 4360 | } |
@@ -4407,7 +4407,7 @@ discard block |
||
| 4407 | 4407 | // Now make replace (the main goal of function) |
| 4408 | 4408 | if ($thousand != ',' && $thousand != '.') |
| 4409 | 4409 | $amount = str_replace(',', '.', $amount); // To accept 2 notations for french users
|
| 4410 | - $amount = str_replace(' ', '', $amount); // To avoid spaces
|
|
| 4410 | + $amount = str_replace(' ', '', $amount); // To avoid spaces
|
|
| 4411 | 4411 | $amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is . |
| 4412 | 4412 | $amount = str_replace($dec, '.', $amount); |
| 4413 | 4413 | } |
@@ -4436,14 +4436,14 @@ discard block |
||
| 4436 | 4436 | $temps = sprintf("%0.10F", $amount - intval($amount)); // temps=0.0000000000 or 0.0000200000 or 9999.1000000000
|
| 4437 | 4437 | $temps = preg_replace('/([\.1-9])0+$/', '\\1', $temps); // temps=0. or 0.00002 or 9999.1
|
| 4438 | 4438 | $nbofdec = max(0, DolUtils::dol_strlen($temps) - 2); // -2 to remove "0." |
| 4439 | - $amount = number_format($amount, min($nbofdec, $nbofdectoround), $dec, $thousand); // Convert amount to format with dolibarr dec and thousand |
|
| 4439 | + $amount = number_format($amount, min($nbofdec, $nbofdectoround), $dec, $thousand); // Convert amount to format with dolibarr dec and thousand |
|
| 4440 | 4440 | } |
| 4441 | 4441 | //print "TT".$amount.'<br>'; |
| 4442 | 4442 | // Always make replace because each math static function (like round) replace |
| 4443 | 4443 | // with local values and we want a number that has a SQL string format x.y |
| 4444 | 4444 | if ($thousand != ',' && $thousand != '.') |
| 4445 | 4445 | $amount = str_replace(',', '.', $amount); // To accept 2 notations for french users
|
| 4446 | - $amount = str_replace(' ', '', $amount); // To avoid spaces
|
|
| 4446 | + $amount = str_replace(' ', '', $amount); // To avoid spaces
|
|
| 4447 | 4447 | $amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is . |
| 4448 | 4448 | $amount = str_replace($dec, '.', $amount); |
| 4449 | 4449 | } |
@@ -4464,7 +4464,7 @@ discard block |
||
| 4464 | 4464 | */ |
| 4465 | 4465 | static function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round = -1, $forceunitoutput = 'no') |
| 4466 | 4466 | {
|
| 4467 | - require_once DOL_BASE_PATH . '/core/lib/product.lib.php'; |
|
| 4467 | + require_once DOL_BASE_PATH.'/core/lib/product.lib.php'; |
|
| 4468 | 4468 | |
| 4469 | 4469 | if (($forceunitoutput == 'no' && $dimension < 1 / 10000) || (is_numeric($forceunitoutput) && $forceunitoutput == -6)) {
|
| 4470 | 4470 | $dimension = $dimension * 1000000; |
@@ -4480,7 +4480,7 @@ discard block |
||
| 4480 | 4480 | $unit = $unit + 3; |
| 4481 | 4481 | } |
| 4482 | 4482 | |
| 4483 | - $ret = price($dimension, 0, $outputlangs, 0, 0, $round) . ' ' . measuring_units_string($unit, $type); |
|
| 4483 | + $ret = price($dimension, 0, $outputlangs, 0, 0, $round).' '.measuring_units_string($unit, $type); |
|
| 4484 | 4484 | |
| 4485 | 4485 | return $ret; |
| 4486 | 4486 | } |
@@ -4504,7 +4504,7 @@ discard block |
||
| 4504 | 4504 | if (empty($thirdparty_seller) || !is_object($thirdparty_seller)) |
| 4505 | 4505 | $thirdparty_seller = $mysoc; |
| 4506 | 4506 | |
| 4507 | - DolUtils::dol_syslog("get_localtax tva=" . $vatrate . " local=" . $local . " thirdparty_buyer id=" . (is_object($thirdparty_buyer) ? $thirdparty_buyer->id : '') . "/country_code=" . (is_object($thirdparty_buyer) ? $thirdparty_buyer->country_code : '') . " thirdparty_seller id=" . $thirdparty_seller->id . "/country_code=" . $thirdparty_seller->country_code . " thirdparty_seller localtax1_assuj=" . $thirdparty_seller->localtax1_assuj . " thirdparty_seller localtax2_assuj=" . $thirdparty_seller->localtax2_assuj);
|
|
| 4507 | + DolUtils::dol_syslog("get_localtax tva=".$vatrate." local=".$local." thirdparty_buyer id=".(is_object($thirdparty_buyer) ? $thirdparty_buyer->id : '')."/country_code=".(is_object($thirdparty_buyer) ? $thirdparty_buyer->country_code : '')." thirdparty_seller id=".$thirdparty_seller->id."/country_code=".$thirdparty_seller->country_code." thirdparty_seller localtax1_assuj=".$thirdparty_seller->localtax1_assuj." thirdparty_seller localtax2_assuj=".$thirdparty_seller->localtax2_assuj);
|
|
| 4508 | 4508 | |
| 4509 | 4509 | $vatratecleaned = $vatrate; |
| 4510 | 4510 | if (preg_match('/^(.*)\s*\((.*)\)$/', $vatrate, $reg)) { // If vat is "xx (yy)"
|
@@ -4535,7 +4535,7 @@ discard block |
||
| 4535 | 4535 | if ($local == 2) {
|
| 4536 | 4536 | //if (! $mysoc->localtax2_assuj || (string) $vatratecleaned == "0") return 0; |
| 4537 | 4537 | if (!$mysoc->localtax2_assuj) |
| 4538 | - return 0; // If main vat is 0, IRPF may be different than 0. |
|
| 4538 | + return 0; // If main vat is 0, IRPF may be different than 0. |
|
| 4539 | 4539 | if ($thirdparty_seller->id == $mysoc->id) {
|
| 4540 | 4540 | if (!$thirdparty_buyer->localtax2_assuj) |
| 4541 | 4541 | return 0; |
@@ -4589,13 +4589,13 @@ discard block |
||
| 4589 | 4589 | |
| 4590 | 4590 | // By default, search value of local tax on line of common tax |
| 4591 | 4591 | $sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type"; |
| 4592 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t, " . MAIN_DB_PREFIX . "c_country as c"; |
|
| 4593 | - $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '" . $thirdparty_seller->country_code . "'"; |
|
| 4594 | - $sql .= " AND t.taux = " . ((float) $vatratecleaned) . " AND t.active = 1"; |
|
| 4592 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; |
|
| 4593 | + $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$thirdparty_seller->country_code."'"; |
|
| 4594 | + $sql .= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1"; |
|
| 4595 | 4595 | if ($vatratecode) |
| 4596 | - $sql .= " AND t.code ='" . $vatratecode . "'"; // If we have the code, we use it in priority |
|
| 4596 | + $sql .= " AND t.code ='".$vatratecode."'"; // If we have the code, we use it in priority |
|
| 4597 | 4597 | else |
| 4598 | - $sql .= " AND t.recuperableonly ='" . $vatnpr . "'"; |
|
| 4598 | + $sql .= " AND t.recuperableonly ='".$vatnpr."'"; |
|
| 4599 | 4599 | DolUtils::dol_syslog("get_localtax", LOG_DEBUG);
|
| 4600 | 4600 | $resql = $db->query($sql); |
| 4601 | 4601 | |
@@ -4641,10 +4641,10 @@ discard block |
||
| 4641 | 4641 | {
|
| 4642 | 4642 | // global $db, $mysoc; |
| 4643 | 4643 | $sql = "SELECT t.localtax1, t.localtax2 "; |
| 4644 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t inner join " . MAIN_DB_PREFIX . "c_country as c ON c.rowid=t.fk_pays"; |
|
| 4645 | - $sql .= " WHERE c.code = '" . $mysoc->country_code . "' AND t.active = 1 AND t.taux=(";
|
|
| 4646 | - $sql .= " SELECT max(tt.taux) FROM " . MAIN_DB_PREFIX . "c_tva as tt inner join " . MAIN_DB_PREFIX . "c_country as c ON c.rowid=tt.fk_pays"; |
|
| 4647 | - $sql .= " WHERE c.code = '" . $mysoc->country_code . "' AND tt.active = 1"; |
|
| 4644 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t inner join ".MAIN_DB_PREFIX."c_country as c ON c.rowid=t.fk_pays"; |
|
| 4645 | + $sql .= " WHERE c.code = '".$mysoc->country_code."' AND t.active = 1 AND t.taux=(";
|
|
| 4646 | + $sql .= " SELECT max(tt.taux) FROM ".MAIN_DB_PREFIX."c_tva as tt inner join ".MAIN_DB_PREFIX."c_country as c ON c.rowid=tt.fk_pays"; |
|
| 4647 | + $sql .= " WHERE c.code = '".$mysoc->country_code."' AND tt.active = 1"; |
|
| 4648 | 4648 | $sql .= " )"; |
| 4649 | 4649 | |
| 4650 | 4650 | $resql = $db->query($sql); |
@@ -4674,13 +4674,13 @@ discard block |
||
| 4674 | 4674 | {
|
| 4675 | 4675 | // global $db, $mysoc; |
| 4676 | 4676 | |
| 4677 | - DolUtils::dol_syslog("getTaxesFromId vat id or rate = " . $vatrate);
|
|
| 4677 | + DolUtils::dol_syslog("getTaxesFromId vat id or rate = ".$vatrate);
|
|
| 4678 | 4678 | |
| 4679 | 4679 | // Search local taxes |
| 4680 | 4680 | $sql = "SELECT t.rowid, t.code, t.taux as rate, t.recuperableonly as npr, t.accountancy_code_sell, t.accountancy_code_buy"; |
| 4681 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t"; |
|
| 4681 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t"; |
|
| 4682 | 4682 | if ($firstparamisid) |
| 4683 | - $sql .= " WHERE t.rowid = " . (int) $vatrate; |
|
| 4683 | + $sql .= " WHERE t.rowid = ".(int) $vatrate; |
|
| 4684 | 4684 | else {
|
| 4685 | 4685 | $vatratecleaned = $vatrate; |
| 4686 | 4686 | $vatratecode = ''; |
@@ -4689,13 +4689,13 @@ discard block |
||
| 4689 | 4689 | $vatratecode = $reg[2]; |
| 4690 | 4690 | } |
| 4691 | 4691 | |
| 4692 | - $sql .= ", " . MAIN_DB_PREFIX . "c_country as c"; |
|
| 4692 | + $sql .= ", ".MAIN_DB_PREFIX."c_country as c"; |
|
| 4693 | 4693 | /* if ($mysoc->country_code == 'ES') $sql.= " WHERE t.fk_pays = c.rowid AND c.code = '".$buyer->country_code."'"; // vat in spain use the buyer country ?? |
| 4694 | 4694 | else $sql.= " WHERE t.fk_pays = c.rowid AND c.code = '".$seller->country_code."'"; */ |
| 4695 | - $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '" . $seller->country_code . "'"; |
|
| 4696 | - $sql .= " AND t.taux = " . ((float) $vatratecleaned) . " AND t.active = 1"; |
|
| 4695 | + $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$seller->country_code."'"; |
|
| 4696 | + $sql .= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1"; |
|
| 4697 | 4697 | if ($vatratecode) |
| 4698 | - $sql .= " AND t.code = '" . $vatratecode . "'"; |
|
| 4698 | + $sql .= " AND t.code = '".$vatratecode."'"; |
|
| 4699 | 4699 | } |
| 4700 | 4700 | |
| 4701 | 4701 | $resql = $db->query($sql); |
@@ -4731,13 +4731,13 @@ discard block |
||
| 4731 | 4731 | {
|
| 4732 | 4732 | // global $db, $mysoc; |
| 4733 | 4733 | |
| 4734 | - DolUtils::dol_syslog("getLocalTaxesFromRate vatrate=" . $vatrate . " local=" . $local);
|
|
| 4734 | + DolUtils::dol_syslog("getLocalTaxesFromRate vatrate=".$vatrate." local=".$local);
|
|
| 4735 | 4735 | |
| 4736 | 4736 | // Search local taxes |
| 4737 | 4737 | $sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.accountancy_code_sell, t.accountancy_code_buy"; |
| 4738 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t"; |
|
| 4738 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t"; |
|
| 4739 | 4739 | if ($firstparamisid) |
| 4740 | - $sql .= " WHERE t.rowid = " . (int) $vatrate; |
|
| 4740 | + $sql .= " WHERE t.rowid = ".(int) $vatrate; |
|
| 4741 | 4741 | else {
|
| 4742 | 4742 | $vatratecleaned = $vatrate; |
| 4743 | 4743 | $vatratecode = ''; |
@@ -4746,14 +4746,14 @@ discard block |
||
| 4746 | 4746 | $vatratecode = $reg[2]; |
| 4747 | 4747 | } |
| 4748 | 4748 | |
| 4749 | - $sql .= ", " . MAIN_DB_PREFIX . "c_country as c"; |
|
| 4749 | + $sql .= ", ".MAIN_DB_PREFIX."c_country as c"; |
|
| 4750 | 4750 | if ($mysoc->country_code == 'ES') |
| 4751 | - $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '" . $buyer->country_code . "'"; // local tax in spain use the buyer country ?? |
|
| 4751 | + $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$buyer->country_code."'"; // local tax in spain use the buyer country ?? |
|
| 4752 | 4752 | else |
| 4753 | - $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '" . $seller->country_code . "'"; |
|
| 4754 | - $sql .= " AND t.taux = " . ((float) $vatratecleaned) . " AND t.active = 1"; |
|
| 4753 | + $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$seller->country_code."'"; |
|
| 4754 | + $sql .= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1"; |
|
| 4755 | 4755 | if ($vatratecode) |
| 4756 | - $sql .= " AND t.code = '" . $vatratecode . "'"; |
|
| 4756 | + $sql .= " AND t.code = '".$vatratecode."'"; |
|
| 4757 | 4757 | } |
| 4758 | 4758 | |
| 4759 | 4759 | $resql = $db->query($sql); |
@@ -4785,7 +4785,7 @@ discard block |
||
| 4785 | 4785 | {
|
| 4786 | 4786 | // global $db, Globals::$conf, $mysoc; |
| 4787 | 4787 | |
| 4788 | - require_once DOL_BASE_PATH . '/product/class/product.class.php'; |
|
| 4788 | + require_once DOL_BASE_PATH.'/product/class/product.class.php'; |
|
| 4789 | 4789 | |
| 4790 | 4790 | $ret = 0; |
| 4791 | 4791 | $found = 0; |
@@ -4800,12 +4800,12 @@ discard block |
||
| 4800 | 4800 | $product->get_buyprice($idprodfournprice, 0, 0, 0); |
| 4801 | 4801 | $ret = $product->vatrate_supplier; |
| 4802 | 4802 | if ($product->default_vat_code) |
| 4803 | - $ret .= ' (' . $product->default_vat_code . ')';
|
|
| 4803 | + $ret .= ' ('.$product->default_vat_code.')';
|
|
| 4804 | 4804 | } |
| 4805 | 4805 | else {
|
| 4806 | - $ret = $product->tva_tx; // Default vat of product we defined |
|
| 4806 | + $ret = $product->tva_tx; // Default vat of product we defined |
|
| 4807 | 4807 | if ($product->default_vat_code) |
| 4808 | - $ret .= ' (' . $product->default_vat_code . ')';
|
|
| 4808 | + $ret .= ' ('.$product->default_vat_code.')';
|
|
| 4809 | 4809 | } |
| 4810 | 4810 | $found = 1; |
| 4811 | 4811 | } |
@@ -4819,8 +4819,8 @@ discard block |
||
| 4819 | 4819 | if (empty(Globals::$conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS)) {
|
| 4820 | 4820 | // If vat of product for the country not found or not defined, we return the first higher vat of country. |
| 4821 | 4821 | $sql = "SELECT t.taux as vat_rate, t.code as default_vat_code"; |
| 4822 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t, " . MAIN_DB_PREFIX . "c_country as c"; |
|
| 4823 | - $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='" . $thirdparty_seller->country_code . "'"; |
|
| 4822 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; |
|
| 4823 | + $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'"; |
|
| 4824 | 4824 | $sql .= " ORDER BY t.taux DESC, t.code ASC, t.recuperableonly ASC"; |
| 4825 | 4825 | $sql .= $db->plimit(1); |
| 4826 | 4826 | |
@@ -4830,16 +4830,16 @@ discard block |
||
| 4830 | 4830 | if ($obj) {
|
| 4831 | 4831 | $ret = $obj->vat_rate; |
| 4832 | 4832 | if ($obj->default_vat_code) |
| 4833 | - $ret .= ' (' . $obj->default_vat_code . ')';
|
|
| 4833 | + $ret .= ' ('.$obj->default_vat_code.')';
|
|
| 4834 | 4834 | } |
| 4835 | 4835 | $db->free($sql); |
| 4836 | 4836 | } else |
| 4837 | 4837 | dol_print_error($db); |
| 4838 | 4838 | } else |
| 4839 | - $ret = Globals::$conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS; // Forced value if autodetect fails |
|
| 4839 | + $ret = Globals::$conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS; // Forced value if autodetect fails |
|
| 4840 | 4840 | } |
| 4841 | 4841 | |
| 4842 | - DolUtils::dol_syslog("get_product_vat_for_country: ret=" . $ret);
|
|
| 4842 | + DolUtils::dol_syslog("get_product_vat_for_country: ret=".$ret);
|
|
| 4843 | 4843 | return $ret; |
| 4844 | 4844 | } |
| 4845 | 4845 | |
@@ -4857,7 +4857,7 @@ discard block |
||
| 4857 | 4857 | // global $db, $mysoc; |
| 4858 | 4858 | |
| 4859 | 4859 | if (!class_exists('Product')) {
|
| 4860 | - require_once DOL_BASE_PATH . 'product/class/product.class.php'; |
|
| 4860 | + require_once DOL_BASE_PATH.'product/class/product.class.php'; |
|
| 4861 | 4861 | } |
| 4862 | 4862 | |
| 4863 | 4863 | $ret = 0; |
@@ -4882,8 +4882,8 @@ discard block |
||
| 4882 | 4882 | if (!$found) {
|
| 4883 | 4883 | // If vat of product for the country not found or not defined, we return higher vat of country. |
| 4884 | 4884 | $sql = "SELECT taux as vat_rate, localtax1, localtax2"; |
| 4885 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t, " . MAIN_DB_PREFIX . "c_country as c"; |
|
| 4886 | - $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='" . $thirdparty_seller->country_code . "'"; |
|
| 4885 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; |
|
| 4886 | + $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'"; |
|
| 4887 | 4887 | $sql .= " ORDER BY t.taux DESC, t.recuperableonly ASC"; |
| 4888 | 4888 | $sql .= $db->plimit(1); |
| 4889 | 4889 | |
@@ -4900,7 +4900,7 @@ discard block |
||
| 4900 | 4900 | dol_print_error($db); |
| 4901 | 4901 | } |
| 4902 | 4902 | |
| 4903 | - DolUtils::dol_syslog("get_product_localtax_for_country: ret=" . $ret);
|
|
| 4903 | + DolUtils::dol_syslog("get_product_localtax_for_country: ret=".$ret);
|
|
| 4904 | 4904 | return $ret; |
| 4905 | 4905 | } |
| 4906 | 4906 | |
@@ -4924,7 +4924,7 @@ discard block |
||
| 4924 | 4924 | {
|
| 4925 | 4925 | // global Globals::$conf; |
| 4926 | 4926 | |
| 4927 | - require_once DOL_BASE_PATH . '/core/lib/company.lib.php'; |
|
| 4927 | + require_once DOL_BASE_PATH.'/core/lib/company.lib.php'; |
|
| 4928 | 4928 | |
| 4929 | 4929 | // Note: possible values for tva_assuj are 0/1 or franchise/reel |
| 4930 | 4930 | $seller_use_vat = ((is_numeric($thirdparty_seller->tva_assuj) && !$thirdparty_seller->tva_assuj) || (!is_numeric($thirdparty_seller->tva_assuj) && $thirdparty_seller->tva_assuj == 'franchise')) ? 0 : 1; |
@@ -4935,7 +4935,7 @@ discard block |
||
| 4935 | 4935 | $buyer_country_code = $thirdparty_buyer->country_code; |
| 4936 | 4936 | $buyer_in_cee = isInEEC($thirdparty_buyer); |
| 4937 | 4937 | |
| 4938 | - DolUtils::dol_syslog("get_default_tva: seller use vat=" . $seller_use_vat . ", seller country=" . $seller_country_code . ", seller in cee=" . $seller_in_cee . ", buyer vat number=" . $thirdparty_buyer->tva_intra . " buyer country=" . $buyer_country_code . ", buyer in cee=" . $buyer_in_cee . ", idprod=" . $idprod . ", idprodfournprice=" . $idprodfournprice . ", SERVICE_ARE_ECOMMERCE_200238EC=" . (!empty(Globals::$conf->global->SERVICES_ARE_ECOMMERCE_200238EC) ? Globals::$conf->global->SERVICES_ARE_ECOMMERCE_200238EC : ''));
|
|
| 4938 | + DolUtils::dol_syslog("get_default_tva: seller use vat=".$seller_use_vat.", seller country=".$seller_country_code.", seller in cee=".$seller_in_cee.", buyer vat number=".$thirdparty_buyer->tva_intra." buyer country=".$buyer_country_code.", buyer in cee=".$buyer_in_cee.", idprod=".$idprod.", idprodfournprice=".$idprodfournprice.", SERVICE_ARE_ECOMMERCE_200238EC=".(!empty(Globals::$conf->global->SERVICES_ARE_ECOMMERCE_200238EC) ? Globals::$conf->global->SERVICES_ARE_ECOMMERCE_200238EC : ''));
|
|
| 4939 | 4939 | |
| 4940 | 4940 | // If services are eServices according to EU Council Directive 2002/38/EC (http://ec.europa.eu/taxation_customs/taxation/vat/traders/e-commerce/article_1610_en.htm) |
| 4941 | 4941 | // we use the buyer VAT. |
@@ -5001,14 +5001,14 @@ discard block |
||
| 5001 | 5001 | |
| 5002 | 5002 | if ($idprodfournprice > 0) {
|
| 5003 | 5003 | if (!class_exists('ProductFournisseur'))
|
| 5004 | - require_once DOL_BASE_PATH . '/fourn/class/fournisseur.product.class.php'; |
|
| 5004 | + require_once DOL_BASE_PATH.'/fourn/class/fournisseur.product.class.php'; |
|
| 5005 | 5005 | $prodprice = new ProductFournisseur($db); |
| 5006 | 5006 | $prodprice->fetch_product_fournisseur_price($idprodfournprice); |
| 5007 | 5007 | return $prodprice->fourn_tva_npr; |
| 5008 | 5008 | } |
| 5009 | 5009 | elseif ($idprod > 0) {
|
| 5010 | 5010 | if (!class_exists('Product'))
|
| 5011 | - require_once DOL_BASE_PATH . 'product/class/product.class.php'; |
|
| 5011 | + require_once DOL_BASE_PATH.'product/class/product.class.php'; |
|
| 5012 | 5012 | $prod = new Product($db); |
| 5013 | 5013 | $prod->fetch($idprod); |
| 5014 | 5014 | return $prod->tva_npr; |
@@ -5087,7 +5087,7 @@ discard block |
||
| 5087 | 5087 | if ($case == 2) |
| 5088 | 5088 | $result = '<input type="checkbox" value="1" checked disabled>'; |
| 5089 | 5089 | if ($case == 3) |
| 5090 | - $result = '<input type="checkbox" value="1" checked disabled> ' . $result; |
|
| 5090 | + $result = '<input type="checkbox" value="1" checked disabled> '.$result; |
|
| 5091 | 5091 | |
| 5092 | 5092 | $classname = 'ok'; |
| 5093 | 5093 | } |
@@ -5098,7 +5098,7 @@ discard block |
||
| 5098 | 5098 | if ($case == 2) |
| 5099 | 5099 | $result = '<input type="checkbox" value="0" disabled>'; |
| 5100 | 5100 | if ($case == 3) |
| 5101 | - $result = '<input type="checkbox" value="0" disabled> ' . $result; |
|
| 5101 | + $result = '<input type="checkbox" value="0" disabled> '.$result; |
|
| 5102 | 5102 | |
| 5103 | 5103 | if ($color == 2) |
| 5104 | 5104 | $classname = 'ok'; |
@@ -5106,7 +5106,7 @@ discard block |
||
| 5106 | 5106 | $classname = 'error'; |
| 5107 | 5107 | } |
| 5108 | 5108 | if ($color) |
| 5109 | - return '<font class="' . $classname . '">' . $result . '</font>'; |
|
| 5109 | + return '<font class="'.$classname.'">'.$result.'</font>'; |
|
| 5110 | 5110 | return $result; |
| 5111 | 5111 | } |
| 5112 | 5112 | |
@@ -5140,13 +5140,13 @@ discard block |
||
| 5140 | 5140 | $num = preg_replace('/([^0-9])/i', '', $num);
|
| 5141 | 5141 | else |
| 5142 | 5142 | $num = preg_replace('/^.*\-/i', '', $num);
|
| 5143 | - $num = substr("000" . $num, -$level);
|
|
| 5143 | + $num = substr("000".$num, -$level);
|
|
| 5144 | 5144 | if ($level == 1) |
| 5145 | 5145 | $path = substr($num, 0, 1); |
| 5146 | 5146 | if ($level == 2) |
| 5147 | - $path = substr($num, 1, 1) . '/' . substr($num, 0, 1); |
|
| 5147 | + $path = substr($num, 1, 1).'/'.substr($num, 0, 1); |
|
| 5148 | 5148 | if ($level == 3) |
| 5149 | - $path = substr($num, 2, 1) . '/' . substr($num, 1, 1) . '/' . substr($num, 0, 1); |
|
| 5149 | + $path = substr($num, 2, 1).'/'.substr($num, 1, 1).'/'.substr($num, 0, 1); |
|
| 5150 | 5150 | } |
| 5151 | 5151 | else {
|
| 5152 | 5152 | // TODO |
@@ -5177,7 +5177,7 @@ discard block |
||
| 5177 | 5177 | {
|
| 5178 | 5178 | // global Globals::$conf; |
| 5179 | 5179 | |
| 5180 | - DolUtils::dol_syslog("functions.lib::dol_mkdir: dir=" . $dir, LOG_INFO);
|
|
| 5180 | + DolUtils::dol_syslog("functions.lib::dol_mkdir: dir=".$dir, LOG_INFO);
|
|
| 5181 | 5181 | |
| 5182 | 5182 | $dir_osencoded = dol_osencode($dir); |
| 5183 | 5183 | if (@is_dir($dir_osencoded)) |
@@ -5189,15 +5189,15 @@ discard block |
||
| 5189 | 5189 | $ccdir = ''; |
| 5190 | 5190 | if (!empty($dataroot)) {
|
| 5191 | 5191 | // Remove data root from loop |
| 5192 | - $dir = str_replace($dataroot . '/', '', $dir); |
|
| 5193 | - $ccdir = $dataroot . '/'; |
|
| 5192 | + $dir = str_replace($dataroot.'/', '', $dir); |
|
| 5193 | + $ccdir = $dataroot.'/'; |
|
| 5194 | 5194 | } |
| 5195 | 5195 | |
| 5196 | 5196 | $cdir = explode("/", $dir);
|
| 5197 | 5197 | $num = count($cdir); |
| 5198 | 5198 | for ($i = 0; $i < $num; $i++) {
|
| 5199 | 5199 | if ($i > 0) |
| 5200 | - $ccdir .= '/' . $cdir[$i]; |
|
| 5200 | + $ccdir .= '/'.$cdir[$i]; |
|
| 5201 | 5201 | else |
| 5202 | 5202 | $ccdir .= $cdir[$i]; |
| 5203 | 5203 | if (preg_match("/^.:$/", $ccdir, $regs))
|
@@ -5241,20 +5241,20 @@ discard block |
||
| 5241 | 5241 | if ($ccdir) {
|
| 5242 | 5242 | $ccdir_osencoded = dol_osencode($ccdir); |
| 5243 | 5243 | if (!@is_dir($ccdir_osencoded)) {
|
| 5244 | - DolUtils::dol_syslog("functions.lib::dol_mkdir: Directory '" . $ccdir . "' does not exists or is outside open_basedir PHP setting.", LOG_DEBUG);
|
|
| 5244 | + DolUtils::dol_syslog("functions.lib::dol_mkdir: Directory '".$ccdir."' does not exists or is outside open_basedir PHP setting.", LOG_DEBUG);
|
|
| 5245 | 5245 | |
| 5246 | 5246 | umask(0); |
| 5247 | 5247 | $dirmaskdec = octdec($newmask); |
| 5248 | 5248 | if (empty($newmask)) {
|
| 5249 | 5249 | $dirmaskdec = empty(Globals::$conf->global->MAIN_UMASK) ? octdec('0755') : octdec(Globals::$conf->global->MAIN_UMASK);
|
| 5250 | 5250 | } |
| 5251 | - $dirmaskdec |= octdec('0111'); // Set x bit required for directories
|
|
| 5251 | + $dirmaskdec |= octdec('0111'); // Set x bit required for directories
|
|
| 5252 | 5252 | if (!@mkdir($ccdir_osencoded, $dirmaskdec)) {
|
| 5253 | 5253 | // Si le is_dir a renvoye une fausse info, alors on passe ici. |
| 5254 | - DolUtils::dol_syslog("functions.lib::dol_mkdir: Fails to create directory '" . $ccdir . "' or directory already exists.", LOG_WARNING);
|
|
| 5254 | + DolUtils::dol_syslog("functions.lib::dol_mkdir: Fails to create directory '".$ccdir."' or directory already exists.", LOG_WARNING);
|
|
| 5255 | 5255 | $nberr++; |
| 5256 | 5256 | } else {
|
| 5257 | - DolUtils::dol_syslog("functions.lib::dol_mkdir: Directory '" . $ccdir . "' created", LOG_DEBUG);
|
|
| 5257 | + DolUtils::dol_syslog("functions.lib::dol_mkdir: Directory '".$ccdir."' created", LOG_DEBUG);
|
|
| 5258 | 5258 | $nberr = 0; // On remet a zero car si on arrive ici, cela veut dire que les echecs precedents peuvent etre ignore |
| 5259 | 5259 | $nbcreated++; |
| 5260 | 5260 | } |
@@ -5302,9 +5302,9 @@ discard block |
||
| 5302 | 5302 | } else {
|
| 5303 | 5303 | $pattern = "/<[^<>]+>/"; |
| 5304 | 5304 | // Exemple of $temp: <a href="/myurl" title="<u>A title</u>">0000-021</a> |
| 5305 | - $temp = preg_replace($pattern, "", $temp); // pass 1 |
|
| 5305 | + $temp = preg_replace($pattern, "", $temp); // pass 1 |
|
| 5306 | 5306 | // $temp after pass 1: <a href="/myurl" title="A title">0000-021 |
| 5307 | - $temp = preg_replace($pattern, "", $temp); // pass 2 |
|
| 5307 | + $temp = preg_replace($pattern, "", $temp); // pass 2 |
|
| 5308 | 5308 | // $temp after pass 2: 0000-021 |
| 5309 | 5309 | } |
| 5310 | 5310 | |
@@ -5360,8 +5360,8 @@ discard block |
||
| 5360 | 5360 | {
|
| 5361 | 5361 | $temp = $stringtoclean; |
| 5362 | 5362 | foreach ($disallowed_tags as $tagtoremove) {
|
| 5363 | - $temp = preg_replace('/<\/?' . $tagtoremove . '>/', '', $temp);
|
|
| 5364 | - $temp = preg_replace('/<\/?' . $tagtoremove . '\s+[^>]*>/', '', $temp);
|
|
| 5363 | + $temp = preg_replace('/<\/?'.$tagtoremove.'>/', '', $temp);
|
|
| 5364 | + $temp = preg_replace('/<\/?'.$tagtoremove.'\s+[^>]*>/', '', $temp);
|
|
| 5365 | 5365 | } |
| 5366 | 5366 | return $temp; |
| 5367 | 5367 | } |
@@ -5378,12 +5378,12 @@ discard block |
||
| 5378 | 5378 | {
|
| 5379 | 5379 | if ($nboflines == 1) {
|
| 5380 | 5380 | if (dol_textishtml($text)) {
|
| 5381 | - $firstline = preg_replace('/<br[^>]*>.*$/s', '', $text); // The s pattern modifier means the . can match newline characters
|
|
| 5381 | + $firstline = preg_replace('/<br[^>]*>.*$/s', '', $text); // The s pattern modifier means the . can match newline characters
|
|
| 5382 | 5382 | $firstline = preg_replace('/<div[^>]*>.*$/s', '', $firstline); // The s pattern modifier means the . can match newline characters
|
| 5383 | 5383 | } else {
|
| 5384 | 5384 | $firstline = preg_replace('/[\n\r].*/', '', $text);
|
| 5385 | 5385 | } |
| 5386 | - return $firstline . ((strlen($firstline) != strlen($text)) ? '...' : ''); |
|
| 5386 | + return $firstline.((strlen($firstline) != strlen($text)) ? '...' : ''); |
|
| 5387 | 5387 | } else {
|
| 5388 | 5388 | $ishtml = 0; |
| 5389 | 5389 | if (dol_textishtml($text)) {
|
@@ -5399,7 +5399,7 @@ discard block |
||
| 5399 | 5399 | $pattern = '/(<br[^>]*>)/Uu'; |
| 5400 | 5400 | } // /U is to have UNGREEDY regex to limit to one html tag. /u is for UTF8 support |
| 5401 | 5401 | else |
| 5402 | - $pattern = '/(<br[^>]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag. |
|
| 5402 | + $pattern = '/(<br[^>]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag. |
|
| 5403 | 5403 | $a = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); |
| 5404 | 5404 | |
| 5405 | 5405 | $firstline = ''; |
@@ -5413,7 +5413,7 @@ discard block |
||
| 5413 | 5413 | $i++; |
| 5414 | 5414 | } |
| 5415 | 5415 | unset($a); |
| 5416 | - return $firstline . (($i < $nba) ? '...' : ''); |
|
| 5416 | + return $firstline.(($i < $nba) ? '...' : ''); |
|
| 5417 | 5417 | } |
| 5418 | 5418 | } |
| 5419 | 5419 | |
@@ -5484,9 +5484,9 @@ discard block |
||
| 5484 | 5484 | static function dol_htmlentitiesbr_decode($stringtodecode, $pagecodeto = 'UTF-8') |
| 5485 | 5485 | {
|
| 5486 | 5486 | $ret = dol_html_entity_decode($stringtodecode, ENT_COMPAT, $pagecodeto); |
| 5487 | - $ret = preg_replace('/' . "\r\n" . '<br(\s[\sa-zA-Z_="]*)?\/?>/i', "<br>", $ret);
|
|
| 5488 | - $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>' . "\r\n" . '/i', "\r\n", $ret);
|
|
| 5489 | - $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>' . "\n" . '/i', "\n", $ret);
|
|
| 5487 | + $ret = preg_replace('/'."\r\n".'<br(\s[\sa-zA-Z_="]*)?\/?>/i', "<br>", $ret);
|
|
| 5488 | + $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>'."\r\n".'/i', "\r\n", $ret);
|
|
| 5489 | + $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>'."\n".'/i', "\n", $ret);
|
|
| 5490 | 5490 | $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>/i', "\n", $ret);
|
| 5491 | 5491 | return $ret; |
| 5492 | 5492 | } |
@@ -5499,7 +5499,7 @@ discard block |
||
| 5499 | 5499 | */ |
| 5500 | 5500 | static function dol_htmlcleanlastbr($stringtodecode) |
| 5501 | 5501 | {
|
| 5502 | - $ret = preg_replace('/(<br>|<br(\s[\sa-zA-Z_="]*)?\/?>|' . "\n" . '|' . "\r" . ')+$/i', "", $stringtodecode);
|
|
| 5502 | + $ret = preg_replace('/(<br>|<br(\s[\sa-zA-Z_="]*)?\/?>|'."\n".'|'."\r".')+$/i', "", $stringtodecode);
|
|
| 5503 | 5503 | return $ret; |
| 5504 | 5504 | } |
| 5505 | 5505 | |
@@ -5596,7 +5596,7 @@ discard block |
||
| 5596 | 5596 | $pattern = '/(<br[^>]*>)/Uu'; |
| 5597 | 5597 | } // /U is to have UNGREEDY regex to limit to one html tag. /u is for UTF8 support |
| 5598 | 5598 | else |
| 5599 | - $pattern = '/(<br[^>]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag. |
|
| 5599 | + $pattern = '/(<br[^>]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag. |
|
| 5600 | 5600 | $a = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); |
| 5601 | 5601 | |
| 5602 | 5602 | $nblines = (int) floor((count($a) + 1) / 2); |
@@ -5627,7 +5627,7 @@ discard block |
||
| 5627 | 5627 | */ |
| 5628 | 5628 | static function dol_microtime_float() |
| 5629 | 5629 | {
|
| 5630 | - DolUtils::dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); |
|
| 5630 | + DolUtils::dol_syslog(__FUNCTION__." is deprecated", LOG_WARNING); |
|
| 5631 | 5631 | |
| 5632 | 5632 | return microtime(true); |
| 5633 | 5633 | } |
@@ -5673,9 +5673,9 @@ discard block |
||
| 5673 | 5673 | elseif (preg_match('/<h[0-9]>/i', $msg))
|
| 5674 | 5674 | return true; |
| 5675 | 5675 | elseif (preg_match('/&[A-Z0-9]{1,6};/i', $msg))
|
| 5676 | - return true; // Html entities names (http://www.w3schools.com/tags/ref_entities.asp) |
|
| 5676 | + return true; // Html entities names (http://www.w3schools.com/tags/ref_entities.asp) |
|
| 5677 | 5677 | elseif (preg_match('/&#[0-9]{2,3};/i', $msg))
|
| 5678 | - return true; // Html entities numbers (http://www.w3schools.com/tags/ref_entities.asp) |
|
| 5678 | + return true; // Html entities numbers (http://www.w3schools.com/tags/ref_entities.asp) |
|
| 5679 | 5679 | |
| 5680 | 5680 | return false; |
| 5681 | 5681 | } |
@@ -5900,7 +5900,7 @@ discard block |
||
| 5900 | 5900 | if ($object->fetch_optionals() > 0) {
|
| 5901 | 5901 | if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) {
|
| 5902 | 5902 | foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) {
|
| 5903 | - $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = $object->array_options['options_' . $key]; |
|
| 5903 | + $substitutionarray['__EXTRAFIELD_'.strtoupper($key).'__'] = $object->array_options['options_'.$key]; |
|
| 5904 | 5904 | } |
| 5905 | 5905 | } |
| 5906 | 5906 | } |
@@ -5912,7 +5912,7 @@ discard block |
||
| 5912 | 5912 | $paymenturl = ''; |
| 5913 | 5913 | } else {
|
| 5914 | 5914 | // Set the online payment url link into __ONLINE_PAYMENT_URL__ key |
| 5915 | - require_once DOL_BASE_PATH . '/core/lib/payments.lib.php'; |
|
| 5915 | + require_once DOL_BASE_PATH.'/core/lib/payments.lib.php'; |
|
| 5916 | 5916 | $outputlangs->loadLangs(array('paypal', 'other'));
|
| 5917 | 5917 | $typeforonlinepayment = 'free'; |
| 5918 | 5918 | if (is_object($object) && $object->element == 'commande') |
@@ -5973,7 +5973,7 @@ discard block |
||
| 5973 | 5973 | |
| 5974 | 5974 | //var_dump($substitutionarray['__AMOUNT_FORMATED__']); |
| 5975 | 5975 | if (empty($exclude) || !in_array('date', $exclude)) {
|
| 5976 | - include_once DOL_BASE_PATH . '/core/lib/date.lib.php'; |
|
| 5976 | + include_once DOL_BASE_PATH.'/core/lib/date.lib.php'; |
|
| 5977 | 5977 | |
| 5978 | 5978 | $tmp = dol_getdate(dol_now(), true); |
| 5979 | 5979 | $tmp2 = dol_get_prev_day($tmp['mday'], $tmp['mon'], $tmp['year']); |
@@ -5983,13 +5983,13 @@ discard block |
||
| 5983 | 5983 | |
| 5984 | 5984 | $substitutionarray = array_merge($substitutionarray, array( |
| 5985 | 5985 | '__DAY__' => (string) $tmp['mday'], |
| 5986 | - '__DAY_TEXT__' => $outputlangs->trans('Day' . $tmp['wday']), // Monday
|
|
| 5987 | - '__DAY_TEXT_SHORT__' => $outputlangs->trans($tmp['weekday'] . 'Min'), // Mon |
|
| 5988 | - '__DAY_TEXT_MIN__' => $outputlangs->trans('Short' . $tmp['weekday']), // M
|
|
| 5986 | + '__DAY_TEXT__' => $outputlangs->trans('Day'.$tmp['wday']), // Monday
|
|
| 5987 | + '__DAY_TEXT_SHORT__' => $outputlangs->trans($tmp['weekday'].'Min'), // Mon |
|
| 5988 | + '__DAY_TEXT_MIN__' => $outputlangs->trans('Short'.$tmp['weekday']), // M
|
|
| 5989 | 5989 | '__MONTH__' => (string) $tmp['mon'], |
| 5990 | - '__MONTH_TEXT__' => $outputlangs->trans('Month' . sprintf("%02d", $tmp['mon'])),
|
|
| 5991 | - '__MONTH_TEXT_SHORT__' => $outputlangs->trans('MonthShort' . sprintf("%02d", $tmp['mon'])),
|
|
| 5992 | - '__MONTH_TEXT_MIN__' => $outputlangs->trans('MonthVeryShort' . sprintf("%02d", $tmp['mon'])),
|
|
| 5990 | + '__MONTH_TEXT__' => $outputlangs->trans('Month'.sprintf("%02d", $tmp['mon'])),
|
|
| 5991 | + '__MONTH_TEXT_SHORT__' => $outputlangs->trans('MonthShort'.sprintf("%02d", $tmp['mon'])),
|
|
| 5992 | + '__MONTH_TEXT_MIN__' => $outputlangs->trans('MonthVeryShort'.sprintf("%02d", $tmp['mon'])),
|
|
| 5993 | 5993 | '__YEAR__' => (string) $tmp['year'], |
| 5994 | 5994 | '__PREVIOUS_DAY__' => (string) $tmp2['day'], |
| 5995 | 5995 | '__PREVIOUS_MONTH__' => (string) $tmp3['month'], |
@@ -6048,7 +6048,7 @@ discard block |
||
| 6048 | 6048 | if (!empty($tmp[1])) |
| 6049 | 6049 | $outputlangs->load($tmp[1]); |
| 6050 | 6050 | |
| 6051 | - $text = preg_replace('/__\(' . preg_quote($reg[1], '/') . '\)__/', $msgishtml ? dol_htmlentitiesbr($outputlangs->transnoentitiesnoconv($reg[1])) : $outputlangs->transnoentitiesnoconv($reg[1]), $text);
|
|
| 6051 | + $text = preg_replace('/__\('.preg_quote($reg[1], '/').'\)__/', $msgishtml ? dol_htmlentitiesbr($outputlangs->transnoentitiesnoconv($reg[1])) : $outputlangs->transnoentitiesnoconv($reg[1]), $text);
|
|
| 6052 | 6052 | } |
| 6053 | 6053 | } |
| 6054 | 6054 | |
@@ -6064,13 +6064,13 @@ discard block |
||
| 6064 | 6064 | $newval = '*****forbidden*****'; |
| 6065 | 6065 | else |
| 6066 | 6066 | $newval = empty(Globals::$conf->global->$keyfound) ? '' : Globals::$conf->global->$keyfound; |
| 6067 | - $text = preg_replace('/__\[' . preg_quote($keyfound, '/') . '\]__/', $msgishtml ? dol_htmlentitiesbr($newval) : $newval, $text);
|
|
| 6067 | + $text = preg_replace('/__\['.preg_quote($keyfound, '/').'\]__/', $msgishtml ? dol_htmlentitiesbr($newval) : $newval, $text);
|
|
| 6068 | 6068 | } |
| 6069 | 6069 | |
| 6070 | 6070 | // Make substitition for array $substitutionarray |
| 6071 | 6071 | foreach ($substitutionarray as $key => $value) {
|
| 6072 | 6072 | if ($key == '__SIGNATURE__' && (!empty(Globals::$conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))) |
| 6073 | - $value = ''; // Protection |
|
| 6073 | + $value = ''; // Protection |
|
| 6074 | 6074 | if ($key == '__USER_SIGNATURE__' && (!empty(Globals::$conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))) |
| 6075 | 6075 | $value = ''; // Protection |
| 6076 | 6076 | |
@@ -6096,7 +6096,7 @@ discard block |
||
| 6096 | 6096 | {
|
| 6097 | 6097 | // global Globals::$conf, $user; |
| 6098 | 6098 | |
| 6099 | - require_once DOL_BASE_PATH . '/core/lib/files.lib.php'; |
|
| 6099 | + require_once DOL_BASE_PATH.'/core/lib/files.lib.php'; |
|
| 6100 | 6100 | |
| 6101 | 6101 | // Add a substitution key for each extrafields, using key __EXTRA_XXX__ |
| 6102 | 6102 | // TODO Remove this. Already available into the getCommonSubstitutionArray used to build the substitution array. |
@@ -6126,11 +6126,11 @@ discard block |
||
| 6126 | 6126 | if (preg_match('/functions_(.*)\.lib\.php/i', $substitfile['name'], $reg)) {
|
| 6127 | 6127 | $module = $reg[1]; |
| 6128 | 6128 | |
| 6129 | - DolUtils::dol_syslog("Library " . $substitfile['name'] . " found into " . $dir);
|
|
| 6129 | + DolUtils::dol_syslog("Library ".$substitfile['name']." found into ".$dir);
|
|
| 6130 | 6130 | // Include the user's functions file |
| 6131 | - require_once $dir . $substitfile['name']; |
|
| 6131 | + require_once $dir.$substitfile['name']; |
|
| 6132 | 6132 | // Call the user's function, and only if it is defined |
| 6133 | - $function_name = $module . "_" . $callfunc; |
|
| 6133 | + $function_name = $module."_".$callfunc; |
|
| 6134 | 6134 | if (function_exists($function_name)) |
| 6135 | 6135 | $function_name($substitutionarray, $outputlangs, $object, $parameters); |
| 6136 | 6136 | } |
@@ -6172,13 +6172,13 @@ discard block |
||
| 6172 | 6172 | $outputlangs = Globals::$langs; |
| 6173 | 6173 | |
| 6174 | 6174 | if ($date_start && $date_end) {
|
| 6175 | - $out .= ($withparenthesis ? ' (' : '') . $outputlangs->transnoentitiesnoconv('DateFromTo', dol_print_date($date_start, $format, false, $outputlangs), dol_print_date($date_end, $format, false, $outputlangs)) . ($withparenthesis ? ')' : '');
|
|
| 6175 | + $out .= ($withparenthesis ? ' (' : '').$outputlangs->transnoentitiesnoconv('DateFromTo', dol_print_date($date_start, $format, false, $outputlangs), dol_print_date($date_end, $format, false, $outputlangs)).($withparenthesis ? ')' : '');
|
|
| 6176 | 6176 | } |
| 6177 | 6177 | if ($date_start && !$date_end) {
|
| 6178 | - $out .= ($withparenthesis ? ' (' : '') . $outputlangs->transnoentitiesnoconv('DateFrom', dol_print_date($date_start, $format, false, $outputlangs)) . ($withparenthesis ? ')' : '');
|
|
| 6178 | + $out .= ($withparenthesis ? ' (' : '').$outputlangs->transnoentitiesnoconv('DateFrom', dol_print_date($date_start, $format, false, $outputlangs)).($withparenthesis ? ')' : '');
|
|
| 6179 | 6179 | } |
| 6180 | 6180 | if (!$date_start && $date_end) {
|
| 6181 | - $out .= ($withparenthesis ? ' (' : '') . $outputlangs->transnoentitiesnoconv('DateUntil', dol_print_date($date_end, $format, false, $outputlangs)) . ($withparenthesis ? ')' : '');
|
|
| 6181 | + $out .= ($withparenthesis ? ' (' : '').$outputlangs->transnoentitiesnoconv('DateUntil', dol_print_date($date_end, $format, false, $outputlangs)).($withparenthesis ? ')' : '');
|
|
| 6182 | 6182 | } |
| 6183 | 6183 | |
| 6184 | 6184 | return $out; |
@@ -6258,7 +6258,7 @@ discard block |
||
| 6258 | 6258 | DolUtils::dol_syslog("Try to add a message in stack with empty message", LOG_WARNING);
|
| 6259 | 6259 | } else {
|
| 6260 | 6260 | if (!in_array((string) $style, array('mesgs', 'warnings', 'errors')))
|
| 6261 | - dol_print_error('', 'Bad parameter style=' . $style . ' for setEventMessages');
|
|
| 6261 | + dol_print_error('', 'Bad parameter style='.$style.' for setEventMessages');
|
|
| 6262 | 6262 | if (empty($mesgs)) |
| 6263 | 6263 | setEventMessage($mesg, $style); |
| 6264 | 6264 | else {
|
@@ -6327,7 +6327,7 @@ discard block |
||
| 6327 | 6327 | |
| 6328 | 6328 | // If inline message with no format, we add it. |
| 6329 | 6329 | if ((empty(Globals::$conf->use_javascript_ajax) || !empty(Globals::$conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) || $keepembedded) && !preg_match('/<div class=".*">/i', $out)) {
|
| 6330 | - $divstart = '<div class="' . $style . ' clearboth">'; |
|
| 6330 | + $divstart = '<div class="'.$style.' clearboth">'; |
|
| 6331 | 6331 | $divend = '</div>'; |
| 6332 | 6332 | } |
| 6333 | 6333 | |
@@ -6354,14 +6354,14 @@ discard block |
||
| 6354 | 6354 | if (!empty(Globals::$conf->use_javascript_ajax) && empty(Globals::$conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && empty($keepembedded)) {
|
| 6355 | 6355 | $return = '<script type="text/javascript"> |
| 6356 | 6356 | $(document).ready(function() {
|
| 6357 | - var block = ' . (!empty(Globals::$conf->global->MAIN_USE_JQUERY_BLOCKUI) ? "true" : "false") . ' |
|
| 6357 | + var block = ' . (!empty(Globals::$conf->global->MAIN_USE_JQUERY_BLOCKUI) ? "true" : "false").' |
|
| 6358 | 6358 | if (block) {
|
| 6359 | - $.dolEventValid("","' . dol_escape_js($out) . '");
|
|
| 6359 | + $.dolEventValid("","' . dol_escape_js($out).'");
|
|
| 6360 | 6360 | } else {
|
| 6361 | 6361 | /* jnotify(message, preset of message type, keepmessage) */ |
| 6362 | - $.jnotify("' . dol_escape_js($out) . '",
|
|
| 6363 | - "' . ($style == "ok" ? 3000 : $style) . '", |
|
| 6364 | - ' . ($style == "ok" ? "false" : "true") . ', |
|
| 6362 | + $.jnotify("' . dol_escape_js($out).'",
|
|
| 6363 | + "' . ($style == "ok" ? 3000 : $style).'", |
|
| 6364 | + ' . ($style == "ok" ? "false" : "true").', |
|
| 6365 | 6365 | { remove: static function (){} } );
|
| 6366 | 6366 | } |
| 6367 | 6367 | }); |
@@ -6556,11 +6556,11 @@ discard block |
||
| 6556 | 6556 | {
|
| 6557 | 6557 | // global Globals::$conf; |
| 6558 | 6558 | |
| 6559 | - $tmp = ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
|
|
| 6559 | + $tmp = ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
|
|
| 6560 | 6560 | if (empty($tmp) && !empty($_SERVER["WINDIR"])) |
| 6561 | 6561 | $tmp = 'iso-8859-1'; // By default for windows |
| 6562 | 6562 | if (empty($tmp)) |
| 6563 | - $tmp = 'utf-8'; // By default for other |
|
| 6563 | + $tmp = 'utf-8'; // By default for other |
|
| 6564 | 6564 | if (!empty(Globals::$conf->global->MAIN_FILESYSTEM_ENCODING)) |
| 6565 | 6565 | $tmp = Globals::$conf->global->MAIN_FILESYSTEM_ENCODING; |
| 6566 | 6566 | |
@@ -6591,16 +6591,16 @@ discard block |
||
| 6591 | 6591 | |
| 6592 | 6592 | // Check in cache |
| 6593 | 6593 | if (isset($cache_codes[$tablename][$key][$fieldid])) { // Can be defined to 0 or ''
|
| 6594 | - return $cache_codes[$tablename][$key][$fieldid]; // Found in cache |
|
| 6594 | + return $cache_codes[$tablename][$key][$fieldid]; // Found in cache |
|
| 6595 | 6595 | } |
| 6596 | 6596 | |
| 6597 | 6597 | DolUtils::dol_syslog('dol_getIdFromCode (value not found into cache)', LOG_DEBUG);
|
| 6598 | 6598 | |
| 6599 | - $sql = "SELECT " . $fieldid . " as valuetoget"; |
|
| 6600 | - $sql .= " FROM " . MAIN_DB_PREFIX . $tablename; |
|
| 6601 | - $sql .= " WHERE " . $fieldkey . " = '" . $db->escape($key) . "'"; |
|
| 6599 | + $sql = "SELECT ".$fieldid." as valuetoget"; |
|
| 6600 | + $sql .= " FROM ".MAIN_DB_PREFIX.$tablename; |
|
| 6601 | + $sql .= " WHERE ".$fieldkey." = '".$db->escape($key)."'"; |
|
| 6602 | 6602 | if (!empty($entityfilter)) |
| 6603 | - $sql .= " AND entity IN (" . getEntity($tablename) . ")";
|
|
| 6603 | + $sql .= " AND entity IN (".getEntity($tablename).")";
|
|
| 6604 | 6604 | |
| 6605 | 6605 | $resql = $db->query($sql); |
| 6606 | 6606 | if ($resql) {
|
@@ -6631,8 +6631,8 @@ discard block |
||
| 6631 | 6631 | //print $strRights."<br>\n"; |
| 6632 | 6632 | $rights = true; |
| 6633 | 6633 | if ($strRights != '') {
|
| 6634 | - $str = 'if(!(' . $strRights . ')) { $rights = false; }';
|
|
| 6635 | - self::dol_eval($str); // The dol_eval must contains all the// global $xxx used into a condition |
|
| 6634 | + $str = 'if(!('.$strRights.')) { $rights = false; }';
|
|
| 6635 | + self::dol_eval($str); // The dol_eval must contains all the// global $xxx used into a condition |
|
| 6636 | 6636 | } |
| 6637 | 6637 | return $rights; |
| 6638 | 6638 | } |
@@ -6659,9 +6659,9 @@ discard block |
||
| 6659 | 6659 | //print $s."<br>\n"; |
| 6660 | 6660 | if ($returnvalue) {
|
| 6661 | 6661 | if ($hideerrors) |
| 6662 | - return @eval('return ' . $s . ';');
|
|
| 6662 | + return @eval('return '.$s.';');
|
|
| 6663 | 6663 | else |
| 6664 | - return eval('return ' . $s . ';');
|
|
| 6664 | + return eval('return '.$s.';');
|
|
| 6665 | 6665 | } |
| 6666 | 6666 | else {
|
| 6667 | 6667 | if ($hideerrors) |
@@ -6715,7 +6715,7 @@ discard block |
||
| 6715 | 6715 | $flagImage = empty($tmparray[1]) ? $tmparray[0] : $tmparray[1]; |
| 6716 | 6716 | } |
| 6717 | 6717 | |
| 6718 | - return img_picto_common($codelang, 'flags/' . strtolower($flagImage) . '.png', $moreatt); |
|
| 6718 | + return img_picto_common($codelang, 'flags/'.strtolower($flagImage).'.png', $moreatt); |
|
| 6719 | 6719 | } |
| 6720 | 6720 | |
| 6721 | 6721 | /** |
@@ -6913,16 +6913,16 @@ discard block |
||
| 6913 | 6913 | 'zu-ZA', |
| 6914 | 6914 | ); |
| 6915 | 6915 | |
| 6916 | - $buildprimarykeytotest = strtolower($countrycode) . '-' . strtoupper($countrycode); |
|
| 6916 | + $buildprimarykeytotest = strtolower($countrycode).'-'.strtoupper($countrycode); |
|
| 6917 | 6917 | if (in_array($buildprimarykeytotest, $locales)) |
| 6918 | - return strtolower($countrycode) . '_' . strtoupper($countrycode); |
|
| 6918 | + return strtolower($countrycode).'_'.strtoupper($countrycode); |
|
| 6919 | 6919 | |
| 6920 | 6920 | foreach ($locales as $locale) {
|
| 6921 | 6921 | $locale_language = locale_get_primary_language($locale); |
| 6922 | 6922 | $locale_region = locale_get_region($locale); |
| 6923 | 6923 | if (strtoupper($countrycode) == $locale_region) {
|
| 6924 | 6924 | //var_dump($locale.'-'.$locale_language.'-'.$locale_region); |
| 6925 | - return strtolower($locale_language) . '_' . strtoupper($locale_region); |
|
| 6925 | + return strtolower($locale_language).'_'.strtoupper($locale_region); |
|
| 6926 | 6926 | } |
| 6927 | 6927 | } |
| 6928 | 6928 | |
@@ -6983,7 +6983,7 @@ discard block |
||
| 6983 | 6983 | $label = Globals::$langs->trans($values[2]); |
| 6984 | 6984 | |
| 6985 | 6985 | //$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && !empty($object->id)) ? $object->id : ''), $values[5]), 1);
|
| 6986 | - $head[$h][0] = BASE_URI . preg_replace('/__ID__/i', ((is_object($object) && !empty($object->id)) ? $object->id : ''), $values[5]);
|
|
| 6986 | + $head[$h][0] = BASE_URI.preg_replace('/__ID__/i', ((is_object($object) && !empty($object->id)) ? $object->id : ''), $values[5]);
|
|
| 6987 | 6987 | $head[$h][1] = $label; |
| 6988 | 6988 | $head[$h][2] = str_replace('+', '', $values[1]);
|
| 6989 | 6989 | $h++; |
@@ -7054,43 +7054,43 @@ discard block |
||
| 7054 | 7054 | // global $micro_start_time; |
| 7055 | 7055 | |
| 7056 | 7056 | if ($zone == 'private') |
| 7057 | - print "\n" . '<!-- Common footer for private page -->' . "\n"; |
|
| 7057 | + print "\n".'<!-- Common footer for private page -->'."\n"; |
|
| 7058 | 7058 | else |
| 7059 | - print "\n" . '<!-- Common footer for public page -->' . "\n"; |
|
| 7059 | + print "\n".'<!-- Common footer for public page -->'."\n"; |
|
| 7060 | 7060 | |
| 7061 | 7061 | // A div to store page_y POST parameter so we can read it using javascript |
| 7062 | 7062 | print "\n<!-- A div to store page_y POST paramater -->\n"; |
| 7063 | - print '<div id="page_y" style="display: none;">' . $_POST['page_y'] . '</div>' . "\n"; |
|
| 7063 | + print '<div id="page_y" style="display: none;">'.$_POST['page_y'].'</div>'."\n"; |
|
| 7064 | 7064 | |
| 7065 | 7065 | $parameters = array(); |
| 7066 | - $reshook = $hookmanager->executeHooks('printCommonFooter', $parameters); // Note that $action and $object may have been modified by some hooks
|
|
| 7066 | + $reshook = $hookmanager->executeHooks('printCommonFooter', $parameters); // Note that $action and $object may have been modified by some hooks
|
|
| 7067 | 7067 | if (empty($reshook)) {
|
| 7068 | 7068 | if (!empty(Globals::$conf->global->MAIN_HTML_FOOTER)) |
| 7069 | - print Globals::$conf->global->MAIN_HTML_FOOTER . "\n"; |
|
| 7069 | + print Globals::$conf->global->MAIN_HTML_FOOTER."\n"; |
|
| 7070 | 7070 | |
| 7071 | 7071 | print "\n"; |
| 7072 | 7072 | if (!empty(Globals::$conf->use_javascript_ajax)) {
|
| 7073 | - print '<script type="text/javascript" language="javascript">' . "\n"; |
|
| 7074 | - print 'jQuery(document).ready(function() {' . "\n";
|
|
| 7073 | + print '<script type="text/javascript" language="javascript">'."\n"; |
|
| 7074 | + print 'jQuery(document).ready(function() {'."\n";
|
|
| 7075 | 7075 | |
| 7076 | 7076 | if ($zone == 'private' && empty(Globals::$conf->dol_use_jmobile)) {
|
| 7077 | 7077 | print "\n"; |
| 7078 | - print '/* JS CODE TO ENABLE to manage handler to switch left menu page (menuhider) */' . "\n"; |
|
| 7078 | + print '/* JS CODE TO ENABLE to manage handler to switch left menu page (menuhider) */'."\n"; |
|
| 7079 | 7079 | print 'jQuery(".menuhider").click(function() {';
|
| 7080 | - print ' console.log("We click on .menuhider");' . "\n";
|
|
| 7080 | + print ' console.log("We click on .menuhider");'."\n";
|
|
| 7081 | 7081 | //print " $('.side-nav').animate({width:'toggle'},200);\n"; // OK with eldy theme but not with md
|
| 7082 | 7082 | print " $('.side-nav').toggle()\n";
|
| 7083 | 7083 | print " $('.login_block').toggle()\n";
|
| 7084 | - print '});' . "\n"; |
|
| 7084 | + print '});'."\n"; |
|
| 7085 | 7085 | } |
| 7086 | 7086 | |
| 7087 | 7087 | // Management of focus and mandatory for fields |
| 7088 | 7088 | if ($action == 'create' || $action == 'edit' || (empty($action) && (preg_match('/new\.php/', $_SERVER["PHP_SELF"])))) {
|
| 7089 | - print '/* JS CODE TO ENABLE to manage focus and mandatory form fields */' . "\n"; |
|
| 7089 | + print '/* JS CODE TO ENABLE to manage focus and mandatory form fields */'."\n"; |
|
| 7090 | 7090 | $relativepathstring = $_SERVER["PHP_SELF"]; |
| 7091 | 7091 | // Clean $relativepathstring |
| 7092 | 7092 | if (constant('DOL_BASE_URI'))
|
| 7093 | - $relativepathstring = preg_replace('/^' . preg_quote(constant('DOL_BASE_URI'), '/') . '/', '', $relativepathstring);
|
|
| 7093 | + $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_BASE_URI'), '/').'/', '', $relativepathstring);
|
|
| 7094 | 7094 | $relativepathstring = preg_replace('/^\//', '', $relativepathstring);
|
| 7095 | 7095 | $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
|
| 7096 | 7096 | $tmpqueryarraywehave = explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
|
@@ -7113,9 +7113,9 @@ discard block |
||
| 7113 | 7113 | if ($qualified) {
|
| 7114 | 7114 | foreach ($defval as $paramkey => $paramval) {
|
| 7115 | 7115 | // Set focus on field |
| 7116 | - print 'jQuery("input[name=\'' . $paramkey . '\']").focus();' . "\n";
|
|
| 7117 | - print 'jQuery("textarea[name=\'' . $paramkey . '\']").focus();' . "\n";
|
|
| 7118 | - print 'jQuery("select[name=\'' . $paramkey . '\']").focus();' . "\n"; // Not really usefull, but we keep it in case of.
|
|
| 7116 | + print 'jQuery("input[name=\''.$paramkey.'\']").focus();'."\n";
|
|
| 7117 | + print 'jQuery("textarea[name=\''.$paramkey.'\']").focus();'."\n";
|
|
| 7118 | + print 'jQuery("select[name=\''.$paramkey.'\']").focus();'."\n"; // Not really usefull, but we keep it in case of.
|
|
| 7119 | 7119 | } |
| 7120 | 7120 | } |
| 7121 | 7121 | } |
@@ -7139,16 +7139,16 @@ discard block |
||
| 7139 | 7139 | if ($qualified) {
|
| 7140 | 7140 | foreach ($defval as $paramkey => $paramval) {
|
| 7141 | 7141 | // Add property 'required' on input |
| 7142 | - print 'jQuery("input[name=\'' . $paramkey . '\']").prop(\'required\',true);' . "\n";
|
|
| 7143 | - print 'jQuery("textarea[name=\'' . $paramkey . '\']").prop(\'required\',true);' . "\n";
|
|
| 7144 | - print 'jQuery("select[name=\'' . $paramkey . '\']").prop(\'required\',true);' . "\n"; // required on a select works only if key is "", this does not happen in Dolibarr
|
|
| 7142 | + print 'jQuery("input[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
|
|
| 7143 | + print 'jQuery("textarea[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
|
|
| 7144 | + print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; // required on a select works only if key is "", this does not happen in Dolibarr
|
|
| 7145 | 7145 | } |
| 7146 | 7146 | } |
| 7147 | 7147 | } |
| 7148 | 7148 | } |
| 7149 | 7149 | } |
| 7150 | 7150 | |
| 7151 | - print '});' . "\n"; |
|
| 7151 | + print '});'."\n"; |
|
| 7152 | 7152 | |
| 7153 | 7153 | // Google Analytics |
| 7154 | 7154 | // TODO Add a hook here |
@@ -7156,15 +7156,15 @@ discard block |
||
| 7156 | 7156 | if ((Globals::$conf->dol_use_jmobile != 4)) {
|
| 7157 | 7157 | print "\n"; |
| 7158 | 7158 | print "/* JS CODE TO ENABLE for google analtics tag */\n"; |
| 7159 | - print ' var _gaq = _gaq || [];' . "\n"; |
|
| 7160 | - print ' _gaq.push([\'_setAccount\', \'' . Globals::$conf->global->MAIN_GOOGLE_AN_ID . '\']);' . "\n"; |
|
| 7161 | - print ' _gaq.push([\'_trackPageview\']);' . "\n"; |
|
| 7162 | - print '' . "\n"; |
|
| 7163 | - print ' (function() {' . "\n";
|
|
| 7164 | - print ' var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;' . "\n"; |
|
| 7165 | - print ' ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';' . "\n"; |
|
| 7166 | - print ' var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);' . "\n"; |
|
| 7167 | - print ' })();' . "\n"; |
|
| 7159 | + print ' var _gaq = _gaq || [];'."\n"; |
|
| 7160 | + print ' _gaq.push([\'_setAccount\', \''.Globals::$conf->global->MAIN_GOOGLE_AN_ID.'\']);'."\n"; |
|
| 7161 | + print ' _gaq.push([\'_trackPageview\']);'."\n"; |
|
| 7162 | + print ''."\n"; |
|
| 7163 | + print ' (function() {'."\n";
|
|
| 7164 | + print ' var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;'."\n"; |
|
| 7165 | + print ' ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';'."\n"; |
|
| 7166 | + print ' var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);'."\n"; |
|
| 7167 | + print ' })();'."\n"; |
|
| 7168 | 7168 | } |
| 7169 | 7169 | } |
| 7170 | 7170 | |
@@ -7174,27 +7174,27 @@ discard block |
||
| 7174 | 7174 | print "/* JS CODE TO ENABLE to add memory info */\n"; |
| 7175 | 7175 | print 'window.console && console.log("';
|
| 7176 | 7176 | if (!empty(Globals::$conf->global->MEMCACHED_SERVER)) |
| 7177 | - print 'MEMCACHED_SERVER=' . Globals::$conf->global->MEMCACHED_SERVER . ' - '; |
|
| 7178 | - print 'MAIN_OPTIMIZE_SPEED=' . (isset(Globals::$conf->global->MAIN_OPTIMIZE_SPEED) ? Globals::$conf->global->MAIN_OPTIMIZE_SPEED : 'off'); |
|
| 7177 | + print 'MEMCACHED_SERVER='.Globals::$conf->global->MEMCACHED_SERVER.' - '; |
|
| 7178 | + print 'MAIN_OPTIMIZE_SPEED='.(isset(Globals::$conf->global->MAIN_OPTIMIZE_SPEED) ? Globals::$conf->global->MAIN_OPTIMIZE_SPEED : 'off'); |
|
| 7179 | 7179 | if (!empty($micro_start_time)) { // Works only if MAIN_SHOW_TUNING_INFO is defined at $_SERVER level. Not in// global variable.
|
| 7180 | 7180 | $micro_end_time = microtime(true); |
| 7181 | - print ' - Build time: ' . ceil(1000 * ($micro_end_time - $micro_start_time)) . ' ms'; |
|
| 7181 | + print ' - Build time: '.ceil(1000 * ($micro_end_time - $micro_start_time)).' ms'; |
|
| 7182 | 7182 | } |
| 7183 | 7183 | if (function_exists("memory_get_usage")) {
|
| 7184 | - print ' - Mem: ' . memory_get_usage(); |
|
| 7184 | + print ' - Mem: '.memory_get_usage(); |
|
| 7185 | 7185 | } |
| 7186 | 7186 | if (function_exists("xdebug_memory_usage")) {
|
| 7187 | - print ' - XDebug time: ' . ceil(1000 * xdebug_time_index()) . ' ms'; |
|
| 7188 | - print ' - XDebug mem: ' . xdebug_memory_usage(); |
|
| 7189 | - print ' - XDebug mem peak: ' . xdebug_peak_memory_usage(); |
|
| 7187 | + print ' - XDebug time: '.ceil(1000 * xdebug_time_index()).' ms'; |
|
| 7188 | + print ' - XDebug mem: '.xdebug_memory_usage(); |
|
| 7189 | + print ' - XDebug mem peak: '.xdebug_peak_memory_usage(); |
|
| 7190 | 7190 | } |
| 7191 | 7191 | if (function_exists("zend_loader_file_encoded")) {
|
| 7192 | - print ' - Zend encoded file: ' . (zend_loader_file_encoded() ? 'yes' : 'no'); |
|
| 7192 | + print ' - Zend encoded file: '.(zend_loader_file_encoded() ? 'yes' : 'no'); |
|
| 7193 | 7193 | } |
| 7194 | - print '");' . "\n"; |
|
| 7194 | + print '");'."\n"; |
|
| 7195 | 7195 | } |
| 7196 | 7196 | |
| 7197 | - print "\n" . '</script>' . "\n"; |
|
| 7197 | + print "\n".'</script>'."\n"; |
|
| 7198 | 7198 | } |
| 7199 | 7199 | |
| 7200 | 7200 | // Add Xdebug coverage of code |
@@ -7208,7 +7208,7 @@ discard block |
||
| 7208 | 7208 | print "<!-- Start of log output\n"; |
| 7209 | 7209 | //print '<div class="hidden">'."\n"; |
| 7210 | 7210 | foreach (Globals::$conf->logbuffer as $logline) {
|
| 7211 | - print $logline . "<br>\n"; |
|
| 7211 | + print $logline."<br>\n"; |
|
| 7212 | 7212 | } |
| 7213 | 7213 | //print '</div>'."\n"; |
| 7214 | 7214 | print "End of log output -->\n"; |
@@ -7251,8 +7251,8 @@ discard block |
||
| 7251 | 7251 | */ |
| 7252 | 7252 | static function dol_set_focus($selector) |
| 7253 | 7253 | {
|
| 7254 | - print "\n" . '<!-- Set focus onto a specific field -->' . "\n"; |
|
| 7255 | - print '<script type="text/javascript" language="javascript">jQuery(document).ready(function() { jQuery("' . dol_escape_js($selector) . '").focus(); });</script>' . "\n";
|
|
| 7254 | + print "\n".'<!-- Set focus onto a specific field -->'."\n"; |
|
| 7255 | + print '<script type="text/javascript" language="javascript">jQuery(document).ready(function() { jQuery("'.dol_escape_js($selector).'").focus(); });</script>'."\n";
|
|
| 7256 | 7256 | } |
| 7257 | 7257 | |
| 7258 | 7258 | /** |
@@ -7297,7 +7297,7 @@ discard block |
||
| 7297 | 7297 | $value = preg_replace('/\*/', '%', $value); // Replace * with %
|
| 7298 | 7298 | } |
| 7299 | 7299 | if ($mode == 1) {
|
| 7300 | - $value = preg_replace('/([<>=]+)\s+([0-9' . preg_quote(Globals::$langs->trans("DecimalSeparator"), '/') . '\-])/', '\1\2', $value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
|
|
| 7300 | + $value = preg_replace('/([<>=]+)\s+([0-9'.preg_quote(Globals::$langs->trans("DecimalSeparator"), '/').'\-])/', '\1\2', $value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
|
|
| 7301 | 7301 | } |
| 7302 | 7302 | |
| 7303 | 7303 | $value = preg_replace('/\s*\|\s*/', '|', $value);
|
@@ -7326,14 +7326,14 @@ discard block |
||
| 7326 | 7326 | if ($newcrit != '') {
|
| 7327 | 7327 | $numnewcrit = price2num($newcrit); |
| 7328 | 7328 | if (is_numeric($numnewcrit)) {
|
| 7329 | - $newres .= ($i2 > 0 ? ' OR ' : '') . $field . ' ' . $operator . ' ' . $numnewcrit; |
|
| 7329 | + $newres .= ($i2 > 0 ? ' OR ' : '').$field.' '.$operator.' '.$numnewcrit; |
|
| 7330 | 7330 | } else {
|
| 7331 | - $newres .= ($i2 > 0 ? ' OR ' : '') . '1 = 2'; // force false |
|
| 7331 | + $newres .= ($i2 > 0 ? ' OR ' : '').'1 = 2'; // force false |
|
| 7332 | 7332 | } |
| 7333 | 7333 | $i2++; // a criteria was added to string |
| 7334 | 7334 | } |
| 7335 | 7335 | } else if ($mode == 2) {
|
| 7336 | - $newres .= ($i2 > 0 ? ' OR ' : '') . $field . " IN (" . $db->escape(trim($crit)) . ")";
|
|
| 7336 | + $newres .= ($i2 > 0 ? ' OR ' : '').$field." IN (".$db->escape(trim($crit)).")";
|
|
| 7337 | 7337 | $i2++; // a criteria was added to string |
| 7338 | 7338 | } else if ($mode == 3) {
|
| 7339 | 7339 | $tmparray = explode(',', trim($crit));
|
@@ -7342,10 +7342,10 @@ discard block |
||
| 7342 | 7342 | foreach ($tmparray as $val) {
|
| 7343 | 7343 | if ($val) {
|
| 7344 | 7344 | $listofcodes .= ($listofcodes ? ',' : ''); |
| 7345 | - $listofcodes .= "'" . $db->escape(trim($val)) . "'"; |
|
| 7345 | + $listofcodes .= "'".$db->escape(trim($val))."'"; |
|
| 7346 | 7346 | } |
| 7347 | 7347 | } |
| 7348 | - $newres .= ($i2 > 0 ? ' OR ' : '') . $field . " IN (" . $listofcodes . ")";
|
|
| 7348 | + $newres .= ($i2 > 0 ? ' OR ' : '').$field." IN (".$listofcodes.")";
|
|
| 7349 | 7349 | $i2++; // a criteria was added to string |
| 7350 | 7350 | } |
| 7351 | 7351 | } else if ($mode == 4) {
|
@@ -7354,10 +7354,10 @@ discard block |
||
| 7354 | 7354 | $listofcodes = ''; |
| 7355 | 7355 | foreach ($tmparray as $val) {
|
| 7356 | 7356 | if ($val) {
|
| 7357 | - $newres .= ($i2 > 0 ? ' OR (' : '(') . $field . ' LIKE \'' . $db->escape(trim($val)) . ',%\'';
|
|
| 7358 | - $newres .= ' OR ' . $field . ' = \'' . $db->escape(trim($val)) . '\''; |
|
| 7359 | - $newres .= ' OR ' . $field . ' LIKE \'%,' . $db->escape(trim($val)) . '\''; |
|
| 7360 | - $newres .= ' OR ' . $field . ' LIKE \'%,' . $db->escape(trim($val)) . ',%\''; |
|
| 7357 | + $newres .= ($i2 > 0 ? ' OR (' : '(').$field.' LIKE \''.$db->escape(trim($val)).',%\'';
|
|
| 7358 | + $newres .= ' OR '.$field.' = \''.$db->escape(trim($val)).'\''; |
|
| 7359 | + $newres .= ' OR '.$field.' LIKE \'%,'.$db->escape(trim($val)).'\''; |
|
| 7360 | + $newres .= ' OR '.$field.' LIKE \'%,'.$db->escape(trim($val)).',%\''; |
|
| 7361 | 7361 | $newres .= ')'; |
| 7362 | 7362 | $i2++; |
| 7363 | 7363 | } |
@@ -7374,9 +7374,9 @@ discard block |
||
| 7374 | 7374 | $newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : ''); |
| 7375 | 7375 | |
| 7376 | 7376 | if (preg_match('/\.(id|rowid)$/', $field)) { // Special case for rowid that is sometimes a ref so used as a search field
|
| 7377 | - $newres .= $field . " = " . (is_numeric(trim($tmpcrit)) ? trim($tmpcrit) : '0'); |
|
| 7377 | + $newres .= $field." = ".(is_numeric(trim($tmpcrit)) ? trim($tmpcrit) : '0'); |
|
| 7378 | 7378 | } else {
|
| 7379 | - $newres .= $field . " LIKE '"; |
|
| 7379 | + $newres .= $field." LIKE '"; |
|
| 7380 | 7380 | |
| 7381 | 7381 | $tmpcrit = trim($tmpcrit); |
| 7382 | 7382 | $tmpcrit2 = $tmpcrit; |
@@ -7395,7 +7395,7 @@ discard block |
||
| 7395 | 7395 | $newres .= $tmpafter; |
| 7396 | 7396 | $newres .= "'"; |
| 7397 | 7397 | if ($tmpcrit2 == '') {
|
| 7398 | - $newres .= ' OR ' . $field . " IS NULL"; |
|
| 7398 | + $newres .= ' OR '.$field." IS NULL"; |
|
| 7399 | 7399 | } |
| 7400 | 7400 | } |
| 7401 | 7401 | |
@@ -7406,10 +7406,10 @@ discard block |
||
| 7406 | 7406 | $i++; |
| 7407 | 7407 | } |
| 7408 | 7408 | if ($newres) |
| 7409 | - $res = $res . ($res ? ' AND ' : '') . ($i2 > 1 ? '(' : '') . $newres . ($i2 > 1 ? ')' : '');
|
|
| 7409 | + $res = $res.($res ? ' AND ' : '').($i2 > 1 ? '(' : '').$newres.($i2 > 1 ? ')' : '');
|
|
| 7410 | 7410 | $j++; |
| 7411 | 7411 | } |
| 7412 | - $res = ($nofirstand ? "" : " AND ") . "(" . $res . ")";
|
|
| 7412 | + $res = ($nofirstand ? "" : " AND ")."(".$res.")";
|
|
| 7413 | 7413 | //print 'xx'.$res.'yy'; |
| 7414 | 7414 | return $res; |
| 7415 | 7415 | } |
@@ -7428,8 +7428,8 @@ discard block |
||
| 7428 | 7428 | $url = $object->getLastMainDocLink($object->element); |
| 7429 | 7429 | |
| 7430 | 7430 | if ($url) {
|
| 7431 | - $out .= img_picto('', 'object_globe.png') . ' ' . Globals::$langs->trans("DirectDownloadLink") . '<br>';
|
|
| 7432 | - $out .= '<input type="text" id="directdownloadlink" class="quatrevingtpercent" value="' . $url . '">'; |
|
| 7431 | + $out .= img_picto('', 'object_globe.png').' '.Globals::$langs->trans("DirectDownloadLink").'<br>';
|
|
| 7432 | + $out .= '<input type="text" id="directdownloadlink" class="quatrevingtpercent" value="'.$url.'">'; |
|
| 7433 | 7433 | $out .= ajax_autoselect("directdownloadlink", 0);
|
| 7434 | 7434 | } |
| 7435 | 7435 | return $out; |
@@ -7470,7 +7470,7 @@ discard block |
||
| 7470 | 7470 | if ($extName) |
| 7471 | 7471 | $subdir = 'thumbs/'; |
| 7472 | 7472 | |
| 7473 | - return ($dirName ? $dirName . '/' : '') . $subdir . $fileName . $extName . $extImgTarget; // New filename for thumb |
|
| 7473 | + return ($dirName ? $dirName.'/' : '').$subdir.$fileName.$extName.$extImgTarget; // New filename for thumb |
|
| 7474 | 7474 | } |
| 7475 | 7475 | |
| 7476 | 7476 | /** |
@@ -7496,14 +7496,14 @@ discard block |
||
| 7496 | 7496 | |
| 7497 | 7497 | if ($alldata == 1) {
|
| 7498 | 7498 | if ($num_mime !== false) |
| 7499 | - return array('target' => '_blank', 'css' => 'documentpreview', 'url' => DOL_BASE_URI . '/document.php?modulepart=' . $modulepart . '&attachment=0&file=' . urlencode($relativepath) . ($param ? '&' . $param : ''), 'mime' => dol_mimetype($relativepath),);
|
|
| 7499 | + return array('target' => '_blank', 'css' => 'documentpreview', 'url' => DOL_BASE_URI.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath).($param ? '&'.$param : ''), 'mime' => dol_mimetype($relativepath),);
|
|
| 7500 | 7500 | else |
| 7501 | 7501 | return array(); |
| 7502 | 7502 | } |
| 7503 | 7503 | |
| 7504 | 7504 | // old behavior |
| 7505 | 7505 | if ($num_mime !== false) |
| 7506 | - return 'javascript:document_preview(\'' . dol_escape_js(DOL_BASE_URI . '/document.php?modulepart=' . $modulepart . '&attachment=0&file=' . urlencode($relativepath) . ($param ? '&' . $param : '')) . '\', \'' . dol_mimetype($relativepath) . '\', \'' . dol_escape_js(Globals::$langs->trans('Preview')) . '\')';
|
|
| 7506 | + return 'javascript:document_preview(\''.dol_escape_js(DOL_BASE_URI.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath).($param ? '&'.$param : '')).'\', \''.dol_mimetype($relativepath).'\', \''.dol_escape_js(Globals::$langs->trans('Preview')).'\')';
|
|
| 7507 | 7507 | else |
| 7508 | 7508 | return ''; |
| 7509 | 7509 | } |
@@ -7520,11 +7520,11 @@ discard block |
||
| 7520 | 7520 | // global Globals::$langs; |
| 7521 | 7521 | $out = '<script type="text/javascript"> |
| 7522 | 7522 | jQuery(document).ready(static function () {
|
| 7523 | - jQuery("#' . $htmlname . '").click(function() { jQuery(this).select(); } );
|
|
| 7523 | + jQuery("#' . $htmlname.'").click(function() { jQuery(this).select(); } );
|
|
| 7524 | 7524 | }); |
| 7525 | 7525 | </script>'; |
| 7526 | 7526 | if ($addlink) |
| 7527 | - $out .= ' <a href="' . $addlink . '" target="_blank">' . Globals::$langs->trans("Link") . '</a>';
|
|
| 7527 | + $out .= ' <a href="'.$addlink.'" target="_blank">'.Globals::$langs->trans("Link").'</a>';
|
|
| 7528 | 7528 | return $out; |
| 7529 | 7529 | } |
| 7530 | 7530 | |
@@ -7905,9 +7905,9 @@ discard block |
||
| 7905 | 7905 | |
| 7906 | 7906 | if (!isset($dictvalues[$tablename])) {
|
| 7907 | 7907 | $dictvalues[$tablename] = array(); |
| 7908 | - $sql = 'SELECT * FROM ' . $tablename . ' WHERE 1'; |
|
| 7908 | + $sql = 'SELECT * FROM '.$tablename.' WHERE 1'; |
|
| 7909 | 7909 | if ($checkentity) |
| 7910 | - $sql .= ' AND entity IN (0,' . getEntity($tablename) . ')'; |
|
| 7910 | + $sql .= ' AND entity IN (0,'.getEntity($tablename).')'; |
|
| 7911 | 7911 | |
| 7912 | 7912 | $resql = $db->query($sql); |
| 7913 | 7913 | if ($resql) {
|
@@ -7945,14 +7945,14 @@ discard block |
||
| 7945 | 7945 | $g = $tmp[1]; |
| 7946 | 7946 | $b = $tmp[2]; |
| 7947 | 7947 | } else {
|
| 7948 | - $hexr = $stringcolor[0] . $stringcolor[1]; |
|
| 7949 | - $hexg = $stringcolor[2] . $stringcolor[3]; |
|
| 7950 | - $hexb = $stringcolor[4] . $stringcolor[5]; |
|
| 7948 | + $hexr = $stringcolor[0].$stringcolor[1]; |
|
| 7949 | + $hexg = $stringcolor[2].$stringcolor[3]; |
|
| 7950 | + $hexb = $stringcolor[4].$stringcolor[5]; |
|
| 7951 | 7951 | $r = hexdec($hexr); |
| 7952 | 7952 | $g = hexdec($hexg); |
| 7953 | 7953 | $b = hexdec($hexb); |
| 7954 | 7954 | } |
| 7955 | - $bright = (max($r, $g, $b) + min($r, $g, $b)) / 510.0; // HSL algorithm |
|
| 7955 | + $bright = (max($r, $g, $b) + min($r, $g, $b)) / 510.0; // HSL algorithm |
|
| 7956 | 7956 | if ($bright > 0.6) |
| 7957 | 7957 | $res = 1; |
| 7958 | 7958 | } |
@@ -7987,11 +7987,11 @@ discard block |
||
| 7987 | 7987 | return 0; // Entry is for menus all excluded to external users |
| 7988 | 7988 | } |
| 7989 | 7989 | if (!$menuentry['perms'] && $type_user) |
| 7990 | - return 0; // No permissions and user is external |
|
| 7990 | + return 0; // No permissions and user is external |
|
| 7991 | 7991 | if (!$menuentry['perms'] && !empty(Globals::$conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) |
| 7992 | 7992 | return 0; // No permissions and option to hide when not allowed, even for internal user, is on |
| 7993 | 7993 | if (!$menuentry['perms']) |
| 7994 | - return 2; // No permissions and user is external |
|
| 7994 | + return 2; // No permissions and user is external |
|
| 7995 | 7995 | return 1; |
| 7996 | 7996 | } |
| 7997 | 7997 | |
@@ -412,14 +412,14 @@ discard block |
||
| 412 | 412 | $param = (isset($tmp[1]) ? $tmp[1] : ''); |
| 413 | 413 | |
| 414 | 414 | if (!preg_match('/mainmenu/i', $param) || !preg_match('/leftmenu/i', $param)) {
|
| 415 | - $param .= ($param ? '&' : '') . 'mainmenu=' . $newTabMenu[$i]['mainmenu'] . '&leftmenu='; |
|
| 415 | + $param .= ($param ? '&' : '').'mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu='; |
|
| 416 | 416 | } |
| 417 | 417 | //$url.="idmenu=".$newTabMenu[$i]['rowid']; // Already done by menuLoad |
| 418 | - $url = DolUtils::dol_buildpath($url, 1) . ($param ? '?' . $param : ''); |
|
| 418 | + $url = DolUtils::dol_buildpath($url, 1).($param ? '?'.$param : ''); |
|
| 419 | 419 | //$shorturl = $shorturl.($param?'?'.$param:''); |
| 420 | 420 | $shorturl = $url; |
| 421 | 421 | if (BASE_URI) {
|
| 422 | - $shorturl = preg_replace('/^' . preg_quote(BASE_URI, '/') . '/', '', $shorturl);
|
|
| 422 | + $shorturl = preg_replace('/^'.preg_quote(BASE_URI, '/').'/', '', $shorturl);
|
|
| 423 | 423 | } |
| 424 | 424 | } |
| 425 | 425 | |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | if (empty($noout)) {
|
| 446 | 446 | foreach ($menu->liste as $menkey => $menuval) {
|
| 447 | 447 | self::print_start_menu_entry($menuval['idsel'], $menuval['classname'], $menuval['enabled']); |
| 448 | - self::print_text_menu_entry($menuval['titre'], $menuval['enabled'], (($menuval['url'] != '#' && !preg_match('/^(http:\/\/|https:\/\/)/i', $menuval['url'])) ? BASE_URI : '') . $menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target'] ? $menuval['target'] : $atarget));
|
|
| 448 | + self::print_text_menu_entry($menuval['titre'], $menuval['enabled'], (($menuval['url'] != '#' && !preg_match('/^(http:\/\/|https:\/\/)/i', $menuval['url'])) ? BASE_URI : '').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target'] ? $menuval['target'] : $atarget));
|
|
| 449 | 449 | self::print_end_menu_entry($menuval['enabled']); |
| 450 | 450 | } |
| 451 | 451 | } |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | // global $conf; |
| 471 | 471 | |
| 472 | 472 | print '<div class="tmenudiv">'; |
| 473 | - print '<ul class="tmenu"' . (empty(Globals::$conf->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' title="Top menu"') . '>'; |
|
| 473 | + print '<ul class="tmenu"'.(empty(Globals::$conf->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' title="Top menu"').'>'; |
|
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | /** |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | static function print_start_menu_entry($idsel, $classname, $showmode) |
| 485 | 485 | {
|
| 486 | 486 | if ($showmode) {
|
| 487 | - print '<li ' . $classname . ' id="mainmenutd_' . $idsel . '">'; |
|
| 487 | + print '<li '.$classname.' id="mainmenutd_'.$idsel.'">'; |
|
| 488 | 488 | //print '<div class="tmenuleft tmenusep"></div>'; |
| 489 | 489 | print '<div class="tmenucenter">'; |
| 490 | 490 | } |
@@ -507,17 +507,17 @@ discard block |
||
| 507 | 507 | // global Globals::$langs; |
| 508 | 508 | |
| 509 | 509 | if ($showmode == 1) {
|
| 510 | - print '<a class="tmenuimage" tabindex="-1" href="' . $url . '"' . ($atarget ? ' target="' . $atarget . '"' : '') . '>'; |
|
| 511 | - print '<div class="' . $id . ' ' . $idsel . ' topmenuimage"><span class="' . $id . ' tmenuimage" id="mainmenuspan_' . $idsel . '"></span></div>'; |
|
| 510 | + print '<a class="tmenuimage" tabindex="-1" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').'>'; |
|
| 511 | + print '<div class="'.$id.' '.$idsel.' topmenuimage"><span class="'.$id.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>'; |
|
| 512 | 512 | print '</a>'; |
| 513 | - print '<a ' . $classname . ' id="mainmenua_' . $idsel . '" href="' . $url . '"' . ($atarget ? ' target="' . $atarget . '"' : '') . '>'; |
|
| 513 | + print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').'>'; |
|
| 514 | 514 | print '<span class="mainmenuaspan">'; |
| 515 | 515 | print $text; |
| 516 | 516 | print '</span>'; |
| 517 | 517 | print '</a>'; |
| 518 | 518 | } elseif ($showmode == 2) {
|
| 519 | - print '<div class="' . $id . ' ' . $idsel . ' topmenuimage tmenudisabled"><span class="' . $id . '" id="mainmenuspan_' . $idsel . '"></span></div>'; |
|
| 520 | - print '<a class="tmenudisabled" id="mainmenua_' . $idsel . '" href="#" title="' . dol_escape_htmltag(Globals::$langs->trans("NotAllowed")) . '">';
|
|
| 519 | + print '<div class="'.$id.' '.$idsel.' topmenuimage tmenudisabled"><span class="'.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>'; |
|
| 520 | + print '<a class="tmenudisabled" id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag(Globals::$langs->trans("NotAllowed")).'">';
|
|
| 521 | 521 | print '<span class="mainmenuaspan">'; |
| 522 | 522 | print $text; |
| 523 | 523 | print '</span>'; |
@@ -581,38 +581,38 @@ discard block |
||
| 581 | 581 | // Show logo company |
| 582 | 582 | if (empty(Globals::$conf->global->MAIN_MENU_INVERT) && empty($noout) && !empty(Globals::$conf->global->MAIN_SHOW_LOGO) && empty(Globals::$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
| 583 | 583 | $mysoc->logo_mini = Globals::$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; |
| 584 | - if (!empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output . '/logos/thumbs/' . $mysoc->logo_mini)) {
|
|
| 585 | - $urllogo = DOL_BASE_URI . '/viewimage.php?cache=1&modulepart=mycompany&file=' . urlencode('logos/thumbs/' . $mysoc->logo_mini);
|
|
| 584 | + if (!empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) {
|
|
| 585 | + $urllogo = DOL_BASE_URI.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini);
|
|
| 586 | 586 | } else {
|
| 587 | - $urllogo = DOL_BASE_URI . '/theme/dolibarr_logo.png'; |
|
| 587 | + $urllogo = DOL_BASE_URI.'/theme/dolibarr_logo.png'; |
|
| 588 | 588 | } |
| 589 | 589 | $title = Globals::$langs->trans("GoIntoSetupToChangeLogo");
|
| 590 | - print "\n" . '<!-- Show logo on menu -->' . "\n"; |
|
| 591 | - print '<div class="blockvmenuimpair blockvmenulogo">' . "\n"; |
|
| 590 | + print "\n".'<!-- Show logo on menu -->'."\n"; |
|
| 591 | + print '<div class="blockvmenuimpair blockvmenulogo">'."\n"; |
|
| 592 | 592 | print '<div class="menu_titre" id="menu_titre_logo"></div>'; |
| 593 | 593 | print '<div class="menu_top" id="menu_top_logo"></div>'; |
| 594 | 594 | print '<div class="menu_contenu" id="menu_contenu_logo">'; |
| 595 | - print '<div class="center"><img class="mycompany" title="' . dol_escape_htmltag($title) . '" alt="" src="' . $urllogo . '" style="max-width: 70%"></div>' . "\n"; |
|
| 595 | + print '<div class="center"><img class="mycompany" title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 70%"></div>'."\n"; |
|
| 596 | 596 | print '</div>'; |
| 597 | 597 | print '<div class="menu_end" id="menu_end_logo"></div>'; |
| 598 | - print '</div>' . "\n"; |
|
| 598 | + print '</div>'."\n"; |
|
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | 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
|
| 602 | 602 | print "\n"; |
| 603 | 603 | print "<!-- Begin SearchForm -->\n"; |
| 604 | - print '<div id="blockvmenusearch" class="blockvmenusearch">' . "\n"; |
|
| 604 | + print '<div id="blockvmenusearch" class="blockvmenusearch">'."\n"; |
|
| 605 | 605 | print $moredata['searchform']; |
| 606 | - print '</div>' . "\n"; |
|
| 606 | + print '</div>'."\n"; |
|
| 607 | 607 | print "<!-- End SearchForm -->\n"; |
| 608 | 608 | } |
| 609 | 609 | |
| 610 | 610 | if (is_array($moredata) && !empty($moredata['bookmarks'])) {
|
| 611 | 611 | print "\n"; |
| 612 | 612 | print "<!-- Begin Bookmarks -->\n"; |
| 613 | - print '<div id="blockvmenubookmarks" class="blockvmenubookmarks">' . "\n"; |
|
| 613 | + print '<div id="blockvmenubookmarks" class="blockvmenubookmarks">'."\n"; |
|
| 614 | 614 | print $moredata['bookmarks']; |
| 615 | - print '</div>' . "\n"; |
|
| 615 | + print '</div>'."\n"; |
|
| 616 | 616 | print "<!-- End Bookmarks -->\n"; |
| 617 | 617 | } |
| 618 | 618 | |
@@ -629,11 +629,11 @@ discard block |
||
| 629 | 629 | |
| 630 | 630 | // Home - dashboard |
| 631 | 631 | //$newmenu->add("/index.php?mainmenu=home&leftmenu=home", Globals::$langs->trans("MyDashboard"), 0, 1, '', $mainmenu, 'home', 0, '', '', '', '<i class="fa fa-bar-chart fa-fw paddingright"></i>');
|
| 632 | - $newmenu->add(BASE_URI . "?controller=home&method=home&mainmenu=home&leftmenu=home", Globals::$langs->trans("MyDashboard"), 0, 1, '', $mainmenu, 'home', 0, '', '', '', '<i class="fa fa-bar-chart fa-fw paddingright"></i>');
|
|
| 632 | + $newmenu->add(BASE_URI."?controller=home&method=home&mainmenu=home&leftmenu=home", Globals::$langs->trans("MyDashboard"), 0, 1, '', $mainmenu, 'home', 0, '', '', '', '<i class="fa fa-bar-chart fa-fw paddingright"></i>');
|
|
| 633 | 633 | |
| 634 | 634 | // Setup |
| 635 | 635 | //$newmenu->add("/admin/index.php?mainmenu=home&leftmenu=setup", Globals::$langs->trans("Setup"), 0, Globals::$user->admin, '', $mainmenu, 'setup', 0, '', '', '', '<i class="fa fa-wrench fa-fw paddingright"></i>');
|
| 636 | - $newmenu->add(BASE_URI . "?controller=admin&method=index&mainmenu=home&leftmenu=setup", Globals::$langs->trans("Setup"), 0, Globals::$user->admin, '', $mainmenu, 'setup', 0, '', '', '', '<i class="fa fa-wrench fa-fw paddingright"></i>');
|
|
| 636 | + $newmenu->add(BASE_URI."?controller=admin&method=index&mainmenu=home&leftmenu=setup", Globals::$langs->trans("Setup"), 0, Globals::$user->admin, '', $mainmenu, 'setup', 0, '', '', '', '<i class="fa fa-wrench fa-fw paddingright"></i>');
|
|
| 637 | 637 | |
| 638 | 638 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "setup") {
|
| 639 | 639 | // Load translation files required by the page |
@@ -642,14 +642,14 @@ discard block |
||
| 642 | 642 | $warnpicto = ''; |
| 643 | 643 | if (empty(Globals::$conf->global->MAIN_INFO_SOCIETE_NOM) || empty(Globals::$conf->global->MAIN_INFO_SOCIETE_COUNTRY)) {
|
| 644 | 644 | Globals::$langs->load("errors");
|
| 645 | - $warnpicto = ' ' . img_warning(Globals::$langs->trans("WarningMandatorySetupNotComplete"));
|
|
| 645 | + $warnpicto = ' '.img_warning(Globals::$langs->trans("WarningMandatorySetupNotComplete"));
|
|
| 646 | 646 | } |
| 647 | 647 | //$newmenu->add("/admin/company.php?mainmenu=home", Globals::$langs->trans("MenuCompanySetup") . $warnpicto, 1);
|
| 648 | - $newmenu->add(BASE_URI . "?controller=admin&method=company&mainmenu=home", Globals::$langs->trans("MenuCompanySetup") . $warnpicto, 1);
|
|
| 648 | + $newmenu->add(BASE_URI."?controller=admin&method=company&mainmenu=home", Globals::$langs->trans("MenuCompanySetup").$warnpicto, 1);
|
|
| 649 | 649 | $warnpicto = ''; |
| 650 | 650 | if (count($conf->modules) <= (empty(Globals::$conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : Globals::$conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) { // If only user module enabled
|
| 651 | 651 | Globals::$langs->load("errors");
|
| 652 | - $warnpicto = ' ' . img_warning(Globals::$langs->trans("WarningMandatorySetupNotComplete"));
|
|
| 652 | + $warnpicto = ' '.img_warning(Globals::$langs->trans("WarningMandatorySetupNotComplete"));
|
|
| 653 | 653 | } |
| 654 | 654 | /* |
| 655 | 655 | $newmenu->add("/admin/modules.php?mainmenu=home", Globals::$langs->trans("Modules") . $warnpicto, 1);
|
@@ -668,42 +668,42 @@ discard block |
||
| 668 | 668 | $newmenu->add("/admin/dict.php?mainmenu=home", Globals::$langs->trans("Dictionary"), 1);
|
| 669 | 669 | $newmenu->add("/admin/const.php?mainmenu=home", Globals::$langs->trans("OtherSetup"), 1);
|
| 670 | 670 | */ |
| 671 | - $newmenu->add(BASE_URI . "?controller=admin&method=modules&mainmenu=home", Globals::$langs->trans("Modules") . $warnpicto, 1);
|
|
| 672 | - $newmenu->add(BASE_URI . "?controller=admin&method=menus&mainmenu=home", Globals::$langs->trans("Menus"), 1);
|
|
| 673 | - $newmenu->add(BASE_URI . "?controller=admin&method=ihm&mainmenu=home", Globals::$langs->trans("GUISetup"), 1);
|
|
| 674 | - |
|
| 675 | - $newmenu->add(BASE_URI . "?controller=admin&method=translation&mainmenu=home", Globals::$langs->trans("Translation"), 1);
|
|
| 676 | - $newmenu->add(BASE_URI . "?controller=admin&method=defaultvalues&mainmenu=home", Globals::$langs->trans("DefaultValues"), 1);
|
|
| 677 | - $newmenu->add(BASE_URI . "?controller=admin&method=boxes&mainmenu=home", Globals::$langs->trans("Boxes"), 1);
|
|
| 678 | - $newmenu->add(BASE_URI . "?controller=admin&method=delais&mainmenu=home", Globals::$langs->trans("MenuWarnings"), 1);
|
|
| 679 | - $newmenu->add(BASE_URI . "?controller=admin&method=security_other&mainmenu=home", Globals::$langs->trans("Security"), 1);
|
|
| 680 | - $newmenu->add(BASE_URI . "?controller=admin&method=limits&mainmenu=home", Globals::$langs->trans("MenuLimits"), 1);
|
|
| 681 | - $newmenu->add(BASE_URI . "?controller=admin&method=pdf&mainmenu=home", Globals::$langs->trans("PDF"), 1);
|
|
| 682 | - $newmenu->add(BASE_URI . "?controller=admin&method=mails&mainmenu=home", Globals::$langs->trans("Emails"), 1);
|
|
| 683 | - $newmenu->add(BASE_URI . "?controller=admin&method=sms&mainmenu=home", Globals::$langs->trans("SMS"), 1);
|
|
| 684 | - $newmenu->add(BASE_URI . "?controller=admin&method=dict&mainmenu=home", Globals::$langs->trans("Dictionary"), 1);
|
|
| 685 | - $newmenu->add(BASE_URI . "?controller=admin&method=const&mainmenu=home", Globals::$langs->trans("OtherSetup"), 1);
|
|
| 671 | + $newmenu->add(BASE_URI."?controller=admin&method=modules&mainmenu=home", Globals::$langs->trans("Modules").$warnpicto, 1);
|
|
| 672 | + $newmenu->add(BASE_URI."?controller=admin&method=menus&mainmenu=home", Globals::$langs->trans("Menus"), 1);
|
|
| 673 | + $newmenu->add(BASE_URI."?controller=admin&method=ihm&mainmenu=home", Globals::$langs->trans("GUISetup"), 1);
|
|
| 674 | + |
|
| 675 | + $newmenu->add(BASE_URI."?controller=admin&method=translation&mainmenu=home", Globals::$langs->trans("Translation"), 1);
|
|
| 676 | + $newmenu->add(BASE_URI."?controller=admin&method=defaultvalues&mainmenu=home", Globals::$langs->trans("DefaultValues"), 1);
|
|
| 677 | + $newmenu->add(BASE_URI."?controller=admin&method=boxes&mainmenu=home", Globals::$langs->trans("Boxes"), 1);
|
|
| 678 | + $newmenu->add(BASE_URI."?controller=admin&method=delais&mainmenu=home", Globals::$langs->trans("MenuWarnings"), 1);
|
|
| 679 | + $newmenu->add(BASE_URI."?controller=admin&method=security_other&mainmenu=home", Globals::$langs->trans("Security"), 1);
|
|
| 680 | + $newmenu->add(BASE_URI."?controller=admin&method=limits&mainmenu=home", Globals::$langs->trans("MenuLimits"), 1);
|
|
| 681 | + $newmenu->add(BASE_URI."?controller=admin&method=pdf&mainmenu=home", Globals::$langs->trans("PDF"), 1);
|
|
| 682 | + $newmenu->add(BASE_URI."?controller=admin&method=mails&mainmenu=home", Globals::$langs->trans("Emails"), 1);
|
|
| 683 | + $newmenu->add(BASE_URI."?controller=admin&method=sms&mainmenu=home", Globals::$langs->trans("SMS"), 1);
|
|
| 684 | + $newmenu->add(BASE_URI."?controller=admin&method=dict&mainmenu=home", Globals::$langs->trans("Dictionary"), 1);
|
|
| 685 | + $newmenu->add(BASE_URI."?controller=admin&method=const&mainmenu=home", Globals::$langs->trans("OtherSetup"), 1);
|
|
| 686 | 686 | } |
| 687 | 687 | |
| 688 | 688 | // System tools |
| 689 | 689 | //$newmenu->add("/admin/tools/index.php?mainmenu=home&leftmenu=admintools", Globals::$langs->trans("AdminTools"), 0, Globals::$user->admin, '', $mainmenu, 'admintools', 0, '', '', '', '<i class="fa fa-server fa-fw paddingright"></i>');
|
| 690 | - $newmenu->add(BASE_URI . "?controller=admin/tools&method=index&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("AdminTools"), 0, Globals::$user->admin, '', $mainmenu, 'admintools', 0, '', '', '', '<i class="fa fa-server fa-fw paddingright"></i>');
|
|
| 690 | + $newmenu->add(BASE_URI."?controller=admin/tools&method=index&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("AdminTools"), 0, Globals::$user->admin, '', $mainmenu, 'admintools', 0, '', '', '', '<i class="fa fa-server fa-fw paddingright"></i>');
|
|
| 691 | 691 | |
| 692 | 692 | if ($usemenuhider || empty($leftmenu) || preg_match('/^admintools/', $leftmenu)) {
|
| 693 | 693 | // Load translation files required by the page |
| 694 | 694 | Globals::$langs->loadLangs(array('admin', 'help'));
|
| 695 | 695 | |
| 696 | 696 | //$newmenu->add('/admin/system/dolibarr.php?mainmenu=home&leftmenu=admintools_info', Globals::$langs->trans('InfoDolibarr'), 1);
|
| 697 | - $newmenu->add(BASE_URI . "?controller=admin/system&method=dolibarr&mainmenu=home&leftmenu=admintools_info", Globals::$langs->trans('InfoDolibarr'), 1);
|
|
| 697 | + $newmenu->add(BASE_URI."?controller=admin/system&method=dolibarr&mainmenu=home&leftmenu=admintools_info", Globals::$langs->trans('InfoDolibarr'), 1);
|
|
| 698 | 698 | if ($usemenuhider || empty($leftmenu) || $leftmenu == 'admintools_info') {
|
| 699 | 699 | /* |
| 700 | 700 | $newmenu->add('/admin/system/modules.php?mainmenu=home&leftmenu=admintools_info', Globals::$langs->trans('Modules'), 2);
|
| 701 | 701 | $newmenu->add('/admin/triggers.php?mainmenu=home&leftmenu=admintools_info', Globals::$langs->trans('Triggers'), 2);
|
| 702 | 702 | $newmenu->add('/admin/system/filecheck.php?mainmenu=home&leftmenu=admintools_info', Globals::$langs->trans('FileCheck'), 2);
|
| 703 | 703 | */ |
| 704 | - $newmenu->add(BASE_URI . '?controller=admin/system&method=modules&mainmenu=home&leftmenu=admintools_info', Globals::$langs->trans('Modules'), 2);
|
|
| 705 | - $newmenu->add(BASE_URI . '?controller=admin&method=triggers&mainmenu=home&leftmenu=admintools_info', Globals::$langs->trans('Triggers'), 2);
|
|
| 706 | - $newmenu->add(BASE_URI . '?controller=admin/system&method=filecheck&mainmenu=home&leftmenu=admintools_info', Globals::$langs->trans('FileCheck'), 2);
|
|
| 704 | + $newmenu->add(BASE_URI.'?controller=admin/system&method=modules&mainmenu=home&leftmenu=admintools_info', Globals::$langs->trans('Modules'), 2);
|
|
| 705 | + $newmenu->add(BASE_URI.'?controller=admin&method=triggers&mainmenu=home&leftmenu=admintools_info', Globals::$langs->trans('Triggers'), 2);
|
|
| 706 | + $newmenu->add(BASE_URI.'?controller=admin/system&method=filecheck&mainmenu=home&leftmenu=admintools_info', Globals::$langs->trans('FileCheck'), 2);
|
|
| 707 | 707 | } |
| 708 | 708 | /* |
| 709 | 709 | $newmenu->add('/admin/system/browser.php?mainmenu=home&leftmenu=admintools', Globals::$langs->trans('InfoBrowser'), 1);
|
@@ -723,33 +723,33 @@ discard block |
||
| 723 | 723 | $newmenu->add("/admin/tools/listsessions.php?mainmenu=home&leftmenu=admintools", Globals::$langs->trans("Sessions"), 1);
|
| 724 | 724 | $newmenu->add('/admin/system/about.php?mainmenu=home&leftmenu=admintools', Globals::$langs->trans('ExternalResources'), 1);
|
| 725 | 725 | */ |
| 726 | - $newmenu->add(BASE_URI . '?controller=admin/system&method=browser&mainmenu=home&leftmenu=admintools', Globals::$langs->trans('InfoBrowser'), 1);
|
|
| 727 | - $newmenu->add(BASE_URI . '?controller=admin/system&method=os&mainmenu=home&leftmenu=admintools', Globals::$langs->trans('InfoOS'), 1);
|
|
| 728 | - $newmenu->add(BASE_URI . '?controller=admin/system&method=web&mainmenu=home&leftmenu=admintools', Globals::$langs->trans('InfoWebServer'), 1);
|
|
| 729 | - $newmenu->add(BASE_URI . '?controller=admin/system&method=phpinfo&mainmenu=home&leftmenu=admintools', Globals::$langs->trans('InfoPHP'), 1);
|
|
| 726 | + $newmenu->add(BASE_URI.'?controller=admin/system&method=browser&mainmenu=home&leftmenu=admintools', Globals::$langs->trans('InfoBrowser'), 1);
|
|
| 727 | + $newmenu->add(BASE_URI.'?controller=admin/system&method=os&mainmenu=home&leftmenu=admintools', Globals::$langs->trans('InfoOS'), 1);
|
|
| 728 | + $newmenu->add(BASE_URI.'?controller=admin/system&method=web&mainmenu=home&leftmenu=admintools', Globals::$langs->trans('InfoWebServer'), 1);
|
|
| 729 | + $newmenu->add(BASE_URI.'?controller=admin/system&method=phpinfo&mainmenu=home&leftmenu=admintools', Globals::$langs->trans('InfoPHP'), 1);
|
|
| 730 | 730 | //if (function_exists('xdebug_is_enabled')) $newmenu->add('/admin/system/xdebug.php', Globals::$langs->trans('XDebug'),1);
|
| 731 | - $newmenu->add(BASE_URI . '?controller=admin/system&method=database&mainmenu=home&leftmenu=admintools', Globals::$langs->trans('InfoDatabase'), 1);
|
|
| 731 | + $newmenu->add(BASE_URI.'?controller=admin/system&method=database&mainmenu=home&leftmenu=admintools', Globals::$langs->trans('InfoDatabase'), 1);
|
|
| 732 | 732 | if (function_exists('eaccelerator_info')) {
|
| 733 | - $newmenu->add(BASE_URI . "?controller=admin/tools&method=eaccelerator&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("EAccelerator"), 1);
|
|
| 733 | + $newmenu->add(BASE_URI."?controller=admin/tools&method=eaccelerator&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("EAccelerator"), 1);
|
|
| 734 | 734 | } |
| 735 | 735 | //$newmenu->add("/admin/system/perf.php?mainmenu=home&leftmenu=admintools", Globals::$langs->trans("InfoPerf"),1);
|
| 736 | - $newmenu->add(BASE_URI . "?controller=admin/tools&method=dolibarr_export&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("Backup"), 1);
|
|
| 737 | - $newmenu->add(BASE_URI . "?controller=admin/tools&method=dolibarr_import&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("Restore"), 1);
|
|
| 738 | - $newmenu->add(BASE_URI . "?controller=admin/tools&method=update&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("MenuUpgrade"), 1);
|
|
| 739 | - $newmenu->add(BASE_URI . "?controller=admin/tools&method=purge&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("Purge"), 1);
|
|
| 740 | - $newmenu->add(BASE_URI . "?controller=admin/tools&method=listevents&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("Audit"), 1);
|
|
| 741 | - $newmenu->add(BASE_URI . "?controller=admin/tools&method=listsessions&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("Sessions"), 1);
|
|
| 742 | - $newmenu->add(BASE_URI . '?controller=admin/system&method=about&mainmenu=home&leftmenu=admintools', Globals::$langs->trans('ExternalResources'), 1);
|
|
| 736 | + $newmenu->add(BASE_URI."?controller=admin/tools&method=dolibarr_export&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("Backup"), 1);
|
|
| 737 | + $newmenu->add(BASE_URI."?controller=admin/tools&method=dolibarr_import&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("Restore"), 1);
|
|
| 738 | + $newmenu->add(BASE_URI."?controller=admin/tools&method=update&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("MenuUpgrade"), 1);
|
|
| 739 | + $newmenu->add(BASE_URI."?controller=admin/tools&method=purge&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("Purge"), 1);
|
|
| 740 | + $newmenu->add(BASE_URI."?controller=admin/tools&method=listevents&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("Audit"), 1);
|
|
| 741 | + $newmenu->add(BASE_URI."?controller=admin/tools&method=listsessions&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("Sessions"), 1);
|
|
| 742 | + $newmenu->add(BASE_URI.'?controller=admin/system&method=about&mainmenu=home&leftmenu=admintools', Globals::$langs->trans('ExternalResources'), 1);
|
|
| 743 | 743 | |
| 744 | 744 | if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
| 745 | 745 | Globals::$langs->load("products");
|
| 746 | 746 | //$newmenu->add("/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools", Globals::$langs->trans("ProductVatMassChange"), 1, Globals::$user->admin);
|
| 747 | - $newmenu->add(BASE_URI . "?controller=product/admin&method=product_tools&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("ProductVatMassChange"), 1, Globals::$user->admin);
|
|
| 747 | + $newmenu->add(BASE_URI."?controller=product/admin&method=product_tools&mainmenu=home&leftmenu=admintools", Globals::$langs->trans("ProductVatMassChange"), 1, Globals::$user->admin);
|
|
| 748 | 748 | } |
| 749 | 749 | } |
| 750 | 750 | |
| 751 | 751 | //$newmenu->add("/user/home.php?leftmenu=users", Globals::$langs->trans("MenuUsersAndGroups"), 0, Globals::$user->rights->user->user->lire, '', $mainmenu, 'users', 0, '', '', '', '<i class="fa fa-users fa-fw paddingright"></i>');
|
| 752 | - $newmenu->add(BASE_URI . "?controller=user&method=home&leftmenu=users", Globals::$langs->trans("MenuUsersAndGroups"), 0, Globals::$user->rights->user->user->lire, '', $mainmenu, 'users', 0, '', '', '', '<i class="fa fa-users fa-fw paddingright"></i>');
|
|
| 752 | + $newmenu->add(BASE_URI."?controller=user&method=home&leftmenu=users", Globals::$langs->trans("MenuUsersAndGroups"), 0, Globals::$user->rights->user->user->lire, '', $mainmenu, 'users', 0, '', '', '', '<i class="fa fa-users fa-fw paddingright"></i>');
|
|
| 753 | 753 | if (Globals::$user->rights->user->user->lire) {
|
| 754 | 754 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "users") {
|
| 755 | 755 | $newmenu->add("", Globals::$langs->trans("Users"), 1, Globals::$user->rights->user->user->lire || Globals::$user->admin);
|
@@ -765,16 +765,16 @@ discard block |
||
| 765 | 765 | $newmenu->add("/user/group/card.php?leftmenu=users&action=create", Globals::$langs->trans("NewGroup"), 2, ((Globals::$conf->global->MAIN_USE_ADVANCED_PERMS ? Globals::$user->rights->user->group_advance->write : Globals::$user->rights->user->user->creer) || Globals::$user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && Globals::$conf->global->MULTICOMPANY_TRANSVERSE_MODE));
|
| 766 | 766 | $newmenu->add("/user/group/list.php?leftmenu=users", Globals::$langs->trans("ListOfGroups"), 2, ((Globals::$conf->global->MAIN_USE_ADVANCED_PERMS ? Globals::$user->rights->user->group_advance->read : Globals::$user->rights->user->user->lire) || Globals::$user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && Globals::$conf->global->MULTICOMPANY_TRANSVERSE_MODE));
|
| 767 | 767 | */ |
| 768 | - $newmenu->add(BASE_URI . "?controller=user&method=card&leftmenu=users&action=create", Globals::$langs->trans("NewUser"), 2, (Globals::$user->rights->user->user->creer || Globals::$user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && Globals::$conf->global->MULTICOMPANY_TRANSVERSE_MODE), '', 'home');
|
|
| 769 | - $newmenu->add(BASE_URI . "?controller=user&method=list&leftmenu=users", Globals::$langs->trans("ListOfUsers"), 2, Globals::$user->rights->user->user->lire || Globals::$user->admin);
|
|
| 770 | - $newmenu->add(BASE_URI . "?controller=user&method=hierarchy&leftmenu=users", Globals::$langs->trans("HierarchicView"), 2, Globals::$user->rights->user->user->lire || Globals::$user->admin);
|
|
| 768 | + $newmenu->add(BASE_URI."?controller=user&method=card&leftmenu=users&action=create", Globals::$langs->trans("NewUser"), 2, (Globals::$user->rights->user->user->creer || Globals::$user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && Globals::$conf->global->MULTICOMPANY_TRANSVERSE_MODE), '', 'home');
|
|
| 769 | + $newmenu->add(BASE_URI."?controller=user&method=list&leftmenu=users", Globals::$langs->trans("ListOfUsers"), 2, Globals::$user->rights->user->user->lire || Globals::$user->admin);
|
|
| 770 | + $newmenu->add(BASE_URI."?controller=user&method=hierarchy&leftmenu=users", Globals::$langs->trans("HierarchicView"), 2, Globals::$user->rights->user->user->lire || Globals::$user->admin);
|
|
| 771 | 771 | if (!empty($conf->categorie->enabled)) {
|
| 772 | 772 | Globals::$langs->load("categories");
|
| 773 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&leftmenu=users&type=7", Globals::$langs->trans("UsersCategoriesShort"), 2, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
|
| 773 | + $newmenu->add(BASE_URI."?controller=categories&method=index&leftmenu=users&type=7", Globals::$langs->trans("UsersCategoriesShort"), 2, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
|
| 774 | 774 | } |
| 775 | 775 | $newmenu->add("", Globals::$langs->trans("Groups"), 1, (Globals::$user->rights->user->user->lire || Globals::$user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && Globals::$conf->global->MULTICOMPANY_TRANSVERSE_MODE));
|
| 776 | - $newmenu->add(BASE_URI . "?controller=user/group&method=card&leftmenu=users&action=create", Globals::$langs->trans("NewGroup"), 2, ((Globals::$conf->global->MAIN_USE_ADVANCED_PERMS ? Globals::$user->rights->user->group_advance->write : Globals::$user->rights->user->user->creer) || Globals::$user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && Globals::$conf->global->MULTICOMPANY_TRANSVERSE_MODE));
|
|
| 777 | - $newmenu->add(BASE_URI . "?controller=user/group&method=list&leftmenu=users", Globals::$langs->trans("ListOfGroups"), 2, ((Globals::$conf->global->MAIN_USE_ADVANCED_PERMS ? Globals::$user->rights->user->group_advance->read : Globals::$user->rights->user->user->lire) || Globals::$user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && Globals::$conf->global->MULTICOMPANY_TRANSVERSE_MODE));
|
|
| 776 | + $newmenu->add(BASE_URI."?controller=user/group&method=card&leftmenu=users&action=create", Globals::$langs->trans("NewGroup"), 2, ((Globals::$conf->global->MAIN_USE_ADVANCED_PERMS ? Globals::$user->rights->user->group_advance->write : Globals::$user->rights->user->user->creer) || Globals::$user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && Globals::$conf->global->MULTICOMPANY_TRANSVERSE_MODE));
|
|
| 777 | + $newmenu->add(BASE_URI."?controller=user/group&method=list&leftmenu=users", Globals::$langs->trans("ListOfGroups"), 2, ((Globals::$conf->global->MAIN_USE_ADVANCED_PERMS ? Globals::$user->rights->user->group_advance->read : Globals::$user->rights->user->user->lire) || Globals::$user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && Globals::$conf->global->MULTICOMPANY_TRANSVERSE_MODE));
|
|
| 778 | 778 | } |
| 779 | 779 | } |
| 780 | 780 | } |
@@ -787,26 +787,26 @@ discard block |
||
| 787 | 787 | if (!empty($conf->societe->enabled)) {
|
| 788 | 788 | Globals::$langs->load("companies");
|
| 789 | 789 | //$newmenu->add("/societe/index.php?leftmenu=thirdparties", Globals::$langs->trans("ThirdParty"), 0, Globals::$user->rights->societe->lire, '', $mainmenu, 'thirdparties');
|
| 790 | - $newmenu->add(BASE_URI . "?controller=societe&method=index&leftmenu=thirdparties", Globals::$langs->trans("ThirdParty"), 0, Globals::$user->rights->societe->lire, '', $mainmenu, 'thirdparties');
|
|
| 790 | + $newmenu->add(BASE_URI."?controller=societe&method=index&leftmenu=thirdparties", Globals::$langs->trans("ThirdParty"), 0, Globals::$user->rights->societe->lire, '', $mainmenu, 'thirdparties');
|
|
| 791 | 791 | |
| 792 | 792 | if (Globals::$user->rights->societe->creer) {
|
| 793 | 793 | //$newmenu->add("/societe/card.php?action=create", Globals::$langs->trans("MenuNewThirdParty"), 1);
|
| 794 | - $newmenu->add(BASE_URI . "?controller=societe&method=card&action=create", Globals::$langs->trans("MenuNewThirdParty"), 1);
|
|
| 794 | + $newmenu->add(BASE_URI."?controller=societe&method=card&action=create", Globals::$langs->trans("MenuNewThirdParty"), 1);
|
|
| 795 | 795 | if (!$conf->use_javascript_ajax) {
|
| 796 | 796 | //$newmenu->add("/societe/card.php?action=create&private=1", Globals::$langs->trans("MenuNewPrivateIndividual"), 1);
|
| 797 | - $newmenu->add(BASE_URI . "?controller=societe&method=card&action=create&private=1", Globals::$langs->trans("MenuNewPrivateIndividual"), 1);
|
|
| 797 | + $newmenu->add(BASE_URI."?controller=societe&method=card&action=create&private=1", Globals::$langs->trans("MenuNewPrivateIndividual"), 1);
|
|
| 798 | 798 | } |
| 799 | 799 | } |
| 800 | 800 | } |
| 801 | 801 | |
| 802 | 802 | //$newmenu->add("/societe/list.php?leftmenu=thirdparties", Globals::$langs->trans("List"), 1);
|
| 803 | - $newmenu->add(BASE_URI . "?controller=societe&method=list&leftmenu=thirdparties", Globals::$langs->trans("List"), 1);
|
|
| 803 | + $newmenu->add(BASE_URI."?controller=societe&method=list&leftmenu=thirdparties", Globals::$langs->trans("List"), 1);
|
|
| 804 | 804 | |
| 805 | 805 | // Prospects |
| 806 | 806 | if (!empty($conf->societe->enabled) && empty(Globals::$conf->global->SOCIETE_DISABLE_PROSPECTS)) {
|
| 807 | 807 | Globals::$langs->load("commercial");
|
| 808 | 808 | //$newmenu->add("/societe/list.php?type=p&leftmenu=prospects", Globals::$langs->trans("ListProspectsShort"), 1, Globals::$user->rights->societe->lire, '', $mainmenu, 'prospects');
|
| 809 | - $newmenu->add(BASE_URI . "?controller=societe&method=list&type=p&leftmenu=prospects", Globals::$langs->trans("ListProspectsShort"), 1, Globals::$user->rights->societe->lire, '', $mainmenu, 'prospects');
|
|
| 809 | + $newmenu->add(BASE_URI."?controller=societe&method=list&type=p&leftmenu=prospects", Globals::$langs->trans("ListProspectsShort"), 1, Globals::$user->rights->societe->lire, '', $mainmenu, 'prospects');
|
|
| 810 | 810 | /* no more required, there is a filter that can do more |
| 811 | 811 | if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=-1", Globals::$langs->trans("LastProspectDoNotContact"), 2, Globals::$user->rights->societe->lire);
|
| 812 | 812 | if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=0", Globals::$langs->trans("LastProspectNeverContacted"), 2, Globals::$user->rights->societe->lire);
|
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=3", Globals::$langs->trans("LastProspectContactDone"), 2, Globals::$user->rights->societe->lire);
|
| 816 | 816 | */ |
| 817 | 817 | //$newmenu->add("/societe/card.php?leftmenu=prospects&action=create&type=p", Globals::$langs->trans("MenuNewProspect"), 2, Globals::$user->rights->societe->creer);
|
| 818 | - $newmenu->add(BASE_URI . "?controller=societe&method=card&leftmenu=prospects&action=create&type=p", Globals::$langs->trans("MenuNewProspect"), 2, Globals::$user->rights->societe->creer);
|
|
| 818 | + $newmenu->add(BASE_URI."?controller=societe&method=card&leftmenu=prospects&action=create&type=p", Globals::$langs->trans("MenuNewProspect"), 2, Globals::$user->rights->societe->creer);
|
|
| 819 | 819 | //$newmenu->add("/contact/list.php?leftmenu=customers&type=p", Globals::$langs->trans("Contacts"), 2, Globals::$user->rights->societe->contact->lire);
|
| 820 | 820 | } |
| 821 | 821 | |
@@ -823,10 +823,10 @@ discard block |
||
| 823 | 823 | if (!empty($conf->societe->enabled) && empty(Globals::$conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
|
| 824 | 824 | Globals::$langs->load("commercial");
|
| 825 | 825 | //$newmenu->add("/societe/list.php?type=c&leftmenu=customers", Globals::$langs->trans("ListCustomersShort"), 1, Globals::$user->rights->societe->lire, '', $mainmenu, 'customers');
|
| 826 | - $newmenu->add(BASE_URI . "?controller=societe&method=list&type=c&leftmenu=customers", Globals::$langs->trans("ListCustomersShort"), 1, Globals::$user->rights->societe->lire, '', $mainmenu, 'customers');
|
|
| 826 | + $newmenu->add(BASE_URI."?controller=societe&method=list&type=c&leftmenu=customers", Globals::$langs->trans("ListCustomersShort"), 1, Globals::$user->rights->societe->lire, '', $mainmenu, 'customers');
|
|
| 827 | 827 | |
| 828 | 828 | //$newmenu->add("/societe/card.php?leftmenu=customers&action=create&type=c", Globals::$langs->trans("MenuNewCustomer"), 2, Globals::$user->rights->societe->creer);
|
| 829 | - $newmenu->add(BASE_URI . "?controller=societe&method=card&leftmenu=customers&action=create&type=c", Globals::$langs->trans("MenuNewCustomer"), 2, Globals::$user->rights->societe->creer);
|
|
| 829 | + $newmenu->add(BASE_URI."?controller=societe&method=card&leftmenu=customers&action=create&type=c", Globals::$langs->trans("MenuNewCustomer"), 2, Globals::$user->rights->societe->creer);
|
|
| 830 | 830 | //$newmenu->add("/contact/list.php?leftmenu=customers&type=c", Globals::$langs->trans("Contacts"), 2, Globals::$user->rights->societe->contact->lire);
|
| 831 | 831 | } |
| 832 | 832 | |
@@ -835,8 +835,8 @@ discard block |
||
| 835 | 835 | Globals::$langs->load("suppliers");
|
| 836 | 836 | //$newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", Globals::$langs->trans("ListSuppliersShort"), 1, (Globals::$user->rights->fournisseur->lire || Globals::$user->rights->supplier_proposal->lire), '', $mainmenu, 'suppliers');
|
| 837 | 837 | //$newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", Globals::$langs->trans("MenuNewSupplier"), 2, Globals::$user->rights->societe->creer && (Globals::$user->rights->fournisseur->lire || Globals::$user->rights->supplier_proposal->lire));
|
| 838 | - $newmenu->add(BASE_URI . "?controller=societe&method=list&type=f&leftmenu=suppliers", Globals::$langs->trans("ListSuppliersShort"), 1, (Globals::$user->rights->fournisseur->lire || Globals::$user->rights->supplier_proposal->lire), '', $mainmenu, 'suppliers');
|
|
| 839 | - $newmenu->add(BASE_URI . "?controller=societe&method=card&leftmenu=suppliers&action=create&type=f", Globals::$langs->trans("MenuNewSupplier"), 2, Globals::$user->rights->societe->creer && (Globals::$user->rights->fournisseur->lire || Globals::$user->rights->supplier_proposal->lire));
|
|
| 838 | + $newmenu->add(BASE_URI."?controller=societe&method=list&type=f&leftmenu=suppliers", Globals::$langs->trans("ListSuppliersShort"), 1, (Globals::$user->rights->fournisseur->lire || Globals::$user->rights->supplier_proposal->lire), '', $mainmenu, 'suppliers');
|
|
| 839 | + $newmenu->add(BASE_URI."?controller=societe&method=card&leftmenu=suppliers&action=create&type=f", Globals::$langs->trans("MenuNewSupplier"), 2, Globals::$user->rights->societe->creer && (Globals::$user->rights->fournisseur->lire || Globals::$user->rights->supplier_proposal->lire));
|
|
| 840 | 840 | } |
| 841 | 841 | |
| 842 | 842 | // Categories |
@@ -852,12 +852,12 @@ discard block |
||
| 852 | 852 | $menutoshow = Globals::$langs->trans("ProspectsCategoriesShort");
|
| 853 | 853 | } |
| 854 | 854 | //$newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
| 855 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&leftmenu=cat&type=2", $menutoshow, 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat'); |
|
| 855 | + $newmenu->add(BASE_URI."?controller=categories&method=index&leftmenu=cat&type=2", $menutoshow, 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat'); |
|
| 856 | 856 | } |
| 857 | 857 | // Categories suppliers |
| 858 | 858 | if (!empty($conf->fournisseur->enabled)) {
|
| 859 | 859 | //$newmenu->add("/categories/index.php?leftmenu=catfournish&type=1", Globals::$langs->trans("SuppliersCategoriesShort"), 1, Globals::$user->rights->categorie->lire);
|
| 860 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&leftmenu=catfournish&type=1", Globals::$langs->trans("SuppliersCategoriesShort"), 1, Globals::$user->rights->categorie->lire);
|
|
| 860 | + $newmenu->add(BASE_URI."?controller=categories&method=index&leftmenu=catfournish&type=1", Globals::$langs->trans("SuppliersCategoriesShort"), 1, Globals::$user->rights->categorie->lire);
|
|
| 861 | 861 | } |
| 862 | 862 | } |
| 863 | 863 | |
@@ -865,30 +865,30 @@ discard block |
||
| 865 | 865 | //$newmenu->add("/societe/index.php?leftmenu=thirdparties", (!empty(Globals::$conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? Globals::$langs->trans("Contacts") : Globals::$langs->trans("ContactsAddresses")), 0, Globals::$user->rights->societe->contact->lire, '', $mainmenu, 'contacts');
|
| 866 | 866 | //$newmenu->add("/contact/card.php?leftmenu=contacts&action=create", (!empty(Globals::$conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? Globals::$langs->trans("NewContact") : Globals::$langs->trans("NewContactAddress")), 1, Globals::$user->rights->societe->contact->creer);
|
| 867 | 867 | //$newmenu->add("/contact/list.php?leftmenu=contacts", Globals::$langs->trans("List"), 1, Globals::$user->rights->societe->contact->lire);
|
| 868 | - $newmenu->add(BASE_URI . "?controller=societe&method=index&leftmenu=thirdparties", (!empty(Globals::$conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? Globals::$langs->trans("Contacts") : Globals::$langs->trans("ContactsAddresses")), 0, Globals::$user->rights->societe->contact->lire, '', $mainmenu, 'contacts');
|
|
| 869 | - $newmenu->add(BASE_URI . "?controller=contact&method=card&leftmenu=contacts&action=create", (!empty(Globals::$conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? Globals::$langs->trans("NewContact") : Globals::$langs->trans("NewContactAddress")), 1, Globals::$user->rights->societe->contact->creer);
|
|
| 870 | - $newmenu->add(BASE_URI . "?controller=contact&method=list&leftmenu=contacts", Globals::$langs->trans("List"), 1, Globals::$user->rights->societe->contact->lire);
|
|
| 868 | + $newmenu->add(BASE_URI."?controller=societe&method=index&leftmenu=thirdparties", (!empty(Globals::$conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? Globals::$langs->trans("Contacts") : Globals::$langs->trans("ContactsAddresses")), 0, Globals::$user->rights->societe->contact->lire, '', $mainmenu, 'contacts');
|
|
| 869 | + $newmenu->add(BASE_URI."?controller=contact&method=card&leftmenu=contacts&action=create", (!empty(Globals::$conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? Globals::$langs->trans("NewContact") : Globals::$langs->trans("NewContactAddress")), 1, Globals::$user->rights->societe->contact->creer);
|
|
| 870 | + $newmenu->add(BASE_URI."?controller=contact&method=list&leftmenu=contacts", Globals::$langs->trans("List"), 1, Globals::$user->rights->societe->contact->lire);
|
|
| 871 | 871 | if (empty(Globals::$conf->global->SOCIETE_DISABLE_PROSPECTS)) {
|
| 872 | 872 | //$newmenu->add("/contact/list.php?leftmenu=contacts&type=p", Globals::$langs->trans("Prospects"), 2, Globals::$user->rights->societe->contact->lire);
|
| 873 | - $newmenu->add(BASE_URI . "?controller=contact&method=list&leftmenu=contacts&type=p", Globals::$langs->trans("Prospects"), 2, Globals::$user->rights->societe->contact->lire);
|
|
| 873 | + $newmenu->add(BASE_URI."?controller=contact&method=list&leftmenu=contacts&type=p", Globals::$langs->trans("Prospects"), 2, Globals::$user->rights->societe->contact->lire);
|
|
| 874 | 874 | } |
| 875 | 875 | if (empty(Globals::$conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
|
| 876 | 876 | //$newmenu->add("/contact/list.php?leftmenu=contacts&type=c", Globals::$langs->trans("Customers"), 2, Globals::$user->rights->societe->contact->lire);
|
| 877 | - $newmenu->add(BASE_URI . "?controller=contact&method=list&leftmenu=contacts&type=c", Globals::$langs->trans("Customers"), 2, Globals::$user->rights->societe->contact->lire);
|
|
| 877 | + $newmenu->add(BASE_URI."?controller=contact&method=list&leftmenu=contacts&type=c", Globals::$langs->trans("Customers"), 2, Globals::$user->rights->societe->contact->lire);
|
|
| 878 | 878 | } |
| 879 | 879 | if (!empty($conf->fournisseur->enabled)) {
|
| 880 | 880 | //$newmenu->add("/contact/list.php?leftmenu=contacts&type=f", Globals::$langs->trans("Suppliers"), 2, Globals::$user->rights->societe->contact->lire);
|
| 881 | - $newmenu->add(BASE_URI . "?controller=contact&method=list&leftmenu=contacts&type=f", Globals::$langs->trans("Suppliers"), 2, Globals::$user->rights->societe->contact->lire);
|
|
| 881 | + $newmenu->add(BASE_URI."?controller=contact&method=list&leftmenu=contacts&type=f", Globals::$langs->trans("Suppliers"), 2, Globals::$user->rights->societe->contact->lire);
|
|
| 882 | 882 | } |
| 883 | 883 | //$newmenu->add("/contact/list.php?leftmenu=contacts&type=o", Globals::$langs->trans("ContactOthers"), 2, Globals::$user->rights->societe->contact->lire);
|
| 884 | - $newmenu->add(BASE_URI . "?controller=contact&methos=list&leftmenu=contacts&type=o", Globals::$langs->trans("ContactOthers"), 2, Globals::$user->rights->societe->contact->lire);
|
|
| 884 | + $newmenu->add(BASE_URI."?controller=contact&methos=list&leftmenu=contacts&type=o", Globals::$langs->trans("ContactOthers"), 2, Globals::$user->rights->societe->contact->lire);
|
|
| 885 | 885 | //$newmenu->add("/contact/list.php?userid=Globals::$user->id", Globals::$langs->trans("MyContacts"), 1, Globals::$user->rights->societe->contact->lire);
|
| 886 | 886 | // Categories |
| 887 | 887 | if (!empty($conf->categorie->enabled)) {
|
| 888 | 888 | Globals::$langs->load("categories");
|
| 889 | 889 | // Categories Contact |
| 890 | 890 | //$newmenu->add("/categories/index.php?leftmenu=catcontact&type=4", Globals::$langs->trans("ContactCategoriesShort"), 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
| 891 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&leftmenu=catcontact&type=4", Globals::$langs->trans("ContactCategoriesShort"), 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
|
| 891 | + $newmenu->add(BASE_URI."?controller=categories&method=index&leftmenu=catcontact&type=4", Globals::$langs->trans("ContactCategoriesShort"), 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
|
| 892 | 892 | } |
| 893 | 893 | } |
| 894 | 894 | |
@@ -904,9 +904,9 @@ discard block |
||
| 904 | 904 | //$newmenu->add("/comm/propal/index.php?leftmenu=propals", Globals::$langs->trans("Proposals"), 0, Globals::$user->rights->propale->lire, '', $mainmenu, 'propals', 100);
|
| 905 | 905 | //$newmenu->add("/comm/propal/card.php?action=create&leftmenu=propals", Globals::$langs->trans("NewPropal"), 1, Globals::$user->rights->propale->creer);
|
| 906 | 906 | //$newmenu->add("/comm/propal/list.php?leftmenu=propals", Globals::$langs->trans("List"), 1, Globals::$user->rights->propale->lire);
|
| 907 | - $newmenu->add(BASE_URI . "?controller=comm/propal&method=index&leftmenu=propals", Globals::$langs->trans("Proposals"), 0, Globals::$user->rights->propale->lire, '', $mainmenu, 'propals', 100);
|
|
| 908 | - $newmenu->add(BASE_URI . "?controller=comm/propal&method=card&action=create&leftmenu=propals", Globals::$langs->trans("NewPropal"), 1, Globals::$user->rights->propale->creer);
|
|
| 909 | - $newmenu->add(BASE_URI . "?controller=comm/propal&method=list&leftmenu=propals", Globals::$langs->trans("List"), 1, Globals::$user->rights->propale->lire);
|
|
| 907 | + $newmenu->add(BASE_URI."?controller=comm/propal&method=index&leftmenu=propals", Globals::$langs->trans("Proposals"), 0, Globals::$user->rights->propale->lire, '', $mainmenu, 'propals', 100);
|
|
| 908 | + $newmenu->add(BASE_URI."?controller=comm/propal&method=card&action=create&leftmenu=propals", Globals::$langs->trans("NewPropal"), 1, Globals::$user->rights->propale->creer);
|
|
| 909 | + $newmenu->add(BASE_URI."?controller=comm/propal&method=list&leftmenu=propals", Globals::$langs->trans("List"), 1, Globals::$user->rights->propale->lire);
|
|
| 910 | 910 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "propals") {
|
| 911 | 911 | /* |
| 912 | 912 | $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=0", Globals::$langs->trans("PropalsDraft"), 2, Globals::$user->rights->propale->lire);
|
@@ -915,15 +915,15 @@ discard block |
||
| 915 | 915 | $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=3", Globals::$langs->trans("PropalStatusNotSigned"), 2, Globals::$user->rights->propale->lire);
|
| 916 | 916 | $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=4", Globals::$langs->trans("PropalStatusBilled"), 2, Globals::$user->rights->propale->lire);
|
| 917 | 917 | */ |
| 918 | - $newmenu->add(BASE_URI . "?controller=comm/propal&method=list&leftmenu=propals&viewstatut=0", Globals::$langs->trans("PropalsDraft"), 2, Globals::$user->rights->propale->lire);
|
|
| 919 | - $newmenu->add(BASE_URI . "?controller=comm/propal&method=list&leftmenu=propals&viewstatut=1", Globals::$langs->trans("PropalsOpened"), 2, Globals::$user->rights->propale->lire);
|
|
| 920 | - $newmenu->add(BASE_URI . "?controller=comm/propal&method=list&leftmenu=propals&viewstatut=2", Globals::$langs->trans("PropalStatusSigned"), 2, Globals::$user->rights->propale->lire);
|
|
| 921 | - $newmenu->add(BASE_URI . "?controller=comm/propal&method=list&leftmenu=propals&viewstatut=3", Globals::$langs->trans("PropalStatusNotSigned"), 2, Globals::$user->rights->propale->lire);
|
|
| 922 | - $newmenu->add(BASE_URI . "?controller=comm/propal&method=list&leftmenu=propals&viewstatut=4", Globals::$langs->trans("PropalStatusBilled"), 2, Globals::$user->rights->propale->lire);
|
|
| 918 | + $newmenu->add(BASE_URI."?controller=comm/propal&method=list&leftmenu=propals&viewstatut=0", Globals::$langs->trans("PropalsDraft"), 2, Globals::$user->rights->propale->lire);
|
|
| 919 | + $newmenu->add(BASE_URI."?controller=comm/propal&method=list&leftmenu=propals&viewstatut=1", Globals::$langs->trans("PropalsOpened"), 2, Globals::$user->rights->propale->lire);
|
|
| 920 | + $newmenu->add(BASE_URI."?controller=comm/propal&method=list&leftmenu=propals&viewstatut=2", Globals::$langs->trans("PropalStatusSigned"), 2, Globals::$user->rights->propale->lire);
|
|
| 921 | + $newmenu->add(BASE_URI."?controller=comm/propal&method=list&leftmenu=propals&viewstatut=3", Globals::$langs->trans("PropalStatusNotSigned"), 2, Globals::$user->rights->propale->lire);
|
|
| 922 | + $newmenu->add(BASE_URI."?controller=comm/propal&method=list&leftmenu=propals&viewstatut=4", Globals::$langs->trans("PropalStatusBilled"), 2, Globals::$user->rights->propale->lire);
|
|
| 923 | 923 | //$newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=2,3,4", Globals::$langs->trans("PropalStatusClosedShort"), 2, Globals::$user->rights->propale->lire);
|
| 924 | 924 | } |
| 925 | 925 | //$newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->propale->lire);
|
| 926 | - $newmenu->add(BASE_URI . "?controller=comm/propal/stats&method=index&leftmenu=propals", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->propale->lire);
|
|
| 926 | + $newmenu->add(BASE_URI."?controller=comm/propal/stats&method=index&leftmenu=propals", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->propale->lire);
|
|
| 927 | 927 | } |
| 928 | 928 | |
| 929 | 929 | // Customers orders |
@@ -932,26 +932,26 @@ discard block |
||
| 932 | 932 | //$newmenu->add("/commande/index.php?leftmenu=orders", Globals::$langs->trans("CustomersOrders"), 0, Globals::$user->rights->commande->lire, '', $mainmenu, 'orders', 200);
|
| 933 | 933 | //$newmenu->add("/commande/card.php?action=create&leftmenu=orders", Globals::$langs->trans("NewOrder"), 1, Globals::$user->rights->commande->creer);
|
| 934 | 934 | //$newmenu->add("/commande/list.php?leftmenu=orders", Globals::$langs->trans("List"), 1, Globals::$user->rights->commande->lire);
|
| 935 | - $newmenu->add(BASE_URI . "?controller=commande&method=index&leftmenu=orders", Globals::$langs->trans("CustomersOrders"), 0, Globals::$user->rights->commande->lire, '', $mainmenu, 'orders', 200);
|
|
| 936 | - $newmenu->add(BASE_URI . "?controller=commande&method=card&action=create&leftmenu=orders", Globals::$langs->trans("NewOrder"), 1, Globals::$user->rights->commande->creer);
|
|
| 937 | - $newmenu->add(BASE_URI . "?controller=commande&method=list&leftmenu=orders", Globals::$langs->trans("List"), 1, Globals::$user->rights->commande->lire);
|
|
| 935 | + $newmenu->add(BASE_URI."?controller=commande&method=index&leftmenu=orders", Globals::$langs->trans("CustomersOrders"), 0, Globals::$user->rights->commande->lire, '', $mainmenu, 'orders', 200);
|
|
| 936 | + $newmenu->add(BASE_URI."?controller=commande&method=card&action=create&leftmenu=orders", Globals::$langs->trans("NewOrder"), 1, Globals::$user->rights->commande->creer);
|
|
| 937 | + $newmenu->add(BASE_URI."?controller=commande&method=list&leftmenu=orders", Globals::$langs->trans("List"), 1, Globals::$user->rights->commande->lire);
|
|
| 938 | 938 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders") {
|
| 939 | 939 | //$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=0", Globals::$langs->trans("StatusOrderDraftShort"), 2, Globals::$user->rights->commande->lire);
|
| 940 | 940 | //$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=1", Globals::$langs->trans("StatusOrderValidated"), 2, Globals::$user->rights->commande->lire);
|
| 941 | - $newmenu->add(BASE_URI . "?controller=commande&method=list&leftmenu=orders&viewstatut=0", Globals::$langs->trans("StatusOrderDraftShort"), 2, Globals::$user->rights->commande->lire);
|
|
| 942 | - $newmenu->add(BASE_URI . "?controller=commande&method=list&leftmenu=orders&viewstatut=1", Globals::$langs->trans("StatusOrderValidated"), 2, Globals::$user->rights->commande->lire);
|
|
| 941 | + $newmenu->add(BASE_URI."?controller=commande&method=list&leftmenu=orders&viewstatut=0", Globals::$langs->trans("StatusOrderDraftShort"), 2, Globals::$user->rights->commande->lire);
|
|
| 942 | + $newmenu->add(BASE_URI."?controller=commande&method=list&leftmenu=orders&viewstatut=1", Globals::$langs->trans("StatusOrderValidated"), 2, Globals::$user->rights->commande->lire);
|
|
| 943 | 943 | if (!empty($conf->expedition->enabled)) {
|
| 944 | 944 | //$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=2", Globals::$langs->trans("StatusOrderSentShort"), 2, Globals::$user->rights->commande->lire);
|
| 945 | - $newmenu->add(BASE_URI . "?controller=commande&method=list&leftmenu=orders&viewstatut=2", Globals::$langs->trans("StatusOrderSentShort"), 2, Globals::$user->rights->commande->lire);
|
|
| 945 | + $newmenu->add(BASE_URI."?controller=commande&method=list&leftmenu=orders&viewstatut=2", Globals::$langs->trans("StatusOrderSentShort"), 2, Globals::$user->rights->commande->lire);
|
|
| 946 | 946 | } |
| 947 | 947 | //$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=3", Globals::$langs->trans("StatusOrderDelivered"), 2, Globals::$user->rights->commande->lire);
|
| 948 | - $newmenu->add(BASE_URI . "?controller=commande&method=list&leftmenu=orders&viewstatut=3", Globals::$langs->trans("StatusOrderDelivered"), 2, Globals::$user->rights->commande->lire);
|
|
| 948 | + $newmenu->add(BASE_URI."?controller=commande&method=list&leftmenu=orders&viewstatut=3", Globals::$langs->trans("StatusOrderDelivered"), 2, Globals::$user->rights->commande->lire);
|
|
| 949 | 949 | //$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=4", Globals::$langs->trans("StatusOrderProcessed"), 2, Globals::$user->rights->commande->lire);
|
| 950 | 950 | //$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=-1", Globals::$langs->trans("StatusOrderCanceledShort"), 2, Globals::$user->rights->commande->lire);
|
| 951 | - $newmenu->add(BASE_URI . "?controller=commande&method=list&leftmenu=orders&viewstatut=-1", Globals::$langs->trans("StatusOrderCanceledShort"), 2, Globals::$user->rights->commande->lire);
|
|
| 951 | + $newmenu->add(BASE_URI."?controller=commande&method=list&leftmenu=orders&viewstatut=-1", Globals::$langs->trans("StatusOrderCanceledShort"), 2, Globals::$user->rights->commande->lire);
|
|
| 952 | 952 | } |
| 953 | 953 | //$newmenu->add("/commande/stats/index.php?leftmenu=orders", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->commande->lire);
|
| 954 | - $newmenu->add(BASE_URI . "?controller=commande/stats&method=index&leftmenu=orders", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->commande->lire);
|
|
| 954 | + $newmenu->add(BASE_URI."?controller=commande/stats&method=index&leftmenu=orders", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->commande->lire);
|
|
| 955 | 955 | } |
| 956 | 956 | |
| 957 | 957 | // Suppliers orders |
@@ -960,16 +960,16 @@ discard block |
||
| 960 | 960 | //$newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", Globals::$langs->trans("SuppliersOrders"), 0, Globals::$user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers', 400);
|
| 961 | 961 | //$newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", Globals::$langs->trans("NewOrder"), 1, Globals::$user->rights->fournisseur->commande->creer);
|
| 962 | 962 | //$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", Globals::$langs->trans("List"), 1, Globals::$user->rights->fournisseur->commande->lire);
|
| 963 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=index&leftmenu=orders_suppliers", Globals::$langs->trans("SuppliersOrders"), 0, Globals::$user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers', 400);
|
|
| 964 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=card&action=create&leftmenu=orders_suppliers", Globals::$langs->trans("NewOrder"), 1, Globals::$user->rights->fournisseur->commande->creer);
|
|
| 965 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers", Globals::$langs->trans("List"), 1, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 963 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=index&leftmenu=orders_suppliers", Globals::$langs->trans("SuppliersOrders"), 0, Globals::$user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers', 400);
|
|
| 964 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=card&action=create&leftmenu=orders_suppliers", Globals::$langs->trans("NewOrder"), 1, Globals::$user->rights->fournisseur->commande->creer);
|
|
| 965 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers", Globals::$langs->trans("List"), 1, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 966 | 966 | |
| 967 | 967 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders_suppliers") {
|
| 968 | 968 | //$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", Globals::$langs->trans("StatusOrderDraftShort"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
| 969 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=0", Globals::$langs->trans("StatusOrderDraftShort"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 969 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=0", Globals::$langs->trans("StatusOrderDraftShort"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 970 | 970 | if (empty(Globals::$conf->global->SUPPLIER_ORDER_HIDE_VALIDATED)) {
|
| 971 | 971 | //$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", Globals::$langs->trans("StatusOrderValidated"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
| 972 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=1", Globals::$langs->trans("StatusOrderValidated"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 972 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=1", Globals::$langs->trans("StatusOrderValidated"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 973 | 973 | } |
| 974 | 974 | /* |
| 975 | 975 | $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", Globals::$langs->trans("StatusOrderApprovedShort"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
@@ -979,16 +979,16 @@ discard block |
||
| 979 | 979 | $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", Globals::$langs->trans("StatusOrderCanceled"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
| 980 | 980 | $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", Globals::$langs->trans("StatusOrderRefused"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
| 981 | 981 | */ |
| 982 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=2", Globals::$langs->trans("StatusOrderApprovedShort"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 983 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=3", Globals::$langs->trans("StatusOrderOnProcessShort"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 984 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=4", Globals::$langs->trans("StatusOrderReceivedPartiallyShort"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 985 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=5", Globals::$langs->trans("StatusOrderReceivedAll"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 986 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=6,7", Globals::$langs->trans("StatusOrderCanceled"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 987 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=9", Globals::$langs->trans("StatusOrderRefused"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 982 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=2", Globals::$langs->trans("StatusOrderApprovedShort"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 983 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=3", Globals::$langs->trans("StatusOrderOnProcessShort"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 984 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=4", Globals::$langs->trans("StatusOrderReceivedPartiallyShort"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 985 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=5", Globals::$langs->trans("StatusOrderReceivedAll"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 986 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=6,7", Globals::$langs->trans("StatusOrderCanceled"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 987 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders_suppliers&statut=9", Globals::$langs->trans("StatusOrderRefused"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 988 | 988 | } |
| 989 | 989 | // 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", Globals::$langs->trans("StatusOrderBilled"), 2, Globals::$user->rights->fournisseur->commande->lire);
|
| 990 | 990 | //$newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->fournisseur->commande->lire);
|
| 991 | - $newmenu->add(BASE_URI . "?controller=commande/stats&method=index&leftmenu=orders_suppliers&mode=supplier", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 991 | + $newmenu->add(BASE_URI."?controller=commande/stats&method=index&leftmenu=orders_suppliers&mode=supplier", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 992 | 992 | } |
| 993 | 993 | |
| 994 | 994 | // Contrat |
@@ -1000,10 +1000,10 @@ discard block |
||
| 1000 | 1000 | $newmenu->add("/contrat/list.php?leftmenu=contracts", Globals::$langs->trans("List"), 1, Globals::$user->rights->contrat->lire);
|
| 1001 | 1001 | $newmenu->add("/contrat/services_list.php?leftmenu=contracts", Globals::$langs->trans("MenuServices"), 1, Globals::$user->rights->contrat->lire);
|
| 1002 | 1002 | */ |
| 1003 | - $newmenu->add(BASE_URI . "?controller=contrat&method=index&leftmenu=contracts", Globals::$langs->trans("ContractsSubscriptions"), 0, Globals::$user->rights->contrat->lire, '', $mainmenu, 'contracts', 2000);
|
|
| 1004 | - $newmenu->add(BASE_URI . "?controller=contrat&method=card&action=create&leftmenu=contracts", Globals::$langs->trans("NewContractSubscription"), 1, Globals::$user->rights->contrat->creer);
|
|
| 1005 | - $newmenu->add(BASE_URI . "?controller=contrat&method=list&leftmenu=contracts", Globals::$langs->trans("List"), 1, Globals::$user->rights->contrat->lire);
|
|
| 1006 | - $newmenu->add(BASE_URI . "?controller=contrat&method=services_list&leftmenu=contracts", Globals::$langs->trans("MenuServices"), 1, Globals::$user->rights->contrat->lire);
|
|
| 1003 | + $newmenu->add(BASE_URI."?controller=contrat&method=index&leftmenu=contracts", Globals::$langs->trans("ContractsSubscriptions"), 0, Globals::$user->rights->contrat->lire, '', $mainmenu, 'contracts', 2000);
|
|
| 1004 | + $newmenu->add(BASE_URI."?controller=contrat&method=card&action=create&leftmenu=contracts", Globals::$langs->trans("NewContractSubscription"), 1, Globals::$user->rights->contrat->creer);
|
|
| 1005 | + $newmenu->add(BASE_URI."?controller=contrat&method=list&leftmenu=contracts", Globals::$langs->trans("List"), 1, Globals::$user->rights->contrat->lire);
|
|
| 1006 | + $newmenu->add(BASE_URI."?controller=contrat&method=services_list&leftmenu=contracts", Globals::$langs->trans("MenuServices"), 1, Globals::$user->rights->contrat->lire);
|
|
| 1007 | 1007 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "contracts") {
|
| 1008 | 1008 | /* |
| 1009 | 1009 | $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=0", Globals::$langs->trans("MenuInactiveServices"), 2, Globals::$user->rights->contrat->lire);
|
@@ -1011,10 +1011,10 @@ discard block |
||
| 1011 | 1011 | $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=4&filter=expired", Globals::$langs->trans("MenuExpiredServices"), 2, Globals::$user->rights->contrat->lire);
|
| 1012 | 1012 | $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=5", Globals::$langs->trans("MenuClosedServices"), 2, Globals::$user->rights->contrat->lire);
|
| 1013 | 1013 | */ |
| 1014 | - $newmenu->add(BASE_URI . "?controller=contrat&method=services_list&leftmenu=contracts&mode=0", Globals::$langs->trans("MenuInactiveServices"), 2, Globals::$user->rights->contrat->lire);
|
|
| 1015 | - $newmenu->add(BASE_URI . "?controller=contrat&method=services_list&leftmenu=contracts&mode=4", Globals::$langs->trans("MenuRunningServices"), 2, Globals::$user->rights->contrat->lire);
|
|
| 1016 | - $newmenu->add(BASE_URI . "?controller=contrat&method=services_list&leftmenu=contracts&mode=4&filter=expired", Globals::$langs->trans("MenuExpiredServices"), 2, Globals::$user->rights->contrat->lire);
|
|
| 1017 | - $newmenu->add(BASE_URI . "?controller=contrat&method=services_list&leftmenu=contracts&mode=5", Globals::$langs->trans("MenuClosedServices"), 2, Globals::$user->rights->contrat->lire);
|
|
| 1014 | + $newmenu->add(BASE_URI."?controller=contrat&method=services_list&leftmenu=contracts&mode=0", Globals::$langs->trans("MenuInactiveServices"), 2, Globals::$user->rights->contrat->lire);
|
|
| 1015 | + $newmenu->add(BASE_URI."?controller=contrat&method=services_list&leftmenu=contracts&mode=4", Globals::$langs->trans("MenuRunningServices"), 2, Globals::$user->rights->contrat->lire);
|
|
| 1016 | + $newmenu->add(BASE_URI."?controller=contrat&method=services_list&leftmenu=contracts&mode=4&filter=expired", Globals::$langs->trans("MenuExpiredServices"), 2, Globals::$user->rights->contrat->lire);
|
|
| 1017 | + $newmenu->add(BASE_URI."?controller=contrat&method=services_list&leftmenu=contracts&mode=5", Globals::$langs->trans("MenuClosedServices"), 2, Globals::$user->rights->contrat->lire);
|
|
| 1018 | 1018 | } |
| 1019 | 1019 | } |
| 1020 | 1020 | |
@@ -1028,11 +1028,11 @@ discard block |
||
| 1028 | 1028 | $newmenu->add("/fichinter/card-red.php?leftmenu=ficheinter", Globals::$langs->trans("ModelList"), 1, Globals::$user->rights->ficheinter->lire, '', '', '', 203);
|
| 1029 | 1029 | $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->fournisseur->commande->lire);
|
| 1030 | 1030 | */ |
| 1031 | - $newmenu->add(BASE_URI . "?controller=fichinter&method=index&leftmenu=ficheinter", Globals::$langs->trans("Interventions"), 0, Globals::$user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200);
|
|
| 1032 | - $newmenu->add(BASE_URI . "?controller=fichinter&method=card&action=create&leftmenu=ficheinter", Globals::$langs->trans("NewIntervention"), 1, Globals::$user->rights->ficheinter->creer, '', '', '', 201);
|
|
| 1033 | - $newmenu->add(BASE_URI . "?controller=fichinter&method=list&leftmenu=ficheinter", Globals::$langs->trans("List"), 1, Globals::$user->rights->ficheinter->lire, '', '', '', 202);
|
|
| 1034 | - $newmenu->add(BASE_URI . "?controller=fichinter&method=card-red&leftmenu=ficheinter", Globals::$langs->trans("ModelList"), 1, Globals::$user->rights->ficheinter->lire, '', '', '', 203);
|
|
| 1035 | - $newmenu->add(BASE_URI . "?controller=fichinter/stats&method=index&leftmenu=ficheinter", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 1031 | + $newmenu->add(BASE_URI."?controller=fichinter&method=index&leftmenu=ficheinter", Globals::$langs->trans("Interventions"), 0, Globals::$user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200);
|
|
| 1032 | + $newmenu->add(BASE_URI."?controller=fichinter&method=card&action=create&leftmenu=ficheinter", Globals::$langs->trans("NewIntervention"), 1, Globals::$user->rights->ficheinter->creer, '', '', '', 201);
|
|
| 1033 | + $newmenu->add(BASE_URI."?controller=fichinter&method=list&leftmenu=ficheinter", Globals::$langs->trans("List"), 1, Globals::$user->rights->ficheinter->lire, '', '', '', 202);
|
|
| 1034 | + $newmenu->add(BASE_URI."?controller=fichinter&method=card-red&leftmenu=ficheinter", Globals::$langs->trans("ModelList"), 1, Globals::$user->rights->ficheinter->lire, '', '', '', 203);
|
|
| 1035 | + $newmenu->add(BASE_URI."?controller=fichinter/stats&method=index&leftmenu=ficheinter", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->fournisseur->commande->lire);
|
|
| 1036 | 1036 | } |
| 1037 | 1037 | } |
| 1038 | 1038 | |
@@ -1050,9 +1050,9 @@ discard block |
||
| 1050 | 1050 | $newmenu->add("/compta/facture/card.php?action=create", Globals::$langs->trans("NewBill"), 1, Globals::$user->rights->facture->creer);
|
| 1051 | 1051 | $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills", Globals::$langs->trans("List"), 1, Globals::$user->rights->facture->lire, '', $mainmenu, 'customers_bills_list');
|
| 1052 | 1052 | */ |
| 1053 | - $newmenu->add(BASE_URI . "?controller=compta/facture&method=list&leftmenu=customers_bills", Globals::$langs->trans("BillsCustomers"), 0, Globals::$user->rights->facture->lire, '', $mainmenu, 'customers_bills');
|
|
| 1054 | - $newmenu->add(BASE_URI . "?controller=compta/facture&method=card&action=create", Globals::$langs->trans("NewBill"), 1, Globals::$user->rights->facture->creer);
|
|
| 1055 | - $newmenu->add(BASE_URI . "?controller=compta/facture&method=list&leftmenu=customers_bills", Globals::$langs->trans("List"), 1, Globals::$user->rights->facture->lire, '', $mainmenu, 'customers_bills_list');
|
|
| 1053 | + $newmenu->add(BASE_URI."?controller=compta/facture&method=list&leftmenu=customers_bills", Globals::$langs->trans("BillsCustomers"), 0, Globals::$user->rights->facture->lire, '', $mainmenu, 'customers_bills');
|
|
| 1054 | + $newmenu->add(BASE_URI."?controller=compta/facture&method=card&action=create", Globals::$langs->trans("NewBill"), 1, Globals::$user->rights->facture->creer);
|
|
| 1055 | + $newmenu->add(BASE_URI."?controller=compta/facture&method=list&leftmenu=customers_bills", Globals::$langs->trans("List"), 1, Globals::$user->rights->facture->lire, '', $mainmenu, 'customers_bills_list');
|
|
| 1056 | 1056 | |
| 1057 | 1057 | if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills(|_draft|_notpaid|_paid|_canceled)$/', $leftmenu)) {
|
| 1058 | 1058 | /* |
@@ -1061,24 +1061,24 @@ discard block |
||
| 1061 | 1061 | $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2", Globals::$langs->trans("BillShortStatusPaid"), 2, Globals::$user->rights->facture->lire);
|
| 1062 | 1062 | $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3", Globals::$langs->trans("BillShortStatusCanceled"), 2, Globals::$user->rights->facture->lire);
|
| 1063 | 1063 | */ |
| 1064 | - $newmenu->add(BASE_URI . "?controller=compta/facture&method=list&leftmenu=customers_bills_draft&search_status=0", Globals::$langs->trans("BillShortStatusDraft"), 2, Globals::$user->rights->facture->lire);
|
|
| 1065 | - $newmenu->add(BASE_URI . "?controller=compta/facture&method=list&leftmenu=customers_bills_notpaid&search_status=1", Globals::$langs->trans("BillShortStatusNotPaid"), 2, Globals::$user->rights->facture->lire);
|
|
| 1066 | - $newmenu->add(BASE_URI . "?controller=compta/facture&method=list&leftmenu=customers_bills_paid&search_status=2", Globals::$langs->trans("BillShortStatusPaid"), 2, Globals::$user->rights->facture->lire);
|
|
| 1067 | - $newmenu->add(BASE_URI . "?controller=compta/facture&method=list&leftmenu=customers_bills_canceled&search_status=3", Globals::$langs->trans("BillShortStatusCanceled"), 2, Globals::$user->rights->facture->lire);
|
|
| 1064 | + $newmenu->add(BASE_URI."?controller=compta/facture&method=list&leftmenu=customers_bills_draft&search_status=0", Globals::$langs->trans("BillShortStatusDraft"), 2, Globals::$user->rights->facture->lire);
|
|
| 1065 | + $newmenu->add(BASE_URI."?controller=compta/facture&method=list&leftmenu=customers_bills_notpaid&search_status=1", Globals::$langs->trans("BillShortStatusNotPaid"), 2, Globals::$user->rights->facture->lire);
|
|
| 1066 | + $newmenu->add(BASE_URI."?controller=compta/facture&method=list&leftmenu=customers_bills_paid&search_status=2", Globals::$langs->trans("BillShortStatusPaid"), 2, Globals::$user->rights->facture->lire);
|
|
| 1067 | + $newmenu->add(BASE_URI."?controller=compta/facture&method=list&leftmenu=customers_bills_canceled&search_status=3", Globals::$langs->trans("BillShortStatusCanceled"), 2, Globals::$user->rights->facture->lire);
|
|
| 1068 | 1068 | } |
| 1069 | 1069 | //$newmenu->add("/compta/facture/invoicetemplate_list.php?leftmenu=customers_bills_templates", Globals::$langs->trans("ListOfTemplates"), 1, Globals::$user->rights->facture->creer, '', $mainmenu, 'customers_bills_templates'); // No need to see recurring invoices, if user has no permission to create invoice.
|
| 1070 | 1070 | //$newmenu->add("/compta/paiement/list.php?leftmenu=customers_bills_payment", Globals::$langs->trans("Payments"), 1, Globals::$user->rights->facture->lire, '', $mainmenu, 'customers_bills_payment');
|
| 1071 | - $newmenu->add(BASE_URI . "?controller=compta/facture&method=invoicetemplate_list&leftmenu=customers_bills_templates", Globals::$langs->trans("ListOfTemplates"), 1, Globals::$user->rights->facture->creer, '', $mainmenu, 'customers_bills_templates'); // No need to see recurring invoices, if user has no permission to create invoice.
|
|
| 1072 | - $newmenu->add(BASE_URI . "?controller=compta/paiement&method=list&leftmenu=customers_bills_payment", Globals::$langs->trans("Payments"), 1, Globals::$user->rights->facture->lire, '', $mainmenu, 'customers_bills_payment');
|
|
| 1071 | + $newmenu->add(BASE_URI."?controller=compta/facture&method=invoicetemplate_list&leftmenu=customers_bills_templates", Globals::$langs->trans("ListOfTemplates"), 1, Globals::$user->rights->facture->creer, '', $mainmenu, 'customers_bills_templates'); // No need to see recurring invoices, if user has no permission to create invoice.
|
|
| 1072 | + $newmenu->add(BASE_URI."?controller=compta/paiement&method=list&leftmenu=customers_bills_payment", Globals::$langs->trans("Payments"), 1, Globals::$user->rights->facture->lire, '', $mainmenu, 'customers_bills_payment');
|
|
| 1073 | 1073 | |
| 1074 | 1074 | if (!empty(Globals::$conf->global->BILL_ADD_PAYMENT_VALIDATION)) {
|
| 1075 | 1075 | //$newmenu->add("/compta/paiement/tovalidate.php?leftmenu=customers_bills_tovalid", Globals::$langs->trans("MenuToValid"), 2, Globals::$user->rights->facture->lire, '', $mainmenu, 'customer_bills_tovalid');
|
| 1076 | - $newmenu->add(BASE_URI . "?controller=compta/paiement&method=tovalidate&leftmenu=customers_bills_tovalid", Globals::$langs->trans("MenuToValid"), 2, Globals::$user->rights->facture->lire, '', $mainmenu, 'customer_bills_tovalid');
|
|
| 1076 | + $newmenu->add(BASE_URI."?controller=compta/paiement&method=tovalidate&leftmenu=customers_bills_tovalid", Globals::$langs->trans("MenuToValid"), 2, Globals::$user->rights->facture->lire, '', $mainmenu, 'customer_bills_tovalid');
|
|
| 1077 | 1077 | } |
| 1078 | 1078 | //$newmenu->add("/compta/paiement/rapport.php?leftmenu=customers_bills_reports", Globals::$langs->trans("Reportings"), 2, Globals::$user->rights->facture->lire, '', $mainmenu, 'customers_bills_reports');
|
| 1079 | 1079 | //$newmenu->add("/compta/facture/stats/index.php?leftmenu=customers_bills_stats", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->facture->lire, '', $mainmenu, 'customers_bills_stats');
|
| 1080 | - $newmenu->add(BASE_URI . "?controller=compta/paiement&method=rapport&leftmenu=customers_bills_reports", Globals::$langs->trans("Reportings"), 2, Globals::$user->rights->facture->lire, '', $mainmenu, 'customers_bills_reports');
|
|
| 1081 | - $newmenu->add(BASE_URI . "?controller=compta/facture/stats&method=index&leftmenu=customers_bills_stats", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->facture->lire, '', $mainmenu, 'customers_bills_stats');
|
|
| 1080 | + $newmenu->add(BASE_URI."?controller=compta/paiement&method=rapport&leftmenu=customers_bills_reports", Globals::$langs->trans("Reportings"), 2, Globals::$user->rights->facture->lire, '', $mainmenu, 'customers_bills_reports');
|
|
| 1081 | + $newmenu->add(BASE_URI."?controller=compta/facture/stats&method=index&leftmenu=customers_bills_stats", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->facture->lire, '', $mainmenu, 'customers_bills_stats');
|
|
| 1082 | 1082 | } |
| 1083 | 1083 | |
| 1084 | 1084 | // Suppliers invoices |
@@ -1087,25 +1087,25 @@ discard block |
||
| 1087 | 1087 | //$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", Globals::$langs->trans("BillsSuppliers"), 0, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
| 1088 | 1088 | //$newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", Globals::$langs->trans("NewBill"), 1, Globals::$user->rights->fournisseur->facture->creer, '', $mainmenu, 'suppliers_bills_create');
|
| 1089 | 1089 | //$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", Globals::$langs->trans("List"), 1, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_list');
|
| 1090 | - $newmenu->add(BASE_URI . "?controller=fourn/facture&method=list&leftmenu=suppliers_bills", Globals::$langs->trans("BillsSuppliers"), 0, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
|
| 1091 | - $newmenu->add(BASE_URI . "?controller=fourn/facture&method=card&leftmenu=suppliers_bills&action=create", Globals::$langs->trans("NewBill"), 1, Globals::$user->rights->fournisseur->facture->creer, '', $mainmenu, 'suppliers_bills_create');
|
|
| 1092 | - $newmenu->add(BASE_URI . "?controller=fourn/facture&method=list&leftmenu=suppliers_bills", Globals::$langs->trans("List"), 1, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_list');
|
|
| 1090 | + $newmenu->add(BASE_URI."?controller=fourn/facture&method=list&leftmenu=suppliers_bills", Globals::$langs->trans("BillsSuppliers"), 0, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
|
| 1091 | + $newmenu->add(BASE_URI."?controller=fourn/facture&method=card&leftmenu=suppliers_bills&action=create", Globals::$langs->trans("NewBill"), 1, Globals::$user->rights->fournisseur->facture->creer, '', $mainmenu, 'suppliers_bills_create');
|
|
| 1092 | + $newmenu->add(BASE_URI."?controller=fourn/facture&method=list&leftmenu=suppliers_bills", Globals::$langs->trans("List"), 1, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_list');
|
|
| 1093 | 1093 | |
| 1094 | 1094 | if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) {
|
| 1095 | 1095 | //$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_draft&search_status=0", Globals::$langs->trans("BillShortStatusDraft"), 2, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_draft');
|
| 1096 | 1096 | //$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_notpaid&search_status=1", Globals::$langs->trans("BillShortStatusNotPaid"), 2, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_notpaid');
|
| 1097 | 1097 | //$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_paid&search_status=2", Globals::$langs->trans("BillShortStatusPaid"), 2, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_paid');
|
| 1098 | - $newmenu->add(BASE_URI . "?controller=fourn/facture&method=list&leftmenu=suppliers_bills_draft&search_status=0", Globals::$langs->trans("BillShortStatusDraft"), 2, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_draft');
|
|
| 1099 | - $newmenu->add(BASE_URI . "?controller=fourn/facture&method=list&leftmenu=suppliers_bills_notpaid&search_status=1", Globals::$langs->trans("BillShortStatusNotPaid"), 2, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_notpaid');
|
|
| 1100 | - $newmenu->add(BASE_URI . "?controller=fourn/facture&method=list&leftmenu=suppliers_bills_paid&search_status=2", Globals::$langs->trans("BillShortStatusPaid"), 2, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_paid');
|
|
| 1098 | + $newmenu->add(BASE_URI."?controller=fourn/facture&method=list&leftmenu=suppliers_bills_draft&search_status=0", Globals::$langs->trans("BillShortStatusDraft"), 2, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_draft');
|
|
| 1099 | + $newmenu->add(BASE_URI."?controller=fourn/facture&method=list&leftmenu=suppliers_bills_notpaid&search_status=1", Globals::$langs->trans("BillShortStatusNotPaid"), 2, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_notpaid');
|
|
| 1100 | + $newmenu->add(BASE_URI."?controller=fourn/facture&method=list&leftmenu=suppliers_bills_paid&search_status=2", Globals::$langs->trans("BillShortStatusPaid"), 2, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_paid');
|
|
| 1101 | 1101 | } |
| 1102 | 1102 | |
| 1103 | 1103 | //$newmenu->add("/fourn/facture/paiement.php?leftmenu=suppliers_bills_payment", Globals::$langs->trans("Payments"), 1, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_payment');
|
| 1104 | 1104 | //$newmenu->add("/fourn/facture/rapport.php?leftmenu=suppliers_bills_report", Globals::$langs->trans("Reportings"), 2, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_report');
|
| 1105 | 1105 | //$newmenu->add("/compta/facture/stats/index.php?mode=supplier&leftmenu=suppliers_bills_stats", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_stats');
|
| 1106 | - $newmenu->add(BASE_URI . "?controller=fourn/facture&method=paiement&leftmenu=suppliers_bills_payment", Globals::$langs->trans("Payments"), 1, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_payment');
|
|
| 1107 | - $newmenu->add(BASE_URI . "?controller=fourn/facture&method=rapport&leftmenu=suppliers_bills_report", Globals::$langs->trans("Reportings"), 2, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_report');
|
|
| 1108 | - $newmenu->add(BASE_URI . "?controller=compta/facture/stats&method=index&mode=supplier&leftmenu=suppliers_bills_stats", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_stats');
|
|
| 1106 | + $newmenu->add(BASE_URI."?controller=fourn/facture&method=paiement&leftmenu=suppliers_bills_payment", Globals::$langs->trans("Payments"), 1, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_payment');
|
|
| 1107 | + $newmenu->add(BASE_URI."?controller=fourn/facture&method=rapport&leftmenu=suppliers_bills_report", Globals::$langs->trans("Reportings"), 2, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_report');
|
|
| 1108 | + $newmenu->add(BASE_URI."?controller=compta/facture/stats&method=index&mode=supplier&leftmenu=suppliers_bills_stats", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_stats');
|
|
| 1109 | 1109 | } |
| 1110 | 1110 | |
| 1111 | 1111 | // Orders |
@@ -1113,7 +1113,7 @@ discard block |
||
| 1113 | 1113 | Globals::$langs->load("orders");
|
| 1114 | 1114 | if (!empty($conf->facture->enabled)) {
|
| 1115 | 1115 | //$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=-3&billed=0&contextpage=billableorders", Globals::$langs->trans("MenuOrdersToBill2"), 0, Globals::$user->rights->commande->lire, '', $mainmenu, 'orders');
|
| 1116 | - $newmenu->add(BASE_URI . "?controller=commande&method=list&leftmenu=orders&viewstatut=-3&billed=0&contextpage=billableorders", Globals::$langs->trans("MenuOrdersToBill2"), 0, Globals::$user->rights->commande->lire, '', $mainmenu, 'orders');
|
|
| 1116 | + $newmenu->add(BASE_URI."?controller=commande&method=list&leftmenu=orders&viewstatut=-3&billed=0&contextpage=billableorders", Globals::$langs->trans("MenuOrdersToBill2"), 0, Globals::$user->rights->commande->lire, '', $mainmenu, 'orders');
|
|
| 1117 | 1117 | } |
| 1118 | 1118 | // if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", Globals::$langs->trans("StatusOrderToBill"), 1, Globals::$user->rights->commande->lire);
|
| 1119 | 1119 | } |
@@ -1123,7 +1123,7 @@ discard block |
||
| 1123 | 1123 | if (!empty(Globals::$conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE)) {
|
| 1124 | 1124 | Globals::$langs->load("supplier");
|
| 1125 | 1125 | //$newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&billed=0", Globals::$langs->trans("MenuOrdersSupplierToBill"), 0, Globals::$user->rights->commande->lire, '', $mainmenu, 'orders');
|
| 1126 | - $newmenu->add(BASE_URI . "?controller=fourn/commande&method=list&leftmenu=orders&search_status=5&billed=0", Globals::$langs->trans("MenuOrdersSupplierToBill"), 0, Globals::$user->rights->commande->lire, '', $mainmenu, 'orders');
|
|
| 1126 | + $newmenu->add(BASE_URI."?controller=fourn/commande&method=list&leftmenu=orders&search_status=5&billed=0", Globals::$langs->trans("MenuOrdersSupplierToBill"), 0, Globals::$user->rights->commande->lire, '', $mainmenu, 'orders');
|
|
| 1127 | 1127 | // if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", Globals::$langs->trans("StatusOrderToBill"), 1, Globals::$user->rights->commande->lire);
|
| 1128 | 1128 | } |
| 1129 | 1129 | } |
@@ -1133,12 +1133,12 @@ discard block |
||
| 1133 | 1133 | if (!empty($conf->don->enabled)) {
|
| 1134 | 1134 | Globals::$langs->load("donations");
|
| 1135 | 1135 | //$newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing", Globals::$langs->trans("Donations"), 0, Globals::$user->rights->don->lire, '', $mainmenu, 'donations');
|
| 1136 | - $newmenu->add(BASE_URI . "?controller=don&method=index&leftmenu=donations&mainmenu=billing", Globals::$langs->trans("Donations"), 0, Globals::$user->rights->don->lire, '', $mainmenu, 'donations');
|
|
| 1136 | + $newmenu->add(BASE_URI."?controller=don&method=index&leftmenu=donations&mainmenu=billing", Globals::$langs->trans("Donations"), 0, Globals::$user->rights->don->lire, '', $mainmenu, 'donations');
|
|
| 1137 | 1137 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "donations") {
|
| 1138 | 1138 | //$newmenu->add("/don/card.php?leftmenu=donations&action=create", Globals::$langs->trans("NewDonation"), 1, Globals::$user->rights->don->creer);
|
| 1139 | 1139 | //$newmenu->add("/don/list.php?leftmenu=donations", Globals::$langs->trans("List"), 1, Globals::$user->rights->don->lire);
|
| 1140 | - $newmenu->add(BASE_URI . "?controller=don&method=card&leftmenu=donations&action=create", Globals::$langs->trans("NewDonation"), 1, Globals::$user->rights->don->creer);
|
|
| 1141 | - $newmenu->add(BASE_URI . "?controller=don&method=list&leftmenu=donations", Globals::$langs->trans("List"), 1, Globals::$user->rights->don->lire);
|
|
| 1140 | + $newmenu->add(BASE_URI."?controller=don&method=card&leftmenu=donations&action=create", Globals::$langs->trans("NewDonation"), 1, Globals::$user->rights->don->creer);
|
|
| 1141 | + $newmenu->add(BASE_URI."?controller=don&method=list&leftmenu=donations", Globals::$langs->trans("List"), 1, Globals::$user->rights->don->lire);
|
|
| 1142 | 1142 | } |
| 1143 | 1143 | // if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->don->lire);
|
| 1144 | 1144 | } |
@@ -1149,24 +1149,24 @@ discard block |
||
| 1149 | 1149 | |
| 1150 | 1150 | $permtoshowmenu = ((!empty($conf->tax->enabled) && Globals::$user->rights->tax->charges->lire) || (!empty($conf->salaries->enabled) && !empty(Globals::$user->rights->salaries->read)) || (!empty($conf->loan->enabled) && Globals::$user->rights->loan->read) || (!empty($conf->banque->enabled) && Globals::$user->rights->banque->lire)); |
| 1151 | 1151 | //$newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", Globals::$langs->trans("MenuSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax');
|
| 1152 | - $newmenu->add(BASE_URI . "?controller=compta/charges&method=index&leftmenu=tax&mainmenu=billing", Globals::$langs->trans("MenuSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax');
|
|
| 1152 | + $newmenu->add(BASE_URI."?controller=compta/charges&method=index&leftmenu=tax&mainmenu=billing", Globals::$langs->trans("MenuSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax');
|
|
| 1153 | 1153 | |
| 1154 | 1154 | // Social contributions |
| 1155 | 1155 | if (!empty($conf->tax->enabled)) {
|
| 1156 | 1156 | //$newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", Globals::$langs->trans("MenuSocialContributions"), 1, Globals::$user->rights->tax->charges->lire);
|
| 1157 | - $newmenu->add(BASE_URI . "?controller=compta/sociales&method=list&leftmenu=tax_social", Globals::$langs->trans("MenuSocialContributions"), 1, Globals::$user->rights->tax->charges->lire);
|
|
| 1157 | + $newmenu->add(BASE_URI."?controller=compta/sociales&method=list&leftmenu=tax_social", Globals::$langs->trans("MenuSocialContributions"), 1, Globals::$user->rights->tax->charges->lire);
|
|
| 1158 | 1158 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i', $leftmenu)) {
|
| 1159 | 1159 | //$newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create", Globals::$langs->trans("MenuNewSocialContribution"), 2, Globals::$user->rights->tax->charges->creer);
|
| 1160 | 1160 | //$newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", Globals::$langs->trans("List"), 2, Globals::$user->rights->tax->charges->lire);
|
| 1161 | 1161 | //$newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing&mode=sconly", Globals::$langs->trans("Payments"), 2, Globals::$user->rights->tax->charges->lire);
|
| 1162 | - $newmenu->add(BASE_URI . "?controller=compta/sociales&method=card&leftmenu=tax_social&action=create", Globals::$langs->trans("MenuNewSocialContribution"), 2, Globals::$user->rights->tax->charges->creer);
|
|
| 1163 | - $newmenu->add(BASE_URI . "?controller=compta/sociales&method=list&leftmenu=tax_social", Globals::$langs->trans("List"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1164 | - $newmenu->add(BASE_URI . "?controller=compta/sociales&method=payments&leftmenu=tax_social&mainmenu=billing&mode=sconly", Globals::$langs->trans("Payments"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1162 | + $newmenu->add(BASE_URI."?controller=compta/sociales&method=card&leftmenu=tax_social&action=create", Globals::$langs->trans("MenuNewSocialContribution"), 2, Globals::$user->rights->tax->charges->creer);
|
|
| 1163 | + $newmenu->add(BASE_URI."?controller=compta/sociales&method=list&leftmenu=tax_social", Globals::$langs->trans("List"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1164 | + $newmenu->add(BASE_URI."?controller=compta/sociales&method=payments&leftmenu=tax_social&mainmenu=billing&mode=sconly", Globals::$langs->trans("Payments"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1165 | 1165 | } |
| 1166 | 1166 | // VAT |
| 1167 | 1167 | if (empty(Globals::$conf->global->TAX_DISABLE_VAT_MENUS)) {
|
| 1168 | 1168 | //$newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing", Globals::$langs->transcountry("VAT", $mysoc->country_code), 1, Globals::$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat');
|
| 1169 | - $newmenu->add(BASE_URI . "?controller=compta/tva&method=list&leftmenu=tax_vat&mainmenu=billing", Globals::$langs->transcountry("VAT", $mysoc->country_code), 1, Globals::$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat');
|
|
| 1169 | + $newmenu->add(BASE_URI."?controller=compta/tva&method=list&leftmenu=tax_vat&mainmenu=billing", Globals::$langs->transcountry("VAT", $mysoc->country_code), 1, Globals::$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat');
|
|
| 1170 | 1170 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i', $leftmenu)) {
|
| 1171 | 1171 | /* |
| 1172 | 1172 | $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create", Globals::$langs->trans("New"), 2, Globals::$user->rights->tax->charges->creer);
|
@@ -1175,18 +1175,18 @@ discard block |
||
| 1175 | 1175 | $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", Globals::$langs->trans("ReportByCustomers"), 2, Globals::$user->rights->tax->charges->lire);
|
| 1176 | 1176 | $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", Globals::$langs->trans("ReportByQuarter"), 2, Globals::$user->rights->tax->charges->lire);
|
| 1177 | 1177 | */ |
| 1178 | - $newmenu->add(BASE_URI . "?controller=compta/tva&method=card&leftmenu=tax_vat&action=create", Globals::$langs->trans("New"), 2, Globals::$user->rights->tax->charges->creer);
|
|
| 1179 | - $newmenu->add(BASE_URI . "?controller=compta/tva&method=list&leftmenu=tax_vat", Globals::$langs->trans("List"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1180 | - $newmenu->add(BASE_URI . "?controller=compta/tva&method=index&leftmenu=tax_vat", Globals::$langs->trans("ReportByMonth"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1181 | - $newmenu->add(BASE_URI . "?controller=compta/tva&method=clients&leftmenu=tax_vat", Globals::$langs->trans("ReportByCustomers"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1182 | - $newmenu->add(BASE_URI . "?controller=compta/tva&method=quadri_detail&leftmenu=tax_vat", Globals::$langs->trans("ReportByQuarter"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1178 | + $newmenu->add(BASE_URI."?controller=compta/tva&method=card&leftmenu=tax_vat&action=create", Globals::$langs->trans("New"), 2, Globals::$user->rights->tax->charges->creer);
|
|
| 1179 | + $newmenu->add(BASE_URI."?controller=compta/tva&method=list&leftmenu=tax_vat", Globals::$langs->trans("List"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1180 | + $newmenu->add(BASE_URI."?controller=compta/tva&method=index&leftmenu=tax_vat", Globals::$langs->trans("ReportByMonth"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1181 | + $newmenu->add(BASE_URI."?controller=compta/tva&method=clients&leftmenu=tax_vat", Globals::$langs->trans("ReportByCustomers"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1182 | + $newmenu->add(BASE_URI."?controller=compta/tva&method=quadri_detail&leftmenu=tax_vat", Globals::$langs->trans("ReportByQuarter"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1183 | 1183 | } |
| 1184 | 1184 | global $mysoc; |
| 1185 | 1185 | |
| 1186 | 1186 | //Local Taxes 1 |
| 1187 | 1187 | if ($mysoc->useLocalTax(1) && (isset($mysoc->localtax1_assuj) && $mysoc->localtax1_assuj == "1")) {
|
| 1188 | 1188 | //$newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1", Globals::$langs->transcountry("LT1", $mysoc->country_code), 1, Globals::$user->rights->tax->charges->lire);
|
| 1189 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=list&leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1", Globals::$langs->transcountry("LT1", $mysoc->country_code), 1, Globals::$user->rights->tax->charges->lire);
|
|
| 1189 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=list&leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1", Globals::$langs->transcountry("LT1", $mysoc->country_code), 1, Globals::$user->rights->tax->charges->lire);
|
|
| 1190 | 1190 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i', $leftmenu)) {
|
| 1191 | 1191 | /* |
| 1192 | 1192 | $newmenu->add("/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&localTaxType=1", Globals::$langs->trans("New"), 2, Globals::$user->rights->tax->charges->creer);
|
@@ -1195,17 +1195,17 @@ discard block |
||
| 1195 | 1195 | $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_1_vat&localTaxType=1", Globals::$langs->trans("ReportByCustomers"), 2, Globals::$user->rights->tax->charges->lire);
|
| 1196 | 1196 | $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_1_vat&localTaxType=1", Globals::$langs->trans("ReportByQuarter"), 2, Globals::$user->rights->tax->charges->lire);
|
| 1197 | 1197 | */ |
| 1198 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=card&leftmenu=tax_1_vat&action=create&localTaxType=1", Globals::$langs->trans("New"), 2, Globals::$user->rights->tax->charges->creer);
|
|
| 1199 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=list&leftmenu=tax_1_vat&localTaxType=1", Globals::$langs->trans("List"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1200 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=index&leftmenu=tax_1_vat&localTaxType=1", Globals::$langs->trans("ReportByMonth"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1201 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=clients&leftmenu=tax_1_vat&localTaxType=1", Globals::$langs->trans("ReportByCustomers"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1202 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=quadri_detail&leftmenu=tax_1_vat&localTaxType=1", Globals::$langs->trans("ReportByQuarter"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1198 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=card&leftmenu=tax_1_vat&action=create&localTaxType=1", Globals::$langs->trans("New"), 2, Globals::$user->rights->tax->charges->creer);
|
|
| 1199 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=list&leftmenu=tax_1_vat&localTaxType=1", Globals::$langs->trans("List"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1200 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=index&leftmenu=tax_1_vat&localTaxType=1", Globals::$langs->trans("ReportByMonth"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1201 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=clients&leftmenu=tax_1_vat&localTaxType=1", Globals::$langs->trans("ReportByCustomers"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1202 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=quadri_detail&leftmenu=tax_1_vat&localTaxType=1", Globals::$langs->trans("ReportByQuarter"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1203 | 1203 | } |
| 1204 | 1204 | } |
| 1205 | 1205 | //Local Taxes 2 |
| 1206 | 1206 | if ($mysoc->useLocalTax(2) && (isset($mysoc->localtax2_assuj) && $mysoc->localtax2_assuj == "1")) {
|
| 1207 | 1207 | //$newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2", Globals::$langs->transcountry("LT2", $mysoc->country_code), 1, Globals::$user->rights->tax->charges->lire);
|
| 1208 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=list&leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2", Globals::$langs->transcountry("LT2", $mysoc->country_code), 1, Globals::$user->rights->tax->charges->lire);
|
|
| 1208 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=list&leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2", Globals::$langs->transcountry("LT2", $mysoc->country_code), 1, Globals::$user->rights->tax->charges->lire);
|
|
| 1209 | 1209 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i', $leftmenu)) {
|
| 1210 | 1210 | /* |
| 1211 | 1211 | $newmenu->add("/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&localTaxType=2", Globals::$langs->trans("New"), 2, Globals::$user->rights->tax->charges->creer);
|
@@ -1214,11 +1214,11 @@ discard block |
||
| 1214 | 1214 | $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_2_vat&localTaxType=2", Globals::$langs->trans("ReportByCustomers"), 2, Globals::$user->rights->tax->charges->lire);
|
| 1215 | 1215 | $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_2_vat&localTaxType=2", Globals::$langs->trans("ReportByQuarter"), 2, Globals::$user->rights->tax->charges->lire);
|
| 1216 | 1216 | */ |
| 1217 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=card&leftmenu=tax_2_vat&action=create&localTaxType=2", Globals::$langs->trans("New"), 2, Globals::$user->rights->tax->charges->creer);
|
|
| 1218 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=list&leftmenu=tax_2_vat&localTaxType=2", Globals::$langs->trans("List"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1219 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=index&leftmenu=tax_2_vat&localTaxType=2", Globals::$langs->trans("ReportByMonth"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1220 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=clients&leftmenu=tax_2_vat&localTaxType=2", Globals::$langs->trans("ReportByCustomers"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1221 | - $newmenu->add(BASE_URI . "?controller=compta/localtax&method=quadri_detail&leftmenu=tax_2_vat&localTaxType=2", Globals::$langs->trans("ReportByQuarter"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1217 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=card&leftmenu=tax_2_vat&action=create&localTaxType=2", Globals::$langs->trans("New"), 2, Globals::$user->rights->tax->charges->creer);
|
|
| 1218 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=list&leftmenu=tax_2_vat&localTaxType=2", Globals::$langs->trans("List"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1219 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=index&leftmenu=tax_2_vat&localTaxType=2", Globals::$langs->trans("ReportByMonth"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1220 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=clients&leftmenu=tax_2_vat&localTaxType=2", Globals::$langs->trans("ReportByCustomers"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1221 | + $newmenu->add(BASE_URI."?controller=compta/localtax&method=quadri_detail&leftmenu=tax_2_vat&localTaxType=2", Globals::$langs->trans("ReportByQuarter"), 2, Globals::$user->rights->tax->charges->lire);
|
|
| 1222 | 1222 | } |
| 1223 | 1223 | } |
| 1224 | 1224 | } |
@@ -1228,14 +1228,14 @@ discard block |
||
| 1228 | 1228 | if (!empty($conf->salaries->enabled)) {
|
| 1229 | 1229 | Globals::$langs->load("salaries");
|
| 1230 | 1230 | //$newmenu->add("/compta/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", Globals::$langs->trans("Salaries"), 1, Globals::$user->rights->salaries->read, '', $mainmenu, 'tax_salary');
|
| 1231 | - $newmenu->add(BASE_URI . "?controller=compta/salaries&method=list&leftmenu=tax_salary&mainmenu=billing", Globals::$langs->trans("Salaries"), 1, Globals::$user->rights->salaries->read, '', $mainmenu, 'tax_salary');
|
|
| 1231 | + $newmenu->add(BASE_URI."?controller=compta/salaries&method=list&leftmenu=tax_salary&mainmenu=billing", Globals::$langs->trans("Salaries"), 1, Globals::$user->rights->salaries->read, '', $mainmenu, 'tax_salary');
|
|
| 1232 | 1232 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i', $leftmenu)) {
|
| 1233 | 1233 | //$newmenu->add("/compta/salaries/card.php?leftmenu=tax_salary&action=create", Globals::$langs->trans("NewPayment"), 2, Globals::$user->rights->salaries->write);
|
| 1234 | 1234 | //$newmenu->add("/compta/salaries/list.php?leftmenu=tax_salary", Globals::$langs->trans("Payments"), 2, Globals::$user->rights->salaries->read);
|
| 1235 | 1235 | //$newmenu->add("/compta/salaries/stats/index.php?leftmenu=tax_salary", Globals::$langs->trans("Statistics"), 2, Globals::$user->rights->salaries->read);
|
| 1236 | - $newmenu->add(BASE_URI . "?controller=compta/salaries&method=card&leftmenu=tax_salary&action=create", Globals::$langs->trans("NewPayment"), 2, Globals::$user->rights->salaries->write);
|
|
| 1237 | - $newmenu->add(BASE_URI . "?controller=compta/salaries&method=list&leftmenu=tax_salary", Globals::$langs->trans("Payments"), 2, Globals::$user->rights->salaries->read);
|
|
| 1238 | - $newmenu->add(BASE_URI . "?controller=compta/salaries/stats&method=index&leftmenu=tax_salary", Globals::$langs->trans("Statistics"), 2, Globals::$user->rights->salaries->read);
|
|
| 1236 | + $newmenu->add(BASE_URI."?controller=compta/salaries&method=card&leftmenu=tax_salary&action=create", Globals::$langs->trans("NewPayment"), 2, Globals::$user->rights->salaries->write);
|
|
| 1237 | + $newmenu->add(BASE_URI."?controller=compta/salaries&method=list&leftmenu=tax_salary", Globals::$langs->trans("Payments"), 2, Globals::$user->rights->salaries->read);
|
|
| 1238 | + $newmenu->add(BASE_URI."?controller=compta/salaries/stats&method=index&leftmenu=tax_salary", Globals::$langs->trans("Statistics"), 2, Globals::$user->rights->salaries->read);
|
|
| 1239 | 1239 | } |
| 1240 | 1240 | } |
| 1241 | 1241 | |
@@ -1243,10 +1243,10 @@ discard block |
||
| 1243 | 1243 | if (!empty($conf->loan->enabled)) {
|
| 1244 | 1244 | Globals::$langs->load("loan");
|
| 1245 | 1245 | //$newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing", Globals::$langs->trans("Loans"), 1, Globals::$user->rights->loan->read, '', $mainmenu, 'tax_loan');
|
| 1246 | - $newmenu->add(BASE_URI . "?controller=loan&method=list&leftmenu=tax_loan&mainmenu=billing", Globals::$langs->trans("Loans"), 1, Globals::$user->rights->loan->read, '', $mainmenu, 'tax_loan');
|
|
| 1246 | + $newmenu->add(BASE_URI."?controller=loan&method=list&leftmenu=tax_loan&mainmenu=billing", Globals::$langs->trans("Loans"), 1, Globals::$user->rights->loan->read, '', $mainmenu, 'tax_loan');
|
|
| 1247 | 1247 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i', $leftmenu)) {
|
| 1248 | 1248 | //$newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create", Globals::$langs->trans("NewLoan"), 2, Globals::$user->rights->loan->write);
|
| 1249 | - $newmenu->add(BASE_URI . "?controller=loan&method=card&leftmenu=tax_loan&action=create", Globals::$langs->trans("NewLoan"), 2, Globals::$user->rights->loan->write);
|
|
| 1249 | + $newmenu->add(BASE_URI."?controller=loan&method=card&leftmenu=tax_loan&action=create", Globals::$langs->trans("NewLoan"), 2, Globals::$user->rights->loan->write);
|
|
| 1250 | 1250 | //$newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",Globals::$langs->trans("Payments"),2,Globals::$user->rights->loan->read);
|
| 1251 | 1251 | } |
| 1252 | 1252 | } |
@@ -1255,12 +1255,12 @@ discard block |
||
| 1255 | 1255 | if (!empty($conf->banque->enabled) && empty(Globals::$conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) {
|
| 1256 | 1256 | Globals::$langs->load("banks");
|
| 1257 | 1257 | //$newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", Globals::$langs->trans("MenuVariousPayment"), 1, Globals::$user->rights->banque->lire, '', $mainmenu, 'tax_various');
|
| 1258 | - $newmenu->add(BASE_URI . "?controller=compta/bank/various_payment&method=list&leftmenu=tax_various&mainmenu=billing", Globals::$langs->trans("MenuVariousPayment"), 1, Globals::$user->rights->banque->lire, '', $mainmenu, 'tax_various');
|
|
| 1258 | + $newmenu->add(BASE_URI."?controller=compta/bank/various_payment&method=list&leftmenu=tax_various&mainmenu=billing", Globals::$langs->trans("MenuVariousPayment"), 1, Globals::$user->rights->banque->lire, '', $mainmenu, 'tax_various');
|
|
| 1259 | 1259 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i', $leftmenu)) {
|
| 1260 | 1260 | //$newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", Globals::$langs->trans("New"), 2, Globals::$user->rights->banque->modifier);
|
| 1261 | 1261 | //$newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", Globals::$langs->trans("List"), 2, Globals::$user->rights->banque->lire);
|
| 1262 | - $newmenu->add(BASE_URI . "?controller=compta/bank/various_payment&method=card&leftmenu=tax_various&action=create", Globals::$langs->trans("New"), 2, Globals::$user->rights->banque->modifier);
|
|
| 1263 | - $newmenu->add(BASE_URI . "?controller=compta/bank/various_payment&method=list&leftmenu=tax_various", Globals::$langs->trans("List"), 2, Globals::$user->rights->banque->lire);
|
|
| 1262 | + $newmenu->add(BASE_URI."?controller=compta/bank/various_payment&method=card&leftmenu=tax_various&action=create", Globals::$langs->trans("New"), 2, Globals::$user->rights->banque->modifier);
|
|
| 1263 | + $newmenu->add(BASE_URI."?controller=compta/bank/various_payment&method=list&leftmenu=tax_various", Globals::$langs->trans("List"), 2, Globals::$user->rights->banque->lire);
|
|
| 1264 | 1264 | } |
| 1265 | 1265 | } |
| 1266 | 1266 | } |
@@ -1278,11 +1278,11 @@ discard block |
||
| 1278 | 1278 | |
| 1279 | 1279 | $permtoshowmenu = (!empty($conf->accounting->enabled) || Globals::$user->rights->accounting->bind->write || Globals::$user->rights->compta->resultat->lire); |
| 1280 | 1280 | //$newmenu->add("/accountancy/index.php?leftmenu=accountancy", Globals::$langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy');
|
| 1281 | - $newmenu->add(BASE_URI . "?controller=accountancy&method=index&leftmenu=accountancy", Globals::$langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy');
|
|
| 1281 | + $newmenu->add(BASE_URI."?controller=accountancy&method=index&leftmenu=accountancy", Globals::$langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy');
|
|
| 1282 | 1282 | |
| 1283 | 1283 | // Chart of account |
| 1284 | 1284 | //$newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", Globals::$langs->trans("Setup"), 1, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1);
|
| 1285 | - $newmenu->add(BASE_URI . "?controller=accountancy&method=index&leftmenu=accountancy_admin", Globals::$langs->trans("Setup"), 1, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1);
|
|
| 1285 | + $newmenu->add(BASE_URI."?controller=accountancy&method=index&leftmenu=accountancy_admin", Globals::$langs->trans("Setup"), 1, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1);
|
|
| 1286 | 1286 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/', $leftmenu)) {
|
| 1287 | 1287 | /* |
| 1288 | 1288 | $newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("General"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_general', 10);
|
@@ -1292,71 +1292,71 @@ discard block |
||
| 1292 | 1292 | $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("AccountingCategory"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41);
|
| 1293 | 1293 | $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("MenuDefaultAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50);
|
| 1294 | 1294 | */ |
| 1295 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=index&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("General"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_general', 10);
|
|
| 1296 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=journals_list&id=35&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("AccountingJournals"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_journal', 20);
|
|
| 1297 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=accountmodel&id=31&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("Pcg_version"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 30);
|
|
| 1298 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=account&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("Chartofaccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 40);
|
|
| 1299 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=categories_list&id=32&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("AccountingCategory"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41);
|
|
| 1300 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=defaultaccounts&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("MenuDefaultAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50);
|
|
| 1295 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=index&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("General"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_general', 10);
|
|
| 1296 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=journals_list&id=35&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("AccountingJournals"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_journal', 20);
|
|
| 1297 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=accountmodel&id=31&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("Pcg_version"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 30);
|
|
| 1298 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=account&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("Chartofaccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 40);
|
|
| 1299 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=categories_list&id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("AccountingCategory"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41);
|
|
| 1300 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=defaultaccounts&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("MenuDefaultAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50);
|
|
| 1301 | 1301 | if (!empty($conf->banque->enabled)) {
|
| 1302 | 1302 | //$newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", Globals::$langs->trans("MenuBankAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51);
|
| 1303 | - $newmenu->add(BASE_URI . "?controller=compta/bank&method=list&mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", Globals::$langs->trans("MenuBankAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51);
|
|
| 1303 | + $newmenu->add(BASE_URI."?controller=compta/bank&method=list&mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", Globals::$langs->trans("MenuBankAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51);
|
|
| 1304 | 1304 | } |
| 1305 | 1305 | if (!empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled)) {
|
| 1306 | 1306 | //$newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("MenuVatAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 52);
|
| 1307 | - $newmenu->add(BASE_URI . "?controller=admin&method=dict&id=10&from=accountancy&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("MenuVatAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 52);
|
|
| 1307 | + $newmenu->add(BASE_URI."?controller=admin&method=dict&id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("MenuVatAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 52);
|
|
| 1308 | 1308 | } |
| 1309 | 1309 | if (!empty($conf->tax->enabled)) {
|
| 1310 | 1310 | //$newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("MenuTaxAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 53);
|
| 1311 | - $newmenu->add(BASE_URI . "?controller=admin&method=dict&id=7&from=accountancy&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("MenuTaxAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 53);
|
|
| 1311 | + $newmenu->add(BASE_URI."?controller=admin&method=dict&id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("MenuTaxAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 53);
|
|
| 1312 | 1312 | } |
| 1313 | 1313 | if (!empty($conf->expensereport->enabled)) {
|
| 1314 | 1314 | //$newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("MenuExpenseReportAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 54);
|
| 1315 | - $newmenu->add(BASE_URI . "?controller=admin&method=dict&id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("MenuExpenseReportAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 54);
|
|
| 1315 | + $newmenu->add(BASE_URI."?controller=admin&method=dict&id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("MenuExpenseReportAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 54);
|
|
| 1316 | 1316 | } |
| 1317 | 1317 | //$newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("MenuProductsAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 55);
|
| 1318 | 1318 | //$newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("ExportOptions"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60);
|
| 1319 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=productaccount&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("MenuProductsAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 55);
|
|
| 1320 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=export&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("ExportOptions"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60);
|
|
| 1319 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=productaccount&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("MenuProductsAccounts"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 55);
|
|
| 1320 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=export&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("ExportOptions"), 2, Globals::$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60);
|
|
| 1321 | 1321 | |
| 1322 | 1322 | // Fiscal year |
| 1323 | 1323 | if (Globals::$conf->global->MAIN_FEATURES_LEVEL > 1) {
|
| 1324 | 1324 | // Not yet used. In a future will lock some periods. |
| 1325 | 1325 | //$newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("FiscalPeriod"), 2, Globals::$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear');
|
| 1326 | - $newmenu->add(BASE_URI . "?controller=accountancy/admin&method=fiscalyear&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("FiscalPeriod"), 2, Globals::$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear');
|
|
| 1326 | + $newmenu->add(BASE_URI."?controller=accountancy/admin&method=fiscalyear&mainmenu=accountancy&leftmenu=accountancy_admin", Globals::$langs->trans("FiscalPeriod"), 2, Globals::$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear');
|
|
| 1327 | 1327 | } |
| 1328 | 1328 | } |
| 1329 | 1329 | |
| 1330 | 1330 | // Binding |
| 1331 | 1331 | if (!empty($conf->facture->enabled)) {
|
| 1332 | 1332 | //$newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", Globals::$langs->trans("CustomersVentilation"), 1, Globals::$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer');
|
| 1333 | - $newmenu->add(BASE_URI . "?controller=accountancy/customer&method=index&leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", Globals::$langs->trans("CustomersVentilation"), 1, Globals::$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer');
|
|
| 1333 | + $newmenu->add(BASE_URI."?controller=accountancy/customer&method=index&leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", Globals::$langs->trans("CustomersVentilation"), 1, Globals::$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer');
|
|
| 1334 | 1334 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/', $leftmenu)) {
|
| 1335 | 1335 | //$newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", Globals::$langs->trans("ToBind"), 2, Globals::$user->rights->accounting->bind->write);
|
| 1336 | 1336 | //$newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", Globals::$langs->trans("Binded"), 2, Globals::$user->rights->accounting->bind->write);
|
| 1337 | - $newmenu->add(BASE_URI . "?controller=accountancy/customer&method=list&mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", Globals::$langs->trans("ToBind"), 2, Globals::$user->rights->accounting->bind->write);
|
|
| 1338 | - $newmenu->add(BASE_URI . "?controller=accountancy/customer&method=lines&mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", Globals::$langs->trans("Binded"), 2, Globals::$user->rights->accounting->bind->write);
|
|
| 1337 | + $newmenu->add(BASE_URI."?controller=accountancy/customer&method=list&mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", Globals::$langs->trans("ToBind"), 2, Globals::$user->rights->accounting->bind->write);
|
|
| 1338 | + $newmenu->add(BASE_URI."?controller=accountancy/customer&method=lines&mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", Globals::$langs->trans("Binded"), 2, Globals::$user->rights->accounting->bind->write);
|
|
| 1339 | 1339 | } |
| 1340 | 1340 | } |
| 1341 | 1341 | if (!empty($conf->supplier_invoice->enabled)) {
|
| 1342 | 1342 | //$newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", Globals::$langs->trans("SuppliersVentilation"), 1, Globals::$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier');
|
| 1343 | - $newmenu->add(BASE_URI . "?controller=accountancy/supplier&method=index&leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", Globals::$langs->trans("SuppliersVentilation"), 1, Globals::$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier');
|
|
| 1343 | + $newmenu->add(BASE_URI."?controller=accountancy/supplier&method=index&leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", Globals::$langs->trans("SuppliersVentilation"), 1, Globals::$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier');
|
|
| 1344 | 1344 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/', $leftmenu)) {
|
| 1345 | 1345 | //$newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", Globals::$langs->trans("ToBind"), 2, Globals::$user->rights->accounting->bind->write);
|
| 1346 | 1346 | //$newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", Globals::$langs->trans("Binded"), 2, Globals::$user->rights->accounting->bind->write);
|
| 1347 | - $newmenu->add(BASE_URI . "?controller=accountancy/supplier&method=list&mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", Globals::$langs->trans("ToBind"), 2, Globals::$user->rights->accounting->bind->write);
|
|
| 1348 | - $newmenu->add(BASE_URI . "?controller=accountancy/supplier&method=lines&mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", Globals::$langs->trans("Binded"), 2, Globals::$user->rights->accounting->bind->write);
|
|
| 1347 | + $newmenu->add(BASE_URI."?controller=accountancy/supplier&method=list&mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", Globals::$langs->trans("ToBind"), 2, Globals::$user->rights->accounting->bind->write);
|
|
| 1348 | + $newmenu->add(BASE_URI."?controller=accountancy/supplier&method=lines&mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", Globals::$langs->trans("Binded"), 2, Globals::$user->rights->accounting->bind->write);
|
|
| 1349 | 1349 | } |
| 1350 | 1350 | } |
| 1351 | 1351 | |
| 1352 | 1352 | if (!empty($conf->expensereport->enabled)) {
|
| 1353 | 1353 | //$newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", Globals::$langs->trans("ExpenseReportsVentilation"), 1, Globals::$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport');
|
| 1354 | - $newmenu->add(BASE_URI . "?controller=accountancy/expensereport&method=index&leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", Globals::$langs->trans("ExpenseReportsVentilation"), 1, Globals::$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport');
|
|
| 1354 | + $newmenu->add(BASE_URI."?controller=accountancy/expensereport&method=index&leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", Globals::$langs->trans("ExpenseReportsVentilation"), 1, Globals::$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport');
|
|
| 1355 | 1355 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/', $leftmenu)) {
|
| 1356 | 1356 | //$newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", Globals::$langs->trans("ToBind"), 2, Globals::$user->rights->accounting->bind->write);
|
| 1357 | 1357 | //$newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", Globals::$langs->trans("Binded"), 2, Globals::$user->rights->accounting->bind->write);
|
| 1358 | - $newmenu->add(BASE_URI . "?controller=accountancy/expensereport&method=list&mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", Globals::$langs->trans("ToBind"), 2, Globals::$user->rights->accounting->bind->write);
|
|
| 1359 | - $newmenu->add(BASE_URI . "?controller=accountancy/expensereport&method=lines&mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", Globals::$langs->trans("Binded"), 2, Globals::$user->rights->accounting->bind->write);
|
|
| 1358 | + $newmenu->add(BASE_URI."?controller=accountancy/expensereport&method=list&mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", Globals::$langs->trans("ToBind"), 2, Globals::$user->rights->accounting->bind->write);
|
|
| 1359 | + $newmenu->add(BASE_URI."?controller=accountancy/expensereport&method=lines&mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", Globals::$langs->trans("Binded"), 2, Globals::$user->rights->accounting->bind->write);
|
|
| 1360 | 1360 | } |
| 1361 | 1361 | } |
| 1362 | 1362 | |
@@ -1366,8 +1366,8 @@ discard block |
||
| 1366 | 1366 | |
| 1367 | 1367 | // Multi journal |
| 1368 | 1368 | $sql = "SELECT rowid, code, label, nature"; |
| 1369 | - $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_journal"; |
|
| 1370 | - $sql .= " WHERE entity = " . $conf->entity; |
|
| 1369 | + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_journal"; |
|
| 1370 | + $sql .= " WHERE entity = ".$conf->entity; |
|
| 1371 | 1371 | $sql .= " AND active = 1"; |
| 1372 | 1372 | $sql .= " ORDER BY label DESC"; |
| 1373 | 1373 | |
@@ -1408,7 +1408,7 @@ discard block |
||
| 1408 | 1408 | Globals::$langs->load('accountancy');
|
| 1409 | 1409 | $journallabel = Globals::$langs->transnoentities($objp->label); // Labels in this table are set by loading llx_accounting_abc.sql. Label can be 'ACCOUNTING_SELL_JOURNAL', 'InventoryJournal', ... |
| 1410 | 1410 | //$newmenu->add('/accountancy/journal/' . $nature . 'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=' . $objp->rowid, $journallabel, 2, Globals::$user->rights->accounting->comptarapport->lire);
|
| 1411 | - $newmenu->add(BASE_URI . '?controller=accountancy/journal&method=' . $nature . 'journal&mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=' . $objp->rowid, $journallabel, 2, Globals::$user->rights->accounting->comptarapport->lire); |
|
| 1411 | + $newmenu->add(BASE_URI.'?controller=accountancy/journal&method='.$nature.'journal&mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $journallabel, 2, Globals::$user->rights->accounting->comptarapport->lire); |
|
| 1412 | 1412 | } |
| 1413 | 1413 | $i++; |
| 1414 | 1414 | } |
@@ -1423,31 +1423,31 @@ discard block |
||
| 1423 | 1423 | |
| 1424 | 1424 | // General Ledger |
| 1425 | 1425 | //$newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_generalledger", Globals::$langs->trans("Bookkeeping"), 1, Globals::$user->rights->accounting->mouvements->lire);
|
| 1426 | - $newmenu->add(BASE_URI . "?controller=accountancy/bookkeeping&method=list&mainmenu=accountancy&leftmenu=accountancy_generalledger", Globals::$langs->trans("Bookkeeping"), 1, Globals::$user->rights->accounting->mouvements->lire);
|
|
| 1426 | + $newmenu->add(BASE_URI."?controller=accountancy/bookkeeping&method=list&mainmenu=accountancy&leftmenu=accountancy_generalledger", Globals::$langs->trans("Bookkeeping"), 1, Globals::$user->rights->accounting->mouvements->lire);
|
|
| 1427 | 1427 | |
| 1428 | 1428 | // Balance |
| 1429 | 1429 | //$newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance", Globals::$langs->trans("AccountBalance"), 1, Globals::$user->rights->accounting->mouvements->lire);
|
| 1430 | - $newmenu->add(BASE_URI . "?controller=accountancy/bookkeeping&method=balance&mainmenu=accountancy&leftmenu=accountancy_balance", Globals::$langs->trans("AccountBalance"), 1, Globals::$user->rights->accounting->mouvements->lire);
|
|
| 1430 | + $newmenu->add(BASE_URI."?controller=accountancy/bookkeeping&method=balance&mainmenu=accountancy&leftmenu=accountancy_balance", Globals::$langs->trans("AccountBalance"), 1, Globals::$user->rights->accounting->mouvements->lire);
|
|
| 1431 | 1431 | |
| 1432 | 1432 | // Files |
| 1433 | 1433 | if (!empty(Globals::$conf->global->MAIN_FEATURES_LEVEL) && Globals::$conf->global->MAIN_FEATURES_LEVEL > 2) {
|
| 1434 | 1434 | //$newmenu->add("/compta/compta-files.php?mainmenu=accountancy&leftmenu=accountancy_files", Globals::$langs->trans("AccountantFiles"), 1, Globals::$user->rights->accounting->mouvements->lire);
|
| 1435 | - $newmenu->add(BASE_URI . "?controller=compta&method=compta-files&mainmenu=accountancy&leftmenu=accountancy_files", Globals::$langs->trans("AccountantFiles"), 1, Globals::$user->rights->accounting->mouvements->lire);
|
|
| 1435 | + $newmenu->add(BASE_URI."?controller=compta&method=compta-files&mainmenu=accountancy&leftmenu=accountancy_files", Globals::$langs->trans("AccountantFiles"), 1, Globals::$user->rights->accounting->mouvements->lire);
|
|
| 1436 | 1436 | } |
| 1437 | 1437 | |
| 1438 | 1438 | // Reports |
| 1439 | 1439 | Globals::$langs->load("compta");
|
| 1440 | 1440 | |
| 1441 | 1441 | //$newmenu->add("/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report", Globals::$langs->trans("Reportings"), 1, Globals::$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca');
|
| 1442 | - $newmenu->add(BASE_URI . "?controller=compta/resultat&method=index&mainmenu=accountancy&leftmenu=accountancy_report", Globals::$langs->trans("Reportings"), 1, Globals::$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca');
|
|
| 1442 | + $newmenu->add(BASE_URI."?controller=compta/resultat&method=index&mainmenu=accountancy&leftmenu=accountancy_report", Globals::$langs->trans("Reportings"), 1, Globals::$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca');
|
|
| 1443 | 1443 | |
| 1444 | 1444 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) {
|
| 1445 | 1445 | //$newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report", Globals::$langs->trans("MenuReportInOut"), 2, Globals::$user->rights->accounting->comptarapport->lire);
|
| 1446 | 1446 | //$newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report", Globals::$langs->trans("ByPredefinedAccountGroups"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
| 1447 | 1447 | //$newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report", Globals::$langs->trans("ByPersonalizedAccountGroups"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
| 1448 | - $newmenu->add(BASE_URI . "?controller=compta/resultat&method=index&leftmenu=accountancy_report", Globals::$langs->trans("MenuReportInOut"), 2, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1449 | - $newmenu->add(BASE_URI . "?controller=compta/resultat&method=clientfourn&leftmenu=accountancy_report", Globals::$langs->trans("ByPredefinedAccountGroups"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1450 | - $newmenu->add(BASE_URI . "?controller=compta/resultat&method=result&leftmenu=accountancy_report", Globals::$langs->trans("ByPersonalizedAccountGroups"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1448 | + $newmenu->add(BASE_URI."?controller=compta/resultat&method=index&leftmenu=accountancy_report", Globals::$langs->trans("MenuReportInOut"), 2, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1449 | + $newmenu->add(BASE_URI."?controller=compta/resultat&method=clientfourn&leftmenu=accountancy_report", Globals::$langs->trans("ByPredefinedAccountGroups"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1450 | + $newmenu->add(BASE_URI."?controller=compta/resultat&method=result&leftmenu=accountancy_report", Globals::$langs->trans("ByPersonalizedAccountGroups"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1451 | 1451 | } |
| 1452 | 1452 | |
| 1453 | 1453 | $modecompta = 'CREANCES-DETTES'; |
@@ -1462,11 +1462,11 @@ discard block |
||
| 1462 | 1462 | $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta = " . $modecompta, Globals::$langs->trans("ByProductsAndServices"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
| 1463 | 1463 | $newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta = " . $modecompta, Globals::$langs->trans("ByVatRate"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
| 1464 | 1464 | */ |
| 1465 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=index&leftmenu=accountancy_report&modecompta = " . $modecompta, Globals::$langs->trans("ReportTurnover"), 2, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1466 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=casoc&leftmenu=accountancy_report&modecompta = " . $modecompta, Globals::$langs->trans("ByCompanies"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1467 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=cabyuser&leftmenu=accountancy_report&modecompta = " . $modecompta, Globals::$langs->trans("ByUsers"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1468 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=cabyprodserv&leftmenu=accountancy_report&modecompta = " . $modecompta, Globals::$langs->trans("ByProductsAndServices"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1469 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=byratecountry&leftmenu=accountancy_report&modecompta = " . $modecompta, Globals::$langs->trans("ByVatRate"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1465 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=index&leftmenu=accountancy_report&modecompta = ".$modecompta, Globals::$langs->trans("ReportTurnover"), 2, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1466 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=casoc&leftmenu=accountancy_report&modecompta = ".$modecompta, Globals::$langs->trans("ByCompanies"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1467 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=cabyuser&leftmenu=accountancy_report&modecompta = ".$modecompta, Globals::$langs->trans("ByUsers"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1468 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=cabyprodserv&leftmenu=accountancy_report&modecompta = ".$modecompta, Globals::$langs->trans("ByProductsAndServices"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1469 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=byratecountry&leftmenu=accountancy_report&modecompta = ".$modecompta, Globals::$langs->trans("ByVatRate"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1470 | 1470 | } |
| 1471 | 1471 | } |
| 1472 | 1472 | |
@@ -1477,9 +1477,9 @@ discard block |
||
| 1477 | 1477 | //$newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta = " . $modecompta, Globals::$langs->trans("ReportTurnoverCollected"), 2, Globals::$user->rights->accounting->comptarapport->lire);
|
| 1478 | 1478 | //$newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta = " . $modecompta, Globals::$langs->trans("ByCompanies"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
| 1479 | 1479 | //$newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta = " . $modecompta, Globals::$langs->trans("ByUsers"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
| 1480 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=index&leftmenu=accountancy_report&modecompta = " . $modecompta, Globals::$langs->trans("ReportTurnoverCollected"), 2, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1481 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=casoc&leftmenu=accountancy_report&modecompta = " . $modecompta, Globals::$langs->trans("ByCompanies"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1482 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=cabyuser&leftmenu=accountancy_report&modecompta = " . $modecompta, Globals::$langs->trans("ByUsers"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1480 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=index&leftmenu=accountancy_report&modecompta = ".$modecompta, Globals::$langs->trans("ReportTurnoverCollected"), 2, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1481 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=casoc&leftmenu=accountancy_report&modecompta = ".$modecompta, Globals::$langs->trans("ByCompanies"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1482 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=cabyuser&leftmenu=accountancy_report&modecompta = ".$modecompta, Globals::$langs->trans("ByUsers"), 3, Globals::$user->rights->accounting->comptarapport->lire);
|
|
| 1483 | 1483 | //$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta = ".$modecompta, Globals::$langs->trans("ByProductsAndServices"),3,Globals::$user->rights->accounting->comptarapport->lire);
|
| 1484 | 1484 | //$newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta = ".$modecompta, Globals::$langs->trans("ByVatRate"),3,Globals::$user->rights->accounting->comptarapport->lire);
|
| 1485 | 1485 | } |
@@ -1492,19 +1492,19 @@ discard block |
||
| 1492 | 1492 | |
| 1493 | 1493 | // Bilan, resultats |
| 1494 | 1494 | //$newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", Globals::$langs->trans("Reportings"), 0, Globals::$user->rights->compta->resultat->lire, '', $mainmenu, 'ca');
|
| 1495 | - $newmenu->add(BASE_URI . "?controller=compta/resultat&method=index&leftmenu=report&mainmenu=accountancy", Globals::$langs->trans("Reportings"), 0, Globals::$user->rights->compta->resultat->lire, '', $mainmenu, 'ca');
|
|
| 1495 | + $newmenu->add(BASE_URI."?controller=compta/resultat&method=index&leftmenu=report&mainmenu=accountancy", Globals::$langs->trans("Reportings"), 0, Globals::$user->rights->compta->resultat->lire, '', $mainmenu, 'ca');
|
|
| 1496 | 1496 | |
| 1497 | 1497 | if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) {
|
| 1498 | 1498 | //$newmenu->add("/compta/resultat/index.php?leftmenu=report", Globals::$langs->trans("MenuReportInOut"), 1, Globals::$user->rights->compta->resultat->lire);
|
| 1499 | 1499 | //$newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", Globals::$langs->trans("ByCompanies"), 2, Globals::$user->rights->compta->resultat->lire);
|
| 1500 | - $newmenu->add(BASE_URI . "?controller=compta/resultat&method=index&leftmenu=report", Globals::$langs->trans("MenuReportInOut"), 1, Globals::$user->rights->compta->resultat->lire);
|
|
| 1501 | - $newmenu->add(BASE_URI . "?controller=compta/resultat&method=clientfourn&leftmenu=report", Globals::$langs->trans("ByCompanies"), 2, Globals::$user->rights->compta->resultat->lire);
|
|
| 1500 | + $newmenu->add(BASE_URI."?controller=compta/resultat&method=index&leftmenu=report", Globals::$langs->trans("MenuReportInOut"), 1, Globals::$user->rights->compta->resultat->lire);
|
|
| 1501 | + $newmenu->add(BASE_URI."?controller=compta/resultat&method=clientfourn&leftmenu=report", Globals::$langs->trans("ByCompanies"), 2, Globals::$user->rights->compta->resultat->lire);
|
|
| 1502 | 1502 | /* On verra ca avec module compabilite expert |
| 1503 | 1503 | $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,Globals::$user->rights->compta->resultat->lire);
|
| 1504 | 1504 | $newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,Globals::$user->rights->compta->resultat->lire);
|
| 1505 | 1505 | */ |
| 1506 | 1506 | //$newmenu->add("/compta/stats/index.php?leftmenu=report", Globals::$langs->trans("ReportTurnover"), 1, Globals::$user->rights->compta->resultat->lire);
|
| 1507 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=index&leftmenu=report", Globals::$langs->trans("ReportTurnover"), 1, Globals::$user->rights->compta->resultat->lire);
|
|
| 1507 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=index&leftmenu=report", Globals::$langs->trans("ReportTurnover"), 1, Globals::$user->rights->compta->resultat->lire);
|
|
| 1508 | 1508 | |
| 1509 | 1509 | /* |
| 1510 | 1510 | $newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,Globals::$user->rights->compta->resultat->lire);
|
@@ -1517,16 +1517,16 @@ discard block |
||
| 1517 | 1517 | //$newmenu->add("/compta/stats/cabyuser.php?leftmenu=report", Globals::$langs->trans("ByUsers"), 2, Globals::$user->rights->compta->resultat->lire);
|
| 1518 | 1518 | //$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report", Globals::$langs->trans("ByProductsAndServices"), 2, Globals::$user->rights->compta->resultat->lire);
|
| 1519 | 1519 | //$newmenu->add("/compta/stats/byratecountry.php?leftmenu=report", Globals::$langs->trans("ByVatRate"), 2, Globals::$user->rights->compta->resultat->lire);
|
| 1520 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=casoc&leftmenu=report", Globals::$langs->trans("ByCompanies"), 2, Globals::$user->rights->compta->resultat->lire);
|
|
| 1521 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=cabyuser&leftmenu=report", Globals::$langs->trans("ByUsers"), 2, Globals::$user->rights->compta->resultat->lire);
|
|
| 1522 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=cabyprodserv&leftmenu=report", Globals::$langs->trans("ByProductsAndServices"), 2, Globals::$user->rights->compta->resultat->lire);
|
|
| 1523 | - $newmenu->add(BASE_URI . "?controller=compta/stats&method=byratecountry&leftmenu=report", Globals::$langs->trans("ByVatRate"), 2, Globals::$user->rights->compta->resultat->lire);
|
|
| 1520 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=casoc&leftmenu=report", Globals::$langs->trans("ByCompanies"), 2, Globals::$user->rights->compta->resultat->lire);
|
|
| 1521 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=cabyuser&leftmenu=report", Globals::$langs->trans("ByUsers"), 2, Globals::$user->rights->compta->resultat->lire);
|
|
| 1522 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=cabyprodserv&leftmenu=report", Globals::$langs->trans("ByProductsAndServices"), 2, Globals::$user->rights->compta->resultat->lire);
|
|
| 1523 | + $newmenu->add(BASE_URI."?controller=compta/stats&method=byratecountry&leftmenu=report", Globals::$langs->trans("ByVatRate"), 2, Globals::$user->rights->compta->resultat->lire);
|
|
| 1524 | 1524 | |
| 1525 | 1525 | // Journaux |
| 1526 | 1526 | //$newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", Globals::$langs->trans("SellsJournal"), 1, Globals::$user->rights->compta->resultat->lire, '', '', '', 50);
|
| 1527 | 1527 | //$newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", Globals::$langs->trans("PurchasesJournal"), 1, Globals::$user->rights->compta->resultat->lire, '', '', '', 51);
|
| 1528 | - $newmenu->add(BASE_URI . "?controller=compta/journal&method=sellsjournal&leftmenu=report", Globals::$langs->trans("SellsJournal"), 1, Globals::$user->rights->compta->resultat->lire, '', '', '', 50);
|
|
| 1529 | - $newmenu->add(BASE_URI . "?controller=compta/journal&method=purchasesjournal&leftmenu=report", Globals::$langs->trans("PurchasesJournal"), 1, Globals::$user->rights->compta->resultat->lire, '', '', '', 51);
|
|
| 1528 | + $newmenu->add(BASE_URI."?controller=compta/journal&method=sellsjournal&leftmenu=report", Globals::$langs->trans("SellsJournal"), 1, Globals::$user->rights->compta->resultat->lire, '', '', '', 50);
|
|
| 1529 | + $newmenu->add(BASE_URI."?controller=compta/journal&method=purchasesjournal&leftmenu=report", Globals::$langs->trans("PurchasesJournal"), 1, Globals::$user->rights->compta->resultat->lire, '', '', '', 51);
|
|
| 1530 | 1530 | } |
| 1531 | 1531 | //if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",Globals::$langs->trans("Journaux"),1,Globals::$user->rights->compta->resultat->lire||Globals::$user->rights->accounting->comptarapport->lire);
|
| 1532 | 1532 | } |
@@ -1538,15 +1538,15 @@ discard block |
||
| 1538 | 1538 | //$newmenu->add("/asset/card.php?action=create", Globals::$langs->trans("MenuNewAsset"), 1, Globals::$user->rights->asset->write);
|
| 1539 | 1539 | //$newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", Globals::$langs->trans("MenuListAssets"), 1, Globals::$user->rights->asset->read);
|
| 1540 | 1540 | //$newmenu->add("/asset/type.php?leftmenu=asset_type", Globals::$langs->trans("MenuTypeAssets"), 1, Globals::$user->rights->asset->read, '', $mainmenu, 'asset_type');
|
| 1541 | - $newmenu->add(BASE_URI . "?controller=asset&method=list&leftmenu=asset&mainmenu=accountancy", Globals::$langs->trans("MenuAssets"), 0, Globals::$user->rights->asset->read, '', $mainmenu, 'asset');
|
|
| 1542 | - $newmenu->add(BASE_URI . "?controller=asset&method=card&action=create", Globals::$langs->trans("MenuNewAsset"), 1, Globals::$user->rights->asset->write);
|
|
| 1543 | - $newmenu->add(BASE_URI . "?controller=asset&method=list&leftmenu=asset&mainmenu=accountancy", Globals::$langs->trans("MenuListAssets"), 1, Globals::$user->rights->asset->read);
|
|
| 1544 | - $newmenu->add(BASE_URI . "?controller=asset&method=type&leftmenu=asset_type", Globals::$langs->trans("MenuTypeAssets"), 1, Globals::$user->rights->asset->read, '', $mainmenu, 'asset_type');
|
|
| 1541 | + $newmenu->add(BASE_URI."?controller=asset&method=list&leftmenu=asset&mainmenu=accountancy", Globals::$langs->trans("MenuAssets"), 0, Globals::$user->rights->asset->read, '', $mainmenu, 'asset');
|
|
| 1542 | + $newmenu->add(BASE_URI."?controller=asset&method=card&action=create", Globals::$langs->trans("MenuNewAsset"), 1, Globals::$user->rights->asset->write);
|
|
| 1543 | + $newmenu->add(BASE_URI."?controller=asset&method=list&leftmenu=asset&mainmenu=accountancy", Globals::$langs->trans("MenuListAssets"), 1, Globals::$user->rights->asset->read);
|
|
| 1544 | + $newmenu->add(BASE_URI."?controller=asset&method=type&leftmenu=asset_type", Globals::$langs->trans("MenuTypeAssets"), 1, Globals::$user->rights->asset->read, '', $mainmenu, 'asset_type');
|
|
| 1545 | 1545 | if ($usemenuhider || empty($leftmenu) || preg_match('/asset_type/', $leftmenu)) {
|
| 1546 | 1546 | //$newmenu->add("/asset/type.php?leftmenu=asset_type&action=create", Globals::$langs->trans("MenuNewTypeAssets"), 2, Globals::$user->rights->asset->write);
|
| 1547 | 1547 | //$newmenu->add("/asset/type.php?leftmenu=asset_type", Globals::$langs->trans("MenuListTypeAssets"), 2, Globals::$user->rights->asset->read);
|
| 1548 | - $newmenu->add(BASE_URI . "?controller=asset&method=type&leftmenu=asset_type&action=create", Globals::$langs->trans("MenuNewTypeAssets"), 2, Globals::$user->rights->asset->write);
|
|
| 1549 | - $newmenu->add(BASE_URI . "?controller=asset&mtehod=type&leftmenu=asset_type", Globals::$langs->trans("MenuListTypeAssets"), 2, Globals::$user->rights->asset->read);
|
|
| 1548 | + $newmenu->add(BASE_URI."?controller=asset&method=type&leftmenu=asset_type&action=create", Globals::$langs->trans("MenuNewTypeAssets"), 2, Globals::$user->rights->asset->write);
|
|
| 1549 | + $newmenu->add(BASE_URI."?controller=asset&mtehod=type&leftmenu=asset_type", Globals::$langs->trans("MenuListTypeAssets"), 2, Globals::$user->rights->asset->read);
|
|
| 1550 | 1550 | } |
| 1551 | 1551 | } |
| 1552 | 1552 | } |
@@ -1571,28 +1571,28 @@ discard block |
||
| 1571 | 1571 | |
| 1572 | 1572 | $newmenu->add("/compta/bank/transfer.php", Globals::$langs->trans("MenuBankInternalTransfer"), 1, Globals::$user->rights->banque->transfer);
|
| 1573 | 1573 | */ |
| 1574 | - $newmenu->add(BASE_URI . "?controller=compta/bank&method=list&leftmenu=bank&mainmenu=bank", Globals::$langs->trans("MenuBankCash"), 0, Globals::$user->rights->banque->lire, '', $mainmenu, 'bank');
|
|
| 1574 | + $newmenu->add(BASE_URI."?controller=compta/bank&method=list&leftmenu=bank&mainmenu=bank", Globals::$langs->trans("MenuBankCash"), 0, Globals::$user->rights->banque->lire, '', $mainmenu, 'bank');
|
|
| 1575 | 1575 | |
| 1576 | - $newmenu->add(BASE_URI . "?controller=compta/bank&method=card&action=create", Globals::$langs->trans("MenuNewFinancialAccount"), 1, Globals::$user->rights->banque->configurer);
|
|
| 1577 | - $newmenu->add(BASE_URI . "?controller=compta/bank&method=list&leftmenu=bank&mainmenu=bank", Globals::$langs->trans("List"), 1, Globals::$user->rights->banque->lire, '', $mainmenu, 'bank');
|
|
| 1578 | - $newmenu->add(BASE_URI . "?controller=compta/bank&method=bankentries_list", Globals::$langs->trans("ListTransactions"), 1, Globals::$user->rights->banque->lire);
|
|
| 1579 | - $newmenu->add(BASE_URI . "?controller=compta/bank&method=budget", Globals::$langs->trans("ListTransactionsByCategory"), 1, Globals::$user->rights->banque->lire);
|
|
| 1576 | + $newmenu->add(BASE_URI."?controller=compta/bank&method=card&action=create", Globals::$langs->trans("MenuNewFinancialAccount"), 1, Globals::$user->rights->banque->configurer);
|
|
| 1577 | + $newmenu->add(BASE_URI."?controller=compta/bank&method=list&leftmenu=bank&mainmenu=bank", Globals::$langs->trans("List"), 1, Globals::$user->rights->banque->lire, '', $mainmenu, 'bank');
|
|
| 1578 | + $newmenu->add(BASE_URI."?controller=compta/bank&method=bankentries_list", Globals::$langs->trans("ListTransactions"), 1, Globals::$user->rights->banque->lire);
|
|
| 1579 | + $newmenu->add(BASE_URI."?controller=compta/bank&method=budget", Globals::$langs->trans("ListTransactionsByCategory"), 1, Globals::$user->rights->banque->lire);
|
|
| 1580 | 1580 | |
| 1581 | - $newmenu->add(BASE_URI . "?controller=compta/bank&method=transfer", Globals::$langs->trans("MenuBankInternalTransfer"), 1, Globals::$user->rights->banque->transfer);
|
|
| 1581 | + $newmenu->add(BASE_URI."?controller=compta/bank&method=transfer", Globals::$langs->trans("MenuBankInternalTransfer"), 1, Globals::$user->rights->banque->transfer);
|
|
| 1582 | 1582 | } |
| 1583 | 1583 | |
| 1584 | 1584 | if (!empty($conf->categorie->enabled)) {
|
| 1585 | 1585 | Globals::$langs->load("categories");
|
| 1586 | 1586 | //$newmenu->add("/categories/index.php?type = 5", Globals::$langs->trans("Rubriques"), 1, Globals::$user->rights->categorie->creer, '', $mainmenu, 'tags');
|
| 1587 | 1587 | //$newmenu->add("/compta/bank/categ.php", Globals::$langs->trans("RubriquesTransactions"), 1, Globals::$user->rights->categorie->creer, '', $mainmenu, 'tags');
|
| 1588 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&type=5", Globals::$langs->trans("Rubriques"), 1, Globals::$user->rights->categorie->creer, '', $mainmenu, 'tags');
|
|
| 1589 | - $newmenu->add(BASE_URI . "?controller=compta/bank&method=categ", Globals::$langs->trans("RubriquesTransactions"), 1, Globals::$user->rights->categorie->creer, '', $mainmenu, 'tags');
|
|
| 1588 | + $newmenu->add(BASE_URI."?controller=categories&method=index&type=5", Globals::$langs->trans("Rubriques"), 1, Globals::$user->rights->categorie->creer, '', $mainmenu, 'tags');
|
|
| 1589 | + $newmenu->add(BASE_URI."?controller=compta/bank&method=categ", Globals::$langs->trans("RubriquesTransactions"), 1, Globals::$user->rights->categorie->creer, '', $mainmenu, 'tags');
|
|
| 1590 | 1590 | } |
| 1591 | 1591 | |
| 1592 | 1592 | // Prelevements |
| 1593 | 1593 | if (!empty($conf->prelevement->enabled)) {
|
| 1594 | 1594 | //$newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank", Globals::$langs->trans("StandingOrders"), 0, Globals::$user->rights->prelevement->bons->lire, '', $mainmenu, 'withdraw');
|
| 1595 | - $newmenu->add(BASE_URI . "?controller=compta/prelevement&method=index&leftmenu=withdraw&mainmenu=bank", Globals::$langs->trans("StandingOrders"), 0, Globals::$user->rights->prelevement->bons->lire, '', $mainmenu, 'withdraw');
|
|
| 1595 | + $newmenu->add(BASE_URI."?controller=compta/prelevement&method=index&leftmenu=withdraw&mainmenu=bank", Globals::$langs->trans("StandingOrders"), 0, Globals::$user->rights->prelevement->bons->lire, '', $mainmenu, 'withdraw');
|
|
| 1596 | 1596 | |
| 1597 | 1597 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "withdraw") {
|
| 1598 | 1598 | //$newmenu->add("/compta/prelevement/demandes.php?status = 0&mainmenu=bank",Globals::$langs->trans("StandingOrderToProcess"),1,Globals::$user->rights->prelevement->bons->lire);
|
@@ -1605,12 +1605,12 @@ discard block |
||
| 1605 | 1605 | $newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank", Globals::$langs->trans("Rejects"), 1, Globals::$user->rights->prelevement->bons->lire);
|
| 1606 | 1606 | $newmenu->add("/compta/prelevement/stats.php?mainmenu=bank", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->prelevement->bons->lire);
|
| 1607 | 1607 | */ |
| 1608 | - $newmenu->add(BASE_URI . "?controller=compta/prelevement&method=create&mainmenu=bank", Globals::$langs->trans("NewStandingOrder"), 1, Globals::$user->rights->prelevement->bons->creer);
|
|
| 1608 | + $newmenu->add(BASE_URI."?controller=compta/prelevement&method=create&mainmenu=bank", Globals::$langs->trans("NewStandingOrder"), 1, Globals::$user->rights->prelevement->bons->creer);
|
|
| 1609 | 1609 | |
| 1610 | - $newmenu->add(BASE_URI . "?controller=compta/prelevement&method=bons&mainmenu=bank", Globals::$langs->trans("WithdrawalsReceipts"), 1, Globals::$user->rights->prelevement->bons->lire);
|
|
| 1611 | - $newmenu->add(BASE_URI . "?controller=compta/prelevement&method=list&mainmenu=bank", Globals::$langs->trans("WithdrawalsLines"), 1, Globals::$user->rights->prelevement->bons->lire);
|
|
| 1612 | - $newmenu->add(BASE_URI . "?controller=compta/prelevement&method=rejets&mainmenu=bank", Globals::$langs->trans("Rejects"), 1, Globals::$user->rights->prelevement->bons->lire);
|
|
| 1613 | - $newmenu->add(BASE_URI . "?controller=compta/prelevement&method=stats&mainmenu=bank", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->prelevement->bons->lire);
|
|
| 1610 | + $newmenu->add(BASE_URI."?controller=compta/prelevement&method=bons&mainmenu=bank", Globals::$langs->trans("WithdrawalsReceipts"), 1, Globals::$user->rights->prelevement->bons->lire);
|
|
| 1611 | + $newmenu->add(BASE_URI."?controller=compta/prelevement&method=list&mainmenu=bank", Globals::$langs->trans("WithdrawalsLines"), 1, Globals::$user->rights->prelevement->bons->lire);
|
|
| 1612 | + $newmenu->add(BASE_URI."?controller=compta/prelevement&method=rejets&mainmenu=bank", Globals::$langs->trans("Rejects"), 1, Globals::$user->rights->prelevement->bons->lire);
|
|
| 1613 | + $newmenu->add(BASE_URI."?controller=compta/prelevement&method=stats&mainmenu=bank", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->prelevement->bons->lire);
|
|
| 1614 | 1614 | |
| 1615 | 1615 | //$newmenu->add("/compta/prelevement/config.php",Globals::$langs->trans("Setup"),1,Globals::$user->rights->prelevement->bons->configurer);
|
| 1616 | 1616 | } |
@@ -1619,12 +1619,12 @@ discard block |
||
| 1619 | 1619 | // Gestion cheques |
| 1620 | 1620 | if (empty(Globals::$conf->global->BANK_DISABLE_CHECK_DEPOSIT) && !empty($conf->banque->enabled) && (!empty($conf->facture->enabled) || !empty(Globals::$conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))) {
|
| 1621 | 1621 | //$newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank", Globals::$langs->trans("MenuChequeDeposits"), 0, Globals::$user->rights->banque->cheque, '', $mainmenu, 'checks');
|
| 1622 | - $newmenu->add(BASE_URI . "?controller=compta/paiement/cheque&method=index&leftmenu=checks&mainmenu=bank", Globals::$langs->trans("MenuChequeDeposits"), 0, Globals::$user->rights->banque->cheque, '', $mainmenu, 'checks');
|
|
| 1622 | + $newmenu->add(BASE_URI."?controller=compta/paiement/cheque&method=index&leftmenu=checks&mainmenu=bank", Globals::$langs->trans("MenuChequeDeposits"), 0, Globals::$user->rights->banque->cheque, '', $mainmenu, 'checks');
|
|
| 1623 | 1623 | if (preg_match('/checks/', $leftmenu)) {
|
| 1624 | 1624 | //$newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank", Globals::$langs->trans("NewChequeDeposit"), 1, Globals::$user->rights->banque->cheque);
|
| 1625 | 1625 | //$newmenu->add("/compta/paiement/cheque/list.php?leftmenu=checks_bis&mainmenu=bank", Globals::$langs->trans("List"), 1, Globals::$user->rights->banque->cheque);
|
| 1626 | - $newmenu->add(BASE_URI . "?controller=compta/paiement/cheque&method=card&leftmenu=checks_bis&action=new&mainmenu=bank", Globals::$langs->trans("NewChequeDeposit"), 1, Globals::$user->rights->banque->cheque);
|
|
| 1627 | - $newmenu->add(BASE_URI . "?controller=compta/paiement/cheque&method=list&leftmenu=checks_bis&mainmenu=bank", Globals::$langs->trans("List"), 1, Globals::$user->rights->banque->cheque);
|
|
| 1626 | + $newmenu->add(BASE_URI."?controller=compta/paiement/cheque&method=card&leftmenu=checks_bis&action=new&mainmenu=bank", Globals::$langs->trans("NewChequeDeposit"), 1, Globals::$user->rights->banque->cheque);
|
|
| 1627 | + $newmenu->add(BASE_URI."?controller=compta/paiement/cheque&method=list&leftmenu=checks_bis&mainmenu=bank", Globals::$langs->trans("List"), 1, Globals::$user->rights->banque->cheque);
|
|
| 1628 | 1628 | } |
| 1629 | 1629 | } |
| 1630 | 1630 | |
@@ -1634,9 +1634,9 @@ discard block |
||
| 1634 | 1634 | //$newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list", Globals::$langs->trans("POS"), 0, $permtomakecashfence, '', $mainmenu, 'cashcontrol');
|
| 1635 | 1635 | //$newmenu->add("/compta/cashcontrol/cashcontrol_card.php?action=create", Globals::$langs->trans("NewCashFence"), 1, $permtomakecashfence);
|
| 1636 | 1636 | //$newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list", Globals::$langs->trans("List"), 1, $permtomakecashfence);
|
| 1637 | - $newmenu->add(BASE_URI . "?controller=compta/cashcontrol&method=cashcontrol_list&action=list", Globals::$langs->trans("POS"), 0, $permtomakecashfence, '', $mainmenu, 'cashcontrol');
|
|
| 1638 | - $newmenu->add(BASE_URI . "?controller=compta/cashcontrol&method=cashcontrol_card&action=create", Globals::$langs->trans("NewCashFence"), 1, $permtomakecashfence);
|
|
| 1639 | - $newmenu->add(BASE_URI . "?controller=compta/cashcontrol&method=cashcontrol_list&action=list", Globals::$langs->trans("List"), 1, $permtomakecashfence);
|
|
| 1637 | + $newmenu->add(BASE_URI."?controller=compta/cashcontrol&method=cashcontrol_list&action=list", Globals::$langs->trans("POS"), 0, $permtomakecashfence, '', $mainmenu, 'cashcontrol');
|
|
| 1638 | + $newmenu->add(BASE_URI."?controller=compta/cashcontrol&method=cashcontrol_card&action=create", Globals::$langs->trans("NewCashFence"), 1, $permtomakecashfence);
|
|
| 1639 | + $newmenu->add(BASE_URI."?controller=compta/cashcontrol&method=cashcontrol_list&action=list", Globals::$langs->trans("List"), 1, $permtomakecashfence);
|
|
| 1640 | 1640 | } |
| 1641 | 1641 | } |
| 1642 | 1642 | |
@@ -1649,34 +1649,34 @@ discard block |
||
| 1649 | 1649 | //$newmenu->add("/product/index.php?leftmenu=product&type=0", Globals::$langs->trans("Products"), 0, Globals::$user->rights->produit->lire, '', $mainmenu, 'product');
|
| 1650 | 1650 | //$newmenu->add("/product/card.php?leftmenu=product&action=create&type=0", Globals::$langs->trans("NewProduct"), 1, Globals::$user->rights->produit->creer);
|
| 1651 | 1651 | //$newmenu->add("/product/list.php?leftmenu=product&type=0", Globals::$langs->trans("List"), 1, Globals::$user->rights->produit->lire);
|
| 1652 | - $newmenu->add(BASE_URI . "?controller=product&method=index&leftmenu=product&type=0", Globals::$langs->trans("Products"), 0, Globals::$user->rights->produit->lire, '', $mainmenu, 'product');
|
|
| 1653 | - $newmenu->add(BASE_URI . "?controller=product&method=card&leftmenu=product&action=create&type=0", Globals::$langs->trans("NewProduct"), 1, Globals::$user->rights->produit->creer);
|
|
| 1654 | - $newmenu->add(BASE_URI . "?controller=product&method=list&leftmenu=product&type=0", Globals::$langs->trans("List"), 1, Globals::$user->rights->produit->lire);
|
|
| 1652 | + $newmenu->add(BASE_URI."?controller=product&method=index&leftmenu=product&type=0", Globals::$langs->trans("Products"), 0, Globals::$user->rights->produit->lire, '', $mainmenu, 'product');
|
|
| 1653 | + $newmenu->add(BASE_URI."?controller=product&method=card&leftmenu=product&action=create&type=0", Globals::$langs->trans("NewProduct"), 1, Globals::$user->rights->produit->creer);
|
|
| 1654 | + $newmenu->add(BASE_URI."?controller=product&method=list&leftmenu=product&type=0", Globals::$langs->trans("List"), 1, Globals::$user->rights->produit->lire);
|
|
| 1655 | 1655 | if (!empty($conf->stock->enabled)) {
|
| 1656 | 1656 | //$newmenu->add("/product/reassort.php?type = 0", Globals::$langs->trans("Stocks"), 1, Globals::$user->rights->produit->lire && Globals::$user->rights->stock->lire);
|
| 1657 | - $newmenu->add(BASE_URI . "?controller=product&method=reassort&type=0", Globals::$langs->trans("Stocks"), 1, Globals::$user->rights->produit->lire && Globals::$user->rights->stock->lire);
|
|
| 1657 | + $newmenu->add(BASE_URI."?controller=product&method=reassort&type=0", Globals::$langs->trans("Stocks"), 1, Globals::$user->rights->produit->lire && Globals::$user->rights->stock->lire);
|
|
| 1658 | 1658 | } |
| 1659 | 1659 | if (!empty($conf->productbatch->enabled)) {
|
| 1660 | 1660 | Globals::$langs->load("stocks");
|
| 1661 | 1661 | //$newmenu->add("/product/reassortlot.php?type = 0", Globals::$langs->trans("StocksByLotSerial"), 1, Globals::$user->rights->produit->lire && Globals::$user->rights->stock->lire);
|
| 1662 | 1662 | //$newmenu->add("/product/stock/productlot_list.php", Globals::$langs->trans("LotSerial"), 1, Globals::$user->rights->produit->lire && Globals::$user->rights->stock->lire);
|
| 1663 | - $newmenu->add(BASE_URI . "?controller=product&method=reassortlot&type=0", Globals::$langs->trans("StocksByLotSerial"), 1, Globals::$user->rights->produit->lire && Globals::$user->rights->stock->lire);
|
|
| 1664 | - $newmenu->add(BASE_URI . "?controller=product/stock&method=productlot_list", Globals::$langs->trans("LotSerial"), 1, Globals::$user->rights->produit->lire && Globals::$user->rights->stock->lire);
|
|
| 1663 | + $newmenu->add(BASE_URI."?controller=product&method=reassortlot&type=0", Globals::$langs->trans("StocksByLotSerial"), 1, Globals::$user->rights->produit->lire && Globals::$user->rights->stock->lire);
|
|
| 1664 | + $newmenu->add(BASE_URI."?controller=product/stock&method=productlot_list", Globals::$langs->trans("LotSerial"), 1, Globals::$user->rights->produit->lire && Globals::$user->rights->stock->lire);
|
|
| 1665 | 1665 | } |
| 1666 | 1666 | if (!empty($conf->variants->enabled)) {
|
| 1667 | 1667 | //$newmenu->add("/variants/list.php", Globals::$langs->trans("VariantAttributes"), 1, Globals::$user->rights->produit->lire);
|
| 1668 | - $newmenu->add(BASE_URI . "?controller=variants&method=list", Globals::$langs->trans("VariantAttributes"), 1, Globals::$user->rights->produit->lire);
|
|
| 1668 | + $newmenu->add(BASE_URI."?controller=variants&method=list", Globals::$langs->trans("VariantAttributes"), 1, Globals::$user->rights->produit->lire);
|
|
| 1669 | 1669 | } |
| 1670 | 1670 | if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) {
|
| 1671 | 1671 | // $newmenu->add("/product/stats/card.php?id = all&leftmenu=stats&type=0", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->produit->lire && Globals::$user->rights->propale->lire);
|
| 1672 | - $newmenu->add(BASE_URI . "?controller=product/stats&method=card&id=all&leftmenu=stats&type=0", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->produit->lire && Globals::$user->rights->propale->lire);
|
|
| 1672 | + $newmenu->add(BASE_URI."?controller=product/stats&method=card&id=all&leftmenu=stats&type=0", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->produit->lire && Globals::$user->rights->propale->lire);
|
|
| 1673 | 1673 | } |
| 1674 | 1674 | |
| 1675 | 1675 | // Categories |
| 1676 | 1676 | if (!empty($conf->categorie->enabled)) {
|
| 1677 | 1677 | Globals::$langs->load("categories");
|
| 1678 | 1678 | //$newmenu->add("/categories/index.php?leftmenu=cat&type=0", Globals::$langs->trans("Categories"), 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
| 1679 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&leftmenu=cat&type=0", Globals::$langs->trans("Categories"), 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
|
| 1679 | + $newmenu->add(BASE_URI."?controller=categories&method=index&leftmenu=cat&type=0", Globals::$langs->trans("Categories"), 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
|
| 1680 | 1680 | //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", Globals::$langs->trans("List"), 1, Globals::$user->rights->categorie->lire);
|
| 1681 | 1681 | } |
| 1682 | 1682 | } |
@@ -1686,18 +1686,18 @@ discard block |
||
| 1686 | 1686 | //$newmenu->add("/product/index.php?leftmenu=service&type=1", Globals::$langs->trans("Services"), 0, Globals::$user->rights->service->lire, '', $mainmenu, 'service');
|
| 1687 | 1687 | //$newmenu->add("/product/card.php?leftmenu=service&action=create&type=1", Globals::$langs->trans("NewService"), 1, Globals::$user->rights->service->creer);
|
| 1688 | 1688 | //$newmenu->add("/product/list.php?leftmenu=service&type=1", Globals::$langs->trans("List"), 1, Globals::$user->rights->service->lire);
|
| 1689 | - $newmenu->add(BASE_URI . "?controller=product&method=index&leftmenu=service&type=1", Globals::$langs->trans("Services"), 0, Globals::$user->rights->service->lire, '', $mainmenu, 'service');
|
|
| 1690 | - $newmenu->add(BASE_URI . "?controller=product&method=card&leftmenu=service&action=create&type=1", Globals::$langs->trans("NewService"), 1, Globals::$user->rights->service->creer);
|
|
| 1691 | - $newmenu->add(BASE_URI . "?controller=product&method=list&leftmenu=service&type=1", Globals::$langs->trans("List"), 1, Globals::$user->rights->service->lire);
|
|
| 1689 | + $newmenu->add(BASE_URI."?controller=product&method=index&leftmenu=service&type=1", Globals::$langs->trans("Services"), 0, Globals::$user->rights->service->lire, '', $mainmenu, 'service');
|
|
| 1690 | + $newmenu->add(BASE_URI."?controller=product&method=card&leftmenu=service&action=create&type=1", Globals::$langs->trans("NewService"), 1, Globals::$user->rights->service->creer);
|
|
| 1691 | + $newmenu->add(BASE_URI."?controller=product&method=list&leftmenu=service&type=1", Globals::$langs->trans("List"), 1, Globals::$user->rights->service->lire);
|
|
| 1692 | 1692 | if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) {
|
| 1693 | 1693 | //$newmenu->add("/product/stats/card.php?id = all&leftmenu=stats&type=1", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->service->lire && Globals::$user->rights->propale->lire);
|
| 1694 | - $newmenu->add(BASE_URI . "?controller=product/stats&method=card&id=all&leftmenu=stats&type=1", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->service->lire && Globals::$user->rights->propale->lire);
|
|
| 1694 | + $newmenu->add(BASE_URI."?controller=product/stats&method=card&id=all&leftmenu=stats&type=1", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->service->lire && Globals::$user->rights->propale->lire);
|
|
| 1695 | 1695 | } |
| 1696 | 1696 | // Categories |
| 1697 | 1697 | if (!empty($conf->categorie->enabled)) {
|
| 1698 | 1698 | Globals::$langs->load("categories");
|
| 1699 | 1699 | //$newmenu->add("/categories/index.php?leftmenu=cat&type=0", Globals::$langs->trans("Categories"), 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
| 1700 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&leftmenu=cat&type=0", Globals::$langs->trans("Categories"), 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
|
| 1700 | + $newmenu->add(BASE_URI."?controller=categories&method=index&leftmenu=cat&type=0", Globals::$langs->trans("Categories"), 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
|
| 1701 | 1701 | //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", Globals::$langs->trans("List"), 1, Globals::$user->rights->categorie->lire);
|
| 1702 | 1702 | } |
| 1703 | 1703 | } |
@@ -1713,15 +1713,15 @@ discard block |
||
| 1713 | 1713 | |
| 1714 | 1714 | $newmenu->add("/product/stock/massstockmove.php", Globals::$langs->trans("MassStockTransferShort"), 1, Globals::$user->rights->stock->mouvement->creer);
|
| 1715 | 1715 | */ |
| 1716 | - $newmenu->add(BASE_URI . "?controller=product/stock&method=index&leftmenu=stock", Globals::$langs->trans("Warehouses"), 0, Globals::$user->rights->stock->lire, '', $mainmenu, 'stock');
|
|
| 1717 | - $newmenu->add(BASE_URI . "?controller=product/stock&method=card&action=create", Globals::$langs->trans("MenuNewWarehouse"), 1, Globals::$user->rights->stock->creer);
|
|
| 1718 | - $newmenu->add(BASE_URI . "?controller=product/stock&method=list", Globals::$langs->trans("List"), 1, Globals::$user->rights->stock->lire);
|
|
| 1719 | - $newmenu->add(BASE_URI . "?controller=product/stock&method=movement_list", Globals::$langs->trans("Movements"), 1, Globals::$user->rights->stock->mouvement->lire);
|
|
| 1716 | + $newmenu->add(BASE_URI."?controller=product/stock&method=index&leftmenu=stock", Globals::$langs->trans("Warehouses"), 0, Globals::$user->rights->stock->lire, '', $mainmenu, 'stock');
|
|
| 1717 | + $newmenu->add(BASE_URI."?controller=product/stock&method=card&action=create", Globals::$langs->trans("MenuNewWarehouse"), 1, Globals::$user->rights->stock->creer);
|
|
| 1718 | + $newmenu->add(BASE_URI."?controller=product/stock&method=list", Globals::$langs->trans("List"), 1, Globals::$user->rights->stock->lire);
|
|
| 1719 | + $newmenu->add(BASE_URI."?controller=product/stock&method=movement_list", Globals::$langs->trans("Movements"), 1, Globals::$user->rights->stock->mouvement->lire);
|
|
| 1720 | 1720 | |
| 1721 | - $newmenu->add(BASE_URI . "?controller=product/stock&method=massstockmove", Globals::$langs->trans("MassStockTransferShort"), 1, Globals::$user->rights->stock->mouvement->creer);
|
|
| 1721 | + $newmenu->add(BASE_URI."?controller=product/stock&method=massstockmove", Globals::$langs->trans("MassStockTransferShort"), 1, Globals::$user->rights->stock->mouvement->creer);
|
|
| 1722 | 1722 | if ($conf->supplier_order->enabled) {
|
| 1723 | 1723 | //$newmenu->add("/product/stock/replenish.php", Globals::$langs->trans("Replenishment"), 1, Globals::$user->rights->stock->mouvement->creer && Globals::$user->rights->fournisseur->lire);
|
| 1724 | - $newmenu->add(BASE_URI . "?controller=product/stock&method=replenish", Globals::$langs->trans("Replenishment"), 1, Globals::$user->rights->stock->mouvement->creer && Globals::$user->rights->fournisseur->lire);
|
|
| 1724 | + $newmenu->add(BASE_URI."?controller=product/stock&method=replenish", Globals::$langs->trans("Replenishment"), 1, Globals::$user->rights->stock->mouvement->creer && Globals::$user->rights->fournisseur->lire);
|
|
| 1725 | 1725 | } |
| 1726 | 1726 | } |
| 1727 | 1727 | |
@@ -1733,16 +1733,16 @@ discard block |
||
| 1733 | 1733 | //$newmenu->add("/product/inventory/list.php?leftmenu=stock", Globals::$langs->trans("Inventory"), 0, Globals::$user->rights->stock->lire, '', $mainmenu, 'stock');
|
| 1734 | 1734 | //$newmenu->add("/product/inventory/card.php?action=create", Globals::$langs->trans("NewInventory"), 1, Globals::$user->rights->stock->creer);
|
| 1735 | 1735 | //$newmenu->add("/product/inventory/list.php", Globals::$langs->trans("List"), 1, Globals::$user->rights->stock->lire);
|
| 1736 | - $newmenu->add(BASE_URI . "?controller=product/inventory&method=list&leftmenu=stock", Globals::$langs->trans("Inventory"), 0, Globals::$user->rights->stock->lire, '', $mainmenu, 'stock');
|
|
| 1737 | - $newmenu->add(BASE_URI . "?controller=product/inventory&method=card&action=create", Globals::$langs->trans("NewInventory"), 1, Globals::$user->rights->stock->creer);
|
|
| 1738 | - $newmenu->add(BASE_URI . "?controller=product/inventory&method=list", Globals::$langs->trans("List"), 1, Globals::$user->rights->stock->lire);
|
|
| 1736 | + $newmenu->add(BASE_URI."?controller=product/inventory&method=list&leftmenu=stock", Globals::$langs->trans("Inventory"), 0, Globals::$user->rights->stock->lire, '', $mainmenu, 'stock');
|
|
| 1737 | + $newmenu->add(BASE_URI."?controller=product/inventory&method=card&action=create", Globals::$langs->trans("NewInventory"), 1, Globals::$user->rights->stock->creer);
|
|
| 1738 | + $newmenu->add(BASE_URI."?controller=product/inventory&method=list", Globals::$langs->trans("List"), 1, Globals::$user->rights->stock->lire);
|
|
| 1739 | 1739 | } else {
|
| 1740 | 1740 | //$newmenu->add("/product/inventory/list.php?leftmenu=stock", Globals::$langs->trans("Inventory"), 0, Globals::$user->rights->stock->inventory_advance->read, '', $mainmenu, 'stock');
|
| 1741 | 1741 | //$newmenu->add("/product/inventory/card.php?action=create", Globals::$langs->trans("NewInventory"), 1, Globals::$user->rights->stock->inventory_advance->write);
|
| 1742 | 1742 | //$newmenu->add("/product/inventory/list.php", Globals::$langs->trans("List"), 1, Globals::$user->rights->stock->inventory_advance->read);
|
| 1743 | - $newmenu->add(BASE_URI . "?controller=product/inventory&method=list&leftmenu=stock", Globals::$langs->trans("Inventory"), 0, Globals::$user->rights->stock->inventory_advance->read, '', $mainmenu, 'stock');
|
|
| 1744 | - $newmenu->add(BASE_URI . "?controller=product/inventory&method=card&action=create", Globals::$langs->trans("NewInventory"), 1, Globals::$user->rights->stock->inventory_advance->write);
|
|
| 1745 | - $newmenu->add(BASE_URI . "?controller=product/inventory&method=list", Globals::$langs->trans("List"), 1, Globals::$user->rights->stock->inventory_advance->read);
|
|
| 1743 | + $newmenu->add(BASE_URI."?controller=product/inventory&method=list&leftmenu=stock", Globals::$langs->trans("Inventory"), 0, Globals::$user->rights->stock->inventory_advance->read, '', $mainmenu, 'stock');
|
|
| 1744 | + $newmenu->add(BASE_URI."?controller=product/inventory&method=card&action=create", Globals::$langs->trans("NewInventory"), 1, Globals::$user->rights->stock->inventory_advance->write);
|
|
| 1745 | + $newmenu->add(BASE_URI."?controller=product/inventory&method=list", Globals::$langs->trans("List"), 1, Globals::$user->rights->stock->inventory_advance->read);
|
|
| 1746 | 1746 | } |
| 1747 | 1747 | } |
| 1748 | 1748 | } |
@@ -1753,19 +1753,19 @@ discard block |
||
| 1753 | 1753 | //$newmenu->add("/expedition/index.php?leftmenu=sendings", Globals::$langs->trans("Shipments"), 0, Globals::$user->rights->expedition->lire, '', $mainmenu, 'sendings');
|
| 1754 | 1754 | //$newmenu->add("/expedition/card.php?action=create2&leftmenu=sendings", Globals::$langs->trans("NewSending"), 1, Globals::$user->rights->expedition->creer);
|
| 1755 | 1755 | //$newmenu->add("/expedition/list.php?leftmenu=sendings", Globals::$langs->trans("List"), 1, Globals::$user->rights->expedition->lire);
|
| 1756 | - $newmenu->add(BASE_URI . "?controller=expedition&method=index&leftmenu=sendings", Globals::$langs->trans("Shipments"), 0, Globals::$user->rights->expedition->lire, '', $mainmenu, 'sendings');
|
|
| 1757 | - $newmenu->add(BASE_URI . "?controller=expedition&method=card&action=create2&leftmenu=sendings", Globals::$langs->trans("NewSending"), 1, Globals::$user->rights->expedition->creer);
|
|
| 1758 | - $newmenu->add(BASE_URI . "?controller=expedition&method=list&leftmenu=sendings", Globals::$langs->trans("List"), 1, Globals::$user->rights->expedition->lire);
|
|
| 1756 | + $newmenu->add(BASE_URI."?controller=expedition&method=index&leftmenu=sendings", Globals::$langs->trans("Shipments"), 0, Globals::$user->rights->expedition->lire, '', $mainmenu, 'sendings');
|
|
| 1757 | + $newmenu->add(BASE_URI."?controller=expedition&method=card&action=create2&leftmenu=sendings", Globals::$langs->trans("NewSending"), 1, Globals::$user->rights->expedition->creer);
|
|
| 1758 | + $newmenu->add(BASE_URI."?controller=expedition&method=list&leftmenu=sendings", Globals::$langs->trans("List"), 1, Globals::$user->rights->expedition->lire);
|
|
| 1759 | 1759 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "sendings") {
|
| 1760 | 1760 | //$newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=0", Globals::$langs->trans("StatusSendingDraftShort"), 2, Globals::$user->rights->expedition->lire);
|
| 1761 | 1761 | //$newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=1", Globals::$langs->trans("StatusSendingValidatedShort"), 2, Globals::$user->rights->expedition->lire);
|
| 1762 | 1762 | //$newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=2", Globals::$langs->trans("StatusSendingProcessedShort"), 2, Globals::$user->rights->expedition->lire);
|
| 1763 | - $newmenu->add(BASE_URI . "?controller=expedition&method=list&leftmenu=sendings&viewstatut=0", Globals::$langs->trans("StatusSendingDraftShort"), 2, Globals::$user->rights->expedition->lire);
|
|
| 1764 | - $newmenu->add(BASE_URI . "?controller=expedition&method=list&leftmenu=sendings&viewstatut=1", Globals::$langs->trans("StatusSendingValidatedShort"), 2, Globals::$user->rights->expedition->lire);
|
|
| 1765 | - $newmenu->add(BASE_URI . "?controller=expedition&method=list&leftmenu=sendings&viewstatut=2", Globals::$langs->trans("StatusSendingProcessedShort"), 2, Globals::$user->rights->expedition->lire);
|
|
| 1763 | + $newmenu->add(BASE_URI."?controller=expedition&method=list&leftmenu=sendings&viewstatut=0", Globals::$langs->trans("StatusSendingDraftShort"), 2, Globals::$user->rights->expedition->lire);
|
|
| 1764 | + $newmenu->add(BASE_URI."?controller=expedition&method=list&leftmenu=sendings&viewstatut=1", Globals::$langs->trans("StatusSendingValidatedShort"), 2, Globals::$user->rights->expedition->lire);
|
|
| 1765 | + $newmenu->add(BASE_URI."?controller=expedition&method=list&leftmenu=sendings&viewstatut=2", Globals::$langs->trans("StatusSendingProcessedShort"), 2, Globals::$user->rights->expedition->lire);
|
|
| 1766 | 1766 | } |
| 1767 | 1767 | //$newmenu->add("/expedition/stats/index.php?leftmenu=sendings", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->expedition->lire);
|
| 1768 | - $newmenu->add(BASE_URI . "?controller=expedition/stats&method=index&leftmenu=sendings", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->expedition->lire);
|
|
| 1768 | + $newmenu->add(BASE_URI."?controller=expedition/stats&method=index&leftmenu=sendings", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->expedition->lire);
|
|
| 1769 | 1769 | } |
| 1770 | 1770 | |
| 1771 | 1771 | // Receptions |
@@ -1774,23 +1774,23 @@ discard block |
||
| 1774 | 1774 | //$newmenu->add("/reception/index.php?leftmenu=receptions", Globals::$langs->trans("Receptions"), 0, Globals::$user->rights->reception->lire, '', $mainmenu, 'receptions');
|
| 1775 | 1775 | //$newmenu->add("/reception/card.php?action=create2&leftmenu=receptions", Globals::$langs->trans("NewReception"), 1, Globals::$user->rights->reception->creer);
|
| 1776 | 1776 | //$newmenu->add("/reception/list.php?leftmenu=receptions", Globals::$langs->trans("List"), 1, Globals::$user->rights->reception->lire);
|
| 1777 | - $newmenu->add(BASE_URI . "?controller=reception&method=index&leftmenu=receptions", Globals::$langs->trans("Receptions"), 0, Globals::$user->rights->reception->lire, '', $mainmenu, 'receptions');
|
|
| 1778 | - $newmenu->add(BASE_URI . "?controller=reception&method=card&action=create2&leftmenu=receptions", Globals::$langs->trans("NewReception"), 1, Globals::$user->rights->reception->creer);
|
|
| 1779 | - $newmenu->add(BASE_URI . "?controller=reception&method=list&leftmenu=receptions", Globals::$langs->trans("List"), 1, Globals::$user->rights->reception->lire);
|
|
| 1777 | + $newmenu->add(BASE_URI."?controller=reception&method=index&leftmenu=receptions", Globals::$langs->trans("Receptions"), 0, Globals::$user->rights->reception->lire, '', $mainmenu, 'receptions');
|
|
| 1778 | + $newmenu->add(BASE_URI."?controller=reception&method=card&action=create2&leftmenu=receptions", Globals::$langs->trans("NewReception"), 1, Globals::$user->rights->reception->creer);
|
|
| 1779 | + $newmenu->add(BASE_URI."?controller=reception&method=list&leftmenu=receptions", Globals::$langs->trans("List"), 1, Globals::$user->rights->reception->lire);
|
|
| 1780 | 1780 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") {
|
| 1781 | 1781 | //$newmenu->add("/reception/list.php?leftmenu=receptions&viewstatut=0", Globals::$langs->trans("StatusReceptionDraftShort"), 2, Globals::$user->rights->reception->lire);
|
| 1782 | - $newmenu->add(BASE_URI . "?controller=reception&method=list&leftmenu=receptions&viewstatut=0", Globals::$langs->trans("StatusReceptionDraftShort"), 2, Globals::$user->rights->reception->lire);
|
|
| 1782 | + $newmenu->add(BASE_URI."?controller=reception&method=list&leftmenu=receptions&viewstatut=0", Globals::$langs->trans("StatusReceptionDraftShort"), 2, Globals::$user->rights->reception->lire);
|
|
| 1783 | 1783 | } |
| 1784 | 1784 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") {
|
| 1785 | 1785 | //$newmenu->add("/reception/list.php?leftmenu=receptions&viewstatut=1", Globals::$langs->trans("StatusReceptionValidatedShort"), 2, Globals::$user->rights->reception->lire);
|
| 1786 | - $newmenu->add(BASE_URI . "?controller=reception&method=list&leftmenu=receptions&viewstatut=1", Globals::$langs->trans("StatusReceptionValidatedShort"), 2, Globals::$user->rights->reception->lire);
|
|
| 1786 | + $newmenu->add(BASE_URI."?controller=reception&method=list&leftmenu=receptions&viewstatut=1", Globals::$langs->trans("StatusReceptionValidatedShort"), 2, Globals::$user->rights->reception->lire);
|
|
| 1787 | 1787 | } |
| 1788 | 1788 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") {
|
| 1789 | 1789 | //$newmenu->add("/reception/list.php?leftmenu=receptions&viewstatut=2", Globals::$langs->trans("StatusReceptionProcessedShort"), 2, Globals::$user->rights->reception->lire);
|
| 1790 | - $newmenu->add(BASE_URI . "?controller=reception&method=list&leftmenu=receptions&viewstatut=2", Globals::$langs->trans("StatusReceptionProcessedShort"), 2, Globals::$user->rights->reception->lire);
|
|
| 1790 | + $newmenu->add(BASE_URI."?controller=reception&method=list&leftmenu=receptions&viewstatut=2", Globals::$langs->trans("StatusReceptionProcessedShort"), 2, Globals::$user->rights->reception->lire);
|
|
| 1791 | 1791 | } |
| 1792 | 1792 | //$newmenu->add("/reception/stats/index.php?leftmenu=receptions", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->reception->lire);
|
| 1793 | - $newmenu->add(BASE_URI . "?controller=reception/stats&method=index&leftmenu=receptions", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->reception->lire);
|
|
| 1793 | + $newmenu->add(BASE_URI."?controller=reception/stats&method=index&leftmenu=receptions", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->reception->lire);
|
|
| 1794 | 1794 | } |
| 1795 | 1795 | } |
| 1796 | 1796 | |
@@ -1824,32 +1824,32 @@ discard block |
||
| 1824 | 1824 | // Project assigned to user |
| 1825 | 1825 | //$newmenu->add("/projet/index.php?leftmenu=projects" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $titleboth, 0, Globals::$user->rights->projet->lire, '', $mainmenu, 'projects');
|
| 1826 | 1826 | //$newmenu->add("/projet/card.php?leftmenu=projects&action=create" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $titlenew, 1, Globals::$user->rights->projet->creer);
|
| 1827 | - $newmenu->add(BASE_URI . "?controller=projet&method=index&leftmenu=projects" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $titleboth, 0, Globals::$user->rights->projet->lire, '', $mainmenu, 'projects'); |
|
| 1828 | - $newmenu->add(BASE_URI . "?controller=projet&method=card&leftmenu=projects&action=create" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $titlenew, 1, Globals::$user->rights->projet->creer); |
|
| 1827 | + $newmenu->add(BASE_URI."?controller=projet&method=index&leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, Globals::$user->rights->projet->lire, '', $mainmenu, 'projects'); |
|
| 1828 | + $newmenu->add(BASE_URI."?controller=projet&method=card&leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, Globals::$user->rights->projet->creer); |
|
| 1829 | 1829 | |
| 1830 | 1830 | if (Globals::$conf->global->PROJECT_USE_OPPORTUNITIES == 0) {
|
| 1831 | 1831 | //$newmenu->add("/projet/list.php?leftmenu=projets" . ($search_project_user ? '&search_project_user=' . $search_project_user : '') . '&search_status=99', Globals::$langs->trans("List"), 1, $showmode, '', 'project', 'list');
|
| 1832 | - $newmenu->add(BASE_URI . "?controller=projet&method=list&leftmenu=projets" . ($search_project_user ? '&search_project_user=' . $search_project_user : '') . '&search_status=99', Globals::$langs->trans("List"), 1, $showmode, '', 'project', 'list');
|
|
| 1832 | + $newmenu->add(BASE_URI."?controller=projet&method=list&leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : '').'&search_status=99', Globals::$langs->trans("List"), 1, $showmode, '', 'project', 'list');
|
|
| 1833 | 1833 | } elseif (Globals::$conf->global->PROJECT_USE_OPPORTUNITIES == 1) {
|
| 1834 | 1834 | //$newmenu->add("/projet/list.php?leftmenu=projets" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), Globals::$langs->trans("List"), 1, $showmode, '', 'project', 'list');
|
| 1835 | 1835 | //$newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99&contextpage=lead', Globals::$langs->trans("ListOpenLeads"), 2, $showmode);
|
| 1836 | 1836 | //$newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project', Globals::$langs->trans("ListOpenProjects"), 2, $showmode);
|
| 1837 | - $newmenu->add(BASE_URI . "?controller=projet&method=list&leftmenu=projets" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), Globals::$langs->trans("List"), 1, $showmode, '', 'project', 'list');
|
|
| 1838 | - $newmenu->add(BASE_URI . '?controller=projet&method=list&mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99&contextpage=lead', Globals::$langs->trans("ListOpenLeads"), 2, $showmode);
|
|
| 1839 | - $newmenu->add(BASE_URI . '?controller=projet&method=list&mainmenu=project&leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project', Globals::$langs->trans("ListOpenProjects"), 2, $showmode);
|
|
| 1837 | + $newmenu->add(BASE_URI."?controller=projet&method=list&leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : ''), Globals::$langs->trans("List"), 1, $showmode, '', 'project', 'list');
|
|
| 1838 | + $newmenu->add(BASE_URI.'?controller=projet&method=list&mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99&contextpage=lead', Globals::$langs->trans("ListOpenLeads"), 2, $showmode);
|
|
| 1839 | + $newmenu->add(BASE_URI.'?controller=projet&method=list&mainmenu=project&leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project', Globals::$langs->trans("ListOpenProjects"), 2, $showmode);
|
|
| 1840 | 1840 | } elseif (Globals::$conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
|
| 1841 | 1841 | //$newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99', Globals::$langs->trans("List"), 2, $showmode);
|
| 1842 | - $newmenu->add(BASE_URI . '?controller=projet&method=list&mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99', Globals::$langs->trans("List"), 2, $showmode);
|
|
| 1842 | + $newmenu->add(BASE_URI.'?controller=projet&method=list&mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99', Globals::$langs->trans("List"), 2, $showmode);
|
|
| 1843 | 1843 | } |
| 1844 | 1844 | |
| 1845 | 1845 | //$newmenu->add("/projet/stats/index.php?leftmenu=projects", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->projet->lire);
|
| 1846 | - $newmenu->add(BASE_URI . "?controller=projet/stats&method=index&leftmenu=projects", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->projet->lire);
|
|
| 1846 | + $newmenu->add(BASE_URI."?controller=projet/stats&method=index&leftmenu=projects", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->projet->lire);
|
|
| 1847 | 1847 | |
| 1848 | 1848 | // Categories |
| 1849 | 1849 | if (!empty($conf->categorie->enabled)) {
|
| 1850 | 1850 | Globals::$langs->load("categories");
|
| 1851 | 1851 | //$newmenu->add("/categories/index.php?leftmenu=cat&type=6", Globals::$langs->trans("Categories"), 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
| 1852 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&leftmenu=cat&type=6", Globals::$langs->trans("Categories"), 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
|
| 1852 | + $newmenu->add(BASE_URI."?controller=categories&method=index&leftmenu=cat&type=6", Globals::$langs->trans("Categories"), 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
|
| 1853 | 1853 | } |
| 1854 | 1854 | |
| 1855 | 1855 | if (empty(Globals::$conf->global->PROJECT_HIDE_TASKS)) {
|
@@ -1862,12 +1862,12 @@ discard block |
||
| 1862 | 1862 | |
| 1863 | 1863 | $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), Globals::$langs->trans("NewTimeSpent"), 0, Globals::$user->rights->projet->lire);
|
| 1864 | 1864 | */ |
| 1865 | - $newmenu->add(BASE_URI . "?controller=projet/activity&method=index&leftmenu=tasks" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), Globals::$langs->trans("Activities"), 0, Globals::$user->rights->projet->lire);
|
|
| 1866 | - $newmenu->add(BASE_URI . "?controller=projet&method=tasks&leftmenu=tasks&action=create", Globals::$langs->trans("NewTask"), 1, Globals::$user->rights->projet->creer);
|
|
| 1867 | - $newmenu->add(BASE_URI . "?controller=projet/tasks&method=list&leftmenu=tasks" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), Globals::$langs->trans("List"), 1, Globals::$user->rights->projet->lire);
|
|
| 1868 | - $newmenu->add(BASE_URI . "?controller=projet/tasks/stats&method=index&leftmenu=projects", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->projet->lire);
|
|
| 1865 | + $newmenu->add(BASE_URI."?controller=projet/activity&method=index&leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), Globals::$langs->trans("Activities"), 0, Globals::$user->rights->projet->lire);
|
|
| 1866 | + $newmenu->add(BASE_URI."?controller=projet&method=tasks&leftmenu=tasks&action=create", Globals::$langs->trans("NewTask"), 1, Globals::$user->rights->projet->creer);
|
|
| 1867 | + $newmenu->add(BASE_URI."?controller=projet/tasks&method=list&leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), Globals::$langs->trans("List"), 1, Globals::$user->rights->projet->lire);
|
|
| 1868 | + $newmenu->add(BASE_URI."?controller=projet/tasks/stats&method=index&leftmenu=projects", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->projet->lire);
|
|
| 1869 | 1869 | |
| 1870 | - $newmenu->add(BASE_URI . "?controller=projet/activity&method=perweek&leftmenu=tasks" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), Globals::$langs->trans("NewTimeSpent"), 0, Globals::$user->rights->projet->lire);
|
|
| 1870 | + $newmenu->add(BASE_URI."?controller=projet/activity&method=perweek&leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), Globals::$langs->trans("NewTimeSpent"), 0, Globals::$user->rights->projet->lire);
|
|
| 1871 | 1871 | } |
| 1872 | 1872 | } |
| 1873 | 1873 | } |
@@ -1883,9 +1883,9 @@ discard block |
||
| 1883 | 1883 | //$newmenu->add("/user/list.php?leftmenu=hrm&mode=employee", Globals::$langs->trans("Employees"), 0, Globals::$user->rights->hrm->employee->read, '', $mainmenu, 'hrm');
|
| 1884 | 1884 | //$newmenu->add("/user/card.php?action=create&employee = 1", Globals::$langs->trans("NewEmployee"), 1, Globals::$user->rights->hrm->employee->write);
|
| 1885 | 1885 | //$newmenu->add("/user/list.php?leftmenu=hrm&mode=employee&contextpage = employeelist", Globals::$langs->trans("List"), 1, Globals::$user->rights->hrm->employee->read);
|
| 1886 | - $newmenu->add(BASE_URI . "?controller=user&method=list&leftmenu=hrm&mode=employee", Globals::$langs->trans("Employees"), 0, Globals::$user->rights->hrm->employee->read, '', $mainmenu, 'hrm');
|
|
| 1887 | - $newmenu->add(BASE_URI . "?controller=user&method=card&action=create&employee = 1", Globals::$langs->trans("NewEmployee"), 1, Globals::$user->rights->hrm->employee->write);
|
|
| 1888 | - $newmenu->add(BASE_URI . "?controller=user&method=list&leftmenu=hrm&mode=employee&contextpage = employeelist", Globals::$langs->trans("List"), 1, Globals::$user->rights->hrm->employee->read);
|
|
| 1886 | + $newmenu->add(BASE_URI."?controller=user&method=list&leftmenu=hrm&mode=employee", Globals::$langs->trans("Employees"), 0, Globals::$user->rights->hrm->employee->read, '', $mainmenu, 'hrm');
|
|
| 1887 | + $newmenu->add(BASE_URI."?controller=user&method=card&action=create&employee = 1", Globals::$langs->trans("NewEmployee"), 1, Globals::$user->rights->hrm->employee->write);
|
|
| 1888 | + $newmenu->add(BASE_URI."?controller=user&method=list&leftmenu=hrm&mode=employee&contextpage = employeelist", Globals::$langs->trans("List"), 1, Globals::$user->rights->hrm->employee->read);
|
|
| 1889 | 1889 | } |
| 1890 | 1890 | |
| 1891 | 1891 | // Leave/Holiday/Vacation module |
@@ -1896,9 +1896,9 @@ discard block |
||
| 1896 | 1896 | //$newmenu->add("/holiday/list.php?leftmenu=hrm", Globals::$langs->trans("CPTitreMenu"), 0, Globals::$user->rights->holiday->read, '', $mainmenu, 'hrm');
|
| 1897 | 1897 | //$newmenu->add("/holiday/card.php?action=request", Globals::$langs->trans("New"), 1, Globals::$user->rights->holiday->write);
|
| 1898 | 1898 | //$newmenu->add("/holiday/list.php?leftmenu=hrm", Globals::$langs->trans("List"), 1, Globals::$user->rights->holiday->read);
|
| 1899 | - $newmenu->add(BASE_URI . "?controller=holiday&method=list&leftmenu=hrm", Globals::$langs->trans("CPTitreMenu"), 0, Globals::$user->rights->holiday->read, '', $mainmenu, 'hrm');
|
|
| 1900 | - $newmenu->add(BASE_URI . "?controller=holiday&method=card&action=request", Globals::$langs->trans("New"), 1, Globals::$user->rights->holiday->write);
|
|
| 1901 | - $newmenu->add(BASE_URI . "?controller=holiday&method=list&leftmenu=hrm", Globals::$langs->trans("List"), 1, Globals::$user->rights->holiday->read);
|
|
| 1899 | + $newmenu->add(BASE_URI."?controller=holiday&method=list&leftmenu=hrm", Globals::$langs->trans("CPTitreMenu"), 0, Globals::$user->rights->holiday->read, '', $mainmenu, 'hrm');
|
|
| 1900 | + $newmenu->add(BASE_URI."?controller=holiday&method=card&action=request", Globals::$langs->trans("New"), 1, Globals::$user->rights->holiday->write);
|
|
| 1901 | + $newmenu->add(BASE_URI."?controller=holiday&method=list&leftmenu=hrm", Globals::$langs->trans("List"), 1, Globals::$user->rights->holiday->read);
|
|
| 1902 | 1902 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "hrm") {
|
| 1903 | 1903 | /* |
| 1904 | 1904 | $newmenu->add("/holiday/list.php?search_statut = 1&leftmenu=hrm", Globals::$langs->trans("DraftCP"), 2, Globals::$user->rights->holiday->read);
|
@@ -1907,18 +1907,18 @@ discard block |
||
| 1907 | 1907 | $newmenu->add("/holiday/list.php?search_statut = 4&leftmenu=hrm", Globals::$langs->trans("CancelCP"), 2, Globals::$user->rights->holiday->read);
|
| 1908 | 1908 | $newmenu->add("/holiday/list.php?search_statut = 5&leftmenu=hrm", Globals::$langs->trans("RefuseCP"), 2, Globals::$user->rights->holiday->read);
|
| 1909 | 1909 | */ |
| 1910 | - $newmenu->add(BASE_URI . "?controller=holiday&method=list&search_statut=1&leftmenu=hrm", Globals::$langs->trans("DraftCP"), 2, Globals::$user->rights->holiday->read);
|
|
| 1911 | - $newmenu->add(BASE_URI . "?controller=holiday&method=list&search_statut=2&leftmenu=hrm", Globals::$langs->trans("ToReviewCP"), 2, Globals::$user->rights->holiday->read);
|
|
| 1912 | - $newmenu->add(BASE_URI . "?controller=holiday&method=list&search_statut=3&leftmenu=hrm", Globals::$langs->trans("ApprovedCP"), 2, Globals::$user->rights->holiday->read);
|
|
| 1913 | - $newmenu->add(BASE_URI . "?controller=holiday&method=list&search_statut=4&leftmenu=hrm", Globals::$langs->trans("CancelCP"), 2, Globals::$user->rights->holiday->read);
|
|
| 1914 | - $newmenu->add(BASE_URI . "?controller=holiday&method=list&search_statut=5&leftmenu=hrm", Globals::$langs->trans("RefuseCP"), 2, Globals::$user->rights->holiday->read);
|
|
| 1910 | + $newmenu->add(BASE_URI."?controller=holiday&method=list&search_statut=1&leftmenu=hrm", Globals::$langs->trans("DraftCP"), 2, Globals::$user->rights->holiday->read);
|
|
| 1911 | + $newmenu->add(BASE_URI."?controller=holiday&method=list&search_statut=2&leftmenu=hrm", Globals::$langs->trans("ToReviewCP"), 2, Globals::$user->rights->holiday->read);
|
|
| 1912 | + $newmenu->add(BASE_URI."?controller=holiday&method=list&search_statut=3&leftmenu=hrm", Globals::$langs->trans("ApprovedCP"), 2, Globals::$user->rights->holiday->read);
|
|
| 1913 | + $newmenu->add(BASE_URI."?controller=holiday&method=list&search_statut=4&leftmenu=hrm", Globals::$langs->trans("CancelCP"), 2, Globals::$user->rights->holiday->read);
|
|
| 1914 | + $newmenu->add(BASE_URI."?controller=holiday&method=list&search_statut=5&leftmenu=hrm", Globals::$langs->trans("RefuseCP"), 2, Globals::$user->rights->holiday->read);
|
|
| 1915 | 1915 | } |
| 1916 | 1916 | //$newmenu->add("/holiday/define_holiday.php?action=request", Globals::$langs->trans("MenuConfCP"), 1, Globals::$user->rights->holiday->read);
|
| 1917 | 1917 | //$newmenu->add("/holiday/month_report.php", Globals::$langs->trans("MenuReportMonth"), 1, Globals::$user->rights->holiday->read_all);
|
| 1918 | 1918 | //$newmenu->add("/holiday/view_log.php?action=request", Globals::$langs->trans("MenuLogCP"), 1, Globals::$user->rights->holiday->define_holiday);
|
| 1919 | - $newmenu->add(BASE_URI . "?controller=holiday&method=define_holiday&action=request", Globals::$langs->trans("MenuConfCP"), 1, Globals::$user->rights->holiday->read);
|
|
| 1920 | - $newmenu->add(BASE_URI . "?controller=holiday&method=month_report", Globals::$langs->trans("MenuReportMonth"), 1, Globals::$user->rights->holiday->read_all);
|
|
| 1921 | - $newmenu->add(BASE_URI . "?controller=holiday&method=view_log&action=request", Globals::$langs->trans("MenuLogCP"), 1, Globals::$user->rights->holiday->define_holiday);
|
|
| 1919 | + $newmenu->add(BASE_URI."?controller=holiday&method=define_holiday&action=request", Globals::$langs->trans("MenuConfCP"), 1, Globals::$user->rights->holiday->read);
|
|
| 1920 | + $newmenu->add(BASE_URI."?controller=holiday&method=month_report", Globals::$langs->trans("MenuReportMonth"), 1, Globals::$user->rights->holiday->read_all);
|
|
| 1921 | + $newmenu->add(BASE_URI."?controller=holiday&method=view_log&action=request", Globals::$langs->trans("MenuLogCP"), 1, Globals::$user->rights->holiday->define_holiday);
|
|
| 1922 | 1922 | } |
| 1923 | 1923 | |
| 1924 | 1924 | // Trips and expenses (old module) |
@@ -1930,10 +1930,10 @@ discard block |
||
| 1930 | 1930 | $newmenu->add("/compta/deplacement/list.php?leftmenu=tripsandexpenses&mainmenu=hrm", Globals::$langs->trans("List"), 1, Globals::$user->rights->deplacement->lire);
|
| 1931 | 1931 | $newmenu->add("/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->deplacement->lire);
|
| 1932 | 1932 | */ |
| 1933 | - $newmenu->add(BASE_URI . "?controller=compta/deplacement&method=index&leftmenu=tripsandexpenses&mainmenu=hrm", Globals::$langs->trans("TripsAndExpenses"), 0, Globals::$user->rights->deplacement->lire, '', $mainmenu, 'tripsandexpenses');
|
|
| 1934 | - $newmenu->add(BASE_URI . "?controller=compta/deplacement&method=card&action=create&leftmenu=tripsandexpenses&mainmenu=hrm", Globals::$langs->trans("New"), 1, Globals::$user->rights->deplacement->creer);
|
|
| 1935 | - $newmenu->add(BASE_URI . "?controller=compta/deplacement&method=list&leftmenu=tripsandexpenses&mainmenu=hrm", Globals::$langs->trans("List"), 1, Globals::$user->rights->deplacement->lire);
|
|
| 1936 | - $newmenu->add(BASE_URI . "?controller=compta/deplacement/stats&method=index&leftmenu=tripsandexpenses&mainmenu=hrm", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->deplacement->lire);
|
|
| 1933 | + $newmenu->add(BASE_URI."?controller=compta/deplacement&method=index&leftmenu=tripsandexpenses&mainmenu=hrm", Globals::$langs->trans("TripsAndExpenses"), 0, Globals::$user->rights->deplacement->lire, '', $mainmenu, 'tripsandexpenses');
|
|
| 1934 | + $newmenu->add(BASE_URI."?controller=compta/deplacement&method=card&action=create&leftmenu=tripsandexpenses&mainmenu=hrm", Globals::$langs->trans("New"), 1, Globals::$user->rights->deplacement->creer);
|
|
| 1935 | + $newmenu->add(BASE_URI."?controller=compta/deplacement&method=list&leftmenu=tripsandexpenses&mainmenu=hrm", Globals::$langs->trans("List"), 1, Globals::$user->rights->deplacement->lire);
|
|
| 1936 | + $newmenu->add(BASE_URI."?controller=compta/deplacement/stats&method=index&leftmenu=tripsandexpenses&mainmenu=hrm", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->deplacement->lire);
|
|
| 1937 | 1937 | } |
| 1938 | 1938 | |
| 1939 | 1939 | // Expense report |
@@ -1953,18 +1953,18 @@ discard block |
||
| 1953 | 1953 | } |
| 1954 | 1954 | $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->expensereport->lire);
|
| 1955 | 1955 | */ |
| 1956 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=index&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("TripsAndExpenses"), 0, Globals::$user->rights->expensereport->lire, '', $mainmenu, 'expensereport');
|
|
| 1957 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=card&action=create&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("New"), 1, Globals::$user->rights->expensereport->creer);
|
|
| 1958 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=list&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("List"), 1, Globals::$user->rights->expensereport->lire);
|
|
| 1956 | + $newmenu->add(BASE_URI."?controller=expensereport&method=index&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("TripsAndExpenses"), 0, Globals::$user->rights->expensereport->lire, '', $mainmenu, 'expensereport');
|
|
| 1957 | + $newmenu->add(BASE_URI."?controller=expensereport&method=card&action=create&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("New"), 1, Globals::$user->rights->expensereport->creer);
|
|
| 1958 | + $newmenu->add(BASE_URI."?controller=expensereport&method=list&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("List"), 1, Globals::$user->rights->expensereport->lire);
|
|
| 1959 | 1959 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "expensereport") {
|
| 1960 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=list&search_status=0&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("Draft"), 2, Globals::$user->rights->expensereport->lire);
|
|
| 1961 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=list&search_status=2&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("Validated"), 2, Globals::$user->rights->expensereport->lire);
|
|
| 1962 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=list&search_status=5&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("Approved"), 2, Globals::$user->rights->expensereport->lire);
|
|
| 1963 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=list&search_status=6&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("Paid"), 2, Globals::$user->rights->expensereport->lire);
|
|
| 1964 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=list&search_status=4&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("Canceled"), 2, Globals::$user->rights->expensereport->lire);
|
|
| 1965 | - $newmenu->add(BASE_URI . "?controller=expensereport&method=list&search_status=99&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("Refused"), 2, Globals::$user->rights->expensereport->lire);
|
|
| 1966 | - } |
|
| 1967 | - $newmenu->add(BASE_URI . "?controller=expensereport/stats&method=index&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->expensereport->lire);
|
|
| 1960 | + $newmenu->add(BASE_URI."?controller=expensereport&method=list&search_status=0&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("Draft"), 2, Globals::$user->rights->expensereport->lire);
|
|
| 1961 | + $newmenu->add(BASE_URI."?controller=expensereport&method=list&search_status=2&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("Validated"), 2, Globals::$user->rights->expensereport->lire);
|
|
| 1962 | + $newmenu->add(BASE_URI."?controller=expensereport&method=list&search_status=5&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("Approved"), 2, Globals::$user->rights->expensereport->lire);
|
|
| 1963 | + $newmenu->add(BASE_URI."?controller=expensereport&method=list&search_status=6&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("Paid"), 2, Globals::$user->rights->expensereport->lire);
|
|
| 1964 | + $newmenu->add(BASE_URI."?controller=expensereport&method=list&search_status=4&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("Canceled"), 2, Globals::$user->rights->expensereport->lire);
|
|
| 1965 | + $newmenu->add(BASE_URI."?controller=expensereport&method=list&search_status=99&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("Refused"), 2, Globals::$user->rights->expensereport->lire);
|
|
| 1966 | + } |
|
| 1967 | + $newmenu->add(BASE_URI."?controller=expensereport/stats&method=index&leftmenu=expensereport&mainmenu=hrm", Globals::$langs->trans("Statistics"), 1, Globals::$user->rights->expensereport->lire);
|
|
| 1968 | 1968 | } |
| 1969 | 1969 | |
| 1970 | 1970 | if (!empty($conf->projet->enabled)) {
|
@@ -1974,7 +1974,7 @@ discard block |
||
| 1974 | 1974 | $search_project_user = DolUtils::GETPOST('search_project_user', 'int');
|
| 1975 | 1975 | |
| 1976 | 1976 | //$newmenu->add("/projet/activity/perweek.php?leftmenu=tasks" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), Globals::$langs->trans("NewTimeSpent"), 0, Globals::$user->rights->projet->lire);
|
| 1977 | - $newmenu->add(BASE_URI . "?controller=projet/activity&method=perweek&leftmenu=tasks" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), Globals::$langs->trans("NewTimeSpent"), 0, Globals::$user->rights->projet->lire);
|
|
| 1977 | + $newmenu->add(BASE_URI."?controller=projet/activity&method=perweek&leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), Globals::$langs->trans("NewTimeSpent"), 0, Globals::$user->rights->projet->lire);
|
|
| 1978 | 1978 | } |
| 1979 | 1979 | } |
| 1980 | 1980 | } |
@@ -1987,24 +1987,24 @@ discard block |
||
| 1987 | 1987 | if (empty(Globals::$user->socid)) { // limit to internal users
|
| 1988 | 1988 | Globals::$langs->load("mails");
|
| 1989 | 1989 | //$newmenu->add("/admin/mails_templates.php?leftmenu=email_templates", Globals::$langs->trans("EMailTemplates"), 0, 1, '', $mainmenu, 'email_templates');
|
| 1990 | - $newmenu->add(BASE_URI . "?controller=admin&method=mails_templates&leftmenu=email_templates", Globals::$langs->trans("EMailTemplates"), 0, 1, '', $mainmenu, 'email_templates');
|
|
| 1990 | + $newmenu->add(BASE_URI."?controller=admin&method=mails_templates&leftmenu=email_templates", Globals::$langs->trans("EMailTemplates"), 0, 1, '', $mainmenu, 'email_templates');
|
|
| 1991 | 1991 | } |
| 1992 | 1992 | |
| 1993 | 1993 | if (!empty($conf->mailing->enabled)) {
|
| 1994 | 1994 | //$newmenu->add("/comm/mailing/index.php?leftmenu=mailing", Globals::$langs->trans("EMailings"), 0, Globals::$user->rights->mailing->lire, '', $mainmenu, 'mailing');
|
| 1995 | 1995 | //$newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", Globals::$langs->trans("NewMailing"), 1, Globals::$user->rights->mailing->creer);
|
| 1996 | 1996 | //$newmenu->add("/comm/mailing/list.php?leftmenu=mailing", Globals::$langs->trans("List"), 1, Globals::$user->rights->mailing->lire);
|
| 1997 | - $newmenu->add(BASE_URI . "?controller=comm/mailing&method=index&leftmenu=mailing", Globals::$langs->trans("EMailings"), 0, Globals::$user->rights->mailing->lire, '', $mainmenu, 'mailing');
|
|
| 1998 | - $newmenu->add(BASE_URI . "?controller=comm/mailing&method=card&leftmenu=mailing&action=create", Globals::$langs->trans("NewMailing"), 1, Globals::$user->rights->mailing->creer);
|
|
| 1999 | - $newmenu->add(BASE_URI . "?controller=comm/mailing&method=list&leftmenu=mailing", Globals::$langs->trans("List"), 1, Globals::$user->rights->mailing->lire);
|
|
| 1997 | + $newmenu->add(BASE_URI."?controller=comm/mailing&method=index&leftmenu=mailing", Globals::$langs->trans("EMailings"), 0, Globals::$user->rights->mailing->lire, '', $mainmenu, 'mailing');
|
|
| 1998 | + $newmenu->add(BASE_URI."?controller=comm/mailing&method=card&leftmenu=mailing&action=create", Globals::$langs->trans("NewMailing"), 1, Globals::$user->rights->mailing->creer);
|
|
| 1999 | + $newmenu->add(BASE_URI."?controller=comm/mailing&method=list&leftmenu=mailing", Globals::$langs->trans("List"), 1, Globals::$user->rights->mailing->lire);
|
|
| 2000 | 2000 | } |
| 2001 | 2001 | |
| 2002 | 2002 | if (!empty($conf->export->enabled)) {
|
| 2003 | 2003 | Globals::$langs->load("exports");
|
| 2004 | 2004 | //$newmenu->add("/exports/index.php?leftmenu=export", Globals::$langs->trans("FormatedExport"), 0, Globals::$user->rights->export->lire, '', $mainmenu, 'export');
|
| 2005 | 2005 | //$newmenu->add("/exports/export.php?leftmenu=export", Globals::$langs->trans("NewExport"), 1, Globals::$user->rights->export->creer);
|
| 2006 | - $newmenu->add(BASE_URI . "?controller=exports&methodindex&leftmenu=export", Globals::$langs->trans("FormatedExport"), 0, Globals::$user->rights->export->lire, '', $mainmenu, 'export');
|
|
| 2007 | - $newmenu->add(BASE_URI . "?controller=exports&method=export&leftmenu=export", Globals::$langs->trans("NewExport"), 1, Globals::$user->rights->export->creer);
|
|
| 2006 | + $newmenu->add(BASE_URI."?controller=exports&methodindex&leftmenu=export", Globals::$langs->trans("FormatedExport"), 0, Globals::$user->rights->export->lire, '', $mainmenu, 'export');
|
|
| 2007 | + $newmenu->add(BASE_URI."?controller=exports&method=export&leftmenu=export", Globals::$langs->trans("NewExport"), 1, Globals::$user->rights->export->creer);
|
|
| 2008 | 2008 | //$newmenu->add("/exports/export.php?leftmenu=export",Globals::$langs->trans("List"),1, Globals::$user->rights->export->lire);
|
| 2009 | 2009 | } |
| 2010 | 2010 | |
@@ -2012,8 +2012,8 @@ discard block |
||
| 2012 | 2012 | Globals::$langs->load("exports");
|
| 2013 | 2013 | //$newmenu->add("/imports/index.php?leftmenu=import", Globals::$langs->trans("FormatedImport"), 0, Globals::$user->rights->import->run, '', $mainmenu, 'import');
|
| 2014 | 2014 | //$newmenu->add("/imports/import.php?leftmenu=import", Globals::$langs->trans("NewImport"), 1, Globals::$user->rights->import->run);
|
| 2015 | - $newmenu->add(BASE_URI . "?controller=imports&method=index&leftmenu=import", Globals::$langs->trans("FormatedImport"), 0, Globals::$user->rights->import->run, '', $mainmenu, 'import');
|
|
| 2016 | - $newmenu->add(BASE_URI . "?controller=imports&method=import&leftmenu=import", Globals::$langs->trans("NewImport"), 1, Globals::$user->rights->import->run);
|
|
| 2015 | + $newmenu->add(BASE_URI."?controller=imports&method=index&leftmenu=import", Globals::$langs->trans("FormatedImport"), 0, Globals::$user->rights->import->run, '', $mainmenu, 'import');
|
|
| 2016 | + $newmenu->add(BASE_URI."?controller=imports&method=import&leftmenu=import", Globals::$langs->trans("NewImport"), 1, Globals::$user->rights->import->run);
|
|
| 2017 | 2017 | } |
| 2018 | 2018 | } |
| 2019 | 2019 | |
@@ -2056,30 +2056,30 @@ discard block |
||
| 2056 | 2056 | $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members&action=create", Globals::$langs->trans("New"), 1, Globals::$user->rights->adherent->configurer);
|
| 2057 | 2057 | $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members", Globals::$langs->trans("List"), 1, Globals::$user->rights->adherent->configurer);
|
| 2058 | 2058 | */ |
| 2059 | - $newmenu->add(BASE_URI . "?controller=adherents&method=index&leftmenu=members&mainmenu=members", Globals::$langs->trans("Members"), 0, Globals::$user->rights->adherent->lire, '', $mainmenu, 'members');
|
|
| 2060 | - $newmenu->add(BASE_URI . "?controller=adherents&method=card&leftmenu=members&action=create", Globals::$langs->trans("NewMember"), 1, Globals::$user->rights->adherent->creer);
|
|
| 2061 | - $newmenu->add(BASE_URI . "?controller=adherents&method=list&leftmenu=members", Globals::$langs->trans("List"), 1, Globals::$user->rights->adherent->lire);
|
|
| 2062 | - $newmenu->add(BASE_URI . "?controller=adherents&method=list&leftmenu=members&statut=-1", Globals::$langs->trans("MenuMembersToValidate"), 2, Globals::$user->rights->adherent->lire);
|
|
| 2063 | - $newmenu->add(BASE_URI . "?controller=adherents&method=list&leftmenu=members&statut=1", Globals::$langs->trans("MenuMembersValidated"), 2, Globals::$user->rights->adherent->lire);
|
|
| 2064 | - $newmenu->add(BASE_URI . "?controller=adherents&method=list&leftmenu=members&statut=1&filter = uptodate", Globals::$langs->trans("MenuMembersUpToDate"), 2, Globals::$user->rights->adherent->lire);
|
|
| 2065 | - $newmenu->add(BASE_URI . "?controller=adherents&method=list&leftmenu=members&statut=1&filter = outofdate", Globals::$langs->trans("MenuMembersNotUpToDate"), 2, Globals::$user->rights->adherent->lire);
|
|
| 2066 | - $newmenu->add(BASE_URI . "?controller=adherents&method=list&leftmenu=members&statut=0", Globals::$langs->trans("MenuMembersResiliated"), 2, Globals::$user->rights->adherent->lire);
|
|
| 2067 | - $newmenu->add(BASE_URI . "?controller=adherents/stats&method=index&leftmenu=members", Globals::$langs->trans("MenuMembersStats"), 1, Globals::$user->rights->adherent->lire);
|
|
| 2068 | - $newmenu->add(BASE_URI . "?controller=adherents/cartes&method=carte&leftmenu=export", Globals::$langs->trans("MembersCards"), 1, Globals::$user->rights->adherent->export);
|
|
| 2059 | + $newmenu->add(BASE_URI."?controller=adherents&method=index&leftmenu=members&mainmenu=members", Globals::$langs->trans("Members"), 0, Globals::$user->rights->adherent->lire, '', $mainmenu, 'members');
|
|
| 2060 | + $newmenu->add(BASE_URI."?controller=adherents&method=card&leftmenu=members&action=create", Globals::$langs->trans("NewMember"), 1, Globals::$user->rights->adherent->creer);
|
|
| 2061 | + $newmenu->add(BASE_URI."?controller=adherents&method=list&leftmenu=members", Globals::$langs->trans("List"), 1, Globals::$user->rights->adherent->lire);
|
|
| 2062 | + $newmenu->add(BASE_URI."?controller=adherents&method=list&leftmenu=members&statut=-1", Globals::$langs->trans("MenuMembersToValidate"), 2, Globals::$user->rights->adherent->lire);
|
|
| 2063 | + $newmenu->add(BASE_URI."?controller=adherents&method=list&leftmenu=members&statut=1", Globals::$langs->trans("MenuMembersValidated"), 2, Globals::$user->rights->adherent->lire);
|
|
| 2064 | + $newmenu->add(BASE_URI."?controller=adherents&method=list&leftmenu=members&statut=1&filter = uptodate", Globals::$langs->trans("MenuMembersUpToDate"), 2, Globals::$user->rights->adherent->lire);
|
|
| 2065 | + $newmenu->add(BASE_URI."?controller=adherents&method=list&leftmenu=members&statut=1&filter = outofdate", Globals::$langs->trans("MenuMembersNotUpToDate"), 2, Globals::$user->rights->adherent->lire);
|
|
| 2066 | + $newmenu->add(BASE_URI."?controller=adherents&method=list&leftmenu=members&statut=0", Globals::$langs->trans("MenuMembersResiliated"), 2, Globals::$user->rights->adherent->lire);
|
|
| 2067 | + $newmenu->add(BASE_URI."?controller=adherents/stats&method=index&leftmenu=members", Globals::$langs->trans("MenuMembersStats"), 1, Globals::$user->rights->adherent->lire);
|
|
| 2068 | + $newmenu->add(BASE_URI."?controller=adherents/cartes&method=carte&leftmenu=export", Globals::$langs->trans("MembersCards"), 1, Globals::$user->rights->adherent->export);
|
|
| 2069 | 2069 | if (!empty(Globals::$conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && ($usemenuhider || empty($leftmenu) || $leftmenu == 'none' || $leftmenu == "members" || $leftmenu == "export")) {
|
| 2070 | - $newmenu->add(BASE_URI . "?controller=adherents&method=htpasswd&leftmenu=export", Globals::$langs->trans("Filehtpasswd"), 1, Globals::$user->rights->adherent->export);
|
|
| 2070 | + $newmenu->add(BASE_URI."?controller=adherents&method=htpasswd&leftmenu=export", Globals::$langs->trans("Filehtpasswd"), 1, Globals::$user->rights->adherent->export);
|
|
| 2071 | 2071 | } |
| 2072 | 2072 | if (!empty($conf->categorie->enabled)) {
|
| 2073 | 2073 | Globals::$langs->load("categories");
|
| 2074 | - $newmenu->add(BASE_URI . "?controller=categories&method=index&leftmenu=cat&type=3", Globals::$langs->trans("Categories"), 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
|
| 2075 | - } |
|
| 2076 | - $newmenu->add(BASE_URI . "?controller=adherents&method=index&leftmenu=members&mainmenu=members", Globals::$langs->trans("Subscriptions"), 0, Globals::$user->rights->adherent->cotisation->lire);
|
|
| 2077 | - $newmenu->add(BASE_URI . "?controller=adherents&methodlist&leftmenu=members&statut=-1,1&mainmenu=members", Globals::$langs->trans("NewSubscription"), 1, Globals::$user->rights->adherent->cotisation->creer);
|
|
| 2078 | - $newmenu->add(BASE_URI . "?controller=adherents/subscription&method=list&leftmenu=members", Globals::$langs->trans("List"), 1, Globals::$user->rights->adherent->cotisation->lire);
|
|
| 2079 | - $newmenu->add(BASE_URI . "?controller=adherents/stats&method=index&leftmenu=members", Globals::$langs->trans("MenuMembersStats"), 1, Globals::$user->rights->adherent->lire);
|
|
| 2080 | - $newmenu->add(BASE_URI . "?controller=adherents&method=type&leftmenu=setup&mainmenu=members", Globals::$langs->trans("MembersTypes"), 0, Globals::$user->rights->adherent->configurer, '', $mainmenu, 'setup');
|
|
| 2081 | - $newmenu->add(BASE_URI . "?controller=adherents&method=type&leftmenu=setup&mainmenu=members&action=create", Globals::$langs->trans("New"), 1, Globals::$user->rights->adherent->configurer);
|
|
| 2082 | - $newmenu->add(BASE_URI . "?controller=adherents&method=type&leftmenu=setup&mainmenu=members", Globals::$langs->trans("List"), 1, Globals::$user->rights->adherent->configurer);
|
|
| 2074 | + $newmenu->add(BASE_URI."?controller=categories&method=index&leftmenu=cat&type=3", Globals::$langs->trans("Categories"), 1, Globals::$user->rights->categorie->lire, '', $mainmenu, 'cat');
|
|
| 2075 | + } |
|
| 2076 | + $newmenu->add(BASE_URI."?controller=adherents&method=index&leftmenu=members&mainmenu=members", Globals::$langs->trans("Subscriptions"), 0, Globals::$user->rights->adherent->cotisation->lire);
|
|
| 2077 | + $newmenu->add(BASE_URI."?controller=adherents&methodlist&leftmenu=members&statut=-1,1&mainmenu=members", Globals::$langs->trans("NewSubscription"), 1, Globals::$user->rights->adherent->cotisation->creer);
|
|
| 2078 | + $newmenu->add(BASE_URI."?controller=adherents/subscription&method=list&leftmenu=members", Globals::$langs->trans("List"), 1, Globals::$user->rights->adherent->cotisation->lire);
|
|
| 2079 | + $newmenu->add(BASE_URI."?controller=adherents/stats&method=index&leftmenu=members", Globals::$langs->trans("MenuMembersStats"), 1, Globals::$user->rights->adherent->lire);
|
|
| 2080 | + $newmenu->add(BASE_URI."?controller=adherents&method=type&leftmenu=setup&mainmenu=members", Globals::$langs->trans("MembersTypes"), 0, Globals::$user->rights->adherent->configurer, '', $mainmenu, 'setup');
|
|
| 2081 | + $newmenu->add(BASE_URI."?controller=adherents&method=type&leftmenu=setup&mainmenu=members&action=create", Globals::$langs->trans("New"), 1, Globals::$user->rights->adherent->configurer);
|
|
| 2082 | + $newmenu->add(BASE_URI."?controller=adherents&method=type&leftmenu=setup&mainmenu=members", Globals::$langs->trans("List"), 1, Globals::$user->rights->adherent->configurer);
|
|
| 2083 | 2083 | } |
| 2084 | 2084 | } |
| 2085 | 2085 | |
@@ -2090,11 +2090,11 @@ discard block |
||
| 2090 | 2090 | //var_dump($newmenu->liste); // |
| 2091 | 2091 | // We update newmenu for special dynamic menus |
| 2092 | 2092 | if (!empty(Globals::$user->rights->banque->lire) && $mainmenu == 'bank') { // Entry for each bank account
|
| 2093 | - require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
| 2093 | + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
| 2094 | 2094 | |
| 2095 | 2095 | $sql = "SELECT rowid, label, courant, rappro"; |
| 2096 | - $sql .= " FROM " . MAIN_DB_PREFIX . "bank_account"; |
|
| 2097 | - $sql .= " WHERE entity = " . $conf->entity; |
|
| 2096 | + $sql .= " FROM ".MAIN_DB_PREFIX."bank_account"; |
|
| 2097 | + $sql .= " WHERE entity = ".$conf->entity; |
|
| 2098 | 2098 | $sql .= " AND clos = 0"; |
| 2099 | 2099 | $sql .= " ORDER BY label"; |
| 2100 | 2100 | |
@@ -2105,16 +2105,16 @@ discard block |
||
| 2105 | 2105 | |
| 2106 | 2106 | if ($numr > 0) {
|
| 2107 | 2107 | //$newmenu->add('/compta/bank/list.php', Globals::$langs->trans("BankAccounts"), 0, Globals::$user->rights->banque->lire);
|
| 2108 | - $newmenu->add(BASE_URI . '?controller=compta/bank?method=list', Globals::$langs->trans("BankAccounts"), 0, Globals::$user->rights->banque->lire);
|
|
| 2108 | + $newmenu->add(BASE_URI.'?controller=compta/bank?method=list', Globals::$langs->trans("BankAccounts"), 0, Globals::$user->rights->banque->lire);
|
|
| 2109 | 2109 | } |
| 2110 | 2110 | |
| 2111 | 2111 | while ($i < $numr) {
|
| 2112 | 2112 | $objp = Config::$dbEngine->fetch_object($resql); |
| 2113 | 2113 | //$newmenu->add('/compta/bank/card.php?id=' . $objp->rowid, $objp->label, 1, Globals::$user->rights->banque->lire);
|
| 2114 | - $newmenu->add(BASE_URI . '?controller=compta/bank&method=card&id=' . $objp->rowid, $objp->label, 1, Globals::$user->rights->banque->lire); |
|
| 2114 | + $newmenu->add(BASE_URI.'?controller=compta/bank&method=card&id='.$objp->rowid, $objp->label, 1, Globals::$user->rights->banque->lire); |
|
| 2115 | 2115 | if ($objp->rappro && $objp->courant != Account::TYPE_CASH && empty($objp->clos)) { // If not cash account and not closed and can be reconciliate
|
| 2116 | 2116 | //$newmenu->add('/compta/bank/bankentries_list.php?action=reconcile&contextpage=banktransactionlist-' . $objp->rowid . '&account=' . $objp->rowid . '&id=' . $objp->rowid . '&search_conciliated=0', Globals::$langs->trans("Conciliate"), 2, Globals::$user->rights->banque->consolidate);
|
| 2117 | - $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', Globals::$langs->trans("Conciliate"), 2, Globals::$user->rights->banque->consolidate);
|
|
| 2117 | + $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', Globals::$langs->trans("Conciliate"), 2, Globals::$user->rights->banque->consolidate);
|
|
| 2118 | 2118 | } |
| 2119 | 2119 | $i++; |
| 2120 | 2120 | } |
@@ -2128,11 +2128,11 @@ discard block |
||
| 2128 | 2128 | $MAXFTP = 20; |
| 2129 | 2129 | $i = 1; |
| 2130 | 2130 | while ($i <= $MAXFTP) {
|
| 2131 | - $paramkey = 'FTP_NAME_' . $i; |
|
| 2131 | + $paramkey = 'FTP_NAME_'.$i; |
|
| 2132 | 2132 | //print $paramkey; |
| 2133 | 2133 | if (!empty(Globals::$conf->global->$paramkey)) {
|
| 2134 | 2134 | //$link = "/ftp/index.php?idmenu = " . $_SESSION["idmenu"] . "&numero_ftp = " . $i; |
| 2135 | - $link = BASE_URI . "?controller=ftp&method=index&idmenu=" . $_SESSION["idmenu"] . "&numero_ftp=" . $i; |
|
| 2135 | + $link = BASE_URI."?controller=ftp&method=index&idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i; |
|
| 2136 | 2136 | |
| 2137 | 2137 | $newmenu->add($link, dol_trunc(Globals::$conf->global->$paramkey, 24)); |
| 2138 | 2138 | } |
@@ -2193,9 +2193,9 @@ discard block |
||
| 2193 | 2193 | } |
| 2194 | 2194 | } |
| 2195 | 2195 | if ($altok % 2 == 0) {
|
| 2196 | - print '<div class="blockvmenu blockvmenuimpair' . $invert . ($lastopened ? ' blockvmenulast' : '') . ($altok == 1 ? ' blockvmenufirst' : '') . '">' . "\n"; |
|
| 2196 | + print '<div class="blockvmenu blockvmenuimpair'.$invert.($lastopened ? ' blockvmenulast' : '').($altok == 1 ? ' blockvmenufirst' : '').'">'."\n"; |
|
| 2197 | 2197 | } else {
|
| 2198 | - print '<div class="blockvmenu blockvmenupair' . $invert . ($lastopened ? ' blockvmenulast' : '') . ($altok == 1 ? ' blockvmenufirst' : '') . '">' . "\n"; |
|
| 2198 | + print '<div class="blockvmenu blockvmenupair'.$invert.($lastopened ? ' blockvmenulast' : '').($altok == 1 ? ' blockvmenufirst' : '').'">'."\n"; |
|
| 2199 | 2199 | } |
| 2200 | 2200 | } |
| 2201 | 2201 | |
@@ -2217,48 +2217,48 @@ discard block |
||
| 2217 | 2217 | if (!preg_match("/^(http:\/\/|https:\/\/)/i", $menu_array[$i]['url'])) {
|
| 2218 | 2218 | $tmp = explode('?', $menu_array[$i]['url'], 2);
|
| 2219 | 2219 | $url = $shorturl = $tmp[0]; |
| 2220 | - $param = (isset($tmp[1]) ? $tmp[1] : ''); // params in url of the menu link |
|
| 2220 | + $param = (isset($tmp[1]) ? $tmp[1] : ''); // params in url of the menu link |
|
| 2221 | 2221 | // Complete param to force leftmenu to '' to close open menu when we click on a link with no leftmenu defined. |
| 2222 | 2222 | if ((!preg_match('/mainmenu/i', $param)) && (!preg_match('/leftmenu/i', $param)) && !empty($menu_array[$i]['mainmenu'])) {
|
| 2223 | - $param .= ($param ? '&' : '') . 'mainmenu=' . $menu_array[$i]['mainmenu'] . '&leftmenu='; |
|
| 2223 | + $param .= ($param ? '&' : '').'mainmenu='.$menu_array[$i]['mainmenu'].'&leftmenu='; |
|
| 2224 | 2224 | } |
| 2225 | 2225 | if ((!preg_match('/mainmenu/i', $param)) && (!preg_match('/leftmenu/i', $param)) && empty($menu_array[$i]['mainmenu'])) {
|
| 2226 | - $param .= ($param ? '&' : '') . 'leftmenu='; |
|
| 2226 | + $param .= ($param ? '&' : '').'leftmenu='; |
|
| 2227 | 2227 | } |
| 2228 | 2228 | //$url.="idmenu = ".$menu_array[$i]['rowid']; // Already done by menuLoad |
| 2229 | - $url = DolUtils::dol_buildpath($url, 1) . ($param ? '?' . $param : ''); |
|
| 2229 | + $url = DolUtils::dol_buildpath($url, 1).($param ? '?'.$param : ''); |
|
| 2230 | 2230 | $shorturlwithoutparam = $shorturl; |
| 2231 | - $shorturl = $shorturl . ($param ? '?' . $param : ''); |
|
| 2231 | + $shorturl = $shorturl.($param ? '?'.$param : ''); |
|
| 2232 | 2232 | } |
| 2233 | 2233 | |
| 2234 | 2234 | |
| 2235 | - 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"; |
|
| 2235 | + 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"; |
|
| 2236 | 2236 | |
| 2237 | 2237 | // Menu level 0 |
| 2238 | 2238 | if ($menu_array[$i]['level'] == 0) {
|
| 2239 | 2239 | if ($menu_array[$i]['enabled']) { // Enabled so visible
|
| 2240 | - print '<div class="menu_titre">' . $tabstring; |
|
| 2240 | + print '<div class="menu_titre">'.$tabstring; |
|
| 2241 | 2241 | if ($shorturlwithoutparam) {
|
| 2242 | - print '<a class="vmenu" href="' . $url . '"' . ($menu_array[$i]['target'] ? ' target="' . $menu_array[$i]['target'] . '"' : '') . '>'; |
|
| 2242 | + print '<a class="vmenu" href="'.$url.'"'.($menu_array[$i]['target'] ? ' target="'.$menu_array[$i]['target'].'"' : '').'>'; |
|
| 2243 | 2243 | } else {
|
| 2244 | 2244 | print '<span class="vmenu">'; |
| 2245 | 2245 | } |
| 2246 | - print ($menu_array[$i]['prefix'] ? $menu_array[$i]['prefix'] : '') . $menu_array[$i]['titre']; |
|
| 2246 | + print ($menu_array[$i]['prefix'] ? $menu_array[$i]['prefix'] : '').$menu_array[$i]['titre']; |
|
| 2247 | 2247 | if ($shorturlwithoutparam) {
|
| 2248 | 2248 | print '</a>'; |
| 2249 | 2249 | } else {
|
| 2250 | 2250 | print '</span>'; |
| 2251 | 2251 | } |
| 2252 | - print '</div>' . "\n"; |
|
| 2252 | + print '</div>'."\n"; |
|
| 2253 | 2253 | $lastlevel0 = 'enabled'; |
| 2254 | 2254 | } else if ($showmenu) { // Not enabled but visible (so greyed)
|
| 2255 | - print '<div class="menu_titre">' . $tabstring . '<font class="vmenudisabled">' . $menu_array[$i]['titre'] . '</font></div>' . "\n"; |
|
| 2255 | + print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$menu_array[$i]['titre'].'</font></div>'."\n"; |
|
| 2256 | 2256 | $lastlevel0 = 'greyed'; |
| 2257 | 2257 | } else {
|
| 2258 | 2258 | $lastlevel0 = 'hidden'; |
| 2259 | 2259 | } |
| 2260 | 2260 | if ($showmenu) {
|
| 2261 | - print '<div class="menu_top"></div>' . "\n"; |
|
| 2261 | + print '<div class="menu_top"></div>'."\n"; |
|
| 2262 | 2262 | } |
| 2263 | 2263 | } |
| 2264 | 2264 | |
@@ -2266,13 +2266,13 @@ discard block |
||
| 2266 | 2266 | if ($menu_array[$i]['level'] > 0) {
|
| 2267 | 2267 | $cssmenu = ''; |
| 2268 | 2268 | if ($menu_array[$i]['url']) {
|
| 2269 | - $cssmenu = ' menu_contenu' . dol_string_nospecial(preg_replace('/\.php.*$/', '', $menu_array[$i]['url']));
|
|
| 2269 | + $cssmenu = ' menu_contenu'.dol_string_nospecial(preg_replace('/\.php.*$/', '', $menu_array[$i]['url']));
|
|
| 2270 | 2270 | } |
| 2271 | 2271 | |
| 2272 | 2272 | if ($menu_array[$i]['enabled'] && $lastlevel0 == 'enabled') { // Enabled so visible, except if parent was not enabled.
|
| 2273 | - print '<div class="menu_contenu' . $cssmenu . '">' . $tabstring; |
|
| 2273 | + print '<div class="menu_contenu'.$cssmenu.'">'.$tabstring; |
|
| 2274 | 2274 | if ($shorturlwithoutparam) {
|
| 2275 | - print '<a class="vsmenu" href="' . $url . '"' . ($menu_array[$i]['target'] ? ' target="' . $menu_array[$i]['target'] . '"' : '') . '>'; |
|
| 2275 | + print '<a class="vsmenu" href="'.$url.'"'.($menu_array[$i]['target'] ? ' target="'.$menu_array[$i]['target'].'"' : '').'>'; |
|
| 2276 | 2276 | } else {
|
| 2277 | 2277 | print '<span class="vsmenu">'; |
| 2278 | 2278 | } |
@@ -2286,26 +2286,26 @@ discard block |
||
| 2286 | 2286 | if (!strstr($menu_array[$i]['titre'], '<table')) {
|
| 2287 | 2287 | print '<br>'; |
| 2288 | 2288 | } |
| 2289 | - print '</div>' . "\n"; |
|
| 2289 | + print '</div>'."\n"; |
|
| 2290 | 2290 | } else if ($showmenu && $lastlevel0 == 'enabled') { // Not enabled but visible (so greyed), except if parent was not enabled.
|
| 2291 | - print '<div class="menu_contenu' . $cssmenu . '">' . $tabstring . '<font class="vsmenudisabled vsmenudisabledmargin">' . $menu_array[$i]['titre'] . '</font><br></div>' . "\n"; |
|
| 2291 | + print '<div class="menu_contenu'.$cssmenu.'">'.$tabstring.'<font class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</font><br></div>'."\n"; |
|
| 2292 | 2292 | } |
| 2293 | 2293 | } |
| 2294 | 2294 | |
| 2295 | 2295 | // If next is a new block or if there is nothing after |
| 2296 | 2296 | if (empty($menu_array[$i + 1]['level'])) { // End menu block
|
| 2297 | 2297 | if ($showmenu) {
|
| 2298 | - print '<div class="menu_end"></div>' . "\n"; |
|
| 2298 | + print '<div class="menu_end"></div>'."\n"; |
|
| 2299 | 2299 | } |
| 2300 | 2300 | if ($blockvmenuopened) {
|
| 2301 | - print '</div>' . "\n"; |
|
| 2301 | + print '</div>'."\n"; |
|
| 2302 | 2302 | $blockvmenuopened = false; |
| 2303 | 2303 | } |
| 2304 | 2304 | } |
| 2305 | 2305 | } |
| 2306 | 2306 | |
| 2307 | 2307 | if ($altok) {
|
| 2308 | - print '<div class="blockvmenuend"></div>'; // End menu block |
|
| 2308 | + print '<div class="blockvmenuend"></div>'; // End menu block |
|
| 2309 | 2309 | } |
| 2310 | 2310 | } |
| 2311 | 2311 | |