diff --git a/livesupport/modules/htmlUI/var/SmartyExtensions.inc.php b/livesupport/modules/htmlUI/var/SmartyExtensions.inc.php index 8baaa2aa3..3dc02e507 100644 --- a/livesupport/modules/htmlUI/var/SmartyExtensions.inc.php +++ b/livesupport/modules/htmlUI/var/SmartyExtensions.inc.php @@ -14,6 +14,7 @@ $Smarty->register_function('tra', 'S_tra'); $Smarty->register_function('getHour', 'S_getHour'); $Smarty->register_function('getMinute', 'S_getMinute'); $Smarty->register_function('getSecond', 'S_getSecond'); +$Smarty->register_function('niceTime', 'S_niceTime'); // --- Smarty Extensions --- /** @@ -83,6 +84,7 @@ function S_getHour($param) ## input format is HH:MM:SS.dddddd extract ($param); list ($h, $m, $s) = explode (':', $time); + settype($h, 'integer'); return $h; } @@ -91,6 +93,7 @@ function S_getMinute($param) ## input format is HH:MM:SS.dddddd extract ($param); list ($h, $m, $s) = explode (':', $time); + settype($m, 'integer'); return $m; } @@ -99,6 +102,29 @@ function S_getSecond($param) ## input format is HH:MM:SS.dddddd extract ($param); list ($h, $m, $s) = explode (':', $time); + if ($plus) $s += $plus; + settype($s, 'integer'); return $s; } + + + +function S_niceTime($param) +{ + extract($param); + + if (strpos($in, '.')) list ($in, $lost) = explode('.', $in); + $in = str_replace(' ', '', $in); + + if (preg_match('/^[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}$/', $in)) list($h, $i, $s) = explode(':', $in); + elseif (preg_match('/^[0-9]{1,2}:[0-9]{1,2}$/', $in)) list($i, $s) = explode(':', $in); + else $s = $in; + + if ($all || $h > 0) $H = sprintf('%02d', $h).':'; + else $H = ' '; + $I = sprintf('%02d', $i).':'; + $S = sprintf('%02d', $s); + + return $H.$I.$S; +} ?> \ No newline at end of file diff --git a/livesupport/modules/htmlUI/var/formmask/generic.inc.php b/livesupport/modules/htmlUI/var/formmask/generic.inc.php index c9d660903..3afa71e56 100755 --- a/livesupport/modules/htmlUI/var/formmask/generic.inc.php +++ b/livesupport/modules/htmlUI/var/formmask/generic.inc.php @@ -710,6 +710,10 @@ $ui_fmask = array( 'type' => 'hidden', 'constant' => 'SCHEDULER.addItem' ), + array( + 'element' => 'playlist', + 'type' => 'hidden' + ), 'date' => array( 'element' => 'date', 'type' => 'date', @@ -722,12 +726,36 @@ $ui_fmask = array( 'label' => 'Time', 'options' => array('format' => 'His'), ), - 'playlist' => array( - 'element' => 'playlist', + 'gunid_duration' => array( + 'element' => 'gunid_duration', 'type' => 'select', 'label' => 'Playlist', 'required' => TRUE, ), + array( + 'element' => 'snap2Prev', + 'type' => 'button', + 'label' => 'Snap to previous', + 'attributes'=> array('onClick' => 'SCHEDULE_snap2Prev()'), + 'groupit' => TRUE + ), + array( + 'element' => 'snap2Hour', + 'type' => 'button', + 'label' => 'Snap to hour', + 'attributes'=> array('onClick' => 'SCHEDULE_snap2Hour()'), + 'groupit' => TRUE + ), + array( + 'element' => 'snap2Next', + 'type' => 'button', + 'label' => 'Snap to next', + 'attributes'=> array('onClick' => 'SCHEDULE_snap2Next()'), + 'groupit' => TRUE + ), + array( + 'group' => array('snap2Prev', 'snap2Hour', 'snap2Next') + ), array( 'element' => 'cancel', 'type' => 'button', @@ -742,13 +770,14 @@ $ui_fmask = array( 'groupit' => TRUE ), array( - 'element' => 'submit', - 'type' => 'submit', + 'element' => 'submitter', + 'type' => 'button', 'label' => 'Submit', + 'attributes'=> array('onClick' => 'SCHEDULE_submit()'), 'groupit' => TRUE ), array( - 'group' => array('cancel', 'reset', 'submit') + 'group' => array('cancel', 'reset', 'submitter') ) ) ); \ No newline at end of file diff --git a/livesupport/modules/htmlUI/var/html/ui_handler.php b/livesupport/modules/htmlUI/var/html/ui_handler.php index ecf640fff..fb313e44c 100644 --- a/livesupport/modules/htmlUI/var/html/ui_handler.php +++ b/livesupport/modules/htmlUI/var/html/ui_handler.php @@ -257,7 +257,7 @@ switch($_REQUEST['act']){ break; case "SCHEDULER.setScheduleTime": - $uiHandler->SCHEDULER->setScheduleTime($_REQUEST); + $uiHandler->SCHEDULER->setScheduleAt($_REQUEST); $uiHandler->SCHEDULER->setClose(); break; diff --git a/livesupport/modules/htmlUI/var/templates/library/results.tpl b/livesupport/modules/htmlUI/var/templates/library/results.tpl index 1fc46afa1..8cb0ec391 100755 --- a/livesupport/modules/htmlUI/var/templates/library/results.tpl +++ b/livesupport/modules/htmlUI/var/templates/library/results.tpl @@ -25,7 +25,7 @@ {/if}