}
$id = OC_Contacts_VCard::add($aid,$vcard->serialize());
+$adr_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'ADR');
+$phone_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'TEL');
+
$details = OC_Contacts_VCard::structureContact($vcard);
$name = $details['FN'][0]['value'];
$tmpl = new OC_Template('contacts','part.details');
$tmpl->assign('details',$details);
$tmpl->assign('id',$id);
+$tmpl->assign('adr_types',$adr_types);
+$tmpl->assign('phone_types',$phone_types);
$page = $tmpl->fetchPage();
OC_JSON::success(array('data' => array( 'id' => $id, 'name' => $name, 'page' => $page )));
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');
+$tmpl->assign('adr_types',$adr_types);
+$tmpl->assign('phone_types',$phone_types);
$tmpl->assign('property',OC_Contacts_VCard::structureProperty($vcard->children[$line],$line));
$page = $tmpl->fetchPage();
}
$adr_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'ADR');
+$phone_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'TEL');
$tmpl = new OC_Template('contacts','part.setpropertyform');
$tmpl->assign('id',$id);
$tmpl->assign('checksum',$checksum);
$tmpl->assign('property',OC_Contacts_VCard::structureProperty($vcard->children[$line]));
$tmpl->assign('adr_types',$adr_types);
+$tmpl->assign('phone_types',$phone_types);
$page = $tmpl->fetchPage();
OC_JSON::success(array('data' => array( 'page' => $page )));
$details = OC_Contacts_VCard::structureContact($vcard);
}
+$l10n = new OC_L10N('contacts');
+$adr_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'ADR');
+$phone_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'TEL');
+
// Process the template
$tmpl = new OC_Template( 'contacts', 'index', 'user' );
+$tmpl->assign('adr_types',$adr_types);
+$tmpl->assign('phone_types',$phone_types);
$tmpl->assign('addressbooks', $addressbooks);
$tmpl->assign('contacts', $contacts);
$tmpl->assign('details', $details );
<p class="contacts_property_data">
<?php echo $_['property']['value']; ?>
<?php if(isset($_['property']['parameters']['TYPE'])): ?>
- (<?php echo $l->t(ucwords(str_replace('cell','mobile',strtolower($_['property']['parameters']['TYPE'])))); ?>)
+<?php
+ $type = $_['property']['parameters']['TYPE'];
+ if (isset($_['phone_types'][strtoupper($type)])){
+ $label=$_['phone_types'][strtoupper($type)];
+ }
+ else{
+ $label=$l->t(ucwords(strtolower($type)));
+ }
+?>
+ (<?php echo $label; ?>)
<?php endif; ?>
<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 class="svg action" src="<?php echo image_path('', 'actions/delete.svg'); ?>" /></span>
<?php echo $l->t('Address'); ?>
<?php if(isset($_['property']['parameters']['TYPE'])): ?>
<br>
- (<?php echo $l->t(ucwords($_['property']['parameters']['TYPE'])); ?>)
+<?php
+ $type = $_['property']['parameters']['TYPE'];
+ if (isset($_['adr_types'][strtoupper($type)])){
+ $label=$_['adr_types'][strtoupper($type)];
+ }
+ else{
+ $label=$l->t(ucwords(strtolower($type)));
+ }
+?>
+ (<?php echo $label; ?>)
<?php endif; ?>
</p>
<p class="contacts_property_data">
</ol>
<?php elseif($_['property']['name']=='TEL'): ?>
<p class="contacts_property_name"><label for="tel"><?php echo $l->t('Phone'); ?></label></p>
- <p class="contacts_property_data"><input id="tel" type="phone" name="value" value="<?php echo $_['property']['value']; ?>"></p>
+ <p class="contacts_property_data"><input id="tel" type="phone" name="value" value="<?php echo $_['property']['value']; ?>">
+ <select id="tel_type" name="parameters[TYPE]" size="1">
+ <?php echo html_select_options($_['phone_types'], strtoupper($_['property']['parameters']['TYPE'])) ?>
+ </select></p>
<?php elseif($_['property']['name']=='EMAIL'): ?>
<p class="contacts_property_name"><label for="email"><?php echo $l->t('Email'); ?></label></p>
<p class="contacts_property_data"><input id="email" type="text" name="value" value="<?php echo $_['property']['value']; ?>"></p>