Skip to content

Commit

Permalink
Merge pull request Qloapps#310 from lakshya-webkul/gli-dash-improvement
Browse files Browse the repository at this point in the history
Dashboard module improvement
  • Loading branch information
rohit053 authored Jan 31, 2022
2 parents 2a3cfd1 + 6c8743c commit 8abd64a
Show file tree
Hide file tree
Showing 98 changed files with 5,671 additions and 833 deletions.
30 changes: 28 additions & 2 deletions admin/themes/default/css/overrides.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
/* This stylesheet should be used to add your custom styles to the back-office without using the Sass sources. It will be loaded after all the default styles.
You should NOT edit any other exisiting back-office CSS file manually: they are generated by the Sass preprocessor: http://www.sass-lang.com/ . */
/*This stylesheet should be used to add your custom styles to the back-office without using the Sass sources. It will be loaded after all the default styles. */
/*You should NOT edit any other exisiting back-office CSS file manually: they are generated by the Sass preprocessor: http://www.sass-lang.com/ . */

.datepicker2 {
background: #fff;
position: absolute;
z-index: 99999;
width: 14rem;
}

.bootstrap #datepicker .daterangepicker thead tr th {
color: #fff;
font-size: .8em;
height: 2.5em;
}

.bootstrap #datepicker .daterangepicker thead tr:first-child th {
font-size: 1.2em;
}

.form-date-actions {
bottom: -25px;
position: absolute;
width: 100%;
z-index: 999;
background-color: #fff;
border: solid 1px #ccc;
}
34 changes: 20 additions & 14 deletions admin/themes/default/js/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,15 @@ $( document ).ready(function() {
"start": $("#date-start").val(),
"end": $("#date-end").val()
}).on('changeDate', function(ev){
if (ev.date.valueOf() >= datepickerEnd.date.valueOf()){
datepickerEnd.setValue(ev.date.setMonth(ev.date.getMonth()+1));
}
// if (ev.date.valueOf() >= datepickerEnd.date.valueOf()){
// datepickerEnd.setValue(ev.date.setMonth(ev.date.getMonth()+1));
// }
}).data('daterangepicker');
$('#testdatepic').daterangepicker({
"dates": translated_dates,
"weekStart": 1,
"start": $("#date-start").val(),
"end": $("#date-end").val()
}).data('daterangepicker');

