Advertisement
Guest User

Untitled

a guest
Nov 9th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.70 KB | None | 0 0
  1. /**
  2. * SugarWebServiceImplv4_1.php
  3. *
  4. * This class is an implementation class for all the web services. Version 4_1 adds limit/off support to the
  5. * get_relationships function. We also added the sync_get_modified_relationships function call from version
  6. * one to facilitate querying for related meetings/calls contacts/users records.
  7. *
  8. */
  9. Class [ class SugarWebServiceImplv4_1 extends SugarWebServiceImplv4 ] {
  10.  
  11.  
  12. - Constants [0] {
  13. }
  14.  
  15. - Static properties [1] {
  16. Property [ public static $helperObject ]
  17. }
  18.  
  19. - Static methods [0] {
  20. }
  21.  
  22. - Properties [0] {
  23. }
  24.  
  25. - Methods [42] {
  26. /**
  27. * Class Constructor Object
  28. *
  29. */
  30. Method [ public method __construct ] {
  31.  
  32. }
  33.  
  34. /**
  35. * Retrieve a collection of beans that are related to the specified bean and optionally return relationship data for those related beans.
  36. * So in this API you can get contacts info for an account and also return all those contact's email address or an opportunity info also.
  37. *
  38. * @param String $session -- Session ID returned by a previous call to login.
  39. * @param 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)..
  40. * @param String $module_id -- The ID of the bean in the specified module
  41. * @param String $link_field_name -- The name of the lnk field to return records from. This name should be the name the relationship.
  42. * @param 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.
  43. * @param Array $related_fields - Array of related bean fields to be returned.
  44. * @param Array $related_module_link_name_to_fields_array - For every related bean returrned, specify link fields name to fields info for that bean to be returned. For ex.'link_name_to_fields_array' => array(array('name' => 'email_addresses', 'value' => array('id', 'email_address', 'opt_out', 'primary_address'))).
  45. * @param Number $deleted -- false if deleted records should not be include, true if deleted records should be included.
  46. * @param String $order_by -- field to order the result sets by
  47. * @param Number $offset -- where to start in the return
  48. * @param Number $limit -- number of results to return (defaults to all)
  49. * @return Array 'entry_list' -- Array - The records that were retrieved
  50. * 'relationship_list' -- Array - The records link field data. The example is if asked about accounts contacts email address then return data would look like Array ( [0] => Array ( [name] => email_addresses [records] => Array ( [0] => Array ( [0] => Array ( [name] => id [value] => 3fb16797-8d90-0a94-ac12-490b63a6be67 ) [1] => Array ( [name] => email_address [value] => hr.kid.qa@example.com ) [2] => Array ( [name] => opt_out [value] => 0 ) [3] => Array ( [name] => primary_address [value] => 1 ) ) [1] => Array ( [0] => Array ( [name] => id [value] => 403f8da1-214b-6a88-9cef-490b63d43566 ) [1] => Array ( [name] => email_address [value] => kid.hr@example.name ) [2] => Array ( [name] => opt_out [value] => 0 ) [3] => Array ( [name] => primary_address [value] => 0 ) ) ) ) )
  51. * @exception 'SoapFault' -- The SOAP error, if any
  52. */
  53. Method [ public method get_relationships ] {
  54.  
  55.  
  56. - Parameters [11] {
  57. Parameter #0 [ $session ]
  58. Parameter #1 [ $module_name ]
  59. Parameter #2 [ $module_id ]
  60. Parameter #3 [ $link_field_name ]
  61. Parameter #4 [ $related_module_query ]
  62. Parameter #5 [ $related_fields ]
  63. Parameter #6 [ $related_module_link_name_to_fields_array ]
  64. Parameter #7 [ $deleted ]
  65. Parameter #8 [ $order_by = '' ]
  66. Parameter #9 [ $offset = 0 ]
  67. Parameter #10 [ $limit = false ]
  68. }
  69. }
  70.  
  71. /**
  72. * get_modified_relationships
  73. *
  74. * Get a list of the relationship records that have a date_modified value set within a specified date range. This is used to
  75. * help facilitate sync operations. The module_name should be "Users" and the related_module one of "Meetings", "Calls" and
  76. * "Contacts".
  77. *
  78. * @param xsd:string $session String of the session id
  79. * @param xsd:string $module_name String value of the primary module to retrieve relationship against
  80. * @param xsd:string $related_module String value of the related module to retrieve records off of
  81. * @param xsd:string $from_date String value in YYYY-MM-DD HH:MM:SS format of date_start range (required)
  82. * @param xsd:string $to_date String value in YYYY-MM-DD HH:MM:SS format of ending date_start range (required)
  83. * @param xsd:int $offset Integer value of the offset to begin returning records from
  84. * @param xsd:int $max_results Integer value of the max_results to return; -99 for unlimited
  85. * @param xsd:int $deleted Integer value indicating deleted column value search (defaults to 0). Set to 1 to find deleted records
  86. * @param xsd:string $module_user_id String value of the user id (optional, but defaults to SOAP session user id anyway) The module_user_id value
  87. * here ought to be the user id of the user initiating the SOAP session
  88. * @param tns:select_fields $select_fields Array value of fields to select and return as name/value pairs
  89. * @param xsd:string $relationship_name String value of the relationship name to search on
  90. * @param xsd:string $deletion_date String value in YYYY-MM-DD HH:MM:SS format for filtering on deleted records whose date_modified falls within range
  91. * this allows deleted records to be returned as well
  92. *
  93. * @return Array records that match search criteria
  94. */
  95. Method [ public method get_modified_relationships ] {
  96.  
  97.  
  98. - Parameters [12] {
  99. Parameter #0 [ $session ]
  100. Parameter #1 [ $module_name ]
  101. Parameter #2 [ $related_module ]
  102. Parameter #3 [ $from_date ]
  103. Parameter #4 [ $to_date ]
  104. Parameter #5 [ $offset ]
  105. Parameter #6 [ $max_results ]
  106. Parameter #7 [ $deleted = 0 ]
  107. Parameter #8 [ $module_user_id = '' ]
  108. Parameter #9 [ $select_fields = Array ]
  109. Parameter #10 [ $relationship_name = '' ]
  110. Parameter #11 [ $deletion_date = '' ]
  111. }
  112. }
  113.  
  114. /**
  115. * Log the user into the application
  116. *
  117. * @param UserAuth array $user_auth -- Set user_name and password (password needs to be
  118. * in the right encoding for the type of authentication the user is setup for. For Base
  119. * sugar validation, password is the MD5 sum of the plain text password.
  120. * @param String $application -- The name of the application you are logging in from. (Currently unused).
  121. * @param array $name_value_list -- Array of name value pair of extra parameters. As of today only 'language' and 'notifyonsave' is supported
  122. * @return Array - id - String id is the session_id of the session that was created.
  123. * - module_name - String - module name of user
  124. * - name_value_list - Array - The name value pair of user_id, user_name, user_language, user_currency_id, user_currency_name,
  125. * - user_default_team_id, user_is_admin, user_default_dateformat, user_default_timeformat
  126. * @exception 'SoapFault' -- The SOAP error, if any
  127. */
  128. Method [ public method login ] {
  129.  
  130.  
  131. - Parameters [3] {
  132. Parameter #0 [ $user_auth ]
  133. Parameter #1 [ $application ]
  134. Parameter #2 [ $name_value_list = Array ]
  135. }
  136. }
  137.  
  138. /**
  139. * Retrieve a list of SugarBean's based on provided IDs. This API will not wotk with report module
  140. *
  141. * @param String $session -- Session ID returned by a previous call to login.
  142. * @param 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)..
  143. * @param Array $ids -- An array of SugarBean IDs.
  144. * @param 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.
  145. * @param Array $link_name_to_fields_array -- A list of link_names and for each link_name, what fields value to be returned. For ex.'link_name_to_fields_array' => array(array('name' => 'email_addresses', 'value' => array('id', 'email_address', 'opt_out', 'primary_address')))
  146. * @return Array
  147. * 'entry_list' -- Array - The records name value pair for the simple data types excluding link field data.
  148. * 'relationship_list' -- Array - The records link field data. The example is if asked about accounts email address then return data would look like Array ( [0] => Array ( [name] => email_addresses [records] => Array ( [0] => Array ( [0] => Array ( [name] => id [value] => 3fb16797-8d90-0a94-ac12-490b63a6be67 ) [1] => Array ( [name] => email_address [value] => hr.kid.qa@example.com ) [2] => Array ( [name] => opt_out [value] => 0 ) [3] => Array ( [name] => primary_address [value] => 1 ) ) [1] => Array ( [0] => Array ( [name] => id [value] => 403f8da1-214b-6a88-9cef-490b63d43566 ) [1] => Array ( [name] => email_address [value] => kid.hr@example.name ) [2] => Array ( [name] => opt_out [value] => 0 ) [3] => Array ( [name] => primary_address [value] => 0 ) ) ) ) )
  149. * @exception 'SoapFault' -- The SOAP error, if any
  150. */
  151. Method [ public method get_entries ] {
  152.  
  153.  
  154. - Parameters [5] {
  155. Parameter #0 [ $session ]
  156. Parameter #1 [ $module_name ]
  157. Parameter #2 [ $ids ]
  158. Parameter #3 [ $select_fields ]
  159. Parameter #4 [ $link_name_to_fields_array ]
  160. }
  161. }
  162.  
  163. /**
  164. * Retrieve a list of beans. This is the primary method for getting list of SugarBeans from Sugar using the SOAP API.
  165. *
  166. * @param String $session -- Session ID returned by a previous call to login.
  167. * @param 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)..
  168. * @param String $query -- SQL where clause without the word 'where'
  169. * @param String $order_by -- SQL order by clause without the phrase 'order by'
  170. * @param integer $offset -- The record offset to start from.
  171. * @param 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.
  172. * @param Array $link_name_to_fields_array -- A list of link_names and for each link_name, what fields value to be returned. For ex.'link_name_to_fields_array' => array(array('name' => 'email_addresses', 'value' => array('id', 'email_address', 'opt_out', 'primary_address')))
  173. * @param integer $max_results -- The maximum number of records to return. The default is the sugar configuration value for 'list_max_entries_per_page'
  174. * @param integer $deleted -- false if deleted records should not be include, true if deleted records should be included.
  175. * @return Array 'result_count' -- integer - The number of records returned
  176. * 'next_offset' -- integer - 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.
  177. * 'entry_list' -- Array - The records that were retrieved
  178. * 'relationship_list' -- Array - The records link field data. The example is if asked about accounts email address then return data would look like Array ( [0] => Array ( [name] => email_addresses [records] => Array ( [0] => Array ( [0] => Array ( [name] => id [value] => 3fb16797-8d90-0a94-ac12-490b63a6be67 ) [1] => Array ( [name] => email_address [value] => hr.kid.qa@example.com ) [2] => Array ( [name] => opt_out [value] => 0 ) [3] => Array ( [name] => primary_address [value] => 1 ) ) [1] => Array ( [0] => Array ( [name] => id [value] => 403f8da1-214b-6a88-9cef-490b63d43566 ) [1] => Array ( [name] => email_address [value] => kid.hr@example.name ) [2] => Array ( [name] => opt_out [value] => 0 ) [3] => Array ( [name] => primary_address [value] => 0 ) ) ) ) )
  179. * @exception 'SoapFault' -- The SOAP error, if any
  180. */
  181. Method [ public method get_entry_list ] {
  182.  
  183.  
  184. - Parameters [10] {
  185. Parameter #0 [ $session ]
  186. Parameter #1 [ $module_name ]
  187. Parameter #2 [ $query ]
  188. Parameter #3 [ $order_by ]
  189. Parameter #4 [ $offset ]
  190. Parameter #5 [ $select_fields ]
  191. Parameter #6 [ $link_name_to_fields_array ]
  192. Parameter #7 [ $max_results ]
  193. Parameter #8 [ $deleted ]
  194. Parameter #9 [ $favorites = false ]
  195. }
  196. }
  197.  
  198. /**
  199. * Retrieve the layout metadata for a given module given a specific type and view.
  200. *
  201. * @param String $session -- Session ID returned by a previous call to login.
  202. * @param array $module_name(s) -- The name of the module(s) 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)..
  203. * @return array $type The type(s) of views requested. Current supported types are 'default' (for application) and 'wireless'
  204. * @return array $view The view(s) requested. Current supported types are edit, detail, list, and subpanel.
  205. * @exception 'SoapFault' -- The SOAP error, if any
  206. */
  207. Method [ public method get_module_layout ] {
  208.  
  209.  
  210. - Parameters [6] {
  211. Parameter #0 [ $session ]
  212. Parameter #1 [ $a_module_names ]
  213. Parameter #2 [ $a_type ]
  214. Parameter #3 [ $a_view ]
  215. Parameter #4 [ $acl_check = true ]
  216. Parameter #5 [ $md5 = false ]
  217. }
  218. }
  219.  
  220. /**
  221. * Given a list of modules to search and a search string, return the id, module_name, along with the fields
  222. * We will support Accounts, Bug Tracker, Cases, Contacts, Leads, Opportunities, Project, ProjectTask, Quotes
  223. *
  224. * @param string $session - Session ID returned by a previous call to login.
  225. * @param string $search_string - string to search
  226. * @param string[] $modules - array of modules to query
  227. * @param int $offset - a specified offset in the query
  228. * @param int $max_results - max number of records to return
  229. * @param string $assigned_user_id - a user id to filter all records by, leave empty to exclude the filter
  230. * @param string[] $select_fields - An array of fields to return. If empty the default return fields will be from the active list view defs.
  231. * @param bool $unified_search_only - A boolean indicating if we should only search against those modules participating in the unified search.
  232. * @param bool $favorites - A boolean indicating if we should only search against records marked as favorites.
  233. * @return Array return_search_result - Array('Accounts' => array(array('name' => 'first_name', 'value' => 'John', 'name' => 'last_name', 'value' => 'Do')))
  234. * @exception 'SoapFault' -- The SOAP error, if any
  235. */
  236. Method [ public method search_by_module ] {
  237.  
  238.  
  239. - Parameters [9] {
  240. Parameter #0 [ $session ]
  241. Parameter #1 [ $search_string ]
  242. Parameter #2 [ $modules ]
  243. Parameter #3 [ $offset ]
  244. Parameter #4 [ $max_results ]
  245. Parameter #5 [ $assigned_user_id = '' ]
  246. Parameter #6 [ $select_fields = Array ]
  247. Parameter #7 [ $unified_search_only = true ]
  248. Parameter #8 [ $favorites = false ]
  249. }
  250. }
  251.  
  252. /**
  253. * Get the base64 contents of a quote pdf.
  254. *
  255. * @param string $session - Session ID returned by a previous call to login.
  256. * @param string $quote_id
  257. * @param string $pdf_format Either Standard or Invoice
  258. */
  259. Method [ public method get_quotes_pdf ] {
  260.  
  261.  
  262. - Parameters [3] {
  263. Parameter #0 [ $session ]
  264. Parameter #1 [ $quote_id ]
  265. Parameter #2 [ $pdf_format = 'Standard' ]
  266. }
  267. }
  268.  
  269. /**
  270. * For a particular report, generate the associated pdf report. All caching should be done
  271. * on the client side.
  272. *
  273. * @param string $session - Session ID returned by a previous call to login.
  274. * @param string $report_id - The id of the report bean.
  275. *
  276. * @return array - file_contents key with pdf base64 encoded.
  277. *
  278. */
  279. Method [ public method get_report_pdf ] {
  280.  
  281.  
  282. - Parameters [2] {
  283. Parameter #0 [ $session ]
  284. Parameter #1 [ $report_id ]
  285. }
  286. }
  287.  
  288. /**
  289. * Get OAuth reqtest token
  290. */
  291. Method [ public method oauth_request_token ] {
  292.  
  293. }
  294.  
  295. /**
  296. * Get OAuth access token
  297. */
  298. Method [ public method oauth_access_token ] {
  299.  
  300. }
  301.  
  302. Method [ public method oauth_access ] {
  303.  
  304.  
  305. - Parameters [1] {
  306. Parameter #0 [ $session = '' ]
  307. }
  308. }
  309.  
  310. /**
  311. * Import emails from the SNIP service.
  312. *
  313. * @param String $session -- Session ID returned by a previous call to login.
  314. * @exception 'SoapFault' -- The SOAP error, if any
  315. */
  316. Method [ public method snip_import_emails ] {
  317.  
  318.  
  319. - Parameters [2] {
  320. Parameter #0 [ $session ]
  321. Parameter #1 [ $email ]
  322. }
  323. }
  324.  
  325. /**
  326. * Return new contact emails since $timestamp for current user
  327. * @param string $session
  328. * @param int $timestamp
  329. */
  330. Method [ public method snip_update_contacts ] {
  331.  
  332.  
  333. - Parameters [2] {
  334. Parameter #0 [ $session ]
  335. Parameter #1 [ $timestamp ]
  336. }
  337. }
  338.  
  339. /**
  340. * Get next job from the queue
  341. * @param string $session
  342. * @param string $clientid
  343. */
  344. Method [ public method job_queue_next ] {
  345.  
  346.  
  347. - Parameters [2] {
  348. Parameter #0 [ $session ]
  349. Parameter #1 [ $clientid ]
  350. }
  351. }
  352.  
  353. /**
  354. * Run cleanup and schedule
  355. * @param string $session
  356. * @param string $clientid
  357. */
  358. Method [ public method job_queue_cycle ] {
  359.  
  360.  
  361. - Parameters [2] {
  362. Parameter #0 [ $session ]
  363. Parameter #1 [ $clientid ]
  364. }
  365. }
  366.  
  367. /**
  368. * Run job from queue
  369. * @param string $session
  370. * @param string $jobid
  371. * @param string $clientid
  372. */
  373. Method [ public method job_queue_run ] {
  374.  
  375.  
  376. - Parameters [3] {
  377. Parameter #0 [ $session ]
  378. Parameter #1 [ $jobid ]
  379. Parameter #2 [ $clientid ]
  380. }
  381. }
  382.  
  383. /**
  384. * Retrieve a single SugarBean based on ID.
  385. *
  386. * @param String $session -- Session ID returned by a previous call to login.
  387. * @param 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)..
  388. * @param String $id -- The SugarBean's ID value.
  389. * @param 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.
  390. * @param Array $link_name_to_fields_array -- A list of link_names and for each link_name, what fields value to be returned. For ex.'link_name_to_fields_array' => array(array('name' => 'email_addresses', 'value' => array('id', 'email_address', 'opt_out', 'primary_address')))
  391. * @param bool $trackView -- Should we track the record accessed.
  392. * @return Array
  393. * 'entry_list' -- Array - The records name value pair for the simple data types excluding link field data.
  394. * 'relationship_list' -- Array - The records link field data. The example is if asked about accounts email address then return data would look like Array ( [0] => Array ( [name] => email_addresses [records] => Array ( [0] => Array ( [0] => Array ( [name] => id [value] => 3fb16797-8d90-0a94-ac12-490b63a6be67 ) [1] => Array ( [name] => email_address [value] => hr.kid.qa@example.com ) [2] => Array ( [name] => opt_out [value] => 0 ) [3] => Array ( [name] => primary_address [value] => 1 ) ) [1] => Array ( [0] => Array ( [name] => id [value] => 403f8da1-214b-6a88-9cef-490b63d43566 ) [1] => Array ( [name] => email_address [value] => kid.hr@example.name ) [2] => Array ( [name] => opt_out [value] => 0 ) [3] => Array ( [name] => primary_address [value] => 0 ) ) ) ) )
  395. * @exception 'SoapFault' -- The SOAP error, if any
  396. */
  397. Method [ public method get_entry ] {
  398.  
  399.  
  400. - Parameters [6] {
  401. Parameter #0 [ $session ]
  402. Parameter #1 [ $module_name ]
  403. Parameter #2 [ $id ]
  404. Parameter #3 [ $select_fields ]
  405. Parameter #4 [ $link_name_to_fields_array ]
  406. Parameter #5 [ $track_view = false ]
  407. }
  408. }
  409.  
  410. /**
  411. * Retrieve the md5 hash of the vardef entries for a particular module.
  412. *
  413. * @param String $session -- Session ID returned by a previous call to login.
  414. * @param 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)..
  415. * @return String The md5 hash of the vardef definition.
  416. * @exception 'SoapFault' -- The SOAP error, if any
  417. */
  418. Method [ public method get_module_fields_md5 ] {
  419.  
  420.  
  421. - Parameters [2] {
  422. Parameter #0 [ $session ]
  423. Parameter #1 [ $module_name ]
  424. }
  425. }
  426.  
  427. /**
  428. * Retrieve the md5 hash of a layout metadata for a given module given a specific type and view.
  429. *
  430. * @param String $session -- Session ID returned by a previous call to login.
  431. * @param array $module_name(s) -- 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)..
  432. * @return array $type(s) The type of view requested. Current supported types are 'default' (for application) and 'wireless'
  433. * @return array $view(s) The view requested. Current supported types are edit, detail, and list.
  434. * @exception 'SoapFault' -- The SOAP error, if any
  435. */
  436. Method [ public method get_module_layout_md5 ] {
  437.  
  438.  
  439. - Parameters [5] {
  440. Parameter #0 [ $session ]
  441. Parameter #1 [ $module_name ]
  442. Parameter #2 [ $type ]
  443. Parameter #3 [ $view ]
  444. Parameter #4 [ $acl_check = true ]
  445. }
  446. }
  447.  
  448. /**
  449. * Update or create a single SugarBean.
  450. *
  451. * @param String $session -- Session ID returned by a previous call to login.
  452. * @param 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)..
  453. * @param 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.
  454. * @param Bool $track_view -- Should the tracker be notified that the action was performed on the bean.
  455. * @return Array 'id' -- the ID of the bean that was written to (-1 on error)
  456. * @exception 'SoapFault' -- The SOAP error, if any
  457. */
  458. Method [ public method set_entry ] {
  459.  
  460.  
  461. - Parameters [4] {
  462. Parameter #0 [ $session ]
  463. Parameter #1 [ $module_name ]
  464. Parameter #2 [ $name_value_list ]
  465. Parameter #3 [ $track_view = false ]
  466. }
  467. }
  468.  
  469. /**
  470. * Retrieve the list of available modules on the system available to the currently logged in user.
  471. *
  472. * @param String $session -- Session ID returned by a previous call to login.
  473. * @param String $filter -- Valid values are: all - Return all modules,
  474. * default - Return all visible modules for the application
  475. * mobile - Return all visible modules for the mobile view
  476. * @return Array 'modules' -- Array - An array of module names
  477. * @exception 'SoapFault' -- The SOAP error, if any
  478. */
  479. Method [ public method get_available_modules ] {
  480.  
  481.  
  482. - Parameters [2] {
  483. Parameter #0 [ $session ]
  484. Parameter #1 [ $filter = 'all' ]
  485. }
  486. }
  487.  
  488. /**
  489. * Enter description here...
  490. *
  491. * @param string $session - Session ID returned by a previous call to login.
  492. * @param array $modules Array of modules to return
  493. * @param bool $MD5 Should the results be md5d
  494. */
  495. Method [ public method get_language_definition ] {
  496.  
  497.  
  498. - Parameters [3] {
  499. Parameter #0 [ $session ]
  500. Parameter #1 [ $modules ]
  501. Parameter #2 [ $MD5 = false ]
  502. }
  503. }
  504.  
  505. /**
  506. * Gets server info. This will return information like version, flavor and gmt_time.
  507. * @return Array - flavor - String - Retrieve the specific flavor of sugar.
  508. * - version - String - Retrieve the version number of Sugar that the server is running.
  509. * - gmt_time - String - Return the current time on the server in the format 'Y-m-d H:i:s'. This time is in GMT.
  510. * @exception 'SoapFault' -- The SOAP error, if any
  511. */
  512. Method [ public method get_server_info ] {
  513.  
  514. }
  515.  
  516. /**
  517. * Retrieve a list of recently viewed records by module.
  518. *
  519. * @param String $session -- Session ID returned by a previous call to login.
  520. * @param String $modules -- An array of modules or 'Home' to indicate all.
  521. * @return Array The recently viewed records
  522. * @exception 'SoapFault' -- The SOAP error, if any
  523. */
  524. Method [ public method get_last_viewed ] {
  525.  
  526.  
  527. - Parameters [2] {
  528. Parameter #0 [ $session ]
  529. Parameter #1 [ $module_names ]
  530. }
  531. }
  532.  
  533. /**
  534. * Retrieve a list of upcoming activities including Calls, Meetings,Tasks and Opportunities
  535. *
  536. * @param String $session -- Session ID returned by a previous call to login.
  537. * @return Array List of upcoming activities
  538. * @exception 'SoapFault' -- The SOAP error, if any
  539. */
  540. Method [ public method get_upcoming_activities ] {
  541.  
  542.  
  543. - Parameters [1] {
  544. Parameter #0 [ $session ]
  545. }
  546. }
  547.  
  548. /**
  549. * Set a single relationship between two beans. The items are related by module name and id.
  550. *
  551. * @param String $session -- Session ID returned by a previous call to login.
  552. * @param String $module_name -- 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)..
  553. * @param String $module_id - The ID of the bean in the specified module_name
  554. * @param String link_field_name -- name of the link field which relates to the other module for which the relationship needs to be generated.
  555. * @param array related_ids -- array of related record ids for which relationships needs to be generated
  556. * @param 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.
  557. * @param integer $delete -- Optional, if the value 0 or nothing is passed then it will add the relationship for related_ids and if 1 is passed, it will delete this relationship for related_ids
  558. * @return Array - created - integer - How many relationships has been created
  559. * - failed - integer - How many relationsip creation failed
  560. * - deleted - integer - How many relationships were deleted
  561. * @exception 'SoapFault' -- The SOAP error, if any
  562. */
  563. Method [ public method set_relationship ] {
  564.  
  565.  
  566. - Parameters [7] {
  567. Parameter #0 [ $session ]
  568. Parameter #1 [ $module_name ]
  569. Parameter #2 [ $module_id ]
  570. Parameter #3 [ $link_field_name ]
  571. Parameter #4 [ $related_ids ]
  572. Parameter #5 [ $name_value_list ]
  573. Parameter #6 [ $delete ]
  574. }
  575. }
  576.  
  577. /**
  578. * Set a single relationship between two beans. The items are related by module name and id.
  579. *
  580. * @param String $session -- Session ID returned by a previous call to login.
  581. * @param array $module_names -- Array of 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)..
  582. * @param array $module_ids - The array of ID of the bean in the specified module_name
  583. * @param array $link_field_names -- Array of the name of the link field which relates to the other module for which the relationships needs to be generated.
  584. * @param array $related_ids -- array of an array of related record ids for which relationships needs to be generated
  585. * @param array $name_value_lists -- Array of Array. The keys of the inner array are the SugarBean attributes, the values of the inner array are the values the attributes should have.
  586. * @param array int $delete_array -- Optional, array of 0 or 1. If the value 0 or nothing is passed then it will add the relationship for related_ids and if 1 is passed, it will delete this relationship for related_ids
  587. * @return Array - created - integer - How many relationships has been created
  588. * - failed - integer - How many relationsip creation failed
  589. * - deleted - integer - How many relationships were deleted
  590. *
  591. * @exception 'SoapFault' -- The SOAP error, if any
  592. */
  593. Method [ public method set_relationships ] {
  594.  
  595.  
  596. - Parameters [7] {
  597. Parameter #0 [ $session ]
  598. Parameter #1 [ $module_names ]
  599. Parameter #2 [ $module_ids ]
  600. Parameter #3 [ $link_field_names ]
  601. Parameter #4 [ $related_ids ]
  602. Parameter #5 [ $name_value_lists ]
  603. Parameter #6 [ $delete_array ]
  604. }
  605. }
  606.  
  607. /**
  608. * Update or create a list of SugarBeans
  609. *
  610. * @param String $session -- Session ID returned by a previous call to login.
  611. * @param 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)..
  612. * @param 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.
  613. * @return Array 'ids' -- Array of the IDs of the beans that was written to (-1 on error)
  614. * @exception 'SoapFault' -- The SOAP error, if any
  615. */
  616. Method [ public method set_entries ] {
  617.  
  618.  
  619. - Parameters [3] {
  620. Parameter #0 [ $session ]
  621. Parameter #1 [ $module_name ]
  622. Parameter #2 [ $name_value_lists ]
  623. }
  624. }
  625.  
  626. /**
  627. * Log out of the session. This will destroy the session and prevent other's from using it.
  628. *
  629. * @param String $session -- Session ID returned by a previous call to login.
  630. * @return Empty
  631. * @exception 'SoapFault' -- The SOAP error, if any
  632. */
  633. Method [ public method logout ] {
  634.  
  635.  
  636. - Parameters [1] {
  637. Parameter #0 [ $session ]
  638. }
  639. }
  640.  
  641. /**
  642. * Return the user_id of the user that is logged into the current session.
  643. *
  644. * @param String $session -- Session ID returned by a previous call to login.
  645. * @return String -- the User ID of the current session
  646. * @exception 'SoapFault' -- The SOAP error, if any
  647. */
  648. Method [ public method get_user_id ] {
  649.  
  650.  
  651. - Parameters [1] {
  652. Parameter #0 [ $session ]
  653. }
  654. }
  655.  
  656. /**
  657. * Retrieve vardef information on the fields of the specified bean.
  658. *
  659. * @param String $session -- Session ID returned by a previous call to login.
  660. * @param 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)..
  661. * @param Array $fields -- Optional, if passed then retrieve vardef information on these fields only.
  662. * @return Array 'module_fields' -- Array - The vardef information on the selected fields.
  663. * 'link_fields' -- Array - The vardef information on the link fields
  664. * @exception 'SoapFault' -- The SOAP error, if any
  665. */
  666. Method [ public method get_module_fields ] {
  667.  
  668.  
  669. - Parameters [3] {
  670. Parameter #0 [ $session ]
  671. Parameter #1 [ $module_name ]
  672. Parameter #2 [ $fields = Array ]
  673. }
  674. }
  675.  
  676. /**
  677. * Perform a seamless login. This is used internally during the sync process.
  678. *
  679. * @param String $session -- Session ID returned by a previous call to login.
  680. * @return 1 -- integer - if the session was authenticated
  681. * @return 0 -- integer - if the session could not be authenticated
  682. */
  683. Method [ public method seamless_login ] {
  684.  
  685.  
  686. - Parameters [1] {
  687. Parameter #0 [ $session ]
  688. }
  689. }
  690.  
  691. /**
  692. * Add or replace the attachment on a Note.
  693. * Optionally you can set the relationship of this note to Accounts/Contacts and so on by setting related_module_id, related_module_name
  694. *
  695. * @param String $session -- Session ID returned by a previous call to login.
  696. * @param Array 'note' -- Array String 'id' -- The ID of the Note containing the attachment
  697. * String 'filename' -- The file name of the attachment
  698. * Binary 'file' -- The binary contents of the file.
  699. * String 'related_module_id' -- module id to which this note to related to
  700. * String 'related_module_name' - module name to which this note to related to
  701. *
  702. * @return Array 'id' -- String - The ID of the Note
  703. * @exception 'SoapFault' -- The SOAP error, if any
  704. */
  705. Method [ public method set_note_attachment ] {
  706.  
  707.  
  708. - Parameters [2] {
  709. Parameter #0 [ $session ]
  710. Parameter #1 [ $note ]
  711. }
  712. }
  713.  
  714. /**
  715. * Retrieve an attachment from a note
  716. * @param String $session -- Session ID returned by a previous call to login.
  717. * @param String $id -- The ID of the appropriate Note.
  718. * @return Array 'note_attachment' -- Array String 'id' -- The ID of the Note containing the attachment
  719. * String 'filename' -- The file name of the attachment
  720. * Binary 'file' -- The binary contents of the file.
  721. * String 'related_module_id' -- module id to which this note is related
  722. * String 'related_module_name' - module name to which this note is related
  723. * @exception 'SoapFault' -- The SOAP error, if any
  724. */
  725. Method [ public method get_note_attachment ] {
  726.  
  727.  
  728. - Parameters [2] {
  729. Parameter #0 [ $session ]
  730. Parameter #1 [ $id ]
  731. }
  732. }
  733.  
  734. /**
  735. * sets a new revision for this document
  736. *
  737. * @param String $session -- Session ID returned by a previous call to login.
  738. * @param Array $document_revision -- Array String 'id' -- The ID of the document object
  739. * String 'document_name' - The name of the document
  740. * String 'revision' - The revision value for this revision
  741. * String 'filename' -- The file name of the attachment
  742. * String 'file' -- The binary contents of the file.
  743. * @return Array - 'id' - String - document revision id
  744. * @exception 'SoapFault' -- The SOAP error, if any
  745. */
  746. Method [ public method set_document_revision ] {
  747.  
  748.  
  749. - Parameters [2] {
  750. Parameter #0 [ $session ]
  751. Parameter #1 [ $document_revision ]
  752. }
  753. }
  754.  
  755. /**
  756. * This method is used as a result of the .htaccess lock down on the cache directory. It will allow a
  757. * properly authenticated user to download a document that they have proper rights to download.
  758. *
  759. * @param String $session -- Session ID returned by a previous call to login.
  760. * @param String $id -- ID of the document revision to obtain
  761. * @return new_return_document_revision - Array String 'id' -- The ID of the document revision containing the attachment
  762. * String document_name - The name of the document
  763. * String revision - The revision value for this revision
  764. * String 'filename' -- The file name of the attachment
  765. * Binary 'file' -- The binary contents of the file.
  766. * @exception 'SoapFault' -- The SOAP error, if any
  767. */
  768. Method [ public method get_document_revision ] {
  769.  
  770.  
  771. - Parameters [2] {
  772. Parameter #0 [ $session ]
  773. Parameter #1 [ $id ]
  774. }
  775. }
  776.  
  777. /**
  778. * Return the ID of the default team for the user that is logged into the current session.
  779. *
  780. * @param String $session -- Session ID returned by a previous call to login.
  781. * @return String -- the Team ID of the current user's default team
  782. * @exception 'SoapFault' -- The SOAP error, if any
  783. */
  784. Method [ public method get_user_team_id ] {
  785.  
  786.  
  787. - Parameters [1] {
  788. Parameter #0 [ $session ]
  789. }
  790. }
  791.  
  792. /**
  793. * Once we have successfuly done a mail merge on a campaign, we need to notify Sugar of the targets
  794. * and the campaign_id for tracking purposes
  795. *
  796. * @param String session -- Session ID returned by a previous call to login.
  797. * @param Array targets -- a string array of ids identifying the targets used in the merge
  798. * @param String campaign_id -- the campaign_id used for the merge
  799. * @return - No output
  800. *
  801. * @exception 'SoapFault' -- The SOAP error, if any
  802. */
  803. Method [ public method set_campaign_merge ] {
  804.  
  805.  
  806. - Parameters [3] {
  807. Parameter #0 [ $session ]
  808. Parameter #1 [ $targets ]
  809. Parameter #2 [ $campaign_id ]
  810. }
  811. }
  812.  
  813. /**
  814. * Retrieve number of records in a given module
  815. *
  816. * @param String session -- Session ID returned by a previous call to login.
  817. * @param String module_name -- module to retrieve number of records from
  818. * @param String query -- allows webservice user to provide a WHERE clause
  819. * @param int deleted -- specify whether or not to include deleted records
  820. *
  821. * @return Array result_count - integer - Total number of records for a given module and query
  822. * @exception 'SoapFault' -- The SOAP error, if any
  823. */
  824. Method [ public method get_entries_count ] {
  825.  
  826.  
  827. - Parameters [4] {
  828. Parameter #0 [ $session ]
  829. Parameter #1 [ $module_name ]
  830. Parameter #2 [ $query ]
  831. Parameter #3 [ $deleted ]
  832. }
  833. }
  834.  
  835. /**
  836. * Retrieve a list of Reports info based on provided IDs.
  837. *
  838. * @param String $session -- Session ID returned by a previous call to login.
  839. * @param Array $ids -- An array of Report IDs.
  840. * @param 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.
  841. * @return Array 'field_list' -- Array of Var def information about the returned fields
  842. * 'entry_list' -- Array of the records that were retrieved
  843. * @exception 'SoapFault' -- The SOAP error, if any
  844. */
  845. Method [ public method get_report_entries ] {
  846.  
  847.  
  848. - Parameters [3] {
  849. Parameter #0 [ $session ]
  850. Parameter #1 [ $ids ]
  851. Parameter #2 [ $select_fields ]
  852. }
  853. }
  854. }
  855. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement