Przeglądaj źródła

Se agrega el administrative_state y se asigna a la ONU, es una réplica de la del Base.

Maximiliano Schvindt 8 lat temu
rodzic
commit
35e97f8afc

+ 17 - 3
app/config/workflow.yml

@@ -1,25 +1,39 @@
 framework:
     workflows:
-        onu_state:
+        administrative_state:
             type: 'state_machine'
             marking_store:
                 type: 'single_state'
                 arguments:
-                    - 'currentState'
+                    - 'administrativeState'
             supports:
                 - FTTHBundle\Entity\ONU
             places:
                 - active
+                - pre_notice
                 - suspend
+                - deleted
             transitions:
+                active_to_pre_notice:
+                    from: active
+                    to:   pre_notice
                 active_to_suspend:
                     from: active
                     to:   suspend
+                pre_notice_to_active:
+                    from: pre_notice
+                    to:   active
+                pre_notice_to_suspend:
+                    from: pre_notice
+                    to:   suspend
                 suspend_to_active:
                     from: suspend
                     to:   active 
+                delete:
+                    from: [active,suspend,pre_notice]
+                    to:   deleted
         transition_state:
-            type: 'workflow'
+            type: 'state_machine'
             marking_store:
                 type: 'single_state'
                 arguments:

+ 27 - 2
src/FTTHBundle/Entity/ONU.php

@@ -81,11 +81,16 @@ class ONU
      * @ORM\Column(type="string", nullable=true) 
      */
     protected $currentState = null;
+    
+    /**
+     * @ORM\Column(type="string", nullable=true) 
+     */
+    protected $administrativeState = 'active';
 
     /**
-     * @ORM\Column(type="string", nullable=false, options={"default": "pending"}) 
+     * @ORM\Column(type="string", nullable=false, options={"default": "success"}) 
      */
-    protected $transitionState = 'pending';
+    protected $transitionState = 'success';
 
     /**
      * @ORM\ManyToOne(targetEntity="OLT", inversedBy="onus", fetch="EXTRA_LAZY")
@@ -293,6 +298,26 @@ class ONU
         return $this;
     }
 
+    /**
+     * Get administrativeState
+     *
+     */
+    public function getAdministrativeState()
+    {
+        return $this->administrativeState;
+    }
+
+    /**
+     * Set administrativeState
+     *
+     */
+    public function setAdministrativeState($administrativeState)
+    {
+        $this->administrativeState = $administrativeState;
+        
+        return $this;
+    }
+
     /**
      * Get transitionState
      *

+ 6 - 6
src/FTTHBundle/Resources/views/ONU/show_workflow.html.twig

@@ -9,10 +9,10 @@
                 <code>
                     FTTHBundle\Entity\ONU::current_state = {{ onu.getCurrentState() }}
                 </code>
-                <br />
+                {#<br />
                 <code>
                     FTTHBundle\Entity\ONU::transitionState = {{ onu.getTransitionState() }}
-                </code>
+                </code>#}
             </p>
             <p>
                 <form action="{{ path('admin_ftth_onu_reset_state', {id: onu.getId()}) }}" method="post" class="form-inline">
@@ -40,7 +40,7 @@
                         <a  href="" name="transition" class="btn btn-danger" disabled="disabled">Sin opciones</a>
                     {% endif %}
                 </div>
-                <div class="btn-group-vertical" role="group">
+                {#<div class="btn-group-vertical" role="group">
                     <code style="color:black;text-align:center">transation_state</code> 
                     {% if workflow_transitions(onu, "transition_state")|length > 0 %}
                         {% for transition in workflow_transitions(onu, "transition_state") %}
@@ -57,15 +57,15 @@
                     {% else %}
                         <a  href="" name="transition" class="btn btn-danger" disabled="disabled">Sin opciones</a>
                     {% endif %}
-                </div>
+                </div>#}
             <br />
         </div>
     </div>
     <div>
         <br />
         <img src="http://200.50.175.17/ftth/workflows_png/{{onu.getWorkflow()}}.png?nocache={{ date().timestamp }}" />
-        <br />
-        <img src="http://200.50.175.17/ftth/workflows_png/transition_state.png?nocache={{ date().timestamp }}" />
+        {#<br />
+        <img src="http://200.50.175.17/ftth/workflows_png/transition_state.png?nocache={{ date().timestamp }}" />#}
     </div>
     <br />
     <div>