From e190e8cd3b61d39c8adb8dbabb68ae76a960092b Mon Sep 17 00:00:00 2001 From: harpiain@gmail.com Date: Wed, 26 Aug 2009 05:35:12 +0000 Subject: [PATCH] - merge de branch (2.4) revisão [839:850] --- admin/softwares/classificacao_software.php | 112 ---------------------------------------------------------------------------------------------------------------- admin/softwares/softwares_classificar.class.php | 239 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/softwares/softwares_classificar.php | 43 +++++++++++++++++++++++++++++++++++++++++++ admin/softwares/softwares_classificar_01.tmpl.php | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/softwares/softwares_classificar_tipo_svgimage.php | 24 ++++++++++++++++++++++++ bibliotecas/security/security.php | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++--- common/cacic_common.class.php | 319 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ common/cacic_common_01.css | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ common/cacic_common_01.tmpl.php | 171 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ instalador/sql/cacic_demonstracao.sql | 3 +++ language/en_US/menu_adm.txt | 2 +- language/es_UR/menu_adm.txt | 2 +- language/pt_BR/language.pt_BR.inc.php | 12 ++++++++++++ language/pt_BR/menu_adm.txt | 2 +- 14 files changed, 1023 insertions(+), 118 deletions(-) delete mode 100755 admin/softwares/classificacao_software.php create mode 100755 admin/softwares/softwares_classificar.class.php create mode 100644 admin/softwares/softwares_classificar.php create mode 100755 admin/softwares/softwares_classificar_01.tmpl.php create mode 100644 admin/softwares/softwares_classificar_tipo_svgimage.php create mode 100755 common/cacic_common.class.php create mode 100644 common/cacic_common_01.css create mode 100755 common/cacic_common_01.tmpl.php diff --git a/admin/softwares/classificacao_software.php b/admin/softwares/classificacao_software.php deleted file mode 100755 index 1c520c0..0000000 --- a/admin/softwares/classificacao_software.php +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - -
_('Formulario para classificacao de softwares');?>
-
- - - - - - - - - - - - - -
- - - - - - - - - -
_('Selecione os softwares que deseja classificar:');?>
- - - - - - - - - - - - - - - - - - - - - - -
  
_('Nao classificados:');?>
     _('Selecionados:');?>  _('Tipo do software:');?>  
 
- -
   
- -
-
- -
       - _('Ocorreu um erro durante a consulta a tabela tipos_software ou sua sessao expirou!')); - while ($row = mysql_fetch_array($result)) - { - ?> -
- - -
 
- - - -
 
- - - - - - -
- 1&&$_SESSION['cs_nivel_administracao']<>3?'disabled':'')?>> -
 
