Merge branch 'develop'

This commit is contained in:
snipe 2017-10-16 20:38:19 -07:00
commit 1376f246dc
14 changed files with 144 additions and 75 deletions

View file

@ -23,14 +23,18 @@ class AssetImporter extends ItemImporter
// ItemImporter handles the general fetching.
parent::handle($row);
foreach ($this->customFields as $customField) {
$customFieldValue = $this->array_smart_custom_field_fetch($row, $customField);
if ($customFieldValue) {
$this->item['custom_fields'][$customField->db_column_name()] = $customFieldValue;
$this->log('Custom Field '. $customField->name.': '.$customFieldValue);
if ($this->customFields) {
foreach ($this->customFields as $customField) {
$customFieldValue = $this->array_smart_custom_field_fetch($row, $customField);
if ($customFieldValue) {
$this->item['custom_fields'][$customField->db_column_name()] = $customFieldValue;
$this->log('Custom Field '. $customField->name.': '.$customFieldValue);
}
}
}
$this->createAssetIfNotExists($row);
}

View file

@ -29,7 +29,7 @@ class AssetMaintenance extends Model implements ICompanyableChild
'title' => 'required|max:100',
'is_warranty' => 'boolean',
'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',
'cost' => 'numeric|nullable'
];

View file

@ -77,23 +77,18 @@ class Ldap extends Model
$connection = Ldap::connectToLdap();
$ldap_username_field = $settings->ldap_username_field;
$baseDn = $settings->ldap_basedn;
$userDn = $ldap_username_field.'='.$username.','.$settings->ldap_basedn;
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 ($ldap_username_field=='userprincipalname') {
$userDn = $username;
} else {
// In case they haven't added an AD domain
if ($settings->ad_domain == '') {
$userDn = $username.'@'.$settings->email_domain;
} else {
$userDn = $username.'@'.$settings->ad_domain;
}
$userDn = ($settings->ad_domain != '') ? $username.'@'.$settings->ad_domain : $username.'@'.$settings->email_domain;
}
} else {
$userDn = $ldap_username_field.'='.$username.','.$settings->ldap_basedn;
}
\Log::debug('Attempting to login using distinguished name:'.$userDn);

File diff suppressed because one or more lines are too long

View file

@ -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

View file

@ -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

View file

@ -1,12 +1,23 @@
{
"/vue.js": "/vue.js",
"/css/AdminLTE.css": "/css/AdminLTE.css",
"/css/app.css": "/css/app.css",
"/css/overrides.css": "/css/overrides.css",
"/vue.js.map": "/vue.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"
"/build/vue.js": "/build/vue.js",
"/mix.js": "/mix.js",
"/build/app.css": "/build/app.535d8af1016a2377e449920c617f0197.css",
"/build/AdminLTE.css": "/build/AdminLTE.3d8a2b2e33baa060b1b324363ad5e1c2.css",
"/build/overrides.css": "/build/overrides.617623c6a96be3e0cbd11c5d4039ec10.css",
"/css/all.css": "/css/all.css",
"/js/all.js": "/js/all.js",
"/css/app.css": "/css/app.css",
"/css/dist/all.css": "/css/dist/all.css",
"/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"
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

52
public/js/dist/all.js vendored

File diff suppressed because one or more lines are too long

View file

@ -18,8 +18,7 @@
data-toggle="modal" - required for Bootstrap Modals
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-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!
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!
class="btn btn-sm btn-default" - makes it look button-ey, feel free to change :)
*/
@ -37,8 +36,6 @@
var link = $(event.relatedTarget);
model = link.data("dependency");
select = link.data("select");
// console.warn("Uh, href is: "+link.attr('href'));
// console.dir(link);
$('#createModal').load(link.attr('href'),function () {
//do we need to re-select2 this, after load? Probably.
$('#createModal').find('select.select2').select2();
@ -47,11 +44,9 @@
$('#createModal').on('click','#modal-save', function () {
console.warn("MODAL SAVE CALLED FOR MODAL!");
var data = {};
console.warn("We are about to SAVE!!! for model: "+model+" and select ID: "+select);
$('.modal-body input:visible').each(function (index, elem) {
console.warn("["+index+"]: "+elem.id+" = "+$(elem).val());
var bits = elem.id.split("-");
if (bits[0] === "modal") {
data[bits[1]] = $(elem).val();
@ -64,11 +59,11 @@
});
data._token = Laravel.csrfToken;
console.log(data);
//console.log(data);
$.ajax({
type: 'POST',
url: "/api/v1/" + model + "s",
url: "../api/v1/" + model + "s",
headers: {
"X-Requested-With": 'XMLHttpRequest',
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
@ -100,15 +95,15 @@
// this code adds the newly created object to that select
var selector = document.getElementById(select);
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;
}
//console.log(document.getElementById(select));
console.dir(selector);
// console.dir(selector);
selector.options[selector.length] = new Option(name, id);
selector.selectedIndex = selector.length - 1;
$(selector).trigger("change");
if(fetchCustomFields) {
if(window.fetchCustomFields) {
fetchCustomFields();
}
@ -124,4 +119,4 @@
});
});
});
});