Univention Bugzilla – Attachment 7709 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]
intermediate patch 2
41293__31_06_2016.patch (text/plain), 8.41 KB, created by
Johannes Keiser
on 2016-05-31 16:16:34 CEST
(
hide
)
Description:
intermediate patch 2
Filename:
MIME Type:
Creator:
Johannes Keiser
Created:
2016-05-31 16:16:34 CEST
Size:
8.41 KB
patch
obsolete
>Index: umc/js/schoolwizards/Grid.js >=================================================================== >--- umc/js/schoolwizards/Grid.js (Revision 69658) >+++ 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 69658) >+++ 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', >@@ -72,6 +76,14 @@ > // 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: ' ', > width: '10px', >Index: umc/js/schoolwizards/UserGridChooseSchool.js >=================================================================== >--- umc/js/schoolwizards/UserGridChooseSchool.js (Revision 0) >+++ 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/ContainerWidget", >+ "umc/widgets/Button", >+ "umc/widgets/ComboBox", >+ "umc/widgets/Text", >+ "umc/modules/schoolwizards/UserGrid", >+ "umc/i18n!umc/modules/schoolwizards" >+], function(declare, lang, array, Form, ContainerWidget, Button, ComboBox, Text, UserGrid, _) { >+ >+ return declare("umc.modules.schoolwizards.UserGridChooseSchool", [ContainerWidget], { >+ 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 69658) >+++ 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'), >@@ -151,6 +152,15 @@ > // ...and another one for Bug #30109 > return this.getWidget('item', 'password').isValid(); > }) >+ }, { >+ type: MultiSelect, >+ name: 'schools', >+ label: _('School'), >+ _setValueAttr: function(values) { >+ this.set('dynamicValues', function() {return values;}); >+ return; >+ }, >+ plugins: null > }], > layout: [ > ['firstname', 'lastname'], >@@ -157,7 +167,8 @@ > ['name'], > ['school_class', 'newClass'], > ['email'], >- ['password'] >+ ['password'], >+ ['schools'] > ] > }; > }, >Index: umc/js/schoolwizards.js >=================================================================== >--- umc/js/schoolwizards.js (Revision 69658) >+++ umc/js/schoolwizards.js (Arbeitskopie) >@@ -37,14 +37,14 @@ > "umc/tools", > "umc/dialog", > "umc/widgets/Module", >- "umc/modules/schoolwizards/UserGrid", >+ "umc/modules/schoolwizards/UserGridChooseSchool", > "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, ClassGrid, ComputerGrid, SchoolGrid, _) { > var grids = { >- 'schoolwizards/users': UserGrid, >+ 'schoolwizards/users': UserGridChooseSchool, > 'schoolwizards/classes': ClassGrid, > 'schoolwizards/computers': ComputerGrid, > 'schoolwizards/schools': SchoolGrid
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