diff --git a/README.md b/README.md index 2cfe4138d62..54fdf1e958b 100644 --- a/README.md +++ b/README.md @@ -154,18 +154,18 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) ### Other application/modules -- Electronic Document Management (EDM) +- Electronic Document Management (EDM) - Bookmarks management - Reporting - Data export/import -- Barcodes +- Barcodes - Margin calculations - LDAP connectivity - ClickToDial integration - Mass emailing - RSS integration - Skype integration -- Social platforms linking +- Social platforms linking - Payment platforms integration (PayPal, Stripe, Paybox...) - Email-Collector @@ -179,14 +179,11 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Multi-Users and groups with finely grained rights - Multi-Currency - Multi-Company (by adding of an external module) - - Very user friendly and easy to use - customizable Dashboard - Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one) - - APIs (REST, SOAP) - Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture) - - Support a lot of country specific features: - Spanish Tax RE and ISPF - French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM) @@ -197,7 +194,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Compatible with European GDPR rules - ... - Flexible PDF & ODT generation for invoices, proposals, orders... -- … +- ... ### System Environment / Requirements diff --git a/SECURITY.md b/SECURITY.md index 61f4a392db8..427b1cc7ae2 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -54,12 +54,12 @@ ONLY vulnerabilities discovered, when the following setup on test platform is us * $dolibarr_main_prod must be set to 1 into conf.php * $dolibarr_nocsrfcheck must be kept to the value 0 into conf.php (this is the default value) * $dolibarr_main_force_https must be set to something else than 0. -* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 2 into backoffice menu Home - Setup - Other (this protection should be set to 2 soon by default) +* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 3 into backoffice menu Home - Setup - Other (this protection should be set to 3 soon by default) * The module DebugBar and ModuleBuilder must NOT be enabled (by default, these modules are not enabled. They are developer tools) * ONLY security reports on modules provided by default and with the "stable" status are valid (troubles into "experimental", "developement" or external modules are not valid vulnerabilities). * The root of web server must link to htdocs and the documents directory must be outside of the web server root (this is the default when using the default installer but may differs with external installer). * The web server setup must be done so only the documents directory is in write mode. The root directory called htdocs must be readonly. -* CSRF attacks are accepted when using a POST URL, but when using GET URL, they are validated only for creating, updating or deleting data resctricted from pages restricted to admin users. +* CSRF attacks are accepted but double check that you have set MAIN_SECURITY_CSRF_WITH_TOKEN to value 3. * Ability for a high level user to edit web site pages into the CMS by including HTML or Javascript is an expected feature. Vulnerabilities into the website module are validated only if HTML or Javascript injection can be done by a non allowed user. Scope is the web application (back office) and the APIs. diff --git a/dev/initdemo/mysqldump_dolibarr_14.0.0.sql b/dev/initdemo/mysqldump_dolibarr_14.0.0.sql index 4061fb9f4cf..e619c2c8fda 100644 --- a/dev/initdemo/mysqldump_dolibarr_14.0.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_14.0.0.sql @@ -2056,7 +2056,7 @@ CREATE TABLE `llx_c_holiday_types` ( `label` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `affect` int(11) NOT NULL, `delay` int(11) NOT NULL, - `newByMonth` double(8,5) NOT NULL DEFAULT 0.00000, + `newbymonth` double(8,5) NOT NULL DEFAULT 0.00000, `fk_country` int(11) DEFAULT NULL, `active` int(11) DEFAULT 1, PRIMARY KEY (`rowid`), diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 9596cd96af8..a842c294937 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -186,12 +186,28 @@ if ($action == 'update') { $msg .= '
'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'
'.$sql.'
'; $ko++; } else { - $db->begin(); - + $sql = ''; if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."product_perentity (fk_product, entity, '".$db->escape($accountancy_field_name)."')"; - $sql .= " VALUES (".((int) $productid).", ".((int) $conf->entity).", '".$db->escape($accounting->account_number)."')"; - $sql .= " ON DUPLICATE KEY UPDATE ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'"; + $sql_exists = "SELECT rowid FROM " . MAIN_DB_PREFIX . "product_perentity"; + $sql_exists .= " WHERE fk_product = " . ((int) $productid) . " AND entity = " . ((int) $conf->entity); + $resql_exists = $db->query($sql_exists); + if (!$resql_exists) { + $msg .= '
'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'
'.$resql_exists.'
'; + $ko++; + } else { + $nb_exists = $db->num_rows($resql_exists); + if ($nb_exists <= 0) { + // insert + $sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_perentity (fk_product, entity, '" . $db->escape($accountancy_field_name) . "')"; + $sql .= " VALUES (" . ((int) $productid) . ", " . ((int) $conf->entity) . ", '" . $db->escape($accounting->account_number) . "')"; + } else { + $obj_exists = $db->fetch_object($resql_exists); + // update + $sql = "UPDATE " . MAIN_DB_PREFIX . "product_perentity"; + $sql .= " SET " . $accountancy_field_name . " = '" . $db->escape($accounting->account_number) . "'"; + $sql .= " WHERE rowid = " . ((int) $obj_exists->rowid); + } + } } else { $sql = " UPDATE ".MAIN_DB_PREFIX."product"; $sql .= " SET ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'"; @@ -199,6 +215,9 @@ if ($action == 'update') { } dol_syslog("/accountancy/admin/productaccount.php", LOG_DEBUG); + + $db->begin(); + if ($db->query($sql)) { $ok++; $db->commit(); diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index dd96ff7dbbd..0cdecb3645f 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1012,7 +1012,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (count($listetype)) { print $form->selectarray("typeid", $listetype, (GETPOST('typeid', 'int') ? GETPOST('typeid', 'int') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', '', 1); } else { - print ''.$langs->trans("NoTypeDefinedGoToSetup").''; + print ''.$langs->trans("NoTypeDefinedGoToSetup").''; } print "\n"; @@ -1997,7 +1997,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; if ($isinspip == -1) { - print '

'.$langs->trans('SPIPConnectionFailed').': '.$mailmanspip->error.''; + print '

'.$langs->trans('SPIPConnectionFailed').': '.$mailmanspip->error.''; } diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index d714e3d9a32..983e6d9aada 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -190,7 +190,7 @@ if ($result > 0) { if (empty($dn)) { $langs->load("errors"); - print ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Member")).''; + print ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Member")).''; } else { $records = $ldap->getAttribute($dn, $search); @@ -199,7 +199,7 @@ if ($result > 0) { // Show tree if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) { if (!is_array($records)) { - print ''.$langs->trans("ErrorFailedToReadLDAP").''; + print ''.$langs->trans("ErrorFailedToReadLDAP").''; } else { $result = show_ldap_content($records, 0, $records['count'], true); } diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 26a45271801..c51fa86cec6 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -670,7 +670,7 @@ if ($rowid > 0) { print '
'; if ($object->statut > 0) { - print '
'.$langs->trans("AddSubscription")."
"; + print '
'.$langs->trans("AddSubscription")."
"; } else { print '
'.$langs->trans("AddSubscription").'
'; } diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 6a294b0256a..97307ffe23f 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -318,6 +318,19 @@ if (!$rowid && $action != 'create' && $action != 'edit') { print ""; $i++; } + + // If no record found + if ($num == 0) { + /*$colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + }*/ + $colspan = 8; + print ''.$langs->trans("NoRecordFound").''; + } + print ""; print '
'; diff --git a/htdocs/adherents/type_ldap.php b/htdocs/adherents/type_ldap.php index a695f84bb81..f932b65e98c 100644 --- a/htdocs/adherents/type_ldap.php +++ b/htdocs/adherents/type_ldap.php @@ -161,7 +161,7 @@ if ($result > 0) { // Show tree if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) { if (!is_array($records)) { - print ''.$langs->trans("ErrorFailedToReadLDAP").''; + print ''.$langs->trans("ErrorFailedToReadLDAP").''; } else { $result = show_ldap_content($records, 0, $records['count'], true); } diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index c7bd40efa37..5be2b3d6eea 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -91,7 +91,7 @@ $form = new Form($db); $formother = new FormOther($db); $formcompany = new FormCompany($db); -$countrynotdefined = ''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; +$countrynotdefined = ''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; print ''.$langs->trans("AccountantDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 5b48301c30d..c370c07b73b 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -302,7 +302,7 @@ if (!isset($_SERVER['WINDIR'])) { print ''; if (!empty($conf->global->GENBARCODE_LOCATION) && !@file_exists($conf->global->GENBARCODE_LOCATION)) { $langs->load("errors"); - print '
'.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).''; + print '
'.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).''; } print ''; } diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 2e4226e89d5..afcba2ef23d 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -360,7 +360,7 @@ foreach ($boxtoadd as $box) { print ''."\n"; } if (!count($boxtoadd) && count($boxactivated)) { - print ''.$langs->trans("AllWidgetsWereEnabled").''; + print ''.$langs->trans("AllWidgetsWereEnabled").''; } print ''."\n"; print ''; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 5e0ab61c3ee..5cffc0257e1 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -369,7 +369,7 @@ $form = new Form($db); $formother = new FormOther($db); $formcompany = new FormCompany($db); -$countrynotdefined = ''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; +$countrynotdefined = ''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup'); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 9073c9e238c..d0a699ef979 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -223,7 +223,7 @@ $tabsql[24] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFI $tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity('c_type_container').")"; //$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, picto, active FROM ".MAIN_DB_PREFIX."c_stcomm"; -$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[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"; $tabsql[30] = "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards"; //$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s"; @@ -315,7 +315,7 @@ $tabfield[24] = "code,label"; $tabfield[25] = "code,label"; //$tabfield[26]= "code,label,short_label"; $tabfield[27] = "code,libelle,picto"; -$tabfield[28] = "code,label,affect,delay,newByMonth,country_id,country"; +$tabfield[28] = "code,label,affect,delay,newbymonth,country_id,country"; $tabfield[29] = "code,label,percent,position"; $tabfield[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; //$tabfield[31]= "pcg_version,label"; @@ -361,7 +361,7 @@ $tabfieldvalue[24] = "code,label"; $tabfieldvalue[25] = "code,label"; //$tabfieldvalue[26]= "code,label,short_label"; $tabfieldvalue[27] = "code,libelle,picto"; -$tabfieldvalue[28] = "code,label,affect,delay,newByMonth,country"; +$tabfieldvalue[28] = "code,label,affect,delay,newbymonth,country"; $tabfieldvalue[29] = "code,label,percent,position"; $tabfieldvalue[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; //$tabfieldvalue[31]= "pcg_version,label"; @@ -407,7 +407,7 @@ $tabfieldinsert[24] = "code,label"; $tabfieldinsert[25] = "code,label"; //$tabfieldinsert[26]= "code,label,short_label"; $tabfieldinsert[27] = "code,libelle,picto"; -$tabfieldinsert[28] = "code,label,affect,delay,newByMonth,fk_country"; +$tabfieldinsert[28] = "code,label,affect,delay,newbymonth,fk_country"; $tabfieldinsert[29] = "code,label,percent,position"; $tabfieldinsert[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; //$tabfieldinsert[31]= "pcg_version,label"; @@ -548,7 +548,7 @@ $tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[25] = array('code'=>$langs->trans('EnterAnyCode')); //$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp")); -$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"), '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")); $tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize")); //$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode")); @@ -1175,6 +1175,8 @@ if ($id) { $sql .= natural_search("r.code_region", $search_code); } elseif ($search_code != '' && $id == 7) { $sql .= natural_search("a.code", $search_code); + } elseif ($search_code != '' && $id == 10) { + $sql .= natural_search("t.code", $search_code); } elseif ($search_code != '' && $id != 9) { $sql .= natural_search("code", $search_code); } @@ -1392,7 +1394,7 @@ if ($id) { if ($value == 'delay') { $valuetoshow = $langs->trans("NoticePeriod"); } - if ($value == 'newByMonth') { + if ($value == 'newbymonth') { $valuetoshow = $langs->trans("NewByMonth"); } if ($value == 'fk_tva') { @@ -1737,7 +1739,7 @@ if ($id) { if ($value == 'delay') { $valuetoshow = $langs->trans("NoticePeriod"); } - if ($value == 'newByMonth') { + if ($value == 'newbymonth') { $valuetoshow = $langs->trans("NewByMonth"); } if ($value == 'fk_tva') { diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php index adaf82d6964..5a23133923e 100644 --- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php +++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php @@ -232,7 +232,7 @@ class PrestaShopWebservice if ($response != '') { libxml_clear_errors(); libxml_use_internal_errors(true); - $xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA); + $xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET); if (libxml_get_errors()) { $msg = var_export(libxml_get_errors(), true); libxml_clear_errors(); diff --git a/htdocs/admin/eventorganization_confbooth_extrafields.php b/htdocs/admin/eventorganization_confbooth_extrafields.php index 6e19bde8268..991ed3f824a 100644 --- a/htdocs/admin/eventorganization_confbooth_extrafields.php +++ b/htdocs/admin/eventorganization_confbooth_extrafields.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/admin/eventorganization_extrafields.php + * \file htdocs/admin/eventorganization_confbooth_extrafields.php * \ingroup bom * \brief Page to setup extra fields of EventOrganization */ diff --git a/htdocs/admin/eventorganization_confboothattendee_extrafields.php b/htdocs/admin/eventorganization_confboothattendee_extrafields.php index 6b201e6b923..0b50c483d69 100644 --- a/htdocs/admin/eventorganization_confboothattendee_extrafields.php +++ b/htdocs/admin/eventorganization_confboothattendee_extrafields.php @@ -21,7 +21,7 @@ */ /** - * \file admin/conferenceorboothattendee_extrafields.php + * \file htdocs/admin/eventorganization_confboothattendee_extrafields.php * \ingroup eventorganization * \brief Page to setup extra fields of conferenceorboothattendee */ diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 8368c679b3c..e33c811c161 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -145,14 +145,18 @@ if ($action == 'updateMask') { $draft = GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha'); $res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); - if ($conf->projet->enabled) { - $projects = GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'); - $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', intval($projects), 'chaine', 0, '', $conf->entity); - } else { - $res3 = dolibarr_del_const($this->db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', $conf->entity); + $res3 = 0; + if (!empty($conf->projet->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided + $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity); } - if (!$res1 > 0 || !$res2 > 0 || !$res3 > 0) { + $dates = GETPOST('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', 'int'); + $res4 = dolibarr_set_const($db, 'EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', intval($dates), 'chaine', 0, '', $conf->entity); + + $amounts = GETPOST('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', 'int'); + $res5 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity); + + if (!($res1 > 0) || !($res2 > 0) || !($res3 > 0) || !($res4 >0) || !($res5 >0)) { $error++; } @@ -465,7 +469,7 @@ print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htm print ''; print ''."\n"; -if ($conf->projet->enabled) { +if (!empty($conf->projet->enabled)) { print ''; print $langs->trans('ProjectIsRequiredOnExpenseReports'); print ''; @@ -473,6 +477,18 @@ if ($conf->projet->enabled) { print ''; } +print ''; +print $langs->trans('PrefillExpenseReportDatesWithCurrentMonth'); +print ''; +print $form->selectyesno('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', empty($conf->global->EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH) ? 0 : 1, 1); +print ''; + +print ''; +print $langs->trans('ForceExpenseReportsLineAmountsIncludingTaxesOnly'); +print ''; +print $form->selectyesno('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY) ? 0 : 1, 1); +print ''; + print ''; print $form->buttonsSaveCancel("Save", ''); diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 85cd419d9ee..d0f08783e22 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -275,9 +275,9 @@ if ($resql) { print "".$langs->trans("Status").""; print ""; if ($result > 0 && empty($rss->error)) { - print ''.$langs->trans("Online").''; + print ''.$langs->trans("Online").''; } else { - print ''.$langs->trans("Offline"); + print ''.$langs->trans("Offline"); $langs->load("errors"); if ($rssparser->error) { print ' - '.$langs->trans($rssparser->error); diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 7dcc5a356b5..affedf1f43c 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -112,8 +112,8 @@ $reshook = $hookmanager->executeHooks('addHomeSetup', $parameters, $object, $act print $hookmanager->resPrint; if (empty($reshook)) { // Show into other - print ''.$langs->trans("SetupDescription5")."
"; - print "
"; + print ''.$langs->trans("SetupDescription5")."
"; + print '
'; // Show logo print '
'; diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php index 10f308b2b2c..8d93c16741a 100644 --- a/htdocs/admin/knowledgemanagement.php +++ b/htdocs/admin/knowledgemanagement.php @@ -17,7 +17,7 @@ */ /** - * \file knowledgemanagement/admin/setup.php + * \file htdocs/admin/knowledgemanagement.php * \ingroup knowledgemanagement * \brief KnowledgeManagement setup page. */ @@ -65,9 +65,7 @@ if (!$user->admin) { * Actions */ -if ((float) DOL_VERSION >= 6) { - include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; -} +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { $maskconstorder = GETPOST('maskconstorder', 'alpha'); diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 2317d63ab7f..4010d724c1a 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -1,10 +1,10 @@ - * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2017 Regis Houssin - * Copyright (C) 2006-2020 Laurent Destailleur - * Copyright (C) 2011-2013 Juanjo Menent +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005-2017 Regis Houssin + * Copyright (C) 2006-2020 Laurent Destailleur + * Copyright (C) 2011-2013 Juanjo Menent * * 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 @@ -153,7 +153,7 @@ $arraylist['dolibarr2ldap'] = $langs->trans("DolibarrToLDAP"); print $form->selectarray('activesynchro', $arraylist, $conf->global->LDAP_SYNCHRO_ACTIVE); print ''.$langs->trans("LDAPDnSynchroActiveExample").''; if ($conf->global->LDAP_SYNCHRO_ACTIVE && !$conf->global->LDAP_USER_DN) { - print '
'.$langs->trans("LDAPSetupNotComplete").''; + print '
'.$langs->trans("LDAPSetupNotComplete").''; } print ''; @@ -297,24 +297,24 @@ if (function_exists("ldap_connect")) { if ($result > 0) { // Test ldap connect and bind print img_picto('', 'info').' '; - print ''.$langs->trans("LDAPTCPConnectOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).''; + print ''.$langs->trans("LDAPTCPConnectOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).''; print '
'; if ($conf->global->LDAP_ADMIN_DN && !empty($conf->global->LDAP_ADMIN_PASS)) { if ($result == 2) { print img_picto('', 'info').' '; - print ''.$langs->trans("LDAPBindOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).''; + print ''.$langs->trans("LDAPBindOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).''; print '
'; } else { print img_picto('', 'error').' '; - print ''.$langs->trans("LDAPBindKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).''; + print ''.$langs->trans("LDAPBindKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).''; print '
'; print $langs->trans("Error").' '.$ldap->error; print '
'; } } else { print img_picto('', 'warning').' '; - print ''.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").''; + print ''.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").''; print '
'; } @@ -322,18 +322,18 @@ if (function_exists("ldap_connect")) { // Test ldap_getversion if (($ldap->getVersion() == 3)) { print img_picto('', 'info').' '; - print ''.$langs->trans("LDAPSetupForVersion3").''; + print ''.$langs->trans("LDAPSetupForVersion3").''; print '
'; } else { print img_picto('', 'info').' '; - print ''.$langs->trans("LDAPSetupForVersion2").''; + print ''.$langs->trans("LDAPSetupForVersion2").''; print '
'; } $unbind = $ldap->unbind(); } else { print img_picto('', 'error').' '; - print ''.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).''; + print ''.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).''; print '
'; print $langs->trans("Error").' '.$ldap->error; print '
'; diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 3be7d63759b..fef3882d2ff 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -321,12 +321,12 @@ if (function_exists("ldap_connect")) { if ($result2 > 0) { print img_picto('', 'info').' '; - print ''.$langs->trans("LDAPSynchroOK").'
'; + print ''.$langs->trans("LDAPSynchroOK").'
'; } else { print img_picto('', 'error').' '; - print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); + print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; - print '
'; + print '

'; print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } @@ -336,9 +336,9 @@ if (function_exists("ldap_connect")) { print "\n
"; } else { print img_picto('', 'error').' '; - print ''.$langs->trans("LDAPSynchroKO"); + print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; - print '
'; + print '

'; print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 7ba47fb8e3d..82ee85b9a20 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -260,12 +260,12 @@ if (function_exists("ldap_connect")) { if ($result2 > 0) { print img_picto('', 'info').' '; - print ''.$langs->trans("LDAPSynchroOK").'
'; + print ''.$langs->trans("LDAPSynchroOK").'
'; } else { print img_picto('', 'error').' '; - print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); + print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; - print '
'; + print '
'; print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } @@ -275,9 +275,9 @@ if (function_exists("ldap_connect")) { print "\n
"; } else { print img_picto('', 'error').' '; - print ''.$langs->trans("LDAPSynchroKO"); + print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; - print '
'; + print '
'; print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } @@ -331,9 +331,9 @@ if (function_exists("ldap_connect")) { print "\n
"; } else { print img_picto('', 'error').' '; - print ''.$langs->trans("LDAPSynchroKO"); + print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; - print '
'; + print '
'; print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index cda1700299c..876c31d79b1 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -472,12 +472,12 @@ if (function_exists("ldap_connect")) { if ($result2 > 0) { print img_picto('', 'info').' '; - print ''.$langs->trans("LDAPSynchroOK").'
'; + print ''.$langs->trans("LDAPSynchroOK").'
'; } else { print img_picto('', 'error').' '; - print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); + print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; - print '
'; + print '
'; print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } @@ -487,9 +487,9 @@ if (function_exists("ldap_connect")) { print "\n
"; } else { print img_picto('', 'error').' '; - print ''.$langs->trans("LDAPSynchroKO"); + print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; - print '
'; + print '
'; print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index 1fde587f21e..05572dc8bbf 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -223,12 +223,12 @@ if (function_exists("ldap_connect")) { if ($result2 > 0) { print img_picto('', 'info').' '; - print ''.$langs->trans("LDAPSynchroOK").'
'; + print ''.$langs->trans("LDAPSynchroOK").'
'; } else { print img_picto('', 'error').' '; - print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); + print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; - print '
'; + print '
'; print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } @@ -238,9 +238,9 @@ if (function_exists("ldap_connect")) { print "\n
"; } else { print img_picto('', 'error').' '; - print ''.$langs->trans("LDAPSynchroKO"); + print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; - print '
'; + print '
'; print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index ffb1e2ca90b..e6041650d63 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -444,12 +444,12 @@ if (function_exists("ldap_connect")) { if ($result2 > 0) { print img_picto('', 'info').' '; - print ''.$langs->trans("LDAPSynchroOK").'
'; + print ''.$langs->trans("LDAPSynchroOK").'
'; } else { print img_picto('', 'error').' '; - print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); + print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; - print '
'; + print '
'; print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } @@ -459,9 +459,9 @@ if (function_exists("ldap_connect")) { print "\n
"; } else { print img_picto('', 'error').' '; - print ''.$langs->trans("LDAPSynchroKO"); + print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; - print '
'; + print '
'; print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } @@ -530,9 +530,9 @@ if (function_exists("ldap_connect")) { print "\n
"; } else { print img_picto('', 'error').' '; - print ''.$langs->trans("LDAPSynchroKO"); + print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; - print '
'; + print '
'; print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index aaadde965a2..65906b83f3c 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -281,7 +281,7 @@ if ($action == 'create') { print load_fiche_titre($langs->trans("NewMenu"), '', 'title_setup'); - print '
'; + print ''; print ''; print dol_get_fiche_head(); diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 1f31dc639c3..9c2b91ec586 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -133,7 +133,7 @@ if ($action == 'install') { // $original_file should match format module_modulename-x.y[.z].zip $original_file = basename($_FILES["fileinstall"]["name"]); - $original_file = preg_replace('/\(\d+\)\.zip$/i', '.zip', $original_file); + $original_file = preg_replace('/\s*\(\d+\)\.zip$/i', '.zip', $original_file); $newfile = $conf->admin->dir_temp.'/'.$original_file.'/'.$original_file; if (!$original_file) { diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index ba7690bb6e3..997c71bb335 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -20,7 +20,7 @@ */ /** - * \file htdocs/admin/credtitransfer.php + * \file htdocs/admin/paymentbybanktransfer.php * \ingroup paymentbybanktransfer * \brief Page to setup payments by credit transfer */ @@ -429,7 +429,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) } - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index c11d5023e27..be45a2101f5 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -307,7 +307,7 @@ for ($i = 1; $i <= 6; $i++) { $pid = false; } } else { - $pid = img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; + $pid = img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; } if ($pid) { print ''; } else { print ''; if (!$i) { $totalarray['nbfield']++; @@ -1855,8 +1855,8 @@ if ($resql) { } // Town if (!empty($arrayfields['s.town']['checked'])) { - print ''; if (!$i) { $totalarray['nbfield']++; @@ -1865,7 +1865,7 @@ if ($resql) { // Zip if (!empty($arrayfields['s.zip']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -1873,7 +1873,7 @@ if ($resql) { } // State if (!empty($arrayfields['state.nom']['checked'])) { - print "\n"; + print "\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1936,7 +1936,7 @@ if ($resql) { // Module Source if (!empty($arrayfields['f.module_source']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -1946,7 +1946,7 @@ if ($resql) { // POS Terminal if (!empty($arrayfields['f.pos_source']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index ca7cd08a6fe..b0109d69fe5 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -206,6 +206,7 @@ if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { print ''; - print ''; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) { print ''; } print ''; + print ''; + print ''; + print ''; $total_ttc += $obj->total_ttc; @@ -706,7 +711,7 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user print "\n"; } - print ''; + print ''; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) { print ''; } diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index 25763dd8339..009f99fccf1 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -48,7 +48,7 @@ $result = restrictedArea($user, 'paymentbybanktransfer', '', ''); * Actions */ - +// None /* @@ -166,7 +166,7 @@ if ($resql) { $i++; } } else { - print ''; + print ''; } print "
'.$langs->trans("ShowProfIdInAddress").' - '.$pid.''; diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 8f4c0c6f763..d2f0d79e4f3 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -236,7 +236,7 @@ if ($result) { print ''; - print ''; + print ''; //print img_edit_add(); print img_picto('', 'switch_off'); print ''; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 90a75626e7c..e09dd13b045 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -443,7 +443,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) } - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index d6b6d6e428a..05abf8c3995 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -183,7 +183,7 @@ if ($action == 'edit') { if (count($listofmethods)) { print $form->selectarray('MAIN_SMS_SENDMODE', $listofmethods, $conf->global->MAIN_SMS_SENDMODE, 1); } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print ''; diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 16e5da99f60..cfc12375050 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -51,7 +51,7 @@ if ($action == 'getlastversion') { $result = getURLContent('https://sourceforge.net/projects/dolibarr/rss'); //var_dump($result['content']); if (function_exists('simplexml_load_string')) { - $sfurl = simplexml_load_string($result['content']); + $sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET); } else { setEventMessages($langs->trans("ErrorPHPDoesNotSupport", "xml"), null, 'errors'); } diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 272ac8d8f19..5ca87663c7a 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -171,7 +171,7 @@ if (GETPOST('target') == 'remote') { if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') { $xmlfile = $xmlarray['content']; //print "xmlfilestart".$xmlfile."xmlfileend"; - $xml = simplexml_load_string($xmlfile); + $xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET); } else { $errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg']; setEventMessages($errormsg, null, 'errors'); diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 150ca10a359..a56ed8c1da3 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -91,6 +91,7 @@ $modules_files = array(); $modules_fullpath = array(); $modulesdir = dolGetModulesDirs(); $rights_ids = array(); +$arrayofpermissions = array(); foreach ($modulesdir as $dir) { $handle = @opendir(dol_osencode($dir)); @@ -155,7 +156,7 @@ foreach ($modules as $key => $module) { if (empty($rights[0])) { continue; } - + $arrayofpermissions[$rights[0]] = array('label'=> 'user->rights->'.$module->rights_class.'->'.$rights[4].(empty($rights[5]) ? '' : '->'.$rights[5])); $permission[] = $rights[0]; array_push($rights_ids, $rights[0]); @@ -336,8 +337,10 @@ foreach ($moduleList as $module) { $idperms = ''; foreach ($module->permission as $permission) { - $idperms .= ($idperms ? ", " : "").$permission; $translationKey = "Permission".$permission; + $labelpermission = $langs->trans($translationKey); + $labelpermission .= ' : '.$arrayofpermissions[$permission]['label']; + $idperms .= ($idperms ? ", " : "").''.$permission.''; if (!empty($conf->global->MAIN_SHOW_PERMISSION)) { if (empty($langs->tab_translate[$translationKey])) { diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index 758a93a765d..bbfa4b85c41 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -63,7 +63,7 @@ print '
'; print ''.$langs->trans("XDebug").': '; $test = !function_exists('xdebug_is_enabled'); if ($test) { - print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis"); + print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' '.$langs->trans("NotSlowedDownByThis").''; } else { print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug")); print ' - '.$langs->trans("MoreInformation").' XDebug admin page'; diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 818f096c99e..b0614c7501d 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -258,6 +258,8 @@ print '
'; print '$dolibarr_nocsrfcheck: '.(empty($dolibarr_nocsrfcheck) ? '0' : $dolibarr_nocsrfcheck); if (!empty($dolibarr_nocsrfcheck)) { print '   '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 0); +} else { + print '   ('.$langs->trans("Recommended").': 0)'; } print '
'; @@ -442,7 +444,7 @@ print '
'; print 'MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': 1)' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."
"; print '
'; -print 'MAIN_SECURITY_CSRF_WITH_TOKEN = '.(empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': 1)' : $conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)."
"; +print 'MAIN_SECURITY_CSRF_WITH_TOKEN = '.(empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': 2)' : $conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)."
"; print '
'; print 'MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL = '.(empty($conf->global->MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)' : $conf->global->MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL)."
"; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 4f6977ffb41..ec363ad112d 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -513,7 +513,7 @@ if (!empty($_SESSION["commandbackuplastdone"])) { $_SESSION["commandbackupresult"] = ''; } if (!empty($_SESSION["commandbackuptorun"])) { - print '
'.$langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser", $dolibarr_main_db_user, $dolibarr_main_db_user).':
'."\n"; + print '
'.$langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser", $dolibarr_main_db_user, $dolibarr_main_db_user).':
'."\n"; print '
'."\n"; print ajax_autoselect("commandbackuptoruntext", 0); print '
'; diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index f246a9eb0b2..f6ce58a40c0 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -110,7 +110,7 @@ if (!empty($conf->syslog->enabled)) { print '

