Commit fbcac3f6 by Aaron Romero

Actualizando Entidad CtlCatalogo a CtlCatalogoFormulario para no interferir con Catalago Maestro.

parent bc94887a
......@@ -130,10 +130,10 @@
<argument>Minsal\FormDinamicoBundle\Entity\CtlCampo</argument>
<argument>SonataAdminBundle:CRUD</argument>
</service>
<service id="sonata.admin.ctlcatalogo" class="Minsal\FormDinamicoBundle\Admin\CtlCatalogoAdmin">
<service id="sonata.admin.ctlcatalogoformulario" class="Minsal\FormDinamicoBundle\Admin\CtlCatalogoFormularioAdmin">
<tag name="sonata.admin" manager_type="orm" group="FR-1-FormConfiguration" label="Catálogo"/>
<argument />
<argument>Minsal\FormDinamicoBundle\Entity\CtlCatalogo</argument>
<argument>Minsal\FormDinamicoBundle\Entity\CtlCatalogoFormulario</argument>
<argument>SonataAdminBundle:CRUD</argument>
</service>
<!--Formulario-->
......
......@@ -9,7 +9,7 @@ use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Show\ShowMapper;
class CtlCatalogoAdmin extends Admin
class CtlCatalogoFormularioAdmin extends Admin
{
protected function configureFormFields(FormMapper $formMapper)
{
......@@ -89,7 +89,7 @@ class CtlCatalogoAdmin extends Admin
public function getTemplate($name) {
switch ($name) {
case 'edit':
return 'MinsalFormDinamicoBundle:CRUD:CtlCatalogo/editCtlCatalogo.html.twig';
return 'MinsalFormDinamicoBundle:CRUD:CtlCatalogoFormulario/editCtlCatalogoFormulario.html.twig';
break;
default:
return parent::getTemplate($name);
......
......@@ -86,7 +86,7 @@ class FrmFormItemAdmin extends Admin
if($this->getSubject()->getTipoOrigen()==1){
$formMapper
->add('idCatalogo','genemu_jqueryselect2_entity',array('label'=>'Catálogo de Referencia','required'=>true, 'property'=>'nombre','class'=>'MinsalFormDinamicoBundle:CtlCatalogo', 'mapped'=>false))
->add('idCatalogo','genemu_jqueryselect2_entity',array('label'=>'Catálogo de Referencia','required'=>true, 'property'=>'nombre','class'=>'MinsalFormDinamicoBundle:CtlCatalogoFormulario', 'mapped'=>false))
;
}
}
......
......@@ -12,7 +12,7 @@ use Doctrine\DBAL as DBAL;
class CtlCatalogoController extends Controller {
class CtlCatalogoFormularioController extends Controller {
/**
* @Route("/catalogos/get", name="catalogos", options={"expose"=true})
......@@ -23,7 +23,7 @@ class CtlCatalogoController extends Controller {
$em = $this->getDoctrine()->getManager();
$dql1 = "SELECT c.id, c.nombre FROM MinsalFormDinamicoBundle:CtlCatalogo c";
$dql1 = "SELECT c.id, c.nombre FROM MinsalFormDinamicoBundle:CtlCatalogoFormulario c";
$r_dql1 = $em->createQuery($dql1)
->setParameters(array())
......@@ -45,7 +45,7 @@ class CtlCatalogoController extends Controller {
$object = null;
$html = '';
$object = $this->findObject('CtlCatalogo',$idCatalogo);
$object = $this->findObject('CtlCatalogoFormulario',$idCatalogo);
$html = '<p>A continuaci&oacute;n se detallan los datos generales del Catálogo seleccionado</p>
<table class="table table-bordered search-detail">
......@@ -97,7 +97,7 @@ class CtlCatalogoController extends Controller {
$sql = "";
$html = "";
$catalogo = $this->findObject('CtlCatalogo', $idCatalogo);
$catalogo = $this->findObject('CtlCatalogoFormulario', $idCatalogo);
$sql = "SELECT c.".$catalogo->getIdCampo()->getNombre()." as id, c.".$catalogo->getIdCampoDescripcion()->getNombre()." as desc".
......
......@@ -80,7 +80,7 @@ class FrmFormItemAdminController extends CRUDController
$newFrmFormItemCatalogo = new FrmFormItemCatalogo();
$catalogo = $this->findObject('CtlCatalogo', $request->get('idCatalogo'));
$catalogo = $this->findObject('CtlCatalogoFormulario', $request->get('idCatalogo'));
$newFrmFormItemCatalogo->setIdFormItem($newFrmFormItem);
$newFrmFormItemCatalogo->setIdCatalogo($catalogo);
/*$newFrmFormItemCatalogo->setHabilitados($request->get('enabledRegs'));
......@@ -265,7 +265,7 @@ class FrmFormItemAdminController extends CRUDController
/*Realizar esto en caso de que cambie el catalogo de referencia
if($frmFormItemCatalogo->getIdCatalogo()->getId() != $request->get('newIdCatalog') ){
$catalogo = $this->findObject('CtlCatalogo', $request->get('newIdCatalog'));
$catalogo = $this->findObject('CtlCatalogoFormulario', $request->get('newIdCatalog'));
$frmFormItemCatalogo->setIdCatalogo($catalogo);
Borrar los registros de frm_item_catalogo_reg que hacen referencia al item_catalogo actualizado
}*/
......
......@@ -6,13 +6,13 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* CtlCatalogo
* CtlCatalogoFormulario
*
* @ORM\Table(name="ctl_catalogo", indexes={@ORM\Index(name="IDX_8E5C8793F1A1D4C9", columns={"id_campo_id"}), @ORM\Index(name="IDX_8E5C879377105966", columns={"id_campo_descripcion"})})
* @ORM\Table(name="ctl_catalogo_formulario", indexes={@ORM\Index(name="IDX_8E5C8793F1A1D4C9", columns={"id_campo_id"}), @ORM\Index(name="IDX_8E5C879377105966", columns={"id_campo_descripcion"})})
* @ORM\Entity
* @UniqueEntity(fields={"nombre"}, errorPath="nombre", message="El Nombre ya existe. No pueden existir Catalogos con nombres similares.")
*/
class CtlCatalogo
class CtlCatalogoFormulario
{
/**
* @var integer
......@@ -20,7 +20,7 @@ class CtlCatalogo
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="SEQUENCE")
* @ORM\SequenceGenerator(sequenceName="ctl_catalogo_id_seq", allocationSize=1, initialValue=1)
* @ORM\SequenceGenerator(sequenceName="ctl_catalogo_formulario_id_seq", allocationSize=1, initialValue=1)
*/
private $id;
......@@ -63,7 +63,7 @@ class CtlCatalogo
/**
* Get id
*
* @return integer
* @return integer
*/
public function getId()
{
......@@ -74,7 +74,7 @@ class CtlCatalogo
* Set nombre
*
* @param string $nombre
* @return CtlCatalogo
* @return CtlCatalogoFormulario
*/
public function setNombre($nombre)
{
......@@ -86,7 +86,7 @@ class CtlCatalogo
/**
* Get nombre
*
* @return string
* @return string
*/
public function getNombre()
{
......@@ -97,7 +97,7 @@ class CtlCatalogo
* Set descripcion
*
* @param string $descripcion
* @return CtlCatalogo
* @return CtlCatalogoFormulario
*/
public function setDescripcion($descripcion)
{
......@@ -109,7 +109,7 @@ class CtlCatalogo
/**
* Get descripcion
*
* @return string
* @return string
*/
public function getDescripcion()
{
......@@ -120,7 +120,7 @@ class CtlCatalogo
* Set idCampo
*
* @param \Minsal\FormDinamicoBundle\Entity\CtlCampo $idCampo
* @return CtlCatalogo
* @return CtlCatalogoFormulario
*/
public function setIdCampo(\Minsal\FormDinamicoBundle\Entity\CtlCampo $idCampo = null)
{
......@@ -132,7 +132,7 @@ class CtlCatalogo
/**
* Get idCampo
*
* @return \Minsal\FormDinamicoBundle\Entity\CtlCampo
* @return \Minsal\FormDinamicoBundle\Entity\CtlCampo
*/
public function getIdCampo()
{
......@@ -143,7 +143,7 @@ class CtlCatalogo
* Set idCampoDescripcion
*
* @param \Minsal\FormDinamicoBundle\Entity\CtlCampo $idCampoDescripcion
* @return CtlCatalogo
* @return CtlCatalogoFormulario
*/
public function setIdCampoDescripcion(\Minsal\FormDinamicoBundle\Entity\CtlCampo $idCampoDescripcion = null)
{
......@@ -155,14 +155,14 @@ class CtlCatalogo
/**
* Get idCampoDescripcion
*
* @return \Minsal\FormDinamicoBundle\Entity\CtlCampo
* @return \Minsal\FormDinamicoBundle\Entity\CtlCampo
*/
public function getIdCampoDescripcion()
{
return $this->idCampoDescripcion;
}
public function __toString()
public function __toString()
{
return $this->nombre ?: ' ';
}
......
......@@ -33,9 +33,9 @@ class FrmFormItemCatalogo
private $idFormItem;
/**
* @var \CtlCatalogo
* @var \CtlCatalogoFormulario
*
* @ORM\ManyToOne(targetEntity="CtlCatalogo")
* @ORM\ManyToOne(targetEntity="CtlCatalogoFormulario")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="id_catalogo", referencedColumnName="id")
* })
......@@ -80,10 +80,10 @@ class FrmFormItemCatalogo
/**
* Set idCatalogo
*
* @param \Minsal\FormDinamicoBundle\Entity\CtlCatalogo $idCatalogo
* @param \Minsal\FormDinamicoBundle\Entity\CtlCatalogoFormulario $idCatalogo
* @return FrmFormItemCatalogo
*/
public function setIdCatalogo(\Minsal\FormDinamicoBundle\Entity\CtlCatalogo $idCatalogo = null)
public function setIdCatalogo(\Minsal\FormDinamicoBundle\Entity\CtlCatalogoFormulario $idCatalogo = null)
{
$this->idCatalogo = $idCatalogo;
......@@ -93,7 +93,7 @@ class FrmFormItemCatalogo
/**
* Get idCatalogo
*
* @return \Minsal\FormDinamicoBundle\Entity\CtlCatalogo
* @return \Minsal\FormDinamicoBundle\Entity\CtlCatalogoFormulario
*/
public function getIdCatalogo()
{
......
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="CtlCatalogo" table="ctl_catalogo">
<entity name="CtlCatalogoFormulario" table="ctl_catalogo_formulario">
<indexes>
<index name="IDX_8E5C8793F1A1D4C9" columns="id_campo_id"/>
<index name="IDX_8E5C879377105966" columns="id_campo_descripcion"/>
......
......@@ -9,7 +9,7 @@
<generator strategy="SEQUENCE"/>
</id>
<field name="condicionHabilitacion" type="integer" column="condicion_habilitacion" nullable="false"/>
<many-to-one field="idCatalogo" target-entity="CtlCatalogo">
<many-to-one field="idCatalogo" target-entity="CtlCatalogoFormulario">
<join-columns>
<join-column name="id_catalogo" referenced-column-name="id"/>
</join-columns>
......
......@@ -432,7 +432,7 @@
dataType: 'json',
timeout: 8000, // 8 sec
success: function(data) {
path = "{{ url('admin_minsal_formdinamico_ctlcatalogo_show', {'id': 'selectedId'}) }}";
path = "{{ url('admin_minsal_formdinamico_ctlcatalogoformulario_show', {'id': 'selectedId'}) }}";
url = path.replace("selectedId", id);
modal_elements[0].footer = '<a href="'+url+'" target="_blank"><button class="action blue"><span class="label">Ver Catálogo</span></button></a>';
......
......@@ -385,7 +385,7 @@
dataType: 'json',
timeout: 8000, // 8 sec
success: function(data) {
path = "{{ url('admin_minsal_formdinamico_ctlcatalogo_show', {'id': 'selectedId'}) }}";
path = "{{ url('admin_minsal_formdinamico_ctlcatalogoformulario_show', {'id': 'selectedId'}) }}";
url = path.replace("selectedId", id);
modal_elements[0].footer = '<a href="'+url+'" target="_blank"><button class="action blue"><span class="label">Ver Catálogo</span></button></a>';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment