diff --git a/.travis.yml b/.travis.yml index af37fe08a8d..e9bf08af57b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,6 +50,9 @@ jobs: - if: type = push AND branch = develop php: nightly env: DB=mysql + - if: type = push AND branch = 13.0 + php: nightly + env: DB=mysql notifications: email: diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 6525013c6bc..e7149ece88d 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -135,12 +135,13 @@ if ($action == 'deletefilter') { $emailcollectorfilter = new EmailCollectorFilter($db); $emailcollectorfilter->fetch(GETPOST('filterid', 'int')); - $result = $emailcollectorfilter->delete($user); - if ($result > 0) - { - $object->fetchFilters(); - } else { - setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors'); + if ($emailcollectorfilter->id > 0) { + $result = $emailcollectorfilter->delete($user); + if ($result > 0) { + $object->fetchFilters(); + } else { + setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors'); + } } } @@ -153,6 +154,11 @@ if (GETPOST('addoperation', 'alpha')) $emailcollectoroperation->status = 1; $emailcollectoroperation->position = 50; + if ($emailcollectoroperation->type == '-1') { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Operation")), null, 'errors'); + } + if (in_array($emailcollectoroperation->type, array('loadthirdparty', 'loadandcreatethirdparty')) && empty($emailcollectoroperation->actionparam)) { $error++; @@ -200,12 +206,13 @@ if ($action == 'deleteoperation') { $emailcollectoroperation = new EmailCollectorAction($db); $emailcollectoroperation->fetch(GETPOST('operationid', 'int')); - $result = $emailcollectoroperation->delete($user); - if ($result > 0) - { - $object->fetchActions(); - } else { - setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); + if ($emailcollectoroperation->id > 0) { + $result = $emailcollectoroperation->delete($user); + if ($result > 0) { + $object->fetchActions(); + } else { + setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); + } } } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 4ededdeacaf..d8fdb51141e 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3159,8 +3159,8 @@ class Commande extends CommonOrder $this->line->tva_tx = $txtva; $this->line->localtax1_tx = $txlocaltax1; $this->line->localtax2_tx = $txlocaltax2; - $this->line->localtax1_type = $localtaxes_type[0]; - $this->line->localtax2_type = $localtaxes_type[2]; + $this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]; + $this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]; $this->line->remise_percent = $remise_percent; $this->line->subprice = $subprice; $this->line->info_bits = $info_bits; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index ec55810e2da..ac1270ed550 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3136,8 +3136,8 @@ class Facture extends CommonInvoice $this->line->tva_tx = $txtva; $this->line->localtax1_tx = ($total_localtax1 ? $localtaxes_type[1] : 0); $this->line->localtax2_tx = ($total_localtax2 ? $localtaxes_type[3] : 0); - $this->line->localtax1_type = isset($localtaxes_type[0]) ? $localtaxes_type[0] : ''; - $this->line->localtax2_type = isset($localtaxes_type[2]) ? $localtaxes_type[2] : ''; + $this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]; + $this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]; $this->line->total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_ht) : $total_ht); // For credit note and if qty is negative, total is negative $this->line->total_ttc = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_ttc) : $total_ttc); // For credit note and if qty is negative, total is negative @@ -3375,8 +3375,8 @@ class Facture extends CommonInvoice $this->line->tva_tx = $txtva; $this->line->localtax1_tx = $txlocaltax1; $this->line->localtax2_tx = $txlocaltax2; - $this->line->localtax1_type = $localtaxes_type[0]; - $this->line->localtax2_type = $localtaxes_type[2]; + $this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]; + $this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]; $this->line->remise_percent = $remise_percent; $this->line->subprice = ($this->type == self::TYPE_CREDIT_NOTE ?-abs($pu_ht) : $pu_ht); // For credit note, unit price always negative, always positive otherwise diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 8f078633c52..1a05017c1d3 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -56,7 +56,7 @@ class EmailCollector extends CommonObject /** * @var string String with name of icon for emailcollector. Must be the part after the 'object_' into object_emailcollector.png */ - public $picto = 'generic'; + public $picto = 'email'; /** * @var string Field with ID of parent key if this field has a parent diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 557bc2a0456..6c6347f67f7 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1714,8 +1714,8 @@ class CommandeFournisseur extends CommonOrder $multicurrency_total_ttc = $tabprice[18]; $pu_ht_devise = $tabprice[19]; - $localtax1_type = $localtaxes_type[0]; - $localtax2_type = $localtaxes_type[2]; + $localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]; + $localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]; $rangmax = $this->line_max(); $rang = $rangmax + 1; @@ -1734,8 +1734,8 @@ class CommandeFournisseur extends CommonOrder $this->line->tva_tx = $txtva; $this->line->localtax1_tx = ($total_localtax1 ? $localtaxes_type[1] : 0); $this->line->localtax2_tx = ($total_localtax2 ? $localtaxes_type[3] : 0); - $this->line->localtax1_type = $localtaxes_type[0]; - $this->line->localtax2_type = $localtaxes_type[2]; + $this->line->localtax1_type = $localtax1_type; + $this->line->localtax2_type = $localtax2_type; $this->line->fk_product = $fk_product; $this->line->product_type = $product_type; $this->line->remise_percent = $remise_percent; @@ -2594,8 +2594,8 @@ class CommandeFournisseur extends CommonOrder $multicurrency_total_ttc = $tabprice[18]; $pu_ht_devise = $tabprice[19]; - $localtax1_type = $localtaxes_type[0]; - $localtax2_type = $localtaxes_type[2]; + $localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]; + $localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]; //Fetch current line from the database and then clone the object and set it in $oldline property $this->line = new CommandeFournisseurLigne($this->db); @@ -2633,8 +2633,8 @@ class CommandeFournisseur extends CommonOrder $this->line->tva_tx = $txtva; $this->line->localtax1_tx = $txlocaltax1; $this->line->localtax2_tx = $txlocaltax2; - $this->line->localtax1_type = $localtaxes_type[0]; - $this->line->localtax2_type = $localtaxes_type[2]; + $this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]; + $this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]; $this->line->remise_percent = $remise_percent; $this->line->subprice = $pu_ht; $this->line->rang = $this->rang; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 40ffb9024c5..c8ae31398c0 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1765,8 +1765,8 @@ class FactureFournisseur extends CommonInvoice $this->line->tva_tx = $txtva; $this->line->localtax1_tx = ($total_localtax1 ? $localtaxes_type[1] : 0); $this->line->localtax2_tx = ($total_localtax2 ? $localtaxes_type[3] : 0); - $this->line->localtax1_type = $localtaxes_type[0]; - $this->line->localtax2_type = $localtaxes_type[2]; + $this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]; + $this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]; $this->line->total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_ht) : $total_ht); // For credit note and if qty is negative, total is negative $this->line->total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_tva) : $total_tva); @@ -1952,8 +1952,8 @@ class FactureFournisseur extends CommonInvoice $line->tva_tx = $vatrate; $line->localtax1_tx = $txlocaltax1; $line->localtax2_tx = $txlocaltax2; - $line->localtax1_type = $localtaxes_type[0]; - $line->localtax2_type = $localtaxes_type[2]; + $line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]; + $line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]; $line->total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_ht) : $total_ht); $line->total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_tva) : $total_tva); $line->total_localtax1 = $total_localtax1; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6b05b594711..bd83272a3e7 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1989,8 +1989,8 @@ EmailcollectorOperationsDesc=Operations are executed from top to bottom order MaxEmailCollectPerCollect=Max number of emails collected per collect CollectNow=Collect now ConfirmCloneEmailCollector=Are you sure you want to clone the Email collector %s ? -DateLastCollectResult=Date latest collect tried -DateLastcollectResultOk=Date latest collect successfull +DateLastCollectResult=Date of latest collect try +DateLastcollectResultOk=Date of latest collect success LastResult=Latest result EmailCollectorConfirmCollectTitle=Email collect confirmation EmailCollectorConfirmCollect=Do you want to run the collection for this collector now ? diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 82be9955e0f..14944619d6e 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -417,7 +417,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && !empty($conf->gl // Check all cases that need a token (all POST actions, all actions and mass actions on pages with CSRFCHECK_WITH_TOKEN set, all sensitive GET actions) if ($_SERVER['REQUEST_METHOD'] == 'POST' || ((GETPOSTISSET('action') || GETPOSTISSET('massaction')) && defined('CSRFCHECK_WITH_TOKEN')) || - in_array(GETPOST('action', 'aZ09'), array('add', 'addtimespent', 'update', 'install', 'delete', 'deleteprof', 'deletepayment', 'confirm_create_user', 'confirm_create_thirdparty', 'confirm_reject_check'))) + in_array(GETPOST('action', 'aZ09'), array('add', 'addtimespent', 'update', 'install', 'delete', 'deletefilter', 'deleteoperation', 'deleteprof', 'deletepayment', 'confirm_create_user', 'confirm_create_thirdparty', 'confirm_reject_check'))) { if (!GETPOSTISSET('token')) { if (GETPOST('uploadform', 'int')) { diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index 6cda745056a..986db1b14bc 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -44,7 +44,7 @@ if ($object->fetch($id) < 1) { if ($cancel) $action = ''; if ($action) { - if ($action == 'edit') { + if ($action == 'update') { $object->ref = $ref; $object->label = $label; @@ -55,7 +55,7 @@ if ($action) { header('Location: '.dol_buildpath('/variants/card.php?id='.$id, 2)); exit(); } - } elseif ($action == 'update') { + } elseif ($action == 'update_value') { if ($objectval->fetch($valueid) > 0) { $objectval->ref = $ref; $objectval->value = GETPOST('value', 'alpha'); @@ -139,7 +139,12 @@ $h++; print dol_get_fiche_head($head, 'variant', $langs->trans('ProductAttributeName'), -1, 'generic'); if ($action == 'edit') { - print '