-changes to list view. Framework so that we may change selected day

-changes to add-user. Started implementing Vladimirs design.
This commit is contained in:
mkonecny 2011-02-07 19:03:14 -05:00
parent e9691f9a4c
commit bc5b9efb4b
19 changed files with 351 additions and 69 deletions

View file

@ -12,6 +12,10 @@ class Application_Model_DateHelper
return date("Y-m-d H:i:s", $this->_timestamp);
}
function setDate($dateString){
$this->_timestamp = strtotime($dateString);
}
function getNowDayStartDiff(){
$dayStartTS = strtotime(date("Y-m-d", $this->_timestamp));
return $this->_timestamp - $dayStartTS;

View file

@ -42,13 +42,13 @@ class Application_Model_Nowplaying
return $rows;
}
public static function GetDataGridData($viewType){
$date = Schedule::GetSchedulerTime();
$timeNow = $date->getDate();
public static function GetDataGridData($viewType, $dateString){
if ($viewType == "now"){
$date = new Application_Model_DateHelper;
$timeNow = $date->getDate();
/* When do "ORDER BY x DESC LIMIT 5" to ensure that we get the last 5 previously scheduled items.
* However using DESC, puts our scheduled items in reverse order, so we need to reverse it again
* with array_reverse.
@ -58,6 +58,10 @@ class Application_Model_Nowplaying
$next = Schedule::Get_Scheduled_Item_Data($timeNow, 1, 10, "24 hours");
} else {
$date = new Application_Model_DateHelper;
$timeNow = $date->setDate($dateString);
$timeNow = $date->getDate();
$previous = array_reverse(Schedule::Get_Scheduled_Item_Data($timeNow, -1, "ALL", $date->getNowDayStartDiff()." seconds"));
$current = Schedule::Get_Scheduled_Item_Data($timeNow, 0);
$next = Schedule::Get_Scheduled_Item_Data($timeNow, 1, "ALL", $date->getNowDayEndDiff()." seconds");

View file

@ -419,21 +419,6 @@ class Schedule {
return $rows;
}
/**
* Returns the date of the server in the format
* "YYYY-MM-DD HH:mm:SS".
*
* Note: currently assuming that Web Server and Scheduler are on the
* same host.
*
* @return date Current server time.
*/
public static function GetSchedulerTime() {
$date = new Application_Model_DateHelper;
return $date;
}
/**
* Returns data related to the scheduled items.
*
@ -447,7 +432,7 @@ class Schedule {
return array();
}
$date = Schedule::GetSchedulerTime();
$date = new Application_Model_DateHelper;
$timeNow = $date->getDate();
return array("env"=>APPLICATION_ENV,
"schedulerTime"=>gmdate("Y-m-d H:i:s"),

View file

@ -1797,7 +1797,7 @@ class StoredFile {
return StoredFile::searchFiles($fromTable, $datatables);
}
private static function searchFiles($fromTable, $data)
public static function searchFiles($fromTable, $data)
{
global $CC_CONFIG, $CC_DBC;

View file

@ -71,5 +71,11 @@ class User {
public static function getHosts($search=NULL) {
return User::getUsers(array('H', 'A'), $search);
}
public static function getUsersDataTablesInfo($datatables_post) {
$fromTable = "cc_subjs";
return StoredFile::searchFiles($fromTable, $datatables_post);
}
}