[Vtigercrm-developers] Customising Products module - Checkbox default setup

Holbok István holbok at gmail.com
Tue Jun 29 04:24:30 PDT 2010


Dear Joe,

The provided method did not work. But I have found the right.

Line: 464 in the file \Smarty\templates\EditViewUI.tpl was responsible 
for the default checked state of all non-custom checkbox in the Product 
Module Create View:

<input name="{$fldname}" tabindex="{$vt_tab}" type="checkbox" {if ( 
$PROD_MODE eq 'create' &&  $fldname|substr:0:3 neq 'cf_') ||( 
$fldname|substr:0:3 neq 'cf_' && $PRICE_BOOK_MODE eq 'create' ) || 
$USER_MODE eq 'create'}checked{/if}>

Cheers:

Holbok István
telefon: +3670-342-0900
e-mail: holbok at gmail.com <mailto:holbok at gmail.com>
**

2010.06.29. 1:05 keltezéssel, Joe Bordes írta:
> Hi,
>
> Default values for the fields can be easily set in the EditView.php 
> script.
> Look for the next block of code:
>
> if(empty($_REQUEST['record']) && $focus->mode != 'edit'){
>     setObjectValuesFromRequest($focus);
> }
>
>
> This is telling you that if we are creating then any value coming in 
> from the REQUEST will be set as the default value.
> Any value you want to set can be done here, like this:
>
> if(empty($_REQUEST['record']) && $focus->mode != 'edit'){
>     setObjectValuesFromRequest($focus);
>     $focus->column_values['your_field']=your_default_value;
> }
>
> This is vtlib code, it is possible that Products doesn't have this, 
> but you can add it.
>
> Give it a try and let us know how it turns out.
> Joe
> TSolucio
>
>
> El 29/06/10 00:57, Holbok István escribió:
>> Hi,
>>
>> I need a small help.
>>
>> My problem is:
>> There is a checkbox type field "Product Active" in the product module 
>> set default checked when creating a new product.
>>
>> I have put some checkbox type fields into the Products module and all 
>> of them inherited default checked. But I would like to use them 
>> default unchecked.
>>
>> I have reviewed all resources:
>> Forum: 
>> http://forums.vtiger.com/viewtopic.php?t=28553&highlight=checkbox+default 
>> (Joe Bordes solution)
>> Smarty template files for the inventory
>> EditView.php for the Products module
>>
>> but I did not find the place where the checkbox set default checked.
>>
>> It is the end of EditView.php file. Here is the only comment about it:
>> *// Added to set product active when creating a new product*
>> $mode=$focus->mode;
>> if($mode != "edit" && $_REQUEST['isDuplicate'] != "true")
>>     $smarty->assign("PROD_MODE", "create");
>>
>>
>> if($focus->mode == 'edit') {
>>     $smarty->display('Inventory/InventoryEditView.tpl');
>> } else {
>>     $smarty->display('Inventory/InventoryCreateView.tpl');
>> }
>>
>> But I did not see where it is set
>>
>> Can some body help?
>>
>> Cheers:
>>
>> Holbok István
>> telefon: +3670-342-0900
>> e-mail: holbok at gmail.com <mailto:holbok at gmail.com>
>>
>>
>> _______________________________________________
>> Join vtiger community athttp://forums.vtiger.com
>
>
> _______________________________________________
> Join vtiger community at http://forums.vtiger.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20100629/33f64817/attachment-0002.html 


More information about the vtigercrm-developers mailing list