Commit 6e9d20c7a423ecce42cc97ef17d18567392fd692
1 parent
5b154063
Exists in
master
Adicionado campo seção no cadastro de área de conhecimento;
Portabilis/ieducar#152
Showing
6 changed files
with
58 additions
and
13 deletions
Show diff stats
ieducar/misc/database/deltas/portabilis/75_adiciona_coluna_secao_area_conhecimento.sql
0 → 100644
@@ -0,0 +1,16 @@ | @@ -0,0 +1,16 @@ | ||
1 | + -- // | ||
2 | + | ||
3 | + -- | ||
4 | + -- Adiciona coluna seção a área de conhecimento | ||
5 | + -- | ||
6 | + -- @author Lucas Schmoeller da Silva <lucas@portabilis.com.br> | ||
7 | + -- @license @@license@@ | ||
8 | + -- @version $Id$ | ||
9 | + | ||
10 | + ALTER TABLE modules.area_conhecimento ADD COLUMN secao CHARACTER VARYING(50); | ||
11 | + | ||
12 | + -- //@UNDO | ||
13 | + | ||
14 | + ALTER TABLE modules.area_conhecimento DROP COLUMN secao; | ||
15 | + | ||
16 | + -- // | ||
0 | \ No newline at end of file | 17 | \ No newline at end of file |
ieducar/misc/database/migrations/20151201161741_coluna_secao_area_conhecimento.php
0 → 100644
@@ -0,0 +1,16 @@ | @@ -0,0 +1,16 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +use Phinx\Migration\AbstractMigration; | ||
4 | + | ||
5 | +class ColunaSecaoAreaConhecimento extends AbstractMigration | ||
6 | +{ | ||
7 | + public function up() | ||
8 | + { | ||
9 | + $count = $this->execute("ALTER TABLE modules.area_conhecimento ADD COLUMN secao CHARACTER VARYING(50);"); | ||
10 | + } | ||
11 | + | ||
12 | + public function down() | ||
13 | + { | ||
14 | + $count = $this->execute("ALTER TABLE modules.area_conhecimento DROP COLUMN secao;"); | ||
15 | + } | ||
16 | +} |
ieducar/modules/AreaConhecimento/Model/Area.php
@@ -48,6 +48,7 @@ class AreaConhecimento_Model_Area extends CoreExt_Entity | @@ -48,6 +48,7 @@ class AreaConhecimento_Model_Area extends CoreExt_Entity | ||
48 | protected $_data = array( | 48 | protected $_data = array( |
49 | 'instituicao' => NULL, | 49 | 'instituicao' => NULL, |
50 | 'nome' => NULL, | 50 | 'nome' => NULL, |
51 | + 'secao' => NULL | ||
51 | ); | 52 | ); |
52 | 53 | ||
53 | public function getDefaultValidatorCollection() | 54 | public function getDefaultValidatorCollection() |
@@ -56,7 +57,8 @@ class AreaConhecimento_Model_Area extends CoreExt_Entity | @@ -56,7 +57,8 @@ class AreaConhecimento_Model_Area extends CoreExt_Entity | ||
56 | 57 | ||
57 | return array( | 58 | return array( |
58 | 'instituicao' => new CoreExt_Validate_Choice(array('choices' => $instituicoes)), | 59 | 'instituicao' => new CoreExt_Validate_Choice(array('choices' => $instituicoes)), |
59 | - 'nome' => new CoreExt_Validate_String(array('min' => 5, 'max' => 60)) | 60 | + 'nome' => new CoreExt_Validate_String(array('min' => 5, 'max' => 60)), |
61 | + 'secao' => new CoreExt_Validate_String(array('min' => 0, 'max' => 50)) | ||
60 | ); | 62 | ); |
61 | } | 63 | } |
62 | 64 |
ieducar/modules/AreaConhecimento/Views/EditController.php
@@ -61,12 +61,17 @@ class EditController extends Core_Controller_Page_EditController | @@ -61,12 +61,17 @@ class EditController extends Core_Controller_Page_EditController | ||
61 | 'label' => 'Nome', | 61 | 'label' => 'Nome', |
62 | 'help' => 'O nome da área de conhecimento. Exemplo: "<em>Ciências da natureza</em>".', | 62 | 'help' => 'O nome da área de conhecimento. Exemplo: "<em>Ciências da natureza</em>".', |
63 | 'entity' => 'nome' | 63 | 'entity' => 'nome' |
64 | + ), | ||
65 | + 'secao' => array( | ||
66 | + 'label' => 'Seção', | ||
67 | + 'help' => 'A seção que abrange a área de conhecimento. Exemplo: "<em>Lógico Matemático</em>".', | ||
68 | + 'entity' => 'secao' | ||
64 | ) | 69 | ) |
65 | ); | 70 | ); |
66 | 71 | ||
67 | protected function _preRender() | 72 | protected function _preRender() |
68 | { | 73 | { |
69 | - parent::_preRender(); | 74 | + parent::_preRender(); |
70 | 75 | ||
71 | Portabilis_View_Helper_Application::loadStylesheet($this, 'intranet/styles/localizacaoSistema.css'); | 76 | Portabilis_View_Helper_Application::loadStylesheet($this, 'intranet/styles/localizacaoSistema.css'); |
72 | 77 | ||
@@ -75,10 +80,10 @@ class EditController extends Core_Controller_Page_EditController | @@ -75,10 +80,10 @@ class EditController extends Core_Controller_Page_EditController | ||
75 | $localizacao->entradaCaminhos( array( | 80 | $localizacao->entradaCaminhos( array( |
76 | $_SERVER['SERVER_NAME']."/intranet" => "Início", | 81 | $_SERVER['SERVER_NAME']."/intranet" => "Início", |
77 | "educar_index.php" => "i-Educar - Escola", | 82 | "educar_index.php" => "i-Educar - Escola", |
78 | - "" => "$nomeMenu área de conhecimento" | 83 | + "" => "$nomeMenu área de conhecimento" |
79 | )); | 84 | )); |
80 | - $this->enviaLocalizacao($localizacao->montar()); | ||
81 | - } | 85 | + $this->enviaLocalizacao($localizacao->montar()); |
86 | + } | ||
82 | 87 | ||
83 | /** | 88 | /** |
84 | * @see clsCadastro#Gerar() | 89 | * @see clsCadastro#Gerar() |
@@ -95,5 +100,9 @@ class EditController extends Core_Controller_Page_EditController | @@ -95,5 +100,9 @@ class EditController extends Core_Controller_Page_EditController | ||
95 | // Nome | 100 | // Nome |
96 | $this->campoTexto('nome', $this->_getLabel('nome'), $this->getEntity()->nome, | 101 | $this->campoTexto('nome', $this->_getLabel('nome'), $this->getEntity()->nome, |
97 | 60, 60, TRUE, FALSE, FALSE, $this->_getHelp('nome')); | 102 | 60, 60, TRUE, FALSE, FALSE, $this->_getHelp('nome')); |
103 | + | ||
104 | + // Seção | ||
105 | + $this->campoTexto('secao', $this->_getLabel('secao'), $this->getEntity()->secao, | ||
106 | + 50, 50, FALSE, FALSE, FALSE, $this->_getHelp('secao')); | ||
98 | } | 107 | } |
99 | } | 108 | } |
100 | \ No newline at end of file | 109 | \ No newline at end of file |
ieducar/modules/AreaConhecimento/Views/IndexController.php
@@ -49,7 +49,8 @@ class IndexController extends Core_Controller_Page_ListController | @@ -49,7 +49,8 @@ class IndexController extends Core_Controller_Page_ListController | ||
49 | protected $_titulo = 'Listagem de áreas de conhecimento'; | 49 | protected $_titulo = 'Listagem de áreas de conhecimento'; |
50 | protected $_processoAp = 945; | 50 | protected $_processoAp = 945; |
51 | protected $_tableMap = array( | 51 | protected $_tableMap = array( |
52 | - 'Nome' => 'nome' | 52 | + 'Nome' => 'nome', |
53 | + 'Seção' => 'secao' | ||
53 | ); | 54 | ); |
54 | 55 | ||
55 | protected function _preRender(){ | 56 | protected function _preRender(){ |
@@ -63,8 +64,8 @@ class IndexController extends Core_Controller_Page_ListController | @@ -63,8 +64,8 @@ class IndexController extends Core_Controller_Page_ListController | ||
63 | $localizacao->entradaCaminhos( array( | 64 | $localizacao->entradaCaminhos( array( |
64 | $_SERVER['SERVER_NAME']."/intranet" => "Início", | 65 | $_SERVER['SERVER_NAME']."/intranet" => "Início", |
65 | "educar_index.php" => "i-Educar - Escola", | 66 | "educar_index.php" => "i-Educar - Escola", |
66 | - "" => "Listagem de áreas de conhecimento" | 67 | + "" => "Listagem de áreas de conhecimento" |
67 | )); | 68 | )); |
68 | - $this->enviaLocalizacao($localizacao->montar()); | ||
69 | - } | 69 | + $this->enviaLocalizacao($localizacao->montar()); |
70 | + } | ||
70 | } | 71 | } |
71 | \ No newline at end of file | 72 | \ No newline at end of file |
ieducar/modules/AreaConhecimento/Views/ViewController.php
@@ -49,7 +49,8 @@ class ViewController extends Core_Controller_Page_ViewController | @@ -49,7 +49,8 @@ class ViewController extends Core_Controller_Page_ViewController | ||
49 | protected $_titulo = 'Detalhes de área de conhecimento'; | 49 | protected $_titulo = 'Detalhes de área de conhecimento'; |
50 | protected $_processoAp = 945; | 50 | protected $_processoAp = 945; |
51 | protected $_tableMap = array( | 51 | protected $_tableMap = array( |
52 | - 'Nome' => 'nome' | 52 | + 'Nome' => 'nome', |
53 | + 'Seção' => 'secao' | ||
53 | ); | 54 | ); |
54 | 55 | ||
55 | 56 | ||
@@ -64,8 +65,8 @@ class ViewController extends Core_Controller_Page_ViewController | @@ -64,8 +65,8 @@ class ViewController extends Core_Controller_Page_ViewController | ||
64 | $localizacao->entradaCaminhos( array( | 65 | $localizacao->entradaCaminhos( array( |
65 | $_SERVER['SERVER_NAME']."/intranet" => "Início", | 66 | $_SERVER['SERVER_NAME']."/intranet" => "Início", |
66 | "educar_index.php" => "i-Educar - Escola", | 67 | "educar_index.php" => "i-Educar - Escola", |
67 | - "" => "Detalhe da área de conhecimento" | 68 | + "" => "Detalhe da área de conhecimento" |
68 | )); | 69 | )); |
69 | - $this->enviaLocalizacao($localizacao->montar()); | ||
70 | - } | 70 | + $this->enviaLocalizacao($localizacao->montar()); |
71 | + } | ||
71 | } | 72 | } |
72 | \ No newline at end of file | 73 | \ No newline at end of file |