Merge branch 'master' of dev.sourcefabric.org:campcaster

This commit is contained in:
mkonecny 2011-01-21 18:15:13 -05:00
commit 5173674714
49 changed files with 1283 additions and 195 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

@ -34,11 +34,14 @@ class ScheduleController extends Zend_Controller_Action
$this->view->headScript()->appendFile('/js/fullcalendar/fullcalendar.min.js','text/javascript');
$this->view->headScript()->appendFile('/js/contextmenu/jquery.contextMenu.js','text/javascript');
$this->view->headScript()->appendFile('/js/qtip/jquery.qtip-1.0.0.min.js','text/javascript');
$this->view->headScript()->appendFile('/js/colorpicker/js/colorpicker.js','text/javascript');
$this->view->headScript()->appendFile('/js/airtime/schedule/schedule.js','text/javascript');
$this->view->headLink()->appendStylesheet('/css/jquery.contextMenu.css');
$this->view->headLink()->appendStylesheet('/css/fullcalendar.css');
$this->view->headLink()->appendStylesheet('/css/colorpicker/css/colorpicker.css');
$this->view->headLink()->appendStylesheet('/css/schedule.css');
@ -74,25 +77,44 @@ class ScheduleController extends Zend_Controller_Action
public function addShowDialogAction()
{
$request = $this->getRequest();
$form = new Application_Form_AddShow();
$formWhat = new Application_Form_AddShowWhat();
$formWhat->removeDecorator('DtDdWrapper');
$formWho = new Application_Form_AddShowWho();
$formWho->removeDecorator('DtDdWrapper');
$formWhen = new Application_Form_AddShowWhen();
$formWhen->removeDecorator('DtDdWrapper');
$formRepeats = new Application_Form_AddShowRepeats();
$formRepeats->removeDecorator('DtDdWrapper');
$formStyle = new Application_Form_AddShowStyle();
$formStyle->removeDecorator('DtDdWrapper');
$this->view->what = $formWhat;
$this->view->when = $formWhen;
$this->view->repeats = $formRepeats;
$this->view->who = $formWho;
$this->view->style = $formStyle;
if ($request->isPost()) {
if ($form->isValid($request->getPost())) {
$data = $request->getPost();
if ($formStyle->isValid($data) && $formWhen->isValid($data) && $formWho->isValid($data) && $formStyle->isValid($data)) {
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$show = new Show(new User($userInfo->id, $userInfo->type));
$overlap = $show->addShow($form->getValues());
$overlap = $show->addShow($data);
if(isset($overlap)) {
$this->view->overlap = $overlap;
$this->view->form = $form->__toString();
$this->view->form = $this->view->render('schedule/add-show-dialog.phtml');
}
return;
return;
}
}
$this->view->form = $form->__toString();
$this->view->content = $this->view->render('schedule/add-show-dialog.phtml');
$this->view->hosts = User::getHosts();
}

View file

@ -1,118 +0,0 @@
<?php
class Application_Form_AddShow extends Zend_Form
{
public function init()
{
// Add name element
$this->addElement('text', 'name', array(
'label' => 'Name:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array('NotEmpty')
));
// Add the description element
$this->addElement('textarea', 'description', array(
'label' => 'Description:',
'required' => false,
));
// Add start date element
$this->addElement('text', 'start_date', array(
'label' => 'Date Start:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array(
'NotEmpty',
array('date', false, array('YYYY-MM-DD'))
)
));
// Add start time element
$this->addElement('text', 'start_time', array(
'label' => 'Start Time:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array(
'NotEmpty',
array('date', false, array('HH:mm'))
)
));
// Add duration element
$this->addElement('text', 'duration', array(
'label' => 'Duration:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array(
'NotEmpty',
array('date', false, array('HH:mm'))
)
));
// Add repeats element
$this->addElement('checkbox', 'repeats', array(
'label' => 'repeats',
'required' => false,
));
$this->addElement(
'multiCheckbox',
'day_check',
array(
'label' => 'Select Days:',
'required' => false,
'multiOptions' => array(
"0" => "Sun",
"1" => "Mon",
"2" => "Tue",
"3" => "Wed",
"4" => "Thu",
"5" => "Fri",
"6" => "Sat",
),
));
// Add end date element
$this->addElement('text', 'end_date', array(
'label' => 'Date End:',
'required' => false,
'filters' => array('StringTrim'),
'validators' => array(
'NotEmpty',
array('date', false, array('YYYY-MM-DD'))
)
));
$this->addElement('checkbox', 'no_end', array(
'label' => 'no end',
'required' => false,
));
// Add end date element
$this->addElement('text', 'hosts_autocomplete', array(
'label' => 'Type a Host:',
'required' => false
));
$options = array();
$hosts = User::getHosts();
foreach ($hosts as $host) {
$options[$host['id']] = $host['login'];
}
$hosts = new Zend_Form_Element_MultiCheckbox('hosts');
$hosts->setLabel('Hosts:')
->setMultiOptions($options)
->setRequired(true);
$this->addElement($hosts);
}
}

