diff --git a/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs b/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs
index 69190627..1d646158 100644
--- a/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs
+++ b/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs
@@ -67,6 +67,8 @@ namespace ENI2.DetailViewControls
this.RegisterTextboxChange(this.textBox_AgentPostalCode, Message.NotificationClass.AGNT);
this.RegisterTextboxChange(this.textBox_AgentStreetAndNumber, Message.NotificationClass.AGNT);
this.RegisterTextboxChange(this.textBox_AgentCountry, Message.NotificationClass.AGNT);
+
+ this.buttonSaveTemplate.IsEnabled = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsEditor;
}
public override void Initialize()
@@ -308,21 +310,21 @@ namespace ENI2.DetailViewControls
{
if (MessageBox.Show("A template with this name already exists, overwrite?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.No)
return;
- }
-
+ }
+
this._currentTemplate = createFromCurrentText(title, existingTemplate);
- DBManager.Instance.Save(this._currentTemplate);
-
+ DBManager.Instance.Save(this._currentTemplate);
+
if(existingTemplate == null)
{
comboBox_AgentTemplate.ItemsSource = null;
_agntTemplates.Add(this._currentTemplate);
_agntTemplates.Sort();
comboBox_AgentTemplate.ItemsSource = _agntTemplates;
- }
+ }
MessageBox.Show("Template saved", "OK", MessageBoxButton.OK, MessageBoxImage.Information);
- }
+ }
private void buttonUndoTemplate_Click(object sender, RoutedEventArgs e)
{
@@ -349,7 +351,7 @@ namespace ENI2.DetailViewControls
this.textBox_AgentStreetAndNumber.GetBindingExpression(TextBox.TextProperty).UpdateSource();
this.buttonUndoTemplate.IsEnabled = false; // can't undo after undo
- }
+ }
private void buttonSetTemplate_Click(object sender, RoutedEventArgs e)
{
diff --git a/ENI2/EditControls/EditReportingPartyDialog.xaml b/ENI2/EditControls/EditReportingPartyDialog.xaml
index 8944d277..2867e0b2 100644
--- a/ENI2/EditControls/EditReportingPartyDialog.xaml
+++ b/ENI2/EditControls/EditReportingPartyDialog.xaml
@@ -48,6 +48,7 @@
+
@@ -64,6 +65,7 @@
+
diff --git a/ENI2/EditControls/EditReportingPartyDialog.xaml.cs b/ENI2/EditControls/EditReportingPartyDialog.xaml.cs
index 9961be04..d792f080 100644
--- a/ENI2/EditControls/EditReportingPartyDialog.xaml.cs
+++ b/ENI2/EditControls/EditReportingPartyDialog.xaml.cs
@@ -39,6 +39,7 @@ namespace ENI2.EditControls
this.checkBoxAdministrator.IsChecked = this.ReportingParty.IsAdmin;
this.checkBoxArchived.IsChecked = this.ReportingParty.IsArchived;
+ this.checkBoxEditor.IsChecked = this.ReportingParty.IsEditor;
this.dateTimePickerChanged.Content = this.ReportingParty.Changed.HasValue ? this.ReportingParty.Changed.ToString() : "";
this.dateTimePickerCreated.Content = this.ReportingParty.Created.HasValue ? this.ReportingParty.Created.ToString() : "";
@@ -67,8 +68,9 @@ namespace ENI2.EditControls
this.ReportingParty.SetPassword(this.passwordBoxPassword.Password);
}
- this.ReportingParty.IsAdmin = this.checkBoxAdministrator.IsChecked ?? false;
+ this.ReportingParty.IsAdmin = this.checkBoxAdministrator.IsChecked ?? false;
this.ReportingParty.IsArchived = this.checkBoxArchived.IsChecked ?? false;
+ this.ReportingParty.IsEditor = this.checkBoxEditor.IsChecked ?? false;
// save value
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(this.ReportingParty);
diff --git a/ENI2/Properties/Resources.Designer.cs b/ENI2/Properties/Resources.Designer.cs
index 344ccf71..1c3226a2 100644
--- a/ENI2/Properties/Resources.Designer.cs
+++ b/ENI2/Properties/Resources.Designer.cs
@@ -2040,6 +2040,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Editor.
+ ///
+ public static string textEditor {
+ get {
+ return ResourceManager.GetString("textEditor", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Edit rules.
///
diff --git a/ENI2/Properties/Resources.resx b/ENI2/Properties/Resources.resx
index 20e2be23..6acc6201 100644
--- a/ENI2/Properties/Resources.resx
+++ b/ENI2/Properties/Resources.resx
@@ -1852,4 +1852,7 @@
New dangerous goods item
+
+ Editor
+
\ No newline at end of file
diff --git a/bsmd.database/ReportingParty.cs b/bsmd.database/ReportingParty.cs
index c2d6bf5b..d4e63e50 100644
--- a/bsmd.database/ReportingParty.cs
+++ b/bsmd.database/ReportingParty.cs
@@ -42,7 +42,11 @@ namespace bsmd.database
///
/// System-User (Testing, Tool)
///
- SYSTEM = 4
+ SYSTEM = 4,
+ ///
+ /// kann bestimmte Dinge (e.g. templates) im ENI bearbeiten
+ ///
+ EDITOR = 8
};
#endregion
@@ -156,6 +160,12 @@ namespace bsmd.database
set { this.SetUserFlag(value, UserFlags.ADMIN); }
}
+ public bool IsEditor
+ {
+ get { return (this.Flags & (int)UserFlags.EDITOR) != 0; }
+ set { this.SetUserFlag(value, UserFlags.EDITOR); }
+ }
+
#endregion
#endregion