# Retrieve personal numbers $array_user = Aastra_manage_userinfo_Asterisk($user, 'get'); $change = 'change'; foreach ($array_user as $key => $value) { if ($value != '') { $change = 'select'; } break; } # Retrieve current status $cf = Aastra_manage_cf_Asterisk($user, $action, $value); # Softkeys? if ($nb_softkeys) { # Textscreen for softkey phones require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(sprintf(Aastra_get_label('Call Forward for %s', $language), Aastra_get_userdevice_Asterisk($user))); if ($cf == '') { $object->setText(Aastra_get_label('Call Forward is currently deactivated.', $language)); $object->addSoftkey('1', Aastra_get_label('Activate', $language), $XML_SERVER . '&action=' . $change); } else { $array_user = array_flip($array_user); $text = sprintf(Aastra_get_label('Call Forward is currently set to %s', $language), $cf); if ($array_user[$cf] != '') { $array_label = array('cell' => Aastra_get_label('Cell', $language), 'home' => Aastra_get_label('Home', $language), 'other' => Aastra_get_label('Other', $language)); $text .= ' (' . $array_label[$array_user[$cf]] . ')'; } $object->setText($text); $object->addSoftkey('1', Aastra_get_label('Change', $language), $XML_SERVER . '&action=' . $change); $object->addSoftkey('2', Aastra_get_label('Deactivate', $language), $XML_SERVER . '&action=cancel');
$object->setCancelAction($XML_SERVER); } } break; # Default is Current status # Default is Current status case 'main': # Authenticate user Aastra_check_signature_Asterisk($user); # Display current status $array_fm = Aastra_manage_followme_Asterisk($user, 'get_all'); # Check if configured if ($array_fm['status'] == '2') { # Error: Not configured require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('Follow-me', $language)); $object->setText(Aastra_get_label('This feature is not configured for your phone. Please contact your administrator.', $language)); if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } } } else { # Configured: List of options require_once 'AastraIPPhoneTextMenu.class.php'; $object = new AastraIPPhoneTextMenu(); $object->setDestroyOnExit();
if (Aastra_size_formattedtextscreen() > 4) { $object->addLine(''); } $object->addLine(sprintf(Aastra_get_label('I=%+.3f %s', $language), $array['day']['I'], $array['trend']['I'])); $object->addLine(sprintf(Aastra_get_label('E=%+.3f %s', $language), $array['day']['E'], $array['trend']['E'])); $object->addLine(sprintf(Aastra_get_label('P=%+.3f %s', $language), $array['day']['P'], $array['trend']['P'])); } else { $object->setScrollStart('2'); $object->addLine(sprintf(Aastra_get_label('I=%+.3f %s', $language), $array['day']['I'], $array['trend']['I'])); $object->addLine(sprintf(Aastra_get_label('E=%+.3f %s', $language), $array['day']['E'], $array['trend']['E'])); $object->addLine(sprintf(Aastra_get_label('P=%+.3f %s', $language), $array['day']['P'], $array['trend']['P'])); $object->setScrollEnd(); } } else { # create object $object = new AastraIPPhoneTextScreen(); $object->setTitle(Aastra_get_language('BIORHYTHMS', $language)); $object->setText(sprintf(Aastra_get_label('I=%+.3f, E=%+.3f, P=%+.3f', $language), $array['day']['I'], $array['day']['E'], $array['day']['P'])); } } } # Common parameters $object->setDestroyOnExit(); if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('5', Aastra_get_label('Back', $language), $XML_SERVER); $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER); $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); }
} if ($directory[$index]['mobile'] != '') { $conf_speed[$speed]['mobile'] = prepare_number($directory[$index]['mobile'], 2, $ARRAY_CONFIG['Dialplan']); } if ($directory[$index]['home'] != '') { $conf_speed[$speed]['home'] = prepare_number($directory[$index]['home'], 2, $ARRAY_CONFIG['Dialplan']); } $conf_speed[$speed]['other'] = ''; if ($asterisk) { Aastra_save_user_context(Aastra_get_userdevice_Asterisk($user), 'speed', $conf_speed); } else { Aastra_save_user_context($user, 'speed', $conf_speed); } # Display update require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('List Updated', $language)); $object->setText(sprintf(Aastra_get_label('%s stored in speed dial list at position %d.', $language), $name, $speed + 1)); # Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER . '&action=zoom'); $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER . '&action=zoom', 1); $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit', 2); $object->setCancelAction($XML_SERVER . '&action=zoom'); $object->addIcon(1, 'Icon:ArrowLeft'); $object->addIcon(2, 'Icon:CircleRed'); }
$object->addIcon('4', 'Icon:PhoneOffHook'); $object->addIcon(10, 'Icon:PhoneDial'); $object->addIcon(11, 'Icon:Speaker'); $object->addIcon(12, 'Icon:Add'); $object->addIcon(13, 'Icon:ArrowLeft'); $object->addIcon(14, 'Icon:ArrowUp'); $object->addIcon(15, 'Icon:Search'); $object->addIcon(16, 'Icon:Book'); $object->addIcon(17, 'Icon:Settings'); $object->addIcon(18, 'Icon:ArrowDown'); $object->addIcon(19, 'Icon:CircleRed'); } } else { # Display error require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); if ($lookup == '') { $object->setTitle(Aastra_get_label('Directory error', $language)); $object->setText(Aastra_get_label('Directory list is empty. Please contact your administrator.', $language)); } else { $object->setTitle(Aastra_get_label('Lookup error', $language)); $object->setText(Aastra_get_label('Sorry no match.', $language)); } # Softkey if ($lookup != '') { $object->addSoftkey('5', Aastra_get_label('List Mode', $language), $XML_SERVER . '&action=list', 1); $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER . '&action=search&lookup=' . $lookup, 2); $object->setCancelAction($XML_SERVER . '&action=search&lookup=' . $lookup); } $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit', 3);
# Softkeys if ($nb_softkeys) { $object->addSoftkey('1', Aastra_get_label('Select', $language), 'SoftKey:Select'); $object->addSoftkey('5', Aastra_get_label('Back', $language), $XML_SERVER); $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } } else { # Display first item $object = new AastraIPPhoneExecute(); $object->addEntry($XML_SERVER . '&zip=' . $zip . '&index=1'); } } else { # shift $index $index--; # Display article $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); if (Aastra_is_wrap_title_supported()) { $object->setTitleWrap(); } # Title if (Aastra_phone_type() == 5) { $object->setTitle($array_rss[$index]['title']); } else { $object->setTitle($array_rss[99]['title'] . ' - ' . $array_rss[$index]['title']); } # Content $object->setText($array_rss[$index]['description']); # Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) {
if ($last != 1) { $object->setTitle(sprintf(Aastra_get_label('Directory (%s-%s)', $language), $min, $max)); } else { $object->setTitle(Aastra_get_label('Directory', $language)); } } else { if ($last != 1) { $object->setTitle(sprintf(Aastra_get_label('Results (%s-%s)', $language), $min, $max)); } else { $object->setTitle(Aastra_get_label('Results', $language)); } } } else { # Display error require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); if ($lookup == '') { $object->setTitle(Aastra_get_label('Directory error', $language)); $object->setText(Aastra_get_label('Directory list is empty. Please contact your administrator.', $language)); } else { $object->setTitle(Aastra_get_label('Lookup error', $language)); $object->setText(Aastra_get_label('Sorry no match.', $language)); } # Softkey if ($lookup != '') { $object->setDoneAction($XML_SERVER . '&action=search&lookup=' . $lookup); } } break; }
if ($header['model'] == 'Aastra6739i' and !Aastra_test_phone_version('3.2.1,', 1)) { $object->addEntry($XML_SERVER_PATH . '/sync.php?action=register&user='******'&action=display'); if (Aastra_is_fastreboot_supported()) { $object->AddEntry('Command: FastReboot'); } else { $object->AddEntry('Command: Reset'); } } } else { # Display error as a TextScreen $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('Configuration error', $language)); $object->setText(Aastra_get_label('Configuration file cannot be generated. Please contact your administrator.', $language)); # Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } } } } break; # Configuration
Aastra_trace_call('LDAP directory', $_SERVER['REQUEST_URI']); # Get Language and HTTP header $language = Aastra_get_language(); $header = Aastra_decode_HTTP_header(); # Load user context $menu = Aastra_get_user_context($header['mac'], 'scrollableTextMenuData'); if (!is_object($menu)) { # If not an object: Something went wrong when fetching the user context. Display error and exit. $object = new AastraIPPhoneTextScreen(); $object->setTitle(Aastra_get_label('Server error', $language)); $object->setText(Aastra_get_label('Context not found. Check cache directory settings.', $language)); $object->output(); exit; } if (!$menu->verifyCookie($cookie)) { # If cookie does not match: Display error and exit. $object = new AastraIPPhoneTextScreen(); $object->setTitle(Aastra_get_label('Server error', $language)); $object->setText(Aastra_get_label('Session not found. Please try again.', $language)); $object->output(); exit; } if ($recentSelection != "") { $menu->setDefaultIndex($recentSelection); } if ($zoomIndex != "") { $menu->zoom($zoomIndex, $recentPage, $recentSelection); } else { $menu->output($page); } exit;
require_once 'AastraIPPhoneFormattedTextScreen.class.php'; $object = new AastraIPPhoneFormattedTextScreen(); if (Aastra_size_formattedtextscreen() > 2) { $object->addLine(''); } if (Aastra_is_formattedtextscreen_color_supported()) { $object->addLine(''); $object->addLine(''); $object->addLine(''); $object->addLine(Aastra_get_label('Welcome Back', $language), 'large', 'center', 'green'); } else { $object->addLine(Aastra_get_label('Welcome Back', $language), 'double', 'center'); } } else { require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setTitle(Aastra_get_label('Presence', $language)); $object->setText(Aastra_get_label('Welcome Back', $language)); } $object->setDestroyOnExit(); # Time-out on the display if (Aastra_is_timeout_supported()) { $object->setTimeout('3'); } # Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) { if (Aastra_is_timeout_supported()) { $object->addSoftKey('6', '', 'SoftKey:Exit'); } else { $object->addSoftKey('6', Aastra_get_label('Close', $language), 'SoftKey:Exit');
$ARRAY_CONFIG[$source]['uri'] = preg_replace($search, $replace, $ARRAY_CONFIG[$source]['uri']); if ($ARRAY_CONFIG[$source]['uri'] == '') { unset($ARRAY_CONFIG[$source]); } break; default: unset($ARRAY_CONFIG[$source]); break; } } # Depending on how many directories are configured switch (count($ARRAY_CONFIG)) { # No directory case '0': require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('Error', $language)); $object->setText(Aastra_get_label('No directory configured. Please contact your administrator.', $language)); if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit', 1); $object->addIcon(1, 'Icon:CircleRed'); } } break; # Just one # Just one case '1':
$db_url = $engine . "://" . $db_username . ":" . $db_password . "@" . $db_host . "/" . $db_database; $db = DB::connect($db_url); //get arguments $user = $_GET['user']; $searchmethod = isset($_GET['searchmethod']) ? $_GET['searchmethod'] : null; //search method : onetouch or t9 $search = isset($_GET['search']) ? $_GET['search'] : null; //name of number to search for $searchterm = isset($_GET['searchterm']) ? $_GET['searchterm'] : null; // "" "" $contact = isset($_GET['contact']) ? $_GET['contact'] : null; //id of a specific contact //declare classes $input = new AastraIPPhoneInputScreen(); $menu = new AastraIPPhoneTextMenu(); $text = new AastraIPPhoneTextScreen(); $screen = new AastraIPPhoneFormattedTextScreen(); //if no $searchmethod is set, check for users perferd input method if (!$searchmethod) { $sql = 'SELECT val from contactdir_details where extension = ? and type =?'; $searchmethod = $db->getRow($sql, array($user, 'searchmethod')); if ($searchmethod) { $searchmethod = implode(",", $searchmethod); } } //step 1&2: ensure that the search term hasnt been entered yet, and promt for it. If //we dont have a search method either, return default to prompt for method if (!$search) { switch ($searchmethod) { case 't9': $sql = 'DELETE FROM contactdir_details WHERE extension = ? and type = ?';
case 'cancel': require_once 'AastraIPPhoneExecute.class.php'; $object = new AastraIPPhoneExecute(); $object->setTriggerDestroyOnExit(); $object->addEntry(''); break; # Submit password # Submit password case 'submit': # MODE USER if ($AA_FREEPBX_MODE == '1') { # Authentication failed if (!Aastra_verify_user_Asterisk($user, $password, 'login')) { # Display error require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('Authentication failed', $language)); $object->setText(Aastra_get_label('Wrong credentials.', $language)); # Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('5', Aastra_get_label('Cancel', $language), 'SoftKey:Exit'); $object->addSoftkey('6', Aastra_get_label('Close', $language), $XML_SERVER); } else { $object->addSoftkey('9', Aastra_get_label('Cancel', $language), 'SoftKey:Exit'); $object->addSoftkey('10', Aastra_get_label('Close', $language), $XML_SERVER); } } } else { # Only if auto-logout is supported//configured
# Display error as a TextScreen $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('Configuration error', $language)); $object->setText(Aastra_get_label('Configuration file cannot be generated. Please contact your administrator.', $language)); if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } } } } else { # Display error as a TextScreen $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('User Login', $language)); $object->setText(Aastra_get_label('Wrong user credentials.', $language)); if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('5', Aastra_get_label('Cancel', $language), 'SoftKey:Exit'); $object->addSoftkey('6', Aastra_get_label('Close', $language), $XML_SERVER . '&action=input'); } else { $object->addSoftkey('9', Aastra_get_label('Cancel', $language), 'SoftKey:Exit'); $object->addSoftkey('10', Aastra_get_label('Close', $language), $XML_SERVER . '&action=input'); } } } break; }
} else { $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER . '?selection=' . $selection . '&user='******'&action=favorites'); $object->setCancelAction($XML_SERVER . '?selection=' . $selection . '&user='******'&action=favorites'); } $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } } } else { # Display error $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('Application error', $language)); $object->setText(Aastra_get_label('The information you are looking for is not available at this time. Try again later.', $language)); } } else { # Display error $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('Application error', $language)); $object->setText(Aastra_get_label('The information you are looking for is not available at this time. Try again later.', $language)); } break; } # Top title if (Aastra_is_top_title_supported()) { $object->setTopTitle(Aastra_get_label('World Clock'), '', '1'); $object->addIcon('1', 'http://' . $AA_XML_SERVER . '/' . $AA_XMLDIRECTORY . '/icons/clock.png'); } # Display object $object->output(); exit;
$last = $value[2]; } if ($value[6] < 0) { $color = 'red'; } else { $color = 'green'; } $object->addLine($value[0] . ': ' . $last . ' (' . $value[6] . ')', NULL, NULL, $color); } } $object->setScrollEnd(); $object->addLine(Aastra_get_label('Powered by Yahoo', $language), '', 'center'); } } else { # Prepare result screen $object = new AastraIPPhoneTextScreen(); require_once 'AastraIPPhoneTextScreen.class.php'; $object->setTitle(Aastra_get_label('Stock results', $language)); $object->setText(Aastra_get_label('Information not available at this time. Please try again later.', $language)); } # Add remaining softkeys if ($nb_softkeys > 0) { if ($nb_softkeys == 6) { $object->addSoftkey('5', Aastra_get_label('Back', $language), $XML_SERVER . '&action=favorites&selection=' . $selection); $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey('8', Aastra_get_label('Back', $language), $XML_SERVER . '&action=favorites&selection=' . $selection); $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); $object->setCancelAction($XML_SERVER . '&action=favorites&selection=' . $selection); } }
############################################################################# # Retrieve parameters $area = Aastra_getvar_safe('area'); # Trace Aastra_trace_call('area', 'area=' . $area); # Test User Agent Aastra_test_phone_version('1.4.2.', 0); # Get language $language = Aastra_get_language(); # Global compatibility $nb_softkeys = Aastra_number_softkeys_supported(); # Test parameter if ($area) { # Load area codes $array = Aastra_readINIfile('area_codes.txt', '#', '='); $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(sprintf(Aastra_get_label('Area code %s', $language), $area)); if ($array[''][$area] != '') { $object->setText($array[''][$area]); } else { $object->setText(sprintf(Aastra_get_label('Area code %s not found.', $language), $area)); } # Softkeys if ($nb_softkeys > 0) { if ($nb_softkeys < 7) { $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER); $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey('9', Aastra_get_label('New Lookup', $language), $XML_SERVER); $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
} } if ($is_softkeys) { $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER . '?action=input&lookup=' . $lookup); $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } break; # Contact details # Contact details case 'zoom': # Retrieve Contact $Contact = getRecord($index); # Any number at all? if ($Contact['phone_home'] == '' and $Contact['phone_work'] != '' and $Contact['phone_mobile'] != '' and $Contact['phone_other'] != '') { # Error Message $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle($Contact['last_name'] . ' ' . $Contact['first_name']); $object->setText(Aastra_get_label('No attached phone number.', $language)); } else { # Retrieve configuration $array_config_asterisk = Aastra_readINIfile(AASTRA_CONFIG_DIRECTORY . 'directory.conf', '#', '='); $conf = $array_config_asterisk['Dialplan']; # Prepare display if ($Contact['phone_home'] != '') { $display['home'] = prepare_number($Contact['phone_home'], 1, $conf); $dial['home'] = prepare_number($Contact['phone_home'], 0, $conf); } if ($Contact['phone_work'] != '') { $display['work'] = prepare_number($Contact['phone_work'], 1, $conf); $dial['work'] = prepare_number($Contact['phone_work'], 0, $conf);
$object->output(True); # Dial the number Aastra_dial_number_Asterisk($user, $value); exit; break; # Parked calls # Parked calls case 'list': # Get Parked calls $park = Aastra_get_parked_calls_Asterisk(); $count = count($park); # Update display if ($count == 0) { # No park calls require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('Parked Calls', $language)); $object->setText(Aastra_get_label('No parked calls on the platform.', $language)); # Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey(4, Aastra_get_label('Refresh', $language), $XML_SERVER . '&action=list'); $object->addSoftkey(6, Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey(6, Aastra_get_label('Refresh', $language), $XML_SERVER . '&action=list'); $object->addSoftkey(10, Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } } } else { # Only one and autopick
$object->addSoftkey('3', Aastra_get_label('Dial', $language), 'SoftKey:Dial'); if ($origin != 'presence') { if ($AA_SPEEDDIAL_STATE) { $object->addSoftkey('4', Aastra_get_label('+Speed', $language), $XML_SERVER . '&action=select&orig_s=listpage=' . $page); } } else { $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER_PATH . '/away.php?user='******'2', Aastra_get_label('Previous', $language), $XML_SERVER . '&action=list&page=' . ($page - 1)); } if ($page != $last) { $object->addSoftkey('5', Aastra_get_label('Next', $language), $XML_SERVER . '&action=list&page=' . ($page + 1)); } $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { # Display error require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('Directory error', $language)); $object->setText(Aastra_get_label('Directory list is empty. Please contact your administrator.', $language)); # Softkey $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } break; } # Output XML object $object->output(); exit;
# Update configuration Aastra_save_user_context($menu_user, 'mymenu' . '_' . $menu_source, $config); # Display list $object = new AastraIPPhoneExecute(); $object->addEntry($XML_SERVER . '&menu_action=add&menu_page2=' . $menu_page2); break; # Info on a menu # Info on a menu case 'details': # Load menu config file $all = Aastra_readINIfile($menu_source . '.menu', '#', '='); foreach ($all as $key => $value) { $all[$key]['info'] = Aastra_get_label($all[$key]['info'], $language); } # Display Help $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle($selection); if ($all[$selection]['info'] != '') { $object->setText($all[$selection]['info']); } else { $object->setText(Aastra_get_label('No information available', $language)); } # Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('5', Aastra_get_label('Back', $language), $XML_SERVER . '&menu_action=add&menu_page2=' . $menu_page2); $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER . '&menu_action=add&menu_page2=' . $menu_page2); $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
$object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { if ($action == 'zoom') { $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER . '?selection=' . $selection . '&user='******'&action=list' . '&page=' . $page); $object->setCancelAction($XML_SERVER . '?selection=' . $selection . '&user='******'&action=list' . '&page=' . $page); } else { $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER . '?selection=' . $selection . '&user='******'&action=favorites'); $object->setCancelAction($XML_SERVER . '?selection=' . $selection . '&user='******'&action=favorites'); } $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } } } else { # Display error $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('Application error', $language)); $object->setText(Aastra_get_label('The information you are looking for is not available at this time. Try again later.', $language)); } } else { # Display error $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('Application error', $language)); $object->setText(Aastra_get_label('The information you are looking for is not available at this time. Try again later.', $language)); } break; } # Display object $object->output(); exit;
} else { $object->addLine($data['favorites'][$selection]['source'] . ' to ' . $data['favorites'][$selection]['target'], 'double', 'center'); } $object->setScrollStart(); $object->addLine(''); $object->addLine(Aastra_get_label('Last Trade', $language) . ': ' . $return[1][0][1]); $object->addLine(Aastra_get_label('Ask', $language) . ': ' . $return[1][0][4]); $object->addLine(Aastra_get_label('Bid', $language) . ': ' . $return[1][0][5]); $object->addLine(Aastra_get_label('Date', $language) . ': ' . $return[1][0][2]); $object->addLine(Aastra_get_label('Time', $language) . ': ' . $return[1][0][3]); $object->setScrollEnd(); $object->addLine(Aastra_get_label('Powered by Yahoo', $language), '', 'center'); } } else { # Prepare result screen $object = new AastraIPPhoneTextScreen(); $object->setTitle(Aastra_get_label('Currency converter', $language)); $object->setText(Aastra_get_label('Information not available at this time. Please try again later.', $language)); } # Add remaining softkeys if ($nb_softkeys == 6) { if ($action == 'display') { $object->addSoftkey('4', Aastra_get_label('New Lookup', $language), $XML_SERVER . '&action=init'); } else { $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER . '&action=favorites&selection=' . $selection); } $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { if ($action == 'display') { $object->addSoftkey('6', Aastra_get_label('New Lookup', $language), $XML_SERVER . '&action=init'); } else {
} } } # Do nothing $object->addEntry(''); # Save Day/Night context if ($context) { Aastra_save_user_context($user, 'daynight', $data); } break; # Display error # Display error case 'error': # Display error as a TextScreen require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle($err_title); $object->setText($err_text); # Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } } break; # Global day/night change # Global day/night change case 'day':
Aastra_forward_to_user_Asterisk($user, $value['number'], $msg_id, $msg_folder, 'INBOX'); } } # Display message $action = 'flash'; $flash_next = $XML_SERVER . '&action=detail&msg=' . $msg; $flash_text = Aastra_get_label('Message forwarded.', $language); break; } # Post-process action switch ($action) { # Error message case 'error': # New text screen require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle($err_title); $object->setText($err_text); if ($err_key[2] != 'SoftKey:Exit') { $object->setDoneAction($err_key[2]); } break; # Flash message # Flash message case 'flash': # New formatted text screen require_once 'AastraIPPhoneFormattedTextScreen.class.php'; $object = new AastraIPPhoneFormattedTextScreen(); $object->setDestroyOnExit(); $size = Aastra_size_display_line();
} fclose($fp); # Prepare result screen $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('Ask Google', $language)); if ($resultSize == 0) { $object->setText(Aastra_get_label('Information not available at this time. Please try again later.', $language)); } else { $message = $message1 . $message2 . $message3 . $message4 . $message5 . $message6 . $message7 . $message8; $message = filter_format($message, $resultSize); $object->setText($message); } } else { # Prepare result screen $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('Ask Google', $language)); $object->setText(Aastra_get_label('Information not available at this time. Please try again later.', $language)); } # Display TextScreen if ($nb_softkeys > 0) { if ($nb_softkeys < 7) { $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER); $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey('9', Aastra_get_label('New Question', $language), $XML_SERVER); $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } } # CancelAction
Aastra_forward_to_user_Asterisk($user, $value['number'], $msg_id, $msg_folder, 'INBOX'); } } # Display message $action = 'flash'; $flash_next = $XML_SERVER . '&action=detail&msg=' . $msg; $flash_text = Aastra_get_label('Message forwarded to the selected user(s).', $language); break; } # Post-process action switch ($action) { # Error message case 'error': # New text screen require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle($err_title); $object->setText($err_text); $object->addSoftkey($err_key[0], $err_key[1], $err_key[2]); break; # Flash message # Flash message case 'flash': # New formatted text screen require_once 'AastraIPPhoneFormattedTextScreen.class.php'; $object = new AastraIPPhoneFormattedTextScreen(); $object->setDestroyOnExit(); $size = Aastra_size_display_line(); if (strlen($flash_text) > $size) { $temp = wordwrap($flash_text, $size, "\n", True);
foreach ($directory as $v) { if ($index >= ($page - 1) * $MaxLines + 1 and $index <= $page * $MaxLines) { if ($v['number'] == $selection) { $object->setDefaultIndex($rank); } if ($AA_PRESENCE_STATE) { $object->addEntry('[' . $status_text[$v['status']]['mnemonic'] . ']' . $v['name'], $XML_SERVER . '&action=zoom&selection=' . $v['number'], $v['number']); } else { $object->addEntry($v['name'], $XML_SERVER . '&action=dial&selection=' . $v['number'], $v['number']); } $rank++; } $index++; } # Next Page if ($page != $last) { $object->addEntry(Aastra_get_label('Next Page', $language), $XML_SERVER . '&action=list&page=' . ($page + 1)); } } else { # Display error require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('Directory error', $language)); $object->setText(Aastra_get_label('Directory list is empty. Please contact your administrator.', $language)); } break; } # Output XML object $object->output(); exit;