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
| /** | |
| 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
| Read parent info in subpanel-list.js: | |
| var ctx = this.context.parent, parentModelId = ctx.get("modelId"), parentModule = ctx.get("module"); | |
| if(parentModule == 'Accounts'){ | |
| // do some action here | |
| var parentBean = app.data.createBean(parentModule, {id:parentModelId}), request = parentBean.fetch(); | |
| request.xhr.done(function(){ | |
| //get the field you need to verify |
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
| //custom/modules/Accounts/clients/base/views/create-actions/create-actions.js | |
| ({ | |
| // CustomCreate-actions View (base) | |
| extendsFrom: 'CreateActionsView', | |
| events: { | |
| 'change input[name=industry]':'OverrideAccountType' | |
| }, | |
| initialize: function (options) { | |
| this._super('initialize', [options]); |
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
| // http://laurenthinoul.com/how-to-add-a-record-color-to-a-listview-in-sugarcrm/ | |
| ({ | |
| extendsFrom: 'RecordlistView', | |
| initialize: function (options) { | |
| app.view.invokeParent(this, {type: 'view', name: 'recordlist', method: 'initialize', args: [options]}); | |
| this.collection.on('data:sync:complete', function () { | |
| this.renderColors(); | |
| }, this); | |
| }, |
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
| // by EvilPeri | |
| //custom/modules/<your module>/clients/base/fields/enum/enum.js | |
| ({ | |
| extendsFrom: 'EnumField', | |
| _render: function(){ | |
| if(this.name == 'your field name here'){ | |
| if(_.isEmpty(this.items)){ | |
| this.setItems(); | |
| return; |
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
| //clients/base/filters/operators/operators.php | |
| //clients/base/api/FilterApi.php | |
| //clients/base/layouts/filter/filter.js | |
| //clients/base/layouts/filterpanel/filterpanel.js | |
| $viewdefs['base']['filter']['operators'] = array( | |
| 'multienum' => array( | |
| '$contains' => 'LBL_OPERATOR_CONTAINS', // is any of | |
| '$not_contains' => 'LBL_OPERATOR_NOT_CONTAINS', | |
| ), |
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
| ini_set('error_reporting', E_ALL); | |
| ini_set('display_errors', true); | |
| ini_set('display_startup_errors', true); | |
| ini_set('log_errors', 1); | |
| //ini_set("error_log", "/path/to/php-error.log"); | |
| ini_set('html_errors',FALSE); | |
| error_log( "Hello log errors!" ); // write some hallo in log |
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
| sudo /opt/lampp/xampp stop | |
| crontab -e | |
| crontab -l | |
| crontab: usage error: unrecognized option | |
| usage: crontab [-u user] file | |
| crontab [ -u user ] [ -i ] { -e | -l | -r } | |
| (default operation is replace, per 1003.2) | |
| -e (edit user's crontab) |
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
| // http://stackoverflow.com/questions/12730581/use-this-php-code-to-open-a-pdf-in-a-new-tab | |
| header('Content-type: application/pdf'); | |
| header('Content-Disposition: inline; filename="' . $filename . '"'); | |
| header('Content-Transfer-Encoding: binary'); | |
| header('Content-Length: ' . filesize($file)); | |
| header('Accept-Ranges: bytes'); | |
| @readfile($file); | |
| exit(); |