Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
denise 2012-05-07 15:08:47 -04:00
commit 0a03bba5b7
4 changed files with 63 additions and 13 deletions

View file

@ -1583,7 +1583,7 @@ class Application_Model_Show {
$interval = $p_start->diff($p_end);
$days = $interval->format('%a');
$shows = Application_Model_Show::getShows($p_start, $p_end);
$today_timestamp = gmdate("Y-m-d H:i:s");
$nowEpoch = time();
foreach ($shows as $show) {
$options = array();
@ -1593,8 +1593,17 @@ class Application_Model_Show {
if (intval($days) <= 7) {
$options["percent"] = Application_Model_Show::getPercentScheduled($show["starts"], $show["ends"], $show["time_filled"]);
}
$startsDT = new DateTime($show["starts"], new DateTimeZone("UTC"));
$endsDT = new DateTime($show["ends"], new DateTimeZone("UTC"));
$startsEpoch = intval($startsDT->format("U"));
$endsEpoch = intval($endsDT->format("U"));
if ($p_editable && (strtotime($today_timestamp) < strtotime($show["ends"]))) {
if ($p_editable && $show["record"] && $nowEpoch < $endsEpoch) {
$options["editable"] = false;
}
else if ($p_editable && $nowEpoch < $endsEpoch) {
$options["editable"] = true;
}
$events[] = Application_Model_Show::makeFullCalendarEvent($show, $options);

View file

@ -879,6 +879,11 @@ Logging::log("getting media! - 2");
$audio_stor = Application_Common_OsPath::join($stor, "organize", $fileName);
Logging::log("copyFileToStor: moving file $audio_file to $audio_stor");
if (chmod($audio_file, 0644) === false){
Logging::log("Warning: couldn't change permissions of $audio_file to 0644");
}
//Martin K.: changed to rename: Much less load + quicker since this is an atomic operation
$r = @rename($audio_file, $audio_stor);