can change the colors of shows if set in add show dialog, otherwise takes default from css style sheet.

This commit is contained in:
Naomi 2011-01-21 14:43:38 -05:00
parent 7bdfd60ea9
commit b3ccd6ab1c
11 changed files with 353 additions and 45 deletions

View File

@ -0,0 +1,20 @@
<?php
// This file generated by Propel 1.5.2 convert-conf target
// from XML runtime conf file /home/naomi/dev-campcaster/campcaster/build/runtime-conf.xml
$conf = array (
'datasources' =>
array (
'airtime' =>
array (
'adapter' => 'pgsql',
'connection' =>
array (
'dsn' => 'pgsql:host=localhost;port=5432;dbname=airtime;user=airtime;password=airtime',
),
),
'default' => 'airtime',
),
'generator_version' => '1.5.2',
);
$conf['classmap'] = include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classmap-airtime-conf.php');
return $conf;

View File

@ -0,0 +1,116 @@
<?php
// This file generated by Propel 1.5.2 convert-conf target
return array (
'CcAccessTableMap' => 'airtime/map/CcAccessTableMap.php',
'CcAccessPeer' => 'airtime/CcAccessPeer.php',
'CcAccess' => 'airtime/CcAccess.php',
'CcAccessQuery' => 'airtime/CcAccessQuery.php',
'BaseCcAccessPeer' => 'airtime/om/BaseCcAccessPeer.php',
'BaseCcAccess' => 'airtime/om/BaseCcAccess.php',
'BaseCcAccessQuery' => 'airtime/om/BaseCcAccessQuery.php',
'CcBackupTableMap' => 'airtime/map/CcBackupTableMap.php',
'CcBackupPeer' => 'airtime/CcBackupPeer.php',
'CcBackup' => 'airtime/CcBackup.php',
'CcBackupQuery' => 'airtime/CcBackupQuery.php',
'BaseCcBackupPeer' => 'airtime/om/BaseCcBackupPeer.php',
'BaseCcBackup' => 'airtime/om/BaseCcBackup.php',
'BaseCcBackupQuery' => 'airtime/om/BaseCcBackupQuery.php',
'CcFilesTableMap' => 'airtime/map/CcFilesTableMap.php',
'CcFilesPeer' => 'airtime/CcFilesPeer.php',
'CcFiles' => 'airtime/CcFiles.php',
'CcFilesQuery' => 'airtime/CcFilesQuery.php',
'BaseCcFilesPeer' => 'airtime/om/BaseCcFilesPeer.php',
'BaseCcFiles' => 'airtime/om/BaseCcFiles.php',
'BaseCcFilesQuery' => 'airtime/om/BaseCcFilesQuery.php',
'CcPermsTableMap' => 'airtime/map/CcPermsTableMap.php',
'CcPermsPeer' => 'airtime/CcPermsPeer.php',
'CcPerms' => 'airtime/CcPerms.php',
'CcPermsQuery' => 'airtime/CcPermsQuery.php',
'BaseCcPermsPeer' => 'airtime/om/BaseCcPermsPeer.php',
'BaseCcPerms' => 'airtime/om/BaseCcPerms.php',
'BaseCcPermsQuery' => 'airtime/om/BaseCcPermsQuery.php',
'CcShowTableMap' => 'airtime/map/CcShowTableMap.php',
'CcShowPeer' => 'airtime/CcShowPeer.php',
'CcShow' => 'airtime/CcShow.php',
'CcShowQuery' => 'airtime/CcShowQuery.php',
'BaseCcShowPeer' => 'airtime/om/BaseCcShowPeer.php',
'BaseCcShow' => 'airtime/om/BaseCcShow.php',
'BaseCcShowQuery' => 'airtime/om/BaseCcShowQuery.php',
'CcShowDaysTableMap' => 'airtime/map/CcShowDaysTableMap.php',
'CcShowDaysPeer' => 'airtime/CcShowDaysPeer.php',
'CcShowDays' => 'airtime/CcShowDays.php',
'CcShowDaysQuery' => 'airtime/CcShowDaysQuery.php',
'BaseCcShowDaysPeer' => 'airtime/om/BaseCcShowDaysPeer.php',
'BaseCcShowDays' => 'airtime/om/BaseCcShowDays.php',
'BaseCcShowDaysQuery' => 'airtime/om/BaseCcShowDaysQuery.php',
'CcShowHostsTableMap' => 'airtime/map/CcShowHostsTableMap.php',
'CcShowHostsPeer' => 'airtime/CcShowHostsPeer.php',
'CcShowHosts' => 'airtime/CcShowHosts.php',
'CcShowHostsQuery' => 'airtime/CcShowHostsQuery.php',
'BaseCcShowHostsPeer' => 'airtime/om/BaseCcShowHostsPeer.php',
'BaseCcShowHosts' => 'airtime/om/BaseCcShowHosts.php',
'BaseCcShowHostsQuery' => 'airtime/om/BaseCcShowHostsQuery.php',
'CcShowScheduleTableMap' => 'airtime/map/CcShowScheduleTableMap.php',
'CcShowSchedulePeer' => 'airtime/CcShowSchedulePeer.php',
'CcShowSchedule' => 'airtime/CcShowSchedule.php',
'CcShowScheduleQuery' => 'airtime/CcShowScheduleQuery.php',
'BaseCcShowSchedulePeer' => 'airtime/om/BaseCcShowSchedulePeer.php',
'BaseCcShowSchedule' => 'airtime/om/BaseCcShowSchedule.php',
'BaseCcShowScheduleQuery' => 'airtime/om/BaseCcShowScheduleQuery.php',
'CcPlaylistTableMap' => 'airtime/map/CcPlaylistTableMap.php',
'CcPlaylistPeer' => 'airtime/CcPlaylistPeer.php',
'CcPlaylist' => 'airtime/CcPlaylist.php',
'CcPlaylistQuery' => 'airtime/CcPlaylistQuery.php',
'BaseCcPlaylistPeer' => 'airtime/om/BaseCcPlaylistPeer.php',
'BaseCcPlaylist' => 'airtime/om/BaseCcPlaylist.php',
'BaseCcPlaylistQuery' => 'airtime/om/BaseCcPlaylistQuery.php',
'CcPlaylistcontentsTableMap' => 'airtime/map/CcPlaylistcontentsTableMap.php',
'CcPlaylistcontentsPeer' => 'airtime/CcPlaylistcontentsPeer.php',
'CcPlaylistcontents' => 'airtime/CcPlaylistcontents.php',
'CcPlaylistcontentsQuery' => 'airtime/CcPlaylistcontentsQuery.php',
'BaseCcPlaylistcontentsPeer' => 'airtime/om/BaseCcPlaylistcontentsPeer.php',
'BaseCcPlaylistcontents' => 'airtime/om/BaseCcPlaylistcontents.php',
'BaseCcPlaylistcontentsQuery' => 'airtime/om/BaseCcPlaylistcontentsQuery.php',
'CcPrefTableMap' => 'airtime/map/CcPrefTableMap.php',
'CcPrefPeer' => 'airtime/CcPrefPeer.php',
'CcPref' => 'airtime/CcPref.php',
'CcPrefQuery' => 'airtime/CcPrefQuery.php',
'BaseCcPrefPeer' => 'airtime/om/BaseCcPrefPeer.php',
'BaseCcPref' => 'airtime/om/BaseCcPref.php',
'BaseCcPrefQuery' => 'airtime/om/BaseCcPrefQuery.php',
'CcScheduleTableMap' => 'airtime/map/CcScheduleTableMap.php',
'CcSchedulePeer' => 'airtime/CcSchedulePeer.php',
'CcSchedule' => 'airtime/CcSchedule.php',
'CcScheduleQuery' => 'airtime/CcScheduleQuery.php',
'BaseCcSchedulePeer' => 'airtime/om/BaseCcSchedulePeer.php',
'BaseCcSchedule' => 'airtime/om/BaseCcSchedule.php',
'BaseCcScheduleQuery' => 'airtime/om/BaseCcScheduleQuery.php',
'CcSessTableMap' => 'airtime/map/CcSessTableMap.php',
'CcSessPeer' => 'airtime/CcSessPeer.php',
'CcSess' => 'airtime/CcSess.php',
'CcSessQuery' => 'airtime/CcSessQuery.php',
'BaseCcSessPeer' => 'airtime/om/BaseCcSessPeer.php',
'BaseCcSess' => 'airtime/om/BaseCcSess.php',
'BaseCcSessQuery' => 'airtime/om/BaseCcSessQuery.php',
'CcSmembTableMap' => 'airtime/map/CcSmembTableMap.php',
'CcSmembPeer' => 'airtime/CcSmembPeer.php',
'CcSmemb' => 'airtime/CcSmemb.php',
'CcSmembQuery' => 'airtime/CcSmembQuery.php',
'BaseCcSmembPeer' => 'airtime/om/BaseCcSmembPeer.php',
'BaseCcSmemb' => 'airtime/om/BaseCcSmemb.php',
'BaseCcSmembQuery' => 'airtime/om/BaseCcSmembQuery.php',
'CcSubjsTableMap' => 'airtime/map/CcSubjsTableMap.php',
'CcSubjsPeer' => 'airtime/CcSubjsPeer.php',
'CcSubjs' => 'airtime/CcSubjs.php',
'CcSubjsQuery' => 'airtime/CcSubjsQuery.php',
'BaseCcSubjsPeer' => 'airtime/om/BaseCcSubjsPeer.php',
'BaseCcSubjs' => 'airtime/om/BaseCcSubjs.php',
'BaseCcSubjsQuery' => 'airtime/om/BaseCcSubjsQuery.php',
'CcTransTableMap' => 'airtime/map/CcTransTableMap.php',
'CcTransPeer' => 'airtime/CcTransPeer.php',
'CcTrans' => 'airtime/CcTrans.php',
'CcTransQuery' => 'airtime/CcTransQuery.php',
'BaseCcTransPeer' => 'airtime/om/BaseCcTransPeer.php',
'BaseCcTrans' => 'airtime/om/BaseCcTrans.php',
'BaseCcTransQuery' => 'airtime/om/BaseCcTransQuery.php',
);

