示例#1
0
    }
    //Increament Total Meetings for all users after skype has been imported
    $total_meetings = $DB->get_records('project_user_mapping', array('group_id' => $currentgroup), null, 'group_id,meetings_total', 0, 1);
    $inc_total = $total_meetings[$currentgroup]->meetings_total;
    $DB->set_field('project_user_mapping', 'meetings_total', ++$inc_total, array('group_id' => $currentgroup));
    //reset users meeting alert
    $DB->set_field('project_user_mapping', 'meeting_alert', 0, array('group_id' => $currentgroup));
    //If all all mapped, redirect page, skipping form
    if (!$unmapped) {
        redirect('view.php?id=' . $cmid);
    }
    $user_map = array();
    //Create the array
    $user_map[0] = "";
    //Add Blank option
    foreach ($mapped_users as $member) {
        //Fill the array with usernames
        $user_map[$member->user_id] = studentidToName($member->user_id);
    }
    //end for each
    $mapped_form = new history_map_users(null, array('group_members' => $user_map, 'convo_members' => $names_unique, 'history' => $history));
}
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string('Chat History Import'), 2);
if ($mapped) {
    $mapped_form->display();
}
$mform->display();
//$strlastmodified = get_string("lastmodified");
//echo "<div class=\"modified\">$strlastmodified: ".userdate($project->timemodified)."</div>";
echo $OUTPUT->footer();
    $fillempty->group_id = $currentgroup;
    foreach ($members as $member) {
        $fillempty->user_id = $member[0];
        $fillempty->id = $DB->insert_record('project_user_mapping', $fillempty);
    }
    $mapped_users = $DB->get_records('project_user_mapping', array('course_id' => $course->id, 'group_id' => $currentgroup));
    //Recall the users
}
$user_map = array();
//Create the array
//$user_map[0] = ""; //Add Blank option
foreach ($mapped_users as $member) {
    //Fill the array with usernames
    $user_map[$member->id] = studentidToName($member->user_id);
}
$mform = new history_map_users(null, array('group_members' => $user_map, 'convo_members' => $names_unique, 'history' => $history));
// If data submitted, then process and store.
if ($mform->is_cancelled()) {
    redirect("view.php?id={$cm->id}");
} else {
    if ($data = $mform->get_data()) {
        if ($data->id) {
            // store the files
            $data->timemodified = time();
            //$data = file_postupdate_standard_editor($data, 'content', $options, $context, 'mod_project', 'task', $data->id);
            //$DB->update_record('project_task', $data);
            //$DB->set_field('project', 'revision', $project->revision+1, array('id'=>$project->id));
            //add_to_log($course->id, 'course', 'update mod', '../mod/project/view.php?id='.$cm->id, 'project '.$project->id);
        } else {
            // adding new history
            /* $data->historyid        = $history->id;