Reorganizing categories

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
akwil
Posts: 24
Joined: Fri May 24, 2013 10:00 am

Reorganizing categories

Post by akwil »

Script version: 2.4.2

Hello,

I have another question about CATEGORIES.
I have more than 100 categories in Hesk.
The problem is that I need to group them...
My structure looks like this:

Skype
* skype credits
* skype - account creation
* etc.
Office
*
*
*
Etc…

Problem starts when I want to add more categories (at the beginning).
Because pressing the up arrow 100 times makes me nervous.

Is there any better way to do that?
I have connected with MySQL database and i see that everything is there.
But I am not sure if I change there (add new row) on top…. It will not crash.

Thank you for your time,
Artur
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Reorganizing categories

Post by Klemen »

You can add new categories directly in the database, but HESK will still use the value of "cat_order" column to order categories.

Perhaps you can manually modify the links that move categories up/down by increasing the value of "move" parameter.

For example to move a category HESK generates a link such as
manage_categories.php?a=order&catid=4&move=-15&token=03c4af9eb6263da69fd65dce586b0d3bb116eede

Instead of "move=-15" you can try "move=-150" to move 10 rows at a time.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
akwil
Posts: 24
Joined: Fri May 24, 2013 10:00 am

Re: Reorganizing categories

Post by akwil »

Thank you Klemen for you reply.
There are 2 places to change it.
I should change it in both places?

I have check it and it works.
But i was wondering if it should be like this:

if ($num > 1)
{
if ($j == 1)
{
echo'<img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" />
<a href="manage_categories.php?a=order&catid='.$mycat
'id'].'&move=15&token='.hesk_token_echo(0).'"><img src="../img/move_down.png" width="16"
height="16" alt="'.$hesklang['move_dn'].'" title="'.$hesklang['move_dn'].'" '.$style.' /></a>';
}
elseif ($j == $num)
{
echo'<a href="manage_categories.php?a=order&catid='.$mycat['id'].'&
move=-150&token='.hesk_token_echo(0).'"><img src="../img/move_up.png" width="16"
height="16"
alt="'.$hesklang['move_up'].'" title="'.$hesklang['move_up'].'" '.$style.' /></a> <img
src="../img/blank.gif"
width="16" height="16" alt="" style="padding:3px;border:none;" />';
}
else
{
echo'
<a href="manage_categories.php?a=order&catid='.$mycat['id'].'&move=-
150
&token='.hesk_token_echo(0).'"><img src="../img/move_up.png" width="16" height="16"
alt="'.$hesklang['move_up'].'" title="'.$hesklang['move_up'].'" '.$style.' /></a>
<a href="manage_categories.php?a=order&catid='.$mycat['id'].'&move=15&token='.hesk_token_echo(0).'"><img src="../img/move_down.png" width="16" height="16" alt="'.$hesklang['move_dn'].'" title="'.$hesklang['move_dn'].'" '.$style.' /></a>
';
}
}
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Reorganizing categories

Post by Klemen »

I personally wouldn't change the code, just the link (copied from browser).

For example in your browser copy the link that Hesk generates then modify the value before opening it.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
akwil
Posts: 24
Joined: Fri May 24, 2013 10:00 am

Re: Reorganizing categories

Post by akwil »

Thank you Klemen for your time to reply.
I have modyfied the code (of course i have created a copy of the file first) and it works great.
Up arrow moves the cattegories 10up. And down arrow one down so perfect:)

Once again thank you for your help.
Great job you are doing! Go on!

Artur Kwil
Post Reply