Comments (8)
Hi
It's possible but not in the easy way, since the plugin is not ready yet.
All you have to do is modify the script a "little" bit, first you have to make 2 database connection, for kalkun (via MySQL) and the phonebook entries (via ODBC).
You must modify all phonebook activity to use the second connection (ODBC) instead of first connection (MySQL).
PS: Why don't just import all external database to Kalkun via CSV? Or just use Kalkun simple API to send SMS to external database.
from kalkun.
I could import all contacts from the external DB to Kalkun, but I'd have to do that on a scheduled basis (i.e. every 5 minutes) and it would take some time because we are talking about a lot of rows.
Let me explain the situation: We have all customers' data (email, phone, etc.) stored and maintained in another system (CRM-like) and I want Kalkun to access the data in that system every time it reads contacts. That way every change of a customer's data in the CRM system is immediately propagated to Kalkun.
A few questions regarding your post:
-
Where and how do I define a second database (ODBC) connection in Kalkun? Do I add another record into database.php (e.g. $db['default2']...)?
-
What PHP files do I need to modify so Kalkun reads all contacts from the other database? Are all contacts-related SQL scripts in a single PHP file or are they spread in multiple files?
Thanks for your reply!
from kalkun.
Before you starting, is it just "readonly" phonebook or "full access" one? Because you must maintain all phonebook database relationship, currently there are 4 related tables including pbk
, user_group
, pbk_groups
, and user
, see https://github.com/back2arie/Kalkun/wiki/Database-Schema. And you must have exact structure on both database. And frankly, maintaining this relationship and modifying the script is really not easy task.
Please re-calculate the effort implementing this function instead of just copy the phonebook from external database.
from kalkun.
Kalkun will have only read-only access to the phonebook, while the CRM-system will modify it. I'm planning to create views in the phonebook database that will present phone numbers exactly like Kalkun expects (i.e. I'll create a 'pbk' view in the contacts database).
Consequently, anyone trying to edit a contact entry in Kalkun will probably get a database error, which is okay with me, users will know that they should edit contacts in the CRM system and not in Kalkun...
from kalkun.
OK, for starting you need to figure how to join several tables from different database, because you need that for sure.
Next, you need to define the owner of the phonebook, by adding set value of user_id
on pbk
, or maybe you want special condition where all phonebook can readed by all user (which is easier). Basically all phonebook database activity is located on /application/models/phonebook_model.php.
Let me know if you need help.
from kalkun.
I've looked at the phonebook_model.php file and I have one question: How do I execute SQL queries to a different database other than $this->db?
If I add another record into database.php (e.g. $db['external'][...]), how do I access that database instead of the default one in phonebook_model.php? My guess is "$this->db['external']", am I right?
from kalkun.
Hi
You must load the database first:
$this->external = $this->load->database('external', TRUE);
Then, you can access active record class, like this:
$this->external->query();
For more information, see http://codeigniter.com/user_guide/database/connecting.html
from kalkun.
Thanks for the info, my situation has changed a little bit (see #14), I'm closing this issue for now.
from kalkun.
Related Issues (20)
- White page after login even with last dev version HOT 1
- [request] LDAP auth HOT 1
- Kalkun doesnt load on Ubuntu 22.04 HOT 7
- Error on daemon.php with file_get_contents HOT 14
- REST_API - Missing or invalid default region HOT 4
- Phone format check error with 3 comma separated numbers HOT 4
- No available plugins HOT 2
- Not working Delivery report HOT 2
- rest_api plugin HOT 2
- Kalkun_API.php HOT 2
- Translation - norwegian HOT 3
- Possible XSS vulnerability HOT 1
- Blacklist plugin error HOT 4
- Error on the dashboard in "Gammu state" field HOT 2
- send sms from csv file HOT 4
- License issue: `GPL-3-or-later` not compatible with `GPL-2-only` HOT 2
- Distributed environment issue HOT 5
- A Database Error Occurred HOT 3
- Migrate away from CodeIgniter3, update to newer web standards
- Replace ci2 plugin system
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kalkun.