if ($index >= ($page - 1) * $MaxLines + 1 and $index <= $page * $MaxLines) { if ($v['number'] == $selection) { $object->setDefaultIndex($rank); } $name = $v['name']; if ($AA_PRESENCE_STATE) { $name = '[' . $status_text[$v['status']]['mnemonic'] . ']' . $v['name']; } $object->addEntry($name, $v['number'], $v['number']); $rank++; } $index++; } # Softkeys if (!$AA_PRESENCE_STATE) { $object->addSoftkey('1', Aastra_get_label('Dial', $language), 'SoftKey:Dial'); if ($AA_SPEEDDIAL_STATE) { $object->addSoftkey('3', Aastra_get_label('+Speed', $language), $XML_SERVER . '&action=select&orig_s=list&page=' . $page); } } else { $object->addSoftkey('1', Aastra_get_label('Select', $language), $XML_SERVER . '&action=zoom&page=' . $page); $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=' . $user); } } if ($page != 1) {
$object->addEntry($name, '&action=view&selection=' . $i, $i); } } else { $object->addEntry($name, '&action=view&selection=' . $i, $i); } $nb_entries++; } } # At least one item in static mode if ($mode != 'dynamic' and $nb_entries == 0) { $object->addEntry(Aastra_get_label('NO ENTRY', $language), ''); } # Add Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('1', Aastra_get_label('Select', $language), 'SoftKey:Select'); if ($mode == 'dynamic') { $object->addSoftkey('2', Aastra_get_label('Move Up', $language), $XML_SERVER . '&action=up'); $object->addSoftkey('3', Aastra_get_label('Clear', $language), $XML_SERVER . '&action=clear'); $object->addSoftkey('4', Aastra_get_label('Edit', $language), $XML_SERVER . '&action=edit'); $object->addSoftkey('5', Aastra_get_label('Move Down', $language), $XML_SERVER . '&action=down'); } $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { if ($mode == 'dynamic') { $object->addSoftkey('3', Aastra_get_label('Move Up', $language), $XML_SERVER . '&action=up'); $object->addSoftkey('5', Aastra_get_label('Clear', $language), $XML_SERVER . '&action=clear'); $object->addSoftkey('6', Aastra_get_label('Edit', $language), $XML_SERVER . '&action=edit'); $object->addSoftkey('8', Aastra_get_label('Move Down', $language), $XML_SERVER . '&action=down'); $object->addSoftkey('4', Aastra_get_label('Page Up', $language), $XML_SERVER . '&action=pgup'); $object->addSoftkey('9', Aastra_get_label('Page Down', $language), $XML_SERVER . '&action=pgdn');
if ($index >= ($dpage - 1) * $MaxLines + 1 and $index <= $dpage * $MaxLines) { if ($value['select']) { $submit = True; $object->addEntry('X ' . $value['name'], $XML_SERVER . '&action=dselect&msg=' . $msg . '&dpage=' . $dpage . '&dindex=' . $key); } else { $object->addEntry('_ ' . $value['name'], $XML_SERVER . '&action=dselect&msg=' . $msg . '&dpage=' . $dpage . '&dindex=' . $key); } if ($key == $dindex) { $object->setDefaultIndex($rank); } $rank++; } $index++; } # Softkeys $object->addSoftkey('1', Aastra_get_label('Reverse Selection', $language), $XML_SERVER . '&action=reverse&msg=' . $msg . '&dpage=' . $dpage . '&origin=' . $origin); if ($dpage != '1') { $object->addSoftkey('3', Aastra_get_label('Previous Page', $language), $XML_SERVER . '&action=forward2&msg=' . $msg . '&dpage=' . ($dpage - 1) . '&origin=' . $origin); } if ($dpage != $last) { $object->addSoftkey('8', Aastra_get_label('Next Page', $language), $XML_SERVER . '&action=forward2&msg=' . $msg . '&dpage=' . ($dpage + 1) . '&origin=' . $origin); } if ($submit) { $object->addSoftkey('9', Aastra_get_label('Submit', $language), $XML_SERVER . '&action=dsubmit&msg=' . $msg . '&origin=' . $origin); } if ($origin == 'list') { $object->addSoftkey('10', Aastra_get_label('Cancel', $language), $XML_SERVER . '&action=list&last_msg=' . $msg); } else { $object->addSoftkey('10', Aastra_get_label('Cancel', $language), $XML_SERVER . '&action=detail&msg=' . $msg); } } else {
# Title if ($lookup == '') { 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)); } } # Softkeys $object->addSoftkey('1', Aastra_get_label('Dial', $language), $XML_SERVER . '&action=dial', 10); if (Aastra_get_intercom_config_Asterisk() != '') { $object->addSoftkey('2', Aastra_get_label('Intercom', $language), $XML_SERVER . '&action=intercom', 11); } if (!$AA_PRESENCE_STATE) { if ($AA_SPEEDDIAL_STATE) { $object->addSoftkey('6', Aastra_get_label('Add to Speed Dial', $language), $XML_SERVER . '&action=select&page=' . $page . '&orig_s=list', 12); } } else { switch ($origin) { case 'presence': $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER_PATH . 'away.php?user='******'directory': if ($AA_SPEEDDIAL_STATE) { $object->addSoftkey('6', Aastra_get_label('Add to Speed Dial', $language), $XML_SERVER . '&action=select&lookup=' . $lookup . '&page=' . $page . '&orig_s=list', 12);
$object->addEntry(Aastra_get_label('Status: Activated', $language), $XML_SERVER . '&action=change_status'); } else { $object->addEntry(Aastra_get_label('Status: Deactivated', $language), $XML_SERVER . '&action=change_status'); } $object->addEntry(sprintf(Aastra_get_label('Initial Ring Time: %ss', $language), $array_fm['prering']), $XML_SERVER . '&action=change_prering'); $object->addEntry(sprintf(Aastra_get_label('Ring Time: %ss', $language), $array_fm['grptime']), $XML_SERVER . '&action=change_grptime'); if ($array_fm['grpconf']) { $object->addEntry(Aastra_get_label('Confirm Calls: Yes', $language), $XML_SERVER . '&action=change_grpconf'); } else { $object->addEntry(Aastra_get_label('Confirm Calls: No', $language), $XML_SERVER . '&action=change_grpconf'); } $object->addEntry(sprintf(Aastra_get_label('%s phone number(s)', $language), count($array_fm['grplist'])), $XML_SERVER . '&action=change_grplist'); # Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('1', Aastra_get_label('Change', $language), 'SoftKey:Select'); $object->addSoftkey('2', Aastra_get_label('My Numbers', $language), $XML_SERVER . '&action=info'); $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey('1', Aastra_get_label('My Numbers', $language), $XML_SERVER . '&action=info'); $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } } } break; # Default # Default default: # Debug Aastra_debug('Unexpected action:' . $action); require_once 'AastraIPPhoneExecute.class.php';
$object = new AastraIPPhoneTextMenu(); $object->setDestroyOnExit(); if (Aastra_is_style_textmenu_supported()) { $object->setStyle('radio'); } # Title $object->setTitle($array_rss[99]['title']); # Display topics foreach ($array_rss as $key => $value) { if ($key != '99') { $object->addEntry($value['title'], $value['uri'] . '&user='******'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()) {
if ($nb_softkeys == 10) { $name = $i + 1 . '. .................................................'; } else { $name = '..................'; } } else { if ($nb_softkeys == 10) { $name = $i + 1 . '. ' . $name; } } $object->addEntry($name, $XML_SERVER . '&action=set_speed&speed=' . $i, ''); } # Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('1', Aastra_get_label('Select', $language), 'SoftKey:Select'); $object->addSoftkey('4', Aastra_get_label('Cancel', $language), $XML_SERVER . '&action=zoom'); $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey('9', Aastra_get_label('Cancel', $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:PresenceNotAvailable'); $object->addIcon(2, 'Icon:CircleRed'); } } break; # Set speed dial # Set speed dial case 'set_speed': # Retrieve session
if (Aastra_is_wrap_title_supported()) { $object->setTitleWrap(); } if (!Aastra_is_softkeys_supported() and $page != 1) { $object->addEntry(Aastra_get_label('Previous Page', $language), $XML_SERVER . '&index=' . ($index + 1) . '&page=' . ($page - 1)); } $i = 1; foreach ($array_rss as $key => $value) { if ($i >= ($page - 1) * $MaxLines + 1 and $i <= $page * $MaxLines) { $object->addEntry($value['title'], $value['uri'] . '&set=' . $set); } $i++; } if (Aastra_is_softkeys_supported()) { if (Aastra_number_softkeys_supported() < 7) { $object->addSoftkey('1', Aastra_get_label('Select', $language), 'SoftKey:Select'); if ($page != 1) { $object->addSoftkey('2', Aastra_get_label('Previous', $language), $XML_SERVER . '&index=' . ($index + 1) . '&page=' . ($page - 1)); } if ($page != $last) { $object->addSoftkey('5', Aastra_get_label('Next', $language), $XML_SERVER . '&index=' . ($index + 1) . '&page=' . ($page + 1)); } if ($nb_rss > 1) { $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER . '&last_index=' . ($index + 1)); $object->setCancelAction($XML_SERVER . '&last_index=' . ($index + 1)); } $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $last_set = intval($nb_rss / 4); if ($nb_rss - $last_set * 4 != 0) { $last_set++;
$text->addSoftkey('3', 'Help', $XML_SERVER_PATH . 'contactdir.php?user='******'&searchmethod=help'); $text->addSoftkey('6', 'Exit', 'SoftKey:Exit'); $text->output(); break; } //step3: if we do have a search term, see if there are any contacts for said term } elseif (!$contact) { $contacts = search($search); if ($contacts) { $menu->setTitle('Please select a contact'); $menu->setDestroyOnExit(); foreach ($contacts as $contact => $val) { $menu->addEntry($val['first_name'] . ' ' . $val['last_name'], $XML_SERVER_PATH . 'contactdir.php?user='******'&contact=' . $val['id'] . '&searchmethod=' . $searchmethod . '&search=' . $search); } $menu->natsortByName(); $menu->addSoftkey('3', 'Exit', 'SoftKey:Exit'); $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();
} $index++; } # Default position if ($default != '') { $object->setDefaultIndex($default); } # Previous page for non softkey phones if (!$nb_softkeys and $page != $last) { $object->addEntry(Aastra_get_label('Next Page', $language), $XML_SERVER . '&action=show_queues_page&page=' . ($page + 1)); } # Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) { if ($last == 1) { $object->addSoftkey('1', Aastra_get_label('Logon/off', $language), 'SoftKey:Select'); if ($pause) { $object->addSoftkey('2', Aastra_get_label('(Un)Pause', $language), $XML_SERVER . '&action=pause'); } if ($logoff_all) { $object->addSoftkey('3', Aastra_get_label('LOGOFF', $language), $XML_SERVER . '&action=logoff_all'); } if ($pause_all) { $object->addSoftkey('4', Aastra_get_label('PAUSE', $language), $XML_SERVER . '&action=pause_all'); } if ($unpause_all) { $object->addSoftkey('5', Aastra_get_label('UNPAUSE', $language), $XML_SERVER . '&action=unpause_all'); } $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { if ($menu_set == 1) {
$object->setDefaultIndex($selection); } # Icons if ($is_icons) { if (Aastra_phone_type() != 5) { $object->addIcon('1', Aastra_get_custom_icon('Speaker')); $object->addIcon('2', Aastra_get_custom_icon('Muted')); } else { $object->addIcon(1, 'Icon:Speaker'); $object->addIcon(2, 'Icon:Mute'); } } # Softkeys if ($nb_softkeys == 6) { if ($mode == 'admin') { $object->addSoftkey(1, Aastra_get_label('(Un)Mute', $language), $XML_SERVER . '&action=mute&page=' . $page . '&confno=' . $confno . '&mode=' . $mode); $object->addSoftkey(3, Aastra_get_label('Kick', $language), $XML_SERVER . '&action=kick&page=' . $page . '&confno=' . $confno . '&mode=' . $mode); } if ($page != 1) { $object->addSoftkey(2, Aastra_get_label('Previous', $language), $XML_SERVER . '&action=display&page=' . ($page - 1) . '&confno=' . $confno . '&mode=' . $mode); } $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER . '&confno=' . $confno); if ($page != $last) { $object->addSoftkey(5, Aastra_get_label('Next', $language), $XML_SERVER . '&action=display&page=' . ($page + 1) . '&confno=' . $confno . '&mode=' . $mode); } $object->addSoftkey(6, Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { if ($mode == 'admin') { $object->addSoftkey(1, Aastra_get_label('(Un)Mute', $language), $XML_SERVER . '&action=mute&page=' . $page . '&confno=' . $confno . '&mode=' . $mode); $object->addSoftkey(2, Aastra_get_label('Kick', $language), $XML_SERVER . '&action=kick&page=' . $page . '&confno=' . $confno . '&mode=' . $mode); }
} else { if ($last != 1) { $object->setTitle(sprintf(Aastra_get_label('Results (%s-%s)', $language), $min, $max)); } else { $object->setTitle(Aastra_get_label('Results', $language)); } } # Softkeys $intercom = Aastra_get_intercom_config_Asterisk(); # How many pages if ($last == 1) { # First menu set if ($menu_set == '1') { # Single page list if ($intercom != '') { $object->addSoftkey('2', Aastra_get_label('Icom', $language), $XML_SERVER . '&action=intercom'); } if (!$AA_PRESENCE_STATE) { $object->addSoftkey('1', Aastra_get_label('Dial', $language), 'SoftKey:Dial2'); if ($AA_SPEEDDIAL_STATE) { $object->addSoftkey('3', Aastra_get_label('+Speed', $language), $XML_SERVER . '&action=select&orig_s=list' . '&lookup=' . $lookup); } } else { $object->addSoftkey('1', Aastra_get_label('Select', $language), $XML_SERVER . '&action=zoom' . '&lookup=' . $lookup); $object->addSoftkey('3', Aastra_get_label('Dial', $language), 'SoftKey:Dial2'); if ($origin != 'presence') { if ($AA_SPEEDDIAL_STATE) { $object->addSoftkey('4', Aastra_get_label('+Speed', $language), $XML_SERVER . '&action=select&orig_s=list' . '&lookup=' . $lookup); } } else { $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER_PATH . '/away.php?user=' . $user);
$object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('Settings', $LANGUAGE)); if ($is_style_textmenu) { $object->setStyle('none'); } if ($index != '') { $object->setDefaultIndex($index); } $text = array('firstlast' => Aastra_get_label('First Last', $LANGUAGE), 'lastfirst' => Aastra_get_label('Last First', $LANGUAGE)); $object->addEntry(sprintf(Aastra_get_label('Display: %s', $LANGUAGE), $text[$ARRAY_USER['display']]), $XML_SERVER . '&action=set_display', ''); $text = array('last' => Aastra_get_label('Last Name', $LANGUAGE), 'first' => Aastra_get_label('First Name', $LANGUAGE)); $object->addEntry(sprintf(Aastra_get_label('Sort: %s', $LANGUAGE), $text[$ARRAY_USER['sort']]), $XML_SERVER . '&action=set_sort', ''); # Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('1', Aastra_get_label('Change', $LANGUAGE), 'SoftKey:Select'); $object->addSoftkey('4', Aastra_get_label('Back', $LANGUAGE), $XML_SERVER . '&action=input'); $object->addSoftkey('6', Aastra_get_label('Exit', $LANGUAGE), 'SoftKey:Exit'); } else { $object->addSoftkey('9', Aastra_get_label('Back', $LANGUAGE), $XML_SERVER . '&action=input', 1); $object->addSoftkey('10', Aastra_get_label('Exit', $LANGUAGE), 'SoftKey:Exit', 2); $object->setCancelAction($XML_SERVER . '&action=input'); $object->addIcon(1, 'Icon:ArrowLeft'); $object->addIcon(2, 'Icon:CircleRed'); } } else { $object->addEntry(Aastra_get_label('Back', $LANGUAGE), $XML_SERVER . '&action=input'); $object->setCancelAction($XML_SERVER . '&action=input'); } break; # Change display value
$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(); $text->addSoftkey('1', 'Mail', 'http://myserver.com/script.php?action=1'); $text->addSoftkey('6', 'Exit', 'SoftKey:Exit'); $text->output(); break; case 'inputscreen1':
$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 $object->addSoftkey('1', Aastra_get_label('Toggle', $language), $XML_SERVER . '&action=change'); if ($day == 1) { $object->addSoftkey('6', Aastra_get_label('All DAY', $language), $XML_SERVER . '&action=day'); } if ($night == 1) { $object->addSoftkey('7', Aastra_get_label('All NIGHT', $language), $XML_SERVER . '&action=night');
$icon = '4'; } else { $icon = ''; } $object->addEntry(Aastra_get_label('Enter Number', $language), $XML_SERVER . '&action=edit_number1&state=' . $state, '', $icon); # Icons if ($is_icons) { $object->addIcon(1, Aastra_get_custom_icon('Cellphone')); $object->addIcon(2, Aastra_get_custom_icon('Home')); $object->addIcon(3, Aastra_get_custom_icon('Phone')); $object->addIcon(4, Aastra_get_custom_icon('Keypad')); } # Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('1', Aastra_get_label('Select', $language), 'SoftKey:Select'); $object->addSoftkey('5', Aastra_get_label('Cancel', $language), $XML_SERVER . '&action=input_prefs2&state=' . $state); $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey('9', Aastra_get_label('Cancel', $language), $XML_SERVER . '&action=input_prefs2&state=' . $state); $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } } # Cancel action $object->setCancelAction($XML_SERVER . '&action=input_prefs2&state=' . $state); break; # Record Temp message # Record Temp message case 'rec_msg': # Get current status $away = Aastra_manage_presence_Asterisk($user, 'get');
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) { $object->addSoftkey('1', Aastra_get_label('Select', $language), 'SoftKey:Select'); $object->addSoftkey('2', Aastra_get_label('Move Up', $language), $XML_SERVER . '?user='******'&action=up'); $object->addSoftkey('3', Aastra_get_label('Clear', $language), $XML_SERVER . '?user='******'&action=clear'); $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER . '?user='******'&action=list'); $object->addSoftkey('5', Aastra_get_label('Move Down', $language), $XML_SERVER . '?user='******'&action=down'); $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey('3', Aastra_get_label('Move Up', $language), $XML_SERVER . '?user='******'&action=up'); $object->addSoftkey('8', Aastra_get_label('Move Down', $language), $XML_SERVER . '?user='******'&action=down'); $object->addSoftkey('6', Aastra_get_label('Clear', $language), $XML_SERVER . '?user='******'&action=clear'); $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER . '?user='******'&action=list'); $object->setCancelAction($XML_SERVER . '?user='******'&action=list'); $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } } break;
# Straight to the directory require_once 'AastraIPPhoneExecute.class.php'; $object = new AastraIPPhoneExecute(); $object->addEntry($ARRAY_CONFIG[$first_source]['uri']); break; # More than one # More than one default: # Display selection require_once 'AastraIPPhoneTextMenu.class.php'; $object = new AastraIPPhoneTextMenu(); $object->setDestroyOnExit(); $object->setTitle(Aastra_get_label('Directory Selection', $language)); foreach ($ARRAY_CONFIG as $source => $value) { $object->addEntry($value['label'], $value['uri'] . '&back=1'); } # Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('1', Aastra_get_label('Select', $language), 'SoftKey:Select'); $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; } # Send XML answer $object->output(); exit;
} } else { # Display the queue require_once 'AastraIPPhoneTextMenu.class.php'; $object = new AastraIPPhoneTextMenu(); $object->setDestroyOnExit(); if (Aastra_is_style_textmenu_supported()) { $object->setStyle('none'); } $object->setTitle(Aastra_get_label('Parked Calls', $language)); if (Aastra_is_softkeys_supported()) { if (Aastra_is_dialuri_supported()) { for ($index = 0; $index < $count; $index++) { $object->addEntry(sprintf('%s-%s', $park[$index][0], $park[$index][1]), 'Dial:' . $park[$index][0], $park[$index][0], '', $park[$index][0]); } $object->addSoftkey(1, Aastra_get_label('Pickup', $language), 'SoftKey:Select'); } else { if (Aastra_is_dialkey_supported()) { for ($index = 0; $index < $count; $index++) { $object->addEntry(sprintf('%s-%s', $park[$index][0], $park[$index][1]), $park[$index][0], $park[$index][0]); } $object->addSoftkey(1, Aastra_get_label('Pickup', $language), 'SoftKey:Dial'); } else { for ($index = 0; $index < $count; $index++) { $object->addEntry(sprintf('%s-%s', $park[$index][0], $park[$index][1]), $XML_SERVER . '&action=dial&value=' . $park[$index][0], $park[$index][0]); } $object->addSoftkey(1, Aastra_get_label('Pickup', $language), 'SoftKey:Select'); } } if ($nb_softkeys) { if ($nb_softkeys == 6) {
} # 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++; } if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('1', Aastra_get_label('Select', $language), 'SoftKey:Select'); if ($page != 1) { $object->addSoftkey('2', Aastra_get_label('Previous', $language), $XML_SERVER . '&action=input&step=3&extension=' . $extension . '&password='******'&page=' . ($page - 1)); } if ($page != $last) { $object->addSoftkey('5', Aastra_get_label('Next', $language), $XML_SERVER . '&action=input&step=3&extension=' . $extension . '&password='******'&page=' . ($page + 1)); } } else { if ($page != 1) { $object->addSoftkey('3', Aastra_get_label('Previous', $language), $XML_SERVER . '&action=input&step=3&extension=' . $extension . '&password='******'&page=' . ($page - 1)); } if ($page != $last) { $object->addSoftkey('8', Aastra_get_label('Next', $language), $XML_SERVER . '&action=input&step=3&extension=' . $extension . '&password='******'&page=' . ($page + 1)); } } } else {
} $object->setTitle($title); if ($is_style_textmenu) { $object->setStyle('none'); } $index = 0; foreach ($all as $key => $value) { if ($index >= ($menu_page2 - 1) * $MaxLines and $index < $menu_page2 * $MaxLines) { $object->addEntry($value['title'], $XML_SERVER . '&menu_action=update&selection=' . $key . '&menu_page2=' . $menu_page2, $key); } $index++; } # Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) { $object->addSoftkey('1', Aastra_get_label('Add', $language), 'SoftKey:Select'); if ($menu_page2 != 1) { $object->addSoftkey('2', Aastra_get_label('Previous', $language), $XML_SERVER . '&menu_action=add&menu_page2=' . ($menu_page2 - 1)); } if ($menu_page2 != $last) { $object->addSoftkey('5', Aastra_get_label('Next', $language), $XML_SERVER . '&menu_action=add&menu_page2=' . ($menu_page2 + 1)); } $object->addSoftkey('3', Aastra_get_label('Details', $language), $XML_SERVER . '&menu_action=details&menu_page2=' . $menu_page2); $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER . '&menu_page=' . $menu_page); $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } else { $object->addSoftkey('1', Aastra_get_label('Add', $language), 'SoftKey:Select'); if ($menu_page2 != 1) { $object->addSoftkey('3', Aastra_get_label('Previous Page', $language), $XML_SERVER . '&menu_action=add&menu_page2=' . ($menu_page2 - 1)); } if ($menu_page2 != $last) {
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(); }
} 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'); if ($summary) { $object->addSoftkey('3', Aastra_get_label('Summary', $language), $XML_SERVER . '&action=summary'); } $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER . '&action=init'); $object->addSoftkey('5', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); $object->addSoftkey('6', Aastra_get_label('More', $language), $XML_SERVER . '&action=favorites&page=0&selection=' . $selection);
switch ($header['model']) { case 'Aastra480i': case 'Aastra480i Cordless': if ($display['work'] != '') { $object->addEntry($title['W'] . ' ' . $display['work'], $dial['work']); } if ($display['mobile'] != '') { $object->addEntry($title['M'] . ' ' . $display['mobile'], $dial['mobile']); } if ($display['home'] != '') { $object->addEntry($title['H'] . ' ' . $display['home'], $dial['home']); } if ($display['other'] != '') { $object->addEntry($title['O'] . ' ' . $display['other'], $dial['other']); } $object->addSoftkey('1', Aastra_get_label('Dial', $language), 'SoftKey:Dial'); break; case 'Aastra9143i': case 'Aastra51i': case 'Aastra53i': if ($display['work'] != '') { $object->addEntry($title['W'] . ' ' . $display['work'], 'Dial:' . $dial['work'], '', '', $dial['work']); } if ($display['mobile'] != '') { $object->addEntry($title['M'] . ' ' . $display['mobile'], 'Dial:' . $dial['mobile'], '', '', $dial['mobile']); } if ($display['home'] != '') { $object->addEntry($title['H'] . ' ' . $display['home'], 'Dial:' . $dial['home'], '', '', $dial['home']); } if ($display['other'] != '') { $object->addEntry($title['O'] . ' ' . $display['other'], 'Dial:' . $dial['other'], '', '', $dial['other']);
$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) { $object->addSoftkey('4', Aastra_get_label('Submit', $language), $XML_SERVER . '&action=dsubmit&msg=' . $msg); } if ($dpage != $last) { $object->addSoftkey('5', Aastra_get_label('Next', $language), $XML_SERVER . '&action=forward2&msg=' . $msg . '&dpage=' . ($dpage + 1)); } $object->addSoftkey('6', Aastra_get_label('Cancel', $language), $XML_SERVER . '&action=detail&msg=' . $msg); } else { # Display error message require_once 'AastraIPPhoneTextScreen.class.php'; $object = new AastraIPPhoneTextScreen();
$display_type = Aastra_get_label('System', $language); } $object->addEntry(array($label, '(' . $display_type . ')', 0, ' '), '&action=menu&selection=' . $search . $i, $search . $i, $icon); } break; } } } # Reset menu item base $object->resetBase(); # Softkeys if ($nb_softkeys) { if ($nb_softkeys == 6) { if ($set == '1') { # First page of menu $object->addSoftkey('1', Aastra_get_label('Select', $language), 'SoftKey:Select'); $object->addSoftkey('2', Aastra_get_label('Move Up', $language), $XML_SERVER . '&action=up&type=' . $type . '&set=' . $set); $object->addSoftkey('3', Aastra_get_label('Remove', $language), $XML_SERVER . '&action=delete&type=' . $type . '&set=' . $set); if ($otherkeys) { $object->addSoftkey('4', Aastra_get_label('Other Keys', $language), $XML_SERVER . '&action=select&type=' . $type . '&set=' . $set); } $object->addSoftkey('5', Aastra_get_label('Move Down', $language), $XML_SERVER . '&action=down&type=' . $type . '&set=' . $set); if ($last != 1) { $object->addSoftkey('6', Aastra_get_label('More', $language), $XML_SERVER . '&set=2&type=' . $type . '&page=' . $page); } else { $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit'); } } else { # Second Page of menu $object->addSoftkey('1', Aastra_get_label('Select', $language), 'SoftKey:Select'); if ($page != 1) {