Skip to content

Instantly share code, notes, and snippets.

View cAstraea's full-sized avatar

cAstraea

View GitHub Profile
@cAstraea
cAstraea / subpanel-list.js
Last active September 11, 2015 10:52
subpanel duplicate
({
extendsFrom: 'SubpanelListView',
initialize: function (options) {
_.bindAll(this);
app.view.invokeParent(this, {type: 'view', name: 'recordlist', method: 'initialize', args:[options]});
//app.view.invokeParent(this, {type: 'view', name: 'record', method: 'initialize', args:[options]});
({
extendsFrom: 'SubpanelListView',
initialize: function(options){
this._super('initialize', [options]);
this.context.on('list:editrow:fire',this.drawerEditClicked, this);
},
drawerEditClicked: function(model){
console.log(model);
},
_dispose: function() {
@cAstraea
cAstraea / email validation
Created September 22, 2015 08:13
validate fields
({
extendsFrom: 'CreateActionsView',
initialize: function (options) {
this._super('initialize', [options]);
//add validation tasks
app.error.errorName2Keys['field_error'] = 'Invalid Email';
@cAstraea
cAstraea / mine.hbs
Last active September 22, 2016 18:05
google autocomplete
<html>
<head>
<style>
#map_canvas {
width: 50%;
height: 300px;
margin: 0px 0;
}
.hiddenMap { position: absolute;
left: -100%; }
@cAstraea
cAstraea / gist:e3e0e56ee0d5866032d1
Created November 6, 2015 10:26
fix permissions sugarcrm
APACHEUSER='bitnami:daemon'
SUGARPATH='/opt/bitnami/apps/sugarcrm/htdocs'
echo "Fixing permissions for sugarCRM"
find -P $SUGARPATH/ -type d -exec chmod 755 {} \;
find -P $SUGARPATH/ -type f -exec chmod 644 {} \;
find -P $SUGARPATH/ -name *.js -exec chmod 755 {} \;
chmod 664 $SUGARPATH/config.php
chmod 664 $SUGARPATH/config_override.php
chmod 664 $SUGARPATH/sugarcrm.log
find -P $SUGARPATH/cache -type d -exec chmod 775 {} \;
@cAstraea
cAstraea / sidebarCS.js
Created February 19, 2016 16:23
Sidebar toggle with button override on Accounts record view using localstorage
//add this with jsgrouping
(function(app){
/**
* Copyright 2015 SugarCRM Inc. Licensed by SugarCRM under the Apache 2.0 license.
*/
//Run callback when Sidecar metadata is fully initialized
app.events.on('app:sync:complete', function(){
// localStorage.setItem('prod:SugarCRM:1:last-state:Accounts:default:hide', '1');
//When a record layout is loaded...
concat(related($pca_pack_com_ag_accounts,"name")," ",related($pca_pack_com_ag_accounts,"billing_address_city")," ",toString(concat(subStr(toString($v_date_visite),8,2),"/",subStr(toString($v_date_visite),5,2),"/",subStr(toString($v_date_visite),0,4))))
<?php
// created: 2016-03-08 14:50:30
//attempt repair
$sq = new SugarQuery();
$sq->select(array('id','name'));
$sq->from(BeanFactory::getBean('DP_actco'));
$result = $sq->execute();
@cAstraea
cAstraea / Visite_Hook.php
Last active March 21, 2016 10:26
update dropdown list with option from module, after_save and after_delete logic hook
<?php
if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('include/entryPoint.php');
require_once('modules/Administration/QuickRepairAndRebuild.php');
class Visite_Hook
{
function update_self($bean, $event, $arguments)
{
@cAstraea
cAstraea / record.js or create-actions.js
Last active April 14, 2016 15:48
Typeahead for previously used values for sugarcrm fields using localstorage
({ extendsFrom: 'RecordView', // extendsFrom: 'CreateView',
myEvents: {
'focusin [name=ca_autocompl_c]': 'typeahead',
},
initialize: function(options) {
this._super('initialize', [options]);