本文整理汇总了PHP中ProjectModule类的典型用法代码示例。如果您正苦于以下问题:PHP ProjectModule类的具体用法?PHP ProjectModule怎么用?PHP ProjectModule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ProjectModule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionEdit
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'));
}
示例2: actionEdit
/**
* 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));
}
示例3: get_specials
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;
}
示例4: actionIndex
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));
}
示例5: run
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);
}
}
}
示例6: array
<?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, ', ')))));
示例7: array
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'));
示例8: array
<?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'
示例9: array
<?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));
示例10: array
$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',
);
示例11: die
$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();
示例12: error_reporting
* 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;");
示例13: actionEdit
/**
* 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();
}
示例14: count
<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>
示例15: array
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;')));