PHP Classes

Files are missing

Recommend this page to a friend!

      PHP Timesheet Management System  >  All threads  >  Files are missing  >  (Un) Subscribe thread alerts  
Subject:Files are missing
Summary:missing files
Messages:12
Author:Benjamin H.
Date:2018-09-05 09:31:39
 
  1 - 10   11 - 12  

  1. Files are missing   Reply   Report abuse  
Picture of Benjamin H. Benjamin H. - 2018-09-05 09:31:39
I tried to test the package some files are missing:
public/js/dist/frontend-dist.js

could be more as i only see a blank page.



  2. Re: Files are missing   Reply   Report abuse  
Picture of Istvan Dobrentei Istvan Dobrentei - 2018-09-05 12:39:44 - In reply to message 1 from Benjamin H.
It is a generated file (frontend-dist.js) and in generally it's kind of files don't push to version control. You should generate it using npm. If you modify the frontend code, install dependencies using npm package manager and after build with npm run build command. This is the frontend but at the backend you should also generate files using composer (composer puts the files in the vendor directory). The project dependencies are in composer.json and package.json.

  3. Re: Files are missing   Reply   Report abuse  
Picture of Benjamin H. Benjamin H. - 2018-09-05 13:30:11 - In reply to message 1 from Benjamin H.
Ok I see you also have to use "npm install" and then "npm run build" to create the missing js file through webpack.

Sadly i couldn't login, http://localhost:89/api/login throws an 404.
Any idea?

I have created a vhost on port 89 to run the page.

  4. Re: Files are missing   Reply   Report abuse  
Picture of Istvan Dobrentei Istvan Dobrentei - 2018-09-05 13:56:21 - In reply to message 3 from Benjamin H.
The admin url is something like http://timesheet.docker/
The url depends on your webserver and etc/host settings.
You should setup your environment well.

For example:

in the project root folder:

cd public folder and run the following command: DB_HOST="127.0.0.1" DB_USER="" DB_PASS="" DB_NAME="timesheet_manager" php -d variables_order=EGPCS -S localhost:8000

open browser and type http://localhost:8000/

or setup your docker environment:
see docker-compose.yml and docker/nginx/nginx.conf file
run from the project root the following command: docker-compose up -d


  5. Re: Files are missing   Reply   Report abuse  
Picture of Benjamin H. Benjamin H. - 2018-09-06 07:18:56 - In reply to message 4 from Istvan Dobrentei
I am on Windows without docker. I have set the environment variables with this extension "vlucas/phpdotenv": "^2.2" inside an .env file.

And as I have already written i have set up a vhost which points to the /public directory. Port 8000 or 8080 etc. is already used.

I get to the login page but when it does the post to /api/login on the localhost with the correct port a 404 is thrown as the file doesn't exists.

So i have added a .htaccess (as i use a normal apache) which redirects every request to the index.php when the file doesn't exists.
Then i could login.

But then i only see "here comes the dashboard" and if I add a new project the entry is correctly added to the database but nothing is listed on the project table or the working hour project select field.

I had to also disable caching that the json request actually return something after adding new entries.

So here my .htaccess file:

<FilesMatch "\.(php)$">
<IfModule mod_expires.c>
ExpiresActive Off
</IfModule>
<IfModule mod_headers.c>
FileETag None
Header unset ETag
Header unset Pragma
Header unset Cache-Control
Header unset Last-Modified
Header set Pragma "no-cache"
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Expires "Thu, 1 Jan 1970 00:00:00 GMT"
</IfModule>
</FilesMatch>

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
</IfModule>


  6. Re: Files are missing   Reply   Report abuse  
Picture of Benjamin H. Benjamin H. - 2018-09-06 08:28:10 - In reply to message 5 from Benjamin H.
Still some issues.

the report.xls template file is missing. I guess this time it is really missing and isn't created by some script.
The template directory is set to \lib\report\ by the php code.
But I have also looked into all other directories but couldn't find anything appropriate.


There isn't a check for crossing working times.
So i could add a work from 8:00 - 9:30 and also from 8:30 - 9:30 for a second work. Both also for the same project. I am not sure if this is correct.

I also had problems with the triggers as my local database had only the user root@localhost and not root@%.
There i also have seen that your InvoiceDB::save function doesn't use db transactions. So the invoice and invoice_items entries are created but then the approval of the working time hours fails (because of the error on the trigger) and the invoice is still created even when the working times aren't approved.
DB transaction would be useful and a check on the result of the approveWorkingTime function call.

Suggestions:
to be able to get a quick summary it should be possible to list all entries by not filling out the date fields.
And it should also be possible to fill out only one field.
e.g.
- from date is filled only show entries from this date
- to date is filled show entries from first entry until end of this date

A "today" button would also be helpful in the date selectors.

  7. Re: Files are missing   Reply   Report abuse  
Picture of Istvan Dobrentei Istvan Dobrentei - 2018-09-06 08:39:03 - In reply to message 5 from Benjamin H.
Yes, you are right. The the public directory is the root and you should first cd into it.

Please type the following in your command line:
DB_HOST="127.0.0.1" DB_USER="root" DB_PASS="tiresome" DB_NAME="timesheet_manager" php -d variables_order=EGPCS -S localhost:8000

or set up the public dir as a www dir in your server config.

see a screnshot:
ibb.co/gKbsHz

  8. Re: Files are missing   Reply   Report abuse  
Picture of Istvan Dobrentei Istvan Dobrentei - 2018-09-06 08:39:21 - In reply to message 5 from Benjamin H.
Yes, you are right. The the public directory is the root and you should first cd into it.

Please type the following in your command line:
DB_HOST="127.0.0.1" DB_USER="root" DB_PASS="tiresome" DB_NAME="timesheet_manager" php -d variables_order=EGPCS -S localhost:8000

or set up the public dir as a www dir in your server config.

see a screenshot:
ibb.co/gKbsHz

  9. Re: Files are missing   Reply   Report abuse  
Picture of Istvan Dobrentei Istvan Dobrentei - 2018-09-06 08:48:52 - In reply to message 6 from Benjamin H.
Thank you for your suggestions and your time.
You are absolutely right. I will correct it and review the whole process when I have free time. There are many feature possibilities.

I created the report.xls with openoffice and the pdf report use it.
Do you think it is a real scenario to do two different kind of work within the same interval?

  10. Re: Files are missing   Reply   Report abuse  
Picture of Benjamin H. Benjamin H. - 2018-09-06 09:21:14 - In reply to message 9 from Istvan Dobrentei
>Do you think it is a real scenario to do two different kind of work within the same interval?

No and thatīs the point. In the current version it could happen that you enter more hours by day then your actual working time for the complete day. And this could also happen by mistake by selecting the wrong starting hour.

If there isn't a check you could end up with an summary working time of e.g. 8.5 when you should only have a max 7.5 of on a normal working day because your only selected one start / end hour wrong.
And because there is no edit button you could only delete and re-enter it.

There should be a select before adding the entry to the DB which checks if there is already an entry where the start and end hour of the date is in between.


>I created the report.xls with openoffice and the pdf report use it.
Is there a way to download if from somewhere? It would be cumbersome to check all possible input fields from the source to create a own.


btw1. for any json request which returns an error it would be helpfull if you get the error message in a popup or at least displayed ;)

btw2. when you delete a working time which is already invoiced and therefore approved the result on a delete action is "ok". It is correct that the entry isn't deleted. but there should be some error like "The entry is already approved ... can't delete etc." instead of leaving the user wondering why the entry isn't deleted.

 
  1 - 10   11 - 12