Merge branch 'cc-5709-airtime-analyzer-buy-now' into cc-5709-airtime-analyzer-buy-now-saas
Conflicts: airtime_mvc/application/views/scripts/partialviews/trialBox.phtml
This commit is contained in:
commit
338fd06f81
10 changed files with 573 additions and 53 deletions
|
@ -4,7 +4,7 @@ require_once 'Zend/Locale.php';
|
|||
class Application_Form_BillingClient extends Zend_Form
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
{
|
||||
/*$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/billing-purchase.phtml'))));*/
|
||||
$client = BillingController::getClientDetails();
|
||||
|
@ -34,7 +34,7 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
$companyname->setLabel(_('Company Name:'))
|
||||
->setValue($client["companyname"])
|
||||
->setAttrib('class', 'input_text')
|
||||
->setRequired(true)
|
||||
->setRequired(false)
|
||||
->addValidator($notEmptyValidator)
|
||||
->addFilter('StringTrim');
|
||||
$this->addElement($companyname);
|
||||
|
@ -85,7 +85,7 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
$this->addElement($state);
|
||||
|
||||
$postcode = new Zend_Form_Element_Text('postcode');
|
||||
$postcode->setLabel(_('Zip Code:'))
|
||||
$postcode->setLabel(_('Zip Code / Postal Code:'))
|
||||
->setValue($client["postcode"])
|
||||
->setAttrib('class', 'input_text')
|
||||
->setRequired(true)
|
||||
|
@ -140,15 +140,16 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
$this->addElement($securityqans);
|
||||
|
||||
foreach ($client["customfields"] as $field) {
|
||||
if ($field["id"] == 7) {
|
||||
if ($field["id"] == "7") {
|
||||
$vatvalue = $field["value"];
|
||||
} elseif ($field["id"] == 71) {
|
||||
} elseif ($field["id"] == "71") {
|
||||
$subscribevalue = $field["value"];
|
||||
}
|
||||
}
|
||||
|
||||
$vat = new Zend_Form_Element_Text('customfield7');
|
||||
$vat = new Zend_Form_Element_Text("7");
|
||||
$vat->setLabel(_('VAT/Tax ID (EU only)'))
|
||||
->setBelongsTo('customfields')
|
||||
->setValue($vatvalue)
|
||||
->setAttrib('class', 'input_text')
|
||||
//->setRequired(true)
|
||||
|
@ -156,9 +157,10 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
->addFilter('StringTrim');
|
||||
$this->addElement($vat);
|
||||
|
||||
$subscribe = new Zend_Form_Element_Checkbox('customfield71');
|
||||
$subscribe = new Zend_Form_Element_Checkbox('71');
|
||||
$subscribe->setLabel(_('Subscribe to Sourcefabric newsletter'))
|
||||
->setValue($subscribevalue)
|
||||
->setBelongsTo('customfields')
|
||||
->setAttrib('class', 'input_text')
|
||||
->setRequired(true)
|
||||
->addValidator($notEmptyValidator)
|
||||
|
|
|
@ -4,37 +4,32 @@ class Application_Form_BillingUpgradeDowngrade extends Zend_Form
|
|||
public function init()
|
||||
{
|
||||
$productPrices = array();
|
||||
$productTypes = array();
|
||||
$products = BillingController::getProducts();
|
||||
|
||||
foreach ($products as $k => $p) {
|
||||
$productPrices[$p["name"]] = array(
|
||||
"monthly" => $p["pricing"]["USD"]["monthly"],
|
||||
"annualy" => $p["pricing"]["USD"]["annually"]
|
||||
);
|
||||
$productTypes[$p["pid"]] = $p["name"];
|
||||
}
|
||||
|
||||
$productTypes = array();
|
||||
list($productPrices, $productTypes) = BillingController::getProductPricesAndTypes();
|
||||
|
||||
//$currentPlanType = ucfirst(Application_Model_Preference::GetPlanLevel());
|
||||
$currentPlanType = "Hobbyist";
|
||||
if (($key = array_search($currentPlanType, $productTypes)) !== false) {
|
||||
unset($productTypes[$key]);
|
||||
//unset($productTypes[$key]);
|
||||
}
|
||||
|
||||
$pid = new Zend_Form_Element_Radio('newproductid');
|
||||
$pid->setLabel(_('Plan type:'))
|
||||
->setMultiOptions($productTypes)
|
||||
->setRequired(true)
|
||||
->setValue(26);
|
||||
$this->addElement($pid);
|
||||
|
||||
$this->addElement($pid);
|
||||
|
||||
$billingcycle = new Zend_Form_Element_Radio('newproductbillingcycle');
|
||||
$billingcycle->setLabel(_('Billing cycle:'))
|
||||
->setMultiOptions(array('monthly' => 'monthly', 'annually' => 'annually'))
|
||||
->setMultiOptions(array('monthly' => 'Monthly', 'annually' => 'Annually'))
|
||||
->setRequired(true)
|
||||
->setValue('monthly');
|
||||
$this->addElement($billingcycle);
|
||||
|
||||
$paymentmethod = new Zend_Form_Element_Radio('paymentmethod');
|
||||
$paymentmethod->setLabel(_('Payment method:'))
|
||||
->setRequired(true)
|
||||
->setMultiOptions(array(
|
||||
'paypal' => _('PayPal'),
|
||||
'tco' => _('Credit Card via 2Checkout')))
|
||||
|
@ -47,6 +42,8 @@ class Application_Form_BillingUpgradeDowngrade extends Zend_Form
|
|||
$this->addElement($submit);*/
|
||||
|
||||
$client = new Application_Form_BillingClient();
|
||||
$client->removeElement("password2");
|
||||
$client->removeElement("password2verify");
|
||||
$this->addSubForm($client, 'billing_client_info');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue