Subversion Repositories bacoAlunos

Rev

Rev 1317 | Rev 1350 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@ page import="pt.estgp.estgweb.Globals" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<div id="contentIntranet">
<div id="contentPane">


<jomm:messages/>
<html:errors/>
<%--<jsp:useBean id="ProfileForm" class="pt.estgp.estgweb.web.form.profile.ProfileForm"/>--%>


<%
    String fromAction = "";
    if (request.getParameter("from") != null && request.getParameter("from").length() != 0)
    {
        request.setAttribute("from", "&from=" + request.getParameter("from"));
        fromAction = "From" + request.getParameter("from");
    }
    request.setAttribute("fromAction", fromAction);

    boolean regular = false;
    //separator=${separator}
%>

<div class="panel panel-default">
    <div class="panel-heading">
        <bean:message key="profile"/>
    </div>
    <div class="panel-body">


<html:form styleClass="form-horizontal" action="/user/profile${fromAction}?${from}">
<jsp:useBean id="ProfileForm" type="pt.estgp.estgweb.web.form.profile.ProfileForm" scope="request"/>
<input type="hidden" name="dispatch" value="editUser">
<html:hidden property="userView.id"/>
<html:hidden property="role"/>
<html:hidden property="typeClass"/>


<!--<table class="form">-->

<baco:isAdmin>
    <div class="form-group">
        <label class="control-label col-sm-2" for="tipoUtilizador">TIPO DE UTILIZADOR:</label>

        <label id="tipoUtilizador" class="form-control-static col-sm-10">
                    <%


                if(ProfileForm.getUserView().getUser() instanceof pt.estgp.estgweb.domain.StudentImpl)
                {
                %>
                    CLASSE ESTUDANTE
                <%
                }
                else if(ProfileForm.getUserView().getUser() instanceof pt.estgp.estgweb.domain.TeacherImpl)
                {
                %>
                    CLASSE PROFESSOR
                <%
                }
                else
                {
                    regular = true;
                %>
                    <label class="alert alert-warning">CLASSE NORMAL</label>
                <%
                }
            %>
        </label>

    </div>

    <div class="panel panel-default">
        <div class="panel-body">
            <div class="form-group">
                <label class="control-label col-sm-2" for="profileAutoBlockMode"><bean:message key="profile.autoBlockMode"/></label>
                <div class="col-sm-10">
                    <html:select styleClass="form-control" styleId="profileAutoBlockMode" property="userView.autoBlockMode">
                        <html:option value="true" key="profile.autoBlockMode.true"/>
                        <html:option value="false" key="profile.autoBlockMode.false"/>
                    </html:select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-2" for="profileAutoBlock"><bean:message key="profile.autoBlock"/></label>
                <div class="col-sm-10">
                    <html:select styleClass="form-control" styleId="profileAutoBlock" property="userView.autoBlock">
                        <html:option value="true" key="profile.autoBlock.true"/>
                        <html:option value="false" key="profile.autoBlock.false"/>
                    </html:select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-2" for="profileManualBlock"><bean:message key="profile.manualBlock"/></label>
                <div class="col-sm-10">
                    <html:select styleClass="form-control" styleId="profileManualBlock" property="userView.manualBlock">
                        <html:option value="true" key="profile.manualBlock.true"/>
                        <html:option value="false" key="profile.manualBlock.false"/>
                    </html:select>
                </div>
            </div>
        </div>
    </div>


</baco:isAdmin>
<baco:isNotAdmin>

    <div class="form-group">
        <label class="control-label col-sm-2" for="code"><bean:message key="profile.siges.code"/></label>
        <div class="col-sm-10">
            <html:text styleId="code" styleClass="form-control" property="userView.code" maxlength="250" readonly="true"/>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-sm-2" for="username"><bean:message key="username"/></label>
        <div class="col-sm-10">
            <html:text styleClass="readOnly form-control" styleId="username" property="userView.username" maxlength="250" readonly="true" />
        </div>

    </div>


    <%
    if(!Globals.USE_LDAP)
    {
    %>
    <logic:equal name="ProfileForm" property="userView.passwordLocal" value="true">
        <div class="form-group">
            <label class="control-label col-sm-2"><bean:message key="password"/></label>
            <div class="col-sm-10">
                <html:password styleClass="form-control" property="userView.password" maxlength="250"/>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-sm-2"><bean:message key="password.again"/></label>
            <div class="col-sm-10">
                <html:password styleClass="form-control" property="userView.passwordAgain" maxlength="250"/>
            </div>
        </div>


    </logic:equal>
    <%
    }
    else
    {
    %>

    <div class="form-group">
        <label class="label label-info">Sistema de autenticação externo (Rede) em uso, não é possivel modificar password. Use a sua password de Rede</label>
        <label class="control-label col-sm-2" ><bean:message key="password"/></label>
        <div class="col-sm-10">
            <html:password styleClass="form-control" property="userView.password" maxlength="250" readonly="true"/>
        </div>
    </div>
    <div class="form-group">

        <label class="control-label col-sm-2" ><bean:message key="password.again"/></label>
        <div class="col-sm-10">
            <html:password styleClass="form-control" property="userView.passwordAgain" maxlength="250" readonly="true"/>
        </div>
    </div>
    <%
    }
    %>

