<?php
/**
 * Marketplace - Component Marketplace 
 * ******************************************************************
 *
 * PHP version 7.0
 *
 * @category   Component
 * @package    Joomla
 * @author     WebKul software private limited <support@webkul.com>
 * @copyright  2010 WebKul software private limited
 * @license    http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @version    GIT:5.2
 * @filesource http://store.webkul.com
 * @link       Technical Support:  webkul.uvdesk.com
 * ******************************************************************
 */
defined('_JEXEC') or die('Restricted access');
/**
 * JFormFieldOrderstatus class
 * 
 * @category Component
 * @package  Joomla
 * @author   WebKul software private limited <support@webkul.com>
 * @license  http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @link     Technical Support:  webkul.uvdesk.com
 */
class JFormFieldOrderstatus extends JFormField
{
    var $type = 'orderstatus';
    /**
     * GetInput function
     *
     * @return void
     */
    function getInput()
    {
        if (!class_exists('VmConfig')) {
            include JPATH_ROOT .
            '/administrator/components/com_virtuemart/helpers/config.php';
        }
        VmConfig::loadConfig();
        vmLanguage::loadJLang('com_virtuemart');
        $key = ($this->element['key_field'] ? $this->element['key_field'] : 'value');
        $val = $this->element['value_field']
            ?$this->element['value_field']:$this->name;
        $model = VmModel::getModel('Orderstatus');
        $orderStatus = $model->getOrderStatusList(true);
        foreach ($orderStatus as $orderState) {
            $orderState->order_status_name = vmText::_(
                $orderState->order_status_name
            );
        }
        return JHtml::_(
            'select.genericlist',
            $orderStatus,
            $this->name,
            'class="inputbox" multiple="true" size="2"',
            'order_status_code',
            'order_status_name',
            $this->value,
            $this->id
        );
    }
}
