From: Ben Klang Date: Mon, 8 Mar 2010 22:53:40 +0000 (-0500) Subject: Shout: Fix display of devices and dialplan X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=3b3307e69141df4e54fd925a19193071d9a3168d;p=horde.git Shout: Fix display of devices and dialplan --- diff --git a/shout/devices.php b/shout/devices.php index fc6e0b54c..e3562c81f 100644 --- a/shout/devices.php +++ b/shout/devices.php @@ -26,7 +26,7 @@ switch ($action) { case 'add': case 'edit': $vars = Horde_Variables::getDefaultVariables(); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new DeviceDetailsForm($vars); // Show the list if the save was successful, otherwise back to edit. @@ -51,7 +51,7 @@ case 'edit': // Create a new add/edit form $devid = Horde_Util::getFormData('devid'); - $devices = $shout->devices->getDevices($curaccount['code']); + $devices = $shout->devices->getDevices($curaccount); $vars = new Horde_Variables($devices[$devid]); $vars->set('action', $action); @@ -66,7 +66,7 @@ case 'delete': $devid = Horde_Util::getFormData('devid'); $vars = Horde_Variables::getDefaultVariables(); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new DeviceDeleteForm($vars); $FormValid = $Form->validate($vars, true); @@ -84,7 +84,7 @@ case 'delete': } $vars = Horde_Variables::getDefaultVariables(array()); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new DeviceDeleteForm($vars); break; @@ -97,7 +97,7 @@ default: // Fetch the (possibly updated) list of extensions try { - $devices = $shout->devices->getDevices($curaccount['code']); + $devices = $shout->devices->getDevices($curaccount); } catch (Exception $e) { $notification->push($e); $devices = array(); diff --git a/shout/dialplan.php b/shout/dialplan.php index 086d2c992..f3af4c8bb 100644 --- a/shout/dialplan.php +++ b/shout/dialplan.php @@ -16,9 +16,9 @@ require_once SHOUT_BASE . '/lib/Forms/ExtensionForm.php'; $action = Horde_Util::getFormData('action'); $menu = Horde_Util::getFormData('menu'); -$curaccount['code'] = $_SESSION['shout']['curaccount']; +$curaccount = $_SESSION['shout']['curaccount']; -$menus = $shout->storage->getMenus($curaccount['code']); +$menus = $shout->storage->getMenus($curaccount); switch($action) { case 'edit': diff --git a/shout/lib/Application.php b/shout/lib/Application.php index 0e206158f..cdbaaa483 100644 --- a/shout/lib/Application.php +++ b/shout/lib/Application.php @@ -88,8 +88,8 @@ class Shout_Application extends Horde_Registry_Application } $account = Horde_Util::getFormData('account'); - if (empty($account) && !empty($_SESSION['shout']['account'])) { - $account = $_SESSION['shout']['account']; + if (empty($account) && !empty($_SESSION['shout']['curaccount'])) { + $account = $_SESSION['shout']['curaccount']; } if (!empty($account) && !in_array($account, array_keys($accounts))) { diff --git a/shout/lib/Driver/Sql.php b/shout/lib/Driver/Sql.php index 7d2426d43..839d21f4e 100644 --- a/shout/lib/Driver/Sql.php +++ b/shout/lib/Driver/Sql.php @@ -85,7 +85,7 @@ class Shout_Driver_Sql extends Shout_Driver $sql = 'SELECT accounts.code AS account, menus.name AS name, ' . 'menus.description AS description, menus.soundfile AS soundfile ' . 'FROM menus INNER JOIN accounts ON menus.account_id = accounts.id ' . - 'WHERE accounts.accountcode = ?'; + 'WHERE accounts.code = ?'; $vars = array($account); $msg = 'SQL query in Shout_Driver_Sql#getMenus(): ' . $sql;