Skip to content

Instantly share code, notes, and snippets.

View Kobedinho's full-sized avatar
🏠
Working from home 💯

Obed Kobedinho

🏠
Working from home 💯
View GitHub Profile
@Kobedinho
Kobedinho / Sugarcrm vagrant xdebug.md
Created October 18, 2022 17:27
[Sugarcrm vagrant box (sugarcrm/php80es716)] #xdebug #vagrant #vscode #sugarcrm

Sugarcrm vagrant xdebug.md

  • tested with vagrant box: sugarcrm/php80es716

File (inside vagrant): /etc/php/8.0/cli/conf.d/20-xdebug.ini

zend_extension=xdebug.so
xdebug.mode=debug
xdebug.start_with_request=yes

#your host ip Not the vagrant ip address
@Kobedinho
Kobedinho / Load custom create view from selection view
Last active September 6, 2019 18:36
When users create records from selection view, the drawer load the create-nodupecheck view so if you have a custom create view you need to change the create-nodupecheck view to extends the custom view instead of base view
// Example to extends the custom create view instead of the base create view
// Path : custom/modules/<module>/clients/base/views/create-nodupecheck/create-nodupecheck.js
({
// syntax to custom views: <module>CustomCreateView
// syntax to base views: CreateView
extendsFrom: 'ContactsCustomCreateView',
initialize: function(options) {
this._super("initialize", [options]);
this.enableDuplicateCheck = false;
// file: custom/modules/<module>/clients/base/views/supanel-list/supanel-list.php
<?php
$viewdefs['Calls']['base']['view']['subpanel-list'] = array(
'template' => 'flex-list',
'favorite' => true,
'rowactions' => array(
'actions' => array(
array(
'type' => 'rowaction',
'css_class' => 'btn',
@Kobedinho
Kobedinho / custom_readonly_fields_logic.php
Last active January 12, 2017 19:51
read only fields with dependencies, put the following code in: /custom/Extension/modules/<module>/Ext/Dependencies/custom_readonly_fields_logic.php
<?php
// Documentation.- http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.7/Architecture/Sugar_Logic/Dependency_Actions/
$dependencies['Meetings']['readonly_fields'] = array(
'hooks' => array("edit"), // values : "edit", "view", "save" and "all"
'trigger' => 'equal($status,"Held")', //Optional, the trigger for the dependency. Defaults to 'true'.
'triggerFields' => array('status'), // The list of fields to watch for change events. When changed, the trigger expressions will be recalculated.
'onload' => true, // Whether or not to trigger the dependencies when the page is loaded.
//Actions is a list of actions to fire when the trigger is true
// You could list multiple fields here each in their own array under 'actions'
'actions' => array(
@Kobedinho
Kobedinho / post_install.php
Last active November 9, 2016 17:54
package to create dropdown list
<?php
require_once ('modules/ModuleBuilder/MB/ModuleBuilder.php') ;
require_once('modules/ModuleBuilder/parsers/parser.dropdown.php');
function post_install()
{
global $app_list_strings, $current_language;
// dropdown list definition
$dropdownLists = array (
array (
"name" => "listName",
@Kobedinho
Kobedinho / <view>.hbs
Last active March 4, 2016 22:45
Custom view - Handelbars partials - Handlebars.registerPartial - app.template
<!-- File : custom/modules/QS_Promociones/clients/base/views/promotion-configurator/promotion-configurator.hbs-->
...
<div class="row-fluid" id="accounts_content">
<!-- loading partial -->
{{> account_filter}}
</div>
...
@Kobedinho
Kobedinho / gist:09075749739c9657b92f
Created November 27, 2014 18:26
script para agregar campo autoincremental a una tabla existente (multiples campos autonumericos)
// esta funcion se ejecuta mediante un paquete
function post_install()
{
global $db;
$query = "ALTER TABLE table_name MODIFY COLUMN table_column int(11) auto_increment NOT NULL, ADD KEY(table_column);";
$res = $db->query($query);
echo "---- Terminando ----";
}