diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc
index 5d4a08cf724e9e37986b0dca32712ca1df510aa6..72031cfd93868a7ad1b093cc8cfdd541170052f9 100644 (file)
}
// Automatically disable pasting process since there is no entry left to paste.
}
// Automatically disable pasting process since there is no entry left to paste.
- if(!$this->cpHandler->entries_queued()){
+ if(isset($this->cpHandler) && !$this->cpHandler->entries_queued()){
$this->cpPastingStarted = FALSE;
}
return("");
$this->cpPastingStarted = FALSE;
}
return("");
*/
function removeFAIObjects($to_delete)
{
*/
function removeFAIObjects($to_delete)
{
+ // Close dialogs and remove locks for currently handled dns
+ $this->cancelEdit();
+
// Do not allow to remove objects with state freeezed
$errors = $disallowed = array();
// Do not allow to remove objects with state freeezed
$errors = $disallowed = array();
}
// Check entry locking
}
// Check entry locking
+ $smarty = get_smarty();
if(count($this->dns)){
if ($user= get_multiple_locks($this->dns)){
return(gen_locked_message($user,$this->dns));
}
if(count($this->dns)){
if(count($this->dns)){
if ($user= get_multiple_locks($this->dns)){
return(gen_locked_message($user,$this->dns));
}
if(count($this->dns)){
- $smarty = get_smarty();
+
+ // Add locks
$dns_names = array();
$dns_names = array();
+ $types = array();
+ $h = $this->getHeadpage();
+
+ // Build list of object -labels
+ foreach($h->objectTypes as $type){
+ $map[$type['objectClass']]= $type['label'];
+ }
+
foreach($this->dns as $dn){
foreach($this->dns as $dn){
- add_lock ($dn, $this->ui->dn);
- $dns_names[] = LDAP::fix($dn);
+ $tmp = $h->getType($dn);
+ if(isset($map[$tmp])){
+ $dns_names[] = '('._($map[$tmp]).') - '.LDAP::fix($dn);
+ }else{
+ $dns_names[] =LDAP::fix($dn);
+ }
}
}
- $smarty->assign("info",msgPool::deleteInfo($dns_names,_("FAI object")));
- $smarty->assign("multiple", true);
- return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+ add_lock ($this->dns, $this->ui->dn);
+
+ $smarty->assign("info",msgPool::deleteInfo($dns_names));
+ return($smarty->fetch(get_template_path('removeEntries.tpl', TRUE)));
}
}
}
}
}
}
// Now save changes
FAI::save_release_changes_now();
$to_del = FAI::clean_up_releases($this->last_dn);
// Now save changes
FAI::save_release_changes_now();
$to_del = FAI::clean_up_releases($this->last_dn);
+ $ldap= $this->config->get_ldap_link();
foreach($to_del as $dn){
$ldap->rmdir_recursive($dn);
}
foreach($to_del as $dn){
$ldap->rmdir_recursive($dn);
}
$this->fai_release = $this->fai_base;
$this->lock_name = $name;
$this->lock_dn = $bb;
$this->fai_release = $this->fai_base;
$this->lock_name = $name;
$this->lock_dn = $bb;
- $this->postremove();
+ $this->handle_post_events('remove');
$fai_filter = session::get("fai_filter");
$fai_filter['fai_release'] = $this->fai_release;
$fai_filter = session::get("fai_filter");
$fai_filter['fai_release'] = $this->fai_release;
$this->dispNewFreeze = false;
$this->dispNewFreeze = false;
- /* Postcreate */
-
/* Assign possible attributes */
$this->lock_type = $type;
$this->lock_name = $name;
$this->lock_dn = $baseToUse;
/* Assign possible attributes */
$this->lock_type = $type;
$this->lock_name = $name;
$this->lock_dn = $baseToUse;
- $this->postcreate();
+ $this->handle_post_events('add');
/* Send daemon event to reload the fai release database
*/
/* Send daemon event to reload the fai release database
*/