/[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 1455 - (show annotations)
Fri Mar 15 17:46:31 2013 UTC (11 years, 10 months ago) by nhaye
File size: 6036 byte(s)
Suppression du bouton de visualisation du champs tmpUplaod

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 }
64
65 function tmpUploadStatic($champ, $validation, $DEBUG = false) {
66 if(!empty($this->val[$champ])) {
67 echo "<a class=\"voir ui-state-default ui-corner-all\" href=\"javascript:file('".$this->val[$champ]."');\">\n";
68 echo "<span class=\"ui-icon ui-icon-newwin\" ";
69 echo "title=\""._("Cliquer ici pour voir le fichier")."\">";
70 echo _("Voir");
71 echo "</span>";
72 echo "</a>\n";
73 }
74 }
75
76 /**
77 * La valeur du champ est passe par le controle hidden
78 *
79 * @param string $champ Nom du champ
80 * @param integer $validation
81 * @param boolean $DEBUG Parametre inutilise
82 */
83 function referencescadastralesstatic($champ, $validation, $DEBUG = false) {
84
85 //
86 foreach (explode(';', $this->val[$champ]) as $key => $ref) {
87 echo "<span class=\"reference-cadastrale-".$key."\">";
88 echo $ref;
89 echo "</span>&nbsp";
90 }
91 }
92
93 /**
94 * Liste de données
95 *
96 * @param string $champ Nom du champ
97 * @param integer $validation
98 * @param boolean $DEBUG Parametre inutilise
99 */
100 function select_multiple_static($champ,$validation,$DEBUG = false){
101
102 $selected_values = explode(",", $this->val[$champ]);
103 //
104 echo "<ul";
105 echo " name=\"".$champ."[]\"";
106 echo " class=\"select_multiple_static\"";
107 if (!$this->correct) {
108 if (isset($this->onchange) and $this->onchange[$champ] != "") {
109 echo " onchange=\"".$this->onchange[$champ]."\"";
110 }
111 if (isset($this->onkeyup) and $this->onkeyup[$champ] != "") {
112 echo " onkeyup=\"".$this->onkeyup[$champ]."\"";
113 }
114 if (isset($this->onclick) and $this->onclick[$champ] != "") {
115 echo " onclick=\"".$this->onclick[$champ]."\"";
116 }
117 }
118 echo " >\n";
119 //
120 $k = 0;
121 foreach ($this->select[$champ] as $elem) {
122 while ($k <count($elem)) {
123 echo "<li> ";
124 echo $this->select[$champ][1][$k];
125 echo "</li>\n";
126 $k++;
127 }
128 }
129 //
130 echo "</ul>\n";
131 }
132
133 function tableau($champ,$validation,$DEBUG = false) {
134 // Ouverture du tableau
135 echo "<table>";
136
137 // Affichage des entêtes de colonnes
138 echo "<tr>";
139 foreach ($this->select[$champ]["column_header"] as $value) {
140 echo "<th>";
141 echo $value;
142 echo "</th>";
143 }
144 echo "</tr>";
145
146 // Initialisation des variables
147 $k=0;
148 $keys = array_keys($this->select[$champ]["values"]);
149 $values = array_values($this->select[$champ]["values"]);
150
151 // Affichage de chaque ligne
152 for ($i=0; $i<count($this->select[$champ]["row_header"]); $i++) {
153 echo "<tr>";
154
155 // Affichage de l'entête de ligne
156 echo "<th>";
157 echo $this->select[$champ]["row_header"][$i];
158 echo "</th>";
159
160 // Affichage des champs
161 for ($j=0; $j<count($this->select[$champ]["column_header"])-1; $j++) {
162 echo "<td>";
163
164 // Appel de la méthode définie dans setType
165 if (method_exists($this, $this->type[$keys[$i+$j*count($this->select[$champ]["row_header"])]])) {
166 $function=$this->type[$keys[$i+$j*count($this->select[$champ]["row_header"])]];
167
168 $this->$function($keys[$i+$j*count($this->select[$champ]["row_header"])], $validation);
169 } else {
170 $this->statiq($keys[$i+$j*count($this->select[$champ]["row_header"])], $validation);
171 }
172 echo "</td>";
173 $k++;
174 }
175 echo "</tr>";
176 }
177 echo "</table>";
178 }
179 }
180
181 ?>

Properties

Name Value
svn:keywords Id

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26