Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 25th, 2012  |  syntax: Diff  |  size: 2.13 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Index: modules/sys_alert/module.php
  2. ===================================================================
  3. --- modules/sys_alert/module.php        (revision 17035)
  4. +++ modules/sys_alert/module.php        (working copy)
  5. @@ -136,7 +136,8 @@
  6.                 {
  7.                         //print_r($_POST);
  8.                         if(!$_POST['threshold'])$error[]='Введите уведомление';
  9. -                       if(!$_POST['obj'])$error[]='Не выбраны объекты';
  10. +                       // 'incoming_call' event doesn't need object
  11. +                       if(!$_POST['obj'] && $_POST['event'] != 'incoming_call' )$error[]='Не выбраны объекты';
  12.                         if(!$_POST['name'])$error[]='Введите название предупреждения';
  13.  
  14.                         //Список объектов
  15. @@ -308,4 +309,4 @@
  16.                 return true;
  17.         }
  18.  }
  19. -       ?>
  20. \ No newline at end of file
  21. +       ?>
  22. Index: design/sys_alert/edit.tpl
  23. ===================================================================
  24. --- design/sys_alert/edit.tpl   (revision 17035)
  25. +++ design/sys_alert/edit.tpl   (working copy)
  26. @@ -40,7 +40,7 @@
  27.                 </td>
  28.         </tr>
  29.  
  30. -       <tr>
  31. +       <tr id='objects'>
  32.                 <td valign="top">Объект:</td>
  33.                 <td class="midle">
  34.                         <a id="sel_object" class="dotted" href="#">выбрать объект</a>
  35. @@ -160,6 +160,7 @@
  36.                 get_obj($(this).val());
  37.                 $('input[name="obj"]').val('');
  38.                 set_threshold($(this).val());
  39. +               display_object_selector($(this).val());
  40.  
  41.         });
  42.  
  43. @@ -173,6 +174,16 @@
  44.         if(type=='hung_up' || type=='miss_incall' || type=='queue_missed_call') $('input[name=threshold]').val(1).hide();
  45.         else $('input[name=threshold]').show();
  46.  }
  47. +
  48. +function display_object_selector(type)
  49. +{
  50. +       if(type=='incoming_call') {
  51. +               $('tr[id=objects]').val(1).hide();
  52. +       } else {
  53. +               $('tr[id=objects]').show();
  54. +       }
  55. +}
  56. +
  57.  function rows_agent(){
  58.         $html = "";