Skip to content

Instantly share code, notes, and snippets.

<?php
require_once('include/MVC/View/views/view.list.php');
class CustomAccountsViewList extends ViewList
{
/**
* @see ViewList::preDisplay()
*/
public function preDisplay()
<?php
class CustomAccountsController extends SugarController
{
public function action_displaypassedids() {
if ( !empty($_REQUEST['uid']) ) {
$recordIds = explode(',',$_REQUEST['uid']);
foreach ( $recordIds as $recordId ) {
$bean = SugarModule::get($_REQUEST['module'])->loadBean();
$bean->retrieve($recordId);
@sukum
sukum / gist:6991293
Last active December 25, 2015 14:29 — forked from jmertic/gist:6294266
Silent install a module loadable package from the command line
#!/usr/bin/env php
<?php
function usage()
{
print("usage: -i /path/to/instance -p /path/to/expanded/module -z /path/to/zipfile\n");
exit(1);
}
$opts = getopt('i:p:z:');
@sukum
sukum / gist:a33032a3e11d33f89468
Created May 23, 2015 11:50 — forked from jmertic/gist:6294266
Silent install a module loadable package from the command line
#!/usr/bin/env php
<?php
function usage()
{
print("usage: -i /path/to/instance -p /path/to/expanded/module -z /path/to/zipfile\n");
exit(1);
}
$opts = getopt('i:p:z:');
@sukum
sukum / config_si.php
Last active September 14, 2021 11:28 — forked from chicks/config_si.php
[Silent install SugarCRM / SuiteCRM] #sugarcrm #suitecrm #install #silent Silent install config_si.php file for SuiteCRM and SugarCRM
<?php
$sugar_config_si = array(
'setup_db_host_name' => 'localhost',
'setup_db_sugarsales_user' => 'sugarcrm', //comment to use existing user
'setup_db_sugarsales_password' => 'DB_USER_PASSWORD', //comment to use existing user
'setup_db_database_name' => 'sugarcrm',
'setup_db_type' => 'mysql',
'setup_db_pop_demo_data' => false,
// create the database
@sukum
sukum / OpportunitiesForCaseLink.php
Last active October 30, 2015 06:53 — forked from dranney-sugarcrm/OpportunitiesForCaseLink.php
Create the basic Link2 override class
/* Creates an alert pop-up with the message 'Foo' */
YAHOO.SUGAR.MessageBox.show({msg: 'Foo'} );
/* Creates an alert pop-up with the message 'Foo' and title 'Bar' */
YAHOO.SUGAR.MessageBox.show({msg: 'Foo', title: 'Bar'} );
/* Creates a confirm pop-up with the message 'Foo' and title 'Bar' that does a particular action on callback based upon the button clicked */
YAHOO.SUGAR.MessageBox.show({msg: 'Foo', title: 'Bar', type: 'confirm',
fn: function(confirm) {
if (confirm == 'yes') {
//do something if 'Yes' was clicked
}
@sukum
sukum / backup.php
Last active June 25, 2016 07:49 — forked from toddsby/backup.php
backup.php
<?php
/*
* PHP: Recursively Backup Files & Folders to ZIP-File
* (c) 2012-2014: Marvin Menzerath - http://menzerath.eu
* contribution: Drew Toddsby
* contribution: sukum, http://stackoverflow.com/questions/15369291/how-to-ignore-directories-using-recursiveiteratoriterator
*/
// Make sure the script can handle large folders/files
ini_set('max_execution_time', 600);
@sukum
sukum / start-stop-example.sh
Last active October 16, 2019 00:51 — forked from alobato/start-stop-example.sh
[start-stop-example] #linux #service #shell #debian
#!/bin/sh
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
set -e
# Must be a valid filename
NAME=foo
PIDFILE=/var/run/$NAME.pid
#This is the command to be run, give the full pathname
DAEMON=/usr/local/bin/bar
@sukum
sukum / mwan-config.sh
Created September 9, 2019 14:11 — forked from braian87b/mwan-config.sh
/etc/config/mwan
# My documentation:
#
# Important: this works well on OpenWRT 15.05.1, on newer versions there was some breaking changes, for example, the wan ifaces have ipv6 capability and now are named with letters ("wan, wanb... , wanc" instead of "wan, wan2... wan3" so wanb6 means 2nd wan ipv6.): https://github.com/openwrt/packages/blob/master/net/mwan3/files/etc/config/mwan3
#
# We have Interfaces, Members, Policyes y Rules:
#
# Interfaces: Allows to identify the wan interface, we just need to have it enabled`
# the others parameters are only to track if the interface it is up or down.
#
# Members: Can be defined in some metric and weight, both values will be important ambos when used in policyes.