Loading...
 

TrackersCreateOnlyHack

1) insert new row in users_permissions:

permName: tiki_p_view_tracker_items
permDesc: Can view tracker items
level: basic
type: trackers

note: tiki_p_view_trackers now applies only to listing display on tiki-list_trackers.php

2) modify tiki-view_tracker.php:

  • eliminate tiki_p_view_trackers die block:

if ($tiki_p_view_trackers != 'y') {
$smarty->assign('msg', tra("You dont have permission to use this feature"));
$smarty->display("error.tpl");
die;
}

  • after new item entry, jump to confirmation screen if permissions are create-only

$smarty->assign('itemId', '');

if($tiki_p_view_tracker_items != 'y') {
$smarty->assign('msg',tra("Your entry has been stored."));
$smarty->display("styles/$style_base/noerror.tpl");
die;
}

  • suppress display of current items if we don't have permission

$smarty->assign_by_ref('ins_fields', $ins_fields%22data%22);

if($tiki_p_view_tracker_items == 'y')
{

if (!isset($_REQUEST%22sort_mode%22)) {
.
.
.

}

ask_ticket('view-trackers');

3) modify templates/tiki-view_tracker.tpl:

  • suppress display of current items GUI if permission is not set

{if $tiki_p_view_tracker_items eq 'y'}

{tr}Tracker Items{/tr}

.
.
.

{/if}

End of file

4) create templates/noerror.tpl, same as error.tpl except:


{tr}Error{/tr}


{tr}Life is good!{/tr}


5) for each active theme, copy noerror.tpl to templates/styles/[theme]


6) assign group or object permissions to specify listing of trackers and creation, viewing of items.



I will attach final modified source files and Unix diff files.

Created by: Last Modification: Saturday 14 January 2006 17:00:17 GMT-0000 by jcyrisse
List Slides