From: hickert Date: Mon, 1 Dec 2008 13:33:22 +0000 (+0000) Subject: Added read only option - 2/3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=623e38132b774b171ce95d2ad1d2d0b39049804f;p=gosa.git Added read only option - 2/3 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13099 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc b/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc index 6635ee071..634d863c9 100644 --- a/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc @@ -395,7 +395,7 @@ class ogroupManagement extends plugin /* 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)); + return(gen_locked_message ($user, $this->dn,TRUE)); } /* Lock the current entry, so everyone will get the @@ -471,7 +471,11 @@ class ogroupManagement extends plugin $display= $this->ogroup->execute(); /* Don't show buttons if tab dialog requests this */ - if (!$this->ogroup->by_object[$this->ogroup->current]->dialog){ + if(($this->ogroup instanceOf tabs || $this->ogroup instanceOf plugin) && $this->ogroup->read_only == TRUE){ + $display.= "

+ +

"; + }elseif (!$this->ogroup->by_object[$this->ogroup->current]->dialog){ $display.= "

\n"; $display.= "\n"; $display.= " \n"; @@ -709,8 +713,7 @@ class ogroupManagement extends plugin { if (isset($this->apptabs->dn)){ del_lock ($this->apptabs->dn); - } - if(isset($this->dn) && !empty($this->dn) && $this->dn != "new"){ + }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)){ diff --git a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc index 78ec8dede..a8959a121 100644 --- a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc +++ b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc @@ -308,7 +308,7 @@ class applicationManagement extends plugin /* 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)); + return(gen_locked_message ($user, $this->dn,TRUE)); } /* Lock the current entry, so everyone will get the @@ -511,7 +511,11 @@ class applicationManagement extends plugin if (!$this->apptabs->by_object[$this->apptabs->current]->dialog){ $display.= "

\n"; - if(isset($this->apptabs->FAIstate) && !preg_match("/freeze/i",$this->apptabs->FAIstate)){ + if(($this->apptabs instanceOf tabs || $this->apptabs instanceOf plugin) && $this->apptabs->read_only == TRUE){ + $display.= "

+ +

"; + }elseif(isset($this->apptabs->FAIstate) && !preg_match("/freeze/i",$this->apptabs->FAIstate)){ $display.= "\n"; $display.= " \n"; if ($this->dn != "new"){ @@ -716,8 +720,7 @@ class applicationManagement extends plugin { if (isset($this->apptabs->dn)){ del_lock ($this->apptabs->dn); - } - if(isset($this->dn) && !empty($this->dn) && $this->dn != "new"){ + }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)){ diff --git a/gosa-plugins/goto/admin/devices/class_deviceManagement.inc b/gosa-plugins/goto/admin/devices/class_deviceManagement.inc index e8735a435..7f2e02171 100644 --- a/gosa-plugins/goto/admin/devices/class_deviceManagement.inc +++ b/gosa-plugins/goto/admin/devices/class_deviceManagement.inc @@ -208,7 +208,7 @@ class deviceManagement extends plugin /* 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)); + return(gen_locked_message ($user, $this->dn,TRUE)); } /* Lock the current entry, so everyone will get the @@ -403,7 +403,12 @@ class deviceManagement extends plugin $display= $this->devicetabs->execute(); /* Don't show buttons if tab dialog requests this */ - if (!$this->devicetabs->by_object[$this->devicetabs->current]->dialog){ + + if(($this->devicetabs instanceOf tabs || $this->devicetabs instanceOf plugin) && $this->devicetabs->read_only == TRUE){ + $display.= "

+ +

"; + }elseif (!$this->devicetabs->by_object[$this->devicetabs->current]->dialog){ $display.= "

\n"; $display.= "\n"; $display.= " \n"; diff --git a/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc b/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc index d41c7b958..397e0bee1 100644 --- a/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc +++ b/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc @@ -317,7 +317,7 @@ class mimetypeManagement extends plugin /* 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)); + return(gen_locked_message ($user, $this->dn,TRUE)); } /* Lock the current entry, so everyone will get the @@ -517,7 +517,12 @@ class mimetypeManagement extends plugin $display= $this->mimetabs->execute(); /* Don't show buttons if tab dialog requests this */ - if (!$this->mimetabs->by_object[$this->mimetabs->current]->dialog){ + + if(($this->mimetabs instanceOf tabs || $this->mimetabs instanceOf plugin) && $this->mimetabs->read_only == TRUE){ + $display.= "

+ +

"; + }elseif (!$this->mimetabs->by_object[$this->mimetabs->current]->dialog){ $display.= "

\n"; if(isset($this->mimetabs->FAIstate) && !preg_match("/freeze/i",$this->mimetabs->FAIstate)){ @@ -727,8 +732,7 @@ class mimetypeManagement extends plugin { if (isset($this->mimetabs->dn)){ del_lock ($this->mimetabs->dn); - } - if(isset($this->dn) && !empty($this->dn) && $this->dn != "new"){ + }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)){ diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index 40d58f000..17b1667fe 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -525,7 +525,7 @@ class systems extends plugin /* 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)); + return(gen_locked_message ($user, $this->dn,TRUE)); } /* Find out more about the object type */ @@ -540,12 +540,14 @@ class systems extends plugin if(!class_available("ArpNewDeviceTabs")){ msg_dialog::display(_("Error"), msgPool::class_not_found("ArpNewDevice"), ERROR_DIALOG); }else{ + add_lock ($this->dn, $this->ui->dn); $this->systab = new ArpNewDeviceTabs($this->config,$this->config->data['TABS']['ARPNEWDEVICETABS'],$this->dn); } }elseif($type == "NewDevice"){ if(!class_available("SelectDeviceType")){ msg_dialog::display(_("Error"), msgPool::class_not_found("SelectDeviceType"), ERROR_DIALOG); }else{ + add_lock ($this->dn, $this->ui->dn); $this->system_activation_object= array($this->dn); $this->systab = new SelectDeviceType($this->config,$this->dn) ; @@ -560,10 +562,10 @@ class systems extends plugin if(!class_available($tabclass)){ msg_dialog::display(_("Error"), msgPool::class_not_found($tabclass), ERROR_DIALOG); }else{ + add_lock ($this->dn, $this->ui->dn); $this->systab= new $tabclass($this->config, $this->config->data['TABS'][$class], $this->dn,$acl_cat); $this->systab->set_acl_base($this->dn); session::set('objectinfo',$this->dn); - add_lock ($this->dn, $this->ui->dn); } }else{ msg_dialog::display(_("Error"), _("Editing this type of object is not supported yet!"), ERROR_DIALOG); @@ -1056,7 +1058,11 @@ class systems extends plugin $dialog = TRUE; } - if (!$dialog){ + if(($this->systab instanceOf tabs || $this->systab instanceOf plugin) && $this->systab->read_only == TRUE){ + $display.= "

+ +

"; + }elseif (!$dialog){ $display.= "

\n"; $display.= "\n"; $display.= " \n"; @@ -1427,8 +1433,7 @@ class systems extends plugin { if (isset($this->systab->dn)){ del_lock ($this->systab->dn); - } - if(isset($this->dn) && !empty($this->dn) && $this->dn != "new"){ + }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)){ diff --git a/gosa-plugins/systems/admin/systems/tabs_server.inc b/gosa-plugins/systems/admin/systems/tabs_server.inc index a2f37eb50..39c030953 100644 --- a/gosa-plugins/systems/admin/systems/tabs_server.inc +++ b/gosa-plugins/systems/admin/systems/tabs_server.inc @@ -48,6 +48,7 @@ class servtabs extends tabs $this->by_object[$tab['CLASS']]->parent= &$this; $this->by_object[$tab['CLASS']]->set_acl_category($category); + $this->read_only |= $this->by_object[$tab['CLASS']]->read_only; /* Initialize current */ if ($this->current == ""){