Any advice appreciated of how best to do this.
I'm trying to re-model the current 'modal' behaviour of Roundcube between the 'mail' view and the 'addressbook' view, and have spent maybe a dozen hours working my way through the code trying to get things off the ground. I haven't programmed in PHP for a while but I do have a PhD in Computer Science, and I think I've put in a reasonable amount of groundwork including creating a new set of templates/styles and reading the plugin API documentation.
My intention could be simply put as having a 'Contact List' appear in the left-pane of what is currently the 'mail' view, i.e. where the folder list currently sits. My preference would be NOT to have to write from scratch another addressbook sub-system, but somehow map the existing functionality across into a new layout.
An edit of the 'mail' template should hopefully allow me to include the contacts on the left e.g. as this mockup screenshot: http://carrier.csi.cam.ac.uk/forsterlewis/computer_science/face_mail/webmail...
FYI the real objective is to experiment with a more contact-centric view of emails, e.g. allowing a click on a contact to display the addressbook details plus emails from/to, as in this mockup: http://carrier.csi.cam.ac.uk/forsterlewis/computer_science/face_mail/webmail...
My problem is fundamentally the 'task' aspect of Roundcube assumes all the folder/email stuff has querystring '_task=mail' and addressbook routines have hardcoded things like $RCMAIL->task=='addressbook'. All this breaks when I try and put the contacts list on the 'mail' page. A smaller issue is 'mail' and 'addressbook' functionality (e.g. 'list') seems to prevent that content co-existing on a page also.
E.g. is it very difficult to get <roundcube:object name="addresslist"
id="contacts-table"...> to be expanded correctly in the 'mail' template
using much of the existing program/steps/addressbook/ code ?
I'd rather not have to create a complete new 'addressbook' plugin just to allow "public $task = 'mail'", but maybe that's the only way. Should I effectively clone the program/steps/addressbook code into a plugin and take out the 'task=addressbook' sensitivity? The downside of that is I'm effectively forking the Roundcube base.
Thanks for any help...
Ian
To provide a brief answer to my own question, providing 'contacts list' functionality on the same page as emails in Roundcube requires an overhaul of the core logic (unless a replacement addressbook is written). The challenge is simply illustrated if you try and place <roundcube:object name='addresslist'> on the 'mail' template. Basic issues seem to be:
(populating a template with a list of messages) and task='addressbook' (providing a list of contacts) so that would need to be engineered out to allow use of existing 'addressbook' and 'mail' code on the same page.
program/steps/addressbook have the same name (e.g. list.php) with other code doing an include of program/steps/$task/list.php so the name clash would need files (and their references) renaming.
'addressbook' page assumes the same command 'list' means 'list contacts'. As far as I can tell this would need re-structuring to use different command names for the two functions for the lists to coexist on the same page (I am re-writing the code to use 'listcontacts' instead of 'list' for the contacts list command.)
Ian
List info: http://lists.roundcube.net/dev/ BT/aba52c80
Hi Ian
You pretty much figured out that the current architecture of Roundcube makes it hard to achieve what you have in mind. However, it's not entirely impossible. check out the address book widget we now have on the compose screen in the latest SVN version. It uses a command named 'list-contacts' which resides in the mail section.
While it's currently bound to the compose step, the code could easily be moved or adjusted to also work on the main screen. See function rcmail_contacts_list() in program/steps/mail/compose.inc and line 277 in program/js/app.js
But to make a long story short, we'll not refactor our code in the near future and you'll have to live with a huge patch.
Good luck! Thomas
Ian Lewis wrote:
To provide a brief answer to my own question, providing 'contacts list' functionality on the same page as emails in Roundcube requires an overhaul of the core logic (unless a replacement addressbook is written). The challenge is simply illustrated if you try and place <roundcube:object name='addresslist'> on the 'mail' template. Basic issues seem to be:
- existing 'shared' logic is hard-coded with tests for task='mail'
(populating a template with a list of messages) and task='addressbook' (providing a list of contacts) so that would need to be engineered out to allow use of existing 'addressbook' and 'mail' code on the same page.
- a small number of the php files in program/steps/mail and
program/steps/addressbook have the same name (e.g. list.php) with other code doing an include of program/steps/$task/list.php so the name clash would need files (and their references) renaming.
- the 'mail' page assumes an action 'list' means 'list emails' while the
'addressbook' page assumes the same command 'list' means 'list contacts'. As far as I can tell this would need re-structuring to use different command names for the two functions for the lists to coexist on the same page (I am re-writing the code to use 'listcontacts' instead of 'list' for the contacts list command.)
Ian
List info: http://lists.roundcube.net/dev/ BT/0ddf6350
List info: http://lists.roundcube.net/dev/ BT/aba52c80
Thanks Thomas - 0.8-SVN installed now and I'll re-start with that.
The changes to apps.js are similar to the changes I came up with so that's encouraging.
I see the new address book widget on the 'Compose' screen of the 'Larry' theme...
Good stuff... Ian
On 29/02/2012 15:17, Thomas Bruederli wrote:
Hi Ian
You pretty much figured out that the current architecture of Roundcube makes it hard to achieve what you have in mind. However, it's not entirely impossible. check out the address book widget we now have on the compose screen in the latest SVN version. It uses a command named 'list-contacts' which resides in the mail section.
While it's currently bound to the compose step, the code could easily be moved or adjusted to also work on the main screen. See function rcmail_contacts_list() in program/steps/mail/compose.inc and line 277 in program/js/app.js
But to make a long story short, we'll not refactor our code in the near future and you'll have to live with a huge patch.
Good luck! Thomas
Ian Lewis wrote:
To provide a brief answer to my own question, providing 'contacts list' functionality on the same page as emails in Roundcube requires an overhaul of the core logic (unless a replacement addressbook is written). The challenge is simply illustrated if you try and place <roundcube:object name='addresslist'> on the 'mail' template. Basic issues seem to be:
- existing 'shared' logic is hard-coded with tests for task='mail'
(populating a template with a list of messages) and task='addressbook' (providing a list of contacts) so that would need to be engineered out to allow use of existing 'addressbook' and 'mail' code on the same page.
- a small number of the php files in program/steps/mail and
program/steps/addressbook have the same name (e.g. list.php) with other code doing an include of program/steps/$task/list.php so the name clash would need files (and their references) renaming.
- the 'mail' page assumes an action 'list' means 'list emails' while the
'addressbook' page assumes the same command 'list' means 'list contacts'. As far as I can tell this would need re-structuring to use different command names for the two functions for the lists to coexist on the same page (I am re-writing the code to use 'listcontacts' instead of 'list' for the contacts list command.)
Ian
List info: http://lists.roundcube.net/dev/ BT/0ddf6350