예제 #1
0
 public function MenuProfileSystem()
 {
     $urlSica = rtrim(\Zend_Controller_Front::getInstance()->getParam('bootstrap')->getOption('urlSica'), '/');
     $infoSystem = \Core_Integration_Sica_User::getInfoSystem();
     $urlHelp = array_key_exists('txUrlHelp', (array) $infoSystem) ? $infoSystem['txUrlHelp'] : '#';
     $html = '<ul class="nav pull-right dropdown-perfil">
             <li class="divider-vertical visible-desktop"></li>
             <li class="dropdown pull-right">
             <a data-toggle="dropdown" class="dropdown-toggle" href="#">
             <img src="/img/icons/icon-perfil.png">
             </a>
             <ul class="dropdown-menu">';
     $html .= '<li><span>Nome: ' . $this->view->userName() . '</span></li>';
     $html .= '<li><span>Perfil: ' . \Core_Integration_Sica_User::getUserNoProfile() . '</span></li>';
     if (\Core_Integration_Sica_User::getUserProfileExternal()) {
         $linkHelp = '';
         $html .= '<li class="divider"></li>';
         if (count(\Core_Integration_Sica_User::getUserAllProfile()) > 1) {
             $html .= $this->view->usuarioExterno()->optionSelecionarPerfil();
         }
         $html .= $this->view->usuarioExterno()->optionAlterarCadastro();
     } else {
         $linkHelp = '<li><a href="' . $urlHelp . '" target="_blank">Ajuda</a></li>';
         $html .= $this->view->usuario()->optionUnidadeOrg();
         $html .= '<li class="divider"></li>';
         if (count(\Core_Integration_Sica_User::getUserAllProfile()) > 1) {
             $html .= $this->view->usuario()->optionSelecionarPerfil();
         }
     }
     $html .= '<li><a href="' . $urlSica . '/index/home/change/password">Alterar Senha</a></li>';
     $html .= $linkHelp;
     $html .= '<li><a href="' . $urlSica . '/usuario/logout">Sair</a></li>';
     $html .= '</ul></li><li class="divider-vertical visible-desktop"></li>';
     return $html;
 }
예제 #2
0
 public function MenuProfileSystem()
 {
     $infoSystem = Core_Integration_Sica_User::getInfoSystem();
     $urlHelp = array_key_exists('txUrlHelp', (array) $infoSystem) ? $infoSystem['txUrlHelp'] : '#';
     $html = '<ul class="nav pull-right dropdown-perfil">
             <li class="divider-vertical visible-desktop"></li>
             <li class="dropdown pull-right">
             <a data-toggle="dropdown" class="dropdown-toggle" href="#">
             <img src="/assets/img/icons/icon-perfil.png">
             </a>
             <ul class="dropdown-menu">';
     $html .= '<li><span>Nome: ' . $this->view->userName() . '</span></li>';
     $html .= '<li><span>Perfil: ' . Core_Integration_Sica_User::getUserNoProfile() . '</span></li>';
     if (\Core_Integration_Sica_User::getUserProfileExternal()) {
         $linkHelp = '';
         $html .= '<li class="divider"></li>';
         if (count(\Core_Integration_Sica_User::getUserAllProfile()) > 1) {
             $html .= $this->view->usuarioExterno()->optionSelecionarPerfil();
         }
         $html .= $this->view->usuarioExterno()->optionAlterarCadastro();
     } else {
         $linkHelp = '<li><a href="' . $urlHelp . '" target="_blank">Ajuda</a></li>';
         $html .= $this->view->usuario()->optionUnidadeOrg();
         $html .= '<li class="divider"></li>';
         if (count(\Core_Integration_Sica_User::getUserAllProfile()) > 1) {
             $html .= $this->view->usuario()->optionSelecionarPerfil();
         }
     }
     $html .= '<li><a data-toggle="modal" data-backdrop="static" data-keyboard="false" ' . 'href="#modal-alterar-senha" id="btn-alterar-senha">Alterar Senha</a></li>';
     $html .= $linkHelp;
     $html .= '<li><a href="' . $this->view->usuario()->urlLogout() . '">Sair</a></li>';
     $html .= '</ul></li><li class="divider-vertical visible-desktop"></li>';
     return $html;
 }
