Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Logbookadvanced] First version of a logbook with filtering and batch processing of QSL handling. #1847

Merged
merged 11 commits into from
Dec 21, 2022
Merged

Conversation

AndreasK79
Copy link
Contributor

@AndreasK79 AndreasK79 commented Dec 18, 2022

Thanks to @hugosilvaparagramanet for his QSL Manger PR. I took his code, modified and expanded the functionality. It was very interesting to see how things were solved, and I learned several new tricks.

I've renamed it to Logbook Advanced. For now, I've replaced the logbook link with this one.

Some changes from the original PR.

  1. Renamed it to Logbook Advanced.
  2. Datatable is added to the table for a scrollable body.
  3. Added a lot more filtering (dxcc, iota, gridsquare, state, and propagation mode).
  4. Built the functionality behind the buttons.

This is basically a logbook with filtering and batch processing of QSL handling.

Feedback is very welcome.

A preview:
image

I've added database save for updated info from callbook, if this info does not exist in the database.
Might need to dig some more about what info is returned from QRZ or HamQTH,

@phl0
Copy link
Contributor

phl0 commented Dec 18, 2022

Is it intended that pressing "reset" does only reset the input form and does not update the table, i.e. return to the list of all QSOs?

@AndreasK79
Copy link
Contributor Author

That's how it's made, but can be changed.

@phl0
Copy link
Contributor

phl0 commented Dec 18, 2022

That's how it's made, but can be changed.

Ah ok. No worries. Thought it might be a bug. But WAD is OK also :)

@AndreasK79
Copy link
Contributor Author

@phl0 refresh and try the reset now :)

@hugosilvaparagramanet
Copy link
Contributor

@AndreasK79 this looks really nice, I'm a little short on time but I'll do my best to try this changes

@AndreasK79
Copy link
Contributor Author

@hugosilvaparagramanet hope you like it. Thanks for the code and the idea.

@AndreasK79
Copy link
Contributor Author

@magicbug I think this is pretty close to ready, if not ready for merge. The question is, if this should have it's own menu item.

@phl0
Copy link
Contributor

phl0 commented Dec 21, 2022

If I may comment on this ... ;-) I would like to keep the old view as well. What do you think about this:

Screenshot from 2022-12-21 14-28-49

@AndreasK79
Copy link
Contributor Author

@phl0 good idea. I was thinking something like that myself.

@phl0
Copy link
Contributor

phl0 commented Dec 21, 2022

@phl0 good idea. I was thinking something like that myself.

QRX I will push that to a branch.

@phl0
Copy link
Contributor

phl0 commented Dec 21, 2022

The stuff is here: https://github.com/phl0/Cloudlog/commits/2logbooks. If @magicbug also agrees I can PR that to @AndreasK79's branch.

@magicbug
Copy link
Owner

Agree think we need to keep both for now at least

@phl0
Copy link
Contributor

phl0 commented Dec 21, 2022

Agree think we need to keep both for now at least

So https://github.com/AndreasK79/Cloudlog/pull/17 ;-)

Have two separate items for logbook and advanced
@AndreasK79
Copy link
Contributor Author

So... mergetime?

@magicbug
Copy link
Owner

think so! at least to dev branch for moar testing! :)

@magicbug magicbug merged commit 507adce into magicbug:dev Dec 21, 2022
@magicbug
Copy link
Owner

Interesting, i'm guessing older mysql issue on my live setup i'm getting An error ocurred while making the request then loading it and its calling logbookadvanced/search

@AndreasK79
Copy link
Contributor Author

Hmm, check dev tools and see if you can pinpoint the error there.

@magicbug
Copy link
Owner

ERROR - 2022-12-21 14:10:43 --> Severity: error --> Exception: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) /home/twom0sql/domains/logbooks.2e0sql.co.uk/public_html/2m0sql/src/QSLManager/QSO.php 12

@magicbug
Copy link
Owner

