From 8224456a4d53d27664f5c30cd96fe4a5b907cb02 Mon Sep 17 00:00:00 2001 From: Brian Jones Date: Thu, 2 Jul 2015 17:36:16 -0400 Subject: [PATCH 01/12] SAK-29637: add ability to User Membership to bulk change status --- .../umem/tool/bundle/Messages.properties | 12 +- .../umem/tool/ui/SiteListBean.java | 150 +++++++++++++++--- .../usermembership/css/usermembership.css | 69 +++++++- .../usermembership/js/usermembership.js | 56 +++++++ .../src/webapp/usermembership/sitelist.jsp | 72 +++++++-- 5 files changed, 322 insertions(+), 37 deletions(-) create mode 100644 usermembership/tool/src/webapp/usermembership/js/usermembership.js diff --git a/usermembership/tool/src/bundle/org/sakaiproject/umem/tool/bundle/Messages.properties b/usermembership/tool/src/bundle/org/sakaiproject/umem/tool/bundle/Messages.properties index a13558af50e7..389b4e29b960 100644 --- a/usermembership/tool/src/bundle/org/sakaiproject/umem/tool/bundle/Messages.properties +++ b/usermembership/tool/src/bundle/org/sakaiproject/umem/tool/bundle/Messages.properties @@ -9,7 +9,7 @@ bar_input_search_title=Enter User Name, ID or Email Address to Search For. bar_search=Search bar_clear_search=Clear search instructions_userlist=Select a user from the search results to get site and group membership. -instructions_sitelist=Site and group membership for selected user. +instructions_sitelist=Site and group membership for the selected user. unauthorized=You are not authorized to use this tool. This incident will be reported. processing=Processing user memberships... no_enrollments=No users to display @@ -53,3 +53,13 @@ user_type_none=(no type) user_auth_all=All user_auth_internal=Internal user_auth_external=External + +## SAK-29637 +set_to_inactive_button=Set Selected to Inactive +set_to_active_button=Set Selected to Active +invert_selection=Invert Selection +select_all=Select All +deselect_all=Deselect All +export_selected_to_csv=Export Selected to CSV +export_selected_to_excel=Export Selected to Excel +actions_header=Actions diff --git a/usermembership/tool/src/java/org/sakaiproject/umem/tool/ui/SiteListBean.java b/usermembership/tool/src/java/org/sakaiproject/umem/tool/ui/SiteListBean.java index 08002582ef2d..93e620c26872 100644 --- a/usermembership/tool/src/java/org/sakaiproject/umem/tool/ui/SiteListBean.java +++ b/usermembership/tool/src/java/org/sakaiproject/umem/tool/ui/SiteListBean.java @@ -42,9 +42,14 @@ import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; +import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.sakaiproject.authz.api.AuthzGroup; +import org.sakaiproject.authz.api.AuthzGroupService; +import org.sakaiproject.authz.api.AuthzPermissionException; +import org.sakaiproject.authz.api.GroupNotDefinedException; import org.sakaiproject.authz.api.Role; import org.sakaiproject.component.api.ServerConfigurationService; import org.sakaiproject.component.cover.ComponentManager; @@ -59,8 +64,8 @@ import org.sakaiproject.tool.api.SessionManager; import org.sakaiproject.tool.api.ToolManager; import org.sakaiproject.umem.api.Authz; +import org.sakaiproject.user.api.UserDirectoryService; import org.sakaiproject.user.api.UserNotDefinedException; -import org.sakaiproject.user.cover.UserDirectoryService; import org.sakaiproject.util.ResourceLoader; @@ -82,7 +87,7 @@ public class SiteListBean { /** Resource bundle */ private transient ResourceLoader msgs = new ResourceLoader("org.sakaiproject.umem.tool.bundle.Messages"); /** Controller fields */ - private List userSitesRows; + private List userSitesRows; /** Getter vars */ private boolean refreshQuery = false; private boolean allowed = false; @@ -98,6 +103,8 @@ public class SiteListBean { private SiteService M_site = (SiteService) ComponentManager.get(SiteService.class.getName()); private ToolManager M_tm = (ToolManager) ComponentManager.get(ToolManager.class.getName()); private Authz authz = (Authz) ComponentManager.get(Authz.class.getName()); + private AuthzGroupService authzGroupService = (AuthzGroupService) ComponentManager.get( AuthzGroupService.class.getName() ); + private UserDirectoryService userDirectoryService= (UserDirectoryService) ComponentManager.get( UserDirectoryService.class.getName() ); private ServerConfigurationService M_scf = (ServerConfigurationService) ComponentManager.get(ServerConfigurationService.class.getName()); /** Private vars */ private RuleBasedCollator collator; @@ -105,6 +112,12 @@ public class SiteListBean { private String portalURL = M_scf.getPortalUrl(); private String message = ""; + private final static String frameID = "Main" + org.sakaiproject.tool.cover.ToolManager.getCurrentPlacement().getId().replaceAll( "[-!~]", "x" ); + public static String getFrameID() + { + return frameID; + } + // ###################################################################################### // UserSitesRow CLASS // ###################################################################################### @@ -121,6 +134,7 @@ public class UserSitesRow implements Serializable { private String pubView; private String userStatus; private String siteTerm; + private boolean selected; { try{ @@ -130,6 +144,7 @@ public class UserSitesRow implements Serializable { } } public UserSitesRow() { + this.selected = false; } public UserSitesRow(String siteId, String siteTitle, String siteType, String groups, String roleName, String pubView, String userStatus, String term) { @@ -141,6 +156,7 @@ public UserSitesRow(String siteId, String siteTitle, String siteType, String gro this.pubView = pubView; this.userStatus = userStatus; this.siteTerm = term; + this.selected = false; } public UserSitesRow(Site site, String groups, String roleName) { @@ -152,6 +168,7 @@ public UserSitesRow(Site site, String groups, String roleName) { this.pubView = site.isPublished() ? msgs.getString("status_published") : msgs.getString("status_unpublished"); this.userStatus = site.getMember(userId).isActive() ? msgs.getString("site_user_status_active") : msgs.getString("site_user_status_inactive"); this.siteTerm = site.getProperties().getProperty(PROP_SITE_TERM); + this.selected = false; } public String getSiteId() { @@ -193,7 +210,14 @@ public String getUserStatus(){ public String getSiteTerm() { return siteTerm; } - + + public boolean isSelected() { + return selected; + } + + public void setSelected( boolean selected ) { + this.selected = selected; + } } public static final Comparator getUserSitesRowComparator(final String fieldName, final boolean sortAscending, final Collator collator) { @@ -283,7 +307,7 @@ public String getInitValues() { * @throws SQLException */ private void doSearch() throws SQLException { - userSitesRows = new ArrayList(); + userSitesRows = new ArrayList<>(); Connection c = null; PreparedStatement pst = null; ResultSet rs = null; @@ -346,7 +370,7 @@ private void doSearch() throws SQLException { */ private void doSearch2() throws SQLException { long start = (new Date()).getTime(); - userSitesRows = new ArrayList(); + userSitesRows = new ArrayList<>(); thisUserId = M_session.getCurrentSessionUserId(); setSakaiSessionUser(userId); LOG.debug("Switched CurrentSessionUserId: " + M_session.getCurrentSessionUserId()); @@ -371,7 +395,7 @@ private void doSearch2() throws SQLException { * @deprecated */ private void doSearch3() throws SQLException { - userSitesRows = new ArrayList(); + userSitesRows = new ArrayList<>(); timeSpentInGroups = 0; Connection c = null; PreparedStatement pst = null; @@ -538,7 +562,7 @@ public List getUserSitesRows() { return userSitesRows; } - public void setUserSitesRows(List userRows) { + public void setUserSitesRows(List userRows) { this.userSitesRows = userRows; } @@ -551,9 +575,9 @@ public boolean isRenderTable() { } public String getUserDisplayId() { - String displayId = null; + String displayId; try{ - displayId = UserDirectoryService.getUser(userId).getDisplayId(); + displayId = userDirectoryService.getUser(userId).getDisplayId(); }catch(UserNotDefinedException e){ displayId = userId; } @@ -580,6 +604,80 @@ public void setSitesSortColumn(String sitesSortColumn) { this.sitesSortColumn = sitesSortColumn; } + /** + * SAK-29637 - Action listener for the 'Set to Active' button. + * + * @param event + */ + public void setToInactive( ActionEvent event ) + { + toggleUserStatusInSites( false ); + } + + /** + * SAK-29637 - Action listener for the 'Set to Inactive' button. + * + * @param event + */ + public void setToActive( ActionEvent event ) + { + toggleUserStatusInSites( true ); + } + + /** + * SAK-29637 - Utility method to toggle the user's status in the selected sites. + * + * @param active true = toggle to active, false = toggle to inactive + */ + private void toggleUserStatusInSites( boolean active ) + { + // Loop through all user rows (user's sites) + for( UserSitesRow row : userSitesRows ) + { + if( row.isSelected() ) + { + // Get the site + Site site = row.site; + if( site == null ) + { + try + { + site = M_site.getSite( row.getSiteId() ); + } + catch( IdUnusedException ex ) + { + LOG.warn( "site not found, id=" + row.getSiteId(), ex ); + } + } + + if( site != null ) + { + String realmID = site.getReference(); + try + { + String roleID = site.getMember( userId ).getRole().getId(); + AuthzGroup realm = authzGroupService.getAuthzGroup( realmID ); + boolean isProvided = StringUtils.isNotBlank( realm.getProviderGroupId() ); + realm.addMember( userId, roleID, active, isProvided ); + authzGroupService.save( realm ); + } + catch( GroupNotDefinedException ex ) + { + LOG.warn( "realm not found, id=" + realmID, ex ); + } + catch( AuthzPermissionException ex ) + { + LOG.warn( "permission exception updating realm, id=" + realmID, ex ); + } + } + } + } + + // Refresh the list + this.refreshQuery = true; + getInitValues(); + } + // ###################################################################################### // CSV export // ###################################################################################### @@ -597,15 +695,16 @@ private String getFileNamePrefix() { /** * Build a generic tabular representation of the user site membership data export. + * SAK-29637 - modified to obey user's selection * * @param userSites The content of the table * @return * A table of data suitable to be exported */ private List> buildDataTable(List userSites) { - List> table = new LinkedList>(); + List> table = new LinkedList<>(); - List header = new ArrayList(); + List header = new ArrayList<>(); header.add(msgs.getString("site_name")); header.add(msgs.getString("site_id")); header.add(msgs.getString("groups")); @@ -615,20 +714,23 @@ private List> buildDataTable(List userSites) { header.add(msgs.getString("status")); header.add(msgs.getString("site_user_status")); table.add(header); - + for (UserSitesRow userSiteRow : userSites) { - List currentRow = new ArrayList(); - currentRow.add(userSiteRow.getSiteTitle()); - currentRow.add(userSiteRow.getSiteId()); - currentRow.add(userSiteRow.getGroups()); - currentRow.add(userSiteRow.getSiteType()); - currentRow.add(userSiteRow.getSiteTerm()); - currentRow.add(userSiteRow.getRoleName()); - currentRow.add(userSiteRow.getPubView()); - currentRow.add(userSiteRow.getUserStatus()); - table.add(currentRow); + if( userSiteRow.isSelected() ) + { + List currentRow = new ArrayList<>(); + currentRow.add(userSiteRow.getSiteTitle()); + currentRow.add(userSiteRow.getSiteId()); + currentRow.add(userSiteRow.getGroups()); + currentRow.add(userSiteRow.getSiteType()); + currentRow.add(userSiteRow.getSiteTerm()); + currentRow.add(userSiteRow.getRoleName()); + currentRow.add(userSiteRow.getPubView()); + currentRow.add(userSiteRow.getUserStatus()); + table.add(currentRow); + } } - + return table; - } + } } diff --git a/usermembership/tool/src/webapp/usermembership/css/usermembership.css b/usermembership/tool/src/webapp/usermembership/css/usermembership.css index 012fed8f5419..900073a18f7b 100644 --- a/usermembership/tool/src/webapp/usermembership/css/usermembership.css +++ b/usermembership/tool/src/webapp/usermembership/css/usermembership.css @@ -3,8 +3,75 @@ text-align: left; padding: 0px; } + .right { vertical-align: bottom; text-align: right; padding: 0px; -} \ No newline at end of file +} + +/* SAK-29637 */ +div#sitelistform\:headerContainer1, div#sitelistform\:headerContainer2 { + margin-top: 1em; +} + +div.headerWrapper { + display: inline-block; + background-color: #EEE !important; + padding: 1em 1em 1em 0.5em; +} + +div#sitelistform\:headerContainer1 span.collapsed, div#sitelistform\:headerContainer1 span.expanded, +div#sitelistform\:headerContainer2 span.collapsed, div#sitelistform\:headerContainer2 span.expanded { + cursor: pointer; + padding-left: 13px; +} + +div#sitelistform\:headerContainer1 span.collapsed, div#sitelistform\:headerContainer2 span.collapsed { + background: url('/library/image/sakai/expand.gif') no-repeat left !important; +} + +div#sitelistform\:headerContainer1 span.expanded, div#sitelistform\:headerContainer2 span.expanded { + background: url('/library/image/sakai/collapse.gif') no-repeat left !important; +} + +div#sitelistform\:actionContainer1, div#sitelistform\:actionContainer2 { + display: none; + background-color: #EEE; + padding: 1em; +} + +div#sitelistform\:actionContainer1 div, div#sitelistform\:actionContainer2 div { + display: inline-block; +} + +div#sitelistform\:actionContainer1 input, div#sitelistform\:actionContainer2 input { + display: block; + margin: 0.25em 0; + border: 0 !important; + background: 0 !important; + background-color: #EEE !important; + width: 100%; + text-align: left; + text-shadow: none !important; +} + +div#sitelistform\:actionContainer1 input:hover:enabled, div#sitelistform\:actionContainer2 input:hover:enabled { + background-color: #CCC !important; +} + +div#sitelistform\:actionContainer1 input:active:enabled, div#sitelistform\:actionContainer2 input:active:enabled { + background-color: #75B9C2 !important; + color: #FFF !important; + box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.15) inset !important; + text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.3) !important; +} + +div#sitelistform\:actionContainer1 div.column2, div#sitelistform\:actionContainer1 div.column3, +div#sitelistform\:actionContainer2 div.column2, div#sitelistform\:actionContainer2 div.column3 { + border-left: 2px solid #C8C8C8; + padding-left: 1em; + margin-left: 1em; + vertical-align: top; +} +/* end SAK-29637 */ diff --git a/usermembership/tool/src/webapp/usermembership/js/usermembership.js b/usermembership/tool/src/webapp/usermembership/js/usermembership.js new file mode 100644 index 000000000000..c824997ba23d --- /dev/null +++ b/usermembership/tool/src/webapp/usermembership/js/usermembership.js @@ -0,0 +1,56 @@ +var USR_MEMBRSHP = {}; + +USR_MEMBRSHP.applyStateToCheckboxes = function( state ) +{ + $( ".chkStatus" ).prop( "checked", state ); + $( ".chkStatus" ).attr( "value", state ); + USR_MEMBRSHP.checkEnableButtons(); +}; + +USR_MEMBRSHP.checkEnableButtons = function() +{ + // Enable the buttons if any of the checkboxes are checked + var disabled = $( ".chkStatus:checked" ).length > 0 ? false : true; + $( "#sitelistform\\:setToInactive1" ).prop( "disabled", disabled ); + $( "#sitelistform\\:setToActive1" ).prop( "disabled", disabled ); + $( "#sitelistform\\:exportCsv1" ).prop( "disabled", disabled ); + $( "#sitelistform\\:exportXls1" ).prop( "disabled", disabled ); + $( "#sitelistform\\:setToInactive2" ).prop( "disabled", disabled ); + $( "#sitelistform\\:setToActive2" ).prop( "disabled", disabled ); + $( "#sitelistform\\:exportCsv2" ).prop( "disabled", disabled ); + $( "#sitelistform\\:exportXls2" ).prop( "disabled", disabled ); +}; + +USR_MEMBRSHP.invertSelection = function() +{ + // For each checkbox... + $( ".chkStatus" ).each( function() + { + // Invert it's selected state and value + var checked = $( this ).prop( "checked" ); + $( this ).prop( "checked", !checked ); + $( this ).attr( "value", !checked ); + }); + + USR_MEMBRSHP.checkEnableButtons(); +}; + +USR_MEMBRSHP.toggleActions = function( clickedElement ) +{ + var specifier = clickedElement.parentElement.id === "sitelistform:headerContainer1" ? "1" : "2"; + var span = $( "#sitelistform\\:actionHeader" + specifier ); + if( span.attr( "class" ) === "collapsed" ) + { + span.attr( "class", "expanded" ); + $( "#sitelistform\\:actionContainer" + specifier ).show(); + $( "#sitelistform\\:actionContainer" + specifier ).css( "display", "inline-flex" ); + } + else + { + span.attr( "class", "collapsed" ); + $( "#sitelistform\\:actionContainer" + specifier ).hide(); + $( "#sitelistform\\:actionContainer" + specifier ).css( "display", "none" ); + } + + setMainFrameHeight( USR_MEMBRSHP.frameID ); +}; diff --git a/usermembership/tool/src/webapp/usermembership/sitelist.jsp b/usermembership/tool/src/webapp/usermembership/sitelist.jsp index 0555757e666c..a8a891cd704f 100644 --- a/usermembership/tool/src/webapp/usermembership/sitelist.jsp +++ b/usermembership/tool/src/webapp/usermembership/sitelist.jsp @@ -1,3 +1,4 @@ +<%@ page import="org.sakaiproject.umem.tool.ui.SiteListBean"%> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://sakaiproject.org/jsf/sakai" prefix="sakai" %> @@ -17,6 +18,14 @@ + + + + + + <%/**/%> @@ -28,6 +37,27 @@

