public void InitView(Int32 idModule, Int32 idCommunity, long idModuleItem, Int32 idItemType, String fullyQualifiedName, Boolean allowAdd, Boolean allowEdit, LoadItemsBy loadModuleSkinBy)
        {
            lm.Comol.Core.DomainModel.ModuleObject item = new lm.Comol.Core.DomainModel.ModuleObject();
            item.CommunityID  = idCommunity;
            item.ObjectLongID = idModuleItem;
            item.ObjectTypeID = idItemType;
            item.ServiceID    = idModule;
            item.FQN          = fullyQualifiedName;
            item.ServiceCode  = Service.GetModuleCode(idModule);
            View.Source       = item;

            View.AllowAdd           = allowAdd;
            View.AllowEdit          = allowEdit;
            View.AllowEditSelection = false;

            DtoDisplaySkin currentSkin = Service.GetDefaultSkinForModule(idModule, idCommunity, idModuleItem, idItemType);

            if (UserContext.isAnonymous)
            {
                LoadCurrentSkin(currentSkin);
                View.DisplaySessionTimeout();
            }
            else
            {
                LoadSkins(idModule, idCommunity, idModuleItem, idItemType, currentSkin, loadModuleSkinBy);
            }
            View.isInitialized = true;
        }
Пример #2
0
 public void InitView(Int32 idModule, Int32 idCommunity, long idItem, Int32 idItemType, SkinType type)
 {
     View.isInitialized = true;
     View.SkinType      = type;
     View.IdSkin        = (long)0;
     if (UserContext.isAnonymous)
     {
         View.DisplaySessionTimeout();
     }
     else
     {
         lm.Comol.Core.DomainModel.ModuleObject item = new lm.Comol.Core.DomainModel.ModuleObject();
         item.CommunityID  = idCommunity;
         item.ObjectLongID = idItem;
         item.ObjectTypeID = idItemType;
         item.ServiceID    = idModule;
         item.ServiceCode  = Service.GetModuleCode(idModule);
         if (View.HasPermissionForItem(item))
         {
             View.DisplayForm(item, true);
         }
         else
         {
             View.AllowAdd = false;
             View.Source   = item;
             View.DisplayNoPermission();
         }
         View.BackUrl = View.PreloadedBackUrl;
     }
 }
 public Boolean HasSkinAssociation(Int32 idModule, Int32 idCommunity, long idModuleItem, Int32 idItemType, String fullyQualifiedName)
 {
     lm.Comol.Core.DomainModel.ModuleObject source = new lm.Comol.Core.DomainModel.ModuleObject()
     {
         FQN = fullyQualifiedName, ObjectTypeID = idItemType, ObjectLongID = idModuleItem, ServiceID = idModule
     };
     return(Service.ObjectHasSkinAssociation(idCommunity, source));
 }
        public Boolean DeleteSKin(DtoDisplaySkin skin, lm.Comol.Core.DomainModel.ModuleObject source, String basePath)
        {
            Boolean result = Service.DeleteModuleSkin(skin.Id, true, basePath);

            if (result)
            {
                LoadSkins(source.ServiceID, source.CommunityID, source.ObjectLongID, source.ObjectTypeID, Service.GetDefaultSkinForModule(source.ServiceID, source.CommunityID, source.ObjectLongID, source.ObjectTypeID), View.LoadModuleSkinBy);
            }
            return(result);
        }
 public Boolean SaveSkinAssociation(DtoDisplaySkin skin, lm.Comol.Core.DomainModel.ModuleObject source)
 {
     if (UserContext.isAnonymous)
     {
         return(false);
     }
     else
     {
         return(Service.SaveSkinAssociation(skin, source.CommunityID, source));
     }
 }
