コード例 #1
0
 /**
  * The default action. It just displays the home page
  */
 function indexAction()
 {
     if (!$this->config->isPhaseOpen(Config::REVIEWING_PHASE)) {
         $this->view->content = $this->texts->reviewer->review_phase_is_closed;
         echo $this->view->render("layout");
         return;
     }
     $nbPapersInGroup = 15;
     // Get the current group
     $currentGroup = $this->getRequest()->getParam("group", "0");
     if ($currentGroup == "0") {
         if (isset($_SESSION['myreview_current_group'])) {
             $currentGroup = $_SESSION['myreview_current_group'];
         } else {
             $currentGroup = 1;
         }
     }
     // Put in the session
     $_SESSION['myreview_current_group'] = $currentGroup;
     $minPaper = ($currentGroup - 1) * $nbPapersInGroup + 1;
     $maxPaper = $minPaper + $nbPapersInGroup;
     $loginSuccessful = $this->getRequest()->getParam("login_successful");
     if (!empty($loginSuccessful)) {
         $this->view->initial_message = $this->zmax_context->texts->welcome_connected_reviewer;
     } else {
         $this->view->initial_message = "";
     }
     $this->view->setFile("content", "index.xml");
     $texts = $this->zmax_context->texts;
     $requiredFileTbl = new RequiredFile();
     /* Select all the papers and list them.
        First extract the 'bloc' describing a line from the template */
     $this->view->setBlock("content", "GROUP", "GROUPS");
     $this->view->setBlock("content", "PAPER", "PAPERS");
     $this->view->setBlock("content", "FORUM_LINK");
     $this->view->setBlock("PAPER", "ALL_REVIEWS", "REVIEWS");
     $this->view->setBlock("PAPER", "MY_REVIEW", "REVIEW");
     $this->view->setBlock("PAPER", "DOWNLOAD", "DOWNLOADS");
     $this->view->setBlock("DOWNLOAD", "DOWNLOAD_LINK", "THE_LINK");
     $this->view->setBlock("PAPER", "review", "show_review");
     $this->view->setBlock("review", "review_mark", "review_marks");
     $this->view->setBlock("review", "review_answer", "review_answers");
     $this->view->setBlock("PAPER", "SECTION", "SECTIONS");
     $this->view->setBlock("PAPER", "ANSWER", "ANSWERS");
     if ($this->config->discussion_mode != Config::GLOBAL_DISCUSSION) {
         $this->view->set_var("FORUM_LINK", "");
     }
     // First, create the groups
     $iPaper = 0;
     $iGroup = 0;
     $begin = 1;
     $qPapers = "SELECT idPaper FROM Review WHERE id_user = '******'";
     $rPapers = $this->zmax_context->db->fetchAll($qPapers);
     $nbPapers = count($rPapers);
     // echo "Nb = $nbPapers<br/>";
     // while ($p =  $rPapers->fetch (Zend_Db::FETCH_OBJ)) {
     foreach ($rPapers as $paper) {
         $iPaper++;
         if ($iPaper % $nbPapersInGroup == 0 or $iPaper == $nbPapers) {
             $iGroup++;
             $end = $iPaper;
             $this->view->group_desc = "({$begin}-{$end})";
             $this->view->id_group = $iGroup;
             if ($iGroup == $currentGroup) {
                 $this->view->current_group = " bgcolor='lightgrey' ";
             } else {
                 $this->view->current_group = "";
             }
             $this->view->append("GROUPS", "GROUP");
             $begin = $end + 1;
         }
     }
     // Loop on the papers assigned to the reviewer
     $reviews = $this->user->findReview();
     $nbPapers = $i = 0;
     foreach ($reviews as $review) {
         $nbPapers++;
         // Take account of groups
         if ($nbPapers < $minPaper or $nbPapers >= $maxPaper) {
             continue;
         }
         $this->view->set_var("css_class", Config::CssCLass($i));
         $paper = $review->findParentPaper();
         // Instantiate entities in the view
         $paper->putInView($this->view);
         // Loop on the files associated to the paper, and propose a download link
         $requiredFiles = $requiredFileTbl->fetchAll();
         $countRequired = 0;
         $this->view->DOWNLOADS = "";
         foreach ($requiredFiles as $requiredFile) {
             $requiredFile->putInView($this->view);
             $countRequired++;
             if (!$paper->fileExists($requiredFile)) {
                 $this->view->THE_LINK = $texts->reviewer->not_yet_uploaded;
             } else {
                 $this->view->assign("THE_LINK", "DOWNLOAD_LINK");
             }
             $this->view->assign("DOWNLOAD_BIS", "DOWNLOAD");
             $this->view->append("DOWNLOADS", "DOWNLOAD_BIS");
         }
         if ($countRequired == 0) {
             $this->view->DOWNLOADS = $texts->reviewer->no_file_to_download;
         }
         if (!$review->overall) {
             $this->view->submit_review = "<font color='red'>" . $texts->reviewer->submit_review . "</font>";
         } else {
             $this->view->submit_review = "<font color='green'>" . $texts->reviewer->update_review . "</font>";
         }
         // If the local discussion mode is enabled AND the reviewer has posted her
         // review: give the ability to look at other reviews
         if ($this->config->discussion_mode != Config::NO_DISCUSSION and $review->overall) {
             $this->view->review_header = $texts->reviewer->all_reviews;
             $this->view->set_var("REVIEW", "");
             $this->view->assign("REVIEWS", "ALL_REVIEWS");
         } else {
             // Show only my review, no forum, no other reviews
             $this->view->show_review = $review->showReview($this->view);
             $this->view->assign("REVIEW", "MY_REVIEW");
             $this->view->review_header = $texts->reviewer->your_review;
             $this->view->REVIEWS = "";
         }
         $this->view->append("PAPERS", "PAPER");
     }
     if ($nbPapers == 0) {
         $this->view->set_var("PAPERS", "No papers");
     }
     echo $this->view->render("layout");
 }
