diff options
-rw-r--r-- | apps/contacts/ajax/addphoto.php | 59 | ||||
-rw-r--r-- | apps/contacts/ajax/deletebook.php | 1 | ||||
-rw-r--r-- | apps/contacts/ajax/deleteproperty.php | 10 | ||||
-rw-r--r-- | apps/contacts/ajax/setphoto.php | 77 | ||||
-rw-r--r-- | apps/contacts/ajax/setproperty.php | 10 | ||||
-rw-r--r-- | apps/contacts/ajax/showsetproperty.php | 11 | ||||
-rw-r--r-- | apps/contacts/js/interface.js | 46 | ||||
-rw-r--r-- | apps/contacts/lib/addressbook.php | 15 | ||||
-rw-r--r-- | apps/contacts/templates/index.php | 2 | ||||
-rw-r--r-- | apps/contacts/templates/part.addpropertyform.php | 19 | ||||
-rw-r--r-- | apps/contacts/templates/part.contacts.php | 2 | ||||
-rw-r--r-- | apps/contacts/templates/part.details.php | 7 | ||||
-rw-r--r-- | apps/contacts/templates/part.property.php | 36 | ||||
-rw-r--r-- | apps/contacts/templates/part.setpropertyform.php | 3 |
14 files changed, 90 insertions, 208 deletions
diff --git a/apps/contacts/ajax/addphoto.php b/apps/contacts/ajax/addphoto.php deleted file mode 100644 index 03d5e6b3ceb..00000000000 --- a/apps/contacts/ajax/addphoto.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php -/** - * ownCloud - Addressbook - * - * @author Jakob Sack - * @copyright 2011 Jakob Sack mail@jakobsack.de - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE - * License as published by the Free Software Foundation; either - * version 3 of the License, or any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU AFFERO GENERAL PUBLIC LICENSE for more details. - * - * You should have received a copy of the GNU Affero General Public - * License along with this library. If not, see <http://www.gnu.org/licenses/>. - * - */ - -// Init owncloud -require_once('../../../lib/base.php'); - -$id = $_POST['id']; -$l10n = new OC_L10N('contacts'); - -// Check if we are a user -if( !OC_User::isLoggedIn()){ - echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!')))); - exit(); -} - -$card = OC_Contacts_Addressbook::findCard( $id ); -if( $card === false ){ - echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Can not find Contact!')))); - exit(); -} - -$addressbook = OC_Contacts_Addressbook::findAddressbook( $card['addressbookid'] ); -if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){ - echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('This is not your contact!')))); - exit(); -} - -$vcard = Sabre_VObject_Reader::read($card['carddata']); -$mimetype = $_FILES['photo']['type'] ? $_FILES['photo']['type'] : 'image/jpeg'; -$photobase = base64_encode(file_get_contents($_FILES['photo']['tmp_name'])); -$photo = new Sabre_VObject_Property( 'PHOTO', $photobase ); -$photo->parameters[] = new Sabre_VObject_Parameter('TYPE',$mimetype); -$photo->parameters[] = new Sabre_VObject_Parameter('ENCODING','b'); -$vcard->add($photo); - -$line = count($vcard->children) - 1; -$checksum = md5($vcard->children[$line]->serialize()); - -OC_Contacts_Addressbook::editCard($id,$vcard->serialize()); -echo json_encode( array( 'status' => 'success', 'data' => array( 'id' => $id, 'line' => $line, 'checksum' => $checksum ))); diff --git a/apps/contacts/ajax/deletebook.php b/apps/contacts/ajax/deletebook.php index ba36c494cdf..8506284cc0d 100644 --- a/apps/contacts/ajax/deletebook.php +++ b/apps/contacts/ajax/deletebook.php @@ -33,7 +33,6 @@ if( !OC_User::isLoggedIn()){ exit(); } - $addressbook = OC_Contacts_Addressbook::findAddressbook( $id ); if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){ echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('This is not your contact!')))); diff --git a/apps/contacts/ajax/deleteproperty.php b/apps/contacts/ajax/deleteproperty.php index 9f8b5dbbaf1..d141cc00b8d 100644 --- a/apps/contacts/ajax/deleteproperty.php +++ b/apps/contacts/ajax/deleteproperty.php @@ -24,7 +24,6 @@ require_once('../../../lib/base.php'); $id = $_GET['id']; -$line = $_GET['line']; $checksum = $_GET['checksum']; @@ -50,8 +49,13 @@ if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){ } $vcard = Sabre_VObject_Reader::read($card['carddata']); - -if(md5($vcard->children[$line]->serialize()) != $checksum ){ +$line = null; +for($i=0;$i<count($vcard->children);$i++){ + if(md5($vcard->children[$i]->serialize()) == $checksum ){ + $line = $i; + } +} +if(is_null($line)){ echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Information about vCard is incorrect. Please reload page!')))); exit(); } diff --git a/apps/contacts/ajax/setphoto.php b/apps/contacts/ajax/setphoto.php deleted file mode 100644 index c29b5326027..00000000000 --- a/apps/contacts/ajax/setphoto.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php -/** - * ownCloud - Addressbook - * - * @author Jakob Sack - * @copyright 2011 Jakob Sack mail@jakobsack.de - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE - * License as published by the Free Software Foundation; either - * version 3 of the License, or any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU AFFERO GENERAL PUBLIC LICENSE for more details. - * - * You should have received a copy of the GNU Affero General Public - * License along with this library. If not, see <http://www.gnu.org/licenses/>. - * - */ - -// Init owncloud -require_once('../../../lib/base.php'); - -$id = $_POST['id']; -$line = $_POST['line']; -$checksum = $_POST['checksum']; -$l10n = new OC_L10N('contacts'); - -// Check if we are a user -if( !OC_User::isLoggedIn()){ - echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!')))); - exit(); -} - -$card = OC_Contacts_Addressbook::findCard( $id ); -if( $card === false ){ - echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Can not find Contact!')))); - exit(); -} - -$addressbook = OC_Contacts_Addressbook::findAddressbook( $card['addressbookid'] ); -if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){ - echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('This is not your contact!')))); - exit(); -} - -$vcard = Sabre_VObject_Reader::read($card['carddata']); -$mimetype = $_FILES['photo']['type'] ? $_FILES['photo']['type'] : 'image/jpeg'; -$photobase = base64_encode(file_get_contents($_FILES['photo']['tmp_name'])); - -if(md5($vcard->children[$line]->serialize()) != $checksum){ - echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Information about vCard is incorrect. Please reload page!')))); - exit(); -} - -// replace photo -$vcard->children[$line]->setValue($photobase); -$encoding = $type = false; -foreach($vcard->children[$line]->parameters as &$parameter){ - if($parameter->name == 'TYPE'){ - $parameter->value = $mimetype; - $type = true; - } - elseif($parameter->name == 'ENCODING'){ - $parameter->value = 'b'; - $encoding = true; - } -} unset($parameter); -if(!$encoding) $vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter('ENCODING','b'); -if(!$type) $vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter('TYPE',$mimetype); - -$checksum = md5($vcard->children[$line]->serialize()); - -OC_Contacts_Addressbook::editCard($id,$vcard->serialize()); -echo json_encode( array( 'status' => 'success', 'data' => array( 'id' => $id, 'line' => $line, 'checksum' => $checksum ))); diff --git a/apps/contacts/ajax/setproperty.php b/apps/contacts/ajax/setproperty.php index 6f33c68631a..08d8892254e 100644 --- a/apps/contacts/ajax/setproperty.php +++ b/apps/contacts/ajax/setproperty.php @@ -24,7 +24,6 @@ require_once('../../../lib/base.php'); $id = $_POST['id']; -$line = $_POST['line']; $checksum = $_POST['checksum']; $l10n = new OC_L10N('contacts'); @@ -47,8 +46,13 @@ if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){ } $vcard = Sabre_VObject_Reader::read($card['carddata']); - -if(md5($vcard->children[$line]->serialize()) != $checksum){ +$line = null; +for($i=0;$i<count($vcard->children);$i++){ + if(md5($vcard->children[$i]->serialize()) == $checksum ){ + $line = $i; + } +} +if(is_null($line)){ echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Information about vCard is incorrect. Please reload page!')))); exit(); } diff --git a/apps/contacts/ajax/showsetproperty.php b/apps/contacts/ajax/showsetproperty.php index 75c3ff88f5f..a00043384f3 100644 --- a/apps/contacts/ajax/showsetproperty.php +++ b/apps/contacts/ajax/showsetproperty.php @@ -24,7 +24,6 @@ require_once('../../../lib/base.php'); $id = $_GET['id']; -$line = $_GET['line']; $checksum = $_GET['checksum']; $l10n = new OC_L10N('contacts'); @@ -47,7 +46,13 @@ if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){ } $vcard = Sabre_VObject_Reader::read($card['carddata']); -if(md5($vcard->children[$line]->serialize()) != $checksum){ +$line = null; +for($i=0;$i<count($vcard->children);$i++){ + if(md5($vcard->children[$i]->serialize()) == $checksum ){ + $line = $i; + } +} +if(is_null($line)){ echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Information about vCard is incorrect. Please reload page!')))); exit(); } @@ -56,7 +61,7 @@ if(md5($vcard->children[$line]->serialize()) != $checksum){ $tmpl = new OC_Template('contacts','part.setpropertyform'); $tmpl->assign('id',$id); $tmpl->assign('checksum',$checksum); -$tmpl->assign('property',OC_Contacts_Addressbook::structureProperty($vcard->children[$line],$line)); +$tmpl->assign('property',OC_Contacts_Addressbook::structureProperty($vcard->children[$line])); $page = $tmpl->fetchPage(); echo json_encode( array( 'status' => 'success', 'data' => array( 'page' => $page ))); diff --git a/apps/contacts/js/interface.js b/apps/contacts/js/interface.js index 0aae7d15d45..bab71eec422 100644 --- a/apps/contacts/js/interface.js +++ b/apps/contacts/js/interface.js @@ -5,10 +5,10 @@ $(document).ready(function(){ });*/ $('#contacts_contacts li').live('click',function(){ - var id = $(this).attr('x-id'); + var id = $(this).data('id'); $.getJSON('ajax/getdetails.php',{'id':id},function(jsondata){ if(jsondata.status == 'success'){ - $('#contacts_details').attr('x-id',jsondata.data.id); + $('#contacts_details').data('id',jsondata.data.id); $('#contacts_details').html(jsondata.data.page); } else{ @@ -19,11 +19,11 @@ $(document).ready(function(){ }); $('#contacts_deletecard').live('click',function(){ - var id = $('#contacts_details').attr('x-id'); + var id = $('#contacts_details').data('id'); $.getJSON('ajax/deletecard.php',{'id':id},function(jsondata){ if(jsondata.status == 'success'){ - $('#contacts_contacts [x-id="'+jsondata.data.id+'"]').remove(); - $('#contacts_details').attr('x-id',''); + $('#contacts_contacts [data-id="'+jsondata.data.id+'"]').remove(); + $('#contacts_details').data('id',''); $('#contacts_details').html(''); } else{ @@ -34,7 +34,7 @@ $(document).ready(function(){ }); $('#contacts_addproperty').live('click',function(){ - var id = $('#contacts_details').attr('x-id'); + var id = $('#contacts_details').data('id'); $.getJSON('ajax/showaddproperty.php',{'id':id},function(jsondata){ if(jsondata.status == 'success'){ $('#contacts_details').append(jsondata.data.page); @@ -57,9 +57,6 @@ $(document).ready(function(){ else if($(this).val() == 'TEL'){ $('#contacts_phonepart').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]')); } - else if($(this).val() == 'NOTE'){ - $('#contacts_fieldpart').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]')); - } else{ $('#contacts_generic').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]')); } @@ -68,8 +65,9 @@ $(document).ready(function(){ $('#contacts_addpropertyform input[type="submit"]').live('click',function(){ $.post('ajax/addproperty.php',$('#contacts_addpropertyform').serialize(),function(jsondata){ if(jsondata.status == 'success'){ - $('#contacts_details').append(jsondata.data.page); + $('#contacts_cardoptions').before(jsondata.data.page); $('#contacts_addpropertyform').remove(); + $('#contacts_addcontactsparts').remove(); } else{ alert(jsondata.data.message); @@ -81,7 +79,7 @@ $(document).ready(function(){ $('#contacts_newcontact').click(function(){ $.getJSON('ajax/showaddcard.php',{},function(jsondata){ if(jsondata.status == 'success'){ - $('#contacts_details').attr('x-id',''); + $('#contacts_details').data('id',''); $('#contacts_details').html(jsondata.data.page); } else{ @@ -94,7 +92,7 @@ $(document).ready(function(){ $('#contacts_addcardform input[type="submit"]').live('click',function(){ $.post('ajax/addcard.php',$('#contacts_addcardform').serialize(),function(jsondata){ if(jsondata.status == 'success'){ - $('#contacts_details').attr('x-id',jsondata.data.id); + $('#contacts_details').data('id',jsondata.data.id); $('#contacts_details').html(jsondata.data.page); } else{ @@ -104,13 +102,12 @@ $(document).ready(function(){ return false; }); - $('.contacts_property [x-use="edit"]').live('click',function(){ - var id = $('#contacts_details').attr('x-id'); - var checksum = $(this).parent().parent().attr('x-checksum'); - var line = $(this).parent().parent().attr('x-line'); - $.getJSON('ajax/showsetproperty.php',{'id': id, 'checksum': checksum, 'line': line },function(jsondata){ + $('.contacts_property [data-use="edit"]').live('click',function(){ + var id = $('#contacts_details').data('id'); + var checksum = $(this).parent().parent().data('checksum'); + $.getJSON('ajax/showsetproperty.php',{'id': id, 'checksum': checksum },function(jsondata){ if(jsondata.status == 'success'){ - $('.contacts_property[x-line="'+line+'"][x-checksum="'+checksum+'"] .contacts_propertyvalue').html(jsondata.data.page); + $('.contacts_property[data-checksum="'+checksum+'"] .contacts_propertyvalue').html(jsondata.data.page); } else{ alert(jsondata.data.message); @@ -122,7 +119,7 @@ $(document).ready(function(){ $('#contacts_setpropertyform input[type="submit"]').live('click',function(){ $.post('ajax/setproperty.php',$('#contacts_setpropertyform').serialize(),function(jsondata){ if(jsondata.status == 'success'){ - $('.contacts_property[x-line="'+jsondata.data.line+'"][x-checksum="'+jsondata.data.oldchecksum+'"]').replaceWith(jsondata.data.page); + $('.contacts_property[data-checksum="'+jsondata.data.oldchecksum+'"]').replaceWith(jsondata.data.page); } else{ alert(jsondata.data.message); @@ -131,13 +128,12 @@ $(document).ready(function(){ return false; }); - $('.contacts_property [x-use="delete"]').live('click',function(){ - var id = $('#contacts_details').attr('x-id'); - var checksum = $(this).parent().parent().attr('x-checksum'); - var line = $(this).parent().parent().attr('x-line'); - $.getJSON('ajax/deleteproperty.php',{'id': id, 'checksum': checksum, 'line': line },function(jsondata){ + $('.contacts_property [data-use="delete"]').live('click',function(){ + var id = $('#contacts_details').data('id'); + var checksum = $(this).parent().parent().data('checksum'); + $.getJSON('ajax/deleteproperty.php',{'id': id, 'checksum': checksum },function(jsondata){ if(jsondata.status == 'success'){ - $('.contacts_property[x-line="'+line+'"][x-checksum="'+checksum+'"]').remove(); + $('.contacts_property[data-checksum="'+checksum+'"]').remove(); } else{ alert(jsondata.data.message); diff --git a/apps/contacts/lib/addressbook.php b/apps/contacts/lib/addressbook.php index cb7b0b4671a..8b91cdbd6f5 100644 --- a/apps/contacts/lib/addressbook.php +++ b/apps/contacts/lib/addressbook.php @@ -291,32 +291,35 @@ class OC_Contacts_Addressbook{ public static function structureContact($object){ $details = array(); - $line = 0; foreach($object->children as $property){ - $temp = self::structureProperty($property,$line); + $temp = self::structureProperty($property); if(array_key_exists($property->name,$details)){ $details[$property->name][] = $temp; } else{ $details[$property->name] = array($temp); } - $line++; } return $details; } - public static function structureProperty($property,$line=null){ + public static function structureProperty($property){ $value = $property->value; - if($property->name == 'ADR'){ + $value = htmlspecialchars($value); + if($property->name == 'ADR' || $property->name == 'N'){ $value = self::unescapeSemicolons($value); } $temp = array( 'name' => $property->name, 'value' => $value, - 'line' => $line, 'parameters' => array(), 'checksum' => md5($property->serialize())); foreach($property->parameters as $parameter){ + // Faulty entries by kaddressbook + if($parameter->name == 'TYPE' && $parameter->value == 'PREF'){ + $parameter->name = 'PREF'; + $parameter->value = '1'; + } $temp['parameters'][$parameter->name] = $parameter->value; } return $temp; diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php index e6dd45739bc..6a29c7bd68e 100644 --- a/apps/contacts/templates/index.php +++ b/apps/contacts/templates/index.php @@ -22,6 +22,6 @@ OC_Util::addStyle('contacts','styles'); </ul> <a id="contacts_newcontact"><?php echo $l->t('Add Contact'); ?></a> </div> -<div id="contacts_details" class="rightcontent" x-id="<?php echo $_['id']; ?>"> +<div id="contacts_details" class="rightcontent" data-id="<?php echo $_['id']; ?>"> <?php echo $this->inc("part.details"); ?> </div> diff --git a/apps/contacts/templates/part.addpropertyform.php b/apps/contacts/templates/part.addpropertyform.php index ff9090b76d8..32affde9526 100644 --- a/apps/contacts/templates/part.addpropertyform.php +++ b/apps/contacts/templates/part.addpropertyform.php @@ -1,7 +1,6 @@ <form id="contacts_addpropertyform"> <input type="hidden" name="id" value="<?php echo $_['id']; ?>"> <select name="name" size="1"> - <option value="BDAY"><?php echo $l->t('Birthday'); ?></option> <option value="ADR"><?php echo $l->t('Address'); ?></option> <option value="TEL"><?php echo $l->t('Telephone'); ?></option> <option value="EMAIL" selected="selected"><?php echo $l->t('Email'); ?></option> @@ -15,8 +14,8 @@ <div id="contacts_addcontactsparts" style="display:none;"> <div id="contacts_addresspart"> <select name="parameters[TYPE]" size="1"> - <option value="WORK"><?php echo $l->t('Work'); ?></option> - <option value="HOME" selected="selected"><?php echo $l->t('Home'); ?></option> + <option value="adr_work"><?php echo $l->t('Work'); ?></option> + <option value="adr_home" selected="selected"><?php echo $l->t('Home'); ?></option> </select> <?php echo $l->t('PO Box'); ?> <input type="text" name="value[0]" value=""> <?php echo $l->t('Extended Address'); ?> <input type="text" name="value[1]" value=""> @@ -28,15 +27,17 @@ </div> <div id="contacts_phonepart"> <select name="parameters[TYPE]" size="1"> - <option value="WORK"><?php echo $l->t('Work'); ?></option> - <option value="CELL" selected="selected"><?php echo $l->t('Mobile'); ?></option> - <option value="HOME"><?php echo $l->t('Home'); ?></option> + <option value="home"><?php echo $l->t('tel_home'); ?></option> + <option value="cell" selected="selected"><?php echo $l->t('tel_cell'); ?></option> + <option value="work"><?php echo $l->t('tel_work'); ?></option> + <option value="text"><?php echo $l->t('tel_text'); ?></option> + <option value="voice"><?php echo $l->t('tel_voice'); ?></option> + <option value="fax"><?php echo $l->t('tel_fax'); ?></option> + <option value="video"><?php echo $l->t('tel_video'); ?></option> + <option value="pager"><?php echo $l->t('tel_pager'); ?></option> </select> <input type="text" name="value" value=""> </div> - <div id="contacts_fieldpart"> - <textarea type="text" name="value"></textarea> - </div> <div id="contacts_generic"> <input type="text" name="value" value=""> </div> diff --git a/apps/contacts/templates/part.contacts.php b/apps/contacts/templates/part.contacts.php index fa6d4790cfc..6664a3671ac 100644 --- a/apps/contacts/templates/part.contacts.php +++ b/apps/contacts/templates/part.contacts.php @@ -1,3 +1,3 @@ <?php foreach( $_['contacts'] as $contact ): ?> - <li x-id="<?php echo $contact['id']; ?>"><a href="index.php?id=<?php echo $contact['id']; ?>"><?php echo $contact['name']; ?></a> </li> + <li data-id="<?php echo $contact['id']; ?>"><a href="index.php?id=<?php echo $contact['id']; ?>"><?php echo $contact['name']; ?></a> </li> <?php endforeach; ?> diff --git a/apps/contacts/templates/part.details.php b/apps/contacts/templates/part.details.php index 4aca8dbc790..0d738b5a0a4 100644 --- a/apps/contacts/templates/part.details.php +++ b/apps/contacts/templates/part.details.php @@ -17,6 +17,7 @@ <?php endforeach; ?> <?php endif; ?> <?php endforeach; ?> - -<a id="contacts_deletecard"><img src="../../core/img/actions/delete.png"></a> -<a id="contacts_addproperty"><img src="../../core/img/actions/download.png"></a> +<div id="contacts_cardoptions"> + <a id="contacts_deletecard"><img src="../../core/img/actions/delete.png"></a> + <a id="contacts_addproperty"><img src="../../core/img/actions/download.png"></a> +</div> diff --git a/apps/contacts/templates/part.property.php b/apps/contacts/templates/part.property.php index 1a4266b3a2b..1611e54b65f 100644 --- a/apps/contacts/templates/part.property.php +++ b/apps/contacts/templates/part.property.php @@ -1,40 +1,48 @@ -<div class="contacts_property" x-line="<?php echo $_['property']['line']; ?>" x-checksum="<?php echo $_['property']['checksum']; ?>"> +<div class="contacts_property" data-checksum="<?php echo $_['property']['checksum']; ?>"> <?php if($_['property']['name'] == 'FN'): ?> <div class="contacts_propertyname"><?php echo $l->t('Name'); ?></div> <div class="contacts_propertyvalue"> - <span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span> <?php echo $_['property']['value']; ?> + <span style="display:none;" data-use="edit"><img src="../../core/img/actions/rename.png"></span> </div> <?php elseif($_['property']['name'] == 'BDAY'): ?> <div class="contacts_propertyname"><?php echo $l->t('Birthday'); ?></div> <div class="contacts_propertyvalue"> <?php echo $l->l('date',new DateTime($_['property']['value'])); ?> - <span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span> - <span style="display:none;" x-use="delete"><img src="../../core/img/actions/delete.png"></span> + <span style="display:none;" data-use="delete"><img src="../../core/img/actions/delete.png"></span> </div> <?php elseif($_['property']['name'] == 'ORG'): ?> <div class="contacts_propertyname"><?php echo $l->t('Organisation'); ?></div> <div class="contacts_propertyvalue"> <?php echo $_['property']['value']; ?> - <span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span> - <span style="display:none;" x-use="delete"><img src="../../core/img/actions/delete.png"></span> + <span style="display:none;" data-use="edit"><img src="../../core/img/actions/rename.png"></span> + <span style="display:none;" data-use="delete"><img src="../../core/img/actions/delete.png"></span> </div> <?php elseif($_['property']['name'] == 'EMAIL'): ?> <div class="contacts_propertyname"><?php echo $l->t('Email'); ?></div> <div class="contacts_propertyvalue"> <?php echo $_['property']['value']; ?> - <span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span> - <span style="display:none;" x-use="delete"><img src="../../core/img/actions/delete.png"></span> + <span style="display:none;" data-use="edit"><img src="../../core/img/actions/rename.png"></span> + <span style="display:none;" data-use="delete"><img src="../../core/img/actions/delete.png"></span> </div> <?php elseif($_['property']['name'] == 'TEL'): ?> - <div class="contacts_propertyname"><?php echo $l->t('Telefon'); ?></div> + <div class="contacts_propertyname"><?php echo $l->t('Telephone'); ?></div> <div class="contacts_propertyvalue"> <?php echo $_['property']['value']; ?> - <span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span> - <span style="display:none;" x-use="delete"><img src="../../core/img/actions/delete.png"></span> + <?php if(isset($_['property']['parameters']['TYPE'])): ?> + (<?php echo $l->t('tel_'.strtolower($_['property']['parameters']['TYPE'])); ?>) + <?php endif; ?> + <span style="display:none;" data-use="edit"><img src="../../core/img/actions/rename.png"></span> + <span style="display:none;" data-use="delete"><img src="../../core/img/actions/delete.png"></span> </div> <?php elseif($_['property']['name'] == 'ADR'): ?> - <div class="contacts_propertyname"><?php echo $l->t('Address'); ?></div> + <div class="contacts_propertyname"> + <?php echo $l->t('Address'); ?> + <?php if(isset($_['property']['parameters']['TYPE'])): ?> + <br> + (<?php echo $l->t('adr_'.strtolower($_['property']['parameters']['TYPE'])); ?>) + <?php endif; ?> + </div> <div class="contacts_propertyvalue"> <?php echo $l->t('PO Box'); ?> <?php echo $_['property']['value'][0]; ?><br> <?php echo $l->t('Extended Address'); ?> <?php echo $_['property']['value'][1]; ?><br> @@ -43,8 +51,8 @@ <?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('Country'); ?> <?php echo $_['property']['value'][6]; ?> - <span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span> - <span style="display:none;" x-use="delete"><img src="../../core/img/actions/delete.png"></span> + <span style="display:none;" data-use="edit"><img src="../../core/img/actions/rename.png"></span> + <span style="display:none;" data-use="delete"><img src="../../core/img/actions/delete.png"></span> </div> <?php endif; ?> </div> diff --git a/apps/contacts/templates/part.setpropertyform.php b/apps/contacts/templates/part.setpropertyform.php index cd774ee6593..d8127bb08b0 100644 --- a/apps/contacts/templates/part.setpropertyform.php +++ b/apps/contacts/templates/part.setpropertyform.php @@ -1,6 +1,5 @@ <form id="contacts_setpropertyform"> <input type="hidden" name="checksum" value="<?php echo $_['property']['checksum']; ?>"> - <input type="hidden" name="line" value="<?php echo $_['property']['line']; ?>"> <input type="hidden" name="id" value="<?php echo $_['id']; ?>"> <?php if($_['property']['name']=='ADR'): ?> <?php echo $l->t('PO Box'); ?> <input type="text" name="value[0]" value="<?php echo $_['property']['value'][0]; ?>"> @@ -12,8 +11,6 @@ <?php echo $l->t('Country'); ?> <input type="text" name="value[6]" value="<?php echo $_['property']['value'][6]; ?>"> <?php elseif($_['property']['name']=='TEL'): ?> <input type="text" name="value" value="<?php echo $_['property']['value']; ?>"> - <?php elseif($_['property']['name']=='NOTE'): ?> - <textarea type="text" name="value"><?php echo $_['property']['value']; ?></textarea> <?php else: ?> <input type="text" name="value" value="<?php echo $_['property']['value']; ?>"> <?php endif; ?> |