2019-03-22 18:18:23 -04:00
|
|
|
VERSION 5.00
|
|
|
|
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} changes
|
|
|
|
Caption = "History"
|
2020-02-19 23:03:48 -05:00
|
|
|
ClientHeight = 7785
|
2019-03-22 18:18:23 -04:00
|
|
|
ClientLeft = 120
|
|
|
|
ClientTop = 465
|
2020-02-25 10:56:18 -05:00
|
|
|
ClientWidth = 16710
|
2019-03-22 18:18:23 -04:00
|
|
|
OleObjectBlob = "changes.frx":0000
|
|
|
|
StartUpPosition = 1 'CenterOwner
|
|
|
|
End
|
|
|
|
Attribute VB_Name = "changes"
|
|
|
|
Attribute VB_GlobalNameSpace = False
|
|
|
|
Attribute VB_Creatable = False
|
|
|
|
Attribute VB_PredeclaredId = True
|
|
|
|
Attribute VB_Exposed = False
|
2020-03-05 01:08:10 -05:00
|
|
|
Private x As Variant
|
2019-03-22 18:18:23 -04:00
|
|
|
|
|
|
|
Private Sub cbCancel_Click()
|
|
|
|
|
|
|
|
Me.Hide
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
2020-02-14 17:24:02 -05:00
|
|
|
Private Sub cbUndo_Click()
|
|
|
|
|
2020-02-18 17:04:03 -05:00
|
|
|
|
2020-02-19 23:03:48 -05:00
|
|
|
Call Me.delete_selected
|
2020-02-14 17:24:02 -05:00
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
2019-03-22 18:18:23 -04:00
|
|
|
Private Sub lbHist_Change()
|
|
|
|
|
|
|
|
Dim i As Integer
|
|
|
|
|
|
|
|
For i = 0 To Me.lbHist.ListCount - 1
|
|
|
|
If Me.lbHist.Selected(i) Then
|
2020-03-05 01:08:10 -05:00
|
|
|
Me.tbPrint.value = x(i, 7)
|
2019-03-22 18:18:23 -04:00
|
|
|
Exit Sub
|
|
|
|
End If
|
|
|
|
Next i
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-19 23:03:48 -05:00
|
|
|
Private Sub lbHist_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
|
|
|
|
|
|
|
|
Select Case KeyCode
|
|
|
|
Case 46
|
|
|
|
Call Me.delete_selected
|
|
|
|
Case 27
|
|
|
|
Call Me.Hide
|
|
|
|
End Select
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
2020-02-25 10:56:18 -05:00
|
|
|
|
|
|
|
|
|
|
|
Private Sub tbPrint_Change()
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
2019-03-22 18:18:23 -04:00
|
|
|
Private Sub UserForm_Activate()
|
|
|
|
|
|
|
|
Dim fail As Boolean
|
|
|
|
|
2020-02-14 02:27:01 -05:00
|
|
|
'x = handler.list_changes("{""user"":""" & Application.UserName & """}", fail)
|
2020-03-05 01:08:10 -05:00
|
|
|
x = handler.list_changes("{""quota_rep_descr"":""" & Sheets("data").Cells(2, 5) & """}", fail)
|
2019-03-22 18:18:23 -04:00
|
|
|
If fail Then
|
|
|
|
Me.Hide
|
|
|
|
Exit Sub
|
|
|
|
End If
|
2020-03-05 01:08:10 -05:00
|
|
|
Me.lbHist.list = x
|
2020-03-03 23:22:13 -05:00
|
|
|
|
|
|
|
lbHEAD.ColumnCount = lbHist.ColumnCount
|
|
|
|
lbHEAD.ColumnWidths = lbHist.ColumnWidths
|
|
|
|
|
|
|
|
' add header elements
|
|
|
|
lbHEAD.clear
|
|
|
|
lbHEAD.AddItem
|
|
|
|
lbHEAD.list(0, 0) = "Modifier"
|
|
|
|
lbHEAD.list(0, 1) = "Owner"
|
|
|
|
lbHEAD.list(0, 2) = "When"
|
|
|
|
lbHEAD.list(0, 3) = "Tag"
|
|
|
|
lbHEAD.list(0, 4) = "Comment"
|
|
|
|
lbHEAD.list(0, 5) = "Sales"
|
|
|
|
|
|
|
|
' make it pretty
|
|
|
|
'body.ZOrder (1)
|
|
|
|
'lbHEAD.ZOrder (0)
|
|
|
|
'lbHEAD.SpecialEffect = fmSpecialEffectFlat
|
|
|
|
'lbHEAD.BackColor = RGB(200, 200, 200)
|
|
|
|
lbHEAD.Height = 10
|
|
|
|
|
|
|
|
' align header to body (should be done last!)
|
|
|
|
lbHEAD.width = lbHist.width
|
|
|
|
lbHEAD.Left = lbHist.Left
|
|
|
|
lbHEAD.Top = lbHist.Top - (lbHEAD.Height - 1)
|
2019-03-22 18:18:23 -04:00
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
2020-02-19 23:03:48 -05:00
|
|
|
Sub delete_selected()
|
|
|
|
|
|
|
|
Dim logid As Integer
|
|
|
|
Dim i As Integer
|
|
|
|
Dim fail As Boolean
|
|
|
|
Dim proceed As Boolean
|
|
|
|
|
2020-02-25 10:56:18 -05:00
|
|
|
If MsgBox("Permanently delete these changes?", vbOKCancel) = vbCancel Then
|
2020-02-19 23:03:48 -05:00
|
|
|
Exit Sub
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
For i = 0 To Me.lbHist.ListCount - 1
|
|
|
|
If Me.lbHist.Selected(i) Then
|
2020-03-05 01:08:10 -05:00
|
|
|
Call handler.undo_changes(x(i, 6), fail)
|
2020-02-19 23:03:48 -05:00
|
|
|
If fail Then
|
|
|
|
MsgBox ("undo did not work")
|
|
|
|
Exit Sub
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
Next i
|
|
|
|
|
|
|
|
Sheets("Orders").PivotTables("PivotTable1").PivotCache.Refresh
|
|
|
|
|
|
|
|
Me.lbHist.clear
|
|
|
|
Me.Hide
|
|
|
|
|
|
|
|
End Sub
|