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
Commits
39af230d
"...fd.git" did not exist on "3487cec7afb9f1a2127e4fbc40e3995c58a05b4b"
Verified
Commit
39af230d
authored
11 months ago
by
dockx thibault
Browse files
Options
Download
Patches
Plain Diff
(templateDialog)
Fixes phpcs code style
parent
ba4cf2eb
dev
6342-update-the-locales-for-1-5
6344-template-issue-when-creating-a-template-with-empty-password-error-message-should-not-be-seen
6365-core-locking-mechanism-is-not-changing-the-mail-ressource-it-does-lock-the-mail-account
6365-core-when-lock-mechanism-is-trigger-the-user-should-not-be-editable-if-not-unlock
6378-orcid-test-method-is-wrong-and-break-orcid-saving
core-php8
master
fusiondirectory-1.5
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/management/class_templateDialog.inc
+26
-25
include/management/class_templateDialog.inc
with
26 additions
and
25 deletions
+26
-25
include/management/class_templateDialog.inc
+
26
−
25
View file @
39af230d
...
@@ -21,14 +21,15 @@
...
@@ -21,14 +21,15 @@
/*!
/*!
* \brief Template dialog handling
* \brief Template dialog handling
*/
*/
class
templateDialog
implements
FusionDirectoryDialog
class
templateDialog
implements
FusionDirectoryDialog
{
{
protected
$management
;
protected
$management
;
protected
$type
;
protected
$type
;
protected
$template
=
NULL
;
protected
$template
=
NULL
;
protected
$templates
;
protected
$templates
;
protected
$target
=
NULL
;
protected
$target
=
NULL
;
protected
$closed
=
FALSE
;
protected
$closed
=
FALSE
;
protected
$tabObject
;
protected
$tabObject
;
...
@@ -37,14 +38,14 @@ class templateDialog implements FusionDirectoryDialog
...
@@ -37,14 +38,14 @@ class templateDialog implements FusionDirectoryDialog
function
__construct
(
$management
,
$type
,
$dn
=
NULL
,
$target
=
NULL
)
function
__construct
(
$management
,
$type
,
$dn
=
NULL
,
$target
=
NULL
)
{
{
$this
->
management
=
$management
;
$this
->
management
=
$management
;
$this
->
type
=
$type
;
$this
->
type
=
$type
;
$this
->
templates
=
objects
::
getTemplates
(
$this
->
type
);
$this
->
templates
=
objects
::
getTemplates
(
$this
->
type
);
if
(
$dn
!==
NULL
)
{
if
(
$dn
!==
NULL
)
{
if
(
isset
(
$this
->
templates
[
$dn
]))
{
if
(
isset
(
$this
->
templates
[
$dn
]))
{
$this
->
template
=
new
template
(
$this
->
type
,
$dn
);
$this
->
template
=
new
template
(
$this
->
type
,
$dn
);
}
else
{
}
else
{
trigger_error
(
'Unknown template "'
.
$dn
.
'"'
);
trigger_error
(
'Unknown template "'
.
$dn
.
'"'
);
}
}
}
}
$this
->
target
=
$target
;
$this
->
target
=
$target
;
...
@@ -58,9 +59,9 @@ class templateDialog implements FusionDirectoryDialog
...
@@ -58,9 +59,9 @@ class templateDialog implements FusionDirectoryDialog
}
}
if
((
$this
->
target
===
NULL
)
&&
if
((
$this
->
target
===
NULL
)
&&
is_object
(
$this
->
template
)
&&
is_object
(
$this
->
template
)
&&
(
isset
(
$_POST
[
$this
->
post_finish
])
||
isset
(
$_GET
[
$this
->
post_finish
]))
(
isset
(
$_POST
[
$this
->
post_finish
])
||
isset
(
$_GET
[
$this
->
post_finish
]))
)
{
)
{
$this
->
template
->
readPost
();
$this
->
template
->
readPost
();
$this
->
template
->
update
();
$this
->
template
->
update
();
$this
->
handleFinish
();
$this
->
handleFinish
();
...
@@ -70,7 +71,7 @@ class templateDialog implements FusionDirectoryDialog
...
@@ -70,7 +71,7 @@ class templateDialog implements FusionDirectoryDialog
if
(
if
(
isset
(
$_POST
[
'template'
])
&&
isset
(
$_POST
[
'template'
])
&&
isset
(
$this
->
templates
[
$_POST
[
'template'
]])
isset
(
$this
->
templates
[
$_POST
[
'template'
]])
)
{
)
{
if
(
is_object
(
$this
->
template
))
{
if
(
is_object
(
$this
->
template
))
{
trigger_error
(
'redefining template object'
);
trigger_error
(
'redefining template object'
);
}
}
...
@@ -122,22 +123,22 @@ class templateDialog implements FusionDirectoryDialog
...
@@ -122,22 +123,22 @@ class templateDialog implements FusionDirectoryDialog
return
$display
;
return
$display
;
}
}
/**
/**
* @return void
* @return void
* Note : The idea is to handle the save directly at the end of the validation of the template data.
* Note : The idea is to handle the save directly at the end of the validation of the template data.
* Allowing direct saving in case of no error and opening the UI at the exact tab in case of error.
* Allowing direct saving in case of no error and opening the UI at the exact tab in case of error.
*/
*/
protected
function
handleFinish
()
protected
function
handleFinish
()
{
{
$this
->
management
->
closeDialogs
();
$this
->
management
->
closeDialogs
();
$tab
=
$this
->
template
->
apply
();
$tab
=
$this
->
template
->
apply
();
$errors
=
$tab
->
save
();
$errors
=
$tab
->
save
();
if
(
!
empty
(
$errors
))
{
if
(
!
empty
(
$errors
))
{
$this
->
management
->
openTabObject
(
$tab
);
$this
->
management
->
openTabObject
(
$tab
);
msg_dialog
::
displayChecks
(
$errors
);
msg_dialog
::
displayChecks
(
$errors
);
}
}
}
}
protected
function
handleCancel
()
protected
function
handleCancel
()
...
...
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