public function configure() { $object = $this->getObject(); $this->useFields(array('egreso', 'complicaciones', 'riesgoqx_id', 'contaminacionqx_id', 'eventoqx_id', 'clasificacionqx', 'destino_px', 'status', 'ev_adversos_anestesia')); //$this->widgetSchema['paciente_id'] = new sfWidgetFormInputHidden(); $this->widgetSchema['egreso'] = new sfWidgetFormInputText(); $this->widgetSchema['complicaciones'] = new sfWidgetFormTextarea(); $this->widgetSchema['status'] = new sfWidgetFormInputHidden(); $this->widgetSchema['status']->setAttribute('value', '100'); $this->setWidget('destino_px', new sfWidgetFormChoice(array('choices' => array('Recuperación', 'Intensivos', 'Sala', 'Defunción'), 'expanded' => true))); $this->setWidget('clasificacionqx', new sfWidgetFormChoice(array('choices' => array(null, 'Mayor', 'Menor'), 'expanded' => false))); $this->widgetSchema->setLabels(AgendaPeer::getLabels()); /* Ajustes a los validadores */ $this->validatorSchema['egreso']->setOption('required', true); $this->validatorSchema['egreso']->setMessage('required', 'Falta hora'); // Agregando las personas del transoperatorio $this->widgetSchema['egreso']->setAttributes(array('id' => 'datahora')); $transPersonal = $object->getPersonalTransoperatorio(); $tmp = new sfForm(); if ($transPersonal != null) { foreach ($transPersonal as $personal) { if ($personal->getPersonalNombre()) { $x = new PersonalcirugiaForm($personal); $x->useFields(array('finaliza', 'personal_nombre')); $tmp->embedForm('personal' . $personal->getId(), $x); } } $this->embedForm('temporal', $tmp); } $this->validatorSchema['clasificacionqx']->setOption('required', true); $this->validatorSchema['clasificacionqx']->setMessage('required', 'Falta clasificación de la cirugía'); }
public function configure() { $object = $this->getObject(); $this->useFields(array('causa_diferido_id', 'status', 'paciente_id', 'show_in_index')); $this->widgetSchema['paciente_id'] = new sfWidgetFormInputHidden(); $this->widgetSchema['status'] = new sfWidgetFormInputHidden(); $this->widgetSchema['show_in_index'] = new sfWidgetFormInputHidden(); $this->widgetSchema['status']->setAttribute('value', '-50'); if (in_array($object->getTipoProcId(), array(1, 2))) { $this->widgetSchema['show_in_index']->setAttribute('value', '0'); } $this->widgetSchema->setLabels(AgendaPeer::getLabels()); }
/** * Populates the object using an array. * * This is particularly useful when populating an object from one of the * request arrays (e.g. $_POST). This method goes through the column * names, checking to see whether a matching key exists in populated * array. If so the setByName() method is called for that column. * * You can specify the key type of the array by additionally passing one * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. * The default key type is the column's BasePeer::TYPE_PHPNAME * * @param array $arr An array to populate the object from. * @param string $keyType The type of keys the array uses. * @return void */ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = AgendaPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setProgramacion($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setFechaestado($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setHora($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setHoraestado($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setInicio($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setLastTime($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setIngreso($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { $this->setSalaId($arr[$keys[8]]); } if (array_key_exists($keys[9], $arr)) { $this->setQuirofanoId($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { $this->setEgreso($arr[$keys[10]]); } if (array_key_exists($keys[11], $arr)) { $this->setCie9mc($arr[$keys[11]]); } if (array_key_exists($keys[12], $arr)) { $this->setCie9mcId($arr[$keys[12]]); } if (array_key_exists($keys[13], $arr)) { $this->setCxRealizada($arr[$keys[13]]); } if (array_key_exists($keys[14], $arr)) { $this->setCxRealizadaId($arr[$keys[14]]); } if (array_key_exists($keys[15], $arr)) { $this->setTipoCx($arr[$keys[15]]); } if (array_key_exists($keys[16], $arr)) { $this->setDiagnostico($arr[$keys[16]]); } if (array_key_exists($keys[17], $arr)) { $this->setDiagnosticoId($arr[$keys[17]]); } if (array_key_exists($keys[18], $arr)) { $this->setMedicoName($arr[$keys[18]]); } if (array_key_exists($keys[19], $arr)) { $this->setPacienteName($arr[$keys[19]]); } if (array_key_exists($keys[20], $arr)) { $this->setPacienteId($arr[$keys[20]]); } if (array_key_exists($keys[21], $arr)) { $this->setEdad($arr[$keys[21]]); } if (array_key_exists($keys[22], $arr)) { $this->setGenero($arr[$keys[22]]); } if (array_key_exists($keys[23], $arr)) { $this->setGeneroId($arr[$keys[23]]); } if (array_key_exists($keys[24], $arr)) { $this->setRegistro($arr[$keys[24]]); } if (array_key_exists($keys[25], $arr)) { $this->setServicio($arr[$keys[25]]); } if (array_key_exists($keys[26], $arr)) { $this->setAnestesiaId($arr[$keys[26]]); } if (array_key_exists($keys[27], $arr)) { $this->setAnestesiaEmpleada($arr[$keys[27]]); } if (array_key_exists($keys[28], $arr)) { $this->setEvAdversosAnestesia($arr[$keys[28]]); } if (array_key_exists($keys[29], $arr)) { $this->setObservaciones($arr[$keys[29]]); } if (array_key_exists($keys[30], $arr)) { $this->setRequerimiento($arr[$keys[30]]); } if (array_key_exists($keys[31], $arr)) { $this->setReqInsumos($arr[$keys[31]]); } if (array_key_exists($keys[32], $arr)) { $this->setReqHemoderiv($arr[$keys[32]]); } if (array_key_exists($keys[33], $arr)) { $this->setReqLaboratorio($arr[$keys[33]]); } if (array_key_exists($keys[34], $arr)) { $this->setReqAnestesico($arr[$keys[34]]); } if (array_key_exists($keys[35], $arr)) { $this->setStatus($arr[$keys[35]]); } if (array_key_exists($keys[36], $arr)) { $this->setCausaDiferidoId($arr[$keys[36]]); } if (array_key_exists($keys[37], $arr)) { $this->setSolicitado($arr[$keys[37]]); } if (array_key_exists($keys[38], $arr)) { $this->setRiesgoqxId($arr[$keys[38]]); } if (array_key_exists($keys[39], $arr)) { $this->setContaminacionqxId($arr[$keys[39]]); } if (array_key_exists($keys[40], $arr)) { $this->setEventoqxId($arr[$keys[40]]); } if (array_key_exists($keys[41], $arr)) { $this->setComplicaciones($arr[$keys[41]]); } if (array_key_exists($keys[42], $arr)) { $this->setValPreAnestesica($arr[$keys[42]]); } if (array_key_exists($keys[43], $arr)) { $this->setReintervencion($arr[$keys[43]]); } if (array_key_exists($keys[44], $arr)) { $this->setPermisos($arr[$keys[44]]); } if (array_key_exists($keys[45], $arr)) { $this->setTipoProcId($arr[$keys[45]]); } if (array_key_exists($keys[46], $arr)) { $this->setAtencionId($arr[$keys[46]]); } if (array_key_exists($keys[47], $arr)) { $this->setTiempoFuera($arr[$keys[47]]); } if (array_key_exists($keys[48], $arr)) { $this->setProcedencia($arr[$keys[48]]); } if (array_key_exists($keys[49], $arr)) { $this->setClasificacionqx($arr[$keys[49]]); } if (array_key_exists($keys[50], $arr)) { $this->setRegionPx($arr[$keys[50]]); } if (array_key_exists($keys[51], $arr)) { $this->setExtensionPx($arr[$keys[51]]); } if (array_key_exists($keys[52], $arr)) { $this->setAnexoDetalle($arr[$keys[52]]); } if (array_key_exists($keys[53], $arr)) { $this->setDestinoPx($arr[$keys[53]]); } if (array_key_exists($keys[54], $arr)) { $this->setLiberacionSala($arr[$keys[54]]); } if (array_key_exists($keys[55], $arr)) { $this->setTiempoEst($arr[$keys[55]]); } if (array_key_exists($keys[56], $arr)) { $this->setRiesgoQxPre($arr[$keys[56]]); } if (array_key_exists($keys[57], $arr)) { $this->setShowInIndex($arr[$keys[57]]); } if (array_key_exists($keys[58], $arr)) { $this->setProtocolo($arr[$keys[58]]); } if (array_key_exists($keys[59], $arr)) { $this->setCancelada($arr[$keys[59]]); } if (array_key_exists($keys[60], $arr)) { $this->setCreatedAt($arr[$keys[60]]); } if (array_key_exists($keys[61], $arr)) { $this->setUpdatedAt($arr[$keys[61]]); } }
/** * Method to invalidate the instance pool of all tables related to siga_procedimiento * by a foreign key with ON DELETE CASCADE */ public static function clearRelatedInstancePool() { // Invalidate objects in AgendaPeer instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. AgendaPeer::clearInstancePool(); }
/** * Find object by primary key using raw SQL to go fast. * Bypass doSelect() and the object formatter by using generated code. * * @param mixed $key Primary key to use for the query * @param PropelPDO $con A connection object * * @return Agenda A model object, or null if the key is not found * @throws PropelException */ protected function findPkSimple($key, $con) { $sql = 'SELECT `ID`, `PROGRAMACION`, `FECHAESTADO`, `HORA`, `HORAESTADO`, `INICIO`, `LAST_TIME`, `INGRESO`, `SALA_ID`, `QUIROFANO_ID`, `EGRESO`, `CIE9MC`, `CIE9MC_ID`, `CX_REALIZADA`, `CX_REALIZADA_ID`, `TIPO_CX`, `DIAGNOSTICO`, `DIAGNOSTICO_ID`, `MEDICO_NAME`, `PACIENTE_NAME`, `PACIENTE_ID`, `EDAD`, `GENERO`, `GENERO_ID`, `REGISTRO`, `SERVICIO`, `ANESTESIA_ID`, `ANESTESIA_EMPLEADA`, `EV_ADVERSOS_ANESTESIA`, `OBSERVACIONES`, `REQUERIMIENTO`, `REQ_INSUMOS`, `REQ_HEMODERIV`, `REQ_LABORATORIO`, `REQ_ANESTESICO`, `STATUS`, `CAUSA_DIFERIDO_ID`, `SOLICITADO`, `RIESGOQX_ID`, `CONTAMINACIONQX_ID`, `EVENTOQX_ID`, `COMPLICACIONES`, `VAL_PRE_ANESTESICA`, `REINTERVENCION`, `PERMISOS`, `TIPO_PROC_ID`, `ATENCION_ID`, `TIEMPO_FUERA`, `PROCEDENCIA`, `CLASIFICACIONQX`, `REGION_PX`, `EXTENSION_PX`, `ANEXO_DETALLE`, `DESTINO_PX`, `LIBERACION_SALA`, `TIEMPO_EST`, `RIESGO_QX_PRE`, `SHOW_IN_INDEX`, `PROTOCOLO`, `CANCELADA`, `CREATED_AT`, `UPDATED_AT` FROM `hc_agenda` WHERE `ID` = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->execute(); } catch (Exception $e) { Propel::log($e->getMessage(), Propel::LOG_ERR); throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e); } $obj = null; if ($row = $stmt->fetch(PDO::FETCH_NUM)) { $obj = new Agenda(); $obj->hydrate($row); AgendaPeer::addInstanceToPool($obj, (string) $key); } $stmt->closeCursor(); return $obj; }
public function configure() { $object = $this->getObject(); $this->useFields(array('medico_name', 'id', 'programacion', 'fechaestado', 'hora', 'horaestado', 'sala_id', 'paciente_name', 'paciente_id', 'diagnostico', 'diagnostico_id', 'edad', 'genero', 'registro', 'servicio', 'requerimiento', 'req_insumos', 'req_hemoderiv', 'req_laboratorio', 'req_anestesico', 'reintervencion', 'quirofano_id', 'tipo_proc_id', 'status', 'atencion_id', 'procedencia', 'tiempo_est', 'riesgo_qx_pre', 'show_in_index', 'protocolo')); $programa = $object->getMedicoPrograma(); if ($programa->isNew()) { $programa->setAgenda($this->getObject()); $programa->fromArray(array('Tipo' => 'cirujano', 'Agenda' => $this->getObject(), 'Status' => 0, 'Programa' => true)); } $progForm = new PersonalcirujanoForm($programa); unset($progForm['inicia'], $progForm['transoperatorio']); $this->embedForm('programa', $progForm); $this->widgetSchema['programa']['programa'] = new sfWidgetFormInputHidden(); //$this->widgetSchema['programacion'] = new sfWidgetFormJqueryDate(array( //'config' => '{"option", "dateFormat", "yy-mm-dd"}',each(array) //)); $this->widgetSchema['programa']['personal_nombre']->setLabel('Nombre del Médico que programa:')->setAttributes(array('class' => 'searchable', 'data-url' => 'profile/json')); if ($object->countProcedimientocirugias() == 0) { $object->addProcedimientocirugia(new Procedimientocirugia()); // $object->addProcedimientocirugia(new Procedimientocirugia()); // $object->addProcedimientocirugia(new Procedimientocirugia()); // $object->addProcedimientocirugia(new Procedimientocirugia()); } $this->embedRelation('Procedimientocirugia', array('embedded_form_class' => 'ProcedimientocirugiaForm', 'delete_name' => 'Eliminar', 'alert_text' => '¿Esta seguro que desea eliminar este procedimiento?\\n Ya no se podrá recuperar', 'parent_level' => 4, 'add_link' => 'Agregar otro Procedimiento', 'max_additions' => 4)); $this->widgetSchema['reintervencion'] = new sfWidgetFormChoice(array('choices' => array('0' => 'No', '1' => 'Si'), 'expanded' => true)); $this->widgetSchema['protocolo'] = new sfWidgetFormChoice(array('choices' => array('0' => 'No', '1' => 'Si'), 'expanded' => true)); $this->widgetSchema['quirofano_id'] = new sfWidgetFormInputHidden(); $this->widgetSchema['id'] = new sfWidgetFormInputHidden(); $this->widgetSchema['programacion'] = new sfWidgetFormInputText(); $this->widgetSchema['hora'] = new sfWidgetFormInputText(); $this->widgetSchema['tiempo_est'] = new sfWidgetFormInputText(); //$this->setWidget('tiempo_est', new sfWidgetFormChoice(array( //'choices' => AgendaPeer::getDuracion() //'id' => 'tiest' //))); $this->widgetSchema['diagnostico_id'] = new sfWidgetFormInputHidden(); $this->setWidget('status', new sfWidgetFormInputHidden()); $this->widgetSchema['status']->setAttribute('value', 1); $this->widgetSchema->setLabels(AgendaPeer::getLabels()); // $this->setWidget('tiempo_est', new sfWidgetFormChoice(array( // 'choices' => AgendaPeer::getDuracion() // ))); $this->widgetSchema['programacion']->setAttributes(array('id' => 'datepicker', 'placeholder' => 'año/mes/dia', 'class' => 'hasDatapicker')); $this->widgetSchema['tiempo_est']->setAttributes(array('id' => 'tiest')); $this->widgetSchema['hora']->setAttributes(array('id' => 'datahora')); $this->widgetSchema['medico_name']->setAttributes(array('planceholder' => 'Nombre del médico que programa la cirugia')); $this->widgetSchema['diagnostico']->setAttributes(array('placeholder' => 'Diagnóstico del paciente', 'data-source' => 'http://example.com/api/data', 'data-field' => 'diagnostico_id')); $this->widgetSchema->setLabels(array('paciente_name' => 'Nombre del Paciente:', 'diagnostico' => 'Diágnostico', 'medico_name' => 'Nombre del médico que programa la cirugía:', 'hora' => 'Hora inicial', 'tipo_proc_id' => 'Tipo de programación:', 'programacion' => 'Programación', 'tiempo_est' => 'Duración', 'riesgo_qx_pre' => 'Riesgo quirurgico:', 'req_insumos' => 'Insumos indispensables:', 'req_anestesico' => 'Requerimientos de Anestesiología:', 'req_hemoderiv' => 'Hemoderivados Necesarios:', 'req_laboratorio' => 'Requisitos de laboratorio:', 'requerimiento' => 'Otras necesidades:')); //$this->widgetSchema['reintervencion'] = new sfWidgetFormChoice(array( // 'choices' => array('0' => 'No', '1' => 'Si'), //'expanded' => true //)); //$this->widgetSchema['protocolo'] = new sfWidgetFormChoice(array( // 'choices' => array('0' => 'No', '1' => 'Si'), //'expanded' => true //)); $this->validatorSchema['diagnostico']->setOption('required', true); $this->validatorSchema['diagnostico']->setMessage('required', 'Falta diagnóstico'); $this->validatorSchema['hora']->setOption('required', true); $this->validatorSchema['hora']->setMessage('required', 'Falta hora'); $this->validatorSchema['programacion']->setOption('required', true); $this->validatorSchema['programacion']->setMessage('required', 'Falta fecha'); $this->validatorSchema['tiempo_est']->setOption('required', true); $this->validatorSchema['tiempo_est']->setMessage('required', 'Falta hora'); $this->validatorSchema['registro']->setOption('required', true); $this->validatorSchema['registro']->setMessage('required', 'Falta registro'); $this->validatorSchema['tipo_proc_id']->setOption('required', true); $this->validatorSchema['tipo_proc_id']->setMessage('required', 'Falta tipo'); $this->validatorSchema['paciente_name']->setOption('required', true); $this->validatorSchema['paciente_name']->setMessage('required', 'Falta nombre'); $this->validatorSchema['edad']->setOption('required', true); $this->validatorSchema['edad']->setMessage('required', 'Falta edad'); //$this->validatorSchema['medico_name']->setOption('required', true); //$this->validatorSchema['medico_name']->setMessage('required','Falta nombre'); $this->validatorSchema['riesgo_qx_pre']->setOption('required', true); $this->validatorSchema['riesgo_qx_pre']->setMessage('required', 'Falta riesgo'); $this->validatorSchema['req_insumos']->setOption('required', true); $this->validatorSchema['req_insumos']->setMessage('required', 'Falta insumos'); $this->validatorSchema['req_anestesico']->setOption('required', true); $this->validatorSchema['req_anestesico']->setMessage('required', 'Falta anestesia'); $this->getObject()->isNew() ? $this->validatorSchema['programacion']->setOption('min', strtotime('today')) : $this->validatorSchema['programacion']->setOption('max', strtotime('today + 30 days')); $this->validatorSchema['programacion']->setMessage('min', 'Fecha invalida'); $this->validatorSchema['programacion']->setMessage('max', 'No se puede progrmar con mas de un mes de anticipación'); $this->setWidget('tipo_proc_id', new sfWidgetFormPropelChoice(array('model' => 'Procedimiento'))); }
/** * Selects a collection of Procedimientregrogramado objects pre-filled with all related objects. * * @param Criteria $criteria * @param PropelPDO $con * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @return array Array of Procedimientregrogramado objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $criteria = clone $criteria; // Set the correct dbName if it has not been overridden if ($criteria->getDbName() == Propel::getDefaultDB()) { $criteria->setDbName(ProcedimientregrogramadoPeer::DATABASE_NAME); } ProcedimientregrogramadoPeer::addSelectColumns($criteria); $startcol2 = ProcedimientregrogramadoPeer::NUM_HYDRATE_COLUMNS; AgendaPeer::addSelectColumns($criteria); $startcol3 = $startcol2 + AgendaPeer::NUM_HYDRATE_COLUMNS; $criteria->addJoin(ProcedimientregrogramadoPeer::AGENDA_ID, AgendaPeer::ID, $join_behavior); // symfony_behaviors behavior foreach (sfMixer::getCallables(self::getMixerPreSelectHook(__FUNCTION__)) as $sf_hook) { call_user_func($sf_hook, 'BaseProcedimientregrogramadoPeer', $criteria, $con); } $stmt = BasePeer::doSelect($criteria, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = ProcedimientregrogramadoPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = ProcedimientregrogramadoPeer::getInstanceFromPool($key1))) { // We no longer rehydrate the object, since this can cause data loss. // See http://www.propelorm.org/ticket/509 // $obj1->hydrate($row, 0, true); // rehydrate } else { $cls = ProcedimientregrogramadoPeer::getOMClass(); $obj1 = new $cls(); $obj1->hydrate($row); ProcedimientregrogramadoPeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded // Add objects for joined Agenda rows $key2 = AgendaPeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = AgendaPeer::getInstanceFromPool($key2); if (!$obj2) { $cls = AgendaPeer::getOMClass(); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); AgendaPeer::addInstanceToPool($obj2, $key2); } // if obj2 loaded // Add the $obj1 (Procedimientregrogramado) to the collection in $obj2 (Agenda) $obj2->addProcedimientregrogramado($obj1); } // if joined row not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }
/** * Retrieve multiple objects by pkey. * * @param array $pks List of primary keys * @param PropelPDO $con the connection to use * @return Agenda[] * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, PropelPDO $con = null) { if ($con === null) { $con = Propel::getConnection(AgendaPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(AgendaPeer::DATABASE_NAME); $criteria->add(AgendaPeer::ID, $pks, Criteria::IN); $objs = AgendaPeer::doSelect($criteria, $con); } return $objs; }
public function getVerboseStatus() { $status = AgendaPeer::getStatus(); return ucfirst($status[$this->getStatus()]); }
public function configure() { $object = $this->getObject(); $this->useFields(array('ingreso', 'anestesia_empleada', 'observaciones', 'tiempo_fuera', 'status', 'anestesia_id', 'solicitado')); //$this->widgetSchema['paciente_id'] = new sfWidgetFormInputHidden(); //$this->widgetSchema['realiza_id'] = new sfWidgetFormInputHidden(); //$this->widgetSchema['supervisor_id'] = new sfWidgetFormInputHidden(); //$this->widgetSchema['anestesiologo_qx_id'] = new sfWidgetFormInputHidden(); //$this->widgetSchema['maestro_anestesia_id'] = new sfWidgetFormInputHidden(); //$this->widgetSchema['instrumentista_id'] = new sfWidgetFormInputHidden(); //$this->widgetSchema['circulante_id'] = new sfWidgetFormInputHidden(); $this->widgetSchema['solicitado'] = new sfWidgetFormInputHidden(); $this->widgetSchema['status'] = new sfWidgetFormInputHidden(); $this->widgetSchema['ingreso'] = new sfWidgetFormInputText(); $this->widgetSchema['ingreso']->setAttributes(array('id' => 'datahora')); $this->widgetSchema['anestesia_empleada'] = new sfWidgetFormInputText(); $this->widgetSchema['anestesia_id'] = new sfWidgetFormInputHidden(); $this->widgetSchema['observaciones'] = new sfWidgetFormTextarea(); $this->widgetSchema['tiempo_fuera'] = new sfWidgetFormChoice(array('choices' => array('No', 'Si'), 'expanded' => true)); $transPersonal = $object->getPersonalTransoperatorio(); $cxInicial = $object->getCirujanoInicial(); $this->embedPersonalForm($object->getCirujanoInicial(), 'cxInicial', array('Tipo' => 'cirujano', 'Inicia' => true, 'Status' => '0')); $this->embedPersonalForm($object->getCirujanoSupInicial(), 'cxSupInicial', array('Tipo' => 'cirujano', 'Inicia' => true, 'Status' => '1')); //------------------------------------------------------------------------- $this->embedPersonalForm($object->getAnestesiologoInicial(), 'anesInicia', array('Tipo' => 'anestesista', 'Inicia' => true, 'Status' => '0')); $this->embedPersonalForm($object->getAnestesiologoSupInicial(), 'anesSupInicia', array('Tipo' => 'anestesista', 'Inicia' => true, 'Status' => '1')); $this->embedPersonalForm($object->getInstrumentistaInicial(), 'instrumentistaInicial', array('Tipo' => 'enfermeria', 'Inicia' => true, 'Status' => '2')); $this->embedPersonalForm($object->getCirculanteInicial(), 'circulanteInicial', array('Tipo' => 'enfermeria', 'Inicia' => true, 'Status' => '3')); //$this->setWidget('turno_ii_id', new sfWidgetFormInput()); /*$turnoChoices = array( '1' => 'Matutino', '2' => 'Vespertino', '3' => 'Nocturno', '4' => 'Plan Piloto', ); $this->widgetSchema['turno_ii_id'] = new sfWidgetFormChoice(array('choices' => $turnoChoices)); $this->widgetSchema['turno_ci_id'] = new sfWidgetFormChoice(array('choices' => $turnoChoices)); */ //$this->setDefault('turno_ii_id', $this->calcTurno()); //$this->setDefault('turno_ci_id', $this->calcTurno()); $this->setDefault('solicitado', true); $this->widgetSchema->setLabels(AgendaPeer::getLabels()); /* Ajustes a los validadores */ /* $this->validatorSchema['ingreso']->setOption('required', true); $this->validatorSchema['ingreso']->setMessage('required','Falta hora'); $this->validatorSchema['realiza']->setOption('required', true); $this->validatorSchema['realiza']->setMessage('required','Falta nombre de cirujano'); $this->validatorSchema['anestesiologo_qx']->setOption('required', true); $this->validatorSchema['anestesiologo_qx']->setMessage('required','Falta nombre de anestesiologo'); $this->validatorSchema['anestesia_empleada']->setOption('required', true); $this->validatorSchema['anestesia_empleada']->setMessage('required','Falta tipo de anestesia'); $this->validatorSchema['instrumentista']->setOption('required', true); $this->validatorSchema['instrumentista']->setMessage('required','Falta nombre de instrumentista'); $this->validatorSchema['turno_ii_id']->setOption('required', true); $this->validatorSchema['turno_ii_id']->setMessage('required','Falta hora'); $this->validatorSchema['circulante']->setOption('required', true); $this->validatorSchema['circulante']->setMessage('required','Falta nombre de circulante'); $this->validatorSchema['turno_ci_id']->setOption('required', true); $this->validatorSchema['turno_ci_id']->setMessage('required','Falta hora'); */ }