예제 #3
0
 public function systemLoggedAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $infoSystem = \Core_Integration_Sica_User::getInfoSystem();
     $this->_helper->json($infoSystem);
 }
예제 #4
0
 public function logoSystem()
 {
     $infoSystem = Core_Integration_Sica_User::getInfoSystem();
     $configs = Core_Registry::get('configs');
     $systemId = isset($infoSystem['sqSistema']) ? $infoSystem['sqSistema'] : null;
     $systemAlias = isset($infoSystem['sgSistema']) ? $infoSystem['sgSistema'] : null;
     $urlImagem = rtrim($configs['urlSica']) . '/sistema/render-logo/id/' . $systemId;
     return "<img src=\"{$urlImagem}\" alt=\"{$systemAlias}\" width=\"120\" height=\"70\">";
 }
예제 #5
0
 public function optionSelecionarPerfil()
 {
     $sistema = \Core_Integration_Sica_User::getInfoSystem();
     $urlSica = rtrim(Zend_Controller_Front::getInstance()->getParam('bootstrap')->getOption('urlSica'), '/');
     return '<li><a ' . 'href="javascript:Sistemas.verifica(\'' . $urlSica . '\',' . $sistema['sqSistema'] . ');">' . 'Selecionar Perfil</a></li>';
     //        $html = '<li><a data-toggle="modal" data-keyboard="false" data-backdrop="static" href="#modal-usuario-perfil">Selecionar Perfil</a></li>';
     //
     //        return $html;
 }
예제 #6
0
 /**
  *
  */
 protected static function getParams($data, $type, $options, $metodo)
 {
     self::checaOperacaoWs($metodo);
     $sqUsuario = \Core_Integration_Sica_User::getUserId() ? \Core_Integration_Sica_User::getUserId() : null;
     $perfilUsuario = isset($_SESSION["USER"]) ? \Core_Integration_Sica_User::getUserProfileExternal() : true;
     $sistema = \Core_Integration_Sica_User::getInfoSystem(\Core_Integration_Sica_User::getUserSystem());
     $request = new \Zend_Controller_Request_Http();
     $arrRequest = explode('/', $request->getRequestUri());
     $params = array('sqSistema' => (int) $sistema['sqSistema'], 'sgSistema' => (string) $sistema['sgSistema'], 'sqClasse' => 0, 'noClasse' => (string) $arrRequest[1] . '/' . $arrRequest[2], 'sqMetodo' => 0, 'noMetodo' => (string) 'index', 'sqUsuario' => $sqUsuario, 'sgOperacao' => self::$sqOperacao, 'stUsuarioExterno' => (int) $perfilUsuario);
     $params['xmTrilha'] = self::geraTagXml($type);
     return $params;
 }
예제 #7
0
 /**
  *
  */
 protected static function getParams($data, $type, $options, $metodo)
 {
     self::checaOperacaoWs($metodo);
     $session = \Core_Integration_Sica_User::has();
     $sqUsuario = \Core_Integration_Sica_User::getUserId() ? \Core_Integration_Sica_User::getUserId() : null;
     $perfilUsuario = $session ? \Core_Integration_Sica_User::getUserProfileExternal() : true;
     $sistema = \Core_Integration_Sica_User::getInfoSystem(\Core_Integration_Sica_User::getUserSystem());
     $sis = \Zend_Registry::get('doctrine')->getEntityManager()->getRepository('app:Sistema')->findBySgSistema('SICA-e');
     $sqSistema = $session ? $sistema['sqSistema'] : $sis[0]->getSqSistema();
     $sgSistema = $session ? $sistema['sgSistema'] : $sis[0]->getSgSistema();
     $request = new \Zend_Controller_Request_Http();
     $arrRequest = explode('/', $request->getRequestUri());
     $params = array('sqSistema' => (int) $sqSistema, 'sgSistema' => (string) $sgSistema, 'sqClasse' => self::NUM_ZERO, 'noClasse' => (string) $arrRequest[1] . '/' . $arrRequest[2], 'sqMetodo' => self::NUM_ZERO, 'noMetodo' => (string) 'index', 'sqUsuario' => $sqUsuario, 'sgOperacao' => self::$sqOperacao, 'stUsuarioExterno' => (int) $perfilUsuario);
     $params['xmTrilha'] = self::geraTagXml($type);
     return $params;
 }
