# 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); $lines = explode("\n", $temp); } else { $lines[0] = $flash_text; } $nb_lines = count($lines); if ($nb_lines == 1) { $object->addLine(''); $object->addLine(''); $object->addLine($lines[0], 'double', 'center'); } else { if ($nb_lines < 4) { $object->addLine(''); } foreach ($lines as $value) { $object->addLine($value, NULL, 'center'); } } # Softkeys $object->setRefresh(2, $flash_next); $object->addSoftkey('6', '', $flash_next); break; }
# Retrieve quote if ($action == 'display') { $array[0] = $data['last']; } else { $array[0] = $data['favorites'][$selection]; } $return = get_currency($array); # Return OK if ($return[0]) { # Create the object $object = new AastraIPPhoneFormattedTextScreen(); # Display results if ($nb_softkeys == 6) { # Regular phone if ($action == 'display') { $object->addLine($data['last']['source'] . ' to ' . $data['last']['target'], NULL, 'center'); } else { $object->addLine($data['favorites'][$selection]['source'] . ' to ' . $data['favorites'][$selection]['target'], NULL, 'center'); } $object->setScrollStart(Aastra_size_formattedtextscreen() - 1); $nb_carac = Aastra_size_display_line(); $object->addLine(''); $object->addLine(format_line($nb_carac, Aastra_get_label('Last Trade', $language), $return[1][0][1])); $object->addLine(format_line($nb_carac, Aastra_get_label('Ask', $language), $return[1][0][4])); $object->addLine(format_line($nb_carac, Aastra_get_label('Bid', $language), $return[1][0][5])); $object->addLine(format_line($nb_carac, Aastra_get_label('Date', $language), $return[1][0][2])); $object->addLine(format_line($nb_carac, Aastra_get_label('Time', $language), $return[1][0][3])); $object->addLine(Aastra_get_label('Powered by Yahoo', $language), '', 'center'); $object->setScrollEnd(); } else { # 6739i
$new = 1; } $object->addSoftkey('2', Aastra_get_label('Emotional', $language), $XML_SERVER . '&bdate=' . $bdate . '&I=' . $I . '&E=' . $new . '&P=' . $P); if ($P == 1) { $new = 0; } else { $new = 1; } $object->addSoftkey('3', Aastra_get_label('Physical', $language), $XML_SERVER . '&bdate=' . $bdate . '&I=' . $I . '&E=' . $E . '&P=' . $new); } else { # Display results if (Aastra_is_formattedtextscreen_supported()) { # create object $object = new AastraIPPhoneFormattedTextScreen(); if (Aastra_size_formattedtextscreen() > 3) { $object->addLine(Aastra_get_label('BIORHYTHMS', $language)); 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
# Update global variable $XML_SERVER .= '&lookup=' . $lookup . '&lastn=' . $lastn . '&firstn=' . $firstn . '&index=' . $index . '&page=' . $page . '&company=' . $company; # Display details if ($ARRAY_USER['display'] == 'firstlast') { $name = $directory[$index]['first'] . ' ' . $directory[$index]['last']; } else { $name = $directory[$index]['last'] . ' ' . $directory[$index]['first']; } if ($name == ' ') { $name = $directory[$index]['company']; } if ($is_formatted_textscreen) { require_once 'AastraIPPhoneFormattedTextScreen.class.php'; $object = new AastraIPPhoneFormattedTextScreen(); $object->setDestroyOnExit(); $object->addLine($name, 'double'); if ($directory[$index]['company'] != '') { $object->addLine($directory[$index]['company']); } else { $object->addLine(Aastra_get_label('Company...', $language)); } if ($directory[$index]['title'] != '') { $object->addLine($directory[$index]['title']); } else { $object->addLine(Aastra_get_label('Title...', $language)); } } else { require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit(); $object->setTitle($name);
} # Use a FormattedTextScreen require_once 'AastraIPPhoneFormattedTextScreen.class.php'; $object = new AastraIPPhoneFormattedTextScreen(); $object->setDestroyOnExit(); # Define color based on status if ($away['status'] != AA_PRESENCE_AVAILABLE) { $color = 'red'; } else { if ($hint == 'Idle') { $color = 'green'; } else { $color = 'red'; } } $object->addLine(Aastra_get_callerid_Asterisk($selection) . ' (' . $selection . ')', 'large', NULL, $color); $line = sprintf(Aastra_get_label('Currently %s', $language), $status_text[$away['status']]['label']); $object->addLine($line); if ($away['status'] != AA_PRESENCE_AVAILABLE) { $line = Aastra_format_presence_dt_Asterisk($away['return']); foreach ($line as $data) { $object->addLine($data); } if ($notify) { $object->addLine(Aastra_get_label('Notification on return', $language)); } } else { if ($hint == 'Idle') { $object->addLine(Aastra_get_label('Phone is idle', $language)); } else { if ($hint == 'Ringing') {
} # Callback $XML_SERVER .= '?user='******'&mode=' . $mode; # Depending on action switch ($action) { # Display case 'display': # Display current status if (Aastra_is_formattedtextscreen_supported()) { # Advanced display require_once 'AastraIPPhoneFormattedTextScreen.class.php'; $object = new AastraIPPhoneFormattedTextScreen(); $object->setdestroyOnExit(); $object->setTimeout('2'); if (Aastra_size_formattedtextscreen() > 3) { $object->addLine(''); $object->addLine(''); } if ($status == 1) { $object->addLine(sprintf(Aastra_get_label('Night Mode activated (%d)', $language), $index), 'double', 'center'); } else { $object->addLine(sprintf(Aastra_get_label('Day Mode activated (%d)', $language), $index), 'double', 'center'); } if ($nb_softkeys == 6) { $object->addSoftKey('6', '', 'SoftKey:Exit'); } } else { # Basic display require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setDestroyOnExit();
$previous_line = $line; } fclose($handle); if ($found == 2) { if (Aastra_is_formattedtextscreen_supported()) { sscanf($current, '%s %s %d, %d at %s %[^$]s', $day, $month, $day2, $year, $time, $AMPM); require_once 'AastraIPPhoneFormattedTextScreen.class.php'; $object = new AastraIPPhoneFormattedTextScreen(); $object->setDestroyOnExit(); $size = Aastra_size_formattedtextscreen(); if ($size > 5) { $font = 'double'; } else { $font = NULL; } $object->addLine($title, $font, 'center'); if ($size < 4) { $object->setScrollStart($size - 1); } if (Aastra_size_formattedtextscreen() > 4) { $object->addLine(''); } if (Aastra_size_formattedtextscreen() > 5) { $object->addLine(''); } $object->addLine($day, $font, 'center'); $object->addLine($month . ' ' . $day2 . ' ' . $year, $font, 'center'); $object->addLine($time . ' ' . $AMPM, $font, 'center'); if ($size < 4) { $object->setScrollEnd(); }
# Save session $array = array('uri_onhook' => $XML_SERVER, 'user' => $user, 'type' => 'temp', 'action' => 'record'); Aastra_save_session('vmail', '600', $array, $user); # Dial special number $object->addEntry('Dial:vmail'); } break; # Display # Display case 'display_back': # Display user message if (Aastra_is_formattedtextscreen_supported()) { 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)); }
# Create the object require_once 'AastraIPPhoneFormattedTextScreen.class.php'; $object = new AastraIPPhoneFormattedTextScreen(); # No color FTS if (!Aastra_is_formattedtextscreen_color_supported()) { # Process the results $nb_carac = Aastra_size_display_line(); $object->setScrollStart(Aastra_size_formattedtextscreen()); foreach ($return[1] as $key => $value) { if ($value != NULL) { if ($value[8] != 'N/A') { $last = 'Not Found'; } else { $last = $value[2]; } $object->addLine(format_line($nb_carac, $value[0], $last)); } } $object->addLine(Aastra_get_label('Powered by Yahoo', $language), '', 'center'); $object->setScrollEnd(); } else { # Color FTS $object->setScrollStart(); foreach ($return[1] as $key => $value) { if ($value != NULL) { if ($value[8] != 'N/A') { $last = 'Not Found'; } else { $last = $value[2]; } if ($value[6] < 0) {
$menu->addSoftkey('5', 'Back', $XML_SERVER_PATH . 'contactdir.php?user='******'&searchmethod=' . $searchmethod . '&searchterm=' . $search); $menu->addSoftkey('6', 'Select', 'SoftKey:Select'); $menu->output(); } else { //if no contacts are found, return error and prompt again /* $text->setTitle('Error'); $text->setText('No Matches Found!'); $text->setDestroyOnExit(); $text->setRefresh('3',$XML_SERVER_PATH.'contactdir.php?user='******'&searchmethod='.$searchmethod.'&searchterm='.$search); $text->addSoftKey('6','','SoftKey:Exit'); //hide default buttons $text->output(); */ $screen->setdestroyOnExit(); $screen->setBeep(); $screen->addLine(''); $screen->addLine(''); $screen->addLine(''); $screen->addLine('No Matches Found!', 'double', 'center'); $screen->setRefresh('2', $XML_SERVER_PATH . 'contactdir.php?user='******'&searchmethod=' . $searchmethod . '&searchterm=' . $search); $screen->addSoftKey('6', '', 'SoftKey:Exit'); $screen->output(); } //step 4: otherwise, we have a valid contacts, if they have details, show them } else { $contact = getContact($contact); if ($contact['tel'] || $contact['home'] || $contact['mobile']) { logit('$contact', print_r($contact, 1)); $menu->setTitleWrap(); $menu->setTitle('Please select a detail for ' . $contact['first_name'] . ' ' . $contact['last_name']); $menu->setDestroyOnExit();
function display_message($title, $message, $backURL = NULL) { global $LANGUAGE; # Depending on phone type if (Aastra_phone_type() != 5) { # non 6739i require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen(); $object->setTitle($title); $object->setText($message); $object->addSoftkey('5', Aastra_get_label('Back', $LANGUAGE), $backURL); $object->addSoftkey('6', Aastra_get_label('Exit', $LANGUAGE), 'SoftKey:Exit'); } else { # 6739i/8000i require_once 'AastraIPPhoneFormattedTextScreen.class.php'; $object = new AastraIPPhoneFormattedTextScreen(); $object->addLine('', 'double', 'center'); $object->addLine($title, 'double', 'center', 'red'); $object->setScrollStart('3'); $object->addLine(''); $object->addLine(''); $object->addLine($message, NULL, 'center'); $object->setScrollEnd(); $object->addLine('', NULL, 'center'); $object->addSoftkey('9', Aastra_get_label('Back', $LANGUAGE), $backURL, 1); $object->addSoftkey('10', Aastra_get_label('Exit', $LANGUAGE), 'SoftKey:Exit', 2); $object->addIcon(1, 'Icon:ArrowLeft'); $object->addIcon(2, 'Icon:CircleRed'); } # Common parameters $object->setDestroyOnExit(); $object->setCancelAction($backURL); $object->output(); exit; }
$execute->addEntry('Dial:7001', 'no'); $execute->output(); break; case 'configuration': require_once 'AastraIPPhoneConfiguration.class.php'; $configuration = new AastraIPPhoneConfiguration(); $configuration->addEntry('softkey1 label', 'Test'); $configuration->addEntry('softkey1 type', 'xml'); $configuration->setTriggerDestroyOnExit(); $configuration->output(); break; case 'formattedtextscreen': require_once 'AastraIPPhoneFormattedTextScreen.class.php'; $ftext = new AastraIPPhoneFormattedTextScreen(); $ftext->setDestroyOnExit(); $ftext->addLine('Formatted Screen', 'double', 'center', 'red'); $ftext->setScrollStart(); $ftext->addLine('Scrolled text1'); $ftext->addLine('Scrolled text2'); $ftext->addLine('Scrolled text3'); $ftext->addLine('Scrolled text4'); $ftext->addLine('Scrolled text5'); $ftext->setScrollEnd(); $ftext->addLine('Footer', NULL, 'center'); $ftext->addSoftkey('10', 'Exit', 'SoftKey:Exit'); $ftext->output(); break; case 'status1': require_once 'AastraIPPhoneStatus.class.php'; $status = new AastraIPPhoneStatus(); $status->setTriggerDestroyOnExit();
} } } else { # Presence disabled $line[] = array($callerid, 'double'); $line[] = array(sprintf(Aastra_get_label('Ext. %s', $language), $number)); } } else { # External call $line[] = array($number, 'double' . 'green'); $line[] = array($callerid); } # Format the display if (Aastra_is_formattedtextscreen_color_supported()) { for ($i = 0; $i < 5; $i++) { $object->addLine(''); } foreach ($line as $value) { $object->addLine($value[0], $value[1], NULL, $value[2]); } } else { $count = count($line); $size = Aastra_size_formattedtextscreen(); if ($size >= $count) { $extra = ($size - $count) / 2; for ($i = 0; $i < $extra; $i++) { $object->addLine(''); } foreach ($line as $value) { $object->addLine($value[0]); }
$detail = get_agent_status($queue, $member); # Depending on the phone if (Aastra_is_formattedtextscreen_supported()) { # Display Agent status require_once 'AastraIPPhoneFormattedTextScreen.class.php'; $object = new AastraIPPhoneFormattedTextScreen(); $object->setDestroyOnExit(); if ($is_color_ftextscreen) { if ($detail['Paused']) { $color = 'yellow'; } else { $color = 'green'; } } if ($is_color_ftextscreen) { $object->addLine(sprintf('%s (%s)', Aastra_get_callerid_Asterisk($member), $queue), 'double', 'center', $color); } else { $object->addLine(sprintf('%s (%s)', Aastra_get_callerid_Asterisk($member), $queue), NULL, 'center'); } if ($is_color_ftextscreen) { $object->setScrollStart(); } else { $object->setScrollStart(Aastra_size_formattedtextscreen() - 1); } if ($detail['Paused']) { $text = Aastra_get_label('Status: Paused', $language); } else { $text = Aastra_get_label('Status: Logged on', $language); } if ($is_color_ftextscreen) { $object->addLine($text, NULL, NULL, $color);