Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Tuesday, December 31, 2019

My new blog

My name is Ken Brill.  I live in central Missouri about 100 miles south of St. Louis. My wife and I run a small 30-acre hobby farm here in Missouri, and I work as a developer from a small, dark corner in my basement.  Out here we only have satellite Internet (Viasat) so that's fun.  They advertise 25Mbs but I rarely see anything better than 12Mbs.  It does the job but I miss my cable modem sometimes.

On the farm, we raise about a dozen goats and sheep, 2 cows, 3 horses, 7 dogs (ranging from a Chihuahua and Maltese to a pair of Great Pyrenees, 6 cats of no discernible use, 4 kids (all girls), and a few dozen Chickens, Guinea fowl, Peacocks, Turkeys, and Ducks.  We have been at it for 5 years now so we are still learning but it's a lot of fun when it's not freezing outside.




The last 12 years I have specialized in SugarCRM.  I began with version 2.5 when a small company I worked for started using it and I have been working on SugarCRM ever since.  I had my own consulting company for a few years where I sold a product called 'Sugar Fully Loaded' that was essentially the SugarCRM CE product with several popular add-ons already loaded and merged (no such thing as upgrade-safe back then).  I spent 9 years after that working at SugarCRM in different roles and now I work remotely as a senior developer on an enterprise level installation and we are getting ready to roll out version 7.10 next year.

Wednesday, March 27, 2019

Adding Audit Logs to Reports

My users had a need to query the audit log for various modules in ways that the current built in system would not allow.  Now I could create advanced report after advanced report but really I hate making advanced reports. So I added myself a JIRA task to create some way of reporting on the Audit Logs.

All the files are available for download from the GitHUB link at the end of this post.

This was my list of criteria for this project
  1. I need a way to report on any modules audit log
  2. I need a way that allows a manager to create their own reports
  3. That method has to be familiar to them already (this was really me saying I wanted it in the Reports module)
  4. It must not allow editing of Audit Logs in any way
  5. It must be fast over millions of records (some of our audit logs are huge)
  6. It must translate all the raw data back into English
  7. It must allow our system admins to include that new audit_events table data in the reports
  8. It cant break the current Audit code

Sunday, January 28, 2018

Developer Centric Logging

A few weeks ago I wrote some posts about overriding the CRON handler and I showed code about Developer Communication.   Since then I have talked to a few people and they all wanted to know what that cryptic function call did so I thought I would look into releasing it.   When I looked at the code I realized that I could not release it as it was crap.  So I took a week and rewrote it into this.  What we have here is a custom logger.  I found scant few examples of custom loggers on the internet so I hope someone finds this useful.

I think it adds all the missing pieces into SugarCRM's SugarLogger function like timers, headers, line tracing, email, and notifications.

Friday, January 19, 2018

Use Rows & Columns reports in Dashlets



I have been thinking about this dashlet for about 7 years.  Its been on my 'to-do' list for probably 4 years.  It found its way to the top of that list January 1st.  I finally coded it this week.  I have been dreading it, the Reports module can be difficult to decode let alone customize.  But, after all of that it was far easier than I had imagined.  I really only had 3 issues.

Sunday, January 14, 2018

Overriding MysqliManager.php

Overriding the stock SQL Managers


It took me a while to figure out how to override the core MysqliManager class so that I could add some code to email me the SQL errors that usually just go to my logs.  At first I tried just creating the custom file, expecting it to be read like others I had created, but I found that you actually  have to tell the system to use your custom class in the config_override.php file like this

Adding custom, global, upgrade-safe PHP functions to SugarCRM

PHP Functions
This falls into the category of hard to find.  It is clearly outlined in the SugarCRM Developers Guide but I have never seen anyone use it.  There were no postings on the message boards about it and I simply stumbled upon it one day.  I wanted to consolidate some code written by others, there were functions that were repeated over and over again in module after module.  So I wanted to find a way to easily move these functions into someplace that was shareable by all modules and was upgrade safe.

Add a JQuery plugin style to a SugarCRM field - Checkboxes to Switchery

Switchery
This is the first in a series where I will show ways to add JQuery custom UI elements to SugarCRM views.   This is fairly easy to do for most JQuery plugins.



In this post we are going to use Switchery.  This JQuery plugin will convert normal checkboxes to iOS style buttons as shown above.   It has a few options but in this first part we are just going to stick to the defaults.  First we have to get the plugin loading into SugarCRM.  We could use the JS loader plugin they released a while back but I had issues with that loading the script multiple times so we are going to stick to the tried and true JSGroupings for this one.