当前位置: 首页>>代码示例>>PHP>>正文


PHP PKPRequest::getJournal方法代码示例

本文整理汇总了PHP中PKPRequest::getJournal方法的典型用法代码示例。如果您正苦于以下问题:PHP PKPRequest::getJournal方法的具体用法?PHP PKPRequest::getJournal怎么用?PHP PKPRequest::getJournal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PKPRequest的用法示例。


在下文中一共展示了PKPRequest::getJournal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 /**
  * Queue payment and save gift details.
  */
 function execute()
 {
     $journal = $this->request->getJournal();
     $journalId = $journal->getId();
     // Create new gift and save details
     import('classes.gift.Gift');
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($this->request);
     $paymentPlugin =& $paymentManager->getPaymentPlugin();
     $gift = new Gift();
     if ($paymentPlugin->getName() == 'ManualPayment') {
         $gift->setStatus(GIFT_STATUS_AWAITING_MANUAL_PAYMENT);
     } else {
         $gift->setStatus(GIFT_STATUS_AWAITING_ONLINE_PAYMENT);
     }
     $gift->setAssocType(ASSOC_TYPE_JOURNAL);
     $gift->setAssocId($journalId);
     $gift->setGiftType(GIFT_TYPE_SUBSCRIPTION);
     $gift->setGiftAssocId($this->getData('typeId'));
     $gift->setBuyerFirstName($this->getData('buyerFirstName'));
     $gift->setBuyerMiddleName($this->getData('buyerMiddleName'));
     $gift->setBuyerLastName($this->getData('buyerLastName'));
     $gift->setBuyerEmail($this->getData('buyerEmail'));
     $gift->setBuyerUserId($this->buyerUserId ? $this->buyerUserId : null);
     $gift->setRecipientFirstName($this->getData('recipientFirstName'));
     $gift->setRecipientMiddleName($this->getData('recipientMiddleName'));
     $gift->setRecipientLastName($this->getData('recipientLastName'));
     $gift->setRecipientEmail($this->getData('recipientEmail'));
     $gift->setRecipientUserId(null);
     $gift->setLocale($this->getData('giftLocale'));
     $gift->setGiftNoteTitle($this->getData('giftNoteTitle'));
     $gift->setGiftNote($this->getData('giftNote'));
     $giftDao = DAORegistry::getDAO('GiftDAO');
     $giftId = $giftDao->insertObject($gift);
     // Create new queued payment
     $subscriptionTypeDao = DAORegistry::getDAO('SubscriptionTypeDAO');
     $subscriptionType =& $subscriptionTypeDao->getSubscriptionType($this->getData('typeId'));
     $queuedPayment =& $paymentManager->createQueuedPayment($journalId, PAYMENT_TYPE_GIFT, null, $giftId, $subscriptionType->getCost(), $subscriptionType->getCurrencyCodeAlpha());
     $queuedPaymentId = $paymentManager->queuePayment($queuedPayment);
     $paymentManager->displayPaymentForm($queuedPaymentId, $queuedPayment);
 }
开发者ID:pkp,项目名称:ojs,代码行数:44,代码来源:GiftIndividualSubscriptionForm.inc.php

