Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Nov 2012 13:24:30 +0000 (14:24 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Nov 2012 13:24:30 +0000 (14:24 +0100)
webcit/ical_subst.c
webcit/messages.c
webcit/static/t/ical/attachment/display.html
webcit/static/t/ical/attachment/display_conflict.html [new file with mode: 0644]
webcit/subst.c

index bd44e42b96fea2efc126a8c9038b99876c894398..db30c668971f0292cd48bb3ab814c6eda431b095 100644 (file)
@@ -558,7 +558,7 @@ InitModule_ICAL_SUBST
 
 
         RegisterIterator("ICAL:CONFLICT", 0, NULL, iterate_FindConflict, 
-                         NULL, NULL, CTX_MIME_ATACH, CTX_ICALCONFLICT, IT_NOFLAG);
+                         NULL, DeleteHash, CTX_MIME_ATACH, CTX_ICALCONFLICT, IT_NOFLAG);
        RegisterNamespace("ICAL:CONFLICT:MSGID", 0, 1, tmplput_ConflictEventMsgID, NULL, CTX_ICALCONFLICT);
        RegisterNamespace("ICAL:CONFLICT:EUID", 0, 1, tmplput_ConflictEUID, NULL, CTX_ICALCONFLICT);
        RegisterNamespace("ICAL:CONFLICT:SUMMARY", 0, 1, tmplput_ConflictSummary, NULL, CTX_ICALCONFLICT);
@@ -567,7 +567,7 @@ InitModule_ICAL_SUBST
 
        RegisterCTX(CTX_ICALATTENDEE);
         RegisterIterator("ICAL:ATTENDEES", 0, NULL, iterate_get_ical_attendees, 
-                         NULL, NULL, CTX_ICALATTENDEE, CTX_ICAL, IT_NOFLAG);
+                         NULL, DeleteHash, CTX_ICALATTENDEE, CTX_ICAL, IT_NOFLAG);
        RegisterNamespace("ICAL:ATTENDEE", 1, 2, tmplput_ICalAttendee, NULL, CTX_ICALATTENDEE);
        RegisterConditional("COND:ICAL:ATTENDEE", 1, cond_ICalAttendeeState, CTX_ICALATTENDEE);
 
@@ -593,28 +593,3 @@ ServerShutdownModule_ICAL
 {
        DeleteHash(&IcalComponentMap);
 }
-
-
-
-/*
-                       if (is_update) {
-                               snprintf(conflict_message, sizeof conflict_message,
-                                        _("This is an update of '%s' which is already in your calendar."), conflict_name);
-                       }
-                       else {
-                               snprintf(conflict_message, sizeof conflict_message,
-                                        _("This event would conflict with '%s' which is already in your calendar."), conflict_name);
-                       }
-
-                       StrBufAppendPrintf(Target, "<dt>%s",
-                                          (is_update ?
-                                           _("Update:") :
-                                           _("CONFLICT:")
-                                                  )
-                               );
-                       StrBufAppendPrintf(Target, "</dt><dd>");
-                       StrEscAppend(Target, NULL, conflict_message, 0, 0);
-                       StrBufAppendPrintf(Target, "</dd>\n");
-                       }
-               }
-/*/
index 3f8108f0a97c54511b4f97df414caec04346b535..6da0b55aa1a97b37df63fc990ab813c185ea9237 100644 (file)
@@ -192,6 +192,9 @@ int read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, co
        WCTemplputParams SubTP;
        StrBuf *Error = NULL;
 
+       memset(&SuperTP, 0, sizeof(WCTemplputParams));
+       memset(&SubTP, 0, sizeof(WCTemplputParams));
+
        Buf = NewStrBuf();
        FoundCharset = NewStrBuf();
        Msg = (message_summary *)malloc(sizeof(message_summary));
