Exemple #1
0
 /**
  * Save email template.
  * @param $args array
  * @param $request PKPRequest
  */
 function execute($args, $request)
 {
     $seriesDao =& DAORegistry::getDAO('SeriesDAO');
     $press =& $request->getPress();
     // Update or insert group group
     if (!isset($this->seriesId)) {
         import('classes.press.Series');
         $series = new Series();
         $series->setPressId($press->getId());
         $series->setTitle($this->getData('title'), Locale::getLocale());
         // Localized
         $series->setAffiliation($this->getData('affiliation'), Locale::getLocale());
         // Localized
         $series->setDivisionId($this->getData('division'));
         $this->seriesId = $seriesDao->insertObject($series);
     } else {
         $series =& $seriesDao->getById($this->seriesId);
         $series->setPressId($press->getId());
         $series->setTitle($this->getData('title'), Locale::getLocale());
         // Localized
         $series->setAffiliation($this->getData('affiliation'), Locale::getLocale());
         // Localized
         $series->setDivisionId($this->getData('division'));
         $seriesDao->updateObject($series);
     }
     return true;
 }