From f20dd8019426c164af8d210692445c830aca28c4 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 18 Jan 2019 11:20:36 +0100 Subject: [PATCH 01/15] FIX: better thirparty support --- htdocs/don/card.php | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 6a63074166c..d2a43b41813 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2015-2016 Alexandre Spangaro - * Copyright (C) 2018 Thibault FOUCART + * Copyright (C) 2018-2019 Thibault FOUCART * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -107,8 +107,8 @@ if ($action == 'update') $object->amount = price2num(GETPOST("amount",'alpha')); $object->town = GETPOST("town",'alpha'); $object->zip = GETPOST("zipcode",'alpha'); - $object->country_id = GETPOST('country_id', 'int'); - $object->email = GETPOST("email",'alpha'); + $object->country_id = GETPOST('country_id', 'int'); + $object->email = GETPOST("email",'alpha'); $object->date = $donation_date; $object->public = GETPOST("public",'alpha'); $object->fk_project = GETPOST("fk_project",'alpha'); @@ -154,6 +154,7 @@ if ($action == 'add') if (! $error) { + $object->fk_soc = GETPOST("fk_soc",'int'); $object->firstname = GETPOST("firstname",'alpha'); $object->lastname = GETPOST("lastname",'alpha'); $object->societe = GETPOST("societe",'alpha'); @@ -161,8 +162,8 @@ if ($action == 'add') $object->amount = price2num(GETPOST("amount",'alpha')); $object->zip = GETPOST("zipcode",'alpha'); $object->town = GETPOST("town",'alpha'); - $object->country_id = GETPOST('country_id', 'int'); - $object->email = GETPOST("email",'alpha'); + $object->country_id = GETPOST('country_id', 'int'); + $object->email = GETPOST("email",'alpha'); $object->date = $donation_date; $object->note_private= GETPOST("note_private",'none'); $object->note_public = GETPOST("note_public",'none'); @@ -516,7 +517,7 @@ if (! empty($id) && $action == 'edit') // Amount if ($object->statut == 0) { - print "".''.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).''; + print "".''.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).''; } else { @@ -530,6 +531,14 @@ if (! empty($id) && $action == 'edit') print ""; print "\n"; +if ( $object->fk_soc && ! empty($conf->societe->enabled) && ! empty($conf->global->DONATION_USE_THIRDPARTIES) ) { + + $company=new Societe($db); + $result=$company->fetch($object->fk_soc); + + print ''.$langs->trans("LinkedToDolibarrThirdParty").''.$company->getNomUrl(1).''; + +} else { $langs->load("companies"); print ''.$langs->trans("Company").''; print ''.$langs->trans("Lastname").''; @@ -537,10 +546,10 @@ if (! empty($id) && $action == 'edit') print ''.$langs->trans("Address").''; print ''; - // Zip / Town - print ''.$langs->trans("Zip").' / '.$langs->trans("Town").''; + // Zip / Town + print ''.$langs->trans("Zip").' / '.$langs->trans("Town").''; print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6); - print ' '; + print ' '; print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); print ''; @@ -551,7 +560,7 @@ if (! empty($id) && $action == 'edit') print ''; print "".''.$langs->trans("EMail").''; - +} // Payment mode print "".$langs->trans("PaymentMode")."\n"; if ($object->modepaymentid) $selected = $object->modepaymentid; @@ -683,11 +692,22 @@ if (! empty($id) && $action != 'edit') print ''.$langs->trans("PublicDonation").''; print yn($object->public); print ''; + +if ($object->fk_soc) { + + $company=new Societe($db); + $result=$company->fetch($object->fk_soc); + + print ''.$langs->trans("LinkedToDolibarrThirdParty").''.$company->getNomUrl(1).''; + +} else { print ''.$langs->trans("Company").''.$object->societe.''; print ''.$langs->trans("Lastname").''.$object->lastname.''; print ''.$langs->trans("Firstname").''.$object->firstname.''; +} + // Payment mode print "".$langs->trans("PaymentMode").""; $form->form_modes_reglement(null, $object->modepaymentid,'none'); From c7bedbe7dc8eca76a73e2d0681eb1ca7a573baa8 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 18 Jan 2019 11:22:33 +0100 Subject: [PATCH 02/15] Update for thirdparty support --- htdocs/don/class/don.class.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index c3941059e64..7c8feaa8a15 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -1,10 +1,11 @@ - * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2009 Regis Houssin * Copyright (C) 2014 Florian Henry * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2016 Juanjo Menent + * Copyright (C) 2019 Thibault FOUCART * * 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 @@ -366,6 +367,7 @@ class Don extends CommonObject $sql.= ", entity"; $sql.= ", amount"; $sql.= ", fk_payment"; + $sql.= ", fk_soc"; $sql.= ", firstname"; $sql.= ", lastname"; $sql.= ", societe"; @@ -388,6 +390,7 @@ class Don extends CommonObject $sql.= ", ".$conf->entity; $sql.= ", ".price2num($this->amount); $sql.= ", ".($this->modepaymentid?$this->modepaymentid:"null"); + $sql.= ", '".$this->fk_soc."'"; $sql.= ", '".$this->db->escape($this->firstname)."'"; $sql.= ", '".$this->db->escape($this->lastname)."'"; $sql.= ", '".$this->db->escape($this->societe)."'"; @@ -489,7 +492,7 @@ class Don extends CommonObject $sql .= ",address='".$this->db->escape($this->address)."'"; $sql .= ",zip='".$this->db->escape($this->zip)."'"; $sql .= ",town='".$this->db->escape($this->town)."'"; - $sql .= ",fk_country = ".$this->country_id; + $sql .= ",fk_country = ".($this->country_id > 0 ? $this->country_id : '0'); $sql .= ",public=".$this->public; $sql .= ",fk_projet=".($this->fk_project>0?$this->fk_project:'null'); $sql .= ",note_private=".(!empty($this->note_private)?("'".$this->db->escape($this->note_private)."'"):"NULL"); @@ -636,7 +639,7 @@ class Don extends CommonObject global $conf; $sql = "SELECT d.rowid, d.datec, d.date_valid, d.tms as datem, d.datedon,"; - $sql.= " d.firstname, d.lastname, d.societe, d.amount, d.fk_statut, d.address, d.zip, d.town, "; + $sql.= " d.fk_soc,d.firstname, d.lastname, d.societe, d.amount, d.fk_statut, d.address, d.zip, d.town, "; $sql.= " d.fk_country, d.country as country_olddata, d.public, d.amount, d.fk_payment, d.paid, d.note_private, d.note_public, d.email, d.phone, "; $sql.= " d.phone_mobile, d.fk_projet as fk_project, d.model_pdf,"; $sql.= " p.ref as project_ref,"; @@ -670,6 +673,7 @@ class Don extends CommonObject $this->date_valid = $this->db->jdate($obj->date_valid); $this->datem = $this->db->jdate($obj->datem); $this->date = $this->db->jdate($obj->datedon); + $this->fk_soc = $obj->fk_soc; $this->firstname = $obj->firstname; $this->lastname = $obj->lastname; $this->societe = $obj->societe; @@ -682,7 +686,7 @@ class Don extends CommonObject $this->country_code = $obj->country_code; $this->country = $obj->country; $this->country_olddata= $obj->country_olddata; // deprecated - $this->email = $obj->email; + $this->email = $obj->email; $this->phone = $obj->phone; $this->phone_mobile = $obj->phone_mobile; $this->project = $obj->project_ref; @@ -692,7 +696,7 @@ class Don extends CommonObject $this->modepaymentid = $obj->fk_payment; $this->modepaymentcode = $obj->payment_code; $this->modepayment = $obj->payment_label; - $this->paid = $obj->paid; + $this->paid = $obj->paid; $this->amount = $obj->amount; $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; From 754714abf7d177720b9e26ef7c179a7151262b86 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 18 Jan 2019 11:23:59 +0100 Subject: [PATCH 03/15] Update llx_don.sql --- htdocs/install/mysql/tables/llx_don.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_don.sql b/htdocs/install/mysql/tables/llx_don.sql index 82728861fc6..4cb081045ee 100644 --- a/htdocs/install/mysql/tables/llx_don.sql +++ b/htdocs/install/mysql/tables/llx_don.sql @@ -31,6 +31,7 @@ create table llx_don amount double(24,8) DEFAULT 0, fk_payment integer, -- Id of payment mode paid smallint default 0 NOT NULL, + fk_soc integer NULL, firstname varchar(50), lastname varchar(50), societe varchar(50), @@ -38,7 +39,7 @@ create table llx_don zip varchar(30), town varchar(50), country varchar(50), -- Deprecated - Replace with fk_country - fk_country integer NOT NULL, + fk_country integer NOT NULL, email varchar(255), phone varchar(24), phone_mobile varchar(24), From 5232024de94e08672bd572094aba801e161f6750 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 18 Jan 2019 11:26:12 +0100 Subject: [PATCH 04/15] ADD thirdparty support --- htdocs/don/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 47408fe4bb5..3203d1fd47f 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2019 Thibault FOUCART * * 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 @@ -85,7 +86,7 @@ llxHeader('',$langs->trans("Donations"),'EN:Module_Donations|FR:Module_Dons|ES:M $donationstatic=new Don($db); // Genere requete de liste des dons -$sql = "SELECT d.rowid, d.datedon, d.firstname, d.lastname, d.societe,"; +$sql = "SELECT d.rowid, d.datedon, d.fk_soc, d.firstname, d.lastname, d.societe,"; $sql.= " d.amount, d.fk_statut as statut, "; $sql.= " p.rowid as pid, p.ref, p.title, p.public"; $sql.= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."projet AS p"; From af03f108a12883c8273adcdc0550ca865b220075 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 18 Jan 2019 11:28:09 +0100 Subject: [PATCH 05/15] Update card.php --- htdocs/don/card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index d2a43b41813..034e045bb46 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -107,8 +107,8 @@ if ($action == 'update') $object->amount = price2num(GETPOST("amount",'alpha')); $object->town = GETPOST("town",'alpha'); $object->zip = GETPOST("zipcode",'alpha'); - $object->country_id = GETPOST('country_id', 'int'); - $object->email = GETPOST("email",'alpha'); + $object->country_id = GETPOST('country_id', 'int'); + $object->email = GETPOST("email",'alpha'); $object->date = $donation_date; $object->public = GETPOST("public",'alpha'); $object->fk_project = GETPOST("fk_project",'alpha'); @@ -117,7 +117,7 @@ if ($action == 'update') $object->modepaymentid = GETPOST('modepayment','int'); // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost($extralabels,$object); + $ret = $extrafields->setOptionalsFromPost($extralabels,$object); if ($ret < 0) $error++; if ($object->update($user) > 0) @@ -162,9 +162,9 @@ if ($action == 'add') $object->amount = price2num(GETPOST("amount",'alpha')); $object->zip = GETPOST("zipcode",'alpha'); $object->town = GETPOST("town",'alpha'); - $object->country_id = GETPOST('country_id', 'int'); - $object->email = GETPOST("email",'alpha'); - $object->date = $donation_date; + $object->country_id = GETPOST('country_id', 'int'); + $object->email = GETPOST('email', 'int'); + $object->date = $donation_date; $object->note_private= GETPOST("note_private",'none'); $object->note_public = GETPOST("note_public",'none'); $object->public = GETPOST("public",'alpha'); From 09567ebaafca3175126e86401728cd5faf8a33f6 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 18 Jan 2019 11:28:29 +0100 Subject: [PATCH 06/15] Update card.php --- htdocs/don/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 034e045bb46..a55ebe5e2e8 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -154,7 +154,7 @@ if ($action == 'add') if (! $error) { - $object->fk_soc = GETPOST("fk_soc",'int'); + $object->fk_soc = GETPOST("fk_soc",'int'); $object->firstname = GETPOST("firstname",'alpha'); $object->lastname = GETPOST("lastname",'alpha'); $object->societe = GETPOST("societe",'alpha'); From 4b447d779916b87877d2230947f003d7d420b94f Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 18 Jan 2019 14:13:55 +0100 Subject: [PATCH 07/15] Update card.php --- htdocs/don/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index a55ebe5e2e8..9e7fd3e5c9e 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -537,7 +537,7 @@ if ( $object->fk_soc && ! empty($conf->societe->enabled) && ! empty($conf->globa $result=$company->fetch($object->fk_soc); print ''.$langs->trans("LinkedToDolibarrThirdParty").''.$company->getNomUrl(1).''; - + } else { $langs->load("companies"); print ''.$langs->trans("Company").''; @@ -699,7 +699,7 @@ if ($object->fk_soc) { $result=$company->fetch($object->fk_soc); print ''.$langs->trans("LinkedToDolibarrThirdParty").''.$company->getNomUrl(1).''; - + } else { print ''.$langs->trans("Company").''.$object->societe.''; From 89e348515a11eb8dce1f4b4c5388b5ecf4a7545e Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 18 Jan 2019 14:14:38 +0100 Subject: [PATCH 08/15] Update don.class.php --- htdocs/don/class/don.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 7c8feaa8a15..1d649b1bd76 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -367,7 +367,7 @@ class Don extends CommonObject $sql.= ", entity"; $sql.= ", amount"; $sql.= ", fk_payment"; - $sql.= ", fk_soc"; + $sql.= ", fk_soc"; $sql.= ", firstname"; $sql.= ", lastname"; $sql.= ", societe"; @@ -390,7 +390,7 @@ class Don extends CommonObject $sql.= ", ".$conf->entity; $sql.= ", ".price2num($this->amount); $sql.= ", ".($this->modepaymentid?$this->modepaymentid:"null"); - $sql.= ", '".$this->fk_soc."'"; + $sql.= ", '".$this->fk_soc."'"; $sql.= ", '".$this->db->escape($this->firstname)."'"; $sql.= ", '".$this->db->escape($this->lastname)."'"; $sql.= ", '".$this->db->escape($this->societe)."'"; @@ -673,7 +673,7 @@ class Don extends CommonObject $this->date_valid = $this->db->jdate($obj->date_valid); $this->datem = $this->db->jdate($obj->datem); $this->date = $this->db->jdate($obj->datedon); - $this->fk_soc = $obj->fk_soc; + $this->fk_soc = $obj->fk_soc; $this->firstname = $obj->firstname; $this->lastname = $obj->lastname; $this->societe = $obj->societe; From 8fcdb3bb6d2a0d05be6ca13a31bc2f904a975344 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 18 Jan 2019 16:30:28 +0100 Subject: [PATCH 09/15] Update card.php --- htdocs/don/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 9e7fd3e5c9e..146c8efaa6b 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -539,6 +539,7 @@ if ( $object->fk_soc && ! empty($conf->societe->enabled) && ! empty($conf->globa print ''.$langs->trans("LinkedToDolibarrThirdParty").''.$company->getNomUrl(1).''; } else { + $langs->load("companies"); print ''.$langs->trans("Company").''; print ''.$langs->trans("Lastname").''; From d961ae3225161196334514a5852a4a2efd15bf52 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 18 Jan 2019 16:31:26 +0100 Subject: [PATCH 10/15] Update card.php --- htdocs/don/card.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 146c8efaa6b..e71574acc23 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -537,7 +537,6 @@ if ( $object->fk_soc && ! empty($conf->societe->enabled) && ! empty($conf->globa $result=$company->fetch($object->fk_soc); print ''.$langs->trans("LinkedToDolibarrThirdParty").''.$company->getNomUrl(1).''; - } else { $langs->load("companies"); @@ -700,13 +699,11 @@ if ($object->fk_soc) { $result=$company->fetch($object->fk_soc); print ''.$langs->trans("LinkedToDolibarrThirdParty").''.$company->getNomUrl(1).''; - } else { print ''.$langs->trans("Company").''.$object->societe.''; print ''.$langs->trans("Lastname").''.$object->lastname.''; print ''.$langs->trans("Firstname").''.$object->firstname.''; - } // Payment mode From c2c238ec248af07f552a25d092c40c1fed6bf686 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 18 Jan 2019 16:32:13 +0100 Subject: [PATCH 11/15] Update don.class.php --- htdocs/don/class/don.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 1d649b1bd76..2f720281b4f 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -367,7 +367,7 @@ class Don extends CommonObject $sql.= ", entity"; $sql.= ", amount"; $sql.= ", fk_payment"; - $sql.= ", fk_soc"; + $sql.= ", fk_soc"; $sql.= ", firstname"; $sql.= ", lastname"; $sql.= ", societe"; @@ -673,7 +673,7 @@ class Don extends CommonObject $this->date_valid = $this->db->jdate($obj->date_valid); $this->datem = $this->db->jdate($obj->datem); $this->date = $this->db->jdate($obj->datedon); - $this->fk_soc = $obj->fk_soc; + $this->fk_soc = $obj->fk_soc; $this->firstname = $obj->firstname; $this->lastname = $obj->lastname; $this->societe = $obj->societe; From e74bccca211951fcaab650c34a67cb2f980a1e3a Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 18 Jan 2019 17:51:42 +0100 Subject: [PATCH 12/15] Update don.class.php --- htdocs/don/class/don.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 2f720281b4f..0f3a1879638 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -390,7 +390,7 @@ class Don extends CommonObject $sql.= ", ".$conf->entity; $sql.= ", ".price2num($this->amount); $sql.= ", ".($this->modepaymentid?$this->modepaymentid:"null"); - $sql.= ", '".$this->fk_soc."'"; + $sql.= ", '".$this->db->escape($this->fk_soc)."'"; $sql.= ", '".$this->db->escape($this->firstname)."'"; $sql.= ", '".$this->db->escape($this->lastname)."'"; $sql.= ", '".$this->db->escape($this->societe)."'"; From a3153889b8e416b64c1a716276e652d61aee6a2f Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 19 Jan 2019 11:31:40 +0100 Subject: [PATCH 13/15] fix --- htdocs/don/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index e71574acc23..f412eac3e63 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -163,7 +163,7 @@ if ($action == 'add') $object->zip = GETPOST("zipcode",'alpha'); $object->town = GETPOST("town",'alpha'); $object->country_id = GETPOST('country_id', 'int'); - $object->email = GETPOST('email', 'int'); + $object->email = GETPOST('email', 'alpha'); $object->date = $donation_date; $object->note_private= GETPOST("note_private",'none'); $object->note_public = GETPOST("note_public",'none'); From 4d2231a6a2fb6f1c52f520181e0b3e2d9d3a1dfe Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 21 Jan 2019 23:53:17 +0100 Subject: [PATCH 14/15] Fix double < --- htdocs/don/class/don.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 0f3a1879638..248c2c29aba 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -1,4 +1,4 @@ -< * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2009 Regis Houssin From e5d1466ec58dd1c418b170a931afa0f0bbf03d3f Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 22 Jan 2019 18:44:28 +0100 Subject: [PATCH 15/15] Update card.php --- htdocs/don/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index f412eac3e63..d7512e95799 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -107,7 +107,7 @@ if ($action == 'update') $object->amount = price2num(GETPOST("amount",'alpha')); $object->town = GETPOST("town",'alpha'); $object->zip = GETPOST("zipcode",'alpha'); - $object->country_id = GETPOST('country_id', 'int'); + $object->country_id = GETPOST('country_id','int'); $object->email = GETPOST("email",'alpha'); $object->date = $donation_date; $object->public = GETPOST("public",'alpha'); @@ -162,7 +162,7 @@ if ($action == 'add') $object->amount = price2num(GETPOST("amount",'alpha')); $object->zip = GETPOST("zipcode",'alpha'); $object->town = GETPOST("town",'alpha'); - $object->country_id = GETPOST('country_id', 'int'); + $object->country_id = GETPOST('country_id','int'); $object->email = GETPOST('email', 'alpha'); $object->date = $donation_date; $object->note_private= GETPOST("note_private",'none');