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 |
|
|
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); |
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) "; |
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 |
{ |
{ |