2 * Copyright (c) 1996-2012 by the citadel.org team
4 * This program is open source software. You can redistribute it and/or
5 * modify it under the terms of the GNU General Public License, version 3.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
15 extern IcalEnumMap icalproperty_kind_map[];
17 HashList *IcalComponentMap = NULL;
20 void SortPregetMatter(HashList *Cals)
26 IcalEnumMap *SortMap[10];
29 const char *Next = NULL;
30 const StrBuf *SortVector;
35 SortVector = SBSTR("ICALSortVec");
36 if (SortVector == NULL)
39 for (i = 0; i < 10; i++) SortMap[i] = NULL;
41 while (StrBufExtract_NextToken(SortBy, SortVector, &Next, ':') > 0) {
42 GetHash(IcalComponentMap, SKEY(SortBy), &vSort);
43 Map = (IcalEnumMap*) vSort;
53 switch (SortMap[i - 1]->map) {
60 It = GetNewHashPos(Cals, 0);
61 while (GetNextHashPos(Cals, It, &KLen, &Key, &vCal)) {
63 Cal = (disp_cal*) vCal;
64 Cal->Status = icalcomponent_get_status(Cal->cal);
65 Cal->SortBy = Cal->cal;
68 while ((SortMap[i] != NULL) &&
69 (Cal->SortBy != NULL))
71 /****Cal->SortBy = icalcomponent_get_first_property(Cal->SortBy, SortMap[i++]->map); */
78 void tmplput_ICalItem(StrBuf *Target, WCTemplputParams *TP)
83 void CreateIcalComponendKindLookup(void)
87 IcalComponentMap = NewHash (1, NULL);
88 while (icalproperty_kind_map[i].NameLen != 0) {
89 RegisterNS(icalproperty_kind_map[i].Name,
90 icalproperty_kind_map[i].NameLen,
97 icalproperty_kind_map[i].Name,
98 icalproperty_kind_map[i].NameLen,
99 &icalproperty_kind_map[i],
100 reference_free_handler);
123 InitModule_ICAL_SUBST
126 CreateIcalComponendKindLookup ();
131 ServerShutdownModule_ICAL
134 DeleteHash(&IcalComponentMap);