1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-30 19:52:17 +01:00

Merge branch 'master' into calendar

This commit is contained in:
Jan-Christoph Borchardt 2011-08-15 23:40:03 +02:00
commit 011ec4b1fb
6 changed files with 69 additions and 62 deletions

View File

@ -14,5 +14,5 @@ OC_App::addNavigationEntry( array(
'id' => 'contacts_index', 'id' => 'contacts_index',
'order' => 10, 'order' => 10,
'href' => OC_Helper::linkTo( 'contacts', 'index.php' ), 'href' => OC_Helper::linkTo( 'contacts', 'index.php' ),
'icon' => OC_Helper::imagePath( 'contacts', 'icon.png' ), 'icon' => OC_Helper::imagePath( 'settings', 'users.svg' ),
'name' => 'Contacts' )); 'name' => 'Contacts' ));

View File

@ -1 +1,2 @@
.contacts_propertyname {float:left;} .contacts_details_left {text-align:right;vertical-align:top;padding:2px;}
.contacts_details_right {text-align:left;vertical-align:top;padding:2px;}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 741 B

View File

@ -102,12 +102,12 @@ $(document).ready(function(){
return false; return false;
}); });
$('.contacts_property [data-use="edit"]').live('click',function(){ $('.contacts_details_property [data-use="edit"]').live('click',function(){
var id = $('#rightcontent').data('id'); var id = $('#rightcontent').data('id');
var checksum = $(this).parent().parent().data('checksum'); var checksum = $(this).parent().parent().data('checksum');
$.getJSON('ajax/showsetproperty.php',{'id': id, 'checksum': checksum },function(jsondata){ $.getJSON('ajax/showsetproperty.php',{'id': id, 'checksum': checksum },function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
$('.contacts_property[data-checksum="'+checksum+'"] .contacts_propertyvalue').html(jsondata.data.page); $('.contacts_details_property[data-checksum="'+checksum+'"] .contacts_details_right').html(jsondata.data.page);
} }
else{ else{
alert(jsondata.data.message); alert(jsondata.data.message);
@ -119,7 +119,7 @@ $(document).ready(function(){
$('#contacts_setpropertyform input[type="submit"]').live('click',function(){ $('#contacts_setpropertyform input[type="submit"]').live('click',function(){
$.post('ajax/setproperty.php',$('#contacts_setpropertyform').serialize(),function(jsondata){ $.post('ajax/setproperty.php',$('#contacts_setpropertyform').serialize(),function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
$('.contacts_property[data-checksum="'+jsondata.data.oldchecksum+'"]').replaceWith(jsondata.data.page); $('.contacts_details_property[data-checksum="'+jsondata.data.oldchecksum+'"]').replaceWith(jsondata.data.page);
} }
else{ else{
alert(jsondata.data.message); alert(jsondata.data.message);
@ -128,12 +128,12 @@ $(document).ready(function(){
return false; return false;
}); });
$('.contacts_property [data-use="delete"]').live('click',function(){ $('.contacts_details_property [data-use="delete"]').live('click',function(){
var id = $('#rightcontent').data('id'); var id = $('#rightcontent').data('id');
var checksum = $(this).parent().parent().data('checksum'); var checksum = $(this).parent().parent().data('checksum');
$.getJSON('ajax/deleteproperty.php',{'id': id, 'checksum': checksum },function(jsondata){ $.getJSON('ajax/deleteproperty.php',{'id': id, 'checksum': checksum },function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
$('.contacts_property[data-checksum="'+checksum+'"]').remove(); $('.contacts_details_property[data-checksum="'+checksum+'"]').remove();
} }
else{ else{
alert(jsondata.data.message); alert(jsondata.data.message);
@ -143,11 +143,11 @@ $(document).ready(function(){
}); });
$('.contacts_property').live('mouseenter',function(){ $('.contacts_details_property').live('mouseenter',function(){
$(this).find('span').show(); $(this).find('span').show();
}); });
$('.contacts_property').live('mouseleave',function(){ $('.contacts_details_property').live('mouseleave',function(){
$(this).find('span').hide(); $(this).find('span').hide();
}); });
}); });

View File

@ -1,29 +1,35 @@
<?php if(array_key_exists('PHOTO',$_['details'])): ?>
<img src="photo.php?id=<?php echo $_['id']; ?>">
<?php endif; ?>
<?php if(array_key_exists('FN',$_['details'])): ?> <?php if(array_key_exists('FN',$_['details'])): ?>
<table>
<?php if(isset($_['details']['PHOTO'])): // Emails first ?>
<tr class="contacts_details_property">
<td class="contacts_details_left">&nbsp;</td>
<td class="contacts_details_right">
<img src="photo.php?id=<?php echo $_['id']; ?>">
</td>
</tr>
<?php endif; ?>
<?php echo $this->inc('part.property', array('property' => $_['details']['FN'][0])); ?> <?php echo $this->inc('part.property', array('property' => $_['details']['FN'][0])); ?>
<?php endif; ?>
<?php if(isset($_['details']['BDAY'])): // Emails first ?> <?php if(isset($_['details']['BDAY'])): // Emails first ?>
<?php echo $this->inc('part.property', array('property' => $_['details']['BDAY'][0])); ?> <?php echo $this->inc('part.property', array('property' => $_['details']['BDAY'][0])); ?>
<?php endif; ?> <?php endif; ?>
<?php if(isset($_['details']['ORG'])): // Emails first ?> <?php if(isset($_['details']['ORG'])): // Emails first ?>
<?php echo $this->inc('part.property', array('property' => $_['details']['ORG'][0])); ?> <?php echo $this->inc('part.property', array('property' => $_['details']['ORG'][0])); ?>
<?php endif; ?> <?php endif; ?>
<?php foreach(array('EMAIL','TEL','ADR') as $type): ?> <?php foreach(array('EMAIL','TEL','ADR') as $type): ?>
<?php if(isset($_['details'][$type])): // Emails first ?> <?php if(isset($_['details'][$type])): // Emails first ?>
<br>
<?php foreach($_['details'][$type] as $property): ?> <?php foreach($_['details'][$type] as $property): ?>
<?php echo $this->inc('part.property',array('property' => $property )); ?> <?php echo $this->inc('part.property',array('property' => $property )); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
</table>
<?php endif; ?>
<div id="contacts_cardoptions"> <div id="contacts_cardoptions">
<a id="contacts_deletecard"><img src="../../core/img/actions/delete.png"></a> <a id="contacts_deletecard"><img class="svg action" src="<?php echo image_path('', 'actions/delete.svg'); ?>" /></a>
<a id="contacts_addproperty"><img src="../../core/img/actions/download.png"></a> <a id="contacts_addproperty"><img class="svg action" src="<?php echo image_path('', 'actions/download.svg'); ?>" /></a>
</div> </div>

View File

@ -1,49 +1,49 @@
<div class="contacts_property" data-checksum="<?php echo $_['property']['checksum']; ?>"> <tr class="contacts_details_property" data-checksum="<?php echo $_['property']['checksum']; ?>">
<?php if($_['property']['name'] == 'FN'): ?> <?php if($_['property']['name'] == 'FN'): ?>
<div class="contacts_propertyname"><?php echo $l->t('Name'); ?></div> <td class="contacts_details_left"><?php echo $l->t('Name'); ?></td>
<div class="contacts_propertyvalue"> <td class="contacts_details_right">
<?php echo $_['property']['value']; ?> <?php echo $_['property']['value']; ?>
<span style="display:none;" data-use="edit"><img src="../../core/img/actions/rename.png"></span> <span style="display:none;" data-use="edit"><img class="svg action" src="<?php echo image_path('', 'actions/rename.svg'); ?>" /></span>
</div> </td>
<?php elseif($_['property']['name'] == 'BDAY'): ?> <?php elseif($_['property']['name'] == 'BDAY'): ?>
<div class="contacts_propertyname"><?php echo $l->t('Birthday'); ?></div> <td class="contacts_details_left"><?php echo $l->t('Birthday'); ?></td>
<div class="contacts_propertyvalue"> <td class="contacts_details_right">
<?php echo $l->l('date',new DateTime($_['property']['value'])); ?> <?php echo $l->l('date',new DateTime($_['property']['value'])); ?>
<span style="display:none;" data-use="delete"><img src="../../core/img/actions/delete.png"></span> <span style="display:none;" data-use="delete"><img class="svg action" src="<?php echo image_path('', 'actions/delete.svg'); ?>" /></span>
</div> </td>
<?php elseif($_['property']['name'] == 'ORG'): ?> <?php elseif($_['property']['name'] == 'ORG'): ?>
<div class="contacts_propertyname"><?php echo $l->t('Organisation'); ?></div> <td class="contacts_details_left"><?php echo $l->t('Organisation'); ?></td>
<div class="contacts_propertyvalue"> <td class="contacts_details_right">
<?php echo $_['property']['value']; ?> <?php echo $_['property']['value']; ?>
<span style="display:none;" data-use="edit"><img src="../../core/img/actions/rename.png"></span> <span style="display:none;" data-use="edit"><img class="svg action" src="<?php echo image_path('', 'actions/rename.svg'); ?>" /></span>
<span style="display:none;" data-use="delete"><img src="../../core/img/actions/delete.png"></span> <span style="display:none;" data-use="delete"><img class="svg action" src="<?php echo image_path('', 'actions/delete.svg'); ?>" /></span>
</div> </td>
<?php elseif($_['property']['name'] == 'EMAIL'): ?> <?php elseif($_['property']['name'] == 'EMAIL'): ?>
<div class="contacts_propertyname"><?php echo $l->t('Email'); ?></div> <td class="contacts_details_left"><?php echo $l->t('Email'); ?></td>
<div class="contacts_propertyvalue"> <td class="contacts_details_right">
<?php echo $_['property']['value']; ?> <?php echo $_['property']['value']; ?>
<span style="display:none;" data-use="edit"><img src="../../core/img/actions/rename.png"></span> <span style="display:none;" data-use="edit"><img class="svg action" src="<?php echo image_path('', 'actions/rename.svg'); ?>" /></span>
<span style="display:none;" data-use="delete"><img src="../../core/img/actions/delete.png"></span> <span style="display:none;" data-use="delete"><img class="svg action" src="<?php echo image_path('', 'actions/delete.svg'); ?>" /></span>
</div> </td>
<?php elseif($_['property']['name'] == 'TEL'): ?> <?php elseif($_['property']['name'] == 'TEL'): ?>
<div class="contacts_propertyname"><?php echo $l->t('Telephone'); ?></div> <td class="contacts_details_left"><?php echo $l->t('Telephone'); ?></td>
<div class="contacts_propertyvalue"> <td class="contacts_details_right">
<?php echo $_['property']['value']; ?> <?php echo $_['property']['value']; ?>
<?php if(isset($_['property']['parameters']['TYPE'])): ?> <?php if(isset($_['property']['parameters']['TYPE'])): ?>
(<?php echo $l->t('tel_'.strtolower($_['property']['parameters']['TYPE'])); ?>) (<?php echo $l->t('tel_'.strtolower($_['property']['parameters']['TYPE'])); ?>)
<?php endif; ?> <?php endif; ?>
<span style="display:none;" data-use="edit"><img src="../../core/img/actions/rename.png"></span> <span style="display:none;" data-use="edit"><img class="svg action" src="<?php echo image_path('', 'actions/rename.svg'); ?>" /></span>
<span style="display:none;" data-use="delete"><img src="../../core/img/actions/delete.png"></span> <span style="display:none;" data-use="delete"><img class="svg action" src="<?php echo image_path('', 'actions/delete.svg'); ?>" /></span>
</div> </td>
<?php elseif($_['property']['name'] == 'ADR'): ?> <?php elseif($_['property']['name'] == 'ADR'): ?>
<div class="contacts_propertyname"> <td class="contacts_details_left">
<?php echo $l->t('Address'); ?> <?php echo $l->t('Address'); ?>
<?php if(isset($_['property']['parameters']['TYPE'])): ?> <?php if(isset($_['property']['parameters']['TYPE'])): ?>
<br> <br>
(<?php echo $l->t('adr_'.strtolower($_['property']['parameters']['TYPE'])); ?>) (<?php echo $l->t('adr_'.strtolower($_['property']['parameters']['TYPE'])); ?>)
<?php endif; ?> <?php endif; ?>
</div> </td>
<div class="contacts_propertyvalue"> <td class="contacts_details_right">
<?php echo $l->t('PO Box'); ?> <?php echo $_['property']['value'][0]; ?><br> <?php echo $l->t('PO Box'); ?> <?php echo $_['property']['value'][0]; ?><br>
<?php echo $l->t('Extended Address'); ?> <?php echo $_['property']['value'][1]; ?><br> <?php echo $l->t('Extended Address'); ?> <?php echo $_['property']['value'][1]; ?><br>
<?php echo $l->t('Street Name'); ?> <?php echo $_['property']['value'][2]; ?><br> <?php echo $l->t('Street Name'); ?> <?php echo $_['property']['value'][2]; ?><br>
@ -51,8 +51,8 @@
<?php echo $l->t('Region'); ?> <?php echo $_['property']['value'][4]; ?><br> <?php echo $l->t('Region'); ?> <?php echo $_['property']['value'][4]; ?><br>
<?php echo $l->t('Postal Code'); ?> <?php echo $_['property']['value'][5]; ?><br> <?php echo $l->t('Postal Code'); ?> <?php echo $_['property']['value'][5]; ?><br>
<?php echo $l->t('Country'); ?> <?php echo $_['property']['value'][6]; ?> <?php echo $l->t('Country'); ?> <?php echo $_['property']['value'][6]; ?>
<span style="display:none;" data-use="edit"><img src="../../core/img/actions/rename.png"></span> <span style="display:none;" data-use="edit"><img class="svg action" src="<?php echo image_path('', 'actions/rename.svg'); ?>" /></span>
<span style="display:none;" data-use="delete"><img src="../../core/img/actions/delete.png"></span> <span style="display:none;" data-use="delete"><img class="svg action" src="<?php echo image_path('', 'actions/delete.svg'); ?>" /></span>
</div> </td>
<?php endif; ?> <?php endif; ?>
</div> </tr>