diff --git a/VERSION b/VERSION
new file mode 100644
index 000000000..be6fbdd24
--- /dev/null
+++ b/VERSION
@@ -0,0 +1,2 @@
+PRODUCT_ID=Airtime
+PRODUCT_RELEASE=1.8.0
diff --git a/application/Bootstrap.php b/application/Bootstrap.php
index 4744296d2..277bd9cab 100644
--- a/application/Bootstrap.php
+++ b/application/Bootstrap.php
@@ -59,7 +59,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
protected function _initHeadScript()
{
$view = $this->getResource('view');
- $view->headScript()->appendFile('/js/libs/jquery-1.5.1.min.js','text/javascript');
+ $view->headScript()->appendFile('/js/libs/jquery-1.5.2.min.js','text/javascript');
$view->headScript()->appendFile('/js/libs/jquery-ui-1.8.11.custom.min.js','text/javascript');
$view->headScript()->appendFile('/js/libs/jquery.stickyPanel.js','text/javascript');
$view->headScript()->appendFile('/js/qtip/jquery.qtip-1.0.0.min.js','text/javascript');
diff --git a/application/controllers/NowplayingController.php b/application/controllers/NowplayingController.php
index c4cd02002..2e9d03a03 100644
--- a/application/controllers/NowplayingController.php
+++ b/application/controllers/NowplayingController.php
@@ -6,8 +6,8 @@ class NowplayingController extends Zend_Controller_Action
public function init()
{
$ajaxContext = $this->_helper->getHelper('AjaxContext');
- $ajaxContext->addActionContext('get-data-grid-data', 'json')
- ->initContext();
+ $ajaxContext->addActionContext('get-data-grid-data', 'json')
+ ->initContext();
}
public function indexAction()
@@ -21,7 +21,7 @@ class NowplayingController extends Zend_Controller_Action
{
$viewType = $this->_request->getParam('view');
$dateString = $this->_request->getParam('date');
- $this->view->entries = Application_Model_Nowplaying::GetDataGridData($viewType, $dateString);
+ $this->view->entries = Application_Model_Nowplaying::GetDataGridData($viewType, $dateString);
}
public function livestreamAction()
diff --git a/application/controllers/ScheduleController.php b/application/controllers/ScheduleController.php
index 85d5b13ff..f713dc8cd 100644
--- a/application/controllers/ScheduleController.php
+++ b/application/controllers/ScheduleController.php
@@ -75,6 +75,9 @@ class ScheduleController extends Zend_Controller_Action
$this->view->rr = $formRecord;
$this->view->absoluteRebroadcast = $formAbsoluteRebroadcast;
$this->view->rebroadcast = $formRebroadcast;
+ $this->view->addNewShow = true;
+
+ $formWhat->populate(array('add_show_id' => '-1'));
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id);
@@ -233,15 +236,19 @@ class ScheduleController extends Zend_Controller_Action
if (strtotime($show->getShowStart()) <= strtotime($today_timestamp) &&
strtotime($today_timestamp) < strtotime($show->getShowEnd()) &&
$user->isAdmin() && !$show->isRecorded()) {
- $menu[] = array('action' => array('type' => 'fn',
- 'callback' => "window['confirmCancelShow']($id)"),
- 'title' => 'Cancel Current Show');
+ $menu[] = array('action' => array('type' => 'fn',
+ 'callback' => "window['confirmCancelShow']($id)"),
+ 'title' => 'Cancel Current Show');
}
if (strtotime($today_timestamp) < strtotime($show->getShowStart())) {
if ($user->isAdmin()) {
+ $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/edit-show/format/json/id/'.$id,
+ 'callback' => 'window["beginEditShow"]'), 'title' => 'Edit Show');
+ //$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/cancel-show'.$params,
+ // 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Edit This Instance and All Following');
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/delete-show'.$params,
'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Delete This Instance');
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/cancel-show'.$params,
@@ -393,9 +400,99 @@ class ScheduleController extends Zend_Controller_Action
public function editShowAction()
{
$showInstanceId = $this->_getParam('id');
- $showInstance = new ShowInstance($showInstanceId);
+
+ $formWhat = new Application_Form_AddShowWhat();
+ $formWho = new Application_Form_AddShowWho();
+ $formWhen = new Application_Form_AddShowWhen();
+ $formRepeats = new Application_Form_AddShowRepeats();
+ $formStyle = new Application_Form_AddShowStyle();
+ $formRecord = new Application_Form_AddShowRR();
+ $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates();
+ $formRebroadcast = new Application_Form_AddShowRebroadcastDates();
+ $formWhat->removeDecorator('DtDdWrapper');
+ $formWho->removeDecorator('DtDdWrapper');
+ $formWhen->removeDecorator('DtDdWrapper');
+ $formRepeats->removeDecorator('DtDdWrapper');
+ $formStyle->removeDecorator('DtDdWrapper');
+ $formRecord->removeDecorator('DtDdWrapper');
+ $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper');
+ $formRebroadcast->removeDecorator('DtDdWrapper');
+
+ $this->view->what = $formWhat;
+ $this->view->when = $formWhen;
+ $this->view->repeats = $formRepeats;
+ $this->view->who = $formWho;
+ $this->view->style = $formStyle;
+ $this->view->rr = $formRecord;
+ $this->view->absoluteRebroadcast = $formAbsoluteRebroadcast;
+ $this->view->rebroadcast = $formRebroadcast;
+ $this->view->addNewShow = false;
+
+ $showInstance = new ShowInstance($showInstanceId);
$show = new Show($showInstance->getShowId());
+
+ $formWhat->populate(array('add_show_id' => $show->getId(),
+ 'add_show_name' => $show->getName(),
+ 'add_show_url' => $show->getUrl(),
+ 'add_show_genre' => $show->getGenre(),
+ 'add_show_description' => $show->getDescription()));
+
+ $formWhen->populate(array('add_show_start_date' => $show->getStartDate(),
+ 'add_show_start_time' => Show::removeSecondsFromTime($show->getStartTime()),
+ 'add_show_duration' => $show->getDuration(),
+ 'add_show_repeats' => $show->isRepeating() ? 1 : 0));
+
+ $days = array();
+ $showDays = CcShowDaysQuery::create()->filterByDbShowId($showInstance->getShowId())->find();
+ foreach($showDays as $showDay){
+ array_push($days, $showDay->getDbDay());
+ }
+
+ $formRepeats->populate(array('add_show_repeat_type' => $show->getRepeatType(),
+ 'add_show_day_check' => $days,
+ 'add_show_end_date' => $show->getRepeatingEndDate(),
+ 'add_show_no_end' => ($show->getRepeatingEndDate() == '')));
+
+ $formRecord->populate(array('add_show_record' => $show->isRecorded(),
+ 'add_show_rebroadcast' => $show->isRebroadcast()));
+ $formRecord->getElement('add_show_record')->setOptions(array('disabled' => true));
+
+
+
+ $rebroadcastsRelative = $show->getRebroadcastsRelative();
+ $rebroadcastFormValues = array();
+ $i = 1;
+ foreach ($rebroadcastsRelative as $rebroadcast){
+ $rebroadcastFormValues["add_show_rebroadcast_date_$i"] = $rebroadcast['day_offset'];
+ $rebroadcastFormValues["add_show_rebroadcast_time_$i"] = Show::removeSecondsFromTime($rebroadcast['start_time']);
+ $i++;
+ }
+ $formRebroadcast->populate($rebroadcastFormValues);
+
+ $rebroadcastsAbsolute = $show->getRebroadcastsAbsolute();
+ $rebroadcastAbsoluteFormValues = array();
+ $i = 1;
+ foreach ($rebroadcastsAbsolute as $rebroadcast){
+ $rebroadcastAbsoluteFormValues["add_show_rebroadcast_absolute_date_$i"] = $rebroadcast['start_date'];
+ $rebroadcastAbsoluteFormValues["add_show_rebroadcast_absolute_time_$i"] = Show::removeSecondsFromTime($rebroadcast['start_time']);
+ $i++;
+ }
+ $formAbsoluteRebroadcast->populate($rebroadcastAbsoluteFormValues);
+
+ $hosts = array();
+ $showHosts = CcShowHostsQuery::create()->filterByDbShow($showInstance->getShowId())->find();
+ foreach($showHosts as $showHost){
+ array_push($hosts, $showHost->getDbHost());
+ }
+ $formWho->populate(array('add_show_hosts' => $hosts));
+
+
+ $formStyle->populate(array('add_show_background_color' => $show->getBackgroundColor(),
+ 'add_show_color' => $show->getColor()));
+
+ $this->view->newForm = $this->view->render('schedule/add-show-form.phtml');
+ $this->view->entries = 5;
}
public function addShowAction()
@@ -407,6 +504,7 @@ class ScheduleController extends Zend_Controller_Action
foreach($js as $j){
$data[$j["name"]] = $j["value"];
}
+
$data['add_show_hosts'] = $this->_getParam('hosts');
$data['add_show_day_check'] = $this->_getParam('days');
@@ -440,6 +538,7 @@ class ScheduleController extends Zend_Controller_Action
$this->view->rr = $formRecord;
$this->view->absoluteRebroadcast = $formAbsoluteRebroadcast;
$this->view->rebroadcast = $formRebroadcast;
+ $this->view->addNewShow = true;
$what = $formWhat->isValid($data);
$when = $formWhen->isValid($data);
@@ -494,11 +593,13 @@ class ScheduleController extends Zend_Controller_Action
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id);
if ($user->isAdmin()) {
- Show::create($data);
+ Show::create($data);
}
//send back a new form for the user.
$formWhat->reset();
+ $formWhat->populate(array('add_show_id' => '-1'));
+
$formWho->reset();
$formWhen->reset();
$formWhen->populate(array('add_show_start_date' => date("Y-m-d"),
diff --git a/application/forms/AddShowRepeats.php b/application/forms/AddShowRepeats.php
index 36d9a3f7e..da8a0d306 100644
--- a/application/forms/AddShowRepeats.php
+++ b/application/forms/AddShowRepeats.php
@@ -57,15 +57,17 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
public function checkReliantFields($formData) {
- $start_timestamp = $formData['add_show_start_date'];
- $end_timestamp = $formData['add_show_end_date'];
+ if (!$formData['add_show_no_end']){
+ $start_timestamp = $formData['add_show_start_date'];
+ $end_timestamp = $formData['add_show_end_date'];
+
+ $start_epoch = strtotime($start_timestamp);
+ $end_epoch = strtotime($end_timestamp);
- $start_epoch = strtotime($start_timestamp);
- $end_epoch = strtotime($end_timestamp);
-
- if($end_epoch < $start_epoch) {
- $this->getElement('add_show_end_date')->setErrors(array('End date must be after start date'));
- return false;
+ if($end_epoch < $start_epoch) {
+ $this->getElement('add_show_end_date')->setErrors(array('End date must be after start date'));
+ return false;
+ }
}
return true;
diff --git a/application/forms/AddShowWhat.php b/application/forms/AddShowWhat.php
index 7a3b35371..b3e78d192 100644
--- a/application/forms/AddShowWhat.php
+++ b/application/forms/AddShowWhat.php
@@ -5,6 +5,12 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm
public function init()
{
+ // Hidden element to indicate whether the show is new or
+ // whether we are updating an existing show.
+ $this->addElement('hidden', 'add_show_id', array(
+ 'decorators' => array('ViewHelper')
+ ));
+
// Add name element
$this->addElement('text', 'add_show_name', array(
'label' => 'Name:',
diff --git a/application/models/Shows.php b/application/models/Shows.php
index 1fd1bda42..6be170dd9 100644
--- a/application/models/Shows.php
+++ b/application/models/Shows.php
@@ -2,11 +2,11 @@
class Show {
- private $_showId;
+ private $_showId;
- public function __construct($showId=NULL)
+ public function __construct($showId=NULL)
{
- $this->_showId = $showId;
+ $this->_showId = $showId;
}
public function getName()
@@ -46,8 +46,32 @@ class Show {
$show->setDbColor($color);
}
- public function getBackgroundColor()
- {
+ public function getUrl()
+ {
+ $show = CcShowQuery::create()->findPK($this->_showId);
+ return $show->getDbUrl();
+ }
+
+ public function setUrl($p_url)
+ {
+ $show = CcShowQuery::create()->findPK($this->_showId);
+ $show->setDbUrl($p_url);
+ }
+
+ public function getGenre()
+ {
+ $show = CcShowQuery::create()->findPK($this->_showId);
+ return $show->getDbGenre();
+ }
+
+ public function setGenre($p_genre)
+ {
+ $show = CcShowQuery::create()->findPK($this->_showId);
+ $show->setDbGenre($p_genre);
+ }
+
+ public function getBackgroundColor()
+ {
$show = CcShowQuery::create()->findPK($this->_showId);
return $show->getDbBackgroundColor();
}
@@ -69,7 +93,7 @@ class Show {
$sql = "SELECT first_name, last_name
FROM cc_show_hosts LEFT JOIN cc_subjs ON cc_show_hosts.subjs_id = cc_subjs.id
- WHERE show_id = {$this->_showId}";
+ WHERE show_id = {$this->_showId}";
$hosts = $CC_DBC->GetAll($sql);
@@ -92,12 +116,415 @@ class Show {
->update(array('DbLastShow' => $timeinfo[0]));
$sql = "DELETE FROM cc_show_instances
- WHERE starts >= '{$day_timestamp}' AND show_id = {$this->_showId}";
+ WHERE starts >= '{$day_timestamp}' AND show_id = {$this->_showId}";
$CC_DBC->query($sql);
RabbitMq::PushSchedule();
}
+ /**
+ * Remove Show Instances that occur on days of the week specified
+ * by input array. For example, if array contains one value of "0",
+ * then all show instances that occur on Sunday are removed.
+ *
+ * @param array p_uncheckedDays
+ * An array specifying which days
+ */
+ public function removeUncheckedDaysInstances($p_uncheckedDays)
+ {
+ global $CC_DBC;
+
+ $uncheckedDaysImploded = implode(",", $p_uncheckedDays);
+ $showId = $this->getId();
+ $sql = "DELETE FROM cc_show_instances"
+ ." WHERE EXTRACT(DOW FROM starts) IN ($uncheckedDaysImploded)"
+ ." AND starts > current_timestamp "
+ ." AND show_id = $showId";
+
+ $CC_DBC->query($sql);
+ }
+
+ /**
+ * Check whether the current show originated
+ * from a recording.
+ *
+ * @return boolean
+ * true if originated from recording, otherwise false.
+ */
+ public function isRecorded(){
+ $showInstancesRow = CcShowInstancesQuery::create()
+ ->filterByDbShowId($this->getId())
+ ->filterByDbRecord(1)
+ ->findOne();
+
+ return !is_null($showInstancesRow);
+ }
+
+ /**
+ * Check whether the current show has rebroadcasts of a recorded
+ * show. Should be used in conjunction with isRecorded().
+ *
+ * @return boolean
+ * true if show has rebroadcasts, otherwise false.
+ */
+ public function isRebroadcast()
+ {
+ $showInstancesRow = CcShowInstancesQuery::create()
+ ->filterByDbShowId($this->_showId)
+ ->filterByDbRebroadcast(1)
+ ->findOne();
+
+ return !is_null($showInstancesRow);
+ }
+
+ public function getRebroadcastsAbsolute()
+ {
+ global $CC_DBC;
+
+ $showId = $this->getId();
+ $sql = "SELECT date(starts) "
+ ."FROM cc_show_instances "
+ ."WHERE show_id = $showId "
+ ."AND record = 1";
+ $baseDate = $CC_DBC->GetOne($sql);
+
+ if (is_null($baseDate)){
+ return array();
+ }
+
+ $sql = "SELECT date(DATE '$baseDate' + day_offset::INTERVAL) as start_date, start_time FROM cc_show_rebroadcast "
+ ."WHERE show_id = $showId "
+ ."ORDER BY start_date";
+
+ return $CC_DBC->GetAll($sql);
+ }
+
+ public function getRebroadcastsRelative()
+ {
+ global $CC_DBC;
+
+ $showId = $this->getId();
+ $sql = "SELECT day_offset, start_time FROM cc_show_rebroadcast "
+ ."WHERE show_id = $showId "
+ ."ORDER BY day_offset";
+
+ return $CC_DBC->GetAll($sql);
+ }
+
+ /**
+ * Check whether the current show is set to repeat
+ * repeating shows.
+ *
+ * @return boolean
+ * true if repeating shows, otherwise false.
+ */
+ public function isRepeating()
+ {
+ $showDaysRow = CcShowDaysQuery::create()
+ ->filterByDbShowId($this->_showId)
+ ->findOne();
+
+ if (!is_null($showDaysRow)){
+ return ($showDaysRow->getDbRepeatType() != -1);
+ } else
+ return false;
+ }
+
+ /**
+ * Get the repeat type of the show. Show can have repeat
+ * type of "weekly", "bi-weekly" and "monthly". These values
+ * are represented by 0, 1, and 2 respectively.
+ *
+ * @return int
+ * Return the integer corresponding to the repeat type.
+ */
+ public function getRepeatType()
+ {
+ $showDaysRow = CcShowDaysQuery::create()
+ ->filterByDbShowId($this->_showId)
+ ->findOne();
+
+ if (!is_null($showDaysRow)){
+ return $showDaysRow->getDbRepeatType();
+ } else
+ return -1;
+ }
+
+ /**
+ * Get the end date for a repeating show in the format yyyy-mm-dd
+ *
+ * @return string
+ * Return the end date for the repeating show or the empty
+ * string if there is no end.
+ */
+ public function getRepeatingEndDate(){
+ global $CC_DBC;
+
+ $showId = $this->getId();
+ $sql = "SELECT last_show FROM cc_show_days"
+ ." WHERE show_id = $showId";
+
+ $endDate = $CC_DBC->GetOne($sql);
+
+ if (is_null($endDate)){
+ return "";
+ } else {
+ return $endDate;
+ }
+ }
+
+ public function deleteAllInstances(){
+ global $CC_DBC;
+
+ $showId = $this->getId();
+ $sql = "DELETE FROM cc_show_instances "
+ ."WHERE starts > current_timestamp "
+ ."AND show_id = $showId";
+
+ $CC_DBC->query($sql);
+ }
+
+ public function removeAllInstancesAfterDate($p_date){
+ global $CC_DBC;
+
+ $showId = $this->getId();
+ $sql = "DELETE FROM cc_show_instances "
+ ."WHERE date(starts) > DATE '$p_date' "
+ ."AND starts > current_timestamp "
+ ."AND show_id = $showId";
+
+ $CC_DBC->query($sql);
+ }
+
+ public function removeAllInstancesBeforeDate($p_date){
+ global $CC_DBC;
+
+ $showId = $this->getId();
+ $sql = "DELETE FROM cc_show_instances "
+ ."WHERE date(starts) < DATE '$p_date' "
+ ."AND starts > current_timestamp "
+ ."AND show_id = $showId";
+
+ $CC_DBC->query($sql);
+ }
+
+ public function getStartDate(){
+ global $CC_DBC;
+
+ $showId = $this->getId();
+ $sql = "SELECT first_show FROM cc_show_days"
+ ." WHERE show_id = $showId";
+
+ $firstDate = $CC_DBC->GetOne($sql);
+
+ if (is_null($firstDate)){
+ return "";
+ } else {
+ return $firstDate;
+ }
+ }
+
+ public function getStartTime(){
+ global $CC_DBC;
+
+ $showId = $this->getId();
+ $sql = "SELECT start_time FROM cc_show_days"
+ ." WHERE show_id = $showId";
+
+ $startTime = $CC_DBC->GetOne($sql);
+
+ if (is_null($startTime)){
+ return "";
+ } else {
+ return $startTime;
+ }
+ }
+
+ public function getAllFutureInstanceIds(){
+ global $CC_DBC;
+
+ $showId = $this->getId();
+ $sql = "SELECT id from cc_show_instances "
+ ." WHERE show_id = $showId"
+ ." AND starts > current_timestamp";
+
+ $rows = $CC_DBC->GetAll($sql);
+
+ $instance_ids = array();
+ foreach ($rows as $row){
+ $instance_ids[] = $row["id"];
+ }
+ return $instance_ids;
+ }
+
+ private function updateDurationTime($p_data){
+ //need to update cc_show_instances, cc_show_days
+
+ global $CC_DBC;
+
+ $sql = "UPDATE cc_show_days "
+ ."SET duration = '$p_data[add_show_duration]' "
+ ."WHERE show_id = $p_data[add_show_id]";
+ $CC_DBC->query($sql);
+
+ $sql = "UPDATE cc_show_instances "
+ ."SET ends = starts + INTERVAL '$p_data[add_show_duration]' "
+ ."WHERE show_id = $p_data[add_show_id] "
+ ."AND starts > current_timestamp";
+ $CC_DBC->query($sql);
+
+ }
+
+ private function updateStartDateTime($p_data, $p_endDate){
+ //need to update cc_schedule, cc_show_instances, cc_show_days
+
+ global $CC_DBC;
+
+ $sql = "UPDATE cc_show_days "
+ ."SET start_time = TIME '$p_data[add_show_start_time]', "
+ ."first_show = DATE '$p_data[add_show_start_date]', ";
+ if (strlen ($p_endDate) == 0){
+ $sql .= "last_show = NULL ";
+ } else {
+ $sql .= "last_show = DATE '$p_endDate' ";
+ }
+ $sql .= "WHERE show_id = $p_data[add_show_id]";
+ $CC_DBC->query($sql);
+
+ $oldStartDateTimeEpoch = strtotime($this->getStartDate()." ".$this->getStartTime());
+ $newStartDateTimeEpoch = strtotime($p_data['add_show_start_date']." ".$p_data['add_show_start_time']);
+ $diff = $newStartDateTimeEpoch - $oldStartDateTimeEpoch;
+
+ $sql = "UPDATE cc_show_instances "
+ ."SET starts = starts + INTERVAL '$diff sec', "
+ ."ends = ends + INTERVAL '$diff sec' "
+ ."WHERE show_id = $p_data[add_show_id] "
+ ."AND starts > current_timestamp";
+ $CC_DBC->query($sql);
+
+ $showInstanceIds = $this->getAllFutureInstanceIds();
+ if (count($showInstanceIds) > 0 && $diff != 0){
+ $showIdsImploded = implode(",", $showInstanceIds);
+ $sql = "UPDATE cc_schedule "
+ ."SET starts = starts + INTERVAL '$diff sec', "
+ ."ends = ends + INTERVAL '$diff sec' "
+ ."WHERE instance_id IN ($showIdsImploded)";
+ $CC_DBC->query($sql);
+ }
+ }
+
+ public function getDuration(){
+ $showDay = CcShowDaysQuery::create()->filterByDbShowId($this->getId())->findOne();
+ return $showDay->getDbDuration();
+ }
+
+ public function getShowDays(){
+ $showDays = CcShowDaysQuery::create()->filterByDbShowId($this->getId())->find();
+
+ $days = array();
+ foreach ($showDays as $showDay){
+ array_push($days, $showDay->getDbDay());
+ }
+
+ return $days;
+ }
+
+ public function hasInstance(){
+ return (!is_null($this->getInstance()));
+ }
+
+ public function getInstance(){
+ $showInstances = CcShowInstancesQuery::create()->filterByDbShowId($this->getId())->findOne();
+ return $showInstances;
+ }
+
+ public function hasInstanceOnDate($p_timestamp){
+ return (!is_null($this->getInstanceOnDate($p_timestamp)));
+ }
+
+ public function getInstanceOnDate($p_timestamp){
+ global $CC_DBC;
+
+ $showId = $this->getId();
+ $sql = "SELECT id FROM cc_show_instances"
+ ." WHERE date(starts) = date(TIMESTAMP '$p_timestamp') "
+ ." AND show_id = $showId";
+
+ $row = $CC_DBC->GetOne($sql);
+ return CcShowInstancesQuery::create()->findPk($row);
+ }
+
+ public static function deletePossiblyInvalidInstances($p_data, $p_show, $p_endDate, $isRecorded, $repeatType)
+ {
+ if ($p_data['add_show_repeats'] != $p_show->isRepeating()
+ || $isRecorded){
+ //repeat option was toggled or show is recorded.
+ $p_show->deleteAllInstances();
+ }
+ if ($p_data['add_show_start_date'] != $p_show->getStartDate()
+ || $p_data['add_show_start_time'] != $p_show->getStartTime()){
+ //start date/time has changed
+
+ $newDate = strtotime($p_data['add_show_start_date']);
+ $oldDate = strtotime($p_show->getStartDate());
+ if ($newDate > $oldDate){
+ $p_show->removeAllInstancesBeforeDate($p_data['add_show_start_date']);
+ }
+
+ $p_show->updateStartDateTime($p_data, $p_endDate);
+ }
+ if ($p_data['add_show_duration'] != $p_show->getDuration()){
+ //duration has changed
+ $p_show->updateDurationTime($p_data);
+ }
+
+ if ($p_data['add_show_repeats']){
+ if ($repeatType != $p_show->getRepeatType()){
+ //repeat type changed.
+ $p_show->deleteAllInstances();
+ } else {
+ //repeat type is the same, check if the days of the week are the same
+ $repeatingDaysChanged = false;
+ $showDaysArray = $p_show->getShowDays();
+ if (count($p_data['add_show_day_check']) == count($showDaysArray)){
+ //same number of days checked, lets see if they are the same numbers
+ $intersect = array_intersect($p_data['add_show_day_check'], $showDaysArray);
+ if (count($intersect) != count($p_data['add_show_day_check'])){
+ $repeatingDaysChanged = true;
+ }
+ } else {
+ $repeatingDaysChanged = true;
+ }
+
+ if ($repeatingDaysChanged){
+ $daysRemoved = array_diff($showDaysArray, $p_data['add_show_day_check']);
+
+ if (count($daysRemoved) > 0){
+ $p_show->removeUncheckedDaysInstances($daysRemoved);
+ }
+ }
+ }
+
+ //Check if end date for the repeat option has changed. If so, need to take care
+ //of deleting possible invalid Show Instances.
+ if ((strlen($p_show->getRepeatingEndDate()) == 0) == $p_data['add_show_no_end']){
+ //show "Never Ends" option was toggled.
+ if ($p_data['add_show_no_end']){
+ } else {
+ $p_show->removeAllInstancesAfterDate($p_endDate);
+ }
+ }
+ if ($p_show->getRepeatingEndDate() != $p_data['add_show_end_date']){
+ //end date was changed.
+
+ $newDate = strtotime($p_data['add_show_end_date']);
+ $oldDate = strtotime($p_show->getRepeatingEndDate());
+ if ($newDate < $oldDate){
+ $p_show->removeAllInstancesAfterDate($p_endDate);
+ }
+ }
+ }
+ }
/**
* Create a show.
@@ -109,112 +536,125 @@ class Show {
* Show ID
*/
public static function create($data)
- {
- $con = Propel::getConnection(CcShowPeer::DATABASE_NAME);
+ {
+ $con = Propel::getConnection(CcShowPeer::DATABASE_NAME);
- $sql = "SELECT time '{$data['add_show_start_time']}' + INTERVAL '{$data['add_show_duration']} hour' ";
- $r = $con->query($sql);
- $endTime = $r->fetchColumn(0);
-
- $sql = "SELECT EXTRACT(DOW FROM TIMESTAMP '{$data['add_show_start_date']} {$data['add_show_start_time']}')";
- $r = $con->query($sql);
+ $sql = "SELECT EXTRACT(DOW FROM TIMESTAMP '{$data['add_show_start_date']} {$data['add_show_start_time']}')";
+ $r = $con->query($sql);
$startDow = $r->fetchColumn(0);
- if ($data['add_show_no_end']) {
- $endDate = NULL;
- $data['add_show_repeats'] = 1;
- }
- else if ($data['add_show_repeats']) {
- $sql = "SELECT date '{$data['add_show_end_date']}' + INTERVAL '1 day' ";
- $r = $con->query($sql);
- $endDate = $r->fetchColumn(0);
- }
- else {
- $sql = "SELECT date '{$data['add_show_start_date']}' + INTERVAL '1 day' ";
- $r = $con->query($sql);
- $endDate = $r->fetchColumn(0);
- }
+ if ($data['add_show_no_end']) {
+ $endDate = NULL;
+ //$data['add_show_repeats'] = 1;
+ }
+ else if ($data['add_show_repeats']) {
+ $sql = "SELECT date '{$data['add_show_end_date']}' + INTERVAL '1 day' ";
+ $r = $con->query($sql);
+ $endDate = $r->fetchColumn(0);
+ }
+ else {
+ $sql = "SELECT date '{$data['add_show_start_date']}' + INTERVAL '1 day' ";
+ $r = $con->query($sql);
+ $endDate = $r->fetchColumn(0);
+ }
//only want the day of the week from the start date.
- if (!$data['add_show_repeats']) {
- $data['add_show_day_check'] = array($startDow);
- }
- else if ($data['add_show_repeats'] && $data['add_show_day_check'] == "") {
+ if (!$data['add_show_repeats']) {
+ $data['add_show_day_check'] = array($startDow);
+ } else if ($data['add_show_repeats'] && $data['add_show_day_check'] == "") {
$data['add_show_day_check'] = array($startDow);
}
//find repeat type or set to a non repeating show.
- if ($data['add_show_repeats']) {
- $repeat_type = $data["add_show_repeat_type"];
- }
- else {
- $repeat_type = -1;
- }
+ $repeatType = ($data['add_show_repeats']) ? $data['add_show_repeat_type'] : -1;
- $show = new CcShow();
- $show->setDbName($data['add_show_name']);
- $show->setDbDescription($data['add_show_description']);
- $show->setDbUrl($data['add_show_url']);
- $show->setDbGenre($data['add_show_genre']);
- $show->setDbColor($data['add_show_color']);
- $show->setDbBackgroundColor($data['add_show_background_color']);
- $show->save();
-
- $showId = $show->getDbId();
-
- if ($data['add_show_record']){
- $isRecorded = 1;
- }
- else {
- $isRecorded = 0;
+ if ($data['add_show_id'] == -1){
+ $ccShow = new CcShow();
+ } else {
+ $ccShow = CcShowQuery::create()->findPK($data['add_show_id']);
}
+ $ccShow->setDbName($data['add_show_name']);
+ $ccShow->setDbDescription($data['add_show_description']);
+ $ccShow->setDbUrl($data['add_show_url']);
+ $ccShow->setDbGenre($data['add_show_genre']);
+ $ccShow->setDbColor($data['add_show_color']);
+ $ccShow->setDbBackgroundColor($data['add_show_background_color']);
+ $ccShow->save();
+ $showId = $ccShow->getDbId();
+ $show = new Show($showId);
+
+ //If show is a new show (not updated), then get
+ //isRecorded from POST data. Otherwise get it from
+ //the database since the user is not allowed to
+ //update this option.
+ if ($data['add_show_id'] == -1){
+ $isRecorded = ($data['add_show_record']) ? 1 : 0;
+ } else {
+ $isRecorded = $show->isRecorded();
+ }
+
+
+ if ($data['add_show_id'] != -1){
+ Show::deletePossiblyInvalidInstances($data, $show, $endDate, $isRecorded, $repeatType);
+ }
+
+ //check if we are adding or updating a show, and if updating
+ //erase all the show's show_days information first.
+ if ($data['add_show_id'] != -1){
+ CcShowDaysQuery::create()->filterByDbShowId($data['add_show_id'])->delete();
+ }
+
//don't set day for monthly repeat type, it's invalid.
- if ($data['add_show_repeats'] && $data["add_show_repeat_type"] == 2) {
+ if ($data['add_show_repeats'] && $data['add_show_repeat_type'] == 2){
$showDay = new CcShowDays();
- $showDay->setDbFirstShow($data['add_show_start_date']);
- $showDay->setDbLastShow($endDate);
- $showDay->setDbStartTime($data['add_show_start_time']);
- $showDay->setDbDuration($data['add_show_duration']);
- $showDay->setDbRepeatType($repeat_type);
- $showDay->setDbShowId($showId);
+ $showDay->setDbFirstShow($data['add_show_start_date']);
+ $showDay->setDbLastShow($endDate);
+ $showDay->setDbStartTime($data['add_show_start_time']);
+ $showDay->setDbDuration($data['add_show_duration']);
+ $showDay->setDbRepeatType($repeatType);
+ $showDay->setDbShowId($showId);
$showDay->setDbRecord($isRecorded);
- $showDay->save();
- }
- else {
+ $showDay->save();
+ } else {
foreach ($data['add_show_day_check'] as $day) {
- if ($startDow !== $day){
+ if ($startDow !== $day){
- if ($startDow > $day)
- $daysAdd = 6 - $startDow + 1 + $day;
- else
- $daysAdd = $day - $startDow;
+ if ($startDow > $day)
+ $daysAdd = 6 - $startDow + 1 + $day;
+ else
+ $daysAdd = $day - $startDow;
- $sql = "SELECT date '{$data['add_show_start_date']}' + INTERVAL '{$daysAdd} day' ";
- $r = $con->query($sql);
- $start = $r->fetchColumn(0);
- }
- else {
- $start = $data['add_show_start_date'];
- }
+ $sql = "SELECT date '{$data['add_show_start_date']}' + INTERVAL '{$daysAdd} day' ";
+ $r = $con->query($sql);
+ $start = $r->fetchColumn(0);
+ }
+ else {
+ $start = $data['add_show_start_date'];
+ }
if (strtotime($start) < strtotime($endDate) || is_null($endDate)) {
- $showDay = new CcShowDays();
- $showDay->setDbFirstShow($start);
- $showDay->setDbLastShow($endDate);
- $showDay->setDbStartTime($data['add_show_start_time']);
- $showDay->setDbDuration($data['add_show_duration']);
- $showDay->setDbDay($day);
- $showDay->setDbRepeatType($repeat_type);
- $showDay->setDbShowId($showId);
+ $showDay = new CcShowDays();
+ $showDay->setDbFirstShow($start);
+ $showDay->setDbLastShow($endDate);
+ $showDay->setDbStartTime($data['add_show_start_time']);
+ $showDay->setDbDuration($data['add_show_duration']);
+ $showDay->setDbDay($day);
+ $showDay->setDbRepeatType($repeatType);
+ $showDay->setDbShowId($showId);
$showDay->setDbRecord($isRecorded);
- $showDay->save();
+ $showDay->save();
}
- }
+ }
}
+ //check if we are adding or updating a show, and if updating
+ //erase all the show's show_rebroadcast information first.
+ if ($data['add_show_id'] != -1){
+ CcShowRebroadcastQuery::create()->filterByDbShowId($data['add_show_id'])->delete();
+ }
//adding rows to cc_show_rebroadcast
- if ($data['add_show_record'] && $data['add_show_rebroadcast'] && $repeat_type != -1) {
+ if ($isRecorded && $data['add_show_rebroadcast'] && $repeatType != -1) {
for ($i=1; $i<=5; $i++) {
@@ -226,15 +666,14 @@ class Show {
$showRebroad->save();
}
}
- }
- else if ($data['add_show_record'] && $data['add_show_rebroadcast'] && $repeat_type == -1){
+ } else if ($isRecorded && $data['add_show_rebroadcast'] && $repeatType == -1){
for ($i=1; $i<=5; $i++) {
if ($data['add_show_rebroadcast_absolute_date_'.$i]) {
$sql = "SELECT date '{$data['add_show_rebroadcast_absolute_date_'.$i]}' - date '{$data['add_show_start_date']}' ";
- $r = $con->query($sql);
- $offset_days = $r->fetchColumn(0);
+ $r = $con->query($sql);
+ $offset_days = $r->fetchColumn(0);
$showRebroad = new CcShowRebroadcast();
$showRebroad->setDbDayOffset($offset_days." days");
@@ -245,20 +684,25 @@ class Show {
}
}
+ //check if we are adding or updating a show, and if updating
+ //erase all the show's show_rebroadcast information first.
+ if ($data['add_show_id'] != -1){
+ CcShowHostsQuery::create()->filterByDbShow($data['add_show_id'])->delete();
+ }
if (is_array($data['add_show_hosts'])) {
//add selected hosts to cc_show_hosts table.
- foreach ($data['add_show_hosts'] as $host) {
- $showHost = new CcShowHosts();
- $showHost->setDbShow($showId);
- $showHost->setDbHost($host);
- $showHost->save();
- }
+ foreach ($data['add_show_hosts'] as $host) {
+ $showHost = new CcShowHosts();
+ $showHost->setDbShow($showId);
+ $showHost->setDbHost($host);
+ $showHost->save();
+ }
}
Show::populateShowUntil($showId);
RabbitMq::PushSchedule();
return $showId;
- }
+ }
/**
* Get all the show instances in the given time range.
@@ -312,8 +756,7 @@ class Show {
$sql = $sql." AND ({$exclude})";
}
- //echo $sql;
- return $CC_DBC->GetAll($sql);
+ return $CC_DBC->GetAll($sql);
}
private static function setNextPop($next_date, $show_id, $day)
@@ -341,29 +784,37 @@ class Show {
$start = $next_date;
$sql = "SELECT timestamp '{$start}' + interval '{$duration}'";
- $end = $CC_DBC->GetOne($sql);
+ $end = $CC_DBC->GetOne($sql);
+
+ $show = new Show($show_id);
+ if ($show->hasInstance()){
+ $showInstance = $show->getInstance();
+ } else {
+ $showInstance = new CcShowInstances();
+ }
+
+ $showInstance->setDbShowId($show_id);
+ $showInstance->setDbStarts($start);
+ $showInstance->setDbEnds($end);
+ $showInstance->setDbRecord($record);
+ $showInstance->save();
+ //$show->addInstance($showInstance);
+
- $newShow = new CcShowInstances();
- $newShow->setDbShowId($show_id);
- $newShow->setDbStarts($start);
- $newShow->setDbEnds($end);
- $newShow->setDbRecord($record);
- $newShow->save();
-
- $show_instance_id = $newShow->getDbId();
+ $show_instance_id = $showInstance->getDbId();
$sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id={$show_id}";
- $rebroadcasts = $CC_DBC->GetAll($sql);
+ $rebroadcasts = $CC_DBC->GetAll($sql);
foreach($rebroadcasts as $rebroadcast) {
$timeinfo = explode(" ", $start);
$sql = "SELECT timestamp '{$timeinfo[0]}' + interval '{$rebroadcast["day_offset"]}' + interval '{$rebroadcast["start_time"]}'";
- $rebroadcast_start_time = $CC_DBC->GetOne($sql);
+ $rebroadcast_start_time = $CC_DBC->GetOne($sql);
$sql = "SELECT timestamp '{$rebroadcast_start_time}' + interval '{$duration}'";
- $rebroadcast_end_time = $CC_DBC->GetOne($sql);
+ $rebroadcast_end_time = $CC_DBC->GetOne($sql);
$newRebroadcastInstance = new CcShowInstances();
$newRebroadcastInstance->setDbShowId($show_id);
@@ -372,7 +823,7 @@ class Show {
$newRebroadcastInstance->setDbRecord(0);
$newRebroadcastInstance->setDbRebroadcast(1);
$newRebroadcastInstance->setDbOriginalShow($show_instance_id);
- $newRebroadcastInstance->save();
+ $newRebroadcastInstance->save();
}
}
RabbitMq::PushSchedule();
@@ -392,33 +843,40 @@ class Show {
}
$sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id={$show_id}";
- $rebroadcasts = $CC_DBC->GetAll($sql);
+ $rebroadcasts = $CC_DBC->GetAll($sql);
+ $show = new Show($show_id);
while(strtotime($next_date) < strtotime($end_timestamp) && (strtotime($last_show) > strtotime($next_date) || is_null($last_show))) {
$start = $next_date;
$sql = "SELECT timestamp '{$start}' + interval '{$duration}'";
- $end = $CC_DBC->GetOne($sql);
+ $end = $CC_DBC->GetOne($sql);
+
+ if ($show->hasInstanceOnDate($start)){
+ $showInstance = $show->getInstanceOnDate($start);
+ } else {
+ $showInstance = new CcShowInstances();
+ }
+ $showInstance->setDbShowId($show_id);
+ $showInstance->setDbStarts($start);
+ $showInstance->setDbEnds($end);
+ $showInstance->setDbRecord($record);
+ $showInstance->save();
+ //$show->addInstance($showInstance);
+
- $newShow = new CcShowInstances();
- $newShow->setDbShowId($show_id);
- $newShow->setDbStarts($start);
- $newShow->setDbEnds($end);
- $newShow->setDbRecord($record);
- $newShow->save();
-
- $show_instance_id = $newShow->getDbId();
+ $show_instance_id = $showInstance->getDbId();
foreach($rebroadcasts as $rebroadcast) {
$timeinfo = explode(" ", $next_date);
$sql = "SELECT timestamp '{$timeinfo[0]}' + interval '{$rebroadcast["day_offset"]}' + interval '{$rebroadcast["start_time"]}'";
- $rebroadcast_start_time = $CC_DBC->GetOne($sql);
+ $rebroadcast_start_time = $CC_DBC->GetOne($sql);
$sql = "SELECT timestamp '{$rebroadcast_start_time}' + interval '{$duration}'";
- $rebroadcast_end_time = $CC_DBC->GetOne($sql);
+ $rebroadcast_end_time = $CC_DBC->GetOne($sql);
$newRebroadcastInstance = new CcShowInstances();
$newRebroadcastInstance->setDbShowId($show_id);
@@ -427,32 +885,32 @@ class Show {
$newRebroadcastInstance->setDbRecord(0);
$newRebroadcastInstance->setDbRebroadcast(1);
$newRebroadcastInstance->setDbOriginalShow($show_instance_id);
- $newRebroadcastInstance->save();
+ $newRebroadcastInstance->save();
}
$sql = "SELECT timestamp '{$start}' + interval '{$interval}'";
- $next_date = $CC_DBC->GetOne($sql);
+ $next_date = $CC_DBC->GetOne($sql);
}
Show::setNextPop($next_date, $show_id, $day);
RabbitMq::PushSchedule();
}
- private static function populateShow($repeat_type, $show_id, $next_pop_date,
+ private static function populateShow($repeatType, $show_id, $next_pop_date,
$first_show, $last_show, $start_time, $duration, $day, $record, $end_timestamp) {
- if($repeat_type == -1) {
+ if($repeatType == -1) {
Show::populateNonRepeatingShow($show_id, $first_show, $start_time, $duration, $day, $record, $end_timestamp);
}
- else if($repeat_type == 0) {
+ else if($repeatType == 0) {
Show::populateRepeatingShow($show_id, $next_pop_date, $first_show, $last_show,
$start_time, $duration, $day, $record, $end_timestamp, '7 days');
}
- else if($repeat_type == 1) {
+ else if($repeatType == 1) {
Show::populateRepeatingShow($show_id, $next_pop_date, $first_show, $last_show,
$start_time, $duration, $day, $record, $end_timestamp, '14 days');
}
- else if($repeat_type == 2) {
+ else if($repeatType == 2) {
Show::populateRepeatingShow($show_id, $next_pop_date, $first_show, $last_show,
$start_time, $duration, $day, $record, $end_timestamp, '1 month');
}
@@ -467,7 +925,7 @@ class Show {
*
* @param int $p_showId
* @param string $p_date
- * In the format "YYYY-MM-DD HH:mm:ss"
+ * In the format "YYYY-MM-DD HH:mm:ss"
*/
public static function populateShowUntil($p_showId, $p_date = NULL)
{
@@ -481,8 +939,8 @@ class Show {
}
}
- $sql = "SELECT * FROM cc_show_days WHERE show_id = {$p_showId}";
- $res = $CC_DBC->GetAll($sql);
+ $sql = "SELECT * FROM cc_show_days WHERE show_id = $p_showId";
+ $res = $CC_DBC->GetAll($sql);
foreach ($res as $row) {
Show::populateShow($row["repeat_type"], $row["show_id"], $row["next_pop_date"], $row["first_show"],
@@ -494,9 +952,9 @@ class Show {
* Generate all the repeating shows in the given range.
*
* @param string $p_startTimestamp
- * In the format "YYYY-MM-DD HH:mm:ss"
+ * In the format "YYYY-MM-DD HH:mm:ss"
* @param string $p_endTimestamp
- * In the format "YYYY-MM-DD HH:mm:ss"
+ * In the format "YYYY-MM-DD HH:mm:ss"
*/
public static function populateAllShowsInRange($p_startTimestamp, $p_endTimestamp)
{
@@ -504,17 +962,17 @@ class Show {
if ($p_startTimestamp != "") {
$sql = "SELECT * FROM cc_show_days
- WHERE last_show IS NULL
+ WHERE last_show IS NULL
OR first_show < '{$p_endTimestamp}' AND last_show > '{$p_startTimestamp}'";
}
else {
$today_timestamp = date("Y-m-d");
$sql = "SELECT * FROM cc_show_days
- WHERE last_show IS NULL
+ WHERE last_show IS NULL
OR first_show < '{$p_endTimestamp}' AND last_show > '{$today_timestamp}'";
}
- $res = $CC_DBC->GetAll($sql);
+ $res = $CC_DBC->GetAll($sql);
foreach ($res as $row) {
Show::populateShow($row["repeat_type"], $row["show_id"], $row["next_pop_date"], $row["first_show"],
@@ -527,7 +985,7 @@ class Show {
* @param string $start
* In the format "YYYY-MM-DD HH:mm:ss"
* @param string $end
- * In the format "YYYY-MM-DD HH:mm:ss"
+ * In the format "YYYY-MM-DD HH:mm:ss"
* @param boolean $editable
*/
public static function getFullCalendarEvents($start, $end, $editable=false)
@@ -552,7 +1010,7 @@ class Show {
if ($editable && strtotime($today_timestamp) < strtotime($show["starts"])) {
$options["editable"] = true;
- $events[] = Show::makeFullCalendarEvent($show, $options);
+ $events[] = Show::makeFullCalendarEvent($show, $options);
}
else {
$events[] = Show::makeFullCalendarEvent($show, $options);
@@ -562,7 +1020,7 @@ class Show {
return $events;
}
- private static function makeFullCalendarEvent($show, $options=array())
+ private static function makeFullCalendarEvent($show, $options=array())
{
$event = array();
@@ -570,12 +1028,12 @@ class Show {
$event["disableResizing"] = true;
}
- $event["id"] = $show["instance_id"];
- $event["title"] = $show["name"];
- $event["start"] = $show["starts"];
- $event["end"] = $show["ends"];
- $event["allDay"] = false;
- $event["description"] = $show["description"];
+ $event["id"] = $show["instance_id"];
+ $event["title"] = $show["name"];
+ $event["start"] = $show["starts"];
+ $event["end"] = $show["ends"];
+ $event["allDay"] = false;
+ $event["description"] = $show["description"];
$event["showId"] = $show["show_id"];
$event["record"] = intval($show["record"]);
$event["rebroadcast"] = intval($show["rebroadcast"]);
@@ -587,23 +1045,58 @@ class Show {
}
if($show["background_color"] != "") {
$event["color"] = "#".$show["background_color"];
- }
+ }
- foreach($options as $key=>$value) {
- $event[$key] = $value;
- }
+ foreach($options as $key=>$value) {
+ $event[$key] = $value;
+ }
- return $event;
- }
+ return $event;
+ }
+
+ public static function getDateFromTimestamp($p_timestamp){
+ $explode = explode(" ", $p_timestamp);
+ return $explode[0];
+ }
+
+ public static function getTimeFromTimestamp($p_timestamp){
+ $explode = explode(" ", $p_timestamp);
+ return $explode[1];
+ }
+
+ /**
+ * This function formats a time by removing seconds
+ *
+ * When we receive a time from the database we get the
+ * format "hh:mm:ss". But when dealing with show times, we
+ * do not care about the seconds.
+ *
+ * @param int $p_timestamp
+ * The value which to format.
+ * @return int
+ * The timestamp with the new format "hh:mm", or
+ * the original input parameter, if it does not have
+ * the correct format.
+ */
+ public static function removeSecondsFromTime($p_timestamp)
+ {
+ //Format is in hh:mm:ss. We want hh:mm
+ $timeExplode = explode(":", $p_timestamp);
+
+ if (count($timeExplode) == 3)
+ return $timeExplode[0].":".$timeExplode[1];
+ else
+ return $p_timestamp;
+ }
}
class ShowInstance {
- private $_instanceId;
+ private $_instanceId;
- public function __construct($instanceId)
+ public function __construct($instanceId)
{
- $this->_instanceId = $instanceId;
+ $this->_instanceId = $instanceId;
}
public function getShowId()
@@ -653,6 +1146,21 @@ class ShowInstance {
return $showInstance->getDbEnds();
}
+ public function getStartDate()
+ {
+ $showStart = $this->getShowStart();
+ $showStartExplode = explode(" ", $showStart);
+ return $showStartExplode[0];
+ }
+
+ public function getStartTime()
+ {
+ $showStart = $this->getShowStart();
+ $showStartExplode = explode(" ", $showStart);
+
+ return $showStartExplode[1];
+ }
+
public function setSoundCloudFileId($p_soundcloud_id)
{
$showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId);
@@ -724,40 +1232,40 @@ class ShowInstance {
public function moveShow($deltaDay, $deltaMin)
{
- global $CC_DBC;
+ global $CC_DBC;
- $hours = $deltaMin/60;
- if($hours > 0)
- $hours = floor($hours);
- else
- $hours = ceil($hours);
+ $hours = $deltaMin/60;
+ if($hours > 0)
+ $hours = floor($hours);
+ else
+ $hours = ceil($hours);
- $mins = abs($deltaMin%60);
+ $mins = abs($deltaMin%60);
$starts = $this->getShowStart();
$ends = $this->getShowEnd();
- $sql = "SELECT timestamp '{$starts}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
- $new_starts = $CC_DBC->GetOne($sql);
+ $sql = "SELECT timestamp '{$starts}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
+ $new_starts = $CC_DBC->GetOne($sql);
- $sql = "SELECT timestamp '{$ends}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
- $new_ends = $CC_DBC->GetOne($sql);
+ $sql = "SELECT timestamp '{$ends}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
+ $new_ends = $CC_DBC->GetOne($sql);
$today_timestamp = date("Y-m-d H:i:s");
if(strtotime($today_timestamp) > strtotime($new_starts)) {
return "can't move show into past";
}
- $overlap = Show::getShows($new_starts, $new_ends, array($this->_instanceId));
+ $overlap = Show::getShows($new_starts, $new_ends, array($this->_instanceId));
- if(count($overlap) > 0) {
- return "Should not overlap shows";
- }
+ if(count($overlap) > 0) {
+ return "Should not overlap shows";
+ }
$rebroadcast = $this->isRebroadcast();
if($rebroadcast) {
$sql = "SELECT timestamp '{$new_starts}' < (SELECT starts FROM cc_show_instances WHERE id = {$rebroadcast})";
- $isBeforeRecordedOriginal = $CC_DBC->GetOne($sql);
+ $isBeforeRecordedOriginal = $CC_DBC->GetOne($sql);
if($isBeforeRecordedOriginal === 't'){
return "Cannot move a rebroadcast show before its original";
@@ -768,33 +1276,33 @@ class ShowInstance {
$this->setShowStart($new_starts);
$this->setShowEnd($new_ends);
RabbitMq::PushSchedule();
- }
+ }
- public function resizeShow($deltaDay, $deltaMin)
- {
- global $CC_DBC;
+ public function resizeShow($deltaDay, $deltaMin)
+ {
+ global $CC_DBC;
- $hours = $deltaMin/60;
- if($hours > 0)
- $hours = floor($hours);
- else
- $hours = ceil($hours);
+ $hours = $deltaMin/60;
+ if($hours > 0)
+ $hours = floor($hours);
+ else
+ $hours = ceil($hours);
- $mins = abs($deltaMin%60);
+ $mins = abs($deltaMin%60);
$starts = $this->getShowStart();
$ends = $this->getShowEnd();
- $sql = "SELECT timestamp '{$ends}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
- $new_ends = $CC_DBC->GetOne($sql);
+ $sql = "SELECT timestamp '{$ends}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
+ $new_ends = $CC_DBC->GetOne($sql);
//only need to check overlap if show increased in size.
if(strtotime($new_ends) > strtotime($ends)) {
- $overlap = Show::getShows($ends, $new_ends);
+ $overlap = Show::getShows($ends, $new_ends);
if(count($overlap) > 0) {
- return "Should not overlap shows";
- }
+ return "Should not overlap shows";
+ }
}
//with overbooking no longer need to check already scheduled content still fits.
@@ -802,45 +1310,45 @@ class ShowInstance {
if($this->isRecorded()) {
$sql = "UPDATE cc_show_instances SET ends = (ends + interval '{$deltaDay} days' + interval '{$hours}:{$mins}')
WHERE rebroadcast = 1 AND instance_id = {$this->_instanceId}";
- $CC_DBC->query($sql);
+ $CC_DBC->query($sql);
}
$this->setShowEnd($new_ends);
RabbitMq::PushSchedule();
- }
+ }
- /**
- * Get the group ID for this show.
- *
- */
- private function getLastGroupId()
- {
- global $CC_DBC;
- $sql = "SELECT group_id FROM cc_schedule WHERE instance_id = '{$this->_instanceId}' ORDER BY ends DESC LIMIT 1";
- $res = $CC_DBC->GetOne($sql);
- return $res;
- }
-
- /**
- * Add a playlist as the last item of the current show.
- *
- * @param int $plId
- * Playlist ID.
- */
- public function addPlaylistToShow($plId)
+ /**
+ * Get the group ID for this show.
+ *
+ */
+ private function getLastGroupId()
{
- $sched = new ScheduleGroup();
- $lastGroupId = $this->getLastGroupId();
+ global $CC_DBC;
+ $sql = "SELECT group_id FROM cc_schedule WHERE instance_id = '{$this->_instanceId}' ORDER BY ends DESC LIMIT 1";
+ $res = $CC_DBC->GetOne($sql);
+ return $res;
+ }
- if (is_null($lastGroupId)) {
- $groupId = $sched->add($this->_instanceId, $this->getShowStart(), null, $plId);
- }
- else {
- $groupId = $sched->addPlaylistAfter($this->_instanceId, $lastGroupId, $plId);
- }
- RabbitMq::PushSchedule();
+ /**
+ * Add a playlist as the last item of the current show.
+ *
+ * @param int $plId
+ * Playlist ID.
+ */
+ public function addPlaylistToShow($plId)
+ {
+ $sched = new ScheduleGroup();
+ $lastGroupId = $this->getLastGroupId();
+
+ if (is_null($lastGroupId)) {
+ $groupId = $sched->add($this->_instanceId, $this->getShowStart(), null, $plId);
+ }
+ else {
+ $groupId = $sched->addPlaylistAfter($this->_instanceId, $lastGroupId, $plId);
+ }
+ RabbitMq::PushSchedule();
$this->updateScheduledTime();
- }
+ }
/**
* Add a media file as the last item in the show.
@@ -850,14 +1358,14 @@ class ShowInstance {
public function addFileToShow($file_id)
{
$sched = new ScheduleGroup();
- $lastGroupId = $this->getLastGroupId();
+ $lastGroupId = $this->getLastGroupId();
- if (is_null($lastGroupId)) {
- $groupId = $sched->add($this->_instanceId, $this->getShowStart(), $file_id);
- }
- else {
- $groupId = $sched->addFileAfter($this->_instanceId, $lastGroupId, $file_id);
- }
+ if (is_null($lastGroupId)) {
+ $groupId = $sched->add($this->_instanceId, $this->getShowStart(), $file_id);
+ }
+ else {
+ $groupId = $sched->addFileAfter($this->_instanceId, $lastGroupId, $file_id);
+ }
RabbitMq::PushSchedule();
$this->updateScheduledTime();
}
@@ -866,7 +1374,7 @@ class ShowInstance {
* Add the given playlists to the show.
*
* @param array $plIds
- * An array of playlist IDs.
+ * An array of playlist IDs.
*/
public function scheduleShow($plIds)
{
@@ -875,37 +1383,37 @@ class ShowInstance {
}
}
- public function removeGroupFromShow($group_id)
- {
- global $CC_DBC;
+ public function removeGroupFromShow($group_id)
+ {
+ global $CC_DBC;
$sql = "SELECT MAX(ends) as end_timestamp, (MAX(ends) - MIN(starts)) as length
FROM cc_schedule
- WHERE group_id = '{$group_id}'";
+ WHERE group_id = '{$group_id}'";
- $groupBoundry = $CC_DBC->GetRow($sql);
+ $groupBoundry = $CC_DBC->GetRow($sql);
- $group = CcScheduleQuery::create()
- ->filterByDbGroupId($group_id)
- ->delete();
+ $group = CcScheduleQuery::create()
+ ->filterByDbGroupId($group_id)
+ ->delete();
- $sql = "UPDATE cc_schedule
- SET starts = (starts - INTERVAL '{$groupBoundry["length"]}'), ends = (ends - INTERVAL '{$groupBoundry["length"]}')
- WHERE starts >= '{$groupBoundry["end_timestamp"]}' AND instance_id = {$this->_instanceId}";
+ $sql = "UPDATE cc_schedule
+ SET starts = (starts - INTERVAL '{$groupBoundry["length"]}'), ends = (ends - INTERVAL '{$groupBoundry["length"]}')
+ WHERE starts >= '{$groupBoundry["end_timestamp"]}' AND instance_id = {$this->_instanceId}";
- $CC_DBC->query($sql);
- RabbitMq::PushSchedule();
+ $CC_DBC->query($sql);
+ RabbitMq::PushSchedule();
$this->updateScheduledTime();
- }
+ }
public function clearShow()
{
- CcScheduleQuery::create()
- ->filterByDbInstanceId($this->_instanceId)
- ->delete();
- RabbitMq::PushSchedule();
+ CcScheduleQuery::create()
+ ->filterByDbInstanceId($this->_instanceId)
+ ->delete();
+ RabbitMq::PushSchedule();
$this->updateScheduledTime();
- }
+ }
public function deleteShow()
{
@@ -913,7 +1421,7 @@ class ShowInstance {
->findPK($this->_instanceId)
->delete();
RabbitMq::PushSchedule();
- }
+ }
public function setRecordedFile($file_id)
{
@@ -942,7 +1450,7 @@ class ShowInstance {
$time = "00:00:00";
}
return $time;
- }
+ }
public function getPercentScheduled()
{
@@ -964,74 +1472,74 @@ class ShowInstance {
public function getShowLength()
{
- global $CC_DBC;
+ global $CC_DBC;
$start_timestamp = $this->getShowStart();
$end_timestamp = $this->getShowEnd();
- $sql = "SELECT TIMESTAMP '{$end_timestamp}' - TIMESTAMP '{$start_timestamp}' ";
- $length = $CC_DBC->GetOne($sql);
+ $sql = "SELECT TIMESTAMP '{$end_timestamp}' - TIMESTAMP '{$start_timestamp}' ";
+ $length = $CC_DBC->GetOne($sql);
- return $length;
- }
+ return $length;
+ }
- public function searchPlaylistsForShow($datatables)
- {
- return StoredFile::searchPlaylistsForSchedule($datatables);
- }
+ public function searchPlaylistsForShow($datatables)
+ {
+ return StoredFile::searchPlaylistsForSchedule($datatables);
+ }
public function getShowListContent()
{
global $CC_DBC;
- $sql = "SELECT *
- FROM (cc_schedule AS s LEFT JOIN cc_files AS f ON f.id = s.file_id
- LEFT JOIN cc_playlist AS p ON p.id = s.playlist_id )
+ $sql = "SELECT *
+ FROM (cc_schedule AS s LEFT JOIN cc_files AS f ON f.id = s.file_id
+ LEFT JOIN cc_playlist AS p ON p.id = s.playlist_id )
- WHERE s.instance_id = '{$this->_instanceId}' ORDER BY starts";
+ WHERE s.instance_id = '{$this->_instanceId}' ORDER BY starts";
- return $CC_DBC->GetAll($sql);
+ return $CC_DBC->GetAll($sql);
}
- public function getShowContent()
- {
- global $CC_DBC;
+ public function getShowContent()
+ {
+ global $CC_DBC;
$res = $this->getShowListContent();
if(count($res) <= 0) {
- return $res;
- }
+ return $res;
+ }
- $items = array();
- $currGroupId = -1;
- $pl_counter = -1;
- $f_counter = -1;
- foreach ($res as $row) {
- if($currGroupId != $row["group_id"]){
- $currGroupId = $row["group_id"];
- $pl_counter = $pl_counter + 1;
- $f_counter = -1;
+ $items = array();
+ $currGroupId = -1;
+ $pl_counter = -1;
+ $f_counter = -1;
+ foreach ($res as $row) {
+ if($currGroupId != $row["group_id"]){
+ $currGroupId = $row["group_id"];
+ $pl_counter = $pl_counter + 1;
+ $f_counter = -1;
- $items[$pl_counter]["pl_name"] = $row["name"];
- $items[$pl_counter]["pl_creator"] = $row["creator"];
- $items[$pl_counter]["pl_description"] = $row["description"];
- $items[$pl_counter]["pl_group"] = $row["group_id"];
+ $items[$pl_counter]["pl_name"] = $row["name"];
+ $items[$pl_counter]["pl_creator"] = $row["creator"];
+ $items[$pl_counter]["pl_description"] = $row["description"];
+ $items[$pl_counter]["pl_group"] = $row["group_id"];
- $sql = "SELECT SUM(clip_length) FROM cc_schedule WHERE group_id = '{$currGroupId}'";
- $length = $CC_DBC->GetOne($sql);
+ $sql = "SELECT SUM(clip_length) FROM cc_schedule WHERE group_id = '{$currGroupId}'";
+ $length = $CC_DBC->GetOne($sql);
- $items[$pl_counter]["pl_length"] = $length;
- }
- $f_counter = $f_counter + 1;
+ $items[$pl_counter]["pl_length"] = $length;
+ }
+ $f_counter = $f_counter + 1;
- $items[$pl_counter]["pl_content"][$f_counter]["f_name"] = $row["track_title"];
- $items[$pl_counter]["pl_content"][$f_counter]["f_artist"] = $row["artist_name"];
- $items[$pl_counter]["pl_content"][$f_counter]["f_length"] = $row["length"];
- }
+ $items[$pl_counter]["pl_content"][$f_counter]["f_name"] = $row["track_title"];
+ $items[$pl_counter]["pl_content"][$f_counter]["f_artist"] = $row["artist_name"];
+ $items[$pl_counter]["pl_content"][$f_counter]["f_length"] = $row["length"];
+ }
- return $items;
- }
+ return $items;
+ }
}
/* Show Data Access Layer */
@@ -1055,11 +1563,11 @@ class Show_DAL {
{
global $CC_CONFIG, $CC_DBC;
- $sql = "SELECT *, si.starts as start_timestamp, si.ends as end_timestamp FROM "
- ." $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] s"
- ." WHERE si.show_id = s.id"
- ." AND si.starts >= TIMESTAMP '$timeNow'"
- ." AND si.starts < TIMESTAMP '$timeNow' + INTERVAL '48 hours'"
+ $sql = "SELECT *, si.starts as start_timestamp, si.ends as end_timestamp FROM "
+ ." $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] s"
+ ." WHERE si.show_id = s.id"
+ ." AND si.starts >= TIMESTAMP '$timeNow'"
+ ." AND si.starts < TIMESTAMP '$timeNow' + INTERVAL '48 hours'"
." ORDER BY si.starts"
." LIMIT $limit";
@@ -1070,7 +1578,7 @@ class Show_DAL {
public static function GetShowsInRange($timeNow, $start, $end)
{
global $CC_CONFIG, $CC_DBC;
- $sql = "SELECT"
+ $sql = "SELECT"
." si.starts as show_starts,"
." si.ends as show_ends,"
." si.rebroadcast as rebroadcast,"
@@ -1091,8 +1599,8 @@ class Show_DAL {
." LEFT JOIN $CC_CONFIG[filesTable] ft"
." ON st.file_id = ft.id"
." LEFT JOIN $CC_CONFIG[showTable] s"
- ." ON si.show_id = s.id"
- ." WHERE ((si.starts < TIMESTAMP '$timeNow' - INTERVAL '$start seconds' AND si.ends > TIMESTAMP '$timeNow' - INTERVAL '$start seconds')"
+ ." ON si.show_id = s.id"
+ ." WHERE ((si.starts < TIMESTAMP '$timeNow' - INTERVAL '$start seconds' AND si.ends > TIMESTAMP '$timeNow' - INTERVAL '$start seconds')"
." OR (si.starts > TIMESTAMP '$timeNow' - INTERVAL '$start seconds' AND si.ends < TIMESTAMP '$timeNow' + INTERVAL '$end seconds')"
." OR (si.starts < TIMESTAMP '$timeNow' + INTERVAL '$end seconds' AND si.ends > TIMESTAMP '$timeNow' + INTERVAL '$end seconds'))"
//checking for st.starts IS NULL so that the query also returns shows that do not have any items scheduled.
@@ -1110,14 +1618,14 @@ class Show_DAL {
//Result: 5
global $CC_CONFIG, $CC_DBC;
- $sql = "SELECT"
+ $sql = "SELECT"
." si.starts as show_starts,"
." si.ends as show_ends,"
." s.name as show_name,"
." s.url as url"
." FROM $CC_CONFIG[showInstances] si"
." LEFT JOIN $CC_CONFIG[showTable] s"
- ." ON si.show_id = s.id"
+ ." ON si.show_id = s.id"
." WHERE EXTRACT(DOW FROM si.starts) = $day"
." AND EXTRACT(WEEK FROM si.starts) = EXTRACT(WEEK FROM localtimestamp)"
." ORDER BY si.starts";
@@ -1126,5 +1634,4 @@ class Show_DAL {
return $CC_DBC->GetAll($sql);
}
-
}
diff --git a/application/views/scripts/nowplaying/get-data-grid-data.phtml b/application/views/scripts/nowplaying/get-data-grid-data.phtml
index 789c0e6d5..ee1e82703 100644
--- a/application/views/scripts/nowplaying/get-data-grid-data.phtml
+++ b/application/views/scripts/nowplaying/get-data-grid-data.phtml
@@ -1,3 +1,2 @@
entries;
-?>
diff --git a/application/views/scripts/schedule/add-show-form.phtml b/application/views/scripts/schedule/add-show-form.phtml
index 61fbfba8d..8456fd6d1 100644
--- a/application/views/scripts/schedule/add-show-form.phtml
+++ b/application/views/scripts/schedule/add-show-form.phtml
@@ -3,7 +3,7 @@
Close
@@ -33,7 +33,7 @@
diff --git a/application/views/scripts/schedule/edit-show.phtml b/application/views/scripts/schedule/edit-show.phtml
index bce09e6c8..03bf357a5 100644
--- a/application/views/scripts/schedule/edit-show.phtml
+++ b/application/views/scripts/schedule/edit-show.phtml
@@ -1,11 +1,2 @@
-
-
- what ?>
-
-
- who ?>
-
-
- style ?>
-
-
+entries;
diff --git a/build/build.properties b/build/build.properties
index 75a77da70..d15498cad 100644
--- a/build/build.properties
+++ b/build/build.properties
@@ -1,6 +1,6 @@
#Note: project.home is automatically generated by the propel-install script.
#Any manual changes to this value will be overwritten.
-project.home = /home/naomiaro/dev-campcaster/campcaster
+project.home = /home/martin/workspace/airtime
project.build = ${project.home}/build
#Database driver
diff --git a/install/airtime-install.php b/install/airtime-install.php
index 9d97f3bb2..24d427638 100644
--- a/install/airtime-install.php
+++ b/install/airtime-install.php
@@ -49,6 +49,7 @@ system("python ".__DIR__."/../python_apps/pypo/install/pypo-install.py");
echo PHP_EOL."*** Recorder Installation ***".PHP_EOL;
system("python ".__DIR__."/../python_apps/show-recorder/install/recorder-install.py");
+AirtimeInstall::SetAirtimeVersion(AIRTIME_VERSION);
echo "******************************* Install Complete *******************************".PHP_EOL;
diff --git a/install/airtime-upgrade.php b/install/airtime-upgrade.php
index 799cb4b76..b1dda7246 100644
--- a/install/airtime-upgrade.php
+++ b/install/airtime-upgrade.php
@@ -7,13 +7,32 @@
*/
require_once(dirname(__FILE__).'/include/AirtimeIni.php');
+set_include_path(__DIR__.'/../library' . PATH_SEPARATOR . get_include_path());
+require_once __DIR__.'/../application/configs/conf.php';
+require_once(dirname(__FILE__).'/include/AirtimeInstall.php');
AirtimeIni::ExitIfNotRoot();
+AirtimeInstall::DbConnect(true);
+
+if(AirtimeInstall::DbTableExists('cc_show_rebroadcast') === true) {
+ $version = "1.7.0";
+ echo "Airtime Version: ".$version." ".PHP_EOL;
+}
+else {
+ $version = "1.6";
+ echo "Airtime Version: ".$version." ".PHP_EOL;
+}
echo "******************************** Update Begin *********************************".PHP_EOL;
-//system("php ".__DIR__."/upgrades/airtime-1.7/airtime-upgrade.php");
-system("php ".__DIR__."/upgrades/airtime-1.8/airtime-upgrade.php");
+if(strcmp($version, "1.7.0") < 0) {
+ system("php ".__DIR__."/upgrades/airtime-1.7/airtime-upgrade.php");
+}
+if(strcmp($version, "1.8.0") < 0) {
+ system("php ".__DIR__."/upgrades/airtime-1.8/airtime-upgrade.php");
+}
+
+AirtimeInstall::SetAirtimeVersion(AIRTIME_VERSION);
echo "******************************* Update Complete *******************************".PHP_EOL;
diff --git a/install/airtime-user.php b/install/airtime-user.php
old mode 100644
new mode 100755
diff --git a/install/include/AirtimeInstall.php b/install/include/AirtimeInstall.php
index 15c3b4e90..847fc2a45 100644
--- a/install/include/AirtimeInstall.php
+++ b/install/include/AirtimeInstall.php
@@ -179,6 +179,32 @@ class AirtimeInstall {
system($command);
}
+ public static function SetAirtimeVersion($p_version)
+ {
+ global $CC_DBC;
+ $sql = "DELETE FROM cc_pref WHERE keystr = 'system_version'";
+ $CC_DBC->query($sql);
+
+ $sql = "INSERT INTO cc_pref (keystr, valstr) VALUES ('system_version', '$p_version')";
+ $result = $CC_DBC->query($sql);
+ if (PEAR::isError($result)) {
+ return false;
+ }
+ return true;
+ }
+
+ public static function GetAirtimeVersion()
+ {
+ global $CC_DBC;
+ $sql = "SELECT valstr FROM cc_pref WHERE keystr = 'system_version'";
+ $version = $CC_DBC->GetOne($sql);
+
+ if (PEAR::isError($version)) {
+ return false;
+ }
+ return $version;
+ }
+
public static function DeleteFilesRecursive($p_path)
{
$command = "rm -rf $p_path";
diff --git a/library/propel/docs/behavior/sluggable.txt b/library/propel/docs/behavior/sluggable.txt
old mode 100755
new mode 100644
diff --git a/library/propel/docs/build.xml b/library/propel/docs/build.xml
old mode 100755
new mode 100644
diff --git a/library/propel/docs/cookbook/Writing-Behavior.txt b/library/propel/docs/cookbook/Writing-Behavior.txt
old mode 100755
new mode 100644
diff --git a/library/propel/generator/lib/behavior/sortable/SortableBehaviorQueryBuilderModifier.php b/library/propel/generator/lib/behavior/sortable/SortableBehaviorQueryBuilderModifier.php
old mode 100755
new mode 100644
diff --git a/library/propel/generator/lib/builder/om/ExtensionQueryInheritanceBuilder.php b/library/propel/generator/lib/builder/om/ExtensionQueryInheritanceBuilder.php
old mode 100755
new mode 100644
diff --git a/library/propel/generator/lib/builder/om/QueryInheritanceBuilder.php b/library/propel/generator/lib/builder/om/QueryInheritanceBuilder.php
old mode 100755
new mode 100644
diff --git a/library/propel/generator/lib/builder/util/PropelStringReader.php b/library/propel/generator/lib/builder/util/PropelStringReader.php
old mode 100755
new mode 100644
diff --git a/library/propel/generator/pear/pear-propel-gen b/library/propel/generator/pear/pear-propel-gen
old mode 100644
new mode 100755
diff --git a/library/propel/generator/resources/xsd/custom_datatypes.xsd b/library/propel/generator/resources/xsd/custom_datatypes.xsd
old mode 100755
new mode 100644
diff --git a/library/propel/generator/resources/xsd/database.xsd b/library/propel/generator/resources/xsd/database.xsd
old mode 100755
new mode 100644
diff --git a/library/propel/generator/resources/xsl/database.xsl b/library/propel/generator/resources/xsl/database.xsl
old mode 100755
new mode 100644
diff --git a/library/propel/runtime/lib/collection/PropelOnDemandIterator.php b/library/propel/runtime/lib/collection/PropelOnDemandIterator.php
old mode 100755
new mode 100644
diff --git a/library/propel/runtime/lib/formatter/ModelWith.php b/library/propel/runtime/lib/formatter/ModelWith.php
old mode 100755
new mode 100644
diff --git a/library/propel/runtime/lib/util/PropelAutoloader.php b/library/propel/runtime/lib/util/PropelAutoloader.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/generator/behavior/sortable/SortableBehaviorQueryBuilderModifierTest.php b/library/propel/test/testsuite/generator/behavior/sortable/SortableBehaviorQueryBuilderModifierTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/generator/behavior/sortable/SortableBehaviorQueryBuilderModifierWithScopeTest.php b/library/propel/test/testsuite/generator/behavior/sortable/SortableBehaviorQueryBuilderModifierWithScopeTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/generator/behavior/sortable/SortableBehaviorTest.php b/library/propel/test/testsuite/generator/behavior/sortable/SortableBehaviorTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/generator/builder/NamespaceTest.php b/library/propel/test/testsuite/generator/builder/NamespaceTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/generator/builder/om/OMBuilderNamespaceTest.php b/library/propel/test/testsuite/generator/builder/om/OMBuilderNamespaceTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/generator/builder/om/QueryBuilderInheritanceTest.php b/library/propel/test/testsuite/generator/builder/om/QueryBuilderInheritanceTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/collection/PropelOnDemandIteratorTest.php b/library/propel/test/testsuite/runtime/collection/PropelOnDemandIteratorTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/formatter/PropelOnDemandFormatterWithTest.php b/library/propel/test/testsuite/runtime/formatter/PropelOnDemandFormatterWithTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/map/GeneratedRelationMapTest.php b/library/propel/test/testsuite/runtime/map/GeneratedRelationMapTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/map/RelatedMapSymmetricalTest.php b/library/propel/test/testsuite/runtime/map/RelatedMapSymmetricalTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/om/BaseObjectSerializeTest.php b/library/propel/test/testsuite/runtime/om/BaseObjectSerializeTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/om/BaseObjectTest.php b/library/propel/test/testsuite/runtime/om/BaseObjectTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/query/ModelCriteriaHooksTest.php b/library/propel/test/testsuite/runtime/query/ModelCriteriaHooksTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/query/ModelWithTest.php b/library/propel/test/testsuite/runtime/query/ModelWithTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/util/BasePeerExceptionsTest.php b/library/propel/test/testsuite/runtime/util/BasePeerExceptionsTest.php
old mode 100755
new mode 100644
diff --git a/plugins/jquery.showinfo.js b/plugins/jquery.showinfo.js
index d38cff6c4..8c4e01c2d 100644
--- a/plugins/jquery.showinfo.js
+++ b/plugins/jquery.showinfo.js
@@ -89,10 +89,18 @@
return this.each(function() {
var obj = $(this);
- var sd;
+ var sd = null;
getServerData();
+ //refresh the UI to update the elapsed/remaining time
+ setInterval(updateWidget, 1000);
+
function updateWidget(){
+
+ if (sd == null){
+ return;
+ }
+
var currentShow = sd.getCurrentShow();
var nextShows = sd.getNextShows();
@@ -126,14 +134,10 @@
"" +
""+options.text.next+": "+nextShowName+""+nextShowRange+"" +
"");
-
- //refresh the UI to update the elapsed/remaining time
- setTimeout(updateWidget, 1000);
}
function processData(data){
sd = new ScheduleData(data);
- updateWidget();
}
function airtimeScheduleJsonpError(jqXHR, textStatus, errorThrown){
diff --git a/public/.htaccess b/public/.htaccess
index 7fb009bfe..b19791a33 100644
--- a/public/.htaccess
+++ b/public/.htaccess
@@ -5,3 +5,5 @@ RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
+RewriteBase /
+
diff --git a/public/css/colorpicker/images/Thumbs.db b/public/css/colorpicker/images/Thumbs.db
deleted file mode 100644
index d396c36dd..000000000
Binary files a/public/css/colorpicker/images/Thumbs.db and /dev/null differ
diff --git a/public/css/fullcalendar.css b/public/css/fullcalendar.css
index 06af1a321..0c93d9936 100644
--- a/public/css/fullcalendar.css
+++ b/public/css/fullcalendar.css
@@ -1,11 +1,11 @@
/*
- * FullCalendar v1.5 Stylesheet
+ * FullCalendar v1.5.1 Stylesheet
*
* Copyright (c) 2011 Adam Shaw
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
- * Date: Sat Mar 19 18:59:37 2011 -0700
+ * Date: Sat Apr 9 14:09:51 2011 -0700
*
*/
@@ -245,6 +245,10 @@ html .fc,
border-color: #ddd;
}
+.fc-state-disabled {
+ cursor: default;
+ }
+
.fc-state-disabled .fc-button-effect {
display: none;
}
@@ -286,6 +290,7 @@ a.fc-event {
height: 100%;
border-style: solid;
border-width: 0;
+ overflow: hidden;
}
.fc-event-time,
@@ -609,5 +614,33 @@ table.fc-border-separate {
.fc-agenda .ui-resizable-resizing { /* TODO: better selector */
_overflow: hidden;
}
-
-
+
+/*---////////////////////////////////////////// CUSTOM OVERRIDES ////////////////////////////////---*/
+
+html .fc, .fc table {
+ font-size: 12px;
+}
+.fc table thead tr.fc-first th, .fc table thead tr.fc-first th.fc-agenda-axis {
+ height:26px !important;
+ vertical-align:middle;
+}
+.fc-agenda-axis input.input_select {
+ height:22px !important;
+ font-size:11px;
+}
+.fc-header-title h2 {
+ font-size: 18px;
+ font-weight: normal;
+ margin-top:2px;
+}
+.fc-event-vert .fc-event-time {
+ font-size: 11px;
+}
+.fc-event-time, .fc-event-title {
+ font-size: 11px;
+ padding: 0 2px;
+}
+
+/*.fc-event {
+ overflow:hidden;
+}*/
diff --git a/public/css/fullcalendar.print.css b/public/css/fullcalendar.print.css
new file mode 100644
index 000000000..98d0e0b36
--- /dev/null
+++ b/public/css/fullcalendar.print.css
@@ -0,0 +1,61 @@
+/*
+ * FullCalendar v1.5.1 Print Stylesheet
+ *
+ * Include this stylesheet on your page to get a more printer-friendly calendar.
+ * When including this stylesheet, use the media='print' attribute of the tag.
+ * Make sure to include this stylesheet IN ADDITION to the regular fullcalendar.css.
+ *
+ * Copyright (c) 2011 Adam Shaw
+ * Dual licensed under the MIT and GPL licenses, located in
+ * MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
+ *
+ * Date: Sat Apr 9 14:09:51 2011 -0700
+ *
+ */
+
+
+ /* Events
+-----------------------------------------------------*/
+
+.fc-event-skin {
+ background: none !important;
+ color: #000 !important;
+ }
+
+/* horizontal events */
+
+.fc-event-hori {
+ border-width: 0 0 1px 0 !important;
+ border-bottom-style: dotted !important;
+ border-bottom-color: #000 !important;
+ padding: 1px 0 0 0 !important;
+ }
+
+.fc-event-hori .fc-event-inner {
+ border-width: 0 !important;
+ padding: 0 1px !important;
+ }
+
+/* vertical events */
+
+.fc-event-vert {
+ border-width: 0 0 0 1px !important;
+ border-left-style: dotted !important;
+ border-left-color: #000 !important;
+ padding: 0 1px 0 0 !important;
+ }
+
+.fc-event-vert .fc-event-inner {
+ border-width: 0 !important;
+ padding: 1px 0 !important;
+ }
+
+.fc-event-bg {
+ display: none !important;
+ }
+
+.fc-event .ui-resizable-handle {
+ display: none !important;
+ }
+
+
diff --git a/public/css/images/icon_alert_ffffff.png b/public/css/images/icon_alert_ffffff.png
new file mode 100644
index 000000000..35d3d1b64
Binary files /dev/null and b/public/css/images/icon_alert_ffffff.png differ
diff --git a/public/css/playlist_builder.css b/public/css/playlist_builder.css
index bd0ecc44f..4724055e9 100644
--- a/public/css/playlist_builder.css
+++ b/public/css/playlist_builder.css
@@ -78,6 +78,7 @@
.spl_artist {
font-size:12px;
+ color:#d5d5d5;
}
/*#spl_editor {
@@ -108,10 +109,10 @@
}
#side_playlist h3 {
- font-size:17px;
+ font-size:20px;
margin:9px 0 3px 0;
padding:0;
- color:#1c1c1c;
+ color:#444444;
font-weight:normal;
clear:both;
float:left;
@@ -120,7 +121,7 @@
font-size:15px;
margin:8px 0 10px 0;
padding:0;
- color:#1c1c1c;
+ color:#6e6e6e;
font-weight:normal;
clear:both;
float:left;
diff --git a/public/css/plupload.queue.css b/public/css/plupload.queue.css
index 75489a419..e54912b37 100644
--- a/public/css/plupload.queue.css
+++ b/public/css/plupload.queue.css
@@ -107,7 +107,7 @@
}
.plupload_file_size, .plupload_file_status, .plupload_file_action {text-align: right;}
-.plupload_filelist .plupload_file_name {width: 205px}
+.plupload_filelist .plupload_file_name {width: 68%;}
.plupload_file_action {
float: right;
diff --git a/public/css/styles.css b/public/css/styles.css
index a500fdc26..c204c11b0 100644
--- a/public/css/styles.css
+++ b/public/css/styles.css
@@ -899,6 +899,7 @@ div.ui-datepicker {
}
#show_time_info {
font-size:12px;
+ height:30px;
}
#show_time_info > div, #show_time_info > span{
@@ -1595,6 +1596,19 @@ dd.radio-inline-list, .preferences dd.radio-inline-list {
height: 120px;
}
+#show_time_info {
+ font-size:12px;
+ height:30px;
+}
+#show_time_warning {
+ background:#c83f3f url(images/icon_alert_ffffff.png) no-repeat 5px 4px;
+ border:1px solid #9d1010;
+ color:#fff;
+ padding: 2px 5px 2px 24px;
+ font-size: 12px;
+ line-height: 140%;
+}
+
/* HACK, to be removed after 1.7.0 */
button.ui-button.md-cancel {
padding: .4em 1em;
diff --git a/public/js/airtime/schedule/add-show.js b/public/js/airtime/schedule/add-show.js
index d8ded66a6..b2449a608 100644
--- a/public/js/airtime/schedule/add-show.js
+++ b/public/js/airtime/schedule/add-show.js
@@ -56,7 +56,7 @@ function findHosts(request, callback) {
}
function setAddShowEvents() {
-
+
var form = $("#add-show-form");
form.find("h3").click(function(){
@@ -129,9 +129,15 @@ function setAddShowEvents() {
form.find("#add_show_day_check-element label").addClass("wrapp-label");
form.find("#add_show_day_check-element br").remove();
- form.find("#add_show_no_end").click(function(){
- form.find("#add_show_end_date").toggle();
- });
+ function endDateVisibility(){
+ if(form.find("#add_show_no_end").is(':checked')){
+ form.find("#add_show_end_date").hide();
+ } else {
+ form.find("#add_show_end_date").show();
+ }
+ }
+ endDateVisibility();
+ form.find("#add_show_no_end").click(endDateVisibility);
createDateInput(form.find("#add_show_start_date"), startDpSelect);
createDateInput(form.find("#add_show_end_date"), endDpSelect);
diff --git a/public/js/airtime/schedule/full-calendar-functions.js b/public/js/airtime/schedule/full-calendar-functions.js
index 8a15c0fd2..ce53f9737 100644
--- a/public/js/airtime/schedule/full-calendar-functions.js
+++ b/public/js/airtime/schedule/full-calendar-functions.js
@@ -33,6 +33,17 @@ function makeAddShowButton(){
});
}
+function beginEditShow(data){
+ //alert (data.entries);
+
+ $("#add-show-form")
+ .empty()
+ .append(data.newForm);
+
+ setAddShowEvents();
+ openAddShowForm();
+}
+
function makeTimeStamp(date){
var sy, sm, sd, h, m, s, timestamp;
sy = date.getFullYear();
@@ -164,17 +175,11 @@ function eventRender(event, element, view) {
.css('margin-top', '5px')
.css('margin-left', 'auto')
.css('margin-right', 'auto')
- .css('text-align', 'center')
.progressbar({
value: event.percent
});
- if(event.percent === 0) {
- // even at 0, the bar still seems to display a little bit of progress...
- div.find("div").hide();
- }
-
- $(element).find(".fc-event-title").after(div);
+ $(element).find(".fc-event-content").append(div);
}
//add the record/rebroadcast icons if needed.
@@ -217,16 +222,6 @@ function eventAfterRender( event, element, view ) {
{xposition: "mouse", yposition: "mouse"});
}
-function eventClick(event, jsEvent, view) {
- var x;
-}
-
-function eventMouseover(event, jsEvent, view) {
-}
-
-function eventMouseout(event, jsEvent, view) {
-}
-
function eventDrop(event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui, view) {
var url;
diff --git a/public/js/airtime/schedule/schedule.js b/public/js/airtime/schedule/schedule.js
index 9561785a3..40a56a68c 100644
--- a/public/js/airtime/schedule/schedule.js
+++ b/public/js/airtime/schedule/schedule.js
@@ -265,9 +265,6 @@ $(window).load(function() {
dayClick: dayClick,
eventRender: eventRender,
eventAfterRender: eventAfterRender,
- eventClick: eventClick,
- eventMouseover: eventMouseover,
- eventMouseout: eventMouseout,
eventDrop: eventDrop,
eventResize: eventResize
});
diff --git a/public/js/fullcalendar/fullcalendar.js b/public/js/fullcalendar/fullcalendar.js
index db5d83855..bbcd2fb88 100644
--- a/public/js/fullcalendar/fullcalendar.js
+++ b/public/js/fullcalendar/fullcalendar.js
@@ -1,6 +1,6 @@
/**
* @preserve
- * FullCalendar v1.5
+ * FullCalendar v1.5.1
* http://arshaw.com/fullcalendar/
*
* Use fullcalendar.css for basic styling.
@@ -11,7 +11,7 @@
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
- * Date: Sat Mar 19 18:59:37 2011 -0700
+ * Date: Sat Apr 9 14:09:51 2011 -0700
*
*/
@@ -111,7 +111,7 @@ var rtlDefaults = {
-var fc = $.fullCalendar = { version: "1.5" };
+var fc = $.fullCalendar = { version: "1.5.1" };
var fcViews = fc.views = {};
@@ -743,8 +743,8 @@ function Header(calendar, options) {
};
}
if (buttonClick) {
- var icon = options.theme ? smartProperty(options.buttonIcons, buttonName) : null;
- var text = smartProperty(options.buttonText, buttonName);
+ var icon = options.theme ? smartProperty(options.buttonIcons, buttonName) : null; // why are we using smartProperty here?
+ var text = smartProperty(options.buttonText, buttonName); // why are we using smartProperty here?
var button = $(
"" +
"" +
@@ -1374,8 +1374,8 @@ function parseDate(s, ignoreTimezone) { // ignoreTimezone defaults to true
return new Date(s * 1000);
}
if (typeof s == 'string') {
- if (s.match(/^\d+$/)) { // a UNIX timestamp
- return new Date(parseInt(s, 10) * 1000);
+ if (s.match(/^\d+(\.\d+)?$/)) { // a UNIX timestamp
+ return new Date(parseFloat(s) * 1000);
}
if (ignoreTimezone === undefined) {
ignoreTimezone = true;
@@ -1390,7 +1390,7 @@ function parseDate(s, ignoreTimezone) { // ignoreTimezone defaults to true
function parseISO8601(s, ignoreTimezone) { // ignoreTimezone defaults to false
// derived from http://delete.me.uk/2005/03/iso8601.html
// TODO: for a know glitch/feature, read tests/issue_206_parseDate_dst.html
- var m = s.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?$/);
+ var m = s.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2})(:?([0-9]{2}))?))?)?)?)?$/);
if (!m) {
return null;
}
@@ -1431,7 +1431,7 @@ function parseISO8601(s, ignoreTimezone) { // ignoreTimezone defaults to false
m[10] || 0,
m[12] ? Number("0." + m[12]) * 1000 : 0
);
- var offset = Number(m[16]) * 60 + Number(m[17]);
+ var offset = Number(m[16]) * 60 + (m[18] ? Number(m[18]) : 0);
offset *= m[15] == '-' ? 1 : -1;
date = new Date(+date + (offset * 60 * 1000));
}
diff --git a/public/js/fullcalendar/fullcalendar.min.js b/public/js/fullcalendar/fullcalendar.min.js
index 7e31e42d1..e17382aa2 100644
--- a/public/js/fullcalendar/fullcalendar.min.js
+++ b/public/js/fullcalendar/fullcalendar.min.js
@@ -1,6 +1,6 @@
/*
- FullCalendar v1.5
+ FullCalendar v1.5.1
http://arshaw.com/fullcalendar/
Use fullcalendar.css for basic styling.
@@ -11,7 +11,7 @@
Dual licensed under the MIT and GPL licenses, located in
MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
- Date: Sat Mar 19 18:59:37 2011 -0700
+ Date: Sat Apr 9 14:09:51 2011 -0700
*/
(function(m,oa){function wb(a){m.extend(true,Ya,a)}function Yb(a,b,e){function d(k){if(E){u();q();ma();S(k)}else f()}function f(){B=b.theme?"ui":"fc";a.addClass("fc");b.isRTL&&a.addClass("fc-rtl");b.theme&&a.addClass("ui-widget");E=m("").prependTo(a);C=new Zb(X,b);(P=C.render())&&a.prepend(P);y(b.defaultView);m(window).resize(na);t()||g()}function g(){setTimeout(function(){!n.start&&t()&&S()},0)}function l(){m(window).unbind("resize",na);C.destroy();
@@ -33,16 +33,16 @@ K):null;T.title=c.title;T.url=c.url;T.allDay=c.allDay;T.className=c.className;T.
H);if(c.end&&c.end<=c.start)c.end=null;c._end=c.end?N(c.end):null;if(c.allDay===oa)c.allDay=Ta(z.allDayDefault,a.allDayDefault);if(c.className){if(typeof c.className=="string")c.className=c.className.split(/\s+/)}else c.className=[]}function ga(c){if(c.className){if(typeof c.className=="string")c.className=c.className.split(/\s+/)}else c.className=[];for(var z=Aa.sourceNormalizers,H=0;Hl;y--)if(S=dc[e.substring(l,y)]){if(f)Q+=S(f,d);l=y-1;break}if(y==l)if(f)Q+=t}}return Q}function Ua(a){return a.end?ec(a.end,a.allDay):ba(N(a.start),1)}function ec(a,b){a=N(a);return b||a.getHours()||a.getMinutes()?ba(a,1):Ka(a)}function fc(a,b){return(b.msLength-a.msLength)*100+(a.event.start-b.event.start)}function Cb(a,b){return a.end>b.start&&a.starte&&td){y=N(d);Q=false}else{y=y;Q=true}f.push({event:j,start:t,end:y,isStart:S,isEnd:Q,msLength:y-t})}}return f.sort(fc)}function ob(a){var b=[],e,d=a.length,f,g,l,j;for(e=0;e=0;e--){d=a[b[e].toLowerCase()];if(d!==oa)return d}return a[""]}function Qa(a){return a.replace(/&/g,
-"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"
")}function Ib(a){return a.id+"/"+a.className+"/"+a.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig,"")}function qb(a){a.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})}function ab(a){a.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}
+a++,1);while(b.getHours());return b}function Fa(a,b,e){for(b=b||1;!a.getDay()||e&&a.getDay()==1||!e&&a.getDay()==6;)ba(a,b);return a}function Ca(a,b){return Math.round((N(a,true)-N(b,true))/Ab)}function yb(a,b,e,d){if(b!==oa&&b!=a.getFullYear()){a.setDate(1);a.setMonth(0);a.setFullYear(b)}if(e!==oa&&e!=a.getMonth()){a.setDate(1);a.setMonth(e)}d!==oa&&a.setDate(d)}function kb(a,b){if(typeof a=="object")return a;if(typeof a=="number")return new Date(a*1E3);if(typeof a=="string"){if(a.match(/^\d+(\.\d+)?$/))return new Date(parseFloat(a)*
+1E3);if(b===oa)b=true;return Bb(a,b)||(a?new Date(a):null)}return null}function Bb(a,b){a=a.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2})(:?([0-9]{2}))?))?)?)?)?$/);if(!a)return null;var e=new Date(a[1],0,1);if(b||!a[14]){b=new Date(a[1],0,1,9,0);if(a[3]){e.setMonth(a[3]-1);b.setMonth(a[3]-1)}if(a[5]){e.setDate(a[5]);b.setDate(a[5])}lb(e,b);a[7]&&e.setHours(a[7]);a[8]&&e.setMinutes(a[8]);a[10]&&e.setSeconds(a[10]);a[12]&&e.setMilliseconds(Number("0."+
+a[12])*1E3);lb(e,b)}else{e.setUTCFullYear(a[1],a[3]?a[3]-1:0,a[5]||1);e.setUTCHours(a[7]||0,a[8]||0,a[10]||0,a[12]?Number("0."+a[12])*1E3:0);b=Number(a[16])*60+(a[18]?Number(a[18]):0);b*=a[15]=="-"?1:-1;e=new Date(+e+b*60*1E3)}return e}function mb(a){if(typeof a=="number")return a*60;if(typeof a=="object")return a.getHours()*60+a.getMinutes();if(a=a.match(/(\d+)(?::(\d+))?\s*(\w+)?/)){var b=parseInt(a[1],10);if(a[3]){b%=12;if(a[3].toLowerCase().charAt(0)=="p")b+=12}return b*60+(a[2]?parseInt(a[2],
+10):0)}}function Oa(a,b,e){return ib(a,null,b,e)}function ib(a,b,e,d){d=d||Ya;var f=a,g=b,l,j=e.length,t,y,S,Q="";for(l=0;ll;y--)if(S=dc[e.substring(l,y)]){if(f)Q+=S(f,d);l=y-1;break}if(y==l)if(f)Q+=t}}return Q}function Ua(a){return a.end?ec(a.end,a.allDay):ba(N(a.start),1)}function ec(a,b){a=N(a);return b||a.getHours()||a.getMinutes()?ba(a,1):Ka(a)}function fc(a,b){return(b.msLength-a.msLength)*100+(a.event.start-b.event.start)}function Cb(a,b){return a.end>b.start&&a.starte&&td){y=N(d);Q=false}else{y=y;Q=true}f.push({event:j,start:t,end:y,isStart:S,isEnd:Q,msLength:y-t})}}return f.sort(fc)}function ob(a){var b=[],e,d=a.length,f,g,l,j;for(e=0;e=0;e--){d=a[b[e].toLowerCase()];if(d!==
+oa)return d}return a[""]}function Qa(a){return a.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"
")}function Ib(a){return a.id+"/"+a.className+"/"+a.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig,"")}function qb(a){a.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})}function ab(a){a.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}
function rb(a,b){a.each(function(e,d){d.className=d.className.replace(/^fc-\w*/,"fc-"+lc[b.getDay()])})}function Jb(a,b){var e=a.source||{},d=a.color,f=e.color,g=b("eventColor"),l=a.backgroundColor||d||e.backgroundColor||f||b("eventBackgroundColor")||g;d=a.borderColor||d||e.borderColor||f||b("eventBorderColor")||g;a=a.textColor||e.textColor||b("eventTextColor");b=[];l&&b.push("background-color:"+l);d&&b.push("border-color:"+d);a&&b.push("color:"+a);return b.join(";")}function $a(a,b,e){if(m.isFunction(a))a=
[a];if(a){var d,f;for(d=0;d=e[t][0]&&g10&&a<20)return"th";
-return["st","nd","rd"][a%10-1]||"th"}};Aa.applyAll=$a;Ja.month=mc;Ja.basicWeek=nc;Ja.basicDay=oc;wb({weekMode:"fixed"});Ja.agendaWeek=qc;Ja.agendaDay=rc;wb({allDaySlot:true,allDayText:"all-day",firstHour:6,slotMinutes:30,defaultEventMinutes:120,axisFormat:"h(:mm)tt",timeFormat:{agenda:"h:mm{ - h:mm}"},dragOpacity:{agenda:0.5},minTime:0,maxTime:24})})(jQuery);
+prevYear:" >> ",nextYear:" << "},buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},Aa=m.fullCalendar={version:"1.5.1"},Ja=Aa.views={};m.fn.fullCalendar=function(a){if(typeof a=="string"){var b=Array.prototype.slice.call(arguments,1),e;this.each(function(){var f=m.data(this,"fullCalendar");if(f&&m.isFunction(f[a])){f=f[a].apply(f,b);if(e===oa)e=f;a=="destroy"&&m.removeData(this,"fullCalendar")}});if(e!==oa)return e;return this}var d=a.eventSources||[];
+delete a.eventSources;if(a.events){d.push(a.events);delete a.events}a=m.extend(true,{},Ya,a.isRTL||a.isRTL===oa&&Ya.isRTL?xc:{},a);this.each(function(f,g){f=m(g);g=new Yb(f,a,d);f.data("fullCalendar",g);g.render()});return this};Aa.sourceNormalizers=[];Aa.sourceFetchers=[];var ac={dataType:"json",cache:false},bc=1;Aa.addDays=ba;Aa.cloneDate=N;Aa.parseDate=kb;Aa.parseISO8601=Bb;Aa.parseTime=mb;Aa.formatDate=Oa;Aa.formatDates=ib;var lc=["sun","mon","tue","wed","thu","fri","sat"],Ab=864E5,cc=36E5,wc=
+6E4,dc={s:function(a){return a.getSeconds()},ss:function(a){return Pa(a.getSeconds())},m:function(a){return a.getMinutes()},mm:function(a){return Pa(a.getMinutes())},h:function(a){return a.getHours()%12||12},hh:function(a){return Pa(a.getHours()%12||12)},H:function(a){return a.getHours()},HH:function(a){return Pa(a.getHours())},d:function(a){return a.getDate()},dd:function(a){return Pa(a.getDate())},ddd:function(a,b){return b.dayNamesShort[a.getDay()]},dddd:function(a,b){return b.dayNames[a.getDay()]},
+M:function(a){return a.getMonth()+1},MM:function(a){return Pa(a.getMonth()+1)},MMM:function(a,b){return b.monthNamesShort[a.getMonth()]},MMMM:function(a,b){return b.monthNames[a.getMonth()]},yy:function(a){return(a.getFullYear()+"").substring(2)},yyyy:function(a){return a.getFullYear()},t:function(a){return a.getHours()<12?"a":"p"},tt:function(a){return a.getHours()<12?"am":"pm"},T:function(a){return a.getHours()<12?"A":"P"},TT:function(a){return a.getHours()<12?"AM":"PM"},u:function(a){return Oa(a,
+"yyyy-MM-dd'T'HH:mm:ss'Z'")},S:function(a){a=a.getDate();if(a>10&&a<20)return"th";return["st","nd","rd"][a%10-1]||"th"}};Aa.applyAll=$a;Ja.month=mc;Ja.basicWeek=nc;Ja.basicDay=oc;wb({weekMode:"fixed"});Ja.agendaWeek=qc;Ja.agendaDay=rc;wb({allDaySlot:true,allDayText:"all-day",firstHour:6,slotMinutes:30,defaultEventMinutes:120,axisFormat:"h(:mm)tt",timeFormat:{agenda:"h:mm{ - h:mm}"},dragOpacity:{agenda:0.5},minTime:0,maxTime:24})})(jQuery);
diff --git a/public/js/fullcalendar/gcal.js b/public/js/fullcalendar/gcal.js
index 076d3ef30..830fd7aac 100644
--- a/public/js/fullcalendar/gcal.js
+++ b/public/js/fullcalendar/gcal.js
@@ -1,11 +1,11 @@
/*
- * FullCalendar v1.5 Google Calendar Plugin
+ * FullCalendar v1.5.1 Google Calendar Plugin
*
* Copyright (c) 2011 Adam Shaw
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
- * Date: Sat Mar 19 18:59:37 2011 -0700
+ * Date: Sat Apr 9 14:09:51 2011 -0700
*
*/
diff --git a/public/js/libs/jquery-1.4.4.min.js b/public/js/libs/jquery-1.4.4.min.js
deleted file mode 100644
index 8f3ca2e2d..000000000
--- a/public/js/libs/jquery-1.4.4.min.js
+++ /dev/null
@@ -1,167 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.4.4
- * http://jquery.com/
- *
- * Copyright 2010, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2010, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Thu Nov 11 19:04:53 2010 -0500
- */
-(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h=
-h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;kd)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La,
-"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,
-e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,
-"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+
-a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,
-C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j,
-s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this,
-j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},
-toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j===
--1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false;
-if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload",
-b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&&
-!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&&
-l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;Ha";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"),
-k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false,
-scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent=
-false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom=
-1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display=
-"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h=
-c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);
-else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";
-if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},
-attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&
-b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0};
-c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,
-arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid=
-d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+
-c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
-8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k===
-"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+
-d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired=
-B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type===
-"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]===
-0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
-(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3];
-break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr,
-q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h=
-l;g.sort(w);if(h)for(var i=1;i0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n,
-m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===
-true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===
-g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return in[3]-0},nth:function(g,i,n){return n[3]-
-0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===
-i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]];
-if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m,
-g);else if(typeof g.length==="number")for(var p=g.length;n";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g);
-n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&&
-function(){var g=k,i=t.createElement("div");i.innerHTML="";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F||
-p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g=
-t.createElement("div");g.innerHTML="";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition?
-function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n0)for(var h=d;h0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h=
-h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):
-c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,
-2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,
-b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&
-e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/\s]+\/)>/g,P={option:[1,
-""],legend:[1,""],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
-c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
-wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
-prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
-this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
-return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;
-else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1>$2>");try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",
-prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument||
-b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1>$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]===""&&!x?r.childNodes:[];for(o=k.length-
-1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));
-d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i,
-jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,
-zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),
-h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b);
-if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=
-d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left;
-e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/