rwdaddresses 1.01 → 1.02
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Readme.txt +5 -0
- data/code/01rwdcore/01rwdcore.rb +15 -13
- data/code/01rwdcore/openhelpwindow.rb +26 -26
- data/code/01rwdcore/returntomain.rb +8 -8
- data/code/01rwdcore/rwdtinkerversion.rb +12 -13
- data/code/01rwdcore/rwdwindowreturn.rb +3 -5
- data/code/01rwdcore/test_cases.rb +115 -0
- data/code/01rwdcore/test_harness.rb +12 -0
- data/code/01rwdcore/uploadreturns.rb +60 -59
- data/code/superant.com.rwdaddresses/attachtmpcontactphoto.rb +23 -23
- data/code/superant.com.rwdaddresses/clearscreendisplay.rb +14 -15
- data/code/superant.com.rwdaddresses/createnewnamerecord.rb +19 -18
- data/code/superant.com.rwdaddresses/deletecontactrecord.rb +22 -21
- data/code/superant.com.rwdaddresses/deleterwdaddressesupdatefiles.rb +15 -16
- data/code/superant.com.rwdaddresses/downloadrwdaddressfiles.rb +34 -32
- data/code/superant.com.rwdaddresses/listnamerecord.rb +14 -14
- data/code/superant.com.rwdaddresses/listvcardrecord.rb +15 -0
- data/code/superant.com.rwdaddresses/loadconfigurationrecord.rb +45 -44
- data/code/superant.com.rwdaddresses/loadconfigurationvariables.rb +14 -13
- data/code/superant.com.rwdaddresses/loadnamerecord.rb +29 -29
- data/code/superant.com.rwdaddresses/openhelpwindowrwdaddresses.rb +25 -25
- data/code/superant.com.rwdaddresses/renamecontact.rb +14 -15
- data/code/superant.com.rwdaddresses/returntomain.rb +8 -8
- data/code/superant.com.rwdaddresses/runaddresseswindow.rb +8 -8
- data/code/superant.com.rwdaddresses/runrwdaddressesmenu1.rb +31 -31
- data/code/superant.com.rwdaddresses/runrwdaddresssyncbackwindow.rb +8 -8
- data/code/superant.com.rwdaddresses/rwdaddressesbackwindow.rb +8 -8
- data/code/superant.com.rwdaddresses/rwdaddresseshelpabout.rb +10 -11
- data/code/superant.com.rwdaddresses/saveconfigurationrecord.rb +20 -20
- data/code/superant.com.rwdaddresses/savevcardrecord.rb +76 -0
- data/code/superant.com.rwdaddresses/syncrwdaddress.rb +24 -26
- data/code/superant.com.rwdaddresses/uploadrwdaddressfiles.rb +28 -28
- data/code/superant.com.rwdaddresses/viewaddressconfiguration.rb +21 -21
- data/code/superant.com.rwdaddresses/viewnamedata.rb +27 -26
- data/code/superant.com.rwdaddresses/viewphoto.rb +4 -4
- data/code/superant.com.rwdaddresses/viewrwdaddressesconfiguration.rb +23 -21
- data/code/superant.com.rwdaddresses/viewtmpcontactphoto.rb +6 -6
- data/code/superant.com.rwdaddresses/viewvcarddata.rb +22 -0
- data/code/superant.com.rwdtinkerbackwindow/controlclient.rb +89 -92
- data/code/superant.com.rwdtinkerbackwindow/diagnostictab.rb +15 -20
- data/code/superant.com.rwdtinkerbackwindow/installapplet.rb +19 -18
- data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +20 -19
- data/code/superant.com.rwdtinkerbackwindow/installremotegem.rb +19 -18
- data/code/superant.com.rwdtinkerbackwindow/listgemdirs.rb +7 -7
- data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +48 -49
- data/code/superant.com.rwdtinkerbackwindow/listinstalledfiles.rb +8 -7
- data/code/superant.com.rwdtinkerbackwindow/listzips.rb +22 -26
- data/code/superant.com.rwdtinkerbackwindow/loadconfigurationrecord.rb +32 -31
- data/code/superant.com.rwdtinkerbackwindow/loadconfigurationvariables.rb +14 -13
- data/code/superant.com.rwdtinkerbackwindow/network.rb +82 -82
- data/code/superant.com.rwdtinkerbackwindow/openappletname.rb +18 -17
- data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +37 -37
- data/code/superant.com.rwdtinkerbackwindow/remotegemlist.rb +20 -20
- data/code/superant.com.rwdtinkerbackwindow/removeapplet.rb +33 -32
- data/code/superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb +8 -9
- data/code/superant.com.rwdtinkerbackwindow/rwdtinkerwin2version.rb +10 -11
- data/code/superant.com.rwdtinkerbackwindow/saveconfigurationrecord.rb +19 -18
- data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +21 -20
- data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +23 -20
- data/configuration/language.dist +1 -1
- data/configuration/rwdaddresses.dist +2 -2
- data/configuration/rwdtinker.dist +2 -2
- data/configuration/tinkerwin2variables.dist +1 -1
- data/extras/vpim/date.rb +198 -0
- data/extras/vpim/dirinfo.rb +229 -0
- data/extras/vpim/enumerator.rb +29 -0
- data/extras/vpim/field.rb +497 -0
- data/extras/vpim/maker/vcard.rb +312 -0
- data/extras/vpim/rfc2425.rb +244 -0
- data/extras/vpim/rrule.rb +482 -0
- data/extras/vpim/time.rb +42 -0
- data/extras/vpim/vcard.rb +151 -0
- data/extras/vpim/vpim.rb +94 -0
- data/gui/frontwindow0/superant.com.rwdaddresses/16editrecord.rwd +5 -0
- data/gui/frontwindow0/superant.com.rwdaddresses/17viewvcardrecord.rwd +32 -0
- data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/3copyright.rwd +1 -1
- data/gui/tinkerbackwindows/superant.com.rwdaddressessyncbackwindow/70rwddiagnostics.rwd +1 -11
- data/init.rb +231 -228
- data/names/Angelina Jolie.vcf +8 -0
- data/rwd_files/HowTo_Addresses.txt +5 -0
- data/rwd_files/HowTo_Tinker.txt +14 -0
- data/rwdconfig.dist +6 -2
- data/tests/makedist.rb +36 -7
- metadata +23 -21
- data/extras/cmdline_parse +0 -47
- data/extras/config_file +0 -69
- data/extras/errorMsg +0 -19
- data/extras/makePlaylist +0 -34
- data/extras/mp3controld +0 -289
- data/extras/playlist +0 -186
- data/extras/plugins/Network +0 -237
- data/extras/showHelp +0 -18
- data/gui/frontwindowselections/superant.com.rwdaddressesselectiontab/rwdaddressessyncselectiontab.rwd +0 -12
- data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/1appname.rwd +0 -4
- data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/3copyright.rwd +0 -3
- data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/5version.rwd +0 -10
- data/installed/rwdaddressesdata2.inf +0 -8
- data/rwd_files/tinker.png +0 -0
data/Readme.txt
CHANGED
|
@@ -147,6 +147,11 @@ erik = secret
|
|
|
147
147
|
Thanks, Steven Gibson
|
|
148
148
|
|
|
149
149
|
== Changelog
|
|
150
|
+
Version 1.02
|
|
151
|
+
Export vCard
|
|
152
|
+
view raw vCard
|
|
153
|
+
updated for rwdtinker 1.61
|
|
154
|
+
|
|
150
155
|
version 1.01
|
|
151
156
|
updated for rwdtinker version 1.59
|
|
152
157
|
refactored diagnotic page - one button to see all information
|
data/code/01rwdcore/01rwdcore.rb
CHANGED
|
@@ -3,18 +3,20 @@
|
|
|
3
3
|
# http://www.erikveen.dds.nl/rubywebdialogs/index.html
|
|
4
4
|
# For more information about RwdTinker see http://www.rubyforge.net/projects/rwdapplications
|
|
5
5
|
# This class is the top class for the RwdTinker application
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
class RwdTinker < RWDialog
|
|
8
|
-
|
|
9
|
-
def main
|
|
10
|
-
@rwd_window = "main"
|
|
11
|
-
@result = "idle"
|
|
12
|
-
@display= "idle"
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
def main
|
|
10
|
+
@rwd_window = "main"
|
|
11
|
+
@result = "idle"
|
|
12
|
+
@display= "idle"
|
|
13
|
+
if TestNow
|
|
14
|
+
|
|
15
|
+
rwdtest_harness
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def inspect
|
|
20
|
+
"Rwdtinker Application "
|
|
21
|
+
end
|
|
22
|
+
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
# this code is to call the help window
|
|
2
2
|
def runhelpwindow
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
$helptopicsarray = $helptopicsarray | ["applet_installation","applet_viewing","applet_tinkerbackeditconfiguration","remote_control"]
|
|
4
|
+
|
|
5
|
+
if @rwd_window == "main"
|
|
6
|
+
if @rwd_tab == "documentsrwdtinkerone"
|
|
7
|
+
$help_topic = "documents_rwdtinker"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
if @rwd_window == "rwdtinkerhelpwindow"
|
|
13
|
+
puts "in help window processing"
|
|
14
|
+
else
|
|
15
|
+
$previouswindow = @rwd_window
|
|
16
|
+
$previoustab = @rwd_tab
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@rwdhelptopic = $help_topic
|
|
21
|
+
@rwdhelpdataoutput = "#{Helptext[:"#{$help_topic}"]}"
|
|
22
|
+
@rwdhelpsubchoicesoutput = $helptopicsarray.rwd_method("choosenewhelptopic")
|
|
23
|
+
@rwd_window = "rwdtinkerhelpwindow"
|
|
24
24
|
end
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
|
|
26
|
+
def choosenewhelptopic(inffile)
|
|
27
|
+
$help_topic = inffile
|
|
28
|
+
runhelpwindow
|
|
29
|
+
end
|
|
30
30
|
|
|
31
31
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Application RwdAddresses orginally (c) 2004 Steven Gibson under GPL.
|
|
2
2
|
#
|
|
3
|
-
# For
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
# For information see http://www.rubyforge.net/projects/rwdapplications
|
|
4
|
+
|
|
5
|
+
# call the window
|
|
6
|
+
def returntomain
|
|
7
|
+
@rwd_window = "main"
|
|
8
|
+
@rwd_tab = "selectiontab"
|
|
9
|
+
end
|
|
10
|
+
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
# Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
|
|
2
2
|
# This application is a framework for writing programs from RubyWebDialogs
|
|
3
|
-
# http://www.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
# For information see http://www.rubyforge.net/projects/rwdapplications
|
|
4
|
+
|
|
5
|
+
# return the version constant defined in the config file
|
|
6
|
+
def runrwdtinkerversion
|
|
7
|
+
@rwd_window = "applicationversion"
|
|
8
|
+
@versionappnamedisplay = "RwdTinker"
|
|
9
|
+
@versioncopyrightdisplay = "(c) 2004 Steven Gibson "
|
|
10
|
+
@versionnumberdisplay = "Version " + RwdTinkerVersion
|
|
11
|
+
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# test harness
|
|
2
|
+
def rwdtinker_all_tests
|
|
3
|
+
print "in rwdtinker all tests\n"
|
|
4
|
+
test_runrwdtinkerbackwindow
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def test_runrwdtinkerbackwindow
|
|
8
|
+
|
|
9
|
+
require 'test/unit'
|
|
10
|
+
begin
|
|
11
|
+
|
|
12
|
+
runrwdtinkerbackwindow
|
|
13
|
+
|
|
14
|
+
raise NotImplementedError, 'Need to write test_runrwdtinkerbackwindow'
|
|
15
|
+
|
|
16
|
+
rescue NotImplementedError
|
|
17
|
+
$stderr.print $!
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def test_choosenewhelptopic
|
|
25
|
+
raise NotImplementedError, 'Need to write test_choosenewhelptopic'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def test_listinstalledfiles
|
|
30
|
+
raise NotImplementedError, 'Need to write test_listinstalledfiles'
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def test_listzipfilestoinstall
|
|
35
|
+
raise NotImplementedError, 'Need to write test_listzipfilestoinstall'
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def test_loadconfigurationrecord
|
|
39
|
+
raise NotImplementedError, 'Need to write test_loadconfigurationrecord'
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def test_loadconfigurationvariables
|
|
43
|
+
raise NotImplementedError, 'Need to write test_loadconfigurationvariables'
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def test_main
|
|
49
|
+
raise NotImplementedError, 'Need to write test_main'
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def test_network_demon
|
|
53
|
+
raise NotImplementedError, 'Need to write test_network_demon'
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def test_network_start
|
|
57
|
+
raise NotImplementedError, 'Need to write test_network_start'
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def test_openappletname
|
|
61
|
+
raise NotImplementedError, 'Need to write test_openappletname'
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def test_removeapplet
|
|
65
|
+
raise NotImplementedError, 'Need to write test_removeapplet'
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def test_returntomain
|
|
69
|
+
raise NotImplementedError, 'Need to write test_returntomain'
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def test_runcontrolcommand
|
|
73
|
+
raise NotImplementedError, 'Need to write test_runcontrolcommand'
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def test_runhelpwindow
|
|
78
|
+
raise NotImplementedError, 'Need to write test_runhelpwindow'
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def test_runrwdtinkerversion
|
|
85
|
+
raise NotImplementedError, 'Need to write test_runrwdtinkerversion'
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def test_runrwdtinkerwin2version
|
|
89
|
+
raise NotImplementedError, 'Need to write test_runrwdtinkerwin2version'
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def test_runviewplatform
|
|
93
|
+
raise NotImplementedError, 'Need to write test_runviewplatform'
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def test_rwdtinkerversiondiagnostic
|
|
97
|
+
raise NotImplementedError, 'Need to write test_rwdtinkerversiondiagnostic'
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def test_rwdwindowreturn
|
|
101
|
+
raise NotImplementedError, 'Need to write test_rwdwindowreturn'
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def test_saveconfigurationrecord
|
|
105
|
+
raise NotImplementedError, 'Need to write test_saveconfigurationrecord'
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def test_viewappletcontents
|
|
110
|
+
raise NotImplementedError, 'Need to write test_viewappletcontents'
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
@@ -1,61 +1,62 @@
|
|
|
1
1
|
def uploadreturnsfile
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
returns_ftpsite = "ftp.superant.com"
|
|
10
|
-
returns_ftplogin = "anonymous@superant.com"
|
|
11
|
-
returns_ftppassword = "anonymous@superant.com"
|
|
12
|
-
returns_ftpdirectory = "/incoming/returns/"
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
ftp
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
2
|
+
require 'net/ftp'
|
|
3
|
+
BasicSocket.do_not_reverse_lookup = true
|
|
4
|
+
@returnsftpdisplays = ""
|
|
5
|
+
randomnumber = rand(9999) + 1000
|
|
6
|
+
puts randomnumber.to_i
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
returns_ftpsite = "ftp.superant.com"
|
|
10
|
+
returns_ftplogin = "anonymous@superant.com"
|
|
11
|
+
returns_ftppassword = "anonymous@superant.com"
|
|
12
|
+
returns_ftpdirectory = "/incoming/returns/"
|
|
13
|
+
|
|
14
|
+
begin
|
|
15
|
+
platformdisplay = "Platform is " + RUBY_PLATFORM + "\n"
|
|
16
|
+
platformdisplay = platformdisplay + "Ruby Version " + VERSION + "\n"
|
|
17
|
+
platformdisplay = platformdisplay + "rwdtinker version " + RwdTinkerVersion + "\n"
|
|
18
|
+
platformdisplay = platformdisplay + "application name " + $rwdapplicationidentity + "\n"
|
|
19
|
+
platformdisplay = platformdisplay + "program directory " + $progdir + "\n"
|
|
20
|
+
platformdisplay = platformdisplay + "hostname " + Resolv.getname(Resolv.getaddress("localhost")) + "\n"
|
|
21
|
+
platformdisplay = platformdisplay + "Date " + Date.today().to_s + "\n"
|
|
22
|
+
if ! @a_emailupload.empty?
|
|
23
|
+
platformdisplay = platformdisplay + @a_emailupload + "\n"
|
|
24
|
+
end
|
|
25
|
+
if ! @a_emailupload.empty?
|
|
26
|
+
platformdisplay = platformdisplay + @a_commentupload + "\n"
|
|
27
|
+
end
|
|
28
|
+
updatefile = Date.today().to_s + Resolv.getname(Resolv.getaddress("localhost")) + randomnumber.to_s
|
|
29
|
+
|
|
30
|
+
tmpdir = ENV['TMP']
|
|
31
|
+
if tmpdir.to_s.empty?
|
|
32
|
+
tmpdir = "/tmp"
|
|
33
|
+
end
|
|
34
|
+
fileName = File.join( tmpdir, updatefile)
|
|
35
|
+
fd = File.open(fileName,"w")
|
|
36
|
+
fd.print(platformdisplay) # save the record info to the file
|
|
37
|
+
fd.close
|
|
38
|
+
ftp = Net::FTP::new(returns_ftpsite)
|
|
39
|
+
@returnsftpdisplay = "data uploaded" + "\n"
|
|
40
|
+
|
|
41
|
+
filedirname = File.join(tmpdir,updatefile)
|
|
42
|
+
|
|
43
|
+
ftp.debug_mode = false
|
|
44
|
+
ftp.login(returns_ftplogin, returns_ftppassword)
|
|
45
|
+
ftp.chdir(returns_ftpdirectory)
|
|
46
|
+
print "I'm in the directory ", ftp.pwd(), "\n"
|
|
47
|
+
|
|
48
|
+
puts filedirname
|
|
49
|
+
ftp.puttextfile(filedirname , updatefile)
|
|
50
|
+
@returnsftpdisplay = @returnsftpdisplay + platformdisplay
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
ftp.close
|
|
54
|
+
|
|
55
|
+
rescue
|
|
56
|
+
@returnsftpdisplay = "upload error"
|
|
57
|
+
if ftp
|
|
58
|
+
ftp.close
|
|
59
|
+
end
|
|
60
|
+
print "ftp error"
|
|
61
|
+
end
|
|
61
62
|
end
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
# this code is to attach a photo from the tmp directory
|
|
2
|
+
def attachtmpcontactphoto
|
|
3
|
+
if @a_viewnamedata
|
|
4
|
+
$currentnametext = @a_viewnamedata
|
|
5
|
+
end
|
|
6
|
+
if $currentnametext
|
|
7
|
+
tmpcontactphotoName = $tmpphoto_directory + "/" + @a_tmpphotoname
|
|
8
|
+
begin
|
|
9
|
+
if File.exist?(tmpcontactphotoName)
|
|
10
|
+
newcontactphotoName = $tmpphoto_directory + "/" + $currentnametext + ".jpg"
|
|
11
|
+
if ! (tmpcontactphotoName == newcontactphotoName )
|
|
12
|
+
File.rename(tmpcontactphotoName, newcontactphotoName)
|
|
13
|
+
end
|
|
14
|
+
@listphotosfromtmp = "Photo attached"
|
|
15
|
+
FileUtils.cp(newcontactphotoName , $addressfiles_directory)
|
|
16
|
+
else
|
|
17
|
+
@listphotosfromtmp = "attachment failed"
|
|
18
|
+
end
|
|
19
|
+
rescue
|
|
20
|
+
@listphotosfromtmp = "attachment failed"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
24
|
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
# this method clears the on screen variables
|
|
2
|
+
def clearnamescreendisplay
|
|
3
|
+
|
|
4
|
+
@a_filename = ""
|
|
5
|
+
@a_name = ""
|
|
6
|
+
@a_address = ""
|
|
7
|
+
@a_citystatezip = ""
|
|
8
|
+
@a_phone = ""
|
|
9
|
+
@a_email = ""
|
|
10
|
+
@a_comment1 = ""
|
|
11
|
+
@a_comment2 = ""
|
|
12
|
+
@a_comment3 = ""
|
|
13
|
+
@extranamedatadisplay = ""
|
|
14
|
+
end
|
|
15
15
|
|
|
16
|
-
end
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
require 'fileutils'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
# this method adds a new address record or saves changes
|
|
2
|
+
def createnewnamerecord
|
|
3
|
+
require 'fileutils'
|
|
4
|
+
if @a_filename
|
|
5
|
+
newname = "%s" % [@a_filename] # grab the new filename to create
|
|
6
|
+
newdata =@a_name.to_s + "\n" + @a_address.to_s + "\n" + @a_citystatezip.to_s + "\n" + @a_phone.to_s + "\n" + @a_email.to_s + "\n" + @a_comment1.to_s + "\n" + @a_comment2.to_s + "\n" + @a_comment3.to_s + "\n"
|
|
7
|
+
fullnewname = newname + ".nam"
|
|
8
|
+
begin # exception trapped block
|
|
9
|
+
fileName = File.join($addressfiles_directory, fullnewname )
|
|
10
|
+
fd = File.open(fileName,"w")
|
|
11
|
+
fd.print(newdata) # save the record info to the file
|
|
12
|
+
fd.close
|
|
13
|
+
@createnewnamerecorddisplay=newdata # show the record info in the browser
|
|
14
|
+
rescue SystemCallError, StandardError
|
|
15
|
+
$stderr.print "system call error: " + $!
|
|
16
|
+
end # exception rescue
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
require 'fileutils'
|
|
5
|
-
|
|
6
|
-
if @a_viewnamedata
|
|
7
|
-
$currentnametext = @a_viewnamedata
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
fileName = $addressfiles_directory + "/" + $currentnametext + ".nam"
|
|
11
|
-
$stderr.print fileName
|
|
1
|
+
# this method deletes an address record
|
|
2
|
+
def deletecontactrecord
|
|
12
3
|
|
|
13
|
-
|
|
4
|
+
require 'fileutils'
|
|
14
5
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
if @a_viewnamedata
|
|
7
|
+
$currentnametext = @a_viewnamedata
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
fileName = $addressfiles_directory + "/" + $currentnametext + ".nam"
|
|
11
|
+
$stderr.print fileName
|
|
12
|
+
|
|
13
|
+
begin # exception trapped block
|
|
14
|
+
|
|
15
|
+
File.delete(fileName)
|
|
16
|
+
fileNamephoto = $addressfiles_directory + "/" + $currentnametext + ".jpg"
|
|
17
|
+
if File.exist?(fileNamephoto)
|
|
18
|
+
File.delete(fileNamephoto)
|
|
19
|
+
end
|
|
20
|
+
rescue SystemCallError, StandardError
|
|
21
|
+
$stderr.print "system call error: " + $!
|
|
22
|
+
end # exception rescue
|
|
23
|
+
|
|
24
|
+
end
|
|
23
25
|
|
|
24
|
-
end
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
# this code is to delete update files
|
|
2
2
|
def deleterwdaddressesupdatefiles
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
fileListarray.each do |x|
|
|
9
|
-
filetodelete = File.join($rwdaddresses_updatedirectory,x)
|
|
10
|
-
if File.exist?(filetodelete)
|
|
11
|
-
File.delete(filetodelete)
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
@rwdaddressesftpdisplay = "update files deleted"
|
|
15
|
-
rescue
|
|
16
|
-
@rwdaddressesftpdisplay = "error opening schedule update directory"
|
|
17
|
-
end # end of error function
|
|
18
|
-
end
|
|
3
|
+
# exception begin
|
|
4
|
+
begin
|
|
5
|
+
fileListarray = Dir.new($rwdaddresses_updatedirectory).entries.sort.delete_if { |x| ! (x =~ /nam$/) }
|
|
6
|
+
#loop through and get the files names
|
|
19
7
|
|
|
8
|
+
fileListarray.each do |x|
|
|
9
|
+
filetodelete = File.join($rwdaddresses_updatedirectory,x)
|
|
10
|
+
if File.exist?(filetodelete)
|
|
11
|
+
File.delete(filetodelete)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
@rwdaddressesftpdisplay = "update files deleted"
|
|
15
|
+
rescue
|
|
16
|
+
@rwdaddressesftpdisplay = "error opening schedule update directory"
|
|
17
|
+
end # end of error function
|
|
18
|
+
end
|
|
20
19
|
|