Skip to content

Commit 6bb5fd5

Browse files
committed
Minor - Add one anchor column to fields table to focus directly on the last field changed (more userfriendly)
1 parent 1c99701 commit 6bb5fd5

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

main/admin/user_fields.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@
157157
$table->set_header(7, get_lang('FieldChangeability'), false);
158158
$table->set_header(8, get_lang('FieldFilter'), false);
159159
$table->set_header(9, get_lang('Modify'), false);
160+
$table->set_header(10, '', false);
160161
$table->set_column_filter(5, 'order_filter');
161162
$table->set_column_filter(6, 'modify_visibility');
162163
$table->set_column_filter(7, 'modify_changeability');
@@ -210,14 +211,14 @@ function order_filter($field_order,$url_params,$row)
210211
$return = '';
211212
// the up icon only has to appear when the row can be moved up (all but the first row)
212213
if ($row[5]<>1) {
213-
$return .= '<a href="'.api_get_self().'?action=moveup&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'">'.Display::return_icon('up.gif', get_lang('Up')).'</a>';
214+
$return .= '<a href="'.api_get_self().'?action=moveup&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'#'.$row[0].'">'.Display::return_icon('up.gif', get_lang('Up')).'</a>';
214215
} else {
215216
$return .= Display::return_icon('blank.gif','',array('width'=>'21px'));
216217
}
217218

218219
// the down icon only has to appear when the row can be moved down (all but the last row)
219220
if ($row[5]<>$number_of_extra_fields) {
220-
$return .= '<a href="'.api_get_self().'?action=movedown&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'">'.Display::return_icon('down.gif', get_lang('Down')).'</a>';
221+
$return .= '<a href="'.api_get_self().'?action=movedown&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'#'.$row[0].'">'.Display::return_icon('down.gif', get_lang('Down')).'</a>';
221222
}
222223
return $return;
223224
}
@@ -230,7 +231,7 @@ function order_filter($field_order,$url_params,$row)
230231
*/
231232
function modify_visibility($visibility,$url_params,$row)
232233
{
233-
return ($visibility?'<a href="'.api_get_self().'?action=hide_field&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'">'.Display::return_icon('visible.gif', get_lang('Hide')).'</a>':'<a href="'.api_get_self().'?action=show_field&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'">'.Display::return_icon('invisible.gif', get_lang('Show')).'</a>');
234+
return ($visibility?'<a href="'.api_get_self().'?action=hide_field&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'#'.$row[0].'">'.Display::return_icon('visible.gif', get_lang('Hide')).'</a>':'<a href="'.api_get_self().'?action=show_field&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'#'.$row[0].'">'.Display::return_icon('invisible.gif', get_lang('Show')).'</a>');
234235
}
235236
/**
236237
* Modify the changeability field to show links and icons
@@ -241,13 +242,13 @@ function modify_visibility($visibility,$url_params,$row)
241242
*/
242243
function modify_changeability($changeability,$url_params,$row)
243244
{
244-
return ($changeability?'<a href="'.api_get_self().'?action=freeze_field&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'">'.Display::return_icon('right.gif', get_lang('MakeUnchangeable')).'</a>':'<a href="'.api_get_self().'?action=thaw_field&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'">'.Display::return_icon('wrong.gif', get_lang('MakeChangeable')).'</a>');
245+
return ($changeability?'<a href="'.api_get_self().'?action=freeze_field&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'#'.$row[0].'">'.Display::return_icon('right.gif', get_lang('MakeUnchangeable')).'</a>':'<a href="'.api_get_self().'?action=thaw_field&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'#'.$row[0].'">'.Display::return_icon('wrong.gif', get_lang('MakeChangeable')).'</a>');
245246
}
246247

247248
function modify_field_filter ($changeability,$url_params,$row)
248249
{
249-
return ($changeability?'<a href="'.api_get_self().'?action=filter_off&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'">'.Display::return_icon('right.gif', get_lang('FilterOff')).'</a>':'' .
250-
'<a href="'.api_get_self().'?action=filter_on&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'">'.Display::return_icon('wrong.gif', get_lang('FilterOn')).'</a>');
250+
return ($changeability?'<a href="'.api_get_self().'?action=filter_off&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'#'.$row[0].'">'.Display::return_icon('right.gif', get_lang('FilterOff')).'</a>':'' .
251+
'<a href="'.api_get_self().'?action=filter_on&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'#'.$row[0].'">'.Display::return_icon('wrong.gif', get_lang('FilterOn')).'</a>');
251252
}
252253

253254
function edit_filter($id, $url_params, $row) {

main/inc/lib/usermanager.lib.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1667,7 +1667,8 @@ public static function get_extra_fields($from = 0, $number_of_items = 0, $column
16671667
6 => $rowf['field_visible'],
16681668
7 => $rowf['field_changeable'],
16691669
8 => $rowf['field_filter'],
1670-
9 => array()
1670+
9 => array(),
1671+
10 => '<a name="'.$rowf['id'].'"></a>',
16711672
);
16721673

16731674
$sqlo = "SELECT * FROM $t_ufo WHERE field_id = ".$rowf['id']." ORDER BY option_order ASC";

0 commit comments

Comments
 (0)