diff --git a/ajax/editname.php b/ajax/editname.php index c7a7bcde..31bdd125 100644 --- a/ajax/editname.php +++ b/ajax/editname.php @@ -17,13 +17,10 @@ function bailOut($msg) { function debug($msg) { OC_Log::write('contacts','ajax/editname.php: '.$msg, OC_Log::DEBUG); } -foreach ($_GET as $key=>$element) { - debug('_GET: '.$key.'=>'.$element); -} $tmpl = new OC_TEMPLATE("contacts", "part.edit_name_dialog"); -$id = $_GET['id']; +$id = isset($_GET['id'])?$_GET['id']:''; if($id) { $vcard = OC_Contacts_App::getContactVCard($id); $name = array('', '', '', '', ''); diff --git a/js/contacts.js b/js/contacts.js index bd01e385..34210a45 100644 --- a/js/contacts.js +++ b/js/contacts.js @@ -363,8 +363,6 @@ Contacts={ //Contacts.UI.notImplemented(); //return false; this.id = ''; this.fn = ''; this.fullname = ''; this.givname = ''; this.famname = ''; this.addname = ''; this.honpre = ''; this.honsuf = ''; - - $.getJSON('ajax/newcontact.php',{},function(jsondata){ if(jsondata.status == 'success'){ id = ''; @@ -379,6 +377,7 @@ Contacts={ }); }, add:function(n, fn, aid){ // add a new contact + console.log('Add contact: ' + n + ', ' + fn + ' ' + aid); $.post(OC.filePath('contacts', 'ajax', 'addcontact.php'), { n: n, fn: fn, aid: aid }, function(jsondata) { if (jsondata.status == 'success'){ @@ -554,6 +553,7 @@ Contacts={ }, editName:function(){ var isnew = (this.id == ''); + /* Initialize the name edit dialog */ if($('#edit_name_dialog').dialog('isOpen') == true){ $('#edit_name_dialog').dialog('moveToTop'); }else{ // TODO: If id=='' call addcontact.php (or whatever name) instead and reload view with id. @@ -1035,18 +1035,6 @@ $(document).ready(function(){ */ $('#contacts_newcontact').click(function(){ Contacts.UI.Card.editNew(); -// $.getJSON('ajax/addcontact.php',{},function(jsondata){ -// if(jsondata.status == 'success'){ -// $('#rightcontent').data('id',''); -// $('#rightcontent').html(jsondata.data.page) -// .find('select').chosen(); -// } -// else{ -// Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message); -// //alert(jsondata.data.message); -// } -// }); -// return false; }); /** @@ -1071,7 +1059,7 @@ $(document).ready(function(){ }); /** - * Delete currently selected contact and TODO: clear page + * Delete currently selected contact TODO: and clear page */ $('#contacts_deletecard').live('click',function(){ Contacts.UI.Card.delete();