예제 #1
0
function viewCalendarById($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $arrLang)
{
    $pCalendar = new paloSantoCalendar($pDB);
    $arrForm = createFieldForm($arrLang);
    $oForm = new paloForm($smarty, $arrForm);
    //$_DATA['ReminderTime'] = isset($_DATA['ReminderTime'])?$_DATA['ReminderTime']:"10";
    $date_ini = getParameter("event_date");
    $id = getParameter("id");
    $user = isset($_SESSION['elastix_user']) ? $_SESSION['elastix_user'] : "";
    $uid = Obtain_UID_From_User($user, $arrConf);
    $festival = $pCalendar->festivalUp();
    // verifica si esta levantado el festival
    if (!$festival) {
        $smarty->assign("mb_title", _tr("Message"));
        $smarty->assign("mb_message", $arrLang['Festival is not up']);
    }
    // yyyy-mm-dd
    if (!preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}\$/", $date_ini)) {
        $date_ini = date("M d Y");
    }
    if (!preg_match("/^[1-9][0-9]*\$/", $id)) {
        $id = "";
    }
    //D M d Y H:i:s TO (e)
    $dateServer = gmdate("D M d Y H:i:s TO (e)", strtotime($date_ini));
    //Fri Nov 12 2010 00:00:00 GMT-0500 (ECT)
    $icalFile = $arrLang["Download ical calendar"];
    $smarty->assign("ID", $id);
    $smarty->assign("module_name", $module_name);
    $smarty->assign("Export_Calendar", $arrLang["Export_Calendar"]);
    $smarty->assign("ical", $icalFile);
    $smarty->assign("LBL_EDIT", $arrLang["Edit Event"]);
    $smarty->assign("LBL_LOADING", $arrLang["Loading"]);
    $smarty->assign("LBL_DELETING", $arrLang["Deleting"]);
    $smarty->assign("LBL_SENDING", $arrLang["Sending Request"]);
    $smarty->assign("START_TYPE", $arrLang["START_TYPE"]);
    $smarty->assign("DATE_SERVER", $dateServer);
    $smarty->assign("CreateEvent", $arrLang["Create New Event"]);
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/form.tpl", $arrLang["Calendar"], array());
    $content = "<form  method='POST' style='margin-bottom:0;' action='?menu={$module_name}' name='formCalendar' id='formCalendar'>" . $htmlForm . "</form>";
    return $content;
}