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

reajustando el menu y la bd #16

Merged
merged 6 commits into from
Aug 5, 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
14 changes: 14 additions & 0 deletions apps/admin/config/factories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,17 @@ all:
param:
cache_key_use_vary_headers: true
cache_key_use_host_name: true
mailer:
class: sfMailer
param:
logging: %SF_LOGGING_ENABLED%
charset: %SF_CHARSET%
delivery_strategy: realtime
transport:
class: Swift_SmtpTransport
param:
host: 10.36.1.2
port: 25
encryption: ~
username: [email protected]
password: 123456
13 changes: 8 additions & 5 deletions apps/admin/modules/busqueda/config/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ generator:
display:
- '=id'
- dm_user_id
- titulo
- '=titulo'
- mensaje
- is_active
- tematica
Expand All @@ -29,7 +29,7 @@ generator:
- desc
table_method: getAdminListQuery
table_count_method: ~
sortable: false
sortable: true
filter:
display:
- id
Expand All @@ -44,10 +44,13 @@ generator:
- updated_at
form:
display:
NONE: [is_active, dm_user_id]
NONE: [dm_user_id, is_active, titulo]
Mensaje: [mensaje]
Others: [titulo, 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: ~
25 changes: 25 additions & 0 deletions apps/admin/modules/busqueda/lib/BusquedaAdminForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,30 @@ public function configure()
{
parent::configure();
unset($this['created_at'], $this['updated_at']);

/* $years = range(1900, date('Y'));



$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_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->setValidators(array(
'is_active' => new sfValidatorBoolean(),
'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' => 'busqueda', 'column' => 'id', 'required' => false))
));
}
}
25 changes: 19 additions & 6 deletions apps/admin/modules/dmUserAdmin/config/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,37 @@ generator:
display:
- id
- =username
- nombre
- apellidos
- email
- solapin
- departamento
- foto_id
- titulo
- is_active
- is_super_admin
- last_login
- titulo
- apellidos
- foto_id
- penalizado
- solapin
- departamento
- created_at
- updated_at
sort:
- username
- nombre
- asc
table_method: getAdminListQuery
table_count_method: ~
loremize: false
filter:
display:
- id
- username
- nombre
- apellidos
- email
- is_active
- last_login
- penalizado
- solapin
- titulo
form:
display:
NONE: [username, email, password, password_again, is_active, is_super_admin]
Expand Down
7 changes: 3 additions & 4 deletions apps/admin/modules/pregunta/config/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ generator:
display:
- '=id'
- dm_user_id
- titulo
- '=titulo'
- mensaje
- created_at
- updated_at
Expand All @@ -29,14 +29,13 @@ generator:
- id
- dm_user_id
- titulo
- mensaje
- created_at
- updated_at
form:
display:
NONE: [dm_user_id]
NONE: [titulo, dm_user_id]
Mensaje: [mensaje]
Others: [titulo]

class: preguntaAdminForm
fields: { }
edit: ~
Expand Down
8 changes: 8 additions & 0 deletions apps/admin/modules/pregunta/lib/preguntaAdminForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,13 @@ class preguntaAdminForm extends BasepreguntaForm
public function configure()
{
parent::configure();
$this->setValidators(array(

'mensaje' => new sfValidatorString(array('min_length' => 20), array('required' => 'Por favor describa la pregunta', 'min_length' => 'Por favor describa mejor su pregunta(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')),

'id' => new sfValidatorDoctrineChoice(array('model' => 'respuestab', 'column' => 'id', 'required' => false))
));
}
}
5 changes: 2 additions & 3 deletions apps/admin/modules/respuesta/config/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ generator:
list:
display:
- '=id'
- pregunta_id
- '=pregunta_id'
- mensaje
- created_at
- updated_at
Expand All @@ -32,8 +32,7 @@ generator:
form:
display:
Pregunta: [pregunta_id]
Mensaje: [mensaje]

NONE: [mensaje]
class: respuestaAdminForm
fields: { }
edit: ~
Expand Down
12 changes: 12 additions & 0 deletions apps/admin/modules/respuesta/lib/respuestaAdminExport.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

/**
* respuesta admin export
*
* @package bibliocnic
* @subpackage respuesta
* @author Your name here
*/
class respuestabAdminExport extends myDoctrineTableExport
{
}
7 changes: 7 additions & 0 deletions apps/admin/modules/respuesta/lib/respuestaAdminForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,12 @@ public function configure()
{
parent::configure();
unset($this['created_at'], $this['updated_at']);
$this->setValidators(array(

'mensaje' => new sfValidatorString(array('min_length' => 20), array('required' => 'Por favor describa la pregunta', 'min_length' => 'Por favor describa mejor su pregunta(al menos 20 caracteres) ')),
'pregunta_id' => new sfValidatorString(array('required' => true), array('required' => 'Debe escoger una pregunta')),

'id' => new sfValidatorDoctrineChoice(array('model' => 'respuestab', 'column' => 'id', 'required' => false))
));
}
}
16 changes: 16 additions & 0 deletions apps/admin/modules/respuesta/lib/respuestabAdminForm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

/**
* respuesta admin form
*
* @package bibliocnic
* @subpackage respuesta
* @author Your name here
*/
class respuestabAdminForm extends BaserespuestabForm
{
public function configure()
{
parent::configure();
}
}
24 changes: 24 additions & 0 deletions apps/admin/modules/respuestaBusqueda/actions/actions.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,28 @@
*/
class respuestaBusquedaActions extends autoRespuestaBusquedaActions
{
public function executeFormWidget(dmWebRequest $request)
{
$form = new respuestaBusquedaForm();
if ($request->isMethod('post') && $form->bindAndValid($request))
{
$form->save();
$user = $this->getUser()->getDmUser();
$this->getService('mail')->setTemplate('respuesta_busqueda')
->addValues(array(
'busqueda_id' => $form->getValue('busqueda_id'),
'email' => $user->getEmail(),
'mensaje' => $form->getValue('mensaje'),
'username' => $user->getUsername(),
'nombre' => $user->getNombre(),
'apellidos' => $user->getApellidos(),
'create_at' => $form->getValue('create_at')

))

->send();
$this->redirectBack();
}
$this->forms['respuestaBusqueda'] = $form;
}
}
17 changes: 9 additions & 8 deletions apps/admin/modules/respuestaBusqueda/config/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ generator:
list:
display:
- '=id'
- busqueda_id
- '=busqueda_id'
- created_by
- updated_by
- mensaje
- uri
- created_at
- updated_at
sort:
Expand All @@ -26,18 +27,18 @@ generator:
sortable: false
filter:
display:
- id
- mensaje
- busqueda_id
- uri
- created_at
- updated_at
- created_by
- updated_by
form:
display:
NONE: [busqueda_id]
Busqueda: [busqueda_id]
Mensaje: [mensaje]
Others: [uri]

class: respuestabAdminForm
fields: { }
fields:
mensaje: { help: 'Arrastre una página o un fichero si desea crear un link.' }
edit: ~
new: ~
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,12 @@ public function configure()
{
parent::configure();
unset($this['created_at'], $this['updated_at']);
$this->setValidators(array(

'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) ')),
'busqueda_id' => new sfValidatorString(array('required' => true), array('required' => 'Debe escoger una busqueda')),

'id' => new sfValidatorDoctrineChoice(array('model' => 'respuestab', 'column' => 'id', 'required' => false))
));
}
}
13 changes: 12 additions & 1 deletion apps/front/config/factories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,16 @@ all:
cache_key_use_vary_headers: true
cache_key_use_host_name: true
mailer:
class: sfMailer
param:
delivery_strategy: none
logging: %SF_LOGGING_ENABLED%
charset: %SF_CHARSET%
delivery_strategy: none
transport:
class: Swift_SmtpTransport
param:
host: 10.36.1.2
port: 25
encryption: ~
username: [email protected]
password: 123456
8 changes: 4 additions & 4 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 @@ -29,14 +29,14 @@ public function executeFormWidget(dmWebRequest $request)

))

