summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fe868cb)
raw | patch | inline | side by side (parent: fe868cb)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 14 Jun 2006 04:28:15 +0000 (04:28 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 14 Jun 2006 04:28:15 +0000 (04:28 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3802 594d385d-05f5-0310-b6e9-bd551577e9d8
index a80b8511b71063ac86fbf91e4ab637f8354b6bc2..dda58a731aba9b18f6921aae455172fdeb7c8187 100644 (file)
--- a/include/class_plugin.inc
+++ b/include/class_plugin.inc
$ui = get_userinfo();
$tmp = array();
$ldap_to->cd($new_base);
- $ldap_to->search("(&(objectClass=gosaSnapshotObject))",array("gosaSnapshotType","gosaSnapshotTimestamp","gosaSnapshotDN","description"));
+ $ldap_to->ls("(&(objectClass=gosaSnapshotObject))",$new_base,array("gosaSnapshotType","gosaSnapshotTimestamp","gosaSnapshotDN","description"));
while($entry = $ldap_to->fetch()){
+
+ $chk = str_replace($base,"",$entry['gosaSnapshotDN'][0]);
+ if(preg_match("/,ou=/",$chk)) continue;
+
if(!isset($entry['description'][0])){
$entry['description'][0] = "";
}
}
}
+
+
/* Format result as requested */
if($raw) {
return($tmp);
diff --git a/plugins/admin/departments/class_departmentManagement.inc b/plugins/admin/departments/class_departmentManagement.inc
index b095805fbf705cdd7a464ffbadfd8180f277bd5d..eeb9d53eae2bd18050a6a8c2a828b4a489927d1f 100644 (file)
* The entry which will be edited is defined in $s_entry
*/
if (( $s_action=="edit") && (!isset($this->deptabs->config))){
+ $s_entry = convert_department_dn(base64_decode($s_entry));
$this->dn= $this->config->departments[trim($s_entry)];
if (($user= get_lock($this->dn)) != ""){
* The entry which will be deleted is defined in $s_entry
*/
if ($s_action =="del"){
+ $s_entry = convert_department_dn(base64_decode($s_entry));
$this->dn= $this->config->departments[trim($s_entry)];
/* Check locking */
}
return ($display);
}else{
+
+ /* Check if there is a snapshot dialog open */
+ if($str = $this->showSnapshotDialog($this->DivListDepartment->selectedBase,"")){
+ return($str);
+ }
+
/* Display dialog with group list */
$this->DivListDepartment->parent = $this;
$this->DivListDepartment->execute();
}
$this->departments= array();
+ $tmp = array();
foreach ($res as $key => $value){
-
+ #$tmp[get_sub_department(convert_department_dn($value['dn']))] = $key;
+ $tmp[$key] = get_sub_department(convert_department_dn($value['dn']));
+ }
+ natcasesort($tmp);
+ foreach($tmp as $key => $q){
+ $value = $res [$key];
/* Don't display base as entry on subsearch */
if(($value['dn'] == $base) && ($this->DivListDepartment->SubSearch)){
continue;
}
- $cdn= convert_department_dn($value['dn']);
-
- /* Append to dep list */
- if(isset($value["description"][0])){
- $this->departments[$cdn]= get_sub_department($cdn)." - [".$value["description"][0]."]";
- }else{
- $this->departments[$cdn]= get_sub_department($cdn);//$value["description"][0];
- }
+ $this->departments[base64_encode($value['dn'])]= $value;
}
- natcasesort ($this->departments);
- reset ($this->departments);
}
function remove_from_parent()
diff --git a/plugins/admin/departments/class_divListDepartment.inc b/plugins/admin/departments/class_divListDepartment.inc
index 4eaea028be39dbd20e7ed3a3b0e4a0ef341d1ba0..cda30ee7fd4ecefedbd71e40956c11defa32856b 100755 (executable)
/* set Page header */
$this->AddHeader(array("string" => " ", "attach" => "style='text-align:center;width:20px;'"));
$this->AddHeader(array("string"=>_("Department name"), "attach" => "style=''"));
- $this->AddHeader(array("string" =>_("Actions"), "attach" => "style='width:60px;border-right:0px;text-align:right;'"));
-
+ $this->AddHeader(array("string" =>_("Actions"), "attach" => "style='width:80px;border-right:0px;text-align:right;'"));
/* Add SubSearch checkbox */
$this->AddCheckBox("SubSearch", _("Select to search within subtrees"), _("Ignore subtrees"), false);
}
/* Generate list head */
- $listhead = "<div style='background:#F0F0F9;padding:5px;'>".
- " <input type='image' class='center' src='images/list_root.png' align='middle' title='"._("Go to root department")."' name='dep_root' alt='". _("Root")."'> ".
- " <input type='image' class='center' src='images/list_up.png' align='middle' title='"._("Go up one department")."' name='dep_back' alt='"._("Up"). "'> ".
- " <input type='image' class='center' src='images/list_home.png' align='middle' title='"._("Go to users home department")."' name='dep_home' alt='". _("Home")."'> ".
- " <input class='center' type='image' src='images/list_reload.png' align='middle' title='"._("Reload list")."' name='submit_department' alt='". _("Submit")."'> ".
- " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
- " <input class='center' type='image' src='images/list_new_department.png' align='middle' alt='"._("Create new department")."' name='dep_new'> ".
- " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
- _("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
- " <input class='center' type='image' src='images/list_submit.png' align='middle' title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'> ".
- "</div>";
+ $listhead = "<div style='background:#F0F0F9;padding:5px;'>".
+ " <input type='image' class='center' src='images/list_root.png' align='middle'
+ title='"._("Go to root department")."' name='dep_root' alt='". _("Root")."'> ".
+ " <input type='image' class='center' src='images/list_up.png' align='middle'
+ title='"._("Go up one department")."' name='dep_back' alt='"._("Up"). "'> ".
+ " <input type='image' class='center' src='images/list_home.png' align='middle'
+ title='"._("Go to users home department")."' name='dep_home' alt='". _("Home")."'> ".
+ " <input class='center' type='image' src='images/list_reload.png' align='middle'
+ title='"._("Reload list")."' name='submit_department' alt='". _("Submit")."'> ".
+ " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+
+ if($this->parent->snapshotEnabled()){
+ $listhead .= " <input class='center' type='image' align='middle' src='images/restore.png'
+ title='"._("Restore snapshopts of already deleted objects")."' alt='"._("Restore")."' name='RestoreDeletedSnapShot'>".
+ " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+ }
+
+ $listhead .= " <input class='center' type='image' src='images/list_new_department.png'
+ align='middle' alt='"._("Create new department")."' name='dep_new'> ".
+ " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
+ _("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
+ " <input class='center' type='image' src='images/list_submit.png' align='middle'
+ title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'> ".
+ "</div>";
$this->SetListHeader($listhead);
}
function setEntries($list)
{
- $actions= "<input class='center' type='image' src='images/edit.png'
- alt='"._("edit")."' name='dep_edit_%KEY%' title='"._("Edit this entry")."'>";
- $actions.= "<input class='center' type='image' src='images/edittrash.png'
- alt='"._("delete")."' name='dep_del_%KEY%' title='"._("Delete this entry")."'>";
$linkopen = "<a href='?plug=".$_GET['plug']."&act=dep_open&dep_id=%s'>%s</a>";
foreach($list as $key => $val) {
+
+ $cdn= convert_department_dn($val['dn']);
+ if(isset($val["description"][0])) {
+ $disp = get_sub_department($cdn)." - [".$val["description"][0]."]";
+ }else{
+ $disp = get_sub_department($cdn);
+ }
+
+ $actions = $this->GetSnapShotActions($val['dn']);
+ $actions.= "<input class='center' type='image' src='images/edit.png'
+ alt='"._("edit")."' name='dep_edit_%KEY%' title='"._("Edit this entry")."'>";
+ $actions.= "<input class='center' type='image' src='images/edittrash.png'
+ alt='"._("delete")."' name='dep_del_%KEY%' title='"._("Delete this entry")."'>";
+
if(!isset($this->config->departments[trim($key)])){
$this->config->departments[trim($key)]="";
}
$title = preg_replace('/ /', ' ', @LDAP::fix($this->config->departments[$key]));
$field0 = array("string" => "<img src='images/".$non_empty."folder.png' title='"._("department")."' alt='department'>", "attach" => "style='text-align:center;width:20px;'");
- $field1 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style='' title='".$title."'");
- $field2 = array("string" => preg_replace("/%KEY%/", base64_encode($key), $actions), "attach" => "style='width:60px;border-right:0px;text-align:
+ $field1 = array("string" => sprintf($linkopen,base64_encode($cdn),$disp), "attach" => "style='' title='".$title."'");
+ $field2 = array("string" => preg_replace("/%KEY%/", base64_encode($key), $actions), "attach" => "style='width:80px;border-right:0px;text-align:
right;'");
$this->AddElement( array($field0,$field1,$field2));
diff --git a/plugins/admin/ogroups/class_divListOGroup.inc b/plugins/admin/ogroups/class_divListOGroup.inc
index 9fc480e268aee51c26fa330939e373af705cf2f3..eda23fd0169ad6890eea6e191f9e5a59c194df14 100755 (executable)
$this->AddHeader(array("string" => " ", "attach" => "style='text-align:center;width:20px;'"));
$this->AddHeader(array("string" => _("Name of object groups")." / "._("Departments"), "attach" => "style=''"));
$this->AddHeader(array("string" => _("Properties"), "attach" => "style='width:136px;'"));
- $this->AddHeader(array("string" => _("Actions"), "attach" => "style='width:107px;border-right:0px;text-align:right;'"));
+ $this->AddHeader(array("string" => _("Actions"), "attach" => "style='width:130px;border-right:0px;text-align:right;'"));
/* Text ,Value ,Name ,Is selected */
$this->AddCheckBox("UserGroups" , _("Select to see groups containing users") , _("Show groups containing users"), true);
// Managment
$listhead = "<div style='background:#F0F0F9;padding:5px;'>".
" <input class='center' type='image' src='images/list_root.png' align='middle'
- title='"._("Go to root department")."' name='dep_root' alt='"._("Root")."'> ".
+ title='"._("Go to root department")."' name='dep_root' alt='"._("Root")."'> ".
" <input class='center' type='image' align='middle' src='images/list_back.png'
- title='"._("Go up one department")."' alt='"._("Up")."' name='dep_back'> ".
+ title='"._("Go up one department")."' alt='"._("Up")."' name='dep_back'> ".
" <input class='center' type='image' align='middle' src='images/list_home.png'
- title='"._("Go to users department")."' alt='"._("Home")."' name='dep_home'> ".
- " <input class='center' type='image' src='images/list_reload.png' align='middle'
- title='"._("Reload list")."' name='submit_department' alt='"._("Submit")."'> ".
- " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
- " <input class='center' type='image' align='middle' src='images/list_new_ogroup.png'
- title='"._("Create new object group")."' alt='"._("new")."' name='group_new'>".
+ title='"._("Go to users department")."' alt='"._("Home")."' name='dep_home'> ".
+ " <input class='center' type='image' src='images/list_reload.png' align='middle'
+ title='"._("Reload list")."' name='submit_department' alt='"._("Submit")."'> ".
+ " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+
+ if($this->parent->snapshotEnabled()){
+ $listhead .= " <input class='center' type='image' align='middle' src='images/restore.png'
+ title='"._("Restore snapshopts of already deleted objects")."' alt='"._("Restore")."' name='RestoreDeletedSnapShot'>".
+ " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+ }
+
+
+ $listhead .=" <input class='center' type='image' align='middle' src='images/list_new_ogroup.png'
+ title='"._("Create new object group")."' alt='"._("new")."' name='group_new'>".
$Copy_Paste.
" <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
_("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
" <input class='center' type='image' src='images/list_submit.png' align='middle'
- title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'> ".
+ title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'> ".
"</div>";
-
+
$this->SetListHeader($listhead);
}
{
/* Add Copy & Paste buttons if copy&paste is enabled
*/
- /* Create action icons */
- $actions = "";
- if($this->parent->CopyPasteHandler){
- $actions.= "<input class='center' type='image'
- src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
- $actions.= "<input class='center' type='image'
- src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }
- $actions.= "<input class='center' type='image'
- src='images/edit.png' alt='"._("edit")."' name='group_edit_%KEY%' title='"._("Edit this entry")."'>";
- $actions.= "<input class='center' type='image'
- src='images/edittrash.png' alt='"._("delete")."' name='group_del_%KEY%' title='"._("Delete this entry")."'>";
-
// Defining Links
$linkopen = "<a href='?plug=".$_GET['plug']."&act=dep_open&dep_id=%s'>%s</a>";
$editlink = "<a href='?plug=".$_GET['plug']."&id=%s&act=edit_entry'>%s</a>";
// Assigning ogroups
foreach($list as $key => $val){
+ /* Create action icons */
+ $actions = $this->GetSnapShotActions($val['dn']);
+ if($this->parent->CopyPasteHandler){
+ $actions.= "<input class='center' type='image'
+ src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
+ $actions.= "<input class='center' type='image'
+ src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
+ }
+ $actions.= "<input class='center' type='image'
+ src='images/edit.png' alt='"._("edit")."' name='group_edit_%KEY%' title='"._("Edit this entry")."'>";
+ $actions.= "<input class='center' type='image'
+ src='images/edittrash.png' alt='"._("delete")."' name='group_del_%KEY%' title='"._("Delete this entry")."'>";
+
+
if(isset($val['mail'])){
$mail = $mailimg;
}else{
$field1 = array("string" => "<img src='images/list_ogroup.png' alt='"._("Object group")."' ".$title.">", "attach" => "style='text-align:center;width: 20px;'");
$field2 = array("string" => sprintf($editlink,$key,($val['cn']['0'].$desc)), "attach" => "style='' ".$title);
$field3 = array("string" => preg_replace("/%KEY/", $key, $this->parent->convert_list($val))." ".$mail, "attach" => "style='width:136px;'");
- $field4 = array("string" => preg_replace("/%KEY%/", $key, $actions), "attach" => "style='width:107px;border-right:0px;text-align:right;'");
+ $field4 = array("string" => preg_replace("/%KEY%/", $key, $actions), "attach" => "style='width:130px;border-right:0px;text-align:right;'");
$this->AddElement(array($field1,$field2,$field3,$field4));
}
diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc
index ced638067314d75935daf0ae0f90306f8cac3d95..3142979c018c07979473ff3530dcfea6820d0668 100644 (file)
Display list
****************/
+ /* Check if there is a snapshot dialog open */
+ if($str = $this->showSnapshotDialog($this->DivListOGroup->selectedBase,get_groups_ou())){
+ return($str);
+ }
+
/* Display dialog with group list */
$this->DivListOGroup->parent = $this;
$this->DivListOGroup->execute();