• Main Page
  • Modules
  • Classes
  • Files
  • File List

controllers/informationCenter/linkAction/SignoffNotesLinkAction.inc.php

00001 <?php
00014 import('lib.pkp.classes.linkAction.LinkAction');
00015 
00016 class SignoffNotesLinkAction extends LinkAction {
00017 
00026    function SignoffNotesLinkAction(&$request, $signoff, $monographId, $stageId) {
00027       // Instantiate the redirect action request.
00028       $dispatcher =& $request->getDispatcher();
00029       import('lib.pkp.classes.linkAction.request.AjaxModal');
00030 
00031       $actionArgs = array(
00032          'signoffId' => $signoff->getId(),
00033          'monographId' => $monographId,
00034          'stageId' => $stageId
00035       );
00036 
00037       $user =& $request->getUser();
00038       $router =& $request->getRouter();
00039 
00040       $ajaxModal = new AjaxModal(
00041          $dispatcher->url($request, ROUTE_COMPONENT, null, 'informationCenter.SignoffInformationCenterHandler',
00042             'viewNotes', null, $actionArgs),
00043          __('submission.informationCenter.notes')
00044       );
00045 
00046       parent::LinkAction('viewSignoffNotes', $ajaxModal, '', $this->_getNoteState($signoff, $user));
00047    }
00048 
00054    function _getNoteState($signoff, $user) {
00055       $noteDao =& DAORegistry::getDAO('NoteDAO');
00056 
00057       // If no notes exist, display a dimmed icon.
00058       if (!$noteDao->notesExistByAssoc(ASSOC_TYPE_SIGNOFF, $signoff->getId())) {
00059          return 'notes_none';
00060       }
00061 
00062       // If new notes exist, display a bold icon.
00063       if ($noteDao->unreadNotesExistByAssoc(ASSOC_TYPE_SIGNOFF, $signoff->getId(), $user->getId())) {
00064          return 'notes_new';
00065       }
00066 
00067       // Otherwise, notes exist but not new ones.
00068       return 'notes';
00069    }
00070 }
00071 
00072 ?>

Generated on Mon Sep 17 2012 13:58:56 for Open Monograph Press by  doxygen 1.7.1