chenqinghong
2024-05-07 3ec06a830367465068963156dcc1d8e522571c13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Quintiq file version 2.0
#parent: #root
Method UpdateExportStatus (String status, Boolean checkIfDisplayMessageBox) id:Method_LibSOPImpExp_BaseButtonExport_UpdateExportStatus
{
  #keys: '[144528.1.177554795]'
  Body:
  [*
    // Update button enabled state, image and tooltip
    exportObj := this.O_GetExportBase();
    
    // No export object means no export executing (get last exported time & button should be enabled)
    if( isnull( exportObj ) or status = LibSOPImpExp_ImportExportBase::Status_Idle() )
    {
      this.Enabled( true, '' );
      this.Image( 'EXPORT2' );
      this.Tooltip( Translations::LibSOPImpExp_Export_LastExportTime( this.O_GetLastExportTime() ) );
    }
    else if( status = LibSOPImpExp_ImportExportBase::Status_InProgress() )
    {
      // Even if another user performed a successful export, as long as this current user's 
      // export still executing, we display 'in progress'
      this.Enabled( false, '' );
      this.Image( 'PROGRESS_BAR' );
      this.Tooltip( Translations::LibSOPImpExp_Export_InProgress() );
    }
    else if( status = LibSOPImpExp_ImportExportBase::Status_Done() )
    {
      this.Enabled( true, '' );
      this.Image( 'EXPORT2' );
      this.Tooltip( Translations::LibSOPImpExp_Export_LastExportTime( this.O_GetLastExportTime() ) );
      
      // If this method triggered by changes to last exported time (either by current user or other users), we skip display success message
      if( checkIfDisplayMessageBox )
      {
        // On sucess, display notification
        WebMessageBox::Success( Application, exportObj.GetSuccessMessage() );
      }
    }
  *]
}