Verified Commit f3db32db authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:sparkles: feat(public-forms) Confirmation text should be easy to edit

issue #5838
parent 3288a277
No related merge requests found
Showing with 44 additions and 11 deletions
+44 -11
...@@ -69,6 +69,11 @@ class publicForm extends simplePlugin ...@@ -69,6 +69,11 @@ class publicForm extends simplePlugin
'fdPublicFormTemplateDN', TRUE, 'fdPublicFormTemplateDN', TRUE,
array(), '', NULL array(), '', NULL
), ),
new TextAreaAttribute(
_('Confirmation text'), _('Text shown once the object is created'),
'fdPublicFormFinalText', FALSE,
'Success'
),
) )
), ),
); );
......
...@@ -34,9 +34,16 @@ attributetype ( 1.3.6.1.4.1.38414.67.10.4 NAME 'fdPublicFormTemplateDN' ...@@ -34,9 +34,16 @@ attributetype ( 1.3.6.1.4.1.38414.67.10.4 NAME 'fdPublicFormTemplateDN'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE ) SINGLE-VALUE )
attributetype ( 1.3.6.1.4.1.38414.67.10.5 NAME 'fdPublicFormFinalText'
DESC 'FusionDirectory - Final text of the public form, shown once the form is validated'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE )
# Objectclasses # Objectclasses
objectclass ( 1.3.6.1.4.1.38414.67.2.1 NAME 'fdPublicForm' objectclass ( 1.3.6.1.4.1.38414.67.2.1 NAME 'fdPublicForm'
DESC 'FusionDirectory - Public form' DESC 'FusionDirectory - Public form'
MUST ( cn ) MUST ( cn )
MAY ( fdPublicFormTitle $ fdPublicFormText $ fdPublicFormTemplateType $ fdPublicFormTemplateDN ) ) MAY ( fdPublicFormTitle $ fdPublicFormText $ fdPublicFormTemplateType $ fdPublicFormTemplateDN $ fdPublicFormFinalText ) )
...@@ -15,17 +15,27 @@ ...@@ -15,17 +15,27 @@
</div> </div>
<div id="window-content"> <div id="window-content">
<div> <div>
<p class="infotext"> {if $done}
{$form.fdPublicFormText|escape} <p class="infotext">
</p> {$form.fdPublicFormFinalText|escape}
</p>
{else}
<p class="infotext">
{$form.fdPublicFormText|escape}
</p>
<br/> <br/>
{$template_dialog} {$template_dialog}
{/if}
</div> </div>
</div> </div>
{if !$done} {if !$done}
<div id="window-footer" class="plugbottom"> <div id="window-footer" class="plugbottom">
<input type="submit" id="form_submit" name="form_submit" value="{msgPool type=okButton}"/> <div>
</div>
<div>
<input type="submit" id="form_submit" name="form_submit" value="{msgPool type=okButton}"/>
</div>
</div> </div>
{/if} {/if}
</form> </form>
......
...@@ -43,7 +43,20 @@ class publicFormPage extends standAlonePage ...@@ -43,7 +43,20 @@ class publicFormPage extends standAlonePage
if (!isset($this->form) && isset($_GET['form'])) { if (!isset($this->form) && isset($_GET['form'])) {
/* Search for the form object */ /* Search for the form object */
$forms = objects::ls('publicForm', array('dn' => 'raw', 'cn' => 1, 'fdPublicFormTitle' => 1, 'fdPublicFormText' => 1, 'fdPublicFormTemplateType' => 1, 'fdPublicFormTemplateDN' => 1), NULL, '(cn='.ldap_escape_f($_GET['form']).')'); $forms = objects::ls(
'publicForm',
array(
'dn' => 'raw',
'cn' => 1,
'fdPublicFormTitle' => 1,
'fdPublicFormText' => 1,
'fdPublicFormFinalText' => 1,
'fdPublicFormTemplateType' => 1,
'fdPublicFormTemplateDN' => 1
),
NULL,
'(cn='.ldap_escape_f($_GET['form']).')'
);
if (count($forms) <= 0) { if (count($forms) <= 0) {
throw new FusionDirectoryException('Form "'.$_GET['form'].'" could not be found'); throw new FusionDirectoryException('Form "'.$_GET['form'].'" could not be found');
} elseif (count($forms) > 1) { } elseif (count($forms) > 1) {
...@@ -81,9 +94,7 @@ class publicFormPage extends standAlonePage ...@@ -81,9 +94,7 @@ class publicFormPage extends standAlonePage
$this->assignSmartyVars(); $this->assignSmartyVars();
if ($this->done) { if (!$this->done) {
$smarty->assign('template_dialog', _('Object created successfully'));
} else {
$templateOutput = $this->template->execute(); $templateOutput = $this->template->execute();
if ($this->template->dialogOpened()) { if ($this->template->dialogOpened()) {
//~ TODO //~ TODO
......
  • SonarQube analysis reported 1 issue

    • :information_source: 1 info

    Note: The following issues were found on lines that were not modified in the commit. Because these issues can't be reported as line comments, they are summarized here:

    1. :information_source: Complete the task associated to this "TODO" comment. :blue_book:
Supports Markdown
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