snipe-it
snipe-it copied to clipboard
Full Multiple Company Support - Import Users ignoring company
Expected Behavior (or desired behavior if a feature request)
Created a CSV file with users, imparted the users with companies. Upon import, the companies field appears to be ignored.

(what you expect to happen goes here)
I expected to see the users imported be matched up to an existing company, instead the company field appears to be ignored.
Please confirm you have done the following before posting your bug report:
- [x ] I have enabled debug mode
- [x ] I have read checked the Common Issues page
Please provide answers to these questions before posting your bug report:
- Version of Snipe-IT you're running
- What OS and web server you're running Snipe-IT on
- What method you used to install Snipe-IT (install.sh, manual installation, docker, etc)
- If you're getting an error in your browser, include that error
- What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error
- If a stacktrace is provided in the error, include that too.
- Any errors that appear in your browser's error console.
- Confirm whether the error is reproduceable on the demo.
- Include any additional information you can find in
app/storage/logsand your webserver's logs. - Include what you've done so far in the installation, and if you got any error messages along the way.
- Indicate whether or not you've manually edited any data directly in the database
For some reason the company is commented out in the import code. I'm wondering if it's left over from porting to 3.0
$newuser = array(
'first_name' => trim(e($row[0])),
'last_name' => trim(e($row[1])),
'username' => trim(e($row[2])),
'email' => trim(e($row[3])),
'password' => bcrypt($pass),
'activated' => $activated,
'location_id' => trim(e($user_location_id)),
'phone' => trim(e($row[5])),
'jobtitle' => trim(e($row[6])),
'employee_num' => trim(e($row[7])),
//'company_id' => Company::getIdForUser($row[8]),
'permissions' => '{"user":1}',
'notes' => 'Imported user'
);