Ejemplo n.º 1
0
//begin.Messages
?>
	<div id="ajax-message">
		<?php 
echo $form->errorSummary($model);
?>
	</div>
	<?php 
//begin.Messages
?>

	<fieldset>

		<?php 
if ($model->cat_TO->publish != 2) {
    $category = SupportContactCategory::getCategory(1);
    if ($category != null) {
        ?>
			<div class="clearfix">
				<label><?php 
        echo $model->getAttributeLabel('cat_id');
        ?>
 <span class="required">*</span></label>
				<div class="desc">
					<?php 
        echo $form->dropDownList($model, 'cat_id', $category, array('prompt' => ''));
        ?>
					<?php 
        echo $form->error($model, 'cat_id');
        ?>
				</div>
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = SupportContactCategory::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, Yii::t('phrase', 'The requested page does not exist.'));
     }
     return $model;
 }
 /**
  * Set default columns to display
  */
 protected function afterConstruct()
 {
     if (count($this->defaultColumns) == 0) {
         /*
         $this->defaultColumns[] = array(
         	'class' => 'CCheckBoxColumn',
         	'name' => 'id',
         	'selectableRows' => 2,
         	'checkBoxHtmlOptions' => array('name' => 'trash_id[]')
         );
         */
         $this->defaultColumns[] = array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1');
         if (!isset($_GET['category'])) {
             $this->defaultColumns[] = array('name' => 'cat_id', 'value' => 'Phrase::trans($data->cat_TO->name, 2)', 'filter' => SupportContactCategory::getCategory(1), 'type' => 'raw');
         }
         $this->defaultColumns[] = array('name' => 'widget_source', 'value' => '$data->widget_source', 'type' => 'raw');
         $this->defaultColumns[] = array('name' => 'creation_search', 'value' => '$data->creation_TO->displayname');
         $this->defaultColumns[] = array('name' => 'creation_date', 'value' => 'Utility::dateFormat($data->creation_date)', 'htmlOptions' => array('class' => 'center'), 'filter' => Yii::app()->controller->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $this, 'attribute' => 'creation_date', 'language' => 'ja', 'i18nScriptFile' => 'jquery.ui.datepicker-en.js', 'htmlOptions' => array('id' => 'creation_date_filter'), 'options' => array('showOn' => 'focus', 'dateFormat' => 'dd-mm-yy', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true));
         if (!isset($_GET['type'])) {
             $this->defaultColumns[] = array('name' => 'publish', 'value' => 'Utility::getPublish(Yii::app()->controller->createUrl("publish",array("id"=>$data->widget_id)), $data->publish, 1)', 'htmlOptions' => array('class' => 'center'), 'filter' => array(1 => Yii::t('phrase', 'Yes'), 0 => Yii::t('phrase', 'No')), 'type' => 'raw');
         }
     }
     parent::afterConstruct();
 }
Ejemplo n.º 4
0
<div class="dialog-content">

	<fieldset>

		<?php 
if ($model->cat->publish != '2') {
    if (SupportContactCategory::getCategory(1) != null) {
        ?>
		<div class="clearfix">
			<label><?php 
        echo $model->getAttributeLabel('cat_id');
        ?>
 <span class="required">*</span></label>
			<div class="desc">
			<?php 
        echo $form->dropDownList($model, 'cat_id', SupportContactCategory::getCategory(1));
        ?>
				<?php 
        echo $form->error($model, 'cat_id');
        ?>
			</div>
		</div>
		<?php 
    }
}
?>

		<div class="clearfix">
			<?php 
if ($model->cat->publish != '2') {
    ?>