diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index d569173aafe..7239ee89a4b 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -175,7 +175,7 @@ if ($action == 'edit') print ''; print ''; - $var=!$var; + $var=false; print ''; print ''; @@ -222,7 +222,7 @@ else print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_METEO").'' .$form->selectyesno('MAIN_DISABLE_METEO',(isset($conf->global->MAIN_DISABLE_METEO)?1:0),1) . '
'; print ''; - $var=!$var; + $var=false; print ''; print ''; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index feb8646442a..d43fef668b4 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -43,6 +43,7 @@ $langs->load("errors"); $langs->load("admin"); $langs->load("companies"); $langs->load("resource"); +$langs->load("holiday"); $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $confirm=GETPOST('confirm','alpha'); @@ -170,7 +171,7 @@ $tabsql[24]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX $tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position, topic, content, active FROM ".MAIN_DB_PREFIX."c_email_templates"; $tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units"; $tabsql[27]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_stcomm"; -$tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid"; +$tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid"; $tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status"; // Criteria to sort dictionaries @@ -234,7 +235,7 @@ $tabfield[24]= "code,label"; $tabfield[25]= "label,type_template,position,topic,content"; $tabfield[26]= "code,label,short_label"; $tabfield[27]= "code,libelle"; -$tabfield[28]= "code,label,delay,newByMonth,country_id,country"; +$tabfield[28]= "code,label,affect,delay,newByMonth,country_id,country"; $tabfield[29]= "code,label,percent,position"; // Nom des champs d'edition pour modification d'un enregistrement @@ -266,7 +267,7 @@ $tabfieldvalue[24]= "code,label"; $tabfieldvalue[25]= "label,type_template,position,topic,content"; $tabfieldvalue[26]= "code,label,short_label"; $tabfieldvalue[27]= "code,libelle"; -$tabfieldvalue[28]= "code,label,delay,newByMonth,country"; +$tabfieldvalue[28]= "code,label,affect,delay,newByMonth,country"; $tabfieldvalue[29]= "code,label,percent,position"; // Nom des champs dans la table pour insertion d'un enregistrement @@ -298,7 +299,7 @@ $tabfieldinsert[24]= "code,label"; $tabfieldinsert[25]= "label,type_template,position,topic,content"; $tabfieldinsert[26]= "code,label,short_label"; $tabfieldinsert[27]= "code,libelle"; -$tabfieldinsert[28]= "code,label,delay,newByMonth,fk_country"; +$tabfieldinsert[28]= "code,label,affect,delay,newByMonth,fk_country"; $tabfieldinsert[29]= "code,label,percent,position"; // Nom du rowid si le champ n'est pas de type autoincrement @@ -396,7 +397,7 @@ $tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[25] = array('type_template'=>$langs->trans("TemplateForElement"),'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"), 'position'=>$langs->trans("PositionIntoComboList")); $tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode")); -$tabhelp[28] = array('delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically")); +$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically")); $tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList")); // List of check for fields (NOT USED YET) diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 66c1ae1ce56..3806258d246 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -169,7 +169,7 @@ else if (empty($mysoc->country_code)) { $langs->load("errors"); - $warnpicto=img_error($langs->trans("WarningMandatorySetupNotComplete")); + $warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete")); print '
'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").''; } else diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index b084f21164c..733569d8071 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -505,7 +505,6 @@ if ($action == 'edit') print ''; print ''; - print '
'; } else { @@ -662,7 +661,6 @@ else // Run the test to connect if ($action == 'testconnect') { - print '
'; print load_fiche_titre($langs->trans("DoTestServerAvailability")); // If we use SSL/TLS @@ -688,7 +686,6 @@ else // Show email send test form if ($action == 'test' || $action == 'testhtml') { - print '
'; print load_fiche_titre($action == 'testhtml'?$langs->trans("DoTestSendHTML"):$langs->trans("DoTestSend")); // Cree l'objet formulaire mail diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 5cd45467f01..bb3934625b6 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2006-2016 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -85,7 +85,7 @@ if (GETPOST('submitthirdparty') && GETPOST('submitthirdparty')) if (empty($forbarcode) || empty($fk_barcode_type)) { - setEventMessages($langs->trans("DefinitionOfBarCodeForProductNotComplete",$thirdpartytmp->getNomUrl()), null, 'warnings'); + setEventMessages($langs->trans("DefinitionOfBarCodeForThirdpartyNotComplete",$thirdpartytmp->getNomUrl()), null, 'warnings'); } } } @@ -387,11 +387,11 @@ print '
'; if ($producttmp->id > 0) { - print $langs->trans("BarCodeDataForProduct",$producttmp->getNomUrl(1)).'
'; + print $langs->trans("BarCodeDataForProduct",'').' '.$producttmp->getNomUrl(1).'
'; } if ($thirdpartytmp->id > 0) { - print $langs->trans("BarCodeDataForThirdparty",$thirdpartytmp->getNomUrl(1)).'
'; + print $langs->trans("BarCodeDataForThirdparty",'').' '.$thirdpartytmp->getNomUrl(1).'
'; } print '
'; diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 02033b27bff..f3969793ef0 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -158,10 +158,23 @@ print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_METEO").'' . yn($conf->global->MAIN_DISABLE_METEO) . '
'; // Reference print ''; -print ''; print ''; + +// Description +print ''; + print '
'.$langs->trans("Ref").''; -print $object->label; +print ''; +$ways = $object->print_all_ways(); +print $langs->trans("Ref").''; +print ''.$langs->trans("Root").' >> '; +foreach ($ways as $way) +{ + print $way."
\n"; +} print '
'; +print $langs->trans("Description").''; +print dol_htmlentitiesbr($object->description); +print '
'; if ($action == 'edit') diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 04529dd2d9e..5ff5723a6c0 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -240,7 +240,7 @@ print '
'; // Company print ''.$langs->trans("ThirdParty").''; $filter='s.client in (1,2,3)'; - print $form->select_company($socid,'socid',$filter,1); + print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"'); print ''; // User print ''.$langs->trans("CreatedBy").''; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 8aa5ce64655..0aa828dc77a 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php'; if (!$user->rights->commande->lire) accessforbidden(); $langs->load("orders"); +$langs->load("bills"); // Security check $socid=GETPOST('socid','int'); diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index a6e04121707..bf0331f251d 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -256,7 +256,7 @@ print '
'; print ''.$langs->trans("ThirdParty").''; if ($mode == 'customer') $filter='s.client in (1,2,3)'; if ($mode == 'supplier') $filter='s.fournisseur = 1'; - print $form->select_company($socid,'socid',$filter,1); + print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"'); print ''; // User print ''.$langs->trans("CreatedBy").''; diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 9ffbe111ea7..216988b6a7a 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -237,7 +237,7 @@ print ''.$langs->tra // Company print ''.$langs->trans("ThirdParty").''; $filter=''; -print $form->select_company($socid,'socid',$filter,1,1); +print $form->select_company($socid,'socid',$filter,1,1,0,array(),0,'','style="width: 95%"'); print ''; // User print ''.$langs->trans("User").''; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index bfe3cdc8555..14f8c8d18f6 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -240,7 +240,7 @@ print '
'; print ''.$langs->trans("ThirdParty").''; if ($mode == 'customer') $filter='s.client in (1,2,3)'; if ($mode == 'supplier') $filter='s.fournisseur = 1'; - print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 100%"'); + print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1); print ''; // User print ''.$langs->trans("CreatedBy").''; diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index cc66d7c7978..4a8dc21ca1b 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -336,9 +336,11 @@ if ($id) print ''; - print ""; + $linkback = ''.$langs->trans("BackToList").''; + + print ""; print ''; // Employee diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index efc994a0446..62ebd0589c0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -898,9 +898,10 @@ class Form * @param array $events Ajax event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param int $limit Maximum number of elements * @param string $morecss Add more css styles to the SELECT component + * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container * @return string HTML string with select box for thirdparty. */ - function select_company($selected='', $htmlname='socid', $filter='', $showempty=0, $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100') + function select_company($selected='', $htmlname='socid', $filter='', $showempty=0, $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='') { $out=''; @@ -934,7 +935,7 @@ class Form } else {*/ - $out.=$this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss); + $out.=$this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam); //} return $out; @@ -954,9 +955,10 @@ class Form * @param int $outputmode 0=HTML select string, 1=Array * @param int $limit Limit number of answers * @param string $morecss Add more css styles to the SELECT component + * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container * @return string HTML string with */ - function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $events=array(), $filterkey='', $outputmode=0, $limit=0, $morecss='minwidth100') + function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $events=array(), $filterkey='', $outputmode=0, $limit=0, $morecss='minwidth100', $moreparam='') { global $conf,$user,$langs; @@ -1010,7 +1012,7 @@ class Form } // Construct $out and $outarray - $out.= ''."\n"; $textifempty=''; // Do not use textempty = ' ' or ' ' here, or search on key will search on ' key'. @@ -4510,7 +4512,7 @@ class Form * @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or ' '), <0 to add an empty value with key that is this value. * @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value" * @param int $value_as_key 1 to use value as key - * @param string $moreparam Add more parameters onto the select tag + * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container * @param int $translate Translate and encode value * @param int $maxlen Length maximum for labels * @param int $disabled Html select box is disabled diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index d6f1521e49d..1727db5f227 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -598,7 +598,11 @@ class FormOther include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $color = colorArrayToHex(colorStringToArray($color,array()),''); - if ($color) print ''; + $textcolor='000'; + $tmpcolorweight=0; + foreach(colorStringToArray($color,array()) as $x) $tmpcolorweight+=$x; + if ($tmpcolorweight < 400) $textcolor='FFF'; + if ($color) print ''; else print $textifnotdefined; } diff --git a/htdocs/core/lib/holiday.lib.php b/htdocs/core/lib/holiday.lib.php index 42551601524..ed4c6d874a3 100644 --- a/htdocs/core/lib/holiday.lib.php +++ b/htdocs/core/lib/holiday.lib.php @@ -39,10 +39,15 @@ function holiday_prepare_head($object) $head[$h][2] = 'card'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/holiday/document.php?id='.$object->id; - $head[$h][1] = $langs->trans('Document'); - $head[$h][2] = 'documents'; - $h++; + // Attachments + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $upload_dir = $conf->holiday->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$')); + $head[$h][0] = DOL_URL_ROOT.'/holiday/document.php?id='.$object->id; + $head[$h][1] = $langs->trans('Documents'); + if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.''; + $head[$h][2] = 'documents'; + $h++; // Show more tabs from modules // Entries must be declared in modules descriptor with line diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 513a16a71f6..a295d433b6f 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -84,9 +84,14 @@ function member_prepare_head(Adherent $object) if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $h++; + // Attachments + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $upload_dir = $conf->adherent->multidir_output[$object->entity].'/'.get_exdir($object->id,2,0,1,$object,'member').'/'.dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$')); $head[$h][0] = DOL_URL_ROOT.'/adherents/document.php?id='.$object->id; - $head[$h][1] = $langs->trans("Documents"); - $head[$h][2] = 'document'; + $head[$h][1] = $langs->trans('Documents'); + if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.''; + $head[$h][2] = 'documents'; $h++; $head[$h][0] = DOL_URL_ROOT.'/adherents/info.php?id='.$object->id; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 5c3c6a00c08..576e575421e 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -312,7 +312,6 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5003__+MAX_llx_menu__, 'hrm', '', 5002__+MAX_llx_menu__, '/holiday/list.php?select_statut=2&leftmenu=hrm', 'ListToApprove', 2, 'trips', '$user->rights->holiday->read', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5004__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/define_holiday.php?&action=request', 'MenuConfCP', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5005__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/view_log.php?&action=request', 'MenuLogCP', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5006__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/month_report.php?&action=request', 'MenuReportMonth', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 4, __ENTITY__); -- HRM - Expense reports insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2100__+MAX_llx_menu__, 'accountancy', 'tripsandexpenses', 15__+MAX_llx_menu__, '/compta/deplacement/index.php?leftmenu=tripsandexpenses', 'TripsAndExpenses', 0, 'trips', '$user->rights->deplacement->lire', '', 0, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2101__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses', 'New', 1, 'trips', '$user->rights->deplacement->creer', '', 0, 1, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 89905a5e231..c3ab3f82750 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1264,7 +1264,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/holiday/list.php?select_statut=2&leftmenu=hrm", $langs->trans("ListToApprove"), 2, $user->rights->holiday->read); $newmenu->add("/holiday/define_holiday.php?&action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->define_holiday); $newmenu->add("/holiday/view_log.php?&action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->define_holiday); - $newmenu->add("/holiday/month_report.php?&action=request", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->define_holiday); } // Trips and expenses (old module) diff --git a/htdocs/core/modules/modOauth.class.php b/htdocs/core/modules/modOauth.class.php index 20fc68444d6..0ccab13e2b5 100644 --- a/htdocs/core/modules/modOauth.class.php +++ b/htdocs/core/modules/modOauth.class.php @@ -93,12 +93,12 @@ class modOauth extends DolibarrModules // $this->rights[$r][4] Niveau 1 pour nommer permission dans code // $this->rights[$r][5] Niveau 2 pour nommer permission dans code - $r++; + /*$r++; $this->rights[$r][0] = 66000; $this->rights[$r][1] = 'OauthAccess'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 1; - $this->rights[$r][4] = 'read'; + $this->rights[$r][4] = 'read';*/ // Main menu entries $this->menus = array(); // List of menus to add diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 1debab7b10b..5e79b71ee34 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -222,7 +222,7 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file - '; // User print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; } diff --git a/htdocs/install/default.css b/htdocs/install/default.css index abf9baa5a7d..76a71e079d8 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -17,46 +17,46 @@ */ body { -font-size:13px; -font-family: Verdana, Arial, Helvetica, Tahoma, sans-serif; -background: #f0f0f0; -margin: 15px 30px 10px; + font-size:13px; + font-family: Verdana, Arial, Helvetica, Tahoma, sans-serif; + background: #fcfcfc; + margin: 15px 30px 10px; } div.titre { -padding: 5px 5px 5px 5px; -margin: 0 0 0 0; + padding: 5px 5px 5px 5px; + margin: 0 0 0 0; } span.titre { -font-size: 1.1em; -font-weight: bold; -background: #FFFFFF; -color: #444; -border: 1px solid #999; -padding: 5px 5px 5px 5px; -margin: 0 0 0 20px; + font-size: 90%; + font-weight: bold; + background: #FFFFFF; + color: #444; + border: 1px solid #999; + padding: 5px 5px 5px 5px; + margin: 0 0 0 15px; } div.soustitre { -font-size: 15px; -font-weight: bold; -color: #4965B3; -padding: 0 1.2em 0.5em 2em; -margin: 1.2em 1.2em 1.2em 1.2em; -border-bottom: 1px solid #999; -border-right: 1px solid #999; -text-align: right; + font-size: 15px; + font-weight: bold; + color: #4965B3; + padding: 0 1.2em 0.5em 2em; + margin: 1.2em 1.2em 1.2em 1.2em; + border-bottom: 1px solid #999; + border-right: 1px solid #999; + text-align: right; } input:disabled { -background: #FDFDFD; -border: 1px solid #ACBCBB; -padding: 0 0 0 0; -margin: 0 0 0 0; -color: #AAA !important; -cursor: not-allowed !important; + background: #FDFDFD; + border: 1px solid #ACBCBB; + padding: 0 0 0 0; + margin: 0 0 0 0; + color: #AAA !important; + cursor: not-allowed !important; } input[type=submit] { @@ -105,36 +105,32 @@ input:-webkit-autofill { } table.main { -margin-left: 10px; -margin-right: 10px; -padding-left: 6px; -padding-right: 6px; -padding-top: 12px; -padding-bottom: 12px; -border: 1px solid #A0A0A0; -border-radius: 8px; -border: solid 1px rgba(90,90,90,.4); --moz-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); --webkit-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); -box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); -background-color: #FFFFFF; -background: -webkit-gradient(linear, center top, center bottom, color-stop(0%, #fff), color-stop(100%, #f8f8f8)); -background: -moz-linear-gradient(top, #fff, #f8f8f8); + padding-left: 6px; + padding-right: 6px; + padding-top: 12px; + padding-bottom: 12px; + border: 1px solid #A0A0A0; + border-radius: 8px; + border: solid 1px rgba(90,90,90,.4); + background-color: #fff; + -moz-box-shadow: 0px 1px 6px 2px rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0px 1px 6px 2px rgba(0, 0, 0, 0.2); + box-shadow: 0px 1px 6px 2px rgba(0, 0, 0, 0.2); } table.main-inside { -padding-left: 10px; -padding-right: 10px; -margin-bottom: 10px; -margin-top: 10px; -color: #000000; + padding-left: 10px; + padding-right: 10px; + margin-bottom: 10px; + margin-top: 10px; + color: #000000; } table.listofchoices, tr.listofchoices, td.listofchoices { -border-collapse: collapse; + border-collapse: collapse; padding: 4px; color: #000000; -border: 1px solid #999 !important; + border: 1px solid #999 !important; } tr.listofchoices { @@ -147,119 +143,119 @@ tr.listofchoices { } .installchoices table tr td { -margin-left: 2px; -margin-right: 2px; -border-bottom: 1px solid #999; -border-right: 1px solid #999; -color: #000000; + margin-left: 2px; + margin-right: 2px; + border-bottom: 1px solid #999; + border-right: 1px solid #999; + color: #000000; } /* OK */ div.ok { -color: #114466; + color: #114466; } font.ok { -color: #114466; + color: #114466; } /* Warning */ div.warning { -color: #777711; + color: #777711; } font.warning { -color: #777711; + color: #777711; } /* Error */ div.error { -color: #550000; -font-weight: bold; -padding: 0.2em 0.2em 0.2em 0.2em; -margin: 0.5em 0 0.5em 0; -border: 1px solid #6C7C8B; + color: #550000; + font-weight: bold; + padding: 0.2em 0.2em 0.2em 0.2em; + margin: 0.5em 0 0.5em 0; + border: 1px solid #6C7C8B; } font.error { -color: #550000; -font-weight: bold; + color: #550000; + font-weight: bold; } /* Next button */ div.nextbutton { -text-align: right; -margin-top: 10px; -padding-top: 5px; -padding-bottom: 5px; -padding-right: 10px; + text-align: right; + margin-top: 10px; + padding-top: 5px; + padding-bottom: 5px; + padding-right: 10px; } div.header { -background-color: #dcdff4; -border-bottom: solid black 1px; -padding-left: 5px; -text-align: center; + background-color: #dcdff4; + border-bottom: solid black 1px; + padding-left: 5px; + text-align: center; } a:link,a:visited,a:active { -text-decoration:none; + text-decoration:none; } a:hover { -text-decoration:underline; + text-decoration:underline; } a.titre { -text-decoration:none; + text-decoration:none; } div.comment { -text-decoration:none; -color:black; -font-size: 13px; + text-decoration:none; + color:black; + font-size: 13px; } h3 { -margin-top: 10px; -font-size:16px; -font-weight: normal; -color: #4965B3; -text-shadow: 1px 1px 1px #c0c0c0; + margin-top: 10px; + font-size:16px; + font-weight: normal; + color: #4965B3; + text-shadow: 1px 1px 1px #c0c0c0; } tr.bg1 { -background-color: #E5E5E5; + background-color: #E5E5E5; } tr.bg2 { -background-color: #B5C5C5; + background-color: #B5C5C5; } /* Class for parameters key and value */ td.label { -color: #5945A3; -padding: 5px 5px 5px 5px; -margin: 0 0 0 0; -border-bottom: 1px solid #CCCCDB; + color: #5945A3; + padding: 5px 5px 5px 5px; + margin: 0 0 0 0; + border-bottom: 1px solid #CCCCDB; } /* Class for parameters example */ td.comment { -color: black; -padding: 5px 5px 5px 5px; -margin: 0 0 0 0; -text-decoration:none; -font-size: 11px; -border-bottom: 1px solid #CCCCDB; + color: black; + padding: 5px 5px 5px 5px; + margin: 0 0 0 0; + text-decoration:none; + font-size: 11px; + border-bottom: 1px solid #CCCCDB; } table { -font-size: 12px; + font-size: 12px; } .install { -border: 1px solid #999; -padding: 4px 4px 4px 4px; + border: 1px solid #999; + padding: 4px 4px 4px 4px; } div.visible { @@ -294,9 +290,9 @@ a.button:hover { } .choiceselected { -background-color: #dfd; -background-repeat: repeat-x; -background-position: top left; + background-color: #dfd; + background-repeat: repeat-x; + background-position: top left; } .center { diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 5b010f80e0b..ac6f444f45e 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -371,6 +371,7 @@ function pHeader($subtitle,$next,$action='set',$param='',$forcejqueryurl='') print ''."\n"; print ''."\n"; print ''."\n"; + print ''."\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a372955d901..cc5a97a1ca7 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -362,7 +362,7 @@ HideAnyVATInformationOnPDF=Hide all information related to VAT on generated PDF HideDescOnPDF=Hide products description on generated PDF HideRefOnPDF=Hide products ref. on generated PDF HideDetailsOnPDF=Hide products lines details on generated PDF -PlaceCustomerAddressToIsoLocation=Use french standard position (La Posteà for customer address position +PlaceCustomerAddressToIsoLocation=Use french standard position (La Poste) for customer address position Library=Library UrlGenerationParameters=Parameters to secure URLs SecurityTokenIsUnique=Use a unique securekey parameter for each URL diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index 0b471cc8c51..f26fdc73cd2 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -22,7 +22,7 @@ ReviewedByCP=Will be reviewed by DescCP=Description SendRequestCP=Create leave request DelayToRequestCP=Leave requests must be made at least %s day(s) before them. -MenuConfCP=Edit balance of leaves +MenuConfCP=Balance of leaves UpdateAllCP=Update the leaves SoldeCPUser=Leaves balance is %s days. ErrorEndDateCP=You must select an end date greater than the start date. @@ -140,4 +140,7 @@ HolidaysRefusedBody=Your leave request for %s to %s has been denied for the foll HolidaysCanceled=Canceled leaved request HolidaysCanceledBody=Your leave request for %s to %s has been canceled. NewByMonth=Added per month +Affect=Followed by a counter +FollowedByACounter=1: This type of leave need to be followed by a counter. Counter is incremented manually or automatically and when a leave request is validated, counter is decremented.
0: Not followed by a counter. +NoLeaveWithCounterDefined=There is no leave types defined that need to be followed by a counter GoIntoDictionaryHolidayTypes=Go into Home - Setup - Dictionaries - Type of leaves to setup the different types of leaves. \ No newline at end of file diff --git a/htdocs/langs/en_US/oauth.lang b/htdocs/langs/en_US/oauth.lang index 4cc08b058c6..260c0e1f902 100644 --- a/htdocs/langs/en_US/oauth.lang +++ b/htdocs/langs/en_US/oauth.lang @@ -8,7 +8,7 @@ TokenDeleted=Token deleted RequestAccess=Click here to request/renew access and receive a new token to save DeleteAccess=Click here to delete token UseTheFollowingUrlAsRedirectURI=Use the following URL as the Redirect URI when creating your credential on your OAuth provider: -ListOfSupportedOauthProviders=Enter here credential provided by your OAuth2 provider. Only supported OAuth2 providers are visible here. This setup may be used by other modules than need OAuth2 authentication. +ListOfSupportedOauthProviders=Enter here credential provided by your OAuth2 provider. Only supported OAuth2 providers are visible here. This setup may be used by other modules that need OAuth2 authentication. OAUTH_GOOGLE_NAME=Api Google OAUTH_GOOGLE_ID=Api Google Id OAUTH_GOOGLE_SECRET=Api Google Secret diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 29ab2c0018c..2975aa4b19b 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -873,7 +873,7 @@ else // Description (used in invoice, propal...) print '"; @@ -977,7 +977,7 @@ else print '"; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 5bca7bb2b86..d82adceb1a4 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -222,10 +222,7 @@ else // multilang if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang = '".$langs->getDefaultLang() ."'"; $sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; - if ($sall) - { - $sql .= natural_search(array_keys($fieldstosearchall), $sall); - } + if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); // if the type is not 1, we show all products (type = 0,2,3) if (dol_strlen($type)) { diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 5b81f8c0818..87d6d4e46eb 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Raphaël Doursenaud @@ -350,8 +350,11 @@ if ($resql) // Warehouse print ''; print ''; print ''; diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 5cc9e27a8cb..80d8bea62f7 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -192,7 +192,7 @@ if ($action == 'create') print ''; // Description - print ''; // Description - print ''; + print ''; // Address print '"; // Nb of products - print '"; // Value - print '"; @@ -326,7 +326,7 @@ else { dol_print_error($db); } - print ''; - print ''; + print ''; // Description - print ''; // Country - print ''; - print '
'.$langs->trans("Ref").''; - print $object->ref; + print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', ''); print '
'.$langs->trans("ThirdParty").''; if ($mode == 'customer') $filter='s.client in (1,2,3)'; if ($mode == 'supplier') $filter='s.fournisseur = 1'; - print $form->select_company($socid,'socid',$filter,1); + print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"'); print '
'.$langs->trans("CreatedBy").''; diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index c397605645d..19b11a0ddf6 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -51,9 +51,9 @@ $var=false; print '
'; print ''; print ''; -print ''; +print ''; print ''; +print $langs->trans("Shipment").':'; print "
'.$langs->trans("SearchASending").'
'.$langs->trans("Search").'
'; -print $langs->trans("Ref").':

