/** Possible actions for a testinvite: edit, view scores, delete */ function testinvite_actions($testinvite_id) { $CI =& get_instance(); $testinvite = $CI->testInviteModel->get_testinvite_by_id($testinvite_id); $scores = $CI->scoreModel->get_scores_by_testinvite($testinvite_id); $reminder_available = !$testinvite->datecompleted && $testinvite->datereminder; $reminder_link = anchor('testinvite/manual_reminder/' . $testinvite_id, img_email(lang('manual_reminder'), FALSE)); $score_link = anchor('score/testinvite/' . $testinvite_id, img_scores(empty($scores))); $reminder_link = $reminder_available ? $reminder_link : img_email('', TRUE); $delete_link = anchor('testinvite/delete/' . $testinvite_id, img_delete(), warning(lang('sure_delete_testinvite'))); if (is_caller()) { $actions = array($reminder_link, $delete_link); } if (is_leader()) { $actions = array($score_link, $reminder_link); } if (is_admin()) { $actions = array($score_link, $reminder_link, $delete_link); } return implode(' ', $actions); }
/** Possible actions for a testsurvey/participant: invite */ function testsurvey_participant_actions($testsurvey_id, $participant_id) { $find_link = anchor('testinvite/invite/' . $testsurvey_id . '/' . $participant_id, img_email(lang('testinvite'))); return implode(' ', array($find_link)); }