public function actionEdit($id = false)
 {
     if ($id) {
         $model = Company::model()->findByPk($id);
     } else {
         $model = Company::getCompany();
     }
     if (isset($_POST['ajax']) && $_POST['ajax'] === 'company-form') {
         echo UActiveForm::validate(array($model));
         Yii::app()->end();
     }
     if (isset($_POST['Company'])) {
         $model->attributes = $_POST['Company'];
         $model->fileupload = CUploadedFile::getInstance($model, 'fileupload');
         $model->iconupload = CUploadedFile::getInstance($model, 'iconupload');
         if ($model->validate()) {
             $model->save();
             Yii::app()->user->setFlash('companySuccessMessage', ProjectModule::t('Successfully updated'));
             //$this->redirect(array('/user/profile'));
         } else {
             Yii::app()->user->setFlash('companyErrorMessage', ProjectModule::t('Something wrong'));
         }
     }
     //Yii::app()->theme = 'admin';
     $this->render('edit', array('model' => $model, 'root' => User::model()->getUserRole() == 'root'));
 }
 /**
  * Updates a particular model.
  * If update is successful, the browser will be redirected to the 'view' page.
  */
 public function actionEdit()
 {
     $model = $this->loadUser();
     if ($model->profile == null) {
         $model->profile = new Profile();
         $model->profile->user_id = $model->id;
     }
     $profile = $model->profile;
     // ajax validator
     if (isset($_POST['ajax']) && $_POST['ajax'] === 'profile-form') {
         echo UActiveForm::validate(array($model, $profile));
         Yii::app()->end();
     }
     if (isset($_POST['User'])) {
         $model->attributes = $_POST['User'];
         $profile->attributes = $_POST['Profile'];
         $profile->notification = $_POST['Profile']['notification'];
         if ($model->validate() && $profile->validate()) {
             //Yii::app()->user->updateSession();
             $model->save();
             $profile->save();
             Yii::app()->user->setFlash('profileMessage', ProjectModule::t('Update profile'));
             //$this->redirect(array('/user/profile'));
         } else {
             $profile->validate();
         }
     }
     $this->render('edit', array('model' => $model, 'profile' => $profile));
 }
    public function get_specials($specials = '')
    {
        $model = Catalog::model()->findAllByAttributes(array('field_varname' => 'specials'));
        $list = CHtml::listData($model, 'id', 'cat_name');
        $arr = explode(',', $specials);
        $sizenumber = count($list);
        $select = '
			<select class="select-specilization" name="Profile[specials]" id="Profile[specials]" multiple size="' . $sizenumber . '">
			<option value="" disabled>' . ProjectModule::t('UseCtrlForMultiselect') . '</option>
			<optgroup label="' . ProjectModule::t('All') . '">' . ProjectModule::t('All') . '</optgroup>
		';
        foreach ($list as $key => $opt) {
            $select .= '<option value="' . $key . '"';
            if (in_array($key, $arr)) {
                $select .= ' selected="selected"';
            }
            $select .= '>' . Yii::t('project', $opt) . '</option>';
        }
        $select .= '</select>';
        return $select;
    }
 public function actionIndex()
 {
     $recipients = $_POST['recipients'];
     $title = $_POST['title'];
     $message = $_POST['message'];
     $profile_url = 'http://' . $_SERVER['SERVER_NAME'] . '/user/profile/edit';
     $message_ps = '<br><br>' . ProjectModule::t('You can unsubscribe...') . ':';
     $message_ps .= '<br><a href="' . $profile_url . '">' . $profile_url . '</a>';
     if ($recipients && $message && $title) {
         if ($recipients == 'executors') {
             $role = 'Author';
         } elseif ($recipients == 'customers') {
             $role = 'Customer';
         }
         //$users = User::model()->findAllCustomers();
         $users = User::model()->resetScope()->Role($role)->with(array('profile' => array('select' => array('profile.general_mailing'))))->findAll();
         foreach ($users as $user) {
             if (!$user->profile || $user->profile->general_mailing == 1) {
                 $email = new Emails();
                 $email->to = $user->email;
                 $email->subject = $title;
                 $email->body = $message . $message_ps;
                 $email->type = 0;
                 $email->dt = time();
                 $email->save();
                 //print_r( $user );
                 //echo $email->body;
                 //echo '<br>';
             }
         }
         //print_r($users);
         $title = '';
         $message = '';
         $recipients = null;
         $result = ProjectModule::t('Your message is sending...');
     } else {
         $result = ProjectModule::t('Something wrong...');
     }
     $this->render('index', array('title' => $title, 'message' => $message, 'recipients' => $recipients, 'result' => $result));
 }
 public function run()
 {
     /*$this->widget('zii.widgets.CListView', array(
           'dataProvider' => $this->arrDataProvider,
           'itemView'=>'newview',
           'summaryText'=>'',
       ));*/
     $data = $this->arrDataProvider->getData();
     $records = PartStatus::model()->findAll();
     $number = 0;
     foreach ($data as $this->item_id => $item) {
         $number++;
         if (User::model()->isCustomer() && $item->status_id == 4) {
             $this->status = ProjectModule::t('Approved by me');
         } else {
             $this->status = PartStatus::model()->findByPk($item->status_id);
             $this->status = $this->status->status;
         }
         $this->record_id = $item->id;
         $this->status_id = $item->status_id;
         $this->select = '<select name="select-status-' . $this->record_id . '" id="select-status-' . $this->record_id . '" onchange="stage_change_status(' . $this->record_id . '); return false;">';
         foreach ($records as $rec) {
             $this->select .= "<option value='{$rec->id}' ";
             if ($rec->id == $item->status_id) {
                 $this->select .= 'selected="selected"';
             }
             $this->select .= ">{$rec->status}</option>";
         }
         $this->select .= '</select>';
         if (Yii::app()->user->isGuest || User::model()->isAuthor() && !User::model()->isExecutor($item->proj_id)) {
             $this->number = $number;
             $this->render('index', $item);
         } else {
             $this->render('newview', $item);
         }
     }
 }
