Ticket #1485012: previewnotread.r2044.patch

File previewnotread.r2044.patch, 5.8 KB (added by JohnDoh, 22 months ago)
  • config/main.inc.php.dist

    diff -Naur --exclude='*.svn*' roundcube_svn/config/main.inc.php.dist roundcube_pub/config/main.inc.php.dist
    old new  
    364364// default setting if preview pane is enabled 
    365365$rcmail_config['preview_pane'] = FALSE; 
    366366 
     367// Preview pane mark as read 
     368$rcmail_config['preview_pane_mark_read'] = TRUE; 
     369 
    367370// focus new window if new message arrives 
    368371$rcmail_config['focus_on_new_message'] = true; 
    369372 
  • program/include/rcmail.php

    diff -Naur --exclude='*.svn*' roundcube_svn/program/include/rcmail.php roundcube_pub/program/include/rcmail.php
    old new  
    286286    if (!($this->output instanceof rcube_template)) 
    287287      $this->output = new rcube_template($this->task, $framed); 
    288288 
    289     foreach (array('flag_for_deletion','read_when_deleted') as $js_config_var) { 
     289    foreach (array('flag_for_deletion','read_when_deleted','preview_pane_mark_read') as $js_config_var) { 
    290290      $this->output->set_env($js_config_var, $this->config->get($js_config_var)); 
    291291    } 
    292292     
  • program/js/app.js

    diff -Naur --exclude='*.svn*' roundcube_svn/program/js/app.js roundcube_pub/program/js/app.js
    old new  
    13611361      this.set_busy(true, 'loading'); 
    13621362      target.location.href = this.env.comm_path+url; 
    13631363      // mark as read and change mbox unread counter 
    1364       if (action == 'preview' && this.message_list && this.message_list.rows[id] && this.message_list.rows[id].unread) 
     1364      if (action == 'preview' && this.message_list && this.message_list.rows[id] && this.message_list.rows[id].unread && this.env.preview_pane_mark_read) 
    13651365        { 
    13661366        this.set_message(id, 'unread', false); 
    13671367        if (this.env.unread_counts[this.env.mailbox]) 
     
    36333633      addrbook_show_images.disabled = !checkbox.checked; 
    36343634    } 
    36353635 
     3636  this.toggle_preview_pane = function(checkbox) 
     3637    { 
     3638    var preview_pane_mark_read; 
     3639    if (preview_pane_mark_read = document.getElementById('rcmfd_preview_pane_mark_read')) 
     3640      preview_pane_mark_read.disabled = !checkbox.checked; 
     3641    } 
     3642 
    36363643  // display fetched raw headers 
    36373644  this.set_headers = function(content) 
    36383645    { 
  • program/localization/en_US/labels.inc

    diff -Naur --exclude='*.svn*' roundcube_svn/program/localization/en_US/labels.inc roundcube_pub/program/localization/en_US/labels.inc
    old new  
    317317$labels['MB'] = 'MB'; 
    318318$labels['GB'] = 'GB'; 
    319319 
     320$labels['previewpanemarkread']  = 'Mark previewed messages as read'; 
     321 
    320322?> 
  • program/steps/mail/show.inc

    diff -Naur --exclude='*.svn*' roundcube_svn/program/steps/mail/show.inc roundcube_pub/program/steps/mail/show.inc
    old new  
    138138    $OUTPUT->set_env('last_uid', $last); 
    139139 
    140140  // mark message as read 
    141   if (!$MESSAGE->headers->seen) 
     141  if (!$MESSAGE->headers->seen && !($RCMAIL->action == 'preview' && !$CONFIG['preview_pane_mark_read'])) 
    142142    $IMAP->set_flag($MESSAGE->uid, 'SEEN'); 
    143143  } 
    144144 
  • program/steps/settings/func.inc

    diff -Naur --exclude='*.svn*' roundcube_svn/program/steps/settings/func.inc roundcube_pub/program/steps/settings/func.inc
    old new  
    158158  // show config parameter for preview pane 
    159159  if (!isset($no_override['preview_pane'])) { 
    160160    $field_id = 'rcmfd_preview'; 
    161     $input_preview = new html_checkbox(array('name' => '_preview_pane', 'id' => $field_id, 'value' => 1)); 
     161    $input_preview = new html_checkbox(array('name' => '_preview_pane', 'id' => $field_id, 'value' => 1, 
     162       'onchange' => JS_OBJECT_NAME.'.toggle_preview_pane(this)')); 
    162163     
    163164    $table->add('title', html::label($field_id, Q(rcube_label('previewpane')))); 
    164165    $table->add(null, $input_preview->show($config['preview_pane']?1:0)); 
    165166  } 
    166167 
     168  // show config parameter for preview pane auto mark as read 
     169  if (!isset($no_override['preview_pane_mark_read'])) { 
     170    $field_id = 'rcmfd_preview_pane_mark_read'; 
     171    $input_preview = new html_checkbox(array('name' => '_preview_pane_mark_read', 'id' => $field_id, 
     172       'value' => 1,  'disabled' => $config['preview_pane']?0:1)); 
     173 
     174    $table->add('title', html::label($field_id, Q(rcube_label('previewpanemarkread')))); 
     175    $table->add(null, $input_preview->show($config['preview_pane_mark_read']?1:0)); 
     176  } 
     177 
    167178  if (!isset($no_override['mdn_requests'])) { 
    168179    $field_id = 'rcmfd_mdn_requests'; 
    169180    $select_mdn_requests = new html_select(array('name' => '_mdn_requests', 'id' => $field_id)); 
  • program/steps/settings/save_prefs.inc

    diff -Naur --exclude='*.svn*' roundcube_svn/program/steps/settings/save_prefs.inc roundcube_pub/program/steps/settings/save_prefs.inc
    old new  
    3030  'htmleditor'   => isset($_POST['_htmleditor']) ? TRUE : FALSE, 
    3131  'inline_images'   => isset($_POST['_inline_images']) ? TRUE : FALSE, 
    3232  'preview_pane' => isset($_POST['_preview_pane']) ? TRUE : FALSE, 
     33  'preview_pane_mark_read' => isset($_POST['_preview_pane_mark_read']) ? TRUE : FALSE, 
    3334  'focus_on_new_message' => isset($_POST['_focus_on_new_message']) ? TRUE : FALSE, 
    3435  'read_when_deleted' => isset($_POST['_read_when_deleted']) ? TRUE : FALSE, 
    3536  'skip_deleted' => isset($_POST['_skip_deleted']) ? TRUE : FALSE,