Univention Bugzilla – Attachment 7712 Details for
Bug 41293
Add new feature of OU-spanning users to UCS@school user wizard
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
41293_2016-06-01.1.patch (text/plain), 8.61 KB, created by
Jürn Brodersen
on 2016-06-01 11:36:27 CEST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Jürn Brodersen
Created:
2016-06-01 11:36:27 CEST
Size:
8.61 KB
patch
obsolete
>Index: umc/js/schoolwizards/Grid.js >=================================================================== >--- umc/js/schoolwizards/Grid.js (Revision 69403) >+++ umc/js/schoolwizards/Grid.js (Arbeitskopie) >@@ -181,7 +181,7 @@ > label: _('School') > }); > } >- columns = columns.concat(this.getGridColumns()); >+ columns = this.getGridColumns().concat(columns); > return columns; > }, > >Index: umc/js/schoolwizards/UserGrid.js >=================================================================== >--- umc/js/schoolwizards/UserGrid.js (Revision 69403) >+++ umc/js/schoolwizards/UserGrid.js (Arbeitskopie) >@@ -32,14 +32,13 @@ > define([ > "dojo/_base/declare", > "dojo/_base/lang", >- "dojo/_base/array", >- "dojo/topic", >+ "dojo/string", > "umc/widgets/TextBox", > "umc/widgets/ComboBox", > "umc/modules/schoolwizards/UserWizard", > "umc/modules/schoolwizards/Grid", > "umc/i18n!umc/modules/schoolwizards" >-], function(declare, lang, array, topic, TextBox, ComboBox, UserWizard, Grid, _) { >+], function(declare, lang, string, TextBox, ComboBox, UserWizard, Grid, _) { > > return declare("umc.modules.schoolwizards.UserGrid", [Grid], { > >@@ -49,7 +48,12 @@ > objectNameSingular: _('school user'), > firstObject: _('the first school user'), > createObjectWizard: UserWizard, >+ sortFields: ['name'], > >+ getGridColumnsWithSchool: function() { >+ return this.getGridColumns(); >+ }, >+ > getGridColumns: function() { > return [{ > name: 'display_name', >@@ -71,6 +75,14 @@ > // name: 'mailPrimaryAddress', > // label: _('E-Mail address'), > // description: _('E-Mail address of the %s.', this.objectNameSingular) >+// }, { >+// name: 'schools', >+// label: _('School'), >+// formatter: lang.hitch(this, function(schools, id) { >+// var escaped_schools_str = string.escape(schools.join(', ')); >+// return '<span title="' + escaped_schools_str + '">' + escaped_schools_str + '</span>'; >+// }), >+// styles: 'white-space: nowrap; text-overflow: ellipsis;', > }, { > name: 'empty', // workaround: EnhancedGrid > label: ' ', >Index: umc/js/schoolwizards/UserGridChooseSchool.js >=================================================================== >--- umc/js/schoolwizards/UserGridChooseSchool.js (nicht existent) >+++ umc/js/schoolwizards/UserGridChooseSchool.js (Arbeitskopie) >@@ -0,0 +1,134 @@ >+/* >+ * Copyright 2012-2016 Univention GmbH >+ * >+ * http://www.univention.de/ >+ * >+ * All rights reserved. >+ * >+ * The source code of this program is made available >+ * under the terms of the GNU Affero General Public License version 3 >+ * (GNU AGPL V3) as published by the Free Software Foundation. >+ * >+ * Binary versions of this program provided by Univention to you as >+ * well as other copyrighted, protected or trademarked materials like >+ * Logos, graphics, fonts, specific documentations and configurations, >+ * cryptographic keys etc. are subject to a license agreement between >+ * you and Univention and not subject to the GNU AGPL V3. >+ * >+ * In the case you use this program under the terms of the GNU AGPL V3, >+ * the program is provided in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+ * GNU Affero General Public License for more details. >+ * >+ * You should have received a copy of the GNU Affero General Public >+ * License with the Debian GNU/Linux or Univention distribution in file >+ * /usr/share/common-licenses/AGPL-3; if not, see >+ * <http://www.gnu.org/licenses/>. >+ */ >+ >+/*global define*/ >+ >+define([ >+ "dojo/_base/declare", >+ "dojo/_base/lang", >+ "dojo/_base/array", >+ "umc/widgets/Form", >+ "umc/widgets/Page", >+ "umc/widgets/Button", >+ "umc/widgets/ComboBox", >+ "umc/widgets/Text", >+ "umc/modules/schoolwizards/UserGrid", >+ "umc/i18n!umc/modules/schoolwizards" >+], function(declare, lang, array, Form, Page, Button, ComboBox, Text, UserGrid, _) { >+ >+ return declare("umc.modules.schoolwizards.UserGridChooseSchool", [Page], { >+ userGrid: null, >+ baseTitle: null, >+ _form: null, >+ >+ postMixInProperties: function() { >+ this.baseTitle = this.module.get('title'); >+ }, >+ >+ buildRendering: function() { >+ this.inherited(arguments); >+ >+ var headerTextWidget = this.createHeader(); >+ this._form = this.createForm(); >+ this._form.on('submit', lang.hitch(this, 'buildGrid')); >+ >+ this.addChild(headerTextWidget); >+ this.addChild(this._form); >+ }, >+ >+ createHeader: function() { >+ var headerText = _("Select a school on which you like to work on"); >+ return new Text({ >+ content: _('<h1>' + headerText + '<h1>'), >+ 'class': 'umcPageHeader' >+ }); >+ }, >+ >+ createForm: function() { >+ return new Form({ >+ widgets: [{ >+ type: ComboBox, >+ name: 'schools', >+ label: _('School'), >+ size: 'OneThirds', >+ staticValues: this.schools >+ }], >+ buttons: [{ >+ name: 'submit', >+ label: _('Next') >+ }], >+ layout: [ >+ ['schools', 'submit'], >+ ] >+ }); >+ }, >+ >+ buildGrid: function() { >+ var selectedSchool = array.filter(this.schools, lang.hitch(this, function(school) { >+ return school.id === this._form.getWidget('schools').getValue(); >+ }))[0]; >+ var _backToSchool = new Button({ >+ name: 'back', >+ label: _('Back'), >+ region: 'footer', >+ onClick: lang.hitch(this, 'chooseDifferentSchool') >+ }); >+ var userGrid = new UserGrid({ >+ description: this.description, >+ schools: [selectedSchool], >+ udmLinkEnabled: this.udmLinkEnabled, >+ autoSearch: this.autoSearch, >+ umcpCommand: lang.hitch(this, 'umcpCommand'), >+ moduleFlavor: this.moduleFlavor, >+ module: this.module >+ }); >+ >+ //add UserGrid to module >+ userGrid.addChild(_backToSchool); >+ this.module.addChild(userGrid); >+ this.module.selectChild(userGrid); >+ >+ //append title with the selected school >+ var titleAppendix = lang.replace(": {0}", [selectedSchool.label]); >+ this.module.set('title', this.baseTitle + titleAppendix); >+ >+ this.userGrid = userGrid; >+ }, >+ >+ chooseDifferentSchool: function() { >+ this.module.removeChild(this.userGrid); >+ this.userGrid.destroyRecursive(); >+ >+ this.module.set('title', this.baseTitle); >+ >+ this.module.selectChild(this); >+ } >+ }); >+}); >+ >Index: umc/js/schoolwizards/UserWizard.js >=================================================================== >--- umc/js/schoolwizards/UserWizard.js (Revision 69403) >+++ umc/js/schoolwizards/UserWizard.js (Arbeitskopie) >@@ -38,10 +38,11 @@ > "umc/widgets/TextBox", > "umc/widgets/Text", > "umc/widgets/ComboBox", >+ "umc/widgets/MultiSelect", > "umc/widgets/PasswordInputBox", > "umc/modules/schoolwizards/Wizard", > "umc/i18n!umc/modules/schoolwizards" >-], function(declare, lang, array, topic, tools, TextBox, Text, ComboBox, PasswordInputBox, Wizard, _) { >+], function(declare, lang, array, topic, tools, TextBox, Text, ComboBox, MultiSelect, PasswordInputBox, Wizard, _) { > > return declare("umc.modules.schoolwizards.UserWizard", [Wizard], { > description: _('Create a new user'), >Index: umc/js/schoolwizards.js >=================================================================== >--- umc/js/schoolwizards.js (Revision 69403) >+++ umc/js/schoolwizards.js (Arbeitskopie) >@@ -37,12 +37,13 @@ > "umc/tools", > "umc/dialog", > "umc/widgets/Module", >+ "umc/modules/schoolwizards/UserGridChooseSchool", > "umc/modules/schoolwizards/UserGrid", > "umc/modules/schoolwizards/ClassGrid", > "umc/modules/schoolwizards/ComputerGrid", > "umc/modules/schoolwizards/SchoolGrid", > "umc/i18n!umc/modules/schoolwizards" >-], function(declare, lang, all, topic, tools, dialog, Module, UserGrid, ClassGrid, ComputerGrid, SchoolGrid, _) { >+], function(declare, lang, all, topic, tools, dialog, Module, UserGridChooseSchool, UserGrid, ClassGrid, ComputerGrid, SchoolGrid, _) { > var grids = { > 'schoolwizards/users': UserGrid, > 'schoolwizards/classes': ClassGrid, >@@ -98,9 +99,21 @@ > }, > > _getGrid: function() { >- var Grid = grids[this.moduleFlavor]; >+ var gridOptions = this._getGridOptions(); > >- return new Grid({ >+ //if the user opens the Users (schools) module and there are more than one school >+ //show an extra page where the user has to choose a school >+ var usersModuleSelected = this.moduleFlavor === 'schoolwizards/users'; >+ if (usersModuleSelected && this.schools.length > 1) { >+ return new UserGridChooseSchool(gridOptions); >+ } else { >+ var Grid = grids[this.moduleFlavor]; >+ return new Grid(gridOptions); >+ } >+ }, >+ >+ _getGridOptions: function() { >+ return { > description: this.description, > schools: this.schools, > udmLinkEnabled: this.udmLinkEnabled, >@@ -108,7 +121,7 @@ > umcpCommand: lang.hitch(this, 'umcpCommand'), > moduleFlavor: this.moduleFlavor, > module: this >- }); >+ }; > } > }); > });
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 41293
:
7675
|
7709
|
7710
| 7712