diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index ed174a380a4..ed7d06919ec 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1732,8 +1732,8 @@ class Facture extends CommonInvoice $sql.= " SET facnumber='".$num."', fk_statut = 1, fk_user_valid = ".$user->id.", date_valid = '".$this->db->idate($now)."'"; if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date { - $sql.= ', datef='.$this->db->idate($this->date); - $sql.= ', date_lim_reglement='.$this->db->idate($this->date_lim_reglement); + $sql.= ", datef='".$this->db->idate($this->date)."'"; + $sql.= ", date_lim_reglement='".$this->db->idate($this->date_lim_reglement)."'"; } $sql.= ' WHERE rowid = '.$this->id; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index feaa996ad0c..61f722a1773 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -62,6 +62,10 @@ class Contact extends CommonObject var $code; var $email; + var $phone_pro; + var $phone_perso; + var $phone_mobile; + var $birthday; var $default_lang; var $note_public; // Public note diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 9c24972e383..f4271d05070 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -875,7 +875,7 @@ class ExtraFields if (!empty($value)) { $checked=' checked="checked" '; } - $value=''; + $value=''; } elseif ($type == 'mail') { diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index cffa4ff6a6d..907b78eaac1 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -345,7 +345,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS)) { // Tel - if ($targetcontact->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->phone); + if ($targetcontact->phone_pro) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->phone_pro); // Fax if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax); // EMail diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php index 1bb6ac33b33..7473720ed10 100644 --- a/htdocs/public/cron/cron_run_jobs.php +++ b/htdocs/public/cron/cron_run_jobs.php @@ -56,8 +56,9 @@ $langs->load("cron"); */ // Check the key, avoid that a stranger starts cron -$key = $_GET['securitykey']; -if (empty($key)) { +$key = GETPOST('securitykey','alpha'); +if (empty($key)) +{ echo 'securitykey is require'; exit; } @@ -67,7 +68,7 @@ if($key != $conf->global->CRON_KEY) exit; } // Check the key, avoid that a stranger starts cron -$userlogin = GETPOST('userlogin'); +$userlogin = GETPOST('userlogin','alpha'); if (empty($userlogin)) { echo 'userlogin is require'; @@ -91,7 +92,8 @@ else exit; } } -$id = GETPOST('id'); +$id = GETPOST('id','int'); + // create a jobs object $object = new Cronjob($db); @@ -177,4 +179,4 @@ else } $db->close(); -?> \ No newline at end of file +?> diff --git a/htdocs/societe/tpl/linesalesrepresentative.tpl.php b/htdocs/societe/tpl/linesalesrepresentative.tpl.php index 9b2867cacff..70c9ec283c0 100644 --- a/htdocs/societe/tpl/linesalesrepresentative.tpl.php +++ b/htdocs/societe/tpl/linesalesrepresentative.tpl.php @@ -4,7 +4,7 @@ print '
| '; print $langs->trans('SalesRepresentatives'); print ' | ';
- if ($user->rights->societe->creer)
+ if ($user->rights->societe->creer && $user->rights->societe->client->voir)
print ''.img_edit().'';
else
print ' ';
diff --git a/htdocs/webservices/admin/webservices.php b/htdocs/webservices/admin/webservices.php
index 2de3c12df2c..7b71e5a0228 100644
--- a/htdocs/webservices/admin/webservices.php
+++ b/htdocs/webservices/admin/webservices.php
@@ -102,6 +102,7 @@ print ' '; $webservices = array( 'user' => '', 'thirdparty' => '!empty($conf->societe->enabled)', + 'contact' => '!empty($conf->societe->enabled)', 'productorservice' => '(!empty($conf->product->enabled) || !empty($conf->service->enabled))', 'order' => '!empty($conf->commande->enabled)', 'invoice' => '!empty($conf->facture->enabled)', diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index 08d21d5cba2..cfe25afbe4c 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -300,7 +300,7 @@ function getContact($authentication,$id,$ref='',$ref_ext='') 'ref_propal' => $contact->ref_propal, 'user_id' => $contact->user_id, 'user_login' => $contact->user_login, - 'civility_id' => $contact->civility_id + 'civilite_id' => $contact->civility_id ); //Retreive all extrafield for thirdsparty @@ -379,7 +379,7 @@ function createContact($authentication,$contact) $newobject=new Contact($db); $newobject->id=$contact['id']; - $newobject->civility_id=$contact['civility_id']; + $newobject->civilite_id=$contact['civility_id']; $newobject->lastname=$contact['lastname']; $newobject->firstname=$contact['firstname']; $newobject->address=$contact['address']; @@ -522,7 +522,7 @@ function getContactsForThirdParty($authentication,$idthirdparty) $linescontact[]=array( 'id' => $contact->id, 'ref' => $contact->ref, - 'civility_id' => $contact->civility_id?$contact->civility_id:'', + 'civility_id' => $contact->civilite_id?$contact->civilite_id:'', 'lastname' => $contact->lastname?$contact->lastname:'', 'firstname' => $contact->firstname?$contact->firstname:'', 'address' => $contact->address?$contact->address:'', @@ -653,6 +653,8 @@ function updateContact($authentication,$contact) $object->fax=$contact['fax']; $object->email=$contact['email']; + $object->civilite_id=$contact['civility_id']; + //Retreive all extrafield for contact // fetch optionals attributes and labels |