예제 #8
0
 private static function geraTagXml($columns, $metadata, $args)
 {
     $sistema = Core_Integration_Sica_User::getInfoSystem(Core_Integration_Sica_User::getUserSystem());
     $schema = current($args->getEntityManager()->getConnection()->getSchemaManager()->getSchemaSearchPaths());
     $request = new Zend_Controller_Request_Http();
     $arrRequest = explode('/', $request->getRequestUri());
     $rota = (string) $arrRequest[1] . '/' . $arrRequest[2];
     $vCont = 0;
     $xml = new XMLWriter();
     $xml->openMemory();
     $xml->startDocument('1.0', 'UTF-8');
     $xml->startElement("schema");
     $xml->writeElement("nome", $schema);
     $xml->writeElement("rota", $rota);
     $xml->startElement("tabela");
     $xml->writeElement("nome", $metadata->getTableName());
     foreach ($columns as $key => $value) {
         $xml->startElement("coluna");
         $xml->writeElement("nome", $key);
         $xml->writeElement("valor", $value);
         $xml->endElement();
         $vCont++;
     }
     $xml->endElement();
     $xml->endElement();
     return $xml->outputMemory(true);
 }
예제 #9
0
 public function optionSelecionarPerfil()
 {
     $sistema = \Core_Integration_Sica_User::getInfoSystem();
     return '<li><a ' . 'href="javascript:Sistemas.verifica(' . $sistema['sqSistema'] . ');">' . 'Selecionar Perfil</a></li>';
 }
예제 #10
0
 /**
  * $sqSistema   = Sigla do sistema
  * $sqClass     = sequencial da class, para indefinido utilize 0 (zero)
  * $sqMetodo    = sequencial do metodo, para indefinido utilize 0 (zero)
  * $noSchema    = Nome do Schema
  * $noTabela    = Nome da tabela
  * $sqUsuario   = Usuario logado
  * $sgOperacao  = I, U, D
  * $columns     = {campo1, campo2, campo3}
  * $values      = {value1, value2, value3}
  * @param \Doctrine\ORM\Event\LifecycleEventArgs $args
  */
 protected static function getParams(LifecycleEventArgs $args)
 {
     $metadata = $args->getEntityManager()->getClassMetadata(get_class($args->getEntity()));
     $sistema = Core_Integration_Sica_User::getInfoSystem(Core_Integration_Sica_User::getUserSystem());
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $params = array('sgSistema' => (string) $sistema['sgSistema'], 'noClasse' => $request->getModuleName() . '/' . $request->getControllerName(), 'noMetodo' => $request->getActionName(), 'sqUsuario' => \Core_Integration_Sica_User::getUserId(), 'sgOperacao' => self::$sqOperacao, 'stUsuarioExterno' => 0);
     $columns = array();
     $values = array();
     $associationMaps = array_merge($metadata->getFieldNames(), $metadata->getAssociationNames());
     foreach ($associationMaps as $name) {
         $value = $metadata->getFieldValue($args->getEntity(), $name);
         $column = $metadata->getColumnName($name);
         if ($metadata->hasAssociation($name)) {
             $associationMap = $metadata->getAssociationMapping($name);
             $value = self::validateValue($value, $args);
             if (isset($associationMap['sourceToTargetKeyColumns'])) {
                 $column = key($associationMap['sourceToTargetKeyColumns']);
             } else {
                 $column = $associationMap['fieldName'];
             }
         }
         array_push($columns, $column);
         array_push($values, $value);
     }
     foreach ($values as $key => $value) {
         if (NULL === $value) {
             $values[$key] = '';
         }
         if (!count($value)) {
             $values[$key] = '';
         }
     }
     self::trataAlgo($values);
     $params['xmTrilha'] = self::geraTagXml($columns, $values, $metadata, $args);
     return $params;
 }
예제 #11
0
 public function optionSelecionarPerfil()
 {
     $sistema = \Core_Integration_Sica_User::getInfoSystem();
     $urlSica = rtrim(Zend_Controller_Front::getInstance()->getParam('bootstrap')->getOption('urlSica'), '/');
     return '<li><a href="javascript:Sistemas.verifica(\'' . $urlSica . '\',' . $sistema['sqSistema'] . ');">' . 'Selecionar Perfil</a></li>';
 }