</baco:isNotAdmin>
<baco:isAdmin>
    <div class="form-group">
        <label class="control-label col-sm-2"><bean:message key="profile.siges.code"/></label>
        <div class="col-sm-10">
            <%
                if(regular)
                {
            %>
            <html:text styleClass="form-control" property="userView.code" maxlength="250" readonly="true"/> <br/>ESTE UTILIZADOR É NORMAL NAO TEM CODIGO SIGES
            <%
            }
            else
            {
            %>
            <html:text styleClass="form-control" property="userView.code" maxlength="250"/>
            <%
                }
            %>

        </div>
    </div>

    <%
        if(ProfileForm.getUserView().getUser() instanceof pt.estgp.estgweb.domain.StudentImpl)
        {
    %>
        <div class="form-group">
            <label class="control-label col-sm-2">Propinas em Dia:</label>

            <label class="form-control-static col-sm-10">
                <logic:equal value="true" name="ProfileForm" property="userView.propinasEmDia"><bean:message key="yes"/></logic:equal>
                <logic:equal value="false" name="ProfileForm" property="userView.propinasEmDia"><bean:message key="no"/><</logic:equal>
            </label>
        </div>
    <%
        }
    %>
    <div class="form-group">
        <label class="control-label col-sm-2"><bean:message key="username"/></label>
        <div class="col-sm-10">
            <html:text styleClass="form-control" property="userView.username" maxlength="250"/>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-2"><bean:message key="password"/></label>
        <div class="col-sm-10">
            <html:password styleClass="form-control" property="userView.password" maxlength="250"/>
        </div>
    </div>



    <div class="form-group">
        <label class="control-label col-sm-2"><bean:message key="targets"/></label>
        <div class="col-sm-8">
            <html:select styleClass="form-control" property="targetRolesStr">
                <logic:present name="ProfileForm" property="targetRoles">
                    <logic:iterate id="item" name="ProfileForm" property="targetRoles">
                        <jomm:option itemName="item" comparableObjectName="ProfileForm"
                                     comparableObjectProperty="targetRolesStr">
                            <bean:message key="user.role.${item}"/>
                        </jomm:option>
                    </logic:iterate>
                </logic:present>
            </html:select>
        </div>
        <div class="col-sm-2">
            <button type="button" class="btn btn-default" onclick="set(this.form,'addRole');this.form.submit();"><span class="glyphicon glyphicon-plus"></span></button>
        </div>
    </div>
    <div class="form-group">
        <div class="control-label col-sm-2"> </div>
        <div class="col-sm-6">
            <logic:present name="ProfileForm" property="selectedRoles">
                <logic:notEmpty name="ProfileForm" property="selectedRoles">
                    <div class="list-group">
                        <logic:iterate id="item" name="ProfileForm" property="selectedRoles">
                            <div class="list-group-item">
                                <bean:message key="user.role.${item}"/>
                                <button type="button" class="btn btn-danger btn-xs pull-right" onclick="ProfileForm.role.value='${item}';set(this.form,'removeRole');this.form.submit();"><span class="glyphicon glyphicon-remove"/></button>
                            </div>
                        </logic:iterate>
                    </div>
                </logic:notEmpty>
            </logic:present>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-2"><bean:message key="area"/></label>
        <div class="col-sm-10">
            <html:select styleClass="form-control" property="userView.mainArea">
                <option value=""></option>
                <html:option value="td" key="area.td"/>
                <html:option value="cesh" key="area.cesh"/>
                <%--<html:option value="ce" key="area.ce"/>--%>
                <%--<html:option value="ch" key="area.ch"/>--%>
                <%--<html:option value="dg" key="area.dg"/>--%>
                <%--<html:option value="eg" key="area.eg"/>--%>
            </html:select>
        </div>
    </div>
