6 $app = Dataface_Application::getInstance();
7 $query = $app->getQuery();
8 $jobId = @$query[
'-job-id'];
10 if ( !@$jobId )
throw new Exception(
"No job id provided");
12 $jobRecord = df_get_record(
'xataface__email_jobs', array(
"job_id"=>
'='.$jobId));
14 throw new Exception(
"The job could not be found.");
17 $emailRecord = df_get_record(
'xataface__email_newsletters', array(
'id'=>
'='.$jobRecord->val(
'email_id')));
19 throw new Exception(
"The email for this job could not be found.");
21 if ( class_exists(
'Dataface_AuthenticationTool') ){
24 $postedBy = $emailRecord->val(
'posted_by');
25 if ( $postedBy != Dataface_AuthenticationTool::getInstance()->getLoggedInUserName() ){
26 return Dataface_Error::permissionDenied(
"Only the user who sent this email can see its progress.");
31 $mod = Dataface_ModuleTool::getInstance()->loadModule(
'modules_Email');
34 Dataface_JavascriptTool::getInstance()->import(
'xataface/modules/Email/email_progress.js');
38 'xataface/modules/email/email_progress.html'