Example #1
0
 public function testCRUD()
 {
     //CREATE Test
     $newProject = new Project();
     $projectName = 'This is a Test';
     $newProject->setAttributes(array('name' => $projectName, 'description' => 'This project is for test purpose only', 'start_date' => '2010-11-15 15:00:00', 'end_date' => '2010-12-06 00:00:00', 'update_user_id' => 1, 'category' => 2, 'status' => 1, 'owner' => 1));
     $this->assertTrue($newProject->save(false));
     //READ Test
     $readProject = Project::model()->findByPk($newProject->id);
     $this->assertTrue($readProject instanceof Project);
     $this->assertEquals($projectName, $readProject->name);
     //UPDATE Test
     $updateProjectName = 'Updated Name2';
     $newProject->name = $updateProjectName;
     $this->AssertTrue($newProject->save(false));
     $updatedProject = Project::model()->findByPk($newProject->id);
     $this->assertTrue($updatedProject instanceof Project);
     $this->assertNotEquals($projectName, $updatedProject->name);
     //DELETE Test
     $deletedProjectId = $newProject->id;
     $newProject->delete();
     $deletedProject = Project::model()->findByPk($newProject->id);
     $this->assertEquals(Null, $deletedProject);
     //GetUserVote Test
     $project = Project::model()->findByPk(18);
     $this->assertTrue($project->getUserVote(7) == true);
     //Vote Test
     $this->assertTrue($project->vote(1, 1) == 1);
 }
 public function loadModel($id)
 {
     if (($model = Project::model()->findByPk($id)) === null) {
         throw new CHttpException(404, 'Страница не найдена');
     }
     return $model;
 }
Example #3
0
 /**
  * This method creates a new db record if such a version does not exist yet.
  * @param string $appversion Version string.
  * @return AppVersion On success, returns AppVersion object; otherwise Null.
  */
 public static function createIfNotExists($appversion, $project_id = null)
 {
     if ($project_id == null) {
         $project_id = Yii::app()->user->getCurProjectId();
     }
     if ($project_id == null) {
         return Null;
     }
     // Ensure that project_id is a valid project ID
     $project = Project::model()->findByPk($project_id);
     if ($project == null) {
         return Null;
     }
     // Try to find an existing version with such a name
     $criteria = new CDbCriteria();
     $criteria->compare('project_id', $project_id, false, 'AND');
     $criteria->compare('version', $appversion, false, 'AND');
     $model = AppVersion::model()->find($criteria);
     if ($model != Null) {
         return $model;
     }
     $model = new AppVersion();
     $model->project_id = $project_id;
     $model->version = $appversion;
     if (!$model->save()) {
         return Null;
     }
     return $model;
 }
 public function actionShow($alias)
 {
     $model = Project::model()->published()->with(array('galleries' => array('scopes' => 'published', 'order' => 'galleries.sort ASC', 'with' => array('images' => array('scopes' => 'published', 'order' => 'images.sort ASC'))), 'slides' => array('scopes' => 'published', 'order' => 'slides.sort ASC')))->findByAlias($alias);
     if (!$model) {
         throw new CHttpException(404);
     }
     $this->render('item', array('model' => $model));
 }
Example #5
0
 public function testDelete()
 {
     $project = $this->projects('project2');
     $savedProjectId = $project->id;
     $this->assertTrue($project->delete());
     $deletedProject = Project::model()->findByPk($savedProjectId);
     $this->assertEquals(NULL, $deletedProject);
 }
