public function index()
    {
        $formContainer = new IrregularitiesExportForm($this->getRequestParameter('uri'));
        $myForm = $formContainer->getForm();

        if ($myForm->isValid() && $myForm->isSubmited()) {
            $delivery = $this->getResource(\tao_helpers_Uri::decode($this->getRequestParameter('uri')));

            $from = $this->hasRequestParameter('from')
                ? strtotime($this->getRequestParameter('from'))
                : '';

            $to = $this->hasRequestParameter('to')
                ? strtotime($this->getRequestParameter('to'))
                : '';

            /** @var $IrregularityReport IrregularityReport */
            $IrregularityReport = $this->getServiceLocator()->get(IrregularityReport::SERVICE_ID);

            return $this->returnTaskJson($IrregularityReport->getIrregularities($delivery, $from, $to));
        } else {
            $this->setData('myForm', $myForm->render());
            $this->setView('Irregularities/index.tpl');
        }
    }
public function index()
    {
        $formContainer = new IrregularitiesExportForm($this->getRequestParameter('uri'));
        $myForm = $formContainer->getForm();

        if ($myForm->isValid() && $myForm->isSubmited()) {
            $delivery = $this->getResource(\tao_helpers_Uri::decode($this->getRequestParameter('uri')));

            $from = $this->hasRequestParameter('from')
                ? strtotime($this->getRequestParameter('from'))
                : '';

            $to = $this->hasRequestParameter('to')
                ? strtotime($this->getRequestParameter('to'))
                : '';

            /** @var $IrregularityReport IrregularityReport */
            $IrregularityReport = $this->getServiceLocator()->get(IrregularityReport::SERVICE_ID);

            return $this->returnTaskJson($IrregularityReport->getIrregularities($delivery, $from, $to));
        } else {
            $this->setData('myForm', $myForm->render());
            $this->setView('Irregularities/index.tpl');
        }
    }
public function index ( ) { $ formContainer = new IrregularitiesExportForm ( $ this -> getRequestParameter ( 'uri' ) ) ; $ myForm = $ formContainer -> getForm ( ) ; if ( $ myForm -> isValid ( ) && $ myForm -> isSubmited ( ) ) { $ delivery = $ this -> getResource ( \ tao_helpers_Uri :: decode ( $ this -> getRequestParameter ( 'uri' ) ) ) ; $ from = $ this -> hasRequestParameter ( 'from' ) ? strtotime ( $ this -> getRequestParameter ( 'from' ) ) : '' ; $ to = $ this -> hasRequestParameter ( 'to' ) ? strtotime ( $ this -> getRequestParameter ( 'to' ) ) : '' ; /** @var $IrregularityReport IrregularityReport */ $ IrregularityReport = $ this -> getServiceLocator ( ) -> get ( IrregularityReport :: SERVICE_ID ) ; return $ this -> returnTaskJson ( $ IrregularityReport -> getIrregularities ( $ delivery , $ from , $ to ) ) ; } else { $ this -> setData ( 'myForm' , $ myForm -> render ( ) ) ; $ this -> setView ( 'Irregularities/index.tpl' ) ; } }
Displays the form to export irregularities and handles it after submit
Displays the form to export irregularities and handles it after submit