Update Index.php
This commit is contained in:
@@ -519,7 +519,7 @@ $pagination_entity_name = "Vorbestellungen";
|
||||
}
|
||||
}
|
||||
|
||||
$requiredFlagIds = [3, 4, 5];
|
||||
$requiredFlagIds = [1, 3, 4, 5];
|
||||
$allFlagsChecked = true;
|
||||
|
||||
foreach ($requiredFlagIds as $flagId) {
|
||||
@@ -545,7 +545,19 @@ $pagination_entity_name = "Vorbestellungen";
|
||||
<?=__($preorder->type, "preorder")?><br />
|
||||
<?=$preorder->ucode?>
|
||||
</td>
|
||||
<td class="status"><?=$preorder->status->code?> - <?=$preorder->status->name?></td>
|
||||
<td class="status"><?=$preorder->status->code?> - <?=$preorder->status->name?>
|
||||
<?php foreach(PreorderStatusflagModel::search(['ids' => [3,4]]) as $flag): ?>
|
||||
<br><input type="checkbox" class="preorder-statusflag-main"
|
||||
id="preorder-<?=$preorder->id?>-statusflag-<?=$flag->id?>"
|
||||
data-preorder_id="<?=$preorder->id?>"
|
||||
data-flag_id="<?=$flag->id?>"
|
||||
<?=(array_key_exists($flag->id, $preorder->statusflags) && $preorder->statusflags[$flag->id]->value && $preorder->statusflags[$flag->id]->value->value) ? "checked='checked'" : ""?>
|
||||
/>
|
||||
<label class="m-0" style="font-weight: unset!important;" for="preorder-<?=$preorder->id?>-statusflag-<?=$flag->id?>" id="preorder-<?=$preorder->id?>-statusflag-<?=$flag->id?>-text" class="text-nowrap">
|
||||
<?=$preorder->statusflags[$flag->id]->name?>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
<?php if($preorder->building_id): ?>
|
||||
<td><?=$preorder->building->street?><br /><?=$preorder->building->zip?> <?=$preorder->building->city?></td>
|
||||
<?php elseif($preorder->adb_hausnummer_id): ?>
|
||||
@@ -576,8 +588,8 @@ $pagination_entity_name = "Vorbestellungen";
|
||||
|
||||
<td><?=($preorder->partner_id) ? $preorder->partner->getCompanyOrName() : ""?></td>
|
||||
<td>
|
||||
<label><input type="checkbox" name="attributes_bep_specified" id="attributes_bep_specified-<?=$preorder->id?>" data-preorder-id="<?=$preorder->id?>" value="1" <?=(is_array($preorder->attribute) && array_key_exists("bep_specified", $preorder->attribute) && $preorder->attribute["bep_specified"]) ? "checked='checked'" : ""?> /> Borderpoint festgelegt</label><br />
|
||||
<label><input type="checkbox" name="attributes_inhouse_cabling_supplied" id="attributes_inhouse_cabling_supplied-<?=$preorder->id?>" data-preorder-id="<?=$preorder->id?>" value="1" <?=(is_array($preorder->attribute) && array_key_exists("inhouse_cabling_supplied", $preorder->attribute) && $preorder->attribute["inhouse_cabling_supplied"]) ? "checked='checked'" : ""?> /> Starterpaket erhalten</label>
|
||||
<label class="m-0" style="font-weight: unset!important;"><input type="checkbox" name="attributes_bep_specified" id="attributes_bep_specified-<?=$preorder->id?>" data-preorder-id="<?=$preorder->id?>" value="1" <?=(is_array($preorder->attribute) && array_key_exists("bep_specified", $preorder->attribute) && $preorder->attribute["bep_specified"]) ? "checked='checked'" : ""?> /> Borderpoint festgelegt</label><br />
|
||||
<label class="m-0" style="font-weight: unset!important;"><input type="checkbox" name="attributes_inhouse_cabling_supplied" id="attributes_inhouse_cabling_supplied-<?=$preorder->id?>" data-preorder-id="<?=$preorder->id?>" value="1" <?=(is_array($preorder->attribute) && array_key_exists("inhouse_cabling_supplied", $preorder->attribute) && $preorder->attribute["inhouse_cabling_supplied"]) ? "checked='checked'" : ""?> /> Starterpaket erhalten</label>
|
||||
</td>
|
||||
<td style="white-space: nowrap" class="text-monospace">
|
||||
<?=date('d.m.Y H:i', $preorder->create)?><br />
|
||||
@@ -1026,7 +1038,7 @@ $pagination_entity_name = "Vorbestellungen";
|
||||
}
|
||||
}
|
||||
|
||||
$("input.preorder-statusflag").change((e) => {
|
||||
$("input.preorder-statusflag, input.preorder-statusflag-main").change((e) => {
|
||||
var elem = e.target;
|
||||
var preorder_id = $(elem).data("preorder_id");
|
||||
var flag_id = $(elem).data("flag_id");
|
||||
@@ -1060,6 +1072,15 @@ $pagination_entity_name = "Vorbestellungen";
|
||||
}, 2000, textelem);
|
||||
}
|
||||
|
||||
// find all inputs with this data-preorder_id="21969" and data-flag_id="3" and set the text to the new value
|
||||
// always with their own fields and then select / unselect the checkbox
|
||||
$("input.preorder-statusflag[data-preorder_id='" + this.preorder_id + "'][data-flag_id='" + this.flag_id + "']").each(function() {
|
||||
if(value) {
|
||||
$(this).prop("checked", true);
|
||||
} else {
|
||||
$(this).prop("checked", false);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
error: function () {
|
||||
@@ -1711,4 +1732,4 @@ $pagination_entity_name = "Vorbestellungen";
|
||||
campaignSelect.trigger("change");
|
||||
});
|
||||
</script>
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
|
||||
Reference in New Issue
Block a user