From 985675d680ea52afc5698464dcbc70a779660fb9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Oct 2017 18:04:46 +0200 Subject: [PATCH] Clean code --- htdocs/core/lib/usergroups.lib.php | 10 ++++----- .../core/modules/modExpenseReport.class.php | 2 +- htdocs/core/modules/modHoliday.class.php | 21 +------------------ htdocs/core/modules/modWebsites.class.php | 2 +- htdocs/langs/en_US/main.lang | 4 ++++ htdocs/langs/en_US/trips.lang | 2 -- htdocs/langs/en_US/website.lang | 1 - htdocs/theme/eldy/ckeditor/config.js | 5 +++-- 8 files changed, 15 insertions(+), 32 deletions(-) diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 0c7fb86a02d..afce2644124 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -60,11 +60,6 @@ function user_prepare_head($object) $h++; } - $head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$object->id; - $head[$h][1] = $langs->trans("UserGUISetup"); - $head[$h][2] = 'guisetup'; - $h++; - if ($canreadperms) { $head[$h][0] = DOL_URL_ROOT.'/user/perms.php?id='.$object->id; @@ -73,6 +68,11 @@ function user_prepare_head($object) $h++; } + $head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$object->id; + $head[$h][1] = $langs->trans("UserGUISetup"); + $head[$h][2] = 'guisetup'; + $h++; + if (! empty($conf->agenda->enabled)) { if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index f068247248a..4d84c0a6d05 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -102,7 +102,7 @@ class modExpenseReport extends DolibarrModules $r++; // Array to add new pages in new tabs - $this->tabs = array('user:+expensereport:ExpenseReport:expensereport:$user->rights->expensereport->lire:/expensereport/list.php?mainmenu=hrm&id=__ID__'); + $this->tabs[] = array('data'=>'user:+expensereport:ExpenseReport:expensereport:$user->rights->expensereport->lire:/expensereport/list.php?mainmenu=hrm&id=__ID__'); // To add a new tab identified by code tabname1 // Boxes $this->boxes = array(); // List of boxes diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index d57800872fd..75bb6a04a07 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -91,26 +91,7 @@ class modHoliday extends DolibarrModules $this->const = array(); // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 0 or 'allentities') // Array to add new pages in new tabs - // Example: $this->tabs = array('objecttype:+tabname1:Title1:@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1 - // 'objecttype:+tabname2:Title2:@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2 - // 'objecttype:-tabname'); // To remove an existing tab identified by code tabname - // where objecttype can be - // 'thirdparty' to add a tab in third party view - // 'intervention' to add a tab in intervention view - // 'order_supplier' to add a tab in supplier order view - // 'invoice_supplier' to add a tab in supplier invoice view - // 'invoice' to add a tab in customer invoice view - // 'order' to add a tab in customer order view - // 'product' to add a tab in product view - // 'stock' to add a tab in stock view - // 'propal' to add a tab in propal view - // 'member' to add a tab in fundation member view - // 'contract' to add a tab in contract view - // 'user' to add a tab in user view - // 'group' to add a tab in group view - // 'contact' to add a tab in contact view - // 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) - $this->tabs = array('user:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->read:/holiday/list.php?mainmenu=hrm&id=__ID__'); + $this->tabs[] = array('data'=>'user:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->read:/holiday/list.php?mainmenu=hrm&id=__ID__'); // To add a new tab identified by code tabname1 // Boxes $this->boxes = array(); // List of boxes diff --git a/htdocs/core/modules/modWebsites.class.php b/htdocs/core/modules/modWebsites.class.php index d6d984193d9..b201d80f555 100644 --- a/htdocs/core/modules/modWebsites.class.php +++ b/htdocs/core/modules/modWebsites.class.php @@ -80,7 +80,7 @@ class modWebsites extends DolibarrModules // New pages on tabs // ----------------- - $this->tabs = array(); + $this->tabs[] = array('data'=>'user:+websites:WebSites:website:$user->rights->websites->read:/user/website.php?mainmenu=home&id=__ID__'); // To add a new tab identified by code tabname1 // Boxes //------ diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 86c25591ef3..a772cb2f58b 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -808,6 +808,10 @@ ModuleBuilder=Module Builder SetMultiCurrencyCode=Set currency BulkActions=Bulk actions ClickToShowHelp=Click to show tooltip help +Website=Web site +WebSites=Web sites +ExpenseReport=Expense report +ExpenseReports=Expense reports HR=HR HRAndBank=HR and Bank AutomaticallyCalculated=Automatically calculated diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang index 9ec96d98ff4..ad4f7217d6f 100644 --- a/htdocs/langs/en_US/trips.lang +++ b/htdocs/langs/en_US/trips.lang @@ -1,6 +1,4 @@ # Dolibarr language file - Source file is en_US - trips -ExpenseReport=Expense report -ExpenseReports=Expense reports ShowExpenseReport=Show expense report Trips=Expense reports TripsAndExpenses=Expenses reports diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index d20566ac397..2aabb01d95d 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -17,7 +17,6 @@ EditCss=Edit Style/CSS or HTML header EditMenu=Edit menu EditMedias=Edit medias EditPageMeta=Edit Meta -Website=Web site AddWebsite=Add website Webpage=Web page/container AddPage=Add page/container diff --git a/htdocs/theme/eldy/ckeditor/config.js b/htdocs/theme/eldy/ckeditor/config.js index 6a20b34d302..bac39e67d87 100644 --- a/htdocs/theme/eldy/ckeditor/config.js +++ b/htdocs/theme/eldy/ckeditor/config.js @@ -34,7 +34,7 @@ CKEDITOR.editorConfig = function( config ) [ ['Templates','NewPage'], ['Save'], - ['Source','Maximize','Preview'], + ['Maximize','Preview'], ['PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'], // 'Cut','Copy','Paste','-', are useless, can be done with right click, even on smarpthone ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], ['CreateDiv','ShowBlocks'], @@ -46,7 +46,8 @@ CKEDITOR.editorConfig = function( config ) ['Link','Unlink','Anchor'], ['Image','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'], ['Styles','Format','Font','FontSize'], - ['TextColor','BGColor'] + ['TextColor','BGColor'], + ['Source'] ]; // Used for mailing fields