diff --git a/livesupport/modules/htmlUI/var/SmartyExtensions.inc.php b/livesupport/modules/htmlUI/var/SmartyExtensions.inc.php index 1839fa4e1..b05f0a8fa 100644 --- a/livesupport/modules/htmlUI/var/SmartyExtensions.inc.php +++ b/livesupport/modules/htmlUI/var/SmartyExtensions.inc.php @@ -72,9 +72,10 @@ function S_htmlspecialchars($param) * * @param void array, array of strings to be outputted translated */ -function S_tra($param) -{ +function S_tra($in) +{ global $uiBrowser; + foreach($in as $val) $param[] = $val; echo tra($param[0], $param[1], $param[2], $param[3], $param[4], $param[5], $param[6], $param[7], $param[8], $param[9]); } diff --git a/livesupport/modules/htmlUI/var/formmask/generic.inc.php b/livesupport/modules/htmlUI/var/formmask/generic.inc.php index 6088ab4e6..869949ac5 100755 --- a/livesupport/modules/htmlUI/var/formmask/generic.inc.php +++ b/livesupport/modules/htmlUI/var/formmask/generic.inc.php @@ -419,11 +419,11 @@ $ui_fmask = array( 'groupit' => TRUE, ), array( - 'element' => 'addrow', - 'type' => 'button', - 'label' => 'Add Criteria', - 'attributes' => array('class' => 'button_wide', 'onClick' => 'SearchForm_addRow()'), - 'groupit' => TRUE, + 'element' => 'spacer', + 'type' => 'static', + 'text' => '                     +                      +                     ' ), array( 'element' => 'submit', @@ -432,7 +432,7 @@ $ui_fmask = array( 'groupit' => TRUE, 'attributes' => array('class' => 'button_wide') ), - array('group' => array('clear', 'addrow', 'submit') + array('group' => array('clear', 'spacer', 'submit') ), ), diff --git a/livesupport/modules/htmlUI/var/html/ui_browser.php b/livesupport/modules/htmlUI/var/html/ui_browser.php index 6a1191e45..f35d7cdf1 100644 --- a/livesupport/modules/htmlUI/var/html/ui_browser.php +++ b/livesupport/modules/htmlUI/var/html/ui_browser.php @@ -31,6 +31,11 @@ if (is_array($_REQUEST['popup'])){ $Smarty->display('popup/_redirector.tpl'); break; + case "_2SCHEDULER": + $Smarty->assign('target', 'SCHEDULER'); + $Smarty->display('popup/_redirector.tpl'); + break; + case "login": $Smarty->assign('dynform', $uiBrowser->login($ui_fmask)); $Smarty->display('popup/login.tpl'); diff --git a/livesupport/modules/htmlUI/var/templates/file/fileform.tpl b/livesupport/modules/htmlUI/var/templates/file/fileform.tpl index 97a383b75..75631cd5b 100755 --- a/livesupport/modules/htmlUI/var/templates/file/fileform.tpl +++ b/livesupport/modules/htmlUI/var/templates/file/fileform.tpl @@ -1,3 +1,3 @@ {UIBROWSER->fileForm id=$editItem.id folderId=$editItem.folderId assign="dynform"} {include file="sub/dynForm_plain.tpl} -{assign var="_uploadform" value=NULL} +{assign var="_uploadform" value=null} diff --git a/livesupport/modules/htmlUI/var/templates/file/webstreamform.tpl b/livesupport/modules/htmlUI/var/templates/file/webstreamform.tpl index 8f47dfd5e..f18e5c431 100755 --- a/livesupport/modules/htmlUI/var/templates/file/webstreamform.tpl +++ b/livesupport/modules/htmlUI/var/templates/file/webstreamform.tpl @@ -1,4 +1,4 @@ {UIBROWSER->webstreamForm id=$editItem.id folderId=$editItem.folderId assign="dynform"} {include file="sub/dynForm_plain.tpl} -{assign var="_uploadform" value=NULL} +{assign var="_uploadform" value=null} diff --git a/livesupport/modules/htmlUI/var/templates/library/searchForm.js.tpl b/livesupport/modules/htmlUI/var/templates/library/searchForm.js.tpl index dc48893cd..e1b586de2 100755 --- a/livesupport/modules/htmlUI/var/templates/library/searchForm.js.tpl +++ b/livesupport/modules/htmlUI/var/templates/library/searchForm.js.tpl @@ -4,6 +4,7 @@ function SearchForm_displayRow(row) { document.getElementById('searchRow_' + row).style.display = 'inline'; + document.forms['search'].elements['row_' + Number(row) + '[active]'].value = 1 } function SearchForm_addRow() @@ -25,6 +26,7 @@ function SearchForm_hideRow(row) document.forms['search'].elements['row_' + Number(row) + '[0]'].options[0].selected = true; document.forms['search'].elements['row_' + Number(row) + '[1]'].options[0].selected = true; document.forms['search'].elements['row_' + Number(row) + '[2]'].value = ''; + document.forms['search'].elements['row_' + Number(row) + '[active]'].value = 0 } function SearchForm_dropRow(row) diff --git a/livesupport/modules/htmlUI/var/templates/menu.tpl b/livesupport/modules/htmlUI/var/templates/menu.tpl index aedeae7aa..63d388b37 100755 --- a/livesupport/modules/htmlUI/var/templates/menu.tpl +++ b/livesupport/modules/htmlUI/var/templates/menu.tpl @@ -3,7 +3,7 @@
  • ##Playlist Editor##
  • -
  • ##Scheduler##
  • +
  • ##Scheduler## + +
  • {if $SUBJECTS->Base->gb->checkPerm($SUBJECTS->Base->userid, 'subjects')}
  • ##Station Settings##
  • diff --git a/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl b/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl index 2afdda7de..15f7c6f79 100755 --- a/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl +++ b/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl @@ -1,7 +1,11 @@
    -

    ##Playlist Editor##: {$PL->title}

    +
    +

    ##Playlist Editor##

    +

    {$PL->title}   {getHour time=$PL->duration}##h## {getMinute time=$PL->duration}##m## {getSecond time=$PL->duration}##s##

    +
    +
     
     
    diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/calendar.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/calendar.tpl index 58931b3ed..d6b0209c3 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/calendar.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/calendar.tpl @@ -6,10 +6,10 @@ diff --git a/livesupport/modules/htmlUI/var/templates/statusbar.tpl b/livesupport/modules/htmlUI/var/templates/statusbar.tpl index 2261c98e1..a89f255f5 100755 --- a/livesupport/modules/htmlUI/var/templates/statusbar.tpl +++ b/livesupport/modules/htmlUI/var/templates/statusbar.tpl @@ -47,7 +47,7 @@
    {if $_nowplaying}
    Now Playing: {$_nowplaying.title}
    -
    +
     
    @@ -65,45 +65,5 @@ -{assign var='_nowplaying' value=NULL} -{assign var='_nextplaying' value=NULL} - - -{* - -
    - -
    - server time -
    - -
    - -
    - local time -
    - -
    - -
    - -
    - -
    - {$STATIONPREFS.stationName} -
    - {$STATIONPREFS.frequency} -
    - -
    - {$SCHEDULER->getNowNextClip()} -
    - {$STATIONPREFS.frequency} -
    - -
    - {include file="userinfo.tpl"} -
    - -
    -*} +{assign var='_nowplaying' value=null} +{assign var='_nextplaying' value=null} diff --git a/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl b/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl index 462dae793..ce7eaddf1 100755 --- a/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl +++ b/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl @@ -39,4 +39,4 @@ onClick="return contextmenu('{$i.id}' {$moreContextAfter} )" -{assign var="_PL_activeId" value=NULL} +{assign var="_PL_activeId" value=null} diff --git a/livesupport/modules/htmlUI/var/ui_conf.php b/livesupport/modules/htmlUI/var/ui_conf.php index 1ad878e00..b248eec49 100755 --- a/livesupport/modules/htmlUI/var/ui_conf.php +++ b/livesupport/modules/htmlUI/var/ui_conf.php @@ -6,6 +6,7 @@ define('UI_ERROR', TRUE); define('UI_DEFAULT_LANGID', 'en_GB'); #define('UI_TIMEZONE', ' +100'); define('UI_TIMEZONEOFFSET', date('Z')); + ## Basic scripts define('UI_HANDLER', 'ui_handler.php'); @@ -70,6 +71,7 @@ define('UI_BROWSE_DEFAULT_LIMIT', 10); ## Scheduler / Calendar define('UI_SCHEDULER_FIRSTWEEKDAY', 1); +define('UI_SCHEDULER_DEFAULT_VIEW', 'day'); define('UI_SCHEDULER_PAUSE_PL2PL', '5 seconds'); ## File types diff --git a/livesupport/modules/htmlUI/var/ui_handler.class.php b/livesupport/modules/htmlUI/var/ui_handler.class.php index 466c44cb1..6a6af8433 100644 --- a/livesupport/modules/htmlUI/var/ui_handler.class.php +++ b/livesupport/modules/htmlUI/var/ui_handler.class.php @@ -65,7 +65,7 @@ class uiHandler extends uiBase { } $this->sessid = $sessid; $this->langid = $formdata['langid']; - $this->redirUrl = UI_BROWSER.'?popup[]=_clear_parent&popup[]=_close'; + $this->redirUrl = UI_BROWSER.'?popup[]=_2SCHEDULER&popup[]=_close'; return TRUE; } diff --git a/livesupport/modules/htmlUI/var/ui_playlist.class.php b/livesupport/modules/htmlUI/var/ui_playlist.class.php index b2f9aefe1..4e604f717 100755 --- a/livesupport/modules/htmlUI/var/ui_playlist.class.php +++ b/livesupport/modules/htmlUI/var/ui_playlist.class.php @@ -6,6 +6,7 @@ class uiPlaylist $this->Base =& $uiBase; $this->activeId =& $_SESSION[UI_PLAYLIST_SESSNAME]['activeId']; $this->title = $this->Base->_getMDataValue($this->activeId, UI_MDATA_KEY_TITLE); + $this->duration = $this->Base->_getMDataValue($this->activeId, UI_MDATA_KEY_DURATION); $this->token =& $_SESSION[UI_PLAYLIST_SESSNAME]['token']; $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close'; $this->redirectUrl = UI_BROWSER.'?popup[]=_2PL.simpleManagement&popup[]=_close'; diff --git a/livesupport/modules/htmlUI/var/ui_scheduler.class.php b/livesupport/modules/htmlUI/var/ui_scheduler.class.php index 468d1f696..53220d2fd 100755 --- a/livesupport/modules/htmlUI/var/ui_scheduler.class.php +++ b/livesupport/modules/htmlUI/var/ui_scheduler.class.php @@ -9,7 +9,7 @@ class uiScheduler extends uiCalendar $this->scheduleNext =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleNext']; if (!is_array($this->curr)) { - $this->curr['view'] = 'month'; + $this->curr['view'] = UI_SCHEDULER_DEFAULT_VIEW; $this->curr['year'] = strftime("%Y"); $this->curr['month'] = strftime("%m"); $this->curr['week'] = strftime("%V"); @@ -103,7 +103,7 @@ class uiScheduler extends uiCalendar ## search for previous entry if (count($week[$this->scheduleAt['day']]) >= 1) { - foreach (array_reverse($week[$this->scheduleAt['day']]) as $entry) { + foreach (array_reverse($week[$this->scheduleAt['day']]) as $entry) { if (strtotime($entry[0]['end']) <= strtotime($this->scheduleAt['hour'].':'.$this->scheduleAt['minute'].':'.$this->scheduleAt['second'])) { $prev = TRUE; list ($this->schedulePrev['hour'], $this->schedulePrev['minute'], $this->schedulePrev['second']) @@ -370,14 +370,15 @@ class uiScheduler extends uiCalendar $datetime = strftime('%Y-%m-%dT%H:%M:%S'); $xmldatetime = str_replace('-', '', $datetime); $pl = $this->displayScheduleMethod($xmldatetime, $xmldatetime); - if(!is_array($pl) || !count($pl)) - return FALSE; + + if(!is_array($pl) || !count($pl)) return FALSE; $pl = current($pl); - $offset = strftime('%H:%M:%S', $this->_strtotime($datetime) - $this->_datetime2timestamp($pl['start']) - UI_TIMEZONEOFFSET); + $offset = strftime('%H:%M:%S', time() - $this->_datetime2timestamp($pl['start']) - 3600); ## subtract 3600 sec. becausefor some reason strftime('%H:%M:%S', 0) is 01:00:00 $clip = $this->Base->gb->displayPlaylistClipAtOffset($this->Base->sessid, $pl['playlistId'], $offset, $distance); - if(!$clip['gunid']) - return FALSE; + + if (!$clip['gunid']) return FALSE; + return array( 'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($clip['gunid']), UI_MDATA_KEY_TITLE), 'duration' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($clip['gunid']), UI_MDATA_KEY_DURATION), diff --git a/livesupport/modules/htmlUI/var/ui_search.class.php b/livesupport/modules/htmlUI/var/ui_search.class.php index e20f12c0f..7901bb044 100755 --- a/livesupport/modules/htmlUI/var/ui_search.class.php +++ b/livesupport/modules/htmlUI/var/ui_search.class.php @@ -43,18 +43,33 @@ class uiSearch } }; }; + for($n = 1; $n <= UI_SEARCH_MAX_ROWS; $n++) { unset ($group); + + if ($n > 1 && $n > $this->criteria['counter']) + $activerow = FALSE; + else $activerow = TRUE; + $form->addElement('static', 's1', NULL, "
    "); - if ($n > 1 && $n > $this->criteria['counter']) $form->addElement('static', 's1_style', NULL, ""); + + if ($activerow===FALSE) $form->addElement('static', 's1_style', NULL, ""); + $sel = &$form->createElement('hierselect', "row_$n", NULL); $sel->setOptions(array($col1, $col2)); $group[] = &$sel; $group[] = &$form->createElement('text', "row_$n".'[2]', NULL); - $group[] = &$form->createElement('button', "dropRow_$n", 'Drop', array('onClick' => "SearchForm_dropRow('$n')", 'class' => UI_BUTTON_STYLE)); + + if ($activerow) $group[] = &$form->createElement('hidden', "row_$n".'[active]', TRUE); + else $group[] = &$form->createElement('hidden', "row_$n".'[active]', FALSE); + + if ($n === 1) $group[] = &$form->createElement('button', "addRow", tra('+'), array('onClick' => "SearchForm_addRow('$n')", 'class' => UI_BUTTON_STYLE)); + else $group[] = &$form->createElement('button', "dropRow_$n", tra('-'), array('onClick' => "SearchForm_dropRow('$n')", 'class' => UI_BUTTON_STYLE)); + $form->addGroup($group); $form->addElement('static', 's2', NULL, "
    "); } + $this->Base->_parseArr2Form($form, $mask2['search']); $form->setConstants($this->criteria['form']); $form->validate(); @@ -68,6 +83,8 @@ class uiSearch function newSearch(&$formdata) { + #print_r($formdata); + $this->results = NULL; $this->criteria['conditions'] = NULL; $this->criteria['offset'] = NULL; @@ -83,7 +100,7 @@ class uiSearch $this->criteria['form']['limit'] = $formdata['limit']; foreach ($formdata as $key=>$val) { - if (is_array($val) && strlen($val[2])) { + if (is_array($val) && $val['active']) { $this->criteria['counter']++; $this->criteria['conditions'][$key] = array('cat' => $this->Base->_formElementDecode($val[0]), 'op' => $val[1], @@ -132,7 +149,7 @@ class uiSearch 'op' => constant('UI_SIMPLESEARCH_OP'.$n), 'val' => stripslashes($formdata['criterium']) ); - $this->criteria['form']['row_'.$n] = array(0 => $this->Base->_formElementEncode(constant('UI_SIMPLESEARCH_CAT'.$n)), + $this->criteria['form']['row_'.$n]= array(0 => $this->Base->_formElementEncode(constant('UI_SIMPLESEARCH_CAT'.$n)), 1 => constant('UI_SIMPLESEARCH_OP'.$n), 2 => stripslashes($formdata['criterium']) );