Show
Ignore:
Timestamp:
04/25/09 19:57:05 (4 years ago)
Author:
xrobau
Message:

Fixed a bug with route names being displayed incorrectly when they contained hyphens.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • contributed_modules/modules/routepermissions/functions.inc.php

    r7566 r7582  
    154154  foreach ($res as $r) { 
    155155    $pieces = explode("-", $r[0]); 
    156     $arr[] = $pieces[2]; 
     156    // $pieces[0] = 'outrt', $pieces[1] = a number, pieces 2+ are the route name. 
     157    array_shift ($pieces); 
     158    array_shift ($pieces); 
     159    $arr[] = implode('-', $pieces); 
    157160  }  
    158161  return $arr; 
  • contributed_modules/modules/routepermissions/install.php

    r7569 r7582  
    4444 
    4545// Check to see if there's data in the table allready - if so, don't touch. 
     46// FIXME - todo. 
    4647 
    4748// If there's not, propogate all extensions and all trunks with YES permissions 
     
    5556  foreach ($routes as $r) { 
    5657    $pieces = explode("-", $r[0]);  
    57 //    out("INSERT INTO routepermissions (exten, routename, allowed) VALUES ('$ext[0]', '$pieces[2]', 'YES');"); 
    58     $db->query("INSERT INTO routepermissions (exten, routename, allowed) VALUES ('$ext[0]', '$pieces[2]', 'YES');"); 
     58    array_shift ($pieces); 
     59                array_shift ($pieces); 
     60                $rn = implode('-', $pieces;) 
     61   
     62    $db->query("INSERT INTO routepermissions (exten, routename, allowed) VALUES ('$ext[0]', '$rn', 'YES');"); 
    5963  } 
    6064} 
  • contributed_modules/modules/routepermissions/module.xml

    r7567 r7582  
    22  <rawname>routepermissions</rawname> 
    33  <name>Outbound Route Permissions</name> 
    4   <version>0.1.0.0</version> 
     4  <version>0.2.0.0</version> 
    55  <candisable>yes</candisable> 
    66  <canuninstall>yes</canuninstall> 
    77  <changelog> 
    88    *0.1.0.0* Original Release 
     9    *0.2.0.0* Fixed bug with routenames not being displayed properly if they contained a hyphen 
    910  </changelog> 
    1011  <description>