Commit fa3404c9 authored by Côme Chilliet's avatar Côme Chilliet

feat(template) Skip empty dialog when using automated template

If a template asked no fields, it should not show the field asking page
 and skips right away to object creation.

issue #6076
parent 1f6bb5fc
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2014-2016 FusionDirectory
Copyright (C) 2014-2020 FusionDirectory
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -129,7 +129,7 @@ class template
}
}
function getNeeded ()
function getNeeded (): array
{
return $this->attributes;
}
......
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2013-2019 FusionDirectory
Copyright (C) 2013-2020 FusionDirectory
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -56,8 +56,9 @@ class templateDialog
}
if (($this->target === NULL) &&
(isset($_POST[$this->post_finish]) || isset($_GET[$this->post_finish])) &&
is_object($this->template)) {
is_object($this->template) &&
(isset($_POST[$this->post_finish]) || isset($_GET[$this->post_finish]) || empty($this->template->getNeeded()))
) {
$this->template->save_object();
return $this->handle_finish();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment