From 57b3117663d2ade08739beb47ccf3ac86b426d6f Mon Sep 17 00:00:00 2001 From: "paul.baranowski" Date: Fri, 24 Sep 2010 18:03:23 -0400 Subject: [PATCH] CC-1676 Scheduler tabs in a different order to menu items Fixed. CC-1662 Get rid of little popups everywhere Got rid of some of these for the scheduler screens. CC-1684 Dont allow user to schedule overlapping playlists Some work on this, but alerting the user to it is not complete. --- .../htmlUI/var/formmask/generic.inc.php | 4 +- src/modules/htmlUI/var/html/ui_browser.php | 1 + src/modules/htmlUI/var/html/ui_handler.php | 22 +++++-- src/modules/htmlUI/var/init_load_once.php | 60 +++++++++++++++++++ src/modules/htmlUI/var/templates/menu.tpl | 6 +- .../var/templates/popup/SCHEDULER.addItem.tpl | 8 ++- .../htmlUI/var/templates/scheduler/main.tpl | 14 ++--- .../var/templates/script/contextmenu.js.tpl | 18 ++++-- src/modules/htmlUI/var/ui_browser_init.php | 55 +---------------- src/modules/htmlUI/var/ui_handler_init.php | 30 ---------- src/modules/htmlUI/var/ui_scheduler.class.php | 23 +++---- src/modules/storageServer/var/Schedule.php | 10 ++-- 12 files changed, 124 insertions(+), 127 deletions(-) create mode 100644 src/modules/htmlUI/var/init_load_once.php delete mode 100644 src/modules/htmlUI/var/ui_handler_init.php 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);