Example #6
0
 public function loadModel($id)
 {
     $model = Project::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Example #7
0
 public function actionView($url)
 {
     $model = Project::model()->findByAttributes(array('identifier' => $url));
     if (!$model) {
         throw new CHttpException(404, 'Такой страницы не существует');
     }
     $this->pageTitle = $model->title . ' - ' . Yii::app()->name;
     User::setLastProjectId($model->id);
     $this->render('view', array('model' => $model));
 }
 /**
  * Protected method to load the associated Project model class
  *
  * @param $project_id int The primary identifier of the associated project
  * @return Project The Project data model based on the primary key.
  * @throws CHttpException
  */
 protected function _loadProject($project_id)
 {
     // if the project property is null, create it base on input id
     if ($this->_project === null) {
         $this->_project = Project::model()->findByPk($project_id);
         if ($this->_project === null) {
             throw new CHttpException(404, 'The requested project does not exist.');
         }
     }
     return $this->_project;
 }
Example #9
0
 /**
  * Returns data array of the attribute for create/update.
  * @param string the attribute name
  * @return array the attribute's data
  */
 public function getAttributeData($attribute)
 {
     switch ($attribute) {
         case 'companyId':
             return array(null => Yii::t('t', '- Please select -')) + CHtml::listData(Company::model()->findAllActiveRecords(array($this->{$attribute})), 'id', 'title');
         case 'projectId':
             return array(null => Yii::t('t', '- Please select -')) + CHtml::listData(Project::model()->findAllOpenRecords(array($this->{$attribute})), 'id', 'title');
         default:
             return $this->{$attribute};
     }
 }
Example #10
0
 public function uniqueSlug($attribute, $params)
 {
     if ($this->isNewRecord) {
         if (Project::model()->exists('location_id = :location_id AND slug = :slug', array(':location_id' => $this->location_id, ':slug' => $this->slug))) {
             $this->addError($attribute, $params['message']);
         }
     } else {
         if (Project::model()->exists('id != :project_id AND location_id = :location_id AND slug = :slug', array(':project_id' => $this->id, ':location_id' => $this->location_id, ':slug' => $this->slug))) {
             $this->addError($attribute, $params['message']);
         }
     }
 }
 public function actionProject()
 {
     $criteria = new CDbCriteria();
     $criteria->order = "id DESC";
     $count = Project::model()->count($criteria);
     $pages = new CPagination($count);
     // элементов на страницу
     $pages->pageSize = 20;
     $pages->applyLimit($criteria);
     $work = Project::model()->findAll($criteria);
     $this->render('project', array('project' => $work, 'pages' => $pages));
 }
Example #12
0
 /**
  * Получает доступ к редактированию проекту если:
  * Администратор, содатель проекта, участник конкретного действия.
  * @param type $projectID
  * @return boolean
  */
 public static function accessEditProject($projectID, $taskId = NULL)
 {
     if (self::currentUserIsAdmin()) {
         return true;
     }
     if (!is_null(Project::model()->find(array('select' => 'id', 'condition' => 'id=:id AND user_id=:user_id', 'params' => array(':id' => $projectID, ':user_id' => Yii::app()->user->getId()))))) {
         return true;
     }
     if (!is_null($taskId) && !is_null(Task::model()->find(array('select' => 'id', 'condition' => 'id=:id  AND project_id=:project_id AND executor=:user_id', 'params' => array(':id' => $taskId, ':project_id' => $projectID, ':user_id' => Yii::app()->user->getId()))))) {
         return true;
     }
     return false;
 }
Example #13
0
 public function uniqueProject($attribute)
 {
     // $pattern  = "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$^";
     // if(!preg_match($pattern, $this->email))
     // $id = Yii::app()->user->id;
     // if (Yii::app()->user->level()=='3'){
     // 	$id_member = Member::model()->find("TRIM(email) = '$id'")->id;
     // }else{
     // 	$id_member = MemberSub::model()->find("TRIM(email) = '$id'")->id_member;
     // }
     $model = Project::model()->find(" project_name = '{$this->project_name}' and id_member = '{$this->id_member}'  ");
     if (count($model) > 0) {
         $this->addError($attribute, "Project for this client , already exist !");
     }
 }
Example #14
0
 public function testUserAccessBasedOnProjectRole()
 {
     $row1 = $this->project_user_roles['row1'];
     Yii::app()->user->setId($row1['user_id']);
     $project = Project::model()->findByPk($row1['project_id']);
     $auth = Yii::app()->authManager;
     $bizRule = 'return isset($params["project"]) && $params["project"]->isUserInRole("member");';
     $auth->assign('member', $row1['user_id'], $bizRule);
     $params = array('project' => $project);
     $this->assertTrue(Yii::app()->user->checkAccess('updateIssue', $params));
     $this->assertTrue(Yii::app()->user->checkAccess('readIssue', $params));
     $this->assertFalse(Yii::app()->user->checkAccess('updateProject', $params));
     // now we ensure the user does not have any access to a project ther are not associated with
     $project = Project::model()->findByPk(1);
     $params = array('project' => $project);
     $this->assertFalse(Yii::app()->user->checkAccess('updateIssue', $params));
     $this->assertFalse(Yii::app()->user->checkAccess('readIssue', $params));
     $this->assertFalse(Yii::app()->user->checkAccess('updateProject', $params));
 }
Example #15
0
 public function testUserAccessBasedOnProjectRole()
 {
     $row1 = $this->projUsrRole['row1'];
     Yii::app()->user->setId($row1['user_id']);
     $project = Project::model()->findByPk($row1['project_id']);
     $auth = Yii::app()->authManager;
     $bizRule = 'return isset($params["project"]) && $params["project"]->isUserInRole("member");';
     $auth->assign('member', $row1['user_id'], $bizRule);
     $params = array('project' => $project);
     $this->assertTrue(Yii::app()->user->checkAccess('updateIssue', $params));
     $this->assertTrue(Yii::app()->user->checkAccess('readIssue', $params));
     $this->assertFalse(Yii::app()->user->checkAccess('updateProject', $params));
     //Check that user can't access projects they are not assigned to
     $project = Project::model()->findByPk(1);
     $params = array('project' => $project);
     $this->assertFalse(Yii::app()->user->checkAccess('updateIssue', $params));
     $this->assertFalse(Yii::app()->user->checkAccess('readIssue', $params));
     $this->assertFalse(Yii::app()->user->checkAccess('updateProject', $params));
 }
Example #16
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Calendar'])) {
         $pn = Project::model()->findByPk($_POST['Calendar']['project_id'])->project_name;
         $model = new Calendar();
         $model->attributes = $_POST['Calendar'];
         $model->description = $_POST['Calendar']['description'] . " of";
         if ($model->save()) {
             echo "sukses";
         } else {
             print_r($model->getErrors());
         }
         // $this->redirect(array('view','id'=>$model->id));
     }
     // $this->render('create',array(
     // 'model'=>$model,
     // ));
 }
