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

This commit is contained in:
denise 2012-09-18 15:29:08 -04:00
commit 0241eb4714
6 changed files with 26 additions and 11 deletions

View File

@ -109,7 +109,7 @@ class UserController extends Zend_Controller_Action
# TODO : remove this. we only use default for now not to break the UI.
if (!$files_action) { # set default action
$files_action = "reassign_to";
$delId = 1;
$new_owner = Application_Model_User::getFirstAdmin();
}
# only delete when valid action is selected for the owned files
@ -132,8 +132,11 @@ class UserController extends Zend_Controller_Action
if ($files_action == "delete_cascade") {
$user->deleteAllFiles();
} elseif ($files_action == "reassign_to") {
$new_owner = $this->_getParam("new_owner");
$user->reassignTo( $new_owner );
// TODO : fix code to actually use the line below and pick a
// real owner instead of defaulting to the first found admin
//$new_owner_id = $this->_getParam("new_owner");
//$new_owner = new Application_Model_User($new_owner_id);
$user->donateFilesTo( $new_owner );
}
# Finally delete the user
$this->view->entries = $user->delete();

View File

@ -696,6 +696,7 @@ SQL;
'start' => $start,
'end' => $end,
'show_name' => $item["show_name"],
'row_id' => $item["id"],
'independent_event' => true
);
self::appendScheduleItem($data, $start, $schedule_item);

View File

@ -215,7 +215,7 @@ class Application_Model_User
return $user->getCcFilessRelatedByDbOwnerId();
}
public function donateFilesTo($user)
public function donateFilesTo($user) // $user is object not user id
{
$my_files = $this->getOwnedFiles();
foreach ($my_files as $file) {
@ -242,18 +242,27 @@ class Application_Model_User
{
return CcSubjsQuery::create()->filterByDbType($type)->find();
}
public static function getFirstAdminId()
{
public static function getFirstAdmin() {
$admins = Application_Model_User::getUsersOfType('A');
if (count($admins) > 0) { // found admin => pick first one
return $admins[0]->getDbId();
return $admins[0];
} else {
Logging::warn("Warning. no admins found in database");
return null;
}
}
public static function getFirstAdminId()
{
$admin = self::getFirstAdmin();
if ($admin) {
return $admin->getDbId();
} else {
return null;
}
}
public static function getUsers(array $type, $search=null)
{
$con = Propel::getConnection();

View File

@ -216,9 +216,9 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
}
// TODO : Fix this interface
//This function should not be defined in the interface.
public function setMetadata($key, $val)
{
//This function should not be defined in the interface.
throw new Exception("Not implemented.");
}

View File

@ -41,11 +41,13 @@ stream_harbor_pass = list.hd(get_process_lines('pwgen -s -N 1 -n 20'))
web_stream = input.harbor("test-harbor", port=8999, password=stream_harbor_pass)
web_stream = on_metadata(notify_stream, web_stream)
output.dummy(fallible=true, web_stream)
queue = on_metadata(notify, queue)
queue = map_metadata(update=false, append_title, queue)
# the crossfade function controls fade in/out
queue = crossfade(queue)
output.dummy(fallible=true, queue)
stream_queue = switch(id="stream_queue_switch", track_sensitive=false,

View File

@ -191,7 +191,7 @@ class PypoPush(Thread):
if self.current_stream_info is None:
correct = False
else:
correct = self.current_stream_info['uri'] == media_item['uri']
correct = self.current_stream_info['row_id'] == media_item['row_id']
self.logger.debug("Is current item correct?: %s", str(correct))
return correct