ERROR - 2022-12-21 14:03:25 --> Severity: error --> Exception: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) /home/twom0sql/domains/logbooks.2e0sql.co.uk/public_html/2m0sql/src/QSLManager/QSO.php 12
ERROR - 2022-12-21 14:03:55 --> Severity: error --> Exception: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) /home/twom0sql/domains/logbooks.2e0sql.co.uk/public_html/2m0sql/src/QSLManager/QSO.php 12
ERROR - 2022-12-21 14:04:10 --> Query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 7 - Invalid query:
SELECT *
FROM TABLE_HRD_CONTACTS_V01 qsos
INNER JOIN station_profile ON qsos.station_id=station_profile.station_id
WHERE station_profile.user_id = 5

		ORDER BY qsos.COL_TIME_ON desc
		LIMIT 

ERROR - 2022-12-21 14:04:10 --> Severity: error --> Exception: Call to a member function result() on bool /home/twom0sql/domains/logbooks.2e0sql.co.uk/public_html/2m0sql/application/models/Logbookadvanced_model.php 135
ERROR - 2022-12-21 14:04:59 --> Severity: error --> Exception: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) /home/twom0sql/domains/logbooks.2e0sql.co.uk/public_html/2m0sql/src/QSLManager/QSO.php 12
ERROR - 2022-12-21 14:05:36 --> Severity: error --> Exception: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) /home/twom0sql/domains/logbooks.2e0sql.co.uk/public_html/2m0sql/src/QSLManager/QSO.php 12
ERROR - 2022-12-21 14:05:54 --> Severity: error --> Exception: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) /home/twom0sql/domains/logbooks.2e0sql.co.uk/public_html/2m0sql/src/QSLManager/QSO.php 12
ERROR - 2022-12-21 14:06:55 --> Severity: error --> Exception: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) /home/twom0sql/domains/logbooks.2e0sql.co.uk/public_html/2m0sql/src/QSLManager/QSO.php 12
ERROR - 2022-12-21 14:07:05 --> Severity: error --> Exception: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) /home/twom0sql/domains/logbooks.2e0sql.co.uk/public_html/2m0sql/src/QSLManager/QSO.php 12

@magicbug
Copy link
Owner

Looks like i was right MySQL server version for the right syntax to use near '' at line 7 - Invalid query:

@AndreasK79
Copy link
Contributor Author

Not really sure that is the problem. The queries doesn't use anything special or newer functions.
It might be how the query is built together.

Try to set limit 250 on line 130 in logbookmodel_advanced.php.

@magicbug
Copy link
Owner

Ignore.. changed to PHP8 and it fixed it.

@magicbug
Copy link
Owner

This server which only hosts me needs an upgrade

@AndreasK79
Copy link
Contributor Author

What version were you running? I'm on 7.4.8 here.

@magicbug
Copy link
Owner

it was 7.3!

@AndreasK79
Copy link
Contributor Author

Right. Should we make sure it works on that version and older? If so, I need to set up a test machine.

@magicbug
Copy link
Owner

Maybe but I think perhaps not, just support the last "stable" release its fine on 7.4

@oe7drt
Copy link

oe7drt commented Dec 28, 2022

Hi just found this via search and wanted to let you know that the advanced logbook failed on PHP 7.2.24 on Rocky Linux.

ERROR - 2022-12-28 22:32:49 --> Severity: error --> Exception: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) /opt/Cloudlog/src/QSLManager/QSO.php 12

I haven't tried with 7.3 as you all seem to use 7.4 and I can confirm it works now. Wasn't sure because the README only shows PHP 7. (7.4.30)

@DL3EL
Copy link

DL3EL commented Jan 1, 2023

I am currently running PHP 7.4.33, all I get is "An error ocurred while making the request"... any tip?

@AndreasK79
Copy link
Contributor Author

@DL3EL I'm not sure what the lowest 7.4 is. I'm running 7.4.8 on my dev-setup, and it works fine here, so if you can upgrade the version a little bit and try again, that should fix it.

@DL3EL
Copy link

DL3EL commented Jan 1, 2023

@AndreasK79 hmm.. I would think, that 7.4.33 is newer than 7.4.8

@AndreasK79
Copy link
Contributor Author

Oops. It should. Can you look in dev tools and see if you see any errors?

@DL3EL
Copy link

DL3EL commented Jan 1, 2023

First I called Logbook Overview (1st and 2nd msg)
Then Logbook Advanced (3rd)
after that I filled the "De" Field and pressed "Search" (4th)

