summaryrefslogtreecommitdiffstats
path: root/apps/contacts/templates
diff options
context:
space:
mode:
authorJakob Sack <kde@jakobsack.de>2011-08-09 13:53:58 +0200
committerJakob Sack <kde@jakobsack.de>2011-08-09 13:53:58 +0200
commit76fc062f27a178be97b2f4bf285f7f07c6361f60 (patch)
treed69727c82e394f22bd08be14d146890592da3d70 /apps/contacts/templates
parent4e5b6f72c17ec361757495e89d3f1929f3981dbb (diff)
downloadnextcloud-server-76fc062f27a178be97b2f4bf285f7f07c6361f60.tar.gz
nextcloud-server-76fc062f27a178be97b2f4bf285f7f07c6361f60.zip
Some more work on the address book
Diffstat (limited to 'apps/contacts/templates')
-rw-r--r--apps/contacts/templates/_details.php4
-rw-r--r--apps/contacts/templates/index.php15
-rw-r--r--apps/contacts/templates/part.addcardform.php13
-rw-r--r--apps/contacts/templates/part.addpropertyform.php43
-rw-r--r--apps/contacts/templates/part.contacts.php (renamed from apps/contacts/templates/_contacts.php)2
-rw-r--r--apps/contacts/templates/part.details.php22
-rw-r--r--apps/contacts/templates/part.property.php50
-rw-r--r--apps/contacts/templates/part.setpropertyform.php21
8 files changed, 159 insertions, 11 deletions
diff --git a/apps/contacts/templates/_details.php b/apps/contacts/templates/_details.php
deleted file mode 100644
index e27b17ef2eb..00000000000
--- a/apps/contacts/templates/_details.php
+++ /dev/null
@@ -1,4 +0,0 @@
-Name <?php echo $_['details']['FN'][0]['value']; ?>
-<?php if(array_key_exists('PHOTO',$_['details'])): ?>
- <img src="photo.php?id=<?php echo $_['id']; ?>">
-<?php endif; ?> \ No newline at end of file
diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php
index ca189cb4c8a..e6dd45739bc 100644
--- a/apps/contacts/templates/index.php
+++ b/apps/contacts/templates/index.php
@@ -3,7 +3,8 @@ OC_Util::addScript('contacts','interface');
OC_Util::addStyle('contacts','styles');
?>
-<div class="contacts_addressbooks">
+<?php
+/*<div class="contacts_addressbooks">
<div class="contacts_addressbooksexpander">
Addressbooks
</div>
@@ -13,12 +14,14 @@ OC_Util::addStyle('contacts','styles');
<?php endforeach; ?>
<br>To use this addressbook, use .../apps/contacts/carddav.php/addressbooks/USERNAME/addressbookname.php
</div>
-</div>
-<div class="contacts_contacts leftcontent">
+</div>*/
+?>
+<div id="contacts_contacts" class="leftcontent">
<ul>
- <?php echo $this->inc("_contacts"); ?>
+ <?php echo $this->inc("part.contacts"); ?>
</ul>
+ <a id="contacts_newcontact"><?php echo $l->t('Add Contact'); ?></a>
</div>
-<div class="contacts_details rightcontent">
- <?php echo $this->inc("_details"); ?>
+<div id="contacts_details" class="rightcontent" x-id="<?php echo $_['id']; ?>">
+ <?php echo $this->inc("part.details"); ?>
</div>
diff --git a/apps/contacts/templates/part.addcardform.php b/apps/contacts/templates/part.addcardform.php
new file mode 100644
index 00000000000..94a59fe097c
--- /dev/null
+++ b/apps/contacts/templates/part.addcardform.php
@@ -0,0 +1,13 @@
+<form id="contacts_addcardform">
+ <?php if(count($_['addressbooks'])==1): ?>
+ <input type="hidden" name="id" value="<?php echo $_['addressbooks'][0]['id']; ?>">
+ <?php else: ?>
+ <select name="id" size="1">
+ <?php foreach($_['addressbooks'] as $addressbook): ?>
+ <option value="<?php echo $addressbook['id']; ?>"><?php echo $addressbook['displayname']; ?></option>
+ <?php endforeach; ?>
+ </select>
+ <?php endif; ?>
+ <input type="text" name="fn" value=""><br>
+ <input type="submit">
+</form>
diff --git a/apps/contacts/templates/part.addpropertyform.php b/apps/contacts/templates/part.addpropertyform.php
new file mode 100644
index 00000000000..ff9090b76d8
--- /dev/null
+++ b/apps/contacts/templates/part.addpropertyform.php
@@ -0,0 +1,43 @@
+<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>
+ <option value="ORG"><?php echo $l->t('Organization'); ?></option>
+ </select>
+ <div id="contacts_generic">
+ <input type="text" name="value" value="">
+ </div>
+ <input type="submit">
+</form>
+<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>
+ </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="">
+ <?php echo $l->t('Street Name'); ?> <input type="text" name="value[2]" value="">
+ <?php echo $l->t('City'); ?> <input type="text" name="value[3]" value="">
+ <?php echo $l->t('Region'); ?> <input type="text" name="value[4]" value="">
+ <?php echo $l->t('Postal Code'); ?> <input type="text" name="value[5]" value="">
+ <?php echo $l->t('Country'); ?> <input type="text" name="value[6]" value="">
+ </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>
+ </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>
+</div>
diff --git a/apps/contacts/templates/_contacts.php b/apps/contacts/templates/part.contacts.php
index bf633b79b04..fa6d4790cfc 100644
--- a/apps/contacts/templates/_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 x-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
new file mode 100644
index 00000000000..4aca8dbc790
--- /dev/null
+++ b/apps/contacts/templates/part.details.php
@@ -0,0 +1,22 @@
+<?php if(array_key_exists('PHOTO',$_['details'])): ?>
+ <img src="photo.php?id=<?php echo $_['id']; ?>">
+<?php endif; ?>
+<?php echo $this->inc('part.property', array('property' => $_['details']['FN'][0])); ?>
+<?php if(isset($_['details']['BDAY'])): // Emails first ?>
+ <?php echo $this->inc('part.property', array('property' => $_['details']['BDAY'][0])); ?>
+<?php endif; ?>
+<?php if(isset($_['details']['ORG'])): // Emails first ?>
+ <?php echo $this->inc('part.property', array('property' => $_['details']['ORG'][0])); ?>
+<?php endif; ?>
+
+<?php foreach(array('EMAIL','TEL','ADR') as $type): ?>
+ <?php if(isset($_['details'][$type])): // Emails first ?>
+ <br>
+ <?php foreach($_['details'][$type] as $property): ?>
+ <?php echo $this->inc('part.property',array('property' => $property )); ?>
+ <?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>
diff --git a/apps/contacts/templates/part.property.php b/apps/contacts/templates/part.property.php
new file mode 100644
index 00000000000..1a4266b3a2b
--- /dev/null
+++ b/apps/contacts/templates/part.property.php
@@ -0,0 +1,50 @@
+<div class="contacts_property" x-line="<?php echo $_['property']['line']; ?>" x-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']; ?>
+ </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>
+ </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>
+ </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>
+ </div>
+ <?php elseif($_['property']['name'] == 'TEL'): ?>
+ <div class="contacts_propertyname"><?php echo $l->t('Telefon'); ?></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>
+ </div>
+ <?php elseif($_['property']['name'] == 'ADR'): ?>
+ <div class="contacts_propertyname"><?php echo $l->t('Address'); ?></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>
+ <?php echo $l->t('Street Name'); ?> <?php echo $_['property']['value'][2]; ?><br>
+ <?php echo $l->t('City'); ?> <?php echo $_['property']['value'][3]; ?><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('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>
+ </div>
+ <?php endif; ?>
+</div>
diff --git a/apps/contacts/templates/part.setpropertyform.php b/apps/contacts/templates/part.setpropertyform.php
new file mode 100644
index 00000000000..cd774ee6593
--- /dev/null
+++ b/apps/contacts/templates/part.setpropertyform.php
@@ -0,0 +1,21 @@
+<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]; ?>">
+ <?php echo $l->t('Extended Address'); ?> <input type="text" name="value[1]" value="<?php echo $_['property']['value'][1]; ?>">
+ <?php echo $l->t('Street Name'); ?> <input type="text" name="value[2]" value="<?php echo $_['property']['value'][2]; ?>">
+ <?php echo $l->t('City'); ?> <input type="text" name="value[3]" value="<?php echo $_['property']['value'][3]; ?>">
+ <?php echo $l->t('Region'); ?> <input type="text" name="value[4]" value="<?php echo $_['property']['value'][4]; ?>">
+ <?php echo $l->t('Postal Code'); ?> <input type="text" name="value[5]" value="<?php echo $_['property']['value'][5]; ?>">
+ <?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; ?>
+ <input type="submit">
+</form>