Sugar Developer Blog

Syndicate content
Weblog for the Sugar Developer community
Updated: 44 min 58 sec ago

Version 5.5.1 – Release Candidate 3 Available!

15 hours 17 min ago


The third Release Candidate (RC) of Sugar CE 5.5.1 is now available to test.

Preview Sugar 5.5.1 RC 3 Now!

Download the Sugar CE 5.5.1 RC 3

Upgrade files are available! We recommend running a test upgrade from your version of Sugar to 5.5.1 RC 3 on a copy of your production instance (such as a development instance). Upgrade files from the 5.5.1 RC 3 to the final Generally Available (GA) release will be provided at the time of release of the GA.

While running Sugar 5.5.1 RC 3, if you encounter any issues, please let us know by submitting a bug in the Bug Tracker. Be sure to designate “5.5.1-RC3″ in the “Found in Release” field. You can also use the Sugar 5.5.1 forums to discuss your experience.

A listing of the bugs and features addressed in Sugar 5.5.1 RC 3 can be found in the Bug Tracker.

Details about the new and enhanced features can be found in this forum thread and in the Release Notes, which are posted in the Documentation area on sugarcrm.com.

Please check the release schedule for updates regarding the GA release. this thread.

Ken’s Linux Desktop Project

Tue, 03/09/2010 - 12:00

About 2 years ago now I converted from using Windows XP to Ubuntu Linux on my laptop full time.  I had tried to do this before with Redhat and then SUSE but I never got an installation that could handle everything I needed to do, there was always something I had to go back to Windows for.  With the release of Ubuntu 9.10 last October, I have finally done away with the Windows partition completely.  It was only around to run the Outlook Plugin and the Off-Line Client before that anyway, so it was not that hard.  I still have several Windows VMs but my hard drive is all Linux now.  Now I am not saying that Ubuntu brings Linux to some sort of operating system apotheosis, but at this point in time (March 2010) and for my needs it is the equal of Windows in all the important areas.

I am currently on my 4th full install of Ubuntu (version 9.10), each time I learned lessons that I applied to the next install and this install is working out very well for me.  It boots in around 20 seconds from power up to network ready, it runs for weeks at a time without a reboot, it supports my graphic card, sound card, network card, Bluetooth, USB 2.0 and every other piece of hardware in my laptop.

I have nothing against Windows, I still have a Windows machine in the house.  It has it’s place even for “Power Users”.  But there are a certain subset of Power Users that find that Linux offers more of that “Power” experience than Windows or Mac does.  When I first started programming computers it was an adventure.  We had 5K or 16K, maybe, to fit everything into, code and data, and you had to find ways to bend the hardware to your needs.  You had to find out how things worked and why the worked and then maybe roll your own software to make it do what you needed it to do.  I remember once programming a side scrolling space game on my Vic20 and my brother and I found that instead of wasting memory on bitmaps of rocks flying through space we would just grab a random group of bytes from memory and render them on the screen.  The bytes that were grabbed almost always rendered into a jagged little rocks and saved 60-70 bytes of ram.  Linux still allows that kind of experience, allows not requires mind you.  Windows (and Mac as well) are more of a polished, sterile experience to me.  Not bad just not adventurous.

Linux has a couple dozen different window managers to choose from and at least 4 different desktop managers to fit underneath them.  If you don’t like your Linux desktop then you can change it in fundamental ways.  If you don’t like your Windows desktop there are some tweaks you can use and maybe a third party program you can buy to show you those tweaks but essentially you are stuck with what you get.  With Windows you get to use NTFS as your file system.  On Linux there are a wide variety of file systems, even encrypted filesystems,  that each have different strengths depending on what you store on your hard drive.  You can customize as much or as little as you want and it’s all free.

Window/Mac on the other hand have one window manager and one desktop manager.  You get  basically the same experience as every other Windows user whether you like it or not.  Of course, at least in Windows, you can purchase third party addons that can change the window manager but for most people there is little more than themes to play with.  There is one filesystem for Windows, NTFS.  Which while better than FAT32, is still a behemoth on resources.  I have done a hundred different benchmarks and ext4 eats NTFS for lunch in almost every category.  The MFT is a great idea for large files but small, often changed files suffer and SugarCRM is nothing but thousands of small files.  Throw SVN into the mix and it grinds to a halt.  On windows it can take most of, if not more than, 1 minute to unzip SugarCRM.  On my linux box it rarely takes more than 4-5 seconds.  Lastly, there is the cost, my neighbor who has 4 computers will have to lay out more than $350 to upgrade to Windows 7.  That doesn’t include the cost of upgrading his aging OfficeXP or any hardware upgrades he is going to need.  Admittedly Windows 7 is lighter on the hardware than Vista was so that last one might not be so bad

So I am going to write a bit about my experience, how I got from there to here and what I learned along the way.  I might even mention SugarCRM once in a while.