1st: DevTools failed to load source map: Could not load content for http://192.168.241.99/assets/css/bootstrap-dialog.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

2nd: DevTools failed to load source map: Could not load content for http://192.168.241.99/assets/js/bundle.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

3rd: jquery-3.3.1.min.js:2 POST http://192.168.241.99/index.php/logbookadvanced/search 500 (Internal Server Error)
send @ jquery-3.3.1.min.js:2
ajax @ jquery-3.3.1.min.js:2
(anonymous) @ logbookadvanced.js?1672500601:142
dispatch @ jquery-3.3.1.min.js:2
y.handle @ jquery-3.3.1.min.js:2
trigger @ jquery-3.3.1.min.js:2
(anonymous) @ jquery-3.3.1.min.js:2
each @ jquery-3.3.1.min.js:2
each @ jquery-3.3.1.min.js:2
trigger @ jquery-3.3.1.min.js:2
w.fn. @ jquery-3.3.1.min.js:2
(anonymous) @ logbookadvanced.js?1672500601:359
l @ jquery-3.3.1.min.js:2
c @ jquery-3.3.1.min.js:2
setTimeout (async)
(anonymous) @ jquery-3.3.1.min.js:2
u @ jquery-3.3.1.min.js:2
fireWith @ jquery-3.3.1.min.js:2
fire @ jquery-3.3.1.min.js:2
u @ jquery-3.3.1.min.js:2
fireWith @ jquery-3.3.1.min.js:2
ready @ jquery-3.3.1.min.js:2
_ @ jquery-3.3.1.min.js:2

4th: jquery-3.3.1.min.js:2 POST http://192.168.241.99/index.php/logbookadvanced/search 500 (Internal Server Error)
send @ jquery-3.3.1.min.js:2
ajax @ jquery-3.3.1.min.js:2
(anonymous) @ logbookadvanced.js?1672500601:142
dispatch @ jquery-3.3.1.min.js:2
y.handle @ jquery-3.3.1.min.js:2

@AndreasK79
Copy link
Contributor Author

Can you click on the logbookadvanced/search link and see if the error 500 has any more info?

@DL3EL
Copy link

DL3EL commented Jan 1, 2023

is there an easy way to copy the whole stuff? Export to a .har file?

image

@AndreasK79
Copy link
Contributor Author

You need to click on the search call:
image
Then click on response on the right side. You will probably find an error there. That's the one I need to hopefully be able to pinpoint the problem.

@DL3EL
Copy link

DL3EL commented Jan 2, 2023

image

image

hope that helps

@AndreasK79
Copy link
Contributor Author

I need what is under the response link.

@DL3EL
Copy link

DL3EL commented Jan 2, 2023

I thought, that was not so important :-)

image

@phl0
Copy link
Contributor

phl0 commented Jan 2, 2023

Maybe set the environment to "development" in index.php temporarily to gain more info in the error.

@DL3EL
Copy link

DL3EL commented Jan 3, 2023

Finally, with the help of @phl0 we could solve the issue. The root cause was, the upgrade to php 7.4 was only done on the OS level. Apache itsself was still running with php 7.3. Here is, what we did, the server is a Raspberry PI with Buster:

For better debug we enabled developer mode (index.php) and increase error level (application/config/config.php)
Install php 7.4 for OS

Make sure libapache2-mod-php7.4 is installed for Apache 2 module (root cause)
Check Admin/Debug Information, it should read "PHP Version 7.4.33"

If not, install it: "sudo apt install php7.4-json php7.4-curl php7.4-mbstring php7.4-mysql php7.4-zip php7.4-xml libapache2-mod-php7.4"
remove old php version: “sudo a2dismod php7.x”
(use “sudo a2dismod” to see exact name)
Enable new version: "sudo a2enmod php7.4”
Restart Apache “sudo systemctl restart apache2”

now the advance Logbook works like charme

@AndreasK79
Copy link
Contributor Author

That is great news! Glad it's now working. Good we have a Linux expert with @phl0 here.

@AndreasK79 AndreasK79 deleted the logbookadvanced branch January 27, 2023 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants