Skip to content

XML-Output with exactly 3 elements per name (for phones with limitations) #6

@shamrockDE

Description

@shamrockDE

Is your feature request related to a problem? Please describe.
As described in issue #3 i am using a Dect-Station m300 from Snom. The xml-phonebook for Snom needs exactly 3 elements: "Telephone", "Mobile" and "Office".

Describe the solution you'd like
It is very easy to implement. In the file "helpers/phoneMiddleware.php" the following code has to be added after line 255:

if (!$usedFields["Telephone"]) {
   $simplified_xml->writeElement('Telephone');
   $usedFields["Telephone"] = true;
}
if (!$usedFields["Mobile"]) {
   $simplified_xml->writeElement('Mobile');
   $usedFields["Mobile"] = true;
}
if (!$usedFields["Other"]) {
   $simplified_xml->writeElement('Office');
   $usedFields["Other"] = true;
}

Describe alternatives you've considered
I changed it in the code directly, and it works ;-)

The output must look like this:

<?xml version="1.0" encoding="UTF-8"?>
<IPPhoneDirectory>
    <DirectoryEntry>
        <Name>John Doe</Name>
        <Telephone>123</Telephone>
        <Office>345</Office>
        <Mobile>123</Mobile>
    </DirectoryEntry>
    <DirectoryEntry>
        <Name>Ray Albert</Name>
        <Telephone>8971</Telephone>
        <Office>1233</Office>
        <Mobile>1233</Mobile>
    </DirectoryEntry>
</IPPhoneDirectory>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions