diff --git a/src/modules/htmlUI/var/formmask/generic.inc.php b/src/modules/htmlUI/var/formmask/generic.inc.php index 38c4a9c69..64bc99f24 100644 --- a/src/modules/htmlUI/var/formmask/generic.inc.php +++ b/src/modules/htmlUI/var/formmask/generic.inc.php @@ -771,8 +771,8 @@ $ui_fmask = array( 'label' => 'Time', 'options' => array('format' => 'His'), ), - 'gunid_duration' => array( - 'element' => 'gunid_duration', + 'id_duration' => array( + 'element' => 'id_duration', 'type' => 'select', 'label' => 'Playlist', 'required' => TRUE, diff --git a/src/modules/htmlUI/var/html/ui_browser.php b/src/modules/htmlUI/var/html/ui_browser.php index 35c949998..32c87a327 100644 --- a/src/modules/htmlUI/var/html/ui_browser.php +++ b/src/modules/htmlUI/var/html/ui_browser.php @@ -153,6 +153,7 @@ if (isset($_REQUEST['popup']) && is_array($_REQUEST['popup'])){ break; case "SCHEDULER.addItem": + $uiHandler->SCHEDULER->setScheduleAtTime($_REQUEST); $Smarty->display('popup/SCHEDULER.addItem.tpl'); break; diff --git a/src/modules/htmlUI/var/html/ui_handler.php b/src/modules/htmlUI/var/html/ui_handler.php index 41e7625e3..6ddc91c86 100644 --- a/src/modules/htmlUI/var/html/ui_handler.php +++ b/src/modules/htmlUI/var/html/ui_handler.php @@ -1,5 +1,7 @@ SCHEDULER->set($_REQUEST); - $uiHandler->SCHEDULER->setReload(); + //$uiHandler->SCHEDULER->setReload(); + $NO_REDIRECT = true; + $_REQUEST["act"] = "SCHEDULER"; + include("ui_browser.php"); break; case "SCHEDULER.setScheduleAtTime": @@ -415,9 +420,16 @@ switch ($_REQUEST['act']) { break; case "SCHEDULER.addItem": - $uiHandler->SCHEDULER->uploadPlaylistMethod($_REQUEST); - $uiHandler->SCHEDULER->setReload(); - break; + $groupId = $uiHandler->SCHEDULER->addItem($_REQUEST); + if (PEAR::isError($groupId) && $groupId->getCode() == 555) { + $Smarty->assign("USER_ERROR", "Scheduling conflict."); + } + + //$uiHandler->SCHEDULER->setReload(); + $NO_REDIRECT = true; + $_REQUEST["act"] = "SCHEDULER"; + include("ui_browser.php"); + break; case "SCHEDULER.removeItem": $uiHandler->SCHEDULER->removeFromScheduleMethod($_REQUEST['scheduleId']); diff --git a/src/modules/htmlUI/var/init_load_once.php b/src/modules/htmlUI/var/init_load_once.php new file mode 100644 index 000000000..fe0da9fc8 --- /dev/null +++ b/src/modules/htmlUI/var/init_load_once.php @@ -0,0 +1,60 @@ +init(); + +$uiHandler = new uiHandler($CC_CONFIG); +$uiHandler->init(); +$uiBase =& $uiHandler; + +$uiBase =& $uiBrowser; +$jscom = new jscom(array("jscom_wrapper")); +$jscom->handler(); + + +// load Smarty+filters ############################################## +require_once(dirname(__FILE__).'/ui_smartyExtensions.inc.php'); +//$Smarty->load_filter('output', 'trimwhitespace'); +//$Smarty->load_filter('post', 'template_marker'); +$Smarty->load_filter('output', 'localizer'); + + +// some basic things ################################################ +foreach (get_defined_constants() as $k=>$v) { + $Smarty->assign($k, $v); +} + +if (isset($_SESSION["USER_ERROR"])) { + $Smarty->assign('USER_ERROR', $_SESSION["USER_ERROR"]); + unset($_SESSION["USER_ERROR"]); +} +$Smarty->assign('ACT', isset($_REQUEST['act'])?$_REQUEST['act']:null); +$Smarty->assign('CONFIG', $CC_CONFIG); +$Smarty->assign('START', array( + 'id' => &$uiBrowser->id, + //'pid' => &$uiBrowser->pid, + //'fid' => &$uiBrowser->fid, + 'sessid' => &$uiBrowser->sessid) + ); +$Smarty->assign('USER', array( + 'sessid' => &$uiBrowser->sessid, + 'userid' => &$uiBrowser->userid, + 'login' => &$uiBrowser->login) + ); +$uiBrowser->loadStationPrefs($ui_fmask['stationPrefs']); +$Smarty->assign('STATIONPREFS', $uiBrowser->STATIONPREFS); +$Smarty->assign_by_ref('_REQUEST', $_REQUEST); +$Smarty->assign_by_ref('_SESSION', $_SESSION); +// retransfer incomplete formdata from SESSION to POST-data ######### +if (isset($_SESSION['retransferFormData']) && is_array($_SESSION['retransferFormData'])) { + foreach($_SESSION['retransferFormData'] as $k=>$v){ + $_POST[$k] = $v; + } + unset($_SESSION['retransferFormData']); +} + +?> \ No newline at end of file diff --git a/src/modules/htmlUI/var/templates/menu.tpl b/src/modules/htmlUI/var/templates/menu.tpl index 6a5c721f0..e6a4f943a 100644 --- a/src/modules/htmlUI/var/templates/menu.tpl +++ b/src/modules/htmlUI/var/templates/menu.tpl @@ -49,10 +49,10 @@ if (window.attachEvent) window.attachEvent("onload", sfHover);