Merge branch 'ConstructionConsent/fixed-import' into 'master'
fixed multiple stuff See merge request fronk/thetool!1250
This commit is contained in:
@@ -165,7 +165,7 @@ $pagination_entity_name = "Zustimmungserklärungen";
|
|||||||
<button type="submit" class="btn btn-primary"><i class="far fa-search fa-fw"></i> Filter anwenden</button>
|
<button type="submit" class="btn btn-primary"><i class="far fa-search fa-fw"></i> Filter anwenden</button>
|
||||||
<a class="btn btn-secondary" href="<?=self::getUrl("ConstructionConsent", "", ["resetFilter" => 1, "filter" => ["project_id" => (is_array($filter) && array_key_exists("project_id", $filter) ? $filter["project_id"] : "")]])?>"><i class="far fa-xmark fa-fw"></i> Filter zurücksetzen</a>
|
<a class="btn btn-secondary" href="<?=self::getUrl("ConstructionConsent", "", ["resetFilter" => 1, "filter" => ["project_id" => (is_array($filter) && array_key_exists("project_id", $filter) ? $filter["project_id"] : "")]])?>"><i class="far fa-xmark fa-fw"></i> Filter zurücksetzen</a>
|
||||||
<input type="file" id="csvFileInput" accept=".csv" class="d-none">
|
<input type="file" id="csvFileInput" accept=".csv" class="d-none">
|
||||||
<?php if ($me->isAdmin() && is_array($filter) && array_key_exists("project_id", $filter) && !empty($filter["project_id"])): ?>
|
<?php if (is_array($filter) && array_key_exists("project_id", $filter) && !empty($filter["project_id"])): ?>
|
||||||
<label style="margin-bottom: 0; cursor: pointer" for="csvFileInput" class="btn btn-info"><i class="fas fa-upload fa-fw"></i> Eigentümer-CSV Import</label>
|
<label style="margin-bottom: 0; cursor: pointer" for="csvFileInput" class="btn btn-info"><i class="fas fa-upload fa-fw"></i> Eigentümer-CSV Import</label>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -375,7 +375,9 @@ $pagination_entity_name = "Adressen";
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<?php if(is_array($owner->files) && count($owner->files)): foreach($owner->files as $file): ?>
|
<?php if(is_array($owner->files) && count($owner->files)): foreach($owner->files as $file): ?>
|
||||||
<a href="<?=self::getUrl("File", "download", ["id" => $file->file_id])?>"><i class="far fa-fw fa-file"></i> <?=$file->filename?></a><br />
|
<a href="<?=self::getUrl("File", "download", ["id" => $file->file_id])?>"><i class="far fa-fw fa-file"></i> <?=$file->filename?></a>
|
||||||
|
<a class="text-danger" href="<?=self::getUrl("ConstructionConsentOwner", "deleteFile", ["id" => $file->id])?>" onclick="if(!confirm('Datei wirklich löschen?')) return false;" title="Datei Löschen"><i class="far fa-fw fa-trash-alt"></i></a>
|
||||||
|
<br />
|
||||||
<?php endforeach; endif; ?>
|
<?php endforeach; endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -156,6 +156,50 @@ class ConstructionConsentOwnerController extends mfBaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function deleteFileAction() {
|
||||||
|
// display errors
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
ini_set('display_startup_errors', 1);
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
$id = $this->request->id;
|
||||||
|
|
||||||
|
$file = new ConstructionConsentOwnerFile($id);
|
||||||
|
if(!$file->id) {
|
||||||
|
$this->layout()->setFlash("Datei nicht gefunden!", "error");
|
||||||
|
$this->redirect("ConstructionConsent");
|
||||||
|
}
|
||||||
|
|
||||||
|
$owner = new ConstructionConsentOwner($file->constructionconsentowner_id);
|
||||||
|
if(!$owner->id) {
|
||||||
|
$this->layout()->setFlash("Besitzer nicht gefunden!", "error");
|
||||||
|
$this->redirect("ConstructionConsent");
|
||||||
|
}
|
||||||
|
|
||||||
|
$consent = $owner->consent;
|
||||||
|
if(!$consent->id) {
|
||||||
|
$this->layout()->setFlash("Zustimmungserklärung nicht gefunden!", "error");
|
||||||
|
$this->redirect("ConstructionConsent");
|
||||||
|
}
|
||||||
|
|
||||||
|
$project = new ConstructionConsentProject($consent->constructionconsentproject_id);
|
||||||
|
|
||||||
|
if(!$project->id) {
|
||||||
|
$this->layout()->setFlash("Zustimmungserklärungsprojekt nicht gefunden!", "error");
|
||||||
|
$this->redirect("ConstructionConsent");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!in_array($project->id, $this->constructionConsentProjects)) {
|
||||||
|
$this->layout()->setFlash("Sie sind nicht berechtigt, diese Zustimmungserklärung zu bearbeiten", "error");
|
||||||
|
$this->redirect("ConstructionConsent");
|
||||||
|
}
|
||||||
|
|
||||||
|
$file->file->delete();
|
||||||
|
$file->delete();
|
||||||
|
|
||||||
|
$this->layout()->setFlash("Datei gelöscht!", "success");
|
||||||
|
$this->redirect("ConstructionConsent", "View", ["id" => $owner->constructionconsent_id]);
|
||||||
|
}
|
||||||
|
|
||||||
protected function apiAction() {
|
protected function apiAction() {
|
||||||
$do = $this->request->do;
|
$do = $this->request->do;
|
||||||
$data = [];
|
$data = [];
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ class WarehouseEShopOrderController extends TTCrud {
|
|||||||
$id = WarehouseEShopOrderModel::create(['status' => 'new',
|
$id = WarehouseEShopOrderModel::create(['status' => 'new',
|
||||||
'extRef' => $json['extRef'],
|
'extRef' => $json['extRef'],
|
||||||
'deliveryMode' => $json['deliveryMode'],
|
'deliveryMode' => $json['deliveryMode'],
|
||||||
'deliveryAddressAdditional' => $json['deliveryAddressAdditional'],
|
'deliveryAddressAdditional' => $json['deliveryAddressAdditional'] ?? '',
|
||||||
'deliveryAddressName' => $json['deliveryAddressName'],
|
'deliveryAddressName' => $json['deliveryAddressName'],
|
||||||
'deliveryAddressLine' => $json['deliveryAddressLine'],
|
'deliveryAddressLine' => $json['deliveryAddressLine'],
|
||||||
'deliveryAddressPLZ' => $json['deliveryAddressPLZ'],
|
'deliveryAddressPLZ' => $json['deliveryAddressPLZ'],
|
||||||
@@ -388,21 +388,19 @@ class WarehouseEShopOrderController extends TTCrud {
|
|||||||
|
|
||||||
$user = UserModel::getOne($json['createBy']);
|
$user = UserModel::getOne($json['createBy']);
|
||||||
|
|
||||||
foreach (["eshop-versand@xinon.at", $user->email] as $emailAddr) {
|
if ($_SERVER['HTTP_HOST'] !== 'localhost')
|
||||||
$email = new Emailnotification();
|
foreach (["eshop-versand@xinon.at", $user->email] as $emailAddr) {
|
||||||
$email->setSubject("Bestellbestätigung Bestellung #$subjectId - Referenz: " . $json['extRef']);
|
$email = new Emailnotification();
|
||||||
$email->setBody($body);
|
$email->setSubject("Bestellbestätigung Bestellung #$subjectId - Referenz: " . $json['extRef']);
|
||||||
$email->setFrom(TT_OUTGOING_EMAIL_2FA, TT_OUTGOING_EMAIL_2FA);
|
$email->setBody($body);
|
||||||
$email->setTo($emailAddr);
|
$email->setFrom(TT_OUTGOING_EMAIL_2FA, TT_OUTGOING_EMAIL_2FA);
|
||||||
$email->send();
|
$email->setTo($emailAddr);
|
||||||
}
|
$email->send();
|
||||||
|
}
|
||||||
|
|
||||||
self::returnJson(['success' => true,
|
self::returnJson(['success' => true,
|
||||||
'message' => $this->infoMessages['create'],
|
'message' => $this->infoMessages['create'],
|
||||||
'id' => $id]);
|
'id' => $id]);
|
||||||
|
|
||||||
$json['id'] = $id;
|
|
||||||
die(json_encode($json));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function beforeCreate(): bool {
|
protected function beforeCreate(): bool {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class WarehouseEShopOrderModel extends TTCrudBaseModel {
|
|||||||
public string $status;
|
public string $status;
|
||||||
public string $deliveryMode;
|
public string $deliveryMode;
|
||||||
public string $deliveryAddressName;
|
public string $deliveryAddressName;
|
||||||
public string $deliveryAddressAdditional;
|
public ?string $deliveryAddressAdditional;
|
||||||
public string $deliveryAddressLine;
|
public string $deliveryAddressLine;
|
||||||
public string $deliveryAddressPLZ;
|
public string $deliveryAddressPLZ;
|
||||||
public string $deliveryAddressCity;
|
public string $deliveryAddressCity;
|
||||||
|
|||||||
@@ -65,12 +65,12 @@ Vue.component('warehouse-e-shop', {
|
|||||||
const response = await axios.post(`${window['TT_CONFIG']['BASE_PATH']}/WarehouseEShopOrder/createOrder`, {
|
const response = await axios.post(`${window['TT_CONFIG']['BASE_PATH']}/WarehouseEShopOrder/createOrder`, {
|
||||||
shoppingCart: this.shoppingCart,
|
shoppingCart: this.shoppingCart,
|
||||||
deliveryMode: this.createOrderDialogData.deliveryMode,
|
deliveryMode: this.createOrderDialogData.deliveryMode,
|
||||||
extRef: this.createOrderDialogData.extRef.trim(),
|
extRef: this.createOrderDialogData.extRef?.trim(),
|
||||||
deliveryAddressName: this.createOrderDialogData.deliveryAddressName.trim(),
|
deliveryAddressName: this.createOrderDialogData.deliveryAddressName?.trim(),
|
||||||
deliveryAddressAdditional: this.createOrderDialogData.deliveryAddressAdditional.trim(),
|
deliveryAddressAdditional: this.createOrderDialogData.deliveryAddressAdditional?.trim(),
|
||||||
deliveryAddressLine: this.createOrderDialogData.deliveryAddressLine.trim(),
|
deliveryAddressLine: this.createOrderDialogData.deliveryAddressLine?.trim(),
|
||||||
deliveryAddressPLZ: this.createOrderDialogData.deliveryAddressPLZ.trim(),
|
deliveryAddressPLZ: this.createOrderDialogData.deliveryAddressPLZ?.trim(),
|
||||||
deliveryAddressCity: this.createOrderDialogData.deliveryAddressCity.trim(),
|
deliveryAddressCity: this.createOrderDialogData.deliveryAddressCity?.trim(),
|
||||||
});
|
});
|
||||||
if (response.data.success) {
|
if (response.data.success) {
|
||||||
this.window.notify('success', response.data.message || 'Erfolgreich gespeichert');
|
this.window.notify('success', response.data.message || 'Erfolgreich gespeichert');
|
||||||
|
|||||||
Reference in New Issue
Block a user