diff --git a/ChangeLog b/ChangeLog
index 3b81e0555d5..bcbfb1a959c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,83 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
+***** ChangeLog for 11.0.4 compared to 11.0.3 *****
+FIX: #13749
+FIX: #7594 Expense report multi pagebreak
+FIX: Access to undeclared static property: Contact::$table_element
+FIX: actions on supplier proposal not saved (bad trigger name)
+FIX: Add function "completeTabsHead" to "addreplace" type hook.
+FIX: All forms must use newToken()
+FIX: Another "Access to undeclared static property: Contact::$table_element" && "Societe::$table_element"
+FIX: author search supplier proposal list
+FIX: A variable was erased by a temporary variable
+FIX: Avoid infinite loop when a fetch is inside a compute field.
+FIX: Backto link
+FIX: Bad position of total in column
+FIX: bad value in currency into discount created from down payment
+FIX: buyprice extrafield langfile and tooltip
+FIX: Buyprice was updated only if min price for this qty had same qty
+FIX: Can switch from double to price type for extrafields
+FIX: Can use decimal value in virtual products
+FIX: child categories only with good entity rights
+FIX: cloning of emailing when no content selected
+FIX: closing tags
+FIX: Combo list of available users to filter on the list of leaves.
+FIX: Compatibility with multicompany, bad numerotation of task.
+FIX: consistency of price w/wo vat wrong when price entered with tax
+FIX: default value of selectMasssAction broken
+FIX: draftordered replenish virtual stock
+FIX: Error update SQL into stock reception
+FIX: expensereport status in generated pdf
+FIX: extra date field incorrect check
+FIX: Extrafields of type price must be '' and not '0' if not defined
+FIX: Foreign currency lost when splitting a discount
+FIX: get remain to pay with rounding decimals
+FIX: gzip and bzip2 must use option -f
+FIX: IHM, unexpected quote
+FIX: keep viewstatut for doli 3.5
+FIX: Link missing into email of some notification
+FIX: Look and feel v11
+FIX: md stylesheet to be included by external modules like eldy
+FIX: missing array option
+FIX: missing default accountancy product buy code
+FIX: missing fk_bank during export of suppliers invoices
+FIX: missing member entity
+FIX: missing selectedlines on supplier order but checkbox are displayed
+FIX: Missing token and take into account max date when it can.
+FIX: model export list must be sorted by label
+FIX: multicurrency manage on hidden conf SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL
+FIX: Must escape shell
+FIX: Must exclude logs and some dirs for compressed backup
+FIX: ordered stock already in $stock
+FIX: picture migration script from doli 9.0
+FIX: print pictures on shipment docs
+FIX: product get purchase prices
+FIX: product purchase prices
+FIX: Protection when database has a corrupted product id
+FIX: remove unused var, $usercancreate can be change by Multicompany
+FIX: replenish stock to buy
+FIX: Sanitizing menu parameter
+FIX: Send email from bulk action of list of thirdparties
+FIX: setup of suggested payment mode on proposals and orders
+FIX: Several pb in export of documents
+FIX: Situation invoice take into account the credit notes.
+FIX: some others modules (like subtotal) use other product_type than 0 or 1 AND must not be considered in this report
+FIX: sort by default role makes no sense
+FIX: sort on company on member list
+FIX: TakePOS buying price
+FIX: text version of html emailing (removed the body style)
+FIX: The "test smtp connectivity" failed on page to setup mass emailing
+FIX: Error logs an Orderline::delete error, but this is an Orderline::insert error
+FIX: Translation of tooltips of extrafields
+FIX: Use getNomURL instead of hard coded link. Fix limit.
+FIX: Use of image into free text for PDF if DOL_DATA_DIR is outside of
+FIX: viewstatut to search status
+FIX: we must export company mail address on contact vcard only if contact email address is empty
+FIX: when we filter a list on a view status, we want this filter to be on bookmark that we create
+FIX: Wrong Sql on getListOfTowns api method
+FIX: wrong user right's name to top menu "commercial"
+FIX: XSS Vulnerability
***** ChangeLog for 11.0.3 compared to 11.0.2 *****
FIX: unit price for selected supplier products not set. NaN was used.
diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl
index c6b8cd330c8..933c5b8f994 100755
--- a/build/makepack-dolibarr.pl
+++ b/build/makepack-dolibarr.pl
@@ -19,7 +19,7 @@ use Term::ANSIColor;
# Change this to defined target for option 98 and 99
$PROJECT="dolibarr";
$PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
-$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
+$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/asso.dolibarr.org/dolibarr_documents/website/www.dolibarr.org/files";
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index d8fe9975da5..129fedf3867 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -966,7 +966,7 @@ while ($i < min($num, $limit))
}
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index c9b7ee42fcf..838e7cd9a5c 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -872,7 +872,7 @@ while ($i < min($num, $limit))
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php
index a582584ae7f..fa47d01cd41 100644
--- a/htdocs/adherents/subscription/list.php
+++ b/htdocs/adherents/subscription/list.php
@@ -524,7 +524,7 @@ while ($i < min($num, $limit))
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php
index 53d9fd8d1f1..9c76c176414 100644
--- a/htdocs/admin/emailcollector_list.php
+++ b/htdocs/admin/emailcollector_list.php
@@ -479,7 +479,7 @@ while ($i < min($num, $limit))
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php
index e5f6dae4852..6bbaeb7c6c8 100644
--- a/htdocs/admin/tools/dolibarr_export.php
+++ b/htdocs/admin/tools/dolibarr_export.php
@@ -200,7 +200,6 @@ if (in_array($type, array('mysql', 'mysqli'))) {
print '
';
print '';
print '';
-
print '
';
if (! empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) {
diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php
index 26f83f36fd6..46431cdb510 100644
--- a/htdocs/api/class/api.class.php
+++ b/htdocs/api/class/api.class.php
@@ -137,6 +137,15 @@ class DolibarrApi
unset($object->labelStatus);
unset($object->labelStatusShort);
+ unset($object->stats_propale);
+ unset($object->stats_commande);
+ unset($object->stats_contrat);
+ unset($object->stats_facture);
+ unset($object->stats_commande_fournisseur);
+ unset($object->stats_reception);
+ unset($object->stats_mrptoconsume);
+ unset($object->stats_mrptoproduce);
+
unset($object->element);
unset($object->fk_element);
unset($object->table_element);
diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php
index fb8c4066a10..ae307bf1a42 100644
--- a/htdocs/asset/list.php
+++ b/htdocs/asset/list.php
@@ -459,7 +459,7 @@ while ($i < min($num, $limit))
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php
index 95a3e6dbe09..410d31fb07e 100644
--- a/htdocs/comm/action/list.php
+++ b/htdocs/comm/action/list.php
@@ -718,7 +718,7 @@ if ($resql)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php
index da1775955b7..6987a27dacd 100644
--- a/htdocs/comm/mailing/class/advtargetemailing.class.php
+++ b/htdocs/comm/mailing/class/advtargetemailing.class.php
@@ -615,7 +615,8 @@ class AdvanceTargetingMailing extends CommonObject
//Standard Extrafield feature
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
- $elementtype = Societe::$table_element;
+ $socstatic = new Societe($this->db);
+ $elementtype = $socstatic->table_element;
$extrafields->fetch_name_optionals_label($elementtype);
@@ -752,7 +753,8 @@ class AdvanceTargetingMailing extends CommonObject
//Standard Extrafield feature
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
- $elementtype = Contact::$table_element;
+ $contactstatic = new Contact($this->db);
+ $elementtype = $contactstatic->table_element;
// fetch optionals attributes and labels
dol_include_once('/core/class/extrafields.class.php');
@@ -854,7 +856,8 @@ class AdvanceTargetingMailing extends CommonObject
//Standard Extrafield feature
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
- $elementtype = Societe::$table_element;
+ $socstatic = new Societe($this->db);
+ $elementtype = $socstatic->table_element;
// fetch optionals attributes and labels
dol_include_once('/core/class/extrafields.class.php');
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 409a1924b70..0962fcd63b6 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -2992,8 +2992,11 @@ class Propal extends CommonObject
if (!$error)
{
+ $main = MAIN_DB_PREFIX . 'propaldet';
+ $ef = $main . "_extrafields";
+ $sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_propal = " . $this->id . ")";
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal = ".$this->id;
- if ($this->db->query($sql))
+ if ($this->db->query($sqlef) && $this->db->query($sql))
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propal WHERE rowid = ".$this->id;
if ($this->db->query($sql))
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index dcc9c7a54c7..eaeea9e3d43 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -1065,7 +1065,7 @@ if ($resql)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 52dfde785a4..54506a4a816 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -3396,6 +3396,19 @@ class Commande extends CommonOrder
$error++;
}
+ if (!$error)
+ {
+ // Delete extrafields of order details
+ $main = MAIN_DB_PREFIX . 'commandedet';
+ $ef = $main . "_extrafields";
+ $sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_commande = " . $this->id . ")";
+ if (!$this->db->query($sql))
+ {
+ $error++;
+ $this->errors[] = $this->db->lasterror();
+ }
+ }
+
if (!$error)
{
// Delete order details
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index e2b6aa06136..8a023cf7e80 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -1075,7 +1075,7 @@ if ($resql)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php
index b8e10e7d0e3..83f735c1eeb 100644
--- a/htdocs/compta/accounting-files.php
+++ b/htdocs/compta/accounting-files.php
@@ -23,7 +23,7 @@
* \brief Page to show portoflio and files of a thirdparty and download it
*/
-if ($_GET['action'] == 'dl' || $_POST['action'] == 'dl') { // To not replace token when downloading file
+if ((array_key_exists('action', $_GET) && $_GET['action'] == 'dl') || (array_key_exists('action', $_POST) && $_POST['action'] == 'dl')) { // To not replace token when downloading file
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
}
diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php
index e0d7f7d5c29..ac2caaf94eb 100644
--- a/htdocs/compta/bank/list.php
+++ b/htdocs/compta/bank/list.php
@@ -529,7 +529,7 @@ foreach ($accounts as $key=>$type)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters=array('arrayfields'=>$arrayfields);
+ $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $objecttmp); // Note that $action and $objecttmpect may have been modified by hook
print $hookmanager->resPrint;
// Date creation
diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php
index 6c59276d600..c13528224c4 100644
--- a/htdocs/compta/cashcontrol/cashcontrol_list.php
+++ b/htdocs/compta/cashcontrol/cashcontrol_list.php
@@ -496,7 +496,7 @@ while ($i < min($num, $limit))
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 03ef9ac03a5..6f214d5d2eb 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -1713,6 +1713,8 @@ if (empty($reshook))
if (!empty($origin) && !empty($originid))
{
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
+
$object->origin = $origin;
$object->origin_id = $originid;
@@ -1724,6 +1726,17 @@ if (empty($reshook))
$line->fetch_optionals($line->id);
$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note
+ // The $line->situation_percent has been modified, so we must recalculate all amounts
+ $tabprice = calcul_price_total($line->qty, $line->subprice, $line->remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 0, 'HT', 0, $line->product_type, $mysoc, '', $line->situation_percent);
+ $line->total_ht = $tabprice[0];
+ $line->total_tva = $tabprice[1];
+ $line->total_ttc = $tabprice[2];
+ $line->total_localtax1 = $tabprice[9];
+ $line->total_localtax2 = $tabprice[10];
+ $line->multicurrency_total_ht = $tabprice[16];
+ $line->multicurrency_total_tva = $tabprice[17];
+ $line->multicurrency_total_ttc = $tabprice[18];
+
// Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée
if ($line->fk_remise_except)
{
@@ -1768,6 +1781,7 @@ if (empty($reshook))
{
$nextSituationInvoice = new Facture($db);
$nextSituationInvoice->fetch($id);
+
// create extrafields with data from create form
$extrafields->fetch_name_optionals_label($nextSituationInvoice->table_element);
$ret = $extrafields->setOptionalsFromPost(null, $nextSituationInvoice);
@@ -4534,7 +4548,7 @@ elseif ($id > 0 || !empty($ref))
$current_situation_counter = array();
foreach ($object->tab_previous_situation_invoice as $prev_invoice) {
- $totalpaye_prev = $prev_invoice->getSommePaiement();
+ $tmptotalpaidforthisinvoice = $prev_invoice->getSommePaiement();
$total_prev_ht += $prev_invoice->total_ht;
$total_prev_ttc += $prev_invoice->total_ttc;
$current_situation_counter[] = (($prev_invoice->type == Facture::TYPE_CREDIT_NOTE) ?-1 : 1) * $prev_invoice->situation_counter;
@@ -4545,7 +4559,7 @@ elseif ($id > 0 || !empty($ref))
if (!empty($conf->banque->enabled)) print '
';
print '';
if ($object->statut == Holiday::STATUS_REFUSED)
diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php
index 2361edf8a27..18df214f4c6 100644
--- a/htdocs/holiday/list.php
+++ b/htdocs/holiday/list.php
@@ -1,9 +1,9 @@
- * Copyright (C) 2013-2018 Laurent Destailleur
+ * Copyright (C) 2013-2020 Laurent Destailleur
* Copyright (C) 2012-2016 Regis Houssin
* Copyright (C) 2018 Charlene Benke
- * Copyright (C) 2019 Frédéric France
+ * Copyright (C) 2019 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
@@ -476,7 +476,7 @@ if ($resql)
$include = '';
- if (!empty($user->rights->holiday->read_all)) $include = 'hierarchyme'; // Can see all
+ if (empty($user->rights->holiday->read_all)) $include = 'hierarchyme'; // Can see only its hierarchyl
print '
';
print '
'."\n";
@@ -488,7 +488,7 @@ if ($resql)
if (!empty($arrayfields['cp.ref']['checked']))
{
print '
';
- print '';
+ print '';
print '
';
}
@@ -744,7 +744,7 @@ if ($resql)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index e2c03545124..00e6279349b 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -427,7 +427,7 @@ ExtrafieldCheckBox=Checkboxes
ExtrafieldCheckBoxFromList=Checkboxes from table
ExtrafieldLink=Link to an object
ComputedFormula=Computed field
-ComputedFormulaDesc=You can enter here a formula using other properties of object or any PHP coding to get a dynamic computed value. You can use any PHP compatible formulas including the "?" condition operator, and following global object: $db, $conf, $langs, $mysoc, $user, $object. WARNING: Only some properties of $object may be available. If you need a properties not loaded, just fetch yourself the object into your formula like in the second example. Using a computed field means you can't enter yourself any value from interface. Also, if there is a syntax error, the formula may return nothing.
Example to reload object (($reloadedobj = new Societe($db)) && ($reloadedobj->fetch($obj->id ? $obj->id: ($obj->rowid ? $obj->rowid: $object->id)) > 0)) ? $reloadedobj->array_options['options_extrafieldkey'] * $reloadedobj->capital / 5: '-1'
Other example of formula to force load of object and its parent object: (($reloadedobj = new Task($db)) && ($reloadedobj->fetch($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetch($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref: 'Parent project not found'
+ComputedFormulaDesc=You can enter here a formula using other properties of object or any PHP coding to get a dynamic computed value. You can use any PHP compatible formulas including the "?" condition operator, and following global object: $db, $conf, $langs, $mysoc, $user, $object. WARNING: Only some properties of $object may be available. If you need a properties not loaded, just fetch yourself the object into your formula like in the second example. Using a computed field means you can't enter yourself any value from interface. Also, if there is a syntax error, the formula may return nothing.
Example to reload object (($reloadedobj = new Societe($db)) && ($reloadedobj->fetchNoCompute($obj->id ? $obj->id: ($obj->rowid ? $obj->rowid: $object->id)) > 0)) ? $reloadedobj->array_options['options_extrafieldkey'] * $reloadedobj->capital / 5: '-1'
Other example of formula to force load of object and its parent object: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref: 'Parent project not found'
Computedpersistent=Store computed field
ComputedpersistentDesc=Computed extra fields will be stored in the database, however, the value will only be recalculated when the object of this field is changed. If the computed field depends on other objects or global data this value might be wrong!!
ExtrafieldParamHelpPassword=Leaving this field blank means this value will be stored without encryption (field must be only hidden with star on screen). Set 'auto' to use the default encryption rule to save password into database (then value read will be the hash only, no way to retrieve original value)
diff --git a/htdocs/langs/es_AR/main.lang b/htdocs/langs/es_AR/main.lang
index 1451ea1c508..a48f7399746 100644
--- a/htdocs/langs/es_AR/main.lang
+++ b/htdocs/langs/es_AR/main.lang
@@ -1,6 +1,6 @@
# Dolibarr language file - Source file is en_US - main
DIRECTION=ltr
-FONTFORPDF=helvética
+FONTFORPDF=helvetica
FONTSIZEFORPDF=10
SeparatorDecimal=.
SeparatorThousand=,
diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php
index 9e7b8f2565a..3e96a33c931 100644
--- a/htdocs/loan/card.php
+++ b/htdocs/loan/card.php
@@ -475,7 +475,7 @@ if ($id > 0)
print '
';
print '';
- print '
';
+ print '
';
// Capital
if ($action == 'edit')
diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php
index 0cf6b344abf..b1fee0177d6 100644
--- a/htdocs/product/class/api_products.class.php
+++ b/htdocs/product/class/api_products.class.php
@@ -669,8 +669,6 @@ class Products extends DolibarrApi
}
/**
- * List purchase prices
- *
* Get a list of all purchase prices of products
*
* @param string $sortfield Sort field
@@ -702,11 +700,11 @@ class Products extends DolibarrApi
if ($supplier > 0) {
$sql .= " AND s.fk_soc = ".$db->escape($supplier);
}
- $sql .= " AND s.fk_product = t.rowid ";
+ $sql .= " AND s.fk_product = t.rowid";
// Select products of given category
if ($category > 0) {
$sql .= " AND c.fk_categorie = ".$db->escape($category);
- $sql .= " AND c.fk_product = t.rowid ";
+ $sql .= " AND c.fk_product = t.rowid";
}
if ($mode == 1) {
// Show only products
@@ -739,10 +737,15 @@ class Products extends DolibarrApi
while ($i < $min)
{
$obj = $db->fetch_object($result);
- $product_static = new Product($db);
- if ($product_static->fetch($obj->rowid)) {
- $obj_ret[] = $this->_cleanObjectDatas($product_static);
+
+ $product_fourn = new ProductFournisseur($this->db);
+ $product_fourn_list = $product_fourn->list_product_fournisseur_price($obj->rowid, '', '', 0, 0);
+ foreach($product_fourn_list as $tmpobj) {
+ $this->_cleanObjectDatas($tmpobj);
}
+ //var_dump($product_fourn_list->db);exit;
+ $obj_ret[$obj->rowid] = $product_fourn_list;
+
$i++;
}
}
@@ -1527,6 +1530,7 @@ class Products extends DolibarrApi
unset($object->prices_by_qty_id);
unset($object->libelle);
unset($object->product_id_already_linked);
+ unset($object->reputations);
unset($object->name);
unset($object->firstname);
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index ce3f8f1cd81..cc12bc73349 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -1148,7 +1148,7 @@ if ($resql)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php
index e0266172463..1702c4beecc 100644
--- a/htdocs/product/stock/class/mouvementstock.class.php
+++ b/htdocs/product/stock/class/mouvementstock.class.php
@@ -515,6 +515,8 @@ class MouvementStock extends CommonObject
// Update PMP and denormalized value of stock qty at product level
if (! $error)
{
+ $newpmp = price2num($newpmp, 'MU');
+
// $sql = "UPDATE ".MAIN_DB_PREFIX."product SET pmp = ".$newpmp.", stock = ".$this->db->ifsql("stock IS NULL", 0, "stock") . " + ".$qty;
// $sql.= " WHERE rowid = ".$fk_product;
// Update pmp + denormalized fields because we change content of produt_stock. Warning: Do not use "SET p.stock", does not works with pgsql
diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php
index e4ad265c793..057735c49cc 100644
--- a/htdocs/product/stock/list.php
+++ b/htdocs/product/stock/list.php
@@ -571,7 +571,7 @@ if ($num)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php
index 527afee2607..154ede71956 100644
--- a/htdocs/product/stock/productlot_list.php
+++ b/htdocs/product/stock/productlot_list.php
@@ -476,7 +476,7 @@ if ($resql)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 650c14c5ee2..f3a8900a148 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -895,7 +895,7 @@ while ($i < min($num, $limit))
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php
index 3fd85f4082e..7d995965294 100644
--- a/htdocs/projet/tasks/list.php
+++ b/htdocs/projet/tasks/list.php
@@ -836,7 +836,7 @@ while ($i < min($num, $limit))
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index f9069f7efa7..3a5e3c89ae3 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -1332,7 +1332,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
*/
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$task_time);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$task_time, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php
index 5552d45380e..ce718fda964 100644
--- a/htdocs/reception/class/reception.class.php
+++ b/htdocs/reception/class/reception.class.php
@@ -763,8 +763,13 @@ class Reception extends CommonObject
}
// extrafields
+ $line->array_options = $supplierorderline->array_options;
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0) // For avoid conflicts if trigger used
- $line->array_options = $array_options;
+ {
+ foreach ($array_options as $key => $value) {
+ $line->array_options[$key] = $value;
+ }
+ }
$line->fk_product = $fk_product;
$line->fk_commande = $supplierorderline->fk_commande;
@@ -938,10 +943,14 @@ class Reception extends CommonObject
if (!$error)
{
+ $main = MAIN_DB_PREFIX . 'commande_fournisseur_dispatch';
+ $ef = $main . "_extrafields";
+ $sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_reception = " . $this->id . ")";
+
$sql = "DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch";
$sql .= " WHERE fk_reception = ".$this->id;
- if ($this->db->query($sql))
+ if ($this->db->query($sqlef) && $this->db->query($sql))
{
// Delete linked object
$res = $this->deleteObjectLinked();
diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php
index fea2662b93f..7566edfc610 100644
--- a/htdocs/reception/list.php
+++ b/htdocs/reception/list.php
@@ -885,7 +885,7 @@ if ($resql)
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index e480d68eca4..4e033e5f35e 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -1279,7 +1279,7 @@ while ($i < min($num, $limit))
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php
index 5d248ec16fd..d5e89459771 100644
--- a/htdocs/societe/website.php
+++ b/htdocs/societe/website.php
@@ -481,7 +481,7 @@ while ($i < min($num, $limit))
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objectwebsiteaccount); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index 7fdd5466cd5..d292ebe13bf 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -2061,11 +2061,14 @@ class SupplierProposal extends CommonObject
if (! $error)
{
+ $main = MAIN_DB_PREFIX . 'supplier_proposaldet';
+ $ef = $main . "_extrafields";
+ $sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_supplier_proposal = " . $this->id . ")";
$sql = "DELETE FROM ".MAIN_DB_PREFIX."supplier_proposaldet WHERE fk_supplier_proposal = ".$this->id;
if ($this->db->query($sql))
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."supplier_proposal WHERE rowid = ".$this->id;
- if ($this->db->query($sql))
+ if ($this->db->query($sqlef) && $this->db->query($sql))
{
// Delete linked object
$res = $this->deleteObjectLinked();
diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php
index a133d781337..91ef70c7b94 100644
--- a/htdocs/supplier_proposal/list.php
+++ b/htdocs/supplier_proposal/list.php
@@ -779,7 +779,7 @@ if ($resql)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
diff --git a/htdocs/theme/md/manifest.json.php b/htdocs/theme/md/manifest.json.php
new file mode 100644
index 00000000000..f8d059752a6
--- /dev/null
+++ b/htdocs/theme/md/manifest.json.php
@@ -0,0 +1,57 @@
+
+ * Copyright (C) 2006 Rodolphe Quiedeville
+ * Copyright (C) 2007-2017 Regis Houssin
+ * Copyright (C) 2011 Philippe Grand
+ * Copyright (C) 2012 Juanjo Menent
+ * Copyright (C) 2018 Ferran Marcet
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FI8TNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * \file htdocs/theme/md/manifest.json.php
+ * \brief File for The Web App
+ */
+
+if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1');
+if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1');
+if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
+if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
+if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
+if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
+if (! defined('NOLOGIN')) define('NOLOGIN', '1');
+if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
+if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
+if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
+
+require_once __DIR__.'/../../main.inc.php';
+
+$appli=constant('DOL_APPLICATION_TITLE');
+if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE;
+
+?>
+{
+ "name": "",
+ "icons": [
+ {
+ "src": "",
+ "sizes": "256x256",
+ "type": "image/png"
+ }
+ ],
+ "theme_color": "#ffffff",
+ "background_color": "#ffffff",
+ "display": "standalone"
+}
\ No newline at end of file
diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php
index 8d76ef5c5eb..08419e5c46d 100644
--- a/htdocs/ticket/list.php
+++ b/htdocs/ticket/list.php
@@ -669,7 +669,7 @@ while ($i < min($num, $limit))
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
diff --git a/htdocs/user/list.php b/htdocs/user/list.php
index eb14f61e982..1ceec68a622 100644
--- a/htdocs/user/list.php
+++ b/htdocs/user/list.php
@@ -655,7 +655,7 @@ while ($i < min($num, $limit))
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
diff --git a/htdocs/zapier/hook_list.php b/htdocs/zapier/hook_list.php
index 56a68ad7300..dbd9239e752 100644
--- a/htdocs/zapier/hook_list.php
+++ b/htdocs/zapier/hook_list.php
@@ -519,7 +519,7 @@ while ($i < min($num, $limit)) {
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column