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

arreglado algunos errores #13

Merged
merged 1 commit into from
Aug 1, 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
2 changes: 1 addition & 1 deletion apps/admin/modules/busqueda/config/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ generator:
display:
- id
- is_active
- user_id
- dm_user_id
- titulo
- mensaje
- tematica
Expand Down
16 changes: 16 additions & 0 deletions apps/admin/modules/pregunta/actions/actions.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

require_once dirname(__FILE__).'/../lib/preguntaGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/preguntaGeneratorHelper.class.php';

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

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

/**
* pregunta admin form
*
* @package bibliocnic
* @subpackage pregunta
* @author Your name here
*/
class preguntaAdminForm extends BasepreguntaForm
{
public function configure()
{
parent::configure();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

/**
* pregunta module configuration.
*
* @package bibliocnic
* @subpackage pregunta
* @author Your name here
* @version SVN: $Id: configuration.php 12474 2008-10-31 10:41:27Z fabien $
*/
class preguntaGeneratorConfiguration extends BasePreguntaGeneratorConfiguration
{
}
13 changes: 13 additions & 0 deletions apps/admin/modules/pregunta/lib/preguntaGeneratorHelper.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

/**
* pregunta module helper.
*
* @package bibliocnic
* @subpackage pregunta
* @author Your name here
* @version SVN: $Id: helper.php 12474 2008-10-31 10:41:27Z fabien $
*/
class preguntaGeneratorHelper extends BasePreguntaGeneratorHelper
{
}
2 changes: 0 additions & 2 deletions apps/admin/modules/tesis/config/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ generator:
list:
display:
- '=id'
- pdf
- created_by
- updated_by
- autors_list
Expand Down Expand Up @@ -75,7 +74,6 @@ generator:
- anno
- resumen
- idioma
- pdf
- palabras_claves
- pais
- institucion
Expand Down
22 changes: 22 additions & 0 deletions apps/front/modules/pregunta/actions/actions.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* Pregunta actions
*/
class preguntaActions extends myFrontModuleActions
{

public function executeFormWidget(dmWebRequest $request)
{
$form = new preguntaForm();

if ($request->hasParameter($form->getName()) && $form->bindAndValid($request))
{
$form->save();
$this->redirectBack();
}

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


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

public function executeForm()
{
$this->form = $this->forms['pregunta'];
}

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

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

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

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


}
3 changes: 3 additions & 0 deletions apps/front/modules/pregunta/templates/_form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php // Vars: $form

echo $form;
18 changes: 18 additions & 0 deletions apps/front/modules/pregunta/templates/_list.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php // Vars: $preguntaPager

echo $preguntaPager->renderNavigationTop();

echo _open('ul.elements');

foreach ($preguntaPager as $pregunta)
{
echo _open('li.element');

echo _link($pregunta);

echo _close('li');
}

echo _close('ul');

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

echo $pregunta;
8 changes: 8 additions & 0 deletions apps/front/modules/respuesta/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 respuestaComponents extends myFrontModuleComponents
{
Expand All @@ -22,5 +23,12 @@ public function executeShow()
$this->respuesta = $this->getRecord($query);
}

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

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


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

echo $respuestaPager->renderNavigationTop();

echo _open('ul.elements');

foreach ($respuestaPager as $respuesta)
{
echo _open('li.element');

echo _link($respuesta);

echo _close('li');
}

echo _close('ul');

echo $respuestaPager->renderNavigationBottom();
22 changes: 21 additions & 1 deletion config/dm/modules.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Content:

Global:

main: # the main module is required, and must not be removed.
components:
header:
Expand All @@ -23,6 +23,7 @@ Content:
listByBusqueda:
show:
Recursos:

tesis:
model: tesis
page: true
Expand All @@ -39,9 +40,28 @@ Content:
form:
list:
show:

recurso:
model: recurso
page: true
components:
list:
form:
show:

Preguntas:

pregunta:
model: pregunta
page: true
components:
form:
list:
show:

respuesta:
model: respuesta
page: true
components:
listByPregunta:
show:
4 changes: 2 additions & 2 deletions lib/form/doctrine/BusquedaForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class BusquedaForm extends BaseBusquedaForm
{
public function configure()
{
unset($this['user_id'], $this['created_at'], $this['updated_at'], $this['is_active']);
$this->getObject()->setUserId( sfcontext::getInstance()->getUser()->getAttribute( 'user_id', ' ' ,'dmSecurityUser' ));
unset($this['dm_user_id'], $this['created_at'], $this['updated_at'], $this['is_active']);
$this->getObject()->setDmUserId( sfcontext::getInstance()->getUser()->getAttribute( 'dm_user_id', ' ' ,'dmSecurityUser' ));
$years = range(1900, date('Y'));

$today = array(
Expand Down
4 changes: 2 additions & 2 deletions lib/form/doctrine/dmUserPlugin/DmUserForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function configure()
'titulo' => 'Grado de escolaridad'
));

$this->widgetSchema['foto_id_form'] = new sfWidgetFormInputFileEditable(array(
/*$this->widgetSchema['foto_id_form'] = new sfWidgetFormInputFileEditable(array(
'label' => 'imagen',
'file_src' => '/uploads/dm-user/' . $this->getObject()->getFilename(),
'is_image' => true,
Expand All @@ -33,7 +33,7 @@ public function configure()
'required' => false,
'path' => sfConfig::get('sf_upload_dir') . '/dm_user',
'mime_types' => 'web_images'
));
));*/
$this->setValidators(array(
'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')),
'email' => new sfValidatorEmail(array(), array('invalid' => 'Por favor escriba un email v&aacutelido')),
Expand Down