Overhauled Address linking
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
<input type="hidden" name="id" value="<?=$order->id?>" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="col-lg-6" id="owner-block">
|
||||
|
||||
|
||||
<div class="form-group row">
|
||||
@@ -172,7 +172,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="col-lg-6" id="billingaddress-block">
|
||||
|
||||
<div class="form-group row">
|
||||
|
||||
@@ -292,6 +292,120 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6" id="techcontact-block">
|
||||
|
||||
<div class="form-group row">
|
||||
|
||||
<div class="col-lg-12 mb-2">
|
||||
<h4>Technischer Kontakt</h4>
|
||||
|
||||
<select class="form-control basicAutoComplete" autocomplete="off" name="techcontact_id" id="techcontact_id" data-url="<?=self::getUrl('Address','api')?>?do=findAddress&autocomplete=1" placeholder="Tippen zum Suchen... (Bestandskunden)" data-noresults-text="Keine Suchergebnisse">
|
||||
<option></option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 mb-2">
|
||||
<div class="mt-2"><label><input type="checkbox" name="new_techcontact" id="techcontact_new" <?=($order->new_techcontact) ? "checked='checked'" : ""?> /> Neuen technischen Kontakt anlegen</label></div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 <?=($order->new_techcontact) ? "" : "hidden"?>" id="techcontact-form">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="techcontact_company">Firmenname</label>
|
||||
<textarea class="form-control" name="techcontact_company" id="techcontact_company"><?=$order->techcontact_company?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="techcontact_firstname">Vorname</label>
|
||||
<input type="text" class="form-control" name="techcontact_firstname" id="techcontact_firstname" value="<?=$order->techcontact_firstname?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="techcontact_lastname">Nachname</label>
|
||||
<input type="text" class="form-control" name="techcontact_lastname" id="techcontact_lastname" value="<?=$order->techcontact_lastname?>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="techcontact_street">Straße</label>
|
||||
<input type="text" class="form-control" name="techcontact_street" id="techcontact_street" value="<?=$order->techcontact_street?>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-3">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="techcontact_zip">Postleitzahl</label>
|
||||
<input type="text" class="form-control" name="techcontact_zip" id="techcontact_zip" value="<?=$order->techcontact_zip?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="techcontact_city">Ort</label>
|
||||
<input type="text" class="form-control" name="techcontact_city" id="techcontact_city" value="<?=$order->techcontact_city?>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="techcontact_country">Land</label>
|
||||
<input type="text" class="form-control" name="techcontact_country" id="techcontact_country" value="<?=$order->techcontact_country?>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="techcontact_phone">Telefon</label>
|
||||
<input type="text" class="form-control" name="techcontact_phone" id="techcontact_phone" value="<?=$order->techcontact_phone?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="techcontact_mobile">Mobil</label>
|
||||
<input type="text" class="form-control" name="techcontact_mobile" id="techcontact_mobile" value="<?=$order->techcontact_mobile?>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="techcontact_email">Emailadresse</label>
|
||||
<input type="text" class="form-control" name="techcontact_email" id="techcontact_email" value="<?=$order->techcontact_email?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="techcontact_fax">Fax</label>
|
||||
<input type="text" class="form-control" name="techcontact_fax" id="techcontact_fax" value="<?=$order->techcontact_fax?>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="form-group row">
|
||||
@@ -822,7 +936,9 @@
|
||||
console.log("is new");
|
||||
$('#owner_id').autoComplete('set', null);
|
||||
$('#owner_id').prop('disabled', true);
|
||||
$('#owner-block').addClass("border border-secondary");
|
||||
} else {
|
||||
$('#owner-block').removeClass("border border-secondary");
|
||||
$('#owner_id').prop('disabled', false);
|
||||
}
|
||||
});
|
||||
@@ -852,7 +968,9 @@
|
||||
console.log("billing is new");
|
||||
$('#billingaddress_id').autoComplete('set', null);
|
||||
$('#billingaddress_id').prop('disabled', true);
|
||||
$('#billingaddress-block').addClass("border border-secondary");
|
||||
} else {
|
||||
$('#billingaddress-block').removeClass("border border-secondary");
|
||||
$('#billingaddress_id').prop('disabled', false);
|
||||
}
|
||||
});
|
||||
@@ -862,6 +980,39 @@
|
||||
$('#billingaddress_id').autoComplete('set', null);
|
||||
}
|
||||
});
|
||||
|
||||
// techcontact
|
||||
// rechnungsadresse
|
||||
<?php if($order->techcontact_id && is_object($order->techcontact)): ?>
|
||||
$('#techcontact_id').autoComplete('set', { value: <?=$order->techcontact_id?>, text: '<?=($order->techcontact_id) ? str_replace("'", "\\'", str_replace(["\n", "\r"], " ", $order->techcontact->getCompanyOrName()))." (".$order->techcontact->zip." ".$order->techcontact->city.", ".$order->techcontact->street.")" : ""?>'});
|
||||
<?php else: ?>
|
||||
$('#techcontact_id').autoComplete();
|
||||
<?php endif; ?>
|
||||
|
||||
$('#techcontact_id').keydown(function() {
|
||||
if(event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('#techcontact_new').change(function() {
|
||||
if($('#techcontact_new').is(":checked")) {
|
||||
console.log("billing is new");
|
||||
$('#techcontact_id').autoComplete('set', null);
|
||||
$('#techcontact_id').prop('disabled', true);
|
||||
$('#techcontact-block').addClass("border border-secondary");
|
||||
} else {
|
||||
$('#techcontact-block').removeClass("border border-secondary");
|
||||
$('#techcontact_id').prop('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
$('#techcontact_id').on("autocomplete.select", function(evt, item) {
|
||||
if(item && item.value === 0) {
|
||||
$('#techcontact_id').autoComplete('set', null);
|
||||
}
|
||||
});
|
||||
/*
|
||||
* autocomplete
|
||||
*******************************/
|
||||
@@ -935,6 +1086,14 @@
|
||||
}
|
||||
});
|
||||
|
||||
$('#techcontact_new').change(function() {
|
||||
if($('#techcontact_new').prop('checked')) {
|
||||
$('#techcontact-form').show();
|
||||
} else {
|
||||
$('#techcontact-form').hide();
|
||||
}
|
||||
});
|
||||
|
||||
/*$('#owner_id').change(function() {
|
||||
var val = $('#owner_id').val();
|
||||
|
||||
@@ -944,7 +1103,7 @@
|
||||
$('#owner-form').hide();
|
||||
}
|
||||
});*/
|
||||
|
||||
/*
|
||||
$('#billingaddress_id').change(function() {
|
||||
var val = $('#billingaddress_id').val();
|
||||
|
||||
@@ -954,7 +1113,8 @@
|
||||
$('#billingaddress-form').hide();
|
||||
}
|
||||
});
|
||||
|
||||
*/
|
||||
|
||||
$('#order_finished').change(function() {
|
||||
if($('#order_finished').is(":checked")) {
|
||||
$('#finish_date_field').show();
|
||||
|
||||
Reference in New Issue
Block a user