Changeset 4640

Show
Ignore:
Timestamp:
08/02/07 13:12:22 (1 year ago)
Author:
p_lindheimer
Message:

added xml attribute needsenginedb, #1961 enabled to work with extension numbers leading with 0s

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.3/findmefollow/functions.inc.php

    r4312 r4640  
    187187        global $astman; 
    188188 
    189         $sql = "INSERT INTO findmefollow (grpnum, strategy, grptime, grppre, grplist, annmsg, postdest, dring, needsconf, remotealert, toolate, ringing, pre_ring) VALUES (".$grpnum.", '".str_replace("'", "''", $strategy)."', ".str_replace("'", "''", $grptime).", '".str_replace("'", "''", $grppre)."', '".str_replace("'", "''", $grplist)."', '".str_replace("'", "''", $annmsg)."', '".str_replace("'", "''", $postdest)."', '".str_replace("'", "''", $dring)."', '$needsconf', '$remotealert', '$toolate', '$ringing', '$pre_ring')"; 
     189        $sql = "INSERT INTO findmefollow (grpnum, strategy, grptime, grppre, grplist, annmsg, postdest, dring, needsconf, remotealert, toolate, ringing, pre_ring) VALUES ('".str_replace("'", "''",$grpnum)."', '".str_replace("'", "''", $strategy)."', ".str_replace("'", "''", $grptime).", '".str_replace("'", "''", $grppre)."', '".str_replace("'", "''", $grplist)."', '".str_replace("'", "''", $annmsg)."', '".str_replace("'", "''", $postdest)."', '".str_replace("'", "''", $dring)."', '$needsconf', '$remotealert', '$toolate', '$ringing', '$pre_ring')"; 
    190190        $results = sql($sql); 
    191191 
     
    211211        global $astman; 
    212212 
    213         $results = sql("DELETE FROM findmefollow WHERE grpnum = $grpnum","query"); 
     213        $results = sql("DELETE FROM findmefollow WHERE grpnum = '".str_replace("'", "''", $grpnum)."'","query"); 
    214214 
    215215        if ($astman) { 
     
    221221 
    222222function findmefollow_full_list() { 
    223         $results = sql("SELECT grpnum FROM findmefollow ORDER BY grpnum","getAll",DB_FETCHMODE_ASSOC); 
     223        $results = sql("SELECT grpnum FROM findmefollow ORDER BY CAST(grpnum as UNSIGNED)","getAll",DB_FETCHMODE_ASSOC); 
    224224        foreach ($results as $result) { 
    225225                if (isset($result['grpnum']) && checkRange($result['grpnum'])) { 
     
    236236 
    237237        global $db; 
    238         $sql = "SELECT grpnum FROM findmefollow ORDER BY grpnum"; 
     238        $sql = "SELECT grpnum FROM findmefollow ORDER BY CAST(grpnum as UNSIGNED)"; 
    239239        $results = $db->getCol($sql); 
    240240        if(DB::IsError($results)) { 
     
    293293        global $astman; 
    294294 
    295         $results = sql("SELECT grpnum, strategy, grptime, grppre, grplist, annmsg, postdest, dring, needsconf, remotealert, toolate, ringing, pre_ring FROM findmefollow WHERE grpnum = $grpnum","getRow",DB_FETCHMODE_ASSOC); 
     295        $results = sql("SELECT grpnum, strategy, grptime, grppre, grplist, annmsg, postdest, dring, needsconf, remotealert, toolate, ringing, pre_ring FROM findmefollow WHERE grpnum = '".str_replace("'", "''", $grpnum)."'","getRow",DB_FETCHMODE_ASSOC); 
    296296 
    297297        if ($check_astdb) { 
     
    349349                        $sql = "UPDATE findmefollow SET grptime = '".$results['grptime']."', grplist = '". 
    350350                                str_replace("'", "''", trim($results['grplist']))."', pre_ring = '".$results['pre_ring']. 
    351                                 "', needsconf = '".$results['needsconf']."' WHERE grpnum = $grpnum LIMIT 1"; 
     351                                "', needsconf = '".$results['needsconf']."' WHERE grpnum = '".str_replace("'", "''", $grpnum)."' LIMIT 1"; 
    352352                        $sql_results = sql($sql); 
    353353                } 
  • modules/branches/2.3/findmefollow/install.php

    r4158 r4640  
    5151                $new_dest = merge_ext_followme(trim($old_dest)); 
    5252                if ($new_dest != $old_dest) { 
    53                         $sql = "UPDATE findmefollow SET postdest = '$new_dest' WHERE grpnum = $grpnum  AND postdest = '$old_dest'"; 
     53                        $sql = "UPDATE findmefollow SET postdest = '$new_dest' WHERE grpnum = '$grpnum'  AND postdest = '$old_dest'"; 
    5454                        $results = $db->query($sql); 
    5555                        if(DB::IsError($results)) { 
     
    9191} 
    9292 
     93// Version 2.4.13 change (#1961) 
     94// 
     95$results = $db->query("ALTER TABLE `findmefollow` CHANGE `grpnum` `grpnum` VARCHAR( 20 ) NOT NULL"); 
     96if(DB::IsError($results)) { 
     97        echo $results->getMessage(); 
     98        return false; 
     99} 
     100 
    93101?> 
  • modules/branches/2.3/findmefollow/install.sql

    r4102 r4640  
    11 
    2 CREATE TABLE IF NOT EXISTS `findmefollow` ( `grpnum` BIGINT( 11 ) NOT NULL , `strategy` VARCHAR( 50 ) NOT NULL , `grptime` SMALLINT NOT NULL , `grppre` VARCHAR( 100 ) NULL , `grplist` VARCHAR( 255 ) NOT NULL , `annmsg` VARCHAR( 255 ) NULL , `postdest` VARCHAR( 255 ) NULL , `dring` VARCHAR ( 255 ) NULL , remotealert VARCHAR ( 80 ), needsconf VARCHAR ( 10 ), toolate VARCHAR ( 80 ), pre_ring SMALLINT NOT NULL DEFAULT 0, PRIMARY KEY  (`grpnum`) ) TYPE = MYISAM ; 
     2CREATE TABLE IF NOT EXISTS `findmefollow` ( `grpnum` VARCHAR( 20 ) NOT NULL , `strategy` VARCHAR( 50 ) NOT NULL , `grptime` SMALLINT NOT NULL , `grppre` VARCHAR( 100 ) NULL , `grplist` VARCHAR( 255 ) NOT NULL , `annmsg` VARCHAR( 255 ) NULL , `postdest` VARCHAR( 255 ) NULL , `dring` VARCHAR ( 255 ) NULL , remotealert VARCHAR ( 80 ), needsconf VARCHAR ( 10 ), toolate VARCHAR ( 80 ), pre_ring SMALLINT NOT NULL DEFAULT 0, PRIMARY KEY  (`grpnum`) ) TYPE = MYISAM ; 
    33 
  • modules/branches/2.3/findmefollow/module.xml

    r4313 r4640  
    22        <rawname>findmefollow</rawname> 
    33        <name>Follow Me</name> 
    4         <version>2.4.12.3</version> 
     4        <version>2.4.13</version> 
    55        <changelog> 
     6                *2.4.13* added xml attribute needsenginedb, #1961 enabled to work with extension numbers leading with 0s 
    67                *2.4.12.3* #2057 don't strip CID prefix if no prefix is being added 
    78                *2.4.12.2* merge findmefollow/core extension destinations if any, and remove findmefollow destinations as a destination since they are handled by core 
     
    3839        </description> 
    3940        <menuitems> 
    40                 <findmefollow>Follow Me</findmefollow> 
     41                <findmefollow needsenginedb="yes">Follow Me</findmefollow> 
    4142        </menuitems> 
    4243        <location>release/2.3/findmefollow-2.4.12.3.tgz</location> 
  • modules/branches/2.3/findmefollow/page.findmefollow.php

    r3894 r4640  
    125125                // We need to populate grplist with the existing extension list. 
    126126                $thisgrp = findmefollow_get(ltrim($extdisplay,'GRP-'), 1); 
    127                 $grpliststr = $thisgrp['grplist']
     127                $grpliststr = isset($thisgrp['grplist']) ? $thisgrp['grplist'] : ''
    128128                $grplist = explode("-", $grpliststr); 
    129                 $strategy = $thisgrp['strategy']; 
    130                 $grppre = $thisgrp['grppre']; 
    131                 $grptime = $thisgrp['grptime']; 
    132                 $goto = $thisgrp['postdest']; 
    133                 $annmsg = $thisgrp['annmsg']; 
    134                 $dring = $thisgrp['dring']; 
    135                 $remotealert = $thisgrp['remotealert']; 
    136                 $needsconf = $thisgrp['needsconf']; 
    137                 $toolate = $thisgrp['toolate']; 
    138                 $ringing = $thisgrp['ringing']; 
    139                 $pre_ring = $thisgrp['pre_ring']; 
    140                 $ddial = $thisgrp['ddial']; 
     129 
     130                $strategy    = isset($thisgrp['strategy'])    ? $thisgrp['strategy']    : ''; 
     131                $grppre      = isset($thisgrp['grppre'])      ? $thisgrp['grppre']      : ''; 
     132                $grptime     = isset($thisgrp['grptime'])     ? $thisgrp['grptime']     : ''; 
     133                $goto        = isset($thisgrp['postdest'])    ? $thisgrp['postdest']    : ''; 
     134                $annmsg      = isset($thisgrp['annmsg'])      ? $thisgrp['annmsg']      : ''; 
     135                $dring       = isset($thisgrp['dring'])       ? $thisgrp['dring']       : ''; 
     136                $remotealert = isset($thisgrp['remotealert']) ? $thisgrp['remotealert'] : ''; 
     137                $needsconf   = isset($thisgrp['needsconf'])   ? $thisgrp['needsconf']   : ''; 
     138                $toolate     = isset($thisgrp['toolate'])     ? $thisgrp['toolate']     : ''; 
     139                $ringing     = isset($thisgrp['ringing'])     ? $thisgrp['ringing']     : ''; 
     140                $pre_ring    = isset($thisgrp['pre_ring'])    ? $thisgrp['pre_ring']    : ''; 
     141                $ddial       = isset($thisgrp['ddial'])       ? $thisgrp['ddial']       : ''; 
    141142                unset($grpliststr); 
    142143                unset($thisgrp); 
     
    374375function checkGRP(theForm) { 
    375376        var msgInvalidGrpNum = "<?php echo _('Invalid Group Number specified'); ?>"; 
    376         var msgInvalidGrpNumStartWithZero = "<?php echo _('Group numbers with more than one digit cannot begin with 0'); ?>"; 
    377377        var msgInvalidExtList = "<?php echo _('Please enter an extension list.'); ?>"; 
    378378        var msgInvalidGrpPrefix = "<?php echo _('Invalid prefix. Valid characters: a-z A-Z 0-9 : _ -'); ?>";