From 3295498e9e49b3f67d6bf5453ebc93ab335e76ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Sep 2017 12:50:34 +0200 Subject: [PATCH 01/11] Remove code comment --- htdocs/product/index.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index cd1c9a4883b..3568cd4a492 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -367,7 +367,6 @@ function activitytrim($product_type) $result = $db->query($sql); if ($result) { - //$tmpyear=$beginyear; // FIXME $beginyear is not defined $tmpyear=0; $trim1=0; $trim2=0; From e61bcd03ed86879044e4631e15242602d7501128 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Sep 2017 13:03:27 +0200 Subject: [PATCH 02/11] Fix travis --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7cb9db632ad..8ae2e95f0c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -126,10 +126,10 @@ before_script: echo "Set timezone" echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then - echo - echo "Enabling APC for PHP <= 5.4" + #echo + #echo "Enabling APC for PHP <= 5.4" # Documentation says it should be available for PHP <= 5.6 but it's not for 5.5 and 5.6! - echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini + #echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini echo echo "Enabling Memcached for PHP <= 5.4" # Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0 and nightly! From 8893d8d59fcf08637e9465d5f3b0a4c3a0c6590d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Nov 2018 11:56:23 +0100 Subject: [PATCH 03/11] Fix compatiblity with new version of PHP --- htdocs/exports/class/export.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 7ab55fd4e53..8e3e3b04767 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -131,11 +131,11 @@ class Export //print_r("$perm[0]-$perm[1]-$perm[2]
"); if (! empty($perm[2])) { - $bool=$user->rights->$perm[0]->$perm[1]->$perm[2]; + $bool=$user->rights->{$perm[0]}->{$perm[1]}->{$perm[2]}; } else { - $bool=$user->rights->$perm[0]->$perm[1]; + $bool=$user->rights->{$perm[0]}->{$perm[1]}; } if ($perm[0]=='user' && $user->admin) $bool=true; if (! $bool) break; From 5eb897e049748930273ab2e32c8f38d9d706ef69 Mon Sep 17 00:00:00 2001 From: tarrsalah Date: Mon, 12 Nov 2018 12:11:40 +0100 Subject: [PATCH 04/11] FIX sql query performance on list_qualified_avoir_supplier_invoices. --- htdocs/fourn/class/fournisseur.facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index bbf5694fc2c..2d241ad6dcb 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1809,10 +1809,10 @@ class FactureFournisseur extends CommonInvoice $sql = "SELECT f.rowid as rowid, f.ref, f.fk_statut, f.type, f.paye, pf.fk_paiementfourn"; $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf ON f.rowid = pf.fk_facturefourn"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as ff ON (f.rowid = ff.fk_facture_source AND ff.type=".self::TYPE_REPLACEMENT.")"; $sql.= " WHERE f.entity = ".$conf->entity; $sql.= " AND f.fk_statut in (".self::STATUS_VALIDATED.",".self::STATUS_CLOSED.")"; - $sql.= " AND ff.type IS NULL"; // Renvoi vrai si pas facture de remplacement + $sql.= " AND NOT EXISTS (SELECT rowid from ".MAIN_DB_PREFIX."facture_fourn as ff WHERE f.rowid = ff.fk_facture_source"; + $sql.= " AND ff.type=".self::TYPE_REPLACEMENT.")"; $sql.= " AND f.type != ".self::TYPE_CREDIT_NOTE; // Type non 2 si facture non avoir if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid; $sql.= " ORDER BY f.ref"; From 66ea8bbe87ebe6763b7a660cfdcda8ef1dd22eea Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 12 Nov 2018 15:58:41 +0100 Subject: [PATCH 05/11] FIX : fourn payment modes musn't be available on customer docs --- htdocs/comm/propal/card.php | 2 +- htdocs/commande/card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index c9f534820fb..49d54dd63f8 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2045,7 +2045,7 @@ if ($action == 'create') print ''; print ''; if ($action == 'editmode') { - $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id'); + $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT'); } else { $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none'); } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 27fc1821a03..da7855b961b 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2196,7 +2196,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; print ''; if ($action == 'editmode') { - $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id'); + $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT'); } else { $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none'); } From f404cae54609388431cb3925927b9756df2c604f Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 12 Nov 2018 16:04:42 +0100 Subject: [PATCH 06/11] FIX : Same on customer card --- htdocs/comm/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 2495d512c55..99fdc6dde76 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -326,7 +326,7 @@ if ($id > 0) print ''; if ($action == 'editmode') { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'mode_reglement_id'); + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'mode_reglement_id', 'CRDT'); } else { From 85dd0ec2ddd016283d54c7b8bf03b818647e9eaf Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 13 Nov 2018 15:24:53 +0100 Subject: [PATCH 07/11] FIX : filter on product category doesn't work --- htdocs/fourn/commande/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 8449181907c..732e408d66e 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -525,6 +525,7 @@ if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); if ($search_company) $sql .= natural_search('s.nom', $search_company); if ($search_request_author) $sql.=natural_search(array('u.lastname','u.firstname','u.login'), $search_request_author) ; if ($search_billed != '' && $search_billed >= 0) $sql .= " AND cf.billed = ".$db->escape($search_billed); +if ($search_product_category > 0) $sql.= " AND cp.fk_categorie = ".$search_product_category; //Required triple check because statut=0 means draft filter if (GETPOST('statut', 'intcomma') !== '') From 30b1db34cd01a5157ec88e348a83ac144e34c6a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 17 Nov 2018 11:33:01 +0100 Subject: [PATCH 08/11] Update CMailFile.class.php --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index bb38563837a..b4c21af8cad 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -493,7 +493,7 @@ class CMailFile if (! empty($addr_cc)) $this->message->setCc($this->getArrayAddress($addr_cc)); if (! empty($addr_bcc)) $this->message->setBcc($this->getArrayAddress($addr_bcc)); //if (! empty($errors_to)) $this->message->setErrorsTo($this->getArrayAddress($errors_to); - if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($from)); + if (isset($deliveryreceipt) && $deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($from)); } else { From dc2f1e9812a3a4bb0b2aebef2ca4068e0eefa816 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 19 Nov 2018 11:25:48 +0100 Subject: [PATCH 09/11] fix list agenda extrafield visibility --- htdocs/comm/action/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 51b9c5b43bb..ed2ce1340c7 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -136,7 +136,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab { foreach($extrafields->attribute_label as $key => $val) { - $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); + if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); } } From ecdfa5219bc04c3db5a408a6ee46dd129cbce042 Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 19 Nov 2018 17:31:45 +0100 Subject: [PATCH 10/11] FIX : We want to be able to send PDF of paid invoices --- htdocs/core/actions_massactions.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index b7bbc402b09..500bf1c19b8 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -175,12 +175,12 @@ if (! $error && $massaction == 'confirm_presend') { //var_dump($thirdpartyid.' - '.$objectid.' - '.$object->statut); - if ($objectclass == 'Facture' && $object->statut != Facture::STATUS_VALIDATED) + if ($objectclass == 'Facture' && $object->statut == Facture::STATUS_DRAFT) { $langs->load("errors"); $nbignored++; $resaction.='
'.$langs->trans('ErrorOnlyInvoiceValidatedCanBeSentInMassAction',$object->ref).'

'; - continue; // Payment done or started or canceled + continue; } if ($objectclass == 'Commande' && $object->statut == Commande::STATUS_DRAFT) { From 322ce410d782a7b280810ab2a32990c5999035e6 Mon Sep 17 00:00:00 2001 From: fappels Date: Fri, 23 Nov 2018 09:42:43 +0100 Subject: [PATCH 11/11] Add missing paid field in fetch sql --- htdocs/expensereport/class/expensereport.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index c6debbe60ff..6feb2225cca 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -456,7 +456,7 @@ class ExpenseReport extends CommonObject $sql.= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve,"; // DATES (datetime) $sql.= " d.fk_user_author, d.fk_user_modif, d.fk_user_validator,"; $sql.= " d.fk_user_valid, d.fk_user_approve,"; - $sql.= " d.fk_statut as status, d.fk_c_paiement,"; + $sql.= " d.fk_statut as status, d.fk_c_paiement, d.paid,"; $sql.= " dp.libelle as libelle_paiement, dp.code as code_paiement"; // INNER JOIN paiement $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as d"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as dp ON d.fk_c_paiement = dp.id AND dp.entity IN (".getEntity('c_paiement').")";