Changeset 8787

Show
Ignore:
Timestamp:
02/07/10 18:01:17 (7 months ago)
Author:
p_lindheimer
Message:

closes #2085 cleans up initially untested checking, only toggle feature code is still untested

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.7/queues/functions.inc.php

    r8785 r8787  
    561561} 
    562562 
    563 function queues_add($account,$name,$password,$prefix,$goto,$agentannounce_id,$members,$joinannounce_id,$maxwait,$alertinfo='',$cwignore='0',$qregex='',$queuewait='0', $use_queue_context='0', $dynmembers = '', $dynmemberonly = '') { 
     563function queues_add($account,$name,$password,$prefix,$goto,$agentannounce_id,$members,$joinannounce_id,$maxwait,$alertinfo='',$cwignore='0',$qregex='',$queuewait='0', $use_queue_context='0', $dynmembers = '', $dynmemberonly = 'no') { 
    564564  global $db,$astman,$amp_conf; 
    565565 
     
    643643  // store dynamic member data in astDB 
    644644        if ($astman) { 
     645    $dynmembers = array_unique($dynmembers); 
    645646          foreach($dynmembers as $member){ 
    646647          $mem=explode(',',$member); 
    647           $astman->database_put('QPENALTY/'.$account.'/agents',$mem[0],$mem[1]); 
     648      if (isset($mem[0]) && trim($mem[0]) != '') { 
     649        $penalty = isset($mem[1]) && ctype_digit(trim($mem[1])) ? $mem[1] : 0; 
     650            $astman->database_put('QPENALTY/'.$account.'/agents',trim($mem[0]),trim($penalty)); 
     651      } 
    648652    } 
    649653          $astman->database_put('QPENALTY/'.$account,'dynmemberonly',$dynmemberonly); 
     
    886890                  foreach($get as $key => $value){ 
    887891                          $key=explode('/',$key); 
    888                           $mem[$key[3]]=$value; 
     892                          $mem[$key[4]]=$value; 
    889893                  } 
    890894                  foreach($mem as $mem => $pnlty){ 
    891895                          $dynmem[]=$mem.','.$pnlty; 
    892896                  } 
    893           } 
    894           $results['dynmembers']=implode("\n",$dynmem); 
    895           $results['dynmeberonly'] = $astman->database_get('QPENALTY/'.$account,'dynmemberonly'); 
     897            $results['dynmembers']=implode("\n",$dynmem); 
     898          } else { 
     899            $results['dynmembers']=''; 
     900     } 
     901          $results['dynmemberonly'] = $astman->database_get('QPENALTY/'.$account,'dynmemberonly'); 
    896902        } else { 
    897903                fatal("Cannot connect to Asterisk Manager with ".$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"]); 
  • modules/branches/2.7/queues/module.xml

    r8785 r8787  
    22        <rawname>queues</rawname> 
    33        <name>Queues</name> 
    4         <version>2.7.0beta1.0</version> 
     4        <version>2.7.0beta1.1</version> 
    55        <publisher>FreePBX</publisher> 
    66        <license>GPLv2+</license> 
  • modules/branches/2.7/queues/page.queues.php

    r8786 r8787  
    256256                </td> 
    257257                <td> 
    258                         <select onChange="insertExten();" id="insexten" tabindex="<?php echo ++$tabindex;?>"> 
     258                        <select onChange="insertExten('');" id="insexten" tabindex="<?php echo ++$tabindex;?>"> 
    259259                                <option value=""><?php echo _("(pick extension)")?></option> 
    260260        <?php 
     
    269269 
    270270        <tr> 
    271                 <td valign="top"><a href="#" class="info"><?php echo _('Dynamic Member Penalty') ?>:<span><br><?php echo _("Dynamic Members are extensions that can log in and out of the queue. When a member logges in to a queue, their penalty in the queue will be as specified here. Extensions included here will NOT be automaticlay logged in to the queue.") ?><br><br></span></a></td> 
     271                <td valign="top"><a href="#" class="info"><?php echo _('Dynamic Members') ?>:<span><br><?php echo _("Dynamic Members are extensions or callback numbers that can log in and out of the queue. When a member logs in to a queue, their penalty in the queue will be as specified here. Extensions included here will NOT automatically be logged in to the queue.") ?><br><br></span></a></td> 
    272272                <td valign="top"> 
    273273                        <textarea id="dynmembers" cols="15" rows="<?php  $rows = count($dynmembers)+1; echo (($rows < 5) ? 5 : (($rows > 20) ? 20 : $rows) ); ?>" name="dynmembers" tabindex="<?php echo ++$tabindex;?>"><?php echo $dynmembers; ?></textarea> 
     
    279279                <a href=# class="info"><?php echo _("Extension Quick Pick")?> 
    280280                        <span> 
    281                                 <?php echo _("Choose an extension to append to the end of the dynamic memebers list above.")?> 
     281                                <?php echo _("Choose an extension to append to the end of the dynamic memeber list above.")?> 
    282282                        </span> 
    283283                </a> 
     
    297297 
    298298        <tr> 
    299           <td><a href="#" class="info"><?php echo _("Allow only these?")?><span><?php echo _('Restrict dynamic queue memeber logins to only thoes listed in previous option. When set to yes, members not listed will be DENIED ACCESS to the queue.')?></span></a></td> 
    300     <td><input type="radio" name="dynmemberonly" value="yes" <?php echo ($dynmemberonly=='yes'?'checked':'');?>><?php echo _('Yes')?><input type="radio" name="dynmemberonly" value="yes" <?php echo ($dynmemberonly!='yes'?'checked':'');?> ><?php echo _('No')?> 
     299          <td><a href="#" class="info"><?php echo _("Restrict Dynamic Agents")?><span><?php echo _('Restrict dynamic queue member logins to only thoes listed in the Dynamic Members list above. When set to Yes, members not listed will be DENIED ACCESS to the queue.')?></span></a></td> 
     300    <td><input type="radio" name="dynmemberonly" value="yes" <?php echo ($dynmemberonly=='yes'?'checked':'');?>><?php echo _('Yes')?><input type="radio" name="dynmemberonly" value="no" <?php echo ($dynmemberonly!='yes'?'checked':'');?> ><?php echo _('No')?> 
    301301                </td> 
    302302        </tr>