Exemplo n.º 1
0
 protected function loadDBData()
 {
     if ($this->newsletter->isScheduled()) {
         $send_date = clone $this->newsletter->send_date;
         $send_date->setTimezone($this->app->default_time_zone);
         $this->ui->getWidget('send_date')->value = $send_date;
     }
 }
Exemplo n.º 2
0
 protected function initNewsletter()
 {
     if ($this->id == '') {
         $this->app->relocate('Newsletter');
     }
     $class_name = SwatDBClassMap::get('DeliveranceNewsletter');
     $this->newsletter = new $class_name();
     $this->newsletter->setDatabase($this->app->db);
     if (!$this->newsletter->load($this->id)) {
         throw new AdminNotFoundException(sprintf('A newsletter with the id of ‘%s’ does not exist', $this->id));
     }
     // Can't send a preview of a newsletter that has been scheduled. This
     // check will also cover the case where the newsletter has been sent.
     if ($this->newsletter->isScheduled()) {
         $this->relocate();
     }
 }