Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
ApprovedProofFilesGridRow.inc.php
1 <?php
2 
16 import('lib.pkp.classes.controllers.grid.GridRow');
17 
18 // Link action & modal classes
19 import('lib.pkp.classes.linkAction.request.AjaxModal');
20 
26  parent::GridRow();
27  }
28 
29  //
30  // Overridden template methods
31  //
32  /*
33  * Configure the grid row
34  * @param $request PKPRequest
35  */
36  function initialize($request) {
37  parent::initialize($request);
38 
39  // Is this a new row or an existing row?
40  $fileId = $this->getId();
41  assert(!empty($fileId));
42 
43  $submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO');
44  $proofFile =& $submissionFileDao->getLatestRevision($fileId);
45 
46  if ($proofFile->getViewable()) {
47  // Actions
48  $router = $request->getRouter();
49  $this->addAction(
50  new LinkAction(
51  'editApprovedProof',
52  new AjaxModal(
53  $router->url($request, null, null, 'editApprovedProof', null, array(
54  'fileId' => $fileId,
55  'submissionId' => $request->getUserVar('submissionId'),
56  'publicationFormatId' => $request->getUserVar('publicationFormatId'),
57  )),
58  __('editor.monograph.approvedProofs.edit'),
59  'edit'
60  ),
61  __('editor.monograph.approvedProofs.edit.linkTitle'),
62  'edit'
63  )
64  );
65  } else {
66  $this->setNoActionMessage(__('grid.catalogEntry.availablePublicationFormat.proofNotApproved'));
67  }
68  }
69 }
70 
71 ?>
Handle approved proof grid row requests.
static & getDAO($name, $dbconn=null)
setNoActionMessage($message)
A modal that retrieves its content from via AJAX.
Class defining basic operations for handling HTML gridRows.
Definition: GridRow.inc.php:25
addAction($action, $position=GRID_ACTION_POSITION_DEFAULT)
Base class defining an action that can be performed by the user in the user interface.