Skip to content

Commit

Permalink
cambio en el formato fecha de las busquedas y aplicacion del clean-mo…
Browse files Browse the repository at this point in the history
…dule-file para limpiar el modelo
  • Loading branch information
PabloRN committed Aug 5, 2011
1 parent 97c8e06 commit 6b7a716
Show file tree
Hide file tree
Showing 15 changed files with 279 additions and 337 deletions.
9 changes: 6 additions & 3 deletions apps/admin/modules/busqueda/config/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ generator:
- updated_at
form:
display:
NONE: [titulo, is_active, dm_user_id]
NONE: [dm_user_id, is_active, titulo]
Mensaje: [mensaje]
Others: [ tematica, fecha_antes, fecha_despues]
Others: [ tematica]
Periodo de tiempo: [fecha_antes, fecha_despues]
class: BusquedaAdminForm
fields: { }
fields:
fecha_antes: {label: Entre el}
fecha_despues: {label: Y el}
edit: ~
new: ~
32 changes: 12 additions & 20 deletions apps/admin/modules/busqueda/lib/BusquedaAdminForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,29 @@ public function configure()
parent::configure();
unset($this['created_at'], $this['updated_at']);

$years = range(1900, date('Y'));
/* $years = range(1900, date('Y'));
$today = array(
'year' => date('Y'),
'month' => date('n'),
'day' => date('j')
);
$this->widgetSchema['fecha_antes'] = new sfWidgetFormDate(array(/*'format' => '%year%', */'years' => array_combine($years, $years), 'default' => $today));
$this->widgetSchema['fecha_antes'] = new sfWidgetFormDate(array('format' => '%year%', 'years' => array_combine($years, $years)));
$this->widgetSchema['fecha_despues'] = new sfWidgetFormDate(array(/*'format' => '%year%', */'years' => array_combine($years, $years), 'default' => $today));
/*$this->widgetSchema['fecha_despues'] = new sfWidgetFormDate(array(/*'format' => '%year%', *//*'years' => array_combine($years, $years), 'default' => $today)); */
$this->widgetSchema['fecha_antes'] = new sfWidgetFormChoice(array( 'choices' => array('' => '', 1900 => 1900, 1950 => 1950, 1960 => 1960, 1970 => 1970, 1980 => 1980, 1990 => 1990, 2000 => 2000, 2001 => 2001, 2002 => 2002, 2003 => 2003, 2004 => 2004, 2005 => 2005, 2006 => 2006, 2007 => 2007, 2008 => 2008, 2009 => 2009, 2010 => 2010, 2011 => 2011, 'Actualidad' => 'Actualidad')));
$this->widgetSchema['fecha_despues'] = new sfWidgetFormChoice(array( 'choices' => array('' => '', 1900 => 1900, 1950 => 1950, 1960 => 1960, 1970 => 1970, 1980 => 1980, 1990 => 1990, 2000 => 2000, 2001 => 2001, 2002 => 2002, 2003 => 2003, 2004 => 2004, 2005 => 2005, 2006 => 2006, 2007 => 2007, 2008 => 2008, 2009 => 2009, 2010 => 2010, 2011 => 2011, 'Actualidad' => 'Actualidad')));

$this->widgetSchema->setLabels(array(
'fecha_antes' => 'Publicado entre',
'fecha_despues' => 'Y',

));
$arreglo = array(
'0' => 0,
'1' => 1
);



