Skip to content

Instantly share code, notes, and snippets.

View cAstraea's full-sized avatar

cAstraea

View GitHub Profile
@cAstraea
cAstraea / dx.web.frca.js
Last active October 28, 2016 07:44
devexpress french dxgrid translation
/*!
* DevExtreme Web
* Version: 16.1.4
* Build date: Jun 22, 2016
*
* Copyright (c) 2012 - 2016 Developer Express Inc. ALL RIGHTS RESERVED
* EULA: https://www.devexpress.com/Support/EULAs/DevExtreme.xml
*/
(function(root, factory) {
$("#{{ target }}").dxSelectBox({
items: itemsArrayforSelectBox,
onValueChanged: function (e) {
swal({
title: "Are you sure?",
text: "Deleting !",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, change it!",
@cAstraea
cAstraea / dxgrid.js
Created June 10, 2016 11:06
adding button after export button of dxgrid
onContentReady: function() {
var $addButton = $('#add');
console.log(SearchFiltersSKZ);
if(! $addButton.length ) //
{
$( '<div id="add" aria-label="edit-button-addrow" role="button" onclick="void(0)" tabindex="0" title="Add a row" class="dx-edit-button dx-datagrid-addrow-button dx-widget dx-button-has-icon dx-button dx-button-normal"><div class="dx-button-content"><i class="dx-icon dx-icon-edit-button-addrow"></i></div></div>' ).insertAfter('.dx-datagrid-export-button');
Feature: Login
In order to gain access to the skoazell interface
As a web user
I need to login
@javascript
Scenario: Loggin in with correct username and password
Given I am on "/"
When I fill in "form-_username" with "admin@gmail.com"
When I fill in "form-_password" with "123"
@cAstraea
cAstraea / record.js
Created April 22, 2016 10:45
Updates field in Account module from module B. [ Module Accounts <-> Module B in a 1-n relationship ]
({ extendsFrom: 'RecordView', // extendsFrom: 'CreateView',
initialize: function(options) {
this._super('initialize', [options]);
this.model.on('sync', this.UpdateDateVisite, this);
},
UpdateDateVisite : function() {
@cAstraea
cAstraea / record.js
Created April 19, 2016 11:27
muli select deps sugarcrm
({ extendsFrom: 'RecordView',
initialize: function(options) {
this._super('initialize', [options]);
this.on("render", this.displayFunction, this);//launch it whenever your page is rendered
this.model.on("change:objectifs_c",this.displayFunction, this);//display changes when the multi select changes for visite objectifs
this.model.on("change:phonobjectif_c",this.displayFunction, this);
this.model.on("change:actioncoobjectif_c",this.displayFunction, this);
},
.ui-autocomplete {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
_width: 160px;
padding: 4px 0;
@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]);
@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)
{
<?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();