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


PHP Issue::setDescription方法代码示例

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


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

示例1: importIssue

 function importIssue(&$journal, &$issueNode, &$issue, &$errors, &$user, $isCommandLine, &$dependentItems, $cleanupErrors = true)
 {
     $errors = array();
     $issue = null;
     $hasErrors = false;
     $issueDao =& DAORegistry::getDAO('IssueDAO');
     $issue = new Issue();
     $issue->setJournalId($journal->getId());
     $journalSupportedLocales = array_keys($journal->getSupportedLocaleNames());
     // => journal locales must be set up before
     $journalPrimaryLocale = $journal->getPrimaryLocale();
     /* --- Set title, description, volume, number, and year --- */
     $titleExists = false;
     for ($index = 0; $node = $issueNode->getChildByName('title', $index); $index++) {
         $locale = $node->getAttribute('locale');
         if ($locale == '') {
             $locale = $journalPrimaryLocale;
         } elseif (!in_array($locale, $journalSupportedLocales)) {
             $errors[] = array('plugins.importexport.native.import.error.issueTitleLocaleUnsupported', array('issueTitle' => $node->getValue(), 'locale' => $locale));
             $hasErrors = true;
             continue;
         }
         $issue->setTitle($node->getValue(), $locale);
         $titleExists = true;
     }
     for ($index = 0; $node = $issueNode->getChildByName('description', $index); $index++) {
         $locale = $node->getAttribute('locale');
         if ($locale == '') {
             $locale = $journalPrimaryLocale;
         } elseif (!in_array($locale, $journalSupportedLocales)) {
             $errors[] = array('plugins.importexport.native.import.error.issueDescriptionLocaleUnsupported', array('issueTitle' => $issue->getLocalizedTitle(), 'locale' => $locale));
             $hasErrors = true;
             continue;
         }
         $issue->setDescription($node->getValue(), $locale);
     }
     if ($node = $issueNode->getChildByName('volume')) {
         $issue->setVolume($node->getValue());
     }
     if ($node = $issueNode->getChildByName('number')) {
         $issue->setNumber($node->getValue());
     }
     if ($node = $issueNode->getChildByName('year')) {
         $issue->setYear($node->getValue());
     }
     /* --- Set date published --- */
     if ($node = $issueNode->getChildByName('date_published')) {
         $publishedDate = strtotime($node->getValue());
         if ($publishedDate === -1) {
             $errors[] = array('plugins.importexport.native.import.error.invalidDate', array('value' => $node->getValue()));
             if ($cleanupErrors) {
                 NativeImportDom::cleanupFailure($dependentItems);
             }
             return false;
         } else {
             $issue->setDatePublished($publishedDate);
         }
     }
     /* --- Set attributes: Identification type, published, current, public ID --- */
     switch ($value = $issueNode->getAttribute('identification')) {
         case 'num_vol_year':
             $issue->setShowVolume(1);
             $issue->setShowNumber(1);
             $issue->setShowYear(1);
             $issue->setShowTitle(0);
             break;
         case 'vol_year':
             $issue->setShowVolume(1);
             $issue->setShowNumber(0);
             $issue->setShowYear(1);
             $issue->setShowTitle(0);
             break;
         case 'vol':
             $issue->setShowVolume(1);
             $issue->setShowNumber(0);
             $issue->setShowYear(0);
             $issue->setShowTitle(0);
             break;
         case 'year':
             $issue->setShowVolume(0);
             $issue->setShowNumber(0);
             $issue->setShowYear(1);
             $issue->setShowTitle(0);
             break;
         case 'title':
         case '':
         case null:
             $issue->setShowVolume(0);
             $issue->setShowNumber(0);
             $issue->setShowYear(0);
             $issue->setShowTitle(1);
             break;
         default:
             $errors[] = array('plugins.importexport.native.import.error.unknownIdentificationType', array('identificationType' => $value, 'issueTitle' => $issue->getLocalizedTitle()));
             $hasErrors = true;
             break;
     }
     if (($issueNode->getAttribute('identification') == 'title' || $issueNode->getAttribute('identification') == '') && !$titleExists) {
         $errors[] = array('plugins.importexport.native.import.error.titleMissing', array());
         // Set a placeholder title so that further errors are
//.........这里部分代码省略.........
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:101,代码来源:NativeImportDom.inc.php

示例2: Issue

             $ticket->setLocation($location);
         } else {
             $ticket->setLocation($row['street_num']);
         }
     }
 } else {
     $location = "{$row['street_dir']} {$row['street_name']} {$row['street_type']} {$row['sud_type']} {$row['sud_num']}";
     $location = preg_replace('/\\s+/', ' ', $location);
     $ticket->setLocation($location);
 }
 echo $ticket->getLocation() . "\n";
 // Create the issue on this ticket
 $issue = new Issue();
 $issue->setDate($ticket->getEnteredDate());
 if ($row['comments']) {
     $issue->setDescription($row['comments']);
 }
 $ticket->updateIssues($issue);
 $issue = $ticket->getIssue();
 $location = $ticket->getLocation();
 $date = $issue->getDate();
 $description = $issue->getDescription();
 echo "Query: {$location}, {$description}, {$date}\n";
 $ticketList = new TicketList();
 $ticketList->findByMongoQuery(array('location' => $location, 'issues.description' => $description, 'issues.date' => $date));
 if (count($ticketList) == 1) {
     // Update the Mongo case Number with what's in reqpro
     foreach ($ticketList as $t) {
         $data = $t->getData();
         $data['number'] = (int) $row['c_num'];
         echo "Saving new number {$data['number']}\n";
开发者ID:CodeForEindhoven,项目名称:uReport,代码行数:31,代码来源:reqproIDs.php

示例3: execute

 /**
  * Save issue settings.
  */
 function execute($issueId = 0)
 {
     $journal =& Request::getJournal();
     $issueDao =& DAORegistry::getDAO('IssueDAO');
     if ($issueId) {
         $issue = $issueDao->getIssueById($issueId);
         $isNewIssue = false;
     } else {
         $issue = new Issue();
         $isNewIssue = true;
     }
     $volume = $this->getData('volume');
     $number = $this->getData('number');
     $year = $this->getData('year');
     $showVolume = $this->getData('showVolume');
     $showNumber = $this->getData('showNumber');
     $showYear = $this->getData('showYear');
     $showTitle = $this->getData('showTitle');
     $issue->setJournalId($journal->getId());
     $issue->setTitle($this->getData('title'), null);
     // Localized
     $issue->setVolume(empty($volume) ? 0 : $volume);
     $issue->setNumber(empty($number) ? 0 : $number);
     $issue->setYear(empty($year) ? 0 : $year);
     if (!$isNewIssue) {
         $issue->setDatePublished($this->getData('datePublished'));
     }
     $issue->setDescription($this->getData('description'), null);
     // Localized
     $issue->setPublicIssueId($this->getData('publicIssueId'));
     $issue->setShowVolume(empty($showVolume) ? 0 : $showVolume);
     $issue->setShowNumber(empty($showNumber) ? 0 : $showNumber);
     $issue->setShowYear(empty($showYear) ? 0 : $showYear);
     $issue->setShowTitle(empty($showTitle) ? 0 : $showTitle);
     $issue->setCoverPageDescription($this->getData('coverPageDescription'), null);
     // Localized
     $issue->setCoverPageAltText($this->getData('coverPageAltText'), null);
     // Localized
     $showCoverPage = array_map(create_function('$arrayElement', 'return (int)$arrayElement;'), (array) $this->getData('showCoverPage'));
     foreach (array_keys($this->getData('coverPageDescription')) as $locale) {
         if (!array_key_exists($locale, $showCoverPage)) {
             $showCoverPage[$locale] = 0;
         }
     }
     $issue->setShowCoverPage($showCoverPage, null);
     // Localized
     $hideCoverPageArchives = array_map(create_function('$arrayElement', 'return (int)$arrayElement;'), (array) $this->getData('hideCoverPageArchives'));
     foreach (array_keys($this->getData('coverPageDescription')) as $locale) {
         if (!array_key_exists($locale, $hideCoverPageArchives)) {
             $hideCoverPageArchives[$locale] = 0;
         }
     }
     $issue->setHideCoverPageArchives($hideCoverPageArchives, null);
     // Localized
     $hideCoverPageCover = array_map(create_function('$arrayElement', 'return (int)$arrayElement;'), (array) $this->getData('hideCoverPageCover'));
     foreach (array_keys($this->getData('coverPageDescription')) as $locale) {
         if (!array_key_exists($locale, $hideCoverPageCover)) {
             $hideCoverPageCover[$locale] = 0;
         }
     }
     $issue->setHideCoverPageCover($hideCoverPageCover, null);
     // Localized
     $issue->setAccessStatus($this->getData('accessStatus'));
     if ($this->getData('enableOpenAccessDate')) {
         $issue->setOpenAccessDate($this->getData('openAccessDate'));
     } else {
         $issue->setOpenAccessDate(null);
     }
     // if issueId is supplied, then update issue otherwise insert a new one
     if ($issueId) {
         $issue->setIssueId($issueId);
         $issueDao->updateIssue($issue);
     } else {
         $issue->setPublished(0);
         $issue->setCurrent(0);
         $issueId = $issueDao->insertIssue($issue);
         $issue->setIssueId($issueId);
     }
     import('classes.file.PublicFileManager');
     $publicFileManager = new PublicFileManager();
     if ($publicFileManager->uploadedFileExists('coverPage')) {
         $journal = Request::getJournal();
         $originalFileName = $publicFileManager->getUploadedFileName('coverPage');
         $newFileName = 'cover_issue_' . $issueId . '_' . $this->getFormLocale() . '.' . $publicFileManager->getExtension($originalFileName);
         $publicFileManager->uploadJournalFile($journal->getId(), 'coverPage', $newFileName);
         $issue->setOriginalFileName($publicFileManager->truncateFileName($originalFileName, 127), $this->getFormLocale());
         $issue->setFileName($newFileName, $this->getFormLocale());
         // Store the image dimensions.
         list($width, $height) = getimagesize($publicFileManager->getJournalFilesPath($journal->getId()) . '/' . $newFileName);
         $issue->setWidth($width, $this->getFormLocale());
         $issue->setHeight($height, $this->getFormLocale());
         $issueDao->updateIssue($issue);
     }
     if ($publicFileManager->uploadedFileExists('styleFile')) {
         $journal = Request::getJournal();
         $originalFileName = $publicFileManager->getUploadedFileName('styleFile');
         $newFileName = 'style_' . $issueId . '.css';
//.........这里部分代码省略.........
开发者ID:JovanyJeff,项目名称:hrp,代码行数:101,代码来源:IssueForm.inc.php

示例4: execute

 /**
  * Save issue settings.
  */
 function execute($issueId = 0)
 {
     $journal =& Request::getJournal();
     $issueDao =& DAORegistry::getDAO('IssueDAO');
     if ($issueId) {
         $issue = $issueDao->getIssueById($issueId);
         $isNewIssue = false;
     } else {
         $issue = new Issue();
         $isNewIssue = true;
     }
     $volume = $this->getData('volume');
     $number = $this->getData('number');
     $year = $this->getData('year');
     $showVolume = $this->getData('showVolume');
     $showNumber = $this->getData('showNumber');
     $showYear = $this->getData('showYear');
     $showTitle = $this->getData('showTitle');
     $issue->setJournalId($journal->getId());
     $issue->setTitle($this->getData('title'), null);
     // Localized
     $issue->setVolume(empty($volume) ? 0 : $volume);
     $issue->setNumber(empty($number) ? 0 : $number);
     $issue->setYear(empty($year) ? 0 : $year);
     if (!$isNewIssue) {
         $issue->setDatePublished($this->getData('datePublished'));
         // If the Editor has asked to reset article publication dates for content
         // in this issue, set them all to the specified issue publication date.
         if ($this->getData('resetArticlePublicationDates')) {
             $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
             $publishedArticles =& $publishedArticleDao->getPublishedArticles($issue->getId());
             foreach ($publishedArticles as $publishedArticle) {
                 $publishedArticle->setDatePublished($this->getData('datePublished'));
                 $publishedArticleDao->updatePublishedArticle($publishedArticle);
             }
         }
     }
     $issue->setDescription($this->getData('description'), null);
     // Localized
     $issue->setStoredPubId('publisher-id', $this->getData('publicIssueId'));
     $issue->setShowVolume(empty($showVolume) ? 0 : $showVolume);
     $issue->setShowNumber(empty($showNumber) ? 0 : $showNumber);
     $issue->setShowYear(empty($showYear) ? 0 : $showYear);
     $issue->setShowTitle(empty($showTitle) ? 0 : $showTitle);
     $issue->setCoverPageDescription($this->getData('coverPageDescription'), null);
     // Localized
     $issue->setCoverPageAltText($this->getData('coverPageAltText'), null);
     // Localized
     $showCoverPage = array_map(create_function('$arrayElement', 'return (int)$arrayElement;'), (array) $this->getData('showCoverPage'));
     foreach (array_keys($this->getData('coverPageDescription')) as $locale) {
         if (!array_key_exists($locale, $showCoverPage)) {
             $showCoverPage[$locale] = 0;
         }
     }
     $issue->setShowCoverPage($showCoverPage, null);
     // Localized
     $hideCoverPageArchives = array_map(create_function('$arrayElement', 'return (int)$arrayElement;'), (array) $this->getData('hideCoverPageArchives'));
     foreach (array_keys($this->getData('coverPageDescription')) as $locale) {
         if (!array_key_exists($locale, $hideCoverPageArchives)) {
             $hideCoverPageArchives[$locale] = 0;
         }
     }
     $issue->setHideCoverPageArchives($hideCoverPageArchives, null);
     // Localized
     $hideCoverPageCover = array_map(create_function('$arrayElement', 'return (int)$arrayElement;'), (array) $this->getData('hideCoverPageCover'));
     foreach (array_keys($this->getData('coverPageDescription')) as $locale) {
         if (!array_key_exists($locale, $hideCoverPageCover)) {
             $hideCoverPageCover[$locale] = 0;
         }
     }
     $issue->setHideCoverPageCover($hideCoverPageCover, null);
     // Localized
     $issue->setAccessStatus($this->getData('accessStatus') ? $this->getData('accessStatus') : ISSUE_ACCESS_OPEN);
     // See bug #6324
     if ($this->getData('enableOpenAccessDate')) {
         $issue->setOpenAccessDate($this->getData('openAccessDate'));
     } else {
         $issue->setOpenAccessDate(null);
     }
     // consider the additional field names from the public identifer plugins
     import('classes.plugins.PubIdPluginHelper');
     $pubIdPluginHelper = new PubIdPluginHelper();
     $pubIdPluginHelper->execute($this, $issue);
     // if issueId is supplied, then update issue otherwise insert a new one
     if ($issueId) {
         $issue->setId($issueId);
         $this->issue =& $issue;
         parent::execute();
         $issueDao->updateIssue($issue);
     } else {
         $issue->setPublished(0);
         $issue->setCurrent(0);
         $issueId = $issueDao->insertIssue($issue);
         $issue->setId($issueId);
     }
     import('classes.file.PublicFileManager');
     $publicFileManager = new PublicFileManager();
//.........这里部分代码省略.........
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:101,代码来源:IssueForm.inc.php


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