caps as $role => $value ) {
if ( in_array( $role, $tmsht_options['display_pages']['ts_user'] ) ) {
$ts_user_page_hook = add_menu_page( 'Timesheet', 'Timesheet', 'read', 'timesheet_ts_user', 'tmsht_ts_user_page', 'dashicons-clock' );
add_action( 'load-' . $ts_user_page_hook, 'tmsht_add_tabs' );
break;
}
}
foreach ( $tmsht_current_user->caps as $role => $value ) {
if ( in_array( $role, $tmsht_options['display_pages']['ts_report'] ) ) {
if ( isset( $ts_user_page_hook ) ) {
$ts_report_page_hook = add_submenu_page( 'timesheet_ts_user', __( 'Report', 'timesheet' ), __( 'Report', 'timesheet' ), 'read', 'timesheet_ts_report', 'tmsht_ts_report_page' );
} else {
$ts_report_page_hook = add_menu_page( 'Timesheet ' . __( 'Report', 'timesheet' ), 'Timesheet ' . __( 'Report', 'timesheet' ), 'read', 'timesheet_ts_report', 'tmsht_ts_report_page', 'dashicons-clock' );
}
add_action( 'load-' . $ts_report_page_hook, 'tmsht_add_tabs' );
break;
}
}
}
}
/* add help tab */
if ( ! function_exists( 'tmsht_add_tabs' ) ) {
function tmsht_add_tabs() {
$screen = get_current_screen();
$args = array(
'id' => 'tmsht',
'section' => '202101246'
);
bws_help_tab( $screen, $args );
}
}
if ( ! function_exists( 'tmsht_plugins_loaded' ) ) {
function tmsht_plugins_loaded() {
/* Internationalization */
load_plugin_textdomain( 'timesheet', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}
}
if ( ! function_exists( 'tmsht_init' ) ) {
function tmsht_init() {
global $tmsht_plugin_info;
$plugin_basename = plugin_basename( __FILE__ );
require_once( dirname( __FILE__ ) . '/bws_menu/bws_include.php' );
bws_include_init( $plugin_basename );
if ( empty( $tmsht_plugin_info ) ) {
if ( ! function_exists( 'get_plugin_data' ) ) {
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
}
$tmsht_plugin_info = get_plugin_data( __FILE__ );
}
/* check WordPress version */
bws_wp_min_version_check( $plugin_basename, $tmsht_plugin_info, '3.8' );
$tmsht_plugin_pages = array(
'timesheet_settings',
'timesheet_ts_user',
'timesheet_ts_report'
);
if ( isset( $_GET['page'] ) && in_array( $_GET['page'], $tmsht_plugin_pages ) ) {
tmsht_register_options();
}
}
}
if ( ! function_exists( 'tmsht_admin_init' ) ) {
function tmsht_admin_init() {
global $bws_plugin_info, $tmsht_plugin_info;
/* Add variable for bws_menu */
if ( ! isset( $bws_plugin_info ) || empty( $bws_plugin_info ) )
$bws_plugin_info = array( 'id' => '606', 'version' => $tmsht_plugin_info["Version"] );
}
}
if ( ! function_exists( 'tmsht_create_tables' ) ) {
function tmsht_create_tables() {
global $wpdb;
$tmsht_prefix = "{$wpdb->prefix}tmsht";
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
/* Table with legends */
if ( ! $wpdb->query( "SHOW TABLES LIKE '{$tmsht_prefix}_legends';" ) ) {
$sql = "CREATE TABLE `{$tmsht_prefix}_legends` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`color` char(7) NOT NULL,
`disabled` BOOLEAN NOT NULL DEFAULT '0',
PRIMARY KEY ( `id` )
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
dbDelta( $sql );
$default_legends = array(
array(
'id' => 1,
'name' => __( 'Work In Office', 'timesheet' ),
'color' => '#94e091',
'disabled' => 0
),
array(
'id' => 2,
'name' => __( 'Work Remotely', 'timesheet' ),
'color' => '#eded76',
'disabled' => 0
),
array(
'id' => 3,
'name' => __( 'Will be absent', 'timesheet' ),
'color' => '#dd8989',
'disabled' => 0
),
array(
'id' => 4,
'name' => __( 'Vacation', 'timesheet' ),
'color' => '#8da6bf',
'disabled' => 0
),
);
foreach ( $default_legends as $legend ) {
$wpdb->insert(
"{$tmsht_prefix}_legends",
array( 'id' => $legend['id'], 'name' => $legend['name'], 'color' => $legend['color'], 'disabled' => $legend['disabled'] ),
array( '%d', '%s', '%s', '%d' )
);
}
}
/* Table with ts */
if ( ! $wpdb->query( "SHOW TABLES LIKE '{$tmsht_prefix}_ts';" ) ) {
$sql = "CREATE TABLE `{$tmsht_prefix}_ts` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) NOT NULL,
`time_from` datetime NOT NULL,
`time_to` datetime NOT NULL,
`legend_id` int(10) NOT NULL,
PRIMARY KEY ( `id` )
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
dbDelta( $sql );
}
}
}
if ( ! function_exists( 'tmsht_activate' ) ) {
function tmsht_activate( $networkwide ) {
global $wpdb;
/* Activation function for network, check if it is a network activation - if so, run the activation function for each blog id */
if ( is_multisite() && $networkwide ) {
$old_blog = $wpdb->blogid;
/* Get all blog ids */
$blogids = $wpdb->get_col( "SELECT `blog_id` FROM $wpdb->blogs" );
foreach ( $blogids as $blog_id ) {
switch_to_blog( $blog_id );
tmsht_create_tables();
tmsht_register_options();
}
switch_to_blog( $old_blog );
return;
}
tmsht_create_tables();
tmsht_register_options();
}
}
if ( ! function_exists( 'tmsht_register_options' ) ) {
function tmsht_register_options() {
global $tmsht_plugin_info, $tmsht_default_options, $tmsht_options;
$update_option = false;
$db_version = '0.1';
if ( ! function_exists( 'get_editable_roles' ) ) {
require_once( ABSPATH . 'wp-admin/includes/user.php' );
}
$tmsht_ts_user_roles = array_keys( get_editable_roles() );
$tmsht_default_options = array(
'plugin_option_version' => $tmsht_plugin_info["Version"],
'plugin_db_version' => $db_version,
'ts_timeline_from' => 0,
'ts_timeline_to' => 24,
'weekends' => array( 'sat', 'sun' ),
'date_format_type' => 'wp',
'date_format' => get_option( 'date_format' ),
'display_pages' => array(
'ts_user' => $tmsht_ts_user_roles,
'ts_report' => array( 'administrator' )
),
'display_settings_notice' => 1,
'suggest_feature_banner' => 1,
'reminder_on_email' => false,
'day_reminder' => 'fri',
'time_reminder' => '18:00'
);
if ( ! get_option( 'tmsht_options' ) ) {
add_option( 'tmsht_options', $tmsht_default_options );
}
$tmsht_options = get_option( 'tmsht_options' );
/* Array merge incase this version has added new options */
if ( ! isset( $tmsht_options['plugin_option_version'] ) || $tmsht_options['plugin_option_version'] != $tmsht_plugin_info["Version"] ) {
$tmsht_default_options['plugin_option_version'] = $tmsht_plugin_info["Version"];
$tmsht_options = array_merge( $tmsht_default_options, $tmsht_options );
$update_option = true;
}
/* Update tables when update plugin and tables changes*/
if ( ! isset( $tmsht_options['plugin_db_version'] ) || $tmsht_options['plugin_db_version'] != $db_version ) {
tmsht_create_tables();
/* update DB version */
$tmsht_options['plugin_db_version'] = $db_version;
$update_option = true;
}
if ( $update_option ) {
update_option( 'tmsht_options', $tmsht_options );
}
}
}
if ( ! function_exists( 'tmsht_admin_scripts_styles' ) ) {
function tmsht_admin_scripts_styles() {
global $tmsht_plugin_info;
if ( isset( $_GET['page'] ) ) {
if ( $_GET['page'] == 'timesheet_settings' ) {
wp_enqueue_script( 'ts_settings_script', plugins_url( 'js/settings.js', __FILE__ ), array( 'jquery', 'jquery-ui-slider', 'wp-color-picker' ), $tmsht_plugin_info['Version'] );
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_style( 'jquery-ui', plugins_url( 'css/jquery-ui.css', __FILE__ ), false );
wp_enqueue_style( 'ts_settings_styles', plugins_url( 'css/settings.css', __FILE__ ), false, $tmsht_plugin_info['Version'] );
}
$tmsht_datetime_options = array(
'locale' => explode( '_', get_locale() )[0],
'dayOfWeekStart' => get_option( 'start_of_week' )
);
if ( $_GET['page'] == 'timesheet_ts_user' ) {
wp_register_script( 'tmsht_datetimepicker_script', plugins_url( 'js/jquery.datetimepicker.full.min.js', __FILE__ ), array( 'jquery' ) );
wp_enqueue_script( 'ts_user_script', plugins_url( 'js/ts_user_script.js', __FILE__ ), array( 'jquery', 'tmsht_datetimepicker_script' ), $tmsht_plugin_info['Version'] );
wp_localize_script( 'ts_user_script', 'tmsht_datetime_options', $tmsht_datetime_options );
wp_enqueue_style( 'ts_user_styles', plugins_url( 'css/ts_user_styles.css', __FILE__ ), false, $tmsht_plugin_info['Version'] );
wp_enqueue_style( 'tmsht_datetimepicker_styles', plugins_url( 'css/jquery.datetimepicker.css', __FILE__ ), false );
}
if ( $_GET['page'] == 'timesheet_ts_report' ) {
wp_register_script( 'tmsht_datetimepicker_script', plugins_url( 'js/jquery.datetimepicker.full.min.js', __FILE__ ), array( 'jquery' ) );
wp_enqueue_script( 'ts_report_script', plugins_url( 'js/ts_report_script.js', __FILE__ ), array( 'jquery', 'tmsht_datetimepicker_script' ), $tmsht_plugin_info['Version'] );
wp_localize_script( 'ts_report_script', 'tmsht_datetime_options', $tmsht_datetime_options );
wp_enqueue_style( 'ts_report_styles', plugins_url( 'css/ts_report_styles.css', __FILE__ ), false, $tmsht_plugin_info['Version'] );
wp_enqueue_style( 'tmsht_datetimepicker_styles', plugins_url( 'css/jquery.datetimepicker.css', __FILE__ ), false );
}
}
}
}
if ( ! function_exists( 'tmsht_generate_color' ) ) {
function tmsht_generate_color() {
global $wpdb;
$tmsht_prefix = "{$wpdb->prefix}tmsht";
$tmsht_get_legends = $wpdb->get_results( "SELECT color FROM `{$tmsht_prefix}_legends`", ARRAY_A );
$tmsht_wrong_colors = array( '#ffffff', '#f9f9f9' );
foreach ( $tmsht_get_legends as $tmsht_legend ) {
$tmsht_wrong_colors[] = $tmsht_legend['color'];
}
while (1) {
$tmsht_color = sprintf( "#%06x", rand( 0,16777215 ) );
if ( ! in_array( $tmsht_color, $tmsht_wrong_colors ) ) {
break;
}
}
return $tmsht_color;
}
}
if ( ! function_exists( 'tmsht_settings_page' ) ) {
function tmsht_settings_page() {
global $wpdb, $tmsht_options, $tmsht_default_options, $tmsht_plugin_info;
$message = $error = "";
$tmsht_prefix = "{$wpdb->prefix}tmsht";
$plugin_basename = plugin_basename( __FILE__ );
$tmsht_weekends_arr = $tmsht_days_reminder_arr = array( 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun' );
$tmsht_date_format_arr = array( 'wp', 'custom' );
$tmsht_get_roles = get_editable_roles();
ksort( $tmsht_get_roles );
if ( ( isset( $_POST['tmsht_save_settings'] ) || isset( $_POST['tmsht_add_ts_legend'] ) ) && check_admin_referer( 'tmsht_nonce_save_settings', 'tmsht_nonce_name' ) ) {
if ( isset( $_POST['tmsht_add_ts_legend'] ) ) {
$tmsht_ts_legend_name = ( isset( $_POST['tmsht_add_ts_legend_name'] ) ) ? esc_html( trim( $_POST['tmsht_add_ts_legend_name'] ) ) : '';
$tmsht_ts_legend_color = ( isset( $_POST['tmsht_add_ts_legend_color'] ) ) ? esc_html( trim( $_POST['tmsht_add_ts_legend_color'] ) ) : '';
$tmsht_wrong_colors = array( '#ffffff', '#f9f9f9' );
if ( empty( $tmsht_ts_legend_name ) ) {
$error = __( 'Please, input legend name', 'timesheet' );
}
if ( ! preg_match( '/^#?([a-f0-9]{6}|[a-f0-9]{3})$/', $tmsht_ts_legend_color ) ) {
if ( $error != "" ) {
$error .= '
' . __( 'Please, choose legend color', 'timesheet' );
} else {
$error .= __( 'Please, choose legend color', 'timesheet' );
}
}
if ( $error == "" && $wpdb->get_results( "SELECT `id` FROM `{$tmsht_prefix}_legends` WHERE `name` = '$tmsht_ts_legend_name' OR `color` = '$tmsht_ts_legend_color'" ) ) {
$error = sprintf( __( 'Legend with name "%s" or with color %s already exists', 'timesheet' ), $tmsht_ts_legend_name, $tmsht_ts_legend_color );
}
if ( $error == "" && in_array( $tmsht_ts_legend_color, $tmsht_wrong_colors ) ) {
$error = sprintf( __( 'The legend with the color %s can not be saved. Please choose a different color.', 'timesheet' ), $tmsht_ts_legend_color );
}
if ( $error == "" ) {
$tmsht_query = $wpdb->insert(
"{$tmsht_prefix}_legends",
array( 'name' => $tmsht_ts_legend_name, 'color' => $tmsht_ts_legend_color ),
array( '%s', '%s' )
);
if ( $tmsht_query ) {
unset( $tmsht_ts_legend_name, $tmsht_ts_legend_color );
$message = __( 'Legend has been successfully added', 'timesheet' );
} else {
$error = __( 'Legend has not been added', 'timesheet' );
}
} else {
$error .= '
' . __( 'Legend has not been added', 'timesheet' );
}
}
if ( isset( $_POST['tmsht_save_settings'] ) ) {
/* Set timeline */
$tmsht_options['ts_timeline_from'] = ( isset( $_POST['tmsht_ts_timeline_from'] ) && $_POST['tmsht_ts_timeline_from'] >= 0 && $_POST['tmsht_ts_timeline_from'] <= 23 ) ? intval( $_POST['tmsht_ts_timeline_from'] ) : 0;
$tmsht_options['ts_timeline_to'] = ( isset( $_POST['tmsht_ts_timeline_to'] ) && $_POST['tmsht_ts_timeline_to'] <= 24 && $_POST['tmsht_ts_timeline_to'] >= 1 ) ? intval( $_POST['tmsht_ts_timeline_to'] ) : 24;
if ( $tmsht_options['ts_timeline_from'] == $tmsht_options['ts_timeline_to'] ) {
if ( $tmsht_options['ts_timeline_to'] + 1 <= 24 ) {
$tmsht_options['ts_timeline_to']++;
} else {
$tmsht_options['ts_timeline_from']--;
}
}
/* Set weekends */
$tmsht_weekends = ( isset( $_POST['tmsht_weekends'] ) ) ? $_POST['tmsht_weekends'] : false;
if ( is_array( $tmsht_weekends ) ) {
foreach ( $tmsht_weekends as $tmsht_weekend ) {
if ( ! in_array( ucfirst( $tmsht_weekend ), $tmsht_weekends_arr ) ) {
unset( $tmsht_weekend );
}
$tmsht_options['weekends'] = $tmsht_weekends;
}
} else {
$tmsht_options['weekends'] = array();
}
/* Enable/disable legends */
$tmsht_ts_legend_ids = ( isset( $_POST['tmsht_ts_legend_id'] ) && is_array( $_POST['tmsht_ts_legend_id'] ) ) ? $_POST['tmsht_ts_legend_id'] : array();
$tmsht_ts_legend_ids_hidden = ( isset( $_POST['tmsht_ts_legend_id_hidden'] ) && is_array( $_POST['tmsht_ts_legend_id_hidden'] ) ) ? $_POST['tmsht_ts_legend_id_hidden'] : array();
$tmsht_ts_legend_ids_enabled = array_diff_key( $tmsht_ts_legend_ids_hidden, $tmsht_ts_legend_ids );
$tmsht_ts_legend_ids_disabled = $tmsht_ts_legend_ids;
if ( $tmsht_ts_legend_ids_enabled ) {
$tmsht_ts_legend_ids_enabled_string = implode( ',', $tmsht_ts_legend_ids_enabled );
$wpdb->query( "UPDATE `{$tmsht_prefix}_legends` SET `disabled` = 1 WHERE `id` IN (" . esc_sql( $tmsht_ts_legend_ids_enabled_string ) . ")" );
}
if ( $tmsht_ts_legend_ids_disabled ) {
$tmsht_ts_legend_ids_disabled_string = implode( ',', $tmsht_ts_legend_ids_disabled );
$wpdb->query( "UPDATE `{$tmsht_prefix}_legends` SET `disabled` = 0 WHERE `id` IN (" . esc_sql( $tmsht_ts_legend_ids_disabled_string ) . ")" );
}
/* Set date format */
if ( isset( $_POST['tmsht_date_format_type'] ) && in_array( $_POST['tmsht_date_format_type'] , $tmsht_date_format_arr ) ) {
$tmsht_options['date_format_type'] = $_POST['tmsht_date_format_type'];
switch ( $_POST['tmsht_date_format_type'] ) {
case 'custom' :
$tmsht_options['date_format'] = ( isset( $_POST['tmsht_date_format_code'] ) ) ? esc_html( trim( $_POST['tmsht_date_format_code'] ) ) : '';
break;
case 'wp':
default:
$tmsht_options['date_format'] = get_option( 'date_format' );
break;
}
}
/* Display TS user page for */
$tmsht_display_ts_user_page_for = ( isset( $_POST['tmsht_display_ts_user_page_for'] ) && is_array( $_POST['tmsht_display_ts_user_page_for'] ) ) ? $_POST['tmsht_display_ts_user_page_for'] : array();
$tmsht_ts_user_roles = array();
foreach ( $tmsht_display_ts_user_page_for as $role ) {
if ( array_key_exists( $role, $tmsht_get_roles ) ) {
$tmsht_ts_user_roles[] = $role;
}
}
$tmsht_options['display_pages']['ts_user'] = $tmsht_ts_user_roles;
/* Display TS report page for */
$tmsht_display_ts_report_page_for = ( isset( $_POST['tmsht_display_ts_report_page_for'] ) && is_array( $_POST['tmsht_display_ts_report_page_for'] ) ) ? $_POST['tmsht_display_ts_report_page_for'] : array();
$tmsht_ts_report_roles = array();
foreach ( $tmsht_display_ts_report_page_for as $role ) {
if ( array_key_exists( $role, $tmsht_get_roles ) ) {
$tmsht_ts_report_roles[] = $role;
}
}
$tmsht_options['display_pages']['ts_report'] = $tmsht_ts_report_roles;
$tmsht_options['reminder_on_email'] = ( isset( $_POST['tmsht_reminder_on_email'] ) && $_POST['tmsht_reminder_on_email'] == 1 );
$tmsht_options['day_reminder'] = ( isset( $_POST['tmsht_day_reminder'] ) && in_array( ucfirst( $_POST['tmsht_day_reminder'] ), $tmsht_days_reminder_arr ) ) ? $_POST['tmsht_day_reminder'] : $tmsht_default_options['day_reminder'];
$tmsht_options['time_reminder'] = ( isset( $_POST['tmsht_time_reminder'] ) && preg_match( '/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/', $_POST['tmsht_time_reminder'] ) ) ? $_POST['tmsht_time_reminder'] : $tmsht_default_options['time_reminder'];
$tmsht_reminder_change_state = ( isset( $_POST['tmsht_reminder_change_state'] ) && $_POST['tmsht_reminder_change_state'] == 1 );
if ( $tmsht_reminder_change_state ) {
wp_clear_scheduled_hook( 'tmsht_reminder_to_email' );
if ( $tmsht_options['reminder_on_email'] ) {
if ( ! wp_next_scheduled( 'tmsht_reminder_to_email' ) ) {
$current_offset = get_option( 'gmt_offset' );
$tzstring = get_option( 'timezone_string' );
/* Remove old Etc mappings. Fallback to gmt_offset. */
if ( false !== strpos( $tzstring,'Etc/GMT' ) ) {
$tzstring = '';
}
/* Create a UTC+- zone if no timezone string exists */
if ( empty( $tzstring ) ) {
if ( 0 == $current_offset ) {
$tzstring = '+0';
} elseif ( $current_offset < 0 ) {
$tzstring = $current_offset;
} else {
$tzstring = '+' . $current_offset;
}
}
$time = strtotime( sprintf( "%s %s:00 %s", ucfirst( $tmsht_options['day_reminder'] ), $tmsht_options['time_reminder'], $tzstring ) );
if ( time() > $time ) {
$time = strtotime( sprintf( "%s %s:00 %s +1 week", ucfirst( $tmsht_options['day_reminder'] ), $tmsht_options['time_reminder'], $tzstring ) );
}
wp_schedule_event( $time, 'tmsht_weekly', 'tmsht_reminder_to_email');
}
}
}
/* Save settings if no errors */
if ( "" == $error ) {
update_option( 'tmsht_options', $tmsht_options );
$message = __( 'Settings saved', 'timesheet' );
}
}
}
if ( isset( $_REQUEST['bws_restore_confirm'] ) && check_admin_referer( $plugin_basename, 'bws_settings_nonce_name' ) ) {
$tmsht_options = $tmsht_default_options;
update_option( 'tmsht_options', $tmsht_options );
$wpdb->query( "UPDATE `{$tmsht_prefix}_legends` SET `disabled` = 1 WHERE `id` NOT IN (1,2,3,4)" );
$message = __( 'All plugin settings were restored.', 'timesheet' );
}
$tmsht_legends = $wpdb->get_results( "SELECT * FROM `{$tmsht_prefix}_legends`", ARRAY_A );
$tmsht_date_formats = array(
'wp' => get_option( 'date_format' ),
'custom' => $tmsht_options['date_format']
); ?>
9 ) ? $time_value : ' ' . $time_value ; ?> |
||
| $user_data_1 ) { ?> | $td_datetime ) { $td_legend_id = $data['legend_id']; $time_to_adjustment = ( date_i18n( 'i', strtotime( $data['time_to'] ) ) > 0 ) ? '24:00' : date_i18n( 'H:i', strtotime( $data['time_to'] ) ); $td_title = sprintf( "%s (%s - %s)", $tmsht_legends[ $td_legend_id ]['name'], date_i18n( 'H:i', strtotime( $data['time_from'] ) ), $time_to_adjustment ); } } } $tmsht_td_timeline_classes = 'tmsht_ts_report_table_td_time tmsht_ts_report_table_td_time_' . $time_value; $tmsht_td_timeline_classes .= ( $tmsht_is_today ) ? ' tmsht_ts_report_table_td_today' : ''; $tmsht_td_timeline_classes .= ( $td_legend_id != -1 ) ? ' tmsht_ts_report_table_td_selected' : ''; $tmsht_td_hover_classes = 'tmsht_ts_report_table_td_helper tmsht_ts_report_table_td_helper_' . $time_value; ?> | " data-legend-id="" title=""> |
| $td_datetime ) { $td_legend_id = $data['legend_id']; $time_to_adjustment = ( date_i18n( 'i', strtotime( $data['time_to'] ) ) > 0 ) ? '24:00' : date_i18n( 'H:i', strtotime( $data['time_to'] ) ); $td_title = sprintf( "%s (%s - %s)", $tmsht_legends[ $td_legend_id ]['name'], date_i18n( 'H:i', strtotime( $data['time_from'] ) ), $time_to_adjustment ); } } } $tmsht_td_timeline_classes = 'tmsht_ts_report_table_td_time tmsht_ts_report_table_td_time_' . $time_value; $tmsht_td_timeline_classes .= ( $tmsht_is_today ) ? ' tmsht_ts_report_table_td_today' : ''; $tmsht_td_timeline_classes .= ( $td_legend_id != -1 ) ? ' tmsht_ts_report_table_td_selected' : ''; $tmsht_td_hover_classes = 'tmsht_ts_report_table_td_helper tmsht_ts_report_table_td_helper_' . $time_value; ?> | " data-legend-id="" title=""> | |
| $user_data_1 ) { $tmsht_short_day_name = date_i18n( 'D', strtotime( $date ) ); $tmsht_is_today = ( date_i18n( $tmsht_date_format_default, strtotime( $date ) ) == date_i18n( $tmsht_date_format_default ) ); $tmsht_td_dateline_classes = 'tmsht_ts_report_table_td_dateline'; $tmsht_td_dateline_classes .= ( $tmsht_is_today ) ? ' tmsht_ts_report_table_highlight_today tmsht_ts_report_table_td_today' : ''; $tmsht_td_dateline_classes .= ( in_array( strtolower( $tmsht_short_day_name ), $tmsht_options['weekends'] ) ) ? ' tmsht_ts_report_table_highlight_weekdays' : ''; $tmsht_td_readonly = ( date_i18n( $tmsht_date_format_default, strtotime( $date ) ) < date_i18n( $tmsht_date_format_default ) ); ?> | $td_datetime ) { $td_legend_id = $data['legend_id']; $time_to_adjustment = ( date_i18n( 'i', strtotime( $data['time_to'] ) ) > 0 ) ? '24:00' : date_i18n( 'H:i', strtotime( $data['time_to'] ) ); $td_title = sprintf( "%s (%s - %s)", $tmsht_legends[ $td_legend_id ]['name'], date_i18n( 'H:i', strtotime( $data['time_from'] ) ), $time_to_adjustment ); } } } $tmsht_td_timeline_classes = 'tmsht_ts_report_table_td_time tmsht_ts_report_table_td_time_' . $time_value; $tmsht_td_timeline_classes .= ( $tmsht_is_today ) ? ' tmsht_ts_report_table_td_today' : ''; $tmsht_td_timeline_classes .= ( $td_legend_id != -1 ) ? ' tmsht_ts_report_table_td_selected' : ''; $tmsht_td_hover_classes = 'tmsht_ts_report_table_td_helper tmsht_ts_report_table_td_helper_' . $time_value; ?> | " data-legend-id="" title=""> |
| $td_datetime ) { $td_legend_id = $data['legend_id']; $time_to_adjustment = ( date_i18n( 'i', strtotime( $data['time_to'] ) ) > 0 ) ? '24:00' : date_i18n( 'H:i', strtotime( $data['time_to'] ) ); $td_title = sprintf( "%s (%s - %s)", $tmsht_legends[ $td_legend_id ]['name'], date_i18n( 'H:i', strtotime( $data['time_from'] ) ), $time_to_adjustment ); } } } $tmsht_is_today = ( date_i18n( $tmsht_date_format_default, strtotime( $date ) ) == date_i18n( $tmsht_date_format_default ) ); $tmsht_td_timeline_classes = 'tmsht_ts_report_table_td_time tmsht_ts_report_table_td_time_' . $time_value; $tmsht_td_timeline_classes .= ( $tmsht_is_today ) ? ' tmsht_ts_report_table_td_today' : ''; $tmsht_td_timeline_classes .= ( $td_legend_id != -1 ) ? ' tmsht_ts_report_table_td_selected' : ''; $tmsht_td_hover_classes = 'tmsht_ts_report_table_td_helper tmsht_ts_report_table_td_helper_' . $time_value; ?> | " data-legend-id="" title=""> | |
9 ) ? $time_value : ' ' . $time_value ; ?> |