Wiki source code of Satisfaction Stats
Last modified by Julien Fleury on 2020/12/19 00:25
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
1.1 | 1 | {{velocity}} |
2 | $xwiki.ssx.use('WeeklyActivityCode.ActivitySheet') | ||
3 | #if ($!request.get('satisfaction_id') && "$!request.get('satisfaction_id')" != "") | ||
4 | #set ($satisfactionId = $!request.get('satisfaction_id')) | ||
5 | #set ($sql = "select obj.satisfaction, count(obj.satisfaction) from Document doc, doc.object(WeeklyActivityCode.DoneActivityClass) as obj where obj.project = :proj and obj.satisfaction <> '' group by obj.satisfaction ") | ||
6 | #set ($resultSql = $services.query.xwql($sql).bindValue("proj", $satisfactionId).execute()) | ||
7 | #set ($total = 0) | ||
8 | #foreach ($item in $resultSql) | ||
9 | #set ($total = $total + 1) | ||
10 | #end | ||
11 | {{html}} | ||
12 | <h2>$msg.get('weeklyActivity.sheet_satisfaction_result'):</h2> | ||
13 | {{/html}} | ||
14 | |||
15 | #foreach($item in $resultSql) | ||
16 | {{html}} | ||
17 | <div class="inline_img"> | ||
18 | #set ($value = (100 / $total) * $item.get(1)) | ||
19 | #if ($item.get(0) == 1) <img src="$xwiki.getDocument('WeeklyActivity.WebHome').getAttachmentURL("2.png")" class="float_right" height="115px" width="100px"/> <div class="satisfactionstats_nbr">$value%</div> | ||
20 | #elseif ($item.get(0) == 2) <img src="$xwiki.getDocument('WeeklyActivity.WebHome').getAttachmentURL("5.png")" class="float_right" height="115px" width="100px"/> <div class="satisfactionstats_nbr">$value%</div> | ||
21 | #elseif ($item.get(0) == 3) <img src="$xwiki.getDocument('WeeklyActivity.WebHome').getAttachmentURL("6.png")" class="float_right" height="115px" width="100px"/> <div class="satisfactionstats_nbr">$value%</div> | ||
22 | #elseif ($item.get(0) == 4) <img src="$xwiki.getDocument('WeeklyActivity.WebHome').getAttachmentURL("8.png")" class="float_right" height="115px" width="100px"/> <div class="satisfactionstats_nbr">$value%</div> | ||
23 | #elseif ($item.get(0) == 5) <img src="$xwiki.getDocument('WeeklyActivity.WebHome').getAttachmentURL("10.png")" class="float_right" height="115px" width="100px"/> <div class="satisfactionstats_nbr">$value%</div> | ||
24 | #end | ||
25 | </div> | ||
26 | {{/html}} | ||
27 | |||
28 | #end | ||
29 | |||
30 | {{html}} | ||
31 | <h3>$msg.get('weeklyActivity.sheet_total_vote') ($!request.get('satisfaction_id')):</h3> | ||
32 | {{/html}} | ||
33 | |||
34 | $total#if ($total > 1) votes #else vote #end | ||
35 | #else | ||
36 | #set($sql = "select distinct obj.project from Document doc, doc.object(WeeklyActivityCode.DoneActivityClass) as obj") | ||
37 | |||
38 | {{html}} | ||
39 | <p>$msg.get('weeklyActivity.sheet_select_project') :</p><br /> | ||
40 | <form action="" method="POST"> | ||
41 | <select name="satisfaction_id"> | ||
42 | #foreach($item in $services.query.xwql($sql).execute()) | ||
43 | #if ($item != "Other") | ||
44 | <option value="$item">$item</option> | ||
45 | #end | ||
46 | #end | ||
47 | </select> | ||
48 | <br /><br /> | ||
49 | <div class="buttonwrapper"> | ||
50 | <input type="submit" value="$msg.get('weeklyActivity.sheet_submit_button')" class="button" /> | ||
51 | </div> | ||
52 | </form> | ||
53 | {{/html}} | ||
54 | |||
55 | #end | ||
56 | |||
57 | {{/velocity}} |