private function _informSubscribers(TA_Model_Observed_Interface $subject, $msg) { $conference = Zend_Registry::get('conference'); $sessionModel = new Core_Model_Session(); $subscriptions = $sessionModel->getSubscriptions(null, $subject->session_id); if (!empty($subscriptions)) { $mailer = new TA_Controller_Action_Helper_SendEmail(); $mailer->sendEmail(array('to_email' => $subscriptions, 'html' => true, 'subject' => $conference['name'] . ': Session updated', 'template' => 'session/observer'), $subject->toArray()); } }
/** * Update session in Google Calendar * * @return void */ public function _postUpdate(TA_Model_Observed_Interface $subject, $msg) { $flash = Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger'); try { $googleEvent = new Core_Service_GoogleEvent(); $sessionModel = new Core_Model_Session(); $session = $sessionModel->getAllSessionDataById($subject->session_id); $googleEvent->update($session->toArray()); } catch (Exception $e) { $log = Zend_Registry::get('log'); $log->emerg($e); return $flash->addMessage('Something went wrong updating Google Calendar'); } $flash->addMessage('Successfully updated session in Google Calendar'); }
private function _informSubscribers(TA_Model_Observed_Interface $subject, $msg) { $conference = Zend_Registry::get('conference'); $sessionModel = new Core_Model_Session(); $subscriptions = $sessionModel->getSubscriptions(null, $subject->session_id); $flash = Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger'); $subs = array(); foreach ($subscriptions as $sub) { $subs[] = $sub['email']; } if (!empty($subscriptions)) { $mailer = new TA_Controller_Action_Helper_SendEmail(); $mailer->sendEmail(array('to_email' => $conference['email'], 'html' => true, 'bcc' => $subs, 'subject' => $conference['name'] . ': Session updated', 'template' => 'session/subscriber'), $subject->toArray()); $flash->addMessage('Successfully emailed ' . count($subs) . ' subscriber(s)'); } }
public function init() { parent::init(); $this->setAction('/core/review/list/'); $this->setAttrib('id', 'statusform'); $submissionId = new Zend_Form_Element_Hidden('submission_id'); $submissionId->setRequired(true)->setLabel('submission_id')->addValidators(array('Int'))->setDecorators(array('Composite')); // todo: replace with 'new' way of doing this $statusOptions = Zend_Registry::get('formconfig')->formdefaults->submit->status->toArray(); $status = new Zend_Form_Element_Select('status'); $status->setLabel('Status')->setAttrib('class', 'small')->addFilter('Null')->addMultiOptions($statusOptions)->setDecorators(array('Composite')); $sessionModel = new Core_Model_Session(); $sessions = $sessionModel->getSessionsForSelect(''); $session = new Zend_Form_Element_Select('session_id'); $session->setLabel('Proposed Session')->setAttrib('class', 'small')->addMultiOption('', '--- select a session ---')->addFilter('Null')->addMultiOptions($sessions)->setDecorators(array('Composite')); $this->addElements(array($submissionId, $status, $session)); $this->addElement('submit', 'submit', array('label' => 'Submit', 'decorators' => $this->_buttonElementDecorator)); }
/** * Archived video stream * */ public function archiveAction() { $this->view->threeColumnLayout = true; $this->view->stylesheet('media.css'); $this->view->headScript()->appendFile('/js/jwplayer.js'); // uncomment for testing $datearray = array('year' => 2011, 'month' => 5, 'day' => 18, 'hour' => 16, 'minute' => 1, 'second' => 10); $zd = new Zend_Date($datearray); $sessionModel = new Core_Model_Session(); $this->view->archive = $sessionModel->getResource('sessionsview')->getSessionsBeforeDate()->group(); $this->view->activeStream = $this->getRequest()->getParam('stream'); // quality toggler $conference = Zend_Registry::get('conference'); $this->view->quality = 'hi'; if ($quality = $this->_getParam('quality')) { setcookie('stream_quality', $quality, time() + 14 * 3600 * 24, '/', $conference['hostname']); $this->view->quality = $quality; } else { $this->view->quality = $this->getRequest()->getCookie('stream_quality', 'lo'); } }
/** * Show HTML grid of schedule * */ public function listAction() { $this->view->Stylesheet('schedule.css'); Zend_Controller_Action_HelperBroker::addHelper(new TA_Controller_Action_Helper_ConferenceInfo()); if ($day = $this->_getParam('day')) { $day = urldecode($day); } elseif ($date = $this->_helper->conferenceInfo()->isLive()) { $day = $date->get('dd/MM/YYYY'); } else { $day = $this->_helper->conferenceInfo('start')->get('dd/MM/YYYY'); } if ($loc = $this->_getParam('loc')) { $datearray = array('year' => 2012, 'month' => 5, 'day' => 22, 'hour' => 16, 'minute' => 35, 'second' => 10); $zd = new Zend_Date($datearray); $sessions = $this->_scheduleModel->getStreamData($zd, $loc); $this->view->session = current($sessions); $this->_helper->layout->assign('customlayout', true); $this->_helper->layout->setLayout('core/locationlayout'); } $mobile = $this->_getParam('mobile', false); // if feedback codes have been sent if ($this->_helper->conferenceInfo()->isFeedbackOpen()) { $feedbackModel = new Core_Model_Feedback(); if ($feedbackModel->getFeedbackId()) { $this->view->feedbackid = true; $this->view->feedback = $this->_getParam('f', false); } } $view = $this->_getParam('view', 'titles'); $timeslot = $this->_getParam('t', null); $location = $this->_getParam('l', null); $this->view->personal = $personal = $this->_getParam('personal', false); $this->view->schedule = $this->_scheduleModel->getSchedule(null, array('view' => $view, 'day' => $day, 'personal' => $personal), $mobile); $this->view->days = $this->_scheduleModel->getDays(); $this->view->timeslots = $this->_scheduleModel->getTimeslots(); $eventModel = new Core_Model_Event(); $events = $eventModel->getEvents(null, array('tstart', 'asc'), 'day'); $this->view->events = $events['rows']; $sessionModel = new Core_Model_Session(); $this->view->subscriptions = $sessionModel->getSubscriptions(); $this->view->filters = array('view' => $view, 'day' => $day, 'personal' => $personal, 'timeslot' => $timeslot, 'location' => $location); if ($this->_getParam('size')) { $this->_helper->layout->assign('customlayout', true); $this->_helper->layout->setLayout('core/fullschedule'); } }
protected function _initSession() { $configSession = new Zend_Config_Ini(APPLICATION_PATH . '/configs/session.ini', APPLICATION_ENV); if (!$this->_request->isInstalling()) { $config = array('name' => 'session', 'primary' => 'session_id', 'modifiedColumn' => 'modified', 'dataColumn' => 'data', 'lifetimeColumn' => 'lifetime', 'lifetime' => $configSession->gc_maxlifetime); Zend_Session::setSaveHandler(new Zend_Session_SaveHandler_DbTable($config)); } if (!$this->_request->isInstalling() or is_writable(Core_Model_Directory::getSessionDirectory(true))) { $types = array(); $options = $configSession->toArray(); if (isset($options['types'])) { $types = $options['types']; unset($options['types']); } Zend_Session::start($options); $session_type = $this->_request->isApplication() ? 'mobile' : 'front'; $session = new Core_Model_Session($session_type); foreach ($types as $type => $class) { $session->addType($type, $class); } $language_session = new Core_Model_Session('language'); if (!$language_session->current_language) { $language_session->current_language = null; } Core_Model_Language::setSession($language_session); Core_View_Default::setSession($session); Core_Controller_Default::setSession($session); } }