Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creados, organizados y validados formularios de recursos. #19

Merged
merged 1 commit into from
Aug 23, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/admin/config/view.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ default:

stylesheets:
- markdown
- lib.ui-datepicker

javascripts:
- admin

- lib.ui-i18n
- lib.ui-datepicker
has_layout: true
layout: <?php echo dm::getDir() ?>/dmAdminPlugin/modules/dmAdmin/templates/layout
58 changes: 8 additions & 50 deletions apps/admin/modules/articulo/config/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,24 @@ generator:
list:
display:
- '=id'
- slide_id
- created_by
- updated_by
- autors_list
- tematicas_list
- dm_users_list
- titulo
- '=titulo'
- anno
- resumen
- idioma
- aprobado
- is_active
- formato_duro
- palabras_claves
- pais
- institucion
- total_paginas
- num_internacional
- organismo
- tipo_dc
- cant_registros
- fecha_inicial
- fecha_final
- ciudad_pub
- editorial
- isbn
- volumen
- num_revista
- pagina_inicial
- pagina_final
- issn
- num_diapositivas
- departamento
- ciudad
- tutor
- tipo
- slide_id
- tematicas_list
- created_at
- updated_at
- created_by
- updated_by
sort:
- position
- asc
Expand All @@ -73,42 +53,20 @@ generator:
- formato_duro
- titulo
- anno
- resumen
- idioma
- palabras_claves
- slide_id
- pais
- institucion
- total_paginas
- num_internacional
- organismo
- tipo_dc
- cant_registros
- fecha_inicial
- fecha_final
- ciudad_pub
- editorial
- isbn
- volumen
- num_revista
- pagina_inicial
- pagina_final
- issn
- num_diapositivas
- departamento
- ciudad
- tutor
- tipo
- created_at
- updated_at
- created_by
- updated_by
- updated_by
form:
display:
NONE: [aprobado, is_active, formato_duro, created_by, updated_by]
NONE: [aprobado, is_active, formato_duro]
Slide: [slide_id_form, slide_id_view]
Users: [dm_users_list]
Others: [titulo, anno, resumen, idioma, palabras_claves, pais, institucion, total_paginas, num_internacional, organismo, tipo_dc, cant_registros, fecha_inicial, fecha_final, ciudad_pub, editorial, isbn, volumen, num_revista, pagina_inicial, pagina_final, issn, num_diapositivas, departamento, ciudad, tutor, tipo]
Others: [titulo, anno, resumen, idioma, palabras_claves, volumen, num_revista, pagina_inicial, pagina_final, issn]
class: ArticuloAdminForm
fields: { }
edit: ~
Expand Down
12 changes: 12 additions & 0 deletions apps/admin/modules/articulo/lib/ArticuloAdminForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,17 @@ class ArticuloAdminForm extends BaseArticuloForm
public function configure()
{
parent::configure();
$this->validatorSchema['volumen'] = new sfValidatorRegex(array ('pattern' => '(^[0-9]+$)', 'required' => true), array('required' => 'Por favor introduzca el volumen de la revista','invalid' => 'El volumen deber ser un n&uacutemero'));
$this->validatorSchema['num_revista'] = new sfValidatorRegex(array ('pattern' => '(^[0-9]+$)', 'required' => true), array('required'=>'Por favor introduzca el n&uacutemero de revista', 'invalid' => 'El No. de revista deber ser un n&uacutemero'));
$this->validatorSchema['pagina_inicial'] = new sfValidatorRegex(array ('pattern' => '(^[0-9]+$)', 'required' => false), array('invalid' => 'La p&aacutegina inicial deber ser un n&uacutemero'));
$this->validatorSchema['pagina_final'] = new sfValidatorRegex(array ('pattern' => '(^[0-9]+$)', 'required' => false), array('invalid' => 'La p&aacutegina final deber ser un n&uacutemero'));
$this->validatorSchema['issn'] = new sfValidatorString(array('min_length' =>3, 'required' => false), array ('min_length' => 'El ISSN debe tener al menos 3 caracteres'));

$this->mergePostValidator( new sfValidatorDoctrineUnique(array(
'model' => 'Recurso', 'column' => array('issn'), 'required' => false), array('invalid' => 'El issn de una revista es &uacutenico')));

$this->mergePostValidator( new sfValidatorSchemaCompare('pagina_inicial', sfValidatorSchemaCompare::LESS_THAN_EQUAL, 'pagina_final',
array(),
array('invalid' => 'La primera p&aacutegina ("%left_field%") debe ser menor que la &uacuteltima ("%right_field%")')));
}
}
65 changes: 9 additions & 56 deletions apps/admin/modules/bibliotecaPersonal/config/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,21 @@ generator:
list:
display:
- '=id'
- slide_id
- created_by
- updated_by
- autors_list
- tematicas_list
- dm_users_list
- titulo
- '=titulo'
- anno
- resumen
- idioma
- aprobado
- is_active
- formato_duro
- palabras_claves
- pais
- institucion
- total_paginas
- num_internacional
- organismo
- tipo_dc
- cant_registros
- fecha_inicial
- fecha_final
- ciudad_pub
- editorial
- isbn
- volumen
- num_revista
- pagina_inicial
- pagina_final
- issn
- num_diapositivas
- departamento
- ciudad
- tutor
- tipo
- slide_id
- tematicas_list
- created_at
- updated_at
- created_by
- updated_by
sort:
- position
- asc
Expand All @@ -73,42 +50,18 @@ generator:
- formato_duro
- titulo
- anno
- resumen
- idioma
- palabras_claves
- slide_id
- pais
- institucion
- total_paginas
- num_internacional
- organismo
- tipo_dc
- cant_registros
- fecha_inicial
- fecha_final
- ciudad_pub
- editorial
- isbn
- volumen
- num_revista
- pagina_inicial
- pagina_final
- issn
- num_diapositivas
- departamento
- ciudad
- tutor
- tipo
- created_at
- updated_at
- created_by
- updated_by
- updated_by
form:
display:
NONE: [aprobado, is_active, formato_duro, created_by, updated_by]
Slide: [slide_id_form, slide_id_view]
Users: [dm_users_list]
Others: [titulo, anno, resumen, idioma, palabras_claves, pais, institucion, total_paginas, num_internacional, organismo, tipo_dc, cant_registros, fecha_inicial, fecha_final, ciudad_pub, editorial, isbn, volumen, num_revista, pagina_inicial, pagina_final, issn, num_diapositivas, departamento, ciudad, tutor, tipo]
NONE: [aprobado, is_active, formato_duro]
PDF: [slide_id_form, slide_id_view]
Others: [titulo, anno, resumen, idioma, palabras_claves, cant_registros, fecha_inicial, tematicas_list]
class: bibliotecapersonalAdminForm
fields: { }
edit: ~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,18 @@ class bibliotecapersonalAdminForm extends BasebibliotecapersonalForm
public function configure()
{
parent::configure();
$this->validatorSchema['cant_registros'] = new sfValidatorRegex(array ('pattern' => '(^[0-9]+$)', 'required' => false), array('invalid' => 'La cantidad de registros deber ser un n&uacutemero'));

$this->widgetSchema['fecha_inicial'] = new sfWidgetFormFilterDate(array(
'from_date' => new sfWidgetFormDmDate(array(), array("style" => "float:none")),
'to_date' => new sfWidgetFormDmDate(array(), array("style" => "float:none")),
'template' => '%from_date% - %to_date% (desde - hasta)',
'with_empty' => true
));
$this->validatorSchema['fecha_inicial'] = new sfValidatorDateRange(array(
'required' => false,
'from_date' => new dmValidatorDate(array('required' => false)),
'to_date' => new dmValidatorDate(array('required' => false))
));
}
}
2 changes: 1 addition & 1 deletion apps/admin/modules/dmUserAdmin/lib/DmUserAdminForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DmUserAdminForm extends BaseDmUserAdminForm

