Esempio n. 1
0
 }
 $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
         if ($action == 'display') {
             $object->addLine($data['last']['source'] . ' to ' . $data['last']['target'], 'double', 'center');
         } else {
             $object->addLine($data['favorites'][$selection]['source'] . ' to ' . $data['favorites'][$selection]['target'], 'double', 'center');
         }
Esempio n. 2
0
     # 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);
         $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('');
         }
    Aastra_trace_call('csv_directory', 'action=' . $action . ', lookup=' . $lookup . ', page=' . $page . ', index=' . $index . ', lastn=' . $lastn . ', firstn=' . $firstn . ', user='******', speed=' . $speed);
}
# Test User Agent
Aastra_test_phone_versions(array('1' => '', '2' => '1.4.2.', '3' => '2.5.3.', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
# Get Language
$language = Aastra_get_language();
# Get global compatibility
$is_multipleinputfields = Aastra_is_multipleinputfields_supported();
$nb_softkeys = Aastra_number_softkeys_supported();
$is_icons = Aastra_is_icons_supported();
$is_lockin = Aastra_is_lockin_supported();
$is_style_textmenu = Aastra_is_style_textmenu_supported();
$is_formatted_textscreen = Aastra_is_formattedtextscreen_supported();
$is_textmenu_wrapitem = Aastra_is_textmenu_wrapitem_supported();
# Retrieve the size of the display
$chars_supported = Aastra_size_display_line();
if ($is_style_textmenu) {
    $chars_supported--;
}
# To handle non softkey phones
if ($nb_softkeys) {
    $MaxLines = AASTRA_MAXLINES;
} else {
    $MaxLines = AASTRA_MAXLINES - 2;
}
# Update URI
$XML_SERVER .= '?user='******'&source=' . $source . '&back=' . $back;
# Get user context
$ARRAY_USER = get_user_config($user);
# Get csv file location
$error = False;
 function render()
 {
     # Beginning of root tag
     $out = "<AastraIPPhoneTextMenu";
     # DestroyOnExit
     if ($this->_destroyOnExit == 'yes') {
         $out .= " destroyOnExit=\"yes\"";
     }
     # CancelAction
     if ($this->_cancelAction != "") {
         $cancelAction = $this->escape($this->_cancelAction);
         $out .= " cancelAction=\"{$cancelAction}\"";
     }
     # DefaultIndex
     if ($this->_defaultIndex != "") {
         $out .= " defaultIndex=\"{$this->_defaultIndex}\"";
     }
     # Style
     if ($this->_style != '') {
         $out .= " style=\"{$this->_style}\"";
     }
     # Beep
     if ($this->_beep == 'yes') {
         $out .= " Beep=\"yes\"";
     }
     # Lockin
     if ($this->_lockin != '') {
         $out .= " LockIn=\"{$this->_lockin}\"";
     }
     # WrapList
     if ($this->_wraplist == 'yes') {
         $out .= " wrapList=\"yes\"";
     }
     # AllowAnswer
     if ($this->_allowAnswer == 'yes') {
         $out .= " allowAnswer=\"yes\"";
     }
     # AllowDrop
     if ($this->_allowDrop == 'yes') {
         $out .= " allowDrop=\"yes\"";
     }
     # AllowXfer
     if ($this->_allowXfer == 'yes') {
         $out .= " allowXfer=\"yes\"";
     }
     # AllowConf
     if ($this->_allowConf == 'yes') {
         $out .= " allowConf=\"yes\"";
     }
     # Timeout
     if ($this->_timeout != 0) {
         $out .= " Timeout=\"{$this->_timeout}\"";
     }
     # Prevent list wrap
     if ($this->_scrollConstrain == 'yes') {
         $out .= " scrollConstrain=\"yes\"";
     }
     # Number selection
     if ($this->_numberLaunch == 'yes') {
         $out .= " numberLaunch=\"yes\"";
     }
     # Scrolls up/down
     if ($this->_scrollUp != '') {
         $out .= " scrollUp=\"" . $this->escape($this->_scrollUp) . "\"";
     }
     if ($this->_scrollDown != '') {
         $out .= " scrollDown=\"" . $this->escape($this->_scrollDown) . "\"";
     }
     # Unit scroll (6739i)
     if ($this->_unitScroll == 'yes') {
         $out .= " unitScroll=\"yes\"";
     }
     # End of root tag
     $out .= ">\n";
     # Title
     if ($this->_title != '') {
         $title = $this->escape($this->_title);
         $out .= "<Title";
         if ($this->_title_wrap == 'yes') {
             $out .= " wrap=\"yes\"";
         }
         $out .= ">" . $title . "</Title>\n";
     }
     # Menu items
     if (isset($this->_entries) && is_array($this->_entries)) {
         $index = 0;
         $base = NULL;
         $length = Aastra_size_display_line();
         $is_softkeys = Aastra_is_softkeys_supported();
         foreach ($this->_entries as $entry) {
             if ($entry->getBase() != NULL) {
                 $base = $entry->getBase();
             } else {
                 if ($base != NULL) {
                     if ($index < $this->_maxitems) {
                         $out .= $entry->render($this->_style, $length, $is_softkeys, $base);
                     }
                     $base = NULL;
                 } else {
                     if ($index < $this->_maxitems) {
                         $out .= $entry->render($this->_style, $length, $is_softkeys);
                     }
                 }
                 $index++;
             }
         }
     }
     # Softkeys
     if (isset($this->_softkeys) && is_array($this->_softkeys)) {
         foreach ($this->_softkeys as $softkey) {
             $out .= $softkey->render();
         }
     }
     # Icons
     if (isset($this->_icons) && is_array($this->_icons)) {
         $IconList = False;
         foreach ($this->_icons as $icon) {
             if (!$IconList) {
                 $out .= "<IconList>\n";
                 $IconList = True;
             }
             $out .= $icon->render();
         }
         if ($IconList) {
             $out .= "</IconList>\n";
         }
     }
     # End Tag
     $out .= "</AastraIPPhoneTextMenu>\n";
     # Return XML object
     return $out;
 }
function Aastra_format_presence_dt_Asterisk($time)
{
    global $language;
    global $AA_FORMAT_DT;
    # Get the size of the display
    $size = Aastra_size_display_line();
    # Decode date and time
    if ($time != '0') {
        $array_day = array('0' => Aastra_get_label('Sun', $language), '1' => Aastra_get_label('Mon', $language), '2' => Aastra_get_label('Tue', $language), '3' => Aastra_get_label('Wed', $language), '4' => Aastra_get_label('Thu', $language), '5' => Aastra_get_label('Fri', $language), '6' => Aastra_get_label('Sat', $language));
        if ($AA_FORMAT_DT == 'US') {
            $date_screen = $array_day[date('w', $time)] . ' ' . date('m/d/y', $time);
            $time_screen = date('h:i A', $time);
        } else {
            $date_screen = $array_day[date('w', $time)] . ' ' . date('d/m/y', $time);
            $time_screen = date('H:i', $time);
        }
        $line[0] = sprintf(Aastra_get_label('Back %s', $language), $date_screen);
        $line[1] = sprintf(Aastra_get_label('At %s', $language), $time_screen);
    } else {
        $line[0] = Aastra_get_label('No return date/time', $language);
        if (strlen($line[0]) > $size) {
            $line[0] = Aastra_get_label('No return info', $language);
        }
    }
    # Return formatted text
    return $line;
}
Esempio n. 6
0
 if ($continue) {
     # If TZ must be asked
     if ($AA_ASK_TZ) {
         # Get TZ data
         $array_ini = Aastra_readINIfile(AASTRA_CONFIG_DIRECTORY . 'timezone.conf', '#', '=');
         $last = intval(count($array_ini['tz']) / $MaxLines);
         if (count($array_ini['tz']) - $last * $MaxLines != 0) {
             $last++;
         }
         # Create TextMenu
         $object = new AastraIPPhoneTextMenu();
         $object->setDestroyOnExit();
         if (Aastra_is_lockin_supported()) {
             $object->setLockIn();
         }
         if (Aastra_size_display_line() > 16) {
             $object->setTitle(sprintf(Aastra_get_label('Select Timezone (%d/%d)', $language), $page, $last));
         } else {
             $object->setTitle(sprintf(Aastra_get_label('Timezone (%d/%d)', $language), $page, $last));
         }
         # Display current TZ page
         $i = 0;
         if (!$nb_softkeys and $page != 1) {
             $object->addEntry(Aastra_get_label('Previous Page', $language), $XML_SERVER . '&action=input&step=3&extension=' . $extension . '&password='******'&page=' . ($page - 1));
         }
         foreach ($array_ini['tz'] as $key => $value) {
             if ($i >= ($page - 1) * $MaxLines and $i < $page * $MaxLines) {
                 $tzname = strtoupper(substr($key, 0, 4)) . substr($key, -(strlen($key) - 4));
                 $object->addEntry($tzname, $XML_SERVER . '&action=submit&extension=' . $extension . '&password='******'&tz_code=' . $value . '&tz_name=' . $tzname);
             }
             $i++;
Esempio n. 7
0
         }
     }
     Aastra_save_user_context($user, 'notify', $data);
     break;
     # Message
 # Message
 case 'send':
     # Retrieve Message
     $data = Aastra_get_user_context($user, 'message');
     # Send message
     if ($data['long'] != '' and $data['short'] != '') {
         require_once 'AastraIPPhoneStatus.class.php';
         $object = new AastraIPPhoneStatus();
         $object->setBeep();
         $object->setSession('message');
         if (Aastra_size_display_line() > 20) {
             if (Aastra_is_status_uri_supported() and $data['uri'] != '') {
                 $object->addEntry('0', $data['long'], 'alert', '10', $data['uri']);
             } else {
                 $object->addEntry('0', $data['long'], 'alert', '10');
             }
         } else {
             $object->addEntry('0', $data['short'], 'alert', '10');
         }
         # Delete message
         Aastra_save_user_context($user, 'message', NULL);
     } else {
         require_once 'AastraIPPhoneExecute.class.php';
         $object = new AastraIPPhoneExecute();
         $object->addEntry('');
     }