$this->setValidators(array(
'is_active' => new sfValidatorBoolean(),
'fecha_antes' => new sfValidatorDate(array('required' => false)),
'fecha_despues' => new sfValidatorDate(array('required' => false)),
'fecha_antes' => new sfValidatorString(array('required' => false)),
'fecha_despues' => new sfValidatorString(array('required' => false)),
'mensaje' => new sfValidatorString(array('min_length' => 20), array('required' => 'Por favor describa la respuesta', 'min_length' => 'Por favor describa mejor su busqueda(al menos 20 caracteres) ')),
'titulo' => new sfValidatorString(array('min_length' => 10), array('required' => 'Por favor escriba un t&iacutetulo', 'min_length' => 'Por favor describa mejor su t&iacutetulo(al menos 10 caracteres) ')),
'dm_user_id' => new sfValidatorString(array('required' => true), array('required' => 'Debe escoger un usuario')),
'tematica' => new sfValidatorString(array('required' => true), array('required' => 'Debe escoger una tematica')),
'id' => new sfValidatorDoctrineChoice(array('model' => 'respuestab', 'column' => 'id', 'required' => false))
'id' => new sfValidatorDoctrineChoice(array('model' => 'busqueda', 'column' => 'id', 'required' => false))
));
}
}
4 changes: 2 additions & 2 deletions apps/front/config/factories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test:
dev:
mailer:
param:
delivery_strategy: realtime
delivery_strategy: none

all:
routing:
Expand All @@ -49,7 +49,7 @@ all:
param:
logging: %SF_LOGGING_ENABLED%
charset: %SF_CHARSET%
delivery_strategy: realtime
delivery_strategy: none
transport:
class: Swift_SmtpTransport
param:
Expand Down
6 changes: 3 additions & 3 deletions apps/front/modules/busqueda/actions/actions.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function executeFormWidget(dmWebRequest $request)
$this->getUser()->setFlash('busqueda_form_valid', true);
$user = $this->getUser()->getDmUser();

$this->getService('mail')->setTemplate('solicitud_busqueda_especializada')
/* $this->getService('mail')->setTemplate('solicitud_busqueda_especializada')
->addValues(array(
'titulo' => $form->getValue('titulo'),
'email' => $user->getEmail(),
Expand All @@ -31,12 +31,12 @@ public function executeFormWidget(dmWebRequest $request)
->send();

*/
$this->redirectBack();
}

$this->forms['busqueda'] = $form;
}


}
}
419 changes: 244 additions & 175 deletions bibliocnic.sql

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions config/doctrine/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ Busqueda:
mensaje: {type: clob, extra: markdown}
is_active: {type: boolean, default: true}
tematica: {type: enum, values: [MATEMATICA, AGRICULTURA, ARTE Y HUMANIDADES, BIOINFORMÁTICA, BIOQUÍMICA GENÉTICA Y BIOLOGÍA MOLECULAR, CIENCIA AMBIENTAL, CIENCIA DE LA COMPUTACION, CIENCIA DE MATERIALES, CIENCIAS BILÓGICAS, CIENCIAS DE LA DECISIÓN, CIENCIAS DE LA TIERRA Y DEL ESPACIO, CIENCIAS SOCIALES, CIENCIAS VETERINARIAS, CONTABILIDAD Y GESTIÓN DE EMPRESAS, ECONOMÍA, ECONOMETRÍA Y FINANZAS, ENERGÍA, ENFERMERÍA, ESTOMATOLOGÍA, FARMACOLOGÍA TOXICOLOGÍA Y FARMACIA, FÍSICA Y ASTRONOMÍA, INGENIERÍA QUÍMICA, INGENIERÍAS, INMUNOLOGÍA Y MICROBIOLOGÍA, MEDICINA, NANOCIENCIA Y NANOTECNOLOGÍAS, NEUROCIENCIAS, PROFECIONALES EN SALUD, PSICOLOGÍA, QUÍMICA]}
fecha_antes: {type: timestamp}
fecha_despues: {type: timestamp}
fecha_antes: {type: enum, values: [1900, 1950, 1960, 1970, 1980, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, Actualidad]}
fecha_despues: {type: enum, values: [1900, 1950, 1960, 1970, 1980, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, Actualidad]}
relations:
DmUser:
local: dm_user_id
Expand Down
20 changes: 0 additions & 20 deletions lib/filter/doctrine/RespuestaSolicitudFormFilter.class.php

This file was deleted.

16 changes: 0 additions & 16 deletions lib/filter/doctrine/SolicitudProrrogaFormFilter.class.php

This file was deleted.

