public function getAppRoute($route_name, $app_id = null)
 {
     if (!$this->mappingRepository) {
         $this->mappingRepository = $this->doctrine->getManager()->getRepository('UnifikSystemBundle:Mapping');
     }
     $mapping = $this->mappingRepository->findOneBy(array('app' => $app_id ? $app_id : $this->systemCore->getApplicationCore()->getApp()->getId(), 'type' => 'route', 'target' => $route_name), array('section' => 'ASC'));
     if ($mapping) {
         // Faut checker toutes les routes, à cause du mapping alias
         $routes = $this->router->getRouteCollection()->all();
         foreach ($routes as $name => $route) {
             if ($defaults = $route->getDefaults()) {
                 if (array_key_exists('_unifikRequest', $defaults) && array_key_exists('mappedRouteName', $defaults['_unifikRequest'])) {
                     $real_name = preg_replace('/^[aA-zZ]{2}__[A-Z]{2}__/', '', $defaults['_unifikRequest']['mappedRouteName']);
                     // On a trouvé la bonne route
                     if ($real_name == $route_name) {
                         return preg_replace('/^[aA-zZ]{2}__[A-Z]{2}__/', '', $name);
                     }
                 }
             }
         }
         // On a rien trouvé... on retourne la route "par défaut" de la section
         return 'section_id_' . $mapping->getSection()->getId();
     }
     // Aucun mapping... on fallback sur la premiere route disponible (?)
     $mapping = $this->mappingRepository->findOneBy(array('type' => 'route', 'target' => $route_name), array('section' => 'ASC'));
     if ($mapping) {
         return 'section_id_' . $mapping->getSection()->getId();
     }
     // Rien de concluant
     return null;
 }
示例#2
0
 public function executeSubcentro(sfWebRequest $request)
 {
     $this->ue = $request->getParameter('ue_id');
     $this->gestion = $this->getUser()->getAttribute('GESTION');
     $this->periodo = $request->getParameter('periodo_id');
     $this->subcentros = doctrine::getTable('DatSieCurso')->getSubcentros($this->getUser()->getAttribute('GESTION'), $request->getParameter('ue_id'), $request->getParameter('periodo_id'));
 }
示例#3
0
 public function executeCrear(sfWebRequest $request)
 {
     $this->gestion = sfConfig::get('app_gestion');
     $this->periodo = $this->getUser()->getAttribute('PERIODO');
     $this->modalidad = $this->getUser()->getAttribute('MODALIDAD');
     // Buscando Unidad Educativa
     $buscar_ue = Doctrine::getTable('RelUsuarioUe')->getCodUE($this->getUser()->getAttribute('USUARIO_ID'));
     // Asignado Codigo de Unidad Educativa
     $this->codue = $buscar_ue['cod_ue'];
     // Recuperando variable de modalidad
     $param_acreditacion = $request->getParameter('cla_acreditacion');
     // Asignando variable de modalidad
     $this->acreditacion = $param_acreditacion['acreditacion_id'];
     //verificamos si tiene permisos para la Centro de Educacion Alternativa
     $unidad = Doctrine::getTable('DatRueUnidadEducativa')->getAsignacionUesUsuario($this->codue, $this->getUser()->getAttribute('USUARIO_ID'));
     if ($unidad) {
         $this->getUser()->setFlash('ue', $this->codue);
         $this->getUser()->setFlash('gestion', $this->gestion);
         // Consulta de todos los Subcentros habilitados
         $this->subcentros = Doctrine::getTable('DatRueSubcentro')->findByCodUeId($this->codue);
         $this->niveles = doctrine::getTable('ClaCiclo')->findByNivelId($this->modalidad);
         if ($this->acreditacion == '22') {
             $this->especialidades = doctrine::getTable('DatAltCursooferta')->findByCodUeId($this->codue);
         } elseif ($this->acreditacion == '23') {
             $this->discapacidades = doctrine::getTable('DatEspDiscapacidad')->findAll();
         }
     } else {
         $this->notice = 'NO TIENE TUICION SOBRE EL C.E.A. O EL C.E.A NO SE ENCUENTRA REGISTRADO';
     }
     return sfView::SUCCESS;
 }
