/**
  * 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 $id the ID of the model to be loaded
  * @return ProjectStatus the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = ProjectStatus::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemplo n.º 2
0
<?php

/* @var $this ZakazController */
/* @var $model Zakaz */
$filelist = Yii::app()->fileman->list_files($model->id);
foreach ($filelist as $fd) {
    $real_path = Yii::app()->fileman->get_file_path($fd['id'], $fd['file_id']);
    $files .= CHtml::link($fd['filename'], array('zakaz/download', 'path' => $real_path)) . '&nbsp;&nbsp;';
    //echo EDownloadHelper::download($real_path);
}
$this->breadcrumbs = array(ProjectModule::t('Zakazs') => array('index'), $model->title);
?>

<h1><?php 
echo ProjectModule::t('View Zakaz');
?>
 #<?php 
echo $model->id;
?>
</h1>
<?php 
if (User::model()->isManager() || User::model()->isAdmin()) {
    $attr = array('id', array('name' => 'user_id', 'type' => 'raw', 'value' => User::model()->findByPk($model->user_id)->username), array('name' => 'category_id', 'type' => 'raw', 'value' => Categories::model()->findByPk($model->category_id)->cat_name), array('name' => 'job_id', 'type' => 'raw', 'value' => Jobs::model()->findByPk($model->job_id)->job_name), 'title', 'text', 'date', 'max_exec_date', 'date_finish', 'pages', 'add_demands', array('name' => 'status', 'type' => 'raw', 'value' => $model->status > 0 ? ProjectStatus::model()->findByPk($model->status)->status : null), 'is_payed', 'informed', 'notes');
} else {
    $attr = array('id', array('name' => 'user_id', 'type' => 'raw', 'value' => User::model()->findByPk($model->user_id)->username), array('name' => 'category_id', 'type' => 'raw', 'value' => Categories::model()->findByPk($model->category_id)->cat_name), array('name' => 'job_id', 'type' => 'raw', 'value' => $model->job_id > 0 ? Jobs::model()->findByPk($model->job_id)->job_name : null), 'title', 'text', 'date', 'max_exec_date', 'pages', 'add_demands', array('name' => 'status', 'type' => 'raw', 'value' => $model->status > 0 ? ProjectStatus::model()->findByPk($model->status)->status : null));
}
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => $attr));
$this->widget('application.modules.project.widgets.zakazParts.ZakazPartWidget', array('projectId' => $model->id, 'userType' => '1', 'action' => 'show'));
Exemplo n.º 3
0
  $files .= CHtml::link($fd['filename'], array('zakaz/download', 'path' => $real_path)).'&nbsp;&nbsp;';
  //echo EDownloadHelper::download($real_path);
}
*/
$this->breadcrumbs = array(ProjectModule::t('Zakazs') => array('index'), $model->title);
?>

<h1><?php 
echo ProjectModule::t('View Zakaz');
?>
 #<?php 
echo $model->id;
?>
</h1>
<?php 
$attr = array('id', array('name' => 'user_id', 'type' => 'raw', 'value' => User::model()->findByPk($model->user_id)->username), 'title', 'max_exec_date', array('name' => 'status', 'type' => 'raw', 'value' => $model->status > 0 ? ProjectStatus::model()->findByPk($model->status)->status : null), 'notes');
//$this->widget('zii.widgets.CDetailView', array(
//	'data'=>$model,
//	'attributes'=>$attr,
//));
/*	
echo '<pre>';
print_r($projectFields);
echo '</pre>';
*/
$projectFields = $model->getFields();
if ($projectFields) {
    /*$form = $this->beginWidget('CActiveForm', array(
    			'id'=>'zakaz-form',
    			'action'=>isset ($model->id) ? $this->createUrl('zakaz/update', ['id'=>$model->id]) : '',
    			'enableAjaxValidation'=>false,
Exemplo n.º 4
0
						<?php 
$this->widget('ext.juidatetimepicker.EJuiDateTimePicker', array('model' => $model, 'attribute' => 'dbauthor_informed'));
?>
					</td>
				</tr>
			</table>
		</div>
		
		<div class="form-item" style="padding-left: 0; padding-right: 0;">
			<?php 
echo $form->errorSummary($model);
?>
			<div class="col-md-12">
				<?php 
echo $form->labelEx($model, 'status');
$models = ProjectStatus::model()->findAll();
$list = CHtml::listData($models, 'id', 'status');
echo $form->dropDownList($model, 'status', $list);
?>
				<?php 
echo $form->error($model, 'status');
?>
			</div>
			<div class="col-md-12">
				<?php 
echo $form->labelEx($model, 'user_id');
$list = CHtml::listData(User::model()->findAllCustomers(), 'id', 'email');
echo $form->dropDownList($model, 'user_id', $list, array('empty' => ProjectModule::t('Select a customer')));
?>
				<?php 
echo $form->error($model, 'user_id');
Exemplo n.º 5
0
    <div class="row">
       <!-- Left column -->

        <div class="col-xs-4 left-column">
            <div class="row zero-edge">
				<div class="col-xs-12 statusBlock">
                   <!--<span class="label label-warning"><b><?php 
//echo $message;
?>
</b></span>-->
				   <span class="block-title"><?php 
echo $form->labelEx($model, 'status');
?>
:&nbsp;</span>
				   <?php 
echo CHtml::dropDownList('Zakaz_status', $model->status, CHtml::listData(ProjectStatus::model()->findAll(), 'id', 'status'), array('ajax' => array('url' => $this->createUrl('/project/zakaz/update'), 'data' => 'js:"id=' . $model->id . '&sid="+this.value', 'cache' => false)));
?>

					<?php 
echo Tools::hint($hints['Zakaz_status'], 'hint-block __status');
?>
					<!--<button class="btn btn-primary btn-spam" onclick="spam(<?php 
echo $model->id;
?>
);" href=""><?php 
echo ProjectModule::t('Search author');
?>
</button>-->
					<br><span class="last-delivery"><?php 
echo ProjectModule::t('Last delivery') . ': ' . $model->last_spam;
?>