Roundcube Community Forum

 

Check box plugin

Started by umount, December 10, 2010, 07:20:00 AM

Previous topic - Next topic

umount

I want to present to you new roundcube plugin  chbox.
checkbox to select messages.

https://github.com/umount/rcplugin_chbox

It is testing version, need patching list.js file, but soon I will be corrected and I will let out the normal version without a patch.

Also my plugin bounce was still updated. Now it support auto loading.
https://github.com/umount/rcplugin_bounce

umount

Remove list.patch. Now plugin chbox work without patch, only how plugin roundcube.

Comments and suggestions are welcome.

lacri

nice :)

you forgott localizations (chbox.chbox) and a the patch for
the functions.js to initialise the selectmenu

in skins/default/functions.js search forfunction rcube_mail_ui()
{
  
this.popups = {
and add selectmenu:       {id:'selectmenu'},and for localizations add folder localization in chbox plugin directory
and add File e.G. for german de_DE.inc with this Content
<?php

$labels 
= array();
$labels['chbox'] = 'Checkbox';

?>


Many thanks for this plugin and your work.

lacri

#3
rosali has a plugin msglistcols with a small modification in msglistcols.php you can add the chbox plugin to this.

search in msglistcols.php tofor($i=0;$i<9;$i++){
          
$field_id 'rcmfd_list_col' $i;
and add $select_col->add(rcube_label('chbox','msglistcols'), 'chbox');a better way is:
@rosali add a check if chbox plugin is loaded :)

and add localization string for chbox in msglistcols localization files
$labels['chbox'] = "Checkbox";

umount

Quote from: lacri;31754nice :)

you forgott localizations (chbox.chbox) and a the patch for
the functions.js to initialise the selectmenu

in skins/default/functions.js search forfunction rcube_mail_ui()
{
  
this.popups = {
and add selectmenu:       {id:'selectmenu'},and for localizations add folder localization in chbox plugin directory
and add File e.G. for german de_DE.inc with this Content
<?php

$labels 
= array();
$labels['chbox'] = 'Checkbox';

?>


Many thanks for this plugin and your work.

I am sorry have forgotten to add folder localization.

patch for skins/default/functions.js I'm try fix :), for it I forgotten too

lacri

i found another small Bug
i have on the bottom as last message in the messagelist one message without subject and 0 bytes sice this one wrong message comes not from imap and has no id she is generated by the chbox plugin or caused by the plugin.

i search for a solution tomorrow morning now is evening :)

many greetz :)

lacri

the bug is in chbox.php in the message_list function
search
function message_list($args){
    
$count count($args['messages']);
    for (
$i=0;$i<$count;$i++) {
      
$uid $args['messages'][$i]->uid;
      
$args['messages'][$i]->list_cols['chbox'] = '<input type="checkbox" name="rcmselect'.$uid.'" id="rcmselect'.$uid.'" />';
    }
    return 
$args;
  }

and replace with
function message_list($args){
    
$count count($args['messages'])-1;
    for (
$i=0;$i<$count;$i++) {
      
$uid $args['messages'][$i]->uid;
      
$args['messages'][$i]->list_cols['chbox'] = '<input type="checkbox" name="rcmselect'.$uid.'" id="rcmselect'.$uid.'" />';
    }
    return 
$args;
  }

the issue is the wrong count of messages
i have change only the count with -1
$count count($args['messages'])-1;

I hope this helps :)

lacri

refix the first fix dont work when folder is empty here is a better solution works fine when folder contains one or more messages and when folder is empty :)

replace message_list function in chbox.php withfunction message_list($args){
    
$count count($args['messages']);
      for (
$i=0;$i<$count;$i++) {
          
$uid $args['messages'][$i]->uid;
        if(
$uid != NULL) {
            
$args['messages'][$i]->list_cols['chbox'] = '<input type="checkbox" name="rcmselect'.$uid.'" id="rcmselect'.$uid.'" />';
        }
      }
    return 
$args;
  }

umount

Quote from: lacri;31761the bug is in chbox.php in the message_list function
search
function message_list($args){
    
$count count($args['messages']);
    for (
$i=0;$i<$count;$i++) {
      
$uid $args['messages'][$i]->uid;
      
$args['messages'][$i]->list_cols['chbox'] = '<input type="checkbox" name="rcmselect'.$uid.'" id="rcmselect'.$uid.'" />';
    }
    return 
$args;
  }

and replace with
function message_list($args){
    
$count count($args['messages'])-1;
    for (
$i=0;$i<$count;$i++) {
      
$uid $args['messages'][$i]->uid;
      
$args['messages'][$i]->list_cols['chbox'] = '<input type="checkbox" name="rcmselect'.$uid.'" id="rcmselect'.$uid.'" />';
    }
    return 
$args;
  }

the issue is the wrong count of messages
i have change only the count with -1
$count count($args['messages'])-1;

I hope this helps :)

Thank you for help.

lacri

i have seen in github you have commited my first fix :) this contains a little bug use the fix from my last posting :)

thanks for your plugin ;)

umount

Quote from: lacri;31764i have seen in github you have commited my first fix :) this contains a little bug use the fix from my last posting :)

thanks for your plugin ;)

no problem :)

umount

Remove need patch functions.js

umount

If you need select childs of collapsed rows.

You should uncomment 45 line

rosali

Please make css skinable:

chbox.php :: line 22


    $this
->include_stylesheet($this->local_skin_path() . "/chbox.css");
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

rosali

Please move ...

chbox_menu

... function out of event listener. It reduces the time to replace the chbox label.

chbox.js

if (window.rcmail) {
  
chbox_menu();
  
rcmail.addEventListener('init', function(evt) {
    
rcmail.register_command('plugin.chbox.selectmenu'rcmail_selectmenutrue);
Regards,
Rosali
__________________
MyRoundcube Project (commercial)