Canvas is not supported in your browser, please install a newer HTML5 compactible browser

Do not buy LeTV 1S

Hey Guys,

Just wanted to make you aware that the LeTv 1s, which is a heavily marketed product by Flipkart is NOT using gorilla glass as everybody thinks it is, it is a cheap and fragile paper glass which can’t handle even a 2 feet drop. I had bought the phone on 8th of March and by 9th of March it had a shattered screen from a mere 2 feet drop. I have been using phones for quite some time, this is the first time the phone such a poor quality display has come along. I understand that physical damage is not covered under warranty, but I do expect from level of durability from a 11k phone.

The worst part is that Flipkart is defending a scam company and hiding negative reviews people are writing about the phone. So if they publish 20 reviews, they make sure 15 are good reviews and 5 are bad. I feel Flipkart is loosing it’s status as a company Indian’s trust because this is the phone that is been sold exclusively via Flipkart and it is of pathetic quality. Flipkart says that we do not have a policy of returning a product damaged by you, it’s like saying, we will sell a mobile with a display that an break if you keep 2 fingers on the screen at the same time, but hey, if it breaks, it’s damaged by you and we will not take it back.

Just wanted to warn everybody out there.

Posted in Uncategorized.

Chef Cookbook for hhvm

Hi Guys,

Yet another new thing I was looking at was HHVM. You can read about HHVM here . I am sharing a cookbook which installs HHVM along with Laravel Framework. This cookbook has also been written keeping ubuntu 14.04 in mind.

You can find the cookbook here.

git@github.com:aniesshsethh/chef-hhvm-laravel.git

Next will be a cookbook for hadoop and running nutch in deploy mode with hbase as storage backend.

The Configuration will be
hadoop 1.x
nutch 2.x
hbase .94

Stay tuned !!!

Posted in Chef, HHVM.

Chef Cookbook for nutch/solr in local mode

Hi Guys,

I have been working on solr/nutch for my job and have been quite busy doing the same. Today I am sharing with you the cookbook I created for setting up nutch/solr on a server.If anybody has some issues running, feel free to drop a comment and I will try to
help out as much as I can.

This cookbook has been written keeping ubuntu 14.04 in mind. Also, please ensure that you update your installation before running this cookbook.

sudo apt-get udpate

You can download the cookbook from
git@github.com:aniesshsethh/chef-nutch-solr.git

Once the cookbook has finished running, you can simply start the solr using

cd /srv/www/solr-lucene/solr/mycore
java -jar start.jar

and if you want to run this process in background

nohup java -jar start.jar &

Posted in Chef, Nutch, Solr.

Google autocomplete address box in sugarCRM – As plug and play module

Hey,

Sorry guys, I have been rather busy this past year, between jobs and such. But I finally found some time and converted the below post into a full fledge module. It works with the contacts/accounts/leads module and give the autocomplete functionality as soon as you install it, without you having to write a single line of code. The module is available on sourceforge.

http://www.sugarforge.org/projects/googleaddress/

It’s a free download, but please leave a comment if you like it.

Posted in PHP, SugarCRM.

Google autocomplete address box in sugarCRM

Hi Guys and Gals,

I have been developing on the sugarCRM and when I was recently going through the kind of data we have and the one thing I found very inconsistent in general were the addresses. Different people have different ways of writing addresses, which becomes a problem when you have to segregate the data for any purpose. For example, someone writes United States of America, as USA or US or States. To solve this particular problem, one of the way is give the users to auto complete the data and what’s a better source than Google.

I will show you how I implemented this in sugarCRM, but this can be implemented in any system in general.

In sugarCRM we have a special field for address, which basically is shown as a single field but in technical terms is a combination of different fields stored in the database.
1) Address
2) City
3) State
4) Postal Code
5) Country

Google does return the data in somewhat this way, but we need to improve it to show it in sugar.

First we need to include the javascript in the contact create view in order to execute custom javascript code.

