Skip to content

Commit

Permalink
#1179: Implémentation des outils de suivi du nombre d'avis à base des…
Browse files Browse the repository at this point in the history
… tableaux d’agrégats

* Ajout de la page de comptages des données détaillés des avis par période pour toutes les démarches ou pour une démarche donnée (implémentée par @ldubost)
  • Loading branch information
lucaa committed Aug 5, 2022
1 parent 3d1d443 commit 02fc59d
Show file tree
Hide file tree
Showing 2 changed files with 171 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<?xml version="1.1" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<xwikidoc version="1.3" reference="Avis.Admin.Statistiques.ComptagesAggregats.ExportComptageSatisfaction" locale="">
<web>Avis.Admin.Statistiques.ComptagesAggregats</web>
<name>ExportComptageSatisfaction</name>
<language/>
<defaultLanguage/>
<translation>0</translation>
<creator>xwiki:XWiki.Admin</creator>
<creationDate>1544396400000</creationDate>
<parent>xwiki:Avis.Admin.Statistiques.ComptagesAggregats.WebHome</parent>
<author>xwiki:XWiki.Admin</author>
<contentAuthor>xwiki:XWiki.Admin</contentAuthor>
<date>1544396400000</date>
<contentUpdateDate>1544396400000</contentUpdateDate>
<version>1.1</version>
<title>Export (Comptage et Satisfaction)</title>
<comment/>
<minorEdit>false</minorEdit>
<syntaxId>xwiki/2.1</syntaxId>
<hidden>false</hidden>
<content>{{velocity}}
#if($request.date)
#set($date = $request.date)
#else
#set($date = "2021-01-01")
#end
#if($request.date)
#set($type = $request.type)
#else
#set($type = "mois")
#end
#if($request.page)
#set($page = $request.page)
#else
#set($page = "")
#end
#set($spage = $escapetool.xml($page))
=Avis détaillés par $type depuis le $date =

{{html clean="false"}}
&lt;form action=""&gt;
Date: &lt;input type="date" name="date" value="${date}" /&gt;
Type: &lt;select name="type"&gt;
&lt;option value="an" #if($type=="an")selected#end&gt;Année&lt;/option&gt;
&lt;option value="mois" #if($type=="mois")selected#end&gt;Mois&lt;/option&gt;
&lt;option value="trimestre" #if($type=="trimestre")selected#end&gt;Trimestre&lt;/option&gt;
&lt;option value="semaine" #if($type=="semaine")selected#end&gt;Semaine&lt;/option&gt;
&lt;option value="jour" #if($type=="jour")selected#end&gt;Jour&lt;/option&gt;
&lt;/select&gt;
Top 250: &lt;input type="checkbox" name="top250" value="1" #if("$!request.top250" == '1')checked=checked#end/&gt;
Demarche: &lt;input type="text" name="page" value="$spage" class="suggest-pages" /&gt;
&lt;input type="submit" value="Go" /&gt;
&lt;/form&gt;
{{/html}}

#if($type=="an")
#set($colFormat = "%Y")
#set($colDisplay = "an")
#elseif($type=="semaine")
#set($colFormat = "%Y%u")
#set($colDisplay = "semaine")
#elseif($type=="jour")
#set($colFormat = "%Y%m%d")
#set($colDisplay = "jour")
#elseif($type=="mois")
#set($colFormat = "%Y%m")
#set($colDisplay = "mois")
#elseif($type=="trimestre")
#set($colFormat = "%Y")
#set($colDisplay = "trimestre")
#end

#set($extraQuery = "")
#if($page &amp;&amp; $page!="")
#set($extraQuery = "and demarche='Demarches.${escapetool.sql($page)}'")
#end

==Data ==

#if($type=="trimestre")
#set($dateField = "CONCAT(date_format(day, '$colFormat'),'T',QUARTER(day))")
#else
#set($dateField = "date_format(day, '$colFormat')")
#end

#set($query = "select demarche, $dateField as $colDisplay, sum(nbAvis) as nbAvis, 5.0 * ((sum(avis3)*3.0 + sum(avis2)*2.0 + sum(avis1)) / sum(nbAvis) -1) as satisfaction, sum(avis1), sum(avis2), sum(avis3), sum(comprehension1), sum(comprehension2), sum(comprehension3), sum(facile1), sum(facile2), sum(facile3), sum(diffManquedinformations), sum(diffDysfonctionnement), sum(diffMobile), sum(diffPiecesjointes), sum(diffSuite), sum(diffAutre), sum(aideProche), sum(aideAssociation), sum(aideAgent), sum(aideInternet), sum(aideAutre) from AvisAggregateByDay where day&gt;'$date' $extraQuery group by 1, 2")
|=Démarche|=Numéro|=Top250|=Mois|=Nb Avis|=Satisfaction|Avis TB|Avis M|Avis PB|Comprehension TB|Comprehension M|Comprehension PB|Facilité TB|Facilité M|Facilité PB|Diff Manque d'Info|Diff Dysfonctionnement|Diff Mobile|Diff Pièces Jointes|Diff Suite|Diff Autre|Aide Proche|Aide Association|Aide Agent|Aide Internet|Aide Autre
#foreach($item in $services.query.hql($query).execute())
#set($demarche = $item[0])
#set($mois = $item[1])
#set($nbAvis = $item[2])
#set($satisfaction = $item[3])
#set($demarcheDoc = $xwiki.getDocument($demarche))
#set($demarcheTitle = $demarcheDoc.getDisplayTitle())
#set($demarcheTop250 = "Non")
#if($demarcheDoc.getValue("top")==1)
#set($demarcheTop250 = "Oui")
#end
#set($satisfaction = $item[3])
#if(($request.top250!=1) || ($demarcheTop250=="Oui"))
|$demarcheTitle|$demarche.replaceAll("Demarches.", "")|$demarcheTop250|$mois|$nbAvis|$satisfaction.toString().replaceAll("[.]", ",")#foreach($i in [4..23])|$item[$i]#end
#end

#end
{{/velocity}}</content>
</xwikidoc>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.1" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<xwikidoc version="1.3" reference="Avis.Admin.Statistiques.ComptagesAggregats.WebHome" locale="">
<web>Avis.Admin.Statistiques.ComptagesAggregats</web>
<name>WebHome</name>
<language/>
<defaultLanguage/>
<translation>0</translation>
<creator>xwiki:XWiki.Admin</creator>
<creationDate>1544396400000</creationDate>
<parent>Avis.Admin.Statistiques.WebHome</parent>
<author>xwiki:XWiki.Admin</author>
<contentAuthor>xwiki:XWiki.Admin</contentAuthor>
<date>1544396400000</date>
<contentUpdateDate>1544396400000</contentUpdateDate>
<version>1.1</version>
<title>Comptages par Aggregats</title>
<comment/>
<minorEdit>false</minorEdit>
<syntaxId>xwiki/2.1</syntaxId>
<hidden>false</hidden>
<content>
{{children /}}</content>
</xwikidoc>

0 comments on commit 02fc59d

Please sign in to comment.