Beispiel #1
0
 /**
  * выбрать шаблон для подстановки
  * @param <type> $act_tmpl
  * @return <type>
  */
 public function get_act_tmpl($act_tmpl)
 {
     return ActsTmpl::model()->findByPk($act_tmpl);
 }
Beispiel #2
0
	$form = $this->beginWidget('CActiveForm', array(
		'id' => 'acts-form',
		'enableAjaxValidation' => false,
//		'action'=>array('acts/changeBody'),
			));
	?>

	<p class="note">Поля с <span class="required">*</span> необходимы</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="span-12">

		<div class="row">
			<?php echo $form->labelEx($model, 'template_id'); ?>
			<?php echo $form->dropDownList($model, 'template_id', CHtml::listData(ActsTmpl::model()->findAll(), 'id', 'name')); ?>
		</div>

		<div class="row">
			<?php echo $form->labelEx($model, 'date'); ?>
			<?php
			$this->widget('zii.widgets.jui.CJuiDatePicker', array(
				'attribute' => 'date',
				'model' => $model,
				'value' => $model->date,
				'language' => 'ru',
				// additional javascript options for the date picker plugin
				'options' => array(
					'showAnim' => 'fold', 'changeYear' => true, 'changeMonth' => true, 'dateFormat' => 'yy-mm-dd',
				),
			));
Beispiel #3
0
 /**
  * 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 = ActsTmpl::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }