Example #1
0
function conference_modconf()
{
    $lang =& DoceboLanguage::createInstance('conference', 'lms');
    $id_room = Get::req('id', DOTY_INT, 0);
    $conference = new Conference_Manager();
    $room_info = $conference->roomInfo($id_room);
    if (isset($_POST['update_conf'])) {
        switch ($room_info['room_type']) {
            case 'teleskill':
                $start_date = Format::dateDb($_POST['start_date'], 'date');
                $start_date = substr($start_date, 0, 10);
                $start_time = (strlen($_POST['start_time']['hour']) == 1 ? '0' : '') . $_POST['start_time']['hour'] . ':' . (strlen($_POST['start_time']['minute']) == 1 ? '0' : '') . $_POST['start_time']['minute'] . ':00';
                $start_timestamp = fromDatetimeToTimestamp($start_date . ' ' . $start_time);
                $conference_name = trim($_POST["conference_name"]) ? trim($_POST["conference_name"]) : $lang->def('_VIDEOCONFERENCE');
                $meetinghours = (int) $_POST["meetinghours"];
                $end_timestamp = $start_timestamp + $meetinghours * 3600;
                $maxparticipants = (int) $_POST["maxparticipants"];
                $teleskill = new Teleskill_Management();
                $teleskill->updateRoom($id_room, getLogUserId(), $conference_name, $start_timestamp, $end_timestamp, false, false, $maxparticipants, isset($_POST['bookable']) ? 1 : 0);
                Util::jump_to('index.php?modname=conference&op=list');
                break;
            default:
                Util::jump_to('index.php?modname=conference&op=list');
                break;
        }
    } else {
        cout(getTitleArea($lang->def('_MOD_CONFERENCE')) . '<div class="std_block">');
        switch ($room_info['room_type']) {
            case 'teleskill':
                $teleskill = new Teleskill_Management();
                $teleskill->getModUi($room_info);
                break;
            default:
                Util::jump_to('index.php?modname=conference&amp;op=list');
                break;
        }
        cout('</div>');
    }
}