View File

@ -53,6 +53,8 @@ class Show {
$show->setDbName($data['add_show_name']);
$show->setDbRepeats($data['add_show_repeats']);
$show->setDbDescription($data['add_show_description']);
$show->setDbColor($data['add_show_color']);
$show->setDbBackgroundColor($data['add_show_background_color']);
$show->save();
$showId = $show->getDbId();
@ -460,7 +462,7 @@ class Show {
$sql;
$sql_gen = "SELECT cc_show_days.id AS day_id, name, repeats, description,
$sql_gen = "SELECT cc_show_days.id AS day_id, name, repeats, description, color, background_color,
first_show, last_show, start_time, end_time, day, show_id
FROM (cc_show LEFT JOIN cc_show_days ON cc_show.id = cc_show_days.show_id)";
@ -604,7 +606,9 @@ class Show {
"start" => $start_ts,
"end" => $end_ts,
"allDay" => false,
"description" => $show["description"]
"description" => $show["description"],
"color" => $show["color"],
"backgroundColor" => $show["background_color"]
);
foreach($options as $key=>$value) {

View File

@ -42,6 +42,8 @@ class CcShowTableMap extends TableMap {
$this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, '');
$this->addColumn('REPEATS', 'DbRepeats', 'TINYINT', true, null, null);
$this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null);
$this->addColumn('COLOR', 'DbColor', 'VARCHAR', false, 6, null);
$this->addColumn('BACKGROUND_COLOR', 'DbBackgroundColor', 'VARCHAR', false, 6, null);
// validators
} // initialize()

View File

@ -49,6 +49,18 @@ abstract class BaseCcShow extends BaseObject implements Persistent
*/
protected $description;
/**
* The value for the color field.
* @var string
*/
protected $color;
/**
* The value for the background_color field.
* @var string
*/
protected $background_color;
/**
* @var array CcShowDays[] Collection to store aggregation of CcShowDays objects.
*/
@ -139,6 +151,26 @@ abstract class BaseCcShow extends BaseObject implements Persistent
return $this->description;
}
/**
* Get the [color] column value.
*
* @return string
*/
public function getDbColor()
{
return $this->color;
}
/**
* Get the [background_color] column value.
*
* @return string
*/
public function getDbBackgroundColor()
{
return $this->background_color;
}
/**
* Set the value of [id] column.
*
@ -219,6 +251,46 @@ abstract class BaseCcShow extends BaseObject implements Persistent
return $this;
} // setDbDescription()
/**
* Set the value of [color] column.
*
* @param string $v new value
* @return CcShow The current object (for fluent API support)
*/
public function setDbColor($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->color !== $v) {
$this->color = $v;
$this->modifiedColumns[] = CcShowPeer::COLOR;
}
return $this;
} // setDbColor()
/**
* Set the value of [background_color] column.
*
* @param string $v new value
* @return CcShow The current object (for fluent API support)
*/
public function setDbBackgroundColor($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->background_color !== $v) {
$this->background_color = $v;
$this->modifiedColumns[] = CcShowPeer::BACKGROUND_COLOR;
}
return $this;
} // setDbBackgroundColor()
/**
* Indicates whether the columns in this object are only set to default values.
*
@ -259,6 +331,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
$this->repeats = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
$this->description = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
$this->color = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
$this->background_color = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
$this->resetModified();
$this->setNew(false);
@ -267,7 +341,7 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$this->ensureConsistency();
}
return $startcol + 4; // 4 = CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 6; // 6 = CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating CcShow object", $e);
@ -632,6 +706,12 @@ abstract class BaseCcShow extends BaseObject implements Persistent
case 3:
return $this->getDbDescription();
break;
case 4:
return $this->getDbColor();
break;
case 5:
return $this->getDbBackgroundColor();
break;
default:
return null;
break;
@ -659,6 +739,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$keys[1] => $this->getDbName(),
$keys[2] => $this->getDbRepeats(),
$keys[3] => $this->getDbDescription(),
$keys[4] => $this->getDbColor(),
$keys[5] => $this->getDbBackgroundColor(),
);
return $result;
}
@ -702,6 +784,12 @@ abstract class BaseCcShow extends BaseObject implements Persistent
case 3:
$this->setDbDescription($value);
break;
case 4:
$this->setDbColor($value);
break;
case 5:
$this->setDbBackgroundColor($value);
break;
} // switch()
}
@ -730,6 +818,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent
if (array_key_exists($keys[1], $arr)) $this->setDbName($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setDbRepeats($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDbDescription($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setDbColor($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setDbBackgroundColor($arr[$keys[5]]);
}
/**
@ -745,6 +835,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent
if ($this->isColumnModified(CcShowPeer::NAME)) $criteria->add(CcShowPeer::NAME, $this->name);
if ($this->isColumnModified(CcShowPeer::REPEATS)) $criteria->add(CcShowPeer::REPEATS, $this->repeats);
if ($this->isColumnModified(CcShowPeer::DESCRIPTION)) $criteria->add(CcShowPeer::DESCRIPTION, $this->description);
if ($this->isColumnModified(CcShowPeer::COLOR)) $criteria->add(CcShowPeer::COLOR, $this->color);
if ($this->isColumnModified(CcShowPeer::BACKGROUND_COLOR)) $criteria->add(CcShowPeer::BACKGROUND_COLOR, $this->background_color);
return $criteria;
}
@ -809,6 +901,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$copyObj->setDbName($this->name);
$copyObj->setDbRepeats($this->repeats);
$copyObj->setDbDescription($this->description);
$copyObj->setDbColor($this->color);
$copyObj->setDbBackgroundColor($this->background_color);
if ($deepCopy) {
// important: temporarily setNew(false) because this affects the behavior of
@ -1239,6 +1333,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$this->name = null;
$this->repeats = null;
$this->description = null;
$this->color = null;
$this->background_color = null;
$this->alreadyInSave = false;
$this->alreadyInValidation = false;
$this->clearAllReferences();

View File

@ -26,7 +26,7 @@ abstract class BaseCcShowPeer {
const TM_CLASS = 'CcShowTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 4;
const NUM_COLUMNS = 6;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
@ -43,6 +43,12 @@ abstract class BaseCcShowPeer {
/** the column name for the DESCRIPTION field */
const DESCRIPTION = 'cc_show.DESCRIPTION';
/** the column name for the COLOR field */
const COLOR = 'cc_show.COLOR';
/** the column name for the BACKGROUND_COLOR field */
const BACKGROUND_COLOR = 'cc_show.BACKGROUND_COLOR';
/**
* An identiy map to hold any loaded instances of CcShow objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
@ -59,12 +65,12 @@ abstract class BaseCcShowPeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbRepeats', 'DbDescription', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbRepeats', 'dbDescription', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::REPEATS, self::DESCRIPTION, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'REPEATS', 'DESCRIPTION', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'repeats', 'description', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbRepeats', 'DbDescription', 'DbColor', 'DbBackgroundColor', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbRepeats', 'dbDescription', 'dbColor', 'dbBackgroundColor', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::REPEATS, self::DESCRIPTION, self::COLOR, self::BACKGROUND_COLOR, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'REPEATS', 'DESCRIPTION', 'COLOR', 'BACKGROUND_COLOR', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'repeats', 'description', 'color', 'background_color', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
);
/**
@ -74,12 +80,12 @@ abstract class BaseCcShowPeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbRepeats' => 2, 'DbDescription' => 3, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbRepeats' => 2, 'dbDescription' => 3, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::REPEATS => 2, self::DESCRIPTION => 3, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'REPEATS' => 2, 'DESCRIPTION' => 3, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'repeats' => 2, 'description' => 3, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbRepeats' => 2, 'DbDescription' => 3, 'DbColor' => 4, 'DbBackgroundColor' => 5, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbRepeats' => 2, 'dbDescription' => 3, 'dbColor' => 4, 'dbBackgroundColor' => 5, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::REPEATS => 2, self::DESCRIPTION => 3, self::COLOR => 4, self::BACKGROUND_COLOR => 5, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'REPEATS' => 2, 'DESCRIPTION' => 3, 'COLOR' => 4, 'BACKGROUND_COLOR' => 5, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'repeats' => 2, 'description' => 3, 'color' => 4, 'background_color' => 5, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
);
/**
@ -155,11 +161,15 @@ abstract class BaseCcShowPeer {
$criteria->addSelectColumn(CcShowPeer::NAME);
$criteria->addSelectColumn(CcShowPeer::REPEATS);
$criteria->addSelectColumn(CcShowPeer::DESCRIPTION);
$criteria->addSelectColumn(CcShowPeer::COLOR);
$criteria->addSelectColumn(CcShowPeer::BACKGROUND_COLOR);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.NAME');
$criteria->addSelectColumn($alias . '.REPEATS');
$criteria->addSelectColumn($alias . '.DESCRIPTION');
$criteria->addSelectColumn($alias . '.COLOR');
$criteria->addSelectColumn($alias . '.BACKGROUND_COLOR');
}
}

View File

@ -10,11 +10,15 @@
* @method CcShowQuery orderByDbName($order = Criteria::ASC) Order by the name column
* @method CcShowQuery orderByDbRepeats($order = Criteria::ASC) Order by the repeats column
* @method CcShowQuery orderByDbDescription($order = Criteria::ASC) Order by the description column
* @method CcShowQuery orderByDbColor($order = Criteria::ASC) Order by the color column
* @method CcShowQuery orderByDbBackgroundColor($order = Criteria::ASC) Order by the background_color column
*
* @method CcShowQuery groupByDbId() Group by the id column
* @method CcShowQuery groupByDbName() Group by the name column
* @method CcShowQuery groupByDbRepeats() Group by the repeats column
* @method CcShowQuery groupByDbDescription() Group by the description column
* @method CcShowQuery groupByDbColor() Group by the color column
* @method CcShowQuery groupByDbBackgroundColor() Group by the background_color column
*
* @method CcShowQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcShowQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@ -39,11 +43,15 @@
* @method CcShow findOneByDbName(string $name) Return the first CcShow filtered by the name column
* @method CcShow findOneByDbRepeats(int $repeats) Return the first CcShow filtered by the repeats column
* @method CcShow findOneByDbDescription(string $description) Return the first CcShow filtered by the description column
* @method CcShow findOneByDbColor(string $color) Return the first CcShow filtered by the color column
* @method CcShow findOneByDbBackgroundColor(string $background_color) Return the first CcShow filtered by the background_color column
*
* @method array findByDbId(int $id) Return CcShow objects filtered by the id column
* @method array findByDbName(string $name) Return CcShow objects filtered by the name column
* @method array findByDbRepeats(int $repeats) Return CcShow objects filtered by the repeats column
* @method array findByDbDescription(string $description) Return CcShow objects filtered by the description column
* @method array findByDbColor(string $color) Return CcShow objects filtered by the color column
* @method array findByDbBackgroundColor(string $background_color) Return CcShow objects filtered by the background_color column
*
* @package propel.generator.airtime.om
*/
@ -245,6 +253,50 @@ abstract class BaseCcShowQuery extends ModelCriteria
return $this->addUsingAlias(CcShowPeer::DESCRIPTION, $dbDescription, $comparison);
}
/**
* Filter the query on the color column
*
* @param string $dbColor The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcShowQuery The current query, for fluid interface
*/
public function filterByDbColor($dbColor = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbColor)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbColor)) {
$dbColor = str_replace('*', '%', $dbColor);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcShowPeer::COLOR, $dbColor, $comparison);
}
/**
* Filter the query on the background_color column
*
* @param string $dbBackgroundColor The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcShowQuery The current query, for fluid interface
*/
public function filterByDbBackgroundColor($dbBackgroundColor = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbBackgroundColor)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbBackgroundColor)) {
$dbBackgroundColor = str_replace('*', '%', $dbBackgroundColor);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcShowPeer::BACKGROUND_COLOR, $dbBackgroundColor, $comparison);
}
/**
* Filter the query by a related CcShowDays object
*

View File

@ -10,6 +10,7 @@
<?php echo $this->what ?>
</div>
<div id="schedule-show-when">
<div id="show_overlap_error"/>
<?php echo $this->when ?>
<?php echo $this->repeats ?>
</div>

View File

@ -126,6 +126,8 @@
<column name="name" phpName="DbName" type="VARCHAR" size="255" required="true" defaultValue=""/>
<column name="repeats" phpName="DbRepeats" type="TINYINT" required="true"/>
<column name="description" phpName="DbDescription" type="VARCHAR" size="512" required="false"/>
<column name="color" phpName="DbColor" type="VARCHAR" size="6" required="false"/>
<column name="background_color" phpName="DbBackgroundColor" type="VARCHAR" size="6" required="false"/>
</table>
<table name="cc_show_days" phpName="CcShowDays">
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>

View File

@ -164,6 +164,8 @@ CREATE TABLE "cc_show"
"name" VARCHAR(255) default '' NOT NULL,
"repeats" INT2 NOT NULL,
"description" VARCHAR(512),
"color" VARCHAR(6),
"background_color" VARCHAR(6),
PRIMARY KEY ("id")
);

View File

@ -61,18 +61,14 @@ function submitShow() {
function(data){
if(data.content) {
dialog.find("form").remove();
dialog.find("#show_overlap_error").remove();
dialog.find("#show_overlap_error").empty();
dialog.append(data.content);
var start = dialog.find("#start_date");
var end = dialog.find("#end_date");
createDateInput(start, startDpSelect);
createDateInput(end, endDpSelect);
makeShowDialog(dialog, json);
if(data.overlap) {
var div, table, tr, days;
div = $('<div id="show_overlap_error"/>');
div = dialog.find("#show_overlap_error");
table = $('<table/>');
days = $.datepicker.regional[''].dayNamesShort;
@ -111,12 +107,7 @@ function autoSelect(event, ui) {
event.preventDefault();
}
function makeShowDialog(json) {
var dialog;
//main jqueryUI dialog
dialog = $('<div id="schedule_add_event_dialog" />');
function makeShowDialog(dialog, json) {
dialog.append(json.content);
dialog.find("#tabs").tabs();
@ -146,16 +137,6 @@ function makeShowDialog(json) {
}
});
dialog.dialog({
autoOpen: false,
title: 'Add Show',
width: 1100,
height: 500,
modal: true,
close: closeDialog,
buttons: { "Cancel": closeDialog, "Ok": submitShow}
});
return dialog;
}
@ -165,7 +146,22 @@ function openShowDialog() {
url = '/Schedule/add-show-dialog/format/json';
$.get(url, function(json){
var dialog = makeShowDialog(json);
var dialog;
//main jqueryUI dialog
dialog = $('<div id="schedule_add_event_dialog" />');
makeShowDialog(dialog, json);
dialog.dialog({
autoOpen: false,
title: 'Add Show',
width: 1100,
height: 500,
modal: true,
close: closeDialog,
buttons: { "Cancel": closeDialog, "Ok": submitShow}
});
dialog.dialog('open');
});
@ -383,12 +379,19 @@ function eventRender(event, element, view) {
$(element).find(".fc-event-title").after(div);
$(element)
.css({'border-color': 'red'})
.find(".fc-event-time, a")
.css({'background-color': 'red', 'border-color': 'red', 'color': 'white'});
}
if(event.backgroundColor !== "") {
$(element)
.css({'border-color': '#'+event.backgroundColor})
.find(".fc-event-time, a")
.css({'background-color': '#'+event.backgroundColor, 'border-color': '#'+event.backgroundColor});
}
if(event.color !== "") {
$(element)
.find(".fc-event-time, a")
.css({'color': '#'+event.color});
}
}
function eventAfterRender( event, element, view ) {