->send(); */

->send();

*/
$this->redirectBack();
}

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


}
}
3 changes: 2 additions & 1 deletion apps/front/modules/dmUser/templates/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
{
$image = $sf_user->getUser()->get('Image');
echo _media($image)->size(50,60);
echo _tag('p.ya_registrado', __('Usted ya se encuentra registrado como "%username%", si no es "%username%" por favor cierre la sesi&oacuten e intente registrarse de nuevo.', array('%username%' => $sf_user->getUsername())));
echo _tag('p.ya_registrado', __('Usted ya se encuentra registrado como "%username%", si no es "%username%" por favor cierre la sesi&oacuten e intente registrarse de nuevo', array('%username%' => $sf_user->getUsername())));

return;
}

Expand Down
5 changes: 3 additions & 2 deletions apps/front/modules/pregunta/actions/actions.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ public function executeFormWidget(dmWebRequest $request)
$form->save();
$this->getUser()->setFlash('pregunta_form_valid', true);
$user = $this->getUser()->getDmUser();
/*$this->getService('mail')->setTemplate('solicitud_busqueda_especializada')
$this->getService('mail')->setTemplate('pregunte_al_bibliotecario')
->addValues(array(
'titulo' => $form->getValue('titulo'),
'email' => $user->getEmail(),
'mensaje' => $form->getValue('mensaje'),
'username' => $user->getUsername(),
'nombre' => $user->getNombre(),
'apellidos' => $user->getApellidos()

))

->send(); */
->send();
$this->redirectBack();
}

Expand Down
Loading