+ + + + + + + + + + + + + + + + + + + + + + + + @@ -93,19 +126,36 @@ -

- -

- -
- - - - + +

+ +

+
+ + + + + + + + + + + + + + + + + + + + - + + + -
From ba13bd01403baf91268261ccea5e9b5449bf5fe1 Mon Sep 17 00:00:00 2001 From: David Horwitz Date: Fri, 26 Jun 2015 08:05:35 +0200 Subject: [PATCH 02/12] SAK-29573 poi 3.12 --- assignment/assignment-impl/impl/pom.xml | 2 +- gradebook/app/ui/pom.xml | 4 ++-- jsf/jsf-spreadsheet/pom.xml | 2 +- master/pom.xml | 1 + roster2/pom.xml | 2 +- samigo/samigo-app/pom.xml | 4 ++-- search/search-impl/impl/pom.xml | 7 +++---- signup/pom.xml | 2 +- site-manage/site-association-tool/tool/pom.xml | 2 +- sitestats/pom.xml | 3 +-- 10 files changed, 14 insertions(+), 15 deletions(-) diff --git a/assignment/assignment-impl/impl/pom.xml b/assignment/assignment-impl/impl/pom.xml index 8c970786408b..1d8a2c19d2f8 100644 --- a/assignment/assignment-impl/impl/pom.xml +++ b/assignment/assignment-impl/impl/pom.xml @@ -100,7 +100,7 @@ org.apache.poi poi - 3.11 + ${sakai.poi.version} org.hibernate diff --git a/gradebook/app/ui/pom.xml b/gradebook/app/ui/pom.xml index 9f5fdad3ad9d..3746024772fd 100644 --- a/gradebook/app/ui/pom.xml +++ b/gradebook/app/ui/pom.xml @@ -285,12 +285,12 @@ org.apache.poi poi - 3.11 + ${sakai.poi.version} org.apache.poi poi-ooxml - 3.11 + ${sakai.poi.version} diff --git a/jsf/jsf-spreadsheet/pom.xml b/jsf/jsf-spreadsheet/pom.xml index 7d86f2944c13..8be0313655c8 100644 --- a/jsf/jsf-spreadsheet/pom.xml +++ b/jsf/jsf-spreadsheet/pom.xml @@ -41,7 +41,7 @@ org.apache.poi poi - 3.11 + ${sakai.poi.version} com.lowagie diff --git a/master/pom.xml b/master/pom.xml index c5d05ed341d3..0dfecf0930c9 100644 --- a/master/pom.xml +++ b/master/pom.xml @@ -119,6 +119,7 @@ 2.6.2 1.2.17 1.7.5 + 3.12 0.8.1-SNAPSHOT 11-SNAPSHOT 11-SNAPSHOT diff --git a/roster2/pom.xml b/roster2/pom.xml index 7bacf956451e..fca8fdb8d44a 100644 --- a/roster2/pom.xml +++ b/roster2/pom.xml @@ -143,7 +143,7 @@ org.apache.poi poi - ${poi.version} + ${sakai.poi.version} org.projectlombok diff --git a/samigo/samigo-app/pom.xml b/samigo/samigo-app/pom.xml index 8d55315fe313..8949cdec7f8a 100644 --- a/samigo/samigo-app/pom.xml +++ b/samigo/samigo-app/pom.xml @@ -207,12 +207,12 @@ org.apache.poi poi - 3.11 + ${sakai.poi.version} org.apache.poi poi-ooxml - 3.11 + ${sakai.poi.version} org.springframework diff --git a/search/search-impl/impl/pom.xml b/search/search-impl/impl/pom.xml index 2b7f32ab9d77..9b46f6dc3e29 100644 --- a/search/search-impl/impl/pom.xml +++ b/search/search-impl/impl/pom.xml @@ -28,7 +28,6 @@ - 3.11 4.5.0 jdk16 @@ -137,19 +136,19 @@ org.apache.poi poi - ${poi.version} + ${sakai.poi.version} jar org.apache.poi poi-ooxml - ${poi.version} + ${sakai.poi.version} jar org.apache.poi poi-scratchpad - ${poi.version} + ${sakai.poi.version} jar 1.0 - 3.11 1.0.5 6.20.0 @@ -141,7 +140,7 @@ org.apache.poi poi - ${poi.version} + ${sakai.poi.version} From 0d84d410ea461c7307bc722b4986fbab956a0db3 Mon Sep 17 00:00:00 2001 From: Sam Ottenhoff Date: Tue, 7 Jul 2015 14:19:44 -0400 Subject: [PATCH 03/12] SAK-29573 remove poi version from roster2 --- roster2/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/roster2/pom.xml b/roster2/pom.xml index fca8fdb8d44a..6b197027cb82 100644 --- a/roster2/pom.xml +++ b/roster2/pom.xml @@ -21,7 +21,6 @@ war - 3.11 1.2 UTF-8 From ec19161f022e183bcfafd3d8b3112c7859042572 Mon Sep 17 00:00:00 2001 From: Mark Triggs Date: Wed, 8 Jul 2015 10:36:44 +1000 Subject: [PATCH 04/12] SAK-29655 Add the PA System to the admin workspace by default. --- kernel/kernel-impl/src/main/sql/hsqldb/sakai_site.sql | 3 +++ kernel/kernel-impl/src/main/sql/mysql/sakai_site.sql | 3 +++ kernel/kernel-impl/src/main/sql/oracle/sakai_site.sql | 3 +++ reference/docs/conversion/sakai_11_mysql_conversion.sql | 5 +++++ reference/docs/conversion/sakai_11_oracle_conversion.sql | 4 ++++ 5 files changed, 18 insertions(+) diff --git a/kernel/kernel-impl/src/main/sql/hsqldb/sakai_site.sql b/kernel/kernel-impl/src/main/sql/hsqldb/sakai_site.sql index 9a96ba447922..fa02a607e906 100644 --- a/kernel/kernel-impl/src/main/sql/hsqldb/sakai_site.sql +++ b/kernel/kernel-impl/src/main/sql/hsqldb/sakai_site.sql @@ -269,6 +269,9 @@ INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!admin', '!admin-1300', 'sitePage.c INSERT INTO SAKAI_SITE_PAGE VALUES('!admin-1400', '!admin', 'Admin Site Perms', '0', 19, '0' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!admin-1450', '!admin-1400', '!admin', 'sakai.adminsiteperms', 1, 'Admin Site Perms', NULL ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!admin', '!admin-1400', 'sitePage.customTitle', 'true'); +INSERT INTO SAKAI_SITE_PAGE VALUES('!admin-1500', '!admin', 'PA System', '0', 20, '0' ); +INSERT INTO SAKAI_SITE_TOOL VALUES('!admin-1550', '!admin-1500', '!admin', 'sakai.pasystem', 1, 'PA System', NULL ); +INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!admin', '!admin-1500', 'sitePage.customTitle', 'true'); INSERT INTO SAKAI_SITE_USER VALUES('!admin', 'admin', -1); diff --git a/kernel/kernel-impl/src/main/sql/mysql/sakai_site.sql b/kernel/kernel-impl/src/main/sql/mysql/sakai_site.sql index d2224f936efb..4452ff1eb2d6 100644 --- a/kernel/kernel-impl/src/main/sql/mysql/sakai_site.sql +++ b/kernel/kernel-impl/src/main/sql/mysql/sakai_site.sql @@ -284,6 +284,9 @@ INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!admin', '!admin-1300', 'sitePage.c INSERT INTO SAKAI_SITE_PAGE VALUES('!admin-1400', '!admin', 'Admin Site Perms', '0', 19, '0' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!admin-1450', '!admin-1400', '!admin', 'sakai.adminsiteperms', 1, 'Admin Site Perms', NULL ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!admin', '!admin-1400', 'sitePage.customTitle', 'true'); +INSERT INTO SAKAI_SITE_PAGE VALUES('!admin-1500', '!admin', 'PA System', '0', 20, '0' ); +INSERT INTO SAKAI_SITE_TOOL VALUES('!admin-1550', '!admin-1500', '!admin', 'sakai.pasystem', 1, 'PA System', NULL ); +INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!admin', '!admin-1500', 'sitePage.customTitle', 'true'); INSERT INTO SAKAI_SITE_USER VALUES('!admin', 'admin', -1); diff --git a/kernel/kernel-impl/src/main/sql/oracle/sakai_site.sql b/kernel/kernel-impl/src/main/sql/oracle/sakai_site.sql index 4f527e8c825d..328d293f0060 100644 --- a/kernel/kernel-impl/src/main/sql/oracle/sakai_site.sql +++ b/kernel/kernel-impl/src/main/sql/oracle/sakai_site.sql @@ -298,6 +298,9 @@ INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!admin', '!admin-1300', 'sitePage.c INSERT INTO SAKAI_SITE_PAGE VALUES('!admin-1400', '!admin', 'Admin Site Perms', '0', 19, '0' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!admin-1450', '!admin-1400', '!admin', 'sakai.adminsiteperms', 1, 'Admin Site Perms', NULL ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!admin', '!admin-1400', 'sitePage.customTitle', 'true'); +INSERT INTO SAKAI_SITE_PAGE VALUES('!admin-1500', '!admin', 'PA System', '0', 20, '0' ); +INSERT INTO SAKAI_SITE_TOOL VALUES('!admin-1550', '!admin-1500', '!admin', 'sakai.pasystem', 1, 'PA System', NULL ); +INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!admin', '!admin-1500', 'sitePage.customTitle', 'true'); INSERT INTO SAKAI_SITE_USER VALUES('!admin', 'admin', -1); diff --git a/reference/docs/conversion/sakai_11_mysql_conversion.sql b/reference/docs/conversion/sakai_11_mysql_conversion.sql index 56f402cc21f7..06cbe4c26179 100644 --- a/reference/docs/conversion/sakai_11_mysql_conversion.sql +++ b/reference/docs/conversion/sakai_11_mysql_conversion.sql @@ -366,6 +366,11 @@ CREATE TABLE `pasystem_banner_dismissed` ( INDEX `state` (`state`) ); +INSERT INTO SAKAI_SITE_PAGE VALUES('!admin-1500', '!admin', 'PA System', '0', 20, '0' ); +INSERT INTO SAKAI_SITE_TOOL VALUES('!admin-1550', '!admin-1500', '!admin', 'sakai.pasystem', 1, 'PA System', NULL ); +INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!admin', '!admin-1500', 'sitePage.customTitle', 'true'); + + -- END SAK-29422 Incorporate NYU's "public announcement system" -- SAK-29571 MFR_MESSAGE_DELETD_I causes bad performance drop index MFR_MESSAGE_DELETED_I on MFR_MESSAGE_T; diff --git a/reference/docs/conversion/sakai_11_oracle_conversion.sql b/reference/docs/conversion/sakai_11_oracle_conversion.sql index 8a03f1e2daee..12582f90ebf4 100644 --- a/reference/docs/conversion/sakai_11_oracle_conversion.sql +++ b/reference/docs/conversion/sakai_11_oracle_conversion.sql @@ -382,6 +382,10 @@ CREATE TABLE pasystem_banner_dismissed ( CREATE INDEX banner_dismissed_lcase_eid on pasystem_banner_dismissed (lower(user_eid)); CREATE INDEX banner_dismissed_state on pasystem_banner_dismissed (state); +INSERT INTO SAKAI_SITE_PAGE VALUES('!admin-1500', '!admin', 'PA System', '0', 20, '0' ); +INSERT INTO SAKAI_SITE_TOOL VALUES('!admin-1550', '!admin-1500', '!admin', 'sakai.pasystem', 1, 'PA System', NULL ); +INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!admin', '!admin-1500', 'sitePage.customTitle', 'true'); + -- END SAK-29422 Incorporate NYU's "public announcement system" -- SAK-29571 MFR_MESSAGE_DELETD_I causes bad performance drop index MFR_MESSAGE_DELETED_I; From 615714e0fb0b6f1aadd3d79edb43f212bb47ad83 Mon Sep 17 00:00:00 2001 From: Mark Triggs Date: Wed, 8 Jul 2015 10:49:18 +1000 Subject: [PATCH 05/12] SAK-29655 Add an icon to the PA System menu item --- reference/library/src/morpheus-master/sass/base/_icons.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/library/src/morpheus-master/sass/base/_icons.scss b/reference/library/src/morpheus-master/sass/base/_icons.scss index c386c975956d..0e854bbf37ee 100644 --- a/reference/library/src/morpheus-master/sass/base/_icons.scss +++ b/reference/library/src/morpheus-master/sass/base/_icons.scss @@ -63,6 +63,7 @@ &.icon-sakai-message-bundle-manager{ @extend .fa-gear;} &.icon-sakai-delegatedaccess{ @extend .fa-gear;} &.icon-sakai-web-168{ @extend .fa-globe;} + &.icon-sakai-pasystem{ @extend .fa-bell;} &.icon-sakai-feedback{ @extend .fa-paper-plane-o;} } } @@ -131,6 +132,7 @@ &.icon-sakai-web-168{ @extend .fa-globe;} &.icon-sakai-feedback{ @extend .fa-paper-plane-o;} &.icon-sakai-see-all-tools{ @extend .fa-plus-square-o;} + &.icon-sakai-pasystem{ @extend .fa-bell;} } } } From d61bc66d5b41fd357fcaf554ee28bf42f2fdab21 Mon Sep 17 00:00:00 2001 From: Miguel Carro Pellicer Date: Wed, 8 Jul 2015 08:52:32 +0200 Subject: [PATCH 06/12] SAK-29657 - Add Feedback DDL to conversion scripts SAK-29657 - Add Feedback DDL to conversion scripts --- .../conversion/sakai_11_mysql_conversion.sql | 14 ++++++++++++++ .../conversion/sakai_11_oracle_conversion.sql | 16 ++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/reference/docs/conversion/sakai_11_mysql_conversion.sql b/reference/docs/conversion/sakai_11_mysql_conversion.sql index 56f402cc21f7..8581ec466b16 100644 --- a/reference/docs/conversion/sakai_11_mysql_conversion.sql +++ b/reference/docs/conversion/sakai_11_mysql_conversion.sql @@ -398,3 +398,17 @@ INSERT INTO SAKAI_REALM_RL_FN VALUES((select REALM_KEY from SAKAI_REALM where RE INSERT INTO SAKAI_REALM_RL_FN VALUES((select REALM_KEY from SAKAI_REALM where REALM_ID = '!site.template.course'), (select ROLE_KEY from SAKAI_REALM_ROLE where ROLE_NAME = 'Instructor'), (select FUNCTION_KEY from SAKAI_REALM_FUNCTION where FUNCTION_NAME = 'calendar.view.audience')); INSERT INTO SAKAI_REALM_RL_FN VALUES((select REALM_KEY from SAKAI_REALM where REALM_ID = '!site.template.lti'), (select ROLE_KEY from SAKAI_REALM_ROLE where ROLE_NAME = 'Instructor'), (select FUNCTION_KEY from SAKAI_REALM_FUNCTION where FUNCTION_NAME = 'calendar.view.audience')); -- END SAK-29497 + +-- SAK-29271 Feedback Tool +CREATE TABLE IF NOT EXISTS sakai_feedback ( + id INT NOT NULL AUTO_INCREMENT, + user_id VARCHAR(99), + email VARCHAR(255) NOT NULL, + site_id VARCHAR(99) NOT NULL, + report_type ENUM('content','technical', 'helpdesk') NOT NULL, + title VARCHAR(40) NOT NULL, + content TEXT NOT NULL, PRIMARY KEY(id)); +INSERT INTO SAKAI_SITE VALUES('!contact-us', 'Contact Us', null, null, null, '', '', null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0, 0, null); +INSERT INTO SAKAI_SITE_PAGE VALUES('!contact-us', '!contact-us', 'Contact Us', '0', 1, '0' ); +INSERT INTO SAKAI_SITE_TOOL VALUES('!contact-us', '!contact-us', '!contact-us', 'sakai.feedback', 1, 'Contact Us', NULL ); +-- END SAK-29271 diff --git a/reference/docs/conversion/sakai_11_oracle_conversion.sql b/reference/docs/conversion/sakai_11_oracle_conversion.sql index 8a03f1e2daee..32018ad71441 100644 --- a/reference/docs/conversion/sakai_11_oracle_conversion.sql +++ b/reference/docs/conversion/sakai_11_oracle_conversion.sql @@ -414,3 +414,19 @@ INSERT INTO SAKAI_REALM_RL_FN VALUES((select REALM_KEY from SAKAI_REALM where RE INSERT INTO SAKAI_REALM_RL_FN VALUES((select REALM_KEY from SAKAI_REALM where REALM_ID = '!site.template.course'), (select ROLE_KEY from SAKAI_REALM_ROLE where ROLE_NAME = 'Instructor'), (select FUNCTION_KEY from SAKAI_REALM_FUNCTION where FUNCTION_NAME = 'calendar.view.audience')); INSERT INTO SAKAI_REALM_RL_FN VALUES((select REALM_KEY from SAKAI_REALM where REALM_ID = '!site.template.lti'), (select ROLE_KEY from SAKAI_REALM_ROLE where ROLE_NAME = 'Instructor'), (select FUNCTION_KEY from SAKAI_REALM_FUNCTION where FUNCTION_NAME = 'calendar.view.audience')); -- END SAK-29497 + +-- SAK-29271 Feedback Tool +CREATE TABLE sakai_feedback ( + id number not null primary key, + user_id varchar2(99) null, + email varchar2(255) not null, + site_id varchar2(99) not null, + report_type varchar2(15) not null, + title varchar2(40) not null, + content varchar2(4000) not null, + CONSTRAINT cons_report_type CHECK (report_type IN ('content','technical', 'helpdesk'))); +CREATE SEQUENCE sakai_feedback_seq START WITH 1 INCREMENT BY 1 nomaxvalue; +INSERT INTO SAKAI_SITE VALUES('!contact-us', 'Contact Us', null, null, null, '', '', null, 1, 0, 0, '', 'admin', 'admin', sysdate, sysdate, 1, 0, 0, 0, null); +INSERT INTO SAKAI_SITE_PAGE VALUES('!contact-us', '!contact-us', 'Contact Us', '0', 1, '0' ); +INSERT INTO SAKAI_SITE_TOOL VALUES('!contact-us', '!contact-us', '!contact-us', 'sakai.feedback', 1, 'Contact Us', NULL ); +-- END SAK-29271 From fe3bb7e9ffec3b14fca21d8cd037749a04720a85 Mon Sep 17 00:00:00 2001 From: Miguel Carro Pellicer Date: Thu, 9 Jul 2015 11:24:53 +0200 Subject: [PATCH 07/12] SAK-29668 Add Support for Google Tag Manager to the Portal --- .../config/bundle/default.sakai.properties | 5 +++++ .../portal/charon/SkinnableCharonPortal.java | 6 ++++++ .../src/webapp/vm/morpheus/includeGoogleTagManager.vm | 11 +++++++++++ .../pack/src/webapp/vm/morpheus/site.vm | 2 ++ 4 files changed, 24 insertions(+) create mode 100644 portal/portal-render-engine-impl/pack/src/webapp/vm/morpheus/includeGoogleTagManager.vm diff --git a/config/configuration/bundles/src/bundle/org/sakaiproject/config/bundle/default.sakai.properties b/config/configuration/bundles/src/bundle/org/sakaiproject/config/bundle/default.sakai.properties index 6655d6562b70..9b487d7735cb 100644 --- a/config/configuration/bundles/src/bundle/org/sakaiproject/config/bundle/default.sakai.properties +++ b/config/configuration/bundles/src/bundle/org/sakaiproject/config/bundle/default.sakai.properties @@ -79,6 +79,11 @@ # # portal.google.universal_analytics_id=UA-XXXXXX-XX +# SAK-29668 +# Add support for Google Tag Manager +# Google Tag Manager is NOT enabled by default, setting these will enable it +# portal.google.tag.manager.container_id = GTM-XXXXX + # SAK-29138 - If set to true, portal will use student's enrolled section title (of preferred type, see below) # rather than the site's title for the course site tab, page (browser tab) title, and tool header title # DEFAULT: false diff --git a/portal/portal-impl/impl/src/java/org/sakaiproject/portal/charon/SkinnableCharonPortal.java b/portal/portal-impl/impl/src/java/org/sakaiproject/portal/charon/SkinnableCharonPortal.java index 3a6383f895d0..067b562d5699 100644 --- a/portal/portal-impl/impl/src/java/org/sakaiproject/portal/charon/SkinnableCharonPortal.java +++ b/portal/portal-impl/impl/src/java/org/sakaiproject/portal/charon/SkinnableCharonPortal.java @@ -1024,6 +1024,12 @@ public PortalRenderContext startPageContext(String siteType, String title, ServerConfigurationService.getBoolean("portal.google.analytics_detail", false)); } + //SAK-29668 + String googleTagManagerContainerId = ServerConfigurationService.getString("portal.google.tag.manager.container_id", null); + if ( googleTagManagerContainerId != null ) { + rcontext.put("googleTagManagerContainerId", googleTagManagerContainerId); + } + Session s = SessionManager.getCurrentSession(); rcontext.put("loggedIn", Boolean.valueOf(s.getUserId() != null)); rcontext.put("userId", s.getUserId()); diff --git a/portal/portal-render-engine-impl/pack/src/webapp/vm/morpheus/includeGoogleTagManager.vm b/portal/portal-render-engine-impl/pack/src/webapp/vm/morpheus/includeGoogleTagManager.vm new file mode 100644 index 000000000000..45b181821369 --- /dev/null +++ b/portal/portal-render-engine-impl/pack/src/webapp/vm/morpheus/includeGoogleTagManager.vm @@ -0,0 +1,11 @@ +#if (${googleTagManagerContainerId}) + + + + +#end ## END of IF (${googleTagManagerContainerId}) \ No newline at end of file diff --git a/portal/portal-render-engine-impl/pack/src/webapp/vm/morpheus/site.vm b/portal/portal-render-engine-impl/pack/src/webapp/vm/morpheus/site.vm index 7a9ee3dd388b..ef0016ff9d30 100644 --- a/portal/portal-render-engine-impl/pack/src/webapp/vm/morpheus/site.vm +++ b/portal/portal-render-engine-impl/pack/src/webapp/vm/morpheus/site.vm @@ -144,6 +144,8 @@ #parse("/vm/morpheus/includeCookieNotice.vm") + #parse("/vm/morpheus/includeGoogleTagManager.vm") + ${includeExtraHead} From 47976f617971868d5fc5c753161f4f6d4eb8f63e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Ballest=C3=A9?= Date: Thu, 9 Jul 2015 13:50:33 +0200 Subject: [PATCH 08/12] SAK-29664 Replaced portal chat icons images for font awesome --- .../charon/src/webapp/scripts/chat.js | 4 +- .../webapp/vm/morpheus/includeFooterExtras.vm | 72 +++++++++----- .../sass/modules/tool/chat/_chat.scss | 92 +++++++----------- .../webapp/image/sakai/video_back_finish.png | Bin 1847 -> 0 bytes .../src/webapp/image/sakai/video_call.png | Bin 381 -> 0 bytes .../webapp/image/sakai/video_cam_disable.png | Bin 559 -> 0 bytes .../webapp/image/sakai/video_cam_enable.png | Bin 348 -> 0 bytes .../src/webapp/image/sakai/video_hang.png | Bin 320 -> 0 bytes .../src/webapp/image/sakai/video_maxi.png | Bin 280 -> 0 bytes .../webapp/image/sakai/video_mic_disable.png | Bin 633 -> 0 bytes .../webapp/image/sakai/video_mic_enable.png | Bin 460 -> 0 bytes 11 files changed, 88 insertions(+), 80 deletions(-) delete mode 100644 reference/library/src/webapp/image/sakai/video_back_finish.png delete mode 100644 reference/library/src/webapp/image/sakai/video_call.png delete mode 100644 reference/library/src/webapp/image/sakai/video_cam_disable.png delete mode 100644 reference/library/src/webapp/image/sakai/video_cam_enable.png delete mode 100644 reference/library/src/webapp/image/sakai/video_hang.png delete mode 100644 reference/library/src/webapp/image/sakai/video_maxi.png delete mode 100644 reference/library/src/webapp/image/sakai/video_mic_disable.png delete mode 100644 reference/library/src/webapp/image/sakai/video_mic_enable.png diff --git a/portal/portal-charon/charon/src/webapp/scripts/chat.js b/portal/portal-charon/charon/src/webapp/scripts/chat.js index d470a5cf18f6..63c170210fbb 100644 --- a/portal/portal-charon/charon/src/webapp/scripts/chat.js +++ b/portal/portal-charon/charon/src/webapp/scripts/chat.js @@ -280,7 +280,7 @@ if (chatDiv.hasClass('video_active')) { chatDiv.css('margin-top', '49px'); } else { - chatDiv.css('margin-top', '241px'); + chatDiv.css('margin-top', '237px'); } } chatDiv.attr('data-height', '318'); @@ -381,7 +381,7 @@ if (chatDiv.hasClass('video_active')) { chatDiv.css('margin-top', '49px'); } else { - chatDiv.css('margin-top', ((chatDiv.attr('data-height') > 300) ? '241' : '260') + 'px'); + chatDiv.css('margin-top', ((chatDiv.attr('data-height') > 300) ? '237' : '260') + 'px'); } if (chatSessionString) { chatSession = JSON.parse(chatSessionString); diff --git a/portal/portal-render-engine-impl/pack/src/webapp/vm/morpheus/includeFooterExtras.vm b/portal/portal-render-engine-impl/pack/src/webapp/vm/morpheus/includeFooterExtras.vm index 756a39ee105b..f14b68525af7 100644 --- a/portal/portal-render-engine-impl/pack/src/webapp/vm/morpheus/includeFooterExtras.vm +++ b/portal/portal-render-engine-impl/pack/src/webapp/vm/morpheus/includeFooterExtras.vm @@ -6,7 +6,7 @@