How to attach the article file to the Section-Editor Assignment mail

Hi,
I have been asked by Editors to modify the EDITOR_ASSIGN template in order to get the pdf file of the article automatically attached to the assignement mail. In other words, I would like to have a similar behaviour as in the REVIEW_REQUEST_ATTACHED template. Is there an best way to do so ?

Thanks
Claude

Hi @Claude_Sabbah,

You’ll have to dive into classes/submission/editor/EditorAction.inc.php in the assignEditor function.

I’d suggest following the pattern used to attach the submission to the REVIEW_REQUEST_ATTACHED email:

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks a lot, Alec.
But not being expert, I guess I should change the line 283 of SectionEditorAction.inc.php
$reviewVersion =& $sectionEditorSubmission->getReviewFile();
with another one?

Best
Claude

Hi @Claude_Sabbah,

Off the top of my head, you would need to do something like…

$articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
$submissionFile =& $articleFileDao->getArticleFile($sectionEditorSubmission->getSubmissionFileId())

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks but I probably forget to add something, since this produces
Fatal error: Call to a member function getSubmissionFileId() on a non-object in /var/www/html/ojs/classes/submission/editor/EditorAction.inc.php on line 96

Best
Claude

Hi @Claude_Sabbah,

The $sectionEditorSubmission object referred to in the quoted code above probably doesn’t exist, judging by that error message. You might find a $submission object in scope where you’re making your modifications.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks, Alec.
This eliminates the error, but no file is attached to the mail, however, with the following lines

                            $email->assignParams($paramArray);
                                        import('classes.file.TemporaryFileManager');
                                        $temporaryFileManager = new TemporaryFileManager();
                                        $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
                                        $submissionFile =& $articleFileDao->getArticleFile($editorSubmission->getSubmissionFileId());
                                        if ($reviewVersion) {
                                                $temporaryFile = $temporaryFileManager->articleToTemporaryFile($reviewVersion, $user->getId());
                                                $email->addPersistAttachment($temporaryFile);
                                }

Best
Claude

Hi @Claude_Sabbah,

The $reviewVersion object does not exist. In this case, it should be $submissionFile.

Regards,
Alec Smecher
Public Knowledge Project Team

Looks perfect !
Thanks a lot for your help. I really appreciate it.

Best
Claude