News:

Looking for a good read? Check out the SimpleDesk Team Blog.

Main Menu

'Helpdesk Profile' in Menu Bar

Started by Mari-chi, August 09, 2011, 10:20:16 PM

Previous topic - Next topic

Mari-chi

I was wondering where I could locate that in Subs.php? Is it even in Subs.php? ???
I was trying to add a menu item below 'Helpdesk Profile' under the 'Profile' tab on my forum's menu bar, but it was not under the Profile array.

Thanks for any input!

Gruffen

Which menu bar?

If you mean the main menu bar that's on every page, that's Subs.php. If you mean the menu bar inside the profile area only, that's a heck load more complicated.

Either way I'd suggest modifying SD's code, rather than SMF's because SD does a *lot* of things to get round not having to do it in SMF.

What should the new item be, where should it go and should it be permission related in some way?

Mari-chi

Right now the menu bar at the top (from Subs.php) looks like this:

Profile
--> Summary
--> Account Settings
--> Forum Profile
--> Helpdesk Profile

When I go to Subs.php, I can't find 'Helpdesk Profile' under the 'Profile' array. :S I wanted to add another menu item called 'Bookmarks' under 'Helpdesk Profile' so that it looks like this:

Profile
--> Summary
--> Account Settings
--> Forum Profile
--> Helpdesk Profile
--> Bookmarks

Or, get rid of 'Helpdesk Profile' altogether under the Profile menu item, if that's possible.


Thanks for the quick reply!

Gruffen

QuoteWhen I go to Subs.php, I can't find 'Helpdesk Profile' under the 'Profile' array.

No, because it isn't there. One of the big changes in SD 2.0 is to avoid file edits, so it's done totally in SD code. (Just be aware, of course, that SD 2.0 final is coming soon)

To remove the item entirely from the main menu, find this line inside function shd_main_menu in Subs-SimpleDesk.php (it's in the Sources/sd_source folder)

if (shd_allowed_to(array('shd_view_profile_own', 'shd_view_profile_any'), 0))

Change that to:
if (false && shd_allowed_to(array('shd_view_profile_own', 'shd_view_profile_any'), 0))

As for editing the menu, you can then just edit it in Subs.php normally by adding to the sub_buttons list. I'd provide more of the code but I don't know whether it should be permission based or where the link should go...

Mari-chi

Unfortunately I don't see that in Subs-SimpleDesk.php. ???

It could just be me being stupid. ㅠㅠ I've attached the file; could you tell me if you can find it? :S

Gruffen

Hang on, what version are you using?

The fact you have a profile area suggests you're running a 2.0 build but the attached file is from 1.0... really confused now.

Mari-chi

@_@ I actually have no clue. I got a different version from a friend, before 2.0 was officially released. In my package manager area, it says 'SVN r48', and in the Helpdesk admin area, it says 'Simpledesk 1.0 felidae'. It was a test version, I think... Not sure now, because I got it way back in... January, if I remember correctly. It wasn't released to the public, to the best of my knowledge.

Gruffen

Yeah, which means it's a total mutant and one that isn't going to be properly supported since everything has changed since then.

Upgrade to 2.0 RC1. Not only do you get a large-ish number of new features, but certain innards will actually work properly (there is, interestingly enough, a minor security defect in versions that old but I corrected it when fixing department support, namely that things can be permanently deleted without the user having the right permission if they're smart enough to do so)

Mari-chi

Aw darn. D: Will all the information in the Helpdesk (ex. permissions, groups, tickets) be lost when I uninstall it and reinstall the newer version?

Gruffen

No, it will should all be retained.

Mari-chi

Okay thanks! One last question: When I go to download it, it says that it's only for 2.0 final, and that lower versions won't be supported. Will it work on 2.0 RC5?

Gruffen

Not without other code changes; there are changes specifically in SD to cope with changes between RC5 and final; honestly you really should look at upgrading as there are security related fixes in there.

Mari-chi

#12
I would, but I modified 2.0 RC5 a lot--and the worst part? All without documenting the changes. u_u So I'm totally stuck.

Thanks for the quick support though, Gruffen. :)

P.S. Could you tell me how to remove the 'helpdesk profile' item from the 'profile' section of the menu in my Helpdesk version?

Gruffen

QuoteI would, but I modified 2.0 RC5 a lot--and the worst part? All without documenting the changes. u_u So I'm totally stuck.

Not really you're not. All you need to do is download a copy of RC5, download a copy of final, and run a file comparison between them, then apply the changes made file by file. It is not for the faint of heart to do but it isn't actually as big a job as it sounds. I did this for RC3 to RC5 and it took me a day and a half - but I had to keep the site running at the same time (as it was a professional site, and couldn't afford any downtime on it at the time)

Moving from RC5 to final is mostly tedious changes, rather than big sweeping bug fixes.

QuoteP.S. Could you tell me how to remove the 'helpdesk profile' item from the 'profile' section of the menu in my Helpdesk version?

If I could figure out how bastardised your version is, then I'd be able to tell you, since I know I rewrote it quite a bit after the version you seem to have (like rewrote most of the permissions stuff, not to mention most of the profile stuff). Certainly, it predates the multiple-departments support, it predates most of the custom field support and looking at it...

It's going to be in Subs.php, in the usual function, but in the code that comes after the normal menu itself. You should be able to find it by searching Subs.php for area=helpdesk. But of course that's also going to foul up if/when you get round to uninstalling for installing 2.0 since the code is completely different in 2.0.


Ideally, what you should do is remove your mutant version of SD, and install SD 2.0 RC1 (or final, it's going to be out next week), and here's the change you need to make it work on 2.0 RC5 properly. This is, AFAIR, the only change.

sd_template/SimpleDesk-Post.template.php
Code (find) Select
if ($editor_context['width'] == ((int) $editor_context['width']) . '%')
{
$width = round(((int) $editor_context['width']) / 0.988, 1);
echo '
<div style="width: ', $width, '%;">', template_control_richedit($context['post_box_name'], 'shd_smileybox', 'shd_bbcbox'), '</div>';
}
// Editor width isn't proportional, presumably we don't care.
else
echo template_control_richedit($context['post_box_name'], 'shd_smileybox', 'shd_bbcbox');


Code (replace) Select
echo template_control_richedit($context['post_box_name'], 'shd_smileybox', 'shd_bbcbox');

You may need to use version emulation to make it work, though. Then you can use the change I posted earlier to remove that menu item.

Mari-chi

ㅠㅠ Man that really doesn't sound like it's for the faint of heart. *faint of heart* lol.

Thank you for helping me through this! ^^ I found that bit in Subs.php, and managed to hide that menu item. Q_Q I'll try to update RC5 if I can work up the nerve...

Thanks again! <3