Skip to content

Commit

Permalink
Merge pull request #10 from PabloRN/master
Browse files Browse the repository at this point in the history
Configuración de formularios de registro y de signin, y envio de email
  • Loading branch information
rafix committed Jul 4, 2011
2 parents 1b3573c + a9d7d38 commit 241b5c1
Show file tree
Hide file tree
Showing 38 changed files with 2,152 additions and 1,884 deletions.
4 changes: 2 additions & 2 deletions apps/admin/modules/busqueda/config/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ generator:
- user_id
- titulo
- mensaje
- tematicas
- tematica
- fecha_antes
- fecha_despues
- created_at
Expand All @@ -46,7 +46,7 @@ generator:
display:
NONE: [is_active, user_id]
Mensaje: [mensaje]
Others: [titulo, tematicas, fecha_antes, fecha_despues]
Others: [titulo, tematica, fecha_antes, fecha_despues]
class: BusquedaAdminForm
fields: { }
edit: ~
Expand Down
1 change: 1 addition & 0 deletions apps/admin/modules/dmUserAdmin/config/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ generator:

list:
display:
- id
- =username
- email
- is_active
Expand Down
16 changes: 16 additions & 0 deletions apps/admin/modules/respuestaBusqueda/actions/actions.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

require_once dirname(__FILE__).'/../lib/respuestaBusquedaGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/respuestaBusquedaGeneratorHelper.class.php';

/**
* respuestaBusqueda actions.
*
* @package bibliocnic
* @subpackage respuestaBusqueda
* @author Your name here
* @version SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $
*/
class respuestaBusquedaActions extends autoRespuestaBusquedaActions
{
}
43 changes: 43 additions & 0 deletions apps/admin/modules/respuestaBusqueda/config/generator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
generator:
class: dmAdminDoctrineGenerator
param:
model_class: respuestab
theme: dmAdmin
non_verbose_templates: true
with_show: false
route_prefix: respuesta_busqueda
with_doctrine_route: false
config:
actions: ~
fields: { }
list:
display:
- '=id'
- busqueda_id
- mensaje
- uri
- created_at
- updated_at
sort:
- created_at
- desc
table_method: getAdminListQuery
table_count_method: ~
sortable: false
filter:
display:
- id
- mensaje
- busqueda_id
- uri
- created_at
- updated_at
form:
display:
NONE: [busqueda_id]
Mensaje: [mensaje]
Others: [uri]
class: respuestabAdminForm
fields: { }
edit: ~
new: ~
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

/**
* respuestaBusqueda module configuration.
*
* @package bibliocnic
* @subpackage respuestaBusqueda
* @author Your name here
* @version SVN: $Id: configuration.php 12474 2008-10-31 10:41:27Z fabien $
*/
class respuestaBusquedaGeneratorConfiguration extends BaseRespuestaBusquedaGeneratorConfiguration
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

/**
* respuestaBusqueda module helper.
*
* @package bibliocnic
* @subpackage respuestaBusqueda
* @author Your name here
* @version SVN: $Id: helper.php 12474 2008-10-31 10:41:27Z fabien $
*/
class respuestaBusquedaGeneratorHelper extends BaseRespuestaBusquedaGeneratorHelper
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

/**
* respuestaBusqueda admin export
*
* @package bibliocnic
* @subpackage respuestaBusqueda
* @author Your name here
*/
class respuestabAdminExport extends myDoctrineTableExport
{
}
17 changes: 17 additions & 0 deletions apps/admin/modules/respuestaBusqueda/lib/respuestabAdminForm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/**
* respuestaBusqueda admin form
*
* @package bibliocnic
* @subpackage respuestaBusqueda
* @author Your name here
*/
class respuestabAdminForm extends BaserespuestabForm
{
public function configure()
{
parent::configure();
unset($this['created_at'], $this['updated_at']);
}
}
17 changes: 15 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: none
delivery_strategy: realtime

all:
routing:
Expand All @@ -43,4 +43,17 @@ all:
class: sfViewCacheManager
param:
cache_key_use_vary_headers: true
cache_key_use_host_name: true
cache_key_use_host_name: true
mailer:
param:
logging: %SF_LOGGING_ENABLED%
charset: %SF_CHARSET%
delivery_strategy: realtime
transport:
class: Swift_SmtpTransport
param:
host: 10.36.1.2
port: 25
encryptation: ~
username: [email protected]
password: 123456
18 changes: 18 additions & 0 deletions apps/front/modules/busqueda/actions/actions.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ public function executeFormWidget(dmWebRequest $request)
{
$form->save();
$this->getUser()->setFlash('busqueda_form_valid', true);
$user = $this->getUser()->getDmUser();

$this->getService('mail')->setTemplate('solicitud_busqueda_especializada')
->addValues(array(
'titulo' => $form->getValue('titulo'),
'email' => $user->getEmail(),
'mensaje' => $form->getValue('mensaje'),
'tematica' => $form->getValue('tematica'),
'fecha_antes' => $form->getValue('fecha_antes'),
'fecha_despues'=> $form->getValue('fecha_despues'),
'nombre' => $user->getNombre(),
'apellidos' => $user->getApellidos()

))

->send();


$this->redirectBack();
}