コード例 #2
0
 /**
  * Show the program of the conference
  */
 function programAction()
 {
     $confSessionTbl = new ConfSession();
     $this->view->setFile("content", "program.xml");
     $this->view->set_block("content", "DATE", "DATES");
     $this->view->set_block("DATE", "SESSION_DETAIL", "SESSIONS");
     $this->view->set_block("SESSION_DETAIL", "PAPER_DETAIL", "PAPERS");
     $this->view->set_block("SESSION_DETAIL", "PAPER_DOWNLOAD", " ");
     $this->view->set_block("SESSION_DETAIL", "CHAIR", "SHOW_CHAIR");
     $this->view->set_block("SESSION_DETAIL", "ROOM", "SHOW_ROOM");
     // Check whether the links to CR files are required
     $listFiles = array();
     if (isset($_REQUEST['with_links'])) {
         // Get the list of required files in the proceedings phase
         $requiredFileTbl = new RequiredFile();
         $requiredFiles = $requiredFileTbl->fetchAll("id_phase = " . Config::PROCEEDINGS_PHASE);
         foreach ($requiredFiles as $requiredFile) {
             $listFiles[$requiredFile->file_code] = $requiredFile->file_extension;
         }
         // Directory of the CR files: the "proceedings" subdirectory must
         // be copied under the current directory when the program is published.
         $fileDir = $this->zmax_context->config->app->upload_path . DIRECTORY_SEPARATOR;
     } else {
         $this->view->download_link = "";
     }
     // First, loop on the dates
     $q_dates = "SELECT DISTINCT slot_date, UNIX_TIMESTAMP(slot_date) AS timestamp FROM Slot s ORDER BY slot_date";
     $rDates = $this->zmax_context->db->query($q_dates);
     while ($date = $rDates->fetch(Zend_Db::FETCH_OBJ)) {
         $this->view->SESSIONS = "";
         $zDate = new Zend_Date($date->timestamp, Zend_Date::TIMESTAMP);
         $this->view->date = $zDate->toString("EEEE d MMM yyyy", $this->zmax_context->locale);
         $q_sessions = "SELECT c.id, name, chair, comment as sess_comment, room, " . " end as slot_end, begin as slot_begin " . " FROM ConfSession c, Slot s " . " WHERE s.id=c.id_slot AND slot_date='{$date->slot_date}'" . " ORDER BY slot_date, begin, end, c.id";
         $rSess = $this->zmax_context->db->query($q_sessions);
         while ($session = $rSess->fetch(Zend_Db::FETCH_OBJ)) {
             $this->view->PAPERS = "";
             $this->view->conf_session_name = $session->name;
             $this->view->conf_slot_name = substr($session->slot_begin, 0, 5) . "-" . substr($session->slot_end, 0, 5);
             $this->view->conf_session_comment = $session->sess_comment;
             $this->view->conf_session_chair = $session->chair;
             $this->view->conf_session_room = $session->room;
             if (empty($session->room)) {
                 $this->view->SHOW_ROOM = "";
             } else {
                 $this->view->assign("SHOW_ROOM", "ROOM");
             }
             if (empty($session->chair)) {
                 $this->view->SHOW_CHAIR = "";
             } else {
                 $this->view->assign("SHOW_CHAIR", "CHAIR");
             }
             // Now, loop on accepter papers
             $q_papers = "SELECT * FROM Paper " . "WHERE id_conf_session='{$session->id}' ORDER BY position_in_session";
             $rp = $this->zmax_context->db->query($q_papers);
             while ($paper = $rp->fetch(Zend_Db::FETCH_OBJ)) {
                 $this->view->paper_authors = PaperRow::getPaperAuthors($this->zmax_context->db, $paper);
                 $this->view->paper_title = $paper->title;
                 // Take the name of the camera ready file
                 $iFile = 0;
                 foreach ($listFiles as $code => $ext) {
                     $iFile++;
                     $filePath = "." . DIRECTORY_SEPARATOR . "proceedings" . DIRECTORY_SEPARATOR . $code . "_" . $paper->id . "." . $ext;
                     if (file_exists($filePath)) {
                         $this->view->file_path = $filePath;
                         // $this->texts->author->get($code) . "</a>";
                         $this->view->append("PAPERS", "PAPER_DOWNLOAD");
                     } else {
                         // No file to download
                         $this->view->append("PAPERS", "PAPER_DETAIL");
                     }
                 }
                 // No file? Show the paper anyway
                 if ($iFile == 0) {
                     $this->view->append("PAPERS", "PAPER_DETAIL");
                 }
             }
             $this->view->append("SESSIONS", "SESSION_DETAIL");
         }
         $this->view->append("DATES", "DATE");
     }
     echo $this->view->render("layout");
 }
