-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
N°3366 - Multiple target state on approbal-extended #7
base: master
Are you sure you want to change the base?
N°3366 - Multiple target state on approbal-extended #7
Conversation
Sounds interesting, does that mean it could be used to have a ruleset for In your example I see it went from |
Yes, this is the target. |
Okay, so the transitions from starting state towards ending state should be named exactly |
There are a lot of logs, because the code is not finished yet. I still have to do a lot of tests to validate this code. To not forget what I did I have already created the PR. I will have time in August to finish it. |
Sure, I gave suggestions to apply correct line indentations and log debug messages as actual debug, not error ;) |
Support PRs review:
Good :
Sounds nice! Will take a closer look. |
Co-authored-by: Thomas Casteleyn <[email protected]>
Co-authored-by: Molkobain <[email protected]>
Co-authored-by: Molkobain <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentations sometimes still not correct. (Is your IDE correctly configured?)
Also, what with users that already have customised their config? Shouldn't there be a migration method during iTop Setup? Currently the old config is ignored and reverted to default.
Totally, the config migration was asked during the support PRs review:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The installer looks good 👍
Co-authored-by: Thomas Casteleyn <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, the code looks much more readable now. Some minor remarks:
// Replacing old conf parameters value to indicate that it is obsolete | ||
$aParamsToRemove = array('target_states', 'bypass_profiles', 'reuse_previous_answers'); | ||
foreach($aParamsToRemove as $sParamToRemove) | ||
{ | ||
$sParamCurrentValue = $oConfiguration->GetModuleSetting('combodo-approval-extended', $sParamToRemove, null); | ||
if(!empty($sParamCurrentValue)) | ||
{ | ||
$oConfiguration->SetModuleSetting('combodo-approval-extended', $sParamToRemove, 'No longer used, you can remove this parameter.'); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this section, since you said this: https://github.com/Combodo/combodo-approval-extended/pull/7/files#r1763440755
$newConfiguration = [ | ||
'UserRequest' => [ | ||
'target_states' => [$oConfiguration->GetModuleSetting('combodo-approval-extended', 'target_states', null) ], | ||
'bypass_profiles' =>$oConfiguration->GetModuleSetting('combodo-approval-extended', 'bypass_profiles', 'Service Manager') , | ||
'reuse_previous_answers' => $oConfiguration->GetModuleSetting('combodo-approval-extended', 'reuse_previous_answers', true) , | ||
] | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still some indentation problem, a typo and to keep backward compatibility, the admin profile should also be included when migrating.
$newConfiguration = [ | |
'UserRequest' => [ | |
'target_states' => [$oConfiguration->GetModuleSetting('combodo-approval-extended', 'target_states', null) ], | |
'bypass_profiles' =>$oConfiguration->GetModuleSetting('combodo-approval-extended', 'bypass_profiles', 'Service Manager') , | |
'reuse_previous_answers' => $oConfiguration->GetModuleSetting('combodo-approval-extended', 'reuse_previous_answers', true) , | |
] | |
]; | |
$newConfiguration = [ | |
'UserRequest' => [ | |
'target_states' => [$oConfiguration->GetModuleSetting('combodo-approval-extended', 'target_state', 'new')], | |
'bypass_profiles' => $oConfiguration->GetModuleSetting('combodo-approval-extended', 'bypass_profiles', 'Administrator, Service Manager'), | |
'reuse_previous_answers' => $oConfiguration->GetModuleSetting('combodo-approval-extended', 'reuse_previous_answers', true), | |
] | |
]; |
$aAllowedClasses = MetaModel::GetConfig()->GetModuleSetting('combodo-approval-extended', 'targets', ApprovalConfiguration::DEFAULT_TARGET); | ||
if (array_key_exists(get_class($oObject), $aAllowedClasses) === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would make more sense later in the code when this var is named differently..
$aAllowedClasses = MetaModel::GetConfig()->GetModuleSetting('combodo-approval-extended', 'targets', ApprovalConfiguration::DEFAULT_TARGET); | |
if (array_key_exists(get_class($oObject), $aAllowedClasses) === false) { | |
$aTargets = MetaModel::GetConfig()->GetModuleSetting('combodo-approval-extended', 'targets', ApprovalConfiguration::DEFAULT_TARGET); | |
if (array_key_exists(get_class($oObject), $aTargets) === false) { |
need change in approval base (branche feature/3366-Add_status_informations_on_approval )
Allows you to configure which classes are affected by the approval and from which statuses. Multiple starting statuses are allowed for a class.
new configuration for this module:
You can configure different triggers to send different messages for approval:
Different approval stages are visible on the object in the Approval tab with the starting and ending status (thanks to the functionality implemented in the approval-base)