OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Notification on metadata or supplementary files change

Are you an Editor, Author, or Journal Manager in need of help? Want to talk to us about workflow issues? This is your forum.

Moderators: jmacgreg, michael, vgabler, John

Forum rules
This forum is meant for general questions about the usability of OJS from an everyday user's perspective: journal managers, authors, and editors are welcome to post questions here, as are librarians and other support staff. We welcome general questions about the role of OJS and how the workflow works, as well as specific function- or user-related questions.

What to do if you have general, workflow or usability questions about OJS:

1. Read the documentation. We've written documentation to cover from OJS basics to system administration and code development, and we encourage you to read it.

2. take a look at the tutorials. We will continue to add tutorials covering OJS basics as time goes on.

3. Post a question. Questions are always welcome here, but if it's a technical question you should probably post to the OJS Technical Support subforum; if you have a development question, try the OJS Development subforum.

Notification on metadata or supplementary files change

Postby primozs » Wed Dec 11, 2013 2:04 pm

Hello,

We have very often problems that authors have to change submission metadata or supplementary files. As far as we noticed there is no notification to editors at this change. No emails, no "coloring" in the Submissions in Review page. So finding such changes is very difficult. Please let me know if that is correct observation.

The best fix to this would be to add notification of course. Any idea is that is "easy" to implement?

But other option would be to add column "last submission change date" in the Submissions in Review page. That date would contain the date of the last submission change (like metadata change, body file change, supplementary file change,...). Anzy idea how "expensive" is this workaround?

Any other idea how to overcome this problem?

Regards, Primož
primozs
 
Posts: 81
Joined: Tue Feb 05, 2013 7:07 am

Re: Notification on metadata or supplementary files change

Postby asmecher » Mon Dec 16, 2013 11:59 am

Hi Primož,

A notification message wouldn't be too difficult. I think it would also be a better solution than a date field; there is a "last modified" date in the database, but by itself that's not very useful information, as any of a number of users might be responsible for the change, and it sounds like you're specifically interested in the Author's changes.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9072
Joined: Wed Aug 10, 2005 12:56 pm

Re: Notification on metadata or supplementary files change

Postby primozs » Mon Dec 16, 2013 12:18 pm

Hi Alec,

Thank you for your reply. You got my idea right. I am interested in the Author's changes, yes. A notification would be very nice. Can you implement it? How fast?

Regards, Primož
primozs
 
Posts: 81
Joined: Tue Feb 05, 2013 7:07 am

Re: Notification on metadata or supplementary files change

Postby asmecher » Mon Dec 16, 2013 12:53 pm

Hi Primož,

It's not a high priority for us at the moment -- but it would be a fairly simple modification. Edit pages/author/TrackSubmissionHandler.inc.php and identify the operations you want to add a notification to (e.g. saveMetadata, uploadRevisedVersion, saveSuppFile). Then add some code something like...
Code: Select all
import('classes.mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($submission, 'MY_NEW_NOTIFICATION');
$email->toAssignedEditingSectionEditors($submission->getId());
$email->toAssignedEditors($submission->getId());
$email->assignParams(array(
   ... (these are the parameters for your email template)
));
$email->send($request);
You can find samples of similar code in classes/submission/author/AuthorAction.inc.php.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9072
Joined: Wed Aug 10, 2005 12:56 pm

Re: Notification on metadata or supplementary files change

Postby primozs » Tue Dec 17, 2013 12:21 am

Hi Alec,

Thank you for help. I will try to implement it.

Regards, Primož
primozs
 
Posts: 81
Joined: Tue Feb 05, 2013 7:07 am

Re: Notification on metadata or supplementary files change

Postby aleskl » Tue Dec 17, 2013 5:44 am

For supplementary files notification, the email sending should be in the function saveSuppFile inside this if sentence (line 305 in pages/author/TrackSubmissionHandler.inc.php), probably before the redirect statement:
Code: Select all
         if ($submitForm->validate()) {
            $submitForm->execute();
            $request->redirect(null, null, 'submission', $articleId);
         } else {


I'm also interested in developing this, so let's keep track here how are we doing :)
I'm going to insert some mail sending code from the AuthorAction.inc.php like Alec suggested.

Regards,
Aleš
aleskl
 
Posts: 107
Joined: Mon Apr 11, 2011 7:08 am

Re: Notification on metadata or supplementary files change

Postby aleskl » Tue Dec 17, 2013 4:34 pm

An update:
I've managed to trigger email sending for supplementary files upload, but the email is empty. The email being sent has a subject [journal name] Array, the body contains nothing but the journal footer text.

I have added the email sending code in pages/author/TrackSubmissionHandler.inc.php in the function saveSuppFile (line 305):
Code: Select all
         if ($submitForm->validate()) {
            $submitForm->execute();
            import('classes.mail.ArticleMailTemplate');
               $email = new ArticleMailTemplate($authorSubmission, 'SUPPLEMENTARY_FILE_NOTIFY');
               $email->toAssignedEditingSectionEditors($authorSubmission->getId());
               $email->toAssignedEditors($authorSubmission->getId());
               $email->assignParams(array(
                  'editorialContactName' => $editorName,
                  'articleTitle' => $authorSubmission->getLocalizedTitle()
               ));
               $email->send($request);
            $request->redirect(null, null, 'submission', $articleId);
         } else {
            $submitForm->display();
         }

The adding of supplementary files works, but the notification email is not very informative. I have created a new email template named SUPPLEMENTARY_FILE_NOTIFY, and I've also found this bug http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=7763, but it's fixed in my release (2.4.3.0). Also, only the above two email parameters work, if I add additional parameters, it breaks the form submitting. I tried to add additional parameters from the REVISED_VERSION_NOTIFY email template. These do not work:
Code: Select all
               'authorName' => $user->getFullName(),
               'submissionUrl' => $request->url(null, $isEditor?'editor':'sectionEditor', 'submissionReview', $authorSubmission->getId()),
               'editorialContactSignature' => $journal->getSetting('contactName') . "\n" . $journal->getLocalizedTitle()


So I'm just halfway there, but I'd really like to get this to work... :)

