Skip to content

Instantly share code, notes, and snippets.

View avtaniket's full-sized avatar

aniket takarkhede avtaniket

  • India
View GitHub Profile
@avtaniket
avtaniket / create-actions.js
Created June 30, 2015 07:22
Conditionaly adding Field Validation to the Create View in SugarCRM
({
extendsFrom: 'CreateActionsView',
initialize: function (options) {
this._super('initialize', [options]);
//add validation
this.model.addValidationTask('note', _.bind(this.doValidateTicketNote, this));
},
@avtaniket
avtaniket / record.js
Created June 30, 2015 07:12
Conditionaly adding Field Validation to the Edit View in SugarCRM
({
extendsFrom: 'RecordView',
initialize: function (options) {
this._super('initialize', [options]);
//add validation
this.model.addValidationTask('note', _.bind(this.doValidateTicketNote, this));
},
<?php
$mod_strings['LBL_OST__TICKETS_LINK_NAME'] = 'OSTicket Management';
$mod_strings['LBL_OST__TICKETS_LINK_DESCRIPTION'] = 'Manage osticket api settings';
$mod_strings['LBL_OST__TICKETS_SECTION_HEADER'] = 'osTicket Connect';
$mod_strings['LBL_OST__TICKETS_SECTION_DESCRIPTION'] = 'Configure setting for the OST_Tickets module';
<?php
$admin_option_defs = array();
$admin_option_defs['OST__Tickets']['ostickets_management'] = array(
//Icon name. Available icons are located in ./themes/default/images
'Releases',
//Link name label
'LBL_OST__TICKETS_LINK_NAME',
@avtaniket
avtaniket / generate_guid.php
Created June 26, 2015 05:46
GUID - unique key generation script to save as primary key in Tables
<?php
/**
* determines if a passed string matches the criteria for a GUID
* @param string $guid
* @return bool false
*/
function is_guid($guid)
{
return strlen($guid) == 36 && preg_match("/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/i", $guid);