-
- - diff --git a/admin/softwares/softwares_classificar.class.php b/admin/softwares/softwares_classificar.class.php new file mode 100755 index 0000000..aaad0e2 --- /dev/null +++ b/admin/softwares/softwares_classificar.class.php @@ -0,0 +1,239 @@ + + * @copyright Copyright (C) 2008 Adriano dos Santos Vieira. All rights reserved. + * @license GNU/GPL, see LICENSE.php + * CACIC is free software and parts of it may contain or be derived from the + * GNU General Public License or other free or open source software licenses. + * See COPYRIGHT.php for copyright notices and details. + */ + +// direct access is denied +defined( 'CACIC' ) or die( 'Acesso restrito (Restricted access)!' ); + +/* + * Classe geral para configurações + */ + include_once('common/cacic_common.class.php'); + +/** + * Implementa classificação/reclassificação de Softwares Inventariados + */ + class Softwares_Classificar extends Cacic_Common { + + function Softwares_Classificar() { + parent::Cacic_Common(); + $titulo = $this->oTranslator->_('Classificacao de softwares'); + /* + * Inicializa template com textos basicos + */ + $this->setPageTitle( $titulo ); + + $this->setNamespace('softwareClassificacao'); + $this->setRoot(dirname(__FILE__)); + $this->readTemplatesFromInput('softwares_classificar_01.tmpl.php'); + + $this->addVar('SoftwaresClassificar', 'CACIC_URL', CACIC_URL ); + $this->addVar('SoftwaresClassificar_form', 'TITULO', $titulo ); + $this->addVar('SoftwaresClassificar_form', 'DESCRICAO', $this->oTranslator->_('Classificacao de softwares conforme tipos possiveis') ); + $this->addVar('SoftwaresClassificar_form', 'SOFTWARE_CLASSIFICADO_SELECT', ''.$this->oTranslator->_('Apenas os nao classificados?')."" ); + $this->addVar('SoftwaresClassificar_form', 'SOFTWARE_NAME_TITLE', $this->oTranslator->_('Nome do software') ); + $this->addVar('SoftwaresClassificar_form', 'NO', $this->oTranslator->_('Nao') ); + $this->addVar('SoftwaresClassificar_form', 'YES', $this->oTranslator->_('Sim') ); + $this->addRows('SoftwaresType_list', $this->fillListSoftwaresType() ); + $this->addVar('SoftwaresClassificar_form', 'COLSPAN', 20 ); + $this->addVar('SoftwaresClassificar_form', 'BTN_SALVAR', $this->oTranslator->_('Gravar alteracoes') ); + $this->addVar('SoftwaresClassificar_form', 'BTN_SALVAR_DENY', ($this->isAdminUser()?'enabled':'disabled')); + $this->addVar('SoftwaresClassificar_form', 'BTN_RESET', $this->oTranslator->_('Restaurar valores') ); + } + + /** + * Armazena na "sessao" os dados de configuração padrao + * @access public + */ + function setup() { + global $cacic_common; + parent::setup(); + $cacic_common['padrao'] = 'Definicoes padrao para pre-preenchimento de campos'; + } + + /** + * Executa a configuracao padrão do CACIC + * @access public + */ + function run() { + $this->clearVar('SoftwaresClassificar_form', 'SET_FOCUS'); + $this->addVar('SoftwaresClassificar_form', 'SET_FOCUS', 'nm_organizacao' ); + $btn_salvar = Security::read('btn_salvar'); + if(isset($btn_salvar) and ($btn_salvar)) { + try { + $this->salvarDados(); + } + catch( Exception $erro ) { + $msg = ''; + $msg .= ''.$erro->getMessage().""; + $this->setMessageText($msg); + } + } + $this->fillForm($btn_salvar); + $this->showForm(); + } + + /** + * Executa a configuracao padrão do CACIC + * @access public + */ + function salvarDados() { + $error = true; + $msg = $this->oTranslator->_('Ocorreu erro no processamento... '); + /* + * Obtem dados do formulario + */ + $software_classificado = Security::read('software_classificado'); + + /* + * monta sql de atualizacao dos dados padrao + */ + $sql_update = ''; + foreach($software_classificado as $id_software => $id_tipo) { + $sql_update = "update softwares_inventariados set id_tipo_software = " . $id_tipo . + " where id_software_inventariado = ".$id_software."; "; + + /* + * Atualiza dados na tabela + */ + $db_result = mysql_query($sql_update); + $error = mysql_errno($this->db_link); + $msg .= $this->oTranslator->_('kciq_msg server msg').": "; + $msg .= mysql_error($this->db_link); + + /* + * Lança execeção se ocorrer erro + */ + ($error) ? $this->throwError($msg):""; + } + + $this->setMessageText(''.$this->oTranslator->_('Processamento realizado com sucesso').""); + } + + /** + * Obtem e preenche dados de formulario - tipos de software + * @access private + */ + function fillListSoftwaresType() { + $sql = "select * from tipos_software order by id_tipo_software"; + $db_result = mysql_query($sql); + $list = array(); + while( $tipos = mysql_fetch_assoc($db_result) ) { + $_arrAux = array( array('SOFTWARE_TYPE_NAME'=>$tipos['te_descricao_tipo_software'] ) ); + $list = array_merge($list, $_arrAux); + } + return $list; + } + + /** + * Obtem e preenche dados de formulario + * @access private + * @param string $btn_salvar Se botao para salvar foi acionado + */ + function fillForm($_btn_salvar) { + $sql = "select * from tipos_software order by id_tipo_software"; + $db_result = mysql_query($sql); + $_tipos_list = array(); + while( $tipos = mysql_fetch_assoc($db_result) ) { + $_tipos_list[ $tipos['id_tipo_software'] ]['te_descricao_tipo_software'] = $tipos['te_descricao_tipo_software']; + } + + /* + * Obtem dados do formulario + */ + $software_classificado = Security::read('software_classificado'); + $software_nao_classificado = Security::read('software_nao_classificado'); + + $this->addVar('SoftwaresClassificar_form', 'YES_CHECKED', ((!isset($software_nao_classificado) or $software_nao_classificado)?'checked':'') ); + + $where = " where id_tipo_software=0 "; + if (isset($software_nao_classificado) and ($software_nao_classificado==0)) { + $where = " "; // esvazia a condicional de listagem + $this->addVar('SoftwaresClassificar_form', 'NO_CHECKED', 'checked' ); + } + + $sql_soft_count = "select count(*) as count from softwares_inventariados ".$where; + $db_result_soft = mysql_query($sql_soft_count); + $count = mysql_fetch_row($db_result_soft); + $this->setPageTotalItems($count[0]); + $this->setPageCurrent(); + $sql_soft = "select * from softwares_inventariados ".$where." limit ".$this->getPageItems()." offset ".$this->getPageFristItem(); + $db_result_soft = mysql_query($sql_soft); + $list = array(); + while( $soft = mysql_fetch_assoc($db_result_soft) ) { + $softwares_classificar_tipo = ""; + foreach($_tipos_list as $tipo_id => $tipo_valor) { + if($_btn_salvar) { + /* Obtem dados do formulario */ + if($software_classificado[$soft['id_software_inventariado']]) + $checked = ($tipo_id == $software_classificado[$soft['id_software_inventariado']] )?" checked ":""; + else /* Obtem dados do banco de dados */ + $checked = ($tipo_id == $soft['id_tipo_software'] )?" checked ":""; + } + else { + /* Obtem dados do banco de dados */ + $checked = ($tipo_id == $soft['id_tipo_software'] )?" checked ":""; + } + + $softwares_classificar_tipo .= ' + + + + '; + } + // monta linha de dados do software + $_arrAux = array( array( 'SOFTWARE_NAME'=>$soft['nm_software_inventariado'], + 'SOFTWARE_ID'=>$soft['id_software_inventariado'], + 'SOFTWARESCLASSIFICAR_TIPO'=>$softwares_classificar_tipo + ) ); + + $list = array_merge($list, $_arrAux); + } + $software_tipos_list = $list; + + /* + * Preenche formulário com dados + */ + $this->addRows('SoftwaresInventariados_list', $software_tipos_list ); + + } + + /** + * Mostra formulario da configuracao padrao + * @access private + */ + function showForm() { + // Monta cabecalho da pagina + $this->displayParsedTemplate('CacicCommon_head'); + // Monta cabecalho da pagina + $this->displayParsedTemplate('SoftwaresClassificar'); + + // Monta corpo da pagina + $page_to_show = $this->fillPagination(); + $this->addVar('SoftwaresClassificar_form', 'PAGE_CURRENT', $page_to_show); + $this->addVar('SoftwaresClassificar_form', 'PAGE_NEXT', $page_to_show+1); + $this->displayParsedTemplate('SoftwaresClassificar_form'); + + // Mostra paginacao + $this->displayParsedTemplate('CacicCommon_pagination'); + + // Monta area de mensages e rodape da pagina + $this->displayParsedTemplate('CacicCommon_messages'); + $this->displayParsedTemplate('CacicCommon_footer'); + } + } + +?> \ No newline at end of file diff --git a/admin/softwares/softwares_classificar.php b/admin/softwares/softwares_classificar.php new file mode 100644 index 0000000..ae6eb06 --- /dev/null +++ b/admin/softwares/softwares_classificar.php @@ -0,0 +1,43 @@ + + * @copyright Copyright (C) 2008 Adriano dos Santos Vieira. All rights reserved. + * @license GNU/GPL, see LICENSE.php + * CACIC is free software and parts of it may contain or be derived from the + * GNU General Public License or other free or open source software licenses. + * See COPYRIGHT.php for copyright notices and details. + */ + +//session_start(); +//session_destroy(); +session_unset(); +$time_start = microtime(true); +/* + * verifica se houve login e também regras para outras verificações (ex: permissões do usuário)! + */ +//if(!isset($_SESSION['id_usuario'])) +// die('Acesso restrito (Restricted access)!'); + +// Ativa modo de depuração (mostra todas as mensagens na página) +// $cacicDebug = true; + +include_once('../../include/library.php'); +//AntiSpy('1,2,3'); // Permitido somente a estes cs_nivel_administracao... + +require_once('softwares_classificar.class.php'); + +$oCacicAdminRede = new Softwares_Classificar(); +$oCacicAdminRede->setup(); +$oCacicAdminRede->run(); + +/* + * Contabiliza tempo de processamento da página + */ +$time_end = microtime(true); +$time_proc = ($time_end-$time_start); +echo '"; + +?> diff --git a/admin/softwares/softwares_classificar_01.tmpl.php b/admin/softwares/softwares_classificar_01.tmpl.php new file mode 100755 index 0000000..98c82a7 --- /dev/null +++ b/admin/softwares/softwares_classificar_01.tmpl.php @@ -0,0 +1,79 @@ + + * @copyright Copyright (C) 2008 Adriano dos Santos Vieira. All rights reserved. + * @license GNU/GPL, see LICENSE.php + * CACIC is free software and parts of it may contain or be derived from the + * GNU General Public License or other free or open source software licenses. + * See COPYRIGHT.php for copyright notices and details. + * + * Templates para configuração (Padrao) do CACIC + */ + +// direct access is denied +defined( 'CACIC' ) or die( 'Acesso restrito (Restricted access)!' ); + +?> + + + + + + +
+ + + + + + + +
+ + {TITULO} +
+
+ {DESCRICAO} + + + + + + + + + + + + + + + {SOFTWARESCLASSIFICAR_TIPO} + + + + + +
{SOFTWARE_CLASSIFICADO_SELECT} + + {YES} + {NO} +
{SOFTWARE_NAME_TITLE} + + +
+ {SOFTWARE_NAME} +
+ + + + + +
+
+
+
+
diff --git a/admin/softwares/softwares_classificar_tipo_svgimage.php b/admin/softwares/softwares_classificar_tipo_svgimage.php new file mode 100644 index 0000000..b812d77 --- /dev/null +++ b/admin/softwares/softwares_classificar_tipo_svgimage.php @@ -0,0 +1,24 @@ + + * @copyright Copyright (C) 2008 Adriano dos Santos Vieira. All rights reserved. + * @license GNU/GPL, see LICENSE.php + * CACIC is free software and parts of it may contain or be derived from the + * GNU General Public License or other free or open source software licenses. + * See COPYRIGHT.php for copyright notices and details. + * + * Gerador de imagem svg para tipos de software a ser classificado + */ +header('Content-Type: image/svg+xml'); + echo ''; +?> + + + + diff --git a/bibliotecas/security/security.php b/bibliotecas/security/security.php index 81c7e68..03cc0b1 100644 --- a/bibliotecas/security/security.php +++ b/bibliotecas/security/security.php @@ -27,11 +27,11 @@ defined( 'SECURITY' ) or die( 'Acesso restrito (Restricted access)!' ); * @param array $_POST_GET array data to read value on * @return mixed the required variable */ - function read($var2read, $_POST_GET='') { + function read($_var2read, $_POST_GET='') { if(!empty($_POST_GET) and is_array($_POST_GET)) - $read_var = @$_POST_GET[$var2read]; + $read_var = @$_POST_GET[$_var2read]; else - $read_var = @$_REQUEST[$var2read]; + $read_var = @$_REQUEST[$_var2read]; /* * tratar segurança na variavel lida @@ -39,4 +39,51 @@ defined( 'SECURITY' ) or die( 'Acesso restrito (Restricted access)!' ); return $read_var; } // end func read + + /** + * Read integer value from form data + * @access public + * @param key_index $var2read index key on POST or GET vars + * @return int a typecasted integer value + */ + function getInt($_var2read) { + $int = (int)(Security::read($_var2read)); + return $int; + } // end func getInt + + /** + * Read float value from form data + * @access public + * @param key_index $var2read index key on POST or GET vars + * @return float a typecasted float value + */ + function getFloat($_var2read) { + $float = (float)(Security::read($_var2read)); + return $float; + } // end func getFloat + + /** + * Read string value from form data + * @access public + * @param key_index $var2read index key on POST or GET vars + * @return string a typecasted string value + */ + function getString($_var2read) { + $string = (string)(Security::read($_var2read)); + return $string; + } // end func getString :P + + /** + * Read escaped string value from form data to MySQL DBMS + * @access public + * @param key_index $var2read index key on POST or GET vars + * @return string a escaped typecasted string value + */ + function getStringEscaped($_var2read) { + $string = (string)(Security::read($_var2read)); + // esse função mysql está obsoleta no php-5.3 e será removida no php-6 + $string = mysql_escape_string($string); + return $string; + } // end func getStringEscaped + } // end class Security diff --git a/common/cacic_common.class.php b/common/cacic_common.class.php new file mode 100755 index 0000000..a3a1459 --- /dev/null +++ b/common/cacic_common.class.php @@ -0,0 +1,319 @@ + + * @copyright Copyright (C) 2008 Adriano dos Santos Vieira. All rights reserved. + * @license GNU/GPL, see LICENSE.php + * CACIC is free software and parts of it may contain or be derived from the + * GNU General Public License or other free or open source software licenses. + * See COPYRIGHT.php for copyright notices and details. + */ + +// direct access is denied +defined( 'CACIC' ) or die( 'Acesso restrito (Restricted access)!' ); + +/* + * Classe de templates + */ +if( ! @include("pat/patErrorManager.php") ) +{ + die('Erro na inclusão da biblioteca patTemplate! (patTemplate include error!).'); +} +if( ! @include("pat/patError.php") ) +{ + die('Erro na inclusão da biblioteca patTemplate! (patTemplate include error!).'); +} +if( ! @include("pat/patTemplate.php") ) +{ + die('Erro na inclusão da biblioteca patTemplate! (patTemplate include error!).'); +} + +/* + * Uma classe para implementar segurança em transações + */ + define( 'SECURITY', 1 ); + require_once('security/security.php'); + + /** + * Dados de configuração para o CACIC + */ + unset($cacic_common); + + define(DISABLED, 'disabled'); + +/** + * Classe para definições de configurações + */ + class Cacic_Common extends patTemplate { + + + var $setup_type; + + /** + * Componente (objeto) para traduções + */ + var $oTranslator; + + /** + * Componente (objeto) para acesso a banco de dados + */ + var $db_link; + + /** + * Itens por página em paginação + */ + var $pagination_items = 20; + + /** + * Conterá a página apresentada (corrente) + */ + var $pagination_current_page; + + /** + * Conterá a quantidade total de itens a serem mostrados + */ + var $pagination_total_items; + + function Cacic_Common() { + global $oTranslator, $ip_servidor, $usuario_bd, $senha_usuario_bd, $nome_bd; + $this->db_link = mysql_connect( $ip_servidor, $usuario_bd, $senha_usuario_bd); + mysql_select_db($nome_bd,$this->db_link); + parent::patTemplate(); + $this->oTranslator = $oTranslator; + /* + * Inicializa template + */ + $this->setNamespace('cacicCommon'); + $this->setRoot(dirname(__FILE__)); + $this->readTemplatesFromInput('cacic_common_01.tmpl.php'); + + $this->addVar('CacicCommon_head', 'CACIC_TITLE', $this->oTranslator->_('Configuracao Basica') ); + $this->addVar('CacicCommon_head', 'CACIC_LANG', CACIC_LANGUAGE ); + $this->addVar('CacicCommon_head', 'CACIC_LANG_CHARSET', CACIC_LANG_CHARSET ); + $this->addVar('CacicCommon_head', 'CACIC_THEME', CACIC_THEME ); + $this->addVar('CacicCommon_head', 'CACIC_URL', CACIC_URL ); + $this->addVar('CacicCommon_messages', 'MESSAGES', $this->oTranslator->_('Mensagens') ); + + // Monta paginação + $this->addVar('CacicCommon_pagination', 'PAGE_TITLE', $this->oTranslator->_('Paginacao') ); + $this->addVar('CacicCommon_pagination_first', 'PAGE_TEXT', $this->oTranslator->_('Primeira') ); + $this->addVar('CacicCommon_pagination_first', 'PAGE_TEXT_TITLE', $this->oTranslator->_('Primeira pagina') ); + $this->addVar('CacicCommon_pagination_back', 'PAGE_TEXT', $this->oTranslator->_('Anterior') ); + $this->addVar('CacicCommon_pagination_back', 'PAGE_TEXT_TITLE', $this->oTranslator->_('Pagina anterior') ); + $this->addVar('CacicCommon_pagination_next', 'PAGE_TEXT', $this->oTranslator->_('Proxima') ); + $this->addVar('CacicCommon_pagination_next', 'PAGE_TEXT_TITLE', $this->oTranslator->_('Proxima pagina') ); + $this->addVar('CacicCommon_pagination_last', 'PAGE_TEXT', $this->oTranslator->_('Ultima') ); + $this->addVar('CacicCommon_pagination_last', 'PAGE_TEXT_TITLE', $this->oTranslator->_('Ultima pagina') ); + + } + + /** + * Armazena na "sessao" os dados de configuração comuns + * @access protected + */ + function setup() { + global $cacic_common; + $cacic_common['common'] = 'Declaracoes comuns ao sistema'; + } + + /** + * Atribui título da página + * @param string $_title Título a ser atríbuido à pagina + * @access protected + */ + function setPageTitle($_title) { + $this->clearVar('CacicCommon_head', 'CACIC_TITLE'); + $this->addVar('CacicCommon_head', 'CACIC_TITLE', $_title ); + } + + /** + * Verifica se é usuário administrador + * @access protected + */ + function isAdminUser() { + $is_admin_user = false; + $is_admin_user = ($_SESSION['cs_nivel_administracao']==1); + + return $is_admin_user; + } + + /** + * Atribui o tipo de configuração a ser processada + * @access protected + * @param string $msg A mensagem a ser mostrada + * @param boolean $js Mostra mensagem usando recurso de javascript + */ + function setMessageText($_msg, $_js=false) { + $this->clearVar('CacicCommon_messages_cond', 'MESSAGE'); + if($_js) + $this->addVar('CacicCommon_messages_cond', 'msgtype', 'js' ); + + $this->addVar('CacicCommon_messages_cond', 'MESSAGE', $_msg ); + } + + /** + * Lança execeção se ocorrer erro + * @access protected + */ + function throwError($_msg) { + throw new Exception($_msg); + } + + /** + * Obtem e preenche dados de paginacao + * @access private + * @param string $btn_salvar Se botao para salvar foi acionado + */ + function fillPagination($_total_items) { + // Monta paginação + $_page_to_show = Security::getInt('page'); + if(!$_page_to_show) + $_page_to_show = 1; + $this->setPageCurrent($_page_to_show); + + if($_total_items) + $this->setPageTotalItems($_total_items); + + $this->addVar('CacicCommon_pagination', 'PAGE_CURRENT', $_page_to_show ); + + + $show = (($this->getPageCurrent()==1 or $this->getPageCurrent()==0)?DISABLED:true); + $this->addVar('CacicCommon_pagination_first', 'SHOW', $show ); // SHOW: true, false, DISABLED + $this->addVar('CacicCommon_pagination_first', 'PAGE_NUMBER', 1 ); + + $this->addVar('CacicCommon_pagination_back', 'SHOW', $show ); + $this->addVar('CacicCommon_pagination_back', 'PAGE_NUMBER', $this->getPageBack() ); + + $this->addRows('CacicCommon_pages_list_cond', $this->pages2Show($_page_to_show, 10) ); + + $show = (($this->getPageNext()==$this->getPageLast())?DISABLED:true); + $this->addVar('CacicCommon_pagination_next', 'SHOW', $show ); + $this->addVar('CacicCommon_pagination_next', 'PAGE_NUMBER', $this->getPageNext() ); + + $show = (($this->getPageLast()==$this->getPageCurrent())?DISABLED:true); + $this->addVar('CacicCommon_pagination_last', 'SHOW', $show ); + $this->addVar('CacicCommon_pagination_last', 'PAGE_NUMBER', $this->getPageLast() ); + + return $_page_to_show; + } + + /** + * Atribui número de itens por página + */ + function setPageItems($_page_items) { + $this->pagination_items = $_page_items; + } + + /** + * Atribui número total de itens a paginar + */ + function setPageTotalItems($_total_items) { + $this->pagination_total_items = $_total_items; + } + + /** + * Obtem número de itens por página + */ + function getPageItems() { + return $this->pagination_items; + } + + /** + * Obtem número da página anterior + */ + function getPageBack() { + $page_back = ($this->pagination_current_page-1)<=0?1:$this->pagination_current_page-1; + return $page_back; + } + + /** + * Obtem número da próxima página + */ + function getPageNext() { + $page_next = ($this->pagination_current_page+1)>$this->getPageLast()?$this->getPageLast():$this->pagination_current_page+1; + return $page_next; + } + + /** + * Obtem número da última página + */ + function getPageLast() { + $page_last = (int)($this->pagination_total_items / $this->pagination_items); + return $page_last; + } + + /** + * Atribui número da página atual (corrente) + */ + function setPageCurrent($_page_current) { + $_page_current = ($_page_current?$_page_current:Security::getInt('page')); + $this->pagination_current_page = $_page_current; + } + + /** + * Obtem número da página atual (corrente) + */ + function getPageCurrent() { + return $this->pagination_current_page; + } + + /** + * Obtem número de itens por página (corrente ou de uma dada) + */ + function getPageFristItem($_page) { + $ret = ($this->pagination_current_page - 1) * $this->pagination_items; + if($_page) + $ret = ($_page - 1) * $this->pagination_items; + $ret = ($ret<=0?0:$ret); + return $ret; + } + + /** + * Prepara dados de paginacao + * @access private + * @param string $btn_salvar Se botao para salvar foi acionado + */ + function pages2Show( $_pages_to_show, $_count) { + if($_pages_to_show<=0) { + $_current_page = 1; + $_pages_to_show = 1; + } + else + $_current_page = $_pages_to_show; + + $count = 0; + $_pages_to_show = $_pages_to_show - (int)( $_count / 2); + $_pages_to_show = $_pages_to_show<=0?$_current_page:$_pages_to_show; + $pages_show = array(); + while ($count < $_count) { + $count++; + $class_current_page = ($_pages_to_show==$_current_page?'currentpage':''); + $pages = array( array( 'PAGE_TEXT' => $this->oTranslator->_($_pages_to_show), + 'PAGE_NUMBER'=> $_pages_to_show, + 'DISABLED'=>($class_current_page?DISABLED:false), + 'CLASS_CURRENT_PAGE'=>$class_current_page + ) + ); + $pages_show = array_merge($pages_show, $pages); + $_pages_to_show++; + } + + return $pages_show; + } + + + /** + * Dump de variaceis + * @access protected + */ + function varDump($_var) { + echo "
";
+    	var_dump($_var);
+    	echo "
"; + } + + } + +?> \ No newline at end of file diff --git a/common/cacic_common_01.css b/common/cacic_common_01.css new file mode 100644 index 0000000..427a39a --- /dev/null +++ b/common/cacic_common_01.css @@ -0,0 +1,80 @@ +/** + * @version $Id: cacic_common.class.tmpl.php 2009-02-19 22:28 harpiain $ + * @package CACIC-Common + * @subpackage CacicTemplate + * @author Adriano dos Santos Vieira + * @copyright Copyright (C) 2008 Adriano dos Santos Vieira. All rights reserved. + * @license GNU/GPL, see LICENSE.php + * CACIC is free software and parts of it may contain or be derived from the + * GNU General Public License or other free or open source software licenses. + * See COPYRIGHT.php for copyright notices and details. + * + * CSS padrão para o CACIC + */ + +.pagination table { + text-align: justify; + color: black; + width: 98%; + margin-left: auto; + margin-right: auto; + border: 0; + padding: 0; +} + +/* Adaptado de: + Credits: Dynamic Drive CSS Library + URL: http://www.dynamicdrive.com/style/ */ + +.pagination, .pagination input { + padding: 2px; + font-size: 11px; +} + +.pagination ul { + margin: 0; + padding: 0; + text-align: right; /* left, right, center to change alignment pagination interface*/ + font-size: 10px; +} + +.pagination li { + list-style-type: none; + display: inline; + padding-bottom: 1px; +} + +.pagination span { + padding: 0 5px; + border: 1px solid #DD6900; + text-decoration: none; + color: #FF9966; +} + +.pagination span:hover { + border: 1px solid #DD6900; + color: #6B1400; + background-color: #FFFF80; + cursor: pointer; +} + +.pagination span.currentpage { + background-color: #6B1400; + color: #FFF !important; + border-color: #2b66a5; + font-weight: bold; + cursor: default; +} + +.pagination span.prevnextdisabled, +.pagination span.prevnextdisabled:hover { + background-color: white; + cursor: default; + color: #929292; + border-color: #929292; + font-weight: normal !important; +} + +.pagination span.prevnext { + font-weight: bold; +} diff --git a/common/cacic_common_01.tmpl.php b/common/cacic_common_01.tmpl.php new file mode 100755 index 0000000..00bc158 --- /dev/null +++ b/common/cacic_common_01.tmpl.php @@ -0,0 +1,171 @@ + + * @copyright Copyright (C) 2008 Adriano dos Santos Vieira. All rights reserved. + * @license GNU/GPL, see LICENSE.php + * CACIC is free software and parts of it may contain or be derived from the + * GNU General Public License or other free or open source software licenses. + * See COPYRIGHT.php for copyright notices and details. + * + * Templates padrão para o CACIC + */ + +// direct access is denied +defined( 'CACIC' ) or die( 'Acesso restrito (Restricted access)!' ); +?> + + + + {CACIC_TITLE} + + + + + + + + + +
+ + + +
+ + + + +
+
+ {MESSAGES} + + + + + + {MESSAGE} + + +
+
+ + + + + + + + + + + diff --git a/instalador/sql/cacic_demonstracao.sql b/instalador/sql/cacic_demonstracao.sql index 89046dc..9c0a73b 100644 --- a/instalador/sql/cacic_demonstracao.sql +++ b/instalador/sql/cacic_demonstracao.sql @@ -1552,3 +1552,6 @@ UNLOCK TABLES; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2009-05-26 1:09:34 + +-- Reinicializa a senha do administrador +UPDATE usuarios SET te_senha=PASSWORD(nm_usuario_acesso); diff --git a/language/en_US/menu_adm.txt b/language/en_US/menu_adm.txt index b0412d8..7340c6b 100755 --- a/language/en_US/menu_adm.txt +++ b/language/en_US/menu_adm.txt @@ -3,7 +3,7 @@ ..Standard Setup|admin/configuracao.php|mainFrame||Systen standard setup ..Server Setup|admin/config_gerais.php|mainFrame||Server module setup ..Client Setup|admin/config_agentes.php|mainFrame||Client module setup -..Classificar Softwares|admin/softwares/classificacao_software.php|mainFrame|| +..Classificar Softwares|admin/softwares/softwares_classificar.php|mainFrame|| ..Softwares Não Usados|admin/softwares/remover_softwares_nao_instalados.php|mainFrame|| ..Módulos|admin/modulos.php|mainFrame||Configurações dos vários módulos disponíveis do CACIC ..Logs||mainFrame|imgs/config_gerais.gif diff --git a/language/es_UR/menu_adm.txt b/language/es_UR/menu_adm.txt index c568bfb..ea31f3b 100755 --- a/language/es_UR/menu_adm.txt +++ b/language/es_UR/menu_adm.txt @@ -3,7 +3,7 @@ ..Configurar Padrones|admin/configuracao.php|mainFrame||Configuraciones Padron para el Sistema ..Configurar Gerente|admin/config_gerais.php|mainFrame||Configuraciones del Módulo Gerente ..Configurar Agentes|admin/config_agentes.php|mainFrame||Configuraciones del Módulo Agente -..Clasificar Softwares|admin/softwares/classificacao_software.php|mainFrame|| +..Clasificar Softwares|admin/softwares/softwares_classificar.php|mainFrame|| ..Softwares No Usados|admin/softwares/remover_softwares_nao_instalados.php|mainFrame|| ..Módulos|admin/modulos.php|mainFrame||Configuraciones de varios modulos disponibles de CACIC ..Logs||mainFrame|imgs/config_gerais.gif diff --git a/language/pt_BR/language.pt_BR.inc.php b/language/pt_BR/language.pt_BR.inc.php index 88a2d47..915bd18 100644 --- a/language/pt_BR/language.pt_BR.inc.php +++ b/language/pt_BR/language.pt_BR.inc.php @@ -1014,3 +1014,15 @@ pt_BR versao do internet explorer pt_BR versao do pattern relatoriosinfo Versão do pattern pt_BR versoes de softwares basicos relatoriosinfo Versões de softwares básicos pt_BR ultimo login relatoriosinfo Último login +pt_BR classificacao de softwares softwares info Classificacao de softwares +pt_BR classificacao de softwares conforme tipos possiveis softwares info Classificacao de softwares conforme tipos possiveis +pt_BR apenas os nao classificados? softwares info Apenas os nao classificados? +pt_BR paginacao geral info Paginacao +pt_BR primeira geral info Primeira +pt_BR primeira pagina geral info Primeira pagina +pt_BR anterior geral info Anterior +pt_BR pagina anterior geral info Pagina anterior +pt_BR proxima geral info Proxima +pt_BR proxima pagina geral info Proxima pagina +pt_BR ultima geral info Ultima +pt_BR ultima pagina geral info Ultima pagina diff --git a/language/pt_BR/menu_adm.txt b/language/pt_BR/menu_adm.txt index 95401c6..9210bec 100755 --- a/language/pt_BR/menu_adm.txt +++ b/language/pt_BR/menu_adm.txt @@ -3,7 +3,7 @@ ..Configurar Padrões|admin/configuracao.php|mainFrame||Configurações Padrão para o Sistema ..Configurar Gerente|admin/config_gerais.php|mainFrame||Configurações do Módulo Gerente ..Configurar Agentes|admin/config_agentes.php|mainFrame||Configurações do Módulo Agente -..Classificar Softwares|admin/softwares/classificacao_software.php|mainFrame|| +..Classificar Softwares|admin/softwares/softwares_classificar.php|mainFrame|| ..Softwares Não Usados|admin/softwares/remover_softwares_nao_instalados.php|mainFrame|| ..Módulos|admin/modulos.php|mainFrame||Configurações dos vários módulos disponíveis do CACIC ..Logs||mainFrame|imgs/config_gerais.gif -- libgit2 0.21.2