示例#4
0
 public function executeBuscarestudiante()
 {
     $request = $this->getRequest();
     $this->a = $request->getParameter('dat_rde_estudiante');
     $this->estudiante = doctrine::gettable('DatRdeEstudiante')->find($this->a['codigo_rude']);
     if ($this->estudiante) {
         $this->inscripcion = doctrine::gettable('DatRdeInscripcionTecnica')->getBuscarInscripcionModificarCurso($this->estudiante->getCodigoRude(), $this->getUser()->getAttribute('GESTION'), $this->getUser()->getAttribute('USUARIO_ID'), $this->a['periodo']);
         if ($this->inscripcion) {
             ///mostrar los niveles
             $this->modalidades = doctrine::gettable('DatAltCursoTecnica')->getModalidad($this->inscripcion->getCodUeId(), $this->getUser()->getAttribute('GESTION'), $this->inscripcion->getPeriodoId(), $this->inscripcion->getSubCeaId());
         } else {
             $this->notice = 'LA INSCRIPCION NO EXISTE O NO TIENE TUICION SOBRE LA UNIDAD EN LA QUE ESTA INSCRITO EL ESTUDIANTE';
         }
     } else {
         $this->notice = 'CODIGO RUDE NO EXISTE';
     }
 }
示例#5
0
文件: cmmonitor.php 项目: swk/bluebox
 public function processAction(&$controller, $params)
 {
     $this->assignEmptyParams($params, 1);
     list($uuid) = $params;
     $input = Input::instance();
     if (is_array($input->post('submit'))) {
         if ($input->post('uuid') == '' || current($input->post('submit')) == 'cancel') {
             $controller->exitQtipAjaxForm();
             exit;
         }
         $controller->template->content = new View('callmanager/commandresponse');
         try {
             $numberobj = doctrine::getTable('Number')->find($input->post('destext'));
             $numbertypeobj = doctrine::getTable($numberobj->class_type)->find($numberobj->foreign_id);
             $destdial = 'user/' . $numbertypeobj->Destination["plugins"]["sip"]["username"] . '@' . $numbertypeobj->Destination->User->Location->domain;
             $commandresponse = $this->executeAction(array($input->post('uuid'), $destdial));
             $controller->view->commandresponse = '<p>Your phone should now ring.  Once you pick it up, you will be monitoring the call and neither party will be able to hear you.</p><br>';
             $controller->view->commandresponse .= '<p>During your monitoring session, you may dial the following numbers on your phone:';
             $controller->view->commandresponse .= '<ul class="clean_indented">';
             $controller->view->commandresponse .= '<li>1 - Speak to the person at the far end of the channel without the person on the channel hearing you</li>';
             $controller->view->commandresponse .= '<li>2 - Speak to the person on the channel without the person at the far end of the channel hearing you</li>';
             $controller->view->commandresponse .= '<li>3 - Bridge into the call and participate in a 3 way conference</li>';
             $controller->view->commandresponse .= '<li>0 - Restore the monitoring session after using one of the other functions</li>';
             $controller->view->commandresponse .= '</ul></p>';
         } catch (ESLException $e) {
             $controller->view->commandresponse = 'An error has occured: ' . $e->getMessage() . '<br>';
             if (strpos($e->getMessage(), 'Not connected')) {
                 $controller->view->commandresponse = 'This indicates that Freeswitch is not running, mod_event_socket is not configured, or the system is unable to log in.';
             }
         } catch (callmanagerException $e) {
             $controller->template->content = new View('callmanager/commandresponse');
             $controller->view->commandresponse = 'An error has occured: ' . $e->getMessage() . '<br>';
         }
     } else {
         $controller->template->content = new View('callmanager/monitor');
         $controller->view->uuid = $uuid;
         $controller->view->userext = '1234';
     }
 }
 public function control()
 {
     if ($this->usuario) {
         ///Buscar el grupo al que pertenece el usuario
         $grupo = Doctrine::getTable('RelUsuarioGrupo')->findOneByUsuarioId($this->usuario)->getGrupoId();
         $rol = Doctrine::getTable('DatUsuGrupo')->find($grupo)->getRolId();
         $menu = doctrine::getTable('DatUsuPermiso')->findOneByAbrMenu($this->abrMenu);
         if ($menu) {
             if (Doctrine::getTable('RelRolPermiso')->find(array($rol, $menu->getId()))) {
                 if ($menu->getEstadoId() == 0) {
                     return true;
                 } else {
                     return false;
                 }
             } else {
                 return false;
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
示例#7
0
 public function executeListadecursos(sfWebRequest $request)
 {
     $this->cursos = doctrine::getTable('DatAltCursoTecnica')->findByCodUeIdAndSubCeaIdAndGestionIdAndPeriodoId($request->getParameter('cod_ue_id'), $request->getParameter('sub_cea_id'), $request->getParameter('gestion_id'), $request->getParameter('periodo_id'));
 }
示例#8
0
 public function executeTurno(sfWebRequest $request)
 {
     $this->turnos = doctrine::getTable('DatSieCurso')->getTurnoAlt($request->getParameter('ue_id'), $request->getParameter('modalidad_id'), $request->getParameter('nivel_id'), $request->getParameter('ciclo_id'), $this->getUser()->getAttribute('GESTION'), $request->getParameter('paralelo_id'), '2', $request->getParameter('subcea_id'));
 }
示例#9
0
 public function executeTurno(sfWebRequest $request)
 {
     $this->turnos = doctrine::getTable('DatEspCurso')->getTurno($request->getParameter('ue_id'), $this->getUser()->getAttribute('GESTION'), $request->getParameter('nivel_id'), $request->getParameter('grado_id'), $request->getParameter('discapacidad_id'), $request->getParameter('paralelo'));
 }
示例#10
0
 public function executeUnidadeducativa(sfWebRequest $request)
 {
     $this->a = $request->getParameter('dat_rde_estudiante');
     $this->gestion = sfConfig::get('app_gestion');
     $this->periodo = sfConfig::get('app_periodo');
     $this->modalidad = sfConfig::get('app_modalidad');
     // Buscando Unidad Educativa
     $buscar_ue = Doctrine::getTable('RelUsuarioUe')->getCodUE($this->getUser()->getAttribute('USUARIO_ID'));
     // Asignado Codigo de Unidad Educativa
     $this->codue = $buscar_ue['cod_ue'];
     // Recuperando variable de modalidad
     $param_acreditacion = $request->getParameter('cla_acreditacion');
     // Asignando variable de modalidad
     $this->acreditacion = $param_acreditacion['acreditacion_id'];
     $unidad = Doctrine::getTable('DatRueUnidadEducativa')->getAsignacionUesUsuario($this->codue, $this->getUser()->getAttribute('USUARIO_ID'));
     if ($unidad) {
         $this->estudiantes = doctrine::getTable('DatRdeEstudiante')->getPosiblesEstudiantes($this->a['paterno'], $this->a['materno'], $this->a['nombre'], $this->a['fecha_nacimiento']['year'] . '-' . $this->a['fecha_nacimiento']['month'] . '-' . $this->a['fecha_nacimiento']['day']);
         $this->subcentros = Doctrine::getTable('DatRueSubcentro')->findByCodUeId($this->codue);
     } else {
         $this->notice = 'NO TIENE TUICION SOBRE EL C.E.A. O EL C.E.A NO SE ENCUENTRA REGISTRADO';
     }
     return sfView::SUCCESS;
 }
示例#11
0
 public function executeTurno(sfWebRequest $request)
 {
     //die($request->getParameter('ue_id').'/'.$this->getUser()->getAttribute('GESTION').'/'.$request->getParameter('periodo_id').'/'.$request->getParameter('subcea_id').'/'.$request->getParameter('modalidad_id').'/'.$request->getParameter('nivel_id').'/'.$request->getParameter('grado_id').'/'.$request->getParameter('curso_oferta_id').'/'.$request->getParameter('paralelo'));
     $this->turnos = doctrine::getTable('DatAltCursoTecnica')->getTurno($request->getParameter('ue_id'), $this->getUser()->getAttribute('GESTION'), $request->getParameter('periodo_id'), $request->getParameter('subcea_id'), $request->getParameter('modalidad_id'), $request->getParameter('nivel_id'), $request->getParameter('grado_id'), $request->getParameter('curso_oferta_id'), $request->getParameter('paralelo'));
 }
示例#12
0
 public function executeMaintenances(sfWebRequest $request)
 {
     // Forward to a 404 page if the requested expedition id is not found
     $this->forward404Unless($items = explode(',', $request->getParameter('ids')));
     if (!($id = doctrine::getTable('loanItems')->getLoanRef($items))) {
         $this->forwardToSecureAction();
     }
     if (!$this->getUser()->isAtLeast(Users::ADMIN) && Doctrine::getTable('loanRights')->isAllowed($this->getUser()->getId(), $id) !== true) {
         $this->forwardToSecureAction();
     }
     $i18n = $this->getContext()->getI18N();
     $options = array('forced_action_observation_options' => array('approval' => $i18n->__('approval'), 'checked_by' => $i18n->__('Checked by'), 'organized_by' => $i18n->__('organized_by'), 'preparation' => $i18n->__('preparation'), 'received_by' => $i18n->__('Received by'), 'received_back_by' => $i18n->__('Return received by'), 'checked_back_by' => $i18n->__('Return checked by')));
     $this->form = new MultiCollectionMaintenanceForm(null, $options);
     if ($request->isMethod('post')) {
         $this->form->bind($request->getParameter('collection_maintenance'));
         if ($this->form->isValid()) {
             try {
                 $obj = $this->form->updateObject();
                 $obj->setReferencedRelation('loan_items');
                 foreach ($items as $it) {
                     $o = clone $obj;
                     $o->setRecordId($it);
                     $o->save();
                 }
                 return $this->renderText('ok');
             } catch (Doctrine_Exception $ne) {
                 $e = new DarwinPgErrorParser($ne);
                 $error = new sfValidatorError(new savedValidator(), $e->getMessage());
                 $this->form->getErrorSchema()->addError($error);
             }
         }
     }
 }
示例#13
0
 public function executeParalelo(sfWebRequest $request)
 {
     $this->paralelos = doctrine::gettable('DatSieCurso')->getParalelo($request->getParameter('ue_id'), $this->getUser()->getAttribute('GESTION'), $request->getParameter('periodo_id'), $request->getParameter('subcea_id'), $request->getParameter('modalidad_id'), $request->getParameter('nivel_id'), $request->getParameter('grado_id'));
 }
示例#14
0
 /**
  * This function will attempt to find a icon starting from the most specific location
  * and working down a skins defualt.  You may specify the intended size as small, medium,
  * or large.  If restrictToSkin is true then we will not consider icons in the modules,
  * or if it is an array then that is considered a list of icons to get from the skin only.
  *
  * For example the 32x32 sip interface icon for the 2600hz skin would render the following
  *    search path (unless restricted to skin)
  *
  * sipinterface/assets/img/icons/32x32/2600hz/sipinterface.png
  * sipinterface/assets/img/icons/32x32/sipinterface.png
  * skins/2600hz/assets/img/icons/32x32/sipinterface.png
  * skins/2600hz/assets/img/icons/32x32/default.png
  *
  */
 public static function getNavIcon($navStructure, $size = 'medium', $options = array())
 {
     // init our options
     if (!is_array($options)) {
         $options = array('restrictToSkin' => FALSE);
     }
     $options += array('restrictToSkin' => FALSE, 'allowSkinSpecific' => TRUE);
     extract($options);
     // init our array, get the module name, and clean up the skin name
     $lookIn = array();
     $skin = str_replace('skins/', '', skins::getSkin());
     // make sure we are dealing with our defualt sizes
     switch ($size) {
         case 'small':
             $size = '16x16';
             break;
         case 'medium':
             $size = '32x32';
             break;
         case 'large':
             $size = '48x48';
             break;
         default:
             $size = '32x32';
             break;
     }
     $name = $navStructure['module'];
     // get the package information to determine the
     // basepath for searching within a module
     $packageRec = doctrine::getTable('Package')->findOneByName($name);
     if ($packageRec) {
         $moddir = substr($packageRec->basedir, strpos($packageRec->basedir, '/'), strlen($packageRec->basedir));
         $basePath = MODPATH . $moddir . '/assets/img/icons/' . $size . '/';
         $baseURL = url::base() . 'modules' . $moddir . '/assets/img/icons/' . $size . '/';
         // see if the module provides an icon for this skin
         if (empty($allowSkinSpecific) || is_array($allowSkinSpecific) && array_key_exists($name, $allowSkinSpecific)) {
             $lookIn[$baseURL . $skin . $name . '.png'] = $basePath . $skin . $name . '.png';
         }
         // see if the module provides a default icon of the correct size
         if (empty($restrictToSkin) || is_array($restrictToSkin) && array_key_exists($name, $restrictToSkin)) {
             $lookIn[$baseURL . $name . '.png'] = $basePath . $name . '.png';
         }
     }
     // basepath for searching the skin
     $basePath = DOCROOT . 'skins/' . $skin . 'assets/img/icons/' . $size . '/';
     $baseURL = url::base() . 'skins/' . $skin . 'assets/img/icons/' . $size . '/';
     $lookIn[$baseURL . $name . '.png'] = $basePath . $name . '.png';
     $lookIn[$baseURL . 'default.png'] = $basePath . 'default.png';
     // look for this icon
     foreach ($lookIn as $url => $path) {
         if (file_exists($path)) {
             return $url;
         }
     }
     return FALSE;
 }
示例#15
0
 /**
  * Executes buscar los datos del estudiante de acuerdo al c?digo RUDE
  *
  * @param sfRequest $request el c?digo RUDE
  */
 public function executeBuscarestudiante()
 {
     $request = $this->getRequest();
     $this->a = $request->getParameter('dat_rde_estudiante');
     $this->gestion = sfConfig::get('app_gestion');
     $this->periodo = $this->getUser()->getAttribute('PERIODO');
     $this->modalidad = $this->getUser()->getAttribute('MODALIDAD');
     // Buscando Unidad Educativa
     $buscar_ue = Doctrine::getTable('RelUsuarioUe')->getCodUE($this->getUser()->getAttribute('USUARIO_ID'));
     // Asignado Codigo de Unidad Educativa
     $this->codue = $buscar_ue['cod_ue'];
     // Recuperando variable de modalidad
     $param_acreditacion = $request->getParameter('cla_acreditacion');
     // Asignando variable de modalidad
     $this->acreditacion = $param_acreditacion['acreditacion_id'];
     $unidad = Doctrine::getTable('DatRueUnidadEducativa')->getAsignacionUesUsuario($this->codue, $this->getUser()->getAttribute('USUARIO_ID'));
     if ($unidad) {
         $this->estudiante = doctrine::gettable('DatRdeEstudiante')->find($this->a['codigo_rude']);
         if ($this->estudiante) {
             //$this->inscripcion = doctrine::getTable('DatRdeInscripcion')->getBuscarInscripcionEstudianteExtemporaneo($this->estudiante->getCodigoRude(),$this->getUser()->getAttribute('GESTION'));
             //if ($this->inscripcion) $this->notice1 = 0;
             $this->subcentros = Doctrine::getTable('DatRueSubcentro')->findByCodUeId($this->codue);
         } else {
             $this->notice = 'CODIGO RUDE NO EXISTE';
         }
     } else {
         $this->notice = 'NO TIENE TUICION SOBRE EL C.E.A. O EL C.E.A NO SE ENCUENTRA REGISTRADO';
     }
     return sfView::SUCCESS;
 }
示例#16
0
 public function executeTurno(sfWebRequest $request)
 {
     //die($request->getParameter('ue_id').'/'.$this->getUser()->getAttribute('GESTION').'/'.$request->getParameter('periodo_id').'/'.$request->getParameter('subcea_id').'/'.$request->getParameter('nivel_id').'/'.$request->getParameter('grado_id').'/'.$request->getParameter('paralelo'));
     $this->turnos = doctrine::getTable('DatSieCurso')->getTurno($request->getParameter('ue_id'), $request->getParameter('gestion_id'), $request->getParameter('periodo_id'), $request->getParameter('subcea_id'), $request->getParameter('nivel_id'), $request->getParameter('grado_id'), $request->getParameter('paralelo'));
 }