Example #17
0
 /**
  * This action allows user to upload a crash report ZIP file using
  * an external uploader tool.
  * @throws Exception 
  */
 public function actionUploadExternal()
 {
     // Create new AR model
     $report = new CrashReport();
     // Start db transaction
     $transaction = $report->dbConnection->beginTransaction();
     // Fill model attributes
     try {
         if (isset($_POST['crashrptver'])) {
             $report->crashrptver = $_POST['crashrptver'];
         }
         if (isset($_POST['crashguid'])) {
             $report->crashguid = $_POST['crashguid'];
         }
         if (isset($_POST['appname'])) {
             $projectName = $_POST['appname'];
             $project = Project::model()->find('name=:name', array(':name' => $projectName));
             if ($project === null) {
                 throw new Exception('Such a project name not found');
             }
             $report->project_id = $project->id;
         }
         // Get file attachment
         if (array_key_exists("crashrpt", $_FILES)) {
             $report->fileAttachment = new CUploadedFile($_FILES['crashrpt']['name'], $_FILES['crashrpt']['tmp_name'], $_FILES['crashrpt']['type'], $_FILES['crashrpt']['size'], $_FILES['crashrpt']['error']);
         }
         if (isset($_POST['appversion'])) {
             $report->appversion = $_POST['appversion'];
         }
         if (isset($_POST['md5'])) {
             $report->md5 = $_POST['md5'];
         }
         if (isset($_POST['emailfrom'])) {
             $report->emailfrom = $_POST['emailfrom'];
         }
         if (isset($_POST['description'])) {
             $report->description = $_POST['description'];
         }
         if (isset($_POST['exceptionmodule'])) {
             $report->exceptionmodule = $_POST['exceptionmodule'];
         }
         if (isset($_POST['exceptionmodulebase'])) {
             $report->exceptionmodulebase = $_POST['exceptionmodulebase'];
         }
         if (isset($_POST['exceptionaddress'])) {
             $report->exceptionaddress = $_POST['exceptionaddress'];
         }
         // This will create new record in the db table
         if ($report->save()) {
             // Commit db transaction
             $transaction->commit();
         }
     } catch (Exception $e) {
         $transaction->rollBack();
         $report->addError('crashrpt', 'Exception caught: ' . $e->getMessage());
     }
     $this->renderPartial('_upload', array('model' => $report));
 }
