protected function getNavigationOptions() { $options = new DataObjectSet(); $counter = new sfDate($this->start_date->get()); $counter->subtractMonth(6); for ($i = 0; $i < 12; $i++) { $options->push(new ArrayData(array('Link' => $this->ShowMonthLink($counter->format('Ym')), 'Selected' => $this->start_date->format('Ym') == $counter->format('Ym') ? 'selected="selected"' : '', 'Month' => CalendarUtil::i18n_date('%B, %Y', $counter->get())))); $counter->addMonth(); } unset($counter); return $options; }
protected function getRangeLink(sfDate $start, sfDate $end) { return Controller::join_links($this->Link(), "show", $start->format('Ymd'), $end->format('Ymd')); }
/** * this checks if recalculation of totals and status is needed * of the opened invoices * * @return void **/ private function checkIfUpdateTotals() { // if the property is not set, we set it here if (!PropertyTable::get('last_calculation_date')) { PropertyTable::set('last_calculation_date', '1970-01-01'); } $last = new sfDate(PropertyTable::get('last_calculation_date')); $today = new sfDate(); if ($today->diff($last, sfTime::DAY) > 0) { CommonTable::calculateTotals(); PropertyTable::set('last_calculation_date', $today->format('Y-m-d')); } }