line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package oEdtk::Main;
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
24554
|
use strict;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use Exporter;
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
147
|
|
7
|
|
|
|
|
|
|
our $VERSION =0.8022; # release number : Y.YMMS -> Year, Month, Sequence
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(Exporter);
|
10
|
|
|
|
|
|
|
our @EXPORT = qw(
|
11
|
|
|
|
|
|
|
c7Flux
|
12
|
|
|
|
|
|
|
date2time
|
13
|
|
|
|
|
|
|
fmt_address
|
14
|
|
|
|
|
|
|
fmt_address_sender
|
15
|
|
|
|
|
|
|
fmt_monetary
|
16
|
|
|
|
|
|
|
prodEdtk_Current_Rec
|
17
|
|
|
|
|
|
|
prodEdtk_Previous_Rec
|
18
|
|
|
|
|
|
|
prodEtk_rec_cdata_join
|
19
|
|
|
|
|
|
|
recEdtk_erase
|
20
|
|
|
|
|
|
|
recEdtk_join_tmplte
|
21
|
|
|
|
|
|
|
recEdtk_post_process
|
22
|
|
|
|
|
|
|
recEdtk_redefine
|
23
|
|
|
|
|
|
|
toC7date
|
24
|
|
|
|
|
|
|
oe_app_usage
|
25
|
|
|
|
|
|
|
oe_CAP_sans_accents
|
26
|
|
|
|
|
|
|
oe_cdata_table_build
|
27
|
|
|
|
|
|
|
oe_char_xlate
|
28
|
|
|
|
|
|
|
oe_clean_addr_line
|
29
|
|
|
|
|
|
|
oe_close_fo
|
30
|
|
|
|
|
|
|
oe_compo_link
|
31
|
|
|
|
|
|
|
oe_compo_set_value
|
32
|
|
|
|
|
|
|
oe_corporation_get
|
33
|
|
|
|
|
|
|
oe_corporation_set
|
34
|
|
|
|
|
|
|
oe_corporation_tag
|
35
|
|
|
|
|
|
|
oe_csv2data_handles
|
36
|
|
|
|
|
|
|
oe_data_build
|
37
|
|
|
|
|
|
|
oe_date_biggest
|
38
|
|
|
|
|
|
|
oe_date_smallest
|
39
|
|
|
|
|
|
|
oe_define_TeX_output
|
40
|
|
|
|
|
|
|
oe_env_var_completion
|
41
|
|
|
|
|
|
|
oe_fmt_date
|
42
|
|
|
|
|
|
|
oe_ID_LDOC
|
43
|
|
|
|
|
|
|
oe_iso_country
|
44
|
|
|
|
|
|
|
oe_list_encodings
|
45
|
|
|
|
|
|
|
oe_new_job
|
46
|
|
|
|
|
|
|
oe_now_time
|
47
|
|
|
|
|
|
|
oe_num_sign_x
|
48
|
|
|
|
|
|
|
oe_num2txt_us
|
49
|
|
|
|
|
|
|
oe_open_fi_IN
|
50
|
|
|
|
|
|
|
oe_open_fo_OUT
|
51
|
|
|
|
|
|
|
oe_outmngr_compo_run
|
52
|
|
|
|
|
|
|
oe_outmngr_full_run
|
53
|
|
|
|
|
|
|
oe_outmngr_output_run
|
54
|
|
|
|
|
|
|
oe_process_ref_rec
|
55
|
|
|
|
|
|
|
oe_rec_motif
|
56
|
|
|
|
|
|
|
oe_rec_output
|
57
|
|
|
|
|
|
|
oe_rec_pre_process
|
58
|
|
|
|
|
|
|
oe_rec_process
|
59
|
|
|
|
|
|
|
oe_round
|
60
|
|
|
|
|
|
|
oe_set_sys_date
|
61
|
|
|
|
|
|
|
oe_to_date
|
62
|
|
|
|
|
|
|
oe_trimp_space
|
63
|
|
|
|
|
|
|
oe_trt_ref_rec
|
64
|
|
|
|
|
|
|
oe_uc_sans_accents
|
65
|
|
|
|
|
|
|
oe_unique_data_name
|
66
|
|
|
|
|
|
|
*OUT *IN @DATATAB $LAST_ENR
|
67
|
|
|
|
|
|
|
%motifs %ouTags %evalSsTrt
|
68
|
|
|
|
|
|
|
);
|
69
|
|
|
|
|
|
|
|
70
|
1
|
|
|
1
|
|
760
|
use POSIX qw(mkfifo);
|
|
1
|
|
|
|
|
12679
|
|
|
1
|
|
|
|
|
7
|
|
71
|
1
|
|
|
1
|
|
2345
|
use Date::Calc qw(Add_Delta_Days Delta_Days Date_to_Time Today Gmtime Week_of_Year);
|
|
1
|
|
|
|
|
74603
|
|
|
1
|
|
|
|
|
163
|
|
72
|
1
|
|
|
1
|
|
1275
|
use Encode;
|
|
1
|
|
|
|
|
18530
|
|
|
1
|
|
|
|
|
111
|
|
73
|
1
|
|
|
1
|
|
12
|
use File::Basename;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
87
|
|
74
|
1
|
|
|
1
|
|
2288
|
use Getopt::Long;
|
|
1
|
|
|
|
|
21974
|
|
|
1
|
|
|
|
|
8
|
|
75
|
1
|
|
|
1
|
|
7287
|
use List::MoreUtils qw(uniq);
|
|
1
|
|
|
|
|
2491
|
|
|
1
|
|
|
|
|
313
|
|
76
|
1
|
|
|
1
|
|
11
|
use List::Util qw(reduce);
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
100
|
|
77
|
1
|
|
|
1
|
|
1175
|
use Math::Round qw(nearest);
|
|
1
|
|
|
|
|
4833
|
|
|
1
|
|
|
|
|
81
|
|
78
|
1
|
|
|
1
|
|
1072
|
use Sys::Hostname;
|
|
1
|
|
|
|
|
1452
|
|
|
1
|
|
|
|
|
65
|
|
79
|
|
|
|
|
|
|
|
80
|
1
|
|
|
1
|
|
803
|
use oEdtk;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
54
|
|
81
|
|
|
|
|
|
|
require oEdtk::libC7;
|
82
|
|
|
|
|
|
|
require oEdtk::Outmngr;
|
83
|
|
|
|
|
|
|
require oEdtk::TexDoc;
|
84
|
1
|
|
|
1
|
|
523
|
use oEdtk::Dict;
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
71
|
|
85
|
1
|
|
|
1
|
|
838
|
use oEdtk::Config qw(config_read);
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
74
|
|
86
|
1
|
|
|
1
|
|
610
|
use oEdtk::Run qw(oe_status_to_msg oe_compo_run oe_after_compo oe_outmngr_output_run_tex);
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7720
|
|
87
|
|
|
|
|
|
|
#use oEUser::Lib;
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
#
|
90
|
|
|
|
|
|
|
# CODE - DOC AT THE END
|
91
|
|
|
|
|
|
|
#
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
# METHODE GENERIQUE D'EXTRACTION ET DE TRAITEMENT DES DONNEES
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
our @DATATAB; # le tableau dans lequel les enregistrements sont ventilés
|
96
|
|
|
|
|
|
|
# changer en OE_DATATAB
|
97
|
|
|
|
|
|
|
our $LAST_ENR =""; # QUID LAST_ENR ????
|
98
|
|
|
|
|
|
|
our $CURRENT_REC =""; # enrgistrement courant
|
99
|
|
|
|
|
|
|
our $PREVIOUS_REC =""; # enregistrement précédent
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
our %motifs; #rendre privée
|
102
|
|
|
|
|
|
|
our %ouTags; #rendre privée
|
103
|
|
|
|
|
|
|
our %evalSsTrt; #rendre privée
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
my $_ID_LDOC =''; # initialisation de l'identifiant unique de document (un par run)
|
106
|
|
|
|
|
|
|
my $PUSH_VALUE ="";
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
# PLANNED : CONFIGURATION OF OUTPUT SYSTEM
|
110
|
|
|
|
|
|
|
# return "\\long\\gdef\\$name\{$value\}";
|
111
|
|
|
|
|
|
|
my $TAG_MODE = 'C7';
|
112
|
|
|
|
|
|
|
my ($TAG_OPEN, $TAG_CLOSE, $TAG_MARKER, $TAG_ASSIGN, $TAG_ASSIGN_CLOS, $TAG_COMMENT, $TAG_L_SET, $TAG_R_SET);
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub oe_define_TeX_output(){
|
115
|
1
|
|
|
1
|
0
|
2
|
$TAG_MODE = 'TEX';
|
116
|
|
|
|
|
|
|
# \\long\\gdef\\$name\{$value\}
|
117
|
|
|
|
|
|
|
# \long\gdef\NUMCONT{000014770}
|
118
|
|
|
|
|
|
|
# \long\gdef\PRENOM{MIREILLE}\long\gdef\DATE{01/08/2009}\long\gdef\NICY{10}\STARTGAR
|
119
|
1
|
|
|
|
|
4
|
$TAG_OPEN = "\\"; # une ouverture de balise (open)
|
120
|
1
|
|
|
|
|
3
|
$TAG_CLOSE = ""; # une fermeture de balise (close)
|
121
|
1
|
|
|
|
|
4
|
$TAG_MARKER = ""; # un marqueur de début de balise
|
122
|
1
|
|
|
|
|
3
|
$TAG_ASSIGN = "long\\gdef\\\{"; # un marqueur d'attribution de valeur
|
123
|
1
|
|
|
|
|
3
|
$TAG_ASSIGN_CLOS= "\}"; # un marqueur fermeture d'attribution de valeur
|
124
|
1
|
|
|
|
|
2
|
$TAG_COMMENT = "%"; # un commentaire (rem)
|
125
|
1
|
|
|
|
|
3
|
$TAG_L_SET = ""; # attribution de variable : partie gauche
|
126
|
1
|
|
|
|
|
3
|
$TAG_R_SET = ""; # attribution de variable : partie droite
|
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
# \long\gdef\xProdApp\}
|
129
|
1
|
|
|
|
|
2
|
1;
|
130
|
|
|
|
|
|
|
}
|
131
|
|
|
|
|
|
|
oe_define_TeX_output(); # valeurs par défaut
|
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
################################################################################
|
135
|
|
|
|
|
|
|
## SPECIFIQUE COMPUSET UTILISE PAR AILLEURS (XLS)
|
136
|
|
|
|
|
|
|
################################################################################
|
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub oe_rec_motif ($$){ # migrer oe_rec_motif
|
139
|
|
|
|
|
|
|
# FONCTION POUR DÉCRIRE LE MOTIF UNPACK DE L'ENREGISTREMENT
|
140
|
|
|
|
|
|
|
#
|
141
|
|
|
|
|
|
|
# appel :
|
142
|
|
|
|
|
|
|
# oe_rec_motif ($keyRec, "A2 A10 A15 A10 A15 A*");
|
143
|
0
|
|
|
0
|
0
|
0
|
my $keyRec=shift;
|
144
|
0
|
|
|
|
|
0
|
my $motif =shift;
|
145
|
0
|
|
|
|
|
0
|
$motifs{$keyRec}=$motif;
|
146
|
0
|
|
|
|
|
0
|
1;
|
147
|
|
|
|
|
|
|
}
|
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
sub oe_rec_pre_process ($$){ # migrer oe_rec_pre_process
|
150
|
|
|
|
|
|
|
# FONCTION POUR ASSOCIER UN PRÉ TRAITEMENT À UN ENREGISTREMENT
|
151
|
|
|
|
|
|
|
# ce traitement est effectué avant le chargement de l'enregistrement dans DATATAB
|
152
|
|
|
|
|
|
|
# le contenu de l'enregistrement précédent est toujours disponible dans DATATAB
|
153
|
|
|
|
|
|
|
# le type de l'enregistrement courant est connu dans le contexte d'execution
|
154
|
|
|
|
|
|
|
#
|
155
|
|
|
|
|
|
|
# appel :
|
156
|
|
|
|
|
|
|
# oe_rec_pre_process ($keyRec, \&fonction);
|
157
|
0
|
|
|
0
|
0
|
0
|
my $keyRec=shift;
|
158
|
0
|
|
|
|
|
0
|
my $refFonction=shift;
|
159
|
0
|
|
|
|
|
0
|
$evalSsTrt{$keyRec}[0]=$refFonction;
|
160
|
0
|
|
|
|
|
0
|
1;
|
161
|
|
|
|
|
|
|
}
|
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
sub oe_rec_output ($$){ # migrer oe_rec_output
|
164
|
|
|
|
|
|
|
# FONCTION POUR DÉCRIRE LE FORMAT DE SORTIE DE L'ENREGISTREMENT POUR SPRINTF
|
165
|
|
|
|
|
|
|
#
|
166
|
|
|
|
|
|
|
# appel :
|
167
|
|
|
|
|
|
|
# oe_rec_output ($keyRec, "<#GESTION=%s><#PENOCOD=%s><#LICCODC=%s>%s");
|
168
|
0
|
|
|
0
|
0
|
0
|
my $keyRec=shift;
|
169
|
0
|
|
|
|
|
0
|
my $format=shift;
|
170
|
0
|
|
|
|
|
0
|
$ouTags{$keyRec}=$format;
|
171
|
0
|
|
|
|
|
0
|
1;
|
172
|
|
|
|
|
|
|
}
|
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
################################################################################
|
176
|
|
|
|
|
|
|
## SPECIFIQUE COMPUSET A SORTIR A MOYEN TERME
|
177
|
|
|
|
|
|
|
################################################################################
|
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
sub oe_define_Compuset_output(){
|
180
|
|
|
|
|
|
|
# <#xAppRef=PRRPC-ADCOMS>
|
181
|
0
|
|
|
0
|
0
|
0
|
$TAG_MODE = 'C7';
|
182
|
0
|
|
|
|
|
0
|
$TAG_OPEN = '<'; # une ouverture de balise (open)
|
183
|
0
|
|
|
|
|
0
|
$TAG_CLOSE = '>'; # une fermeture de balise (close)
|
184
|
0
|
|
|
|
|
0
|
$TAG_MARKER = '#'; # un marqueur de début de balise
|
185
|
0
|
|
|
|
|
0
|
$TAG_ASSIGN = '='; # un marqueur d'attribution de valeur
|
186
|
0
|
|
|
|
|
0
|
$TAG_ASSIGN_CLOS= ''; # un marqueur fermeture d'attribution de valeur
|
187
|
0
|
|
|
|
|
0
|
$TAG_COMMENT = ''; # un commentaire (rem)
|
188
|
0
|
|
|
|
|
0
|
$TAG_L_SET = ''; # attribution de variable : partie gauche
|
189
|
0
|
|
|
|
|
0
|
$TAG_R_SET = ''; # attribution de variable : partie droite
|
190
|
0
|
|
|
|
|
0
|
1;
|
191
|
|
|
|
|
|
|
}
|
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
# The newlines are important here, otherwise if you consume too much
|
195
|
|
|
|
|
|
|
# input in Compuset and don't process it right away, you'll get bogus
|
196
|
|
|
|
|
|
|
# errors at character count 16384.
|
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
sub fmt_monetary($) { # cf oe_num2txt_us / oe_compo_set_value
|
199
|
|
|
|
|
|
|
# NE SURTOUT PLUS UTILISER !
|
200
|
0
|
|
|
0
|
0
|
0
|
my $mnt = shift;
|
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
#$mnt = oe_num2txt_us($mnt);
|
203
|
0
|
|
|
|
|
0
|
$mnt=~s/\s*//g;
|
204
|
0
|
0
|
|
|
|
0
|
if ($mnt ne 0) { # fmt_monetary zap les montants à zéro ce qui n'est pas une bonne solution (ex INCIMRI) => à corriger, mais attention régression possible sur états MHN
|
205
|
|
|
|
|
|
|
# on utilise 'ne' car à ce niveau le montant peut être : '1 000.00' ou '-120.00' ou '63.00-'
|
206
|
0
|
|
|
|
|
0
|
$mnt = oe_compo_set_value($mnt);
|
207
|
|
|
|
|
|
|
} else {
|
208
|
|
|
|
|
|
|
# Some lines have optional amounts and we don't want
|
209
|
|
|
|
|
|
|
# to print 0,00 in that case.
|
210
|
0
|
|
|
|
|
0
|
$mnt = '';
|
211
|
|
|
|
|
|
|
}
|
212
|
0
|
|
|
|
|
0
|
return $mnt;
|
213
|
|
|
|
|
|
|
}
|
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
sub fmt_address(@) { # migrer c7_oe_fmt_adr
|
216
|
0
|
|
|
0
|
0
|
0
|
my @addr = map { oe_clean_addr_line($_) } @_;
|
|
0
|
|
|
|
|
0
|
|
217
|
0
|
|
|
0
|
|
0
|
return reduce { "$a$b" } @addr;
|
|
0
|
|
|
|
|
0
|
|
218
|
|
|
|
|
|
|
}
|
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
sub fmt_address_sender(@) { # migrer c7_oe_fmt_sender_adr
|
221
|
0
|
|
|
0
|
0
|
0
|
my $first = shift;
|
222
|
0
|
|
|
|
|
0
|
my $addr = fmt_address(@_);
|
223
|
0
|
|
|
|
|
0
|
return fmt_address($first) . "$addr";
|
224
|
|
|
|
|
|
|
}
|
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
sub toC7date(\$) { # migrer c7_oe_to_date
|
228
|
|
|
|
|
|
|
# RECOIT UNE REFERENCE SUR UNE DATE AU FORMAT AAAAMMJJ
|
229
|
|
|
|
|
|
|
# FORMATE AU FORMAT JJMM>AAAA
|
230
|
0
|
|
|
0
|
0
|
0
|
my $refVar =shift;
|
231
|
0
|
|
0
|
|
|
0
|
${$refVar}||="";
|
|
0
|
|
|
|
|
0
|
|
232
|
0
|
|
|
|
|
0
|
${$refVar}=~s/(\d{4})(\d{2})(\d{2})(.*)/\$3\$2\$1/o;
|
|
0
|
|
|
|
|
0
|
|
233
|
|
|
|
|
|
|
|
234
|
0
|
|
|
|
|
0
|
return ${$refVar};
|
|
0
|
|
|
|
|
0
|
|
235
|
|
|
|
|
|
|
}
|
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
sub c7Flux(\$) { # migrer c7_oe_ref_norm_flux
|
238
|
|
|
|
|
|
|
# LES SIGNES "INFÉRIEUR" ET "SUPÉRIEUR" SONT DES DÉLÉMITEURS RÉSERVÉS À COMPUSET
|
239
|
|
|
|
|
|
|
# LES FLUX MÉTIERS SONT TRAITÉS POUR REMPLACER CES SIGNES PAR DES ACCOLADES
|
240
|
|
|
|
|
|
|
# A L'ÉDITION, COMPUSET RÉTABLI CES SIGNES POUR RETROUVER L'AFFICHAGE ATTENDUS
|
241
|
|
|
|
|
|
|
#
|
242
|
|
|
|
|
|
|
# DANS LA CONFIGURATION COMPUSET, LES LIGNES SUIVANTES SONT UTILISEES POUR RETABLIR LES CARACTERES ORIGINAUX :
|
243
|
|
|
|
|
|
|
# LE CARACTÈRE { DANS LE FLUX DE DATA EST REMPLACÉ PAR LE SIGNE INFÉRIEUR À LA COMPOSITION
|
244
|
|
|
|
|
|
|
#
|
245
|
|
|
|
|
|
|
# LE CARACTÈRE } DANS LE FLUX DE DATA EST REMPLACÉ PAR LE SIGNE SUPÉRIEUR À LA COMPOSITION
|
246
|
|
|
|
|
|
|
# ,>
|
247
|
|
|
|
|
|
|
#
|
248
|
|
|
|
|
|
|
# l'appel de la fonction se fait par passage de référence de façon implicite
|
249
|
|
|
|
|
|
|
# c7Flux($chaine);
|
250
|
|
|
|
|
|
|
|
251
|
0
|
|
|
0
|
0
|
0
|
my $refChaine =shift;
|
252
|
0
|
|
0
|
|
|
0
|
${$refChaine}||="";
|
|
0
|
|
|
|
|
0
|
|
253
|
0
|
|
|
|
|
0
|
${$refChaine}=~s/{/g;
|
|
0
|
|
|
|
|
0
|
|
254
|
0
|
|
|
|
|
0
|
${$refChaine}=~s/>/}/g;
|
|
0
|
|
|
|
|
0
|
|
255
|
0
|
|
|
|
|
0
|
1;
|
256
|
|
|
|
|
|
|
}
|
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
sub recEdtk_erase ($){ # migrer oe_rec_erase
|
260
|
|
|
|
|
|
|
# FONCTION POUR SUPPRIMER LE TRAITEMENT D'UN ENREGISTREMENT
|
261
|
|
|
|
|
|
|
#
|
262
|
|
|
|
|
|
|
# appel :
|
263
|
|
|
|
|
|
|
# recEdtk_erase ($keyRec);
|
264
|
0
|
|
|
0
|
0
|
0
|
my $keyRec=shift;
|
265
|
0
|
|
|
|
|
0
|
$evalSsTrt{$keyRec}[0]="";
|
266
|
0
|
|
|
|
|
0
|
$evalSsTrt{$keyRec}[1]="";
|
267
|
0
|
|
|
|
|
0
|
$evalSsTrt{$keyRec}[2]="";
|
268
|
0
|
|
|
|
|
0
|
$motifs{$keyRec}="";
|
269
|
0
|
|
|
|
|
0
|
$ouTags{$keyRec}="-1";
|
270
|
0
|
|
|
|
|
0
|
1;
|
271
|
|
|
|
|
|
|
}
|
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
sub recEdtk_redefine ($$){ # migrer oe_rec_redefine
|
274
|
|
|
|
|
|
|
# FONCTION POUR REDEFINIR LE TRAITEMENT D'UN ENREGISTREMENT
|
275
|
|
|
|
|
|
|
#
|
276
|
|
|
|
|
|
|
# appel :
|
277
|
|
|
|
|
|
|
# recEdtk_redefine ($keyRec, "A2 A10 A15 A10 A15 A*");
|
278
|
0
|
|
|
0
|
0
|
0
|
my $keyRec=shift;
|
279
|
0
|
|
|
|
|
0
|
my $motif =shift;
|
280
|
0
|
|
|
|
|
0
|
recEdtk_erase($keyRec);
|
281
|
0
|
|
|
|
|
0
|
oe_rec_motif($keyRec, $motif);
|
282
|
0
|
|
|
|
|
0
|
1;
|
283
|
|
|
|
|
|
|
}
|
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
sub recEdtk_join_tmplte ($$$){ # migrer oe_rec_joined_descriptors
|
287
|
|
|
|
|
|
|
# FONCTION POUR COMPLÉTER LES DESCRIPTIF DU MOTIF UNPACK DE L'ENREGISTREMENT
|
288
|
|
|
|
|
|
|
# ET DU FORMAT DE SORTIE EN PARALLÈLE
|
289
|
|
|
|
|
|
|
#
|
290
|
|
|
|
|
|
|
# appel :
|
291
|
|
|
|
|
|
|
# recEdtk_join_tmplte ("abc", 'A2', '<#tag=%s>');
|
292
|
|
|
|
|
|
|
# recEdtk_join_tmplte ($keyRec, $motif, $output);
|
293
|
|
|
|
|
|
|
|
294
|
0
|
|
|
0
|
0
|
0
|
my $keyRec=shift;
|
295
|
0
|
|
|
|
|
0
|
my $motif =shift;
|
296
|
0
|
|
0
|
|
|
0
|
$motif ||="A*";
|
297
|
0
|
|
|
|
|
0
|
my $output=shift;
|
298
|
0
|
|
0
|
|
|
0
|
$output ||="%s";
|
299
|
0
|
|
|
|
|
0
|
$motifs{$keyRec}.=$motif;
|
300
|
0
|
|
|
|
|
0
|
$ouTags{$keyRec}.=$output;
|
301
|
0
|
|
|
|
|
0
|
$ouTags{$keyRec}=~s/^\-1//; # lorsque recEdtk_join_tmplte est utilisé pour définir ouTags dynamiquement en cours de oe_trt_ref_rec, la valeur par défaut de ouTags = '-1' (pas de traitement) => on le retire pour ne pas polluer la sortie
|
302
|
0
|
|
|
|
|
0
|
1;
|
303
|
|
|
|
|
|
|
}
|
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
sub oe_rec_process ($$){ # migrer oe_rec_process
|
307
|
|
|
|
|
|
|
# FONCTION POUR ASSOCIER UN TRAITEMENT À UN ENREGISTREMENT
|
308
|
|
|
|
|
|
|
# ce traitement est effectué juste après le chargement de l'enregistrement dans DATATAB
|
309
|
|
|
|
|
|
|
#
|
310
|
|
|
|
|
|
|
# appel :
|
311
|
|
|
|
|
|
|
# oe_rec_process ($keyRec, \&fonction);
|
312
|
0
|
|
|
0
|
0
|
0
|
my $keyRec=shift;
|
313
|
0
|
|
|
|
|
0
|
my $refFonction=shift;
|
314
|
0
|
|
|
|
|
0
|
$evalSsTrt{$keyRec}[1]=$refFonction;
|
315
|
0
|
|
|
|
|
0
|
1;
|
316
|
|
|
|
|
|
|
}
|
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
sub recEdtk_post_process ($$){ # migrer recEdtk_post_process
|
319
|
|
|
|
|
|
|
# FONCTION POUR ASSOCIER UN POST TRAITEMENT À UN ENREGISTREMENT
|
320
|
|
|
|
|
|
|
# ce traitement est effectué juste après le reformatage de l'enregistrement dans format_sortie
|
321
|
|
|
|
|
|
|
# la ligne d'enregistrement est connu dans le contexte d'exécution, dans sa forme "format_sortie"
|
322
|
|
|
|
|
|
|
#
|
323
|
|
|
|
|
|
|
# appel :
|
324
|
|
|
|
|
|
|
# recEdtk_post_process ($keyRec, \&fonction);
|
325
|
0
|
|
|
0
|
0
|
0
|
my $keyRec=shift;
|
326
|
0
|
|
|
|
|
0
|
my $refFonction=shift;
|
327
|
0
|
|
|
|
|
0
|
$evalSsTrt{$keyRec}[2]=$refFonction;
|
328
|
0
|
|
|
|
|
0
|
1;
|
329
|
|
|
|
|
|
|
}
|
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
sub oe_process_ref_rec ($$\$;$$) { # migrer oe_process_ref_rec
|
332
|
|
|
|
|
|
|
# ANALYSE ET TRAITEMENT COMBINES DES ENREGISTREMENTS
|
333
|
|
|
|
|
|
|
# il encapsule l'analyse et le traitement complet de l'enregistrement (oe_trt_ref_rec)
|
334
|
|
|
|
|
|
|
# il faut un appel par longueur de cle, dans l'ordre décroissant (de la cle la plus stricte à la moins contraingnante)
|
335
|
|
|
|
|
|
|
# APPEL :
|
336
|
|
|
|
|
|
|
# oe_process_ref_rec ($offsetKey, $lenKey, $ligne [,$offsetRec, $lenRec]);
|
337
|
|
|
|
|
|
|
# RETOURNE : statut
|
338
|
|
|
|
|
|
|
#
|
339
|
|
|
|
|
|
|
# exemple if (oe_process_ref_rec (0, 3, $ligne)){
|
340
|
|
|
|
|
|
|
# } elsif (oe_process_ref_rec (0, 2, $ligne)){
|
341
|
|
|
|
|
|
|
# etc.
|
342
|
0
|
|
|
0
|
0
|
0
|
my $offsetKey =shift;
|
343
|
0
|
|
|
|
|
0
|
my $lenKey =shift;
|
344
|
0
|
|
|
|
|
0
|
my $refLigne =shift;
|
345
|
0
|
|
|
|
|
0
|
my $offsetRec =shift; # optionnel
|
346
|
0
|
|
0
|
|
|
0
|
$offsetRec ||=0;
|
347
|
0
|
|
|
|
|
0
|
my $lenRec =shift; # optionnel
|
348
|
0
|
|
0
|
|
|
0
|
$lenRec ||="";
|
349
|
|
|
|
|
|
|
|
350
|
0
|
0
|
0
|
|
|
0
|
if (${$refLigne}=~m/^.{$offsetKey}(\w{$lenKey})/s && oe_trt_ref_rec($1,$refLigne,$offsetRec,$lenRec)){
|
|
0
|
|
|
|
|
0
|
|
351
|
|
|
|
|
|
|
# l'enregistrement a été identifié et traité
|
352
|
|
|
|
|
|
|
# on édite l'enregistrement
|
353
|
0
|
|
|
|
|
0
|
print OUT ${$refLigne};
|
|
0
|
|
|
|
|
0
|
|
354
|
0
|
|
|
|
|
0
|
return 1;
|
355
|
|
|
|
|
|
|
}
|
356
|
|
|
|
|
|
|
# SINON ON A PAS RECONNU L'ENREGISTREMENT, C'EST UN ECHEC
|
357
|
0
|
|
|
|
|
0
|
return 0;
|
358
|
|
|
|
|
|
|
}
|
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
sub oe_trt_ref_rec ($\$;$$){ # migrer oe_trt_ref_rec
|
361
|
|
|
|
|
|
|
# TRAITEMENT PRINCIPAL DES ENREGISTREMENTS
|
362
|
|
|
|
|
|
|
# MÉTHODE GÉNÉRIQUE V0.2.1 27/04/2009 10:05:03 (le passage de référence devient implicite)
|
363
|
|
|
|
|
|
|
# LA FONCTION A BESOIN DU TYPE DE L'ENREGISTEMENT ET DE LA RÉFÉRENCE À UNE LIGNE DE DONNÉES
|
364
|
|
|
|
|
|
|
# appel :
|
365
|
|
|
|
|
|
|
# oe_trt_ref_rec($Rec_ID, $ligne [,$offsetRec,$lenRec]);
|
366
|
|
|
|
|
|
|
# retourne : statut, $Rec_ID
|
367
|
0
|
|
|
0
|
0
|
0
|
my $Rec_ID =shift;
|
368
|
0
|
|
|
|
|
0
|
my $refLigne =shift;
|
369
|
0
|
|
|
|
|
0
|
my $offsetRec =shift; # OFFSET OPTIONNEL DE DONNÉES À SUPPRIMER EN TÊTE DE LIGNE
|
370
|
0
|
|
|
|
|
0
|
my $lenRec =shift; # LONGUEUR ÉVENTUELLE DE DONNÉEES À TRAITER
|
371
|
|
|
|
|
|
|
# VALEURS PAR DÉFAUT
|
372
|
0
|
|
0
|
|
|
0
|
$ouTags{$Rec_ID} ||="-1";
|
373
|
0
|
|
0
|
|
|
0
|
$motifs{$Rec_ID} ||="";
|
374
|
0
|
|
0
|
|
|
0
|
$offsetRec ||=0;
|
375
|
0
|
|
0
|
|
|
0
|
$lenRec ||="";
|
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
# SI MOTIF D'EXTRACTION DU TYPE D'ENREGISTREMENT N'EST PAS CONNU,
|
378
|
|
|
|
|
|
|
# ET SI IL N'Y A AUCUN PRE TRAITEMENT ASSOCIÉ AU TYPE D'ENREGISTREMENT,
|
379
|
|
|
|
|
|
|
# ALORS LE TYPE D'ENREGISTREMENT N'EST PAS CONNU
|
380
|
|
|
|
|
|
|
#
|
381
|
|
|
|
|
|
|
# CE CONTRÔLE PERMET DE DÉFINIR DYNAMIQUEMENT UN TYPE D'ENREGISTREMENT EN FOCNTION DU CONTEXTE
|
382
|
|
|
|
|
|
|
# C'EST A DIRE QU'UN ENREGISTREMENT TYPÉ "1" POURRA AVOIR DES CARACTÉRISITQUES DIFFÉRENTES
|
383
|
|
|
|
|
|
|
# EN FONCTION DU TYPE D'ENREGISTREMENT TRAITÉ PRÉCÉDEMMENT.
|
384
|
|
|
|
|
|
|
# CES CARACTÉRISITIQUES PEUVENT ÊTRE DÉFINIES AU MOMENT DU PRÉ TRAITEMENT.
|
385
|
|
|
|
|
|
|
#
|
386
|
0
|
0
|
0
|
|
|
0
|
if ($motifs{$Rec_ID} eq "" && !($evalSsTrt{$Rec_ID}[0])) {
|
387
|
0
|
|
|
|
|
0
|
warn "INFO : oe_trt_ref_rec() > LIGNE $. REC. >$Rec_ID< (offset $offsetRec) UNKNOWN\n";
|
388
|
0
|
|
|
|
|
0
|
return 0;
|
389
|
|
|
|
|
|
|
}
|
390
|
|
|
|
|
|
|
|
391
|
0
|
|
|
|
|
0
|
$PREVIOUS_REC =$CURRENT_REC;
|
392
|
0
|
|
|
|
|
0
|
$CURRENT_REC =$Rec_ID;
|
393
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
# STEP 0 : EVAL PRE TRAITEMENT de $refLigne
|
395
|
0
|
0
|
|
|
|
0
|
&{$evalSsTrt{$Rec_ID}[0]}($refLigne) if $evalSsTrt{$Rec_ID}[0];
|
|
0
|
|
|
|
|
0
|
|
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
# ON S'ASSURE DE BIEN VIDER LE TABLEAU DE LECTURE DE L'ENREGISTREMENT PRECEDENT
|
398
|
0
|
|
|
|
|
0
|
undef @DATATAB;
|
399
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
# EVENTUELLEMENT SUPPRESSION DES DONNEES NON UTILES (OFFSET ET HORS DATA UTILES (lenData))
|
401
|
0
|
0
|
|
|
|
0
|
${$refLigne}=~s/^.{$offsetRec}(.{1,$lenRec}).*/$1/ if ($offsetRec > 0);
|
|
0
|
|
|
|
|
0
|
|
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
# ECLATEMENT DE L'ENREGISTREMENT EN CHAMPS
|
404
|
0
|
0
|
|
|
|
0
|
@DATATAB =unpack ($motifs{$Rec_ID},${$refLigne})
|
|
0
|
|
|
|
|
0
|
|
405
|
|
|
|
|
|
|
or die "ERROR: oe_trt_ref_rec() > LIGNE $. typEnr >$Rec_ID< motif >$motifs{$Rec_ID}< UNKNOWN\n";
|
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
# STEP 1 : EVAL TRAITEMENT CHAMPS
|
408
|
0
|
0
|
|
|
|
0
|
&{$evalSsTrt{$Rec_ID}[1]} if $evalSsTrt{$Rec_ID}[1];
|
|
0
|
|
|
|
|
0
|
|
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
# STRUCTURATION DE L'ENREGISTREMENT POUR SORTIE
|
411
|
0
|
0
|
|
|
|
0
|
if ($ouTags{$Rec_ID} ne "-1"){
|
412
|
0
|
|
|
|
|
0
|
${$refLigne} ="${TAG_OPEN}a${Rec_ID}${TAG_CLOSE}";
|
|
0
|
|
|
|
|
0
|
|
413
|
0
|
0
|
|
|
|
0
|
${$refLigne} .=sprintf ($ouTags{$Rec_ID},@DATATAB)
|
|
0
|
|
|
|
|
0
|
|
414
|
|
|
|
|
|
|
or die "ERROR: oe_trt_ref_rec() > LIGNE $. typEnr >$Rec_ID< ouTags >$ouTags{$Rec_ID}<\n";
|
415
|
0
|
|
|
|
|
0
|
${$refLigne} .="${TAG_OPEN}e${Rec_ID}${TAG_CLOSE}\n";
|
|
0
|
|
|
|
|
0
|
|
416
|
|
|
|
|
|
|
} else {
|
417
|
0
|
|
|
|
|
0
|
${$refLigne}="";
|
|
0
|
|
|
|
|
0
|
|
418
|
|
|
|
|
|
|
}
|
419
|
0
|
|
|
|
|
0
|
$LAST_ENR=$Rec_ID;
|
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
# STEP 2 : EVAL POST TRAITEMENT
|
422
|
0
|
0
|
|
|
|
0
|
&{$evalSsTrt{$Rec_ID}[2]} if $evalSsTrt{$Rec_ID}[2];
|
|
0
|
|
|
|
|
0
|
|
423
|
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
# ÉVENTUELLEMENT AJOUT DE DONNÉES COMPLÉMENTAIRES
|
425
|
0
|
|
|
|
|
0
|
${$refLigne} .=$PUSH_VALUE;
|
|
0
|
|
|
|
|
0
|
|
426
|
0
|
|
|
|
|
0
|
$PUSH_VALUE ="";
|
427
|
0
|
|
|
|
|
0
|
${$refLigne} =~s/\s{2,}/ /g; # CONCATÉNATION DES BLANCS
|
|
0
|
|
|
|
|
0
|
|
428
|
|
|
|
|
|
|
#$LAST_ENR=$Rec_ID;
|
429
|
|
|
|
|
|
|
|
430
|
0
|
|
|
|
|
0
|
return 1, $Rec_ID;
|
431
|
|
|
|
|
|
|
}
|
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
sub prodEtk_rec_cdata_join ($){ # migrer prodEtk_rec_cdata_join
|
434
|
0
|
|
|
0
|
0
|
0
|
$PUSH_VALUE .=shift;
|
435
|
0
|
|
|
|
|
0
|
1;
|
436
|
|
|
|
|
|
|
}
|
437
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
sub prodEdtk_Previous_Rec () { # migrer oe_previous_rec
|
439
|
0
|
|
|
0
|
0
|
0
|
return $PREVIOUS_REC;
|
440
|
|
|
|
|
|
|
}
|
441
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
sub prodEdtk_Current_Rec () { # migrer oe_current_rec
|
443
|
0
|
|
|
0
|
0
|
0
|
return $CURRENT_REC;
|
444
|
|
|
|
|
|
|
}
|
445
|
|
|
|
|
|
|
|
446
|
|
|
|
|
|
|
################################################################################
|
447
|
|
|
|
|
|
|
|
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
sub oe_round ($;$){
|
450
|
|
|
|
|
|
|
# http://perl.enstimac.fr/allpod/fr-5.6.0/perlfaq4.pod
|
451
|
|
|
|
|
|
|
# http://perl.enstimac.fr/DocFr/perlfaq4.html
|
452
|
|
|
|
|
|
|
# http://www.linux-kheops.com/doc/perl/faq-perl-enstimac/perlfaq4.html
|
453
|
|
|
|
|
|
|
# Perl n'est pas en faute. C'est pareil qu'en C. L'IEEE dit que nous devons faire comme ça. Les nombres en Perl dont la valeur absolue est un entier inférieur à 2**31 (sur les machines 32 bit) fonctionneront globalement comme des entiers mathématiques. Les autres nombres ne sont pas garantis.
|
454
|
0
|
|
|
0
|
0
|
0
|
my $value = shift;
|
455
|
0
|
|
|
|
|
0
|
my $multiple= shift;
|
456
|
0
|
|
|
|
|
0
|
my $decimal;#= shift;
|
457
|
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
#if (!(defined $decimal)){$decimal = 2;} # decimal peut valoir 0 (decimal converti en entier)
|
459
|
0
|
0
|
|
|
|
0
|
if (!(defined $multiple)){$multiple = .01;} # $multiple peut valoir 0 (decimal converti en entier)
|
|
0
|
|
|
|
|
0
|
|
460
|
0
|
0
|
|
|
|
0
|
if ($multiple=~/^0\./){
|
|
|
0
|
|
|
|
|
|
461
|
0
|
|
|
|
|
0
|
$decimal=length($multiple)-2;
|
462
|
|
|
|
|
|
|
}elsif ($multiple=~/^\./){
|
463
|
0
|
|
|
|
|
0
|
$decimal=length($multiple)-1;
|
464
|
|
|
|
|
|
|
} else {
|
465
|
0
|
|
|
|
|
0
|
$decimal = 0;
|
466
|
|
|
|
|
|
|
}
|
467
|
0
|
|
|
|
|
0
|
my $motif = "%.0${decimal}f";
|
468
|
|
|
|
|
|
|
#my $multiple=1/(10**$decimal);
|
469
|
0
|
|
|
|
|
0
|
$value = nearest ($multiple, $value);
|
470
|
|
|
|
|
|
|
|
471
|
0
|
|
|
|
|
0
|
return sprintf ($motif, $value);
|
472
|
|
|
|
|
|
|
}
|
473
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
sub oe_num_sign_x(\$;$) { # migrer oe_num_sign_x
|
475
|
|
|
|
|
|
|
# traitement des montants signés alphanumeriques
|
476
|
|
|
|
|
|
|
# recoit : une reference a une variable alphanumerique
|
477
|
|
|
|
|
|
|
# un nombre de décimal après la virgule (optionnel, 0 par défaut)
|
478
|
|
|
|
|
|
|
|
479
|
0
|
|
|
0
|
0
|
0
|
my ($refMontant, $decimal)=@_;
|
480
|
0
|
|
0
|
|
|
0
|
${$refMontant} ||="";
|
|
0
|
|
|
|
|
0
|
|
481
|
0
|
|
0
|
|
|
0
|
$decimal ||=0;
|
482
|
|
|
|
|
|
|
|
483
|
|
|
|
|
|
|
# controle de la validite de la valeur transmise
|
484
|
0
|
|
|
|
|
0
|
${$refMontant}=~s/\s+//g;
|
|
0
|
|
|
|
|
0
|
|
485
|
0
|
0
|
0
|
|
|
0
|
if (${$refMontant} eq "" || ${$refMontant} eq 0) {
|
|
0
|
0
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
486
|
0
|
|
|
|
|
0
|
${$refMontant} =0;
|
|
0
|
|
|
|
|
0
|
|
487
|
0
|
|
|
|
|
0
|
return 1;
|
488
|
|
|
|
|
|
|
} elsif (${$refMontant}=~/\D{2,}/){
|
489
|
0
|
|
|
|
|
0
|
warn "INFO : value (${$refMontant}) not numeric.\n";
|
|
0
|
|
|
|
|
0
|
|
490
|
0
|
|
|
|
|
0
|
return -1;
|
491
|
|
|
|
|
|
|
}
|
492
|
|
|
|
|
|
|
|
493
|
0
|
|
|
|
|
0
|
my %hXVal;
|
494
|
0
|
|
|
|
|
0
|
$hXVal{'p'}=0;
|
495
|
0
|
|
|
|
|
0
|
$hXVal{'q'}=1;
|
496
|
0
|
|
|
|
|
0
|
$hXVal{'r'}=2;
|
497
|
0
|
|
|
|
|
0
|
$hXVal{'s'}=3;
|
498
|
0
|
|
|
|
|
0
|
$hXVal{'t'}=4;
|
499
|
0
|
|
|
|
|
0
|
$hXVal{'u'}=5;
|
500
|
0
|
|
|
|
|
0
|
$hXVal{'v'}=6;
|
501
|
0
|
|
|
|
|
0
|
$hXVal{'w'}=7;
|
502
|
0
|
|
|
|
|
0
|
$hXVal{'x'}=8;
|
503
|
0
|
|
|
|
|
0
|
$hXVal{'y'}=9;
|
504
|
|
|
|
|
|
|
|
505
|
0
|
0
|
|
|
|
0
|
if ( ${$refMontant}=~s/(\D{1})$/$hXVal{$1}/ ) {
|
|
0
|
0
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
506
|
|
|
|
|
|
|
# une valeur avec signe negatif alphanumerique 213y => -2139
|
507
|
0
|
|
|
|
|
0
|
${$refMontant}=(${$refMontant}*(-1));
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
508
|
|
|
|
|
|
|
# warn "INFO : MONTANT SIGNE";
|
509
|
|
|
|
|
|
|
} elsif (${$refMontant}=~/^-{1}/){
|
510
|
|
|
|
|
|
|
# une valeur avec un signe negatif -123456
|
511
|
|
|
|
|
|
|
}
|
512
|
|
|
|
|
|
|
|
513
|
0
|
|
|
|
|
0
|
${$refMontant}=${$refMontant}/(10**$decimal);
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
514
|
|
|
|
|
|
|
|
515
|
0
|
|
|
|
|
0
|
return ${$refMontant};
|
|
0
|
|
|
|
|
0
|
|
516
|
|
|
|
|
|
|
}
|
517
|
|
|
|
|
|
|
|
518
|
|
|
|
|
|
|
|
519
|
|
|
|
|
|
|
sub date2time ($){ # migrer oe_date_to_time
|
520
|
|
|
|
|
|
|
# FONCTION DÉPRÉCIÉE,
|
521
|
|
|
|
|
|
|
# UTILISER LA BIBLIOTHÈQUE SPÉCIALISÉE : Date::Calc
|
522
|
0
|
|
|
0
|
0
|
0
|
my $date=shift; # une date au format AAAAMMJJ
|
523
|
|
|
|
|
|
|
|
524
|
0
|
|
|
|
|
0
|
my $tmpDate="AAAAMMJJ";
|
525
|
0
|
|
|
|
|
0
|
my $decalage=0;
|
526
|
0
|
|
|
|
|
0
|
my $jours=-1;
|
527
|
0
|
|
|
|
|
0
|
my $time=time;
|
528
|
0
|
|
|
|
|
0
|
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) =
|
529
|
|
|
|
|
|
|
gmtime($time);
|
530
|
0
|
|
|
|
|
0
|
my $nowDate=sprintf ("%4.0f%02.0f%02.0f", $year+1900, $mon+1, $mday);
|
531
|
|
|
|
|
|
|
|
532
|
0
|
0
|
|
|
|
0
|
if ($nowDate > $date){
|
|
|
0
|
|
|
|
|
|
533
|
|
|
|
|
|
|
# date est plus ancien
|
534
|
0
|
|
|
|
|
0
|
$decalage=-1;
|
535
|
|
|
|
|
|
|
}elsif ($nowDate < $date){
|
536
|
|
|
|
|
|
|
# date est plus récent
|
537
|
0
|
|
|
|
|
0
|
$decalage=+1;
|
538
|
|
|
|
|
|
|
}
|
539
|
|
|
|
|
|
|
|
540
|
0
|
|
|
|
|
0
|
while ($date ne $tmpDate){
|
541
|
0
|
|
|
|
|
0
|
$jours++;
|
542
|
|
|
|
|
|
|
# une journée comporte 86400 secondes
|
543
|
0
|
|
|
|
|
0
|
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) =
|
544
|
|
|
|
|
|
|
gmtime($time+($decalage*$jours*86400));
|
545
|
0
|
|
|
|
|
0
|
$tmpDate=sprintf ("%4.0f%02.0f%02.0f", $year+1900, $mon+1, $mday);
|
546
|
|
|
|
|
|
|
}
|
547
|
|
|
|
|
|
|
|
548
|
0
|
|
|
|
|
0
|
return ($time+($decalage*$jours*86400)), ($decalage*$jours);
|
549
|
|
|
|
|
|
|
}
|
550
|
|
|
|
|
|
|
|
551
|
|
|
|
|
|
|
|
552
|
|
|
|
|
|
|
sub oe_now_time(){ # migrer oe_now_time
|
553
|
|
|
|
|
|
|
# FONCTION DÉPRÉCIÉE,
|
554
|
|
|
|
|
|
|
# UTILISER LA BIBLIOTHÈQUE SPÉCIALISÉE : Date::Calc -> Today
|
555
|
|
|
|
|
|
|
|
556
|
0
|
|
|
0
|
0
|
0
|
my $time =time;
|
557
|
0
|
|
|
|
|
0
|
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) =
|
558
|
|
|
|
|
|
|
gmtime($time);
|
559
|
0
|
|
|
|
|
0
|
$time =sprintf ("%4.0f%02.0f%02.0f%02.0f%02.0f%02.0f", $year+1900, $mon+1, $mday, $hour, $min, $sec);
|
560
|
|
|
|
|
|
|
|
561
|
0
|
|
|
|
|
0
|
return $time;
|
562
|
|
|
|
|
|
|
}
|
563
|
|
|
|
|
|
|
|
564
|
|
|
|
|
|
|
# DICTIONNAIRE ISO DES PAYS
|
565
|
|
|
|
|
|
|
my $_DICO_COUNTRY;
|
566
|
|
|
|
|
|
|
# DICTIONNAIRE DES ABBRÉVIATIONS.
|
567
|
|
|
|
|
|
|
my $_DICO_POST;
|
568
|
|
|
|
|
|
|
# DICTIONNAIRE de translation des caractères (déconseillés, mais parfois nécessaires).
|
569
|
|
|
|
|
|
|
my $_DICO_CHAR;
|
570
|
|
|
|
|
|
|
|
571
|
|
|
|
|
|
|
|
572
|
|
|
|
|
|
|
{
|
573
|
|
|
|
|
|
|
my $_LAST_ISO ="";
|
574
|
|
|
|
|
|
|
|
575
|
|
|
|
|
|
|
sub oe_iso_country(;$){
|
576
|
|
|
|
|
|
|
# retourne le code pays dans la codification country_dico.ini ou la dernière valeur connue
|
577
|
0
|
|
|
0
|
0
|
0
|
my $country = shift;
|
578
|
0
|
0
|
|
|
|
0
|
if (!defined($_DICO_COUNTRY)) {
|
579
|
0
|
|
|
|
|
0
|
my $cfg = config_read();
|
580
|
0
|
|
|
|
|
0
|
$_DICO_COUNTRY = oEdtk::Dict->new($cfg->{'EDTK_DICO_COUNTRY'}, , { section => $cfg->{'EDTK_LANG'} });
|
581
|
|
|
|
|
|
|
}
|
582
|
0
|
0
|
|
|
|
0
|
$_LAST_ISO = $_DICO_COUNTRY->translate($country) if defined ($country);
|
583
|
0
|
|
|
|
|
0
|
return $_LAST_ISO;
|
584
|
|
|
|
|
|
|
}
|
585
|
|
|
|
|
|
|
}
|
586
|
|
|
|
|
|
|
|
587
|
|
|
|
|
|
|
|
588
|
|
|
|
|
|
|
sub oe_char_xlate($;$){ # à migrer dans le dictionnaire ?
|
589
|
0
|
|
|
0
|
0
|
0
|
my $scalar = shift;
|
590
|
|
|
|
|
|
|
|
591
|
0
|
0
|
|
|
|
0
|
if (!defined($_DICO_CHAR)) {
|
592
|
0
|
|
0
|
|
|
0
|
my $section = shift || 'DEFAULT';
|
593
|
0
|
|
|
|
|
0
|
my $cfg = config_read();
|
594
|
0
|
|
|
|
|
0
|
$_DICO_CHAR = oEdtk::Dict->new($cfg->{'EDTK_DICO_XLAT'}, , { section => $section });
|
595
|
|
|
|
|
|
|
}
|
596
|
0
|
|
|
|
|
0
|
$scalar = $_DICO_CHAR->substitue($scalar);
|
597
|
|
|
|
|
|
|
|
598
|
0
|
|
|
|
|
0
|
return $scalar;
|
599
|
|
|
|
|
|
|
}
|
600
|
|
|
|
|
|
|
|
601
|
|
|
|
|
|
|
|
602
|
|
|
|
|
|
|
sub oe_clean_addr_line(\$) { # migrer oe_clean_addr_line
|
603
|
|
|
|
|
|
|
# CETTE FONCTION PERMET UN NETTOYAGE DES LIGNES D'ADRESSE POUR CONSTRUIRE LES BLOCS D'ADRESSE DESTINTATIRE
|
604
|
|
|
|
|
|
|
# elle travaille sur la référence de la variable directement mais retourne aussi la chaine resultante
|
605
|
0
|
|
|
0
|
0
|
0
|
my $rLine = shift;
|
606
|
|
|
|
|
|
|
|
607
|
|
|
|
|
|
|
# valeur par défaut dans le cas où le champs serait undef
|
608
|
0
|
0
|
0
|
|
|
0
|
if (!defined($$rLine) || length($$rLine) == 0) {
|
609
|
0
|
|
|
|
|
0
|
$$rLine = '';
|
610
|
0
|
|
|
|
|
0
|
return $$rLine;
|
611
|
|
|
|
|
|
|
}
|
612
|
|
|
|
|
|
|
|
613
|
0
|
|
|
|
|
0
|
chomp($$rLine); # pour être sûr de ne pas avoir de retour à la ligne en fin de champ
|
614
|
0
|
|
|
|
|
0
|
oe_trimp_space($rLine);
|
615
|
|
|
|
|
|
|
|
616
|
0
|
|
|
|
|
0
|
$$rLine = oe_char_xlate($$rLine, 'ADDRESS');
|
617
|
|
|
|
|
|
|
# à faire : une expression régulière qui traite tout ce qui n'est pas 0-9\-\°\w par des blancs...
|
618
|
|
|
|
|
|
|
|
619
|
|
|
|
|
|
|
# LA LIGNE SUIVANTE N'EST À ACTIVER QU'APRÈS TEST, POUR LE MOMENT PRIS EN CHARGE PAR LE oe_char_xlate
|
620
|
|
|
|
|
|
|
#$$rLine =~ s/\\+/\//g; # on supprime on remplace les backslash qui sont des caractères d'échappement et qui semble-t-il ne sont pas comptés lors du controle de taille (sprintf("%.38s",...)
|
621
|
0
|
|
|
|
|
0
|
$$rLine =~ s/^\s+//; # on supprime les blancs consécutifs en début de chaîne (on a fait un oe_trimp_space en premier...) TRIM gauche
|
622
|
0
|
|
|
|
|
0
|
$$rLine =~ s/\s+$//; # on supprime les blancs consécutifs en fin de chaîne (...) TRIM droite
|
623
|
0
|
|
|
|
|
0
|
$$rLine =~ s/^0\s+//; # on supprime les zéros tout seul en début de chaine (on le passe en dernier, après les TRIM gauche)
|
624
|
0
|
|
|
|
|
0
|
$$rLine =~ s/\s+/ /; # concentration des blancs consécutifs
|
625
|
|
|
|
|
|
|
|
626
|
|
|
|
|
|
|
# Use the given dictionary to translate words.
|
627
|
0
|
0
|
|
|
|
0
|
if (length($$rLine) > 38) {
|
628
|
0
|
0
|
|
|
|
0
|
if (!defined($_DICO_POST)) {
|
629
|
0
|
|
|
|
|
0
|
my $cfg = config_read();
|
630
|
0
|
|
|
|
|
0
|
$_DICO_POST = oEdtk::Dict->new($cfg->{'EDTK_DICO_POST'});
|
631
|
|
|
|
|
|
|
}
|
632
|
0
|
|
|
|
|
0
|
my @words = split(/ /, $$rLine);
|
633
|
0
|
|
|
|
|
0
|
$$rLine = join(' ', map { $_DICO_POST->translate($_) } @words);
|
|
0
|
|
|
|
|
0
|
|
634
|
|
|
|
|
|
|
}
|
635
|
0
|
|
|
|
|
0
|
$$rLine = sprintf("%.38s", $$rLine); # on s'assure de ne pas dépasser 38 caractères par lignes
|
636
|
|
|
|
|
|
|
|
637
|
|
|
|
|
|
|
# POUR ÉVITER L'UTILISATION DES BLANCS FORCÉS ENTRE DES CHAMPS D'ADRESSE (EX : ```)
|
638
|
|
|
|
|
|
|
# on rajoute un blanc en fin de champ s'il contient au moins un caractère
|
639
|
0
|
0
|
0
|
|
|
0
|
if ($TAG_MODE eq "C7" && $$rLine =~ /\w+$/) {
|
640
|
0
|
|
|
|
|
0
|
$$rLine .= " ";
|
641
|
|
|
|
|
|
|
}
|
642
|
0
|
|
|
|
|
0
|
return $$rLine;
|
643
|
|
|
|
|
|
|
}
|
644
|
|
|
|
|
|
|
|
645
|
|
|
|
|
|
|
|
646
|
|
|
|
|
|
|
sub oe_CAP_sans_accents (\$) {
|
647
|
|
|
|
|
|
|
# CETTE FONCTION CONVERTIT LES CARACTÈRES ACCENTUÉS MAJUSCULES EN CARACTÈRES NON ACCENTUÉS MAJ
|
648
|
|
|
|
|
|
|
# l'utilisation de la localisation provoque un bug dans la commande "sort".
|
649
|
|
|
|
|
|
|
# On ne s'appuie pas sur la possibilité de rétablir le comportement par défaut par échappement
|
650
|
|
|
|
|
|
|
# (la directive no locale ou lorsqu'on sort du bloc englobant la directive use locale)
|
651
|
|
|
|
|
|
|
# de façon à adopter un mode de fonctionnement standard et simplifié.
|
652
|
|
|
|
|
|
|
# NB : la localisation ralentit considérablement les tris.
|
653
|
|
|
|
|
|
|
# (cf. doc Perl concernant la localisation : perllocale)
|
654
|
|
|
|
|
|
|
#
|
655
|
|
|
|
|
|
|
# l'appel de la fonction se fait par passage de référence implicite
|
656
|
|
|
|
|
|
|
# oe_char_no_accents($chaine);
|
657
|
|
|
|
|
|
|
|
658
|
0
|
|
|
0
|
0
|
0
|
my $refChaine =shift;
|
659
|
0
|
|
0
|
|
|
0
|
${$refChaine}||="";
|
|
0
|
|
|
|
|
0
|
|
660
|
0
|
|
|
|
|
0
|
${$refChaine}=~s/[ÀÂÄ]/A/g;
|
|
0
|
|
|
|
|
0
|
|
661
|
0
|
|
|
|
|
0
|
${$refChaine}=~s/[ÉÈÊË]/E/g;
|
|
0
|
|
|
|
|
0
|
|
662
|
0
|
|
|
|
|
0
|
${$refChaine}=~s/[ÌÎÏ]/I/g;
|
|
0
|
|
|
|
|
0
|
|
663
|
0
|
|
|
|
|
0
|
${$refChaine}=~s/[ÒÔÖÕ]/O/g;
|
|
0
|
|
|
|
|
0
|
|
664
|
0
|
|
|
|
|
0
|
${$refChaine}=~s/[ÚÙÛÜ]/U/g;
|
|
0
|
|
|
|
|
0
|
|
665
|
0
|
|
|
|
|
0
|
${$refChaine}=~s/Ç/C/g;
|
|
0
|
|
|
|
|
0
|
|
666
|
|
|
|
|
|
|
# on ne reprend pas la commande uc qui peut être faite avant appel à oe_CAP_sans_accents
|
667
|
|
|
|
|
|
|
# - soit on veut garder les minuscules accentuées, soit on veut tout capitaliser
|
668
|
|
|
|
|
|
|
## ${$refChaine}= uc ${$refChaine};
|
669
|
|
|
|
|
|
|
|
670
|
0
|
|
|
|
|
0
|
return ${$refChaine};
|
|
0
|
|
|
|
|
0
|
|
671
|
|
|
|
|
|
|
}
|
672
|
|
|
|
|
|
|
|
673
|
|
|
|
|
|
|
sub oe_uc_sans_accents (\$) { # migrer oe_uc_sans_accents
|
674
|
|
|
|
|
|
|
# CETTE FONCTION CONVERTIT LES CARACTÈRES ACCENTUÉS EN CARACTÈRES MAJUSCULES NON ACCENTUÉS
|
675
|
|
|
|
|
|
|
# l'utilisation de la localisation provoque un bug dans la commande "sort".
|
676
|
|
|
|
|
|
|
# On ne s'appuie pas sur la possibilité de rétablir le comportement par défaut par échappement
|
677
|
|
|
|
|
|
|
# (la directive no locale ou lorsqu'on sort du bloc englobant la directive use locale)
|
678
|
|
|
|
|
|
|
# de façon à adopter un mode de fonctionnement standard et simplifié.
|
679
|
|
|
|
|
|
|
# NB : la localisation ralentit considérablement les tris.
|
680
|
|
|
|
|
|
|
# (cf. doc Perl concernant la localisation : perllocale)
|
681
|
|
|
|
|
|
|
#
|
682
|
|
|
|
|
|
|
# l'appel de la fonction se fait par passage de référence implicite
|
683
|
|
|
|
|
|
|
# oe_uc_sans_accents($chaine);
|
684
|
|
|
|
|
|
|
|
685
|
0
|
|
|
0
|
0
|
0
|
my $refChaine =shift;
|
686
|
0
|
|
0
|
|
|
0
|
${$refChaine}||="";
|
|
0
|
|
|
|
|
0
|
|
687
|
0
|
|
|
|
|
0
|
${$refChaine}=~s/[àâä]/a/ig;
|
|
0
|
|
|
|
|
0
|
|
688
|
0
|
|
|
|
|
0
|
${$refChaine}=~s/[éèêë]/e/ig;
|
|
0
|
|
|
|
|
0
|
|
689
|
0
|
|
|
|
|
0
|
${$refChaine}=~s/[ìîï]/i/ig;
|
|
0
|
|
|
|
|
0
|
|
690
|
0
|
|
|
|
|
0
|
${$refChaine}=~s/[òôöõ]/o/ig;
|
|
0
|
|
|
|
|
0
|
|
691
|
0
|
|
|
|
|
0
|
${$refChaine}=~s/[úùûü]/u/ig;
|
|
0
|
|
|
|
|
0
|
|
692
|
0
|
|
|
|
|
0
|
${$refChaine}=~s/ç/c/ig;
|
|
0
|
|
|
|
|
0
|
|
693
|
0
|
|
|
|
|
0
|
${$refChaine}= uc ${$refChaine};
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
694
|
|
|
|
|
|
|
|
695
|
0
|
|
|
|
|
0
|
return ${$refChaine};
|
|
0
|
|
|
|
|
0
|
|
696
|
|
|
|
|
|
|
}
|
697
|
|
|
|
|
|
|
|
698
|
|
|
|
|
|
|
|
699
|
|
|
|
|
|
|
sub oe_trimp_space(\$) { # migrer oe_trimp_space
|
700
|
|
|
|
|
|
|
# SUPPRESSION DES ESPACES CONSECUTIFS (TRAILING BLANK) PAR GROUPAGE
|
701
|
|
|
|
|
|
|
# le parametre doit etre une reference, exemple : oe_trimp_space($chaine)
|
702
|
|
|
|
|
|
|
# retourne le nombre de caracteres retires
|
703
|
0
|
|
|
0
|
0
|
0
|
my $rChaine =shift;
|
704
|
0
|
|
0
|
|
|
0
|
${$rChaine}||="";
|
|
0
|
|
|
|
|
0
|
|
705
|
0
|
|
|
|
|
0
|
${$rChaine} =~s/\s{2,}/ /go;
|
|
0
|
|
|
|
|
0
|
|
706
|
|
|
|
|
|
|
|
707
|
0
|
|
|
|
|
0
|
return ${$rChaine};
|
|
0
|
|
|
|
|
0
|
|
708
|
|
|
|
|
|
|
}
|
709
|
|
|
|
|
|
|
|
710
|
|
|
|
|
|
|
|
711
|
|
|
|
|
|
|
sub oe_list_encodings {
|
712
|
0
|
|
|
0
|
0
|
0
|
my @list = Encode->encodings();
|
713
|
0
|
|
|
|
|
0
|
warn "INFO : available encodings on this machine are : @list\n";
|
714
|
|
|
|
|
|
|
}
|
715
|
|
|
|
|
|
|
|
716
|
|
|
|
|
|
|
# migrer oe_open_fi_IN
|
717
|
|
|
|
|
|
|
sub oe_open_fi_IN ($;$){ # GESTION DE BASE INPUT FILE
|
718
|
0
|
|
|
0
|
0
|
0
|
my $fi =shift;
|
719
|
0
|
0
|
|
|
|
0
|
open (IN, "$fi") or die "ERROR: ouverture $fi, code retour $!\n";
|
720
|
|
|
|
|
|
|
|
721
|
0
|
|
|
|
|
0
|
1;
|
722
|
|
|
|
|
|
|
}
|
723
|
|
|
|
|
|
|
|
724
|
|
|
|
|
|
|
# migrer oe_open_fo_OUT
|
725
|
|
|
|
|
|
|
sub oe_open_fo_OUT ($){ # GESTION DE BASE OUTPUT FILE
|
726
|
0
|
|
|
0
|
0
|
0
|
my $fo =shift;
|
727
|
0
|
0
|
|
|
|
0
|
open (OUT, "> $fo") or die "ERROR: ouverture $fo - code retour $!\n";
|
728
|
|
|
|
|
|
|
|
729
|
0
|
|
|
|
|
0
|
1;
|
730
|
|
|
|
|
|
|
}
|
731
|
|
|
|
|
|
|
|
732
|
|
|
|
|
|
|
|
733
|
|
|
|
|
|
|
sub oe_close_fo ($) { # migrer oe_close_fo
|
734
|
0
|
|
|
0
|
0
|
0
|
my $f =shift;
|
735
|
|
|
|
|
|
|
|
736
|
0
|
0
|
|
|
|
0
|
close (OUT) or die "ERROR: fermeture $f - code retour $!\n";
|
737
|
0
|
|
|
|
|
0
|
1;
|
738
|
|
|
|
|
|
|
}
|
739
|
|
|
|
|
|
|
|
740
|
|
|
|
|
|
|
sub oe_to_date(\$) { # migrer oe_to_date
|
741
|
|
|
|
|
|
|
# RECOIT UNE REFERENCE SUR UNE DATE AU FORMAT AAAAMMJJ
|
742
|
|
|
|
|
|
|
# FORMATE AU FORMAT JJ/MM/AAAA
|
743
|
0
|
|
|
0
|
0
|
0
|
my $refVar =shift;
|
744
|
0
|
|
0
|
|
|
0
|
${$refVar}||="";
|
|
0
|
|
|
|
|
0
|
|
745
|
0
|
|
|
|
|
0
|
${$refVar}=~s/(\d{4})(\d{2})(\d{2})(.*)/$3\/$2\/$1/o;
|
|
0
|
|
|
|
|
0
|
|
746
|
|
|
|
|
|
|
|
747
|
0
|
|
|
|
|
0
|
return ${$refVar};
|
|
0
|
|
|
|
|
0
|
|
748
|
|
|
|
|
|
|
}
|
749
|
|
|
|
|
|
|
|
750
|
|
|
|
|
|
|
|
751
|
|
|
|
|
|
|
sub oe_fmt_date($) { # migrer oe_fmt_date
|
752
|
0
|
|
|
0
|
0
|
0
|
my $date = shift;
|
753
|
|
|
|
|
|
|
|
754
|
0
|
0
|
|
|
|
0
|
die "ERROR: Unexpected date format: \"$date\"\n"
|
755
|
|
|
|
|
|
|
if $date !~ /^\s*(\d{1,2})\/(\d{1,2})\/(\d{2}|\d{4})\s*$/;
|
756
|
|
|
|
|
|
|
|
757
|
0
|
|
|
|
|
0
|
return sprintf("%02s/%02s/%s", $1, $2, $3);
|
758
|
|
|
|
|
|
|
}
|
759
|
|
|
|
|
|
|
|
760
|
|
|
|
|
|
|
# Convert a date in DD/MM/YYYY format to YYYYMMDD format.
|
761
|
|
|
|
|
|
|
sub oe_date_convert($) { # oe_date_format
|
762
|
0
|
|
|
0
|
0
|
0
|
my $date = shift;
|
763
|
|
|
|
|
|
|
|
764
|
0
|
0
|
|
|
|
0
|
if ($date !~ /^\s*(\d{1,2})\/(\d{1,2})\/(\d{4})\s*$/) {
|
765
|
0
|
|
|
|
|
0
|
return undef;
|
766
|
|
|
|
|
|
|
}
|
767
|
0
|
|
|
|
|
0
|
return sprintf("%d%02d%02d", $3, $2, $1);
|
768
|
|
|
|
|
|
|
}
|
769
|
|
|
|
|
|
|
|
770
|
|
|
|
|
|
|
sub oe_date_compare {
|
771
|
0
|
|
|
0
|
0
|
0
|
my ($date1, $date2) = @_;
|
772
|
|
|
|
|
|
|
|
773
|
0
|
0
|
|
|
|
0
|
if ($date1 eq '') {
|
774
|
0
|
|
|
|
|
0
|
$date1=$date2;
|
775
|
|
|
|
|
|
|
}
|
776
|
|
|
|
|
|
|
|
777
|
0
|
|
|
|
|
0
|
my $wdate1 = oe_date_convert($date1);
|
778
|
0
|
|
|
|
|
0
|
my $wdate2 = oe_date_convert($date1);
|
779
|
|
|
|
|
|
|
|
780
|
0
|
0
|
|
|
|
0
|
if (!defined($wdate1)) {
|
781
|
0
|
|
|
|
|
0
|
warn "INFO : Unexpected date format: \"$date1\" should be dd/mm/yyyy. Date ignored\n";
|
782
|
0
|
|
|
|
|
0
|
return 1;
|
783
|
|
|
|
|
|
|
}
|
784
|
0
|
0
|
|
|
|
0
|
if (!defined($wdate2)) {
|
785
|
0
|
|
|
|
|
0
|
warn "INFO : Unexpected date format: \"$date2\" should be dd/mm/yyyy. Date ignored\n";
|
786
|
0
|
|
|
|
|
0
|
return -1;
|
787
|
|
|
|
|
|
|
}
|
788
|
0
|
|
|
|
|
0
|
return $wdate1 <=> $wdate2;
|
789
|
|
|
|
|
|
|
}
|
790
|
|
|
|
|
|
|
|
791
|
|
|
|
|
|
|
sub oe_date_smallest($$) {
|
792
|
0
|
|
|
0
|
0
|
0
|
my ($date1, $date2) = @_;
|
793
|
|
|
|
|
|
|
|
794
|
0
|
0
|
|
|
|
0
|
if (oe_date_compare($date1, $date2) <= 0) {
|
795
|
0
|
|
|
|
|
0
|
return $date1;
|
796
|
|
|
|
|
|
|
} else {
|
797
|
0
|
|
|
|
|
0
|
return $date2;
|
798
|
|
|
|
|
|
|
}
|
799
|
|
|
|
|
|
|
}
|
800
|
|
|
|
|
|
|
|
801
|
|
|
|
|
|
|
sub oe_date_biggest($$) {
|
802
|
0
|
|
|
0
|
0
|
0
|
my ($date1, $date2) = @_;
|
803
|
|
|
|
|
|
|
|
804
|
0
|
0
|
|
|
|
0
|
if (oe_date_compare($date1, $date2) <= 0) {
|
805
|
0
|
|
|
|
|
0
|
return $date2;
|
806
|
|
|
|
|
|
|
} else {
|
807
|
0
|
|
|
|
|
0
|
return $date1;
|
808
|
|
|
|
|
|
|
}
|
809
|
|
|
|
|
|
|
}
|
810
|
|
|
|
|
|
|
|
811
|
|
|
|
|
|
|
|
812
|
|
|
|
|
|
|
sub oe_num2txt_us(\$) {
|
813
|
|
|
|
|
|
|
# traitement des montants au format Texte
|
814
|
|
|
|
|
|
|
# le séparateur de décimal "," est transformé en "." pour les commandes de chargement US / C7
|
815
|
|
|
|
|
|
|
# le séparateur de millier "." ou " " est supprimé
|
816
|
|
|
|
|
|
|
# recoit : une variable alphanumerique formattée pour l'affichage
|
817
|
|
|
|
|
|
|
# $value = oe_num2txt_us($value);
|
818
|
|
|
|
|
|
|
# ou par référence
|
819
|
|
|
|
|
|
|
# oe_num2txt_us($value);
|
820
|
|
|
|
|
|
|
|
821
|
0
|
|
|
0
|
0
|
0
|
my $refValue = shift;
|
822
|
0
|
|
0
|
|
|
0
|
${$refValue}||="";
|
|
0
|
|
|
|
|
0
|
|
823
|
|
|
|
|
|
|
|
824
|
0
|
0
|
|
|
|
0
|
if (${$refValue}){
|
|
0
|
|
|
|
|
0
|
|
825
|
0
|
|
|
|
|
0
|
${$refValue}=~s/\s+//g; # suppression des blancs
|
|
0
|
|
|
|
|
0
|
|
826
|
0
|
|
|
|
|
0
|
${$refValue}=~s/\.//g; # suppression des séparateurs de milliers
|
|
0
|
|
|
|
|
0
|
|
827
|
0
|
|
|
|
|
0
|
${$refValue}=~s/\,/\./g; # remplacement du séparateur de décimal
|
|
0
|
|
|
|
|
0
|
|
828
|
0
|
|
|
|
|
0
|
${$refValue}=~s/(.*)(\-)$/$2$1/;# éventuellement on met le signe négatif devant
|
|
0
|
|
|
|
|
0
|
|
829
|
|
|
|
|
|
|
|
830
|
|
|
|
|
|
|
} else {
|
831
|
0
|
|
|
|
|
0
|
${$refValue}=0;
|
|
0
|
|
|
|
|
0
|
|
832
|
|
|
|
|
|
|
}
|
833
|
|
|
|
|
|
|
|
834
|
0
|
|
|
|
|
0
|
return ${$refValue};
|
|
0
|
|
|
|
|
0
|
|
835
|
|
|
|
|
|
|
}
|
836
|
|
|
|
|
|
|
|
837
|
|
|
|
|
|
|
|
838
|
|
|
|
|
|
|
# NE SERT PLUS À RIEN DANS LE CONTEXTE LaTeX
|
839
|
|
|
|
|
|
|
sub oe_compo_set_value ($;$){ # oe_cdata_set
|
840
|
0
|
|
|
0
|
0
|
0
|
my ($value, $noedit) = @_;
|
841
|
|
|
|
|
|
|
|
842
|
|
|
|
|
|
|
# A RETIRER : CERTAINS NUM SONT DÉJÀ US
|
843
|
|
|
|
|
|
|
# -> oe_compo_set_value($value) => oe_compo_set_value(oe_num2txt_us($value))
|
844
|
0
|
|
|
|
|
0
|
my $result = $TAG_L_SET . oe_num2txt_us($value);
|
845
|
|
|
|
|
|
|
|
846
|
0
|
0
|
|
|
|
0
|
if (!$noedit) {
|
847
|
0
|
|
|
|
|
0
|
$result .= $TAG_R_SET;
|
848
|
|
|
|
|
|
|
}
|
849
|
0
|
|
|
|
|
0
|
return $result;
|
850
|
|
|
|
|
|
|
}
|
851
|
|
|
|
|
|
|
|
852
|
|
|
|
|
|
|
|
853
|
|
|
|
|
|
|
# NE SERT PLUS À RIEN DANS LE CONTEXTE LaTeX
|
854
|
|
|
|
|
|
|
sub oe_cdata_table_build($@){ # oe_xdata_table_build
|
855
|
0
|
|
|
0
|
0
|
0
|
my $name = shift;
|
856
|
0
|
|
|
|
|
0
|
my @DATATAB = shift;
|
857
|
0
|
|
|
|
|
0
|
my $cdata="";
|
858
|
0
|
|
|
|
|
0
|
for (my $i = 0; $i <= $#DATATAB; $i++) {
|
859
|
0
|
|
|
|
|
0
|
my $elem = sprintf("%.6s%0.2d", $name, $i);
|
860
|
0
|
|
0
|
|
|
0
|
$cdata .= oe_data_build($elem, $DATATAB[$i] || "");
|
861
|
|
|
|
|
|
|
}
|
862
|
|
|
|
|
|
|
#warn "\n";
|
863
|
0
|
|
|
|
|
0
|
return $cdata;
|
864
|
|
|
|
|
|
|
}
|
865
|
|
|
|
|
|
|
|
866
|
|
|
|
|
|
|
|
867
|
|
|
|
|
|
|
sub oe_include_build ($$){ # dans le cadre nettoyage code C7 il faudra raccourcir ces appels
|
868
|
0
|
|
|
0
|
0
|
0
|
my ($name, $path)= @_;
|
869
|
|
|
|
|
|
|
#import oEdtk::TexDoc;
|
870
|
|
|
|
|
|
|
|
871
|
0
|
|
|
|
|
0
|
my $tag = oEdtk::TexDoc->new();
|
872
|
0
|
|
|
|
|
0
|
$tag->include($name, $path);
|
873
|
0
|
|
|
|
|
0
|
return $tag;
|
874
|
|
|
|
|
|
|
}
|
875
|
|
|
|
|
|
|
|
876
|
|
|
|
|
|
|
|
877
|
|
|
|
|
|
|
# NE SERT PLUS À RIEN DANS LE CONTEXTE LaTeX
|
878
|
|
|
|
|
|
|
# mais utilisé dans Main.pm => nettoyer
|
879
|
|
|
|
|
|
|
sub oe_data_build($;$) { #oe_xdata_build
|
880
|
0
|
|
|
0
|
0
|
0
|
my ($name, $val)= @_;
|
881
|
|
|
|
|
|
|
|
882
|
0
|
0
|
|
|
|
0
|
if ($TAG_MODE eq 'TEX') {
|
883
|
0
|
|
|
|
|
0
|
my $tag = oEdtk::TexTag->new($name, $val);
|
884
|
0
|
|
|
|
|
0
|
return $tag->emit();
|
885
|
|
|
|
|
|
|
}
|
886
|
|
|
|
|
|
|
|
887
|
|
|
|
|
|
|
# POUR COMPUSET
|
888
|
0
|
|
|
|
|
0
|
my $data = "";
|
889
|
0
|
0
|
|
|
|
0
|
if (defined $val) {
|
|
|
0
|
|
|
|
|
|
890
|
|
|
|
|
|
|
# s'il s'agit d'une variable numérique
|
891
|
0
|
0
|
|
|
|
0
|
if ($val =~ /^[\d\.]+$/) {
|
892
|
0
|
|
|
|
|
0
|
$data = $TAG_OPEN . $TAG_MARKER . $name . $TAG_ASSIGN . $TAG_L_SET .
|
893
|
|
|
|
|
|
|
$val . $TAG_ASSIGN_CLOS . $TAG_CLOSE;
|
894
|
|
|
|
|
|
|
} else {
|
895
|
0
|
|
|
|
|
0
|
$data = $TAG_OPEN . $TAG_MARKER . $name . $TAG_ASSIGN .
|
896
|
|
|
|
|
|
|
$val . $TAG_ASSIGN_CLOS . $TAG_CLOSE;
|
897
|
|
|
|
|
|
|
}
|
898
|
|
|
|
|
|
|
} elsif (defined $name) {
|
899
|
0
|
|
|
|
|
0
|
$data = $TAG_OPEN . $name . $TAG_CLOSE;
|
900
|
|
|
|
|
|
|
}
|
901
|
0
|
|
|
|
|
0
|
return $data;
|
902
|
|
|
|
|
|
|
}
|
903
|
|
|
|
|
|
|
|
904
|
|
|
|
|
|
|
|
905
|
|
|
|
|
|
|
sub oe_app_usage() { # migrer oe_app_usage
|
906
|
0
|
|
|
0
|
0
|
0
|
my $app="";
|
907
|
0
|
|
|
|
|
0
|
$0=~/([\w-]+[\.plmex]*$)/;
|
908
|
0
|
0
|
|
|
|
0
|
$1 ? $app="application.pl" : $app=$1;
|
909
|
0
|
|
|
|
|
0
|
print STDOUT << "EOF";
|
910
|
|
|
|
|
|
|
|
911
|
|
|
|
|
|
|
Usage : $app [job] [options]
|
912
|
|
|
|
|
|
|
Usage : $app --noinputfiles [job] [options]
|
913
|
|
|
|
|
|
|
options :
|
914
|
|
|
|
|
|
|
--massmail to confirm mass treatment
|
915
|
|
|
|
|
|
|
--edms to confirm edms treatment
|
916
|
|
|
|
|
|
|
--cgi
|
917
|
|
|
|
|
|
|
these values depend on ED_REFIDDOC config table
|
918
|
|
|
|
|
|
|
(example : omgr treatment confirmation)
|
919
|
|
|
|
|
|
|
|
920
|
|
|
|
|
|
|
--input_code input caracters encoding
|
921
|
|
|
|
|
|
|
(ie : --input_code=iso-8859-1)
|
922
|
|
|
|
|
|
|
--noinputfiles no data file needed for treatment
|
923
|
|
|
|
|
|
|
--help this message
|
924
|
|
|
|
|
|
|
|
925
|
|
|
|
|
|
|
EOF
|
926
|
|
|
|
|
|
|
# --notracking halt tracking, do not track
|
927
|
0
|
|
|
|
|
0
|
oe_list_encodings();
|
928
|
0
|
|
|
|
|
0
|
exit 1;
|
929
|
|
|
|
|
|
|
}
|
930
|
|
|
|
|
|
|
|
931
|
|
|
|
|
|
|
|
932
|
|
|
|
|
|
|
# XXX Global variable used to remember stuff from oe_new_job() when we
|
933
|
|
|
|
|
|
|
# are in oe_compo_link(). It would be *much* better to keep state in an
|
934
|
|
|
|
|
|
|
# object instance instead.
|
935
|
|
|
|
|
|
|
my $_RUN_PARAMS;
|
936
|
|
|
|
|
|
|
|
937
|
|
|
|
|
|
|
|
938
|
|
|
|
|
|
|
sub oe_new_job(@) {
|
939
|
0
|
|
|
0
|
0
|
0
|
@ARGV = (@ARGV, @_); # surcharge éventuelle des options avec les paramamètre de oe_new_job pour GetOptions
|
940
|
0
|
|
|
|
|
0
|
my $cfg = config_read('COMPO');
|
941
|
0
|
|
|
|
|
0
|
my $params = {};
|
942
|
|
|
|
|
|
|
# DEFAULT OPTION VALUES.
|
943
|
0
|
|
|
|
|
0
|
my %defaults = (
|
944
|
|
|
|
|
|
|
# xls => 0,
|
945
|
|
|
|
|
|
|
# tex => 0,
|
946
|
|
|
|
|
|
|
index => 0,
|
947
|
|
|
|
|
|
|
massmail => 0,
|
948
|
|
|
|
|
|
|
edms => 0,
|
949
|
|
|
|
|
|
|
cgi => 0,
|
950
|
|
|
|
|
|
|
input_code=> 0
|
951
|
|
|
|
|
|
|
);
|
952
|
|
|
|
|
|
|
|
953
|
|
|
|
|
|
|
# exemples d'ajout de paramètres au lancement
|
954
|
|
|
|
|
|
|
# oe_new_job('--index');
|
955
|
|
|
|
|
|
|
# oe_new_job("--input_code=utf8");
|
956
|
|
|
|
|
|
|
|
957
|
0
|
|
|
|
|
0
|
GetOptions(\%defaults, 'help', 'index', 'massmail', 'edms', 'cgi', 'noinputfiles', 'input_code=s');
|
958
|
0
|
|
|
|
|
0
|
while (my ($key, $val) = each(%defaults)) {
|
959
|
0
|
0
|
|
|
|
0
|
if (!defined($params->{$key})) {
|
960
|
0
|
|
|
|
|
0
|
$params->{$key} = $val;
|
961
|
|
|
|
|
|
|
}
|
962
|
|
|
|
|
|
|
}
|
963
|
|
|
|
|
|
|
|
964
|
0
|
0
|
|
|
|
0
|
if ($^O ne 'MSWin32') {
|
965
|
0
|
|
|
|
|
0
|
$defaults{'fifo'} = 1;
|
966
|
|
|
|
|
|
|
} else {
|
967
|
0
|
|
|
|
|
0
|
$defaults{'fifo'} = 0;
|
968
|
|
|
|
|
|
|
}
|
969
|
|
|
|
|
|
|
|
970
|
0
|
|
|
|
|
0
|
$params->{'doclib'} = _omngr_doclib();
|
971
|
0
|
|
|
|
|
0
|
$params->{'idldoc'} = oe_ID_LDOC();
|
972
|
|
|
|
|
|
|
|
973
|
0
|
|
|
|
|
0
|
$params->{'outfile'} = $cfg->{'EDTK_PRGNAME'}.".txt"; # devrait être lié à TexMode
|
974
|
0
|
|
0
|
|
|
0
|
$params->{'output_code'} = $cfg->{'EDTK_OUT_ENCODING'} || 'utf8';
|
975
|
0
|
|
|
|
|
0
|
$params->{'output_code'} = ">:encoding(". $params->{'output_code'} .")";
|
976
|
0
|
0
|
|
|
|
0
|
if ($params->{'input_code'}) {
|
977
|
0
|
|
|
|
|
0
|
$params->{'input_code'} = "<:encoding(". $params->{'input_code'} .")";
|
978
|
|
|
|
|
|
|
} else {
|
979
|
0
|
|
|
|
|
0
|
$params->{'input_code'} = "<";
|
980
|
|
|
|
|
|
|
}
|
981
|
|
|
|
|
|
|
|
982
|
|
|
|
|
|
|
|
983
|
0
|
|
|
|
|
0
|
my $fi;
|
984
|
0
|
0
|
|
|
|
0
|
if ($defaults{help}) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
985
|
0
|
|
|
|
|
0
|
&oe_app_usage();
|
986
|
0
|
|
|
|
|
0
|
exit 0;
|
987
|
|
|
|
|
|
|
} elsif ($defaults{noinputfiles}) {
|
988
|
0
|
|
|
|
|
0
|
$fi = 0;
|
989
|
0
|
|
|
|
|
0
|
warn "INFO : no input file for this treatment\n";
|
990
|
|
|
|
|
|
|
} elsif ($#ARGV ==-1) { # TO KEEP COMPATIBILITY
|
991
|
0
|
|
|
|
|
0
|
&oe_app_usage();
|
992
|
0
|
|
|
|
|
0
|
exit 0;
|
993
|
|
|
|
|
|
|
} else {
|
994
|
0
|
|
|
|
|
0
|
$fi = $ARGV[0]; # TO KEEP COMPATIBILITY
|
995
|
0
|
0
|
|
|
|
0
|
open(IN, $params->{'input_code'}, $fi) or die "ERROR: Cannot open \"$fi\" for reading: $!\n";
|
996
|
0
|
|
|
|
|
0
|
warn "INFO : input perl data is $fi (encode \'". $params->{'input_code'} ."\' $ARGV[-1])\n";
|
997
|
|
|
|
|
|
|
}
|
998
|
|
|
|
|
|
|
|
999
|
|
|
|
|
|
|
|
1000
|
|
|
|
|
|
|
# Override default setting if EDTK_COMPO_ASYNC is set in edtk.ini.
|
1001
|
0
|
|
|
|
|
0
|
my $async = $cfg->{'EDTK_COMPO_ASYNC'};
|
1002
|
0
|
0
|
0
|
|
|
0
|
if (defined($async) && $async =~ /^yes$/i) {
|
|
|
0
|
0
|
|
|
|
|
1003
|
0
|
|
|
|
|
0
|
$params->{'fifo'} = 1;
|
1004
|
|
|
|
|
|
|
} elsif (defined($async) && $async =~ /^no$/i){
|
1005
|
0
|
|
|
|
|
0
|
$params->{'fifo'} = 0;
|
1006
|
|
|
|
|
|
|
}
|
1007
|
|
|
|
|
|
|
|
1008
|
0
|
0
|
0
|
|
|
0
|
if ($params->{'fifo'} && $^O eq 'MSWin32') {
|
1009
|
0
|
|
|
|
|
0
|
warn "INFO : FIFO mode is not possible under Windows, ignoring.\n";
|
1010
|
0
|
|
|
|
|
0
|
$params->{'fifo'} = 0;
|
1011
|
|
|
|
|
|
|
}
|
1012
|
|
|
|
|
|
|
|
1013
|
|
|
|
|
|
|
# If we are in FIFO mode and there is a left-over text file, the mkfifo()
|
1014
|
|
|
|
|
|
|
# call would fail. If we are not in FIFO mode and there's a left-over FIFO,
|
1015
|
|
|
|
|
|
|
# we would hang indefinitely, so make sure to remove this file first.
|
1016
|
0
|
|
|
|
|
0
|
unlink($params->{'outfile'});
|
1017
|
|
|
|
|
|
|
|
1018
|
|
|
|
|
|
|
# Handle options passed in the EDTK_OPTIONS environment variable.
|
1019
|
0
|
0
|
|
|
|
0
|
if (exists($ENV{'EDTK_OPTIONS'})) {
|
1020
|
0
|
|
|
|
|
0
|
my @opts = split(',', $ENV{'EDTK_OPTIONS'});
|
1021
|
0
|
|
|
|
|
0
|
foreach my $opt (@opts) {
|
1022
|
0
|
|
|
|
|
0
|
$params->{$opt} = 1;
|
1023
|
|
|
|
|
|
|
}
|
1024
|
|
|
|
|
|
|
}
|
1025
|
|
|
|
|
|
|
|
1026
|
0
|
0
|
|
|
|
0
|
if ($params->{'fifo'}) {
|
1027
|
0
|
|
|
|
|
0
|
warn "INFO : Creating FIFO for output data file (". $params->{'outfile'} .")\n";
|
1028
|
0
|
0
|
|
|
|
0
|
mkfifo($params->{'outfile'}, 0700) or die "ERROR: Could not create fifo : $!\n";
|
1029
|
0
|
|
|
|
|
0
|
my $pid = oe_compo_run($cfg->{'EDTK_PRGNAME'}, $params);
|
1030
|
0
|
|
|
|
|
0
|
$params->{'pid'} = $pid;
|
1031
|
|
|
|
|
|
|
}
|
1032
|
|
|
|
|
|
|
|
1033
|
0
|
0
|
|
|
|
0
|
open(OUT,$params->{'output_code'}, $params->{'outfile'}) or die "ERROR: Cannot open \'". $params->{'outfile'} ."\' for writing: $!\n";
|
1034
|
0
|
|
|
|
|
0
|
warn "INFO : input compo data is ".$params->{'outfile'} ." (encode \'". $params->{'output_code'} ."\')\n";
|
1035
|
|
|
|
|
|
|
|
1036
|
|
|
|
|
|
|
# Remember for later use in oe_compo_link() & oEdtk::Main.
|
1037
|
0
|
|
|
|
|
0
|
$_RUN_PARAMS = $params;
|
1038
|
|
|
|
|
|
|
|
1039
|
0
|
0
|
0
|
|
|
0
|
if (defined $cfg->{'EDTK_COMPO_INCLUDE'} && $cfg->{'EDTK_COMPO_INCLUDE'}=~/yes/i) {
|
1040
|
0
|
|
|
|
|
0
|
print OUT oe_include_build($cfg->{'EDTK_PRGNAME'}.".".$cfg->{'EDTK_EXT_COMPO'}, 'EDTK_DIR_SCRIPT');
|
1041
|
|
|
|
|
|
|
}
|
1042
|
0
|
|
|
|
|
0
|
print OUT oe_data_build(oe_corporation_tag());
|
1043
|
0
|
|
|
|
|
0
|
print OUT oe_data_build('xIdLdoc', $params->{'idldoc'});
|
1044
|
0
|
|
|
|
|
0
|
print OUT oe_data_build('xDebFlux');
|
1045
|
0
|
|
|
|
|
0
|
print OUT oe_data_build('xAppRef', $cfg->{'EDTK_PRGNAME'});
|
1046
|
0
|
|
|
|
|
0
|
print OUT oe_data_build('xDOCLIB', $params->{'doclib'});
|
1047
|
|
|
|
|
|
|
|
1048
|
0
|
|
|
|
|
0
|
my $env = $cfg->{'EDTK_TYPE_ENV'};
|
1049
|
0
|
0
|
|
|
|
0
|
if ($env ne 'Production') {
|
1050
|
|
|
|
|
|
|
# On génère le filigrane de 'TEST EDITION'.
|
1051
|
0
|
|
0
|
|
|
0
|
print OUT oe_data_build('xWaterM', $cfg->{'EDTK_WATERMARKTEXT'}||' ');
|
1052
|
0
|
|
|
|
|
0
|
print OUT oe_data_build('xTstApp');
|
1053
|
|
|
|
|
|
|
} else {
|
1054
|
|
|
|
|
|
|
# Pas de filigrane.
|
1055
|
0
|
|
|
|
|
0
|
print OUT oe_data_build('xProdApp');
|
1056
|
|
|
|
|
|
|
}
|
1057
|
0
|
|
|
|
|
0
|
print OUT oe_data_build('xTYPPROD', substr($env, 0, 1));
|
1058
|
0
|
|
|
|
|
0
|
print OUT oe_data_build('xHOST', hostname());
|
1059
|
|
|
|
|
|
|
|
1060
|
|
|
|
|
|
|
# Do we want to generate an index file?
|
1061
|
0
|
0
|
|
|
|
0
|
if ($params->{'index'}) {
|
1062
|
0
|
|
|
|
|
0
|
print OUT oe_data_build ('xStOmgr');
|
1063
|
0
|
|
|
|
|
0
|
print OUT oe_data_build ('xHost', hostname());
|
1064
|
|
|
|
|
|
|
}
|
1065
|
0
|
|
|
|
|
0
|
print OUT $TAG_COMMENT;
|
1066
|
0
|
|
|
|
|
0
|
print OUT "\n";
|
1067
|
|
|
|
|
|
|
}
|
1068
|
|
|
|
|
|
|
|
1069
|
|
|
|
|
|
|
sub oe_csv2data_handles () {
|
1070
|
0
|
|
|
0
|
0
|
0
|
undef @DATATAB;
|
1071
|
0
|
|
|
|
|
0
|
my $ligne = ;
|
1072
|
0
|
|
|
|
|
0
|
chomp ($ligne);
|
1073
|
0
|
|
|
|
|
0
|
c7Flux($ligne);
|
1074
|
0
|
|
|
|
|
0
|
@DATATAB = split (/,/, $ligne);
|
1075
|
0
|
|
|
|
|
0
|
my $motif = "";
|
1076
|
|
|
|
|
|
|
|
1077
|
|
|
|
|
|
|
|
1078
|
|
|
|
|
|
|
# TRANSFORME UN FICHIER CSV EN FICHIER DATA
|
1079
|
|
|
|
|
|
|
# LA PREMIÈRE LIGNE DÉFINIT LES COLONNES ET LES NOMS DE BALISE
|
1080
|
|
|
|
|
|
|
# une balise d'exécution est ajoutée en fin de ligne = xFLigne
|
1081
|
|
|
|
|
|
|
# au final une balise de fin de flux est ajoutée = xFinFlux
|
1082
|
|
|
|
|
|
|
|
1083
|
0
|
|
|
|
|
0
|
for (my $i=0; $i<=$#DATATAB; $i++){
|
1084
|
0
|
0
|
|
|
|
0
|
$DATATAB[$i] ="vide$i" if ($DATATAB[$i] eq '');
|
1085
|
0
|
|
|
|
|
0
|
$DATATAB[$i] =~s/\_//g;
|
1086
|
|
|
|
|
|
|
|
1087
|
0
|
|
|
|
|
0
|
$motif .= sprintf ('%s%s%.8s%s', $TAG_OPEN, $TAG_MARKER, $DATATAB[$i], $TAG_ASSIGN );
|
1088
|
|
|
|
|
|
|
# my $tag_data =oe_unique_data_name(8, "$DATATAB[$i]", $i);
|
1089
|
|
|
|
|
|
|
# $motif .= sprintf ('%s%s%.8s%s', $TAG_OPEN, $TAG_MARKER, $tag_data, $TAG_ASSIGN);
|
1090
|
0
|
|
|
|
|
0
|
$motif .= "%s" . $TAG_ASSIGN_CLOS . $TAG_CLOSE;
|
1091
|
|
|
|
|
|
|
}
|
1092
|
0
|
|
|
|
|
0
|
$motif .= $TAG_OPEN . "xFLigne" . $TAG_CLOSE;
|
1093
|
0
|
|
|
|
|
0
|
$motif =~s/\s//g;
|
1094
|
|
|
|
|
|
|
# warn $motif . "\n";
|
1095
|
|
|
|
|
|
|
|
1096
|
0
|
|
|
|
|
0
|
while ($ligne = ) {
|
1097
|
0
|
|
|
|
|
0
|
@DATATAB = ();
|
1098
|
0
|
|
|
|
|
0
|
chomp ($ligne);
|
1099
|
0
|
|
|
|
|
0
|
c7Flux($ligne);
|
1100
|
0
|
|
|
|
|
0
|
@DATATAB= split (/,/, $ligne);
|
1101
|
0
|
|
|
|
|
0
|
for (my $i=0; $i<=$#DATATAB; $i++){
|
1102
|
0
|
0
|
|
|
|
0
|
if ($DATATAB[$i]=~/^\s*[\d\.\s]+$/){
|
1103
|
0
|
|
|
|
|
0
|
$DATATAB[$i] = $TAG_L_SET . $DATATAB[$i];
|
1104
|
|
|
|
|
|
|
}
|
1105
|
|
|
|
|
|
|
}
|
1106
|
0
|
|
0
|
|
|
0
|
$ligne = sprintf($motif, @DATATAB) || '';
|
1107
|
0
|
|
|
|
|
0
|
print OUT $ligne . "\n"; # if $ligne;
|
1108
|
|
|
|
|
|
|
}
|
1109
|
|
|
|
|
|
|
|
1110
|
0
|
|
|
|
|
0
|
1;
|
1111
|
|
|
|
|
|
|
}
|
1112
|
|
|
|
|
|
|
|
1113
|
|
|
|
|
|
|
|
1114
|
|
|
|
|
|
|
sub oe_outmngr_full_run($;$){
|
1115
|
0
|
|
|
0
|
0
|
0
|
my $input_fdatwork = shift;
|
1116
|
0
|
|
0
|
|
|
0
|
my $output_format = shift || "PDF";
|
1117
|
0
|
|
|
|
|
0
|
oe_outmngr_compo_run ($input_fdatwork, $output_format);
|
1118
|
0
|
|
|
|
|
0
|
oe_outmngr_output_run ();
|
1119
|
0
|
|
|
|
|
0
|
1;
|
1120
|
|
|
|
|
|
|
}
|
1121
|
|
|
|
|
|
|
|
1122
|
|
|
|
|
|
|
sub oe_outmngr_compo_run ($;$){
|
1123
|
0
|
|
|
0
|
0
|
0
|
my $input_fdatwork = shift;
|
1124
|
0
|
|
0
|
|
|
0
|
my $output_format = shift || "PDF";
|
1125
|
0
|
|
|
|
|
0
|
my $xTypTrt = _app_typ_trt();
|
1126
|
|
|
|
|
|
|
|
1127
|
0
|
|
|
|
|
0
|
import oEdtk::Outmngr qw(omgr_import);
|
1128
|
0
|
|
|
|
|
0
|
import oEdtk::libC7 qw();
|
1129
|
1
|
|
|
1
|
|
21
|
use Fcntl qw(:flock);
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
212
|
|
1130
|
1
|
|
|
1
|
|
7
|
use File::Copy;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
679
|
|
1131
|
|
|
|
|
|
|
|
1132
|
0
|
|
|
|
|
0
|
my $cfg = config_read('COMSET');
|
1133
|
0
|
|
|
|
|
0
|
my $script_compo = $cfg->{'EDTK_DIR_SCRIPT'} . "/" . $cfg->{'EDTK_PRGNAME'} . "." . $cfg->{'EDTK_EXT_COMP_OMGR'};
|
1134
|
0
|
|
|
|
|
0
|
my $lockfile = $cfg->{'EDTK_DOCLIB_LOCK'};
|
1135
|
0
|
0
|
|
|
|
0
|
open(my $lock, '>', $lockfile) or die "ERROR: Cannot open lock file: $!\n";
|
1136
|
|
|
|
|
|
|
|
1137
|
0
|
|
|
|
|
0
|
warn "INFO : lancement compo ($output_format, $script_compo, $input_fdatwork)\n";
|
1138
|
|
|
|
|
|
|
|
1139
|
|
|
|
|
|
|
# When Compuset fails with a doclib opened in read-write mode, it corrupts the file,
|
1140
|
|
|
|
|
|
|
# so we have to protect against this...
|
1141
|
0
|
|
|
|
|
0
|
my $doclib = _omngr_doclib();
|
1142
|
0
|
|
|
|
|
0
|
my $DMG_path = $cfg->{'C7_DCLIB_RW'} . "/$doclib.dmg";
|
1143
|
|
|
|
|
|
|
|
1144
|
0
|
|
|
|
|
0
|
warn "INFO : Acquiring exclusive lock on $lockfile...\n";
|
1145
|
0
|
0
|
|
|
|
0
|
flock($lock, LOCK_EX) or die "ERROR: Cannot acquire exclusive lock: $!\n";
|
1146
|
0
|
|
|
|
|
0
|
warn "INFO : Successfully acquired lock.\n";
|
1147
|
0
|
|
|
|
|
0
|
eval {
|
1148
|
0
|
0
|
|
|
|
0
|
if (-f $DMG_path) {
|
1149
|
0
|
0
|
|
|
|
0
|
copy($DMG_path, "$DMG_path.bak") or die "ERROR: Cannot backup \"$DMG_path\": $!\n";
|
1150
|
|
|
|
|
|
|
}
|
1151
|
0
|
0
|
|
|
|
0
|
if (defined $cfg->{'EDTK_TESTDATE'}) { oe_set_sys_date($cfg->{'EDTK_TESTDATE'}) };
|
|
0
|
|
|
|
|
0
|
|
1152
|
0
|
|
|
|
|
0
|
c7_compo ($output_format, $script_compo, $input_fdatwork, "OMGR", $doclib);
|
1153
|
0
|
|
|
|
|
0
|
c7_emit ($output_format, $script_compo, $input_fdatwork, $cfg->{'EDTK_FDATAOUT'}, "OMGR", $doclib);
|
1154
|
|
|
|
|
|
|
};
|
1155
|
0
|
0
|
|
|
|
0
|
if ($@) {
|
1156
|
|
|
|
|
|
|
# There was an error, restore the backup doclib, and re-throw the error.
|
1157
|
0
|
0
|
|
|
|
0
|
copy("$DMG_path.bak", $DMG_path) or warn "INFO : Could not restore the doclib $DMG_path !\n";
|
1158
|
|
|
|
|
|
|
# die $@;
|
1159
|
|
|
|
|
|
|
}
|
1160
|
0
|
|
|
|
|
0
|
close($lock);
|
1161
|
|
|
|
|
|
|
|
1162
|
0
|
|
|
|
|
0
|
my $idx1 =$cfg->{'EDTK_DIR_OUTMNGR'} . "/" . $cfg->{'EDTK_PRGNAME'} . ".idx1";
|
1163
|
|
|
|
|
|
|
|
1164
|
|
|
|
|
|
|
# warn
|
1165
|
|
|
|
|
|
|
# "INFO : OM EDTK_PRGNAME = "
|
1166
|
|
|
|
|
|
|
# . $cfg->{'EDTK_PRGNAME'}
|
1167
|
|
|
|
|
|
|
# . " EDTK_FTYP_DFLT = "
|
1168
|
|
|
|
|
|
|
# . $cfg->{'EDTK_FTYP_DFLT'}
|
1169
|
|
|
|
|
|
|
# . " EDTK_TYP_ENVIRO = "
|
1170
|
|
|
|
|
|
|
# . $cfg->{'EDTK_TYP_ENVIRO'}
|
1171
|
|
|
|
|
|
|
# ."\n";
|
1172
|
|
|
|
|
|
|
|
1173
|
|
|
|
|
|
|
|
1174
|
0
|
0
|
|
|
|
0
|
omgr_import ($cfg->{'EDTK_PRGNAME'}, $idx1) if ($xTypTrt =~ /[MGTD]/); # xxxxxx c'est là qu'il faut le bon nom d'application
|
1175
|
|
|
|
|
|
|
|
1176
|
0
|
0
|
|
|
|
0
|
if ($xTypTrt!~/D/) {
|
1177
|
0
|
|
|
|
|
0
|
unlink ($idx1);
|
1178
|
0
|
|
|
|
|
0
|
unlink ($input_fdatwork);
|
1179
|
|
|
|
|
|
|
}
|
1180
|
|
|
|
|
|
|
|
1181
|
0
|
|
|
|
|
0
|
print "$cfg->{'EDTK_FDATAOUT'}.$output_format\n";
|
1182
|
0
|
|
|
|
|
0
|
1;
|
1183
|
|
|
|
|
|
|
}
|
1184
|
|
|
|
|
|
|
|
1185
|
|
|
|
|
|
|
|
1186
|
|
|
|
|
|
|
sub oe_outmngr_output_run (;$){
|
1187
|
|
|
|
|
|
|
# le paramètre optionnel permet de fixer le type de traitement pour
|
1188
|
|
|
|
|
|
|
# permettre à l'exploitation de lancer le output_run à intervalle régulier
|
1189
|
0
|
|
|
0
|
0
|
0
|
my $xTypTrt = _app_typ_trt(shift);
|
1190
|
|
|
|
|
|
|
|
1191
|
0
|
0
|
|
|
|
0
|
if ( $xTypTrt !~/[MTD]/) {
|
1192
|
|
|
|
|
|
|
# oe_outmngr_output_run : on ne passe dans index_output qu'en cas de Mass, Debug ou Test de lotissement
|
1193
|
0
|
|
|
|
|
0
|
warn "INFO : traitement OM '$xTypTrt' -> lotissement suspendu\n";
|
1194
|
0
|
|
|
|
|
0
|
return 1;
|
1195
|
|
|
|
|
|
|
}
|
1196
|
|
|
|
|
|
|
|
1197
|
0
|
|
|
|
|
0
|
import oEdtk::Outmngr qw(omgr_export);
|
1198
|
0
|
|
|
|
|
0
|
import oEdtk::libC7 qw ();
|
1199
|
1
|
|
|
1
|
|
7
|
use Archive::Zip qw(:ERROR_CODES);
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
136
|
|
1200
|
1
|
|
|
1
|
|
6
|
use Fcntl qw(:flock);
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
3084
|
|
1201
|
|
|
|
|
|
|
|
1202
|
0
|
|
|
|
|
0
|
my $cfg =config_read('COMSET');
|
1203
|
|
|
|
|
|
|
|
1204
|
0
|
|
|
|
|
0
|
warn "INFO : lancement \@tSsLots =omgr_export\n";
|
1205
|
0
|
|
|
|
|
0
|
my @lots = omgr_export();
|
1206
|
0
|
|
|
|
|
0
|
my (@tProcessed_Dclib);
|
1207
|
0
|
|
|
|
|
0
|
my $lockfile = $cfg->{'EDTK_DOCLIB_LOCK'};
|
1208
|
0
|
0
|
|
|
|
0
|
open(my $lock, '>', $lockfile) or die "ERROR: Cannot open lock file: $!\n";
|
1209
|
|
|
|
|
|
|
|
1210
|
0
|
|
|
|
|
0
|
foreach (@lots) {
|
1211
|
0
|
|
|
|
|
0
|
my ($SsLot, $numpgs, @tDclib) = @$_;
|
1212
|
|
|
|
|
|
|
|
1213
|
0
|
|
|
|
|
0
|
warn "INFO : Preparation job ticket $cfg->{'EDTK_DIR_OUTMNGR'} $SsLot pour compo - tDclib = @tDclib\n";
|
1214
|
0
|
|
|
|
|
0
|
my $SsLot_output_txt =$cfg->{'EDTK_DIR_OUTMNGR'} . "/" . $SsLot . "." . $cfg->{'EDTK_EXT_WORK'};
|
1215
|
0
|
|
|
|
|
0
|
my $SsLot_output_opf =$cfg->{'EDTK_DIR_OUTMNGR'} . "/" . $SsLot ; #. "." . $cfg->{'EDTK_EXT_PDF'};
|
1216
|
0
|
|
|
|
|
0
|
my $lib_filieres =$cfg->{'C7_CHAINS_LIB'};
|
1217
|
|
|
|
|
|
|
|
1218
|
0
|
|
|
|
|
0
|
oe_open_fo_OUT ($SsLot_output_txt);
|
1219
|
0
|
|
|
|
|
0
|
oe_open_fi_IN ($cfg->{'EDTK_DIR_OUTMNGR'} . "/" . $SsLot . ".job");
|
1220
|
0
|
|
|
|
|
0
|
oe_csv2data_handles ();
|
1221
|
|
|
|
|
|
|
|
1222
|
0
|
|
|
|
|
0
|
print OUT oe_data_build ("xIniPBAN");
|
1223
|
|
|
|
|
|
|
|
1224
|
0
|
|
|
|
|
0
|
warn "INFO : Preparation de l'index $cfg->{'EDTK_DIR_OUTMNGR'} $SsLot pour compo\n";
|
1225
|
0
|
|
|
|
|
0
|
oe_open_fi_IN ($cfg->{'EDTK_DIR_OUTMNGR'} . "/" . $SsLot . ".idx");
|
1226
|
0
|
|
|
|
|
0
|
oe_csv2data_handles;
|
1227
|
0
|
|
|
|
|
0
|
print OUT oe_data_build ("xFinFlux");
|
1228
|
0
|
|
|
|
|
0
|
oe_close_fo($SsLot_output_txt);
|
1229
|
|
|
|
|
|
|
|
1230
|
0
|
|
|
|
|
0
|
warn "INFO : Composition $SsLot dans $cfg->{'EDTK_DIR_OUTMNGR'}\n";
|
1231
|
0
|
|
|
|
|
0
|
warn "INFO : Acquiring shared lock on $lockfile...\n";
|
1232
|
0
|
0
|
|
|
|
0
|
flock($lock, LOCK_SH) or die "ERROR: Cannot acquire lock: $!\n";
|
1233
|
0
|
|
|
|
|
0
|
warn "INFO : Successfully acquired lock.\n";
|
1234
|
0
|
|
|
|
|
0
|
eval {
|
1235
|
0
|
0
|
|
|
|
0
|
if (defined $cfg->{'EDTK_TESTDATE'}) { oe_set_sys_date($cfg->{'EDTK_TESTDATE'}) };
|
|
0
|
|
|
|
|
0
|
|
1236
|
0
|
|
|
|
|
0
|
c7_compo ("PDF", $lib_filieres, $SsLot_output_txt, "OMGR", @tDclib);
|
1237
|
0
|
|
|
|
|
0
|
c7_emit ("PDF", $lib_filieres, $SsLot_output_txt, $SsLot_output_opf, "OMGR", @tDclib);
|
1238
|
|
|
|
|
|
|
};
|
1239
|
0
|
|
|
|
|
0
|
flock($lock, LOCK_UN);
|
1240
|
0
|
0
|
|
|
|
0
|
die "ERROR: can't unlock $lock : $@" if $@; # Now that we unlocked, re-throw the error if any.
|
1241
|
|
|
|
|
|
|
|
1242
|
0
|
|
|
|
|
0
|
close(IN); # XXX OMG THIS IS A HACK!$#@#@
|
1243
|
0
|
|
|
|
|
0
|
warn "INFO : Packaging $cfg->{'EDTK_DIR_OUTMNGR'} $SsLot\n";
|
1244
|
0
|
|
|
|
|
0
|
my $zip = Archive::Zip->new();
|
1245
|
0
|
|
|
|
|
0
|
$zip->addFile("$cfg->{'EDTK_DIR_OUTMNGR'}/$SsLot.idx", "$SsLot.idx");
|
1246
|
0
|
|
|
|
|
0
|
$zip->addFile("$cfg->{'EDTK_DIR_OUTMNGR'}/$SsLot.pdf", "$SsLot.pdf");
|
1247
|
0
|
0
|
|
|
|
0
|
die "ERROR: Could not create zip archive\n"
|
1248
|
|
|
|
|
|
|
unless $zip->writeToFileNamed("$cfg->{'EDTK_DIR_OUTMNGR'}/$SsLot.zip") == AZ_OK;
|
1249
|
|
|
|
|
|
|
|
1250
|
0
|
0
|
|
|
|
0
|
if ($xTypTrt !~/D/) {
|
1251
|
0
|
|
|
|
|
0
|
unlink("$cfg->{'EDTK_DIR_OUTMNGR'}/$SsLot.job");
|
1252
|
0
|
|
|
|
|
0
|
unlink("$cfg->{'EDTK_DIR_OUTMNGR'}/$SsLot.idx");
|
1253
|
0
|
|
|
|
|
0
|
unlink("$cfg->{'EDTK_DIR_OUTMNGR'}/$SsLot.txt");
|
1254
|
0
|
|
|
|
|
0
|
unlink("$cfg->{'EDTK_DIR_OUTMNGR'}/$SsLot.pdf");
|
1255
|
|
|
|
|
|
|
}
|
1256
|
|
|
|
|
|
|
|
1257
|
0
|
|
|
|
|
0
|
@tProcessed_Dclib = uniq(@tProcessed_Dclib, @tDclib);
|
1258
|
|
|
|
|
|
|
}
|
1259
|
|
|
|
|
|
|
|
1260
|
0
|
0
|
|
|
|
0
|
if ($xTypTrt !~/D/) {
|
1261
|
0
|
|
|
|
|
0
|
while (my $docLib = shift (@tProcessed_Dclib)){
|
1262
|
|
|
|
|
|
|
# warn "INFO : Suppr ".$cfg->{'EDTK_DIR_DOCLIB'}."/$docLib";
|
1263
|
0
|
|
|
|
|
0
|
unlink($cfg->{'EDTK_DIR_DOCLIB'}."/$docLib");
|
1264
|
|
|
|
|
|
|
}
|
1265
|
|
|
|
|
|
|
}
|
1266
|
0
|
|
|
|
|
0
|
close($lock); # This releases locks.
|
1267
|
0
|
|
|
|
|
0
|
warn "INFO : Fin oe_outmngr_output_run\n";
|
1268
|
|
|
|
|
|
|
|
1269
|
0
|
|
|
|
|
0
|
my @zips = map { $cfg->{'EDTK_DIR_OUTMNGR'}."/$$_[0].zip\n" } @lots;
|
|
0
|
|
|
|
|
0
|
|
1270
|
0
|
|
|
|
|
0
|
print @zips;
|
1271
|
|
|
|
|
|
|
|
1272
|
0
|
|
|
|
|
0
|
return 1;
|
1273
|
|
|
|
|
|
|
}
|
1274
|
|
|
|
|
|
|
|
1275
|
|
|
|
|
|
|
|
1276
|
|
|
|
|
|
|
sub oe_compo_link (;@){ # migrer oe_close_files oe_compo_link
|
1277
|
|
|
|
|
|
|
# SI LE FLUX D'ENTREE FAIT MOINS DE 1 LIGNE (variable $.), SORTIES EN ERREUR
|
1278
|
|
|
|
|
|
|
# if ($. == 0) {
|
1279
|
|
|
|
|
|
|
# # FLUX INVALIDE ARRET
|
1280
|
|
|
|
|
|
|
# die "ERROR: uncomplete datastream\n $message \n\n";
|
1281
|
|
|
|
|
|
|
#}
|
1282
|
|
|
|
|
|
|
|
1283
|
0
|
|
|
0
|
0
|
0
|
my @opt=@_;
|
1284
|
|
|
|
|
|
|
|
1285
|
0
|
0
|
|
|
|
0
|
if ($TAG_MODE eq 'TEX') {
|
1286
|
0
|
|
|
|
|
0
|
my $cfg = config_read('COMPO');
|
1287
|
0
|
|
|
|
|
0
|
my $params = $_RUN_PARAMS;
|
1288
|
0
|
|
|
|
|
0
|
$params->{'corp'} = oe_corporation_set();
|
1289
|
0
|
0
|
|
|
|
0
|
if (@opt) {
|
1290
|
0
|
|
|
|
|
0
|
foreach (@opt){
|
1291
|
0
|
|
|
|
|
0
|
$_=~s/\-+//g;
|
1292
|
0
|
|
|
|
|
0
|
$params->{$_} = 1;
|
1293
|
|
|
|
|
|
|
}
|
1294
|
|
|
|
|
|
|
}
|
1295
|
|
|
|
|
|
|
|
1296
|
0
|
|
|
|
|
0
|
print OUT oe_data_build('xFinFlux');
|
1297
|
0
|
0
|
|
|
|
0
|
close(OUT) or die "ERROR: closing output $!\n";
|
1298
|
0
|
0
|
|
|
|
0
|
if ($params->{'noinputfiles'}) {
|
1299
|
|
|
|
|
|
|
} else {
|
1300
|
0
|
0
|
|
|
|
0
|
close(IN) or die "ERROR: closing input $!\n" ;
|
1301
|
|
|
|
|
|
|
}
|
1302
|
|
|
|
|
|
|
|
1303
|
0
|
0
|
|
|
|
0
|
if ($params->{'fifo'}) {
|
1304
|
|
|
|
|
|
|
# Disable signal handler.
|
1305
|
0
|
|
|
|
|
0
|
$SIG{'CHLD'} = 'DEFAULT';
|
1306
|
0
|
0
|
|
|
|
0
|
if (!defined($params->{'cldstatus'})) {
|
1307
|
|
|
|
|
|
|
# Wait for the LaTeX process to terminate.
|
1308
|
0
|
|
|
|
|
0
|
my $pid = $params->{'pid'};
|
1309
|
0
|
|
|
|
|
0
|
warn "INFO : Waiting for the LaTeX process to terminate ($pid)...\n";
|
1310
|
0
|
|
|
|
|
0
|
my $kid = waitpid($pid, 0);
|
1311
|
0
|
0
|
|
|
|
0
|
if ($kid <= 0) {
|
1312
|
0
|
|
|
|
|
0
|
die "ERROR: Could not collect child process status: $!\n";
|
1313
|
|
|
|
|
|
|
}
|
1314
|
0
|
|
|
|
|
0
|
$params->{'cldstatus'} = $?;
|
1315
|
|
|
|
|
|
|
}
|
1316
|
0
|
|
|
|
|
0
|
my $status = $params->{'cldstatus'};
|
1317
|
0
|
0
|
|
|
|
0
|
if ($status != 0) {
|
1318
|
0
|
|
|
|
|
0
|
my $msg = oe_status_to_msg($status);
|
1319
|
0
|
|
|
|
|
0
|
die "ERROR: LaTeX process failed: $msg\n";
|
1320
|
|
|
|
|
|
|
}
|
1321
|
0
|
|
|
|
|
0
|
warn "INFO : The LaTeX process terminated successfully.\n";
|
1322
|
|
|
|
|
|
|
} else {
|
1323
|
|
|
|
|
|
|
# Run the LaTeX process.
|
1324
|
0
|
|
|
|
|
0
|
oe_compo_run($cfg->{'EDTK_PRGNAME'}, $params);
|
1325
|
|
|
|
|
|
|
}
|
1326
|
0
|
|
|
|
|
0
|
oe_after_compo($cfg->{'EDTK_PRGNAME'}, $params);
|
1327
|
|
|
|
|
|
|
}
|
1328
|
|
|
|
|
|
|
|
1329
|
0
|
|
|
|
|
0
|
return 1;
|
1330
|
|
|
|
|
|
|
}
|
1331
|
|
|
|
|
|
|
|
1332
|
|
|
|
|
|
|
|
1333
|
|
|
|
|
|
|
sub oe_env_var_completion (\$){
|
1334
|
|
|
|
|
|
|
# développe les chemins en remplaçant les variables d'environnement par les valeurs réelles
|
1335
|
|
|
|
|
|
|
# tous les niveaux d'imbrication définis dans les variables d'environnement sont développés
|
1336
|
|
|
|
|
|
|
# nécessite au préalable que les variables d'environnements soient définies
|
1337
|
0
|
|
|
0
|
0
|
0
|
my $rValue =shift;
|
1338
|
0
|
0
|
|
|
|
0
|
if ($^O eq "MSWin32"){
|
1339
|
|
|
|
|
|
|
# il peut y avoir des variables dans les variables d'environnement elles mêmes
|
1340
|
0
|
|
|
|
|
0
|
while (${$rValue}=~/\$/g) {
|
|
0
|
|
|
|
|
0
|
|
1341
|
0
|
|
|
|
|
0
|
${$rValue}=~s/\$(\w+)/${ENV{$1}}/g;
|
|
0
|
|
|
|
|
0
|
|
1342
|
|
|
|
|
|
|
}
|
1343
|
0
|
|
|
|
|
0
|
${$rValue}=~s/(\/)/\\/g;
|
|
0
|
|
|
|
|
0
|
|
1344
|
|
|
|
|
|
|
|
1345
|
|
|
|
|
|
|
} else {
|
1346
|
|
|
|
|
|
|
# VERIFIER COMPATIBILITÉ SOUS *NIX
|
1347
|
0
|
|
|
|
|
0
|
while (${$rValue}=~/\$/g) {
|
|
0
|
|
|
|
|
0
|
|
1348
|
0
|
|
|
|
|
0
|
${$rValue}=~s/\$(\w+)/${ENV{$1}}/g;
|
|
0
|
|
|
|
|
0
|
|
1349
|
|
|
|
|
|
|
}
|
1350
|
|
|
|
|
|
|
}
|
1351
|
0
|
|
|
|
|
0
|
return ${$rValue};
|
|
0
|
|
|
|
|
0
|
|
1352
|
|
|
|
|
|
|
}
|
1353
|
|
|
|
|
|
|
|
1354
|
|
|
|
|
|
|
|
1355
|
|
|
|
|
|
|
sub oe_ID_LDOC() {
|
1356
|
|
|
|
|
|
|
# UTILISE LA BIBLIOTHÈQUE : Date::Calc
|
1357
|
|
|
|
|
|
|
# ID du lot de document
|
1358
|
|
|
|
|
|
|
# format YWWWDHHMMSSPPPP.r (compuset se limite à 16 digits : 15 entiers, 1 decimal) 999999999999999.9
|
1359
|
|
|
|
|
|
|
|
1360
|
0
|
0
|
|
0
|
0
|
0
|
if ($_ID_LDOC eq '') { # on ne le génère qu'une fois par run : plusieurs appels dans la même instance retourne le même id
|
1361
|
0
|
|
|
|
|
0
|
my $time =time;
|
1362
|
0
|
|
|
|
|
0
|
my ($year,$month,$day, $hour,$min,$sec, $doy,$dow,$dst)=
|
1363
|
|
|
|
|
|
|
Gmtime($time);
|
1364
|
0
|
|
|
|
|
0
|
my ($week,) = Week_of_Year($year,$month,$day);
|
1365
|
|
|
|
|
|
|
|
1366
|
0
|
|
|
|
|
0
|
my $pid = "$$";
|
1367
|
0
|
|
|
|
|
0
|
my $rnd = int(rand(10));
|
1368
|
0
|
0
|
|
|
|
0
|
if (length $pid > 5) {
|
1369
|
0
|
|
|
|
|
0
|
$pid = $pid/(10**((length $pid)-5));
|
1370
|
|
|
|
|
|
|
}
|
1371
|
|
|
|
|
|
|
|
1372
|
0
|
|
|
|
|
0
|
$_ID_LDOC =sprintf ("%1d%02d%1d%02d%02d%02d%05d%1d", $year % 10, $week, $dow, $hour, $min, $sec, $pid, $rnd );
|
1373
|
|
|
|
|
|
|
|
1374
|
|
|
|
|
|
|
}
|
1375
|
|
|
|
|
|
|
|
1376
|
0
|
|
|
|
|
0
|
return $_ID_LDOC;
|
1377
|
|
|
|
|
|
|
}
|
1378
|
|
|
|
|
|
|
|
1379
|
|
|
|
|
|
|
|
1380
|
|
|
|
|
|
|
{
|
1381
|
|
|
|
|
|
|
my $_app_typ_trt; # type de traitement de lotissement,
|
1382
|
|
|
|
|
|
|
# valeur accessible uniquement par la méthode _app_typ_trt
|
1383
|
|
|
|
|
|
|
|
1384
|
|
|
|
|
|
|
sub _app_typ_trt (;$){
|
1385
|
|
|
|
|
|
|
# désignation du type de traitement de lotissement (Output Management)
|
1386
|
|
|
|
|
|
|
# si la fonction est appelée avec un paramètre on l'attribue à $_app_typ_trt
|
1387
|
|
|
|
|
|
|
# si la fonction est appelée seule, on renvoie juste la valeur normée
|
1388
|
|
|
|
|
|
|
# par defaut la valeur est 'U' pour 'undef'
|
1389
|
|
|
|
|
|
|
# ON NE PEUT PAS CHANGER DE VALEUR EN COURS DE TRAITEMENT, SAUF pour passer en Test ou Debug
|
1390
|
|
|
|
|
|
|
# valeurs possibles :
|
1391
|
|
|
|
|
|
|
# - 'M' -> traitement de Masse avec lotissement
|
1392
|
|
|
|
|
|
|
# - 'G' -> traitement de reGroupement, lotissement en attente
|
1393
|
|
|
|
|
|
|
# - 'L' -> traitement édition Locale sans lotissement
|
1394
|
|
|
|
|
|
|
# - 'H' -> traitement homologation sans lotissement
|
1395
|
|
|
|
|
|
|
# - 'T' -> traitement test/homologation, lotissement en test possible
|
1396
|
|
|
|
|
|
|
# - 'D' -> mode Debug, conservation des fichiers intermédiaires
|
1397
|
|
|
|
|
|
|
# - 'U' -> 'undef' traitement sans lotissement
|
1398
|
|
|
|
|
|
|
|
1399
|
|
|
|
|
|
|
# Gestion des types d'éxécution (Mass/Grouped/Local/Homol/Test/Debug/Undef) en 3 groupes :
|
1400
|
|
|
|
|
|
|
# - MTD -> font du Lotissement
|
1401
|
|
|
|
|
|
|
# - G -> lotissement en attente
|
1402
|
|
|
|
|
|
|
# - LHU -> ne font pas de lotissement
|
1403
|
|
|
|
|
|
|
# - D -> ne supprime pas les fichiers intermédiaires
|
1404
|
|
|
|
|
|
|
# - U -> mode par défaut
|
1405
|
|
|
|
|
|
|
# - H -> mode associé à l'extension 'Homologation' (-V2)
|
1406
|
|
|
|
|
|
|
|
1407
|
|
|
|
|
|
|
|
1408
|
|
|
|
|
|
|
# Nouvelle gestion d'exécution à partir de EDTK_TYPE_ENV :
|
1409
|
|
|
|
|
|
|
# EDTK_TYPE_ENV = Production -> cleanup, si mode indexé : détermination des trt à partir de EDTK_REFIDDOC
|
1410
|
|
|
|
|
|
|
# EDTK_TYPE_ENV = Integration -> cleanup, bandeau, si mode indexé : détermination des trt à partir de EDTK_REFIDDOC
|
1411
|
|
|
|
|
|
|
# EDTK_TYPE_ENV = Test -> bandeau, si mode indexé : détermination des trt à partir de EDTK_REFIDDOC
|
1412
|
|
|
|
|
|
|
# EDTK_TYPE_ENV = Development -> cleanup, bandeau, traitement 'court'
|
1413
|
|
|
|
|
|
|
|
1414
|
0
|
|
0
|
0
|
|
0
|
my $xTypTrt = shift || '';
|
1415
|
0
|
0
|
0
|
|
|
0
|
if (defined $_app_typ_trt && $xTypTrt!~/^[TD]/i) {return $_app_typ_trt ;}
|
|
0
|
|
|
|
|
0
|
|
1416
|
|
|
|
|
|
|
# seules les types Test et Debug permettent de changer $_app_typ_trt s'il est déjà défini
|
1417
|
|
|
|
|
|
|
|
1418
|
0
|
0
|
|
|
|
0
|
if ($xTypTrt !~ /^([MGLHTDU])/i){
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1419
|
0
|
|
|
|
|
0
|
$_app_typ_trt='U';
|
1420
|
|
|
|
|
|
|
|
1421
|
|
|
|
|
|
|
} elsif ($xTypTrt =~ /^([MGL])/i) {
|
1422
|
0
|
|
|
|
|
0
|
$_app_typ_trt=$1;
|
1423
|
|
|
|
|
|
|
|
1424
|
|
|
|
|
|
|
} elsif ($xTypTrt =~ /^([HTD])/i) {
|
1425
|
0
|
|
|
|
|
0
|
$_app_typ_trt=$1;
|
1426
|
|
|
|
|
|
|
}
|
1427
|
|
|
|
|
|
|
|
1428
|
0
|
|
|
|
|
0
|
warn "INFO : type de traitement OM = $_app_typ_trt (Mass/Grouped/Local/Homol/Test/Debug/Undef)\n";
|
1429
|
0
|
|
|
|
|
0
|
return $_app_typ_trt;
|
1430
|
|
|
|
|
|
|
}
|
1431
|
|
|
|
|
|
|
}
|
1432
|
|
|
|
|
|
|
|
1433
|
|
|
|
|
|
|
{
|
1434
|
|
|
|
|
|
|
my $_DOCLIB; # DESIGNATION DE LA DCLIB pour le lotissement
|
1435
|
|
|
|
|
|
|
# valeur accessible uniquement par la méthode _omngr_doclib
|
1436
|
|
|
|
|
|
|
|
1437
|
|
|
|
|
|
|
sub _omngr_doclib (;$$){
|
1438
|
0
|
0
|
|
0
|
|
0
|
if (defined $_DOCLIB) { return $_DOCLIB ; }
|
|
0
|
|
|
|
|
0
|
|
1439
|
|
|
|
|
|
|
|
1440
|
0
|
|
|
|
|
0
|
my $doclib =shift;
|
1441
|
0
|
0
|
|
|
|
0
|
if (!defined $doclib){
|
1442
|
0
|
|
|
|
|
0
|
my $cfg = config_read('ENVDESC');
|
1443
|
0
|
|
0
|
|
|
0
|
my $ext =shift || $cfg->{'EDTK_EXT_DEFAULT'};
|
1444
|
0
|
|
|
|
|
0
|
$_DOCLIB = "DCLIB_" . oe_ID_LDOC() . "." . $ext;
|
1445
|
|
|
|
|
|
|
#$_DOCLIB =~ s/\./_/;
|
1446
|
|
|
|
|
|
|
} else {
|
1447
|
0
|
|
|
|
|
0
|
$_DOCLIB=$doclib;
|
1448
|
|
|
|
|
|
|
}
|
1449
|
|
|
|
|
|
|
|
1450
|
0
|
|
|
|
|
0
|
return $_DOCLIB;
|
1451
|
|
|
|
|
|
|
}
|
1452
|
|
|
|
|
|
|
}
|
1453
|
|
|
|
|
|
|
|
1454
|
|
|
|
|
|
|
|
1455
|
|
|
|
|
|
|
#sub user_corp_file_prefixe($;$){
|
1456
|
|
|
|
|
|
|
# my($filename, $directories, $suffix) = fileparse(shift);
|
1457
|
|
|
|
|
|
|
# my $sep = shift || '.';
|
1458
|
|
|
|
|
|
|
# my @prefix = split (/$sep/, $filename);
|
1459
|
|
|
|
|
|
|
# oe_corporation_set ($prefix[0]);
|
1460
|
|
|
|
|
|
|
# # warn "$filename \$prefix[0] $prefix[0] -> ". oe_corporation_set()."\n";
|
1461
|
|
|
|
|
|
|
#1;
|
1462
|
|
|
|
|
|
|
#}
|
1463
|
|
|
|
|
|
|
|
1464
|
|
|
|
|
|
|
sub oe_corporation_tag() {
|
1465
|
0
|
|
|
0
|
0
|
0
|
return (sprintf ("x%.7s", oe_corporation_set()) );
|
1466
|
|
|
|
|
|
|
}
|
1467
|
|
|
|
|
|
|
|
1468
|
|
|
|
|
|
|
|
1469
|
|
|
|
|
|
|
my $_xCORPOR;
|
1470
|
|
|
|
|
|
|
my $_DICT;
|
1471
|
|
|
|
|
|
|
|
1472
|
|
|
|
|
|
|
sub oe_corporation_get() {
|
1473
|
0
|
|
|
0
|
0
|
0
|
return $_xCORPOR;
|
1474
|
|
|
|
|
|
|
}
|
1475
|
|
|
|
|
|
|
|
1476
|
|
|
|
|
|
|
sub oe_corporation_set(;$){
|
1477
|
|
|
|
|
|
|
# UTILISATION DICTIONNAIRE :
|
1478
|
|
|
|
|
|
|
# - si paramètre connu dans le dictionnaire => valeur du dictionnaire
|
1479
|
|
|
|
|
|
|
# - si paramètre inconnu dans le paramètre => valeur par défaut (edtk.ini / EDTK_CORP)
|
1480
|
|
|
|
|
|
|
# - si aucun paramètre => dernière valeur connue
|
1481
|
0
|
|
|
0
|
0
|
0
|
my $parametre = shift;
|
1482
|
|
|
|
|
|
|
|
1483
|
0
|
0
|
|
|
|
0
|
if (!defined($_DICT)) {
|
1484
|
0
|
|
|
|
|
0
|
my $cfg =config_read();
|
1485
|
0
|
|
|
|
|
0
|
$_xCORPOR = $cfg->{'EDTK_CORP'}; # Valeur par défaut
|
1486
|
0
|
|
|
|
|
0
|
$_DICT = oEdtk::Dict->new($cfg->{'EDTK_DICO'}, { invert => 1 });
|
1487
|
|
|
|
|
|
|
}
|
1488
|
|
|
|
|
|
|
|
1489
|
0
|
|
|
|
|
0
|
my $entity;
|
1490
|
0
|
0
|
|
|
|
0
|
if (defined($parametre)) {
|
1491
|
0
|
|
|
|
|
0
|
$entity = $parametre;
|
1492
|
|
|
|
|
|
|
} else {
|
1493
|
0
|
|
|
|
|
0
|
$entity = $_xCORPOR;
|
1494
|
|
|
|
|
|
|
}
|
1495
|
|
|
|
|
|
|
|
1496
|
0
|
|
|
|
|
0
|
$entity = $_DICT->translate($entity, 1);
|
1497
|
|
|
|
|
|
|
|
1498
|
0
|
0
|
|
|
|
0
|
if (defined ($entity)) {
|
1499
|
|
|
|
|
|
|
# si la valeur a été trouvée dans le dictionnaire
|
1500
|
0
|
|
|
|
|
0
|
$_xCORPOR = $entity;
|
1501
|
|
|
|
|
|
|
}
|
1502
|
|
|
|
|
|
|
|
1503
|
|
|
|
|
|
|
# warn "\$entity $entity \$_xCORPOR $_xCORPOR\n";
|
1504
|
0
|
|
|
|
|
0
|
return $_xCORPOR;
|
1505
|
|
|
|
|
|
|
}
|
1506
|
|
|
|
|
|
|
|
1507
|
|
|
|
|
|
|
|
1508
|
|
|
|
|
|
|
|
1509
|
|
|
|
|
|
|
{ # en cours pas encore opérationnel (récup du générateur)
|
1510
|
|
|
|
|
|
|
my $cpt_sub_call =0; # variable constante propre a la fonction
|
1511
|
|
|
|
|
|
|
my %hListeId;
|
1512
|
|
|
|
|
|
|
|
1513
|
|
|
|
|
|
|
sub oe_unique_data_name ($$;$) {
|
1514
|
|
|
|
|
|
|
# definition d'un identifiant unique sur n caracteres
|
1515
|
|
|
|
|
|
|
# les 6 premiers caracteres de la clef transmises sont extraits
|
1516
|
|
|
|
|
|
|
# si l'id est deja connu, on prend les 4 premiers et on ajoute un compteur sur 3 (correspond a la séquence des appels)
|
1517
|
|
|
|
|
|
|
# s'il est n'est toujours pas unique, on prend les 3 premiers caracteres et on complète le compteur sur 3 par un caractere
|
1518
|
|
|
|
|
|
|
# recoit : - le nombre de caractères total à retourner
|
1519
|
|
|
|
|
|
|
# - un identifiant
|
1520
|
|
|
|
|
|
|
# - optionnel : une reference a une valeur de compteur (3 numerique)
|
1521
|
|
|
|
|
|
|
|
1522
|
0
|
|
|
0
|
0
|
0
|
my ($nb_car, $id, $cpt_value) =@_;
|
1523
|
0
|
0
|
|
|
|
0
|
if ($nb_car lt 6) { $nb_car = 6 ; }
|
|
0
|
|
|
|
|
0
|
|
1524
|
|
|
|
|
|
|
|
1525
|
0
|
0
|
|
|
|
0
|
if ($cpt_value) {$cpt_sub_call=$cpt_value} else {$cpt_sub_call++};
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1526
|
|
|
|
|
|
|
|
1527
|
0
|
|
|
|
|
0
|
my $debut = $nb_car-2;
|
1528
|
0
|
|
|
|
|
0
|
my $motif ="%-" . $debut . "." . $debut . "s%0.2d"; # "%-4.4s%0.2d"
|
1529
|
0
|
|
|
|
|
0
|
warn "$motif / $id\n";
|
1530
|
0
|
|
|
|
|
0
|
$id =sprintf ("$motif", $id);
|
1531
|
0
|
|
|
|
|
0
|
$id =~s/\s/x/g;
|
1532
|
|
|
|
|
|
|
|
1533
|
0
|
0
|
|
|
|
0
|
if (exists ($hListeId{$id})){
|
1534
|
0
|
|
|
|
|
0
|
$debut = $nb_car-3;
|
1535
|
0
|
|
|
|
|
0
|
$motif ="%-" . $debut . "." . $debut . "s%0.3d"; # "%-3.3s%0.3d"
|
1536
|
0
|
|
|
|
|
0
|
$id =sprintf ($motif ,$id, $cpt_sub_call);
|
1537
|
|
|
|
|
|
|
|
1538
|
0
|
|
|
|
|
0
|
my $cpt =97; # pour le caractere "a"
|
1539
|
0
|
|
|
|
|
0
|
while (exists ($hListeId{$id})) {
|
1540
|
0
|
|
|
|
|
0
|
$debut = $nb_car-4;
|
1541
|
0
|
|
|
|
|
0
|
$motif ="%-" . $debut . "." . $debut . "s%0.3d"; # "%-3.3s%0.3d"
|
1542
|
0
|
|
|
|
|
0
|
$id =sprintf ($motif, $id, $cpt_sub_call, chr($cpt++));
|
1543
|
0
|
0
|
|
|
|
0
|
die "ERROR: impossible de creer une clef unique" if ($cpt >= 123);
|
1544
|
|
|
|
|
|
|
|
1545
|
|
|
|
|
|
|
# use Log::Log4perl;
|
1546
|
|
|
|
|
|
|
# Log::Log4perl->init("log.conf"); => read log.conf
|
1547
|
|
|
|
|
|
|
# $logger = Log::Log4perl->get_logger("");
|
1548
|
|
|
|
|
|
|
# $logger->logdie("impossible de creer une clef unique") if ($cpt >= 123);
|
1549
|
|
|
|
|
|
|
# $logger->trace("..."); # Log a trace message
|
1550
|
|
|
|
|
|
|
# $logger->debug("..."); # Log a debug message
|
1551
|
|
|
|
|
|
|
# $logger->info("..."); # Log a info message
|
1552
|
|
|
|
|
|
|
# $logger->warn("..."); # Log a warn message / $logger->error_warn("..."); (comprend l'appel à warn() )
|
1553
|
|
|
|
|
|
|
# $logger->error("..."); # Log a error message / $logger->logdie ("..."); (comprend l'appel à die() )
|
1554
|
|
|
|
|
|
|
# $logger->fatal("..."); # Log a fatal message
|
1555
|
|
|
|
|
|
|
}
|
1556
|
|
|
|
|
|
|
}
|
1557
|
0
|
|
|
|
|
0
|
$hListeId{$id}=1;
|
1558
|
0
|
|
|
|
|
0
|
return $id;
|
1559
|
|
|
|
|
|
|
}
|
1560
|
|
|
|
|
|
|
}
|
1561
|
|
|
|
|
|
|
|
1562
|
|
|
|
|
|
|
{
|
1563
|
|
|
|
|
|
|
my $_backup_date ;
|
1564
|
|
|
|
|
|
|
|
1565
|
|
|
|
|
|
|
sub oe_set_sys_date($) {
|
1566
|
0
|
|
|
0
|
0
|
0
|
my $requested_date = shift;
|
1567
|
|
|
|
|
|
|
|
1568
|
0
|
|
|
|
|
0
|
my $time = time;
|
1569
|
0
|
|
|
|
|
0
|
my ($year,$month,$day, $hour,$min,$sec, $doy,$dow,$dst) =
|
1570
|
|
|
|
|
|
|
Gmtime($time);
|
1571
|
|
|
|
|
|
|
|
1572
|
0
|
|
|
|
|
0
|
my $commande = sprintf ("date %s", $requested_date);
|
1573
|
0
|
|
|
|
|
0
|
warn "INFO : $commande\n";
|
1574
|
|
|
|
|
|
|
|
1575
|
0
|
|
|
|
|
0
|
eval {
|
1576
|
0
|
|
|
|
|
0
|
system($commande);
|
1577
|
|
|
|
|
|
|
};
|
1578
|
|
|
|
|
|
|
|
1579
|
|
|
|
|
|
|
# if ($?){
|
1580
|
0
|
0
|
|
|
|
0
|
if ($@){
|
1581
|
0
|
|
|
|
|
0
|
warn "ERROR: echec commande $commande : $@\n";
|
1582
|
0
|
|
|
|
|
0
|
return -1;
|
1583
|
|
|
|
|
|
|
}
|
1584
|
|
|
|
|
|
|
|
1585
|
0
|
0
|
|
|
|
0
|
if (!defined $_backup_date) {
|
1586
|
0
|
|
|
|
|
0
|
$_backup_date = sprintf ("%02s-%02s-%02s", $day, $month, $year);
|
1587
|
|
|
|
|
|
|
}
|
1588
|
0
|
|
|
|
|
0
|
return $_backup_date;
|
1589
|
|
|
|
|
|
|
}
|
1590
|
|
|
|
|
|
|
|
1591
|
|
|
|
|
|
|
sub _restore_sys_date {
|
1592
|
1
|
50
|
|
1
|
|
4
|
oe_set_sys_date($_backup_date) if (defined $_backup_date);
|
1593
|
1
|
|
|
|
|
7
|
1;
|
1594
|
|
|
|
|
|
|
}
|
1595
|
|
|
|
|
|
|
}
|
1596
|
|
|
|
|
|
|
|
1597
|
|
|
|
|
|
|
|
1598
|
|
|
|
|
|
|
END {
|
1599
|
1
|
|
|
1
|
|
5
|
_restore_sys_date;
|
1600
|
|
|
|
|
|
|
# return "(c) 2005-2012 daunay\@cpan.org - edtk\@free.fr - oEdtk v$VERSION\n";
|
1601
|
|
|
|
|
|
|
}
|
1602
|
|
|
|
|
|
|
|
1603
|
|
|
|
|
|
|
1;
|