/[dolibarr]/dolibarr/htdocs/telephonie/script/commande_presel_statut.php
ViewVC logotype

Diff of /dolibarr/htdocs/telephonie/script/commande_presel_statut.php

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

revision 1.3 by rodolphe, Thu Oct 20 13:52:20 2005 UTC revision 1.4 by rodolphe, Mon Oct 31 15:33:31 2005 UTC
# Line 24  Line 24 
24   */   */
25  require ("../../master.inc.php");  require ("../../master.inc.php");
26  require_once DOL_DOCUMENT_ROOT."/telephonie/lignetel.class.php";  require_once DOL_DOCUMENT_ROOT."/telephonie/lignetel.class.php";
27    require_once (DOL_DOCUMENT_ROOT."/lib/dolibarrmail.class.php");
28    
29    
30  set_time_limit(0);  set_time_limit(0);
31    
# Line 104  while ( $childrenNow < $childrenTotal ) Line 106  while ( $childrenNow < $childrenTotal )
106    
107  function GetPreselection_byRef($db, $host, $user_login, $user_passwd, $ids)  function GetPreselection_byRef($db, $host, $user_login, $user_passwd, $ids)
108  {    {  
109    
110      $user = new User($db);
111      $user->id = 1;
112    
113    foreach($ids as $cli)    foreach($ids as $cli)
114      {      {
115        _log("$cli Debut Traitement ligne", LOG_NOTICE);        _log("$cli Debut Traitement ligne", LOG_NOTICE);
# Line 214  function GetPreselection_byRef($db, $hos Line 220  function GetPreselection_byRef($db, $hos
220                        $sql .= " (cli,mode,date_traitement,situation,fk_fournisseur,traite) ";                        $sql .= " (cli,mode,date_traitement,situation,fk_fournisseur,traite) ";
221                        $sql .= " VALUES ('$ligne_numero','PRESELECTION',now(),'$situation_key',4,1);";                        $sql .= " VALUES ('$ligne_numero','PRESELECTION',now(),'$situation_key',4,1);";
222                      }                      }
223                      elseif ($situation_key == 'TRAITE_OK / TRAITE_OK')
224                        {
225                          $sql .= " (cli,mode,date_traitement,situation,fk_fournisseur,traite) ";
226                          $sql .= " VALUES ('$ligne_numero','PRESELECTION',now(),'$situation_key',4,1);";
227                        }
228                    else                    else
229                      {                      {
230                        $sql .= " (cli,mode,date_traitement,situation,fk_fournisseur) ";                        $sql .= " (cli,mode,date_traitement,situation,fk_fournisseur) ";
# Line 225  function GetPreselection_byRef($db, $hos Line 236  function GetPreselection_byRef($db, $hos
236                    if ($resql)                    if ($resql)
237                      {                      {
238                        _log("$cli log etat de la ligne SUCCESS", LOG_NOTICE);                        _log("$cli log etat de la ligne SUCCESS", LOG_NOTICE);
239    
240                          if ($situation_key == 'TRAITE_OK / TRAITE_OK')
241                            {
242                              $ligne = new LigneTel($db);
243      
244                              if ($ligne->fetch($cli) == 1)
245                                {
246                                  if ($ligne->statut == 2)
247                                    {
248                                      $statut = 3;
249                                      $date_mise_service = strftime(time());
250                                      $datea = $db->idate($date_mise_service);
251                                      
252                                      if ($ligne->set_statut($user, $statut, $datea) <> 0)
253                                        {
254                                          $error++;
255                                          print "ERROR\n";
256                                        }
257                                    }
258                                }
259                              else
260                                {
261                                  print "Erreur de lecture\n";
262                                }
263                            }
264    
265                      }                      }
266                    else                    else
267                      {                      {

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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