$error_detected = [];
$warning_detected = [];
+ if (isset($post['cancel'])) {
+ return $response
+ ->withStatus(301)
+ ->withHeader('Location', $this->cancelUri($this->getArgs($request)));
+ }
+
$df = DynamicField::getFieldType($this->zdb, $post['field_type']);
try {
$post = $request->getParsedBody();
$post['form_name'] = $form_name;
+ if (isset($post['cancel'])) {
+ return $response
+ ->withStatus(301)
+ ->withHeader('Location', $this->cancelUri($this->getArgs($request)));
+ }
+
$error_detected = [];
$warning_detected = [];
*/
public function redirectUri(array $args)
{
- return $this->routeparser->urlFor('configureDynamicFields');
+ return $this->routeparser->urlFor('configureDynamicFields', ['form_name' => $args['form_name']]);
}
/**
): Response {
$post = $request->getParsedBody();
+ if (isset($post['cancel'])) {
+ return $response
+ ->withStatus(301)
+ ->withHeader('Location', $this->cancelUri($this->getArgs($request)));
+ }
+
$error_detected = [];
$msg = null;
<button type="submit" class="ui labeled icon primary button action">
<i class="save icon"></i> {{ _T("Save") }}
</button>
+ <input type="submit" name="cancel" value="{{ _T("Cancel") }}" class="ui button"/>
+ <input type="hidden" name="form_name" id="form_name" value="{{ form_name }}"/>
</div>
{% endif %}
{% include "components/forms/csrf.html.twig" %}
<button type="submit" name="valid" class="ui labeled icon primary button action">
<i class="plus icon"></i> {{ _T("Add") }}
</button>
+ <input type="submit" name="cancel" value="{{ _T("Cancel") }}" class="ui button"/>
{% endif %}
<input type="hidden" name="form_name" id="form_name" value="{{ form_name }}"/>
{% if mode == 'ajax' %}
<label for="{{ name }}">{{ _T("Name:") }}</label>
<input type="text" name="{{ name }}" id="{{ name }}" value="{% if class == 'Status' %}{{ entry.libelle_statut }}{% else %}{{ entry.libelle_type_cotis }}{% endif %}" />
</div>
- <div class="field inline">
{% if class == 'Status' %}
+ <div class="field inline">
<label for="{{ field }}">
{{ _T("Priority:") }}
</label>
<i class="save icon"></i>
{{ _T("Save") }}
</button>
+ <input type="submit" name="cancel" value="{{ _T("Cancel") }}" class="ui button"/>
</div>
{% endif %}
{% include 'components/forms/csrf.html.twig' %}