wprintf("</TD></TR>\n");
- /*
- * If this is an all-day-event, set the end time to be identical to
- * the start time (the hour/minute/second will be set to midnight).
- * Otherwise extract or create it.
- */
wprintf("<TR><TD><B>");
wprintf(_("End"));
wprintf("</B></TD><TD id=\"dtendcell\">\n");
- if (t_start.is_date) {
- t_end = t_start;
+ p = icalcomponent_get_first_property(vevent,
+ ICAL_DTEND_PROPERTY);
+ if (p != NULL) {
+ t_end = icalproperty_get_dtend(p);
+
+ /*
+ * If this is an all-day-event, the end time is set to real end
+ * day + 1, so we have to adjust accordingly.
+ */
+ if (t_start.is_date) {
+ icaltime_adjust(&t_end, -1, 0, 0, 0);
+ }
}
else {
- p = icalcomponent_get_first_property(vevent,
- ICAL_DTEND_PROPERTY);
- if (p != NULL) {
- t_end = icalproperty_get_dtend(p);
+ /*
+ * If this is an all-day-event, set the end time to be identical to
+ * the start time (the hour/minute/second will be set to midnight).
+ * Otherwise extract or create it.
+ */
+ if (t_start.is_date) {
+ t_end = t_start;
}
else {
/*
icalproperty_free(prop);
}
- if (all_day_event == 0) {
+ if (all_day_event) {
+ icaltime_from_webform_dateonly(&t, "dtend");
+
+ /* with this field supposed to be non-inclusive we have to add one day */
+ icaltime_adjust(&t, 1, 0, 0, 0);
+ }
+ else {
icaltime_from_webform(&t, "dtend");
- icalcomponent_add_property(vevent,
- icalproperty_new_dtend(icaltime_normalize(t)
- )
- );
}
+ icalcomponent_add_property(vevent,
+ icalproperty_new_dtend(icaltime_normalize(t)
+ )
+ );
+
/* recurrence rules -- begin */
/* remove any existing rule */
(WCC->is_mailbox) ));
}
+int ConditionalIsRoomtype(StrBuf *Target, WCTemplputParams *TP)
+{
+ wcsession *WCC = WC;
+
+ if ((WCC == NULL) ||
+ (TP->Tokens->nParameters < 3) ||
+ (TP->Tokens->Params[2]->Type != TYPE_STR)||
+ (TP->Tokens->Params[2]->len < 7))
+ return 0;
+
+ switch(WCC->wc_view) {
+ case VIEW_BBS:
+ return TP->Tokens->Params[2]->Start[7]=='B';
+ case VIEW_MAILBOX:
+ return TP->Tokens->Params[2]->Start[7]=='M';
+ case VIEW_ADDRESSBOOK:
+ return TP->Tokens->Params[2]->Start[7]=='A';
+ case VIEW_TASKS:
+ return TP->Tokens->Params[2]->Start[7]=='T';
+ case VIEW_NOTES:
+ return TP->Tokens->Params[2]->Start[7]=='N';
+ case VIEW_WIKI:
+ return TP->Tokens->Params[2]->Start[7]=='W';
+ case VIEW_JOURNAL:
+ return TP->Tokens->Params[2]->Start[7]=='J';
+
+ case VIEW_CALENDAR:
+ if (TP->Tokens->Params[2]->len < 13)
+ return 0;
+ return TP->Tokens->Params[2]->Start[10]=='E';
+
+ case VIEW_CALBRIEF:
+ if (TP->Tokens->Params[3]->len < 13)
+ return 0;
+ return TP->Tokens->Params[2]->Start[10]=='B';
+
+ default:
+ return 0;
+ }
+}
+
void
InitModule_ROOMOPS
(void)
WebcitAddUrlHandler(HKEY("json_roomflr"), jsonRoomFlr, 0);
RegisterNamespace("ROOMBANNER", 0, 1, tmplput_roombanner, 0);
+ RegisterConditional(HKEY("COND:ROOM:TYPE_IS"), 0, ConditionalIsRoomtype, CTX_NONE);
RegisterConditional(HKEY("COND:ROOM:FLAGS:QR_PERMANENT"), 0, ConditionalRoomHas_QR_PERMANENT, CTX_NONE);
RegisterConditional(HKEY("COND:ROOM:FLAGS:QR_INUSE"), 0, ConditionalRoomHas_QR_INUSE, CTX_NONE);
RegisterConditional(HKEY("COND:ROOM:FLAGS:QR_PRIVATE"), 0, ConditionalRoomHas_QR_PRIVATE, CTX_NONE);
}
};
req.send(null); */
- window.location = "/mobilemsg/"+msgnum+"?Mail=1";
+ window.location = "/mobilemsg/"+msgnum;
}
function CtdlHideMsg() {
currentMsgDisplay.style.display = "none";
unmarkAllRows();
markedRowId = parent.ctdlRowId;
document.getElementById("preview_pane").innerHTML = "";
- new Ajax.Updater('preview_pane', 'msg/'+msgId+'?Mail=1', {method: 'get'});
+ new Ajax.Updater('preview_pane', 'msg/'+msgId, {method: 'get'});
markRow(parent);
new Ajax.Request('ajax_servcmd', {
method: 'post',
<?!("COND:MAIL:SUBJ", 7)><p class="message_subject"><?_("Subject:")> <?MAIL:SUMM:SUBJECT></p><??("X", 7)>
<p style="visibility: hidden;" id="msg<?MAIL:SUMM:N>" class="msgbuttons">
- <?!("COND:BSTR", 8, "Mail")>
+ <??("COND:ROOM:TYPE_IS", 8, "VIEW_BBS")>
<a href="display_enter?recp=%22<?MAIL:SUMM:FROM("U")>%22%3C<?MAIL:SUMM:RFCA("U")>%3E&references=<?MAIL:SUMM:INREPLYTO("U")>%3C<?MAIL:SUMM:RFCA("U")>%3E&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re:%20", "Re:")>"><span>[</span><?_("Reply")><span>]</span></a>
<a href="display_enter?recp=%22<?MAIL:SUMM:FROM("U")>%22%3C<?MAIL:SUMM:RFCA("U")>%3E%2C<?MAIL:SUMM:ALLRCPT("U")>&references=<?MAIL:SUMM:INREPLYTO("U")>%3C<?MAIL:SUMM:RFCA("U")>%3E&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re:%20", "Re:")>"><span>[</span><?_("ReplyAll")><span>]</span></a>
<a href="display_enter?fwdquote=<?MAIL:SUMM:N>&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Fwd:%%20", "Fwd:")>"><span>[</span><?_("Forward")><span>]</span></a>
<??("X", 8)>
- <??("COND:BSTR", 9, "Mail")>
+ <?!("COND:ROOM:TYPE_IS", 9, "VIEW_BBS")>
<a href="display_enter?recp=%22<?MAIL:SUMM:FROM("U")>%22%3C<?MAIL:SUMM:RFCA("U")>%3E&references=<?MAIL:SUMM:INREPLYTO("U")>%3C<?MAIL:SUMM:RFCA("U")>%3E&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re:%20", "Re:")>"><span>[</span><?_("Reply")><span>]</span></a>
<a href="display_enter?replyquote=<?MAIL:SUMM:N>&recp=%22<?MAIL:SUMM:FROM("U")>%22%3C<?MAIL:SUMM:RFCA("U")>%3E&references=<?MAIL:SUMM:INREPLYTO("U")>%3C<?MAIL:SUMM:RFCA("U")>%3E&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re:%%20", "Re:")>"><span>[</span><?_("ReplyQuoted")><span>]</span></a>
<?!("X", 9)>
<a href="confirm_move_msg?msgid=<?MAIL:SUMM:N>"><span>[</span><?_("Move")><span>]</span></a>
+<?!("COND:ROOM:EDITACCESS", 10)>
<a href="delete_msg?msgid=<?MAIL:SUMM:N>" onclick="return confirm('<?_("Delete this message?")>');"><span>[</span><?_("Delete")><span>]</span> </a>
+<??("X", 10)>
<a href="#" onclick="window.open('msgheaders/<?MAIL:SUMM:N>', 'headers<?MAIL:SUMM:N>', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=400'); "><span>[</span><?_("Headers")><span>]</span></a>
<a href="#" onclick="window.open('printmsg/<?MAIL:SUMM:N>', 'print<?MAIL:SUMM:N>', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=400'); "><span>[</span><?_("Print")><span>]</span></a>
</p>
}
function eventEditAllDay() {
var allDayCheck = document.getElementById("alldayevent");
- var dtend = document.getElementById("dtendcell");
+ var dtend_time = document.getElementById("dtend_time");
var dtstart_time = document.getElementById("dtstart_time");
if(allDayCheck.checked) {
dtstart_time.style.visibility = "hidden";
- dtend.style.visibility = "hidden";
+ dtend_time.style.visibility = "hidden";
} else {
dtstart_time.style.visibility = "visible";
- dtend.style.visibility = "visible";
+ dtend_time.style.visibility = "visible";
}
}