Ejemplo n.º 1
0
        $flash_next = $XML_SERVER . '&action=detail&msg=' . $msg;
        $flash_text = Aastra_get_label('Message forwarded.', $language);
        break;
}
# Post-process action
switch ($action) {
    # Error message
    case 'error':
        # New text screen
        require_once 'AastraIPPhoneTextScreen.class.php';
        $object = new AastraIPPhoneTextScreen();
        $object->setDestroyOnExit();
        $object->setTitle($err_title);
        $object->setText($err_text);
        if ($err_key[2] != 'SoftKey:Exit') {
            $object->setDoneAction($err_key[2]);
        }
        break;
        # Flash message
    # Flash message
    case 'flash':
        # New formatted text screen
        require_once 'AastraIPPhoneFormattedTextScreen.class.php';
        $object = new AastraIPPhoneFormattedTextScreen();
        $object->setDestroyOnExit();
        $size = Aastra_size_display_line();
        if (strlen($flash_text) > $size) {
            $temp = wordwrap($flash_text, $size, "\n", True);
            $lines = explode("\n", $temp);
        } else {
            $lines[0] = $flash_text;
Ejemplo n.º 2
0
                    $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));
                }
            }
        } else {
            # Display error
            require_once 'AastraIPPhoneTextScreen.class.php';
            $object = new AastraIPPhoneTextScreen();
            $object->setDestroyOnExit();
            if ($lookup == '') {
                $object->setTitle(Aastra_get_label('Directory error', $language));
                $object->setText(Aastra_get_label('Directory list is empty. Please contact your administrator.', $language));
            } else {
                $object->setTitle(Aastra_get_label('Lookup error', $language));
                $object->setText(Aastra_get_label('Sorry no match.', $language));
            }
            # Softkey
            if ($lookup != '') {
                $object->setDoneAction($XML_SERVER . '&action=search&lookup=' . $lookup);
            }
        }
        break;
}
# Output XML object
$object->output();
exit;
Ejemplo n.º 3
0
     $object = new AastraIPPhoneTextScreen();
     $object->setDestroyOnExit();
     if (Aastra_is_lockin_supported()) {
         $object->setLockIn();
     }
     $object->setTitle(Aastra_get_label('Authentication failed', $language));
     $object->setText(Aastra_get_label('Wrong credentials.', $language));
     if ($nb_softkeys) {
         if ($nb_softkeys == 6) {
             $object->addSoftkey('6', Aastra_get_label('Close', $language), $XML_SERVER . '&action=input&step=1&extension=' . $extension);
         } else {
             $object->addSoftkey('10', Aastra_get_label('Close', $language), $XML_SERVER . '&action=input&step=1&extension=' . $extension);
         }
     } else {
         if ($is_doneAction) {
             $object->setDoneAction($XML_SERVER . '&action=input&step=1&extension=' . $extension);
         }
     }
     $continue = False;
 }
 # Test MAC address
 if ($continue) {
     # Read config file
     $ext_array = Aastra_read_HDconfig_file(AASTRA_PATH_CACHE . 'startup_asterisk.cfg');
     # Test MAC address
     if (isset($ext_array[$extension]['mac'])) {
         if ($ext_array[$extension]['mac'] == $header['mac']) {
             # Should not happen so let's clean up
             Aastra_update_HDconfig_file(AASTRA_PATH_CACHE . 'startup_asterisk.cfg', $extension, NULL);
             Aastra_delete_mac($header['mac']);
         }
Ejemplo n.º 4
0
     # DoneAction
     $object->setDoneAction($XML_SERVER . '&action=zoom&page=' . $page . '&selection=' . $selection);
     break;
     # Unnotify
 # Unnotify
 case 'unnotify':
     # Add the user to the list
     Aastra_manage_presence_Asterisk($selection, 'unset', 'notify', $user);
     # Display text
     require_once 'AastraIPPhoneTextScreen.class.php';
     $object = new AastraIPPhoneTextScreen();
     $object->setDestroyOnExit();
     $object->setTitle(Aastra_get_label('Notification Cancelled', $language));
     $object->setText(sprintf(Aastra_get_label('You will NOT ANYMORE be notified when %s returns.', $language), Aastra_get_callerid_Asterisk($selection)));
     # DoneAction
     $object->setDoneAction($XML_SERVER . '&action=zoom&page=' . $page . '&selection=' . $selection);
     break;
     # Display directory
 # Display directory
 case 'list':
     # Get list of users
     $directory = Aastra_get_user_directory_Asterisk();
     # Remove current user
     unset($directory[Aastra_get_userdevice_Asterisk($user)]);
     # Sort Directory by name
     Aastra_natsort2d($directory, 'name');
     # Number of records
     $index = count($directory);
     # At least one record
     if ($index > 0) {
         # Retrieve last page
Ejemplo n.º 5
0
                $softkey = 1;
                for ($y = 0; $y < $nb_rss; $y++) {
                    if ($y >= ($set - 1) * 4 and $y < $set * 4) {
                        $object->addSoftkey($softkey, $Title[$y], $XML_SERVER . '&index=' . ($y + 1) . '&rank=1' . '&set=' . $set);
                        $softkey++;
                    }
                }
                if ($last_set != 1) {
                    if ($set != $last_set) {
                        $object->addSoftkey('5', Aastra_get_label('More...', $language), $XML_SERVER . '&index=' . ($index + 1) . '&rank=' . ($rank + 1) . '&set=' . ($set + 1));
                    } else {
                        $object->addSoftkey('5', Aastra_get_label('More...', $language), $XML_SERVER . '&index=' . ($index + 1) . '&rank=' . ($rank + 1) . '&set=1');
                    }
                }
                if ($rank != 0) {
                    $object->addSoftkey('8', Aastra_get_label('Previous', $language), $XML_SERVER . '&index=' . ($index + 1) . '&rank=' . $rank . '&set=' . $set);
                }
                if ($rank != count($array_rss) - 1) {
                    $object->addSoftkey('9', Aastra_get_label('Next', $language), $XML_SERVER . '&index=' . ($index + 1) . '&rank=' . ($rank + 2) . '&set=' . $set);
                }
                $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
                $object->setCancelAction($back);
            }
        } else {
            $object->setDoneAction($back);
        }
    }
    # Display output
    $object->output();
    exit;
}
Ejemplo n.º 6
0
 if ($input1 == '' or $input2 == '' and $input3 == '' and $input4 == '' and $input5 == '') {
     # Display error
     require_once 'AastraIPPhoneTextScreen.class.php';
     $object = new AastraIPPhoneTextScreen();
     $object->setTitle(Aastra_get_label('User error', $language));
     $object->setText(Aastra_get_label('The name and at least one phone number are mandatory fields.', $language));
     if ($nb_softkeys) {
         if ($nb_softkeys == 6) {
             $object->addSoftkey('5', Aastra_get_label('Cancel', $language), $XML_SERVER . '&selection=' . $selection);
             $object->addSoftkey('6', Aastra_get_label('Close', $language), $XML_SERVER . '&action=edit&selection=' . $selection . '&input1=' . $input1 . '&input2=' . $input2 . '&input3=' . $input3 . '&input4=' . $input4 . '&input5=' . $input5);
         } else {
             $object->addSoftkey('9', Aastra_get_label('Cancel', $language), $XML_SERVER . '&selection=' . $selection);
             $object->addSoftkey('10', Aastra_get_label('Close', $language), $XML_SERVER . '&action=edit&selection=' . $selection . '&input1=' . $input1 . '&input2=' . $input2 . '&input3=' . $input3 . '&input4=' . $input4 . '&input5=' . $input5);
         }
     } else {
         $object->setDoneAction($XML_SERVER . '&action=edit&selection=' . $selection);
     }
 } else {
     # Update user data
     $data[$selection]['name'] = $input1;
     $data[$selection]['work'] = $input2;
     $data[$selection]['mobile'] = $input3;
     $data[$selection]['home'] = $input4;
     $data[$selection]['other'] = $input5;
     if ($asterisk) {
         $data = Aastra_save_user_context(Aastra_get_userdevice_Asterisk($user), 'speed', $data);
     } else {
         Aastra_save_user_context($user, 'speed', $data);
     }
     # Back to the list
     require_once 'AastraIPPhoneExecute.class.php';