Example #1
0
 /**
  * Internal function to return a ReviewForm object from a row.
  * @param $row array
  * @return ReviewForm
  */
 function &_returnReviewFormFromRow(&$row)
 {
     $reviewForm = new ReviewForm();
     $reviewForm->setId($row['review_form_id']);
     $reviewForm->setConferenceId($row['conference_id']);
     $reviewForm->setSequence($row['seq']);
     $reviewForm->setActive($row['is_active']);
     $reviewForm->setCompleteCount($row['complete_count']);
     $reviewForm->setIncompleteCount($row['incomplete_count']);
     $this->getDataObjectSettings('review_form_settings', 'review_form_id', $row['review_form_id'], $reviewForm);
     HookRegistry::call('ReviewFormDAO::_returnReviewFormFromRow', array(&$reviewForm, &$row));
     return $reviewForm;
 }
 function importReviewForms()
 {
     assert($this->xml->name == 'reviewForms');
     $journal = $this->journal;
     $reviewFormDao =& DAORegistry::getDAO('ReviewFormDAO');
     $reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO');
     $this->nextElement();
     while ($this->xml->name == 'reviewForm') {
         $reviewFormXML = $this->getCurrentElementAsDom();
         $reviewForm = new ReviewForm();
         $reviewForm->setSequence((int) $reviewFormXML->sequence);
         $reviewForm->setActive((int) $reviewFormXML->active);
         $reviewForm->setAssocType(ASSOC_TYPE_JOURNAL);
         $reviewForm->setAssocId($this->journal->getId());
         $reviewFormDao->insertObject($reviewForm);
         $this->idTranslationTable->register(INTERNAL_TRANSFER_OBJECT_REVIEW_FORM, (int) $reviewFormXML->oldId, $reviewForm->getId());
         foreach ($reviewFormXML->reviewElement as $reviewElementXML) {
             $reviewFormElement = new ReviewFormElement();
             $reviewFormElement->setReviewFormId($reviewForm->getId());
             $reviewFormElement->setSequence((int) $reviewElementXML->sequence);
             $reviewFormElement->setElementType((int) $reviewElementXML->elementType);
             $reviewFormElement->setRequired((int) $reviewElementXML->required);
             $reviewFormElement->setIncluded((int) $reviewElementXML->included);
             $reviewFormElementDao->insertObject($reviewFormElement);
             $this->idTranslationTable->register(INTERNAL_TRANSFER_OBJECT_REVIEW_FORM_ELEMENT, (int) $reviewElementXML->oldId, $reviewFormElement->getId());
             $this->restoreDataObjectSettings($reviewFormElementDao, $reviewElementXML->settings, 'review_form_element_settings', 'review_form_element_id', $reviewFormElement->getId());
         }
         $this->restoreDataObjectSettings($reviewFormDao, $reviewFormXML->settings, 'review_form_settings', 'review_form_id', $reviewForm->getId());
         $this->nextElement();
     }
 }
Example #3
0
 /**
  * Save review form.
  */
 function execute()
 {
     $conference =& Request::getConference();
     $conferenceId = $conference->getId();
     $reviewFormDao =& DAORegistry::getDAO('ReviewFormDAO');
     if ($this->reviewFormId != null) {
         $reviewForm =& $reviewFormDao->getReviewForm($this->reviewFormId, $conferenceId);
     }
     if (!isset($reviewForm)) {
         $reviewForm = new ReviewForm();
         $reviewForm->setConferenceId($conferenceId);
         $reviewForm->setActive(0);
         $reviewForm->setSequence(REALLY_BIG_NUMBER);
     }
     $reviewForm->setTitle($this->getData('title'), null);
     // Localized
     $reviewForm->setDescription($this->getData('description'), null);
     // Localized
     if ($reviewForm->getId() != null) {
         $reviewFormDao->updateReviewForm($reviewForm);
         $reviewFormId = $reviewForm->getId();
     } else {
         $reviewFormId = $reviewFormDao->insertReviewForm($reviewForm);
         $reviewFormDao->resequenceReviewForms($conferenceId, 0);
     }
 }
Example #4
0
 /**
  * Save review form.
  * @see Form::execute()
  */
 function execute()
 {
     $press =& Request::getPress();
     $pressId = $press->getId();
     $reviewFormDao =& DAORegistry::getDAO('ReviewFormDAO');
     if ($this->reviewFormId != null) {
         $reviewForm =& $reviewFormDao->getReviewForm($this->reviewFormId, ASSOC_TYPE_PRESS, $pressId);
     }
     if (!isset($reviewForm)) {
         $reviewForm = new ReviewForm();
         $reviewForm->setPressId($pressId);
         $reviewForm->setActive(0);
         $reviewForm->setSequence(REALLY_BIG_NUMBER);
     }
     $reviewForm->setTitle($this->getData('title'), null);
     // Localized
     $reviewForm->setDescription($this->getData('description'), null);
     // Localized
     if ($reviewForm->getId() != null) {
         $reviewFormDao->updateObject($reviewForm);
         $this->reviewFormId = $reviewForm->getId();
     } else {
         $this->reviewFormId = $reviewFormDao->insertObject($reviewForm);
         $reviewFormDao->resequenceReviewForms(ASSOC_TYPE_PRESS, $pressId);
     }
     $this->reviewForm = $reviewForm;
 }