Example #18
0
<?php

/* @var $this ProjectController */
/* @var $dataProvider CActiveDataProvider */
$this->widget('booster.widgets.TbBreadcrumbs', array('links' => array('Project(s)')));
$this->menu = array(array('label' => 'Add new project', 'url' => array('project/create')));
// Get active projects
$expiredprojects = Project::model()->count(array('condition' => 'status="Expired" AND deleted=0'));
$activeprojects = Project::model()->count(array('condition' => 'status="Active" AND deleted=0'));
$upcomingprojects = Project::model()->count(array('condition' => 'status="Upcoming" AND deleted=0'));
?>

<h2 class="page-header">Projects</h2>

<!--<div class="span-19" style="margin: 0px; padding: 0px;">
<table class="span-4" style="margin: 0px; padding: 0px;">
    <tr>
        <td class="span-4" style="margin: 0px; padding: 0px;"">
            <h4><?php 
$this->widget('booster.widgets.TbLabel', array('context' => 'danger', 'label' => 'Expired projects :'));
?>
</h4>
            <h4><?php 
$this->widget('booster.widgets.TbLabel', array('context' => 'success', 'label' => 'Active projects :'));
?>
</h4>
            <h4><?php 
$this->widget('booster.widgets.TbLabel', array('context' => 'primary', 'label' => 'Upcoming projects :'));
?>
</h4>
        </td>
