Beispiel #1
0
     foreach ($messages as $item) {
         if ($msg_id == $item['id'] && $msg_folder == $item['folder']) {
             $page = intval($index / $MaxLines);
             if ($index - $page * $MaxLines != 0) {
                 $page++;
             }
             $object->setDefaultIndex($index - ($page - 1) * $MaxLines);
             break;
         } else {
             $index++;
         }
     }
 }
 $index = 0;
 # Set menu Item base
 $object->setBase($XML_SERVER . '&action=detail');
 # List messages
 foreach ($messages as $item) {
     # Message to be displayed?
     if ($index >= ($page - 1) * $MaxLines && $index < $page * $MaxLines) {
         # Message ID
         $msg = sprintf('%s-%s', $item['id'], $item['folder']);
         # Caller ID
         $cid = Aastra_format_callerid_Asterisk($item['callerid']);
         if ($cid == '') {
             $cid = Aastra_get_label('Unknown', $language);
         }
         # Display on 2 lines with icons
         $date = format_date($item['origtime']);
         $time = format_time($item['origtime']);
         $display = array('0' => $cid, '1' => sprintf('%s %s', $date, $time), '2' => 2, '3' => ' ');
Beispiel #2
0
     foreach ($messages as $item) {
         if ($msg_id == $item['id'] && $msg_folder == $item['folder']) {
             $page = intval($index / $MaxLines);
             if ($index - $page * $MaxLines != 0) {
                 $page++;
             }
             $object->setDefaultIndex($index - ($page - 1) * $MaxLines);
             break;
         } else {
             $index++;
         }
     }
 }
 $index = 0;
 # Set menu Item base
 $object->setBase($XML_SERVER . '&action=play_message&orig_p=list');
 # List messages
 foreach ($messages as $item) {
     # Message to be displayed?
     if ($index >= ($page - 1) * $MaxLines && $index < $page * $MaxLines) {
         # Message ID
         $msg = sprintf('%s-%s', $item['id'], $item['folder']);
         # Caller ID
         $cid = Aastra_format_callerid_Asterisk($item['callerid'], '2');
         $name = $cid['name'];
         $number = $cid['number'];
         if ($name == '') {
             $name = Aastra_get_label('Unknown', $language);
         }
         if ($number == '') {
             $number = Aastra_get_label('Unknown', $language);
 } else {
     $object->setTitle(Aastra_get_label('Results', $language));
 }
 # Default Index
 if ($index == '') {
     $object->setDefaultIndex('2');
 }
 # Previous page for non softkey phones
 if (!$nb_softkeys and $page != 1) {
     $object->addEntry('Previous Page', $XML_SERVER . '&page=' . ($page - 1) . '&action=browse');
 }
 # Display items
 $count = 0;
 $rank = 1;
 $first = 0;
 $object->setBase($XML_SERVER);
 foreach ($directory2 as $key => $value) {
     if ($count >= ($page - 1) * $MaxLines and $count < $page * $MaxLines) {
         $display = substr($key, 0, $chars_supported - 3);
         $display = str_pad($display, $chars_supported, '-', STR_PAD_BOTH);
         $object->addEntry($display, '&action=nothing');
         if ($first == 0) {
             $first = 1;
         }
         $rank++;
     }
     $count++;
     foreach ($value as $value2) {
         if ($count >= ($page - 1) * $MaxLines and $count < $page * $MaxLines) {
             if ($first == 0) {
                 $display = substr($key, 0, $chars_supported - 3);
Beispiel #4
0
         $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) {
         # Format key number
         if ($nb_keys > 9) {
             $key = sprintf('%02s', $array_key[$search . $i]['key']);
         } else {
             $key = $array_key[$search . $i]['key'];
         }
         # Check "locked" state
         if ($array_key[$search . $i]['locked'] == '1') {
             $locked = True;