jDownloadsownloads.com



Author Topic: Frontend upload in current category  (Read 7704 times)

0 Members and 1 Guest are viewing this topic.

Offline 2borg

  • Newbie
  • *
  • Posts: 25
Frontend upload in current category
« on: 07.07.2014 11:32:02 »
Hi,

When uploading in frontend, is it possible to autoselect the category the user is currently in..
It will be very helpful for a large category tree, so user doesn't have to scroll and search for the category when the category is already there.

and one more thing, if a user could create category in frontend, that would be a great feautre too...
« Last Edit: 07.07.2014 11:34:17 by 2borg »

Offline 2borg

  • Newbie
  • *
  • Posts: 25
Re: Frontend upload in current category
« Reply #1 on: 07.07.2014 12:29:50 »
I tried to change the option "May select a different Category" in "User Group Settings" but stil getting the dropdown.

And also in the dropdown list I can see unpublished Categories.

Offline Arno

  • Administrator
  • ***
  • Posts: 12.177
    • jDownloads.com
Re: Frontend upload in current category
« Reply #2 on: 09.07.2014 11:17:40 »

Quote
I tried to change the option "May select a different Category" in "User Group Settings" but stil getting the dropdown.
This can be a bug in the 'user groups settings'. Here is not always use the correct user group when:
- the user is a member in multiple user groups
- the user is a member from a new added user sub group
We work here on a solution for the next beta update.

Quote
And also in the dropdown list I can see unpublished Categories.
What is your user group?
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!

Offline 2borg

  • Newbie
  • *
  • Posts: 25
Re: Frontend upload in current category
« Reply #3 on: 09.07.2014 13:53:48 »
This can be a bug in the 'user groups settings'. Here is not always use the correct user group when:
- the user is a member in multiple user groups
- the user is a member from a new added user sub group
We work here on a solution for the next beta update.
What is your user group?


I have this scenario.

I have three user groups and evey group can see and download from their corresponding categroy (Usergroup 1 can see and download Category 1, 2-2 and 3-3). No User group can see  category other than its own.
A user can be assigned to one, two or all three groups. (i created menu items with single category and assigned every menu item to the corresponding group) and they can only download files but not upload.

