Passed
Pull Request — master (#457)
by Eder
13:02
created

ieducar/intranet/acoes_acao_destaque.php (3 issues)

Labels
Severity
1
<?php
2
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3
    *                                                                        *
4
    *   @author Prefeitura Municipal de Itajaí                               *
5
    *   @updated 29/03/2007                                                  *
6
    *   Pacote: i-PLB Software Público Livre e Brasileiro                    *
7
    *                                                                        *
8
    *   Copyright (C) 2006  PMI - Prefeitura Municipal de Itajaí             *
9
    *                       [email protected]                           *
10
    *                                                                        *
11
    *   Este  programa  é  software livre, você pode redistribuí-lo e/ou     *
12
    *   modificá-lo sob os termos da Licença Pública Geral GNU, conforme     *
13
    *   publicada pela Free  Software  Foundation,  tanto  a versão 2 da     *
14
    *   Licença   como  (a  seu  critério)  qualquer  versão  mais  nova.    *
15
    *                                                                        *
16
    *   Este programa  é distribuído na expectativa de ser útil, mas SEM     *
17
    *   QUALQUER GARANTIA. Sem mesmo a garantia implícita de COMERCIALI-     *
18
    *   ZAÇÃO  ou  de ADEQUAÇÃO A QUALQUER PROPÓSITO EM PARTICULAR. Con-     *
19
    *   sulte  a  Licença  Pública  Geral  GNU para obter mais detalhes.     *
20
    *                                                                        *
21
    *   Você  deve  ter  recebido uma cópia da Licença Pública Geral GNU     *
22
    *   junto  com  este  programa. Se não, escreva para a Free Software     *
23
    *   Foundation,  Inc.,  59  Temple  Place,  Suite  330,  Boston,  MA     *
24
    *   02111-1307, USA.                                                     *
25
    *                                                                        *
26
    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
27
$desvio_diretorio = "";
28
require_once ("include/clsBase.inc.php");
29
require_once ("include/clsCadastro.inc.php");
30
require_once("include/pmiacoes/geral.inc.php");
31
require_once( "include/Geral.inc.php" );
32
33
class clsIndex extends clsBase
34
{
35
    function Formular()
36
    {
37
        $this->renderMenu = false;
38
        $this->renderMenuSuspenso = false;
39
        $this->SetTitulo( "{$this->_instituicao} Sistema de Cadastro de A&ccedil;&oatilde;es do Governo - Categorias!" );
40
        $this->processoAp = "551";
41
    }
42
}
43
44
class indice extends clsCadastro
45
{
46
    var $pessoa_logada;
47
    var $cod_acao_governo;
48
    var $categoria;
49
        
50
    function Inicializar()
51
    {
52
        
53
        $retorno = "Novo";
54
        @session_start();
55
        $this->pessoa_logada = $_SESSION['id_pessoa'];
56
        
57
        $this->cod_acao_governo = $_GET['cod_acao_governo'];
58
        if(isset($_GET['cod_acao_governo']) && isset($_GET['destaque']))
59
        {
60
61
            if( is_numeric($_GET['destaque']) && $this->permiteEditar())
62
            {
63
                $obj_acao = new clsPmiacoesAcaoGoverno($this->cod_acao_governo,null,null,null,null,null,null,$_GET['destaque']);
64
                $obj_acao->edita();
65
                header("location: acoes_acao_det.php?cod_acao_governo={$this->cod_acao_governo}&display={$_GET["display"]}");
66
                die;
67
                    
68
            }
69
        }   
70
            
71
        @session_write_close();
0 ignored issues
show
Are you sure the usage of session_write_close() is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
72
        
73
        echo "<script>if(window.parent == window)window.location = \"acoes_acao_lst.php\"; else window.close();</script>";
74
        die;
75
        
76
            
77
78
        return $retorno;
79
    }
80
81
    function Gerar()
82
    {
83
        die;
84
    }
85
86
    function Novo() 
87
    {
88
        return false;
89
    }
90
91
    function Editar() 
92
    {
93
94
        return false;
95
    }
96
97
    function Excluir()
98
    {
99
    
100
        return false;
101
    }
102
    
103
    function permiteEditar()
104
    {
105
        $retorno = false;
106
    
107
        $obj_funcionario = new clsFuncionario($this->pessoa_logada);
108
        $detalhe_func = $obj_funcionario->detalhe();
109
        $setor_funcionario = $detalhe_func["ref_cod_setor_new"];
110
        
111
        //*
112
        $obj = new clsSetor();
113
        $setor_pai = array_shift(array_reverse($obj->getNiveis($setor_funcionario)));
0 ignored issues
show
array_reverse($obj->getN...is($setor_funcionario)) cannot be passed to array_shift() as the parameter $array expects a reference. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

113
        $setor_pai = array_shift(/** @scrutinizer ignore-type */ array_reverse($obj->getNiveis($setor_funcionario)));
Loading history...
114
        //*
115
        
116
        $obj_secretaria_responsavel = new clsPmiacoesSecretariaResponsavel($setor_pai);
117
        $obj_secretaria_responsavel_det = $obj_secretaria_responsavel->detalhe();
118
119
        $obj_acao = new clsPmiacoesAcaoGoverno($this->cod_acao_governo);
120
        $obj_acao_det = $obj_acao->detalhe();
121
        $status = $obj_acao_det["status_acao"];
122
        
123
        
124
        //**
125
            $func_cad = $obj_acao_det["ref_funcionario_cad"];   
126
            $obj_funcionario = new clsFuncionario($func_cad);
127
            $detalhe_func = $obj_funcionario->detalhe();
128
            $setor_cad = $detalhe_func["ref_cod_setor_new"];            
129
            $setor_cad = array_shift(array_reverse($obj->getNiveis($setor_cad)));
0 ignored issues
show
array_reverse($obj->getNiveis($setor_cad)) cannot be passed to array_shift() as the parameter $array expects a reference. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

129
            $setor_cad = array_shift(/** @scrutinizer ignore-type */ array_reverse($obj->getNiveis($setor_cad)));
Loading history...
130
        //**
131
        
132
        //isSecom = $setor_pai == 4327 ? true : false;
133
        $retorno = ($obj_secretaria_responsavel_det != false )? true : false;   
134
        return $retorno;
135
    }       
136
}
137
138
$pagina = new clsIndex();
139
$miolo = new indice();
140
$pagina->addForm( $miolo );
141
$pagina->MakeAll();
142
?>
143