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

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

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

revision 1.2 by rodolphe, Mon Oct 31 18:43:53 2005 UTC revision 1.3 by rodolphe, Wed Nov 2 09:01:17 2005 UTC
# Line 25  Line 25 
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    
28    
29    $verbose = 0;
30    
31    for ($i = 1 ; $i < sizeof($argv) ; $i++)
32    {
33      if ($argv[$i] == "-v")
34        {
35          $verbose = 1;
36        }
37      if ($argv[$i] == "-vv")
38        {
39          $verbose = 2;
40        }
41      if ($argv[$i] == "-vvv")
42        {
43          $verbose = 3;
44        }
45    }
46    
47    
48  $user = new User($db);  $user = new User($db);
49  $user->id = 1; // C'est sale je sais !  $user->id = 1; // C'est sale je sais !
50    
# Line 110  if ($resql) Line 130  if ($resql)
130    
131  function CreatePreselection($host, $user_login, $user_passwd, $ligne, $id_person)  function CreatePreselection($host, $user_login, $user_passwd, $ligne, $id_person)
132  {    {  
133      global $verbose;
134    dolibarr_syslog("Appel de CreatePreselection($host, $user_login, ****, $ligne, $id_person)");    dolibarr_syslog("Appel de CreatePreselection($host, $user_login, ****, $ligne, $id_person)");
135    
136    $url = "/AzurApp_websvc_b3gdb/account.asmx/CreatePreselection?";    $url = "/AzurApp_websvc_b3gdb/account.asmx/CreatePreselection?";
# Line 121  function CreatePreselection($host, $user Line 142  function CreatePreselection($host, $user
142    $url .= "&okCollecte=true";    $url .= "&okCollecte=true";
143    $url .= "&okPreselection=true";    $url .= "&okPreselection=true";
144    
145      if ($verbose > 2)
146        dolibarr_syslog("$url");
147    
148    $fp = fsockopen($host, 80, $errno, $errstr, 30);    $fp = fsockopen($host, 80, $errno, $errstr, 30);
149    if (!$fp)    if (!$fp)
# Line 144  function CreatePreselection($host, $user Line 167  function CreatePreselection($host, $user
167          {          {
168            $line = fgets($fp, 1024);            $line = fgets($fp, 1024);
169                        
170              if ($verbose > 2)
171                dolibarr_syslog($line);
172    
173            if ($parse == 1)            if ($parse == 1)
174              {              {
175                preg_match('/^<string xmlns=".*">(.*)<\/string>$/', $line, $results);                preg_match('/^<string xmlns=".*">(.*)<\/string>$/', $line, $results);
# Line 164  function CreatePreselection($host, $user Line 190  function CreatePreselection($host, $user
190        fclose($fp);        fclose($fp);
191      }      }
192        
193      if ($verbose > 1)
194        dolibarr_syslog("result = ".$result);
195    
196    if (substr($result,0,2) == "OK")    if (substr($result,0,2) == "OK")
197      {      {
198        dolibarr_syslog("Presel réussie ligne ".$ligne." id client ".$id_person." $result\n");        dolibarr_syslog("Presel réussie ligne ".$ligne." id client ".$id_person." $result\n");

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

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