<?php

// TODO: integrare cu plugin ce adauga validare de CUI (RO)

namespace Modules\Orders\Cancel;

class View_Utils_FormService extends \App\Mvc\View_Utils_FormAbstract
{

	/**
	 * Creates the form for supplier insert/update.
	 * @see \App\Mvc\View_Utils_FormAbstract::getForm()
	 */
	public function getForm()
	{

		// FORM FIELDS FOR ADDING AND EDITING SUPPLIERS ///////////////////////////////////////////
		$form = \Engine\Form\General::create();
		$form->setStyle('width', 250)->setStyle('labelWidth', 40);

		// SERVICE GROUP //////////////////////////////////////////////////////////////////////////
		$fieldset1 = \Engine\Form\Container\Fieldset::create($this->lang['formFieldsCat']['serviceCancel']);
		$form->addContainer($fieldset1);

		// service cancel reason
		$fld_servCancelReason = new \App\Form\Input\Select_ServiceCancelReason($this->lang['formFields']['serviceCancelReason'], 'serviceCancelReason', $this->values['serviceCancelReason']);
		$fld_servCancelReason->setMandatory(true);
		$fld_servCancelReason->showDefaultOption();
		$fieldset1->addElement($fld_servCancelReason);

		// service cancel details
		$fld_servCancelDet = new \Engine\Form\Input\Textarea($this->lang['formFields']['serviceCancelDetails'], 'serviceCancelDetails', $this->values['serviceCancelDetails']);
		$fld_servCancelDet->setMandatory(false);
		$fieldset1->addElement($fld_servCancelDet);


		// service/order id
		$form->addElement(new \Engine\Form\Input\Hidden('', 'idService', $this->values['idService']));

		// submit button
		$form->addElement(new \Engine\Form\Input\Hidden('', 'save', 1));

		return $form;

	}

}