service/v4/SugarWebServiceUtilv4.php
\SugarWebServiceUtilv4
- Parent(s)
- \SugarWebServiceUtilv3_1 < \SugarWebServiceUtilv3 < \SoapHelperWebServices
- Children
- \SugarWebServiceUtilv4_1
Methods


addFieldLevelACLs(
String $module_name, String $view_type, String $view, array $metadata
)
:
\unknown
Add ACL values to metadata files.
Inherited from: \SugarWebServiceUtilv3_1::addFieldLevelACLs()Name | Type | Description |
---|---|---|
$module_name | String | |
$view_type | String | (wireless or detail) |
$view | String | (list, detail,edit, etc) |
$metadata | array | The metadata for the view type and view. |
Type | Description |
---|---|
\unknown |


add_create_account(
$seed
)
:
void
Name | Type | Description |
---|---|---|
$seed |


array_get_name_value_list(
$array
)
:
void
Name | Type | Description |
---|---|---|
$array |


array_get_name_value_lists(
$array
)
:
void
Name | Type | Description |
---|---|---|
$array |


array_get_return_value(
$array, $module
)
:
void
Name | Type | Description |
---|---|---|
$array | ||
$module |


checkACLAccess(
$bean, $viewType, $errorObject, $error_key
)
:
void
Name | Type | Description |
---|---|---|
$bean | ||
$viewType | ||
$errorObject | ||
$error_key |


checkModuleRoleAccess(
string $module
)
:
array
Check a module for acces to a set of available actions.
Inherited from: \SugarWebServiceUtilv3_1::checkModuleRoleAccess()Name | Type | Description |
---|---|---|
$module | string |
Type | Description |
---|---|
array | results containing access and boolean indicating access |


checkQuery(
$errorObject, $query, $order_by
=
''
)
:
void
Name | Type | Description |
---|---|---|
$errorObject | ||
$query | ||
$order_by |


checkSessionAndModuleAccess(
$session, $login_error_key, $module_name, $access_level, $module_access_level_error_key, $errorObject
)
:
void
Name | Type | Description |
---|---|---|
$session | ||
$login_error_key | ||
$module_name | ||
$access_level | ||
$module_access_level_error_key | ||
$errorObject |


check_for_duplicate_contacts(
$seed
)
:
void
Name | Type | Description |
---|---|---|
$seed |


check_modules_access(
$user, $module_name, $action
=
'write'
)
:
void
Name | Type | Description |
---|---|---|
$user | ||
$module_name | ||
$action |


cmp_datedue(
array $a, array $b
)
:
int
Sort the array for upcoming activities based on the date due flag ascending.
Inherited from: \SugarWebServiceUtilv3::cmp_datedue()\SugarWebServiceUtilv3_1::cmp_datedue()Name | Type | Description |
---|---|---|
$a | array | |
$b | array |
Type | Description |
---|---|
int | Indicates equality for date due flag |


decrypt_string(
\$string $string
)
:
\a
decrypt a string use the TripleDES algorithm. This meant to be modified if the end user chooses a different algorithm
Inherited from: \SoapHelperWebServices::decrypt_string()\SugarWebServiceUtilv3::decrypt_string()\SugarWebServiceUtilv3_1::decrypt_string()Name | Type | Description |
---|---|---|
$string | \$string |
|
Type | Description |
---|---|
\a | decrypted string if we can decrypt, the original string otherwise |


filter_fields(
$value, $fields
)
:
void
Name | Type | Description |
---|---|---|
$value | ||
$fields |


filter_fields_for_query(
object $value, array $fields
)
:
array
Processes the filter_fields attribute to use with SugarBean::create_new_list_query()
Name | Type | Description |
---|---|---|
$value | object | SugarBean |
$fields | array |
Type | Description |
---|---|
array |


formatWirelessListViewResultsToArray(
array $fields
)
:
array
Format the results for wirless list view metadata from an associative array to a numerically indexed array. This conversion will ensure that consumers of the metadata can eval the json response and iterative over the results with the order of the fields preserved.
Name | Type | Description |
---|---|---|
$fields | array |
Type | Description |
---|---|
array |


format_upcoming_activities_entries(
array $list, string $date_field
)
:
array
Given a list of bean entries, format the expected response.
Inherited from: \SugarWebServiceUtilv3::format_upcoming_activities_entries()\SugarWebServiceUtilv3_1::format_upcoming_activities_entries()Name | Type | Description |
---|---|---|
$list | array | An array containing a bean list. |
$date_field | string | Name of the field storing the date field we are examining |
Type | Description |
---|---|
array | The results. |