Example #19
0
 /**
  * Print out array of models for the jqGrid rows.
  */
 public function actionGridData()
 {
     if (!Yii::app()->request->isPostRequest) {
         throw new CHttpException(400, Yii::t('http', 'Invalid request. Please do not repeat this request again.'));
         exit;
     }
     // specify request details
     $jqGrid = $this->processJqGridRequest();
     // specify filter parameters
     $company = isset($_GET['company']) ? $_GET['company'] : null;
     if ($company !== 'all' && !ctype_digit($company)) {
         $company = 'all';
     }
     $priority = isset($_GET['priority']) ? $_GET['priority'] : null;
     if ($priority !== 'all' && $priority !== (string) Project::PRIORITY_HIGHEST && $priority !== (string) Project::PRIORITY_HIGH && $priority !== (string) Project::PRIORITY_MEDIUM && $priority !== (string) Project::PRIORITY_LOW && $priority !== (string) Project::PRIORITY_LOWEST) {
         $priority = 'all';
     }
     $state = isset($_GET['state']) ? $_GET['state'] : null;
     if ($state !== 'all' && $state !== 'closed' && $state !== 'open') {
         $state = 'all';
     }
     // criteria
     $criteria = new CDbCriteria();
     $criteria->group = "`t`.`id`";
     // required by together()
     $criteria->select = "`t`.closeDate, `t`.hourlyRate, `t`.openDate, `t`.priority, `t`.title";
     //$criteria->select="`t`.`closeDate`, `t`.`hourlyRate`, `t`.`openDate`, `t`.`priority`, `t`.`title`"; // uncomment in yii-1.1.2
     if ($jqGrid['searchField'] !== null && $jqGrid['searchString'] !== null && $jqGrid['searchOper'] !== null) {
         $field = array('closeDate' => "`t`.`closeDate`", 'hourlyRate' => "`t`.`hourlyRate`", 'openDate' => "`t`.`openDate`", 'priority' => "`t`.`priority`", 'title' => "`t`.`title`", 'company' => "`Project_Company`.`title`");
         $operation = $this->getJqGridOperationArray();
         $keywordFormula = $this->getJqGridKeywordFormulaArray();
         if (isset($field[$jqGrid['searchField']]) && isset($operation[$jqGrid['searchOper']])) {
             $criteria->condition = '(' . $field[$jqGrid['searchField']] . ' ' . $operation[$jqGrid['searchOper']] . ' :keyword)';
             $criteria->params = array(':keyword' => str_replace('keyword', $jqGrid['searchString'], $keywordFormula[$jqGrid['searchOper']]));
             // search by special field types
             if ($jqGrid['searchField'] === 'createTime' && ($keyword = strtotime($jqGrid['searchString'])) !== false) {
                 $criteria->params = array(':keyword' => str_replace('keyword', $keyword, $keywordFormula[$jqGrid['searchOper']]));
                 if (date('H:i:s', $keyword) === '00:00:00') {
                     // visitor is looking for a precision by day, not by second
                     $criteria->condition = '(TO_DAYS(FROM_UNIXTIME(' . $field[$jqGrid['searchField']] . ',"%Y-%m-%d")) ' . $operation[$jqGrid['searchOper']] . ' TO_DAYS(FROM_UNIXTIME(:keyword,"%Y-%m-%d")))';
                 }
             }
         }
     }
     if ($company !== 'all') {
         $criteria->addCondition("`Project_Company`.`id`=:companyId");
         $criteria->params[':companyId'] = $company;
     }
     if ($priority === (string) Project::PRIORITY_HIGHEST) {
         $criteria->addCondition("`t`.`priority`=:priorityHighest");
         $criteria->params[':priorityHighest'] = Project::PRIORITY_HIGHEST;
     } else {
         if ($priority === (string) Project::PRIORITY_HIGH) {
             $criteria->addCondition("`t`.`priority`=:priorityHigh");
             $criteria->params[':priorityHigh'] = Project::PRIORITY_HIGH;
         } else {
             if ($priority === (string) Project::PRIORITY_MEDIUM) {
                 $criteria->addCondition("`t`.`priority`=:priorityMedium");
                 $criteria->params[':priorityMedium'] = Project::PRIORITY_MEDIUM;
             } else {
                 if ($priority === (string) Project::PRIORITY_LOW) {
                     $criteria->addCondition("`t`.`priority`=:priorityLow");
                     $criteria->params[':priorityLow'] = Project::PRIORITY_LOW;
                 } else {
                     if ($priority === (string) Project::PRIORITY_LOWEST) {
                         $criteria->addCondition("`t`.`priority`=:priorityLowest");
                         $criteria->params[':priorityLowest'] = Project::PRIORITY_LOWEST;
                     }
                 }
             }
         }
     }
     if ($state === 'closed') {
         $criteria->addCondition("`t`.`closeDate` IS NOT NULL");
     } else {
         if ($state === 'open') {
             $criteria->addCondition("(`t`.`closeDate` IS NULL OR TO_DAYS('" . MDate::formatToDb(time(), 'date') . "') < TO_DAYS(`t`.`closeDate`))");
         }
     }
     if (User::isClient()) {
         $criteria->addCondition("`Company_User2Company`.`userId`=:clientId AND `Company_User2Company`.`position`=:clientPosition");
         $criteria->params[':clientId'] = Yii::app()->user->id;
         $criteria->params[':clientPosition'] = Company::OWNER;
     }
     if (User::isConsultant()) {
         $criteria->addCondition("`Task_Consultant`.`id`=:consultantId");
         $criteria->params[':consultantId'] = Yii::app()->user->id;
     }
     // pagination
     $with = array();
     if (strpos($criteria->condition, 'Project_Company') !== false) {
         $with[] = 'allCompany';
     }
     if (strpos($criteria->condition, 'Company_User2Company') !== false) {
         $with[] = 'allCompany.allUser2Company';
     }
     if (strpos($criteria->condition, 'Task_Consultant') !== false) {
         $with[] = 'allTask.allConsultant';
     }
     if (count($with) >= 1) {
         $pages = new CPagination(Project::model()->with($with)->count($criteria));
     } else {
         $pages = new CPagination(Project::model()->count($criteria));
     }
     $pages->pageSize = $jqGrid['pageSize'] !== null ? $jqGrid['pageSize'] : self::GRID_PAGE_SIZE;
     $pages->applyLimit($criteria);
     // sort
     $sort = new CSort('Project');
     $sort->attributes = array('closeDate' => array('asc' => "`t`.`closeDate`", 'desc' => "`t`.`closeDate` desc", 'label' => Project::model()->getAttributeLabel('Closed')), 'hourlyRate' => array('asc' => "`t`.`hourlyRate`", 'desc' => "`t`.`hourlyRate` desc", 'label' => Project::model()->getAttributeLabel('Rate')), 'openDate' => array('asc' => "`t`.`openDate`", 'desc' => "`t`.`openDate` desc", 'label' => Project::model()->getAttributeLabel('Opened')), 'priority' => array('asc' => "`t`.`priority`", 'desc' => "`t`.`priority` desc", 'label' => Project::model()->getAttributeLabel('priority')), 'title' => array('asc' => "`t`.`title`", 'desc' => "`t`.`title` desc", 'label' => Project::model()->getAttributeLabel('title')), 'company' => array('asc' => "`Project_Company`.`title`", 'desc' => "`Project_Company`.`title` desc", 'label' => Company2Project::model()->getAttributeLabel('companyId')));
     $sort->defaultOrder = "`t`.`closeDate` ASC, `t`.`priority` ASC, `t`.`createTime` DESC";
     $sort->applyOrder($criteria);
     // find all
     $with = array('allCompany' => array('select' => 'title'));
     if (strpos($criteria->condition, 'Company_User2Company') !== false) {
         $with['allCompany.allUser2Company'] = array('select' => 'id');
     }
     if (strpos($criteria->condition, 'Task_Consultant') !== false) {
         $with['allTask.allConsultant'] = array('select' => 'id');
     }
     $together = strpos($criteria->condition, 'Project_Company') !== false || strpos($criteria->order, 'Project_Company') !== false || strpos($criteria->condition, 'Company_User2Company') !== false || strpos($criteria->condition, 'Task_Consultant') !== false;
     if ($together) {
         $models = Project::model()->with($with)->together()->findAll($criteria);
     } else {
         $models = Project::model()->with($with)->findAll($criteria);
     }
     // create resulting data array
     $data = array('page' => $pages->getCurrentPage() + 1, 'total' => $pages->getPageCount(), 'records' => $pages->getItemCount(), 'rows' => array());
     foreach ($models as $model) {
         $data['rows'][] = array('id' => $model->id, 'cell' => array(isset($model->allCompany[0]->id) ? CHtml::link(CHtml::encode($model->allCompany[0]->title), array('company/show', 'id' => $model->allCompany[0]->id)) : '', CHtml::encode($model->title), CHtml::encode($model->hourlyRate), CHtml::encode($model->getAttributeView('priority')), CHtml::encode(MDate::format($model->openDate, 'medium', null)), CHtml::encode(MDate::format($model->closeDate, 'medium', null)), CHtml::link('<span class="ui-icon ui-icon-zoomin"></span>', array('show', 'id' => $model->id), array('class' => 'w3-ig w3-link-icon w3-border-1px-transparent w3-first ui-corner-all', 'title' => Yii::t('link', 'Show'))) . CHtml::link('<span class="ui-icon ui-icon-pencil"></span>', array('update', 'id' => $model->id), array('class' => 'w3-ig w3-link-icon w3-border-1px-transparent w3-last ui-corner-all', 'title' => Yii::t('link', 'Edit')))));
     }
     $this->printJson($data);
 }
