Skip to content

Instantly share code, notes, and snippets.

@tortugacrm
tortugacrm / unlink-action.js
Last active August 29, 2015 14:20
Sugar 7 - customized unlink-action.js
@tortugacrm
tortugacrm / delete_contacts.php
Created July 31, 2014 08:15
This script will delete all the contacts in a Sugar 7 instance (REST API v10)
<?php
// http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_7.2/70_API/Web_Services/20_Examples/v10/module_filter_GET/
$base_url = "https://{instance url}/rest/v10";
$username = "admin";
$password = "****";
/**
* Generic function to make cURL request.
* @param $url - The URL route to use.
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
class WorldCup14Api extends SugarApi
{
public function registerApiRest()
{
return array(
'GetScoresEndpoint' => array(
<?php
$manifest = array (
'acceptable_sugar_versions' =>
array(
'regex_matches' => array(
'7\\.[0-9]\\.[0-9]$'
),
),
<?php
$app_strings['LBL_DASHLET_WORLDCUP14'] = 'Football World Cup 2014';
$app_strings['LBL_DASHLET_WC14_DESC'] = 'Football World Cup results per day or team';
$app_strings['LBL_DASHLET_WC14_TODAYTEAM'] = 'What do you want to see?';
$app_strings['LBL_DASHLET_WC14_FAVTEAM'] = 'My Favorite team is';
$app_strings['LBL_DASHLET_WC14_LOCALTIME'] = 'locale time';
$app_list_strings['DASHLET_WC14_list']=array (
'today' => 'Today\'s matches live scores',
'team' => 'See my favorite team\'s scores',
<div style="background-image: url('custom/clients/base/views/worldcup14/media/wc2014.png'); background-repeat: no-repeat; background-position: right top;">
{{#if this}}
{{#each this}}
{{#if this.home_team.country}}
<div class="news-article">
<p><img src="{{{this.url}}}custom/clients/base/views/worldcup14/media/flags/{{{this.home_team.code}}}.png" border="0" />
<b>{{{this.home_team.country}}}</b> vs <b>{{{this.away_team.country}}}</b>
<img src="{{{this.url}}}custom/clients/base/views/worldcup14/media/flags/{{{this.away_team.code}}}.png" border="0" />
<br/>
{{{this.home_team.goals}}} - {{{this.away_team.goals}}}&nbsp;
({
plugins: ['Dashlet'],
initDashlet: function () {
if (this.meta.config) {
var team = this.settings.get("team") || "FRA";
this.settings.set("team", team);
var todayorteam = this.settings.get("todayorteam") || "team";
this.settings.set("todayorteam", todayorteam);
}
//this.model.on("change:name", this.loadData, this);
@tortugacrm
tortugacrm / worldcup14.php
Last active August 29, 2015 14:03
Sugar 7 Football Worldcup 2014 Dashlet
<?php
if(!defined('sugarEntry'))define('sugarEntry', true);
$viewdefs['base']['view']['worldcup14'] = array(
'dashlets' => array(
array(
'label' => 'LBL_DASHLET_WORLDCUP14',
'description' => 'LBL_DASHLET_WC14_DESC',
'config' => array(
'todayorteam' => '-1',
'team' => '14',