/[openfoncier]/trunk/app/bible.php
ViewVC logotype

Annotation of /trunk/app/bible.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2408 - (hide annotations)
Tue Oct 15 10:12:25 2013 UTC (11 years, 3 months ago) by softime
File size: 3056 byte(s)
Modification de l'affichage de la bible lors de l'ajout d'un événement d'instruction : le libellé est affiché dans le tableau et le texte est toujours visible en infobulle.
+ Ajout des tests + MàJ HISTORY.txt

1 fraynaud 88 <?php
2     /**
3     * Ce script permet de mettre un texte de la bible dans un formulaire instruction
4     * champs file d'un formulaire
5     *
6 fmichon 1515 * @package openfoncier
7 fmichon 1184 * @version SVN : $Id$
8 fraynaud 88 */
9 fmichon 1515
10     //
11 fraynaud 88 require_once "../obj/utils.class.php";
12     $f = new utils("nohtml");
13 fmichon 1515
14 fraynaud 88 /**
15     * Affichage de la structure HTML
16     */
17     //
18 fmichon 1524 if ($f->isAjaxRequest()) {
19     //
20     header("Content-type: text/html; charset=".HTTPCHARSET."");
21     } else {
22     //
23     $f->setFlag("htmlonly");
24     $f->display();
25     }
26     //
27 fraynaud 88 $f->displayStartContent();
28 fmichon 1524 //
29     $f->setTitle(_("Liste des éléments de la bible en lien avec un evenement"));
30     $f->displayTitle();
31 fmichon 1523
32 fmichon 1524 /**
33     *
34     */
35 fmichon 1523 //
36 fmichon 1524 (isset($_GET["ev"]) ? $evenement = $_GET["ev"] : $evenement = "");
37     $evenement = intval($evenement);
38     //
39     (isset($_GET["idx"]) ? $idx = $_GET["idx"] : $idx = "");
40     $nature = substr($idx, 0, 2);
41     //
42 fmichon 1523 (isset($_GET["complement"]) ? $complement = $_GET["complement"] : $complement = "1");
43    
44 fmichon 1524 /**
45     *
46     */
47     //
48 softime 2408 $sql = "SELECT *, bible.libelle as bible_lib
49 fmichon 1524 FROM ".DB_PREFIXE."bible
50     LEFT OUTER JOIN ".DB_PREFIXE."dossier_autorisation_type
51     ON bible.dossier_autorisation_type=dossier_autorisation_type.dossier_autorisation_type
52     WHERE evenement=".$evenement."
53     AND complement=".$complement."
54     AND (bible.dossier_autorisation_type IS NULL
55     OR dossier_autorisation_type.code ='".$nature."') ";
56 fraynaud 88 $res = $f->db->query($sql);
57 fmichon 1524 $f->addToLog("app/bible.php: db->query(\"".$sql."\");", VERBOSE_MODE);
58 fraynaud 88 $f->isDatabaseError($res);
59 fmichon 1524 //
60     echo "<form method=\"post\" name=\"f3\" action=\"#\">\n";
61     //
62     if ($res->numrows() > 0) {
63     //
64 softime 2408 echo "\t<table id='tab-bible' width='100%'>\n";
65 fmichon 1524 //
66     echo "\t\t<tr class=\"ui-tabs-nav ui-accordion ui-state-default tab-title\">";
67     echo "<th>"._("Choisir")."</th>";
68 softime 2408 echo "<th>"._("Libelle")."</th>";
69 fmichon 1524 echo "</tr>\n";
70     //
71     $i = 0;
72     //
73     while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) {
74     //
75     echo "\t\t<tr";
76     echo " class=\"".($i % 2 == 0 ? "odd" : "even")."\"";
77     echo ">";
78     //
79     echo "<td class=\"center\"><input type=\"checkbox\" name=\"choix[]\" value=\"".$i."\" id=\"checkbox".$i."\" /></td>";
80 softime 2408 // XXX utilisation de l'attribut titre pour afficher une infobulle
81     echo "<td><span class=\"content\" title=\"".$row['contenu']."\" id=\"content".$i."\">".$row['bible_lib']."</span></td>";
82 fmichon 1524 //
83     echo "</tr>\n";
84     //
85 fraynaud 343 $i++;
86 fraynaud 88 }
87 fmichon 1524 echo "\t</table>\n";
88     //
89     echo "<div class=\"formControls\">\n";
90     $f->layout->display_form_button(array(
91     "value" => _("Valider"),
92     "onclick" => "bible_return('f2', 'complement".($complement == "1" ? "" : $complement)."'); return false;",
93     ));
94     $f->displayLinkJsCloseWindow();
95     echo "</div>\n";
96    
97     } else {
98     //
99     $message_class = "error";
100     $message = _("Aucun element dans la bible pour l'evenement")." : ".$evenement;
101     $f->displayMessage($message_class, $message);
102     //
103     echo "<div class=\"formControls\">\n";
104     $f->displayLinkJsCloseWindow();
105     echo "</div>\n";
106     }
107     //
108     echo "</form>\n";
109    
110     /**
111     * Affichage de la structure HTML
112     */
113     //
114     $f->displayEndContent();
115    
116 fraynaud 88 ?>

Properties

Name Value
svn:keywords Id

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26