\n"; /* diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 13760ebf776..00796add031 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -38,6 +38,7 @@ $result = restrictedArea($user, 'expedition',$expeditionid,''); $search_ref_exp = GETPOST("search_ref_exp"); $search_ref_liv = GETPOST('search_ref_liv'); $search_company = GETPOST("search_company"); +$sall = GETPOST('sall'); $optioncss = GETPOST('optioncss','alpha'); $sortfield = GETPOST('sortfield','alpha'); @@ -63,6 +64,13 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $viewstatut=''; } +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'e.ref'=>"Ref", + 's.nom'=>"ThirdParty" +); + + /* * View */ @@ -100,6 +108,7 @@ if ($viewstatut <> '') { if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp); if ($search_ref_liv) $sql .= natural_search('l.ref', $search_ref_liv); if ($search_company) $sql .= natural_search('s.nom', $search_company); +if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1,$offset); @@ -123,12 +132,21 @@ if ($resql) $i = 0; print '
'."\n"; if ($optioncss != '') print ''; - print ''; + + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); + } + + $moreforfilter=''; + + print '
'; print ''; print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"e.ref","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"],"s.nom", "", $param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ThirdParty"), $_SERVER["PHP_SELF"],"s.nom", "", $param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDeliveryPlanned"), $_SERVER["PHP_SELF"],"e.date_delivery","",$param, 'align="center"',$sortfield,$sortorder); if($conf->livraison_bon->enabled) { diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index 983517e7ea2..cc5e770d02a 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -240,7 +240,7 @@ print '
'; print '
'; // User print ''; */ // User diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 17f304fbd58..4d80ac04039 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2013 Florian Henry @@ -1056,7 +1056,7 @@ if ($action == 'create') print ''; // Description (must be a textarea and not html must be allowed (used in list view) - print ''; + print ''; print ''; @@ -1068,7 +1068,7 @@ if ($action == 'create') $langs->load("project"); - print ''; - print ''; - print ''; + print ''; // Private note - if (!empty($user->societe_id)) + if (empty($user->societe_id)) { print ''; - print ''; - print ''; + print '
'.$langs->trans("ThirdParty").''; if ($mode == 'customer') $filter='s.client in (1,2,3)'; if ($mode == 'supplier') $filter='s.fournisseur = 1'; - print $form->select_company($socid,'socid',$filter,1); + print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"'); print '
'.$langs->trans("CreatedBy").''; diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index 7eb05c65b67..6c515192f78 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -218,7 +218,7 @@ print '
'.$langs->tra /* print '
'.$langs->trans("ThirdParty").''; $filter=''; -print $form->select_company($socid,'socid',$filter,1,1); +print $form->select_company($socid,'socid',$filter,1,1,0,array(),0,'','style="width: 95%"'); print '
'.$langs->trans('Ref').''.$langs->trans("Draft").'
'.$langs->trans("Description").'
'.$langs->trans("Description").''; print ''; print '
'.$langs->trans("Project").''; + print '
'.$langs->trans("Project").''; /* Fix: If a project must be linked to any companies (suppliers or not), project must be not be set as limited to customer but must be not linked to any particular thirdparty if ($societe->fournisseur==1) $numprojet=select_projects(-1,$_POST["projectid"],'projectid'); @@ -1087,7 +1087,7 @@ if ($action == 'create') if ($conf->contrat->enabled) { $langs->load("contracts"); - print '
'.$langs->trans("Contract").''; + print '
'.$langs->trans("Contract").''; $numcontrat=$formcontract->select_contract($soc->id,GETPOST('contratid','int'),'contratid',0,1); if ($numcontrat==0) { @@ -1106,19 +1106,19 @@ if ($action == 'create') // Public note print '
'.$langs->trans('NotePublic').''; + print ''.$langs->trans('NotePublic').''; $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); //print ''; print '
'.$langs->trans('NotePrivate').''; + print ''.$langs->trans('NotePrivate').''; $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); //print ''; @@ -1313,7 +1313,7 @@ else if ($id > 0 || ! empty($ref)) } // Description (must be a textarea and not html must be allowed (used in list view) - print '
'; + print '
'; print $form->editfieldkey("Description",'description',$object->description,$object,$user->rights->ficheinter->creer,'textarea'); print ''; print $form->editfieldval("Description",'description',$object->description,$object,$user->rights->ficheinter->creer,'textarea:8:80'); diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 5cf2cf3617f..bd9fd680087 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -763,7 +763,7 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create dol_fiche_head(); $out=''; - $typeleaves=$cp->getTypes(1,-1); + $typeleaves=$cp->getTypes(1,1); foreach($typeleaves as $key => $val) { $nb_type = $cp->getCPforUser($user->id, $val['rowid']); diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 21c36574ea9..eb558e1c37f 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -33,7 +33,9 @@ class Holiday extends CommonObject { public $element='holiday'; public $table_element='holiday'; - + protected $isnolinkedbythird = 1; // No field fk_soc + protected $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + /** * @deprecated * @see id @@ -211,7 +213,8 @@ class Holiday extends CommonObject $sql.= " cp.note_private,"; $sql.= " cp.note_public,"; $sql.= " cp.fk_user_create,"; - $sql.= " cp.fk_type"; + $sql.= " cp.fk_type,"; + $sql.= " cp.entity"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp"; $sql.= " WHERE cp.rowid = ".$id; @@ -247,6 +250,7 @@ class Holiday extends CommonObject $this->note_public = $obj->note_public; $this->fk_user_create = $obj->fk_user_create; $this->fk_type = $obj->fk_type; + $this->entity = $obj->entity; } $this->db->free($resql); @@ -1804,8 +1808,8 @@ class Holiday extends CommonObject /** * Return array with list of types * - * @param int $active Status of type - * @param int $affect Filter on affect (a request will change sold or not) + * @param int $active Status of type. -1 = Both + * @param int $affect Filter on affect (a request will change sold or not). -1 = Both * @return array Return array with list of types */ function getTypes($active=-1, $affect=-1) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index e78d185661f..eb7fea3598c 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -132,7 +132,8 @@ elseif($action == 'add_event') $new_holiday = $nb_holiday + $add_holiday; // add event to existing types of vacation - foreach ($typeleaves as $key => $leave) { + foreach ($typeleaves as $key => $leave) + { $vacationTypeID = $leave['rowid']; // On ajoute la modification dans le LOG @@ -158,8 +159,18 @@ llxHeader(array(),$langs->trans('CPTitreMenu')); print load_fiche_titre($langs->trans('MenuConfCP'), '', 'title_hrm.png'); print '
'.$langs->trans('LastUpdateCP').': '."\n"; -if ($holiday->getConfCP('lastUpdate')) print ''.dol_print_date($db->jdate($holiday->getConfCP('lastUpdate')),'dayhour','tzuser').''; +$lastUpdate = $holiday->getConfCP('lastUpdate', 0); +if ($lastUpdate) +{ + $monthLastUpdate = $lastUpdate[4].$lastUpdate[5]; + $yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3]; + print ''.dol_print_date($db->jdate($holiday->getConfCP('lastUpdate')),'dayhour','tzuser').''; + print '
'.$langs->trans("MonthOfLastMonthlyUpdate").': '.$yearLastUpdate.'-'.$monthLastUpdate.''."\n"; +} else print $langs->trans('None'); + + + print "

