From: hickert Date: Wed, 1 Jul 2009 11:46:35 +0000 (+0000) Subject: Updated role management X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ddd3edd34596c1847f66e3058d5365d95e8823bc;p=gosa.git Updated role management git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13868 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/roleManagement/admin/roleManagement/class_divListRole.inc b/gosa-plugins/roleManagement/admin/roleManagement/class_divListRole.inc index 22c7f1d0a..d83524efe 100644 --- a/gosa-plugins/roleManagement/admin/roleManagement/class_divListRole.inc +++ b/gosa-plugins/roleManagement/admin/roleManagement/class_divListRole.inc @@ -154,11 +154,8 @@ class divListRole extends MultiSelectWindow $acl = $ui->get_permissions($val['dn'],"roles/role"); $acl_all= $ui->has_complete_category_acls($val['dn'],"roles"); - // Add copy & cut functionality - $actions = $this->parent->get_copypaste_action($val['dn'],"roles","role"); - // Create edit and remove icon buttons - $actions.= ""; $actions.= $this->parent->get_snapshot_action($val['dn'],$this->module); diff --git a/gosa-plugins/roleManagement/admin/roleManagement/class_roleGeneric.inc b/gosa-plugins/roleManagement/admin/roleManagement/class_roleGeneric.inc index 48c6c7570..9fd6a3705 100644 --- a/gosa-plugins/roleManagement/admin/roleManagement/class_roleGeneric.inc +++ b/gosa-plugins/roleManagement/admin/roleManagement/class_roleGeneric.inc @@ -58,6 +58,7 @@ class roleGeneric extends plugin { $tmp = $this->allowedBasesToMoveTo(); $smarty->assign("bases", $tmp); $smarty->assign("base_select",$this->base); + $smarty->assign("members",$this->convert_list()); foreach($this->attributes as $attr){ $smarty->assign($attr,$this->$attr); } @@ -69,6 +70,20 @@ class roleGeneric extends plugin { } + function convert_list() + { + $temp= ""; + foreach ($this->roleOccupant as $key => $value){ + $temp.= " + \n"; + } + + return ($temp); + } + + function save(){ plugin::save(); diff --git a/gosa-plugins/roleManagement/admin/roleManagement/class_roleManagement.inc b/gosa-plugins/roleManagement/admin/roleManagement/class_roleManagement.inc index 598dcf80f..d3d9da484 100644 --- a/gosa-plugins/roleManagement/admin/roleManagement/class_roleManagement.inc +++ b/gosa-plugins/roleManagement/admin/roleManagement/class_roleManagement.inc @@ -68,7 +68,7 @@ class roleManagement extends plugin plugin::execute(); /* Variables to restore after 'entry locked' warning was displayed */ - session::set('LOCK_VARS_TO_USE',array('/^role_/')); + session::set('LOCK_VARS_TO_USE',array('/^role_/','/^act/','/^id/','/^menu_action/')); $smarty = get_smarty(); $s_action = ""; @@ -113,7 +113,7 @@ class roleManagement extends plugin * New handling ***************/ - if($s_action == "new"){ + if($s_action == "new" && $this->dialog instanceOf tabs){ $this->dialog = new roletabs($this->config, $this->config->data['TABS']['ROLETABS'], "new"); $this->dialog->set_acl_base($this->DivListRoles->selectedBase); } @@ -122,12 +122,28 @@ class roleManagement extends plugin * Edit handling ***************/ - if($s_action == "edit"){ + if($s_action == "edit" && !$this->dialog instanceOf tabs){ if(!isset($this->roles[$s_entry])){ trigger_error("Unknown entry!"); }else{ + $entry = $this->roles[$s_entry]; - $this->dialog = new roletabs($this->config, $this->config->data['TABS']['ROLETABS'], $entry['dn']); + $this->dn = $entry['dn']; + + /* Check locking, save current plugin in 'back_plugin', so + the dialog knows where to return. */ + if (($user= get_lock($this->dn)) != ""){ + return(gen_locked_message ($user, $this->dn,TRUE)); + } + + /* Lock the current entry, so everyone will get the above dialog */ + add_lock ($this->dn, $this->ui->dn); + + /* Open the dialog */ + $this->dialog = new roletabs($this->config, $this->config->data['TABS']['ROLETABS'], + $entry['dn'], "roles"); + $this->dialog->set_acl_base($this->dn); + set_object_info($this->dn); } } @@ -135,25 +151,25 @@ class roleManagement extends plugin * Dialog handling ***************/ - if (isset($_POST['edit_finish']) && $this->dialog instanceOf tabs){ + if ((isset($_POST['edit_finish']) || isset($_POST['edit_apply'])) && $this->dialog instanceOf tabs){ $this->dialog->save_object(); $msgs = $this->dialog->check(); if(count($msgs)){ msg_dialog::displayChecks($msgs); }else{ $this->dialog->save(); - if(isset($this->grouptab->dn)){ + if (!isset($_POST['edit_apply'])){ $this->remove_lock(); + $this->dialog= NULL; + set_object_info(); + }else{ + $this->dialog->re_init(); } - $this->dialog= NULL; - set_object_info(); } } if (isset($_POST['edit_cancel']) && $this->dialog instanceOf tabs){ - if(isset($this->grouptab->dn)){ - $this->remove_lock(); - } + $this->remove_lock(); $this->dialog= NULL; set_object_info(); } @@ -195,7 +211,7 @@ class roleManagement extends plugin // Add departments if subsearch is disabled if(!$this->DivListRoles->SubSearch){ - $this->DivListRoles->AddDepartments($this->DivListRoles->selectedBase,4,1); + $this->DivListRoles->AddDepartments($this->DivListRoles->selectedBase,3,1); } $this->reload (); $this->DivListRoles->setEntries($this->roles); @@ -252,6 +268,14 @@ class roleManagement extends plugin function remove_lock() { + if (isset($this->dialog->dn)){ + del_lock ($this->dialog->dn); + }elseif(isset($this->dn) && !empty($this->dn) && $this->dn != "new"){ + del_lock($this->dn); + } + if(isset($this->dns) && is_array($this->dns) && count($this->dns)){ + del_lock($this->dns); + } } diff --git a/gosa-plugins/roleManagement/admin/roleManagement/roleGeneric.tpl b/gosa-plugins/roleManagement/admin/roleManagement/roleGeneric.tpl index ca1fc0c22..f99855100 100644 --- a/gosa-plugins/roleManagement/admin/roleManagement/roleGeneric.tpl +++ b/gosa-plugins/roleManagement/admin/roleManagement/roleGeneric.tpl @@ -1,60 +1,93 @@ - - - - - - - - - +
{t}cn{/t}: - {render acl=$cnACL} - - {/render} -
{t}description{/t}: - {render acl=$descriptionACL} - - {/render} -
- - - - - - - - - - - - - - -
-
- +
+ +

  + {t}Generic{/t} +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{t}Name{/t} + {render acl=$cnACL} + + {/render} +
{t}Description{/t} + {render acl=$descriptionACL} + + {/render} +
+
+ +
+
+ {render acl=$baseACL} + + {/render} + {render acl=$baseACL disable_picture='images/lists/folder_grey.png'} + + {/render} +

 