Regards,
Aleš
aleskl
 
Posts: 107
Joined: Mon Apr 11, 2011 7:08 am

Re: Notification on metadata or supplementary files change

Postby asmecher » Wed Dec 18, 2013 10:13 am

Hi Aleš,

Try passing "true" to the $ignorePostedData parameter of the ArticleMailTemplate constructor; I suspect this will solve the content problems you're having with email templates.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9072
Joined: Wed Aug 10, 2005 12:56 pm

Re: Notification on metadata or supplementary files change

Postby aleskl » Thu Jan 02, 2014 2:42 pm

asmecher wrote:Try passing "true" to the $ignorePostedData parameter of the ArticleMailTemplate constructor; I suspect this will solve the content problems you're having with email templates.


Thanks Alec, that did the trick!

I've changed the line calling the ArticleMailTemplate constructor to:

Code: Select all
$email = new ArticleMailTemplate($authorSubmission, 'SUPPLEMENTARY_FILE_NOTIFY', null, null, null, true, true);


And now the email is sent with the proper subject line as defined in the email template. I have also added various calls for the author and editor names, copied from the AuthorAction.inc.php (from line 112 on). The code in pages/author/TrackSubmissionHandler.inc.php is now:
Code: Select all
   function saveSuppFile($args, $request) {
      $articleId = (int) $request->getUserVar('articleId');
      $suppFileId = (int) array_shift($args);
      $this->validate($request, $articleId);

      $authorSubmission =& $this->submission;
      $this->setupTemplate($request, true, $articleId, 'summary');

      if ($authorSubmission->getStatus() != STATUS_PUBLISHED && $authorSubmission->getStatus() != STATUS_ARCHIVED) {
         import('classes.submission.form.SuppFileForm');

         $user =& $request->getUser();
         $journal =& $request->getJournal();
         $submitForm = new SuppFileForm($authorSubmission, $journal, $suppFileId);
         $submitForm->readInputData();

         if ($submitForm->validate()) {
            $submitForm->execute();
            import('classes.mail.ArticleMailTemplate');
               $email = new ArticleMailTemplate($authorSubmission, 'SUPPLEMENTARY_FILE_NOTIFY', null, null, null, true, true);
               $isEditor = false;
               $assignedSectionEditors = $email->toAssignedEditingSectionEditors($authorSubmission->getId());
               $editor = array_shift($assignedSectionEditors);
               if (!$editor) {
                  $isEditor = true;
                  $assignedEditors = $email->toAssignedEditors($authorSubmission->getId());
                  $editor = array_shift($assignedEditors);
               }
               if (!$editor) {
                  $email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
                  $editorName = $journal->getSetting('contactName');
               } else {
                  $editorName = $editor->getEditorFullName();
               }
               $email->assignParams(array(
                  'editorialContactName' => $editorName,
                  'articleTitle' => $authorSubmission->getLocalizedTitle(),
                  'authorName' => $user->getFullName(),
                  'submissionUrl' => $request->url(null, $isEditor?'editor':'sectionEditor', 'submissionReview', $authorSubmission->getId()),
                  'editorialContactSignature' => $journal->getSetting('contactName') . "\n" . $journal->getLocalizedTitle()
               ));
               $email->send($request);
            $request->redirect(null, null, 'submission', $articleId);
         } else {
            $submitForm->display();
         }
      } else {
         $request->redirect(null, null, 'submission', $articleId);
      }
   }


And the email template named SUPPLEMENTARY_FILE_NOTIFY is like this:
Subject: Supplementary file uploaded
Body:
Dear {$editorialContactName}:

Supplementary file for the paper "{$articleTitle}" has been uploaded by the author {$authorName}.

The submission link: {$submissionUrl}


Thanks again for all your help! The only addition to this would be to write the event in the article log, but this is not essential for now.

Cheers,
Ales
aleskl
 
Posts: 107
Joined: Mon Apr 11, 2011 7:08 am

Re: Notification on metadata or supplementary files change

Postby aleskl » Mon Jan 20, 2014 7:29 am

You can also set the subject of the email template SUPPLEMENTARY_FILE_NOTIFY to include the article number:

Subject: Supplementary file uploaded #{$articleId}
aleskl
 
Posts: 107
Joined: Mon Apr 11, 2011 7:08 am


Return to OJS Editorial Support and Discussion

Who is online

Users browsing this forum: Bing [Bot] and 3 guests