generateUnifiedSearchFields(
string $moduleName
)
:
array
Generate unifed search fields for a particular module even if the module does not participate in the unified search.
Inherited from: \SugarWebServiceUtilv3_1::generateUnifiedSearchFields()Name | Type | Description |
---|---|---|
$moduleName | string |
Type | Description |
---|---|
array | An array of fields to be searched against. |


generateUpcomingActivitiesWhereClause(
$seed, $meta
)
:
void
Name | Type | Description |
---|---|---|
$seed | ||
$meta |


getFieldLevelACLValue(
String $module, String $field, $current_user
=
null
)
:
int
Return the field level acl raw value. We cannot use the hasAccess call as we do not have a valid bean record at the moment and therefore can not specify the is_owner flag. We need the raw access value so we can do the computation on the client side. TODO: Move function into ACLField class.
Inherited from: \SugarWebServiceUtilv3_1::getFieldLevelACLValue()Name | Type | Description |
---|---|---|
$module | String | Name of the module |
$field | String | Name of the field |
$current_user |
Type | Description |
---|---|
int |


getModulesFromList(
array $list, array $availModules
)
:
void
Convert modules list to Web services result
Name | Type | Description |
---|---|---|
$list | array | List of module candidates (only keys are used) |
$availModules | array | List of module availability from Session |


getRelationshipResults(
String $bean, String $link_field_name, Array $link_module_fields, String $optional_where
=
'', $order_by
=
''
)
:
Array
Fetch and array of related records
Inherited from: \SugarWebServiceUtilv3::getRelationshipResults()\SugarWebServiceUtilv3_1::getRelationshipResults()Name | Type | Description |
---|---|---|
$bean | String | -- Primary record |
$link_field_name | String | -- The name of the relationship |
$link_module_fields | Array | -- The keys of the array are the SugarBean attributes, the values of the array are the values the attributes should have. |
$optional_where | String | -- IGNORED |
$order_by |
Type | Description |
---|---|
Array | 'rows/fields_set_on_rows' -- The list of records and what fields were actually set for thos erecords |


get_data_list(
$seed, $order_by
=
"", $where
=
"", $row_offset
=
0, $limit
=
-1, $max
=
-1, $show_deleted
=
0, $favorites
=
false
)
:
void
Equivalent of get_list function within SugarBean but allows the possibility to pass in an indicator if the list should filter for favorites. Should eventually update the SugarBean function as well.
Name | Type | Description |
---|---|---|
$seed | ||
$order_by | ||
$where | ||
$row_offset | ||
$limit | ||
$max | ||
$show_deleted | ||
$favorites |


get_field_list(
$value, $fields, $translate
=
true
)
:
void
Name | Type | Description |
---|---|---|
$value | ||
$fields | ||
$translate |


get_file_contents_base64(
string $filename, bool $remove
=
FALSE
)
:
string
Return the contents of a file base64 encoded
Inherited from: \SugarWebServiceUtilv3_1::get_file_contents_base64()Name | Type | Description |
---|---|---|
$filename | string |
|
$remove | bool |
|
Type | Description |
---|---|
string | - Contents base64'd. |


get_module_view_defs(
$moduleName, $type, $view
)
:
void
Name | Type | Description |
---|---|---|
$moduleName | ||
$type | ||
$view |


get_name_value(
$field, $value
)
:
void
Name | Type | Description |
---|---|---|
$field | ||
$value |


get_name_value_list(
$value
)
:
void
Name | Type | Description |
---|---|---|
$value |


get_name_value_list_for_fields(
$value, $fields
)
:
void
Name | Type | Description |
---|---|---|
$value | ||
$fields |


get_return_module_fields(
$value, $module, $fields, $translate
=
true
)
:
void
Name | Type | Description |
---|---|---|
$value | ||
$module | ||
$fields | ||
$translate |


get_return_value(
$value, $module
)
:
void
Name | Type | Description |
---|---|---|
$value | ||
$module |


get_return_value_for_fields(
$value, $module, $fields
)
:
void
Name | Type | Description |
---|---|---|
$value | ||
$module | ||
$fields |


get_return_value_for_link_fields(
$bean, $module, $link_name_to_value_fields_array
)
:
void
Name | Type | Description |
---|---|---|
$bean | ||
$module | ||
$link_name_to_value_fields_array |


get_subpanel_defs(
String $module, String $type
)
:
array
get_subpanel_defs
Name | Type | Description |
---|---|---|
$module | String | The name of the module to get the subpanel definition for |
$type | String | The type of subpanel definition ('wireless' or 'default') |
Type | Description |
---|---|
array | Array of the subpanel definition; empty array if no matching definition found |


get_upcoming_activities(
)
:
array
Retrieve all of the upcoming activities for a particular user.
Inherited from: \SugarWebServiceUtilv3::get_upcoming_activities()\SugarWebServiceUtilv3_1::get_upcoming_activities()Type | Description |
---|---|
array |


