Sugesstion for sorting

Phoca Download - download manager
jamfx
Phoca Enthusiast
Phoca Enthusiast
Posts: 61
Joined: 08 Mar 2009, 09:26
Contact:

Sugesstion for sorting

Post by jamfx »

Hi Jan,

this time, I want to make a suggestion for an improvement of PhocaDownloads.

I have a lot of downloads in a lot of categories. The phsical folder structure looks like this:
- Category A
\-> 2011
\-> 2010
\-> 2009
- Category B
\-> 2011
\-> 2010
\-> 2009
- Category C
\-> 2011
\-> 2010
\-> 2009
[....]

Now, if you click on the Editor-Button, PhocaDownloads goes crazy on sorting the Folders... It's simply impossible to find the proper Folder, because a lot of folders are named identicaly. The are sorted somehow (mysticaly for me).

To improve this, I would suggest to use the Alias or the Name from the Backend. Maybe it's even better to show the structured folders from backend.

Thanks
JamFX
Last edited by jamfx on 24 Nov 2011, 09:26, edited 1 time in total.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48595
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Sugesstion for sorting

Post by Jan »

Hi, physical folder structure is not sorted, like by file manager, all your folder structure is displayed. :idea: e.g. in multiple add feature

Jan
If you find Phoca extensions useful, please support the project
jamfx
Phoca Enthusiast
Phoca Enthusiast
Posts: 61
Joined: 08 Mar 2009, 09:26
Contact:

Re: Sugesstion for sorting

Post by jamfx »

No, sorry, it's not sorted. It looks like this:
http://imageshack.us/photo/my-images/696/unsorted.png/

It's the latest Joomla 1.7 Version. This view is seen, if you write an article and use a the Download-Editor-Button to insert a download in an Article.

Thanks for your help / review.
JamFX
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48595
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Sugesstion for sorting

Post by Jan »

Aha, now I know what you mean. The sorting of tree (which was added in some previous version) was removed because tree didn't follow the ACL - the rights needs to be checked for every category.

So you can change the sorting here:
administrator\components\com_phocadownload\models\fields\phocadownloadcategory.php

Jan
If you find Phoca extensions useful, please support the project
jamfx
Phoca Enthusiast
Phoca Enthusiast
Posts: 61
Joined: 08 Mar 2009, 09:26
Contact:

Re: Sugesstion for sorting

Post by jamfx »

Hi,
thanks Jan for your reply. I found in the mentioned file line 29:

Code: Select all

. ' ORDER BY a.ordering';
Which options do I have to sort? I would like to have a nice treeview if possible... Or can I just order them as I have the folder structure in my first post?

Thanks.
JamFX
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48595
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Sugesstion for sorting

Post by Jan »

Hi, depends on you. E.g. ORDER BY a.title ASC or ORDER BY a.title DESC, etc.

Jan
If you find Phoca extensions useful, please support the project
jamfx
Phoca Enthusiast
Phoca Enthusiast
Posts: 61
Joined: 08 Mar 2009, 09:26
Contact:

Re: Sugesstion for sorting

Post by jamfx »

Hi Jan,

is there an overview somewhere where I can find all possible sortings and their meanings?
Thx
JamFX
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48595
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Sugesstion for sorting

Post by Jan »

Hi, I think you need to see some mysql manual and see tables in database where you can see by which columns you can order.

Jan
If you find Phoca extensions useful, please support the project
jamfx
Phoca Enthusiast
Phoca Enthusiast
Posts: 61
Joined: 08 Mar 2009, 09:26
Contact:

Re: Sugesstion for sorting

Post by jamfx »

Hi Jan,
first, I hope you had a nice Xmas and had a fiew days off, so you could regain power, with family and a good dinner :)

But i just faced the problem again. I am not into SQL and Table-THings like you. Hopefully you will find a solution for this mess. I can not explain how hard it is to use the Phoca-Download with this issue. PLease find a way. I think - >THIS IS A BUG <- not a sorting problem at all...
So hopefully you can do something about it, please!!! :(

Thanks a lot
JamFX
SonRiab
Phoca Professional
Phoca Professional
Posts: 258
Joined: 02 Jun 2011, 09:29
Contact:

Re: Sugesstion for sorting

Post by SonRiab »

Moin jamfx! ;)

/JOOMLAROOT/administrator/components/com_phocadownload/helpers/phocadownload.php (line 179-186):

Code: Select all

			foreach ($catDataTree as $k => $v) {
				foreach ($catData as $k2 => $v2) {
					if ($v->value == $v2->value) {
						$catDataTreeRights[$k]->text  = $v->text;
						$catDataTreeRights[$k]->value = $v->value;
					}
				}
			}
I have changed this to keep the right order (which is in $catDataTree!).

/JOOMLAROOT/components/com_phocadownload/views/phocadownloadlinkfile/view.html.php (line 80-84):

Code: Select all

		if ($tmpl['type'] != 4) {
			$lists['catid'] = PhocaDownloadHelper::filterCategory($query, $catid, null, true, true);
		} else {
			$lists['catid'] = PhocaDownloadHelper::filterCategory($query, $catid, null, false, true);
		}
To get the tree, we have to set the last parameter of the filterCategory function to true.

/JOOMLAROOT/adminstrator/components/com_phocadownload/views/phocadownloadlinkfile/view.html.php (line 80-84):

Code: Select all

		if ($tmpl['type'] != 4) {
			$lists['catid'] = PhocaDownloadHelper::filterCategory($query, $catid, null, true, true);
		} else {
			$lists['catid'] = PhocaDownloadHelper::filterCategory($query, $catid, null, false, true);
		}
Hope this will fix your problem! ;)
And Jan: Maybe you could implement it into a new version. It would make the Phoca Download Button Plugin more user-friendly.
Post Reply