Initial import.
[siap.git] / _config / forms / FormOrgao.php
CommitLineData
696f20d5
MS
1<?\r
2class FormOrgao extends Form {\r
3 function FormOrgao() {\r
4 parent::Form("sis_orgao");\r
5 $this->page_size = 50;\r
6 // global $profile;\r
7 // $this->flags = $profile->getFlags();\r
8 }\r
9 \r
10 function configFields() {\r
11 global $profile;\r
12 \r
13 $f = $this->newField("hidden", array("id_usuario", "Responsável"));\r
14 $f->value = $profile->fields('id');\r
15 $this->addField($f, "IU");\r
16 \r
17 $f = $this->newField("hidden", array("dataalteracao", "Data Alteração"));\r
18 $f->value = date("Y-m-d H:i:s");\r
19 $this->addField($f, "IU");\r
20 \r
21 $f = $this->newField("html", array("label","Dados do órgão"));\r
22 $this->addField($f, "IU");\r
23 \r
24 $f = $this->newField("char", array("nome", "Nome"));\r
25 $f->maxlength = 50;\r
26 $this->addField($f, "LOFIU");\r
27 \r
28 // $f = $this->newField("char", array("cid10", "Código CID10"));\r
29 // $f->maxlength = 10;\r
30 // $f->size_cols = 10;\r
31 // $f->is_required = false;\r
32 // $this->addField($f, "LOFIU");\r
33 \r
34 $f = $this->newField("imageUpload", array("imagem", "Ícone ilustrutivo (50x50 px)", "upload/sis_orgao/"));\r
35 $f->addThumb("#ID#", 1000, 1000, 4);\r
36 $f->addThumb("#ID#_p", 50, 50, 4);\r
37 $f->is_required = false;\r
38 $this->addField($f, "IU");\r
39 \r
40 $f = $this->newField("html", array("separador"));\r
41 $this->addField($f, "IU");\r
42 \r
43 $f = $this->newField("html", array("label","Dados extras"));\r
44 $this->addField($f, "IU");\r
45 \r
46 $f = $this->newField("char", array("pagina", "URL com http://"));\r
47 $f->maxlength = 250;\r
48 $f->is_required = false;\r
49 $this->addField($f, "LOFIU");\r
50 \r
51 $f = $this->newField("char", array("palavrachave", "Palavras-chave"));\r
52 $f->maxlength = 250;\r
53 $f->is_required = false;\r
54 $f->comment = "Palavras relacionadas ao órgão, que eventualmente podem facilitar a pesquisa. Separar palavras com ponto e vírgula.";\r
55 $this->addField($f, "LOFIU");\r
56 \r
57 $f = $this->newField("imageUpload", array("imagem", "Ícone", "upload/sis_orgao/"));\r
58 $f->addThumb("#ID#", 1000, 1000, 4);\r
59 $f->addThumb("#ID#_p", 50, 50, 4);\r
60 $f->is_required = false;\r
61 $this->addField($f, "L");\r
62 \r
63 $f = $this->newField('html',array('box'));\r
64 $this->addField($f);\r
65 \r
66 $f = $this->newField('html',array('label', 'Sistemas relacionados'));\r
67 $this->addField($f);\r
68 \r
69 $f = $this->newField('multiItems', array('orgaosistema','','sis_orgao_sistema','id_orgao','id_sistema'));\r
70 $f->addElementsByTable('sis_sistema');\r
71 $this->addField($f,'IU');\r
72 \r
73 $f = $this->newField('html',array('box'));\r
74 $this->addField($f);\r
75 \r
76 $f = $this->newField('html',array('label', 'Topografia'));\r
77 $this->addField($f);\r
78 \r
79 $f = $this->newField('multiItems', array('orgaogrupoorgao','','sis_orgao_grupoorgao','id_orgao','id_grupoorgao'));\r
80 $f->addElementsByTable('sis_grupoorgao');\r
81 $this->addField($f,'IU');\r
82 }\r
83 \r
84 function onPosPost($routine){\r
85 global $load;\r
86 \r
87 $load->config('classes/Palavra.php');\r
88 $cadastra = new Palavra();\r
89 $cadastra->cadastraPalavras($this->fields("nome"));\r
90 $cadastra->cadastraPalavras($this->fields("nome"), false);\r
91 $cadastra->cadastraPalavras($this->fields("palavrachave"),true,';');\r
92 }\r
93}\r
94?>