This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
array('id' => '1234-567', 'meeting_id' => '7890-1011', 'contact_id'=>"9872-3464", | |
'required' => true, 'accept_status' => 'Tentative', 'date_modified' => '2010-11-12 10:11:20') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
'emails' => array( | |
("address" => "a@x", "primary" => true) | |
("address" => "b@x", "primary" => false) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
'emails' => array( | |
// Update | |
"a@x" => array("address" => "b@y", "primary" => true), | |
// Delete | |
"b@x" => false, | |
// Add | |
"c@x" => array("address" => "c@x", "opt-out" => true) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$query = array( | |
array("op" => "<", "args" => array("$filesize", 100000)), | |
array("op" => "OR", "args" => array( | |
array("op" => "=", "args" => array("$fileext", "doc")), | |
array("op" => "=", "args" => array("$fileext", "docx")), | |
array("op" => "=", "args" => array("$fileext", "xls")), | |
array("op" => "=", "args" => array("$fileext", "xlsx")), | |
), | |
array("op" => "BETWEEN", "args" => array("$date_modified", "1/1/2001", "1/1/2012")), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
array("op" => "OR", args => array( | |
array("op" => "AND", args => array( | |
array("op" => "!=", "args" => array("$contacts.state", "CA")), | |
array("op" => "!=", "args" => array("$contacts.state", "OH")), | |
)), | |
array("op" => "=", args => array("[email protected]", 'CA')), | |
array("op" => "=", args => array("$opportunities.contacts.state", 'CA')), | |
)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT meetings.id, ... FROM meetings | |
LEFT JOIN contacts ON ... | |
LEFT JOIN contacts as contacts2 ON .... LEFT JOIN accounts ON ... LEFT JOIN contacts as contacts2_accounts_contacts | |
LEFT JOIN opportunities ON ... LEFT JOIN contacts as opportunities_contacts ON ... | |
WHERE ((contacts.state != 'CA' AND contacts.state != 'OH') AND contacts.id IS NOT NULL AND contacts.deleted = 0) OR | |
(contacts2_accounts_contacts.state = 'CA' | |
AND contacts2_accounts_contacts.id IS NOT NULL AND contacts2.deleted = 0) OR | |
(opportunities_contacts.state = 'CA' AND opportunities_contacts.id IS NOT NULL | |
AND opportunities_contacts.deleted = 0 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
'contacts' => array( | |
array('id' => '1234-567', 'meeting_id' => '7890-1011', 'contact_id'=>"9872-3464", | |
'required' => true, 'accept_status' => 'Tentative', 'date_modified' => '2010-11-12 10:11:20') | |
// etc. | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$createdef['[email protected]']['Contacts'] = array( | |
'fields' => array( | |
'email1' => '{from_addr}', | |
'last_name' => '{from_name}', | |
'description' => 'created from {subject}', | |
'lead_source' => 'Email', | |
), | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import urlparse | |
import oauth2 as oauth | |
import urllib | |
consumer_key = 'CONSUMERKEY' | |
consumer_secret = 'CONSUMERSECRET' | |
url = 'http://localhost:8888/sugar63/service/v4/rest.php' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
token = oauth.Token(request_token['oauth_token'], | |
request_token['oauth_token_secret']) | |
token.set_verifier(oauth_verifier) | |
client = oauth.Client(consumer, token) | |
restparams['method'] = 'oauth_access_token' | |
resp, content = client.request(url, "POST", body=urllib.urlencode(restparams)) | |
access_token = dict(urlparse.parse_qsl(content)) | |
print "Access Token:" |