Bloque la suppression d'entité ou d'organisation ayant des filles
This commit is contained in:
parent
e83c63e0de
commit
afe35d65c6
|
@ -20,6 +20,15 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
function before_delete_entite($object) {
|
||||
$entite = new LSsupannEntite();
|
||||
if ($entite->listChildren($object)) {
|
||||
LSerror::addErrorCode('Cette entité a des entités filles, vous ne pouvez pas la supprimer');
|
||||
return false;
|
||||
}
|
||||
return $false;
|
||||
}
|
||||
|
||||
$GLOBALS['LSobjects']['LSsupannEntite'] = array (
|
||||
'objectclass' => array(
|
||||
'supannEntite',
|
||||
|
@ -31,6 +40,9 @@ $GLOBALS['LSobjects']['LSsupannEntite'] = array (
|
|||
'label' => 'Entités',
|
||||
'displayAttrName' => true,
|
||||
|
||||
// triggers
|
||||
'before_delete' => 'before_delete_entite',
|
||||
|
||||
// LSform
|
||||
'LSform' => array (
|
||||
'ajaxSubmit' => 1,
|
||||
|
|
|
@ -20,6 +20,15 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
function before_delete_organization($object) {
|
||||
$org = new LSsupannEntite();
|
||||
if ($org->listChildren($object)) {
|
||||
LSerror::addErrorCode('Cette organisation a des entités filles, vous ne pouvez pas la supprimer');
|
||||
return false;
|
||||
}
|
||||
return $false;
|
||||
}
|
||||
|
||||
$GLOBALS['LSobjects']['LSsupannOrg'] = array (
|
||||
'objectclass' => array(
|
||||
'organization',
|
||||
|
@ -33,6 +42,9 @@ $GLOBALS['LSobjects']['LSsupannOrg'] = array (
|
|||
'label' => 'Organisations',
|
||||
'displayAttrName' => true,
|
||||
|
||||
// triggers
|
||||
'before_delete' => 'before_delete_organization',
|
||||
|
||||
// LSform
|
||||
'LSform' => array (
|
||||
'ajaxSubmit' => 1,
|
||||
|
|
Reference in New Issue