Exemplo n.º 1
0
 public function index(Context $context)
 {
     $dir = MODULES_DIR . '/' . $context->getModulo()->getChave();
     $context->setParameter('js', array(__DIR__ . '/js/highcharts.js', __DIR__ . '/js/highcharts.exporting.js'));
     $query = $this->em()->createQuery("SELECT e FROM Novosga\\Model\\Unidade e WHERE e.status = 1 ORDER BY e.nome");
     $unidades = $query->getResult();
     $this->app()->view()->set('unidades', $unidades);
     $this->app()->view()->set('relatorios', $this->relatorios);
     $this->app()->view()->set('graficos', $this->graficos);
     $this->app()->view()->set('statusAtendimento', AtendimentoService::situacoes());
     $arr = array();
     foreach ($unidades as $u) {
         $arr[$u->getId()] = $u->getNome();
     }
     $this->app()->view()->set('unidadesJson', json_encode($arr));
     $this->app()->view()->set('now', DateUtil::now(_('d/m/Y')));
 }
Exemplo n.º 2
0
 private function checkMigration(Context $context)
 {
     $data = $context->session()->get(InstallData::SESSION_KEY);
     $db = new DatabaseConfig($data->database);
     $em = $db->createEntityManager();
     $version = Configuracao::get($em, 'version');
     $context->setParameter('currVersion', $version ? $version->getValor() : '');
 }