Example #1
0
/** 
 *  this saves the values from anonymous user such as guest on the main-site
 *  @param object $data the data form complete_guest form
 *  @param string $guestid the unique guestidentifier
 *  @return mixed false on error or the completeid
 */
function feedback_save_guest_values($data, $guestid)
{
    $timemodified = time();
    if (!($completed = get_record('feedback_completedtmp', 'id', $data['completedid']))) {
        return feedback_create_values($data, 0, $timemodified, true, $guestid);
    } else {
        $completed->timemodified = $timemodified;
        return feedback_update_values($data, $completed, true);
    }
}
Example #2
0
/**
 * this saves the values from anonymous user such as guest on the main-site
 *
 * @global object
 * @param string $guestid the unique guestidentifier
 * @return mixed false on error or the completeid
 */
function feedback_save_guest_values($guestid) {
    global $DB;

    $completedid = optional_param('completedid', false, PARAM_INT);

    $timemodified = time();
    if (!$completed = $DB->get_record('feedback_completedtmp', array('id'=>$completedid))) {
        return feedback_create_values(0, $timemodified, true, $guestid);
    } else {
        $completed->timemodified = $timemodified;
        return feedback_update_values($completed, true);
    }
}
Example #3
0
/**
 * this saves the values from anonymous user such as guest on the main-site
 *
 * @deprecated since Moodle 3.1
 *
 * @param string $guestid the unique guestidentifier
 * @return mixed false on error or the completeid
 */
function feedback_save_guest_values($guestid)
{
    global $DB;
    debugging('Function feedback_save_guest_values() was deprecated because it did not have ' . 'enough arguments, was not suitable for non-temporary table and was taking ' . 'data directly from input', DEBUG_DEVELOPER);
    $completedid = optional_param('completedid', false, PARAM_INT);
    $timemodified = time();
    if (!($completed = $DB->get_record('feedback_completedtmp', array('id' => $completedid)))) {
        return feedback_create_values(0, $timemodified, true, $guestid);
    } else {
        $completed->timemodified = $timemodified;
        return feedback_update_values($completed, true);
    }
}