Beispiel #1
0
                            }
                            $object->addSoftkey(1, Aastra_get_label('Pickup', $language), 'SoftKey:Select');
                        }
                    }
                    if ($nb_softkeys) {
                        if ($nb_softkeys == 6) {
                            $object->addSoftkey(4, Aastra_get_label('Refresh', $language), $XML_SERVER . '&action=list');
                            $object->addSoftkey(6, Aastra_get_label('Exit', $language), 'SoftKey:Exit');
                        } else {
                            $object->addSoftkey(6, Aastra_get_label('Refresh', $language), $XML_SERVER . '&action=list');
                            $object->addSoftkey(10, Aastra_get_label('Exit', $language), 'SoftKey:Exit');
                        }
                    }
                } else {
                    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]);
                        }
                    } 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]);
                        }
                    }
                }
            }
        }
        break;
}
# Display object
$object->output();
exit;
 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();
 }
 function output($page = NULL)
 {
     # Test phone firmware / model
     Aastra_test_phone_version('1.4.2.', 0);
     Aastra_test_phone_model(array('Aastra9112i', 'Aastra9133i'), False, 0);
     # Force destroyOnExit
     $this->_destroyOnExit = 'yes';
     # Initial call?
     if (!isset($page)) {
         # Count number of entries in list
         $this->_count = count($this->_list);
         # Setup icons
         $this->_setupIcons();
         # Setup Softkeys
         $this->_setupSoftKeys();
         # Set Cancel URI
         if (!empty($this->_backCancelURL)) {
             parent::setCancelAction($this->_backCancelURL);
         }
         # Do some security / compliancy checks
         # Protect against wrap list bug in FW < R2.4.0
         if (Aastra_test_phone_version('2.4.0.', 1)) {
             $this->_wraplist = 'no';
         }
         if (!Aastra_is_wrap_title_supported()) {
             $this->_wraplist = 'no';
         }
         if (!Aastra_is_textmenu_wrapitem_supported()) {
             $this->_title_wrap = 'no';
         }
         if (!Aastra_is_style_textmenu_supported()) {
             $this->_style = '';
         }
         if (!Aastra_is_lockin_supported()) {
             $this->_lockin = 'no';
         }
         # Save object in user context (context = mac address)
         Aastra_save_user_context($this->_header['mac'], 'scrollableTextMenuData', $this);
     } else {
         # If beep is set, only beep during initial call
         $this->_beep = 'no';
     }
     # Generate the actual items of the menu for the given page
     $this->_generatePage($page);
     parent::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();
        $screen->addLine('');
        $screen->addLine('');
        $screen->addLine('');