summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e24003f)
raw | patch | inline | side by side (parent: e24003f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 11 May 2006 11:49:53 +0000 (11:49 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 11 May 2006 11:49:53 +0000 (11:49 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3296 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/departments/class_departmentManagement.inc | patch | blob | history | |
plugins/admin/departments/tabs_department.inc | patch | blob | history |
diff --git a/plugins/admin/departments/class_departmentManagement.inc b/plugins/admin/departments/class_departmentManagement.inc
index c454cc598c5fb3b9dee92bc018b33aa7d99dcbc1..1d231605b9ad3496d60663baeb127f3729248faa 100644 (file)
$this->config->get_departments();
$this->config->make_idepartments();
$_SESSION['config']= $this->config;
-
+
$smarty = get_smarty();
$display = "";
$depfilter = get_global("depfilter");
$s_entry = preg_replace("/dep_".$s_action."_/i","",$key);
$s_entry = preg_replace("/_.*$/","",$s_entry);
$s_entry = base64_decode($s_entry);
- // Post for edit
+ // Post for edit
}elseif(preg_match("/dep_edit_.*/",$key)){
$s_action="edit";
$s_entry = preg_replace("/dep_".$s_action."_/i","",$key);
}elseif(preg_match("/dep_root.*/i",$key)){
$s_action="root";
}
-
+
}
if(isset($_POST['CurrentMainBase']) && $_POST['CurrentMainBase']){
$_SESSION['CurrentMainBase'] = $_POST['CurrentMainBase'];
}
-
+
if($s_action=="root"){
- $_SESSION['CurrentMainBase'] = ($this->config->current['BASE']);
+ $_SESSION['CurrentMainBase'] = ($this->config->current['BASE']);
}
if($s_action=="home"){
if($s_action=="back"){
$base_back = preg_replace("/^[^,]+,/","", $_SESSION['CurrentMainBase']);
$base_back = convert_department_dn($base_back);
-
+
if(isset($this->config->departments[trim($base_back)])){
- $_SESSION['CurrentMainBase'] = $this->config->departments[trim($base_back)];
+ $_SESSION['CurrentMainBase'] = $this->config->departments[trim($base_back)];
}else{
$_SESSION['CurrentMainBase'] = $this->config->departments["/"];
}
}
/* Delete Entry if Posted action (s_action) == del
- * The entry which will be deleted is defined in $s_entry
+ * The entry which will be deleted is defined in $s_entry
*/
if ($s_action =="del"){
$this->dn= $this->config->departments[trim($s_entry)];
}
+ /* If this var ist true, the object will be unset after the next two operations */
+ $UnsetAfterTaggingMoving = false;
+
/* This department must be tagged
- */
+ */
if((isset($_GET['TagDepartment'])) && ($this->deptabs->by_object['department']->must_be_tagged())){
$this->deptabs->by_object['department']->tag_objects();
- if ($this->dn != "new"){
- del_lock ($this->dn);
- }
- unset ($this->deptabs);
- $this->deptabs= NULL;
- unset ($_SESSION['objectinfo']);
- exit();
+ $UnsetAfterTaggingMoving = true;
+
}
-
/* Edit Complete ...
* Finish request
if((isset($_GET['PerformRecMove'])) &&( $this->deptabs->by_object['department']->am_i_moved())){
$this->deptabs->save(true);
$this->deptabs->by_object['department']->recursive_move("","",true);
- $this->reload ();
- /* Group has been saved successfully, remove lock from LDAP. */
- if ($this->dn != "new"){
- del_lock ($this->dn);
- }
+ $UnsetAfterTaggingMoving = true;
+ }
+ /* Unset current object / all operations are done */
+ if($UnsetAfterTaggingMoving){
+ /* There's no page reload so we have to read new users at
+ this point. */
+ del_lock ($this->dn);
+ $this->reload ();
unset ($this->deptabs);
$this->deptabs= NULL;
unset ($_SESSION['objectinfo']);
- exit();
+ exit();
}
+
if ((isset($_POST['edit_finish'])) && (isset($this->deptabs->config) ) ){
/* Check tabs, will feed message array */
/* Save, or display error message? */
if (count($message) == 0){
- /* Save user data to ldap */
- $disp = $this->deptabs->save();
- if($this->deptabs->by_object['department']->must_be_tagged()) {
- $disp.= $this->deptabs->by_object['department']->ShowTagFrame();
- return($disp);
- }
-
- if(!($this->deptabs->by_object['department']->am_i_moved()) ){
+ $res = $this->deptabs->save(true);
+ $display = "";
+
+ /* Get tagging frame */
+ if($this->deptabs->by_object['department']->must_be_tagged()){
+ $display .= $this->deptabs->by_object['department']->ShowTagFrame();
+ }
+
+ /* Get recursive move frame */
+ if($this->deptabs->by_object['department']->am_i_moved()){
+ $display .= $res;
+ }
+
+ /* If no frame is returned, unset this obejct, else display those frames */
+ if(empty($display)){
gosa_log ("Department object'".$this->dn."' has been saved");
/* Group has been saved successfully, remove lock from
$this->deptabs= NULL;
unset ($_SESSION['objectinfo']);
}else{
- return($disp);
+ return($display);
}
} else {
/* Ok. There seem to be errors regarding to the tab data,
}
}
+
/* User cancelt edit oder delete
- * Cancel dialog
- */
+ * Cancel dialog
+ */
if (isset($_POST['edit_cancel']) || isset($_POST['delete_cancel']) ||
isset($_POST['delete_department_confirm'])){
/* 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>";
+ " <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>";
/* Show main page */
$divlist = new divlist("departmenttabs");
if(!isset($this->config->departments[trim($key)])){
$this->config->departments[trim($key)]="";
}
-
+
$non_empty="";
$keys= str_replace("/","\/",$key);
foreach($this->config->departments as $keyd=>$vald ){
$non_empty="full";
}
}
-
+
$title = $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."'");
}
$smarty->assign("CurrentMainBase", $_SESSION['CurrentMainBase']);
-
+
/* Extend if we are not using javascript */
$smarty->assign("apply", apply_filter());
$smarty->assign("alphabet", generate_alphabet());
}
$res= get_list("(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))",
- $this->ui->subtreeACL, $base, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT);
+ $this->ui->subtreeACL, $base, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT);
$this->departments= array();
foreach ($res as $value){
}
}
- }
-
- ?>
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/departments/tabs_department.inc b/plugins/admin/departments/tabs_department.inc
index fb93bcf4b7872674bc2e4494720742f4118f1912..77834bb271b14e827d6e43b66bc4c367a3b1a878 100644 (file)
}
$this->dn= $new_dn;
}
- tabs::save(TRUE);
- return($disp);
+ return(tabs::save(TRUE));
}
}