datepickerEnd = $('.datepicker2').daterangepicker({
Expand All @@ -308,39 +314,39 @@ $( document ).ready(function() {
}
}).data('daterangepicker');

//Set first date picker to month -1 if same month
// Set first date picker to month -1 if same month
startDate = Date.parseDate($("#date-start").val(), $("#date-start").data('date-format'));
endDate = Date.parseDate($("#date-end").val(), $("#date-end").data('date-format'));

if (startDate.getFullYear() == endDate.getFullYear() && startDate.getMonth() == endDate.getMonth())
datepickerStart.setValue(startDate.subMonths(1));

//Events binding
// Events binding
$("#date-start").focus(function() {
datepickerStart.setCompare(false);
datepickerEnd.setCompare(false);
// datepickerEnd.setCompare(false);
$(".date-input").removeClass("input-selected");
$(this).addClass("input-selected");
});

$("#date-end").focus(function() {
datepickerStart.setCompare(false);
datepickerEnd.setCompare(false);
// datepickerEnd.setCompare(false);
$(".date-input").removeClass("input-selected");
$(this).addClass("input-selected");
});

$("#date-start-compare").focus(function() {
datepickerStart.setCompare(true);
datepickerEnd.setCompare(true);
// datepickerEnd.setCompare(true);
$('#compare-options').val(3);
$(".date-input").removeClass("input-selected");
$(this).addClass("input-selected");
});

$("#date-end-compare").focus(function() {
datepickerStart.setCompare(true);
datepickerEnd.setCompare(true);
// datepickerEnd.setCompare(true);
$('#compare-options').val(3);
$(".date-input").removeClass("input-selected");
$(this).addClass("input-selected");
Expand All @@ -363,8 +369,8 @@ $( document ).ready(function() {
} else {
datepickerStart.setStartCompare(null);
datepickerStart.setEndCompare(null);
datepickerEnd.setStartCompare(null);
datepickerEnd.setEndCompare(null);
// datepickerEnd.setStartCompare(null);
// datepickerEnd.setEndCompare(null);
$('#form-date-body-compare').hide();
$('#compare-options').prop('disabled', true);
$('#date-start').focus();
Expand All @@ -380,10 +386,10 @@ $( document ).ready(function() {

datepickerStart.setStartCompare($("#date-start-compare").val());
datepickerStart.setEndCompare($("#date-end-compare").val());
datepickerEnd.setStartCompare($("#date-start-compare").val());
datepickerEnd.setEndCompare($("#date-end-compare").val());
// datepickerEnd.setStartCompare($("#date-start-compare").val());
// datepickerEnd.setEndCompare($("#date-end-compare").val());
datepickerStart.setCompare(true);
datepickerEnd.setCompare(true);
// datepickerEnd.setCompare(true);

if (this.value == 3)
$('#date-start-compare').focus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
</script>

<div id="dashboard">
{$hookDashboardUnnamedOne}
<div class="row">
<div class="col-lg-12">
{if $warning}
Expand All @@ -39,10 +40,10 @@
<div id="calendar" class="panel">
<form action="{$action|escape}" method="post" id="calendar_form" name="calendar_form" class="form-inline">
<div class="btn-group">
<button type="button" name="submitDateDay" class="btn btn-default submitDateDay{if isset($preselect_date_range) && $preselect_date_range == 'day'} active{/if}">
<button type="button" name="submitDateDay" class="btn btn-default submitDateDay{if (!isset($preselect_date_range) || !$preselect_date_range) || (isset($preselect_date_range) && $preselect_date_range == 'day')} active{/if}">
{l s='Day'}
</button>
<button type="button" name="submitDateMonth" class="btn btn-default submitDateMonth{if (!isset($preselect_date_range) || !$preselect_date_range) || (isset($preselect_date_range) && $preselect_date_range == 'month')} active{/if}">
<button type="button" name="submitDateMonth" class="btn btn-default submitDateMonth {if isset($preselect_date_range) && $preselect_date_range == 'month'}active{/if}">
{l s='Month'}
</button>
<button type="button" name="submitDateYear" class="btn btn-default submitDateYear{if isset($preselect_date_range) && $preselect_date_range == 'year'} active{/if}">
Expand All @@ -57,10 +58,6 @@
<button type="button" name="submitDateYearPrev" class="btn btn-default submitDateYearPrev{if isset($preselect_date_range) && $preselect_date_range == 'prev-year'} active{/if}">
{l s='Year'}-1
</button>
<!--
<button type="submit" name="submitDateRealTime" class="hide btn btn-default submitDateRealTime {if $dashboard_use_push}active{/if}" value="{!$dashboard_use_push|intval}">
{l s='Real Time'}
</button> -->
</div>
<input type="hidden" name="datepickerFrom" id="datepickerFrom" value="{$date_from|escape}" class="form-control">
<input type="hidden" name="datepickerTo" id="datepickerTo" value="{$date_to|escape}" class="form-control">
Expand All @@ -77,8 +74,8 @@
</span>
<i class="icon-caret-down"></i>
</button>
{$calendar}
</div>
{$calendar}
</form>
</div>
</div>
Expand All @@ -87,30 +84,10 @@
<div class="col-md-4 col-lg-3" id="hookDashboardZoneOne">
{$hookDashboardZoneOne}
</div>
<div class="col-md-8 col-lg-7" id="hookDashboardZoneTwo">
{$hookDashboardZoneTwo}
</div>
<div class="col-md-12 col-lg-2">
{$hookDashboardZoneThree}
<section class="dash_links panel">
<h3><i class="icon-link"></i> {l s="Useful links"}</h3>
<dl>
<dt><a href="https://qloapps.com/qlo-reservation-system/" class="_blank">{l s="Official Documentation"}</a></dt>
<dd>{l s="Qloapps User Guide"}</dd>
</dl>
<dl>
<dt><a href="https://forums.qloapps.com/" class="_blank">{l s="Qloapps Forum"}</a></dt>
<dd>{l s="Connect with the Qloapps community"}</dd>
</dl>
<dl>
<dt><a href="https://qloapps.com/addons/" class="_blank">{l s="Qloapps Addons"}</a></dt>
<dd>{l s="Enhance your store Qloapps modules"}</dd>
</dl>
<dl>
<dt><a href="https://qloapps.com/contact/" class="_blank">{l s="Contact Us!"}</a></dt>
<dd>{l s="Contact us for any help"}</dd>
</dl>
</section>
<div class="col-md-8 col-lg-9" id="hookDashboardZoneTwo">
<div class='row'>
{$hookDashboardZoneTwo}
</div>
</div>
</div>
</div>
34 changes: 28 additions & 6 deletions admin/themes/default/template/helpers/calendar/calendar.tpl
Original file line number Diff line number Diff line change
@@ -1,23 +1,45 @@
<div id="datepicker" class="row row-padding-top hide">
<div id="datepicker" class="row hide">
<div class="col-lg-12">
<div class="daterangepicker-days">
<div class="row">
{if $is_rtl}
<div class="col-sm-6 col-lg-4">
<div class="datepicker2" data-date="{$date_to}" data-date-format="{$date_format}"></div>
<div class="datepicker2" data-date="{$date_to}" data-date-format="{$date_format}">
<div class='form-date-actions'>
<button class='btn btn-link' type='button' id="datepicker-cancel" tabindex="7">
<i class='icon-remove'></i>
{l s='Cancel'}
</button>
<button class='btn btn-default pull-right' type='submit' name="submitDateRange" tabindex="6">
<i class='icon-ok text-success'></i>
{l s='Apply'}
</button>
</div>
</div>
</div>
<div class="col-sm-6 col-lg-4">
<div class="col-sm-6 col-lg-4 hide">
<div class="datepicker1" data-date="{$date_from}" data-date-format="{$date_format}"></div>
</div>
{else}
<div class="col-sm-6 col-lg-4">
<div class="col-sm-6 col-lg-4 hide">
<div class="datepicker1" data-date="{$date_from}" data-date-format="{$date_format}"></div>
</div>
<div class="col-sm-6 col-lg-4">
<div class="datepicker2" data-date="{$date_to}" data-date-format="{$date_format}"></div>
<div class="datepicker2" data-date="{$date_to}" data-date-format="{$date_format}">
<div class='form-date-actions'>
<button class='btn btn-link' type='button' id="datepicker-cancel" tabindex="7">
<i class='icon-remove'></i>
{l s='Cancel'}
</button>
<button class='btn btn-default pull-right' type='submit' name="submitDateRange" tabindex="6">
<i class='icon-ok text-success'></i>
{l s='Apply'}
</button>
</div>
</div>
</div>
{/if}
<div class="col-xs-12 col-sm-6 col-lg-4 pull-right">
<div class="col-xs-12 col-sm-6 col-lg-4 pull-right hide">
<div id='datepicker-form' class='form-inline'>
<div id='date-range' class='form-date-group'>
<div class='form-date-heading'>
Expand Down
9 changes: 9 additions & 0 deletions classes/CustomerMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,13 @@ public function delete()
}
return parent::delete();
}

public static function getMessagesByDate($date)
{
return Db::getInstance()->getValue(
'SELECT COUNT(cm.`id_customer_message`)
FROM `'._DB_PREFIX_.'customer_message` cm
WHERE cm.`date_add` BETWEEN "'.pSQL($date).' 00:00:00" AND "'.pSQL($date).' 23:59:59"'
);
}
}
Loading

0 comments on commit 8abd64a

Please sign in to comment.