Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
Conflicts: airtime_mvc/application/models/StoredFile.php airtime_mvc/application/models/airtime/om/BaseCcFiles.php airtime_mvc/application/models/airtime/om/BaseCcFilesPeer.php
This commit is contained in:
commit
d5d4d50a9e
24 changed files with 4604 additions and 373 deletions
|
@ -11,6 +11,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('contents', 'json')
|
||||
->addActionContext('delete', 'json')
|
||||
->addActionContext('delete-group', 'json')
|
||||
->addActionContext('context-menu', 'json')
|
||||
->addActionContext('get-file-meta-data', 'html')
|
||||
->addActionContext('upload-file-soundcloud', 'json')
|
||||
|
@ -31,12 +32,16 @@ class LibraryController extends Zend_Controller_Action
|
|||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/js/jquery.dataTables.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.pluginAPI.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.fnSetFilteringDelay.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.ColVis.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.ColReorder.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.FixedColumns.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/library.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/advancedsearch.js','text/javascript');
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'/css/media_library.css');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'/css/contextmenu.css');
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'/css/datatables/css/ColVis.css');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'/css/datatables/css/ColReorder.css');
|
||||
|
||||
$this->_helper->layout->setLayout('library');
|
||||
$this->_helper->viewRenderer->setResponseSegment('library');
|
||||
|
@ -179,26 +184,66 @@ class LibraryController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
|
||||
public function deleteGroupAction()
|
||||
{
|
||||
$ids = $this->_getParam('ids');
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new Application_Model_User($userInfo->id);
|
||||
|
||||
if ($user->isAdmin()) {
|
||||
|
||||
if (!is_null($ids)) {
|
||||
foreach ($ids as $key => $id) {
|
||||
$file = Application_Model_StoredFile::Recall($id);
|
||||
|
||||
if (PEAR::isError($file)) {
|
||||
$this->view->message = $file->getMessage();
|
||||
return;
|
||||
}
|
||||
else if(is_null($file)) {
|
||||
$this->view->message = "file doesn't exist";
|
||||
return;
|
||||
}
|
||||
|
||||
$res = $file->delete();
|
||||
|
||||
if (PEAR::isError($res)) {
|
||||
$this->view->message = $res->getMessage();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
$res = settype($res, "integer");
|
||||
$data = array("filepath" => $file->getFilePath(), "delete" => $res);
|
||||
Application_Model_RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->ids = $ids;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function contentsAction()
|
||||
{
|
||||
$post = $this->getRequest()->getPost();
|
||||
Logging::log(print_r($post, true));
|
||||
$datatables = Application_Model_StoredFile::searchFilesForPlaylistBuilder($post);
|
||||
|
||||
//format clip lengh to 1 decimal
|
||||
foreach($datatables["aaData"] as &$data){
|
||||
if($data[6] == 'audioclip'){
|
||||
$file = Application_Model_StoredFile::Recall($data[0]);
|
||||
if($data['ftype'] == 'audioclip'){
|
||||
$file = Application_Model_StoredFile::Recall($data['id']);
|
||||
$scid = $file->getSoundCloudId();
|
||||
if($scid == "-2"){
|
||||
$data[1] .= '<span id="'.$data[0].'" class="small-icon progress"></span>';
|
||||
$data['track_title'] .= '<span id="'.$data['id'].'" class="small-icon progress"></span>';
|
||||
}else if($scid == "-3"){
|
||||
$data[1] .= '<span id="'.$data[0].'" class="small-icon sc-error"></span>';
|
||||
$data['track_title'] .= '<span id="'.$data['id'].'" class="small-icon sc-error"></span>';
|
||||
}else if(!is_null($scid)){
|
||||
$data[1] .= '<span id="'.$data[0].'" class="small-icon soundcloud"></span>';
|
||||
$data['track_title'] .= '<span id="'.$data['id'].'" class="small-icon soundcloud"></span>';
|
||||
}
|
||||
}
|
||||
$sec = Application_Model_Playlist::playlistTimeToSeconds($data[5]);
|
||||
$data[5] = Application_Model_Playlist::secondsToPlaylistTime($sec);
|
||||
$sec = Application_Model_Playlist::playlistTimeToSeconds($data['length']);
|
||||
$data['length'] = Application_Model_Playlist::secondsToPlaylistTime($sec);
|
||||
}
|
||||
|
||||
die(json_encode($datatables));
|
||||
|
|
|
@ -9,6 +9,8 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('add-item', 'json')
|
||||
->addActionContext('delete-item', 'json')
|
||||
->addActionContext('add-group', 'json')
|
||||
->addActionContext('delete-group', 'json')
|
||||
->addActionContext('set-fade', 'json')
|
||||
->addActionContext('set-cue', 'json')
|
||||
->addActionContext('move-item', 'json')
|
||||
|
@ -209,6 +211,59 @@ class PlaylistController extends Zend_Controller_Action
|
|||
unset($this->view->pl);
|
||||
}
|
||||
|
||||
public function addGroupAction()
|
||||
{
|
||||
$ids = $this->_getParam('ids');
|
||||
$pos = $this->_getParam('pos', null);
|
||||
|
||||
if (!is_null($ids)) {
|
||||
$pl = $this->getPlaylist();
|
||||
if ($pl === false) {
|
||||
$this->view->playlist_error = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($ids as $key => $value) {
|
||||
$res = $pl->addAudioClip($value);
|
||||
if (PEAR::isError($res)) {
|
||||
$this->view->message = $res->getMessage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->pl = $pl;
|
||||
$this->view->html = $this->view->render('playlist/update.phtml');
|
||||
$this->view->name = $pl->getName();
|
||||
$this->view->length = $pl->getLength();
|
||||
$this->view->description = $pl->getDescription();
|
||||
return;
|
||||
}
|
||||
$this->view->message = "a file is not chosen";
|
||||
}
|
||||
|
||||
public function deleteGroupAction()
|
||||
{
|
||||
$ids = $this->_getParam('ids', null);
|
||||
|
||||
foreach ($ids as $key => $id) {
|
||||
$pl = Application_Model_Playlist::Recall($id);
|
||||
|
||||
if ($pl !== FALSE) {
|
||||
Application_Model_Playlist::Delete($id);
|
||||
$pl_sess = $this->pl_sess;
|
||||
if($pl_sess->id === $id){
|
||||
unset($pl_sess->id);
|
||||
}
|
||||
} else {
|
||||
$this->view->playlist_error = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->ids = $ids;
|
||||
$this->view->html = $this->view->render('playlist/index.phtml');
|
||||
}
|
||||
|
||||
public function setCueAction()
|
||||
{
|
||||
$pos = $this->_getParam('pos');
|
||||
|
|
|
@ -443,7 +443,8 @@ class Application_Model_Playlist {
|
|||
$pl = new CcPlaylist();
|
||||
$pl->setDbName($this->name);
|
||||
$pl->setDbState("incomplete");
|
||||
$pl->setDbMtime(new DateTime("now", new DateTimeZone("UTC")));
|
||||
$pl->setDbMtime(new DateTime("now"), new DateTimeZone("UTC"));
|
||||
$pl->setDbUtime(new DateTime("now"), new DateTimeZone("UTC"));
|
||||
$pl->save();
|
||||
|
||||
$this->id = $pl->getDbId();
|
||||
|
@ -534,6 +535,10 @@ class Application_Model_Playlist {
|
|||
|
||||
$res = $this->insertPlaylistElement($this->id, $p_mediaId, $p_position, $p_cliplength, $p_cuein, $p_cueout, $p_fadeIn, $p_fadeOut);
|
||||
|
||||
$pl = CcPlaylistQuery::create()->findPK($this->id);
|
||||
$pl->setDbMtime(new DateTime("now"), new DateTimeZone("UTC"));
|
||||
$pl->save();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -559,6 +564,11 @@ class Application_Model_Playlist {
|
|||
return FALSE;
|
||||
|
||||
$row->delete();
|
||||
|
||||
$pl = CcPlaylistQuery::create()->findPK($this->id);
|
||||
$pl->setDbMtime(new DateTime("now"), new DateTimeZone("UTC"));
|
||||
$pl->save();
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
|
@ -584,6 +594,10 @@ class Application_Model_Playlist {
|
|||
if($res !== TRUE)
|
||||
return FALSE;
|
||||
|
||||
$pl = CcPlaylistQuery::create()->findPK($this->id);
|
||||
$pl->setDbMtime(new DateTime("now"), new DateTimeZone("UTC"));
|
||||
$pl->save();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -90,6 +90,9 @@ class Application_Model_StoredFile {
|
|||
}
|
||||
$this->setDbColMetadata($dbMd);
|
||||
}
|
||||
|
||||
$this->_file->setDbMtime(new DateTime("now"), new DateTimeZone("UTC"));
|
||||
$this->_file->save();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -120,6 +123,7 @@ class Application_Model_StoredFile {
|
|||
}
|
||||
}
|
||||
|
||||
$this->_file->setDbMtime(new DateTime("now"), new DateTimeZone("UTC"));
|
||||
$this->_file->save();
|
||||
}
|
||||
|
||||
|
@ -494,6 +498,8 @@ class Application_Model_StoredFile {
|
|||
{
|
||||
$file = new CcFiles();
|
||||
$file->setDbGunid(md5(uniqid("", true)));
|
||||
$file->setDbUtime(new DateTime("now"), new DateTimeZone("UTC"));
|
||||
$file->setDbMtime(new DateTime("now"), new DateTimeZone("UTC"));
|
||||
|
||||
$storedFile = new Application_Model_StoredFile();
|
||||
$storedFile->_file = $file;
|
||||
|
@ -636,32 +642,38 @@ class Application_Model_StoredFile {
|
|||
return $res;
|
||||
}
|
||||
|
||||
public static function searchFilesForPlaylistBuilder($datatables) {
|
||||
public static function searchFilesForPlaylistBuilder($datatables)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
$displayData = array("track_title", "artist_name", "album_title", "genre", "length", "ftype");
|
||||
$displayData = array("track_title", "artist_name", "album_title", "genre", "length", "year", "utime", "mtime", "ftype");
|
||||
|
||||
$plSelect = "SELECT ";
|
||||
$fileSelect = "SELECT ";
|
||||
foreach ($displayData as $key){
|
||||
foreach ($displayData as $key) {
|
||||
|
||||
if($key === "track_title"){
|
||||
if ($key === "track_title") {
|
||||
$plSelect .= "name AS ".$key.", ";
|
||||
$fileSelect .= $key.", ";
|
||||
}
|
||||
else if ($key === "ftype"){
|
||||
} else if ($key === "ftype") {
|
||||
$plSelect .= "'playlist' AS ".$key.", ";
|
||||
$fileSelect .= $key.", ";
|
||||
}
|
||||
else if ($key === "artist_name"){
|
||||
} else if ($key === "artist_name") {
|
||||
$plSelect .= "creator AS ".$key.", ";
|
||||
$fileSelect .= $key.", ";
|
||||
}
|
||||
else if ($key === "length"){
|
||||
} else if ($key === "length") {
|
||||
$plSelect .= $key.", ";
|
||||
$fileSelect .= $key.", ";
|
||||
}
|
||||
else {
|
||||
} else if ($key === "year") {
|
||||
$plSelect .= "CAST(utime AS varchar) AS ".$key.", ";
|
||||
$fileSelect .= $key.", ";
|
||||
} else if ($key === "utime") {
|
||||
$plSelect .= $key.", ";
|
||||
$fileSelect .= $key.", ";
|
||||
} else if ($key === "mtime") {
|
||||
$plSelect .= $key.", ";
|
||||
$fileSelect .= $key.", ";
|
||||
} else {
|
||||
$plSelect .= "NULL AS ".$key.", ";
|
||||
$fileSelect .= $key.", ";
|
||||
}
|
||||
|
@ -670,13 +682,10 @@ class Application_Model_StoredFile {
|
|||
$fromTable = " ((".$plSelect."PL.id
|
||||
FROM ".$CC_CONFIG["playListTable"]." AS PL
|
||||
LEFT JOIN ".$CC_CONFIG['playListTimeView']." AS PLT USING(id))
|
||||
|
||||
UNION
|
||||
|
||||
(".$fileSelect."id FROM ".$CC_CONFIG["filesTable"]." AS FILES WHERE file_exist = 'TRUE')) AS RESULTS";
|
||||
|
||||
return Application_Model_StoredFile::searchFiles($fromTable, $datatables);
|
||||
|
||||
}
|
||||
|
||||
public static function searchPlaylistsForSchedule($datatables)
|
||||
|
@ -698,7 +707,12 @@ class Application_Model_StoredFile {
|
|||
$searchTerms = explode(" ", $data["sSearch"]);
|
||||
|
||||
$selectorCount = "SELECT COUNT(*)";
|
||||
$selectorRows = "SELECT ". join("," , $columnsDisplayed);
|
||||
foreach( $columnsDisplayed as $key=>$col){
|
||||
if($col == ''){
|
||||
unset($columnsDisplayed[$key]);
|
||||
}
|
||||
}
|
||||
$selectorRows = "SELECT " . join(',', $columnsDisplayed );
|
||||
|
||||
$sql = $selectorCount." FROM ".$fromTable;
|
||||
$totalRows = $CC_DBC->getOne($sql);
|
||||
|
@ -741,7 +755,7 @@ class Application_Model_StoredFile {
|
|||
// End Order By clause
|
||||
|
||||
//ordered by integer as expected by datatables.
|
||||
$CC_DBC->setFetchMode(DB_FETCHMODE_ORDERED);
|
||||
//$CC_DBC->setFetchMode(DB_FETCHMODE_ORDERED);
|
||||
|
||||
if(isset($where)) {
|
||||
$where = join(" AND ", $where);
|
||||
|
@ -754,6 +768,18 @@ class Application_Model_StoredFile {
|
|||
}
|
||||
|
||||
$results = $CC_DBC->getAll($sql);
|
||||
foreach($results as &$row){
|
||||
// add checkbox row
|
||||
$row['checkbox'] = "<input type='checkbox' name='cb_".$row[id]."'>";
|
||||
|
||||
// a full timestamp is being returned for playlists' year column;
|
||||
// split it and grab only the year info
|
||||
$yearSplit = explode('-', $row['year']);
|
||||
$row['year'] = $yearSplit[0];
|
||||
}
|
||||
//$results['checkbox']
|
||||
//$results = $CC_DBC->getAssoc($sql);
|
||||
Logging::log(print_r($results, true));
|
||||
//echo $results;
|
||||
//echo $sql;
|
||||
|
||||
|
|
|
@ -49,6 +49,8 @@ class CcFilesTableMap extends TableMap {
|
|||
$this->addColumn('CURRENTLYACCESSING', 'DbCurrentlyaccessing', 'INTEGER', true, null, 0);
|
||||
$this->addForeignKey('EDITEDBY', 'DbEditedby', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
|
||||
$this->addColumn('MTIME', 'DbMtime', 'TIMESTAMP', false, 6, null);
|
||||
$this->addColumn('UTIME', 'DbUtime', 'TIMESTAMP', false, 6, null);
|
||||
$this->addColumn('LPTIME', 'DbLPtime', 'TIMESTAMP', false, 6, null);
|
||||
$this->addColumn('MD5', 'DbMd5', 'CHAR', false, 32, null);
|
||||
$this->addColumn('TRACK_TITLE', 'DbTrackTitle', 'VARCHAR', false, 512, null);
|
||||
$this->addColumn('ARTIST_NAME', 'DbArtistName', 'VARCHAR', false, 512, null);
|
||||
|
|
|
@ -44,6 +44,8 @@ class CcPlaylistTableMap extends TableMap {
|
|||
$this->addColumn('CURRENTLYACCESSING', 'DbCurrentlyaccessing', 'INTEGER', true, null, 0);
|
||||
$this->addForeignKey('EDITEDBY', 'DbEditedby', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
|
||||
$this->addColumn('MTIME', 'DbMtime', 'TIMESTAMP', false, 6, null);
|
||||
$this->addColumn('UTIME', 'DbUtime', 'TIMESTAMP', false, 6, null);
|
||||
$this->addColumn('LPTIME', 'DbLPtime', 'TIMESTAMP', false, 6, null);
|
||||
$this->addColumn('CREATOR', 'DbCreator', 'VARCHAR', false, 32, null);
|
||||
$this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null);
|
||||
// validators
|
||||
|
|
|
@ -96,6 +96,18 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
*/
|
||||
protected $mtime;
|
||||
|
||||
/**
|
||||
* The value for the utime field.
|
||||
* @var string
|
||||
*/
|
||||
protected $utime;
|
||||
|
||||
/**
|
||||
* The value for the lptime field.
|
||||
* @var string
|
||||
*/
|
||||
protected $lptime;
|
||||
|
||||
/**
|
||||
* The value for the md5 field.
|
||||
* @var string
|
||||
|
@ -590,6 +602,72 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [utime] column value.
|
||||
*
|
||||
*
|
||||
* @param string $format The date/time format string (either date()-style or strftime()-style).
|
||||
* If format is NULL, then the raw DateTime object will be returned.
|
||||
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
|
||||
* @throws PropelException - if unable to parse/validate the date/time value.
|
||||
*/
|
||||
public function getDbUtime($format = 'Y-m-d H:i:s')
|
||||
{
|
||||
if ($this->utime === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
try {
|
||||
$dt = new DateTime($this->utime);
|
||||
} catch (Exception $x) {
|
||||
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->utime, true), $x);
|
||||
}
|
||||
|
||||
if ($format === null) {
|
||||
// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
|
||||
return $dt;
|
||||
} elseif (strpos($format, '%') !== false) {
|
||||
return strftime($format, $dt->format('U'));
|
||||
} else {
|
||||
return $dt->format($format);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [lptime] column value.
|
||||
*
|
||||
*
|
||||
* @param string $format The date/time format string (either date()-style or strftime()-style).
|
||||
* If format is NULL, then the raw DateTime object will be returned.
|
||||
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
|
||||
* @throws PropelException - if unable to parse/validate the date/time value.
|
||||
*/
|
||||
public function getDbLPtime($format = 'Y-m-d H:i:s')
|
||||
{
|
||||
if ($this->lptime === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
try {
|
||||
$dt = new DateTime($this->lptime);
|
||||
} catch (Exception $x) {
|
||||
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->lptime, true), $x);
|
||||
}
|
||||
|
||||
if ($format === null) {
|
||||
// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
|
||||
return $dt;
|
||||
} elseif (strpos($format, '%') !== false) {
|
||||
return strftime($format, $dt->format('U'));
|
||||
} else {
|
||||
return $dt->format($format);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [md5] column value.
|
||||
*
|
||||
|
@ -1360,6 +1438,104 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
return $this;
|
||||
} // setDbMtime()
|
||||
|
||||
/**
|
||||
* Sets the value of [utime] column to a normalized version of the date/time value specified.
|
||||
*
|
||||
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
|
||||
* be treated as NULL for temporal objects.
|
||||
* @return CcFiles The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbUtime($v)
|
||||
{
|
||||
// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
|
||||
// -- which is unexpected, to say the least.
|
||||
if ($v === null || $v === '') {
|
||||
$dt = null;
|
||||
} elseif ($v instanceof DateTime) {
|
||||
$dt = $v;
|
||||
} else {
|
||||
// some string/numeric value passed; we normalize that so that we can
|
||||
// validate it.
|
||||
try {
|
||||
if (is_numeric($v)) { // if it's a unix timestamp
|
||||
$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
|
||||
// We have to explicitly specify and then change the time zone because of a
|
||||
// DateTime bug: http://bugs.php.net/bug.php?id=43003
|
||||
$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
|
||||
} else {
|
||||
$dt = new DateTime($v);
|
||||
}
|
||||
} catch (Exception $x) {
|
||||
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->utime !== null || $dt !== null ) {
|
||||
// (nested ifs are a little easier to read in this case)
|
||||
|
||||
$currNorm = ($this->utime !== null && $tmpDt = new DateTime($this->utime)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null;
|
||||
$newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null;
|
||||
|
||||
if ( ($currNorm !== $newNorm) // normalized values don't match
|
||||
)
|
||||
{
|
||||
$this->utime = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null);
|
||||
$this->modifiedColumns[] = CcFilesPeer::UTIME;
|
||||
}
|
||||
} // if either are not null
|
||||
|
||||
return $this;
|
||||
} // setDbUtime()
|
||||
|
||||
/**
|
||||
* Sets the value of [lptime] column to a normalized version of the date/time value specified.
|
||||
*
|
||||
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
|
||||
* be treated as NULL for temporal objects.
|
||||
* @return CcFiles The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbLPtime($v)
|
||||
{
|
||||
// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
|
||||
// -- which is unexpected, to say the least.
|
||||
if ($v === null || $v === '') {
|
||||
$dt = null;
|
||||
} elseif ($v instanceof DateTime) {
|
||||
$dt = $v;
|
||||
} else {
|
||||
// some string/numeric value passed; we normalize that so that we can
|
||||
// validate it.
|
||||
try {
|
||||
if (is_numeric($v)) { // if it's a unix timestamp
|
||||
$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
|
||||
// We have to explicitly specify and then change the time zone because of a
|
||||
// DateTime bug: http://bugs.php.net/bug.php?id=43003
|
||||
$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
|
||||
} else {
|
||||
$dt = new DateTime($v);
|
||||
}
|
||||
} catch (Exception $x) {
|
||||
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->lptime !== null || $dt !== null ) {
|
||||
// (nested ifs are a little easier to read in this case)
|
||||
|
||||
$currNorm = ($this->lptime !== null && $tmpDt = new DateTime($this->lptime)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null;
|
||||
$newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null;
|
||||
|
||||
if ( ($currNorm !== $newNorm) // normalized values don't match
|
||||
)
|
||||
{
|
||||
$this->lptime = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null);
|
||||
$this->modifiedColumns[] = CcFilesPeer::LPTIME;
|
||||
}
|
||||
} // if either are not null
|
||||
|
||||
return $this;
|
||||
} // setDbLPtime()
|
||||
|
||||
/**
|
||||
* Set the value of [md5] column.
|
||||
*
|
||||
|
@ -2440,55 +2616,57 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$this->currentlyaccessing = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null;
|
||||
$this->editedby = ($row[$startcol + 9] !== null) ? (int) $row[$startcol + 9] : null;
|
||||
$this->mtime = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null;
|
||||
$this->md5 = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null;
|
||||
$this->track_title = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null;
|
||||
$this->artist_name = ($row[$startcol + 13] !== null) ? (string) $row[$startcol + 13] : null;
|
||||
$this->bit_rate = ($row[$startcol + 14] !== null) ? (string) $row[$startcol + 14] : null;
|
||||
$this->sample_rate = ($row[$startcol + 15] !== null) ? (string) $row[$startcol + 15] : null;
|
||||
$this->format = ($row[$startcol + 16] !== null) ? (string) $row[$startcol + 16] : null;
|
||||
$this->length = ($row[$startcol + 17] !== null) ? (string) $row[$startcol + 17] : null;
|
||||
$this->album_title = ($row[$startcol + 18] !== null) ? (string) $row[$startcol + 18] : null;
|
||||
$this->genre = ($row[$startcol + 19] !== null) ? (string) $row[$startcol + 19] : null;
|
||||
$this->comments = ($row[$startcol + 20] !== null) ? (string) $row[$startcol + 20] : null;
|
||||
$this->year = ($row[$startcol + 21] !== null) ? (string) $row[$startcol + 21] : null;
|
||||
$this->track_number = ($row[$startcol + 22] !== null) ? (int) $row[$startcol + 22] : null;
|
||||
$this->channels = ($row[$startcol + 23] !== null) ? (int) $row[$startcol + 23] : null;
|
||||
$this->url = ($row[$startcol + 24] !== null) ? (string) $row[$startcol + 24] : null;
|
||||
$this->bpm = ($row[$startcol + 25] !== null) ? (string) $row[$startcol + 25] : null;
|
||||
$this->rating = ($row[$startcol + 26] !== null) ? (string) $row[$startcol + 26] : null;
|
||||
$this->encoded_by = ($row[$startcol + 27] !== null) ? (string) $row[$startcol + 27] : null;
|
||||
$this->disc_number = ($row[$startcol + 28] !== null) ? (string) $row[$startcol + 28] : null;
|
||||
$this->mood = ($row[$startcol + 29] !== null) ? (string) $row[$startcol + 29] : null;
|
||||
$this->label = ($row[$startcol + 30] !== null) ? (string) $row[$startcol + 30] : null;
|
||||
$this->composer = ($row[$startcol + 31] !== null) ? (string) $row[$startcol + 31] : null;
|
||||
$this->encoder = ($row[$startcol + 32] !== null) ? (string) $row[$startcol + 32] : null;
|
||||
$this->checksum = ($row[$startcol + 33] !== null) ? (string) $row[$startcol + 33] : null;
|
||||
$this->lyrics = ($row[$startcol + 34] !== null) ? (string) $row[$startcol + 34] : null;
|
||||
$this->orchestra = ($row[$startcol + 35] !== null) ? (string) $row[$startcol + 35] : null;
|
||||
$this->conductor = ($row[$startcol + 36] !== null) ? (string) $row[$startcol + 36] : null;
|
||||
$this->lyricist = ($row[$startcol + 37] !== null) ? (string) $row[$startcol + 37] : null;
|
||||
$this->original_lyricist = ($row[$startcol + 38] !== null) ? (string) $row[$startcol + 38] : null;
|
||||
$this->radio_station_name = ($row[$startcol + 39] !== null) ? (string) $row[$startcol + 39] : null;
|
||||
$this->info_url = ($row[$startcol + 40] !== null) ? (string) $row[$startcol + 40] : null;
|
||||
$this->artist_url = ($row[$startcol + 41] !== null) ? (string) $row[$startcol + 41] : null;
|
||||
$this->audio_source_url = ($row[$startcol + 42] !== null) ? (string) $row[$startcol + 42] : null;
|
||||
$this->radio_station_url = ($row[$startcol + 43] !== null) ? (string) $row[$startcol + 43] : null;
|
||||
$this->buy_this_url = ($row[$startcol + 44] !== null) ? (string) $row[$startcol + 44] : null;
|
||||
$this->isrc_number = ($row[$startcol + 45] !== null) ? (string) $row[$startcol + 45] : null;
|
||||
$this->catalog_number = ($row[$startcol + 46] !== null) ? (string) $row[$startcol + 46] : null;
|
||||
$this->original_artist = ($row[$startcol + 47] !== null) ? (string) $row[$startcol + 47] : null;
|
||||
$this->copyright = ($row[$startcol + 48] !== null) ? (string) $row[$startcol + 48] : null;
|
||||
$this->report_datetime = ($row[$startcol + 49] !== null) ? (string) $row[$startcol + 49] : null;
|
||||
$this->report_location = ($row[$startcol + 50] !== null) ? (string) $row[$startcol + 50] : null;
|
||||
$this->report_organization = ($row[$startcol + 51] !== null) ? (string) $row[$startcol + 51] : null;
|
||||
$this->subject = ($row[$startcol + 52] !== null) ? (string) $row[$startcol + 52] : null;
|
||||
$this->contributor = ($row[$startcol + 53] !== null) ? (string) $row[$startcol + 53] : null;
|
||||
$this->language = ($row[$startcol + 54] !== null) ? (string) $row[$startcol + 54] : null;
|
||||
$this->file_exist = ($row[$startcol + 55] !== null) ? (boolean) $row[$startcol + 55] : null;
|
||||
$this->soundcloud_id = ($row[$startcol + 56] !== null) ? (int) $row[$startcol + 56] : null;
|
||||
$this->soundcloud_error_code = ($row[$startcol + 57] !== null) ? (int) $row[$startcol + 57] : null;
|
||||
$this->soundcloud_error_msg = ($row[$startcol + 58] !== null) ? (string) $row[$startcol + 58] : null;
|
||||
$this->soundcloud_link_to_file = ($row[$startcol + 59] !== null) ? (string) $row[$startcol + 59] : null;
|
||||
$this->utime = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null;
|
||||
$this->lptime = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null;
|
||||
$this->md5 = ($row[$startcol + 13] !== null) ? (string) $row[$startcol + 13] : null;
|
||||
$this->track_title = ($row[$startcol + 14] !== null) ? (string) $row[$startcol + 14] : null;
|
||||
$this->artist_name = ($row[$startcol + 15] !== null) ? (string) $row[$startcol + 15] : null;
|
||||
$this->bit_rate = ($row[$startcol + 16] !== null) ? (string) $row[$startcol + 16] : null;
|
||||
$this->sample_rate = ($row[$startcol + 17] !== null) ? (string) $row[$startcol + 17] : null;
|
||||
$this->format = ($row[$startcol + 18] !== null) ? (string) $row[$startcol + 18] : null;
|
||||
$this->length = ($row[$startcol + 19] !== null) ? (string) $row[$startcol + 19] : null;
|
||||
$this->album_title = ($row[$startcol + 20] !== null) ? (string) $row[$startcol + 20] : null;
|
||||
$this->genre = ($row[$startcol + 21] !== null) ? (string) $row[$startcol + 21] : null;
|
||||
$this->comments = ($row[$startcol + 22] !== null) ? (string) $row[$startcol + 22] : null;
|
||||
$this->year = ($row[$startcol + 23] !== null) ? (string) $row[$startcol + 23] : null;
|
||||
$this->track_number = ($row[$startcol + 24] !== null) ? (int) $row[$startcol + 24] : null;
|
||||
$this->channels = ($row[$startcol + 25] !== null) ? (int) $row[$startcol + 25] : null;
|
||||
$this->url = ($row[$startcol + 26] !== null) ? (string) $row[$startcol + 26] : null;
|
||||
$this->bpm = ($row[$startcol + 27] !== null) ? (string) $row[$startcol + 27] : null;
|
||||
$this->rating = ($row[$startcol + 28] !== null) ? (string) $row[$startcol + 28] : null;
|
||||
$this->encoded_by = ($row[$startcol + 29] !== null) ? (string) $row[$startcol + 29] : null;
|
||||
$this->disc_number = ($row[$startcol + 30] !== null) ? (string) $row[$startcol + 30] : null;
|
||||
$this->mood = ($row[$startcol + 31] !== null) ? (string) $row[$startcol + 31] : null;
|
||||
$this->label = ($row[$startcol + 32] !== null) ? (string) $row[$startcol + 32] : null;
|
||||
$this->composer = ($row[$startcol + 33] !== null) ? (string) $row[$startcol + 33] : null;
|
||||
$this->encoder = ($row[$startcol + 34] !== null) ? (string) $row[$startcol + 34] : null;
|
||||
$this->checksum = ($row[$startcol + 35] !== null) ? (string) $row[$startcol + 35] : null;
|
||||
$this->lyrics = ($row[$startcol + 36] !== null) ? (string) $row[$startcol + 36] : null;
|
||||
$this->orchestra = ($row[$startcol + 37] !== null) ? (string) $row[$startcol + 37] : null;
|
||||
$this->conductor = ($row[$startcol + 38] !== null) ? (string) $row[$startcol + 38] : null;
|
||||
$this->lyricist = ($row[$startcol + 39] !== null) ? (string) $row[$startcol + 39] : null;
|
||||
$this->original_lyricist = ($row[$startcol + 40] !== null) ? (string) $row[$startcol + 40] : null;
|
||||
$this->radio_station_name = ($row[$startcol + 41] !== null) ? (string) $row[$startcol + 41] : null;
|
||||
$this->info_url = ($row[$startcol + 42] !== null) ? (string) $row[$startcol + 42] : null;
|
||||
$this->artist_url = ($row[$startcol + 43] !== null) ? (string) $row[$startcol + 43] : null;
|
||||
$this->audio_source_url = ($row[$startcol + 44] !== null) ? (string) $row[$startcol + 44] : null;
|
||||
$this->radio_station_url = ($row[$startcol + 45] !== null) ? (string) $row[$startcol + 45] : null;
|
||||
$this->buy_this_url = ($row[$startcol + 46] !== null) ? (string) $row[$startcol + 46] : null;
|
||||
$this->isrc_number = ($row[$startcol + 47] !== null) ? (string) $row[$startcol + 47] : null;
|
||||
$this->catalog_number = ($row[$startcol + 48] !== null) ? (string) $row[$startcol + 48] : null;
|
||||
$this->original_artist = ($row[$startcol + 49] !== null) ? (string) $row[$startcol + 49] : null;
|
||||
$this->copyright = ($row[$startcol + 50] !== null) ? (string) $row[$startcol + 50] : null;
|
||||
$this->report_datetime = ($row[$startcol + 51] !== null) ? (string) $row[$startcol + 51] : null;
|
||||
$this->report_location = ($row[$startcol + 52] !== null) ? (string) $row[$startcol + 52] : null;
|
||||
$this->report_organization = ($row[$startcol + 53] !== null) ? (string) $row[$startcol + 53] : null;
|
||||
$this->subject = ($row[$startcol + 54] !== null) ? (string) $row[$startcol + 54] : null;
|
||||
$this->contributor = ($row[$startcol + 55] !== null) ? (string) $row[$startcol + 55] : null;
|
||||
$this->language = ($row[$startcol + 56] !== null) ? (string) $row[$startcol + 56] : null;
|
||||
$this->file_exist = ($row[$startcol + 57] !== null) ? (boolean) $row[$startcol + 57] : null;
|
||||
$this->soundcloud_id = ($row[$startcol + 58] !== null) ? (int) $row[$startcol + 58] : null;
|
||||
$this->soundcloud_error_code = ($row[$startcol + 59] !== null) ? (int) $row[$startcol + 59] : null;
|
||||
$this->soundcloud_error_msg = ($row[$startcol + 60] !== null) ? (string) $row[$startcol + 60] : null;
|
||||
$this->soundcloud_link_to_file = ($row[$startcol + 61] !== null) ? (string) $row[$startcol + 61] : null;
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
@ -2497,7 +2675,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 60; // 60 = CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
return $startcol + 62; // 62 = CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating CcFiles object", $e);
|
||||
|
@ -2929,150 +3107,156 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
return $this->getDbMtime();
|
||||
break;
|
||||
case 11:
|
||||
return $this->getDbMd5();
|
||||
return $this->getDbUtime();
|
||||
break;
|
||||
case 12:
|
||||
return $this->getDbTrackTitle();
|
||||
return $this->getDbLPtime();
|
||||
break;
|
||||
case 13:
|
||||
return $this->getDbArtistName();
|
||||
return $this->getDbMd5();
|
||||
break;
|
||||
case 14:
|
||||
return $this->getDbBitRate();
|
||||
return $this->getDbTrackTitle();
|
||||
break;
|
||||
case 15:
|
||||
return $this->getDbSampleRate();
|
||||
return $this->getDbArtistName();
|
||||
break;
|
||||
case 16:
|
||||
return $this->getDbFormat();
|
||||
return $this->getDbBitRate();
|
||||
break;
|
||||
case 17:
|
||||
return $this->getDbLength();
|
||||
return $this->getDbSampleRate();
|
||||
break;
|
||||
case 18:
|
||||
return $this->getDbAlbumTitle();
|
||||
return $this->getDbFormat();
|
||||
break;
|
||||
case 19:
|
||||
return $this->getDbGenre();
|
||||
return $this->getDbLength();
|
||||
break;
|
||||
case 20:
|
||||
return $this->getDbComments();
|
||||
return $this->getDbAlbumTitle();
|
||||
break;
|
||||
case 21:
|
||||
return $this->getDbYear();
|
||||
return $this->getDbGenre();
|
||||
break;
|
||||
case 22:
|
||||
return $this->getDbTrackNumber();
|
||||
return $this->getDbComments();
|
||||
break;
|
||||
case 23:
|
||||
return $this->getDbChannels();
|
||||
return $this->getDbYear();
|
||||
break;
|
||||
case 24:
|
||||
return $this->getDbUrl();
|
||||
return $this->getDbTrackNumber();
|
||||
break;
|
||||
case 25:
|
||||
return $this->getDbBpm();
|
||||
return $this->getDbChannels();
|
||||
break;
|
||||
case 26:
|
||||
return $this->getDbRating();
|
||||
return $this->getDbUrl();
|
||||
break;
|
||||
case 27:
|
||||
return $this->getDbEncodedBy();
|
||||
return $this->getDbBpm();
|
||||
break;
|
||||
case 28:
|
||||
return $this->getDbDiscNumber();
|
||||
return $this->getDbRating();
|
||||
break;
|
||||
case 29:
|
||||
return $this->getDbMood();
|
||||
return $this->getDbEncodedBy();
|
||||
break;
|
||||
case 30:
|
||||
return $this->getDbLabel();
|
||||
return $this->getDbDiscNumber();
|
||||
break;
|
||||
case 31:
|
||||
return $this->getDbComposer();
|
||||
return $this->getDbMood();
|
||||
break;
|
||||
case 32:
|
||||
return $this->getDbEncoder();
|
||||
return $this->getDbLabel();
|
||||
break;
|
||||
case 33:
|
||||
return $this->getDbChecksum();
|
||||
return $this->getDbComposer();
|
||||
break;
|
||||
case 34:
|
||||
return $this->getDbLyrics();
|
||||
return $this->getDbEncoder();
|
||||
break;
|
||||
case 35:
|
||||
return $this->getDbOrchestra();
|
||||
return $this->getDbChecksum();
|
||||
break;
|
||||
case 36:
|
||||
return $this->getDbConductor();
|
||||
return $this->getDbLyrics();
|
||||
break;
|
||||
case 37:
|
||||
return $this->getDbLyricist();
|
||||
return $this->getDbOrchestra();
|
||||
break;
|
||||
case 38:
|
||||
return $this->getDbOriginalLyricist();
|
||||
return $this->getDbConductor();
|
||||
break;
|
||||
case 39:
|
||||
return $this->getDbRadioStationName();
|
||||
return $this->getDbLyricist();
|
||||
break;
|
||||
case 40:
|
||||
return $this->getDbInfoUrl();
|
||||
return $this->getDbOriginalLyricist();
|
||||
break;
|
||||
case 41:
|
||||
return $this->getDbArtistUrl();
|
||||
return $this->getDbRadioStationName();
|
||||
break;
|
||||
case 42:
|
||||
return $this->getDbAudioSourceUrl();
|
||||
return $this->getDbInfoUrl();
|
||||
break;
|
||||
case 43:
|
||||
return $this->getDbRadioStationUrl();
|
||||
return $this->getDbArtistUrl();
|
||||
break;
|
||||
case 44:
|
||||
return $this->getDbBuyThisUrl();
|
||||
return $this->getDbAudioSourceUrl();
|
||||
break;
|
||||
case 45:
|
||||
return $this->getDbIsrcNumber();
|
||||
return $this->getDbRadioStationUrl();
|
||||
break;
|
||||
case 46:
|
||||
return $this->getDbCatalogNumber();
|
||||
return $this->getDbBuyThisUrl();
|
||||
break;
|
||||
case 47:
|
||||
return $this->getDbOriginalArtist();
|
||||
return $this->getDbIsrcNumber();
|
||||
break;
|
||||
case 48:
|
||||
return $this->getDbCopyright();
|
||||
return $this->getDbCatalogNumber();
|
||||
break;
|
||||
case 49:
|
||||
return $this->getDbReportDatetime();
|
||||
return $this->getDbOriginalArtist();
|
||||
break;
|
||||
case 50:
|
||||
return $this->getDbReportLocation();
|
||||
return $this->getDbCopyright();
|
||||
break;
|
||||
case 51:
|
||||
return $this->getDbReportOrganization();
|
||||
return $this->getDbReportDatetime();
|
||||
break;
|
||||
case 52:
|
||||
return $this->getDbSubject();
|
||||
return $this->getDbReportLocation();
|
||||
break;
|
||||
case 53:
|
||||
return $this->getDbContributor();
|
||||
return $this->getDbReportOrganization();
|
||||
break;
|
||||
case 54:
|
||||
return $this->getDbLanguage();
|
||||
return $this->getDbSubject();
|
||||
break;
|
||||
case 55:
|
||||
return $this->getDbFileExist();
|
||||
return $this->getDbContributor();
|
||||
break;
|
||||
case 56:
|
||||
return $this->getDbSoundcloudId();
|
||||
return $this->getDbLanguage();
|
||||
break;
|
||||
case 57:
|
||||
return $this->getDbSoundcloudErrorCode();
|
||||
return $this->getDbFileExist();
|
||||
break;
|
||||
case 58:
|
||||
return $this->getDbSoundcloudErrorMsg();
|
||||
return $this->getDbSoundcloudId();
|
||||
break;
|
||||
case 59:
|
||||
return $this->getDbSoundcloudErrorCode();
|
||||
break;
|
||||
case 60:
|
||||
return $this->getDbSoundcloudErrorMsg();
|
||||
break;
|
||||
case 61:
|
||||
return $this->getDbSoundcloudLinkToFile();
|
||||
break;
|
||||
default:
|
||||
|
@ -3110,55 +3294,57 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$keys[8] => $this->getDbCurrentlyaccessing(),
|
||||
$keys[9] => $this->getDbEditedby(),
|
||||
$keys[10] => $this->getDbMtime(),
|
||||
$keys[11] => $this->getDbMd5(),
|
||||
$keys[12] => $this->getDbTrackTitle(),
|
||||
$keys[13] => $this->getDbArtistName(),
|
||||
$keys[14] => $this->getDbBitRate(),
|
||||
$keys[15] => $this->getDbSampleRate(),
|
||||
$keys[16] => $this->getDbFormat(),
|
||||
$keys[17] => $this->getDbLength(),
|
||||
$keys[18] => $this->getDbAlbumTitle(),
|
||||
$keys[19] => $this->getDbGenre(),
|
||||
$keys[20] => $this->getDbComments(),
|
||||
$keys[21] => $this->getDbYear(),
|
||||
$keys[22] => $this->getDbTrackNumber(),
|
||||
$keys[23] => $this->getDbChannels(),
|
||||
$keys[24] => $this->getDbUrl(),
|
||||
$keys[25] => $this->getDbBpm(),
|
||||
$keys[26] => $this->getDbRating(),
|
||||
$keys[27] => $this->getDbEncodedBy(),
|
||||
$keys[28] => $this->getDbDiscNumber(),
|
||||
$keys[29] => $this->getDbMood(),
|
||||
$keys[30] => $this->getDbLabel(),
|
||||
$keys[31] => $this->getDbComposer(),
|
||||
$keys[32] => $this->getDbEncoder(),
|
||||
$keys[33] => $this->getDbChecksum(),
|
||||
$keys[34] => $this->getDbLyrics(),
|
||||
$keys[35] => $this->getDbOrchestra(),
|
||||
$keys[36] => $this->getDbConductor(),
|
||||
$keys[37] => $this->getDbLyricist(),
|
||||
$keys[38] => $this->getDbOriginalLyricist(),
|
||||
$keys[39] => $this->getDbRadioStationName(),
|
||||
$keys[40] => $this->getDbInfoUrl(),
|
||||
$keys[41] => $this->getDbArtistUrl(),
|
||||
$keys[42] => $this->getDbAudioSourceUrl(),
|
||||
$keys[43] => $this->getDbRadioStationUrl(),
|
||||
$keys[44] => $this->getDbBuyThisUrl(),
|
||||
$keys[45] => $this->getDbIsrcNumber(),
|
||||
$keys[46] => $this->getDbCatalogNumber(),
|
||||
$keys[47] => $this->getDbOriginalArtist(),
|
||||
$keys[48] => $this->getDbCopyright(),
|
||||
$keys[49] => $this->getDbReportDatetime(),
|
||||
$keys[50] => $this->getDbReportLocation(),
|
||||
$keys[51] => $this->getDbReportOrganization(),
|
||||
$keys[52] => $this->getDbSubject(),
|
||||
$keys[53] => $this->getDbContributor(),
|
||||
$keys[54] => $this->getDbLanguage(),
|
||||
$keys[55] => $this->getDbFileExist(),
|
||||
$keys[56] => $this->getDbSoundcloudId(),
|
||||
$keys[57] => $this->getDbSoundcloudErrorCode(),
|
||||
$keys[58] => $this->getDbSoundcloudErrorMsg(),
|
||||
$keys[59] => $this->getDbSoundcloudLinkToFile(),
|
||||
$keys[11] => $this->getDbUtime(),
|
||||
$keys[12] => $this->getDbLPtime(),
|
||||
$keys[13] => $this->getDbMd5(),
|
||||
$keys[14] => $this->getDbTrackTitle(),
|
||||
$keys[15] => $this->getDbArtistName(),
|
||||
$keys[16] => $this->getDbBitRate(),
|
||||
$keys[17] => $this->getDbSampleRate(),
|
||||
$keys[18] => $this->getDbFormat(),
|
||||
$keys[19] => $this->getDbLength(),
|
||||
$keys[20] => $this->getDbAlbumTitle(),
|
||||
$keys[21] => $this->getDbGenre(),
|
||||
$keys[22] => $this->getDbComments(),
|
||||
$keys[23] => $this->getDbYear(),
|
||||
$keys[24] => $this->getDbTrackNumber(),
|
||||
$keys[25] => $this->getDbChannels(),
|
||||
$keys[26] => $this->getDbUrl(),
|
||||
$keys[27] => $this->getDbBpm(),
|
||||
$keys[28] => $this->getDbRating(),
|
||||
$keys[29] => $this->getDbEncodedBy(),
|
||||
$keys[30] => $this->getDbDiscNumber(),
|
||||
$keys[31] => $this->getDbMood(),
|
||||
$keys[32] => $this->getDbLabel(),
|
||||
$keys[33] => $this->getDbComposer(),
|
||||
$keys[34] => $this->getDbEncoder(),
|
||||
$keys[35] => $this->getDbChecksum(),
|
||||
$keys[36] => $this->getDbLyrics(),
|
||||
$keys[37] => $this->getDbOrchestra(),
|
||||
$keys[38] => $this->getDbConductor(),
|
||||
$keys[39] => $this->getDbLyricist(),
|
||||
$keys[40] => $this->getDbOriginalLyricist(),
|
||||
$keys[41] => $this->getDbRadioStationName(),
|
||||
$keys[42] => $this->getDbInfoUrl(),
|
||||
$keys[43] => $this->getDbArtistUrl(),
|
||||
$keys[44] => $this->getDbAudioSourceUrl(),
|
||||
$keys[45] => $this->getDbRadioStationUrl(),
|
||||
$keys[46] => $this->getDbBuyThisUrl(),
|
||||
$keys[47] => $this->getDbIsrcNumber(),
|
||||
$keys[48] => $this->getDbCatalogNumber(),
|
||||
$keys[49] => $this->getDbOriginalArtist(),
|
||||
$keys[50] => $this->getDbCopyright(),
|
||||
$keys[51] => $this->getDbReportDatetime(),
|
||||
$keys[52] => $this->getDbReportLocation(),
|
||||
$keys[53] => $this->getDbReportOrganization(),
|
||||
$keys[54] => $this->getDbSubject(),
|
||||
$keys[55] => $this->getDbContributor(),
|
||||
$keys[56] => $this->getDbLanguage(),
|
||||
$keys[57] => $this->getDbFileExist(),
|
||||
$keys[58] => $this->getDbSoundcloudId(),
|
||||
$keys[59] => $this->getDbSoundcloudErrorCode(),
|
||||
$keys[60] => $this->getDbSoundcloudErrorMsg(),
|
||||
$keys[61] => $this->getDbSoundcloudLinkToFile(),
|
||||
);
|
||||
if ($includeForeignObjects) {
|
||||
if (null !== $this->aCcSubjs) {
|
||||
|
@ -3232,150 +3418,156 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$this->setDbMtime($value);
|
||||
break;
|
||||
case 11:
|
||||
$this->setDbMd5($value);
|
||||
$this->setDbUtime($value);
|
||||
break;
|
||||
case 12:
|
||||
$this->setDbTrackTitle($value);
|
||||
$this->setDbLPtime($value);
|
||||
break;
|
||||
case 13:
|
||||
$this->setDbArtistName($value);
|
||||
$this->setDbMd5($value);
|
||||
break;
|
||||
case 14:
|
||||
$this->setDbBitRate($value);
|
||||
$this->setDbTrackTitle($value);
|
||||
break;
|
||||
case 15:
|
||||
$this->setDbSampleRate($value);
|
||||
$this->setDbArtistName($value);
|
||||
break;
|
||||
case 16:
|
||||
$this->setDbFormat($value);
|
||||
$this->setDbBitRate($value);
|
||||
break;
|
||||
case 17:
|
||||
$this->setDbLength($value);
|
||||
$this->setDbSampleRate($value);
|
||||
break;
|
||||
case 18:
|
||||
$this->setDbAlbumTitle($value);
|
||||
$this->setDbFormat($value);
|
||||
break;
|
||||
case 19:
|
||||
$this->setDbGenre($value);
|
||||
$this->setDbLength($value);
|
||||
break;
|
||||
case 20:
|
||||
$this->setDbComments($value);
|
||||
$this->setDbAlbumTitle($value);
|
||||
break;
|
||||
case 21:
|
||||
$this->setDbYear($value);
|
||||
$this->setDbGenre($value);
|
||||
break;
|
||||
case 22:
|
||||
$this->setDbTrackNumber($value);
|
||||
$this->setDbComments($value);
|
||||
break;
|
||||
case 23:
|
||||
$this->setDbChannels($value);
|
||||
$this->setDbYear($value);
|
||||
break;
|
||||
case 24:
|
||||
$this->setDbUrl($value);
|
||||
$this->setDbTrackNumber($value);
|
||||
break;
|
||||
case 25:
|
||||
$this->setDbBpm($value);
|
||||
$this->setDbChannels($value);
|
||||
break;
|
||||
case 26:
|
||||
$this->setDbRating($value);
|
||||
$this->setDbUrl($value);
|
||||
break;
|
||||
case 27:
|
||||
$this->setDbEncodedBy($value);
|
||||
$this->setDbBpm($value);
|
||||
break;
|
||||
case 28:
|
||||
$this->setDbDiscNumber($value);
|
||||
$this->setDbRating($value);
|
||||
break;
|
||||
case 29:
|
||||
$this->setDbMood($value);
|
||||
$this->setDbEncodedBy($value);
|
||||
break;
|
||||
case 30:
|
||||
$this->setDbLabel($value);
|
||||
$this->setDbDiscNumber($value);
|
||||
break;
|
||||
case 31:
|
||||
$this->setDbComposer($value);
|
||||
$this->setDbMood($value);
|
||||
break;
|
||||
case 32:
|
||||
$this->setDbEncoder($value);
|
||||
$this->setDbLabel($value);
|
||||
break;
|
||||
case 33:
|
||||
$this->setDbChecksum($value);
|
||||
$this->setDbComposer($value);
|
||||
break;
|
||||
case 34:
|
||||
$this->setDbLyrics($value);
|
||||
$this->setDbEncoder($value);
|
||||
break;
|
||||
case 35:
|
||||
$this->setDbOrchestra($value);
|
||||
$this->setDbChecksum($value);
|
||||
break;
|
||||
case 36:
|
||||
$this->setDbConductor($value);
|
||||
$this->setDbLyrics($value);
|
||||
break;
|
||||
case 37:
|
||||
$this->setDbLyricist($value);
|
||||
$this->setDbOrchestra($value);
|
||||
break;
|
||||
case 38:
|
||||
$this->setDbOriginalLyricist($value);
|
||||
$this->setDbConductor($value);
|
||||
break;
|
||||
case 39:
|
||||
$this->setDbRadioStationName($value);
|
||||
$this->setDbLyricist($value);
|
||||
break;
|
||||
case 40:
|
||||
$this->setDbInfoUrl($value);
|
||||
$this->setDbOriginalLyricist($value);
|
||||
break;
|
||||
case 41:
|
||||
$this->setDbArtistUrl($value);
|
||||
$this->setDbRadioStationName($value);
|
||||
break;
|
||||
case 42:
|
||||
$this->setDbAudioSourceUrl($value);
|
||||
$this->setDbInfoUrl($value);
|
||||
break;
|
||||
case 43:
|
||||
$this->setDbRadioStationUrl($value);
|
||||
$this->setDbArtistUrl($value);
|
||||
break;
|
||||
case 44:
|
||||
$this->setDbBuyThisUrl($value);
|
||||
$this->setDbAudioSourceUrl($value);
|
||||
break;
|
||||
case 45:
|
||||
$this->setDbIsrcNumber($value);
|
||||
$this->setDbRadioStationUrl($value);
|
||||
break;
|
||||
case 46:
|
||||
$this->setDbCatalogNumber($value);
|
||||
$this->setDbBuyThisUrl($value);
|
||||
break;
|
||||
case 47:
|
||||
$this->setDbOriginalArtist($value);
|
||||
$this->setDbIsrcNumber($value);
|
||||
break;
|
||||
case 48:
|
||||
$this->setDbCopyright($value);
|
||||
$this->setDbCatalogNumber($value);
|
||||
break;
|
||||
case 49:
|
||||
$this->setDbReportDatetime($value);
|
||||
$this->setDbOriginalArtist($value);
|
||||
break;
|
||||
case 50:
|
||||
$this->setDbReportLocation($value);
|
||||
$this->setDbCopyright($value);
|
||||
break;
|
||||
case 51:
|
||||
$this->setDbReportOrganization($value);
|
||||
$this->setDbReportDatetime($value);
|
||||
break;
|
||||
case 52:
|
||||
$this->setDbSubject($value);
|
||||
$this->setDbReportLocation($value);
|
||||
break;
|
||||
case 53:
|
||||
$this->setDbContributor($value);
|
||||
$this->setDbReportOrganization($value);
|
||||
break;
|
||||
case 54:
|
||||
$this->setDbLanguage($value);
|
||||
$this->setDbSubject($value);
|
||||
break;
|
||||
case 55:
|
||||
$this->setDbFileExist($value);
|
||||
$this->setDbContributor($value);
|
||||
break;
|
||||
case 56:
|
||||
$this->setDbSoundcloudId($value);
|
||||
$this->setDbLanguage($value);
|
||||
break;
|
||||
case 57:
|
||||
$this->setDbSoundcloudErrorCode($value);
|
||||
$this->setDbFileExist($value);
|
||||
break;
|
||||
case 58:
|
||||
$this->setDbSoundcloudErrorMsg($value);
|
||||
$this->setDbSoundcloudId($value);
|
||||
break;
|
||||
case 59:
|
||||
$this->setDbSoundcloudErrorCode($value);
|
||||
break;
|
||||
case 60:
|
||||
$this->setDbSoundcloudErrorMsg($value);
|
||||
break;
|
||||
case 61:
|
||||
$this->setDbSoundcloudLinkToFile($value);
|
||||
break;
|
||||
} // switch()
|
||||
|
@ -3413,55 +3605,57 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
if (array_key_exists($keys[8], $arr)) $this->setDbCurrentlyaccessing($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[9], $arr)) $this->setDbEditedby($arr[$keys[9]]);
|
||||
if (array_key_exists($keys[10], $arr)) $this->setDbMtime($arr[$keys[10]]);
|
||||
if (array_key_exists($keys[11], $arr)) $this->setDbMd5($arr[$keys[11]]);
|
||||
if (array_key_exists($keys[12], $arr)) $this->setDbTrackTitle($arr[$keys[12]]);
|
||||
if (array_key_exists($keys[13], $arr)) $this->setDbArtistName($arr[$keys[13]]);
|
||||
if (array_key_exists($keys[14], $arr)) $this->setDbBitRate($arr[$keys[14]]);
|
||||
if (array_key_exists($keys[15], $arr)) $this->setDbSampleRate($arr[$keys[15]]);
|
||||
if (array_key_exists($keys[16], $arr)) $this->setDbFormat($arr[$keys[16]]);
|
||||
if (array_key_exists($keys[17], $arr)) $this->setDbLength($arr[$keys[17]]);
|
||||
if (array_key_exists($keys[18], $arr)) $this->setDbAlbumTitle($arr[$keys[18]]);
|
||||
if (array_key_exists($keys[19], $arr)) $this->setDbGenre($arr[$keys[19]]);
|
||||
if (array_key_exists($keys[20], $arr)) $this->setDbComments($arr[$keys[20]]);
|
||||
if (array_key_exists($keys[21], $arr)) $this->setDbYear($arr[$keys[21]]);
|
||||
if (array_key_exists($keys[22], $arr)) $this->setDbTrackNumber($arr[$keys[22]]);
|
||||
if (array_key_exists($keys[23], $arr)) $this->setDbChannels($arr[$keys[23]]);
|
||||
if (array_key_exists($keys[24], $arr)) $this->setDbUrl($arr[$keys[24]]);
|
||||
if (array_key_exists($keys[25], $arr)) $this->setDbBpm($arr[$keys[25]]);
|
||||
if (array_key_exists($keys[26], $arr)) $this->setDbRating($arr[$keys[26]]);
|
||||
if (array_key_exists($keys[27], $arr)) $this->setDbEncodedBy($arr[$keys[27]]);
|
||||
if (array_key_exists($keys[28], $arr)) $this->setDbDiscNumber($arr[$keys[28]]);
|
||||
if (array_key_exists($keys[29], $arr)) $this->setDbMood($arr[$keys[29]]);
|
||||
if (array_key_exists($keys[30], $arr)) $this->setDbLabel($arr[$keys[30]]);
|
||||
if (array_key_exists($keys[31], $arr)) $this->setDbComposer($arr[$keys[31]]);
|
||||
if (array_key_exists($keys[32], $arr)) $this->setDbEncoder($arr[$keys[32]]);
|
||||
if (array_key_exists($keys[33], $arr)) $this->setDbChecksum($arr[$keys[33]]);
|
||||
if (array_key_exists($keys[34], $arr)) $this->setDbLyrics($arr[$keys[34]]);
|
||||
if (array_key_exists($keys[35], $arr)) $this->setDbOrchestra($arr[$keys[35]]);
|
||||
if (array_key_exists($keys[36], $arr)) $this->setDbConductor($arr[$keys[36]]);
|
||||
if (array_key_exists($keys[37], $arr)) $this->setDbLyricist($arr[$keys[37]]);
|
||||
if (array_key_exists($keys[38], $arr)) $this->setDbOriginalLyricist($arr[$keys[38]]);
|
||||
if (array_key_exists($keys[39], $arr)) $this->setDbRadioStationName($arr[$keys[39]]);
|
||||
if (array_key_exists($keys[40], $arr)) $this->setDbInfoUrl($arr[$keys[40]]);
|
||||
if (array_key_exists($keys[41], $arr)) $this->setDbArtistUrl($arr[$keys[41]]);
|
||||
if (array_key_exists($keys[42], $arr)) $this->setDbAudioSourceUrl($arr[$keys[42]]);
|
||||
if (array_key_exists($keys[43], $arr)) $this->setDbRadioStationUrl($arr[$keys[43]]);
|
||||
if (array_key_exists($keys[44], $arr)) $this->setDbBuyThisUrl($arr[$keys[44]]);
|
||||
if (array_key_exists($keys[45], $arr)) $this->setDbIsrcNumber($arr[$keys[45]]);
|
||||
if (array_key_exists($keys[46], $arr)) $this->setDbCatalogNumber($arr[$keys[46]]);
|
||||
if (array_key_exists($keys[47], $arr)) $this->setDbOriginalArtist($arr[$keys[47]]);
|
||||
if (array_key_exists($keys[48], $arr)) $this->setDbCopyright($arr[$keys[48]]);
|
||||
if (array_key_exists($keys[49], $arr)) $this->setDbReportDatetime($arr[$keys[49]]);
|
||||
if (array_key_exists($keys[50], $arr)) $this->setDbReportLocation($arr[$keys[50]]);
|
||||
if (array_key_exists($keys[51], $arr)) $this->setDbReportOrganization($arr[$keys[51]]);
|
||||
if (array_key_exists($keys[52], $arr)) $this->setDbSubject($arr[$keys[52]]);
|
||||
if (array_key_exists($keys[53], $arr)) $this->setDbContributor($arr[$keys[53]]);
|
||||
if (array_key_exists($keys[54], $arr)) $this->setDbLanguage($arr[$keys[54]]);
|
||||
if (array_key_exists($keys[55], $arr)) $this->setDbFileExist($arr[$keys[55]]);
|
||||
if (array_key_exists($keys[56], $arr)) $this->setDbSoundcloudId($arr[$keys[56]]);
|
||||
if (array_key_exists($keys[57], $arr)) $this->setDbSoundcloudErrorCode($arr[$keys[57]]);
|
||||
if (array_key_exists($keys[58], $arr)) $this->setDbSoundcloudErrorMsg($arr[$keys[58]]);
|
||||
if (array_key_exists($keys[59], $arr)) $this->setDbSoundcloudLinkToFile($arr[$keys[59]]);
|
||||
if (array_key_exists($keys[11], $arr)) $this->setDbUtime($arr[$keys[11]]);
|
||||
if (array_key_exists($keys[12], $arr)) $this->setDbLPtime($arr[$keys[12]]);
|
||||
if (array_key_exists($keys[13], $arr)) $this->setDbMd5($arr[$keys[13]]);
|
||||
if (array_key_exists($keys[14], $arr)) $this->setDbTrackTitle($arr[$keys[14]]);
|
||||
if (array_key_exists($keys[15], $arr)) $this->setDbArtistName($arr[$keys[15]]);
|
||||
if (array_key_exists($keys[16], $arr)) $this->setDbBitRate($arr[$keys[16]]);
|
||||
if (array_key_exists($keys[17], $arr)) $this->setDbSampleRate($arr[$keys[17]]);
|
||||
if (array_key_exists($keys[18], $arr)) $this->setDbFormat($arr[$keys[18]]);
|
||||
if (array_key_exists($keys[19], $arr)) $this->setDbLength($arr[$keys[19]]);
|
||||
if (array_key_exists($keys[20], $arr)) $this->setDbAlbumTitle($arr[$keys[20]]);
|
||||
if (array_key_exists($keys[21], $arr)) $this->setDbGenre($arr[$keys[21]]);
|
||||
if (array_key_exists($keys[22], $arr)) $this->setDbComments($arr[$keys[22]]);
|
||||
if (array_key_exists($keys[23], $arr)) $this->setDbYear($arr[$keys[23]]);
|
||||
if (array_key_exists($keys[24], $arr)) $this->setDbTrackNumber($arr[$keys[24]]);
|
||||
if (array_key_exists($keys[25], $arr)) $this->setDbChannels($arr[$keys[25]]);
|
||||
if (array_key_exists($keys[26], $arr)) $this->setDbUrl($arr[$keys[26]]);
|
||||
if (array_key_exists($keys[27], $arr)) $this->setDbBpm($arr[$keys[27]]);
|
||||
if (array_key_exists($keys[28], $arr)) $this->setDbRating($arr[$keys[28]]);
|
||||
if (array_key_exists($keys[29], $arr)) $this->setDbEncodedBy($arr[$keys[29]]);
|
||||
if (array_key_exists($keys[30], $arr)) $this->setDbDiscNumber($arr[$keys[30]]);
|
||||
if (array_key_exists($keys[31], $arr)) $this->setDbMood($arr[$keys[31]]);
|
||||
if (array_key_exists($keys[32], $arr)) $this->setDbLabel($arr[$keys[32]]);
|
||||
if (array_key_exists($keys[33], $arr)) $this->setDbComposer($arr[$keys[33]]);
|
||||
if (array_key_exists($keys[34], $arr)) $this->setDbEncoder($arr[$keys[34]]);
|
||||
if (array_key_exists($keys[35], $arr)) $this->setDbChecksum($arr[$keys[35]]);
|
||||
if (array_key_exists($keys[36], $arr)) $this->setDbLyrics($arr[$keys[36]]);
|
||||
if (array_key_exists($keys[37], $arr)) $this->setDbOrchestra($arr[$keys[37]]);
|
||||
if (array_key_exists($keys[38], $arr)) $this->setDbConductor($arr[$keys[38]]);
|
||||
if (array_key_exists($keys[39], $arr)) $this->setDbLyricist($arr[$keys[39]]);
|
||||
if (array_key_exists($keys[40], $arr)) $this->setDbOriginalLyricist($arr[$keys[40]]);
|
||||
if (array_key_exists($keys[41], $arr)) $this->setDbRadioStationName($arr[$keys[41]]);
|
||||
if (array_key_exists($keys[42], $arr)) $this->setDbInfoUrl($arr[$keys[42]]);
|
||||
if (array_key_exists($keys[43], $arr)) $this->setDbArtistUrl($arr[$keys[43]]);
|
||||
if (array_key_exists($keys[44], $arr)) $this->setDbAudioSourceUrl($arr[$keys[44]]);
|
||||
if (array_key_exists($keys[45], $arr)) $this->setDbRadioStationUrl($arr[$keys[45]]);
|
||||
if (array_key_exists($keys[46], $arr)) $this->setDbBuyThisUrl($arr[$keys[46]]);
|
||||
if (array_key_exists($keys[47], $arr)) $this->setDbIsrcNumber($arr[$keys[47]]);
|
||||
if (array_key_exists($keys[48], $arr)) $this->setDbCatalogNumber($arr[$keys[48]]);
|
||||
if (array_key_exists($keys[49], $arr)) $this->setDbOriginalArtist($arr[$keys[49]]);
|
||||
if (array_key_exists($keys[50], $arr)) $this->setDbCopyright($arr[$keys[50]]);
|
||||
if (array_key_exists($keys[51], $arr)) $this->setDbReportDatetime($arr[$keys[51]]);
|
||||
if (array_key_exists($keys[52], $arr)) $this->setDbReportLocation($arr[$keys[52]]);
|
||||
if (array_key_exists($keys[53], $arr)) $this->setDbReportOrganization($arr[$keys[53]]);
|
||||
if (array_key_exists($keys[54], $arr)) $this->setDbSubject($arr[$keys[54]]);
|
||||
if (array_key_exists($keys[55], $arr)) $this->setDbContributor($arr[$keys[55]]);
|
||||
if (array_key_exists($keys[56], $arr)) $this->setDbLanguage($arr[$keys[56]]);
|
||||
if (array_key_exists($keys[57], $arr)) $this->setDbFileExist($arr[$keys[57]]);
|
||||
if (array_key_exists($keys[58], $arr)) $this->setDbSoundcloudId($arr[$keys[58]]);
|
||||
if (array_key_exists($keys[59], $arr)) $this->setDbSoundcloudErrorCode($arr[$keys[59]]);
|
||||
if (array_key_exists($keys[60], $arr)) $this->setDbSoundcloudErrorMsg($arr[$keys[60]]);
|
||||
if (array_key_exists($keys[61], $arr)) $this->setDbSoundcloudLinkToFile($arr[$keys[61]]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3484,6 +3678,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
if ($this->isColumnModified(CcFilesPeer::CURRENTLYACCESSING)) $criteria->add(CcFilesPeer::CURRENTLYACCESSING, $this->currentlyaccessing);
|
||||
if ($this->isColumnModified(CcFilesPeer::EDITEDBY)) $criteria->add(CcFilesPeer::EDITEDBY, $this->editedby);
|
||||
if ($this->isColumnModified(CcFilesPeer::MTIME)) $criteria->add(CcFilesPeer::MTIME, $this->mtime);
|
||||
if ($this->isColumnModified(CcFilesPeer::UTIME)) $criteria->add(CcFilesPeer::UTIME, $this->utime);
|
||||
if ($this->isColumnModified(CcFilesPeer::LPTIME)) $criteria->add(CcFilesPeer::LPTIME, $this->lptime);
|
||||
if ($this->isColumnModified(CcFilesPeer::MD5)) $criteria->add(CcFilesPeer::MD5, $this->md5);
|
||||
if ($this->isColumnModified(CcFilesPeer::TRACK_TITLE)) $criteria->add(CcFilesPeer::TRACK_TITLE, $this->track_title);
|
||||
if ($this->isColumnModified(CcFilesPeer::ARTIST_NAME)) $criteria->add(CcFilesPeer::ARTIST_NAME, $this->artist_name);
|
||||
|
@ -3604,6 +3800,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$copyObj->setDbCurrentlyaccessing($this->currentlyaccessing);
|
||||
$copyObj->setDbEditedby($this->editedby);
|
||||
$copyObj->setDbMtime($this->mtime);
|
||||
$copyObj->setDbUtime($this->utime);
|
||||
$copyObj->setDbLPtime($this->lptime);
|
||||
$copyObj->setDbMd5($this->md5);
|
||||
$copyObj->setDbTrackTitle($this->track_title);
|
||||
$copyObj->setDbArtistName($this->artist_name);
|
||||
|
@ -4263,6 +4461,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$this->currentlyaccessing = null;
|
||||
$this->editedby = null;
|
||||
$this->mtime = null;
|
||||
$this->utime = null;
|
||||
$this->lptime = null;
|
||||
$this->md5 = null;
|
||||
$this->track_title = null;
|
||||
$this->artist_name = null;
|
||||
|
|
|
@ -26,7 +26,7 @@ abstract class BaseCcFilesPeer {
|
|||
const TM_CLASS = 'CcFilesTableMap';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 60;
|
||||
const NUM_COLUMNS = 62;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
@ -64,6 +64,12 @@ abstract class BaseCcFilesPeer {
|
|||
/** the column name for the MTIME field */
|
||||
const MTIME = 'cc_files.MTIME';
|
||||
|
||||
/** the column name for the UTIME field */
|
||||
const UTIME = 'cc_files.UTIME';
|
||||
|
||||
/** the column name for the LPTIME field */
|
||||
const LPTIME = 'cc_files.LPTIME';
|
||||
|
||||
/** the column name for the MD5 field */
|
||||
const MD5 = 'cc_files.MD5';
|
||||
|
||||
|
@ -227,12 +233,12 @@ abstract class BaseCcFilesPeer {
|
|||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbGunid', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbFileExist', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', 'DbSoundcloudLinkToFile', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbGunid', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbFileExist', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', 'dbSoundcloudLinkToFile', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::GUNID, self::NAME, self::MIME, self::FTYPE, self::DIRECTORY, self::FILEPATH, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::MD5, self::TRACK_TITLE, self::ARTIST_NAME, self::BIT_RATE, self::SAMPLE_RATE, self::FORMAT, self::LENGTH, self::ALBUM_TITLE, self::GENRE, self::COMMENTS, self::YEAR, self::TRACK_NUMBER, self::CHANNELS, self::URL, self::BPM, self::RATING, self::ENCODED_BY, self::DISC_NUMBER, self::MOOD, self::LABEL, self::COMPOSER, self::ENCODER, self::CHECKSUM, self::LYRICS, self::ORCHESTRA, self::CONDUCTOR, self::LYRICIST, self::ORIGINAL_LYRICIST, self::RADIO_STATION_NAME, self::INFO_URL, self::ARTIST_URL, self::AUDIO_SOURCE_URL, self::RADIO_STATION_URL, self::BUY_THIS_URL, self::ISRC_NUMBER, self::CATALOG_NUMBER, self::ORIGINAL_ARTIST, self::COPYRIGHT, self::REPORT_DATETIME, self::REPORT_LOCATION, self::REPORT_ORGANIZATION, self::SUBJECT, self::CONTRIBUTOR, self::LANGUAGE, self::FILE_EXIST, self::SOUNDCLOUD_ID, self::SOUNDCLOUD_ERROR_CODE, self::SOUNDCLOUD_ERROR_MSG, self::SOUNDCLOUD_LINK_TO_FILE, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'GUNID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'FILE_EXIST', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', 'SOUNDCLOUD_LINK_TO_FILE', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'gunid', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'file_exist', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', 'soundcloud_link_to_file', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbGunid', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbUtime', 'DbLPtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbFileExist', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', 'DbSoundcloudLinkToFile', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbGunid', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbFileExist', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', 'dbSoundcloudLinkToFile', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::GUNID, self::NAME, self::MIME, self::FTYPE, self::DIRECTORY, self::FILEPATH, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::UTIME, self::LPTIME, self::MD5, self::TRACK_TITLE, self::ARTIST_NAME, self::BIT_RATE, self::SAMPLE_RATE, self::FORMAT, self::LENGTH, self::ALBUM_TITLE, self::GENRE, self::COMMENTS, self::YEAR, self::TRACK_NUMBER, self::CHANNELS, self::URL, self::BPM, self::RATING, self::ENCODED_BY, self::DISC_NUMBER, self::MOOD, self::LABEL, self::COMPOSER, self::ENCODER, self::CHECKSUM, self::LYRICS, self::ORCHESTRA, self::CONDUCTOR, self::LYRICIST, self::ORIGINAL_LYRICIST, self::RADIO_STATION_NAME, self::INFO_URL, self::ARTIST_URL, self::AUDIO_SOURCE_URL, self::RADIO_STATION_URL, self::BUY_THIS_URL, self::ISRC_NUMBER, self::CATALOG_NUMBER, self::ORIGINAL_ARTIST, self::COPYRIGHT, self::REPORT_DATETIME, self::REPORT_LOCATION, self::REPORT_ORGANIZATION, self::SUBJECT, self::CONTRIBUTOR, self::LANGUAGE, self::FILE_EXIST, self::SOUNDCLOUD_ID, self::SOUNDCLOUD_ERROR_CODE, self::SOUNDCLOUD_ERROR_MSG, self::SOUNDCLOUD_LINK_TO_FILE, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'GUNID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'FILE_EXIST', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', 'SOUNDCLOUD_LINK_TO_FILE', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'gunid', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'file_exist', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', 'soundcloud_link_to_file', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, )
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -242,12 +248,12 @@ abstract class BaseCcFilesPeer {
|
|||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbGunid' => 1, 'DbName' => 2, 'DbMime' => 3, 'DbFtype' => 4, 'DbDirectory' => 5, 'DbFilepath' => 6, 'DbState' => 7, 'DbCurrentlyaccessing' => 8, 'DbEditedby' => 9, 'DbMtime' => 10, 'DbMd5' => 11, 'DbTrackTitle' => 12, 'DbArtistName' => 13, 'DbBitRate' => 14, 'DbSampleRate' => 15, 'DbFormat' => 16, 'DbLength' => 17, 'DbAlbumTitle' => 18, 'DbGenre' => 19, 'DbComments' => 20, 'DbYear' => 21, 'DbTrackNumber' => 22, 'DbChannels' => 23, 'DbUrl' => 24, 'DbBpm' => 25, 'DbRating' => 26, 'DbEncodedBy' => 27, 'DbDiscNumber' => 28, 'DbMood' => 29, 'DbLabel' => 30, 'DbComposer' => 31, 'DbEncoder' => 32, 'DbChecksum' => 33, 'DbLyrics' => 34, 'DbOrchestra' => 35, 'DbConductor' => 36, 'DbLyricist' => 37, 'DbOriginalLyricist' => 38, 'DbRadioStationName' => 39, 'DbInfoUrl' => 40, 'DbArtistUrl' => 41, 'DbAudioSourceUrl' => 42, 'DbRadioStationUrl' => 43, 'DbBuyThisUrl' => 44, 'DbIsrcNumber' => 45, 'DbCatalogNumber' => 46, 'DbOriginalArtist' => 47, 'DbCopyright' => 48, 'DbReportDatetime' => 49, 'DbReportLocation' => 50, 'DbReportOrganization' => 51, 'DbSubject' => 52, 'DbContributor' => 53, 'DbLanguage' => 54, 'DbFileExist' => 55, 'DbSoundcloudId' => 56, 'DbSoundcloudErrorCode' => 57, 'DbSoundcloudErrorMsg' => 58, 'DbSoundcloudLinkToFile' => 59, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbGunid' => 1, 'dbName' => 2, 'dbMime' => 3, 'dbFtype' => 4, 'dbDirectory' => 5, 'dbFilepath' => 6, 'dbState' => 7, 'dbCurrentlyaccessing' => 8, 'dbEditedby' => 9, 'dbMtime' => 10, 'dbMd5' => 11, 'dbTrackTitle' => 12, 'dbArtistName' => 13, 'dbBitRate' => 14, 'dbSampleRate' => 15, 'dbFormat' => 16, 'dbLength' => 17, 'dbAlbumTitle' => 18, 'dbGenre' => 19, 'dbComments' => 20, 'dbYear' => 21, 'dbTrackNumber' => 22, 'dbChannels' => 23, 'dbUrl' => 24, 'dbBpm' => 25, 'dbRating' => 26, 'dbEncodedBy' => 27, 'dbDiscNumber' => 28, 'dbMood' => 29, 'dbLabel' => 30, 'dbComposer' => 31, 'dbEncoder' => 32, 'dbChecksum' => 33, 'dbLyrics' => 34, 'dbOrchestra' => 35, 'dbConductor' => 36, 'dbLyricist' => 37, 'dbOriginalLyricist' => 38, 'dbRadioStationName' => 39, 'dbInfoUrl' => 40, 'dbArtistUrl' => 41, 'dbAudioSourceUrl' => 42, 'dbRadioStationUrl' => 43, 'dbBuyThisUrl' => 44, 'dbIsrcNumber' => 45, 'dbCatalogNumber' => 46, 'dbOriginalArtist' => 47, 'dbCopyright' => 48, 'dbReportDatetime' => 49, 'dbReportLocation' => 50, 'dbReportOrganization' => 51, 'dbSubject' => 52, 'dbContributor' => 53, 'dbLanguage' => 54, 'dbFileExist' => 55, 'dbSoundcloudId' => 56, 'dbSoundcloudErrorCode' => 57, 'dbSoundcloudErrorMsg' => 58, 'dbSoundcloudLinkToFile' => 59, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::GUNID => 1, self::NAME => 2, self::MIME => 3, self::FTYPE => 4, self::DIRECTORY => 5, self::FILEPATH => 6, self::STATE => 7, self::CURRENTLYACCESSING => 8, self::EDITEDBY => 9, self::MTIME => 10, self::MD5 => 11, self::TRACK_TITLE => 12, self::ARTIST_NAME => 13, self::BIT_RATE => 14, self::SAMPLE_RATE => 15, self::FORMAT => 16, self::LENGTH => 17, self::ALBUM_TITLE => 18, self::GENRE => 19, self::COMMENTS => 20, self::YEAR => 21, self::TRACK_NUMBER => 22, self::CHANNELS => 23, self::URL => 24, self::BPM => 25, self::RATING => 26, self::ENCODED_BY => 27, self::DISC_NUMBER => 28, self::MOOD => 29, self::LABEL => 30, self::COMPOSER => 31, self::ENCODER => 32, self::CHECKSUM => 33, self::LYRICS => 34, self::ORCHESTRA => 35, self::CONDUCTOR => 36, self::LYRICIST => 37, self::ORIGINAL_LYRICIST => 38, self::RADIO_STATION_NAME => 39, self::INFO_URL => 40, self::ARTIST_URL => 41, self::AUDIO_SOURCE_URL => 42, self::RADIO_STATION_URL => 43, self::BUY_THIS_URL => 44, self::ISRC_NUMBER => 45, self::CATALOG_NUMBER => 46, self::ORIGINAL_ARTIST => 47, self::COPYRIGHT => 48, self::REPORT_DATETIME => 49, self::REPORT_LOCATION => 50, self::REPORT_ORGANIZATION => 51, self::SUBJECT => 52, self::CONTRIBUTOR => 53, self::LANGUAGE => 54, self::FILE_EXIST => 55, self::SOUNDCLOUD_ID => 56, self::SOUNDCLOUD_ERROR_CODE => 57, self::SOUNDCLOUD_ERROR_MSG => 58, self::SOUNDCLOUD_LINK_TO_FILE => 59, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'GUNID' => 1, 'NAME' => 2, 'MIME' => 3, 'FTYPE' => 4, 'DIRECTORY' => 5, 'FILEPATH' => 6, 'STATE' => 7, 'CURRENTLYACCESSING' => 8, 'EDITEDBY' => 9, 'MTIME' => 10, 'MD5' => 11, 'TRACK_TITLE' => 12, 'ARTIST_NAME' => 13, 'BIT_RATE' => 14, 'SAMPLE_RATE' => 15, 'FORMAT' => 16, 'LENGTH' => 17, 'ALBUM_TITLE' => 18, 'GENRE' => 19, 'COMMENTS' => 20, 'YEAR' => 21, 'TRACK_NUMBER' => 22, 'CHANNELS' => 23, 'URL' => 24, 'BPM' => 25, 'RATING' => 26, 'ENCODED_BY' => 27, 'DISC_NUMBER' => 28, 'MOOD' => 29, 'LABEL' => 30, 'COMPOSER' => 31, 'ENCODER' => 32, 'CHECKSUM' => 33, 'LYRICS' => 34, 'ORCHESTRA' => 35, 'CONDUCTOR' => 36, 'LYRICIST' => 37, 'ORIGINAL_LYRICIST' => 38, 'RADIO_STATION_NAME' => 39, 'INFO_URL' => 40, 'ARTIST_URL' => 41, 'AUDIO_SOURCE_URL' => 42, 'RADIO_STATION_URL' => 43, 'BUY_THIS_URL' => 44, 'ISRC_NUMBER' => 45, 'CATALOG_NUMBER' => 46, 'ORIGINAL_ARTIST' => 47, 'COPYRIGHT' => 48, 'REPORT_DATETIME' => 49, 'REPORT_LOCATION' => 50, 'REPORT_ORGANIZATION' => 51, 'SUBJECT' => 52, 'CONTRIBUTOR' => 53, 'LANGUAGE' => 54, 'FILE_EXIST' => 55, 'SOUNDCLOUD_ID' => 56, 'SOUNDCLOUD_ERROR_CODE' => 57, 'SOUNDCLOUD_ERROR_MSG' => 58, 'SOUNDCLOUD_LINK_TO_FILE' => 59, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'gunid' => 1, 'name' => 2, 'mime' => 3, 'ftype' => 4, 'directory' => 5, 'filepath' => 6, 'state' => 7, 'currentlyaccessing' => 8, 'editedby' => 9, 'mtime' => 10, 'md5' => 11, 'track_title' => 12, 'artist_name' => 13, 'bit_rate' => 14, 'sample_rate' => 15, 'format' => 16, 'length' => 17, 'album_title' => 18, 'genre' => 19, 'comments' => 20, 'year' => 21, 'track_number' => 22, 'channels' => 23, 'url' => 24, 'bpm' => 25, 'rating' => 26, 'encoded_by' => 27, 'disc_number' => 28, 'mood' => 29, 'label' => 30, 'composer' => 31, 'encoder' => 32, 'checksum' => 33, 'lyrics' => 34, 'orchestra' => 35, 'conductor' => 36, 'lyricist' => 37, 'original_lyricist' => 38, 'radio_station_name' => 39, 'info_url' => 40, 'artist_url' => 41, 'audio_source_url' => 42, 'radio_station_url' => 43, 'buy_this_url' => 44, 'isrc_number' => 45, 'catalog_number' => 46, 'original_artist' => 47, 'copyright' => 48, 'report_datetime' => 49, 'report_location' => 50, 'report_organization' => 51, 'subject' => 52, 'contributor' => 53, 'language' => 54, 'file_exist' => 55, 'soundcloud_id' => 56, 'soundcloud_error_code' => 57, 'soundcloud_error_msg' => 58, 'soundcloud_link_to_file' => 59, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbGunid' => 1, 'DbName' => 2, 'DbMime' => 3, 'DbFtype' => 4, 'DbDirectory' => 5, 'DbFilepath' => 6, 'DbState' => 7, 'DbCurrentlyaccessing' => 8, 'DbEditedby' => 9, 'DbMtime' => 10, 'DbUtime' => 11, 'DbLPtime' => 12, 'DbMd5' => 13, 'DbTrackTitle' => 14, 'DbArtistName' => 15, 'DbBitRate' => 16, 'DbSampleRate' => 17, 'DbFormat' => 18, 'DbLength' => 19, 'DbAlbumTitle' => 20, 'DbGenre' => 21, 'DbComments' => 22, 'DbYear' => 23, 'DbTrackNumber' => 24, 'DbChannels' => 25, 'DbUrl' => 26, 'DbBpm' => 27, 'DbRating' => 28, 'DbEncodedBy' => 29, 'DbDiscNumber' => 30, 'DbMood' => 31, 'DbLabel' => 32, 'DbComposer' => 33, 'DbEncoder' => 34, 'DbChecksum' => 35, 'DbLyrics' => 36, 'DbOrchestra' => 37, 'DbConductor' => 38, 'DbLyricist' => 39, 'DbOriginalLyricist' => 40, 'DbRadioStationName' => 41, 'DbInfoUrl' => 42, 'DbArtistUrl' => 43, 'DbAudioSourceUrl' => 44, 'DbRadioStationUrl' => 45, 'DbBuyThisUrl' => 46, 'DbIsrcNumber' => 47, 'DbCatalogNumber' => 48, 'DbOriginalArtist' => 49, 'DbCopyright' => 50, 'DbReportDatetime' => 51, 'DbReportLocation' => 52, 'DbReportOrganization' => 53, 'DbSubject' => 54, 'DbContributor' => 55, 'DbLanguage' => 56, 'DbFileExist' => 57, 'DbSoundcloudId' => 58, 'DbSoundcloudErrorCode' => 59, 'DbSoundcloudErrorMsg' => 60, 'DbSoundcloudLinkToFile' => 61, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbGunid' => 1, 'dbName' => 2, 'dbMime' => 3, 'dbFtype' => 4, 'dbDirectory' => 5, 'dbFilepath' => 6, 'dbState' => 7, 'dbCurrentlyaccessing' => 8, 'dbEditedby' => 9, 'dbMtime' => 10, 'dbUtime' => 11, 'dbLPtime' => 12, 'dbMd5' => 13, 'dbTrackTitle' => 14, 'dbArtistName' => 15, 'dbBitRate' => 16, 'dbSampleRate' => 17, 'dbFormat' => 18, 'dbLength' => 19, 'dbAlbumTitle' => 20, 'dbGenre' => 21, 'dbComments' => 22, 'dbYear' => 23, 'dbTrackNumber' => 24, 'dbChannels' => 25, 'dbUrl' => 26, 'dbBpm' => 27, 'dbRating' => 28, 'dbEncodedBy' => 29, 'dbDiscNumber' => 30, 'dbMood' => 31, 'dbLabel' => 32, 'dbComposer' => 33, 'dbEncoder' => 34, 'dbChecksum' => 35, 'dbLyrics' => 36, 'dbOrchestra' => 37, 'dbConductor' => 38, 'dbLyricist' => 39, 'dbOriginalLyricist' => 40, 'dbRadioStationName' => 41, 'dbInfoUrl' => 42, 'dbArtistUrl' => 43, 'dbAudioSourceUrl' => 44, 'dbRadioStationUrl' => 45, 'dbBuyThisUrl' => 46, 'dbIsrcNumber' => 47, 'dbCatalogNumber' => 48, 'dbOriginalArtist' => 49, 'dbCopyright' => 50, 'dbReportDatetime' => 51, 'dbReportLocation' => 52, 'dbReportOrganization' => 53, 'dbSubject' => 54, 'dbContributor' => 55, 'dbLanguage' => 56, 'dbFileExist' => 57, 'dbSoundcloudId' => 58, 'dbSoundcloudErrorCode' => 59, 'dbSoundcloudErrorMsg' => 60, 'dbSoundcloudLinkToFile' => 61, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::GUNID => 1, self::NAME => 2, self::MIME => 3, self::FTYPE => 4, self::DIRECTORY => 5, self::FILEPATH => 6, self::STATE => 7, self::CURRENTLYACCESSING => 8, self::EDITEDBY => 9, self::MTIME => 10, self::UTIME => 11, self::LPTIME => 12, self::MD5 => 13, self::TRACK_TITLE => 14, self::ARTIST_NAME => 15, self::BIT_RATE => 16, self::SAMPLE_RATE => 17, self::FORMAT => 18, self::LENGTH => 19, self::ALBUM_TITLE => 20, self::GENRE => 21, self::COMMENTS => 22, self::YEAR => 23, self::TRACK_NUMBER => 24, self::CHANNELS => 25, self::URL => 26, self::BPM => 27, self::RATING => 28, self::ENCODED_BY => 29, self::DISC_NUMBER => 30, self::MOOD => 31, self::LABEL => 32, self::COMPOSER => 33, self::ENCODER => 34, self::CHECKSUM => 35, self::LYRICS => 36, self::ORCHESTRA => 37, self::CONDUCTOR => 38, self::LYRICIST => 39, self::ORIGINAL_LYRICIST => 40, self::RADIO_STATION_NAME => 41, self::INFO_URL => 42, self::ARTIST_URL => 43, self::AUDIO_SOURCE_URL => 44, self::RADIO_STATION_URL => 45, self::BUY_THIS_URL => 46, self::ISRC_NUMBER => 47, self::CATALOG_NUMBER => 48, self::ORIGINAL_ARTIST => 49, self::COPYRIGHT => 50, self::REPORT_DATETIME => 51, self::REPORT_LOCATION => 52, self::REPORT_ORGANIZATION => 53, self::SUBJECT => 54, self::CONTRIBUTOR => 55, self::LANGUAGE => 56, self::FILE_EXIST => 57, self::SOUNDCLOUD_ID => 58, self::SOUNDCLOUD_ERROR_CODE => 59, self::SOUNDCLOUD_ERROR_MSG => 60, self::SOUNDCLOUD_LINK_TO_FILE => 61, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'GUNID' => 1, 'NAME' => 2, 'MIME' => 3, 'FTYPE' => 4, 'DIRECTORY' => 5, 'FILEPATH' => 6, 'STATE' => 7, 'CURRENTLYACCESSING' => 8, 'EDITEDBY' => 9, 'MTIME' => 10, 'UTIME' => 11, 'LPTIME' => 12, 'MD5' => 13, 'TRACK_TITLE' => 14, 'ARTIST_NAME' => 15, 'BIT_RATE' => 16, 'SAMPLE_RATE' => 17, 'FORMAT' => 18, 'LENGTH' => 19, 'ALBUM_TITLE' => 20, 'GENRE' => 21, 'COMMENTS' => 22, 'YEAR' => 23, 'TRACK_NUMBER' => 24, 'CHANNELS' => 25, 'URL' => 26, 'BPM' => 27, 'RATING' => 28, 'ENCODED_BY' => 29, 'DISC_NUMBER' => 30, 'MOOD' => 31, 'LABEL' => 32, 'COMPOSER' => 33, 'ENCODER' => 34, 'CHECKSUM' => 35, 'LYRICS' => 36, 'ORCHESTRA' => 37, 'CONDUCTOR' => 38, 'LYRICIST' => 39, 'ORIGINAL_LYRICIST' => 40, 'RADIO_STATION_NAME' => 41, 'INFO_URL' => 42, 'ARTIST_URL' => 43, 'AUDIO_SOURCE_URL' => 44, 'RADIO_STATION_URL' => 45, 'BUY_THIS_URL' => 46, 'ISRC_NUMBER' => 47, 'CATALOG_NUMBER' => 48, 'ORIGINAL_ARTIST' => 49, 'COPYRIGHT' => 50, 'REPORT_DATETIME' => 51, 'REPORT_LOCATION' => 52, 'REPORT_ORGANIZATION' => 53, 'SUBJECT' => 54, 'CONTRIBUTOR' => 55, 'LANGUAGE' => 56, 'FILE_EXIST' => 57, 'SOUNDCLOUD_ID' => 58, 'SOUNDCLOUD_ERROR_CODE' => 59, 'SOUNDCLOUD_ERROR_MSG' => 60, 'SOUNDCLOUD_LINK_TO_FILE' => 61, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'gunid' => 1, 'name' => 2, 'mime' => 3, 'ftype' => 4, 'directory' => 5, 'filepath' => 6, 'state' => 7, 'currentlyaccessing' => 8, 'editedby' => 9, 'mtime' => 10, 'utime' => 11, 'lptime' => 12, 'md5' => 13, 'track_title' => 14, 'artist_name' => 15, 'bit_rate' => 16, 'sample_rate' => 17, 'format' => 18, 'length' => 19, 'album_title' => 20, 'genre' => 21, 'comments' => 22, 'year' => 23, 'track_number' => 24, 'channels' => 25, 'url' => 26, 'bpm' => 27, 'rating' => 28, 'encoded_by' => 29, 'disc_number' => 30, 'mood' => 31, 'label' => 32, 'composer' => 33, 'encoder' => 34, 'checksum' => 35, 'lyrics' => 36, 'orchestra' => 37, 'conductor' => 38, 'lyricist' => 39, 'original_lyricist' => 40, 'radio_station_name' => 41, 'info_url' => 42, 'artist_url' => 43, 'audio_source_url' => 44, 'radio_station_url' => 45, 'buy_this_url' => 46, 'isrc_number' => 47, 'catalog_number' => 48, 'original_artist' => 49, 'copyright' => 50, 'report_datetime' => 51, 'report_location' => 52, 'report_organization' => 53, 'subject' => 54, 'contributor' => 55, 'language' => 56, 'file_exist' => 57, 'soundcloud_id' => 58, 'soundcloud_error_code' => 59, 'soundcloud_error_msg' => 60, 'soundcloud_link_to_file' => 61, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, )
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -330,6 +336,8 @@ abstract class BaseCcFilesPeer {
|
|||
$criteria->addSelectColumn(CcFilesPeer::CURRENTLYACCESSING);
|
||||
$criteria->addSelectColumn(CcFilesPeer::EDITEDBY);
|
||||
$criteria->addSelectColumn(CcFilesPeer::MTIME);
|
||||
$criteria->addSelectColumn(CcFilesPeer::UTIME);
|
||||
$criteria->addSelectColumn(CcFilesPeer::LPTIME);
|
||||
$criteria->addSelectColumn(CcFilesPeer::MD5);
|
||||
$criteria->addSelectColumn(CcFilesPeer::TRACK_TITLE);
|
||||
$criteria->addSelectColumn(CcFilesPeer::ARTIST_NAME);
|
||||
|
@ -391,6 +399,8 @@ abstract class BaseCcFilesPeer {
|
|||
$criteria->addSelectColumn($alias . '.CURRENTLYACCESSING');
|
||||
$criteria->addSelectColumn($alias . '.EDITEDBY');
|
||||
$criteria->addSelectColumn($alias . '.MTIME');
|
||||
$criteria->addSelectColumn($alias . '.UTIME');
|
||||
$criteria->addSelectColumn($alias . '.LPTIME');
|
||||
$criteria->addSelectColumn($alias . '.MD5');
|
||||
$criteria->addSelectColumn($alias . '.TRACK_TITLE');
|
||||
$criteria->addSelectColumn($alias . '.ARTIST_NAME');
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
* @method CcFilesQuery orderByDbCurrentlyaccessing($order = Criteria::ASC) Order by the currentlyaccessing column
|
||||
* @method CcFilesQuery orderByDbEditedby($order = Criteria::ASC) Order by the editedby column
|
||||
* @method CcFilesQuery orderByDbMtime($order = Criteria::ASC) Order by the mtime column
|
||||
* @method CcFilesQuery orderByDbUtime($order = Criteria::ASC) Order by the utime column
|
||||
* @method CcFilesQuery orderByDbLPtime($order = Criteria::ASC) Order by the lptime column
|
||||
* @method CcFilesQuery orderByDbMd5($order = Criteria::ASC) Order by the md5 column
|
||||
* @method CcFilesQuery orderByDbTrackTitle($order = Criteria::ASC) Order by the track_title column
|
||||
* @method CcFilesQuery orderByDbArtistName($order = Criteria::ASC) Order by the artist_name column
|
||||
|
@ -78,6 +80,8 @@
|
|||
* @method CcFilesQuery groupByDbCurrentlyaccessing() Group by the currentlyaccessing column
|
||||
* @method CcFilesQuery groupByDbEditedby() Group by the editedby column
|
||||
* @method CcFilesQuery groupByDbMtime() Group by the mtime column
|
||||
* @method CcFilesQuery groupByDbUtime() Group by the utime column
|
||||
* @method CcFilesQuery groupByDbLPtime() Group by the lptime column
|
||||
* @method CcFilesQuery groupByDbMd5() Group by the md5 column
|
||||
* @method CcFilesQuery groupByDbTrackTitle() Group by the track_title column
|
||||
* @method CcFilesQuery groupByDbArtistName() Group by the artist_name column
|
||||
|
@ -166,6 +170,8 @@
|
|||
* @method CcFiles findOneByDbCurrentlyaccessing(int $currentlyaccessing) Return the first CcFiles filtered by the currentlyaccessing column
|
||||
* @method CcFiles findOneByDbEditedby(int $editedby) Return the first CcFiles filtered by the editedby column
|
||||
* @method CcFiles findOneByDbMtime(string $mtime) Return the first CcFiles filtered by the mtime column
|
||||
* @method CcFiles findOneByDbUtime(string $utime) Return the first CcFiles filtered by the utime column
|
||||
* @method CcFiles findOneByDbLPtime(string $lptime) Return the first CcFiles filtered by the lptime column
|
||||
* @method CcFiles findOneByDbMd5(string $md5) Return the first CcFiles filtered by the md5 column
|
||||
* @method CcFiles findOneByDbTrackTitle(string $track_title) Return the first CcFiles filtered by the track_title column
|
||||
* @method CcFiles findOneByDbArtistName(string $artist_name) Return the first CcFiles filtered by the artist_name column
|
||||
|
@ -227,6 +233,8 @@
|
|||
* @method array findByDbCurrentlyaccessing(int $currentlyaccessing) Return CcFiles objects filtered by the currentlyaccessing column
|
||||
* @method array findByDbEditedby(int $editedby) Return CcFiles objects filtered by the editedby column
|
||||
* @method array findByDbMtime(string $mtime) Return CcFiles objects filtered by the mtime column
|
||||
* @method array findByDbUtime(string $utime) Return CcFiles objects filtered by the utime column
|
||||
* @method array findByDbLPtime(string $lptime) Return CcFiles objects filtered by the lptime column
|
||||
* @method array findByDbMd5(string $md5) Return CcFiles objects filtered by the md5 column
|
||||
* @method array findByDbTrackTitle(string $track_title) Return CcFiles objects filtered by the track_title column
|
||||
* @method array findByDbArtistName(string $artist_name) Return CcFiles objects filtered by the artist_name column
|
||||
|
@ -658,6 +666,68 @@ abstract class BaseCcFilesQuery extends ModelCriteria
|
|||
return $this->addUsingAlias(CcFilesPeer::MTIME, $dbMtime, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the utime column
|
||||
*
|
||||
* @param string|array $dbUtime The value to use as filter.
|
||||
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcFilesQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbUtime($dbUtime = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbUtime)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbUtime['min'])) {
|
||||
$this->addUsingAlias(CcFilesPeer::UTIME, $dbUtime['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbUtime['max'])) {
|
||||
$this->addUsingAlias(CcFilesPeer::UTIME, $dbUtime['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcFilesPeer::UTIME, $dbUtime, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the lptime column
|
||||
*
|
||||
* @param string|array $dbLPtime The value to use as filter.
|
||||
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcFilesQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbLPtime($dbLPtime = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbLPtime)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbLPtime['min'])) {
|
||||
$this->addUsingAlias(CcFilesPeer::LPTIME, $dbLPtime['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbLPtime['max'])) {
|
||||
$this->addUsingAlias(CcFilesPeer::LPTIME, $dbLPtime['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcFilesPeer::LPTIME, $dbLPtime, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the md5 column
|
||||
*
|
||||
|
|
|
@ -215,7 +215,6 @@ abstract class BaseCcMusicDirs extends BaseObject implements Persistent
|
|||
*/
|
||||
public function setExists($v)
|
||||
{
|
||||
Logging::log("setting exists to ".print_r($v, true));
|
||||
if ($v !== null) {
|
||||
$v = (boolean) $v;
|
||||
}
|
||||
|
|
|
@ -63,6 +63,18 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
*/
|
||||
protected $mtime;
|
||||
|
||||
/**
|
||||
* The value for the utime field.
|
||||
* @var string
|
||||
*/
|
||||
protected $utime;
|
||||
|
||||
/**
|
||||
* The value for the lptime field.
|
||||
* @var string
|
||||
*/
|
||||
protected $lptime;
|
||||
|
||||
/**
|
||||
* The value for the creator field.
|
||||
* @var string
|
||||
|
@ -205,6 +217,72 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [utime] column value.
|
||||
*
|
||||
*
|
||||
* @param string $format The date/time format string (either date()-style or strftime()-style).
|
||||
* If format is NULL, then the raw DateTime object will be returned.
|
||||
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
|
||||
* @throws PropelException - if unable to parse/validate the date/time value.
|
||||
*/
|
||||
public function getDbUtime($format = 'Y-m-d H:i:s')
|
||||
{
|
||||
if ($this->utime === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
try {
|
||||
$dt = new DateTime($this->utime);
|
||||
} catch (Exception $x) {
|
||||
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->utime, true), $x);
|
||||
}
|
||||
|
||||
if ($format === null) {
|
||||
// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
|
||||
return $dt;
|
||||
} elseif (strpos($format, '%') !== false) {
|
||||
return strftime($format, $dt->format('U'));
|
||||
} else {
|
||||
return $dt->format($format);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [lptime] column value.
|
||||
*
|
||||
*
|
||||
* @param string $format The date/time format string (either date()-style or strftime()-style).
|
||||
* If format is NULL, then the raw DateTime object will be returned.
|
||||
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
|
||||
* @throws PropelException - if unable to parse/validate the date/time value.
|
||||
*/
|
||||
public function getDbLPtime($format = 'Y-m-d H:i:s')
|
||||
{
|
||||
if ($this->lptime === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
try {
|
||||
$dt = new DateTime($this->lptime);
|
||||
} catch (Exception $x) {
|
||||
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->lptime, true), $x);
|
||||
}
|
||||
|
||||
if ($format === null) {
|
||||
// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
|
||||
return $dt;
|
||||
} elseif (strpos($format, '%') !== false) {
|
||||
return strftime($format, $dt->format('U'));
|
||||
} else {
|
||||
return $dt->format($format);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [creator] column value.
|
||||
*
|
||||
|
@ -378,6 +456,104 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
return $this;
|
||||
} // setDbMtime()
|
||||
|
||||
/**
|
||||
* Sets the value of [utime] column to a normalized version of the date/time value specified.
|
||||
*
|
||||
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
|
||||
* be treated as NULL for temporal objects.
|
||||
* @return CcPlaylist The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbUtime($v)
|
||||
{
|
||||
// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
|
||||
// -- which is unexpected, to say the least.
|
||||
if ($v === null || $v === '') {
|
||||
$dt = null;
|
||||
} elseif ($v instanceof DateTime) {
|
||||
$dt = $v;
|
||||
} else {
|
||||
// some string/numeric value passed; we normalize that so that we can
|
||||
// validate it.
|
||||
try {
|
||||
if (is_numeric($v)) { // if it's a unix timestamp
|
||||
$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
|
||||
// We have to explicitly specify and then change the time zone because of a
|
||||
// DateTime bug: http://bugs.php.net/bug.php?id=43003
|
||||
$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
|
||||
} else {
|
||||
$dt = new DateTime($v);
|
||||
}
|
||||
} catch (Exception $x) {
|
||||
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->utime !== null || $dt !== null ) {
|
||||
// (nested ifs are a little easier to read in this case)
|
||||
|
||||
$currNorm = ($this->utime !== null && $tmpDt = new DateTime($this->utime)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null;
|
||||
$newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null;
|
||||
|
||||
if ( ($currNorm !== $newNorm) // normalized values don't match
|
||||
)
|
||||
{
|
||||
$this->utime = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null);
|
||||
$this->modifiedColumns[] = CcPlaylistPeer::UTIME;
|
||||
}
|
||||
} // if either are not null
|
||||
|
||||
return $this;
|
||||
} // setDbUtime()
|
||||
|
||||
/**
|
||||
* Sets the value of [lptime] column to a normalized version of the date/time value specified.
|
||||
*
|
||||
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
|
||||
* be treated as NULL for temporal objects.
|
||||
* @return CcPlaylist The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbLPtime($v)
|
||||
{
|
||||
// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
|
||||
// -- which is unexpected, to say the least.
|
||||
if ($v === null || $v === '') {
|
||||
$dt = null;
|
||||
} elseif ($v instanceof DateTime) {
|
||||
$dt = $v;
|
||||
} else {
|
||||
// some string/numeric value passed; we normalize that so that we can
|
||||
// validate it.
|
||||
try {
|
||||
if (is_numeric($v)) { // if it's a unix timestamp
|
||||
$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
|
||||
// We have to explicitly specify and then change the time zone because of a
|
||||
// DateTime bug: http://bugs.php.net/bug.php?id=43003
|
||||
$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
|
||||
} else {
|
||||
$dt = new DateTime($v);
|
||||
}
|
||||
} catch (Exception $x) {
|
||||
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->lptime !== null || $dt !== null ) {
|
||||
// (nested ifs are a little easier to read in this case)
|
||||
|
||||
$currNorm = ($this->lptime !== null && $tmpDt = new DateTime($this->lptime)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null;
|
||||
$newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null;
|
||||
|
||||
if ( ($currNorm !== $newNorm) // normalized values don't match
|
||||
)
|
||||
{
|
||||
$this->lptime = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null);
|
||||
$this->modifiedColumns[] = CcPlaylistPeer::LPTIME;
|
||||
}
|
||||
} // if either are not null
|
||||
|
||||
return $this;
|
||||
} // setDbLPtime()
|
||||
|
||||
/**
|
||||
* Set the value of [creator] column.
|
||||
*
|
||||
|
@ -468,8 +644,10 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
$this->currentlyaccessing = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
|
||||
$this->editedby = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null;
|
||||
$this->mtime = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
|
||||
$this->creator = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
|
||||
$this->description = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
|
||||
$this->utime = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
|
||||
$this->lptime = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
|
||||
$this->creator = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null;
|
||||
$this->description = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null;
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
@ -478,7 +656,7 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 8; // 8 = CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
return $startcol + 10; // 10 = CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating CcPlaylist object", $e);
|
||||
|
@ -842,9 +1020,15 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
return $this->getDbMtime();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getDbCreator();
|
||||
return $this->getDbUtime();
|
||||
break;
|
||||
case 7:
|
||||
return $this->getDbLPtime();
|
||||
break;
|
||||
case 8:
|
||||
return $this->getDbCreator();
|
||||
break;
|
||||
case 9:
|
||||
return $this->getDbDescription();
|
||||
break;
|
||||
default:
|
||||
|
@ -877,8 +1061,10 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
$keys[3] => $this->getDbCurrentlyaccessing(),
|
||||
$keys[4] => $this->getDbEditedby(),
|
||||
$keys[5] => $this->getDbMtime(),
|
||||
$keys[6] => $this->getDbCreator(),
|
||||
$keys[7] => $this->getDbDescription(),
|
||||
$keys[6] => $this->getDbUtime(),
|
||||
$keys[7] => $this->getDbLPtime(),
|
||||
$keys[8] => $this->getDbCreator(),
|
||||
$keys[9] => $this->getDbDescription(),
|
||||
);
|
||||
if ($includeForeignObjects) {
|
||||
if (null !== $this->aCcSubjs) {
|
||||
|
@ -934,9 +1120,15 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
$this->setDbMtime($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setDbCreator($value);
|
||||
$this->setDbUtime($value);
|
||||
break;
|
||||
case 7:
|
||||
$this->setDbLPtime($value);
|
||||
break;
|
||||
case 8:
|
||||
$this->setDbCreator($value);
|
||||
break;
|
||||
case 9:
|
||||
$this->setDbDescription($value);
|
||||
break;
|
||||
} // switch()
|
||||
|
@ -969,8 +1161,10 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
if (array_key_exists($keys[3], $arr)) $this->setDbCurrentlyaccessing($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setDbEditedby($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setDbMtime($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setDbCreator($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setDbDescription($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setDbUtime($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setDbLPtime($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[8], $arr)) $this->setDbCreator($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[9], $arr)) $this->setDbDescription($arr[$keys[9]]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -988,6 +1182,8 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
if ($this->isColumnModified(CcPlaylistPeer::CURRENTLYACCESSING)) $criteria->add(CcPlaylistPeer::CURRENTLYACCESSING, $this->currentlyaccessing);
|
||||
if ($this->isColumnModified(CcPlaylistPeer::EDITEDBY)) $criteria->add(CcPlaylistPeer::EDITEDBY, $this->editedby);
|
||||
if ($this->isColumnModified(CcPlaylistPeer::MTIME)) $criteria->add(CcPlaylistPeer::MTIME, $this->mtime);
|
||||
if ($this->isColumnModified(CcPlaylistPeer::UTIME)) $criteria->add(CcPlaylistPeer::UTIME, $this->utime);
|
||||
if ($this->isColumnModified(CcPlaylistPeer::LPTIME)) $criteria->add(CcPlaylistPeer::LPTIME, $this->lptime);
|
||||
if ($this->isColumnModified(CcPlaylistPeer::CREATOR)) $criteria->add(CcPlaylistPeer::CREATOR, $this->creator);
|
||||
if ($this->isColumnModified(CcPlaylistPeer::DESCRIPTION)) $criteria->add(CcPlaylistPeer::DESCRIPTION, $this->description);
|
||||
|
||||
|
@ -1056,6 +1252,8 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
$copyObj->setDbCurrentlyaccessing($this->currentlyaccessing);
|
||||
$copyObj->setDbEditedby($this->editedby);
|
||||
$copyObj->setDbMtime($this->mtime);
|
||||
$copyObj->setDbUtime($this->utime);
|
||||
$copyObj->setDbLPtime($this->lptime);
|
||||
$copyObj->setDbCreator($this->creator);
|
||||
$copyObj->setDbDescription($this->description);
|
||||
|
||||
|
@ -1309,6 +1507,8 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
$this->currentlyaccessing = null;
|
||||
$this->editedby = null;
|
||||
$this->mtime = null;
|
||||
$this->utime = null;
|
||||
$this->lptime = null;
|
||||
$this->creator = null;
|
||||
$this->description = null;
|
||||
$this->alreadyInSave = false;
|
||||
|
|
|
@ -26,7 +26,7 @@ abstract class BaseCcPlaylistPeer {
|
|||
const TM_CLASS = 'CcPlaylistTableMap';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 8;
|
||||
const NUM_COLUMNS = 10;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
@ -49,6 +49,12 @@ abstract class BaseCcPlaylistPeer {
|
|||
/** the column name for the MTIME field */
|
||||
const MTIME = 'cc_playlist.MTIME';
|
||||
|
||||
/** the column name for the UTIME field */
|
||||
const UTIME = 'cc_playlist.UTIME';
|
||||
|
||||
/** the column name for the LPTIME field */
|
||||
const LPTIME = 'cc_playlist.LPTIME';
|
||||
|
||||
/** the column name for the CREATOR field */
|
||||
const CREATOR = 'cc_playlist.CREATOR';
|
||||
|
||||
|
@ -71,12 +77,12 @@ abstract class BaseCcPlaylistPeer {
|
|||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbCreator', 'DbDescription', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbCreator', 'dbDescription', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::CREATOR, self::DESCRIPTION, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'CREATOR', 'DESCRIPTION', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'creator', 'description', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbUtime', 'DbLPtime', 'DbCreator', 'DbDescription', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', 'dbCreator', 'dbDescription', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::UTIME, self::LPTIME, self::CREATOR, self::DESCRIPTION, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', 'CREATOR', 'DESCRIPTION', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', 'creator', 'description', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -86,12 +92,12 @@ abstract class BaseCcPlaylistPeer {
|
|||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbState' => 2, 'DbCurrentlyaccessing' => 3, 'DbEditedby' => 4, 'DbMtime' => 5, 'DbCreator' => 6, 'DbDescription' => 7, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbState' => 2, 'dbCurrentlyaccessing' => 3, 'dbEditedby' => 4, 'dbMtime' => 5, 'dbCreator' => 6, 'dbDescription' => 7, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::STATE => 2, self::CURRENTLYACCESSING => 3, self::EDITEDBY => 4, self::MTIME => 5, self::CREATOR => 6, self::DESCRIPTION => 7, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'STATE' => 2, 'CURRENTLYACCESSING' => 3, 'EDITEDBY' => 4, 'MTIME' => 5, 'CREATOR' => 6, 'DESCRIPTION' => 7, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'state' => 2, 'currentlyaccessing' => 3, 'editedby' => 4, 'mtime' => 5, 'creator' => 6, 'description' => 7, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbState' => 2, 'DbCurrentlyaccessing' => 3, 'DbEditedby' => 4, 'DbMtime' => 5, 'DbUtime' => 6, 'DbLPtime' => 7, 'DbCreator' => 8, 'DbDescription' => 9, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbState' => 2, 'dbCurrentlyaccessing' => 3, 'dbEditedby' => 4, 'dbMtime' => 5, 'dbUtime' => 6, 'dbLPtime' => 7, 'dbCreator' => 8, 'dbDescription' => 9, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::STATE => 2, self::CURRENTLYACCESSING => 3, self::EDITEDBY => 4, self::MTIME => 5, self::UTIME => 6, self::LPTIME => 7, self::CREATOR => 8, self::DESCRIPTION => 9, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'STATE' => 2, 'CURRENTLYACCESSING' => 3, 'EDITEDBY' => 4, 'MTIME' => 5, 'UTIME' => 6, 'LPTIME' => 7, 'CREATOR' => 8, 'DESCRIPTION' => 9, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'state' => 2, 'currentlyaccessing' => 3, 'editedby' => 4, 'mtime' => 5, 'utime' => 6, 'lptime' => 7, 'creator' => 8, 'description' => 9, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -169,6 +175,8 @@ abstract class BaseCcPlaylistPeer {
|
|||
$criteria->addSelectColumn(CcPlaylistPeer::CURRENTLYACCESSING);
|
||||
$criteria->addSelectColumn(CcPlaylistPeer::EDITEDBY);
|
||||
$criteria->addSelectColumn(CcPlaylistPeer::MTIME);
|
||||
$criteria->addSelectColumn(CcPlaylistPeer::UTIME);
|
||||
$criteria->addSelectColumn(CcPlaylistPeer::LPTIME);
|
||||
$criteria->addSelectColumn(CcPlaylistPeer::CREATOR);
|
||||
$criteria->addSelectColumn(CcPlaylistPeer::DESCRIPTION);
|
||||
} else {
|
||||
|
@ -178,6 +186,8 @@ abstract class BaseCcPlaylistPeer {
|
|||
$criteria->addSelectColumn($alias . '.CURRENTLYACCESSING');
|
||||
$criteria->addSelectColumn($alias . '.EDITEDBY');
|
||||
$criteria->addSelectColumn($alias . '.MTIME');
|
||||
$criteria->addSelectColumn($alias . '.UTIME');
|
||||
$criteria->addSelectColumn($alias . '.LPTIME');
|
||||
$criteria->addSelectColumn($alias . '.CREATOR');
|
||||
$criteria->addSelectColumn($alias . '.DESCRIPTION');
|
||||
}
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
* @method CcPlaylistQuery orderByDbCurrentlyaccessing($order = Criteria::ASC) Order by the currentlyaccessing column
|
||||
* @method CcPlaylistQuery orderByDbEditedby($order = Criteria::ASC) Order by the editedby column
|
||||
* @method CcPlaylistQuery orderByDbMtime($order = Criteria::ASC) Order by the mtime column
|
||||
* @method CcPlaylistQuery orderByDbUtime($order = Criteria::ASC) Order by the utime column
|
||||
* @method CcPlaylistQuery orderByDbLPtime($order = Criteria::ASC) Order by the lptime column
|
||||
* @method CcPlaylistQuery orderByDbCreator($order = Criteria::ASC) Order by the creator column
|
||||
* @method CcPlaylistQuery orderByDbDescription($order = Criteria::ASC) Order by the description column
|
||||
*
|
||||
|
@ -21,6 +23,8 @@
|
|||
* @method CcPlaylistQuery groupByDbCurrentlyaccessing() Group by the currentlyaccessing column
|
||||
* @method CcPlaylistQuery groupByDbEditedby() Group by the editedby column
|
||||
* @method CcPlaylistQuery groupByDbMtime() Group by the mtime column
|
||||
* @method CcPlaylistQuery groupByDbUtime() Group by the utime column
|
||||
* @method CcPlaylistQuery groupByDbLPtime() Group by the lptime column
|
||||
* @method CcPlaylistQuery groupByDbCreator() Group by the creator column
|
||||
* @method CcPlaylistQuery groupByDbDescription() Group by the description column
|
||||
*
|
||||
|
@ -45,6 +49,8 @@
|
|||
* @method CcPlaylist findOneByDbCurrentlyaccessing(int $currentlyaccessing) Return the first CcPlaylist filtered by the currentlyaccessing column
|
||||
* @method CcPlaylist findOneByDbEditedby(int $editedby) Return the first CcPlaylist filtered by the editedby column
|
||||
* @method CcPlaylist findOneByDbMtime(string $mtime) Return the first CcPlaylist filtered by the mtime column
|
||||
* @method CcPlaylist findOneByDbUtime(string $utime) Return the first CcPlaylist filtered by the utime column
|
||||
* @method CcPlaylist findOneByDbLPtime(string $lptime) Return the first CcPlaylist filtered by the lptime column
|
||||
* @method CcPlaylist findOneByDbCreator(string $creator) Return the first CcPlaylist filtered by the creator column
|
||||
* @method CcPlaylist findOneByDbDescription(string $description) Return the first CcPlaylist filtered by the description column
|
||||
*
|
||||
|
@ -54,6 +60,8 @@
|
|||
* @method array findByDbCurrentlyaccessing(int $currentlyaccessing) Return CcPlaylist objects filtered by the currentlyaccessing column
|
||||
* @method array findByDbEditedby(int $editedby) Return CcPlaylist objects filtered by the editedby column
|
||||
* @method array findByDbMtime(string $mtime) Return CcPlaylist objects filtered by the mtime column
|
||||
* @method array findByDbUtime(string $utime) Return CcPlaylist objects filtered by the utime column
|
||||
* @method array findByDbLPtime(string $lptime) Return CcPlaylist objects filtered by the lptime column
|
||||
* @method array findByDbCreator(string $creator) Return CcPlaylist objects filtered by the creator column
|
||||
* @method array findByDbDescription(string $description) Return CcPlaylist objects filtered by the description column
|
||||
*
|
||||
|
@ -319,6 +327,68 @@ abstract class BaseCcPlaylistQuery extends ModelCriteria
|
|||
return $this->addUsingAlias(CcPlaylistPeer::MTIME, $dbMtime, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the utime column
|
||||
*
|
||||
* @param string|array $dbUtime The value to use as filter.
|
||||
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcPlaylistQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbUtime($dbUtime = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbUtime)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbUtime['min'])) {
|
||||
$this->addUsingAlias(CcPlaylistPeer::UTIME, $dbUtime['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbUtime['max'])) {
|
||||
$this->addUsingAlias(CcPlaylistPeer::UTIME, $dbUtime['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcPlaylistPeer::UTIME, $dbUtime, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the lptime column
|
||||
*
|
||||
* @param string|array $dbLPtime The value to use as filter.
|
||||
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcPlaylistQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbLPtime($dbLPtime = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbLPtime)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbLPtime['min'])) {
|
||||
$this->addUsingAlias(CcPlaylistPeer::LPTIME, $dbLPtime['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbLPtime['max'])) {
|
||||
$this->addUsingAlias(CcPlaylistPeer::LPTIME, $dbLPtime['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcPlaylistPeer::LPTIME, $dbLPtime, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the creator column
|
||||
*
|
||||
|
|
|
@ -46,6 +46,8 @@
|
|||
<column name="currentlyaccessing" phpName="DbCurrentlyaccessing" type="INTEGER" required="true" defaultValue="0"/>
|
||||
<column name="editedby" phpName="DbEditedby" type="INTEGER" required="false"/>
|
||||
<column name="mtime" phpName="DbMtime" type="TIMESTAMP" size="6" required="false"/>
|
||||
<column name="utime" phpName="DbUtime" type="TIMESTAMP" size="6" required="false"/>
|
||||
<column name="lptime" phpName="DbLPtime" type="TIMESTAMP" size="6" required="false"/>
|
||||
<column name="md5" phpName="DbMd5" type="CHAR" size="32" required="false"/>
|
||||
<column name="track_title" phpName="DbTrackTitle" type="VARCHAR" size="512" required="false"/>
|
||||
<column name="artist_name" phpName="DbArtistName" type="VARCHAR" size="512" required="false"/>
|
||||
|
@ -215,6 +217,8 @@
|
|||
<column name="currentlyaccessing" phpName="DbCurrentlyaccessing" type="INTEGER" required="true" defaultValue="0"/>
|
||||
<column name="editedby" phpName="DbEditedby" type="INTEGER" required="false"/>
|
||||
<column name="mtime" phpName="DbMtime" type="TIMESTAMP" size="6" required="false"/>
|
||||
<column name="utime" phpName="DbUtime" type="TIMESTAMP" size="6" required="false"/>
|
||||
<column name="lptime" phpName="DbLPtime" type="TIMESTAMP" size="6" required="false"/>
|
||||
<column name="creator" phpName="DbCreator" type="VARCHAR" size="32" required="false"/>
|
||||
<column name="description" phpName="DbDescription" type="VARCHAR" size="512" required="false"/>
|
||||
<foreign-key foreignTable="cc_subjs" name="cc_playlist_editedby_fkey">
|
||||
|
|
|
@ -72,6 +72,8 @@ CREATE TABLE "cc_files"
|
|||
"currentlyaccessing" INTEGER default 0 NOT NULL,
|
||||
"editedby" INTEGER,
|
||||
"mtime" TIMESTAMP(6),
|
||||
"utime" TIMESTAMP(6),
|
||||
"lptime" TIMESTAMP(6),
|
||||
"md5" CHAR(32),
|
||||
"track_title" VARCHAR(512),
|
||||
"artist_name" VARCHAR(512),
|
||||
|
@ -288,6 +290,8 @@ CREATE TABLE "cc_playlist"
|
|||
"currentlyaccessing" INTEGER default 0 NOT NULL,
|
||||
"editedby" INTEGER,
|
||||
"mtime" TIMESTAMP(6),
|
||||
"utime" TIMESTAMP(6),
|
||||
"lptime" TIMESTAMP(6),
|
||||
"creator" VARCHAR(32),
|
||||
"description" VARCHAR(512),
|
||||
PRIMARY KEY ("id")
|
||||
|
|
14
airtime_mvc/public/css/datatables/css/ColReorder.css
Normal file
14
airtime_mvc/public/css/datatables/css/ColReorder.css
Normal file
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* Namespace DTCR - "DataTables ColReorder" plug-in
|
||||
*/
|
||||
|
||||
table.DTCR_clonedTable {
|
||||
background-color: white;
|
||||
z-index: 998;
|
||||
}
|
||||
|
||||
div.DTCR_pointer {
|
||||
width: 1px;
|
||||
background-color: #5B5B5B;
|
||||
z-index: 997;
|
||||
}
|
75
airtime_mvc/public/css/datatables/css/ColVis.css
Normal file
75
airtime_mvc/public/css/datatables/css/ColVis.css
Normal file
|
@ -0,0 +1,75 @@
|
|||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* ColVis styles
|
||||
*/
|
||||
.ColVis {
|
||||
float: right;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.ColVis_Button {
|
||||
position: relative;
|
||||
float: left;
|
||||
margin-right: 3px;
|
||||
padding: 3px 5px;
|
||||
height: 30px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #d0d0d0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button.ColVis_Button::-moz-focus-inner {
|
||||
border: none !important;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ColVis_text_hover {
|
||||
border: 1px solid #999;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
div.ColVis_collectionBackground {
|
||||
background-color: black;
|
||||
z-index: 996;
|
||||
}
|
||||
|
||||
div.ColVis_collection {
|
||||
position: relative;
|
||||
width: 130px;
|
||||
background-color: #999;
|
||||
padding: 3px;
|
||||
border: 1px solid #ccc;
|
||||
z-index: 998;
|
||||
}
|
||||
|
||||
div.ColVis_collection button.ColVis_Button {
|
||||
background-color: white;
|
||||
width: 100%;
|
||||
float: none;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
div.ColVis_catcher {
|
||||
position: absolute;
|
||||
z-index: 997;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
|
||||
|
||||
button.ColVis_Button {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.ColVis_collection button.ColVis_Button:hover {
|
||||
border: 1px solid #999;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
span.ColVis_radio {
|
||||
display: inline-block;
|
||||
width: 20px;
|
||||
}
|
|
@ -67,3 +67,11 @@
|
|||
-o-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.datatable_checkbox {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.datatable_checkbox .DataTables_sort_wrapper {
|
||||
text-align: center;
|
||||
}
|
||||
|
|
|
@ -609,7 +609,7 @@ dl.inline-list dd {
|
|||
background: url("images/search_auto_bg.png") no-repeat scroll 0 0 #DDDDDD;
|
||||
width: 60%;
|
||||
border: 1px solid #5B5B5B;
|
||||
margin: 0;
|
||||
margin-left: -8px;
|
||||
padding: 4px 3px 4px 25px;
|
||||
}
|
||||
.dataTables_length select {
|
||||
|
@ -622,6 +622,30 @@ dl.inline-list dd {
|
|||
padding: 2px 2px 2px 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
#library_display thead th, #library_display tbody td {
|
||||
cursor: pointer;
|
||||
}
|
||||
#library_display thead th.library_checkbox,
|
||||
#library_display thead th.library_id,
|
||||
#library_display thead th.library_title {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.ColVis.TableTools .ui-button {
|
||||
height: 21px;
|
||||
}
|
||||
button.ColVis_Button.ColVis_ShowAll {
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.library_toolbar .ui-button, .ColVis.TableTools .ui-button {
|
||||
float: right;
|
||||
text-align:center;
|
||||
font-size:12px;
|
||||
font-weight:normal;
|
||||
padding: 0.2em 1em;
|
||||
margin: 0.5em 0.2em -0.5em 0.2em;
|
||||
}
|
||||
|
||||
/*----END Data Table----*/
|
||||
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
var dTable;
|
||||
var checkedCount = 0;
|
||||
var checkedPLCount = 0;
|
||||
|
||||
//used by jjmenu
|
||||
function getId() {
|
||||
var tr_id = $(this.triggerElement).attr("id");
|
||||
var tr_id = $(this.triggerElement).parent().attr("id");
|
||||
tr_id = tr_id.split("_");
|
||||
|
||||
return tr_id[1];
|
||||
}
|
||||
|
||||
function getType() {
|
||||
var tr_id = $(this.triggerElement).attr("id");
|
||||
var tr_id = $(this.triggerElement).parent().attr("id");
|
||||
tr_id = tr_id.split("_");
|
||||
|
||||
return tr_id[0];
|
||||
|
@ -30,10 +34,22 @@ function deleteAudioClip(json) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (json.ids != undefined) {
|
||||
for (var i = json.ids.length - 1; i >= 0; i--) {
|
||||
deleteItem("au", json.ids[i]);
|
||||
}
|
||||
} else if (json.id != undefined) {
|
||||
deleteItem("au", json.id);
|
||||
}
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function confirmDeleteGroup() {
|
||||
if(confirm('Are you sure you want to delete the selected items?')){
|
||||
groupDelete();
|
||||
}
|
||||
}
|
||||
|
||||
//callbacks called by jjmenu
|
||||
function confirmDeleteAudioClip(params){
|
||||
if(confirm('The file will be deleted from disk, are you sure you want to delete?')){
|
||||
|
@ -77,7 +93,13 @@ function deletePlaylist(json) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (json.ids != undefined) {
|
||||
for (var i = json.ids.length - 1; i >= 0; i--) {
|
||||
deleteItem("pl", json.ids[i]);
|
||||
}
|
||||
} else if (json.id != undefined) {
|
||||
deleteItem("pl", json.id);
|
||||
}
|
||||
window.location.reload();
|
||||
}
|
||||
//end callbacks called by jjmenu
|
||||
|
@ -90,7 +112,7 @@ function addLibraryItemEvents() {
|
|||
cursor: 'pointer'
|
||||
});
|
||||
|
||||
$('#library_display tbody tr')
|
||||
$('#library_display tbody tr td').not('[class=library_checkbox]')
|
||||
.jjmenu("click",
|
||||
[{get:"/Library/context-menu/format/json/id/#id#/type/#type#"}],
|
||||
{id: getId, type: getType},
|
||||
|
@ -101,20 +123,19 @@ function addLibraryItemEvents() {
|
|||
function dtRowCallback( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
|
||||
var id, type, once;
|
||||
|
||||
type = aData[6].substring(0,2);
|
||||
id = aData[0];
|
||||
type = aData["ftype"].substring(0,2);
|
||||
id = aData["id"];
|
||||
|
||||
if(type == "au") {
|
||||
$('td:eq(5)', nRow).html( '<img src="css/images/icon_audioclip.png">' );
|
||||
}
|
||||
else if(type == "pl") {
|
||||
$('td:eq(5)', nRow).html( '<img src="css/images/icon_playlist.png">' );
|
||||
$('td.library_type', nRow).html( '<img src="css/images/icon_audioclip.png">' );
|
||||
} else if(type == "pl") {
|
||||
$('td.library_type', nRow).html( '<img src="css/images/icon_playlist.png">' );
|
||||
}
|
||||
|
||||
$(nRow).attr("id", type+'_'+id);
|
||||
|
||||
// insert id on lenth field
|
||||
$('td:eq(4)', nRow).attr("id", "length");
|
||||
$('td.library_length', nRow).attr("id", "length");
|
||||
|
||||
return nRow;
|
||||
}
|
||||
|
@ -123,14 +144,15 @@ function dtDrawCallback() {
|
|||
addLibraryItemEvents();
|
||||
addMetadataQtip();
|
||||
saveNumEntriesSetting();
|
||||
setupGroupActions();
|
||||
}
|
||||
|
||||
function addProgressIcon(id) {
|
||||
if($("#au_"+id).find("td:eq(0)").find("span").length > 0){
|
||||
$("#au_"+id).find("td:eq(0)").find("span").removeClass();
|
||||
if($("#au_"+id).find("td.library_title").find("span").length > 0){
|
||||
$("#au_"+id).find("td.library_title").find("span").removeClass();
|
||||
$("span[id="+id+"]").addClass("small-icon progress");
|
||||
}else{
|
||||
$("#au_"+id).find("td:eq(0)").append('<span id="'+id+'" class="small-icon progress"></span>')
|
||||
$("#au_"+id).find("td.library_title").append('<span id="'+id+'" class="small-icon progress"></span>')
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -229,7 +251,7 @@ function addQtipToSCIcons(){
|
|||
function addMetadataQtip(){
|
||||
var tableRow = $('#library_display tbody tr');
|
||||
tableRow.each(function(){
|
||||
var title = $(this).find('td:eq(0)').html()
|
||||
var title = $(this).find('td.library_title').html()
|
||||
var info = $(this).attr("id")
|
||||
info = info.split("_");
|
||||
var id = info[1];
|
||||
|
@ -297,30 +319,215 @@ function getNumEntriesPreference(data) {
|
|||
return parseInt(data.libraryInit.numEntries);
|
||||
}
|
||||
|
||||
function groupAdd() {
|
||||
if (checkedPLCount > 0) {
|
||||
alert("Can't add playlist to another playlist");
|
||||
return;
|
||||
}
|
||||
disableGroupBtn('library_group_add');
|
||||
|
||||
var ids = new Array();
|
||||
var addGroupUrl = '/Playlist/add-group';
|
||||
var newSPLUrl = '/Playlist/new/format/json';
|
||||
var dirty = true;
|
||||
$('#library_display tbody tr').each(function() {
|
||||
var idSplit = $(this).attr('id').split("_");
|
||||
var id = idSplit.pop();
|
||||
var type = idSplit.pop();
|
||||
if (dirty && $(this).find(":checkbox").attr("checked")) {
|
||||
if (type == "au") {
|
||||
ids.push(id);
|
||||
} else if (type == "pl") {
|
||||
alert("Can't add playlist to another playlist");
|
||||
dirty = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (dirty && ids.length > 0) {
|
||||
stopAudioPreview();
|
||||
|
||||
if ($('#spl_sortable').length == 0) {
|
||||
$.post(newSPLUrl, function(json) {
|
||||
openDiffSPL(json);
|
||||
redrawDataTablePage();
|
||||
|
||||
$.post(addGroupUrl, {format: "json", ids: ids}, setSPLContent);
|
||||
});
|
||||
} else {
|
||||
$.post(addGroupUrl, {format: "json", ids: ids}, setSPLContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function groupDelete() {
|
||||
disableGroupBtn('library_group_delete');
|
||||
|
||||
var auIds = new Array();
|
||||
var plIds = new Array();
|
||||
var auUrl = '/Library/delete-group';
|
||||
var plUrl = '/Playlist/delete-group';
|
||||
var dirty = true;
|
||||
$('#library_display tbody tr').each(function() {
|
||||
var idSplit = $(this).attr('id').split("_");
|
||||
var id = idSplit.pop();
|
||||
var type = idSplit.pop();
|
||||
if (dirty && $(this).find(":checkbox").attr("checked")) {
|
||||
if (type == "au") {
|
||||
auIds.push(id);
|
||||
} else if (type == "pl") {
|
||||
plIds.push(id);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (dirty && (auIds.length > 0 || plIds.length > 0)) {
|
||||
stopAudioPreview();
|
||||
|
||||
if (auIds.length > 0) {
|
||||
$.post(auUrl, {format: "json", ids: auIds}, deleteAudioClip);
|
||||
}
|
||||
if (plIds.length > 0) {
|
||||
$.post(plUrl, {format: "json", ids: plIds}, deletePlaylist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function toggleAll() {
|
||||
var checked = $(this).attr("checked");
|
||||
$('#library_display tr').each(function() {
|
||||
var idSplit = $(this).attr('id').split("_");
|
||||
var type = idSplit[0];
|
||||
$(this).find(":checkbox").attr("checked", checked);
|
||||
if (checked) {
|
||||
if (type == "pl") {
|
||||
checkedPLCount++;
|
||||
}
|
||||
$(this).addClass('selected');
|
||||
} else {
|
||||
if (type == "pl") {
|
||||
checkedPLCount--;
|
||||
}
|
||||
$(this).removeClass('selected');
|
||||
}
|
||||
});
|
||||
|
||||
if (checked) {
|
||||
checkedCount = $('#library_display tbody tr').size();
|
||||
enableGroupBtn('library_group_add', groupAdd);
|
||||
enableGroupBtn('library_group_delete', confirmDeleteGroup);
|
||||
} else {
|
||||
checkedCount = 0;
|
||||
checkedPLCount = 0;
|
||||
disableGroupBtn('library_group_add');
|
||||
disableGroupBtn('library_group_delete');
|
||||
}
|
||||
}
|
||||
|
||||
function enableGroupBtn(btnId, func) {
|
||||
btnId = '#' + btnId;
|
||||
if ($(btnId).hasClass('ui-state-disabled')) {
|
||||
$(btnId).removeClass('ui-state-disabled');
|
||||
$(btnId).click(func);
|
||||
}
|
||||
}
|
||||
|
||||
function disableGroupBtn(btnId) {
|
||||
btnId = '#' + btnId;
|
||||
if (!$(btnId).hasClass('ui-state-disabled')) {
|
||||
$(btnId).addClass('ui-state-disabled');
|
||||
$(btnId).unbind("click");
|
||||
}
|
||||
}
|
||||
|
||||
function checkBoxChanged() {
|
||||
var cbAll = $('#library_display thead').find(":checkbox");
|
||||
var cbAllChecked = cbAll.attr("checked");
|
||||
var checked = $(this).attr("checked");
|
||||
var size = $('#library_display tbody tr').size();
|
||||
var idSplit = $(this).parent().parent().attr('id').split("_");
|
||||
var type = idSplit[0];
|
||||
if (checked) {
|
||||
if (checkedCount < size) {
|
||||
checkedCount++;
|
||||
}
|
||||
if (type == "pl" && checkedPLCount < size) {
|
||||
checkedPLCount++;
|
||||
}
|
||||
enableGroupBtn('library_group_add', groupAdd);
|
||||
enableGroupBtn('library_group_delete', confirmDeleteGroup);
|
||||
$(this).parent().parent().addClass('selected');
|
||||
} else {
|
||||
if (checkedCount > 0) {
|
||||
checkedCount--;
|
||||
}
|
||||
if (type == "pl" && checkedPLCount > 0) {
|
||||
checkedPLCount--;
|
||||
}
|
||||
if (checkedCount == 0) {
|
||||
disableGroupBtn('library_group_add');
|
||||
disableGroupBtn('library_group_delete');
|
||||
}
|
||||
$(this).parent().parent().removeClass('selected');
|
||||
}
|
||||
|
||||
if (cbAllChecked && checkedCount < size) {
|
||||
cbAll.attr("checked", false);
|
||||
} else if (!cbAllChecked && checkedCount == size) {
|
||||
cbAll.attr("checked", true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function setupGroupActions() {
|
||||
checkedCount = 0;
|
||||
$('#library_display tr:nth-child(1)').find(":checkbox").attr("checked", false);
|
||||
$('#library_display thead').find(":checkbox").change(toggleAll);
|
||||
$('#library_display tbody tr').each(function() {
|
||||
$(this).find(":checkbox").change(checkBoxChanged);
|
||||
});
|
||||
|
||||
disableGroupBtn('library_group_add');
|
||||
disableGroupBtn('library_group_delete');
|
||||
}
|
||||
|
||||
function fnShowHide(iCol) {
|
||||
/* Get the DataTables object again - this is not a recreation, just a get of the object */
|
||||
var oTable = dTable;
|
||||
|
||||
var bVis = oTable.fnSettings().aoColumns[iCol].bVisible;
|
||||
oTable.fnSetColumnVis( iCol, bVis ? false : true );
|
||||
}
|
||||
|
||||
function createDataTable(data) {
|
||||
var dTable = $('#library_display').dataTable( {
|
||||
dTable = $('#library_display').dataTable( {
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
"sAjaxSource": "/Library/contents/format/json",
|
||||
"fnServerData": function ( sSource, aoData, fnCallback ) {
|
||||
"fnServerData": function ( sSource, aoData, testCallback ) {
|
||||
$.ajax( {
|
||||
"dataType": 'json',
|
||||
"type": "POST",
|
||||
"url": sSource,
|
||||
"data": aoData,
|
||||
"success": fnCallback
|
||||
"success": testCallback
|
||||
} );
|
||||
},
|
||||
"fnRowCallback": dtRowCallback,
|
||||
"fnDrawCallback": dtDrawCallback,
|
||||
"aoColumns": [
|
||||
/* Id */ { "sName": "id", "bSearchable": false, "bVisible": false },
|
||||
/* Title */ { "sTitle": "Title", "sName": "track_title" },
|
||||
/* Creator */ { "sTitle": "Creator", "sName": "artist_name" },
|
||||
/* Album */ { "sTitle": "Album", "sName": "album_title" },
|
||||
/* Genre */ { "sTitle": "Genre", "sName": "genre" },
|
||||
/* Length */ { "sTitle": "Length", "sName": "length" },
|
||||
/* Type */ { "sTitle": "Type", "sName": "ftype", "bSearchable": false }
|
||||
/* Checkbox */ {"sTitle": "<input type='checkbox' name='cb_all'>", "bSortable": false, "bSearchable": false, "mDataProp": "checkbox", "sWidth": "25px", "sClass": "library_checkbox"},
|
||||
/* Id */ {"sName": "id", "bSearchable": false, "bVisible": false, "mDataProp": "id", "sClass": "library_id"},
|
||||
/* Title */ {"sTitle": "Title", "sName": "track_title", "mDataProp": "track_title", "sClass": "library_title"},
|
||||
/* Creator */ {"sTitle": "Creator", "sName": "artist_name", "mDataProp": "artist_name", "sClass": "library_creator"},
|
||||
/* Album */ {"sTitle": "Album", "sName": "album_title", "mDataProp": "album_title", "sClass": "library_album"},
|
||||
/* Genre */ {"sTitle": "Genre", "sName": "genre", "mDataProp": "genre", "sWidth": "10%", "sClass": "library_genre"},
|
||||
/* Year */ {"sTitle": "Year", "sName": "year", "mDataProp": "year", "sWidth": "8%", "sClass": "library_year"},
|
||||
/* Length */ {"sTitle": "Length", "sName": "length", "mDataProp": "length", "sWidth": "10%", "sClass": "library_length"},
|
||||
/* Type */ {"sTitle": "Type", "sName": "ftype", "bSearchable": false, "mDataProp": "ftype", "sWidth": "9%", "sClass": "library_type"},
|
||||
/* Upload Time */ {"sTitle": "Upload Time", "sName": "utime", "mDataProp": "utime", "sClass": "library_upload_time"},
|
||||
/* Last Modified */ {"sTitle": "Last Modified", "sName": "mtime", "bVisible": false, "mDataProp": "mtime", "sClass": "library_modified_time"},
|
||||
],
|
||||
"aaSorting": [[2,'asc']],
|
||||
"sPaginationType": "full_numbers",
|
||||
|
@ -330,9 +537,31 @@ function createDataTable(data) {
|
|||
"sSearch": ""
|
||||
},
|
||||
"iDisplayLength": getNumEntriesPreference(data),
|
||||
"bStateSave": true
|
||||
"bStateSave": true,
|
||||
// R = ColReorder, C = ColVis, see datatables doc for others
|
||||
"sDom": 'Rlfr<"H"C<"library_toolbar">>t<"F"ip>',
|
||||
"oColVis": {
|
||||
"buttonText": "Show/Hide Columns",
|
||||
"sAlign": "right",
|
||||
"aiExclude": [0, 1, 2],
|
||||
"sSize": "css",
|
||||
"bShowAll": true
|
||||
},
|
||||
"oColReorder": {
|
||||
"aiOrder": [ 0, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] /* code this */,
|
||||
"iFixedColumns": 3
|
||||
}
|
||||
});
|
||||
dTable.fnSetFilteringDelay(350);
|
||||
|
||||
$("div.library_toolbar").html('<span class="fg-button ui-button ui-state-default" id="library_order_reset">Reset Order</span>' +
|
||||
'<span class="fg-button ui-button ui-state-default ui-state-disabled" id="library_group_delete">Delete</span>' +
|
||||
'<span class="fg-button ui-button ui-state-default ui-state-disabled" id="library_group_add">Add</span>');
|
||||
|
||||
$('#library_order_reset').click(function() {
|
||||
ColReorder.fnReset( dTable );
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
@ -341,7 +570,7 @@ $(document).ready(function() {
|
|||
$.ajax({ url: "/Api/library-init/format/json", dataType:"json", success:createDataTable,
|
||||
error:function(jqXHR, textStatus, errorThrown){}});
|
||||
|
||||
checkImportStatus()
|
||||
checkImportStatus();
|
||||
setInterval( "checkImportStatus()", 5000 );
|
||||
setInterval( "checkSCUploadStatus()", 5000 );
|
||||
|
||||
|
|
|
@ -449,6 +449,9 @@ function setUpSPL() {
|
|||
}
|
||||
|
||||
$("#fieldset-metadate_change").addClass("closed");
|
||||
|
||||
// update the "Last Modified" time for this playlist
|
||||
redrawDataTablePage();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
987
airtime_mvc/public/js/datatables/plugin/dataTables.ColReorder.js
Normal file
987
airtime_mvc/public/js/datatables/plugin/dataTables.ColReorder.js
Normal file
|
@ -0,0 +1,987 @@
|
|||
/*
|
||||
* File: ColReorder.js
|
||||
* Version: 1.0.4
|
||||
* CVS: $Id$
|
||||
* Description: Controls for column visiblity in DataTables
|
||||
* Author: Allan Jardine (www.sprymedia.co.uk)
|
||||
* Created: Wed Sep 15 18:23:29 BST 2010
|
||||
* Modified: $Date$ by $Author$
|
||||
* Language: Javascript
|
||||
* License: GPL v2 or BSD 3 point style
|
||||
* Project: DataTables
|
||||
* Contact: www.sprymedia.co.uk/contact
|
||||
*
|
||||
* Copyright 2010-2011 Allan Jardine, all rights reserved.
|
||||
*
|
||||
* This source file is free software, under either the GPL v2 license or a
|
||||
* BSD style license, available at:
|
||||
* http://datatables.net/license_gpl2
|
||||
* http://datatables.net/license_bsd
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
(function($, window, document) {
|
||||
|
||||
|
||||
/**
|
||||
* Switch the key value pairing of an index array to be value key (i.e. the old value is now the
|
||||
* key). For example consider [ 2, 0, 1 ] this would be returned as [ 1, 2, 0 ].
|
||||
* @method fnInvertKeyValues
|
||||
* @param array aIn Array to switch around
|
||||
* @returns array
|
||||
*/
|
||||
function fnInvertKeyValues( aIn )
|
||||
{
|
||||
var aRet=[];
|
||||
for ( var i=0, iLen=aIn.length ; i<iLen ; i++ )
|
||||
{
|
||||
aRet[ aIn[i] ] = i;
|
||||
}
|
||||
return aRet;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Modify an array by switching the position of two elements
|
||||
* @method fnArraySwitch
|
||||
* @param array aArray Array to consider, will be modified by reference (i.e. no return)
|
||||
* @param int iFrom From point
|
||||
* @param int iTo Insert point
|
||||
* @returns void
|
||||
*/
|
||||
function fnArraySwitch( aArray, iFrom, iTo )
|
||||
{
|
||||
var mStore = aArray.splice( iFrom, 1 )[0];
|
||||
aArray.splice( iTo, 0, mStore );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Switch the positions of nodes in a parent node (note this is specifically designed for
|
||||
* table rows). Note this function considers all element nodes under the parent!
|
||||
* @method fnDomSwitch
|
||||
* @param string sTag Tag to consider
|
||||
* @param int iFrom Element to move
|
||||
* @param int Point to element the element to (before this point), can be null for append
|
||||
* @returns void
|
||||
*/
|
||||
function fnDomSwitch( nParent, iFrom, iTo )
|
||||
{
|
||||
var anTags = [];
|
||||
for ( var i=0, iLen=nParent.childNodes.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( nParent.childNodes[i].nodeType == 1 )
|
||||
{
|
||||
anTags.push( nParent.childNodes[i] );
|
||||
}
|
||||
}
|
||||
var nStore = anTags[ iFrom ];
|
||||
|
||||
if ( iTo !== null )
|
||||
{
|
||||
nParent.insertBefore( nStore, anTags[iTo] );
|
||||
}
|
||||
else
|
||||
{
|
||||
nParent.appendChild( nStore );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* DataTables plug-in API functions
|
||||
*
|
||||
* This are required by ColReorder in order to perform the tasks required, and also keep this
|
||||
* code portable, to be used for other column reordering projects with DataTables, if needed.
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
/**
|
||||
* Plug-in for DataTables which will reorder the internal column structure by taking the column
|
||||
* from one position (iFrom) and insert it into a given point (iTo).
|
||||
* @method $.fn.dataTableExt.oApi.fnColReorder
|
||||
* @param object oSettings DataTables settings object - automatically added by DataTables!
|
||||
* @param int iFrom Take the column to be repositioned from this point
|
||||
* @param int iTo and insert it into this point
|
||||
* @returns void
|
||||
*/
|
||||
$.fn.dataTableExt.oApi.fnColReorder = function ( oSettings, iFrom, iTo )
|
||||
{
|
||||
var i, iLen, j, jLen, iCols=oSettings.aoColumns.length, nTrs, oCol;
|
||||
|
||||
/* Sanity check in the input */
|
||||
if ( iFrom == iTo )
|
||||
{
|
||||
/* Pointless reorder */
|
||||
return;
|
||||
}
|
||||
|
||||
if ( iFrom < 0 || iFrom >= iCols )
|
||||
{
|
||||
this.oApi._fnLog( oSettings, 1, "ColReorder 'from' index is out of bounds: "+iFrom );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( iTo < 0 || iTo >= iCols )
|
||||
{
|
||||
this.oApi._fnLog( oSettings, 1, "ColReorder 'to' index is out of bounds: "+iTo );
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate the new column array index, so we have a mapping between the old and new
|
||||
*/
|
||||
var aiMapping = [];
|
||||
for ( i=0, iLen=iCols ; i<iLen ; i++ )
|
||||
{
|
||||
aiMapping[i] = i;
|
||||
}
|
||||
fnArraySwitch( aiMapping, iFrom, iTo );
|
||||
var aiInvertMapping = fnInvertKeyValues( aiMapping );
|
||||
|
||||
|
||||
/*
|
||||
* Convert all internal indexing to the new column order indexes
|
||||
*/
|
||||
/* Sorting */
|
||||
for ( i=0, iLen=oSettings.aaSorting.length ; i<iLen ; i++ )
|
||||
{
|
||||
oSettings.aaSorting[i][0] = aiInvertMapping[ oSettings.aaSorting[i][0] ];
|
||||
}
|
||||
|
||||
/* Fixed sorting */
|
||||
if ( oSettings.aaSortingFixed !== null )
|
||||
{
|
||||
for ( i=0, iLen=oSettings.aaSortingFixed.length ; i<iLen ; i++ )
|
||||
{
|
||||
oSettings.aaSortingFixed[i][0] = aiInvertMapping[ oSettings.aaSortingFixed[i][0] ];
|
||||
}
|
||||
}
|
||||
|
||||
/* Data column sorting (the column which the sort for a given column should take place on) */
|
||||
for ( i=0, iLen=iCols ; i<iLen ; i++ )
|
||||
{
|
||||
oSettings.aoColumns[i].iDataSort = aiInvertMapping[ oSettings.aoColumns[i].iDataSort ];
|
||||
}
|
||||
|
||||
/* Update the Get and Set functions for each column */
|
||||
for ( i=0, iLen=iCols ; i<iLen ; i++ )
|
||||
{
|
||||
oCol = oSettings.aoColumns[i];
|
||||
if ( typeof oCol.mDataProp == 'number' ) {
|
||||
oCol.mDataProp = aiInvertMapping[ oCol.mDataProp ];
|
||||
oCol.fnGetData = oSettings.oApi._fnGetObjectDataFn( oCol.mDataProp );
|
||||
oCol.fnSetData = oSettings.oApi._fnSetObjectDataFn( oCol.mDataProp );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Move the DOM elements
|
||||
*/
|
||||
if ( oSettings.aoColumns[iFrom].bVisible )
|
||||
{
|
||||
/* Calculate the current visible index and the point to insert the node before. The insert
|
||||
* before needs to take into account that there might not be an element to insert before,
|
||||
* in which case it will be null, and an appendChild should be used
|
||||
*/
|
||||
var iVisibleIndex = this.oApi._fnColumnIndexToVisible( oSettings, iFrom );
|
||||
var iInsertBeforeIndex = null;
|
||||
|
||||
i = iTo < iFrom ? iTo : iTo + 1;
|
||||
while ( iInsertBeforeIndex === null && i < iCols )
|
||||
{
|
||||
iInsertBeforeIndex = this.oApi._fnColumnIndexToVisible( oSettings, i );
|
||||
i++;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
nTrs = oSettings.nTHead.getElementsByTagName('tr');
|
||||
for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
|
||||
{
|
||||
fnDomSwitch( nTrs[i], iVisibleIndex, iInsertBeforeIndex );
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
if ( oSettings.nTFoot !== null )
|
||||
{
|
||||
nTrs = oSettings.nTFoot.getElementsByTagName('tr');
|
||||
for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
|
||||
{
|
||||
fnDomSwitch( nTrs[i], iVisibleIndex, iInsertBeforeIndex );
|
||||
}
|
||||
}
|
||||
|
||||
/* Body */
|
||||
for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( oSettings.aoData[i].nTr !== null )
|
||||
{
|
||||
fnDomSwitch( oSettings.aoData[i].nTr, iVisibleIndex, iInsertBeforeIndex );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Move the internal array elements
|
||||
*/
|
||||
/* Columns */
|
||||
fnArraySwitch( oSettings.aoColumns, iFrom, iTo );
|
||||
|
||||
/* Search columns */
|
||||
fnArraySwitch( oSettings.aoPreSearchCols, iFrom, iTo );
|
||||
|
||||
/* Array array - internal data anodes cache */
|
||||
for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( $.isArray( oSettings.aoData[i]._aData ) ) {
|
||||
fnArraySwitch( oSettings.aoData[i]._aData, iFrom, iTo );
|
||||
}
|
||||
fnArraySwitch( oSettings.aoData[i]._anHidden, iFrom, iTo );
|
||||
}
|
||||
|
||||
/* Reposition the header elements in the header layout array */
|
||||
for ( i=0, iLen=oSettings.aoHeader.length ; i<iLen ; i++ )
|
||||
{
|
||||
fnArraySwitch( oSettings.aoHeader[i], iFrom, iTo );
|
||||
}
|
||||
|
||||
if ( oSettings.aoFooter !== null )
|
||||
{
|
||||
for ( i=0, iLen=oSettings.aoFooter.length ; i<iLen ; i++ )
|
||||
{
|
||||
fnArraySwitch( oSettings.aoFooter[i], iFrom, iTo );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Update DataTables' event handlers
|
||||
*/
|
||||
|
||||
/* Sort listener */
|
||||
for ( i=0, iLen=iCols ; i<iLen ; i++ )
|
||||
{
|
||||
$(oSettings.aoColumns[i].nTh).unbind('click');
|
||||
this.oApi._fnSortAttachListener( oSettings, oSettings.aoColumns[i].nTh, i );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Any extra operations for the other plug-ins
|
||||
*/
|
||||
if ( typeof ColVis != 'undefined' )
|
||||
{
|
||||
ColVis.fnRebuild( oSettings.oInstance );
|
||||
}
|
||||
|
||||
if ( typeof oSettings.oInstance._oPluginFixedHeader != 'undefined' )
|
||||
{
|
||||
oSettings.oInstance._oPluginFixedHeader.fnUpdate();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ColReorder provides column visiblity control for DataTables
|
||||
* @class ColReorder
|
||||
* @constructor
|
||||
* @param {object} DataTables object
|
||||
* @param {object} ColReorder options
|
||||
*/
|
||||
ColReorder = function( oTable, oOpts )
|
||||
{
|
||||
/* Santiy check that we are a new instance */
|
||||
if ( !this.CLASS || this.CLASS != "ColReorder" )
|
||||
{
|
||||
alert( "Warning: ColReorder must be initialised with the keyword 'new'" );
|
||||
}
|
||||
|
||||
if ( typeof oOpts == 'undefined' )
|
||||
{
|
||||
oOpts = {};
|
||||
}
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Public class variables
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/**
|
||||
* @namespace Settings object which contains customisable information for ColReorder instance
|
||||
*/
|
||||
this.s = {
|
||||
/**
|
||||
* DataTables settings object
|
||||
* @property dt
|
||||
* @type Object
|
||||
* @default null
|
||||
*/
|
||||
"dt": null,
|
||||
|
||||
/**
|
||||
* Initialisation object used for this instance
|
||||
* @property init
|
||||
* @type object
|
||||
* @default {}
|
||||
*/
|
||||
"init": oOpts,
|
||||
|
||||
/**
|
||||
* Number of columns to fix (not allow to be reordered)
|
||||
* @property fixed
|
||||
* @type int
|
||||
* @default 0
|
||||
*/
|
||||
"fixed": 0,
|
||||
|
||||
/**
|
||||
* Callback function for once the reorder has been done
|
||||
* @property dropcallback
|
||||
* @type function
|
||||
* @default null
|
||||
*/
|
||||
"dropCallback": null,
|
||||
|
||||
/**
|
||||
* @namespace Information used for the mouse drag
|
||||
*/
|
||||
"mouse": {
|
||||
"startX": -1,
|
||||
"startY": -1,
|
||||
"offsetX": -1,
|
||||
"offsetY": -1,
|
||||
"target": -1,
|
||||
"targetIndex": -1,
|
||||
"fromIndex": -1
|
||||
},
|
||||
|
||||
/**
|
||||
* Information which is used for positioning the insert cusor and knowing where to do the
|
||||
* insert. Array of objects with the properties:
|
||||
* x: x-axis position
|
||||
* to: insert point
|
||||
* @property aoTargets
|
||||
* @type array
|
||||
* @default []
|
||||
*/
|
||||
"aoTargets": []
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @namespace Common and useful DOM elements for the class instance
|
||||
*/
|
||||
this.dom = {
|
||||
/**
|
||||
* Dragging element (the one the mouse is moving)
|
||||
* @property drag
|
||||
* @type element
|
||||
* @default null
|
||||
*/
|
||||
"drag": null,
|
||||
|
||||
/**
|
||||
* The insert cursor
|
||||
* @property pointer
|
||||
* @type element
|
||||
* @default null
|
||||
*/
|
||||
"pointer": null
|
||||
};
|
||||
|
||||
|
||||
/* Constructor logic */
|
||||
this.s.dt = oTable.fnSettings();
|
||||
this._fnConstruct();
|
||||
|
||||
/* Store the instance for later use */
|
||||
ColReorder.aoInstances.push( this );
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
|
||||
ColReorder.prototype = {
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Public methods
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
"fnReset": function ()
|
||||
{
|
||||
var a = [];
|
||||
for ( var i=0, iLen=this.s.dt.aoColumns.length ; i<iLen ; i++ )
|
||||
{
|
||||
a.push( this.s.dt.aoColumns[i]._ColReorder_iOrigCol );
|
||||
}
|
||||
|
||||
this._fnOrderColumns( a );
|
||||
},
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Private methods (they are of course public in JS, but recommended as private)
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/**
|
||||
* Constructor logic
|
||||
* @method _fnConstruct
|
||||
* @returns void
|
||||
* @private
|
||||
*/
|
||||
"_fnConstruct": function ()
|
||||
{
|
||||
var that = this;
|
||||
var i, iLen;
|
||||
|
||||
/* Columns discounted from reordering - counting left to right */
|
||||
if ( typeof this.s.init.iFixedColumns != 'undefined' )
|
||||
{
|
||||
this.s.fixed = this.s.init.iFixedColumns;
|
||||
}
|
||||
|
||||
/* Drop callback initialisation option */
|
||||
if ( typeof this.s.init.fnReorderCallback != 'undefined' )
|
||||
{
|
||||
this.s.dropCallback = this.s.init.fnReorderCallback;
|
||||
}
|
||||
|
||||
/* Add event handlers for the drag and drop, and also mark the original column order */
|
||||
for ( i=0, iLen=this.s.dt.aoColumns.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( i > this.s.fixed-1 )
|
||||
{
|
||||
this._fnMouseListener( i, this.s.dt.aoColumns[i].nTh );
|
||||
}
|
||||
|
||||
/* Mark the original column order for later reference */
|
||||
this.s.dt.aoColumns[i]._ColReorder_iOrigCol = i;
|
||||
}
|
||||
|
||||
/* State saving */
|
||||
this.s.dt.aoStateSave.push( {
|
||||
"fn": function (oS, sVal) {
|
||||
return that._fnStateSave.call( that, sVal );
|
||||
},
|
||||
"sName": "ColReorder_State"
|
||||
} );
|
||||
|
||||
/* An initial column order has been specified */
|
||||
var aiOrder = null;
|
||||
if ( typeof this.s.init.aiOrder != 'undefined' )
|
||||
{
|
||||
aiOrder = this.s.init.aiOrder.slice();
|
||||
}
|
||||
|
||||
/* State loading, overrides the column order given */
|
||||
if ( this.s.dt.oLoadedState && typeof this.s.dt.oLoadedState.ColReorder != 'undefined' &&
|
||||
this.s.dt.oLoadedState.ColReorder.length == this.s.dt.aoColumns.length )
|
||||
{
|
||||
aiOrder = this.s.dt.oLoadedState.ColReorder;
|
||||
}
|
||||
|
||||
/* If we have an order to apply - do so */
|
||||
if ( aiOrder )
|
||||
{
|
||||
/* We might be called during or after the DataTables initialisation. If before, then we need
|
||||
* to wait until the draw is done, if after, then do what we need to do right away
|
||||
*/
|
||||
if ( !that.s.dt._bInitComplete )
|
||||
{
|
||||
var bDone = false;
|
||||
this.s.dt.aoDrawCallback.push( {
|
||||
"fn": function () {
|
||||
if ( !that.s.dt._bInitComplete && !bDone )
|
||||
{
|
||||
bDone = true;
|
||||
var resort = fnInvertKeyValues( aiOrder );
|
||||
that._fnOrderColumns.call( that, resort );
|
||||
}
|
||||
},
|
||||
"sName": "ColReorder_Pre"
|
||||
} );
|
||||
}
|
||||
else
|
||||
{
|
||||
var resort = fnInvertKeyValues( aiOrder );
|
||||
that._fnOrderColumns.call( that, resort );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Set the column order from an array
|
||||
* @method _fnOrderColumns
|
||||
* @param array a An array of integers which dictate the column order that should be applied
|
||||
* @returns void
|
||||
* @private
|
||||
*/
|
||||
"_fnOrderColumns": function ( a )
|
||||
{
|
||||
if ( a.length != this.s.dt.aoColumns.length )
|
||||
{
|
||||
this.s.dt.oInstance.oApi._fnLog( oDTSettings, 1, "ColReorder - array reorder does not "+
|
||||
"match known number of columns. Skipping." );
|
||||
return;
|
||||
}
|
||||
|
||||
for ( var i=0, iLen=a.length ; i<iLen ; i++ )
|
||||
{
|
||||
var currIndex = $.inArray( i, a );
|
||||
if ( i != currIndex )
|
||||
{
|
||||
/* Reorder our switching array */
|
||||
fnArraySwitch( a, currIndex, i );
|
||||
|
||||
/* Do the column reorder in the table */
|
||||
this.s.dt.oInstance.fnColReorder( currIndex, i );
|
||||
}
|
||||
}
|
||||
|
||||
/* When scrolling we need to recalculate the column sizes to allow for the shift */
|
||||
if ( this.s.dt.oScroll.sX !== "" || this.s.dt.oScroll.sY !== "" )
|
||||
{
|
||||
this.s.dt.oInstance.fnAdjustColumnSizing();
|
||||
}
|
||||
|
||||
/* Save the state */
|
||||
this.s.dt.oInstance.oApi._fnSaveState( this.s.dt );
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* This function effectively replaces the state saving function in DataTables (this is needed
|
||||
* because otherwise DataTables would state save the columns in their reordered state, not the
|
||||
* original which is needed on first draw). This is sensitive to any changes in the DataTables
|
||||
* state saving method!
|
||||
* @method _fnStateSave
|
||||
* @param string sCurrentVal
|
||||
* @returns string JSON encoded cookie string for DataTables
|
||||
* @private
|
||||
*/
|
||||
"_fnStateSave": function ( sCurrentVal )
|
||||
{
|
||||
var i, iLen, sTmp;
|
||||
var sValue = sCurrentVal.split('"aaSorting"')[0];
|
||||
var a = [];
|
||||
var oSettings = this.s.dt;
|
||||
|
||||
/* Sorting */
|
||||
sValue += '"aaSorting":[ ';
|
||||
for ( i=0 ; i<oSettings.aaSorting.length ; i++ )
|
||||
{
|
||||
sValue += '['+oSettings.aoColumns[ oSettings.aaSorting[i][0] ]._ColReorder_iOrigCol+
|
||||
',"'+oSettings.aaSorting[i][1]+'"],';
|
||||
}
|
||||
sValue = sValue.substring(0, sValue.length-1);
|
||||
sValue += "],";
|
||||
|
||||
/* Column filter */
|
||||
for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
|
||||
{
|
||||
a[ oSettings.aoColumns[i]._ColReorder_iOrigCol ] = {
|
||||
"sSearch": encodeURIComponent(oSettings.aoPreSearchCols[i].sSearch),
|
||||
"bRegex": !oSettings.aoPreSearchCols[i].bRegex
|
||||
};
|
||||
}
|
||||
|
||||
sValue += '"aaSearchCols":[ ';
|
||||
for ( i=0 ; i<a.length ; i++ )
|
||||
{
|
||||
sValue += '["'+a[i].sSearch+'",'+a[i].bRegex+'],';
|
||||
}
|
||||
sValue = sValue.substring(0, sValue.length-1);
|
||||
sValue += "],";
|
||||
|
||||
/* Visibility */
|
||||
a = [];
|
||||
for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
|
||||
{
|
||||
a[ oSettings.aoColumns[i]._ColReorder_iOrigCol ] = oSettings.aoColumns[i].bVisible;
|
||||
}
|
||||
|
||||
sValue += '"abVisCols":[ ';
|
||||
for ( i=0 ; i<a.length ; i++ )
|
||||
{
|
||||
sValue += a[i]+",";
|
||||
}
|
||||
sValue = sValue.substring(0, sValue.length-1);
|
||||
sValue += "],";
|
||||
|
||||
/* Column reordering */
|
||||
a = [];
|
||||
for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ ) {
|
||||
a.push( oSettings.aoColumns[i]._ColReorder_iOrigCol );
|
||||
}
|
||||
sValue += '"ColReorder":['+a.join(',')+']';
|
||||
|
||||
return sValue;
|
||||
},
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mouse drop and drag
|
||||
*/
|
||||
|
||||
/**
|
||||
* Add a mouse down listener to a particluar TH element
|
||||
* @method _fnMouseListener
|
||||
* @param int i Column index
|
||||
* @param element nTh TH element clicked on
|
||||
* @returns void
|
||||
* @private
|
||||
*/
|
||||
"_fnMouseListener": function ( i, nTh )
|
||||
{
|
||||
var that = this;
|
||||
$(nTh).bind( 'mousedown.ColReorder', function (e) {
|
||||
that._fnMouseDown.call( that, e, nTh );
|
||||
return false;
|
||||
} );
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Mouse down on a TH element in the table header
|
||||
* @method _fnMouseDown
|
||||
* @param event e Mouse event
|
||||
* @param element nTh TH element to be dragged
|
||||
* @returns void
|
||||
* @private
|
||||
*/
|
||||
"_fnMouseDown": function ( e, nTh )
|
||||
{
|
||||
var
|
||||
that = this,
|
||||
aoColumns = this.s.dt.aoColumns;
|
||||
|
||||
/* Store information about the mouse position */
|
||||
var nThTarget = e.target.nodeName == "TH" ? e.target : $(e.target).parents('TH')[0];
|
||||
var offset = $(nThTarget).offset();
|
||||
this.s.mouse.startX = e.pageX;
|
||||
this.s.mouse.startY = e.pageY;
|
||||
this.s.mouse.offsetX = e.pageX - offset.left;
|
||||
this.s.mouse.offsetY = e.pageY - offset.top;
|
||||
this.s.mouse.target = nTh;
|
||||
this.s.mouse.targetIndex = $('th', nTh.parentNode).index( nTh );
|
||||
this.s.mouse.fromIndex = this.s.dt.oInstance.oApi._fnVisibleToColumnIndex( this.s.dt,
|
||||
this.s.mouse.targetIndex );
|
||||
|
||||
/* Calculate a cached array with the points of the column inserts, and the 'to' points */
|
||||
this.s.aoTargets.splice( 0, this.s.aoTargets.length );
|
||||
|
||||
this.s.aoTargets.push( {
|
||||
"x": $(this.s.dt.nTable).offset().left,
|
||||
"to": 0
|
||||
} );
|
||||
|
||||
var iToPoint = 0;
|
||||
for ( var i=0, iLen=aoColumns.length ; i<iLen ; i++ )
|
||||
{
|
||||
/* For the column / header in question, we want it's position to remain the same if the
|
||||
* position is just to it's immediate left or right, so we only incremement the counter for
|
||||
* other columns
|
||||
*/
|
||||
if ( i != this.s.mouse.fromIndex )
|
||||
{
|
||||
iToPoint++;
|
||||
}
|
||||
|
||||
if ( aoColumns[i].bVisible )
|
||||
{
|
||||
this.s.aoTargets.push( {
|
||||
"x": $(aoColumns[i].nTh).offset().left + $(aoColumns[i].nTh).outerWidth(),
|
||||
"to": iToPoint
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
/* Disallow columns for being reordered by drag and drop, counting left to right */
|
||||
if ( this.s.fixed !== 0 )
|
||||
{
|
||||
this.s.aoTargets.splice( 0, this.s.fixed );
|
||||
}
|
||||
|
||||
/* Add event handlers to the document */
|
||||
$(document).bind( 'mousemove.ColReorder', function (e) {
|
||||
that._fnMouseMove.call( that, e );
|
||||
} );
|
||||
|
||||
$(document).bind( 'mouseup.ColReorder', function (e) {
|
||||
that._fnMouseUp.call( that, e );
|
||||
} );
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Deal with a mouse move event while dragging a node
|
||||
* @method _fnMouseMove
|
||||
* @param event e Mouse event
|
||||
* @returns void
|
||||
* @private
|
||||
*/
|
||||
"_fnMouseMove": function ( e )
|
||||
{
|
||||
var that = this;
|
||||
|
||||
if ( this.dom.drag === null )
|
||||
{
|
||||
/* Only create the drag element if the mouse has moved a specific distance from the start
|
||||
* point - this allows the user to make small mouse movements when sorting and not have a
|
||||
* possibly confusing drag element showing up
|
||||
*/
|
||||
if ( Math.pow(
|
||||
Math.pow(e.pageX - this.s.mouse.startX, 2) +
|
||||
Math.pow(e.pageY - this.s.mouse.startY, 2), 0.5 ) < 5 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
this._fnCreateDragNode();
|
||||
}
|
||||
|
||||
/* Position the element - we respect where in the element the click occured */
|
||||
this.dom.drag.style.left = (e.pageX - this.s.mouse.offsetX) + "px";
|
||||
this.dom.drag.style.top = (e.pageY - this.s.mouse.offsetY) + "px";
|
||||
|
||||
/* Based on the current mouse position, calculate where the insert should go */
|
||||
var bSet = false;
|
||||
for ( var i=1, iLen=this.s.aoTargets.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( e.pageX < this.s.aoTargets[i-1].x + ((this.s.aoTargets[i].x-this.s.aoTargets[i-1].x)/2) )
|
||||
{
|
||||
this.dom.pointer.style.left = this.s.aoTargets[i-1].x +"px";
|
||||
this.s.mouse.toIndex = this.s.aoTargets[i-1].to;
|
||||
bSet = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* The insert element wasn't positioned in the array (less than operator), so we put it at
|
||||
* the end
|
||||
*/
|
||||
if ( !bSet )
|
||||
{
|
||||
this.dom.pointer.style.left = this.s.aoTargets[this.s.aoTargets.length-1].x +"px";
|
||||
this.s.mouse.toIndex = this.s.aoTargets[this.s.aoTargets.length-1].to;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Finish off the mouse drag and insert the column where needed
|
||||
* @method _fnMouseUp
|
||||
* @param event e Mouse event
|
||||
* @returns void
|
||||
* @private
|
||||
*/
|
||||
"_fnMouseUp": function ( e )
|
||||
{
|
||||
var that = this;
|
||||
|
||||
$(document).unbind( 'mousemove.ColReorder' );
|
||||
$(document).unbind( 'mouseup.ColReorder' );
|
||||
|
||||
if ( this.dom.drag !== null )
|
||||
{
|
||||
/* Remove the guide elements */
|
||||
document.body.removeChild( this.dom.drag );
|
||||
document.body.removeChild( this.dom.pointer );
|
||||
this.dom.drag = null;
|
||||
this.dom.pointer = null;
|
||||
|
||||
/* Actually do the reorder */
|
||||
this.s.dt.oInstance.fnColReorder( this.s.mouse.fromIndex, this.s.mouse.toIndex );
|
||||
|
||||
/* When scrolling we need to recalculate the column sizes to allow for the shift */
|
||||
if ( this.s.dt.oScroll.sX !== "" || this.s.dt.oScroll.sY !== "" )
|
||||
{
|
||||
this.s.dt.oInstance.fnAdjustColumnSizing();
|
||||
}
|
||||
|
||||
if ( this.s.dropCallback !== null )
|
||||
{
|
||||
this.s.dropCallback.call( this );
|
||||
}
|
||||
|
||||
/* Save the state */
|
||||
this.s.dt.oInstance.oApi._fnSaveState( this.s.dt );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Copy the TH element that is being drags so the user has the idea that they are actually
|
||||
* moving it around the page.
|
||||
* @method _fnCreateDragNode
|
||||
* @returns void
|
||||
* @private
|
||||
*/
|
||||
"_fnCreateDragNode": function ()
|
||||
{
|
||||
var that = this;
|
||||
|
||||
this.dom.drag = $(this.s.dt.nTHead.parentNode).clone(true)[0];
|
||||
this.dom.drag.className += " DTCR_clonedTable";
|
||||
while ( this.dom.drag.getElementsByTagName('caption').length > 0 )
|
||||
{
|
||||
this.dom.drag.removeChild( this.dom.drag.getElementsByTagName('caption')[0] );
|
||||
}
|
||||
while ( this.dom.drag.getElementsByTagName('tbody').length > 0 )
|
||||
{
|
||||
this.dom.drag.removeChild( this.dom.drag.getElementsByTagName('tbody')[0] );
|
||||
}
|
||||
while ( this.dom.drag.getElementsByTagName('tfoot').length > 0 )
|
||||
{
|
||||
this.dom.drag.removeChild( this.dom.drag.getElementsByTagName('tfoot')[0] );
|
||||
}
|
||||
|
||||
$('thead tr:eq(0)', this.dom.drag).each( function () {
|
||||
$('th:not(:eq('+that.s.mouse.targetIndex+'))', this).remove();
|
||||
} );
|
||||
$('tr', this.dom.drag).height( $('tr:eq(0)', that.s.dt.nTHead).height() );
|
||||
|
||||
$('thead tr:gt(0)', this.dom.drag).remove();
|
||||
|
||||
$('thead th:eq(0)', this.dom.drag).each( function (i) {
|
||||
this.style.width = $('th:eq('+that.s.mouse.targetIndex+')', that.s.dt.nTHead).width()+"px";
|
||||
} );
|
||||
|
||||
this.dom.drag.style.position = "absolute";
|
||||
this.dom.drag.style.top = "0px";
|
||||
this.dom.drag.style.left = "0px";
|
||||
this.dom.drag.style.width = $('th:eq('+that.s.mouse.targetIndex+')', that.s.dt.nTHead).outerWidth()+"px";
|
||||
|
||||
|
||||
this.dom.pointer = document.createElement( 'div' );
|
||||
this.dom.pointer.className = "DTCR_pointer";
|
||||
this.dom.pointer.style.position = "absolute";
|
||||
|
||||
if ( this.s.dt.oScroll.sX === "" && this.s.dt.oScroll.sY === "" )
|
||||
{
|
||||
this.dom.pointer.style.top = $(this.s.dt.nTable).offset().top+"px";
|
||||
this.dom.pointer.style.height = $(this.s.dt.nTable).height()+"px";
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dom.pointer.style.top = $('div.dataTables_scroll', this.s.dt.nTableWrapper).offset().top+"px";
|
||||
this.dom.pointer.style.height = $('div.dataTables_scroll', this.s.dt.nTableWrapper).height()+"px";
|
||||
}
|
||||
|
||||
document.body.appendChild( this.dom.pointer );
|
||||
document.body.appendChild( this.dom.drag );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Static parameters
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/**
|
||||
* Array of all ColReorder instances for later reference
|
||||
* @property ColReorder.aoInstances
|
||||
* @type array
|
||||
* @default []
|
||||
* @static
|
||||
*/
|
||||
ColReorder.aoInstances = [];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Static functions
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/**
|
||||
* Reset the column ordering for a DataTables instance
|
||||
* @method ColReorder.fnReset
|
||||
* @param object oTable DataTables instance to consider
|
||||
* @returns void
|
||||
* @static
|
||||
*/
|
||||
ColReorder.fnReset = function ( oTable )
|
||||
{
|
||||
for ( var i=0, iLen=ColReorder.aoInstances.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( ColReorder.aoInstances[i].s.dt.oInstance == oTable )
|
||||
{
|
||||
ColReorder.aoInstances[i].fnReset();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Constants
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/**
|
||||
* Name of this class
|
||||
* @constant CLASS
|
||||
* @type String
|
||||
* @default ColReorder
|
||||
*/
|
||||
ColReorder.prototype.CLASS = "ColReorder";
|
||||
|
||||
|
||||
/**
|
||||
* ColReorder version
|
||||
* @constant VERSION
|
||||
* @type String
|
||||
* @default As code
|
||||
*/
|
||||
ColReorder.VERSION = "1.0.4";
|
||||
ColReorder.prototype.VERSION = ColReorder.VERSION;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Initialisation
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* Register a new feature with DataTables
|
||||
*/
|
||||
if ( typeof $.fn.dataTable == "function" &&
|
||||
typeof $.fn.dataTableExt.fnVersionCheck == "function" &&
|
||||
$.fn.dataTableExt.fnVersionCheck('1.8.0') )
|
||||
{
|
||||
$.fn.dataTableExt.aoFeatures.push( {
|
||||
"fnInit": function( oDTSettings ) {
|
||||
var oTable = oDTSettings.oInstance;
|
||||
if ( typeof oTable._oPluginColReorder == 'undefined' ) {
|
||||
var opts = typeof oDTSettings.oInit.oColReorder != 'undefined' ?
|
||||
oDTSettings.oInit.oColReorder : {};
|
||||
oTable._oPluginColReorder = new ColReorder( oDTSettings.oInstance, opts );
|
||||
} else {
|
||||
oTable.oApi._fnLog( oDTSettings, 1, "ColReorder attempted to initialise twice. Ignoring second" );
|
||||
}
|
||||
|
||||
return null; /* No node to insert */
|
||||
},
|
||||
"cFeature": "R",
|
||||
"sFeature": "ColReorder"
|
||||
} );
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Warning: ColReorder requires DataTables 1.8.0 or greater - www.datatables.net/download");
|
||||
}
|
||||
|
||||
})(jQuery, window, document);
|
995
airtime_mvc/public/js/datatables/plugin/dataTables.ColVis.js
Normal file
995
airtime_mvc/public/js/datatables/plugin/dataTables.ColVis.js
Normal file
|
@ -0,0 +1,995 @@
|
|||
/*
|
||||
* File: ColVis.js
|
||||
* Version: 1.0.7.dev
|
||||
* CVS: $Id$
|
||||
* Description: Controls for column visiblity in DataTables
|
||||
* Author: Allan Jardine (www.sprymedia.co.uk)
|
||||
* Created: Wed Sep 15 18:23:29 BST 2010
|
||||
* Modified: $Date$ by $Author$
|
||||
* Language: Javascript
|
||||
* License: GPL v2 or BSD 3 point style
|
||||
* Project: Just a little bit of fun :-)
|
||||
* Contact: www.sprymedia.co.uk/contact
|
||||
*
|
||||
* Copyright 2010-2011 Allan Jardine, all rights reserved.
|
||||
*
|
||||
* This source file is free software, under either the GPL v2 license or a
|
||||
* BSD style license, available at:
|
||||
* http://datatables.net/license_gpl2
|
||||
* http://datatables.net/license_bsd
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
/**
|
||||
* ColVis provides column visiblity control for DataTables
|
||||
* @class ColVis
|
||||
* @constructor
|
||||
* @param {object} DataTables settings object
|
||||
*/
|
||||
ColVis = function( oDTSettings, oInit )
|
||||
{
|
||||
/* Santiy check that we are a new instance */
|
||||
if ( !this.CLASS || this.CLASS != "ColVis" )
|
||||
{
|
||||
alert( "Warning: ColVis must be initialised with the keyword 'new'" );
|
||||
}
|
||||
|
||||
if ( typeof oInit == 'undefined' )
|
||||
{
|
||||
oInit = {};
|
||||
}
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Public class variables
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/**
|
||||
* @namespace Settings object which contains customisable information for ColVis instance
|
||||
*/
|
||||
this.s = {
|
||||
/**
|
||||
* DataTables settings object
|
||||
* @property dt
|
||||
* @type Object
|
||||
* @default null
|
||||
*/
|
||||
"dt": null,
|
||||
|
||||
/**
|
||||
* Customisation object
|
||||
* @property oInit
|
||||
* @type Object
|
||||
* @default passed in
|
||||
*/
|
||||
"oInit": oInit,
|
||||
|
||||
/**
|
||||
* Callback function to tell the user when the state has changed
|
||||
* @property fnStateChange
|
||||
* @type function
|
||||
* @default null
|
||||
*/
|
||||
"fnStateChange": null,
|
||||
|
||||
/**
|
||||
* Mode of activation. Can be 'click' or 'mouseover'
|
||||
* @property activate
|
||||
* @type String
|
||||
* @default click
|
||||
*/
|
||||
"activate": "click",
|
||||
|
||||
/**
|
||||
* Position of the collection menu when shown - align "left" or "right"
|
||||
* @property sAlign
|
||||
* @type String
|
||||
* @default right
|
||||
*/
|
||||
"sAlign": "left",
|
||||
|
||||
/**
|
||||
* Text used for the button
|
||||
* @property buttonText
|
||||
* @type String
|
||||
* @default Show / hide columns
|
||||
*/
|
||||
"buttonText": "Show / hide columns",
|
||||
|
||||
/**
|
||||
* Flag to say if the collection is hidden
|
||||
* @property hidden
|
||||
* @type boolean
|
||||
* @default true
|
||||
*/
|
||||
"hidden": true,
|
||||
|
||||
/**
|
||||
* List of columns (integers) which should be excluded from the list
|
||||
* @property aiExclude
|
||||
* @type Array
|
||||
* @default []
|
||||
*/
|
||||
"aiExclude": [],
|
||||
|
||||
/**
|
||||
* Store the original viisbility settings so they could be restored
|
||||
* @property abOriginal
|
||||
* @type Array
|
||||
* @default []
|
||||
*/
|
||||
"abOriginal": [],
|
||||
|
||||
/**
|
||||
* Show Show-All button
|
||||
* @property bShowAll
|
||||
* @type Array
|
||||
* @default []
|
||||
*/
|
||||
"bShowAll": false,
|
||||
|
||||
/**
|
||||
* Show All button text
|
||||
* @property sShowAll
|
||||
* @type String
|
||||
* @default Restore original
|
||||
*/
|
||||
"sShowAll": "Show All",
|
||||
|
||||
/**
|
||||
* Show restore button
|
||||
* @property bRestore
|
||||
* @type Array
|
||||
* @default []
|
||||
*/
|
||||
"bRestore": false,
|
||||
|
||||
/**
|
||||
* Restore button text
|
||||
* @property sRestore
|
||||
* @type String
|
||||
* @default Restore original
|
||||
*/
|
||||
"sRestore": "Restore original",
|
||||
|
||||
/**
|
||||
* Overlay animation duration in mS
|
||||
* @property iOverlayFade
|
||||
* @type Integer
|
||||
* @default 500
|
||||
*/
|
||||
"iOverlayFade": 500,
|
||||
|
||||
/**
|
||||
* Label callback for column names. Takes three parameters: 1. the column index, 2. the column
|
||||
* title detected by DataTables and 3. the TH node for the column
|
||||
* @property fnLabel
|
||||
* @type Function
|
||||
* @default null
|
||||
*/
|
||||
"fnLabel": null,
|
||||
|
||||
/**
|
||||
* Indicate if ColVis should automatically calculate the size of buttons or not. The default
|
||||
* is for it to do so. Set to "css" to disable the automatic sizing
|
||||
* @property sSize
|
||||
* @type String
|
||||
* @default auto
|
||||
*/
|
||||
"sSize": "auto",
|
||||
|
||||
/**
|
||||
* Indicate if the column list should be positioned by Javascript, visually below the button
|
||||
* or allow CSS to do the positioning
|
||||
* @property bCssPosition
|
||||
* @type boolean
|
||||
* @default false
|
||||
*/
|
||||
"bCssPosition": false
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @namespace Common and useful DOM elements for the class instance
|
||||
*/
|
||||
this.dom = {
|
||||
/**
|
||||
* Wrapper for the button - given back to DataTables as the node to insert
|
||||
* @property wrapper
|
||||
* @type Node
|
||||
* @default null
|
||||
*/
|
||||
"wrapper": null,
|
||||
|
||||
/**
|
||||
* Activation button
|
||||
* @property button
|
||||
* @type Node
|
||||
* @default null
|
||||
*/
|
||||
"button": null,
|
||||
|
||||
/**
|
||||
* Collection list node
|
||||
* @property collection
|
||||
* @type Node
|
||||
* @default null
|
||||
*/
|
||||
"collection": null,
|
||||
|
||||
/**
|
||||
* Background node used for shading the display and event capturing
|
||||
* @property background
|
||||
* @type Node
|
||||
* @default null
|
||||
*/
|
||||
"background": null,
|
||||
|
||||
/**
|
||||
* Element to position over the activation button to catch mouse events when using mouseover
|
||||
* @property catcher
|
||||
* @type Node
|
||||
* @default null
|
||||
*/
|
||||
"catcher": null,
|
||||
|
||||
/**
|
||||
* List of button elements
|
||||
* @property buttons
|
||||
* @type Array
|
||||
* @default []
|
||||
*/
|
||||
"buttons": [],
|
||||
|
||||
/**
|
||||
* Restore button
|
||||
* @property restore
|
||||
* @type Node
|
||||
* @default null
|
||||
*/
|
||||
"restore": null
|
||||
};
|
||||
|
||||
/* Store global reference */
|
||||
ColVis.aInstances.push( this );
|
||||
|
||||
/* Constructor logic */
|
||||
this.s.dt = oDTSettings;
|
||||
this._fnConstruct();
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
|
||||
ColVis.prototype = {
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Public methods
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/**
|
||||
* Rebuild the list of buttons for this instance (i.e. if there is a column header update)
|
||||
* @method fnRebuild
|
||||
* @returns void
|
||||
*/
|
||||
"fnRebuild": function ()
|
||||
{
|
||||
/* Remove the old buttons */
|
||||
for ( var i=this.dom.buttons.length-1 ; i>=0 ; i-- )
|
||||
{
|
||||
if ( this.dom.buttons[i] !== null )
|
||||
{
|
||||
this.dom.collection.removeChild( this.dom.buttons[i] );
|
||||
}
|
||||
}
|
||||
this.dom.buttons.splice( 0, this.dom.buttons.length );
|
||||
|
||||
if ( this.dom.restore )
|
||||
{
|
||||
this.dom.restore.parentNode( this.dom.restore );
|
||||
}
|
||||
|
||||
/* Re-add them (this is not the optimal way of doing this, it is fast and effective) */
|
||||
this._fnAddButtons();
|
||||
|
||||
/* Update the checkboxes */
|
||||
this._fnDrawCallback();
|
||||
},
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Private methods (they are of course public in JS, but recommended as private)
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/**
|
||||
* Constructor logic
|
||||
* @method _fnConstruct
|
||||
* @returns void
|
||||
* @private
|
||||
*/
|
||||
"_fnConstruct": function ()
|
||||
{
|
||||
this._fnApplyCustomisation();
|
||||
|
||||
var that = this;
|
||||
this.dom.wrapper = document.createElement('div');
|
||||
this.dom.wrapper.className = "ColVis TableTools";
|
||||
|
||||
this.dom.button = this._fnDomBaseButton( this.s.buttonText );
|
||||
this.dom.button.className += " ColVis_MasterButton";
|
||||
this.dom.wrapper.appendChild( this.dom.button );
|
||||
|
||||
this.dom.catcher = this._fnDomCatcher();
|
||||
this.dom.collection = this._fnDomCollection();
|
||||
this.dom.background = this._fnDomBackground();
|
||||
|
||||
this._fnAddButtons();
|
||||
|
||||
/* Store the original visbility information */
|
||||
for ( var i=0, iLen=this.s.dt.aoColumns.length ; i<iLen ; i++ )
|
||||
{
|
||||
this.s.abOriginal.push( this.s.dt.aoColumns[i].bVisible );
|
||||
}
|
||||
|
||||
/* Update on each draw */
|
||||
this.s.dt.aoDrawCallback.push( {
|
||||
"fn": function () {
|
||||
that._fnDrawCallback.call( that );
|
||||
},
|
||||
"sName": "ColVis"
|
||||
} );
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Apply any customisation to the settings from the DataTables initialisation
|
||||
* @method _fnApplyCustomisation
|
||||
* @returns void
|
||||
* @private
|
||||
*/
|
||||
"_fnApplyCustomisation": function ()
|
||||
{
|
||||
var oConfig = this.s.oInit;
|
||||
|
||||
if ( typeof oConfig.activate != 'undefined' )
|
||||
{
|
||||
this.s.activate = oConfig.activate;
|
||||
}
|
||||
|
||||
if ( typeof oConfig.buttonText != 'undefined' )
|
||||
{
|
||||
this.s.buttonText = oConfig.buttonText;
|
||||
}
|
||||
|
||||
if ( typeof oConfig.aiExclude != 'undefined' )
|
||||
{
|
||||
this.s.aiExclude = oConfig.aiExclude;
|
||||
}
|
||||
|
||||
if ( typeof oConfig.bRestore != 'undefined' )
|
||||
{
|
||||
this.s.bRestore = oConfig.bRestore;
|
||||
}
|
||||
|
||||
if ( typeof oConfig.sRestore != 'undefined' )
|
||||
{
|
||||
this.s.sRestore = oConfig.sRestore;
|
||||
}
|
||||
|
||||
if ( typeof oConfig.bShowAll != 'undefined' )
|
||||
{
|
||||
this.s.bShowAll = oConfig.bShowAll;
|
||||
}
|
||||
|
||||
if ( typeof oConfig.sShowAll != 'undefined' )
|
||||
{
|
||||
this.s.sShowAll = oConfig.sShowAll;
|
||||
}
|
||||
|
||||
if ( typeof oConfig.sAlign != 'undefined' )
|
||||
{
|
||||
this.s.sAlign = oConfig.sAlign;
|
||||
}
|
||||
|
||||
if ( typeof oConfig.fnStateChange != 'undefined' )
|
||||
{
|
||||
this.s.fnStateChange = oConfig.fnStateChange;
|
||||
}
|
||||
|
||||
if ( typeof oConfig.iOverlayFade != 'undefined' )
|
||||
{
|
||||
this.s.iOverlayFade = oConfig.iOverlayFade;
|
||||
}
|
||||
|
||||
if ( typeof oConfig.fnLabel != 'undefined' )
|
||||
{
|
||||
this.s.fnLabel = oConfig.fnLabel;
|
||||
}
|
||||
|
||||
if ( typeof oConfig.sSize != 'undefined' )
|
||||
{
|
||||
this.s.sSize = oConfig.sSize;
|
||||
}
|
||||
|
||||
if ( typeof oConfig.bCssPosition != 'undefined' )
|
||||
{
|
||||
this.s.bCssPosition = oConfig.bCssPosition;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* On each table draw, check the visiblity checkboxes as needed. This allows any process to
|
||||
* update the table's column visiblity and ColVis will still be accurate.
|
||||
* @method _fnDrawCallback
|
||||
* @returns void
|
||||
* @private
|
||||
*/
|
||||
"_fnDrawCallback": function ()
|
||||
{
|
||||
var aoColumns = this.s.dt.aoColumns;
|
||||
|
||||
for ( var i=0, iLen=aoColumns.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( this.dom.buttons[i] !== null )
|
||||
{
|
||||
if ( aoColumns[i].bVisible )
|
||||
{
|
||||
$('input', this.dom.buttons[i]).attr('checked','checked');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('input', this.dom.buttons[i]).removeAttr('checked');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Loop through the columns in the table and as a new button for each one.
|
||||
* @method _fnAddButtons
|
||||
* @returns void
|
||||
* @private
|
||||
*/
|
||||
"_fnAddButtons": function ()
|
||||
{
|
||||
var
|
||||
nButton,
|
||||
sExclude = ","+this.s.aiExclude.join(',')+",";
|
||||
|
||||
for ( var i=0, iLen=this.s.dt.aoColumns.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( sExclude.indexOf( ","+i+"," ) == -1 )
|
||||
{
|
||||
nButton = this._fnDomColumnButton( i );
|
||||
this.dom.buttons.push( nButton );
|
||||
this.dom.collection.appendChild( nButton );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dom.buttons.push( null );
|
||||
}
|
||||
}
|
||||
|
||||
if ( this.s.bRestore )
|
||||
{
|
||||
nButton = this._fnDomRestoreButton();
|
||||
nButton.className += " ColVis_Restore";
|
||||
this.dom.buttons.push( nButton );
|
||||
this.dom.collection.appendChild( nButton );
|
||||
}
|
||||
|
||||
if ( this.s.bShowAll )
|
||||
{
|
||||
nButton = this._fnDomShowAllButton();
|
||||
nButton.className += " ColVis_ShowAll";
|
||||
this.dom.buttons.push( nButton );
|
||||
this.dom.collection.appendChild( nButton );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Create a button which allows a "restore" action
|
||||
* @method _fnDomRestoreButton
|
||||
* @returns {Node} Created button
|
||||
* @private
|
||||
*/
|
||||
"_fnDomRestoreButton": function ()
|
||||
{
|
||||
var
|
||||
that = this,
|
||||
nButton = document.createElement('button'),
|
||||
nSpan = document.createElement('span');
|
||||
|
||||
nButton.className = !this.s.dt.bJUI ? "ColVis_Button TableTools_Button" :
|
||||
"ColVis_Button TableTools_Button ui-button ui-state-default";
|
||||
nButton.appendChild( nSpan );
|
||||
$(nSpan).html( '<span class="ColVis_title">'+this.s.sRestore+'</span>' );
|
||||
|
||||
$(nButton).click( function (e) {
|
||||
for ( var i=0, iLen=that.s.abOriginal.length ; i<iLen ; i++ )
|
||||
{
|
||||
that.s.dt.oInstance.fnSetColumnVis( i, that.s.abOriginal[i], false );
|
||||
}
|
||||
that._fnAdjustOpenRows();
|
||||
that.s.dt.oInstance.fnDraw( false );
|
||||
} );
|
||||
|
||||
return nButton;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Create a button which allows a "show all" action
|
||||
* @method _fnDomShowAllButton
|
||||
* @returns {Node} Created button
|
||||
* @private
|
||||
*/
|
||||
"_fnDomShowAllButton": function ()
|
||||
{
|
||||
var
|
||||
that = this,
|
||||
nButton = document.createElement('button'),
|
||||
nSpan = document.createElement('span');
|
||||
|
||||
nButton.className = !this.s.dt.bJUI ? "ColVis_Button TableTools_Button" :
|
||||
"ColVis_Button TableTools_Button ui-button ui-state-default";
|
||||
nButton.appendChild( nSpan );
|
||||
$(nSpan).html( '<span class="ColVis_title">'+this.s.sShowAll+'</span>' );
|
||||
|
||||
$(nButton).click( function (e) {
|
||||
for ( var i=0, iLen=that.s.abOriginal.length ; i<iLen ; i++ )
|
||||
{
|
||||
if (that.s.aiExclude.indexOf(i) === -1)
|
||||
{
|
||||
that.s.dt.oInstance.fnSetColumnVis( i, true, false );
|
||||
}
|
||||
}
|
||||
that._fnAdjustOpenRows();
|
||||
that.s.dt.oInstance.fnDraw( false );
|
||||
} );
|
||||
|
||||
return nButton;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Create the DOM for a show / hide button
|
||||
* @method _fnDomColumnButton
|
||||
* @param {int} i Column in question
|
||||
* @returns {Node} Created button
|
||||
* @private
|
||||
*/
|
||||
"_fnDomColumnButton": function ( i )
|
||||
{
|
||||
var
|
||||
that = this,
|
||||
oColumn = this.s.dt.aoColumns[i],
|
||||
nButton = document.createElement('button'),
|
||||
nSpan = document.createElement('span'),
|
||||
dt = this.s.dt;
|
||||
|
||||
nButton.className = !dt.bJUI ? "ColVis_Button TableTools_Button" :
|
||||
"ColVis_Button TableTools_Button ui-button ui-state-default";
|
||||
nButton.appendChild( nSpan );
|
||||
var sTitle = this.s.fnLabel===null ? oColumn.sTitle : this.s.fnLabel( i, oColumn.sTitle, oColumn.nTh );
|
||||
$(nSpan).html(
|
||||
'<span class="ColVis_radio"><input type="checkbox"/></span>'+
|
||||
'<span class="ColVis_title">'+sTitle+'</span>' );
|
||||
|
||||
$(nButton).click( function (e) {
|
||||
var showHide = !$('input', this).is(":checked");
|
||||
if ( e.target.nodeName.toLowerCase() == "input" )
|
||||
{
|
||||
showHide = $('input', this).is(":checked");
|
||||
}
|
||||
|
||||
/* Need to consider the case where the initialiser created more than one table - change the
|
||||
* API index that DataTables is using
|
||||
*/
|
||||
var oldIndex = $.fn.dataTableExt.iApiIndex;
|
||||
$.fn.dataTableExt.iApiIndex = that._fnDataTablesApiIndex.call(that);
|
||||
|
||||
// Optimisation for server-side processing when scrolling - don't do a full redraw
|
||||
if ( dt.oFeatures.bServerSide && (dt.oScroll.sX !== "" || dt.oScroll.sY !== "" ) )
|
||||
{
|
||||
that.s.dt.oInstance.fnSetColumnVis( i, showHide, false );
|
||||
that.s.dt.oInstance.oApi._fnScrollDraw( that.s.dt );
|
||||
that._fnDrawCallback();
|
||||
}
|
||||
else
|
||||
{
|
||||
that.s.dt.oInstance.fnSetColumnVis( i, showHide );
|
||||
}
|
||||
|
||||
$.fn.dataTableExt.iApiIndex = oldIndex; /* Restore */
|
||||
|
||||
if ( that.s.fnStateChange !== null )
|
||||
{
|
||||
that.s.fnStateChange.call( that, i, showHide );
|
||||
}
|
||||
} );
|
||||
|
||||
return nButton;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Get the position in the DataTables instance array of the table for this instance of ColVis
|
||||
* @method _fnDataTablesApiIndex
|
||||
* @returns {int} Index
|
||||
* @private
|
||||
*/
|
||||
"_fnDataTablesApiIndex": function ()
|
||||
{
|
||||
for ( var i=0, iLen=this.s.dt.oInstance.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( this.s.dt.oInstance[i] == this.s.dt.nTable )
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Create the DOM needed for the button and apply some base properties. All buttons start here
|
||||
* @method _fnDomBaseButton
|
||||
* @param {String} text Button text
|
||||
* @returns {Node} DIV element for the button
|
||||
* @private
|
||||
*/
|
||||
"_fnDomBaseButton": function ( text )
|
||||
{
|
||||
var
|
||||
that = this,
|
||||
nButton = document.createElement('button'),
|
||||
nSpan = document.createElement('span'),
|
||||
sEvent = this.s.activate=="mouseover" ? "mouseover" : "click";
|
||||
|
||||
nButton.className = !this.s.dt.bJUI ? "ColVis_Button TableTools_Button" :
|
||||
"ColVis_Button TableTools_Button ui-button ui-state-default";
|
||||
nButton.appendChild( nSpan );
|
||||
nSpan.innerHTML = text;
|
||||
|
||||
$(nButton).bind( sEvent, function (e) {
|
||||
that._fnCollectionShow();
|
||||
e.preventDefault();
|
||||
} );
|
||||
|
||||
return nButton;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Create the element used to contain list the columns (it is shown and hidden as needed)
|
||||
* @method _fnDomCollection
|
||||
* @returns {Node} div container for the collection
|
||||
* @private
|
||||
*/
|
||||
"_fnDomCollection": function ()
|
||||
{
|
||||
var that = this;
|
||||
var nHidden = document.createElement('div');
|
||||
nHidden.style.display = "none";
|
||||
nHidden.className = !this.s.dt.bJUI ? "ColVis_collection TableTools_collection" :
|
||||
"ColVis_collection TableTools_collection ui-buttonset ui-buttonset-multi";
|
||||
|
||||
if ( !this.s.bCssPosition )
|
||||
{
|
||||
nHidden.style.position = "absolute";
|
||||
}
|
||||
$(nHidden).css('opacity', 0);
|
||||
|
||||
return nHidden;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* An element to be placed on top of the activate button to catch events
|
||||
* @method _fnDomCatcher
|
||||
* @returns {Node} div container for the collection
|
||||
* @private
|
||||
*/
|
||||
"_fnDomCatcher": function ()
|
||||
{
|
||||
var
|
||||
that = this,
|
||||
nCatcher = document.createElement('div');
|
||||
nCatcher.className = "ColVis_catcher TableTools_catcher";
|
||||
|
||||
$(nCatcher).click( function () {
|
||||
that._fnCollectionHide.call( that, null, null );
|
||||
} );
|
||||
|
||||
return nCatcher;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Create the element used to shade the background, and capture hide events (it is shown and
|
||||
* hidden as needed)
|
||||
* @method _fnDomBackground
|
||||
* @returns {Node} div container for the background
|
||||
* @private
|
||||
*/
|
||||
"_fnDomBackground": function ()
|
||||
{
|
||||
var that = this;
|
||||
|
||||
var nBackground = document.createElement('div');
|
||||
nBackground.style.position = "absolute";
|
||||
nBackground.style.left = "0px";
|
||||
nBackground.style.top = "0px";
|
||||
nBackground.className = "ColVis_collectionBackground TableTools_collectionBackground";
|
||||
$(nBackground).css('opacity', 0);
|
||||
|
||||
$(nBackground).click( function () {
|
||||
that._fnCollectionHide.call( that, null, null );
|
||||
} );
|
||||
|
||||
/* When considering a mouse over action for the activation, we also consider a mouse out
|
||||
* which is the same as a mouse over the background - without all the messing around of
|
||||
* bubbling events. Use the catcher element to avoid messing around with bubbling
|
||||
*/
|
||||
if ( this.s.activate == "mouseover" )
|
||||
{
|
||||
$(nBackground).mouseover( function () {
|
||||
that.s.overcollection = false;
|
||||
that._fnCollectionHide.call( that, null, null );
|
||||
} );
|
||||
}
|
||||
|
||||
return nBackground;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Show the show / hide list and the background
|
||||
* @method _fnCollectionShow
|
||||
* @returns void
|
||||
* @private
|
||||
*/
|
||||
"_fnCollectionShow": function ()
|
||||
{
|
||||
var that = this, i, iLen;
|
||||
var oPos = $(this.dom.button).offset();
|
||||
var nHidden = this.dom.collection;
|
||||
var nBackground = this.dom.background;
|
||||
var iDivX = parseInt(oPos.left, 10);
|
||||
var iDivY = parseInt(oPos.top + $(this.dom.button).outerHeight(), 10);
|
||||
|
||||
if ( !this.s.bCssPosition )
|
||||
{
|
||||
nHidden.style.top = iDivY+"px";
|
||||
nHidden.style.left = iDivX+"px";
|
||||
}
|
||||
nHidden.style.display = "block";
|
||||
$(nHidden).css('opacity',0);
|
||||
|
||||
var iWinHeight = $(window).height(), iDocHeight = $(document).height(),
|
||||
iWinWidth = $(window).width(), iDocWidth = $(document).width();
|
||||
|
||||
nBackground.style.height = ((iWinHeight>iDocHeight)? iWinHeight : iDocHeight) +"px";
|
||||
nBackground.style.width = ((iWinWidth<iDocWidth)? iWinWidth : iDocWidth) +"px";
|
||||
|
||||
var oStyle = this.dom.catcher.style;
|
||||
oStyle.height = $(this.dom.button).outerHeight()+"px";
|
||||
oStyle.width = $(this.dom.button).outerWidth()+"px";
|
||||
oStyle.top = oPos.top+"px";
|
||||
oStyle.left = iDivX+"px";
|
||||
|
||||
document.body.appendChild( nBackground );
|
||||
document.body.appendChild( nHidden );
|
||||
document.body.appendChild( this.dom.catcher );
|
||||
|
||||
/* Resize the buttons */
|
||||
if ( this.s.sSize == "auto" )
|
||||
{
|
||||
var aiSizes = [];
|
||||
this.dom.collection.style.width = "auto";
|
||||
for ( i=0, iLen=this.dom.buttons.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( this.dom.buttons[i] !== null )
|
||||
{
|
||||
this.dom.buttons[i].style.width = "auto";
|
||||
aiSizes.push( $(this.dom.buttons[i]).outerWidth() );
|
||||
}
|
||||
}
|
||||
iMax = Math.max.apply(window, aiSizes);
|
||||
for ( i=0, iLen=this.dom.buttons.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( this.dom.buttons[i] !== null )
|
||||
{
|
||||
this.dom.buttons[i].style.width = iMax+"px";
|
||||
}
|
||||
}
|
||||
this.dom.collection.style.width = iMax+"px";
|
||||
}
|
||||
|
||||
/* Visual corrections to try and keep the collection visible */
|
||||
if ( !this.s.bCssPosition )
|
||||
{
|
||||
nHidden.style.left = this.s.sAlign=="left" ?
|
||||
iDivX+"px" : (iDivX-$(nHidden).outerWidth()+$(this.dom.button).outerWidth())+"px";
|
||||
|
||||
var iDivWidth = $(nHidden).outerWidth();
|
||||
var iDivHeight = $(nHidden).outerHeight();
|
||||
|
||||
if ( iDivX + iDivWidth > iDocWidth )
|
||||
{
|
||||
nHidden.style.left = (iDocWidth-iDivWidth)+"px";
|
||||
}
|
||||
}
|
||||
|
||||
/* This results in a very small delay for the end user but it allows the animation to be
|
||||
* much smoother. If you don't want the animation, then the setTimeout can be removed
|
||||
*/
|
||||
setTimeout( function () {
|
||||
$(nHidden).animate({"opacity": 1}, that.s.iOverlayFade);
|
||||
$(nBackground).animate({"opacity": 0.1}, that.s.iOverlayFade, 'linear', function () {
|
||||
/* In IE6 if you set the checked attribute of a hidden checkbox, then this is not visually
|
||||
* reflected. As such, we need to do it here, once it is visible. Unbelievable.
|
||||
*/
|
||||
if ( jQuery.browser.msie && jQuery.browser.version == "6.0" )
|
||||
{
|
||||
that._fnDrawCallback();
|
||||
}
|
||||
});
|
||||
}, 10 );
|
||||
|
||||
this.s.hidden = false;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Hide the show / hide list and the background
|
||||
* @method _fnCollectionHide
|
||||
* @returns void
|
||||
* @private
|
||||
*/
|
||||
"_fnCollectionHide": function ( )
|
||||
{
|
||||
var that = this;
|
||||
|
||||
if ( !this.s.hidden && this.dom.collection !== null )
|
||||
{
|
||||
this.s.hidden = true;
|
||||
|
||||
$(this.dom.collection).animate({"opacity": 0}, that.s.iOverlayFade, function (e) {
|
||||
this.style.display = "none";
|
||||
} );
|
||||
|
||||
$(this.dom.background).animate({"opacity": 0}, that.s.iOverlayFade, function (e) {
|
||||
document.body.removeChild( that.dom.background );
|
||||
document.body.removeChild( that.dom.catcher );
|
||||
} );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
"_fnAdjustOpenRows": function ()
|
||||
{
|
||||
var aoOpen = this.s.dt.aoOpenRows;
|
||||
var iVisible = this.s.dt.oApi._fnVisbleColumns( this.s.dt );
|
||||
|
||||
for ( var i=0, iLen=aoOpen.length ; i<iLen ; i++ ) {
|
||||
aoOpen[i].nTr.getElementsByTagName('td')[0].colSpan = iVisible;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Static object methods
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/**
|
||||
* Rebuild the collection for a given table, or all tables if no parameter given
|
||||
* @method ColVis.fnRebuild
|
||||
* @static
|
||||
* @param object oTable DataTable instance to consider - optional
|
||||
* @returns void
|
||||
*/
|
||||
ColVis.fnRebuild = function ( oTable )
|
||||
{
|
||||
var nTable = null;
|
||||
if ( typeof oTable != 'undefined' )
|
||||
{
|
||||
nTable = oTable.fnSettings().nTable;
|
||||
}
|
||||
|
||||
for ( var i=0, iLen=ColVis.aInstances.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( typeof oTable == 'undefined' || nTable == ColVis.aInstances[i].s.dt.nTable )
|
||||
{
|
||||
ColVis.aInstances[i].fnRebuild();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Static object propterties
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/**
|
||||
* Collection of all ColVis instances
|
||||
* @property ColVis.aInstances
|
||||
* @static
|
||||
* @type Array
|
||||
* @default []
|
||||
*/
|
||||
ColVis.aInstances = [];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Constants
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/**
|
||||
* Name of this class
|
||||
* @constant CLASS
|
||||
* @type String
|
||||
* @default ColVis
|
||||
*/
|
||||
ColVis.prototype.CLASS = "ColVis";
|
||||
|
||||
|
||||
/**
|
||||
* ColVis version
|
||||
* @constant VERSION
|
||||
* @type String
|
||||
* @default See code
|
||||
*/
|
||||
ColVis.VERSION = "1.0.7.dev";
|
||||
ColVis.prototype.VERSION = ColVis.VERSION;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Initialisation
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* Register a new feature with DataTables
|
||||
*/
|
||||
if ( typeof $.fn.dataTable == "function" &&
|
||||
typeof $.fn.dataTableExt.fnVersionCheck == "function" &&
|
||||
$.fn.dataTableExt.fnVersionCheck('1.7.0') )
|
||||
{
|
||||
$.fn.dataTableExt.aoFeatures.push( {
|
||||
"fnInit": function( oDTSettings ) {
|
||||
var init = (typeof oDTSettings.oInit.oColVis == 'undefined') ?
|
||||
{} : oDTSettings.oInit.oColVis;
|
||||
var oColvis = new ColVis( oDTSettings, init );
|
||||
return oColvis.dom.wrapper;
|
||||
},
|
||||
"cFeature": "C",
|
||||
"sFeature": "ColVis"
|
||||
} );
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Warning: ColVis requires DataTables 1.7 or greater - www.datatables.net/download");
|
||||
}
|
||||
|
||||
})(jQuery);
|
1185
airtime_mvc/public/js/datatables/plugin/dataTables.FixedColumns.js
Normal file
1185
airtime_mvc/public/js/datatables/plugin/dataTables.FixedColumns.js
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue