Browse Source

Merge remote-tracking branch 'origin/master' into luciano

Luciano Andrade 8 years ago
parent
commit
e4dc82c479

+ 2 - 2
Dockerfile

@@ -1,10 +1,10 @@
-FROM debian:8
+FROM debian:9
 EXPOSE 8000
 
 #RUN echo "Acquire::http::Proxy \"http://172.17.0.5:3142\";" | tee /etc/apt/apt.conf.d/00aptproxy
 
 RUN apt-get update 
-RUN apt-get install -yq git wget vim tmux php5-cli php5-mysql php5-curl
+RUN apt-get install -yq git wget vim tmux php-cli php-mysql php-curl graphviz php-amqplib php7.0-xml php7.0-zip
 
 RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
 RUN php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

+ 1 - 0
app/AppKernel.php

@@ -35,6 +35,7 @@ class AppKernel extends Kernel
             new TemplateBundle\TemplateBundle(),
             new ExtraDataBundle\ExtraDataBundle(),
             new DeviceBundle\DeviceBundle(),
+            new OwnerVoterBundle\OwnerVoterBundle(),
         ];
 
         if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {

+ 17 - 0
app/Resources/SonataAdminBundle/views/CRUD/list__action_delete.html.twig

@@ -0,0 +1,17 @@
+{#
+
+This file is part of the Sonata package.
+
+(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
+
+For the full copyright and license information, please view the LICENSE
+file that was distributed with this source code.
+
+#}
+
+{% if admin.hasAccess('delete', object) and owner_voter.vote(token_security.token, object, ['delete']) >= 0 and admin.hasRoute('delete') %}
+    <a href="{{ admin.generateObjectUrl('delete', object) }}" class="btn btn-sm btn-default delete_link" title="{{ 'action_delete'|trans({}, 'SonataAdminBundle') }}">
+        <i class="fa fa-times" aria-hidden="true"></i>
+        {{ 'action_delete'|trans({}, 'SonataAdminBundle') }}
+    </a>
+{% endif %}

+ 18 - 0
app/Resources/SonataAdminBundle/views/CRUD/list__action_edit.html.twig

@@ -0,0 +1,18 @@
+{#
+
+This file is part of the Sonata package.
+
+(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
+
+For the full copyright and license information, please view the LICENSE
+file that was distributed with this source code.
+
+#}
+
+{% if admin.hasAccess('edit', object) and owner_voter.vote(token_security.token, object, ['edit']) >= 0 and admin.hasRoute('edit') %}
+    <a href="{{ admin.generateObjectUrl('edit', object) }}" class="btn btn-sm btn-default edit_link"
+       title="{{ 'action_edit'|trans({}, 'SonataAdminBundle') }}">
+        <i class="fa fa-pencil" aria-hidden="true"></i>
+        {{ 'action_edit'|trans({}, 'SonataAdminBundle') }}
+    </a>
+{% endif %}

+ 3 - 0
app/config/config.yml

@@ -18,6 +18,7 @@ imports:
     - { resource: "@ExtraDataBundle/Resources/config/services.yml" }
     - { resource: "bundles/ik/device-bundle/parameters.yml" }
     - { resource: "@DeviceBundle/Resources/config/services.yml" }
+    - { resource: "@OwnerVoterBundle/Resources/config/services.yml" }
 
 parameters:
     app_name: ftth
@@ -58,6 +59,8 @@ twig:
     globals:
         base_url: %url_base%
         fd_alerts: '@base_admin.alert_service'
+        token_security: '@security.token_storage'
+        owner_voter: '@owner_voter.voter'
 
 # Doctrine Configuration
 doctrine:

+ 9 - 1
composer.json

@@ -59,6 +59,13 @@
             "options": {
                     "local_pk": "./keys/bitbucket.id_rsa"
             }
+        },
+        {
+            "type": "vcs",
+            "url":  "ssh://git@200.50.168.30:222/VendorSoftwareFlowdat3/OwnerVoter.git",
+            "options": {
+                    "local_pk": "./keys/bitbucket.id_rsa"
+            }
         }
     ],
     "config":{
@@ -90,7 +97,8 @@
         "php-amqplib/rabbitmq-bundle": "^1.12",
         "ik/template-bundle": "dev-master",
         "ik/extra-data-bundle": "dev-master",
-        "ik/device-bundle": "dev-master"
+        "ik/device-bundle": "dev-master",
+        "ik/owner-voter-bundle": "dev-master"
     },
     "require-dev": {
         "sensio/generator-bundle": "^3.0",

+ 32 - 8
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "content-hash": "26eeb076c6624846bb4f12cbfbb04882",
+    "content-hash": "48dd7956d5bc2894952bf9cdcbf16888",
     "packages": [
         {
             "name": "behat/transliterator",
@@ -1258,7 +1258,7 @@
             "source": {
                 "type": "git",
                 "url": "ssh://git@200.50.168.30:222/VendorSoftwareFlowdat3/BaseAdmin.git",
-                "reference": "0e78c0ea30184059e6f7065cf9628b8fc228c768"
+                "reference": "bd26c21874c4daaf5ea1891c4be873bcf8af1090"
             },
             "type": "library",
             "autoload": {
@@ -1273,7 +1273,7 @@
                 "bootstrap",
                 "sonata"
             ],
-            "time": "2017-05-08 15:32:19"
+            "time": "2017-06-26 12:35:24"
         },
         {
             "name": "ik/device-bundle",
@@ -1348,13 +1348,36 @@
             ],
             "time": "2017-04-06 15:40:13"
         },
+        {
+            "name": "ik/owner-voter-bundle",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "ssh://git@200.50.168.30:222/VendorSoftwareFlowdat3/OwnerVoter.git",
+                "reference": "9ae7b65c59f9cb2216b422744a5e1ffbe429ef29"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "OwnerVoterBundle\\": ""
+                }
+            },
+            "description": "Flowdat 3 Owner Voter Bundle",
+            "keywords": [
+                "Admin Generator",
+                "admin",
+                "bundle",
+                "owner-voter"
+            ],
+            "time": "2017-06-12 15:49:24"
+        },
         {
             "name": "ik/template-bundle",
             "version": "dev-master",
             "source": {
                 "type": "git",
                 "url": "ssh://git@200.50.168.30:222/VendorSoftwareFlowdat3/TemplateBundle.git",
-                "reference": "7bedade34a07bd7ce79bcf2b82dee5970dc3f7f8"
+                "reference": "9452c62f90a0574cb1d6c94426655f1b79c571f9"
             },
             "require": {
                 "ik/base-admin-bundle": "dev-master"
@@ -1372,7 +1395,7 @@
                 "bundle",
                 "template"
             ],
-            "time": "2017-04-24 12:01:58"
+            "time": "2017-06-15 15:38:21"
         },
         {
             "name": "ik/webservice-bundle",
@@ -1401,7 +1424,7 @@
             "source": {
                 "type": "git",
                 "url": "ssh://git@200.50.168.30:222/VendorSoftwareFlowdat3/WorkflowBundle.git",
-                "reference": "885d95f8b54a3c25c8209f7a69b425670450a8dd"
+                "reference": "ce470a71aa2c8638177260cf69d6c81b9de69180"
             },
             "require": {
                 "php-amqplib/rabbitmq-bundle": "^1.12"
@@ -1431,7 +1454,7 @@
                 "bundle",
                 "workflow"
             ],
-            "time": "2017-06-05 13:56:21"
+            "time": "2017-06-23 13:10:24"
         },
         {
             "name": "incenteev/composer-parameter-handler",
@@ -5505,7 +5528,8 @@
         "ik/workflow-bundle": 20,
         "ik/template-bundle": 20,
         "ik/extra-data-bundle": 20,
-        "ik/device-bundle": 20
+        "ik/device-bundle": 20,
+        "ik/owner-voter-bundle": 20
     },
     "prefer-stable": false,
     "prefer-lowest": false,

+ 1 - 1
src/FTTHBundle/Admin/OLTAdmin.php

@@ -39,7 +39,7 @@ class OLTAdmin extends BaseAdmin
             ->add('sshPass')
 //            ->add('workflow')
             ->add('currentState','string', array('template' => 'WorkflowBundle:Workflow:base_list_field_current_state.html.twig'))
-            ->add('_action', null, array(
+            ->add('_action', 'with-workflow-action', array(
                 'actions' => array(
                     'show' => array(),
                     'edit' => array(),

+ 1 - 1
src/FTTHBundle/Admin/ONUAdmin.php

@@ -45,7 +45,7 @@ class ONUAdmin extends BaseAdmin
             ->add('olt')
 //            ->add('workflow')
             ->add('currentState','string', array('template' => 'WorkflowBundle:Workflow:base_list_field_current_state.html.twig'))
-            ->add('_action', null, array(
+            ->add('_action', 'with-workflow-action', array(
                 'actions' => array(
                     'show' => array(),
                     'edit' => array(),

+ 1 - 1
src/FTTHBundle/Entity/ONU.php

@@ -394,7 +394,7 @@ class ONU implements DeviceInterface
      * @param OLT $olt
      * @return $this
      */
-    public function setOlt(OLT $olt)
+    public function setOlt($olt)
     {
         $this->olt = $olt;