ChronoSheets ProjectArticleSheet en 0 XWiki.jvdrean XWiki.Admin XWiki.Admin 1175075622000 1190219411000 1208179968000 1.1 false XWiki.TagClass 0 input 1 tags 1 Tags 1 ,| 30 0 com.xpn.xwiki.objects.classes.StaticListClass ChronoSheets.ProjectArticleSheet 0 XWiki.TagClass #set($obj = $doc.getObject("ChronoClasses.ProjectArticleClass")) #set($bentrydoc = $doc) #set($creationDate = $xwiki.formatDate($bentrydoc.creationDate,"dd MMMM yyyy")) #if($context.action!="inline") ## ---------------------------------------------------------------------------- ## VIEW ## ---------------------------------------------------------------------------- #set($showattachments = "yes") #set($showcomments = "yes") <div id="projectlogarticle"> #if ($doc.taskcompletion == "100%") #set ($btype = "${bentrydoc.type}-complete") #else #set ($btype = $bentrydoc.type) #end <div class="rounded-title" #if (!$currentStyle) style="background-color:#eee;color:#D61385;" #else style="background-color:$currentStyle" #end > <span class="plogheaderleft" id="plogheaderleft">$msg.get($btype)</span> #if($context.action != "edit") <span id="plogbar-actions"> <a id="plogbar-edit" href="$editurl">$msg.get("edit${bentrydoc.type}")</a> #if($isXWikiAdmin || $isChronoManager || $isChronoAdmin || $context.user == $doc.creator) | <a id="deleteplogarticle" href="$doc.getURL('delete')">$msg.get("delete${bentrydoc.type}")</a> #end </span> #end </div> <div class="roundedcontent"> <div class="article_header"> <img id="plogheaderimg" src="$xwiki.getSkinFile("${btype}-large.gif")" width="32" height="32" style="float:left;margin-right:10px;" /> <div style="float:left;margin-top:-5px;"><span id="plogtype">$msg.get("$btype") </span>$msg.get("article_date") $creationDate, $msg.get("article_author") #displayUser($bentrydoc.getCreator())<br/> <span style="font-size:20px;font-weight:bold;">$doc.title</span> </div> </div> <div style="clear:both;"></div> #roundedbottom() #if ($doc.type == "task") #roundedtop() <ul class="star"> <li><strong>$msg.get("taskduedate") : </strong><span>$doc.taskduedate</span></li> <li><strong>$msg.get("taskassignee") : </strong><span>$doc.taskassignee</span></li> <li><strong>$msg.get("taskcompletion") : </strong><span id="task_completed_value">$doc.taskcompletion</span><div id="slider_container" class="slider_container"><div id="slider_track" class="slider_track"><div id="task_completed" style="width:$doc.taskcompletion;" class="task_completed"></div></div><div id="slider" style="left:$doc.taskcompletion;" class="slider" /><img id="tc_loading" class="tc_loading" src="$xwiki.getSkinFile("ajax-loader.gif")" alt="Loading" style="left:$doc.taskcompletion;" /></div></li> </ul> <div style="clear:both;"></div> #roundedbottom() {pre} <script type="text/javascript"> #set($url = "${doc.getURL('save')}?ChronoClasses.ProjectArticleClass_${obj.getNumber()}_taskcompletion=") var slider = new xwkSlider({domNode:'slider', trackNode:'slider_track', updCol:'task_completed', loading:'tc_loading', url:'$url', updHandler:updTaskCompl} ); </script> {/pre} #end #if ($doc.type == "meeting") #roundedtop() * *$msg.get("meetingstart")* : $doc.meetingstart * *$msg.get("meetingend")* : $doc.meetingend * *$msg.get("meetinglocation")* : $doc.meetinglocation <div style="width:300px;"> #displayRsvps($doc) </div> #roundedbottom() #end #set ($content = $obj.get("content")) #if ($content != "") #roundedtop() $content #roundedbottom() #end </div> #set($showcomments = "yes") <style> #xwikidata #commentscontent { border-bottom:0px; } </style> #else ## ---------------------------------------------------------------------------- ## EDIT ## ---------------------------------------------------------------------------- #roundedtitletop($msg.get("editplogelement")) ##if ($doc.display("type", "view") == "") #if ($request.type != "") ## ------------ ## creation ## ------------ #set ($type = $request.type) <input type="hidden" name="ChronoClasses.ProjectArticleClass_0_type" id="ChronoClasses.ProjectArticleClass_0_type" value="$type" /> <input type="hidden" name="comment" id="comment" value="createt${type}" /> #else ## ------------ ## edition ## ------------ #set ($type = $doc.display("type", "view")) <input type="hidden" name="comment" id="comment" value="edit${type}" /> #end <table id="projectlogarticle_edit" style="margin: 0 -5px;"> ## <tr> ## <td align="right">*$msg.get("plogarticletype") :*</td> ## <td colspan="3">$doc.display("type", "edit")</td> ## </tr> <tr><td width="80" align="right">&nbsp;</td><td colspan="3"></td></tr> <tr> <td align="right">*$msg.get("plogarticletitle") :*</td> <td colspan="3"><input type="text" value="$!doc.title" name="title" id="xwikidoctitleinput"/></td> </tr> #set($ptype = $type) <tr id="task_edit" class="#if($ptype != "task")hidden#end"> <td align="right">*$msg.get("taskassignee"):*</td> <td> <table style="width:100%"><tr> <td>$doc.display("taskassignee", "edit")</td> <td align="right">*$msg.get("taskduedate") :*</td> <td>$doc.display("taskduedate", "edit")</td> <td> <table style="width:100%"><tr id="task_completion_edit" class="#if($ptype != "task")hidden#end"> <td align="right">*$msg.get("taskcompletion") :*</td><td>$doc.display("taskcompletion", "edit")</td> </tr></table> </td> </tr></table> </td> </tr> <tr id="meeting_dates_edit" class="#if($ptype != "meeting")hidden#end"> <td align="right">*$msg.get("date") :*</td> ## ------------------------------------------------------------------------------------------------------------------------------------------ {pre} <style> .date_displayer { border: solid 1px #CCC; $style padding-left:1px; padding-right:16px; background:url($xwiki.getSkinFile("calendar.png")) center right no-repeat; } </style> {/pre} ## init ## ------------------------ #set ($svalue = $doc.getValue("meetingstart")) ##if($xwiki.chronopolys.isDate($svalue)==false) #if($doc.isNew()) #set($svalue=$xwiki.getCurrentDate()) $!svalue.setHours(8) $!svalue.setMinutes(0) #end #if($svalue.getHours() < 8 || $svalue.getHours() > 23) $!svalue.setHours(8) #end #if($svalue.getMinutes() != 0 || $svalue.getMinutes() != 15 || $svalue.getMinutes() != 30 || $svalue.getMinutes() != 45) $!svalue.setMinutes(0) #end #set($srvalue=$xwiki.formatDate($svalue,"dd/MM/yyyy HH:mm")) #set($sfvalue=$xwiki.formatDate($svalue,"dd/MM/yyyy")) #set($sfhour =$xwiki.formatDate($svalue,"HH:mm")) #set ($evalue = $doc.getValue("meetingend")) #if($doc.isNew()) #set($evalue=$xwiki.getCurrentDate()) $!evalue.setHours(18) $!evalue.setMinutes(0) #end #if($evalue.getMinutes() != 0 || $evalue.getMinutes() != 15 || $evalue.getMinutes() != 30 || $evalue.getMinutes() != 45) $!evalue.setMinutes(0) #end #if($evalue.getHours() < 8 || $evalue.getHours() > 23) $!evalue.setHours(18) #end #set($ervalue=$xwiki.formatDate($evalue,"dd/MM/yyyy HH:mm")) #set($sevalue = $xwiki.formatDate($evalue,"dd/MM/yyyy")) #set($sehour = $xwiki.formatDate($evalue,"HH:mm")) ## display date ## ------------------------ <td> <table style="width:100%"><tr> <td style="width:15%"> <nobr><span id="display_meetingday" class="date_displayer">$sfvalue</span></nobr> <input id="meetingday" type="hidden" value="$sfvalue" name="meetingday" onchange="syncInputs()" /> <input id="ChronoClasses.ProjectArticleClass_0_meetingstart" type="hidden" value="$srvalue" name="ChronoClasses.ProjectArticleClass_0_meetingstart"/> <input id="ChronoClasses.ProjectArticleClass_0_meetingend" type="hidden" value="$ervalue" name="ChronoClasses.ProjectArticleClass_0_meetingend"/> </td> ## display hours ## ------------------------ #macro(meetinghours $type $hourval) <div id="${type}hour_container"><select id="${type}hour" onchange="syncInputs()"> #set ($hourlist = ["08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23" ]) #set ($minlist = ["00", "15", "30", "45"]) #foreach ($hour in $hourlist) #foreach ($min in $minlist) #if ($hourval == "${hour}:${min}")#set($selected="selected")#else#set ($selected="")#end<option $selected>${hour}:${min}</option> #end #end </select></div> #end <td align="right" style="width:10%">*$msg.get("meetinghours") :*</td> <td> <table> <tr><td>$msg.get("meetingstart")&nbsp;&nbsp;</td><td>#meetinghours("start" $sfhour)</td><td>$msg.get("meetingend")&nbsp;&nbsp;</td><td>#meetinghours("end" $sehour)</td></tr> </table> </td> ## calendar ## ------------------------ {pre} <script type="text/javascript"> Calendar.setup( { date : new Date($svalue.getTime()), inputField : "meetingday", displayArea : "display_meetingday", daFormat : "%d/%m/%Y", ifFormat : "%d/%m/%Y" } ); function syncInputs() { var rstart = $('ChronoClasses.ProjectArticleClass_0_meetingstart'); var rend = $('ChronoClasses.ProjectArticleClass_0_meetingend'); var dinput = $('meetingday'); var shinput = $('starthour'); var ehinput = $('endhour'); rstart.value = dinput.value + ' ' + shinput.value; rend.value = dinput.value + ' ' + ehinput.value; changeMeetingsSelect(); } function changeMeetingsSelect() { var shoutput = ""; var ehoutput = ""; var selected = ""; var shinput = $('starthour'); var shdiv = $('starthour_container'); var sht = shinput.options[shinput.selectedIndex].text.split(':'); var shh = parseFloat(sht[0]); var shm = parseFloat(sht[1]); var ehinput = $('endhour'); var ehdiv = $('endhour_container'); var eht = ehinput.options[ehinput.selectedIndex].text.split(':'); var ehh = parseFloat(eht[0]); var ehm = parseFloat(eht[1]); var hourlist = ["08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"]; var minlist = ["00", "15", "30", "45"]; shoutput += '<select id="starthour" onchange="syncInputs()">'; for (var i = 0; i < hourlist.length; i++) { for (var j = 0; j < minlist.length; j++) { if (ehh >= parseFloat(hourlist[i])) { if (ehh == parseFloat(hourlist[i]) && ehm <= parseFloat(hourlist[i])) { // same hour but min lower or equal } else { if (shh == parseFloat(hourlist[i]) && shm == parseFloat(minlist[j])) { selected = "selected"; } else { selected = ""; } shoutput += "<option "+ selected + ">" + hourlist[i] + ":" + minlist[j] + "</option>"; } } } } shoutput += "</select>"; shdiv.innerHTML = shoutput; ehoutput += '<select id="endhour" onchange="syncInputs()">'; for (var i = 0; i < hourlist.length; i++) { for (var j = 0; j < minlist.length; j++) { if (parseFloat(hourlist[i]) >= shh) { if (parseFloat(hourlist[i]) == shh && parseFloat(minlist[j]) <= shm) { // same hour but min higher or equal } else { if (ehh == parseFloat(hourlist[i]) && ehm == parseFloat(minlist[j])) { selected = "selected"; } else { selected = ""; } ehoutput += "<option "+ selected + ">" + hourlist[i] + ":" + minlist[j] + "</option>"; } } } } ehoutput += "</select>"; ehdiv.innerHTML = ehoutput; } changeMeetingsSelect(); </script> {/pre} ## ------------------------------------------------------------------------------------------------------------------------------------------ </table> </td> </tr> <tr id="meeting_location_edit" class="#if($ptype != "meeting")hidden#end"> <td align="right">*$msg.get("meetinglocation") :*</td> <td>$doc.display("meetinglocation", "edit")</td> </tr> <tr id="meeting_rsvp_edit" class="#if($ptype != "meeting")hidden#end"> <td align="right">*$msg.get("meetingguests") :*</td> <td colspan="3"><div id="rsvp" style="height:auto;"></div></td> </tr> <tr> <td align="right">*$msg.get("plogarticlecontent") :*</td> <td colspan="3">$doc.display("content", "edit")</td> </tr> </table> #roundedbottom() {pre} <script type="text/javascript"> Event.observe(window, 'load', loadRsvp, false); </script> {/pre} #end