Example #1
0
function prepare_survey_responses_record($group_id, &$record, $salt)
{
    global $datetime_fmt;
    /*
        Prepare the column values in the task  record
        Input: a row from the project_task table (passed by
                reference.
       Output: the same row with values transformed for database export
    */
    $record['date'] = format_date($datetime_fmt, $record['date']);
    $record['reponse'] = prepare_textarea($record['response']);
    //compute encrypted user_id
    $enc_user_id = codendi_crypt($record['user_id'], $salt);
    $record['user_id'] = $enc_user_id;
}
Example #2
0
function pe_utils_format_sr_messages($group_id, $sr_id)
{
    global $SR_MSG, $Language;
    // return all the follow-up comments attached to a given bug
    // Do a big SQl query the first time and then cache the results
    // instead of doing one SQL query for each bug
    if (!isset($SR_MSG)) {
        $sql = 'SELECT support_messages.support_id, support_messages.from_email,' . 'support_messages.date,support_messages.body ' . 'FROM support_messages, support ' . 'WHERE (support_messages.support_id=support.support_id AND ' . "support.group_id='{$group_id}') " . 'ORDER BY date DESC';
        $res = db_query($sql);
        if ($res) {
            while ($row = db_fetch_array($res)) {
                $SR_MSG[$row['support_id']] .= '==================================================' . "\n" . $Language->getText('global', 'by') . ': ' . $row['from_email'] . '      ' . $Language->getText('global', 'on') . ': ' . format_date($GLOBALS['Language']->getText('system', 'datefmt'), $row['date']) . "\n\n" . prepare_textarea($row['body']) . "\n";
            }
        } else {
            $SR_MSG = array();
        }
    }
    return $SR_MSG[$sr_id];
}