Open Monograph Press  3.3.0
PublicIdentifiersForm.inc.php
1 <?php
2 
16 import('lib.pkp.controllers.tab.pubIds.form.PKPPublicIdentifiersForm');
17 
19 
26  public function __construct($pubObject, $stageId = null, $formParams = null) {
27  parent::__construct($pubObject, $stageId, $formParams);
28  }
29 
33  function fetch($request, $template = null, $display = false) {
34  $templateMgr = TemplateManager::getManager($request);
35  $enablePublisherId = $request->getContext()->getData('enablePublisherId');
36  $templateMgr->assign([
37  'enablePublisherId' => (is_a($this->getPubObject(), 'Chapter') && in_array('chapter', $enablePublisherId)) ||
38  (is_a($this->getPubObject(), 'Representation') && in_array('representation', $enablePublisherId)) ||
39  (is_a($this->getPubObject(), 'SubmissionFile') && in_array('file', $enablePublisherId)),
40  ]);
41 
42  return parent::fetch($request, $template, $display);
43  }
44 
48  public function execute(...$functionArgs) {
49  parent::execute(...$functionArgs);
50  $pubObject = $this->getPubObject();
51  if (is_a($pubObject, 'Chapter')) {
52  $chapterDao = DAORegistry::getDAO('ChapterDAO'); /* @var $chapterDao ChapterDAO */
53  $chapterDao->updateObject($pubObject);
54  }
55  }
56 
60  public function getAssocType($pubObject) {
61  if (is_a($pubObject, 'Chapter')) {
62  return ASSOC_TYPE_CHAPTER;
63  }
64  return parent::getAssocType($pubObject);
65  }
66 
67 }
68 
69 
PublicIdentifiersForm\__construct
__construct($pubObject, $stageId=null, $formParams=null)
Definition: PublicIdentifiersForm.inc.php:26
DAORegistry\getDAO
static & getDAO($name, $dbconn=null)
Definition: DAORegistry.inc.php:57
PublicIdentifiersForm
Displays a pub ids form.
Definition: PublicIdentifiersForm.inc.php:18
PublicIdentifiersForm\fetch
fetch($request, $template=null, $display=false)
Definition: PublicIdentifiersForm.inc.php:33
PKPPublicIdentifiersForm\getPubObject
getPubObject()
Definition: PKPPublicIdentifiersForm.inc.php:120
PublicIdentifiersForm\getAssocType
getAssocType($pubObject)
Definition: PublicIdentifiersForm.inc.php:60
PublicIdentifiersForm\execute
execute(... $functionArgs)
Definition: PublicIdentifiersForm.inc.php:48
PKPTemplateManager\getManager
static & getManager($request=null)
Definition: PKPTemplateManager.inc.php:1239
PKPPublicIdentifiersForm
Displays a pub ids form.
Definition: PKPPublicIdentifiersForm.inc.php:19