'; +print '>

'; print 'trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg']; throw new RestException(500, $errormsg); diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index 4ebbe832dc5..be76a00099c 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -274,7 +274,7 @@ if ($conf->product->enabled || $conf->product->service) { } else { $disabled = 1; $titleno = $langs->trans("NoBarcodeNumberingTemplateDefined"); - print ''.$langs->trans("NoBarcodeNumberingTemplateDefined").' ('.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").')
'; + print ''.$langs->trans("NoBarcodeNumberingTemplateDefined").' ('.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").')
'; } if (empty($nbno)) { $disabled1 = 1; diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 06c3caae43c..5c014b6206f 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -231,7 +231,7 @@ if ($object->id) { // On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites if (!$obj['photo_vignette'] && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i', $obj['photo']) && ($object->imgWidth > $maxWidth || $object->imgHeight > $maxHeight)) { - print ''.img_picto($langs->trans('GenerateThumb'), 'refresh').'  '; + print ''.img_picto($langs->trans('GenerateThumb'), 'refresh').'  '; } if ($user->rights->categorie->creer) { print ''; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index a4c06b65d1f..4a7128fa865 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -865,6 +865,7 @@ class ActionComm extends CommonObject $this->fetchResources(); } } + $this->db->free($resql); } else { $this->error = $this->db->lasterror(); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index c9f422d78c8..c8ec0621394 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -351,7 +351,7 @@ if ($object->id > 0) { print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client)); $tmpcheck = $object->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongCustomerCode").')'; + print ' ('.$langs->trans("WrongCustomerCode").')'; } print ''; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 2ed56683c02..614bedb8268 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -912,7 +912,7 @@ if ($action == 'create') { } } if (empty($nbemail)) { - $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").''; + $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").''; } if ($text) { print $form->textwithpicto($nbemail, $text, 1, 'warning'); @@ -1161,7 +1161,7 @@ if ($action == 'create') { } } if (empty($nbemail)) { - $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").''; + $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").''; } if ($text) { print $form->textwithpicto($nbemail, $text, 1, 'warning'); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 3283957f8a2..340ac1dfc8c 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -284,7 +284,7 @@ if ($object->fetch($id) >= 0) { } } if (empty($nbemail)) { - $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").''; + $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").''; } if ($text) { print $form->textwithpicto($nbemail, $text, 1, 'warning'); @@ -378,7 +378,7 @@ if ($object->fetch($id) >= 0) { $var = !$var; if ($allowaddtarget) { - print ''; + print ''; print ''; } else { print '
'; diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 01abc1e5ef1..66860669e2d 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -184,7 +184,7 @@ if ($result) { $i++; } } else { - print '
'; + print ''; } print "
'.$langs->trans("None").'
'.$langs->trans("None").'

"; $db->free($result); diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index f6a03c1d11d..eabe47e54ca 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -932,10 +932,10 @@ if ($resql) { $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.urlencode($search_account).'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)), '', $user->rights->banque->modifier); } else // If direct entries is not done using miscellaneous payments { - $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', $user->rights->banque->modifier); + $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&token='.newToken().'&page='.$page.$param, '', $user->rights->banque->modifier); } } else { - $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', -1); + $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&token='.newToken().'&page='.$page.$param, '', -1); } } diff --git a/htdocs/compta/facture/index.php b/htdocs/compta/facture/index.php index d3d3a33acb5..790b9d334c3 100644 --- a/htdocs/compta/facture/index.php +++ b/htdocs/compta/facture/index.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/compat/facture/index.php + * \file htdocs/compta/facture/index.php * \ingroup facture * \brief Home page of customer invoices area */ diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index b2074224412..852589dbd1a 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1846,8 +1846,8 @@ if ($resql) { } // Alias if (!empty($arrayfields['s.name_alias']['checked'])) { - print '
'; - print $obj->name_alias; + print ''; + print dol_escape_htmltag($obj->name_alias); print ''; - print $obj->town; + print ''; + print dol_escape_htmltag($obj->town); print ''; - print $obj->zip; + print dol_escape_htmltag($obj->zip); print '".$obj->state_name."".dol_escape_htmltag($obj->state_name)."'; - print $obj->module_source; + print dol_escape_htmltag($obj->module_source); print ''; - print $obj->pos_source; + print dol_escape_htmltag($obj->pos_source); print ''; print ''; + print ''; @@ -222,15 +223,19 @@ if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { print '
'; print $tmpinvoice->getNomUrl(1, ''); print '
'; print '
'; + + print ''; print $thirdpartystatic->getNomUrl(1, 'customer', 44); print ''.price($obj->total_ht).''.price($obj->total_ttc).''.dol_print_date($db->jdate($obj->tms), 'day').''.$tmpinvoice->getLibStatut(3, $obj->am).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToBill").': '.price($tot_tobill).') '.price($tot_ht).'
'.$langs->trans("NoSupplierInvoiceToWithdraw", $langs->transnoentitiesnoconv("BankTransfer")).'
'.$langs->trans("NoSupplierInvoiceToWithdraw", $langs->transnoentitiesnoconv("BankTransfer")).'

"; } else { @@ -223,7 +223,7 @@ if ($result) { $i++; } } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print "
"; diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 58cfe5be72d..a2de75123a0 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -33,11 +33,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page $langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawals')); -// Security check -if ($user->socid > 0) { - accessforbidden(); -} - // Get supervariables $action = GETPOST('action', 'aZ09'); $id = GETPOST('id', 'int'); @@ -71,11 +66,11 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ $hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist')); -if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') { - accessforbidden(); -} -if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') { - accessforbidden(); +$type = $object->type; +if ($type == 'bank-transfer') { + $result = restrictedArea($user, 'paymentbybanktransfer', '', '', ''); +} else { + $result = restrictedArea($user, 'prelevement', '', '', 'bons'); } diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index fe074bcb9d0..03dfd0288bd 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -39,12 +39,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies', 'bills')); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'prelevement', '', '', 'bons'); - $type = GETPOST('type', 'aZ09'); // Get supervariables @@ -63,6 +57,16 @@ $offset = $limit * $page; $hookmanager->initHooks(array('directdebitcreatecard', 'globalcard')); +// Security check +if ($user->socid) { + $socid = $user->socid; +} +if ($type == 'bank-transfer') { + $result = restrictedArea($user, 'paymentbybanktransfer', '', '', ''); +} else { + $result = restrictedArea($user, 'prelevement', '', '', 'bons'); +} + /* * Actions @@ -141,7 +145,11 @@ if (empty($reshook)) { } } $objectclass = "BonPrelevement"; - $uploaddir = $conf->prelevement->dir_output; + if ($type == 'bank-transfer') { + $uploaddir = $conf->paymentbybanktransfer->dir_output; + } else { + $uploaddir = $conf->prelevement->dir_output; + } include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 0230e4cb726..cb10e9248f1 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -37,10 +37,6 @@ $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies')); // Security check $socid = GETPOST('socid', 'int'); $status = GETPOST('status', 'int'); -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'prelevement', '', '', 'bons'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page @@ -73,6 +69,15 @@ $massactionbutton = ''; $hookmanager->initHooks(array('withdrawalstodolist')); +if ($user->socid) { + $socid = $user->socid; +} +if ($type == 'bank-transfer') { + $result = restrictedArea($user, 'paymentbybanktransfer', '', '', ''); +} else { + $result = restrictedArea($user, 'prelevement', '', '', 'bons'); +} + /* * Actions diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index a100cd9156f..067f76ed2c8 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -34,11 +34,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page $langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawals')); -// Securite acces client -if ($user->socid > 0) { - accessforbidden(); -} - // Get supervariables $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); @@ -70,11 +65,16 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ $hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist')); -if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') { +// Security check +if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') { - accessforbidden(); + +$type = $object->type; +if ($type == 'bank-transfer') { + $result = restrictedArea($user, 'paymentbybanktransfer', '', '', ''); +} else { + $result = restrictedArea($user, 'prelevement', '', '', 'bons'); } diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 9ff5970e656..febc4827a94 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -62,11 +62,16 @@ $object = new BonPrelevement($db); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals -if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') { +// Security check +if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') { - accessforbidden(); + +$type = $object->type; +if ($type == 'bank-transfer') { + $result = restrictedArea($user, 'paymentbybanktransfer', '', '', ''); +} else { + $result = restrictedArea($user, 'prelevement', '', '', 'bons'); } diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index 5833f417ddd..8255c537442 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -32,11 +32,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page $langs->loadLangs(array("banks", "categories", 'withdrawals', 'bills')); -// Security check -if ($user->socid > 0) { - accessforbidden(); -} - // Get supervariables $prev_id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); @@ -61,11 +56,16 @@ $object = new BonPrelevement($db); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals -if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') { +// Security check +if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') { - accessforbidden(); + +$type = $object->type; +if ($type == 'bank-transfer') { + $result = restrictedArea($user, 'paymentbybanktransfer', '', '', ''); +} else { + $result = restrictedArea($user, 'prelevement', '', '', 'bons'); } diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index c0f89a7e046..93f2305c60f 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -41,14 +41,14 @@ $socid = GETPOST('socid', 'int'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'prelevement', '', ''); +$result = restrictedArea($user, 'prelevement', '', 'bons'); /* * Actions */ - +// None /* @@ -225,7 +225,7 @@ if ($result) { $i++; } } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print "
"; diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index a82da74ab48..38ea2fb1d52 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -35,11 +35,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page $langs->loadlangs(array('banks', 'categories', 'bills', 'withdrawals')); -// Security check -if ($user->socid > 0) { - accessforbidden(); -} - // Get supervariables $action = GETPOST('action', 'aZ09'); $id = GETPOST('id', 'int'); @@ -66,6 +61,13 @@ if ($sortfield == "") { $sortfield = "pl.fk_soc"; } +$type = $object->type; +if ($type == 'bank-transfer') { + $result = restrictedArea($user, 'paymentbybanktransfer', '', '', ''); +} else { + $result = restrictedArea($user, 'prelevement', '', '', 'bons'); +} + /* * Actions diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index feb69bdc7fb..ae92286dfec 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -42,13 +42,6 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'di $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -// Security check -$socid = GETPOST('socid', 'int'); -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'prelevement', '', '', 'bons'); - $type = GETPOST('type', 'aZ09'); $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; @@ -80,6 +73,17 @@ $company = new Societe($db); $hookmanager->initHooks(array('withdrawalsreceiptslineslist')); +// Security check +$socid = GETPOST('socid', 'int'); +if ($user->socid) { + $socid = $user->socid; +} +if ($type == 'bank-transfer') { + $result = restrictedArea($user, 'paymentbybanktransfer', '', '', ''); +} else { + $result = restrictedArea($user, 'prelevement', '', '', 'bons'); +} + /* * Actions @@ -274,7 +278,7 @@ if ($result) { $i++; } } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print ""; print ''; diff --git a/htdocs/compta/prelevement/orders_list.php b/htdocs/compta/prelevement/orders_list.php index 3ca9ce32fbe..be7c72907fd 100644 --- a/htdocs/compta/prelevement/orders_list.php +++ b/htdocs/compta/prelevement/orders_list.php @@ -33,13 +33,6 @@ $langs->loadLangs(array('banks', 'categories', 'withdrawals')); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlist'; // To manage different context of search -// Security check -$socid = GETPOST('socid', 'int'); -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'prelevement', '', '', 'bons'); - $type = GETPOST('type', 'aZ09'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -72,6 +65,17 @@ if ($type == 'bank-transfer') { $usercancreate = $user->rights->paymentbybanktransfer->create; } +// Security check +$socid = GETPOST('socid', 'int'); +if ($user->socid) { + $socid = $user->socid; +} +if ($type == 'bank-transfer') { + $result = restrictedArea($user, 'paymentbybanktransfer', '', '', ''); +} else { + $result = restrictedArea($user, 'prelevement', '', '', 'bons'); +} + /* * Actions @@ -137,15 +141,15 @@ if ($result) { $newcardbutton = ''; if ($usercancreate) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php'); + $newcardbutton .= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php?type='.urlencode($type)); } // Lines of title fields print ''; + print ''; if ($optioncss != '') { print ''; } - print ''; print ''; print ''; print ''; @@ -217,7 +221,7 @@ if ($result) { $i++; } } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print ""; diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index ed8c704bcfa..029d5dd8598 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -33,13 +33,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies')); -// Security check -$socid = GETPOST('socid', 'int'); -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'prelevement', '', '', 'bons'); - $type = GETPOST('type', 'aZ09'); // Get supervariables @@ -54,6 +47,17 @@ $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; +// Security check +$socid = GETPOST('socid', 'int'); +if ($user->socid) { + $socid = $user->socid; +} +if ($type == 'bank-transfer') { + $result = restrictedArea($user, 'paymentbybanktransfer', '', '', ''); +} else { + $result = restrictedArea($user, 'prelevement', '', '', 'bons'); +} + /* * View @@ -140,7 +144,7 @@ if ($result) { $i++; } } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print ""; diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index ae1dd54a13c..9c30db6e08a 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -31,14 +31,18 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies')); +$type = GETPOST('type', 'aZ09'); + // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'prelevement', '', '', 'bons'); - -$type = GETPOST('type', 'aZ09'); +if ($type == 'bank-transfer') { + $result = restrictedArea($user, 'paymentbybanktransfer', '', '', ''); +} else { + $result = restrictedArea($user, 'prelevement', '', '', 'bons'); +} /* diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index e03010cb5a5..1aecac97f19 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -165,7 +165,8 @@ class Contact extends CommonObject /** * @var int Thirdparty ID */ - public $socid; + public $socid; // both socid and fk_soc are used + public $fk_soc; // both socid and fk_soc are used /** * @var int 0=inactive, 1=active @@ -1027,7 +1028,8 @@ class Contact extends CommonObject $this->country_code = $obj->country_id ? $obj->country_code : ''; $this->country = $obj->country_id ? ($langs->trans('Country'.$obj->country_code) != 'Country'.$obj->country_code ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : ''; - $this->socid = $obj->fk_soc; + $this->fk_soc = $obj->fk_soc; // Both fk_soc and socid are used + $this->socid = $obj->fk_soc; // Both fk_soc and socid are used $this->socname = $obj->socname; $this->poste = $obj->poste; $this->statut = $obj->statut; diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 974bfb15e77..bb610baa4b0 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -645,7 +645,7 @@ if ($sql_select) { print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, '', $sortfield, $sortorder, 'right '); print "\n"; - print ''.$langs->trans("SelectElementAndClick", $langs->transnoentitiesnoconv("Search")).''; + print ''.$langs->trans("SelectElementAndClick", $langs->transnoentitiesnoconv("Search")).''; print ""; } else { @@ -653,7 +653,7 @@ if ($sql_select) { print ''."\n"; - print ''; + print ''; print "
'.$langs->trans("FeatureNotYetAvailable").'
'.$langs->trans("FeatureNotYetAvailable").'
"; } diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index 79696d12997..8babb849e7e 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -173,7 +173,7 @@ if ($result > 0) { // Show tree if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) { if (!is_array($records)) { - print ''.$langs->trans("ErrorFailedToReadLDAP").''; + print ''.$langs->trans("ErrorFailedToReadLDAP").''; } else { $result = show_ldap_content($records, 0, $records['count'], true); } diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index 4e2165d6f38..c813e8af4a0 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -102,12 +102,12 @@ if ($action == 'builddoc' && $permissiontoadd) { if (empty($donotredirect)) { // This is set when include is done by bulk action "Bill Orders" setEventMessages($langs->trans("FileGenerated"), null); - $urltoredirect = $_SERVER['REQUEST_URI']; + /*$urltoredirect = $_SERVER['REQUEST_URI']; $urltoredirect = preg_replace('/#builddoc$/', '', $urltoredirect); $urltoredirect = preg_replace('/action=builddoc&?/', '', $urltoredirect); // To avoid infinite loop header('Location: '.$urltoredirect.'#builddoc'); - exit; + exit;*/ } } } diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 810a23957fd..a3da2812067 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -334,7 +334,7 @@ if ($type == 'directory') { $textifempty = $langs->trans('NoFileFound'); } elseif ($section === '0') { if ($module == 'ecm') { - $textifempty = '
'.$langs->trans("DirNotSynchronizedSyncFirst").'

'; + $textifempty = '
'.$langs->trans("DirNotSynchronizedSyncFirst").'

