
Untitled
By: a guest on
Apr 25th, 2012 | syntax:
Diff | size: 2.13 KB | hits: 13 | expires: Never
Index: modules/sys_alert/module.php
===================================================================
--- modules/sys_alert/module.php (revision 17035)
+++ modules/sys_alert/module.php (working copy)
@@ -136,7 +136,8 @@
{
//print_r($_POST);
if(!$_POST['threshold'])$error[]='Введите уведомление';
- if(!$_POST['obj'])$error[]='Не выбраны объекты';
+ // 'incoming_call' event doesn't need object
+ if(!$_POST['obj'] && $_POST['event'] != 'incoming_call' )$error[]='Не выбраны объекты';
if(!$_POST['name'])$error[]='Введите название предупреждения';
//Список объектов
@@ -308,4 +309,4 @@
return true;
}
}
- ?>
\ No newline at end of file
+ ?>
Index: design/sys_alert/edit.tpl
===================================================================
--- design/sys_alert/edit.tpl (revision 17035)
+++ design/sys_alert/edit.tpl (working copy)
@@ -40,7 +40,7 @@
</td>
</tr>
- <tr>
+ <tr id='objects'>
<td valign="top">Объект:</td>
<td class="midle">
<a id="sel_object" class="dotted" href="#">выбрать объект</a>
@@ -160,6 +160,7 @@
get_obj($(this).val());
$('input[name="obj"]').val('');
set_threshold($(this).val());
+ display_object_selector($(this).val());
});
@@ -173,6 +174,16 @@
if(type=='hung_up' || type=='miss_incall' || type=='queue_missed_call') $('input[name=threshold]').val(1).hide();
else $('input[name=threshold]').show();
}
+
+function display_object_selector(type)
+{
+ if(type=='incoming_call') {
+ $('tr[id=objects]').val(1).hide();
+ } else {
+ $('tr[id=objects]').show();
+ }
+}
+
function rows_agent(){
$html = "";