{% extends 'base.html.twig' %} {% block body %} {{ form_start(form) }}

{% if mode=="update" %} Modification SCRUM {% elseif mode=="submit" %} Création SCRUM {% endif %}

{{ form_widget(form.submit) }} Annuler {% if mode=="update" %} Supprimer {% endif %}

{% if app.session.flashbag.has('error') %}
Erreur
{% for flashMessage in app.session.flashbag.get('error') %} {{ flashMessage }}
{% endfor %}
{% endif %} {% if app.session.flashbag.has('notice') %}
Information
{% for flashMessage in app.session.flashbag.get('notice') %} {{ flashMessage }}
{% endfor %}
{% endif %}
Informations
{{ form_row(form.category) }} {{ form_row(form.name) }} {{ form_row(form.giteaid) }} {{ form_row(form.users) }}
{% if mode=="update" %}
Sprints
{% endif %}
{% if mode=="update" %}
Equipes
Types
Priorités
Colonnes
{% endif %}
{{ form_end(form) }} {% endblock %} {% block localjavascript %} $(document).ready(function() { $("#scrum_giteaid").select2(); $("#scrum_name").focus(); {% if mode=="update" %} loadscrumcolumns(); loadscrumteams(); loadscrumprioritys(); loadscrumtypes(); loadscrumsprints(); {%endif%} }); {% if mode=="update" %} $("#addcolumn").click(function() { ModalLoad('mymodalcolumn','Ajouter une colonne','{{path('app_scrumcolumn_submit',{scrumid:scrum.id})}}'); }); $('#scrumcolumns').on('click', '.modcolumn', function(event) { url="{{path('app_scrumcolumn_update',{id:'xxx'})}}"; url=url.replace("xxx",$(this).data("id")); ModalLoad('mymodalcolumn','Modifier une colonne',url); }); $('#mymodalcolumn').on('hidden.bs.modal', function () { loadscrumcolumns(); }); function loadscrumcolumns() { $("#scrumcolumns").empty(); $.ajax({ method: "POST", url: "{{path("app_scrumcolumn_select",{scrumid:scrum.id})}}", success: function(datas, dataType) { jQuery.each(datas, function(i, wid) { html ='
  • '; html+='
    '; html+='
    '; html+='
    '; html+=wid.name; html+='
    '; html+='
    '; html+=''; html+='
  • '; $("#scrumcolumns").append(html); }); $( "#scrumcolumns" ).sortable({ axis: "y", handle: ".fa-arrows-alt-v", update: function( event, ui ) { lstordered=""; $( "#scrumcolumns li" ).each(function( index ) { if(index==0) lstordered=$(this).data("id"); else lstordered=lstordered+","+$(this).data("id"); }); $.ajax({ method: "POST", url: "{{path("app_scrumcolumn_order",{scrumid:scrum.id})}}", data: { lstordered:lstordered } }); } }); }, }); } $("#addteam").click(function() { ModalLoad('mymodalteam','Ajouter une colonne','{{path('app_scrumteam_submit',{scrumid:scrum.id})}}'); }); $('#scrumteams').on('click', '.modteam', function(event) { url="{{path('app_scrumteam_update',{id:'xxx'})}}"; url=url.replace("xxx",$(this).data("id")); ModalLoad('mymodalteam','Modifier une team',url); }); $('#mymodalteam').on('hidden.bs.modal', function () { loadscrumteams(); }); function loadscrumteams() { $("#scrumteams").empty(); $.ajax({ method: "POST", url: "{{path("app_scrumteam_select",{scrumid:scrum.id})}}", success: function(datas, dataType) { jQuery.each(datas, function(i, wid) { html ='
  • '; html+='
    '; html+='
    '; html+='
    '; html+=wid.name; html+='
    '; html+='
    '; html+=''; html+='
  • '; $("#scrumteams").append(html); }); $( "#scrumteams" ).sortable({ axis: "y", handle: ".fa-arrows-alt-v", update: function( event, ui ) { lstordered=""; $( "#scrumteams li" ).each(function( index ) { if(index==0) lstordered=$(this).data("id"); else lstordered=lstordered+","+$(this).data("id"); }); $.ajax({ method: "POST", url: "{{path("app_scrumteam_order",{scrumid:scrum.id})}}", data: { lstordered:lstordered } }); } }); }, }); } $("#addpriority").click(function() { ModalLoad('mymodalpriority','Ajouter une colonne','{{path('app_scrumpriority_submit',{scrumid:scrum.id})}}'); }); $('#scrumprioritys').on('click', '.modpriority', function(event) { url="{{path('app_scrumpriority_update',{id:'xxx'})}}"; url=url.replace("xxx",$(this).data("id")); ModalLoad('mymodalpriority','Modifier une priority',url); }); $('#mymodalpriority').on('hidden.bs.modal', function () { loadscrumprioritys(); }); function loadscrumprioritys() { $("#scrumprioritys").empty(); $.ajax({ method: "POST", url: "{{path("app_scrumpriority_select",{scrumid:scrum.id})}}", success: function(datas, dataType) { jQuery.each(datas, function(i, wid) { html ='
  • '; html+='
    '; html+='
    '; html+='
    '; html+=wid.name; html+='
    '; html+='
    '; html+=''; html+='
  • '; $("#scrumprioritys").append(html); }); $( "#scrumprioritys" ).sortable({ axis: "y", handle: ".fa-arrows-alt-v", update: function( event, ui ) { lstordered=""; $( "#scrumprioritys li" ).each(function( index ) { if(index==0) lstordered=$(this).data("id"); else lstordered=lstordered+","+$(this).data("id"); }); $.ajax({ method: "POST", url: "{{path("app_scrumpriority_order",{scrumid:scrum.id})}}", data: { lstordered:lstordered } }); } }); }, }); } $("#addsprint").click(function() { ModalLoad('mymodalsprint','Ajouter un sprint','{{path('app_scrumsprint_submit',{scrumid:scrum.id})}}'); }); $('#scrumsprints').on('click', '.modsprint', function(event) { url="{{path('app_scrumsprint_update',{id:'xxx'})}}"; url=url.replace("xxx",$(this).data("id")); ModalLoad('mymodalsprint','Modifier un sprint',url); }); $('#mymodalsprint').on('hidden.bs.modal', function () { loadscrumsprints(); }); $('#viewsprintclosed').change(function() { if(this.checked) { $(".sprintclosed").removeClass("hidden"); } else { $(".sprintclosed").addClass("hidden"); } }); function loadscrumsprints() { $("#scrumsprints").empty(); $.ajax({ method: "POST", url: "{{path("app_scrumsprint_select",{scrumid:scrum.id})}}", success: function(datas, dataType) { jQuery.each(datas, function(i, wid) { style=''; classname=''; if(wid.closed) { style='background-color:#cdcdcd;'; classname='sprintclosed'; if(!$("#viewsprintclosed").is(':checked')) { classname+=' hidden'; } } html ='
  • '; html+='
    '; html+='
    '; html+='
    '; html+=wid.name; html+='
    '; html+='
    '; html+=''; html+='
  • '; $("#scrumsprints").append(html); }); $( "#scrumsprints" ).sortable({ axis: "y", handle: ".fa-arrows-alt-v", update: function( event, ui ) { lstordered=""; $( "#scrumsprints li" ).each(function( index ) { if(index==0) lstordered=$(this).data("id"); else lstordered=lstordered+","+$(this).data("id"); }); $.ajax({ method: "POST", url: "{{path("app_scrumsprint_order",{scrumid:scrum.id})}}", data: { lstordered:lstordered } }); } }); }, }); } $("#addtype").click(function() { ModalLoad('mymodaltype','Ajouter une colonne','{{path('app_scrumtype_submit',{scrumid:scrum.id})}}'); }); $('#scrumtypes').on('click', '.modtype', function(event) { url="{{path('app_scrumtype_update',{id:'xxx'})}}"; url=url.replace("xxx",$(this).data("id")); ModalLoad('mymodaltype','Modifier un type',url); }); $('#mymodaltype').on('hidden.bs.modal', function () { loadscrumtypes(); }); function loadscrumtypes() { $("#scrumtypes").empty(); $.ajax({ method: "POST", url: "{{path("app_scrumtype_select",{scrumid:scrum.id})}}", success: function(datas, dataType) { jQuery.each(datas, function(i, wid) { html ='
  • '; html+='
    '; html+='
    '; html+='
    '; html+=wid.name; html+='
    '; html+='
    '; html+=''; html+='
  • '; $("#scrumtypes").append(html); }); $( "#scrumtypes" ).sortable({ axis: "y", handle: ".fa-arrows-alt-v", update: function( event, ui ) { lstordered=""; $( "#scrumtypes li" ).each(function( index ) { if(index==0) lstordered=$(this).data("id"); else lstordered=lstordered+","+$(this).data("id"); }); $.ajax({ method: "POST", url: "{{path("app_scrumtype_order",{scrumid:scrum.id})}}", data: { lstordered:lstordered } }); } }); }, }); } {% endif %} {% endblock %}