1 |
vpihour |
527 |
<?php |
2 |
|
|
require_once "../obj/utils.class.php"; |
3 |
|
|
|
4 |
|
|
// Identifiant de l'objet metier a copier |
5 |
|
|
(isset($_GET['idx']) ? $idx = $_GET['idx'] : $idx = ""); |
6 |
|
|
// Nom de l'objet metier |
7 |
|
|
(isset($_GET['obj']) ? $obj = $_GET['obj'] : $obj = ""); |
8 |
|
|
|
9 |
|
|
$f = new utils("nohtml"); |
10 |
|
|
|
11 |
|
|
$liste_gauche = ""; |
12 |
|
|
|
13 |
|
|
/*Requête qui récupère les services qui sont dans des thématiques*/ |
14 |
|
|
$sql = |
15 |
|
|
"SELECT |
16 |
|
|
ser_cat.service_categorie, ser_cat.libelle AS them_lib, |
17 |
|
|
ser.service, ser.libelle AS ser_lib |
18 |
|
|
FROM |
19 |
|
|
public.lien_service_service_categorie lie, |
20 |
|
|
public.service_categorie ser_cat, |
21 |
|
|
public.service ser |
22 |
|
|
WHERE |
23 |
|
|
ser_cat.service_categorie = lie.service_categorie AND |
24 |
|
|
ser.service = lie.service AND |
25 |
|
|
( |
26 |
|
|
ser.om_validite_fin <= CURRENT_DATE OR |
27 |
|
|
ser.om_validite_fin IS NULL |
28 |
|
|
) |
29 |
|
|
"; |
30 |
|
|
|
31 |
|
|
$res = $f->db->query($sql); |
32 |
|
|
$f->isDatabaseError($res); |
33 |
|
|
|
34 |
|
|
$temp_ser_cat = 0; |
35 |
|
|
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) { |
36 |
|
|
|
37 |
|
|
/*On change de thématique, donc rajoute le nom de la thématique*/ |
38 |
|
|
if ( $temp_ser_cat != $row['service_categorie'] ){ |
39 |
|
|
|
40 |
|
|
$temp_ser_cat = $row['service_categorie']; |
41 |
|
|
$liste_gauche .= ' |
42 |
nhaye |
528 |
<div id="them_'.$row['service_categorie'].'" class="liste_gauche_them" >'. |
43 |
vpihour |
527 |
$row['them_lib']. |
44 |
|
|
'</div> |
45 |
|
|
<div |
46 |
|
|
class="liste_gauche_service" |
47 |
nhaye |
528 |
id="'.$row['service_categorie'].'_'.$row['service'].'" > |
48 |
vpihour |
527 |
'.$row['ser_lib'].' |
49 |
|
|
</div> |
50 |
|
|
'; |
51 |
|
|
} |
52 |
|
|
|
53 |
|
|
/*On est dans la même thématique*/ |
54 |
|
|
else { |
55 |
|
|
|
56 |
|
|
$liste_gauche .= ' |
57 |
|
|
<div |
58 |
|
|
class="liste_gauche_service" |
59 |
nhaye |
528 |
id="'.$row['service_categorie'].'_'.$row['service'].'" > |
60 |
vpihour |
527 |
'.$row['ser_lib'].' |
61 |
|
|
</div> |
62 |
|
|
'; |
63 |
|
|
} |
64 |
|
|
|
65 |
|
|
} |
66 |
|
|
|
67 |
|
|
/*Requête qui récupère les services qui ne sont pas dans une thématique*/ |
68 |
|
|
$sql = |
69 |
|
|
"SELECT service, libelle |
70 |
|
|
FROM public.service |
71 |
|
|
WHERE service NOT IN |
72 |
|
|
( |
73 |
|
|
SELECT service |
74 |
|
|
FROM lien_service_service_categorie |
75 |
|
|
) |
76 |
|
|
AND |
77 |
|
|
( |
78 |
|
|
om_validite_fin <= CURRENT_DATE OR |
79 |
|
|
om_validite_fin IS NULL |
80 |
|
|
) |
81 |
|
|
"; |
82 |
|
|
|
83 |
|
|
$res = $f->db->query($sql); |
84 |
|
|
$f->isDatabaseError($res); |
85 |
|
|
|
86 |
|
|
if ( $res->numrows() > 0 ) |
87 |
|
|
$liste_gauche .= ' |
88 |
|
|
<div id="them_0" class="liste_gauche_them">Autres</div>'; |
89 |
|
|
|
90 |
|
|
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) { |
91 |
|
|
/*Ajout de tous les services qui n'ont pas de thématique*/ |
92 |
|
|
$liste_gauche .= ' |
93 |
|
|
<div |
94 |
|
|
class="liste_gauche_service" |
95 |
nhaye |
528 |
id="0_'.$row['service'].'" > |
96 |
vpihour |
527 |
'.$row['libelle'].' |
97 |
|
|
</div> |
98 |
|
|
'; |
99 |
|
|
} |
100 |
|
|
|
101 |
|
|
/*Affichage du formulaire*/ |
102 |
|
|
echo '<div class="subtitle">'; |
103 |
|
|
echo '<h3>'; |
104 |
|
|
echo _("Application"); |
105 |
|
|
echo '<span class="om-icon om-icon-16 om-icon-fix arrow-right-16">></span>'; |
106 |
|
|
echo _("consultation"); |
107 |
|
|
echo '</h3>'; |
108 |
|
|
echo '</div>'; |
109 |
|
|
echo '<div class="sformulaire">'; |
110 |
|
|
echo '<form onsubmit="affichersform(\'consultation\', |
111 |
|
|
\'../scr/sousform.php?obj=consultation&premiersf=0&retourformulaire=PC& |
112 |
|
|
idxformulaire=PC12R0001&trisf=&validation=1&retour=tab\', this);return false;" |
113 |
|
|
method="post" action="" name="f2">'; |
114 |
|
|
echo '<div class="formEntete ui-corner-all">'; |
115 |
|
|
echo "<div id='form-content'>"; |
116 |
|
|
echo '<div class="bloc">'; |
117 |
|
|
echo "<fieldset class='cadre ui-corner-all ui-widget-content'>\n"; |
118 |
|
|
echo "\t<legend class='ui-corner-all ui-widget-content ui-state-active'>". |
119 |
|
|
_("Consultation par thématique ")."</legend>"; |
120 |
|
|
echo "<div class='fieldsetContent' style='width:100%'>"; |
121 |
|
|
echo '<div class="field-ser-them field-type-hiddenstatic">'; |
122 |
|
|
echo '<div class="form-libelle">'; |
123 |
|
|
echo '<label class="libelle-dossier" for="dossier">'; |
124 |
|
|
echo _('dossier'); |
125 |
|
|
echo '<span class="not-null-tag">*</span>'; |
126 |
|
|
echo '</label>'; |
127 |
|
|
echo '</div>'; |
128 |
|
|
echo '<div class="form-content">'; |
129 |
|
|
echo '<input id="dossier" class="champFormulaire" type="hidden" value="PC12R0001" name="dossier">'; |
130 |
|
|
echo $idx; |
131 |
|
|
echo '</div>'; |
132 |
|
|
echo '</div>'; |
133 |
|
|
/*Code du nouveau champ*/ |
134 |
|
|
echo '<div class="field-ser-them ser-them">'; |
135 |
|
|
echo '<div class="list-ser-them">'; |
136 |
|
|
echo $liste_gauche; |
137 |
|
|
echo '</div>'; |
138 |
|
|
echo '<div class="button-ser-them">'; |
139 |
|
|
echo '<ul>'; |
140 |
|
|
echo '<li>'; |
141 |
|
|
echo '<input type="button" value="'._("Ajouter").' >>" id="add-ser-them"/>'; |
142 |
|
|
echo '</li>'; |
143 |
|
|
echo '<li>'; |
144 |
|
|
echo '<input type="button" value="<< '._("Supprimer").'" id="del-ser-them"/>'; |
145 |
|
|
echo '</li>'; |
146 |
|
|
echo '</ul>'; |
147 |
|
|
echo '</div>'; |
148 |
|
|
echo '<div class="list-sel-ser-them">'; |
149 |
|
|
echo '</div>'; |
150 |
|
|
echo '</div>'; |
151 |
|
|
/* -- FIN --*/ |
152 |
|
|
echo '<div class="field-ser-them field-type-date2">'; |
153 |
|
|
echo '<div class="form-libelle">'; |
154 |
|
|
echo '<label class="libelle-date_envoi" for="date_envoi">'; |
155 |
|
|
echo _('date_envoi'); |
156 |
|
|
echo '<span class="not-null-tag">*</span>'; |
157 |
|
|
echo '</label>'; |
158 |
|
|
echo '</div>'; |
159 |
|
|
echo '<div class="form-content">'; |
160 |
|
|
echo '<input id="date_envoi" class="champFormulaire datepicker" |
161 |
nhaye |
528 |
type="text" onkeyup="" onchange="fdate(this)" |
162 |
vpihour |
527 |
maxlength="10" size="12" value="'.date("d/m/Y").'" |
163 |
|
|
name="date_envoi">'; |
164 |
|
|
echo '</div>'; |
165 |
|
|
echo '</div>'; |
166 |
|
|
echo "</div>"; |
167 |
|
|
echo "</fieldset>"; |
168 |
|
|
echo '</div>'; |
169 |
|
|
echo '</div>'; |
170 |
|
|
echo '</div>'; |
171 |
|
|
echo '<div class="formControls">'; |
172 |
|
|
echo '<input class="om-button ui-button ui-widget ui-state-default ui-corner-all" |
173 |
|
|
type="button" onclick="affichersform(\'consultation\', |
174 |
|
|
\'../scr/sousform.php?obj=consultation&premiersf=0&retourformulaire=PC& |
175 |
|
|
idxformulaire=PC12R0001&trisf=&validation=1&retour=tab\', |
176 |
|
|
this.form);" |
177 |
|
|
value="Ajouter le(s) enregistrement(s) de la table : \'Consultation\'" |
178 |
|
|
role="button" aria-disabled="false">'; |
179 |
|
|
echo '<a class="retour" onclick="ajaxIt(\'consultation\', |
180 |
|
|
\'../scr/soustab.php?obj=consultation&retourformulaire=PC& |
181 |
|
|
idxformulaire=PC12R0001&premier=0&tricol=\');" |
182 |
|
|
href="#">'; |
183 |
|
|
echo 'Retour'; |
184 |
|
|
echo '</a>'; |
185 |
|
|
echo '</div>'; |
186 |
|
|
echo '</form>'; |
187 |
|
|
echo '</div>'; |
188 |
nhaye |
528 |
|
189 |
|
|
echo "<script> |
190 |
|
|
$(function(){ |
191 |
|
|
$('.liste_gauche_service').click( |
192 |
|
|
|
193 |
|
|
function(){ |
194 |
|
|
$(this).toggleClass('liste_gauche_service_selected'); |
195 |
|
|
}); |
196 |
|
|
}); |
197 |
|
|
|
198 |
|
|
|
199 |
|
|
|
200 |
|
|
</script>"; |
201 |
vpihour |
527 |
?> |