Skip to content

Commit

Permalink
#48 finish rights split validation and clean comments & todo
Browse files Browse the repository at this point in the history
  • Loading branch information
BBGuy committed Oct 15, 2014
1 parent 0f59349 commit cc3cd39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions sites/all/modules/custom/kendra_e/kendra_e.module
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function kendra_e_resolve_asset_rights($asset, $start, $end, &$rt_split) {
// ['contributions'][nid]['role']
// ['contributions'][nid]['right_type']
$rights = array();
// Cpllect all the rights information.
// Collect all the rights information.
// This step collects the details from the database. All other functions
// work on the extracted data.
_kendra_e_collect_asset_rights($rights, $asset, $start, $end);
Expand Down Expand Up @@ -248,10 +248,9 @@ function _kendra_e_collect_asset_rights(&$rights, $asset, $start, $end, $right_t
$contribution_a['role'] = $contribution_role->name;
$contribution_a['right_type'] = $contribution_right_type->name;
$contribution_a['nid'] = $contribution->nid;
// @todo - we need to add righ type support.
$points = $combined_target_usage * $usage_weight;
$contribution_a['points'] = $points;
// If an contributions comes from an asset?
// If a contributions comes from an asset.
if ( $contribution->type == 'asset') {
// Set the type.
$contribution_a['type'] = 'asset';
Expand All @@ -271,7 +270,6 @@ function _kendra_e_collect_asset_rights(&$rights, $asset, $start, $end, $right_t
}
}
}

}

/**
Expand Down Expand Up @@ -333,10 +331,11 @@ function _kendra_e_validate_rights_split($contributions, &$rt_split) {
$rt_split[$key] = $value / $temp_total * 100;
}
// Add missing rights as zero %
// todo - Add missing rights as zero %

//$rt_split = array_intersect($rt_split, $used_split);
//print_r($rt_split);
foreach ($used_split as $value) {
if (!isset($rt_split[$value])) {
$rt_split[$value] = 0;
}
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion sites/all/modules/custom/kendra_wf/kendra_wf.module
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ function kendra_wf_get_current_aggregated_rights_table() {


// Put it all together.

// The Title.
$content['title'] = array(
'#prefix' => '<div class="rights-report-title">',
Expand Down

0 comments on commit cc3cd39

Please sign in to comment.