Thursday, June 14, 2012

[Solved] Problems Installing Payslip module using vtlib in vtiger


When installing Payslip module using vtib from "VtigerCRM_5.2.0_Vtlib.pdf", I faced some problems. I want to share how I solved those problem.

Problem 1:
------------------------------------------------------------------------------------------------------------
I installed the Payslip module but when I clicked on Payslip link in vtiger, it showed blank page.

For this, open your php.ini file
Remove comment from line:
             error_reporting = E_ALL & ~E_NOTICE

Tuesday, May 22, 2012

Dependent Dropdown in SugarCRM (SugarCE)

In order to make dependent dropdown, first you need to create 2 independent dropdown list from sugar admin panel. Let's say country_c and city_c with Item Name as below:

For country_c menu:
Item Name                    Display Name
AAA                             Thailand
BBB                              Nepal

For city_c menu:
Item Name                   Display Name
AAA_1                        Bangkok
AAA_2                        Phuket
BBB_1                         Lumbini
BBB_2                         Pokhara

Here you can see that if Item Name for country is AAA then the corresponding Item Name for city is AAA_1, AAA_2 i.e. it starts with AAA.

Wednesday, April 11, 2012

How to make Nagios monitor its service at particular Time Period

I am considering that you already know how to add custom services. If not, please have a look at my previous post:  http://codebyte.blogspot.com/2012/03/adding-custom-services-for-windows-host.html

Suppose you want to monitor your service at 16:00 to 16:15 and 18:00 to 18:15 hours everyday.

First of all, you need to open your timeperiod.cfg file in your nagios server installation directory.
Add the following lines,
define timeperiod{
         timeperiod_name               24X7custom
         alias                                   24X7custom
         sunday                               16:00-16:15,18:00-18:15
         monday                             16:00-16:15,18:00-18:15
         tuesday                             16:00-16:15,18:00-18:15
         wednesday                        16:00-16:15,18:00-18:15
         thursday                           16:00-16:15,18:00-18:15
         friday                                16:00-16:15,18:00-18:15
         saturday                           16:00-16:15,18:00-18:15
}

Tuesday, March 27, 2012

Adding custom services for Windows host to be monitored by Nagios (Monitoring MS SQL Database Table)

Nagios has many in-built services which can be easily configured for a host so that it can be monitored. Services for Windows host like check cpu load, drive space, running processes can be monitored by using various parameters in check_nt command.
While monitoring, situation comes when you have to monitor a specific service which may be a part of an application, size of particular file or a table in database and many others. In these cases, you have to make your own customized program/script to monitor them. Nagios should be configured to run this customized program and get its output and show the service status.

Saturday, March 24, 2012

Kannel–A quick installation and configuration guide

Kannel is free and open source SMS and WAP gateway. It is easy to use, install and configure. This article will describe a quick and easy steps for installing and configuring this gateway for sending and receiving SMS.
Installation
Kannel in based on Linux and can be easily installed from repository. It is available in both aptitude and yum repositories and can be installed right away by giving their respective commands.
apt-get install kannel
or
yum install kannel
If you don’t find it in repository, then you can add more repositories. This link gives guide to add repository to CentOS. You can find for other Linux distribution too.
Configuration
After you install, you will find a file named kannel.conf at /etc/. The configuration file for my modem Nokia30 is shown below.

Monday, March 19, 2012

[Solved] Kinamu Reporter 'Invalid argument supplied' Problem

You might have seen the below error in Kinamu Reporter:
Warning: Invalid argument supplied for foreach() in \modules\KReports\KReportQuery.php on line 401
Warning: reset() expects parameter 1 to be array, null given in \modules\KReports\KReportQuery.php on line 784
Warning: Invalid argument supplied for foreach() in \modules\KReports\KReportQuery.php on line 785

This problem comes when you have not added any field in the selection criteria.
While creating report, on the right panel under Report Definition, you can see 2 things: Selectioncriteria and Display Fields. Problem occurs when you add fields only in Display Field but not in Selectioncriteria.

Let us suppose that you added first name and last name from module contacts in Display Fields, then the query will be:
select first name, last name from contacts

This statement should work but in basic version of Kinamu Reporter, this statement alone does not work. So you need to specify parameters in Selectioncriteria also. Adding parameters in Selectioncriteria means that you are specifying where clause for the query statement. For e.g. if you set first_name = 'Poonam' in Selectioncriteria, then the query will be:
select first name, last name from contacts where first_name = 'Poonam'

This solves the problem.

Thursday, March 15, 2012

Remove 'View Change Log' from SugarCRM Detail View

For 'Contacts' Module

1. Copy file from  'sugarcrm\modules\Contacts\metadata\detailviewdefs.php' to  sugarcrm\custom\modules\Contacts\metadata\detailviewdefs.php

Inside the form array, add 1 line,
'hideAudit' => true,

Go to Admin->Repair->Quick Repair and Rebuild. This will execute the code.

Do the same for other modules replacing 'Contacts' by 'your-module'.

Remove 'Direct Reports' from SugarCRM Contacts subpanel

Create Directory: sugarcrm\custom\Extension\modules\Contacts\Ext\Layoutdefs

Create a file named layoutdefs.ext.php inside this directory with code as below:
<?php unset($layout_defs['Contacts']['subpanel_setup']['contacts']); ?>

Go to Admin->Repair->Quick Repair and Rebuld. This will execute the code

Remove 'Duplicate' from Detail View of SugarCRM

1. Copy file from  'sugarcrm\modules\Contacts\metadata\detailviewdefs.php' to  sugarcrm\custom\modules\Contacts\metadata\detailviewdefs.php

2. Inside the form arrary, you will see an array with values 'edit', 'delete', 'duplicate'. Remove 'duplicate' from the array.

Go to Admin->Repair->Quick Repair and Rebuild. This will execute the code.

Remove 'Import Contacts' from SugarCRM

1. Go to directory: sugarcrm\custom\Extension\modules\Contacts\Ext\Menus
   (Create the directory if you already don't have one)
2. Create a file: menu.ext.php
   
Write the below code in that file

foreach ($final_module_menu as $key => $val){
if($val[1] == $mod_strings['LNK_IMPORT_CONTACTS'])
unset($final_module_menu[$key]);
}

If you check the file sugarcrm\modules\Contacts\Menu.php, you can see the code for all menus that are seen in Action Menu of contacts.

$final_module_menu is the array which contains all those values:
$final_module_array =
Array (
    [0] =>Array ( [0] => index.php?module=Contacts&action=EditView&return_module=Contacts&return_action=index [1] => Create Contact [2] => CreateContacts [3] => Contacts )
    [1] => Array ( [0] => index.php?module=Contacts&action=ImportVCard [1] => Create Contact From vCard [2] => CreateContacts [3] => Contacts )
    [2] => Array ( [0] => index.php?module=Contacts&action=index&return_module=Contacts&return_action=DetailView [1] => View Contacts [2] => Contacts [3] => Contacts )
    [3] => Array ( [0] => index.php?module=Import&action=Step1&import_module=Contacts&return_module=Contacts&return_action=index [1] => Import Contacts [2] => Import [3] => Contacts ) )

So comparing $val[1] with the value of the item we want to remove, gives the required $key value.

After making any changes in the file, go to Admin->Repair->Quick Repair and Rebuild. This will execute the code.

Note: Sugarcrm Version - Sugarcrm 6.0.2