@mkdir($dir, 0700, TRUE); $upload_result = $upload->upload("filedata", $dir); //var_dump($upload ); //file data if ($upload_result) { $success = $upload_result . ' ' . TTi18n::gettext('Successfully Uploaded'); } else { $error = $upload->get_error(); } } Debug::Text('Post Upload Operation...', __FILE__, __LINE__, __METHOD__, 10); if (isset($success) and $success != '') { Debug::Text('Rename', __FILE__, __LINE__, __METHOD__, 10); $file_data_arr = $upload->get_file(); $license_data = trim(file_get_contents($dir . '/' . $upload_result)); $license = new TTLicense(); $retval = $license->getLicenseFile(TRUE, $license_data); //Download updated license file if one exists. if ($retval === FALSE) { $error = TTi18n::gettext('Invalid License File'); } } } else { Debug::Text('Permission denied for upload!', __FILE__, __LINE__, __METHOD__, 10); } break; case 'import': $import = TTnew('Import'); $import->company_id = $current_company->getId(); $import->user_id = $current_user->getId(); //Debug::setVerbosity(11); $upload->set_max_filesize(128000000);
function isNewVersionAvailable($ytd = 0, $all_companies = FALSE) { Debug::Text('Check For Update!', __FILE__, __LINE__, __METHOD__, 10); $current_company = $this->getCurrentCompanyObject(); $data = $this->getAboutData($ytd, $all_companies); $ttsc = new TimeTrexSoapClient(); //We must ensure that the data is up to date //Otherwise version check will fail. $ttsc->sendCompanyData($current_company->getId(), TRUE); $ttsc->sendCompanyUserLocationData($current_company->getId()); $ttsc->sendCompanyUserCountData($current_company->getId()); $ttsc->sendCompanyVersionData($current_company->getId()); $license = new TTLicense(); $license->getLicenseFile(FALSE); //Download updated license file if one exists. $latest_version = $ttsc->isLatestVersion($current_company->getId()); $latest_tax_engine_version = $ttsc->isLatestTaxEngineVersion($current_company->getId()); $latest_tax_data_version = $ttsc->isLatestTaxDataVersion($current_company->getId()); $sslf = TTnew('SystemSettingListFactory'); $sslf->getByName('new_version'); if ($sslf->getRecordCount() == 1) { $obj = $sslf->getCurrent(); } else { $obj = TTnew('SystemSettingListFactory'); } $obj->setName('new_version'); if ($latest_version == FALSE or $latest_tax_engine_version == FALSE or $latest_tax_data_version == FALSE) { $obj->setValue(1); $data['new_version'] = TRUE; } else { $obj->setValue(0); $data['new_version'] = FALSE; } if ($obj->isValid()) { $obj->Save(); } return $this->returnHandler($data); }
require_once Environment::getBasePath() . 'includes/Interface.inc.php'; //Debug::setVerbosity(11); $smarty->assign('title', TTi18n::gettext($title = '4. Upgrade Complete')); // See index.php /* * Get FORM variables */ extract(FormVariables::GetVariables(array('action', 'data'))); $install_obj = new Install(); if ($install_obj->isInstallMode() == FALSE) { Redirect::Page(URLBuilder::getURL(NULL, 'install.php')); exit; } //Check for updated license file. $license = new TTLicense(); $license->getLicenseFile(TRUE); //Download updated license file if one exists. $action = Misc::findSubmitButton(); switch ($action) { case 'back': Debug::Text('Back', __FILE__, __LINE__, __METHOD__, 10); Redirect::Page(URLBuilder::getURL(NULL, 'DatabaseConfig.php')); break; case 'next': Debug::Text('Next', __FILE__, __LINE__, __METHOD__, 10); Redirect::Page(URLBuilder::getURL(NULL, 'Done.php?upgrade=1')); break; default: break; } $cache->clean();
//Debug::Text(' Encoded Data ('.strlen($encoded_data).'): '. $encoded_data, __FILE__, __LINE__, __METHOD__,10); } Redirect::Page(URLBuilder::getURL(array('data' => $encoded_data), 'https://www.timetrex.com/university.php')); exit; break; case 'check_for_updates': Debug::Text('Check For Update!', __FILE__, __LINE__, __METHOD__, 10); $ttsc = new TimeTrexSoapClient(); //We must ensure that the data is up to date //Otherwise version check will fail. $ttsc->sendCompanyData($current_company->getId(), TRUE); $ttsc->sendCompanyUserLocationData($current_company->getId()); $ttsc->sendCompanyUserCountData($current_company->getId()); $ttsc->sendCompanyVersionData($current_company->getId()); $license = new TTLicense(); $license->getLicenseFile(FALSE); //Download updated license file if one exists. $latest_version = $ttsc->isLatestVersion($current_company->getId()); $latest_tax_engine_version = $ttsc->isLatestTaxEngineVersion($current_company->getId()); $latest_tax_data_version = $ttsc->isLatestTaxDataVersion($current_company->getId()); $sslf = TTnew('SystemSettingListFactory'); $sslf->getByName('new_version'); if ($sslf->getRecordCount() == 1) { $obj = $sslf->getCurrent(); } else { $obj = TTnew('SystemSettingListFactory'); } $obj->setName('new_version'); if ($latest_version == FALSE or $latest_tax_engine_version == FALSE or $latest_tax_data_version == FALSE) { $obj->setValue(1); $data['new_version'] = 1;