Skip to content

Instantly share code, notes, and snippets.

View joebordes's full-sized avatar

Joe Bordes joebordes

View GitHub Profile
@joebordes
joebordes / LayoutEditorSequenceInformation.diff
Created March 26, 2018 13:56
Show sequence information of blocks and fields in Layout Editor
diff --git a/Smarty/templates/Settings/LayoutBlockEntries.tpl b/Smarty/templates/Settings/LayoutBlockEntries.tpl
index 7f4fbf7..5c7900c 100644
--- a/Smarty/templates/Settings/LayoutBlockEntries.tpl
+++ b/Smarty/templates/Settings/LayoutBlockEntries.tpl
@@ -257,6 +257,7 @@
<img src="{'arrow_up.png'|@vtiger_imageurl:$THEME}" border="0" style="cursor:pointer;" onclick="changeBlockorder('block_up','{$entries.tabid}','{$entries.blockid}','{$MODULE}') " alt="{$MOD.
<img src="{'arrow_down.png'|@vtiger_imageurl:$THEME}" border="0" style="cursor:pointer;" onclick="changeBlockorder('block_down','{$entries.tabid}','{$entries.blockid}','{$MODULE}') " alt="{$
{/if}
+ <span style="font-size: smaller">({$entries.sequence})</span>
</td>
@joebordes
joebordes / execwf.php
Created December 14, 2018 09:40
Force events and workflow on records
<?php
// Turn on debugging level
$Vtiger_Utils_Log = true;
include_once 'vtlib/Vtiger/Module.php';
error_reporting(E_ALL);
ini_set('display_errors', 'on');
$usr = new Users();
$current_user = Users::getActiveAdminUser();
@joebordes
joebordes / wsinit.php
Created July 31, 2019 11:12
Initialize webservice on module
<?php
// Turn on debugging level
$Vtiger_Utils_Log = true;
include_once 'vtlib/Vtiger/Module.php';
error_reporting(E_ALL);
ini_set('display_errors', 'on');
$usr = new Users();
$current_user = Users::getActiveAdminUser();
@joebordes
joebordes / addfilestophar.md
Last active September 1, 2019 23:23
Add files to an executable phar: phpcs security rules
  • Create a temporary directory
  • Copy the phar file you want to add the files to cp /home/joe/bin/phpcs73.phar .
  • create another temporary directory mkdir k
  • copy inside the structure you want to have in the phar. For example, inside the phpcs73.phar file there is a structure like this: src/Standards/ (you can see the contents and structure of your phar with phar list -f file.phar and I want to copy the new rules inside that directory so I create k/src/Standards/Security
@joebordes
joebordes / dbuser.md
Created October 6, 2019 11:23
Add MySQL/PGSQL DB user

MYSQL

  • create user 'username'@'localhost' identified by 'user-password';
  • create database dbname;
  • grant all privileges on dbname.* to 'username'@'localhost';
  • flush privileges;

PSQL

  • sudo --login --user postgres
### Create user for process
adduser --system --shell /bin/bash --gecos 'Desc of process' --group --disabled-password --home /home/$USER $USER
### add user to group
usermod -aG docker $USER
### Create docker-compose file
su - %USER
create and test docker-compose.yml
diff --git a/actions/websocket_actions.test.jsx b/actions/websocket_actions.test.jsx
index 15925cb9e..e3cd431d2 100644
--- a/actions/websocket_actions.test.jsx
+++ b/actions/websocket_actions.test.jsx
@@ -565,7 +565,7 @@ describe('handlePluginEnabled/handlePluginDisabled', () => {
// Pretend to be a browser, invoke onload
mockScript.onload();
- expect(initialize).toHaveBeenCalledWith(expect.anything(), store);
+ expect(initialize).toHaveBeenCalledWith(expect.anything(), store, browserHistory);
@joebordes
joebordes / integromat.diff
Created May 14, 2020 13:00
coreBOS change to work with integromat
diff --git a/include/Webservices/OperationManager.php b/include/Webservices/OperationManager.php
index 7fd3dd8..d9b0732 100644
--- a/include/Webservices/OperationManager.php
+++ b/include/Webservices/OperationManager.php
@@ -91,6 +91,7 @@ class OperationManager {
public function getOperationInput() {
$type = strtolower($this->type);
+ $type='request';
switch ($type) {
@joebordes
joebordes / BusinessQuestion.csv
Last active May 14, 2020 20:59
react mermaid corebos question
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
"Name Text","Question No","Type","Status","SQL Query","Collection","Module","Page Size","Assigned To","Created By","Created Time","Modified Time","Columns","Condition","Description","Order by Column","Group by Column","Type Properties","Main Table Alias","Unique ID Field","Materialized View Cron","Map Id","Materialized View Workflow","Conditions in Filter Format","CRM Entity Alias","Update View when Related Changes","Related Module List","Unique Identifier"
"mm2","cbQ-0000002","Mermaid","Active","0","","Potentials","0.00","admin","admin","2020-01-10 17:14:28","2020-05-12 23:22:06","A(( )) -->|contrat| B
B(( )) -->|Avenants| C(( ))
C(( )) -->|en cours| H
D(( )) -->|Terrain| E
E(( )) -->|Etudes| C(( ))
F(( )) -->|Plans| G
G(( )) -->|Métrés| C(( ))
H((VT)) -->|""Control<br>Dossier""| I(( ))
I(( )) -->|""Control<br>Prix""| J
@joebordes
joebordes / BusinessQuestion.csv
Last active May 14, 2020 21:42
react number corebos question
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
"Name Text","Question No","Type","Status","SQL Query","Collection","Module","Page Size","Assigned To","Created By","Created Time","Modified Time","Columns","Condition","Description","Order by Column","Group by Column","Type Properties","Main Table Alias","Unique ID Field","Materialized View Cron","Map Id","Materialized View Workflow","Conditions in Filter Format","CRM Entity Alias","Update View when Related Changes","Related Module List","Unique Identifier"
"filter test2","cbQ-0000005","Number","Active","0","","Quotes","0.00","admin","admin","2020-04-19 15:06:03","2020-04-19 15:15:05","[{""fieldname"":""pl_gross_total"",""operation"":""is"",""value"":""round(sum(pl_gross_total), 2)"",""valuetype"":""expression"",""joincondition"":""sum"",""groupid"":0,""groupjoin"":""pl_gross_total""}]","[{""fieldname"":""subject"",""operation"":""contains"",""value"":""an"",""valuetype"":""rawtext"",""joincondition"":""or"",""groupid"":""0"",""groupjoin"":""""},{""fieldname"":""pl_gross_total"",""operation"":""greater than""