').attr('class', 'invitation' + (status ? ' ' + status : ''))
.append($('').text(user))
.append($(' | ').text(rcmail.gettext('kolab_files.status' + status)))
- .append($(' | '));
- // @todo: delete and accept button
+ .append(buttons);
};
@@ -3107,9 +3120,39 @@ function kolab_files_ui()
table = $('#document-editors-dialog table > tbody');
$.each(response.result.list || {}, function() {
- table.append(kolab_files_attendee_record(this.user, this.status));
+ var record = kolab_files_attendee_record(this.user, this.status);
+ table.append(record);
if (info.session && info.session.invitations)
- info.session.invitations.push($.extend({status: 'invited'}, this));
+ info.session.invitations.push($.extend({status: 'invited', record: record}, this));
+ });
+ };
+
+ // Remove document session participants
+ this.document_remove = function(id, attendees)
+ {
+ if (attendees.length) {
+ this.req = this.set_busy(true, 'kolab_files.documentremoving');
+ this.request('document_remove', {id: id, users: attendees}, 'document_remove_response');
+ }
+ };
+
+ // document remove response handler
+ this.document_remove_response = function(response)
+ {
+ if (!this.response(response) || !response.result)
+ return;
+
+ var info = rcmail.env.file_data;
+
+ $.each(response.result.list || {}, function(i, user) {
+ var invitations = [];
+ $.each(info.session.invitations, function(i, u) {
+ if (u.user == user && u.record)
+ u.record.remove();
+ else
+ invitations.push(u);
+ });
+ info.session.invitations = invitations;
});
};
diff --git a/plugins/kolab_files/lib/kolab_files_engine.php b/plugins/kolab_files/lib/kolab_files_engine.php
index fda250ce..1bd0d728 100644
--- a/plugins/kolab_files/lib/kolab_files_engine.php
+++ b/plugins/kolab_files/lib/kolab_files_engine.php
@@ -950,7 +950,8 @@ class kolab_files_engine
*/
protected function action_edit()
{
- $this->plugin->add_label('sessionterminating', 'unsavedchanges');
+ $this->plugin->add_label('sessionterminating', 'unsavedchanges', 'documentinviting',
+ 'documentremoving', 'removeparticipant');
$this->file_opener(intval($_GET['_viewer']));
}
diff --git a/plugins/kolab_files/localization/en_US.inc b/plugins/kolab_files/localization/en_US.inc
index 88ba16c6..b0c0f368 100644
--- a/plugins/kolab_files/localization/en_US.inc
+++ b/plugins/kolab_files/localization/en_US.inc
@@ -118,6 +118,9 @@ $labels['statusinvited'] = 'Invited';
$labels['statusaccepted'] = 'Accepted';
$labels['statusdeclined'] = 'Declined';
$labels['statusrequested'] = 'Requested';
+$labels['documentinviting'] = 'Inviting participant(s)...';
+$labels['documentremoving'] = 'Removing participant(s)...';
+$labels['removeparticipant'] = 'Remove';
$labels['storepasswords'] = 'remember password';
$labels['storepasswordsdesc'] = 'Stored passwords will be encrypted. Enable this if you do not want to be asked for the password on every login or you want this storage to be available via WebDAV.';
diff --git a/plugins/kolab_files/skins/larry/style.css b/plugins/kolab_files/skins/larry/style.css
index a878d89d..7f1b6cfa 100644
--- a/plugins/kolab_files/skins/larry/style.css
+++ b/plugins/kolab_files/skins/larry/style.css
@@ -596,3 +596,10 @@ table.propform td.source table.propform td {
#document-editors-dialog table tr.organizer td {
color: #888;
}
+
+#document-editors-dialog table td.options a.delete {
+ background: url(../../../../skins/larry/images/buttons.png) -7px -379px no-repeat;
+ height: 16px;
+ width: 16px;
+ display: block;
+}
|