16 changes: 10 additions & 6 deletions lib/form/doctrine/BusquedaForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,23 @@ public function configure()
{
unset($this['dm_user_id'], $this['created_at'], $this['updated_at'], $this['is_active']);
$this->getObject()->setDmUserId( sfcontext::getInstance()->getUser()->getAttribute( 'user_id', ' ' ,'dmSecurityUser' ));
$years = range(1900, date('Y'));
/* $years = range(1900, date('Y'));
$today = array(
'year' => date('Y'),
'month' => date('n'),
'day' => date('j')
);
$this->widgetSchema['fecha_antes'] = new sfWidgetFormDate(array(/*'format' => '%year%', */'years' => array_combine($years, $years), 'default' => $today));
$this->widgetSchema['fecha_antes'] = new sfWidgetFormDate(array(/*'format' => '%year%', *//*'years' => array_combine($years, $years), 'default' => $today));
$this->widgetSchema['fecha_despues'] = new sfWidgetFormDate(array(/*'format' => '%year%', */'years' => array_combine($years, $years), 'default' => $today));

/*$this->widgetSchema['fecha_despues'] = new sfWidgetFormDate(array(/*'format' => '%year%', *//*'years' => array_combine($years, $years), 'default' => $today));
*/
$this->widgetSchema['fecha_antes'] = new sfWidgetFormChoice(array( 'choices' => array('' => '', 1900 => 1900, 1950 => 1950, 1960 => 1960, 1970 => 1970, 1980 => 1980, 1990 => 1990, 2000 => 2000, 2001 => 2001, 2002 => 2002, 2003 => 2003, 2004 => 2004, 2005 => 2005, 2006 => 2006, 2007 => 2007, 2008 => 2008, 2009 => 2009, 2010 => 2010, 2011 => 2011, 'Actualidad' => 'Actualidad')));
$this->widgetSchema['fecha_despues'] = new sfWidgetFormChoice(array( 'choices' => array('' => '', 1900 => 1900, 1950 => 1950, 1960 => 1960, 1970 => 1970, 1980 => 1980, 1990 => 1990, 2000 => 2000, 2001 => 2001, 2002 => 2002, 2003 => 2003, 2004 => 2004, 2005 => 2005, 2006 => 2006, 2007 => 2007, 2008 => 2008, 2009 => 2009, 2010 => 2010, 2011 => 2011, 'Actualidad' => 'Actualidad')));


$this->widgetSchema->setLabels(array(
'fecha_antes' => 'Publicado entre',
'fecha_despues' => 'Y',
Expand All @@ -36,8 +40,8 @@ public function configure()
'titulo' => new sfValidatorString(array('min_length' =>10), array ('required' => 'Debe escribir un titulo sugerente', 'min_length' => 'El titulo debe tener al menos 10 caracteres')),
'mensaje' => new sfValidatorString(array('min_length' => 20), array('required' => 'Por favor describa su busqueda', 'min_length' => 'Por favor describa mejor su busqueda(al menos 20 caracteres) ')),
'tematica' => new sfValidatorString(),
'fecha_antes' => new sfValidatorDate(array('required' => false)),
'fecha_despues' => new sfValidatorDate(array('required' => false)),
'fecha_antes' => new sfValidatorString(array('required' => false)),
'fecha_despues' => new sfValidatorString(array('required' => false)),
'id' => new sfValidatorDoctrineChoice(array('model' => 'busqueda', 'column' => 'id', 'required' => false))
));
$this->validatorSchema->setPostValidator(
Expand Down
20 changes: 0 additions & 20 deletions lib/form/doctrine/RespuestaSolicitudForm.class.php

This file was deleted.

16 changes: 0 additions & 16 deletions lib/form/doctrine/SolicitudProrrogaForm.class.php

This file was deleted.

16 changes: 0 additions & 16 deletions lib/model/doctrine/RespuestaSolicitud.class.php

This file was deleted.

11 changes: 0 additions & 11 deletions lib/model/doctrine/RespuestaSolicitudTable.class.php

This file was deleted.

16 changes: 0 additions & 16 deletions lib/model/doctrine/SolicitudProrroga.class.php

This file was deleted.

11 changes: 0 additions & 11 deletions lib/model/doctrine/SolicitudProrrogaTable.class.php

This file was deleted.

0 comments on commit 6b7a716

Please sign in to comment.