diff --git a/ieducar/intranet/imagens/mytdt/seta-branca-baixo.png b/ieducar/intranet/imagens/mytdt/seta-branca-baixo.png new file mode 100644 index 0000000..fa758f1 Binary files /dev/null and b/ieducar/intranet/imagens/mytdt/seta-branca-baixo.png differ diff --git a/ieducar/intranet/imagens/mytdt/seta-preta-direita.png b/ieducar/intranet/imagens/mytdt/seta-preta-direita.png new file mode 100644 index 0000000..609c912 Binary files /dev/null and b/ieducar/intranet/imagens/mytdt/seta-preta-direita.png differ diff --git a/ieducar/intranet/styles/mytdt.css b/ieducar/intranet/styles/mytdt.css index cb8983b..d3391a5 100644 --- a/ieducar/intranet/styles/mytdt.css +++ b/ieducar/intranet/styles/mytdt.css @@ -9,8 +9,29 @@ * @company MyTDT Corporation [http://www.mytdt.com.br] */ td.area-conhecimento { - background-color: #546C76; - color: #FFF; + background-color: #A1B3BD; + color: #000; font-weight: bold; text-align: left; + cursor: pointer; +} + +td.area-conhecimento-destaque { + background-color: #546C76 !important; + color: #FFF !important; +} + +td.area-conhecimento img.area-conhecimento-seta { + -moz-user-select: none; + outline: none; + border: 0; + margin-top: -1px; +} + +td.area-conhecimento img.seta-baixo { + display: none; +} + +.tr-componente-curricular { + display: none; } diff --git a/ieducar/lib/Portabilis/Business/Professor.php b/ieducar/lib/Portabilis/Business/Professor.php index 68303fc..0e179f6 100644 --- a/ieducar/lib/Portabilis/Business/Professor.php +++ b/ieducar/lib/Portabilis/Business/Professor.php @@ -102,14 +102,14 @@ class Portabilis_Business_Professor { protected static function componentesCurricularesTurmaAlocado($turmaId, $anoLetivo, $userId) { - $sql = "select cc.id, cc.nome, ac.nome as area_conhecimento + $sql = "select cc.id, cc.nome, ac.nome as area_conhecimento, ac.secao as secao_area_conhecimento from modules.componente_curricular_turma as cct, pmieducar.turma, modules.componente_curricular as cc, modules.area_conhecimento as ac, pmieducar.escola_ano_letivo as al, pmieducar.servidor_disciplina as scc where turma.cod_turma = $1 and cct.turma_id = turma.cod_turma and cct.escola_id = turma.ref_ref_cod_escola and cct.componente_curricular_id = cc.id and al.ano = $2 and cct.escola_id = al.ref_cod_escola and scc.ref_ref_cod_instituicao = turma.ref_cod_instituicao and scc.ref_cod_servidor = $3 and scc.ref_cod_curso = turma.ref_cod_curso and scc.ref_cod_disciplina = cc.id and cc.area_conhecimento_id = ac.id - order by ac.nome, cc.nome"; + order by ac.secao, ac.nome, cc.nome"; $options = array('params' => array($turmaId, $anoLetivo, $userId)); @@ -118,7 +118,7 @@ class Portabilis_Business_Professor { protected static function componentesCurricularesCursoAlocado($turmaId, $anoLetivo, $userId) { - $sql = "select cc.id as id, cc.nome as nome, ac.nome as area_conhecimento from pmieducar.serie, pmieducar.escola_serie_disciplina as esd, + $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, pmieducar.turma, modules.componente_curricular as cc, modules.area_conhecimento as ac, pmieducar.escola_ano_letivo as al, pmieducar.servidor_disciplina as scc where turma.cod_turma = $1 and serie.cod_serie = 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 { al.ref_cod_escola and serie.ativo = 1 and esd.ativo = 1 and al.ativo = 1 and scc.ref_ref_cod_instituicao = turma.ref_cod_instituicao and scc.ref_cod_servidor = $3 and scc.ref_cod_curso = serie.ref_cod_curso and scc.ref_cod_disciplina = cc.id and cc.area_conhecimento_id = ac.id - order by ac.nome, cc.nome"; + order by ac.secao, ac.nome, cc.nome"; $options = array('params' => array($turmaId, $anoLetivo, $userId)); diff --git a/ieducar/modules/Avaliacao/Assets/Javascripts/Diario.js b/ieducar/modules/Avaliacao/Assets/Javascripts/Diario.js index 6b5f9ef..659f7a2 100644 --- a/ieducar/modules/Avaliacao/Assets/Javascripts/Diario.js +++ b/ieducar/modules/Avaliacao/Assets/Javascripts/Diario.js @@ -715,34 +715,61 @@ function updateComponenteCurriculares($targetElement, matriculaId, componentesCu var areas = new Array(); - var $ccHeader = $j('').addClass('strong'); - - $j('').addClass('center').html('Componente curricular').appendTo($ccHeader); - updateComponenteCurricularHeaders($ccHeader, $j('')); - - $ccHeader.appendTo($targetElement); - - var areaColspan = $j('td', $ccHeader).length; - + var setaDireita = ""; + var setaBaixo = ""; $j.each(componentesCurriculares, function(index, cc) { if (areas.indexOf(cc.area_id) == -1) { areas.push(cc.area_id); - var $areaRow = $j(''); + //primeiro o header para calcular o colspan + var $ccHeader = $j('').addClass('strong').addClass('tr-componente-curricular').data('areaid', cc.area_id); + $j('').addClass('center').html('Componente curricular').appendTo($ccHeader); + updateComponenteCurricularHeaders($ccHeader, $j('')); - $j('').addClass('area-conhecimento').attr('colspan', areaColspan).html(cc.area_nome).appendTo($areaRow); + //pegando o colspan + var areaColspan = $j('td', $ccHeader).length; + var $areaRow = $j('').addClass('tr-area-conhecimento').data('areaid', cc.area_id); + var conteudo = setaDireita + setaBaixo + " " + cc.area_nome; + $j('').addClass('area-conhecimento').attr('colspan', areaColspan).html(conteudo).appendTo($areaRow); + + //por fim adicionando primeiro a área depois o header $areaRow.appendTo($targetElement); + $ccHeader.appendTo($targetElement); } - var $ccRow = $j(''); + var $ccRow = $j('').addClass('tr-componente-curricular').data('areaid', cc.area_id); $j('').addClass('center').html(cc.nome).appendTo($ccRow); updateComponenteCurricular($ccRow, matriculaId, cc); $ccRow.appendTo($targetElement); }); + + $j('.tr-area-conhecimento').bind('click', function() { + $j('td', this).toggleClass('area-conhecimento-destaque'); + + var fechado = $j('.seta-baixo', this).is(':hidden'); + if (fechado) { + $j('.seta-baixo', this).css('display', 'inline'); + $j('.seta-direita', this).css('display', 'none'); + } else { + $j('.seta-baixo', this).css('display', 'none'); + $j('.seta-direita', this).css('display', 'inline'); + } + + var id = $j(this).data('areaid'); + $j('.tr-componente-curricular').each(function() { + if ($j(this).data('areaid') == id) { + if ($j(this).is(':hidden')) { + $j(this).slideRow('down'); + } else { + $j(this).slideRow('up'); + } + } + }); + }); } @@ -837,3 +864,112 @@ function showNextSelectionButton() { .appendTo($navActions); } } + +(function($) { + var sR = { + defaults: { + slideSpeed: 400, + easing: false, + callback: false + }, + thisCallArgs: { + slideSpeed: 400, + easing: false, + callback: false + }, + methods: { + up: function (arg1,arg2,arg3) { + if(typeof arg1 == 'object') { + for(p in arg1) { + sR.thisCallArgs.eval(p) = arg1[p]; + } + }else if(typeof arg1 != 'undefined' && (typeof arg1 == 'number' || arg1 == 'slow' || arg1 == 'fast')) { + sR.thisCallArgs.slideSpeed = arg1; + }else{ + sR.thisCallArgs.slideSpeed = sR.defaults.slideSpeed; + } + + if(typeof arg2 == 'string'){ + sR.thisCallArgs.easing = arg2; + }else if(typeof arg2 == 'function'){ + sR.thisCallArgs.callback = arg2; + }else if(typeof arg2 == 'undefined') { + sR.thisCallArgs.easing = sR.defaults.easing; + } + if(typeof arg3 == 'function') { + sR.thisCallArgs.callback = arg3; + }else if(typeof arg3 == 'undefined' && typeof arg2 != 'function'){ + sR.thisCallArgs.callback = sR.defaults.callback; + } + var $cells = $(this).find('td'); + $cells.wrapInner('
'); + var currentPadding = $cells.css('padding'); + $cellContentWrappers = $(this).find('.slideRowUp'); + $cellContentWrappers.slideUp(sR.thisCallArgs.slideSpeed,sR.thisCallArgs.easing).parent().animate({ + paddingTop: '0px', + paddingBottom: '0px'},{ + complete: function () { + $(this).children('.slideRowUp').replaceWith($(this).children('.slideRowUp').contents()); + $(this).parent().css({'display':'none'}); + $(this).css({'padding': currentPadding}); + }}); + var wait = setInterval(function () { + if($cellContentWrappers.is(':animated') === false) { + clearInterval(wait); + if(typeof sR.thisCallArgs.callback == 'function') { + sR.thisCallArgs.callback.call(this); + } + } + }, 100); + return $(this); + }, + down: function (arg1,arg2,arg3) { + if(typeof arg1 == 'object') { + for(p in arg1) { + sR.thisCallArgs.eval(p) = arg1[p]; + } + }else if(typeof arg1 != 'undefined' && (typeof arg1 == 'number' || arg1 == 'slow' || arg1 == 'fast')) { + sR.thisCallArgs.slideSpeed = arg1; + }else{ + sR.thisCallArgs.slideSpeed = sR.defaults.slideSpeed; + } + + if(typeof arg2 == 'string'){ + sR.thisCallArgs.easing = arg2; + }else if(typeof arg2 == 'function'){ + sR.thisCallArgs.callback = arg2; + }else if(typeof arg2 == 'undefined') { + sR.thisCallArgs.easing = sR.defaults.easing; + } + if(typeof arg3 == 'function') { + sR.thisCallArgs.callback = arg3; + }else if(typeof arg3 == 'undefined' && typeof arg2 != 'function'){ + sR.thisCallArgs.callback = sR.defaults.callback; + } + var $cells = $(this).find('td'); + $cells.wrapInner('