Changeset 7131

Show
Ignore:
Timestamp:
10/24/08 19:04:49 (5 years ago)
Author:
xrobau
Message:

Able to add using Quick Lookup (except 'range' groups), and the chained comboboxes work. Removal of seletions there, but not implemented.

Files:

Legend:

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

    r7120 r7131  
    33//    Why Pay More 4 Less Pty Ltd (Australia) 2008 
    44// 
    5 //       This is NOT OPEN SOURCE SOFTWARE. 
     5//       THIS IS NOT OPEN SOURCE SOFTWARE. 
    66// 
    77//  Whilst the source is available for you to look at, you  
    8 //  do NOT have a licence to change or re-distribute this  
     8//  do NOT have a licence to change or re-distribute this  
    99//  software.  
    10 // 
    11 //  This specific document, and the databases that accompany it 
    12 //  are licenced for the SOLE USE of Astrogen LLC, otherwise 
    13 //  known as FreePBX, to be distributed SOLEY with the FreePBX 
    14 //  software package. 
    15 // 
     10 
     11//  This specific document, all other associated files, any  
     12//  databases, and the database designs that accompany it 
     13//  are Copyright 2008, and  are licenced for the SOLE USE of  
     14//  Astrogen LLC, otherwise known as FreePBX, to be  
     15//  distributed SOLEY with the FreePBX software package. 
     16 
    1617//  If you wish to licence the redistribution of these 
    17 //  copyrighted documents, database, and database designes,  
    18 //  the ONLY company that is approved to do so is: 
     18//  copyrighted documents, database, and database designs,  
     19//  the ONLY company that is able to do so is: 
    1920 
    2021//    Why Pay More 4 Less Pty Ltd, 
    2122//    1 Grayson st, 
    22 //    Gladstone, QLD, 4680 
     23//    Gladstone, QLD, 4680, AUSTRALIA 
     24// 
     25//   PHYSICAL MAIL only (Electronic mail is not acceptable) 
    2326 
    2427//   If you do not have written permission from this company to 
    25 //   do so, you are violating international copyright laws, and 
    26 //   will be prosecuted to the full extent of the law. 
     28//   redistribute this copyrighted package and do so, you are  
     29//   violating international copyright laws, and will be  
     30//   prosecuted to the FULL EXTENT of the law. 
    2731 
    2832//   You may be asking why this licence is so strict?  At the time 
    29 //   this was written, the Author believed that Fonatity was 
     33//   this was written, the Author believed that Fonality was 
    3034//   involved in numerous GPL Violations with their Trixbox 
    3135//   product.  If and when that is ever resolved, this document 
     
    225229  if(is_array($results)){ 
    226230    foreach($results as $result){ 
    227       $allowed[] = $result; 
     231      $dests[] = $result; 
    228232    } 
    229233  } 
    230   return isset($allowed)?$allowed:null; 
     234  return isset($dests)?$dests:null; 
    231235} 
    232236 
     
    251255 
    252256function cidroute_alter($post){ 
     257  global $db; 
    253258  if (isset($post['addquick'])) { 
    254259    // Check for Range: Area: State: 
     
    258263      print "<br>Adding range ".$defn[1]."\n"; 
    259264    } elseif (strcasecmp($defn[0], "Area") === 0) { 
    260       print "<br>Adding Area ".$defn[1]."\n"; 
     265      $q = "insert into cidroute_matches (country, areacode, min_numb, max_numb, dest) select "; 
     266      $q .= "country, areacode, min_numb, max_numb, ".$db->escapeSimple($post['itemid'])." from "; 
     267      $q .= "cidroute_cidlist where localarea = '".$db->escapeSimple($defn[1])."'"; 
     268      sql($q); 
    261269    } elseif (strcasecmp($defn[0], "State") === 0) { 
    262270      print "<br>Adding State ".$defn[1]."\n"; 
     271      $q = "insert into cidroute_matches (country, areacode, min_numb, max_numb, dest) select "; 
     272      $q .= "country, areacode, min_numb, max_numb, ".$db->escapeSimple($post['itemid'])." from "; 
     273      $q .= "cidroute_cidlist where state = '".$db->escapeSimple($defn[1])."'"; 
     274      sql($q); 
    263275    } elseif (strcasecmp($defn[0], "Region") === 0) { 
    264276      print "<br>Adding region ".$defn[1]."\n"; 
     277      $q = "insert into cidroute_matches (country, areacode, min_numb, max_numb, dest) select "; 
     278      $q .= "country, areacode, min_numb, max_numb, ".$db->escapeSimple($post['itemid'])." from "; 
     279      $q .= "cidroute_cidlist where region = '".$db->escapeSimple($defn[1])."'"; 
     280      sql($q); 
    265281    } 
    266282  } elseif (isset($post['area'])) { 
  • contributed_modules/modules/cidroute/js/comboselect.css

    r7121 r7131  
    1 lxabel, ixnput, #myselect, #myotherselect { 
     1#myselect, #myotherselect { 
    22  display: block; 
    33  float: left; 
     
    2525  display: block; 
    2626  float: left; 
    27   width: 800px
     27  width: 100%
    2828  margin-bottom: 10px; 
    2929  padding: 0; 
     
    3333  display: block; 
    3434  float: left; 
    35   width: 45%; 
     35  width: 47%; 
    3636} 
    3737 
    3838fieldset.comboselect select { 
    39   height: 100px; 
     39  height: 300px; 
    4040} 
    4141 
    4242fieldset.comboselect fieldset { 
    4343  border: 0; 
    44   width: 30px
    45   height: 100px; 
     44  width: 3%
     45  height: 300px; 
    4646  padding: 10px; 
    4747  padding-top: 25px; 
  • contributed_modules/modules/cidroute/js/comboselect.js

    r7121 r7131  
    6969      combo += '<input type="button" class="csremove" value="' + settings.rembtn + '" />'; 
    7070      combo += '</fieldset>'; 
    71       combo += '<select id="' + rightID + '" name="' + rightID + '" class="csright" multiple="multiple">'; 
     71      combo += '<select id="' + rightID + '" name="' + rightID + '[]" class="csright" multiple="multiple">'; 
    7272      combo += '</select>'; 
    7373      combo += '</fieldset>';    
  • contributed_modules/modules/cidroute/page.cidroute.php

    r7121 r7131  
    182182?> 
    183183  </td></tr> 
    184   <tr><td colspan=2><hr></td></tr> 
    185   <tr><td> 
     184  <tr><td colspan=2><hr> 
    186185        <script type="text/javascript" src="modules/cidroute/js/comboselect.js" charset="utf-8"></script> 
    187186  <script type="text/javascript" src="modules/cidroute/js/chainedSelects.js" charset="utf-8"></script> 
     
    223222        }); 
    224223  $(document).ready(function() { 
    225                 $('#myselect').comboselect({ sort: 'both', addbtn: '+',  rembtn: '-' }); 
     224                $('#myselect').comboselect({ sort: 'both', addbtn: '&gt;&gt;',  rembtn: '&lt;&lt;' }); 
    226225  }); 
    227226 
     
    239238        <input type="hidden" name="action" value="alter"> 
    240239  <input type="hidden" name="display" value="<? echo $dispnum; ?>"> 
    241  
    242   Quick Select:</td><td> 
     240  </td></tr> 
     241  <tr><td>Quick Select:</td><td> 
    243242  <input style="width: 200px" type="text" id="quick" name="quick" value="" /> &nbsp; <input type="submit" name="addquick" value="Add" /></td></tr> 
    244243  <tr><td>State:</td><td> <select id="state" name="state"> 
     
    260259  <tr><td>Area:</td><td> 
    261260        <select name="area" id="area"><option value="0">--</option></select></td></tr> 
    262   <tr><td><input type="submit" name="addselect" value="submit" /></td></tr> 
    263   <tr><td>Currently Used Maps</td></tr> 
     261  <tr><td><input type="submit" name="addselect" value="Submit" /></td></tr> 
     262  <tr><td><?php echo _('Currently Selected Areas'); ?></td> 
     263    <td style="text-align: right"><i>Move areas to right hand side to remove</i></td></tr> 
     264   
    264265  <tr><td colspan=2> 
    265266  </form> 
     
    267268   
    268269  <form method="post" action="<? echo $_SERVER['PHP_SELF'] ?>" class="removestuff"> 
    269   <select id="myselect" name="myselect" multiple="multiple"> 
     270        <input type="hidden" name="itemid" value="<? echo $itemid ?>"> 
     271        <input type="hidden" name="action" value="alter"> 
     272  <input type="hidden" name="display" value="<? echo $dispnum; ?>"> 
     273  <select id="myselect" name="myselect[]" multiple="multiple"> 
    270274<? 
    271275  $q = "select  state, region, localarea, cidroute_cidlist.areacode, cidroute_cidlist.min_numb, cidroute_cidlist.max_numb "; 
     
    284288   
    285289  </select> 
     290  </tr></td> 
     291  <tr><td colspan=2 style="text-align: right"><input type="submit" name="delselect" value="Remove Selected" /></td></tr> 
    286292  </form> 
    287293