';
// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 14ea39a2077..cf54ade1a64 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -592,9 +592,10 @@ abstract class CommonObject
}
if(! empty($id_type_contact)) {
- $datecreate = dol_now();
- $this->db->begin();
+ $datecreate = dol_now();
+
+ $this->db->begin();
// Insertion dans la base
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact";
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index ae9b57cba8f..db8afaf29f2 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -58,11 +58,12 @@ class ExtraFields
var $attribute_perms;
// Array to store permission to check
var $attribute_list;
-
+ // Array to store if extra field is hidden
+ var $attribute_hidden; // warning, do not rely on this. If your module need a hidden data, it must use its own table.
+
var $error;
var $errno;
- var $attribute_hidden;
public static $type2label=array(
'varchar'=>'String',
@@ -120,7 +121,7 @@ class ExtraFields
* @param int $alwayseditable Is attribute always editable regardless of the document status
* @param string $perms Permission to check
* @param int $list Into list view by default
- * @param int $ishidden Is hidden extrafield
+ * @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table)
* @return int <=0 if KO, >0 if OK
*/
function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param=0, $alwayseditable=0, $perms='', $list=0, $ishidden=0)
@@ -248,7 +249,7 @@ class ExtraFields
* @param int $alwayseditable Is attribute always editable regardless of the document status
* @param string $perms Permission to check
* @param int $list Into list view by default
- * @param int $ishidden Is hidden extrafield
+ * @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table)
* @return int <=0 if KO, >0 if OK
*/
private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list=0, $ishidden=0)
@@ -396,7 +397,7 @@ class ExtraFields
* @param int $alwayseditable Is attribute always editable regardless of the document status
* @param string $perms Permission to check
* @param int $list Into list view by default
- * @param int $ishidden Is hidden extrafield
+ * @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table)
* @return int >0 if OK, <=0 if KO
*/
function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0, $perms='',$list='',$ishidden=0)
@@ -491,7 +492,7 @@ class ExtraFields
* @param int $alwayseditable Is attribute always editable regardless of the document status
* @param string $perms Permission to check
* @param int $list Into list view by default
- * @param int $ishidden Is hidden extrafield
+ * @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table)
* @return int <=0 if KO, >0 if OK
*/
private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list=0,$ishidden=0)
@@ -1177,7 +1178,7 @@ class ExtraFields
$params=$this->attribute_param[$key];
$perms=$this->attribute_perms[$key];
$list=$this->attribute_list[$key];
- $hidden=$this->attribute_hidden[$key];
+ $hidden=$this->attribute_hidden[$key]; // warning, do not rely on this. If your module need a hidden data, it must use its own table.
$showsize=0;
if ($type == 'date')
diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php
index 5a9a446596f..4dd62444d89 100644
--- a/htdocs/core/db/pgsql.class.php
+++ b/htdocs/core/db/pgsql.class.php
@@ -1099,7 +1099,7 @@ class DoliDBPgsql extends DoliDB
*/
function DDLDropField($table,$field_name)
{
- $sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
+ $sql= "ALTER TABLE ".$table." DROP COLUMN ".$field_name;
dol_syslog($sql,LOG_DEBUG);
if (! $this->query($sql))
{
diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php
index 17141b6200d..fcc931a9ed2 100644
--- a/htdocs/core/modules/modCategorie.class.php
+++ b/htdocs/core/modules/modCategorie.class.php
@@ -65,7 +65,7 @@ class modCategorie extends DolibarrModules
// Config pages
$this->config_page_url = array('categorie.php@categories');
- $this->langfiles = array("products","companies","categories");
+ $this->langfiles = array("products","companies","categories","members");
// Constants
$this->const = array();
@@ -182,7 +182,7 @@ class modCategorie extends DolibarrModules
'u.label' => "Label",
'u.description' => "Description",
'p.rowid' => 'ContactId',
- 'p.civility' => 'Civility',
+ 'p.civility' => 'UserTitle',
'p.lastname' => 'LastName',
'p.firstname' => 'Firstname',
'p.address' => 'Address',
diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php
index c4f9dc20243..28a275c3863 100644
--- a/htdocs/core/modules/modFacture.class.php
+++ b/htdocs/core/modules/modFacture.class.php
@@ -223,7 +223,7 @@ class modFacture extends DolibarrModules
$this->export_label[$r]='CustomersInvoicesAndPayments'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("facture","facture","export"));
- $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'f.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','f.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin','pj.ref'=>'ProjectRef','p.rowid'=>'PaymentId','p.ref'=>'PaymentRef','p.amount'=>'AmountPayment','pf.amount'=>'AmountPaymentDistributedOnInvoice','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber','pt.code'=>'IdPaymentMode','pt.libelle'=>'LabelPaiementMode','p.note'=>'PaymentNote','p.fk_bank'=>'IdTransaction','ba.ref'=>'AccountRef');
+ $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'f.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','f.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin','pj.ref'=>'ProjectRef','p.rowid'=>'PaymentId','p.ref'=>'PaymentRef','p.amount'=>'AmountPayment','pf.amount'=>'AmountPaymentDistributedOnInvoice','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber','pt.code'=>'IdPaymentMode','pt.libelle'=>'LabelPaymentMode','p.note'=>'PaymentNote','p.fk_bank'=>'IdTransaction','ba.ref'=>'AccountRef');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Numeric','p.datep'=>'Date','p.num_paiement'=>'Numeric','p.fk_bank'=>'Numeric');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"Numeric",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pj.ref'=>'Text','p.amount'=>'Numeric','pf.amount'=>'Numeric','p.rowid'=>'Numeric','p.ref'=>'Text','p.datep'=>'Date','p.num_paiement'=>'Numeric','p.fk_bank'=>'Numeric','p.note'=>'Text','pt.code'=>'Text','pt.libelle'=>'text','ba.ref'=>'Text');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'pj.ref'=>'project','p.rowid'=>'payment','p.ref'=>'payment','p.amount'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment','pt.code'=>'payment','pt.libelle'=>'payment','p.note'=>'payment','f.fk_user_author'=>'user','uc.login'=>'user','f.fk_user_valid'=>'user','uv.login'=>'user','p.fk_bank'=>'account','ba.ref'=>'account');
diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php
index 659ba30a0b9..c9f46012443 100644
--- a/htdocs/core/modules/modSalaries.class.php
+++ b/htdocs/core/modules/modSalaries.class.php
@@ -73,7 +73,7 @@ class modSalaries extends DolibarrModules
$this->depends = array();
$this->requiredby = array();
$this->conflictwith = array();
- $this->langfiles = array("salaries");
+ $this->langfiles = array("salaries","bills");
// Constants
$this->const = array();
diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php
index 48de5a48a6c..759b68555b7 100644
--- a/htdocs/core/modules/modUser.class.php
+++ b/htdocs/core/modules/modUser.class.php
@@ -68,7 +68,7 @@ class modUser extends DolibarrModules
// Dependancies
$this->depends = array();
$this->requiredby = array();
- $this->langfiles = array("main","users","companies");
+ $this->langfiles = array("main","users","companies","members");
// Constants
$this->const = array();
diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php
index d8bb890c0dd..f03e511f8d0 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -120,8 +120,8 @@ if ($id > 0 && empty($object->id))
if ($object->id > 0)
{
- $title=$langs->trans("ThirdParty")." - ".$langs->trans('SupplierCard');
- if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$langs->trans('SupplierCard');
+ $title=$langs->trans("ThirdParty")." - ".$langs->trans('Supplier');
+ if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$langs->trans('Supplier');
$help_url='';
llxHeader('',$title, $help_url);
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 5021061ec19..bc2d323a855 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -1448,7 +1448,7 @@ class CommandeFournisseur extends CommonOrder
$sql.= "'".price2num($total_localtax2)."',";
$sql.= "'".price2num($total_ttc)."',";
$sql.= ($fk_unit ? "'".$this->db->escape($fk_unit)."'":"null");
- $sql.= ", ".$this->fk_multicurrency;
+ $sql.= ", ".($this->fk_multicurrency ? $this->fk_multicurrency : "null");
$sql.= ", '".$this->db->escape($this->multicurrency_code)."'";
$sql.= ", ".price2num($pu_ht * $this->multicurrency_tx);
$sql.= ", ".$multicurrency_total_ht;
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index af2f6174315..f89e4f1121e 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -380,6 +380,7 @@ ExtraInfos=Extra infos
RegulatedOn=Regulated on
ChequeNumber=Check N°
ChequeOrTransferNumber=Check/Transfer N°
+ChequeBordereau=Check schedule
ChequeMaker=Check/Transfer transmitter
ChequeBank=Bank of Check
CheckBank=Check
diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang
index b80562833b2..76bf2961c62 100644
--- a/htdocs/langs/en_US/companies.lang
+++ b/htdocs/langs/en_US/companies.lang
@@ -261,6 +261,7 @@ AddContactAddress=Create contact/address
EditContact=Edit contact
EditContactAddress=Edit contact/address
Contact=Contact
+ContactId=Contact id
ContactsAddresses=Contacts/Addresses
NoContactDefinedForThirdParty=No contact defined for this third party
NoContactDefined=No contact defined
diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php
index 35bd8e85155..f6d94fb8135 100644
--- a/htdocs/margin/tabs/productMargins.php
+++ b/htdocs/margin/tabs/productMargins.php
@@ -69,11 +69,21 @@ if ($id > 0 || ! empty($ref))
{
$result = $object->fetch($id, $ref);
- $helpurl='';
- if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
- if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
+ $title = $langs->trans('ProductServiceCard');
+ $helpurl = '';
+ $shortlabel = dol_trunc($object->label,16);
+ if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
+ {
+ $title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Card');
+ $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
+ }
+ if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
+ {
+ $title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Card');
+ $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
+ }
- llxHeader("", $langs->trans("CardProduct".$object->type), $help_url);
+ llxHeader('', $title, $helpurl);
/*
* En mode visu
diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php
index b1c69268325..26cf85cb3d6 100644
--- a/htdocs/opensurvey/card.php
+++ b/htdocs/opensurvey/card.php
@@ -188,10 +188,11 @@ if ($object->fk_user_creat)
$userstatic->fetch($object->fk_user_creat);
}
-
+$title = $object->titre." - ".$langs->trans('Card');
+$helpurl = '';
$arrayofjs=array();
$arrayofcss=array('/opensurvey/css/style.css');
-llxHeader('',$object->titre, 0, 0, 0, 0, $arrayofjs, $arrayofcss);
+llxHeader('',$title, $helpurl, 0, 0, 0, $arrayofjs, $arrayofcss);
// Define format of choices
@@ -219,7 +220,7 @@ print '
';
diff --git a/htdocs/opensurvey/wizard/create_survey.php b/htdocs/opensurvey/wizard/create_survey.php
index c9ba1324a70..94ec2a7c247 100644
--- a/htdocs/opensurvey/wizard/create_survey.php
+++ b/htdocs/opensurvey/wizard/create_survey.php
@@ -1,7 +1,7 @@
* Copyright (C) 2014 Marcos García
- * Copyright (C) 2015 Alexandre Spangaro
+ * Copyright (C) 2015-2016 Alexandre Spangaro
*
* 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
@@ -133,15 +133,15 @@ llxHeader('', $langs->trans("OpenSurvey"), '', "", 0, 0, $arrayofjs, $arrayofcss
print load_fiche_titre($langs->trans("CreatePoll").' (1 / 2)');
-//debut du formulaire
+// debut du formulaire
print '