Exemplo n.º 1
0
 /**
  * Save changes to submission.
  * @param $args array
  * @param $request PKPRequest
  * @return int the submission ID
  */
 function execute($args, $request)
 {
     parent::execute($args, $request);
     // handle category assignment.
     ListbuilderHandler::unpack($request, $this->getData('categories'), array($this, 'deleteEntry'), array($this, 'insertEntry'), array($this, 'updateEntry'));
     return $this->submissionId;
 }
Exemplo n.º 2
0
 /**
  * Assign form data to user-submitted data.
  */
 function readInputData()
 {
     parent::readInputData();
     $this->readUserVars(array('categories', 'seriesId', 'seriesPosition'));
     $application = PKPApplication::getApplication();
     $request = $application->getRequest();
     ListbuilderHandler::unpack($request, $this->getData('categories'), array($this, 'deleteEntry'), array($this, 'insertEntry'), array($this, 'updateEntry'));
 }
 /**
  * Save changes to submission.
  * @param $args array
  * @param $request PKPRequest
  * @return int the submission ID
  */
 function execute($args, $request)
 {
     parent::execute($args, $request);
     // handle category assignment.
     ListbuilderHandler::unpack($request, $this->getData('categories'));
     $submissionDao = Application::getSubmissionDAO();
     $submission = $submissionDao->getById($this->submissionId);
     // Send author notification email
     import('classes.mail.MonographMailTemplate');
     $mail = new MonographMailTemplate($submission, 'SUBMISSION_ACK', null, null, null, false);
     $authorMail = new MonographMailTemplate($submission, 'SUBMISSION_ACK_NOT_USER', null, null, null, false);
     $context = $request->getContext();
     $router = $request->getRouter();
     if ($mail->isEnabled()) {
         // submission ack emails should be from the contact.
         $mail->setReplyTo($this->context->getSetting('contactEmail'), $this->context->getSetting('contactName'));
         $authorMail->setReplyTo($this->context->getSetting('contactEmail'), $this->context->getSetting('contactName'));
         $user = $request->getUser();
         $primaryAuthor = $submission->getPrimaryAuthor();
         if (!isset($primaryAuthor)) {
             $authors = $submission->getAuthors();
             $primaryAuthor = $authors[0];
         }
         $mail->addRecipient($user->getEmail(), $user->getFullName());
         if ($user->getEmail() != $primaryAuthor->getEmail()) {
             $authorMail->addRecipient($primaryAuthor->getEmail(), $primaryAuthor->getFullName());
         }
         if ($context->getSetting('copySubmissionAckPrimaryContact')) {
             $authorMail->addBcc($context->getSetting('contactEmail'), $context->getSetting('contactName'));
         }
         if ($copyAddress = $context->getSetting('copySubmissionAckAddress')) {
             $authorMail->addBcc($copyAddress);
         }
         $assignedAuthors = $submission->getAuthors();
         foreach ($assignedAuthors as $author) {
             $authorEmail = $author->getEmail();
             // only add the author email if they have not already been added as the primary author
             // or user creating the submission.
             if ($authorEmail != $primaryAuthor->getEmail() && $authorEmail != $user->getEmail()) {
                 $authorMail->addRecipient($author->getEmail(), $author->getFullName());
             }
         }
         $mail->bccAssignedSeriesEditors($submission->getId(), WORKFLOW_STAGE_ID_SUBMISSION);
         $mail->assignParams(array('authorName' => $user->getFullName(), 'authorUsername' => $user->getUsername(), 'editorialContactSignature' => $context->getSetting('contactName') . "\n" . $context->getLocalizedName(), 'submissionUrl' => $router->url($request, null, 'authorDashboard', 'submission', $submission->getId())));
         $authorMail->assignParams(array('submitterName' => $user->getFullName(), 'editorialContactSignature' => $context->getSetting('contactName') . "\n" . $context->getLocalizedName()));
         $mail->send($request);
         $recipients = $authorMail->getRecipients();
         if (!empty($recipients)) {
             $authorMail->send($request);
         }
     }
     // Log submission.
     import('lib.pkp.classes.log.SubmissionLog');
     import('classes.log.SubmissionEventLogEntry');
     // constants
     SubmissionLog::logEvent($request, $submission, SUBMISSION_LOG_SUBMISSION_SUBMIT, 'submission.event.submissionSubmitted');
     return $this->submissionId;
 }
 /**
  * Check the number of lisbuilder rows. If it's equal to 0, return false.
  *
  * @see FormValidator::isValid()
  * @return boolean
  */
 function isValid()
 {
     $value = $this->getFieldValue();
     import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
     ListbuilderHandler::unpack($request, $value);
     if ($this->_valid) {
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 5
0
 /**
  * @copydoc ContextSettingsForm::execute()
  * @param $request Request
  */
 function execute($request)
 {
     $journal = $request->getContext();
     if ($journal->getEnabled() !== $this->getData('journalEnabled')) {
         $journalDao = DAORegistry::getDAO('JournalDAO');
         $journal->setEnabled($this->getData('journalEnabled'));
         $journalDao->updateObject($journal);
     }
     // Save block plugins context positions.
     import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
     $this->categories = null;
     ListbuilderHandler::unpack($request, $request->getUserVar('categories'));
     $this->setData('categories', $this->categories);
     parent::execute($request);
 }
 /**
  * @copydoc Form::readInputData()
  */
 function readInputData($request)
 {
     $this->readUserVars(array('message', 'users', 'template'));
     import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
     $this->setData('userIds', array($request->getUserVar('userId')));
     $userData = $this->getData('users');
     ListbuilderHandler::unpack($request, $userData, array($this, 'deleteEntry'), array($this, 'insertEntry'), array($this, 'updateEntry'));
 }
Exemplo n.º 7
0
 /**
  * @copydoc Form::execute()
  */
 function execute($request)
 {
     ListbuilderHandler::unpack($request, $this->getData('roles'));
 }
Exemplo n.º 8
0
 /**
  * @copydoc Form::execute()
  */
 function execute($request)
 {
     ListbuilderHandler::unpack($request, $this->getData('roles'), array($this, 'deleteEntry'), array($this, 'insertEntry'), array($this, 'updateEntry'));
 }
Exemplo n.º 9
0
 /**
  * Save series.
  * @param $args array
  * @param $request PKPRequest
  */
 function execute($args, $request)
 {
     $seriesDao = DAORegistry::getDAO('SeriesDAO');
     $press = $request->getPress();
     // Get or create the series object
     if ($this->getSeriesId()) {
         $series = $seriesDao->getById($this->getSeriesId(), $press->getId());
     } else {
         $series = $seriesDao->newDataObject();
         $series->setPressId($press->getId());
     }
     // Populate/update the series object from the form
     $series->setPath($this->getData('path'));
     $series->setFeatured($this->getData('featured'));
     $series->setTitle($this->getData('title'), null);
     // Localized
     $series->setDescription($this->getData('description'), null);
     // Localized
     $series->setPrefix($this->getData('prefix'), null);
     // Localized
     $series->setSubtitle($this->getData('subtitle'), null);
     // Localized
     $series->setEditorRestricted($this->getData('restricted'));
     $series->setOnlineISSN($this->getData('onlineIssn'));
     $series->setPrintISSN($this->getData('printIssn'));
     $series->setSortOption($this->getData('sortOption'));
     // Insert or update the series in the DB
     if ($this->getSeriesId()) {
         $seriesDao->updateObject($series);
     } else {
         $this->setSeriesId($seriesDao->insertObject($series));
     }
     // Handle the image upload if there was one.
     if ($temporaryFileId = $this->getData('temporaryFileId')) {
         // Fetch the temporary file storing the uploaded library file
         $temporaryFileDao = DAORegistry::getDAO('TemporaryFileDAO');
         $temporaryFile = $temporaryFileDao->getTemporaryFile($temporaryFileId, $this->_userId);
         $temporaryFilePath = $temporaryFile->getFilePath();
         import('lib.pkp.classes.file.ContextFileManager');
         $pressFileManager = new ContextFileManager($press->getId());
         $basePath = $pressFileManager->getBasePath() . '/series/';
         // Delete the old file if it exists
         $oldSetting = $series->getImage();
         if ($oldSetting) {
             $pressFileManager->deleteFile($basePath . $oldSetting['thumbnailName']);
             $pressFileManager->deleteFile($basePath . $oldSetting['name']);
         }
         // The following variables were fetched in validation
         assert($this->_sizeArray && $this->_imageExtension);
         // Generate the surrogate image.
         switch ($this->_imageExtension) {
             case '.jpg':
                 $image = imagecreatefromjpeg($temporaryFilePath);
                 break;
             case '.png':
                 $image = imagecreatefrompng($temporaryFilePath);
                 break;
             case '.gif':
                 $image = imagecreatefromgif($temporaryFilePath);
                 break;
             default:
                 $image = null;
                 // Suppress warn
         }
         assert($image);
         $coverThumbnailsMaxWidth = $press->getSetting('coverThumbnailsMaxWidth');
         $coverThumbnailsMaxHeight = $press->getSetting('coverThumbnailsMaxHeight');
         $thumbnailFilename = $series->getId() . '-series-thumbnail' . $this->_imageExtension;
         $xRatio = min(1, $coverThumbnailsMaxWidth / $this->_sizeArray[0]);
         $yRatio = min(1, $coverThumbnailsMaxHeight / $this->_sizeArray[1]);
         $ratio = min($xRatio, $yRatio);
         $thumbnailWidth = round($ratio * $this->_sizeArray[0]);
         $thumbnailHeight = round($ratio * $this->_sizeArray[1]);
         $thumbnail = imagecreatetruecolor($thumbnailWidth, $thumbnailHeight);
         imagecopyresampled($thumbnail, $image, 0, 0, 0, 0, $thumbnailWidth, $thumbnailHeight, $this->_sizeArray[0], $this->_sizeArray[1]);
         // Copy the new file over
         $filename = $series->getId() . '-series' . $this->_imageExtension;
         $pressFileManager->copyFile($temporaryFile->getFilePath(), $basePath . $filename);
         switch ($this->_imageExtension) {
             case '.jpg':
                 imagejpeg($thumbnail, $basePath . $thumbnailFilename);
                 break;
             case '.png':
                 imagepng($thumbnail, $basePath . $thumbnailFilename);
                 break;
             case '.gif':
                 imagegif($thumbnail, $basePath . $thumbnailFilename);
                 break;
         }
         imagedestroy($thumbnail);
         imagedestroy($image);
         $series->setImage(array('name' => $filename, 'width' => $this->_sizeArray[0], 'height' => $this->_sizeArray[1], 'thumbnailName' => $thumbnailFilename, 'thumbnailWidth' => $thumbnailWidth, 'thumbnailHeight' => $thumbnailHeight, 'uploadName' => $temporaryFile->getOriginalFileName(), 'dateUploaded' => Core::getCurrentDate()));
         // Clean up the temporary file
         import('lib.pkp.classes.file.TemporaryFileManager');
         $temporaryFileManager = new TemporaryFileManager();
         $temporaryFileManager->deleteFile($temporaryFileId, $this->_userId);
     }
     // Update series object to store image information.
     $seriesDao->updateObject($series);
     import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
     // Save the series editor associations.
     ListbuilderHandler::unpack($request, $this->getData('subEditors'), array(&$this, 'deleteSubEditorEntry'), array(&$this, 'insertSubEditorEntry'), array(&$this, 'updateSubEditorEntry'));
     // Save the category associations.
     ListbuilderHandler::unpack($request, $this->getData('categories'), array(&$this, 'deleteCategoryEntry'), array(&$this, 'insertCategoryEntry'), array(&$this, 'updateCategoryEntry'));
     return true;
 }
 /**
  * Save review form element.
  * @param $request PKPRequest
  * @return int Review form element ID
  */
 function execute($request)
 {
     $reviewFormElementDao = DAORegistry::getDAO('ReviewFormElementDAO');
     if ($this->reviewFormElementId) {
         $context = $request->getContext();
         $reviewFormElement = $reviewFormElementDao->getById($this->reviewFormElementId);
         $reviewFormDao = DAORegistry::getDAO('ReviewFormDAO');
         $reviewForm = $reviewFormDao->getById($reviewFormElement->getReviewFormId(), Application::getContextAssocType(), $context->getId());
         if (!$reviewForm) {
             fatalError('Invalid review form element ID!');
         }
     } else {
         $reviewFormElement = $reviewFormElementDao->newDataObject();
         $reviewFormElement->setReviewFormId($this->reviewFormId);
         $reviewFormElement->setSequence(REALLY_BIG_NUMBER);
     }
     $reviewFormElement->setQuestion($this->getData('question'), null);
     // Localized
     $reviewFormElement->setRequired($this->getData('required') ? 1 : 0);
     $reviewFormElement->setIncluded($this->getData('included') ? 1 : 0);
     $reviewFormElement->setElementType($this->getData('elementType'));
     if (in_array($this->getData('elementType'), ReviewFormElement::getMultipleResponsesElementTypes())) {
         $this->setData('possibleResponsesProcessed', $reviewFormElement->getPossibleResponses(null));
         ListbuilderHandler::unpack($request, $this->getData('possibleResponses'), array($this, 'deleteEntry'), array($this, 'insertEntry'), array($this, 'updateEntry'));
         $reviewFormElement->setPossibleResponses($this->getData('possibleResponsesProcessed'), null);
     } else {
         $reviewFormElement->setPossibleResponses(null, null);
     }
     if ($reviewFormElement->getId()) {
         $reviewFormElementDao->deleteSetting($reviewFormElement->getId(), 'possibleResponses');
         $reviewFormElementDao->updateObject($reviewFormElement);
     } else {
         $this->reviewFormElementId = $reviewFormElementDao->insertObject($reviewFormElement);
         $reviewFormElementDao->resequenceReviewFormElements($this->reviewFormId);
     }
     return $this->reviewFormElementId;
 }
Exemplo n.º 11
0
 /**
  * Assign user to copyedit the selected files
  * @see Form::execute()
  */
 function execute($request)
 {
     // Decode the "files" list
     import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
     ListbuilderHandler::unpack($request, $this->getData('files'));
     // Send the message to the user
     $submission = $this->getSubmission();
     import('lib.pkp.classes.mail.SubmissionMailTemplate');
     $email = new SubmissionMailTemplate($submission, 'AUDITOR_REQUEST', null, null, null, false);
     $email->setBody($this->getData('personalMessage'));
     $userDao = DAORegistry::getDAO('UserDAO');
     /* @var $userDao UserDAO */
     // FIXME: How to validate user IDs?
     $user = $userDao->getById($this->getData('userId'));
     import('lib.pkp.controllers.grid.submissions.SubmissionsListGridCellProvider');
     list($page, $operation) = SubmissionsListGridCellProvider::getPageAndOperationByUserRoles($request, $submission, $user->getId());
     $dispatcher = $request->getDispatcher();
     $auditUrl = $dispatcher->url($request, ROUTE_PAGE, null, $page, $operation, array('submissionId' => $submission->getId()));
     // Other parameters assigned above; see bug #7090.
     $email->assignParams(array('auditorName' => $user->getFullName(), 'auditorUserName' => $user->getUsername(), 'auditUrl' => $auditUrl));
     $email->addRecipient($user->getEmail(), $user->getFullName());
     $email->setEventType($this->getEventType());
     if (!$this->getData('skipEmail')) {
         $email->send($request);
     }
 }
 /**
  * @copydoc Form::readInputData()
  */
 function readInputData($request)
 {
     $this->readUserVars(array('message', 'users', 'template'));
     import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
     $userData = $this->getData('users');
     ListbuilderHandler::unpack($request, $userData);
 }
Exemplo n.º 13
0
 /**
  * @copydoc Form::execute()
  */
 function execute($request)
 {
     $footerCategoryDao = DAORegistry::getDAO('FooterCategoryDAO');
     $footerCategory = $this->getFooterCategory();
     if (!$footerCategory) {
         // this is a new footerCategory
         $footerCategory = $footerCategoryDao->newDataObject();
         $footerCategory->setContextId($this->getContextId());
         $existingFooterCategory = false;
     } else {
         $existingFooterCategory = true;
     }
     $footerCategory->setTitle($this->getData('title'), null);
     // localized
     $footerCategory->setDescription($this->getData('description'), null);
     // localized
     $footerCategory->setPath($this->getData('path'));
     if ($existingFooterCategory) {
         $footerCategoryDao->updateObject($footerCategory);
         $footerCategoryId = $footerCategory->getId();
     } else {
         $footerCategoryId = $footerCategoryDao->insertObject($footerCategory);
         $this->setFooterCategory($footerCategory);
         // so insertEntry() has it for new FooterLinks
     }
     // for the footer links in the listbuilder.
     ListbuilderHandler::unpack($request, $this->getData('footerLinks'));
     return $footerCategoryId;
 }
Exemplo n.º 14
0
 /**
  * @copydoc Form::execute()
  */
 function execute($request)
 {
     $site = $request->getSite();
     $site->updateSetting('categoriesEnabled', (int) $this->getData('categoriesEnabled'));
     ListbuilderHandler::unpack($request, $this->getData('categories'));
 }
Exemplo n.º 15
0
 /**
  * @copydoc ContextSettingsForm::execute()
  */
 function execute($request)
 {
     parent::execute($request);
     // Save block plugins context positions.
     import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
     ListbuilderHandler::unpack($request, $request->getUserVar('blocks'));
     // Activate the selected theme plugin
     $context = $request->getContext();
     $themePlugins = PluginRegistry::loadCategory('themes');
     $selectedThemePluginPath = $this->getData('themePluginPath');
     $selectedThemePlugin = null;
     foreach ($themePlugins as $themePlugin) {
         if (basename($themePlugin->getPluginPath()) != $selectedThemePluginPath) {
             if ($themePlugin->getEnabled()) {
                 $themePlugin->setEnabled(false);
             }
         } else {
             $selectedThemePlugin = $themePlugin;
         }
     }
     if ($selectedThemePlugin) {
         // Activate the selected theme to trigger a CSS recompile.
         $selectedThemePlugin->setEnabled(true);
     } else {
         assert(false);
         // Couldn't identify the selected theme plugin
     }
 }
Exemplo n.º 16
0
 /**
  * @copydoc Form::execute()
  * @param $request PKPRequest
  */
 function execute($request)
 {
     $queryDao = DAORegistry::getDAO('QueryDAO');
     $query = $this->getQuery();
     $headNote = $query->getHeadNote();
     $headNote->setTitle($this->getData('subject'));
     $headNote->setContents($this->getData('comment'));
     $noteDao = DAORegistry::getDAO('NoteDAO');
     $noteDao->updateObject($headNote);
     import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
     ListbuilderHandler::unpack($request, $this->getData('users'));
     $queryDao->updateObject($query);
 }
Exemplo n.º 17
0
 /**
  * @copydoc ContextSettingsForm::execute()
  */
 function execute($request)
 {
     // Clear the template cache if theme has changed
     $context = $request->getContext();
     if ($this->getData('themePluginPath') != $context->getSetting('themePluginPath')) {
         $templateMgr = TemplateManager::getManager($request);
         $templateMgr->clearTemplateCache();
         $templateMgr->clearCssCache();
     }
     parent::execute($request);
     // Save block plugins context positions.
     import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
     ListbuilderHandler::unpack($request, $request->getUserVar('blocks'), array($this, 'deleteEntry'), array($this, 'insertEntry'), array($this, 'updateEntry'));
 }
 /**
  * Save site settings.
  */
 function execute($request)
 {
     parent::execute($request);
     $siteDao = DAORegistry::getDAO('SiteDAO');
     $site = $siteDao->getSite();
     $site->setRedirect($this->getData('redirect'));
     $site->setMinPasswordLength($this->getData('minPasswordLength'));
     $siteSettingsDao = $this->siteSettingsDao;
     foreach ($this->getLocaleFieldNames() as $setting) {
         $siteSettingsDao->updateSetting($setting, $this->getData($setting), null, true);
     }
     $siteSettingsDao->updateSetting('defaultMetricType', $this->getData('defaultMetricType'));
     // Activate the selected theme plugin
     $selectedThemePluginPath = $this->getData('themePluginPath');
     $site->updateSetting('themePluginPath', $selectedThemePluginPath);
     $siteDao->updateObject($site);
     // Save block plugins context positions.
     import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
     ListbuilderHandler::unpack($request, $request->getUserVar('blocks'), array($this, 'deleteEntry'), array($this, 'insertEntry'), array($this, 'updateEntry'));
     return true;
 }
Exemplo n.º 19
0
 /**
  * Save chapter
  * @param $request
  * @see Form::execute()
  */
 function execute($request)
 {
     $chapterDao = DAORegistry::getDAO('ChapterDAO');
     $chapter = $this->getChapter();
     if ($chapter) {
         $chapter->setTitle($this->getData('title'), null);
         //Localized
         $chapter->setSubtitle($this->getData('subtitle'), null);
         //Localized
         $chapterDao->updateObject($chapter);
     } else {
         $monograph = $this->getMonograph();
         $chapter = $chapterDao->newDataObject();
         $chapter->setMonographId($monograph->getId());
         $chapter->setTitle($this->getData('title'), null);
         //Localized
         $chapter->setSubtitle($this->getData('subtitle'), null);
         //Localized
         $chapterDao->insertChapter($chapter);
     }
     $this->setChapter($chapter);
     // Save the author associations. (See insert/deleteEntry.)
     import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
     ListbuilderHandler::unpack($request, $this->getData('authors'), array($this, 'deleteAuthorsEntry'), array($this, 'insertAuthorsEntry'), array($this, 'updateAuthorsEntry'));
     ListbuilderHandler::unpack($request, $this->getData('files'), array($this, 'deleteFilesEntry'), array($this, 'insertFilesEntry'), array($this, 'updateFilesEntry'));
     return true;
 }
Exemplo n.º 20
0
 /**
  * Save section.
  * @param $args array
  * @param $request PKPRequest
  */
 function execute($args, $request)
 {
     $sectionDao = DAORegistry::getDAO('SectionDAO');
     $journal = $request->getJournal();
     // Get or create the section object
     if ($this->getSectionId()) {
         $section = $sectionDao->getById($this->getSectionId(), $journal->getId());
     } else {
         import('classes.journal.Section');
         $section = $sectionDao->newDataObject();
         $section->setJournalId($journal->getId());
     }
     // Populate/update the section object from the form
     $section->setTitle($this->getData('title'), null);
     // Localized
     $section->setAbbrev($this->getData('abbrev'), null);
     // Localized
     $reviewFormId = $this->getData('reviewFormId');
     if ($reviewFormId === '') {
         $reviewFormId = null;
     }
     $section->setReviewFormId($reviewFormId);
     $section->setMetaIndexed($this->getData('metaIndexed') ? 0 : 1);
     // #2066: Inverted
     $section->setMetaReviewed($this->getData('metaReviewed') ? 0 : 1);
     // #2066: Inverted
     $section->setAbstractsNotRequired($this->getData('abstractsNotRequired') ? 1 : 0);
     $section->setIdentifyType($this->getData('identifyType'), null);
     // Localized
     $section->setEditorRestricted($this->getData('editorRestriction') ? 1 : 0);
     $section->setHideTitle($this->getData('hideTitle') ? 1 : 0);
     $section->setHideAuthor($this->getData('hideAuthor') ? 1 : 0);
     $section->setHideAbout($this->getData('hideAbout') ? 1 : 0);
     $section->setPolicy($this->getData('policy'), null);
     // Localized
     $section->setAbstractWordCount($this->getData('wordCount'));
     $section = parent::execute($section);
     // Insert or update the section in the DB
     if ($this->getSectionId()) {
         $sectionDao->updateObject($section);
     } else {
         $section->setSequence(REALLY_BIG_NUMBER);
         $this->setSectionId($sectionDao->insertObject($section));
         $sectionDao->resequenceSections($journal->getId());
     }
     import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
     // Save the section editor associations.
     ListbuilderHandler::unpack($request, $this->getData('subEditors'), array(&$this, 'deleteSubEditorEntry'), array(&$this, 'insertSubEditorEntry'), array(&$this, 'updateSubEditorEntry'));
     return true;
 }
Exemplo n.º 21
0
 /**
  * @copydoc Form::execute()
  * @param $request PKPRequest
  */
 function execute($request)
 {
     $queryDao = DAORegistry::getDAO('QueryDAO');
     $query = $this->getQuery();
     $headNote = $query->getHeadNote();
     $headNote->setTitle($this->getData('subject'));
     $headNote->setContents($this->getData('comment'));
     $noteDao = DAORegistry::getDAO('NoteDAO');
     $noteDao->updateObject($headNote);
     import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
     ListbuilderHandler::unpack($request, $this->getData('users'));
     $queryDao->updateObject($query);
     // Notify the users of a new query.
     $notificationManager = new NotificationManager();
     $user = $request->getUser();
     foreach ($queryDao->getParticipantIds($query->getId()) as $userId) {
         // Skip sending a message to the current user.
         if ($user->getId() == $userId) {
             continue;
         }
         $notificationManager->createNotification($request, $userId, NOTIFICATION_TYPE_NEW_QUERY, $request->getContext()->getId(), ASSOC_TYPE_QUERY, $query->getId(), NOTIFICATION_LEVEL_TASK);
     }
 }