コード例 #3
0
 function assignAction()
 {
     $this->view->setFile("content", "assign.xml");
     $this->view->initial_message = "";
     // Sort either by topic or by status
     if (isset($_REQUEST['sort_topic'])) {
         $sortOption = "topic";
     } else {
         $sortOption = "status";
     }
     // Check whether papers are assigned to sessions
     if (isset($_REQUEST['form_assign_session'])) {
         foreach ($_REQUEST['conf_session'] as $id_paper => $id_session) {
             if (!empty($id_session)) {
                 if (isset($_REQUEST['position_in_session'][$id_paper])) {
                     $pos_in_session = trim($_REQUEST['position_in_session'][$id_paper]);
                 } else {
                     $pos_in_session = "";
                 }
                 if (!empty($pos_in_session)) {
                     $this->zmax_context->db->query("UPDATE Paper SET id_conf_session='{$id_session}', " . "position_in_session='{$pos_in_session}' " . "WHERE id='{$id_paper}'");
                 } else {
                     $this->db->query("UPDATE Paper SET id_conf_session='{$id_session}' " . "WHERE id='{$id_paper}'");
                 }
             }
         }
     }
     /*  First extract the 'blocks' describing a line from the template */
     $this->view->set_block("content", "PAPER_DETAIL", "PAPERS");
     $conf_sessions = $this->zmax_context->db->fetchPairs("SELECT id, name FROM ConfSession");
     $conf_sessions[0] = $this->texts->admin->not_yet_assigned;
     ksort($conf_sessions);
     // Get the list of required files in the proceedings phase
     $listFiles = array();
     $requiredFileTbl = new RequiredFile();
     $requiredFiles = $requiredFileTbl->fetchAll("id_phase = " . Config::PROCEEDINGS_PHASE);
     foreach ($requiredFiles as $requiredFile) {
         $listFiles[$requiredFile->file_code] = $requiredFile->file_extension;
     }
     // Directory of the CR files
     $fileDir = ".." . DIRECTORY_SEPARATOR . $this->zmax_context->config->app->upload_path . DIRECTORY_SEPARATOR . "proceedings" . DIRECTORY_SEPARATOR;
     // OK. Now execute the query, fetch the papers, display
     $query = "SELECT p.id, p.title, p.CR as cr, p.emailContact, t.label AS topic, IFNULL(id_conf_session,0) id_conf_session, " . " IFNULL(position_in_session,999) position_in_session, s.label " . " FROM Paper as p,  PaperStatus s, ResearchTopic t WHERE p.status=s.id " . " AND cameraReadyRequired ='Y' AND t.id=p.topic " . "ORDER BY id_conf_session DESC, position_in_session ASC, {$sortOption}";
     $rPapers = $this->zmax_context->db->query($query);
     $i = 0;
     while ($paper = $rPapers->fetch(Zend_Db::FETCH_OBJ)) {
         $this->view->css_class = Config::CssCLass($i++);
         $this->view->session_list = Zmax_View_Phplib::selectField("conf_session[{$paper->id}]", $conf_sessions, $paper->id_conf_session);
         $this->view->paper_id = $paper->id;
         $this->view->paper_title = $paper->title;
         $this->view->paper_status = $paper->label;
         $this->view->paper_topic = $paper->topic;
         $this->view->paper_position_in_session = $paper->position_in_session;
         $this->view->paper_authors = PaperRow::getPaperAuthors($this->zmax_context->db, $paper);
         $this->view->paper_email_contact = $paper->emailContact;
         $this->view->someUser = Mail::SOME_USER;
         if (!$this->config->isPhaseOpen(Config::PROCEEDINGS_PHASE)) {
             $this->view->cr_paper = $this->texts->admin->camera_ready_not_open;
         } else {
             // Take the name of the camera ready file
             foreach ($listFiles as $code => $ext) {
                 $filePath = $fileDir . $code . "_" . $paper->id . "." . $ext;
                 if (file_exists($filePath)) {
                     $this->view->download_link = $this->texts->camera_ready_uploaded;
                 } else {
                     $this->view->download_link = $this->texts->camera_ready_not_uploaded;
                 }
             }
         }
         $this->view->append("PAPERS", "PAPER_DETAIL");
     }
     echo $this->view->render("layout");
 }