Example #6
0
<?php

$this->menu = array(array('label' => ProjectModule::t('Create Project Field'), 'url' => array('create')), array('label' => ProjectModule::t('Update Project Field'), 'url' => array('update', 'id' => $model->id)), array('label' => ProjectModule::t('Delete Project Field'), 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => UserModule::t('Are you sure to delete this item?'))), array('label' => ProjectModule::t('Manage Project Fields'), 'url' => array('admin')));
$this->widget('zii.widgets.CMenu', array('items' => $this->menu, 'htmlOptions' => array('class' => 'operations')));
?>
<h1><?php 
//echo UserModule::t('View Project Field #').$model->varname;
echo UserModule::t('FieldOfOrders') . ' "' . $model->varname . '"';
?>
</h1>

<?php 
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('id', 'varname', 'title', 'field_type', 'field_size', 'required', 'error_message', 'default', 'position', 'visible', array('label' => ProjectModule::t('Work types'), 'type' => 'raw', 'value' => $model->work_types == null ? '(' . UserModule::t("All") . ')' : Catalog::getNamesByIds($model->work_types, ', ')))));
echo $customer->profile->lastname;
?>
 <br>
        <?php 
echo $customer->email;
?>
 <br>
        <?php 
echo $customer->profile->mob_tel;
?>
    </div>

<?php 
$this->widget('application.modules.project.widgets.payment.PaymentWidget', array('projectId' => $model->id));
if ($user->isCustomer()) {
    $UT = 1;
    $this->renderPartial('_form', array('model' => $model, 'times' => $times));
} elseif ($user->isManager() || $user->isAdmin()) {
    $UT = 0;
    $this->renderPartial('_formUpdateManager', array('model' => $model, 'times' => $times));
}
?>

    <h3 ><?php 
echo ProjectModule::t('Changes');
?>
</h3>

<?php 
$this->widget('application.modules.project.widgets.changes.ChangesWidget', array('project' => $model));
$this->widget('application.modules.project.widgets.zakazParts.ZakazPartWidget', array('projectId' => $model->id, 'userType' => $UT, 'action' => 'edit'));
Example #8
0
<?php

