Guillermo Espinoza 5 anni fa
parent
commit
9633ef2062

File diff suppressed because it is too large
+ 56 - 0
app/DoctrineMigrations/src/action.yml


File diff suppressed because it is too large
+ 17 - 0
app/DoctrineMigrations/src/template.yml


+ 7 - 1
src/RadiusBundle/Admin/AccessAdmin.php

@@ -7,6 +7,7 @@ use Sonata\AdminBundle\Datagrid\DatagridMapper;
 use Sonata\AdminBundle\Datagrid\ListMapper;
 use Sonata\AdminBundle\Form\FormMapper;
 use Sonata\AdminBundle\Show\ShowMapper;
+use RadiusBundle\Entity\Profile;
 
 class AccessAdmin extends BaseAdmin
 {
@@ -52,7 +53,12 @@ class AccessAdmin extends BaseAdmin
     protected function configureFormFields(FormMapper $formMapper)
     {
         $formMapper
-            ->add('profile')
+            ->add('profile', null, [
+                'required' => true,
+                'attr' => [
+                    'required' => 'required',
+                ],
+            ])
             ->add('clientId')
             ->add('name')
             ->add('password')

+ 16 - 8
src/RadiusBundle/Entity/Access.php

@@ -40,6 +40,7 @@ class Access implements TenancyIdTraitInterface, LocationInterface
      * @var int
      *
      * @ORM\Column(type="integer", nullable=false)
+     * 
      * @Assert\NotNull
      */
     private $clientId;
@@ -55,24 +56,17 @@ class Access implements TenancyIdTraitInterface, LocationInterface
     private $password;
 
     /**
-     * //@ ORM\OneToOne(targetEntity="\Flowdat2\DhcpBundle\Entity\AssignedIP", cascade={"remove"})
-     * //@ ORM\JoinColumn(nullable=true)
      * @ORM\Column(type="string", length=39, nullable=true)
      */
     private $static_ip;
 
     /**
      * @var string $comments
+     * 
      * @ORM\Column(name="comments", type="text", nullable=true)
      */
     private $comments;
 
-//    /**
-//     * @ ORM\OneToOne(targetEntity="\Flowdat2\FtthBundle\Entity\ONU", fetch="EXTRA_LAZY")
-//     * @ ORM\JoinColumn(onDelete="CASCADE")
-//     */
-//    protected $onu;
-
 
     /**
      * @return string
@@ -92,11 +86,13 @@ class Access implements TenancyIdTraitInterface, LocationInterface
 
     /**
      * @param int $id
+     * 
      * @return mixed Retorna el objeto.
      */
     public function setId($id)
     {
         $this->id = $id;
+
         return $this;
     }
 
@@ -110,11 +106,13 @@ class Access implements TenancyIdTraitInterface, LocationInterface
 
     /**
      * @param mixed $profile
+     * 
      * @return mixed Retorna el objeto.
      */
     public function setProfile($profile)
     {
         $this->profile = $profile;
+
         return $this;
     }
 
@@ -128,11 +126,13 @@ class Access implements TenancyIdTraitInterface, LocationInterface
 
     /**
      * @param int $clientId
+     * 
      * @return mixed Retorna el objeto.
      */
     public function setClientId(int $clientId)
     {
         $this->clientId = $clientId;
+
         return $this;
     }
 
@@ -146,11 +146,13 @@ class Access implements TenancyIdTraitInterface, LocationInterface
 
     /**
      * @param mixed $name
+     * 
      * @return mixed Retorna el objeto.
      */
     public function setName($name)
     {
         $this->name = $name;
+
         return $this;
     }
 
@@ -164,11 +166,13 @@ class Access implements TenancyIdTraitInterface, LocationInterface
 
     /**
      * @param mixed $password
+     * 
      * @return mixed Retorna el objeto.
      */
     public function setPassword($password)
     {
         $this->password = $password;
+
         return $this;
     }
 
@@ -182,11 +186,13 @@ class Access implements TenancyIdTraitInterface, LocationInterface
 
     /**
      * @param mixed $static_ip
+     * 
      * @return mixed Retorna el objeto.
      */
     public function setStaticIp($static_ip)
     {
         $this->static_ip = $static_ip;
+
         return $this;
     }
 
@@ -200,11 +206,13 @@ class Access implements TenancyIdTraitInterface, LocationInterface
 
     /**
      * @param string $comments
+     * 
      * @return mixed Retorna el objeto.
      */
     public function setComments($comments)
     {
         $this->comments = $comments;
+        
         return $this;
     }
 

+ 21 - 3
src/RadiusBundle/Entity/Profile.php

@@ -138,9 +138,27 @@ class Profile implements TenancyIdTraitInterface
         return $this->download;
     }
 
+    /**
+     * @return string
+     */
+    public function getDownloadAsK()
+    {
+        return round($this->getDownload() / 1000, 2) . "k";
+    }
 
-    function getDownloadAsK(){return round($this->getDownload()/1000,2)."k"; }
-    function getUploadAsK()  {return round($this->getUpload()/1000,2)."k"; }
+    /**
+     * @return string
+     */
+    public function getUploadAsK()
+    {
+        return round($this->getUpload() / 1000, 2) . "k";
+    }
 
-    function getRadiusName()  {return preg_replace("|[^A-Za-z0-9]|", "-", $this->name); }
+    /**
+     * @return string
+     */
+    public function getRadiusName()
+    {
+        return preg_replace("|[^A-Za-z0-9]|", "-", $this->name);
+    }
 }

+ 7 - 7
src/RadiusBundle/Resources/translations/RadiusBundle.es.yml

@@ -21,16 +21,16 @@ filter:
     label_snmp_comunity: SNMP Comunity
     label_snmp_version: SNMP Versión
     label_radius_password: Contraseña
-    label_model: modelo
+    label_model: Modelo
     label_acct_enabled: Cuenta Habilitada
 
 breadcrumb:
     link_profile_list: Listado Perfiles
     link_profile_create: Crear Perfil
     link_profile_delete: Eliminar Perfil
-    link_access_list: Listado Acciones
-    link_access_create: Crear Acción
-    link_access_delete: Eliminar Acción
+    link_access_list: Listado Accesos
+    link_access_create: Crear Acceso
+    link_access_delete: Eliminar Acceso
     link_n_a_s_model_list: Listado Modelo de NAS
     link_n_a_s_model_create: Crear Modelo de NAS
     link_n_a_s_model_delete: Eliminar Modelo de NAS
@@ -54,7 +54,7 @@ form:
     label_snmp_comunity: SNMP Comunity
     label_snmp_version: SNMP Versión
     label_radius_password: Contraseña
-    label_model: modelo
+    label_model: Modelo
     label_acct_enabled: Cuenta Habilitada
 
 list:
@@ -73,7 +73,7 @@ list:
     label_snmp_comunity: SNMP Comunity
     label_snmp_version: SNMP Versión
     label_radius_password: Contraseña
-    label_model: modelo
+    label_model: Modelo
     label_acct_enabled: Cuenta Habilitada
 
 show:
@@ -92,7 +92,7 @@ show:
     label_snmp_comunity: SNMP Comunity
     label_snmp_version: SNMP Versión
     label_radius_password: Contraseña
-    label_model: modelo
+    label_model: Modelo
     label_acct_enabled: Cuenta Habilitada
 
 error: