17 import(
'lib.pkp.classes.install.Installer');
56 $site = $siteDao->getSite();
57 $adminEmail = $site->getLocalizedContactEmail();
59 import(
'lib.pkp.classes.file.SubmissionFileManager');
61 $contexts = $pressDao->getAll();
62 while ($context = $contexts->next()) {
63 $submissions = $submissionDao->getByContextId($context->getId());
64 while ($submission = $submissions->next()) {
66 $submissionFiles = $submissionFileDao->getBySubmissionId($submission->getId());
67 foreach ($submissionFiles as $submissionFile) {
68 $generatedFilename = $submissionFile->getServerFileName();
69 $basePath = $submissionFileManager->getBasePath() . $submissionFile->_fileStageToPath($submissionFile->getFileStage()) .
'/';
70 $globPattern = $submissionFile->getSubmissionId() .
'-' .
72 $submissionFile->getFileId() .
'-' .
73 $submissionFile->getRevision() .
'-' .
74 $submissionFile->getFileStage() .
'-' .
75 date(
'Ymd', strtotime($submissionFile->getDateUploaded())) .
78 $matchedResults = glob($basePath . $globPattern);
79 if (count($matchedResults)>1) {
80 error_log(
"Duplicate potential files for \"$globPattern\"!", 1, $adminEmail);
83 if (count($matchedResults) == 1) {
85 $discoveredFilename = array_shift($matchedResults);
87 echo
"Need to rename \"$discoveredFilename\" to \"$generatedFilename\".\n";
89 rename($discoveredFilename, $basePath . $generatedFilename);
93 error_log(
"Unable to find a match for \"$globPattern\".\n", 1, $adminEmail);
108 $contexts = $pressDao->getAll();
112 $pluginSettingsDao->updateSetting(0,
'defaultthemeplugin',
'enabled',
'1',
'int');
115 while ($context = $contexts->next()) {
116 $pluginSettingsDao->updateSetting($context->getId(),
'defaultthemeplugin',
'enabled',
'1',
'int');
128 $tablesToUpdate = array(
130 'data_object_tombstone_oai_set_objects',
135 'email_templates_data',
139 'metadata_descriptions',
143 foreach ($tablesToUpdate as $tableName) {
144 $dao->update(
'UPDATE ' . $tableName .
' SET assoc_type = ' . ASSOC_TYPE_SERIES .
' WHERE assoc_type = 526');
158 $result = $authorDao->retrieve(
159 'SELECT DISTINCT author_id
161 WHERE (setting_name = ? OR setting_name = ?)
162 AND setting_type = ?',
163 array(
'affiliation',
'biography',
'object')
166 while (!$result->EOF) {
167 $row = $result->getRowAssoc(
false);
168 $authorId = $row[
'author_id'];
171 $author = $authorDao->getById($authorId);
172 if (!$author)
continue;
174 foreach ((array) $author->getAffiliation(
null) as
$locale => $affiliation) {
175 if (is_array($affiliation))
foreach($affiliation as
$locale => $s) {
176 $author->setAffiliation($s,
$locale);
180 foreach ((array) $author->getBiography(
null) as
$locale => $biography) {
181 if (is_array($biography))
foreach($biography as
$locale => $s) {
182 $author->setBiography($s,
$locale);
185 $authorDao->updateObject($author);
200 $result = $emailTemplateDao->retrieve(
'SELECT * FROM email_templates_data');
201 while (!$result->EOF) {
202 $row = $result->getRowAssoc(
false);
203 $emailTemplateDao->update(
204 'UPDATE email_templates_data
206 WHERE email_key = ? AND
211 preg_replace(
'/{\$[a-zA-Z]+Url}/',
'<a href="\0">\0</a>', nl2br($row[
'body'])),
223 $result = $emailTemplateDao->retrieve(
'SELECT * FROM email_templates_default_data');
224 while (!$result->EOF) {
225 $row = $result->getRowAssoc(
false);
226 $emailTemplateDao->update(
227 'UPDATE email_templates_default_data
229 WHERE email_key = ? AND
232 preg_replace(
'/{\$[a-zA-Z]+Url}/',
'<a href="\0">\0</a>', nl2br($row[
'body'])),
244 $contexts = $contextDao->getAll();
245 while ($context = $contexts->next()) {
246 foreach (array(
'emailFooter',
'emailSignature') as $settingName) {
247 $settingsDao->updateSetting(
250 $context->getData(
'emailHeader'),
265 import(
'lib.pkp.classes.submission.SubmissionFile');
267 $filesResult = $submissionFileDao->retrieve(
268 'SELECT DISTINCT sf.file_id, sf.assoc_type, sf.assoc_id, s.symbolic, s.date_notified, s.date_completed, s.user_id, s.signoff_id FROM submission_files sf, signoffs s WHERE s.assoc_type=? AND s.assoc_id=sf.file_id AND s.symbolic IN (?, ?)',
269 array(ASSOC_TYPE_SUBMISSION_FILE,
'SIGNOFF_COPYEDITING',
'SIGNOFF_PROOFING')
283 while (!$filesResult->EOF) {
284 $row = $filesResult->getRowAssoc(
false);
285 $fileId = $row[
'file_id'];
286 $symbolic = $row[
'symbolic'];
287 $dateNotified = $row[
'date_notified']?strtotime($row[
'date_notified']):
null;
288 $dateCompleted = $row[
'date_completed']?strtotime($row[
'date_completed']):
null;
289 $userId = $row[
'user_id'];
290 $signoffId = $row[
'signoff_id'];
291 $fileAssocType = $row[
'assoc_type'];
292 $fileAssocId = $row[
'assoc_id'];
293 $filesResult->MoveNext();
295 $submissionFiles = $submissionFileDao->getAllRevisions($fileId);
296 assert(count($submissionFiles)>0);
297 $anyFile = end($submissionFiles);
299 $assocType = $assocId = $query =
null;
301 case 'SIGNOFF_COPYEDITING':
302 $query = $queryDao->newDataObject();
303 $query->setAssocType($assocType = ASSOC_TYPE_SUBMISSION);
304 $query->setAssocId($assocId = $anyFile->getSubmissionId());
305 $query->setStageId(WORKFLOW_STAGE_ID_EDITING);
307 case 'SIGNOFF_PROOFING':
309 if ($anyFile->getAssocType() == ASSOC_TYPE_NOTE) {
310 $note = $noteDao->getById($anyFile->getAssocId());
311 assert($note && $note->getAssocType() == ASSOC_TYPE_QUERY);
312 if (count($queryDao->getParticipantIds($note->getAssocId(), $userId))==0) $queryDao->insertParticipant($anyFile->getAssocId(), $userId);
313 $this->_transferSignoffData($signoffId, $note->getAssocId());
316 $query = $queryDao->newDataObject();
317 assert($anyFile->getAssocType()==ASSOC_TYPE_REPRESENTATION);
318 $query->setAssocType($assocType = ASSOC_TYPE_SUBMISSION);
319 $query->setAssocId($assocId = $anyFile->getSubmissionId());
320 $query->setStageId(WORKFLOW_STAGE_ID_PRODUCTION);
322 default: assert(
false);
324 $query->setSequence(REALLY_BIG_NUMBER);
325 $query->setIsClosed($dateCompleted?
true:
false);
326 $queryDao->insertObject($query);
327 $queryDao->resequence($assocType, $assocId);
330 $user = $userDao->getById($userId);
331 $assignedUserIds = array($userId);
332 foreach (array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR, ROLE_ID_ASSISTANT) as $roleId) {
333 $stageAssignments = $stageAssignmentDao->getBySubmissionAndRoleId($anyFile->getSubmissionId(), $roleId, $query->getStageId());
334 while ($stageAssignment = $stageAssignments->next()) {
335 $assignedUserIds[] = $stageAssignment->getUserId();
339 foreach (array_unique($assignedUserIds) as $assignedUserId) {
340 $queryDao->insertParticipant($query->getId(), $assignedUserId);
344 $headNote = $noteDao->newDataObject();
345 $headNote->setAssocType(ASSOC_TYPE_QUERY);
346 $headNote->setAssocId($query->getId());
348 case 'SIGNOFF_COPYEDITING':
349 $headNote->setTitle(
'Copyediting for "' . $anyFile->getFileLabel() .
'"');
350 $headNote->setContents(
'Auditing assignment for the file "' . htmlspecialchars($anyFile->getFileLabel()) .
'" (Signoff ID: ' . $signoffId .
')');
352 case 'SIGNOFF_PROOFING':
353 $headNote->setTitle(
'Proofreading for ' . $anyFile->getFileLabel());
354 $headNote->setContents(
'Proofing assignment for the file "' . htmlspecialchars($anyFile->getFileLabel()) .
'" (Signoff ID: ' . $signoffId .
')');
356 default: assert(
false);
358 $noteDao->insertObject($headNote);
361 $headNote->setDateCreated($dateNotified);
362 $noteDao->updateObject($headNote);
365 if ($dateCompleted) {
366 $completionNote = $noteDao->newDataObject();
367 $completionNote->setAssocType(ASSOC_TYPE_QUERY);
368 $completionNote->setAssocId($query->getId());
369 $completionNote->setContents(
'The assignment is complete.');
370 $completionNote->setUserId($userId);
371 $noteDao->insertObject($completionNote);
372 $completionNote->setDateCreated($dateCompleted);
373 $noteDao->updateObject($completionNote);
376 $this->_transferSignoffData($signoffId, $query->getId());
378 $filesResult->Close();
393 $allQueriesResult = $queryDao->retrieve(
394 'SELECT DISTINCT q.*,
395 COALESCE(pf.submission_id, qs.assoc_id) AS submission_id
397 LEFT JOIN publication_formats pf ON (q.assoc_type = ? AND q.assoc_id = pf.publication_format_id AND q.stage_id = ?)
398 LEFT JOIN queries qs ON (qs.assoc_type = ?)
399 WHERE q.assoc_type = ? OR q.assoc_type = ?
401 array((
int) ASSOC_TYPE_REPRESENTATION, (
int) WORKFLOW_STAGE_ID_PRODUCTION, (
int) ASSOC_TYPE_SUBMISSION, (
int) ASSOC_TYPE_SUBMISSION, (
int) ASSOC_TYPE_REPRESENTATION)
403 $allQueries = array();
404 while (!$allQueriesResult->EOF) {
405 $row = $allQueriesResult->getRowAssoc(
false);
406 $allQueries[$row[
'submission_id']][
'queries'][] = $query = $queryDao->_fromRow($row);
408 $fix = array_key_exists(
'fix', $allQueries[$row[
'submission_id']]) ? $allQueries[$row[
'submission_id']][
'fix'] :
false;
409 $allQueries[$row[
'submission_id']][
'fix'] = ($query->getAssocType() == ASSOC_TYPE_REPRESENTATION) || $fix;
410 $allQueriesResult->MoveNext();
412 $allQueriesResult->Close();
413 foreach ($allQueries as $submissionId => $queriesBySubmission) {
415 if ($allQueries[$submissionId][
'fix']) {
417 foreach($queriesBySubmission[
'queries'] as $query) {
418 if ($query->getAssocType() == ASSOC_TYPE_REPRESENTATION) {
419 $query->setAssocType(ASSOC_TYPE_SUBMISSION);
420 $query->setAssocId($submissionId);
422 $query->setSequence($i);
423 $queryDao->updateObject($query);
442 import(
'lib.pkp.classes.security.Role');
444 $commentsResult = $submissionDao->retrieve(
445 'SELECT s.submission_id, s.context_id, s.comments_to_ed, s.date_submitted
446 FROM submissions_tmp s
447 WHERE s.comments_to_ed IS NOT NULL AND s.comments_to_ed != \'\''
449 while (!$commentsResult->EOF) {
450 $row = $commentsResult->getRowAssoc(
false);
452 if ($comments_to_ed !=
""){
454 $authorAssignmentsResult = $stageAssignmetDao->getBySubmissionAndRoleId($row[
'submission_id'], ROLE_ID_AUTHOR);
455 if ($authorAssignmentsResult->getCount() != 0) {
457 $userId = $authorAssignmentsResult->next()->getUserId();
459 $managerUserGroup = $userGroupDao->getDefaultByRoleId($row[
'context_id'], ROLE_ID_MANAGER);
460 $managerUsers = $userGroupDao->getUsersById($managerUserGroup->getId(), $row[
'context_id']);
461 $userId = $managerUsers->next()->getId();
465 $query = $queryDao->newDataObject();
466 $query->setAssocType(ASSOC_TYPE_SUBMISSION);
467 $query->setAssocId($row[
'submission_id']);
468 $query->setStageId(WORKFLOW_STAGE_ID_SUBMISSION);
469 $query->setSequence(REALLY_BIG_NUMBER);
471 $queryDao->insertObject($query);
472 $queryDao->resequence(ASSOC_TYPE_SUBMISSION, $row[
'submission_id']);
473 $queryDao->insertParticipant($query->getId(), $userId);
475 $queryId = $query->getId();
477 $note = $noteDao->newDataObject();
478 $note->setUserId($userId);
479 $note->setAssocType(ASSOC_TYPE_QUERY);
480 $note->setTitle(
'Cover Note to Editor');
481 $note->setContents($comments_to_ed);
482 $note->setDateCreated(strtotime($row[
'date_submitted']));
483 $note->setDateModified(strtotime($row[
'date_submitted']));
484 $note->setAssocId($queryId);
485 $noteDao->insertObject($note);
487 $commentsResult->MoveNext();
489 $commentsResult->Close();
492 $submissionDao->update(
'DROP TABLE submissions_tmp');
502 private function _transferSignoffData($signoffId, $queryId) {
507 $notes = $noteDao->getByAssoc(1048582 , $signoffId);
508 while ($note =
$notes->next()) {
509 $note->setAssocType(ASSOC_TYPE_QUERY);
510 $note->setAssocId($queryId);
511 $noteDao->updateObject($note);
514 $submissionFiles = $submissionFileDao->getAllRevisionsByAssocId(ASSOC_TYPE_NOTE, $note->getId());
515 foreach ($submissionFiles as $submissionFile) {
516 $submissionFile->setAssocType(ASSOC_TYPE_NOTE);
517 $submissionFile->setAssocId($note->getId());
518 $submissionFile->setFileStage(SUBMISSION_FILE_QUERY);
519 $submissionFileDao->updateObject($submissionFile);
524 $signoffsResult = $submissionFileDao->retrieve(
525 'SELECT * FROM signoffs WHERE symbolic = ? AND assoc_type = ? AND assoc_id = ?',
526 array(
'SIGNOFF_SIGNOFF', 1048582 , $signoffId)
528 while (!$signoffsResult->EOF) {
529 $row = $signoffsResult->getRowAssoc(
false);
530 $metaSignoffId = $row[
'signoff_id'];
531 $userId = $row[
'user_id'];
532 $dateCompleted = $row[
'date_completed']?strtotime($row[
'date_completed']):null;
533 $signoffsResult->MoveNext();
535 if ($dateCompleted) {
536 $user = $userDao->getById($userId);
537 $note = $noteDao->newDataObject();
538 $note->setAssocType(ASSOC_TYPE_QUERY);
539 $note->setAssocId($queryId);
540 $note->setUserId($userId);
541 $note->setContents(
'The completed task has been reviewed by ' . htmlspecialchars($user->getFullName()) .
' (' . $user->getEmail() .
').');
542 $noteDao->insertObject($note);
544 $noteDao->updateObject($note);
546 $submissionFileDao->update(
'DELETE FROM signoffs WHERE signoff_id=?', array($metaSignoffId));
548 $signoffsResult->Close();
550 $submissionFileDao->update(
'DELETE FROM signoffs WHERE signoff_id=?', array($signoffId));
562 import(
'plugins.generic.staticPages.classes.StaticPagesDAO');
566 $contexts = $contextDao->getAll();
567 while ($context = $contexts->next()) {
568 $contextStaticPages = $staticPagesDao->getByContextId($context->getId())->toAssociativeArray();
569 foreach($contextStaticPages as $staticPage) {
570 $retNMIId = $navigationMenuItemDao->portStaticPage($staticPage);
572 $staticPagesDao->deleteById($staticPage->getId());
574 error_log(
'WARNING: The StaticPage "' . $staticPage->getLocalizedTitle() .
'" uses a path (' . $staticPage->getPath() .
') that conflicts with an existing Custom Navigation Menu Item path. Skipping this StaticPage.');
589 import(
'lib.pkp.classes.identity.Identity');
591 $userDao->update(
"INSERT INTO user_settings (user_id, locale, setting_name, setting_value, setting_type) SELECT DISTINCT u.user_id, s.primary_locale, ?, u.first_name, 'string' FROM users_tmp u, site s", array(IDENTITY_SETTING_GIVENNAME));
592 $userDao->update(
"INSERT INTO user_settings (user_id, locale, setting_name, setting_value, setting_type) SELECT DISTINCT u.user_id, s.primary_locale, ?, u.last_name, 'string' FROM users_tmp u, site s", array(IDENTITY_SETTING_FAMILYNAME));
594 $userDao->update(
"INSERT INTO author_settings (author_id, locale, setting_name, setting_value, setting_type) SELECT DISTINCT a.author_id, s.locale, ?, a.first_name, 'string' FROM authors_tmp a, submissions s WHERE s.submission_id = a.submission_id", array(IDENTITY_SETTING_GIVENNAME));
595 $userDao->update(
"INSERT INTO author_settings (author_id, locale, setting_name, setting_value, setting_type) SELECT DISTINCT a.author_id, s.locale, ?, a.last_name, 'string' FROM authors_tmp a, submissions s WHERE s.submission_id = a.submission_id", array(IDENTITY_SETTING_FAMILYNAME));
599 $driver = $userDao->getDriver();
604 $userDao->update(
"UPDATE user_settings, users_tmp u SET user_settings.setting_value = CONCAT(user_settings.setting_value, ' ', u.middle_name) WHERE user_settings.setting_name = ? AND u.user_id = user_settings.user_id AND u.middle_name IS NOT NULL AND u.middle_name <> ''", array(IDENTITY_SETTING_GIVENNAME));
605 $userDao->update(
"UPDATE author_settings, authors_tmp a SET author_settings.setting_value = CONCAT(author_settings.setting_value, ' ', a.middle_name) WHERE author_settings.setting_name = ? AND a.author_id = author_settings.author_id AND a.middle_name IS NOT NULL AND a.middle_name <> ''", array(IDENTITY_SETTING_GIVENNAME));
612 $userDao->update(
"UPDATE user_settings SET setting_value = CONCAT(setting_value, ' ', u.middle_name) FROM users_tmp u WHERE user_settings.setting_name = ? AND u.user_id = user_settings.user_id AND u.middle_name IS NOT NULL AND u.middle_name <> ''", array(IDENTITY_SETTING_GIVENNAME));
613 $userDao->update(
"UPDATE author_settings SET setting_value = CONCAT(setting_value, ' ', a.middle_name) FROM authors_tmp a WHERE author_settings.setting_name = ? AND a.author_id = author_settings.author_id AND a.middle_name IS NOT NULL AND a.middle_name <> ''", array(IDENTITY_SETTING_GIVENNAME));
615 default:
fatalError(
'Unknown database type!');
621 $site = $siteDao->getSite();
622 $supportedLocales = $site->getSupportedLocales();
623 $userResult = $userDao->retrieve(
"
624 SELECT user_id, first_name, last_name, middle_name, salutation, suffix FROM users_tmp
625 WHERE (salutation IS NOT NULL AND salutation <> '') OR
626 (suffix IS NOT NULL AND suffix <> '')
628 while (!$userResult->EOF) {
629 $row = $userResult->GetRowAssoc(
false);
630 $userId = $row[
'user_id'];
631 $firstName = $row[
'first_name'];
632 $lastName = $row[
'last_name'];
633 $middleName = $row[
'middle_name'];
634 $salutation = $row[
'salutation'];
635 $suffix = $row[
'suffix'];
636 foreach ($supportedLocales as $siteLocale) {
637 $preferredPublicName = ($salutation !=
'' ?
"$salutation " :
'') .
"$firstName " . ($middleName !=
'' ?
"$middleName " :
'') . $lastName . ($suffix !=
'' ?
", $suffix" :
'');
639 $preferredPublicName =
"$lastName, " . ($salutation !=
'' ?
"$salutation " :
'') . $firstName . ($middleName !=
'' ?
" $middleName" :
'');
641 $params = array((
int) $userId, $siteLocale, $preferredPublicName);
642 $userDao->update(
"INSERT INTO user_settings (user_id, locale, setting_name, setting_value, setting_type) VALUES (?, ?, 'preferredPublicName', ?, 'string')",
$params);
644 $userResult->MoveNext();
646 $userResult->Close();
652 $presses = $pressDao->getAll();
653 $pressessSupportedLocales = array();
654 while ($press = $presses->next()) {
655 $pressessSupportedLocales[$press->getId()] = $press->getSupportedLocales();
658 $authorResult = $userDao->retrieve(
"
659 SELECT a.author_id, a.first_name, a.last_name, a.middle_name, a.suffix, p.press_id FROM authors_tmp a
660 LEFT JOIN submissions s ON (s.submission_id = a.submission_id)
661 LEFT JOIN presses p ON (p.press_id = s.context_id)
662 WHERE suffix IS NOT NULL AND suffix <> ''
664 while (!$authorResult->EOF) {
665 $row = $authorResult->GetRowAssoc(
false);
666 $authorId = $row[
'author_id'];
667 $firstName = $row[
'first_name'];
668 $lastName = $row[
'last_name'];
669 $middleName = $row[
'middle_name'];
670 $suffix = $row[
'suffix'];
671 $pressId = $row[
'press_id'];
672 $supportedLocales = $pressessSupportedLocales[$pressId];
673 foreach ($supportedLocales as
$locale) {
674 $preferredPublicName =
"$firstName " . ($middleName !=
'' ?
"$middleName " :
'') . $lastName . ($suffix !=
'' ?
", $suffix" :
'');
676 $preferredPublicName =
"$lastName, " . $firstName . ($middleName !=
'' ?
" $middleName" :
'');
679 $userDao->update(
"INSERT INTO author_settings (author_id, locale, setting_name, setting_value, setting_type) VALUES (?, ?, 'preferredPublicName', ?, 'string')",
$params);
681 $authorResult->MoveNext();
683 $authorResult->Close();
686 $siteDao->update(
'DROP TABLE users_tmp');
687 $siteDao->update(
'DROP TABLE authors_tmp');
701 $roleString =
'(' . implode(
",", $roles) .
')';
703 $userGroupDao->update(
'UPDATE user_groups SET permit_metadata_edit = 1 WHERE role_id IN ' . $roleString);
704 switch ($userGroupDao->getDriver()) {
707 $stageAssignmentDao->update(
'UPDATE stage_assignments sa JOIN user_groups ug on sa.user_group_id = ug.user_group_id SET sa.can_change_metadata = 1 WHERE ug.role_id IN ' . $roleString);
714 $stageAssignmentDao->update(
'UPDATE stage_assignments SET can_change_metadata=1 FROM stage_assignments sa JOIN user_groups ug ON (sa.user_group_id = ug.user_group_id) WHERE ug.role_id IN ' . $roleString);
716 default:
fatalError(
"Unknown database type!");
733 import(
'lib.pkp.classes.file.BaseSubmissionFileManager');
734 import(
'lib.pkp.classes.file.FileManager');
735 import(
'classes.file.PublicFileManager');
737 $fileManager = new \FileManager();
738 $publicFileManager = new \PublicFileManager();
742 $result = $submissionDao->retrieve(
743 'SELECT ps.submission_id as submission_id,
744 ps.cover_image as cover_image,
745 s.context_id as context_id
746 FROM published_submissions ps
747 LEFT JOIN submissions s ON (s.submission_id = ps.submission_id)'
749 while (!$result->EOF) {
750 $row = $result->getRowAssoc(
false);
751 if (empty($row[
'cover_image'])) {
755 $coverImage = unserialize($row[
'cover_image']);
756 if (empty($coverImage)) {
760 $context = $contexts[$row[
'context_id']];
761 if (empty($context)) {
762 $context =
Services::get(
'context')->get($row[
'context_id']);
767 $coverPath = $baseSubmissionFileManager->getBasePath() .
'simple/' . $coverImage[
'name'];
768 $coverPathInfo = pathinfo($coverPath);
769 $thumbPath = $baseSubmissionFileManager->getBasePath() .
'simple/' . $coverImage[
'thumbnailName'];
770 $thumbPathInfo = pathinfo($thumbPath);
773 $newCoverPath = join(
'_', [
775 $row[
'submission_id'],
776 $row[
'submission_id'],
778 ]) .
'.' . $coverPathInfo[
'extension'];
779 $publicFileManager->copyContextFile(
784 $newThumbPath = join(
'_', [
786 $row[
'submission_id'],
787 $row[
'submission_id'],
790 ]) .
'.' . $thumbPathInfo[
'extension'];
791 $publicFileManager->copyContextFile(
798 if(isset($context)) {
799 foreach ($context->getSupportedFormLocales() as $localeKey) {
800 $newCoverPathInfo = pathinfo($newCoverPath);
803 $submissionDao->update(
804 'INSERT INTO submission_settings (submission_id, setting_name, setting_value, setting_type, locale)
805 VALUES (?, ?, ?, ?, ?)',
807 $row[
'submission_id'],
810 'uploadName' => $newCoverPathInfo[
'basename'],
811 'dateUploaded' => $coverImage[
'dateUploaded'],
822 $fileManager->deleteByPath($coverPath);
823 $fileManager->deleteByPath($thumbPath);