Afficher les derniers auteurs
1 #if("$!request.xpage" != "plain")
2 #info("This is a service document for the meeting manager application")
3 #else
4 #if("$request.service" == "useravatar")
5 #includeMacros("MMCode.MeetingManagerMacros")
6 #avatar("$!request.username")
7 #elseif("$request.service" == "startmeeting")
8 #info("$msg.get('meetings.meeting.startmeeting.help')")
9 #set($meetingDoc = $xwiki.getDocument("$request.meeting"))
10 #set($meeting = $meetingDoc.getObject('MMCode.MeetingClass'))
11 #set($actionURL = $meetingDoc.getURL('save',"xredirect=$doc.getURL('view','started=1')"))
12 <form action="$actionURL">
13 <div>
14 <input type="hidden" name="MMCode.MeetingClass_0_status" value="started" />
15 <div style="margin-top:15px;" align="center">
16 <span class="buttonwrapper">
17 <input type="submit" id="dostartmeeting" value="$msg.get('meetings.meeting.dostart')" />
18 </span>
19 </div>
20 </div>
21 </form>
22 #elseif("$request.service" == "endmeeting")
23 #info("$msg.get('meetings.meeting.endmeeting.help')")
24 #set($meetingDoc = $xwiki.getDocument("$request.meeting"))
25 #set($meeting = $meetingDoc.getObject('MMCode.MeetingClass'))
26 #set($actionURL = $meetingDoc.getURL('save',"xredirect=$doc.getURL('view','closed=1')"))
27 <form action="$actionURL">
28 <div>
29 <input type="hidden" name="MMCode.MeetingClass_0_status" value="finished" />
30 <div style="margin-top:15px;" align="center">
31 <span class="buttonwrapper">
32 <input type="submit" id="doendmeeting" value="$msg.get('meetings.meeting.doend')" />
33 </span>
34 </div>
35 </div>
36 </form>
37 #elseif("$!request.service" == "makecycle")
38 #set($meetingDoc = $xwiki.getDocument("$request.meeting"))
39 #set($meeting = $meetingDoc.getObject('MMCode.MeetingClass'))
40 <div id="domakecycleform">
41 <div>
42 <div>
43 Nom de la page du cycle: <input type="text" autocomplete="off" class="title" name="cyclename" id="cycletitle" size="50"/>
44 <input type="hidden" name="name" id="cyclepagename" class="clean" value="" />
45 <div style="color:grey;padding:5px;">
46 <div>$msg.get('meetings.meeting.cycleurlwillbe')</div>
47 {pre}<div><span class="url">$xwiki.getDocument("${meetingDoc.web}.WebHome").getExternalURL('view')<span></div>{/pre}
48 </div>
49 </div>
50 <div style="margin-top:15px;" align="center">
51 <span class="buttonwrapper">
52 <button id="domakecycle">
53 $msg.get('meetings.meeting.domakecycle')
54 </button>
55 </span>
56 <span class="loading hidden" id="makecycleloading">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
57 </div>
58 </div>
59 </div>
60 #set($createURLBase = $xwiki.getDocument('MMCode.MeetingManagerService').getURL('view',"xpage=plain&service=domakecycle&meeting=$meetingDoc.fullName"))
61 <script type="text/javascript">
62 #set($url = $xwiki.getDocument("${meetingDoc.web}.WebHome").getExternalURL('view'))
63 var p = new PageCreator($('domakecycleform'), "${url}");
64 Event.observe($('domakecycle'), "click", function(){
65 if($('cyclepagename').value.strip() == "") {
66 alert("Le nom du cycle ne peut etre vide");
67 return;
68 }
69 else {
70 $('makecycleloading').removeClassName
71 new Ajax.Request("$createURLBase" + "&pagename=${meetingDoc.web}." + $F('cyclepagename') + "&cyclename=" + $F('cycletitle'),
72 {
73 onComplete: function(transport){
74 $('makecycleloading').addClassName('hidden');
75 if (!transport.responseText.match(/^http:.*/)) {
76 alert(transport.responseText);
77 }
78 else {
79 window.location = transport.responseText;
80 }
81 }
82 });
83 }
84 });
85 </script>
86 #elseif("$request.service"=="domakecycle")
87 {pre}
88 #set($meeting=$xwiki.getDocument($request.meeting))
89 #set($cycleName = $request.cyclename)
90 #set($pageName = $request.pagename)
91 #set($cycle = $xwiki.getDocument($pageName))
92 #if(!$cycle.isNew())
93 $msg.get('meetings.cycle.alreadyexists')
94 #else
95 #set($cobj = $cycle.getObject('MMCode.MeetingCycleClass', true))
96 #set($ok = $cobj.set('name',"$cycleName"))
97 #set($ok = $cycle.setContent($xwiki.getDocument('MMCode.MeetingCycleClassTemplate').content))
98 #set($ok = $cycle.save())
99 #set($cycleItem = $meeting.getObject('MMCode.MeetingCycleItemClass', true))
100 #set($ok = $cycleItem.set("cycle", $cycle.fullName))
101 #set($ok = $meeting.setMinorEdit(true))
102 #set($ok = $meeting.setComment("$msg.get('meetings.cycle.addingmeetingtocycle')"))
103 #set($ok = $meeting.save())
104 $cycle.getExternalURL('inline')
105 #end
106 {/pre}
107 #elseif("$request.service"=="nextmeeting")
108 {pre}
109 #set($template=$request.template)
110 #set($date=$request.date)
111 #set($title=$request.title)
112 #set($name=$request.name)
113 #if($xwiki.exists($name))
114 $msg.get('meetings.meeting.docalreadyexists')
115 #else
116 #set($ok = $xwiki.copyDocument($template, $name))
117 #set($newdoc=$xwiki.getDocument($name))
118 #set($meeting=$newdoc.getObject("MMCode.MeetingClass"))
119 ## set date
120 #set($ok = $meeting.set("date", $date))
121 #set($ok = $meeting.set("description", ""))
122 #set($ok = $meeting.set("minutes", ""))
123 #set($ok = $meeting.set("status", "prepared"))
124 #set($ok = $newdoc.save())
125 #foreach($p in $newdoc.getObjects("MMCode.MeetingParticipantClass"))
126 #set($ok = $p.set("participation","undecided"))
127 #set($ok = $p.set("message",""))
128 #end
129 #set($ok = $newdoc.setTitle($title))
130 #set($ok = $newdoc.save())
131 $newdoc.getExternalURL('view')
132 {/pre}
133 #end
134 #else
135 ERROR: service not found.
136 #end
137 #end