Yii::app()->getClientScript()->registerCssFile(Yii::app()->theme->baseUrl . '/css/manager.css');
?>

<div class="row white-bg inside-block">
<div class="col-md-12">
<?php 
$this->breadcrumbs = array(ProjectModule::t('Zakazs'));
if (Campaign::getId()) {
    $columns = array('id');
    $projectFields = $model->getFields();
    if ($projectFields) {
        foreach ($projectFields as $field) {
            if ($field->field_type == "LIST") {
                $varname = $field->varname;
                $columns[] = array('name' => $varname, 'filter' => Catalog::getAll($varname), 'value' => '$data->catalog_' . $varname . '->cat_name');
            } elseif ($field->varname != 'soderjanie' && $field->varname != 'description' && $field->varname != 'opisanie') {
                // !!! Сделать настраиваемым
                $columns[] = $field->varname;
            }
        }
    }
    /*$columns[] = array(
          'name'=>'date',
          'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array(
              'model'=>$model,
              'attribute'=>'dbdate',
              'language'=>Yii::app()->language,
              ),true),
          'value'=>'$data->dbdate'
Example #9
0
<?php

/* @var $this ZakazPartsController */
/* @var $dataProvider CActiveDataProvider */
$this->breadcrumbs = array(ProjectModule::t('Zakaz Parts'));
$this->menu = array(array('label' => ProjectModule::t('Create ZakazParts'), 'url' => array('create')), array('label' => ProjectModule::t('Manage ZakazParts'), 'url' => array('admin')));
?>

<h1>Zakaz Parts</h1>

<?php 
$this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'itemView' => '_view'));
Example #10
0
<?php

$this->menu = array(array('label' => ProjectModule::t('Create Project Field'), 'url' => array('create')), array('label' => ProjectModule::t('View Project Field'), 'url' => array('view', 'id' => $model->id)), array('label' => ProjectModule::t('Manage Project Fields'), 'url' => array('admin')));
$this->widget('zii.widgets.CMenu', array('items' => $this->menu, 'htmlOptions' => array('class' => 'operations')));
?>

<h1><?php 
echo ProjectModule::t('Update Project Field') . ' ' . $model->id;
?>
</h1>
<?php 
echo $this->renderPartial('_form', array('model' => $model));
Example #11
0
$columns = array('id');
$columns[] = array('name' => 'title');
if (ProjectField::model()->inTableByVarname('specials')) {
    $columns[] = array('name' => 'specials', 'filter' => Catalog::getAll('specials'), 'value' => '$data->catalog_specials->cat_name');
}
if (ProjectField::model()->inTableByVarname('specials2')) {
    $columns[] = array('name' => 'specials2', 'filter' => Catalog::getAll('specials2'), 'value' => '$data->catalog_specials2->cat_name');
}
$columns[] = array('name' => 'max_exec_date', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'dbmax_exec_date', 'language' => Yii::app()->language), true), 'value' => '$data->dbmax_exec_date');
$columns[] = array('name' => 'author_informed', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'dbauthor_informed', 'language' => Yii::app()->language), true), 'value' => '$data->dbauthor_informed');
$columns[] = array('name' => 'manager_informed', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'dbmanager_informed', 'language' => Yii::app()->language), true), 'value' => '$data->dbmanager_informed');
$columns[] = array('name' => 'status', 'filter' => ProjectStatus::getAll(), 'value' => '$data->statusName');
$columns[] = array('name' => 'lastPartStatus', 'filter' => ZakazParts::model()->getForFilter(), 'value' => '$data->lastPartStatus');
$columns[] = array('name' => 'lastPartDate', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'lastPartDate', 'language' => Yii::app()->language), true), 'value' => '$data->lastPartDate');
if (ProjectField::model()->inTableByVarname('technicalspec')) {
    $columns[] = array('name' => 'technicalspec', 'value' => '$data->technicalspec == 1 ? ProjectModule::t(\'Yes\') : ProjectModule::t(\'No\')', 'filter' => array("0" => ProjectModule::t('No'), "1" => ProjectModule::t('Yes')));
}
$columns[] = array('class' => 'CButtonColumn', 'template' => '{delete}{update}');
/*
$projectFields = $model->getFields();
if ($projectFields) {
	foreach($projectFields as $field) {
		if ($field->field_type=="LIST"){
			$varname = $field->varname;
			$arr = Catalog::getAll($varname);
			if (!$arr) $arr = Catalog::getAll($varname, 0); // Если список одноуровненвый
			$columns[] = array(
					'name'=>$varname,
					'filter'=>$arr,
					'value'=>'$data->catalog_'.$varname.'->cat_name',
				);
Example #12
0
    $res["reason"] = "Post Data Illegal";
    die(json_encode($res));
}
/**
 * validate power
 */
