diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 693ed934824..744400211da 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -747,6 +747,9 @@ if ($action == 'create') } if(!empty($origin) && !empty($originid)) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + print ''.$langs->trans("LinkedObject").''; + print ''.dolGetElementUrl($originid,$origin,1).''; print ''; print ''; } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 543cf862d8f..e559946e413 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -211,13 +211,16 @@ class ActionComm extends CommonObject if ($this->elementtype=='commande') $this->elementtype='order'; if ($this->elementtype=='contrat') $this->elementtype='contract'; - if (! is_array($this->userassigned)) // For backward compatibility + if (! is_array($this->userassigned) && ! empty($this->userassigned)) // For backward compatibility { $tmpid=$this->userassigned; $this->userassigned=array(); $this->userassigned[$tmpid]=array('id'=>$tmpid); } + if (is_object($this->contact) && $this->contact->id > 0 && ! ($this->contactid > 0)) $this->contactid = $this->contact->id; // For backward compatibility. Using this->contact->xx is deprecated + + $userownerid=$this->userownerid; $userdoneid=$this->userdoneid; @@ -282,13 +285,13 @@ class ActionComm extends CommonObject $sql.= "'".$this->db->idate($now)."',"; $sql.= (strval($this->datep)!=''?"'".$this->db->idate($this->datep)."'":"null").","; $sql.= (strval($this->datef)!=''?"'".$this->db->idate($this->datef)."'":"null").","; - $sql.= (isset($this->durationp) && $this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").","; // deprecated + $sql.= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '')?"'".$this->durationp."'":"null").","; // deprecated $sql.= (isset($this->type_id)?$this->type_id:"null").","; $sql.= (isset($this->type_code)?" '".$this->type_code."'":"null").","; - $sql.= (isset($this->socid) && $this->socid > 0?" '".$this->socid."'":"null").","; - $sql.= (isset($this->fk_project) && $this->fk_project > 0?" '".$this->fk_project."'":"null").","; + $sql.= ((isset($this->socid) && $this->socid > 0)?" '".$this->socid."'":"null").","; + $sql.= ((isset($this->fk_project) && $this->fk_project > 0)?" '".$this->fk_project."'":"null").","; $sql.= " '".$this->db->escape($this->note)."',"; - $sql.= (isset($this->contactid) && $this->contactid > 0?"'".$this->contactid."'":"null").","; + $sql.= ((isset($this->contactid) && $this->contactid > 0)?"'".$this->contactid."'":"null").","; $sql.= (isset($user->id) && $user->id > 0 ? "'".$user->id."'":"null").","; $sql.= ($userownerid>0?"'".$userownerid."'":"null").","; $sql.= ($userdoneid>0?"'".$userdoneid."'":"null").","; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b659e05c72a..566f887ba52 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1,9 +1,9 @@ +/* Copyright (C) 2006-2015 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2015 Juanjo Menent * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2011-2014 Philippe Grand * Copyright (C) 2012-2015 Marcos GarcĂ­a @@ -47,21 +47,6 @@ abstract class CommonObject */ public $error; - /** - * @var string[] Array of error strings - */ - public $errors=array(); - - /** - * @var string Can be used to pass information when only object is provied to method - */ - public $context=array(); - - /** - * @var string Contains canvas name if record is an alternative canvas record - */ - public $canvas; - /** * @var string Key value used to track if data is coming from import wizard */ @@ -89,7 +74,23 @@ abstract class CommonObject - // Following var are used by some objects only. We keep this property here in CommonObject to be able to provide common method using them. + // Following vars are used by some objects only. We keep this property here in CommonObject to be able to provide common method using them. + + /** + * @var string[] Array of error strings + */ + public $errors=array(); + + /** + * @var string Can be used to pass information when only object is provided to method + */ + public $context=array(); + + /** + * @var string Contains canvas name if record is an alternative canvas record + */ + public $canvas; + public $name; public $lastname; diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 0c44708c6db..ee3a9d586b5 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -207,8 +207,9 @@ UPDATE llx_product SET fk_barcode_type = NULL WHERE fk_barcode_type NOT IN (SELE -- fk_user_author ALTER TABLE llx_product_price ADD INDEX idx_product_price_fk_user_author (fk_user_author); UPDATE llx_product_price set fk_user_author = null where fk_user_author = 0; +UPDATE llx_product_price set fk_user_author = null where fk_user_author not in (select rowid from llx_user); ALTER TABLE llx_product_price ADD CONSTRAINT fk_product_price_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); --- fk_user_author +-- fk_product ALTER TABLE llx_product_price ADD INDEX idx_product_price_fk_product (fk_product); DELETE from llx_product_price where fk_product NOT IN (SELECT rowid from llx_product); ALTER TABLE llx_product_price ADD CONSTRAINT fk_product_price_product FOREIGN KEY (fk_product) REFERENCES llx_product (rowid); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5ca742f0816..4cc34477fde 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -398,7 +398,7 @@ ExtrafieldParamHelpsellist=Parameters list comes from a table
Syntax : table_ ExtrafieldParamHelpchkbxlst=Parameters list comes from a table
Syntax : table_name:label_field:id_field::filter
Example : c_typent:libelle:id::filter

