Loading...
 

TrackersCreateOnlyHack

DB table insert:

  • users_permissions


changed files:

  • tiki-view_tracker.php
  • templates/tiki-view_tracker.tpl


new file:

  • templates/noerror.tpl
  • templates/styles/[yourthemes]/noerror.tpl


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'}

<h3>Tracker Items{/tr}</h3>

.
.
.

{/if}

End of file

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

<div class="cbox-title">


Error{/tr}


Life is good!{/tr}

</div>


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.


Page last modified on Saturday 14 January 2006 17:00:17 GMT-0000

Upcoming Events

No records to display

Why Register?

Register at tiki.org and you'll be able to use the account at any *.tiki.org site, thanks to the InterTiki feature. A valid email address is required to receive site notifications and occasional newsletters. You can opt out of these items at any time.