</baco:isAdmin>


<%
if(ProfileForm.getUserView().getUser() instanceof pt.estgp.estgweb.domain.TeacherImpl)
{
%>
    <div class="form-group">
        <label class="control-label col-sm-2" ><bean:message key="profile.scholar.degree"/></label>
        <div class="col-sm-10">
            <html:select  styleClass="form-control" property="userView.scholarDegree">
                <html:option value="less"><bean:message key="profile.scholar.degree.less"/></html:option>
                <html:option value="9"><bean:message key="profile.scholar.degree.9"/></html:option>
                <html:option value="12"><bean:message key="profile.scholar.degree.12"/></html:option>
                <html:option value="12.professional.course"><bean:message key="profile.scholar.degree.12.professional.course"/></html:option>
                <html:option value="superior"><bean:message key="profile.scholar.degree.superior"/></html:option>
            </html:select>
        </div>
    </div>


    <div class="form-group">
        <label class="control-label col-sm-2" ><bean:message key="profile.academic.degree"/></label>
        <div class="col-sm-10">
            <html:select styleClass="form-control" property="userView.academicDegree">
                <html:option value="Bac"><bean:message key="profile.academic.degree.Bac"/></html:option>
                <html:option value="Bac"><bean:message key="profile.academic.degree.BacEsp"/></html:option>
                <html:option value="Lic"><bean:message key="profile.academic.degree.Lic"/></html:option>
                <html:option value="LicEsp"><bean:message key="profile.academic.degree.LicEsp"/></html:option>
                <html:option value="Mas"><bean:message key="profile.academic.degree.Mas"/></html:option>
                <html:option value="MasEsp"><bean:message key="profile.academic.degree.MasEsp"/></html:option>
                <html:option value="Phd"><bean:message key="profile.academic.degree.Phd"/></html:option>n>
                <html:option value="PhdEsp"><bean:message key="profile.academic.degree.PhdEsp"/></html:option>
            </html:select>
        </div>
    </div>
<%
    }
%>
<div class="form-group">
    <label class="control-label col-sm-2" ><bean:message key="bi"/></label>
    <div class="col-sm-10">
        <html:text styleClass="readOnly form-control" property="userView.bi" maxlength="250" readonly="true" />
    </div>
</div>
<div class="form-group">
    <label class="control-label col-sm-2" ><bean:message key="birthday.date"/></label>
    <div class="col-sm-10">
        <html:text styleClass="readOnly form-control" property="birthDayDate" maxlength="100" readonly="true"/>
    </div>
</div>
<div class="form-group">
    <label class="control-label col-sm-2" ><bean:message key="name"/></label>
    <div class="col-sm-10">
        <html:text styleClass="form-control" property="userView.name" maxlength="250" readonly="true" />
    </div>
</div>
<div class="form-group">
    <label class="control-label col-sm-2" ><bean:message key="address"/></label>
    <div class="col-sm-10">
        <html:text property="userView.address" maxlength="250" />
    </div>
</div>
<div class="form-group">
    <label class="control-label col-sm-2" ><bean:message key="zip"/></label>
    <div class="col-sm-10">
        <html:text styleClass="form-control" property="userView.zip" maxlength="8" />
    </div>
</div>
<baco:isAdmin>
    <div class="form-group">
        <label class="control-label col-sm-2" ><bean:message key="office"/></label>
        <div class="col-sm-10">
            <html:text styleClass="form-control" property="userView.office" maxlength="10" />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-2" > EXT. (<bean:message key="phone.number"/>)</label>
        <div class="col-sm-10">
            <html:text styleClass="form-control" property="userView.ext" maxlength="10" />
        </div>
    </div>
</baco:isAdmin>
<baco:isNotAdmin>
    <div class="form-group">
        <label class="control-label col-sm-2" ><bean:message key="office"/></label>
        <div class="col-sm-10">
            <html:text styleClass="form-control" property="userView.office" maxlength="10" readonly="true" />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-2" > EXT. (<bean:message key="phone.number"/>)</label>
        <div class="col-sm-10">
            <html:text styleClass="form-control" property="userView.ext" maxlength="10" readonly="true"/>
        </div>
    </div>
</baco:isNotAdmin>
    <%-->--%>
    <%--<th>--%>
    <%--<bean:message key="country"/>--%>
    <%--</th>--%>
    <%--<td>--%>
    <%--<html:text property="userView.country" maxlength="100" readonly="true" styleClass="readOnly"/>--%>
    <%--</td>--%>
    <%--</tr>--%>
