Exemplo n.º 1
0
 /**
  * Edit the current issue form
  */
 function editIssue($args, $request)
 {
     $issueId = (int) array_shift($args);
     $this->validate($issueId, true);
     $issue =& $this->issue;
     $this->setupTemplate(EDITOR_SECTION_ISSUES);
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('issueId', $issueId);
     $journal =& $request->getJournal();
     $journalId = $journal->getId();
     import('classes.issue.IssueAction');
     $templateMgr->assign('issueOptions', IssueAction::getIssueOptions());
     import('classes.issue.form.IssueForm');
     if (checkPhpVersion('5.0.0')) {
         // WARNING: This form needs $this in constructor
         $issueForm = new IssueForm('editor/issues/issueData.tpl');
     } else {
         $issueForm =& new IssueForm('editor/issues/issueData.tpl');
     }
     $issueForm->readInputData();
     if ($issueForm->validate($issue)) {
         $issueForm->execute($issueId);
         $issueForm->initData($issueId);
     }
     $templateMgr->assign_by_ref('issue', $issue);
     $templateMgr->assign('unpublished', !$issue->getPublished());
     $issueForm->display();
 }
 /**
  * Edit the current issue form
  */
 function editIssue($args)
 {
     $issueId = isset($args[0]) ? (int) $args[0] : 0;
     $this->validate($issueId, true);
     $issue =& $this->issue;
     $this->setupTemplate(EDITOR_SECTION_ISSUES);
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('issueId', $issueId);
     $journal =& Request::getJournal();
     $journalId = $journal->getId();
     import('classes.issue.IssueAction');
     $templateMgr->assign('issueOptions', IssueAction::getIssueOptions());
     import('classes.issue.form.IssueForm');
     if (checkPhpVersion('5.0.0')) {
         // WARNING: This form needs $this in constructor
         $issueForm = new IssueForm('editor/issues/issueData.tpl');
     } else {
         $issueForm =& new IssueForm('editor/issues/issueData.tpl');
     }
     $issueForm->readInputData();
     if ($issueForm->validate($issueId)) {
         $issueForm->execute($issueId);
         $issueForm->initData($issueId);
         //%CBP% add Issue ISBN to table
         $CBPPlatformDao =& DAORegistry::getDAO('CBPPlatformDAO');
         $CBPPlatformDao->setIssueISBN($issueId, Request::getUserVar('isbn'));
     }
     $templateMgr->assign_by_ref('issue', $issue);
     $templateMgr->assign('unpublished', !$issue->getPublished());
     $issueForm->display();
 }