Skip to content

A free open source IT asset/license management system

Check for model name (this should never be blank, but…)

snipe0b57f74e36c6
diff --git a/resources/views/hardware/checkout.blade.php b/resources/views/hardware/checkout.blade.php
index 35ad67d409..6345794a96 100755
--- a/resources/views/hardware/checkout.blade.php
+++ b/resources/views/hardware/checkout.blade.php
@@ -320,7 +320,12 @@ $(function() {
for (var i in data) {
var asset = data[i];
- table_html += "<tr><td class=\"col-md-8\"><a href=\"{{ config('app.url') }}/hardware/" + asset.id + "/view\">" + asset.name + " (" + asset.model.name + ")</a></td><td class=\"col-md-4\">" + asset.asset_tag + "</td></tr>";
+ table_html += "<tr><td class=\"col-md-8\"><a href=\"{{ config('app.url') }}/hardware/" + asset.id + "/view\">" + asset.name;
+ if (asset.model.name!='') {
+ table_html += " (" + asset.model.name + ")";
+
+ }
+ table_html += "</a></td><td class=\"col-md-4\">" + asset.asset_tag + "</td></tr>";
}
$('#current_assets_content').html(table_html + '</tbody></table></div></div>');