get_user_module_list(
$user
)
:
void
Name | Type | Description |
---|---|---|
$user |


get_visible_mobile_modules(
array $availModules
)
:
array
Examine the wireless_module_registry to determine which modules have been enabled for the mobile view.
Inherited from: \SugarWebServiceUtilv3_1::get_visible_mobile_modules()Name | Type | Description |
---|---|---|
$availModules | array | An array of all the modules the user already has access to. |
Type | Description |
---|---|
array | Modules enalbed for mobile view. |


get_visible_modules(
array $availModules
)
:
array
Examine the application to determine which modules have been enabled..
Inherited from: \SugarWebServiceUtilv3_1::get_visible_modules()Name | Type | Description |
---|---|---|
$availModules | array | An array of all the modules the user already has access to. |
Type | Description |
---|---|
array | Modules enabled within the application. |


is_favorites_enabled(
string $module_name
)
:
bool
Return a boolean indicating if the bean name is favorites enabled.
Name | Type | Description |
---|---|---|
$module_name | string | The module name |
Type | Description |
---|---|
bool | true indicating bean is favorites enabled |


is_valid_ip_address(
string $session_var
)
:
bool
Use the same logic as in SugarAuthenticate to validate the ip address
Inherited from: \SoapHelperWebServices::is_valid_ip_address()\SugarWebServiceUtilv3::is_valid_ip_address()\SugarWebServiceUtilv3_1::is_valid_ip_address()Name | Type | Description |
---|---|---|
$session_var | string |
Type | Description |
---|---|
bool | - true if the ip address is valid, false otherwise. |


login_success(
$name_value_list
=
array()
)
:
void
Name | Type | Description |
---|---|---|
$name_value_list |


metdataAclParserWirelessDetail(
String $module_name, array $metadata
)
:
array
Parse wireless detailview metadata and add ACL values.
Name | Type | Description |
---|---|---|
$module_name | String | |
$metadata | array |
Type | Description |
---|---|
array | Metadata with acls added |


metdataAclParserWirelessEdit(
String $module_name, array $metadata
)
:
array
Parse wireless editview metadata and add ACL values.
Name | Type | Description |
---|---|---|
$module_name | String | |
$metadata | array |
Type | Description |
---|---|
array | Metadata with acls added |


metdataAclParserWirelessList(
String $module_name, array $metadata
)
:
array
Parse wireless listview metadata and add ACL values.
Name | Type | Description |
---|---|---|
$module_name | String | |
$metadata | array |
Type | Description |
---|---|
array | Metadata with acls added |


name_value_lists_get_array(
$list
)
:
void
Name | Type | Description |
---|---|---|
$list |


new_handle_set_entries(
$module_name, $name_value_lists, $select_fields
=
FALSE
)
:
void
Name | Type | Description |
---|---|---|
$module_name | ||
$name_value_lists | ||
$select_fields |


new_handle_set_relationship(
String $module_name, String $module_id, String $link_field_name, Array $related_ids, Array $name_value_list, int $delete
)
:
true
Name | Type | Description |
---|---|---|
$module_name | String | -- The name of the module that the primary record is from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method). |
$module_id | String | -- The ID of the bean in the specified module |
$link_field_name | String |
|
$related_ids | Array | -- The array of ids for which we want to create relationships |
$name_value_list | Array | -- The array of name value pair of additional attributes to be set when adding this relationship |
$delete | int | delete -- If 0 then add relationship else delete this relationship data |
Type | Description |
---|---|
true | on success, false on failure |


setFaultObject(
$errorObject
)
:
void
Name | Type | Description |
---|---|---|
$errorObject |


trackView(
\SugarBean $seed, string $current_view
)
:
void
Name | Type | Description |
---|---|---|
$seed | \SugarBean | |
$current_view | string |


validate_authenticated(
String $session_id
)
:
truefalse
Validate the provided session information is correct and current. Load the session.
Inherited from: \SoapHelperWebServices::validate_authenticated()\SugarWebServiceUtilv3::validate_authenticated()\SugarWebServiceUtilv3_1::validate_authenticated()Name | Type | Description |
---|---|---|
$session_id | String | -- The session ID that was returned by a call to login. |
Type | Description |
---|---|
truefalse | -- If the session is valid and loaded.-- if the session is not valid. |


validate_user(
string $user_name, string $password
)
:
truefalse
Validate the user session based on user name and password hash.
Inherited from: \SoapHelperWebServices::validate_user()\SugarWebServiceUtilv3::validate_user()\SugarWebServiceUtilv3_1::validate_user()Name | Type | Description |
---|---|---|
$user_name | string | -- The user name to create a session for |
$password | string | -- The MD5 sum of the user's password |
Type | Description |
---|---|
truefalse | -- If the session is created-- If the session is not created |