예제 #1
0
         }
         /// sending mail to student (from actual user) ///
         if (isset($bInformStudent) && optional_param('sendemailtostudent', 0, PARAM_INT) == 1) {
             global $USER;
             $emuser = get_complete_user_data('id', $post->student);
             $emfrom = get_complete_user_data('id', $USER->id);
             require_once $CFG->dirroot . '/mod/praxe/mailing.php';
             $mail = new praxe_mailing();
             $stud = new stdClass();
             $stud->name = fullname($emuser);
             $stud->date = userdate(praxe_record::getData('datestart'), get_string('strftimedateshort')) . " - " . userdate(praxe_record::getData('dateend'), get_string('strftimedateshort'));
             $stud->subject = s($location->subject);
             $stud->school = s($location->name);
             $stud->studyfield = s(praxe_record::getData('studyfield_name'));
             $mail->setSubject(get_string('studenttopraxe', 'praxe'));
             $mail->addLinkToFoot(praxe_get_base_url(), get_string('praxe', 'praxe'));
             $emtext = get_string('assigntolocation_mail_student', 'praxe', $stud);
             $mail->setPlain($emtext);
             $mail->setHtml($emtext);
             if (!$mail->mailToUser($emuser, $emfrom)) {
                 print_error('mailnotsenttostudent', 'praxe', praxe_get_base_url(array('schoolid' => 0, 'mode' => 'locations')));
             }
         }
         redirect(praxe_get_base_url(array('schoolid' => 0, 'mode' => 'locations')), get_string('assigned_to_location', 'praxe'));
     }
     break;
 case 'addschool':
     /// add new school form
     /// no access ///
     $post->headmaster = optional_param('headmaster', null, PARAM_INT);
     if (!praxe_has_capability('manageallincourse') && !praxe_has_capability('editanyschool')) {