Menu

#306 Periods error

Future_Requests
open
None
1
2014-08-01
2014-07-29
Anonymous
No

I have configured my system for periods submissions, like "period 1" and "period 2" and the user can select only one period for each room. So i set in my "config.inc.php" to "$max_duration_enabled = TRUE;" and "$max_duration_periods = 1;" right? Ok

After then, when user select in calendar "period 1", the system not allow submission because there is some policy conflicts "the maximum duration of booking is 1 period" and they can't go ahead.

But, if the user select in calendar "period 2", the system works fine.

So, can you help me?

Thank you very much!!

Discussion

  • Campbell Morrison

    I haven't been able to reproduce this problem. Can you tell me please

    • what timezone your system is set to?
    • which version of MRBS you are using?
    • whether your server is a Windows or Linux server?
    • your version of PHP?

    Thanks,

    Campbell

     
  • Anonymous

    Anonymous - 2014-07-29

    Hi Campbell,

    Your requests:

    • Timezone America/Sao_Paulo
    • MRBS Latest version 1.4.11 (prior version 1.4.10 occurs the same problem)
    • Server Linux CentOS
    • PHP version 5.3.28
    • Server provider: Hostgator

    Thank you.

     

    Last edit: Anonymous 2014-07-29
  • Campbell Morrison

    Thanks. I think I can reproduce the problem. Do you find that the period select box is disabled if you select "period 1"?

     
  • Anonymous

    Anonymous - 2014-07-29

    Exactly. Period select box is disabled when "period 1" is selected in calendar and the system results policy conflicts "the maximum duration of booking is 1 period". But, if selected "period 2" in calendar, works fine.

    I think, as a suggestion, if selected $max_duration_periods = 1;" the system may be disable the end of period.

     

    Last edit: Anonymous 2014-07-29
  • Campbell Morrison

    I've now fixed this in Rev 2854. You can patch your system by replacing the code for the function genAllDay() in edit_entry.php with the following code:

    // Generate the All Day checkbox for an area
    function genAllDay($a, $id, $name, $display_none=FALSE, $disabled=FALSE)
    {
      global $default_duration_all_day;
    
      echo "<div class=\"group\"" . (($display_none || !$a['show_all_day']) ? ' style="display: none"' : '') .">\n";
    
      $class = array();
      $class[] = 'all_day';
    
      $disable_field = $disabled || $display_none || !$a['show_all_day'];
    
      if ($disable_field)
      {
        // and if $disabled is set, give the element a class so that the JavaScript
        // knows to keep it disabled
        $class[] = 'keep_disabled';
      }
      // (1) If $display_none or $disabled are set then we'll also disable the select so
      //     that there is only one select passing through the variable to the handler.
      // (2) If this is an existing booking that we are editing or copying, then we do
      //     not want the default duration applied
      $params = array('name'        => $name,
                      'id'          => $id,
                      'label'       => get_vocab("all_day"),
                      'label_after' => TRUE,
                      'attributes'  => 'data-show=' . (($a['show_all_day']) ? '1' : '0'),
                      'value'       => ($default_duration_all_day && !isset($id) && !$drag),
                      'disabled'    => $disable_field,
                      'class'       => $class);
    
      generate_checkbox($params);
    
      echo "</div>\n";
    }
    

    Campbell

     
  • Anonymous

    Anonymous - 2014-08-01

    Thank you man!! Works fine now! I would like to reward you for your work. Is there any way that i make a donation?

    Anderson