/** * * Cria uma verba para um projeto de uma determinada rubrica * @param integer $id - projeto vinculado */ public function actionCreate($id) { $model = new ProjetoVerba(); //@var Projeto projeto $projeto = Projeto::model()->findByPk($id); if ($projeto == null) { //Projeto inexistente throw new CHttpException('404'); } $model->cod_projeto = $id; $model->projeto = $projeto; if (isset($_POST['ProjetoVerba'])) { $model->attributes = $_POST['ProjetoVerba']; if (isset($_POST['ProjetoVerba']['rubricas'])) { $model->rubricas = $_POST['ProjetoVerba']['rubricas']; } if ($model->save()) { //Salva as rubricas da receita $this->saveRubricas($model->cod_verba, $model->rubricas); //Adiciona desembolso inicial $this->desembolsoInicial($model); //Redireciona para o projeto $this->redirect(array('view', 'id' => $model->cod_verba)); } } if (count($model->projeto->orcamentos) > 0) { $this->render('create', array('model' => $model, 'rubricas' => $this->getRubricas($model))); } else { $this->render('_alert_orcamentos', array('projeto' => $projeto)); } }
/** * Cria uma nova despesa * Oferece escolha de receita antes * @param integer $id Projeto.cod_projeto */ public function actionCreate($id) { $model = Projeto::model()->findByPk($id); if ($model == null) { throw new CHttpException(404); } $this->render('choose_receita', array('model' => $model)); }
/** * Edita um projeto * @param integer $id identificador do projeto */ public function actionUpdate($id) { $model = Projeto::model()->findByPk($id); if (!in_array(Yii::app()->user->name, $model->gt->getPermited())) { throw new CHttpException(400, 'Permition Denied'); } // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Projeto'])) { $model->attributes = $_POST['Projeto']; if ($model->save()) { $this->redirect(array('view', 'id' => $model->cod_projeto)); } } $this->render('/projeto/update', array('model' => $model)); }
<?php echo $form->errorSummary($model); ?> <?php if (!isset($model->cod_projeto)) { ?> <div class="input"> <?php echo $form->labelEx($model, 'cod_projeto'); ?> <?php $projetos["null"] = "Selecione um projeto"; ?> <?php $projetos = $projetos + CHtml::listData(Projeto::model()->findAll(array('order' => 'nome')), 'cod_projeto', 'nome'); ?> <?php echo $form->dropDownList($model, 'cod_projeto', $projetos); ?> <?php echo $form->error($model, 'cod_projeto'); ?> </div> <?php } ?> <div class="input"> <?php echo $form->labelEx($model, 'descricao');
<h1>Adicionar Projeto Atuante</h1> <div class="form"> <?php $form = $this->beginWidget('CActiveForm', array('id' => 'pessoa-form', 'enableAjaxValidation' => false)); ?> <?php echo $form->errorSummary($model); ?> <div class="row"> <?php $projetos = Projeto::model()->findAll(array('order' => 'nome')); ?> <?php echo $form->dropDownList($model, 'cod_projeto', array("NULL" => "Selecione um Projeto") + CHtml::listData($projetos, 'cod_projeto', 'nome')); ?> <?php echo $form->error($model, 'cod_projeto'); ?> </div> <div class="row buttons"> <?php echo CHtml::submitButton($model->isNewRecord ? 'Adicionar' : 'Salvar'); ?> </div>
/** * @param $id - Identificador de uma Pessoa */ public static function findAllOfUser($id = null) { $criteria = new CDbCriteria(); if ($id == null) { $id = Yii::app()->user->getId(); } $criteria->with = array('pessoas'); $criteria->together = true; $criteria->order = "situacao, t.nome"; $criteria->addCondition('pessoas.cod_pessoa = :cod_pessoa OR t.cod_pos_grad = :cod_pessoa OR t.cod_grad = :cod_pessoa OR t.cod_professor = :cod_pessoa', 'AND'); $criteria->params = array('cod_pessoa' => $id); return Projeto::model()->findAll($criteria); }
/** * Edita um projeto * @param integer $id identificador do projeto */ public function actionUpdateProjeto($id) { $model = Projeto::model()->findByPk($id); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Projeto'])) { $model->attributes = $_POST['Projeto']; if ($model->save()) { $this->redirect(array('view', 'id' => $model->cod_gt)); } } $this->render('/projeto/update', array('model' => $model)); }
/** * Renderiza parcialmente as despesas de um projeto */ public function actionAjaxDespesas($projeto, $rubrica) { $criteria = new CDbCriteria(); $criteria->compare('cod_rubrica', $rubrica); $criteria->compare('cod_projeto', $projeto); $despesas = ProjetoDespesa::model()->findAll($criteria); $proj = Projeto::model()->findByPk($projeto); if ($proj == null || $rubrica == null) { throw new ChttpException(404); } $this->layout = false; $this->render('/projeto/financeiro/_despesas', array('despesas' => $despesas, 'projeto' => $proj)); }
<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array('name' => 'termino', 'value' => isset($termino) ? $termino : null, 'language' => 'pt-BR', 'options' => array('showAnim' => 'drop'), 'htmlOptions' => array('style' => 'height:15px;'))); ?> <label><b>Término</b></label> </div> <br> <div class="input"> <?php echo CHtml::dropDownList('dropDownCategoria', $categoria, CHtml::listData(AtividadeCategoria::model()->findAll(array('order' => 'nome', 'condition' => 'cod_categoria_pai = cod_categoria')), 'cod_categoria', 'nome'), array('prompt' => 'Escolha uma Categoria')); ?> </div> <br> <div class="input"> <?php echo CHtml::dropDownList('dropDownProjeto', $projeto, CHtml::listData(Projeto::model()->findAll(array('order' => 'nome')), 'cod_projeto', 'nome'), array('prompt' => "Escolha um Projeto")); ?> </div> <div class="input"> <?php echo CHtml::checkBox('checkBoxFinalizado', $finalizado); ?> <b> Mostrar Somente Atividades Finalizadas</b> </div> <br> <?php echo CHtml::submitButton('Limpar', array('id' => 'btnLimpar', 'submit' => 'atividade')); ?> <?php
public function actionCoordenadores() { $projetos = Projeto::model()->findAll(); foreach ($projetos as $p) { if ($p->save()) { echo $p->nome . " foi salvo com sucesso<br>"; } } Yii::app()->end(); }
<?php $this->renderPartial("/projeto/_detalhe_pagamento", array('pagamento' => $bolsa)); ?> <!-- Nome da Bolsa --> <?php $categoria = $bolsa->categoria; ?> <br> <!-- Informações da Bolsa --> <b> <?php echo CHtml::link(CHtml::encode($categoria), array('/pessoafinanceiro/view', 'id' => $bolsa->cod_financeiro)); ?> </b> <?php $projetoVinculado = Projeto::model()->findByPk($bolsa->projeto_vinculado); if (is_object($projetoVinculado)) { ?> <br> <ul> <?php $fontePagadora = FontePagadora::model()->findByPk($bolsa->cod_fonte_pagadora)->nome; ?> <li><b>Projeto Vinculado: </b><?php echo CHtml::link(CHtml::encode($projetoVinculado->nome), array('/projeto/view', 'id' => $bolsa->projeto_vinculado)); ?> </li> <li><b>Fonte Pagadora: </b><?php echo $fontePagadora; ?> </li>
url += '&finalizado=0'; location.href = url; } </script> <?php $this->breadcrumbs = array('Atividades'); $this->menu = array(array('label' => 'Adicionar Atividade', 'url' => array('create')), array('label' => 'Gerenciar Atividades', 'url' => array('admin'))); ?> <h1>Atividades</h1> <?php echo CHtml::dropDownList('dropDownProjeto', $projeto, CHtml::listData(Projeto::model()->findAll(array('order' => 'nome')), 'cod_projeto', 'nome'), array('prompt' => "Selecione um Projeto", 'onchange' => 'filtraAtividade();')); ?> <?php echo CHtml::dropDownList('dropDownPessoa', $pessoa, CHtml::listData(Pessoa::model()->findAll(array('order' => 'nome')), 'cod_pessoa', 'nome'), array('prompt' => "Selecione uma Pessoa", 'onchange' => 'filtraAtividade();')); ?> <?php echo CHtml::dropDownList('dropDownCategoria', $categoria, CHtml::listData(AtividadeCategoria::model()->findAll(array('order' => 'nome', 'condition' => 'cod_categoria_pai = cod_categoria')), 'cod_categoria', 'nome'), array('prompt' => 'Selecione uma Categoria', 'onchange' => 'filtraAtividade();')); ?> <br> <?php echo CHtml::checkBox('checkBoxFinalizado', $finalizado, array('onchange' => 'filtraAtividade();')); ?> <b> Mostrar Atividades Finalizadas</b> <?php //echo CHtml::button('Filtrar',array('onclick'=>'filtraAtividade()')); ?>
<div class="input"> <?php echo $form->labelEx($model,'turnos_trabalho'); ?> <?php echo $form->textField($model,'turnos_trabalho'); ?> <?php echo $form->error($model,'turnos_trabalho'); ?> </div> */ ?> <div class="input"> <?php echo $form->labelEx($model, 'projetos'); ?> <?php if (Sipesq::getPermition('projeto.informacoes')) { ?> <?php echo $form->listBox($model, 'projetos', CHtml::listData(Projeto::model()->findAll(array('order' => 'nome')), 'cod_projeto', 'nome', 'categoria.nome'), array("multiple" => "multiple", "size" => "15", "class" => "input-xxlarge")); ?> <?php } else { ?> <?php echo $form->listBox($model, 'projetos', CHtml::listData(Projeto::findAllOfUser(), 'cod_projeto', 'nome', 'categoria.nome'), array("multiple" => "multiple", "size" => "15", "class" => "input-xxlarge")); ?> <?php } ?> <?php echo $form->error($model, 'projetos'); ?> <div class="hint">Segure a tecla <b>CTRL</b> para selecionar mais de um projeto.</div><br> </div>
$page = "info"; if (isset($_GET['p'])) { $page = $_GET['p']; } Yii::app()->clientScript->registerScript('tab-menu', "\n\n\t\t\$('document').ready(\n\t\t\tfunction(){\n\t\t\tvar secao = '#{$page}';\n\t\t\t\t\$('.tab').hide();\n\t\t\t\t\$(secao).parent().show('fast');\n\t\t\t\t\$('#menu-tab a').removeClass('selected'); \n\t\t\t\treturn false;\n\t\t\t}\n\t\t);\n\n\t\t\$('#menu-tab a').click(\n\t\t\tfunction(){\n\t\t\t \$('.tab').hide();\n\t\t\t \$(\$(this).attr('name')).parent().show('fast');\n\t\t\t \$('#menu-tab a').removeClass('selected'); \n\t\t\t \$(this).addClass('selected');\n\t\t\t return false;\n\t\t\t});\n\t\t\t\n\t\t\$('#menu-tab a').hover(\n\t\t\tfunction(){\n\t\t\t \$(this).addClass('hover');\n\t\t\t return false;\n\t\t\t}, \n\t\t\tfunction(){\n\t\t\t \$(this).removeClass('hover');\n\t\t\t return false;\n\t\t\t}\n\t\t\t);\n\n\t\t\$('#lnkAtividades').click(\n\t\t\tfunction(){\n\t\t\t\t\$('#tabAtividades').html('Carregando Atividades...');\n\t\t\t\t\$('#tabAtividades').load('/portalcegov/sipesq/index.php/projeto/tabAtividades/' + cod_projeto);\n\n\t\t\t}\n\t\t);\t\n\t\t\n"); ?> <h1><?php echo $model->nome; ?> </h1> <?php if (Sipesq::isSupport()) { ?> <?php echo CHtml::dropDownList('dropDownProjeto', $_GET['id'], CHtml::listData(Projeto::model()->findAll(array('order' => 'nome')), 'cod_projeto', 'nome'), array('prompt' => "Selecione um projeto", 'onchange' => 'filtraProjeto();', 'class' => 'input-xxlarge')); ?> <br> <?php } else { ?> <?php echo CHtml::dropDownList('dropDownProjeto', $_GET['id'], CHtml::listData(Projeto::findAllOfUser(), 'cod_projeto', 'nome'), array('prompt' => "Selecione um projeto", 'onchange' => 'filtraProjeto();', 'class' => 'input-xxlarge')); ?> <br> <?php } ?> <ul id="menu-tab"> <li><a name="#info" id="lnkInfo" href="#">Informações Gerais</a></li> <?php
/** * 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 loadProjeto($id) { $model = Projeto::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<?php echo $form->textField($model, 'cartao_ufrgs'); ?> <?php echo $form->error($model, 'cartao_ufrgs'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'projetos_atuante'); ?> <div class="checkboxlist"> <?php echo $form->listBox($model, 'projetos_atuante', CHtml::listData(Projeto::model()->findAll(array('order' => 'nome')), 'cod_projeto', 'nome'), array("multiple" => "multiple", "size" => "10")); ?> </div> </div> <div class="hint">Segure a tecla <b>CTRL</b> para selecionar mais de um projeto.</div><br> <div class="row"> <?php echo $form->labelEx($model, 'email'); ?> <?php echo $form->textField($model, 'email'); ?> <?php echo $form->error($model, 'email'); ?>
<?php echo $form->labelEx($model, 'categoria'); ?> <?php echo $form->textField($model, 'categoria'); ?> <?php echo $form->error($model, 'categoria'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'projeto_vinculado'); ?> <?php echo $form->dropDownList($model, 'projeto_vinculado', CHtml::listData(Projeto::model()->findAll(array('order' => 'nome')), 'cod_projeto', 'nome')); ?> <?php echo $form->error($model, 'projeto_vinculado'); ?> </div> <div class="row buttons"> <?php echo CHtml::submitButton($model->isNewRecord ? 'Adicionar' : 'Salvar'); ?> </div> <?php $this->endWidget(); ?>
/** * * Retorna os projetos que acabam em 6 meses */ public static function getLasts() { $criteria = new CDbCriteria(); $dataLimite = date("d/m/Y", mktime(0, 0, 0, date("m") + 6, date("d"), date("Y"))); $dataAtual = date("d/m/Y"); $criteria->addCondition("t.data_fim <= '{$dataLimite}'", 'AND'); $criteria->addCondition("t.data_fim >= '{$dataAtual}'", 'AND'); $criteria->order = 't.data_fim DESC, t.nome ASC'; return Projeto::model()->findALL($criteria); }
echo $form->labelEx($model, 'nro_patrimonio'); ?> <?php echo $form->textField($model, 'nro_patrimonio'); ?> <?php echo $form->error($model, 'nro_patrimonio'); ?> </div> <div class="input"> <?php echo $form->labelEx($model, 'cod_projeto'); ?> <?php echo $form->dropDownList($model, 'cod_projeto', CHtml::listData(Projeto::model()->findAll(array('order' => 'nome')), 'cod_projeto', 'nome'), array('empty' => '-- Selecione um projeto --')); ?> <?php echo $form->error($model, 'cod_projeto'); ?> </div> <div class="input"> <?php echo $form->labelEx($model, 'valor'); ?> <?php echo $form->textField($model, 'valor', array('onkeyup' => 'formataValor(this);')); ?> <?php echo $form->error($model, 'valor');
$header = "<div class=\"alert alert-danger\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>"; $footer = "</div>"; echo $form->errorSummary($model, $header, $footer); ?> <?php if (Sipesq::isSupport()) { ?> <div class="input"> <?php echo $form->labelEx($model, 'cod_projeto'); ?> <?php echo $form->dropDownList($model, 'cod_projeto', CHtml::listData(Projeto::model()->findAll(array('order' => 'nome')), 'cod_projeto', 'nome', 'situacao_text')); ?> <?php echo $form->error($model, 'cod_projeto'); ?> </div> <?php } ?> <div class="input"> <?php echo $form->labelEx($model, 'nome'); ?> <?php echo $form->textField($model, 'nome');