Add module to SugarCRM (How To)

I couldn’t find a single document that gave a new user this vital information, although I was able to locate a bazillion modules for download.   I ended up digging into the code to see what it was looking for.

While it is an easy process, it, obviously, has been misinterpreted as intuitive.

Simply :

1)  Download the module you wish to install.

- Each module I downloaded was compressed in ‘ZIP’ format.

** DO NOT DECOMPRESS THE FILE **

2)  Navigate (while logged in as admin) to the admin screen and scroll down. Select ‘Module Loader’.

3)  Click on ‘Choose File’. Find your .zip module file and select.

4)  Click the ‘Upload’ button.  If all is as it should be,  the file and pertinent data will appear in the installed module section at the top of the screen.

Good luck,

David

 


Linux unzip – “unsupported compression method 99″

Project : Setup an email server for a single incoming sender, for a single, encrypted, compressed email. Process the email by extracting the compressed, password protected zip file, decompressing, globbing it into mysql for future reference and processing the resulting XML file.

Using PERL MIME::Parser I manage to separate the zipped attachment from the rest of the message and save it as a file in a particular directory.

But lo and behold, upon trying the command (on a linux redhat machine) :

unzip -P[password] [path/filename.zip]

This is the error generated :

“unsupported compression method 99″

Here’s the fix :

(sudo) yum install p7zip

After the installation is complete, change the command to :

7za x -[password] [path/filename.zip]

Success !  Works like charm.

 

Good luck out there.


PHP script – no output or errors displayed.

Ever run a  script and neither errors or output is displayed in th

browser ?  After you bang your head against your desk, you

resort to the trusty log files. Which offer no help and only

increase confusion.

More than likely, what is happening is a fatal error is occurring

(on a call to an undefined method, is what I encountered) at

the top-level of your code.  Adding ‘error_reporting’ code

also didn’t help.  So, what do you do, back up even further in the

process chain and add these 2 lines to an .htaccess file :

php_value display_errors 1
php_value display_startup_errors 1
and voila !  Re-running the script shows :
Fatal error: Class 'DOMDocument' not found in /var/www/html/dev/xmlreader3.php on line 27

Good luck and I hope this helps some poor soul !
David 

Resolving Fatal error: Class ‘DOMDocument’ not found…

Hello all  you happy programmers.

I ran into this little beauty today,  after migrating code I’d written from one server to another, that processes a fairly large XML Document.

   PHP Fatal error:  Class ‘DOMDocument’ not found in <…> line 85

Thanks to the wonderfulness of yum, this is all it takes to resolve this issue :

[root@dev]# yum install php-xml
Loaded plugins: fastestmirror
Determining fastest mirrors
fedora/metalink                                                                                                                                                    | 4.1 kB     00:00
updates/metalink                                                                                                                                                   | 3.8 kB     00:00
 * fedora: dl.fedoraproject.org
 * updates: dl.fedoraproject.org
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package php-xml.x86_64 0:5.2.13-1.fc11 set to be updated
–> Processing Dependency: libxslt.so.1(LIBXML2_1.0.13)(64bit) for package: php-xml
–> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: php-xml
–> Processing Dependency: libxslt.so.1(LIBXML2_1.0.24)(64bit) for package: php-xml
–> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: php-xml
–> Processing Dependency: libexslt.so.0()(64bit) for package: php-xml
–> Processing Dependency: libxslt.so.1()(64bit) for package: php-xml
–> Running transaction check
—> Package libxslt.x86_64 0:1.1.26-1.fc11 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

==================================================================
 Package                                    Arch                                      Version                                            Repository                                  Size
==================================================================

Installing:
 php-xml                                    x86_64                                    5.2.13-1.fc11                                      updates                                    121 k
Installing for dependencies:
 libxslt                                    x86_64                                    1.1.26-1.fc11                                      updates                                    554 k

Transaction Summary
==================================================================
Install      2 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 675 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): libxslt-1.1.26-1.fc11.x86_64.rpm                                                                                                                            | 554 kB     00:00
(2/2): php-xml-5.2.13-1.fc11.x86_64.rpm                                                                                                                            | 121 kB     00:00
——————————————————————————————————————————————————————————————
Total                                                                                                                                                     724 kB/s | 675 kB     00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : libxslt                                                                                                                                                            1/2
  Installing     : php-xml                                                                                                                                                            2/2

Installed:
  php-xml.x86_64 0:5.2.13-1.fc11

Dependency Installed:
  libxslt.x86_64 0:1.1.26-1.fc11

Complete!

[root@dev]#

I hope this helps some one.

Happy Developing.

David


How to Tether Your Blackberry using Bluetooth

(PC Windows 7 version)

While this is written specifically for a TMobile Blackberry and a Dell laptop, the theory of utilizing a Bluetooth enabled cellular phone (Motorolla, iPhone, etc..) to provide internet access for a bluetooth enabled laptop, PC, PDA, tablet or other device, applies.  In some cases, you may be required to install additional software or applications (EasyTether, PDAnet) which, for the most part, free.

Hardware :

Blackberry 9300 Curve

