예제 #1
0
 /**
  * Put the review mark information is the view
  */
 function putInView($view, $html = false)
 {
     parent::putInView($view, $html);
     // Show the label of the scale instead of the number
     // Add the reviewer expertise
     $name = "ReviewMark" . "->mark";
     if (isset(Config::$Scale[$this->mark])) {
         $view->setVar($name, Config::$Scale[$this->mark]);
     } else {
         $view->setVar($name, "?");
     }
 }
예제 #2
0
 /**
  * Check that a session is valid
  */
 function putInView(&$view, $html = true)
 {
     // Call the parent method: default behavior
     parent::putInView($view);
     // Now refine. Dates are shown using the required format.
     $reviewDeadline = Zmax_View_Phplib::formatDate($this->reviewDeadline, $this->date_format);
     $name = "Config" . "->reviewDeadline";
     $view->setVar($name, $reviewDeadline);
     $submissionDeadline = Zmax_View_Phplib::formatDate($this->submissionDeadline, $this->date_format);
     $name = "Config" . "->submissionDeadline";
     $view->setVar($name, $submissionDeadline);
     $name = "Config" . "->nb_papers";
     $view->setVar($name, Config::countAllPapers());
     $name = "Config" . "->nb_words";
     $view->setVar($name, 250);
 }
예제 #3
0
 /**
  * Put paper information in the view
  * @author philipperigaux
  *
  */
 function putInView(&$view, $html = false)
 {
     // Call the parent which does most of the job
     parent::putInView($view, $html);
     // Show the abstracts
     $view->SECTIONS = "";
     foreach ($this->_abstract as $abstract) {
         $abstractStruct = $abstract->findParentAbstractSection();
         if (is_object($abstractStruct)) {
             // Maybe the abstract section has been removed.
             $abstractStruct->putInView($view);
             $abstract->putInView($view, $html);
             if ($view->entityExists("SECTION")) {
                 $view->assign("temp", "SECTION");
                 $view->append("SECTIONS", "temp");
             }
         }
     }
     // OK, now get the topic
     $topic = $this->findParentResearchTopic();
     if (is_object($topic)) {
         $topic_name = $topic->label;
     } else {
         $topic_name = "";
     }
     $ename = "Paper" . "->" . "topic_name";
     $view->setVar($ename, $topic_name);
     // OK, now get the status
     $status = $this->findParentPaperStatus();
     if (is_object($status)) {
         $statusName = $status->label;
     } else {
         $statusName = "";
     }
     $ename = "Paper" . "->" . "status";
     $view->setVar($ename, $statusName);
     // Create a string with list of authors
     $ename = "Paper" . "->" . "authors";
     $view->setVar($ename, $this->getAuthors());
     // Idem with the list of reviewers
     $strReviewers = $comma = "";
     if (!empty($this->id)) {
         $reviews = $this->findReview();
         foreach ($reviews as $review) {
             // Get the user
             $user = $review->findParentUser();
             $strReviewers .= $comma . $user->first_name . " " . $user->last_name;
             $comma = ",";
         }
     }
     $ename = "Paper" . "->" . "reviewers";
     $view->setVar($ename, $strReviewers);
     // Show the answers
     $view->ANSWERS = "";
     if ($view->entityExists("ANSWER")) {
         foreach ($this->_answers as $answer) {
             $answer->putInView($view);
             $question = $answer->findParentPaperQuestion();
             if (is_object($question)) {
                 $question->putInView($view);
             }
             $choice = $answer->findParentPQChoice();
             $choice->putInView($view);
             $view->assign("temp", "ANSWER");
             $view->append("ANSWERS", "temp");
         }
     }
 }
예제 #4
0
 /**
  * Put the review information is the view
  */
 function putInView($view, $html = false)
 {
     parent::putInView($view, $html);
     // Add the reviewer expertise
     $name = "Config" . "->reviewerExpertise";
     if (isset(Config::$Expertise[$this->reviewerExpertise])) {
         $view->setVar($name, Config::$Expertise[$this->reviewerExpertise]);
     } else {
         $view->setVar($name, "unknwon_expertise");
     }
 }
예제 #5
0
 /**
  * Put the values in the view
  *
  * Overriden method: put the name of the country instead of the code
  * @author philipperigaux
  *
  */
 function putInView(&$view, $html = true)
 {
     // Trim some values
     $this->address = trim($this->address);
     parent::putInView($view, $html);
     // Get the config
     $registry = Zend_registry::getInstance();
     $config = $registry->get("Config");
     $name = "User" . "->country";
     $country = $this->findParentCountry();
     if (!is_object($country)) {
         $country_name = "";
     } else {
         $country_name = $country->name;
     }
     $view->setVar($name, $country_name);
     // Put the default password in the view
     $name = "User" . "->default_password";
     $view->setVar($name, $this->defaultPassword($config->passwordGenerator));
     // Create a view field with the list of topics (for existing users)
     $strTopics = $comma = "";
     if ($this->id != "") {
         $usertopics = $this->findUserTopic();
         foreach ($usertopics as $usertopic) {
             $topic = $usertopic->findParentResearchTopic();
             if (is_object($topic)) {
                 $strTopics .= $comma . $topic->label;
                 $comma = ", ";
             }
         }
     }
     $name = "User" . "->topics";
     $view->setVar($name, $strTopics);
 }