working on add show screen, using subforms and jqueryUI tabs to separate adding show decisions.

This commit is contained in:
Naomi 2011-01-20 18:30:53 -05:00
parent dc2208d9ee
commit 42e2e0d407
11 changed files with 270 additions and 9 deletions

View file

@ -58,6 +58,7 @@ class Application_Form_AddShow extends Zend_Form
'required' => false,
));
// Add days checkboxes
$this->addElement(
'multiCheckbox',
'day_check',
@ -86,12 +87,13 @@ class Application_Form_AddShow extends Zend_Form
)
));
// Add no end element
$this->addElement('checkbox', 'no_end', array(
'label' => 'no end',
'required' => false,
));
// Add end date element
// Add hosts autocomplete
$this->addElement('text', 'hosts_autocomplete', array(
'label' => 'Type a Host:',
'required' => false
@ -104,6 +106,7 @@ class Application_Form_AddShow extends Zend_Form
$options[$host['id']] = $host['login'];
}
//Add hosts selection
$hosts = new Zend_Form_Element_MultiCheckbox('hosts');
$hosts->setLabel('Hosts:')
->setMultiOptions($options)

View file

@ -0,0 +1,46 @@
<?php
class Application_Form_AddShowRepeats extends Zend_Form_SubForm
{
public function init()
{
// Add days checkboxes
$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'))
)
));
// Add no end element
$this->addElement('checkbox', 'no_end', array(
'label' => 'no end',
'required' => false,
));
}
}

View file

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

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', '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,
));
}
}

View file

@ -0,0 +1,32 @@
<?php
class Application_Form_AddShowWho extends Zend_Form_SubForm
{
public function init()
{
// Add hosts autocomplete
$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'];
}
//Add hosts selection
$hosts = new Zend_Form_Element_MultiCheckbox('hosts');
$hosts->setLabel('Hosts:')
->setMultiOptions($options)
->setRequired(true);
$this->addElement($hosts);
}
}