';
// List of directories area
$texte .= '';
@@ -161,10 +160,25 @@ class doc_generic_contract_odt extends ModelePDFContract
$texte .= ' ';
// Scan directories
- if (count($listofdir)) {
- $texte .= $langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).' ';
+ $nbofiles = count($listoffiles);
+ if (!empty($conf->global->CONTRACT_ADDON_PDF_ODT_PATH)) {
+ $texte .= $langs->trans("NumberOfModelFilesFound").': ';
+ //$texte.=$nbofiles?'':'';
+ $texte .= count($listoffiles);
+ //$texte.=$nbofiles?' ':'';
+ $texte .= ' ';
}
+ if ($nbofiles) {
+ $texte .= '';
+ }
// Add input to upload a new template file.
$texte .= ''.$langs->trans("UploadNewTemplate");
$maxfilesizearray = getMaxFileSizeArray();
@@ -228,7 +242,7 @@ class doc_generic_contract_odt extends ModelePDFContract
$sav_charset_output = $outputlangs->charset_output;
$outputlangs->charset_output = 'UTF-8';
- // Load traductions files required by page
+ // Load translation files required by page
$outputlangs->loadLangs(array("main", "dict", "companies", "bills"));
if ($conf->contrat->multidir_output[$object->entity]) {
@@ -382,16 +396,21 @@ class doc_generic_contract_odt extends ModelePDFContract
dol_syslog($e->getMessage(), LOG_INFO);
}
+ // Call the ODTSubstitution hook
+ $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
+ $reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
+
foreach ($tmparray as $key => $value) {
try {
- if (preg_match('/logo$/', $key)) { // Image
+ if (preg_match('/logo$/', $key)) {
+ // Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
- } else // Text
- {
+ } else {
+ // Text
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
} catch (OdfException $e) {
@@ -448,7 +467,7 @@ class doc_generic_contract_odt extends ModelePDFContract
}
// Call the beforeODTSave hook
- $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
+ $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@@ -457,6 +476,7 @@ class doc_generic_contract_odt extends ModelePDFContract
$odfHandler->exportAsAttachedPDF($file);
} catch (Exception $e) {
$this->error = $e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
} else {
@@ -464,10 +484,12 @@ class doc_generic_contract_odt extends ModelePDFContract
$odfHandler->saveToDisk($file);
} catch (Exception $e) {
$this->error = $e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
+ $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if (!empty($conf->global->MAIN_UMASK)) {
diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php
index 792c8434ba4..d859ae0ca56 100644
--- a/htdocs/core/modules/dons/html_cerfafr.modules.php
+++ b/htdocs/core/modules/dons/html_cerfafr.modules.php
@@ -120,18 +120,18 @@ class html_cerfafr extends ModeleDon
// This is not the proper way to do it but $formclass->form_modes_reglement
// prints the translation instead of returning it
- if ($don->modepaiementid) {
- $formclass->load_cache_types_paiements();
- $paymentmode = $formclass->cache_types_paiements[$don->modepaiementid]['label'];
+ $formclass->load_cache_types_paiements();
+ if ($don->modepaymentid) {
+ $paymentmode = $formclass->cache_types_paiements[$don->modepaymentid]['label'];
} else {
$paymentmode = '';
}
-
- if ($don->modepaymentcode == 'CHQ') {
+ $modepaymentcode = !empty($formclass->cache_types_paiements[$don->modepaymentid]['code']) ? $formclass->cache_types_paiements[$don->modepaymentid]['code'] : "";
+ if ($modepaymentcode == 'CHQ') {
$ModePaiement = '
Remise d\'espèces Chèque Virement, prélèvement, carte bancaire';
- } elseif ($don->modepaymentcode == 'LIQ') {
+ } elseif ($modepaymentcode == 'LIQ') {
$ModePaiement = '
Remise d\'espèces Chèque Virement, prélèvement, carte bancaire';
- } elseif ($don->modepaymentcode == 'VIR' || $don->modepaymentcode == 'PRE' || $don->modepaymentcode == 'CB') {
+ } elseif ($modepaymentcode == 'VIR' || $modepaymentcode == 'PRE' || $modepaymentcode == 'CB') {
$ModePaiement = '
Remise d\'espèces Chèque Virement, prélèvement, carte bancaire';
} else {
$ModePaiement = '
Remise d\'espèces Chèque Virement, prélèvement, carte bancaire';
diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
index cfb23269ca9..73793c5a757 100644
--- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
+++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
@@ -175,7 +175,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
$texte .= '
';
}
diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index 061f18e5442..0b8fa2d4621 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -174,7 +174,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$texte .= '
';
}
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index 39d833de6cc..ee4cc9b5d0d 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -9,6 +9,7 @@
* Copyright (C) 2015 Marcos García
* Copyright (C) 2017-2018 Ferran Marcet
* Copyright (C) 2018-2020 Frédéric France
+ * Copyright (C) 2022 Anthony Berton
*
* 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
@@ -579,7 +580,8 @@ class pdf_crabe extends ModelePDFFactures
$pdf->useTemplate($tplidx);
}
if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
- $this->_pagehead($pdf, $object, 0, $outputlangs);
+ $top_shift = $this->_pagehead($pdf, $object, 0, $outputlangs);
+ $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
}
$pdf->setPage($pageposbefore + 1);
@@ -622,7 +624,8 @@ class pdf_crabe extends ModelePDFFactures
$pdf->useTemplate($tplidx);
}
if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
- $this->_pagehead($pdf, $object, 0, $outputlangs);
+ $top_shift = $this->_pagehead($pdf, $object, 0, $outputlangs);
+ $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
}
$pdf->setPage($pageposafter + 1);
}
@@ -749,10 +752,18 @@ class pdf_crabe extends ModelePDFFactures
// retrieve global local tax
if ($localtax1_type && $localtax1ligne != 0) {
- $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne;
+ if (empty($this->localtax1[$localtax1_type][$localtax1_rate])) {
+ $this->localtax1[$localtax1_type][$localtax1_rate] = $localtax1ligne;
+ } else {
+ $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne;
+ }
}
if ($localtax2_type && $localtax2ligne != 0) {
- $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne;
+ if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) {
+ $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne;
+ } else {
+ $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne;
+ }
}
if (($object->lines[$i]->info_bits & 0x01) == 0x01) {
@@ -798,7 +809,8 @@ class pdf_crabe extends ModelePDFFactures
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
- $this->_pagehead($pdf, $object, 0, $outputlangs);
+ $top_shift = $this->_pagehead($pdf, $object, 0, $outputlangs);
+ $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
}
if (!empty($tplidx)) {
$pdf->useTemplate($tplidx);
@@ -818,7 +830,8 @@ class pdf_crabe extends ModelePDFFactures
}
$pagenb++;
if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
- $this->_pagehead($pdf, $object, 0, $outputlangs);
+ $top_shift = $this->_pagehead($pdf, $object, 0, $outputlangs);
+ $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
}
}
}
@@ -943,7 +956,8 @@ class pdf_crabe extends ModelePDFFactures
$pdf->useTemplate($tplidx);
}
if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
- $this->_pagehead($pdf, $object, 0, $outputlangs);
+ $top_shift = $this->_pagehead($pdf, $object, 0, $outputlangs);
+ $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
}
$pdf->setPage($current_page);
$this->_tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top + $y - 3, $tab3_width, $tab3_height);
@@ -1005,7 +1019,8 @@ class pdf_crabe extends ModelePDFFactures
$pdf->useTemplate($tplidx);
}
if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
- $this->_pagehead($pdf, $object, 0, $outputlangs);
+ $top_shift = $this->_pagehead($pdf, $object, 0, $outputlangs);
+ $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
}
$pdf->setPage($current_page);
$this->_tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top + $y - 3, $tab3_width, $tab3_height);
@@ -1180,7 +1195,7 @@ class pdf_crabe extends ModelePDFFactures
// Decret n°2099-1299 2022-10-07
// French mention : "Option pour le paiement de la taxe d'après les débits"
if ($this->emetteur->country_code == 'FR') {
- if ($conf->global->TAX_MODE == 1) {
+ if (isset($conf->global->TAX_MODE) && $conf->global->TAX_MODE == 1) {
$pdf->SetXY($this->marge_gauche, $posy);
$pdf->writeHTMLCell(80, 5, '', '', $outputlangs->transnoentities("MentionVATDebitOptionIsOn"), 0, 1);
@@ -2056,6 +2071,43 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->SetXY($posx + 2, $posy);
$pdf->MultiCell($widthrecbox - 2, 4, $carac_client, 0, $ltrdirection);
+
+ // Show shipping address
+ if (getDolGlobalInt('INVOICE_SHOW_SHIPPING_ADDRESS')) {
+ $idaddressshipping = $object->getIdContact('external', 'SHIPPING');
+
+ if (!empty($idaddressshipping)) {
+ $contactshipping = $object->fetch_Contact($idaddressshipping[0]);
+ $object->fetch_thirdparty($object->contact->fk_soc);
+ $carac_client_name_shipping=pdfBuildThirdpartyName($object->contact, $outputlangs);
+ $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, $object->contact, $usecontact, 'target', $object);
+ } else {
+ $carac_client_name_shipping=pdfBuildThirdpartyName($object->thirdparty, $outputlangs);
+ $carac_client_shipping=pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'target', $object);;
+ }
+ if (!empty($carac_client_shipping) && (isset($object->contact->socid) && $object->contact->socid != $object->socid)) {
+ $posy += $hautcadre;
+
+ // Show shipping frame
+ $pdf->SetXY($posx + 2, $posy - 5);
+ $pdf->SetFont('', '', $default_font_size - 2);
+ $pdf->MultiCell($widthrecbox, '', $langs->trans('ShippingTo'), 0, 'L', 0);
+ $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
+
+ // Show shipping name
+ $pdf->SetXY($posx + 2, $posy + 3);
+ $pdf->SetFont('', 'B', $default_font_size);
+ $pdf->MultiCell($widthrecbox - 2, 2, $carac_client_name_shipping, '', 'L');
+
+ $posy = $pdf->getY();
+
+ // Show shipping information
+ $pdf->SetXY($posx+2, $posy);
+ $pdf->SetFont('', '', $default_font_size - 1);
+ $pdf->MultiCell($widthrecbox - 2, 2, $carac_client_shipping, '', 'L');
+ $top_shift += $hautcadre;
+ }
+ }
}
$pdf->SetTextColor(0, 0, 0);
diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
index e11cd90bc43..c3a4318a218 100644
--- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
@@ -9,6 +9,7 @@
* Copyright (C) 2015 Marcos García
* Copyright (C) 2017 Ferran Marcet
* Copyright (C) 2018 Frédéric France
+ * Copyright (C) 2022 Anthony Berton
*
* 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
@@ -448,7 +449,9 @@ class pdf_sponge extends ModelePDFFactures
$pagenb++;
// Output header (logo, ref and address blocks). This is first call for first page.
- $top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs, $outputlangsbis);
+ $pagehead = $this->_pagehead($pdf, $object, 1, $outputlangs, $outputlangsbis);
+ $top_shift = $pagehead['top_shift'];
+ $shipp_shift = $pagehead['shipp_shift'];
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0, 0, 0);
@@ -456,7 +459,7 @@ class pdf_sponge extends ModelePDFFactures
// $pdf->GetY() here can't be used. It is bottom of the second addresse box but first one may be higher
// $this->tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks)
- $this->tab_top = 90 + $top_shift; // top_shift is an addition for linked objects or addons (0 in most cases)
+ $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases)
$this->tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
// You can add more thing under header here, if you increase $extra_under_address_shift too.
@@ -1290,7 +1293,7 @@ class pdf_sponge extends ModelePDFFactures
// Decret n°2099-1299 2022-10-07
// French mention : "Option pour le paiement de la taxe d'après les débits"
if ($this->emetteur->country_code == 'FR') {
- if ($conf->global->TAX_MODE == 1) {
+ if (isset($conf->global->TAX_MODE) && $conf->global->TAX_MODE == 1) {
$pdf->SetXY($this->marge_gauche, $posy);
$pdf->writeHTMLCell(80, 5, '', '', $outputlangs->transnoentities("MentionVATDebitOptionIsOn"), 0, 1);
@@ -2222,6 +2225,7 @@ class pdf_sponge extends ModelePDFFactures
$posy += 1;
$top_shift = 0;
+ $shipp_shift = 0;
// Show list of linked objects
$current_y = $pdf->getY();
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, $w, 3, 'R', $default_font_size);
@@ -2244,7 +2248,6 @@ class pdf_sponge extends ModelePDFFactures
$hautcadre = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 38 : 40;
$widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 82;
-
// Show sender frame
if (empty($conf->global->MAIN_PDF_NO_SENDER_FRAME)) {
$pdf->SetTextColor(0, 0, 0);
@@ -2322,10 +2325,49 @@ class pdf_sponge extends ModelePDFFactures
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->SetXY($posx + 2, $posy);
$pdf->MultiCell($widthrecbox - 2, 4, $carac_client, 0, $ltrdirection);
+
+ // Show shipping address
+ if (getDolGlobalInt('INVOICE_SHOW_SHIPPING_ADDRESS')) {
+ $idaddressshipping = $object->getIdContact('external', 'SHIPPING');
+
+ if (!empty($idaddressshipping)) {
+ $contactshipping = $object->fetch_Contact($idaddressshipping[0]);
+ $object->fetch_thirdparty($object->contact->fk_soc);
+ $carac_client_name_shipping=pdfBuildThirdpartyName($object->contact, $outputlangs);
+ $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, $object->contact, $usecontact, 'target', $object);
+ } else {
+ $carac_client_name_shipping=pdfBuildThirdpartyName($object->thirdparty, $outputlangs);
+ $carac_client_shipping=pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'target', $object);;
+ }
+ if (!empty($carac_client_shipping) && (isset($object->contact->socid) && $object->contact->socid != $object->socid)) {
+ $posy += $hautcadre;
+
+ // Show shipping frame
+ $pdf->SetXY($posx + 2, $posy - 5);
+ $pdf->SetFont('', '', $default_font_size - 2);
+ $pdf->MultiCell($widthrecbox, '', $langs->trans('ShippingTo'), 0, 'L', 0);
+ $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
+
+ // Show shipping name
+ $pdf->SetXY($posx + 2, $posy + 3);
+ $pdf->SetFont('', 'B', $default_font_size);
+ $pdf->MultiCell($widthrecbox - 2, 2, $carac_client_name_shipping, '', 'L');
+
+ $posy = $pdf->getY();
+
+ // Show shipping information
+ $pdf->SetXY($posx+2, $posy);
+ $pdf->SetFont('', '', $default_font_size - 1);
+ $pdf->MultiCell($widthrecbox - 2, 2, $carac_client_shipping, '', 'L');
+ $shipp_shift += $hautcadre;
+ }
+ }
}
$pdf->SetTextColor(0, 0, 0);
- return $top_shift;
+
+ $pagehead = array('top_shift' => $top_shift, 'shipp_shift' => $shipp_shift);
+ return $pagehead;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php
index 7a572615a21..321741ea8a0 100644
--- a/htdocs/core/modules/facture/mod_facture_mercure.php
+++ b/htdocs/core/modules/facture/mod_facture_mercure.php
@@ -1,9 +1,10 @@
- * Copyright (C) 2004-2011 Laurent Destailleur
- * Copyright (C) 2005-2007 Regis Houssin
- * Copyright (C) 2008 Raphael Bertrand (Resultic)
- * Copyright (C) 2013 Juanjo Menent
+/* Copyright (C) 2003-2007 Rodolphe Quiedeville
+ * Copyright (C) 2004-2011 Laurent Destailleur
+ * Copyright (C) 2005-2007 Regis Houssin
+ * Copyright (C) 2008 Raphael Bertrand (Resultic)
+ * Copyright (C) 2013 uanjo Menent
+ * Copyright (C) 2022 Anthony Berton
*
* 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
@@ -143,16 +144,28 @@ class mod_facture_mercure extends ModeleNumRefFactures
// Get Mask value
$mask = '';
if (is_object($invoice) && $invoice->type == 1) {
- $mask = $conf->global->FACTURE_MERCURE_MASK_REPLACEMENT;
+ if (isset($conf->global->FACTURE_MERCURE_MASK_REPLACEMENT)) {
+ $mask = $conf->global->FACTURE_MERCURE_MASK_REPLACEMENT;
+ }
if (!$mask) {
- $mask = $conf->global->FACTURE_MERCURE_MASK_INVOICE;
+ if (isset($conf->global->FACTURE_MERCURE_MASK_INVOICE)) {
+ $mask = $conf->global->FACTURE_MERCURE_MASK_INVOICE;
+ }
}
} elseif (is_object($invoice) && $invoice->type == 2) {
- $mask = $conf->global->FACTURE_MERCURE_MASK_CREDIT;
+ if (isset($conf->global->FACTURE_MERCURE_MASK_CREDIT)) {
+ $mask = $conf->global->FACTURE_MERCURE_MASK_CREDIT;
+ }
} elseif (is_object($invoice) && $invoice->type == 3) {
- $mask = $conf->global->FACTURE_MERCURE_MASK_DEPOSIT;
+ if (isset($conf->global->FACTURE_MERCURE_MASK_DEPOSIT)) {
+ $mask = $conf->global->FACTURE_MERCURE_MASK_DEPOSIT;
+ }
} else {
- $mask = $conf->global->FACTURE_MERCURE_MASK_INVOICE;
+ if (isset($conf->global->FACTURE_MERCURE_MASK_INVOICE)) {
+ $mask = $conf->global->FACTURE_MERCURE_MASK_INVOICE;
+ } else {
+ $mask = '';
+ }
}
if (!$mask) {
$this->error = 'NotConfigured';
diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php
index 09f93a436ea..22c12024c2b 100644
--- a/htdocs/core/modules/import/import_csv.modules.php
+++ b/htdocs/core/modules/import/import_csv.modules.php
@@ -862,8 +862,8 @@ class ImportCsv extends ModeleImports
$stringtosearch = json_encode($socialnetwork).':'.json_encode($json->$socialnetwork);
//var_dump($stringtosearch);
//var_dump($this->db->escape($stringtosearch)); // This provide a value for sql string (but not for a like)
- $where[] = $key." LIKE '%".$this->db->escapeforlike($this->db->escape($stringtosearch))."%'";
- $filters[] = $col." LIKE '%".$this->db->escapeforlike($this->db->escape($stringtosearch))."%'";
+ $where[] = $key." LIKE '%".$this->db->escape($this->db->escapeforlike($stringtosearch))."%'";
+ $filters[] = $col." LIKE '%".$this->db->escape($this->db->escapeforlike($stringtosearch))."%'";
//var_dump($where[1]); // This provide a value for sql string inside a like
} else {
$where[] = $key.' = '.$data[$key];
diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php
index ecf7d8b4a77..35adc4476a0 100644
--- a/htdocs/core/modules/import/import_xlsx.modules.php
+++ b/htdocs/core/modules/import/import_xlsx.modules.php
@@ -908,8 +908,8 @@ class ImportXlsx extends ModeleImports
$stringtosearch = json_encode($socialnetwork).':'.json_encode($json->$socialnetwork);
//var_dump($stringtosearch);
//var_dump($this->db->escape($stringtosearch)); // This provide a value for sql string (but not for a like)
- $where[] = $key." LIKE '%".$this->db->escapeforlike($this->db->escape($stringtosearch))."%'";
- $filters[] = $col." LIKE '%".$this->db->escapeforlike($this->db->escape($stringtosearch))."%'";
+ $where[] = $key." LIKE '%".$this->db->escape($this->db->escapeforlike($stringtosearch))."%'";
+ $filters[] = $col." LIKE '%".$this->db->escape($this->db->escapeforlike($stringtosearch))."%'";
//var_dump($where[1]); // This provide a value for sql string inside a like
} else {
$where[] = $key.' = '.$data[$key];
diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php
index 688db8b8e7f..7649c255d04 100644
--- a/htdocs/core/modules/mailings/advthirdparties.modules.php
+++ b/htdocs/core/modules/mailings/advthirdparties.modules.php
@@ -42,7 +42,7 @@ class mailing_advthirdparties extends MailingTargets
*/
public $db;
- public $enabled = '$conf->societe->enabled';
+ public $enabled = 'isModEnabled("societe")';
/**
diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php
index decbc81716b..64097078147 100644
--- a/htdocs/core/modules/mailings/contacts1.modules.php
+++ b/htdocs/core/modules/mailings/contacts1.modules.php
@@ -38,7 +38,7 @@ class mailing_contacts1 extends MailingTargets
public $require_module = array("societe"); // Module mailing actif si modules require_module actifs
public $require_admin = 0; // Module mailing actif pour user admin ou non
- public $enabled = '$conf->societe->enabled';
+ public $enabled = 'isModEnabled("societe")';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
@@ -388,6 +388,7 @@ class mailing_contacts1 extends MailingTargets
}
$sql .= " WHERE sp.entity IN (".getEntity('contact').")";
$sql .= " AND sp.email <> ''";
+
$sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = sp.email) = 0";
// Exclude unsubscribed email adresses
$sql .= " AND sp.statut = 1";
@@ -409,7 +410,7 @@ class mailing_contacts1 extends MailingTargets
// Filter on language
if ($filter_lang != '') {
- $sql .= " AND sp.default_lang = '".$this->db->escape($filter_lang)."'";
+ $sql .= " AND sp.default_lang LIKE '".$this->db->escape($filter_lang)."%'";
}
// Filter on nature
diff --git a/htdocs/core/modules/mailings/eventorganization.modules.php b/htdocs/core/modules/mailings/eventorganization.modules.php
new file mode 100644
index 00000000000..84c27c5f673
--- /dev/null
+++ b/htdocs/core/modules/mailings/eventorganization.modules.php
@@ -0,0 +1,212 @@
+
+ * Copyright (C) 2005-2010 Laurent Destailleur
+ * Copyright (C) 2005-2009 Regis Houssin
+ *
+ * This file is an example to follow to add your own email selector inside
+ * the Dolibarr email tool.
+ * Follow instructions given in README file to know what to change to build
+ * your own emailing list selector.
+ * Code that need to be changed in this file are marked by "CHANGE THIS" tag.
+ */
+
+/**
+ * \file htdocs/core/modules/mailings/eventorganization.modules.php
+ * \ingroup mailing
+ * \brief Example file to provide a list of recipients for mailing module
+ */
+
+
+// Load Dolibarr Environment
+include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php';
+
+
+/**
+ * Class to manage a list of personalised recipients for mailing feature
+ */
+class mailing_eventorganization extends MailingTargets
+{
+ // This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
+ public $name = 'AttendeesOfOrganizedEvent';
+ public $desc = "Attendees of an organized event";
+
+ public $require_admin = 0;
+
+ public $require_module = array(); // This module allows to select by categories must be also enabled if category module is not activated
+
+ /**
+ * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
+ */
+ public $picto = 'conferenceorbooth';
+
+ /**
+ * @var DoliDB Database handler.
+ */
+ public $db;
+
+ public $enabled = 'isModEnabled("eventorganization")';
+
+
+ /**
+ * Constructor
+ *
+ * @param DoliDB $db Database handler
+ */
+ public function __construct($db)
+ {
+ global $conf, $langs;
+ $langs->load('companies');
+
+ $this->db = $db;
+ }
+
+
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ /**
+ * This is the main function that returns the array of emails
+ *
+ * @param int $mailing_id Id of mailing. No need to use it.
+ * @return int <0 if error, number of emails added if ok
+ */
+ public function add_to_target($mailing_id)
+ {
+ // phpcs:enable
+ global $conf, $langs;
+
+ $cibles = array();
+ $addDescription = '';
+
+ $sql = "SELECT p.ref, p.entity, e.rowid as id, e.fk_project, e.email as email, e.email_company as company_name, e.firstname as firstname, e.lastname as lastname,";
+ $sql .= " 'eventorganizationattendee' as source";
+ $sql .= " FROM ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee as e,";
+ $sql .= " ".MAIN_DB_PREFIX."projet as p";
+ $sql .= " WHERE e.email <> ''";
+ $sql .= " AND e.fk_project = p.rowid";
+ $sql .= " AND p.entity IN (".getEntity('project').")";
+ $sql .= " AND e.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")";
+ $sql .= " AND e.fk_project = ".((int) GETPOST('filter_eventorganization', 'int'));
+ $sql .= " ORDER BY e.email";
+
+ // Stock recipients emails into targets table
+ $result = $this->db->query($sql);
+ if ($result) {
+ $num = $this->db->num_rows($result);
+ $i = 0;
+ $j = 0;
+
+ dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found");
+
+ $old = '';
+ while ($i < $num) {
+ $obj = $this->db->fetch_object($result);
+ if ($old <> $obj->email) {
+ $otherTxt = ($obj->ref ? $langs->transnoentities("Project").'='.$obj->ref : '');
+ if (strlen($addDescription) > 0 && strlen($otherTxt) > 0) {
+ $otherTxt .= ";";
+ }
+ $otherTxt .= $addDescription;
+ $cibles[$j] = array(
+ 'email' => $obj->email,
+ 'fk_project' => $obj->fk_project,
+ 'lastname' => $obj->lastname,
+ 'firstname' => $obj->firstname,
+ 'other' => $otherTxt,
+ 'source_url' => $this->url($obj->id, $obj->source),
+ 'source_id' => $obj->id,
+ 'source_type' => $obj->source
+ );
+ $old = $obj->email;
+ $j++;
+ }
+
+ $i++;
+ }
+ } else {
+ dol_syslog($this->db->error());
+ $this->error = $this->db->error();
+ return -1;
+ }
+
+ return parent::addTargetsToDatabase($mailing_id, $cibles);
+ }
+
+
+ /**
+ * On the main mailing area, there is a box with statistics.
+ * If you want to add a line in this report you must provide an
+ * array of SQL request that returns two field:
+ * One called "label", One called "nb".
+ *
+ * @return array Array with SQL requests
+ */
+ public function getSqlArrayForStats()
+ {
+ // CHANGE THIS: Optionnal
+
+ //var $statssql=array();
+ //$this->statssql[0]="SELECT field1 as label, count(distinct(email)) as nb FROM mytable WHERE email IS NOT NULL";
+ return array();
+ }
+
+
+ /**
+ * Return here number of distinct emails returned by your selector.
+ * For example if this selector is used to extract 500 different
+ * emails from a text file, this function must return 500.
+ *
+ * @param string $sql Requete sql de comptage
+ * @return int|string Nb of recipient, or <0 if error, or '' if NA
+ */
+ public function getNbOfRecipients($sql = '')
+ {
+ global $conf;
+
+ $sql = "SELECT COUNT(DISTINCT(e.email)) as nb";
+ $sql .= " FROM ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee as e, ";
+ $sql .= " ".MAIN_DB_PREFIX."projet as p";
+ $sql .= " WHERE e.email <> ''";
+ $sql .= " AND e.fk_project = p.rowid";
+ $sql .= " AND p.entity IN (".getEntity('project').")";
+
+ //print $sql;
+
+ // La requete doit retourner un champ "nb" pour etre comprise par parent::getNbOfRecipients
+ return parent::getNbOfRecipients($sql);
+ }
+
+ /**
+ * This is to add a form filter to provide variant of selector
+ * If used, the HTML select must be called "filter"
+ *
+ * @return string A html select zone
+ */
+ public function formFilter()
+ {
+ global $conf, $langs;
+
+ $langs->load("companies");
+
+ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
+ $formproject = new FormProjets($this->db);
+ $s .= $formproject->select_projects(-1, 0, "filter_eventorganization", 0, 0, 1, 1, 0, 0, 0, '', 1, 0, '', '', 'usage_organize_event=1');
+
+ return $s;
+ }
+
+
+ /**
+ * Can include an URL link on each record provided by selector shown on target page.
+ *
+ * @param int $id ID
+ * @param string $sourcetype Source type
+ * @return string Url link
+ */
+ public function url($id, $sourcetype = 'thirdparty')
+ {
+ if ($sourcetype == 'project') {
+ return ''.img_object('', "eventorganization").' ';
+ }
+
+ return '';
+ }
+}
diff --git a/htdocs/core/modules/mailings/example.modules.php b/htdocs/core/modules/mailings/example.modules.php
deleted file mode 100644
index 739ab773196..00000000000
--- a/htdocs/core/modules/mailings/example.modules.php
+++ /dev/null
@@ -1,154 +0,0 @@
-
- *
- * This file is an example to follow to add your own email selector inside
- * the Dolibarr email tool.
- * Follow instructions given in README file to know what to change to build
- * your own emailing list selector.
- * Code that need to be changed in this file are marked by "CHANGE THIS" tag.
- */
-
-/**
- * \file htdocs/core/modules/mailings/example.modules.php
- * \ingroup mailing
- * \brief Example file to provide a list of recipients for mailing module
- */
-
-include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php';
-
-
-// CHANGE THIS: Class name must be called mailing_xxx with xxx=name of your selector
-
-/**
- \class mailing_example
- \brief Class to manage a list of personalised recipients for mailing feature
-*/
-class mailing_example extends MailingTargets
-{
- // CHANGE THIS: Put here a name not already used
- public $name = 'example';
- // CHANGE THIS: Put here a description of your selector module.
- // This label is used if no translation is found for key MailingModuleDescXXX where XXX=name is found
- public $desc = 'Put here a description';
- // CHANGE THIS: Set to 1 if selector is available for admin users only
- public $require_admin = 0;
- // CHANGE THIS: Add a tooltip language key to add a tooltip help icon after the email target selector
- public $tooltip = 'MyTooltipLangKey';
-
- public $require_module = array();
-
- /**
- * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
- */
- public $picto = '';
-
- /**
- * @var DoliDB Database handler.
- */
- public $db;
-
-
- // CHANGE THIS: Constructor name must be called mailing_xxx with xxx=name of your selector
- /**
- * Constructor
- *
- * @param DoliDB $db Database handler
- */
- public function __construct($db)
- {
- $this->db = $db;
- }
-
-
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
- /**
- * This is the main function that returns the array of emails
- *
- * @param int $mailing_id Id of mailing. No need to use it.
- * @return int <0 if error, number of emails added if ok
- */
- public function add_to_target($mailing_id)
- {
- // phpcs:enable
- $target = array();
-
- // CHANGE THIS
- // ----- Your code start here -----
-
- // You must fill the $target array with record like this
- // $target[0]=array('email'=>'email_0','name'=>'name_0','firstname'=>'firstname_0', 'other'=>'other_0');
- // ...
- // $target[n]=array('email'=>'email_n','name'=>'name_n','firstname'=>'firstname_n', 'other'=>'other_n');
-
- // Example: $target[0]=array('email'=>'myemail@example.com', 'name'=>'Doe', 'firstname'=>'John', 'other'=>'Other information');
-
- // ----- Your code end here -----
-
- return parent::addTargetsToDatabase($mailing_id, $target);
- }
-
-
- /**
- * On the main mailing area, there is a box with statistics.
- * If you want to add a line in this report you must provide an
- * array of SQL request that returns two field:
- * One called "label", One called "nb".
- *
- * @return array Array with SQL requests
- */
- public function getSqlArrayForStats()
- {
- // CHANGE THIS: Optionnal
-
- //var $statssql=array();
- //$this->statssql[0]="SELECT field1 as label, count(distinct(email)) as nb FROM mytable WHERE email IS NOT NULL";
- return array();
- }
-
-
- /**
- * Return here number of distinct emails returned by your selector.
- * For example if this selector is used to extract 500 different
- * emails from a text file, this function must return 500.
- *
- * @param string $sql Requete sql de comptage
- * @return int|string Nb of recipient, or <0 if error, or '' if NA
- */
- public function getNbOfRecipients($sql = '')
- {
- // CHANGE THIS: Optionnal
-
- // Example: return parent::getNbOfRecipients("SELECT count(*) as nb from dolibarr_table");
- // Example: return 500;
- return '?';
- }
-
- /**
- * This is to add a form filter to provide variant of selector
- * If used, the HTML select must be called "filter"
- *
- * @return string A html select zone
- */
- public function formFilter()
- {
- // CHANGE THIS: Optionnal
-
- $s = '';
- return $s;
- }
-
-
- /**
- * Can include an URL link on each record provided by selector
- * shown on target page.
- *
- * @param int $id ID
- * @return string Url link
- */
- public function url($id)
- {
- // CHANGE THIS: Optionnal
-
- return '';
- }
-}
diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php
index 992539cc303..9fe6a615f5d 100644
--- a/htdocs/core/modules/mailings/fraise.modules.php
+++ b/htdocs/core/modules/mailings/fraise.modules.php
@@ -41,7 +41,7 @@ class mailing_fraise extends MailingTargets
public $require_module = array('adherent');
- public $enabled = '$conf->adherent->enabled';
+ public $enabled = 'isModEnabled("adherent")';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
diff --git a/htdocs/core/modules/mailings/partnership.modules.php b/htdocs/core/modules/mailings/partnership.modules.php
index 8a1fe0f2c16..b4a8e9d8fd9 100644
--- a/htdocs/core/modules/mailings/partnership.modules.php
+++ b/htdocs/core/modules/mailings/partnership.modules.php
@@ -44,7 +44,7 @@ class mailing_partnership extends MailingTargets
*/
public $db;
- public $enabled = '$conf->partnership->enabled';
+ public $enabled = 'isModEnabled("partnership")';
/**
diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php
index 71be0733fb2..2f8040d4b75 100644
--- a/htdocs/core/modules/mailings/thirdparties.modules.php
+++ b/htdocs/core/modules/mailings/thirdparties.modules.php
@@ -31,7 +31,7 @@ class mailing_thirdparties extends MailingTargets
public $require_module = array("societe"); // This module allows to select by categories must be also enabled if category module is not activated
- public $enabled = '$conf->societe->enabled';
+ public $enabled = 'isModEnabled("societe")';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php
index 9083b643900..9fc43e37388 100644
--- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php
+++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php
@@ -29,7 +29,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
public $require_module = array('contrat');
- public $enabled = '$conf->societe->enabled';
+ public $enabled = 'isModEnabled("societe")';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
@@ -219,6 +219,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
$s = '';
if (count($this->arrayofproducts)) {
+ $langs->loadLangs(array("products"));
$s .= ''.$langs->trans("ProductOrService").' ';
} else {
$s .= ''.$langs->trans("ContactsAllShort").' ';
diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
index 2ab951147b9..ed48c93c4de 100644
--- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
+++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
@@ -164,7 +164,9 @@ class doc_generic_member_odt extends ModelePDFMember
$texte .= '';
}
diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php
index a0fb405887e..3a7caa1cb57 100644
--- a/htdocs/core/modules/modAsset.class.php
+++ b/htdocs/core/modules/modAsset.class.php
@@ -63,7 +63,7 @@ class modAsset extends DolibarrModules
$this->descriptionlong = "Asset module to manage assets module and depreciation charge on Dolibarr";
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
- $this->version = 'development';
+ $this->version = 'experimental';
// Key used in llx_const table to save module status enabled/disabled (where ASSETS is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of image file used for this module.
diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php
index 0a07fff6aaf..830f9f0f8b1 100644
--- a/htdocs/core/modules/modBlockedLog.class.php
+++ b/htdocs/core/modules/modBlockedLog.class.php
@@ -183,7 +183,7 @@ class modBlockedLog extends DolibarrModules
$result = $b->setObjectData($object, 'MODULE_SET', 0);
if ($result < 0) {
$this->error = $b->error;
- $this->errors = $b->erros;
+ $this->errors = $b->errors;
return 0;
}
@@ -226,7 +226,7 @@ class modBlockedLog extends DolibarrModules
$result = $b->setObjectData($object, 'MODULE_RESET', 0);
if ($result < 0) {
$this->error = $b->error;
- $this->errors = $b->erros;
+ $this->errors = $b->errors;
return 0;
}
diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php
index 992015fe75e..93b243625f4 100644
--- a/htdocs/core/modules/modCron.class.php
+++ b/htdocs/core/modules/modCron.class.php
@@ -99,7 +99,7 @@ class modCron extends DolibarrModules
// Cronjobs
$this->cronjobs = array(
0=>array('entity'=>0, 'label'=>'PurgeDeleteTemporaryFilesShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'purgeFiles', 'parameters'=>'tempfilesold+logfiles', 'comment'=>'PurgeDeleteTemporaryFiles', 'frequency'=>2, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>50, 'status'=>1, 'test'=>true),
- 1=>array('entity'=>0, 'label'=>'MakeLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'dumpDatabase', 'parameters'=>'none,auto,1,auto,10', 'comment'=>'MakeLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>90, 'status'=>0, 'test'=>'in_array($conf->db->type, array(\'mysql\', \'mysqli\'))'),
+ 1=>array('entity'=>0, 'label'=>'MakeLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'dumpDatabase', 'parameters'=>'none,auto,1,auto,10,0,0', 'comment'=>'MakeLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>90, 'status'=>0, 'test'=>'in_array($conf->db->type, array(\'mysql\', \'mysqli\'))'),
2=>array('entity'=>0, 'label'=>'MakeSendLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'sendBackup', 'parameters'=>',,,,,sql', 'comment'=>'MakeSendLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>604800, 'priority'=>91, 'status'=>0, 'test'=>'!empty($conf->global->MAIN_ALLOW_BACKUP_BY_EMAIL) && in_array($conf->db->type, array(\'mysql\', \'mysqli\'))'),
3=>array('entity'=>0, 'label'=>'CleanUnfinishedCronjobShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'cleanUnfinishedCronjob', 'parameters'=>'', 'comment'=>'CleanUnfinishedCronjob', 'frequency'=>5, 'unitfrequency'=>60, 'priority'=>10, 'status'=>0, 'test'=>'getDolGlobalInt("MAIN_FEATURES_LEVEL") >= 2'),
// 1=>array('entity'=>0, 'label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24)
diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php
index 437fa691713..f037f26176c 100644
--- a/htdocs/core/modules/modEventOrganization.class.php
+++ b/htdocs/core/modules/modEventOrganization.class.php
@@ -62,7 +62,7 @@ class modEventOrganization extends DolibarrModules
// Key used in llx_const table to save module status enabled/disabled (where EVENTORGANIZATION is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->picto = 'action';
+ $this->picto = 'conferenceorbooth';
// Define some features supported by module (triggers, login, substitutions, menus, css, etc...)
$this->module_parts = array(
diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php
index 09ff03cae9b..3f3dd4b97a1 100644
--- a/htdocs/core/modules/modHRM.class.php
+++ b/htdocs/core/modules/modHRM.class.php
@@ -56,7 +56,7 @@ class modHRM extends DolibarrModules
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
$this->description = "HRM";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
- $this->version = 'experimental';
+ $this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of image file used for this module.
diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php
index 940c4fb2f9a..5224f82a2f5 100644
--- a/htdocs/core/modules/modProduct.class.php
+++ b/htdocs/core/modules/modProduct.class.php
@@ -860,7 +860,7 @@ class modProduct extends DolibarrModules
));
}
- $this->import_updatekeys_array[$r] = array('sp.fk_product'=>'ProductOrService', 'sp.ref_fourn'=>'SupplierRef', 'sp.fk_soc'=>'Supplier');
+ $this->import_updatekeys_array[$r] = array('sp.fk_product'=>'ProductOrService', 'sp.ref_fourn'=>'SupplierRef', 'sp.fk_soc'=>'Supplier', 'sp.quantity'=>"QtyMin");
}
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php
index 89e57be51bb..8bc8e03adb2 100644
--- a/htdocs/core/modules/modProjet.class.php
+++ b/htdocs/core/modules/modProjet.class.php
@@ -214,7 +214,7 @@ class modProjet extends DolibarrModules
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
- //Exports
+ // Exports
//--------
$r = 1;
@@ -291,6 +291,40 @@ class modProjet extends DolibarrModules
}
$this->export_sql_end[$r] .= " WHERE p.entity IN (".getEntity('project').")";
+ // Import project/opportunities
+ $r++;
+ $this->import_code[$r] = 'projects';
+ $this->import_label[$r] = 'ImportDatasetProjects';
+ $this->import_icon[$r] = 'project';
+ $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon
+ $this->import_tables_array[$r] = array('t'=>MAIN_DB_PREFIX.'projet', 'extra'=>MAIN_DB_PREFIX.'projet_extrafields'); // List of tables to insert into (insert done in same order)
+ $this->import_fields_array[$r] = array('t.ref'=>'ProjectRef*', 't.title'=>'Label*', 't.description'=>"Description", 't.fk_soc' => 'ThirdPartyName', 't.public'=>"Public", 't.fk_statut'=>"Status");
+ $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('t.fk_opp_status'=>"OpportunityStatus", 't.opp_percent'=>"OpportunityProbability", 't.opp_amount'=>"OpportunityAmount", 't.note_public'=>"NotePublic", 't.note_private'=>"NotePrivate", 't.budget_amount'=>"Budget", 't.dateo'=>"DateStart", 't.datee'=>"DateEnd"));
+ // Add extra fields
+ $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'projet' AND entity IN (0,".$conf->entity.")";
+ $resql = $this->db->query($sql);
+ if ($resql) { // This can fail when class is used on old database (during migration for example)
+ while ($obj = $this->db->fetch_object($resql)) {
+ $fieldname = 'extra.'.$obj->name;
+ $fieldlabel = ucfirst($obj->label);
+ $this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : '');
+ }
+ }
+ // End add extra fields
+ $this->import_fieldshidden_array[$r] = array('t.fk_user_creat'=>'user->id', 'extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'projet'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
+ $this->import_convertvalue_array[$r] = array(
+ 't.ref'=>array('rule'=>'getrefifauto', 'class'=>(empty($conf->global->PROJECT_ADDON) ? 'mod_project_simple' : $conf->global->PROJECT_ADDON), 'path'=>"/core/modules/project/".(empty($conf->global->PROJECT_ADDON) ? 'mod_project_simple' : $conf->global->PROJECT_ADDON).'.php'),
+ 't.fk_soc' => array(
+ 'rule' => 'fetchidfromref',
+ 'file' => '/societe/class/societe.class.php',
+ 'class' => 'Societe',
+ 'method' => 'fetch',
+ 'element' => 'ThirdParty'
+ ),
+ );
+ //$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
+ $this->import_regex_array[$r] = array('t.dateo'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$', 't.datee'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$', 't.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$');
+ $this->import_examplevalues_array[$r] = array('t.fk_soc'=>'ThirdParty', 't.ref'=>"auto or PJ2010-1234", 't.title'=>"My project", 't.fk_statut'=>'0,1 or 2', 't.datec'=>'1972-10-10', 't.note_private'=>"My private note", 't.note_public'=>"My public note");
// Import list of tasks
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
diff --git a/htdocs/core/modules/modStockTransfer.class.php b/htdocs/core/modules/modStockTransfer.class.php
index 6c8f068adf6..279add98bad 100644
--- a/htdocs/core/modules/modStockTransfer.class.php
+++ b/htdocs/core/modules/modStockTransfer.class.php
@@ -63,7 +63,7 @@ class modStockTransfer extends DolibarrModules
// Used only if file README.md and README-LL.md not found.
$this->descriptionlong = "StockTransfer description (Long)";
// 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/modTicket.class.php b/htdocs/core/modules/modTicket.class.php
index f34398abc4b..c8d2d8d5a4f 100644
--- a/htdocs/core/modules/modTicket.class.php
+++ b/htdocs/core/modules/modTicket.class.php
@@ -124,7 +124,6 @@ class modTicket extends DolibarrModules
$this->tabs = array(
'thirdparty:+ticket:Tickets:ticket:$user->rights->ticket->read:/ticket/list.php?socid=__ID__',
- 'project:+ticket:Tickets:ticket:$user->rights->ticket->read:/ticket/list.php?projectid=__ID__',
);
// Dictionaries
diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
index 42b3c529fe4..b89c4eab2cd 100644
--- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
+++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
@@ -175,7 +175,9 @@ class doc_generic_mo_odt extends ModelePDFMo
$texte .= '';
}
diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
index 94d511367e2..821b6a24e10 100644
--- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
+++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
@@ -334,7 +334,7 @@ class doc_generic_product_odt extends ModelePDFProduct
'__FROM_EMAIL__' => $this->emetteur->email,
'__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht,
- '__TOTAL_VAT__' => $object->total_vat
+ '__TOTAL_VAT__' => $object->total_tva
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index 8b1261f35f0..2015da21f61 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -134,8 +134,8 @@ class doc_generic_project_odt extends ModelePDFProjects
// Get source company
$this->emetteur = $mysoc;
- if (!$this->emetteur->pays_code) {
- $this->emetteur->pays_code = substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini
+ if (!$this->emetteur->country_code) {
+ $this->emetteur->country_code = substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini
}
}
@@ -468,7 +468,9 @@ class doc_generic_project_odt extends ModelePDFProjects
$texte .= '';
}
diff --git a/htdocs/core/modules/project/mod_project_universal.php b/htdocs/core/modules/project/mod_project_universal.php
index 47fd83842ed..1020c42ebf6 100644
--- a/htdocs/core/modules/project/mod_project_universal.php
+++ b/htdocs/core/modules/project/mod_project_universal.php
@@ -30,6 +30,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php';
*/
class mod_project_universal extends ModeleNumRefProjects
{
+ /**
+ * @var DoliDB $db
+ */
+ public $db;
+
/**
* Dolibarr version of the loaded document
* @var string
diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php
index dc3f19d72fd..894df4bf8f3 100644
--- a/htdocs/core/modules/project/modules_project.php
+++ b/htdocs/core/modules/project/modules_project.php
@@ -127,6 +127,11 @@ abstract class ModeleNumRefProjects
*/
public $error = '';
+ /**
+ * @var string $version
+ */
+ public $version;
+
/**
* Return if a module can be used or not
*
diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
index ba386eedfe7..a7f3eab4a30 100644
--- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
+++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
@@ -433,7 +433,9 @@ class doc_generic_task_odt extends ModelePDFTask
$texte .= '';
}
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index 231d8c1ddff..facb364cd23 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -961,8 +961,33 @@ class pdf_azur extends ModelePDFPropales
$posy = $pdf->GetY() + 1;
}
+ // Show delivery mode
+ if (empty($conf->global->PROPOSAL_PDF_HIDE_DELIVERYMODE) && $object->shipping_method_id > 0) {
+ $outputlangs->load("sendings");
+
+ $shipping_method_id = $object->shipping_method_id;
+ if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD) && !empty($this->emetteur->shipping_method_id)) {
+ $shipping_method_id = $this->emetteur->shipping_method_id;
+ }
+ $shipping_method_code = dol_getIdFromCode($this->db, $shipping_method_id, 'c_shipment_mode', 'rowid', 'code');
+ $shipping_method_label = dol_getIdFromCode($this->db, $shipping_method_id, 'c_shipment_mode', 'rowid', 'libelle');
+
+ $pdf->SetFont('', 'B', $default_font_size - 2);
+ $pdf->SetXY($this->marge_gauche, $posy);
+ $titre = $outputlangs->transnoentities("SendingMethod").':';
+ $pdf->MultiCell(43, 4, $titre, 0, 'L');
+
+ $pdf->SetFont('', '', $default_font_size - 2);
+ $pdf->SetXY($posxval, $posy);
+ $lib_condition_paiement = ($outputlangs->transnoentities("SendingMethod".strtoupper($shipping_method_code)) != "SendingMethod".strtoupper($shipping_method_code)) ? $outputlangs->trans("SendingMethod".strtoupper($shipping_method_code)) : $shipping_method_label;
+ $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement);
+ $pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L');
+
+ $posy = $pdf->GetY() + 1;
+ }
+
// Show payments conditions
- if (empty($conf->global->PROPOSAL_PDF_HIDE_PAYMENTTERM) && ($object->cond_reglement_code || $object->cond_reglement)) {
+ if (empty($conf->global->PROPOSAL_PDF_HIDE_PAYMENTTERM) && $object->cond_reglement_code) {
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentConditions").':';
@@ -981,22 +1006,6 @@ class pdf_azur extends ModelePDFPropales
}
if (empty($conf->global->PROPOSAL_PDF_HIDE_PAYMENTMODE)) {
- // Check a payment mode is defined
- /* Not required on a proposal
- if (empty($object->mode_reglement_code)
- && ! $conf->global->FACTURE_CHQ_NUMBER
- && ! $conf->global->FACTURE_RIB_NUMBER)
- {
- $pdf->SetXY($this->marge_gauche, $posy);
- $pdf->SetTextColor(200,0,0);
- $pdf->SetFont('','B', $default_font_size - 2);
- $pdf->MultiCell(90, 3, $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"),0,'L',0);
- $pdf->SetTextColor(0,0,0);
-
- $posy=$pdf->GetY()+1;
- }
- */
-
// Show payment mode
if ($object->mode_reglement_code
&& $object->mode_reglement_code != 'CHQ'
diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
index 9bffe9009fb..f537ea2ef9d 100644
--- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
@@ -1080,8 +1080,33 @@ class pdf_cyan extends ModelePDFPropales
$posy = $pdf->GetY() + 1;
}
+ // Show delivery mode
+ if (empty($conf->global->PROPOSAL_PDF_HIDE_DELIVERYMODE) && $object->shipping_method_id > 0) {
+ $outputlangs->load("sendings");
+
+ $shipping_method_id = $object->shipping_method_id;
+ if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD) && !empty($this->emetteur->shipping_method_id)) {
+ $shipping_method_id = $this->emetteur->shipping_method_id;
+ }
+ $shipping_method_code = dol_getIdFromCode($this->db, $shipping_method_id, 'c_shipment_mode', 'rowid', 'code');
+ $shipping_method_label = dol_getIdFromCode($this->db, $shipping_method_id, 'c_shipment_mode', 'rowid', 'libelle');
+
+ $pdf->SetFont('', 'B', $default_font_size - 2);
+ $pdf->SetXY($this->marge_gauche, $posy);
+ $titre = $outputlangs->transnoentities("SendingMethod").':';
+ $pdf->MultiCell(43, 4, $titre, 0, 'L');
+
+ $pdf->SetFont('', '', $default_font_size - 2);
+ $pdf->SetXY($posxval, $posy);
+ $lib_condition_paiement = ($outputlangs->transnoentities("SendingMethod".strtoupper($shipping_method_code)) != "SendingMethod".strtoupper($shipping_method_code)) ? $outputlangs->trans("SendingMethod".strtoupper($shipping_method_code)) : $shipping_method_label;
+ $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement);
+ $pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L');
+
+ $posy = $pdf->GetY() + 1;
+ }
+
// Show payments conditions
- if (empty($conf->global->PROPOSAL_PDF_HIDE_PAYMENTTERM) && ($object->cond_reglement_code || $object->cond_reglement)) {
+ if (empty($conf->global->PROPOSAL_PDF_HIDE_PAYMENTTERM) && $object->cond_reglement_code) {
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentConditions").':';
@@ -1100,22 +1125,6 @@ class pdf_cyan extends ModelePDFPropales
}
if (empty($conf->global->PROPOSAL_PDF_HIDE_PAYMENTMODE)) {
- // Check a payment mode is defined
- /* Not required on a proposal
- if (empty($object->mode_reglement_code)
- && ! $conf->global->FACTURE_CHQ_NUMBER
- && ! $conf->global->FACTURE_RIB_NUMBER)
- {
- $pdf->SetXY($this->marge_gauche, $posy);
- $pdf->SetTextColor(200,0,0);
- $pdf->SetFont('','B', $default_font_size - 2);
- $pdf->MultiCell(90, 3, $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"),0,'L',0);
- $pdf->SetTextColor(0,0,0);
-
- $posy=$pdf->GetY()+1;
- }
- */
-
// Show payment mode
if ($object->mode_reglement_code
&& $object->mode_reglement_code != 'CHQ'
diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
index 4d8edca7f64..4ebc742b4bb 100644
--- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
+++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
@@ -168,7 +168,9 @@ class doc_generic_reception_odt extends ModelePdfReception
$texte .= '';
}
diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
index 0f5adc3fc7d..eb6ba838d7a 100644
--- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
+++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
@@ -172,7 +172,9 @@ class doc_generic_stock_odt extends ModelePDFStock
$texte .= '';
}
diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
index f3177233589..12bbcc12edc 100644
--- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
@@ -163,7 +163,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
// Scan directories
$nbofiles = count($listoffiles);
- if (!empty($conf->global->COMMANDE_ADDON_PDF_ODT_PATH)) {
+ if (!empty($conf->global->SUPPLIER_ORDER_ADDON_PDF_ODT_PATH)) {
$texte .= $langs->trans("NumberOfModelFilesFound").': ';
//$texte.=$nbofiles?'':'';
$texte .= count($listoffiles);
@@ -175,7 +175,9 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
$texte .= '';
}
diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
index 5e4b75a183e..7ff463df8b3 100644
--- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
@@ -5,7 +5,7 @@
* Copyright (C) 2010-2014 Juanjo Menent
* Copyright (C) 2015 Marcos García
* Copyright (C) 2017 Ferran Marcet
- * Copyright (C) 2018 Frédéric France
+ * Copyright (C) 2018-2022 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
@@ -1567,7 +1567,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
'border-left' => false, // remove left line separator
);
- if (!empty($conf->global->MAIN_GENERATE_ORDERS_WITH_PICTURE)) {
+ if (!empty($conf->global->MAIN_GENERATE_SUPPLIER_ORDER_WITH_PICTURE)) {
$this->cols['photo']['status'] = true;
}
diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
index fc75445123a..55a7710c5a4 100644
--- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
@@ -179,7 +179,9 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
$texte .= '';
diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php
index 57cba16c01b..c73a8a16db6 100644
--- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php
+++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php
@@ -138,7 +138,7 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal
return 0;
}
- $date = $supplier_proposal->datep;
+ $date = $supplier_proposal->date;
$customercode = $objsoc->code_client;
$numFinal = get_next_value($db, $mask, 'supplier_proposal', 'ref', '', $customercode, $date);
diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php
index ff6359be5ce..1a2d1e537cc 100644
--- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php
+++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php
@@ -161,7 +161,9 @@ class doc_generic_ticket_odt extends ModelePDFTicket
$texte .= '';
}
diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
index d129c80f126..1c3e346203b 100644
--- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
+++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
@@ -192,7 +192,9 @@ class doc_generic_user_odt extends ModelePDFUser
$texte .= '';
}
diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php
index 7657fe21e96..5124a1dce35 100644
--- a/htdocs/core/tpl/massactions_pre.tpl.php
+++ b/htdocs/core/tpl/massactions_pre.tpl.php
@@ -360,7 +360,8 @@ if ($massaction == 'preapproveleave') {
// Allow Pre-Mass-Action hook (eg for confirmation dialog)
$parameters = array(
'toselect' => isset($toselect) ? $toselect : array(),
- 'uploaddir' => isset($uploaddir) ? $uploaddir : null
+ 'uploaddir' => isset($uploaddir) ? $uploaddir : null,
+ 'massaction' => $massaction
);
$reshook = $hookmanager->executeHooks('doPreMassActions', $parameters, $object, $action);
diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php
index 2a0f3d654d7..c8f1ccd7a34 100644
--- a/htdocs/core/tpl/notes.tpl.php
+++ b/htdocs/core/tpl/notes.tpl.php
@@ -91,7 +91,7 @@ if ($module == 'propal') {
} elseif ($module == 'shipping') {
$permission = $user->hasRight("expedition", "creer");
} elseif ($module == 'product') {
- $permission = $user->hasRight("produit", "creer");
+ $permission = $user->hasRight("product", "creer");
} elseif ($module == 'service') {
$permission = $user->hasRight("service", "creer");
} elseif ($module == 'ecmfiles') {
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index bd961b5bf17..c0382a39de4 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -385,7 +385,7 @@ if ($nolinesbefore) {
if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier' || $object->element == 'invoice_supplier_rec') { // We must have same test in printObjectLines
$coldisplay++;
?>
- ">
+ ">
';
$coldisplay++;
@@ -718,7 +718,8 @@ if (!empty($usemargins) && $user->rights->margins->creer) {
{
console.log("objectline_create.tpl Call method change() after change on #idprod or #idprodfournprice (senderissupplier=). this.val = "+$(this).val());
- setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva
+ setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva(product)
+
jQuery('#trlinefordates').show();
rights->margins->creer) {
global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { ?>
if (isNaN(pbq)) { console.log("We use experimental option PRODUIT_CUSTOMER_PRICES_BY_QTY or PRODUIT_CUSTOMER_PRICES_BY_QTY but we could not get the id of pbq from product combo list, so load of price may be 0 if product has differet prices"); }
- // Get the HT price for the product and display it
+ // Get the price for the product and display it
console.log("Load unit price without tax and set it into #price_ht for product id="+$(this).val()+" socid=socid; ?>");
$.post('/product/ajax/products.php?action=fetch',
{ 'id': $(this).val(), 'socid': socid; ?>, 'token': '' },
@@ -755,7 +756,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) {
if (data.mandatory_period == 1 && data.type == 1) {
jQuery('#date_start').addClass('inputmandatory');
jQuery('#date_end').addClass('inputmandatory');
- }else{
+ } else {
jQuery('#date_start').removeClass('inputmandatory');
jQuery('#date_end').removeClass('inputmandatory');
}
@@ -767,6 +768,23 @@ if (!empty($usemargins) && $user->rights->margins->creer) {
console.log("objectline_create.tpl set content of price_ht");
jQuery("#price_ht").val(data.price_ht);
}
+
+ var tva_tx = data.tva_tx;
+ var default_vat_code = data.default_vat_code;
+
+ // Now set the VAT
+ var stringforvatrateselection = tva_tx;
+ if (typeof default_vat_code != 'undefined' && default_vat_code != null) {
+ stringforvatrateselection = stringforvatrateselection+' ('+default_vat_code+')';
+ }
+ // Set vat rate if field is an input box
+ $('#tva_tx').val(tva_tx);
+ // Set vat rate by selecting the combo
+ //$('#tva_tx option').val(tva_tx); // This is bugged, it replaces the vat key of all options
+ $('#tva_tx option').removeAttr('selected');
+ console.log("stringforvatrateselection="+stringforvatrateselection+" -> value of option label for this key="+$('#tva_tx option[value="'+stringforvatrateselection+'"]').val());
+ $('#tva_tx option[value="'+stringforvatrateselection+'"]').prop('selected', true);
+
global->PRODUIT_AUTOFILL_DESC) && $conf->global->PRODUIT_AUTOFILL_DESC == 1) {
if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { ?>
@@ -919,39 +937,41 @@ if (!empty($usemargins) && $user->rights->margins->creer) {
?>
global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) {?>
- /* To process customer price per quantity (PRODUIT_CUSTOMER_PRICES_BY_QTY works only if combo product is not an ajax after x key pressed) */
- var pbq = parseInt($('option:selected', this).attr('data-pbq')); // When select is done from HTML select
- if (isNaN(pbq)) { pbq = jQuery('#idprod').attr('data-pbq'); } // When select is done from HTML input with autocomplete
- var pbqup = parseFloat($('option:selected', this).attr('data-pbqup'));
- if (isNaN(pbqup)) { pbqup = jQuery('#idprod').attr('data-pbqup'); }
- var pbqbase = $('option:selected', this).attr('data-pbqbase');
- if (isNaN(pbqbase)) { pbqbase = jQuery('#idprod').attr('data-pbqbase'); }
- var pbqqty = parseFloat($('option:selected', this).attr('data-pbqqty'));
- if (isNaN(pbqqty)) { pbqqty = jQuery('#idprod').attr('data-pbqqty'); }
- var pbqpercent = parseFloat($('option:selected', this).attr('data-pbqpercent'));
- if (isNaN(pbqpercent)) { pbqpercent = jQuery('#idprod').attr('data-pbqpercent'); }
+ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) {
+ ?>
+ /* To process customer price per quantity (PRODUIT_CUSTOMER_PRICES_BY_QTY works only if combo product is not an ajax after x key pressed) */
+ var pbq = parseInt($('option:selected', this).attr('data-pbq')); // When select is done from HTML select
+ if (isNaN(pbq)) { pbq = jQuery('#idprod').attr('data-pbq'); } // When select is done from HTML input with autocomplete
+ var pbqup = parseFloat($('option:selected', this).attr('data-pbqup'));
+ if (isNaN(pbqup)) { pbqup = jQuery('#idprod').attr('data-pbqup'); }
+ var pbqbase = $('option:selected', this).attr('data-pbqbase');
+ if (isNaN(pbqbase)) { pbqbase = jQuery('#idprod').attr('data-pbqbase'); }
+ var pbqqty = parseFloat($('option:selected', this).attr('data-pbqqty'));
+ if (isNaN(pbqqty)) { pbqqty = jQuery('#idprod').attr('data-pbqqty'); }
+ var pbqpercent = parseFloat($('option:selected', this).attr('data-pbqpercent'));
+ if (isNaN(pbqpercent)) { pbqpercent = jQuery('#idprod').attr('data-pbqpercent'); }
- if ((jQuery('#idprod').val() > 0) && ! isNaN(pbq) && pbq > 0)
- {
- var pbqupht = pbqup; /* TODO support of price per qty TTC not yet available */
+ if ((jQuery('#idprod').val() > 0) && ! isNaN(pbq) && pbq > 0)
+ {
+ var pbqupht = pbqup; /* TODO support of price per qty TTC not yet available */
- console.log("We choose a price by quanty price_by_qty id = "+pbq+" price_by_qty upht = "+pbqupht+" price_by_qty qty = "+pbqqty+" price_by_qty percent = "+pbqpercent);
- jQuery("#pbq").val(pbq);
- jQuery("#price_ht").val(pbqupht);
- if (jQuery("#qty").val() < pbqqty)
- {
- jQuery("#qty").val(pbqqty);
- }
- if (jQuery("#remise_percent").val() < pbqpercent)
- {
- jQuery("#remise_percent").val(pbqpercent);
- }
- } else { jQuery("#pbq").val(''); }
+ console.log("We choose a price by quanty price_by_qty id = "+pbq+" price_by_qty upht = "+pbqupht+" price_by_qty qty = "+pbqqty+" price_by_qty percent = "+pbqpercent);
+ jQuery("#pbq").val(pbq);
+ jQuery("#price_ht").val(pbqupht);
+ if (jQuery("#qty").val() < pbqqty)
+ {
+ jQuery("#qty").val(pbqqty);
+ }
+ if (jQuery("#remise_percent").val() < pbqpercent)
+ {
+ jQuery("#remise_percent").val(pbqpercent);
+ }
+ } else { jQuery("#pbq").val(''); }
- // Deal with supplier
+
+ // Deal with supplier ref price
if (jQuery('#idprodfournprice').val() > 0)
{
console.log("objectline_create.tpl #idprodfournprice is > 0, so we set some properties into page");
@@ -971,7 +991,15 @@ if (!empty($usemargins) && $user->rights->margins->creer) {
var tva_tx = parseFloat($('option:selected', this).attr('data-tvatx')); // When select is done from HTML select
if (isNaN(tva_tx)) { tva_tx = parseFloat(jQuery('#idprodfournprice').attr('data-tvatx'));} // When select is done from HTML input with ajax autocomplete
- console.log("objectline_create.tpl We find supplier price : up = "+up+", up_locale = "+up_locale+", qty = "+qty+", tva_tx = "+tva_tx+", discount = "+discount+" for product "+jQuery('#idprodfournprice').val());
+ var default_vat_code = $('option:selected', this).attr('data-default-vat-code'); // When select is done from HTML select
+ if (typeof default_vat_code === 'undefined') { default_vat_code = jQuery('#idprodfournprice').attr('data-default-vat-code');} // When select is done from HTML input with ajax autocomplete
+
+ var stringforvatrateselection = tva_tx;
+ if (typeof default_vat_code != 'undefined' && default_vat_code != null) {
+ stringforvatrateselection = stringforvatrateselection+' ('+default_vat_code+')';
+ }
+
+ console.log("objectline_create.tpl We find supplier price : up = "+up+", up_locale = "+up_locale+", qty = "+qty+", tva_tx = "+tva_tx+", default_vat_code = "+default_vat_code+", stringforvatrateselection="+stringforvatrateselection+", discount = "+discount+" for product supplier ref id = "+jQuery('#idprodfournprice').val());
if (typeof up_locale === 'undefined') {
jQuery("#price_ht").val(up);
@@ -979,8 +1007,13 @@ if (!empty($usemargins) && $user->rights->margins->creer) {
jQuery("#price_ht").val(up_locale);
}
- /* $('#tva_tx option').removeAttr('selected').filter('[value='+tva_tx+']').prop('selected', true); */
- $('#tva_tx option').val(tva_tx);
+ // Set vat rate if field is an input box
+ $('#tva_tx').val(tva_tx);
+ // Set vat rate by selecting the combo
+ //$('#tva_tx option').val(tva_tx); // This is bugged, it replaces the vat key of all options
+ $('#tva_tx option').removeAttr('selected');
+ console.log("stringforvatrateselection="+stringforvatrateselection+" -> value of option label for this key="+$('#tva_tx option[value="'+stringforvatrateselection+'"]').val());
+ $('#tva_tx option[value="'+stringforvatrateselection+'"]').prop('selected', true);
if (jQuery("#qty").val() < qty) {
jQuery("#qty").val(qty);
diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php
index 8c786e7a041..5520215d89a 100644
--- a/htdocs/core/tpl/objectline_edit.tpl.php
+++ b/htdocs/core/tpl/objectline_edit.tpl.php
@@ -196,7 +196,7 @@ $coldisplay++;
if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier' || $object->element == 'invoice_supplier_rec') { // We must have same test in printObjectLines
$coldisplay++;
?>
-
+
fk_fournprice.'">';
}
diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php
index 03e98e1147d..14197b6d052 100644
--- a/htdocs/core/tpl/objectline_view.tpl.php
+++ b/htdocs/core/tpl/objectline_view.tpl.php
@@ -234,14 +234,14 @@ if (($line->info_bits & 2) == 2) {
}
}
-if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0 && empty($conf->global->SUPPLIER_HIDE_SUPPLIER_OBJECTLINES)) {
+if ($user->hasRight('fournisseur', 'lire') && isset($line->fk_fournprice) && $line->fk_fournprice > 0 && empty($conf->global->SUPPLIER_HIDE_SUPPLIER_OBJECTLINES)) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$productfourn = new ProductFournisseur($this->db);
$productfourn->fetch_product_fournisseur_price($line->fk_fournprice);
print '
';
print ''.$langs->trans('Supplier').' : '.$productfourn->getSocNomUrl(1, 'supplier').' - '.$langs->trans('Ref').' : ';
// Supplier ref
- if ($user->rights->produit->creer || $user->rights->service->creer) { // change required right here
+ if ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')) { // change required right here
print $productfourn->getNomUrl();
} else {
print $productfourn->ref_supplier;
@@ -353,19 +353,27 @@ if ($line->special_code == 3) { ?>
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$tooltiponprice = $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->total_ht);
$tooltiponprice .= ' '.$langs->transcountry("TotalVAT", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_tva);
- if (!$senderissupplier && is_object($object->thirdparty)) {
+ if (is_object($object->thirdparty)) {
+ if ($senderissupplier) {
+ $seller = $object->thirdparty;
+ $buyer = $mysoc;
+ } else {
+ $seller = $mysoc;
+ $buyer = $object->thirdparty;
+ }
+
if ($mysoc->useLocalTax(1)) {
- if (($mysoc->country_code == $object->thirdparty->country_code) || $object->thirdparty->useLocalTax(1)) {
- $tooltiponprice .= ' '.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax1);
+ if (($seller->country_code == $buyer->country_code) || $line->total_localtax1 || $seller->useLocalTax(1)) {
+ $tooltiponprice .= ' '.$langs->transcountry("TotalLT1", $seller->country_code).'='.price($line->total_localtax1);
} else {
- $tooltiponprice .= ' '.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThisCustomer").' ';
+ $tooltiponprice .= ' '.$langs->transcountry("TotalLT1", $seller->country_code).'='.$langs->trans($senderissupplier ? "NotUsedForThisSupplier" : "NotUsedForThisCustomer").' ';
}
}
if ($mysoc->useLocalTax(2)) {
- if (($mysoc->country_code == $object->thirdparty->country_code) || $object->thirdparty->useLocalTax(2)) {
- $tooltiponprice .= ' '.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax2);
+ if (($seller->country_code == $buyer->thirdparty->country_code) || $line->total_localtax2 || $seller->useLocalTax(2)) {
+ $tooltiponprice .= ' '.$langs->transcountry("TotalLT2", $seller->country_code).'='.price($line->total_localtax2);
} else {
- $tooltiponprice .= ' '.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThisCustomer").' ';
+ $tooltiponprice .= ' '.$langs->transcountry("TotalLT2", $seller->country_code).'='.$langs->trans($senderissupplier ? "NotUsedForThisSupplier" : "NotUsedForThisCustomer").' ';
}
}
}
@@ -418,7 +426,7 @@ if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlin
print 'Error SQL: ' . $this->db->lasterror();
} elseif ($obj = $this->db->fetch_object($resql_asset)) {
if (!empty($obj->found)) {
- print '';
+ print ' ';
print img_edit_add() . ' ';
}
}
@@ -430,7 +438,7 @@ if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlin
$coldisplay++;
if (($line->info_bits & 2) == 2 || !empty($disableedit)) {
} else { ?>
- id.'&action=editline&token='.newToken().'&lineid='.$line->id.'#line_'.$line->id; ?>">
+ id.'&action=editline&token='.newToken().'&lineid='.$line->id; ?>">
';
}
print ' ';
diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
index f31a4c2c93e..e3f798dec62 100644
--- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
+++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
@@ -742,7 +742,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
if (!is_object($member)) { // This should not happen
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$member = new Adherent($this->db);
- $member->fetch($this->fk_adherent);
+ $member->fetch($object->fk_adherent);
}
if (empty($object->actionmsg2)) {
diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php
index 8f4b32ae502..d26c83f4772 100644
--- a/htdocs/cron/class/cronjob.class.php
+++ b/htdocs/cron/class/cronjob.class.php
@@ -1262,13 +1262,13 @@ class Cronjob extends CommonObject
dol_syslog(get_class($this)."::run_jobs END result=".$result." error=".$errmsg, LOG_ERR);
$this->error = $errmsg;
- $this->lastoutput = ($object->output ? $object->output."\n" : "").$errmsg;
+ $this->lastoutput = (!empty($object->output) ? $object->output."\n" : "").$errmsg;
$this->lastresult = is_numeric($result) ? $result : -1;
$retval = $this->lastresult;
$error++;
} else {
dol_syslog(get_class($this)."::run_jobs END");
- $this->lastoutput = $object->output;
+ $this->lastoutput = (!empty($object->output) ? $object->output : "");
$this->lastresult = var_export($result, true);
$retval = $this->lastresult;
}
diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php
index ae53242d836..30f195b550b 100644
--- a/htdocs/cron/list.php
+++ b/htdocs/cron/list.php
@@ -448,7 +448,7 @@ print ' ';
print ' ';
print '';
-print $form->selectarray('search_status', array('0'=>$langs->trans("Disabled"), '1'=>$langs->trans("Scheduled")), $search_status, 1);
+print $form->selectarray('search_status', array('0'=>$langs->trans("Disabled"), '1'=>$langs->trans("Scheduled")), $search_status, 1, 0, 0, '', 0, 0, 0, '', 'onrightofpage');
print ' ';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php
index ad1a3b9934a..73fc15e6911 100644
--- a/htdocs/delivery/class/delivery.class.php
+++ b/htdocs/delivery/class/delivery.class.php
@@ -638,7 +638,7 @@ class Delivery extends CommonObject
$sql .= " WHERE rowid = ".((int) $lineid);
if ($this->db->query($sql)) {
- $this->update_price();
+ $this->update_price(1);
return 1;
} else {
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index a0a795e9c8b..459c892a1d9 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -48,6 +48,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$langs->loadLangs(array('bills', 'companies', 'donations', 'users'));
$id = GETPOST('rowid') ?GETPOST('rowid', 'int') : GETPOST('id', 'int');
+$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
@@ -58,10 +59,11 @@ $projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
$public_donation = (int) GETPOST("public", 'int');
$object = new Don($db);
-$extrafields = new ExtraFields($db);
+if ($id > 0 || $ref) {
+ $object->fetch($id, $ref);
+}
-// Security check
-$result = restrictedArea($user, 'don', $id);
+$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@@ -71,6 +73,11 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen
$hookmanager->initHooks(array('doncard', 'globalcard'));
$upload_dir = $conf->don->dir_output;
+
+
+// Security check
+$result = restrictedArea($user, 'don', $object->id);
+
$permissiontoadd = $user->rights->don->creer;
@@ -487,7 +494,8 @@ if ($action == 'create') {
// Payment mode
print " ".$langs->trans("PaymentMode")." \n";
$selected = GETPOST('modepayment', 'int');
- $form->select_types_paiements($selected, 'modepayment', 'CRDT', 0, 1);
+ print img_picto('', 'payment', 'class="pictofixedwidth"');
+ print $form->select_types_paiements($selected, 'modepayment', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
print " \n";
// Public note
@@ -516,7 +524,8 @@ if ($action == 'create') {
if (isModEnabled('project')) {
print "".$langs->trans("Project")." ";
- $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
+ print img_picto('', 'project', 'class="pictofixedwidth"');
+ print $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
print " \n";
}
diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php
index e4928ac9363..b42f5fb4e4d 100644
--- a/htdocs/don/class/paymentdonation.class.php
+++ b/htdocs/don/class/paymentdonation.class.php
@@ -65,7 +65,7 @@ class PaymentDonation extends CommonObject
public $amounts = array(); // Array of amounts
public $fk_typepayment; // Payment mode ID
- public $paymenttype; // Payment mode ID
+ public $paymenttype; // Payment mode ID or Code. TODO Use only the code in this field.
public $num_payment;
@@ -188,12 +188,12 @@ class PaymentDonation extends CommonObject
$sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_donation (fk_donation, datec, datep, amount,";
$sql .= " fk_typepayment, num_payment, note, ext_payment_id, ext_payment_site,";
$sql .= " fk_user_creat, fk_bank)";
- $sql .= " VALUES ($this->chid, '".$this->db->idate($now)."',";
+ $sql .= " VALUES (".((int) $this->chid).", '".$this->db->idate($now)."',";
$sql .= " '".$this->db->idate($this->datepaid)."',";
- $sql .= " ".price2num($totalamount).",";
+ $sql .= " ".((float) price2num($totalamount)).",";
$sql .= " ".((int) $this->paymenttype).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', ";
$sql .= " ".($this->ext_payment_id ? "'".$this->db->escape($this->ext_payment_id)."'" : "null").", ".($this->ext_payment_site ? "'".$this->db->escape($this->ext_payment_site)."'" : "null").",";
- $sql .= " ".$user->id.", 0)";
+ $sql .= " ".((int) $user->id).", 0)";
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -269,8 +269,8 @@ class PaymentDonation extends CommonObject
$this->tms = $this->db->jdate($obj->tms);
$this->datep = $this->db->jdate($obj->datep);
$this->amount = $obj->amount;
- $this->fk_typepayment = $obj->fk_typepayment; // For backward compatibility
- $this->paymenttype = $obj->fk_typepayment;
+ $this->fk_typepayment = $obj->fk_typepayment; // Id on type of payent
+ $this->paymenttype = $obj->fk_typepayment; // Id on type of payment. We should store the code into paymenttype.
$this->num_payment = $obj->num_payment;
$this->note_public = $obj->note_public;
$this->fk_bank = $obj->fk_bank;
diff --git a/htdocs/don/document.php b/htdocs/don/document.php
index b6b7e6a24d3..a5aa3984202 100644
--- a/htdocs/don/document.php
+++ b/htdocs/don/document.php
@@ -49,13 +49,6 @@ $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
-// Security check
-if ($user->socid) {
- $socid = $user->socid;
-}
-$result = restrictedArea($user, 'don', $id, '');
-
-
// Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
@@ -74,13 +67,20 @@ if (!$sortfield) {
$sortfield = "name";
}
-
$object = new Don($db);
-$object->fetch($id, $ref);
+if ($id > 0 || $ref) {
+ $object->fetch($id, $ref);
+}
$upload_dir = $conf->don->dir_output.'/'.get_exdir($id, 0, 0, 0, $object, 'donation').'/'.dol_sanitizeFileName($object->ref);
$modulepart = 'don';
+// Security check
+if ($user->socid) {
+ $socid = $user->socid;
+}
+$result = restrictedArea($user, 'don', $object->id);
+
$permissiontoadd = $user->rights->don->creer; // Used by the include of actions_dellink.inc.php
diff --git a/htdocs/don/index.php b/htdocs/don/index.php
index 721cfb8d67a..c402ecd6f0e 100644
--- a/htdocs/don/index.php
+++ b/htdocs/don/index.php
@@ -35,11 +35,11 @@ $hookmanager->initHooks(array('donationindex'));
$langs->load("donations");
+$donation_static = new Don($db);
+
// Security check
$result = restrictedArea($user, 'don');
-$donation_static = new Don($db);
-
/*
* Actions
diff --git a/htdocs/don/info.php b/htdocs/don/info.php
index 82dd9842210..ad67cceb30c 100644
--- a/htdocs/don/info.php
+++ b/htdocs/don/info.php
@@ -38,14 +38,17 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
+$object = new Don($db);
+if ($id > 0 || $ref) {
+ $object->fetch($id, $ref);
+}
+
// Security check
if ($user->socid) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'don', $id, '');
+$result = restrictedArea($user, 'don', $object->id);
-$object = new Don($db);
-$object->fetch($id);
/*
diff --git a/htdocs/don/list.php b/htdocs/don/list.php
index c3cb4d9ce58..ac704571daa 100644
--- a/htdocs/don/list.php
+++ b/htdocs/don/list.php
@@ -88,6 +88,11 @@ $fieldstosearchall = array(
'd.firstname'=>'Firstname',
);
+// Security check
+$result = restrictedArea($user, 'don');
+
+
+
/*
* View
@@ -234,7 +239,7 @@ if ($resql) {
Don::STATUS_PAID=>$langs->trans("DonationStatusPaid"),
Don::STATUS_CANCELED=>$langs->trans("Canceled")
);
- print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'maxwidth100');
+ print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'maxwidth100 onrightofpage');
print '';
print '';
$searchpicto = $form->showFilterAndCheckAddButtons(0);
diff --git a/htdocs/don/note.php b/htdocs/don/note.php
index 4d84c4b1417..dd3f4e176ce 100644
--- a/htdocs/don/note.php
+++ b/htdocs/don/note.php
@@ -43,17 +43,19 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
+$hookmanager->initHooks(array('donnote'));
+
+$object = new Don($db);
+if ($id > 0 || $ref) {
+ $object->fetch($id, $ref);
+}
+
// Security check
$socid = 0;
if ($user->socid) {
$socid = $user->socid;
}
-$hookmanager->initHooks(array('donnote'));
-
-$result = restrictedArea($user, 'don', $id, '');
-
-$object = new Don($db);
-$object->fetch($id);
+$result = restrictedArea($user, 'don', $object->id, '');
$permissionnote = $user->rights->don->creer; // Used by the include of actions_setnotes.inc.php
diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php
index 6a2cc78f128..358c0b208e9 100644
--- a/htdocs/don/payment/payment.php
+++ b/htdocs/don/payment/payment.php
@@ -95,7 +95,7 @@ if ($action == 'add_payment') {
// Create a line of payments
$payment = new PaymentDonation($db);
$payment->chid = $chid;
- $payment->datepaid = $datepaid;
+ $payment->datep = $datepaid;
$payment->amounts = $amounts; // Tableau de montant
$payment->paymenttype = GETPOST("paymenttype", 'int');
$payment->num_payment = GETPOST("num_payment", 'alphanohtml');
@@ -192,14 +192,14 @@ if ($action == 'create') {
print '';
print ' '.$langs->trans("PaymentMode").' ';
- $form->select_types_paiements(GETPOSTISSET("paymenttype") ? GETPOST("paymenttype") : $object->paymenttype, "paymenttype");
+ $form->select_types_paiements(GETPOSTISSET("paymenttype") ? GETPOST("paymenttype") : $object->fk_typepayment, "paymenttype");
print " \n";
print ' ';
print '';
print ''.$langs->trans('AccountToCredit').' ';
print '';
- $form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid") : $object->accountid, "accountid", 0, '', 2); // Show open bank account list
+ $form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid") : "0", "accountid", 0, '', 2); // Show open bank account list
print ' ';
// Number
diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php
index 46b787fc6fd..e43a86da515 100644
--- a/htdocs/emailcollector/class/emailcollectoraction.class.php
+++ b/htdocs/emailcollector/class/emailcollectoraction.class.php
@@ -85,7 +85,7 @@ class EmailCollectorAction extends CommonObject
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",),
'fk_emailcollector' => array('type'=>'integer', 'label'=>'Id of emailcollector', 'foreignkey'=>'emailcollector.rowid'),
'type' => array('type'=>'varchar(128)', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1),
- 'actionparam' => array('type'=>'varchar(255)', 'label'=>'ParamForAction', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>-1),
+ 'actionparam' => array('type'=>'text', 'label'=>'ParamForAction', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>-1),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>500, 'notnull'=>1,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>1,),
'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'llx_user.rowid',),
diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
index 909758ca3f2..595eaf67eeb 100644
--- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php
+++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
@@ -123,6 +123,7 @@ class ConferenceOrBoothAttendee extends CommonObject
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,),
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'default'=>0, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Canceled'),),
+ 'ip' => array('type'=>'varchar(250)', 'label'=>'Ip', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
);
public $rowid;
public $ref;
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index d3981dcf264..0b8668a6c1a 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -84,6 +84,13 @@ class Expedition extends CommonObject
*/
public $picto = 'dolly';
+
+ /**
+ * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
+ */
+ public $fields = array();
+
+
public $socid;
/**
@@ -733,7 +740,8 @@ class Expedition extends CommonObject
} else {
$qty = $obj->edbqty;
}
- if ($qty <= 0) {
+
+ if ($qty == 0 || ($qty < 0 && !getDolGlobalInt('SHIPMENT_ALLOW_NEGATIVE_QTY'))) {
continue;
}
dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid);
diff --git a/htdocs/expedition/class/expeditionstats.class.php b/htdocs/expedition/class/expeditionstats.class.php
index 8eb31896f38..aa4e40fcb8f 100644
--- a/htdocs/expedition/class/expeditionstats.class.php
+++ b/htdocs/expedition/class/expeditionstats.class.php
@@ -131,6 +131,54 @@ class ExpeditionStats extends Stats
return $this->_getNbByYear($sql);
}
+ /**
+ * Return the orders amount by month for a year
+ *
+ * @param int $year Year to scan
+ * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
+ * @return array Array with amount by month
+ */
+ public function getAmountByMonth($year, $format = 0)
+ {
+ global $user;
+
+ $sql = "SELECT date_format(c.date_valid,'%m') as dm, SUM(c.".$this->field.")";
+ $sql .= " FROM ".$this->from;
+ if (empty($user->rights->societe->client->voir) && !$this->socid) {
+ $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ }
+ $sql .= $this->join;
+ $sql .= " WHERE ".$this->where;
+ $sql .= " GROUP BY dm";
+ $sql .= $this->db->order('dm', 'DESC');
+
+ $res = $this->_getAmountByMonth($year, $sql, $format);
+ return $res;
+ }
+
+ /**
+ * Return the orders amount average by month for a year
+ *
+ * @param int $year year for stats
+ * @return array array with number by month
+ */
+ public function getAverageByMonth($year)
+ {
+ global $user;
+
+ $sql = "SELECT date_format(c.date_valid,'%m') as dm, AVG(c.".$this->field.")";
+ $sql .= " FROM ".$this->from;
+ if (empty($user->rights->societe->client->voir) && !$this->socid) {
+ $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ }
+ $sql .= $this->join;
+ $sql .= " WHERE ".$this->where;
+ $sql .= " GROUP BY dm";
+ $sql .= $this->db->order('dm', 'DESC');
+
+ return $this->_getAverageByMonth($year, $sql);
+ }
+
/**
* Return nb, total and average
*
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index 3b06f005787..14544087647 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -284,6 +284,9 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
+
+$sqlfields = $sql; // $sql fields to remove for count total
+
$sql .= " FROM ".MAIN_DB_PREFIX."expedition as e";
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (e.rowid = ef.fk_object)";
@@ -446,19 +449,31 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPrint;
-$sql .= $db->order($sortfield, $sortorder);
-
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
- $result = $db->query($sql);
- $nbtotalofrecords = $db->num_rows($result);
+ /* The fast and low memory method to get and count full list converts the sql into a sql count */
+ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
+ $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
+ $resql = $db->query($sqlforcount);
+ if ($resql) {
+ $objforcount = $db->fetch_object($resql);
+ $nbtotalofrecords = $objforcount->nbtotalofrecords;
+ } else {
+ dol_print_error($db);
+ }
+
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}
+ $db->free($resql);
}
-$sql .= $db->plimit($limit + 1, $offset);
+// Complete request and execute it with limit
+$sql .= $db->order($sortfield, $sortorder);
+if ($limit) {
+ $sql .= $db->plimit($limit + 1, $offset);
+}
//print $sql;
$resql = $db->query($sql);
@@ -772,7 +787,7 @@ if (!empty($arrayfields['e.tms']['checked'])) {
// Status
if (!empty($arrayfields['e.fk_statut']['checked'])) {
print '';
- print $form->selectarray('search_status', array('0'=>$langs->trans('StatusSendingDraftShort'), '1'=>$langs->trans('StatusSendingValidatedShort'), '2'=>$langs->trans('StatusSendingProcessedShort')), $search_status, 1);
+ print $form->selectarray('search_status', array('0'=>$langs->trans('StatusSendingDraftShort'), '1'=>$langs->trans('StatusSendingValidatedShort'), '2'=>$langs->trans('StatusSendingProcessedShort')), $search_status, 1, 0, 0, '', 0, 0, 0, '', 'onrightofpage');
print ' ';
}
// Status billed
diff --git a/htdocs/expedition/stats/month.php b/htdocs/expedition/stats/month.php
index 34842efaaf3..398bc381715 100644
--- a/htdocs/expedition/stats/month.php
+++ b/htdocs/expedition/stats/month.php
@@ -47,11 +47,12 @@ $WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
$mesg = '';
+$mode = '';
print load_fiche_titre($langs->trans("StatisticsOfSendings").' '.$year, $mesg);
-$stats = new ExpeditionStats($db);
-$data = $stats->getNbExpeditionByMonth($year);
+$stats = new ExpeditionStats($db, $socid, $mode);
+$data = $stats->getNbByMonth($year);
dol_mkdir($conf->expedition->dir_temp);
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 33ec1fede7b..f6aa14865ec 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -2297,7 +2297,7 @@ if ($action == 'create') {
}
}
- $tredited = 'tredited';
+ $tredited = 'tredited'; // Case the addfile and linkto file is used for edit (used by following tpl)
include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php';
include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php';
@@ -2455,6 +2455,7 @@ if ($action == 'create') {
print ''."\n";
print '';
+ $tredited = ''; // Case the addfile and linkto file is used for edit (used by following tpl)
include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php';
include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php';
@@ -2517,6 +2518,7 @@ if ($action == 'create') {
print '';
$defaultvat = -1;
if (!empty($conf->global->EXPENSEREPORT_NO_DEFAULT_VAT)) {
+ // If option to have no default VAT on expense report is on, we force MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS
$conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none';
}
print $form->load_tva('vatrate', (!empty($vatrate) ? $vatrate : $defaultvat), $mysoc, '', 0, 0, '', false, 1);
diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php
index a1afcef74a2..ecb1cf3d65b 100644
--- a/htdocs/expensereport/class/expensereport.class.php
+++ b/htdocs/expensereport/class/expensereport.class.php
@@ -367,7 +367,7 @@ class ExpenseReport extends CommonObject
}
if (!$error) {
- $result = $this->update_price();
+ $result = $this->update_price(1);
if ($result > 0) {
if (!$notrigger) {
// Call trigger
@@ -1858,7 +1858,7 @@ class ExpenseReport extends CommonObject
$result = $this->line->insert(0, true);
if ($result > 0) {
- $result = $this->update_price(); // This method is designed to add line from user input so total calculation must be done using 'auto' mode.
+ $result = $this->update_price(1); // This method is designed to add line from user input so total calculation must be done using 'auto' mode.
if ($result > 0) {
$this->db->commit();
return $this->line->id;
@@ -2217,7 +2217,7 @@ class ExpenseReport extends CommonObject
return -1;
}
- $this->update_price();
+ $this->update_price(1);
$this->db->commit();
@@ -2896,7 +2896,7 @@ class ExpenseReportLine extends CommonObjectLine
if (!$fromaddline) {
$tmpparent = new ExpenseReport($this->db);
$tmpparent->fetch($this->fk_expensereport);
- $result = $tmpparent->update_price();
+ $result = $tmpparent->update_price(1);
if ($result < 0) {
$error++;
$this->error = $tmpparent->error;
@@ -3023,7 +3023,7 @@ class ExpenseReportLine extends CommonObjectLine
$tmpparent = new ExpenseReport($this->db);
$result = $tmpparent->fetch($this->fk_expensereport);
if ($result > 0) {
- $result = $tmpparent->update_price();
+ $result = $tmpparent->update_price(1);
if ($result < 0) {
$error++;
$this->error = $tmpparent->error;
diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php
index 896bb29cf43..bded18fa597 100644
--- a/htdocs/expensereport/list.php
+++ b/htdocs/expensereport/list.php
@@ -285,6 +285,9 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
+
+$sqlfields = $sql; // $sql fields to remove for count total
+
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as d";
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)";
@@ -340,20 +343,32 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
-$sql .= $db->order($sortfield, $sortorder);
-
// Count total nb of records
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
- $result = $db->query($sql);
- $nbtotalofrecords = $db->num_rows($result);
+ /* The fast and low memory method to get and count full list converts the sql into a sql count */
+ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
+ $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
+ $resql = $db->query($sqlforcount);
+ if ($resql) {
+ $objforcount = $db->fetch_object($resql);
+ $nbtotalofrecords = $objforcount->nbtotalofrecords;
+ } else {
+ dol_print_error($db);
+ }
+
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}
+ $db->free($resql);
}
-$sql .= $db->plimit($limit + 1, $offset);
+// Complete request and execute it with limit
+$sql .= $db->order($sortfield, $sortorder);
+if ($limit) {
+ $sql .= $db->plimit($limit + 1, $offset);
+}
//print $sql;
$resql = $db->query($sql);
@@ -532,7 +547,7 @@ if ($resql) {
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
- $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
+ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '';
@@ -540,6 +555,13 @@ if ($resql) {
// Filters
print '
';
+ // Action column
+ if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ print '';
+ $searchpicto = $form->showFilterButtons('left');
+ print $searchpicto;
+ print ' ';
+ }
if (!empty($arrayfields['d.ref']['checked'])) {
print '';
print ' ';
@@ -626,14 +648,19 @@ if ($resql) {
print ' ';
}
// Action column
- print '';
- $searchpicto = $form->showFilterButtons();
- print $searchpicto;
- print ' ';
+ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ print '';
+ $searchpicto = $form->showFilterButtons();
+ print $searchpicto;
+ print ' ';
+ }
print " \n";
print '
';
+ if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
+ }
if (!empty($arrayfields['d.ref']['checked'])) {
print_liste_field_titre($arrayfields['d.ref']['label'], $_SERVER["PHP_SELF"], "d.ref", "", $param, '', $sortfield, $sortorder);
}
@@ -676,7 +703,9 @@ if ($resql) {
if (!empty($arrayfields['d.fk_statut']['checked'])) {
print_liste_field_titre($arrayfields['d.fk_statut']['label'], $_SERVER["PHP_SELF"], "d.fk_statut", "", $param, 'align="right"', $sortfield, $sortorder);
}
- print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
+ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
+ }
print " \n";
$total_total_ht = 0;
@@ -712,6 +741,18 @@ if ($resql) {
print '
';
+ // Action column
+ if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ print '';
+ if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
+ $selected = 0;
+ if (in_array($obj->rowid, $arrayofselected)) {
+ $selected = 1;
+ }
+ print ' ';
+ }
+ print ' ';
+ }
// Ref
if (!empty($arrayfields['d.ref']['checked'])) {
print '';
@@ -856,15 +897,17 @@ if ($resql) {
}
}
// Action column
- print ' ';
- if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
- $selected = 0;
- if (in_array($obj->rowid, $arrayofselected)) {
- $selected = 1;
+ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ print ' ';
+ if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
+ $selected = 0;
+ if (in_array($obj->rowid, $arrayofselected)) {
+ $selected = 1;
+ }
+ print ' ';
}
- print ' ';
+ print ' ';
}
- print '';
if (!$i) {
$totalarray['nbfield']++;
}
diff --git a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php
index 3835740dd40..fd25a1fff4b 100644
--- a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php
+++ b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php
@@ -136,8 +136,18 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) {
print ' ';
} else {
- print '
global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ' style="display: none"' : '').'>';
- print '';
+ if (empty($tredited)) {
+ $css = 'oddeven nohover trattachnewfilenow';
+ $newcolspan = $colspan;
+ } else {
+ $css = 'trattachnewfilenow tredited';
+ $newcolspan = $colspan - 1;
+ }
+ print ' global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ' style="display: none"' : '').'>';
+ if (!empty($tredited)) {
+ print ' ';
+ }
+ print '';
print ''.$langs->trans("NoFilesUploadedYet").' ';
print ' ';
}
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index 174196a23a5..a3b69d6e26c 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -251,6 +251,9 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
+
+$sqlfields = $sql; // $sql fields to remove for count total
+
$sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f";
if (isModEnabled('project')) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr on f.fk_projet = pr.rowid";
@@ -324,20 +327,18 @@ $sql .= $hookmanager->resPrint;
// Count total nb of records
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
- /* This old and fast method to get and count full list returns all record so use a high amount of memory. */
- $resql = $db->query($sql);
- $nbtotalofrecords = $db->num_rows($resql);
/* The fast and low memory method to get and count full list converts the sql into a sql count */
- /*$sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql);
+ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
+ $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
$resql = $db->query($sqlforcount);
if ($resql) {
$objforcount = $db->fetch_object($resql);
$nbtotalofrecords = $objforcount->nbtotalofrecords;
} else {
dol_print_error($db);
- }*/
+ }
- if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
+ if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}
@@ -493,7 +494,7 @@ if (!empty($moreforfilter)) {
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
-$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
+$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '
';
@@ -503,7 +504,7 @@ print '
';
// Action column
-if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
+if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '';
$searchpicto = $form->showFilterButtons('left');
print $searchpicto;
@@ -574,7 +575,7 @@ if (!empty($arrayfields['f.fk_statut']['checked'])) {
if (empty($conf->global->FICHINTER_CLASSIFY_BILLED)) {
unset($liststatus[2]); // Option deprecated. In a future, billed must be managed with a dedicated field to 0 or 1
}
- print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1);
+ print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1, 0, 0, '', 'onrightofpage');
print ' ';
}
// Fields of detail line
@@ -588,7 +589,7 @@ if (!empty($arrayfields['fd.duree']['checked'])) {
print ' ';
}
// Action column
-if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
+if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
@@ -602,6 +603,10 @@ $totalarray['nbfield'] = 0;
// Fields title label
// --------------------------------------------------------------------
print ' ';
+// Action column
+if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
+}
if (!empty($arrayfields['f.ref']['checked'])) {
print_liste_field_titre($arrayfields['f.ref']['label'], $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
}
@@ -650,7 +655,11 @@ if (!empty($arrayfields['fd.date']['checked'])) {
if (!empty($arrayfields['fd.duree']['checked'])) {
print_liste_field_titre($arrayfields['fd.duree']['label'], $_SERVER["PHP_SELF"], "fd.duree", "", $param, '', $sortfield, $sortorder, 'right ');
}
-print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
+
+// Action column
+if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
+}
print " \n";
@@ -687,7 +696,18 @@ while ($i < $imaxinloop) {
$companystatic->status = $obj->thirdpartystatus;
print '';
-
+ // Action column
+ if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ print '';
+ if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
+ $selected = 0;
+ if (in_array($obj->rowid, $arrayofselected)) {
+ $selected = 1;
+ }
+ print ' ';
+ }
+ print ' ';
+ }
if (!empty($arrayfields['f.ref']['checked'])) {
print "";
@@ -848,7 +868,7 @@ while ($i < $imaxinloop) {
$totalarray['val']['fd.duree'] += $obj->duree;
}
// Action column
- if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
+ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print ' ';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php
index 2c929aa40ba..f3260d8ea48 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -106,7 +106,7 @@ if (empty($reshook)) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
- // terms of the settlement
+ // Set payment terms of the settlement
if ($action == 'setconditions' && $user->rights->societe->creer) {
$object->fetch($id);
$result = $object->setPaymentTerms(GETPOST('cond_reglement_supplier_id', 'int'));
@@ -114,7 +114,7 @@ if (empty($reshook)) {
dol_print_error($db, $object->error);
}
}
- // mode de reglement
+ // Payment mode
if ($action == 'setmode' && $user->rights->societe->creer) {
$object->fetch($id);
$result = $object->setPaymentMethods(GETPOST('mode_reglement_supplier_id', 'int'));
@@ -123,6 +123,15 @@ if (empty($reshook)) {
}
}
+ // Bank account
+ if ($action == 'setbankaccount' && $user->rights->societe->creer) {
+ $object->fetch($id);
+ $result = $object->setBankAccount(GETPOST('fk_account', 'int'));
+ if ($result < 0) {
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
+ }
+
// update supplier order min amount
if ($action == 'setsupplier_order_min_amount') {
$object->fetch($id);
@@ -276,7 +285,7 @@ if ($object->id > 0) {
print " ";
print ' ';
- // Mode de reglement par defaut
+ // Default payment mode
print '';
print '';
print $langs->trans('PaymentMode');
@@ -294,6 +303,26 @@ if ($object->id > 0) {
print " ";
print ' ';
+ if (isModEnabled("banque")) {
+ // Default bank account for payments
+ print '';
+ print '';
+ print ' ';
+ if ($action == 'editbankaccount') {
+ $form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_account, 'fk_account', 1);
+ } else {
+ $form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_account, 'none');
+ }
+ print " ";
+ print ' ';
+ }
+
// Relative discounts (Discounts-Drawbacks-Rebates)
print '';
print '';
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 3e58ceddfce..aed73da97ba 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -2138,7 +2138,7 @@ class CommandeFournisseur extends CommonOrder
}
if ($line->delete($notrigger) > 0) {
- $this->update_price();
+ $this->update_price(1);
return 1;
} else {
$this->error = $line->error;
@@ -2641,7 +2641,7 @@ class CommandeFournisseur extends CommonOrder
$sql .= ", ".price2num($comclient->lines[$i]->qty, 'MS').", ".price2num($comclient->lines[$i]->tva_tx, 5).", ".price2num($comclient->lines[$i]->localtax1_tx, 5).", ".price2num($comclient->lines[$i]->localtax2_tx, 5).", ".price2num($comclient->lines[$i]->remise_percent, 3);
$sql .= ", '".price2num($comclient->lines[$i]->subprice, 'MT')."','0', '".$this->db->escape($ref)."');";
if ($this->db->query($sql)) {
- $this->update_price();
+ $this->update_price(1);
}
}
@@ -2894,7 +2894,7 @@ class CommandeFournisseur extends CommonOrder
// Mise a jour info denormalisees au niveau facture
if ($result >= 0) {
- $this->update_price('', 'auto');
+ $this->update_price('1', 'auto');
$this->db->commit();
return $result;
} else {
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 3f7013fec34..2f607ad75cf 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -809,7 +809,7 @@ class FactureFournisseur extends CommonInvoice
// Update total price
- $result = $this->update_price();
+ $result = $this->update_price(1);
if ($result > 0) {
// Actions on extra fields
if (!$error) {
@@ -2425,7 +2425,7 @@ class FactureFournisseur extends CommonInvoice
$this->errors[] = $line->error;
} else {
// Update total price into invoice record
- $res = $this->update_price('', 'auto', 0, $this->thirdparty);
+ $res = $this->update_price('1', 'auto', 0, $this->thirdparty);
}
return $res;
@@ -2472,7 +2472,7 @@ class FactureFournisseur extends CommonInvoice
$this->db->rollback();
return -3;
} else {
- $res = $this->update_price();
+ $res = $this->update_price(1);
if ($res > 0) {
$this->db->commit();
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 5dbe81ca4a4..f559c31a89f 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -413,13 +413,13 @@ if (empty($reshook)) {
// Add a product line
if ($action == 'addline' && GETPOST('submitforalllines', 'aZ09') && GETPOST('vatforalllines', 'alpha') && $usercancreate) {
- // Define vat_rate
+ // Define new vat_rate for all lines
$vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0);
$vat_rate = str_replace('*', '', $vat_rate);
$localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty, $mysoc);
$localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty, $mysoc);
foreach ($object->lines as $line) {
- $result = $object->updateline($line->id, $line->desc, $line->subprice, $line->qty, $line->remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $line->info_bits, $line->product_type, 0, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
+ $result = $object->updateline($line->id, $line->desc, $line->subprice, $line->qty, $line->remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $line->info_bits, $line->product_type, 0, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice, $line->ref_supplier);
}
} elseif ($action == 'addline' && $usercancreate) {
$db->begin();
@@ -1698,7 +1698,7 @@ if ($action == 'create') {
print $societe->getNomUrl(1, 'supplier');
print ' ';
} else {
- print img_picto('', 'company').$form->select_company((empty($socid) ? '' : $socid), 'socid', 's.fournisseur=1', 'SelectThirdParty', 1, 0, null, 0, 'minwidth175 maxwidth500 widthcentpercentminusxx');
+ print img_picto('', 'company').$form->select_company((empty($socid) ? '' : $socid), 'socid', '(s.fournisseur=1 AND s.status=1)', 'SelectThirdParty', 1, 0, null, 0, 'minwidth175 maxwidth500 widthcentpercentminusxx');
// reload page to retrieve customer informations
if (!empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE)) {
print '
diff --git a/htdocs/install/doctemplates/websites/website_template-restaurant/containers/index.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/index.php
index dc10e0099f4..08ce45517af 100644
--- a/htdocs/install/doctemplates/websites/website_template-restaurant/containers/index.php
+++ b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/index.php
@@ -1,11 +1,5 @@
ref.'/page250.tpl.php';
+?>
diff --git a/htdocs/install/doctemplates/websites/website_template-restaurant/containers/javascript.js.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/javascript.js.php
index f58102cf00b..fe1f15266af 100644
--- a/htdocs/install/doctemplates/websites/website_template-restaurant/containers/javascript.js.php
+++ b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/javascript.js.php
@@ -8,6 +8,7 @@ header('Cache-Control: max-age=3600, public, must-revalidate');
header('Content-type: application/javascript');
// END PHP ?>
/* JS content (all pages) */
+// test
diff --git a/htdocs/install/doctemplates/websites/website_template-restaurant/containers/menu.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/menu.php
index 7e4cd71a69d..57315e4da18 100644
--- a/htdocs/install/doctemplates/websites/website_template-restaurant/containers/menu.php
+++ b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/menu.php
@@ -1,5 +1,5 @@
ref.'/page172.tpl.php';
+if (empty($dolibarr_main_data_root)) require './page251.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page251.tpl.php';
?>
diff --git a/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page169.tpl.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page169.tpl.php
deleted file mode 100644
index a592c302c73..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page169.tpl.php
+++ /dev/null
@@ -1,198 +0,0 @@
-
-
-
-About us
-
-
-
-
-
-
-
-
-
-use_manifest) { print ' '."\n"; } ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Team Members
-
-
-
-
-
-
-
-
Sophia
-
-
CEO & Founder
-
-
-
-
-
-
-
-
-
Benjamin W.
-
-
Restaurant Manager
-
-
-
-
-
-
-
-
Muchen Jack
-
-
Senior Chef
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page172.tpl.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page172.tpl.php
deleted file mode 100644
index cf759e644a8..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page172.tpl.php
+++ /dev/null
@@ -1,597 +0,0 @@
-
-
-
-Our menus
-
-
-
-
-
-
-
-
-
-use_manifest) { print ' '."\n"; } ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page248.tpl.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page248.tpl.php
new file mode 100644
index 00000000000..9acf79aaec9
--- /dev/null
+++ b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page248.tpl.php
@@ -0,0 +1,113 @@
+
+
+
+About us
+
+
+
+
+
+
+
+
+
+use_manifest) { print ' '."\n"; } ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Team Members
+
+
+
+
+
+
+
+
Sophia
+
+
CEO & Founder
+
+
+
+
+
+
+
+
+
Benjamin W.
+
+
Restaurant Manager
+
+
+
+
+
+
+
+
Muchen Jack
+
+
Senior Chef
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page170.tpl.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page249.tpl.php
similarity index 70%
rename from htdocs/install/doctemplates/websites/website_template-restaurant/containers/page170.tpl.php
rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/page249.tpl.php
index c444ce1292d..8742e231c27 100644
--- a/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page170.tpl.php
+++ b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page249.tpl.php
@@ -18,8 +18,8 @@ ob_start();
-
-
+
+
use_manifest) { print ' '."\n"; } ?>
@@ -34,7 +34,7 @@ ob_start();
email;
@@ -51,67 +51,12 @@ ob_start();
}
}
?>
+
+
+
+