Example #20
0
	<div class="row">
		<?php echo $form->labelEx($model,'story_code'); ?>
		<?php echo $form->textField($model,'story_code',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'story_code'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'story_description'); ?>
		<?php echo $form->textArea($model, 'story_description', array('rows'=>15, 'cols'=>70, 'maxlength'=>1000))?>
		<?php echo $form->error($model,'story_description'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'story_project'); ?>
		<?php echo $form->dropDownList($model,'story_project',Project::model()->getProjects()); ?>
		<?php echo $form->error($model,'story_project'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'story_priority'); ?>
		<?php echo $form->textField($model,'story_priority'); ?>
		<?php echo $form->error($model,'story_priority'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'story_point'); ?>
		<?php echo $form->textField($model,'story_point'); ?>
		<?php echo $form->error($model,'story_point'); ?>
	</div>
Example #21
0
                    </div>


                <?php 
    }
}
?>
            
        </div>

    </div>
    <div id="tab4">
           <select class="filter-project-client">
        <option value="*">All Project</option>
        <?php 
foreach (Project::model()->findAll("status = 1") as $key) {
    ?>
          <option value="<?php 
    echo str_replace(" ", "_", $key->project_name);
    ?>
"><?php 
    echo $key->project_name;
    ?>
</option>
        <?php 
}
?>
      </select>
        <div class="container-client">
            <?php 
