Rework templating context access so contexts can be accessed through several layers
[citadel.git] / webcit / vcard_edit.c
index 9c8bd3b0c4c76b899883eb610e0df2308d633a7e..38b799316afb66916abe3d56cad3a11b82f14cfb 100644 (file)
@@ -1,19 +1,13 @@
 /*
- * Copyright (c) 1996-2011 by the citadel.org team
+ * Copyright (c) 1996-2012 by the citadel.org team
  *
  * This program is open source software.  You can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 3 of the
- * License, or (at your option) any later version.
+ * modify it under the terms of the GNU General Public License, version 3.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
 #include "webcit.h"
@@ -657,7 +651,7 @@ TODO: check for layer II
 
 void tmplput_VCARD_ITEM(StrBuf *Target, WCTemplputParams *TP)
 {
-       HashList *VC = CTX;
+       HashList *VC = CTX(CTX_VCARD);
        eVC evc;
        void *vStr;
 
@@ -1281,7 +1275,7 @@ void submit_vcard(void) {
        }
 
        Buf = NewStrBuf();
-       serv_write(HKEY("ENT0 1|||4||||||1\n"));
+       serv_write(HKEY("ENT0 1|||4\n"));
        if (!StrBuf_ServGetln(Buf) && (GetServerStatus(Buf, NULL) != 4))
        {
                edit_vcard();
@@ -1350,8 +1344,6 @@ void submit_vcard(void) {
        serv_write(HKEY("000\n"));
        free(serialized_vcard);
 
-       StrBuf_ServGetln(Buf);
-
        if (!strcmp(bstr("return_to"), "select_user_to_edit")) {
                select_user_to_edit(NULL);
        }