コード例 #1
0
ファイル: follow.php プロジェクト: jamesrusso/Aastra_Scripts
 # User information
 case 'info':
     # Retrieve stored data
     $array_user = Aastra_manage_userinfo_Asterisk($user, 'get');
     # All indexes
     $array_index = array('cell' => array('1', Aastra_get_label('(M)', $language), '1'), 'home' => array('2', Aastra_get_label('(H)', $language), '2'), 'other' => array('3', Aastra_get_label('(O)', $language), '3'));
     # Personal phone numbers
     require_once 'AastraIPPhoneTextMenu.class.php';
     $object = new AastraIPPhoneTextMenu();
     $object->setDestroyOnExit();
     if ($is_style_textmenu) {
         $object->setStyle('none');
     }
     $object->setTitle(Aastra_get_label('Personal Numbers', $language));
     if ($type != '') {
         $object->setDefaultIndex($array_index[$type][2]);
     }
     # Numbers
     foreach ($array_index as $key => $value) {
         if ($array_user[$key] != '') {
             $label = $array_user[$key];
         } else {
             $label = '.....................';
         }
         if ($is_icons) {
             $icon = $value[0];
         } else {
             $icon = '';
             $label = $value[1] . ' ' . $label;
         }
         $object->addEntry($label, $XML_SERVER . '&action=edit_info&type=' . $key, $key, $icon);
コード例 #2
0
ファイル: vmail_4.php プロジェクト: jamesrusso/Aastra_Scripts
 $index = 1;
 $rank = 1;
 $submit = False;
 # Display items
 foreach ($directory as $key => $value) {
     if ($index >= ($dpage - 1) * $MaxLines + 1 and $index <= $dpage * $MaxLines) {
         if ($value['select']) {
             $submit = True;
         }
         if ($value['select']) {
             $object->addEntry($value['name'], $XML_SERVER . '&action=dselect&msg=' . $msg . '&dpage=' . $dpage . '&dindex=' . $key, '', 1);
         } else {
             $object->addEntry($value['name'], $XML_SERVER . '&action=dselect&msg=' . $msg . '&dpage=' . $dpage . '&dindex=' . $key, '', 2);
         }
         if ($key == $dindex) {
             $object->setDefaultIndex($rank);
         }
         $rank++;
     }
     $index++;
 }
 # Icons
 $object->addIcon('1', '0000000804020C30C0000000');
 $object->addIcon('2', '000000000000000000000000');
 # Softkeys
 $object->addSoftkey('1', Aastra_get_label('Select', $language), 'SoftKey:Select');
 if ($dpage != '1') {
     $object->addSoftkey('2', Aastra_get_label('Previous', $language), $XML_SERVER . '&action=forward2&msg=' . $msg . '&dpage=' . ($dpage - 1));
 }
 $object->addSoftkey('3', Aastra_get_label('Reverse', $language), $XML_SERVER . '&action=reverse&msg=' . $msg . '&dpage=' . $dpage);
 if ($submit) {
コード例 #3
0
ファイル: mymenu.php プロジェクト: jamesrusso/Aastra_Scripts
 # At least one menu?
 if (count($config['menu']) > 0) {
     # Retrieve last menu_page
     $nb_menu_pages = count($config['menu']);
     $last = intval($nb_menu_pages / $MaxLines);
     if ($nb_menu_pages - $last * $MaxLines != 0) {
         $last++;
     }
     if ($menu_page > $last) {
         $menu_page = $last;
     }
     # Display menu
     $object = new AastraIPPhoneTextMenu();
     $object->setDestroyOnExit();
     if ($menu_action == 'list' and $menu_pos != '') {
         $object->setDefaultIndex($menu_pos);
     }
     $title = $all['RESERVED']['title'];
     if ($last != 1) {
         $title .= ' (' . $menu_page . '/' . $last . ')';
     }
     $object->setTitle($title);
     if ($is_style_textmenu) {
         $object->setStyle('none');
     }
     $index = 0;
     $menu_pos = 1;
     if (!$nb_softkeys and $menu_page != 1) {
         $object->addEntry(Aastra_get_label('Previous Page', $language), $XML_SERVER . '&menu_page=' . ($menu_page - 1));
     }
     $search = array('/\\$\\$AA_XML_SERVER_AA\\$\\$/', '/\\$\\$AA_XMLDIRECTORY_AA\\$\\$/');
コード例 #4
0
 $object->setTitle(Aastra_get_label('Watch List', $language));
 for ($i = 0; $i < AASTRA_MAXLINES; $i++) {
     if ($data['favorites'][$i]['source'] == '' or $data['favorites'][$i]['target'] == '') {
         $object->addEntry('...........................', $XML_SERVER . '&action=inputfav1&selection=' . $i, $i);
         $data['favorites'][$i]['source'] = '';
         $data['favorites'][$i]['target'] = '';
     } else {
         $object->addEntry(sprintf(Aastra_get_label('%s to %s', $language), $data['favorites'][$i]['source'], $data['favorites'][$i]['target']), $XML_SERVER . '&action=displayfav&selection=' . $i, $i);
         $summary = True;
     }
 }
 # Update user favorites
 Aastra_save_user_context($user, 'currency', $data);
 # Set default index
 if ($default != '') {
     $object->setDefaultIndex($default);
 }
 # Add softkeys
 if ($nb_softkeys == 6) {
     # Regular phone
     if ($page == '0') {
         $object->addSoftkey('1', Aastra_get_label('Select', $language), 'SoftKey:Select');
         $object->addSoftkey('2', Aastra_get_label('Move Up', $language), $XML_SERVER . '&action=up');
         if ($summary) {
             $object->addSoftkey('3', Aastra_get_label('Summary', $language), $XML_SERVER . '&action=summary');
         }
         $object->addSoftkey('4', Aastra_get_label('Edit', $language), $XML_SERVER . '&action=inputfav1&choice=fav1');
         $object->addSoftkey('5', Aastra_get_label('Move Down', $language), $XML_SERVER . '&action=down');
         $object->addSoftkey('6', Aastra_get_label('More', $language), $XML_SERVER . '&action=favorites&page=1&selection=' . $selection);
     } else {
         $object->addSoftkey('2', Aastra_get_label('Clear', $language), $XML_SERVER . '&action=clear&page=1');
コード例 #5
0
ファイル: clock.php プロジェクト: jamesrusso/Aastra_Scripts
     $array_fav[$selection]['name'] = '';
     Aastra_save_user_context($user, 'clock', $array_fav);
     $selection++;
 }
 if ($action == 'set') {
     $key = search_index($city, $array);
     $array_fav[$rank]['index'] = $array[$key]['index'];
     $array_fav[$rank]['name'] = $array[$key]['name'];
     Aastra_save_user_context($user, 'clock', $array_fav);
     $selection = $rank + 1;
 }
 # Display the favorites
 $object = new AastraIPPhoneTextMenu();
 $object->setDestroyOnExit();
 $object->setTitle(Aastra_get_label('Favorite Cities', $language));
 $object->setDefaultIndex($selection);
 if (Aastra_is_style_textmenu_supported) {
     $object->setStyle('none');
 }
 for ($i = 0; $i < $MaxLines; $i++) {
     if ($array_fav[$i]['name'] != '') {
         $object->addEntry($array_fav[$i]['name'], $XML_SERVER . '?action=zoomfav&city=' . $array_fav[$i]['index'] . '&user='******'&selection=' . ($i + 1), $i);
     } else {
         $array[$i]['name'] = '';
         $array[$i]['index'] = '';
         $object->addEntry('..........................', $XML_SERVER . '?action=select' . '&user='******'&rank=' . $i, '');
     }
 }
 # Softkeys
 if ($nb_softkeys > 0) {
     if ($nb_softkeys == 6) {
コード例 #6
0
 } else {
     $conf_speed = Aastra_get_user_context($user, 'speed');
 }
 $found = 0;
 $i = 0;
 while ($found == 0 and $i < $MaxLines) {
     if ($conf_speed[$i]['name'] == '') {
         $found = 1;
     }
     $i++;
 }
 require_once 'AastraIPPhoneTextMenu.class.php';
 $object = new AastraIPPhoneTextMenu();
 $object->setDestroyOnExit();
 if ($found == 1) {
     $object->setDefaultIndex($i);
 }
 $object->setTitle(Aastra_get_label('Speed Dial List', $language));
 for ($i = 0; $i < AASTRA_MAXLINES; $i++) {
     $name = $conf_speed[$i]['name'];
     if ($name == '') {
         if ($nb_softkeys == 10) {
             $name = $i + 1 . '. .................................................';
         } else {
             $name = '..................';
         }
     } else {
         if ($nb_softkeys == 10) {
             $name = $i + 1 . '. ' . $name;
         }
     }
コード例 #7
0
             $icon = '1';
         } else {
             $protected = '*';
         }
     } else {
         if ($is_icons) {
             $icon = '2';
         } else {
             $protected = '-';
         }
     }
     $object->addEntry($protected . $display, $XML_SERVER . '&action=change&index=' . $i, '&index=' . $i, $icon);
 }
 # Default position
 if ($index != '') {
     $object->setDefaultIndex($index + 1);
 }
 # Softkeys
 if ($nb_softkeys) {
     if ($nb_softkeys == 6) {
         # Regular phone
         $object->addSoftkey('1', Aastra_get_label('Toggle', $language), 'SoftKey:Select');
         if ($day == 1) {
             $object->addSoftkey('2', Aastra_get_label('All DAY', $language), $XML_SERVER . '&action=day');
         }
         if ($night == 1) {
             $object->addSoftkey('3', Aastra_get_label('All NIGHT', $language), $XML_SERVER . '&action=night');
         }
         $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
     } else {
         # 6739i
 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();
 }
コード例 #9
0
ファイル: rss.php プロジェクト: jamesrusso/Aastra_Scripts
 } else {
     $MaxLines = AASTRA_MAXLINES - 2;
 }
 # Retrieve last page
 $count = count($array_rss);
 $last = intval($count / $MaxLines);
 if ($count - $last * $MaxLines != 0) {
     $last++;
 }
 # More than one item
 if ($count > 1) {
     # Display list
     $object = new AastraIPPhoneTextMenu();
     $object->setDestroyOnExit();
     if ($last_rank != '') {
         $object->setDefaultIndex(($last_rank - 1) % $MaxLines + 1);
         $page = intval($last_rank / $MaxLines);
         if ($last_rank - $page * $MaxLines != 0) {
             $page++;
         }
     }
     if ($last == '1') {
         $object->setTitle($Title[$index]);
     } else {
         $object->setTitle(sprintf($Title[$index] . ' (%d/%d)', $page, $last));
     }
     if (Aastra_is_style_textmenu_supported()) {
         $object->setStyle('radio');
     }
     if (Aastra_is_textmenu_wrapitem_supported()) {
         $object->setWrapList();
コード例 #10
0
     $menu->addEntry('Choice 3', 'http://myserver.com/script.php?choice=3', 'Value=3');
     $menu->addEntry('Choice 4', 'http://myserver.com/script.php?choice=4', 'Value=4');
     $menu->addEntry('Choice 5', 'http://myserver.com/script.php?choice=5', 'Value=5');
     $menu->addEntry('Choice 6', 'http://myserver.com/script.php?choice=6', 'Value=6');
     $menu->addEntry('Choice 7', 'http://myserver.com/script.php?choice=7', 'Value=7');
     $menu->natsortByName();
     $menu->addSoftkey('1', 'My Select', 'http://myserver.com/script.php?action=1');
     $menu->addSoftkey('10', 'Done', 'SoftKey:Exit');
     $menu->output();
     break;
 case 'textmenu2':
     require_once 'AastraIPPhoneTextMenu.class.php';
     $menu = new AastraIPPhoneTextMenu();
     $menu->setTitle('Title');
     $menu->setDestroyOnExit();
     $menu->setDefaultIndex('2');
     $menu->addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2', '1');
     $menu->addEntry('Choice 1', 'http://myserver.com/script.php?choice=1', 'Value=1', '2');
     $menu->addEntry('Choice 3', 'http://myserver.com/script.php?choice=3', 'Value=3', '3');
     $menu->natsortByName();
     $menu->addSoftkey('1', 'My Select', 'http://myserver.com/script.php?action=1');
     $menu->addSoftkey('9', 'Back', $XML_SERVER);
     $menu->addSoftkey('10', 'Exit', 'SoftKey:Exit');
     $menu->output();
     break;
 case 'textscreen':
     require_once 'AastraIPPhoneTextScreen.class.php';
     $text = new AastraIPPhoneTextScreen();
     $text->setTitle('Title');
     $text->setText('The screen object can be implemented similar to the firmware info screen.');
     $text->setDestroyOnExit();
コード例 #11
0
ファイル: key.php プロジェクト: jamesrusso/Aastra_Scripts
     }
     if ($header['module'][$module] == '560M') {
         $title .= sprintf(Aastra_get_label('Page %d %s', $language), $pagem, $side[0]);
         $parameter = $type . 'page' . $pagem . $side[1];
         $object->addEntry(sprintf(Aastra_get_label('Title: %s', $language), $array_key[$parameter]['value']), $XML_SERVER . '&action=title&type=' . $type . '&selection=' . $parameter . '&page=' . $page . '&set=' . $set, $parameter);
         if ($default_index) {
             $default_index++;
         }
     } else {
         $title .= $side;
     }
 }
 $object->setTitle($title);
 # Default position
 if ($default_index) {
     $object->setDefaultIndex($default_index);
 }
 # Previous page for non-softkey phones
 if (!$nb_softkeys) {
     if ($page != 1) {
         $object->addEntry(Aastra_get_label('Previous Page', $language), $XML_SERVER . '&type=' . $type . '&page=' . ($page - 1) . '&set=' . $set);
     }
 }
 # Set menu item base
 $object->setBase($XML_SERVER . '&type=' . $type . '&page=' . $page . '&set=' . $set);
 # Labels for the types
 $array_type = array('' => Aastra_get_label('Not configured', $language), 'empty' => Aastra_get_label('Empty', $language), 'blf' => Aastra_get_label('BLF', $language), 'blfxfer' => Aastra_get_label('BLF', $language), 'speeddial' => Aastra_get_label('Speed Dial', $language), 'speeddialxfer' => Aastra_get_label('Speed Dial', $language), 'speeddialconf' => Aastra_get_label('Speed Dial', $language), 'dnd' => Aastra_get_label('Phone DND', $language), 'callforward' => Aastra_get_label('Phone CFWD', $language), 'park' => Aastra_get_label('Park', $language), 'dir' => Aastra_get_label('Phone Directory', $language), 'callers' => Aastra_get_label('Callers List', $language), 'icom' => Aastra_get_label('Intercom', $language), 'services' => Aastra_get_label('Services', $language), 'phonelock' => Aastra_get_label('Lock/Unlock', $language), 'paging' => Aastra_get_label('Paging', $language), 'xml' => Aastra_get_label('Application', $language));
 # Display items
 for ($i = 1; $i <= $nb_keys; $i++) {
     # Key in the page?
     if ($i > $keys_per_page * ($page - 1) and $i <= $keys_per_page * $page) {