From e926efe02272725f327f511d7d1bd9ad343ae763 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 6 Aug 2018 12:39:50 +0200 Subject: [PATCH 1/8] fix connect mode for v8 release --- htdocs/public/payment/newpayment.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index a189781c8c1..ec343161a96 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -441,14 +441,15 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) $service = 'StripeLive'; $servicestatus = 1; } - $stripeacc = null; // No Oauth/connect use for public pages + $thirdparty = new Societe($db); $thirdparty->fetch($thirdparty_id); // Create Stripe customer include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; - $stripe = new Stripe($db); + $stripe = new Stripe($db); + $stripeacc = $stripe->getStripeAccount($service); $customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 1); // Create Stripe card from Token @@ -473,7 +474,7 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) 'customer' => $customer->id, 'source' => $card, 'statement_descriptor' => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 6, 'right', 'UTF-8', 1).' '.$FULLTAG, 22, 'right', 'UTF-8', 1) // 22 chars that appears on bank receipt - )); + ),array("idempotency_key" => "$ref","stripe_account" => "$stripeacc")); // Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...) if (empty($charge)) { @@ -507,7 +508,7 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) 'description' => 'Stripe payment: '.$FULLTAG, 'metadata' => array("FULLTAG" => $FULLTAG, 'Recipient' => $mysoc->name, 'dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>(empty($_SERVER['REMOTE_ADDR'])?'':$_SERVER['REMOTE_ADDR'])), 'statement_descriptor' => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 6, 'right', 'UTF-8', 1).' '.$FULLTAG, 22, 'right', 'UTF-8', 1) // 22 chars that appears on bank receipt - )); + ),array("idempotency_key" => "$ref","stripe_account" => "$stripeacc")); // Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...) if (empty($charge)) { From dc3a2ac26e42cf122614b4342b5d8e993e5722af Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 12 Aug 2018 22:40:47 +0200 Subject: [PATCH 2/8] standardize code --- htdocs/fourn/commande/card.php | 1 - htdocs/fourn/commande/contact.php | 2 +- htdocs/fourn/commande/dispatch.php | 2 +- htdocs/fourn/commande/document.php | 2 +- htdocs/fourn/commande/index.php | 2 +- htdocs/fourn/commande/info.php | 3 +-- htdocs/fourn/commande/list.php | 2 +- htdocs/fourn/commande/note.php | 3 +-- htdocs/fourn/commande/orderstoinvoice.php | 1 + htdocs/fourn/facture/card.php | 1 - htdocs/fourn/facture/contact.php | 2 +- htdocs/fourn/facture/document.php | 2 +- htdocs/fourn/facture/info.php | 2 +- htdocs/fourn/facture/list.php | 3 +-- htdocs/fourn/facture/note.php | 3 +-- htdocs/fourn/facture/paiement.php | 1 + htdocs/fourn/facture/rapport.php | 2 +- 17 files changed, 15 insertions(+), 19 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index ff8743fabe9..6ebb90817fd 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2782,5 +2782,4 @@ elseif (! empty($object->id)) // End of page llxFooter(); - $db->close(); diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index 262d73a6082..f62ccd03331 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -203,6 +203,6 @@ if ($id > 0 || ! empty($ref)) } } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 609aa792511..20664b6d679 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -873,6 +873,6 @@ if ($id > 0 || ! empty($ref)) { } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index 19a084cde86..41e982284fc 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -189,6 +189,6 @@ else exit; } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 4eead48abf4..1d5cfc2097b 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -432,6 +432,6 @@ print "
"; print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 016e9007fb9..747247a38c2 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -221,7 +221,6 @@ if (!empty($object->id)) show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters); } - - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 44ae098f195..4123e73d522 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1197,6 +1197,6 @@ else dol_print_error($db); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index 44edbdc8f00..d44c1348b15 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -155,7 +155,6 @@ if ($id > 0 || ! empty($ref)) } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 4c229518eba..ee6cc6c6af8 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -617,5 +617,6 @@ if (($action != 'create' && $action != 'add') && !$error) { dol_htmloutput_mesg($mesg, $mesgs); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 834621c85cb..3a8dbca7a70 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3202,7 +3202,6 @@ else } } - // End of page llxFooter(); $db->close(); diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index 6b54e28987f..923a9af03da 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -276,6 +276,6 @@ if ($id > 0 || ! empty($ref)) } } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 9c111ebe773..064ffd37b00 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -260,6 +260,6 @@ else print $langs->trans('ErrorUnknown'); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index 1297c44037b..0ba10aa1985 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -126,6 +126,6 @@ print ''; print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 98a6956a809..3d7ac96f47e 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1167,7 +1167,6 @@ else dol_print_error($db); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 11d59d1170c..3ed5d66829a 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -214,7 +214,6 @@ if ($object->id > 0) dol_fiche_end(); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 74593cb8675..79bda41264e 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -941,5 +941,6 @@ if (empty($action)) } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/fourn/facture/rapport.php b/htdocs/fourn/facture/rapport.php index c20b26b1263..e8696f0bdca 100644 --- a/htdocs/fourn/facture/rapport.php +++ b/htdocs/fourn/facture/rapport.php @@ -165,6 +165,6 @@ if ($year) } } +// End of page llxFooter(); - $db->close(); From f1f64db4dc2a69392333a57a133c29e62083fa23 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 13 Aug 2018 10:20:21 +0200 Subject: [PATCH 3/8] standardize code --- htdocs/fourn/card.php | 2 +- htdocs/fourn/contact.php | 3 +-- htdocs/fourn/index.php | 2 +- htdocs/fourn/paiement/card.php | 2 +- htdocs/fourn/paiement/info.php | 2 +- htdocs/fourn/product/list.php | 1 + htdocs/fourn/recap-fourn.php | 1 + htdocs/ftp/admin/ftpclient.php | 2 +- htdocs/ftp/index.php | 3 +-- htdocs/holiday/define_holiday.php | 2 +- htdocs/holiday/document.php | 3 +-- htdocs/holiday/list.php | 2 +- htdocs/holiday/month_report.php | 4 ++-- htdocs/holiday/view_log.php | 2 +- htdocs/hrm/admin/admin_establishment.php | 1 + htdocs/hrm/admin/admin_hrm.php | 1 + htdocs/hrm/establishment/card.php | 1 + htdocs/hrm/establishment/info.php | 1 + htdocs/hrm/index.php | 4 +--- 19 files changed, 20 insertions(+), 19 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 906dbda4f6e..2fe58419b28 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -882,6 +882,6 @@ else dol_print_error($db); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php index a334442e9ab..a6adb0bad27 100644 --- a/htdocs/fourn/contact.php +++ b/htdocs/fourn/contact.php @@ -130,7 +130,6 @@ else dol_print_error($db); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index 033bcc63a2a..0a3ceec93a1 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -313,6 +313,6 @@ if (count($companystatic->SupplierCategories)) //print "\n"; print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index daa452d0c29..0392bf3b8bd 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -407,6 +407,6 @@ else dol_fiche_end(); +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/fourn/paiement/info.php b/htdocs/fourn/paiement/info.php index eafc4f2decc..83794c8fb58 100644 --- a/htdocs/fourn/paiement/info.php +++ b/htdocs/fourn/paiement/info.php @@ -57,6 +57,6 @@ print '
'; dol_print_object_info($object); print '
'; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index 47bc949a758..9927b6b2b5d 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -308,5 +308,6 @@ else dol_print_error($db); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php index e680c18074e..1ff9f486510 100644 --- a/htdocs/fourn/recap-fourn.php +++ b/htdocs/fourn/recap-fourn.php @@ -191,5 +191,6 @@ else dol_print_error($db); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/ftp/admin/ftpclient.php b/htdocs/ftp/admin/ftpclient.php index ee7acc9070d..1e9a6227825 100644 --- a/htdocs/ftp/admin/ftpclient.php +++ b/htdocs/ftp/admin/ftpclient.php @@ -309,6 +309,6 @@ else } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index de8489ebb55..7c9527f3a9a 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -685,9 +685,8 @@ if ($conn_id) } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 380f609ec6d..c0bfff15507 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -374,6 +374,6 @@ else print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index cec638a769b..c452ac27ff0 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -295,7 +295,6 @@ else print $langs->trans("ErrorUnknown"); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 86ca95580b1..fcd5cc9d8b0 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -630,8 +630,8 @@ print ''; print ''; }*/ +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index 0faa2b56585..5bb3bcaeca8 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -194,6 +194,6 @@ else print ''; print ''; -// Fin de page -$db->close(); +// End of page llxFooter(); +$db->close(); diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index c36ccd1f4d7..c9cc2e6c16f 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -138,6 +138,6 @@ print ''."\n"; print ''."\n"; print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index f52cb1afc61..f7ebef5e623 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -145,5 +145,6 @@ print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php index ac47eec6292..c61480347bb 100644 --- a/htdocs/hrm/admin/admin_hrm.php +++ b/htdocs/hrm/admin/admin_hrm.php @@ -108,5 +108,6 @@ print '
'; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index b90144ea8f8..2c762b624d2 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -163,7 +163,6 @@ else print $langs->trans("ErrorUnknown"); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/loan/index.php b/htdocs/loan/index.php index 426a4f66491..5b81ebbb023 100644 --- a/htdocs/loan/index.php +++ b/htdocs/loan/index.php @@ -202,6 +202,6 @@ else dol_print_error($db); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php index d5b6e673f7c..3a092e4cb84 100644 --- a/htdocs/loan/info.php +++ b/htdocs/loan/info.php @@ -113,5 +113,6 @@ print ''; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index f38ed50e431..2ed8e82f20b 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -129,6 +129,7 @@ if ($id > 0) dol_fiche_end(); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index e19e33bc31e..919139bd6e3 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -292,8 +292,6 @@ if (empty($action) && ! empty($user->rights->loan->delete)) print ''; - - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index ced69451d9d..4ccdcc4542a 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -278,5 +278,6 @@ dol_fiche_end(); print '
'; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 8c62b4dd6fe..dc546a7f9b4 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -268,6 +268,7 @@ $(document).ready(function() { }); '."\n"; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index 0612c143497..7160a13ed59 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -321,5 +321,6 @@ print ''; $db->free($result); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 45b604d1919..7b33517556e 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -383,5 +383,6 @@ $(document).ready(function() { '; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index d827f5d985e..55fef4e5c35 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -367,5 +367,6 @@ $(document).ready(function() { '; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 94eff1911e7..b4c1ac0cdd0 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -273,5 +273,6 @@ print ' '; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index eb61e4ec41f..2ecd6088abf 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -282,5 +282,6 @@ print ' '; +// End of page llxFooter(); $db->close(); From e58c03d7b916e3fa21a228b702541cce1fea6233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Couragier?= Date: Mon, 13 Aug 2018 11:59:55 +0200 Subject: [PATCH 5/8] #9236 Allow to import expedtion lines via API --- htdocs/expedition/class/api_shipments.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index 844a6c95305..87596e59613 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -192,13 +192,13 @@ class Shipments extends DolibarrApi foreach($request_data as $field => $value) { $this->shipment->$field = $value; } - /*if (isset($request_data["lines"])) { + if (isset($request_data["lines"])) { $lines = array(); foreach ($request_data["lines"] as $line) { array_push($lines, (object) $line); } $this->shipment->lines = $lines; - }*/ + } if ($this->shipment->create(DolibarrApiAccess::$user) < 0) { throw new RestException(500, "Error creating shipment", array_merge(array($this->shipment->error), $this->shipment->errors)); From 0b5a87a4435189f845b65e9a88eb93a4af46cab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 13 Aug 2018 17:25:41 +0200 Subject: [PATCH 6/8] Update modules_holiday.php --- htdocs/core/modules/holiday/modules_holiday.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/holiday/modules_holiday.php b/htdocs/core/modules/holiday/modules_holiday.php index 7e7865c87e8..901a7531cbe 100644 --- a/htdocs/core/modules/holiday/modules_holiday.php +++ b/htdocs/core/modules/holiday/modules_holiday.php @@ -34,7 +34,7 @@ /** - * Parent class to manage intervention document templates + * Parent class to manage holidays document templates */ abstract class ModelePDFHoliday extends CommonDocGenerator { @@ -52,7 +52,7 @@ abstract class ModelePDFHoliday extends CommonDocGenerator { global $conf; - $type='contract'; + $type = 'holiday'; $liste=array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -64,7 +64,7 @@ abstract class ModelePDFHoliday extends CommonDocGenerator /** - * Parent class for all contract numbering modules + * Parent class for all holidays numbering modules */ class ModelNumRefHolidays { From cbdd1949dfd462810eb0ff2657c5f9da687fd6ef Mon Sep 17 00:00:00 2001 From: delcroix Patrick Date: Mon, 13 Aug 2018 20:39:20 +0200 Subject: [PATCH 7/8] Fix #9205 quote in Label/number on supplier payment # Fix #9205 #9205 the num_paiement wasn't escaped, not sure it's an real issue but it was reported here https://www.dolibarr.fr/forum/8-mise-a-jour/62340-message-erreur-suite-mise-a-jour#99408 --- htdocs/fourn/class/paiementfourn.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 49a24acf72b..494196e9c2d 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -193,7 +193,7 @@ class PaiementFourn extends Paiement $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiementfourn ('; $sql.= 'ref, entity, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, fk_user_author, fk_bank)'; $sql.= " VALUES ('".$this->db->escape($ref)."', ".$conf->entity.", '".$this->db->idate($now)."',"; - $sql.= " '".$this->db->idate($this->datepaye)."', '".$total."', '".$mtotal."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($this->note)."', ".$user->id.", 0)"; + $sql.= " '".$this->db->idate($this->datepaye)."', '".$total."', '".$mtotal."', ".$this->paiementid.", '".$this->db->escape($this->num_paiement)."', '".$this->db->escape($this->note)."', ".$user->id.", 0)"; $resql = $this->db->query($sql); if ($resql) From 5e762fe712d3d2dc799aa967bccb3f8c03500b6f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Aug 2018 23:22:20 +0200 Subject: [PATCH 8/8] Fix cloning website switch on new web site --- htdocs/website/class/website.class.php | 5 +++-- htdocs/website/class/websitepage.class.php | 7 ++++--- htdocs/website/index.php | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index a6b5dcc51f7..9e128329cad 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -493,9 +493,10 @@ class Website extends CommonObject * @param User $user User making the clone * @param int $fromid Id of object to clone * @param string $newref New ref + * @param string $newlang New language * @return mixed New object created, <0 if KO */ - public function createFromClone($user, $fromid, $newref) + public function createFromClone($user, $fromid, $newref, $newlang='') { global $hookmanager, $langs; global $dolibarr_main_data_root; @@ -572,7 +573,7 @@ class Website extends CommonObject dol_delete_file($filetplold); // Create new file - $objectpagenew = $objectpageold->createFromClone($user, $pageid, $objectpageold->pageurl, '', 0, $object->id); + $objectpagenew = $objectpageold->createFromClone($user, $pageid, $objectpageold->pageurl, '', 0, $object->id, 1); //print $pageid.' = '.$objectpageold->pageurl.' -> '.$objectpagenew->id.' = '.$objectpagenew->pageurl.'
'; if (is_object($objectpagenew) && $objectpagenew->pageurl) { diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index c0b6aaa7ab9..10cbc3381f6 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -362,10 +362,11 @@ class WebsitePage extends CommonObject * @param string $newref New ref/alias of page * @param string $newlang New language * @param int $istranslation 1=New page is a translation of the cloned page. - * @param int $newwebsite 0=Same web site, 1=New web site + * @param int $newwebsite 0=Same web site, >0=Id of new website + * @param int $keeptitleunchanged 1=Keep title unchanged * @return mixed New object created, <0 if KO */ - public function createFromClone(User $user, $fromid, $newref, $newlang='', $istranslation=0, $newwebsite=0) + public function createFromClone(User $user, $fromid, $newref, $newlang='', $istranslation=0, $newwebsite=0, $keeptitleunchanged=0) { global $hookmanager, $langs; $error = 0; @@ -385,7 +386,7 @@ class WebsitePage extends CommonObject $object->ref = $newref; $object->pageurl = $newref; $object->aliasalt = ''; - $object->title = $langs->trans("CopyOf").' '.$object->title; + $object->title = ($keeptitleunchanged ? '' : $langs->trans("CopyOf").' ').$object->title; if (! empty($newlang)) $object->lang=$newlang; if ($istranslation) $object->fk_page = $fromid; else $object->fk_page = 0; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index ceb6f5480d9..0fd4005c19d 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1115,6 +1115,7 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf $object = $objectnew; $id = $object->id; $pageid = $object->fk_default_home; + $websitekey = GETPOST('siteref','aZ09'); } }