To do so, navigate to custom/modules/Contacts/metadata/, if there is a file named “editviewdefs.php” then open it, if it doesn’t exist, please copy it from modules/Contacts/metadata/

Under the templateMeta array add this

'includes' =>
    				array (
    						0 =>
    						array (
    								'file' => 'custom/modules/Contacts/js/addressautocomplete.js',
        ),
      ),

The complete file should look like this

<?php
/*********************************************************************************
 * SugarCRM Community Edition is a customer relationship management program developed by
 * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/

$viewdefs['Contacts']['EditView'] = array(
    'templateMeta' => array('form'=>array('hidden'=>array('<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
    											          '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
    											          '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
    											          '<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
    											          '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">')),
							'maxColumns' => '2',
                            'widths' => array(
                                            array('label' => '10', 'field' => '30'),
                                            array('label' => '10', 'field' => '30'),
                                        ),
    		
    		'includes' =>
    				array (
    						0 =>
    						array (
    								'file' => 'custom/modules/Contacts/js/addressautocomplete.js',
        ),
      ),
),


    'panels' =>
    array (
      'lbl_contact_information' =>
      array (
        array (
          array (
            'name' => 'first_name',
            'customCode' => '{html_options name="salutation" id="salutation" options=$fields.salutation.options selected=$fields.salutation.value}' 
	      . '&nbsp;<input name="first_name"  id="first_name" size="25" maxlength="25" type="text" value="{$fields.first_name.value}">',
	      ),
          

        ),
        array (
          array (
            'name' => 'last_name',
          ),
          array (
            'name' => 'phone_work',
            'comment' => 'Work phone number of the contact',
            'label' => 'LBL_OFFICE_PHONE',
          ),
        ),

        array (

          array (
            'name' => 'title',
            'comment' => 'The title of the contact',
            'label' => 'LBL_TITLE',
          ),
          array (
            'name' => 'phone_mobile',
            'comment' => 'Mobile phone number of the contact',
            'label' => 'LBL_MOBILE_PHONE',
          ),

        ),

        array (
          'department',
          array (
            'name' => 'phone_fax',
            'comment' => 'Contact fax number',
            'label' => 'LBL_FAX_PHONE',
          ),
        ),
        array(
          array (
            'name' => 'account_name',
            'displayParams' =>
            array (
              'key' => 'billing',
              'copy' => 'primary',
              'billingKey' => 'primary',
              'additionalFields' =>
              array (
                'phone_office' => 'phone_work',
              ),
            ),
          ),
        ),

        array (

          array (
            'name' => 'primary_address_street',
            'hideLabel' => true,
            'type' => 'address',
            'displayParams' =>
            array (
              'key' => 'primary',
              'rows' => 2,
              'cols' => 30,
              'maxlength' => 150,
            ),
          ),

          array (
            'name' => 'alt_address_street',
            'hideLabel' => true,
            'type' => 'address',
            'displayParams' =>
            array (
              'key' => 'alt',
              'copy' => 'primary',
              'rows' => 2,
              'cols' => 30,
              'maxlength' => 150,
            ),
          ),
        ),

        array (

          array (
            'name' => 'email1',
            'studio' => 'false',
            'label' => 'LBL_EMAIL_ADDRESS',
          ),
        ),

        array (

          array (
            'name' => 'description',
            'label' => 'LBL_DESCRIPTION',
          ),
        ),
      ),


      'LBL_PANEL_ADVANCED' =>
      array (

        array (

          array (
            'name' => 'report_to_name',
            'label' => 'LBL_REPORTS_TO',
          ),

          array (
            'name' => 'sync_contact',
            'comment' => 'Synch to outlook?  (Meta-Data only)',
            'label' => 'LBL_SYNC_CONTACT',
          ),
        ),

        array (

          array (
            'name' => 'lead_source',
            'comment' => 'How did the contact come about',
            'label' => 'LBL_LEAD_SOURCE',
          ),

          array (
            'name' => 'do_not_call',
            'comment' => 'An indicator of whether contact can be called',
            'label' => 'LBL_DO_NOT_CALL',
          ),
        ),

        array (
	      'campaign_name',
        ),
      ),



      'LBL_PANEL_ASSIGNMENT' =>
      array (
        array (
          array (
            'name' => 'assigned_user_name',
            'label' => 'LBL_ASSIGNED_TO_NAME',
          ),
        ),
      ),
    )
);
?>

Basically the thing of interest is

'file' => 'custom/modules/Contacts/js/addressautocomplete.js',

add the javascript file at the file mentioned above with the code.

 $.getScript("https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places&callback=initialize");
function initialize() {	
	var input = (document.getElementById('primary_address_street'));
	var options = {
			  types: ['establishment']
			};
	var autocomplete = new google.maps.places.Autocomplete(input);
	google.maps.event.addListener(autocomplete, 'place_changed', function() {		
		 var place = autocomplete.getPlace();
		 jQuery("#primary_address_city").val("");
		 jQuery("#primary_address_state").val("");
		 jQuery("#primary_address_country").val("");
		 jQuery("#primary_address_postalcode").val("");
		 jQuery("#primary_address_street").val("");
		 var street_name = "";
		 street_name = place.name
		 $.each(place.address_components,function(key,element){			
			 if(jQuery.inArray("street_number", element.types) !== -1){
				 street_name += " ,"+element.long_name;
			 }
			 if(jQuery.inArray("route", element.types) !== -1){
				 street_name += " ,"+element.long_name;
			 }
			 if(jQuery.inArray("neighborhood", element.types) !== -1){
				 street_name += " ,"+element.long_name;
			 }
			 if(jQuery.inArray("administrative_area_level_2", element.types) !== -1 || jQuery.inArray("locality", element.types) !== -1){			
					 jQuery("#primary_address_city").val(element.long_name);
			 }
			 if(jQuery.inArray("administrative_area_level_1", element.types) !== -1){
				 jQuery("#primary_address_state").val(element.long_name);
			 }
			 if(jQuery.inArray("country", element.types) !== -1){
				 jQuery("#primary_address_country").val(element.long_name);
			 }
			 if(jQuery.inArray("postal_code", element.types) !== -1){
					jQuery("#primary_address_postalcode").val(element.long_name);
			 }		
		 });
		   window.setTimeout(function() {
			   jQuery("#primary_address_street").val(street_name);
	           jQuery("#primary_address_country").focus();
	        }, 200);
	});
	
}

Now after this if you do a repair and rebuild, you will see something like this

The field turns to autocomplete. When you start typing a name, for example “Google Plex” you get a suggestion, when you select the suggestion, the javascript code written above basically splits that data into the particular fields

If you face any problems, just drop a comment and I will try to help you out.

Posted in Javascript, jQuery, PHP, SugarCRM.

Colleagues subpanel for Contacts in SugarCRM

Hi Guys and Gals,

It’s been a very long time since my last blog post and the reason is that I have been busy learning SugarCRM at my work and to get it up and running in my company.

One of the requirements that was required was to have a colleague subpanel under the contact. Basically the sales team wanted to see other people related to this contact without actually going into the organization.

So the workaround for this was to make a subpanel to only show the contacts but no actual relationship is created.

Below are the steps as to how you can do it

1) Create a Many to Many relationship under contacts using the studio.
Go to the admin

Go to studio under the admin panel

Click on Contacts and then click on relationships and then add a relationship

Create a many to many relationships to the contacts and mark the label as “Colleagues” and the click “Save and Deploy”

2) You should now have a file under custom/Extension/modules/Contacts/Ext/Layoutdefs/contacts_contacts_1_Contacts.php with the code

$layout_defs["Contacts"]["subpanel_setup"]['contacts_contacts_1'] = array (
  'order' => 100,
  'module' => 'Contacts',
  'subpanel_name' => 'default',
  'sort_order' => 'asc',
  'sort_by' => 'id',
  'title_key' => 'LBL_CONTACTS_CONTACTS_1_FROM_CONTACTS_R_TITLE',
  'get_subpanel_data' => 'contacts_contacts_1',
  'top_buttons' => 
  array (
    0 => 
    array (
      'widget_class' => 'SubPanelTopButtonQuickCreate',
    ),
    1 => 
    array (
      'widget_class' => 'SubPanelTopSelectButton',
      'mode' => 'MultiSelect',
    ),
  ),
);

You have replace the file with these contents.

<?php
 // created: 2013-04-24 09:14:38
$layout_defs["Contacts"]["subpanel_setup"]['contacts_contacts_1'] = array (
  'order' => 100,
  'module' => 'Contacts',
  'subpanel_name' => 'default',
  'sort_order' => 'asc',
  'sort_by' => 'id',
  'title_key' => 'LBL_CONTACTS_CONTACTS_1_FROM_CONTACTS_R_TITLE',
  'top_buttons' => array (),
  'get_subpanel_data' => 'function:getSubpanelQueryParts', 
    // Set to true to indicate we are building a custom SQL query
    'generate_select' => true,             
    'function_parameters' => array(
        // File where the above function is defined at
        'import_function_file' => 'custom/include/custom_utils.php', 
        )
);

3) Now create a file under custom/include/custom_utils.php and enter the following code

<?php
function getSubpanelQueryParts($params)
{

	$bean = $GLOBALS['app']->controller->bean;
	$accid = $bean->account_id;
	$memof = new Account();
	$memof->retrieve($accid);
	$memof = $memof->parent_id;
	$return_array['select']='SELECT contacts.id ';
	$return_array['from']='FROM contacts ';
	$return_array['where']= "WHERE contacts.id  IN ( SELECT contact_id FROM accounts_contacts where contact_id != '$bean->id' AND account_id IN ( '$bean->account_id','$memof' ) )";
	return $return_array;
}

4) Now Remove the edit and the remove button from the subpanel.
Go To admin->studio->contacts->Subpanels->Contacts->Colleagues. Remove the edit and remove button and click on “Save & Deploy”

Now Some Explanation

<?php
 // created: 2013-04-24 09:14:38
$layout_defs["Contacts"]["subpanel_setup"]['contacts_contacts_1'] = array (
  'order' => 100,
  'module' => 'Contacts',
  'subpanel_name' => 'default',
  'sort_order' => 'asc',
  'sort_by' => 'id',
  'title_key' => 'LBL_CONTACTS_CONTACTS_1_FROM_CONTACTS_R_TITLE',
  'top_buttons' => array (),
  'get_subpanel_data' => 'function:getSubpanelQueryParts', 
    // Set to true to indicate we are building a custom SQL query
    'generate_select' => true,             
    'function_parameters' => array(
        // File where the above function is defined at
        'import_function_file' => 'custom/include/custom_utils.php', 
        )
);

What I do here is to remove the top button because all we are using this subpanel is to display content and NOT actually use the relationship. We are also passing a custom query to find the contacts of the parent organization. That is defined in custom/include/custom_utils.php

<?php
function getSubpanelQueryParts($params)
{

	$bean = $GLOBALS['app']->controller->bean;
	$accid = $bean->account_id;
	$memof = new Account();
	$memof->retrieve($accid);
	$memof = $memof->parent_id;
	$return_array['select']='SELECT contacts.id ';
	$return_array['from']='FROM contacts ';
	$return_array['where']= "WHERE contacts.id  IN ( SELECT contact_id FROM accounts_contacts where contact_id != '$bean->id' AND account_id IN ( '$bean->account_id','$memof' ) )";
	return $return_array;
}

Here I am changing the where class to include the contact ids of the parent organization. Here I am doing another trick of pulling in the member organization also.

Final Output will look like this

I will come up with more tips and tricks soon as I go on and make new features for my company.

Posted in MySql, PHP, SugarCRM.

Limesurvey Integeration

Hi Guys/Gals,

Today I am presenting to you the first module I wrote with an intention of releasing it to the community. Having experience with the LimeSurvey and drupal community, I am trying to link them with the most important thing to any survey taking software, user base.

Any business would have a front end website to the world, however from time to time business may want to ask it’s user some questions and exporting and importing users can be tiring and not to mention the fact that everyday many more users are added with equally important opinions.

So this module is simple syncing module that once set up would automatically send over any user that is not yet in the LimeSurvey installation (new or old) .

At this point the module is pretty basic and allows you to sync with only one survey. However, if you wish resync a new survey that you are conducting you can always clear the sync table and resyc it with a new survey.

The way this module works is simple, it basically checks for all users in the system and add to the cron queue the one’s which are not there in the limesurvey system.

Now, I am going to explain how can you install this on your drupal 7 installation. Since I haven’t yet applied for full project access, the project is still in sandbox, I want to develop it a bit more before applying for access. The URL of the project is


http://drupal.org/sandbox/aniesshsethh/1807280

or you can download it directly from here.

LimeSurvey Integeration

Installation Instructions :

1 ) upload the files to the drupal 7 installation module directory, usually ( sites/all/modules/ ) or ( sites/all/modules/contrib/ ) . The full procedure is explained here Install

2) Enabled the modules using the module screen or drush. The drush command will be

drush en limesurvey_integeration --yes

OR the module screen

3) After the module is enabled, you need to put in the configuration settings for the limesurvey installation that you want to link to. To reach that screen you can use the configure option on the module screen or hit the url

admin/config/lsintegeration

Although the options are pretty simple , I will still walk through it.

Enable the sync -> As simple as it gets, enable or disable a module

Enter the Limesurvey URL : Simply add the URL to your installation upto admin with a trailing slash.

The survey ID : Enter the survey id with which you want to sync the users

User Name : Your username of limesurvey installation

Password : your password of limesurvey installation

Mappings : The module supports any additional field created at the drupal end to be mapped to fields at the limesurvey end.

Defaults : The module also allows to default fields to a specific value as per users requirement that will be entered in limesurvey upon successful completion.

Now before saving you need to ensure that proper settings are met in the lime survey. You need to enable the RPC interface under “interfaces” under the global settings

admin/globalsettings

If you have everything correctly entered and RPC interface enabled under limesurvey you will see a confirmation status saying everything is ok , or else you will see appropriate error.

This module has been created keeping heavy traffic websites in mind, so instead of trying to send over all the new users over a single cron run, this module adds the users to be sent over in queue which is handled by drupal in a efficient manner .

That said, this module also has a status screen where you can see which users have been successfully sent over and which are not, along with a status.

admin/config/lsintegeration/status

Also, if you are done with one survey and you want take another survey, you just need to change the survey id at the configuration screen and clear the syncing table using

admin/config/lsintegeration/clearsync

Please let me know if you used this module, for any problems, you can either leave a comment or just drop me a message using the contact me form or directly mail me at aniesshsethh@gmail.com

Posted in Drupal 7, LimeSurvey.

Hi……..

Hi Guys,

I am Aniessh Sethh from Mumbai, born and raised in Faridabad (For those of you who don’t know, it’s a small town south of Delhi). I am a Web Application Developer by profession and a open source enthusiast by nature.

I have been associated with open source in general for the past 3 years and have contributed two major projects at LimeSurvey(GSoC and summer internship) and have been actively developing in drupal.

This is my personal space where I will share and upload the stuff that I do in my free time, it maybe some modules/plugins or something creative like a poster.

Posted in General.