Exemplo n.º 1
0
# Retrieve parameters
$user = Aastra_getvar_safe('user');
$action = Aastra_getvar_safe('action');
$value = Aastra_getvar_safe('value');
$selection = Aastra_getvar_safe('selection');
$page = Aastra_getvar_safe('page', '1');
$type = Aastra_getvar_safe('type');
# Maximum number of phones in the follow-me list
$MAX_NUMBERS = 10;
# Trace
Aastra_trace_call('follow_asterisk', 'user='******', action=' . $action . ', value=' . $value . ', selection=' . $selection);
# Test User Agent
Aastra_test_phone_versions(array('1' => '1.4.2.', '2' => '1.4.2.', '3' => '2.5.3.', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
# Get global compatibility
$nb_softkeys = Aastra_number_softkeys_supported();
$is_icons = Aastra_is_icons_supported();
$is_style_textmenu = Aastra_is_style_textmenu_supported();
# Initial call
if ($action == '') {
    if ($nb_softkeys) {
        $action = 'main';
    } else {
        $action = 'change_status2';
    }
}
# Get Language
$language = Aastra_get_language();
# Keep return URI
$XML_SERVER .= '?user=' . $user;
# Compute MaxLines
if ($nb_softkeys) {
Exemplo n.º 2
0
 if ($page != 1) {
     $object->addSoftkey('3', Aastra_get_label('Previous Page', $language), $XML_SERVER . '&action=list&lookup=' . $lookup . '&page=' . ($page - 1), 14);
 }
 if ($lookup == '') {
     $object->addSoftkey('5', Aastra_get_label('Lookup', $language), $XML_SERVER . '&action=search', 15);
 } else {
     $object->addSoftkey('4', Aastra_get_label('List Mode', $language), $XML_SERVER . '&action=list', 16);
     $object->addSoftkey('5', Aastra_get_label('New Lookup', $language), $XML_SERVER . '&action=search', 15);
 }
 $object->addSoftkey('7', Aastra_get_label('Preferences', $language), $XML_SERVER . '&action=prefs&lookup=' . $lookup . '&page=' . $page, 17);
 if ($page != $last) {
     $object->addSoftkey('8', Aastra_get_label('Next Page', $language), $XML_SERVER . '&action=list&lookup=' . $lookup . '&page=' . ($page + 1), 18);
 }
 $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit', 19);
 # Icons
 if (Aastra_is_icons_supported()) {
     $object->addIcon('1', 'Icon:PresenceAvailable');
     $object->addIcon('2', 'Icon:PresenceNotAvailable');
     $object->addIcon('3', 'Icon:PhoneRinging');
     $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');
 }
 function _setupIcons()
 {
     if (Aastra_is_icons_supported()) {
         $this->addIcon($this->_nextKeyIconIndex, $this->_nextKeyIcon);
         $this->addIcon($this->_previousKeyIconIndex, $this->_previousKeyIcon);
         if (Aastra_phone_type() == 5) {
             # 6739i
             $this->addIcon($this->_backKeyIconIndex, 'Icon:ArrowLeft');
             $this->addIcon($this->_selectKeyIconIndex, 'Icon:Information');
             $this->addIcon($this->_exitKeyIconIndex, 'Icon:CircleRed');
         }
     }
 }
 function addEntry($name, $url, $selection = NULL, $icon = NULL, $dial = NULL, $line = NULL)
 {
     if (!Aastra_is_icons_supported()) {
         $icon = NULL;
     }
     $this->_entries[] = new AastraIPPhoneTextMenuEntry($name, $url, $selection, $icon, $dial, $line, NULL);
 }
 function zoom($index, $recentPage, $recentSelection)
 {
     # Find record matching the given index
     foreach ($this->_list as $record) {
         if ($record['index'] == $index) {
             $myrecord = $record;
             break;
         }
     }
     # Textmenu for the zoom
     $menu = new AastraIPPhoneTextMenu();
     $menu->setDestroyOnExit();
     if (Aastra_is_style_textmenu_supported()) {
         $menu->setStyle('none');
     }
     if (Aastra_is_wrap_title_supported()) {
         $menu->setTitleWrap();
     }
     if (Aastra_is_textmenu_wrapitem_supported()) {
         $menu->setWrapList();
     }
     $menu->setTitle($myrecord['name']);
     # Default Index
     $defaultIndex = 1;
     if (!empty($myrecord['title'])) {
         $menu->addEntry($myrecord['title'], NULL, NULL);
         $defaultIndex++;
     }
     if (!empty($myrecord['department'])) {
         $menu->addEntry($myrecord['department'], NULL, NULL);
         $defaultIndex++;
     }
     if (!empty($myrecord['company'])) {
         $menu->addEntry($myrecord['company'], NULL, NULL);
         $defaultIndex++;
     }
     $menu->setDefaultIndex($defaultIndex);
     # If Dial2 softkey is supported, add 'Dial:' Prefix to URL (so number can be dialed by pressing right navigation key)
     if (!Aastra_test_phone_version('2.0.1.', 1)) {
         $URLprefix = 'Dial:';
     } else {
         $URLprefix = '';
     }
     # Office Number
     if (!empty($myrecord['office'])) {
         if (Aastra_is_icons_supported()) {
             $iconIndex = 10;
             $prompt = '';
         } else {
             $iconIndex = NULL;
             $prompt = Aastra_get_label('(W)', $this->_language) . ' ';
         }
         if (!Aastra_test_phone_version('2.0.1.', 1)) {
             $menu->addEntry($prompt . $myrecord['office'], $URLprefix . $myrecord['officeDigits'], $myrecord['officeDigits'], $iconIndex, $myrecord['officeDigits']);
         } else {
             $menu->addEntry($prompt . $myrecord['office'], $URLprefix . $myrecord['officeDigits'], $myrecord['officeDigits']);
         }
     }
     # Office 2 number
     if (!empty($myrecord['office2'])) {
         if (Aastra_is_icons_supported()) {
             $iconIndex = 10;
             $prompt = '';
         } else {
             $iconIndex = NULL;
             $prompt = Aastra_get_label('(W)', $this->_language) . ' ';
         }
         if (!Aastra_test_phone_version('2.0.1.', 1)) {
             $menu->addEntry($prompt . $myrecord['office2'], $URLprefix . $myrecord['office2Digits'], $myrecord['officeDigits'], $iconIndex, $myrecord['office2Digits']);
         } else {
             $menu->addEntry($prompt . $myrecord['office2'], $URLprefix . $myrecord['office2Digits'], $myrecord['officeDigits']);
         }
     }
     # Mobile number
     if (!empty($myrecord['mobile'])) {
         if (Aastra_is_icons_supported()) {
             $iconIndex = 11;
             $prompt = '';
         } else {
             $iconIndex = NULL;
             $prompt = Aastra_get_label('(C)', $this->_language) . ' ';
         }
         if (!Aastra_test_phone_version('2.0.1.', 1)) {
             $menu->addEntry($prompt . $myrecord['mobile'], $URLprefix . $myrecord['mobileDigits'], $myrecord['officeDigits'], $iconIndex, $myrecord['mobileDigits']);
         } else {
             $menu->addEntry($prompt . $myrecord['mobile'], $URLprefix . $myrecord['mobileDigits'], $myrecord['officeDigits']);
         }
     }
     # Home number
     if (!empty($myrecord['home'])) {
         if (Aastra_is_icons_supported()) {
             $iconIndex = 12;
             $prompt = '';
         } else {
             $iconIndex = NULL;
             $prompt = Aastra_get_label('(H)', $this->_language) . ' ';
         }
         if (!Aastra_test_phone_version('2.0.1.', 1)) {
             $menu->addEntry($prompt . $myrecord['home'], $URLprefix . $myrecord['homeDigits'], $myrecord['officeDigits'], $iconIndex, $myrecord['homeDigits']);
         } else {
             $menu->addEntry($prompt . $myrecord['home'], $URLprefix . $myrecord['homeDigits'], $myrecord['officeDigits']);
         }
     }
     # Softkeys
     if (Aastra_is_softkeys_supported()) {
         if (Aastra_number_softkeys_supported() != 10) {
             # Regular phone with 6 softkeys
             if (!Aastra_test_phone_version('2.0.1.', 1)) {
                 $dialKeyType = 'SoftKey:Dial2';
             } else {
                 $dialKeyType = 'SoftKey:Dial';
             }
             $menu->addSoftkey(1, Aastra_get_label('Dial', $this->_language), $dialKeyType);
             $menu->addSoftkey(3, Aastra_get_label('Back', $this->_language), $this->_scrollHandlerReference . '&listPage=' . $recentPage . '&recentSelection=' . $recentSelection);
             $menu->addSoftkey(6, Aastra_get_label('Exit', $this->_language), 'SoftKey:Exit');
             # Check if speed dial URL is set
             if (isset($myrecord['speedURL'])) {
                 $menu->addSoftkey(4, Aastra_get_label('Add to Speed Dial', $this->_language), $myrecord['speedURL']);
             }
         } else {
             # 6739i
             $menu->addSoftkey(9, Aastra_get_label('Back', $this->_language), $this->_scrollHandlerReference . '&listPage=' . $recentPage . '&recentSelection=' . $recentSelection, 8);
             $menu->addSoftkey(10, Aastra_get_label('Exit', $this->_language), 'SoftKey:Exit', 9);
             # Check if speed dial URL is set
             if (isset($myrecord['speedURL'])) {
                 $menu->addSoftkey(6, Aastra_get_label('+Speed', $this->_language), $myrecord['speedURL']);
             }
         }
     }
     # Icons
     if (Aastra_is_icons_supported()) {
         if (Aastra_phone_type() != 5) {
             $menu->addIcon(10, Aastra_get_custom_icon('Office'));
             $menu->addIcon(11, Aastra_get_custom_icon('Cellphone'));
             $menu->addIcon(12, Aastra_get_custom_icon('Home'));
         } else {
             $menu->addIcon(8, 'Icon:ArrowLeft');
             $menu->addIcon(9, 'Icon:CircleRed');
             $menu->addIcon(10, 'Icon:Office');
             $menu->addIcon(11, 'Icon:CellPhone');
             $menu->addIcon(12, 'Icon:Home');
         }
     }
     # Cancel action
     $menu->setCancelAction($this->_scrollHandlerReference . '&listPage=' . $recentPage . '&recentSelection=' . $recentSelection);
     # Display XML object
     $menu->output();
 }