2012-01-16 09:56:57 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class ShowbuilderController extends Zend_Controller_Action
|
|
|
|
{
|
|
|
|
public function init()
|
|
|
|
{
|
|
|
|
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
2012-02-02 18:13:20 +01:00
|
|
|
$ajaxContext->addActionContext('schedule-move', 'json')
|
2021-10-11 16:10:47 +02:00
|
|
|
->addActionContext('schedule-add', 'json')
|
|
|
|
->addActionContext('schedule-remove', 'json')
|
|
|
|
->addActionContext('builder-dialog', 'json')
|
|
|
|
->addActionContext('check-builder-feed', 'json')
|
|
|
|
->addActionContext('builder-feed', 'json')
|
|
|
|
->addActionContext('context-menu', 'json')
|
2022-01-23 19:15:55 +01:00
|
|
|
->initContext();
|
2012-01-16 09:56:57 +01:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public function indexAction()
|
|
|
|
{
|
2015-08-18 21:23:42 +02:00
|
|
|
$userType = Application_Model_User::GetCurrentUser()->getType();
|
|
|
|
|
2022-03-14 11:15:04 +01:00
|
|
|
// $this->_helper->layout->setLayout("showbuilder");
|
2013-09-24 12:21:04 +02:00
|
|
|
|
2021-10-11 16:10:47 +02:00
|
|
|
$this->view->headScript()->appendScript("localStorage.setItem( 'user-type', '{$userType}' );");
|
2012-07-11 00:53:06 +02:00
|
|
|
|
2022-09-19 11:58:31 +02:00
|
|
|
$this->view->headLink()->appendStylesheet(Assets::url('css/redmond/jquery-ui-1.8.8.custom.css'));
|
2015-08-18 21:23:42 +02:00
|
|
|
|
2022-09-19 11:58:31 +02:00
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/contextmenu/jquery.contextMenu.js'), 'text/javascript');
|
2013-01-14 22:00:38 +01:00
|
|
|
|
2022-09-19 11:58:31 +02:00
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/blockui/jquery.blockUI.js'), 'text/javascript');
|
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/airtime/buttons/buttons.js'), 'text/javascript');
|
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/airtime/utilities/utilities.js'), 'text/javascript');
|
2013-01-14 22:00:38 +01:00
|
|
|
|
2022-09-19 11:58:31 +02:00
|
|
|
$this->view->headLink()->appendStylesheet(Assets::url('css/media_library.css'));
|
|
|
|
$this->view->headLink()->appendStylesheet(Assets::url('css/jquery.contextMenu.css'));
|
|
|
|
$this->view->headLink()->appendStylesheet(Assets::url('css/datatables/css/ColVis.css'));
|
|
|
|
$this->view->headLink()->appendStylesheet(Assets::url('css/datatables/css/dataTables.colReorder.min.css'));
|
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/airtime/library/library.js'), 'text/javascript');
|
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/airtime/library/events/library_showbuilder.js'), 'text/javascript');
|
2015-09-17 00:32:16 +02:00
|
|
|
$headScript = $this->view->headScript();
|
2022-09-19 11:58:31 +02:00
|
|
|
AirtimeTableView::injectTableJavaScriptDependencies($headScript);
|
2013-09-24 12:24:13 +02:00
|
|
|
|
2015-08-18 21:23:42 +02:00
|
|
|
// PLUPLOAD
|
2022-09-19 11:58:31 +02:00
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/libs/dropzone.min.js'), 'text/javascript');
|
2015-08-18 21:23:42 +02:00
|
|
|
|
2022-09-19 11:58:31 +02:00
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/timepicker/jquery.ui.timepicker.js'), 'text/javascript');
|
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/airtime/showbuilder/tabs.js'), 'text/javascript');
|
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/airtime/showbuilder/builder.js'), 'text/javascript');
|
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/airtime/showbuilder/main_builder.js'), 'text/javascript');
|
2015-08-18 21:23:42 +02:00
|
|
|
|
|
|
|
// MEDIA BUILDER
|
2022-09-19 11:58:31 +02:00
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/libs/dayjs.min.js'), 'text/javascript');
|
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/libs/utc.min.js'), 'text/javascript');
|
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/libs/timezone.min.js'), 'text/javascript');
|
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/airtime/library/spl.js'), 'text/javascript');
|
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/airtime/library/podcast.js'), 'text/javascript');
|
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/airtime/library/publish.js'), 'text/javascript');
|
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/airtime/playlist/smart_blockbuilder.js'), 'text/javascript');
|
|
|
|
$this->view->headLink()->appendStylesheet(Assets::url('css/playlist_builder.css'));
|
|
|
|
|
|
|
|
$this->view->headLink()->appendStylesheet(Assets::url('css/jquery.ui.timepicker.css'));
|
|
|
|
$this->view->headLink()->appendStylesheet(Assets::url('css/showbuilder.css'));
|
|
|
|
$this->view->headLink()->appendStylesheet(Assets::url('css/dashboard.css'));
|
2013-09-24 12:21:04 +02:00
|
|
|
|
2015-08-18 21:23:42 +02:00
|
|
|
$csrf_namespace = new Zend_Session_Namespace('csrf_namespace');
|
|
|
|
$csrf_element = new Zend_Form_Element_Hidden('csrf');
|
|
|
|
$csrf_element->setValue($csrf_namespace->authtoken)->setRequired('true')->removeDecorator('HtmlTag')->removeDecorator('Label');
|
|
|
|
$this->view->csrf = $csrf_element;
|
|
|
|
|
|
|
|
$request = $this->getRequest();
|
2022-03-14 11:15:04 +01:00
|
|
|
// populate date range form for show builder.
|
2021-10-11 16:10:47 +02:00
|
|
|
$now = time();
|
|
|
|
$from = $request->getParam('from', $now);
|
|
|
|
$to = $request->getParam('to', $now + (3 * 60 * 60));
|
2012-02-09 23:41:12 +01:00
|
|
|
|
2021-10-11 16:10:47 +02:00
|
|
|
$utcTimezone = new DateTimeZone('UTC');
|
2013-12-04 22:26:11 +01:00
|
|
|
$displayTimeZone = new DateTimeZone(Application_Model_Preference::GetTimezone());
|
2012-09-15 01:05:30 +02:00
|
|
|
|
2021-10-11 16:10:47 +02:00
|
|
|
$start = DateTime::createFromFormat('U', $from, $utcTimezone);
|
2013-12-04 22:26:11 +01:00
|
|
|
$start->setTimezone($displayTimeZone);
|
2021-10-11 16:10:47 +02:00
|
|
|
$end = DateTime::createFromFormat('U', $to, $utcTimezone);
|
2013-12-04 22:26:11 +01:00
|
|
|
$end->setTimezone($displayTimeZone);
|
2012-02-09 23:41:12 +01:00
|
|
|
|
2015-09-29 15:19:33 +02:00
|
|
|
$this->checkAndShowSetupPopup($request);
|
|
|
|
|
2012-02-15 00:39:27 +01:00
|
|
|
$form = new Application_Form_ShowBuilder();
|
2021-10-11 16:10:47 +02:00
|
|
|
$form->populate([
|
|
|
|
'sb_date_start' => $start->format('Y-m-d'),
|
|
|
|
'sb_time_start' => $start->format('H:i'),
|
|
|
|
'sb_date_end' => $end->format('Y-m-d'),
|
|
|
|
'sb_time_end' => $end->format('H:i'),
|
|
|
|
]);
|
2012-02-15 00:39:27 +01:00
|
|
|
|
|
|
|
$this->view->sb_form = $form;
|
2012-03-29 15:34:58 +02:00
|
|
|
}
|
2012-07-11 00:53:06 +02:00
|
|
|
|
2015-08-05 20:49:43 +02:00
|
|
|
/** Check if we need to show the timezone/language setup popup and display it. (eg. on first run) */
|
|
|
|
public function checkAndShowSetupPopup($request)
|
|
|
|
{
|
|
|
|
$setupComplete = Application_Model_Preference::getLangTimezoneSetupComplete();
|
2015-10-14 20:28:39 +02:00
|
|
|
$previousPage = strtolower($request->getHeader('Referer'));
|
2015-08-05 20:49:43 +02:00
|
|
|
$userService = new Application_Service_UserService();
|
|
|
|
$currentUser = $userService->getCurrentUser();
|
2021-10-11 16:10:47 +02:00
|
|
|
$previousPageWasLoginScreen = (strpos($previousPage, 'login') !== false)
|
2022-07-07 20:01:15 +02:00
|
|
|
|| (strpos($previousPage, SAAS_LOGIN_REFERRER) !== false);
|
2015-08-05 20:49:43 +02:00
|
|
|
|
|
|
|
// If current user is Super Admin, and they came from the login page,
|
|
|
|
// and they have not seen the setup popup before
|
2015-08-05 21:00:28 +02:00
|
|
|
if ($currentUser->isSuperAdmin() && $previousPageWasLoginScreen && empty($setupComplete)) {
|
2015-08-05 20:49:43 +02:00
|
|
|
$lang_tz_popup_form = new Application_Form_SetupLanguageTimezone();
|
|
|
|
$this->view->lang_tz_popup_form = $lang_tz_popup_form;
|
2022-09-19 11:58:31 +02:00
|
|
|
$this->view->headScript()->appendFile(Assets::url('js/airtime/nowplaying/lang-timezone-setup.js'), 'text/javascript');
|
2015-08-05 20:49:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public function contextMenuAction()
|
|
|
|
{
|
2022-07-07 23:27:28 +02:00
|
|
|
$baseUrl = Config::getBasePath();
|
2012-10-19 17:09:34 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
$id = $this->_getParam('id');
|
|
|
|
$now = floatval(microtime(true));
|
|
|
|
|
|
|
|
$request = $this->getRequest();
|
2021-10-11 16:10:47 +02:00
|
|
|
$menu = [];
|
2012-07-16 03:17:13 +02:00
|
|
|
|
|
|
|
$user = Application_Model_User::getCurrentUser();
|
|
|
|
|
|
|
|
$item = CcScheduleQuery::create()->findPK($id);
|
|
|
|
$instance = $item->getCcShowInstances();
|
|
|
|
|
2021-10-11 16:10:47 +02:00
|
|
|
$menu['preview'] = ['name' => _('Preview'), 'icon' => 'play'];
|
2022-03-14 11:15:04 +01:00
|
|
|
// select the cursor
|
2021-10-11 16:10:47 +02:00
|
|
|
$menu['selCurs'] = ['name' => _('Select cursor'), 'icon' => 'select-cursor'];
|
|
|
|
$menu['delCurs'] = ['name' => _('Remove cursor'), 'icon' => 'select-cursor'];
|
2012-03-01 00:19:59 +01:00
|
|
|
|
2021-10-11 16:10:47 +02:00
|
|
|
if ($now < floatval($item->getDbEnds('U.u')) && $user->canSchedule($instance->getDbShowId())) {
|
2022-03-14 11:15:04 +01:00
|
|
|
// remove/truncate the item from the schedule
|
2021-10-11 16:10:47 +02:00
|
|
|
$menu['del'] = ['name' => _('Delete'), 'icon' => 'delete', 'url' => $baseUrl . 'showbuilder/schedule-remove'];
|
2012-07-16 03:17:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$this->view->items = $menu;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function builderDialogAction()
|
|
|
|
{
|
2012-03-01 00:19:59 +01:00
|
|
|
$request = $this->getRequest();
|
2021-10-11 16:10:47 +02:00
|
|
|
$id = $request->getParam('id');
|
2012-03-01 00:19:59 +01:00
|
|
|
|
|
|
|
$instance = CcShowInstancesQuery::create()->findPK($id);
|
|
|
|
|
|
|
|
if (is_null($instance)) {
|
2021-10-11 16:10:47 +02:00
|
|
|
$this->view->error = _('show does not exist');
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2012-03-01 00:19:59 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-12-04 22:26:11 +01:00
|
|
|
$displayTimeZone = new DateTimeZone(Application_Model_Preference::GetTimezone());
|
2015-08-18 21:23:42 +02:00
|
|
|
|
2012-03-01 00:19:59 +01:00
|
|
|
$start = $instance->getDbStarts(null);
|
2013-12-04 22:26:11 +01:00
|
|
|
$start->setTimezone($displayTimeZone);
|
2012-03-01 00:19:59 +01:00
|
|
|
$end = $instance->getDbEnds(null);
|
2013-12-04 22:26:11 +01:00
|
|
|
$end->setTimezone($displayTimeZone);
|
2012-03-01 00:19:59 +01:00
|
|
|
|
|
|
|
$show_name = $instance->getCcShow()->getDbName();
|
2015-06-26 20:42:52 +02:00
|
|
|
$start_time = $start->format(DEFAULT_TIMESTAMP_FORMAT);
|
|
|
|
$end_time = $end->format(DEFAULT_TIMESTAMP_FORMAT);
|
2012-03-01 00:19:59 +01:00
|
|
|
|
|
|
|
$this->view->title = "{$show_name}: {$start_time} - {$end_time}";
|
2014-03-12 23:00:01 +01:00
|
|
|
$this->view->start = $start_time;
|
|
|
|
$this->view->end = $end_time;
|
2012-03-01 00:19:59 +01:00
|
|
|
|
2015-08-24 18:05:57 +02:00
|
|
|
$form = new Application_Form_ShowBuilder();
|
2021-10-11 16:10:47 +02:00
|
|
|
$form->populate([
|
|
|
|
'sb_date_start' => $start->format('Y-m-d'),
|
|
|
|
'sb_time_start' => $start->format('H:i'),
|
|
|
|
'sb_date_end' => $end->format('Y-m-d'),
|
|
|
|
'sb_time_end' => $end->format('H:i'),
|
|
|
|
]);
|
2015-08-24 18:05:57 +02:00
|
|
|
|
|
|
|
$this->view->sb_form = $form;
|
|
|
|
|
2012-03-01 00:19:59 +01:00
|
|
|
$this->view->dialog = $this->view->render('showbuilder/builderDialog.phtml');
|
|
|
|
}
|
2015-08-18 21:23:42 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public function checkBuilderFeedAction()
|
|
|
|
{
|
2014-03-10 23:33:07 +01:00
|
|
|
$request = $this->getRequest();
|
2021-10-11 16:10:47 +02:00
|
|
|
$show_filter = intval($request->getParam('showFilter', 0));
|
|
|
|
$my_shows = intval($request->getParam('myShows', 0));
|
|
|
|
$timestamp = intval($request->getParam('timestamp', -1));
|
|
|
|
$instances = $request->getParam('instances', []);
|
2012-03-07 12:20:30 +01:00
|
|
|
|
Feature: Support php7.4 (#1354)
* Run CI tests against php 7.4
* Sort composer dependencies
* Remove unused Aws S3 php library
* Pin simplepie dependency to ^1.5
* Pin getid3 dependency to ^1.9
* Pin composer semver to ^3.2
* Pin php-amqplib to ^2.12
* Drop sentry logging support
* Update composer dependencies
* Move propel regenerate to Makefile
* Regenerate propel files with v1.7.0
* Pin propel orm to ^1.7
* Regenerate propel files with v1.7.2
* fix: generator_version in airtime-conf-production.php
* Replace propel/propel1 with jooola/propel1
* Regenerate propel files with v1.7.3-dev
* Fix php7.4 compatibility
Using php-cs-fixer:
'@PhpCsFixer' => true,
'concat_space' => ['spacing' => 'one'],
'ordered_class_elements' => false,
'yoda_style' => false,
'@PHP74Migration' => true,
'assign_null_coalescing_to_coalesce_equal' => false,
'ternary_to_null_coalescing' => false,
'heredoc_indentation' => false,
'@PHP74Migration:risky' => true,
'declare_strict_types' => false,
'void_return' => false,
'use_arrow_functions' => false,
* Fix pre-commit
2021-10-17 17:19:53 +02:00
|
|
|
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request);
|
2012-03-07 12:20:30 +01:00
|
|
|
|
2021-10-11 16:10:47 +02:00
|
|
|
$opts = ['myShows' => $my_shows, 'showFilter' => $show_filter];
|
2012-03-07 12:20:30 +01:00
|
|
|
$showBuilder = new Application_Model_ShowBuilder($startsDT, $endsDT, $opts);
|
|
|
|
|
2022-03-14 11:15:04 +01:00
|
|
|
// only send the schedule back if updates have been made.
|
2012-03-07 12:20:30 +01:00
|
|
|
// -1 default will always call the schedule to be sent back if no timestamp is defined.
|
2012-09-18 17:02:41 +02:00
|
|
|
$this->view->update = $showBuilder->hasBeenUpdatedSince(
|
2021-10-11 16:10:47 +02:00
|
|
|
$timestamp,
|
|
|
|
$instances
|
|
|
|
);
|
2012-03-07 12:20:30 +01:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public function builderFeedAction()
|
|
|
|
{
|
2021-10-11 16:10:47 +02:00
|
|
|
$current_time = time();
|
2015-08-18 21:23:42 +02:00
|
|
|
|
2014-03-10 23:33:07 +01:00
|
|
|
$request = $this->getRequest();
|
2021-10-11 16:10:47 +02:00
|
|
|
$show_filter = intval($request->getParam('showFilter', 0));
|
|
|
|
$show_instance_filter = intval($request->getParam('showInstanceFilter', 0));
|
|
|
|
$my_shows = intval($request->getParam('myShows', 0));
|
2012-01-23 19:07:07 +01:00
|
|
|
|
Feature: Support php7.4 (#1354)
* Run CI tests against php 7.4
* Sort composer dependencies
* Remove unused Aws S3 php library
* Pin simplepie dependency to ^1.5
* Pin getid3 dependency to ^1.9
* Pin composer semver to ^3.2
* Pin php-amqplib to ^2.12
* Drop sentry logging support
* Update composer dependencies
* Move propel regenerate to Makefile
* Regenerate propel files with v1.7.0
* Pin propel orm to ^1.7
* Regenerate propel files with v1.7.2
* fix: generator_version in airtime-conf-production.php
* Replace propel/propel1 with jooola/propel1
* Regenerate propel files with v1.7.3-dev
* Fix php7.4 compatibility
Using php-cs-fixer:
'@PhpCsFixer' => true,
'concat_space' => ['spacing' => 'one'],
'ordered_class_elements' => false,
'yoda_style' => false,
'@PHP74Migration' => true,
'assign_null_coalescing_to_coalesce_equal' => false,
'ternary_to_null_coalescing' => false,
'heredoc_indentation' => false,
'@PHP74Migration:risky' => true,
'declare_strict_types' => false,
'void_return' => false,
'use_arrow_functions' => false,
* Fix pre-commit
2021-10-17 17:19:53 +02:00
|
|
|
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request);
|
2012-01-23 19:07:07 +01:00
|
|
|
|
2022-07-07 20:01:15 +02:00
|
|
|
$opts = [
|
|
|
|
'myShows' => $my_shows,
|
2021-10-11 16:10:47 +02:00
|
|
|
'showFilter' => $show_filter,
|
2022-07-07 20:01:15 +02:00
|
|
|
'showInstanceFilter' => $show_instance_filter,
|
|
|
|
];
|
2012-02-15 00:39:27 +01:00
|
|
|
$showBuilder = new Application_Model_ShowBuilder($startsDT, $endsDT, $opts);
|
2012-01-16 09:56:57 +01:00
|
|
|
|
2012-09-07 22:50:33 +02:00
|
|
|
$data = $showBuilder->getItems();
|
2021-10-11 16:10:47 +02:00
|
|
|
$this->view->schedule = $data['schedule'];
|
|
|
|
$this->view->instances = $data['showInstances'];
|
2012-03-07 12:20:30 +01:00
|
|
|
$this->view->timestamp = $current_time;
|
2012-01-16 09:56:57 +01:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public function scheduleAddAction()
|
|
|
|
{
|
2012-01-31 18:59:27 +01:00
|
|
|
$request = $this->getRequest();
|
2015-08-18 21:23:42 +02:00
|
|
|
|
2021-10-11 16:10:47 +02:00
|
|
|
$mediaItems = $request->getParam('mediaIds', []);
|
|
|
|
$scheduledItems = $request->getParam('schedIds', []);
|
2015-08-18 21:23:42 +02:00
|
|
|
|
2021-10-11 16:10:47 +02:00
|
|
|
$log_vars = [];
|
|
|
|
$log_vars['url'] = $_SERVER['HTTP_HOST'];
|
|
|
|
$log_vars['action'] = 'showbuilder/schedule-add';
|
|
|
|
$log_vars['params'] = [];
|
|
|
|
$log_vars['params']['media_items'] = $mediaItems;
|
|
|
|
$log_vars['params']['scheduled_items'] = $scheduledItems;
|
2022-09-27 13:16:03 +02:00
|
|
|
Logging::debug($log_vars);
|
2015-08-18 21:23:42 +02:00
|
|
|
|
2012-02-01 18:47:08 +01:00
|
|
|
try {
|
|
|
|
$scheduler = new Application_Model_Scheduler();
|
2012-03-28 14:23:25 +02:00
|
|
|
$scheduler->scheduleAfter($scheduledItems, $mediaItems);
|
2012-07-16 03:17:13 +02:00
|
|
|
} catch (OutDatedScheduleException $e) {
|
2012-02-16 16:29:11 +01:00
|
|
|
$this->view->error = $e->getMessage();
|
2022-09-27 13:16:03 +02:00
|
|
|
Logging::error($e->getMessage());
|
2012-07-16 03:17:13 +02:00
|
|
|
} catch (Exception $e) {
|
2012-02-16 16:29:11 +01:00
|
|
|
$this->view->error = $e->getMessage();
|
2022-09-27 13:16:03 +02:00
|
|
|
Logging::error($e->getMessage());
|
2012-02-01 18:47:08 +01:00
|
|
|
}
|
2012-01-31 18:59:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function scheduleRemoveAction()
|
|
|
|
{
|
|
|
|
$request = $this->getRequest();
|
2021-10-11 16:10:47 +02:00
|
|
|
$items = $request->getParam('items', []);
|
2015-08-18 21:23:42 +02:00
|
|
|
|
2021-10-11 16:10:47 +02:00
|
|
|
$log_vars = [];
|
|
|
|
$log_vars['url'] = $_SERVER['HTTP_HOST'];
|
|
|
|
$log_vars['action'] = 'showbuilder/schedule-remove';
|
|
|
|
$log_vars['params'] = [];
|
|
|
|
$log_vars['params']['removed_items'] = $items;
|
2022-09-27 13:16:03 +02:00
|
|
|
Logging::debug($log_vars);
|
2012-01-31 18:59:27 +01:00
|
|
|
|
|
|
|
try {
|
2012-02-01 18:47:08 +01:00
|
|
|
$scheduler = new Application_Model_Scheduler();
|
2012-02-15 18:27:59 +01:00
|
|
|
$scheduler->removeItems($items);
|
2012-07-16 03:17:13 +02:00
|
|
|
} catch (OutDatedScheduleException $e) {
|
2012-02-16 16:29:11 +01:00
|
|
|
$this->view->error = $e->getMessage();
|
2022-09-27 13:16:03 +02:00
|
|
|
Logging::error($e->getMessage());
|
2012-07-16 03:17:13 +02:00
|
|
|
} catch (Exception $e) {
|
2012-02-16 16:29:11 +01:00
|
|
|
$this->view->error = $e->getMessage();
|
2022-09-27 13:16:03 +02:00
|
|
|
Logging::error($e->getMessage());
|
2012-01-31 18:59:27 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public function scheduleMoveAction()
|
|
|
|
{
|
2012-01-17 11:18:17 +01:00
|
|
|
$request = $this->getRequest();
|
2021-10-11 16:10:47 +02:00
|
|
|
$selectedItems = $request->getParam('selectedItem');
|
|
|
|
$afterItem = $request->getParam('afterItem');
|
2015-04-11 04:53:39 +02:00
|
|
|
|
2022-09-27 13:16:03 +02:00
|
|
|
$log_vars = [];
|
|
|
|
$log_vars['url'] = $_SERVER['HTTP_HOST'];
|
|
|
|
$log_vars['action'] = 'showbuilder/schedule-move';
|
|
|
|
$log_vars['params'] = [];
|
|
|
|
$log_vars['params']['selected_items'] = $selectedItems;
|
|
|
|
$log_vars['params']['destination_after_item'] = $afterItem;
|
|
|
|
Logging::debug($log_vars);
|
2012-01-27 21:06:04 +01:00
|
|
|
|
2012-02-02 18:13:20 +01:00
|
|
|
try {
|
|
|
|
$scheduler = new Application_Model_Scheduler();
|
2012-03-28 14:23:25 +02:00
|
|
|
$scheduler->moveItem($selectedItems, $afterItem);
|
2012-07-16 03:17:13 +02:00
|
|
|
} catch (OutDatedScheduleException $e) {
|
2012-02-16 16:29:11 +01:00
|
|
|
$this->view->error = $e->getMessage();
|
2022-09-27 13:16:03 +02:00
|
|
|
Logging::error($e->getMessage());
|
2012-07-16 03:17:13 +02:00
|
|
|
} catch (Exception $e) {
|
2012-02-16 16:29:11 +01:00
|
|
|
$this->view->error = $e->getMessage();
|
2022-09-27 13:16:03 +02:00
|
|
|
Logging::error($e->getMessage());
|
2012-01-27 21:06:04 +01:00
|
|
|
}
|
2012-01-16 09:56:57 +01:00
|
|
|
}
|
2012-02-15 18:27:59 +01:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public function scheduleReorderAction()
|
|
|
|
{
|
2021-10-11 16:10:47 +02:00
|
|
|
throw new Exception('this controller is/was a no-op please fix your code');
|
2012-02-15 18:27:59 +01:00
|
|
|
}
|
2012-03-25 18:57:20 +02:00
|
|
|
}
|