<div class="form-group">
    <label class="control-label col-sm-2" ><bean:message key="phone.number"/></label>
    <div class="col-sm-10">
        <html:text styleClass="form-control" property="userView.phonenumber" maxlength="250" />
    </div>
</div>

<%--


<tr>
    <th>
        <bean:message key="profile.pop3server"/>
    </th>
    <td>
        <html:text styleClass="text" property="userView.pop3server" maxlength="250"/>
    </td>
</tr>

<tr>
    <th>
        <bean:message key="profile.pop3username"/>
    </th>
    <td>
        <html:text styleClass="text" property="userView.pop3username" maxlength="250"/>
    </td>
</tr>

<tr>
    <th>
        <bean:message key="profile.pop3password"/>
        <br>
        (
        <bean:message key="profile.pop3password.warn"/>
        )
    </th>
    <td>
        <html:password styleClass="password" property="userView.pop3password" maxlength="250"/>
    </td>
</tr>
<tr>
    <th>
        <bean:message key="profile.pop3password.again"/>
    </th>
    <td>
        <html:password styleClass="password" property="userView.pop3passwordAgain" maxlength="250"/>
    </td>
</tr>
--%>
<div class="form-group">
    <label class="control-label col-sm-2" ><bean:message key="profile.skype"/></label>
    <div class="col-sm-10">
        <html:text styleClass="form-control" property="userView.skype" maxlength="250"/>
    </div>
</div>
<div class="form-group">
    <label class="control-label col-sm-2" ><bean:message key="profile.gmail"/></label>
    <div class="col-sm-10">
        <html:text styleClass="form-control" property="userView.gmail" maxlength="250"/>
    </div>
</div>
<div class="form-group">
    <label class="control-label col-sm-2" ><bean:message key="profile.msn"/></label>
    <div class="col-sm-10">
        <html:text styleClass="form-control" property="userView.msn" maxlength="250"/>
    </div>
</div>

<%--<baco:isNotAdmin>--%>
    <!--<tr>-->
        <!--<th>-->
            <%--<bean:message key="email.institucion"/>--%>
            <!--*-->
        <!--</th>-->
        <!--<td>-->
            <%--<html:text property="userView.email" maxlength="250" readonly="true" styleClass="readOnly text"/>--%>
        <!--</td>-->
    <!--</tr>-->
<%--</baco:isNotAdmin>--%>
<%--<baco:isAdmin>--%>

<div class="form-group">
    <baco:isNotAdmin>
        <label class="label label-info">
            <bean:message key="profile.email.change"/>
        </label>
    </baco:isNotAdmin>
    <label class="control-label col-sm-2" ><bean:message key="email.institucion2"/></label>
    <div class="col-sm-10">
        <baco:hasRole role="all,admin">
            <html:text styleClass="form-control" property="userView.email" maxlength="250"/>
        </baco:hasRole>
        <baco:hasNotRole role="all,admin">
            <html:text styleClass="form-control" property="userView.email" maxlength="250" readonly="true"/>
        </baco:hasNotRole>
    </div>
</div>
<div class="form-group">
    <label class="control-label col-sm-2" ><bean:message key="email.secundary"/></label>
    <div class="col-sm-10">
        <html:text styleClass="form-control" property="userView.outEmail" maxlength="250"/>
    </div>
</div>
<%--</baco:isAdmin>--%>


<button type="button" class="btn btn-default" onclick="set(this.form,'editUser');this.form.submit()"><bean:message key="confirm"/></button>
<button type="button" class="btn btn-danger" onclick="window.history.back()"><bean:message key="cancel"/></button>

</html:form>


    </div> <!--End panel-body-->
</div> <!--End panel-->
<%--
<logic:present name="ProfileForm" property="userView.courses">
    <ul>
        <logic:iterate id="course" name="ProfileForm" property="userView.courses">
            <li>
                <bean:write name="course" property="name"/>
                <ul>
                    <logic:iterate id="courseUnit" name="course" property="courseUnits">
                        <li>
                            (<bean:write name="courseUnit" property="importYear"/>) <html:link action="${user}/startLoadCourseUnit${fromAction}?courseUnitView.id=${courseUnit.id}"><bean:write name="courseUnit" property="name"/> (<bean:write name="courseUnit" property="code"/>)</html:link>
                        </li>
                    </logic:iterate>
                </ul>
            </li>
        </logic:iterate>
    </ul>
</logic:present>--%>
</div>
</div>

Generated by GNU Enscript 1.6.5.2.