*
@@ -741,12 +741,11 @@ if ($object->id > 0)
/*
* Latest proposals
*/
- if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
- {
+ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
$langs->load("propal");
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht";
- $sql .= ", p.tva as total_tva";
+ $sql .= ", p.total_tva";
$sql .= ", p.total as total_ttc";
$sql .= ", p.ref, p.ref_client, p.remise";
$sql .= ", p.datep as dp, p.fin_validite as date_limit";
diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index fec8622d77a..e4d04ace6ae 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -137,7 +137,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) {
* Draft customer proposals
*/
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
- $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.fk_statut as status";
+ $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total as total_ttc, p.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
@@ -228,7 +228,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
* Draft supplier proposals
*/
if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) {
- $sql = "SELECT p.rowid, p.ref, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.fk_statut as status";
+ $sql = "SELECT p.rowid, p.ref, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
@@ -765,7 +765,7 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T
* Opened (validated) proposals
*/
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
- $sql = "SELECT p.rowid as propalid, p.entity, p.total as total_ttc, p.total_ht, p.tva as total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
+ $sql = "SELECT p.rowid as propalid, p.entity, p.total as total_ttc, p.total_ht, p.total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index a115d8bca5e..aadc1f55281 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -285,7 +285,7 @@ class Propal extends CommonObject
'remise_absolue' =>array('type'=>'double', 'label'=>'CustomerRelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
//'remise' =>array('type'=>'double', 'label'=>'Remise', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
'total_ht' =>array('type'=>'double(24,8)', 'label'=>'TotalHT', 'enabled'=>1, 'visible'=>-1, 'position'=>125, 'isameasure'=>1),
- 'tva' =>array('type'=>'double(24,8)', 'label'=>'VAT', 'enabled'=>1, 'visible'=>-1, 'position'=>130, 'isameasure'=>1),
+ 'total_tva' =>array('type'=>'double(24,8)', 'label'=>'VAT', 'enabled'=>1, 'visible'=>-1, 'position'=>130, 'isameasure'=>1),
'localtax1' =>array('type'=>'double(24,8)', 'label'=>'LocalTax1', 'enabled'=>1, 'visible'=>-1, 'position'=>135, 'isameasure'=>1),
'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LocalTax2', 'enabled'=>1, 'visible'=>-1, 'position'=>140, 'isameasure'=>1),
'total' =>array('type'=>'double(24,8)', 'label'=>'TotalTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>145, 'isameasure'=>1),
@@ -1038,7 +1038,7 @@ class Propal extends CommonObject
$sql .= ", remise";
$sql .= ", remise_percent";
$sql .= ", remise_absolue";
- $sql .= ", tva";
+ $sql .= ", total_tva";
$sql .= ", total";
$sql .= ", datep";
$sql .= ", datec";
@@ -1425,7 +1425,7 @@ class Propal extends CommonObject
public function fetch($rowid, $ref = '', $ref_ext = '')
{
$sql = "SELECT p.rowid, p.ref, p.entity, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc";
- $sql .= ", p.total, p.tva, p.localtax1, p.localtax2, p.total_ht";
+ $sql .= ", p.total, p.total_tva, p.localtax1, p.localtax2, p.total_ht";
$sql .= ", p.datec";
$sql .= ", p.date_valid as datev";
$sql .= ", p.datep as dp";
@@ -1483,7 +1483,7 @@ class Propal extends CommonObject
$this->remise_absolue = $obj->remise_absolue;
$this->total = $obj->total; // TODO deprecated
$this->total_ht = $obj->total_ht;
- $this->total_tva = $obj->tva;
+ $this->total_tva = $obj->total_tva;
$this->total_localtax1 = $obj->localtax1;
$this->total_localtax2 = $obj->localtax2;
$this->total_ttc = $obj->total;
@@ -1618,7 +1618,7 @@ class Propal extends CommonObject
$sql .= " datep=".(strval($this->date) != '' ? "'".$this->db->idate($this->date)."'" : 'null').",";
if (!empty($this->fin_validite)) $sql .= " fin_validite=".(strval($this->fin_validite) != '' ? "'".$this->db->idate($this->fin_validite)."'" : 'null').",";
$sql .= " date_valid=".(strval($this->date_validation) != '' ? "'".$this->db->idate($this->date_validation)."'" : 'null').",";
- $sql .= " tva=".(isset($this->total_tva) ? $this->total_tva : "null").",";
+ $sql .= " total_tva=".(isset($this->total_tva) ? $this->total_tva : "null").",";
$sql .= " localtax1=".(isset($this->total_localtax1) ? $this->total_localtax1 : "null").",";
$sql .= " localtax2=".(isset($this->total_localtax2) ? $this->total_localtax2 : "null").",";
$sql .= " total_ht=".(isset($this->total_ht) ? $this->total_ht : "null").",";
diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php
index b51f138b0e5..c274ebf74f3 100644
--- a/htdocs/comm/propal/index.php
+++ b/htdocs/comm/propal/index.php
@@ -198,7 +198,7 @@ if ($resql)
* Draft proposals
*/
if (!empty($conf->propal->enabled)) {
- $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc";
+ $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total as total_ttc";
$sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta";
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 5eca82f022c..d05543530d1 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -181,14 +181,14 @@ $arrayfields = array(
'p.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>0),
'p.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0),
'p.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
- 'p.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0),
+ 'p.total_tva'=>array('label'=>"AmountVAT", 'checked'=>0),
'p.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
'p.total_ht_invoiced'=>array('label'=>"AmountInvoicedHT", 'checked'=>0, 'enabled'=>!empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
'p.total_invoiced'=>array('label'=>"AmountInvoicedTTC", 'checked'=>0, 'enabled'=>!empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
'p.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
'p.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
'p.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
- 'p.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'p.multicurrency_total_tva'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
'p.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
'p.multicurrency_total_ht_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedHT', 'checked'=>0, 'enabled'=>!empty($conf->multicurrency->enabled) && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
'p.multicurrency_total_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedTTC', 'checked'=>0, 'enabled'=>!empty($conf->multicurrency->enabled) && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
@@ -391,8 +391,8 @@ $sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.tow
$sql .= " typent.code as typent_code,";
$sql .= " ava.rowid as availability,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
-$sql .= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut as status, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,';
-$sql .= ' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva as multicurrency_total_vat, p.multicurrency_total_ttc,';
+$sql .= ' p.rowid, p.entity, p.note_private, p.total_ht, p.total_tva, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut as status, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,';
+$sql .= ' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc,';
$sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,';
$sql .= ' p.note_public, p.note_private,';
$sql .= ' p.fk_cond_reglement,p.fk_mode_reglement,p.fk_shipping_method,';
@@ -449,7 +449,7 @@ if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
if ($search_societe_alias) $sql .= natural_search('s.name_alias', $search_societe_alias);
if ($search_login) $sql .= natural_search("u.login", $search_login);
if ($search_montant_ht != '') $sql .= natural_search("p.total_ht", $search_montant_ht, 1);
-if ($search_montant_vat != '') $sql .= natural_search("p.tva", $search_montant_vat, 1);
+if ($search_montant_vat != '') $sql .= natural_search("p.total_tva", $search_montant_vat, 1);
if ($search_montant_ttc != '') $sql .= natural_search("p.total", $search_montant_ttc, 1);
if ($search_multicurrency_code != '') $sql .= ' AND p.multicurrency_code = "'.$db->escape($search_multicurrency_code).'"';
if ($search_multicurrency_tx != '') $sql .= natural_search('p.multicurrency_tx', $search_multicurrency_tx, 1);
@@ -834,7 +834,7 @@ if ($resql)
print '';
print '';
}
- if (!empty($arrayfields['p.total_vat']['checked']))
+ if (!empty($arrayfields['p.total_tva']['checked']))
{
// Amount
print '| ';
@@ -881,7 +881,7 @@ if ($resql)
print '';
print ' | ';
}
- if (!empty($arrayfields['p.multicurrency_total_vat']['checked']))
+ if (!empty($arrayfields['p.multicurrency_total_tva']['checked']))
{
// Amount
print '';
@@ -992,14 +992,14 @@ if ($resql)
if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) print_liste_field_titre($arrayfields['p.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "p.fk_cond_reglement", "", $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['p.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['p.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "p.fk_mode_reglement", "", $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'], $_SERVER["PHP_SELF"], 'p.total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
- if (!empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'], $_SERVER["PHP_SELF"], 'p.tva', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['p.total_tva']['checked'])) print_liste_field_titre($arrayfields['p.total_tva']['label'], $_SERVER["PHP_SELF"], 'p.total_tva', '', $param, 'class="right"', $sortfield, $sortorder);
if (!empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'], $_SERVER["PHP_SELF"], 'p.total', '', $param, 'class="right"', $sortfield, $sortorder);
if (!empty($arrayfields['p.total_ht_invoiced']['checked'])) print_liste_field_titre($arrayfields['p.total_ht_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder);
if (!empty($arrayfields['p.total_invoiced']['checked'])) print_liste_field_titre($arrayfields['p.total_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder);
if (!empty($arrayfields['p.multicurrency_code']['checked'])) print_liste_field_titre($arrayfields['p.multicurrency_code']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_code', '', $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['p.multicurrency_tx']['checked'])) print_liste_field_titre($arrayfields['p.multicurrency_tx']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_tx', '', $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['p.multicurrency_total_ht']['checked'])) print_liste_field_titre($arrayfields['p.multicurrency_total_ht']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
- if (!empty($arrayfields['p.multicurrency_total_vat']['checked'])) print_liste_field_titre($arrayfields['p.multicurrency_total_vat']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_total_tva', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['p.multicurrency_total_tva']['checked'])) print_liste_field_titre($arrayfields['p.multicurrency_total_tva']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_total_tva', '', $param, 'class="right"', $sortfield, $sortorder);
if (!empty($arrayfields['p.multicurrency_total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.multicurrency_total_ttc']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_total_ttc', '', $param, 'class="right"', $sortfield, $sortorder);
if (!empty($arrayfields['p.multicurrency_total_ht_invoiced']['checked'])) print_liste_field_titre($arrayfields['p.multicurrency_total_ht_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder);
if (!empty($arrayfields['p.multicurrency_total_invoiced']['checked'])) print_liste_field_titre($arrayfields['p.multicurrency_total_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder);
@@ -1267,12 +1267,12 @@ if ($resql)
$totalarray['val']['p.total_ht'] += $obj->total_ht;
}
// Amount VAT
- if (!empty($arrayfields['p.total_vat']['checked']))
+ if (!empty($arrayfields['p.total_tva']['checked']))
{
- print ' | '.price($obj->total_vat)." | \n";
+ print ''.price($obj->total_tva)." | \n";
if (!$i) $totalarray['nbfield']++;
- if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_vat';
- $totalarray['val']['p.total_vat'] += $obj->total_vat;
+ if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_tva';
+ $totalarray['val']['p.total_tva'] += $obj->total_tva;
}
// Amount TTC
if (!empty($arrayfields['p.total_ttc']['checked']))
@@ -1320,9 +1320,9 @@ if ($resql)
if (!$i) $totalarray['nbfield']++;
}
// Amount VAT
- if (!empty($arrayfields['p.multicurrency_total_vat']['checked']))
+ if (!empty($arrayfields['p.multicurrency_total_tva']['checked']))
{
- print ''.price($obj->multicurrency_total_vat)." | \n";
+ print ''.price($obj->multicurrency_total_tva)." | \n";
if (!$i) $totalarray['nbfield']++;
}
// Amount TTC
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 7b60dd639f6..249df885435 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -1376,7 +1376,7 @@ if ($resql)
// Alias
if (!empty($arrayfields['s.name_alias']['checked']))
{
- print '';
+ print ' | ';
print $obj->name_alias;
print ' | ';
if (!$i) $totalarray['nbfield']++;
diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php
index 6efd56c01db..747bae87cf7 100644
--- a/htdocs/core/boxes/box_propales.php
+++ b/htdocs/core/boxes/box_propales.php
@@ -2,7 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville
* Copyright (C) 2004-2007 Laurent Destailleur
* Copyright (C) 2005-2009 Regis Houssin
- * Copyright (C) 2015-2019 Frederic France
+ * Copyright (C) 2015-2021 Frederic France
* Copyright (C) 2020 Pierre Ardoin
*
* This program is free software; you can redistribute it and/or modify
@@ -88,7 +88,7 @@ class box_propales extends ModeleBoxes
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.logo, s.email, s.entity";
- $sql .= ", p.rowid, p.ref, p.fk_statut, p.datep as dp, p.datec, p.fin_validite, p.date_cloture, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.tms";
+ $sql .= ", p.rowid, p.ref, p.fk_statut, p.datep as dp, p.datec, p.fin_validite, p.date_cloture, p.total_ht, p.total_tva, p.total as total_ttc, p.tms";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= ", ".MAIN_DB_PREFIX."propal as p";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 503fa93abe2..394138ce2ce 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -3230,9 +3230,12 @@ abstract class CommonObject
// Specific code for backward compatibility with old field names
if ($this->element == 'facture' || $this->element == 'facturerec') $fieldht = 'total';
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') $fieldtva = 'total_tva';
- if ($this->element == 'propal') $fieldttc = 'total';
+ if ($this->element == 'propal') {
+ $fieldttc = 'total';
+ $fieldtva = 'total_tva';
+ }
if ($this->element == 'expensereport') $fieldtva = 'total_tva';
- if ($this->element == 'supplier_proposal') $fieldttc = 'total';
+ if ($this->element == 'supplier_proposal') $fieldtva = 'total_tva';
if ($this->element == 'commande') $fieldtva = 'total_tva';
if (empty($nodatabaseupdate))
diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php
index a706d9a880e..c2850990ff5 100644
--- a/htdocs/core/class/translate.class.php
+++ b/htdocs/core/class/translate.class.php
@@ -460,7 +460,7 @@ class Translate
$tmparray = dol_getcache($usecachekey);
if (is_array($tmparray) && count($tmparray))
{
- $this->tab_translate += $tmparray; // Faster than array_merge($tmparray,$this->tab_translate). Note: If a valuer already exists into tab_translate, value into tmparaay is not added.
+ $this->tab_translate += $tmparray; // Faster than array_merge($tmparray,$this->tab_translate). Note: If a value already exists into tab_translate, value into tmparaay is not added.
//print $newdomain."\n";
//var_dump($this->tab_translate);
$fileread = 1;
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index a424657e206..310f34a86fb 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -7,7 +7,7 @@
* Copyright (C) 2013-2014 Juanjo Menent
* Copyright (C) 2013 Christophe Battarel
* Copyright (C) 2013-2018 Alexandre Spangaro
- * Copyright (C) 2015-2019 Frédéric France
+ * Copyright (C) 2015-2021 Frédéric France
* Copyright (C) 2015 Raphaël Doursenaud
* Copyright (C) 2017 Rui Strecht
* Copyright (C) 2018 Ferran Marcet
@@ -53,20 +53,32 @@ function societe_prepare_head(Societe $object)
if (empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) {
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->societe->contact->lire) {
//$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
- $nbContact = 0; // TODO
+ $nbContact = 0;
+ // Enable caching of thirdrparty count Contacts
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
+ $cachekey = 'count_contacts_thirdparty_'.$object->id;
+ $dataretrieved = dol_getcache($cachekey);
- $sql = "SELECT COUNT(p.rowid) as nb";
- $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
- $sql .= " WHERE p.fk_soc = ".$object->id;
- $resql = $db->query($sql);
- if ($resql) {
- $obj = $db->fetch_object($resql);
- if ($obj) $nbContact = $obj->nb;
+ if (!is_null($dataretrieved)) {
+ $nbContact = $dataretrieved;
+ } else {
+ $sql = "SELECT COUNT(p.rowid) as nb";
+ $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
+ $sql .= " WHERE p.fk_soc = ".$object->id;
+ $resql = $db->query($sql);
+ if ($resql) {
+ $obj = $db->fetch_object($resql);
+ $nbContact = $obj->nb;
+ }
+
+ dol_setcache($cachekey, $nbContact, 120); // If setting cache fails, this is not a problem, so we do not test result.
}
$head[$h][0] = DOL_URL_ROOT.'/societe/contact.php?socid='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
- if ($nbContact > 0) $head[$h][1] .= ''.$nbContact.'';
+ if ($nbContact > 0) {
+ $head[$h][1] .= ''.$nbContact.'';
+ }
$head[$h][2] = 'contact';
$h++;
}
@@ -74,7 +86,9 @@ function societe_prepare_head(Societe $object)
$head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id;
$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
$head[$h][1] = $langs->trans("ContactsAddresses");
- if ($nbContact > 0) $head[$h][1] .= ''.$nbContact.'';
+ if ($nbContact > 0) {
+ $head[$h][1] .= ''.$nbContact.'';
+ }
$head[$h][2] = 'contact';
$h++;
}
@@ -82,9 +96,15 @@ function societe_prepare_head(Societe $object)
if ($object->client == 1 || $object->client == 2 || $object->client == 3) {
$head[$h][0] = DOL_URL_ROOT.'/comm/card.php?socid='.$object->id;
$head[$h][1] = '';
- if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && ($object->client == 2 || $object->client == 3)) $head[$h][1] .= $langs->trans("Prospect");
- if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && $object->client == 3) $head[$h][1] .= ' | ';
- if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && ($object->client == 1 || $object->client == 3)) $head[$h][1] .= $langs->trans("Customer");
+ if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && ($object->client == 2 || $object->client == 3)) {
+ $head[$h][1] .= $langs->trans("Prospect");
+ }
+ if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && $object->client == 3) {
+ $head[$h][1] .= ' | ';
+ }
+ if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && ($object->client == 1 || $object->client == 3)) {
+ $head[$h][1] .= $langs->trans("Customer");
+ }
$head[$h][2] = 'customer';
$h++;
@@ -98,7 +118,9 @@ function societe_prepare_head(Societe $object)
}
}
$supplier_module_enabled = 0;
- if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) $supplier_module_enabled = 1;
+ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
+ $supplier_module_enabled = 1;
+ }
if ($supplier_module_enabled == 1 && $object->fournisseur && !empty($user->rights->fournisseur->lire)) {
$head[$h][0] = DOL_URL_ROOT.'/fourn/card.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Supplier");
@@ -107,26 +129,33 @@ function societe_prepare_head(Societe $object)
}
if (!empty($conf->projet->enabled) && (!empty($user->rights->projet->lire))) {
+ $nbProject = 0;
+ // Enable caching of thirdrparty count projects
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
+ $cachekey = 'count_projects_thirdparty_'.$object->id;
+ $dataretrieved = dol_getcache($cachekey);
+
+ if (!is_null($dataretrieved)) {
+ $nbProject = $dataretrieved;
+ } else {
+ $sql = "SELECT COUNT(n.rowid) as nb";
+ $sql .= " FROM ".MAIN_DB_PREFIX."projet as n";
+ $sql .= " WHERE fk_soc = ".$object->id;
+ $sql .= " AND entity IN (".getEntity('project').")";
+ $resql = $db->query($sql);
+ if ($resql) {
+ $obj = $db->fetch_object($resql);
+ $nbProject = $obj->nb;
+ } else {
+ dol_print_error($db);
+ }
+ dol_setcache($cachekey, $nbProject, 120); // If setting cache fails, this is not a problem, so we do not test result.
+ }
$head[$h][0] = DOL_URL_ROOT.'/societe/project.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Projects");
- $nbNote = 0;
- $sql = "SELECT COUNT(n.rowid) as nb";
- $sql .= " FROM ".MAIN_DB_PREFIX."projet as n";
- $sql .= " WHERE fk_soc = ".$object->id;
- $sql .= " AND entity IN (".getEntity('project').")";
- $resql = $db->query($sql);
- if ($resql) {
- $num = $db->num_rows($resql);
- $i = 0;
- while ($i < $num) {
- $obj = $db->fetch_object($resql);
- $nbNote = $obj->nb;
- $i++;
- }
- } else {
- dol_print_error($db);
+ if ($nbProject > 0) {
+ $head[$h][1] .= ''.$nbProject.'';
}
- if ($nbNote > 0) $head[$h][1] .= ''.$nbNote.'';
$head[$h][2] = 'project';
$h++;
}
@@ -180,12 +209,16 @@ function societe_prepare_head(Societe $object)
//$title = $langs->trans("BankAccountsAndGateways");
$servicestatus = 0;
- if (!empty($conf->global->STRIPE_LIVE) && !GETPOST('forcesandbox', 'alpha')) $servicestatus = 1;
+ if (!empty($conf->global->STRIPE_LIVE) && !GETPOST('forcesandbox', 'alpha')) {
+ $servicestatus = 1;
+ }
include_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php';
$societeaccount = new SocieteAccount($db);
$stripecu = $societeaccount->getCustomerAccount($object->id, 'stripe', $servicestatus); // Get thirdparty cu_...
- if ($stripecu) $foundonexternalonlinesystem++;
+ if ($stripecu) {
+ $foundonexternalonlinesystem++;
+ }
}
$sql = "SELECT COUNT(n.rowid) as nb";
@@ -199,13 +232,8 @@ function societe_prepare_head(Societe $object)
$resql = $db->query($sql);
if ($resql) {
- $num = $db->num_rows($resql);
- $i = 0;
- while ($i < $num) {
- $obj = $db->fetch_object($resql);
- $nbBankAccount = $obj->nb;
- $i++;
- }
+ $obj = $db->fetch_object($resql);
+ $nbBankAccount = $obj->nb;
} else {
dol_print_error($db);
}
@@ -214,8 +242,11 @@ function societe_prepare_head(Societe $object)
$head[$h][0] = DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id;
$head[$h][1] = $title;
- if ($foundonexternalonlinesystem) $head[$h][1] .= '...';
- elseif ($nbBankAccount > 0) $head[$h][1] .= ''.$nbBankAccount.'';
+ if ($foundonexternalonlinesystem) {
+ $head[$h][1] .= '...';
+ } elseif ($nbBankAccount > 0) {
+ $head[$h][1] .= ''.$nbBankAccount.'';
+ }
$head[$h][2] = 'rib';
$h++;
}
@@ -229,17 +260,14 @@ function societe_prepare_head(Societe $object)
$sql .= " WHERE fk_soc = ".$object->id.' AND fk_website > 0';
$resql = $db->query($sql);
if ($resql) {
- $num = $db->num_rows($resql);
- $i = 0;
- while ($i < $num) {
- $obj = $db->fetch_object($resql);
- $nbNote = $obj->nb;
- $i++;
- }
+ $obj = $db->fetch_object($resql);
+ $nbNote = $obj->nb;
} else {
dol_print_error($db);
}
- if ($nbNote > 0) $head[$h][1] .= ''.$nbNote.'';
+ if ($nbNote > 0) {
+ $head[$h][1] .= ''.$nbNote.'';
+ }
$head[$h][2] = 'website';
$h++;
}
@@ -253,50 +281,75 @@ function societe_prepare_head(Societe $object)
if ($user->socid == 0) {
// Notifications
if (!empty($conf->notification->enabled)) {
- $nbNote = 0;
- $sql = "SELECT COUNT(n.rowid) as nb";
- $sql .= " FROM ".MAIN_DB_PREFIX."notify_def as n";
- $sql .= " WHERE fk_soc = ".$object->id;
- $resql = $db->query($sql);
- if ($resql) {
- $num = $db->num_rows($resql);
- $i = 0;
- while ($i < $num) {
- $obj = $db->fetch_object($resql);
- $nbNote = $obj->nb;
- $i++;
- }
+ $nbNotif = 0;
+ // Enable caching of thirdrparty count notifications
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
+ $cachekey = 'count_notifications_thirdparty_'.$object->id;
+ $dataretrieved = dol_getcache($cachekey);
+ if (!is_null($dataretrieved)) {
+ $nbNotif = $dataretrieved;
} else {
- dol_print_error($db);
+ $sql = "SELECT COUNT(n.rowid) as nb";
+ $sql .= " FROM ".MAIN_DB_PREFIX."notify_def as n";
+ $sql .= " WHERE fk_soc = ".$object->id;
+ $resql = $db->query($sql);
+ if ($resql) {
+ $obj = $db->fetch_object($resql);
+ $nbNotif = $obj->nb;
+ } else {
+ dol_print_error($db);
+ }
+ dol_setcache($cachekey, $nbNotif, 120); // If setting cache fails, this is not a problem, so we do not test result.
}
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Notifications");
- if ($nbNote > 0) $head[$h][1] .= ''.$nbNote.'';
+ if ($nbNotif > 0) {
+ $head[$h][1] .= ''.$nbNotif.'';
+ }
$head[$h][2] = 'notify';
$h++;
}
// Notes
$nbNote = 0;
- if (!empty($object->note_private)) $nbNote++;
- if (!empty($object->note_public)) $nbNote++;
+ if (!empty($object->note_private)) {
+ $nbNote++;
+ }
+ if (!empty($object->note_public)) {
+ $nbNote++;
+ }
$head[$h][0] = DOL_URL_ROOT.'/societe/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Notes");
- if ($nbNote > 0) $head[$h][1] .= ''.$nbNote.'';
+ if ($nbNote > 0) {
+ $head[$h][1] .= ''.$nbNote.'';
+ }
$head[$h][2] = 'note';
$h++;
- // Attached files
- require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
- require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
- $upload_dir = $conf->societe->multidir_output[$object->entity]."/".$object->id;
- $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
- $nbLinks = Link::count($db, $object->element, $object->id);
+ // Attached files and Links
+ $totalAttached = 0;
+ // Enable caching of thirdrparty count attached files and links
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
+ $cachekey = 'count_attached_thirdparty_'.$object->id;
+ $dataretrieved = dol_getcache($cachekey);
+ if (!is_null($dataretrieved)) {
+ $totalAttached = $dataretrieved;
+ } else {
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+ require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
+ $upload_dir = $conf->societe->multidir_output[$object->entity]."/".$object->id;
+ $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
+ $nbLinks = Link::count($db, $object->element, $object->id);
+ $totalAttached = $nbFiles + $nbLinks;
+ dol_setcache($cachekey, $totalAttached, 120); // If setting cache fails, this is not a problem, so we do not test result.
+ }
$head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Documents");
- if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= ''.($nbFiles + $nbLinks).'';
+ if (($totalAttached) > 0) {
+ $head[$h][1] .= ''.($totalAttached).'';
+ }
$head[$h][2] = 'document';
$h++;
}
@@ -304,17 +357,41 @@ function societe_prepare_head(Societe $object)
$head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Events");
if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ $nbEvent = 0;
+ // Enable caching of thirdrparty count actioncomm
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
+ $cachekey = 'count_events_thirdparty_'.$object->id;
+ $dataretrieved = dol_getcache($cachekey);
+ if (!is_null($dataretrieved)) {
+ $nbEvent = $dataretrieved;
+ } else {
+ $sql = "SELECT COUNT(id) as nb";
+ $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm";
+ $sql .= " WHERE fk_soc = ".$object->id;
+ $resql = $db->query($sql);
+ if ($resql) {
+ $obj = $db->fetch_object($resql);
+ $nbEvent = $obj->nb;
+ } else {
+ dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
+ }
+ dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
+ }
+
$head[$h][1] .= '/';
$head[$h][1] .= $langs->trans("Agenda");
+ if ($nbEvent > 0) {
+ $head[$h][1] .= ''.$nbEvent.'';
+ }
}
$head[$h][2] = 'agenda';
$h++;
// Log
/*$head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$object->id;
- $head[$h][1] = $langs->trans("Info");
- $head[$h][2] = 'info';
- $h++;*/
+ $head[$h][1] = $langs->trans("Info");
+ $head[$h][2] = 'info';
+ $h++;*/
complete_head_from_modules($conf, $langs, $object, $head, $h, 'thirdparty', 'remove');
@@ -412,16 +489,27 @@ function getCountry($searchkey, $withcode = '', $dbtouse = 0, $outputlangs = '',
// Check parameters
if (empty($searchkey) && empty($searchlabel)) {
- if ($withcode === 'all') return array('id'=>'', 'code'=>'', 'label'=>'');
- else return '';
+ if ($withcode === 'all') {
+ return array('id'=>'', 'code'=>'', 'label'=>'');
+ } else {
+ return '';
+ }
+ }
+ if (!is_object($dbtouse)) {
+ $dbtouse = $db;
+ }
+ if (!is_object($outputlangs)) {
+ $outputlangs = $langs;
}
- if (!is_object($dbtouse)) $dbtouse = $db;
- if (!is_object($outputlangs)) $outputlangs = $langs;
$sql = "SELECT rowid, code, label FROM ".MAIN_DB_PREFIX."c_country";
- if (is_numeric($searchkey)) $sql .= " WHERE rowid=".$searchkey;
- elseif (!empty($searchkey)) $sql .= " WHERE code='".$db->escape($searchkey)."'";
- else $sql .= " WHERE label='".$db->escape($searchlabel)."'";
+ if (is_numeric($searchkey)) {
+ $sql .= " WHERE rowid=".$searchkey;
+ } elseif (!empty($searchkey)) {
+ $sql .= " WHERE code='".$db->escape($searchkey)."'";
+ } else {
+ $sql .= " WHERE label='".$db->escape($searchlabel)."'";
+ }
$resql = $dbtouse->query($sql);
if ($resql) {
@@ -433,17 +521,25 @@ function getCountry($searchkey, $withcode = '', $dbtouse = 0, $outputlangs = '',
if ($entconv) $label = ($obj->code && ($outputlangs->trans("Country".$obj->code) != "Country".$obj->code)) ? $outputlangs->trans("Country".$obj->code) : $label;
else $label = ($obj->code && ($outputlangs->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code)) ? $outputlangs->transnoentitiesnoconv("Country".$obj->code) : $label;
}
- if ($withcode == 1) $result = $label ? "$obj->code - $label" : "$obj->code";
- elseif ($withcode == 2) $result = $obj->code;
- elseif ($withcode == 3) $result = $obj->rowid;
- elseif ($withcode === 'all') $result = array('id'=>$obj->rowid, 'code'=>$obj->code, 'label'=>$label);
- else $result = $label;
+ if ($withcode == 1) {
+ $result = $label ? "$obj->code - $label" : "$obj->code";
+ } elseif ($withcode == 2) {
+ $result = $obj->code;
+ } elseif ($withcode == 3) {
+ $result = $obj->rowid;
+ } elseif ($withcode === 'all') {
+ $result = array('id'=>$obj->rowid, 'code'=>$obj->code, 'label'=>$label);
+ } else {
+ $result = $label;
+ }
} else {
$result = 'NotDefined';
}
$dbtouse->free($resql);
return $result;
- } else dol_print_error($dbtouse, '');
+ } else {
+ dol_print_error($dbtouse, '');
+ }
return 'Error';
}
@@ -466,7 +562,9 @@ function getState($id, $withcode = '', $dbtouse = 0, $withregion = 0, $outputlan
{
global $db, $langs;
- if (!is_object($dbtouse)) $dbtouse = $db;
+ if (!is_object($dbtouse)) {
+ $dbtouse = $db;
+ }
$sql = "SELECT d.rowid as id, d.code_departement as code, d.nom as name, d.active, c.label as country, c.code as country_code, r.code_region as region_code, r.nom as region_name FROM";
$sql .= " ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r,".MAIN_DB_PREFIX."c_country as c";
@@ -529,7 +627,9 @@ function currency_name($code_iso, $withcode = '', $outputlangs = null)
{
global $langs, $db;
- if (empty($outputlangs)) $outputlangs = $langs;
+ if (empty($outputlangs)) {
+ $outputlangs = $langs;
+ }
$outputlangs->load("dict");
@@ -549,8 +649,11 @@ function currency_name($code_iso, $withcode = '', $outputlangs = null)
if ($num) {
$obj = $db->fetch_object($resql);
$label = ($obj->label != '-' ? $obj->label : '');
- if ($withcode) return ($label == $code_iso) ? "$code_iso" : "$code_iso - $label";
- else return $label;
+ if ($withcode) {
+ return ($label == $code_iso) ? "$code_iso" : "$code_iso - $label";
+ } else {
+ return $label;
+ }
} else {
return $code_iso;
}
@@ -895,8 +998,8 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
// Purge search criteria
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
$search_status = '';
- $search_name = '';
- $search_roles = array();
+ $search_name = '';
+ $search_roles = array();
$search_address = '';
$search_poste = '';
$search = array();
@@ -989,7 +1092,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
} elseif (in_array($key, array('role'))) {
print $formcompany->showRoles("search_roles", $contactstatic, 'edit', $search_roles);
} else {
- print '';
+ print '';
}
print '';
}
@@ -1260,14 +1363,27 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$sql .= " a.fk_contact,";
$sql .= " c.code as acode, c.libelle as alabel, c.picto as apicto,";
$sql .= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname";
- if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur'))) $sql .= ", sp.lastname, sp.firstname";
- elseif (is_object($filterobj) && get_class($filterobj) == 'Dolresource') { /* Nothing */ } elseif (is_object($filterobj) && get_class($filterobj) == 'Project') { /* Nothing */ } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql .= ", m.lastname, m.firstname";
- elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql .= ", o.ref";
- elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql .= ", o.ref";
- elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql .= ", o.ref";
- elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') $sql .= ", o.ref";
- elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') $sql .= ", o.ref";
- elseif (is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid']) && is_array($filterobj->fields['ref']) && $filterobj->table_element && $filterobj->element) $sql .= ", o.ref";
+ if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur'))) {
+ $sql .= ", sp.lastname, sp.firstname";
+ } elseif (is_object($filterobj) && get_class($filterobj) == 'Dolresource') {
+ /* Nothing */
+ } elseif (is_object($filterobj) && get_class($filterobj) == 'Project') {
+ /* Nothing */
+ } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') {
+ $sql .= ", m.lastname, m.firstname";
+ } elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') {
+ $sql .= ", o.ref";
+ } elseif (is_object($filterobj) && get_class($filterobj) == 'Product') {
+ $sql .= ", o.ref";
+ } elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') {
+ $sql .= ", o.ref";
+ } elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') {
+ $sql .= ", o.ref";
+ } elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') {
+ $sql .= ", o.ref";
+ } elseif (is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid']) && is_array($filterobj->fields['ref']) && $filterobj->table_element && $filterobj->element) {
+ $sql .= ", o.ref";
+ }
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action";
@@ -1286,7 +1402,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$sql .= " ON er.resource_type = 'dolresource'";
$sql .= " AND er.element_id = a.id";
$sql .= " AND er.resource_id = ".$filterobj->id;
- } elseif (is_object($filterobj) && get_class($filterobj) == 'Project') { /* Nothing */ } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql .= ", ".MAIN_DB_PREFIX."adherent as m";
+ } elseif (is_object($filterobj) && get_class($filterobj) == 'Project') {
+ /* Nothing */
+ } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql .= ", ".MAIN_DB_PREFIX."adherent as m";
elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql .= ", ".MAIN_DB_PREFIX."product as o";
elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql .= ", ".MAIN_DB_PREFIX."ticket as o";
diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php
index fda122be7bf..9702c8ab1dc 100644
--- a/htdocs/core/lib/cron.lib.php
+++ b/htdocs/core/lib/cron.lib.php
@@ -99,10 +99,10 @@ function dol_print_cron_urls()
// Cron launch
print '';
print $langs->trans("URLToLaunchCronJobs").':
';
- $url = $urlwithroot.'/public/cron/cron_run_jobs.php?'.(empty($conf->global->CRON_KEY) ? '' : 'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login;
+ $url = $urlwithroot.'/public/cron/cron_run_jobs_by_url.php?'.(empty($conf->global->CRON_KEY) ? '' : 'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login;
print img_picto('', 'globe').'
'.$url."\n";
print ' '.$langs->trans("OrToLaunchASpecificJob").'
';
- $url = $urlwithroot.'/public/cron/cron_run_jobs.php?'.(empty($conf->global->CRON_KEY) ? '' : 'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid';
+ $url = $urlwithroot.'/public/cron/cron_run_jobs_by_url.php?'.(empty($conf->global->CRON_KEY) ? '' : 'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid';
print img_picto('', 'globe').'
'.$url."\n";
print '
';
print '
';
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 7d994616e5c..8809e626e81 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2450,21 +2450,32 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64,
function getArrayOfSocialNetworks()
{
global $conf, $db;
- $sql = "SELECT rowid, code, label, url, icon, active FROM ".MAIN_DB_PREFIX."c_socialnetworks";
- $sql .= " WHERE entity=".$conf->entity;
+
$socialnetworks = array();
- $resql = $db->query($sql);
- if ($resql) {
- while ($obj = $db->fetch_object($resql)) {
- $socialnetworks[$obj->code] = array(
- 'rowid' => $obj->rowid,
- 'label' => $obj->label,
- 'url' => $obj->url,
- 'icon' => $obj->icon,
- 'active' => $obj->active,
- );
+ // Enable caching of array
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
+ $cachekey = 'socialnetworks_' . $conf->entity;
+ $dataretrieved = dol_getcache($cachekey);
+ if (!is_null($dataretrieved)) {
+ $socialnetworks = $dataretrieved;
+ } else {
+ $sql = "SELECT rowid, code, label, url, icon, active FROM ".MAIN_DB_PREFIX."c_socialnetworks";
+ $sql .= " WHERE entity=".$conf->entity;
+ $resql = $db->query($sql);
+ if ($resql) {
+ while ($obj = $db->fetch_object($resql)) {
+ $socialnetworks[$obj->code] = array(
+ 'rowid' => $obj->rowid,
+ 'label' => $obj->label,
+ 'url' => $obj->url,
+ 'icon' => $obj->icon,
+ 'active' => $obj->active,
+ );
+ }
}
+ dol_setcache($cachekey, $socialnetworks); // If setting cache fails, this is not a problem, so we do not test result.
}
+
return $socialnetworks;
}
@@ -3173,15 +3184,15 @@ function dol_substr($string, $start, $length, $stringencoding = '', $trunconbyte
/**
- * Truncate a string to a particular length adding '...' if string larger than length.
- * If length = max length+1, we do no truncate to avoid having just 1 char replaced with '...'.
+ * Truncate a string to a particular length adding '…' if string larger than length.
+ * If length = max length+1, we do no truncate to avoid having just 1 char replaced with '…'.
* MAIN_DISABLE_TRUNC=1 can disable all truncings
*
* @param string $string String to truncate
- * @param int $size Max string size visible (excluding ...). 0 for no limit. WARNING: Final string size can have 3 more chars (if we added ..., or if size was max+1 or max+2 or max+3 so it does not worse to replace with ...)
+ * @param int $size Max string size visible (excluding …). 0 for no limit. WARNING: Final string size can have 3 more chars (if we added …, or if size was max+1 so it does not worse to replace with ...)
* @param string $trunc Where to trunc: 'right', 'left', 'middle' (size must be a 2 power), 'wrap'
* @param string $stringencoding Tell what is source string encoding
- * @param int $nodot Truncation do not add ... after truncation. So it's an exact truncation.
+ * @param int $nodot Truncation do not add … after truncation. So it's an exact truncation.
* @param int $display Trunc is used to display data and can be changed for small screen. TODO Remove this param (must be dealt with CSS)
* @return string Truncated string. WARNING: length is never higher than $size if $nodot is set, but can be 3 chars higher otherwise.
*/
@@ -3189,42 +3200,53 @@ function dol_trunc($string, $size = 40, $trunc = 'right', $stringencoding = 'UTF
{
global $conf;
- if ($size == 0 || !empty($conf->global->MAIN_DISABLE_TRUNC)) return $string;
+ if ($size == 0 || !empty($conf->global->MAIN_DISABLE_TRUNC)) {
+ return $string;
+ }
- if (empty($stringencoding)) $stringencoding = 'UTF-8';
+ if (empty($stringencoding)) {
+ $stringencoding = 'UTF-8';
+ }
// reduce for small screen
if ($conf->dol_optimize_smallscreen == 1 && $display == 1) $size = round($size / 3);
// We go always here
- if ($trunc == 'right')
- {
- $newstring = dol_textishtml($string) ?dol_string_nohtmltag($string, 1) : $string;
- if (dol_strlen($newstring, $stringencoding) > ($size + ($nodot ? 0 : 3))) // If nodot is 0 and size is 1,2 or 3 chars more, we don't trunc and don't add ...
- return dol_substr($newstring, 0, $size, $stringencoding).($nodot ? '' : '...');
- else //return 'u'.$size.'-'.$newstring.'-'.dol_strlen($newstring,$stringencoding).'-'.$string;
- return $string;
- } elseif ($trunc == 'middle')
- {
- $newstring = dol_textishtml($string) ?dol_string_nohtmltag($string, 1) : $string;
- if (dol_strlen($newstring, $stringencoding) > 2 && dol_strlen($newstring, $stringencoding) > ($size + 1))
- {
+ if ($trunc == 'right') {
+ $newstring = dol_textishtml($string) ? dol_string_nohtmltag($string, 1) : $string;
+ if (dol_strlen($newstring, $stringencoding) > ($size + ($nodot ? 0 : 1))) {
+ // If nodot is 0 and size is 1 chars more, we don't trunc and don't add …
+ return dol_substr($newstring, 0, $size, $stringencoding).($nodot ? '' : '…');
+ } else {
+ //return 'u'.$size.'-'.$newstring.'-'.dol_strlen($newstring,$stringencoding).'-'.$string;
+ return $string;
+ }
+ } elseif ($trunc == 'middle') {
+ $newstring = dol_textishtml($string) ? dol_string_nohtmltag($string, 1) : $string;
+ if (dol_strlen($newstring, $stringencoding) > 2 && dol_strlen($newstring, $stringencoding) > ($size + 1)) {
$size1 = round($size / 2);
$size2 = round($size / 2);
- return dol_substr($newstring, 0, $size1, $stringencoding).'...'.dol_substr($newstring, dol_strlen($newstring, $stringencoding) - $size2, $size2, $stringencoding);
- } else return $string;
- } elseif ($trunc == 'left')
- {
- $newstring = dol_textishtml($string) ?dol_string_nohtmltag($string, 1) : $string;
- if (dol_strlen($newstring, $stringencoding) > ($size + ($nodot ? 0 : 3))) // If nodot is 0 and size is 1,2 or 3 chars more, we don't trunc and don't add ...
- return '...'.dol_substr($newstring, dol_strlen($newstring, $stringencoding) - $size, $size, $stringencoding);
- else return $string;
- } elseif ($trunc == 'wrap')
- {
- $newstring = dol_textishtml($string) ?dol_string_nohtmltag($string, 1) : $string;
- if (dol_strlen($newstring, $stringencoding) > ($size + 1))
- return dol_substr($newstring, 0, $size, $stringencoding)."\n".dol_trunc(dol_substr($newstring, $size, dol_strlen($newstring, $stringencoding) - $size, $stringencoding), $size, $trunc);
- else return $string;
- } else return 'BadParam3CallingDolTrunc';
+ return dol_substr($newstring, 0, $size1, $stringencoding).'…'.dol_substr($newstring, dol_strlen($newstring, $stringencoding) - $size2, $size2, $stringencoding);
+ } else {
+ return $string;
+ }
+ } elseif ($trunc == 'left') {
+ $newstring = dol_textishtml($string) ? dol_string_nohtmltag($string, 1) : $string;
+ if (dol_strlen($newstring, $stringencoding) > ($size + ($nodot ? 0 : 1))) {
+ // If nodot is 0 and size is 1 chars more, we don't trunc and don't add …
+ return '…'.dol_substr($newstring, dol_strlen($newstring, $stringencoding) - $size, $size, $stringencoding);
+ } else {
+ return $string;
+ }
+ } elseif ($trunc == 'wrap') {
+ $newstring = dol_textishtml($string) ? dol_string_nohtmltag($string, 1) : $string;
+ if (dol_strlen($newstring, $stringencoding) > ($size + 1)) {
+ return dol_substr($newstring, 0, $size, $stringencoding)."\n".dol_trunc(dol_substr($newstring, $size, dol_strlen($newstring, $stringencoding) - $size, $stringencoding), $size, $trunc);
+ } else {
+ return $string;
+ }
+ } else {
+ return 'BadParam3CallingDolTrunc';
+ }
}
/**
diff --git a/htdocs/core/lib/memory.lib.php b/htdocs/core/lib/memory.lib.php
index 90120dc63f1..484b3933e42 100644
--- a/htdocs/core/lib/memory.lib.php
+++ b/htdocs/core/lib/memory.lib.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2021 Frédéric France
*
* 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
@@ -23,11 +24,34 @@
global $shmkeys, $shmoffset;
-$shmkeys = array('main'=>1, 'admin'=>2, 'dict'=>3, 'companies'=>4, 'suppliers'=>5, 'products'=>6,
- 'commercial'=>7, 'compta'=>8, 'projects'=>9, 'cashdesk'=>10, 'agenda'=>11, 'bills'=>12,
- 'propal'=>13, 'boxes'=>14, 'banks'=>15, 'other'=>16, 'errors'=>17, 'members'=>18, 'ecm'=>19,
- 'orders'=>20, 'users'=>21, 'help'=>22, 'stocks'=>23, 'interventions'=>24,
- 'donations'=>25, 'contracts'=>26);
+$shmkeys = array(
+ 'main' => 1,
+ 'admin' => 2,
+ 'dict' => 3,
+ 'companies' => 4,
+ 'suppliers' => 5,
+ 'products' => 6,
+ 'commercial' => 7,
+ 'compta' => 8,
+ 'projects' => 9,
+ 'cashdesk' => 10,
+ 'agenda' => 11,
+ 'bills' => 12,
+ 'propal' => 13,
+ 'boxes' => 14,
+ 'banks' => 15,
+ 'other' => 16,
+ 'errors' => 17,
+ 'members' => 18,
+ 'ecm' => 19,
+ 'orders' => 20,
+ 'users' => 21,
+ 'help' => 22,
+ 'stocks' => 23,
+ 'interventions' => 24,
+ 'donations' => 25,
+ 'contracts' => 26,
+);
$shmoffset = 1000; // Max number of entries found into a language file. If too low, some entries will be overwritten.
@@ -36,61 +60,60 @@ $shmoffset = 1000; // Max number of entries found into a language file. If too l
* Save data into a memory area shared by all users, all sessions on server
*
* @param string $memoryid Memory id of shared area
- * @param mixed $data Data to save
- * @return int <0 if KO, Nb of bytes written if OK
+ * @param mixed $data Data to save. It must not be a null value.
+ * @param int $expire ttl in seconds, 0 never expire
+ * @return int <0 if KO, 0 if nothing is done, Nb of bytes written if OK
* @see dol_getcache()
*/
-function dol_setcache($memoryid, $data)
+function dol_setcache($memoryid, $data, $expire = 0)
{
global $conf;
$result = 0;
- // Using a memcached server
- if (!empty($conf->memcached->enabled) && class_exists('Memcached'))
- {
- global $dolmemcache;
- if (empty($dolmemcache) || !is_object($dolmemcache))
- {
- $dolmemcache = new Memcached();
- $tmparray = explode(':', $conf->global->MEMCACHED_SERVER);
- $result = $dolmemcache->addServer($tmparray[0], $tmparray[1] ? $tmparray[1] : 11211);
- if (!$result) return -1;
- }
+ if (strpos($memoryid, 'count_') === 0) { // The memoryid key start with 'count_...'
+ if (empty($conf->global->MAIN_CACHE_COUNT)) return 0;
+ }
- $memoryid = session_name().'_'.$memoryid;
+ if (!empty($conf->memcached->enabled) && class_exists('Memcached')) {
+ // Using a memcached server
+ global $dolmemcache;
+ if (empty($dolmemcache) || !is_object($dolmemcache)) {
+ $dolmemcache = new Memcached();
+ $tmparray = explode(':', $conf->global->MEMCACHED_SERVER);
+ $result = $dolmemcache->addServer($tmparray[0], $tmparray[1] ? $tmparray[1] : 11211);
+ if (!$result) return -1;
+ }
+
+ $memoryid = session_name() . '_' . $memoryid;
//$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false);
- $dolmemcache->add($memoryid, $data); // This fails if key already exists
+ $dolmemcache->add($memoryid, $data, $expire); // This fails if key already exists
$rescode = $dolmemcache->getResultCode();
- if ($rescode == 0)
- {
+ if ($rescode == 0) {
return count($data);
} else {
return -$rescode;
}
- } elseif (!empty($conf->memcached->enabled) && class_exists('Memcache'))
- {
+ } elseif (!empty($conf->memcached->enabled) && class_exists('Memcache')) { // This is a really not reliable cache ! Use Memcached instead.
+ // Using a memcache server
global $dolmemcache;
- if (empty($dolmemcache) || !is_object($dolmemcache))
- {
- $dolmemcache = new Memcache();
- $tmparray = explode(':', $conf->global->MEMCACHED_SERVER);
- $result = $dolmemcache->addServer($tmparray[0], $tmparray[1] ? $tmparray[1] : 11211);
- if (!$result) return -1;
- }
+ if (empty($dolmemcache) || !is_object($dolmemcache)) {
+ $dolmemcache = new Memcache();
+ $tmparray = explode(':', $conf->global->MEMCACHED_SERVER);
+ $result = $dolmemcache->addServer($tmparray[0], $tmparray[1] ? $tmparray[1] : 11211);
+ if (!$result) return -1;
+ }
- $memoryid = session_name().'_'.$memoryid;
+ $memoryid = session_name() . '_' . $memoryid;
//$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false);
- $result = $dolmemcache->add($memoryid, $data); // This fails if key already exists
- if ($result)
- {
+ $result = $dolmemcache->add($memoryid, $data, false, $expire); // This fails if key already exists
+ if ($result) {
return count($data);
} else {
return -1;
}
- } // Using shmop
- elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02))
- {
- $result = dol_setshmop($memoryid, $data);
+ } elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) { // This is a really not reliable cache ! Use Memcached instead.
+ // Using shmop
+ $result = dol_setshmop($memoryid, $data, $expire);
}
return $result;
@@ -100,68 +123,67 @@ function dol_setcache($memoryid, $data)
* Read a memory area shared by all users, all sessions on server
*
* @param string $memoryid Memory id of shared area
- * @return int|mixed <0 if KO, data if OK
+ * @return int|mixed <0 if KO, data if OK, null if not found into cache or no caching feature enabled
* @see dol_setcache()
*/
function dol_getcache($memoryid)
{
global $conf;
- // Using a memcached server
- if (!empty($conf->memcached->enabled) && class_exists('Memcached'))
- {
- global $m;
- if (empty($m) || !is_object($m))
- {
- $m = new Memcached();
- $tmparray = explode(':', $conf->global->MEMCACHED_SERVER);
- $result = $m->addServer($tmparray[0], $tmparray[1] ? $tmparray[1] : 11211);
- if (!$result) return -1;
- }
+ if (strpos($memoryid, 'count_') === 0) { // The memoryid key start with 'count_...'
+ if (empty($conf->global->MAIN_CACHE_COUNT)) return null;
+ }
- $memoryid = session_name().'_'.$memoryid;
+ // Using a memcached server
+ if (!empty($conf->memcached->enabled) && class_exists('Memcached')) {
+ global $m;
+ if (empty($m) || !is_object($m)) {
+ $m = new Memcached();
+ $tmparray = explode(':', $conf->global->MEMCACHED_SERVER);
+ $result = $m->addServer($tmparray[0], $tmparray[1] ? $tmparray[1] : 11211);
+ if (!$result) return -1;
+ }
+
+ $memoryid = session_name() . '_' . $memoryid;
//$m->setOption(Memcached::OPT_COMPRESSION, false);
//print "Get memoryid=".$memoryid;
$data = $m->get($memoryid);
$rescode = $m->getResultCode();
- //print "memoryid=".$memoryid." - rescode=".$rescode." - data=".count($data)."\n
";
+ //print "memoryid=".$memoryid." - rescode=".$rescode." - count(response)=".count($data)."\n
";
//var_dump($data);
- if ($rescode == 0)
- {
+ if ($rescode == 0) {
return $data;
+ } elseif ($rescode == 16) { // = Memcached::MEMCACHED_NOTFOUND but this constant doe snot exists.
+ return null;
} else {
return -$rescode;
}
- } elseif (!empty($conf->memcached->enabled) && class_exists('Memcache'))
- {
+ } elseif (!empty($conf->memcached->enabled) && class_exists('Memcache')) { // This is a really not reliable cache ! Use Memcached instead.
global $m;
- if (empty($m) || !is_object($m))
- {
- $m = new Memcache();
- $tmparray = explode(':', $conf->global->MEMCACHED_SERVER);
- $result = $m->addServer($tmparray[0], $tmparray[1] ? $tmparray[1] : 11211);
- if (!$result) return -1;
- }
+ if (empty($m) || !is_object($m)) {
+ $m = new Memcache();
+ $tmparray = explode(':', $conf->global->MEMCACHED_SERVER);
+ $result = $m->addServer($tmparray[0], $tmparray[1] ? $tmparray[1] : 11211);
+ if (!$result) return -1;
+ }
- $memoryid = session_name().'_'.$memoryid;
+ $memoryid = session_name() . '_' . $memoryid;
//$m->setOption(Memcached::OPT_COMPRESSION, false);
$data = $m->get($memoryid);
//print "memoryid=".$memoryid." - rescode=".$rescode." - data=".count($data)."\n
";
//var_dump($data);
- if ($data)
- {
+ if ($data) {
return $data;
} else {
- return -1;
+ return null; // There is no way to make a difference between NOTFOUND and error when using Memcache. So do not use it, use Memcached instead.
}
- } // Using shmop
- elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02))
- {
+ } elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) { // This is a really not reliable cache ! Use Memcached instead.
+ // Using shmop
$data = dol_getshmop($memoryid);
return $data;
}
- return 0;
+ return null;
}
@@ -175,7 +197,9 @@ function dol_getcache($memoryid)
function dol_getshmopaddress($memoryid)
{
global $shmkeys, $shmoffset;
- if (empty($shmkeys[$memoryid])) return 0;
+ if (empty($shmkeys[$memoryid])) { // No room reserved for thid memoryid, no way to use cache
+ return 0;
+ }
return $shmkeys[$memoryid] + $shmoffset;
}
@@ -189,10 +213,11 @@ function dol_listshmop()
global $shmkeys, $shmoffset;
$resarray = array();
- foreach ($shmkeys as $key => $val)
- {
+ foreach ($shmkeys as $key => $val) {
$result = dol_getshmop($key);
- if (!is_numeric($result) || $result > 0) $resarray[$key] = $result;
+ if (!is_numeric($result) || $result > 0) {
+ $resarray[$key] = $result;
+ }
}
return $resarray;
}
@@ -201,32 +226,33 @@ function dol_listshmop()
* Save data into a memory area shared by all users, all sessions on server
*
* @param int $memoryid Memory id of shared area ('main', 'agenda', ...)
- * @param string $data Data to save
- * @return int <0 if KO, Nb of bytes written if OK
+ * @param string $data Data to save. Must be a not null value.
+ * @param int $expire ttl in seconds, 0 never expire
+ * @return int <0 if KO, 0=Caching not available, Nb of bytes written if OK
*/
-function dol_setshmop($memoryid, $data)
+function dol_setshmop($memoryid, $data, $expire)
{
global $shmkeys, $shmoffset;
//print 'dol_setshmop memoryid='.$memoryid."
\n";
if (empty($shmkeys[$memoryid]) || !function_exists("shmop_write")) return 0;
$shmkey = dol_getshmopaddress($memoryid);
+ if (empty($shmkey)) return 0; // No key reserved for this memoryid, we can't cache this memoryid
+
$newdata = serialize($data);
$size = strlen($newdata);
//print 'dol_setshmop memoryid='.$memoryid." shmkey=".$shmkey." newdata=".$size."bytes
\n";
$handle = shmop_open($shmkey, 'c', 0644, 6 + $size);
- if ($handle)
- {
+ if ($handle) {
$shm_bytes_written1 = shmop_write($handle, str_pad($size, 6), 0);
$shm_bytes_written2 = shmop_write($handle, $newdata, 6);
- if (($shm_bytes_written1 + $shm_bytes_written2) != (6 + dol_strlen($newdata)))
- {
- print "Couldn't write the entire length of data\n";
+ if (($shm_bytes_written1 + $shm_bytes_written2) != (6 + dol_strlen($newdata))) {
+ print "Couldn't write the entire length of data\n";
}
shmop_close($handle);
return ($shm_bytes_written1 + $shm_bytes_written2);
} else {
- print 'Error in shmop_open for memoryid='.$memoryid.' shmkey='.$shmkey.' 6+size=6+'.$size;
+ print 'Error in shmop_open for memoryid=' . $memoryid . ' shmkey=' . $shmkey . ' 6+size=6+' . $size;
return -1;
}
}
@@ -235,24 +261,29 @@ function dol_setshmop($memoryid, $data)
* Read a memory area shared by all users, all sessions on server
*
* @param string $memoryid Memory id of shared area ('main', 'agenda', ...)
- * @return int <0 if KO, data if OK
+ * @return int <0 if KO, data if OK, Null if no cache enabled or not found
*/
function dol_getshmop($memoryid)
{
global $shmkeys, $shmoffset;
- if (empty($shmkeys[$memoryid]) || !function_exists("shmop_open")) return 0;
+ $data = null;
+
+ if (empty($shmkeys[$memoryid]) || !function_exists("shmop_open")) {
+ return null;
+ }
$shmkey = dol_getshmopaddress($memoryid);
+ if (empty($shmkey)) return null; // No key reserved for this memoryid, we can't cache this memoryid
+
//print 'dol_getshmop memoryid='.$memoryid." shmkey=".$shmkey."
\n";
$handle = @shmop_open($shmkey, 'a', 0, 0);
- if ($handle)
- {
+ if ($handle) {
$size = trim(shmop_read($handle, 0, 6));
if ($size) $data = unserialize(shmop_read($handle, 6, $size));
else return -1;
shmop_close($handle);
} else {
- return -2;
+ return null; // Can't open existing block, so we suppose it was not created, so nothing were cached yet for the memoryid
}
return $data;
}
diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php
index 75a20ac6852..07112ed66d9 100644
--- a/htdocs/core/lib/website.lib.php
+++ b/htdocs/core/lib/website.lib.php
@@ -205,7 +205,7 @@ function dolWebsiteReplacementOfLinks($website, $content, $removephppart = 0, $c
/**
* Render a string of an HTML content and output it.
- * Used to ouput the page when viewed from server (Dolibarr or Apache).
+ * Used to ouput the page when viewed from a server (Dolibarr or Apache).
*
* @param string $content Content string
* @param string $contenttype Content type
@@ -231,7 +231,7 @@ function dolWebsiteOutput($content, $contenttype = 'html', $containerid = '')
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
- if (defined('USEDOLIBARREDITOR')) // REPLACEMENT OF LINKS When page called from Dolibarr editor
+ if (defined('USEDOLIBARREDITOR')) // REPLACEMENT OF LINKS When page called from Dolibarr editor (this case should not happen)
{
// We remove the part of content
if ($contenttype == 'html')
@@ -296,7 +296,7 @@ function dolWebsiteOutput($content, $contenttype = 'html', $containerid = '')
if (empty($includehtmlcontentopened)) {
$content = str_replace('!~!~!~', '', $content);
}
- } else // REPLACEMENT OF LINKS When page called from virtual host
+ } else // REPLACEMENT OF LINKS When page called from virtual host web server
{
$symlinktomediaexists = 1;
if ($website->virtualhost) {
@@ -355,7 +355,7 @@ function dolWebsiteOutput($content, $contenttype = 'html', $containerid = '')
}
}
- $content = str_replace(' contenteditable="true"', ' contenteditable="false"', $content);
+ //$content = str_replace(' contenteditable="true"', ' contenteditable="false"', $content);
if (!empty($conf->global->WEBSITE_ADD_CSS_TO_BODY)) {
$content = str_replace('id;
$sql .= " AND p.entity IN (".getEntity('supplier_proposal').")";
diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
index 1e169632a85..8fa464adb92 100644
--- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
+++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
@@ -174,5 +174,10 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private,
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailAttendes', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendes)__', '__(Hello)__ __THIRDPARTY_NAME__,
__(ThisIsContentOfYourOragnisationEventBulkMailToAttendes)__
__(Sincerely)__
__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,
__(ThisIsContentOfYourOragnisationEventBulkMailToSpeakers)__
__(Sincerely)__
__USER_SIGNATURE__', null, '1', null);
+
-- Code enhanced - Standardize field name
ALTER TABLE llx_commande CHANGE COLUMN tva total_tva double(24,8) default 0;
+ALTER TABLE llx_supplier_proposal CHANGE COLUMN tva total_tva double(24,8) default 0;
+ALTER TABLE llx_supplier_proposal CHANGE COLUMN total total_ttc double(24,8) default 0;
+ALTER TABLE llx_propal CHANGE COLUMN tva total_tva double(24,8) default 0;
+
diff --git a/htdocs/install/mysql/tables/llx_propal.sql b/htdocs/install/mysql/tables/llx_propal.sql
index 6e3e38dffd6..0a348c6aa6c 100644
--- a/htdocs/install/mysql/tables/llx_propal.sql
+++ b/htdocs/install/mysql/tables/llx_propal.sql
@@ -48,7 +48,7 @@ create table llx_propal
remise_absolue real DEFAULT 0, -- remise globale absolue (obsolete)
remise real DEFAULT 0, -- remise calculee (obsolete)
total_ht double(24,8) DEFAULT 0, -- montant total ht apres remise globale
- tva double(24,8) DEFAULT 0, -- montant total tva apres remise globale
+ total_tva double(24,8) DEFAULT 0, -- montant total tva apres remise globale
localtax1 double(24,8) DEFAULT 0, -- amount total localtax1
localtax2 double(24,8) DEFAULT 0, -- amount total localtax2
total double(24,8) DEFAULT 0, -- montant total ttc apres remise globale
@@ -76,9 +76,9 @@ create table llx_propal
fk_delivery_address integer, -- delivery address (deprecated)
fk_multicurrency integer,
- multicurrency_code varchar(255),
+ multicurrency_code varchar(255),
multicurrency_tx double(24,8) DEFAULT 1,
- multicurrency_total_ht double(24,8) DEFAULT 0,
+ multicurrency_total_ht double(24,8) DEFAULT 0,
multicurrency_total_tva double(24,8) DEFAULT 0,
multicurrency_total_ttc double(24,8) DEFAULT 0
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_supplier_proposal.sql b/htdocs/install/mysql/tables/llx_supplier_proposal.sql
index e63c4ff64c7..cf64d76d7d1 100644
--- a/htdocs/install/mysql/tables/llx_supplier_proposal.sql
+++ b/htdocs/install/mysql/tables/llx_supplier_proposal.sql
@@ -37,10 +37,10 @@ CREATE TABLE llx_supplier_proposal (
remise_absolue double DEFAULT 0,
remise double DEFAULT 0,
total_ht double(24,8) DEFAULT 0,
- tva double(24,8) DEFAULT 0,
+ total_tva double(24,8) DEFAULT 0,
localtax1 double(24,8) DEFAULT 0,
localtax2 double(24,8) DEFAULT 0,
- total double(24,8) DEFAULT 0,
+ total_ttc double(24,8) DEFAULT 0,
fk_account integer DEFAULT NULL,
fk_currency varchar(3) DEFAULT NULL,
fk_cond_reglement integer DEFAULT NULL,
diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs_by_url.php
similarity index 100%
rename from htdocs/public/cron/cron_run_jobs.php
rename to htdocs/public/cron/cron_run_jobs_by_url.php
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index 405c34734f3..c56fac31a3f 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -906,8 +906,8 @@ class SupplierProposal extends CommonObject
$sql .= ", remise";
$sql .= ", remise_percent";
$sql .= ", remise_absolue";
- $sql .= ", tva";
- $sql .= ", total";
+ $sql .= ", total_tva";
+ $sql .= ", total_ttc";
$sql .= ", datec";
$sql .= ", ref";
$sql .= ", fk_user_author";
@@ -1200,7 +1200,7 @@ class SupplierProposal extends CommonObject
global $conf;
$sql = "SELECT p.rowid, p.entity, p.ref, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc";
- $sql .= ", p.total, p.tva, p.localtax1, p.localtax2, p.total_ht";
+ $sql .= ", p.total_ttc, p.total_tva, p.localtax1, p.localtax2, p.total_ht";
$sql .= ", p.datec";
$sql .= ", p.date_valid as datev";
$sql .= ", p.date_livraison as delivery_date";
@@ -1239,12 +1239,11 @@ class SupplierProposal extends CommonObject
$this->remise = $obj->remise;
$this->remise_percent = $obj->remise_percent;
$this->remise_absolue = $obj->remise_absolue;
- $this->total = $obj->total; // TODO deprecated
$this->total_ht = $obj->total_ht;
- $this->total_tva = $obj->tva;
+ $this->total_tva = $obj->total_tva;
$this->total_localtax1 = $obj->localtax1;
$this->total_localtax2 = $obj->localtax2;
- $this->total_ttc = $obj->total;
+ $this->total_ttc = $obj->total_ttc;
$this->socid = $obj->fk_soc;
$this->fk_project = $obj->fk_project;
$this->model_pdf = $obj->model_pdf;
@@ -2784,7 +2783,7 @@ class SupplierProposalLine extends CommonObjectLine
// Bit 0: 0 si TVA normal - 1 si TVA NPR
// Bit 1: 0 ligne normale - 1 si ligne de remise fixe
- public $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne
+ public $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne
public $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne
public $total_ttc; // Total TTC de la ligne toute quantite et incluant la remise ligne
diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php
index 476c2a14db2..fd3dccce0bb 100644
--- a/htdocs/supplier_proposal/index.php
+++ b/htdocs/supplier_proposal/index.php
@@ -304,7 +304,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
$now = dol_now();
- $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, p.rowid as supplier_proposalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datec as dp";
+ $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, p.rowid as supplier_proposalid, p.total_ttc, p.total_tva, p.total_ht, p.ref, p.fk_statut, p.datec as dp";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= ", ".MAIN_DB_PREFIX."supplier_proposal as p";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php
index 9826c2a409d..04bafe19297 100644
--- a/htdocs/supplier_proposal/list.php
+++ b/htdocs/supplier_proposal/list.php
@@ -152,7 +152,7 @@ $arrayfields = array(
'sp.date_valid'=>array('label'=>$langs->trans("Date"), 'checked'=>1),
'sp.date_livraison'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1),
'sp.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
- 'sp.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0),
+ 'sp.total_tva'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0),
'sp.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0),
'sp.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
'sp.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
@@ -253,7 +253,7 @@ if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DI
$sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
$sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
-$sql .= ' sp.rowid, sp.note_private, sp.total_ht, sp.tva as total_vat, sp.total as total_ttc, sp.localtax1, sp.localtax2, sp.ref, sp.fk_statut as status, sp.fk_user_author, sp.date_valid, sp.date_livraison as dp,';
+$sql .= ' sp.rowid, sp.note_private, sp.total_ht, sp.total_tva, sp.total_ttc, sp.localtax1, sp.localtax2, sp.ref, sp.fk_statut as status, sp.fk_user_author, sp.date_valid, sp.date_livraison as dp,';
$sql .= ' sp.fk_multicurrency, sp.multicurrency_code, sp.multicurrency_tx, sp.multicurrency_total_ht, sp.multicurrency_total_tva as multicurrency_total_vat, sp.multicurrency_total_ttc,';
$sql .= ' sp.datec as date_creation, sp.tms as date_update,';
$sql .= " p.rowid as project_id, p.ref as project_ref,";
@@ -299,8 +299,8 @@ if ($search_ref) $sql .= natural_search('sp.ref', $search_ref);
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
if ($search_login) $sql .= natural_search('u.login', $search_login);
if ($search_montant_ht) $sql .= natural_search('sp.total_ht=', $search_montant_ht, 1);
-if ($search_montant_vat != '') $sql .= natural_search("sp.tva", $search_montant_vat, 1);
-if ($search_montant_ttc != '') $sql .= natural_search("sp.total", $search_montant_ttc, 1);
+if ($search_montant_vat != '') $sql .= natural_search("sp.total_tva", $search_montant_vat, 1);
+if ($search_montant_ttc != '') $sql .= natural_search("sp.total_ttc", $search_montant_ttc, 1);
if ($search_multicurrency_code != '') $sql .= ' AND sp.multicurrency_code = "'.$db->escape($search_multicurrency_code).'"';
if ($search_multicurrency_tx != '') $sql .= natural_search('sp.multicurrency_tx', $search_multicurrency_tx, 1);
if ($search_multicurrency_montant_ht != '') $sql .= natural_search('sp.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
@@ -552,7 +552,7 @@ if ($resql)
print '';
print '';
}
- if (!empty($arrayfields['sp.total_vat']['checked']))
+ if (!empty($arrayfields['sp.total_tva']['checked']))
{
// Amount
print '';
@@ -653,7 +653,7 @@ if ($resql)
if (!empty($arrayfields['sp.date_valid']['checked'])) print_liste_field_titre($arrayfields['sp.date_valid']['label'], $_SERVER["PHP_SELF"], 'sp.date_valid', '', $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['sp.date_livraison']['checked'])) print_liste_field_titre($arrayfields['sp.date_livraison']['label'], $_SERVER["PHP_SELF"], 'sp.date_livraison', '', $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['sp.total_ht']['checked'])) print_liste_field_titre($arrayfields['sp.total_ht']['label'], $_SERVER["PHP_SELF"], 'sp.total_ht', '', $param, '', $sortfield, $sortorder, 'right ');
- if (!empty($arrayfields['sp.total_vat']['checked'])) print_liste_field_titre($arrayfields['sp.total_vat']['label'], $_SERVER["PHP_SELF"], 'sp.total_vat', '', $param, '', $sortfield, $sortorder, 'right ');
+ if (!empty($arrayfields['sp.total_tva']['checked'])) print_liste_field_titre($arrayfields['sp.total_tva']['label'], $_SERVER["PHP_SELF"], 'sp.total_tva', '', $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['sp.total_ttc']['checked'])) print_liste_field_titre($arrayfields['sp.total_ttc']['label'], $_SERVER["PHP_SELF"], 'sp.total_ttc', '', $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['sp.multicurrency_code']['checked'])) print_liste_field_titre($arrayfields['sp.multicurrency_code']['label'], $_SERVER['PHP_SELF'], 'sp.multicurrency_code', '', $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['sp.multicurrency_tx']['checked'])) print_liste_field_titre($arrayfields['sp.multicurrency_tx']['label'], $_SERVER['PHP_SELF'], 'sp.multicurrency_tx', '', $param, '', $sortfield, $sortorder);
@@ -803,12 +803,12 @@ if ($resql)
$totalarray['val']['sp.total_ht'] += $obj->total_ht;
}
// Amount VAT
- if (!empty($arrayfields['sp.total_vat']['checked']))
+ if (!empty($arrayfields['sp.total_tva']['checked']))
{
- print ' | '.price($obj->total_vat)." | \n";
+ print ''.price($obj->total_tva)." | \n";
if (!$i) $totalarray['nbfield']++;
- if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'sp.total_vat';
- $totalarray['val']['sp.total_vat'] += $obj->total_vat;
+ if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'sp.total_tva';
+ $totalarray['val']['sp.total_tva'] += $obj->total_tva;
}
// Amount TTC
if (!empty($arrayfields['sp.total_ttc']['checked']))
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index d2c8ffdbcc4..326aac90390 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -3503,6 +3503,7 @@ table.hidepaginationnext .paginationnext {
}
+
/* Set the color for hover lines */
.oddeven:hover, .evenodd:hover, .impair:hover, .pair:hover
{
@@ -4632,6 +4633,10 @@ span.websitebuttonsitepreviewdisabled img, a.websitebuttonsitepreviewdisabled im
line-height: 1em;
}
+#divbodywebsite section p {
+ margin: unset;
+}
+
/* ============================================================================== */
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 186f2e2dfb3..81407987c35 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -4509,6 +4509,10 @@ span.websitebuttonsitepreviewdisabled img, a.websitebuttonsitepreviewdisabled im
line-height: 1em;
}
+#divbodywebsite section p {
+ margin: unset;
+}
+
/* ============================================================================== */
/* Module agenda */
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index ca038935af9..46dfd49ed0a 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -358,7 +358,7 @@ if ($action == 'seteditinline')
{
dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 1);
setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'warnings');
- dolibarr_set_const($db, 'WEBSITE_SUBCONTAINERSINLINE', 0); // Force disable of 'Include dynamic content'
+ //dolibarr_set_const($db, 'WEBSITE_SUBCONTAINERSINLINE', 0); // Force disable of 'Include dynamic content'
header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('pageid', 'int'));
exit;
}
@@ -371,7 +371,7 @@ if ($action == 'unseteditinline')
if ($action == 'setshowsubcontainers')
{
dolibarr_set_const($db, 'WEBSITE_SUBCONTAINERSINLINE', 1);
- dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 0); // Force disable of edit inline
+ //dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 0); // Force disable of edit inline
header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('pageid', 'int'));
exit;
}
@@ -2743,7 +2743,19 @@ if (!GETPOST('hide_websitemenu'))
print ''."\n";
print '';
- print '
';
+
+ print '
'; // Button include dynamic contant
+ print $langs->trans("ShowSubcontainers");
+ if (empty($conf->global->WEBSITE_SUBCONTAINERSINLINE))
+ {
+ print '
ref.'&pageid='.$websitepage->id.'&action=setshowsubcontainers&token='.newToken().'">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', false, 0, 0, '', 'nomarginleft').'';
+ }
+ else {
+ print '
ref.'&pageid='.$websitepage->id.'&action=unsetshowsubcontainers&token='.newToken().'">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("On")), 'switch_on', '', false, 0, 0, '', 'nomarginleft').'';
+ }
+ print '
';
+
+ print '
'; // Button edit inline
print ''."\n";
print ''."\n";
@@ -2812,17 +2824,7 @@ if (!GETPOST('hide_websitemenu'))
}
print '
';
- print '
';
- print $langs->trans("ShowSubcontainers");
- if (empty($conf->global->WEBSITE_SUBCONTAINERSINLINE))
- {
- print '
ref.'&pageid='.$websitepage->id.'&action=setshowsubcontainers&token='.newToken().'">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', false, 0, 0, '', 'nomarginleft').'';
- }
- else {
- print '
ref.'&pageid='.$websitepage->id.'&action=unsetshowsubcontainers&token='.newToken().'">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("On")), 'switch_on', '', false, 0, 0, '', 'nomarginleft').'';
- }
- /*}*/
- print '
';
+
print '
';
// Set page as homepage
@@ -4275,7 +4277,7 @@ if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpa
// REPLACEMENT OF LINKS When page called by website editor
$out .= ''."\n";
- $out .= '