|
|
|
@ -326,20 +326,7 @@ function rcube_webmail()
|
|
|
|
|
|
|
|
|
|
if ((this.env.action == 'add' || this.env.action == 'edit') && this.gui_objects.editform) {
|
|
|
|
|
this.enable_command('save', true);
|
|
|
|
|
this.enable_command('upload-photo', this.env.coltypes.photo ? true : false);
|
|
|
|
|
this.enable_command('delete-photo', this.env.coltypes.photo && this.env.action == 'edit');
|
|
|
|
|
|
|
|
|
|
for (var col in this.env.coltypes)
|
|
|
|
|
this.init_edit_field(col, null);
|
|
|
|
|
|
|
|
|
|
$('.contactfieldgroup .row a.deletebutton').click(function(){ ref.delete_edit_field(this); return false });
|
|
|
|
|
|
|
|
|
|
$('select.addfieldmenu').change(function(e){
|
|
|
|
|
ref.insert_edit_field($(this).val(), $(this).attr('rel'), this);
|
|
|
|
|
this.selectedIndex = 0;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("input[type='text']:visible").first().focus();
|
|
|
|
|
this.init_contact_form();
|
|
|
|
|
}
|
|
|
|
|
else if (this.gui_objects.qsearchbox) {
|
|
|
|
|
this.enable_command('search', 'reset-search', 'moveto', true);
|
|
|
|
@ -3840,6 +3827,28 @@ function rcube_webmail()
|
|
|
|
|
this.enable_command('export', (this.contact_list.rowcount > 0));
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.init_contact_form = function()
|
|
|
|
|
{
|
|
|
|
|
var ref = this, col;
|
|
|
|
|
|
|
|
|
|
this.set_photo_actions($('#ff_photo').val());
|
|
|
|
|
|
|
|
|
|
for (col in this.env.coltypes)
|
|
|
|
|
this.init_edit_field(col, null);
|
|
|
|
|
|
|
|
|
|
$('.contactfieldgroup .row a.deletebutton').click(function() {
|
|
|
|
|
ref.delete_edit_field(this);
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('select.addfieldmenu').change(function(e) {
|
|
|
|
|
ref.insert_edit_field($(this).val(), $(this).attr('rel'), this);
|
|
|
|
|
this.selectedIndex = 0;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("input[type='text']:visible").first().focus();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.group_create = function()
|
|
|
|
|
{
|
|
|
|
|
if (!this.gui_objects.folderlist || !this.env.address_sources[this.env.source].groups)
|
|
|
|
@ -4139,17 +4148,11 @@ function rcube_webmail()
|
|
|
|
|
|
|
|
|
|
this.replace_contact_photo = function(id)
|
|
|
|
|
{
|
|
|
|
|
$('#ff_photo').val(id);
|
|
|
|
|
|
|
|
|
|
var buttons = this.buttons['upload-photo'];
|
|
|
|
|
for (var n=0; n < buttons.length; n++)
|
|
|
|
|
$('#'+buttons[n].id).html(this.get_label(id == '-del-' ? 'addphoto' : 'replacephoto'));
|
|
|
|
|
|
|
|
|
|
var img_src = id == '-del-' ? this.env.photo_placeholder :
|
|
|
|
|
this.env.comm_path + '&_action=photo&_source=' + this.env.source + '&_cid=' + this.env.cid + '&_photo=' + id;
|
|
|
|
|
$(this.gui_objects.contactphoto).children('img').attr('src', img_src);
|
|
|
|
|
|
|
|
|
|
this.enable_command('delete-photo', id != '-del-');
|
|
|
|
|
this.set_photo_actions(id);
|
|
|
|
|
$(this.gui_objects.contactphoto).children('img').attr('src', img_src);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.photo_upload_end = function()
|
|
|
|
@ -4158,6 +4161,17 @@ function rcube_webmail()
|
|
|
|
|
delete this.photo_upload_id;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.set_photo_actions = function(id)
|
|
|
|
|
{
|
|
|
|
|
var n, buttons = this.buttons['upload-photo'];
|
|
|
|
|
for (n=0; n < buttons.length; n++)
|
|
|
|
|
$('#'+buttons[n].id).html(this.get_label(id == '-del-' ? 'addphoto' : 'replacephoto'));
|
|
|
|
|
|
|
|
|
|
$('#ff_photo').val(id);
|
|
|
|
|
this.enable_command('upload-photo', this.env.coltypes.photo ? true : false);
|
|
|
|
|
this.enable_command('delete-photo', this.env.coltypes.photo && id != '-del-');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************/
|
|
|
|
|
/********* user settings methods *********/
|
|
|
|
|