'; } else { $textifempty = $langs->trans('NoFileFound'); } diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 9a0a11f04d4..d63726dcea6 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -283,7 +283,7 @@ if (empty($conf->use_javascript_ajax) || !empty($conf->global->MAIN_ECM_DISABLE_ print ''; print ''; if ($nbofsubdir && $nboffilesinsubdir) { - print '+'.$nboffilesinsubdir.' '; + print '+'.$nboffilesinsubdir.' '; } print ''; @@ -439,7 +439,7 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, print ''; print ''; if ($nbofsubdir > 0 && $nboffilesinsubdir > 0) { - print '+'.$nboffilesinsubdir.' '; + print '+'.$nboffilesinsubdir.' '; } print ''; diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 3f75ee30d02..7183605ae10 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -220,6 +220,7 @@ abstract class CommonDocGenerator // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Define array with couple substitution key => substitution value + * For example {company_name}, {company_name_alias} * * @param Societe $object Object * @param Translate $outputlangs Language object for output diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index faf2ab18d2c..f63081660d6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5324,7 +5324,7 @@ abstract class CommonObject $ecmfile->gen_or_uploaded = 'generated'; $ecmfile->description = ''; // indexed content $ecmfile->keywords = ''; // keyword content - $ecmfile->src_object_type = $this->table_element; + $ecmfile->src_object_type = $this->table_element.(empty($this->module) ? '' : '@'.$this->module); $ecmfile->src_object_id = $this->id; $result = $ecmfile->create($user); @@ -7808,7 +7808,7 @@ abstract class CommonObject $out .= $labeltoshow; } if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) { - $out .= ' *'; + $out .= ' *'; } } else { if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) { @@ -8220,7 +8220,7 @@ abstract class CommonObject $return .= '
'; // On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites if ($photo_vignette && (image_format_supported($photo) > 0) && ($this->imgWidth > $maxWidth || $this->imgHeight > $maxHeight)) { - $return .= ''.img_picto($langs->trans('GenerateThumb'), 'refresh').'  '; + $return .= ''.img_picto($langs->trans('GenerateThumb'), 'refresh').'  '; } // Special cas for product if ($modulepart == 'product' && ($user->rights->produit->creer || $user->rights->service->creer)) { @@ -9405,6 +9405,11 @@ abstract class CommonObject */ public function setCategoriesCommon($categories, $type_categ = '', $remove_existing = true) { + // Handle single category + if (!is_array($categories)) { + $categories = array($categories); + } + dol_syslog(get_class($this)."::setCategoriesCommon Oject Id:".$this->id.' type_categ:'.$type_categ.' nb tag add:'.count($categories), LOG_DEBUG); require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; @@ -9414,11 +9419,6 @@ abstract class CommonObject return -1; } - // Handle single category - if (!is_array($categories)) { - $categories = array($categories); - } - // Get current categories $c = new Categorie($this->db); $existing = $c->containing($this->id, $type_categ, 'id'); diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 8e43a70c3fe..ee91d67b9ce 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -624,14 +624,15 @@ class Conf if (!empty($this->global->MAILING_EMAIL_FROM)) { $this->mailing->email_from = $this->global->MAILING_EMAIL_FROM; } - if (!isset($this->global->MAIN_EMAIL_ADD_TRACK_ID)) { - $this->global->MAIN_EMAIL_ADD_TRACK_ID = 1; - } if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { $this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1; } + if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) { + $this->global->MAIN_FIX_FOR_BUGGED_MTA = 1; + } + // Format for date (used by default when not found or not searched in lang) $this->format_date_short = "%d/%m/%Y"; // Format of day with PHP/C tags (strftime functions) $this->format_date_short_java = "dd/MM/yyyy"; // Format of day with Java tags @@ -828,7 +829,10 @@ class Conf // Enable by default the CSRF protection by token. if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) { - $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 1; // Value 2 uses also CSRF check for all GET requests + // Value 1 makes CSRF check for all POST parameters only + // Value 2 makes also CSRF check for GET requests with action = a sensitive requests like action=del, action=remove... + // Value 3 makes also CSRF check for all GET requests with a param action or massaction + $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 1; // Note: Set MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL=1 to have a renewal of token at each page call instead of each session (not recommended) } diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index a1725526898..e4a91d903df 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -741,7 +741,7 @@ class DolGraph /** * Build a graph using JFlot library. Input when calling this method should be: * $this->data = array(array(0=>'labelxA',1=>yA), array('labelxB',yB)); - * $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // or when there is n series to show for each x + * $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // when there is n series to show for each x * $this->data = array(array('label'=>'labelxA','data'=>yA), array('labelxB',yB)); // Syntax deprecated * $this->legend= array("Val1",...,"Valn"); // list of n series name * $this->type = array('bars',...'lines','linesnopoint'); or array('pie') or array('polar') @@ -1028,7 +1028,7 @@ class DolGraph /** * Build a graph using Chart library. Input when calling this method should be: * $this->data = array(array(0=>'labelxA',1=>yA), array('labelxB',yB)); - * $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // or when there is n series to show for each x + * $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // when there is n series to show for each x * $this->data = array(array('label'=>'labelxA','data'=>yA), array('labelxB',yB)); // Syntax deprecated * $this->legend= array("Val1",...,"Valn"); // list of n series name * $this->type = array('bars',...'lines', 'linesnopoint'); or array('pie') or array('polar') or array('piesemicircle'); @@ -1303,6 +1303,8 @@ class DolGraph $this->stringtoshow .= 'var options = { maintainAspectRatio: false, aspectRatio: 2.5, '; if (empty($showlegend)) { $this->stringtoshow .= 'legend: { display: false }, '; + } else { + $this->stringtoshow .= 'legend: { position: \'' . ($showlegend == 2 ? 'right' : 'top') . '\' },'; } $this->stringtoshow .= 'scales: { xAxes: [{ '; if ($this->hideXValues) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8deda2ecd09..99b2c3521c6 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -791,7 +791,7 @@ class Form // Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button $ret .= ''; // Hidden button BEFORE so it is the one used when we submit with ENTER. - $ret .= 'use_javascript_ajax) ? '' : ' style="display: none"').' class="button'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">'; + $ret .= 'use_javascript_ajax) ? '' : ' style="display: none"').' class="button small'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">'; $ret .= ''; if (!empty($conf->use_javascript_ajax)) { @@ -1680,11 +1680,6 @@ class Form if ($resql) { $num = $this->db->num_rows($resql); - if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) { - include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; - $out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT")); - } - if ($htmlname != 'none' && !$options_only) { $out .= ''; } + if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; + $out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT")); + } + $this->num = $num; return $out; } else { @@ -5783,11 +5783,11 @@ class Form return $num; } else { - $this->error = ''.$langs->trans("ErrorNoVATRateDefinedForSellerCountry", $country_code).''; + $this->error = ''.$langs->trans("ErrorNoVATRateDefinedForSellerCountry", $country_code).''; return -1; } } else { - $this->error = ''.$this->db->error().''; + $this->error = ''.$this->db->error().''; return -2; } } @@ -5838,9 +5838,9 @@ class Form // Check parameters if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) { if ($societe_vendeuse->id == $mysoc->id) { - $return .= ''.$langs->trans("ErrorYourCountryIsNotDefined").''; + $return .= ''.$langs->trans("ErrorYourCountryIsNotDefined").''; } else { - $return .= ''.$langs->trans("ErrorSupplierCountryIsNotDefined").''; + $return .= ''.$langs->trans("ErrorSupplierCountryIsNotDefined").''; } return $return; } @@ -7923,7 +7923,7 @@ class Form } if (!$nboftypesoutput) { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print ''; @@ -8789,8 +8789,8 @@ class Form public function showFilterButtons() { $out = '
'; - $out .= ''; - $out .= ''; + $out .= ''; + $out .= ''; $out .= '
'; return $out; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index f25a6e0933c..0d1d838aad4 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -393,6 +393,38 @@ class FormFile global $langs, $conf, $user, $hookmanager; global $form; + $reshook = 0; + if (is_object($hookmanager)) { + $parameters = array( + 'modulepart'=>&$modulepart, + 'modulesubdir'=>&$modulesubdir, + 'filedir'=>&$filedir, + 'urlsource'=>&$urlsource, + 'genallowed'=>&$genallowed, + 'delallowed'=>&$delallowed, + 'modelselected'=>&$modelselected, + 'allowgenifempty'=>&$allowgenifempty, + 'forcenomultilang'=>&$forcenomultilang, + 'noform'=>&$noform, + 'param'=>&$param, + 'title'=>&$title, + 'buttonlabel'=>&$buttonlabel, + 'codelang'=>&$codelang, + 'morepicto'=>&$morepicto, + 'hideifempty'=>&$hideifempty, + 'removeaction'=>&$removeaction + ); + $reshook = $hookmanager->executeHooks('showDocuments', $parameters, $object); // Note that parameters may have been updated by hook + // May report error + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + } + // Remode default action if $reskook > 0 + if ($reshook > 0) { + return $hookmanager->resPrint; + } + if (!is_object($form)) { $form = new Form($this->db); } @@ -702,9 +734,10 @@ class FormFile $urlsource .= '#'.$forname.'_form'; // So we switch to form after a generation } if (empty($noform)) { - $out .= ''; + $out .= ''; } $out .= ''; + $out .= ''; $out .= ''; $out .= load_fiche_titre($titletoshow, '', ''); @@ -754,7 +787,7 @@ class FormFile } // Button - $genbutton = ''.img_picto($langs->trans("Delete"), 'delete').''; } if ($printer) { - //$out.= ''; - $out .= ''.img_picto($langs->trans("PrintFile", $relativepath), 'printer.png').''; } @@ -959,7 +992,7 @@ class FormFile } if (count($file_list) == 0 && count($link_list) == 0 && $headershown) { - $out .= ''.$langs->trans("None").''."\n"; + $out .= ''.$langs->trans("None").''."\n"; } } @@ -1674,7 +1707,8 @@ class FormFile dol_include_once($hookmanager->resArray['classpath']); if (array_key_exists('classname', $hookmanager->resArray) && !empty($hookmanager->resArray['classname'])) { if (class_exists($hookmanager->resArray['classname'])) { - $object_instance = new ${$hookmanager->resArray['classname']}($this->db); + $tmpclassname = $hookmanager->resArray['classname']; + $object_instance = new $tmpclassname($this->db); } } } @@ -1813,9 +1847,11 @@ class FormFile print ''; // File + // Check if document source has external module part, if it the case use it for module part on document.php + preg_match('/^[^@]*@([^@]*)$/', $modulepart.'@expertisemedical', $modulesuffix); print ''; //print "XX".$file['name']; //$file['name'] must be utf8 - print 'getDocumentsLink($modulepart, $modulesubdir, $filedir, '^'.preg_quote($file['name'],'/').'$'); - print $this->showPreview($file, $modulepart, $file['relativename']); + print $this->showPreview($file, (empty($modulesuffix) ? $modulepart : $modulesuffix[1]), $file['relativename']); print "\n"; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 8c30d42075f..99ee1b6af9b 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -863,9 +863,9 @@ class FormOther } }, function(color, context) { console.log("close"); }, - function(color, context) { var hex = color.val(\'hex\'); console.log("new color selected in jpicker "+hex);'; + function(color, context) { var hex = color.val(\'hex\'); console.log("new color selected in jpicker "+hex+" setpropertyonselect='.dol_escape_js($setpropertyonselect).'");'; if ($setpropertyonselect) { - $out .= ' if (hex != null) document.documentElement.style.setProperty(\'--'.$setpropertyonselect.'\', \'#\'+hex);'; + $out .= ' if (hex != null) document.documentElement.style.setProperty(\'--'.dol_escape_js($setpropertyonselect).'\', \'#\'+hex);'; } $out .= '}, function(color, context) { console.log("cancel"); } diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index 0ce9cae7b4e..60811956c32 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -178,7 +178,7 @@ function limitChars(textarea, limit, infodiv) } else { if ($this->fromtype) { $langs->load("errors"); - print ' <'.$langs->trans("ErrorNoPhoneDefinedForThisUser").'> '; + print ' <'.$langs->trans("ErrorNoPhoneDefinedForThisUser").'> '; } } print "\n"; diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 6a8a91dbb05..c3c434d1aed 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -240,7 +240,7 @@ class RssParser if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) { //print 'xx'.LIBXML_NOCDATA; libxml_use_internal_errors(false); - $rss = simplexml_load_string($str, "SimpleXMLElement", LIBXML_NOCDATA); + $rss = simplexml_load_string($str, "SimpleXMLElement", LIBXML_NOCDATA|LIBXML_NOCDATA); } else { if (!function_exists('xml_parser_create')) { $this->error = 'Function xml_parser_create are not supported by your PHP'; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 0adcb967991..efea4c54b09 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -724,7 +724,7 @@ function getFormeJuridiqueLabel($code) function getCountriesInEEC() { // List of all country codes that are in europe for european vat rules - // List found on http://ec.europa.eu/taxation_customs/common/faq/faq_1179_en.htm#9 + // List found on https://ec.europa.eu/taxation_customs/territorial-status-eu-countries-and-certain-territories_en global $conf, $db; $country_code_in_EEC = array(); diff --git a/htdocs/core/lib/eventorganization.lib.php b/htdocs/core/lib/eventorganization.lib.php index 2f8ea573c1f..51ff1f2a90f 100644 --- a/htdocs/core/lib/eventorganization.lib.php +++ b/htdocs/core/lib/eventorganization.lib.php @@ -16,7 +16,7 @@ */ /** - * \file eventorganization/lib/eventorganization.lib.php + * \file htdocs/core/lib/eventorganization.lib.php * \ingroup eventorganization * \brief Library files with common functions for EventOrganization */ diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ef7f320f049..897b248824f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3732,7 +3732,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'action'=>'infobox-action', 'account'=>'infobox-bank_account', 'accountline'=>'infobox-bank_account', 'accountancy'=>'infobox-bank_account', 'asset'=>'infobox-bank_account', 'bank_account'=>'bg-infobox-bank_account', 'bill'=>'infobox-commande', 'billa'=>'infobox-commande', 'billr'=>'infobox-commande', 'billd'=>'infobox-commande', - 'conferenceorbooth'=>'infobox-project', + 'margin'=>'infobox-bank_account', 'conferenceorbooth'=>'infobox-project', 'cash-register'=>'infobox-bank_account', 'contract'=>'infobox-contrat', 'check'=>'font-status4', 'collab'=>'infobox-action', 'conversation'=>'infobox-contrat', 'donation'=>'infobox-commande', 'dolly'=>'infobox-commande', 'dollyrevert'=>'flip infobox-order_supplier', 'ecm'=>'infobox-action', 'eventorganization'=>'infobox-project', @@ -6156,7 +6156,7 @@ function yn($yesno, $case = 1, $color = 0) } } if ($color) { - return ''.$result.''; + return ''.$result.''; } return $result; } diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 28b56efb20d..e18ec3e3678 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -480,7 +480,8 @@ function getNumberInvoicesPieChart($mode) date_add($datenowadd30, $interval30days); date_add($datenowadd15, $interval15days); - $sql = "SELECT sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub30, 'Y-m-d')."'", 1, 0).") as nblate30"; + $sql = "SELECT"; + $sql .= " sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub30, 'Y-m-d')."'", 1, 0).") as nblate30"; $sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub15, 'Y-m-d')."'", 1, 0).") as nblate15"; $sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($now, 'Y-m-d')."'", 1, 0).") as nblatenow"; $sql .= ", sum(".$db->ifsql("f.date_lim_reglement >= '".date_format($now, 'Y-m-d')."'", 1, 0).") as nbnotlatenow"; @@ -508,24 +509,26 @@ function getNumberInvoicesPieChart($mode) while ($i < $num) { $obj = $db->fetch_object($resql); - $dataseries = array(array($langs->trans('InvoiceLate30Days'), $obj->nblate30) + /*$dataseries = array(array($langs->trans('InvoiceLate30Days'), $obj->nblate30) ,array($langs->trans('InvoiceLate15Days'), $obj->nblate15 - $obj->nblate30) ,array($langs->trans('InvoiceLateMinus15Days'), $obj->nblatenow - $obj->nblate15) ,array($langs->trans('InvoiceNotLate'), $obj->nbnotlatenow - $obj->nbnotlate15) ,array($langs->trans('InvoiceNotLate15Days'), $obj->nbnotlate15 - $obj->nbnotlate30) - ,array($langs->trans('InvoiceNotLate30Days'), $obj->nbnotlate30)); + ,array($langs->trans('InvoiceNotLate30Days'), $obj->nbnotlate30));*/ + $dataseries[0]=array($langs->trans('NbOfOpenInvoices'), $obj->nblate30, $obj->nblate15 - $obj->nblate30, $obj->nblatenow - $obj->nblate15, $obj->nbnotlatenow - $obj->nbnotlate15, $obj->nbnotlate15 - $obj->nbnotlate30, $obj->nbnotlate30); $i++; } foreach ($dataseries as $key=>$value) { $total += $value[1]; } + $legend = array($langs->trans('InvoiceLate30Days'), $langs->trans('InvoiceLate15Days'), $langs->trans('InvoiceLateMinus15Days'), $langs->trans('InvoiceNotLate'), $langs->trans('InvoiceNotLate15Days'), $langs->trans('InvoiceNotLate30Days')); $colorseries = array($badgeStatus8, $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus11, '-'.$badgeStatus11); $result = '
'; $result .= ''; $result .= ''; - $result .= ''; if ($conf->use_javascript_ajax) { + //var_dump($dataseries); $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); + + $dolgraph->setLegend($legend); + $dolgraph->SetDataColor(array_values($colorseries)); $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); - $dolgraph->SetType(['pie']); - $dolgraph->setHeight('150'); - $dolgraph->setWidth('300'); + $dolgraph->SetType(array('bars', 'bars', 'bars', 'bars', 'bars', 'bars')); + $dolgraph->setHeight('160'); + $dolgraph->setWidth('400'); + $dolgraph->setHideXValues(true); if ($mode == 'customers') { $dolgraph->draw('idgraphcustomerinvoices'); } elseif ($mode == 'fourn' || $mode == 'suppliers') { @@ -1218,7 +1226,7 @@ function getCustomerInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) print "\n"; } - print ''; + print ''; print ''; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) { print ''; @@ -1383,7 +1391,7 @@ function getPurchaseInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) print "\n"; } - print ''; + print ''; print ''; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) { print ''; diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 4621e22d122..390961f5db2 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -224,7 +224,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag } if ($type == 'free') { - $out = $urltouse.'/public/payment/newpayment.php?amount='.($mode ? '' : '').$amount.($mode ? '' : '').'&tag='.($mode ? '' : '').$freetag.($mode ? '' : ''); + $out = $urltouse.'/public/payment/newpayment.php?amount='.($mode ? '' : '').$amount.($mode ? '' : '').'&tag='.($mode ? '' : '').$freetag.($mode ? '' : ''); if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { $out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); @@ -234,120 +234,120 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag } //if ($mode) $out.='&noidempotency=1'; } elseif ($type == 'order') { - $out = $urltouse.'/public/payment/newpayment.php?source=order&ref='.($mode ? '' : ''); + $out = $urltouse.'/public/payment/newpayment.php?source=order&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= 'order_ref'; } if ($mode == 0) { $out .= urlencode($ref); } - $out .= ($mode ? '' : ''); + $out .= ($mode ? '' : ''); if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { $out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } else { - $out .= '&securekey='.($mode ? '' : ''); + $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) { $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + order_ref)"; } if ($mode == 0) { $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); } - $out .= ($mode ? '' : ''); + $out .= ($mode ? '' : ''); } } } elseif ($type == 'invoice') { - $out = $urltouse.'/public/payment/newpayment.php?source=invoice&ref='.($mode ? '' : ''); + $out = $urltouse.'/public/payment/newpayment.php?source=invoice&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= 'invoice_ref'; } if ($mode == 0) { $out .= urlencode($ref); } - $out .= ($mode ? '' : ''); + $out .= ($mode ? '' : ''); if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { $out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } else { - $out .= '&securekey='.($mode ? '' : ''); + $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) { $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + invoice_ref)"; } if ($mode == 0) { $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); } - $out .= ($mode ? '' : ''); + $out .= ($mode ? '' : ''); } } } elseif ($type == 'contractline') { - $out = $urltouse.'/public/payment/newpayment.php?source=contractline&ref='.($mode ? '' : ''); + $out = $urltouse.'/public/payment/newpayment.php?source=contractline&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= 'contractline_ref'; } if ($mode == 0) { $out .= urlencode($ref); } - $out .= ($mode ? '' : ''); + $out .= ($mode ? '' : ''); if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { $out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } else { - $out .= '&securekey='.($mode ? '' : ''); + $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) { $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + contractline_ref)"; } if ($mode == 0) { $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); } - $out .= ($mode ? '' : ''); + $out .= ($mode ? '' : ''); } } } elseif ($type == 'member' || $type == 'membersubscription') { $newtype = 'member'; - $out = $urltouse.'/public/payment/newpayment.php?source=member&ref='.($mode ? '' : ''); + $out = $urltouse.'/public/payment/newpayment.php?source=member&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= 'member_ref'; } if ($mode == 0) { $out .= urlencode($ref); } - $out .= ($mode ? '' : ''); + $out .= ($mode ? '' : ''); if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { $out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } else { - $out .= '&securekey='.($mode ? '' : ''); + $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) { $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$newtype."' + member_ref)"; } if ($mode == 0) { $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$newtype.$ref, 2); } - $out .= ($mode ? '' : ''); + $out .= ($mode ? '' : ''); } } } if ($type == 'donation') { - $out = $urltouse.'/public/payment/newpayment.php?source=donation&ref='.($mode ? '' : ''); + $out = $urltouse.'/public/payment/newpayment.php?source=donation&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= 'donation_ref'; } if ($mode == 0) { $out .= urlencode($ref); } - $out .= ($mode ? '' : ''); + $out .= ($mode ? '' : ''); if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { $out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } else { - $out .= '&securekey='.($mode ? '' : ''); + $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) { $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + donation_ref)"; } if ($mode == 0) { $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); } - $out .= ($mode ? '' : ''); + $out .= ($mode ? '' : ''); } } } @@ -450,7 +450,7 @@ function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0, } } - print '

'."\n"; + print '

'."\n"; print $fromcompany->name.'
'; print $line1; if (strlen($line1.$line2) > 50) { @@ -459,5 +459,5 @@ function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0, print ' - '; } print $line2; - print '
'."\n"; + print ''."\n"; } diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index c2257cd20fe..a2c08977b37 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -49,7 +49,7 @@ function pdf_admin_prepare_head() $head = array(); $head[$h][0] = DOL_URL_ROOT.'/admin/pdf.php'; - $head[$h][1] = $langs->trans("Common"); + $head[$h][1] = $langs->trans("Parameters"); $head[$h][2] = 'general'; $h++; @@ -2240,6 +2240,7 @@ function pdf_getTotalQty($object, $type, $outputlangs) if (!empty($object->lines[$i]->fk_parent_line)) { $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); } + $hidedetails = ''; $parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code); $action = ''; $reshook = $hookmanager->executeHooks('pdf_getTotalQty', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index da5d9388bd8..be804dc184c 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -853,7 +853,7 @@ function accessforbidden($message = '', $printheader = 1, $printfooter = 1, $sho print $hookmanager->resPrint; if (empty($reshook)) { if ($user->login) { - print $langs->trans("CurrentLogin").': '.$user->login.'
'; + print $langs->trans("CurrentLogin").': '.$user->login.'
'; print $langs->trans("ErrorForbidden2", $langs->transnoentitiesnoconv("Home"), $langs->transnoentitiesnoconv("Users")); } else { print $langs->trans("ErrorForbidden3"); diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index 82f446f04c7..bcb430dac41 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -63,16 +63,16 @@ function getOnlineSignatureUrl($mode, $type, $ref = '') $out = ''; if ($type == 'proposal') { - $out = DOL_MAIN_URL_ROOT.'/public/onlinesign/newonlinesign.php?source=proposal&ref='.($mode ? '' : ''); + $out = DOL_MAIN_URL_ROOT.'/public/onlinesign/newonlinesign.php?source=proposal&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= 'proposal_ref'; } if ($mode == 0) { $out .= urlencode($ref); } - $out .= ($mode ? '' : ''); + $out .= ($mode ? '' : ''); if ($mode == 1) { - $out .= '&hashp=hash_of_file'; + $out .= '&hashp=hash_of_file'; } else { include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $propaltmp = new Propal($db); diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 7a9bb12172b..84b0ada3487 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -339,7 +339,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) $thumbsbyrow = 6; print '
'; - print '
'.$langs->trans("Statistics").' - '; + $result .= ''.$langs->trans("NbOfOpenInvoices").' - '; if ($mode == 'customers') { $result .= $langs->trans("CustomerInvoice"); } elseif ($mode == 'fourn' || $mode == 'suppliers') { @@ -537,14 +540,19 @@ function getNumberInvoicesPieChart($mode) $result .= '
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToTake").': '.price($total_ttc - $totalam).')
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToTake").': '.price($total_ttc - $totalam).')  '.price($total).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToPay").': '.price($total_ttc - $totalam).')
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToPay").': '.price($total_ttc - $totalam).')  '.price($total).'
'; + print '
'; // Title if ($foruserprofile) { @@ -400,7 +400,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if (!file_exists($file)) { $url = DOL_URL_ROOT.'/public/theme/common/nophoto.png'; } - print ''; + print ''; if ($subdir == $conf->global->MAIN_THEME) { $title = $langs->trans("ThemeCurrentlyActive"); } else { diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index b191e24b117..6504cfa27a6 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -546,7 +546,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t print ''."\n"; $lastlevel0 = 'enabled'; } elseif ($showmenu) { // Not enabled but visible (so greyed) - print ''."\n"; + print ''."\n"; $lastlevel0 = 'greyed'; } else { $lastlevel0 = 'hidden'; @@ -582,7 +582,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t } print ''."\n"; } elseif ($showmenu && $lastlevel0 == 'enabled') { // Not enabled but visible (so greyed), except if parent was not enabled. - print ''."\n"; + print ''."\n"; } } diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index 77725be2ae7..ebb5edc1c3b 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -309,7 +309,7 @@ class MenuManager print ''; } if ($val['enabled'] == 2) { - print ''.$val['titre'].''; + print ''.$val['titre'].''; } print ''; print ''."\n"; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 0f4aedcd2f9..1538d765014 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -2081,7 +2081,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM print ''."\n"; $lastlevel0 = 'enabled'; } elseif ($showmenu) { // Not enabled but visible (so greyed) - print ''."\n"; + print ''."\n"; $lastlevel0 = 'greyed'; } else { $lastlevel0 = 'hidden'; @@ -2122,7 +2122,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Not enabled but visible (so greyed), except if parent was not enabled. print ''."\n"; + print ''.$menu_array[$i]['titre'].'
'."\n"; } } diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index a9817f3d1a5..35186e423ef 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -317,14 +317,14 @@ class MenuManager print ''; } if ($val['enabled'] == 2) { - print ''; + print ''; // Add font-awesome if ($val['level'] == 0 && !empty($val['prefix'])) { print $val['prefix']; } print $val['titre']; - print ''; + print ''; } print ''; print ''."\n"; diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index d1c222570cf..9a45a9b7fc2 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -320,7 +320,7 @@ class MenuManager print ''; } if ($val['enabled'] == 2) { - print ''.$val['titre'].''; + print ''.$val['titre'].''; } print ''; print ''."\n"; @@ -407,7 +407,7 @@ class MenuManager if ($menu_array[$i]['enabled']) { print '
'."\n"; } else { - print ''."\n"; + print ''."\n"; } print ''."\n"; } @@ -433,7 +433,7 @@ class MenuManager print ''; } } else { - print $tabstring.''.$menu_array[$i]['titre'].''; + print $tabstring.''.$menu_array[$i]['titre'].''; } // If title is not pure text and contains a table, no carriage return added diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index 2e1ab3b5ef4..08d31e3cd95 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -295,12 +295,14 @@ class doc_generic_bom_odt extends ModelePDFBom // Recipient name $contactobject = null; if (!empty($usecontact)) { - // On peut utiliser le nom de la societe du contact - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index adb26a38e0a..1e6aeac79e5 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -53,7 +53,8 @@ class doc_generic_order_odt extends ModelePDFCommandes public $phpmin = array(5, 6); /** - * @var string Dolibarr version of the loaded document + * Dolibarr version of the loaded document + * @var string */ public $version = 'dolibarr'; @@ -96,7 +97,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined @@ -234,6 +235,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $sav_charset_output = $outputlangs->charset_output; $outputlangs->charset_output = 'UTF-8'; + // Load translation files required by the page $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); if ($conf->commande->dir_output) { @@ -271,7 +273,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); $newfiletmp = $objectref.'_'.$newfiletmp; - //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; + // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { @@ -307,11 +309,14 @@ class doc_generic_order_odt extends ModelePDFCommandes // Recipient name $contactobject = null; if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { @@ -379,6 +384,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $array_other = $this->get_substitutionarray_other($outputlangs); // retrieve contact information for use in object as contact_xxx tags $array_thirdparty_contact = array(); + if ($usecontact && is_object($contactobject)) { $array_thirdparty_contact = $this->get_substitutionarray_contact($contactobject, $outputlangs, 'contact'); } @@ -455,7 +461,6 @@ class doc_generic_order_odt extends ModelePDFCommandes } // Call the beforeODTSave hook - $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); $reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index d45bab013e9..d83bf427ead 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1449,7 +1449,7 @@ class pdf_einstein extends ModelePDFCommandes } // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 52f96764473..01fde021cb0 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1634,7 +1634,7 @@ class pdf_eratosthene extends ModelePDFCommandes } //Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index b1e441175d9..a640d342ddc 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -295,11 +295,14 @@ class doc_generic_contract_odt extends ModelePDFContract // Recipient name $contactobject = null; if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 638c22221bd..69a4d5ce96e 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -720,7 +720,7 @@ class pdf_strato extends ModelePDFContract $this->recipient = $object->thirdparty; // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 2893234e719..9c549576818 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -860,7 +860,7 @@ class pdf_storm extends ModelePDFDeliveryOrder } // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 4656784f50d..19e319d0522 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -859,7 +859,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder } // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 5229645afe5..c504d97a854 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -307,11 +307,14 @@ class doc_generic_shipment_odt extends ModelePdfExpedition // Recipient name $contactobject = null; if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a SHIPPING contact and we dont use as recipient we store the contact object for later use + // if we have a SHIPPING contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 28d797acffc..cf8b03f1fea 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; - +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; /** * Class to build sending documents with model espadon @@ -1121,7 +1121,7 @@ class pdf_espadon extends ModelePdfExpedition } // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index f2434c93d26..56c8fb143fb 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -676,7 +676,7 @@ class pdf_merou extends ModelePdfExpedition } // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index aa6603fa35a..4b542e4e636 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -1071,7 +1071,7 @@ class pdf_rouget extends ModelePdfExpedition } // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index ec494302e93..ef20b4ff389 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -308,11 +308,14 @@ class doc_generic_invoice_odt extends ModelePDFFactures // Recipient name $contactobject = null; if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a BILLING contact and we dont use it as recipient we store the contact object for later use + // if we have a BILLING contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 0fe149af0df..037074bce23 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1927,7 +1927,7 @@ class pdf_crabe extends ModelePDFFactures } // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 021f195c577..b919b90abfd 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -2143,7 +2143,7 @@ class pdf_sponge extends ModelePDFFactures } // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 37d64c43e17..e23a0aa1701 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -674,7 +674,7 @@ class pdf_soleil extends ModelePDFFicheinter } // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php index 7b2af1e0032..6ba84727b3f 100644 --- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php +++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php @@ -295,11 +295,14 @@ class doc_generic_member_odt extends ModelePDFMember // Recipient name if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index b6ad4c6b8ff..c2d697b4a4d 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -302,11 +302,14 @@ class doc_generic_mo_odt extends ModelePDFMo // Recipient name $contactobject = null; if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index 05eef305c37..d702299769e 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -118,15 +118,10 @@ class doc_generic_product_odt extends ModelePDFProduct $form = new Form($this->db); $texte = $this->description.".
\n"; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; $texte .= ''; - if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) { - $texte .= ''; - $texte .= ''; - $texte .= ''; - } $texte .= '
'; // List of directories area @@ -165,35 +160,25 @@ class doc_generic_product_odt extends ModelePDFProduct $texte .= '
'; // Scan directories - if (count($listofdir)) { + $nbofiles = count($listoffiles); + if (!empty($conf->global->PRODUCT_ADDON_PDF_ODT_PATH)) { $texte .= $langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).''; - - /*if ($conf->global->MAIN_PRODUCT_CHOOSE_ODT_DOCUMENT > 0) - { - // Model for creation - $liste=ModelePDFProduct::liste_modeles($this->db); - $texte.= '
'; - $texte.= ''; - $texte.= ''; - $texte.= '"; - - $texte.= ''; - $texte.= ''; - $texte.= '"; - $texte.= ''; - - $texte.= ''; - $texte.= '"; - $texte.= '
'.$langs->trans("DefaultModelPropalCreate").''; - $texte.= $form->selectarray('value2',$liste,$conf->global->PRODUCT_ADDON_PDF_ODT_DEFAULT); - $texte.= "
'.$langs->trans("DefaultModelPropalToBill").''; - $texte.= $form->selectarray('value3',$liste,$conf->global->PRODUCT_ADDON_PDF_ODT_TOBILL); - $texte.= "
'.$langs->trans("DefaultModelPropalClosed").''; - $texte.= $form->selectarray('value4',$liste,$conf->global->PRODUCT_ADDON_PDF_ODT_CLOSED); - $texte.= "
'; - }*/ } + if ($nbofiles) { + $texte .= '
'; + // Show list of found files + foreach ($listoffiles as $file) { + $texte .= '- '.$file['name'].' '.img_picto('', 'listlight').'
'; + } + $texte .= '
'; + } + // Add input to upload a new template file. + $texte .= '
'.$langs->trans("UploadNewTemplate").' '; + $texte .= ''; + $texte .= ''; + $texte .= '
'; + $texte .= ''; $texte .= ''; @@ -319,11 +304,14 @@ class doc_generic_product_odt extends ModelePDFProduct // Recipient name $contactobject = null; if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { @@ -344,7 +332,7 @@ class doc_generic_product_odt extends ModelePDFProduct // Line of free text $newfreetext = ''; - $paramfreetext = 'product_FREE_TEXT'; + $paramfreetext = 'PRODUCT_FREE_TEXT'; if (!empty($conf->global->$paramfreetext)) { $newfreetext = make_substitutions($conf->global->$paramfreetext, $substitutionarray); } @@ -372,7 +360,6 @@ class doc_generic_product_odt extends ModelePDFProduct //print html_entity_decode($odfHandler->__toString()); //print exit; - $object->fetch_optionals(); // Make substitutions into odt of freetext try { @@ -399,7 +386,7 @@ class doc_generic_product_odt extends ModelePDFProduct complete_substitutions_array($tmparray, $outputlangs, $object); // Call the ODTSubstitution hook - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); + $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); $reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $value) { @@ -480,6 +467,7 @@ class doc_generic_product_odt extends ModelePDFProduct } } + $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); $reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if (!empty($conf->global->MAIN_UMASK)) { diff --git a/htdocs/core/modules/product_batch/mod_lot_free.php b/htdocs/core/modules/product_batch/mod_lot_free.php index 0f069143ab1..def14bd37b3 100644 --- a/htdocs/core/modules/product_batch/mod_lot_free.php +++ b/htdocs/core/modules/product_batch/mod_lot_free.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/core/modules/product/mod_lot_free.php + * \file htdocs/core/modules/product_batch/mod_lot_free.php * \ingroup productbatch * \brief File containing class for numbering model of Lot free */ diff --git a/htdocs/core/modules/product_batch/mod_sn_advanced.php b/htdocs/core/modules/product_batch/mod_sn_advanced.php index 5e8fde199c1..abe094220d2 100644 --- a/htdocs/core/modules/product_batch/mod_sn_advanced.php +++ b/htdocs/core/modules/product_batch/mod_sn_advanced.php @@ -22,7 +22,7 @@ */ /** - * \file htdocs/core/modules/product_batch/mod_batch_advanced.php + * \file htdocs/core/modules/product_batch/mod_sn_advanced.php * \ingroup productbatch * \brief File containing class for numbering model of SN advanced */ diff --git a/htdocs/core/modules/product_batch/mod_sn_free.php b/htdocs/core/modules/product_batch/mod_sn_free.php index 95e1bd20359..67d39ec085a 100644 --- a/htdocs/core/modules/product_batch/mod_sn_free.php +++ b/htdocs/core/modules/product_batch/mod_sn_free.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/core/modules/product/mod_sn_free.php + * \file htdocs/core/modules/product_batch/mod_sn_free.php * \ingroup productbatch * \brief File containing class for numbering model of SN free */ diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index bd2fcfa471f..fb0991c8da1 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -335,11 +335,14 @@ class doc_generic_proposal_odt extends ModelePDFPropales // Recipient name $contactobject = null; if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index bf079c47b66..e964d61cda3 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1616,7 +1616,7 @@ class pdf_azur extends ModelePDFPropales } // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 97f76df31bb..9dcccb92fdc 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1731,7 +1731,7 @@ class pdf_cyan extends ModelePDFPropales } // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 34d34ec3e19..4729231ac8b 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -62,8 +62,7 @@ class doc_generic_reception_odt extends ModelePdfReception { global $conf, $langs, $mysoc; - $langs->load("main"); - $langs->load("companies"); + $langs->loadLangs(array("main", "companies")); $this->db = $db; $this->name = "ODT templates"; @@ -173,6 +172,11 @@ class doc_generic_reception_odt extends ModelePdfReception } $texte .= '
'; } + // Add input to upload a new template file. + $texte .= '
'.$langs->trans("UploadNewTemplate").' '; + $texte .= ''; + $texte .= ''; + $texte .= '
'; $texte .= ''; @@ -223,10 +227,7 @@ class doc_generic_reception_odt extends ModelePdfReception $sav_charset_output = $outputlangs->charset_output; $outputlangs->charset_output = 'UTF-8'; - $outputlangs->load("main"); - $outputlangs->load("dict"); - $outputlangs->load("companies"); - $outputlangs->load("bills"); + $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); if ($conf->reception->dir_output."/reception") { // If $object is id instead of object @@ -288,21 +289,25 @@ class doc_generic_reception_odt extends ModelePdfReception return -1; } - // If BILLING contact defined on invoice, we use it + // If CUSTOMER contact defined on reception, we use it $usecontact = false; - $arrayidcontact = $object->getIdContact('external', 'BILLING'); + $arrayidcontact = $object->getIdContact('external', 'CUSTOMER'); if (count($arrayidcontact) > 0) { $usecontact = true; $result = $object->fetch_contact($arrayidcontact[0]); } // Recipient name + $contactobject = null; if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a BILLING contact and we dont use it as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { @@ -318,6 +323,7 @@ class doc_generic_reception_odt extends ModelePdfReception '__TOTAL_VAT__' => $object->total_tva ); complete_substitutions_array($substitutionarray, $langs, $object); + // Call the ODTSubstitution hook $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray); $reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks @@ -343,6 +349,7 @@ class doc_generic_reception_odt extends ModelePdfReception ); } catch (Exception $e) { $this->error = $e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } // After construction $odfHandler->contentXml contains content and @@ -359,67 +366,23 @@ class doc_generic_reception_odt extends ModelePdfReception dol_syslog($e->getMessage(), LOG_INFO); } - // Make substitutions into odt of user info - $tmparray = $this->get_substitutionarray_user($user, $outputlangs); - //var_dump($tmparray); exit; - foreach ($tmparray as $key => $value) { - try { - if (preg_match('/logo$/', $key)) { // Image - //var_dump($value);exit; - if (file_exists($value)) { - $odfHandler->setImage($key, $value); - } else { - $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); - } - } else // Text - { - $odfHandler->setVars($key, $value, true, 'UTF-8'); - } - } catch (OdfException $e) { - dol_syslog($e->getMessage(), LOG_INFO); - } + // Define substitution array + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); + $array_object_from_properties = $this->get_substitutionarray_each_var_object($object, $outputlangs); + $array_objet = $this->get_substitutionarray_object($object, $outputlangs); + $array_user = $this->get_substitutionarray_user($user, $outputlangs); + $array_soc = $this->get_substitutionarray_mysoc($mysoc, $outputlangs); + $array_thirdparty = $this->get_substitutionarray_thirdparty($socobject, $outputlangs); + $array_other = $this->get_substitutionarray_other($outputlangs); + // retrieve contact information for use in object as contact_xxx tags + $array_thirdparty_contact = array(); + if ($usecontact && is_object($contactobject)) { + $array_thirdparty_contact = $this->get_substitutionarray_contact($contactobject, $outputlangs, 'contact'); } - // Make substitutions into odt of mysoc - $tmparray = $this->get_substitutionarray_mysoc($mysoc, $outputlangs); - //var_dump($tmparray); exit; - foreach ($tmparray as $key => $value) { - try { - if (preg_match('/logo$/', $key)) { // Image - //var_dump($value);exit; - if (file_exists($value)) { - $odfHandler->setImage($key, $value); - } else { - $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); - } - } else // Text - { - $odfHandler->setVars($key, $value, true, 'UTF-8'); - } - } catch (OdfException $e) { - dol_syslog($e->getMessage(), LOG_INFO); - } - } - // Make substitutions into odt of thirdparty - $tmparray = $this->get_substitutionarray_thirdparty($socobject, $outputlangs); - foreach ($tmparray as $key => $value) { - try { - if (preg_match('/logo$/', $key)) { // Image - if (file_exists($value)) { - $odfHandler->setImage($key, $value); - } else { - $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); - } - } else // Text - { - $odfHandler->setVars($key, $value, true, 'UTF-8'); - } - } catch (OdfException $e) { - dol_syslog($e->getMessage(), LOG_INFO); - } - } - // Replace tags of object + external modules - $tmparray = $this->get_substitutionarray_reception($object, $outputlangs); + + $tmparray = array_merge($substitutionarray, $array_object_from_properties, $array_user, $array_soc, $array_thirdparty, $array_objet, $array_other, $array_thirdparty_contact); complete_substitutions_array($tmparray, $outputlangs, $object); + // Call the ODTSubstitution hook $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); $reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks @@ -441,25 +404,36 @@ class doc_generic_reception_odt extends ModelePdfReception } // Replace tags of lines try { - $listlines = $odfHandler->setSegment('lines'); - foreach ($object->lines as $line) { - $tmparray = $this->get_substitutionarray_reception_lines($line, $outputlangs); - complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); - // Call the ODTSubstitutionLine hook - $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line); - $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - foreach ($tmparray as $key => $val) { - try { - $listlines->setVars($key, $val, true, 'UTF-8'); - } catch (OdfException $e) { - dol_syslog($e->getMessage(), LOG_INFO); - } catch (SegmentException $e) { - dol_syslog($e->getMessage(), LOG_INFO); - } - } - $listlines->merge(); + $foundtagforlines = 1; + try { + $listlines = $odfHandler->setSegment('lines'); + } catch (OdfException $e) { + // We may arrive here if tags for lines not present into template + $foundtagforlines = 0; + dol_syslog($e->getMessage(), LOG_INFO); + } + if ($foundtagforlines) { + $linenumber = 0; + foreach ($object->lines as $line) { + $linenumber++; + $tmparray = $this->get_substitutionarray_reception_lines($line, $outputlangs); + complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); + // Call the ODTSubstitutionLine hook + $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line); + $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + foreach ($tmparray as $key => $val) { + try { + $listlines->setVars($key, $val, true, 'UTF-8'); + } catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); + } catch (SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); + } + } + $listlines->merge(); + } + $odfHandler->mergeSegment($listlines); } - $odfHandler->mergeSegment($listlines); } catch (OdfException $e) { $this->error = $e->getMessage(); dol_syslog($this->error, LOG_WARNING); @@ -486,6 +460,7 @@ class doc_generic_reception_odt extends ModelePdfReception $odfHandler->exportAsAttachedPDF($file); } catch (Exception $e) { $this->error = $e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } else { @@ -493,6 +468,7 @@ class doc_generic_reception_odt extends ModelePdfReception $odfHandler->saveToDisk($file); } catch (Exception $e) { $this->error = $e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } @@ -505,6 +481,8 @@ class doc_generic_reception_odt extends ModelePdfReception $odfHandler = null; // Destroy object + $this->result = array('fullpath'=>$file); + return 1; // Success } else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 68ceb87ba96..38344a5f486 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -972,7 +972,7 @@ class pdf_squille extends ModelePdfReception } // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index 2e48160d038..1d02b8003da 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -308,11 +308,14 @@ class doc_generic_stock_odt extends ModelePDFStock // Recipient name $contactobject = null; if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 3119ffa8dc5..c4fb2ef7b50 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -1238,7 +1238,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices } // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $mysoc; diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index 49ba1ec6cdf..dfb05d2d55f 100644 --- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -298,11 +298,14 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders // Recipient name $contactobject = null; if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 3e04844119b..436017cda0a 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -1407,7 +1407,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders } // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index bb12b19c829..8c706f59db3 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -1314,7 +1314,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders } // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 8cd572a1bcf..18e5a210aa1 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -332,11 +332,14 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal // Recipient name $contactobject = null; if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a BILLING contact and we dont use it as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 5bd9b8cf339..1bf47275599 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -1418,7 +1418,7 @@ class pdf_aurore extends ModelePDFSupplierProposal // Recipient name if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $socname = $object->contact; } else { $socname = $object->thirdparty; diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php index 82ce006447e..e20cbf44cf7 100644 --- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php +++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php @@ -293,11 +293,14 @@ class doc_generic_ticket_odt extends ModelePDFTicket // Recipient name if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 7e07539aa8e..050eb43d44a 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -325,7 +325,7 @@ class doc_generic_user_odt extends ModelePDFUser // Recipient name if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { $socobject = $object->contact; } else { $socobject = $object->thirdparty; diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index cf91120d3f8..134c5e00362 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -315,11 +315,14 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup // Recipient name if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 2f1c113fcf5..6750cc0b1a5 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -141,9 +141,9 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel } print ''; - print ''; + print ''; print $langs->trans("None"); - print ''; + print ''; print ''; } diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 2961dea7c96..212e766589c 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -146,10 +146,6 @@ if ($action == 'presend') { $formmail->trackid = $trackid; - if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) { // If bit 2 is set - include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid); - } $formmail->withfrom = 1; // Fill list of recipient with email inside <>. diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 078b68d864e..3def83f4e0d 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -135,19 +135,19 @@ if ($permission) { + '; } ?> -
+
socid) ? 0 : $object->socid); $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); ?>
- -
+
selectcontacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 1, 'minwidth100imp'); + print img_object('', 'contact', 'class="pictofixedwidth"').$form->selectcontacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 1, 'minwidth100imp widthcentpercentminusxx maxwidth400'); $nbofcontacts = $form->num; $newcardbutton = ''; @@ -157,7 +157,7 @@ if ($permission) { print $newcardbutton; ?>
-
+
element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) { diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 7b20e7209f7..0a4bb149986 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -310,7 +310,7 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->fil print ''.$langs->trans("LoginUsingOpenID").''; } else { $langs->load("errors"); - print ''.$langs->trans("ErrorOpenIDSetupNotComplete", 'MAIN_AUTHENTICATION_OPENID_URL').''; + print ''.$langs->trans("ErrorOpenIDSetupNotComplete", 'MAIN_AUTHENTICATION_OPENID_URL').''; } echo '
'; @@ -346,7 +346,7 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) { $resgetcommitstrip = getURLContent("https://www.commitstrip.com/en/feed/"); } if ($resgetcommitstrip && $resgetcommitstrip['http_code'] == '200') { - $xml = simplexml_load_string($resgetcommitstrip['content']); + $xml = simplexml_load_string($resgetcommitstrip['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET); $little = $xml->channel->item[0]->children('content', true); print preg_replace('/width="650" height="658"/', '', $little->encoded); } diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 4d715ed8797..4d0772225c7 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -114,10 +114,6 @@ if ($massaction == 'presend') { $formmail->fromid = $user->id; } $formmail->trackid = $trackid; - if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) { // If bit 2 is set - include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid); - } $formmail->withfrom = 1; $liste = $langs->trans("AllRecipientSelected", count($arrayofselected)); if (count($listofselectedthirdparties) == 1) { // Only 1 different recipient selected, we can suggest contacts diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 6a7d48add5e..c4ddc7d0c4c 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -195,15 +195,16 @@ if (($line->info_bits & 2) == 2) { } } - - - //print get_date_range($line->date_start, $line->date_end, $format); } // Add description in form if ($line->fk_product > 0 && !empty($conf->global->PRODUIT_DESC_IN_FORM)) { - print (!empty($line->description) && $line->description != $line->product_label) ? (($line->date_start || $line->date_end) ? '' : '
').'
'.dol_htmlentitiesbr($line->description) : ''; + if ($line->element == 'facturedetrec') { + print (!empty($line->description) && $line->description != $line->product_label) ? (($line->date_start_fill || $line->date_end_fill) ? '' : '
').'
'.dol_htmlentitiesbr($line->description) : ''; + } else { + print (!empty($line->description) && $line->description != $line->product_label) ? (($line->date_start || $line->date_end) ? '' : '
').'
'.dol_htmlentitiesbr($line->description) : ''; + } } // Line extrafield diff --git a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php index c8e27f66189..b1eb321f7f5 100644 --- a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php +++ b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php @@ -78,7 +78,11 @@ class InterfaceContactRoles extends DolibarrTriggers require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; $contactdefault = new Contact($this->db); $contactdefault->socid = $socid; - $TContact = $contactdefault->getContactRoles($object->element); + + $TContact = array(); + if (method_exists($contactdefault, 'getContactRoles')) { // For backward compatibility + $TContact = $contactdefault->getContactRoles($object->element); + } if (is_array($TContact) && !empty($TContact)) { $TContactAlreadyLinked = array(); diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 20d948b4b3b..813ee69b6fb 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -42,6 +42,7 @@ if (!$section) { $section = 0; } $section_dir = GETPOST('section_dir', 'alpha'); +$overwritefile = GETPOST('overwritefile', 'int'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -120,7 +121,6 @@ if (GETPOST("sendit", 'alphanohtml') && !empty($conf->global->MAIN_UPLOAD_DOC)) if (!$error) { $generatethumbs = 0; - $overwritefile = GETPOST('overwritefile', 'int')?GETPOST('overwritefile', 'int'):0; $res = dol_add_file_process($upload_dir, $overwritefile, 1, 'userfile', '', null, '', $generatethumbs); if ($res > 0) { $result = $ecmdir->changeNbOfFiles('+'); diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 780b3bebc55..9b997c8b0e9 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -643,6 +643,7 @@ print ''; print ''; print ''; print ''; +print ''; $title = $langs->trans("ListOfConferencesOrBooths"); diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 19d35a4be0e..709d3255e13 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -697,6 +697,7 @@ print ''; print ''; print ''; print ''; +print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd); diff --git a/htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php b/htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php index 17c78babfea..e4990da6424 100644 --- a/htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php +++ b/htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php @@ -58,7 +58,7 @@ if ($massaction == 'presend_attendees') { print dol_get_fiche_head(null, '', ''); - // Cree l'objet formulaire mail + // Create form for email include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); $formmail->withform = -1; @@ -68,10 +68,6 @@ if ($massaction == 'presend_attendees') { $formmail->fromid = $user->id; } $formmail->trackid = $trackid; - if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) { // If bit 2 is set - include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid); - } $formmail->withfrom = 1; $liste = $langs->trans("AllRecipientSelected", count($listofselectedid)); $formmail->withtoreadonly = 1; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 29f008b42b0..6e40b6b3a77 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -68,6 +68,17 @@ $socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('socid_id', $childids = $user->getAllChildIds(1); +if (! empty($conf->global->EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH)) { + if (empty($date_start)) { + $date_start = dol_mktime(0, 0, 0, (int) dol_print_date(dol_now(), '%m'), 1, (int) dol_print_date(dol_now(), '%Y')); + } + + if (empty($date_end)) { + // date('t') => number of days in the month, so last day of the month too + $date_end = dol_mktime(0, 0, 0, (int) dol_print_date(dol_now(), '%m'), (int) date('t'), (int) dol_print_date(dol_now(), '%Y')); + } +} + // Hack to use expensereport dir $rootfordata = DOL_DATA_ROOT; $rootforuser = DOL_DATA_ROOT; @@ -268,10 +279,14 @@ if (empty($reshook)) { } } - if (!$error && empty($conf->global->EXPENSEREPORT_ALLOW_OVERLAPPING_PERIODS) && $object->periode_existe($fuser, $object->date_debut, $object->date_fin)) { - $error++; - setEventMessages($langs->trans("ErrorDoubleDeclaration"), null, 'errors'); - $action = 'create'; + if (!$error && empty($conf->global->EXPENSEREPORT_ALLOW_OVERLAPPING_PERIODS)) { + $overlappingExpenseReportID = $object->periode_existe($fuser, $object->date_debut, $object->date_fin, true); + + if ($overlappingExpenseReportID > 0) { + $error++; + setEventMessages($langs->trans("ErrorDoubleDeclaration").' '. $langs->trans('ShowTrip').'', null, 'errors'); + $action = 'create'; + } } if (!$error) { @@ -1579,6 +1594,8 @@ if ($action == 'create') { print ''; } else { + $taxlessUnitPriceDisabled = ! empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY) ? ' disabled' : ''; + print dol_get_fiche_head($head, 'card', $langs->trans("ExpenseReport"), -1, 'trip'); // Clone confirmation @@ -2295,7 +2312,7 @@ if ($action == 'create') { // Unit price print ''; - print ''; + print ''; print ''; // Unit price with tax @@ -2474,7 +2491,7 @@ if ($action == 'create') { // Unit price net print ''; - print ''; + print ''; print ''; // Unit price with tax diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 63303554c51..64034c10a3f 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2213,8 +2213,6 @@ class ExpenseReport extends CommonObject $date_d_form = $date_debut; $date_f_form = $date_fin; - $existe = false; - while ($i < $num_rows) { $objp = $this->db->fetch_object($result); @@ -2222,17 +2220,13 @@ class ExpenseReport extends CommonObject $date_f_req = $this->db->jdate($objp->date_fin); // 4 if (!($date_f_form < $date_d_req || $date_d_form > $date_f_req)) { - $existe = true; + return $objp->rowid; } $i++; } - if ($existe) { - return 1; - } else { - return 0; - } + return 0; } else { return 0; } diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 9cfb2fe475f..67ed2d4e741 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -212,7 +212,7 @@ if ($object->id > 0) { print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); $tmpcheck = $object->check_codefournisseur(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongSupplierCode").')'; + print ' ('.$langs->trans("WrongSupplierCode").')'; } print ''; print ''; diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index b08d9237c63..5b523d8d7e8 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -846,7 +846,7 @@ class ProductFournisseur extends Product $this->fourn_qty = $record["quantity"]; $this->fourn_remise_percent = $record["remise_percent"]; $this->fourn_remise = $record["remise"]; - $this->fourn_unitprice = $record["unitprice"]; + $this->fourn_unitprice = $fourn_unitprice; $this->fourn_charges = $record["charges"]; // deprecated $this->fourn_tva_tx = $record["tva_tx"]; $this->fourn_id = $record["fourn_id"]; @@ -1183,7 +1183,7 @@ class ProductFournisseur extends Product $label .= $this->displayPriceProductFournisseurLog($logPrices); } - $url = dol_buildpath('/product/fournisseurs.php', 1).'?id='.$this->id.'&action=add_price&socid='.$this->fourn_id.'&rowid='.$this->product_fourn_price_id; + $url = dol_buildpath('/product/fournisseurs.php', 1).'?id='.$this->id.'&action=add_price&token='.newToken().'&socid='.$this->fourn_id.'&rowid='.$this->product_fourn_price_id; if ($option != 'nolink') { // Add param to save lastsearch_values or not diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 56f98139052..a325f9db780 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -418,7 +418,7 @@ $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " country.code as country_code,"; $sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,"; -$sql .= " u.login"; +$sql .= ' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender'; if ($search_categ_sup && $search_categ_sup != '-1') { $sql .= ", cs.fk_categorie, cs.fk_soc"; } @@ -634,7 +634,7 @@ if (!$search_all) { $sql .= " state.code_departement, state.nom,"; $sql .= ' country.code,'; $sql .= " p.rowid, p.ref, p.title,"; - $sql .= " u.login"; + $sql .= " u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender"; if ($search_categ_sup && $search_categ_sup != '-1') { $sql .= ", cs.fk_categorie, cs.fk_soc"; } @@ -1585,13 +1585,25 @@ if ($resql) { $totalarray['val']['f.total_ttc'] += $obj->total_ttc; } + $userstatic->id = $obj->fk_user_author; + $userstatic->login = $obj->login; + $userstatic->lastname = $obj->lastname; + $userstatic->firstname = $obj->firstname; + $userstatic->email = $obj->user_email; + $userstatic->statut = $obj->user_statut; + $userstatic->entity = $obj->entity; + $userstatic->photo = $obj->photo; + $userstatic->office_phone = $obj->office_phone; + $userstatic->office_fax = $obj->office_fax; + $userstatic->user_mobile = $obj->user_mobile; + $userstatic->job = $obj->job; + $userstatic->gender = $obj->gender; + // Author if (!empty($arrayfields['u.login']['checked'])) { - $userstatic->id = $obj->fk_user_author; - $userstatic->login = $obj->login; - print ''; + print ''; if ($userstatic->id) { - print $userstatic->getLoginUrl(1); + print $userstatic->getLoginUrl(-1); } else { print ' '; } diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index e13d43c612d..55d92b7835b 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1447,7 +1447,7 @@ class Holiday extends CommonObject // Update each user counter foreach ($users as $userCounter) { - $nbDaysToAdd = (isset($typeleaves[$userCounter['type']]['newByMonth']) ? $typeleaves[$userCounter['type']]['newByMonth'] : 0); + $nbDaysToAdd = (isset($typeleaves[$userCounter['type']]['newbymonth']) ? $typeleaves[$userCounter['type']]['newbymonth'] : 0); if (empty($nbDaysToAdd)) { continue; } @@ -2081,7 +2081,7 @@ class Holiday extends CommonObject { global $mysoc; - $sql = "SELECT rowid, code, label, affect, delay, newByMonth"; + $sql = "SELECT rowid, code, label, affect, delay, newbymonth"; $sql .= " FROM ".MAIN_DB_PREFIX."c_holiday_types"; $sql .= " WHERE (fk_country IS NULL OR fk_country = ".((int) $mysoc->country_id).')'; if ($active >= 0) { @@ -2096,7 +2096,7 @@ class Holiday extends CommonObject $num = $this->db->num_rows($result); if ($num) { while ($obj = $this->db->fetch_object($result)) { - $types[$obj->rowid] = array('rowid'=> $obj->rowid, 'code'=> $obj->code, 'label'=>$obj->label, 'affect'=>$obj->affect, 'delay'=>$obj->delay, 'newByMonth'=>$obj->newByMonth); + $types[$obj->rowid] = array('rowid'=> $obj->rowid, 'code'=> $obj->code, 'label'=>$obj->label, 'affect'=>$obj->affect, 'delay'=>$obj->delay, 'newbymonth'=>$obj->newbymonth); } return $types; diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index fdcdb5f88e6..621443fb408 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -358,7 +358,7 @@ if (count($typeleaves) == 0) { //var_dump($users['rowid'].' - '.$val['rowid']); print ''; if ($canedit) { - print ''; + print ''; } else { print $nbtoshow; } diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 5139e12ab7a..2ab7e3976aa 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1205,7 +1205,7 @@ if ($step == 4 && $datatoimport) { // async: false // });'."\n"; // Now reload page - print 'var newlocation= \''.$_SERVER["PHP_SELF"].'?step=4'.$param.'&action=saveorder&boxorder=\' + boxorder;'."\n"; + print 'var newlocation= \''.$_SERVER["PHP_SELF"].'?step=4'.$param.'&action=saveorder&token='.newToken().'&boxorder=\' + boxorder;'."\n"; //print 'alert(newlocation);'; print 'window.location.href=newlocation;'."\n"; print '}'."\n"; diff --git a/htdocs/index.php b/htdocs/index.php index 880b5577bbb..8c1433c79cb 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -337,6 +337,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { ), 'supplier_proposal' => array( + 'lang' => 'supplier_proposal', 'groupName' => 'SupplierProposals', 'globalStatsKey' => 'askprice', 'stats' => @@ -486,6 +487,9 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } if (!empty($boards)) { + if (!empty($groupElement['lang'])) { + $langs->load($groupElement['lang']); + } $groupName = $langs->trans($groupElement['groupName']); $groupKeyLowerCase = strtolower($groupKey); $nbTotalForGroup = 0; diff --git a/htdocs/install/mysql/data/llx_00_c_country.sql b/htdocs/install/mysql/data/llx_00_c_country.sql index 4465756f00a..7217fda7d09 100644 --- a/htdocs/install/mysql/data/llx_00_c_country.sql +++ b/htdocs/install/mysql/data/llx_00_c_country.sql @@ -279,5 +279,5 @@ INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (24 -- Set field eec -UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','DK','EE','ES','FI','FR','GR','HR','NL','HU','IE','IM','IT','LT','LU','LV','MC','MT','PL','PT','RO','SE','SK','SI'); +UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','DK','EE','ES','FI','FR','GR','HR','NL','HU','IE','IT','LT','LU','LV','MC','MT','PL','PT','RO','SE','SK','SI'); diff --git a/htdocs/install/mysql/data/llx_c_holiday_type.sql b/htdocs/install/mysql/data/llx_c_holiday_type.sql index addd7f9942e..65f9a51b037 100644 --- a/htdocs/install/mysql/data/llx_c_holiday_type.sql +++ b/htdocs/install/mysql/data/llx_c_holiday_type.sql @@ -25,12 +25,12 @@ -- -- Generic to all countries -insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country, active) values ('LEAVE_SICK', 'Sick leave', 0, 0, 0, NULL, 1); -insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country, active) values ('LEAVE_OTHER', 'Other leave', 0, 0, 0, NULL, 1); +insert into llx_c_holiday_types(code, label, affect, delay, newbymonth, fk_country, active) values ('LEAVE_SICK', 'Sick leave', 0, 0, 0, NULL, 1); +insert into llx_c_holiday_types(code, label, affect, delay, newbymonth, fk_country, active) values ('LEAVE_OTHER', 'Other leave', 0, 0, 0, NULL, 1); -- Not enabled by default, we prefer to have an entrey dedicated to country -insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country, active) values ('LEAVE_PAID', 'Paid vacation', 1, 7, 0, NULL, 0); +insert into llx_c_holiday_types(code, label, affect, delay, newbymonth, fk_country, active) values ('LEAVE_PAID', 'Paid vacation', 1, 7, 0, NULL, 0); -- Leaves specific to France -insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country, active) values ('LEAVE_RTT_FR', 'RTT' , 1, 7, 0.83, 1, 1); -insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country, active) values ('LEAVE_PAID_FR', 'Paid vacation', 1, 30, 2.08334, 1, 1); +insert into llx_c_holiday_types(code, label, affect, delay, newbymonth, fk_country, active) values ('LEAVE_RTT_FR', 'RTT' , 1, 7, 0.83, 1, 1); +insert into llx_c_holiday_types(code, label, affect, delay, newbymonth, fk_country, active) values ('LEAVE_PAID_FR', 'Paid vacation', 1, 30, 2.08334, 1, 1); diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index cae269783e4..12b0b92a13e 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -330,7 +330,7 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (10 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (105,10, '15','0','VAT 12% Majoré à 25% (15%)',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (106,10, '22.5','0','VAT 18% Majoré à 25% (22.5%)',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (107,10, '6','0','VAT 6%', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (107,10,'18.18','0','VAT 18%+FODEC', 1, 1, '4', 0, 0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (108,10,'18.18','0','VAT 18%+FODEC', 1, 1, '4', 0, 0); -- UKRAINE (id country=226) INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2261,226, '0','0','VAT rate 0',1); @@ -379,10 +379,6 @@ INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 4 INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 462, 46, '15','0','VAT 15%',1); INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 463, 46, '7.5','0','VAT 7.5%',1); --- SOUTH AFRICA (id country=205) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2051,205, '0','0','No VAT',1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2052,205, '14','0','VAT 14%',1); - -- VENEZUELA (id country=232) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2321,232, '0','0','No VAT',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2322,232, '12','0','VAT 12%',1); diff --git a/htdocs/install/mysql/data/llx_const.sql b/htdocs/install/mysql/data/llx_const.sql index 2f2975a158c..d7193d87a49 100644 --- a/htdocs/install/mysql/data/llx_const.sql +++ b/htdocs/install/mysql/data/llx_const.sql @@ -85,7 +85,7 @@ insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_EXP -- -- Mail Mailing -- -insert into llx_const (name, value, type, note, visible) values ('MAIN_FIX_FOR_BUGGED_MTA','1','chaine','Set constant to fix email ending from PHP with some linux ike system',1); +--insert into llx_const (name, value, type, note, visible) values ('MAIN_FIX_FOR_BUGGED_MTA','1','chaine','Set constant to fix email ending from PHP with some linux like system',1); insert into llx_const (name, value, type, note, visible) values ('MAILING_EMAIL_FROM','no-reply@mydomain.com','chaine','EMail emmetteur pour les envois d emailings',0); diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 912eb7fe0eb..82a6bdec3dc 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -78,6 +78,9 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, -- v15 + +ALTER TABLE llx_c_holiday_types CHANGE COLUMN newByMonth newbymonth double(8,5) DEFAULT 0 NOT NULL; + ALTER TABLE llx_product ADD COLUMN mandatory_period tinyint NULL DEFAULT 0; ALTER TABLE llx_holiday ADD COLUMN date_approve DATETIME DEFAULT NULL; @@ -128,7 +131,7 @@ ALTER TABLE llx_categorie_knowledgemanagement ADD INDEX idx_categorie_knowledgem ALTER TABLE llx_categorie_knowledgemanagement ADD INDEX idx_categorie_knowledgemanagement_fk_knowledgemanagement (fk_knowledgemanagement); ALTER TABLE llx_categorie_knowledgemanagement ADD CONSTRAINT fk_categorie_knowledgemanagement_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); -ALTER TABLE llx_categorie_knowledgemanagement ADD CONSTRAINT fk_categorie_knowledgemanagement_knowledgemanagement_rowid FOREIGN KEY (fk_knowledgemanagement) REFERENCES llx_knowledgemanagement (rowid); +ALTER TABLE llx_categorie_knowledgemanagement ADD CONSTRAINT fk_categorie_knowledgemanagement_knowledgemanagement_rowid FOREIGN KEY (fk_knowledgemanagement) REFERENCES llx_knowledgemanagement_knowledgerecord (rowid); ALTER TABLE llx_product_lot ADD COLUMN barcode varchar(180) DEFAULT NULL; ALTER TABLE llx_product_lot ADD COLUMN fk_barcode_type integer DEFAULT NULL; @@ -150,3 +153,220 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2010', ' INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2011', 'Ideell förening'); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2012', 'Stiftelse'); +-- START GRH/HRM MODULE + + +CREATE TABLE llx_hrm_evaluation( + -- BEGIN MODULEBUILDER FIELDS + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + ref varchar(128) DEFAULT '(PROV)' NOT NULL, + label varchar(255), + description text, + note_public text, + note_private text, + date_creation datetime NOT NULL, + tms timestamp, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + import_key varchar(14), + status smallint NOT NULL, + date_eval date, + fk_user integer NOT NULL, + fk_job integer NOT NULL + -- END MODULEBUILDER FIELDS +) ENGINE=innodb; +ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_rowid (rowid); +ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_ref (ref); +ALTER TABLE llx_hrm_evaluation ADD CONSTRAINT llx_hrm_evaluation_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); +ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_status (status); + + +create table llx_hrm_evaluation_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + +ALTER TABLE llx_hrm_evaluation_extrafields ADD INDEX idx_evaluation_fk_object(fk_object); + + +CREATE TABLE llx_hrm_evaluationdet( + -- BEGIN MODULEBUILDER FIELDS + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + date_creation datetime NOT NULL, + tms timestamp, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + fk_skill integer NOT NULL, + fk_evaluation integer NOT NULL, + rank integer NOT NULL, + required_rank integer NOT NULL, + import_key varchar(14) + -- END MODULEBUILDER FIELDS +) ENGINE=innodb; + +ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_rowid (rowid); +ALTER TABLE llx_hrm_evaluationdet ADD CONSTRAINT llx_hrm_evaluationdet_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); +ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_fk_skill (fk_skill); +ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_fk_evaluation (fk_evaluation); + + +create table llx_hrm_evaluationdet_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + +ALTER TABLE llx_hrm_evaluationdet_extrafields ADD INDEX idx_evaluationdet_fk_object(fk_object); + + + + +CREATE TABLE llx_hrm_job( + + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + label varchar(255) NOT NULL, + description text, + date_creation datetime NOT NULL, + tms timestamp, + deplacement varchar(255), + note_public text, + note_private text, + fk_user_creat integer, + fk_user_modif integer + +) ENGINE=innodb; + +ALTER TABLE llx_hrm_job ADD INDEX idx_hrm_job_rowid (rowid); +ALTER TABLE llx_hrm_job ADD INDEX idx_hrm_job_label (label); + + +create table llx_hrm_job_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + +ALTER TABLE llx_hrm_job_extrafields ADD INDEX idx_job_fk_object(fk_object); + + + +CREATE TABLE llx_hrm_job_user( + -- BEGIN MODULEBUILDER FIELDS + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + -- ref varchar(128) NOT NULL, + description text, + date_creation datetime NOT NULL, + tms timestamp, + fk_contrat integer, + fk_user integer NOT NULL, + fk_job integer NOT NULL, + date_start date, + date_end date, + commentaire_abandon varchar(255), + note_public text, + note_private text, + fk_user_creat integer, + fk_user_modif integer + -- END MODULEBUILDER FIELDS +) ENGINE=innodb; + +ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_rowid (rowid); +-- ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_ref (ref); + + +create table llx_hrm_job_user_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + +ALTER TABLE llx_hrm_job_user_extrafields ADD INDEX idx_position_fk_object(fk_object); + + + +CREATE TABLE llx_hrm_skill( + -- BEGIN MODULEBUILDER FIELDS + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + label varchar(255), + description text, + date_creation datetime NOT NULL, + tms timestamp, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + required_level integer NOT NULL, + date_validite integer NOT NULL, + temps_theorique double(24,8) NOT NULL, + skill_type integer NOT NULL, + note_public text, + note_private text + -- END MODULEBUILDER FIELDS +) ENGINE=innodb; + +ALTER TABLE llx_hrm_skill ADD INDEX idx_hrm_skill_rowid (rowid); +ALTER TABLE llx_hrm_skill ADD CONSTRAINT llx_hrm_skill_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); +ALTER TABLE llx_hrm_skill ADD INDEX idx_hrm_skill_skill_type (skill_type); + +create table llx_hrm_skill_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + +ALTER TABLE llx_hrm_skill_extrafields ADD INDEX idx_skill_fk_object(fk_object); + + +CREATE TABLE llx_hrm_skilldet( + -- BEGIN MODULEBUILDER FIELDS + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + description text, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + fk_skill integer NOT NULL, + rank integer + -- END MODULEBUILDER FIELDS +) ENGINE=innodb; + +ALTER TABLE llx_hrm_skilldet ADD INDEX idx_hrm_skilldet_rowid (rowid); +ALTER TABLE llx_hrm_skilldet ADD CONSTRAINT llx_hrm_skilldet_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); + +create table llx_hrm_skilldet_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + +ALTER TABLE llx_hrm_skilldet_extrafields ADD INDEX idx_skilldet_fk_object(fk_object); + + +CREATE TABLE llx_hrm_skillrank( + -- BEGIN MODULEBUILDER FIELDS + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_skill integer NOT NULL, + rank integer NOT NULL, + fk_object integer NOT NULL, + date_creation datetime NOT NULL, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + objecttype varchar(128) NOT NULL + -- END MODULEBUILDER FIELDS +) ENGINE=innodb; + +ALTER TABLE llx_hrm_skillrank ADD INDEX idx_hrm_skillrank_rowid (rowid); +ALTER TABLE llx_hrm_skillrank ADD INDEX idx_hrm_skillrank_fk_skill (fk_skill); +ALTER TABLE llx_hrm_skillrank ADD CONSTRAINT llx_hrm_skillrank_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); + +--END GRH/HRM MODULE diff --git a/htdocs/install/mysql/tables/llx_c_holiday_types.sql b/htdocs/install/mysql/tables/llx_c_holiday_types.sql index 9c09d486bec..b602ee1d330 100644 --- a/htdocs/install/mysql/tables/llx_c_holiday_types.sql +++ b/htdocs/install/mysql/tables/llx_c_holiday_types.sql @@ -22,7 +22,7 @@ CREATE TABLE llx_c_holiday_types ( label varchar(255) NOT NULL, affect integer NOT NULL, -- a request will change sold or not delay integer NOT NULL, -- Minimum delay to be allowed to make request - newByMonth double(8,5) DEFAULT 0 NOT NULL, -- Amount of new days for each user each month + newbymonth double(8,5) DEFAULT 0 NOT NULL, -- Amount of new days for each user each month fk_country integer DEFAULT NULL, -- This type is dedicated to a country active integer DEFAULT 1 ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluation.key.sql b/htdocs/install/mysql/tables/llx_hrm_evaluation.key.sql new file mode 100644 index 00000000000..804bc6b4803 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_evaluation.key.sql @@ -0,0 +1,29 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_rowid (rowid); +ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_ref (ref); +ALTER TABLE llx_hrm_evaluation ADD CONSTRAINT llx_hrm_evaluation_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); +ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_status (status); +-- END MODULEBUILDER INDEXES + +--ALTER TABLE llx_hrm_evaluation ADD UNIQUE INDEX uk_hrm_evaluation_fieldxy(fieldx, fieldy); + +--ALTER TABLE llx_hrm_evaluation ADD CONSTRAINT llx_hrm_evaluation_fk_field FOREIGN KEY (fk_field) REFERENCES llx_hrm_myotherobject(rowid); + diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluation.sql b/htdocs/install/mysql/tables/llx_hrm_evaluation.sql new file mode 100644 index 00000000000..bc9b7a1effc --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_evaluation.sql @@ -0,0 +1,37 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +CREATE TABLE llx_hrm_evaluation( + -- BEGIN MODULEBUILDER FIELDS + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + ref varchar(128) DEFAULT '(PROV)' NOT NULL, + label varchar(255), + description text, + note_public text, + note_private text, + date_creation datetime NOT NULL, + tms timestamp, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + import_key varchar(14), + status smallint NOT NULL, + date_eval date, + fk_user integer NOT NULL, + fk_job integer NOT NULL + -- END MODULEBUILDER FIELDS +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.key.sql new file mode 100644 index 00000000000..ff9ba9d6cb6 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.key.sql @@ -0,0 +1,21 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_hrm_evaluation_extrafields ADD INDEX idx_evaluation_fk_object(fk_object); +-- END MODULEBUILDER INDEXES diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.sql new file mode 100644 index 00000000000..da00cc3c333 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.sql @@ -0,0 +1,25 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + +create table llx_hrm_evaluation_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluationdet.key.sql b/htdocs/install/mysql/tables/llx_hrm_evaluationdet.key.sql new file mode 100644 index 00000000000..05309ce57e2 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_evaluationdet.key.sql @@ -0,0 +1,29 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_rowid (rowid); +ALTER TABLE llx_hrm_evaluationdet ADD CONSTRAINT llx_hrm_evaluationdet_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); +ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_fk_skill (fk_skill); +ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_fk_evaluation (fk_evaluation); +-- END MODULEBUILDER INDEXES + +--ALTER TABLE llx_hrm_evaluationdet ADD UNIQUE INDEX uk_hrm_evaluationdet_fieldxy(fieldx, fieldy); + +--ALTER TABLE llx_hrm_evaluationdet ADD CONSTRAINT llx_hrm_evaluationdet_fk_field FOREIGN KEY (fk_field) REFERENCES llx_hrm_myotherobject(rowid); + diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluationdet.sql b/htdocs/install/mysql/tables/llx_hrm_evaluationdet.sql new file mode 100644 index 00000000000..0509cc80146 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_evaluationdet.sql @@ -0,0 +1,32 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +CREATE TABLE llx_hrm_evaluationdet( + -- BEGIN MODULEBUILDER FIELDS + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + date_creation datetime NOT NULL, + tms timestamp, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + fk_skill integer NOT NULL, + fk_evaluation integer NOT NULL, + rank integer NOT NULL, + required_rank integer NOT NULL, + import_key varchar(14) + -- END MODULEBUILDER FIELDS +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.key.sql new file mode 100644 index 00000000000..5072e2eb67b --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.key.sql @@ -0,0 +1,21 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_hrm_evaluationdet_extrafields ADD INDEX idx_evaluationdet_fk_object(fk_object); +-- END MODULEBUILDER INDEXES diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.sql new file mode 100644 index 00000000000..4d4031ba228 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.sql @@ -0,0 +1,24 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + +create table llx_hrm_evaluationdet_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_hrm_job.key.sql b/htdocs/install/mysql/tables/llx_hrm_job.key.sql new file mode 100644 index 00000000000..6fe7da6016e --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_job.key.sql @@ -0,0 +1,27 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_hrm_job ADD INDEX idx_hrm_job_rowid (rowid); +ALTER TABLE llx_hrm_job ADD INDEX idx_hrm_job_label (label); +-- END MODULEBUILDER INDEXES + +--ALTER TABLE llx_hrm_job ADD UNIQUE INDEX uk_hrm_job_fieldxy(fieldx, fieldy); + +--ALTER TABLE llx_hrm_job ADD CONSTRAINT llx_hrm_job_fk_field FOREIGN KEY (fk_field) REFERENCES llx_hrm_myotherobject(rowid); + diff --git a/htdocs/install/mysql/tables/llx_hrm_job.sql b/htdocs/install/mysql/tables/llx_hrm_job.sql new file mode 100644 index 00000000000..51f472af377 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_job.sql @@ -0,0 +1,32 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +CREATE TABLE llx_hrm_job( + + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + label varchar(255) NOT NULL, + description text, + date_creation datetime NOT NULL, + tms timestamp, + deplacement varchar(255), + note_public text, + note_private text, + fk_user_creat integer, + fk_user_modif integer + +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_hrm_job_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_job_extrafields.key.sql new file mode 100644 index 00000000000..b5226dc4c38 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_job_extrafields.key.sql @@ -0,0 +1,21 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_hrm_job_extrafields ADD INDEX idx_job_fk_object(fk_object); +-- END MODULEBUILDER INDEXES diff --git a/htdocs/install/mysql/tables/llx_hrm_job_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_job_extrafields.sql new file mode 100644 index 00000000000..10cccf1c36f --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_job_extrafields.sql @@ -0,0 +1,25 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + +create table llx_hrm_job_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + diff --git a/htdocs/install/mysql/tables/llx_hrm_job_user.key.sql b/htdocs/install/mysql/tables/llx_hrm_job_user.key.sql new file mode 100644 index 00000000000..ead2f7f3b18 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_job_user.key.sql @@ -0,0 +1,27 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_rowid (rowid); +-- ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_ref (ref); +-- END MODULEBUILDER INDEXES + +--ALTER TABLE llx_hrm_job_user ADD UNIQUE INDEX uk_hrm_job_user_fieldxy(fieldx, fieldy); + +--ALTER TABLE llx_hrm_job_user ADD CONSTRAINT llx_hrm_job_user_fk_field FOREIGN KEY (fk_field) REFERENCES llx_hrm_myotherobject(rowid); + diff --git a/htdocs/install/mysql/tables/llx_hrm_job_user.sql b/htdocs/install/mysql/tables/llx_hrm_job_user.sql new file mode 100644 index 00000000000..ce9620623dd --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_job_user.sql @@ -0,0 +1,36 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + +CREATE TABLE llx_hrm_job_user( + -- BEGIN MODULEBUILDER FIELDS + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + -- ref varchar(128) NOT NULL, + description text, + date_creation datetime NOT NULL, + tms timestamp, + fk_contrat integer, + fk_user integer NOT NULL, + fk_job integer NOT NULL, + date_start datetime, + date_end datetime, + commentaire_abandon varchar(255), + note_public text, + note_private text, + fk_user_creat integer, + fk_user_modif integer + -- END MODULEBUILDER FIELDS +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.key.sql new file mode 100644 index 00000000000..99ed1f4c1bc --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.key.sql @@ -0,0 +1,21 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_hrm_job_user_extrafields ADD INDEX idx_position_fk_object(fk_object); +-- END MODULEBUILDER INDEXES diff --git a/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.sql new file mode 100644 index 00000000000..7495563f68d --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.sql @@ -0,0 +1,25 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + +create table llx_hrm_job_user_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + diff --git a/htdocs/install/mysql/tables/llx_hrm_skill.key.sql b/htdocs/install/mysql/tables/llx_hrm_skill.key.sql new file mode 100644 index 00000000000..b3196bf8522 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_skill.key.sql @@ -0,0 +1,28 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_hrm_skill ADD INDEX idx_hrm_skill_rowid (rowid); +ALTER TABLE llx_hrm_skill ADD CONSTRAINT llx_hrm_skill_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); +ALTER TABLE llx_hrm_skill ADD INDEX idx_hrm_skill_skill_type (skill_type); +-- END MODULEBUILDER INDEXES + +--ALTER TABLE llx_hrm_skill ADD UNIQUE INDEX uk_hrm_skill_fieldxy(fieldx, fieldy); + +--ALTER TABLE llx_hrm_skill ADD CONSTRAINT llx_hrm_skill_fk_field FOREIGN KEY (fk_field) REFERENCES llx_hrm_myotherobject(rowid); + diff --git a/htdocs/install/mysql/tables/llx_hrm_skill.sql b/htdocs/install/mysql/tables/llx_hrm_skill.sql new file mode 100644 index 00000000000..96a31be588a --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_skill.sql @@ -0,0 +1,35 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +CREATE TABLE llx_hrm_skill( + -- BEGIN MODULEBUILDER FIELDS + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + label varchar(255), + description text, + date_creation datetime NOT NULL, + tms timestamp, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + required_level integer NOT NULL, + date_validite integer NOT NULL, + temps_theorique double(24,8) NOT NULL, + skill_type integer NOT NULL, + note_public text, + note_private text + -- END MODULEBUILDER FIELDS +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_hrm_skill_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_skill_extrafields.key.sql new file mode 100644 index 00000000000..a4ae591731e --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_skill_extrafields.key.sql @@ -0,0 +1,21 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_hrm_skill_extrafields ADD INDEX idx_skill_fk_object(fk_object); +-- END MODULEBUILDER INDEXES diff --git a/htdocs/install/mysql/tables/llx_hrm_skill_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_skill_extrafields.sql new file mode 100644 index 00000000000..d47657e34f8 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_skill_extrafields.sql @@ -0,0 +1,25 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + +create table llx_hrm_skill_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + diff --git a/htdocs/install/mysql/tables/llx_hrm_skilldet.key.sql b/htdocs/install/mysql/tables/llx_hrm_skilldet.key.sql new file mode 100644 index 00000000000..289276e07b5 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_skilldet.key.sql @@ -0,0 +1,27 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_hrm_skilldet ADD INDEX idx_hrm_skilldet_rowid (rowid); +ALTER TABLE llx_hrm_skilldet ADD CONSTRAINT llx_hrm_skilldet_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); +-- END MODULEBUILDER INDEXES + +--ALTER TABLE llx_hrm_skilldet ADD UNIQUE INDEX uk_hrm_skilldet_fieldxy(fieldx, fieldy); + +--ALTER TABLE llx_hrm_skilldet ADD CONSTRAINT llx_hrm_skilldet_fk_field FOREIGN KEY (fk_field) REFERENCES llx_hrm_myotherobject(rowid); + diff --git a/htdocs/install/mysql/tables/llx_hrm_skilldet.sql b/htdocs/install/mysql/tables/llx_hrm_skilldet.sql new file mode 100644 index 00000000000..fba82645915 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_skilldet.sql @@ -0,0 +1,28 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +CREATE TABLE llx_hrm_skilldet( + -- BEGIN MODULEBUILDER FIELDS + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + description text, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + fk_skill integer NOT NULL, + rank integer + -- END MODULEBUILDER FIELDS +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.key.sql new file mode 100644 index 00000000000..319eb193a18 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.key.sql @@ -0,0 +1,21 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- +-- 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 https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_hrm_skilldet_extrafields ADD INDEX idx_skilldet_fk_object(fk_object); +-- END MODULEBUILDER INDEXES diff --git a/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.sql new file mode 100644 index 00000000000..a6e14f476c0 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.sql @@ -0,0 +1,24 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- 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 https://www.gnu.org/licenses/. + +create table llx_hrm_skilldet_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + diff --git a/htdocs/install/mysql/tables/llx_hrm_skillrank.key.sql b/htdocs/install/mysql/tables/llx_hrm_skillrank.key.sql new file mode 100644 index 00000000000..11d89b0187c --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_skillrank.key.sql @@ -0,0 +1,27 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- 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 https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_hrm_skillrank ADD INDEX idx_hrm_skillrank_rowid (rowid); +ALTER TABLE llx_hrm_skillrank ADD INDEX idx_hrm_skillrank_fk_skill (fk_skill); +ALTER TABLE llx_hrm_skillrank ADD CONSTRAINT llx_hrm_skillrank_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); +-- END MODULEBUILDER INDEXES + +--ALTER TABLE llx_hrm_skillrank ADD UNIQUE INDEX uk_hrm_skillrank_fieldxy(fieldx, fieldy); + +--ALTER TABLE llx_hrm_skillrank ADD CONSTRAINT llx_hrm_skillrank_fk_field FOREIGN KEY (fk_field) REFERENCES llx_hrm_myotherobject(rowid); + diff --git a/htdocs/install/mysql/tables/llx_hrm_skillrank.sql b/htdocs/install/mysql/tables/llx_hrm_skillrank.sql new file mode 100644 index 00000000000..5c4deb95938 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_hrm_skillrank.sql @@ -0,0 +1,30 @@ +-- Copyright (C) 2021 Gauthier VERDOL +-- Copyright (C) 2021 Greg Rastklan +-- Copyright (C) 2021 Jean-Pascal BOUDET +-- 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 https://www.gnu.org/licenses/. + + +CREATE TABLE llx_hrm_skillrank( + -- BEGIN MODULEBUILDER FIELDS + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_skill integer NOT NULL, + rank integer NOT NULL, + fk_object integer NOT NULL, + date_creation datetime NOT NULL, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + objecttype varchar(128) NOT NULL + -- END MODULEBUILDER FIELDS +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_workstation_workstation_user_group.sql b/htdocs/install/mysql/tables/llx_workstation_workstation_usergroup.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_workstation_workstation_user_group.sql rename to htdocs/install/mysql/tables/llx_workstation_workstation_usergroup.sql diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 129ee9d7827..b36914ad36b 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -283,7 +283,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $db->free($resql); } else { if ($db->lasterrno() != 'DB_ERROR_NOSUCHTABLE') { - print ''.dol_escape_htmltag($sql).' : '.dol_escape_htmltag($db->lasterror())."
\n"; + print ''.dol_escape_htmltag($sql).' : '.dol_escape_htmltag($db->lasterror())."\n"; } } } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e63323e6c33..9b3d6b02af3 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -133,7 +133,6 @@ IdModule=Module ID IdPermissions=Permissions ID LanguageBrowserParameter=Parameter %s LocalisationDolibarrParameters=Localization parameters -ClientTZ=Client Time Zone (user) ClientHour=Client time (user) OSTZ=Server OS Time Zone PHPTZ=PHP server Time Zone @@ -161,7 +160,7 @@ Purge=Purge PurgeAreaDesc=This page allows you to delete all files generated or stored by Dolibarr (temporary files or all files in %s directory). Using this feature is not normally necessary. It is provided as a workaround for users whose Dolibarr is hosted by a provider that does not offer permissions to delete files generated by the web server. PurgeDeleteLogFile=Delete log files, including %s defined for Syslog module (no risk of losing data) PurgeDeleteTemporaryFiles=Delete all log and temporary files (no risk of losing data). Parameter can be 'tempfilesold', 'logfiles' or both 'tempfilesold+logfiles'. Note: Deletion of temporary files is done only if the temp directory was created more than 24 hours ago. -PurgeDeleteTemporaryFilesShort=Delete log and temporary files +PurgeDeleteTemporaryFilesShort=Delete log and temporary files (no risk of losing data) PurgeDeleteAllFilesInDocumentsDir=Delete all files in directory: %s.
This will delete all generated documents related to elements (third parties, invoices etc...), files uploaded into the ECM module, database backup dumps and temporary files. PurgeRunNow=Purge now PurgeNothingToDelete=No directory or files to delete. @@ -518,6 +517,8 @@ ProductDocumentTemplates=Document templates to generate product document FreeLegalTextOnExpenseReports=Free legal text on expense reports WatermarkOnDraftExpenseReports=Watermark on draft expense reports ProjectIsRequiredOnExpenseReports=The project is mandatory for entering an expense report +PrefillExpenseReportDatesWithCurrentMonth=Pre-fill start and end dates of new expense report with start and end dates of the current month +ForceExpenseReportsLineAmountsIncludingTaxesOnly=Force the entry of expense report amounts always in amount with taxes AttachMainDocByDefault=Set this to 1 if you want to attach main document to email by default (if applicable) FilesAttachedToEmail=Attach file SendEmailsReminders=Send agenda reminders by emails @@ -2157,7 +2158,7 @@ NoWritableFilesFoundIntoRootDir=No writable files or directories of the common p RecommendedValueIs=Recommended: %s Recommended=Recommended NotRecommended=Not recommended -ARestrictedPath=A restricted path +ARestrictedPath=Some restricted path CheckForModuleUpdate=Check for external modules updates CheckForModuleUpdateHelp=This action will connect to editors of external modules to check if a new version is available. ModuleUpdateAvailable=An update is available diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index e475a815ac9..afdff97ded6 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -265,6 +265,7 @@ DateInvoice=Invoice date DatePointOfTax=Point of tax NoInvoice=No invoice NoOpenInvoice=No open invoice +NbOfOpenInvoices=Number of open invoices ClassifyBill=Classify invoice SupplierBillsToPay=Unpaid vendor invoices CustomerBillsUnpaid=Unpaid customer invoices diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index b68b62c2a43..fb6e20adcca 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1155,4 +1155,5 @@ ConfirmMassLeaveApproval=Mass leave approval confirmation RecordAproved=Record approved RecordsApproved=%s Record(s) approved Properties=Properties -hasBeenValidated=%s has been validated \ No newline at end of file +hasBeenValidated=%s has been validated +ClientTZ=Client Time Zone (user) diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index 763af20c6b4..71e44e8f281 100644 --- a/htdocs/langs/en_US/productbatch.lang +++ b/htdocs/langs/en_US/productbatch.lang @@ -37,7 +37,8 @@ ManufacturingDate=Manufacturing date DestructionDate=Destruction date FirstUseDate=First use date QCFrequency=Quality control frequency (in days) - +ShowAllLots=Show all lots +HideLots=Hide lots #Traceability - qc status OutOfOrder=Out of order InWorkingOrder=In working order diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6f6d74c0cda..7775071a55c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -465,13 +465,13 @@ if (!defined('NOTOKENRENEWAL') && !defined('NOSESSION')) { if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN')) || defined('CSRFCHECK_WITH_TOKEN')) { // Array of action code where CSRFCHECK with token will be forced (so token must be provided on url request) $sensitiveget = false; - if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') == 2) { + if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) { // All GET actions and mass actions are processed as sensitive. $sensitiveget = true; - } else { - // Only GET actions coded with a &token into url are processed as sensitive. + } elseif (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 2) { + // Few GET actions coded with a &token into url are processed as sensitive. $arrayofactiontoforcetokencheck = array( - 'activate', 'add', 'addrights', 'addtimespent', + 'activate', 'doprev', 'donext', 'dvprev', 'dvnext', 'install', 'reopen' @@ -479,7 +479,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt( if (in_array(GETPOST('action', 'aZ09'), $arrayofactiontoforcetokencheck)) { $sensitiveget = true; } - if (preg_match('/^(classify|close|confirm|del|disable|enable|remove|set|unset|update)/', GETPOST('action', 'aZ09'))) { + if (preg_match('/^(add|classify|close|confirm|copy|del|disable|enable|remove|set|unset|update|save)/', GETPOST('action', 'aZ09'))) { $sensitiveget = true; } } @@ -3081,7 +3081,7 @@ if (!function_exists("llxFooter")) { */ function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) { - global $conf, $db, $langs, $user, $mysoc, $object; + global $conf, $db, $langs, $user, $mysoc, $object, $hookmanager; global $delayedhtmlcontent; global $contextpage, $page, $limit; global $dolibarr_distrib; @@ -3304,6 +3304,11 @@ if (!function_exists("llxFooter")) { } } + $reshook = $hookmanager->executeHooks('beforeBodyClose'); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + print $hookmanager->resPrint; + } + print "\n"; print "\n"; } diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 1b3cc468e5c..43e9c87c6e6 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -124,7 +124,7 @@ if ($socid > 0) { print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client)); $tmpcheck = $object->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongCustomerCode").')'; + print ' ('.$langs->trans("WrongCustomerCode").')'; } print ''; } @@ -135,7 +135,7 @@ if ($socid > 0) { print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); $tmpcheck = $object->check_codefournisseur(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongSupplierCode").')'; + print ' ('.$langs->trans("WrongSupplierCode").')'; } print ''; } diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 4a3f9fd6e25..ea0af722885 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2309,7 +2309,7 @@ if ($module == 'initmodule') { $i++; } } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print ''; @@ -3106,7 +3106,7 @@ if ($module == 'initmodule') { print ''; } } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print ''; @@ -3199,7 +3199,7 @@ if ($module == 'initmodule') { print ''; } } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print ''; @@ -3696,7 +3696,7 @@ if ($module == 'initmodule') { print ''; } } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print ''; diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index 4e154b5665d..9126da0070d 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -301,11 +301,14 @@ class doc_generic_myobject_odt extends ModelePDFMyObject // Recipient name $contactobject = null; if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index 1b95a2a0c20..1a435d3763d 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -1110,7 +1110,7 @@ class pdf_standard_myobject extends ModelePDFMyObject } // Recipient name - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index 8fbd25090c7..59b4cbfa16b 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -22,7 +22,7 @@ require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; /** - * \file mrp/class/api_mo.class.php + * \file htdocs/mrp/class/api_mos.class.php * \ingroup mrp * \brief File for API management of MO. */ diff --git a/htdocs/mrp/lib/mrp_mo.lib.php b/htdocs/mrp/lib/mrp_mo.lib.php index 8fe07df89c1..08bc07f298a 100644 --- a/htdocs/mrp/lib/mrp_mo.lib.php +++ b/htdocs/mrp/lib/mrp_mo.lib.php @@ -104,5 +104,7 @@ function moPrepareHead($object) //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'mo@mrp'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'mo@mrp', 'remove'); + return $head; } diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 84dab109b91..784b91f6f4c 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -704,7 +704,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $newlinetext = ''; if ($object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED && $action != 'consumeorproduce' && $action != 'consumeandproduceall') { - $newlinetext = ''.$langs->trans("AddNewConsumeLines").''; + $newlinetext = ''.$langs->trans("AddNewConsumeLines").''; } print load_fiche_titre($langs->trans('Consumption'), '', '', 0, '', '', $newlinetext); @@ -996,7 +996,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $newlinetext = ''; if ($object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED && $action != 'consumeorproduce' && $action != 'consumeandproduceall') { if ($nblinetoproduce == 0 || $object->mrptype == 1) { - $newlinetext = ''.$langs->trans("AddNewProduceLines").''; + $newlinetext = ''.$langs->trans("AddNewProduceLines").''; } } print load_fiche_titre($langs->trans('Production'), '', '', 0, '', '', $newlinetext); diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index c32b49ff1a1..19aff377c65 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -254,18 +254,6 @@ if ($action == 'edit') { } print ''; -// EMail -//If linked user, then emails are going to be sent to users' email -if (!$object->fk_user_creat) { - print ''.$langs->trans("EMail").''; - if ($action == 'edit') { - print ''; - } else { - print dol_print_email($object->mail_admin, 0, 0, 1, 0, 1, 1); - } - print ''; -} - // Receive an email with each vote print ''.$langs->trans('ToReceiveEMailForEachVote').''; if ($action == 'edit') { @@ -323,10 +311,14 @@ print ''; // Author print ''; print $langs->trans("Author").''; -if ($object->fk_user_creat) { +if ($object->fk_user_creat > 0) { print $userstatic->getLoginUrl(1); } else { - print dol_htmlentities($object->nom_admin); + if ($action == 'edit') { + print ''; + } else { + print dol_print_email($object->mail_admin, 0, 0, 1, 0, 1, 1); + } } print ''; diff --git a/htdocs/opensurvey/wizard/create_survey.php b/htdocs/opensurvey/wizard/create_survey.php index 30e662be7ea..6ed1f2073d2 100644 --- a/htdocs/opensurvey/wizard/create_survey.php +++ b/htdocs/opensurvey/wizard/create_survey.php @@ -170,7 +170,7 @@ if ($_SESSION["mailsonde"]) { $cochemail = "checked"; } -print ' '.$langs->trans("ToReceiveEMailForEachVote").'
'."\n"; +print '
'."\n"; if ($_SESSION['allow_comments']) { $allow_comments = 'checked'; @@ -178,7 +178,7 @@ if ($_SESSION['allow_comments']) { if (GETPOSTISSET('allow_comments')) { $allow_comments = GETPOST('allow_comments') ? 'checked' : ''; } -print ' '.$langs->trans('CanComment').'
'."\n"; +print '
'."\n"; if ($_SESSION['allow_spy']) { $allow_spy = 'checked'; @@ -186,7 +186,7 @@ if ($_SESSION['allow_spy']) { if (GETPOSTISSET('allow_spy')) { $allow_spy = GETPOST('allow_spy') ? 'checked' : ''; } -print ' '.$langs->trans('CanSeeOthersVote').'
'."\n"; +print '
'."\n"; if (GETPOST('choix_sondage')) { if (GETPOST('choix_sondage') == 'date') { diff --git a/htdocs/product/admin/dynamic_prices.php b/htdocs/product/admin/dynamic_prices.php index 9a354a8dcdb..e1e23feac86 100644 --- a/htdocs/product/admin/dynamic_prices.php +++ b/htdocs/product/admin/dynamic_prices.php @@ -182,9 +182,9 @@ if ($action != 'create_updater' && $action != 'edit_updater') { print ''; } } else { - print ''; + print ''; print $langs->trans("None"); - print ''; + print ''; } print ''; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 80378bd1b2a..b4c951a953f 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -640,7 +640,7 @@ if (empty($reshook)) { // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost(null, $object); + $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); if ($ret < 0) { $error++; } diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 9804daf1bba..e7709b3af41 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -462,7 +462,7 @@ class Products extends DolibarrApi $childsArbo = $this->product->getChildsArbo($id, 1); - $keys = array('rowid', 'qty', 'fk_product_type', 'label', 'incdec'); + $keys = array('rowid', 'qty', 'fk_product_type', 'label', 'incdec', 'ref'); $childs = array(); foreach ($childsArbo as $values) { $childs[] = array_combine($keys, $values); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index de88ec9f277..3be832dcea3 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5111,7 +5111,7 @@ class Product extends CommonObject * * @param User $user user asking change * @param int $id_entrepot id of warehouse - * @param double $nbpiece nb of units + * @param double $nbpiece nb of units (should be always positive, use $movement to decide if we add or remove) * @param int $movement 0 = add, 1 = remove * @param string $label Label of stock movement * @param double $price Unit price HT of product, used to calculate average weighted price (PMP in french). If 0, average weighted price is not changed. @@ -5129,11 +5129,18 @@ class Product extends CommonObject include_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; + if ($nbpiece < 0) { + if (!$movement) { + $movement = 1; + } + $nbpiece = abs($nbpiece); + } + $op[0] = "+".trim($nbpiece); $op[1] = "-".trim($nbpiece); $movementstock = new MouvementStock($this->db); - $movementstock->setOrigin($origin_element, $origin_id); // Set ->origin and ->origin->id + $movementstock->setOrigin($origin_element, $origin_id); // Set ->origin_type and ->origin_id $result = $movementstock->_create($user, $this->id, $id_entrepot, $op[$movement], $movement, $price, $label, $inventorycode, '', '', '', '', false, 0, $disablestockchangeforsubproduct); if ($result >= 0) { @@ -5155,7 +5162,7 @@ class Product extends CommonObject * * @param User $user user asking change * @param int $id_entrepot id of warehouse - * @param double $nbpiece nb of units + * @param double $nbpiece nb of units (should be always positive, use $movement to decide if we add or remove) * @param int $movement 0 = add, 1 = remove * @param string $label Label of stock movement * @param double $price Price to use for stock eval @@ -5176,11 +5183,18 @@ class Product extends CommonObject include_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; + if ($nbpiece < 0) { + if (!$movement) { + $movement = 1; + } + $nbpiece = abs($nbpiece); + } + $op[0] = "+".trim($nbpiece); $op[1] = "-".trim($nbpiece); $movementstock = new MouvementStock($this->db); - $movementstock->setOrigin($origin_element, $origin_id); + $movementstock->setOrigin($origin_element, $origin_id); // Set ->origin_type and ->fk_origin $result = $movementstock->_create($user, $this->id, $id_entrepot, $op[$movement], $movement, $price, $label, $inventorycode, '', $dlc, $dluo, $lot, false, 0, $disablestockchangeforsubproduct); if ($result >= 0) { diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 5f783d190e9..2cecfc84bc4 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -24,7 +24,7 @@ /** * \file htdocs/product/composition/card.php * \ingroup product - * \brief Page de la fiche produit + * \brief Page of product file */ require '../../main.inc.php'; @@ -335,19 +335,28 @@ if ($id > 0 || !empty($ref)) { print ''; print ''; - print ''; + print '
'; print ''; + // Rank print ''; + // Product ref print ''; + // Product label print ''; + // Min supplier price print ''; + // Min customer price print ''; + // Stock if (!empty($conf->stock->enabled)) { print ''; } + // Qty in kit print ''; + // Stoc inc/dev print ''; + // Move print ''; print ''."\n"; @@ -359,12 +368,16 @@ if ($id > 0 || !empty($ref)) { if ($value['level'] <= 1) { print ''; + // Rank print ''; $notdefined = 0; $nb_of_subproduct = $value['nb']; + // Product ref print ''; + + // Product label print ''; // Best buying price @@ -423,8 +436,9 @@ if ($id > 0 || !empty($ref)) { print ''; } - print ''; + // Move action + print ''; + print ''."\n"; } else { $hide = ''; @@ -436,12 +450,18 @@ if ($id > 0 || !empty($ref)) { //$productstatic->ref=$value['label']; $productstatic->ref = $value['ref']; + + // Rankd print ''; + + // Product ref print ''; + + // Product label print ''; // Best buying price @@ -451,19 +471,36 @@ if ($id > 0 || !empty($ref)) { print ''; print ''; + // Stock if (!empty($conf->stock->enabled)) { print ''; // Real stock } + + // Qty in kit print ''; + + // Inc/dec print ''; + + // Action move print ''; print ''."\n"; } } + + // Total + print ''; + + // Rank + print ''; + + // Product ref print ''; + + // Product label print ''; // Minimum buying price @@ -495,11 +532,16 @@ if ($id > 0 || !empty($ref)) { print ''; } - print ''; + + print ''; + + print ''; + print ''."\n"; } else { $colspan = 8; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 285331a091a..a3ae38184e9 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -767,11 +767,6 @@ END; // Barcode if (!empty($conf->barcode->enabled)) { - // Option to define a transport cost on supplier price - print ''; - print ''; - print ''; - print ''; $formbarcode = new FormBarCode($db); // Barcode type @@ -781,6 +776,12 @@ END; print $formbarcode->selectBarcodeType(($rowid ? $object->supplier_fk_barcode_type : $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE), 'fk_barcode_type', 1); print ''; print ''; + + // Barcode value + print ''; + print ''; + print ''; + print ''; } // Option to define a transport cost on supplier price @@ -788,7 +789,7 @@ END; if (!empty($conf->margin->enabled)) { print ''; print ''; - print ''; print ''; } @@ -893,7 +894,7 @@ END; $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { if ($usercancreate) { - print ''; + print ''; print $langs->trans("AddSupplierPrice").''; } } @@ -933,8 +934,8 @@ END; 'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => $conf->multicurrency->enabled, 'checked'=>0, 'position'=>10), 'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>1, 'position'=>13), 'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>1, 'position'=>14), - 'pfp.barcode'=>array('label'=>$langs->trans("BarcodeValue"), 'enabled' => $conf->barcode->enabled, 'checked'=>0, 'position'=>15), - 'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => $conf->barcode->enabled, 'checked'=>0, 'position'=>16), + 'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => $conf->barcode->enabled, 'checked'=>0, 'position'=>15), + 'pfp.barcode'=>array('label'=>$langs->trans("BarcodeValue"), 'enabled' => $conf->barcode->enabled, 'checked'=>0, 'position'=>16), 'pfp.packaging'=>array('label'=>$langs->trans("PackagingForThisProduct"), 'enabled' => !empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING), 'checked'=>0, 'position'=>17), 'pfp.tms'=>array('label'=>$langs->trans("DateModification"), 'enabled' => $conf->barcode->enabled, 'checked'=>1, 'position'=>18), ); @@ -1007,12 +1008,12 @@ END; if (!empty($arrayfields['pfp.supplier_reputation']['checked'])) { print_liste_field_titre("ReputationForThisProduct", $_SERVER["PHP_SELF"], "pfp.supplier_reputation", "", $param, '', $sortfield, $sortorder, 'center '); } - if (!empty($arrayfields['pfp.barcode']['checked'])) { - print_liste_field_titre("BarcodeValue", $_SERVER["PHP_SELF"], "pfp.barcode", "", $param, '', $sortfield, $sortorder, 'center '); - } if (!empty($arrayfields['pfp.fk_barcode_type']['checked'])) { print_liste_field_titre("BarcodeType", $_SERVER["PHP_SELF"], "pfp.fk_barcode_type", "", $param, '', $sortfield, $sortorder, 'center '); } + if (!empty($arrayfields['pfp.barcode']['checked'])) { + print_liste_field_titre("BarcodeValue", $_SERVER["PHP_SELF"], "pfp.barcode", "", $param, '', $sortfield, $sortorder, 'center '); + } if (!empty($arrayfields['pfp.packaging']['checked'])) { print_liste_field_titre("PackagingForThisProduct", $_SERVER["PHP_SELF"], "pfp.packaging", "", $param, 'align="center"', $sortfield, $sortorder); } @@ -1152,13 +1153,6 @@ END; print''; } - // Barcode - if (!empty($arrayfields['pfp.barcode']['checked'])) { - print ''; - } - // Barcode type if (!empty($arrayfields['pfp.fk_barcode_type']['checked'])) { print ''; } + // Barcode + if (!empty($arrayfields['pfp.barcode']['checked'])) { + print ''; + } + // Packaging if (!empty($arrayfields['pfp.packaging']['checked'])) { print ''; print ''; } print ''; @@ -799,7 +801,7 @@ if ($object->id > 0) { print ''; // Call method to disable the button if no qty entered yet for inventory - if ($object->status != $object::STATUS_VALIDATED || $totalfound == 0) { + if ($object->status != $object::STATUS_VALIDATED || !$hasinput) { print ''; @@ -77,10 +94,6 @@ if ($object->element == 'product') { $ident = $conf->global->MAIN_DEFAULT_WAREHOUSE; } print img_picto('', 'stock').$formproduct->selectWarehouses($ident, 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100'); - print '   '; print ''; } if ($object->element == 'stock') { @@ -88,14 +101,19 @@ if ($object->element == 'stock') { print ''; } print ''; -print ''; +print ''; print ''; // If product is a Kit, we ask if we must disable stock change of subproducts diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php index 27c9b2acb21..3e2adf8a169 100644 --- a/htdocs/product/stock/tpl/stocktransfer.tpl.php +++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php @@ -89,7 +89,7 @@ if ($object->element == 'stock') { print ''; -print ''; +print ''; print ''; // Serial / Eat-by date diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 37019d85274..83f27c11796 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1089,6 +1089,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print ''; print ''; print ''; + print ''; // Form to convert time spent into invoice if ($massaction == 'generateinvoice') { diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index bbb4a85aadf..0932b17baf5 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -281,7 +281,7 @@ print ''; print '
'; print '
'; print '
'.$langs->trans("DemoDesc").'

