Example #1
0
 public static function getEnumListForKey($key)
 {
     $list = array('apartment_periodActivityDefault' => Apartment::getPeriodActivityList(), 'mode_list_show' => Apartment::getModeShowList());
     return isset($list[$key]) ? $list[$key] : array();
 }
Example #2
0
<?php 
}
?>

<?php 
if ($model->type == Apartment::TYPE_CHANGE) {
    echo '<div class="clear">&nbsp;</div>';
    $this->widget('application.modules.lang.components.langFieldWidget', array('model' => $model, 'field' => 'exchange_to', 'type' => 'text'));
}
if (issetModule('formeditor')) {
    Yii::import('application.modules.formeditor.models.HFormEditor');
    $rows = HFormEditor::getGeneralFields();
    HFormEditor::renderFormRows($rows, $model);
}
$canSet = $model->canSetPeriodActivity() ? 1 : 0;
echo '<div class="rowold" id="set_period" ' . (!$canSet ? 'style="display: none;"' : '') . '>';
echo $form->labelEx($model, 'period_activity');
echo $form->dropDownList($model, 'period_activity', Apartment::getPeriodActivityList());
echo CHtml::hiddenField('set_period_activity', $canSet);
echo $form->error($model, 'period_activity');
echo '</div>';
if (!$canSet) {
    echo '<div id="date_end_activity"><b>' . Yii::t('common', 'The listing will be active till {DATE}', array('{DATE}' => $model->getDateEndActivityLongFormat())) . '</b>';
    echo '&nbsp;' . CHtml::link(tc('Change'), 'javascript:;', array('onclick' => '$("#date_end_activity").hide(); $("#set_period_activity").val(1); $("#set_period").show();'));
    echo '</div>';
}
?>

</div>
<?php 
Yii::app()->clientScript->registerScript('old price script', "\n    \$('#edit_old_price').on('click',function(){\n    \$(this).hide();\n    \$('#old_price_value').hide()\n    \$('#Apartment_price_old_new').show();\n    return false;\n    });\n");