Пример #6
0
 public void InitView(long idSkin, Int32 idModule, Int32 idCommunity, long idItem, Int32 idItemType)
 {
     View.isInitialized = true;
     View.IdSkin        = idSkin;
     if (UserContext.isAnonymous)
     {
         View.DisplaySessionTimeout();
     }
     else
     {
         lm.Comol.Core.DomainModel.ModuleObject item = new lm.Comol.Core.DomainModel.ModuleObject();
         item.CommunityID  = idCommunity;
         item.ObjectLongID = idItem;
         item.ObjectTypeID = idItemType;
         item.ServiceID    = idModule;
         item.ServiceCode  = Service.GetModuleCode(idModule);
         View.Source       = item;
         Domain.Skin skin = Service.GetItem <Domain.Skin>(idSkin);
         if (skin == null)
         {
             View.DisplayUnknownItem();
         }
         else
         {
             SkinType type = (skin.IsPortal) ? SkinType.Portal : (skin.IsModule) ? SkinType.Module : (skin.Communities.Count > 0) ? SkinType.Community : (skin.Organizations.Count > 0) ? SkinType.Organization : SkinType.NotAssigned;
             View.SkinType  = type;
             View.AllowEdit = (type == SkinType.Module && View.HasPermissionForItem(item)) || (type != SkinType.Module && View.FullSkinManagement);
             if ((type == SkinType.Module && View.HasPermissionForItem(item)) || (type != SkinType.Module && View.FullSkinManagement))
             {
                 View.LoadAvailableViews(Service.GetAvailableViews(type));
                 View.LoadSkinInfo(skin.Id, skin.Name, true, skin.OverrideVoidFooterLogos);
             }
             else
             {
                 View.DisplayNoPermission();
             }
         }
         View.BackUrl = View.PreloadedBackUrl;
     }
 }
Пример #7
0
        public void InitView(ModuleGenericTemplateMessages permissions, lm.Comol.Core.Notification.Domain.NotificationChannel channel, long idAction, Int32 idModule, String moduleCode, Int32 idCommunty, Int32 idOrganization = 0, Boolean forPortal = false, long idTemplate = 0, long idVersion = 0, lm.Comol.Core.DomainModel.ModuleObject obj = null, List <dtoTemplateItem> items = null)
        {
            dtoSelectorContext c = new dtoSelectorContext();

            c.IdAction       = idAction;
            c.IdModule       = (idModule > 0) ? idModule : (!String.IsNullOrEmpty(moduleCode) ? CurrentManager.GetModuleID(moduleCode) : 0);
            c.ModuleCode     = (!String.IsNullOrEmpty(moduleCode)) ? moduleCode : (idModule > 0 ? CurrentManager.GetModuleCode(idModule) : "");
            c.IdCommunity    = idCommunty;
            c.IdOrganization = idOrganization;
            if (idCommunty > 0 && idOrganization <= 0)
            {
                Community community = CurrentManager.GetCommunity(idCommunty);
                c.IdOrganizationCommunity = (community == null) ? 0 : ((community.IdFather == 0) ? community.Id : CurrentManager.GetIdCommunityFromOrganization(community.IdOrganization));
            }
            else if (idOrganization > 0)
            {
                c.IdOrganizationCommunity = CurrentManager.GetIdCommunityFromOrganization(idOrganization);
            }
            c.IsForPortal = (forPortal && idCommunty == 0 && idOrganization == 0);
            c.ObjectOwner = obj;
            InitView(permissions, channel, c, idTemplate, idVersion, true, items);
        }
Пример #8
0
 public void InitView(Boolean allowSelectTemplate, Int32 idCommunity, String currentCode = "", lm.Comol.Core.DomainModel.ModuleObject obj = null, long idTemplate = 0, long idVersion = 0, long idAction = 0)
 {
     if (UserContext.isAnonymous)
     {
         View.CurrentMode = Domain.EditMessageMode.None;
     }
     else
     {
         View.ModuleCode             = currentCode;
         View.CurrentObject          = obj;
         View.ContainerIdCommunity   = idCommunity;
         View.AllowTemplateSelection = allowSelectTemplate;
         View.MantainRecipients      = false;
         InitializeEditor(currentCode, idTemplate, idVersion, idAction);
     }
 }
