From 53836fa85781ea7992c4b7eff40d4690d3d2ed16 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Tue, 4 Oct 2011 21:16:48 +0200 Subject: [PATCH] Add new contact name to end of cantact list --- ajax/addcard.php | 3 +-- js/interface.js | 2 ++ lib/vcard.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ajax/addcard.php b/ajax/addcard.php index 70e0f0a8..ee955137 100644 --- a/ajax/addcard.php +++ b/ajax/addcard.php @@ -44,10 +44,9 @@ $vcard->add(new Sabre_VObject_Property('UID',OC_Contacts_VCard::createUID())); $id = OC_Contacts_VCard::add($aid,$vcard->serialize()); $details = OC_Contacts_VCard::structureContact($vcard); -$name = $details['FN'][0]['value']; $tmpl = new OC_Template('contacts','part.details'); $tmpl->assign('details',$details); $tmpl->assign('id',$id); $page = $tmpl->fetchPage(); -OC_JSON::success(array('data' => array( 'id' => $id, 'name' => $name, 'page' => $page ))); +OC_JSON::success(array('data' => array( 'id' => $id, 'page' => $page ))); diff --git a/js/interface.js b/js/interface.js index 3ec84a3c..47e9bb10 100644 --- a/js/interface.js +++ b/js/interface.js @@ -104,6 +104,8 @@ $(document).ready(function(){ if(jsondata.status == 'success'){ $('#rightcontent').data('id',jsondata.data.id); $('#rightcontent').html(jsondata.data.page); + $('#leftcontent .active').removeClass('active'); + $('#leftcontent ul').append('
  • '+jsondata.data.name+'
  • '); } else{ alert(jsondata.data.message); diff --git a/lib/vcard.php b/lib/vcard.php index 78327ab1..bff28973 100644 --- a/lib/vcard.php +++ b/lib/vcard.php @@ -246,7 +246,7 @@ class OC_Contacts_VCard{ public static function escapeSemicolons($value){ foreach($value as &$i ){ $i = implode("\\\\;", explode(';', $i)); - } unset($i); + } return implode(';',$value); }