From d7163fe5434d1efae6371b50adafffa869209178 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 15:34:33 +0200 Subject: [PATCH] Qual: Start to fight deprecated code use reported by https://scrutinizer-ci.com/g/eldy/dolibarr/issues/develop?orderField=path&order=asc --- htdocs/comm/action/listactions.php | 12 +----------- htdocs/comm/address.php | 4 ++-- htdocs/societe/class/societe.class.php | 8 +++++--- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index cdd81877d7bb4..055086bbdbbae 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -195,16 +195,6 @@ if ($status == 'done') $title=$langs->trans("DoneActions"); if ($status == 'todo') $title=$langs->trans("ToDoActions"); - /*if ($socid) - { - $societe = new Societe($db); - $societe->fetch($socid); - $newtitle=$langs->trans($title).' '.$langs->trans("For").' '.$societe->nom; - } - else - { - $newtitle=$langs->trans($title); - }*/ $newtitle=$langs->trans($title); $tabactive=''; @@ -298,7 +288,7 @@ { $societestatic->id=$obj->socid; $societestatic->client=$obj->client; - $societestatic->nom=$obj->societe; + $societestatic->name=$obj->societe; print $societestatic->getNomUrl(1,'',10); } else print ' '; diff --git a/htdocs/comm/address.php b/htdocs/comm/address.php index 86333a3996c66..438f22d28c268 100644 --- a/htdocs/comm/address.php +++ b/htdocs/comm/address.php @@ -304,7 +304,7 @@ $societe->fetch($socid); $head = societe_prepare_head($societe); - dol_fiche_head($head, 'card', $societe->nom); + dol_fiche_head($head, 'card', $societe->name); print_titre($langs->trans("EditAddress")); print "
\n"; @@ -407,7 +407,7 @@ $societe->fetch($object->socid); $head = societe_prepare_head($societe); - dol_fiche_head($head, 'customer', $societe->nom); + dol_fiche_head($head, 'customer', $societe->name); // Confirmation delete diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 814ed4832b369..96a9d89b9e0e1 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -58,6 +58,7 @@ class Societe extends CommonObject * @deprecated Use $name instead */ var $nom; + var $firstname; var $lastname; var $particulier; @@ -65,6 +66,7 @@ class Societe extends CommonObject var $address; var $zip; var $town; + /** * 0=activity ceased, 1= in activity * @var int @@ -443,7 +445,7 @@ function create($user='') { // Call trigger $result=$this->call_trigger('COMPANY_CREATE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } else $error++; @@ -879,7 +881,7 @@ function update($id, $user='', $call_trigger=1, $allowmodcodeclient=0, $allowmod { // Call trigger $result=$this->call_trigger('COMPANY_MODIFY',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } @@ -1245,7 +1247,7 @@ function delete($id) // Call trigger $result=$this->call_trigger('COMPANY_DELETE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers if (! $error)