diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 693ed93482484e86090a2fbb5ba51608a52a6f9f..744400211da0867cec5800410a8be971e8401e66 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 '<tr><td>'.$langs->trans("LinkedObject").'</td>'; + print '<td colspan="3">'.dolGetElementUrl($originid,$origin,1).'</td></tr>'; print '<input type="hidden" name="fk_element" size="10" value="'.GETPOST('originid').'">'; print '<input type="hidden" name="elementtype" size="10" value="'.GETPOST('origin').'">'; } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 543cf862d8fbf2ec11dbc02874c7fae2865c6ecb..e559946e413692bca9288e66f6a7926e3635082c 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 b659e05c72ab4f3a4e00a33cbba707a972e539f9..566f887ba523e73c4699551afbfdb9595761481b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1,9 +1,9 @@ <?php -/* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net> +/* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> - * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> + * Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2011-2014 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2012-2015 Marcos GarcĂa <marcosgdf@gmail.com> @@ -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 0c44708c6db2a20e17815641aa1bb0f8a0402c27..ee3a9d586b5db473b9bc586e9579c07392c990c8 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 5ca742f08160fe5df06feba99b4ebf52f626b5e5..4cc34477fdede7f48267b02dbd28adcb239b79c4 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<br>Syntax : table_ ExtrafieldParamHelpchkbxlst=Parameters list comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value <br> if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another :<br>c_typent:libelle:id:parent_list_code|parent_column:filter LibraryToBuildPDF=Library used to build PDF WarningUsingFPDF=Warning: Your <b>conf.php</b> contains directive <b>dolibarr_pdf_force_fpdf=1</b>. 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.<br>To solve this and have a full support of PDF generation, please download <a href="http://www.tcpdf.org/" target="_blank">TCPDF library</a>, then comment or remove the line <b>$dolibarr_pdf_force_fpdf=1</b>, and add instead <b>$dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'</b> -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:<br>1 : local tax apply on products and services without vat (localtax is calculated on amount without tax)<br>2 : local tax apply on products and services including vat (localtax is calculated on amount + main tax)<br>3 : local tax apply on products without vat (localtax is calculated on amount without tax)<br>4 : local tax apply on products including vat (vat is calculated on amount + main vat)<br>5 : local tax apply on services without vat (localtax is calculated on amount without tax)<br>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:<br>1 : local tax apply on products and services without vat (localtax is calculated on amount without tax)<br>2 : local tax apply on products and services including vat (localtax is calculated on amount + main tax)<br>3 : local tax apply on products without vat (localtax is calculated on amount without tax)<br>4 : local tax apply on products including vat (localtax is calculated on amount + main vat)<br>5 : local tax apply on services without vat (localtax is calculated on amount without tax)<br>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 <strong>%s</strong> RefreshPhoneLink=Refresh link diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 8d0d4484a2e6a7513d9f683b90688d4be0b0ae30..33edc83dd85fa82ac3ce7e74aa3bd7866e12941d 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 '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">'."\n"; + print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST">'."\n"; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="id" value="'.$object->id.'">'; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index b059b75bdabae32489e4abe513859c2547446ff8..cd544b4fd83a03ba7b40deff7a05debb4b930544 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 '</form>'; } -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 20ef1714164af0f174fbc0e4de92bc6c9990e501..02e1dd0edbb094312d8f93b7e429555257178b4f 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -392,10 +392,13 @@ if ($id > 0 || ! empty($ref)) print '<td class="nowrap">'; 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 '</td>';