Thanks for the awnser. I modified the generator.yml and the form. I'm
sending the two of them.
Thanks in advance.
Generator.yml:
*generator:
class: sfDoctrineGenerator
param:
model_class: Patient
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: patient
with_doctrine_route: true
actions_base_class: sfActions
config:
actions: ~
fields:
dni: {label: DNI}
lastname: {label: Apellido}
name: {label: Nombre}
email: {label: Email}
celnumber: {label: Celular}
phonenumber: {label: Fijo}
firsttime: { label: Primer atendimiento, help: Marque el casillero
si el paciente es la primera vez que se atiende }
medicalservicenumber: { label: Numero socio }
list:
title: Administracion de Pacientes
display: [ =dni, =lastname, =name, =email]
max_per_page: 15
sort: [lastname, asc]
filter:
display: [dni, lastname, name, email]
form:
class: BackendPatientForm
edit: ~
new: ~
*
BackendPatientForm:
*<?php
class BackendPatientForm extends PatientForm
{
public function configure()
{
$this->widgetSchema['medical_service_id'] = new
sfWidgetFormDoctrineChoice(
array(
'model' => 'Patient',
'add_empty' =>
'Seleccione Obra Social...',
'method' => 'getName',
'order_by' =>
array('id', 'asc'),
'query' =>
$this->getAllMedicalServices()
), array());
$this->widgetSchema['firsttime'] = new sfWidgetFormChoice(
array(
'choices' => array(0 =>
'No', 1 => 'Si'),
'multiple' => false,
'expanded' => true
)
);
$this->setValidators(array(
'id' => new sfValidatorChoice(array('choices'
=> array($this->getObject()->get('id')), 'empty_value' =>
$this->getObject()->get('id'), 'required' => false)),
'dni' => new
sfValidatorString(array('max_length' => 20)),
'name' => new
sfValidatorString(array('max_length' => 255)),
'lastname' => new
sfValidatorString(array('max_length' => 255)),
'email' => new
sfValidatorString(array('max_length' => 100, 'required' => false)),
'celnumber' => new
sfValidatorString(array('max_length' => 50, 'required' => false)),
'phonenumber' => new
sfValidatorString(array('max_length' => 50, 'required' => false)),
'medicalservicenumber' => new
sfValidatorString(array('max_length' => 100, 'required' => false)),
'medical_service_id' => new sfValidatorNumber(),
'firsttime' => new sfValidatorNumber()
));
//$this->widgetSchema->setNameFormat('patient[%s]');
//$this->errorSchema = new
sfValidatorErrorSchema($this->validatorSchema);
//$this->setupInheritance();
//parent::setup();
}
protected function getAllMedicalServices()
{
$q = Doctrine_Query::create()
->select('*')
->from('MedicalService ms');
return $q;
}
}*
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en