protected function getIdForHiddenSelectLinkField()
 {
     return ZurmoHtml::getIdByName($this->getNameForHiddenSelectLinkField());
 }
Ejemplo n.º 2
0
 /**
  * An input Id is typically formed like: modelClassName_attributeName or
  * modelClassName_attributeName_relationAttributeName.  This method resolves the input Id string.
  * @param string $attributeName
  * @param string $relationAttributeName
  * @return string representing the content of the input id.
  */
 protected function getEditableInputId($attributeName = null, $relationAttributeName = null)
 {
     assert('$attributeName == null || is_string($attributeName)');
     assert('$relationAttributeName == null || is_string($relationAttributeName)');
     if ($attributeName == null) {
         $attributeName = $this->attribute;
     }
     $inputPrefix = $this->resolveInputIdPrefix();
     $id = $inputPrefix . '_' . $attributeName;
     if ($relationAttributeName != null) {
         $id .= '_' . $relationAttributeName;
     }
     return ZurmoHtml::getIdByName($id);
 }
 protected function renderAttributeNameSelectionContent(DropDownDependencyCustomFieldMapping $mapping)
 {
     $inputName = $this->formName . '[mappingData][' . $mapping->getPosition() . '][attributeName]';
     $inputId = ZurmoHtml::getIdByName($inputName);
     $htmlOptions = array();
     $htmlOptions['id'] = $inputId;
     if ($mapping->allowsAttributeSelection()) {
         $htmlOptions['empty'] = Zurmo::t('Core', '(None)');
         $data = $mapping->getAvailableCustomFieldAttributes();
     } else {
         $htmlOptions['empty'] = $mapping->getSelectHigherLevelFirstMessage();
         $data = array();
     }
     Yii::app()->clientScript->registerScript('DropDownDependency' . $inputId, $this->renderAttributeDropDownOnChangeScript($inputId));
     $content = ZurmoHtml::dropDownList($inputName, $mapping->getAttributeName(), $data, $htmlOptions);
     return $content;
 }