Merge branch 'pick_profile_by_id'

[#73] Identify profiles by ID
This commit is contained in:
Jens Schuppe 2024-04-05 12:27:06 +02:00
commit aa2c938abe
5 changed files with 200 additions and 89 deletions

View file

@ -22,10 +22,11 @@ class CRM_Twingle_Page_Profiles extends CRM_Core_Page {
public function run():void {
CRM_Utils_System::setTitle(E::ts('Twingle API Profiles'));
$profiles = [];
foreach (CRM_Twingle_Profile::getProfiles() as $profile_name => $profile) {
$profiles[$profile_name]['name'] = $profile_name;
foreach (CRM_Twingle_Profile::getProfiles() as $profile_id => $profile) {
$profiles[$profile_id]['id'] = $profile_id;
$profiles[$profile_id]['name'] = $profile->getName();
foreach (CRM_Twingle_Profile::allowedAttributes() as $attribute) {
$profiles[$profile_name][$attribute] = $profile->getAttribute($attribute);
$profiles[$profile_id][$attribute] = $profile->getAttribute($attribute);
}
}
$this->assign('profiles', $profiles);