Initial Elastic support in kolab_addressbook
This commit is contained in:
parent
a3a1691cde
commit
0739986326
4 changed files with 178 additions and 24 deletions
|
@ -218,21 +218,11 @@ rcube_webmail.prototype.book_showurl = function()
|
|||
}
|
||||
|
||||
if (url) {
|
||||
$('div.showurldialog:ui-dialog').dialog('close');
|
||||
|
||||
var txt = rcmail.gettext('carddavurldescription', 'kolab_addressbook'),
|
||||
$dialog = $('<div>').addClass('showurldialog').append('<p>' + txt + '</p>'),
|
||||
textbox = $('<textarea>').addClass('urlbox').css('width', '100%').attr('rows', 2).appendTo($dialog);
|
||||
dialog = $('<div>').addClass('showurldialog').append('<p>' + txt + '</p>'),
|
||||
textbox = $('<textarea>').addClass('urlbox').css('width', '100%').attr('rows', 3).appendTo(dialog);
|
||||
|
||||
$dialog.dialog({
|
||||
resizable: true,
|
||||
closeOnEscape: true,
|
||||
title: rcmail.gettext('bookshowurl', 'kolab_addressbook'),
|
||||
close: function() {
|
||||
$dialog.dialog("destroy").remove();
|
||||
},
|
||||
width: 520
|
||||
}).show();
|
||||
this.simple_dialog(dialog, rcmail.gettext('bookshowurl', 'kolab_addressbook'), null, {width: 520});
|
||||
|
||||
textbox.val(url).select();
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ class kolab_addressbook_ui
|
|||
|
||||
if (empty($this->rc->action)) {
|
||||
// Include stylesheet (for directorylist)
|
||||
$this->plugin->include_stylesheet($this->plugin->local_skin_path().'/kolab_addressbook.css');
|
||||
$this->plugin->include_stylesheet($this->plugin->local_skin_path().'/kolab_addressbook.css', true);
|
||||
|
||||
// include kolab folderlist widget if available
|
||||
if (in_array('libkolab', $this->plugin->api->loaded_plugins())) {
|
||||
|
@ -85,7 +85,8 @@ class kolab_addressbook_ui
|
|||
$this->plugin->api->output->button(array(
|
||||
'label' => 'kolab_addressbook.'.str_replace('-', '', $command),
|
||||
'domain' => $this->ID,
|
||||
'classact' => 'active',
|
||||
'class' => str_replace('-', ' ', $command) . ' disabled',
|
||||
'classact' => str_replace('-', ' ', $command) . ' active',
|
||||
'command' => $command,
|
||||
'type' => 'link'
|
||||
)));
|
||||
|
@ -98,7 +99,8 @@ class kolab_addressbook_ui
|
|||
$this->plugin->api->output->button(array(
|
||||
'label' => 'managefolders',
|
||||
'type' => 'link',
|
||||
'classact' => 'active',
|
||||
'class' => 'folders disabled',
|
||||
'classact' => 'folders active',
|
||||
'command' => 'folders',
|
||||
'task' => 'settings',
|
||||
)));
|
||||
|
@ -117,8 +119,8 @@ class kolab_addressbook_ui
|
|||
'kolab_addressbook.nraddressbooksfound',
|
||||
'kolab_addressbook.noaddressbooksfound',
|
||||
'kolab_addressbook.foldersubscribe',
|
||||
'resetsearch');
|
||||
|
||||
'resetsearch'
|
||||
);
|
||||
|
||||
if ($this->plugin->bonnie_api) {
|
||||
$this->rc->output->set_env('kolab_audit_trail', true);
|
||||
|
@ -139,7 +141,7 @@ class kolab_addressbook_ui
|
|||
}
|
||||
// include stylesheet for audit trail
|
||||
else if ($this->rc->action == 'show' && $this->plugin->bonnie_api) {
|
||||
$this->plugin->include_stylesheet($this->plugin->local_skin_path().'/kolab_addressbook.css');
|
||||
$this->plugin->include_stylesheet($this->plugin->local_skin_path().'/kolab_addressbook.css', true);
|
||||
$this->rc->output->add_label('kolab_addressbook.showhistory');
|
||||
}
|
||||
// book create/edit form
|
||||
|
@ -206,7 +208,7 @@ class kolab_addressbook_ui
|
|||
$options = $storage->folder_info($folder);
|
||||
}
|
||||
|
||||
$form = array();
|
||||
$form = array();
|
||||
|
||||
// General tab
|
||||
$form['props'] = array(
|
||||
|
@ -236,9 +238,10 @@ class kolab_addressbook_ui
|
|||
$hidden_fields[] = array('name' => '_parent', 'value' => $path_imap);
|
||||
}
|
||||
else {
|
||||
$select = kolab_storage::folder_selector('contact', array('name' => '_parent'), $folder);
|
||||
$prop = array('name' => '_parent', 'id' => '_parent');
|
||||
$select = kolab_storage::folder_selector('contact', $prop, $folder);
|
||||
|
||||
$form['props']['fieldsets']['location']['content']['path'] = array(
|
||||
$form['props']['fieldsets']['location']['content']['parent'] = array(
|
||||
'label' => $this->plugin->gettext('parentbook'),
|
||||
'value' => $select->show(strlen($folder) ? $path_imap : ''),
|
||||
);
|
||||
|
@ -259,7 +262,7 @@ class kolab_addressbook_ui
|
|||
$out = "$form_start\n";
|
||||
|
||||
// Create form output
|
||||
foreach ($form as $tab) {
|
||||
foreach ($form as $idx => $tab) {
|
||||
if (!empty($tab['fieldsets']) && is_array($tab['fieldsets'])) {
|
||||
$content = '';
|
||||
foreach ($tab['fieldsets'] as $fieldset) {
|
||||
|
@ -274,7 +277,12 @@ class kolab_addressbook_ui
|
|||
}
|
||||
|
||||
if ($content) {
|
||||
$out .= html::tag('fieldset', null, html::tag('legend', null, rcube::Q($tab['name'])) . $content) ."\n";
|
||||
if ($idx != 'props') {
|
||||
$out .= html::tag('fieldset', null, html::tag('legend', null, rcube::Q($tab['name'])) . $content) ."\n";
|
||||
}
|
||||
else {
|
||||
$out .= $content ."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,143 @@
|
|||
<div id="contacthistory" class="uidialog" aria-hidden="true">
|
||||
<roundcube:object name="plugin.object_changelog_table" class="records-table changelog-table" />
|
||||
<div class="compare-button"><input type="button" class="button" value="↳ <roundcube:label name='libkolab.compare' />" /></div>
|
||||
</div>
|
||||
|
||||
<div id="contactdiff" class="uidialog contentbox" aria-hidden="true">
|
||||
<h2 class="contact-names">Contact Name</h2>
|
||||
<h2 class="contact-names-new diff-text-new"></h2>
|
||||
|
||||
<div class="form-section contact-name">
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-nickname">
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-organization">
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-department">
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-jobtitle">
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-photo">
|
||||
<img class="diff-img-old" /> ⇢
|
||||
<img class="diff-img-new" />
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-email">
|
||||
<label><roundcube:label name="email" /><span class="index"></span></label>
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-phone">
|
||||
<label><roundcube:label name="phone" /><span class="index"></span></label>
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-address">
|
||||
<label><roundcube:label name="address" /><span class="index"></span></label>
|
||||
<div class="diff-text-diff" style="white-space:pre-wrap"></div>
|
||||
<div class="diff-text-old"></div>
|
||||
<div class="diff-text-new"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-website">
|
||||
<label><roundcube:label name="website" /><span class="index"></span></label>
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-im">
|
||||
<label><roundcube:label name="instantmessenger" /><span class="index"></span></label>
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-gender">
|
||||
<label><roundcube:label name="gender" /><span class="index"></span></label>
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-birthday">
|
||||
<label><roundcube:label name="birthday" /><span class="index"></span></label>
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-anniversary">
|
||||
<label><roundcube:label name="anniversary" /><span class="index"></span></label>
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-profession">
|
||||
<label><roundcube:label name="profession" /><span class="index"></span></label>
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-manager">
|
||||
<label><roundcube:label name="manager" /><span class="index"></span></label>
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-assistant">
|
||||
<label><roundcube:label name="assistant" /><span class="index"></span></label>
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-spouse">
|
||||
<label><roundcube:label name="spouse" /><span class="index"></span></label>
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-children">
|
||||
<label><roundcube:label name="children" /><span class="index"></span></label>
|
||||
<span class="diff-text-old"></span> ⇢
|
||||
<span class="diff-text-new"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-notes">
|
||||
<label><roundcube:label name="notes" /></label>
|
||||
<div class="diff-text-diff" style="white-space:pre-wrap"></div>
|
||||
<div class="diff-text-old"></div>
|
||||
<div class="diff-text-new"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-freebusyurl">
|
||||
<label><roundcube:label name="kolab_addressbook.freebusyurl" /></label>
|
||||
<div class="diff-text-old"></div>
|
||||
<div class="diff-text-new"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-pgppublickey">
|
||||
<label><roundcube:label name="kolab_addressbook.pgppublickey" /></label>
|
||||
<div class="diff-text-old" style="white-space:pre-wrap"></div>
|
||||
<div class="diff-text-new" style="white-space:pre-wrap"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-section contact-pkcs7publickey">
|
||||
<label><roundcube:label name="kolab_addressbook.pkcs7publickey" /></label>
|
||||
<div class="diff-text-old" style="white-space:pre-wrap"></div>
|
||||
<div class="diff-text-new" style="white-space:pre-wrap"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,13 @@
|
|||
<roundcube:include file="includes/layout.html" />
|
||||
|
||||
<h1 class="voice"><roundcube:label name="kolab_addressbook.bookproperties" /></h1>
|
||||
|
||||
<div class="formcontent">
|
||||
<roundcube:object name="bookdetails" class="propform" />
|
||||
</div>
|
||||
|
||||
<div class="formbuttons">
|
||||
<roundcube:button command="book-save" class="btn btn-primary submit" label="save" />
|
||||
</div>
|
||||
|
||||
<roundcube:include file="includes/footer.html" />
|
Loading…
Add table
Reference in a new issue