Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Show Part Picture (if available) Issue
09-15-2017, 10:25 PM (This post was last modified: 09-15-2017 10:42 PM by VortecCPI.)
Post: #4
RE: Show Part Picture (if available) Issue
I recently noticed pictures showed correctly for Work Order entry so I had a look at the code for showing pictures for each page.

Two comments:

#1: Adding "$SupportedImgExt = array('png','jpg','jpeg');" on line 861 in SelectProducts.php fixed the issue.

#2: The code to manage images here is a bit different and could likely be made more consistent if not the same.

In an effort to be more consistent I chose to change the code at line 861 to match that found elsewhere in webERP:

$SupportedImgExt = array('png','jpg','jpeg');
$imagefile = reset((glob($_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.{' . implode(",", $SupportedImgExt) . '}', GLOB_BRACE)));
if(extension_loaded('gd') && function_exists('gd_info') && file_exists ($imagefile) ) {
$StockImgLink = '<img src="GetStockImage.php?automake=1&amp;textcolor=FFFFFF&amp;bgcolor=CCCCCC'.
'&amp;StockID='.urlencode($myrow['stockid']).
'&amp;text='. //$myrow['stockid'] .
'&amp;width=100'.
'&amp;height=100'.
'" alt="" />';
} else if(file_exists ($imagefile)) {
$StockImgLink = '<img src="' . $imagefile . '" height="100" width="100" />';
} else {
$StockImgLink = '<p>'._('No Image').'</p>';
}

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Show Part Picture (if available) Issue - VortecCPI - 09-15-2017 10:25 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)