]> git.agnieray.net Git - galette.git/commitdiff
Move modals templates in the right folder
authorGuillaume AGNIERAY <dev@agnieray.net>
Wed, 16 Feb 2022 21:26:35 +0000 (22:26 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Wed, 8 Jun 2022 05:51:21 +0000 (07:51 +0200)
And rework some jQueryUI dialogs with SUI modals (WIP)

29 files changed:
galette/lib/Galette/Controllers/Crud/ContributionsController.php
galette/lib/Galette/Controllers/Crud/DynamicFieldsController.php
galette/lib/Galette/Controllers/CrudController.php
galette/lib/Galette/Controllers/CsvController.php
galette/lib/Galette/Controllers/HistoryController.php
galette/lib/Galette/Controllers/PdfController.php
galette/lib/Galette/Controllers/PluginsController.php
galette/templates/gtwig/elements/contributions_mass_add.html.twig [deleted file]
galette/templates/gtwig/elements/contributions_mass_choose_type.html.twig [deleted file]
galette/templates/gtwig/elements/edit_pdf_models.html.twig
galette/templates/gtwig/elements/replacements_legend.html.twig [deleted file]
galette/templates/gtwig/modals/configuration_dynamic_field_form.html.twig [new file with mode: 0644]
galette/templates/gtwig/modals/confirm_removal.html.twig [new file with mode: 0644]
galette/templates/gtwig/modals/contribution_form.html.twig [new file with mode: 0644]
galette/templates/gtwig/modals/mass_add_contributions.html.twig [new file with mode: 0644]
galette/templates/gtwig/modals/mass_choose_contributions_type.html.twig [new file with mode: 0644]
galette/templates/gtwig/modals/members_attendance_sheet.html.twig [new file with mode: 0644]
galette/templates/gtwig/modals/plugin_initdb.html.twig [new file with mode: 0644]
galette/templates/gtwig/modals/replacements_legend.html.twig [new file with mode: 0644]
galette/templates/gtwig/modals/telemetry.html.twig
galette/templates/gtwig/pages/configuration_dynamic_field_form.html.twig [deleted file]
galette/templates/gtwig/pages/configuration_texts.html.twig
galette/templates/gtwig/pages/confirm_removal.html.twig [deleted file]
galette/templates/gtwig/pages/contribution_form.html.twig [deleted file]
galette/templates/gtwig/pages/contributions_list.html.twig
galette/templates/gtwig/pages/members_attendance_sheet.html.twig [deleted file]
galette/templates/gtwig/pages/plugin_initdb.html.twig [deleted file]
galette/templates/gtwig/pages/plugins.html.twig
galette/templates/gtwig/pages/preferences.html.twig

index d74b2575951b920ea40b5939954f573e197e933c..1f5d3e36cac53cb3c341fafb319931ad9993cf0e 100644 (file)
@@ -152,7 +152,7 @@ class ContributionsController extends CrudController
         // display page
         $this->view->render(
             $response,
-            'pages/contribution_form.html.twig',
+            'modals/contribution_form.html.twig',
             $params
         );
         return $response;
@@ -241,7 +241,7 @@ class ContributionsController extends CrudController
         // display page
         $this->view->render(
             $response,
-            'elements/contributions_mass_choose_type.html.twig',
+            'modals/mass_choose_contributions_type.html.twig',
             array(
                 'mode'          => $request->isXhr() ? 'ajax' : '',
                 'page_title'    => str_replace(
@@ -285,7 +285,7 @@ class ContributionsController extends CrudController
         // display page
         $this->view->render(
             $response,
-            'elements/contributions_mass_add.html.twig',
+            'modals/mass_add_contributions.html.twig',
             array(
                 'mode'          => $request->isXhr() ? 'ajax' : '',
                 'page_title'    => str_replace(
index 2808e92a52b51b15219cb6373ff7ea040b4b99c6..d6e7438954eda30ab5c23e78e760e0de41c3377f 100644 (file)
@@ -89,7 +89,7 @@ class DynamicFieldsController extends CrudController
         // display page
         $this->view->render(
             $response,
-            'pages/configuration_dynamic_field_form.html.twig',
+            'modals/configuration_dynamic_field_form.html.twig',
             $params
         );
         return $response;
index 9be84d12e3828c00052a89119ba906c53c30bbe1..b2328b494660901d21f6f6cda3f27df30155d770 100644 (file)
@@ -144,7 +144,7 @@ abstract class CrudController extends AbstractController
         // display page
         $this->view->render(
             $response,
-            'pages/confirm_removal.html.twig',
+            'modals/confirm_removal.html.twig',
             $this->getconfirmDeleteParams($request)
         );
         return $response;
index 97e559c95e97e3dcaa0976ba6a6f0bddf34c64bf..5d91e4d4bf252be204f898cc088b208b173b1773 100644 (file)
@@ -453,7 +453,7 @@ class CsvController extends AbstractController
         // display page
         $this->view->render(
             $response,
-            'pages/confirm_removal.html.twig',
+            'modals/confirm_removal.html.twig',
             array(
                 'mode'          => $request->isXhr() ? 'ajax' : '',
                 'page_title'    => sprintf(
index 495f22742583ed908cc397ddaae31ffd18f3dd72..e98ddd9287969464a0f7372e8e5eb45e2078d5db 100644 (file)
@@ -264,7 +264,7 @@ class HistoryController extends AbstractController
         // display page
         $this->view->render(
             $response,
-            'pages/confirm_removal.html.twig',
+            'modals/confirm_removal.html.twig',
             array(
                 'mode'          => $request->isXhr() ? 'ajax' : '',
                 'page_title'    => _T('Flush the logs'),
index 3fffaf085001436af528d3e21d091c2d2cf5448e..8fd425622a5321a84d9c56ca76f0ea2b3fccfc91 100644 (file)
@@ -337,7 +337,7 @@ class PdfController extends AbstractController
         // display page
         $this->view->render(
             $response,
-            'pages/members_attendance_sheet.html.twig',
+            'modals/members_attendance_sheet.html.twig',
             [
                 'page_title'    => _T("Attendance sheet configuration"),
                 'ajax'          => $ajax,
index 94b26e221c684905f2ee6ba3f350e583eab297ac..d3a00633ebc263cb2af92dbcd572600f6d0000d8 100644 (file)
@@ -357,7 +357,7 @@ class PluginsController extends AbstractController
         // display page
         $this->view->render(
             $response,
-            'pages/plugin_initdb.html.twig',
+            'modals/plugin_initdb.html.twig',
             $params
         );
         return $response;
diff --git a/galette/templates/gtwig/elements/contributions_mass_add.html.twig b/galette/templates/gtwig/elements/contributions_mass_add.html.twig
deleted file mode 100644 (file)
index aa2df5d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-{% extends 'pages/contribution_form.html.twig' %}
-
-{% block content %}
-    <div id="mass_contributions"{% if mode != 'ajax' %} class="center"{% else %} title="{{ page_title }}"{% endif %}>
-    <form action="{{ form_url }}" method="post">
-        {% if mode != 'ajax' %}<h2>{{ page_title }}</h2>{% endif %}
-        <div class="button-container">
-            {{ parent() }}
-            <input type="submit" id="masschange" class="button" value="{% if changes is not defined %}{{ _T("Edit") }}{% else %}{{ _T("OK") }}{% endif %}"/>
-            <a href="{{ cancel_uri }}" class="button" id="btncancel">{{ _T("Cancel") }}</a>
-            <input type="hidden" name="confirm" value="1"/>
-            {% if mode == 'ajax' %}<input type="hidden" name="ajax" value="true"/>{% endif %}
-            {% for key, value in data %}
-                {% if value is iterable %}
-                    {% for val in value %}
-                <input type="hidden" name="{{ key }}[]" value="{{ val }}"/>
-                    {% endfor %}
-                {% else %}
-                <input type="hidden" name="{{ key }}" value="{{ value }}"/>
-                {% endif %}
-            {% endfor %}
-            {% include "components/forms/csrf.html.twig" %}
-        </div>
-    </form>
-    </div>
-{% endblock %}
diff --git a/galette/templates/gtwig/elements/contributions_mass_choose_type.html.twig b/galette/templates/gtwig/elements/contributions_mass_choose_type.html.twig
deleted file mode 100644 (file)
index 3a62d40..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-{% extends (mode == 'ajax') ? "ajax.html.twig" : "page.html.twig" %}
-
-{% block content %}
-    <div id="mass_contributions"{% if mode != 'ajax' %} class="center"{% else %} title="{{ page_title }}"{% endif %}>
-    <form action="{{ form_url }}" method="post">
-        {% if mode != 'ajax' %}<h2>{{ page_title }}</h2>{% endif %}
-        <label for="type">{{ _T("Contribution type") }}</label>
-        <select name="type" id="type">
-            <option value="{{ constant('Galette\\Entity\\Contribution::TYPE_FEE') }}">{{ _T("Membership") }}</option>
-            <option value="{{ constant('Galette\\Entity\\Contribution::TYPE_DONATION') }}">{{ _T("Donation") }}</option>
-        </select>
-        <div class="button-container">
-            <input type="submit" id="masschange" class="button" value="{{ _T("OK") }}"/>
-            <a href="{{ cancel_uri }}" class="button" id="btncancel">{{ _T("Cancel") }}</a>
-            {% if mode == 'ajax' %}<input type="hidden" name="ajax" value="true"/>{% endif %}
-            {% for key, value in data %}
-                {% if value is iterable %}
-                    {% for val in value %}
-                <input type="hidden" name="{{ key }}[]" value="{{ val }}"/>
-                    {% endfor %}
-                {% else %}
-                <input type="hidden" name="{{ key }}" value="{{ value }}"/>
-                {% endif %}
-            {% endfor %}
-            {% include "components/forms/csrf.html.twig" %}
-        </div>
-    </form>
-    </div>
-{% endblock %}
index cadea87efef164aea7cb2416510cc3fbaec61b3b..369b6f6065e9c985fbb3f1f7b3eb09b836e2b53e 100644 (file)
@@ -52,4 +52,4 @@
                 {% include 'components/forms/csrf.html.twig' %}
             </div>
         </form>
-        {% include 'elements/replacements_legend.html.twig' with { 'legends': model.getLegend(), 'cur_ref': model.id } %}
+        {% include 'modals/replacements_legend.html.twig' with { 'legends': model.getLegend(), 'cur_ref': model.id } %}
diff --git a/galette/templates/gtwig/elements/replacements_legend.html.twig b/galette/templates/gtwig/elements/replacements_legend.html.twig
deleted file mode 100644 (file)
index 36d184c..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-<div id="legende{{ cur_ref }}" class="texts_legend ui modal" title="{{ _T("Existing variables") }}">
-    <div class="header">{{ _T('Existing variables') }}</div>
-    <div class="content">
-        <table class="ui very basic table">
-    {% for legend in legends %}
-        <tr>
-            <th colspan="4">
-                {{ legend.title }}
-            </th>
-        </tr>
-        {% for pattern in legend.patterns %}
-            {% if loop.index0 % 2 == 0 %}
-                <tr>
-            {% endif %}
-            <th><tt>{{ pattern.pattern|trim('/') }}</tt></th>
-            <td class="back">
-                {% if pattern.title is defined %}{{ pattern.title }}{% endif %}
-            </td>
-            {% if loop.index0 % 2 != 0 %}
-                </tr>
-            {% endif %}
-        {% endfor %}
-    {% endfor %}
-        </table>
-    </div>
-    <div class="actions"><div class="ui labeled icon deny button"><i class="times icon"></i> {{ _T('Close') }}</div></div>
-</div>
-<script type="text/javascript">
-
-    var _addLegenButton = function(selector) {
-        $(selector).append('<a id="btnlegend" class="ui tooltip" data-html="{{ _T("Show existing variables")|e('js') }}"><i class="circular inverted primary link icon info"></i> <span class="sr-only">{{ _T("Show existing variables")|e('js') }}</span></a>');
-    };
-
-    var _handleLegend = function(selector) {
-        if (typeof selector == 'undefined') {
-            selector = '{{ cur_ref }}';
-        }
-        $('#legende' + selector + ' h1').remove();
-        $('#legende' + selector).dialog({
-            autoOpen: false,
-            modal: true,
-            hide: 'fold',
-            width: '60em',
-            create: function (event, ui) {
-                if ($(window ).width() < 767) {
-                    $(this).dialog('option', {
-                        'width': '95%',
-                        'draggable': false
-                    });
-                }
-            }
-        }).dialog('close');
-
-        $('#btnlegend').unbind('click').click(function(){
-            $('#legende' + selector).dialog('open');
-            return false;
-        });
-    };
-</script>
diff --git a/galette/templates/gtwig/modals/configuration_dynamic_field_form.html.twig b/galette/templates/gtwig/modals/configuration_dynamic_field_form.html.twig
new file mode 100644 (file)
index 0000000..35100fe
--- /dev/null
@@ -0,0 +1,165 @@
+{% extends (mode == 'ajax') ? "ajax.html.twig" : "page.html.twig" %}
+
+{% block content %}
+{% if action == 'edit' %}
+    <form action="{{ path_for('doEditDynamicField', { 'form_name': form_name, 'id': df.getId() }) }}" method="post" class="ui form">
+        <div class="ui top attached header">
+            {{ _T("Edit field %field")|replace({ '%field': df.getName() }) }}
+        </div>
+        <div class="ui bottom attached segment">
+            <div class="active content field">
+                <div class="inline field">
+                    <label for="field_name">{{ _T("Name:") }}</label>
+                    <input type="text" name="field_name" id="field_name" value="{{ df.getName(false) }}"{if not $df|is_a:'Galette\DynamicFields\Separator'} required="required"{/if}/>
+                </div>
+                <div class="inline field">
+                    <label for="field_perm">{{ _T("Permissions:") }}</label>
+                    <select name="field_perm" id="field_perm" class="ui dropdown nochosen">
+                        {% for key, value in perm_names %}
+                            <option value="{{ key }}"{% if key == df.getPerm() %} selected="selected"{% endif %}>{{ value }}</option>
+                        {% endfor %}
+                    </select>
+                </div>
+    {% if df.hasData() %}
+                <div class="inline field">
+                    <label for="field_required">{{ _T("Required:") }}</label>
+                    <select name="field_required" id="field_required" class="ui dropdown nochosen">
+                        <option value="0" {% if not df.isRequired() %}selected="selected"{% endif %}>{{ _T("No") }}</option>
+                        <option value="1" {% if df.isRequired() %}selected="selected"{% endif %}>{{ _T("Yes") }}</option>
+                    </select>
+                </div>
+    {% endif %}
+    {% if df.hasWidth() %}
+                <div class="inline field">
+                    <label for="field_width">{{ _T("Width:") }}</label>
+                    <input type="text" name="field_width" id="field_width" value="{{ df.getWidth() }}" size="3"/>
+                </div>
+    {% endif %}
+    {% if df.hasHeight() %}
+                <div class="inline field">
+                    <label for="field_height">{{ _T("Height:") }}</label>
+                    <input type="text" name="field_height" id="field_height" value="{{ df.getHeight() }}" size="3"/>
+                </div>
+    {% endif %}
+    {% if df.hasSize() %}
+                <div class="inline field">
+                    <label for="field_size">{{ _T("Size:") }}</label>
+                    <input type="text" name="field_size" id="field_size" value="{{ df.getSize() }}" size="3"/>
+        {if $df|is_a:'Galette\DynamicFields\File'}
+                    <span class="exemple">{{ _T("Maximum file size, in Ko.") }}</span>
+        {else}
+                    <span class="exemple">{{ _T("Maximum number of characters.") }}</span>
+        {/if}
+                </div>
+    {% endif %}
+    {% if df.isMultiValued() %}
+                <div class="inline field">
+                    <label for="field_repeat">{{ _T("Repeat:") }}</label>
+                    <input type="text" name="field_repeat" id="field_repeat" value="{{ df.getRepeat() }}" size="3"/>
+                    <span class="exemple">{{ _T("Number of values or zero if infinite.") }}</span>
+                </div>
+    {% endif %}
+    {% if df.hasFixedValues() %}
+                <div class="inline field">
+                    <label for="fixed_values">{{ _T("Values:") }}</label>
+                    <textarea name="fixed_values" id="fixed_values" cols="20" rows="6">{{ df.getValues(true) }}</textarea>
+                    <br/><span class="exemple">{{ _T("Choice list (one entry per line).") }}</span>
+                </div>
+    {% endif %}
+                <div class="field">
+                    <label for="field_information">{{ _T("Information:") }}</label>
+                    <textarea name="field_information" id="field_information" cols="20" rows="6">{{ df.getInformation() }}</textarea>
+                    <span class="tip">{{ _T("Extra information displayed along with dynamic field.") }}</span>
+                </div>
+            </div>
+        </div>
+
+        <div class="ui basic center aligned segment">
+            <button type="submit" class="ui labeled icon primary button action">
+                <i class="save icon"></i> {{ _T("Save") }}
+            </button>
+            {% include "components/forms/csrf.html.twig" %}
+        </div>
+     </form>
+{% elseif action == 'add' %}
+    <form action="{{ path_for('doAddDynamicField', { 'form_name': form_name }) }}" method="post" enctype="multipart/form-data" title="{{ _T("New dynamic field") }}" class="ui form">
+    {% if mode != 'ajax' %}
+        <div class="ui top attached header">
+            {{ _T("New dynamic field") }}
+        </div>
+        <div class="ui bottom attached segment">
+            <div class="active content field">
+    {% else %}
+        <div class="cssform">
+    {% endif %}
+                <div class="inline field">
+                    <label for="field_name">{{ _T("Field name") }}</label>
+                    <input size="40" type="text" name="field_name" id="field_name" value="{% if df is defined %}{{ df.getName() }}{% endif %}"/>
+                </div>
+                <div class="inline field">
+                    <label for="field_perm">{{ _T("Visibility") }}</label>
+                    <select name="field_perm" id="field_perm" class="ui dropdown nochosen">
+                        {% set perm = 0 %}
+                        {% if df is defined %}
+                            {% set perm = df.getPerm() %}
+                        {% endif %}
+                        {% for key, value in perm_names %}
+                            <option value="{{ key }}"{% if key == perm %} selected="selected"{% endif %}>{{ value }}</option>
+                        {% endfor %}
+                    </select>
+                </div>
+                <div class="inline field">
+                    <label for="field_type">{{ _T("Type") }}</label>
+                    <select name="field_type" id="field_type" class="ui dropdown nochosen">
+                        {% set type = 0 %}
+                        {% if df is defined %}
+                            {% set type = df.getType() %}
+                        {% endif %}
+                        {html_options options=$field_type_names selected=$type}
+                        {% for key, value in field_type_names %}
+                            <option value="{{ key }}"{% if key == type %} selected="selected"{% endif %}>{{ value }}</option>
+                        {% endfor %}
+                    </select>
+                </div>
+                <div class="inline field">
+                    <label for="field_required">{{ _T("Required") }}</label>
+                    <select name="field_required" id="field_required" class="ui dropdown nochosen">
+                        <option value="0"{% if df is not defined or not df.isRequired() %} selected="selected"{% endif %}>{{ _T("No") }}</option>
+                        <option value="1"{% if df is defined and df.isRequired() %} selected="selected"{% endif %}>{{ _T("Yes") }}</option>
+                    </select>
+                    {% include "components/forms/csrf.html.twig" %}
+                </div>
+    {% if mode != 'ajax' %}
+            </div>
+    {% endif %}
+        </div>
+        <div class="ui basic center aligned segment">
+            <button type="submit" name="valid" class="ui labeled icon primary button action">
+                <i class="plus icon"></i> {{ _T("Add") }}
+            </button>
+            <input type="hidden" name="form_name" id="form_name" value="{{ form_name }}"/>
+        </div>
+    </form>
+{% endif %}
+{% endblock %}
+
+{% block javascripts %}
+    <script>
+        $('#field_information').summernote({
+            lang: '{{ i18n.getID()|replace({ '_': '-'}) }}',
+            height: 240,
+            toolbar: [
+                ['style', ['style']],
+                ['font', ['bold', 'italic', 'strikethrough', 'clear']],
+                ['para', ['ul', 'ol', 'paragraph']],
+                ['insert', ['link', 'picture']],
+                ['view', ['codeview', 'help']]
+            ],
+            styleTags: [
+                'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'
+            ]
+        });
+        $('#field_information').summernote('focus');
+
+    </script>
+{% endblock %}
diff --git a/galette/templates/gtwig/modals/confirm_removal.html.twig b/galette/templates/gtwig/modals/confirm_removal.html.twig
new file mode 100644 (file)
index 0000000..de8325a
--- /dev/null
@@ -0,0 +1,63 @@
+{% extends (mode == 'ajax') ? "ajax.html.twig" : "page.html.twig" %}
+
+{% block content %}
+    <div id="confirm_removal"{% if mode == 'ajax' %} class="center"{% else %} title="{{ page_title }}"{% endif %}>
+    <form action="{{ form_url }}" method="post">
+    {% if mode != 'ajax' %}
+        <div class="ui segment">
+            <div class="content">
+        {% if with_cascade is defined %}
+                <div class="field inline">
+        {% endif %}
+    {% endif %}
+    {% if with_cascade is defined %}
+                    <label for="cascade">{{ _T("Cascade delete") }}</label>
+                    <input type="checkbox" name="cascade" id="cascade" value="true" title="{{ _T("Delete all associated data") }}"/>
+    {% endif %}
+    {% if mode != 'ajax' %}
+        {% if with_cascade is defined %}
+                </div>
+        {% endif %}
+        {% if message is defined %}
+                <div class="ui warning message">
+        {% endif %}
+    {% endif %}
+    {% if message is defined %}
+                    <p>{{ message }}</p>
+    {% endif %}
+    {% if mode != 'ajax' %}
+        {% if message is defined %}
+                </div>
+        {% endif %}
+                <div class="ui red message">
+    {% endif %}
+                    <p>{{ _T("Are you sure you want to proceed?") }}<br/>{{ _T("This can't be undone.") }}</p>
+    {% if mode != 'ajax' %}
+                </div>
+            </div>
+        </div>
+        <div class="ui basic center aligned segment">
+    {% else %}
+        <div class="button-container">
+    {% endif %}
+            <input type="submit" id="delete" value="{{ _T("Remove") }}"{% if mode != 'ajax' %} class="ui primary button action"{% endif %}/>
+            <a href="{{ cancel_uri }}" class="{% if mode != 'ajax' %}ui {% endif %}button" id="btncancel">{{ _T("Cancel") }}</a>
+            <input type="hidden" name="confirm" value="1"/>
+            {% if mode == 'ajax' %}<input type="hidden" name="ajax" value="true"/>{% endif %}
+            {% for key, value in data %}
+                {% if value is iterable %}
+                    {% for val in value %}
+                <input type="hidden" name="{{ key }}[]" value="{{ val }}"/>
+                    {% endfor %}
+                {% else %}
+                <input type="hidden" name="{{ key }}" value="{{ value }}"/>
+                {% endif %}
+            {% endfor %}
+            {% include 'components/forms/csrf.html.twig' %}
+        </div>
+    </form>
+    </div>
+{% endblock %}
+
+{% block javascripts %}
+{% endblock %}
diff --git a/galette/templates/gtwig/modals/contribution_form.html.twig b/galette/templates/gtwig/modals/contribution_form.html.twig
new file mode 100644 (file)
index 0000000..5f7bdb0
--- /dev/null
@@ -0,0 +1,293 @@
+{% extends (mode == 'ajax') ? "ajax.html.twig" : "page.html.twig" %}
+
+{% block content %}
+{% if members.list is defined or require_mass %}
+        <form action="{% if contribution.id %}{{ path_for("doEditContribution", { "type": type, "id": contribution.id }) }}{% else %}{{ path_for("doAddContribution", { "type": type }) }}{% endif %}" enctype="multipart/form-data" method="post" class="ui form">
+    {% if contribution.isTransactionPart() %}
+        {assign var="mid" value=$contribution->transaction->member}
+            <div class="ui top attached header">
+                {{ _T("Related transaction information") }}
+            </div>
+            <div class="ui bottom attached segment">
+                <div class="active content field">
+                    <table id="transaction_detail" class="listing ui celled table">
+                        <thead>
+                            <tr>
+                                <th colspan="5">
+                                    {{ contribution.transaction.description }}
+                                    <a
+                                        href="{{ path_for("editTransaction", { "id": contribution.transaction.id }) }}"
+                                        class="ui icon button tooltip"
+                                        title="{{ _T("View transaction") }}"
+                                    >
+                                        <i class="columns icon"><span class="sr-only">{{ _T("View transaction") }}</span></i>
+                                    </a>
+                                </th>
+                            </tr>
+                            <tr>
+                                <th class="listing">#</th>
+                                <th class="listing">{{ _T("Date") }}</th>
+                                <th class="listing">{{ _T("Member") }}</th>
+                                <th class="listing">{{ _T("Amount") }}</th>
+                                <th class="listing">{{ _T("Not dispatched amount") }}</th>
+                            </tr>
+                        </thead>
+                        <tbody>
+                            <tr>
+                                <td>{{ contribution.transaction.id }}</td>
+                                <td>{{ contribution.transaction.date }}</td>
+                                <td>{ memberName id="$mid"}</td>
+                                <td class="right">{{ contribution.transaction.amount }}</td>
+                                <td class="right">{{ contribution.transaction.getMissingAmount() }}</td>
+                            </tr>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+    {% endif %}
+            <div class="ui styled fluid accordion field">
+                <div class="active title">
+                    <i class="icon dropdown"></i>
+    {% if type == constant('Galette\\Entity\\Contribution::TYPE_FEE') %}
+                    {{ _T("Select contributor and membership fee type") }}
+    {% else %}
+                    {{ _T("Select contributor and donation type") }}
+    {% endif %}
+    {% if contribution.isTransactionPart() and contribution.transaction.getMissingAmount() > 0 %}
+                    <a
+                        href="{{ path_for("addContribution", { "type": constant('Galette\\Entity\\Contribution::TYPE_FEE') }) }}?trans_id={{ contribution.transaction.id }}"
+                        class="ui icon button fright tooltip"
+                        title="{{ _T("Create a new fee that will be attached to the current transaction") }}">
+                        <i class="user check icon"></i>
+                        <span class="sr-only">{{ _T("New attached fee") }}</span>
+                    </a>
+                    <a
+                        href="{{ path_for("addContribution", { "type": "donation" }) }}?trans_id={{ contribution.transaction.id }}"
+                        class="ui icon button fright tooltip"
+                        title="{{ _T("Create a new donation that will be attached to the current transaction") }}">
+                        <i class="gift icon"></i>
+                        <span class="sr-only">{{ _T("New attached donation") }}</span>
+                    </a>
+    {% endif %}
+                </div>
+    {% if not require_mass %}
+                <div class="active content field">
+                    <div class="field inline">
+                        <label for="id_adh">{{ _T("Contributor:") }}</label>
+                        <select name="id_adh" id="id_adh" class="nochosen">
+                            {% if adh_selected == 0 %}
+                            <option value="">{{ _T("Search for name or ID and pick member") }}</option>
+                            {% endif %}
+                            {% for k,v in members.list %}
+                                <option value="{{ k }}"{% if contribution.member == k %} selected="selected"{% endif %}>{{ v }}</option>
+                            {% endfor %}
+                        </select>
+                    </div>
+    {% endif %}
+                    <div class="field inline">
+                        <label for="id_type_cotis">{{ _T("Contribution type:") }}</label>
+                        <select name="id_type_cotis" id="id_type_cotis" class="ui dropdown nochosen"{% if required.id_type_cotis == 1 %} required="required"{% endif %}>
+                            {% if contribution.type %}
+                                {% set selectedid = contribution.type.id %}
+                            {% else %}
+                                {% set selectedid = null %}
+                            {% endif %}
+                            {html_options options=$type_cotis_options selected=$selectedid}
+                            {% for key, value in type_cotis_options %}
+                                <option value="{{ key }}"{% if key == selectedid %} selected="selected"{% endif %}>{{ value }}</option>
+                            {% endfor %}
+                        </select>
+                    </div>
+    {% if type == constant('Galette\\Entity\\Contribution::TYPE_FEE') %}
+                    <noscript>
+                        <div class="button-container" id="reloadcont">
+                            <input type="submit" id="btnreload" name="btnreload" value="{{ _T("Reload") }}" title="{{ _T("Reload date information according to selected member and contribution type") }}" class="ui button"/>
+                        </div>
+                    </noscript>
+    {% endif %}
+                </div>
+            </div>
+
+            <div class="ui styled fluid accordion field">
+                <div class="active title">
+                    <i class="icon dropdown"></i>
+    {% if type == constant('Galette\\Entity\\Contribution::TYPE_FEE') %}
+                    {{ _T("Details of membership fee") }}
+    {% else %}
+                    {{ _T("Details of donation") }}
+    {% endif %}
+                </div>
+                <div class="active content field">
+                    <div class="field inline">
+                        <label for="montant_cotis">{{ _T("Amount:") }}</label>
+                        <input type="text" name="montant_cotis" id="montant_cotis" value="{{ contribution.amount }}" maxlength="10"{% if required.montant_cotis == 1 %} required="required"{% endif %}/>
+                    </div>
+                    {# payment type #}
+                    {% set ptype = contribution.payment_type %}
+                    {% if ptype == null %}
+                        {% set ptype = constant('Galette\\Entity\\PaymentType::CHECK') %}
+                    {% endif %}
+                    {% include 'components/forms/payment_types.html.twig' with { 'current': ptype, 'varname': 'type_paiement_cotis', 'show_inline': true } %}
+                    <div class="field inline">
+                        <label for="date_enreg">
+                            {{ _T("Record date:") }}
+                        </label>
+                        <div class="ui calendar" id="contribution-rangestart">
+                            <div class="ui input left icon">
+                                <i class="calendar icon"></i>
+                                <input type="text" name="date_enreg" id="date_enreg" value="{{ contribution.date }}" maxlength="10"{% if required.date_enreg == 1 %} required="required"{% endif %}>
+                            </div>
+                        </div>
+                        <span class="exemple">{{ _T("(yyyy-mm-dd format)") }}</span>
+                    </div>
+                    <div class="field inline">
+                        <label for="date_debut_cotis">
+                            {% if type == constant('Galette\\Entity\\Contribution::TYPE_FEE') %}
+                                {{ _T("Start date of membership:") }}
+                            {% else %}
+                                {{ _T("Date of contribution:") }}
+                            {% endif %}
+                        </label>
+                        <div class="ui calendar" id="contribution-rangeend">
+                            <div class="ui input left icon">
+                                <i class="calendar icon"></i>
+                                <input type="text" name="date_debut_cotis" id="date_debut_cotis" value="{{ contribution.begin_date }}" maxlength="10"{% if required.date_debut_cotis == 1 %} required="required"{% endif %}/>
+                            </div>
+                        </div>
+                        <span class="exemple">{{ _T("(yyyy-mm-dd format)") }}</span>
+                    </div>
+            {% if type == constant('Galette\\Entity\\Contribution::TYPE_FEE') %}
+                    <div class="field inline">
+                {% if preferences.pref_membership_ext != "" %}
+                        <label for="duree_mois_cotis">{{ _T("Membership extension:") }}</label>
+                        <input type="text" name="duree_mois_cotis" id="duree_mois_cotis" value="{{ contribution.duration }}" maxlength="3"{% if required.date_fin_cotis == 1%} required="required"{% endif %}/>
+                        <span class="exemple">{{ _T("months") }}</span>
+                {% else %}
+                        <label for="date_fin_cotis">{{ _T("End date of membership:") }}</label>
+                        <input type="text" name="date_fin_cotis" id="date_fin_cotis" value="{{ contribution.end_date }}" maxlength="10"{% if required.date_fin_cotis == 1 %} required="required"{% endif %}/>
+                        <span class="exemple">{{ _T("(yyyy-mm-dd format)") }}</span>
+                {% endif %}
+                    </div>
+            {% endif %}
+                    <div class="field inline">
+                        <label for="info_cotis">{{ _T("Comments:") }}</label>
+                        <textarea name="info_cotis" id="info_cotis" cols="61" rows="6"{% if required.info_cotis is defined and required.info_cotis == 1 %} required="required"{% endif %}>{{ contribution.info }}</textarea>
+                    </div>
+                </div>
+            </div>
+
+    {% if contribution.isTransactionPart() and contribution.transaction.getMissingAmount() %}
+            <div class="ui styled fluid accordion field">
+                <div class="active title">
+                    <i class="icon dropdown"></i>
+                    {{ _T("Transaction related") }}
+                </div>
+                <div class="active content field">
+                    <p>
+                        <span class="bline tooltip" title="{{ _T("Select a contribution type to create for dispatch transaction") }}">{{ _T("Dispatch type:") }}</span>
+                        <span class="tip">{{ _T("Select a contribution type to create for dispatch transaction") }}</span>
+                        <input type="radio" name="contrib_type" id="contrib_type_fee" value="{{ constant('Galette\\Entity\\Contribution::TYPE_FEE') }}" checked="checked"/> <label for="contrib_type_fee">{{ _T("Membership fee") }}</label>
+                        <input type="radio" name="contrib_type" id="contrib_type_donation" value="donation"/> <label for="contrib_type_donation">{{ _T("Donation") }}</label>
+                    </p>
+                </div>
+            </div>
+    {% endif %}
+        {% include 'components/dynamic_fields.html.twig' with { 'object': contribution } %}
+    {% if not contribution.id and preferences.pref_mail_method != constant('Galette\\Core\\GaletteMail::METHOD_DISABLED') %}
+        {% if not require_mass %}
+            <div class="ui center aligned segment">
+                <div class="inline field">
+                    <div class="ui toggle checkbox">
+                        <input type="checkbox" name="mail_confirm" id="mail_confirm" value="1" {if isset($smarty.post.mail_confirm) and $smarty.post.mail_confirm != ""}checked="checked"{/if}/>
+                        <label for="mail_confirm">
+                            {{ _T("Notify member") }}
+                        </label>
+                        <br/>
+                        <span class="exemple">
+                            {{ _T("Member will receive a notification by email, if he has an address.") }}
+                        </span>
+                    </div>
+                </div>
+            </div>
+        {% endif %}
+    {% endif %}
+    {% if not require_mass %}
+        <div class="ui basic center aligned segment">
+            <button type="submit" name="valid" class="ui labeled icon primary button action">
+                <i class="save icon"></i> {{ _T("Save") }}
+            </button>
+            <input type="hidden" name="id_cotis" value="{{ contribution.id }}"/>
+            <input type="hidden" name="valid" value="1"/>
+            <input type="hidden" name="trans_id" value="{% if contribution.transaction != NULL %}{{ contribution.transaction.id }}{% endif %}"/>
+        </div>
+    {% endif %}
+            {% include "components/forms/csrf.html.twig" %}
+        </form>
+{% else %} {# No members #}
+    <div class="ui warning message" id="warningbox">
+        <h3>{{ _T("No member registered!") }}</h3>
+        <p>
+            {{ _T("Unfortunately, there is no member in your database yet,") }}
+            <br/>
+            <a href="{{ path_for("addMember") }}">{{ _T("please create a member") }}</a>
+        </p>
+    </div>
+{% endif %}
+{% endblock %}
+
+{% block javascripts %}
+<script type="text/javascript">
+    {% include "elements/js/choose_adh.js.twig" %}
+
+    $(function() {
+        /*$('#date_debut_cotis, #date_fin_cotis, #date_enreg').datepicker({
+            changeMonth: true,
+            changeYear: true,
+            showOn: 'button',
+            buttonText: '<i class="ui calendar alt icon"></i> <span class="sr-only">{{ _T("Select a date")|e("js") }}</span>'
+        });*/
+
+    {% if type == constant('Galette\\Entity\\Contribution::TYPE_FEE') and not contribution.id %}
+        $('#id_adh, #id_type_cotis').on('change', function() {
+            var _this = $(this);
+            var _member = $('#id_adh').val();
+            var _fee    = $('#id_type_cotis').val();
+
+            $.ajax({
+                type: 'POST',
+                dataType: 'json',
+                url : '{{ path_for ("contributionDates") }}',
+                data: {
+                    member_id: _member,
+                    fee_id: _fee
+                },
+                {% include "elements/js/loader.js.twig" %},
+                success: function(res){
+                    $('#date_debut_cotis').val(res.date_debut_cotis);
+                    $('#date_fin_cotis').val(res.date_fin_cotis);
+                },
+                error: function() {
+                    alert("{{ _T("An error occurred retrieving dates :(")|e("js") }}");
+                }
+            });
+
+        });
+    {% endif %}
+
+    {% if contribution.isTransactionPart() and contribution.transaction.getMissingAmount() %}
+        $('#transaction_related').hide();
+        $('#montant_cotis').on('keyup', function() {
+            var _amount = {{ contribution.transaction.getMissingAmount() }};
+            var _current = $(this).val();
+            if (_current < _amount) {
+                $('#transaction_related').show();
+            } else if (_current > _amount) {
+                alert('{{ _T("Contribution amount should be greater than %max")|replace({ '%max': contribution.transaction.getMissingAmount() })|e("js") }}');
+            } else {
+                $('#transaction_related').hide();
+            }
+        });
+    {% endif %}
+    });
+</script>
+{% endblock %}
diff --git a/galette/templates/gtwig/modals/mass_add_contributions.html.twig b/galette/templates/gtwig/modals/mass_add_contributions.html.twig
new file mode 100644 (file)
index 0000000..733ff0f
--- /dev/null
@@ -0,0 +1,26 @@
+{% extends 'modals/contribution_form.html.twig' %}
+
+{% block content %}
+    <div id="mass_contributions"{% if mode != 'ajax' %} class="center"{% else %} title="{{ page_title }}"{% endif %}>
+    <form action="{{ form_url }}" method="post">
+        {% if mode != 'ajax' %}<h2>{{ page_title }}</h2>{% endif %}
+        <div class="button-container">
+            {{ parent() }}
+            <input type="submit" id="masschange" class="button" value="{% if changes is not defined %}{{ _T("Edit") }}{% else %}{{ _T("OK") }}{% endif %}"/>
+            <a href="{{ cancel_uri }}" class="button" id="btncancel">{{ _T("Cancel") }}</a>
+            <input type="hidden" name="confirm" value="1"/>
+            {% if mode == 'ajax' %}<input type="hidden" name="ajax" value="true"/>{% endif %}
+            {% for key, value in data %}
+                {% if value is iterable %}
+                    {% for val in value %}
+                <input type="hidden" name="{{ key }}[]" value="{{ val }}"/>
+                    {% endfor %}
+                {% else %}
+                <input type="hidden" name="{{ key }}" value="{{ value }}"/>
+                {% endif %}
+            {% endfor %}
+            {% include "components/forms/csrf.html.twig" %}
+        </div>
+    </form>
+    </div>
+{% endblock %}
diff --git a/galette/templates/gtwig/modals/mass_choose_contributions_type.html.twig b/galette/templates/gtwig/modals/mass_choose_contributions_type.html.twig
new file mode 100644 (file)
index 0000000..3a62d40
--- /dev/null
@@ -0,0 +1,29 @@
+{% extends (mode == 'ajax') ? "ajax.html.twig" : "page.html.twig" %}
+
+{% block content %}
+    <div id="mass_contributions"{% if mode != 'ajax' %} class="center"{% else %} title="{{ page_title }}"{% endif %}>
+    <form action="{{ form_url }}" method="post">
+        {% if mode != 'ajax' %}<h2>{{ page_title }}</h2>{% endif %}
+        <label for="type">{{ _T("Contribution type") }}</label>
+        <select name="type" id="type">
+            <option value="{{ constant('Galette\\Entity\\Contribution::TYPE_FEE') }}">{{ _T("Membership") }}</option>
+            <option value="{{ constant('Galette\\Entity\\Contribution::TYPE_DONATION') }}">{{ _T("Donation") }}</option>
+        </select>
+        <div class="button-container">
+            <input type="submit" id="masschange" class="button" value="{{ _T("OK") }}"/>
+            <a href="{{ cancel_uri }}" class="button" id="btncancel">{{ _T("Cancel") }}</a>
+            {% if mode == 'ajax' %}<input type="hidden" name="ajax" value="true"/>{% endif %}
+            {% for key, value in data %}
+                {% if value is iterable %}
+                    {% for val in value %}
+                <input type="hidden" name="{{ key }}[]" value="{{ val }}"/>
+                    {% endfor %}
+                {% else %}
+                <input type="hidden" name="{{ key }}" value="{{ value }}"/>
+                {% endif %}
+            {% endfor %}
+            {% include "components/forms/csrf.html.twig" %}
+        </div>
+    </form>
+    </div>
+{% endblock %}
diff --git a/galette/templates/gtwig/modals/members_attendance_sheet.html.twig b/galette/templates/gtwig/modals/members_attendance_sheet.html.twig
new file mode 100644 (file)
index 0000000..8f840bf
--- /dev/null
@@ -0,0 +1,47 @@
+{% extends (ajax) ? "ajax.html.twig" : "page.html.twig" %}
+
+{% block content %}
+    <form action="{{ path_for('attendance_sheet') }}" id="sheet_details_form" method="POST" class="ui form">
+        <div class="ui top attached header">
+            {{ _T("Some details about your attendance sheet...") }} - <span>{{ _T("%s attendees")|replace({ '%s': selection|length }) }}</span>
+        </div>
+        <div class="ui bottom attached segment">
+            <div class="active content field">
+                <div class="inline field">
+                    <label for="sheet_type">{{ _T("Sheet type") }}</label>
+                    <input type="text" name="sheet_type" id="sheet_type" value="{{ _T("Attendance sheet") }}" required/>
+                </div>
+                <div class="inline field">
+                    <label for="sheet_title">{{ _T("Title") }}</label>
+                    <input type="text" name="sheet_title" id="sheet_title"/>
+                </div>
+                <div class="inline field">
+                    <label for="sheet_sub_title">{{ _T("Subtitle") }}</label>
+                    <input type="text" name="sheet_sub_title" id="sheet_sub_title"/>
+                </div>
+                <div class="inline field">
+                    <label for="sheet_date">{{ _T("Date") }}</label>
+                    <input type="text" name="sheet_date" id="sheet_date"/>
+                    <span class="exemple">{{ _T("(yyyy-mm-dd format)") }}</span>
+                </div>
+                <div class="inline field">
+                    <label for="sheet_photos">{{ _T("With photos?") }}</label>
+                    <input type="checkbox" name="sheet_photos" id="sheet_photos" value="1"/>
+{% for member in selection %}
+                    <input type="hidden" name="selection[]" value="{{ member }}"/>
+{% endfor %}
+                {% include 'components/forms/csrf.html.twig' %}
+                </div>
+            </div>
+        </div>
+{% if not ajax %}
+        <div class="ui basic center aligned segment">
+            <button type="submit" class="ui labeled icon primary button">
+                <i class="file pdf icon" aria-hidden="true"></i>
+                {{ _T("Generate") }}
+            </button>
+        </div>
+{% endif %}
+
+    </form>
+{% endblock %}
diff --git a/galette/templates/gtwig/modals/plugin_initdb.html.twig b/galette/templates/gtwig/modals/plugin_initdb.html.twig
new file mode 100644 (file)
index 0000000..8a21e51
--- /dev/null
@@ -0,0 +1,137 @@
+{% extends (mode == 'ajax') ? "ajax.html.twig" : "page.html.twig" %}
+
+{% block content %}
+<section id="plugin_install">
+    <header>
+        <h1>{{ _T("%plugin plugin installation")|replace({ '%plugin': plugin.name }) }}</h1>
+    </header>
+    <div>
+    <form action="{{ path_for('pluginInitDb', { 'id': plugid }) }}" id="plugins_initdb_form" method="post">
+        <h2>{{ page_title }}</h2>
+{% if mode == 'ajax' %}
+    {% include 'elements/messages_inline.html.twig' %}
+{% endif %}
+
+
+
+{% if step == 1 %}
+        <div id="installation_mode">
+            <article id="mode_new" class="installation_mode">
+                <h3>
+                    <input type="radio" name="install_type" value="{{ constant('Galette\\Core\\PluginInstall::INSTALL') }}" checked="checked" id="install"/>
+                    <label for="install">{{ _T("New installation") }}</label>
+                </h3>
+                <ul>
+                    <li>{{ _T("you're installing %name for the first time")|replace({ '%name': plugin.name }) }},</li>
+                    <li>{{ _T("you wish to erase an older version of of %name without keeping your data")|replace({ '%name': plugin.name }) }}.</li>
+                </ul>
+            </article>
+    {% if update_scripts is defined and update_scripts|length > 0 %}
+            <article id="mode_update" class="installation_mode">
+                <h3>
+                    <input type="radio" name="install_type" value="{{ constant('Galette\\Core\\PluginInstall::UPDATE') }}" id="update"/>
+                    <label for="update">{{ _T("Update") }}</label>
+                </h3>
+                <ul>
+                <li>{{ _T("you already have installed %name, and you want to upgrade to the latest version")|replace({ '%name': plugin.name }) }}.</li>
+                </ul>
+                <p id="warningbox">{{ _T("Warning: Don't forget to backup your current database.") }}</span>
+            </article>
+    {% endif %}
+        </div>
+{% endif %}
+{% if step == 'i2' or step == 'u2' %}
+    {{ results }}
+{% endif %}
+{% if step == 'u3' %}
+        <fieldset class="cssform">
+            <legend class="ui-state-active ui-corner-top">{{ _T("You current %name version is...")|replace({ '%name': plugin.name }) }}</legend>
+            <ul class="leaders">
+    {% set last = 0.00 %}
+    {% for k, val in update_scripts %}
+                <li>
+                    <span>
+                        <label for="upgrade-{{ val }}">
+
+        {% if last == 0.00 %}
+            {{ _T("older than %version")|replace({ '%version': val }) }}
+        {% elseif last != val %}
+            {{ _T("comprised between") }} {{ last }} {{ _T("and") }} {{ val }}
+        {% else %}
+            {{ val }}
+        {% endif %}
+        {% set last = val %}
+                        </label>
+                    </span>
+                    <span>
+                        <input type="radio" name="previous_version" value="{{ val }}" id="upgrade-{{ val }}" required/>
+                    </span>
+                </li>
+    {% endfor %}
+            </ul>
+        </fieldset>
+{% endif %}
+{% if step == 'i4' or step == 'u4' %}
+        <p>{{ _T("(Errors on DROP and RENAME operations can be ignored)") }}</p>
+    {% if error_detected|length > 0 %}
+        <p id="errorbox">
+        {% if step == 'i3' %}
+            {{ _T("The tables are not totally created, it may be a permission problem.") }}
+        {% else %}
+            {{ _T("The tables have not been totally created, it may be a permission problem.") }}
+            <br/>
+            {{ _T("Your database is maybe not usable, try to restore the older version.") }}
+        {% endif %}
+        </p>
+    {% endif %}
+{% endif %}
+{% if step == 'i5' or step =='u5' %}
+        <p>
+            {% if step == 'i5' %}
+                {{ _T("Plugin '%name' has been successfully installed!")|replace({ '%name': plugin.name }) }}
+            {% else %}
+                {{ _T("Plugin '%name' has been successfully updated!")|replace({ '%name': plugin.name }) }}
+            {% endif %}
+        </p>
+{% endif %}
+{% if istep < 5 %}
+        <p id="btn_box">
+            <input type="hidden" name="plugid" value="{{ plugid }}"/>
+    {% if istep > 1 and install_type is defined %}
+            <input type="hidden" name="install_type" value="{{ install_type }}"/>
+    {% endif %}
+    {% if error_detected|length == 0 and istep >= 2 or istep > 2 %}
+            <input type="hidden" name="install_dbperms_ok" value="1"/>
+    {% endif %}
+    {% if error_detected|length == 0 and istep >= 4 or istep > 4 %}
+            <input type="hidden" name="install_dbwrite_ok" value="1"/>
+    {% endif %}
+    {% if error_detected|length > 0 %}
+            <input type="submit" value="{{ _T("Retry") }}"/>
+    {% else %}
+            <button id="next" type="ui labeled icon button submit">{{ _T("Next step") }} <i class="forward icon"></i></button>
+    {% endif %}
+{% else %}
+    {% if mode != 'ajax' %}
+            <a href="{{ path_for('plugins') }}" class="ui labeled icon button" id="btnback"><i class="backward icon"></i> {{ _T("Back to plugins managment page") }}</a>
+    {% endif %}
+{% endif %}
+            {% include 'components/forms/csrf.html.twig' %}
+        </p>
+    </form>
+    </div>
+    <footer>
+        <p>{{ _T("Steps:") }}</p>
+        <ol>
+            <li{% if step == 1 %} class="current"{% endif %}>{{ _T("Installation mode") }} - </li>
+            <li{% if step == 'i2' or step == 'u2' %} class="current"{% endif %}>{{ _T("Access permissions to database") }} - </li>
+        {% if install_type is defined and install_type == 'upgrade' %}
+            <li{% if step == 'u3' %} class="current"{% endif %}>{{ _T("Version selection") }} - </li>
+            </li>
+        {% endif %}
+            <li{% if step == 'i4' or step == 'u4' %} class="current"{% endif %}>{% if install_type is not defined or install_type == 'install' %}{{ _T("Database installation") }}{% else %}{{ _T("Database upgrade") }}{% endif %} - </li>
+            <li{% if step == 'i5' or step == 'u5' %} class="current"{% endif %}>{{ _T("End!") }}</li>
+        </ol>
+    </footer>
+</section>
+{% endblock %}
diff --git a/galette/templates/gtwig/modals/replacements_legend.html.twig b/galette/templates/gtwig/modals/replacements_legend.html.twig
new file mode 100644 (file)
index 0000000..47fe143
--- /dev/null
@@ -0,0 +1,45 @@
+<div id="legende{{ cur_ref }}" class="texts_legend ui large modal" title="{{ _T("Existing variables") }}">
+    <div class="header">{{ _T('Existing variables') }}</div>
+    <div class="scrolling content">
+        <table class="ui very basic table">
+    {% for legend in legends %}
+        <tr>
+            <th colspan="4">
+                {{ legend.title }}
+            </th>
+        </tr>
+        {% for pattern in legend.patterns %}
+            {% if loop.index0 % 2 == 0 %}
+                <tr>
+            {% endif %}
+            <th><tt>{{ pattern.pattern|trim('/') }}</tt></th>
+            <td class="back">
+                {% if pattern.title is defined %}{{ pattern.title }}{% endif %}
+            </td>
+            {% if loop.index0 % 2 != 0 %}
+                </tr>
+            {% endif %}
+        {% endfor %}
+    {% endfor %}
+        </table>
+    </div>
+    <div class="actions"><div class="ui labeled icon deny button"><i class="times icon"></i> {{ _T('Close') }}</div></div>
+</div>
+<script type="text/javascript">
+
+    var _addLegenButton = function(selector) {
+        $(selector).append('<a id="btnlegend" class="ui tooltip" data-html="{{ _T("Show existing variables")|e('js') }}"><i class="circular inverted primary link icon info"></i> <span class="sr-only">{{ _T("Show existing variables")|e('js') }}</span></a>');
+    };
+
+    var _handleLegend = function(selector) {
+        if (typeof selector == 'undefined') {
+            selector = '{{ cur_ref }}';
+        }
+        $('#legende' + selector).modal().modal('hide');
+
+        $('#btnlegend').unbind('click').click(function(){
+            $('#legende' + selector).modal('show');
+            return false;
+        });
+    };
+</script>
index 49b3739b7257d297175e39b0fdadc257060fbb71..b8a1ccc7969e3392611cbcc9a49d706efedde33e 100644 (file)
@@ -1,23 +1,29 @@
 {% if part == "dialog" %}
-        <div id="telemetry_panel">
-            <h3>{{ _T("Telemetry data are <strong>anonymous</strong>; nothing about your organization or its members will be sent.") }}</h3>
-            <p>{{ _T("Nothing is automated in the process; it's up to you to send (or resend) data.") }}<br/>{{ _T("You can review below the raw data that would be send if you press the 'Send' button.") }}.<br/>{{ _T("Also note tha all data is sent over a <strong>HTTPS secured connection</strong>.") }}</p>
-            <div class="tdata">
+        <div id="telemetry_panel" class="texts_legend ui modal">
+            <div class="header">{{ _T("Telemetry data are <strong>anonymous</strong>; nothing about your organization or its members will be sent.") }}</div>
+            <div class="scrolling content">
+                <p>{{ _T("Nothing is automated in the process; it's up to you to send (or resend) data.") }}<br/>{{ _T("You can review below the raw data that would be send if you press the 'Send' button.") }}.<br/>{{ _T("Also note tha all data is sent over a <strong>HTTPS secured connection</strong>.") }}</p>
+                <div class="tdata">
+                </div>
             </div>
         </div>
 {% endif %}
 {% if part == "jsdialog" %}
-                $('#telemetry_panel').dialog({
+                $('#telemetry_panel').modal({
                     title: '{{ _T("Send telemetry information")|e('js') }}',
-                    buttons: {
-                        '{{ _T("Send")|e('js') }}': function() {
+                    class: 'large',
+                    actions: [{
+                        text    : '{{ _T("Send")|e('js') }}',
+                        class   : 'green approve',
+                        icon    : 'share',
+                        click   : function() {
                             $.ajax({
                                 url:  '{{ path_for('telemetrySend') }}',
                                 method: 'POST',
                                 {% include "elements/js/loader.js.twig" %},
                                 success: function(data) {
                                     if (data.success) {
-                                        $('#telemetry_panel').dialog('close');
+                                        $('#telemetry_panel').modal('hide');
     {% if orig is defined and orig == 'desktop' %}
                                         $('#telemetry').remove();
                                         if ($('#share a').length == 0) {
                                 error: function() {
                                     alert("{{ _T("An error occurred sending telemetry information :(")|e('js') }}");
                                 }
-                            });
-                        },
-                        '{{ _T("Cancel")|e('js') }}': function() {
-                            $(this).dialog('close');
+                            });}
+                    }, {
+                        text    : '{{ _T("Cancel")|e('js') }}',
+                        class   : 'red cancel',
+                        icon    : 'times',
+                        click   : function() {
+                            $(this).find('.tdata').empty();
                         }
-                    },
-                    maxHeight: $(window).height(),
-                    open: function(event, ui) {
-                        $(this).dialog('option', 'maxHeight', $(window).height());
-                        $(this).parent().prev('.ui-widget-overlay');
-                    },
-                    draggable: true,
-                    modal: true,
-                    resizable: true,
-                    width: ($(window).width() > 767 ? '50%' : '100%'),
-                    autoOpen: false,
-                    close: function(){
-                        $(this).find('.tdata').empty();
-                    }
+                    }]
                 });
 
                 $('#telemetry').on('click', function(e) {
@@ -69,7 +65,7 @@
                         url:  '{{ path_for('telemetryInfos') }}',
                         success: function(data) {
                             $('#telemetry_panel .tdata').append(data);
-                            $('#telemetry_panel').dialog('open');
+                            $('#telemetry_panel').modal('show');
                         }
 
                     });
                     }
                 });
             });
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git a/galette/templates/gtwig/pages/configuration_dynamic_field_form.html.twig b/galette/templates/gtwig/pages/configuration_dynamic_field_form.html.twig
deleted file mode 100644 (file)
index 35100fe..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-{% extends (mode == 'ajax') ? "ajax.html.twig" : "page.html.twig" %}
-
-{% block content %}
-{% if action == 'edit' %}
-    <form action="{{ path_for('doEditDynamicField', { 'form_name': form_name, 'id': df.getId() }) }}" method="post" class="ui form">
-        <div class="ui top attached header">
-            {{ _T("Edit field %field")|replace({ '%field': df.getName() }) }}
-        </div>
-        <div class="ui bottom attached segment">
-            <div class="active content field">
-                <div class="inline field">
-                    <label for="field_name">{{ _T("Name:") }}</label>
-                    <input type="text" name="field_name" id="field_name" value="{{ df.getName(false) }}"{if not $df|is_a:'Galette\DynamicFields\Separator'} required="required"{/if}/>
-                </div>
-                <div class="inline field">
-                    <label for="field_perm">{{ _T("Permissions:") }}</label>
-                    <select name="field_perm" id="field_perm" class="ui dropdown nochosen">
-                        {% for key, value in perm_names %}
-                            <option value="{{ key }}"{% if key == df.getPerm() %} selected="selected"{% endif %}>{{ value }}</option>
-                        {% endfor %}
-                    </select>
-                </div>
-    {% if df.hasData() %}
-                <div class="inline field">
-                    <label for="field_required">{{ _T("Required:") }}</label>
-                    <select name="field_required" id="field_required" class="ui dropdown nochosen">
-                        <option value="0" {% if not df.isRequired() %}selected="selected"{% endif %}>{{ _T("No") }}</option>
-                        <option value="1" {% if df.isRequired() %}selected="selected"{% endif %}>{{ _T("Yes") }}</option>
-                    </select>
-                </div>
-    {% endif %}
-    {% if df.hasWidth() %}
-                <div class="inline field">
-                    <label for="field_width">{{ _T("Width:") }}</label>
-                    <input type="text" name="field_width" id="field_width" value="{{ df.getWidth() }}" size="3"/>
-                </div>
-    {% endif %}
-    {% if df.hasHeight() %}
-                <div class="inline field">
-                    <label for="field_height">{{ _T("Height:") }}</label>
-                    <input type="text" name="field_height" id="field_height" value="{{ df.getHeight() }}" size="3"/>
-                </div>
-    {% endif %}
-    {% if df.hasSize() %}
-                <div class="inline field">
-                    <label for="field_size">{{ _T("Size:") }}</label>
-                    <input type="text" name="field_size" id="field_size" value="{{ df.getSize() }}" size="3"/>
-        {if $df|is_a:'Galette\DynamicFields\File'}
-                    <span class="exemple">{{ _T("Maximum file size, in Ko.") }}</span>
-        {else}
-                    <span class="exemple">{{ _T("Maximum number of characters.") }}</span>
-        {/if}
-                </div>
-    {% endif %}
-    {% if df.isMultiValued() %}
-                <div class="inline field">
-                    <label for="field_repeat">{{ _T("Repeat:") }}</label>
-                    <input type="text" name="field_repeat" id="field_repeat" value="{{ df.getRepeat() }}" size="3"/>
-                    <span class="exemple">{{ _T("Number of values or zero if infinite.") }}</span>
-                </div>
-    {% endif %}
-    {% if df.hasFixedValues() %}
-                <div class="inline field">
-                    <label for="fixed_values">{{ _T("Values:") }}</label>
-                    <textarea name="fixed_values" id="fixed_values" cols="20" rows="6">{{ df.getValues(true) }}</textarea>
-                    <br/><span class="exemple">{{ _T("Choice list (one entry per line).") }}</span>
-                </div>
-    {% endif %}
-                <div class="field">
-                    <label for="field_information">{{ _T("Information:") }}</label>
-                    <textarea name="field_information" id="field_information" cols="20" rows="6">{{ df.getInformation() }}</textarea>
-                    <span class="tip">{{ _T("Extra information displayed along with dynamic field.") }}</span>
-                </div>
-            </div>
-        </div>
-
-        <div class="ui basic center aligned segment">
-            <button type="submit" class="ui labeled icon primary button action">
-                <i class="save icon"></i> {{ _T("Save") }}
-            </button>
-            {% include "components/forms/csrf.html.twig" %}
-        </div>
-     </form>
-{% elseif action == 'add' %}
-    <form action="{{ path_for('doAddDynamicField', { 'form_name': form_name }) }}" method="post" enctype="multipart/form-data" title="{{ _T("New dynamic field") }}" class="ui form">
-    {% if mode != 'ajax' %}
-        <div class="ui top attached header">
-            {{ _T("New dynamic field") }}
-        </div>
-        <div class="ui bottom attached segment">
-            <div class="active content field">
-    {% else %}
-        <div class="cssform">
-    {% endif %}
-                <div class="inline field">
-                    <label for="field_name">{{ _T("Field name") }}</label>
-                    <input size="40" type="text" name="field_name" id="field_name" value="{% if df is defined %}{{ df.getName() }}{% endif %}"/>
-                </div>
-                <div class="inline field">
-                    <label for="field_perm">{{ _T("Visibility") }}</label>
-                    <select name="field_perm" id="field_perm" class="ui dropdown nochosen">
-                        {% set perm = 0 %}
-                        {% if df is defined %}
-                            {% set perm = df.getPerm() %}
-                        {% endif %}
-                        {% for key, value in perm_names %}
-                            <option value="{{ key }}"{% if key == perm %} selected="selected"{% endif %}>{{ value }}</option>
-                        {% endfor %}
-                    </select>
-                </div>
-                <div class="inline field">
-                    <label for="field_type">{{ _T("Type") }}</label>
-                    <select name="field_type" id="field_type" class="ui dropdown nochosen">
-                        {% set type = 0 %}
-                        {% if df is defined %}
-                            {% set type = df.getType() %}
-                        {% endif %}
-                        {html_options options=$field_type_names selected=$type}
-                        {% for key, value in field_type_names %}
-                            <option value="{{ key }}"{% if key == type %} selected="selected"{% endif %}>{{ value }}</option>
-                        {% endfor %}
-                    </select>
-                </div>
-                <div class="inline field">
-                    <label for="field_required">{{ _T("Required") }}</label>
-                    <select name="field_required" id="field_required" class="ui dropdown nochosen">
-                        <option value="0"{% if df is not defined or not df.isRequired() %} selected="selected"{% endif %}>{{ _T("No") }}</option>
-                        <option value="1"{% if df is defined and df.isRequired() %} selected="selected"{% endif %}>{{ _T("Yes") }}</option>
-                    </select>
-                    {% include "components/forms/csrf.html.twig" %}
-                </div>
-    {% if mode != 'ajax' %}
-            </div>
-    {% endif %}
-        </div>
-        <div class="ui basic center aligned segment">
-            <button type="submit" name="valid" class="ui labeled icon primary button action">
-                <i class="plus icon"></i> {{ _T("Add") }}
-            </button>
-            <input type="hidden" name="form_name" id="form_name" value="{{ form_name }}"/>
-        </div>
-    </form>
-{% endif %}
-{% endblock %}
-
-{% block javascripts %}
-    <script>
-        $('#field_information').summernote({
-            lang: '{{ i18n.getID()|replace({ '_': '-'}) }}',
-            height: 240,
-            toolbar: [
-                ['style', ['style']],
-                ['font', ['bold', 'italic', 'strikethrough', 'clear']],
-                ['para', ['ul', 'ol', 'paragraph']],
-                ['insert', ['link', 'picture']],
-                ['view', ['codeview', 'help']]
-            ],
-            styleTags: [
-                'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'
-            ]
-        });
-        $('#field_information').summernote('focus');
-
-    </script>
-{% endblock %}
index f973e56b4c5d5ec168e2c10fbb9d0da0ca10c9d6..8daf3cd3aa78a47149544b3d3b2bb7f75de3095a 100644 (file)
@@ -56,7 +56,7 @@
                 {% include 'components/forms/csrf.html.twig' %}
             </div>
         </form>
-        {% include 'elements/replacements_legend.html.twig' with { 'legends': texts.getLegend(), 'cur_ref': cur_ref } %}
+        {% include 'modals/replacements_legend.html.twig' with { 'legends': texts.getLegend(), 'cur_ref': cur_ref } %}
 {% endblock %}
 
 {% block javascripts %}
diff --git a/galette/templates/gtwig/pages/confirm_removal.html.twig b/galette/templates/gtwig/pages/confirm_removal.html.twig
deleted file mode 100644 (file)
index de8325a..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-{% extends (mode == 'ajax') ? "ajax.html.twig" : "page.html.twig" %}
-
-{% block content %}
-    <div id="confirm_removal"{% if mode == 'ajax' %} class="center"{% else %} title="{{ page_title }}"{% endif %}>
-    <form action="{{ form_url }}" method="post">
-    {% if mode != 'ajax' %}
-        <div class="ui segment">
-            <div class="content">
-        {% if with_cascade is defined %}
-                <div class="field inline">
-        {% endif %}
-    {% endif %}
-    {% if with_cascade is defined %}
-                    <label for="cascade">{{ _T("Cascade delete") }}</label>
-                    <input type="checkbox" name="cascade" id="cascade" value="true" title="{{ _T("Delete all associated data") }}"/>
-    {% endif %}
-    {% if mode != 'ajax' %}
-        {% if with_cascade is defined %}
-                </div>
-        {% endif %}
-        {% if message is defined %}
-                <div class="ui warning message">
-        {% endif %}
-    {% endif %}
-    {% if message is defined %}
-                    <p>{{ message }}</p>
-    {% endif %}
-    {% if mode != 'ajax' %}
-        {% if message is defined %}
-                </div>
-        {% endif %}
-                <div class="ui red message">
-    {% endif %}
-                    <p>{{ _T("Are you sure you want to proceed?") }}<br/>{{ _T("This can't be undone.") }}</p>
-    {% if mode != 'ajax' %}
-                </div>
-            </div>
-        </div>
-        <div class="ui basic center aligned segment">
-    {% else %}
-        <div class="button-container">
-    {% endif %}
-            <input type="submit" id="delete" value="{{ _T("Remove") }}"{% if mode != 'ajax' %} class="ui primary button action"{% endif %}/>
-            <a href="{{ cancel_uri }}" class="{% if mode != 'ajax' %}ui {% endif %}button" id="btncancel">{{ _T("Cancel") }}</a>
-            <input type="hidden" name="confirm" value="1"/>
-            {% if mode == 'ajax' %}<input type="hidden" name="ajax" value="true"/>{% endif %}
-            {% for key, value in data %}
-                {% if value is iterable %}
-                    {% for val in value %}
-                <input type="hidden" name="{{ key }}[]" value="{{ val }}"/>
-                    {% endfor %}
-                {% else %}
-                <input type="hidden" name="{{ key }}" value="{{ value }}"/>
-                {% endif %}
-            {% endfor %}
-            {% include 'components/forms/csrf.html.twig' %}
-        </div>
-    </form>
-    </div>
-{% endblock %}
-
-{% block javascripts %}
-{% endblock %}
diff --git a/galette/templates/gtwig/pages/contribution_form.html.twig b/galette/templates/gtwig/pages/contribution_form.html.twig
deleted file mode 100644 (file)
index 5f7bdb0..0000000
+++ /dev/null
@@ -1,293 +0,0 @@
-{% extends (mode == 'ajax') ? "ajax.html.twig" : "page.html.twig" %}
-
-{% block content %}
-{% if members.list is defined or require_mass %}
-        <form action="{% if contribution.id %}{{ path_for("doEditContribution", { "type": type, "id": contribution.id }) }}{% else %}{{ path_for("doAddContribution", { "type": type }) }}{% endif %}" enctype="multipart/form-data" method="post" class="ui form">
-    {% if contribution.isTransactionPart() %}
-        {assign var="mid" value=$contribution->transaction->member}
-            <div class="ui top attached header">
-                {{ _T("Related transaction information") }}
-            </div>
-            <div class="ui bottom attached segment">
-                <div class="active content field">
-                    <table id="transaction_detail" class="listing ui celled table">
-                        <thead>
-                            <tr>
-                                <th colspan="5">
-                                    {{ contribution.transaction.description }}
-                                    <a
-                                        href="{{ path_for("editTransaction", { "id": contribution.transaction.id }) }}"
-                                        class="ui icon button tooltip"
-                                        title="{{ _T("View transaction") }}"
-                                    >
-                                        <i class="columns icon"><span class="sr-only">{{ _T("View transaction") }}</span></i>
-                                    </a>
-                                </th>
-                            </tr>
-                            <tr>
-                                <th class="listing">#</th>
-                                <th class="listing">{{ _T("Date") }}</th>
-                                <th class="listing">{{ _T("Member") }}</th>
-                                <th class="listing">{{ _T("Amount") }}</th>
-                                <th class="listing">{{ _T("Not dispatched amount") }}</th>
-                            </tr>
-                        </thead>
-                        <tbody>
-                            <tr>
-                                <td>{{ contribution.transaction.id }}</td>
-                                <td>{{ contribution.transaction.date }}</td>
-                                <td>{ memberName id="$mid"}</td>
-                                <td class="right">{{ contribution.transaction.amount }}</td>
-                                <td class="right">{{ contribution.transaction.getMissingAmount() }}</td>
-                            </tr>
-                        </tbody>
-                    </table>
-                </div>
-            </div>
-    {% endif %}
-            <div class="ui styled fluid accordion field">
-                <div class="active title">
-                    <i class="icon dropdown"></i>
-    {% if type == constant('Galette\\Entity\\Contribution::TYPE_FEE') %}
-                    {{ _T("Select contributor and membership fee type") }}
-    {% else %}
-                    {{ _T("Select contributor and donation type") }}
-    {% endif %}
-    {% if contribution.isTransactionPart() and contribution.transaction.getMissingAmount() > 0 %}
-                    <a
-                        href="{{ path_for("addContribution", { "type": constant('Galette\\Entity\\Contribution::TYPE_FEE') }) }}?trans_id={{ contribution.transaction.id }}"
-                        class="ui icon button fright tooltip"
-                        title="{{ _T("Create a new fee that will be attached to the current transaction") }}">
-                        <i class="user check icon"></i>
-                        <span class="sr-only">{{ _T("New attached fee") }}</span>
-                    </a>
-                    <a
-                        href="{{ path_for("addContribution", { "type": "donation" }) }}?trans_id={{ contribution.transaction.id }}"
-                        class="ui icon button fright tooltip"
-                        title="{{ _T("Create a new donation that will be attached to the current transaction") }}">
-                        <i class="gift icon"></i>
-                        <span class="sr-only">{{ _T("New attached donation") }}</span>
-                    </a>
-    {% endif %}
-                </div>
-    {% if not require_mass %}
-                <div class="active content field">
-                    <div class="field inline">
-                        <label for="id_adh">{{ _T("Contributor:") }}</label>
-                        <select name="id_adh" id="id_adh" class="nochosen">
-                            {% if adh_selected == 0 %}
-                            <option value="">{{ _T("Search for name or ID and pick member") }}</option>
-                            {% endif %}
-                            {% for k,v in members.list %}
-                                <option value="{{ k }}"{% if contribution.member == k %} selected="selected"{% endif %}>{{ v }}</option>
-                            {% endfor %}
-                        </select>
-                    </div>
-    {% endif %}
-                    <div class="field inline">
-                        <label for="id_type_cotis">{{ _T("Contribution type:") }}</label>
-                        <select name="id_type_cotis" id="id_type_cotis" class="ui dropdown nochosen"{% if required.id_type_cotis == 1 %} required="required"{% endif %}>
-                            {% if contribution.type %}
-                                {% set selectedid = contribution.type.id %}
-                            {% else %}
-                                {% set selectedid = null %}
-                            {% endif %}
-                            {html_options options=$type_cotis_options selected=$selectedid}
-                            {% for key, value in type_cotis_options %}
-                                <option value="{{ key }}"{% if key == selectedid %} selected="selected"{% endif %}>{{ value }}</option>
-                            {% endfor %}
-                        </select>
-                    </div>
-    {% if type == constant('Galette\\Entity\\Contribution::TYPE_FEE') %}
-                    <noscript>
-                        <div class="button-container" id="reloadcont">
-                            <input type="submit" id="btnreload" name="btnreload" value="{{ _T("Reload") }}" title="{{ _T("Reload date information according to selected member and contribution type") }}" class="ui button"/>
-                        </div>
-                    </noscript>
-    {% endif %}
-                </div>
-            </div>
-
-            <div class="ui styled fluid accordion field">
-                <div class="active title">
-                    <i class="icon dropdown"></i>
-    {% if type == constant('Galette\\Entity\\Contribution::TYPE_FEE') %}
-                    {{ _T("Details of membership fee") }}
-    {% else %}
-                    {{ _T("Details of donation") }}
-    {% endif %}
-                </div>
-                <div class="active content field">
-                    <div class="field inline">
-                        <label for="montant_cotis">{{ _T("Amount:") }}</label>
-                        <input type="text" name="montant_cotis" id="montant_cotis" value="{{ contribution.amount }}" maxlength="10"{% if required.montant_cotis == 1 %} required="required"{% endif %}/>
-                    </div>
-                    {# payment type #}
-                    {% set ptype = contribution.payment_type %}
-                    {% if ptype == null %}
-                        {% set ptype = constant('Galette\\Entity\\PaymentType::CHECK') %}
-                    {% endif %}
-                    {% include 'components/forms/payment_types.html.twig' with { 'current': ptype, 'varname': 'type_paiement_cotis', 'show_inline': true } %}
-                    <div class="field inline">
-                        <label for="date_enreg">
-                            {{ _T("Record date:") }}
-                        </label>
-                        <div class="ui calendar" id="contribution-rangestart">
-                            <div class="ui input left icon">
-                                <i class="calendar icon"></i>
-                                <input type="text" name="date_enreg" id="date_enreg" value="{{ contribution.date }}" maxlength="10"{% if required.date_enreg == 1 %} required="required"{% endif %}>
-                            </div>
-                        </div>
-                        <span class="exemple">{{ _T("(yyyy-mm-dd format)") }}</span>
-                    </div>
-                    <div class="field inline">
-                        <label for="date_debut_cotis">
-                            {% if type == constant('Galette\\Entity\\Contribution::TYPE_FEE') %}
-                                {{ _T("Start date of membership:") }}
-                            {% else %}
-                                {{ _T("Date of contribution:") }}
-                            {% endif %}
-                        </label>
-                        <div class="ui calendar" id="contribution-rangeend">
-                            <div class="ui input left icon">
-                                <i class="calendar icon"></i>
-                                <input type="text" name="date_debut_cotis" id="date_debut_cotis" value="{{ contribution.begin_date }}" maxlength="10"{% if required.date_debut_cotis == 1 %} required="required"{% endif %}/>
-                            </div>
-                        </div>
-                        <span class="exemple">{{ _T("(yyyy-mm-dd format)") }}</span>
-                    </div>
-            {% if type == constant('Galette\\Entity\\Contribution::TYPE_FEE') %}
-                    <div class="field inline">
-                {% if preferences.pref_membership_ext != "" %}
-                        <label for="duree_mois_cotis">{{ _T("Membership extension:") }}</label>
-                        <input type="text" name="duree_mois_cotis" id="duree_mois_cotis" value="{{ contribution.duration }}" maxlength="3"{% if required.date_fin_cotis == 1%} required="required"{% endif %}/>
-                        <span class="exemple">{{ _T("months") }}</span>
-                {% else %}
-                        <label for="date_fin_cotis">{{ _T("End date of membership:") }}</label>
-                        <input type="text" name="date_fin_cotis" id="date_fin_cotis" value="{{ contribution.end_date }}" maxlength="10"{% if required.date_fin_cotis == 1 %} required="required"{% endif %}/>
-                        <span class="exemple">{{ _T("(yyyy-mm-dd format)") }}</span>
-                {% endif %}
-                    </div>
-            {% endif %}
-                    <div class="field inline">
-                        <label for="info_cotis">{{ _T("Comments:") }}</label>
-                        <textarea name="info_cotis" id="info_cotis" cols="61" rows="6"{% if required.info_cotis is defined and required.info_cotis == 1 %} required="required"{% endif %}>{{ contribution.info }}</textarea>
-                    </div>
-                </div>
-            </div>
-
-    {% if contribution.isTransactionPart() and contribution.transaction.getMissingAmount() %}
-            <div class="ui styled fluid accordion field">
-                <div class="active title">
-                    <i class="icon dropdown"></i>
-                    {{ _T("Transaction related") }}
-                </div>
-                <div class="active content field">
-                    <p>
-                        <span class="bline tooltip" title="{{ _T("Select a contribution type to create for dispatch transaction") }}">{{ _T("Dispatch type:") }}</span>
-                        <span class="tip">{{ _T("Select a contribution type to create for dispatch transaction") }}</span>
-                        <input type="radio" name="contrib_type" id="contrib_type_fee" value="{{ constant('Galette\\Entity\\Contribution::TYPE_FEE') }}" checked="checked"/> <label for="contrib_type_fee">{{ _T("Membership fee") }}</label>
-                        <input type="radio" name="contrib_type" id="contrib_type_donation" value="donation"/> <label for="contrib_type_donation">{{ _T("Donation") }}</label>
-                    </p>
-                </div>
-            </div>
-    {% endif %}
-        {% include 'components/dynamic_fields.html.twig' with { 'object': contribution } %}
-    {% if not contribution.id and preferences.pref_mail_method != constant('Galette\\Core\\GaletteMail::METHOD_DISABLED') %}
-        {% if not require_mass %}
-            <div class="ui center aligned segment">
-                <div class="inline field">
-                    <div class="ui toggle checkbox">
-                        <input type="checkbox" name="mail_confirm" id="mail_confirm" value="1" {if isset($smarty.post.mail_confirm) and $smarty.post.mail_confirm != ""}checked="checked"{/if}/>
-                        <label for="mail_confirm">
-                            {{ _T("Notify member") }}
-                        </label>
-                        <br/>
-                        <span class="exemple">
-                            {{ _T("Member will receive a notification by email, if he has an address.") }}
-                        </span>
-                    </div>
-                </div>
-            </div>
-        {% endif %}
-    {% endif %}
-    {% if not require_mass %}
-        <div class="ui basic center aligned segment">
-            <button type="submit" name="valid" class="ui labeled icon primary button action">
-                <i class="save icon"></i> {{ _T("Save") }}
-            </button>
-            <input type="hidden" name="id_cotis" value="{{ contribution.id }}"/>
-            <input type="hidden" name="valid" value="1"/>
-            <input type="hidden" name="trans_id" value="{% if contribution.transaction != NULL %}{{ contribution.transaction.id }}{% endif %}"/>
-        </div>
-    {% endif %}
-            {% include "components/forms/csrf.html.twig" %}
-        </form>
-{% else %} {# No members #}
-    <div class="ui warning message" id="warningbox">
-        <h3>{{ _T("No member registered!") }}</h3>
-        <p>
-            {{ _T("Unfortunately, there is no member in your database yet,") }}
-            <br/>
-            <a href="{{ path_for("addMember") }}">{{ _T("please create a member") }}</a>
-        </p>
-    </div>
-{% endif %}
-{% endblock %}
-
-{% block javascripts %}
-<script type="text/javascript">
-    {% include "elements/js/choose_adh.js.twig" %}
-
-    $(function() {
-        /*$('#date_debut_cotis, #date_fin_cotis, #date_enreg').datepicker({
-            changeMonth: true,
-            changeYear: true,
-            showOn: 'button',
-            buttonText: '<i class="ui calendar alt icon"></i> <span class="sr-only">{{ _T("Select a date")|e("js") }}</span>'
-        });*/
-
-    {% if type == constant('Galette\\Entity\\Contribution::TYPE_FEE') and not contribution.id %}
-        $('#id_adh, #id_type_cotis').on('change', function() {
-            var _this = $(this);
-            var _member = $('#id_adh').val();
-            var _fee    = $('#id_type_cotis').val();
-
-            $.ajax({
-                type: 'POST',
-                dataType: 'json',
-                url : '{{ path_for ("contributionDates") }}',
-                data: {
-                    member_id: _member,
-                    fee_id: _fee
-                },
-                {% include "elements/js/loader.js.twig" %},
-                success: function(res){
-                    $('#date_debut_cotis').val(res.date_debut_cotis);
-                    $('#date_fin_cotis').val(res.date_fin_cotis);
-                },
-                error: function() {
-                    alert("{{ _T("An error occurred retrieving dates :(")|e("js") }}");
-                }
-            });
-
-        });
-    {% endif %}
-
-    {% if contribution.isTransactionPart() and contribution.transaction.getMissingAmount() %}
-        $('#transaction_related').hide();
-        $('#montant_cotis').on('keyup', function() {
-            var _amount = {{ contribution.transaction.getMissingAmount() }};
-            var _current = $(this).val();
-            if (_current < _amount) {
-                $('#transaction_related').show();
-            } else if (_current > _amount) {
-                alert('{{ _T("Contribution amount should be greater than %max")|replace({ '%max': contribution.transaction.getMissingAmount() })|e("js") }}');
-            } else {
-                $('#transaction_related').hide();
-            }
-        });
-    {% endif %}
-    });
-</script>
-{% endblock %}
index d0828804638c5fecab8df87c6796c376cc2f55d1..0854098d6e2a2049a92e4a9d15228248dd5a10b0 100644 (file)
@@ -1,9 +1,5 @@
-{% if mode == 'ajax' %}
-    {% set extend = 'ajax.html.twig' %}
-{% else %}
-    {% set extend = 'page.html.twig' %}
-{% endif %}
-{% extends extend %}
+{% extends (mode == 'ajax') ? "ajax.html.twig" : "page.html.twig" %}
+
 {% block content %}
         <form action="{{ path_for("payments_filter", { "type": "contributions" }) }}" method="post" id="filtre" class="ui form">
         <div class="ui segment">
diff --git a/galette/templates/gtwig/pages/members_attendance_sheet.html.twig b/galette/templates/gtwig/pages/members_attendance_sheet.html.twig
deleted file mode 100644 (file)
index 8f840bf..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-{% extends (ajax) ? "ajax.html.twig" : "page.html.twig" %}
-
-{% block content %}
-    <form action="{{ path_for('attendance_sheet') }}" id="sheet_details_form" method="POST" class="ui form">
-        <div class="ui top attached header">
-            {{ _T("Some details about your attendance sheet...") }} - <span>{{ _T("%s attendees")|replace({ '%s': selection|length }) }}</span>
-        </div>
-        <div class="ui bottom attached segment">
-            <div class="active content field">
-                <div class="inline field">
-                    <label for="sheet_type">{{ _T("Sheet type") }}</label>
-                    <input type="text" name="sheet_type" id="sheet_type" value="{{ _T("Attendance sheet") }}" required/>
-                </div>
-                <div class="inline field">
-                    <label for="sheet_title">{{ _T("Title") }}</label>
-                    <input type="text" name="sheet_title" id="sheet_title"/>
-                </div>
-                <div class="inline field">
-                    <label for="sheet_sub_title">{{ _T("Subtitle") }}</label>
-                    <input type="text" name="sheet_sub_title" id="sheet_sub_title"/>
-                </div>
-                <div class="inline field">
-                    <label for="sheet_date">{{ _T("Date") }}</label>
-                    <input type="text" name="sheet_date" id="sheet_date"/>
-                    <span class="exemple">{{ _T("(yyyy-mm-dd format)") }}</span>
-                </div>
-                <div class="inline field">
-                    <label for="sheet_photos">{{ _T("With photos?") }}</label>
-                    <input type="checkbox" name="sheet_photos" id="sheet_photos" value="1"/>
-{% for member in selection %}
-                    <input type="hidden" name="selection[]" value="{{ member }}"/>
-{% endfor %}
-                {% include 'components/forms/csrf.html.twig' %}
-                </div>
-            </div>
-        </div>
-{% if not ajax %}
-        <div class="ui basic center aligned segment">
-            <button type="submit" class="ui labeled icon primary button">
-                <i class="file pdf icon" aria-hidden="true"></i>
-                {{ _T("Generate") }}
-            </button>
-        </div>
-{% endif %}
-
-    </form>
-{% endblock %}
diff --git a/galette/templates/gtwig/pages/plugin_initdb.html.twig b/galette/templates/gtwig/pages/plugin_initdb.html.twig
deleted file mode 100644 (file)
index d45c63a..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-{% extends (mode == 'ajax') ? "ajax.html.twig" : "page.html.twig" %}
-
-{% block content %}
-<section id="plugin_install">
-    <header>
-        <h1>{{ _T("%plugin plugin installation")|replace({ '%plugin': plugin.name }) }}</h1>
-    </header>
-    <div>
-    <form action="{{ path_for('pluginInitDb', { 'id': plugid }) }}" id="plugins_initdb_form" method="post">
-        <h2>{{ page_title }}</h2>
-{% if mode == 'ajax' %}
-    {% include 'elements/messages_inline.html.twig' %}
-{% endif %}
-
-
-
-{% if step == 1 %}
-        <div id="installation_mode">
-            <article id="mode_new" class="installation_mode">
-                <h3>
-                    <input type="radio" name="install_type" value="{{ constant('Galette\\Core\\PluginInstall::INSTALL') }}" checked="checked" id="install"/>
-                    <label for="install">{{ _T("New installation") }}</label>
-                </h3>
-                <ul>
-                    <li>{{ _T("you're installing %name for the first time")|replace({ '%name': plugin.name }) }},</li>
-                    <li>{{ _T("you wish to erase an older version of of %name without keeping your data")|replace({ '%name': plugin.name }) }}.</li>
-                </ul>
-            </article>
-    {% if update_scripts is defined and update_scripts|length > 0 %}
-            <article id="mode_update" class="installation_mode">
-                <h3>
-                    <input type="radio" name="install_type" value="{{ constant('Galette\\Core\\PluginInstall::UPDATE') }}" id="update"/>
-                    <label for="update">{{ _T("Update") }}</label>
-                </h3>
-                <ul>
-                <li>{{ _T("you already have installed %name, and you want to upgrade to the latest version")|replace({ '%name': plugin.name }) }}.</li>
-                </ul>
-                <p id="warningbox">{{ _T("Warning: Don't forget to backup your current database.") }}</span>
-            </article>
-    {% endif %}
-        </div>
-{% endif %}
-{% if step == 'i2' or step == 'u2' %}
-    {{ results }}
-{% endif %}
-{% if step == 'u3' %}
-        <fieldset class="cssform">
-            <legend class="ui-state-active ui-corner-top">{{ _T("You current %name version is...")|replace({ '%name': plugin.name }) }}</legend>
-            <ul class="leaders">
-    {% set last = 0.00 %}
-    {% for k, val in update_scripts %}
-                <li>
-                    <span>
-                        <label for="upgrade-{{ val }}">
-
-        {% if last == 0.00 %}
-            {{ _T("older than %version")|replace({ '%version': val }) }}
-        {% elseif last != val %}
-            {{ _T("comprised between") }} {{ last }} {{ _T("and") }} {{ val }}
-        {% else %}
-            {{ val }}
-        {% endif %}
-        {% set last = val %}
-                        </label>
-                    </span>
-                    <span>
-                        <input type="radio" name="previous_version" value="{{ val }}" id="upgrade-{{ val }}" required/>
-                    </span>
-                </li>
-    {% endfor %}
-            </ul>
-        </fieldset>
-{% endif %}
-{% if step == 'i4' or step == 'u4' %}
-        <p>{{ _T("(Errors on DROP and RENAME operations can be ignored)") }}</p>
-    {% if error_detected|length > 0 %}
-        <p id="errorbox">
-        {% if step == 'i3' %}
-            {{ _T("The tables are not totally created, it may be a permission problem.") }}
-        {% else %}
-            {{ _T("The tables have not been totally created, it may be a permission problem.") }}
-            <br/>
-            {{ _T("Your database is maybe not usable, try to restore the older version.") }}
-        {% endif %}
-        </p>
-    {% endif %}
-{% endif %}
-{% if step == 'i5' or step =='u5' %}
-        <p>
-            {% if step == 'i5' %}
-                {{ _T("Plugin '%name' has been successfully installed!")|replace({ '%name': plugin.name }) }}
-            {% else %}
-                {{ _T("Plugin '%name' has been successfully updated!")|replace({ '%name': plugin.name }) }}
-            {% endif %}
-        </p>
-{% endif %}
-{% if istep < 5 %}
-        <p id="btn_box">
-            <input type="hidden" name="plugid" value="{{ plugid }}"/>
-    {% if istep > 1 and install_type is defined %}
-            <input type="hidden" name="install_type" value="{{ install_type }}"/>
-    {% endif %}
-    {% if error_detected|length == 0 and istep >= 2 or istep > 2 %}
-            <input type="hidden" name="install_dbperms_ok" value="1"/>
-    {% endif %}
-    {% if error_detected|length == 0 and istep >= 4 or istep > 4 %}
-            <input type="hidden" name="install_dbwrite_ok" value="1"/>
-    {% endif %}
-    {% if error_detected|length > 0 %}
-            <input type="submit" value="{{ _T("Retry") }}"/>
-    {% else %}
-            <button id="next" type="ui labeled icon button submit">{{ _T("Next step") }} <i class="forward icon"></i></button>
-    {% endif %}
-{% else %}
-    {% if mode == 'ajax' %}
-            <a href="#" class="ui  button" id="btnback">{{ _T("Close") }}</a>
-    {% else %}
-            <a href="{{ path_for('plugins') }}" class="ui labeled icon button" id="btnback"><i class="backward icon"></i> {{ _T("Back to plugins managment page") }}</a>
-    {% endif %}
-{% endif %}
-            {% include 'components/forms/csrf.html.twig' %}
-        </p>
-    </form>
-    </div>
-    <footer>
-        <p>{{ _T("Steps:") }}</p>
-        <ol>
-            <li{% if step == 1 %} class="current"{% endif %}>{{ _T("Installation mode") }} - </li>
-            <li{% if step == 'i2' or step == 'u2' %} class="current"{% endif %}>{{ _T("Access permissions to database") }} - </li>
-        {% if install_type is defined and install_type == 'upgrade' %}
-            <li{% if step == 'u3' %} class="current"{% endif %}>{{ _T("Version selection") }} - </li>
-            </li>
-        {% endif %}
-            <li{% if step == 'i4' or step == 'u4' %} class="current"{% endif %}>{% if install_type is not defined or install_type == 'install' %}{{ _T("Database installation") }}{% else %}{{ _T("Database upgrade") }}{% endif %} - </li>
-            <li{% if step == 'i5' or step == 'u5' %} class="current"{% endif %}>{{ _T("End!") }}</li>
-        </ol>
-    </footer>
-</section>
-{% endblock %}
index c0ad90e55be2a1b04727d9fdf6d259b3511925aa..518519ad5e5ee4734b2578a9aab24e497f946a90 100644 (file)
     {% else %}
             var _initdb_dialog = function(res, _plugin){
                 var _title = '{{ _T("Plugin database initialization: %name")|e('js') }}';
-                var _el = $('<div id="initdb" title="' + _title.replace('%name', _plugin) + '"> </div>');
-                _el.appendTo('body').dialog({
-                    modal: true,
-                    hide: 'fold',
-                    width: '80%',
-                    height: 500,
-                    create: function (event, ui) {
-                        if ($(window ).width() < 767) {
-                            $(this).dialog('option', {
-                                    'width': '95%',
-                                    'draggable': false
-                            });
-                        }
-                    },
-                    close: function(event, ui){
-                        _el.remove();
-                    }
-                });
+                $('body').modal({
+                    title: _title.replace('%name', _plugin),
+                    class: 'initdb-modal large coupled',
+                    classContent: 'scrolling',
+                    content: res,
+                    actions: [{
+                        text    : '{{ _T("Cancel")|e('js') }}',
+                        class   : 'red cancel',
+                        icon    : 'times'
+                    }]
+                }).modal('show');
                 _initdb_bindings(res);
             };
             var _initdb_bindings = function(res){
-                $('#initdb').empty().append(res);
-                $('#initdb input:submit, #initdb .button, #initdb input:reset' ).button();
+                //$('.initdb-modal' ).empty().append(res);
+                $('.initdb-modal input:submit, .initdb-modal .button, .initdb-modal input:reset' ).button();
                 _messagesEffects();
-                $('#btnback').click(function(){
-                    $('#initdb').dialog('close');
-                });
+                //$('#btnback').click(function(){
+                //    $('#initdb').dialog('close');
+                //});
                 $("#plugins_initdb_form").submit(function(event) {
                     /* stop form from submitting normally */
                     event.preventDefault();
index 93269c9a096f0dfbeb94c2d55afb22fe52e1992e..468afb4f6a5d308dfa4b8b85c121ab01c0308b76 100644 (file)
         </form>
 
         {% include "modals/telemetry.html.twig" with { part: "dialog" } %}
-        {% include "elements/replacements_legend.html.twig" with { legends: preferences.getLegend(), cur_ref: 'prefs' } %}
+        {% include "modals/replacements_legend.html.twig" with { legends: preferences.getLegend(), cur_ref: 'prefs' } %}
 {% endblock %}
 
 {% block javascripts %}