diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index 65079a21d..df8d21e6e 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -5,6 +5,10 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm public function init() { + $this->setDecorators(array( + array('ViewScript', array('viewScript' => 'form/add-show-when.phtml')) + )); + // Add start date element $startDate = new Zend_Form_Element_Text('add_show_start_date'); $startDate->class = 'input_text'; @@ -15,11 +19,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm ->setValidators(array( 'NotEmpty', array('date', false, array('YYYY-MM-DD')))) - ->setDecorators(array( - array(array('open'=>'HtmlTag'), array('tag' => 'dd', 'openOnly'=>true)), - 'ViewHelper', - 'Description', - array('Label', array('tag' =>'dt')))); + ->setDecorators(array('ViewHelper')); $startDate->setAttrib('alt', 'date'); $this->addElement($startDate); @@ -33,10 +33,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm 'NotEmpty', array('date', false, array('HH:mm')), array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered')))) - ->setDecorators(array( - 'ViewHelper', - 'Errors', - array(array('close'=>'HtmlTag'), array('tag' => 'dd', 'closeOnly'=>true)))); + ->setDecorators(array('ViewHelper')); $startTime->setAttrib('alt', 'time'); $this->addElement($startTime); @@ -50,11 +47,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm ->setValidators(array( 'NotEmpty', array('date', false, array('YYYY-MM-DD')))) - ->setDecorators(array( - array(array('open'=>'HtmlTag'), array('tag' => 'dd', 'openOnly'=>true)), - 'ViewHelper', - 'Description', - array('Label', array('tag' =>'dt')))); + ->setDecorators(array('ViewHelper')); $endDate->setAttrib('alt', 'date'); $this->addElement($endDate); @@ -68,10 +61,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm 'NotEmpty', array('date', false, array('HH:mm')), array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered')))) - ->setDecorators(array( - 'ViewHelper', - 'Errors', - array(array('close'=>'HtmlTag'), array('tag' => 'dd', 'closeOnly'=>true)))); + ->setDecorators(array('ViewHelper')); $endTime->setAttrib('alt', 'time'); $this->addElement($endTime); @@ -80,20 +70,22 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm 'label' => 'Duration:', 'class' => 'input_text', 'value' => '01h00m', - 'readonly' => true + 'readonly' => true, + 'decorators' => array('ViewHelper') )); // Add repeats element $this->addElement('checkbox', 'add_show_repeats', array( 'label' => 'Repeats?', 'required' => false, + 'decorators' => array('ViewHelper') )); } public function checkReliantFields($formData, $startDateModified) { $valid = true; - + $start_time = $formData['add_show_start_date']." ".$formData['add_show_start_time']; //DateTime stores $start_time in the current timezone diff --git a/airtime_mvc/application/views/scripts/form/add-show-when.phtml b/airtime_mvc/application/views/scripts/form/add-show-when.phtml new file mode 100644 index 000000000..6f3591ac6 --- /dev/null +++ b/airtime_mvc/application/views/scripts/form/add-show-when.phtml @@ -0,0 +1,65 @@ +
+
+
+ +
+
+ element->getElement('add_show_start_date') ?> + element->getElement('add_show_start_time') ?> +
+ element->getElement('add_show_start_date')->hasErrors() || $this->element->getElement('add_show_start_time')->hasErrors()){ ?> + + +
+ +
+ +
+ element->getElement('add_show_end_date_no_repeat') ?> + element->getElement('add_show_end_time') ?> +
+ element->getElement('add_show_end_date_no_repeat')->hasErrors() || $this->element->getElement('add_show_end_time')->hasErrors()){ ?> + + +
+ +
+
+ element->getElement('add_show_duration') ?> +
+ element->getElement('add_show_duration')->hasErrors()){ ?> + + +
+ element->getElement('add_show_repeats')->getLabel() ?> +
+
+ element->getElement('add_show_repeats') ?> +
+
+
+