|
@@ -82,6 +82,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
|
|
|
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
|
|
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
|
|
|
require_once DOL_DOCUMENT_ROOT . '/custom/voucher/class/helper.class.php';
|
|
require_once DOL_DOCUMENT_ROOT . '/custom/voucher/class/helper.class.php';
|
|
|
require_once DOL_DOCUMENT_ROOT . '/custom/voucher/class/voucherhistory.class.php';
|
|
require_once DOL_DOCUMENT_ROOT . '/custom/voucher/class/voucherhistory.class.php';
|
|
|
|
|
+require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
|
|
|
|
+
|
|
|
dol_include_once('/voucher/class/voucherhistory.class.php');
|
|
dol_include_once('/voucher/class/voucherhistory.class.php');
|
|
|
dol_include_once('/voucher/lib/voucher_voucherhistory.lib.php');
|
|
dol_include_once('/voucher/lib/voucher_voucherhistory.lib.php');
|
|
|
|
|
|
|
@@ -102,6 +104,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
|
|
$dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09');
|
|
$dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09');
|
|
|
|
|
|
|
|
$fk_product = GETPOST('fk_product', 'int');
|
|
$fk_product = GETPOST('fk_product', 'int');
|
|
|
|
|
+$eventId = GETPOST('eventId', 'int');
|
|
|
|
|
|
|
|
// Initialize technical objects
|
|
// Initialize technical objects
|
|
|
$object = new Voucherhistory($db);
|
|
$object = new Voucherhistory($db);
|
|
@@ -190,6 +193,36 @@ if (empty($reshook)) {
|
|
|
|
|
|
|
|
$triggermodname = 'VOUCHER_VOUCHERHISTORY_MODIFY'; // Name of trigger action code to execute when we modify record
|
|
$triggermodname = 'VOUCHER_VOUCHERHISTORY_MODIFY'; // Name of trigger action code to execute when we modify record
|
|
|
|
|
|
|
|
|
|
+ if ($action == 'add') {
|
|
|
|
|
+ # Search Product
|
|
|
|
|
+ $productObj = new Product($db);
|
|
|
|
|
+ $productResult = $productObj->fetch($product_id);
|
|
|
|
|
+ print_r($productResult);exit;
|
|
|
|
|
+ # Search bundle
|
|
|
|
|
+ # Create BBTicket
|
|
|
|
|
+ $newticket = new BbTicket($db);
|
|
|
|
|
+ $newticket->fk_facture = null;
|
|
|
|
|
+ $newticket->bundle_id = $fk_product;
|
|
|
|
|
+ $newticket->usable_occasions = $ticket->usable_occasions;
|
|
|
|
|
+ $newticket->usage = $ticket->usage;
|
|
|
|
|
+ $newticket->available_at = $ticket->available_at;
|
|
|
|
|
+ $newticket->validated_at = $ticket->validated_at;
|
|
|
|
|
+ $newticket->expire_at = $ticket->expire_at;
|
|
|
|
|
+ $newticket->ticket_id = $ticket->ticket_id;
|
|
|
|
|
+ $newticket->fk_settlements_group_id = $group_id;
|
|
|
|
|
+ if ($newticket->create($this->user) == -1) {
|
|
|
|
|
+ dol_syslog("Nem sikerult a ticketek mentese. facture_id: " . $object->fk_facture);
|
|
|
|
|
+ }
|
|
|
|
|
+ # Save VoucherHistory OBject
|
|
|
|
|
+ $object->fk_bundle = $fk_product;
|
|
|
|
|
+ $object->fk_product = $fk_product;
|
|
|
|
|
+ $object->fk_event = $eventId;
|
|
|
|
|
+ $object->fk_ticket = 100;
|
|
|
|
|
+ $object->pdf_path = 'asd';
|
|
|
|
|
+ $object->date_creation = dol_now();
|
|
|
|
|
+ $object->status = "0";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
|
|
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
|
|
|
include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
|
|
include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
|
|
|
|
|
|
|
@@ -236,21 +269,6 @@ $title = $langs->trans("Voucherhistory");
|
|
|
$help_url = '';
|
|
$help_url = '';
|
|
|
llxHeader('', $title, $help_url);
|
|
llxHeader('', $title, $help_url);
|
|
|
|
|
|
|
|
-// Example : Adding jquery code
|
|
|
|
|
-// print '<script type="text/javascript">
|
|
|
|
|
-// jQuery(document).ready(function() {
|
|
|
|
|
-// function init_myfunc()
|
|
|
|
|
-// {
|
|
|
|
|
-// jQuery("#myid").removeAttr(\'disabled\');
|
|
|
|
|
-// jQuery("#myid").attr(\'disabled\',\'disabled\');
|
|
|
|
|
-// }
|
|
|
|
|
-// init_myfunc();
|
|
|
|
|
-// jQuery("#mybutton").click(function() {
|
|
|
|
|
-// init_myfunc();
|
|
|
|
|
-// });
|
|
|
|
|
-// });
|
|
|
|
|
-// </script>';
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
// Part to create
|
|
// Part to create
|
|
|
if ($action == 'create') {
|
|
if ($action == 'create') {
|
|
@@ -279,6 +297,7 @@ if ($action == 'create') {
|
|
|
|
|
|
|
|
// Common attributes
|
|
// Common attributes
|
|
|
include DOL_DOCUMENT_ROOT . '/custom/voucher/core/tpl/commonfields_add.tpl.php';
|
|
include DOL_DOCUMENT_ROOT . '/custom/voucher/core/tpl/commonfields_add.tpl.php';
|
|
|
|
|
+ //include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
|
|
|
|
|
|
|
|
// Other attributes
|
|
// Other attributes
|
|
|
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
|
|
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
|
|
@@ -624,355 +643,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|
|
|
|
|
|
|
include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
|
|
include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+//print_r($_REQUEST);
|
|
|
// End of page
|
|
// End of page
|
|
|
llxFooter();
|
|
llxFooter();
|
|
|
$db->close();
|
|
$db->close();
|
|
|
|
|
+echo '<link rel="stylesheet" type="text/css" href="' . dol_buildpath('/custom/voucher/css/voucher.css', 1) . '">';
|
|
|
|
|
+echo '<script type="text/javascript" src="' . dol_buildpath('/custom/voucher/scripts/voucher.js', 1) . '"></script>';
|
|
|
?>
|
|
?>
|
|
|
-
|
|
|
|
|
-<style>
|
|
|
|
|
- td.in-range:not(.end-date) {
|
|
|
|
|
- background-color: #c8e4f1 !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .hide {
|
|
|
|
|
- display: none;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .timeSelectBox {
|
|
|
|
|
- display: inline-block;
|
|
|
|
|
- width: 150px;
|
|
|
|
|
- margin: 0 10px 0 0;
|
|
|
|
|
- vertical-align: top;
|
|
|
|
|
- border: 1px silver solid;
|
|
|
|
|
- padding: 5px 10px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- input#date-range {
|
|
|
|
|
- padding: 0 10px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .time_slider {
|
|
|
|
|
- display: none !important;
|
|
|
|
|
- height: 0px !important;
|
|
|
|
|
- }
|
|
|
|
|
- .TDhideClass {
|
|
|
|
|
- display: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-</style>
|
|
|
|
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
|
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
|
|
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
|
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
|
|
|
-<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css">
|
|
|
|
|
-<script>
|
|
|
|
|
- var gen = {
|
|
|
|
|
- setElem: "ok",
|
|
|
|
|
- init: function() {
|
|
|
|
|
- var now = new Date;
|
|
|
|
|
- $("#date-range").attr("date-start", now.toISOString().slice(0, 10));
|
|
|
|
|
- $("#date-range").attr("date-end", now.toISOString().slice(0, 10));
|
|
|
|
|
- $(document).on("click", "#eventGen", function() {
|
|
|
|
|
- var elem = $(this);
|
|
|
|
|
- var sendAjax = false;
|
|
|
|
|
- var data = {
|
|
|
|
|
- action: "generateEvents",
|
|
|
|
|
- id_eventdetails: 1,
|
|
|
|
|
- token: "151c561ba2f4ffff0adfe5866cc1dcc3",
|
|
|
|
|
- // id_eventdetails: $("#addproduct input[name='id').val(),
|
|
|
|
|
- dates: {},
|
|
|
|
|
- max_num: (!Number.isNaN(parseInt($("#max_num").val()))) ? parseInt($("#max_num").val()) : 0,
|
|
|
|
|
- buffer: (!Number.isNaN(parseInt($("#buffer").val()))) ? parseInt($("#buffer").val()) : 0,
|
|
|
|
|
- participants: (!Number.isNaN(parseInt($("#participants").val()))) ? parseInt($("#participants").val()) : 0,
|
|
|
|
|
- };
|
|
|
|
|
- var from = new Date($("#date-range").attr("date-start"));
|
|
|
|
|
- var to = new Date($("#date-range").attr("date-end"));
|
|
|
|
|
-
|
|
|
|
|
- var d = from;
|
|
|
|
|
- while (d <= to) {
|
|
|
|
|
- // console.log(DAYS[d.getDay()]);
|
|
|
|
|
- dayNum = d.getDay();
|
|
|
|
|
- // console.log(d.getDay());
|
|
|
|
|
- if ($("#Day" + dayNum).is(":checked")) {
|
|
|
|
|
- data.dates[d.toISOString().split("T")[0]] = [];
|
|
|
|
|
- $.each($("input[name='Day" + dayNum + "-timestart[]']"), function(k, v) {
|
|
|
|
|
- if ($(v).val() && $("input[name='Day" + dayNum + "-time-duration[]']").eq(k).val()) {
|
|
|
|
|
- timeRange = {
|
|
|
|
|
- start: $("input[name='Day" + dayNum + "-timestart[]']").eq(k).val(),
|
|
|
|
|
- // end: $("input[name='Day"+dayNum+"-timeend[]']").eq(k).val(),
|
|
|
|
|
- duration: $("input[name='Day" + dayNum + "-time-duration[]']").eq(k).val(),
|
|
|
|
|
- };
|
|
|
|
|
- data.dates[d.toISOString().split("T")[0]].push(timeRange);
|
|
|
|
|
- sendAjax = true;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- d = new Date(d.getTime() + (24 * 60 * 60 * 1000));
|
|
|
|
|
- }
|
|
|
|
|
- if (sendAjax) {
|
|
|
|
|
- $.ajax({
|
|
|
|
|
- type: "POST",
|
|
|
|
|
- url: "/custom/eventwizard/eventdetails_card.php",
|
|
|
|
|
- data: data,
|
|
|
|
|
- success: function(response) {
|
|
|
|
|
- if (response.s) {
|
|
|
|
|
- location.href = $("#agenda").attr("href");
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- error: function(response) {
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- $(document).on("input", ".timestart", function(event) {
|
|
|
|
|
- if (gen.setElem == "ok") {
|
|
|
|
|
- gen.setElem = "input";
|
|
|
|
|
- var elem = $(this);
|
|
|
|
|
- var a = (elem.val()).split(":");
|
|
|
|
|
- var b = (elem.parent().find(".durationtime").val()).split(":");
|
|
|
|
|
- var time = new Date();
|
|
|
|
|
- time.setHours(parseInt(a[0]), parseInt(a[1]), 00, 000);
|
|
|
|
|
- time.setMinutes(time.getMinutes() + parseInt(b[1]));
|
|
|
|
|
- time.setHours(time.getHours() + parseInt(b[0]));
|
|
|
|
|
- // var c = [time.getHours(), time.getMinutes()];
|
|
|
|
|
- elem.parent().find(".timeend").val(time.getHours() + ":" + time.getMinutes())
|
|
|
|
|
- var minutes = [parseInt(a[0]) * 60 + parseInt(a[1]), parseInt(b[0]) * 60 + parseInt(b[1])];
|
|
|
|
|
- if (isNaN(minutes[0])) {
|
|
|
|
|
- minutes[0] = 0;
|
|
|
|
|
- }
|
|
|
|
|
- if (isNaN(minutes[1])) {
|
|
|
|
|
- minutes[1] = 0;
|
|
|
|
|
- }
|
|
|
|
|
- elem.parent().parent().find(".time_slider").slider("values", 0, minutes[0]);
|
|
|
|
|
- elem.parent().parent().find(".time_slider").slider("values", 1, minutes[0] + minutes[1]);
|
|
|
|
|
- elem.parent().find(".timestart").attr("info", minutes[0]);
|
|
|
|
|
- elem.parent().find(".timeend").attr("info", minutes[0] + minutes[1]);
|
|
|
|
|
- // elem.parent().find(".durationtime").attr("info",minutes[1]);
|
|
|
|
|
- gen.setElem = "ok";
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- $(document).on("input", ".durationtime", function(event) {
|
|
|
|
|
- if (gen.setElem == "ok") {
|
|
|
|
|
- gen.setElem = "input";
|
|
|
|
|
- var elem = $(this);
|
|
|
|
|
- var a = (elem.parent().find(".timestart").val()).split(":");
|
|
|
|
|
- var b = (elem.val()).split(":");
|
|
|
|
|
- var time = new Date();
|
|
|
|
|
- time.setHours(parseInt(a[0]), parseInt(a[1]), 00, 000);
|
|
|
|
|
- time.setMinutes(time.getMinutes() + parseInt(b[1]));
|
|
|
|
|
- time.setHours(time.getHours() + parseInt(b[0]));
|
|
|
|
|
- // var c = [time.getHours(), time.getMinutes()];
|
|
|
|
|
- elem.parent().find(".timeend").val(time.getHours() + ":" + time.getMinutes())
|
|
|
|
|
- var minutes = [parseInt(a[0]) * 60 + parseInt(a[1]), parseInt(b[0]) * 60 + parseInt(b[1])];
|
|
|
|
|
- if (isNaN(minutes[0])) {
|
|
|
|
|
- minutes[0] = 0;
|
|
|
|
|
- }
|
|
|
|
|
- if (isNaN(minutes[1])) {
|
|
|
|
|
- minutes[1] = 0;
|
|
|
|
|
- }
|
|
|
|
|
- // console.log(minutes);
|
|
|
|
|
- elem.parent().parent().find(".time_slider").slider("values", 0, minutes[0]);
|
|
|
|
|
- elem.parent().parent().find(".time_slider").slider("values", 1, minutes[0] + minutes[1]);
|
|
|
|
|
- elem.parent().find(".timestart").attr("info", minutes[0]);
|
|
|
|
|
- elem.parent().find(".timeend").attr("info", minutes[0] + minutes[1]);
|
|
|
|
|
- // elem.parent().find(".durationtime").attr("info",minutes[1]);
|
|
|
|
|
- gen.setElem = "ok";
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- $(document).on("click", ".addTime", function() {
|
|
|
|
|
- var elem = $(this);
|
|
|
|
|
- // var html = '<span class="addedTimes"> & <input type="time" name="Day'+elem.attr("info")+'-timestart[]"> - <input type="time" name="Day'+elem.attr("info")+'-timeend[]">ASD</span>';
|
|
|
|
|
- var html = '<span class="addedTimes timeSelectBox"><span class="time_slider" style="display:inline-block;width:150px;"></span><span class="time_slider_details">Kezdés:<input type="time" name="Day' + elem.attr("info") + '-timestart[]" info="0" class="timepicker timestart"><br/> Időtartam: <input name="Day' + elem.attr("info") + '-time-duration[]" pattern="[0-9]+:[0-9]{2}$" placeholder="hh:mm" type="text" class="durationtime" style="width:45px !important"/><input name="Day' + elem.attr("info") + '-timeend[]" class="timeend hide" info="0"/></span></span>';
|
|
|
|
|
- elem.parent().parent().find("td.dayTime").append(html);
|
|
|
|
|
- $(function() {
|
|
|
|
|
- // gen.setTimeRange(".time_slider");
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- $(document).on("click", ".delTime", function() {
|
|
|
|
|
- var elem = $(this);
|
|
|
|
|
- $(elem.parent().parent().find('td.dayTime span.addedTimes').last()).remove();
|
|
|
|
|
- // var listTimeStart = elem.parent().parent().find('td.dayTime input[name="Day'+elem.attr("info")+'-timestart[]"]');
|
|
|
|
|
- // var listTimeEnd = elem.parent().parent().find('td.dayTime input[name="Day'+elem.attr("info")+'-timeend[]"]');
|
|
|
|
|
-
|
|
|
|
|
- // if(listTimeStart.length > 1){
|
|
|
|
|
- // $(listTimeStart.last()).remove();
|
|
|
|
|
- // }
|
|
|
|
|
- // if(listTimeEnd.length > 1){
|
|
|
|
|
- // $(listTimeEnd.last()).remove();
|
|
|
|
|
- // }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- var option = {
|
|
|
|
|
- //autoUpdateInput: false,
|
|
|
|
|
- locale: {
|
|
|
|
|
- "format": "YYYY-MM-DD",
|
|
|
|
|
- cancelLabel: "Mégse",
|
|
|
|
|
- applyLabel: "Ok",
|
|
|
|
|
- "monthNames": [
|
|
|
|
|
- "január",
|
|
|
|
|
- "február",
|
|
|
|
|
- "március",
|
|
|
|
|
- "április",
|
|
|
|
|
- "május",
|
|
|
|
|
- "június",
|
|
|
|
|
- "július",
|
|
|
|
|
- "augusztus",
|
|
|
|
|
- "szeptember",
|
|
|
|
|
- "október",
|
|
|
|
|
- "november",
|
|
|
|
|
- "december"
|
|
|
|
|
- ],
|
|
|
|
|
- "daysOfWeek": [
|
|
|
|
|
- "Vas",
|
|
|
|
|
- "Hé",
|
|
|
|
|
- "Ke",
|
|
|
|
|
- "Sze",
|
|
|
|
|
- "Csüt",
|
|
|
|
|
- "Pé",
|
|
|
|
|
- "Szo"
|
|
|
|
|
- ],
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
- $("#date-range").daterangepicker(option, function(start, end, label) {
|
|
|
|
|
- $("#date-range").attr("date-start", start.format("YYYY-MM-DD"));
|
|
|
|
|
- $("#date-range").attr("date-end", end.format("YYYY-MM-DD"));
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // gen.setTimeRange(".time_slider");
|
|
|
|
|
-
|
|
|
|
|
- $(document).on("mousewheel", ".time_slider", function(event) {
|
|
|
|
|
- event.preventDefault();
|
|
|
|
|
- var elem = $(this);
|
|
|
|
|
- value = elem.slider("value");
|
|
|
|
|
-
|
|
|
|
|
- //console.log(event.deltaX, event.deltaY, event.deltaFactor);
|
|
|
|
|
-
|
|
|
|
|
- //Mousewheel Scrolled up
|
|
|
|
|
- if (event.deltaY == -1) {
|
|
|
|
|
- //alert("scrolled down");
|
|
|
|
|
- value = value + 1;
|
|
|
|
|
- elem.slider("value", value);
|
|
|
|
|
- // $("#slider_val").html(value);
|
|
|
|
|
- }
|
|
|
|
|
- //Mousewheel Scrolled down
|
|
|
|
|
- else if (event.deltaY == 1) {
|
|
|
|
|
- //alert("scrolled up");
|
|
|
|
|
- value = value - 1;
|
|
|
|
|
- elem.slider("value", value);
|
|
|
|
|
- // $("#slider_val").html(value);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- setTimeRange: function(elem) {
|
|
|
|
|
- //".time_slider"
|
|
|
|
|
- $(elem).slider({
|
|
|
|
|
- // width: 320px,
|
|
|
|
|
- // height: 2px,
|
|
|
|
|
- range: true,
|
|
|
|
|
- min: 0,
|
|
|
|
|
- max: 2880,
|
|
|
|
|
- step: 5,
|
|
|
|
|
- slide: function(e, ui) {
|
|
|
|
|
- if (gen.setElem == "ok") {
|
|
|
|
|
- gen.setElem = "slider";
|
|
|
|
|
- var hours = Math.floor(ui.value / 60);
|
|
|
|
|
- var minutes = ui.value - (hours * 60);
|
|
|
|
|
- hours = hours % 24;
|
|
|
|
|
- if (hours.toString().length == 1) hours = "0" + hours;
|
|
|
|
|
- if (minutes.toString().length == 1) minutes = "0" + minutes;
|
|
|
|
|
-
|
|
|
|
|
- // $("#something").html(hours+":"+minutes);
|
|
|
|
|
- if (ui.handleIndex == 0) {
|
|
|
|
|
- $(ui.handle).parent().parent().find(".timestart").val(hours + ":" + minutes);
|
|
|
|
|
- $(ui.handle).parent().parent().find(".timestart").attr("info", ui.value);
|
|
|
|
|
- }
|
|
|
|
|
- if (ui.handleIndex == 1) {
|
|
|
|
|
- $(ui.handle).parent().parent().find(".timeend").val(hours + ":" + minutes);
|
|
|
|
|
- $(ui.handle).parent().parent().find(".timeend").attr("info", ui.value);
|
|
|
|
|
- }
|
|
|
|
|
- var diff = parseInt($(ui.handle).parent().parent().find(".timeend").attr("info")) - parseInt($(ui.handle).parent().parent().find(".timestart").attr("info"));
|
|
|
|
|
- // console.log(parseInt($(ui.handle).parent().parent().find(".timestart").attr("info")));
|
|
|
|
|
- // console.log(parseInt($(ui.handle).parent().parent().find(".timeend").attr("info")));
|
|
|
|
|
- // console.log(diff);
|
|
|
|
|
- if (!isNaN(diff)) {
|
|
|
|
|
- hours = Math.floor(diff / 60);
|
|
|
|
|
- minutes = diff - (hours * 60);
|
|
|
|
|
- // hours = hours%24;
|
|
|
|
|
- if (hours.toString().length == 1) hours = "0" + hours;
|
|
|
|
|
- if (minutes.toString().length == 1) minutes = "0" + minutes;
|
|
|
|
|
-
|
|
|
|
|
- $(ui.handle).parent().parent().find(".durationtime").val(hours + ":" + minutes + "");
|
|
|
|
|
-
|
|
|
|
|
- // var start = $(ui.handle).parent().parent().find(".timepicker").val();
|
|
|
|
|
- // details = "Kezdés: "+start+"<br/>Időtartam: "+hours+"ó "+minutes+"p";
|
|
|
|
|
- }
|
|
|
|
|
- // $(ui.handle).parent().parent().find(".time_slider_details").html(details);
|
|
|
|
|
-
|
|
|
|
|
- // console.log(hours+":"+minutes);
|
|
|
|
|
- // console.log(ui);
|
|
|
|
|
- gen.setElem = "ok";
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- },
|
|
|
|
|
- };
|
|
|
|
|
- $(function() {
|
|
|
|
|
- gen.init();
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- $(document).ready(function() {
|
|
|
|
|
- $('#fk_product').on('change', function() {
|
|
|
|
|
- var selectedValue = $(this).val(); // A kiválasztott érték lekérése
|
|
|
|
|
- if(selectedValue == -1){
|
|
|
|
|
- $("#eventDateSelector").addClass("TDhideClass");;
|
|
|
|
|
- }else{
|
|
|
|
|
- $("#eventDateSelector").removeClass('TDhideClass');
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- $('#fk_product').select2({
|
|
|
|
|
- dir: 'ltr',
|
|
|
|
|
- width: 'resolve',
|
|
|
|
|
- minimumInputLength: 0,
|
|
|
|
|
- language: select2arrayoflanguage,
|
|
|
|
|
- matcher: function(params, data) {
|
|
|
|
|
- if ($.trim(params.term) === "") {
|
|
|
|
|
- return data;
|
|
|
|
|
- }
|
|
|
|
|
- keywords = (params.term).split(" ");
|
|
|
|
|
- for (var i = 0; i < keywords.length; i++) {
|
|
|
|
|
- if (((data.text).toUpperCase()).indexOf((keywords[i]).toUpperCase()) == -1) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return data;
|
|
|
|
|
- },
|
|
|
|
|
- theme: 'default',
|
|
|
|
|
- containerCssClass: ':all:',
|
|
|
|
|
- selectionCssClass: ':all:',
|
|
|
|
|
- templateResult: function(data, container) {
|
|
|
|
|
- if (data.element) {
|
|
|
|
|
- $(container).addClass($(data.element).attr("class"));
|
|
|
|
|
- }
|
|
|
|
|
- if (data.id == -1 && $(data.element).attr("data-html") == undefined) {
|
|
|
|
|
- return ' ';
|
|
|
|
|
- }
|
|
|
|
|
- if ($(data.element).attr("data-html") != undefined) return htmlEntityDecodeJs($(data.element).attr("data-html")); // If property html set, we decode html entities and use this
|
|
|
|
|
- return data.text;
|
|
|
|
|
- },
|
|
|
|
|
- templateSelection: function(selection) {
|
|
|
|
|
- if (selection.id == -1) return '<span class="placeholder">' + selection.text + '</span>';
|
|
|
|
|
- return selection.text;
|
|
|
|
|
- },
|
|
|
|
|
- escapeMarkup: function(markup) {
|
|
|
|
|
- return markup;
|
|
|
|
|
- },
|
|
|
|
|
- dropdownCssClass: 'ui-dialog'
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
-</script>
|
|
|
|
|
|
|
+<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css">
|