diff --git a/dev/skeletons/build_class_from_table.php b/dev/skeletons/build_class_from_table.php index d9e30b23501..0e5a6d82a82 100755 --- a/dev/skeletons/build_class_from_table.php +++ b/dev/skeletons/build_class_from_table.php @@ -636,7 +636,8 @@ foreach ($skeletonfiles as $skeletonfile => $outfile) { if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime']) { - $varprop.="print ''.\$langs->trans(\"Field".$prop['field']."\").'".$prop['field'].".'\">';\n"; + $baseString = 'print "".\$langs->trans("Field%s")."%s."\">";'; + $varprop.= sprintf("\t ".$baseString." \n", $prop['field'], $prop['field'], $prop['field']); } } $targetcontent=preg_replace('/LIST_OF_TD_LABEL_FIELDS_EDIT/', $varprop, $targetcontent); @@ -648,7 +649,7 @@ foreach ($skeletonfiles as $skeletonfile => $outfile) { if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime']) { - $varprop.="print ''.\$langs->trans(\"Field".$prop['field']."\").'\$object->".$prop['field']."';\n"; + $varprop.=sprintf("\t print ''.\$langs->trans(\"Field%s\").''.\$object->%s.'';\n",$prop['field'],$prop['field']); } } $targetcontent=preg_replace('/LIST_OF_TD_LABEL_FIELDS_VIEW/', $varprop, $targetcontent); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index b272105fe16..b5d15e07833 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1487,7 +1487,8 @@ if ($id) $canbemodified=$iserasable; if ($obj->code == 'RECEP') $canbemodified=1; - $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):''); + $rowidcol=$tabrowid[$id]; + $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->{$rowidcol})?$obj->{$rowidcol}:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):''); if ($param) $url .= '&'.$param; $url.='&'; diff --git a/htdocs/cashdesk/class/Auth.class.php b/htdocs/cashdesk/class/Auth.class.php index 33bbd094050..5e431514d1c 100644 --- a/htdocs/cashdesk/class/Auth.class.php +++ b/htdocs/cashdesk/class/Auth.class.php @@ -22,14 +22,14 @@ */ class Auth { - var $db; + protected $db; - var $login; - var $passwd; + private $login; + private $passwd; - var $reponse; + private $reponse; - var $sqlQuery; + public $sqlQuery; /** * Enter description here ... @@ -37,7 +37,7 @@ class Auth * @param DoliDB $db Database handler * @return void */ - function __construct($db) + public function __construct($db) { $this->db = $db; $this->reponse(null); @@ -49,7 +49,7 @@ class Auth * @param string $aLogin Login * @return void */ - function login($aLogin) + public function login($aLogin) { $this->login = $aLogin; } @@ -71,7 +71,7 @@ class Auth * @param string $aReponse Response * @return void */ - function reponse($aReponse) + public function reponse($aReponse) { $this->reponse = $aReponse; } @@ -83,7 +83,7 @@ class Auth * @param string $aPasswd Password * @return int 0 or 1 */ - function verif($aLogin, $aPasswd) + public function verif($aLogin, $aPasswd) { global $conf,$langs; global $dolibarr_main_authentication,$dolibarr_auto_user; diff --git a/htdocs/cashdesk/tpl/validation2.tpl.php b/htdocs/cashdesk/tpl/validation2.tpl.php index 844522f55e0..8f24e2069aa 100644 --- a/htdocs/cashdesk/tpl/validation2.tpl.php +++ b/htdocs/cashdesk/tpl/validation2.tpl.php @@ -29,15 +29,15 @@ $langs->load("bills"); diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 3b4fa942f81..40051753252 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -41,61 +41,61 @@ class Contact extends CommonObject public $table_element='socpeople'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - var $civility_id; // In fact we store civility_code - var $civility_code; - var $address; - var $zip; - var $town; + public $civility_id; // In fact we store civility_code + public $civility_code; + public $address; + public $zip; + public $town; /** * @deprecated * @see state_id */ - var $fk_departement; + public $fk_departement; /** * @deprecated * @see state_code */ - var $departement_code; + public $departement_code; /** * @deprecated * @see state */ - var $departement; - var $state_id; // Id of department - var $state_code; // Code of department - var $state; // Label of department + public $departement; + public $state_id; // Id of department + public $state_code; // Code of department + public $state; // Label of department - var $poste; // Position + public $poste; // Position - var $socid; // fk_soc - var $statut; // 0=inactif, 1=actif + public $socid; // fk_soc + public $statut; // 0=inactif, 1=actif - var $code; - var $email; - var $skype; - var $photo; - var $jabberid; - var $phone_pro; - var $phone_perso; - var $phone_mobile; - var $fax; + public $code; + public $email; + public $skype; + public $photo; + public $jabberid; + public $phone_pro; + public $phone_perso; + public $phone_mobile; + public $fax; - var $priv; + public $priv; - var $birthday; - var $default_lang; - var $no_email; // 1=Don't send e-mail to this contact, 0=do + public $birthday; + public $default_lang; + public $no_email; // 1=Don't send e-mail to this contact, 0=do - var $ref_facturation; // Nb de reference facture pour lequel il est contact - var $ref_contrat; // Nb de reference contrat pour lequel il est contact - var $ref_commande; // Nb de reference commande pour lequel il est contact - var $ref_propal; // Nb de reference propal pour lequel il est contact + public $ref_facturation; // Reference number of invoice for which it is contact + public $ref_contrat; // Nb de reference contrat pour lequel il est contact + public $ref_commande; // Nb de reference commande pour lequel il est contact + public $ref_propal; // Nb de reference propal pour lequel il est contact - var $user_id; - var $user_login; + public $user_id; + public $user_login; - var $oldcopy; // To contains a clone of this when we need to save old properties of object + public $oldcopy; // To contains a clone of this when we need to save old properties of object /** diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index f656e7a41e7..053e5b314d6 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2346,8 +2346,11 @@ class CommandeFournisseur extends CommonOrder $subprice = price2num($pu_ht,'MU'); + //Fetch current line from the database and then clone the object and set it in $oldline property $this->line=new CommandeFournisseurLigne($this->db); $this->line->fetch($rowid); + $oldline = clone $this->line; + $this->line->oldline = $oldline; $this->line->context = $this->context; diff --git a/htdocs/societe/class/address.class.php b/htdocs/societe/class/address.class.php index d8a1687cf9d..43e46008910 100644 --- a/htdocs/societe/class/address.class.php +++ b/htdocs/societe/class/address.class.php @@ -31,21 +31,21 @@ */ class Address { - var $db; + protected $db; - var $id; - var $type; - var $label; - var $socid; - var $name; - var $address; - var $zip; - var $town; - var $country_id; - var $country_code; - var $phone; - var $fax; - var $note; + public $id; + public $type; + public $label; + public $socid; + public $name; + public $address; + public $zip; + public $town; + public $country_id; + public $country_code; + public $phone; + public $fax; + public $note; /** * Adresses liees a la societe @@ -495,21 +495,21 @@ class Address */ class AddressLine { - - var $id; - var $date_creation; - var $date_modification; - var $label; - var $name; - var $address; - var $zip; - var $town; - var $country_id; - var $country_code; - var $country; - var $phone; - var $fax; - var $note; + protected $db; + public $id; + public $date_creation; + public $date_modification; + public $label; + public $name; + public $address; + public $zip; + public $town; + public $country_id; + public $country_code; + public $country; + public $phone; + public $fax; + public $note; /**