Page 1 of 1
Reorganizing categories
Posted: Fri May 24, 2013 1:02 pm
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
Re: Reorganizing categories
Posted: Sat May 25, 2013 5:46 pm
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.
Re: Reorganizing categories
Posted: Mon Jun 03, 2013 11:43 am
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>
';
}
}
Re: Reorganizing categories
Posted: Fri Jun 07, 2013 1:15 pm
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.
Re: Reorganizing categories
Posted: Fri Jun 07, 2013 1:23 pm
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