Fixed a bug that happened when an Endpoint Manager -> Device Mapping dialog was opened and an extension that is mapped to a phone is removed from Extensions dialog.
Switching back to Device Mapping dialog via the tabs (without re-opening the dialog) will still show that the removed extension is mapped. However pressing the action button “Save” will cause MySQL error and potentially might erase other mapped devices.
In addition, removed an unneeded attribute from an Endpoint Manager table and set a proper reference between extension(device) on a mapped phone to a device table.