'; -print '
'.$langs->trans("ChooseYourDemoProfil").'
'; +print '
'.$langs->trans("ChooseYourDemoProfil").'
'; print '
'; print '
'; diff --git a/htdocs/public/eventorganization/attendee_register.php b/htdocs/public/eventorganization/attendee_register.php index a454f214316..4dad36e4d03 100644 --- a/htdocs/public/eventorganization/attendee_register.php +++ b/htdocs/public/eventorganization/attendee_register.php @@ -690,14 +690,14 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO print '
'.$langs->trans('Rank').''.$langs->trans('ComposedProduct').''.$langs->trans('Label').''.$langs->trans('MinSupplierPrice').''.$langs->trans('MinCustomerPrice').''.$langs->trans('Stock').''.$langs->trans('Qty').''.$langs->trans('ComposedProductIncDecStock').'
'.$object->sousprods[$parent_label][$value['id']][7].''.$productstatic->getNomUrl(1, 'composition').''.$productstatic->label.''.($value['incdec'] == 1 ? 'x' : '').''; - print '
'; for ($i = 0; $i < $value['level']; $i++) { print '     '; // Add indentation } print $productstatic->getNomUrl(1, 'composition').''.$productstatic->label.'  '.$value['nb'].'  
 '; + print ''; if ($user->rights->produit->creer || $user->rights->service->creer) { print ''; } print '
