Gravity Form Nested Forms hijack to AirTables - gravity-forms-plugin

I have a form for registering an organization for an event and then a nested form to put who will sit at the table. A classic example of this: https://gravitywiz.com/documentation/gravity-forms-nested-forms/
What I need is to push the parent info and nested people into AirTables. I need to manipulate it a before it goes in but I can do that if I could just call the nested data! On submission of the parent form I capture the Unique ID for that submission. In Exporting the child data view Gravity Forms I see that the ID of the parent is appended to the row(s). That is awesome. However, I can't find that variable anywhere when I print_r out a get_entries in GravityForms.
I have been up and down the docs. I am stumped. How do I call Nested forms results based on the Parent Entry ID? I see it on the export but can't find it in the raw data? Below is the raw data from a nested form submission. I see no record of the Parent Entry ID. Yet, when I export it (Excel image) you can see it.
Array ( [id] => 2099 [form_id] => 5 [post_id] => [date_created] => 2022-11-08 16:56:22 [date_updated] => 2022-11-08 16:56:22 [is_starred] => 0 [is_read] => 0 [ip] => 66.248.200.2 [source_url] => https://ecologik.net/ccs-test-form/ [user_agent] => Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0 [currency] => USD [payment_status] => [payment_date] => [payment_amount] => [payment_method] => [transaction_id] => [is_fulfilled] => [created_by] => 1 [transaction_type] => [status] => active [1.3] => 1 [1.6] => 1 [3] => 222222 [5] => 2022-11-11 [4.1] => sadfsda [4.3] => sdaf [4.4] => Indiana [4.5] => 45678 [4.6] => United States [2] => https://image.jpeg [is_approved] => 3 [1.2] => [1.4] => [1.8] => [4.2] => [6] => [workflow_current_status_timestamp] => )

Using the parent id, you can get the array of nested form ids.
$entry_id = '1';//replace 1 with the ids of your parent form. It can either be a specific id or you could run it through a loop and search all the form entries
$entry = GFAPI::get_entry( $entry_id );
$get_nested = $entry['3'];//replace 3 with the field id containing your nested form entries.
Then you can loop through them to get what you need.
if(!empty($get_nested)){
$nested_ids=explode(",",$get_nested);
foreach($nested_ids as $nested_id){
$nested_entry = GFAPI::get_entry( $nested_id );
//now add code to get what you need from each entry
}
}

Related

How to modify Mediawiki Login form

I'm trying to add the attribute autocomplete="off" in mediawiki login form. Being completely new, I'm unable to find where the form is being built.
I'm using MediaWiki 1.29.1
Any help would be greatly appreciated.
Things I did to find it:
1. Added the following code in LocalSettings.php
$wgHooks['UserLoginForm'][] = 'modifyLoginForm';
function modifyLoginForm( &$template ) {
//Printed template and got the following
/*
UserloginTemplate Object
(
[data] => Array
(
[link] =>
[header] =>
[name] => Admin
[password] =>
[retype] =>
[email] =>
[realname] =>
[domain] =>
[reason] =>
[action] => /mediawiki/index.php?title=Special:UserLogin&action=submitlogin&type=login&returnto=Main+Page
[message] =>
[messagetype] => error
[createemail] =>
[userealname] => 1
[useemail] => 1
[emailrequired] =>
[emailothers] => 1
[canreset] => 1
[resetlink] => 1
[canremember] => 1
[usereason] =>
[remember] =>
[cansecurelogin] =>
[stickHTTPS] =>
[token] => 18955182baa69e0a66edefghi4e0ef
[loginend] =>
[signupend] =>
[usedomain] =>
)
*/
}
Tried to modify includes/templates/Userlogin.php . There is a login form, but it didn't get affected.
Checked LoginSignupSpecialPage.php, but not sure how to add the attribute.

(Salesforce Force.com REST API) How do I determine which products are associated with opportunities?

I'm using the Salesforce Force.com REST API. I need to determine which Products (Product2) are associated with Opportunities (Opportunity). Thus far, I've been unable to make the connection.
In the Salesofrce UI, opportunities can be associated with pricebooks and products. Pricebooks contain products, but it is also possible to associate products with an opportunity directly.
Querying an opportunity via the API yields the following:
Array
(
[0] => Array
(
[attributes] => Array
(
[type] => Opportunity
[url] => /services/data/v33.0/sobjects/Opportunity/xxxxxxxxxxxxxxxx
)
[Id] => xxxxxxxxxxxxxxxx
[IsDeleted] =>
[AccountId] => xxxxxxxxxxxxxxxxx
[Name] => Some Name
[Description] =>
[StageName] => Closed Won
[Amount] => 650
[Probability] => 100
[CloseDate] => 2012-04-12
[Type] => New Business
[NextStep] => A string
[LeadSource] => something
[IsClosed] => 1
[IsWon] => 1
[ForecastCategory] => Closed
[ForecastCategoryName] => Closed
[CampaignId] =>
[HasOpportunityLineItem] => 1
[Pricebook2Id] => xxxxxxxxxxxxxxxxxxxxx
[OwnerId] => xxxxxxxxxxxxxxxxxxx
[CreatedDate] => 2012-12-30T20:17:35.000+0000
[CreatedById] => xxxxxxxxxxxxxxxxxxxxxxxxxxx
[LastModifiedDate] => 2015-05-22T15:20:18.000+0000
[LastModifiedById] => xxxxxxxxxxxxxxxxxxxxxxxx
[SystemModstamp] => 2015-05-22T15:20:18.000+0000
[LastActivityDate] =>
[FiscalQuarter] => 1
[FiscalYear] => 2015
[Fiscal] => 2015 1
[LastViewedDate] => 2015-06-03T14:38:03.000+0000
[LastReferencedDate] => 2015-06-03T14:38:03.000+0000
[SyncedQuoteId] =>
[Type_of_Deal__c] => Monthly Contract Count
[Number_of_Contracts__c] => 999
[Fee_Per_Contract__c] => 999
[Installation_Fee__c] =>
[Roof_Top_Fee__c] =>
[LID__LinkedIn_Company_Id__c] =>
[inclusion_type__c] => inclusion type
[Total_Contract_Term__c] => 999
[Monthly_Value_of_Fee_Per_Contract__c] => 999
[Total_Value_of_Fee_Per_Contract__c] => 999
[Total_Value_of_Roof_Top_Fee__c] => 0
[Monthly_Fidels_Revenue__c] => 999
[Total_Value_of_Deal__c] => 999
[Number_of_Roof_Tops__c] =>
[Monthly_Value_of_Roof_Top_Fee__c] => 0
[Installation_Date__c] => 2012-01-01
[Reason_if_Lost__c] =>
[Total_Monthly_Revenue__c] => 999
[Existing_Agency__c] => Service Group
[Number_of_Contracts_in_Last_Batch__c] => 999
[Agent_Name__c] => John Smith
[Total_Value_of_Agency_Revenue__c] => 9999
[Contract_Start_Date__c] => 2012-01-01
[Batch_Received__c] => Yes
[Administrator__c] =>
[Per_Contract__c] => 999
[Integration_type__c] =>
[Last_Batch_ID__c] =>
[Last_Batch_Date__c] =>
)
)
From which you can see that no Product2 data is available. There is however, a Pricebook2Id. One might assume that querying that specific pricebook would yield information on which products are associated with it. However, querying a specific pricebook yields the following:
Array
(
[0] => Array
(
[attributes] => Array
(
[type] => Pricebook2
[url] => /services/data/v33.0/sobjects/Pricebook2/xxxxxxxxxxxx
)
[Id] => xxxxxxxxxxxxxxxxxxxx
[IsDeleted] =>
[Name] => Company Price Book
[CreatedDate] => 2011-11-14T18:36:23.000+0000
[CreatedById] => xxxxxxxxxxxxxxxxxxx
[LastModifiedDate] => 2011-11-14T18:36:23.000+0000
[LastModifiedById] => xxxxxxxxxxxxxxxxxxxxxxx
[SystemModstamp] => 2011-11-14T18:36:23.000+0000
[LastViewedDate] => 2015-06-04T19:41:20.000+0000
[LastReferencedDate] => 2015-06-04T19:41:20.000+0000
[IsActive] => 1
[Description] =>
[IsStandard] =>
)
)
As you can see, no information about products is available from the pricebook. So my question is:
How do I determine which products are associated with opportunities using the Salesforce Force.com REST API?
There is an object called 'Opportunity Product'. you need to get that object as well and link the proper opportunity to product.
It's a many to many relation and not one to many so more than one product might be related to each opportunity and vise versa.

Don't post form input fields which are hidden?

I have created a form where input fields are shown/hidden based on selections and i like to post only the input fields which are visible. At the moment the values of the hidden input fields are also submitten
I checked the $_POST and i see
[chairs] => Array
(
[0] => chair-b-white
[1] => chair-c-black
)
[num_of_chair-a-black] =>
[num_of_chair-a-white] =>
[num_of_chair-a-gray] =>
[num_of_chair-b-black] =>
[num_of_chair-b-white] => 2
[num_of_chair-b-gray] =>
[num_of_chair-c-black] => 5
[num_of_chair-c-white] =>
[num_of_chair-c-gray] =>
Is there a way to skip posting input fields which are empty?
I assume you toggle the fields' visibility using javascript. When hiding them you can also set them to disabled. Disabled form fields are not submitted to the server.

per-item details ci-merchant and PayPalExpress

I am using ci-merchant and I want to do my cart checkout with PayPal Express.
This is the code I am using:
$this->load->library('merchant');
$this->merchant->load('paypal_express');
$settings = $this->merchant->default_settings();
$settings = array(
'username' => 'bla bla bla.gmail.com',
'password' => 'bla bla bla',
'signature' => 'bla bla bla',
'test_mode' => true);
$this->merchant->initialize($settings);
$params =array(
'amount' => $this->cart->format_number($this->cart->total()),
'currency' => 'EUR',
'return_url' => 'https://www.example.com/checkout/payment_return/123',
'cancel_url' => 'https://www.example.com/checkout',
'description' => 'Esto es desc'
);
$response = $this->merchant->purchase($params);
With the above code I am being redirected to PayPal just fine, but at the items column I only see one unique item.
Now I would like to add per-item description, qty and price. But I don't know the where to include my items array, and wich format should I use. I can't find it on ci-merchant docs. Can anybody explain me?
You just need to setup your $params to include all of the fields you would need to make it work, and you need to make sure you're using version 63.0 or later.
It can be a little tricky, though, because any Express Checkout flow could include more than 1 payment, and each payment included could include more than 1 item, so you'll end up adding 0,1,2, etc. to params.
Here's a sample of SetExpressCheckout with 1 payment that has 2 items on it.
[REQUESTDATA] => Array
(
[USER] => ***
[PWD] => ***
[VERSION] => 97.0
[BUTTONSOURCE] => AngellEYE_PHPClass
[SIGNATURE] => ***
[METHOD] => SetExpressCheckout
[MAXAMT] => 200.00
[RETURNURL] => http://paypal.angelleye.com/standard/samples/DoExpressCheckoutPayment.php
[CANCELURL] => http://paypal.angelleye.com/paypal/class/cancel.php
[ALLOWNOTE] => 1
[HDRIMG] => http://paypal.angelleye.com/images/hdrimg.jpg
[SOLUTIONTYPE] => Sole
[LANDINGPAGE] => Billing
[BRANDNAME] => Angell EYE
[CUSTOMERSERVICENUMBER] => 555-555-5555
[BUYEREMAILOPTIONENABLE] => 1
[PAYMENTREQUEST_0_AMT] => 100.00
[PAYMENTREQUEST_0_CURRENCYCODE] => USD
[PAYMENTREQUEST_0_ITEMAMT] => 80.00
[PAYMENTREQUEST_0_SHIPPINGAMT] => 15.00
[PAYMENTREQUEST_0_TAXAMT] => 5.00
[PAYMENTREQUEST_0_DESC] => This is a test order.
[PAYMENTREQUEST_0_NOTETEXT] => This is a test note before ever having left the web site.
[PAYMENTREQUEST_0_PAYMENTACTION] => Sale
[L_PAYMENTREQUEST_0_NAME0] => Widget 123
[L_PAYMENTREQUEST_0_DESC0] => Widget 123
[L_PAYMENTREQUEST_0_AMT0] => 40.00
[L_PAYMENTREQUEST_0_NUMBER0] => 123
[L_PAYMENTREQUEST_0_QTY0] => 1
[L_PAYMENTREQUEST_0_ITEMURL0] => http://www.angelleye.com/products/123.php
[L_PAYMENTREQUEST_0_ITEMCATEGORY0] => Digital
[L_PAYMENTREQUEST_0_NAME1] => Widget 456
[L_PAYMENTREQUEST_0_DESC1] => Widget 456
[L_PAYMENTREQUEST_0_AMT1] => 40.00
[L_PAYMENTREQUEST_0_NUMBER1] => 456
[L_PAYMENTREQUEST_0_QTY1] => 1
[L_PAYMENTREQUEST_0_ITEMURL1] => http://www.angelleye.com/products/456.php
[L_PAYMENTREQUEST_0_ITEMCATEGORY1] => Digital
)
That results in the following when redirected to PayPal..
CI Merchant doesn't support listing order items in PayPal out of the box. There is a pull request which supports this, but it won't be merged into master until we work around some tax calculation and rounding issues.
Until it's supported officially, you may want to try using the forked version to achieve this, or simply edit the PayPal driver yourself to pass through the item data.

zend framework action name changes to 'id'

I have a zend framework application with modules 'dashboard' and 'admin' of which 'dashboard' is the default one. When I try to access a different module, I am getting the request object like this
Zend_Controller_Request_Http Object
(
[_paramSources:protected] => Array
(
[0] => _GET
[1] => _POST
)
[_requestUri:protected] => /admin/application/show/
[_baseUrl:protected] => http://local.dashmonitor.us.com
[_basePath:protected] =>
[_pathInfo:protected] => /admin/application/show/
[_params:protected] => Array
(
[module] => admin
[controller] => application
[action] => get
[id] => show
)
[_rawBody:protected] =>
[_aliases:protected] => Array
(
)
[_dispatched:protected] => 1
[_module:protected] => admin
[_moduleKey:protected] => module
[_controller:protected] => application
[_controllerKey:protected] => controller
[_action:protected] => get
[_actionKey:protected] => action
)
My real action name is 'show' but it changes to 'get' here. Can anybody please help?