if (!isset($_SESSION['user_info']) || empty($_SESSION['user_info'])) {
    $res["reason"] = "u are not login";
    die(json_encode($res));
}
$db = new MySQL($log);
$mysqli = $db->openDB();
if ($mysqli !== null) {
    $project = new Project($mysqli, $log);
    $module = new Module($mysqli, $log);
    $projectModule = new ProjectModule($mysqli, $log);
    if ($data['op'] === 'del') {
        foreach ($data['data'] as $prodata) {
            //validate power
            //judge if  the project u_id is eq user id
            if ($project->getProjectById($prodata['id'])) {
                if ($project->u_id !== $_SESSION['user_info']['id']) {
                    $res["result"] = false;
                    $res["reason"] = "U have no power to del ID:" . $prodata['id'];
                    $db->closeDB();
                    die(json_encode($res));
                }
            } else {
                $res["result"] = false;
                $res["reason"] = "Project ID:" . $prodata['id'] . "Not Found!";
                $db->closeDB();
Example #13
0
 * An easy Xss framework
 */
require_once "../Path.php";
require_once "../sess.php";
require_once PHP_BASE_DIR . "/db/MySQL.php";
require_once PHP_BASE_DIR . "/util/util.php";
require_once PHP_BASE_DIR . "/entity/Project.php";
require_once PHP_BASE_DIR . "/entity/ProjectModule.php";
error_reporting(E_ALL ^ E_NOTICE);
header("Content-Type: application/javascript; charset=UTF-8");
/**
 * validate power
 */
$p_id = empty($_GET['p_id']) ? 0 : (int) $_GET['p_id'];
if (!isset($_SESSION['user_info']) || empty($_SESSION['user_info'])) {
    $res["reason"] = "u are not login";
    die(json_encode($res));
}
$db = new MySQL($log);
$mysqli = $db->openDB();
if ($mysqli !== null) {
    $project = new Project($mysqli, $log);
    $projectModule = new ProjectModule($mysqli, $log);
    $project->getProjectById($p_id);
    if ($_SESSION['user_info']['id'] === $project->u_id) {
        $projectModule->getProjectModulesByProject($p_id);
        die("coreconfig = " . $projectModule->config);
    }
    $db->closeDB();
}
die("coreconfig = null;");
 /**
  * Updates a particular model.
  * If update is successful, the browser will be redirected to the 'view' page.
  *
  * @param integer $id the ID of the model to be updated
  */
 public function actionEdit($id)
 {
     if (!Yii::app()->request->isAjaxRequest) {
         return false;
     }
     $model = $this->loadModel($id);
     $model->scenario = 'edit';
     if (!$model->isAllowedAdd()) {
         echo CJSON::encode(array('error' => array('text' => array(ProjectModule::t('You are not allowed to change!')))));
         Yii::app()->end();
     }
     if (isset($_POST['ProjectChanges'])) {
         $model->date_update = date('Y-m-d H:i:s');
         $model->attributes = $_POST['ProjectChanges'];
         $model->fileupload = CUploadedFile::getInstance($model, 'fileupload');
         if (ProjectChanges::approveAllowed()) {
             $model->date_moderate = date('Y-m-d H:i:s');
             $model->moderate = 1;
         } else {
             $model->moderate = 0;
         }
         if (!$model->validate()) {
             echo CJSON::encode(array('error' => CJSON::decode(CActiveForm::validate($model))));
             Yii::app()->end();
         }
         if ($model->save(false)) {
             echo CJSON::encode(array('success' => true));
             Yii::app()->end();
         }
     }
     echo CJSON::encode(array('error' => array('text' => array('Данные не переданы!'))));
     Yii::app()->end();
 }
Example #15
0
<div class="col-xs-12 tips-wrapper <?php 
echo count($tips) ? '' : '__empty';
?>
">
<?php 
if (count($tips)) {
    ?>
	<div class="col-xs-12 tips-content">
		<span class="block-title"><?php 
    echo ProjectModule::t('Tips');
    ?>
</span>
		<div class="tips-list">
		<?php 
    foreach ($tips as $tip) {
        ?>
			<div class="tips-item">
				<div class="tips-item_title"><?php 
        echo CHtml::link(CHtml::encode($tip->title), array('tips/view', 'id' => $tip->id));
        ?>
</div>
				<div class="tips-item_text"><?php 
        echo $tip->text;
        ?>
</div>
			</div>
		<?php 
    }
    ?>
		</div>
	</div>
Example #16
0
echo $form->labelEx($model, 'comment');
?>
		<?php 
echo $form->textArea($model, 'comment', array('rows' => 6, 'cols' => 50));
?>
		<?php 
echo $form->error($model, 'comment');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'file');
?>
		<?php 
$this->widget('ext.EAjaxUpload.EAjaxUpload', array('id' => 'EAjaxUpload', 'config' => array('action' => $this->createUrl('zakazParts/upload/' . $model->id), 'template' => '<div class="qq-uploader"><div class="qq-upload-drop-area"><span>' . ProjectModule::t('Drop files here to upload') . '</span></div><div class="qq-upload-button">' . ProjectModule::t('Upload a file') . '</div><ul class="qq-upload-list"></ul></div>', 'debug' => false, 'allowedExtensions' => array('jpg, '), 'sizeLimit' => 10 * 1024 * 1024, 'minSizeLimit' => 10 * 1024, 'onComplete' => "js:function(id, fileName, responseJSON){ alert(fileName); }")));
?>
                <?php 
echo $form->hiddenField($model, 'file');
?>
		<?php 
echo $form->error($model, 'file');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'date');
?>
                <?php 
$this->widget('zii.widgets.jui.CJuiDatePicker', array('name' => 'Zakaz[date]', 'language' => 'ru', 'value' => $model->date, 'options' => array('dateFormat' => 'yy-mm-dd', 'showAnim' => 'drop'), 'htmlOptions' => array('style' => 'height:20px;background-white:blue;color:black;')));
Example #17
0


            <?php 
Yii::app()->getClientscript()->registerScriptFile(Yii::app()->theme->baseUrl . '/js/manager.js');
?>
          <!-- Начало блока добавления частей менеджера -->
          <?php 
$this->widget('application.modules.project.widgets.zakazParts.ZakazPartWidget', array('projectId' => $model->id));
?>
            <div class="row zero-edge">
                <div class="col-xs-12 btn btn-primary addPart" onclick="add_part(<?php 
echo $model->id;
?>
);"><?php 
echo ProjectModule::t('Add part');
?>
</div>
            </div>
            <!-- Конец блока добавления частей менеджера -->
            <!-- Начало блока правок (доработок) менеджера -->
            <?php 
$this->widget('application.modules.project.widgets.changes.ChangesWidget', array('project' => $model));
?>
            <!-- Конец блока правок (доработок) менеджера -->

        </div>

         <!-- Right column -->
        <div class="col-xs-8">
           <div class="row">
Example #18
0
<?php

/* @var $this ZakazController */
/* @var $model Zakaz */
$this->breadcrumbs = array(ProjectModule::t('Zakazs') => array('index'), ProjectModule::t('Manage'));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$('#zakaz-grid').yiiGridView('update', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1><?php 
echo ProjectModule::t('Manage Zakaz');
?>
</h1>

<p>
<?php 
echo ProjectModule::t('You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b> or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.');
?>
</p>

<?php 
echo CHtml::link(ProjectModule::t('Advanced Search'), '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'zakaz-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('id', array('name' => 'user_id', 'type' => 'raw', 'value' => 'User::model()->findByPk($data->user_id)->username'), array('name' => 'category_id', 'type' => 'raw', 'value' => 'Categories::model()->findByPk($data->category_id)->cat_name'), array('name' => 'job_id', 'type' => 'raw', 'value' => 'Jobs::model()->findByPk($data->job_id)->job_name'), 'title', array('class' => 'CButtonColumn'))));
Example #19
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'));
		</div>
        <?php 
Yii::app()->getClientScript()->registerScriptFile('/js/tinymce/tinymce.min.js');
Yii::app()->getClientScript()->registerScriptFile('/js/chat_templates.js', CClientScript::POS_END);
?>

		<div class="chtpl0-form">
			<textarea></textarea>
			<div class="chtpl0-subm">
				<h5><?php 
echo ProjectModule::t('Send message');
?>
</h5>
				<br>
				<button class="chtpl0-submit1"><?php 
echo ProjectModule::t('Send message');
?>
</button>
			</div>
		</div>
        <?php 
$this->widget('YiiChatWidget', array('chat_id' => $model->id, 'executor' => $model->executor, 'identity' => Yii::app()->user->id, 'selector' => '#chatWindow', 'minPostLen' => 1, 'maxPostLen' => 5000, 'model' => new ChatHandler(), 'data' => 'any data', 'onSuccess' => new CJavaScriptExpression("function(code, text, post_id){   }"), 'onError' => new CJavaScriptExpression("function(errorcode, info){  }")));
?>
    </div>
</div>

<div class="col-xs-12 payment-block">
    <?php 
$this->widget('application.modules.project.widgets.payment.PaymentWidget', array('projectId' => $model->id, 'hints' => $hints));
?>
</div>
 /**
  * @return array customized attribute labels (name=>label)
  */
 public function attributeLabels()
 {
     return array('id' => ProjectModule::t('ID'), 'user_id' => ProjectModule::t('User'), 'project_id' => ProjectModule::t('Project'), 'file' => ProjectModule::t('File'), 'fileupload' => ProjectModule::t('Attach file'), 'comment' => ProjectModule::t('Comment'), 'date_create' => ProjectModule::t('Date Create'), 'date_update' => ProjectModule::t('Date Update'), 'date_moderate' => ProjectModule::t('Date Moderate'), 'moderate' => ProjectModule::t('Approved'));
 }
 public function yiichat_list_posts($chat_id, $identity, $last_id, $data)
 {
     $res = parent::yiichat_list_posts($chat_id, $identity, $last_id, $data);
     if (count($res) > 0) {
         $order = Zakaz::model()->findByPk($chat_id);
     }
     foreach ($res as $k => $v) {
         $res1[$k] = $v->attributes;
         $res1[$k]['sender'] = array();
         $res1[$k]['sender']['fullusername'] = $res[$k]->senderObject->email;
         if ($res[$k]->senderObject) {
             $res1[$k]['sender']['superuser'] = $res[$k]->senderObject->getRelated('AuthAssignment')->attributes;
         }
         // При удалённом пользователе необходима проверка
         $res1[$k]['sender']['rating'] = (int) $res[$k]->senderObject->profile->rating;
         switch ($res1[$k]['sender']['superuser']['itemname']) {
             case 'Admin':
                 $res1[$k]['sender']['username'] = ProjectModule::t('Admin');
                 //'Админ';
                 break;
             case 'Manager':
                 $res1[$k]['sender']['username'] = ProjectModule::t('Manager');
                 //'Менеджер';
                 break;
             case 'Author':
                 if (ProjectMessages::model()->getRole($res1[$k]['sender_role']) == 'Corrector') {
                     $res1[$k]['sender']['username'] = ProjectModule::t('Corrector');
                 } else {
                     $res1[$k]['sender']['username'] = ProjectModule::t('Executor');
                 }
                 //'Автор';
                 break;
             case 'Customer':
                 $res1[$k]['sender']['username'] = ProjectModule::t('Customer');
                 //'Заказчик';
                 break;
         }
         $res1[$k]['sender']['username'] = $res1[$k]['sender']['fullusername'];
         if ($res[$k]->recipient > 0) {
             $res1[$k]['recipient'] = array();
             $res1[$k]['recipient']['fullusername'] = $res[$k]->recipientObject->email;
             $res1[$k]['recipient']['superuser'] = $res[$k]->recipientObject->getRelated('AuthAssignment')->attributes;
             switch ($res1[$k]['recipient']['superuser']['itemname']) {
                 case 'Admin':
                     $res1[$k]['recipient']['username'] = ProjectModule::t('to admin');
                     //'админу';
                     break;
                 case 'Manager':
                     $res1[$k]['recipient']['username'] = ProjectModule::t('to manager');
                     //'менеджеру';
                     break;
                 case 'Author':
                     if (ProjectMessages::model()->getRole($res1[$k]['recipient_role']) == 'Corrector') {
                         $res1[$k]['recipient']['username'] = ProjectModule::t('to corrector');
                     } else {
                         $res1[$k]['recipient']['username'] = ProjectModule::t('to executor');
                     }
                     //'автору';
                     break;
                 case 'Customer':
                     $res1[$k]['recipient']['username'] = ProjectModule::t('to customer');
                     //'заказчику';
                     break;
             }
             //$res1[$k]['recipient']['username']=$res1[$k]['recipient']['fullusername'];
         }
         if ($res1[$k]['sender_role']) {
             $res1[$k]['sender_role'] = ProjectMessages::model()->getRole($res1[$k]['sender_role']);
         }
     }
     return $res1;
 }
echo CHtml::label('Прикрепить файл', 'fileupload');
?>
							<?php 
echo CHtml::fileField('ProjectChanges[fileupload]', $fileupload, array('class' => 'col-xs-12 btn btn-user'));
?>
						</div>

						<div class="col-xs-12">
							<?php 
echo CHtml::label('Комментарий', 'comment');
?>
							<?php 
echo CHtml::textArea('ProjectChanges[comment]', $comment, array('class' => 'col-xs-12'));
?>
						</div>
						<?php 
echo CHtml::endForm();
?>
						<?php 
$url = Yii::app()->createUrl("/project/changes/add", array('project' => $project->id));
echo CHtml::htmlButton(ProjectModule::t('Add changes'), array('class' => 'col-xs-12 btn btn-primary addPart', 'onclick' => "javascript: send('{$url}')"));
?>
					</div>
				</div>
				
            </div>
        </div>
    </div>
</div>

Example #24
0
<?php

/* @var $this ZakazPartsController */
/* @var $model ZakazParts */
$this->breadcrumbs = array(ProjectModule::t('Zakaz Parts') => array('index'), $model->title);
$this->menu = array(array('label' => ProjectModule::t('List ZakazParts'), 'url' => array('index')), array('label' => ProjectModule::t('Create ZakazParts'), 'url' => array('create')), array('label' => ProjectModule::t('Update ZakazParts'), 'url' => array('update', 'id' => $model->id)), array('label' => ProjectModule::t('Delete ZakazParts'), 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => ProjectModule::t('Are you sure you want to delete this item?'))), array('label' => ProjectModule::t('Manage ZakazParts'), 'url' => array('admin')));
?>

<h1><?php 
echo ProjectModule::t('View ZakazParts') . ' #' . $model->id;
?>
</h1>

<?php 
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('id', 'proj_id', 'title', 'text', 'file', 'date', 'max_exec_date', 'date_finish', 'pages', 'budget', 'add_demands')));
    ?>
