Merge branch 'develop'
This commit is contained in:
commit
1376f246dc
14 changed files with 144 additions and 75 deletions
|
@ -23,14 +23,18 @@ class AssetImporter extends ItemImporter
|
||||||
// ItemImporter handles the general fetching.
|
// ItemImporter handles the general fetching.
|
||||||
parent::handle($row);
|
parent::handle($row);
|
||||||
|
|
||||||
foreach ($this->customFields as $customField) {
|
if ($this->customFields) {
|
||||||
$customFieldValue = $this->array_smart_custom_field_fetch($row, $customField);
|
|
||||||
if ($customFieldValue) {
|
foreach ($this->customFields as $customField) {
|
||||||
$this->item['custom_fields'][$customField->db_column_name()] = $customFieldValue;
|
$customFieldValue = $this->array_smart_custom_field_fetch($row, $customField);
|
||||||
$this->log('Custom Field '. $customField->name.': '.$customFieldValue);
|
if ($customFieldValue) {
|
||||||
|
$this->item['custom_fields'][$customField->db_column_name()] = $customFieldValue;
|
||||||
|
$this->log('Custom Field '. $customField->name.': '.$customFieldValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->createAssetIfNotExists($row);
|
$this->createAssetIfNotExists($row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ class AssetMaintenance extends Model implements ICompanyableChild
|
||||||
'title' => 'required|max:100',
|
'title' => 'required|max:100',
|
||||||
'is_warranty' => 'boolean',
|
'is_warranty' => 'boolean',
|
||||||
'start_date' => 'required|date_format:"Y-m-d"',
|
'start_date' => 'required|date_format:"Y-m-d"',
|
||||||
'completion_date' => 'date_format:"Y-m-d"',
|
'completion_date' => 'nullable|date_format:"Y-m-d"',
|
||||||
'notes' => 'string|nullable',
|
'notes' => 'string|nullable',
|
||||||
'cost' => 'numeric|nullable'
|
'cost' => 'numeric|nullable'
|
||||||
];
|
];
|
||||||
|
|
|
@ -77,23 +77,18 @@ class Ldap extends Model
|
||||||
$connection = Ldap::connectToLdap();
|
$connection = Ldap::connectToLdap();
|
||||||
$ldap_username_field = $settings->ldap_username_field;
|
$ldap_username_field = $settings->ldap_username_field;
|
||||||
$baseDn = $settings->ldap_basedn;
|
$baseDn = $settings->ldap_basedn;
|
||||||
|
$userDn = $ldap_username_field.'='.$username.','.$settings->ldap_basedn;
|
||||||
|
|
||||||
if ($settings->is_ad =='1') {
|
if ($settings->is_ad =='1') {
|
||||||
// Check if they are using the userprincipalname for the username field.
|
// Check if they are using the userprincipalname for the username field.
|
||||||
// If they are, we can skip building the UPN to authenticate against AD
|
// If they are, we can skip building the UPN to authenticate against AD
|
||||||
if ($ldap_username_field=='userprincipalname') {
|
if ($ldap_username_field=='userprincipalname') {
|
||||||
$userDn = $username;
|
$userDn = $username;
|
||||||
} else {
|
} else {
|
||||||
// In case they haven't added an AD domain
|
// In case they haven't added an AD domain
|
||||||
if ($settings->ad_domain == '') {
|
$userDn = ($settings->ad_domain != '') ? $username.'@'.$settings->ad_domain : $username.'@'.$settings->email_domain;
|
||||||
$userDn = $username.'@'.$settings->email_domain;
|
|
||||||
} else {
|
|
||||||
$userDn = $username.'@'.$settings->ad_domain;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
$userDn = $ldap_username_field.'='.$username.','.$settings->ldap_basedn;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
\Log::debug('Attempting to login using distinguished name:'.$userDn);
|
\Log::debug('Attempting to login using distinguished name:'.$userDn);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"css/AdminLTE.css","sources":[],"mappings":";;;;;;A","sourceRoot":""}
|
{"version":3,"file":"css/AdminLTE.css","sources":[],"mappings":";;;;;;","sourceRoot":""}
|
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"css/app.css","sources":[],"mappings":";;;;;;;;A","sourceRoot":""}
|
{"version":3,"file":"css/app.css","sources":[],"mappings":";;;;;;;;","sourceRoot":""}
|
File diff suppressed because one or more lines are too long
|
@ -1,12 +1,23 @@
|
||||||
{
|
{
|
||||||
"/vue.js": "/vue.js",
|
"/build/vue.js": "/build/vue.js",
|
||||||
"/css/AdminLTE.css": "/css/AdminLTE.css",
|
"/mix.js": "/mix.js",
|
||||||
"/css/app.css": "/css/app.css",
|
"/build/app.css": "/build/app.535d8af1016a2377e449920c617f0197.css",
|
||||||
"/css/overrides.css": "/css/overrides.css",
|
"/build/AdminLTE.css": "/build/AdminLTE.3d8a2b2e33baa060b1b324363ad5e1c2.css",
|
||||||
"/vue.js.map": "/vue.js.map",
|
"/build/overrides.css": "/build/overrides.617623c6a96be3e0cbd11c5d4039ec10.css",
|
||||||
"/css/AdminLTE.css.map": "/css/AdminLTE.css.map",
|
"/css/all.css": "/css/all.css",
|
||||||
"/css/app.css.map": "/css/app.css.map",
|
"/js/all.js": "/js/all.js",
|
||||||
"/css/overrides.css.map": "/css/overrides.css.map",
|
"/css/app.css": "/css/app.css",
|
||||||
"/public/css/dist/all.css": "/public/css/dist/all.css",
|
"/css/dist/all.css": "/css/dist/all.css",
|
||||||
"/public/js/dist/all.js": "/public/js/dist/all.js"
|
"/js/dist/all.js": "/js/dist/all.js",
|
||||||
|
"/css/AdminLTE.css": "/css/AdminLTE.css",
|
||||||
|
"/css/overrides.css": "/css/overrides.css",
|
||||||
|
"/css/skin-blue.css": "/css/skin-blue.css",
|
||||||
|
"/vue.js": "/vue.js",
|
||||||
|
"/vue.js.map": "/vue.js.map",
|
||||||
|
"/mix.js.map": "/mix.js.map",
|
||||||
|
"/css/AdminLTE.css.map": "/css/AdminLTE.css.map",
|
||||||
|
"/css/app.css.map": "/css/app.css.map",
|
||||||
|
"/css/overrides.css.map": "/css/overrides.css.map",
|
||||||
|
"public/css/dist/all.css": "public/css/dist/all.css",
|
||||||
|
"public/js/dist/all.js": "public/js/dist/all.js"
|
||||||
}
|
}
|
64
build/vue.js
64
build/vue.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
12
public/css/dist/all.css
vendored
12
public/css/dist/all.css
vendored
File diff suppressed because one or more lines are too long
52
public/js/dist/all.js
vendored
52
public/js/dist/all.js
vendored
File diff suppressed because one or more lines are too long
|
@ -18,8 +18,7 @@
|
||||||
data-toggle="modal" - required for Bootstrap Modals
|
data-toggle="modal" - required for Bootstrap Modals
|
||||||
data-target="#createModal" - fixed ID for the modal, do not change
|
data-target="#createModal" - fixed ID for the modal, do not change
|
||||||
data-dependency="user" - which Snipe-IT model you're going to be creating.
|
data-dependency="user" - which Snipe-IT model you're going to be creating.
|
||||||
data-select="assigned_to" - What is the *ID* of the select-dropdown that you're going to be adding to, if the modal-create was a
|
data-select="assigned_to" - What is the *ID* of the select-dropdown that you're going to be adding to, if the modal-create was a success? Be on the lookout for duplicate ID's, it will confuse this library!
|
||||||
success? Be on the lookout for duplicate ID's, it will confuse this library!
|
|
||||||
class="btn btn-sm btn-default" - makes it look button-ey, feel free to change :)
|
class="btn btn-sm btn-default" - makes it look button-ey, feel free to change :)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -37,8 +36,6 @@
|
||||||
var link = $(event.relatedTarget);
|
var link = $(event.relatedTarget);
|
||||||
model = link.data("dependency");
|
model = link.data("dependency");
|
||||||
select = link.data("select");
|
select = link.data("select");
|
||||||
// console.warn("Uh, href is: "+link.attr('href'));
|
|
||||||
// console.dir(link);
|
|
||||||
$('#createModal').load(link.attr('href'),function () {
|
$('#createModal').load(link.attr('href'),function () {
|
||||||
//do we need to re-select2 this, after load? Probably.
|
//do we need to re-select2 this, after load? Probably.
|
||||||
$('#createModal').find('select.select2').select2();
|
$('#createModal').find('select.select2').select2();
|
||||||
|
@ -47,11 +44,9 @@
|
||||||
|
|
||||||
|
|
||||||
$('#createModal').on('click','#modal-save', function () {
|
$('#createModal').on('click','#modal-save', function () {
|
||||||
console.warn("MODAL SAVE CALLED FOR MODAL!");
|
|
||||||
var data = {};
|
var data = {};
|
||||||
console.warn("We are about to SAVE!!! for model: "+model+" and select ID: "+select);
|
console.warn("We are about to SAVE!!! for model: "+model+" and select ID: "+select);
|
||||||
$('.modal-body input:visible').each(function (index, elem) {
|
$('.modal-body input:visible').each(function (index, elem) {
|
||||||
console.warn("["+index+"]: "+elem.id+" = "+$(elem).val());
|
|
||||||
var bits = elem.id.split("-");
|
var bits = elem.id.split("-");
|
||||||
if (bits[0] === "modal") {
|
if (bits[0] === "modal") {
|
||||||
data[bits[1]] = $(elem).val();
|
data[bits[1]] = $(elem).val();
|
||||||
|
@ -64,11 +59,11 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
data._token = Laravel.csrfToken;
|
data._token = Laravel.csrfToken;
|
||||||
console.log(data);
|
//console.log(data);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: "/api/v1/" + model + "s",
|
url: "../api/v1/" + model + "s",
|
||||||
headers: {
|
headers: {
|
||||||
"X-Requested-With": 'XMLHttpRequest',
|
"X-Requested-With": 'XMLHttpRequest',
|
||||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||||
|
@ -100,15 +95,15 @@
|
||||||
// this code adds the newly created object to that select
|
// this code adds the newly created object to that select
|
||||||
var selector = document.getElementById(select);
|
var selector = document.getElementById(select);
|
||||||
if(!selector) {
|
if(!selector) {
|
||||||
console.error("Could not find original <select> element with an id of: "+select);
|
// console.error("Could not find original <select> element with an id of: "+select);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//console.log(document.getElementById(select));
|
//console.log(document.getElementById(select));
|
||||||
console.dir(selector);
|
// console.dir(selector);
|
||||||
selector.options[selector.length] = new Option(name, id);
|
selector.options[selector.length] = new Option(name, id);
|
||||||
selector.selectedIndex = selector.length - 1;
|
selector.selectedIndex = selector.length - 1;
|
||||||
$(selector).trigger("change");
|
$(selector).trigger("change");
|
||||||
if(fetchCustomFields) {
|
if(window.fetchCustomFields) {
|
||||||
fetchCustomFields();
|
fetchCustomFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue