Hi,
I have just a small patch which seems reasonable to me. In 0.1stable release is an option to limit max_pagesize but it seems it is working only for new settings and users cannot save new value bigger than that. But when user already has bigger value in database (from older releases) then value max_pagesize from config file is not used.
So this is my solution.
--- ../webmail_01_stable/program/include/main.inc 2008-02-27 14:39: 22.000000000 +0100 +++ program/include/main.inc 2008-03-07 11:28:10.000000000 +0100 @@ -278,7 +278,11 @@
// set pagesize from config if (isset($CONFIG['pagesize']))
$IMAP->set_pagesize($CONFIG['max_pagesize']);
$IMAP->set_pagesize($CONFIG['pagesize']);
Regards
Hi.
Just an idea when we are talking about max_pagesize.
I use RoundCube for our customers and me too. Sometimes I need to print list of emails of particular mailbox (mainly to report incidents or simply to create mail digest). In this case I need set a big page size because paging doesn't have sense in this scenario and applying different stylesheet (I use webdeveloper extension for doing this).
Maybe will be nice to implement this function for other users. A proper way is to add a button for printing email listing, then skiping max_pagesize constraints and applying diferent stylesheet (below).
/* List of emails - printing */
#taskbar, #header, #message, #messagetoolbar, #quicksearchbar, #messagecountbar, #mailboxlist-header, #mailboxlist-container, #mailboxcontrols, #listcontrols { display:none; }
#mailcontframe { position:static; border:none; overflow:visible; }
Jiri Kaderavek.
Dne pátek, 7. března 2008 Ondrej Zlosky napsal(a):
Hi,
I have just a small patch which seems reasonable to me. In 0.1stable release is an option to limit max_pagesize but it seems it is working only for new settings and users cannot save new value bigger than that. But when user already has bigger value in database (from older releases) then value max_pagesize from config file is not used.
So this is my solution.
--- ../webmail_01_stable/program/include/main.inc 2008-02-27 14:39: 22.000000000 +0100 +++ program/include/main.inc 2008-03-07 11:28:10.000000000 +0100 @@ -278,7 +278,11 @@
// set pagesize from config if (isset($CONFIG['pagesize']))
- $IMAP->set_pagesize($CONFIG['pagesize']);
- if ($CONFIG['pagesize'] > $CONFIG['max_pagesize']) {
$IMAP->set_pagesize($CONFIG['max_pagesize']);
- } else {
$IMAP->set_pagesize($CONFIG['pagesize']);
- } }
Regards
hi,
i think it would be better to overwrite the pagesize in the user config load process.
while grepping throu the code i came accross $USER->get_prefs() which returns the user preferences array.
it is called two times in main.inc:
@101: rcmail_startup(): $CONFIG = array_merge($CONFIG, (array)$USER->get_prefs());
and
@617: rcmail_login() $CONFIG = array_merge($CONFIG, (array)$USER->get_prefs());
so i would patch the $USER->get_prefs() method to check for limitations such as page_size.
but my additional thought is: why the heck is this code redundant? :) shouldn't one create a method in main.inc (or somewhere else) which takes care of merging, checking and enforcing config/preferences values?
cheers, raoul
Ondrej Zlosky wrote:
Hi,
I have just a small patch which seems reasonable to me. In 0.1stable release is an option to limit max_pagesize but it seems it is working only for new settings and users cannot save new value bigger than that. But when user already has bigger value in database (from older releases) then value max_pagesize from config file is not used.
So this is my solution.
--- ../webmail_01_stable/program/include/main.inc 2008-02-27 14:39:22.000000000 +0100 +++ program/include/main.inc 2008-03-07 11:28:10.000000000 +0100 @@ -278,7 +278,11 @@
// set pagesize from config if (isset($CONFIG['pagesize']))
- $IMAP->set_pagesize($CONFIG['pagesize']);
- if ($CONFIG['pagesize'] > $CONFIG['max_pagesize']) {
$IMAP->set_pagesize($CONFIG['max_pagesize']);
- } else {
$IMAP->set_pagesize($CONFIG['pagesize']);
- } }
Regards
-- Ondrej Zlosky ondrej.zlosky@gmail.com mailto:ondrej.zlosky@gmail.com
List info: http://lists.roundcube.net/dev/
I use RoundCube for our customers and me too. Sometimes I need to
print list of emails of particular mailbox (mainly to report incidents or
simply to create mail digest). In this case I need set a big page size
because paging doesn't have sense in this scenario and applying different
stylesheet (I use webdeveloper extension for doing this).
To me that sounds like something that could be written as a separate
tool for use by admins instead of built into RC itself. That tool
could output CSV in order to be more report-like for either direct
digital distribution or for easy formatting, maybe by a macro in
OpenOffice. You might be able to create a .ods file directly. It is
really a separate task from the core features of RC, but I can't
speak for the main RC developers. Maybe they see this as a important
feature of RC.
That tool could be written in PHP and use some of the existing
classes in RC, or it could be a CLI tool run on the IMAP host written
in perl, python, or whatever you are comfortable with. It might be
worth a Google to see if something like that already exists.
Charles Dostale System Admin - Silver Oaks Communications http://www.silveroaks.com/ 824 17th Street, Moline IL 61265
List info: http://lists.roundcube.net/dev/
Dne pátek, 7. března 2008 chasd napsal(a):
I use RoundCube for our customers and me too. Sometimes I need to print list of emails of particular mailbox (mainly to report incidents or simply to create mail digest). In this case I need set a big page size because paging doesn't have sense in this scenario and applying different stylesheet (I use webdeveloper extension for doing this).
To me that sounds like something that could be written as a separate tool for use by admins instead of built into RC itself. That tool could output CSV in order to be more report-like for either direct digital distribution or for easy formatting, maybe by a macro in OpenOffice. You might be able to create a .ods file directly. It is really a separate task from the core features of RC, but I can't speak for the main RC developers. Maybe they see this as a important feature of RC.
That tool could be written in PHP and use some of the existing classes in RC, or it could be a CLI tool run on the IMAP host written in perl, python, or whatever you are comfortable with. It might be worth a Google to see if something like that already exists.
I understand you. Sure, it's better to implement reporting as a separate task (and I hope sometimes someone will do that in a way you presented), but ... consider this as simple Print Mailbox function.
JK. _______________________________________________ List info: http://lists.roundcube.net/dev/