Add transfer and account_state today view to reception
This commit is contained in:
@@ -12,6 +12,34 @@ use yii\i18n\Formatter;
|
||||
|
||||
class DateUtil
|
||||
{
|
||||
/**
|
||||
* Get UTC today @00:00:00 .
|
||||
* Helper method to generate date for mysql
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public static function todayStart( ){
|
||||
$d2 = new \DateTime();
|
||||
$d2->setTimezone( new \DateTimeZone( "UTC" ) );
|
||||
$d2->setTime(0, 0, 0);
|
||||
return $d2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get UTC t @00:00:00 .
|
||||
* Helper method to generate date for mysql
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public static function tomorrowStart( ){
|
||||
$d2 = new \DateTime();
|
||||
$d2->add(new \DateInterval('P1D'));
|
||||
$d2->setTimezone( new \DateTimeZone( "UTC" ) );
|
||||
$d2->setTime(0, 0, 0);
|
||||
return $d2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static function addMonth($timestamp, $monthCount = 1)
|
||||
{
|
||||
@@ -65,4 +93,12 @@ class DateUtil
|
||||
return $formatter->asDatetime($dateTimeObject);
|
||||
}
|
||||
|
||||
public static function formatDateUtc($dateTimeObject)
|
||||
{
|
||||
$formatter = new Formatter;
|
||||
$formatter->datetimeFormat = 'php:Y-m-d';
|
||||
$formatter->timeZone = 'UTC';
|
||||
return $formatter->asDatetime($dateTimeObject);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -320,6 +320,17 @@ class Helper {
|
||||
public static function isTicketCreatePriceEditable() {
|
||||
return \Yii::$app->params ['ticket_create_price_editable'] == true ;
|
||||
}
|
||||
|
||||
public static function isReceptionTransferListToday(){
|
||||
return \Yii::$app->params['reception_transfer_list_only_today'];
|
||||
}
|
||||
public static function isReceptionAccountStateIndexToday(){
|
||||
return \Yii::$app->params['reception_account_state_index_only_today'];
|
||||
}
|
||||
|
||||
public static function isReceptionTransferIndexEnabled(){
|
||||
return !Helper::isReceptionTransferListToday();
|
||||
}
|
||||
|
||||
public static function getRealUserIp() {
|
||||
$client = @$_SERVER ['HTTP_CLIENT_IP'];
|
||||
|
||||
@@ -30,6 +30,9 @@ return [
|
||||
* Hány napig láthatják visszamenőleg a recepciósok az adatokat
|
||||
* */
|
||||
'reception_visibility_days' => 3,
|
||||
'reception_account_state_index_only_today' => false,
|
||||
'reception_transfer_list_only_today' => false,
|
||||
|
||||
'backend_skin' => 'skin-red', //skin-green
|
||||
/**User cart module on/off*/
|
||||
'user_cart_on' => true,
|
||||
|
||||
Reference in New Issue
Block a user