mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
Contacts: make name editable again
This commit is contained in:
parent
0bbeb13e26
commit
31846141b0
5 changed files with 20 additions and 4 deletions
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php if(array_key_exists('FN',$_['details'])): ?>
|
||||
<p id="contacts_details_name"><?php echo $_['details']['FN'][0]['value']; ?></p>
|
||||
<?php echo $this->inc('part.property.FN', array('property' => $_['details']['FN'][0])); ?>
|
||||
<img class="svg action" id="contacts_deletecard" src="<?php echo image_path('', 'actions/delete.svg'); ?>" title="<?php echo $l->t('Delete contact');?>" />
|
||||
|
||||
<?php if(isset($_['details']['PHOTO'])): // Emails first ?>
|
||||
|
|
|
|||
9
apps/contacts/templates/part.property.FN.php
Normal file
9
apps/contacts/templates/part.property.FN.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<p id="contacts_details_name" class="contacts_property" data-checksum="<?php echo $_['property']['checksum']; ?>">
|
||||
<?php echo $_['property']['value']; ?>
|
||||
<span style="display:none;" data-use="edit"><img class="svg action" src="<?php echo image_path('', 'actions/rename.svg'); ?>" /></span>
|
||||
</p>
|
||||
<?php if (!isset($_['details'])): ?>
|
||||
<script>
|
||||
$('#leftcontent li.active a').text('<?php echo $_['property']['value']; ?>');
|
||||
</script>
|
||||
<?php endif ?>
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
<form id="contacts_setpropertyform">
|
||||
<input type="hidden" name="checksum" value="<?php echo $_['property']['checksum']; ?>">
|
||||
<input type="hidden" name="id" value="<?php echo $_['id']; ?>">
|
||||
<?php if($_['property']['name']=='ADR'): ?>
|
||||
<?php if($_['property']['name']=='FN'): ?>
|
||||
<p class="contacts_property_data"><input id="fn" type="text" name="value" value="<?php echo $_['property']['value']; ?>"></p>
|
||||
<?php elseif($_['property']['name']=='ADR'): ?>
|
||||
<p class="contacts_property_name"><label for="adr_pobox"><?php echo $l->t('Address'); ?></label></p>
|
||||
<ol class="contacts_property_data" id="contacts_addresspart">
|
||||
<li class="input">
|
||||
|
|
|
|||
Loading…
Reference in a new issue