Ejemplo n.º 1
0
        private void SendNotification(ModuleTicket.NotificationActionCategoryUserReceiver receiver)
        {
            Domain.SettingsPortal settingsPortal = service.PortalSettingsGet();
            if (!(settingsPortal.IsNotificationUserActive && settingsPortal.IsNotificationManActive))
            {
                View.ShowSendInfo(false);
                return;
            }

            NotificationAction action = new NotificationAction();

            action.IdModuleUsers = new List <long>();
            action.IdModuleUsers.Add((long)receiver);

            action.ModuleCode   = ModuleTicket.UniqueCode;
            action.IdCommunity  = CurrentCommunityId;
            action.IdObjectType = (long)ModuleTicket.ObjectType.Category;
            action.IdObject     = -1;

            action.IdModuleAction = (long)ModuleTicket.NotificationActionType.CategoriesNotification;

            View.SendNotification(action, UserContext.CurrentUserID);

            View.ShowSendInfo(true);
        }
Ejemplo n.º 2
0
        private void SendNotification(long userId)
        {
            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout(this.CurrentCommunityId);
                return;
            }

            Domain.SettingsPortal settingsPortal = service.PortalSettingsGet();
            if (!(settingsPortal.IsNotificationUserActive && settingsPortal.IsNotificationManActive))
            {
                View.ShowSendResponse(false);
                return;
            }

            NotificationAction action = new NotificationAction();

            action.IdModuleUsers = new List <long>();
            action.IdModuleUsers.Add(userId);

            action.ModuleCode   = ModuleTicket.UniqueCode;
            action.IdCommunity  = CurrentCommunityId;
            action.IdObjectType = (long)ModuleTicket.ObjectType.Category;
            action.IdObject     = View.CurrentCategoryId;

            action.IdModuleAction = (long)ModuleTicket.NotificationActionType.CategoriesNotification;

            View.SendNotification(action, UserContext.CurrentUserID);

            //this.InitView();

            View.ShowSendResponse(true);
        }
Ejemplo n.º 3
0
 public DTO_PortalSettingsSwitch(Domain.SettingsPortal settings)
 {
     IsActive                 = settings.IsActive;
     CanCreateCategory        = settings.CanCreateCategory;
     CanShowTicket            = settings.CanShowTicket;
     CanEditTicket            = settings.CanEditTicket;
     CanBehalf                = settings.CanBehalf;
     IsNotificationUserActive = settings.IsNotificationUserActive;
     IsNotificationManActive  = settings.IsNotificationManActive;
 }
Ejemplo n.º 4
0
        public void SetnotificationSettings(Domain.Enums.MailSettings creatorSettings)
        {
            Domain.SettingsPortal settingsPortal = service.PortalSettingsGet();
            if (!(settingsPortal.IsNotificationUserActive && settingsPortal.IsNotificationManActive))
            {
                return;
            }

            service.NotificationSetTicketCreatorExternal(View.TicketId, creatorSettings, View.CurrentUser.UserId);

            this.InitView();
        }
Ejemplo n.º 5
0
        public void SetSwitch(Domain.Enums.GlobalAdminSwitch Switch, bool status)
        {
            if (!CheckSession())
            {
                return;
            }

            bool success = service.SettingsSwitchSet(Switch, status);

            //this.InitView(GlobalAdminStatus.none);

            Domain.SettingsPortal settings = service.SettingsGlobalGet(false, View.CurrentCategorySelection);

            View.SetCategories(settings);

            View.ShowSwitchChanged(new DTO_PortalSettingsSwitch(settings), Switch, status, success);
        }
Ejemplo n.º 6
0
        public void SaveSettings(
            bool enableUser,
            bool enableManager,
            Domain.Enums.MailSettings userSettings,
            Domain.Enums.MailSettings managerSettings)
        {
            if (!CheckSession())
            {
                return;
            }



            GlobalAdminStatus SaveStatus = GlobalAdminStatus.SaveOK;

            //if (!service.PersonCurrentIsSysAdmin())
            //{
            //    View.SendUserActions(service.ModuleID, ModuleTicket.ActionType.NoPermission, 0, ModuleTicket.InteractionType.None);

            //    View.ShowNoPermission();
            //    return;
            //}

            //Begin Action
            View.SendUserActions(service.ModuleID, ModuleTicket.ActionType.SettingsGlobalModify, 0, ModuleTicket.InteractionType.UserWithLearningObject);
            //End Action

            Domain.SettingsPortal settings = View.Settings;


            bool successMailSet = service.MailSendSetConfig(enableUser, enableManager, userSettings, managerSettings);

            Domain.DTO.DTO_Access Access = new Domain.DTO.DTO_Access();
            Access.CanManageCategory = settings.CanCreateCategory;
            Access.CanShowTicket     = settings.CanShowTicket;
            Access.CanEditTicket     = settings.CanEditTicket;

            //TO DO: Rinominare View.Permission in View.BehalfPermission?
            // O comunque rivedere quando sarà ora...

            bool successSet = service.SettingsGlobalSet(
                settings.HasExternalLimitation,
                settings.ExternalLimitation,
                settings.HasInternalLimitation,
                settings.InternalLimitation,
                settings.HasDraftLimitation,
                settings.DraftLimitation,
                settings.CommunityTypeSettings,
                0,
                Access,
                View.Permissions);//0 ==> View.Settings.MailSettings,

            bool hasDraftLimitationError    = (settings.DraftLimitation <= 0);
            bool hasInternalLimitationError = (settings.InternalLimitation < 0);
            bool hasExternalLimitationError = (settings.ExternalLimitation < 0);

            if (!(successSet && successMailSet))
            {
                SaveStatus = GlobalAdminStatus.InternalError;
            }

            InitView(SaveStatus, hasDraftLimitationError, hasInternalLimitationError, hasExternalLimitationError);
        }