modules/Forecasts/ForecastUtils.php
Functions
add_downline(
Object $user, object $parent_node
)
:
void
Parameters
Details
Name | Type | Description |
---|---|---|
$user | Object | user: object of type Forecasts/Common representing the user downline nodes will be created for. |
$parent_node | object | parent_node: object of type Node, codes created in this function will have this parent. |
- Version
- since 4.5
buildExportLink(
\echo $forecast_type
)
:
string
Display the export link
Parameters
Returns
Name | Type | Description |
---|---|---|
$forecast_type | \echo | Bool set true if you want it echo'd, set false to have contents returned |
Type | Description |
---|---|
string | export link html |
create_node(
string $user_id, string $href
=
true, boolean $dynamic
=
true, boolean $force_direct
=
false, boolean $top_level
=
false, boolean $commit
=
false
)
:
void
create a new node for the tree widget
Parameters
Name | Type | Description |
---|---|---|
$user_id | string | user_id, primary key value of a valid sugar user. |
$href | string | href script for the node. |
$dynamic | boolean | dynamic: allow dynamic loading of child node, defult is true |
$force_direct | boolean | force_direct: force direct forecast for the node default false. |
$top_level | boolean | top_level: is this the top level node, if yes add forecast type of node label, default false |
$commit | boolean | commit: commit of forecast is allowed from this node. |
get_chart_for_user(
$user
=
null, $user_id
=
null, $forecast_type
=
'Direct'
)
:
void
Generate chart for current user's forecast history
Parameters
Name | Type | Description |
---|---|---|
$user | ||
$user_id | ||
$forecast_type |
get_worksheet_defintion(
$user_id, $forecast_type, $timeperiod_id, $allow_commit
=
false
)
:
void
Parameters
Name | Type | Description |
---|---|---|
$user_id | ||
$forecast_type | ||
$timeperiod_id | ||
$allow_commit |
processnavigation(
$url_string, $json
=
null
)
:
void
Parameters
Name | Type | Description |
---|---|---|
$url_string | ||
$json |
upsert_worksheet_record(
$owner_id, $timeperiod_id, $forecast_type, $wk_related_id, $related_forecast_type, $best_case, $likely_case, $worst_case, $convert_to_basecurrency
=
true
)
:
void
Parameters
Name | Type | Description |
---|---|---|
$owner_id | ||
$timeperiod_id | ||
$forecast_type | ||
$wk_related_id | ||
$related_forecast_type | ||
$best_case | ||
$likely_case | ||
$worst_case | ||
$convert_to_basecurrency |