From: Bart Visscher Date: Fri, 2 Dec 2011 20:24:48 +0000 (+0100) Subject: Contacts: make name editable again X-Git-Tag: v3.0~82^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=31846141b0269bb24b9925a1bbbbc5d815719bec;p=nextcloud-server.git Contacts: make name editable again --- diff --git a/apps/contacts/ajax/setproperty.php b/apps/contacts/ajax/setproperty.php index c9102c4a2ee..22f228cbf43 100644 --- a/apps/contacts/ajax/setproperty.php +++ b/apps/contacts/ajax/setproperty.php @@ -107,7 +107,12 @@ OC_Contacts_VCard::edit($id,$vcard->serialize()); $adr_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'ADR'); $phone_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'TEL'); -$tmpl = new OC_Template('contacts','part.property'); +if ($vcard->children[$line]->name == 'FN'){ + $tmpl = new OC_Template('contacts','part.property.FN'); +} +else{ + $tmpl = new OC_Template('contacts','part.property'); +} $tmpl->assign('adr_types',$adr_types); $tmpl->assign('phone_types',$phone_types); $tmpl->assign('property',OC_Contacts_VCard::structureProperty($vcard->children[$line],$line)); diff --git a/apps/contacts/js/interface.js b/apps/contacts/js/interface.js index ba1c0e536c2..eb81e872682 100644 --- a/apps/contacts/js/interface.js +++ b/apps/contacts/js/interface.js @@ -110,7 +110,7 @@ $(document).ready(function(){ $('.contacts_property [data-use="edit"]').live('click',function(){ var id = $('#rightcontent').data('id'); - var checksum = $(this).parents('li').first().data('checksum'); + var checksum = $(this).parents('.contacts_property').first().data('checksum'); $.getJSON('ajax/showsetproperty.php',{'id': id, 'checksum': checksum },function(jsondata){ if(jsondata.status == 'success'){ $('.contacts_property[data-checksum="'+checksum+'"]').html(jsondata.data.page) diff --git a/apps/contacts/templates/part.details.php b/apps/contacts/templates/part.details.php index f6d69005a08..afad0b7f64c 100644 --- a/apps/contacts/templates/part.details.php +++ b/apps/contacts/templates/part.details.php @@ -1,5 +1,5 @@ -

+ inc('part.property.FN', array('property' => $_['details']['FN'][0])); ?> diff --git a/apps/contacts/templates/part.property.FN.php b/apps/contacts/templates/part.property.FN.php new file mode 100644 index 00000000000..83cef94e303 --- /dev/null +++ b/apps/contacts/templates/part.property.FN.php @@ -0,0 +1,9 @@ +

+ + +

+ + + diff --git a/apps/contacts/templates/part.setpropertyform.php b/apps/contacts/templates/part.setpropertyform.php index f216a55f5e9..8635d7db1ce 100644 --- a/apps/contacts/templates/part.setpropertyform.php +++ b/apps/contacts/templates/part.setpropertyform.php @@ -1,7 +1,9 @@
- + +

+