コード例 #4
0
 function submittedAction()
 {
     $paperTbl = new Paper();
     $reviewTbl = new Review();
     $requiredFileTbl = new RequiredFile();
     $db = $this->zmax_context->db;
     $this->view_initial_message = "";
     $this->view->mailType = Mail::SOME_USER;
     $this->view->setFile("content", "submitted.xml");
     // Check whether the current selection must be changed
     if (isset($_POST['spStatus'])) {
         $this->config->changeCurrentSelection();
     }
     // If required, hide the selection form
     if (isset($_REQUEST['hide_selection_form'])) {
         $this->config->show_selection_form = 'N';
         $this->config->save();
     } else {
         if (isset($_REQUEST['show_selection_form'])) {
             $this->config->show_selection_form = 'Y';
             $this->config->save();
         }
     }
     /* Select all the papers and list them.
     		 First extract the 'block' describing a line from the template */
     $this->view->setBlock("content", "PAPER_DETAIL", "PAPERS");
     $this->view->setBlock("content", "SELECTION_FORM");
     $this->view->setBlock("content", "SHOW_SELECTION_FORM");
     $this->view->setBlock("PAPER_DETAIL", "REVIEWER", "REVIEWERS");
     $this->view->setBlock("PAPER_DETAIL", "DOWNLOAD", "DOWNLOADS");
     $this->view->setBlock("DOWNLOAD", "DOWNLOAD_LINK", "THE_LINK");
     $config = $this->config_v1;
     // Show the form for filtering papers, if required
     if ($this->config->show_selection_form == 'Y') {
         $this->view->set_var("FORM_SELECT_PAPERS", $this->FormSelectPapers($this->myUrl(), $this->view, $this->db_v1));
         $this->view->set_var("SHOW_SELECTION_FORM", "");
     } else {
         $this->view->set_var("SELECTION_FORM", "");
     }
     $nbPapers = 0;
     // Check whether the paper must be removed
     if (isset($_REQUEST['instr'])) {
         if ($_REQUEST['instr'] == "remove" and isset($_REQUEST['idPaper'])) {
             $paper = $paperTbl->find($_REQUEST['idPaper'])->current();
             $paper->delete();
         }
         if ($_REQUEST['instr'] == "removeReviewer") {
             $review = $reviewTbl->find($_REQUEST['id_paper'], $_REQUEST['id_user'])->current();
             if ($review) {
                 $review->delete();
             }
         }
     }
     // Do not load abstracts
     PaperRow::$loadAbstracts = false;
     PaperRow::$loadAnswers = false;
     $papers = $paperTbl->fetchAll("inCurrentSelection='Y'", "id");
     $i = 0;
     foreach ($papers as $paper) {
         $this->view->set_var("REVIEWERS", "");
         $nbPapers++;
         $paper->putInView($this->view);
         // Choose the CSS class
         $this->view->css_class = Config::CssCLass($i++);
         $this->view->set_var("SESSION_ID", session_id());
         $this->view->set_var("SUBMISSION_URL", $this->config->submissionURL);
         /* Show the list of reviewers */
         $reviews = $paper->findReview();
         foreach ($reviews as $review) {
             $user = $review->findParentUser();
             $review->putInView($this->view);
             $user->putInView($this->view);
             $this->view->append("REVIEWERS", "REVIEWER");
         }
         // Loop on the files associated to the paper, and propose a download link
         $requiredFiles = $requiredFileTbl->fetchAll();
         $countRequired = 0;
         $this->view->DOWNLOADS = "";
         foreach ($requiredFiles as $requiredFile) {
             // Check the file is required in the current phase
             // if ($this->config->isPhaseOpen($requiredFile->id_phase)) {
             $requiredFile->putInView($this->view);
             $countRequired++;
             if (!$paper->fileExists($requiredFile)) {
                 $this->view->THE_LINK = $this->zmax_context->texts->reviewer->not_yet_uploaded;
             } else {
                 $this->view->assign("THE_LINK", "DOWNLOAD_LINK");
             }
             $this->view->assign("DOWNLOAD_BIS", "DOWNLOAD");
             $this->view->append("DOWNLOADS", "DOWNLOAD_BIS");
             // }
         }
         if ($countRequired == 0) {
             $this->view->DOWNLOADS = $this->zmax_context->texts->reviewer->no_file_to_download;
         }
         /* Instanciate the entities in PAPER_DETAIL. Put in PAPERS   */
         $this->view->append("PAPERS", "PAPER_DETAIL");
     }
     echo $this->view->render("layout");
 }
