Пример #1
0
 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('pageTitle', 'submission.comments.comments');
     $templateMgr->assign('commentAction', 'postLayoutComment');
     $templateMgr->assign('commentType', 'layout');
     $templateMgr->assign('hiddenFormParams', array('articleId' => $this->article->getId()));
     parent::display();
 }
 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('pageTitle', 'submission.comments.directorAuthorCorrespondence');
     $templateMgr->assign('paperId', $this->paper->getPaperId());
     $templateMgr->assign('commentAction', 'postDirectorDecisionComment');
     $templateMgr->assign('hiddenFormParams', array('paperId' => $this->paper->getPaperId()));
     $isDirector = $this->roleId == ROLE_ID_DIRECTOR || $this->roleId == ROLE_ID_TRACK_DIRECTOR ? true : false;
     $templateMgr->assign('isDirector', $isDirector);
     parent::display();
 }
 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('pageTitle', 'submission.comments.editorAuthorCorrespondence');
     $templateMgr->assign('articleId', $this->article->getId());
     $templateMgr->assign('commentAction', 'postEditorDecisionComment');
     $templateMgr->assign('hiddenFormParams', array('articleId' => $this->article->getId()));
     $isEditor = $this->roleId == ROLE_ID_EDITOR || $this->roleId == ROLE_ID_SECTION_EDITOR ? true : false;
     $templateMgr->assign('isEditor', $isEditor);
     parent::display();
 }
Пример #4
0
 /**
  * Display the form.
  */
 function display()
 {
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $reviewAssignment =& $reviewAssignmentDao->getById($this->reviewId);
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('commentType', 'peerReview');
     $templateMgr->assign('pageTitle', 'submission.comments.review');
     $templateMgr->assign('commentAction', 'postPeerReviewComment');
     $templateMgr->assign('commentTitle', strip_tags($this->article->getScientificTitle()));
     $templateMgr->assign('isLocked', isset($reviewAssignment) && $reviewAssignment->getDateCompleted() != null);
     $templateMgr->assign('canEmail', false);
     // Previously, editors could always email.
     $templateMgr->assign('showReviewLetters', $this->roleId == ROLE_ID_EDITOR || $this->roleId == ROLE_ID_SECTION_EDITOR ? true : false);
     $templateMgr->assign('reviewer', ROLE_ID_REVIEWER);
     $templateMgr->assign('hiddenFormParams', array('articleId' => $this->article->getArticleId(), 'reviewId' => $this->reviewId));
     parent::display();
 }
Пример #5
0
 /**
  * Display the form.
  */
 function display()
 {
     $reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO');
     $reviewAssignment =& $reviewAssignmentDao->getById($this->reviewId);
     $reviewLetters =& $reviewAssignmentDao->getReviewIndexesForRound($this->paper->getPaperId(), $this->paper->getCurrentRound());
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('commentType', 'peerReview');
     $templateMgr->assign('pageTitle', 'submission.comments.review');
     $templateMgr->assign('commentAction', 'postPeerReviewComment');
     $templateMgr->assign('commentTitle', strip_tags($this->paper->getLocalizedTitle()));
     $templateMgr->assign('isLocked', isset($reviewAssignment) && $reviewAssignment->getDateCompleted() != null);
     $templateMgr->assign('canEmail', false);
     // Previously, directors could always email.
     $templateMgr->assign('showReviewLetters', $this->roleId == ROLE_ID_DIRECTOR ? true : false);
     $templateMgr->assign('reviewLetters', $reviewLetters);
     $templateMgr->assign('reviewer', ROLE_ID_REVIEWER);
     $templateMgr->assign('hiddenFormParams', array('paperId' => $this->paper->getPaperId(), 'reviewId' => $this->reviewId));
     parent::display();
 }
Пример #6
0
 /**
  * Add a comment
  * @param $args array
  * @param $request Request
  */
 function add($args, $request)
 {
     $articleId = isset($args[0]) ? (int) $args[0] : 0;
     $galleyId = isset($args[1]) ? (int) $args[1] : 0;
     $parentId = isset($args[2]) ? (int) $args[2] : 0;
     $journal =& $request->getJournal();
     $commentDao =& DAORegistry::getDAO('CommentDAO');
     $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
     $publishedArticle =& $publishedArticleDao->getPublishedArticleByArticleId($articleId);
     $parent =& $commentDao->getById($parentId, $articleId);
     if (isset($parent) && $parent->getSubmissionId() != $articleId) {
         $request->redirect(null, null, 'view', array($articleId, $galleyId));
     }
     $this->validate($request, $articleId);
     $this->setupTemplate($request, $publishedArticle, $galleyId, $parent);
     // Bring in comment constants
     $enableComments = $journal->getSetting('enableComments');
     switch ($enableComments) {
         case COMMENTS_UNAUTHENTICATED:
             break;
         case COMMENTS_AUTHENTICATED:
         case COMMENTS_ANONYMOUS:
             // The user must be logged in to post comments.
             if (!$request->getUser()) {
                 Validation::redirectLogin();
             }
             break;
         default:
             // Comments are disabled.
             Validation::redirectLogin();
     }
     import('classes.comment.form.CommentForm');
     $commentForm = new CommentForm(null, $articleId, $galleyId, isset($parent) ? $parentId : null);
     $commentForm->initData();
     if (isset($args[3]) && $args[3] == 'save') {
         $commentForm->readInputData();
         if ($commentForm->validate()) {
             $commentForm->execute();
             // Send a notification to associated users
             import('classes.notification.NotificationManager');
             $notificationManager = new NotificationManager();
             $articleDao =& DAORegistry::getDAO('ArticleDAO');
             $article =& $articleDao->getArticle($articleId);
             $notificationUsers = $article->getAssociatedUserIds();
             foreach ($notificationUsers as $userRole) {
                 $notificationManager->createNotification($request, $userRole['id'], NOTIFICATION_TYPE_USER_COMMENT, $article->getJournalId(), ASSOC_TYPE_ARTICLE, $article->getId());
             }
             $request->redirect(null, null, 'view', array($articleId, $galleyId, $parentId), array('refresh' => 1));
         }
     }
     $commentForm->display();
 }
