From: Ben Klang Date: Mon, 29 Mar 2010 02:32:47 +0000 (-0400) Subject: Shout: catch and log some additional possible errors X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ba82a3573cca85c0c632ccbe5734090be6609b3c;p=horde.git Shout: catch and log some additional possible errors --- diff --git a/shout/dialplan.php b/shout/dialplan.php index f5d7c6f81..9524a2dce 100644 --- a/shout/dialplan.php +++ b/shout/dialplan.php @@ -56,7 +56,8 @@ default: $conferences = $shout->storage->getConferences($curaccount); $soundfiles = $shout->getRecordings(); } catch (Exception $e) { - $notification->push(_("Problem getting destination information.")); + Horde::logMessage($e, 'ERR'); + $notification->push(_("Problem getting menu information.")); } break; diff --git a/shout/lib/Ajax/Application.php b/shout/lib/Ajax/Application.php index bac80d140..b1ef8ba87 100644 --- a/shout/lib/Ajax/Application.php +++ b/shout/lib/Ajax/Application.php @@ -108,6 +108,9 @@ class Shout_Ajax_Application extends Horde_Ajax_Application_Base $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); $account = $_SESSION['shout']['curaccount']; $menus = $shout->storage->getMenus($account); + if (empty($menus)) { + return false; + } foreach ($menus as $menu => $info) { // Fill in the actions for each menu $menus[$menu]['actions'] = $shout->dialplan->getMenuActions($account, $menu); diff --git a/shout/templates/dialplan/edit.inc b/shout/templates/dialplan/edit.inc index 85c743633..d41551b27 100644 --- a/shout/templates/dialplan/edit.inc +++ b/shout/templates/dialplan/edit.inc @@ -336,11 +336,6 @@ function refreshMenu() { $('menuWorking').show(); $('dialpadWorking').show(); - curmenu = $('menu.select').value; - if (!curmenu || !menuInfo.get(curmenu)) { - // TODO Show an error of some kind - return false; - } $A(['1','2','3','4','5','6','7','8','9','0','star','octo']).each(function (digit){ empty('digit_' + digit); @@ -362,6 +357,14 @@ function refreshMenu() $('digit_' + digit).appendChild(span); }) + if (!(menuInfo.size())) { + $('menuWorking').hide(); + $('dialpadWorking').hide(); + return true; + } + + curmenu = $('menu.select').value; + var text = document.createTextNode(menuInfo.get(curmenu).description); empty('menu.description'); $('menu.description').appendChild(text);