[BUG] repeatHeaderCount (incl. fix)

If you need support with TeamCal Pro (installation, configuration, usage) post your request here.
Post Reply
Heart1010
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: 2012-05-07, 16:38
Are you a spam bot?: No

[BUG] repeatHeaderCount (incl. fix)

Post by Heart1010 » 2012-06-25, 17:20

Hi,

a small bug with repeatHeaderCount config setting.

$intCurrentUserCount and $intPageUserCount are incremented right now for every user and only then, after that, there is the check if the user is hidden :? :wink:
Therefor the setting for repeatHeaderCount is interpreted wrong.

So I changed in file /include/showmonth.function.php (line ~607)
foreach ($users as $usr)
{
$intCurrentUserCount++;
$intPageUserCount++;
$monthBody='';
$U->findByName($usr['user']);
//print($usr['group']."|".$usr['user'].'<br>');

if ( !($U->status&$CONF['USHIDDEN']) )
{
if ( checkAuth("viewCalendar",$U->username) )
{
to
foreach ($users as $usr)
{
//$intCurrentUserCount++;
//$intPageUserCount++;

$monthBody='';
$U->findByName($usr['user']);
//print($usr['group']."|".$usr['user'].'<br>');

if ( !($U->status&$CONF['USHIDDEN']) )
{
$intCurrentUserCount++;
$intPageUserCount++;


if ( checkAuth("viewCalendar",$U->username) )
{
and everything works like it should!

User avatar
George
Platinum Boarder
Platinum Boarder
Posts: 420
Joined: 2004-11-29, 21:20
Are you a spam bot?: No
Contact:

Re: [BUG] repeatHeaderCount (incl. fix)

Post by George » 2012-06-29, 22:30

Hi Heart1010
nice find! Thanks for sharing. WIll fix that in the next release.
Best regards,
George

schmidts
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 2012-08-17, 10:11
Are you a spam bot?: No

Re: [BUG] repeatHeaderCount (incl. fix)

Post by schmidts » 2012-08-20, 09:11

Hello,

i have just downloaded and installed tcpro version 3.4.0000 but i still got this error.

you have to move these two rowes a little bit more down to really take effect and to solve this problem:

orig:

Code: Select all

    foreach ($users as $usr)
        {
                $monthBody='';
                $U->findByName($usr['user']);
                //print($usr['group']."|".$usr['user'].'|curusercount:'.$intCurrentUserCount.'|pageusercount:'.$intPageUserCount.'<br>');

                if ( !($U->status&$CONF['USHIDDEN']) )
                {
                        $intCurrentUserCount++;
                        $intPageUserCount++;

                        if ( checkAuth("viewCalendar",$U->username) )
                        {
                                $intThisUsersPage = floor($intCurrentUserCount/$intUsersPerPage) + 1;
change to this fixed the problem for me:

Code: Select all

foreach ($users as $usr)
        {
                $monthBody='';
                $U->findByName($usr['user']);
                //print($usr['group']."|".$usr['user'].'|curusercount:'.$intCurrentUserCount.'|pageusercount:'.$intPageUserCount.'<br>');

                if ( !($U->status&$CONF['USHIDDEN']) )
                {

                        if ( checkAuth("viewCalendar",$U->username) )
                        {
                                $intCurrentUserCount++;
                                $intPageUserCount++;
                                $intThisUsersPage = floor($intCurrentUserCount/$intUsersPerPage) + 1;
sorry if the tabs are not exactly the same as in the orig file but for me it looked like there was a missing } somewhere and i wasnt able to find it, so i changed the order of tabs to make it easier.

maybe you can bring this change into the next version.

best regards

stefan

User avatar
George
Platinum Boarder
Platinum Boarder
Posts: 420
Joined: 2004-11-29, 21:20
Are you a spam bot?: No
Contact:

Re: [BUG] repeatHeaderCount (incl. fix)

Post by George » 2012-08-20, 09:45

Thanks schmidts for the find. Looks correct to me on first glimpse. I missed the hidden calendar check.

Post Reply