diff --git a/ajax/contactdetails.php b/ajax/contactdetails.php index 6a989c79..abec500c 100644 --- a/ajax/contactdetails.php +++ b/ajax/contactdetails.php @@ -37,10 +37,10 @@ OC_JSON::checkAppEnabled('contacts'); $l=new OC_L10N('contacts'); $id = isset($_GET['id'])?$_GET['id']:null; -$vcard = OC_Contacts_App::getContactVCard( $id ); if(is_null($id)) { bailOut($l->t('Missing ID')); } +$vcard = OC_Contacts_App::getContactVCard( $id ); if(is_null($vcard)) { bailOut($l->t('Error parsing VCard for ID: "'.$id.'"')); } diff --git a/js/contacts.js b/js/contacts.js index 26206e97..bd01e385 100644 --- a/js/contacts.js +++ b/js/contacts.js @@ -236,7 +236,6 @@ Contacts={ delete:function() { $('#contacts_deletecard').tipsy('hide'); $.getJSON('ajax/deletecard.php',{'id':this.id},function(jsondata){ - console.log('Card.delete: ' + this.id); if(jsondata.status == 'success'){ $('#leftcontent [data-id="'+jsondata.data.id+'"]').remove(); $('#rightcontent').data('id',''); @@ -380,7 +379,6 @@ 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'){ @@ -591,6 +589,7 @@ Contacts={ this.addname = n[2]; this.honpre = n[3]; this.honsuf = n[4]; + $('#n').val(n.join(';')); if(n[3].length > 0) { this.fullname = n[3] + ' '; @@ -774,7 +773,6 @@ Contacts={ } }, loadPhoto:function(){ - //console.log('loadPhoto: ' + this.data.PHOTO); if(this.data.PHOTO) { $('#file_upload_form').show(); $('#contacts_propertymenu a[data-type="PHOTO"]').parent().hide(); @@ -1056,7 +1054,6 @@ $(document).ready(function(){ */ $('#leftcontent li').live('click',function(){ var id = $(this).data('id'); - console.log('Contact ' + id + ' clicked.'); var oldid = $('#rightcontent').data('id'); if(oldid != 0){ $('#leftcontent li[data-id="'+oldid+'"]').removeClass('active'); @@ -1070,59 +1067,16 @@ $(document).ready(function(){ //alert(jsondata.data.message); } }); - // NOTE: Deprecated. -// $.getJSON('ajax/getdetails.php',{'id':id, 'new':1},function(jsondata){ -// if(jsondata.status == 'success'){ -// $('#rightcontent').data('id',jsondata.data.id); -// $('#rightcontent').html(jsondata.data.page); -// $('#leftcontent li[data-id="'+jsondata.data.id+'"]').addClass('active'); -// //Contacts.UI.loadHandlers(); -// } -// else{ -// Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message); -// //alert(jsondata.data.message); -// } -// }); return false; }); /** - * Delete currently selected contact TODO: and clear page + * Delete currently selected contact and TODO: clear page */ $('#contacts_deletecard').live('click',function(){ Contacts.UI.Card.delete(); }); - /** - * Add and insert a new contact into the list. NOTE: Deprecated - */ -// $('#contacts_addcardform input[type="submit"]').live('click',function(){ -// $.post('ajax/addcontact.php',$('#contact_identity').serialize(),function(jsondata){ -// if(jsondata.status == 'success'){ -// $('#rightcontent').data('id',jsondata.data.id); -// $('#rightcontent').html(jsondata.data.page); -// $('#leftcontent .active').removeClass('active'); -// var item = '