Skip to content

Commit

Permalink
Move assigned projects outside of form
Browse files Browse the repository at this point in the history
Move the list of assigned projects outside of the form in account_page.
This list is not editable, so it must not be part of the form.

Fixes: #21552
  • Loading branch information
cproensa authored and vboctor committed Mar 27, 2017
1 parent 62f13d0 commit 665f665
Showing 1 changed file with 45 additions and 21 deletions.
66 changes: 45 additions & 21 deletions account_page.php
Expand Up @@ -258,27 +258,6 @@
<?php echo get_enum_element( 'access_levels', current_user_get_access_level() ); ?>
</td>
</tr>
<?php
$t_projects = user_get_assigned_projects( auth_get_current_user_id() );
if( count( $t_projects ) > 0 ) {
echo '<tr>';
echo '<td class="category">' . lang_get( 'assigned_projects' ) . '</td>';
echo '<td>';
foreach( $t_projects AS $t_project_id=>$t_project ) {
$t_project_name = string_attribute( $t_project['name'] );
$t_view_state = $t_project['view_state'];
$t_access_level = $t_project['access_level'];
$t_access_level = get_enum_element( 'access_levels', $t_access_level );
$t_view_state = get_enum_element( 'project_view_state', $t_view_state );

echo '<div class="col-md-3 col-xs-6 no-padding">' . $t_project_name . '</div> <div class="col-md-9 col-xs-6"><span class="label label-default">' . $t_access_level . '</span><span class="bold padding-left-4">' . $t_view_state . '</span></div>';
echo '<div class="clearfix"></div>';
echo '<div class="space-4"></div>';
}
echo '</td>';
echo '</tr>';
}
?>
</fieldset>
</table>
</div>
Expand All @@ -294,6 +273,51 @@
</div>
</div>

<?php
$t_projects = user_get_assigned_projects( auth_get_current_user_id() );
if( !empty( $t_projects ) ) {
?>
<div class="space-10"></div>

<div class="widget-box widget-color-blue2">
<div class="widget-header widget-header-small">
<h4 class="widget-title lighter">
<i class="ace-icon fa fa-user"></i>
<?php echo lang_get( 'assigned_projects' ) ?>
</h4>
</div>
<div class="widget-body">
<div class="widget-main no-padding">
<div class="table-responsive">
<table class="table table-bordered table-condensed table-striped">
<?php
echo '<tr>';
echo '<td class="category">' . lang_get( 'assigned_projects' ) . '</td>';
echo '<td>';
foreach( $t_projects AS $t_project_id => $t_project ) {
$t_project_name = string_attribute( $t_project['name'] );
$t_view_state = $t_project['view_state'];
$t_access_level = $t_project['access_level'];
$t_access_level = get_enum_element( 'access_levels', $t_access_level );
$t_view_state = get_enum_element( 'project_view_state', $t_view_state );

echo '<div class="col-md-3 col-xs-6 no-padding">' . $t_project_name . '</div>'
. '<div class="col-md-9 col-xs-6">'
. '<span class="label label-default">' . $t_access_level . '</span>'
. '<span class="bold padding-left-4">' . $t_view_state . '</span></div>';
echo '<div class="clearfix"></div>';
echo '<div class="space-4"></div>';
}
echo '</td>';
echo '</tr>';
?>
</table>
</div>
</div>
</div>
</div>
<?php } ?>

</form>
</div>

Expand Down

0 comments on commit 665f665

Please sign in to comment.