X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fgofon%2Fconference%2Fclass_phoneConferenceManagment.inc;h=57de90f6136a82f870359fd55c19744718a36c69;hb=2c0515a09cbb244ec32757b8372f7e55830a67e3;hp=720efc191632d0f3f09a665545ee2647b5482e27;hpb=27e925c49c9183c284a42b2604388a85a6f939e1;p=gosa.git
diff --git a/plugins/gofon/conference/class_phoneConferenceManagment.inc b/plugins/gofon/conference/class_phoneConferenceManagment.inc
index 720efc191..57de90f61 100644
--- a/plugins/gofon/conference/class_phoneConferenceManagment.inc
+++ b/plugins/gofon/conference/class_phoneConferenceManagment.inc
@@ -22,7 +22,7 @@ require "tabs_conference.inc";
class phoneConferenceManagment extends plugin
{
/* Definitions */
- var $plHeadline = "Phone conference";
+ var $plHeadline = "Phone conferences";
var $plDescription = "Management";
/* CLI vars */
@@ -47,6 +47,9 @@ class phoneConferenceManagment extends plugin
$this->dn = "";
$this->config = $config;
+ $acl= get_permissions ($ui->dn, $ui->subtreeACL);
+ $this->acl= get_module_permission($acl, "conference", $ui->dn);
+
/* Get global filter config */
if (!isset($_SESSION["conferencefilter"])){
$base= get_base_from_people($ui->dn);
@@ -60,6 +63,10 @@ class phoneConferenceManagment extends plugin
/* Execute class and display something */
function execute()
{
+
+ /* Call parent execute */
+ plugin::execute();
+
/* Reload departments */
$this->config->departments = get_departments();
$smarty = get_smarty();
@@ -182,9 +189,7 @@ class phoneConferenceManagment extends plugin
* Finally delete department
*/
if (isset($_POST['delete_department_confirm'])){
- $acl= get_permissions ($this->dn, $this->ui->subtreeACL);
- $acl= get_module_permission($acl, "goFonConference", $this->dn);
- if (chkacl($acl, "all") == ""){
+ if (chkacl($this->acl, "delete") == ""){
$this->remove_from_parent();
gosa_log ("Department object'".$this->dn."' has been removed");
$this->reload ();
@@ -207,20 +212,18 @@ class phoneConferenceManagment extends plugin
/* Lock the current entry, so everyone will get the above dialog */
add_lock ($this->dn, $this->ui->dn);
- /* Set up the users ACL's for this 'dn' */
- $this->acl= get_permissions ($this->dn, $this->ui->subtreeACL);
-
/* Register conftab to trigger edit dialog */
$this->conftab= new conferencetabs($this->config,$this->config->data['TABS']['CONFERENCETABS'], $this->dn);
- $this->conftab->set_acl(array(":all"));
$_SESSION['objectinfo']= $this->dn;
}
/* Insert new entry*/
if($s_action == "new"){
+ $this->dn= "new";
+ /* Set up the users ACL's for this 'dn' */
$this->dn= "new";
$this->conftab= new conferencetabs($this->config,$this->config->data['TABS']['CONFERENCETABS'], $this->dn);
- $this->conftab->set_acl(array(':all'));
+ unset($_SESSION['objectinfo']);//
}
/* Edit finished, check and save changes */
@@ -242,12 +245,14 @@ class phoneConferenceManagment extends plugin
}
$this->conftab->save ();
+ del_lock ($this->conftab->dn);;
unset ($this->conftab);
$this->conftab= NULL;
unset ($_SESSION['objectinfo']);
} else {
show_errors($message);
}
+
$this->reload();
}
@@ -258,9 +263,9 @@ class phoneConferenceManagment extends plugin
/* Don't show buttons if tab dialog requests this */
if (!$this->conftab->by_object[$this->conftab->current]->dialog){
$display.= "
\n";
- $display.= "\n";
+ $display.= "\n";
$display.= " \n";
- $display.= "\n";
+ $display.= "\n";
$display.= "
";
}
return ($display);
@@ -270,40 +275,41 @@ class phoneConferenceManagment extends plugin
$options= "";
foreach ($this->config->idepartments as $key => $value){
if ($conferencefilter['depselect'] == $key){
- $options.= "";
+ $options.= "";
} else {
$options.= "";
}
}
$listhead = "";
/* Images for delete / edit */
- $actions = "";
- $actions.= "";
-
+ $actions = "";
+ $actions.= "";
+
+ $actions2= "";
/* open an entry */
$linkopen= "%s";
/* Set Header */
$divlist = new divlist("conferenceTabs");
$divlist->SetSummary(_("This table displays all available conference rooms."));
- $divlist->SetEntriesPerPage(20);
+ $divlist->SetEntriesPerPage(0);
$divlist->SetHeader(array(
- array("string" => " "),
- array("string" =>_("Name / nummer")),
- array("string" => _("Owner")),
- array("string" => _("PIN")),
- array("string" =>_("Actions"), "attach" => "style='text-align: right;border:none'")));
+ array("string" => " ", "attach" => "style='text-align:center;width:20px;'"),
+ array("string" =>_("Name - Number"), "attach" => "style=''"),
+ array("string" => _("Owner"), "attach" => "style='width:200px;'"),
+ array("string" => _("PIN"), "attach" => "style='width:50px;'"),
+ array("string" =>_("Actions"), "attach" => "style='width:60px;border-right:0px;text-align:right;'")));
/* Insert departments in divlist*/
foreach($this->departments as $key=> $val){
@@ -320,27 +326,27 @@ class phoneConferenceManagment extends plugin
}
/* Prepare and insert fields*/
- $a_field1 = array("string" => "
","attach"=>"style='width:22px;'");
- $a_field2 = array("string" => sprintf($linkopen,base64_encode($key),$val));
- $a_field3 = array("string" => " ");
- $a_field4 = array("string" => " ");
- $a_field5 = array("string" => " ", "attach" => "style='border:none;width:60px;'");
+ $a_field1 = array("string" => "
", "attach" => "style='text-align:center;width:20px;'");
+ $a_field2 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style=''");
+ $a_field3 = array("string" => " ", "attach" => "style='width:200px;'");
+ $a_field4 = array("string" => " ", "attach" => "style='width:50px;'");
+ $a_field5 = array("string" => " ", "attach" => "style='width:60px;border-right:0px;text-align:right;'");
/* Add entries */
$divlist->AddEntry(array($a_field1,$a_field2,$a_field3,$a_field4,$a_field5));
}
/* Image shown in divlist */
- $userimg = "
";
+ $userimg = "
";
/* Edit entry link*/
$editlink = "%s";
/* Insert conferneces*/
foreach($this->conferences as $conferencekey => $conference ){
-
- if(isset($conference['goFonPIN'][0])){
- $pin = $conference['goFonPIN'][0];
+
+ if((isset($conference['goFonPIN'][0]))&&(($this->ui->dn==$conference['goFonConferenceOwner'][0])||($this->acl=="#all#"))){
+ $pin = "
";
}else{
$pin = " ";
}
@@ -356,11 +362,24 @@ class phoneConferenceManagment extends plugin
$data = $ldap->fetch($ldap->cat($conference['goFonConferenceOwner'][0]));
$cn = $data['cn'][0];
- $a_field1 = array("string"=>sprintf($userimg,_("Conference")));
- $a_field2 = array("string"=>sprintf($editlink,$conferencekey,$conference['cn'][0].$number));
- $a_field3 = array("string"=> $cn);
- $a_field4 = array("string"=> $pin);
- $a_field5 = array("string"=>preg_replace("/%KEY%/",$conferencekey,$actions));
+ $a_field1 = array("string"=>sprintf($userimg,_("Conference")), "attach" => "style='text-align:center;width:20px;'");
+
+ if(($this->acl=="#all#")||(($this->ui->dn==$conference['goFonConferenceOwner'][0])&&(chkacl($this->acl,"goFonConferenceOwner")==""))){
+ $a_field2 = array("string"=>sprintf($editlink,$conferencekey,$conference['cn'][0].$number), "attach" => "style=''");
+ }else{
+ $a_field2 = array("string"=>$conference['cn'][0].$number, "attach" => "style=''");
+ }
+ $a_field3 = array("string"=> $cn, "attach" => "style='width:200px;'");
+ $a_field4 = array("string"=> $pin, "attach" => "style='width:50px;'");
+
+ if(($this->ui->dn==$conference['goFonConferenceOwner'][0])&&(chkacl($this->acl,"goFonConferenceOwner")=="")){
+ $a_field5 = array("string"=>preg_replace("/%KEY%/",$conferencekey,$actions), "attach" => "style='width:60px;border-right:0px;text-align:right;'");
+ }elseif(chkacl($this->acl,"goFonConferenceOwner")==""){
+ $a_field5 = array("string"=>preg_replace("/%KEY%/",$conferencekey,$actions2), "attach" => "style='width:52px;border-right:0px;text-align:right;'");
+ }else{
+ $a_field5 = array("string"=>" ", "attach" => "style='width:52px;border-right:0px;text-align:right;'");
+ }
+
$divlist->AddEntry(array($a_field1,$a_field2,$a_field3,$a_field4,$a_field5));
}
@@ -402,16 +421,19 @@ class phoneConferenceManagment extends plugin
}
ksort($tmp);
foreach($tmp as $value){
- if($value["description"][0]!=".."){
+ if(isset($value["description"][0])){
$this->departments[$value['dn']]=convert_department_dn2($value['dn'])." - [".$value["description"][0]."]";
}else{
- $this->departments[$value['dn']]=$value["description"][0];
+ $this->departments[$value['dn']]=convert_department_dn2($value['dn']);//$value["description"][0];
}
}
}
function remove_from_parent()
{
+ $cfg = new conference($this->config, $this->dn);
+
+ $cfg->remove_from_parent();
$ldap= $this->config->get_ldap_link();
$ldap->cd ($this->dn);
$ldap->recursive_remove();