diff --git a/program/js/app.js b/program/js/app.js index c3012fc7b..cd8c828f7 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -5918,6 +5918,7 @@ function rcube_webmail() this.enable_command('export-selected', 'copy', selected > 0); this.enable_command('edit', id && writable); this.enable_command('delete', 'move', selected && writable); + this.enable_command('qrcode', selected == 1); return false; }; @@ -6876,7 +6877,7 @@ function rcube_webmail() options = {button: false, cancel_button: 'close', width: 300, height: 300}, img = new Image(300, 300); - img.src = this.url('addressbook/qrcode', {_source: this.env.source, _cid: this.env.cid}); + img.src = this.url('addressbook/qrcode', {_source: this.env.source, _cid: this.env.cid || this.contact_list.get_single_selection()}); return this.simple_dialog(img, title, null, options); }; diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index 5d99ad523..519201950 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -131,7 +131,9 @@ $RCMAIL->register_action_map(array( 'search-delete' => 'search.inc', )); - +// Disable qr-code if php-gd or Endroid's QrCode is not installed +$OUTPUT->set_env('qrcode', function_exists('imagecreate') && class_exists('Endroid\QrCode\QrCode')); +$OUTPUT->add_label('qrcode'); // instantiate a contacts object according to the given source function rcmail_contact_source($source=null, $init_env=false, $writable=false) diff --git a/program/steps/addressbook/show.inc b/program/steps/addressbook/show.inc index 74779e454..e8e3712b6 100644 --- a/program/steps/addressbook/show.inc +++ b/program/steps/addressbook/show.inc @@ -42,10 +42,6 @@ if ($cid && ($record = ($CONTACT_RECORD ?: $CONTACTS->get_record($cid, true)))) // get address book name (for display) rcmail_set_sourcename($CONTACTS); -// Disable qr-code if php-gd or Endroid's QrCode is not installed -$OUTPUT->set_env('qrcode', function_exists('imagecreate') && class_exists('Endroid\QrCode\QrCode')); -$OUTPUT->add_label('qrcode'); - $OUTPUT->add_handlers(array( 'contacthead' => 'rcmail_contact_head', 'contactdetails' => 'rcmail_contact_details', diff --git a/skins/classic/addressbook.css b/skins/classic/addressbook.css index 95b7a7d28..91e675ff3 100644 --- a/skins/classic/addressbook.css +++ b/skins/classic/addressbook.css @@ -104,6 +104,11 @@ background-position: 7px 20px; } +#contactmenu li a.qrcode +{ + background-position: 7px -39px; +} + #contactmenu li a.assigngroup { background-position: 7px 0; diff --git a/skins/classic/images/contactactions.png b/skins/classic/images/contactactions.png index 5fd9ef3f9..8eda5388f 100644 Binary files a/skins/classic/images/contactactions.png and b/skins/classic/images/contactactions.png differ diff --git a/skins/classic/templates/addressbook.html b/skins/classic/templates/addressbook.html index 133ef45f9..57b5bba4d 100644 --- a/skins/classic/templates/addressbook.html +++ b/skins/classic/templates/addressbook.html @@ -59,6 +59,9 @@