/**
* Constructor.
* @param $submission Submission
* @param $stageId int STAGE_ID_...
*/
function __construct($submission, $stageId)
{
parent::__construct($submission->getId(), ASSOC_TYPE_SUBMISSION, $stageId, 'controllers/grid/users/stageParticipant/addParticipantForm.tpl');
$this->_submission = $submission;
$this->_stageId = $stageId;
// add checks in addition to anything that the Notification form may apply.
$this->addCheck(new FormValidator($this, 'userGroupId', 'required', 'editor.submission.addStageParticipant.form.userGroupRequired'));
// FIXME: should use a custom validator to check that the user belongs to this group.
// validating in validate method for now.
$this->addCheck(new FormValidator($this, 'userId', 'required', 'editor.submission.addStageParticipant.form.userRequired'));
$this->addCheck(new FormValidatorPost($this));
$this->addCheck(new FormValidatorCSRF($this));
}