var CustomActivities = CustomActivities || {};
(function(){
var PREFERENCES_ACTIVITIES = "org.alfresco.share.activities",
PREF_FILTER = ".filter",
PREF_RANGE = ".range",
PREF_ACTIVITIES = ".activities";
var Dom = YAHOO.util.Dom;
var $html = Alfresco.util.encodeHTML;
var $userProfile = Alfresco.util.userProfileLink;
CustomActivities.Activities = function CustomActivities_constructor(htmlId) {
CustomActivities.Activities.superclass.constructor.call(this, htmlId);
return this;
};
YAHOO.extend(CustomActivities.Activities, Alfresco.dashlet.Activities, {
onReady: function CustomActivities_onReady() {
var me = this;
// Create dropdown filter widgets
this.widgets.range = Alfresco.util.createYUIButton(this, "range", this.onDateFilterChanged,
{
type: "menu",
menu: "range-menu",
lazyloadmenu: false
});
this.widgets.user = Alfresco.util.createYUIButton(this, "user", this.onExclusionFilterChanged,
{
type: "menu",
menu: "user-menu",
lazyloadmenu: false
});
this.widgets.activities = Alfresco.util.createYUIButton(this, "activities", this.onActivitiesFilterChanged,
{
type: "menu",
menu: "activities-menu",
lazyloadmenu: false
});
// The activity list container
this.activityList = Dom.get(this.id + "-activityList");
// Load preferences to override default filter and range
this.widgets.range.set("label", this.msg("filter.7days"));
this.widgets.range.value = "7";
// Sirve para que el botón por defecto sea "Mis Actividades"
// this.widgets.user.set("label", this.msg("filter.all"));
this.widgets.user.set("label", this.msg("filter.mine"));
this.widgets.user.value = "mine";
this.widgets.activities.set("label", this.msg("filter.allItems") + " " + Alfresco.constants.MENU_ARROW_SYMBOL);
this.widgets.activities.value = "";
var prefs = this.services.preferences.get();
var activitiesPreference = Alfresco.util.findValueByDotNotation(prefs, this.buildPreferences(PREF_ACTIVITIES), "");
if (activitiesPreference !== null)
{
this.widgets.activities.value = activitiesPreference;
// set the correct menu label
var menuItems = this.widgets.activities.getMenu().getItems();
for (index in menuItems)
{
if (menuItems.hasOwnProperty(index))
{
if (menuItems[index].value === activitiesPreference)
{
this.widgets.activities.set("label", menuItems[index].cfg.getProperty("text") + " " + Alfresco.constants.MENU_ARROW_SYMBOL);
break;
}
}
}
}
var rangePreference = Alfresco.util.findValueByDotNotation(prefs, this.buildPreferences(PREF_RANGE), "7");
if (rangePreference !== null)
{
this.widgets.range.value = rangePreference;
// set the correct menu label
var menuItems = this.widgets.range.getMenu().getItems();
for (index in menuItems)
{
if (menuItems.hasOwnProperty(index))
{
if (menuItems[index].value === rangePreference)
{
this.widgets.range.set("label", menuItems[index].cfg.getProperty("text") + " " + Alfresco.constants.MENU_ARROW_SYMBOL);
break;
}
}
}
}
// var filterPreference = Alfresco.util.findValueByDotNotation(prefs, this.buildPreferences(PREF_FILTER), "all");
// if (filterPreference !== null)
// {
// this.widgets.user.value = filterPreference;
// // set the correct menu label
// var menuItems = this.widgets.user.getMenu().getItems();
// for (index in menuItems)
// {
// if (menuItems.hasOwnProperty(index))
// {
// if (menuItems[index].value === filterPreference)
// {
// this.widgets.user.set("label", menuItems[index].cfg.getProperty("text") + " " + Alfresco.constants.MENU_ARROW_SYMBOL);
// break;
// }
// }
// }
// }
// Display the toolbar now that we have selected the filter
Dom.removeClass(Selector.query(".toolbar div", this.id, true), "hidden");
// Populate the activity list
this.populateActivityList(this.widgets.range.value, this.widgets.user.value, this.widgets.activities.value);
}
});
})();
model.widgets[0].name = "CustomActivities.Activities";
<@markup id="mis-actividades-por-defecto-js" action="after" target="js" scope="global">
<@script type="text/javascript" src="${url.context}/res/customizations/components/dashlets/custom-activities.js" group="dashlets"/>
</@markup>
<@markup id="mis-actividades-por-defecto-html" action="replace" target="html" scope="global">
<@uniqueIdDiv>
<#assign id = args.htmlid>
<div class="dashlet activities">
<div class="title">${msg("header")}</div>
<div class="toolbar flat-button">
<div class="hidden">
<span class="align-left yui-button yui-menu-button" id="${id}-user">
<span class="first-child">
<button type="button" tabindex="0"></button>
</span>
</span>
<select id="${id}-user-menu">
<#–
<#list filterTypes as filter>
<option value="${filter.type?html}">${msg("filter." + filter.label)}</option>
</#list>
–>
</select>
<span class="align-left yui-button yui-menu-button" id="${id}-activities">
<span class="first-child">
<button type="button" tabindex="0"></button>
</span>
</span>
<select id="${id}-activities-menu">
<#list filterActivities as filter>
<option value="${filter.type?html}">${msg("filter." + filter.label)}</option>
</#list>
</select>
<span class="align-left yui-button yui-menu-button" id="${id}-range">
<span class="first-child">
<button type="button" tabindex="0"></button>
</span>
</span>
<select id="${id}-range-menu">
<#list filterRanges as filter>
<option value="${filter.type?html}">${msg("filter." + filter.label)}</option>
</#list>
</select>
<div class="clear"></div>
</div>
</div>
<div id="${id}-activityList" class="body scrollableList" <#if args.height??>style="height: ${args.height?html}px;"</#if>></div>
</div>
<#– Empty results list template –>
<div id="${id}-empty" style="display: none">
<div class="empty"><h3>${msg("empty.title")}</h3><span>${msg("empty.description")}</span></div>
</div>
</@>
</@markup>
/amp-share/src/main/amp/config/alfresco/web-extension/site-webscripts/org/alfresco/components/dashlets/my-activities.get.config.xml
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.