Commit 1f693848d917c6006d1babd9eb745b4ea4452294
Exists in
master
Merge branch 'master' of https://github.com/mytdt/ieducar into mytdt-master
Showing
7 changed files
with
188 additions
and
28 deletions
Show diff stats
2.85 KB
2.83 KB
ieducar/intranet/styles/mytdt.css
... | ... | @@ -9,8 +9,29 @@ |
9 | 9 | * @company MyTDT Corporation [http://www.mytdt.com.br] |
10 | 10 | */ |
11 | 11 | td.area-conhecimento { |
12 | - background-color: #546C76; | |
13 | - color: #FFF; | |
12 | + background-color: #A1B3BD; | |
13 | + color: #000; | |
14 | 14 | font-weight: bold; |
15 | 15 | text-align: left; |
16 | + cursor: pointer; | |
17 | +} | |
18 | + | |
19 | +td.area-conhecimento-destaque { | |
20 | + background-color: #546C76 !important; | |
21 | + color: #FFF !important; | |
22 | +} | |
23 | + | |
24 | +td.area-conhecimento img.area-conhecimento-seta { | |
25 | + -moz-user-select: none; | |
26 | + outline: none; | |
27 | + border: 0; | |
28 | + margin-top: -1px; | |
29 | +} | |
30 | + | |
31 | +td.area-conhecimento img.seta-baixo { | |
32 | + display: none; | |
33 | +} | |
34 | + | |
35 | +.tr-componente-curricular { | |
36 | + display: none; | |
16 | 37 | } | ... | ... |
ieducar/lib/Portabilis/Business/Professor.php
... | ... | @@ -102,14 +102,14 @@ class Portabilis_Business_Professor { |
102 | 102 | |
103 | 103 | |
104 | 104 | protected static function componentesCurricularesTurmaAlocado($turmaId, $anoLetivo, $userId) { |
105 | - $sql = "select cc.id, cc.nome, ac.nome as area_conhecimento | |
105 | + $sql = "select cc.id, cc.nome, ac.nome as area_conhecimento, ac.secao as secao_area_conhecimento | |
106 | 106 | from modules.componente_curricular_turma as cct, pmieducar.turma, modules.componente_curricular as cc, modules.area_conhecimento as ac, |
107 | 107 | pmieducar.escola_ano_letivo as al, pmieducar.servidor_disciplina as scc |
108 | 108 | where turma.cod_turma = $1 and cct.turma_id = turma.cod_turma and cct.escola_id = turma.ref_ref_cod_escola |
109 | 109 | and cct.componente_curricular_id = cc.id and al.ano = $2 and cct.escola_id = al.ref_cod_escola and |
110 | 110 | scc.ref_ref_cod_instituicao = turma.ref_cod_instituicao and scc.ref_cod_servidor = $3 and |
111 | 111 | scc.ref_cod_curso = turma.ref_cod_curso and scc.ref_cod_disciplina = cc.id and cc.area_conhecimento_id = ac.id |
112 | - order by ac.nome, cc.nome"; | |
112 | + order by ac.secao, ac.nome, cc.nome"; | |
113 | 113 | |
114 | 114 | $options = array('params' => array($turmaId, $anoLetivo, $userId)); |
115 | 115 | |
... | ... | @@ -118,7 +118,7 @@ class Portabilis_Business_Professor { |
118 | 118 | |
119 | 119 | |
120 | 120 | protected static function componentesCurricularesCursoAlocado($turmaId, $anoLetivo, $userId) { |
121 | - $sql = "select cc.id as id, cc.nome as nome, ac.nome as area_conhecimento from pmieducar.serie, pmieducar.escola_serie_disciplina as esd, | |
121 | + $sql = "select cc.id as id, cc.nome as nome, ac.nome as area_conhecimento, ac.secao as secao_area_conhecimento from pmieducar.serie, pmieducar.escola_serie_disciplina as esd, | |
122 | 122 | pmieducar.turma, modules.componente_curricular as cc, modules.area_conhecimento as ac, pmieducar.escola_ano_letivo as al, |
123 | 123 | pmieducar.servidor_disciplina as scc where turma.cod_turma = $1 and serie.cod_serie = |
124 | 124 | turma.ref_ref_cod_serie and esd.ref_ref_cod_escola = turma.ref_ref_cod_escola and esd.ref_ref_cod_serie = |
... | ... | @@ -126,7 +126,7 @@ class Portabilis_Business_Professor { |
126 | 126 | al.ref_cod_escola and serie.ativo = 1 and esd.ativo = 1 and al.ativo = 1 and scc.ref_ref_cod_instituicao = |
127 | 127 | turma.ref_cod_instituicao and scc.ref_cod_servidor = $3 and scc.ref_cod_curso = serie.ref_cod_curso and |
128 | 128 | scc.ref_cod_disciplina = cc.id and cc.area_conhecimento_id = ac.id |
129 | - order by ac.nome, cc.nome"; | |
129 | + order by ac.secao, ac.nome, cc.nome"; | |
130 | 130 | |
131 | 131 | $options = array('params' => array($turmaId, $anoLetivo, $userId)); |
132 | 132 | ... | ... |
ieducar/modules/Avaliacao/Assets/Javascripts/Diario.js
... | ... | @@ -715,34 +715,61 @@ function updateComponenteCurriculares($targetElement, matriculaId, componentesCu |
715 | 715 | |
716 | 716 | var areas = new Array(); |
717 | 717 | |
718 | - var $ccHeader = $j('<tr />').addClass('strong'); | |
719 | - | |
720 | - $j('<td />').addClass('center').html('Componente curricular').appendTo($ccHeader); | |
721 | - updateComponenteCurricularHeaders($ccHeader, $j('<td />')); | |
722 | - | |
723 | - $ccHeader.appendTo($targetElement); | |
724 | - | |
725 | - var areaColspan = $j('td', $ccHeader).length; | |
726 | - | |
718 | + var setaDireita = "<img src=\"imagens/mytdt/seta-preta-direita.png\" align=\"top\" class=\"area-conhecimento-seta seta-direita\" />"; | |
719 | + var setaBaixo = "<img src=\"imagens/mytdt/seta-branca-baixo.png\" align=\"top\" class=\"area-conhecimento-seta seta-baixo\" />"; | |
727 | 720 | |
728 | 721 | $j.each(componentesCurriculares, function(index, cc) { |
729 | 722 | if (areas.indexOf(cc.area_id) == -1) { |
730 | 723 | areas.push(cc.area_id); |
731 | 724 | |
732 | - var $areaRow = $j('<tr />'); | |
725 | + //primeiro o header para calcular o colspan | |
726 | + var $ccHeader = $j('<tr />').addClass('strong').addClass('tr-componente-curricular').data('areaid', cc.area_id); | |
727 | + $j('<td />').addClass('center').html('Componente curricular').appendTo($ccHeader); | |
728 | + updateComponenteCurricularHeaders($ccHeader, $j('<td />')); | |
733 | 729 | |
734 | - $j('<td />').addClass('area-conhecimento').attr('colspan', areaColspan).html(cc.area_nome).appendTo($areaRow); | |
730 | + //pegando o colspan | |
731 | + var areaColspan = $j('td', $ccHeader).length; | |
735 | 732 | |
733 | + var $areaRow = $j('<tr />').addClass('tr-area-conhecimento').data('areaid', cc.area_id); | |
734 | + var conteudo = setaDireita + setaBaixo + " " + cc.area_nome; | |
735 | + $j('<td />').addClass('area-conhecimento').attr('colspan', areaColspan).html(conteudo).appendTo($areaRow); | |
736 | + | |
737 | + //por fim adicionando primeiro a área depois o header | |
736 | 738 | $areaRow.appendTo($targetElement); |
739 | + $ccHeader.appendTo($targetElement); | |
737 | 740 | } |
738 | 741 | |
739 | - var $ccRow = $j('<tr />'); | |
742 | + var $ccRow = $j('<tr />').addClass('tr-componente-curricular').data('areaid', cc.area_id); | |
740 | 743 | |
741 | 744 | $j('<td />').addClass('center').html(cc.nome).appendTo($ccRow); |
742 | 745 | updateComponenteCurricular($ccRow, matriculaId, cc); |
743 | 746 | |
744 | 747 | $ccRow.appendTo($targetElement); |
745 | 748 | }); |
749 | + | |
750 | + $j('.tr-area-conhecimento').bind('click', function() { | |
751 | + $j('td', this).toggleClass('area-conhecimento-destaque'); | |
752 | + | |
753 | + var fechado = $j('.seta-baixo', this).is(':hidden'); | |
754 | + if (fechado) { | |
755 | + $j('.seta-baixo', this).css('display', 'inline'); | |
756 | + $j('.seta-direita', this).css('display', 'none'); | |
757 | + } else { | |
758 | + $j('.seta-baixo', this).css('display', 'none'); | |
759 | + $j('.seta-direita', this).css('display', 'inline'); | |
760 | + } | |
761 | + | |
762 | + var id = $j(this).data('areaid'); | |
763 | + $j('.tr-componente-curricular').each(function() { | |
764 | + if ($j(this).data('areaid') == id) { | |
765 | + if ($j(this).is(':hidden')) { | |
766 | + $j(this).slideRow('down'); | |
767 | + } else { | |
768 | + $j(this).slideRow('up'); | |
769 | + } | |
770 | + } | |
771 | + }); | |
772 | + }); | |
746 | 773 | } |
747 | 774 | |
748 | 775 | |
... | ... | @@ -837,3 +864,112 @@ function showNextSelectionButton() { |
837 | 864 | .appendTo($navActions); |
838 | 865 | } |
839 | 866 | } |
867 | + | |
868 | +(function($) { | |
869 | + var sR = { | |
870 | + defaults: { | |
871 | + slideSpeed: 400, | |
872 | + easing: false, | |
873 | + callback: false | |
874 | + }, | |
875 | + thisCallArgs: { | |
876 | + slideSpeed: 400, | |
877 | + easing: false, | |
878 | + callback: false | |
879 | + }, | |
880 | + methods: { | |
881 | + up: function (arg1,arg2,arg3) { | |
882 | + if(typeof arg1 == 'object') { | |
883 | + for(p in arg1) { | |
884 | + sR.thisCallArgs.eval(p) = arg1[p]; | |
885 | + } | |
886 | + }else if(typeof arg1 != 'undefined' && (typeof arg1 == 'number' || arg1 == 'slow' || arg1 == 'fast')) { | |
887 | + sR.thisCallArgs.slideSpeed = arg1; | |
888 | + }else{ | |
889 | + sR.thisCallArgs.slideSpeed = sR.defaults.slideSpeed; | |
890 | + } | |
891 | + | |
892 | + if(typeof arg2 == 'string'){ | |
893 | + sR.thisCallArgs.easing = arg2; | |
894 | + }else if(typeof arg2 == 'function'){ | |
895 | + sR.thisCallArgs.callback = arg2; | |
896 | + }else if(typeof arg2 == 'undefined') { | |
897 | + sR.thisCallArgs.easing = sR.defaults.easing; | |
898 | + } | |
899 | + if(typeof arg3 == 'function') { | |
900 | + sR.thisCallArgs.callback = arg3; | |
901 | + }else if(typeof arg3 == 'undefined' && typeof arg2 != 'function'){ | |
902 | + sR.thisCallArgs.callback = sR.defaults.callback; | |
903 | + } | |
904 | + var $cells = $(this).find('td'); | |
905 | + $cells.wrapInner('<div class="slideRowUp" />'); | |
906 | + var currentPadding = $cells.css('padding'); | |
907 | + $cellContentWrappers = $(this).find('.slideRowUp'); | |
908 | + $cellContentWrappers.slideUp(sR.thisCallArgs.slideSpeed,sR.thisCallArgs.easing).parent().animate({ | |
909 | + paddingTop: '0px', | |
910 | + paddingBottom: '0px'},{ | |
911 | + complete: function () { | |
912 | + $(this).children('.slideRowUp').replaceWith($(this).children('.slideRowUp').contents()); | |
913 | + $(this).parent().css({'display':'none'}); | |
914 | + $(this).css({'padding': currentPadding}); | |
915 | + }}); | |
916 | + var wait = setInterval(function () { | |
917 | + if($cellContentWrappers.is(':animated') === false) { | |
918 | + clearInterval(wait); | |
919 | + if(typeof sR.thisCallArgs.callback == 'function') { | |
920 | + sR.thisCallArgs.callback.call(this); | |
921 | + } | |
922 | + } | |
923 | + }, 100); | |
924 | + return $(this); | |
925 | + }, | |
926 | + down: function (arg1,arg2,arg3) { | |
927 | + if(typeof arg1 == 'object') { | |
928 | + for(p in arg1) { | |
929 | + sR.thisCallArgs.eval(p) = arg1[p]; | |
930 | + } | |
931 | + }else if(typeof arg1 != 'undefined' && (typeof arg1 == 'number' || arg1 == 'slow' || arg1 == 'fast')) { | |
932 | + sR.thisCallArgs.slideSpeed = arg1; | |
933 | + }else{ | |
934 | + sR.thisCallArgs.slideSpeed = sR.defaults.slideSpeed; | |
935 | + } | |
936 | + | |
937 | + if(typeof arg2 == 'string'){ | |
938 | + sR.thisCallArgs.easing = arg2; | |
939 | + }else if(typeof arg2 == 'function'){ | |
940 | + sR.thisCallArgs.callback = arg2; | |
941 | + }else if(typeof arg2 == 'undefined') { | |
942 | + sR.thisCallArgs.easing = sR.defaults.easing; | |
943 | + } | |
944 | + if(typeof arg3 == 'function') { | |
945 | + sR.thisCallArgs.callback = arg3; | |
946 | + }else if(typeof arg3 == 'undefined' && typeof arg2 != 'function'){ | |
947 | + sR.thisCallArgs.callback = sR.defaults.callback; | |
948 | + } | |
949 | + var $cells = $(this).find('td'); | |
950 | + $cells.wrapInner('<div class="slideRowDown" style="display:none;" />'); | |
951 | + $cellContentWrappers = $cells.find('.slideRowDown'); | |
952 | + $(this).show(); | |
953 | + $cellContentWrappers.slideDown(sR.thisCallArgs.slideSpeed, sR.thisCallArgs.easing, function() { $(this).replaceWith( $(this).contents()); }); | |
954 | + | |
955 | + var wait = setInterval(function () { | |
956 | + if($cellContentWrappers.is(':animated') === false) { | |
957 | + clearInterval(wait); | |
958 | + if(typeof sR.thisCallArgs.callback == 'function') { | |
959 | + sR.thisCallArgs.callback.call(this); | |
960 | + } | |
961 | + } | |
962 | + }, 100); | |
963 | + return $(this); | |
964 | + } | |
965 | + } | |
966 | + }; | |
967 | + | |
968 | + $.fn.slideRow = function(method,arg1,arg2,arg3) { | |
969 | + if(typeof method != 'undefined') { | |
970 | + if(sR.methods[method]) { | |
971 | + return sR.methods[method].apply(this, Array.prototype.slice.call(arguments,1)); | |
972 | + } | |
973 | + } | |
974 | + }; | |
975 | +})(jQuery); | |
840 | 976 | \ No newline at end of file | ... | ... |
ieducar/modules/Avaliacao/Views/DiarioApiController.php
... | ... | @@ -758,12 +758,13 @@ class DiarioApiController extends ApiCoreController |
758 | 758 | |
759 | 759 | //buscando pela área do conhecimento |
760 | 760 | $area = $this->getAreaConhecimento($componente['id']); |
761 | + $nomeArea = (($area->secao != '') ? $area->secao . ' - ' : '') . $area->nome; | |
761 | 762 | $componente['area_id'] = $area->id; |
762 | - $componente['area_nome'] = $this->safeString(strtoupper($area->nome), false); | |
763 | + $componente['area_nome'] = $this->safeString(strtoupper($nomeArea), false); | |
763 | 764 | |
764 | 765 | //criando chave para ordenamento temporário |
765 | 766 | //área de conhecimento + componente curricular |
766 | - $componente['my_order'] = Portabilis_String_Utils::unaccent(strtoupper($area->nome)) . Portabilis_String_Utils::unaccent(strtoupper($_componente->get('nome'))); | |
767 | + $componente['my_order'] = Portabilis_String_Utils::unaccent(strtoupper($nomeArea)) . Portabilis_String_Utils::unaccent(strtoupper($_componente->get('nome'))); | |
767 | 768 | |
768 | 769 | $componentesCurriculares[] = $componente; |
769 | 770 | } |
... | ... | @@ -794,9 +795,10 @@ class DiarioApiController extends ApiCoreController |
794 | 795 | |
795 | 796 | $area = $mapper->findAll(array('area_conhecimento'), $where); |
796 | 797 | |
797 | - $areaConhecimento = new stdClass(); | |
798 | - $areaConhecimento->id = $area[0]->area_conhecimento->id; | |
799 | - $areaConhecimento->nome = $area[0]->area_conhecimento->nome; | |
798 | + $areaConhecimento = new stdClass(); | |
799 | + $areaConhecimento->id = $area[0]->area_conhecimento->id; | |
800 | + $areaConhecimento->nome = $area[0]->area_conhecimento->nome; | |
801 | + $areaConhecimento->secao = $area[0]->area_conhecimento->secao; | |
800 | 802 | |
801 | 803 | return $areaConhecimento; |
802 | 804 | } | ... | ... |
ieducar/modules/DynamicInput/Views/ComponenteCurricularController.php
... | ... | @@ -71,23 +71,23 @@ class ComponenteCurricularController extends ApiCoreController |
71 | 71 | } |
72 | 72 | |
73 | 73 | else { |
74 | - $sql = "select cc.id, cc.nome, ac.nome as area_conhecimento | |
74 | + $sql = "select cc.id, cc.nome, ac.nome as area_conhecimento, ac.secao as secao_area_conhecimento | |
75 | 75 | from pmieducar.turma, modules.componente_curricular_turma as cct, modules.componente_curricular as cc, modules.area_conhecimento as ac, |
76 | 76 | pmieducar.escola_ano_letivo as al where turma.cod_turma = $1 and cct.turma_id = turma.cod_turma and |
77 | 77 | cct.escola_id = turma.ref_ref_cod_escola and cct.componente_curricular_id = cc.id and al.ano = $2 |
78 | 78 | and cct.escola_id = al.ref_cod_escola and cc.area_conhecimento_id = ac.id |
79 | - order by ac.nome, cc.nome"; | |
79 | + order by ac.secao, ac.nome, cc.nome"; | |
80 | 80 | |
81 | 81 | $componentesCurriculares = $this->fetchPreparedQuery($sql, array($turmaId, $ano)); |
82 | 82 | |
83 | 83 | if (count($ComponentesCurriculares) < 1) { |
84 | - $sql = "select cc.id, cc.nome, ac.nome as area_conhecimento from | |
84 | + $sql = "select cc.id, cc.nome, ac.nome as area_conhecimento, ac.secao as secao_area_conhecimento from | |
85 | 85 | pmieducar.turma as t, pmieducar.escola_serie_disciplina as esd, modules.componente_curricular |
86 | 86 | as cc, modules.area_conhecimento as ac, pmieducar.escola_ano_letivo as al where t.cod_turma = $1 and esd.ref_ref_cod_escola = |
87 | 87 | t.ref_ref_cod_escola and esd.ref_ref_cod_serie = t.ref_ref_cod_serie and esd.ref_cod_disciplina = |
88 | 88 | cc.id and al.ano = $2 and esd.ref_ref_cod_escola = al.ref_cod_escola and t.ativo = 1 and |
89 | 89 | esd.ativo = 1 and al.ativo = 1 and cc.area_conhecimento_id = ac.id |
90 | - order by ac.nome, cc.nome"; | |
90 | + order by ac.secao, ac.nome, cc.nome"; | |
91 | 91 | |
92 | 92 | $componentesCurriculares = $this->fetchPreparedQuery($sql, array($turmaId, $ano)); |
93 | 93 | } |
... | ... | @@ -95,9 +95,10 @@ class ComponenteCurricularController extends ApiCoreController |
95 | 95 | |
96 | 96 | $options = array(); |
97 | 97 | foreach ($componentesCurriculares as $componenteCurricular) { |
98 | + $areaConhecimento = (($componenteCurricular['secao_area_conhecimento'] != '') ? $componenteCurricular['secao_area_conhecimento'] . ' - ' : '') . $componenteCurricular['area_conhecimento']; | |
98 | 99 | $options['__' . $componenteCurricular['id']] = array( |
99 | 100 | 'value' => $this->toUtf8($componenteCurricular['nome']), |
100 | - 'group' => $this->toUtf8($componenteCurricular['area_conhecimento']) | |
101 | + 'group' => $this->toUtf8($areaConhecimento) | |
101 | 102 | ); |
102 | 103 | } |
103 | 104 | ... | ... |