OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Disable Track Director permission ti push "Complete" button

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

Disable Track Director permission ti push "Complete" button

Postby bronskyblu » Sun Nov 13, 2011 1:20 pm

Hi to everybody,
my Director asked me to let him to complete the review process of each paper, specifically he would like to remove the track director ability of complete it by pushing the "Complete" button that you can find in the bottom of the Director and Track Director paper review form. Do you think is it possible and, in this case, is it possible without dangerous actions (conference is on going)?
Thanks a lot (also for your work).
Cheers,

gabriele
bronskyblu
 
Posts: 14
Joined: Sun Oct 03, 2010 4:36 am

Re: Disable Track Director permission ti push "Complete" button

Postby jmacgreg » Thu Nov 17, 2011 5:33 pm

Hi Gabriele,

It shouldn't be a problem -- what you would need to do is put a conditional around that particular block in the relevant template file to display it only when the user is a full Director. Let us know if you need any pointers on how to do this.

Cheers,
James
jmacgreg
 
Posts: 4162
Joined: Tue Feb 14, 2006 10:50 am

Re: Disable Track Director permission ti push "Complete" button

Postby bronskyblu » Mon Nov 21, 2011 6:17 am

Hi James,
thanks for your reply.

I found the block I want to put in the conditional sintax but I did not find the right way to do it: I was thinking something easy like

{if $isSiteAdmin}
... block....
{/if}

should be fine, 'cause it work well for the site admin. At the contrary, the corresponding form for Director and track director (i.e. {if $isDirector} and {if $isTrackDirector}) don't seem to produce any consequence. I'm not familiar with template programming so I have no idea if it's just a syntax problem (isDirector and isTrackDirector variable do not exist; I found the former but not the latter) or I need to create the right context (call some variables or something like this). So any suggestion is welcome.
Cheers,

Gabriele
bronskyblu
 
Posts: 14
Joined: Sun Oct 03, 2010 4:36 am

Re: Disable Track Director permission ti push "Complete" button

Postby bronskyblu » Mon Nov 28, 2011 2:36 pm

Hi James,
sorry for bother you again. I wonder if you think there is some available option to easily make the changes I need, without upsetting the code.
Thank you so much.


Gabriee
bronskyblu
 
Posts: 14
Joined: Sun Oct 03, 2010 4:36 am

Re: Disable Track Director permission ti push "Complete" button

Postby jmacgreg » Mon Nov 28, 2011 3:11 pm

Hi Gabriele,

When you added the $isDirector if statement to the text, did you test the end result with a user who was only enrolled as a track director? If a user is enrolled as a director at all they would pass the test, regardless of whether they were assigned to the submission as a director or track director. If you could provide the modification itself here, I'd appreciate it.

Cheers,
James
jmacgreg
 
Posts: 4162
Joined: Tue Feb 14, 2006 10:50 am

Re: Disable Track Director permission ti push "Complete" button

Postby bronskyblu » Wed Nov 30, 2011 4:21 pm

Hi James, thanks for your reply.

I tried to modify this file: "ocs>templates>trackDirector>submission>directorDecision.tpl"
by adding, in the last few lines, {if $isDirector} ... {/if} to let the director only to view (and push) the file "complete.tpl", containig the "complete" button. This is the code (I used anytime cut&copy to avoid typing issues):

Code: Select all
{if $isFinalReview}
   {if $isDirector}
      <div class="separator"></div>

      {include file="trackDirector/submission/complete.tpl"}
   {/if}
   <div class="separator"></div>

   {include file="trackDirector/submission/layout.tpl"}
{/if}


Unluckily it does not seem to work: logging as director or track director it gives me back a negative result (in both cases anything between {if $isDirector} ... {/if} is not visible). I did not add "Director" feature to my profile, so I cannot see this form as Site Administrator.

Hence my boss asked me to apply the same philosophy to the user home, to give different instructions to trackdirectors and reviewers simply by adding different links, I used the same idea, putting these links between {if $isTrackDirector} ... {/if} and {if $isReviewer}...{/if}. So I did the test: I added to the file "ocs>templates>user>index.tpl" the following code lines just before <div id="myAccount"> (easy to know!)

Code: Select all
{if $isSiteAdmin}
SA
{/if}
{if $isDirector}
D
{/if}
{if $isTrackDirector}
TD
{/if}
{if $isReviewer}
R
{/if}


(the letter are just identifier for the user role).
Once uploaded, I logged in with four different account kind (Site admin, Director, Track director and reviewer). The only letters I read was "SA" when I was logged as Site admin.

That's all. Really, first, it seemed to be to much easier and till now I don't have the key of the problem (or simply the way is just a little bit harder for my tpl un-knowledge).
Thanks,


Gabriele
bronskyblu
 
Posts: 14
Joined: Sun Oct 03, 2010 4:36 am

Re: Disable Track Director permission ti push "Complete" button

Postby mcrider » Thu Dec 01, 2011 5:21 pm

Hi Gabriele,

When using variables in templates, you need to trace your way back to the controller that calls the template to make sure the controller is assigning the variable (making it available) to the template (or check classes/template/TemplateManager.inc.php to see if the variable is assigned there).

For your case, you can assign the 'isDirector' variable in the controller that calls your template (pages/trackDirector/SubmissionEditHandler::submissionReview(), which loads your template via the trackDirector/submissionReview.tpl template), or assign it in the generic TemplateManager constructor (which assigns variables to all templates in the system). You should be able to do it with this:

$templateMgr->assign('isDirector', Validation::isDirector());

(If you do it in TemplateManager.inc.php, replace '$templateMgr' with '$this' -- there are many examples in these parts of the code).

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: Disable Track Director permission ti push "Complete" button

Postby bronskyblu » Fri Dec 02, 2011 5:41 pm

Thank you so much Matt: both your suggestions work pretty well!

Cheers,

Gabriele
bronskyblu
 
Posts: 14
Joined: Sun Oct 03, 2010 4:36 am


Return to OCS Technical Support

Who is online

Users browsing this forum: No registered users and 1 guest