Exemplo n.º 1
0
     $cf->setStatus(10);
     $cf->setProductEdition((int) getTTProductEdition());
     $cf->setName($company_data['name']);
     $cf->setShortName($company_data['short_name']);
     $cf->setAddress1($company_data['address1']);
     $cf->setAddress2($company_data['address2']);
     $cf->setCity($company_data['city']);
     $cf->setCountry($company_data['country']);
     $cf->setProvince($company_data['province']);
     $cf->setPostalCode($company_data['postal_code']);
     $cf->setWorkPhone($company_data['work_phone']);
     $cf->setEnableAddCurrency(TRUE);
     $cf->setEnableAddPermissionGroupPreset(TRUE);
     $cf->setEnableAddStation(TRUE);
     $cf->setEnableAddPayStubEntryAccountPreset(TRUE);
     $cf->setEnableAddCompanyDeductionPreset(TRUE);
     $cf->setEnableAddRecurringHolidayPreset(TRUE);
     if ($cf->isValid()) {
         $company_id = $cf->Save();
         $install_obj->writeConfigFile(array('primary_company_id' => $company_id));
         Redirect::Page(URLBuilder::getURL(array('company_id' => $company_id, 'external_installer' => $external_installer), 'User.php'));
         break;
     }
 default:
     //Select box options;
     $company_data['status_options'] = $cf->getOptions('status');
     $company_data['country_options'] = $cf->getOptions('country');
     if (!isset($id) and isset($company_data['id'])) {
         $id = $company_data['id'];
     }
     $company_data['user_list_options'] = UserListFactory::getByCompanyIdArray($id);