/** * Returns the choices associated. * * @return array An array of choices */ public function getChoices() { $choices = array(); $add_empty = $this->getOption('add_empty'); if ($add_empty === true) { $choices[''] = __(''); } for ($day = 0; $day < 7; $day++) { $choices[$day] = Dayperiod::dayOfWeekToName($day); } return $choices; }
echo __('Currently unvailable') . ' (~)'; ?> </span> </span> </h2> <table class="color planning"> <thead> <tr> <th class="empty"></th> <th class="hide"></th> <?php for ($day = 0; $day < 7; ++$day) { ?> <th><?php echo __('%week_day% - %date%', array('%week_day%' => Dayperiod::dayOfWeekToShortName($day), '%date%' => strftime('%d/%m', strtotime(date('Y-m-d', $date) . " +" . ($day - Dayperiod::toWeekDay($date) + 1) . " day")))); ?> </th> <?php } ?> </tr> </thead> <tbody> <?php $startIndex = $availability['startIndex']; ?> <?php $stopIndex = $availability['stopIndex']; ?> <?php
/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param Dayperiod $value A Dayperiod object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(Dayperiod $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getId(); } // if key === null self::$instances[$key] = $obj; } }
<noscript> <?php include_partial('tools/messageBox', array('class' => 'warning', 'title' => __('Javascript disabled'), 'msg' => __('JavaScript is disabled. Deletion function disabled due to security measures.'), 'showImg' => true)); ?> </noscript> <table class="planning"> <thead> <tr> <th class="empty"></th> <th class="hide"></th> <?php for ($day = 0; $day < 7; ++$day) { ?> <th><?php echo Dayperiod::dayOfWeekToName($day); ?> </th> <?php } ?> </tr> </thead> <tbody> <?php $day_marker = array(0 => null, 1 => null, 2 => null, 3 => null, 4 => null, 5 => null, 6 => null); ?> <?php $day_periods_per_day = array(0 => array(), 1 => array(), 2 => array(), 3 => array(), 4 => array(), 5 => array(), 6 => array()); ?>
--> <span class="toofar no_border"> <?php echo __('Currently unvailable'); ?> </span> </span> </h2> <table class="color planning month"> <thead> <tr> <?php for ($day = 0; $day < 7; ++$day) { ?> <th><?php echo __('%week_day%', array('%week_day%' => Dayperiod::dayOfWeekToShortName($day))); ?> </th> <?php } ?> </tr> </thead> <tbody> <?php $monthStart = ReservationPeer::getMonthStart($date); $monthStop = ReservationPeer::getMonthStop($date); $startDayIndex = date('N', $monthStart) - 1; $tst = $monthStart; ?>
public function copyWithoutRoom() { $dayperiod = new Dayperiod(); $dayperiod->setStart($this->getStart()); $dayperiod->setStop($this->getStop()); $dayperiod->setDayOfWeek($this->getDayOfWeek()); return $dayperiod; }
public function repeatDayperiodWeek(Dayperiod $dayperiod) { for ($week_day = 0; $week_day < 7; ++$week_day) { $newDayperiod = $dayperiod->copyWithoutRoom(); $newDayperiod->setDayOfWeek($week_day); $newDayperiod->setRoomId($this->getId()); if (!$newDayperiod->overlaps()) { $newDayperiod->save(); } } }