示例2: execute

 /**
  * Create institutional subscription. 
  */
 function execute()
 {
     $journal = $this->request->getJournal();
     $journalId = $journal->getId();
     $typeId = $this->getData('typeId');
     $subscriptionTypeDao = DAORegistry::getDAO('SubscriptionTypeDAO');
     $nonExpiring = $subscriptionTypeDao->getSubscriptionTypeNonExpiring($typeId);
     $today = date('Y-m-d');
     $insert = false;
     if (!isset($this->subscription)) {
         import('classes.subscription.InstitutionalSubscription');
         $subscription = new InstitutionalSubscription();
         $subscription->setJournalId($journalId);
         $subscription->setUserId($this->userId);
         $subscription->setReferenceNumber(null);
         $subscription->setNotes(null);
         $insert = true;
     } else {
         $subscription =& $this->subscription;
     }
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($this->request);
     $paymentPlugin =& $paymentManager->getPaymentPlugin();
     if ($paymentPlugin->getName() == 'ManualPayment') {
         $subscription->setStatus(SUBSCRIPTION_STATUS_AWAITING_MANUAL_PAYMENT);
     } else {
         $subscription->setStatus(SUBSCRIPTION_STATUS_AWAITING_ONLINE_PAYMENT);
     }
     $subscription->setTypeId($typeId);
     $subscription->setMembership($this->getData('membership') ? $this->getData('membership') : null);
     $subscription->setDateStart($nonExpiring ? null : $today);
     $subscription->setDateEnd($nonExpiring ? null : $today);
     $subscription->setInstitutionName($this->getData('institutionName'));
     $subscription->setInstitutionMailingAddress($this->getData('institutionMailingAddress'));
     $subscription->setDomain($this->getData('domain'));
     $subscription->setIPRanges($this->getData('ipRanges'));
     $institutionalSubscriptionDao = DAORegistry::getDAO('InstitutionalSubscriptionDAO');
     if ($insert) {
         $institutionalSubscriptionDao->insertSubscription($subscription);
     } else {
         $institutionalSubscriptionDao->updateSubscription($subscription);
     }
     $subscriptionTypeDao = DAORegistry::getDAO('SubscriptionTypeDAO');
     $subscriptionType =& $subscriptionTypeDao->getSubscriptionType($this->getData('typeId'));
     $queuedPayment =& $paymentManager->createQueuedPayment($journalId, PAYMENT_TYPE_PURCHASE_SUBSCRIPTION, $this->userId, $subscription->getId(), $subscriptionType->getCost(), $subscriptionType->getCurrencyCodeAlpha());
     $queuedPaymentId = $paymentManager->queuePayment($queuedPayment);
     $paymentManager->displayPaymentForm($queuedPaymentId, $queuedPayment);
 }
开发者ID:bkroll,项目名称:ojs,代码行数:51,代码来源:UserInstitutionalSubscriptionForm.inc.php

示例3: declineToReviewObject

 /**
  * Store decline by author to review an object.
  * @param array $args
  * @param PKPRequest $request
  */
 function declineToReviewObject($args, $request)
 {
     $journal =& $request->getJournal();
     $journalId = $journal->getId();
     $user =& $request->getUser();
     $objectId = !isset($args) || empty($args) ? null : (int) $args[0];
     if (!$this->_ensureObjectExists($objectId, $journalId)) {
         $request->redirect(null, 'objectsForReview');
     }
     $ofrDao =& DAORegistry::getDAO('ObjectForReviewDAO');
     $objectForReview =& $ofrDao->getById($objectId);
     $ofrAssignmentDao =& DAORegistry::getDAO('ObjectForReviewAssignmentDAO');
     $assignment =& $ofrAssignmentDao->getByObjectAndUserId($objectId, $user->getId());
     $redirect = true;
     if ($assignment) {
         import('classes.mail.MailTemplate');
         $email = new MailTemplate('OFR_OBJECT_DECLINED');
         $send = $request->getUserVar('send');
         // Author has filled out mail form or decided to skip email
         if ($send && !$email->hasErrors()) {
             // Update object for review as requested
             $assignment->setStatus(OFR_STATUS_DECLINED);
             $ofrAssignmentDao->updateObject($assignment);
             $email->send();
             $this->_createTrivialNotification(NOTIFICATION_TYPE_OFR_DECLINED, $request);
         } else {
             $returnUrl = $request->url(null, 'author', 'declineToReviewObject', $objectId);
             $this->_displayEmailForm($email, $objectForReview, $user, $returnUrl, 'OFR_OBJECT_DECLINED', $request);
             $redirect = false;
         }
     }
     if ($redirect) {
         $request->redirect(null, 'author', 'objectsForReview');
     }
 }
开发者ID:justinshaffner,项目名称:AAAObjectsForReview,代码行数:40,代码来源:ObjectsForReviewAuthorHandler.inc.php

