diff --git a/livesupport/modules/htmlUI/var/templates/playlist/changeTransition.tpl b/livesupport/modules/htmlUI/var/templates/playlist/changeTransition.tpl new file mode 100755 index 000000000..924223b5d --- /dev/null +++ b/livesupport/modules/htmlUI/var/templates/playlist/changeTransition.tpl @@ -0,0 +1,8 @@ +{include file="header.tpl"} + +{include file="script/PL.changeTransition.js.tpl"} +{include file="sub/dynForm_plain.tpl"} + + + + diff --git a/livesupport/modules/htmlUI/var/templates/scratchPad.tpl b/livesupport/modules/htmlUI/var/templates/scratchPad.tpl index 4fb7c5c9c..35770df9a 100755 --- a/livesupport/modules/htmlUI/var/templates/scratchPad.tpl +++ b/livesupport/modules/htmlUI/var/templates/scratchPad.tpl @@ -33,9 +33,13 @@ [Clear] diff --git a/livesupport/modules/htmlUI/var/ui_base.inc.php b/livesupport/modules/htmlUI/var/ui_base.inc.php index 0f043c26d..10831fadb 100644 --- a/livesupport/modules/htmlUI/var/ui_base.inc.php +++ b/livesupport/modules/htmlUI/var/ui_base.inc.php @@ -280,6 +280,7 @@ class uiBase function _twoDigits($num) { + if (strlen($num) == 1) return "0$num"; if (strlen($num) == 0) diff --git a/livesupport/modules/htmlUI/var/ui_playlist.class.php b/livesupport/modules/htmlUI/var/ui_playlist.class.php index 02f1d6069..d7bea899c 100755 --- a/livesupport/modules/htmlUI/var/ui_playlist.class.php +++ b/livesupport/modules/htmlUI/var/ui_playlist.class.php @@ -133,7 +133,7 @@ class uiPlaylist $r = $this->Base->gb->addAudioClipToPlaylist($this->token, $elemId, $this->Base->sessid); if (PEAR::isError($r)) { print_r($r); - $this->Base->_retMsg('Cannot add Item to Playlist'); + $this->Base->_retMsg('Error on add item to Playlist'); return FALSE; } } @@ -173,7 +173,7 @@ class uiPlaylist $this->Base->_retMsg('Cannot create Playlist'); return FALSE; } - $this->Base->_setMDataValue($plid, 'dc:title', $datetime); + $this->Base->_setMDataValue($plid, UI_MDATA_KEY_TITLE, $datetime); if ($this->activate($plid)===FALSE) { return FALSE; } @@ -208,10 +208,10 @@ class uiPlaylist $this->flat[$parent]['attrs'] = $attrs; } if ($sub['elementname']=='fadeinfo') { - $this->flat[$parent]['fadein'] = $this->_plTimeToSecs($sub['attrs']['fadein']); - $this->flat[$parent]['fadeout'] = $this->_plTimeToSecs($sub['attrs']['fadeout']); - $this->flat[$parent]['fadein_ms'] = $sub['attrs']['fadein'] ? $this->_plTimeToSecs($sub['attrs']['fadein']) * 1000 : 0; - $this->flat[$parent]['fadeout_ms'] = $sub['attrs']['fadeout'] ? $this->_plTimeToSecs($sub['attrs']['fadeout']) * 1000 : 0; + $this->flat[$parent]['fadein'] = GreenBox::_plTimeToSecs($sub['attrs']['fadein']); + $this->flat[$parent]['fadeout'] = GreenBox::_plTimeToSecs($sub['attrs']['fadeout']); + $this->flat[$parent]['fadein_ms'] = $sub['attrs']['fadein'] ? GreenBox::_plTimeToSecs($sub['attrs']['fadein']) * 1000 : 0; + $this->flat[$parent]['fadeout_ms'] = $sub['attrs']['fadeout'] ? GreenBox::_plTimeToSecs($sub['attrs']['fadeout']) * 1000 : 0; } } } @@ -226,32 +226,35 @@ class uiPlaylist switch ($type) { case "fadeX": $item[$prev['attrs']['id']] = - array('fadeIn' => $this->_secsToPlTime($prev['fadein']), - 'fadeOut' => $this->_secsToPlTime($duration/1000)); - $item[$id] = array('fadeIn' => $this->_secsToPlTime($duration/1000), - 'fadeOut' => $this->_secsToPlTime($curr['fadeout'])); + array('fadeIn' => GreenBox::_secsToPlTime($prev['fadein']), + 'fadeOut' => GreenBox::_secsToPlTime($duration/1000)); + $item[$id] = array('fadeIn' => GreenBox::_secsToPlTime($duration/1000), + 'fadeOut' => GreenBox::_secsToPlTime($curr['fadeout'])); break; case "pause": $item[$prev['attrs']['id']] = - array('fadeIn' => $this->_secsToPlTime($prev['fadein']), - 'fadeOut' => $this->_secsToPlTime(-$duration/1000)); - $item[$id] = array('fadeIn' => $this->_secsToPlTime(-$duration/1000), - 'fadeOut' => $this->_secsToPlTime($curr['fadeout'])); + array('fadeIn' => GreenBox::_secsToPlTime($prev['fadein']), + 'fadeOut' => GreenBox::_secsToPlTime(-$duration/1000)); + $item[$id] = array('fadeIn' => GreenBox::_secsToPlTime(-$duration/1000), + 'fadeOut' => GreenBox::_secsToPlTime($curr['fadeout'])); break; case "fadeIn": - $item[$id] = array('fadeIn' => $this->_secsToPlTime($duration/1000), - 'fadeOut' => $this->_secsToPlTime($curr['fadeout'])); + $item[$id] = array('fadeIn' => GreenBox::_secsToPlTime($duration/1000), + 'fadeOut' => GreenBox::_secsToPlTime($curr['fadeout'])); break; case "fadeOut": - $item[$id] = array('fadeIn' => $this->_secsToPlTime($curr['fadein']), - 'fadeOut' => $this->_secsToPlTime($duration/1000)); + $item[$id] = array('fadeIn' => GreenBox::_secsToPlTime($curr['fadein']), + 'fadeOut' => GreenBox::_secsToPlTime($duration/1000)); break; } #print_r($item); foreach ($item as $i=>$val) { - if ($this->Base->gb->changeFadeInfo($this->token, $i, $val['fadeIn'], $val['fadeOut'], $this->Base->sessid) === FALSE) - $this->Base->_retMsg('Feiled: changeFadeInfo'); - return FALSE; + $r = $this->Base->gb->changeFadeInfo($this->token, $i, $val['fadeIn'], $val['fadeOut'], $this->Base->sessid); + #print_r($r); + if (PEAR::isError($r)) { + $this->Base->_retMsg('ChangeFadeInfo failed'); + return FALSE; + } } } diff --git a/livesupport/modules/htmlUI/var/ui_scheduler.class.php b/livesupport/modules/htmlUI/var/ui_scheduler.class.php index 061783d4e..73a453473 100755 --- a/livesupport/modules/htmlUI/var/ui_scheduler.class.php +++ b/livesupport/modules/htmlUI/var/ui_scheduler.class.php @@ -97,11 +97,12 @@ class uiScheduler extends uiCalendar require_once 'Calendar/Month/Weekdays.php'; $Period = new Calendar_Month_Weekdays($this->curr['year'], $this->curr['month'], $this->firstDayOfWeek); $Period->build(); - } - if ($period=='week') { + } elseif ($period=='week') { require_once 'Calendar/Week.php'; $Period = new Calendar_Week ($this->curr['year'], $this->curr['month'], $this->curr['day'], $this->firstDayOfWeek); $Period->build(); + } else { + return array(); } $d = $Period->fetch(); $corrMonth = $d->thisMonth()<=12 ? $this->Base->_twoDigits($d->thisMonth()) : '01'; ## due to bug in @@ -135,8 +136,9 @@ class uiScheduler extends uiCalendar { $dfrom = $dfrom.'T00:00:00'; $dto = $dto.'T23:59:59'; - $pArr = $this->displayScheduleMethod($dfrom, $dto); - #print_r($pArr); + if (($pArr = $this->displayScheduleMethod($dfrom, $dto)) === FALSE) + return array(FALSE);; + foreach ($pArr as $val) { #print_r($val); $pStampArr[] = array('start' => $this->_datetime2timestamp($val['start']), @@ -167,7 +169,16 @@ class uiScheduler extends uiCalendar } } - ## XML-RPC methods ############################################################################################ + function _isError($r) + { + if (is_array($r['error'])) { + $this->Base->_retMsg('Error: $1', $r['error']['message']); + return TRUE; + } + return FALSE; + } + + ## XML-RPC wrapper methods ############################################################################################ function initXmlRpc() { include_once dirname(__FILE__).'/SchedulerPhpClient.class.php'; @@ -182,8 +193,8 @@ class uiScheduler extends uiCalendar #echo "Schedule Gunid: $gunid At: ".$datetime; $r = $this->spc->UploadPlaylistMethod($this->Base->sessid, $gunid, $datetime.UI_TIMEZONE); #print_r($r); - if (is_array($r['error'])) - $this->Base->_retMsg('Error: $1', $r['error']['message']); + if ($this->_isError($r)) + return FALSE; if (isset($r['scheduleEntryId'])) $this->Base->_retMsg('ScheduleId: $1', $r['scheduleEntryId']); } @@ -193,6 +204,8 @@ class uiScheduler extends uiCalendar { #echo $from.$to; $r = $this->spc->displayScheduleMethod($this->Base->sessid, $from, $to); + if ($this->_isError($r)) + return FALSE; return $r; } }