templates/mission/_planning_item.html.twig line 1

Open in your IDE?
  1. {# DON'T ADD MODAL TEMPLATE IN THIS FILE #}
  2. {% set id_step = 0 %}
  3. <div id="scrollbox" class="workflow col-12 pt-12 pb-8 {% if mission.state == 'archived' or mission.state == 'validated' or mission.state == 'provisional' %}overlay overlay-block{% endif%}">
  4.     {% if mission.workflow is not empty %}
  5.         {% set number_of_all_steps = mission.workflow.steps|length - 1 %}
  6.         {% for step in mission.workflow.steps |sort((a, b) => a.position - b.position) %}
  7.             <div class="step-workflow position-relative">
  8.                 {% if step.active and id_step != 0 %}
  9.                     <svg width="32" class="mb-5" height="32" viewbox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
  10.                         <g clip-path="url(#clip0_2236_2734)">
  11.                             <path  class="check" d="M11.1666 17L14.1666 20L21.1666 13" stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
  12.                             <path d="M16.1666 28C22.794 28 28.1666 22.6274 28.1666 16C28.1666 9.37258 22.794 4 16.1666 4C9.53921 4 4.16663 9.37258 4.16663 16C4.16663 22.6274 9.53921 28 16.1666 28Z" stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
  13.                         </g>
  14.                         <defs>
  15.                             <clipPath id="clip0_2236_2734">
  16.                                 <rect width="32" height="32" fill="white" transform="translate(0.166626)"/>
  17.                             </clipPath>
  18.                         </defs>
  19.                     </svg>
  20.                 {% endif %}
  21.                 <div class=" step-{{ id_step }}" {% if step.active %} id="activescrollto" {% endif %}>
  22.                     <div class="cadre-step-workflow d-flex align-items-center {% if step.active %}active{% endif %} " style="padding: 5px 8px;{% if step.active %}box-shadow:none;{% endif %}">
  23.                         {% if not step.active and (is_granted('ROLE_ADMIN')) %}
  24.                             <a style="display: flex;align-items: center;
  25. " class="text-white admin" href="{{ path('workflow_jump_step', {'step': step.id, 'workflow': step.workflow.id}) }}" onclick="return confirm('Êtes-vous sûr de vouloir effectuer cette mise à jour ?');">
  26.                             {% endif %}
  27.                             <div class="planning-name-step" style="color: #344054;font-size: 14px;{% if step.active %}color: #fff !important;{% endif %}">
  28.                                 {{ step.name }}
  29.                                 {% if step.active %}
  30.                                     {# time_remaining_step is in  App\Twig\StepTwig.php #}
  31.                                     {% set time_remaining = step|time_remaining_step %}
  32.                                     {% set label =  time_remaining > 1 ? " jours ouvrés" : " jour ouvré" %}
  33.                                     {# <p style="margin: 0;font-size: 12px;font-weight: initial;">(Echéance pour cette étape : {{ time_remaining != "date-start-missed" ? time_remaining ~ label  : "Information indisponible"}} )</p> #}
  34.                                 {% endif %}
  35.                             </div>
  36.                             
  37.                                 {% set users_responsable = users_responsable_current_step(mission,step) %}
  38.                                 {% if users_responsable|length > 0 %}
  39.                                     {% set first_users_responsable = users_responsable[0] %}
  40.                                     <div class="content-step-description position-relative">
  41.                                         {% if users_responsable|length > 1 %}
  42.                                             <span class="number-user-responsable">
  43.                                                 +{{users_responsable|length - 1}}
  44.                                             </span>
  45.                                         {% endif %}
  46.                                         {% set url = vich_uploader_asset(users_responsable[0], 'picture') %}
  47.                                         <div class="content-step-responsable d-flex justify-content-center align-items-center" style="background-image : url({{url}});background-color: white;color: #1668cc;border-radius: 50%;">
  48.                                             {% if not url %}
  49.                                                 {{ first_users_responsable.firstname|slice(0,1)|upper }}{{ first_users_responsable.lastname|slice(0,1)|upper }}
  50.                                             {% endif %}
  51.                                         </div>
  52.                                     </div>
  53.                                                         
  54.                             {% endif %}
  55.                             
  56.                             {% if not step.active and is_granted('ROLE_ADMIN') %}
  57.                             </a>
  58.                             {# à mettre en dynamique #}
  59.                             {# {% if not step.active %}
  60.                                 <div class="content-step-responsable d-flex justify-content-center align-items-center" style="background-image : url();background-color: white;color: #1668cc;border-radius: 50%;">
  61.                                     yu
  62.                                 </div>
  63.                             {% endif %} #}
  64.                         {% endif %}
  65.                     </div>
  66.                     <div class="zone-btn-workflow-{{ loop.index }}" style="margin-left: 0;">
  67.                         {% if step.active %}
  68.                             {# is_responsable(step,missionParticipant) or #}
  69.                             {% if  (is_granted('ROLE_ADMIN')  or is_granted('ROLE_CLIENT_ADMIN') or ( step.manager == constant('\\App\\Enum\\Manager::CLIENT'))   and user_get_mission_role(app.user, mission) == constant('\\App\\Enum\\Role::ROLE_VALIDATOR'))
  70.                                     or ( step.manager == constant('\\App\\Enum\\Manager::CLIENT_EXTERNAL'))   and user_can_validate_step(step,app.user) 
  71.                                     or (step.manager == constant('\\App\\Enum\\Manager::JOB') and is_granted('ROLE_SUBCONTRACTOR')  and user_get_mission_job(app.user, mission) == step.job) %}
  72.                                 {% set displayReturnBtn = false %}
  73.                                 {% for action in step.actions %}
  74.                                     {% for trigger in action.triggers %}
  75.                                         {% if trigger.triggerType == constant('\\App\\Enum\\Trigger::REFUSAL') %}
  76.                                             {% set displayReturnBtn = true %}
  77.                                         {% endif %}
  78.                                     {% endfor %}
  79.                                 {% endfor %}
  80.                                 <div>
  81.                                     <button type="button" class="btn btn-primary-custom btn-validate-step " data-type="validation" data-stepid="{{step.id}}" data-mission={{mission.id}} {{stimulus_action('planning--index','validateStep')}} style=" width: 100%;background-color:var(--my-flow-pink) !important; padding: 0 10px;text-align: center; font-weight:600;letter-spacing: 1px;color: #fff !important;">
  82.                                         Terminer l’étape
  83.                                         {# <svg style="height: 18px; width: 18px; fill:white;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"/></svg> #}
  84.                                     </button>
  85.                                     <div class="att">
  86.                                         <svg width="26" height="26" viewbox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
  87.                                             <g clip-path="url(#clip0_2236_4012)">
  88.                                                 <path d="M13 22.75C18.3848 22.75 22.75 18.3848 22.75 13C22.75 7.61522 18.3848 3.25 13 3.25C7.61522 3.25 3.25 7.61522 3.25 13C3.25 18.3848 7.61522 22.75 13 22.75Z" stroke="#EA5D0C" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
  89.                                                 <path d="M13 13.8125V8.125" stroke="#EA5D0C" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
  90.                                                 <path d="M13 18.4844C13.5609 18.4844 14.0156 18.0297 14.0156 17.4688C14.0156 16.9078 13.5609 16.4531 13 16.4531C12.4391 16.4531 11.9844 16.9078 11.9844 17.4688C11.9844 18.0297 12.4391 18.4844 13 18.4844Z" fill="#EA5D0C"/>
  91.                                             </g>
  92.                                             <defs>
  93.                                                 <clipPath id="clip0_2236_4012">
  94.                                                     <rect width="26" height="26" fill="white"/>
  95.                                                 </clipPath>
  96.                                             </defs>
  97.                                         </svg>
  98.                                         <span class="prent">
  99.                                             Veuillez valider l’étape en cours<br>lorsque vous aurez terminé.
  100.                                         </span>
  101.                                     </div>
  102.                                     {% if id_step != number_of_all_steps %}
  103.                                         <svg width="32" height="32" class="mb-5" viewbox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
  104.                                             <g class="nexts" clip-path="url(#clip0_1_10344)">
  105.                                                 <path d="M16 28C22.6274 28 28 22.6274 28 16C28 9.37258 22.6274 4 16 4C9.37258 4 4 9.37258 4 16C4 22.6274 9.37258 28 16 28Z" stroke="var(--my-flow-pink) " stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
  106.                                                 <path class="nexts" d="M12 17L16 21L20 17" stroke="var(--my-flow-pink) " stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
  107.                                                 <path class="nexts" d="M16 11V21" stroke="var(--my-flow-pink) " stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
  108.                                             </g>
  109.                                             <defs>
  110.                                                 <clipPath id="clip0_1_10344">
  111.                                                     <rect width="32" height="32" fill="white"/>
  112.                                                 </clipPath>
  113.                                             </defs>
  114.                                         </svg>
  115.                                     {% endif %}
  116.                                 </div>
  117.                             {% endif %}
  118.                             {% set display = false %}
  119.                             {% for action in step.actions %}
  120.                                 {% for trigger in action.triggers %}
  121.                                     {% if trigger.triggerType == constant('\\App\\Enum\\Trigger::RELAUNCH_CLIENT') %}
  122.                                         {% set display = true %}
  123.                                     {% endif %}
  124.                                 {% endfor %}
  125.                             {% endfor %}
  126.                             {% if
  127.                                                 display and
  128.                                                 (is_granted('ROLE_ADMIN')
  129.                                                 or (
  130.                                                 step.manager == constant('\\App\\Enum\\Manager::CLIENT')
  131.                                                 and is_granted('ROLE_SUBCONTRACTOR')
  132.                                                 ))
  133.                                             %}
  134.                                 <br>
  135.                                 <button type="button" class="btn btn-red-custom-warning mt-3 " data-href="{{ path('workflow_relaunch_step', {'step': step.id, 'workflow': step.workflow.id}) }}" {{stimulus_action('planning--index','relaunchSubcontractor')}}>
  136.                                     <i class="fa fa-repeat text-white"></i>
  137.                                     Relancer
  138.                                 </button>
  139.                             {% endif %}
  140.                         {% endif %}
  141.                         {# and step.endDate is not null #}
  142.                         {% if loop.last and step.active == true  and (  is_granted('ROLE_ADMIN')  or is_granted('ROLE_VALIDATOR') ) and mission.state == 'in_progress' and step.isLast == true %}
  143.                             <button type="button" class="btn btn-red-custom-warning mt-3" data-type="closed" data-stepid="{{step.id}}" data-mission={{mission.id}} {{stimulus_action('planning--index','closeStep')}}>
  144.                                 <i class="fa fa-archive text-white"></i>
  145.                                 Cloturer
  146.                             </button>
  147.                         {% endif %}
  148.                     </div>
  149.                 </div>
  150.             </div>
  151.             {% if loop.index < 10 %}
  152.                 {% set id_step = loop.index  %}
  153.             {% else %}
  154.                 {% set id_step =  id_step - 1 %}
  155.             {% endif %}
  156.         {% endfor %}
  157.     {% endif %}
  158. </div>
  159. {% if mission.state == 'in_progress' and mission.canStart['state'] == false %}
  160.     <div class="overlay-layer bg-dark bg-opacity-25 overlay-custom">
  161.         <div class="bg-white rounded pt-5 pb-5 btn-none" style="padding: 12px;margin:10px">
  162.             Cette mission ne peut pas démarrer avant que la/les mission(s)
  163.             <strong>{{ mission.canStart['ListOfMissions'] }}</strong>
  164.             ne soit/soient clôturée(s) ou finie(s).
  165.         </div>
  166.     </div>
  167. {% endif %}
  168. {% if campaign.state != "in_progress" or (mission.state == 'archived' or mission.state == 'validated' or mission.state == 'provisional' or mission.state == 'finalized') %}
  169.     <div class="overlay-wrapper">
  170.         <img src="assets/media/stock/600x400/img-1.jpg" alt="" class="w-100 rounded"/>
  171.     </div>
  172.     {% if mission.state == 'archived' or mission.state == "cancelled" and mission.state == "finalized" %}
  173.         <div class="overlay-layer bg-dark bg-opacity-25">
  174.             <a href="{{ path('mission_index') }}" class="btn btn-primary-custom btn-shadow">Retourner à la liste des missions</a>
  175.         </div>
  176.     {% else %}
  177.         <div class="overlay-layer bg-dark bg-opacity-25 overlay-custom">
  178.             <div class="bg-white rounded pt-5 pb-5 btn-none">
  179.                 <a href="{{ path('mission_index') }}" class="btn btn-shadow">
  180.                     {% if mission.state == "closed" %}
  181.                         Mission cloturée
  182.                     {% else %}
  183.                         {% if mission.state == "finalized" %}
  184.                             Mission archivée
  185.                         {% elseif mission.state == "deleted" %}
  186.                             Mission supprimée
  187.                         {% else %}
  188.                             La mission n'est pas encore validée, le planning sera disponible dès sa validation
  189.                         {% endif %}
  190.                     {% endif %}
  191.                     {# order mission in traitement #}
  192.                 </a>
  193.             </div>
  194.         </div>
  195.     {% endif %}
  196. {% endif %}
  197. {# archivé cloturé #}