Changeset 9410

Show
Ignore:
Timestamp:
03/27/10 17:06:12 (3 years ago)
Author:
p_lindheimer
Message:

Merged revisions 9396-9409 via svnmerge from
http://svn.freepbx.org/modules/branches/2.7

........

r9407 | p_lindheimer | 2010-03-27 09:50:51 -0700 (Sat, 27 Mar 2010) | 1 line


move uninstall table removes to php script, minor changes to page layout, some localization impacts and added info under delete button indicating how many DIDs affected if a source is deleted

........

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.8

    • Property svnmerge-integrated changed from /modules/branches/2.7:1-9395 to /modules/branches/2.7:1-9409
  • modules/branches/2.8/cidlookup

    • Property lastpublish changed from 9010 to 9407
  • modules/branches/2.8/cidlookup/functions.inc.php

    r8116 r9410  
    232232} 
    233233 
    234 function cidlookup_did_list() { 
     234function cidlookup_did_list($id=false) { 
    235235  $sql = " 
    236236  SELECT cidlookup_id, a.extension extension, a.cidnum cidnum, pricid FROM cidlookup_incoming a  
     
    238238  ON a.extension = b.extension AND a.cidnum = b.cidnum 
    239239  "; 
     240  if ($id !== false && ctype_digit($id)) { 
     241    $sql .= " WHERE cidlookup_id = '$id'"; 
     242  } 
    240243 
    241244  $results = sql($sql,"getAll",DB_FETCHMODE_ASSOC); 
    242   return is_array($results)?$results:null
     245  return is_array($results)?$results:array()
    243246} 
    244247 
  • modules/branches/2.8/cidlookup/module.xml

    r9011 r9410  
    22  <rawname>cidlookup</rawname> 
    33  <name>Caller ID Lookup</name> 
    4   <version>2.7.0.0</version> 
     4  <version>2.7.0.1</version> 
    55  <publisher>FreePBX</publisher> 
    66  <license>GPLv2+</license> 
     
    1515    <module>core ge 2.5.1.2</module> 
    1616  </depends> 
    17   <location>release/2.7/cidlookup-2.7.0.0.tgz</location> 
    18   <md5sum>7db9e3bb987370f8230b180230ef48fe</md5sum> 
     17  <location>release/2.7/cidlookup-2.7.0.1.tgz</location> 
     18  <md5sum>45a30d653996845025a9ba510edde5b5</md5sum> 
    1919  <changelog> 
     20    *2.7.0.1* might effect #3979 
    2021    *2.7.0.0* localizations 
    2122    *2.6.0.1* #3599, #3821 
  • modules/branches/2.8/cidlookup/page.cidlookup.php

    r8968 r9410  
    6969    //get details for this source 
    7070    $thisItem = cidlookup_get($itemid); 
    71   } else { 
    72     $thisItem = Array( 'description' => null, 'sourcetype' => null, 'cache' => null); 
    73   } 
    74  
    75   $delURL = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].'&action=delete'; 
    76   $delButton = " 
     71    $delButton = " 
    7772      <form name=delete action=\"{$_SERVER['PHP_SELF']}\" method=POST> 
    7873        <input type=\"hidden\" name=\"display\" value=\"{$dispnum}\"> 
     
    8176        <input type=submit value=\""._("Delete CID Lookup source")."\"> 
    8277      </form>"; 
    83    
    84 ?> 
    85  
    86   <h2><?php echo ($itemid ? _("Source:")." ". $itemid : _("Add Source")); ?></h2> 
     78    $dids_using_arr = cidlookup_did_list($itemid); 
     79    $dids_using = count($dids_using_arr); 
     80    if ($dids_using) { 
     81      $delButton .= '<small>'.sprintf(_("There are %s DIDs using this source that will no longer have lookups if deleted."),$dids_using).'</small>'; 
     82    } 
     83    $thisItem_description = isset($thisItem['description']) ? htmlspecialchars($thisItem['description']):''; 
     84 
     85  } else { 
     86    $thisItem = Array( 'description' => '', 'sourcetype' => null, 'cache' => null); 
     87  } 
     88?> 
     89  <h2><?php echo ($itemid ? sprintf(_("Source: %s (id %s)"),$thisItem_description,$itemid) : _("Add Source")); ?></h2> 
    8790   
    8891  <p style="width: 80%"><?php echo ($itemid ? '' : _("A Lookup Source let you specify a source for resolving numeric caller IDs of incoming calls, you can then link an Inbound route to a specific CID source. This way you will have more detailed CDR reports with informations taken directly from your CRM. You can also install the phonebook module to have a small number <-> name association. Pay attention, name lookup may slow down your PBX")); ?></p> 
     
    103106  <tr> 
    104107    <td><a href="#" class="info"><?php echo _("Source Description:")?><span><?php echo _("Enter a description for this source.")?></span></a></td> 
    105     <td><input type="text" name="description" value="<?php echo (isset($thisItem['description']) ? $thisItem['description'] : ''); ?>" tabindex="<?php echo ++$tabindex;?>"></td> 
     108    <td><input type="text" name="description" value="<?php echo $thisItem_description; ?>" tabindex="<?php echo ++$tabindex;?>"></td> 
    106109  </tr> 
    107110  <tr> 
  • modules/branches/2.8/cidlookup/uninstall.php

    r7903 r9410  
    1616// 
    1717 
    18 needreload(); 
    19  
     18sql('DROP TABLE IF EXISTS cidlookup'); 
     19sql('DROP TABLE IF EXISTS cidlookup_incoming'); 
    2020?>