Пример #9
0
        public Boolean SaveAsTemplate(OwnerType t, String prefixName, List <dtoTemplateTranslation> translations, List <String> contentModules, lm.Comol.Core.MailCommons.Domain.Messages.MessageSettings settings, lm.Comol.Core.DomainModel.ModuleObject obj = null)
        {
            Boolean saved = false;

            if (UserContext.isAnonymous)
            {
                View.CurrentMode = Domain.EditMessageMode.None;
            }
            else
            {
                TemplateType         type      = TemplateType.None;
                dtoBaseTemplateOwner ownership = new dtoBaseTemplateOwner()
                {
                    IdPerson = UserContext.CurrentUserID, ModuleCode = View.ModuleCode
                };
                switch (t)
                {
                case OwnerType.Object:
                    ownership.Type              = OwnerType.Object;
                    ownership.IdObject          = obj.ObjectLongID;
                    ownership.IdObjectCommunity = obj.CommunityID;
                    ownership.IdObjectModule    = obj.ServiceID;
                    ownership.IdObjectType      = obj.ObjectTypeID;
                    ownership.IsPortal          = false;
                    break;

                case OwnerType.Person:
                    ownership.IsPortal = true;
                    ownership.Type     = OwnerType.Person;
                    break;

                case OwnerType.Module:
                    ownership.IsPortal    = false;
                    ownership.IdCommunity = View.ContainerIdCommunity;
                    ownership.IdModule    = CurrentManager.GetModuleID(View.ModuleCode);
                    ownership.ModuleCode  = View.ModuleCode;
                    ownership.Type        = OwnerType.Module;
                    break;

                default:
                    ownership = null;
                    break;
                }
                if (ownership != null)
                {
                    TemplateDefinition template = Service.AddTemplate(prefixName, type, ownership, contentModules, translations, settings);
                    if (template == null)
                    {
                        View.DisplayTemplateUnSaved(t);
                    }
                    else
                    {
                        View.DisplayTemplateSaved(t);
                    }
                }
                else
                {
                    View.DisplayTemplateUnSaved(t);
                }
            }
            return(saved);
        }
        private void LoadItems(dtoTemplateItem current, long idAction, Int32 idCommunity, long idTemplate, long idVersion, Int32 idModule = 0, String moduleCode = "", lm.Comol.Core.DomainModel.ModuleObject source = null)
        {
            List <dtoTemplateItem> items = Service.GetAvailableTemplates(idAction, idCommunity, idModule, moduleCode, source, lm.Comol.Core.Notification.Domain.NotificationChannel.Mail, idTemplate, idVersion);

            if (items.Count == 0)
            {
                View.LoadEmptyTemplate();
                View.AllowPreview = false;
                View.AllowSelect  = false;
            }
            else
            {
                View.LoadTemplates(items);
            }
        }
        public void InitView(long idAction, Int32 idCommunity, long idTemplate, long idVersion, Int32 idModule = 0, String moduleCode = "", lm.Comol.Core.DomainModel.ModuleObject source = null)
        {
            View.isInitialized = true;
            //View.Source = source;
            //View.CurrentIdModule = idModule;
            //View.CurrentModuleCode = moduleCode;
            //View.CurrentIdAction = idAction;

            dtoTemplateItem current = Service.GetDefaultTemplate(idAction, idCommunity, idModule, moduleCode, source, idTemplate, idVersion);

            if (UserContext.isAnonymous)
            {
                LoadCurrentTemplate(current);
                View.AllowPreview = false;
                View.AllowSelect  = false;
            }
            else
            {
                LoadItems(current, idAction, idCommunity, idTemplate, idVersion, idModule, moduleCode, source);
            }
        }