/**
  * @return string
  */
 protected function renderTimeTriggerContentAndWrapper()
 {
     if ($this->model->timeTriggerAttribute != null) {
         $componentType = TimeTriggerForWorkflowForm::getType();
         $inputPrefixData = array(get_class($this->model), $componentType);
         $adapter = new WorkflowAttributeToElementAdapter($inputPrefixData, $this->model->timeTrigger, $this->form, $componentType);
         $view = new AttributeRowForWorkflowComponentView($adapter, 1, $inputPrefixData, $this->model->timeTriggerAttribute, false, true, $componentType);
         $timeTriggerContent = ZurmoHtml::tag('div', array('class' => 'dynamic-rows'), ZurmoHtml::tag('ul', array(), $view->render()));
         $htmlOptions = array('id' => 'time-trigger-container');
     } else {
         $timeTriggerContent = ZurmoHtml::tag('div', array('class' => 'dynamic-rows'), ZurmoHtml::tag('ul', array(), ''));
         $htmlOptions = array('id' => 'time-trigger-container', 'style' => 'display:none');
     }
     return ZurmoHtml::tag('div', $htmlOptions, $timeTriggerContent);
 }
 public function actionAddOrChangeTimeTriggerAttribute($type, $attributeIndexOrDerivedType, $moduleClassName, $id = null, $isBeingCopied = false)
 {
     $componentType = TimeTriggerForWorkflowForm::getType();
     $postData = PostUtil::getData();
     //Special situation since this is coming form GET
     $postData['ByTimeWorkflowWizardForm']['moduleClassName'] = $moduleClassName;
     $savedWorkflow = null;
     $workflow = null;
     $this->resolveSavedWorkflowAndWorkflowByPostData($postData, $savedWorkflow, $workflow, $type, $id, (bool) $isBeingCopied);
     $moduleClassName = $workflow->getModuleClassName();
     $modelClassName = $moduleClassName::getPrimaryModelName();
     $form = new WizardActiveForm();
     $form->enableAjaxValidation = true;
     //ensures error validation populates correctly
     $form->id = WorkflowWizardView::getFormId();
     $wizardFormClassName = WorkflowToWizardFormAdapter::getFormClassNameByType($workflow->getType());
     $model = ComponentForWorkflowFormFactory::makeByComponentType($moduleClassName, $modelClassName, $workflow->getType(), $componentType);
     $form->modelClassNameForError = $wizardFormClassName;
     $model->attributeIndexOrDerivedType = $attributeIndexOrDerivedType;
     $inputPrefixData = array($wizardFormClassName, $componentType);
     $adapter = new WorkflowAttributeToElementAdapter($inputPrefixData, $model, $form, $componentType);
     $view = new AttributeRowForWorkflowComponentView($adapter, 1, $inputPrefixData, $attributeIndexOrDerivedType, false, true, $componentType);
     $content = $view->render();
     $form->renderAddAttributeErrorSettingsScript($view::getFormId());
     Yii::app()->getClientScript()->setToAjaxMode();
     Yii::app()->getClientScript()->render($content);
     echo $content;
 }