1 |
<?php |
<?php |
2 |
/** |
/** |
3 |
* Script personnalisé pour les consultations multiples. |
* Script personnalisé pour les consultations multiples. |
4 |
* |
* |
5 |
* @package openfoncier |
* @package openfoncier |
6 |
* @version SVN : $Id$ |
* @version SVN : $Id$ |
7 |
*/ |
*/ |
8 |
|
|
9 |
|
// |
10 |
|
require_once "../obj/utils.class.php"; |
11 |
|
$f = new utils("nohtml"); |
12 |
|
|
|
require_once "../obj/utils.class.php"; |
|
|
|
|
13 |
// Identifiant de l'objet metier a copier |
// Identifiant de l'objet metier a copier |
14 |
(isset($_GET['idx']) ? $idx = $_GET['idx'] : $idx = ""); |
($f->get_submitted_get_value('idx') !== null ? $idx = $f->get_submitted_get_value('idx') : $idx = ""); |
15 |
// Nom de l'objet metier |
// Nom de l'objet metier |
16 |
(isset($_GET['obj']) ? $obj = $_GET['obj'] : $obj = ""); |
($f->get_submitted_get_value('obj') !== null ? $obj = $f->get_submitted_get_value('obj') : $obj = ""); |
17 |
//formulaire retour |
//formulaire retour |
18 |
(isset($_GET['ret']) ? $retourformulaire = $_GET['ret'] : $retourformulaire = ""); |
($f->get_submitted_get_value('ret') !== null ? $retourformulaire = $f->get_submitted_get_value('ret') : $retourformulaire = ""); |
19 |
(isset($_GET['date_envoi']) ? $date_envoi = $_GET['date_envoi'] : $date_envoi = ""); |
($f->get_submitted_get_value('date_envoi') !== null ? $date_envoi = $f->get_submitted_get_value('date_envoi') : $date_envoi = ""); |
20 |
|
|
|
$f = new utils("nohtml"); |
|
|
|
|
21 |
$liste_gauche = ""; |
$liste_gauche = ""; |
22 |
|
|
23 |
if ( isset($_GET) && isset($_GET['data']) && !empty($_GET['data']) ){ |
if (count($f->get_submitted_get_value()) > 0 |
24 |
|
&& $f->get_submitted_get_value('data') !== null |
25 |
|
&& $f->get_submitted_get_value('data') != "" ) { |
26 |
$f->disableLog(); |
$f->disableLog(); |
27 |
/*Récupération des données et formatage.*/ |
/*Récupération des données et formatage.*/ |
28 |
$donnees_temp = explode(';', $_GET['data']); |
$donnees_temp = explode(';', $f->get_submitted_get_value('data')); |
29 |
for ( $i = 1 ; $i < count($donnees_temp) ; $i++ ) |
for ( $i = 1 ; $i < count($donnees_temp) ; $i++ ) |
30 |
$donnees[] = explode('_', $donnees_temp[$i]); |
$donnees[] = explode('_', $donnees_temp[$i]); |
31 |
|
|
38 |
* */ |
* */ |
39 |
if ( isset($donnees) && count($donnees) > 0 ){ |
if ( isset($donnees) && count($donnees) > 0 ){ |
40 |
|
|
|
require_once "../core/om_dbform.class.php"; |
|
|
$om_dbform = new dbForm(); |
|
41 |
require_once "../obj/consultation.class.php"; |
require_once "../obj/consultation.class.php"; |
42 |
$consultation = new consultation("]",$f->db,DEBUG); |
$consultation = new consultation("]",$f->db,DEBUG); |
43 |
|
|
44 |
foreach ($donnees as $value) { |
foreach ($donnees as $value) { |
45 |
|
|
46 |
$sql = "SELECT delai FROM service WHERE service = $value[0]"; |
$sql = "SELECT delai, id |
47 |
|
FROM ".DB_PREFIXE."service |
48 |
|
LEFT JOIN ".DB_PREFIXE."om_etat |
49 |
|
ON service.edition = om_etat.om_etat |
50 |
|
WHERE service = $value[0]"; |
51 |
$res = $f->db->query($sql); |
$res = $f->db->query($sql); |
52 |
$f->isDatabaseError($res); |
$f->isDatabaseError($res); |
53 |
$row=& $res->fetchRow(); |
$row=& $res->fetchRow(); |
54 |
$delai = $row[0]; |
$delai = $row[0]; |
55 |
|
$type_edition = $row[1]; |
56 |
|
|
57 |
/*Calcul du delai de retour*/ |
/*Calcul du delai de retour*/ |
58 |
$date_envoi_temp = $om_dbform->datePHP($date_envoi); |
$date_envoi_temp = $consultation->datePHP($date_envoi); |
59 |
$delai = $om_dbform->dateDB($consultation->moisdate($date_envoi_temp, $delai)); |
$delai = $consultation->dateDB($f->mois_date($date_envoi_temp, $delai)); |
60 |
|
|
61 |
/*Les données à ajouter*/ |
/*Les données à ajouter*/ |
62 |
$arrayVal = array( |
$arrayVal = array( |
70 |
'date_reception' => NULL, |
'date_reception' => NULL, |
71 |
'motivation' => "", |
'motivation' => "", |
72 |
'fichier' => NULL, |
'fichier' => NULL, |
73 |
'lu' => TRUE |
'lu' => TRUE, |
74 |
|
'code_barres' => NULL, |
75 |
|
'om_final_consultation' => FALSE, |
76 |
|
'om_fichier_consultation' => "", |
77 |
|
'marque' => false, |
78 |
); |
); |
79 |
|
|
80 |
$consultation->ajouter($arrayVal, $f->db, DEBUG); |
$consultation->ajouter($arrayVal, $f->db, DEBUG); |
81 |
|
|
82 |
/*Comptage du nombre de consultations papier demandées et récupération des ids des PDFs à éditer*/ |
/*Comptage du nombre de consultations papier demandées et récupération des ids des PDFs à éditer*/ |
83 |
if ($value[1]==1){ |
if ($value[1]==1){ |
84 |
$idxConsultations[] = $consultation->valF['consultation']; |
$idxConsultations[] = $consultation->valF['consultation']; |
85 |
|
$objConsultations[] = $type_edition; |
86 |
$nbConsPap++; |
$nbConsPap++; |
87 |
} |
} |
88 |
} |
} |
90 |
/*Génération du PDF*/ |
/*Génération du PDF*/ |
91 |
if ( isset($idxConsultations) && count($idxConsultations) > 0 ){ |
if ( isset($idxConsultations) && count($idxConsultations) > 0 ){ |
92 |
|
|
93 |
$textIdsConsultations = ""; |
$textIdsConsultations = "idx="; |
94 |
foreach ($idxConsultations as $value) |
foreach ($idxConsultations as $value) { |
95 |
$textIdsConsultations .= "&idxConsultations[]=$value"; |
$textIdsConsultations .= $value.";"; |
96 |
|
} |
97 |
|
$textObjConsultations = "obj="; |
98 |
|
foreach ($objConsultations as $value) { |
99 |
|
$textObjConsultations .= $value.";"; |
100 |
|
} |
101 |
echo " |
echo " |
102 |
<script language='javascript' type='text/javascript'> |
<script language='javascript' type='text/javascript'> |
103 |
$.download('../app/pdfetat.php','obj=$obj$textIdsConsultations', 'POST', $obj); |
window.open('../pdf/pdfetat.php?output=inline&".$textObjConsultations."&".$textIdsConsultations."','_blank') |
104 |
</script> |
</script> |
105 |
"; |
"; |
106 |
} |
} |
116 |
ser_cat.service_categorie, ser_cat.libelle AS them_lib, |
ser_cat.service_categorie, ser_cat.libelle AS them_lib, |
117 |
ser.service, ser.libelle AS ser_lib, ser.consultation_papier |
ser.service, ser.libelle AS ser_lib, ser.consultation_papier |
118 |
FROM |
FROM |
119 |
public.lien_service_service_categorie lie, |
".DB_PREFIXE."lien_service_service_categorie lie, |
120 |
public.service_categorie ser_cat, |
".DB_PREFIXE."service_categorie ser_cat, |
121 |
public.service ser |
".DB_PREFIXE."service ser |
122 |
WHERE |
WHERE |
123 |
ser_cat.service_categorie = lie.service_categorie AND |
ser_cat.service_categorie = lie.service_categorie AND |
124 |
ser.service = lie.service AND |
ser.service = lie.service AND |
125 |
( |
( |
126 |
ser.om_validite_fin <= CURRENT_DATE OR |
(ser.om_validite_debut IS NULL |
127 |
ser.om_validite_fin IS NULL |
AND (ser.om_validite_fin IS NULL |
128 |
|
OR ser.om_validite_fin > CURRENT_DATE)) |
129 |
|
OR |
130 |
|
(ser.om_validite_debut <= CURRENT_DATE |
131 |
|
AND (ser.om_validite_fin IS NULL |
132 |
|
OR ser.om_validite_fin > CURRENT_DATE)) |
133 |
) |
) |
134 |
|
ORDER BY them_lib, ser_lib |
135 |
"; |
"; |
136 |
|
|
137 |
$res = $f->db->query($sql); |
$res = $f->db->query($sql); |
138 |
|
$f->addToLog("app/consultation_multiple.php: db->query(\"".$sql."\")", VERBOSE_MODE); |
139 |
$f->isDatabaseError($res); |
$f->isDatabaseError($res); |
140 |
|
|
141 |
$temp_ser_cat = 0; |
$temp_ser_cat = 0; |
142 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) { |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) { |
143 |
$name = $row['service_categorie'].'_'. |
$name = $row['service_categorie'].'_'. |
144 |
$row['service'].'_'. |
$row['service'].'_'. |
145 |
(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '0' : '1' ).'_'; |
(($row['consultation_papier'] == '' || $row['consultation_papier'] == 'f' ) ? '0' : '1' ).'_'; |
146 |
/*On change de thématique, donc rajoute le nom de la thématique*/ |
/*On change de thématique, donc rajoute le nom de la thématique*/ |
147 |
if ( $temp_ser_cat != $row['service_categorie'] ){ |
if ( $temp_ser_cat != $row['service_categorie'] ){ |
148 |
|
|
152 |
$row['them_lib']. |
$row['them_lib']. |
153 |
'</div> |
'</div> |
154 |
<div |
<div |
155 |
class="liste_gauche_service '.$name.'" |
class="liste_gauche_service t'.$name.'" |
156 |
id="'.$name.'" > |
id="t'.$name.'" > |
157 |
'.$row['ser_lib'].' |
'.$row['ser_lib'].' |
158 |
<input id="'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '' : 'checked' ).'/> |
<input class="t'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == 'f' ) ? '' : 'checked="checked"' ).'/> |
159 |
</div> |
</div> |
160 |
'; |
'; |
161 |
} |
} |
165 |
|
|
166 |
$liste_gauche .= ' |
$liste_gauche .= ' |
167 |
<div |
<div |
168 |
class="liste_gauche_service '.$name.'" |
class="liste_gauche_service t'.$name.'" |
169 |
id="'.$name.'" > |
id="t'.$name.'" > |
170 |
'.$row['ser_lib'].' |
'.$row['ser_lib'].' |
171 |
<input id="'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '' : 'checked' ).'/> |
<input class="t'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == 'f' ) ? '' : 'checked="checked"' ).'/> |
172 |
</div> |
</div> |
173 |
'; |
'; |
174 |
} |
} |
178 |
/*Requête qui récupère les services qui ne sont pas dans une thématique*/ |
/*Requête qui récupère les services qui ne sont pas dans une thématique*/ |
179 |
$sql = |
$sql = |
180 |
"SELECT service, libelle, consultation_papier |
"SELECT service, libelle, consultation_papier |
181 |
FROM public.service |
FROM ".DB_PREFIXE."service |
182 |
WHERE service NOT IN |
WHERE service NOT IN |
183 |
( |
( |
184 |
SELECT service |
SELECT service |
185 |
FROM lien_service_service_categorie |
FROM ".DB_PREFIXE."lien_service_service_categorie |
186 |
) |
) |
187 |
AND |
AND |
188 |
( |
( |
193 |
|
|
194 |
$res = $f->db->query($sql); |
$res = $f->db->query($sql); |
195 |
$f->isDatabaseError($res); |
$f->isDatabaseError($res); |
196 |
|
|
197 |
if ( $res->numrows() > 0 ) |
if ( $res->numrows() > 0 ) |
198 |
$liste_gauche .= ' |
$liste_gauche .= ' |
199 |
<div id="them_0" class="liste_gauche_them">Autres</div>'; |
<div id="them_0" class="liste_gauche_them">Autres</div>'; |
200 |
|
|
201 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) { |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) { |
202 |
|
|
203 |
/*Ajout de tous les services qui n'ont pas de thématique*/ |
/*Ajout de tous les services qui n'ont pas de thématique*/ |
204 |
$name = '0_'. |
$name = '0_'. |
205 |
$row['service'].'_'. |
$row['service'].'_'. |
206 |
(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '0' : '1' ).'_'; |
(($row['consultation_papier'] == '' || $row['consultation_papier'] == 'f' ) ? '0' : '1' ).'_'; |
207 |
$liste_gauche .= ' |
$liste_gauche .= ' |
208 |
<div |
<div |
209 |
class="liste_gauche_service '.$name.'" |
class="liste_gauche_service t'.$name.'" |
210 |
id="'.$name.'" > |
id="t'.$name.'" > |
211 |
'.$row['libelle'].' |
'.$row['libelle'].' |
212 |
<input id="'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '' : 'checked' ).'/> |
<input class="t'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == 'f' ) ? '' : 'checked="checked"' ).'/> |
213 |
</div> |
</div> |
214 |
'; |
'; |
215 |
} |
} |
217 |
/*Affichage du formulaire*/ |
/*Affichage du formulaire*/ |
218 |
echo '<div class="subtitle">'; |
echo '<div class="subtitle">'; |
219 |
echo '<h3>'; |
echo '<h3>'; |
|
echo _("Application"); |
|
220 |
echo '<span class="om-icon om-icon-16 om-icon-fix arrow-right-16"></span>'; |
echo '<span class="om-icon om-icon-16 om-icon-fix arrow-right-16"></span>'; |
221 |
echo _("consultation"); |
echo _("consultation"); |
222 |
echo '</h3>'; |
echo '</h3>'; |
225 |
echo '<form onsubmit="ajaxIt(\'consultation\', \'../app/consultation_multiple.php\');return false;" |
echo '<form onsubmit="ajaxIt(\'consultation\', \'../app/consultation_multiple.php\');return false;" |
226 |
method="get" action="" name="f2" id="form_val">'; |
method="get" action="" name="f2" id="form_val">'; |
227 |
echo '<div class="formEntete ui-corner-all">'; |
echo '<div class="formEntete ui-corner-all">'; |
228 |
echo "<div id='form-content'>"; |
echo "<div>"; |
229 |
echo '<div class="bloc">'; |
echo '<div class="bloc">'; |
230 |
echo "<fieldset class='cadre ui-corner-all ui-widget-content'>\n"; |
echo "<fieldset class='cadre ui-corner-all ui-widget-content'>\n"; |
231 |
echo "\t<legend class='ui-corner-all ui-widget-content ui-state-active'>". |
echo "\t<legend class='ui-corner-all ui-widget-content ui-state-active'>". |
239 |
echo '</label>'; |
echo '</label>'; |
240 |
echo '</div>'; |
echo '</div>'; |
241 |
echo '<div class="form-content">'; |
echo '<div class="form-content">'; |
242 |
echo '<input id="dossier" class="champFormulaire" type="hidden" value="'.$idx.'" name="dossier"/>'; |
echo '<input class="champFormulaire" type="hidden" value="'.$idx.'" name="dossier"/>'; |
243 |
echo $idx; |
echo $idx; |
244 |
echo '</div>'; |
echo '</div>'; |
245 |
echo '</div>'; |
echo '</div>'; |
259 |
echo '</ul>'; |
echo '</ul>'; |
260 |
echo '</div>'; |
echo '</div>'; |
261 |
echo '<div class="list-sel-ser-them">'; |
echo '<div class="list-sel-ser-them">'; |
262 |
echo '<div class=\'row\'>'; |
echo '<div class=\'row row_title\'>'; |
263 |
echo '<div class=\'cell1 liste_gauche_them\' id=\'list-sel-ser-them-title\'>'._('Service a consulter').'</div>'; |
echo '<div class=\'cell1 liste_droite_title list-sel-ser-them-title\'>'._('Service a consulter').'</div>'; |
264 |
echo '<div class=\'cell2 liste_gauche_them\' id=\'list-sel-ser-them-title\'>'._('Version papier').'</div>'; |
echo '<div class=\'cell2 liste_droite_title list-sel-ser-them-title\'>'._('Version papier').'</div>'; |
265 |
echo '</div>'; |
echo '</div>'; |
266 |
echo '</div>'; |
echo '</div>'; |
267 |
echo '</div>'; |
echo '</div>'; |
289 |
echo '<input class="om-button ui-button ui-widget ui-state-default ui-corner-all" |
echo '<input class="om-button ui-button ui-widget ui-state-default ui-corner-all" |
290 |
type="button" onclick="if ( $(\'.liste_gauche_service_selected\').length > 0 && $(\'#date_envoi\').val() != \'\' ) { ajaxIt(\'consultation\', \'../app/consultation_multiple.php\'); } else alert(\'Veuillez choisir au moins un service et une date d envoi\');" |
type="button" onclick="if ( $(\'.liste_gauche_service_selected\').length > 0 && $(\'#date_envoi\').val() != \'\' ) { ajaxIt(\'consultation\', \'../app/consultation_multiple.php\'); } else alert(\'Veuillez choisir au moins un service et une date d envoi\');" |
291 |
value="Ajouter le(s) enregistrement(s) de la table : \'Consultation\'" |
value="Ajouter le(s) enregistrement(s) de la table : \'Consultation\'" |
292 |
role="button" aria-disabled="false" id="button_val">'; |
id="button_val">'; |
293 |
echo '<a class="retour" onclick="ajaxIt(\'consultation\', \'../scr/soustab.php?obj='.$obj.'&retourformulaire='.$retourformulaire.'&idxformulaire='.$idx.'&premier=0&tricol=\');" |
echo '<a class="retour" onclick="ajaxIt(\'consultation\', \'../scr/soustab.php?obj='.$obj.'&retourformulaire='.$retourformulaire.'&idxformulaire='.$idx.'&premier=0&tricol=\');" |
294 |
href="#">'; |
href="#">'; |
295 |
echo 'Retour'; |
echo 'Retour'; |
301 |
echo " |
echo " |
302 |
<script language='javascript' type='text/javascript'> |
<script language='javascript' type='text/javascript'> |
303 |
$(function(){ |
$(function(){ |
304 |
|
|
305 |
/* |
/* |
306 |
Sélectionne tous les services d'un thème au clique sur celui ci. |
Sélectionne tous les services d'un thème au clique sur celui ci. |
307 |
*/ |
*/ |
316 |
function() { |
function() { |
317 |
|
|
318 |
if ( $(this).attr('id').indexOf('them') == -1 && |
if ( $(this).attr('id').indexOf('them') == -1 && |
319 |
$(this).attr('id').indexOf(id) == 0 && |
$(this).attr('id').indexOf(id) == 1 && |
320 |
$(this).hasClass('liste_gauche_service_selected') ) |
$(this).hasClass('liste_gauche_service_selected') ) |
321 |
|
|
322 |
numSerWithClass++; |
numSerWithClass++; |
323 |
|
|
324 |
if ( $(this).attr('id').indexOf('them') == -1 && |
if ( $(this).attr('id').indexOf('them') == -1 && |
325 |
$(this).attr('id').indexOf(id) == 0 ) |
$(this).attr('id').indexOf(id) == 1 ) |
326 |
|
|
327 |
numSer++; |
numSer++; |
328 |
} |
} |
334 |
function() { |
function() { |
335 |
|
|
336 |
if ( $(this).attr('id').indexOf('them') == -1 && |
if ( $(this).attr('id').indexOf('them') == -1 && |
337 |
$(this).attr('id').indexOf(id) == 0 && |
$(this).attr('id').indexOf(id) == 1 && |
338 |
!$(this).hasClass('liste_gauche_service_selected') ) |
!$(this).hasClass('liste_gauche_service_selected') ) |
339 |
|
|
340 |
$(this).addClass('liste_gauche_service_selected'); |
$(this).addClass('liste_gauche_service_selected'); |
348 |
function() { |
function() { |
349 |
|
|
350 |
if ( $(this).attr('id').indexOf('them') == -1 && |
if ( $(this).attr('id').indexOf('them') == -1 && |
351 |
$(this).attr('id').indexOf(id) == 0 && |
$(this).attr('id').indexOf(id) == 1 && |
352 |
$(this).hasClass('liste_gauche_service_selected') ) |
$(this).hasClass('liste_gauche_service_selected') ) |
353 |
|
|
354 |
$(this).removeClass('liste_gauche_service_selected'); |
$(this).removeClass('liste_gauche_service_selected'); |
374 |
'click', |
'click', |
375 |
'.cell1', |
'.cell1', |
376 |
function(){ |
function(){ |
377 |
$(this).parent().toggleClass('liste_droite_service_selected'); |
if ( !$(this).hasClass('liste_droite_title') ) |
378 |
|
$(this).parent().toggleClass('liste_droite_service_selected'); |
379 |
} |
} |
380 |
); |
); |
381 |
|
|
384 |
'input[type=checkbox]', |
'input[type=checkbox]', |
385 |
function(){ |
function(){ |
386 |
|
|
387 |
old_id = $(this).attr('id'); |
old_id = $(this).attr('class'); |
388 |
|
|
389 |
tab_don = old_id.split('_'); |
tab_don = old_id.split('_'); |
390 |
|
|
391 |
new_id = tab_don[0] + '_' + tab_don[1] + '_' + ((tab_don[2] == 0 ) ? 1 : 0 ) + '_'; |
new_id = tab_don[0] + '_' + tab_don[1] + '_' + ((tab_don[2] == 0 ) ? 1 : 0 ) + '_'; |
392 |
|
|
393 |
changeOneData( ';' + tab_don[1] + '_' + tab_don[2], ';' + tab_don[1] + '_' + ((tab_don[2] == 0) ? 1 : 0) ); |
changeOneData( ';' + tab_don[1] + '_' + tab_don[2], ';' + tab_don[1] + '_' + ((tab_don[2] == 0) ? 1 : 0) ); |
394 |
$('div[name=\"' + $(this).attr('class') + '\"]').attr('id', new_id); |
$('div[class=\"' + old_id + '\"]').attr('class', new_id); |
395 |
$(this).attr('id', new_id); |
$(this).attr('class', new_id); |
396 |
|
|
397 |
} |
} |
398 |
); |
); |
406 |
$('.liste_gauche_service_selected').each( |
$('.liste_gauche_service_selected').each( |
407 |
function(i) { |
function(i) { |
408 |
|
|
409 |
var id = $(this).attr('id'); |
var name = $(this).attr('name'); |
410 |
|
|
411 |
if ( listServ.length > 0 && listServ.indexOf(id.split('_')[1]) != -1 ) |
if ( listServ.length > 0 && listServ.indexOf(name.split('_')[1]) != -1 ) |
412 |
return; |
return; |
413 |
listServ[i] = id.split('_')[1]; |
listServ[i] = name.split('_')[1]; |
414 |
data += ';' + id.split('_')[1] + '_' + id.split('_')[2] ; |
data += ';' + name.split('_')[1] + '_' + name.split('_')[2] ; |
415 |
|
|
416 |
} |
} |
417 |
); |
); |
438 |
|
|
439 |
var data = ''; |
var data = ''; |
440 |
|
|
441 |
|
//Supprime les éléments de la liste de droite |
442 |
$('.liste_droite_service_selected').each( |
$('.liste_droite_service_selected').each( |
443 |
function() { |
function() { |
444 |
|
|
445 |
|
var name = $('#'+ $(this).attr('id') + ' .cell1 div').attr('name'); |
446 |
|
|
447 |
var id = $('#'+ $(this).attr('id') + ' .cell1 div').attr('id'); |
manageListServ('.list-ser-them div', name, 1); |
|
|
|
|
manageListServ('.list-ser-them div', id, 1); |
|
|
data += ';' + id.split('_')[1] + '_' + id.split('_')[2] ; |
|
448 |
|
|
449 |
$(this).remove(); |
$(this).remove(); |
450 |
} |
} |
451 |
); |
); |
452 |
|
|
453 |
|
//Change les valeurs qui vont être renvoyées à la validation du formulaire |
454 |
|
$('.liste_droite_service').each( |
455 |
|
function(){ |
456 |
|
|
457 |
|
var name = $('#'+ $(this).attr('id') + ' .cell1 div').attr('name'); |
458 |
|
data += ';' + name.split('_')[1] + '_' + name.split('_')[2] ; |
459 |
|
} |
460 |
|
); |
461 |
|
|
462 |
changeActionVal(data); |
changeActionVal(data); |
463 |
} |
} |
464 |
); |
); |
475 |
/* |
/* |
476 |
Affiche ou cache un élément qui n'est pas une thématique et dont son identifiant correspond. |
Affiche ou cache un élément qui n'est pas une thématique et dont son identifiant correspond. |
477 |
*/ |
*/ |
478 |
function manageListServ( objet ,id, type){ |
function manageListServ( objet , name, type){ |
479 |
|
|
480 |
$(objet).each( |
$(objet).each( |
481 |
function() { |
function() { |
482 |
|
|
483 |
if ( isNotthemIsOneServ(this, id) ){ |
if ( isNotthemIsOneServ(this, name) ){ |
484 |
if ( type == 0 ) |
if ( type == 0 ) |
485 |
|
|
486 |
$(this).hide() ; |
$(this).hide() ; |
538 |
|
|
539 |
function changeDataLeftColumn(){ |
function changeDataLeftColumn(){ |
540 |
|
|
541 |
|
$('.list-sel-ser-them').empty(); |
542 |
|
$('.list-sel-ser-them').html( |
543 |
|
'<div class=\"row row_title\">' + |
544 |
|
'<div class=\"cell1 liste_droite_title list-sel-ser-them-title\">"._("Service a consulter")."</div>' + |
545 |
|
'<div class=\"cell2 liste_droite_title list-sel-ser-them-title\">"._("Version papier")."</div>' + |
546 |
|
'</div>' |
547 |
|
); |
548 |
|
|
549 |
var listServ = new Array(); |
var listServ = new Array(); |
550 |
var data = ''; |
var data = ''; |
551 |
|
|
|
if ( $('.liste_droite_service').length == 0 ){ |
|
|
$('.list-sel-ser-them').empty(); |
|
|
$('.list-sel-ser-them').append(''+ |
|
|
'<div class=\'row\'>'+ |
|
|
'<div class=\'cell1 liste_gauche_them\' id=\'list-sel-ser-them-title\'>"._('Service a consulter')."</div>'+ |
|
|
'<div class=\'cell2 liste_gauche_them\' id=\'list-sel-ser-them-title\'>"._('Version papier')."</div>'+ |
|
|
'</div>') ; |
|
|
} |
|
|
|
|
552 |
$('.liste_gauche_service_selected').each( |
$('.liste_gauche_service_selected').each( |
553 |
function(i) { |
function(i) { |
554 |
|
|
|
if ( !$(this).is(':visible') ) |
|
|
return; |
|
|
|
|
555 |
var id = $(this).attr('id'); |
var id = $(this).attr('id'); |
556 |
|
|
557 |
if ( listServ.length > 0 && listServ.indexOf(id.split('_')[1]) != -1 ) |
if ( $.inArray(id.split('_')[1], listServ) != -1 ) |
558 |
return; |
return; |
559 |
listServ[i] = id.split('_')[1]; |
|
560 |
data += ';' + id.split('_')[1] + '_' + id.split('_')[2] ; |
data += ';' + id.split('_')[1] + '_' + id.split('_')[2] ; |
561 |
|
listServ[i] = id.split('_')[1]; |
562 |
|
|
563 |
$('.list-sel-ser-them').append( |
$('.list-sel-ser-them').append( |
564 |
'<div class=\'row liste_droite_service\' id=\'' + i + '\'>'+ |
'<div id=\'s' + i + '\' class=\'row liste_droite_service\'>'+ |
565 |
'<div class=\'cell1\'>'+ |
'<div class=\'cell1\'>'+ |
566 |
'<div name=\'' + $(this).attr('id') + '\' id=\'' + $(this).attr('id') + '\'>'+ |
'<div class=\'' + $(this).attr('id') + '\' name=\'' + $(this).attr('id') + '\'>'+ |
567 |
$(this).html().split('<')[0]+ |
$(this).html().split('<')[0]+ |
568 |
'</div>'+ |
'</div>'+ |
569 |
'</div>' + |
'</div>' + |
581 |
|
|
582 |
} |
} |
583 |
); |
); |
|
|
|
584 |
changeActionVal(data); |
changeActionVal(data); |
585 |
} |
} |
586 |
</script>"; |
</script>"; |