Skip to content

Commit

Permalink
Added a lot of other fields, like home, zip, city etc.
Browse files Browse the repository at this point in the history
Improved Innovaphone DECT handling
  • Loading branch information
a-schild committed Mar 20, 2018
1 parent 984f1cc commit e9231bb
Show file tree
Hide file tree
Showing 10 changed files with 416 additions and 206 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ There are two components at the moment:
Added text search in gigaset environments
- v1.7 Added better support for Innovaphone DECT handsets
- v1.8 Better umlaut handling (utf8)
- v2.0 Added a lot of other fields, like home, zip, city etc.
Improved Innovaphone DECT handling

(C) Aarboard AG, www.aarboard.ch, 2018

Expand Down
Binary file modified documentation/inno-pbx-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions documentation/install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ On the PBX you have to configure the external LDAP service like this:
- Username & Password
- Search base dc=company,dc=ch
- Mode basic
Name Attributes cn
Number Attributes telephoneNumber,mobileNumber
Detail Attributes cn,mail,company,person,mail
Name Attributes company,givenName,sn
Number Attributes telephoneNumber,mobile,homePhone
Detail Attributes mail,postalAddress,postalCode,l,countryCode

You can also use the quick dial functionality
For this upload the excel with the speeddial entries filled in
Expand Down
12 changes: 12 additions & 0 deletions documentation/upgrade.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
This new version adds support for speel dial functionality

Upgrade from 1.x to 2.0 version:
- Please export your data in a excel file and then recreate the database
with the phonebook.sql script
Then change the exported data to match the new column layout
and import them back
- Remove the old script.php file, it's no longer used (Used index.php instead)
- Make sure to replace all ldap attributes in all ldap settings your have,
with exception of the quick dial entries
Name Attributes: company,givenName,sn
Number Attributes: telephoneNumber,mobile,homePhone
Detail Attributes: mail,postalAddress,postalCode,l,countryCode

Upgrade from 1.7 to 1.8 version:
- Make sure your MySQL database is using utf8mb4 encoding otherwise you will see encoding problems
You might first export the data to excel, recreate the database and import the excel file again
Expand Down
330 changes: 255 additions & 75 deletions ldap-server/InnoLdapServer.pm

Large diffs are not rendered by default.

55 changes: 32 additions & 23 deletions ldap-server/db/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,48 @@

// Prüfen ob die Verbindung zur Datenbank steht
if ($conn->connect_error) {
die("Verbindung fehlgeschlagen: " . $conn->connect_error);
die("DB connection failed: " . $conn->connect_error);
}
$conn->set_charset('utf8');

/** Create a new PHPExcel Object **/
$objPHPExcel = new PHPExcel();
$objPHPExcel->getActiveSheet()->setTitle('Entreprise');
$objPHPExcel->getActiveSheet()->setTitle('Phonebook');