示例4: uploadONIXObjectForReview

 /**
  * Batch import from an ONIX XML export.
  * @param array $args
  * @param PKPRequest $request
  */
 function uploadONIXObjectForReview($args, &$request)
 {
     $user = $request->getUser();
     $journal =& $request->getJournal();
     $ofrOrgDao =& DAORegistry::getDAO('ObjectForReviewOrganizationDAO');
     $ofrPlugin =& $this->_getObjectsForReviewPlugin();
     $ofrPlugin->import('classes.form.ObjectForReviewForm');
     $reviewObjectTypeId = (int) $request->getUserVar('reviewObjectTypeId');
     import('classes.file.TemporaryFileManager');
     $temporaryFileManager = new TemporaryFileManager();
     $temporaryFile = $temporaryFileManager->handleUpload('onixFile', $user->getId());
     $filePath = $temporaryFile->getFilePath();
     $parser = new XMLParser();
     $doc =& $parser->parse($filePath);
     $multiple = $request->getUserVar('multiple');
     if ($doc) {
         // Determine if we have short or long tags.
         $productNodes = $doc->getChildByName('product');
         $shortTags = $productNodes ? true : false;
         for ($index = 0; $productNode = $doc->getChildByName($this->_getOnixTag('Product', $shortTags), $index); $index++) {
             $importData = array();
             if ($productNode) {
                 $publisherNode = $productNode->getChildByName($this->_getOnixTag('Publisher', $shortTags));
                 if ($publisherNode) {
                     $publisherNameNode = $publisherNode->getChildByName($this->_getOnixTag('PublisherName', $shortTags));
                     if ($publisherNameNode) {
                         $publisher = $publisherNameNode->getValue();
                         $organization =& $ofrOrgDao->getOrganizationByName(trim($publisher));
                         if ($organization) {
                             $importData['publisherId'] = $organization->getId();
                         }
                     }
                 }
                 $websiteNode = $publisherNode->getChildByName($this->_getOnixTag('Website', $shortTags));
                 if ($websiteNode) {
                     $websiteLinkNode = $websiteNode->getChildByName($this->_getOnixTag('WebsiteLink', $shortTags));
                     $websiteLink = $websiteLinkNode->getValue();
                     $importData['book_publisher_url'] = $websiteLink;
                 }
                 $titleNode = $productNode->getChildByName($this->_getOnixTag('Title', $shortTags));
                 if ($titleNode) {
                     $titleTextNode = $titleNode->getChildByName($this->_getOnixTag('TitleText', $shortTags));
                     $title = $titleTextNode->getValue();
                     $importData['title'] = $title;
                 }
                 $subTitleNode = $titleNode->getChildByName($this->_getOnixTag('Subtitle', $shortTags));
                 if ($subTitleNode) {
                     $subTitle = $subTitleNode->getValue();
                     $importData['shortTitle'] = $subTitle;
                 }
                 $seriesNode = $productNode->getChildByName($this->_getOnixTag('Series', $shortTags));
                 if ($seriesNode) {
                     $seriesTextNode = $seriesNode->getChildByName($this->_getOnixTag('TitleOfSeries', $shortTags));
                     $series = $seriesTextNode->getValue();
                     $importData['book_series'] = $series;
                 }
                 $languageNode = $productNode->getChildByName($this->_getOnixTag('Language', $shortTags));
                 if ($languageNode) {
                     $languageCodeNode = $languageNode->getChildByName($this->_getOnixTag('LanguageCode', $shortTags));
                     $language = $languageCodeNode->getValue();
                     $importData['language'] = substr($language, 0, 2);
                 } else {
                     $importData['language'] = 'en';
                 }
                 $pageNode = $productNode->getChildByName($this->_getOnixTag('NumberOfPages', $shortTags));
                 if ($pageNode) {
                     $pages = $pageNode->getValue();
                     $importData['book_pages_no'] = $pages;
                 }
                 // Abstract. Look for OtherText with
                 // sub element of TextTypeCode of '01' (main description)
                 $abstract = '';
                 for ($authorIndex = 0; $node = $productNode->getChildByName($this->_getOnixTag('OtherText', $shortTags), $authorIndex); $authorIndex++) {
                     $typeNode = $node->getChildByName($this->_getOnixTag('TextTypeCode', $shortTags));
                     if ($typeNode && $typeNode->getValue() == '01') {
                         $textNode = $node->getChildByName($this->_getOnixTag('Text', $shortTags));
                         if ($textNode) {
                             $abstract = strip_tags($textNode->getValue());
                         }
                         break;
                     }
                 }
                 $importData['abstract'] = $abstract;
                 // ISBN-13
                 for ($productIdentifierIndex = 0; $node = $productNode->getChildByName($this->_getOnixTag('ProductIdentifier', $shortTags), $productIdentifierIndex); $productIdentifierIndex++) {
                     $idTypeNode = $node->getChildByName($this->_getOnixTag('ProductIDType', $shortTags));
                     if ($idTypeNode && $idTypeNode->getValue() == '15') {
                         // ISBN-13
                         $textNode = $node->getChildByName($this->_getOnixTag('IDValue', $shortTags));
                         if ($textNode) {
                             $importData['book_isbn'] = $textNode->getValue();
                         }
                         break;
                     }
                 }
//.........这里部分代码省略.........
开发者ID:justinshaffner,项目名称:AAAObjectsForReview,代码行数:101,代码来源:ObjectsForReviewEditorHandler.inc.php


注:本文中的PKPRequest::getJournal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。