[FIX] ZM 1.24.2: Missing progress bar for certain users

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

[FIX] ZM 1.24.2: Missing progress bar for certain users

Post by mastertheknife »

How to reproduce:
In user options, make a user unable to edit events by setting Events:Edit to Events:View and then try to watch an event, the progress bar will be missing.
This is caused by an error in a javascript file. ZM hides the archive\unarchive buttons for users that can't edit events and this causes an error and halts the javascript execution.

In file skins/classic/views/js/event.js, edit the following, which starts at around line 259 (May vary from installation to installation)
Change it from:

Code: Select all

    if ( parseInt(event.Archived) )
    {
        $('archiveEvent').addClass( 'hidden' );
        $('unarchiveEvent').removeClass( 'hidden' );
    }
    else
    {
        $('archiveEvent').removeClass( 'hidden' );
        $('unarchiveEvent').addClass( 'hidden' );
    }
To:

Code: Select all

	 if ( canEditEvents ) {
    if ( parseInt(event.Archived) )
    {
        $('archiveEvent').addClass( 'hidden' );
        $('unarchiveEvent').removeClass( 'hidden' );
    }
    else
    {
        $('archiveEvent').removeClass( 'hidden' );
        $('unarchiveEvent').addClass( 'hidden' );
    }
    }
mastertheknife.
Post Reply