" id="part_title_<?php 
    echo $data['id'];
    ?>
">
								<?php 
    echo $data['title'];
    ?>
							</a>
						</h4>
					</div>
					<?php 
    if (User::model()->isAuthor()) {
        ?>
					<div class="title-time"><?php 
        echo ProjectModule::t('Date');
        ?>
:<br />
						<?php 
        echo $data['dbdate'];
        ?>
					</div>
					<?php 
    }
    ?>
				</div>
				<div id="collapseOne<?php 
    echo $data['id'];
    ?>
" class="panel-collapse collapse">
					<div class="panel-body">
Example #26
0
        }
    }
    $this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => $columns));
    ?>
	<br>
	<form method="post"
		  action="<?php 
    echo Yii::app()->createUrl('project/zakaz/moderationAnswer', array('id' => $model->id, 'event_id' => $event->id, 'answer' => 1));
    ?>
"
		  style="display: inline-block">
		<input type="submit" value="<?php 
    echo ProjectModule::t('Approve');
    ?>
">
	</form>
	<form method="post"
		  action="<?php 
    echo Yii::app()->createUrl('project/zakaz/moderationAnswer', array('id' => $model->id, 'event_id' => $event->id, 'answer' => 0));
    ?>
"
		  style="display: inline-block">
		<input type="submit" value="<?php 
    echo ProjectModule::t('Reject');
    ?>
