| Code Perl |
sub resLireTout {local($To,$nom0) = @_;
local $nomFic = &getFile($To,$nom0,"");
local $x = "";
srand $$; until(open(F1,"<".$nomFic)) {select(undef,undef,undef,rand)}; $x .= join("",<F1>); close(F1);
local($k,$x0,$y,$nom,$y1,$y2,$y3,$x2);
local %T0 = ();
local($date,$err);
while(true) {
if ($x ne "") {$x =~ s/^\s*//};
if ($x eq '') {last}; $k = index($x,"/#T)");
if ($k==-1) {return 101}; $k = $k+4; $x0 = substr($x,0,$k); $x = substr($x,$k);
if ($x0!~/\(#T\((\w+)\)new:\/\/(\w+)\/#T\(.{3}Owner\):(\w+)\/#T\(.{3}Error\):(\w+)\/#T/) {next};
$y = $1;
if ($y eq "Contact") {
if ($x0!~/\(#T\(Contact\)new:\/\/(\w+)\/#T\(ctcOwner\):(\w+)\/#T\(ctcError\):(\w+)\/#T\(ctcAdmin\):(.*)\/#T\(ctcVData\):(.*)\/#T/) {next};
$date = $1; $nom = $2; $err = $3; $y1 = $4; $y2 = $5; $y3 = "";
if ($y2=~/(.*)\/#T\(ctcVMail\):(.*)/) {$y2 = $1; $y3 = $2};
if ($y2=~/(.*)\/#T\(ctcVDate\):(.*)/) {$y2 = $1; if ($2 ne "") {$date = $2}};
if ($nom eq "1000") {next};
if (index($y1,"/#T")!=-1) {$y1 = substr($y1,0,index($y1,"/#T"))}
$x2 = $To.$nom; if (!(defined %{$T0{$x2}})) {next}; if (!(defined $T0{$x2}{'resCtc'})) {$T0{$x2}{'resCtc'} = ""}; $T0{$x2}{'resCtc'} .= "/".$y1.",".$date;
}
if ($y eq "Resume") {
if ($x0!~/\(#T\(Resume\)new:\/\/(\w+)\/#T\(resOwner\):(\w+)\/#T\(resError\):(\w+)\/#T\(resVCrit\):(.*)\/#T\(resVData\):(.*)\/#T/) {next};
$date = $1; $nom = $2; $err = $3; $y1 = $4; $y2 = $5; $y3 = "";
if ($y2=~/(.*)\/#T\(resVMail\):(.*)/) {$y2 = $1; $y3 = $2};
if ($y2=~/(.*)\/#T\(resVDate\):(.*)/) {$y2 = $1; if ($2 ne "") {$date = $2}};
if ($nom eq "1000") {next};
$x2 = $To.$nom; %{$T0{$x2}} = (); $T0{$x2}{'resOwner'} = $nom; $T0{$x2}{'resError'} = $err; $T0{$x2}{'resVCrit'} = $y1; $T0{$x2}{'resVData'} = $y2; $T0{$x2}{'resVDate'} = $date; $T0{$x2}{'resVMail'} = $y3;
}
}
foreach $x2 (keys %T0) {
if ($nom0 eq "*") {if ($T0{$x2}{'resError'} eq "1") {next}};
$k = scalar(@wwEnr); %{$wwEnr[$k]} = (); foreach $y (keys %{$T0{$x2}}) {$wwEnr[$k]{$y} = $T0{$x2}{$y}}
}
return 0;
}
|
| Code JavaScript |
function resLireTout(To,nom0) {
var nomFic = getFile(To,nom0,"");
var x = "";
x += eval(nomFic);
var k,x0,y,nom,y1,y2,y3,x2;
var T0 = [];
var date,err;
while(true) {
if (x!="") {x = x.replace(/^\s*/,"")};
if (x=='') {break}; k = x.indexOf("/#T)");
if (k==-1) {return 101}; k = k+4; x0 = x.substr(0,k); x = x.substr(k);
if (!x0.match(/\(#T\((\w+)\)new:\/\/(\w+)\/#T\(.{3}Owner\):(\w+)\/#T\(.{3}Error\):(\w+)\/#T/)) {continue};
y = RegExp.$1;
if (y=="Contact") {
if (!x0.match(/\(#T\(Contact\)new:\/\/(\w+)\/#T\(ctcOwner\):(\w+)\/#T\(ctcError\):(\w+)\/#T\(ctcAdmin\):(.*)\/#T\(ctcVData\):(.*)\/#T/)) {continue};
date = RegExp.$1; nom = RegExp.$2; err = RegExp.$3; y1 = RegExp.$4; y2 = RegExp.$5; y3 = "";
if (y2.match(/(.*)\/#T\(ctcVMail\):(.*)/)) {y2 = RegExp.$1; y3 = RegExp.$2};
if (y2.match(/(.*)\/#T\(ctcVDate\):(.*)/)) {y2 = RegExp.$1; if (RegExp.$2!="") {date = RegExp.$2}};
if (nom=="1000") {continue};
if (y1.indexOf("/#T")!=-1) {y1 = y1.substr(0,y1.indexOf("/#T"))}
x2 = To+nom; if (typeof(T0[x2])=="undefined") {continue}; if (typeof(T0[x2]['resCtc'])=="undefined") {T0[x2]['resCtc'] = ""}; T0[x2]['resCtc'] += "/"+y1+","+date;
}
if (y=="Resume") {
if (!x0.match(/\(#T\(Resume\)new:\/\/(\w+)\/#T\(resOwner\):(\w+)\/#T\(resError\):(\w+)\/#T\(resVCrit\):(.*)\/#T\(resVData\):(.*)\/#T/)) {continue};
date = RegExp.$1; nom = RegExp.$2; err = RegExp.$3; y1 = RegExp.$4; y2 = RegExp.$5; y3 = "";
if (y2.match(/(.*)\/#T\(resVMail\):(.*)/)) {y2 = RegExp.$1; y3 = RegExp.$2};
if (y2.match(/(.*)\/#T\(resVDate\):(.*)/)) {y2 = RegExp.$1; if (RegExp.$2!="") {date = RegExp.$2}};
if (nom=="1000") {continue};
x2 = To+nom; T0[x2] = []; T0[x2]['resOwner'] = nom; T0[x2]['resError'] = err; T0[x2]['resVCrit'] = y1; T0[x2]['resVData'] = y2; T0[x2]['resVDate'] = date; T0[x2]['resVMail'] = y3;
}
}
for(x2 in T0) {
if (nom0=="*") {if (T0[x2]['resError']=="1") {continue}};
k = wwEnr.length; wwEnr[k] = []; for(y in T0[x2]) {wwEnr[k][y] = T0[x2][y]}
}
return 0;
}
|