$objPHPExcel->getActiveSheet()->setCellValue('A1', 'Etat');
$objPHPExcel->getActiveSheet()->setCellValue('B1', 'Entreprise');
$objPHPExcel->getActiveSheet()->setCellValue('C1', 'Personne');
$objPHPExcel->getActiveSheet()->setCellValue('D1', 'Fonction');
$objPHPExcel->getActiveSheet()->setCellValue('E1', 'Tel');
$objPHPExcel->getActiveSheet()->setCellValue('F1', 'KurzwahlTel');
$objPHPExcel->getActiveSheet()->setCellValue('G1', 'Mobile');
$objPHPExcel->getActiveSheet()->setCellValue('H1', 'KurzwahlMobile');
$objPHPExcel->getActiveSheet()->setCellValue('I1', 'Fax');
$objPHPExcel->getActiveSheet()->setCellValue('J1', 'E-Mail');
$objPHPExcel->getActiveSheet()->setCellValue('K1', 'Adresse');
$objPHPExcel->getActiveSheet()->setCellValue('L1', 'Ville');
$objPHPExcel->getActiveSheet()->setCellValue('M1', 'Case Postale');
$objPHPExcel->getActiveSheet()->setCellValue('N1', 'Pays');
$objPHPExcel->getActiveSheet()->setCellValue('A1', 'Company');
$objPHPExcel->getActiveSheet()->setCellValue('B1', 'First name');
$objPHPExcel->getActiveSheet()->setCellValue('C1', 'Last name');
$objPHPExcel->getActiveSheet()->setCellValue('D1', 'Address');
$objPHPExcel->getActiveSheet()->setCellValue('E1', 'Zip');
$objPHPExcel->getActiveSheet()->setCellValue('F1', 'City');
$objPHPExcel->getActiveSheet()->setCellValue('G1', 'Country');
$objPHPExcel->getActiveSheet()->setCellValue('H1', 'Phone');
$objPHPExcel->getActiveSheet()->setCellValue('I1', 'KW phone');
$objPHPExcel->getActiveSheet()->setCellValue('J1', 'Mobile');
$objPHPExcel->getActiveSheet()->setCellValue('K1', 'KW mobile');
$objPHPExcel->getActiveSheet()->setCellValue('L1', 'Home');
$objPHPExcel->getActiveSheet()->setCellValue('M1', 'KW Home');
$objPHPExcel->getActiveSheet()->setCellValue('N1', 'Fax');
$objPHPExcel->getActiveSheet()->setCellValue('O1', 'E-Mail');
$myRow= 1;
$res = $conn->query("select * from address ");
while ($row = $res->fetch_assoc()) {
$myRow+= 1;
$objPHPExcel->getActiveSheet()->setCellValue('B'.$myRow, $row['company']);
$objPHPExcel->getActiveSheet()->setCellValue('C'.$myRow, $row['person']);
$objPHPExcel->getActiveSheet()->setCellValue('E'.$myRow, $row['phone']);
$objPHPExcel->getActiveSheet()->setCellValue('F'.$myRow, $row['speeddial_phone']);
$objPHPExcel->getActiveSheet()->setCellValue('G'.$myRow, $row['mobil']);
$objPHPExcel->getActiveSheet()->setCellValue('H'.$myRow, $row['speeddial_mobile']);
$objPHPExcel->getActiveSheet()->setCellValue('J'.$myRow, $row['email']);
$objPHPExcel->getActiveSheet()->setCellValue('A'.$myRow, $row['company']);
$objPHPExcel->getActiveSheet()->setCellValue('B'.$myRow, $row['firstname']);
$objPHPExcel->getActiveSheet()->setCellValue('C'.$myRow, $row['lastname']);
$objPHPExcel->getActiveSheet()->setCellValue('D'.$myRow, $row['address']);
$objPHPExcel->getActiveSheet()->setCellValue('E'.$myRow, $row['zip']);
$objPHPExcel->getActiveSheet()->setCellValue('F'.$myRow, $row['city']);
$objPHPExcel->getActiveSheet()->setCellValue('G'.$myRow, $row['country']);
$objPHPExcel->getActiveSheet()->setCellValue('H'.$myRow, $row['phone']);
$objPHPExcel->getActiveSheet()->setCellValue('I'.$myRow, $row['speeddial_phone']);
$objPHPExcel->getActiveSheet()->setCellValue('J'.$myRow, $row['mobile']);
$objPHPExcel->getActiveSheet()->setCellValue('K'.$myRow, $row['speeddial_mobile']);
$objPHPExcel->getActiveSheet()->setCellValue('L'.$myRow, $row['home']);
$objPHPExcel->getActiveSheet()->setCellValue('M'.$myRow, $row['speeddial_home']);
$objPHPExcel->getActiveSheet()->setCellValue('N'.$myRow, $row['fax']);
$objPHPExcel->getActiveSheet()->setCellValue('O'.$myRow, $row['email']);
}

$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
Expand Down
Loading

0 comments on commit e9231bb

Please sign in to comment.