add show form is broken up into tabs.

This commit is contained in:
Naomi 2011-01-21 13:25:12 -05:00
parent 42e2e0d407
commit c83244fb3a
8 changed files with 38 additions and 159 deletions

View file

@ -1,121 +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,
));
// 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,
));
// 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);
}
}

View file

@ -8,7 +8,7 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
// Add days checkboxes
$this->addElement(
'multiCheckbox',
'day_check',
'add_show_day_check',
array(
'label' => 'Select Days:',
'required' => false,
@ -24,7 +24,7 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
));
// Add end date element
$this->addElement('text', 'end_date', array(
$this->addElement('text', 'add_show_end_date', array(
'label' => 'Date End:',
'required' => false,
'filters' => array('StringTrim'),
@ -35,7 +35,7 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
));
// Add no end element
$this->addElement('checkbox', 'no_end', array(
$this->addElement('checkbox', 'add_show_no_end', array(
'label' => 'no end',
'required' => false,
));

View file

@ -6,7 +6,7 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
public function init()
{
// Add show background-color input
$this->addElement('text', 'show-background-color', array(
$this->addElement('text', 'add_show_background_color', array(
'label' => 'Background Colour:',
'required' => true,
'filters' => array('StringTrim'),
@ -14,7 +14,7 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
));
// Add show color input
$this->addElement('text', 'show-color', array(
$this->addElement('text', 'add_show_color', array(
'label' => 'Text Colour',
'required' => true,
'filters' => array('StringTrim'),

View file

@ -6,7 +6,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
public function init()
{
// Add start date element
$this->addElement('text', 'start_date', array(
$this->addElement('text', 'add_show_start_date', array(
'label' => 'Date Start:',
'required' => true,
'filters' => array('StringTrim'),
@ -17,7 +17,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
));
// Add start time element
$this->addElement('text', 'start_time', array(
$this->addElement('text', 'add_show_start_time', array(
'label' => 'Start Time:',
'required' => true,
'filters' => array('StringTrim'),
@ -28,7 +28,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
));
// Add duration element
$this->addElement('text', 'duration', array(
$this->addElement('text', 'add_show_duration', array(
'label' => 'Duration:',
'required' => true,
'filters' => array('StringTrim'),
@ -39,7 +39,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
));
// Add repeats element
$this->addElement('checkbox', 'repeats', array(
$this->addElement('checkbox', 'add_show_repeats', array(
'label' => 'repeats',
'required' => false,
));

View file

@ -6,7 +6,7 @@ class Application_Form_AddShowWho extends Zend_Form_SubForm
public function init()
{
// Add hosts autocomplete
$this->addElement('text', 'hosts_autocomplete', array(
$this->addElement('text', 'add_show_hosts_autocomplete', array(
'label' => 'Type a Host:',
'required' => false
));
@ -19,7 +19,7 @@ class Application_Form_AddShowWho extends Zend_Form_SubForm
}
//Add hosts selection
$hosts = new Zend_Form_Element_MultiCheckbox('hosts');
$hosts = new Zend_Form_Element_MultiCheckbox('add_show_hosts');
$hosts->setLabel('Hosts:')
->setMultiOptions($options)
->setRequired(true);