Commit 039df6a6 authored by Mathieu Lutfy's avatar Mathieu Lutfy Committed by Aegir user

#91 civicrm_org_providers: make it possible to view...

#91 civicrm_org_providers: make it possible to view other users (for admins).
parent 9f798484
...@@ -126,12 +126,24 @@ function civicrm_org_providers_block_info() { ...@@ -126,12 +126,24 @@ function civicrm_org_providers_block_info() {
function civicrm_org_providers_block_view($block_name) { function civicrm_org_providers_block_view($block_name) {
switch($block_name) { switch($block_name) {
case 'update_links': case 'update_links':
civicrm_initialize(); civicrm_initialize();
$session = CRM_Core_Session::singleton(); $session = CRM_Core_Session::singleton();
$myContactID = $session->get('userID'); $myContactID = $session->get('userID');
$validStatuses = array("1","2","3","5"); $validStatuses = array("1","2","3","5");
// Make it possible to view other users (useful for admins).
if (arg(0) == 'user' && arg(1)) {
// $myContactID = arg(1);
$result = civicrm_api3('UFMatch', 'get', [
'uf_id' => arg(1),
'sequential' => 1,
]);
if (!empty($result['values'])) {
$myContactID = $result['values'][0]['contact_id'];
}
}
$result = civicrm_api3('Relationship', 'get', [ $result = civicrm_api3('Relationship', 'get', [
'sequential' => 1, 'sequential' => 1,
'is_permission_a_b' => 1, 'is_permission_a_b' => 1,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment