# ivyforms/0.8.1/backend/src/Services/Template/SoftwarePurchaseOrderFormTemplate.php

The Innovative Form Builder – IvyForms, version 0.8.1. 248 lines.

- Page: https://pluginprobe.com/plugins/ivyforms/0.8.1/code/backend/src/Services/Template/SoftwarePurchaseOrderFormTemplate.php
- Raw: https://pluginprobe.com/plugins/ivyforms/0.8.1/raw/backend/src/Services/Template/SoftwarePurchaseOrderFormTemplate.php
- Modified: 2026-01-29T13:48:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ivyforms/0.8.1/code/backend/src/Services/Template/SoftwarePurchaseOrderFormTemplate.php#L10-L20`.

```php
<?php

namespace IvyForms\Services\Template;

// phpcs:disable PSR1.Files.SideEffects
if (!defined('ABSPATH')) {
    exit; // Exit if accessed directly
}

use IvyForms\Services\Translations\BackendStrings;

/**
 * Software Purchase Order Form Template
 */
class SoftwarePurchaseOrderFormTemplate
{
    /**
     * Get the template configuration
     *
     * @return array<string, mixed>
     */
    public static function getTemplate(): array
    {
        return [
            'id' => 'software_purchase_order_form',
            'name' => BackendStrings::getTemplateStrings()['software_purchase_order_form'],
            'description' => BackendStrings::getTemplateStrings()[
                'software_purchase_order_form_description'
            ],
            'category' => 'order-forms',
            'subcategory' => 'general-product-order-form',
            'is_pro' => false,
            'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'software-purchase-order-form.svg',
            'form_data' => [
                'name' => BackendStrings::getTemplateStrings()['software_purchase_order_form'],
                'published' => 1,
                'showTitle' => 1,
                'storeEntries' => 1,
                'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
                'fields' => array_merge(
                    self::getRequestorInformationFields(),
                    self::getSoftwareDetailsFields(),
                    self::getAdditionalInformationFields()
                ),
                'settings' => []
            ]
        ];
    }

    /**
     * Requestor information fields (name, email, phone, department)
     *
     * @return array<int, array<string, mixed>>
     */
    private static function getRequestorInformationFields(): array
    {
        return [
            // Requestor Name
            [
                'id' => 0,
                'fieldIndex' => 1,
                'type' => 'name',
                'label' => BackendStrings::getTemplateStrings()['requestor_name'],
                'parentId' => null,
                'defaultValue' => '',
                'placeholder' => '',
                'required' => true,
                'readonly' => false,
                'position' => 1,
            ],
            // First Name - Child of Name Field
            [
                'id' => 0,
                'type' => 'text',
                'label' => BackendStrings::getTemplateStrings()['first_name'],
                'placeholder' => BackendStrings::getTemplateStrings()['enter_your_first_name'],
                'required' => true,
                'parentId' => 0,
                'fieldIndex' => 1,
                'defaultValue' => '',
                'position' => 1,
                'optionHide' => false,
                'description' => '',
                'settings' => json_encode(['nameFieldType' => 'nameField1']),
            ],
            // Last Name - Child of Name Field
            [
                'id' => 0,
                'type' => 'text',
                'label' => BackendStrings::getTemplateStrings()['last_name'],
                'placeholder' => BackendStrings::getTemplateStrings()['enter_your_last_name'],
                'required' => true,
                'parentId' => 0,
                'fieldIndex' => 1,
                'defaultValue' => '',
                'position' => 2,
                'optionHide' => false,
                'description' => '',
                'settings' => json_encode(['nameFieldType' => 'nameField2']),
            ],
            // Email Address
            [
                'id' => 0,
                'fieldIndex' => 2,
                'type' => 'email',
                'label' => BackendStrings::getTemplateStrings()['email_address'],
                'placeholder' => BackendStrings::getTemplateStrings()['email_placeholder'],
                'required' => true,
                'parentId' => null,
                'defaultValue' => '',
                'position' => 3,
            ],
            // Phone Number
            [
                'id' => 0,
                'fieldIndex' => 3,
                'type' => 'phone',
                'label' => BackendStrings::getTemplateStrings()['phone_number'],
                'placeholder' => BackendStrings::getTemplateStrings()['phone_placeholder'],
                'required' => false,
                'parentId' => null,
                'defaultValue' => '',
                'position' => 4,
            ],
            // Department
            [
                'id' => 0,
                'fieldIndex' => 4,
                'type' => 'text',
                'label' => BackendStrings::getTemplateStrings()['department'],
                'placeholder' => BackendStrings::getTemplateStrings()['enter_department'],
                'required' => true,
                'parentId' => null,
                'defaultValue' => '',
                'position' => 5,
            ],
        ];
    }

    /**
     * Software details fields (software name, number of licenses, license type)
     *
     * @return array<int, array<string, mixed>>
     */
    private static function getSoftwareDetailsFields(): array
    {
        return [
            // Software Name
            [
                'id' => 0,
                'fieldIndex' => 5,
                'type' => 'text',
                'label' => BackendStrings::getTemplateStrings()['software_name'],
                'placeholder' => BackendStrings::getTemplateStrings()['enter_software_name'],
                'required' => true,
                'parentId' => null,
                'defaultValue' => '',
                'position' => 6,
            ],
            // Number of Licenses
            [
                'id' => 0,
                'fieldIndex' => 6,
                'type' => 'number',
                'label' => BackendStrings::getTemplateStrings()['number_of_licenses'],
                'placeholder' => BackendStrings::getTemplateStrings()['enter_number_of_licenses'],
                'required' => true,
                'parentId' => null,
                'defaultValue' => '',
                'position' => 7,
                'minValue' => 1,
            ],
            // License Type
            [
                'id' => 0,
                'fieldIndex' => 7,
                'type' => 'select',
                'label' => BackendStrings::getTemplateStrings()['license_type'],
                'placeholder' => BackendStrings::getTemplateStrings()['select_license_type'],
                'required' => false,
                'parentId' => null,
                'defaultValue' => '',
                'position' => 8,
                'fieldOptions' => [
                    [
                        'id' => 0,
                        'label' => BackendStrings::getTemplateStrings()['single_user'],
                        'value' => 'single_user',
                        'isDefault' => false,
                        'position' => 1
                    ],
                    [
                        'id' => 0,
                        'label' => BackendStrings::getTemplateStrings()['multi_user'],
                        'value' => 'multi_user',
                        'isDefault' => false,
                        'position' => 2
                    ],
                    [
                        'id' => 0,
                        'label' => BackendStrings::getTemplateStrings()['enterprise'],
                        'value' => 'enterprise',
                        'isDefault' => false,
                        'position' => 3
                    ],
                ]
            ],
        ];
    }

    /**
     * Additional information fields (notes, activation date)
     *
     * @return array<int, array<string, mixed>>
     */
    private static function getAdditionalInformationFields(): array
    {
        return [
            // Additional Notes or Requirements
            [
                'id' => 0,
                'fieldIndex' => 8,
                'type' => 'textarea',
                'label' => BackendStrings::getTemplateStrings()['additional_notes_or_requirements'],
                'placeholder' => BackendStrings::getTemplateStrings()['enter_additional_notes_or_requirements'],
                'required' => false,
                'parentId' => null,
                'defaultValue' => '',
                'position' => 9,
            ],
            // Required Activation Date
            [
                'id' => 0,
                'fieldIndex' => 9,
                'type' => 'date',
                'label' => BackendStrings::getTemplateStrings()['required_activation_date'],
                'placeholder' => BackendStrings::getTemplateStrings()['select_required_activation_date'],
                'required' => true,
                'parentId' => null,
                'defaultValue' => '',
                'position' => 10,
                'dateFieldType' => 'picker',
                'dateFormat' => 'MM/DD/YYYY',
            ],
        ];
    }
}

```
