[openresultat-Commits] r475 - branches/2.x/obj

1 view
Skip to first unread message

fray...@hephaestos.ovh.adullact.org

unread,
Jan 31, 2020, 4:13:23 AM1/31/20
to openmairie-...@googlegroups.com
Author: fraynaud
Date: 2020-01-31 10:13:21 +0100 (Fri, 31 Jan 2020)
New Revision: 475

Modified:
branches/2.x/obj/election.class.php
branches/2.x/obj/election_bureau.class.php
Log:
ergonomie election_bureau




Modified: branches/2.x/obj/election.class.php
===================================================================
--- branches/2.x/obj/election.class.php 2020-01-30 09:17:18 UTC (rev 474)
+++ branches/2.x/obj/election.class.php 2020-01-31 09:13:21 UTC (rev 475)
@@ -1705,4 +1705,71 @@
$this->f->layout->display_message($class , $this->msg);

}
+/*
+ // =================================================================
+ // affichage des resultats (modif candidat_election n impacte pas)
+ // =================================================================
+
+
+ function afterFormSpecificContent() {
+ $maj=$this->getParameter("maj");
+ if($maj==3){
+ $election=$this->getVal('election');
+ echo "<div id=\"affichage_article\" class=\"formEntete ui-corner-all\">";
+ $this->affiche_data($election);
+ echo "</div>";
+ }
+ }
+
+ function affiche_data($election){
+ $sql = "select election_candidat.ordre, candidat.libelle, ";
+ $sql .= " candidat_resultat.resultat, ";
+ $sql .= " case election_candidat.creation_resultat when 't' then '<img src=../app/img/arrive.png>' else '<img src=../app/img/erreur.png>' end as creation ";
+
+ $sql .= " from ".DB_PREFIXE."election_candidat ";
+ $sql .= " left join ".DB_PREFIXE."candidat on candidat.candidat=election_candidat.candidat " ;
+ $sql .= " LEFT JOIN ".DB_PREFIXE."candidat_resultat ON election_candidat.election_candidat=candidat_resultat.election_candidat ";
+ $sql .= " where election_candidat.election = ".$election;
+ $sql .= " order by election_candidat.ordre ";
+ $res=$this->db->query($sql);
+ if (database::isError($res))
+ die($res->getDebugInfo()." ".$sql);
+ else {
+ $temp = _("Liste des Candidats");
+ echo "<fieldset class=\"cadre ui-corner-all ui-widget-content\"><legend>".$temp."</legend>";
+ echo "<table class=\"tab-tab\">";
+ echo "<tr class=\"ui-tabs-nav ui-accordion ui-state-default tab-title\">";
+ // affichage des entetes
+ echo "<th class=\"title\">"._("ordre")."</th>";
+ echo "<th class=\"title\">"._("candidat")."</th>";
+ echo "<th class=\"title\">"._("voix")."</th>";
+ echo "<th class=\"title\">"._("creation")."</th>";
+ echo "</tr>";
+ $i=0;
+ $oddeven=array("odd","even");
+ $exprime=0;
+ while ($line=$res->fetchrow(DB_FETCHMODE_ASSOC)) {
+ echo "<tr class=\"tab-data ".$oddeven[$i%2]."\">";
+ echo '<td>'.$line['ordre'].'</td>';
+ echo '<td>'.$line['libelle'].'</td>';
+ echo '<td style="text-align:right">'.$line['resultat'].'</td>';
+ echo '<td>'.$line['creation'].'</td>';
+ echo "</tr>";
+ $exprime=$exprime+$line['resultat'];
+ $i++;
+ }
+ echo "<tr class=\"tab-data ".$oddeven[$i%2]."\">";
+ echo '<td></td><td>'._("Total exprime").'</td><td style="text-align:right">'.$exprime.'</td></tr>';
+ echo "</table>";
+ echo "</fieldset>";
+ if($i==0)
+ echo "<b>"._("les resultats election n'ont pas ete crees - voir action dans onglet candidat")."</b>";
+ else
+ echo $i." "._("resultat(s) candidat cree(s)");
+ }
+
+ }
+*/
+
+
}

Modified: branches/2.x/obj/election_bureau.class.php
===================================================================
--- branches/2.x/obj/election_bureau.class.php 2020-01-30 09:17:18 UTC (rev 474)
+++ branches/2.x/obj/election_bureau.class.php 2020-01-31 09:13:21 UTC (rev 475)
@@ -171,9 +171,34 @@
$form->setLib('candidat'.$i,$row['libelle']." : ");
$this->candidats[$i]=$row['libelle'];
}
+ if($maj==3){
+ $form->setLib('election_bureau','');
+ $form->setLib('bureau','');
+ $form->setLib('election','');
+
+ }
}

+ function setLayout(&$form, $maj) {
+
+ if($maj==3){
+ $form->setBloc('election_bureau','D',"","col_4"); // bloc
+ $form->setFieldset('election_bureau','D',_('Election'), "collapsible");
+ $form->setFieldset('bureau','F','');
+ $form->setBloc('bureau','F','');
+ $form->setBloc('inscrit','D',"","col_3"); // bloc
+ $form->setFieldset('inscrit','D',_('resultat du bureau'), "collapsible");
+ $form->setFieldset('exprime','F','');
+ $form->setBloc('exprime','F',''); // fin bloc
+ $form->setBloc('envoi_aff','D',"","col_3"); // bloc
+ $form->setFieldset('envoi_aff','D',_('envoi'), "collapsible");
+ $form->setFieldset('envoi_web','F','');
+ $form->setBloc('envoi_web','F','');
+ }
+ }

+
+
function triggermodifier($id, &$dnu1 = null, $val = array(), $dnu2 = null) {
// update d election_resultat : resultat du candidat dans le bureau
// calcul exprime
@@ -744,6 +769,11 @@
echo '<td></td><td>'._("Total exprime").'</td><td style="text-align:right">'.$exprime.'</td></tr>';
echo "</table>";
echo "</fieldset>";
+ if($i==0)
+ echo "<b>"._("les resultats election n'ont pas ete crees - voir action dans onglet candidat")."</b>";
+ else
+ echo $i." "._("resultat(s) candidat cree(s)");
+
}

}

Reply all
Reply to author
Forward
0 new messages