{t}X.121 Address{/t} + {render acl=$x121AddressACL} + + {/render} +
{t}Phone number{/t} + {render acl=$telephoneNumberACL} + + {/render} +
{t}Fax number{/t} + {render acl=$facsimileTelephoneNumberACL} + + {/render} +
+
-
-{render acl=$baseACL} -
+

  + {t}Occupants{/t} +

+ +{render acl=$roleOccupantACL} + {/render} -{render acl=$baseACL disable_picture='images/lists/folder_grey.png'} - +
+{render acl=$roleOccupantACL} +   +{/render} +{render acl=$roleOccupantACL} + {/render}
{t}x121Address{/t}: - {render acl=$x121AddressACL} - - {/render} -
{t}telephoneNumber{/t}: - {render acl=$telephoneNumberACL} - - {/render} -
{t}facsimileTelephoneNumber{/t}: - {render acl=$facsimileTelephoneNumberACL} - - {/render} -
+ diff --git a/gosa-plugins/roleManagement/html/images/new.png b/gosa-plugins/roleManagement/html/images/new.png new file mode 100644 index 000000000..318715a4d Binary files /dev/null and b/gosa-plugins/roleManagement/html/images/new.png differ diff --git a/gosa-plugins/roleManagement/html/images/occupant.png b/gosa-plugins/roleManagement/html/images/occupant.png new file mode 100644 index 000000000..8f69e2b99 Binary files /dev/null and b/gosa-plugins/roleManagement/html/images/occupant.png differ diff --git a/gosa-plugins/roleManagement/html/images/plugin.png b/gosa-plugins/roleManagement/html/images/plugin.png new file mode 100644 index 000000000..eb720b7e5 Binary files /dev/null and b/gosa-plugins/roleManagement/html/images/plugin.png differ diff --git a/gosa-plugins/roleManagement/html/images/role.png b/gosa-plugins/roleManagement/html/images/role.png new file mode 100644 index 000000000..3b82c19b6 Binary files /dev/null and b/gosa-plugins/roleManagement/html/images/role.png differ