Dell Inspiron 1525  (Windows 7 Ultimate)

Iomega Bluetooth 2.1 USB Micro adapter

(http://www.iogear.com/support/dm/driver/GBU421#display)

-          Turn on or enable Bluetooth functionality on your Blackberry.

-          Make the Blackberry discoverable.

-          On the laptop, for built in Bluetooth devices, enable Bluetooth radio support (turn it on).

-          Make the laptop discoverable (may not be necessary on some laptops.)

-          Establish a trusted Bluetooth connection between the laptop and Blackberry by pairing

The two devices.

  • Use either of the devices to search or add Bluetooth devices.
  • Upon discovery of the device targeted for a connection, follow the instruction(usually a simple matter of entering a string of numbers on one device, then doing the same on the other to verify the intent to pair)

-          Once the two devices  have been successfully paired, open your Bluetooth device control panel.

  • “Bluetooth Device Control” in Windows 7 Ultimate

-          For the recently paired Blackberry, you will see a number of methods in which you can utilize the functionality of the device. (ie. Internet and Telephone, File Transfer, Headset…)

-          Internet and Telephone, that’s the one we’re looking for.

-          Click “Connect”

-          Watch it “automagically” perform a number of cryptic tasks.

-         At this point you should see an indicator that shows the name of your Blackberry and a status of connected.

Now your connected to the internet and you can get Back To Work !

David Burney


Passing Data to Dialog Boxes with Flex

Main Screen

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientAlphas="[1.0, .5]" backgroundGradientColors="[#000000, #000000]" xmlns:ns1="components.*">

Screen Objects

<mx:ComboBox x="68" y="83" id="color_cmb" width="178" dataProvider="{colorsAC}"
editable="false" prompt="Select a Color" change="showPopUpButton.enabled='true'"/>
<mx:Button x="321" y="83" label="Show Next Screen" id="showPopUpButton" click="showThePopUpComponent(color_cmb.selectedItem.label)" enabled="false"/>

<mx:Script>

<![CDATA[ 

import mx.collections.*; // imports the array classes

import mx.managers.PopUpManager; // imports the PopUpManager
import components.NextWindow; // imports the Next Window component
public var colorsAC:ArrayCollection = new ArrayCollection( [ {label:"Red"}, {label:"Blue"}, {label:"Yellow"}, {label:"Green"}, {label:"Purple"}, {label:"Orange"} ]);

/* This function displays the new window and passed data to it in two ways. 1) Sets a public attribute defined in the window (this attribute is bound to textField2
2) Calls a function in the window (named passData) and passes it the value of the combobox as a parameter. Either way works fine. Which to use would depend on what you are going to do with the data once it gets there */

public function showThePopUpComponent(passedValue:String):void {
var newPopUp:NextWindow = NextWindow(PopUpManager.createPopUp(this, NextWindow, true));
newPopUp.theDataFromTheComboBox = passedValue newPopUp.passData(passedValue); PopUpManager.centerPopUp(newPopUp);
]]>

</mx:Script>

</mx:Application>


 Next Window Component

<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300" title="Next Window with Data Passed From The Combo Box" showCloseButton="true" close="PopUpManager.removePopUp(this)" >

Screen Objects

<mx:Label x="31" y="23" text="No Value Yet" id="textField1"/>
<mx:Label x="31" y="77" text="{theDataFromTheComboBox}" id="textField2" /> <mx:Script>
<![CDATA[
import mx.controls.Alert;

// Allows us to display alert boxes

import mx.managers.PopUpManager;

// Allows us to use PopUpManager Functions (like remove window)

// This variable is bound to textField2. When the main screen puts a value in it, textField2 is automatically updated (cause of dataprovider)
[Bindable]
public var theDataFromTheComboBox:String;

// This function is called from main screen to put data into a text field
 public function passData(passedData:String):void { textField1.text = passedData } ]]> </mx:Script> </mx:TitleWindow>

 


PHP XML DOM getelementsbytagname

$xml = new DOMDocument('1.0', 'utf-8');
$xml->formatOutput = true; $xml->preserveWhiteSpace = false;
$xml->load("document.xml');
$xmlEmail = $xml->getElementsByTagName('Email')->item(0);
$Email = (string)$xmlEmail->nodeValue;
$pstatus = cpl_patient_init($xmlEmail->nodeValue);


.htaccess mod-rewrite for https non-www to www

# Redirect from non-www, non-canonical hostname to the canonical www hostname,
# preserving HTTPS(SSL) protocol

RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteCond %{SERVER_PORT}s ^(443(s)¦[0-9]+s)$
RewriteRule (.*) http%2://www.example.com/$1 [R=301,L]


Blocking an IP on a Linux server

Here we’re concerned with a Brute Force attack on our system via SSH.  And adding an entry to iptables to block or drop it.

iptables -A INPUT -s IP-ADDRESS -j DROP

Replace IP-ADDRESS with your actual IP address. For example, if you wish to block ip address 65.55.44.100  type the command as follows:


iptables -A INPUT -s 65.55.44.100 -j DROP


 
Internet Solutions | all rights reserved | ©2009-2011