Beispiel #1
0
 $cf->setCountry($company_data['country']);
 if (isset($company_data['province'])) {
     $cf->setProvince($company_data['province']);
 }
 $cf->setPostalCode($company_data['postal_code']);
 $cf->setWorkPhone($company_data['work_phone']);
 $cf->setFaxPhone($company_data['fax_phone']);
 $cf->setAdminContact($company_data['admin_contact']);
 $cf->setBillingContact($company_data['billing_contact']);
 $cf->setSupportContact($company_data['support_contact']);
 if (isset($company_data['enable_second_last_name']) and $company_data['enable_second_last_name'] == 1) {
     $cf->setEnableSecondLastName(TRUE);
 } else {
     $cf->setEnableSecondLastName(FALSE);
 }
 if ($cf->isNew() == TRUE) {
     $cf->setEnableAddCurrency(TRUE);
     $cf->setEnableAddPermissionGroupPreset(TRUE);
     $cf->setEnableAddStation(TRUE);
     $cf->setEnableAddPayStubEntryAccountPreset(TRUE);
     $cf->setEnableAddRecurringHolidayPreset(TRUE);
 }
 if ($cf->isValid()) {
     $cf->Save();
     //$cf->FailTransaction();
     $cf->CommitTransaction();
     if ($permission->Check('company', 'edit')) {
         Redirect::Page(URLBuilder::getURL(NULL, 'CompanyList.php'));
     } else {
         Redirect::Page(URLBuilder::getURL(NULL, '../index.php'));
     }