working on add show screen, using subforms and jqueryUI tabs to separate adding show decisions.
This commit is contained in:
parent
dc2208d9ee
commit
42e2e0d407
11 changed files with 270 additions and 9 deletions
|
@ -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)
|
||||
|
|
46
application/forms/AddShowRepeats.php
Normal file
46
application/forms/AddShowRepeats.php
Normal 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,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
27
application/forms/AddShowStyle.php
Normal file
27
application/forms/AddShowStyle.php
Normal 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')
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
26
application/forms/AddShowWhat.php
Normal file
26
application/forms/AddShowWhat.php
Normal 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,
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
51
application/forms/AddShowWhen.php
Normal file
51
application/forms/AddShowWhen.php
Normal 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,
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
32
application/forms/AddShowWho.php
Normal file
32
application/forms/AddShowWho.php
Normal 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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue