Afficher les derniers auteurs
1 {{velocity clean="false"}}
2
3 {{html wiki="true" clean="false"}}
4
5 {{include document="MMCode.MeetingManagerMacros"/}}
6
7 #set($meetingSpace="${doc.web}") ##TODO take this out at to the including sheet.
8 #set($cycle = $doc.getObject("MMCode.MeetingCycleClass"))
9 #if(!$cycle)
10 #warning("This document must be applied to meeting cycles pages.")
11 #else
12 #set($ok = $xwiki.ssx.use("MMCode.MeetingManager"))
13 #set($ok = $xwiki.jsx.use("MMCode.MeetingManager"))
14 #set($ok = $xwiki.jsx.use("XWiki.ModalBox"))
15 #set($ok = $xwiki.ssx.use("XWiki.ModalBox"))
16 #set($showattachments = "no")
17 #set($showcomments = "no")
18 #set($showhistory = "no")
19 #set($showinformation = "no")
20 #set($ok = $xwiki.jsx.use("XWiki.DatePickerExtension"))
21 #set($ok = $xwiki.ssx.use("XWiki.DatePickerExtension"))
22
23 = Cycle <em>$cycle.get('name')</em> =
24
25 #if($context.action=="inline")<div id="meetingcycleedit">#end
26 <div class="cycleinfos"><div class="cyclefreq">
27 **$msg.get('meetings.cycle.frequency')** <p> $cycle.get('frequency')</p></div>
28
29 <div class="cycledesc">
30 **$msg.get('meetings.cycle.description')** $cycle.get('description')</div>
31 #if($context.action=="inline")</div>#end
32
33 #if($context.action == "view")
34 #if($hasEdit)
35 <div id="newmeetingform" class="hidden">
36 ## <form action="" id="newdoc" method="post">
37 <div>
38 <input type="hidden" name="parent" value="${doc.web}.WebHome" />
39 #set($lm = $xwiki.searchDocuments(", BaseObject as meeting, BaseObject cycleitem, StringProperty as cycle, DateProperty as date where meeting.name=doc.fullName and meeting.className='MMCode.MeetingClass' and cycleitem.className='MMCode.MeetingCycleItemClass' and cycleitem.name=doc.fullName and cycle.id.id=cycleitem.id and cycle.id.name='cycle' and cycle.value='$doc.fullName' and date.id.id=meeting.id and date.id.name='date' order by date.value desc", 1, 0))
40 ##set($count = $xwiki.countDocuments(", BaseObject as meeting, BaseObject cycleitem, StringProperty as cycle, DateProperty as date where meeting.name=doc.fullName and meeting.className='MMCode.MeetingClass' and cycleitem.className='MMCode.MeetingCycleItemClass' and cycleitem.name=doc.fullName and cycle.id.id=cycleitem.id and cycle.id.name='cycle' and cycle.value='$doc.fullName' and date.id.id=meeting.id and date.id.name='date'"))
41 #if($lm.size() > 0)
42 #set($lastmeeting = $listtool.get($lm, 0))
43 #set($lastmeetingobj = $xwiki.getDocument($lastmeeting).getObject("MMCode.MeetingClass"))
44 #set($lastdate = $lastmeetingobj.getProperty('date').value)
45 <div id="lastmeeting" class="infomessage">
46 $msg.get('meetings.cycle.lastmeeting')
47 <div style="margin-top:15px;">
48 <em>$msg.get('meetings.cycle.lastname') </em>
49 $xwiki.getDocument($lastmeeting).displayTitle
50 </div>
51 <div>
52 <em>$msg.get('meetings.cycle.lastdate') </em>
53 **$datetool.format("dd/MM/yyyy", $lastdate)**
54 ($msg.get('meetings.cycle.laststatus') **$lastmeetingobj.display('status','view')**)</div>
55 </div>
56 <input type="hidden" name="template" class="template" value="$lastmeeting" />
57 #set($frequency = $cycle.getProperty('frequency').value)
58 #if("$!frequency" == "") #set($frequency = "weekly") #end
59 #set($mdt = $xwiki.jodatime.getMutableDateTime($mathtool.add(1900, $lastdate.year), $mathtool.add($lastdate.month, 1), $lastdate.date, $lastdate.hours, $lastdate.minutes, $lastdate.seconds, 0))
60 #if($frequency=="bimonthly") #set($ok = $mdt.addDays(14))
61 #elseif($frequency=="monthly") #set($ok = $mdt.addMonths(1))
62 #elseif($frequency=="quarterly") #set($ok = $mdt.addMonths(3))
63 #elseif($frequency=="yearly") #set($ok = $mdt.addYears(1))
64 #else ##weekly
65 #set($ok = $mdt.addDays(7))
66 #end
67 #set($sdate = $xwiki.jodatime.getDateTimeFormatterForPattern("yyyy/MM/dd").print($mdt))
68 <div id="nextmeeting" class="infomessage">
69 <div style="margin-bottom:20px;">**$msg.get('meetings.cycle.nextmeeting')** </div>
70 <div>
71 $msg.get('meetings.cycle.nextname')
72 <input type="text" autocomplete="off" value="$cycle.get('name') ${sdate}" id="nextmeetingname" name="nextmeetingdate" class="title" size="50"/>
73 <input type="hidden" name="name" class="clean" value="$util.clearName($cycle.get('name'))${sdate}"/>
74 </div>
75 <div style="color:grey;padding:5px;">
76 <div>$msg.get('meetings.dashboard.urlwillbe')</div>
77 <div><span class="url">$doc.getExternalURL('view')<span></div>
78 #help("$msg.get('meetings.dashboard.pickpagenamehelp')")
79 </div>
80 <div style="margin-top:10px;">
81 $msg.get('meetings.cycle.nextdate')
82 <input type="text" value="$datetool.format("dd/MM/yyyy", $mdt.toDate())" id="nextmeetingdate" class="date"/>
83 <img src="$xwiki.getDocument('MMCode.MeetingManager').getAttachmentURL('calendar.gif')" />
84 ($msg.get("meetings.cycle.${frequency}.fromlast"))
85 </div>
86 <div style="margin-top:20px;">
87 <span class="buttonwrapper"><button id="docreatenextmeeting">$msg.get('meetings.cycle.submitcreate')</button></span>
88 </div>
89 </div>
90 #else
91 No last meeting found
92 #end
93 </div>
94 ## </form>
95 </div>
96
97 #if("$!cycle.get('frequency')" != "")
98 <div align="right">
99 <span class="buttonwrapper">
100 <button id="createnextmeeting" title="$msg.get('meetings.dashboard.createnewmeeting')" />
101 $msg.get('meetings.cycle.createnextmeeting')
102 </button>
103 </span>
104 </div>
105 #end
106 </div>
107
108 {{html wiki="false"}}
109 <script type="text/javascript">
110
111 function createNextMeeting(){
112 var title = $('MB_content').down(".title").value;
113 var name = $('MB_content').down(".clean").value;
114 var date = $('MB_content').down(".date").value;
115 var template = $('MB_content').down(".template").value;
116 if(name.strip() == "") {
117 alert("Le nom de la prochaine reunion ne peut etre vide");
118 return;
119 }
120 else {
121 var url = "$xwiki.getDocument('MMCode.MeetingManagerService').getURL('view','xpage=plain&service=nextmeeting')";
122 url += ("&title=" + title + "&name=$meetingSpace." + name + "&date=" + date + "&template=" + template);
123 var ajx = new Ajax.Request(url, {
124 onComplete: function(transport) {
125 window.location = transport.responseText;
126 /*
127 if(!transport.responseText.match(/^http:.*$/)) {
128 alert(transport.responseText);
129 }
130 else {
131 window.location = transport.responseText;
132 }
133 */
134 }
135 });
136 }
137 }
138 Event.observe($('createnextmeeting'), "click", function(){
139 Modalbox.show($('newmeetingform').down("div"), {
140 autoFocusing: false,
141 title: this.title,
142 overlayClose: false,
143 width:800,
144 afterLoad: function() {
145 var p = new PageCreator($('MB_content'), "$xwiki.getDocument("${doc.web}.WebHome").getExternalURL('view')");
146 p.updateURL();
147 new DatePicker({
148 relative:$('MB_frame').down("input.date"),
149 language:"$context.language",
150 zindex:10000,
151 enableCloseOnBlur:true
152 });
153 $('MB_content').down("button").observe("click", createNextMeeting);
154 }
155 });
156 });
157 </script>
158 {{/html}}
159 #end
160 #end
161 #end
162 {{/html}}
163 {{/velocity}}
164
165 {{velocity clean="false"}}
166 #if("$!context.action" == "view")
167 #set($collist = [ "doc.title", "date", "doc.creator", "location", "status" ])
168 #set($colprops = {"doc.title" : {"type" : "text", "size" : "20", "link": "view"},
169 "doc.creator" : {"type":"text", "size" : "10"} ,
170 "location" : {"type" : "text", "size" : "10"},
171 "date" : {"type" : "text", "size" : "10", "link": "view"},
172 "status" : {"type" : "list", "size" : "1"}
173 })
174 ## id of the div, list of columns, columns properties, default column to sort for, class name
175 #set($className = "MMCode.MeetingClass")
176 #set($transprefix="meetings.cycle.table.")
177 #set($dataurl = $xwiki.getURL('MMCode.MeetingCycleResults','view',"xpage=plain&outputSyntax=plain&cycle=$doc.fullName"))
178 #set($collist2 = "")
179 #set($classparams = "")
180 #foreach($colname in $collist)
181 #set($collist2 = "${collist2},${colname}")
182 #set($propClassName = "")
183 #set($propClassName = $colprops.get($colname).get("class"))
184 #if($propClassName!="")
185 #set($classparams = "${classparams}&${colname}_class=${propClassName}")
186 #end
187 #end
188 #set($collist2 = $collist2.substring(1))
189 #set($dataurl = "${dataurl}&transprefix=meetings.dashboard.grid.&classname=${className}&collist=${collist2}${classparams}")
190
191 {{html wiki=true clean=false}}
192 #livetable("meetingsgrid" $collist $colprops {
193 "selectedColumn":"doc.creationDate",
194 "defaultOrder":"desc",
195 "translationPrefix":"meetings.dashboard.grid.",
196 "className":"MMCode.MeetingClass",
197 "rowCount": 10,
198 "tagCloud": true,
199 "url":"$dataurl"
200 })
201 {{/html}}
202 #end
203
204 {{/velocity}}