Showing posts with label develop. Show all posts
Showing posts with label develop. Show all posts

Thursday, 12 February 2015

[vTiger 6] Change comments order

If you want see the comments of your modules ordered by creation date, open  "\modules\ModComments" file, search "getAllParentComments($parentId)" function and edit the line

//Condition are directly added as query_generator transforms the
//reference field and searches their entity names
$query = $query ." AND related_to = ? AND parent_comments = '' ORDER BY vtiger_crmentity.createdtime DESC";

Change to:

$query = $query ." AND related_to = ? AND parent_comments = '' ORDER BY vtiger_crmentity.createdtime ASC";

Wednesday, 21 May 2014

[vTiger 6] Updated: How to disable editing on details view

vTiger 6 provides the ability to quick edit on details view for each module. This is an advantage but if you have a picklist dependency, it not will be controlated to AJAX on details view. It could induce a data inconsistency.

To solve this problem, edit on your module the file: vtigerinstallation_path\modules\module_name\views\Detail.php comment all lines inside the function public function getHeaderScripts(Vtiger_Request $request) { }
but not comment the function.

Example: Disable editing on service module.



public function getHeaderScripts(Vtiger_Request $request) {
    // I will to comment from here
    /*
    parent::getHeaderScripts($request);
    $headerScriptInstances = parent::getHeaderScripts($request);
    $moduleName = $request->getModule();
    $modulePopUpFile = 'modules.'.$moduleName.'.resources.Edit';
    unset($headerScriptInstances[$modulePopUpFile]);

    $jsFileNames = array(
'modules.Products.resources.Edit',
    );
    $jsFileNames[] = $modulePopUpFile;

    $jsScriptInstances = $this->checkAndConvertJsScripts($jsFileNames);
    $headerScriptInstances = array_merge($headerScriptInstances, $jsScriptInstances);
    return $headerScriptInstances;
    */ 
    //to here
    }


Now you can't edit the fields from details view.

Best regards.



Update:

Another way by Anonymous

On the showModuleDetailView function. I erased few lines, just to show that I comment the

Wednesday, 9 April 2014

[vTiger 6] How to change default fields on popup ListView

When I need to select some item of a vTiger module from other, a popup window is opened. A list of items appears with a columns by default but we can't choose them from GUI. We need to change the code. 

The following example changes the columns for Products module. We are going to add two new columns to the view, the Serial Number and the Category of the product:


Wednesday, 26 February 2014

[MySQL] - Regular Expressions - How to check a decimal number

To check if the field value is a decimal number, you can use the following expresion

REGEXP '^[[:digit:]]+\\.{0,1}[[:digit:]]*$'

Example: 
select '3.222' REGEXP '^[[:digit:]]+\\.{0,1}[[:digit:]]*$' as prueba;