\n"; $result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user. @@ -193,52 +204,77 @@ if ($cp_events == 1) $typeleaves=$holiday->getTypes(1,1); -print ''."\n"; -print ''; - -print ''; -print ""; -print ''; -foreach($typeleaves as $key => $val) +if (count($typeleaves) == 0) { - print ''; + //print '
'; + print $langs->trans("NoLeaveWithCounterDefined")."
\n"; + print $langs->trans("GoIntoDictionaryHolidayTypes"); + //print '
'; } -print ''; -print ''; -print ''; - - -foreach($listUsers as $users) +else { - $var=!$var; - - print ''; - print ''; - foreach($typeleaves as $key => $val) - { - $nbtoshow=''; - if ($holiday->getCPforUser($users['rowid'], $val['rowid']) != '') $nbtoshow=price2num($holiday->getCPforUser($users['rowid'], $val['rowid']), 5); - print ''."\n"; - } - print ''; - print ''."\n"; + print ''."\n"; + print ''; + + print '
'.$langs->trans('Employee').''.$val['label'].''.$langs->trans('Note').'
'; - $userstatic->id=$users['rowid']; - $userstatic->lastname=$users['name']; - $userstatic->firstname=$users['firstname']; - print $userstatic->getNomUrl(1); - print ''; - print ''; - //print ' '.$langs->trans('days'); - print '
'; + print ""; + print ''; + if (count($typeleaves)) + { + foreach($typeleaves as $key => $val) + { + print ''; + } + } + else + { + print ''; + } + print ''; + print ''; print ''; - - $i++; + + + foreach($listUsers as $users) + { + $var=!$var; + + print ''; + print ''; + + if (count($typeleaves)) + { + foreach($typeleaves as $key => $val) + { + $nbtoshow=''; + if ($holiday->getCPforUser($users['rowid'], $val['rowid']) != '') $nbtoshow=price2num($holiday->getCPforUser($users['rowid'], $val['rowid']), 5); + print ''."\n"; + } + } + else + { + print ''; + } + print ''; + print ''."\n"; + print ''; + + $i++; + } + + print '
'.$langs->trans('Employee').''.$val['label'].''.$langs->trans("NoLeaveWithCounterDefined").''.$langs->trans('Note').'
'; + $userstatic->id=$users['rowid']; + $userstatic->lastname=$users['name']; + $userstatic->firstname=$users['firstname']; + print $userstatic->getNomUrl(1); + print ''; + print ''; + //print ' '.$langs->trans('days'); + print '
'; + + print ''; } -print '
'; - -print ''; - llxFooter(); $db->close(); diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 79347c24c4e..2a673333430 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -253,6 +253,7 @@ else dol_fiche_head(''); } +$alltypeleaves=$holiday->getTypes(1,-1); // To have labels $out=''; $typeleaves=$holiday->getTypes(1,1); @@ -291,7 +292,7 @@ print_liste_field_titre($langs->trans("DateCreateCP"),$_SERVER["PHP_SELF"],"cp.d print_liste_field_titre($langs->trans("Employe"),$_SERVER["PHP_SELF"],"cp.fk_user","",'','',$sortfield,$sortorder); print_liste_field_titre($langs->trans("ValidatorCP"),$_SERVER["PHP_SELF"],"cp.fk_validator","",'','',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],'','','','',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],'','','','align="center"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],'','','','align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDebCP"),$_SERVER["PHP_SELF"],"cp.date_debut","",'','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateFinCP"),$_SERVER["PHP_SELF"],"cp.date_fin","",'','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cp.statut","",'','align="center"',$sortfield,$sortorder); @@ -407,7 +408,10 @@ if (! empty($holiday->holiday)) print '
'.dol_print_date($date,'day').''.$userstatic->getNomUrl('1').''.$approbatorstatic->getNomUrl('1').''.$infos_CP['fk_type'].''; + $label=$alltypeleaves[$infos_CP['fk_type']]['label']; + print $label?$label:$infos_CP['fk_type']; + print ''; $nbopenedday=num_open_day($infos_CP['date_debut_gmt'], $infos_CP['date_fin_gmt'], 0, 1, $infos_CP['halfday']); print $nbopenedday.' '.$langs->trans('DurationDays'); diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php deleted file mode 100644 index 55b4e05942a..00000000000 --- a/htdocs/holiday/month_report.php +++ /dev/null @@ -1,156 +0,0 @@ - - * Copyright (C) 2011 François Legastelois - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/holiday/month_report.php - * \ingroup holiday - * \brief Monthly report of paid holiday. - */ - -require('../main.inc.php'); -require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php'; - -// Protection if external user -if ($user->societe_id > 0) accessforbidden(); - - -// Si l'utilisateur n'a pas le droit de lire cette page -if(!$user->rights->holiday->read_all) accessforbidden(); - -$langs->load('hrm'); - - -/* - * View - */ - -$html = new Form($db); -$htmlother = new FormOther($db); -$holidaystatic = new Holiday($db); - -llxHeader(array(),$langs->trans('CPTitreMenu')); - -$cp = new Holiday($db); - -$month = GETPOST('month_start'); -$year = GETPOST('year_start'); - -if(empty($month)) { - $month = date('n'); -} -if(empty($year)) { - $year = date('Y'); -} - -$sql = "SELECT cp.rowid, cp.fk_user, cp.date_debut, cp.date_fin, cp.halfday"; -$sql.= " FROM " . MAIN_DB_PREFIX . "holiday cp"; -$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "user u ON cp.fk_user = u.rowid"; -$sql.= " WHERE cp.statut = 3"; // Approved -// TODO Use BETWEEN instead of date_format -$sql.= " AND (date_format(cp.date_debut, '%Y-%c') = '$year-$month' OR date_format(cp.date_fin, '%Y-%c') = '$year-$month')"; -$sql.= " ORDER BY u.lastname,cp.date_debut"; - -$result = $db->query($sql); -$num = $db->num_rows($result); - -print load_fiche_titre($langs->trans('MenuReportMonth'), '', 'title_hrm.png'); - -// Get month of last update -$lastUpdate = $cp->getConfCP('lastUpdate', 0); -$monthLastUpdate = $lastUpdate[4].$lastUpdate[5]; -$yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3]; -print $langs->trans("MonthOfLastMonthlyUpdate").': '.$yearLastUpdate.'-'.$monthLastUpdate.'

