From: Ben Klang Date: Sun, 28 Mar 2010 21:46:44 +0000 (-0400) Subject: Shout: Add conference list screen X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9f046fe9b3ffb81fc25c4c72c6b6fe85d757d78a;p=horde.git Shout: Add conference list screen --- diff --git a/shout/conferences.php b/shout/conferences.php new file mode 100644 index 000000000..afa57b1e1 --- /dev/null +++ b/shout/conferences.php @@ -0,0 +1,114 @@ + + */ + +require_once dirname(__FILE__) . '/lib/Application.php'; +$shout = Horde_Registry::appInit('shout'); + +require_once SHOUT_BASE . '/lib/Forms/ConferenceForm.php'; + +$curaccount = $_SESSION['shout']['curaccount']; +$action = Horde_Util::getFormData('action'); +$vars = Horde_Variables::getDefaultVariables(); + +$RENDERER = new Horde_Form_Renderer(); + +$title = _("Conferences: "); + +switch ($action) { +case 'add': +case 'edit': + $vars = Horde_Variables::getDefaultVariables(); + $vars->set('account', $curaccount); + $Form = new ConferenceDetailsForm($vars); + + // Show the list if the save was successful, otherwise back to edit. + if ($Form->isSubmitted() && $Form->isValid()) { + // Form is Valid and Submitted + try { + $devid = Horde_Util::getFormData('devid'); + + $Form->execute(); + $notification->push(_("Conference information saved."), + 'horde.success'); + $action = 'list'; + break; + + } catch (Exception $e) { + $notification->push($e); + } + } elseif ($Form->isSubmitted()) { + // Submitted but not valid + $notification->push(_("Problem processing the form. Please check below and try again."), 'horde.warning'); + } + + // Create a new add/edit form + $devid = Horde_Util::getFormData('devid'); + $devices = $shout->devices->getDevices($curaccount); + $vars = new Horde_Variables($devices[$devid]); + + $vars->set('action', $action); + $Form = new ConferenceDetailsForm($vars); + + // Make sure we get the right template below. + $action = 'edit'; + + break; +case 'delete': + $title .= sprintf(_("Delete Devices %s"), $extension); + $devid = Horde_Util::getFormData('devid'); + + $vars = Horde_Variables::getDefaultVariables(); + $vars->set('account', $curaccount); + $Form = new DeviceDeleteForm($vars); + + $FormValid = $Form->validate($vars, true); + + if ($Form->isSubmitted() && $FormValid) { + try { + $Form->execute(); + $notification->push(_("Device Deleted.")); + $action = 'list'; + } catch (Exception $e) { + $notification->push($e); + } + } elseif ($Form->isSubmitted()) { + $notification->push(_("Problem processing the form. Please check below and try again."), 'horde.warning'); + } + + $vars = Horde_Variables::getDefaultVariables(array()); + $vars->set('account', $curaccount); + $Form = new DeviceDeleteForm($vars); + + break; + +case 'list': +default: + $action = 'list'; + $title .= _("List Conferences"); +} + +// Fetch the (possibly updated) list of extensions +try { + $conferences = $shout->devices->getConferences($curaccount); +} catch (Exception $e) { + $notification->push($e); + $devices = array(); +} + +Horde::addScriptFile('stripe.js', 'horde'); +require SHOUT_TEMPLATES . '/common-header.inc'; +require SHOUT_TEMPLATES . '/menu.inc'; + +$notification->notify(); + +require SHOUT_TEMPLATES . '/conferences/' . $action . '.inc'; + +require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/shout/lib/Forms/ConferenceForm.php b/shout/lib/Forms/ConferenceForm.php new file mode 100644 index 000000000..e69de29bb diff --git a/shout/lib/Shout.php b/shout/lib/Shout.php index c30f77055..55fe35199 100644 --- a/shout/lib/Shout.php +++ b/shout/lib/Shout.php @@ -30,7 +30,7 @@ class Shout $menu->add(Horde::applicationUrl('dialplan.php'), _("Incoming Calls"), "dialplan.png"); $menu->add(Horde::applicationUrl('extensions.php'), _("Extensions"), "extension.png"); $menu->add(Horde::applicationUrl('devices.php'), _("Devices"), "shout.png"); - $menu->add(Horde::applicationUrl('conferences.png'), _("Conferences"), "conference.png"); + $menu->add(Horde::applicationUrl('conferences.php'), _("Conferences"), "conference.png"); //$menu->add(Horde::applicationUrl('recordings.php'), _("Recordings"), "recordings.png"); /* Administration. */ diff --git a/shout/templates/conferences/list.inc b/shout/templates/conferences/list.inc new file mode 100644 index 000000000..151a228bc --- /dev/null +++ b/shout/templates/conferences/list.inc @@ -0,0 +1,54 @@ +
+ Account: +
+ +
+ + + + + + + + $info) { + + $url = Horde::applicationUrl("conferences.php"); + $url = Horde_Util::addParameter($url, + array( + 'roomno' => $roomno, + ) + ); + + ?> + + + + + + + +
NameRoom NumberPINOptions
+ + + + + + + +
+
+ diff --git a/shout/themes/graphics/conference-add.png b/shout/themes/graphics/conference-add.png new file mode 100755 index 000000000..06c5350cb Binary files /dev/null and b/shout/themes/graphics/conference-add.png differ