From e639f2a91fc2644deb265f2404d9b8f6a02ff72d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Mar 2018 10:51:12 +0100 Subject: [PATCH] Removed deprecated method classer_facturee(). Duplicate of classifyBilled --- htdocs/api/class/api.class.php | 1 - htdocs/comm/action/class/actioncomm.class.php | 1 - htdocs/comm/action/pertype.php | 4 -- htdocs/comm/action/peruser.php | 38 +++++++++---------- htdocs/comm/card.php | 16 ++++---- htdocs/comm/propal/class/propal.class.php | 15 -------- htdocs/commande/class/commande.class.php | 26 +------------ htdocs/commande/orderstoinvoice.php | 4 +- htdocs/expedition/index.php | 30 +++++++-------- 9 files changed, 45 insertions(+), 90 deletions(-) diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index df87efcd8c3..92391a14dc0 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -140,7 +140,6 @@ class DolibarrApi unset($object->class_element_line); unset($object->picto); - unset($object->facturee); // Replace with billed unset($object->fieldsforcombobox); unset($object->comments); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 685ee6526d3..682e66e8144 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -592,7 +592,6 @@ class ActionComm extends CommonObject $this->label = $obj->label; $this->datep = $this->db->jdate($obj->datep); $this->datef = $this->db->jdate($obj->datep2); -// $this->durationp = $this->durationp; // deprecated $this->datec = $this->db->jdate($obj->datec); $this->datem = $this->db->jdate($obj->datem); diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index cc3688a4793..1657166bd3d 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -468,10 +468,8 @@ if ($resql) $event->datef=$datep2; $event->type_code=$obj->code; $event->type_color=$obj->color; - //$event->libelle=$obj->label; // deprecated $event->label=$obj->label; $event->percentage=$obj->percent; - //$event->author->id=$obj->fk_user_author; // user id of creator $event->authorid=$obj->fk_user_author; // user id of creator $event->userownerid=$obj->fk_user_action; // user id of owner $event->priority=$obj->priority; @@ -483,8 +481,6 @@ if ($resql) $event->socid=$obj->fk_soc; $event->contactid=$obj->fk_contact; - //$event->societe->id=$obj->fk_soc; // deprecated - //$event->contact->id=$obj->fk_contact; // deprecated $event->fk_element=$obj->fk_element; $event->elementtype=$obj->elementtype; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 7922f33a05d..f6939ddc2b6 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -496,10 +496,8 @@ if ($resql) $event->datef=$datep2; $event->type_code=$obj->code; $event->type_color=$obj->color; - //$event->libelle=$obj->label; // deprecated $event->label=$obj->label; $event->percentage=$obj->percent; - //$event->author->id=$obj->fk_user_author; // user id of creator $event->authorid=$obj->fk_user_author; // user id of creator $event->userownerid=$obj->fk_user_action; // user id of owner $event->priority=$obj->priority; @@ -511,8 +509,6 @@ if ($resql) $event->socid=$obj->fk_soc; $event->contactid=$obj->fk_contact; - //$event->societe->id=$obj->fk_soc; // deprecated - //$event->contact->id=$obj->fk_contact; // deprecated $event->fk_element=$obj->fk_element; $event->elementtype=$obj->elementtype; @@ -624,9 +620,9 @@ $currentdaytoshow = $firstdaytoshow; echo '
'; while($currentdaytoshow<$lastdaytoshow) { - + echo ''; - + echo ''; echo ''; $i=0; // 0 = sunday, @@ -646,7 +642,7 @@ while($currentdaytoshow<$lastdaytoshow) { $i++; } echo "\n"; - + echo ''; echo ''; $i=0; @@ -667,8 +663,8 @@ while($currentdaytoshow<$lastdaytoshow) { $i++; } echo "\n"; - - + + // Define $usernames $usernames = array(); //init $usernamesid = array(); @@ -722,7 +718,7 @@ while($currentdaytoshow<$lastdaytoshow) { $result=$tmpuser->fetch($id); $usernames[]=$tmpuser; } - + /* if ($filtert > 0) { @@ -742,7 +738,7 @@ while($currentdaytoshow<$lastdaytoshow) { //$tmpgroup->fetch($usergroup); No fetch, we want all users for all groups $usernames = $tmpgroup->listUsersForGroup(); }*/ - + // Load array of colors by type $colorsbytype=array(); $labelbytype=array(); @@ -753,7 +749,7 @@ while($currentdaytoshow<$lastdaytoshow) { $colorsbytype[$obj->code]=$obj->color; $labelbytype[$obj->code]=$obj->libelle; } - + // Loop on each user to show calendar $todayarray=dol_getdate($now,'fast'); $sav = $tmpday; @@ -767,42 +763,42 @@ while($currentdaytoshow<$lastdaytoshow) { print $username->getNomUrl(-1,'',0,0,20,1,''); print ''; $tmpday = $sav; - + // Lopp on each day of week $i = 0; for ($iter_day = 0; $iter_day < 8; $iter_day++) { - + if (($i + 1) < $begin_d || ($i + 1) > $end_d) { $i++; continue; } - + // Show days of the current week $curtime = dol_time_plus_duree($currentdaytoshow, $iter_day, 'd'); $tmparray = dol_getdate($curtime,'fast'); $tmpday = $tmparray['mday']; $tmpmonth = $tmparray['mon']; $tmpyear = $tmparray['year']; - + $style='cal_current_month'; if ($iter_day == 6) $style.=' cal_other_month'; $today=0; if ($todayarray['mday']==$tmpday && $todayarray['mon']==$tmpmonth && $todayarray['year']==$tmpyear) $today=1; if ($today) $style='cal_today_peruser'; - + show_day_events2($username, $tmpday, $tmpmonth, $tmpyear, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype, $var); - + $i++; } echo "\n"; $showheader = false; } - + echo "
\n"; echo "
"; - + $currentdaytoshow = dol_time_plus_duree($currentdaytoshow, 7, 'd'); } @@ -921,7 +917,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $colorindexused[$user->id] = 0; // Color index for current user (user->id) is always 0 $nextindextouse=count($colorindexused); // At first run this is 0, so first user has 0, next 1, ... //if ($username->id && $day==1) var_dump($eventarray); - + // We are in a particular day for $username, now we scan all events foreach ($eventarray as $daykey => $notused) { diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 301c5869502..4f012710a39 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -751,7 +751,7 @@ if ($object->id > 0) { // Check if there are orders billable $sql2 = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,'; - $sql2.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee'; + $sql2.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as billed'; $sql2.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql2.= ', '.MAIN_DB_PREFIX.'commande as c'; $sql2.= ' WHERE c.fk_soc = s.rowid'; @@ -779,14 +779,16 @@ if ($object->id > 0) { $objp = $db->fetch_object($resql); + $commande_static->id = $objp->cid; + $commande_static->ref = $objp->ref; + $commande_static->ref_client=$objp->ref_client; + $commande_static->total_ht = $objp->total_ht; + $commande_static->total_tva = $objp->total_tva; + $commande_static->total_ttc = $objp->total_ttc; + $commande_static->billed = $objp->billed; + print ''; print ''; - $commande_static->id = $objp->cid; - $commande_static->ref = $objp->ref; - $commande_static->ref_client=$objp->ref_client; - $commande_static->total_ht = $objp->total_ht; - $commande_static->total_tva = $objp->total_tva; - $commande_static->total_ttc = $objp->total_ttc; print $commande_static->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->dc),'day')."\n"; print ''.price($objp->total_ht).''; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 67090f386dc..6e98329a4cc 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2528,21 +2528,6 @@ class Propal extends CommonObject } } - /** - * Class invoiced the Propal - * - * @return int <0 si ko, >0 si ok - * @deprecated - * @see classifyBilled() - */ - function classer_facturee() - { - global $user; - dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING); - - return $this->classifyBilled($user); - } - /** * Set draft status * diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 52219e12d9f..15c4a9d94de 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -79,10 +79,9 @@ class Commande extends CommonOrder */ public $statut; /** - * @deprecated - * @see billed + * Billed + * @var int */ - public $facturee; public $billed; // billed or not public $brouillon; @@ -545,7 +544,6 @@ class Commande extends CommonOrder { $this->statut = self::STATUS_VALIDATED; $this->billed = 0; - $this->facturee = 0; // deprecated $this->db->commit(); return 1; @@ -1624,7 +1622,6 @@ class Commande extends CommonOrder $this->remise_percent = $obj->remise_percent; $this->remise_absolue = $obj->remise_absolue; $this->source = $obj->source; - $this->facturee = $obj->billed; // deprecated $this->billed = $obj->billed; $this->note = $obj->note_private; // deprecated $this->note_private = $obj->note_private; @@ -2701,7 +2698,6 @@ class Commande extends CommonOrder if (! $error) { $this->oldcopy= clone $this; - $this->facturee=1; // deprecated $this->billed=1; } @@ -2737,21 +2733,6 @@ class Commande extends CommonOrder } } - /** - * Classify the order as invoiced - * - * @return int <0 if ko, >0 if ok - * @deprecated - * @see classifyBilled() - */ - function classer_facturee() - { - global $user; - dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING); - - return $this->classifyBilled($user); - } - /** * Classify the order as not invoiced * @@ -2773,7 +2754,6 @@ class Commande extends CommonOrder if (! $error) { $this->oldcopy= clone $this; - $this->facturee=1; // deprecated $this->billed=1; } @@ -2784,7 +2764,6 @@ class Commande extends CommonOrder if (! $error) { - $this->facturee=0; // deprecated $this->billed=0; $this->db->commit(); @@ -3319,7 +3298,6 @@ class Commande extends CommonOrder */ function getLibStatut($mode) { - if ($this->facturee && empty($this->billed)) $this->billed=$this->facturee; // For backward compatibility return $this->LibStatut($this->statut, $this->billed, $mode); } diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index a15598ee82d..bebcaa93097 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -545,7 +545,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error) rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -695,7 +695,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error) print ''; // Statut - print ''.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).''; + print ''.$generic_commande->LibStatut($objp->fk_statut,$objp->billed,5).''; // Checkbox print ''; diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index 7eaba0b29ad..ebfe9a0f434 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -93,11 +93,11 @@ if ($resql) while ($i < $num) { $obj = $db->fetch_object($resql); - + $shipment->id=$obj->rowid; $shipment->ref=$obj->ref; - $shipment->ref_customer=$obj->ref_customer; - + $shipment->ref_customer=$obj->ref_customer; + print ''; print $shipment->getNomUrl(1); print ""; @@ -148,11 +148,11 @@ if ($resql) $orderstatic->ref=$obj->ref; $orderstatic->ref_customer=$obj->ref_customer; $orderstatic->statut=$obj->fk_statut; - $orderstatic->facturee=0; - + $orderstatic->billed=0; + $companystatic->name=$obj->name; - $companystatic->id=$obj->socid; - + $companystatic->id=$obj->socid; + print ''; print ''; print $orderstatic->getNomUrl(1); @@ -203,16 +203,16 @@ if ( $resql ) while ($i < $num) { $obj = $db->fetch_object($resql); - + $orderstatic->id=$obj->rowid; $orderstatic->ref=$obj->ref; $orderstatic->ref_customer=$obj->ref_customer; $orderstatic->statut=$obj->status; - $orderstatic->facturee=$obj->billed; - + $orderstatic->billed=$obj->billed; + $companystatic->name=$obj->name; - $companystatic->id=$obj->socid; - + $companystatic->id=$obj->socid; + print ''; print $orderstatic->getNomUrl(1); print ''; @@ -262,11 +262,11 @@ if ($resql) while ($i < $num) { $obj = $db->fetch_object($resql); - + $shipment->id=$obj->rowid; $shipment->ref=$obj->ref; - $shipment->ref_customer=$obj->ref_customer; - + $shipment->ref_customer=$obj->ref_customer; + print ''; print $shipment->getNomUrl(1); print '';