View file

@ -0,0 +1,46 @@
<?php
class Application_Form_AddShowRepeats extends Zend_Form_SubForm
{
public function init()
{
// Add days checkboxes
$this->addElement(
'multiCheckbox',
'add_show_day_check',
array(
'label' => 'Select Days:',
'required' => false,
'multiOptions' => array(
"0" => "Sun",
"1" => "Mon",
"2" => "Tue",
"3" => "Wed",
"4" => "Thu",
"5" => "Fri",
"6" => "Sat",
),
));
// Add end date element
$this->addElement('text', 'add_show_end_date', array(
'label' => 'Date End:',
'required' => false,
'filters' => array('StringTrim'),
'validators' => array(
'NotEmpty',
array('date', false, array('YYYY-MM-DD'))
)
));
// Add no end element
$this->addElement('checkbox', 'add_show_no_end', array(
'label' => 'no end',
'required' => false,
));
}
}

View file

@ -0,0 +1,23 @@
<?php
class Application_Form_AddShowStyle extends Zend_Form_SubForm
{
public function init()
{
// Add show background-color input
$this->addElement('text', 'add_show_background_color', array(
'label' => 'Background Colour:',
'filters' => array('StringTrim')
));
// Add show color input
$this->addElement('text', 'add_show_color', array(
'label' => 'Text Colour',
'filters' => array('StringTrim')
));
}
}

View file

@ -0,0 +1,26 @@
<?php
class Application_Form_AddShowWhat extends Zend_Form_SubForm
{
public function init()
{
// Add name element
$this->addElement('text', 'add_show_name', array(
'label' => 'Name:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array('NotEmpty')
));
// Add the description element
$this->addElement('textarea', 'add_show_description', array(
'label' => 'Description:',
'required' => false,
));
}
}

View file

@ -0,0 +1,51 @@
<?php
class Application_Form_AddShowWhen extends Zend_Form_SubForm
{
public function init()
{
// Add start date element
$this->addElement('text', 'add_show_start_date', array(
'label' => 'Date Start:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array(
'NotEmpty',
array('date', false, array('YYYY-MM-DD'))
)
));
// Add start time element
$this->addElement('text', 'add_show_start_time', array(
'label' => 'Start Time:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array(
'NotEmpty',
array('date', false, array('HH:mm'))
)
));
// Add duration element
$this->addElement('text', 'add_show_duration', array(
'label' => 'Duration:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array(
'NotEmpty',
array('date', false, array('HH:mm'))
)
));
// Add repeats element
$this->addElement('checkbox', 'add_show_repeats', array(
'label' => 'repeats',
'required' => false,
));
}
}

View file

@ -0,0 +1,32 @@
<?php
class Application_Form_AddShowWho extends Zend_Form_SubForm
{
public function init()
{
// Add hosts autocomplete
$this->addElement('text', 'add_show_hosts_autocomplete', array(
'label' => 'Type a Host:',
'required' => false
));
$options = array();
$hosts = User::getHosts();
foreach ($hosts as $host) {
$options[$host['id']] = $host['login'];
}
//Add hosts selection
$hosts = new Zend_Form_Element_MultiCheckbox('add_show_hosts');
$hosts->setLabel('Hosts:')
->setMultiOptions($options)
->setRequired(true);
$this->addElement($hosts);
}
}

View file

