Changeset 3056


Ignore:
Timestamp:
07/15/10 16:14:08 (14 years ago)
Author:
asaikawa
Message:

Ticket #873 - Inserida verificacao se o diretorio do processo existe. Se nao existir, mostra um icone diferente

Location:
trunk/workflow
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/workflow/inc/class.bo_userinterface.inc.php

    r2591 r3056  
    9191                                        $recset[$procname_ver]['useHTTPS'] = 0; 
    9292                        } 
    93                         $recset[$procname_ver][] = array('wf_activity_id'       => $line['wf_activity_id'], 
    94                                                                                 'wf_name'                       => $line['wf_name'], 
    95                                                                                 'wf_menu_path'          => $line['wf_menu_path'], 
    96                                                                                 'wf_type'                       => $line['wf_type'], 
    97                                                                                 'wf_is_autorouted'      => $line['wf_is_autorouted'], 
    98                                                                                 'wf_is_interactive' => $line['wf_is_interactive']); 
     93                        if (!is_dir(GALAXIA_PROCESSES . '/' . $line['wf_normalized_name'])) 
     94                        { 
     95                                $recset[$procname_ver]['wf_iconfile'] = $templateServer->generateImageLink('navbar_nocode.png'); 
     96                        } 
     97                        else 
     98                        { 
     99                                $recset[$procname_ver][] = array('wf_activity_id'       => $line['wf_activity_id'], 
     100                                                                                                'wf_name'                       => $line['wf_name'], 
     101                                                                                                'wf_menu_path'          => $line['wf_menu_path'], 
     102                                                                                                'wf_type'                       => $line['wf_type'], 
     103                                                                                                'wf_is_autorouted'      => $line['wf_is_autorouted'], 
     104                                                                                                'wf_is_interactive' => $line['wf_is_interactive']); 
     105                        } 
    99106                } 
    100107 
  • trunk/workflow/inc/class.ui_adminactivities.inc.php

    r2591 r3056  
    10351035                $image_name = $proc_info['wf_normalized_name'] . SEP . 'graph' . SEP . $proc_info['wf_normalized_name'] . '.png'; 
    10361036                $image = GALAXIA_PROCESSES . SEP . $image_name; 
    1037                 if (Factory::getInstance('BrowserInfo')->isOpera()) 
    1038                         $maximumDimension = 1000000; 
     1037                if (file_exists($image)) 
     1038                { 
     1039                        if (Factory::getInstance('BrowserInfo')->isOpera()) 
     1040                                $maximumDimension = 1000000; 
     1041                        else 
     1042                                $maximumDimension = 2500; 
     1043 
     1044                        $dims = getimagesize($image); 
     1045                        list($originalWidth, $originalHeight) = $dims; 
     1046 
     1047                        /* the image must be resized */ 
     1048                        if (max($originalWidth, $originalHeight) > $maximumDimension) 
     1049                        { 
     1050                                /* define the new width and height */ 
     1051                                $newWidth = $newHeight = $maximumDimension; 
     1052                                if ($originalWidth > $originalHeight) 
     1053                                        $newHeight = $maximumDimension * ($originalHeight / $originalWidth); 
     1054                                else 
     1055                                        $newWidth = $maximumDimension * ($originalWidth / $originalHeight); 
     1056 
     1057                                /* create the new image and send to the browser */ 
     1058                                $smallerImage = imagecreatetruecolor($newWidth, $newHeight); 
     1059                                imagecopyresampled($smallerImage, imagecreatefrompng($image), 0, 0, 0, 0, $newWidth, $newHeight, $originalWidth, $originalHeight); 
     1060                                header('content-disposition: inline; filename=' . $image_name); 
     1061                                header('content-type: ' . $dims['mime']); 
     1062                                imagepng($smallerImage); 
     1063                        } 
     1064                        else 
     1065                        { 
     1066                                header('content-disposition: inline; filename=' . $image_name); 
     1067                                header('content-type: ' . $dims['mime']); 
     1068                                header('content-length: ' . filesize($image)); 
     1069                                readfile($image); 
     1070                        } 
     1071                } 
     1072                // if there is no graph, show "graph not found" message 
    10391073                else 
    1040                         $maximumDimension = 2500; 
    1041  
    1042                 $dims = getimagesize($image); 
    1043                 list($originalWidth, $originalHeight) = $dims; 
    1044  
    1045                 /* the image must be resized */ 
    1046                 if (max($originalWidth, $originalHeight) > $maximumDimension) 
    1047                 { 
    1048                         /* define the new width and height */ 
    1049                         $newWidth = $newHeight = $maximumDimension; 
    1050                         if ($originalWidth > $originalHeight) 
    1051                                 $newHeight = $maximumDimension * ($originalHeight / $originalWidth); 
    1052                         else 
    1053                                 $newWidth = $maximumDimension * ($originalWidth / $originalHeight); 
    1054  
    1055                         /* create the new image and send to the browser */ 
    1056                         $smallerImage = imagecreatetruecolor($newWidth, $newHeight); 
    1057                         imagecopyresampled($smallerImage, imagecreatefrompng($image), 0, 0, 0, 0, $newWidth, $newHeight, $originalWidth, $originalHeight); 
    1058                         header('content-disposition: inline; filename=' . $image_name); 
    1059                         header('content-type: ' . $dims['mime']); 
    1060                         imagepng($smallerImage); 
    1061                 } 
    1062                 else 
    1063                 { 
    1064                         header('content-disposition: inline; filename=' . $image_name); 
    1065                         header('content-type: ' . $dims['mime']); 
    1066                         header('content-length: ' . filesize($image)); 
    1067                         readfile($image); 
     1074                { 
     1075                        header ('Content-type: image/png'); 
     1076                        $text = 'GRAFICO NAO ENCONTRADO'; 
     1077                        $font_size = 5; 
     1078                        $width = imagefontwidth($font_size) * strlen($text); 
     1079                        $height = imagefontheight($font_size); 
     1080                        $im = imagecreate($width, $height); 
     1081                        $text_color = imagecolorallocate($im, 0, 0, 0);         // black 
     1082                        $bg_color = imagecolorallocate($im, 255, 255, 255);     // white 
     1083                        imagefill($im, 0, 0, $bg_color); 
     1084                        imagestring($im, $font_size, 0, 0, $text, $text_color); 
     1085                        imagepng($im); 
     1086                        imagedestroy($im); 
    10681087                } 
    10691088        } 
Note: See TracChangeset for help on using the changeset viewer.