Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fusiondirectory
fusiondirectory
Commits
990c67f0
Commit
990c67f0
authored
Mar 27, 2019
by
Côme Chilliet
Browse files
🚑
fix(management) Fix configuration dialog for select classes
issue
#5965
parent
4d951e7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/management/class_ManagementConfigurationDialog.inc
View file @
990c67f0
...
...
@@ -133,6 +133,40 @@ class ManagementConfigurationDialog extends simplePlugin
}
}
function
save_object
()
{
parent
::
save_object
();
if
(
isset
(
$_POST
[
'edit_cancel'
]))
{
$this
->
handle_cancel
();
}
elseif
(
isset
(
$_POST
[
'edit_finish'
]))
{
$this
->
handle_finish
();
}
}
protected
function
handle_finish
()
{
$msgs
=
$this
->
check
();
if
(
count
(
$msgs
))
{
msg_dialog
::
displayChecks
(
$msgs
);
return
;
}
else
{
$errors
=
$this
->
save
();
if
(
count
(
$errors
))
{
msg_dialog
::
displayChecks
(
$errors
);
return
;
}
else
{
$this
->
parent
->
remove_lock
();
$this
->
parent
->
closeDialogs
();
}
}
}
protected
function
handle_cancel
()
{
$this
->
parent
->
remove_lock
();
$this
->
parent
->
closeDialogs
();
}
function
execute
():
string
{
global
$config
,
$ui
;
...
...
include/management/class_management.inc
View file @
990c67f0
...
...
@@ -366,7 +366,7 @@ class management
throw
new
FusionDirectoryException
(
'No valid listing object'
);
}
$action
=
[
'targets'
=>
[],
'action'
=>
''
,
'subaction'
=>
NULL
];
if
(
$this
->
is_modal_dialog
())
{
if
(
$this
->
showTabFooter
())
{
if
(
isset
(
$_POST
[
'edit_cancel'
]))
{
$action
[
'action'
]
=
'cancel'
;
}
elseif
(
isset
(
$_POST
[
'edit_finish'
]))
{
...
...
@@ -374,7 +374,7 @@ class management
}
elseif
(
isset
(
$_POST
[
'edit_apply'
]))
{
$action
[
'action'
]
=
'apply'
;
}
}
else
{
}
else
if
(
!
$this
->
dialogOpened
())
{
if
(
isset
(
$_POST
[
'delete_confirmed'
]))
{
$action
[
'action'
]
=
'removeConfirmed'
;
}
elseif
(
isset
(
$_POST
[
'delete_cancel'
]))
{
...
...
@@ -451,7 +451,7 @@ class management
}
if
(
method_exists
(
$this
->
dialogObject
,
'execute'
))
{
$display
=
$this
->
dialogObject
->
execute
();
$display
.
=
$this
->
_
getTabFooter
();
$display
.
=
$this
->
getTabFooter
();
return
$this
->
getHeader
()
.
$display
;
}
}
...
...
@@ -460,7 +460,7 @@ class management
if
(
$this
->
tabObject
instanceOf
simpleTabs
)
{
$this
->
tabObject
->
save_object
();
$display
=
$this
->
tabObject
->
execute
();
$display
.
=
$this
->
_
getTabFooter
();
$display
.
=
$this
->
getTabFooter
();
return
$this
->
getHeader
()
.
$display
;
}
...
...
@@ -554,7 +554,7 @@ class management
}
}
function
is_modal_
dialog
():
bool
function
dialog
Opened
():
bool
{
return
(
is_object
(
$this
->
tabObject
)
||
is_object
(
$this
->
dialogObject
));
}
...
...
@@ -608,17 +608,30 @@ class management
}
/*!
* \brief
Generates
the footer
which is used whenever a tab object is displayed.
* \brief
Whe
the
r
footer
buttons should appear
*/
protected
function
_get
TabFooter
():
string
protected
function
show
TabFooter
():
bool
{
// Do not display tab footer for non tab objects
if
(
!
(
$this
->
tabObject
instanceOf
simpleTabs
))
{
return
''
;
return
FALSE
;
}
// Check if there is a dialog opened - We don't need any buttons in this case.
if
(
$this
->
tabObject
->
dialogOpened
())
{
return
FALSE
;
}
return
TRUE
;
}
/*!
* \brief Generates the footer which is used whenever a tab object is displayed.
*/
protected
function
getTabFooter
():
string
{
// Do not display tab footer for non tab objects
if
(
!
$this
->
showTabFooter
())
{
return
''
;
}
...
...
@@ -814,7 +827,7 @@ class management
}
/*!
* \brief Editing an object was caneled.
* \brief Editing an object was can
c
eled.
* Close dialogs/tabs and remove locks.
*/
function
cancelEdit
()
...
...
@@ -850,23 +863,6 @@ class management
$this
->
remove_lock
();
$this
->
closeDialogs
();
}
}
elseif
(
$this
->
dialogObject
instanceOf
simplePlugin
)
{
$this
->
dialogObject
->
save_object
();
$msgs
=
$this
->
dialogObject
->
check
();
if
(
count
(
$msgs
))
{
msg_dialog
::
displayChecks
(
$msgs
);
return
;
}
else
{
$errors
=
$this
->
dialogObject
->
save
();
if
(
count
(
$errors
))
{
msg_dialog
::
displayChecks
(
$errors
);
return
;
}
else
{
@
DEBUG
(
DEBUG_TRACE
,
__LINE__
,
__FUNCTION__
,
__FILE__
,
$this
->
currentDns
,
'Dialog saved'
);
$this
->
remove_lock
();
$this
->
closeDialogs
();
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment