opensourcepos / opensourcepos

Open Source Point of Sale is a web based point of sale application written in PHP using CodeIgniter framework. It uses MySQL as the data back end and has a Bootstrap 3 based user interface.

Home Page:http://www.opensourcepos.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: Rename Company Logo on upload and housekeeping of company_logo files

objecttothis opened this issue · comments

Current OSPOS 3.3.9 behavior for company logo in OSPOS > Configuration > Information is

  • Upload the file as is given by the user and not rename.
  • When removing the company logo to not remove the file but just replace the value for the filename with an empty string.
  • Changing the company_logo does not remove any old company logo.

Proposed changes

  • save the default logo as default_company_logo.jpg. This is the OpensourcePOS logo. (The default logo is embedded as an SVG and is visible if a custom company logo is not present so this change is not needed)
  • Clicking "Remove Image" causes the current image to be deleted on disk and the value of the company_logo in the database be set to default_company_logo.jpg. Clicking "Remove Image" would retain it's current behavior of causing the button on the view to read "Select Image" even though technically it has the default company logo file that it displays.
  • Adding or changing company logo causes the uploaded file to be renamed to company_logo.[ext] where [ext] is the result of file->guessExtension();

These changes would result in

  • Always having some image on the login landing page rather than the blank company logo section that looks sort of awkward when "Remove Image" has been clicked. (already present behavior)
  • Keeping /public/uploads/ free from clutter.

Thoughts?

So we always have a max of two files for the logo active at the same time

  • company_logo
  • default_company_logo

the first one is renamed and overwritten from any file that is uploaded. If it does not exist, due to it being deleted or not uploaded yet, then we fallback to the second default one/

So we always have a max of two files for the logo active at the same time

  • company_logo
  • default_company_logo

the first one is renamed and overwritten from any file that is uploaded. If it does not exist, due to it being deleted or not uploaded yet, then we fallback to the second default one/

That was my original thought but then I realized that the default logo is an embedded SVG, no no need to keep it on disk. Someone did ask for the possibility to have a custom logo AND receipt logo though. I think due to poor print quality on thermal printers people asked for the ability to do a b/w version.