1. HDcms
  2. General
  3. Friday, September 28 2018, 04:40 PM
Hello,

Tab with custom fields easy profile
case1
case2
....

How is it possible to update the values ​​of another table (other component) from the backup of a tab that has ~ 40 checkboxes

XYZ table with same field value:
ch1 = case1,
ch2 = case2

Regards
admin Accepted Answer
Admin
Hi,
sorry for late reply, it's a weekedn :D

This seems possible but I does not know how the other component save informations.

Anyway to make this you can build a simple plugin, follow these steps:
- Download, Install and Enable Skeleton Plugin (you will find it at http://docs.easy-profile.com/index.php/article/triggers)
- Open file /plugins/jsn/skeleton/skeleton.php
- remove samples functions: triggerFieldAvatarUpdate, triggerProfileUpdate
- add function like this:
public function triggerProfileUpdate($user,&$data,$changed,$isNew){ 
$alias_of_checkbox = 'HERE_THE_ALIAS';
$values = (array) json_decode($data[$alias_of_checkbox]);
// the $values var will contain a PHP array with values of the checkbox:
$db = JFactory::getDbo();
foreach($values as $value) {
// Query for each value
$query = '....';
$db->setQuery($query)->execute();
}
}
This code will be triggered when user update own profile.

NOTE: This code is not tested and not supported, this is only for example purpose. You need to have a minimum of PHP knowledges
  1. more than a month ago
  2. General
  3. # 1
HDcms Accepted Answer
Hello
Thank you. I look at this. How much would it cost if you did it?
Regards
  1. more than a month ago
  2. General
  3. # 2
admin Accepted Answer
Admin
Hi,
normally we does not do custom works, anyway this seems something of simple, so probably we can help you to build your plugin for free ;)
  1. more than a month ago
  2. General
  3. # 3
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.