Code

Added number check
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 16 Aug 2005 11:51:26 +0000 (11:51 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 16 Aug 2005 11:51:26 +0000 (11:51 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1152 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/ogroups/class_phonequeue.inc
plugins/gofon/conference/class_phoneConferenceGeneric.inc
plugins/gofon/phoneaccount/class_phoneAccount.inc

index 52bc8949d3cdecb2a27d9b4c360e623d9790e98a..506984d55659a2be4381a61c9966893f4da9ee96 100644 (file)
@@ -471,7 +471,7 @@ class phonequeue extends plugin
   {
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
-    $ldap->search("(|(objectClass=goFonAccount)(objectClass=goFonQueue))", array("telephoneNumber","cn","uid"));
+    $ldap->search("(|(objectClass=goFonAccount)(objectClass=goFonQueue)(goFonConference))", array("telephoneNumber","cn","uid"));
     while($attrs = $ldap->fetch()) {
       unset($attrs['telephoneNumber']['count']);
       foreach($attrs['telephoneNumber'] as $tele){
index b2880643e558d2c7e4269efa301bd7e8912578d5..b277a3b4167e40b2d49c8e1e0455eda1c30765e4 100644 (file)
@@ -100,7 +100,7 @@ class conference extends plugin
        $smarty= get_smarty();
 
        $smarty->assign("goFonConferenceOptions",                   array("P"=>"Conference ",""=>"Conference without PIN"));
-       $smarty->assign("goFonConferenceOptionFormats", array("wav"=>"Wave","gsm"=>"GSM","wav49"=>"Wave49"));
+       $smarty->assign("goFonConferenceOptionFormats", array("WAV"=>"Wave","GSM"=>"GSM","WAV49"=>"Wave49"));
        $smarty->assign("goFonConferenceOption",        $this->goFonConferenceOption_P);
        
        foreach ($this->attributes as $val){
@@ -243,7 +243,14 @@ class conference extends plugin
       $EXT[$i]['priority']=$i;
       $EXT[$i]['app']     ="MeetMe";
       $EXT[$i]['appdata'] =$this->goFonConferenceOptionNumber."|".$parameter."|".$this->goFonPIN;
-      
+      $i++; 
+
+      // Start Conference 
+      $EXT[$i]['exten']   =$this->cn;
+      $EXT[$i]['context'] =$context;
+      $EXT[$i]['priority']=1;
+      $EXT[$i]['app']     ="Goto";
+      $EXT[$i]['appdata'] =$this->goFonConferenceOptionNumber."|1";
       $SQL=array();
     
       foreach($EXT as $keytop => $valtop){
@@ -305,6 +312,40 @@ class conference extends plugin
   }
 
 
+
+  /* This function checks if the given phonenumbers are available or already in use*/
+  function is_number_used()
+  {
+    $ldap= $this->config->get_ldap_link();
+    $ldap->cd($this->config->current['BASE']);
+    $ldap->search("(|(objectClass=goFonAccount)(objectClass=goFonQueue)(objectClass=goFonConference))", array("telephoneNumber","cn","uid"));
+    while($attrs = $ldap->fetch()) {
+      unset($attrs['telephoneNumber']['count']);
+      foreach($attrs['telephoneNumber'] as $tele){
+        if(!isset($attrs['cn'][0])) $attrs['cn'][0]=$attrs['dn'];
+        if(!isset($attrs['uid'][0])) $attrs['uid'][0]=$attrs['dn'];
+        $numbers[$tele]=$attrs;
+      }
+    }
+
+    foreach($this->phoneNumbers as $num){
+      if(!isset($this->cn)) $this->cn = "";
+
+      if((isset($numbers[$num]))&&(($numbers[$num]['uid'][0]!=$this->uid))){
+        if(isset($numbers[$num]['uid'][0])){
+          return sprintf(_("The specified telephonenumber '%s' is already assigned to '%s'."),$num,$numbers[$num]['uid'][0]);
+        }else{
+          return sprintf(_("The specified telephonenumber '%s' is already assigned to '%s'."),$num,$numbers[$num]['cn'][0]);
+        }
+      }
+    }
+  }
+
+
+
+
+
+
   /* Save to LDAP */
   function save()
   {
index 03f69db1371c42426e10581be4a40500854612c7..5ab022af63a3c54d0973ac5fffb8dd0bf8407445 100644 (file)
@@ -973,7 +973,7 @@ class phoneAccount extends plugin
   {
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
-    $ldap->search("(|(objectClass=goFonAccount)(objectClass=goFonQueue))", array("telephoneNumber","cn","uid"));
+    $ldap->search("(|(objectClass=goFonAccount)(objectClass=goFonQueue)(objectClass=goFonConference))", array("telephoneNumber","cn","uid"));
     while($attrs = $ldap->fetch()) {
       unset($attrs['telephoneNumber']['count']);
       foreach($attrs['telephoneNumber'] as $tele){