diff --git a/dev/initdemo/mysqldump_dolibarr_3.5.0.sql b/dev/initdemo/mysqldump_dolibarr_3.5.0.sql index f94c3238db387..8e257afddb41c 100644 --- a/dev/initdemo/mysqldump_dolibarr_3.5.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_3.5.0.sql @@ -393,100 +393,6 @@ LOCK TABLES `llx_adherent_type_extrafields` WRITE; /*!40000 ALTER TABLE `llx_adherent_type_extrafields` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_advanced_extrafields` --- - -DROP TABLE IF EXISTS `llx_advanced_extrafields`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_advanced_extrafields` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `entity` int(11) NOT NULL DEFAULT '1', - `elementtype` varchar(64) NOT NULL, - `name` varchar(64) NOT NULL, - `label` varchar(64) NOT NULL, - `format` varchar(8) NOT NULL, - `fieldsize` int(11) DEFAULT NULL, - `maxlength` int(11) DEFAULT NULL, - `options` varchar(255) DEFAULT NULL, - `rang` int(11) DEFAULT NULL, - PRIMARY KEY (`rowid`), - UNIQUE KEY `idx_advanced_extrafields_name` (`elementtype`,`entity`,`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_advanced_extrafields` --- - -LOCK TABLES `llx_advanced_extrafields` WRITE; -/*!40000 ALTER TABLE `llx_advanced_extrafields` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_advanced_extrafields` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_advanced_extrafields_options` --- - -DROP TABLE IF EXISTS `llx_advanced_extrafields_options`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_advanced_extrafields_options` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `fk_extrafields` int(11) NOT NULL, - `value` varchar(255) NOT NULL, - `rang` int(11) DEFAULT NULL, - PRIMARY KEY (`rowid`), - KEY `idx_advanced_extrafields_options_fk_advanced_extrafields` (`fk_extrafields`), - CONSTRAINT `fk_advanced_extrafields_options_fk_advanced_extrafields` FOREIGN KEY (`fk_extrafields`) REFERENCES `llx_advanced_extrafields` (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_advanced_extrafields_options` --- - -LOCK TABLES `llx_advanced_extrafields_options` WRITE; -/*!40000 ALTER TABLE `llx_advanced_extrafields_options` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_advanced_extrafields_options` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_advanced_extrafields_values` --- - -DROP TABLE IF EXISTS `llx_advanced_extrafields_values`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_advanced_extrafields_values` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `entity` int(11) NOT NULL DEFAULT '1', - `datec` datetime DEFAULT NULL, - `datem` datetime DEFAULT NULL, - `fk_element` int(11) NOT NULL, - `fk_extrafields` int(11) NOT NULL, - `value` varchar(255) DEFAULT NULL, - `fk_user_create` int(11) DEFAULT NULL, - `fk_user_modif` int(11) DEFAULT NULL, - PRIMARY KEY (`rowid`), - KEY `idx_advanced_extrafields_values_fk_advanced_extrafields` (`fk_extrafields`,`entity`), - CONSTRAINT `fk_advanced_extrafields_values_fk_advanced_extrafields` FOREIGN KEY (`fk_extrafields`) REFERENCES `llx_advanced_extrafields` (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_advanced_extrafields_values` --- - -LOCK TABLES `llx_advanced_extrafields_values` WRITE; -/*!40000 ALTER TABLE `llx_advanced_extrafields_values` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_advanced_extrafields_values` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_bank` -- diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 8b1eebb24c3f6..b29a76c0d1dcb 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -462,6 +462,10 @@ print '
'; + $parameters = array('chartofaccounts' => $chartofaccounts, 'permissiontoadd' => $permissiontoadd, 'permissiontodelete' => $permissiontodelete); + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $accounting, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 26dd8a8c63ba8..b9b152943abd5 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2907,7 +2907,7 @@ $percent = $line->get_prev_progress($object->id); } if ((float) $all_progress < (float) $percent) { - $mesg = $langs->trans("Line").' '.$i.' : '.$langs->trans("CantBeLessThanMinPercent"); + $mesg = $langs->trans("Line").' '.$line->rang.' : '.$langs->trans("CantBeLessThanMinPercent"); setEventMessages($mesg, null, 'warnings'); $result = -1; } else { diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index b7eb906685033..c5c875fcfb97d 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1127,7 +1127,7 @@ function purgeSessions($mysessionid) $sessValues = file_get_contents($fullpath); // get raw session data if (preg_match('/dol_login/i', $sessValues) && // limit to dolibarr session - preg_match('/dol_entity\|s:([0-9]+):"('.$conf->entity.')"/i', $sessValues) && // limit to current entity + (preg_match('/dol_entity\|i:('.$conf->entity.')/', $sessValues) || preg_match('/dol_entity\|s:([0-9]+):"('.$conf->entity.')"/i', $sessValues)) && // limit to current entity preg_match('/dol_company\|s:([0-9]+):"(' . getDolGlobalString('MAIN_INFO_SOCIETE_NOM').')"/i', $sessValues)) { // limit to company name $tmp = explode('_', $file); $idsess = $tmp[1]; diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index 96140ac1780f0..21868e83967aa 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -238,7 +238,11 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Set path to the background PDF File if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) { - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } + $pagecount = $pdf->setSourceFile($logodir .'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); $tplidx = $pdf->importPage(1); } diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 72126a0f635e1..e2c3747356a10 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -291,7 +291,11 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->SetFont(pdf_getPDFFont($outputlangs)); // Set path to the background PDF File if (!getDolGlobalString('MAIN_DISABLE_FPDI') && getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) { - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } + $pagecount = $pdf->setSourceFile($logodir .'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); $tplidx = $pdf->importPage(1); } 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 b4aa436331882..a7a636f772b82 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -252,7 +252,11 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $pdf->SetFont(pdf_getPDFFont($outputlangs)); // Set path to the background PDF File if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) { - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } + $pagecount = $pdf->setSourceFile($logodir .'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); $tplidx = $pdf->importPage(1); } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 895e804968ecd..a1b8ebb62d2b4 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -865,7 +865,10 @@ //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($user->hasRight($rightskey, 'creer')) { - $arrayofmassactions['preupdateprice'] = img_picto('', 'edit', 'class="pictofixedwidth"').$langs->trans("UpdatePrice"); + if (getDolGlobalString('PRODUCT_PRICE_UNIQ') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { + $arrayofmassactions['preupdateprice'] = img_picto('', 'edit', 'class="pictofixedwidth"').$langs->trans("UpdatePrice"); + } + $arrayofmassactions['switchonsalestatus'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SwitchOnSaleStatus"); $arrayofmassactions['switchonpurchasestatus'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SwitchOnPurchaseStatus"); } diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index b11f9351063b5..77fcb33e72602 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -245,7 +245,7 @@ exit(1); } } - $user->loadRights(); + $user->loadRights('', 1); // We force rights reload to have the correct permissions for user in the entity we just switched in } // Reload langs