ruleName = JText::translate('VBSEASONDAYS');
$this->ruleDescr = JText::translate('VBO_CONDTEXT_RULE_WDAYS_DESCR');
$this->ruleId = basename(__FILE__);
}
/**
* Displays the rule parameters.
*
* @return void
*/
public function renderParams()
{
$this->vbo_app->loadSelect2();
$wdays = array(
JText::translate('VBSUNDAY'),
JText::translate('VBMONDAY'),
JText::translate('VBTUESDAY'),
JText::translate('VBWEDNESDAY'),
JText::translate('VBTHURSDAY'),
JText::translate('VBFRIDAY'),
JText::translate('VBSATURDAY'),
);
$current_wdays = $this->getParam('wdays', array());
?>
getPropVal('booking', 'checkin', 0);
$book_out = $this->getPropVal('booking', 'checkout', 0);
if (empty($book_in) || empty($book_out)) {
return false;
}
$info_in = getdate($book_in);
$info_out = getdate($book_out);
$involved_wdays = $this->getParam('wdays', array());
$involved_type = $this->getParam('type', 'checkin');
if ($involved_type == 'checkin') {
return (in_array($info_in['wday'], $involved_wdays));
}
if ($involved_type == 'checkout') {
return (in_array($info_out['wday'], $involved_wdays));
}
return (in_array($info_in['wday'], $involved_wdays) || in_array($info_out['wday'], $involved_wdays));
}
}