The I have admin user who is assignet to all three groups (otherwise the user doesn't see the menu Items) and also administrator group who is allowed to upload files.

My main Problem is that admin users are 3 (not-so-young-anymore) ladies who might have difficulties when uploading a file and having to scroll through 700-800 category tree.

I tried adding a user to only one group and granting the gropup Upload rights, and still got the same result. User always get the dropdown list with all categories (published and unpubliched) when trying to upload a new file.



« Last Edit: 09.07.2014 13:56:36 by 2borg »

Online ColinM

  • jD Tester
  • *
  • Posts: 3.365
Re: Frontend upload in current category
« Reply #4 on: 10.07.2014 01:18:39 »
Hi
As Arno says there are 'challenges' at the moment with user group settings.  One way you might like to investigate is to deny upload (create) access to those categories the user group does not have access.  But probably an impractical suggestion with a huge number of categories unless you have a suitable tree type structure for the categories.  If you do have a tree type structure then denying access near the root cascades down that branch.  In that situation the denied categories will not appear in the available list.

I have done that on a small scale OK but it would be helpful if you could perhaps try on the large scale.

Colin

Offline 2borg

  • Newbie
  • *
  • Posts: 25
Re: Frontend upload in current category
« Reply #5 on: 28.07.2014 10:19:05 »
I have only few users who can upload rights, but they have upload rights to all folders.

My thoughts were to save the folder/categry ID in some vriable or in session, and when a user klicks the upload button, field for category gets automatically filled with the saved variable and instead of Dopdown list we have a readonly field that shows us where we are uploading. We know the value of the variable (categroy ID) because the user is allready in this folder.

This way we can avoid scrolling through all of categories, and also showing unpublished categories :D

I tried to play with this, but I still need to know the system a little bit better and plus my programming skills are still not that advanced. :D

Online ColinM

  • jD Tester
  • *
  • Posts: 3.365
Re: Frontend upload in current category
« Reply #6 on: 28.07.2014 16:02:55 »
Hi
Presently there is a bug in the current release that causes all categories to be shown.  This has been fixed for next release so that should assist.

However you can limit creating a download to a specific category by setting a default category in the Basic Options of the Create Downloads menu.  So put each of your 'creators' in their own user groups, then create a View Access level that contains that user group.  Next generate several  'create a download' menu items one for each category and setting each one for the specific View Access Level.  So only users from the relevant user group will see thier menu item.  Finaly set the categories to have the appropriate View Access Level.

Colin

Offline 2borg

  • Newbie
  • *
  • Posts: 25
Re: Frontend upload in current category
« Reply #7 on: 30.07.2014 13:44:11 »
Hi,
I managed to do it by editing some template files (its not a nice solution but it works).
Because I'm using only Single Category view and use Direct Download, i edited only
components\com_jdownloads\views\category\tmpl\default.php and edited &upload_link at line 180 to look like this:

I added:
Code: [Select]
&amp;Catid='.$catid.' at the end of the two <a href tags> to be able to transfer my current Category ID to Edit form.
Code: [Select]
$upload_link = '<a href="'.JRoute::_('index.php?option=com_jdownloads&amp;view=form&amp;layout=edit&amp;Itemid='.$menuItemids['upload']).'&amp;Catid='.$catid.'">'.'<img src="'.JURI::base().'components/com_jdownloads/assets/images/upload.png" width="32" height="32" border="0" alt="" /></a> <a href="'.JRoute::_('index.php?option=com_jdownloads&amp;view=form&amp;layout=edit&amp;Itemid='.$menuItemids['upload'].'&amp;Catid='.$catid.'').'">'.JText::_('COM_JDOWNLOADS_UPLOAD_LINKTEXT').'</a>';
Then I parsed Catid to variable in:
components\com_jdownloads\views\form\tmpl\edit.php
I got a new Catid Variable with:
Code: [Select]
$Catid = $_GET['Catid'];
and at the end i added this code at the line 230
Code: [Select]
$this->form->setFieldAttribute('cat_id', 'default',  $Catid);
$this->form->setFieldAttribute('cat_id', 'readonly', 'true');

and got this
Code: [Select]
<?php
$this
->form->setFieldAttribute('cat_id''default',  $Catid);
$this->form->setFieldAttribute('cat_id''readonly''true');
 echo 
$this->form->getInput('cat_id'); ?>

So now my user can upload files in to the category he/she is currently in.

I know that this is not a permanent solution and I will have to do this every time component gets updated, but i think that it is good feature if you have 800+ categories/folders.

An also if you leave this out

Code: [Select]
$this->form->setFieldAttribute('cat_id', 'readonly', 'true');
your user will be able to change your upload category if they want.

I hope this will be helpfull to someone and maybe serve as a feature proposal :D
« Last Edit: 30.07.2014 13:47:26 by 2borg »

Online ColinM

  • jD Tester
  • *
  • Posts: 3.365
Re: Frontend upload in current category
« Reply #8 on: 11.09.2014 19:08:19 »
Hi
Apologies for the delay in replying but I missed it!

Yes a good idea.  Will pick it up again when we have a stable version.

Thanks
Colin

Offline 2borg

  • Newbie
  • *
  • Posts: 25
Re: Frontend upload in current category
« Reply #9 on: 09.12.2014 10:46:08 »
Hi,
I just wanted to ask is this feature implemented ? And did you consider implementing the feature ?


Online ColinM

  • jD Tester
  • *
  • Posts: 3.365
Re: Frontend upload in current category
« Reply #10 on: 11.12.2014 00:43:38 »
Hi
Not Yet
still waiting on stable version - not forgotten

Offline blakky

  • Newbie
  • *
  • Posts: 1
Re: Frontend upload in current category
« Reply #11 on: 16.07.2015 11:31:09 »
Hi, I'd really love to see this feature too! I have a very wide catalog and it is a pain for my users to scroll down the category menu.
Any news?