Merge branch '2.4.x' of dev.sourcefabric.org:airtime into 2.4.x

This commit is contained in:
Martin Konecny 2013-05-30 15:52:36 -04:00
commit a46763b092
4 changed files with 54 additions and 17 deletions

View file

@ -393,7 +393,8 @@ class LibraryController extends Zend_Controller_Action
} }
$c[0] = $c['item_id']; $c[0] = $c['item_id'];
} }
$newPl->addAudioClips($contents, null, 'begining');
$newPl->addAudioClips($contents, null, 'before');
$newPl->setCreator(Application_Model_User::getCurrentUser()->getId()); $newPl->setCreator(Application_Model_User::getCurrentUser()->getId());
$newPl->setDescription($originalPl->getDescription()); $newPl->setDescription($originalPl->getDescription());

View file

@ -330,7 +330,7 @@ SQL;
{ {
list($value, $modifier) = $this->getLimitValueAndModifier(); list($value, $modifier) = $this->getLimitValueAndModifier();
if ($modifier == "items") { if ($modifier == "items") {
$length = $value." ".$modifier; $length = $value." "._("items");
} else { } else {
$hour = "00"; $hour = "00";
$mins = "00"; $mins = "00";
@ -1354,6 +1354,21 @@ SQL;
"year" => _("Year") "year" => _("Year")
); );
$modifierOptions = array(
"0" => _("Select modifier"),
"contains" => _("contains"),
"does not contain" => _("does not contain"),
"is" => _("is"),
"is not" => _("is not"),
"starts with" => _("starts with"),
"ends with" => _("ends with"),
"is" => _("is"),
"is not" => _("is not"),
"is greater than" => _("is greater than"),
"is less than" => _("is less than"),
"is in the range" => _("is in the range")
);
// Load criteria from db // Load criteria from db
$out = CcBlockcriteriaQuery::create()->orderByDbCriteria()->findByDbBlockId($this->id); $out = CcBlockcriteriaQuery::create()->orderByDbCriteria()->findByDbBlockId($this->id);
$storedCrit = array(); $storedCrit = array();
@ -1365,11 +1380,20 @@ SQL;
$extra = $crit->getDbExtra(); $extra = $crit->getDbExtra();
if ($criteria == "limit") { if ($criteria == "limit") {
$storedCrit["limit"] = array("value"=>$value, "modifier"=>$modifier); $storedCrit["limit"] = array(
"value"=>$value,
"modifier"=>$modifier,
"display_modifier"=>_($modifier));
} else if($criteria == "repeat_tracks") { } else if($criteria == "repeat_tracks") {
$storedCrit["repeat_tracks"] = array("value"=>$value); $storedCrit["repeat_tracks"] = array("value"=>$value);
} else { } else {
$storedCrit["crit"][$criteria][] = array("criteria"=>$criteria, "value"=>$value, "modifier"=>$modifier, "extra"=>$extra, "display_name"=>$criteriaOptions[$criteria]); $storedCrit["crit"][$criteria][] = array(
"criteria"=>$criteria,
"value"=>$value,
"modifier"=>$modifier,
"extra"=>$extra,
"display_name"=>$criteriaOptions[$criteria],
"display_modifier"=>$modifierOptions[$modifier]);
} }
} }

View file

@ -411,26 +411,38 @@ SQL;
|| $obj instanceof CcWebstream || || $obj instanceof CcWebstream ||
$obj instanceof CcBlock) { $obj instanceof CcBlock) {
$entry = $this->plItem; $entry = $this->plItem;
$entry["id"] = $obj->getDbId(); $entry["id"] = $obj->getDbId();
$entry["pos"] = $pos; $entry["pos"] = $pos;
$entry["cliplength"] = $obj->getDbLength(); $entry["cliplength"] = $obj->getDbLength();
if ($obj instanceof CcFiles && $obj) { if ($obj instanceof CcFiles && $obj) {
$entry["cuein"] = $obj->getDbCuein();
$entry["cueout"] = $obj->getDbCueout(); $entry["cuein"] = isset($p_item['cuein']) ?
$p_item['cuein'] : $obj->getDbCuein();
$entry["cueout"] = isset($p_item['cueout']) ?
$p_item['cueout'] : $obj->getDbCueout();
$cue_out = Application_Common_DateHelper::calculateLengthInSeconds($entry['cueout']); $cue_in = isset($p_item['cueInSec']) ?
$cue_in = Application_Common_DateHelper::calculateLengthInSeconds($entry['cuein']); $p_item['cueInSec'] : Application_Common_DateHelper::calculateLengthInSeconds($entry['cuein']);
$entry["cliplength"] = Application_Common_DateHelper::secondsToPlaylistTime($cue_out-$cue_in);
} elseif ($obj instanceof CcWebstream && $obj) { $cue_out = isset($p_item['cueOutSec']) ?
$p_item['cueOutSec'] : Application_Common_DateHelper::calculateLengthInSeconds($entry['cueout']);
$entry["cliplength"] = isset($p_item['length']) ?
$p_item['length'] : Application_Common_DateHelper::secondsToPlaylistTime($cue_out-$cue_in);
}
elseif ($obj instanceof CcWebstream && $obj) {
$entry["cuein"] = "00:00:00"; $entry["cuein"] = "00:00:00";
$entry["cueout"] = $entry["cliplength"]; $entry["cueout"] = $entry["cliplength"];
} }
$entry["ftype"] = $objType; $entry["ftype"] = $objType;
} }
return $entry; return $entry;
} else { }
else {
throw new Exception("trying to add a object that does not exist."); throw new Exception("trying to add a object that does not exist.");
} }
} }

View file

@ -587,13 +587,13 @@ var AIRTIME = (function(AIRTIME){
var extra = (ele['extra']==null)?"":"- "+ele['extra']; var extra = (ele['extra']==null)?"":"- "+ele['extra'];
$html += "<li>" + $html += "<li>" +
"<span class='block-item-title'>"+ele['display_name']+"</span>" + "<span class='block-item-title'>"+ele['display_name']+"</span>" +
"<span class='block-item-criteria'>"+ele['modifier']+"</span>" + "<span class='block-item-criteria'>"+ele['display_modifier']+"</span>" +
"<span class='block-item-criteria'>"+ele['value']+"</span>" + "<span class='block-item-criteria'>"+ele['value']+"</span>" +
"<span class='block-item-criteria'>"+extra+"</span>" + "<span class='block-item-criteria'>"+extra+"</span>" +
"</li>"; "</li>";
}); });
} }
$html += "<li><br /><span class='block-item-title'>"+$.i18n._("Limit to: ")+data.limit.value+" "+data.limit.modifier+"</span></li>"; $html += "<li><br /><span class='block-item-title'>"+$.i18n._("Limit to: ")+data.limit.value+" "+data.limit.display_modifier+"</span></li>";
} }
$pl.find("#block_"+id+"_info").html($html).show(); $pl.find("#block_"+id+"_info").html($html).show();
mod.enableUI(); mod.enableUI();