コード例 #5
0
 /**
  * Attendee console: shows tha account and the list of submitted papers
  */
 function consoleAction()
 {
     $this->view->setFile("content", "index.xml");
     $this->view->setBlock("content", "PAPER", "PAPERS");
     $this->view->setBlock("PAPER", "UPLOAD", "UPLOADS");
     $this->view->setBlock("PAPER", "UPLOAD_BUTTON");
     $this->view->setBlock("UPLOAD", "DOWNLOAD", "DOWNLOAD_LINK");
     $requiredFileTbl = new RequiredFile();
     // Put user info in the view
     $this->user->putInView($this->view);
     // Loop on the papers of the current user
     $authors = $this->user->findAuthor();
     $i = 0;
     foreach ($authors as $author) {
         $this->view->css_class = Config::CssCLass($i++);
         // Get the paper
         $paper = $author->findParentPaper();
         $author->putInView($this->view);
         $paper->putInView($this->view);
         $this->view->UPLOADS = "";
         // Loop on the required file, and propose an upload link if required
         $requiredFiles = $requiredFileTbl->fetchAll();
         $countRequired = 0;
         $submissionComplete = true;
         $message = "";
         foreach ($requiredFiles as $requiredFile) {
             // Check the file is required in the current phase
             if ($this->config->isPhaseOpen($requiredFile->id_phase)) {
                 $requiredFile->putInView($this->view);
                 $countRequired++;
                 if ($requiredFile->mandatory == 'Y') {
                     $this->view->file_mandatory = '*';
                 } else {
                     $this->view->file_mandatory = '';
                 }
                 if (!$paper->fileExists($requiredFile)) {
                     $this->view->DOWNLOAD_LINK = " ";
                     if ($requiredFile->mandatory == 'Y') {
                         // The submission is not complete!
                         $submissionComplete = false;
                         $this->view->font_color = "red";
                     } else {
                         $this->view->font_color = "green";
                     }
                 } else {
                     $this->view->assign("DOWNLOAD_LINK", "DOWNLOAD");
                     $this->view->font_color = "green";
                 }
                 $this->view->append("UPLOADS", "UPLOAD");
             }
         }
         // Submission no complete? Show it
         if ($submissionComplete) {
             $this->view->icon_name = "ok-icon.png";
         } else {
             $this->view->icon_name = "warning-icon.png";
         }
         $this->view->message = $message;
         // Allright. Nothing to upload? Tell it.
         if ($countRequired == 0) {
             $this->view->UPLOADS = "No file to upload at this moment<br/>";
             $this->view->UPLOAD_BUTTON = " ";
         }
         // Two instantiations to resolve dynamic labels
         $this->view->assign("PAPER2", "PAPER");
         $this->view->append("PAPERS", "PAPER2");
     }
     if ($i == 0) {
         // Don't show the submision block;
         $this->view->PAPERS = $this->texts->author->no_submission_so_far;
     }
     echo $this->view->render("layout");
 }
コード例 #6
0
 /**
  * Download a paper
  */
 function downloadAction()
 {
     // The paper id should be a param
     $idPaper = $this->getRequest()->getParam('id_paper');
     $paper = new Paper();
     $paperRow = $paper->find($idPaper)->current();
     // The file id should be here as well
     $idFile = $this->getRequest()->getParam('id_file');
     $requiredFileTbl = new RequiredFile();
     $requiredFileRow = $requiredFileTbl->find($idFile)->current();
     if (!is_object($paperRow) or !is_object($requiredFileRow)) {
         // Raise an exception
         throw new Zmax_Exception("Author::download. Invalid call: ({$idPaper}, {$idFile})");
     }
     if (!$paperRow->getAuthorByEmail($this->user->email) and !$paperRow->getReview($this->user->id) and !$this->user->isAdmin()) {
         throw new Zmax_Exception("Author::download. No access right ({$idPaper}, {$idFile})");
     }
     $paperRow->download($requiredFileRow);
 }