Ticket #1485012: previewnotread.r2011.patch

File previewnotread.r2011.patch, 5.8 KB (added by JohnDoh, 17 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  
    359359// default setting if preview pane is enabled 
    360360$rcmail_config['preview_pane'] = FALSE; 
    361361 
     362// Preview pane mark as read 
     363$rcmail_config['preview_pane_mark_read'] = TRUE; 
     364 
    362365// focus new window if new message arrives 
    363366$rcmail_config['focus_on_new_message'] = true; 
    364367 
  • 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  
    13571357      this.set_busy(true, 'loading'); 
    13581358      target.location.href = this.env.comm_path+url; 
    13591359      // mark as read and change mbox unread counter 
    1360       if (action == 'preview' && this.message_list && this.message_list.rows[id] && this.message_list.rows[id].unread) 
     1360      if (action == 'preview' && this.message_list && this.message_list.rows[id] && this.message_list.rows[id].unread && this.env.preview_pane_mark_read) 
    13611361        { 
    13621362        this.set_message(id, 'unread', false); 
    13631363        if (this.env.unread_counts[this.env.mailbox]) 
     
    36503650      addrbook_show_images.disabled = !checkbox.checked; 
    36513651    } 
    36523652 
     3653  this.toggle_preview_pane = function(checkbox) 
     3654    { 
     3655    var preview_pane_mark_read; 
     3656    if (preview_pane_mark_read = document.getElementById('rcmfd_preview_pane_mark_read')) 
     3657      preview_pane_mark_read.disabled = !checkbox.checked; 
     3658    } 
     3659 
    36533660  // display fetched raw headers 
    36543661  this.set_headers = function(content) 
    36553662    { 
  • 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  
    315315$labels['MB'] = 'MB'; 
    316316$labels['GB'] = 'GB'; 
    317317 
     318$labels['previewpanemarkread']  = 'Mark previewed messages as read'; 
     319 
    318320?> 
  • 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,