Some more fixes. It basically works but looks ugly
This commit is contained in:
parent
6d1c266e1e
commit
c6f499c685
14 changed files with 90 additions and 208 deletions
|
@ -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 )));
|
|
@ -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!'))));
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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 )));
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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 )));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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; ?>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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; ?>
|
||||
|
|
Loading…
Reference in a new issue