$sql = "\n                    SELECT mcd.id as id_mcd ,mch.id AS id, pm.name_file file\n                    FROM\n                    project_comment pm INNER JOIN  member_comment_head AS mch\n                    ON pm.id = mch.project_comment_id\n                    INNER JOIN\n                    member_comment_detail AS mcd\n                    ON mch.id = mcd.head_id\n                    and  mcd.status = 0\n                    GROUP BY mch.id\n                    ORDER BY mch.id DESC\n\n                    ";
Example #22
0
 public function actionUpdatepriority()
 {
     // echo "masuk ke update sttatus";
     // echo "update id ".$_GET['id'];
     if (Project::model()->updateByPk($_GET['id'], array('priority' => "{$_GET['nilai']}"))) {
         echo "sukses";
     } else {
         echo "id : " . $_REQUEST['id'];
         echo "nilai : " . $_REQUEST['nilai'];
     }
 }
Example #23
0
        echo $d[name];
        ?>
</option>
			<?php 
    }
    ?>
		</select>
		<img style="width:20px;display:none" src="<?php 
    echo Yii::app()->request->baseUrl;
    ?>
/img/setting.png" >
	</td>
	<td >
		<select  class="combo-s" style="display:inline">
			<?php 
    $status = Project::model()->findByPk($de[id])->status;
    foreach (Status::model()->findAll() as $d) {
        ?>
			<option <?php 
        if ($status == $d[id]) {
            echo "selected";
        }
        ?>
 value="<?php 
        echo $d[id];
        ?>
"><?php 
        echo $d[name];
        ?>
</option>
			<?php 
</label>
        </td>
        <td>
            <input type='text' id='project_friendly_name' maxlength="25" name='project_friendly_name'/>
        </td>
    </tr>
    <tr>
        <td style="text-align: right;">
            <label for='parent_project'><?php 
$clang->eT("Parent Project : ");
?>
</label>
        </td>
        <td>
            <?php 
$parent_project = Project::model()->findAll(array('condition' => "parent_project_id = '0'"));
$parent_project_list = CHtml::listData($parent_project, 'project_id', 'project_name');
echo CHtml::dropDownList('parent_project', '', $parent_project_list, array('prompt' => 'Select Parent Project'));
?>
        </td>
    </tr>
    <tr>
        <td style="text-align: right;">
            <label for='client'><?php 
$clang->eT("Client : ");
?>
</label>
        </td>
        <td>
            <?php 
$company = Contact::model()->findAll(array('condition' => "contact_type_id = '1'"));
</label>
        </td>
        <td>
            <input type='text' id='project_friendly_name' maxlength="25" name='project_friendly_name'/>
        </td>
    </tr>
    <tr>
        <td style="text-align: right;">
            <label for='parent_project'><?php 
$clang->eT("Parent Project : ");
?>
</label>
        </td>
        <td>
            <?php 
$parent_project = Project::model()->findAll(array('condition' => "parent_project_id = '0'", 'order' => 'project_id desc'));
$parent_project_list = array();
foreach ($parent_project as $val) {
    $parent_project_list[$val['project_id']] = $val['project_id'] . ' - ' . $val['project_name'];
}
//$parent_project_list = CHtml::listData($parent_project, 'project_id', 'project_name');
echo CHtml::dropDownList('parent_project', '', $parent_project_list, array('prompt' => 'Select Parent Project'));
?>
        </td>
    </tr>
    <tr>
        <td style="text-align: right;">
            <label for='client'><?php 
$clang->eT("Client : ");
?>
</label>
Example #26
0
		}

		</style>
		<form id="form-filter-progres">
				<div style="
					position: relative;
	        		top: 50px;
	        		" 
        		class="filter-progres">

					<label>
						<?php 
if (isset($_REQUEST['project_id']) && $_REQUEST['project_id'] != 'PROJECT NAME') {
    ?>
						<div class="label upload"><?php 
    echo Project::model()->findByPk($_REQUEST['project_id'])->project_name;
    ?>
</div>
						<?php 
} else {
    ?>
						<div class="label upload">LATEST UPLOAD</div>

						<?php 
}
?>
							<input type="hidden" name="r" value="land/userme">
							<select name="project_id" class="filter-progres-select">
								<option>PROJECT NAME</option>
								<?php 