Пример #7
0
 function add($args)
 {
     $paperId = isset($args[0]) ? (int) $args[0] : 0;
     $galleyId = isset($args[1]) ? (int) $args[1] : 0;
     $parentId = isset($args[2]) ? (int) $args[2] : 0;
     $conference =& Request::getConference();
     $schedConf =& Request::getSchedConf();
     $this->validate($paperId);
     $paper =& $this->paper;
     $parent =& $commentDao->getComment($parentId, $paperId);
     if (isset($parent) && $parent->getPaperId() != $paperId) {
         Request::redirect(null, null, null, 'view', array($paperId, $galleyId));
     }
     $this->setupTemplate($paper, $galleyId, $parent);
     // Bring in comment constants
     $commentDao =& DAORegistry::getDAO('CommentDAO');
     $enableComments = $conference->getSetting('enableComments');
     $commentsRequireRegistration = $conference->getSetting('commentsRequireRegistration');
     $commentsAllowAnonymous = $conference->getSetting('commentsAllowAnonymous');
     $closeCommentsDate = $schedConf->getSetting('closeCommentsDate');
     $commentsClosed = $schedConf->getSetting('closeComments') ? true : false && strtotime($closeCommentsDate < time());
     $enableComments = $enableComments && !$commentsClosed && $paper->getEnableComments();
     if (!$enableComments) {
         Request::redirect(null, null, 'index');
     }
     if ($commentsRequireRegistration && !Request::getUser()) {
         Validation::redirectLogin();
     }
     import('comment.form.CommentForm');
     $commentForm = new CommentForm(null, $paperId, $galleyId, isset($parent) ? $parentId : null);
     $commentForm->initData();
     if (isset($args[3]) && $args[3] == 'save') {
         $commentForm->readInputData();
         if ($commentForm->validate()) {
             $commentForm->execute();
             // Send a notification to associated users
             import('notification.Notification');
             $paperDAO =& DAORegistry::getDAO('PaperDAO');
             $paper =& $paperDAO->getPaper($paperId);
             $notificationUsers = $paper->getAssociatedUserIds();
             foreach ($notificationUsers as $userRole) {
                 $url = Request::url(null, null, null, 'view', array($paperId, $galleyId, $parentId));
                 Notification::createNotification($userRole['id'], "notification.type.userComment", $paper->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_USER_COMMENT);
             }
             Request::redirect(null, null, null, 'view', array($paperId, $galleyId, $parentId), array('refresh' => 1));
         }
     }
     $commentForm->display();
 }
Пример #8
0
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add(get_string('emarking', 'mod_emarking'));
$PAGE->navbar->add(get_string('comment', 'mod_emarking'));
echo $OUTPUT->header();
echo $OUTPUT->heading_with_help(get_string('emarking', 'mod_emarking'), 'annotatesubmission', 'mod_emarking');
//output of the tabtree
echo $OUTPUT->tabtree(emarking_tabs($context, $cm, $emarking), "comment");
//Form viewer
$view_form = 1;
// action actions on create
if ($action == "create") {
    echo $OUTPUT->heading(get_string('createcomment', 'mod_emarking'));
    //Creating form
    $newcommentform = new CommentForm();
    //Form Display
    $newcommentform->display();
}
if ($action == "created") {
    //Recration of the form
    $newcommentform = new CommentForm();
    //Form result
    if ($newcommentform->is_cancelled()) {
        $action = "list";
    } elseif ($fromform = $newcommentform->get_data()) {
        $record = new stdClass();
        //Giving var record the necesary parameters
        $record->text = $fromform->comment["text"];
        $record->emarkingid = $emarking->id;
        $record->markerid = $USER->id;
        //Creating record in moodle DB
        $DB->insert_record('emarking_predefined_comment', $record);