All questions about EDocman extension

How to change table layout?

  • Reto Rappa
  • Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 9 months ago #46345 by Reto Rappa
How to change table layout? was created by Reto Rappa
Hi, I want to change the standard table layout to show the document description between document title and document date. Is that possible and how?

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Online
  • Administrator
  • Administrator
More
9 years 9 months ago #46357 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic How to change table layout?
Hi Reto

It is possible but you will need to modify code. However, I am not sure you should modify it because the table layout don't have enough space to show the description of the document. Maybe you can try to edit the code in the file components/com_edocman/views/common/documents_table.php to add the description to table ?

Give it a try to see how it goes.

Regards,

Tuan
The following user(s) said Thank You: Reto Rappa

Please Log in or Create an account to join the conversation.

  • Reto Rappa
  • Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 8 months ago #47147 by Reto Rappa
Replied by Reto Rappa on topic How to change table layout?
Thank you! In the meanwhile I modified the code and it worked with this additional column. And there is enough space. :)

I use the description field for displaying a part number. Another question - is it possible to sort the table for the description field? If yes, where to add/change the code?

And I want to sort the table not with the standard sort button, but with two buttons (arrow up/down) next to each table headline. For example: Title (sort arrow up/down) / Description (sort arrow up/down) / etc. How to enable this?

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Online
  • Administrator
  • Administrator
More
9 years 8 months ago #47182 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic How to change table layout?
Hi Reto

Unfortunately, it is not possible to do that. If you change the ordering in one way, the other user change it in different way, how will the system display these records ?

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Reto Rappa
  • Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 8 months ago #47211 by Reto Rappa
Replied by Reto Rappa on topic How to change table layout?
But sorting in this case is a temporarily event only and depends only to the one who visits the site in this moment, or what do you mean? I don't want to change the sorting "forever".

So once more: As the site-visitor (frontend) can change sorting by title and date, is it possible to sort by description and where to change this (not tbl.title or tbl.created_time, but tbl.description or similiar)? Thank you.

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Online
  • Administrator
  • Administrator
More
9 years 8 months ago #47212 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic How to change table layout?
Ah, I am confusing because you mentioned this in your post

And I want to sort the table not with the standard sort button, but with two buttons (arrow up/down) next to each table headline. For example: Title (sort arrow up/down) / Description (sort arrow up/down) / etc. How to enable this?


So if you want to sort the documents based on the description , not by date or ordering or title, then you will need to customize code:

1. Open the file components/com_edocman/models/category.php

2. Find the code below:
Code:
$this->state->setData($_REQUEST);

3. Add the lines of code below after that line:

$this->state->filter_order = 'tbl.description';
$this->state->filter_order_Dir = '';

After that, check it again and it should work as expected. Please note that this will be the ordering used for all users, each user cannot choose the ordering he wants (For example, A want to order by title, B want to order by date...).

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Reto Rappa
  • Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 8 months ago #47429 by Reto Rappa
Replied by Reto Rappa on topic How to change table layout?
Tuan, thank you, I added the lines but don't see any effect. Maybe we don't talk about the same things. :)

Please forget what I wrote above, one step after the other. If I activate the table layout for the document listing and also activate the "show sort options", is there a way to add another sort option? Actual the user in the frontend can sort the document listing for title, date and sorting, ascending and descending. Can I add an option that the user can also sort for description?

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Online
  • Administrator
  • Administrator
More
9 years 8 months ago #47455 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic How to change table layout?
Hi Reto

Maybe it doesn't change because you are entering the description into short description field of documents instead of entering into description field ?

For your last questions, yes, you can. Follow the instructions below :

1. Open the file components/com_edocman/views/category/view.html.php

2. Find the code below:
Code:
$options = array(); $options[] = JHTML::_('select.option', '', JText::_('EDOCMAN_SELECT')); $options[] = JHTML::_('select.option', 'tbl.title', JText::_('EDOCMAN_TITLE')); $options[] = JHTML::_('select.option', 'tbl.created_time', JText::_('EDOCMAN_DATE')); $options[] = JHTML::_('select.option', 'tbl.ordering', JText::_('EDOCMAN_ORDERING'));

3. Add this line of code below after the above lines:
Code:
$options[] = JHTML::_('select.option', 'tbl.description', JText::_('EDOCMAN_DESCRIPTION')); $options[] = JHTML::_('select.option', 'tbl.short_description', JText::_('EDOCMAN_SHORT_DESCRIPTION'));


After that, please try again to see how it goes.

Tuan
The following user(s) said Thank You: Reto Rappa

Please Log in or Create an account to join the conversation.

  • Reto Rappa
  • Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 7 months ago #47969 by Reto Rappa
Replied by Reto Rappa on topic How to change table layout?
Tuan, many thanks, that works great!

As written above, I want to include some arrow-images near the table-headings to make a direct sorting easier for the user. For example: Title (sort arrow up / sort arrow down)

What code do I have to include for the href-tag (I suppose) of the arrow-image, if I want to klick on the sort-up-arrow-image to let the table be sorted by "Title ascending"?

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago #93580 by Jolo
Replied by Jolo on topic How to change table layout?
Please teach me how to add another column in the table layout in Edocman. I am not that versed as an IT person and can't do programming alone.

Please help,

Jolo Cruz

Please Log in or Create an account to join the conversation.

Moderators: Mr. Dam