Skip to content

Instantly share code, notes, and snippets.

View pgorod's full-sized avatar

pgorod

View GitHub Profile
@pgorod
pgorod / gist:c535ba65ee81e1e9893d90097a899236
Created March 28, 2018 08:49
Populate a dropdown from the database (SuiteCRM)
https://web.archive.org/web/20140116145925/http://www.eggsurplus.com/home/content/populate-a-dropdown-from-the-database/
Dumps backtrace into log, with chronological order
Call with
$GLOBALS['log']->debug(generateCallTrace());
----------------
function generateCallTrace()
{
@pgorod
pgorod / Fix "selected" in Listviews, SuiteR
Created October 10, 2017 14:59
Fix "selected" in Listviews, SuiteR
jssource/src_files/include/javascript/sugar_3.js
Line 2432
sugarListView.prototype.toggleSelected = function () {
var numSelected = sugarListView.get_num_selected();
var selectedRecords = document.getElementById("selectedRecordsTop");
var selectActions = document.getElementById("selectActions");
var selectActionsDisabled = document.getElementById("selectActionsDisabled");
@pgorod
pgorod / gist:5de7c6f8d37413654b16e06668d7e1b1
Last active February 12, 2024 19:36 — forked from jmertic/gist:3684156
HOWTO: Adding your own ListView action items - Part 1
<?php
require_once('include/MVC/View/views/view.list.php');
class CustomAccountsViewList extends ViewList
{
/**
* @see ViewList::preDisplay()
*/
public function preDisplay()
@pgorod
pgorod / gist:c838f258fadf9528b61183e763e978a8
Last active October 8, 2017 18:11 — forked from jmertic/gist:3684162
HOWTO: Adding your own ListView action items - Part 2
<?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);
@pgorod
pgorod / backup_github_issues.sh
Last active October 5, 2024 11:09 — forked from bojanpopic/backup_github_issues.sh
A (dirty) bash script that will backup issues from the GitHub repo using API. It takes pagination into consideration. Originally created by @boombatower, improved by @bojanpopic, them improved by me to handle number of pages automatically.
#!/bin/bash
# based on the script by Bojan Popic https://gist.github.com/bojanpopic/2c3025d2952844de1dd0
# Gets all issues form a repo. Since Pull Requests are also Issues in Github internally, these are also included.
repo="organization/repoName" # put the name of the repo here. Usually it is like this: organization/repo-na$
username="myuser" # your github username
password="mypassword" # your github password
# this script can be used on public repos with any user's credentials, you don't have to own the repo!