public function configure()
{
$this->validatorSchema['username'] = new sfValidatorString(array('min_length' =>5), array ('required' => 'Debe escribir apodo para identificarlo en la red', 'min_length' => 'El apodo debe tener al menos 5 caracteres'));
$this->validatorSchema['username'] = new sfValidatorString(array('min_length' =>5), array ('required' => 'Debe escribir apodo para identificarlo en la red', 'min_length' => 'El apodo debe tener al menos 5 caracteres'));
$this->validatorSchema['password'] = new sfValidatorString(array('min_length' =>5, 'max_length' => 10), array ('required' => 'Debe escribir una contrase&ntildea', 'min_length' => 'La contrase&ntildea debe tener al menos 5 caracteres', 'max_length' => 'La contrase&ntildea no debe exceder los 10 caracteres'));
$this->validatorSchema['email'] = new sfValidatorEmail(array(), array ('invalid' => 'Por favor escriba un email v&aacutelido'));
$this->validatorSchema['solapin'] = new sfValidatorRegex(array ('pattern' => '(^[0-9]{4}$)'), array('invalid' => 'El No. de solap&iacuten deber ser de 4 d&iacutegitos'));
Expand Down
63 changes: 9 additions & 54 deletions apps/admin/modules/documentoLegal/config/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,22 @@ generator:
list:
display:
- '=id'
- slide_id
- created_by
- updated_by
- autors_list
- tematicas_list
- dm_users_list
- titulo
- '=titulo'
- anno
- resumen
- idioma
- aprobado
- is_active
- formato_duro
- palabras_claves
- pais
- institucion
- total_paginas
- num_internacional
- organismo
- total_paginas
- tipo_dc
- cant_registros
- fecha_inicial
- fecha_final
- ciudad_pub
- editorial
- isbn
- volumen
- num_revista
- pagina_inicial
- pagina_final
- issn
- num_diapositivas
- departamento
- ciudad
- tutor
- tipo
- slide_id
- tematicas_list
- created_at
- updated_at
- created_by
- updated_by
sort:
- position
- asc
Expand All @@ -73,42 +51,19 @@ generator:
- formato_duro
- titulo
- anno
- resumen
- idioma
- palabras_claves
- slide_id
- pais
- institucion
- total_paginas
- num_internacional
- organismo
- tipo_dc
- cant_registros
- fecha_inicial
- fecha_final
- ciudad_pub
- editorial
- isbn
- volumen
- num_revista
- pagina_inicial
- pagina_final
- issn
- num_diapositivas
- departamento
- ciudad
- tutor
- tipo
- created_at
- updated_at
- created_by
- updated_by
- updated_by
form:
display:
NONE: [aprobado, is_active, formato_duro, created_by, updated_by]
NONE: [aprobado, is_active, formato_duro]
Slide: [slide_id_form, slide_id_view]
Users: [dm_users_list]
Others: [titulo, anno, resumen, idioma, palabras_claves, pais, institucion, total_paginas, num_internacional, organismo, tipo_dc, cant_registros, fecha_inicial, fecha_final, ciudad_pub, editorial, isbn, volumen, num_revista, pagina_inicial, pagina_final, issn, num_diapositivas, departamento, ciudad, tutor, tipo]
Others: [titulo, anno, resumen, idioma, palabras_claves, organismo, total_paginas, tipo_dc, tematicas_list]
class: documentolegalAdminForm
fields: { }
edit: ~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ class documentolegalAdminForm extends BasedocumentolegalForm
public function configure()
{
parent::configure();
$this->widgetSchema['tipo_dc'] = new sfWidgetFormChoice(array( 'choices' => array('Decreto ley' => 'Decreto ley','Ley' => 'Ley', 'Reglamento' => 'Reglamento', 'Procedimiento' => 'Procedimiento', 'Resolucion' => 'Resolucion')));
$this->validatorSchema['organismo'] = new sfValidatorString(array('min_length' =>3), array ('required' => 'Debe escribir el organismo', 'min_length' => 'El organismo debe tener al menos 3 caracteres'));
$this->validatorSchema['tipo_dc'] = new sfValidatorString(array( 'required' => false));
$this->validatorSchema['total_paginas'] = new sfValidatorRegex(array ('pattern' => '(^[0-9]+$)', 'required' => false), array('invalid' => 'El total de p&aacuteginas deber ser un n&uacutemero'));
}
}
Loading