OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



how to skip email displayEditForm?

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

how to skip email displayEditForm?

Postby theodore » Thu Dec 13, 2012 6:07 pm

hello!
In many functions like confirmReview or thankReviewer etc, they end with
$email->displayEditForm(....); return false;
where the mailform screen appears and the user chooses if he wants to send, skip or cancel the mail.

If I want o skip the display mail screen and just send it automaticaly, like he pressed "send", how i do it?

If I understand well, each function has an if mode where in the "if" it sends the mail and registers, and in the "else" mode it displays the mail, and then the function is recalled so as to get again in the "if".
So I suppose I just have to recurse the function without display the mail.
That's how I think it works, but do not find the way to make it...

Any help pls??
theodore
 
Posts: 37
Joined: Wed May 16, 2012 8:52 am

Re: how to skip email displayEditForm?

Postby theodore » Wed Dec 26, 2012 9:02 am

hi folks, sorryfor asking this again, but I am really stuck...

many methods that end to sending email, have this method:
$email->displayEditForm(Request::url(null, 'reviewer', 'recordRecommendation'), array('reviewId' => $reviewerSubmission->getReviewId(), 'recommendation' => $recommendation));
return false;

which leads to the mail form and the user chooses whether to send, skip or cancel the mail.

I just want to make the mail to be automatically sent, without the user to see the form and chooses the action...

If I just have $email->send() and delete the $email->displayEditForm, the mail is sent, but the page stays black and the registration is not happened, because the faunction must be somehow recalled itself...

i think the clue is this request:url function, I thnik that I must put sth similar out of the displayEditForm but have not managed to find it...
theodore
 
Posts: 37
Joined: Wed May 16, 2012 8:52 am

Re: how to skip email displayEditForm?

Postby theodore » Wed Dec 26, 2012 10:30 am

folks, leave it!
I FOUND IT!!

The matter was not to that recordRecommendation function, but to the otherone with same name!

I just change as follows:

if (!$reviewerSubmission->getCancelled()) {
if (ReviewerAction::recordRecommendation($reviewerSubmission, $recommendation, Request::getUserVar('send'))) {
Request::redirect(null, null, 'submission', $reviewId);
}
} else {
Request::redirect(null, null, 'submission', $reviewId);
}

to the following:

if (ReviewerAction::recordRecommendation($reviewerSubmission, $recommendation, true)) {
Request::redirect(null, null, 'submission', $reviewId);
}

that's all! The same way to all similar functions.
hope it will help many others.

cheers!
theodore
 
Posts: 37
Joined: Wed May 16, 2012 8:52 am


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron