From: hickert Date: Fri, 1 Sep 2006 09:58:21 +0000 (+0000) Subject: 'Added acls to ogroup-phonequeue settings X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2ad3f11fd8bf2d90b17925e06802553d6c90b634;p=gosa.git 'Added acls to ogroup-phonequeue settings git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4567 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/ogroups/class_mailogroup.inc b/plugins/admin/ogroups/class_mailogroup.inc index 33aaf0120..aa11b64a9 100644 --- a/plugins/admin/ogroups/class_mailogroup.inc +++ b/plugins/admin/ogroups/class_mailogroup.inc @@ -26,12 +26,16 @@ class mailogroup extends plugin function execute() { - /* Call parent execute */ - plugin::execute(); + /* Call parent execute */ + plugin::execute(); /* Do we need to flip is_account state? */ - if (isset($_POST['modify_state'])){ - $this->is_account= !$this->is_account; + if(isset($_POST['modify_state'])){ + if($this->is_account && $this->acl_is_removeable()){ + $this->is_account= FALSE; + }elseif(!$this->is_account && $this->acl_is_createable()){ + $this->is_account= TRUE; + } } /* Show tab dialog headers */ diff --git a/plugins/admin/ogroups/class_phonequeue.inc b/plugins/admin/ogroups/class_phonequeue.inc index 22f235db2..e47ae9c61 100644 --- a/plugins/admin/ogroups/class_phonequeue.inc +++ b/plugins/admin/ogroups/class_phonequeue.inc @@ -10,12 +10,12 @@ class phonequeue extends plugin var $goFonTimeOut ="20"; var $goFonMaxLen ="20"; // var $goFonAnnounceFrequency ="60"; // Annouce Frequency in seconds - var $goFonDialOption_t =""; - var $goFonDialOption_T =""; - var $goFonDialOption_h =""; - var $goFonDialOption_r =""; + var $goFonDialOptiont =""; + var $goFonDialOptionT =""; + var $goFonDialOptionh =""; + var $goFonDialOptionr =""; var $goFonQueueAnnounce ="gonicus-berlin-welcome"; - var $goFonDialOption_H =""; + var $goFonDialOptionH =""; var $goFonMusiconHold ="default"; var $goFonWelcomeMusic ="gonicus-berlin-welcome"; var $goFonQueueReportHold ="yes"; @@ -41,9 +41,9 @@ class phonequeue extends plugin var $old_phone_numbers =array(); /* attribute list for save action */ - var $attributes= array( "goFonTimeOut","goFonMaxLen","goFonAnnounceFrequency","goFonDialOption_t","goFonDialOption_T", - "goFonDialOption_h","goFonDialOption_r","cn", - "goFonDialOption_H","goFonMusiconHold","goFonWelcomeMusic","goFonQueueReportHold","goFonQueueYouAreNext", + var $attributes= array( "goFonTimeOut","goFonMaxLen","goFonAnnounceFrequency","goFonDialOptiont","goFonDialOptionT", + "goFonDialOptionh","goFonDialOptionr","cn", + "goFonDialOptionH","goFonMusiconHold","goFonWelcomeMusic","goFonQueueReportHold","goFonQueueYouAreNext", "goFonQueueThereAre","goFonQueueCallsWaiting","goFonQueueThankYou","goFonQueueMinutes","goFonQueueSeconds","goFonQueueLessThan", "telephoneNumber","goFonQueueLanguage","goFonQueueStrategy","goFonQueueAnnounceHoldtime","goFonQueueAnnounce","goFonDialOption","goFonQueueRetry"); /* ObjectClass */ @@ -66,7 +66,7 @@ class phonequeue extends plugin } for($i = 0; $i < strlen($this->goFonDialOption); $i++){ - $name = "goFonDialOption_".$this->goFonDialOption[$i]; + $name = "goFonDialOption".$this->goFonDialOption[$i]; $this->$name=$this->goFonDialOption[$i]; } } @@ -99,12 +99,16 @@ class phonequeue extends plugin function execute() { - /* Call parent execute */ - plugin::execute(); + /* Call parent execute */ + plugin::execute(); /* Do we need to flip is_account state? */ - if (isset($_POST['modify_state'])){ - $this->is_account= !$this->is_account; + if(isset($_POST['modify_state'])){ + if($this->is_account && $this->acl_is_removeable()){ + $this->is_account= FALSE; + }elseif(!$this->is_account && $this->acl_is_createable()){ + $this->is_account= TRUE; + } } /* Show tab dialog headers */ @@ -120,15 +124,19 @@ class phonequeue extends plugin } /* Add queue number */ - if(isset($_POST['add_phonenumber'])&&(isset($_POST['phonenumber']))&&(!empty($_POST['phonenumber']))){ - if((!in_array($_POST['phonenumber'],$this->telephoneNumber))&&(is_numeric($_POST['phonenumber']))){ - $this->telephoneNumber[]=$_POST['phonenumber']; + if($this->acl_is_writeable("telephoneNumber")){ + if(isset($_POST['add_phonenumber'])&&(isset($_POST['phonenumber']))&&(!empty($_POST['phonenumber']))){ + if((!in_array($_POST['phonenumber'],$this->telephoneNumber))&&(is_numeric($_POST['phonenumber']))){ + $this->telephoneNumber[]=$_POST['phonenumber']; + } } } /* Delete queue number */ - if(isset($_POST['delete_phonenumber'])&&(isset($_POST['goFonQueueNumber_List']))){ - unset($this->telephoneNumber[$_POST['goFonQueueNumber_List']]); + if($this->acl_is_writeable("telephoneNumber")){ + if(isset($_POST['delete_phonenumber'])&&(isset($_POST['goFonQueueNumber_List']))){ + unset($this->telephoneNumber[$_POST['goFonQueueNumber_List']]); + } } $tmp = array(); @@ -140,27 +148,35 @@ class phonequeue extends plugin $this->telephoneNumber=$tmp; /* queue number up */ - if(isset($_POST['up_phonenumber'])&&(isset($_POST['goFonQueueNumber_List']))){ - if($_POST['goFonQueueNumber_List']>0){ - $up = $this->telephoneNumber[$_POST['goFonQueueNumber_List']]; - $down = $this->telephoneNumber[$_POST['goFonQueueNumber_List']-1]; - $this->telephoneNumber[$_POST['goFonQueueNumber_List']] = $down; - $this->telephoneNumber[$_POST['goFonQueueNumber_List']-1] = $up; + if($this->acl_is_writeable("telephoneNumber")){ + if(isset($_POST['up_phonenumber'])&&(isset($_POST['goFonQueueNumber_List']))){ + if($_POST['goFonQueueNumber_List']>0){ + $up = $this->telephoneNumber[$_POST['goFonQueueNumber_List']]; + $down = $this->telephoneNumber[$_POST['goFonQueueNumber_List']-1]; + $this->telephoneNumber[$_POST['goFonQueueNumber_List']] = $down; + $this->telephoneNumber[$_POST['goFonQueueNumber_List']-1] = $up; + } } - } - /* Queuenumber down */ - if(isset($_POST['down_phonenumber'])&&(isset($_POST['goFonQueueNumber_List']))){ - if(isset($this->telephoneNumber[($_POST['goFonQueueNumber_List']+1)])){ - $up = $this->telephoneNumber[$_POST['goFonQueueNumber_List']+1]; - $down = $this->telephoneNumber[$_POST['goFonQueueNumber_List']]; - $this->telephoneNumber[$_POST['goFonQueueNumber_List']+1] = $down; - $this->telephoneNumber[$_POST['goFonQueueNumber_List']] = $up; + /* Queuenumber down */ + if(isset($_POST['down_phonenumber'])&&(isset($_POST['goFonQueueNumber_List']))){ + if(isset($this->telephoneNumber[($_POST['goFonQueueNumber_List']+1)])){ + $up = $this->telephoneNumber[$_POST['goFonQueueNumber_List']+1]; + $down = $this->telephoneNumber[$_POST['goFonQueueNumber_List']]; + $this->telephoneNumber[$_POST['goFonQueueNumber_List']+1] = $down; + $this->telephoneNumber[$_POST['goFonQueueNumber_List']] = $up; + } } } $smarty= get_smarty(); + /* Set acls */ + $tmp = $this->plInfo(); + foreach($tmp['plProvidedAcls'] as $name => $translated){ + $smarty->assign($name."ACL",$this->getacl($name)); + } + $smarty->assign("goFonQueueLanguageOptions",array('de'=>_('German'))); $smarty->assign("goFonQueueStrategyOptions", $this->goFonQueueStrategyOptions); @@ -172,12 +188,6 @@ class phonequeue extends plugin }else{ $smarty->assign($val."CHK"," checked "); } - - if(chkacl($this->acl,$key)==""){ - $smarty->assign($val."ACL",""); - }else{ - $smarty->assign($val."ACL"," disabled "); - } } return ($display.$smarty->fetch (get_template_path('phonequeue.tpl', TRUE))); } @@ -410,11 +420,11 @@ class phonequeue extends plugin $a_ext[$i]['app'] = "Queue"; $a_ext[$i]['appdata'] = $this->attrs['cn'][0]. "|". - $this->goFonDialOption_t. - $this->goFonDialOption_T. - $this->goFonDialOption_h. - $this->goFonDialOption_H. - $this->goFonDialOption_r; + $this->goFonDialOptiont. + $this->goFonDialOptionT. + $this->goFonDialOptionh. + $this->goFonDialOptionH. + $this->goFonDialOptionr; } if($this->goFonQueueAnnounceHoldtime != false) { @@ -538,7 +548,7 @@ class phonequeue extends plugin { plugin::save_object(); if(isset($_POST['phonenumber'])){ - foreach(array("goFonDialOption_t","goFonDialOption_T","goFonDialOption_h","goFonDialOption_r","goFonDialOption_H","goFonMusiconHold") as $val){ + foreach(array("goFonDialOptiont","goFonDialOptionT","goFonDialOptionh","goFonDialOptionr","goFonDialOptionH","goFonMusiconHold") as $val){ if(isset($_POST[$val])){ $this->$val = $_POST[$val]; }else{ @@ -565,7 +575,7 @@ class phonequeue extends plugin plugin::save(); $this->attrs['goFonDialOption'] = ""; - foreach(array("goFonDialOption_t","goFonDialOption_T","goFonDialOption_r","goFonDialOption_h","goFonDialOption_H","cn") as $val){ + foreach(array("goFonDialOptiont","goFonDialOptionT","goFonDialOptionr","goFonDialOptionh","goFonDialOptionH","cn") as $val){ $this->attrs['goFonDialOption'].=$this->$val; unset($this->attrs[$val]); } @@ -627,7 +637,7 @@ class phonequeue extends plugin /* Remove all temporary attributes */ $tmp = array_flip($this->attributes); - foreach(array("goFonDialOption_t","goFonDialOption_T","goFonDialOption_r","goFonDialOption_h","goFonDialOption_H","cn") as $val){ + foreach(array("goFonDialOptiont","goFonDialOptionT","goFonDialOptionr","goFonDialOptionh","goFonDialOptionH","cn") as $val){ unset($this->$val); unset($this->attrs[$val]); unset($tmp[$val]); @@ -717,11 +727,11 @@ class phonequeue extends plugin "goFonTimeOut" => _("Timeout"), "goFonMaxLen" => _("Max queue length"), "goFonAnnounceFrequency" => _("Announce frequency"), - "goFonDialOption_t" => _("Allow the called user to transfer his call"), - "goFonDialOption_T" => _("Allows calling user to transfer call"), - "goFonDialOption_h" => _("Allow the called to hangup by pressing *"), - "goFonDialOption_r" => _("Ring instead of playing background music"), - "goFonDialOption_H" => _("Allows calling to hangup by pressing *"), + "goFonDialOptiont" => _("Allow the called user to transfer his call"), + "goFonDialOptionT" => _("Allows calling user to transfer call"), + "goFonDialOptionh" => _("Allow the called to hangup by pressing *"), + "goFonDialOptionr" => _("Ring instead of playing background music"), + "goFonDialOptionH" => _("Allows calling to hangup by pressing *"), "goFonMusiconHold" => _("Music on hold"), "goFonWelcomeMusic" => _("Welcome music"), diff --git a/plugins/admin/ogroups/phonequeue.tpl b/plugins/admin/ogroups/phonequeue.tpl index 95f7b52e4..9a2ea4046 100644 --- a/plugins/admin/ogroups/phonequeue.tpl +++ b/plugins/admin/ogroups/phonequeue.tpl @@ -8,21 +8,33 @@
- {html_options options=$telephoneNumber} +{/render} -
- +{render acl=$telephoneNumberACL} +
+{/render} +{render acl=$telephoneNumberACL} + +{/render}
- -   - +{render acl=$telephoneNumberACL} + +{/render} +{render acl=$telephoneNumberACL} +   +{/render} +{render acl=$telephoneNumberACL} + +{/render}
@@ -35,10 +47,12 @@ {t}Language{/t} - {html_options options=$goFonQueueLanguageOptions selected=$goFonQueueLanguage} +{/render} @@ -46,7 +60,9 @@ {t}Timeout{/t} - +{render acl=$goFonTimeOutACL} + +{/render} @@ -54,7 +70,9 @@ {t}Retry{/t} - +{render acl=$goFonQueueRetryACL} + +{/render} @@ -62,10 +80,12 @@ {t}Strategy{/t} - {html_options options=$goFonQueueStrategyOptions selected=$goFonQueueStrategy} +{/render} @@ -74,7 +94,9 @@ {t}Max queue length{/t} - +{render acl=$goFonMaxLenACL} + +{/render} @@ -82,7 +104,9 @@ {t}Announce frequency{/t} - +{render acl=$goFonAnnounceFrequencyACL} + +{/render} {t}(in seconds){/t} @@ -99,7 +123,9 @@ {t}Use music on hold instead of ringing{/t} - +{render acl=goFonMusiconHoldACL} + +{/render} --> @@ -108,7 +134,9 @@ {t}Music on hold{/t} - +{render acl=$goFonMusiconHoldACL} + +{/render} @@ -116,7 +144,9 @@ {t}Welcome sound file{/t} - +{render acl=$goFonWelcomeMusicACL} + +{/render} @@ -124,7 +154,9 @@ {t}Announce message{/t} - +{render acl=$goFonQueueAnnounceACL} + +{/render} @@ -132,7 +164,9 @@ {t}Sound file for 'You are next ...'{/t} - +{render acl=$goFonQueueYouAreNextACL} + +{/render} @@ -140,7 +174,9 @@ {t}'There are ...'{/t} - +{render acl=$goFonQueueThereAreACL} + +{/render} @@ -148,7 +184,9 @@ {t}'... calls waiting'{/t} - +{render acl=$goFonQueueCallsWaitingACL} + +{/render} @@ -156,7 +194,9 @@ {t}'Thank you' message{/t} - +{render acl=$goFonQueueThankYouACL} + +{/render} @@ -164,7 +204,9 @@ {t}'minutes' sound file{/t} - +{render acl=$goFonQueueMinutesACL} + +{/render} @@ -172,7 +214,9 @@ {t}'seconds' sound file{/t} - +{render acl=$goFonQueueSecondsACL} + +{/render} @@ -180,7 +224,9 @@ {t}Hold sound file{/t} - +{render acl=$goFonQueueReportHoldACL} + +{/render} @@ -188,7 +234,9 @@ {t}Less Than sound file{/t} - +{render acl=$goFonQueueLessThanACL} + +{/render} @@ -208,19 +256,25 @@
- +{render acl=$goFonQueueAnnounceHoldtimeACL} + +{/render} {t}Announce holdtime{/t}
- +{render acl=$goFonDialOptiontACL} + +{/render} {t}Allow the called user to transfer his call{/t}
- +{render acl=$goFonDialOptionTACL} + +{/render} {t}Allows calling user to transfer call{/t}
@@ -230,19 +284,25 @@
- +{render acl=$goFonDialOptionhACL} + +{/render} {t}Allow the called to hangup by pressing *{/t}
- +{render acl=$goFonDialOptionHACL} + +{/render} {t}Allows calling to hangup by pressing *{/t}
- +{render acl=$goFonDialOptionrACL} + +{/render} {t}Ring instead of playing background music{/t}