Merge branch 'master' into ldap
This commit is contained in:
commit
c6c6c07e33
11 changed files with 127 additions and 26 deletions
|
|
@ -118,7 +118,6 @@ ganttz.DependencyComponentBase = zk.$extends(zul.Widget,{
|
|||
|
||||
|
||||
var deparrow = this._findImageElement('arrow');
|
||||
deparrow.attr('src', this.$class.getImagesDir() + "arrow3.png");
|
||||
deparrow.css({top : yend - 5, left : xend - 8});
|
||||
},
|
||||
_drawArrowEndStart : function(coordOrig, coordDest){
|
||||
|
|
@ -155,23 +154,18 @@ ganttz.DependencyComponentBase = zk.$extends(zul.Widget,{
|
|||
depend.css(dependcss);
|
||||
|
||||
var deparrow = this._findImageElement('arrow');
|
||||
var deparrowsrc, deparrowcss;
|
||||
var deparrowcss;
|
||||
if ( width == 0 ) {
|
||||
deparrowcss = {top : (yend - 10) , left : (xend - 5)};
|
||||
deparrowsrc = this.$class.getImagesDir() + "arrow2.png";
|
||||
if ( yorig > yend ) {
|
||||
deparrowcss = {top : yend};
|
||||
deparrowsrc = this.$class.getImagesDir() + "arrow4.png";
|
||||
}
|
||||
} else {
|
||||
deparrowcss = {top : (yend -5), left : (xend - 10)};
|
||||
deparrowsrc = this.$class.getImagesDir() + "arrow.png";
|
||||
if (width < 0) {
|
||||
deparrowcss = {top : (yend - 5), left : xend}
|
||||
deparrowsrc = this.$class.getImagesDir() + "arrow3.png";
|
||||
}
|
||||
}
|
||||
deparrow.attr('src', deparrowsrc);
|
||||
deparrow.css(deparrowcss);
|
||||
},
|
||||
findPos_ : function(element){
|
||||
|
|
@ -180,22 +174,18 @@ ganttz.DependencyComponentBase = zk.$extends(zul.Widget,{
|
|||
return {left : (pos2.left - pos1.left), top : (pos2.top - pos1.top)};
|
||||
},
|
||||
_findImageElement : function(name) {
|
||||
var img = jq('.' + name + '', this.$n());
|
||||
return img;
|
||||
return jq('.' + name + '', this.$n());
|
||||
},
|
||||
setupArrow_ : function(){
|
||||
var image_data = [ [ "start", "pixel.gif" ], [ "mid", "pixel.gif" ],
|
||||
[ "end", "pixel.gif" ], [ "arrow", "arrow.png" ] ];
|
||||
var img;
|
||||
var imgDiv;
|
||||
var insertPoint = jq(this.$n());
|
||||
for ( var i = 0; i < image_data.length; i++) {
|
||||
img = jq(document.createElement('img'));
|
||||
img.attr({
|
||||
'class' : image_data[i][0] + " extra_padding",
|
||||
'src' : this.$class.getImagesDir() + image_data[i][1]
|
||||
});
|
||||
imgDiv = jq(document.createElement('div'));
|
||||
imgDiv.attr('class', image_data[i][0] + " extra_padding");
|
||||
|
||||
insertPoint.append(img);
|
||||
insertPoint.append(imgDiv);
|
||||
}
|
||||
}
|
||||
},{
|
||||
|
|
@ -342,4 +332,4 @@ ganttz.UnlinkedDependencyComponent = zk.$extends(ganttz.DependencyComponentBase,
|
|||
|
||||
zk.afterLoad('ganttz',function(){
|
||||
ganttz.UnlinkedDependencyComponent.molds = ganttz.DependencyComponent.molds;
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -68,6 +68,10 @@ public class User extends BaseEntity {
|
|||
|
||||
private boolean expandResourceLoadViewCharts = true;
|
||||
|
||||
private String firstName = "";
|
||||
|
||||
private String lastName = "";
|
||||
|
||||
/**
|
||||
* Necessary for Hibernate. Please, do not call it.
|
||||
*/
|
||||
|
|
@ -255,4 +259,20 @@ public class User extends BaseEntity {
|
|||
this.expandCompanyPlanningViewCharts = expandCompanyPlanningViewCharts;
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -201,4 +201,14 @@
|
|||
<dropColumn tableName="configuration" columnName="expand_resource_load_view_charts"/>
|
||||
</changeSet>
|
||||
|
||||
<changeSet id="add-new-fields" author="calvarinop">
|
||||
<comment>Add new column to store the first and last name for this user</comment>
|
||||
<addColumn tableName="user_table">
|
||||
<column name="first_name" type="VARCHAR(255)"/>
|
||||
</addColumn>
|
||||
<addColumn tableName="user_table">
|
||||
<column name="last_name" type="VARCHAR(255)"/>
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@
|
|||
column="expand_order_planning_view_charts" />
|
||||
<property name="expandResourceLoadViewCharts" not-null="true"
|
||||
column="expand_resource_load_view_charts" />
|
||||
<property name="firstName" column="first_name"/>
|
||||
<property name="lastName" column="last_name"/>
|
||||
|
||||
<!-- Index created in a database-object section -->
|
||||
<set name="roles" table="roles_table" lazy="false">
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ public class CustomMenuController extends Div implements IMenuItemsRegister {
|
|||
subItem(_("Materials Needs At Date"),"/reports/timeLineMaterialReport.zul","15-informes.html"));
|
||||
|
||||
topItem(_("My account"), "", "",
|
||||
subItem(_("Settings"), "/users/settings.zul", ""));
|
||||
subItem(_("Settings"), "/settings/settings.zul", ""));
|
||||
}
|
||||
|
||||
private Vbox getRegisteredItemsInsertionPoint() {
|
||||
|
|
|
|||
|
|
@ -16,11 +16,10 @@
|
|||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.navalplanner.web.users;
|
||||
package org.navalplanner.web.users.settings;
|
||||
|
||||
import org.navalplanner.business.common.exceptions.ValidationException;
|
||||
import org.navalplanner.business.users.entities.Language;
|
||||
import org.navalplanner.business.users.entities.User;
|
||||
|
||||
/**
|
||||
* Model for UI operations related to user settings
|
||||
|
|
@ -51,4 +50,12 @@ public interface ISettingsModel {
|
|||
|
||||
boolean isExpandCompanyPlanningViewCharts();
|
||||
|
||||
void setLastName(String lastName);
|
||||
|
||||
String getLastName();
|
||||
|
||||
void setFirstName(String firstName);
|
||||
|
||||
String getFirstName();
|
||||
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.navalplanner.web.users;
|
||||
package org.navalplanner.web.users.settings;
|
||||
|
||||
import static org.navalplanner.web.I18nHelper._;
|
||||
|
||||
|
|
@ -126,4 +126,20 @@ public class SettingsController extends GenericForwardComposer {
|
|||
return settingsModel.isExpandResourceLoadViewCharts();
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return settingsModel.getFirstName();
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
settingsModel.setFirstName(firstName);
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return settingsModel.getLastName();
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
settingsModel.setLastName(lastName);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -16,9 +16,8 @@
|
|||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.navalplanner.web.users;
|
||||
package org.navalplanner.web.users.settings;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
|
||||
import org.navalplanner.business.common.exceptions.ValidationException;
|
||||
import org.navalplanner.business.users.daos.IUserDAO;
|
||||
|
|
@ -42,7 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
*/
|
||||
@Service
|
||||
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
|
||||
@OnConcurrentModification(goToPage = "/users/settings.zul")
|
||||
@OnConcurrentModification(goToPage = "/settings/settings.zul")
|
||||
public class SettingsModel implements ISettingsModel {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -146,4 +145,28 @@ public class SettingsModel implements ISettingsModel {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFirstName() {
|
||||
return user.getFirstName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFirstName(String firstName) {
|
||||
if (user != null) {
|
||||
user.setFirstName(firstName);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLastName() {
|
||||
return user.getLastName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLastName(String lastName) {
|
||||
if (user != null) {
|
||||
user.setLastName(lastName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -114,7 +114,7 @@ signature="java.lang.Boolean isDefaultPasswordsControl()"?>
|
|||
<vbox id="registeredItemsInsertionPoint" width="90px"/>
|
||||
</west>
|
||||
|
||||
<center self="@{insert(content)}" class="main-area"/>
|
||||
<center self="@{insert(content)}" class="main-area" autoscroll="true" />
|
||||
|
||||
</borderlayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<zk>
|
||||
<window id="settingsWindow" self="@{define(content)}"
|
||||
apply="org.navalplanner.web.users.SettingsController"
|
||||
apply="org.navalplanner.web.users.settings.SettingsController"
|
||||
title="${i18n:_('User settings')}">
|
||||
|
||||
<vbox id="messagesContainer" />
|
||||
|
|
@ -40,7 +40,30 @@
|
|||
</tabs>
|
||||
<tabpanels>
|
||||
<tabpanel>
|
||||
<groupbox>
|
||||
<caption label="${i18n:_('Personal Data')}" />
|
||||
<grid fixedLayout="true" id="personalData">
|
||||
<columns>
|
||||
<column width="200px" />
|
||||
<column />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label value="${i18n:_('First name')}:" />
|
||||
<textbox id="firstName"
|
||||
value="@{settingsController.firstName}" width="300px"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('Last name')}:" />
|
||||
<textbox id="lastName"
|
||||
value="@{settingsController.lastName}" width="300px"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</groupbox>
|
||||
|
||||
<groupbox style="margin-top: 5px" closable="false">
|
||||
<caption label="${i18n:_('Application settings')}" />
|
||||
<grid fixedLayout="true" id="configurationVariables">
|
||||
<columns>
|
||||
<column width="200px" />
|
||||
|
|
@ -43,6 +43,16 @@
|
|||
value="@{controller.user.loginName}" width="300px"
|
||||
constraint="no empty:${i18n:_('cannot be null or empty')}"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('First name')}:" />
|
||||
<textbox id="firstName"
|
||||
value="@{controller.user.firstName}" width="300px"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('Last name')}:" />
|
||||
<textbox id="lastName"
|
||||
value="@{controller.user.lastName}" width="300px"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('Password')}:" />
|
||||
<textbox id="password" type="password"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue