[Vtigercrm-developers] HELP ME!

Andrew Rodes arodes at onweald.com
Tue Mar 14 08:05:42 PST 2006


I would like to suggest one small change to the proposed change. I
implemented the change Luis mentions verbatim several weeks ago, but it
would insert the literal 'null' into ALL blank fields. I would recommend the
following instead which adds a small check to see if the field is likely a
foreign key. This is the code I submitted in the patch for quotes (tic 51).
It appears Sales Orders has the same basic problem, so the fix should work
here as well.

> changed   modules/orders/SaveSalesOrders.php
> Old =
>
> line 44   foreach($focus->column_fields as $fieldname => $val)
> {
>    if(isset($_REQUEST[$fieldname]))
>    {
>        $value = $_REQUEST[$fieldname];
>                   //echo '<BR>';
>        //echo $fieldname."         ".$value;
>        //echo '<BR>';
>        $focus->column_fields[$fieldname] = $value;
>    }
>       }
>

> New=
>
> Line 44 foreach($focus->column_fields as $fieldname => $val) {
>    if(isset($_REQUEST[$fieldname]))
>    {
>        $value = $_REQUEST[$fieldname];
>>		$match = stristr($fieldname,'id'); // adding this to try and
set only foreign keys. we dont want ALL blank values set to null
>>		if(empty($value) && $match != '0') 
>>		{ 
>>		$value = 'null';
>>		} 
>                    //echo '<BR>';
>        //echo $fieldname."         ".$value;
>        //echo '<BR>';
>        $focus->column_fields[$fieldname] = $value;
>    }
>       }
 


Andy Rodes
arodes at onweald.com
-----Original Message-----
From: vtigercrm-developers-bounces at lists.vtigercrm.com
[mailto:vtigercrm-developers-bounces at lists.vtigercrm.com] On Behalf Of Mike
Fedyk
Sent: Monday, March 13, 2006 6:00 PM
To: Luis Alberto Arenas Salinas
Subject: Re: [Vtigercrm-developers] HELP ME!

Great!

I'll add this to my list of patches to review.

Mike

Luis Alberto Arenas Salinas wrote:

> Well, if some body have problem with save sales orders trough qoute 
> module, i solve it do it:
>
> changed   modules/orders/SaveSalesOrders.php
>
> Old =
>
> line 44   foreach($focus->column_fields as $fieldname => $val)
> {
>    if(isset($_REQUEST[$fieldname]))
>    {
>        $value = $_REQUEST[$fieldname];
>                   //echo '<BR>';
>        //echo $fieldname."         ".$value;
>        //echo '<BR>';
>        $focus->column_fields[$fieldname] = $value;
>    }
>       }
>
>
> New=
>
> Line 44 foreach($focus->column_fields as $fieldname => $val) {
>    if(isset($_REQUEST[$fieldname]))
>    {
>        $value = $_REQUEST[$fieldname];
>            // New Lines HERE
>                if(empty($value))
>                {
>                      $value = 'null';
>                }
>                    //echo '<BR>';
>        //echo $fieldname."         ".$value;
>        //echo '<BR>';
>        $focus->column_fields[$fieldname] = $value;
>    }
>       }
>
>
>
_______________________________________________
This vtiger.com email is sponsored by Zoho Planner. Still scribbling down
your To-Do's on bits of paper & palms of your hands? Try the AJAX enabled,
personal organizer online, Zoho Planner for FREE instead!
http://zohoplanner.com/?vt 





More information about the vtigercrm-developers mailing list