Code source wiki de Statistiques et Graphiques
Modifié par Vivien Palmowski le 2026/03/11 10:39
Afficher les derniers auteurs
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{velocity}} | ||
| 2 | |||
| 3 | $services.localization.render("awm.statistics.desc") | ||
| 4 | |||
| 5 | #if($request.appname||$request.className) | ||
| 6 | #if($request.className) | ||
| 7 | #set($className = $request.className) | ||
| 8 | #else | ||
| 9 | #set($appDoc = $xwiki.getDocument($request.appname)) | ||
| 10 | #set($className = $appDoc.getValue("class")) | ||
| 11 | #end | ||
| 12 | #set($classDoc = $xwiki.getDocument($className).getxWikiClass()) | ||
| 13 | {{html}} | ||
| 14 | <form action=""> | ||
| 15 | <table> | ||
| 16 | <tbody> | ||
| 17 | <tr> | ||
| 18 | <th> | ||
| 19 | $services.localization.render("awm.statistics.field") | ||
| 20 | </th> | ||
| 21 | <td> | ||
| 22 | <select name="property"> | ||
| 23 | #foreach($prop in $classDoc.getProperties()) | ||
| 24 | <option value="${escapetool.xml($prop.name)}" #if($request.property==$prop.name)selected#end>${prop.prettyName}</option> | ||
| 25 | #end | ||
| 26 | </select> | ||
| 27 | </td></tr> | ||
| 28 | <tr> | ||
| 29 | <th> | ||
| 30 | $services.localization.render("awm.statistics.type") | ||
| 31 | </th> | ||
| 32 | <td> | ||
| 33 | <select name="type"> | ||
| 34 | <option value="pie" #if($request.type=="pie")selected#end>$services.localization.render("awm.statistics.type.pie")</option> | ||
| 35 | <option value="bar" #if($request.type=="bar")selected#end>$services.localization.render("awm.statistics.type.bar") | ||
| 36 | </option> | ||
| 37 | <option value="bar3D" #if($request.type=="bar3D")selected#end>$services.localization.render("awm.statistics.type.bar3D") | ||
| 38 | </option> | ||
| 39 | <option value="line" #if($request.type=="line")selected#end>$services.localization.render("awm.statistics.type.line") | ||
| 40 | </option> | ||
| 41 | </select></td></tr> | ||
| 42 | <tr> | ||
| 43 | <th>$services.localization.render("awm.statistics.function")</th> | ||
| 44 | <td><input type="text" size="40" name="function" value="$!{escapetool.xml($!request.function)}" /></td> | ||
| 45 | </tr> | ||
| 46 | <tr> | ||
| 47 | <th>$services.localization.render("awm.statistics.aggregate")</th> | ||
| 48 | <td><input type="text" size="40" name="aggregate" value="$!{escapetool.xml($!request.aggregate)}" /></td> | ||
| 49 | </tr> | ||
| 50 | <tr> | ||
| 51 | <th>$services.localization.render("awm.statistics.aggregateFunction")</th> | ||
| 52 | <td><input type="text" size="40" name="aggregateFunction" value="$!{escapetool.xml($!request.aggregateFunction)}" /></td> | ||
| 53 | </tr> | ||
| 54 | <tr> | ||
| 55 | <th></th> | ||
| 56 | <td> | ||
| 57 | #if($request.appname) | ||
| 58 | <input name="appname" type="hidden" value="${escapetool.xml($request.appname)}" /> | ||
| 59 | #end | ||
| 60 | #if($request.className) | ||
| 61 | <input name="className" type="hidden" value="${escapetool.xml($request.className)}" /> | ||
| 62 | #end | ||
| 63 | <input type="submit" value="$services.localization.render("awm.statistics.continue")" class="button" /> | ||
| 64 | </td> | ||
| 65 | </tr> | ||
| 66 | </tbody> | ||
| 67 | </table> | ||
| 68 | </form> | ||
| 69 | {{/html}} | ||
| 70 | |||
| 71 | #if($request.property) | ||
| 72 | {{awmchart type="${request.type}" #if($request.appname)app="${appDoc.space}"#end #if($request.className)className="${className}"#end category="${request.property}" function="$!{request.function}" aggregate="$!{request.aggregate}" aggregateFunction="$!{request.aggregateFunction}"/}} | ||
| 73 | |||
| 74 | $services.localization.render("awm.statistics.insert") | ||
| 75 | {{{ | ||
| 76 | {{awmchart type="${request.type}" #if($request.appname)app="${appDoc.space}"#end #if($request.className)className="${className}"#end category="${request.property}" function="$!{request.function}" aggregate="$!{request.aggregate}" aggregateFunction="$!{request.aggregateFunction}" /}} | ||
| 77 | }}} | ||
| 78 | |||
| 79 | #end | ||
| 80 | #elseif($request.showClasses) | ||
| 81 | #set($list = $xwiki.classList) | ||
| 82 | {{html}} | ||
| 83 | <form action=""> | ||
| 84 | $services.localization.render("awm.statistics.chooseclass") <select name="className"> | ||
| 85 | #foreach($className in $list) | ||
| 86 | <option value="${escapetool.xml($className)}">${className}</option> | ||
| 87 | #end | ||
| 88 | </select> | ||
| 89 | <input type="submit" value="$services.localization.render("awm.statistics.continue")" class="button" /> | ||
| 90 | </form> | ||
| 91 | {{/html}} | ||
| 92 | #else | ||
| 93 | #set($list = $services.query.xwql("from doc.object(AppWithinMinutes.LiveTableClass) as obj order by doc.title").execute()) | ||
| 94 | {{html}} | ||
| 95 | <form action=""> | ||
| 96 | $services.localization.render("awm.statistics.chooseapp") <select name="appname"> | ||
| 97 | #foreach($appname in $list) | ||
| 98 | <option value="${escapetool.xml($appname)}">${xwiki.getDocument($appname).getDisplayTitle()}</option> | ||
| 99 | #end | ||
| 100 | </select> | ||
| 101 | <input type="submit" value="$services.localization.render("awm.statistics.continue")" class="button" /> | ||
| 102 | </form> | ||
| 103 | {{/html}} | ||
| 104 | |||
| 105 | [[$services.localization.render("awm.statistics.showclasses")>>||queryString="showClasses=1"]] | ||
| 106 | #end | ||
| 107 | {{/velocity}} |