Ignore:
Timestamp:
08/17/10 16:17:12 (14 years ago)
Author:
viani
Message:

Ticket #1135 - Merged r1990:3166 from /trunk/workflow into /branches/2.2/workflow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/workflow/inc/class.ui_adminactivities.inc.php

    r1710 r3167  
    22 
    33require_once dirname(__FILE__) . SEP . 'class.WorkflowUtils.inc.php'; 
    4 require_once dirname(__FILE__) . SEP . 'class.fsutils.inc.php'; /* toolkit for filesystem handling */ 
    54require_once 'engine' . SEP . 'config.egw.inc.php'; 
    65/** 
     
    7372                parent::WorkflowUtils(); 
    7473 
    75                 $this->workflow_acl = CreateObject('workflow.workflow_acl'); 
     74                $this->workflow_acl = Factory::getInstance('workflow_acl'); 
    7675                $denyAccess = true; 
    7776                if ($this->workflow_acl->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id'])) 
     
    106105                } 
    107106 
    108                 $this->process_manager  = CreateObject('workflow.workflow_processmanager'); 
    109                 $this->activity_manager = CreateObject('workflow.workflow_activitymanager'); 
    110                 $this->role_manager     = CreateObject('workflow.workflow_rolemanager'); 
    111                 $this->fs = new FsUtils(); /* gets instance */ 
     107                $this->process_manager  = Factory::getInstance('workflow_processmanager'); 
     108                $this->activity_manager = Factory::getInstance('workflow_activitymanager'); 
     109                $this->role_manager     = Factory::getInstance('workflow_rolemanager'); 
     110                $this->fs = &Factory::newInstance('FsUtils'); /* gets instance */ 
    112111 
    113112        } 
     
    374373                // fill proc_bar 
    375374                $this->t->set_var('proc_bar', $this->fill_proc_bar($proc_info)); 
    376                  
     375 
    377376                //collect some messages from used objects 
    378377                $this->message[] = $this->activity_manager->get_error(false, _DEBUG); 
     
    380379                $this->message[] = $this->role_manager->get_error(false, _DEBUG); 
    381380 
    382                 $templateServer = &$GLOBALS['workflow']['factory']->getInstance('TemplateServer'); 
     381                $templateServer = &Factory::getInstance('TemplateServer'); 
    383382 
    384383                // fill the general variables of the template 
     
    732731                        $this->translate_template('block_process_activities_header'); 
    733732                        $this->t->parse('process_activities_header', 'block_process_activities_header', True); 
    734                         $templateServer = &$GLOBALS['workflow']['factory']->getInstance('TemplateServer'); 
     733                        $templateServer = &Factory::getInstance('TemplateServer'); 
    735734                        foreach ($process_activities_data as $activity) 
    736735                        { 
     
    792791                                'trans_href_from'       => $GLOBALS['phpgw']->link('/index.php', 'menuaction=workflow.ui_adminactivities.form&where2='. $where2 .'&sort_mode2='. $sort_mode2 .'&p_id='. $this->wf_p_id .'&find='. $find .'&where='. $where .'&sort_mode='. $this->sort_mode .'&activity_id='. $transition['wf_act_from_id']), 
    793792                                'trans_actFromName'     => $transition['wf_act_from_name'], 
    794                                 'trans_arrow'           => $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateImageLink('next.gif'), 
     793                                'trans_arrow'           => Factory::getInstance('TemplateServer')->generateImageLink('next.gif'), 
    795794                                'trans_href_to'         => $GLOBALS['phpgw']->link('/index.php', 'menuaction=workflow.ui_adminactivities.form&where2='. $where2 .'&sort_mode2='. $sort_mode2 .'&p_id='. $this->wf_p_id .'&find='. $find .'&where='. $where .'&sort_mode='. $this->sort_mode .'&activity_id='. $transition['wf_act_to_id']), 
    796795                                'trans_actToName'       => $transition['wf_act_to_name'], 
     
    10361035                $image_name = $proc_info['wf_normalized_name'] . SEP . 'graph' . SEP . $proc_info['wf_normalized_name'] . '.png'; 
    10371036                $image = GALAXIA_PROCESSES . SEP . $image_name; 
    1038                 if ($GLOBALS['workflow']['factory']->getInstance('BrowserInfo')->isOpera()) 
    1039                         $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 
    10401073                else 
    1041                         $maximumDimension = 2500; 
    1042  
    1043                 $dims = getimagesize($image); 
    1044                 list($originalWidth, $originalHeight) = $dims; 
    1045  
    1046                 /* the image must be resized */ 
    1047                 if (max($originalWidth, $originalHeight) > $maximumDimension) 
    1048                 { 
    1049                         /* define the new width and height */ 
    1050                         $newWidth = $newHeight = $maximumDimension; 
    1051                         if ($originalWidth > $originalHeight) 
    1052                                 $newHeight = $maximumDimension * ($originalHeight / $originalWidth); 
    1053                         else 
    1054                                 $newWidth = $maximumDimension * ($originalWidth / $originalHeight); 
    1055  
    1056                         /* create the new image and send to the browser */ 
    1057                         $smallerImage = imagecreatetruecolor($newWidth, $newHeight); 
    1058                         imagecopyresampled($smallerImage, imagecreatefrompng($image), 0, 0, 0, 0, $newWidth, $newHeight, $originalWidth, $originalHeight); 
    1059                         header('content-disposition: inline; filename=' . $image_name); 
    1060                         header('content-type: ' . $dims['mime']); 
    1061                         imagepng($smallerImage); 
    1062                 } 
    1063                 else 
    1064                 { 
    1065                         header('content-disposition: inline; filename=' . $image_name); 
    1066                         header('content-type: ' . $dims['mime']); 
    1067                         header('content-length: ' . filesize($image)); 
    1068                         readfile($image); 
    1069                 } 
    1070         } 
    1071          
     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); 
     1087                } 
     1088        } 
     1089 
    10721090        /** 
    10731091         * Dislays the activity agents config rows 
     
    10901108                        } 
    10911109                        $this->translate_template('admin_agents'); 
    1092                                                                                                 $this->t->parse('agents_config_rows', 'admin_agents'); 
     1110                        $this->t->parse('agents_config_rows', 'admin_agents'); 
    10931111                } 
    10941112        } 
Note: See TracChangeset for help on using the changeset viewer.