1
PayPeriodScheduleViewController = BaseViewController.extend( {
3
el: '#pay_period_schedule_view_container', //Must set el here and can only set string, so events can work
4
user_preference_api: null,
6
pay_period_starts_on_array: null,
7
start_week_day_array: null,
8
transaction_date_array: null,
9
transaction_date_business_day_array: null,
10
time_zone_array: null,
11
shift_assigned_day_array: null,
12
timesheet_verify_type_array: null,
13
sub_pay_periods_view_controller: null,
15
initialize: function( options ) {
17
this._super( 'initialize', options );
18
this.edit_view_tpl = 'PayPeriodScheduleEditView.html';
19
this.permission_id = 'pay_period_schedule';
20
this.viewId = 'PayPeriodSchedule';
21
this.script_name = 'PayPeriodScheduleView';
22
this.table_name_key = 'pay_period_schedule';
23
this.context_menu_name = $.i18n._( 'Pay Period Schedule' );
24
this.navigation_label = $.i18n._( 'Pay Period Schedule' ) + ':';
25
this.api = new (APIFactory.getAPIClass( 'APIPayPeriodSchedule' ))();
26
this.user_preference_api = new (APIFactory.getAPIClass( 'APIUserPreference' ))();
28
this.invisible_context_menu_dic[ContextMenuIconName.copy] = true; //Hide some context menus
29
this.invisible_context_menu_dic[ContextMenuIconName.mass_edit] = true;
31
this.buildContextMenu();
34
this.setSelectRibbonMenuIfNecessary( 'PayPeriodSchedule' );
38
openEditView: function( id ) {
39
Global.setUINotready();
40
TTPromise.add('init','init');
45
if ( $this.edit_only_mode ) {
47
$this.initOptions( function( result ) {
49
if ( !$this.edit_view ) {
50
$this.initEditViewUI( $this.viewId, $this.edit_view_tpl );
53
$this.getPayPeriodScheduleData( id, function( result ) {
54
// Waiting for the (APIFactory.getAPIClass( 'API' )) returns data to set the current edit record.
55
$this.current_edit_record = result;
64
if ( !this.edit_view ) {
65
this.initEditViewUI( $this.viewId, $this.edit_view_tpl );
73
getPayPeriodScheduleData: function( id, callBack ) {
75
filter.filter_data = {};
76
filter.filter_data.id = [id];
78
this.api['get' + this.api.key_name]( filter, {
79
onResult: function( result ) {
80
var result_data = result.getResult();
85
result_data = result_data[0];
87
callBack( result_data );
93
initOptions: function( callBack ) {
97
{option_name: 'type'},
98
{option_name: 'transaction_date'},
99
{option_name: 'transaction_date_business_day'},
100
{option_name: 'shift_assigned_day'},
101
{option_name: 'time_zone', field_name: '', api: this.user_preference_api},
102
{option_name: 'timesheet_verify_type'},
103
{option_name: 'start_week_day'}
107
this.initDropDownOptions( options, function( result ) {
109
$this.transaction_date_array.push( {
112
label: $.i18n._( '- Last Day Of Month -' ),
117
$this.user_preference_api.getOptions( 'start_week_day', {
118
onResult: function( res ) {
119
var result = res.getResult();
120
$this.pay_period_starts_on_array = Global.buildRecordArray( result );
123
callBack( result ); // First to initialize drop down options, and then to initialize edit view UI.
132
onTabShow: function( e, ui ) {
134
var key = this.edit_view_tab_selected_index;
135
this.editFieldResize( key );
136
if ( !this.current_edit_record ) {
140
if ( this.edit_view_tab_selected_index === 2 ) {
142
if ( this.current_edit_record.id ) {
143
this.edit_view_tab.find( '#tab_pay_period' ).find( '.first-column-sub-view' ).css( 'display', 'block' );
144
this.initSubPayPeriodsView();
146
this.edit_view_tab.find( '#tab_pay_period' ).find( '.first-column-sub-view' ).css( 'display', 'none' );
147
this.edit_view.find( '.save-and-continue-div' ).css( 'display', 'block' );
150
} else if ( this.edit_view_tab_selected_index === 3 ) {
152
if ( this.current_edit_record.id ) {
153
this.edit_view_tab.find( '#tab_audit' ).find( '.first-column-sub-view' ).css( 'display', 'block' );
154
this.initSubLogView( 'tab_audit' );
156
this.edit_view_tab.find( '#tab_audit' ).find( '.first-column-sub-view' ).css( 'display', 'none' );
157
this.edit_view.find( '.save-and-continue-div' ).css( 'display', 'block' );
160
this.buildContextMenu( true );
165
setTabStatus: function() {
167
$( this.edit_view_tab.find( 'ul li a[ref="tab_pay_period_schedule"]' ) ).parent().show();
168
if ( this.is_mass_editing ) {
169
$( this.edit_view_tab.find( 'ul li a[ref="tab_pay_period"]' ) ).parent().hide();
170
$( this.edit_view_tab.find( 'ul li a[ref="tab_audit"]' ) ).parent().hide();
171
this.edit_view_tab.tabs( 'select', 0 );
173
$( this.edit_view_tab.find( 'ul li a[ref="tab_pay_period"]' ) ).parent().show();
174
if ( this.subAuditValidate() ) {
175
$( this.edit_view_tab.find( 'ul li a[ref="tab_audit"]' ) ).parent().show();
177
$( this.edit_view_tab.find( 'ul li a[ref="tab_audit"]' ) ).parent().hide();
178
this.edit_view_tab.tabs( 'select', 0 );
183
this.editFieldResize( 0 );
187
initTabData: function() {
188
if ( this.edit_view_tab.tabs( 'option', 'selected' ) === 2 ) {
189
if ( this.current_edit_record.id ) {
190
this.edit_view_tab.find( '#tab_pay_period' ).find( '.first-column-sub-view' ).css( 'display', 'block' );
191
this.initSubPayPeriodsView();
193
this.edit_view_tab.find( '#tab_pay_period' ).find( '.first-column-sub-view' ).css( 'display', 'none' );
194
this.edit_view.find( '.save-and-continue-div' ).css( 'display', 'block' );
196
} else if ( this.edit_view_tab.tabs( 'option', 'selected' ) === 3 ) {
197
if ( this.current_edit_record.id ) {
198
this.edit_view_tab.find( '#tab_audit' ).find( '.first-column-sub-view' ).css( 'display', 'block' );
199
this.initSubLogView( 'tab_audit' );
201
this.edit_view_tab.find( '#tab_audit' ).find( '.first-column-sub-view' ).css( 'display', 'none' );
202
this.edit_view.find( '.save-and-continue-div' ).css( 'display', 'block' );
207
initSubPayPeriodsView: function() {
210
if ( this.sub_pay_periods_view_controller ) {
211
this.sub_pay_periods_view_controller.buildContextMenu( true );
212
this.sub_pay_periods_view_controller.setDefaultMenu();
213
$this.sub_pay_periods_view_controller.parent_value = $this.current_edit_record.id;
214
$this.sub_pay_periods_view_controller.parent_edit_record = $this.current_edit_record;
215
$this.sub_pay_periods_view_controller.initData(); //Init data in this parent view
219
Global.loadScript( 'views/payroll/pay_periods/PayPeriodsViewController.js', function() {
221
var tab_pay_period_schedule = $this.edit_view_tab.find( '#tab_pay_period' );
223
var firstColumn = tab_pay_period_schedule.find( '.first-column-sub-view' );
225
Global.trackView( 'Sub' + 'PayPeriods' + 'View' );
226
PayPeriodsViewController.loadSubView( firstColumn, beforeLoadView, afterLoadView );
230
function beforeLoadView() {
234
function afterLoadView( subViewController ) {
236
$this.sub_pay_periods_view_controller = subViewController;
237
$this.sub_pay_periods_view_controller.parent_key = 'pay_period_schedule_id';
238
$this.sub_pay_periods_view_controller.parent_value = $this.current_edit_record.id;
239
$this.sub_pay_periods_view_controller.parent_edit_record = $this.current_edit_record;
240
$this.sub_pay_periods_view_controller.parent_view_controller = $this;
241
$this.sub_pay_periods_view_controller.initData(); //Init data in this parent view
245
onFormItemChange: function( target, doNotValidate ) {
247
this.setIsChanged( target );
248
this.setMassEditingFieldsWhenFormChange( target );
249
var key = target.getField();
250
var c_value = target.getValue();
252
this.current_edit_record[key] = c_value;
254
if ( key === 'type_id' ) {
257
} else if ( key === 'timesheet_verify_type_id' ) {
258
this.onVerifyTypeChange();
261
if ( !doNotValidate ) {
266
removeEditView: function() {
268
this._super( 'removeEditView' );
269
this.sub_pay_periods_view_controller = null;
273
onVerifyTypeChange: function() {
274
if ( this.current_edit_record.timesheet_verify_type_id === 10 ) {
275
this.detachElement( 'timesheet_verify_before_end_date' );
276
this.detachElement( 'timesheet_verify_before_transaction_date' );
278
this.attachElement( 'timesheet_verify_before_end_date' );
279
this.attachElement( 'timesheet_verify_before_transaction_date' );
282
this.editFieldResize();
285
_continueDoCopyAsNew: function() {
289
LocalCacheData.current_doing_context_action = 'copy_as_new';
293
if ( Global.isSet( this.edit_view ) ) {
295
this.current_edit_record.id = '';
296
var navigation_div = this.edit_view.find( '.navigation-div' );
297
navigation_div.css( 'display', 'none' );
301
$this.onTypeChange(); //Override for this;
302
this.is_changed = false;
303
ProgressBar.closeOverlay();
308
var grid_selected_id_array = this.getGridSelectIdArray();
309
var grid_selected_length = grid_selected_id_array.length;
311
if ( grid_selected_length > 0 ) {
312
selectedId = grid_selected_id_array[0];
314
TAlertManager.showAlert( $.i18n._( 'No selected record' ) );
318
filter.filter_data = {};
319
filter.filter_data.id = [selectedId];
321
this.api['get' + this.api.key_name]( filter, {
322
onResult: function( result ) {
324
$this.onCopyAsNewResult( result );
332
onTypeChange: function() {
334
if ( this.current_edit_record.type_id === 5 ) {
335
this.detachElement( 'anchor_date' );
338
if ( this.current_edit_record.id ) {
339
this.detachElement( 'anchor_date' );
341
this.attachElement( 'anchor_date' );
346
if ( this.current_edit_record.type_id === 5 ) {
347
this.detachElement( 'primary' );
348
this.detachElement( 'primary_day_of_month' );
349
this.detachElement( 'primary_transaction_day_of_month' );
350
this.detachElement( 'secondary' );
351
this.detachElement( 'secondary_day_of_month' );
352
this.detachElement( 'secondary_transaction_day_of_month' );
353
this.attachElement( 'annual_pay_periods' );
354
this.detachElement( 'start_day_of_week' );
355
this.detachElement( 'transaction_date' );
356
this.detachElement( 'transaction_date_bd' );
358
} else if ( this.current_edit_record.type_id === 10 || this.current_edit_record.type_id === 20 || this.current_edit_record.type_id === 100 || this.current_edit_record.type_id === 200 ) {
359
this.detachElement( 'primary' );
360
this.detachElement( 'primary_day_of_month' );
361
this.detachElement( 'primary_transaction_day_of_month' );
362
this.detachElement( 'secondary' );
363
this.detachElement( 'secondary_day_of_month' );
364
this.detachElement( 'secondary_transaction_day_of_month' );
365
this.detachElement( 'annual_pay_periods' );
366
this.attachElement( 'start_day_of_week' );
367
this.attachElement( 'transaction_date' );
368
this.attachElement( 'transaction_date_bd' );
370
} else if ( this.current_edit_record.type_id === 30 ) {
371
this.attachElement( 'primary' );
372
this.attachElement( 'primary_day_of_month' );
373
this.attachElement( 'primary_transaction_day_of_month' );
374
this.attachElement( 'secondary' );
375
this.attachElement( 'secondary_day_of_month' );
376
this.attachElement( 'secondary_transaction_day_of_month' );
377
this.detachElement( 'annual_pay_periods' );
378
this.detachElement( 'start_day_of_week' );
379
this.detachElement( 'transaction_date' );
380
this.attachElement( 'transaction_date_bd' );
381
} else if ( this.current_edit_record.type_id === 50 ) {
382
this.attachElement( 'primary' );
383
this.attachElement( 'primary_day_of_month' );
384
this.attachElement( 'primary_transaction_day_of_month' );
385
this.detachElement( 'secondary' );
386
this.detachElement( 'secondary_day_of_month' );
387
this.detachElement( 'secondary_transaction_day_of_month' );
388
this.detachElement( 'annual_pay_periods' );
389
this.detachElement( 'start_day_of_week' );
390
this.detachElement( 'transaction_date' );
391
this.attachElement( 'transaction_date_bd' );
394
this.editFieldResize();
397
setCurrentEditRecordData: function() {
398
//Set current edit record data to all widgets
399
for ( var key in this.current_edit_record ) {
400
var widget = this.edit_view_ui_dic[key];
401
if ( Global.isSet( widget ) ) {
404
widget.setValue( this.current_edit_record[key] );
411
this.onVerifyTypeChange();
412
this.collectUIDataToCurrentEditRecord();
413
this.setEditViewDataDone();
416
buildEditViewUI: function() {
418
this._super( 'buildEditViewUI' );
423
'tab_pay_period_schedule': $.i18n._( 'Pay Period Schedule' ),
424
'tab_advanced': $.i18n._( 'Advanced' ),
425
'tab_pay_period': $.i18n._( 'Pay Periods' ),
426
'tab_audit': $.i18n._( 'Audit' )
429
if ( !this.edit_only_mode ) {
430
this.navigation.AComboBox( {
431
id: this.script_name + '_navigation',
432
api_class: (APIFactory.getAPIClass( 'APIPayPeriodSchedule' )),
433
allow_multiple_selection: false,
434
layout_name: ALayoutIDs.PAY_PERIOD_SCHEDULE,
435
navigation_mode: true,
436
show_search_inputs: true
439
this.setNavigation();
444
var tab_pay_period_schedule = this.edit_view_tab.find( '#tab_pay_period_schedule' );
446
var tab_pay_period_schedule_column1 = tab_pay_period_schedule.find( '.first-column' );
447
this.edit_view_tabs[0] = [];
449
this.edit_view_tabs[0].push( tab_pay_period_schedule_column1 );
452
var form_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );
453
form_item_input.TTextInput( {field: 'name', width: '100%'} );
454
this.addEditFieldToColumn( $.i18n._( 'Name' ), form_item_input, tab_pay_period_schedule_column1, '' );
456
form_item_input.parent().width( '45%' );
459
form_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );
460
form_item_input.TTextInput( {field: 'description', width: '100%'} );
461
this.addEditFieldToColumn( $.i18n._( 'Description' ), form_item_input, tab_pay_period_schedule_column1 );
463
form_item_input.parent().width( '45%' );
466
form_item_input = Global.loadWidgetByName( FormItemType.SEPARATED_BOX );
467
form_item_input.SeparatedBox( {label: $.i18n._( 'Pay Period Dates' )} );
468
this.addEditFieldToColumn( null, form_item_input, tab_pay_period_schedule_column1 );
471
form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );
473
form_item_input.TComboBox( {field: 'type_id'} );
474
form_item_input.setSourceData( Global.addFirstItemToArray( $this.type_array ) );
475
this.addEditFieldToColumn( $.i18n._( 'Type' ), form_item_input, tab_pay_period_schedule_column1 );
479
form_item_input = Global.loadWidgetByName( FormItemType.SEPARATED_BOX );
480
form_item_input.SeparatedBox( {label: $.i18n._( 'Primary' )} );
481
this.addEditFieldToColumn( null, form_item_input, tab_pay_period_schedule_column1, '', null, true, false, 'primary' );
483
// Pay Period Start Day of Month
484
form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );
486
form_item_input.TComboBox( {field: 'primary_day_of_month'} );
487
var widgetContainer = $( "<div class='widget-h-box'></div>" );
488
var label = $( "<span class='widget-right-label'> " + $.i18n._( 'at 00:00' ) + "</span>" );
490
widgetContainer.append( form_item_input );
491
widgetContainer.append( label );
492
form_item_input.setSourceData( Global.addFirstItemToArray( $this.transaction_date_array ) );
493
this.addEditFieldToColumn( $.i18n._( 'Pay Period Start Day of Month' ), form_item_input, tab_pay_period_schedule_column1, '', widgetContainer, true );
495
// Transaction Day Of Month
496
form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );
498
form_item_input.TComboBox( {field: 'primary_transaction_day_of_month'} );
499
form_item_input.setSourceData( Global.addFirstItemToArray( $this.transaction_date_array ) );
500
this.addEditFieldToColumn( $.i18n._( 'Transaction Day Of Month' ), form_item_input, tab_pay_period_schedule_column1, '', null, true );
503
form_item_input = Global.loadWidgetByName( FormItemType.SEPARATED_BOX );
504
form_item_input.SeparatedBox( {label: $.i18n._( 'Secondary' )} );
505
this.addEditFieldToColumn( null, form_item_input, tab_pay_period_schedule_column1, '', null, true, false, 'secondary' );
507
// Pay Period Start Day Of Month
508
form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );
510
form_item_input.TComboBox( {field: 'secondary_day_of_month'} );
511
widgetContainer = $( "<div class='widget-h-box'></div>" );
512
label = $( "<span class='widget-right-label'> " + $.i18n._( 'at 00:00' ) + "</span>" );
514
widgetContainer.append( form_item_input );
515
widgetContainer.append( label );
516
form_item_input.setSourceData( Global.addFirstItemToArray( $this.transaction_date_array ) );
517
this.addEditFieldToColumn( $.i18n._( 'Pay Period Start Day of Month' ), form_item_input, tab_pay_period_schedule_column1, '', widgetContainer, true );
519
// Transaction Day Of Month
520
form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );
522
form_item_input.TComboBox( {field: 'secondary_transaction_day_of_month'} );
523
form_item_input.setSourceData( Global.addFirstItemToArray( $this.transaction_date_array ) );
524
this.addEditFieldToColumn( $.i18n._( 'Transaction Day Of Month' ), form_item_input, tab_pay_period_schedule_column1, '', null, true );
526
// Annual Pay Periods
527
form_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );
529
form_item_input.TTextInput( {field: 'annual_pay_periods'} );
530
this.addEditFieldToColumn( $.i18n._( 'Annual Pay Periods' ), form_item_input, tab_pay_period_schedule_column1, '', null, true );
532
// Pay Period Starts On
533
form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );
535
form_item_input.TComboBox( {field: 'start_day_of_week'} );
536
widgetContainer = $( "<div class='widget-h-box'></div>" );
537
label = $( "<span class='widget-right-label'> " + $.i18n._( 'at 00:00' ) + "</span>" );
539
widgetContainer.append( form_item_input );
540
widgetContainer.append( label );
541
form_item_input.setSourceData( Global.addFirstItemToArray( $this.pay_period_starts_on_array ) );
542
this.addEditFieldToColumn( $.i18n._( 'Pay Period Starts On' ), form_item_input, tab_pay_period_schedule_column1, '', widgetContainer, true );
545
form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );
547
form_item_input.TComboBox( {field: 'transaction_date'} );
548
widgetContainer = $( "<div class='widget-h-box'></div>" );
549
label = $( "<span class='widget-right-label'> (" + $.i18n._( 'days after end of pay period' ) + ")</span>" );
551
widgetContainer.append( form_item_input );
552
widgetContainer.append( label );
553
form_item_input.setSourceData( Global.addFirstItemToArray( $this.transaction_date_array ) );
554
this.addEditFieldToColumn( $.i18n._( 'Transaction Date' ), form_item_input, tab_pay_period_schedule_column1, '', widgetContainer, true );
556
// Transaction Always on Business Day
557
form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );
559
form_item_input.TComboBox( {field: 'transaction_date_bd'} );
561
form_item_input.setSourceData( Global.addFirstItemToArray( $this.transaction_date_business_day_array ) );
562
this.addEditFieldToColumn( $.i18n._( 'Transaction Always on Business Day' ), form_item_input, tab_pay_period_schedule_column1, '', null, true );
564
//Create Initial Pay Periods From
565
form_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );
567
form_item_input.TDatePicker( {field: 'anchor_date'} );
568
this.addEditFieldToColumn( $.i18n._( 'Create Initial Pay Periods From' ), form_item_input, tab_pay_period_schedule_column1, '', null, true );
571
form_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );
572
form_item_input.AComboBox( {
573
api_class: (APIFactory.getAPIClass( 'APIUser' )),
574
allow_multiple_selection: true,
575
layout_name: ALayoutIDs.USER,
576
show_search_inputs: true,
580
this.addEditFieldToColumn( $.i18n._( 'Employees' ), form_item_input, tab_pay_period_schedule_column1 );
584
var tab_advanced = this.edit_view_tab.find( '#tab_advanced' );
586
var tab_advanced_column1 = tab_advanced.find( '.first-column' );
587
this.edit_view_tabs[1] = [];
589
this.edit_view_tabs[1].push( tab_advanced_column1 );
592
form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );
594
form_item_input.TComboBox( {field: 'start_week_day_id'} );
595
form_item_input.setSourceData( Global.addFirstItemToArray( $this.start_week_day_array ) );
596
this.addEditFieldToColumn( $.i18n._( 'Overtime Week' ), form_item_input, tab_advanced_column1, '' );
599
form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );
601
form_item_input.TComboBox( {field: 'time_zone', set_empty: true} );
602
form_item_input.setSourceData( Global.addFirstItemToArray( $this.time_zone_array ) );
603
this.addEditFieldToColumn( $.i18n._( 'Time Zone' ), form_item_input, tab_advanced_column1 );
605
// Minimum Time-Off Between Shifts
606
form_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );
607
form_item_input.TTextInput( {field: 'new_day_trigger_time', mode: 'time_unit', need_parser_sec: true} );
609
widgetContainer = $( "<div class='widget-h-box'></div>" );
610
label = $( "<span class='widget-right-label'>(" + $.i18n._( 'Only for shifts that span midnight' ) + ")</span>" );
611
widgetContainer.append( form_item_input );
612
widgetContainer.append( label );
613
this.addEditFieldToColumn( $.i18n._( 'Minimum Time-Off Between Shifts' ), form_item_input, tab_advanced_column1, '', widgetContainer );
615
// Maximum Shift Time
616
form_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );
617
form_item_input.TTextInput( {field: 'maximum_shift_time', mode: 'time_unit', need_parser_sec: true} );
619
this.addEditFieldToColumn( $.i18n._( 'Maximum Shift Time' ), form_item_input, tab_advanced_column1, '', null );
622
form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );
624
form_item_input.TComboBox( {field: 'shift_assigned_day_id'} );
625
form_item_input.setSourceData( Global.addFirstItemToArray( $this.shift_assigned_day_array ) );
626
this.addEditFieldToColumn( $.i18n._( 'Assign Shifts To' ), form_item_input, tab_advanced_column1 );
628
// TimeSheet Verification
629
form_item_input = Global.loadWidgetByName( FormItemType.SEPARATED_BOX );
630
form_item_input.SeparatedBox( {label: $.i18n._( 'TimeSheet Verification' )} );
631
this.addEditFieldToColumn( null, form_item_input, tab_advanced_column1 );
633
// Timesheet Verification
634
form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );
636
form_item_input.TComboBox( {field: 'timesheet_verify_type_id'} );
637
form_item_input.setSourceData( Global.addFirstItemToArray( $this.timesheet_verify_type_array ) );
638
this.addEditFieldToColumn( $.i18n._( 'TimeSheet Verification' ), form_item_input, tab_advanced_column1 );
640
// Verification Window Starts
641
form_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );
642
form_item_input.TTextInput( {field: 'timesheet_verify_before_end_date', width: 30} );
644
widgetContainer = $( "<div class='widget-h-box'></div>" );
645
label = $( "<span class='widget-right-label'>" + $.i18n._( 'Day(s)' ) + ' (' + $.i18n._( 'Before Pay Period End Date' ) + ' )' + "</span>" );
646
widgetContainer.append( form_item_input );
647
widgetContainer.append( label );
648
this.addEditFieldToColumn( $.i18n._( 'Verification Window Starts' ), form_item_input, tab_advanced_column1, '', widgetContainer, true );
650
// Verification Windows Ends
651
form_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );
652
form_item_input.TTextInput( {field: 'timesheet_verify_before_transaction_date', width: 30} );
654
widgetContainer = $( "<div class='widget-h-box'></div>" );
655
label = $( "<span class='widget-right-label'>" + $.i18n._( 'Day(s)' ) + ' (' + $.i18n._( 'Before Pay Period Transaction Date' ) + ' )' + "</span>" );
656
widgetContainer.append( form_item_input );
657
widgetContainer.append( label );
658
this.addEditFieldToColumn( $.i18n._( 'Verification Windows Ends' ), form_item_input, tab_advanced_column1, '', widgetContainer, true );
662
buildSearchFields: function() {
664
this._super( 'buildSearchFields' );
666
this.search_fields = [
669
label: $.i18n._( 'Name' ),
673
form_item_type: FormItemType.TEXT_INPUT
676
label: $.i18n._( 'Type' ),
681
layout_name: ALayoutIDs.OPTION_COLUMN,
682
form_item_type: FormItemType.AWESOME_BOX
685
label: $.i18n._( 'Description' ),
687
field: 'description',
689
form_item_type: FormItemType.TEXT_INPUT
692
label: $.i18n._( 'Created By' ),
695
layout_name: ALayoutIDs.USER,
696
api_class: (APIFactory.getAPIClass( 'APIUser' )),
699
script_name: 'EmployeeView',
700
form_item_type: FormItemType.AWESOME_BOX
703
label: $.i18n._( 'Updated By' ),
706
layout_name: ALayoutIDs.USER,
707
api_class: (APIFactory.getAPIClass( 'APIUser' )),
710
script_name: 'EmployeeView',
711
form_item_type: FormItemType.AWESOME_BOX