I thought I would start with some mythbusting (more or less) some old truths

  1. Linux won’t support my hardware
    • This might have been true and may still be true on some hardware.  I have loaded Ubuntu on dozens of desktops and laptops and have found that only video cards really cause any issues.  Nvidia and ATI video cards are almost all supported though and that accounts for most of the video cards out there.
    • Ubuntu even found my wireless network and bluetooth during install, a task that required a driver disk when installing Windows Vista on the same hardware.
    • I plugged my wife’s kodak camera into my USB port and the OS saw the camera and loaded a program to pull pictures off of it.  Same with her no-name brand MP3 player.  From what I understand iPods need not apply but other than that, everything worked just as well as it had in Windows.
    • Ubuntu even loaded my networked printer without a driver disk, my USB headphones worked first time, it was great.
  2. I won’t know how to do things
    • If you take the standard options during install, what you will get will be very Windows-like.  This is no accident.  Browsing the web and Email will be very familiar to you.
    • There will be a little learning curve of course but it is not very steep at all.
  3. I won’t be able to run the apps I need
    • This might also be true.  I am a programmer most of the time.  The vendor I bought my programming environment from (Zend) had a Linux version.  OpenOffice is my MSOffice replacement and it does everything I need (even has a SugarCRM plugin for the word processor to generate mail merges), Firefox has a Linux version, Thunderbird is very Outlook-ish and so forth.
    • For HTML editing I could use a Linux program like Bluefish or one of a dozen others but I learned Macromedia DreamWeaver a long time ago and own it (version and I love it.  It runs great in Linux using a program called Wine.  It allows many windows apps to run nativity under Linux.  I also run Macromedia Flash 8, WinMerge and PaintShop Pro under Wine and they all work fine.  From what I understand MSOffice runs fine under Wine although I have not tried that myself.
    • For email I run Thunderbird3.  It has everything I need (complex filters & spam-handling) and loads in seconds instead of a few minutes as my Outlook used to do.  The searches (even the advanced ones) are about 10x faster as well.
    • I use Clam Anti-virus and they make a Windows and Linux version.
  4. You have to compile everything you want to install or it’s hard to install new software
    • I have not compiled anything with this install, or the two or three that preceded it.  Nothing
    • There is a package manager that downloads and installs just about any program you could need, most others install much the same and on Windows.  Once programs are loaded this package manager also makes sure you are up to date and if a newer version comes out it alerts you and lets you update it.  Something that Windows doesn’t do for the most part and when it does it does it in a hundred little taskbar apps that sit there and suck memory.
    • Don’t get me wrong, there is plenty out there to compile. If you are adventurous it might be the way to go.
  5. I wont be supported
    • Are you supported now? If something goes wrong in windows do you call Microsoft?
    • I have a Dell laptop and they don’t even ask what the OS is. So far I have gotten excellent hardware support when something has gone wrong.
    • There are dozens of forums and most all real IT people are comfortable in Linux at least enough to fix software issues.
    • You can even pay for support if you want.

Next I will write a few posts going over the lessons I have learned from past installs, what choices I made and why and things like that.

SugarCRM HTML Editor Custom Field

Sat, 03/06/2010 - 23:04

In this entry we are going to look at a new custom field, an HTML editor field, and instead of the broad overview that we did with the Masked Input field we are going to focus on one of the two parts that make up a custom field. Again, the source code for this project is at the bottom of this post.  In this case we are going to focus on the code that actually draws the field on the view (Editiew, DetailView and so on). The HTML Editor (SugarCRM Uses a Javascript library called TinyMCE for it’s HTML editor) is a complex field to render and it really uses the template part of the custom field to it’s fullest, so it will be a great example. Now I am sure there are several ways to code this and mine might not be the very best, but it works and it’s small so it’s good enough in my book.

So this custom field follows Masked Input in format, it has all the same files but we are going to look at only 5 of them in this post.

custom/include/SugarFields/Fields/Htmleditor/EditView.tpl
custom/include/SugarFields/Fields/Htmleditor/WirelessEditView.tpl
custom/include/SugarFields/Fields/Htmleditor/WirelessDetailView.tpl
custom/include/SugarFields/Fields/Htmleditor/SugarFieldHtmleditor.php
custom/include/SugarFields/Fields/Htmleditor/DetailView.tpl

These five files are responsible for putting each instance of the HTML Editor on the view. These files are ONLY run when the cached TPL file needs to be created NOT every time the view is drawn. So if you run a Quick Repair and Rebuild, the next time a view with an HTML Editor field on it is drawn these files will be run to create the cached TPL file. This, of course, would change if you are in Developer Mode. In Addition to all of that, it is possible that there would be more than 5 files here as there were for the Masked Input field, but you really only need to define the views where your field would differ from the stock presentation. So, lets start with SugarFieldHtmleditor.php. This is the file that calls the appropiate TPL when it is time to render the field onto the cached TPL.

SugarFieldHtmleditor.php

OK, first notice the capitolization on the class name, it is required that you follow the standard for naming your field as stated in the Developers guide. The first two functions in the class, “getDetailViewSmarty” and “getEditViewSmarty” are called to create the field on the appropriate view’s TPL. For the DetailView I just used the standard code as I don’t really need to reformat anything. You cannot reformat the value here as this function will only get run once to create the cached TPL file, once that TPL file is created this function is not called again. So I reformat the HTML in the actual DetailView.tpl file. We will examine that later. For the Editiew I customized the code to create the instance of the TimeMCE editor. I load and instantiate the class “SugarTimeMCE()” (the SuagrCRM loader file for the TimeMCE class), then feed it some parameters like size and a unique ID so that mutliple HTML Editors can exist on the page. Then, with the “$tinyMCE->getInstance($id);” command I get the JavaScript that will initialize the TinyMCE editor on the View. From there I add the TinyMCE code to the $vardef array and set it all off to the parser in the Setup function.  We will see how this data gets onto the View in the next section.

The next function “getVardefValue()” simply returns a value to display in this field.  If there is not data in the field then it adds the default.  Now in this field there is no default value so really this function is unneeded but I always include it anyway.

The last function is the “save()” function.  This function gets called when a EditView is submitted for saving.  In this code I run the HTML that was typed into the HTMP Editor through a few scrubbing routines before it is sent off to the database.  The first function is $tinyMCE->cleanEncodedMCEHtml() and this just removes any TinyMCE code from the HTML.  The second function is $purifier->purify() which is a 3rd party standards-compliant HTML filter library.  It filters out most malicious code (better known as XSS) and reformats the code to be standards compliant.   Not really 100% needed, but it shows how you can process the input from the editview and affect changes before it gets committed to the database.  Maybe you could do some math here or alter the contents of another field based on whats in this one.  It can be a very powerful function for creating custom fields that do more than just accept data from the EditView and shove it into the database.

So in this file we see the two $vardef’s we added in the SugarFieldHtmleditor.php file.  The variables “TinyID” and “tinyMCE” are rendered onto this view by placing them in double curly braces.  I believe this is part of a two pass conversion that goes on in the Smarty template system.  The first pass converts these to actual PHP variable names and the second pass converts them to the values of those variables.  This contrasts with the single curly brace variables like {$vals}.  These represent actual smarty values that were assigned before the templating began.  If you are anything like me you will spend alot of time figuring out how to render a value by trial and error.  Another thing you might notice are the {literal} tags.  Since $vardef.tinyMCE actually contains a JavaScript like this

<script type="text/javascript" language="Javascript"> tinyMCE.init({"convert_urls":false,"height":"500","width":"50%","theme":"advanced","theme_advanced_toolbar_align":... </script> -

and since that code contains curly braces you have to put {literal} tags around it so that smarty won’t try to compile it.  Anyway, our TinyMCE code that we got in SugarFieldHtmleditor.php replaces the TEXTAREA we have in the editview.tpl file.  Thats why on some systems you will see the TEXTAREA for a second or two before the TinyMCE comes up.  Now for the WirelessEditView.tpl we just render a TEXTAREA.  I’m not sure what a WAP browser is going to do with the HTML,so it might be a better idea to make the text non-editable in a WAP browser by putting the HTML in a hidden field and rendering it in a DIV or just straight on the screen.  That would be your call.

detailview.tpl

This is the detailview.tpl file.  What I am doing here is rendering the HTML in a scrollable DIV.  That way if there is alot of HTML to render it doesnt make the page 4 miles long.  It renders in a window that is the same size as the TinyMCE window and puts a scroll bar on the right hand side.  For the WirelessDetailView.tpl we do the same thing without the DIV.

I have 2 or 3 other fields I am going to blog about, but if you have any other ideas on fields you would like to see just go to the SugarCRM forums and look for this post and add your comments to it.

I have made my source code for this custom field available as a loadable module here.

SugarCRM Custom Masked Input field

Sat, 03/06/2010 - 05:00

OK, I didn’t mean to publish this last night, I must have accidentally clicked the wrong button somehow.  So if you read this before, please catch how it ends.  I plan to post several new custom fields in the next few weeks in hopes of sparking some community development of some new custom fields.   This post will be showcase the Masked Input field.  Masked Input fields allow users to enter formatted data like credit card numbers or phone numbers.  They apply a ‘mask’ over the text field and only allow the user to enter the desired characters.  For example on a U.S. phone number it would allow 3 number and then automatically enter a dash and then 3 more numbers and so on.  It would reject all letter or symbols during input.  In my version it looks something like this

This custom field is 100% upgrade safe and it can be added to any module, even custom modules.  I will go over all the files needed to make it work and there will be a link to download an installable module that you can simply load into module loader.

This first thing you are going to want to do is read the SugarCRM Developers guide section on SugarField widgets.  This will give you an overview of how the stock fields are put together.

So, lets start out going over the files needed to make a custom field.

First the files in the custom/ directory

  • custom/Extension/modules/ModuleBuilder/Ext/Language/en_us.Masked_input_field.php
    • This file is used to tell SugarCRM of the existence of your new field. The name of the actual file is up to you.
  • custom/Extension/modules/EditCustomFields/Ext/Language/en_us.Masked_input_field.php
    • This file defines all the language strings for the Studio Editor. The name of the actual file is up to you.
  • custom/modules/DynamicFields/templates/Fields/Templatemaskedinput.php
  • custom/modules/DynamicFields/templates/Fields/Forms/maskedinput.php
  • custom/modules/DynamicFields/templates/Fields/Forms/maskedinput.tpl
    • Together these three files draw and handle the ‘Add New Field’ screen in Studio.

Then the files in the include/ directory

  • custom/include/SugarFields/Fields/MaskedinputDetailView.tpl
  • custom/include/SugarFields/Fields/MaskedinputEditView.tpl
  • custom/ include/SugarFields/Fields/MaskedinputSearchView.tpl
  • custom/ include/SugarFields/Fields/MaskedinputSugarFieldMaskedinput.js
  • custom/ include/SugarFields/Fields/MaskedinputSugarFieldMaskedinputjs.php
  • custom/ include/SugarFields/Fields/MaskedinputSugarFieldMaskedinput.php
  • custom/ include/SugarFields/Fields/MaskedinputWirelessDetailView.tpl
  • custom/ include/SugarFields/Fields/MaskedinputWirelessEditView.tpl
    • -These files are responsible for drawing and maintaining the actual field drawn on the EditView or any other view

So we have a collection of files that takes care of the studio side of the custom field and a collection of files that take care of the actual field on the different views.  First lets look at the files that take care of the Studio end.

First custom/Extension/modules/ModuleBuilder/Ext/Language/en_us.Masked_input_field.php, this file contains an addition to the $mod_strings['fieldTypes'] array to tell SugarCRM that your new field exists.  You should read the Developers Guide in reference to how custom fields need to be named.  The other language file custom/Extension/modules/EditCustomFields/Ext/Language/en_us.Masked_input_field.php is the language file that defines the labels and drop downs on the ‘Add new field’ screen.  If you created a complex field that actually needed more text than just a label, you would use $app_stings insted of $mod_strings so that your text would be available in all modules.

Second are the actual template files, custom/modules/DynamicFields/templates/Fields/Forms/maskedinput.php and custom/modules/DynamicFields/templates/Fields/Forms/maskedinput.tpl actually draws the screen.  The maskedinput.tpl file is the smarty template and the PHP file renders it.  In the PHP file you can control what fields are shown to the user, for example you can hide the ‘Reportable’ checkbox if the field you are designing doesnt really work on a report.  The template file draws the screen in three parts, the tpl file you create for your custom field (maskedinput.tpl in this case) is the middle one with custom/modules/DynamicFields/templates/Fields/Forms/coreTop.tpl on top and custom/modules/DynamicFields/templates/Fields/Forms/coreBottom.tpl on the bottom.  You can override either or both of these as well if you want as both are included from within the maskedinput.tpl file.  In your “Middle” section you can create as many options for your field as you want.  However there are only 4 fields in the database in which to store all your settings.  If you look in the fields_meta_data table you will see the fields ext1, ext2, ext3 and ext4.  Now ext1, ext2 and ext3 are all text fields but ext4 is a longtext field.  Meaning that if you have a long or complex list of options for your custom field what you would want to do is put all those options in an array and serialize it and then place that data in ext4.  Something like this.

function save($df) {
global $app_list_strings;
$parent_option=$_REQUEST['options'];
$parent_list=$app_list_strings[$parent_option];
$this->ext1=$_REQUEST['options'];
$ext4=array();
foreach ($parent_list as $key=>$value) {
$ext4[$key]=$_REQUEST[$key.'_child'];
}
$this->ext4=base64_encode(serialize($ext4));
parent::save($df);
}

Third is the custom/modules/DynamicFields/templates/Fields/Templatemaskedinput.php file.  This file handles the saving of the “add field” form drawn by the files above, the declaring of the filed type to by used in the database and handles any other custom code you might have.  The save() routine above would go in this file.

Now lets looks at the files that will actually draw the field on the EditView, DetailView and SearchView.  The ListView is not yet supported yet.  The ListView, at the moment, will simply display whatever is in the database.

  • custom/include/SugarFields/Fields/MaskedinputDetailView.tpl
    • This file controls what the field looks like on the DetailView
    • In Masked Input this file controls if all the data is shown or just a subset.
  • custom/include/SugarFields/Fields/MaskedinputEditView.tpl
    • This file controls what the field looks like on the EditView
    • In Masked Input this file actually runs the JavaScript (from MaskedinputSugarFieldMaskedinput.js) to make the Masked Input field.
  • custom/ include/SugarFields/Fields/MaskedinputSearchView.tpl
    • This file controls what the field looks like on the SearchView
  • custom/ include/SugarFields/Fields/MaskedinputSugarFieldMaskedinput.js
    • This is a javascript file that I include in the EditView.  I include it in the MaskedinputSugarFieldMaskedinput.php so it is only included on the page once no matter how many Masked Input fields are on the screen.
  • custom/ include/SugarFields/Fields/MaskedinputSugarFieldMaskedinput.php
    • This loads the various TPL in this directory depending on what screen is to be shown.
  • custom/ include/SugarFields/Fields/MaskedinputWirelessDetailView.tpl
    • This file controls what the field looks like on the WAP DetailView
  • custom/ include/SugarFields/Fields/MaskedinputWirelessEditView.tpl
    • This file controls what the field looks like on the WAP EditView

I have made my source code available as a lodable module here.

Sugar Community Edition Version 5.5.1 – Release Candidate 2

Wed, 02/17/2010 - 19:24

Sugar Community Edition
Version 5.5.1 – Release Candidate 2

The second Release Candidate (RC) of Sugar CE 5.5.1 is now available to test.

Preview Sugar 5.5.1 RC 2 Now!

Download the Sugar CE 5.5.1 RC 2

Upgrade files are available! We recommend running a test upgrade from your version of Sugar to 5.5.1 RC 2 on a copy of your production instance (example: a development instance). Upgrade files from the 5.5.1 RC 2 to the final Generally Available (GA) release will be provided at the time of release of the GA.

While testing Sugar 5.5.1 RC 2, if you encounter any issues, please let us know through submitting a bug in the Bug Tracker. Be sure to designate “5.5.1-RC2″ as for the “Found in Release” field. You can also use the Sugar 5.5.1 forums to discuss your experience.

To date, we have addressed nearly 300 bugs related to Emails, Email Templates and Inbound Emails in Sugar 5.5.1. A full listing of the bugs and features addressed in Sugar 5.5.1 RC 2 can be found in the Bug Tracker. Search using “5.5.1-RC2″ in the “Found in Release” field, and “Fixed” in the “Resolution” field.

Details about the new and enhanced features can be found in this forum thread and in the Release Notes and Application Guides, are posted in the Documentation area on sugarcrm.com.

We plan to release the next GA-candidate in the upcoming weeks. Please check for release schedule updates in this forum thread.

Smarty or PHP as a templating language?

Fri, 02/12/2010 - 21:48

Just came across an interesting post by Ibuildings CTO Ivo Jansch, talking about the use of Smarty as a templating language over PHP itself. His argument comes down to the the cleanliness of the code; he considers Smarty code much easier to read and follow when used inside a PHP script as compared to PHP itself.

SugarCRM uses Smarty extensively as a part of our metadata, themes, and MVC frameworks to help separate the markup from our PHP code, and have built in several optimizations to our use of Smarty to avoid some of the speed penalties from using it. What does everyone else think about using Smarty as a templating language? Sound off in the comments with your thoughts.

See “Connect your data to the outside world with SugarCRM connectors” on IBM Developerworks

Tue, 02/02/2010 - 17:22

My second SugarCRM article just went live today on IBM Developerworks entitled “Connect your data to the outside world with SugarCRM connectors“. This article talks about the connectors framework introduced in Sugar 5.2, and shows to how to build your own connector using the example of building a Google News connector that leverages the Google AJAX Search API. The source code is also included with the article, which is ready to drop into your custom/ directory to use on your SugarCRM instance.

Checkout “Being RESTful with SugarCRM” on IBM developerWorks

Mon, 01/18/2010 - 04:32

I recently wrote a new article on IBM developerWorks entitled “Being RESTful with SugarCRM“, which talks about the new REST support in the Web Services framework in SugarCRM 5.5. The article talks about what REST is and how it works, and then goes on to show examples of interacting with SugarCRM using REST web services. The article also has the source code used for the examples available at the end of the article as a downloadable zip file.

Stay tuned as there will be another SugarCRM article on developerWorks coming shortly….

Making software management tools work for you – see it at Confoo.ca

Fri, 01/15/2010 - 00:24

I just added a post on my blog talking about my upcoming talk at confoo.ca entitled “Making software management tools work for you“, that attempts to be that “next step” talk in making management tools compliment your processes and vise-versa. While I’m there, I hope to meet up with any SugarCRM developers and users in the area or planning to attend, as there’s lots of exciting stuff coming soon that I’d love to hear feedback on.

Sugar 5.5.1 Release Candidate 1 is now available

Fri, 01/08/2010 - 19:47

Sugar Community Edition
Version 5.5.1 – Release Candidate 1
Thursday, January 7, 2010

The first Release Candidate (RC) of Sugar CE 5.5.1 is now available to test.

Preview Sugar 5.5.1 RC 1 Now!

Download the Sugar CE 5.5.1 RC 1

NOTE: Upgrade files are available to test upgrading from previous versions to 5.5.1 RC 1. We highly recommend that you test the upgrade on a copy of your production instance. Upgrade files from the 5.5.1 RC 1 to the final Generally Available (GA) release will be provided at the time of release of the GA.

While testing Sugar 5.5.1 RC 1, if you encounter any issues, please let us know through submitting a bug in the Bug Tracker. You can also use the the Sugar 5.5.1 forums to discuss your experience.

To date, we have addressed nearly 300 bugs related to Emails, Email Templates and Inbound Emails in Sugar 5.5.1. A full listing of the bugs and features addressed in Sugar 5.5.1 RC 1 can be found in the Bug Tracker.

Details about the new and enhanced features can be found in this forum thread and in the Release Notes and Application Guides, are posted in the Documentation area on sugarcrm.com.

We plan to release the next GA-candidate in the upcoming weeks. Please check for release schedule updates in this forum thread.

SugarCRM 5.5.1 Beta 1 Released

Wed, 12/23/2009 - 00:05

Last week, we released the first Beta of Sugar 5.5.1 as this is our commitment “release early, release often”.

Please help by testing for regressions in your modules or api clients.  Also, try out the functionality and usability.

Customers can download the 5.5.1 Beta 1 for Sugar Professional and Sugar Enterprise through the Download Manager.

The 5.5.1 Beta 1 of Sugar Community Edition Community can be downloaded through the Sugar project in SugarForge.

In 5.5.1 we improved the performance and design of the Emails module, as well as addressed the most significant emails issues and feedback reported by customers through SugarCRM Support.

As of the Beta 1 release, we addressed over 140 bugs related to Emails, Email Templates and Inbound Emails. A full listing of the bugs and features addressed in Sugar 5.5.1 Beta 1 can be found in the Bug Tracker.

Additional details about the new and enhanced features can be found in this forum thread and in the Release Notes. The Release Notes will be posted in the Documentation area on sugarcrm.com shortly.

The current plan is to release the first production-ready 5.5.1 Release Candidate early in January 2010. Please check for release schedule updates in this thread.

PHP 5.2 RPMs for Red Hat and CentOS

Wed, 12/16/2009 - 14:06

One of the new baseline system requirements for SugarCRM 5.5 is that you have one of the 5.2.x versions of PHP installed on your server. This requirement was added to not only simplify our support matrix, but also be able to use some of the newer PHP features to make SugarCRM faster and more stable than before. But this requirement has put an extra burden on systems administrators to upgrade their systems to the newer PHP version. With many Linux distributions this could require manually compiling code, which no sys admin ever wants to have to do.

Fortunately, the folks at Oracle have provided a set of RPMs for free that will upgrade any RHEL (Red Hat Enterprise Linux) 4 or 5 system ( as well as any system based upon RHEL such as CentOS or Oracle Enterprise Linux ) to the latest PHP 5.2 version, ( 5.2.10 as of this writing ). They provide the full set of modules, including the oci8 extension for connecting to Oracle databases, in both 32 and 64 bit versions. They are unsupported by Oracle, but definitely make it much easier to upgrade to PHP 5.2 without manually compiling packages by hand. You can check out the project and download the RPMs at http://oss.oracle.com/projects/php/.

My Multi-Monitor FireFox setup for SugarCRM

Wed, 12/09/2009 - 06:10

After showing this to more than a few SugarCRM users I thought I’d share how I use FireFox and SugarCRM with a wider audience.  For my method, two FireFox add-ons are required as well as two or more monitors.  What I found is that I wanted to have a window open with tabs for all my reports and I didn’t want to open my Editviews and Detailviews in the same window and have to search through my tabs to get back to my reports (or listviews, although I don’t use any of the Listviews anymore, only reports).  I also didn’t want to open a new window for every record either.  What I want to do is to be able to click on a link in my reports window and have that link open up on my “Working” window on another monitor.  That means I can scroll through a report, open up a few links that interest me without losing focus on the report.  I also want some of my reports to auto-refresh so that I can see fresh data every time I go to them, for example my “Open Cases” report, so that when a new case arrives it automatically gets added to the report screen without me having to remember to refresh the page.  I also like to keep a auto-refreshing dashboard open on a third screen but for now lets concentrate on just the two monitors.

The Add-ins for Firefox are:

OpenInWindow 1.2.1 and ReloadEvery 3.5.1

ReloadEvery, obviously, is the add-in that adds a menu option to automatically reload a page every so often.  It adds an entry to the context menu that allows you to refresh the page on a schedule that you set up.  I use every 5 minutes and every 30 minutes the most depending on what I am refreshing.  My Case list gets refreshed every 5 minutes and my dashboards get refreshed every 30 minutes. OpenInWindow adds an entry to the context menu that allows you to open a link in a different FireFox window.  So I open a window on my second monitor and I send all my work there.  This way the links that I open up to work on never get mixed up with my reports or Listviews.  If a new case comes in I can see it because that window remains visible on my first monitor while I work cases on my second monitor.  Each link I send to the second monitor opens a new tab in that window which is much better than opening up a new window for each new link.  It also beats the heck out of having dozens of tabs open and then havhing to look through them all looking for that case or the root report you work from.

The Cloud is the Next OS

Mon, 12/07/2009 - 06:55

Every decade or so, there is a dramatic shift in how people use computers. We’ve seen mainframes cede to personal computers which enable web applications which, in turn, have given rise to RIAs and mobile apps. We are on the cusp of the next revolution.

With all the buzz around cloud computing it is difficult to get at what really matters. Will the Software – with all the bugs and deployment/management headaches – disappear? Will everyone shelve the notion of “deployment“ as an outdated concept from the 20th century? On the contrary, the rush to the Cloud is a dramatic validation that Software is more alive than ever; what has changed is the way we deploy it.

In the last decade we had two options: either deployment was easy but all systems were locked with no customer access (SaaS) or deployment was difficult but the systems were accessible to the customer (local systems).

At Sugar we believe that the decision about deployment- or the lack of thereof- belongs to the customer. We’ve always felt that our customers know how to run their business, and it is part of our job to accommodate. Here at Sugar, we recognize that every customer is unique with unique requirements. We are here to help our customers reach their goals, not to tell them how to run their business.

Cloud technologies are exactly what the doctor ordered to empower our customers. Suddenly the availability of low-cost computing resources has flipped the customer’s deployment decision on its head. An application that is written for the Cloud is truly capable of running anywhere- sometimes even across multiple clouds. Such applications offer the customer an option involving minimal deployment with full access to the customer’s data as if it were deployed locally. These applications are using the Cloud as their operating system. Distributed file systems, memory management, resource rebalancing, asynchronous notification mechanisms can be easily implemented and/or consumed using cloud APIs.

Next week I’ll dig in to the different cloud offerings and how to best utilize them in your applications.

Add a “Jump-to-page” control to SugarCRM

Sun, 12/06/2009 - 20:08

Recently I’ve seen more than a few queries about how to add a “Jump-to-page” control to SugarCRM.  Something like what is shown below

"Jump-to-page" Control

This control needs to be dynamic and it should also always know what page that is currently being shown.  I chose a dropdown control for this but you could write some other control like a YUI slider or just a string of numbers like 1 2 3 4 5 6 7.  It would only require a small change to a few lines of my code to use a different control.  I am going to stick to the dropdown for this tutorial however.

For many new programmers, the hardest thing to figure out in a new project is where to put your code.  Some changes can be made in an upgrade safe way, in the custom directory, and some cannot.  To find out which this will be I will first have to find the files that will need to be altered.  First I choose where my new dropdown control will be located.  I chose right beside the pagination controls (the “VCR” buttons).  So I need to find the file where that control is drawn.  The first thing I did was look at the HTML that is in that section.  I pulled up a “View Source” (actually I used a FireFox add-on called “Web Developer” to inspect that section but a view source will do just fine.  When I found the pagination control in the HTML it started like this.

<td class="paginationChangeButtons" nowrap="nowrap" width="1%" align="right">

So from that I use my source code editor (I use Zend Studio 5.5.1 myself) to search all the files in SugarCRM for the phase “paginationChangeButtons”, that search returned one file,  /include/ListView/ListViewPagination.tpl.  Files that end in TPL are smarty templates.  Smarty is the utility that SugarCRM uses to render the HTML on the different screens.  So this template file is the template file that draws the pagination section of a listview page.  Sounds perfect. So that fileis where I am going to put my code.  Now I am not going to go into how smarty works in this blog but basically there is a template and a PHP script that fills that template.  In this template I am going to put a “Smarty Variable”, I will call it $loopNavButtons.  I want to place this variable right before the start button of the pagination control as shown in the image above.  So I find the bit in the code that draws that button and place my variable

<td nowrap='nowrap' width='1%' align="right" class='paginationChangeButtons'> {$loopNavButtons} {if $pageData.urls.startPage} <button type='button' name='listViewStartButton' title='{$navStrings.start}' class='button' {if $prerow}onclick='... <img src='{sugar_getimagepath file='start.gif'}' alt='{$navStrings.start}' align='absmiddle' border='0' width='13' height='11'> </button> {else} <button type='button' name='listViewStartButton' title='{$navStrings.start}' class='button' disabled> <img src='{sugar_getimagepath file='start_off.gif'}' alt='{$navStrings.start}' align='absmiddle' border='0' width='13' height='11'> </button> {/if}

After that I need to add the code that will fill in that variable.  That code goes in the file /include/ListView/ListViewSmarty.php.  This is where I find that this modification cannot be made upgrade safe.  The TPL files are loaded from a static path so there is no way to get around having to edit the core files.  Some modifications are just that way.  Anyway moving on….

In ListViewSmarty.php I know I am going to have to calculate the number of pages that the drop down will show.  I have to take the number of records, divide that by the number shown on each screen.  Then I will need to draw my drop down and fill that with the correct number of options.  I will also need to figure out what page I am on already and make that the default selection of the dropdown.  All that code looks like this, I start after all the code needed to do my math around line #106.  The first 10 lines already exist in the file, I show them only for reference.

$this->ss->assign('bgHilite', $hilite_bg); $this->ss->assign('colCount', count($this->displayColumns) + 1); $this->ss->assign('htmlVar', strtoupper($htmlVar)); $this->ss->assign('moduleString', $this->moduleString); $this->ss->assign('editLinkString', $app_strings['LBL_EDIT_BUTTON']); $this->ss->assign('viewLinkString', $app_strings['LBL_VIEW_BUTTON']); $this->ss->assign('allLinkString',$app_strings['LBL_LINK_ALL']); $this->ss->assign('noneLinkString',$app_strings['LBL_LINK_NONE']); $this->ss->assign('recordsLinkString',$app_strings['LBL_LINK_RECORDS']); $this->ss->assign('selectLinkString',$app_strings['LBL_LINK_SELECT']); //kbrill - pagination steps // Step 1: Do the math $tStep=$this->data['pageData']['offsets']['next'] - $this->data['pageData']['offsets']['current']; $tPages=$this->data['pageData']['offsets']['end'] / $tStep; // Step 2: Draw the control with the needed javascript $control="<select name=pSteps onChange='return sListView.save_checks(this.options[this.selectedIndex].value , \"{$this->moduleString}\")'>"; for ($loopNumber=0;$loopNumber<=$tPages;$loopNumber++) { $currentPageNumber=$loopNumber*$tStep; $loopPageNumber=$loopNumber+1; if($this->data['pageData']['offsets']['current']==$currentPageNumber) { $selected="SELECTED /"; } else { $selected = "/"; } $control .= "<option value='{$currentPageNumber}' {$selected}>Page {$loopPageNumber}</option>"; } $control .= "</select>"; //Step 3: Render the control if($tPages>0) { $this->ss->assign('loopNavButtons', $control); } else { //If there is only one page then dont draw the control $this->ss->assign('loopNavButtons', ""); }

So with that code in place, we run a quick repair to replace the cached smarty template and we are done.

SugarCRM 5.5.0 Generally Available

Thu, 12/03/2009 - 02:47

SugarCRM 5.5.0 GA

We are excited to announce announce the general availability of version 5.5!

Sugar Community Edition 5.5 GA

Download the Sugar CE 5.5 GA

Install Sugar 5.5 GA, or upgrade your system from a previous version to Sugar 5.5.
Note: If your Sugar database is larger than 1GB, use the Silent Upgrade package to upgrade to Sugar 5.5. Read more about this here.

Sugar Professional & Enterprises Edition 5.5 GA

Sugar 5.5 Professional & Enterprise offers the following new and enhanced features:

Product Features

  • Dynamic Teams: Ability for users to add multiple teams and users to a record to provide extra visibility and enhance collaboration on complex projects without compromising security.
  • Studio for Sugar Mobile: Sugar administrators can now customize the EditView, DetailView, ListView and Search layouts of the Sugar modules appearing in the mobile view.
  • Password Management: P

rovides admins with greater control over how passwords are created and enforced in the system.

Platform Enhancements

  • New Web Services: We are updating our web services API’s to make them easier to retrieve related items and perform better under heavy loads
  • New Themes Framework: We have rewritten how themes are handled in the Sugar platform. Themes will be easier/quicker for developers to create.

The Sugar 5.5 GA release can now be downloaded within the Download Manager.
In addition, over 1900 bugs were fixed in Sugar 5.5! This is our highest-quality, most stable release to date! You can view the bugs that were fixed in Sguar 5.5 within the Bug Tracker.

For further details about this release, please read the Release Notes, which are available within the Download Manager, as well as in the Documentation area of the SugarCRM website.

Thanks to all of you who helped us make Sugar 5.5 a success!

The Definitive Guide to SugarCRM now available

Tue, 12/01/2009 - 16:53

The Definitive Guide to SugarCRM: Better Business Applications is now available in paperback form. This book does an in-depth look at the SugarCRM platform, from the MVC and Metadata frameworks to Web Services, and many bits in between. It then walks the user through customizing SugarCRM out-of-the-box using Studio, Logic Hooks, Workflows, and custom PHP code. It then follows up by showing how to build new functionality on top of Sugar using Module Builder and custom PHP code, and then finishes by showing how to build a complete solution on the platform.

It is a unique book in that it is the first and only official SugarCRM book on the market. Written by myself, John Mertic, it comes with all of the engineering expertise of Sugar, giving developers, IT administrators, systems integrators, and consultants a unique insight into the platform and how to use it to build complete business applications and solutions. It’s a definite must read for anyone here that follows this blog.

You can buy the book from Amazon now, or look for it at your local book retailer.

Module Builder Tour

Fri, 11/20/2009 - 16:55

Hello everyone!  This is the beginning in hopefully a long series of videos that will explore the various APIs in SugarCRM.

John Mertic, a dev on SugarCRM’s core engineering team, walks us through creating a module and also the talks about how to begin to extend the functionality of the modules.

I hope you enjoy!

Module Builder Tour from SugarCRMCasts on Vimeo.

If you have any comments or questions, please let me know.