">
	</form>
	<?php 
} else {
    echo 'Project not found.';
}
Example #27
0
echo CHtml::label(ProjectModule::t('Attach file'), 'iconupload');
?>
		<?php 
echo CHtml::fileField('Company[iconupload]', '', array('class' => 'col-xs-12 btn btn-user'));
?>
		<?php 
echo $form->error($model, 'iconupload');
?>
	</div>
	<div class="row">
		<?php 
echo CHtml::image(Yii::app()->getBaseUrl() . '/' . $model->getFilesPath() . '/' . $model->logo, 'logo');
?>
<br />
		<?php 
echo CHtml::label(ProjectModule::t('Attach file'), 'fileupload');
?>
		<?php 
echo CHtml::fileField('Company[fileupload]', '', array('class' => 'col-xs-12 btn btn-user'));
?>
		<?php 
echo $form->error($model, 'fileupload');
?>
	</div>
	<div class="row">
		<?php 
echo $form->labelEx($model, 'header');
?>
		<?php 
echo $form->textArea($model, 'header', array('rows' => 12, 'cols' => 50, 'class' => 'form-control'));
?>
Example #28
0
<?php

/* @var $this ZakazPartsController */
/* @var $model ZakazParts */
$this->breadcrumbs = array('Zakaz Parts' => array('index'), 'Create');
$this->menu = array(array('label' => ProjectModule::t('List ZakazParts'), 'url' => array('index')), array('label' => ProjectModule::t('Manage ZakazParts'), 'url' => array('admin')));
?>