'."\n"; - - -print '
'."\n"; - -dol_fiche_head(); - -print $langs->trans('Month').': '; -print $htmlother->select_month($month, 'month_start').' '; -print $htmlother->select_year($year,'year_start',1,10,3); - -print ''; - -print '
'; -print '
'; - -$var=true; -print ''; - -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; - -if($num == '0') { - - print ''; - print ''; - print ''; - -} else { - - $langs->load('users'); - - while ($holiday = $db->fetch_array($result)) - { - $user = new User($db); - $user->fetch($holiday['fk_user']); - $var=!$var; - - $holidaystatic->id=$holiday['rowid']; - $holidaystatic->ref=$holiday['rowid']; - - $start_date=$db->jdate($holiday['date_debut']); - $end_date=$db->jdate($holiday['date_fin']); - $start_date_gmt=$db->jdate($holiday['date_debut'],1); - $end_date_gmt=$db->jdate($holiday['date_fin'],1); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - } -} -print '
'.$langs->trans('Ref').''.$langs->trans('Employee').''.$langs->trans('DateDebCP').''.$langs->trans('DateFinCP').''.$langs->trans('nbJours').'
'.$langs->trans('None').'
'.$holidaystatic->getNomUrl(1).''.$user->getNomUrl(1).''.dol_print_date($start_date,'day'); - print ''.dol_print_date($end_date,'day'); - print ''; - $nbopenedday=num_open_day($start_date_gmt, $end_date_gmt, 0, 1, $holiday['halfday']); - print $nbopenedday; - print '
'; - -dol_fiche_end(); - -print '
'; - - -// Fin de page -llxFooter(); - -$db->close(); diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 766478ed9de..cf1bdcb8748 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2007-2016 Laurent Destailleur * Copyright (C) 2011 Dimitri Mouillard * * This program is free software; you can redistribute it and/or modify @@ -101,10 +101,10 @@ foreach($cp->logs as $logs_CP) } -if($log_holiday == '2') +if ($log_holiday == '2') { print '
'.$langs->trans('NoResults').''.$langs->trans('None').'
'.$langs->trans("Description").''; - $doleditor = new DolEditor('desc', GETPOST('desc'), '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 4, 80); + $doleditor = new DolEditor('desc', GETPOST('desc'), '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 4, '80%'); $doleditor->Create(); print "
'.$langs->trans("NoteNotVisibleOnBill").''; // We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF. - $doleditor = new DolEditor('note', GETPOST('note'), '', 140, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 8, 70); + $doleditor = new DolEditor('note', GETPOST('note'), '', 140, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 8, '80%'); $doleditor->Create(); print "
'; - $warehousetmp->fetch($objp->fk_entrepot); - print $warehousetmp->getNomUrl(1); + if ($objp->fk_entrepot > 0) + { + $warehousetmp->fetch($objp->fk_entrepot); + print $warehousetmp->getNomUrl(1); + } print ''.$objp->batch.''.dol_print_date($db->jdate($objp->eatby), 'day').'
'.$langs->trans("LocationSummary").'
'.$langs->trans("Description").''; + print '
'.$langs->trans("Description").''; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('desc',(!empty($object->description)?$object->description:''),'',180,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,5,70); @@ -270,7 +270,7 @@ else print '
'.$langs->trans("LocationSummary").''.$object->lieu.'
'.$langs->trans("Description").''.nl2br($object->description).'
'.$langs->trans("Description").''.nl2br($object->description).'
'.$langs->trans('Address').''; @@ -298,17 +298,17 @@ else $calcproducts=$object->nb_products(); // Total nb of different products - print '
'.$langs->trans("NumberOfDifferentProducts").''; + print '
'.$langs->trans("NumberOfDifferentProducts").''; print empty($calcproductsunique['nb'])?'0':$calcproductsunique['nb']; print "
'.$langs->trans("NumberOfProducts").''; + print '
'.$langs->trans("NumberOfProducts").''; print empty($calcproducts['nb'])?'0':$calcproducts['nb']; print "
'.$langs->trans("EstimatedStockValueShort").''; + print '
'.$langs->trans("EstimatedStockValueShort").''; print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency); print "
'.$langs->trans("LastMovement").''; + print '
'.$langs->trans("LastMovement").''; if ($lastmovementdate) { print dol_print_date($lastmovementdate,'dayhour').' '; @@ -529,10 +529,10 @@ else // Ref print '
'.$langs->trans("Ref").'
'.$langs->trans("LocationSummary").'
'.$langs->trans("LocationSummary").'
'.$langs->trans("Description").''; + print '
'.$langs->trans("Description").''; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('desc',$object->description,'',180,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,5,70); @@ -551,12 +551,12 @@ else print '
'.$langs->trans('Country').''; + print '
'.$langs->trans('Country').''; print $form->select_country($object->country_id?$object->country_id:$mysoc->country_code,'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.$langs->trans("Status").''; + print '
'.$langs->trans("Status").''; print ''; print ""; print ''; print "'; -print "'; +print $langs->trans("Warehouse").':'; print "
'.$langs->trans("Search").'
"; -print $langs->trans("Ref").':
".$langs->trans("Other").':

"; $sql = "SELECT e.label, e.rowid, e.statut"; diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 833e285f608..4801dff3af0 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -48,6 +48,17 @@ $offset = $limit * $page; $year = strftime("%Y",time()); +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'e.label'=>"Ref", + 'e.lieu'=>"LocationSummary", + 'e.description'=>"Description", + 'e.address'=>"Address", + 'e.zip'=>'Zip', + 'e.town'=>'Town', +); + + /* * View @@ -62,11 +73,10 @@ $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON e.rowid = ps.fk_entrepot"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid"; $sql.= " WHERE e.entity IN (".getEntity('stock', 1).")"; - if ($search_ref) $sql.= natural_search("e.label", $search_ref); // ref if ($search_label) $sql.= natural_search("e.lieu", $search_label); // label if ($search_status != '' && $search_status >= 0) $sql.= " AND e.statut = ".$search_status; -if ($sall) $sql.= natural_search(array('e.label','e.description','e.lieu','e.address','e.town'), $sall); +if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); $sql.= " GROUP BY e.rowid, e.label, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays"; $totalnboflines=0; $result=$db->query($sql); @@ -95,7 +105,15 @@ if ($result) print ''; print ''; - print ''; + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); + } + + $moreforfilter=''; + + print '
'; print ""; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"], "e.label","","","",$sortfield,$sortorder); diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php index d57baeab088..13ab22c0466 100644 --- a/htdocs/projet/stats/index.php +++ b/htdocs/projet/stats/index.php @@ -283,7 +283,7 @@ print ''; // User /*print '
'.$langs->tra print '
'.$langs->trans("ThirdParty").''; if ($mode == 'customer') $filter='s.client in (1,2,3)'; if ($mode == 'supplier') $filter='s.fournisseur = 1'; -print $form->select_company($socid,'socid',$filter,1); +print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"'); print '
'.$langs->trans("ProjectCommercial").''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 536801716dd..1179494de8c 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1031,6 +1031,12 @@ form#login { } .login_main_message { text-align: center; + max-width: 560px; + margin-bottom: 10px; +} +.login_main_message .error { + border: 1px solid #caa; + padding: 10px; } div#login_left, div#login_right { display: inline-block; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index e69d36232b2..6f76a9b4d49 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1077,6 +1077,12 @@ form#login { } .login_main_message { text-align: center; + max-width: 560px; + margin-bottom: 10px; +} +.login_main_message .error { + border: 1px solid #caa; + padding: 10px; } div#login_left, div#login_right { display: inline-block; diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 43666f5b0bd..6f5e79b9d60 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -235,7 +235,7 @@ if ($action == 'create') print ''; print ""; - print ''; + print ''; print ''; // Multicompany @@ -253,7 +253,7 @@ if ($action == 'create') } } - print "".'".'
'.$langs->trans("Name").''.$langs->trans("Name").'
'.$langs->trans("Description").''; + print "
'.$langs->trans("Description").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('note','','',240,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,ROWS_8,90); $doleditor->Create(); @@ -310,14 +310,14 @@ else print ''; // Ref - print ''; + print ''; print ''; print ''; // Name - print ''; + print ''; print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index c6c18d9a87b..199041551c5 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -100,14 +100,14 @@ dol_fiche_head($head, 'ldap', $langs->trans("Group"), 0, 'group'); print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").''; print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); print '
'.$langs->trans("Name").'
'.$langs->trans("Name").''.$object->name; if (empty($object->entity)) { @@ -335,7 +335,7 @@ else } // Note - print '
'.$langs->trans("Description").'
'.$langs->trans("Description").''.dol_htmlentitiesbr($object->note).' 
'; // Ref -print ''; +print ''; print ''; print ''; // Name -print ''; +print ''; print '\n"; // Note -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 11e08988de6..9ffda5e96c8 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -191,14 +191,14 @@ if ($id) print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").''; print $form->showrefnav($fgroup,'id','',$canreadperms); print '
'.$langs->trans("Name").'
'.$langs->trans("Name").''.$fgroup->name; if (!$fgroup->entity) { @@ -116,7 +116,7 @@ if (!$fgroup->entity) print "
'.$langs->trans("Note").'
'.$langs->trans("Note").''.nl2br($fgroup->note).' 
'; // Ref - print ''; + print ''; print ''; print ''; // Nom - print ''; + print ''; print '\n"; // Note - print ''; + print ''; print ''; print "\n";
'.$langs->trans("Ref").'
'.$langs->trans("Ref").''; print $form->showrefnav($fgroup,'id','',$user->rights->user->user->lire || $user->admin); print '
'.$langs->trans("Name").'
'.$langs->trans("Name").''.$fgroup->name.''; if (! $fgroup->entity) { @@ -207,7 +207,7 @@ if ($id) print "
'.$langs->trans("Note").'
'.$langs->trans("Note").''.dol_htmlentitiesbr($fgroup->note).'