diff --git a/apps/admin/modules/busqueda/config/generator.yml b/apps/admin/modules/busqueda/config/generator.yml index 2518e9d..eef026c 100644 --- a/apps/admin/modules/busqueda/config/generator.yml +++ b/apps/admin/modules/busqueda/config/generator.yml @@ -34,7 +34,7 @@ generator: display: - id - is_active - - user_id + - dm_user_id - titulo - mensaje - tematica diff --git a/apps/admin/modules/pregunta/actions/actions.class.php b/apps/admin/modules/pregunta/actions/actions.class.php new file mode 100644 index 0000000..671f896 --- /dev/null +++ b/apps/admin/modules/pregunta/actions/actions.class.php @@ -0,0 +1,16 @@ +hasParameter($form->getName()) && $form->bindAndValid($request)) + { + $form->save(); + $this->redirectBack(); + } + + $this->forms['pregunta'] = $form; + } + + +} diff --git a/apps/front/modules/pregunta/actions/components.class.php b/apps/front/modules/pregunta/actions/components.class.php new file mode 100644 index 0000000..67252aa --- /dev/null +++ b/apps/front/modules/pregunta/actions/components.class.php @@ -0,0 +1,30 @@ +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); + } + + +} diff --git a/apps/front/modules/pregunta/templates/_form.php b/apps/front/modules/pregunta/templates/_form.php new file mode 100644 index 0000000..3369cc8 --- /dev/null +++ b/apps/front/modules/pregunta/templates/_form.php @@ -0,0 +1,3 @@ +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(); \ No newline at end of file diff --git a/apps/front/modules/pregunta/templates/_show.php b/apps/front/modules/pregunta/templates/_show.php new file mode 100644 index 0000000..88b6518 --- /dev/null +++ b/apps/front/modules/pregunta/templates/_show.php @@ -0,0 +1,3 @@ +respuesta = $this->getRecord($query); } + public function executeListByPregunta() + { + $query = $this->getListQuery(); + + $this->respuestaPager = $this->getPager($query); + } + } diff --git a/apps/front/modules/respuesta/templates/_listByPregunta.php b/apps/front/modules/respuesta/templates/_listByPregunta.php new file mode 100644 index 0000000..e68b0aa --- /dev/null +++ b/apps/front/modules/respuesta/templates/_listByPregunta.php @@ -0,0 +1,18 @@ +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(); \ No newline at end of file diff --git a/config/dm/modules.yml b/config/dm/modules.yml index 5c79c1e..bf4ed9a 100644 --- a/config/dm/modules.yml +++ b/config/dm/modules.yml @@ -1,7 +1,7 @@ Content: Global: - + main: # the main module is required, and must not be removed. components: header: @@ -23,6 +23,7 @@ Content: listByBusqueda: show: Recursos: + tesis: model: tesis page: true @@ -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: \ No newline at end of file diff --git a/lib/form/doctrine/BusquedaForm.class.php b/lib/form/doctrine/BusquedaForm.class.php index 65d4bf3..c9b29c0 100644 --- a/lib/form/doctrine/BusquedaForm.class.php +++ b/lib/form/doctrine/BusquedaForm.class.php @@ -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( diff --git a/lib/form/doctrine/dmUserPlugin/DmUserForm.class.php b/lib/form/doctrine/dmUserPlugin/DmUserForm.class.php index f1e87ec..9c4c1a8 100644 --- a/lib/form/doctrine/dmUserPlugin/DmUserForm.class.php +++ b/lib/form/doctrine/dmUserPlugin/DmUserForm.class.php @@ -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, @@ -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álido')),