Changeset 7298

Show
Ignore:
Timestamp:
11/22/08 14:38:07 (5 years ago)
Author:
mbrevda
Message:

auto generate default variables when adding a new setcid

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • contributed_modules/modules/setcid/page.setcid.php

    r7151 r7298  
    5757 
    5858foreach (setcid_list() as $row) { 
    59   echo '<li><a href="config.php?display=setcid&amp;type='.$type.'&amp;extdisplay='.$row['cid_id'].'" class="">'.$row['description'].'</a></li>'; 
     59  echo '<li><a href="config.php?display=setcid&amp;type='.$type.'&amp;extdisplay='.$row['cid_id'].'" class="rnavdata" rnavdata="'.$row['description'].','.$row['cid_name'].','.$row['cid_num'].','.$row['dest'].'">'.$row['description'].'</a></li>'; 
     60 
    6061} 
    6162 
     
    8384$helptext = _("Set CallerID allows you to change the caller id of the call and then continue on to the desired destination. For example, you may want to change the caller id form \"John Doe\" to \"Sales: John Doe\". Please note, the text you enter is what the callerid is changed to. To append to the current callerid, use the proper asterisk variables, such as \"\${CALLERID(name)}\" for the currently set callerid name and \"\${CALLERID(num)}\" for the currently set callerid number."); 
    8485echo $helptext; 
     86echo $row['dest']; 
    8587?> 
    8688 
     
    9799  <tr> 
    98100    <td><a href="#" class="info"><?php echo _("CallerID Name")?>:<span><?php echo _("The CallerID Name that you want to change to. If you are appending to the current callerid, dont forget to include the appropriate asterisk variables. If you leave this box blank, the CallerID name will be blanked");?></span></a></td> 
    99     <td><input size="14" type="text" name="cid_name" value="<?php echo $cid_name; ?>"  tabindex="<?php echo ++$tabindex;?>"/></td> </tr> 
     101    <td><input size="30" type="text" name="cid_name" value="<?php echo $cid_name; ?>"  tabindex="<?php echo ++$tabindex;?>"/></td> </tr> 
    100102    <td><a href="#" class="info"><?php echo _("CallerID Number")?>:<span><?php echo _("The CallerID Number that you want to change to. If you are appending to the current callerid, dont forget to include the appropriate asterisk variables. If you leave this box blank, the CallerID number will be blanked");?></span></a></td> 
    101     <td><input size="14" type="text" name="cid_num" value="<?php echo $cid_num; ?>"  tabindex="<?php echo ++$tabindex;?>"/></td> </tr> 
     103    <td><input size="30" type="text" name="cid_num" value="<?php echo $cid_num; ?>"  tabindex="<?php echo ++$tabindex;?>"/></td> </tr> 
    102104  <tr><td colspan="2"><br><h5><?php echo _("Destination")?>:<hr></h5></td></tr> 
    103105 
     
    130132<script language="javascript"> 
    131133<!-- 
     134$(document).ready(function () { 
     135 
     136  if (!$('[name=description]').attr("value")) { 
     137  $('[name=cid_name]').attr({value: "${CALLERID(name)}"}); 
     138  $('[name=cid_num]').attr({value: "${CALLERID(num)}"}); 
     139    } 
     140     
     141 // select rnav options - fake type = edit 
     142 /* 
     143  $("a.rnavdata").click(function(event){ 
     144  event.preventDefault(); 
     145  linktext = $(this).text(); 
     146  rnavdata = $(this).attr("rnavdata"); 
     147  arr = rnavdata.split(","); 
     148  $('h2').text("<?php echo _("Edit") ?>: " + arr[0]); 
     149  $('[name=description]').attr({value: arr[0]}); 
     150  $('[name=cid_name]').attr({value: arr[1]}); 
     151  $('[name=cid_num]').attr({value: arr[2]}); 
     152  }); 
     153  */ 
     154}); 
     155 
    132156 
    133157function checkSetcid(theForm) {