Expand Down
15 changes: 15 additions & 0 deletions apps/front/modules/busqueda/actions/components.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* No redirection nor database manipulation ( insert, update, delete ) here
*
*
*/
class busquedaComponents extends myFrontModuleComponents
{
Expand All @@ -13,5 +14,19 @@ public function executeForm()
$this->form = $this->forms['busqueda'];
}

public function executeList()
{
$query = $this->getListQuery();

$this->busquedaPager = $this->getPager($query);
}

public function executeShow()
{
$query = $this->getShowQuery();

$this->busqueda = $this->getRecord($query);
}


}
2 changes: 1 addition & 1 deletion apps/front/modules/busqueda/config/security.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
all:
is_secure: false
is_secure: true
18 changes: 18 additions & 0 deletions apps/front/modules/busqueda/templates/_list.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php // Vars: $busquedaPager

echo $busquedaPager->renderNavigationTop();

echo _open('ul.elements');

foreach ($busquedaPager as $busqueda)
{
echo _open('li.element');

echo _link($busqueda);

echo _close('li');
}

echo _close('ul');

echo $busquedaPager->renderNavigationBottom();
3 changes: 3 additions & 0 deletions apps/front/modules/busqueda/templates/_show.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php // Vars: $busqueda

echo $busqueda;
11 changes: 10 additions & 1 deletion apps/front/modules/dmUser/actions/actions.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@ public function executeFormWidget(dmWebRequest $request)
}

$form->bind($data, $request->getFiles($form->getName()));


if ($request->isMethod('post') && $form->bindAndValid($request))

{
$form->save();
$this->getUser()->setFlash('busqueda_form_valid', true);
$this->redirectBack();
}

if ($form->isValid())
{
$user = $form->save();
Expand All @@ -49,6 +57,7 @@ public function executeFormWidget(dmWebRequest $request)
// pass the form to the component
$this->forms['DmUser'] = $form;
}

}

?>
11 changes: 7 additions & 4 deletions apps/front/modules/dmUser/templates/_form.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<?php

/*if($sf_user->isAuthenticated())
if ($sf_user->getFlash('busqueda_form_valid'))
{
echo _tag('p.felicitaciones', 'Su solicitud ha sido enviada satisfactoriamente y ser&aacute respondida con la mayor brevedad posible ');
}
if($sf_user->isAuthenticated())
{
$image = $sf_user->getUser()->get('Image');
echo _media($image)->size(50,60);
echo _tag('p', __('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;
}*/
}

echo $form;
1 change: 1 addition & 0 deletions apps/front/modules/dmUser/templates/_signin.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
return;
}


echo $form->open('.dm_signin_form action=@signin');

echo _tag('ul.dm_form_elements',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
/**
* Respuesta busqueda actions
*/
class respuestaBusquedaActions extends myFrontModuleActions
{


}
25 changes: 25 additions & 0 deletions apps/front/modules/respuestaBusqueda/actions/components.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/**
* Respuesta busqueda components
*
* No redirection nor database manipulation ( insert, update, delete ) here
*/
class respuestaBusquedaComponents extends myFrontModuleComponents
{

public function executeListByBusqueda()
{
$query = $this->getListQuery();

$this->respuestaBusquedaPager = $this->getPager($query);
}

public function executeShow()
{
$query = $this->getShowQuery();

$this->respuestaBusqueda = $this->getRecord($query);
}


}
18 changes: 18 additions & 0 deletions apps/front/modules/respuestaBusqueda/templates/_listByBusqueda.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php // Vars: $respuestaBusquedaPager

echo $respuestaBusquedaPager->renderNavigationTop();

echo _open('ul.elements');

foreach ($respuestaBusquedaPager as $respuestaBusqueda)
{
echo _open('li.element');

echo _link($respuestaBusqueda);

echo _close('li');
}

echo _close('ul');

echo $respuestaBusquedaPager->renderNavigationBottom();
3 changes: 3 additions & 0 deletions apps/front/modules/respuestaBusqueda/templates/_show.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php // Vars: $respuestaBusqueda

echo $respuestaBusqueda;
Loading

0 comments on commit 241b5c1

Please sign in to comment.