Skip to content

Commit

Permalink
Merge branch 'dotnet451' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-brooke committed Dec 19, 2018
2 parents 76ce6c4 + 62ad126 commit 9da1d05
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 5 deletions.
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
7 changes: 5 additions & 2 deletions SuiteCRMAddIn/BusinessLogic/AppointmentsSynchroniser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,12 @@ protected override void OutlookItemAdded(AppointmentItem olItem)
}
}

Log.Debug($"OutlookItemAdded, CRM id = {crmId}; Outlook ID = {olItem.EntryID}");
Log.Debug($"OutlookItemAdded: entry, CRM id = {crmId}; Outlook ID = {olItem.EntryID}");
if (olItem.IsCall())
base.OutlookItemAdded(olItem, Globals.ThisAddIn.CallsSynchroniser);
else
base.OutlookItemAdded(olItem, Globals.ThisAddIn.MeetingsSynchroniser);
Log.Debug($"OutlookItemAdded: exit, CRM id = {crmId}; Outlook ID = {olItem.EntryID}");
}
finally
{
Expand All @@ -161,12 +162,14 @@ protected override void OutlookItemChanged(AppointmentItem olItem)
try
{
var crmId = olItem.GetCrmId();
Log.Debug($"OutlookItemChanged, CRM id = {crmId}; Outlook ID = {olItem.EntryID}");
Log.Debug($"OutlookItemChanged: entry, CRM id = {crmId}; Outlook ID = {olItem.EntryID}");

if (olItem.IsCall())
base.OutlookItemChanged(olItem, Globals.ThisAddIn.CallsSynchroniser);
else
base.OutlookItemChanged(olItem, Globals.ThisAddIn.MeetingsSynchroniser);

Log.Debug($"OutlookItemChanged: exit, CRM id = {crmId}; Outlook ID = {olItem.EntryID}");
}
catch (BadStateTransition bst)
{
Expand Down
1 change: 0 additions & 1 deletion SuiteCRMAddIn/BusinessLogic/SyncDirection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,5 @@ public static bool AllowOutbound(Direction direction)
{
return (direction == Direction.Import || direction == Direction.BiDirectional);
}

}
}
7 changes: 5 additions & 2 deletions SuiteCRMAddIn/BusinessLogic/Synchroniser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ protected void Items_ItemChange(object olItem)

protected void Items_ItemRemove()
{
Log.Debug($"Outlook {folderName} ItemRemove");
Log.Debug($"Outlook {folderName} ItemRemove: entry");
try
{
RemoveDeletedItems();
Expand All @@ -641,6 +641,7 @@ protected void Items_ItemRemove()
{
ErrorHandler.Handle($"Failed to handle item(s) removed from {folderName}", problem);
}
Log.Debug($"Outlook {folderName} ItemRemove: exit");
}

/// <summary>
Expand Down Expand Up @@ -838,7 +839,9 @@ protected void RemoveDeletedItems()
var syncStatesCopy = SyncStateManager.Instance.GetSynchronisedItems<SyncStateType>();
foreach (var syncState in syncStatesCopy)
{
var shouldDeleteFromCrm = syncState.IsDeletedInOutlook || !syncState.ShouldSyncWithCrm;
var shouldDeleteFromCrm = this.IsEnabled() &&
SyncDirection.AllowOutbound(this.Direction) &&
(syncState.IsDeletedInOutlook || !syncState.ShouldSyncWithCrm);
if (shouldDeleteFromCrm) RemoveFromCrm(syncState);
if (syncState.IsDeletedInOutlook) SyncStateManager.Instance.RemoveSyncState(syncState);
}
Expand Down

0 comments on commit 9da1d05

Please sign in to comment.