@@ -217,7 +220,6 @@ int read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, co
                /* Locate a renderer capable of converting this MIME part into HTML */
                if (GetHash(MimeRenderHandler, SKEY(Buf), &vHdr) &&
                    (vHdr != NULL)) {
-                       WCTemplputParams SubTP;
                        RenderMimeFuncStruct *Render;
                        
                        StackContext(&SuperTP, &SubTP, Msg->MsgBody, CTX_MIME_ATACH, 0, NULL);
index 24f506759ad9c78a3e4d4ad659692cd5127d0f6c..8f7fba401ef212056c0c88e5a3404da3ea69f987 100644 (file)
@@ -1,4 +1,3 @@
-
 <div class="mimepart">
 
 <div id="rsvp<?BSTR("divname")>_title">
@@ -48,7 +47,7 @@
 
 <?--("If this is a REQUEST, display conflicts and buttons")>
 <?!("COND:ICAL:METHOD", 110, #"ICAL_METHOD_REQUEST")>
-<?ICAL:SERV:CHECK:CONFLICT()>
+<?ITERATE("ICAL:CONFLICT", ="ical_attachment_display_conflict")>
 <?--("Display the Accept/Decline buttons")>
 <p id="rsvp<?BSTR("divname")>_question">
 <?_("How would you like to respond to this invitation?")>
diff --git a/webcit/static/t/ical/attachment/display_conflict.html b/webcit/static/t/ical/attachment/display_conflict.html
new file mode 100644 (file)
index 0000000..47fb42a
--- /dev/null
@@ -0,0 +1,7 @@
+<dt>
+<??("ICAL:CONFLICT:IS:UPDATE", 30)><?_("Update:"  )><??("X", 30)>
+<??("ICAL:CONFLICT:IS:UPDATE", 40)><?_("CONFLICT:")><??("X", 40)>
+</dt><dd>
+<??("ICAL:CONFLICT:IS:UPDATE", 10)><?_("This is an update of"          )> '<?ICAL:CONFLICT:SUMMARY("X")>' <?_("which is already in your calendar.")><??("X", 10)>
+<?!("ICAL:CONFLICT:IS:UPDATE", 20)><?_("This event would conflict with")> '<?ICAL:CONFLICT:SUMMARY("X")>' <?_("which is already in your calendar.")><?!("X", 20)>
+</dd>
index 6f85d04cd28b0bfca2d53aded61cf200af144732..c3b094874778772db7758442a2e70036e6c8cf2b 100644 (file)
@@ -163,6 +163,8 @@ void StackDynamicContext(WCTemplputParams *Super,
                Sub->Sub = Super->Sub;
                Super->Sub = Sub;
        }
+       if (Sub->Sub != NULL)
+               Sub->Sub->Super = Sub;
        Sub->Super = Super;
        
        Sub->Context = Context;
@@ -179,6 +181,10 @@ void UnStackContext(WCTemplputParams *Sub)
        {
                Sub->Super->Sub = Sub->Sub;
        }
+       if (Sub->Sub != NULL)
+       {
+               Sub->Sub->Super = Sub->Super;
+       }
 }
 void UnStackDynamicContext(StrBuf *Target, WCTemplputParams **TPP)
 {
@@ -315,9 +321,6 @@ void LogTemplateError (StrBuf *Target, const char *Type, int ErrorPos, WCTemplpu
 */
 }
 
-
-
-
 void LogError (StrBuf *Target, const char *Type, const char *Format, ...)
 {
        wcsession *WCC;
@@ -392,7 +395,7 @@ int CheckContext(StrBuf *Target, ContextFilter *Need, WCTemplputParams *TP, cons
                        return 1;
 
                 LogTemplateError(
-                        Target, ErrType, ERR_PARM1, TP,
+                        Target, ErrType, ERR_NAME, TP,
                        "  WARNING: requires Context: [%s], have [%s]!", 
                        ContextName(Need->ContextType), 
                        ContextName(TP->Filter.ContextType));
@@ -2254,10 +2257,12 @@ int EvaluateConditional(StrBuf *Target, int Neg, int state, WCTemplputParams **T
        res = Cond->CondF(Target, TP);
        if (res == Neg)
                rc = TP->Tokens->Params[1]->lvalue;
+
        if (LoadTemplates > 5) 
                syslog(1, "<%s> : %d %d==%d\n", 
                        ChrPtr(TP->Tokens->FlatToken), 
                        rc, res, Neg);
+
        if (TP->Sub != NULL)
        {
                *TPP = TP->Sub;