diff --git a/htdocs/core/modules/holiday/modules_holiday.php b/htdocs/core/modules/holiday/modules_holiday.php
index 8e7ee2880c8..4e03e184738 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
{
@@ -44,16 +44,16 @@ abstract class ModelePDFHoliday extends CommonDocGenerator
/**
* Return list of active generation modules
*
- * @param DoliDB $db Database handler
+ * @param DoliDB $db Database handler
* @param integer $maxfilenamelength Max length of value to show
* @return array List of templates
- */
+ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
- static function liste_modeles($db,$maxfilenamelength=0)
+ static function liste_modeles($db, $maxfilenamelength=0)
{
global $conf;
- $type = 'contract';
+ $type = 'holiday';
$list = array();
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
@@ -65,7 +65,7 @@ abstract class ModelePDFHoliday extends CommonDocGenerator
/**
- * Parent class for all contract numbering modules
+ * Parent class for all holidays numbering modules
*/
class ModelNumRefHolidays
{
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));
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/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php
index 6de1453044f..297a5fb859a 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)
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/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/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();
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();
diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php
index 91a62ea347c..2625cf6d438 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))
{
diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php
index 1bb58f66f7d..8b571e147f2 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 023baf09c7b..52ee3028ab1 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');
}
}