Archive for the ‘Uncategorized’ Category

Version 5.5.1 – Release Candidate 3 Available!

Tuesday, March 9th, 2010


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

Tuesday, March 9th, 2010

Ubuntu Logo

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 8) 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

Saturday, March 6th, 2010

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

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.

EditView.tpl

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.php

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

Friday, March 5th, 2010

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

Masked Input Field

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

(more…)

Sugar Community Edition Version 5.5.1 – Release Candidate 2

Wednesday, February 17th, 2010

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?

Friday, February 12th, 2010

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

Tuesday, February 2nd, 2010

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.

Connect your data to the outside world with SugarCRM connectors

Checkout “Being RESTful with SugarCRM” on IBM developerWorks

Sunday, January 17th, 2010

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.

Screen

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

Thursday, January 14th, 2010

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

Friday, January 8th, 2010

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.

Have feedback for us? Drop us a line.
Terms & Conditions | Privacy | Trademark Info | Contact Info | FAQs | SugarCRM Inc.© 2004 - 2009 All rights reserved.