]> code.citadel.org Git - citadel.git/blobdiff - webcit/vcard_edit.c
fix vcard sorting and tabs
[citadel.git] / webcit / vcard_edit.c
index 0807f4862372aa98c74dbec221514532b6482774..f94841f9ac7caf062ec408cf5d4f93f50a9101d9 100644 (file)
@@ -985,7 +985,7 @@ void do_addrbook_view(vcardview_struct* VS) {
        }
 
        if (num_ab > 1) {
-               ///SortByHashKey(VS->addrbook, 0);
+               SortByHashKey(VS->addrbook, 1);
        }
 
        num_pages = (GetCount(VS->addrbook) / NAMESPERPAGE) + 1;
@@ -1012,12 +1012,13 @@ void do_addrbook_view(vcardview_struct* VS) {
                if (GetHashAt(VS->addrbook, tabfirst, &hklen1, &c1, &v1)) {
                        a1 = (addrbookent*) v1;
                        StrBufAppendBuf(headline, a1->name, 0);
-
+                       StrBuf_Utf8StrCut(headline, 3);
                        if (GetHashAt(VS->addrbook, tablast, &hklen2, &c2, &v2)) {
 
                                a2 = (addrbookent*) v2;
                                StrBufAppendBufPlain(headline, HKEY(" - "), 0);
                                StrBufAppendBuf(headline, a2->name, 0);
+                               StrBuf_Utf8StrCut(headline, 9);
                        }
                }
                tablabels[i] = headline;
@@ -1028,23 +1029,9 @@ void do_addrbook_view(vcardview_struct* VS) {
 
        DoTemplate(HKEY("vcard_list"), WCC->WBuf, &SubTP);
        UnStackContext(&SubTP);
-       /* Placeholders for empty columns at end */
-       if ((num_ab % 4) != 0) {
-               for (i=0; i<(4-(num_ab % 4)); ++i) {
-                       do_template("vcard_list_cell_end");
-               }
-       }
-       
-       do_template("vcard_list_section_end");
-       end_tab((num_pages-1), num_pages);
-
-       begin_tab(num_pages, num_pages);
-       /* FIXME there ought to be something here */
-       end_tab(num_pages, num_pages);
-
        DeleteHash(&headlines);
        free(tablabels);
-       wDumpContent(1);
+       StrBufAppendBufPlain(WCC->WBuf, HKEY("</div>"), 0);/* closes: id=global */
 }