diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php
index 55b2052936c..c57e681be34 100644
--- a/htdocs/admin/emailcollector_list.php
+++ b/htdocs/admin/emailcollector_list.php
@@ -315,21 +315,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
llxHeader('', $title, $help_url);
-// Example : Adding jquery code
-print '';
-
$arrayofselected = is_array($toselect) ? $toselect : array();
$param = '';
diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php
index 056a73328dc..1d994e25177 100644
--- a/htdocs/asset/list.php
+++ b/htdocs/asset/list.php
@@ -305,21 +305,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
llxHeader('', $title, $help_url);
-// Example : Adding jquery code
-print '';
-
$arrayofselected = is_array($toselect) ? $toselect : array();
$param = '';
diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php
index fbd219a298b..b598b95ae0a 100644
--- a/htdocs/bom/bom_card.php
+++ b/htdocs/bom/bom_card.php
@@ -244,22 +244,6 @@ $title = $langs->trans('BOM');
$help_url ='EN:Module_BOM';
llxHeader('', $title, $help_url);
-// Example : Adding jquery code
-print '';
-
-
// Part to create
if ($action == 'create') {
print load_fiche_titre($langs->trans("NewBOM"), '', 'bom');
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index f601606be33..aa9897f9dc7 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -4014,7 +4014,7 @@ class Commande extends CommonOrder
$now = dol_now();
- return max($this->date_commande, $this->date_livraison) < ($now - $conf->commande->client->warning_delay);
+ return max($this->date, $this->date_livraison) < ($now - $conf->commande->client->warning_delay);
}
/**
@@ -4131,7 +4131,7 @@ class OrderLine extends CommonOrderLine
$sql .= ' cd.fk_unit,';
$sql .= ' cd.fk_multicurrency, cd.multicurrency_code, cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc,';
$sql .= ' p.ref as product_ref, p.label as product_label, p.description as product_desc, p.tobatch as product_tobatch,';
- $sql .= ' cd.date_start, cd.date_end';
+ $sql .= ' cd.date_start, cd.date_end, cd.vat_src_code';
$sql .= ' FROM '.MAIN_DB_PREFIX.'commandedet as cd';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid';
$sql .= ' WHERE cd.rowid = '.((int) $rowid);
@@ -4352,7 +4352,8 @@ class OrderLine extends CommonOrderLine
// if buy price not defined, define buyprice as configured in margin admin
if ($this->pa_ht == 0 && $pa_ht_isemptystring) {
- if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) {
+ $result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product);
+ if ($result < 0) {
return $result;
} else {
$this->pa_ht = $result;
@@ -4529,7 +4530,8 @@ class OrderLine extends CommonOrderLine
// if buy price not defined, define buyprice as configured in margin admin
if ($this->pa_ht == 0 && $pa_ht_isemptystring) {
- if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) {
+ $result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product);
+ if ($result < 0) {
return $result;
} else {
$this->pa_ht = $result;
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 98bbd00b351..73413d1070f 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -1373,7 +1373,7 @@ if ($resql) {
$generic_product = new Product($db);
$userstatic = new User($db);
$i = 0;
- $totalarray = array();
+ $totalarray = array('nbfield' => 0, 'val' => array(), 'pos' => array());
while ($i < min($num, $limit)) {
$obj = $db->fetch_object($resql);
@@ -1610,7 +1610,11 @@ if ($resql) {
if (!$i) {
$totalarray['pos'][$totalarray['nbfield']] = 'c.total_ht';
}
- $totalarray['val']['c.total_ht'] += $obj->total_ht;
+ if (isset($totalarray['val']['c.total_ht'])) {
+ $totalarray['val']['c.total_ht'] += $obj->total_ht;
+ } else {
+ $totalarray['val']['c.total_ht'] = $obj->total_ht;
+ }
}
// Amount VAT
if (!empty($arrayfields['c.total_vat']['checked'])) {
diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php
index ab8451c9e59..ec7af37940c 100644
--- a/htdocs/compta/cashcontrol/cashcontrol_list.php
+++ b/htdocs/compta/cashcontrol/cashcontrol_list.php
@@ -343,21 +343,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs');
-// Example : Adding jquery code
-print '';
-
$arrayofselected = is_array($toselect) ? $toselect : array();
$param = '';
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 6ec837fe1d1..265f515233f 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -2381,12 +2381,12 @@ if (empty($reshook)) {
setEventMessages($mesg, null, 'warnings');
$error++;
$result = -1;
+ } elseif ($progress < $percent) {
+ $mesg = '
'.$langs->trans("CantBeLessThanMinPercent").'
';
+ setEventMessages($mesg, null, 'warnings');
+ $error++;
+ $result = -1;
}
- } elseif ($progress < $percent) {
- $mesg = ''.$langs->trans("CantBeLessThanMinPercent").'
';
- setEventMessages($mesg, null, 'warnings');
- $error++;
- $result = -1;
}
// Check minimum price
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index cc3688d03a0..a5f408f4299 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -885,30 +885,32 @@ class Contact extends CommonObject
$this->error = $this->db->lasterror();
}
- // Mis a jour alerte birthday
- if (!empty($this->birthday_alert)) {
- //check existing
- $sql_check = "SELECT rowid FROM ".MAIN_DB_PREFIX."user_alert WHERE type=1 AND fk_contact=".$this->db->escape($id)." AND fk_user=".$user->id;
- $result_check = $this->db->query($sql_check);
- if (!$result_check || ($this->db->num_rows($result_check) < 1)) {
- //insert
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."user_alert(type,fk_contact,fk_user) ";
- $sql .= "VALUES (1,".$this->db->escape($id).",".$user->id.")";
+ if ($user) {
+ // Update birthday alert
+ if (!empty($this->birthday_alert)) {
+ //check existing
+ $sql_check = "SELECT rowid FROM " . MAIN_DB_PREFIX . "user_alert WHERE type = 1 AND fk_contact = " . ((int) $id) . " AND fk_user = " . ((int) $user->id);
+ $result_check = $this->db->query($sql_check);
+ if (!$result_check || ($this->db->num_rows($result_check) < 1)) {
+ //insert
+ $sql = "INSERT INTO " . MAIN_DB_PREFIX . "user_alert(type, fk_contact, fk_user) ";
+ $sql .= "VALUES (1," . ((int) $id) . "," . ((int) $user->id) . ")";
+ $result = $this->db->query($sql);
+ if (!$result) {
+ $error++;
+ $this->error = $this->db->lasterror();
+ }
+ } else {
+ $result = true;
+ }
+ } else {
+ $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_alert ";
+ $sql .= "WHERE type=1 AND fk_contact=" . ((int) $id) . " AND fk_user=" . ((int) $user->id);
$result = $this->db->query($sql);
if (!$result) {
$error++;
$this->error = $this->db->lasterror();
}
- } else {
- $result = true;
- }
- } else {
- $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_alert ";
- $sql .= "WHERE type=1 AND fk_contact=".$this->db->escape($id)." AND fk_user=".$user->id;
- $result = $this->db->query($sql);
- if (!$result) {
- $error++;
- $this->error = $this->db->lasterror();
}
}
diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql
index 9eb6a43f9b0..b032ba5beb4 100644
--- a/htdocs/core/menus/init_menu_auguria.sql
+++ b/htdocs/core/menus/init_menu_auguria.sql
@@ -76,8 +76,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
-- Third parties
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 500__+MAX_llx_menu__, 'companies', 'thirdparties', 2__+MAX_llx_menu__, '/societe/index.php?mainmenu=companies&leftmenu=thirdparties', 'ThirdParty', 0, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&action=create', 'MenuNewThirdParty', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 502__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&action=create', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&action=create', 'MenuNewThirdParty', 1, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 502__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&leftmenu=thirdparties', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', __HANDLER__, 'left', 503__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=f&leftmenu=suppliers', 'ListSuppliersShort', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', __HANDLER__, 'left', 504__+MAX_llx_menu__, 'companies', '', 503__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&leftmenu=supplier&action=create&type=f', 'NewSupplier', 2, 'suppliers', '$user->rights->societe->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 506__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=p&leftmenu=prospects', 'ListProspectsShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 3, __ENTITY__);
diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
index 1dc8ce74db0..83ccd391bd9 100644
--- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
@@ -251,7 +251,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
$pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
} else {
- $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default
+ $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default
$pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative
}
diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
index a1c01002d2e..39ea743c5de 100644
--- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
+++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
@@ -240,7 +240,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
$pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
$pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
} else {
- $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default
+ $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default
$pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative
}
diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
index aed43ea40ac..f6f4b0b1a2a 100644
--- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
@@ -201,14 +201,13 @@ class pdf_espadon extends ModelePdfExpedition
continue;
}
- $objphoto = new Product($this->db);
$objphoto->fetch($object->lines[$i]->fk_product);
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
$pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/";
$dir = $conf->product->dir_output.'/'.$pdir;
} else {
- $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
+ $pdir = get_exdir(0, 0, 0, 0, $objphoto, 'product');
$dir = $conf->product->dir_output.'/'.$pdir;
}
@@ -609,7 +608,7 @@ class pdf_espadon extends ModelePdfExpedition
$posYAfterDescription = $pdf->GetY();
}
- $nexY = $pdf->GetY();
+ $nexY = max($pdf->GetY(), $posYAfterImage);
$pageposafter = $pdf->getPage();
$pdf->setPage($pageposbefore);
diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
index ad793d3d6b8..401309c22e5 100644
--- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
@@ -257,7 +257,7 @@ class pdf_sponge extends ModelePDFFactures
$pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
$pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
} else {
- $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default
+ $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default
$pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative
}
diff --git a/htdocs/core/modules/modKnowledgeManagement.class.php b/htdocs/core/modules/modKnowledgeManagement.class.php
index 14e5aabb681..6d9bef40232 100644
--- a/htdocs/core/modules/modKnowledgeManagement.class.php
+++ b/htdocs/core/modules/modKnowledgeManagement.class.php
@@ -68,7 +68,7 @@ class modKnowledgeManagement extends DolibarrModules
$this->descriptionlong = "Manage a Knowledge Management (KM) or Help-Desk base";
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
- $this->version = 'development';
+ $this->version = 'experimental';
// Url to the file with your last numberversion of this module
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';
diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php
index f7ba7a42842..2f4427d7566 100644
--- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php
+++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php
@@ -145,8 +145,14 @@ class pdf_squille extends ModelePdfReception
$objphoto = new Product($this->db);
$objphoto->fetch($object->lines[$i]->fk_product);
- $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/";
- $dir = $conf->product->dir_output.'/'.$pdir;
+ if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
+ {
+ $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/";
+ $dir = $conf->product->dir_output.'/'.$pdir;
+ } else {
+ $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product');
+ $dir = $conf->product->dir_output.'/'.$pdir;
+ }
$realpath = '';
@@ -446,7 +452,7 @@ class pdf_squille extends ModelePdfReception
}
$posYAfterDescription = $pdf->GetY();
- $nexY = $pdf->GetY();
+ $nexY = max($pdf->GetY(), $posYAfterImage);
$pageposafter = $pdf->getPage();
$pdf->setPage($pageposbefore);
diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php
index b51823242f8..d7f7cdb8bb1 100644
--- a/htdocs/eventorganization/conferenceorbooth_list.php
+++ b/htdocs/eventorganization/conferenceorbooth_list.php
@@ -253,20 +253,6 @@ if ($projectid > 0) {
llxHeader('', $title, $help_url);
-// Example : Adding jquery code
-print '';
if ($projectid > 0) {
// To verify role of users
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index c644f9e35a5..bf8e53e8b82 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -610,7 +610,7 @@ $sql .= ' cf.fk_multicurrency, cf.multicurrency_code, cf.multicurrency_tx, cf.mu
$sql .= ' cf.date_creation as date_creation, cf.tms as date_update,';
$sql .= ' cf.note_public, cf.note_private,';
$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_title,";
-$sql .= " u.firstname, u.lastname, u.photo, u.login, u.email as user_email";
+$sql .= " u.firstname, u.lastname, u.photo, u.login, u.email as user_email, u.statut as user_status";
// Add fields from extrafields
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
@@ -1346,6 +1346,7 @@ if ($resql) {
$userstatic->login = $obj->login;
$userstatic->photo = $obj->photo;
$userstatic->email = $obj->user_email;
+ $userstatic->statut = $obj->user_status;
if (!empty($arrayfields['u.login']['checked'])) {
print '';
if ($userstatic->id) {
diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
index f11fa826fac..fa8cb0197cc 100644
--- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
+++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
@@ -353,3 +353,6 @@ INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active)
INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (14,'MAINFREIGHT', 'Mainfreight', NULL, 'https://www.mainfreight.com/track?{TRACKID}', 0);
+UPDATE llx_menu SET perms = '$user->rights->societe->creer' WHERE titre = 'MenuNewThirdParty' AND url = '/societe/card.php?mainmenu=companies&action=create';
+UPDATE llx_menu SET url = '/societe/list.php?mainmenu=companies&leftmenu=thirdparties' WHERE titre = 'List' AND url = '/societe/list.php?mainmenu=companies&action=create';
+
diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
index 5dfeac1d222..1ebb8e380a7 100644
--- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
+++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
@@ -580,6 +580,11 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
-- Removed no more used function
-- VPGSQL8.2 DROP FUNCTION IF EXISTS update_modified_column_date_m() CASCADE;
+-- VPGSQL8.2 DROP TRIGGER update_customer_modtime ON llx_ecm_directories;
+-- VPGSQL8.2 DROP TRIGGER update_customer_modtime ON llx_ecm_files;
+-- VPGSQL8.2 CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_ecm_directories FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+-- VPGSQL8.2 CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_ecm_files FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 6,'AC_EMAIL_IN','system','reception Email',NULL, 1, 4);
diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang
index bd23bd39a5c..cd1964ff383 100644
--- a/htdocs/langs/en_US/website.lang
+++ b/htdocs/langs/en_US/website.lang
@@ -31,7 +31,7 @@ AddWebsite=Add website
Webpage=Web page/container
AddPage=Add page/container
PageContainer=Page
-PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'.
+PreviewOfSiteNotYetAvailable=The preview of your website %s is not yet available. You must first 'Import a full website template' or just 'Add a page/container'.
RequestedPageHasNoContentYet=Requested page with id %s has no content yet, or cache file .tpl.php was removed. Edit content of the page to solve this.
SiteDeleted=Web site '%s' deleted
PageContent=Page/Contenair
diff --git a/htdocs/langs/nl_NL/main.lang b/htdocs/langs/nl_NL/main.lang
index 4a0eb506398..9c0fcdfa791 100644
--- a/htdocs/langs/nl_NL/main.lang
+++ b/htdocs/langs/nl_NL/main.lang
@@ -10,10 +10,10 @@ SeparatorDecimal=,
SeparatorThousand=Space
FormatDateShort=%m/%d/%Y
FormatDateShortInput=%m/%d/%Y
-FormatDateShortJava=MM/dd/jjjj
-FormatDateShortJavaInput=MM/dd/jjjj
-FormatDateShortJQuery=mm/dd/jj
-FormatDateShortJQueryInput=mm/dd/jj
+FormatDateShortJava=MM/dd/yyyy
+FormatDateShortJavaInput=MM/dd/yyyy
+FormatDateShortJQuery=mm/dd/yy
+FormatDateShortJQueryInput=mm/dd/yy
FormatHourShortJQuery=HH:MI
FormatHourShort=%I:%M %p
FormatHourShortDuration=%H:%M
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 ca3c925dd51..e5e352def43 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
@@ -240,16 +240,14 @@ class pdf_standard_myobject extends ModelePDFMyObject
{
if (empty($object->lines[$i]->fk_product)) continue;
- $objphoto->fetch($object->lines[$i]->fk_product);
- //var_dump($objphoto->ref);exit;
- if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
- {
- $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
- $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
- } else {
- $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default
- $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative
- }
+ //var_dump($objphoto->ref);exit;
+ if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
+ $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
+ $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
+ } else {
+ $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default
+ $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative
+ }
$arephoto = false;
foreach ($pdir as $midir)
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index 9a689c79a08..cac59593950 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -212,19 +212,19 @@ $help_url = '';
llxHeader('', $title, $help_url);
// Example : Adding jquery code
-print '';
+// print '';
// Part to create
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index 41561a5a45b..abc8b879d33 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -386,19 +386,19 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs');
// Example : Adding jquery code
-print '';
+// print '';
$arrayofselected = is_array($toselect) ? $toselect : array();
diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php
index fad22645cd5..b6cc502bd60 100644
--- a/htdocs/mrp/mo_card.php
+++ b/htdocs/mrp/mo_card.php
@@ -201,20 +201,6 @@ $title = $langs->trans('Mo')." - ".$langs->trans("Card");
llxHeader('', $title, '');
-// Example : Adding jquery code
-print '';
// Part to create
diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php
index 1883517470c..731a7bcfc50 100644
--- a/htdocs/mrp/mo_list.php
+++ b/htdocs/mrp/mo_list.php
@@ -299,20 +299,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
llxHeader('', $title, $help_url);
-// Example : Adding jquery code
-print '';
$arrayofselected = is_array($toselect) ? $toselect : array();
diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php
index 79f51be6ca9..49d46c652fd 100644
--- a/htdocs/partnership/partnership_list.php
+++ b/htdocs/partnership/partnership_list.php
@@ -398,20 +398,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs');
-// Example : Adding jquery code
-print '';
$arrayofselected = is_array($toselect) ? $toselect : array();
diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php
index 6a29a414ed7..5ec359e5d8a 100644
--- a/htdocs/product/inventory/card.php
+++ b/htdocs/product/inventory/card.php
@@ -168,20 +168,6 @@ $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks|DE:Modul_Best
llxHeader('', $title, $help_url);
-// Example : Adding jquery code
-print '';
// Part to create
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 54a3d9e7ba9..4600377ee01 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
@@ -251,16 +251,15 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio
{
if (empty($object->lines[$i]->fk_product)) continue;
- $objphoto->fetch($object->lines[$i]->fk_product);
- //var_dump($objphoto->ref);exit;
- if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
- {
- $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
- $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
- } else {
- $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default
- $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative
- }
+ $objphoto->fetch($object->lines[$i]->fk_product);
+ //var_dump($objphoto->ref);exit;
+ if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
+ $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
+ $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
+ } else {
+ $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default
+ $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative
+ }
$arephoto = false;
foreach ($pdir as $midir)
diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php
index 4826dc735ef..a1e98ded601 100644
--- a/htdocs/recruitment/recruitmentcandidature_card.php
+++ b/htdocs/recruitment/recruitmentcandidature_card.php
@@ -305,21 +305,6 @@ $title = $langs->trans("RecruitmentCandidature");
$help_url = '';
llxHeader('', $title, $help_url);
-// Example : Adding jquery code
-print '';
-
// Part to create
if ($action == 'create') {
diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php
index 1caeb05095f..7a5a88bc6c4 100644
--- a/htdocs/recruitment/recruitmentcandidature_list.php
+++ b/htdocs/recruitment/recruitmentcandidature_list.php
@@ -348,21 +348,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
llxHeader('', $title, $help_url);
-// Example : Adding jquery code
-print '';
-
$arrayofselected = is_array($toselect) ? $toselect : array();
$param = '';
diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php
index 6475a60a8ed..7ccad1de16a 100644
--- a/htdocs/recruitment/recruitmentjobposition_list.php
+++ b/htdocs/recruitment/recruitmentjobposition_list.php
@@ -349,21 +349,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
llxHeader('', $title, $help_url);
-// Example : Adding jquery code
-print '';
-
$arrayofselected = is_array($toselect) ? $toselect : array();
$param = '';
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index fdfd32cb5d8..a213cca5577 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -4383,21 +4383,24 @@ class Societe extends CommonObject
$table = 'supplier_proposal';
}
- $sql = "SELECT rowid, total_ht, total_ttc, fk_statut as status FROM ".MAIN_DB_PREFIX.$table." as f";
- $sql .= " WHERE fk_soc = ".$this->id;
+ $sql = "SELECT rowid, ref, total_ht, total_ttc, fk_statut as status FROM ".MAIN_DB_PREFIX.$table." as f";
+ $sql .= " WHERE fk_soc = ".((int) $this->id);
if ($mode == 'supplier') {
$sql .= " AND entity IN (".getEntity('supplier_proposal').")";
} else {
$sql .= " AND entity IN (".getEntity('propal').")";
}
- dol_syslog("getOutstandingProposals", LOG_DEBUG);
+ dol_syslog("getOutstandingProposals for fk_soc = ".((int) $this->id), LOG_DEBUG);
+
$resql = $this->db->query($sql);
if ($resql) {
$outstandingOpened = 0;
$outstandingTotal = 0;
$outstandingTotalIncTax = 0;
+ $arrayofref = array();
while ($obj = $this->db->fetch_object($resql)) {
+ $arrayofref[$obj->rowid] = $obj->ref;
$outstandingTotal += $obj->total_ht;
$outstandingTotalIncTax += $obj->total_ttc;
if ($obj->status != 0) {
@@ -4405,7 +4408,7 @@ class Societe extends CommonObject
$outstandingOpened += $obj->total_ttc;
}
}
- return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax); // 'opened' is 'incl taxes'
+ return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax, 'refs'=>$arrayofref); // 'opened' is 'incl taxes'
} else {
return array();
}
@@ -4424,8 +4427,8 @@ class Societe extends CommonObject
$table = 'commande_fournisseur';
}
- $sql = "SELECT rowid, total_ht, total_ttc, fk_statut as status FROM ".MAIN_DB_PREFIX.$table." as f";
- $sql .= " WHERE fk_soc = ".$this->id;
+ $sql = "SELECT rowid, ref, total_ht, total_ttc, fk_statut as status FROM ".MAIN_DB_PREFIX.$table." as f";
+ $sql .= " WHERE fk_soc = ".((int) $this->id);
if ($mode == 'supplier') {
$sql .= " AND entity IN (".getEntity('supplier_order').")";
} else {
@@ -4438,7 +4441,9 @@ class Societe extends CommonObject
$outstandingOpened = 0;
$outstandingTotal = 0;
$outstandingTotalIncTax = 0;
+ $arrayofref = array();
while ($obj = $this->db->fetch_object($resql)) {
+ $arrayofref[$obj->rowid] = $obj->ref;
$outstandingTotal += $obj->total_ht;
$outstandingTotalIncTax += $obj->total_ttc;
if ($obj->status != 0) {
@@ -4446,7 +4451,7 @@ class Societe extends CommonObject
$outstandingOpened += $obj->total_ttc;
}
}
- return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax); // 'opened' is 'incl taxes'
+ return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax, 'refs'=>$arrayofref); // 'opened' is 'incl taxes'
} else {
return array();
}
@@ -4473,7 +4478,7 @@ class Societe extends CommonObject
$alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT');
$remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT');
*/
- $sql = "SELECT rowid, total_ht, total_ttc, paye, type, fk_statut as status, close_code FROM ".MAIN_DB_PREFIX.$table." as f";
+ $sql = "SELECT rowid, ref, total_ht, total_ttc, paye, type, fk_statut as status, close_code FROM ".MAIN_DB_PREFIX.$table." as f";
$sql .= " WHERE fk_soc = ".((int) $this->id);
if (!empty($late)) {
$sql .= " AND date_lim_reglement < '".$this->db->idate(dol_now())."'";
@@ -4490,6 +4495,7 @@ class Societe extends CommonObject
$outstandingOpened = 0;
$outstandingTotal = 0;
$outstandingTotalIncTax = 0;
+ $arrayofref = array();
if ($mode == 'supplier') {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$tmpobject = new FactureFournisseur($this->db);
@@ -4498,6 +4504,7 @@ class Societe extends CommonObject
$tmpobject = new Facture($this->db);
}
while ($obj = $this->db->fetch_object($resql)) {
+ $arrayofref[$obj->rowid] = $obj->ref;
$tmpobject->id = $obj->rowid;
if ($obj->status != $tmpobject::STATUS_DRAFT // Not a draft
@@ -4524,7 +4531,7 @@ class Societe extends CommonObject
$outstandingOpened -= $tmpobject->getSumFromThisCreditNotesNotUsed();
}
}
- return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax); // 'opened' is 'incl taxes'
+ return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax, 'refs'=>$arrayofref); // 'opened' is 'incl taxes'
} else {
dol_syslog("Sql error ".$this->db->lasterror, LOG_ERR);
return array();
diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php
index ddfdea57ef2..16053069d30 100644
--- a/htdocs/website/class/websitepage.class.php
+++ b/htdocs/website/class/websitepage.class.php
@@ -233,6 +233,10 @@ class WebsitePage extends CommonObject
$this->aliasalt = ','.preg_replace('/,+$/', '', preg_replace('/^,+/', '', $this->aliasalt)).','; // content in database must be ',xxx,...,yyy,'
}
+ $this->pageurl = preg_replace('/[^a-z0-9\-\_]/i', '', $this->pageurl);
+ $this->pageurl = preg_replace('/\-\-+/', '-', $this->pageurl);
+ $this->pageurl = preg_replace('/^\-/', '', $this->pageurl);
+
// Remove spaces and be sure we have main language only
$this->lang = preg_replace('/[_-].*$/', '', trim($this->lang)); // en_US or en-US -> en
@@ -576,6 +580,10 @@ class WebsitePage extends CommonObject
$this->aliasalt = ','.preg_replace('/,+$/', '', preg_replace('/^,+/', '', $this->aliasalt)).','; // content in database must be ',xxx,...,yyy,'
}
+ $this->pageurl = preg_replace('/[^a-z0-9\-\_]/i', '', $this->pageurl);
+ $this->pageurl = preg_replace('/\-\-+/', '-', $this->pageurl);
+ $this->pageurl = preg_replace('/^\-/', '', $this->pageurl);
+
// Remove spaces and be sure we have main language only
$this->lang = preg_replace('/[_-].*$/', '', trim($this->lang)); // en_US or en-US -> en
diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php
index 2074873a031..cf4d26b2c33 100644
--- a/htdocs/website/websiteaccount_card.php
+++ b/htdocs/website/websiteaccount_card.php
@@ -117,22 +117,6 @@ $formfile = new FormFile($db);
llxHeader('', 'WebsiteAccount', '');
-// Example : Adding jquery code
-print '';
-
-
// Part to create
if ($action == 'create') {
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("WebsiteAccount")));
diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php
index 673b1db935d..5b63ca2d481 100755
--- a/htdocs/workstation/workstation_card.php
+++ b/htdocs/workstation/workstation_card.php
@@ -159,7 +159,7 @@ $help_url = 'EN:Module_Workstation';
llxHeader('', $title, $help_url);
-// Example : Adding jquery code
+// jquery code
?>
|