// part of orsee. see orsee.org
ob_start();
$title = "send_bulk_mail";
include "header.php";
if ($proceed) {
    $allow = check_allow('participants_bulk_mail', 'participants_main.php');
}
if ($proceed) {
    if (isset($_REQUEST['send']) && $_REQUEST['send']) {
        $send = true;
    } else {
        $send = false;
    }
    // load invitation languages
    $inv_langs = lang__get_part_langs();
    $plist_ids = $_SESSION['plist_ids'];
    $number = count($plist_ids);
    if ($send) {
        if (!is_array($plist_ids) || count($plist_ids) < 1) {
            redirect("admin/");
        }
    }
}
if ($proceed) {
    if ($send) {
        // checks
        $bulk = $_REQUEST;
        $continue = true;
        foreach ($inv_langs as $inv_lang) {
            if (!$bulk[$inv_lang . '_subject']) {
Exemple #2
0
function query__get_bulkactions()
{
    global $color;
    $bulkactions = array();
    // don't use ' in text!
    if (check_allow('participants_bulk_mail')) {
        // BULK EMAIL
        $display_text = lang('send_bulk_mail');
        $inv_langs = lang__get_part_langs();
        $html = ' <center>
                <TABLE class="or_page_subtitle" style="background: ' . $color['page_subtitle_background'] . '; color: ' . $color['page_subtitle_textcolor'] . '; width: 90%;">
                    <TR><TD align="center">
                        ' . lang('send_bulk_mail_to') . ' #xyz_participants#
                </TD></TR></TABLE>
                <input class="bforminput" type="hidden" name="action" value="bulkmail">
                <TABLE class="or_formtable" style="width: 90%;">';
        foreach ($inv_langs as $inv_lang) {
            if (count($inv_langs) > 1) {
                $html .= '<TR><TD colspan=2>
                                                <TABLE width="100%" border=0 class="or_panel_title"><TR>
                        <TD style="background: ' . $color['panel_title_background'] . '; color: ' . $color['panel_title_textcolor'] . '">
                            ' . $inv_lang . ':
                        </TD>
                        </TR></TABLE>
                        </TD></TR>';
            }
            if (isset($_REQUEST['message_subject_' . $inv_lang])) {
                $tsubject = $_REQUEST['message_subject_' . $inv_lang];
            } else {
                $tsubject = '';
            }
            if (isset($_REQUEST['message_text_' . $inv_lang])) {
                $ttext = $_REQUEST['message_text_' . $inv_lang];
            } else {
                $ttext = '';
            }
            $html .= '   <TR>
                    <TD>' . lang('subject') . ':</TD>
                    <TD><input class="bforminput" type="text" name="message_subject_' . $inv_lang . '" size="50" max-length="200" value="' . $tsubject . '"></TD>
                </TR><TR>
                    <TD valign="top">' . lang('message_text') . ':</TD>
                    <TD><textarea class="bforminput" name="message_text_' . $inv_lang . '" rows="20" cols="50" wrap="virtual">' . $ttext . '</textarea></TD>
                </TR>';
        }
        $html .= '<TR><TD colspan="2" align="center"><INPUT id="popupsubmit" class="button" type="submit" name="popupsubmit" value="' . lang('send') . '"></TD></TR>
                </TABLE></center>';
        $bulkactions['bulkmail'] = array('display_text' => $display_text, 'html' => $html);
    }
    if (check_allow('participants_bulk_participant_status')) {
        // PARTICIPANT STATUS
        $display_text = lang('set_participant_status');
        if (isset($_REQUEST['new_status'])) {
            $new_status = $_REQUEST['new_status'];
        } else {
            $new_status = '';
        }
        if (isset($_REQUEST['remark'])) {
            $remark = $_REQUEST['remark'];
        } else {
            $remark = '';
        }
        $status_select = participant_status__select_field('new_status', $new_status, array(), 'bforminput');
        $html = ' <center>
                <TABLE class="or_page_subtitle" style="background: ' . $color['page_subtitle_background'] . '; color: ' . $color['page_subtitle_textcolor'] . '; width: 90%;">
                    <TR><TD align="center">
                        ' . lang('set_participant_status_for') . ' #xyz_participants#
                </TD></TR></TABLE>
                <input class="bforminput" type="hidden" name="action" value="status">
                <TABLE class="or_formtable" style="width: 90%;">
                <TR>
                    <TD>' . lang('new_status') . ':</TD>
                    <TD>' . $status_select . '</TD>
                </TR>
                <TR>
                    <TD valign="top">' . lang('add_remark_to_profile') . ':</TD>
                    <TD><textarea class="bforminput" name="remark" rows="5" cols="30" wrap="virtual">' . $remark . '</textarea></TD>
                </TR>


                <TR><TD colspan="2" align="center"><INPUT id="popupsubmit" class="button" type="submit" name="popupsubmit" value="' . lang('set_status') . '"></TD></TR>
                </TABLE></center>
                ';
        $bulkactions['status'] = array('display_text' => $display_text, 'html' => $html);
    }
    if (check_allow('participants_bulk_profile_update')) {
        // PROFILE UPDATE REQUEST
        $display_text = lang('set_profile_update_request');
        if (isset($_REQUEST['new_pool'])) {
            $new_pool = $_REQUEST['new_pool'];
        } else {
            $new_pool = '';
        }
        if (isset($_REQUEST['new_profile_update_status'])) {
            $new_profile_update_status = $_REQUEST['new_profile_update_status'];
        } else {
            $new_profile_update_status = '';
        }
        if (isset($_REQUEST['do_pool_transfer'])) {
            $do_pool_transfer = $_REQUEST['do_pool_transfer'];
        } else {
            $do_pool_transfer = '';
        }
        $pool_select = subpools__select_field('new_pool', $new_pool, array(), 'bforminput');
        $html = ' <center>
                <TABLE class="or_page_subtitle" style="background: ' . $color['page_subtitle_background'] . '; color: ' . $color['page_subtitle_textcolor'] . '; width: 90%;">
                    <TR><TD align="center">
                        ' . lang('set_profile_update_request_for') . ' #xyz_participants#
                </TD></TR></TABLE>
                <input class="bforminput" type="hidden" name="action" value="profile_update">
                <TABLE class="or_formtable" style="width: 90%;">
                <TR>
                    <TD>' . lang('set_profile_update_request_status_equal_to') . ' <SELECT name="new_profile_update_status" class="bforminput">
                            <OPTION value="y"';
        if ($new_profile_update_status == 'y') {
            $html .= ' SELECTED';
        }
        $html .= '>' . lang('active') . '</OPTION>
                            <OPTION value="n"';
        if ($new_profile_update_status != 'y') {
            $html .= ' SELECTED';
        }
        $html .= '>' . lang('inactive') . '</OPTION>
                            </SELECT>
                    </TD>
                </TR>
                <TR>
                    <TD><INPUT class="bforminput" type="checkbox" name="do_pool_transfer" value="y"';
        if ($do_pool_transfer == 'y') {
            $html .= ' CHECKED';
        }
        $html .= '>' . lang('upon_profile_update_transfer_to_subject_pool') . ' ' . $pool_select . '</TD>
                </TR>
                <TR><TD colspan="2" align="center"><INPUT id="popupsubmit" class="button" type="submit" name="popupsubmit" value="' . lang('set_status') . '"></TD></TR>
                </TABLE></center>
                ';
        $bulkactions['profile_update'] = array('display_text' => $display_text, 'html' => $html);
    }
    return $bulkactions;
}
Exemple #3
0
function lang__select_lang($varname, $selected = "", $type = "all")
{
    global $lang;
    switch ($type) {
        case "public":
            $sel_langs = lang__get_public_langs();
            break;
        case "part":
            $sel_langs = lang__get_part_langs();
            break;
        default:
            $sel_langs = get_languages();
    }
    if (!$selected) {
        $selected = lang('lang');
    }
    $lang_names = lang__get_language_names();
    $out = '';
    $out .= '<SELECT name="' . $varname . '">';
    foreach ($sel_langs as $olang) {
        $out .= '<OPTION value="' . $olang . '"';
        if ($olang == $selected) {
            $out .= ' SELECTED';
        }
        $out .= '>' . $lang_names[$olang] . '</OPTION>';
    }
    $out .= '</SELECT>';
    return $out;
}
Exemple #4
0
function participant__show_inner_form($edit, $errors, $admin = false, $template = 'current_template')
{
    global $lang, $settings, $color;
    $out = array();
    $tout = array();
    if (!isset($edit['participant_id'])) {
        $edit['participant_id'] = '';
    }
    if (!isset($edit['subpool_id'])) {
        $edit['subpool_id'] = 1;
    }
    $subpool = orsee_db_load_array("subpools", $edit['subpool_id'], "subpool_id");
    if (!$subpool['subpool_id']) {
        $subpool = orsee_db_load_array("subpools", 1, "subpool_id");
    }
    $edit['subpool_id'] = $subpool['subpool_id'];
    $pools = subpools__get_subpools();
    foreach ($pools as $p => $pool) {
        $out['is_subjectpool_' . $p] = false;
    }
    $out['is_subjectpool_' . $subpool['subpool_id']] = true;
    if ($admin) {
        $out['is_admin'] = true;
        $out['is_not_admin'] = false;
    } else {
        $out['is_admin'] = false;
        $out['is_not_admin'] = true;
    }
    if (!$admin && isset($edit['participant_id_crypt'])) {
        echo '<INPUT type=hidden name="p" value="' . $edit['participant_id_crypt'] . '">
                <INPUT type=hidden name="participant_id_crypt" value="' . $edit['participant_id_crypt'] . '">';
    }
    if ($admin) {
        $nonunique = participantform__get_nonunique($edit, $edit['participant_id']);
    }
    // user-defined participant form fields
    $formfields = participantform__load();
    foreach ($formfields as $f) {
        if ($f['subpools'] == 'all' | in_array($subpool['subpool_id'], explode(",", $f['subpools']))) {
            if ($f['admin_only'] != 'y') {
                $f = form__replace_funcs_in_field($f);
                if (isset($edit[$f['mysql_column_name']])) {
                    $f['value'] = $edit[$f['mysql_column_name']];
                } else {
                    $f['value'] = $f['default_value'];
                }
                $field = form__render_field($f);
                if ($admin) {
                    if (isset($nonunique[$f['mysql_column_name']])) {
                        $note = lang('not_unique');
                        $link = 'participants_show.php?form%5Bquery%5D%5B0%5D%5Bpformtextfields_freetextsearch%5D%5Bsearch_string%5D=' . urlencode($f['value']) . '&form%5Bquery%5D%5B0%5D%5Bpformtextfields_freetextsearch%5D%5Bnot%5D=&form%5Bquery%5D%5B0%5D%5Bpformtextfields_freetextsearch%5D%5Bsearch_field%5D=' . urlencode($f['mysql_column_name']) . '&search_submit=';
                        $field .= ' <A HREF="' . $link . '"><FONT color="' . $color['important_note_textcolor'] . '">' . str_replace(" ", "&nbsp;", $note) . '</FONT></A>';
                    }
                }
                $out[$f['mysql_column_name']] = $field;
                if (in_array($f['mysql_column_name'], $errors)) {
                    $out['error_' . $f['mysql_column_name']] = ' bgcolor="' . $color['missing_field'] . '"';
                } else {
                    $out['error_' . $f['mysql_column_name']] = '';
                }
            }
        }
    }
    // language field
    if (!isset($edit['language'])) {
        $edit['language'] = lang('lang');
    }
    $part_langs = lang__get_part_langs();
    if (count($part_langs) > 1) {
        $out['multiple_participant_languages_exist'] = true;
        $tout['multiple_participant_languages_exist'] = true;
    } else {
        $out['multiple_participant_languages_exist'] = false;
        $tout['multiple_participant_languages_exist'] = false;
    }
    $out['language'] = lang__select_lang('language', $edit['language'], "part");
    if (in_array('language', $errors)) {
        $out['error_language'] = ' bgcolor="' . $color['missing_field'] . '"';
    } else {
        $out['error_language'] = '';
    }
    // subscriptions field
    if (!isset($edit['subscriptions'])) {
        $edit['subscriptions'] = '';
    }
    $out['subscriptions'] = participant__subscriptions_form_field($subpool['subpool_id'], 'subscriptions', $edit['subscriptions']);
    if (in_array('subscriptions', $errors)) {
        $out['error_subscriptions'] = ' bgcolor="' . $color['missing_field'] . '"';
    } else {
        $out['error_subscriptions'] = '';
    }
    $formoutput = load_form_template('profile_form_public', $out, $template);
    echo $formoutput;
}