Esempio n. 1
0
            $request_id = $rf->Save();
            $rf->CommitTransaction();
            //$rf->FailTransaction();
            //Redirect::Page( URLBuilder::getURL( array('refresh' => FALSE ), '../CloseWindow.php') );
            Redirect::Page(URLBuilder::getURL(array('refresh' => TRUE), '../CloseWindow.php'));
        }
        $rf->FailTransaction();
    default:
        if ((int) $id > 0) {
            Debug::Text(' ID was passed: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
            $rlf = new RequestListFactory();
            $rlf->getByIDAndCompanyID($id, $current_company->getId());
            foreach ($rlf as $r_obj) {
                //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);
                $data = array('id' => $r_obj->getId(), 'user_date_id' => $r_obj->getId(), 'user_id' => $r_obj->getUserDateObject()->getUser(), 'user_full_name' => $r_obj->getUserDateObject()->getUserObject()->getFullName(), 'date_stamp' => $r_obj->getUserDateObject()->getDateStamp(), 'type_id' => $r_obj->getType(), 'status_id' => $r_obj->getStatus(), 'created_date' => $r_obj->getCreatedDate(), 'created_by' => $r_obj->getCreatedBy(), 'updated_date' => $r_obj->getUpdatedDate(), 'updated_by' => $r_obj->getUpdatedBy(), 'deleted_date' => $r_obj->getDeletedDate(), 'deleted_by' => $r_obj->getDeletedBy());
            }
        } elseif ($action != 'submit') {
            Debug::Text(' ID was NOT passed: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
            //UserID has to be set at minimum
            $data = array('user_id' => $current_user->getId(), 'user_full_name' => $current_user->getFullName(), 'date_stamp' => TTDate::getTime());
        } else {
            $data['user_full_name'] = $current_user->getFullName();
        }
        //Select box options;
        $data['status_options'] = $rf->getOptions('status');
        $data['type_options'] = $rf->getOptions('type');
        $smarty->assign_by_ref('data', $data);
        break;
}
$smarty->assign_by_ref('rf', $rf);
$smarty->display('request/EditRequest.tpl');