<h1><?php 
echo ProjectModule::t('Create ZakazParts');
?>
</h1>

<?php 
$this->renderPartial('_form', array('model' => $model));
echo $form->error($model, 'time_for_call');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'edu_dep');
?>
		<?php 
echo $form->textField($model, 'edu_dep');
?>
		<?php 
echo $form->error($model, 'edu_dep');
?>
	</div>
<?php 
//echo CHtml::activeFileField(
?>
	<div class="row buttons">
		<?php 
echo CHtml::submitButton(ProjectModule::t('Save'));
?>
	</div>

<?php 
$this->endWidget();
?>
</div><!-- form -->
<div id="chatWindow"></div>
<?php 
$this->widget('YiiChatWidget', array('chat_id' => $model->id, 'executor' => $model->executor, 'identity' => Yii::app()->user->id, 'selector' => '#chatWindow', 'minPostLen' => 1, 'maxPostLen' => 5000, 'model' => new ChatHandler(), 'data' => 'any data', 'onSuccess' => new CJavaScriptExpression("function(code, text, post_id){   }"), 'onError' => new CJavaScriptExpression("function(errorcode, info){  }")));
Example #30
0
	<div class="row">
		<?php 
echo $form->labelEx($model, 'edu_dep');
?>
		<?php 
echo $form->textField($model, 'edu_dep');
?>
		<?php 
echo $form->error($model, 'edu_dep');
?>
	</div>

	<div class="row buttons">
		<?php 
echo CHtml::submitButton($model->isNewRecord ? ProjectModule::t('Create') : ProjectModule::t('Save'));
?>
	</div>

<?php 
$this->endWidget();
?>

</div><!-- form -->

<?php 
if (!$model->isNewRecord && $model->status == 2) {
    $upload = new UploadPaymentImage();
    ?>

<div class="form">