Skip to content

Instantly share code, notes, and snippets.

<?php
/*Setting Label for button
* AjayKumar
* custom/Extension/modules/Accounts/Ext/Language/en_us.check_button.php
*/
$mod_strings['LBL_CHECK_BUTTON_LABEL']='Checking router record';
array(
'type'=>'rowaction',
'event'=>'button:check_button:click',
'name'=>'check_button',
'label'=>'LBL_CHECK_BUTTON_LABEL',
'acl_action'=>'view',
),
<?php
$mod_strings['LBL_FILTER_ACCOUNT_TEMPLATE']='Accounts without Current Account';
@AjayKumar01
AjayKumar01 / enableAudit.php
Created April 9, 2016 08:52
Enabling 'View Change Log' Button in record view of module or Enabling Audit for module
<php
/*
* Enabling Audit for module
* Ajay Kumar
* Path : /crm//custom/Extension/modules/Project/Ext/Vardefs/enableAudit.php
*/
$dictionary['Project']['audited'] = true;
?>
({
/*Registering Button action for Keyboard shortcut
* Ajay Kumar
* custom/modules/Accounts/clients/base/views/record/reord.js
*/
extendsFrom: 'RecordView',
initialize: function(options) {
this._super('initialize', [options]);
this.events = _.extend({}, this.events, {
'click a[name=test_button]': '_testAlert',
@AjayKumar01
AjayKumar01 / record.js
Last active May 29, 2016 05:05
Adding Shortcut name in record.js
/*custom/modules/Accounts/clients/base/layouts/record/record.js
* Ajay Kumar
*/
({
plugins: ['ShortcutSession'],
shortcuts: ['Sidebar:Toggle', 'Record:Edit', 'Record:Delete', 'Record:Save', 'Record:Cancel', 'Record:Previous', 'Record:Next', 'Record:Favorite', 'Record:Follow', 'Record:Copy', 'Record:Action:More', 'Record:Test']
})
@AjayKumar01
AjayKumar01 / daily_file_dump
Created July 7, 2016 09:48
Script to take backup of file system daily basis
#!/bin/bash
#Script to take autodump of directories
#Written by Ajay Kumar
#Dated: 07 July 2016
BACKUPDIR="/home/restore/CRM_Backup/"
TODAY=`date +"%A"`
#enter directories to be backedup here
FILES=( '/var/www/html/sugarhome' )
@AjayKumar01
AjayKumar01 / clearcache.sh
Created July 7, 2016 09:42
Clear Os cache automatically -To Improve Server Performance
#!/usr/bin/sh
echo 3 > /proc/sys/vm/drop_caches
//Execute this file in cron with difference (based on RAM size)
In terminal
>crontab -e
//then add the below with correct path,we have given 45 mins as diff
@AjayKumar01
AjayKumar01 / record.js
Last active October 3, 2016 20:32
Duplicate primary Email validation in record.js
({
extendsFrom: 'RecordView',
initialize: function(options) {
this._super('initialize', [options]);
this.model.addValidationTask('check_email', _.bind(this._doValidateEmail, this));
},
_doValidateEmail: function(fields, errors, callback) {
console.log("test function");
_.each(this.model.get('email'), function(emailObject) {
if (emailObject.primary_address) { //check if primary
@AjayKumar01
AjayKumar01 / recordlist.js
Last active October 3, 2016 20:32
Adding button in list view
({
extendsFrom:'RecordlistView',
initialize:function(options){
this._super('initialize',[options]);
this.context.on('list:updatecurrentsize:fire',this.mass_update_currentsize,this);
},
/**
* Function to mass update the current size
* for all selected accounts
* Written by: Ajay Kumar