@ -16,48 +16,50 @@ class Show {
$con = Propel::getConnection(CcShowPeer::DATABASE_NAME);
$sql = "SELECT time '{$data['start_time']}' + INTERVAL '{$data['duration']} hour' ";
$sql = "SELECT time '{$data['add_show_start_time']}' + INTERVAL '{$data['add_show_duration']} hour' ";
$r = $con->query($sql);
$endTime = $r->fetchColumn(0);
$sql = "SELECT EXTRACT(DOW FROM TIMESTAMP '{$data['start_date']} {$data['start_time']}')";
$sql = "SELECT EXTRACT(DOW FROM TIMESTAMP '{$data['add_show_start_date']} {$data['add_show_start_time']}')";
$r = $con->query($sql);
$startDow = $r->fetchColumn(0);
if($data['no_end']) {
if($data['add_show_no_end']) {
$endDate = NULL;
$data['repeats'] = 1;
$data['add_show_repeats'] = 1;
}
else if($data['repeats']) {
$sql = "SELECT date '{$data['end_date']}' + INTERVAL '1 day' ";
else if($data['add_show_repeats']) {
$sql = "SELECT date '{$data['add_show_end_date']}' + INTERVAL '1 day' ";
$r = $con->query($sql);
$endDate = $r->fetchColumn(0);
}
else {
$sql = "SELECT date '{$data['start_date']}' + INTERVAL '1 day' ";
$sql = "SELECT date '{$data['add_show_start_date']}' + INTERVAL '1 day' ";
$r = $con->query($sql);
$endDate = $r->fetchColumn(0);
}
if($data['day_check'] === null) {
$data['day_check'] = array($startDow);
if(!isset($data['add_show_day_check'])) {
$data['add_show_day_check'] = array($startDow);
}
$overlap = $this->getShows($data['start_date'], $endDate, $data['day_check'], $data['start_time'], $endTime);
$overlap = $this->getShows($data['add_show_start_date'], $endDate, $data['add_show_day_check'], $data['add_show_start_time'], $endTime);
if(count($overlap) > 0) {
return $overlap;
}
$show = new CcShow();
$show->setDbName($data['name']);
$show->setDbRepeats($data['repeats']);
$show->setDbDescription($data['description']);
$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();
foreach ($data['day_check'] as $day) {
foreach ($data['add_show_day_check'] as $day) {
if($startDow !== $day){
@ -66,25 +68,25 @@ class Show {
else
$daysAdd = $day - $startDow;
$sql = "SELECT date '{$data['start_date']}' + INTERVAL '{$daysAdd} day' ";
$sql = "SELECT date '{$data['add_show_start_date']}' + INTERVAL '{$daysAdd} day' ";
$r = $con->query($sql);
$start = $r->fetchColumn(0);
}
else {
$start = $data['start_date'];
$start = $data['add_show_start_date'];
}
$showDay = new CcShowDays();
$showDay->setDbFirstShow($start);
$showDay->setDbLastShow($endDate);
$showDay->setDbStartTime($data['start_time']);
$showDay->setDbStartTime($data['add_show_start_time']);
$showDay->setDbEndTime($endTime);
$showDay->setDbDay($day);
$showDay->setDbShowId($showId);
$showDay->save();
}
foreach ($data['hosts'] as $host) {
foreach ($data['add_show_hosts'] as $host) {
$showHost = new CcShowHosts();
$showHost->setDbShow($showId);
$showHost->setDbHost($host);
@ -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

@ -1 +1,24 @@
<br /><br /><center>View script for controller <b>Schedule</b> and script/action name <b>addShowDialog</b></center>
<form>
<div id="tabs">
<ul>
<li><a href="#schedule-show-what"><span>What</span></a></li>
<li><a href="#schedule-show-when"><span>When</span></a></li>
<li><a href="#schedule-show-who"><span>Who</span></a></li>
<li><a href="#schedule-show-style"><span>Style</span></a></li>
</ul>
<div id="schedule-show-what">
<?php echo $this->what ?>
</div>
<div id="schedule-show-when">
<div id="show_overlap_error"/>
<?php echo $this->when ?>
<?php echo $this->repeats ?>
</div>
<div id="schedule-show-who">
<?php echo $this->who ?>
</div>
<div id="schedule-show-style">
<?php echo $this->style ?>
</div>
</div>
</form>