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
/** | |
April 22, 2014 in Desarrollo, Sugar | |
1.) Custom AutoIncrement Field(having unique value): | |
For declaring “autoincrement” field in sugacrm do as follows: | |
Suppose we have to declare “Au Pair number” field as an autoincrement field in suagcrm. For this we have to declare vardef in custom/Extension/modules/oss_auPairs/Ext/Vardefs/vardefs.ext.php as follows: | |
*/ | |
$dictionary["oss_auPairs"]["fields"]["aupair_number"] =array ( |
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
$.ajax({ | |
beforeSend: function (request) { | |
request.setRequestHeader("OAuth-Token", SUGAR.App.api.getOAuthToken()); | |
}, | |
url: "rest/v10/cplus_ContactsPlus/create_cplus", | |
data: { type: "cplus", societyname: this.model.get('name') }, | |
dataType: "json", | |
type: "GET", | |
success: function (data) { | |
var obj = jQuery.parseJSON(data); |
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
global $db; | |
$db = DBManagerFactory::getInstance(); | |
$sql = "SELECT your_qurey_here"; | |
$res = $db->query($sql); | |
$row = $db->fetchByAssoc($res); | |
$cnt = $db->getRowCount($res); |
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
require_once('include/utils.php'); | |
$newID = create_guid(); |
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
if($.isEmptyObject(google)) { | |
$.getScript('https://www.google.com/jsapi', function () { | |
google.load("maps", "3", {'other_params' : 'sensor=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
<style> | |
/* svg fix for leaflet on sugar 7 against styles from styleguide/assets/css/nvd3.css */ | |
svg { | |
width: auto; | |
height: auto; | |
max-height: 1900px; | |
max-width: 1900px; | |
} | |
</style> |
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
Example usage common function defined in sidecar: | |
------------------- | |
// "custom-record": {"controller": | |
({ | |
// Record View (base) | |
extendsFrom: 'RecordView', | |
initialize: function (options) { | |
//this.plugins = _.union(this.plugins, ['MyAmazingFunctionFour']); // Call function through plugins | |
//app.MyAmazingFunction() // Call function through app | |
//SUGAR.util.MyAmazingFunctionTwo(); // Call function through SUGAR.util |
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
// MySQL | |
update users set user_hash = md5('jim') where user_name = 'jim'; | |
// MSSQL | |
update users set user_hash = '5e027396789a18c37aeda616e3d7991b' where user_name = 'jim'; |
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
TRUNCATE TABLE `activities`; | |
TRUNCATE TABLE `calls`; | |
TRUNCATE TABLE `calls_contacts`; | |
TRUNCATE TABLE `meetings`; | |
TRUNCATE TABLE `meetings_contacts`; | |
TRUNCATE TABLE `tasks`; | |
TRUNCATE TABLE `notes`; |
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
############################################### | |
# | |
# Install ORO CRM | |
# | |
############################################### | |
cd /var/www/html/OroCrm # go to your install OroCrm folder |