-
AuthorPosts
-
suelasrotas Friend
suelasrotas
- Join date:
- December 2010
- Posts:
- 35
- Downloads:
- 24
- Uploads:
- 5
- Thanks:
- 13
- Thanked:
- 1 times in 1 posts
March 4, 2017 at 9:58 pm #1015324Hi there,
I am trying to use your extension to show their own private documents to each user. Your filter will make it really easy for them to find their documents but…
The component menu item shows nothing. My template is based on Gantry but I have tried using Beez with the same results.
Any ideas?
The Captain ModeratorThe Captain
- Join date:
- December 2014
- Posts:
- 66
- Downloads:
- 74
- Uploads:
- 19
- Thanked:
- 11 times in 11 posts
March 6, 2017 at 1:56 am #1015463Hi Suelasrotas,
I can’t access your administrator site to see the issue closely, please check again.
Regards
1 user says Thank You to The Captain for this useful post
suelasrotas Friendsuelasrotas
- Join date:
- December 2010
- Posts:
- 35
- Downloads:
- 24
- Uploads:
- 5
- Thanks:
- 13
- Thanked:
- 1 times in 1 posts
March 6, 2017 at 6:44 pm #1015742This reply has been marked as private.The Captain ModeratorThe Captain
- Join date:
- December 2014
- Posts:
- 66
- Downloads:
- 74
- Uploads:
- 19
- Thanked:
- 11 times in 11 posts
March 7, 2017 at 2:19 am #1015822I have checked your issue, You may be miss the json file on the : [YOUR_SITE]/media/jamegafilter/. You can send the FTP info in private message for me. I need check some code on your site.
suelasrotas Friendsuelasrotas
- Join date:
- December 2010
- Posts:
- 35
- Downloads:
- 24
- Uploads:
- 5
- Thanks:
- 13
- Thanked:
- 1 times in 1 posts
March 7, 2017 at 12:14 pm #1016016This reply has been marked as private.The Captain ModeratorThe Captain
- Join date:
- December 2014
- Posts:
- 66
- Downloads:
- 74
- Uploads:
- 19
- Thanked:
- 11 times in 11 posts
March 8, 2017 at 7:14 am #1016232Hi, In the file plugins/jamegafilter/docman/tmpl/default.php: I added the code:
/* ExtendJS 0.2.3 More info at http://extendjs.org Copyright (c) 2013+ ChrisBenjaminsen.com Distributed under the terms of the MIT license. http://extendjs.org/licence.txt This notice shall be included in all copies or substantial portions of the Software. */ !function(a){"use strict";function b(a){a.parent instanceof Function&&(b.apply(this,[a.parent]),this.super=c(this,d(this,this.constructor))),a.apply(this,arguments)}function c(a,b){for(var c in a)"super"!==c&&a[c]instanceof Function&&!(a[c].prototype instanceof Class)&&(b[c]=a[c].super||d(a,a[c]));return b}function d(a,b){var c=a.super;return b.super=function(){return a.super=c,b.apply(a,arguments)}}a.Class=function(){},a.Class.extend=function e(a){function d(){b!==arguments[0]&&(b.apply(this,[a]),c(this,this),this.initializer instanceof Function&&this.initializer.apply(this),this.constructor.apply(this,arguments))}return d.prototype=new this(b),d.prototype.constructor=d,d.toString=function(){return a.toString()},d.extend=function(b){return b.parent=a,e.apply(d,arguments)},d},a.Class=a.Class.extend(function(){this.constructor=function(){}})}(this);
after the code:
The menu items show the docman files for filter, now. Regards.
suelasrotas Friendsuelasrotas
- Join date:
- December 2010
- Posts:
- 35
- Downloads:
- 24
- Uploads:
- 5
- Thanks:
- 13
- Thanked:
- 1 times in 1 posts
March 8, 2017 at 10:55 am #1016292Hi there!
Thanks for your fix. Unfortunately, my web page seems to be really slow due to the filter.
Another problem is that it shows every document in Docman, although it is extremely important for me to show just the documents they own.
Any ideas?
Kind regards
The Captain ModeratorThe Captain
- Join date:
- December 2014
- Posts:
- 66
- Downloads:
- 74
- Uploads:
- 19
- Thanked:
- 11 times in 11 posts
March 10, 2017 at 4:02 am #1016952Hi,
To resolve your problems. I edited the code on some files.- in the path: plugins/jamegafilter/docman/tmpl/default.php. I added the code :
$userID = JFactory::getUser()->id;
after the code:
$json = @file_get_contents(JPATH_SITE.$this->config->json);
and Replace the snippet of code :
function afterGetData(item) { // console.log(item.id) item.url = sefUrl[item.id].replace(new RegExp(/(&)/, 'g'),'&'); item.url_download = dUrl[item.id].replace(new RegExp(/(&)/, 'g'),'&'); } }
By the code:
function afterGetData(item) { // console.log(item.id) if (item.created_by == '<?php echo $userID ?>') { item.available = true; item.url = sefUrl[item.id].replace(new RegExp(/(&)/, 'g'),'&'); item.url_download = dUrl[item.id].replace(new RegExp(/(&)/, 'g'),'&'); } else { item.available = false; } }
- In the path: plugins/jamegafilter/docman/helper.php.
I added the code:$item->created_by = $baseItem->created_by;
After the code:
$item->desc = !empty($desc) ? substr($desc,0,100).'...' : $desc;
- In the path : components/com_jamegafilter/assets/js/main.js.
I replaced the code:item.setData(itemdata); lnmain.addItem(item, 'k' + itemdata.id);
By the code :
if (itemdata.available != 'undefined') { if (itemdata.available) { item.setData(itemdata); lnmain.addItem(item, 'k' + itemdata.id); } } else { item.setData(itemdata); lnmain.addItem(item, 'k' + itemdata.id); }
Please check again, and confirm the result for me.
Regards.
1 user says Thank You to The Captain for this useful post
suelasrotas Friendsuelasrotas
- Join date:
- December 2010
- Posts:
- 35
- Downloads:
- 24
- Uploads:
- 5
- Thanks:
- 13
- Thanked:
- 1 times in 1 posts
March 10, 2017 at 4:57 pm #1017195Thumbs up to that!!!! There are just a few things I would like to adjust but it might be better to open a new thread.
Super good job!
suelasrotas Friendsuelasrotas
- Join date:
- December 2010
- Posts:
- 35
- Downloads:
- 24
- Uploads:
- 5
- Thanks:
- 13
- Thanked:
- 1 times in 1 posts
March 10, 2017 at 5:00 pm #1017197One last thing…
Do I have to upgrade the component now that version 1.0.6?
Kind regards
suelasrotas Friendsuelasrotas
- Join date:
- December 2010
- Posts:
- 35
- Downloads:
- 24
- Uploads:
- 5
- Thanks:
- 13
- Thanked:
- 1 times in 1 posts
March 15, 2017 at 5:54 pm #1018707Hi there!
I just need to know whether it is OK to upgrade the component to new version or not.
Any ideas?
The Captain ModeratorThe Captain
- Join date:
- December 2014
- Posts:
- 66
- Downloads:
- 74
- Uploads:
- 19
- Thanked:
- 11 times in 11 posts
March 17, 2017 at 2:46 am #1019298Hi,
Please wait till the next release version. At the moment, we are updating some feature for other extensions on the Megafilter Component
Regards.suelasrotas Friendsuelasrotas
- Join date:
- December 2010
- Posts:
- 35
- Downloads:
- 24
- Uploads:
- 5
- Thanks:
- 13
- Thanked:
- 1 times in 1 posts
March 26, 2017 at 5:50 pm #1021894Aye Captain!
I am afraid I have discovered a bug related to this topic.
When a user with special privileges logs in, he/she is not going to be able to see all of the documents on Docman.
I think the code you applied restricts the filter to show just the documents you own without checking privileges. The way Docman works restricts the documents you can see very easily but not very visually.
Do you think is possible that Megafilter can show all the documents when a Superadmin or administrator logs in?
Kind regards
The Captain ModeratorThe Captain
- Join date:
- December 2014
- Posts:
- 66
- Downloads:
- 74
- Uploads:
- 19
- Thanked:
- 11 times in 11 posts
March 27, 2017 at 4:06 am #1022001Hi, Yes, all the documents should show when a SuperAdmin or Administrator logs in. Please follow steps below, In the path : plugins/jamegafilter/docman/default.php, insert the snippet of code:
$groups = JFactory::getUser()->get('groups'); $isAdmin = count(array_intersect($groups, array('7','8'))) ? true : false;
after :
$userID = JFactory::getUser()->id;
and replace the snippet of code :
function afterGetData(item) { // console.log(item.id) if (item.created_by == '<?php echo $userID ?>') { item.available = true; item.url = sefUrl[item.id].replace(new RegExp(/(&)/, 'g'),'&'); item.url_download = dUrl[item.id].replace(new RegExp(/(&)/, 'g'),'&'); } else { item.available = false; } }
by the code :
function afterGetData(item) { <?php if ($this->item['type'] == 'docman') : if ($userID) : if (!$isAdmin) : ?> if (item.created_by == '<?php echo $userID ?>') { item.available = true; } else { item.available = false; } <?php else : ?> item.available = true; <?php endif; else : ?> item.available = false; <?php endif; endif; ?> item.url = sefUrl[item.id].replace(new RegExp(/(&)/g),'&'); item.url_download = dUrl[item.id].replace(new RegExp(/(&)/g),'&'); }
Please try this and confirm the result for me.
Regards1 user says Thank You to The Captain for this useful post
suelasrotas Friendsuelasrotas
- Join date:
- December 2010
- Posts:
- 35
- Downloads:
- 24
- Uploads:
- 5
- Thanks:
- 13
- Thanked:
- 1 times in 1 posts
March 27, 2017 at 6:23 am #1022033This reply has been marked as private. -
AuthorPosts
This topic contains 24 replies, has 4 voices, and was last updated by Mo0nlight 7 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum