Author Topic: Need help with calendar plugin, please  (Read 3531 times)

Offline phloks

  • Newbie
  • *
  • Posts: 4
Need help with calendar plugin, please
« on: February 03, 2018, 11:59:30 AM »
Hi,

I'm running Roundcubemail GIT 20180131.1044 (1.4-git), and as far as IMAP is concerned, all is working perfectly.
However, I'm trying to get the plugin https://plugins.roundcube.net/packages/offerel/caldavzap (offerel/caldavzap) to work, but this does not go entirely ok.

I installed the plugin, made the necessary config changes for the plugin itself, added the plugin directory name in the global config file to activate
the plugin, and when I login to RC, the button called "Calendar" has been added to the top bar, but the button is disabled.

I have been discussing this issue with the developer of the plugin the last couple of days, and he checked and double-checked his code, and there is no
functionality in his code that could render the button disabled.
When I tell RC to use ?_task=caldavzap, The calendar is being loaded and displayed....
All the button does, is calling RC with ?_task=caldavzap.

If I display the page source, somewhere the disabled="disabled" part has been added:
Code: [Select]
<button id="A1B2C3D4E5F6" class="button-calendar" type="button" onclick="return rcmail.command('switch-task','caldavzap',this,event)" value="Calendar" disabled="disabled">Calendar</button> ,
and the developer suspects this is done somewhere in RC.

Can anyone here help us out, please ?
What could be the reason the newly added button is greyed out and disabled ?

Thanks,
Hans

Offline Loguithat1955

  • Full Member
  • ***
  • Posts: 54
Re: Need help with calendar plugin, please
« Reply #1 on: February 03, 2018, 12:11:56 PM »
Hi there. I'm the developer of the plug-in. The button in the RC taskbar has no css class for disabling the button. Nor is such a functionality somewhere else in the plug-in. I really have no idea, why this button is disabled in the taskbar.

The only hint about disabling buttons, i could found, are the hints about the template definitions at https://github.com/roundcube/roundcubemail/wiki/Skin-Markup.

Can anybody please help us, to solve this problem please?

BTW, the button is defined by:

Code: [Select]
$this->add_button(array(
'label'      => 'caldavzap.caldavzap',
'id'   => 'calendar-button-unique-id',
'command'    => 'caldavzap',
'class'      => 'button-calendar',
'classsel'   => 'button-calendar button-selected',
'innerclass' => 'button-inner' 
 ), 'taskbar');
« Last Edit: February 03, 2018, 01:11:37 PM by Loguithat1955 »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Need help with calendar plugin, please
« Reply #2 on: February 03, 2018, 02:01:23 PM »
Buttons are enabled/disabled with Javascript rcmail.enable_command https://github.com/roundcube/roundcubemail/blob/master/program/js/app.js#L1442

Offline Loguithat1955

  • Full Member
  • ***
  • Posts: 54
Re: Need help with calendar plugin, please
« Reply #3 on: February 03, 2018, 02:17:46 PM »
Yes, i know. This is true, if i would try to insert such a button in a template and disable it initially. But in my case, the button is added in the init of the php script, instead of the template. Its nowhere disabled. If i use this in RC 1.3.4, this works. The only difference is see here, is that the user uses RC 1.4 from Github, which isn't released as of yet. I don't know if there changed something in 1.4.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Need help with calendar plugin, please
« Reply #4 on: February 03, 2018, 05:36:59 PM »
I'm not aware of any changes 1.4 although something defiantly may have changed. When you add that type of button it is disabled by default https://github.com/roundcube/roundcubemail/blob/master/program/include/rcmail_output_html.php#L1531 If its added from PHP and you're noting dealing with JS you would call $rcmail->output->command('enable_command', '{command}', true); to enable it.

Offline Loguithat1955

  • Full Member
  • ***
  • Posts: 54
Re: Need help with calendar plugin, please
« Reply #5 on: February 04, 2018, 04:04:31 AM »
Thx for the help. We have found a fix. The attribute "type" was missing in my definition.