/** * @return string */ protected function renderContent() { $sqlContent = ZurmoHtml::Tag('h3', array(), Zurmo::t('ReportsModule', 'Count Query')); $sqlContent .= $this->dataProvider->makeTotalCountSqlQueryForDisplay(); $content = ZurmoHtml::tag('div', array(), $sqlContent); $sqlContent = ZurmoHtml::Tag('h3', array(), Zurmo::t('ReportsModule', 'Grid Query')); $sqlContent .= $this->dataProvider->makeSqlQueryForDisplay(); $content .= ZurmoHtml::tag('div', array(), $sqlContent); return $content; }
/** * @return The element's content as a string. */ protected function renderControlEditable() { $firstValueSpanAreaId = $this->getFirstValueEditableInputId() . '-first-value-area'; $secondValueSpanAreaId = $this->getSecondValueEditableInputId() . '-second-value-area'; $startingDivStyleFirstValue = null; $startingDivStyleSecondValue = null; if (in_array($this->getOperator(), array(OperatorRules::TYPE_IS_NULL, OperatorRules::TYPE_IS_NOT_NULL, OperatorRules::TYPE_CHANGES, OperatorRules::TYPE_DOES_NOT_CHANGE, OperatorRules::TYPE_IS_EMPTY, OperatorRules::TYPE_IS_NOT_EMPTY))) { $startingDivStyleFirstValue = "display:none;"; } if ($this->getOperator() != OperatorRules::TYPE_BETWEEN) { $startingDivStyleSecondValue = "display:none;"; } $content = ZurmoHtml::tag('div', array('id' => $firstValueSpanAreaId, 'class' => 'first-value-area', 'style' => $startingDivStyleFirstValue), $this->renderEditableFirstValueContent()); $content .= ZurmoHtml::tag('div', array('id' => $secondValueSpanAreaId, 'class' => 'second-value-area', 'style' => $startingDivStyleSecondValue), ZurmoHtml::Tag('span', array('class' => 'dynamic-and-for-mixed'), Zurmo::t('Core', 'and')) . $this->renderEditableSecondValueContent()); return $content; }
/** * Render a date JUI widget * @return The element's content as a string. */ protected function renderControlEditable() { $valueTypeId = $this->getValueTypeEditableInputId(); $firstDateSpanAreaSuffix = '-first-date-area'; $secondDateSpanAreaSuffix = '-second-date-area'; $firstDateSpanAreaId = $valueTypeId . $firstDateSpanAreaSuffix; $secondDateSpanAreaId = $valueTypeId . $secondDateSpanAreaSuffix; $valueTypesRequiringFirstDateInput = MixedDateTypesSearchFormAttributeMappingRules::getValueTypesRequiringFirstDateInput(); $valueTypesRequiringSecondDateInput = MixedDateTypesSearchFormAttributeMappingRules::getValueTypesRequiringSecondDateInput(); Yii::app()->clientScript->registerScript('mixedDateTypes', "\n \$('.dateValueType').change( function()\n {\n arr = " . CJSON::encode($valueTypesRequiringFirstDateInput) . ";\n arr2 = " . CJSON::encode($valueTypesRequiringSecondDateInput) . ";\n firstDateSpanAreaQualifier = '#' + \$(this).attr('id') + '" . $firstDateSpanAreaSuffix . "';\n secondDateSpanAreaQualifier = '#' + \$(this).attr('id') + '" . $secondDateSpanAreaSuffix . "';\n if (\$.inArray(\$(this).val(), arr) != -1)\n {\n \$(firstDateSpanAreaQualifier).show();\n \$(firstDateSpanAreaQualifier).find('.hasDatepicker').prop('disabled', false);\n }\n else\n {\n \$(firstDateSpanAreaQualifier).hide();\n \$(firstDateSpanAreaQualifier).find('.hasDatepicker').prop('disabled', true);\n }\n if (\$.inArray(\$(this).val(), arr2) != -1)\n {\n \$(secondDateSpanAreaQualifier).show();\n \$(secondDateSpanAreaQualifier).find('.hasDatepicker').prop('disabled', false);\n }\n else\n {\n \$(secondDateSpanAreaQualifier).hide();\n \$(secondDateSpanAreaQualifier).find('.hasDatepicker').prop('disabled', true);\n }\n }\n );\n "); $startingDivStyleFirstDate = null; $startingDivStyleSecondDate = null; if (!in_array($this->getValueType(), $valueTypesRequiringFirstDateInput)) { $startingDivStyleFirstDate = "display:none;"; $firstDateDisabled = 'disabled'; } else { $firstDateDisabled = null; } if (!in_array($this->getValueType(), $valueTypesRequiringSecondDateInput)) { $startingDivStyleSecondDate = "display:none;"; $secondDateDisabled = 'disabled'; } else { $secondDateDisabled = null; } $content = ZurmoHtml::tag('span', array('id' => $firstDateSpanAreaId, 'class' => 'first-date-area', 'style' => $startingDivStyleFirstDate), $this->renderEditableFirstDateContent($firstDateDisabled)); $content .= ZurmoHtml::tag('span', array('id' => $secondDateSpanAreaId, 'class' => 'second-date-area', 'style' => $startingDivStyleSecondDate), ZurmoHtml::Tag('span', array('class' => 'dynamic-and-for-mixed'), Zurmo::t('Core', 'and')) . $this->renderEditableSecondDateContent($secondDateDisabled)); return $content; }