/[dolibarr]/dolibarr/htdocs/telephonie/lignetel.class.php
ViewVC logotype

Diff of /dolibarr/htdocs/telephonie/lignetel.class.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by rodolphe, Wed Oct 19 11:19:33 2005 UTC revision 1.27 by rodolphe, Thu Nov 3 13:16:03 2005 UTC
# Line 475  class LigneTel { Line 475  class LigneTel {
475     * Change le statut de la ligne     * Change le statut de la ligne
476     *     *
477     */     */
478    function set_statut($user, $statut, $datea='', $commentaire='')    function set_statut($user, $statut, $datea='', $commentaire='', $fourn=0)
479    {    {
   
480      if ($statut == 6 || $statut == 3)      if ($statut == 6 || $statut == 3)
481        {        {
482          $this->send_mail($user, $commentaire, $statut);          $this->send_mail($user, $commentaire, $statut);
# Line 488  class LigneTel { Line 487  class LigneTel {
487      $sql .= " SET statut = ".$statut ;      $sql .= " SET statut = ".$statut ;
488      $sql .= " WHERE rowid =".$this->id;      $sql .= " WHERE rowid =".$this->id;
489            
490        if ($fourn > 0)
491          {
492            $sql .= " AND fk_fournisseur =".$fourn;
493          }
494    
495      $this->db->query($sql);      $this->db->query($sql);
496            
497      if ($statut == 2)      if ($statut == 2)
498        {        {
499          $sql = "UPDATE ".MAIN_DB_PREFIX."telephonie_societe_ligne";          $sql = "UPDATE ".MAIN_DB_PREFIX."telephonie_societe_ligne";
         $sql .= " SET statut = ".$statut ;  
         $sql .= " WHERE rowid =".$this->id;  
   
         $this->db->query($sql);  
   
         $sql = "UPDATE ".MAIN_DB_PREFIX."telephonie_societe_ligne";  
500          $sql .= " SET date_commande = now()";          $sql .= " SET date_commande = now()";
501          $sql .= ", fk_user_commande=".$user->id;          $sql .= ", fk_user_commande=".$user->id;
502          $sql .= " WHERE rowid =".$this->id;          $sql .= " WHERE rowid =".$this->id;
503          $sql .= " AND date_commande IS NULL";              $sql .= " AND date_commande IS NULL";    
504    
505          $this->db->query($sql);          if ($fourn > 0)
506              {
507                $sql .= " AND fk_fournisseur =".$fourn;
508              }
509    
510            $this->db->query($sql);
511        }        }
512    
513      if ($datea)      if ($datea)
# Line 532  class LigneTel { Line 534  class LigneTel {
534          $sql .= " AND dates >= '".$datea ."'";          $sql .= " AND dates >= '".$datea ."'";
535    
536          $this->db->query($sql);          $this->db->query($sql);
   
537        }        }
538      else      else
539        {        {

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26