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.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
21 extern IcalEnumMap icalproperty_kind_map[];
23 HashList *IcalComponentMap = NULL;
26 void SortPregetMatter(HashList *Cals)
32 IcalEnumMap *SortMap[10];
35 const char *Next = NULL;
36 const StrBuf *SortVector;
41 SortVector = SBSTR("ICALSortVec");
42 if (SortVector == NULL)
45 for (i = 0; i < 10; i++) SortMap[i] = NULL;
47 while (StrBufExtract_NextToken(SortBy, SortVector, &Next, ':') > 0) {
48 GetHash(IcalComponentMap, SKEY(SortBy), &vSort);
49 Map = (IcalEnumMap*) vSort;
59 switch (SortMap[i - 1]->map) {
66 It = GetNewHashPos(Cals, 0);
67 while (GetNextHashPos(Cals, It, &KLen, &Key, &vCal)) {
69 Cal = (disp_cal*) vCal;
70 Cal->Status = icalcomponent_get_status(Cal->cal);
71 Cal->SortBy = Cal->cal;
74 while ((SortMap[i] != NULL) &&
75 (Cal->SortBy != NULL))
77 /****Cal->SortBy = icalcomponent_get_first_property(Cal->SortBy, SortMap[i++]->map); */
84 void tmplput_ICalItem(StrBuf *Target, WCTemplputParams *TP)
89 void CreateIcalComponendKindLookup(void)
93 IcalComponentMap = NewHash (1, NULL);
94 while (icalproperty_kind_map[i].NameLen != 0) {
95 RegisterNS(icalproperty_kind_map[i].Name,
96 icalproperty_kind_map[i].NameLen,
102 Put(IcalComponentMap,
103 icalproperty_kind_map[i].Name,
104 icalproperty_kind_map[i].NameLen,
105 &icalproperty_kind_map[i],
106 reference_free_handler);
129 InitModule_ICAL_SUBST
132 CreateIcalComponendKindLookup ();
137 ServerShutdownModule_ICAL
140 DeleteHash(&IcalComponentMap);