Commit 2318f5f64d0fed0af209acb751417dfe2695f9d3
1 parent
d5506105
Exists in
2.8
and in
6 other branches
PSR
Showing
1 changed file
with
146 additions
and
184 deletions
Show diff stats
ieducar/intranet/educar_matricula_ocorrencia_disciplinar_cad.php
1 | 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 | - * ctima@itajai.sc.gov.br * | |
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 | 2 | require_once 'include/clsBase.inc.php'; |
28 | 3 | require_once 'include/clsCadastro.inc.php'; |
29 | 4 | require_once 'include/clsBanco.inc.php'; |
30 | 5 | require_once 'include/pmieducar/geral.inc.php'; |
31 | 6 | require_once 'Portabilis/Date/Utils.php'; |
32 | 7 | require_once 'modules/Api/Model/ApiExternaController.php'; |
33 | -require_once ("include/modules/clsModulesAuditoriaGeral.inc.php"); | |
8 | +require_once('include/modules/clsModulesAuditoriaGeral.inc.php'); | |
34 | 9 | |
35 | 10 | class clsIndexBase extends clsBase |
36 | 11 | { |
37 | - function Formular() | |
12 | + public function Formular() | |
38 | 13 | { |
39 | - $this->SetTitulo( "{$this->_instituicao} i-Educar - Ocorrência Disciplinar" ); | |
40 | - $this->processoAp = "578"; | |
41 | - $this->addEstilo("localizacaoSistema"); | |
14 | + $this->SetTitulo("{$this->_instituicao} i-Educar - Ocorrência Disciplinar"); | |
15 | + $this->processoAp = '578'; | |
16 | + $this->addEstilo('localizacaoSistema'); | |
42 | 17 | } |
43 | 18 | } |
44 | 19 | |
... | ... | @@ -49,70 +24,67 @@ class indice extends clsCadastro |
49 | 24 | * |
50 | 25 | * @var int |
51 | 26 | */ |
52 | - var $pessoa_logada; | |
27 | + public $pessoa_logada; | |
53 | 28 | |
54 | - var $cod_ocorrencia_disciplinar; | |
55 | - var $ref_cod_matricula; | |
56 | - var $ref_cod_tipo_ocorrencia_disciplinar; | |
57 | - var $sequencial; | |
58 | - var $ref_usuario_exc; | |
59 | - var $ref_usuario_cad; | |
60 | - var $observacao; | |
61 | - var $data_exclusao; | |
62 | - var $ativo; | |
29 | + public $cod_ocorrencia_disciplinar; | |
30 | + public $ref_cod_matricula; | |
31 | + public $ref_cod_tipo_ocorrencia_disciplinar; | |
32 | + public $sequencial; | |
33 | + public $ref_usuario_exc; | |
34 | + public $ref_usuario_cad; | |
35 | + public $observacao; | |
36 | + public $data_exclusao; | |
37 | + public $ativo; | |
63 | 38 | |
64 | - var $data_cadastro; | |
65 | - var $ref_cod_instituicao; | |
66 | - var $ref_cod_escola; | |
39 | + public $data_cadastro; | |
40 | + public $ref_cod_instituicao; | |
41 | + public $ref_cod_escola; | |
67 | 42 | |
68 | - var $hora_cadastro; | |
43 | + public $hora_cadastro; | |
69 | 44 | |
70 | - function Inicializar() | |
45 | + public function Inicializar() | |
71 | 46 | { |
72 | - $retorno = "Novo"; | |
47 | + $retorno = 'Novo'; | |
73 | 48 | |
74 | - | |
75 | - $this->ref_cod_matricula = $_GET["ref_cod_matricula"]; | |
49 | + $this->ref_cod_matricula = $_GET['ref_cod_matricula']; | |
76 | 50 | |
77 | 51 | $obj_permissoes = new clsPermissoes(); |
78 | 52 | |
79 | - $obj_permissoes->permissao_cadastra( 21145, $this->pessoa_logada, 7, "educar_matricula_lst.php" ); | |
53 | + $obj_permissoes->permissao_cadastra(21145, $this->pessoa_logada, 7, 'educar_matricula_lst.php'); | |
80 | 54 | |
81 | 55 | $data = getdate(); |
82 | 56 | |
83 | - $data['mday'] = sprintf("%02d",$data['mday']); | |
84 | - $data['mon'] = sprintf("%02d",$data['mon']); | |
85 | - $data['hours'] = sprintf("%02d",$data['hours']); | |
86 | - $data['minutes'] = sprintf("%02d",$data['minutes']); | |
57 | + $data['mday'] = sprintf('%02d', $data['mday']); | |
58 | + $data['mon'] = sprintf('%02d', $data['mon']); | |
59 | + $data['hours'] = sprintf('%02d', $data['hours']); | |
60 | + $data['minutes'] = sprintf('%02d', $data['minutes']); | |
87 | 61 | |
88 | 62 | $this->data_cadastro = "{$data['mday']}/{$data['mon']}/{$data['year']}"; |
89 | 63 | $this->hora_cadastro = "{$data['hours']}:{$data['minutes']}"; |
90 | 64 | |
91 | - $this->sequencial=$_GET["sequencial"]; | |
92 | - $this->ref_cod_matricula=$_GET["ref_cod_matricula"]; | |
93 | - $this->ref_cod_tipo_ocorrencia_disciplinar=$_GET["ref_cod_tipo_ocorrencia_disciplinar"]; | |
65 | + $this->sequencial = $_GET['sequencial']; | |
66 | + $this->ref_cod_matricula = $_GET['ref_cod_matricula']; | |
67 | + $this->ref_cod_tipo_ocorrencia_disciplinar = $_GET['ref_cod_tipo_ocorrencia_disciplinar']; | |
94 | 68 | |
95 | 69 | if (is_numeric($this->ref_cod_matricula) && |
96 | 70 | is_numeric($this->ref_cod_tipo_ocorrencia_disciplinar) && |
97 | - is_numeric($this->sequencial)) | |
98 | - { | |
71 | + is_numeric($this->sequencial)) { | |
99 | 72 | $obj = new clsPmieducarMatriculaOcorrenciaDisciplinar($this->ref_cod_matricula, $this->ref_cod_tipo_ocorrencia_disciplinar, $this->sequencial); |
100 | 73 | $registro = $obj->detalhe(); |
101 | - if ($registro) | |
102 | - { | |
103 | - foreach( $registro AS $campo => $val ) // passa todos os valores obtidos no registro para atributos do objeto | |
74 | + if ($registro) { | |
75 | + foreach ($registro as $campo => $val) { // passa todos os valores obtidos no registro para atributos do objeto | |
104 | 76 | $this->$campo = $val; |
77 | + } | |
105 | 78 | |
106 | - $this->hora_cadastro = dataFromPgToBr($this->data_cadastro,'H:i'); | |
79 | + $this->hora_cadastro = dataFromPgToBr($this->data_cadastro, 'H:i'); | |
107 | 80 | $this->data_cadastro = dataFromPgToBr($this->data_cadastro); |
108 | 81 | |
109 | - $obj_permissoes = new clsPermissoes(); | |
110 | - if( $obj_permissoes->permissao_excluir( 578, $this->pessoa_logada, 7 ) ) | |
111 | - { | |
112 | - $this->fexcluir = true; | |
113 | - } | |
82 | + $obj_permissoes = new clsPermissoes(); | |
83 | + if ($obj_permissoes->permissao_excluir(578, $this->pessoa_logada, 7)) { | |
84 | + $this->fexcluir = true; | |
85 | + } | |
114 | 86 | |
115 | - $retorno = "Editar"; | |
87 | + $retorno = 'Editar'; | |
116 | 88 | } |
117 | 89 | } |
118 | 90 | |
... | ... | @@ -124,75 +96,73 @@ class indice extends clsCadastro |
124 | 96 | $det_escola = $obj_escola->detalhe(); |
125 | 97 | $this->ref_cod_instituicao = $det_escola['ref_cod_instituicao']; |
126 | 98 | |
127 | - $this->url_cancelar = ($retorno == "Editar") ? "educar_matricula_ocorrencia_disciplinar_det.php?ref_cod_matricula={$registro["ref_cod_matricula"]}&ref_cod_tipo_ocorrencia_disciplinar={$registro["ref_cod_tipo_ocorrencia_disciplinar"]}&sequencial={$registro["sequencial"]}" : "educar_matricula_ocorrencia_disciplinar_lst.php?ref_cod_matricula={$this->ref_cod_matricula}"; | |
99 | + $this->url_cancelar = ($retorno == 'Editar') ? "educar_matricula_ocorrencia_disciplinar_det.php?ref_cod_matricula={$registro['ref_cod_matricula']}&ref_cod_tipo_ocorrencia_disciplinar={$registro['ref_cod_tipo_ocorrencia_disciplinar']}&sequencial={$registro['sequencial']}" : "educar_matricula_ocorrencia_disciplinar_lst.php?ref_cod_matricula={$this->ref_cod_matricula}"; | |
128 | 100 | } |
129 | 101 | |
130 | 102 | $this->breadcrumb('Ocorrências disciplinares da matrícula', [ |
131 | 103 | url('intranet/educar_index.php') => 'Escola', |
132 | 104 | ]); |
133 | 105 | |
134 | - $this->nome_url_cancelar = "Cancelar"; | |
106 | + $this->nome_url_cancelar = 'Cancelar'; | |
135 | 107 | |
136 | 108 | return $retorno; |
137 | 109 | } |
138 | 110 | |
139 | - function Gerar() | |
111 | + public function Gerar() | |
140 | 112 | { |
141 | - if(is_numeric($this->ref_cod_matricula)) { | |
113 | + if (is_numeric($this->ref_cod_matricula)) { | |
142 | 114 | $obj_ref_cod_matricula = new clsPmieducarMatricula(); |
143 | 115 | $detalhe_aluno = $obj_ref_cod_matricula->lista($this->ref_cod_matricula); |
144 | - if($detalhe_aluno) | |
116 | + if ($detalhe_aluno) { | |
145 | 117 | $detalhe_aluno = array_shift($detalhe_aluno); |
118 | + } | |
146 | 119 | $obj_aluno = new clsPmieducarAluno(); |
147 | - $det_aluno = array_shift($det_aluno = $obj_aluno->lista($detalhe_aluno['ref_cod_aluno'],null,null,null,null,null,null,null,null,null,1)); | |
120 | + $det_aluno = array_shift($det_aluno = $obj_aluno->lista($detalhe_aluno['ref_cod_aluno'], null, null, null, null, null, null, null, null, null, 1)); | |
148 | 121 | |
149 | - $this->campoRotulo("nm_pessoa","Nome do Aluno",$det_aluno['nome_aluno']); | |
122 | + $this->campoRotulo('nm_pessoa', 'Nome do Aluno', $det_aluno['nome_aluno']); | |
150 | 123 | } else { |
151 | - $this->inputsHelper()->dynamic(array('ano', 'instituicao', 'escola')); | |
124 | + $this->inputsHelper()->dynamic(['ano', 'instituicao', 'escola']); | |
152 | 125 | // FIXME #parameters |
153 | 126 | $this->inputsHelper()->simpleSearchMatricula(null); |
154 | 127 | $this->inputsHelper()->hidden('somente_andamento'); |
155 | 128 | } |
156 | 129 | |
157 | 130 | // primary keys |
158 | - $this->campoOculto( "ref_cod_matricula", $this->ref_cod_matricula ); | |
159 | - $this->campoOculto( "ref_cod_tipo_ocorrencia_disciplinar", $this->ref_cod_tipo_ocorrencia_disciplinar ); | |
160 | - $this->campoOculto( "sequencial", $this->sequencial ); | |
161 | - $this->campoOculto( "cod_ocorrencia_disciplinar", $this->cod_ocorrencia_disciplinar); | |
131 | + $this->campoOculto('ref_cod_matricula', $this->ref_cod_matricula); | |
132 | + $this->campoOculto('ref_cod_tipo_ocorrencia_disciplinar', $this->ref_cod_tipo_ocorrencia_disciplinar); | |
133 | + $this->campoOculto('sequencial', $this->sequencial); | |
134 | + $this->campoOculto('cod_ocorrencia_disciplinar', $this->cod_ocorrencia_disciplinar); | |
162 | 135 | |
163 | - $this->campoData("data_cadastro","Data Atual",$this->data_cadastro,true); | |
164 | - $this->campoHora("hora_cadastro","Horas",$this->hora_cadastro,true); | |
136 | + $this->campoData('data_cadastro', 'Data Atual', $this->data_cadastro, true); | |
137 | + $this->campoHora('hora_cadastro', 'Horas', $this->hora_cadastro, true); | |
165 | 138 | |
166 | - $opcoes = array( "" => "Selecione" ); | |
139 | + $opcoes = ['' => 'Selecione']; | |
167 | 140 | |
168 | 141 | $objTemp = new clsPmieducarTipoOcorrenciaDisciplinar(); |
169 | - $lista = $objTemp->lista(null,null,null,null,null,null,null,null,null,null,1,$this->ref_cod_instituicao); | |
170 | - if ( is_array( $lista ) && count( $lista ) ) | |
171 | - { | |
172 | - foreach ( $lista as $registro ) | |
173 | - { | |
142 | + $lista = $objTemp->lista(null, null, null, null, null, null, null, null, null, null, 1, $this->ref_cod_instituicao); | |
143 | + if (is_array($lista) && count($lista)) { | |
144 | + foreach ($lista as $registro) { | |
174 | 145 | $opcoes["{$registro['cod_tipo_ocorrencia_disciplinar']}"] = "{$registro['nm_tipo']}"; |
175 | 146 | } |
176 | 147 | } |
177 | 148 | |
178 | - $this->campoLista( "ref_cod_tipo_ocorrencia_disciplinar", "Tipo Ocorrência Disciplinar", $opcoes, $this->ref_cod_tipo_ocorrencia_disciplinar ); | |
149 | + $this->campoLista('ref_cod_tipo_ocorrencia_disciplinar', 'Tipo Ocorrência Disciplinar', $opcoes, $this->ref_cod_tipo_ocorrencia_disciplinar); | |
179 | 150 | |
180 | 151 | // text |
181 | - $this->campoMemo( "observacao", "Observacão", $this->observacao, 60, 10, true ); | |
182 | - | |
183 | - $this->campoCheck("visivel_pais", | |
184 | - Portabilis_String_Utils::toLatin1("Visível aos pais"), | |
185 | - $this->visivel_pais, | |
186 | - Portabilis_String_Utils::toLatin1("Marque este campo, caso deseje que os pais do aluno possam visualizar tal ocorrência disciplinar.")); | |
187 | - | |
152 | + $this->campoMemo('observacao', 'Observacão', $this->observacao, 60, 10, true); | |
153 | + | |
154 | + $this->campoCheck( | |
155 | + 'visivel_pais', | |
156 | + Portabilis_String_Utils::toLatin1('Visível aos pais'), | |
157 | + $this->visivel_pais, | |
158 | + Portabilis_String_Utils::toLatin1('Marque este campo, caso deseje que os pais do aluno possam visualizar tal ocorrência disciplinar.') | |
159 | + ); | |
188 | 160 | } |
189 | 161 | |
190 | - function Novo() | |
162 | + public function Novo() | |
191 | 163 | { |
192 | - | |
193 | - | |
194 | 164 | $obj_permissoes = new clsPermissoes(); |
195 | - $obj_permissoes->permissao_cadastra( 578, $this->pessoa_logada, 7, "educar_matricula_ocorrencia_disciplinar_lst.php" ); | |
165 | + $obj_permissoes->permissao_cadastra(578, $this->pessoa_logada, 7, 'educar_matricula_ocorrencia_disciplinar_lst.php'); | |
196 | 166 | |
197 | 167 | $this->visivel_pais = is_null($this->visivel_pais) ? 0 : 1; |
198 | 168 | |
... | ... | @@ -200,54 +170,49 @@ class indice extends clsCadastro |
200 | 170 | |
201 | 171 | $this->ref_cod_matricula = is_numeric($this->ref_cod_matricula) ? $this->ref_cod_matricula : $this->getRequest()->matricula_id; |
202 | 172 | |
203 | - $obj_ref_cod_matricula = new clsPmieducarMatricula($this->ref_cod_matricula); | |
204 | - $detalhe_mat = $obj_ref_cod_matricula->detalhe(); | |
205 | - $this->ref_cod_instituicao = $detalhe_mat['ref_cod_instituicao']; | |
173 | + $obj_ref_cod_matricula = new clsPmieducarMatricula($this->ref_cod_matricula); | |
174 | + $detalhe_mat = $obj_ref_cod_matricula->detalhe(); | |
175 | + $this->ref_cod_instituicao = $detalhe_mat['ref_cod_instituicao']; | |
206 | 176 | |
207 | - $obj = new clsPmieducarMatriculaOcorrenciaDisciplinar( $this->ref_cod_matricula, $this->ref_cod_tipo_ocorrencia_disciplinar, null, $this->pessoa_logada, $this->pessoa_logada, $this->observacao, $this->getDataHoraCadastro(), $this->data_exclusao, $this->ativo, $this->visivel_pais); | |
177 | + $obj = new clsPmieducarMatriculaOcorrenciaDisciplinar($this->ref_cod_matricula, $this->ref_cod_tipo_ocorrencia_disciplinar, null, $this->pessoa_logada, $this->pessoa_logada, $this->observacao, $this->getDataHoraCadastro(), $this->data_exclusao, $this->ativo, $this->visivel_pais); | |
208 | 178 | $cod_ocorrencia_disciplinar = $obj->cadastra(); |
209 | - if( $cod_ocorrencia_disciplinar ) | |
210 | - { | |
211 | - | |
179 | + if ($cod_ocorrencia_disciplinar) { | |
212 | 180 | $ocorrenciaDisciplinar = new clsPmieducarMatriculaOcorrenciaDisciplinar(); |
213 | 181 | $ocorrenciaDisciplinar->cod_ocorrencia_disciplinar = $cod_ocorrencia_disciplinar; |
214 | 182 | |
215 | 183 | $ocorrenciaDisciplinar = $ocorrenciaDisciplinar->detalhe(); |
216 | 184 | |
217 | - $auditoria = new clsModulesAuditoriaGeral("matricula_ocorrencia_disciplinar", $this->pessoa_logada, $cod_ocorrencia_disciplinar); | |
185 | + $auditoria = new clsModulesAuditoriaGeral('matricula_ocorrencia_disciplinar', $this->pessoa_logada, $cod_ocorrencia_disciplinar); | |
218 | 186 | $auditoria->inclusao($ocorrenciaDisciplinar); |
219 | 187 | |
220 | - if(($this->visivel_pais) && ($this->possuiConfiguracaoNovoEducacao())){ | |
188 | + if (($this->visivel_pais) && ($this->possuiConfiguracaoNovoEducacao())) { | |
221 | 189 | $resposta = json_decode($this->enviaOcorrenciaNovoEducacao($cod_ocorrencia_disciplinar)); |
222 | 190 | |
223 | - if(is_array($resposta->errors)){ | |
224 | - echo Portabilis_String_Utils::toLatin1("Erro ao enviar ocorrencia disciplinar ao sistema externo: " . $resposta->errors[0]); | |
191 | + if (is_array($resposta->errors)) { | |
192 | + echo Portabilis_String_Utils::toLatin1('Erro ao enviar ocorrencia disciplinar ao sistema externo: ' . $resposta->errors[0]); | |
225 | 193 | die; |
226 | 194 | } |
227 | - | |
228 | 195 | } |
229 | - $this->mensagem .= "Cadastro efetuado com sucesso.<br>"; | |
196 | + $this->mensagem .= 'Cadastro efetuado com sucesso.<br>'; | |
230 | 197 | if ($voltaListagem) { |
231 | 198 | $this->simpleRedirect("educar_matricula_ocorrencia_disciplinar_lst.php?ref_cod_matricula={$this->ref_cod_matricula}"); |
232 | 199 | } else { |
233 | - echo "<script language='javascript' type='text/javascript'>alert('Cadastro efetuado com sucesso.');</script>"; | |
234 | - echo "<script language='javascript' type='text/javascript'>window.location.href='educar_matricula_ocorrencia_disciplinar_cad.php'</script>"; | |
200 | + echo '<script language=\'javascript\' type=\'text/javascript\'>alert(\'Cadastro efetuado com sucesso.\');</script>'; | |
201 | + echo '<script language=\'javascript\' type=\'text/javascript\'>window.location.href=\'educar_matricula_ocorrencia_disciplinar_cad.php\'</script>'; | |
235 | 202 | } |
236 | 203 | |
237 | 204 | return true; |
238 | 205 | } |
239 | 206 | |
240 | - $this->mensagem = "Cadastro não realizado.<br>"; | |
207 | + $this->mensagem = 'Cadastro não realizado.<br>'; | |
241 | 208 | |
242 | 209 | return false; |
243 | 210 | } |
244 | 211 | |
245 | - function Editar() | |
212 | + public function Editar() | |
246 | 213 | { |
247 | - | |
248 | - | |
249 | 214 | $obj_permissoes = new clsPermissoes(); |
250 | - $obj_permissoes->permissao_cadastra( 578, $this->pessoa_logada, 7, "educar_matricula_ocorrencia_disciplinar_lst.php" ); | |
215 | + $obj_permissoes->permissao_cadastra(578, $this->pessoa_logada, 7, 'educar_matricula_ocorrencia_disciplinar_lst.php'); | |
251 | 216 | |
252 | 217 | $ocorrenciaDisciplinar = new clsPmieducarMatriculaOcorrenciaDisciplinar(); |
253 | 218 | $ocorrenciaDisciplinar->cod_ocorrencia_disciplinar = $this->cod_ocorrencia_disciplinar; |
... | ... | @@ -262,31 +227,28 @@ class indice extends clsCadastro |
262 | 227 | $obj = new clsPmieducarMatriculaOcorrenciaDisciplinar($this->ref_cod_matricula, $this->ref_cod_tipo_ocorrencia_disciplinar, $this->sequencial, $this->pessoa_logada, $this->pessoa_logada, $this->observacao, $this->getDataHoraCadastro(), $this->data_exclusao, $this->ativo, $this->visivel_pais); |
263 | 228 | |
264 | 229 | $editou = $obj->edita(); |
265 | - if( $editou ) | |
266 | - { | |
230 | + if ($editou) { | |
267 | 231 | $ocorrenciaDisciplinarDetalheDepois = $ocorrenciaDisciplinar->detalhe(); |
268 | - $auditoria = new clsModulesAuditoriaGeral("matricula_ocorrencia_disciplinar", $this->pessoa_logada, $this->cod_ocorrencia_disciplinar); | |
232 | + $auditoria = new clsModulesAuditoriaGeral('matricula_ocorrencia_disciplinar', $this->pessoa_logada, $this->cod_ocorrencia_disciplinar); | |
269 | 233 | $auditoria->alteracao($ocorrenciaDisciplinarDetalheAntes, $ocorrenciaDisciplinarDetalheDepois); |
270 | 234 | |
271 | - $this->mensagem .= "Edição efetuada com sucesso.<br>"; | |
235 | + $this->mensagem .= 'Edição efetuada com sucesso.<br>'; | |
272 | 236 | if ($voltaListagem) { |
273 | 237 | $this->simpleRedirect("educar_matricula_ocorrencia_disciplinar_lst.php?ref_cod_matricula={$this->ref_cod_matricula}"); |
274 | 238 | } else { |
275 | - $this->simpleRedirect("educar_matricula_ocorrencia_disciplinar_cad.php"); | |
239 | + $this->simpleRedirect('educar_matricula_ocorrencia_disciplinar_cad.php'); | |
276 | 240 | } |
277 | 241 | } |
278 | 242 | |
279 | - $this->mensagem = "Edição não realizada.<br>"; | |
243 | + $this->mensagem = 'Edição não realizada.<br>'; | |
280 | 244 | |
281 | 245 | return false; |
282 | 246 | } |
283 | 247 | |
284 | - function Excluir() | |
248 | + public function Excluir() | |
285 | 249 | { |
286 | - | |
287 | - | |
288 | 250 | $obj_permissoes = new clsPermissoes(); |
289 | - $obj_permissoes->permissao_excluir( 578, $this->pessoa_logada, 7, "educar_matricula_ocorrencia_disciplinar_lst.php" ); | |
251 | + $obj_permissoes->permissao_excluir(578, $this->pessoa_logada, 7, 'educar_matricula_ocorrencia_disciplinar_lst.php'); | |
290 | 252 | |
291 | 253 | $ocorrenciaDisciplinar = new clsPmieducarMatriculaOcorrenciaDisciplinar(); |
292 | 254 | $ocorrenciaDisciplinar->cod_ocorrencia_disciplinar = $this->cod_ocorrencia_disciplinar; |
... | ... | @@ -295,70 +257,71 @@ class indice extends clsCadastro |
295 | 257 | $this->data_cadastro = Portabilis_Date_Utils::brToPgSQL($this->data_cadastro); |
296 | 258 | $obj = new clsPmieducarMatriculaOcorrenciaDisciplinar($this->ref_cod_matricula, $this->ref_cod_tipo_ocorrencia_disciplinar, $this->sequencial, $this->pessoa_logada, $this->pessoa_logada, $this->observacao, $this->data_cadastro, $this->data_exclusao, 0); |
297 | 259 | $excluiu = $obj->excluir(); |
298 | - if( $excluiu ) | |
299 | - { | |
300 | - $auditoria = new clsModulesAuditoriaGeral("matricula_ocorrencia_disciplinar", $this->pessoa_logada, $this->cod_ocorrencia_disciplinar); | |
260 | + if ($excluiu) { | |
261 | + $auditoria = new clsModulesAuditoriaGeral('matricula_ocorrencia_disciplinar', $this->pessoa_logada, $this->cod_ocorrencia_disciplinar); | |
301 | 262 | $auditoria->exclusao($ocorrenciaDisciplinar); |
302 | 263 | |
303 | - $this->mensagem .= "Exclusão efetuada com sucesso.<br>"; | |
264 | + $this->mensagem .= 'Exclusão efetuada com sucesso.<br>'; | |
304 | 265 | $this->simpleRedirect("educar_matricula_ocorrencia_disciplinar_lst.php?ref_cod_matricula={$this->ref_cod_matricula}"); |
305 | 266 | } |
306 | 267 | |
307 | - $this->mensagem = "Exclusão não realizada.<br>"; | |
268 | + $this->mensagem = 'Exclusão não realizada.<br>'; | |
308 | 269 | |
309 | 270 | return false; |
310 | 271 | } |
311 | 272 | |
312 | - protected function getDataHoraCadastro() { | |
313 | - return $this->data_cadastro = dataToBanco($this->data_cadastro) . " " . $this->hora_cadastro; | |
314 | - } | |
315 | - protected function enviaOcorrenciaNovoEducacao($cod_ocorrencia_disciplinar){ | |
316 | - | |
317 | - $tmp_obj = new clsPmieducarConfiguracoesGerais( $this->ref_cod_instituicao ); | |
318 | - $instituicao = $tmp_obj->detalhe(); | |
319 | - | |
320 | - $obj_tmp = new clsPmieducarMatricula($this->ref_cod_matricula); | |
321 | - $det_tmp = $obj_tmp->detalhe(); | |
322 | - $cod_aluno = $det_tmp["ref_cod_aluno"]; | |
323 | - | |
324 | - $cod_escola = $det_tmp["ref_ref_cod_escola"]; | |
325 | - | |
326 | - $obj_tmp = new clsPmieducarTipoOcorrenciaDisciplinar($this->ref_cod_tipo_ocorrencia_disciplinar); | |
327 | - $det_tmp = $obj_tmp->detalhe(); | |
328 | - | |
329 | - $tipo_ocorrencia = $det_tmp["nm_tipo"]; | |
330 | - | |
331 | - $params = [ | |
332 | - 'token' => config('legacy.apis.access_key'), | |
333 | - 'api_code' => $cod_ocorrencia_disciplinar, | |
334 | - 'student_code' => $cod_aluno, | |
335 | - 'description' => $this->observacao, | |
336 | - 'occurred_at' => $this->data_cadastro, | |
337 | - 'unity_code' => $cod_escola, | |
338 | - 'kind' => $tipo_ocorrencia, | |
339 | - ]; | |
340 | - | |
341 | - $requisicao = new ApiExternaController([ | |
342 | - 'url' => $instituicao['url_novo_educacao'], | |
343 | - 'recurso' => 'ocorrencias-disciplinares', | |
344 | - 'tipoRequisicao' => ApiExternaController::REQUISICAO_POST, | |
345 | - 'params' => $params, | |
346 | - 'token_header' => config('legacy.apis.educacao_token_header'), | |
347 | - 'token_key' => config('legacy.apis.educacao_token_key'), | |
348 | - ] | |
349 | - ); | |
350 | - | |
351 | - | |
352 | - return $requisicao->executaRequisicao(); | |
353 | - } | |
273 | + protected function getDataHoraCadastro() | |
274 | + { | |
275 | + return $this->data_cadastro = dataToBanco($this->data_cadastro) . ' ' . $this->hora_cadastro; | |
276 | + } | |
354 | 277 | |
355 | - protected function possuiConfiguracaoNovoEducacao(){ | |
356 | - $tmp_obj = new clsPmieducarConfiguracoesGerais( $this->ref_cod_instituicao ); | |
357 | - $instituicao = $tmp_obj->detalhe(); | |
278 | + protected function enviaOcorrenciaNovoEducacao($cod_ocorrencia_disciplinar) | |
279 | + { | |
280 | + $tmp_obj = new clsPmieducarConfiguracoesGerais($this->ref_cod_instituicao); | |
281 | + $instituicao = $tmp_obj->detalhe(); | |
282 | + | |
283 | + $obj_tmp = new clsPmieducarMatricula($this->ref_cod_matricula); | |
284 | + $det_tmp = $obj_tmp->detalhe(); | |
285 | + $cod_aluno = $det_tmp['ref_cod_aluno']; | |
286 | + | |
287 | + $cod_escola = $det_tmp['ref_ref_cod_escola']; | |
288 | + | |
289 | + $obj_tmp = new clsPmieducarTipoOcorrenciaDisciplinar($this->ref_cod_tipo_ocorrencia_disciplinar); | |
290 | + $det_tmp = $obj_tmp->detalhe(); | |
291 | + | |
292 | + $tipo_ocorrencia = $det_tmp['nm_tipo']; | |
293 | + | |
294 | + $params = [ | |
295 | + 'token' => config('legacy.apis.access_key'), | |
296 | + 'api_code' => $cod_ocorrencia_disciplinar, | |
297 | + 'student_code' => $cod_aluno, | |
298 | + 'description' => $this->observacao, | |
299 | + 'occurred_at' => $this->data_cadastro, | |
300 | + 'unity_code' => $cod_escola, | |
301 | + 'kind' => $tipo_ocorrencia, | |
302 | + ]; | |
303 | + | |
304 | + $requisicao = new ApiExternaController( | |
305 | + [ | |
306 | + 'url' => $instituicao['url_novo_educacao'], | |
307 | + 'recurso' => 'ocorrencias-disciplinares', | |
308 | + 'tipoRequisicao' => ApiExternaController::REQUISICAO_POST, | |
309 | + 'params' => $params, | |
310 | + 'token_header' => config('legacy.apis.educacao_token_header'), | |
311 | + 'token_key' => config('legacy.apis.educacao_token_key'), | |
312 | + ] | |
313 | + ); | |
314 | + | |
315 | + return $requisicao->executaRequisicao(); | |
316 | + } | |
358 | 317 | |
359 | - return strlen($instituicao['url_novo_educacao']) > 0; | |
360 | - } | |
318 | + protected function possuiConfiguracaoNovoEducacao() | |
319 | + { | |
320 | + $tmp_obj = new clsPmieducarConfiguracoesGerais($this->ref_cod_instituicao); | |
321 | + $instituicao = $tmp_obj->detalhe(); | |
361 | 322 | |
323 | + return strlen($instituicao['url_novo_educacao']) > 0; | |
324 | + } | |
362 | 325 | } |
363 | 326 | |
364 | 327 | // cria uma extensao da classe base |
... | ... | @@ -366,7 +329,6 @@ $pagina = new clsIndexBase(); |
366 | 329 | // cria o conteudo |
367 | 330 | $miolo = new indice(); |
368 | 331 | // adiciona o conteudo na clsBase |
369 | -$pagina->addForm( $miolo ); | |
332 | +$pagina->addForm($miolo); | |
370 | 333 | // gera o html |
371 | 334 | $pagina->MakeAll(); |
372 | -?> | ... | ... |