/[openfoncier]/trunk/obj/om_formulaire.class.php
ViewVC logotype

Contents of /trunk/obj/om_formulaire.class.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1270 - (show annotations)
Wed Feb 20 16:22:45 2013 UTC (11 years, 11 months ago) by nhaye
File size: 6380 byte(s)
Ajout des données techniques aux lots via overlay jquery,
correction du widget de tableau de formulaire,
création d'un script (displayLotCerfa).php appelé en javascript,
correction de l'ordre des champs du tableau de surface (donnees_techniques.form.inc.php)
ajout d'un lien dans le menu contextuel permettant d'afficher le form des données techniques

1 <?php
2 /**
3 * Ce fichier est destine a permettre la surcharge de certaines methodes de
4 * la classe om_formulaire pour des besoins specifiques de l'application
5 *
6 * @package openmairie_exemple
7 * @version SVN : $Id$
8 */
9
10 /**
11 *
12 */
13 require_once PATH_OPENMAIRIE."om_formulaire.class.php";
14
15 /**
16 *
17 */
18 class om_formulaire extends formulaire {
19
20 /**
21 * Pour upload dans /tmp
22 *
23 * @param string $champ Nom du champ
24 * @param integer $validation
25 * @param boolean $DEBUG Parametre inutilise
26 */
27 function tmpUpload($champ, $validation, $DEBUG = false) {
28
29 //
30 echo "<input";
31 echo " type=\"text\"";
32 echo " name=\"".$champ."\"";
33 echo " id=\"".$champ."\" ";
34 echo " value=\"".$this->val[$champ]."\"";
35 echo " size=\"".$this->taille[$champ]."\"";
36 echo " maxlength=\"".$this->max[$champ]."\"";
37 echo " class=\"champFormulaire upload\"";
38 if (!$this->correct) {
39 if (isset($this->onchange) and $this->onchange[$champ] != "") {
40 echo " onchange=\"".$this->onchange[$champ]."\"";
41 }
42 if (isset($this->onkeyup) and $this->onkeyup[$champ] != "") {
43 echo " onkeyup=\"".$this->onkeyup[$champ]."\"";
44 }
45 if (isset($this->onclick) and $this->onclick[$champ] != "") {
46 echo " onclick=\"".$this->onclick[$champ]."\"";
47 }
48 } else {
49 echo " disabled=\"disabled\"";
50 }
51 echo " />\n";
52
53 //
54 if (!$this->correct) {
55 //
56 echo "<a class=\"upload ui-state-default ui-corner-all\" href=\"javascript:tmpUpload('".$champ."');\">";
57 echo "<span class=\"ui-icon ui-icon-arrowthickstop-1-s\" ";
58 echo "title=\""._("Cliquer ici pour telecharger un fichier depuis votre poste de travail")."\">";
59 echo _("Telecharger");
60 echo "</span>";
61 echo "</a>\n";
62 //
63 echo "<a class=\"voir ui-state-default ui-corner-all\" href=\"javascript:voir2('".$champ."');\">\n";
64 echo "<span class=\"ui-icon ui-icon-newwin\" ";
65 echo "title=\""._("Cliquer ici pour voir le fichier")."\">";
66 echo _("Voir");
67 echo "</span>";
68 echo "</a>\n";
69 }
70 }
71
72 function tmpUploadStatic($champ, $validation, $DEBUG = false) {
73 if(!empty($this->val[$champ])) {
74 echo "<a class=\"voir ui-state-default ui-corner-all\" href=\"javascript:file('".$this->val[$champ]."');\">\n";
75 echo "<span class=\"ui-icon ui-icon-newwin\" ";
76 echo "title=\""._("Cliquer ici pour voir le fichier")."\">";
77 echo _("Voir");
78 echo "</span>";
79 echo "</a>\n";
80 }
81 }
82
83 /**
84 * La valeur du champ est passe par le controle hidden
85 *
86 * @param string $champ Nom du champ
87 * @param integer $validation
88 * @param boolean $DEBUG Parametre inutilise
89 */
90 function referencescadastralesstatic($champ, $validation, $DEBUG = false) {
91
92 //
93 foreach (explode(';', $this->val[$champ]) as $key => $ref) {
94 echo "<span class=\"reference-cadastrale-".$key."\">";
95 echo $ref;
96 echo "</span>&nbsp";
97 }
98 }
99
100 /**
101 * Liste de données
102 *
103 * @param string $champ Nom du champ
104 * @param integer $validation
105 * @param boolean $DEBUG Parametre inutilise
106 */
107 function select_multiple_static($champ,$validation,$DEBUG = false){
108
109 $selected_values = explode(",", $this->val[$champ]);
110 //
111 echo "<ul";
112 echo " name=\"".$champ."[]\"";
113 echo " class=\"select_multiple_static\"";
114 if (!$this->correct) {
115 if (isset($this->onchange) and $this->onchange[$champ] != "") {
116 echo " onchange=\"".$this->onchange[$champ]."\"";
117 }
118 if (isset($this->onkeyup) and $this->onkeyup[$champ] != "") {
119 echo " onkeyup=\"".$this->onkeyup[$champ]."\"";
120 }
121 if (isset($this->onclick) and $this->onclick[$champ] != "") {
122 echo " onclick=\"".$this->onclick[$champ]."\"";
123 }
124 }
125 echo " >\n";
126 //
127 $k = 0;
128 foreach ($this->select[$champ] as $elem) {
129 while ($k <count($elem)) {
130 echo "<li> ";
131 echo $this->select[$champ][1][$k];
132 echo "</li>\n";
133 $k++;
134 }
135 }
136 //
137 echo "</ul>\n";
138 }
139
140 function tableau($champ,$validation,$DEBUG = false) {
141 // Ouverture du tableau
142 echo "<table>";
143
144 // Affichage des entêtes de colonnes
145 echo "<tr>";
146 foreach ($this->select[$champ]["column_header"] as $value) {
147 echo "<th>";
148 echo $value;
149 echo "</th>";
150 }
151 echo "</tr>";
152
153 // Initialisation des variables
154 $k=0;
155 $keys = array_keys($this->select[$champ]["values"]);
156 $values = array_values($this->select[$champ]["values"]);
157
158 // Affichage de chaque ligne
159 for ($i=0; $i<count($this->select[$champ]["row_header"]); $i++) {
160 echo "<tr>";
161
162 // Affichage de l'entête de ligne
163 echo "<th>";
164 echo $this->select[$champ]["row_header"][$i];
165 echo "</th>";
166
167 // Affichage des champs
168 for ($j=0; $j<count($this->select[$champ]["column_header"])-1; $j++) {
169 echo "<td>";
170
171 // Appel de la méthode définie dans setType
172 if (method_exists($this, $this->type[$keys[$i+$j*count($this->select[$champ]["row_header"])]])) {
173 $function=$this->type[$keys[$i+$j*count($this->select[$champ]["row_header"])]];
174
175 $this->$function($keys[$i+$j*count($this->select[$champ]["row_header"])], $validation);
176 } else {
177 $this->statiq($keys[$i+$j*count($this->select[$champ]["row_header"])], $validation);
178 }
179 echo "</td>";
180 $k++;
181 }
182 echo "</tr>";
183 }
184 echo "</table>";
185 }
186 }
187
188 ?>

Properties

Name Value
svn:keywords Id

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26