'.$langs->trans('BarcodeValue').''.img_picto('', 'barcode', 'class="pictofixedwidth"').'
'.$langs->trans('BarcodeValue').''.img_picto('', 'barcode', 'class="pictofixedwidth"').'
'.$langs->trans("Charges").''; + print ''; print '
'; - print $productfourn->supplier_barcode; - print ''; @@ -1168,6 +1162,13 @@ END; print ''; + print $productfourn->supplier_barcode; + print ''; diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 2ebde580db7..c0b607cde45 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -716,7 +716,7 @@ if ($object->id > 0) { $num = $db->num_rows($resql); $i = 0; - $totalfound = 0; + $hasinput = false; $totalarray = array(); while ($i < $num) { $obj = $db->fetch_object($resql); @@ -766,7 +766,10 @@ if ($object->id > 0) { print ''; if ($object->status == $object::STATUS_VALIDATED) { $qty_view = GETPOST("id_".$obj->rowid) && price2num(GETPOST("id_".$obj->rowid), 'MS') >= 0 ? GETPOST("id_".$obj->rowid) : $obj->qty_view; - $totalfound += price2num($qty_view, 'MS'); + if (!$hasinput && $qty_view !== null && $obj->qty_stock != $qty_view) { + $hasinput = true; + } + print ''; print ''; @@ -777,7 +780,6 @@ if ($object->id > 0) { print ''; } else { print $obj->qty_view; - $totalfound += $obj->qty_view; print '
'; print img_picto('', 'product'); $form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES) ? '0' : ''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500'); - print '   '; print ''.$langs->trans("NumberOfUnit").''; +if ($object->element == 'product' || $object->element == 'stock') { + print ''; + print ajax_combobox("mouvement"); +} +print ''; +print '
'.$langs->trans("WarehouseTarget").''; print img_picto('', 'stock').$formproduct->selectWarehouses(GETPOST('id_entrepot_destination'), 'id_entrepot_destination', 'warehouseopen,warehouseinternal', 1); print '
'.$langs->trans("NumberOfUnit").'
'.$langs->trans("NumberOfUnit").'
' . "\n"; // Email - print '' . "\n"; // Company print ''; // Country - print ''."\n"; } else { @@ -585,7 +585,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Moral"); if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { - print ''."\n"; } else { @@ -601,18 +601,18 @@ print ''.$langs->trans('UserTitle').''."\n"; // Lastname -print ''."\n"; +print ''."\n"; // Firstname -print ''."\n"; +print ''."\n"; // EMail print ''."\n"; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; } // Gender print ''; @@ -679,7 +679,7 @@ print ''."\n"; // TODO Move this into generic feature. if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { $arraybudget = array('50'=>'<= 100 000', '100'=>'<= 200 000', '200'=>'<= 500 000', '300'=>'<= 1 500 000', '600'=>'<= 3 000 000', '1000'=>'<= 5 000 000', '2000'=>'5 000 000+'); - print ''; } @@ -229,7 +229,7 @@ if ($object->fournisseur) { print $object->code_fournisseur; $tmpcheck = $object->check_codefournisseur(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongSupplierCode").')'; + print ' ('.$langs->trans("WrongSupplierCode").')'; } print ''; } @@ -525,7 +525,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print "\n".'
'."\n"; if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + print ''; } print "\n
\n"; diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index c6256324257..ef68a03ab78 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -112,7 +112,7 @@ if ($socid) { print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client)); $tmpcheck = $object->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongCustomerCode").')'; + print ' ('.$langs->trans("WrongCustomerCode").')'; } print ''; } @@ -123,7 +123,7 @@ if ($socid) { print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); $tmpcheck = $object->check_codefournisseur(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongSupplierCode").')'; + print ' ('.$langs->trans("WrongSupplierCode").')'; } print ''; } diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 7425f094958..d0511d53a1f 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -181,7 +181,7 @@ if ($id > 0 || !empty($ref)) { print $object->code_client; $tmpcheck = $object->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongCustomerCode").')'; + print ' ('.$langs->trans("WrongCustomerCode").')'; } print ''; } @@ -192,7 +192,7 @@ if ($id > 0 || !empty($ref)) { print $object->code_fournisseur; $tmpcheck = $object->check_codefournisseur(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongSupplierCode").')'; + print ' ('.$langs->trans("WrongSupplierCode").')'; } print ''; } diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 0ea53355629..0bc51450e44 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -222,7 +222,7 @@ if ($object->client) { print $object->code_client; $tmpcheck = $object->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongCustomerCode").')'; + print ' ('.$langs->trans("WrongCustomerCode").')'; } print ''; } @@ -233,7 +233,7 @@ if ($object->fournisseur) { print $object->code_fournisseur; $tmpcheck = $object->check_codefournisseur(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongSupplierCode").')'; + print ' ('.$langs->trans("WrongSupplierCode").')'; } print ''; } diff --git a/htdocs/stripe/lib/stripe.lib.php b/htdocs/stripe/lib/stripe.lib.php index 8749847b958..b0503a7103f 100644 --- a/htdocs/stripe/lib/stripe.lib.php +++ b/htdocs/stripe/lib/stripe.lib.php @@ -118,9 +118,9 @@ function html_print_stripe_footer($fromcompany, $langs) } print '


'."\n"; - print '
'."\n"; + print '
'."\n"; print $fromcompany->name.'
'; print $line1.'
'; print $line2; - print '
'."\n"; + print '
'."\n"; } diff --git a/htdocs/support/index.php b/htdocs/support/index.php index 4c80445865b..7330c034aa7 100644 --- a/htdocs/support/index.php +++ b/htdocs/support/index.php @@ -83,9 +83,9 @@ print '
' . $langs->trans("EmailAttendee") . '*'; + print '
' . $langs->trans("EmailAttendee") . '*'; print img_picto('', 'email', 'class="pictofixedwidth"'); print '
' . $langs->trans("Company"); if (!empty(floatval($project->price_registration))) { - print '*'; + print '*'; } print ' '; print img_picto('', 'company', 'class="pictofixedwidth"'); @@ -722,7 +722,7 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO print '
' . $langs->trans('Country') . '*'; + print '
' . $langs->trans('Country') . '*'; print img_picto('', 'country', 'class="pictofixedwidth"'); $country_id = GETPOST('country_id'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index b6498ca4032..5c7de4c321e 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -381,7 +381,7 @@ if (empty($reshook) && $action == 'add') { $urlback = $conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION; // TODO Make replacement of __AMOUNT__, etc... } else { - $urlback = $_SERVER["PHP_SELF"]."?action=added"; + $urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken(); } if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE) && $conf->global->MEMBER_NEWFORM_PAYONLINE != '-1') { @@ -573,7 +573,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { $defaulttype = $tmp[0]; $isempty = 0; } - print '
'.$langs->trans("Type").' *'; + print '
'.$langs->trans("Type").' *'; print $form->selectarray("typeid", $adht->liste_array(1), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty); print '
'.$langs->trans('MemberNature').' *'."\n"; + print '
'.$langs->trans('MemberNature').' *'."\n"; print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); print '
'; print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
'.$langs->trans("Lastname").' *
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''; //print img_picto('', 'email', 'class="pictofixedwidth"'); print '
'.$langs->trans("Login").' *
'.$langs->trans("Password").' *
'.$langs->trans("PasswordAgain").' *
'.$langs->trans("Login").' *
'.$langs->trans("Password").' *
'.$langs->trans("PasswordAgain").' *
'.$langs->trans("Gender").'
'.$langs->trans("TurnoverOrBudget").' *'; + print '
'.$langs->trans("TurnoverOrBudget").' *'; print $form->selectarray('budget', $arraybudget, GETPOST('budget'), 1); print ' € or $'; diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 6894e6a18c8..606bed0c490 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -190,7 +190,7 @@ if (!empty($_SESSION['ipaddress'])) { // To avoid to make action twice $urlback = $_SERVER["REQUEST_URI"]; $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentFailed"); $content = ""; - $content .= ''.$companylangs->transnoentitiesnoconv("ValidationOfOnlinePaymentFailed")."\n"; + $content .= ''.$companylangs->transnoentitiesnoconv("ValidationOfOnlinePaymentFailed")."\n"; $content .= "

\n"; $content .= ''.$companylangs->transnoentitiesnoconv("TechnicalInformation").":
\n"; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 70a684f5932..18d6a2987c8 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1506,12 +1506,12 @@ if ($ispaymentok) { $content .= $companylangs->transnoentities("PostActionAfterPayment").' : '; if ($ispostactionok > 0) { //$topic.=' ('.$companylangs->transnoentitiesnoconv("Status").' '.$companylangs->transnoentitiesnoconv("OK").')'; - $content .= ''.$companylangs->transnoentitiesnoconv("OK").''; + $content .= ''.$companylangs->transnoentitiesnoconv("OK").''; } elseif ($ispostactionok == 0) { $content .= $companylangs->transnoentitiesnoconv("None"); } else { $topic .= ($ispostactionok ? '' : ' ('.$companylangs->trans("WarningPostActionErrorAfterPayment").')'); - $content .= ''.$companylangs->transnoentitiesnoconv("Error").''; + $content .= ''.$companylangs->transnoentitiesnoconv("Error").''; } $content .= '
'."\n"; foreach ($postactionmessages as $postactionmessage) { @@ -1630,7 +1630,7 @@ if ($ispaymentok) { $urlback = $_SERVER["REQUEST_URI"]; $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("ValidationOfPaymentFailed"); $content = ""; - $content .= ''.$companylangs->transnoentitiesnoconv("PaymentSystemConfirmPaymentPageWasCalledButFailed")."\n"; + $content .= ''.$companylangs->transnoentitiesnoconv("PaymentSystemConfirmPaymentPageWasCalledButFailed")."\n"; $content .= "

\n"; $content .= ''.$companylangs->transnoentitiesnoconv("TechnicalInformation").":
\n"; diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index ca7101a3679..b9b68c5e2e9 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -311,7 +311,7 @@ if (empty($reshook) && $action == 'add') { $urlback = $conf->global->PROJECT_URL_REDIRECT_LEAD; // TODO Make replacement of __AMOUNT__, etc... } else { - $urlback = $_SERVER["PHP_SELF"]."?action=added"; + $urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken(); } if (!empty($entity)) { @@ -415,9 +415,9 @@ jQuery(document).ready(function () { print ''."\n"; // Lastname -print ''."\n"; +print ''."\n"; // Firstname -print ''."\n"; +print ''."\n"; // Company print ''."\n"; // Address @@ -460,7 +460,7 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print ''; } // EMail -print ''."\n"; +print ''."\n"; // Other attributes $tpl_context = 'public'; // define template context to public include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 4598859b7b6..b07b7350372 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -577,13 +577,13 @@ jQuery(document).ready(function () { print '
'.$langs->trans("Lastname").' *
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Company").'
'.$langs->trans("Email").' *
'.$langs->trans("Email").' *
'."\n"; // Name -print ''; +print ''; print ''; print ''; // Email -print ''."\n"; +print ''."\n"; // Company -print ''."\n"; // Address print ''; } // Type of event -print ''."\n"; +print ''."\n"; print ''; // Label -print ''."\n"; +print ''."\n"; print ''."\n"; // Note -print ''."\n"; +print ''."\n"; print ''."\n"; // Start Date -print ''."\n"; // End Date -print ''; } @@ -163,7 +163,7 @@ if ($object->id) { print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); $tmpcheck = $object->check_codefournisseur(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongSupplierCode").')'; + print ' ('.$langs->trans("WrongSupplierCode").')'; } print ''; } diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index c896d4df70a..b932fb11595 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -118,7 +118,7 @@ if ($object->id > 0) { print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client)); $tmpcheck = $object->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongCustomerCode").')'; + print ' ('.$langs->trans("WrongCustomerCode").')'; } print ''; } @@ -129,7 +129,7 @@ if ($object->id > 0) { print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); $tmpcheck = $object->check_codefournisseur(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongSupplierCode").')'; + print ' ('.$langs->trans("WrongSupplierCode").')'; } print ''; } diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index b52b8b4a650..4ed16e948c5 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -178,7 +178,7 @@ if ($result > 0) { print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client)); $tmpcheck = $object->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongCustomerCode").')'; + print ' ('.$langs->trans("WrongCustomerCode").')'; } print ''; } @@ -189,7 +189,7 @@ if ($result > 0) { print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); $tmpcheck = $object->check_codefournisseur(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongSupplierCode").')'; + print ' ('.$langs->trans("WrongSupplierCode").')'; } print ''; } diff --git a/htdocs/societe/partnership.php b/htdocs/societe/partnership.php index 85223e856f3..443126290ab 100644 --- a/htdocs/societe/partnership.php +++ b/htdocs/societe/partnership.php @@ -189,7 +189,7 @@ if ($id > 0) { print showValueWithClipboardCPButton(dol_escape_htmltag($societe->code_client)); $tmpcheck = $societe->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongCustomerCode").')'; + print ' ('.$langs->trans("WrongCustomerCode").')'; } print ''; } @@ -200,7 +200,7 @@ if ($id > 0) { print showValueWithClipboardCPButton(dol_escape_htmltag($societe->code_fournisseur)); $tmpcheck = $societe->check_codefournisseur(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongSupplierCode").')'; + print ' ('.$langs->trans("WrongSupplierCode").')'; } print ''; print ''; diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index f80bebd9bf5..6a0b9fac742 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -761,7 +761,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client)); $tmpcheck = $object->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongCustomerCode").')'; + print ' ('.$langs->trans("WrongCustomerCode").')'; } print ''; $sql = "SELECT count(*) as nb from ".MAIN_DB_PREFIX."facture where fk_soc = ".((int) $socid); @@ -823,7 +823,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); $tmpcheck = $object->check_codefournisseur(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongSupplierCode").')'; + print ' ('.$langs->trans("WrongSupplierCode").')'; } print ''; $sql = "SELECT count(*) as nb from ".MAIN_DB_PREFIX."facture where fk_soc = ".((int) $socid); @@ -1032,7 +1032,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print $img ? $img.' ' : ''; print getCountry($companypaymentmodetemp->country_code, 1); } else { - print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; + print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; } print ''; // Default @@ -1141,7 +1141,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print $img ? $img.' ' : ''; print getCountry($src->country, 1); } else { - print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; + print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; } } elseif ($src->object == 'source' && $src->type == 'card') { print ''.$src->owner->name.'
....'.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year.''; @@ -1152,7 +1152,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print $img ? $img.' ' : ''; print getCountry($src->card->country, 1); } else { - print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; + print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; } } elseif ($src->object == 'source' && $src->type == 'sepa_debit') { print ''.$src->billing_details->name.'
....'.$src->sepa_debit->last4; @@ -1162,7 +1162,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print $img ? $img.' ' : ''; print getCountry($src->sepa_debit->country, 1); } else { - print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; + print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; } } elseif ($src->object == 'payment_method' && $src->type == 'card') { print ''.$src->billing_details->name.'
....'.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year.''; @@ -1173,7 +1173,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print $img ? $img.' ' : ''; print getCountry($src->card->country, 1); } else { - print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; + print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; } } elseif ($src->object == 'payment_method' && $src->type == 'sepa_debit') { print ''.$src->billing_details->name.'
....'.$src->sepa_debit->last4; @@ -1183,7 +1183,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print $img ? $img.' ' : ''; print getCountry($src->sepa_debit->country, 1); } else { - print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; + print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; } } else { print ''; + print ''; } print "
lastname).'" autofocus="autofocus">
'.$langs->trans("Email").'*
'.$langs->trans("Email").'*
'.$langs->trans("Company").'*'; +print '
'.$langs->trans("Company").'*'; print '
'.$langs->trans("Address").''."\n"; @@ -628,16 +628,16 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print '
'.$langs->trans("EventType").'*
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
'.$langs->trans("LabelOfBooth").'*
'.$langs->trans("LabelOfBooth").'*
'.$langs->trans("Description").'*
'.$langs->trans("Description").'*
'.$langs->trans("DateStart").'*'; +print '
'.$langs->trans("DateStart").'*'; if (!empty($project->date_start)) { print '('.$langs->trans('Min'). ' '.dol_print_date($project->date_start).')'; } @@ -646,7 +646,7 @@ print ''; print $form->selectDate((empty($datestart)?$project->date_start:$datestart), 'datestart'); print '
'.$langs->trans("DateEnd").'*'; +print '
'.$langs->trans("DateEnd").'*'; if (!empty($project->date_end)) { print '('.$langs->trans('Max'). ' '.dol_print_date($project->date_end).')'; } diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index dc79346b427..3119c7831a9 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -508,17 +508,17 @@ jQuery(document).ready(function () { print ''."\n"; // Last Name -print ''; +print ''; print ''; print ''; // First Name -print ''; +print ''; print ''; print ''; // Email -print ''."\n"; +print ''."\n"; // Company -print ''."\n"; // Address print ''; } // Type of event -print ''."\n"; +print ''."\n"; print ''; // Label -print ''."\n"; +print ''."\n"; print ''."\n"; // Note -print ''."\n"; +print ''."\n"; print ''."\n"; // Start Date print ''."\n"; diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index b7f3f577ce2..f32e09aa580 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -618,11 +618,13 @@ if ($search_ref_supplier) { $param .= "&search_ref_supplier=".urlencode($search_ref_supplier); } // Add $param from extra fields -foreach ($search_array_options as $key => $val) { - $crit = $val; - $tmpkey = preg_replace('/search_options_/', '', $key); - if ($val != '') { - $param .= '&search_options_'.$tmpkey.'='.urlencode($val); +if ($search_array_options) { + foreach ($search_array_options as $key => $val) { + $crit = $val; + $tmpkey = preg_replace('/search_options_/', '', $key); + if ($val != '') { + $param .= '&search_options_' . $tmpkey . '=' . urlencode($val); + } } } diff --git a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php index c037e11f8db..80d4e85435c 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php @@ -294,11 +294,14 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi // Recipient name $contactobject = null; if (!empty($usecontact)) { - if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { - $socobject = $object->contact; + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index 4c6cb84783a..50e978aceab 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -1026,7 +1026,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio } // Recipient name - /*if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + /*if ($usecontact && $object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php b/htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php index a7bfe03aac4..3d3b59a9253 100644 --- a/htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php +++ b/htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php @@ -124,7 +124,7 @@ function getPublicJobPositionUrl($mode, $ref = '', $localorexternal = 0) $urltouse = $urlwithroot; } - $out = $urltouse.'/public/recruitment/view.php?ref='.($mode ? '' : '').$ref.($mode ? '' : ''); + $out = $urltouse.'/public/recruitment/view.php?ref='.($mode ? '' : '').$ref.($mode ? '' : ''); /*if (!empty($conf->global->RECRUITMENT_SECURITY_TOKEN)) { if (empty($conf->global->RECRUITMENT_SECURITY_TOKEN)) $out .= '&securekey='.urlencode($conf->global->RECRUITMENT_SECURITY_TOKEN); diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index 0406c5bc65c..5fbc1029e4e 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -605,7 +605,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; } } else { - print '
'.$langs->trans("CreateDolibarrLogin")."
"; + print '
'.$langs->trans("CreateDolibarrLogin")."
"; } } diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index 9f9a1ae7b50..b1e03866d7e 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/compta/paiement_salary.php + * \file htdocs/salaries/paiement_salary.php * \ingroup salary * \brief Page to add payment of a salary */ diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index 386824bf251..e57421bf8b5 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -62,7 +62,7 @@ print dol_get_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company @@ -73,7 +73,7 @@ print dol_get_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company @@ -134,7 +134,7 @@ for ($i = 1; $i <= 4; $i++) { if ($this->control->tpl['checkprofid'.$i] > 0) { echo '   '.$this->control->tpl['urlprofid'.$i]; } else { - echo ' ('.$langs->trans("ErrorWrongValue").')'; + echo ' ('.$langs->trans("ErrorWrongValue").')'; } } echo ''; diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index 361c6d59f8d..16cd9f1e637 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -57,7 +57,7 @@ if ($this->control->tpl['action_delete']) { @@ -68,7 +68,7 @@ if ($this->control->tpl['action_delete']) { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 027293f9ed9..334793985f0 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2284,7 +2284,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; + print '"> '.$langs->trans("Currency".$conf->currency).''; // Default language if (!empty($conf->global->MAIN_MULTILANGS)) { @@ -2511,7 +2511,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; $tmpcheck = $object->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongCustomerCode").')'; + print ' ('.$langs->trans("WrongCustomerCode").')'; } print ''; print ''; @@ -2524,7 +2524,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); $tmpcheck = $object->check_codefournisseur(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongSupplierCode").')'; + print ' ('.$langs->trans("WrongSupplierCode").')'; } print ''; print ''; @@ -2552,7 +2552,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($object->id_prof_check($i, $object) > 0) { print '   '.$object->id_prof_url($i, $object); } else { - print ' ('.$langs->trans("ErrorWrongValue").')'; + print ' ('.$langs->trans("ErrorWrongValue").')'; } } print ''; diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php index 21cd629dc67..dc88baf0c28 100644 --- a/htdocs/societe/checkvat/checkVatPopup.php +++ b/htdocs/societe/checkvat/checkVatPopup.php @@ -49,7 +49,7 @@ $vatNumber = GETPOST("vatNumber", 'alpha'); if (!$vatNumber) { print '
'; - print ''.$langs->transnoentities("ErrorFieldRequired", $langs->trans("VATIntraShort")).'
'; + print ''.$langs->transnoentities("ErrorFieldRequired", $langs->trans("VATIntraShort")).'
'; } else { $vatNumber = preg_replace('/\^\w/', '', $vatNumber); $vatNumber = str_replace(array(' ', '.'), '', $vatNumber); @@ -97,16 +97,16 @@ if (!$vatNumber) { // Service indisponible if (!is_array($result) || preg_match('/SERVICE_UNAVAILABLE/i', $result['faultstring'])) { - print ''.$langs->trans("ErrorServiceUnavailableTryLater").'
'; + print ''.$langs->trans("ErrorServiceUnavailableTryLater").'
'; $messagetoshow = $soapclient->response; } elseif (preg_match('/TIMEOUT/i', $result['faultstring'])) { - print ''.$langs->trans("ErrorServiceUnavailableTryLater").'
'; + print ''.$langs->trans("ErrorServiceUnavailableTryLater").'
'; $messagetoshow = $soapclient->response; } elseif (preg_match('/SERVER_BUSY/i', $result['faultstring'])) { - print ''.$langs->trans("ErrorServiceUnavailableTryLater").'
'; + print ''.$langs->trans("ErrorServiceUnavailableTryLater").'
'; $messagetoshow = $soapclient->response; } elseif ($result['faultstring']) { - print ''.$langs->trans("Error").'
'; + print ''.$langs->trans("Error").'
'; $messagetoshow = $result['faultstring']; } elseif (preg_match('/INVALID_INPUT/i', $result['faultstring']) || ($result['requestDate'] && !$result['valid'])) { @@ -114,26 +114,26 @@ if (!$vatNumber) { if ($result['requestDate']) { print $langs->trans("Date").': '.$result['requestDate'].'
'; } - print $langs->trans("VATIntraSyntaxIsValid").': '.$langs->trans("No").' (Might be a non europeen VAT)
'; - print $langs->trans("ValueIsValid").': '.$langs->trans("No").' (Might be a non europeen VAT)
'; + print $langs->trans("VATIntraSyntaxIsValid").': '.$langs->trans("No").' (Might be a non europeen VAT)
'; + print $langs->trans("ValueIsValid").': '.$langs->trans("No").' (Might be a non europeen VAT)
'; //$messagetoshow=$soapclient->response; } else { // Syntaxe ok if ($result['requestDate']) { print $langs->trans("Date").': '.$result['requestDate'].'
'; } - print $langs->trans("VATIntraSyntaxIsValid").': '.$langs->trans("Yes").'
'; + print $langs->trans("VATIntraSyntaxIsValid").': '.$langs->trans("Yes").'
'; print $langs->trans("ValueIsValid").': '; if (preg_match('/MS_UNAVAILABLE/i', $result['faultstring'])) { - print ''.$langs->trans("ErrorVATCheckMS_UNAVAILABLE", $countryCode).'
'; + print ''.$langs->trans("ErrorVATCheckMS_UNAVAILABLE", $countryCode).'
'; } else { if (!empty($result['valid']) && ($result['valid'] == 1 || $result['valid'] == 'true')) { - print ''.$langs->trans("Yes").''; + print ''.$langs->trans("Yes").''; print '
'; print $langs->trans("Name").': '.$result['name'].'
'; print $langs->trans("Address").': '.$result['address'].'
'; } else { - print ''.$langs->trans("No").''; + print ''.$langs->trans("No").''; print '
'."\n"; } } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 23c2976d43a..8c5ef8ca5ca 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2575,13 +2575,13 @@ class Societe extends CommonObject $label .= ' '.$this->getLibStatut(5); } - if (!empty($this->name)) { - $label .= '
'.$langs->trans('Name').': '.dol_escape_htmltag($this->name); - if (!empty($this->name_alias)) { - $label .= ' ('.dol_escape_htmltag($this->name_alias).')'; - } + $label .= '
'.$langs->trans('Name').': '.dol_escape_htmltag($this->name); + if (!empty($this->name_alias)) { + $label .= ' ('.dol_escape_htmltag($this->name_alias).')'; + } + if ($this->email) { + $label .= '
'.img_picto('', 'email', 'class="pictofixedwidth"').$this->email; } - $label .= '
'.img_picto('', 'email', 'class="pictofixedwidth"').$this->email; if (!empty($this->phone) || !empty($this->fax)) { $phonelist = array(); if ($this->phone) { diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 5f996e6f37d..c4bd26e1fc2 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -148,7 +148,7 @@ if ($object->client) { print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client)); $tmpcheck = $object->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongCustomerCode").')'; + print ' ('.$langs->trans("WrongCustomerCode").')'; } print ''; $sql = "SELECT count(*) as nb from ".MAIN_DB_PREFIX."facture where fk_soc = ".((int) $socid); @@ -185,7 +185,7 @@ if ($object->fournisseur) { print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); $tmpcheck = $object->check_codefournisseur(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongSupplierCode").')'; + print ' ('.$langs->trans("WrongSupplierCode").')'; } print ''; $sql = "SELECT count(*) as nb from ".MAIN_DB_PREFIX."commande_fournisseur where fk_soc = ".((int) $socid); @@ -686,7 +686,7 @@ if ($sql_select) { print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, '', $sortfield, $sortorder, 'right '); print "\n"; - print ''; + print ''; print "
lastname).'" autofocus="autofocus">
firstname).'" autofocus="autofocus">
'.$langs->trans("Email").'*
'.$langs->trans("Email").'*
'.$langs->trans("Company").'*'; +print '
'.$langs->trans("Company").'*'; print '
'.$langs->trans("Address").''."\n"; @@ -560,13 +560,13 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print '
'.$langs->trans("EventType").'*
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
'.$langs->trans("LabelOfconference").'*
'.$langs->trans("LabelOfconference").'*
'.$langs->trans("Description").'*
'.$langs->trans("Description").'*
'.$langs->trans("DateStart").'trans('CustomerCode'); ?> control->tpl['code_client']; ?> control->tpl['checkcustomercode'] <> 0) { ?> - (trans("WrongCustomerCode"); ?>) + (trans("WrongCustomerCode"); ?>)
trans('SupplierCode'); ?> control->tpl['code_fournisseur']; ?> control->tpl['checksuppliercode'] <> 0) { ?> - (trans("WrongSupplierCode"); ?>) + (trans("WrongSupplierCode"); ?>)
trans('CustomerCode'); ?> control->tpl['code_client']; ?> control->tpl['checkcustomercode'] <> 0) { ?> - (trans("WrongCustomerCode"); ?>) + (trans("WrongCustomerCode"); ?>)
trans('SupplierCode'); ?> control->tpl['code_fournisseur']; ?> control->tpl['checksuppliercode'] <> 0) { ?> - (trans("WrongSupplierCode"); ?>) + (trans("WrongSupplierCode"); ?>)
'.$form->editfieldkey('Capital', 'capital', '', $object, 0).' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("SelectElementAndClick", $langs->transnoentitiesnoconv("Search")).'
'.$langs->trans("SelectElementAndClick", $langs->transnoentitiesnoconv("Search")).'
"; } else { @@ -694,7 +694,7 @@ if ($sql_select) { print ''."\n"; - print ''; + print ''; print "
'.$langs->trans("FeatureNotYetAvailable").'
'.$langs->trans("FeatureNotYetAvailable").'
"; } diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 60184d4ed15..23720ebd54c 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -152,7 +152,7 @@ if ($object->id) { print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client)); $tmpcheck = $object->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongCustomerCode").')'; + print ' ('.$langs->trans("WrongCustomerCode").')'; } print '
'; @@ -1227,7 +1227,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if ($nbremote == 0 && $nblocal == 0) { $colspan = (!empty($conf->global->STRIPE_ALLOW_LOCAL_CARD) ? 10 : 9); - print '
'.$langs->trans("None").'
>'.$langs->trans("None").'
"; print ""; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index c29717f002d..bf19fc0385b 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -218,7 +218,7 @@ if ($object->client) { print $object->code_client; $tmpcheck = $object->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongCustomerCode").')'; + print ' ('.$langs->trans("WrongCustomerCode").')'; } print '
'; print '
'.img_picto('', 'who.png', 'class="valignmiddle"', 1).''; -print ''.$langs->trans("CommunitySupport").''; +print ''.$langs->trans("CommunitySupport").''; print ''; -print '
'.$langs->trans("TypeOfSupport").': '.$langs->trans("TypeSupportCommunauty").''; +print '
'.$langs->trans("TypeOfSupport").': '.$langs->trans("TypeSupportCommunauty").''; print '
'.$langs->trans("TypeOfHelp").'/'.$langs->trans("Efficiency").'/'.$langs->trans("Price").': '; print $langs->trans("TypeHelpDev").'/'.img_picto_common('', 'redstar', 'class="valignmiddle"', 1).img_picto_common('', 'redstar', 'class="valignmiddle"', 1).'/'.img_picto_common('', 'star', 'class="valignmiddle"', 1).img_picto_common('', 'star', 'class="valignmiddle"', 1).img_picto_common('', 'star', 'class="valignmiddle"', 1).img_picto_common('', 'star', 'class="valignmiddle"', 1); print '
'; @@ -147,9 +147,9 @@ print '
'; print ''; + print ''; } else { $result = show_ldap_content($records, 0, $records['count'], true); } diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 46506163c1f..478e345f2e3 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -248,9 +248,9 @@ if ($object->id > 0) { print ''; if ($caneditperms) { print ''; } print ''; @@ -302,9 +302,9 @@ if ($object->id > 0) { print ''; if ($caneditperms) { print ''; } else { print ''; @@ -353,7 +353,7 @@ if ($object->id > 0) { } else { // Do not own permission if ($caneditperms) { - print ''; diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index e8ceef77b0a..b7ea48f7734 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -189,7 +189,7 @@ if ($result > 0) { // Affichage arbre if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) { if (!is_array($records)) { - print ''; + print ''; } else { $result = show_ldap_content($records, 0, $records['count'], true); } diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 7c7fe868b2f..d3ba33a5acf 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -420,7 +420,7 @@ if ($result) { } else { // Do not own permission if ($caneditperms) { - print ''; @@ -430,7 +430,7 @@ if ($result) { } else { // Do not own permission if ($caneditperms) { - print ''; diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index a3ad036ca9a..d70419060f5 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -587,7 +587,7 @@ if (!empty($id) || !empty($ref)) { $htmltext = $langs->trans("GoOnMenuToCreateVairants", $langs->transnoentities("Product"), $langs->transnoentities("VariantAttributes")); print $form->textwithpicto('', $htmltext); - /*print '     id).'">'; + /*print '     id).'">'; print $langs->trans("Create"); print '';*/ @@ -605,7 +605,7 @@ if (!empty($id) || !empty($ref)) { $htmltext = $langs->trans("GoOnMenuToCreateVairants", $langs->transnoentities("Product"), $langs->transnoentities("VariantAttributes")); print $form->textwithpicto('', $htmltext); /* - print '     id).'">'; + print '     id).'">'; print $langs->trans("Create"); print ''; */ diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index 2d3c71e7370..c68f1162790 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -225,7 +225,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase break; } //print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n"; - $this->assertTrue($ok, 'Found string $db-> into a .class.php file in '.$file['relativename']); + $this->assertTrue($ok, 'Found string $db-> into a .class.php file in '.$file['relativename'].'. Inside a .class file, you should use $this->db-> instead.'); //exit; } } else {
'.img_picto('', 'mail.png', 'class="valignmiddle"', 1).''; -print ''.$langs->trans("EMailSupport").''; +print ''.$langs->trans("EMailSupport").''; print ''; -print '
'.$langs->trans("TypeOfSupport").': '.$langs->trans("TypeSupportCommercial").''; +print '
'.$langs->trans("TypeOfSupport").': '.$langs->trans("TypeSupportCommercial").''; print '
'.$langs->trans("TypeOfHelp").'/'.$langs->trans("Efficiency").'/'.$langs->trans("Price").': '; print $langs->trans("TypeHelpOnly").'/'.img_picto_common('', 'redstar', 'class="valignmiddle"', 1).img_picto_common('', 'redstar', 'class="valignmiddle"', 1).img_picto_common('', 'redstar', 'class="valignmiddle"', 1).'/'.img_picto_common('', 'star', 'class="valignmiddle"', 1).img_picto_common('', 'star', 'class="valignmiddle"', 1); print '
'; @@ -182,9 +182,9 @@ print '
'; print ''; print ''; @@ -523,7 +523,7 @@ if ($socid && !$projectid && !$project_ref && $user->rights->societe->lire) { print showValueWithClipboardCPButton(dol_escape_htmltag($socstat->code_fournisseur)); $tmpcheck = $socstat->check_codefournisseur(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongSupplierCode").')'; + print ' ('.$langs->trans("WrongSupplierCode").')'; } print ''; print ''; @@ -698,6 +698,7 @@ print ''; print ''; print ''; print ''; + if ($socid) { print ''; } @@ -759,6 +760,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print '
'; print '
'.img_picto('', 'pagemaster.png', 'class="valignmiddle"', 1).''; -print ''.$langs->trans("OtherSupport").''; +print ''.$langs->trans("OtherSupport").''; print ''; -print '
'.$langs->trans("TypeOfSupport").': '.$langs->trans("TypeSupportCommercial").''; +print '
'.$langs->trans("TypeOfSupport").': '.$langs->trans("TypeSupportCommercial").''; //print '
'.$langs->trans("Efficiency").'/'.$langs->trans("Price").': '.img_picto_common('','redstar').img_picto_common('','redstar').img_picto_common('','redstar').' / '.img_picto_common('','star'); print '
'.$langs->trans("TypeOfHelp").'/'.$langs->trans("Efficiency").'/'.$langs->trans("Price").': '; print $langs->trans("TypeHelpDevForm").'/?/?'; diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index ec05dd89796..1fe95ff57d8 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -44,8 +44,8 @@ $langs->loadLangs(array("admin", "cashdesk", "commercial")); if (GETPOST('action', 'alpha') == 'set') { $db->begin(); - $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'alpha'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'restricthtml'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'restricthtml'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_RECEIPT_NAME", GETPOST('TAKEPOS_RECEIPT_NAME', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_SHOW_CUSTOMER", GETPOST('TAKEPOS_SHOW_CUSTOMER', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_AUTO_PRINT_TICKETS", GETPOST('TAKEPOS_AUTO_PRINT_TICKETS', 'int'), 'int', 0, '', $conf->entity); diff --git a/htdocs/takepos/floors.php b/htdocs/takepos/floors.php index b3ba955f4e8..64040a24466 100644 --- a/htdocs/takepos/floors.php +++ b/htdocs/takepos/floors.php @@ -212,9 +212,9 @@ $( document ).ready(function() { admin) {?> &place="+place+"&idproduct="+idproduct+"&selectedline="+selectedline, function() { global->TAKEPOS_CUSTOMER_DISPLAY)) echo "CustomerDisplay();";?> }); } diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index ad5d8f9fbd2..8b2e5ca78b7 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1056,12 +1056,12 @@ function DolibarrTakeposPrinting(id) { } function CreditNote() { - $("#poslines").load("invoice.php?action=creditnote&invoiceid="+placeid, function() { + $("#poslines").load("invoice.php?action=creditnote&token=&invoiceid="+placeid, function() { }); } function SetNote() { - $("#poslines").load("invoice.php?action=addnote&invoiceid="+placeid+"&idline="+selectedline+"&addnote="+$("#textinput").val(), function() { + $("#poslines").load("invoice.php?action=addnote&token=&invoiceid="+placeid+"&idline="+selectedline+"&addnote="+$("#textinput").val(), function() { }); } diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 27c3be96c5d..f79263bfce3 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -255,7 +255,7 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) { }); }, 2500); } - + global->TAKEPOS_CUSTOMER_DISPLAY)) { echo "var line1='".$langs->trans('TotalTTC')."'.substring(0,20);"; @@ -274,18 +274,18 @@ if (!empty($conf->global->TAKEPOS_CUSTOMER_DISPLAY)) {
-
trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?>
+
trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?>
total_ttc) { ?>
-
trans('RemainToPay'); ?>: multicurrency_code); ?>
+
trans('RemainToPay'); ?>: multicurrency_code); ?>
-
trans("Received"); ?>: multicurrency_code); ?>
+
trans("Received"); ?>: multicurrency_code); ?>
-
trans("Change"); ?>: multicurrency_code); ?>
+
trans("Change"); ?>: multicurrency_code); ?>
global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) { @@ -293,7 +293,7 @@ if (!empty($conf->global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) {
'; $filter = ''; $form = new Form($db); - print ''.$langs->trans("BankAccount").': '; + print ''.$langs->trans("BankAccount").': '; $form->select_comptes(0, 'accountid', 0, $filter, 1, ''); print ajax_combobox('selectaccountid'); print '
diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 7eaa4d9ec68..b655d9f7789 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -238,10 +238,10 @@ function AddProductConfirm(placeid, productid){ place=placeid; diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index d978d2ac792..627a6c99565 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -119,7 +119,7 @@ if (!empty($conf->global->TAKEPOS_HEADER) || !empty($conf->global->{$constFreeTe if (!empty($conf->global->{$constFreeText})) { $newfreetext .= make_substitutions($conf->global->{$constFreeText}, $substitutionarray); } - print $newfreetext; + print nl2br($newfreetext); } ?>

diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 708870eeaa6..308114e89a7 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -13,7 +13,7 @@ --colorbacktitle1: rgb(); --colorbacktabcard1: rgb(); --colorbacktabactive: rgb(); - --colorbacklineimpair1: rgb(); + --colorbacklinepair1: rgb(); --colorbacklineimpair2: rgb(); --colorbacklinepair1: rgb(); --colorbacklinepair2: rgb(); @@ -28,8 +28,9 @@ --colortexttitlelink: rgba(, 0.9); --colortext: rgb(); --colortextlink: rgb(); - --colortextbackhmenu: #; + --colortextbackhmenu: #; --colortextbackvmenu: #; + --colortopbordertitle1: rgb(); --listetotal: #888888; --inputbackgroundcolor: #FFF; --inputbordercolor: rgba(0,0,0,.2); @@ -1737,6 +1738,20 @@ td.showDragHandle { display: inline-block; } +/* +.classforhorizontalscrolloftabs .fiche .div-table-responsive +{ + transform:rotateX(180deg); + -ms-transform:rotateX(180deg); + -webkit-transform:rotateX(180deg); +} +.classforhorizontalscrolloftabs .fiche .div-table-responsive-inside +{ + transform:rotateX(180deg); + -ms-transform:rotateX(180deg); + -webkit-transform:rotateX(180deg); +} +*/ global->THEME_DISABLE_STICKY_TOPMENU)) { ?> @@ -1847,10 +1862,11 @@ div.vmenu, td.vmenu { display: none; } - /* if no side-nav, we don't need to have width forced */ + /* if no side-nav, we don't need to have width forced to calc(100% - 210px); */ .classforhorizontalscrolloftabs #id-right { - width: unset; - display: unset; + width: 100%; + /* width: unset; */ + /* display: unset; */ } body.sidebar-collapse .login_block { @@ -2222,12 +2238,12 @@ img.photorefnoborder { .underrefbanner { } .underbanner { - border-bottom: px solid rgb(); + border-bottom: px solid var(--colortopbordertitle1); /* border-bottom: 2px solid var(--colorbackhmenu1); */ } .trextrafieldseparator td, .trextrafields_collapse_last td { /* border-bottom: 2px solid var(--colorbackhmenu1) !important; */ - border-bottom: 2px solid rgb() !important; + border-bottom: 2px solid var(--colortopbordertitle1) !important; } .tdhrthin { @@ -3364,10 +3380,10 @@ td.border, div.tagtable div div.border { border-bottom: none !important; } .bordertop { - border-top: 1px solid rgb(); + border-top: 1px solid var(--colortopbordertitle1); } .borderbottom { - border-bottom: 1px solid rgb(); + border-bottom: 1px solid var(--colortopbordertitle1); } @@ -3379,10 +3395,15 @@ table.liste, table.noborder, table.formdoc, div.noborder { border-collapse: separate !important; border-spacing: 0px; border-top-width: px; - border-top-color: rgb(); + border-top-color: var(--colortopbordertitle1); border-top-style: solid; margin: 0px 0px 5px 0px; + + border-left: 1px solid var(--colortopbordertitle1); + border-right: 1px solid var(--colortopbordertitle1); + /*width: calc(100% - 7px); border-collapse: separate !important; border-spacing: 0px; @@ -3395,20 +3416,20 @@ table.liste, table.noborder, table.formdoc, div.noborder { } #tablelines { border-bottom-width: 1px; - border-bottom-color: rgb(); + border-bottom-color: var(--colortopbordertitle1); border-bottom-style: solid; } table.liste tr:last-of-type td, table.noborder:not(#tablelines) tr:last-of-type td, table.formdoc tr:last-of-type td, div.noborder tr:last-of-type td { border-bottom-width: 1px; - border-bottom-color: rgb(); + border-bottom-color: var(--colortopbordertitle1); border-bottom-style: solid; } div.tabBar div.fichehalfright table.noborder:not(.margintable):not(.paymenttable):not(.lastrecordtable):last-of-type { - border-bottom: 1px solid rgb(); + border-bottom: 1px solid var(--colortopbordertitle1); } div.tabBar table.border>tbody>tr:last-of-type>td { border-bottom-width: 1px; - border-bottom-color: rgb(); + border-bottom-color: var(--colortopbordertitle1); border-bottom-style: solid; } div.tabBar div.fichehalfright table.noborder { @@ -3442,7 +3463,7 @@ tr.liste_titre_filter td.liste_titre:first-of-type { { border-bottom-width: 0 !important; border-top-width: 1px; - border-top-color: rgb(); + border-top-color: var(--colortopbordertitle1); border-top-style: solid; } tr#trlinefordates td { @@ -3451,7 +3472,7 @@ tr#trlinefordates td { .liste_titre_add td, .liste_titre_add th, .liste_titre_add .tagtd { border-top-width: 1px; - border-top-color: rgb(); + border-top-color: var(--colortopbordertitle1); border-top-style: solid; } table.liste tr, table.noborder tr, div.noborder form { @@ -3716,14 +3737,14 @@ table.hidepaginationnext .paginationnext { { font-family: ; margin-bottom: 1px; - color: var(--oddevencolor); + color: var(--oddeven); } .impair, .nohover .impair:hover, tr.impair td.nohover { - background: var(--colorbacklineimpair1); + background-color: var(--colorbacklineimpair2); } #GanttChartDIV { - background-color: var(--colorbacklineimpair1); + background-color: var(--colorbacklineimpair2); } .oddeven, .evenodd, .pair, .nohover .pair:hover, tr.pair td.nohover, .tagtr.oddeven { @@ -3732,21 +3753,21 @@ table.hidepaginationnext .paginationnext { color: var(--oddevencolor); } .pair, .nohover .pair:hover, tr.pair td.nohover { - background-color: var(--colorbacklinepair1); + background-color: var(--colorbacklinepair2); } table.dataTable tr.oddeven { - background-color: var(--colorbacklinepair1) !important; + background-color: var(--colorbacklinepair2) !important; } /* For no hover style */ td.oddeven, table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td, tr.nohover td, form.nohover, form.nohover:hover { - background-color: var(--colorbacklineimpair1) !important; - background: var(--colorbacklineimpair1) !important; + background-color: var(--colorbacklineimpair2) !important; + background: var(--colorbacklineimpair2) !important; } td.evenodd, tr.nohoverpair td, #trlinefordates td { - background-color: var(--colorbacklinepair1) !important; - background: var(--colorbacklinepair1) !important; + background-color: var(--colorbacklinepair2) !important; + background: var(--colorbacklinepair2) !important; } .trforbreak td { font-weight: 500; @@ -3781,7 +3802,9 @@ tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td { } table.nobottomiftotal tr.liste_total td { background-color: #fff; + border-bottom: 0px !important; + } table.nobottom, td.nobottom { border-bottom: 0px !important; @@ -3797,8 +3820,12 @@ div.liste_titre { } div.liste_titre_bydiv { border-top-width: px; - border-top-color: rgb(); + border-top-color: var(--colortopbordertitle1); border-top-style: solid; + + border-left: px solid var(--colortopbordertitle1); + /* border-right: px solid var(--colortopbordertitle1); */ + border-collapse: collapse; display: table; @@ -3829,7 +3856,7 @@ div.liste_titre_bydiv, .liste_titre div.tagtr, tr.liste_titre, tr.liste_titre_se } tr.liste_titre th, tr.liste_titre td, th.liste_titre { - border-bottom: 1px solid rgb(); + border-bottom: 1px solid var(--colortopbordertitle1); } tr.liste_titre:first-child th, tr:first-child th.liste_titre { /* border-bottom: 1px solid #ddd ! important; */ @@ -3848,7 +3875,7 @@ tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, fo } tr.liste_titre_topborder td { border-top-width: px; - border-top-color: rgb(); + border-top-color: var(--colortopbordertitle1); border-top-style: solid; } .liste_titre td a { @@ -3949,7 +3976,7 @@ div.tabBar .noborder { } #tablelines tr.liste_titre td, .paymenttable tr.liste_titre td, .margintable tr.liste_titre td, .tableforservicepart1 tr.liste_titre td { - border-bottom: 1px solid rgb() !important; + border-bottom: 1px solid var(--colortopbordertitle1) !important; } #tablelines tr td { height: unset; @@ -3961,11 +3988,10 @@ div.tabBar .noborder { div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright):not(.ficheaddleft) > .border > tbody > tr:nth-of-type(even):not(.liste_titre), .liste > tbody > tr:nth-of-type(even):not(.liste_titre), div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright):not(.ficheaddleft) .oddeven.tagtr:nth-of-type(even):not(.liste_titre) { - background: linear-gradient(bottom, var(--colorbacklineimpair1) 85%, var(--colorbacklineimpair2) 100%); - background: -o-linear-gradient(bottom, var(--colorbacklineimpair1) 85%, var(--colorbacklineimpair2) 100%); - background: -moz-linear-gradient(bottom, var(--colorbacklineimpair1) 85%, var(--colorbacklineimpair2) 100%); - background: -webkit-linear-gradient(bottom, var(--colorbacklineimpair1) 85%, var(--colorbacklineimpair2) 100%); - /* background: -ms-linear-gradient(bottom, var(--colorbacklineimpair1) 85%, var(--colorbacklineimpair2) 100%); */ + background: linear-gradient(bottom, var(----colorbacklineimpair2) 0%, var(--colorbacklineimpair2) 100%); + background: -o-linear-gradient(bottom, var(--colorbacklineimpair2) 0%, var(--colorbacklineimpair2) 100%); + background: -moz-linear-gradient(bottom, var(--colorbacklineimpair2) 0%, var(--colorbacklineimpair2) 100%); + background: -webkit-linear-gradient(bottom, var(--colorbacklineimpair2) 0%, var(--colorbacklineimpair2) 100%); } .noborder > tbody > tr:nth-child(even):not(:last-child) td:not(.liste_titre), .liste > tbody > tr:nth-child(even):not(:last-child) td:not(.liste_titre), .noborder .oddeven.tagtr:nth-child(even):not(:last-child) .tagtd:not(.liste_titre) @@ -3977,11 +4003,10 @@ div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright):not(.ficheaddleft div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright):not(.ficheaddleft) > .border > tbody > tr:nth-of-type(odd):not(.liste_titre), .liste > tbody > tr:nth-of-type(odd):not(.liste_titre), div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright):not(.ficheaddleft) .oddeven.tagtr:nth-of-type(odd):not(.liste_titre) { - background: linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%); - background: -o-linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%); - background: -moz-linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%); - background: -webkit-linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%); - /* background: -ms-linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%); */ + background: linear-gradient(bottom, var(--colorbacklinepair2) 0%, var(--colorbacklinepair2) 100%); + background: -o-linear-gradient(bottom, var(--colorbacklinepair2) 0%, var(--colorbacklinepair2) 100%); + background: -moz-linear-gradient(bottom, var(--colorbacklinepair2) 0%, var(--colorbacklinepair2) 100%); + background: -webkit-linear-gradient(bottom, var(--colorbacklinepair2) 0%, var(--colorbacklinepair2) 100%); } .noborder > tbody > tr:nth-child(odd):not(:last-child) td:not(.liste_titre), .liste > tbody > tr:nth-child(odd):not(:last-child) td:not(.liste_titre), .noborder .oddeven.tagtr:nth-child(odd):not(:last-child) .tagtd:not(.liste_titre) @@ -4196,7 +4221,7 @@ span.dashboardlineko { margin-bottom: 25px !important; border-bottom-width: 1px; background: var(--colorbackbody); - border-top: px solid rgb(); + border-top: px solid var(--colortopbordertitle1); /* border-top: 2px solid var(--colorbackhmenu1) !important; */ } table.noborder.boxtable tr td { @@ -4878,11 +4903,10 @@ table.cal_month td { padding-left: 1px !important; padding-right: 1px !important .cal_past { } .cal_peruser { padding-top: 0 !important; padding-bottom: 0 !important; padding-: 1px !important; padding-: 1px !important; } .cal_impair { - background: linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%); - background: -o-linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%); - background: -moz-linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%); - background: -webkit-linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%); - /* background: -ms-linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%); */ + background: linear-gradient(bottom, var(--colorbacklinepair2) 85%, var(--colorbacklinepair2) 100%); + background: -o-linear-gradient(bottom, var(--colorbacklinepair2) 85%, var(--colorbacklinepair2) 100%); + background: -moz-linear-gradient(bottom, var(--colorbacklinepair2) 85%, var(--colorbacklinepair2) 100%); + background: -webkit-linear-gradient(bottom, var(--colorbacklinepair2) 85%, var(--colorbacklinepair2) 100%); } .cal_today_peruser_impair { background: #F8F8F0; } .peruser_busy { } @@ -5654,7 +5678,7 @@ span#select2-taskid-container[title^='--'] { } .select2-container--default .select2-results__option--highlighted[aria-selected] { - background-color: rgb(); + background-color: var(--colorbackhmenu1); color: var(--colortextbackhmenu); } .select2-container--default .select2-results__option--highlighted[aria-selected] span { @@ -6659,7 +6683,6 @@ div.tabsElem a.tab { background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(230,230,230,0.4) 100%); background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(230,230,230,0.4) 100%); background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(230,230,230,0.4) 100%); - background-image: -ms-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(230,230,230,0.4) 100%); background-image: linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(230,230,230,0.4) 100%); } .cd-timeline-content:after { diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 44a0a7d7b20..de089ecba54 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -118,7 +118,8 @@ $dol_no_mouse_hover = $conf->dol_no_mouse_hover; //$user->conf->THEME_ELDY_ENABLE_PERSONALIZED=0; //var_dump($user->conf->THEME_ELDY_RGB); -$useboldtitle = (isset($conf->global->THEME_ELDY_USEBOLDTITLE) ? $conf->global->THEME_ELDY_USEBOLDTITLE : 0); +$useboldtitle = getDolGlobalInt('THEME_ELDY_USEBOLDTITLE'); +$userborderontable = getDolGlobalInt('THEME_ELDY_USEBORDERONTABLE'); $borderwidth = 1; // Case of option always editable @@ -208,6 +209,8 @@ if ($tmpval <= 460) { $colortextbackvmenu = '000000'; } +$colortopbordertitle1 = join(',', colorStringToArray($colortopbordertitle1)); // Normalize value to 'x,y,z' + $colorbacktitle1 = join(',', colorStringToArray($colorbacktitle1)); // Normalize value to 'x,y,z' $tmppart = explode(',', $colorbacktitle1); if ($colortexttitle == '') { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index d68bfa78ee9..691ffa8f658 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -118,6 +118,7 @@ $dol_no_mouse_hover = $conf->dol_no_mouse_hover; $useboldtitle = (isset($conf->global->THEME_ELDY_USEBOLDTITLE) ? $conf->global->THEME_ELDY_USEBOLDTITLE : 0); $borderwidth = 2; +$userborderontable = 1; // Case of option always editable if (!isset($conf->global->THEME_ELDY_BACKBODY)) { @@ -210,6 +211,8 @@ if ($tmpval <= 460) { $colortextbackvmenu = '000000'; } +$colortopbordertitle1 = join(',', colorStringToArray($colortopbordertitle1)); // Normalize value to 'x,y,z' + $colorbacktitle1 = join(',', colorStringToArray($colorbacktitle1)); // Normalize value to 'x,y,z' $tmppart = explode(',', $colorbacktitle1); if ($colortexttitle == '') { @@ -270,12 +273,13 @@ print 'colorbacklinepair1='.$colorbacklinepair1."\n"; print 'colorbacklinepair2='.$colorbacklinepair2."\n"; print 'colorbacklinepairhover='.$colorbacklinepairhover."\n"; print 'colorbacklinepairchecked='.$colorbacklinepairchecked."\n"; -print '$colortexttitlenotab='.$colortexttitlenotab."\n"; -print '$colortexttitle='.$colortexttitle."\n"; -print '$colortext='.$colortext."\n"; -print '$colortextlink='.$colortextlink."\n"; -print '$colortextbackhmenu='.$colortextbackhmenu."\n"; -print '$colortextbackvmenu='.$colortextbackvmenu."\n"; +print 'colortexttitlenotab='.$colortexttitlenotab."\n"; +print 'colortexttitle='.$colortexttitle."\n"; +print 'colortext='.$colortext."\n"; +print 'colortextlink='.$colortextlink."\n"; +print 'colortexttitlelink='.$colortexttitlelink."\n"; +print 'colortextbackhmenu='.$colortextbackhmenu."\n"; +print 'colortextbackvmenu='.$colortextbackvmenu."\n"; print 'dol_hide_topmenu='.$dol_hide_topmenu."\n"; print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n"; print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n"; @@ -306,12 +310,15 @@ print '*/'."\n"; --colorbacklinepairchecked: rgb(); --colorbacklinebreak: rgb(); --colorbackbody: rgb(); + --colorbackmobilemenu: #f8f8f8; --colortexttitlenotab: rgb(); --colortexttitle: rgb(); + --colortexttitlelink: rgba(, 0.9); --colortext: rgb(); --colortextlink: rgb(); - --colortextbackhmenu: #; + --colortextbackhmenu: #; --colortextbackvmenu: #; + --colortopbordertitle1: rgb(); --listetotal: #551188; --inputbackgroundcolor: #FFF; --inputbordercolor: rgba(0,0,0,.2); @@ -328,13 +335,16 @@ print '*/'."\n"; --amountremaintopaycolor:#880000; --amountpaymentcomplete:#008800; --amountremaintopaybackcolor:none; + --productlinestockod: #002200; + --productlinestocktoolow: #884400; + --infoboxmoduleenabledbgcolor : linear-gradient(0.4turn, #fff, #fff, #fff, #e4efe8); } body { background-color: #FFFFFF; - background: rgb(); + background: var(--colorbackbody); color: rgb(); font-size: ; @@ -580,7 +590,7 @@ input.pageplusone { } .optionblue { - color: rgb(); + color: var(--colortextlink); } .optiongrey, .opacitymedium { opacity: 0.5; @@ -984,7 +994,7 @@ body[class*="colorblind-"] .text-success{ color: #ccc !important; } .editfielda span.fa-pencil-alt:hover, .editfielda span.fa-trash:hover { - color: rgb() !important; + color: var(--colortexttitle) !important; } .size15x { font-size: 1.5em !important; } @@ -1765,7 +1775,7 @@ td.showDragHandle { display: none; - background: rgb(); + background: var(--colorbackvmenu1); border-right: 1px solid rgba(0,0,0,0.2); box-shadow: 3px 0 6px -2px #eee; bottom: 0; @@ -1859,6 +1869,7 @@ body.sidebar-collapse .side-nav, body.sidebar-collapse .login_block div.login_block { /* border-right: none ! important; */ top: inherit !important; + border-right: 1px solid rgba(0,0,0,0.3); } .side-nav { @@ -1909,12 +1920,12 @@ div.login_block { } #id-left { z-index: 91; - background: rgb(); + background: var(--colorbackvmenu1); border-right: 1px solid rgba(0,0,0,0.3); padding-top: 20px; browser->layout, array('phone', 'tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?> - top: 50px ! important; + top: 66px ! important; top: 60px ! important; @@ -2204,11 +2215,11 @@ img.photorefnoborder { .underrefbanner { } .underbanner { - border-bottom: px solid rgb(); + border-bottom: px solid var(--colortopbordertitle1); } .trextrafieldseparator td, .trextrafields_collapse_last td { - border-bottom: 1px solid rgb() !important; + border-bottom: 1px solid var(--colortopbordertitle1) !important; } .tdhrthin { margin: 0; @@ -2239,13 +2250,12 @@ div#tmenu_tooltip { display:none; - background: rgb(); + background: var(--colorbackhmenu1); /* background-image: linear-gradient(to top, rgba(255,255,255,.3) 0%, rgba(128,128,128,.3) 100%); background-image: -o-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(128,128,128,.3) 100%); background-image: -moz-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(128,128,128,.3) 100%); background-image: -webkit-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(128,128,128,.3) 100%); - background-image: -ms-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(128,128,128,.3) 100%); background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.3)), color-stop(1, rgba(128,128,128,.3)) ); */ @@ -2322,13 +2332,12 @@ ul.tmenu { /* t r b l */ padding-left: 5px; } ul.tmenu li { - background: rgb(); + background: var(--colorbackhmenu1); /* background-image: linear-gradient(to top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); background-image: -o-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); background-image: -moz-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); background-image: -webkit-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image: -ms-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.3)), color-stop(1, rgba(0,0,0,.3)) ); */ } @@ -2729,7 +2738,7 @@ div.login_block { z-index: 10; text-align: center; vertical-align: middle; - background: rgb(); + background: var(--colorbackvmenu1); width: 228px; height: 70px; @@ -2810,9 +2819,9 @@ img.login, img.printer, img.entity { font-weight: bold; } .userimg.atoplogin img.userphoto, .userimgatoplogin img.userphoto { /* size for user photo in login bar */ - border-radius: 8px; - width: 16px; - height: 16px; + /* border-radius: 8px; */ + width: 20px; + height: 20px; background-size: contain; vertical-align: text-bottom; background-color: #FFF; @@ -3115,7 +3124,7 @@ div.tabBar { border-left: 1px solid #BBB; border-top: 1px solid #CCC; width: auto; - background: rgb(); + background: var(--colorbacktabcard1); border-bottom: 1px solid #aaa; } @@ -3208,8 +3217,8 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { } .tabactive, a.tab#active { - color: # !important; - background: rgb() !important; + color: var(--colortextbacktab) !important; + background: var(--colorbacktabcard1) !important; border-right: 1px solid #AAA !important; border-left: 1px solid #AAA !important; @@ -3225,8 +3234,8 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { a.tab:hover { /* - background: rgba(, 0.5) url() 50% 0 repeat-x; - color: #; + background: var(--colorbacktabcard1) url() 50% 0 repeat-x; + color: var(--colortextbacktab); */ text-decoration: underline; } @@ -3386,10 +3395,10 @@ td.border, div.tagtable div div.border { border-bottom: none !important; } .bordertop { - border-top: 1px solid rgb(); + border-top: 1px solid var(--colortopbordertitle1); } .borderbottom { - border-bottom: 1px solid rgb(); + border-bottom: 1px solid var(--colortopbordertitle1); } .fichehalfright table.noborder { @@ -3397,7 +3406,7 @@ td.border, div.tagtable div div.border { } div.colorback { - background: rgb(); + background: var(--colorbacktitle1); padding: 10px; margin-top: 5px; } @@ -3412,7 +3421,7 @@ table.liste, table.noborder, table.formdoc, div.noborder { border-spacing: 0px; border-top-width: px; - border-top-color: rgb(); + border-top-color: var(--colortopbordertitle1); border-top-style: solid; border-bottom-width: 1px; @@ -3445,7 +3454,7 @@ table.paddingtopbottomonly tr td { } .liste_titre_filter { - background: rgb() !important; + background: var(--colorbacktitle1) !important; } tr.liste_titre_filter td.liste_titre { padding-top: 4px; @@ -3454,19 +3463,19 @@ tr.liste_titre_filter td.liste_titre { .liste_titre_create td, .liste_titre_create th, .liste_titre_create .tagtd { border-top-width: 1px; - border-top-color: rgb(); + border-top-color: var(--colortopbordertitle1); border-top-style: solid; } .liste_titre_add td, .liste_titre_add th, .liste_titre_add .tagtd { border-top-width: 2px; - border-top-color: rgb(); + border-top-color: var(--colortopbordertitle1); border-top-style: solid; } .liste_titre_add td, .liste_titre_add .tagtd { border-top-width: 1px; - border-top-color: rgb(); + border-top-color: var(--colortopbordertitle1); border-top-style: solid; } @@ -3534,7 +3543,7 @@ div.refidpadding { } div.refid { font-weight: bold; - color: rgb(); + color: rgb(--colortexttitlenotab); font-size: 160%; } div.refidno { @@ -3627,7 +3636,7 @@ div.pagination li .active span:focus { z-index: 2; color: #fff; cursor: default; - background-color: rgb(); + background-color: var(--colorbackhmenu1); border-color: #337ab7; } div.pagination .disabled span, @@ -3672,11 +3681,10 @@ table.hidepaginationnext .paginationnext { /* Prepare to remove class pair - impair .noborder > tbody > tr:nth-child(even) td { - background: linear-gradient(to bottom, rgb() 85%, rgb() 100%); - background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); - background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); - background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); - background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background: linear-gradient(to bottom, var(--colorbacklineimpair1) 85%, var(--colorbacklineimpair2) 100%); + background: -o-linear-gradient(bottom, var(--colorbacklineimpair1) 85%, var(--colorbacklineimpair2) 100%); + background: -moz-linear-gradient(bottom, var(--colorbacklineimpair1) 85%, var(--colorbacklineimpair2) 100%); + background: -webkit-linear-gradient(bottom, var(--colorbacklineimpair1) 85%, var(--colorbacklineimpair2) 100%); font-family: ; border: 0px; margin-bottom: 1px; @@ -3685,11 +3693,10 @@ table.hidepaginationnext .paginationnext { } .noborder > tbody > tr:nth-child(odd) td { - background: linear-gradient(to bottom, rgb() 85%, rgb() 100%); - background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); - background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); - background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); - background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background: linear-gradient(to bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%); + background: -o-linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%); + background: -moz-linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%); + background: -webkit-linear-gradient(bottom, var(--colorbacklinepair1) 85%, var(--colorbacklinepair2) 100%); font-family: ; border: 0px; margin-bottom: 1px; @@ -3698,11 +3705,7 @@ table.hidepaginationnext .paginationnext { */ ul.noborder li:nth-child(odd):not(.liste_titre) { - background-color: rgb() !important; - background-color: rgb() !important; - background-color: rgb() !important; - background-color: rgb() !important; - background-color: rgb() !important; + background-color: var(--colorbacklinepair2) !important; } @@ -3827,7 +3830,7 @@ div.liste_titre { } div.liste_titre_bydiv { border-top-width: px; - border-top-color: rgb(); + border-top-color: var(--colortopbordertitle1); border-top-style: solid; box-shadow: none; @@ -3842,11 +3845,11 @@ tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, tabl } div.liste_titre_bydiv, .liste_titre div.tagtr, tr.liste_titre, tr.liste_titre_sel, .tagtr.liste_titre, .tagtr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr { - background: rgb(); + background: var(--colorbacktitle1); font-weight: ; /* border-bottom: 1px solid #FDFFFF; */ - color: rgb(); + color: var(--colortexttitle); font-family: ; text-align: ; } @@ -3867,25 +3870,25 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste } tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a { text-shadow: none !important; - color: rgb(); + color: var(--colortexttitlelink); } tr.liste_titre_topborder td { border-top-width: px; - border-top-color: rgb(); + border-top-color: var(--colortopbordertitle1); border-top-style: solid; } .liste_titre td a { text-shadow: none !important; - color: rgb(); + color: var(--colortexttitle); } .liste_titre td a.notasortlink { - color: rgb(); + color: var(--colortextlink); } .liste_titre td a.notasortlink:hover { background: transparent; } tr.liste_titre:last-child th.liste_titre, tr.liste_titre:last-child th.liste_titre_sel, tr.liste_titre td.liste_titre, tr.liste_titre td.liste_titre_sel, form.liste_titre div.tagtd { /* For last line of table headers only */ - border-bottom: 1px solid rgb(); + border-bottom: 1px solid var(--colortopbordertitle1); } div.liste_titre { @@ -3933,7 +3936,7 @@ tr.liste_sub_total, tr.liste_sub_total td { } .paymenttable, .margintable:not(.margintablenotop) { border-top-width: px !important; - border-top-color: rgb() !important; + border-top-color: var(--colortopbordertitle1) !important; border-top-style: solid !important; } .margintable.margintablenotop { @@ -3986,11 +3989,10 @@ div .tdtop { div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright):not(.ficheaddleft) > .border > tbody > tr:nth-of-type(even):not(.liste_titre), .liste > tbody > tr:nth-of-type(even):not(.liste_titre), div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright):not(.ficheaddleft) .oddeven.tagtr:nth-of-type(even):not(.liste_titre) { - background: linear-gradient(to bottom, rgb() 85%, rgb() 100%); - background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); - background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); - background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); - background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background: linear-gradient(to bottom, var(--colorbacklineimpair1) 0%, var(--colorbacklineimpair2) 100%); + background: -o-linear-gradient(bottom, var(--colorbacklineimpair1) 0%, var(--colorbacklineimpair2) 100%); + background: -moz-linear-gradient(bottom, var(--colorbacklineimpair1) 0%, var(--colorbacklineimpair2) 100%); + background: -webkit-linear-gradient(bottom, var(--colorbacklineimpair1) 0%, var(--colorbacklineimpair2) 100%); } .noborder > tbody > tr:nth-child(even):not(:last-child) td:not(.liste_titre), .liste > tbody > tr:nth-child(even):not(:last-child) td:not(.liste_titre), .noborder .tagtr:nth-child(even):not(:last-child) .oddeven.tagtd:not(.liste_titre) @@ -4002,11 +4004,10 @@ div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright):not(.ficheaddleft div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright):not(.ficheaddleft) > .border > tbody > tr:nth-of-type(odd):not(.liste_titre), .liste > tbody > tr:nth-of-type(odd):not(.liste_titre), div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright):not(.ficheaddleft) .oddeven.tagtr:nth-of-type(odd):not(.liste_titre) { - background: linear-gradient(to bottom, rgb() 85%, rgb() 100%); - background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); - background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); - background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); - background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background: linear-gradient(to bottom, var(--colorbacklinepair1) 0%, var(--colorbacklinepair2) 100%); + background: -o-linear-gradient(bottom, var(--colorbacklinepair1) 0%, var(--colorbacklinepair2) 100%); + background: -moz-linear-gradient(bottom, var(--colorbacklinepair1) 0%, var(--colorbacklinepair2) 100%); + background: -webkit-linear-gradient(bottom, var(--colorbacklinepair1) 0%, var(--colorbacklinepair2) 100%); } .noborder > tbody > tr:nth-child(odd):not(:last-child) td:not(.liste_titre), .liste > tbody > tr:nth-child(odd):not(:last-child) td:not(.liste_titre), .noborder .tagtr:nth-child(odd):not(:last-child) .oddeven.tagtd:not(.liste_titre) @@ -4015,7 +4016,7 @@ div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright):not(.ficheaddleft } ul.noborder li:nth-child(even):not(.liste_titre) { - background-color: rgb() !important; + background-color: var(--colorbacklinepair2) !important; } @@ -6538,7 +6539,6 @@ border-top-right-radius: 6px; background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(230,230,230,0.4) 100%); background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(230,230,230,0.4) 100%); background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(230,230,230,0.4) 100%); - background-image: -ms-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(230,230,230,0.4) 100%); background-image: linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(230,230,230,0.4) 100%); } .cd-timeline-content:after { diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index aeab9ac6e27..118d6208237 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -45,7 +45,7 @@ $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'tickep#selectedfieldstlist'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'ticketlist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') @@ -511,7 +511,7 @@ if ($socid && !$projectid && !$project_ref && $user->rights->societe->lire) { print showValueWithClipboardCPButton(dol_escape_htmltag($socstat->code_client)); $tmpcheck = $socstat->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongCustomerCode").')'; + print ' ('.$langs->trans("WrongCustomerCode").')'; } print '
'."\n"; @@ -1088,6 +1090,7 @@ print $hookmanager->resPrint; print '
'."\n"; print ''."\n"; +print ''."\n"; print ''."\n"; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 2dbc2a3f020..d925c16cbab 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2725,7 +2725,7 @@ class User extends CommonObject /** * Return clickable link of login (eventualy with picto) * - * @param int $withpictoimg Include picto into link + * @param int $withpictoimg Include picto into link (1=picto, -1=photo) * @param string $option On what the link point to ('leave', 'accountancy', 'nolink', ) * @param integer $notooltip 1=Disable tooltip on picto and name * @param string $morecss Add more css on link diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 8da4f344d56..2207e3358ae 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -119,7 +119,7 @@ if ($id > 0) { print ''; if (empty($conf->global->CLICKTODIAL_URL) && empty($object->clicktodial_url)) { $langs->load("errors"); - print ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("ClickToDial")).''; + print ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("ClickToDial")).''; } else { print '     '.$form->textwithpicto($langs->trans("KeepEmptyToUseDefault").': '.$conf->global->CLICKTODIAL_URL, $langs->trans("ClickToDialUrlDesc")); } @@ -158,7 +158,7 @@ if ($id > 0) { } if (empty($url)) { $langs->load("errors"); - print ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("ClickToDial")).''; + print ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("ClickToDial")).''; } else { print $form->textwithpicto((empty($object->clicktodial_url) ? ''.$langs->trans("DefaultLink").': ' : '').$url, $langs->trans("ClickToDialUrlDesc")); } diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index e02eb3e25d0..710dab1ee22 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -184,7 +184,7 @@ if ($result > 0) { // Show tree if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) { if (!is_array($records)) { - print '
'.$langs->trans("ErrorFailedToReadLDAP").'
'.$langs->trans("ErrorFailedToReadLDAP").'
'.$langs->trans("Module").''; - print ''.$langs->trans("All").""; + print ''.$langs->trans("All").""; print '/'; - print ''.$langs->trans("None").""; + print ''.$langs->trans("None").""; print ' '; - print 'module.'&token='.newToken().'">'.$langs->trans("All").""; + print 'module.'&token='.newToken().'">'.$langs->trans("All").""; print '/'; - print 'module.'&token='.newToken().'">'.$langs->trans("None").""; + print 'module.'&token='.newToken().'">'.$langs->trans("None").""; print ' id.'&confirm=yes&token='.newToken().'">'; + print 'id.'&confirm=yes&token='.newToken().'">'; //print img_edit_add($langs->trans("Add")); print img_picto($langs->trans("Add"), 'switch_off'); print '
'.$langs->trans("ErrorFailedToReadLDAP").'
'.$langs->trans("ErrorFailedToReadLDAP").'
id.'&confirm=yes&token='.newToken().'">'; + print 'id.'&confirm=yes&token='.newToken().'">'; //print img_edit_add($langs->trans("Add")); print img_picto($langs->trans("Add"), 'switch_off'); print 'id.'&confirm=yes&token='.newToken().'">'; + print 'id.'&confirm=yes&token='.newToken().'">'; //print img_edit_add($langs->trans("Add")); print img_picto($langs->trans("Add"), 'switch_off'); print '