Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
fusiondirectory
fusiondirectory-plugins
Commits
3288a277
Verified
Commit
3288a277
authored
6 years ago
by
Côme Chilliet
Browse files
Options
Download
Patches
Plain Diff
feat(public-forms) Added object creation to public forms
issue
#5838
parent
b37fc6d8
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
public-forms/ihtml/themes/breezy/public-form.tpl
+3
-1
public-forms/ihtml/themes/breezy/public-form.tpl
public-forms/include/class_publicFormPage.inc
+25
-12
public-forms/include/class_publicFormPage.inc
with
28 additions
and
13 deletions
+28
-13
public-forms/ihtml/themes/breezy/public-form.tpl
+
3
−
1
View file @
3288a277
...
@@ -23,9 +23,11 @@
...
@@ -23,9 +23,11 @@
{
$template_dialog
}
{
$template_dialog
}
</div>
</div>
</div>
</div>
{
if
!
$done
}
<div
id=
"window-footer"
class=
"plugbottom"
>
<div
id=
"window-footer"
class=
"plugbottom"
>
<input
type=
"submit"
name=
"form_submit"
value=
"
{
msgPool
type
=
okButton
}
"
/>
<input
type=
"submit"
id=
"form_submit"
name=
"form_submit"
value=
"
{
msgPool
type
=
okButton
}
"
/>
</div>
</div>
{/
if
}
</form>
</form>
</div>
</div>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
public-forms/include/class_publicFormPage.inc
+
25
−
12
View file @
3288a277
...
@@ -22,6 +22,7 @@ class publicFormPage extends standAlonePage
...
@@ -22,6 +22,7 @@ class publicFormPage extends standAlonePage
{
{
protected
$form
;
protected
$form
;
protected
$template
;
protected
$template
;
protected
$done
;
function
readLdapConfig
()
function
readLdapConfig
()
{
{
...
@@ -36,6 +37,10 @@ class publicFormPage extends standAlonePage
...
@@ -36,6 +37,10 @@ class publicFormPage extends standAlonePage
return
;
return
;
}
}
if
(
$this
->
done
)
{
return
;
}
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
,
'fdPublicFormTemplateType'
=>
1
,
'fdPublicFormTemplateDN'
=>
1
),
NULL
,
'(cn='
.
ldap_escape_f
(
$_GET
[
'form'
])
.
')'
);
...
@@ -52,13 +57,15 @@ class publicFormPage extends standAlonePage
...
@@ -52,13 +57,15 @@ class publicFormPage extends standAlonePage
$this
->
template
->
save_object
();
$this
->
template
->
save_object
();
//~ $success = TRUE;
if
(
isset
(
$_POST
[
'form_submit'
]))
{
//~ /* Do we need to show error messages? */
$tabobject
=
$this
->
template
->
apply
();
//~ if (count($this->message) != 0) {
$errors
=
$tabobject
->
save
();
//~ /* Show error message and continue editing */
if
(
empty
(
$errors
))
{
//~ msg_dialog::displayChecks($this->message);
$this
->
done
=
TRUE
;
//~ $success = FALSE;
}
else
{
//~ }
msg_dialog
::
displayChecks
(
$errors
);
}
}
}
}
...
@@ -74,14 +81,20 @@ class publicFormPage extends standAlonePage
...
@@ -74,14 +81,20 @@ class publicFormPage extends standAlonePage
$this
->
assignSmartyVars
();
$this
->
assignSmartyVars
();
$templateOutput
=
$this
->
template
->
execute
();
if
(
$this
->
done
)
{
if
(
$this
->
template
->
dialogOpened
())
{
$smarty
->
assign
(
'template_dialog'
,
_
(
'Object created successfully'
));
//~ TODO
return
$templateOutput
;
}
else
{
}
else
{
$smarty
->
assign
(
'template_dialog'
,
$templateOutput
);
$templateOutput
=
$this
->
template
->
execute
();
if
(
$this
->
template
->
dialogOpened
())
{
//~ TODO
return
$templateOutput
;
}
else
{
$smarty
->
assign
(
'template_dialog'
,
$templateOutput
);
}
}
}
$smarty
->
assign
(
'done'
,
$this
->
done
);
$smarty
->
assign
(
'form'
,
$this
->
form
);
$smarty
->
assign
(
'form'
,
$this
->
form
);
$smarty
->
append
(
'css_files'
,
get_template_path
(
'login.css'
));
$smarty
->
append
(
'css_files'
,
get_template_path
(
'login.css'
));
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets