Procedural File: SugarSoapUsers.php
Source Location: /SugarSoapUsers.php
Includes
require_once
('soap/SoapTypes.php')
[line 38]
require_once
('modules/Accounts/Account.php')
[line 39]
require_once
('soap/SoapHelperFunctions.php')
[line 37]
******************************************************************************* SugarCRM is a customer relationship management program developed by SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with the addition of the following permission added to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com. The interactive user interfaces in modified source and object code versions of this program must display Appropriate Legal Notices, as required under Section 5 of the GNU General Public License version 3. In accordance with Section 7(b) of the GNU General Public License version 3, these Appropriate Legal Notices must retain the display of the "Powered by SugarCRM" logo. If the display of the logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices must display the words "Powered by SugarCRM". ******************************************************************************
Functions
get_available_modules [line 775]
Array get_available_modules(
String $session
)
|
|
Retrieve the list of available modules on the system available to the currently logged in user.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
API Tags:
| Return: | 'modules' -- An array of module names 'error' -- The SOAP error, if any |
get_document_revision [line 1652]
return_document_revision get_document_revision(
String $session, String $id
)
|
|
This method is used as a result of the .htaccess lock down on the cache directory. It will allow a properly authenticated user to download a document that they have proper rights to download.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
String |
$id: |
-- ID of the document revision to obtain |
API Tags:
| Return: | - this is a complex type as defined in SoapTypes.php |
get_entries [line 343]
Array get_entries(
String $session, String $module_name, Array $ids, Array $select_fields
)
|
|
Retrieve a list of SugarBean's based on provided IDs.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
String |
$module_name: |
-- The name of the module to return records 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).. |
|
Array |
$ids: |
-- An array of SugarBean IDs. |
|
Array |
$select_fields: |
-- A list of the fields to be included in the results. This optional parameter allows for only needed fields to be retrieved. |
API Tags:
| Return: | 'field_list' -- Var def information about the returned fields 'entry_list' -- The records that were retrieved 'error' -- The SOAP error, if any |
get_entries_count [line 1729]
void get_entries_count(
session $session, module_name $module_name, query $query, deleted $deleted
)
|
|
Retrieve number of records in a given module
Parameters:
|
session |
$session: |
the session id of the authenticated user |
|
module_name |
$module_name: |
module to retrieve number of records from |
|
query |
$query: |
allows webservice user to provide a WHERE clause |
|
deleted |
$deleted: |
specify whether or not to include deleted records |
get_entry [line 322]
unknown get_entry(
String $session, String $module_name, String $id, Array $select_fields
)
|
|
Retrieve a single SugarBean based on ID.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
String |
$module_name: |
-- The name of the module to return records 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).. |
|
String |
$id: |
-- The SugarBean's ID value. |
|
Array |
$select_fields: |
-- A list of the fields to be included in the results. This optional parameter allows for only needed fields to be retrieved. |
get_entry_list [line 232]
Array get_entry_list(
String $session, String $module_name, String $query, String $order_by, String $offset, Array $select_fields, String $max_results, Number $deleted
)
|
|
Retrieve a list of beans. This is the primary method for getting list of SugarBeans from Sugar using the SOAP API.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
String |
$module_name: |
-- The name of the module to return records 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).. |
|
String |
$query: |
-- SQL where clause without the word 'where' |
|
String |
$order_by: |
-- SQL order by clause without the phrase 'order by' |
|
String |
$offset: |
-- The record offset to start from. |
|
Array |
$select_fields: |
-- A list of the fields to be included in the results. This optional parameter allows for only needed fields to be retrieved. |
|
String |
$max_results: |
-- The maximum number of records to return. The default is the sugar configuration value for 'list_max_entries_per_page' |
|
Number |
$deleted: |
-- false if deleted records should not be include, true if deleted records should be included. |
API Tags:
| Return: | 'result_count' -- The number of records returned 'next_offset' -- The start of the next page (This will always be the previous offset plus the number of rows returned. It does not indicate if there is additional data unless you calculate that the next_offset happens to be closer than it should be. 'field_list' -- The vardef information on the selected fields. Array -- 'field'=> 'name' -- the name of the field 'type' -- the data type of the field 'label' -- the translation key for the label of the field 'required' -- Is the field required? 'options' -- Possible values for a drop down field 'entry_list' -- The records that were retrieved 'error' -- The SOAP error, if any |
get_gmt_time [line 930]
Return the current time on the server in the format 'Y-m-d H:i:s'. This time is in GMT.
API Tags:
| Return: | -- The current date/time 'Y-m-d H:i:s' |
get_mailmerge_document [line 1379]
unknown get_mailmerge_document(
String $session, unknown_type $file_name, unknown_type $fields
)
|
|
Enter description here...
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
unknown_type |
$file_name: |
|
|
unknown_type |
$fields: |
|
get_mailmerge_document2 [line 1514]
unknown get_mailmerge_document2(
String $session, unknown_type $file_name, unknown_type $fields
)
|
|
Enter description here...
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
unknown_type |
$file_name: |
|
|
unknown_type |
$fields: |
|
get_module_fields [line 731]
Array get_module_fields(
String $session, String $module_name
)
|
|
Retrieve vardef information on the fields of the specified bean.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
String |
$module_name: |
-- The name of the module to return records 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).. |
API Tags:
| Return: | 'module_fields' -- The vardef information on the selected fields. 'error' -- The SOAP error, if any |
get_note_attachment [line 542]
Array get_note_attachment(
String $session, String $id, Binary $note
)
|
|
Retrieve an attachment from a note
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
Binary |
$note: |
-- The flie contents of the attachment. |
|
String |
$id: |
-- The ID of the appropriate Note. |
API Tags:
| Return: | 'id' -- The ID of the new note or -1 on error 'error' -- The SOAP error if any. |
get_related_notes [line 646]
Array get_related_notes(
String $session, String $module_name, String $module_id, Array $select_fields
)
|
|
Retrieve the collection of notes that are related to a bean.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
String |
$module_name: |
-- The name of the module to return records 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).. |
|
String |
$module_id: |
-- The ID of the bean that you want to associate the note with |
|
Array |
$select_fields: |
-- A list of the fields to be included in the results. This optional parameter allows for only needed fields to be retrieved. |
API Tags:
| Return: | 'result_count' -- The number of records returned (-1 on error) 'next_offset' -- The start of the next page (This will always be the previous offset plus the number of rows returned. It does not indicate if there is additional data unless you calculate that the next_offset happens to be closer than it should be. 'field_list' -- The vardef information on the selected fields. 'entry_list' -- The records that were retrieved 'error' -- The SOAP error, if any |
get_relationships [line 996]
unknown get_relationships(
String $session, String $module_name, String $module_id, String $related_module, String $related_module_query, Number $deleted
)
|
|
Retrieve a collection of beans tha are related to the specified bean.
As of 4.5.1c, all combinations of related modules are supported
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
String |
$module_name: |
-- 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).. |
|
String |
$module_id: |
-- The ID of the bean in the specified module |
|
String |
$related_module: |
-- The name of the related module to return records 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).. |
|
String |
$related_module_query: |
-- A portion of the where clause of the SQL statement to find the related items. The SQL query will already be filtered to only include the beans that are related to the specified bean. |
|
Number |
$deleted: |
-- false if deleted records should not be include, true if deleted records should be included. |
get_server_time [line 915]
String get_server_time(
)
|
|
Return the current time on the server in the format 'Y-m-d H:i:s'. This time is in the server's default timezone.
API Tags:
| Return: | -- The current date/time 'Y-m-d H:i:s' |
get_server_version [line 966]
String get_server_version(
)
|
|
Retrieve the version number of Sugar that the server is running.
API Tags:
| Return: | -- The current sugar version number. '1.0' on error. |
get_sugar_flavor [line 947]
String get_sugar_flavor(
)
|
|
Retrieve the specific flavor of sugar.
API Tags:
| Return: | 'CE' -- For Community Edition 'PRO' -- For Professional 'ENT' -- For Enterprise |
get_user_id [line 863]
String get_user_id(
String $session
)
|
|
Return the user_id of the user that is logged into the current session.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
API Tags:
| Return: | -- the User ID of the current session -1 on error. |
get_user_team_id [line 887]
String get_user_team_id(
String $session
)
|
|
Return the ID of the default team for the user that is logged into the current session.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
API Tags:
| Return: | -- the Team ID of the current user's default team - for Community Edition
-1 on error. |
handle_set_entries [line 1831]
void handle_set_entries(
$module_name, $name_value_lists, [ $select_fields = FALSE]
)
|
|
Parameters:
|
|
$module_name: |
|
|
|
$name_value_lists: |
|
|
|
$select_fields: |
|
handle_set_relationship [line 1147]
Empty handle_set_relationship(
Array $set_relationship_value
)
|
|
(Internal) Create a relationship between two beans.
Parameters:
|
Array |
$set_relationship_value: |
-- 'module1' -- 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).. 'module1_id' -- The ID of the bean in the specified module 'module2' -- The name of the module that the related 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).. 'module2_id' -- The ID of the bean in the specified module |
API Tags:
| Return: | error on success, Error on failure |
is_loopback [line 150]
Check to see if the soap server and client are on the same machine.
We don't allow a server to sync to itself.
API Tags:
| Return: | -- if the SOAP server and client are on the same machine |
is_user_admin [line 60]
int is_user_admin(
String $session
)
|
|
Return if the user is an admin or not
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
API Tags:
| Return: | 1 or 0 depending on if the user is an admin |
login [line 87]
Array(session_id, login(
UserAuth $user_auth, String $application
)
|
|
Log the user into the application
Parameters:
|
String |
$application: |
-- The name of the application you are logging in from. (Currently unused). |
|
UserAuth |
$user_auth: |
array $user_auth -- Set user_name and password (password needs to be in the right encoding for the type of authentication the user is setup for. For Base sugar validation, password is the MD5 sum of the plain text password. |
API Tags:
| Return: | error) -- session_id is the id of the session that was created. Error is set if there was any error during creation. |
logout [line 701]
Empty logout(
String $session
)
|
|
Log out of the session. This will destroy the session and prevent other's from using it.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
API Tags:
| Return: | error on success, Error on failure |
relate_note_to_module [line 587]
no relate_note_to_module(
String $session, String $note_id, String $module_name, String $module_id
)
|
|
Attach a note to another bean. Once you have created a note to store an attachment, the note needs to be related to the bean.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
String |
$note_id: |
-- The ID of the note that you want to associate with a bean |
|
String |
$module_name: |
-- The name of the module to return records 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).. |
|
String |
$module_id: |
-- The ID of the bean that you want to associate the note with |
API Tags:
| Return: | error for success, error for failure |
seamless_login [line 196]
true seamless_login(
String $session
)
|
|
Perform a seamless login. This is used internally during the sync process.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
API Tags:
| Return: | -- if the session was authenticated |
search_by_module [line 1234]
get_entry_list_result search_by_module(
string $user_name, string $password, string $search_string, string[] $modules, int $offset, int $max_results
)
|
|
Given a list of modules to search and a search string, return the id, module_name, along with the fields as specified in the $query_array
Parameters:
|
string |
$user_name: |
- username of the Sugar User
|
|
string |
$password: |
- password of the Sugar User
|
|
string |
$search_string: |
|
|
string[] |
$modules: |
- array of modules to query
|
|
int |
$offset: |
- a specified offset in the query
|
|
int |
$max_results: |
- max number of records to return
|
API Tags:
| Return: | - id, module_name, and list of fields from each record |
set_campaign_merge [line 1697]
error_value set_campaign_merge(
session $session, targets $targets, campaign_id $campaign_id
)
|
|
Once we have successfuly done a mail merge on a campaign, we need to notify Sugar of the targets and the campaign_id for tracking purposes
Parameters:
|
session |
$session: |
the session id of the authenticated user |
|
targets |
$targets: |
a string array of ids identifying the targets used in the merge |
|
campaign_id |
$campaign_id: |
the campaign_id used for the merge |
set_document_revision [line 1201]
unknown set_document_revision(
String $session, unknown_type $document_revision
)
|
|
Enter description here...
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
unknown_type |
$document_revision: |
|
set_entries [line 475]
Array set_entries(
String $session, String $module_name, Array $name_value_lists
)
|
|
Update or create a list of SugarBeans
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
String |
$module_name: |
-- The name of the module to return records 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).. |
|
Array |
$name_value_lists: |
-- Array of Bean specific Arrays where the keys of the array are the SugarBean attributes, the values of the array are the values the attributes should have. |
API Tags:
| Return: | 'ids' -- Array of the IDs of the beans that was written to (-1 on error) 'error' -- The SOAP error if any. |
set_entries_details [line 1815]
Array set_entries_details(
String $session, String $module_name, Array $name_value_lists, Array $select_fields
)
|
|
Update or create a list of SugarBeans, returning details about the records created/updated
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
String |
$module_name: |
-- The name of the module to return records 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).. |
|
Array |
$name_value_lists: |
-- Array of Bean specific Arrays where the keys of the array are the SugarBean attributes, the values of the array are the values the attributes should have. |
|
Array |
$select_fields: |
-- A list of the fields to be included in the results. This optional parameter allows for only needed fields to be retrieved. |
API Tags:
| Return: | 'name_value_lists' -- Array of Bean specific Arrays where the keys of the array are the SugarBean attributes, the values of the array are the values the attributes should have. 'error' -- The SOAP error if any. |
set_entry [line 415]
Array set_entry(
String $session, String $module_name, Array $name_value_list
)
|
|
Update or create a single SugarBean.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
String |
$module_name: |
-- The name of the module to return records 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).. |
|
Array |
$name_value_list: |
-- The keys of the array are the SugarBean attributes, the values of the array are the values the attributes should have. |
API Tags:
| Return: | 'id' -- the ID of the bean that was written to (-1 on error) 'error' -- The SOAP error if any. |
set_note_attachment [line 507]
Array set_note_attachment(
String $session, Binary $note
)
|
|
Add or replace the attachment on a Note.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
Binary |
$note: |
-- The flie contents of the attachment. |
API Tags:
| Return: | 'id' -- The ID of the new note or -1 on error 'error' -- The SOAP error if any. |
set_relationship [line 1089]
Empty set_relationship(
String $session, Array $set_relationship_value
)
|
|
Set a single relationship between two beans. The items are related by module name and id.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
Array |
$set_relationship_value: |
-- 'module1' -- 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).. 'module1_id' -- The ID of the bean in the specified module 'module2' -- The name of the module that the related 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).. 'module2_id' -- The ID of the bean in the specified module |
API Tags:
| Return: | error on success, Error on failure |
set_relationships [line 1115]
Empty set_relationships(
String $session, Array $set_relationship_list
)
|
|
Setup several relationships between pairs of beans. The items are related by module name and id.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
Array |
$set_relationship_list: |
-- One for each relationship to setup. Each entry is itself an array. 'module1' -- 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).. 'module1_id' -- The ID of the bean in the specified module 'module2' -- The name of the module that the related 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).. 'module2_id' -- The ID of the bean in the specified module |
API Tags:
| Return: | error on success, Error on failure |
test [line 846]
String test(
String $string
)
|
|
A simple test method that returns the string you pass into it. It is convenient for verifying connectivity and server availability.
Parameters:
|
String |
$string: |
-- An arbirtray string that will be returned |
API Tags:
| Return: | -- The string that you sent in. |
update_portal_user [line 802]
Empty update_portal_user(
String $session, String $portal_name, Array $name_value_list
)
|
|
Update the properties of a contact that is portal user. Add the portal user name to the user's properties.
Parameters:
|
String |
$session: |
-- Session ID returned by a previous call to login. |
|
String |
$portal_name: |
-- The portal user_name of the contact |
|
Array |
$name_value_list: |
-- collection of 'name'=>'value' pairs for finding the contact |
API Tags:
| Return: | error on success, Error on failure |
validate_authenticated [line 163]
true validate_authenticated(
String $session_id
)
|
|
Validate the provided session information is correct and current. Load the session.
Parameters:
|
String |
$session_id: |
-- The session ID that was returned by a call to login. |
API Tags:
| Return: | -- If the session is valid and loaded. |
|
|