filter can be a simple test (eg active=1) to display only active value
if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another :
c_typent:libelle:id:parent_list_code|parent_column:filter LibraryToBuildPDF=Library used to build PDF WarningUsingFPDF=Warning: Your conf.php contains directive dolibarr_pdf_force_fpdf=1. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation.
To solve this and have a full support of PDF generation, please download TCPDF library, then comment or remove the line $dolibarr_pdf_force_fpdf=1, and add instead $dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir' -LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are:
1 : local tax apply on products and services without vat (localtax is calculated on amount without tax)
2 : local tax apply on products and services including vat (localtax is calculated on amount + main tax)
3 : local tax apply on products without vat (localtax is calculated on amount without tax)
4 : local tax apply on products including vat (vat is calculated on amount + main vat)
5 : local tax apply on services without vat (localtax is calculated on amount without tax)
6 : local tax apply on services including vat (localtax is calculated on amount + tax) +LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are:
1 : local tax apply on products and services without vat (localtax is calculated on amount without tax)
2 : local tax apply on products and services including vat (localtax is calculated on amount + main tax)
3 : local tax apply on products without vat (localtax is calculated on amount without tax)
4 : local tax apply on products including vat (localtax is calculated on amount + main vat)
5 : local tax apply on services without vat (localtax is calculated on amount without tax)
6 : local tax apply on services including vat (localtax is calculated on amount + tax) SMS=SMS LinkToTestClickToDial=Enter a phone number to call to show a link to test the ClickToDial url for user %s RefreshPhoneLink=Refresh link diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 8d0d4484a2e..33edc83dd85 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1177,7 +1177,7 @@ else print_fiche_titre($langs->trans('Modify').' '.$type.' : '.(is_object($object->oldcopy)?$object->oldcopy->ref:$object->ref), ""); // Main official, simple, and not duplicated code - print '
'."\n"; + print ''."\n"; print ''; print ''; print ''; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index b059b75bdab..cd544b4fd83 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -351,7 +351,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print '
'; } -else +else if ($id > 0 || ! empty($ref)) { /* * Fiche projet en mode visu diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 20ef1714164..02e1dd0edbb 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -392,10 +392,13 @@ if ($id > 0 || ! empty($ref)) print ''; print img_object('','user','class="hideonsmartphone"'); $contactsoftask=$object->getListContactId('internal'); - if (count($contactsoftask)>0) { + if (count($contactsoftask)>0) + { $userid=$contactsoftask[0]; - print $form->select_dolusers($userid,'userid',0,'',0,'',$contactsoftask); - }else { + print $form->select_dolusers((GETPOST('userid')?GETPOST('userid'):$userid),'userid',0,'',0,'',$contactsoftask); + } + else + { print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); } print '';