Пример #1
0
                 $bf->setManualId($bf->Validator->stripNonNumeric($mapped_row['default_branch_id']));
                 $tmp_branch = $bf->getName();
             } elseif (strtolower($filtered_import_map['default_branch_id']['parse_hint']) == 'manual_id') {
                 $bf->setName($mapped_row['default_branch_id']);
                 $bf->setManualId($mapped_row['default_branch_id']);
             } else {
                 $next_available_manual_id = BranchListFactory::getNextAvailableManualId($mapped_row['company_id']);
                 $bf->setName($mapped_row['default_branch_id']);
                 $bf->setManualId($next_available_manual_id);
             }
             $bf->setCity('NA');
             if ($bf->isValid()) {
                 echo "[CB: " . $mapped_row['default_branch_id'] . "]";
                 $new_branch_id = $bf->Save(FALSE);
                 $branch_options[$new_branch_id] = $bf->getName();
                 $branch_manual_id_options[$new_branch_id] = $bf->getManualId();
             }
             unset($bf, $new_branch_id, $next_available_manual_id);
         }
     }
     $uf->setDefaultBranch($tmp_branch);
     unset($tmp_branch);
 }
 if (isset($mapped_row['default_department_id']) and $mapped_row['default_department_id'] != '') {
     $tmp_department = Misc::importCallInputParseFunction('default_department_id', $mapped_row['default_department_id'], $filtered_import_map['default_department_id']['default_value'], $filtered_import_map['default_department_id']['parse_hint']);
     if ($create_department === TRUE) {
         //Check to see if department exists or not.
         if (array_search(parse_default_department_id($mapped_row['default_department_id']), $department_options) === FALSE) {
             //Create department
             $df = new DepartmentFactory();
             $df->setCompany($mapped_row['company_id']);