+void ContactDataObject::SaveTelephone(map<int, wxString> *TelephoneList, map<int, wxString> *TelephoneListAltID,
+ map<int, wxString> *TelephoneListPID, map<int, wxString> *TelephoneListType,
+ map<int, wxString> *TelephoneListTypeInfo, map<int, wxString> *TelephoneListDataType,
+ map<int, int> *TelephoneListPref, map<int, wxString> *TelephoneListTokens,
+ wxString *SaveData, wxString DataType){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, wxString>::iterator TelephoneIter = TelephoneList->begin();
+ TelephoneIter != TelephoneList->end(); TelephoneIter++){
+
+ ProcessData.Append("TEL");
+
+ // Check if there is a value for TYPE.
+
+ if (DataType.size() > 0 || (*TelephoneListAltID)[TelephoneIter->first].size() > 0){
+
+ ProcessData.Append(";TYPE=\"");
+
+ bool ProcessedType = false;
+
+ if (DataType.size() > 0){
+
+ ProcessData.Append(DataType);
+ ProcessedType = true;
+
+ }
+
+ if ((*TelephoneListAltID)[TelephoneIter->first].size() > 0){
+
+ if (ProcessedType == true){
+ ProcessData.Append(",");
+ }
+ ProcessData.Append((*TelephoneListTypeInfo)[TelephoneIter->first]);
+
+ }
+
+ ProcessData.Append("\"");
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*TelephoneListAltID)[TelephoneIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*TelephoneListAltID)[TelephoneIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*TelephoneListPID)[TelephoneIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*TelephoneListPID)[TelephoneIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*TelephoneListPref)[TelephoneIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*TelephoneListPref)[TelephoneIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*TelephoneListTokens)[TelephoneIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*TelephoneListTokens)[TelephoneIter->first]);
+
+ }
+
+ ProcessData.Append(":");
+ ProcessData.Append((*TelephoneListDataType)[TelephoneIter->first]);
+ ProcessData.Append(":");
+ ProcessData.Append(TelephoneIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+