foreach ($redbox as $key) {
Example #27
0
<?php

/* @var $this AccountInvitationController */
/* @var $model AccountInvitation */
/* @var $form CActiveForm */
$form = $this->beginWidget('CActiveForm', array('id' => 'issue-form', 'htmlOptions' => array('class' => 'well'), 'enableAjaxValidation' => false));
// list of projects user created
// can only invite to own project
$active_projects = array(0 => '') + Project::model()->getProjectsCreatedBy(Yii::app()->user->id, 'datasourceArray');
echo $form->errorSummary($model);
echo $form->label($model, 'account_invitation_to_email');
echo $form->textField($model, 'account_invitation_to_email');
echo $form->label($model, 'account_invitation_message');
echo $form->textArea($model, "account_invitation_message");
echo $form->label($model, 'account_invitation_project');
echo $form->dropDownList($model, 'account_invitation_project', $active_projects);
echo $form->label($model, 'account_invitation_type');
echo $form->checkbox($model, 'account_invitation_type');
echo CHtml::submitButton($model->isNewRecord ? 'Invite' : 'Save', array('data-theme' => 'b'));
$this->endWidget();
                <th><?php 
    $clang->eT("Project");
    ?>
</th>
                <th><?php 
    $clang->eT("Sending");
    ?>
</th>
            </tr>
        </thead>
        <tbody>
            <?php 
    for ($i = 0; $i < count($usr_arr); $i++) {
        $usr = $usr_arr[$i];
        if ($usr['project_id'] == $project_id) {
            $project = Project::model()->findAllByPk($usr['project_id']);
            ?>
                    <tr>

                        <td style="padding:3px;">
                            <?php 
            echo CHtml::form(array("admin/pquery/sa/mod/prjid/{$project_id}/vid/{$vendor_project_id}"), 'post');
            ?>
            
                            <input type='image' src='<?php 
            echo $imageurl;
            ?>
edit_16.png' alt='<?php 
            $clang->eT("Edit this Query");
            ?>
' />
Example #29
0
<?php

$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'employee-to-project-form', 'enableAjaxValidation' => false, 'enableClientValidation' => true, 'type' => 'vertical', 'htmlOptions' => array('class' => 'well'), 'inlineErrors' => true));
$projectList = $model->isNewRecord ? $projectList = array_diff(CHtml::listData(Project::model()->findAll(), 'id', 'title'), CHtml::listData($model->employee->projects, 'id', 'title')) : CHtml::listData(Project::model()->findAll(), 'id', 'title');
?>

    <div class="alert alert-info">
        <?php 
echo Yii::t('TeamModule.team', 'Поля, отмеченные');
?>
        <span class="required">*</span>
        <?php 
echo Yii::t('TeamModule.team', 'обязательны.');
?>
    </div>

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

    <div class="row-fluid control-group <?php 
echo $model->hasErrors('project_id') ? 'error' : '';
?>
">
        <?php 
echo $form->dropDownListRow($model, 'project_id', $projectList, array('empty' => 'Выберите проект'));
?>
    </div>
    <div class='row-fluid control-group <?php 
echo $model->hasErrors("status") ? "error" : "";
?>
Example #30
0
	<?php 
$model = ProjectComment::model()->findByPk($id);
// $idh = ProjectComment::model()->findByPk($id)->head_project_id;
$head = ProjectCommentHead::model()->findByPk($model->head_project_id);
$project = Project::model()->findByPk($head->project_id);
$project_name = Project::model()->findByPk(ProjectCommentHead::model()->findByPk($model->head_project_id)->project_id)->project_name;
echo $idh;
?>
    <img class="img-close" src="<?php 
echo Yii::app()->request->baseUrl;
?>
/img/close.png">
    <center>
      <h1>
        DETAIL PROGRES IMAGE
      </h1>
    </center>
    <table>
      <tr>
          <td style="width:30%">Name </td>
          <td>:</td>
          <td style="width:70%">
            <input maxlength="30" img_id="<?php 
echo $model->id;
?>
" value="<?php 
echo $model->alias_name;
?>
" type="text" id="input-edit-image">
          <?php 
if ($model->alias_name == '') {