RSS

LuxCal Forum

The place for questions, suggestions and news about the LuxCal Event Calendar

User:   Password:   Remember Me?   
LuxCal Forum / General / Support / Add more fields.
Posted:  06 Sep 2012 17:49
Hello, I want to add more fields. How I can do? Which files I have to edit?
Posted:  06 Sep 2012 19:52
I assume you want to add fields to the events.
To do this you need . . .
1. to add the required fields to the "event" table in the MySQL database.
2. to retrieve these fields from the database (file: retrieve.php)
3. to add these fields to the Event windows (files: eventform1.php, eventreport.php)
4. to process these fields and save them in the database (event.php)
5. integrate those fields in the views, reports, etc. (all files in the "views" directory and many of the other files)
This will keep you off the streets for a while ;)
Roel
Posted:  20 Sep 2012 10:44
Hi Roel.

Me too interested into this but it seems I'm encountering some problem... Could you specify more about that?

That's my problem... I've added a "customers" table to the db, added a "customer_id" field to the events table.

Inserted that to retrieve.php around line 75 (inside the select statement):          e.customer_id AS cuid,     
Inserted that to retrieve.php just at the end of the select statement:        cu.surname AS cusn

Added that near the other INNER JOIN statements:    INNER JOIN [db]customers cu ON cu.customer_id = e.customer_id

Added a input into eventform1.php with value <?php echo $cusn; ?> (that is for CustomerSurName)


I was thinking that could be all to see the field populated with the customer surname in the event window but it seems is not so...

Please could you give me some hint?


Thanks a lot,
Dzeta.
Posted:  22 Sep 2012 19:19
Hi Dzeta,

It's not so easy to see what's wrong from your above post, but in your description you forgot to copy the selected fields to the $evt array (this is the array with all retrieved event data):

Insert in retrieve.php around line 190:
  $evt['cuid'] = $row['cuid']; (only if you use this field later)
  $evt['cusn'] = stripslashes($row['cusn']);

I assume that you have also "integrated" the $cusn in the file event.php, to check if the input is valid and to store it in the database, etc.

Let me know if this helps.
Roel
Posted:  08 Oct 2012 14:03
Thanks Roel, I worked a bit more on it and now it works.

I would like to do a list of the changes I applied to get it works but that is really difficult at the moment, it's really a very long list...

Till now I managed to show a dropdown list to select the customer ID and a field to add a telephone number in the event add/edit window and save them in the event record and then show both this info into the calendar views.

Just to go a bit off topics: the telephone number will be showed as a custom protocol link (you can choose the protocol into the settings so it can be "skype:<customer_tel_number_here>" or "tel:" or "whaterveryouwant:" ) ... then I messed with windows registry to associate that custom protocol to call a batch file that use the tel number to pass it as a parameter to a call of the executable of my voip softphone... (I use a batch file so I can easily change what executable it calls and the way it pass the parameters without messing around everytime with windows registry...) Ok, that last part is really off topics with the calendar but I am just a bit too much proud about how nice all that has comes out ehehe :-P