Show
Ignore:
Timestamp:
09/05/06 00:03:06 (7 years ago)
Author:
qldrob
Message:

Let static queue members be left in the order that they're entered.

Files:

Legend:

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

    r1889 r2276  
    140140  // now add to queues table 
    141141  $fields = array( 
    142     array($account,'account',$account), 
    143     array($account,'maxlen',($_REQUEST['maxlen'])?$_REQUEST['maxlen']:'0'), 
    144     array($account,'joinempty',($_REQUEST['joinempty'])?$_REQUEST['joinempty']:'yes'), 
    145     array($account,'leavewhenempty',($_REQUEST['leavewhenempty'])?$_REQUEST['leavewhenempty']:'no'), 
    146     array($account,'strategy',($_REQUEST['strategy'])?$_REQUEST['strategy']:'ringall'), 
    147     array($account,'timeout',($_REQUEST['timeout'])?$_REQUEST['timeout']:'15'), 
    148     array($account,'retry',($_REQUEST['retry'])?$_REQUEST['retry']:'5'), 
    149     array($account,'wrapuptime',($_REQUEST['wrapuptime'])?$_REQUEST['wrapuptime']:'0'), 
     142    array($account,'account',$account,0), 
     143    array($account,'maxlen',($_REQUEST['maxlen'])?$_REQUEST['maxlen']:'0',0), 
     144    array($account,'joinempty',($_REQUEST['joinempty'])?$_REQUEST['joinempty']:'yes',0), 
     145    array($account,'leavewhenempty',($_REQUEST['leavewhenempty'])?$_REQUEST['leavewhenempty']:'no',0), 
     146    array($account,'strategy',($_REQUEST['strategy'])?$_REQUEST['strategy']:'ringall',0), 
     147    array($account,'timeout',($_REQUEST['timeout'])?$_REQUEST['timeout']:'15',0), 
     148    array($account,'retry',($_REQUEST['retry'])?$_REQUEST['retry']:'5',0), 
     149    array($account,'wrapuptime',($_REQUEST['wrapuptime'])?$_REQUEST['wrapuptime']:'0',0), 
    150150    //array($account,'agentannounce',($_REQUEST['agentannounce'])?$_REQUEST['agentannounce']:'None'), 
    151     array($account,'announce-frequency',($_REQUEST['announcefreq'])?$_REQUEST['announcefreq']:'0'), 
    152     array($account,'announce-holdtime',($_REQUEST['announceholdtime'])?$_REQUEST['announceholdtime']:'no'), 
    153     array($account,'queue-youarenext',($_REQUEST['announceposition']=='no')?'':'queue-youarenext'),  //if no, play no sound 
    154     array($account,'queue-thereare',($_REQUEST['announceposition']=='no')?'':'queue-thereare'),  //if no, play no sound 
    155     array($account,'queue-callswaiting',($_REQUEST['announceposition']=='no')?'':'queue-callswaiting'),  //if no, play no sound 
    156     array($account,'queue-thankyou',$qthanku), 
    157     array($account,'context',$context),  
    158     array($account,'monitor-format',($_REQUEST['monitor-format'])?$_REQUEST['monitor-format']:''), 
    159     array($account,'monitor-join','yes'), 
    160     array($account,'music',($_REQUEST['music'])?$_REQUEST['music']:'default')); 
     151    array($account,'announce-frequency',($_REQUEST['announcefreq'])?$_REQUEST['announcefreq']:'0',0), 
     152    array($account,'announce-holdtime',($_REQUEST['announceholdtime'])?$_REQUEST['announceholdtime']:'no',0), 
     153    array($account,'queue-youarenext',($_REQUEST['announceposition']=='no')?'':'queue-youarenext',0),  //if no, play no sound 
     154    array($account,'queue-thereare',($_REQUEST['announceposition']=='no')?'':'queue-thereare',0),  //if no, play no sound 
     155    array($account,'queue-callswaiting',($_REQUEST['announceposition']=='no')?'':'queue-callswaiting',0),  //if no, play no sound 
     156    array($account,'queue-thankyou',$qthanku,0), 
     157    array($account,'context',$context,0),  
     158    array($account,'monitor-format',($_REQUEST['monitor-format'])?$_REQUEST['monitor-format']:'',0), 
     159    array($account,'monitor-join','yes',0), 
     160    array($account,'music',($_REQUEST['music'])?$_REQUEST['music']:'default',0)); 
    161161 
    162162  //there can be multiple members 
    163163  if (isset($members)) { 
     164    $count = 0; 
    164165    foreach ($members as $member) { 
    165       $fields[] = array($account,'member',$member); 
    166     } 
    167   } 
    168  
    169     $compiled = $db->prepare('INSERT INTO queues (id, keyword, data) values (?,?,?)'); 
     166      $fields[] = array($account,'member',$member,$count); 
     167      $count++; 
     168    } 
     169  } 
     170 
     171    $compiled = $db->prepare('INSERT INTO queues (id, keyword, data, flags) values (?,?,?,?)'); 
    170172  $result = $db->executeMultiple($compiled,$fields); 
    171173    if(DB::IsError($result)) { 
     
    223225 
    224226  //okay, but there can be multiple member variables ... do another select for them 
    225   $sql = "SELECT data FROM queues WHERE id = '$account' AND keyword = 'member'"; 
     227  $sql = "SELECT data FROM queues WHERE id = '$account' AND keyword = 'member' order by flags"; 
    226228  $results['member'] = $db->getCol($sql); 
    227229   
  • modules/branches/2.2/queues/page.queues.php

    r2248 r2276  
    7676   
    7777  // check for duplicates, and re-sequence 
    78   $members = array_values(array_unique($members)); 
     78  // $members = array_values(array_unique($members)); 
    7979} 
    8080