Changeset 3707
- Timestamp:
- 02/06/07 00:50:30 (6 years ago)
- Files:
-
- modules/branches/2.3 (modified) (1 prop)
- modules/branches/2.3/ivr/functions.inc.php (modified) (6 diffs)
- modules/branches/2.3/ivr/install.php (modified) (1 diff)
- modules/branches/2.3/ivr/install.sql (modified) (1 diff)
- modules/branches/2.3/ivr/module.xml (modified) (2 diffs)
- modules/branches/2.3/ivr/page.ivr.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.3
- Property svnmerge-integrated changed from /modules/branches/2.2:1-3588,3615-3635,3637-3638,3640,3674,3680,3686,3692,3702 to /modules/branches/2.2:1-3588,3615-3635,3637-3638,3640,3674,3680,3686,3692,3702,3706
modules/branches/2.3/ivr/functions.inc.php
r3681 r3707 47 47 // s == old stuff. We don't care. 48 48 if ($arr[0] != 's') 49 ivr_add_command($id,$cmd['extension'],$cmd['args'] );49 ivr_add_command($id,$cmd['extension'],$cmd['args'],0); 50 50 } 51 51 } … … 149 149 $ext->add($id, 's', '', new ext_setvar('LOOPCOUNT', 0)); 150 150 $ext->add($id, 's', '', new ext_setvar('__DIR-CONTEXT', $details['dircontext'])); 151 $ext->add($id, 's', '', new ext_setvar('IVR_CONTEXT_${CONTEXT}', '${IVR_CONTEXT}')); 151 152 $ext->add($id, 's', '', new ext_setvar('_IVR_CONTEXT', '${CONTEXT}')); 152 153 $ext->add($id, 's', '', new ext_answer('')); … … 169 170 $ext->add($id, $dest['selection'],'', new ext_dbdel('${BLKVM_OVERRIDE}')); 170 171 $ext->add($id, $dest['selection'],'', new ext_setvar('__NODEST', '')); 171 $ext->add($id, $dest['selection'],'', new ext_goto($dest['dest'])); 172 if ($dest['ivr_ret']) { 173 $ext->add($id, $dest['selection'],'', new ext_gotoif('$["x${IVR_CONTEXT_${CONTEXT}}" = "x"]', $dest['dest'].':${IVR_CONTEXT_${CONTEXT}},s,1')); 174 } else { 175 $ext->add($id, $dest['selection'],'', new ext_goto($dest['dest'])); 176 } 172 177 } 173 178 } … … 209 214 } 210 215 211 function ivr_add_command($id, $cmd, $dest ) {216 function ivr_add_command($id, $cmd, $dest, $ivr_ret) { 212 217 global $db; 213 218 // Does it already exist? 214 219 $res = $db->getRow("SELECT * from ivr_dests where ivr_id='$id' and selection='$cmd'"); 220 $ivr_ret = $ivr_ret ? 1 : 0; 215 221 if (count($res) == 0) { 216 222 // Just add it. 217 sql("INSERT INTO ivr_dests VALUES('$id', '$cmd', '$dest' )");223 sql("INSERT INTO ivr_dests VALUES('$id', '$cmd', '$dest', '$ivr_ret')"); 218 224 } else { 219 225 // Update it. 220 sql("UPDATE ivr_dests SET dest='$dest' where ivr_id='$id' and selection='$cmd'");226 sql("UPDATE ivr_dests SET dest='$dest', ivr_ret='$ivr_ret' where ivr_id='$id' and selection='$cmd'"); 221 227 } 222 228 needreload(); … … 250 256 $dest = $post[$post[$var].$match[1]]; 251 257 $cmd = $post['option'.$match[1]]; 258 $ivr_ret = $post['ivr_ret'.$match[1]]; 252 259 // Debugging if it all goes pear shaped. 253 260 // print "I think pushing $cmd does $dest<br>\n"; 254 261 if (strlen($cmd)) 255 ivr_add_command($id, $cmd, $dest );262 ivr_add_command($id, $cmd, $dest, $ivr_ret); 256 263 } 257 264 } … … 285 292 global $db; 286 293 287 $sql = "SELECT selection, dest FROM ivr_dests where ivr_id='$id' ORDER BY selection";294 $sql = "SELECT selection, dest, ivr_ret FROM ivr_dests where ivr_id='$id' ORDER BY selection"; 288 295 $res = $db->getAll($sql, DB_FETCHMODE_ASSOC); 289 296 if(DB::IsError($res)) { modules/branches/2.3/ivr/install.php
r1911 r3707 55 55 } 56 56 57 // Version 2.5.7 adds auto-return to IVR 58 $sql = "SELECT ivr_ret FROM ivr_dests"; 59 $check = $db->getRow($sql, DB_FETCHMODE_ASSOC); 60 if(DB::IsError($check)) { 61 // add new field 62 $sql = "ALTER TABLE ivr_dests ADD ivr_ret TINYINT(1) NOT NULL DEFAULT 0;"; 63 $result = $db->query($sql); 64 if(DB::IsError($result)) { die($result->getDebugInfo()); } 65 } 66 57 67 ?> modules/branches/2.3/ivr/install.sql
r1627 r3707 1 1 CREATE TABLE IF NOT EXISTS ivr ( ivr_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, displayname VARCHAR(50), deptname VARCHAR(50), enable_directory VARCHAR(8), enable_directdial VARCHAR(8), timeout INT, announcement VARCHAR(255), dircontext VARCHAR ( 50 ) DEFAULT "default" ); 2 CREATE TABLE IF NOT EXISTS ivr_dests ( ivr_id INT NOT NULL, selection VARCHAR(10), dest VARCHAR(50) );2 CREATE TABLE IF NOT EXISTS ivr_dests ( ivr_id INT NOT NULL, selection VARCHAR(10), dest VARCHAR(50), ivr_ret TINYINT(1) NOT NULL DEFAULT 0); modules/branches/2.3/ivr/module.xml
r3684 r3707 2 2 <rawname>ivr</rawname> 3 3 <name>IVR</name> 4 <version>2.5. 6</version>4 <version>2.5.7</version> 5 5 <type>setup</type> 6 6 <category>Inbound Call Control</category> … … 9 9 </description> 10 10 <changelog> 11 *2.5.7* extended schema and added ability to have ivr options to return to calling parent ivrs if appropriate, otherwise specified destination 11 12 *2.5.6* Added: Set(IVR_CONTEXT=${CONTEXT}) to facilitate simple returns to calling context (e.g. from an announcement or custom app) 12 13 *2.5.5* Fix bug #1651 and apply patch #1664, allow voicemail as destination if ivr is entered from a queue breakout option modules/branches/2.3/ivr/page.ivr.php
r3589 r3707 202 202 if (!empty($dests)) { 203 203 foreach ($dests as $dest) { 204 drawdestinations($count, $dest['selection'], $dest['dest'] );204 drawdestinations($count, $dest['selection'], $dest['dest'], $dest['ivr_ret']); 205 205 $count++; 206 206 } 207 207 } 208 208 while ($count < $nbroptions) { 209 drawdestinations($count, null, null );209 drawdestinations($count, null, null, 0); 210 210 $count++; 211 211 } … … 275 275 } 276 276 277 function drawdestinations($count, $sel, $dest ) { ?>277 function drawdestinations($count, $sel, $dest, $ivr_ret) { ?> 278 278 <tr> <td style="text-align:right;"> 279 280 <small><a href="#" class="info"><?php echo _("Return to IVR")?><span><?php echo _("Check this box to have this option return to a parent IVR if it was called from a parent IVR. If not, it will go to the chosen destination.<br><br>The return path will be to any IVR that was in the call path prior to this IVR which could lead to strange results if there was an IVR called in the call path but not immediately before this")?></span></a></small><input type="checkbox" name="ivr_ret<?php echo $count ?>" "<?php echo $ivr_ret?'CHECKED':''; ?>"<br /> 279 281 <input size="2" type="text" name="option<?php echo $count ?>" value="<?php echo $sel ?>"><br /> 280 282 <?php if (strlen($sel)) { ?>
