Changeset 3061 for sandbox/workflow


Ignore:
Timestamp:
07/15/10 17:50:39 (14 years ago)
Author:
viani
Message:

Ticket #1015 - Merged 2466:3060 /sandbox/workflow/trunk/ em /sandbox/workflow/branches/1015

Location:
sandbox/workflow/branches/1015
Files:
42 edited
2 copied

Legend:

Unmodified
Added
Removed
  • sandbox/workflow/branches/1015/doc/change_log.txt

    r1712 r3061  
    1515arifragoso is Ari Fragoso de Medeiros Junior 
    1616hermespinheiro is Hermes Pinheiro Neto 
    17  
    18 Os registros estão listados em ordem decrescente de data de realização. 
     17pedroerp is Pedro Eugênio Rocha Pedreira 
     18fabianok is Fabiano Sardenberg Kuss 
     19pereira.jair is Jair Gonçalves Pereira Junior 
     20adeildosantos is Adeildo Fernandes dos Santos 
     21 
     22[2.2.000] 
     23 
     24        #1143 - Refinição da função apache_request_headers, caso não exista no ambiente apache-php (viani) 
     25        #1139 - Modificação na função wf_upload_file para possibilitar a remoção de arquivos (fabianok) 
     26        #1131 - Modificação na exportação de processos para permitir templates com nomes aleatórios (viani) 
     27        #1120 - Moficado plugin wf_select_ldap_users para retornar atributos adicionais (adeildosantos) 
     28        #1119 - Implementado método getSupervisorAreas em class.wf_orgchart.php (pereira.jair) 
     29        #1089 - Melhoria em query sql na inserção de instancias. (fabianok) 
     30        #1082 - Removida coluna wf_parent_activity_id da tabela egw_wf_interinstance_relations (asaikawa) 
     31        #1080 - Modificada string (excluído) para (inativo) quando um registro de usuário no cache não existe mais no ldap. (viani) 
     32        #1069 - Inclusão de log de tempo de execução de atividades. (gbisotto/rufino) 
     33        #1004 - Melhorado o método getEmployeeCostCenterID para que retorne o id da área caso não exista o id do centro de custo do funcionário. (gbisotto) 
     34        #946 - Possibilitar que o plugin smarty wf_autocomplete_input atualize a lista de seleção a cada tecla pressionada. (asaikawa) 
     35        #944 - Alteração na função javascript get_form_fields para retornar em array os elementos identificados com '[]'. (asaikawa) 
     36        #943 - Criar na classe wf_location, uma consulta de cidades pelo início do nome. (asaikawa) 
     37        #942 - Ajustar a classe wf_location para considerar a nova coluna que identifica se o registro é distrito. (asaikawa) 
     38        #935 - Incluída opção para listar funcionários em ordem alfabética geral na impressão do organograma. (pedroerp) 
     39        #928 - Incluída busca por telefone no organograma. (pedroerp) 
     40        #916 - Criada nova variável wf_webserver_url no contexto de execução dos processos. (pedroerp) 
     41        #870 - Correção de bug no parâmetro print_mode da classe run_activity. (pedroerp) 
     42        #869 - Indentificação do titular e substituro de áreas do organograma. (pedroerp) 
     43        #868 - Correção da altura das janelas de edição do organograma. (pedroerp) 
     44        #609 - Reconstrução da classe factory (pedroerp/rufino) 
     45        #441 - Inclusão do período de substituição de chefia no organograma. (pedroerp) 
    1946 
    2047[2.1.000] 
    2148 
     49        #989 - Compatibilização do workflow com os novos temas do Expresso. (rodsouza) 
     50        #951 - Correção de bug na verificação de sessão das chamadas ajax do workflow. (viani) 
    2251        #794 - Correção de bug de sintaxe na classe Workflow_WfSecurity. (hermespinheiro). 
    2352        #792 - Modificado o atribuito de usuário padrão de uma atividade para aceitar também um perfil padrão. (rufino) 
     
    2756        #658 - Correção no alinhamento dos ícones de aplicações externas. Ao redimensionar a janela, o ícones são reorganizados. (gbisotto) 
    2857        #657 - Correção no alinhamento do menu de atividades dos processos. Ao redimensionar a janela, os menus são reorganizados. (gbisotto). 
     58        #643 - Criação do método createNewInstance na classe JobBase, que possibilita iniciar uma instância do processo a partir de um job. (rufino) 
    2959        #639 - Inclusão de cor em destaque ao passar o mouse sobre uma linha nas visualizações do organograma. (rodsouza) 
    3060        #638 - Mudança na query de busca do organograma para pesquisar também por áreas. (rodsouza) 
    31         #643 - Criação do método createNewInstance na classe JobBase, que possibilita iniciar uma instância do processo a partir de um job. (rufino) 
     61        #637 - Inclusão de click-to-call no organograma e outras melhorias na interface. (rodsouza) 
     62        #603 - Remoção do design pattern observer da engine do workflow, por inutilidade. (gbisotto) 
    3263        #442 - Criação do plugin wf_autocomplete_input, para listar com autocomplete o resultado de uma busca ajax. (rufino) 
    33         #637 - Inclusão de click-to-call no organograma e outras melhorias na interface. (rodsouza) 
     64 
     65[2.0.004] 
     66 
     67        #1045 - Corrigido bug de sessão nas chamadas ajax de processos. (viani) 
     68        #951 - Corrigido bug na verificação de sessão ativa nas chamadas ajax de processos. (viani) 
     69 
     70[2.0.003] 
     71        #899 - Inclusão de inserts faltantes no arquivo default_records, além de atualização de estrutura de tabelas do organograma. (pedroerp) 
     72 
     73[2.0.001] 
     74 
     75        #671 - Inclusão do arquivo header.session.inc.php para a verificação de segurança de sessão. (asaikawa) 
    3476 
    3577[2.0.000] 
    3678 
    37         * Correção de bug no método getByUser da classe wf_instance. (hermespinheiro) 
    38         * Melhorias no organograma, com novas visualizações nas interfaces. (rodsouza) 
     79        #641 - Correção de bug no método getByUser da classe wf_instance. (hermespinheiro) 
     80        #589 - Melhorias no organograma, com novas visualizações nas interfaces. (rodsouza) 
     81        #439 - Redução do tempo de carga dos funcionários de uma área no organograma (rodsouza) 
    3982 
    4083[1.8.05.000] 
  • sandbox/workflow/branches/1015/inc/class.WorkflowLDAP.inc.php

    r2372 r3061  
    377377         * @access public 
    378378         */ 
    379         function getUsers($context) 
    380         { 
    381                 $filter = '(&(phpgwaccounttype=u)(!(phpgwAccountVisible=-1)))'; 
     379        function getUsers($context, $onlyVisibleAccounts = true) 
     380        { 
     381                $filter = '(phpgwaccounttype=u)'; 
     382                if($onlyVisibleAccounts) 
     383                        $filter = '(&' . $filter . '(!(phpgwAccountVisible=-1)))'; 
     384 
    382385                $elements = array('uidnumber', 'cn', 'mail'); 
    383386                return $this->getEntities($context, $filter, $elements, 'u', false); 
     
    561564         * @access public 
    562565         */ 
    563         function search($searchTerm, $includeUsers = true, $includeGroups = false, $includeLists = false, $context = null) 
     566        function search($searchTerm, $includeUsers = true, $includeGroups = false, $includeLists = false, $context = null, $onlyVisibleAccounts = true) 
    564567        { 
    565568                if (!($includeUsers || $includeGroups || $includeLists)) 
     
    586589                        $entityFilter = $entityFilter[0]; 
    587590 
    588                 $filter = "(&{$entityFilter}(cn={$searchTerm})(!(phpgwAccountVisible=-1)))"; 
     591                if($onlyVisibleAccounts) 
     592                        $filter = "(&{$entityFilter}(cn={$searchTerm})(!(phpgwAccountVisible=-1)))"; 
     593                else 
     594                        $filter = "(&{$entityFilter}(cn={$searchTerm}))"; 
     595 
    589596                $resourceIdentifier = ldap_search($this->dataSource, $context, $filter, array('cn', 'uidnumber', 'gidnumber', 'phpgwaccounttype', 'mail')); 
    590597                ldap_sort($this->dataSource, $resourceIdentifier, 'cn'); 
  • sandbox/workflow/branches/1015/inc/class.basemodel.inc.php

    r795 r3061  
    167167    * @param string $obj Class name 
    168168    * @return mixed 
    169     * @deprecated 
     169    * @deprecated 2.2.00.000 
    170170    * @access public 
    171171    */ 
    172172        function &getInstance($obj) 
    173     { 
     173        { 
     174                wf_warn_deprecated_method('Factory', 'getInstance'); 
    174175                return(wf_create_object(strtolower($obj))); 
    175176        } 
  • sandbox/workflow/branches/1015/inc/class.bo_participants.inc.php

    r2372 r3061  
    7474                { 
    7575                        $preffix = ($usePreffix) ? 'u' : ''; 
    76                         $ents = $this->ldap->getUsers($params['context']); 
     76                        $ents = $this->ldap->getUsers($params['context'], $params['onlyVisibleAccounts']); 
    7777                        foreach ($ents as $ent) 
    7878                                $output[$preffix . $ent[$id]] = $ent['name']; 
     
    162162                $searchLists = (strpos($entities, 'l') !== false); 
    163163 
     164                $onlyVisibleAccounts = $params['onlyVisibleAccounts']; 
     165 
    164166                /* faz a busca */ 
    165167                $output = array(); 
    166                 $output['participants'] = $this->ldap->search($searchTerm, $searchUsers, $searchGroups, $searchLists); 
     168                $output['participants'] = $this->ldap->search($searchTerm, $searchUsers, $searchGroups, $searchLists, null, $onlyVisibleAccounts); 
    167169 
    168170                /* limita os resultados e define uma mensagem que será exibida */ 
  • sandbox/workflow/branches/1015/inc/class.bo_userinterface.inc.php

    r2372 r3061  
    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 
  • sandbox/workflow/branches/1015/inc/class.bo_utils.inc.php

    r2372 r3061  
    6464         */ 
    6565        function search_ldap_users_by_cn($params) 
    66         { 
     66        {  
    6767                // parâmetro a ser procurado no ldap 
    6868                $cn = trim(ereg_replace(' +', ' ', $params['cn'])); 
     
    8686                        $ret_name = empty($params['name']) ? 'cn' : $params['name']; 
    8787 
     88                        $ret_complement = empty($params['complement']) ? '' : $params['complement']; 
     89 
    8890                        $ajaxConfig = &Factory::newInstance('ajax_config', 'contactcenter'); 
    8991                        $config = $ajaxConfig->read_repository(); 
     
    103105 
    104106                                $filter     = '(&(uid=*)(phpgwAccountType=u)(!(phpgwAccountVisible=-1))(cn=*' . $cn . '*))'; 
    105                                 $attrib_ret = array('cn', $ret_id, $ret_name); 
     107 
     108                                if($ret_complement != '') 
     109                                        $attrib_ret = array('cn', $ret_id, $ret_name, $ret_complement); 
     110                                else 
     111                                        $attrib_ret = array('cn', $ret_id, $ret_name); 
    106112 
    107113                                $r = ldap_search($ds, $ldapconfig['basedn'], $filter, $attrib_ret, 0, 0, 5); 
     
    112118                                        } 
    113119                                        elseif(ldap_count_entries($ds, $r) < 200){ 
     120 
    114121                                                $result = ldap_get_entries($ds, $r); 
    115                                                 foreach($result as $value){ 
    116                                                         $output['values'][] = array( 
    117                                                                 'id'   => $value[$ret_id], 
    118                                                                 'name' => trim(ucwords(strtolower($value[$ret_name][0])))); 
     122 
     123                                                foreach($result as $value){  
     124                                                        if( ($value[$ret_name][0] != '') && ($value[$ret_complement][0] != '') ){ 
     125                                                                        $complement = " >> " . $value[$ret_complement][0]; 
     126                                                                        $output['values'][] = array( 
     127                                                                                                                                 'id'   => $value[$ret_id], 
     128                                                                                                                                 'name' => trim(ucwords(strtolower($value[$ret_name][0]))) . $complement 
     129                                                                                                                           );  
     130 
     131                                                        } 
     132                                                elseif($value[$ret_name][0] != ''){ 
     133                                                                $output['values'][] = array( 
     134                                                                                                                         'id'   => $value[$ret_id], 
     135                                                                                                                         'name' => trim(ucwords(strtolower($value[$ret_name][0]))) 
     136                                                                                                                   );  
     137                                                        } 
     138                                                else{ 
     139                                                                $output['values'][] = array( 
     140                                                                                                                         'id'   => '', 
     141                                                                                                                         'name' => "-- Selecione uma Opção --" 
     142                                                                                                                   );  
     143                                                        } 
     144 
    119145                                                } 
    120  
    121146 
    122147                                                foreach ($output['values'] as $key => $value){ 
     
    140165                else{ 
    141166                        $output['msg'] = 'Não digite caracteres especiais nem números. Apenas letras e espaços são permitidos.'; 
    142                 } 
     167                }  
    143168                return $output; 
    144169        } 
  • sandbox/workflow/branches/1015/inc/class.run_activity.inc.php

    r2588 r3061  
    2424     */ 
    2525        class run_activity extends WorkflowUtils 
    26         {        
     26        { 
    2727                /** 
    2828                 * @var array  $public_functions func 
     
    5050                 * @access public 
    5151                 */ 
    52                 var $process;    
     52                var $process; 
    5353                /** 
    5454                 * @var object $GUI  GUI engine object. Act carefully with it. 
     
    6262                var $message = Array(); 
    6363                /** 
    64                  * @var object $categories categorie object for categories  
     64                 * @var object $categories categorie object for categories 
    6565                 * @access public 
    6666                 */ 
    6767                var $categories; 
    6868                /** 
    69                  * @var array $conf  
    70                  * @access public 
    71                  */ 
    72                 var $conf = array();     
     69                 * @var array $conf 
     70                 * @access public 
     71                 */ 
     72                var $conf = array(); 
    7373                /** 
    7474                 * @var $wf_template local activity template 
     
    7676                 */ 
    7777                var $wf_template; 
    78                 /**  
     78                /** 
    7979                 * @var object $instance 
    8080                 * @access public 
    8181                 */ 
    8282                var $instance; 
    83                 /**  
     83                /** 
    8484                 * @var object $activity_type The type of activity 
    8585                 * @access public 
     
    8888                // then we retain all usefull vars as members, to make them avaible in user's source code 
    8989                // theses are data which can be set before the user code and which are not likely to change because of the user code 
    90                 /**  
    91                  * @var int $process_id The process id  
     90                /** 
     91                 * @var int $process_id The process id 
    9292                 * @access public 
    9393                 */ 
    9494                var $process_id; 
    95                 /**  
    96                  * @var int $activity_id The activity id  
     95                /** 
     96                 * @var int $activity_id The activity id 
    9797                 * @access public 
    9898                 */ 
    9999                var $activity_id; 
    100                 /**  
     100                /** 
    101101                 * @var int $process_name The process name 
    102102                 * @access public 
    103103                 */ 
    104104                var $process_name; 
    105                 /**  
    106                  * @var int $process_version The process_version  
     105                /** 
     106                 * @var int $process_version The process_version 
    107107                 * @access public 
    108108                 */ 
    109109                var $process_version; 
    110                 /**  
    111                  * @var int $activity_name The process id  
     110                /** 
     111                 * @var int $activity_name The process id 
    112112                 * @access public 
    113113                 */ 
    114114                var $activity_name; 
    115                 /**  
    116                  * @var int $user_name The user name  
     115                /** 
     116                 * @var int $user_name The user name 
    117117                 * @access public 
    118118                 */ 
    119119                var $user_name; 
    120                 /**  
    121                  * @var int $view_activity activity id of the view activity avaible for this process  
     120                /** 
     121                 * @var int $view_activity activity id of the view activity avaible for this process 
    122122                 * @access public 
    123123                 */ 
    124124                var $view_activity; 
    125                 // theses 4 vars aren't avaible for the user code, they're set only after this user code was executed            
    126                 /**  
    127                  * @var int $instance_id Instance id  
     125                // theses 4 vars aren't avaible for the user code, they're set only after this user code was executed 
     126                /** 
     127                 * @var int $instance_id Instance id 
    128128                 * @access public 
    129129                 */ 
    130130                var $instance_id=0; 
    131                 /**  
    132                  * @var string $instance_name Instance name  
     131                /** 
     132                 * @var string $instance_name Instance name 
    133133                 * @access public 
    134134                 */ 
    135135                var $instance_name=''; 
    136                 /**  
    137                  * @var int $instance_owner Instance owner id  
     136                /** 
     137                 * @var int $instance_owner Instance owner id 
    138138                 * @access public 
    139139                 */ 
    140140                var $instance_owner=0; 
    141                 /**  
    142                  * @var string $owner_name Owner name  
     141                /** 
     142                 * @var string $owner_name Owner name 
    143143                 * @access public 
    144144                 */ 
    145145                var $owner_name=''; 
    146                  
     146 
    147147                /** 
    148148                 * @var bool $print_mode print mode 
     
    155155                 */ 
    156156                var $enable_print_mode = false; 
    157                  
     157 
    158158                /** 
    159159                 * @var array $act_role_names of roles associated with the activity, usefull for lists of users associated with theses roles 
    160                  * @access public        
     160                 * @access public 
    161161                 */ 
    162162                var $act_role_names= Array(); 
    163                  
     163 
    164164                /** 
    165165                 * @var array $agents Array of ui_agent objects 
     
    172172                 * @access public 
    173173                 */ 
    174                 var $smarty;                 
     174                var $smarty; 
    175175                /** 
    176176                 * @var array $wf holds a global environment vector 
    177177                 * @access public 
    178178                 */ 
    179                 var $wf;                     
     179                var $wf; 
    180180                /** 
    181181                 * @var $download_mode activates download mode 
    182182                 * @access public 
    183183                 */ 
    184                 var $download_mode;         
     184                var $download_mode; 
    185185                /** 
    186186                 * @var string $_template_name holds the template's file name 
    187187                 * @access public 
    188188                 */ 
    189                 var $_template_name = null;  
     189                var $_template_name = null; 
    190190                /** 
    191191                 * @var bool Indicates wether the current instance is a child instance or not 
     
    193193         */ 
    194194                var $isChildInstance = false; 
     195 
    195196                /** 
    196197                 * @var object Stores a 'workflow_smarty' object 
     
    200201 
    201202                /** 
     203                 * @var object Log Object 
     204         * @access private 
     205         */ 
     206                private $logger = null; 
     207 
     208                /** 
    202209                 * Constructor 
    203                  *  
    204                  * @access public  
     210                 * 
     211                 * @access public 
    205212                 */ 
    206213                function run_activity() 
     
    218225 
    219226                        $this->workflowSmarty   = &Factory::getInstance('workflow_smarty', false); 
     227 
     228                        // never configure a log of type "firebug" here. This will make goAjax stop running well =( 
     229                        $this->logger                   = &Factory::getInstance('Logger', array('file')); 
    220230 
    221231                        // TODO: open a new connection to the database under a different username to allow privilege handling on tables 
     
    236246                function go($activity_id=0, $iid=0, $auto=0) 
    237247                { 
     248                        $totalTime = microtime(true); 
     249 
    238250                        $result=Array(); 
    239251 
     
    431443 
    432444                        /* BEGIN WORKFLOW MVC SETTINGS */ 
    433                         $env = array( );                                           //create settings vector 
     445                        $env = array();                                            //create settings vector 
    434446                        $env['view']          =& $smarty;                          //view layer instance 
    435447                        $env['template_file'] =& $_template_name;                  //template file to be shown 
    436                         $env['dao']           =& wf_create_object('wf_db');        //data access object instance 
     448                        $env['dao']                       =& Factory::newInstance('wf_db');    //data access object instance 
    437449                        $env['workflow']      =& $GLOBALS['workflow'];             //workflow environment information 
    438450                        $env['instance']      =& $instance;                        //process manager instance 
     
    441453                        $env['request']       =& $security->process($_REQUEST);    //sanitizes input data from client 
    442454                        $env['factory']       =& Factory::getInstance('ProcessWrapperFactory');  //instantiation controller class 
    443                         $env['natural']           =& wf_create_object('wf_natural');   //data access object instance for mainframe 
     455                        $env['natural']           =& Factory::newInstance('wf_natural');   //data access object instance for mainframe 
    444456                        /* END WORKFLOW MVC SETTINGS */ 
    445457 
     
    485497 
    486498                        /* include the files */ 
     499                        $processTime = microtime(true); 
     500 
    487501                        foreach ($_engineFiles as $_engineFile) 
    488502                                require $_engineFile; 
     503 
     504                        $processTime = (microtime(true) - $processTime); 
    489505 
    490506                        unset($GLOBALS['workflow_env']); 
     
    528544                        } 
    529545 
     546                        $totalTime = (microtime(true) - $totalTime); 
     547 
     548                        $logTime = sprintf("GO [pid=%s,iid=%s,uid=%s,aid=%s] [eng=%ss,proc=%ss]", 
     549                                                                $this->process_id, 
     550                                                                $this->instance_id, 
     551                                                                $GLOBALS['user'], 
     552                                                                $this->activity_id, 
     553                                                                number_format(($totalTime - $processTime),3), 
     554                                                                number_format($processTime,3) ); 
     555 
     556                        $this->logger->debug($logTime); 
     557 
    530558                        // TODO: process instance comments 
    531  
    532559                        $instructions = $this->runtime->handle_postUserCode(_DEBUG); 
    533560                        switch($instructions['action']) 
     
    593620                function goAjax($activity_id=0, $iid=0, $auto=0) 
    594621                { 
     622                        $totalTime = microtime(true); 
     623 
    595624                        $result=Array(); 
    596625 
     
    702731 
    703732                        /* BEGIN WORKFLOW MVC SETTINGS */ 
    704                         $env = array( );                                           //create settings vector 
    705                         $env['dao']           =& wf_create_object('wf_db');        //data access object instance 
     733                        $env = array();                                            //create settings vector 
     734                        $env['dao']                       =& Factory::newInstance('wf_db');    //data access object instance 
    706735                        $env['workflow']      =& $GLOBALS['workflow'];             //workflow environment information 
    707736                        $env['instance']      =& $instance;                        //process manager instance 
     
    710739                        $env['request']       =& $security->process($_REQUEST); //sanitizes input data from client 
    711740                        $env['factory']       =& Factory::newInstance('ProcessWrapperFactory');  //instantiation controller class 
    712                         $env['natural']           =& wf_create_object('wf_natural');   //data access object instance for mainframe 
     741                        $env['natural']           =& Factory::newInstance('wf_natural');   //data access object instance for mainframe 
    713742                        /* END WORKFLOW MVC SETTINGS */ 
    714743 
     
    727756                         * the messages for the process factory instead of Workflow 
    728757                         * factory. Note that this is the same comment as the previous 
    729                          * function... boooring.. =} 
     758                         * function... boooring.. 
    730759                         */ 
    731760                        Security::enable(); 
     
    734763                        $nc = &Factory::newInstance('NanoController'); 
    735764                        $nc->setClassPath(GALAXIA_PROCESSES . SEP . $this->process->getNormalizedName(). SEP . 'code'); 
     765 
     766                        $processTime = microtime(true); 
    736767                        $nc->iterateOverVirtualRequests(); 
     768                        $processTime = microtime(true) - $processTime; 
     769 
    737770                        $nc->outputResultData(); 
    738771                        unset($GLOBALS['workflow_env']); 
     
    740773                        if (!is_null($iid)) 
    741774                                $instance->instance->sync(); 
     775 
     776                        $totalTime = microtime(true) - $totalTime; 
     777 
     778                        $logTime = sprintf("GOAJAX [pid=%s,iid=%s,uid=%s,aid=%s] [eng=%ss,proc=%ss]", 
     779                                                                $this->process_id, 
     780                                                                $this->instance_id, 
     781                                                                $GLOBALS['user'], 
     782                                                                $this->activity_id, 
     783                                                                number_format(($totalTime - $processTime),3), 
     784                                                                number_format($processTime,3) ); 
     785 
     786                        $this->logger->debug($logTime); 
    742787                } 
    743788 
  • sandbox/workflow/branches/1015/inc/class.so_move_instances.inc.php

    r2588 r3061  
    318318                } 
    319319 
    320                 /* format the array elements for use in a SELECT SQL statement, e.g. [iid => 12, aid = 27] would produce (12, 27) */ 
    321                 $instanceActivityList = array_map(create_function('$e', 'return \'(\' . $e[\'iid\'] . \', \' . $e[\'aid\'] . \')\';'), $instanceActivityList); 
    322  
    323                 /* update the interinstance relations of the modified rows of the instance_activities table */ 
    324                 $resultSet = $this->db->query("SELECT wf_parent_instance_id, wf_parent_activity_id FROM egw_wf_interinstance_relations WHERE ((wf_parent_instance_id, wf_parent_activity_id) IN (" . implode(', ', $instanceActivityList) . "))"); 
    325                 $rows = $resultSet->GetArray(-1); 
    326                 if (is_array($rows)) 
    327                 { 
    328                         foreach ($rows as $row) 
    329                         { 
    330                                 /* update the activity ID */ 
    331                                 if (!$this->db->query("UPDATE egw_wf_interinstance_relations SET wf_parent_activity_id = ? WHERE (wf_parent_instance_id = ?) AND (wf_parent_activity_id = ?)", array($activitiesConvert[$row['wf_parent_activity_id']], $row['wf_parent_instance_id'], $row['wf_parent_activity_id']))) 
    332                                 { 
    333                                         $this->db->FailTrans(); 
    334                                         return array('error' => 'Erro atualizando a tabela de relacionamento inter-instância. Nenhuma modificação foi salva'); 
    335                                 } 
    336                         } 
    337                 } 
    338  
    339320                /* in case of success, commit the modifications */ 
    340321                $this->db->CompleteTrans(); 
  • sandbox/workflow/branches/1015/inc/class.so_userinterface.inc.php

    r2588 r3061  
    333333                        { 
    334334                                $employees[$i]['telephoneNumber'] = is_null($entry['telephonenumber']) ? '' : $entry['telephonenumber']; 
    335                                 $employees[$i]['cn'] = is_null($entry['cn']) ? '' : $entry['cn'] . (is_null($entry['last_update']) ? ' <font color="red">(excluído)</font>' : ''); 
     335                                $employees[$i]['cn'] = is_null($entry['cn']) ? '' : $entry['cn'] . (is_null($entry['last_update']) ? ' <font color="red">(inativo)</font>' : ''); 
    336336                        } 
    337337                } 
  • sandbox/workflow/branches/1015/inc/class.ui_adminactivities.inc.php

    r2372 r3061  
    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        } 
  • sandbox/workflow/branches/1015/inc/class.ui_adminroles.inc.php

    r2372 r3061  
    276276                                        $entry = $cachedLDAP->getEntryByID($mapping['wf_user']); 
    277277                                        $cname = $GLOBALS['phpgw']->translation->convert($entry['cn'],'utf-8'); 
    278                                         $glabel = ""; 
     278                                        $glabel = (!empty($entry['uid'])) ? '[' . $entry['uid'] . ']' : ''; 
    279279                                        if (is_null($entry['last_update'])) 
    280                                                 $glabel = '<font color="red">(excluído)</font>'; 
     280                                                $glabel = '<font color="red">(inativo)</font>'; 
    281281                                } 
    282282 
  • sandbox/workflow/branches/1015/inc/class.ui_participants.inc.php

    r2372 r3061  
    9292                $hideSectors = ($_REQUEST['hideSectors'] == '1') ? true : false; 
    9393 
     94                // the default value of $onlyVisibleAccounts is true 
     95                if((isset($_REQUEST['onlyVisibleAccounts'])) && (empty($_REQUEST['onlyVisibleAccounts']) || $_REQUEST['onlyVisibleAccounts'] === 'false')) 
     96                        $onlyVisibleAccounts = false; 
     97                else 
     98                        $onlyVisibleAccounts = true; 
     99 
    94100                /* define the initial organization */ 
    95101                $selectedOrganization = $ldap->getOrganizationFromDN($userDN); 
     
    117123                $smarty->assign('organizations', $organizationList); 
    118124                $smarty->assign('selectedOrganization', $selectedOrganization); 
    119                 $smarty->assign('sectors', $this->bo->getSectors(array('organization' => $selectedOrganization), true)); 
     125                $smarty->assign('sectors', $this->bo->getSectors(array('organization' => $selectedOrganization, 'onlyVisibleAccounts' => $onlyVisibleAccounts), true)); 
    120126                $smarty->assign('selectedSector', $selectedSector); 
    121                 $smarty->assign('participants', $this->bo->getEntities(array('entities' => $entities, 'id' => $id, 'context' => $selectedSector, 'usePreffix' => $usePreffix), true)); 
     127                $smarty->assign('participants', $this->bo->getEntities(array('entities' => $entities, 'id' => $id, 'context' => $selectedSector, 'onlyVisibleAccounts' => $onlyVisibleAccounts, 'usePreffix' => $usePreffix), true)); 
    122128                $smarty->assign('entities', $entities); 
    123129                $smarty->assign('id', $id); 
     
    126132                $smarty->assign('hideOrganizations', $hideOrganizations); 
    127133                $smarty->assign('hideSectors', $hideSectors); 
     134                $smarty->assign('onlyVisibleAccounts', $onlyVisibleAccounts); 
    128135                $smarty->assign('header', $smarty->expressoHeader); 
    129136                $smarty->assign('txt_loading', lang("loading")); 
  • sandbox/workflow/branches/1015/inc/class.workflow_processmanager.inc.php

    r2372 r3061  
    226226                          fclose($fp); 
    227227                          $out.='      ]]></code>'; 
    228                           if($res['wf_is_interactive']=='y') { 
    229                                 $out.='      <template><![CDATA['; 
    230                                 $fp=fopen(GALAXIA_PROCESSES.SEP."$wf_procname".SEP."code".SEP."templates".SEP."$name.tpl","r"); 
    231                                 //while(!feof($fp)) { 
    232                                 //      $line=fread($fp,8192); 
    233                                         $out.=''; //all templatess will be exported in another section 
    234                                 //} 
    235                                 fclose($fp); 
    236                                 $out.='      ]]></template>'; 
    237                           } 
    238228                          $out.='    </activity>'."\n";     
    239229                        } 
  • sandbox/workflow/branches/1015/inc/common.inc.php

    r2588 r3061  
    7070require_once WF_LIB_ROOT . 'factory/WorkflowFactory.php'; 
    7171require_once WF_LIB_ROOT . 'factory/ProcessFactory.php'; 
     72require_once WF_INC_ROOT . 'common_functions.inc.php'; 
    7273?> 
  • sandbox/workflow/branches/1015/inc/engine/src/API/BaseActivity.php

    r2372 r3061  
    8484   * Seems to be the rest of a bad object architecture 
    8585   *  
    86    * @deprecated 
     86   * @deprecated 2.2.00.000 
    8787   */ 
    8888  function setDb(&$db) 
    8989  { 
     90        wf_warn_deprecated_method(); 
    9091    $this->db =& $db; 
    9192  } 
     
    550551   * e.g. $isadmin = $activity->checkUserRole($user,'admin') 
    551552   *  
    552    * @deprecated Unused function. Old API, do not use it. Return always false 
     553   * @deprecated 2.2.00.000 - Unused function. Old API, do not use it. Return always false 
    553554   */ 
    554555  function checkUserRole($user,$rolename)  
    555556  { 
     557        wf_warn_deprecated_method(); 
    556558    $this->error[] = 'use of an old deprecated function checkUserRole, return always false'; 
    557559    return false; 
  • sandbox/workflow/branches/1015/inc/engine/src/API/Instance.php

    r2588 r3061  
    8484   */ 
    8585  var $parentLock = false; 
    86   /** 
    87    * @var int $parentActivityId The activity ID of the parent instance 
    88    * @access public 
    89    */ 
    90   var $parentActivityId; 
    9186  /** 
    9287   * @var int $parentInstanceId The instance ID of the parent instance 
     
    490485    return ''; 
    491486  } 
    492   
     487 
    493488  /** 
    494489   * Creates a new instance. 
     
    503498  function _createNewInstance($activityId,$user) { 
    504499    // Creates a new instance setting up started, ended, user, status and owner 
    505     $pid = $this->getOne('select wf_p_id from '.GALAXIA_TABLE_PREFIX.'activities where wf_activity_id=?',array((int)$activityId)); 
     500    $pid = $this->getOne('SELECT wf_p_id FROM '.GALAXIA_TABLE_PREFIX.'activities WHERE wf_activity_id=?',array((int)$activityId)); 
    506501    $this->pId = $pid; 
    507502    $this->setStatus('active'); 
     
    510505    $this->setStarted($now); 
    511506    $this->setOwner($user); 
    512      
    513     $query = 'insert into '.GALAXIA_TABLE_PREFIX.'instances 
    514       (wf_started,wf_ended,wf_status,wf_p_id,wf_owner,wf_properties)  
    515       values(?,?,?,?,?,?)'; 
    516     $this->query($query,array($now,0,'active',$pid,$user,$this->security_cleanup(Array(),false))); 
    517     $this->instanceId = $this->getOne('select max(wf_instance_id) from '.GALAXIA_TABLE_PREFIX.'instances  
    518                       where wf_started=? and wf_owner=?',array((int)$now,$user)); 
     507 
     508    //Get the id of new instance, before insert values in table and use this value from main table and relationship tables. 
     509    $this->instanceId = $this->getOne("SELECT nextval('seq_egw_wf_instances')"); 
    519510    $iid=$this->instanceId; 
    520      
     511 
     512    $query = 'INSERT INTO '.GALAXIA_TABLE_PREFIX.'instances 
     513                (wf_instance_id, wf_started,wf_ended,wf_status,wf_p_id,wf_owner,wf_properties) 
     514              VALUES 
     515                (?,?,?,?,?,?,?)'; 
     516 
     517    $this->query($query,array((int)$iid, $now,0,'active',$pid,$user,$this->security_cleanup(Array(),false))); 
     518 
    521519    // Then add in ".GALAXIA_TABLE_PREFIX."instance_activities an entry for the 
    522520    // activity the user and status running and started now 
    523     $query = 'insert into '.GALAXIA_TABLE_PREFIX.'instance_activities (wf_instance_id,wf_activity_id,wf_user, 
    524             wf_started,wf_status) values(?,?,?,?,?)'; 
     521    $query = 'INSERT INTO '.GALAXIA_TABLE_PREFIX.'instance_activities 
     522                (wf_instance_id,wf_activity_id,wf_user,wf_started,wf_status) 
     523              VALUES 
     524                (?,?,?,?,?)'; 
    525525    $this->query($query,array((int)$iid,(int)$activityId,$user,(int)$now,'running')); 
    526526 
    527527    if (($this->isChildInstance) && (!is_null($this->parentInstanceId))) 
    528528    { 
    529       $query = 'INSERT INTO '.GALAXIA_TABLE_PREFIX.'interinstance_relations(wf_parent_instance_id, wf_parent_activity_id, wf_child_instance_id, wf_parent_lock) VALUES(?,?,?,?)'; 
    530       $this->query($query,array((int) $this->parentInstanceId, (int) $this->parentActivityId, (int) $iid, (int) (($this->parentLock) ? 1 : 0))); 
    531     } 
    532      
     529      $query = 'INSERT INTO '.GALAXIA_TABLE_PREFIX.'interinstance_relations 
     530                  (wf_parent_instance_id, wf_child_instance_id, wf_parent_lock) 
     531                VALUES 
     532                  (?,?,?)'; 
     533      $this->query($query,array((int) $this->parentInstanceId, (int) $iid, (int) (($this->parentLock) ? 1 : 0))); 
     534    } 
     535 
    533536    //update database with other datas stored in the object 
    534537    return $this->sync(); 
    535538  } 
    536    
     539 
    537540  /** 
    538541   * Sets the name of this instance 
     
    11401143    return $this->__activity_completed; 
    11411144  } 
    1142   
     1145 
    11431146  /** 
    11441147   * This function can be called by the instance object himself (for automatic activities) 
    1145    * or by the WfRuntime object. In interactive activities code users use complete() --without args--  
    1146    * which refer to the WfRuntime->complete() function which call this one.  
     1148   * or by the WfRuntime object. In interactive activities code users use complete() --without args-- 
     1149   * which refer to the WfRuntime->complete() function which call this one. 
    11471150   * In non-interactive activities a call to a complete() will generate errors because the engine 
    11481151   * does it his own way as I said first. 
     
    11601163  { 
    11611164    //$this->db-> 
    1162     $result = $this->query("SELECT 1 FROM " . GALAXIA_TABLE_PREFIX . "instances i, " . GALAXIA_TABLE_PREFIX . "interinstance_relations ir WHERE (ir.wf_child_instance_id = i.wf_instance_id) AND (i.wf_status IN ('active', 'exception')) AND (ir.wf_parent_lock = 1) AND (ir.wf_parent_instance_id = ?) AND (ir.wf_parent_activity_id = ?)", array($this->instanceId, $activityId)); 
     1165    $result = $this->query("SELECT 1 FROM " . GALAXIA_TABLE_PREFIX . "instances i, " . GALAXIA_TABLE_PREFIX . "interinstance_relations ir WHERE (ir.wf_child_instance_id = i.wf_instance_id) AND (i.wf_status IN ('active', 'exception')) AND (ir.wf_parent_lock = 1) AND (ir.wf_parent_instance_id = ?)", array($this->instanceId)); 
    11631166    if ($result->numRows() > 0) 
    11641167      die("Esta instância está aguardando que outras instâncias, das quais depende, sejam finalizadas."); 
     
    11681171    //The complete() is in a transaction, it will be completly done or not at all 
    11691172    $this->db->StartTrans(); 
    1170      
     1173 
    11711174    //lock rows and ensure access is granted 
    11721175    if (!(isset($this->security))) $this->security = &Factory::getInstance('WfSecurity'); 
  • sandbox/workflow/branches/1015/inc/engine/src/ProcessMonitor/ProcessMonitor.php

    r2372 r3061  
    5959 
    6060  /** 
    61    * @deprecated 
     61   * @deprecated 2.2.00.000 
    6262   */ 
    6363  function update_instance_status($iid,$status) { 
     64        wf_warn_deprecated_method(); 
    6465    return; 
    6566    $query = "update `".GALAXIA_TABLE_PREFIX."instances` set `wf_status`=? where `wf_instance_id`=?"; 
     
    6970   
    7071  /** 
    71    * @deprecated 
     72   * @deprecated 2.2.00.000 
    7273   */ 
    7374  function update_instance_activity_status($iid,$activityId,$status) { 
     75        wf_warn_deprecated_method(); 
    7476    return; 
    7577    $query = "update `".GALAXIA_TABLE_PREFIX."instance_activities` set `wf_status`=? where `wf_instance_id`=? and `wf_activity_id`=?"; 
  • sandbox/workflow/branches/1015/inc/engine/src/common/WfRuntime.php

    r2372 r3061  
    66 * as it handle concurrency and part of the core execution of the instance while avoiding 
    77 * bad manipulation of the instance 
    8  *  
     8 * 
    99 * @package Galaxia 
    10  * @license http://www.gnu.org/copyleft/gpl.html GPL  
     10 * @license http://www.gnu.org/copyleft/gpl.html GPL 
    1111 */ 
    12 class WfRuntime extends Base  
    13 {   
     12class WfRuntime extends Base 
     13{ 
    1414  /** 
    1515   * @var array processes config values cached for this object life duration, init is done at first use for the only process associated with this runtime object 
    1616   * @access public 
    1717   */ 
    18   var $conf= Array();   
     18  var $conf= Array(); 
    1919  /** 
    2020   * @var object $activity 
    21    * @access public  
     21   * @access public 
    2222   */ 
    2323  var $activity = null; 
    2424  /** 
    2525   * @var object $instance 
    26    * @access public  
     26   * @access public 
    2727   */ 
    2828  var $instance = null; 
    2929  /** 
    3030   * @var int $instance_id 
    31    * @access public  
    32    */ 
    33   var $instance_id = 0;   
     31   * @access public 
     32   */ 
     33  var $instance_id = 0; 
    3434  /** 
    3535   * @var int $activity_id 
    36    * @access public  
     36   * @access public 
    3737   */ 
    3838  var $activity_id = 0; 
    3939  /** 
    4040   * @var object $process Retrieve process information 
    41    * @access public  
     41   * @access public 
    4242   */ 
    4343  var $process = null; 
    4444  /** 
    4545   * @var object $workitems  Reference to $instance->workitems 
    46    * @access public  
     46   * @access public 
    4747   */ 
    4848  var $workitems = null; 
    4949  /** 
    5050   * @var object $activities Reference to $instance->activities 
    51    * @access public  
    52    */   
     51   * @access public 
     52   */ 
    5353  var $activities = null; 
    5454  /** 
    5555   * @var object $security Security object 
    56    * @access public  
    57    */   
     56   * @access public 
     57   */ 
    5858  var $security = null; 
    5959  /** 
    6060   * @var bool $transaction_in_progress Transaction state 
    61    * @access public  
    62    */   
    63   var $transaction_in_progress = false;  
     61   * @access public 
     62   */ 
     63  var $transaction_in_progress = false; 
    6464  /** 
    6565   * @var bool $debug Debug state 
    66    * @access public  
    67    */    
     66   * @access public 
     67   */ 
    6868  var $debug=false; 
    6969  /** 
    7070   * @var bool $auto_mode Automatic mode state, non-interactive for instance, big impact on error handling 
    71    * @access public  
    72    */   
     71   * @access public 
     72   */ 
    7373  var $auto_mode=false; 
    7474 
     
    8181  /** 
    8282   * Constructor 
    83    *  
     83   * 
    8484   * @param object &$db ADOdb 
    8585   * @return object WfRuntime instance 
    8686   * @access public 
    8787   */ 
    88   function WfRuntime()  
     88  function WfRuntime() 
    8989  { 
    9090    $this->child_name = 'WfRuntime'; 
     
    101101   * Collect errors from all linked objects which could have been used by this object 
    102102   * Each child class should instantiate this function with her linked objetcs, calling get_error(true) 
    103    *  
     103   * 
    104104   * @param bool $debug false by default, if true debug messages can be added to 'normal' messages 
    105105   * @param string $prefix appended to the debug message 
    106    * @return void  
     106   * @return void 
    107107   * @access private 
    108108   */ 
     
    118118  /** 
    119119   * Ends-up dying and giving a last message 
    120    *  
     120   * 
    121121   * @param string $last_message last sentence 
    122122   * @param bool $include_errors false by default, if true we'll include error messages 
     
    134134    if ($this->debug) $debug = true; 
    135135    if ($this->auto_mode) $dying = false; 
    136      
     136 
    137137    if ($include_errors) 
    138138    { 
     
    161161   * Loads the config values for the process associated with the runtime 
    162162   * config values are cached while this WfRuntime object stays alive 
    163    *  
     163   * 
    164164   * @param array $arrayconf Config array with default value, where key is config option name and value is default value 
    165    * @access private  
     165   * @access private 
    166166   * @return array Values associated with the current process for the asked config options and as well for som WfRuntime internal config options 
    167167   */ 
     
    172172      $this->loadProcess(); 
    173173    } 
    174     $arrayconf['auto-release_on_leaving_activity'] = 1;   
     174    $arrayconf['auto-release_on_leaving_activity'] = 1; 
    175175    $this->conf =  $this->process->getConfigValues($arrayconf); 
    176176    return $this->conf; 
     
    179179  /** 
    180180   * Loads instance, the activity and the process, needed by the runtime engine to 'execute' the activity 
    181    *  
     181   * 
    182182   * @param int $activityId activity id, the activity we will run 
    183183   * @param int $instanceId instance Id, can be empty for a start or standalone activity 
    184    * @return bool  
     184   * @return bool 
    185185   * @access public 
    186186   */ 
     
    204204      return false; 
    205205    } 
    206      
     206 
    207207    //ensure the activity is not completed 
    208208    $this->instance->setActivityCompleted(false); 
    209209        $this->instance->activityID = $activityId; 
    210      
     210 
    211211    //set the workitems and activities links 
    212212    $this->workitems =& $this->instance->workitems; 
     
    214214    return true; 
    215215  } 
    216    
     216 
    217217  /** 
    218218   * Retrieves the process object associated with the activity 
    219    *  
     219   * 
    220220   * @param int $pId Process id of the process you want, if you do not give it we will try to take it from the activity 
    221221   * @return mixed Process object of the right type or false 
     
    242242    return true; 
    243243  } 
    244    
     244 
    245245  /** 
    246246   * Gets current process instance 
    247    *  
     247   * 
    248248   * @return object Process instance 
    249249   * @access public 
     
    256256  /** 
    257257   * Retrieves the activity of the right type from a baseActivity Object 
    258    *  
     258   * 
    259259   * @param int $activity_id activity_id you want 
    260260   * @param bool $with_roles will load the roles links on the object 
     
    285285    return true; 
    286286  } 
    287    
     287 
    288288  /** 
    289289   * Gets current activity instance 
    290    *  
     290   * 
    291291   * @return object Activity instance 
    292292   * @access public 
    293    */   
     293   */ 
    294294  function &getActivity() 
    295295  { 
    296296    return $this->activity; 
    297297  } 
    298    
     298 
    299299  /** 
    300300   * Gets the instance which could be an empty object 
    301    *  
     301   * 
    302302   * @param int $instanceId is the instance id 
    303303   * @return mixed Instance object which can be empty or string if something was turning bad 
     
    308308    $this->instance_id = $instanceId; 
    309309    $this->instance->getInstance($instanceId); 
    310     if ( ($this->instance->getInstanceId()==0)  
     310    if ( ($this->instance->getInstanceId()==0) 
    311311      && (! (($this->activity->getType()=='standalone') || ($this->activity->getType()=='start') )) ) 
    312312    { 
     
    319319    return true; 
    320320  } 
    321    
     321 
    322322  /** 
    323323   * Perform necessary security checks at runtime before running an activity 
    324324   * This will as well lock the tables via the security object 
    325325   * It should be launched in a transaction 
    326    *  
     326   * 
    327327   * @return bool true if ok, false if the user has no runtime access 
    328328   * @access public 
     
    356356   * This will as well lock the tables via the security object 
    357357   * It should be launched in a transaction 
    358    *  
     358   * 
    359359   * @return bool true if ok, false if the user has no runtime access instance and activity are unsetted in case of false check 
    360360   * @access public 
     
    372372        //we are granted an access to release but there is a special bad case where 
    373373        //we are a user authorized at releasing instances owned by others and where 
    374         //this instance is owned by another (for some quite complex reasons).  
     374        //this instance is owned by another (for some quite complex reasons). 
    375375        //we should not release this new user!! 
    376         //Then this is auto-release, not a conscious act and so we will release only  
     376        //Then this is auto-release, not a conscious act and so we will release only 
    377377        //if we can still grab this instance (avoiding the bad case) 
    378          
     378 
    379379        //test grab before release 
    380380        if ($this->checkUserRun()) 
     
    386386    return false; 
    387387  } 
    388    
     388 
    389389  /** 
    390390   * Sets/unsets the WfRuntime in debug mode 
    391    *  
     391   * 
    392392   * @param bool $debug_mode true by default, set it to false to disable debug mode 
    393393   * @access public 
    394    * @return void  
     394   * @return void 
    395395   */ 
    396396  function setDebug($debug_mode=true) 
     
    398398    $this->debug = $debug_mode; 
    399399  } 
    400    
     400 
    401401  /** 
    402402   * Sets/unsets the WfRuntime in automatic mode. i.e : executing 
    403403   * non-interactive or interactive activities. Automatic mode have big impacts 
    404404   * on error handling and on the way activities are executed 
    405    *  
     405   * 
    406406   * @param bool $auto_mode true by default, set it to false to disable automatic mode 
    407407   * @access public 
    408    * @return void  
     408   * @return void 
    409409   */ 
    410410  function setAuto($auto_mode=true) 
     
    412412    $this->auto_mode = $auto_mode; 
    413413  } 
    414    
     414 
    415415  /** 
    416416   * This function will start a transaction, call it before setActivityUser() 
    417    *  
    418    * @access public 
    419    * @return void  
     417   * 
     418   * @access public 
     419   * @return void 
    420420   */ 
    421421  function StartRun() 
     
    424424    $this->db->StartTrans(); 
    425425  } 
    426    
     426 
    427427  /** 
    428428   * This function ends the transactions started in StartRun() 
    429    *  
     429   * 
    430430   * @access public 
    431431   * @return void 
     
    433433  function EndStartRun() 
    434434  { 
    435     if ($this->transaction_in_progress)  
     435    if ($this->transaction_in_progress) 
    436436    { 
    437437      $this->db->CompleteTrans(); 
     
    439439    } 
    440440  } 
    441    
    442   /** 
    443    * For interactive activities this function will set the current user on the instance-activities table.  
     441 
     442  /** 
     443   * For interactive activities this function will set the current user on the instance-activities table. 
    444444   * This will prevent having several user using the same activity on the same intsance at the same time 
    445445   * But if you want this function to behave well you should call it after a checkUserRun or a checkUserRelease 
    446446   * and inside a transaction. Theses others function will ensure the table will be locked and the user 
    447447   * is really granted the action 
    448    *  
     448   * 
    449449   * @param bool $grab true by default, if false the user will be set to '*', releasing the instance-activity record 
    450450   * @access public 
    451    * @return bool  
     451   * @return bool 
    452452   */ 
    453453  function setActivityUser($grab=true) 
    454454  { 
    455     if(isset($GLOBALS['user']) && !empty($this->instance->instanceId) && !empty($this->activity_id))  
     455    if(isset($GLOBALS['user']) && !empty($this->instance->instanceId) && !empty($this->activity_id)) 
    456456    { 
    457457      if ($this->activity->isInteractive()) 
     
    480480      $this->error[] = $errors; 
    481481      return false; 
    482     }     
    483   } 
    484    
     482    } 
     483  } 
     484 
    485485  /** 
    486486   * Tries to give some usefull info about the current runtime 
    487    *  
     487   * 
    488488   * @return array associative arrays with keys/values which could be usefull 
    489489   * @access public 
     
    510510   * This part of the runtime will be runned just after the activity code inclusion. 
    511511   * We are in fact after all the "user code" part. We should decide what to do next 
    512    *  
     512   * 
    513513   * @param bool $debug false by default 
    514514   * @return array an array which must be analysed by the application run class. It contains 2 keys 
     
    525525  { 
    526526    $result = Array(); 
    527      
     527 
    528528     // re-retrieve instance id which could have been modified by a complete 
    529529     $this->instance_id = $this->instance->getInstanceId(); 
    530       
     530 
    531531     //synchronised instance object with the database 
    532532     $this->instance->sync(); 
     
    537537      if ($this->instance->getActivityCompleted()) 
    538538      { 
    539         // activity is interactive and completed,  
     539        // activity is interactive and completed, 
    540540        // we have to continue the workflow 
    541541        // and send any autorouted activity which could be after this one 
     
    554554        if ($GLOBALS['workflow']['__leave_activity']) 
    555555        { 
    556           // activity is interactive and the activity source set the  
     556          // activity is interactive and the activity source set the 
    557557          // $GLOBALS[workflow][__leave_activity] it's a 'cancel' mode. 
    558558          // we redirect the user to the leave activity page 
     
    561561        } 
    562562        else 
    563         {  
     563        { 
    564564          //the activity is not completed and the user doesn't want to leave 
    565565          // we loop on the form 
     
    570570    } 
    571571    else 
    572     {  
     572    { 
    573573      // in auto mode or with non interactive activities we return engine info 
    574574      // and we collect our errors, we do not let them for other objects 
     
    583583  /** 
    584584   * Gets the the 'Activity Completed' status 
    585    *  
    586    * @access public 
    587    * @return string  
     585   * 
     586   * @access public 
     587   * @return string 
    588588   */ 
    589589  function getActivityCompleted() 
     
    592592  } 
    593593 
    594    
     594 
    595595  //----------- Instance public function mapping ------------------------------------------- 
    596    
     596 
    597597  /** 
    598598   * Sets the next activity to be executed, if the current activity is 
    599599   * a switch activity the complete() method will use the activity setted 
    600    * in this method as the next activity for the instance.  
     600   * in this method as the next activity for the instance. 
    601601   * Note that this method receives an activity name as argument (Not an Id) 
    602602   * and that it does not need the activityId like the instance method 
    603    *  
     603   * 
    604604   * @param string $actname name of the next activity 
    605605   * @return bool 
    606606   * @access public 
    607607   */ 
    608   function setNextActivity($actname)  
     608  function setNextActivity($actname) 
    609609  { 
    610610    return $this->instance->setNextActivity($this->activity_id,$actname); 
     
    612612 
    613613  /** 
    614    * Sets the user that must perform the next  
     614   * Sets the user that must perform the next 
    615615   * activity of the process. this effectively "assigns" the instance to 
    616616   * some user 
    617    *  
     617   * 
    618618   * @param int $user the next user id 
    619619   * @param string $activityName The name of the activity that the user will be able to executed. '*' means the next activity. 
    620    * @return bool  
     620   * @return bool 
    621621   * @access public 
    622622   */ 
     
    631631 
    632632  /** 
    633    * Sets the user role that must perform the next  
     633   * Sets the user role that must perform the next 
    634634   * activity of the process. this effectively "assigns" the instance to 
    635635   * some user 
    636    *  
     636   * 
    637637   * @param string $roleName the next activity role 
    638638   * @param string $activityName The name of the activity that the role will be able to executed. '*' means the next activity. 
     
    655655 
    656656  /** 
    657    * Gets the user that must perform the next activity of the process.  
     657   * Gets the user that must perform the next activity of the process. 
    658658   * This can be empty if no setNextUser() was done before. 
    659659   * It wont return the default user but only the user which was assigned by a setNextUser 
    660    *  
    661    * @return int  
    662    * @access public 
    663    */ 
    664   function getNextUser()  
     660   * 
     661   * @return int 
     662   * @access public 
     663   */ 
     664  function getNextUser() 
    665665  { 
    666666    return $this->instance->getNextUser(); 
    667667  } 
    668   
     668 
    669669  /** 
    670670   * Sets the name of this instance. 
    671    *  
     671   * 
    672672   * @param string $value new name of the instance 
    673    * @return bool  
    674    * @access public 
    675    */ 
    676   function setName($value)  
     673   * @return bool 
     674   * @access public 
     675   */ 
     676  function setName($value) 
    677677  { 
    678678    return $this->instance->setName($value); 
     
    681681  /** 
    682682   * Gets the name of this instance 
    683    *  
    684    * @return string  
     683   * 
     684   * @return string 
    685685   * @access public 
    686686   */ 
     
    691691  /** 
    692692   * Sets the category of this instance 
    693    *  
     693   * 
    694694   * @param string $value 
    695695   * @return bool 
    696696   * @access public 
    697697   */ 
    698   function setCategory($value)  
     698  function setCategory($value) 
    699699  { 
    700700    return $this->instance->setcategory($value); 
     
    703703  /** 
    704704   * Gets category of this instance 
    705    *  
    706    * @return string  
    707    * @access public 
    708    */ 
    709   function getCategory()  
     705   * 
     706   * @return string 
     707   * @access public 
     708   */ 
     709  function getCategory() 
    710710  { 
    711711    return $this->instance->getCategory(); 
    712712  } 
    713    
     713 
    714714  /** 
    715715   * Sets a property in this instance. This method is used in activities to 
     
    718718   * problems (A->z, digits and _ for spaces). If you have several set to call look 
    719719   * at the setProperties function. Each call to this function has an impact on database 
    720    *  
     720   * 
    721721   * @param string $name property name (it will be normalized) 
    722722   * @param mixed $value value for this property 
    723    * @return bool  
    724    * @access public 
    725    */ 
    726   function set($name,$value)  
     723   * @return bool 
     724   * @access public 
     725   */ 
     726  function set($name,$value) 
    727727  { 
    728728    return $this->instance->set($name,$value); 
    729729  } 
    730    
     730 
    731731  /** 
    732732   * Unsets a property in this instance. This method is used in activities to 
     
    734734   * All property names are normalized for security reasons and to avoid localisation 
    735735   * problems (A->z, digits and _ for spaces). Each call to this function has an impact on database 
    736    *  
     736   * 
    737737   * @param string $name property name (it will be normalized) 
    738738   * @return bool true if it was ok 
    739739   * @access public 
    740740   */ 
    741   function clear($name)  
     741  function clear($name) 
    742742  { 
    743743    return $this->instance->clear($name); 
     
    749749   * All property names are normalized for security reasons and to avoid localisation 
    750750   * problems (A->z, digits and _ for spaces) 
    751    *  
     751   * 
    752752   * @param string $name property name (it will be normalized) 
    753753   * @return bool true if it exists and false otherwise 
     
    766766   * problems (A->z, digits and _ for spaces). If you have several set to call look 
    767767   * at the setProperties function. Each call to this function has an impact on database 
    768    *  
     768   * 
    769769   * @param array $properties_array associative array containing for each record the 
    770770   * property name as the key and the property value as the value. You do not need the complete 
     
    780780  /** 
    781781   * Gets the value of an instance property 
    782    *  
     782   * 
    783783   * @param string $name name of the instance 
    784784   * @param string $defaultValue 
     
    793793  /** 
    794794   * Describes the activities where the instance is present, can be more than one activity if the instance was "splitted" 
    795    *  
     795   * 
    796796   * @access public 
    797797   * @return array Vector of assocs 
    798798   */ 
    799   function getActivities()  
     799  function getActivities() 
    800800  { 
    801801    return $this->instance->getActivities(); 
    802802  } 
    803    
     803 
    804804  /** 
    805805   * Gets the instance status can be 'completed', 'active', 'aborted' or 'exception' 
    806    *  
     806   * 
    807807   * @access public 
    808808   * @return string Instance status 
    809809   */ 
    810   function getStatus()  
     810  function getStatus() 
    811811  { 
    812812    return $this->instance->getStatus(); 
    813813  } 
    814    
     814 
    815815  /** 
    816816   * Sets the instance status 
    817    *  
     817   * 
    818818   * @param $status Desired status, it can be: 'completed', 'active', 'aborted' or 'exception' 
    819819   * @return bool 
    820820   * @access public 
    821821   */ 
    822   function setStatus($status)  
     822  function setStatus($status) 
    823823  { 
    824824    return $this->instance->setStatus($status); 
    825825  } 
    826    
     826 
    827827  /** 
    828828   * Gets the instance priority 
    829    *  
    830    * @access public 
    831    * @return int  
     829   * 
     830   * @access public 
     831   * @return int 
    832832   */ 
    833833  function getPriority() 
    834834  { 
    835835    return $this->instance->getPriority(); 
    836   }  
     836  } 
    837837 
    838838  /** 
    839839   * Sets the instance priority 
    840    *  
     840   * 
    841841   * @param int $priority 
    842842   * @access public 
    843    * @return bool  
     843   * @return bool 
    844844   */ 
    845845  function setPriority($priority) 
     
    847847    return $this->instance->setPriority($priority); 
    848848  } 
    849     
     849 
    850850  /** 
    851851   * Returns the instance id 
    852    *  
    853    * @return int  
    854    * @access public 
    855    */ 
    856   function getInstanceId()  
     852   * 
     853   * @return int 
     854   * @access public 
     855   */ 
     856  function getInstanceId() 
    857857  { 
    858858    return $this->instance->getInstanceId(); 
    859859  } 
    860    
     860 
    861861  /** 
    862862   * Returns the process id for this instance 
    863    *  
    864    * @return int  
    865    * @access public  
     863   * 
     864   * @return int 
     865   * @access public 
    866866   */ 
    867867  function getProcessId() { 
    868868    return $this->instance->getProcessId(); 
    869869  } 
    870    
     870 
    871871  /** 
    872872   * Returns the owner of the instance 
    873    *  
    874    * @return string  
    875    * @access public 
    876    */ 
    877   function getOwner()  
     873   * 
     874   * @return string 
     875   * @access public 
     876   */ 
     877  function getOwner() 
    878878  { 
    879879    return $this->instance->getOwner(); 
    880880  } 
    881    
     881 
    882882  /** 
    883883   * Sets the instance owner 
    884    *  
    885    * @param string $user  
    886    * @access public 
    887    * @return bool   
    888    */ 
    889   function setOwner($user)  
     884   * 
     885   * @param string $user 
     886   * @access public 
     887   * @return bool 
     888   */ 
     889  function setOwner($user) 
    890890  { 
    891891    return $this->instance->setOwner($user); 
    892892  } 
    893    
     893 
    894894  /** 
    895895   * Returns the user that must execute or is already executing an activity where the instance is present 
    896    *  
     896   * 
    897897   * @param int $activityId 
    898898   * @return bool False if the activity was not found for the instance, else return the user id or '*' if no user is defined yet 
    899899   * @access public 
    900    */   
    901   function getActivityUser($activityId)  
     900   */ 
     901  function getActivityUser($activityId) 
    902902  { 
    903903    return $this->instance->getActivityUser($activityId); 
    904904  } 
    905    
     905 
    906906  /** 
    907907   * Sets the status of the instance in some activity 
    908    *  
     908   * 
    909909   * @param int $activityId Activity id 
    910910   * @param string $status New status, it can be 'running' or 'completed' 
    911911   * @return bool False if no activity was found for the instance 
    912912   * @access public 
    913    */   
    914   function setActivityStatus($activityId,$status)  
     913   */ 
     914  function setActivityStatus($activityId,$status) 
    915915  { 
    916916    return $this->instance->setActivityStatus($activityId,$status); 
    917917  } 
    918    
    919    
    920   /** 
    921    * Gets the status of the instance in some activity  
    922    *  
    923    * @param int $activityId  
     918 
     919 
     920  /** 
     921   * Gets the status of the instance in some activity 
     922   * 
     923   * @param int $activityId 
    924924   * @return string 'running' or 'completed' 
    925925   * @access public 
    926926   */ 
    927   function getActivityStatus($activityId)  
     927  function getActivityStatus($activityId) 
    928928  { 
    929929    return $this->instance->getActivityStatus($activityId); 
    930930  } 
    931    
     931 
    932932  /** 
    933933   * Resets the start time of the activity indicated to the current time 
    934    *  
     934   * 
    935935   * @param int $activityId 
    936    * @return bool  
    937    * @access public 
    938    */ 
    939   function setActivityStarted($activityId)  
     936   * @return bool 
     937   * @access public 
     938   */ 
     939  function setActivityStarted($activityId) 
    940940  { 
    941941    return $this->instance->setActivityStarted($activityId); 
    942942  } 
    943    
     943 
    944944  /** 
    945945   * Gets the Unix timstamp of the starting time for the given activity 
    946    *  
     946   * 
    947947   * @param int $activityId 
    948    * @return int  
    949    * @access public 
    950    */ 
    951   function getActivityStarted($activityId)  
     948   * @return int 
     949   * @access public 
     950   */ 
     951  function getActivityStarted($activityId) 
    952952  { 
    953953    return $this->instance->getActivityStarted($activityId); 
    954954  } 
    955    
     955 
    956956  /** 
    957957   * Gets the time where the instance was started 
    958    *  
    959    * @return int  
    960    * @access public 
    961    */ 
    962   function getStarted()  
     958   * 
     959   * @return int 
     960   * @access public 
     961   */ 
     962  function getStarted() 
    963963  { 
    964964    return $this->instance->getStarted(); 
    965965  } 
    966    
     966 
    967967  /** 
    968968   * Gets the end time of the instance (when the process was completed) 
    969    *  
    970    * @return int  
    971    * @access public  
    972    */ 
    973   function getEnded()  
     969   * 
     970   * @return int 
     971   * @access public 
     972   */ 
     973  function getEnded() 
    974974  { 
    975975    return $this->instance->getEnded(); 
    976976  } 
    977    
    978    
     977 
     978 
    979979  /** 
    980980   * Completes an activity. 
     
    982982   * the engine does automatically complete automatic activities after 
    983983   * executing them 
    984    *  
     984   * 
    985985   * @return bool True or false, if false it means the complete was not done for some internal reason 
    986986   * consult get_error() for more informations 
    987987   * @access public 
    988988   */ 
    989   function complete()  
     989  function complete() 
    990990  { 
    991991    if (!($this->activity->isInteractive())) 
     
    994994      return false; 
    995995    } 
    996      
     996 
    997997    return $this->instance->complete($this->activity_id); 
    998998  } 
     
    10011001   * Aborts an activity and terminates the whole instance. We still create a workitem to keep track 
    10021002   * of where in the process the instance was aborted 
    1003    *  
    1004    * @return bool  
    1005    * @access public 
    1006    */ 
    1007   function abort()  
     1003   * 
     1004   * @return bool 
     1005   * @access public 
     1006   */ 
     1007  function abort() 
    10081008  { 
    10091009    return $this->instance->abort(); 
    10101010  } 
    1011    
     1011 
    10121012  /** 
    10131013   * Gets a comment for this instance 
    1014    *  
     1014   * 
    10151015   * @param int $cId Comment id 
    1016    * @return string  
    1017    * @access public 
    1018    */ 
    1019   function get_instance_comment($cId)  
     1016   * @return string 
     1017   * @access public 
     1018   */ 
     1019  function get_instance_comment($cId) 
    10201020  { 
    10211021    return $this->instance->get_instance_comment($cId); 
    10221022  } 
    1023    
     1023 
    10241024  /** 
    10251025   * Inserts or updates an instance comment 
    1026    *  
     1026   * 
    10271027   * @param int $cId Commend id 
    1028    * @param int $activityId  
    1029    * @param object $activity  
     1028   * @param int $activityId 
     1029   * @param object $activity 
    10301030   * @param int $user User id 
    10311031   * @param string $title Comment's title 
    10321032   * @param string $comment Comment's contents 
    1033    * @return bool  
    1034    * @access public 
    1035    */ 
    1036   function replace_instance_comment($cId, $activityId, $activity, $user, $title, $comment)  
     1033   * @return bool 
     1034   * @access public 
     1035   */ 
     1036  function replace_instance_comment($cId, $activityId, $activity, $user, $title, $comment) 
    10371037  { 
    10381038    return $this->instance->replace_instance_comment($cId, $activityId, $activity, $user, $title, $comment); 
    10391039  } 
    1040    
     1040 
    10411041  /** 
    10421042   * Removes an instance comment 
    1043    *  
     1043   * 
    10441044   * @param int $cId Comment id 
    1045    * @return bool  
    1046    * @access public 
    1047    */ 
    1048   function remove_instance_comment($cId)  
     1045   * @return bool 
     1046   * @access public 
     1047   */ 
     1048  function remove_instance_comment($cId) 
    10491049  { 
    10501050    return $this->instance->remove_instance_comment($cId); 
    10511051  } 
    1052   
     1052 
    10531053  /** 
    10541054   * Lists instance comments 
    1055    *  
    1056    * @return array  
    1057    * @access public 
    1058    */ 
    1059   function get_instance_comments()  
     1055   * 
     1056   * @return array 
     1057   * @access public 
     1058   */ 
     1059  function get_instance_comments() 
    10601060  { 
    10611061    return $this->instance->get_instance_comments(); 
     
    10871087    $workflow = $GLOBALS['workflow']; 
    10881088    unset($_REQUEST['iid']); 
    1089     $run_activity = Factory::getInstance('run_activity'); 
     1089    $run_activity = Factory::newInstance('run_activity'); 
    10901090    $run_activity->runtime->instance->parentInstanceId = $this->instance_id; 
    1091     $run_activity->runtime->instance->parentActivityId = $this->activity_id; 
    10921091    $output = $run_activity->goChildInstance($activityID, $properties, $user, $parentLock); 
    10931092    $_REQUEST['iid'] = $iid; 
     
    11281127  function getParent() 
    11291128  { 
    1130     $resultSet = $this->query("SELECT wf_parent_instance_id, wf_parent_activity_id, wf_parent_lock FROM egw_wf_interinstance_relations WHERE (wf_child_instance_id = ?)", array($this->getInstanceId())); 
     1129    $resultSet = $this->query("SELECT wf_parent_instance_id, wf_parent_lock FROM egw_wf_interinstance_relations WHERE (wf_child_instance_id = ?)", array($this->getInstanceId())); 
    11311130    if (($row = $resultSet->fetchRow())) 
    1132       return array('instance_id' => $row['wf_parent_instance_id'], 'activity_id' => $row['wf_parent_activity_id'], 'lock' => ($row['wf_parent_lock'] == 1)); 
     1131      return array('instance_id' => $row['wf_parent_instance_id'], 'lock' => ($row['wf_parent_lock'] == 1)); 
    11331132    else 
    11341133      return false; 
  • sandbox/workflow/branches/1015/inc/local/classes/class.wf_engine.php

    r2588 r3061  
    8686        * @return bool true caso a instância tenha sido continuada e false caso contrário. 
    8787        * @access public 
    88         * @deprecated 1.7.00.000 
     88        * @deprecated 2.2.00.000 
    8989        */ 
    9090        function continueInstance($activityID, $instanceID) 
    9191        { 
     92                wf_warn_deprecated_method('wf_instance', 'continueInstance'); 
    9293                $WFInstance = &Factory::getInstance('wf_instance'); 
    9394                return $WFInstance->continueInstance($activityID, $instanceID); 
     
    99100        * @return boolean true se foi possível abortar a instância e false caso contrário. 
    100101        * @access public 
    101         * @deprecated 1.7.00.000 
     102        * @deprecated 2.2.00.000 
    102103        */ 
    103104        function abortInstance($instanceID) 
    104105        { 
     106                wf_warn_deprecated_method('wf_instance', 'abort'); 
    105107                $WFInstance = &Factory::getInstance('wf_instance'); 
    106108                return $WFInstance->abort($instanceID); 
     
    113115        * @return boolean true se foi possível mudar o nome da instância e false caso contrário. 
    114116        * @access public 
    115         * @deprecated 1.7.00.000 
     117        * @deprecated 2.2.00.000 
    116118        */ 
    117119        function setInstanceName($instanceID, $name) 
    118120        { 
     121                wf_warn_deprecated_method('wf_instance', 'setName'); 
    119122                $WFInstance = &Factory::getInstance('wf_instance'); 
    120123                return $WFInstance->setName($instanceID, $name); 
     
    127130        * @return boolean true se foi possível mudar a prioridade da instância e false caso contrário. 
    128131        * @access public 
    129         * @deprecated 1.7.00.000 
     132        * @deprecated 2.2.00.000 
    130133        */ 
    131134        function setInstancePriority($instanceID, $priority) 
    132135        { 
     136                wf_warn_deprecated_method('wf_instance', 'setPriority'); 
    133137                $WFInstance = &Factory::getInstance('wf_instance'); 
    134138                return $WFInstance->setPriority($instanceID, $priority); 
     
    141145        * @return array As instâncias que satisfazem o critério de seleção. 
    142146        * @access public 
    143         * @deprecated 1.7.00.000 
     147        * @deprecated 2.2.00.000 
    144148        */ 
    145149        function getIdleInstances($numberOfDays, $activities = null) 
    146150        { 
     151                wf_warn_deprecated_method('wf_instance', 'getIdle'); 
    147152                $WFInstance = &Factory::getInstance('wf_instance'); 
    148153                return $WFInstance->getIdle($numberOfDays, $activities); 
     
    154159        * @return array As instâncias que satisfazem o critério de seleção. 
    155160        * @access public 
    156         * @deprecated 1.7.00.000 
     161        * @deprecated 2.2.00.000 
    157162        */ 
    158163        function getInstances($activities = null) 
    159164        { 
     165                wf_warn_deprecated_method('wf_instance', 'getIdle'); 
    160166                return $this->getIdleInstances(0, $activities); 
    161167        } 
     
    166172        * @return array As instâncias que satisfazem o critério de seleção. 
    167173        * @access public 
    168         * @deprecated 1.7.00.000 
     174        * @deprecated 2.2.00.000 
    169175        */ 
    170176        function getInstancesByName($name) 
    171177        { 
     178                wf_warn_deprecated_method('wf_instance', 'getByName'); 
    172179                $WFInstance = &Factory::getInstance('wf_instance'); 
    173180                $preOutput = $WFInstance->getByName($name); 
     
    187194        * @return array As instâncias filhas do par instância/atividade atual 
    188195        * @access public 
    189         * @deprecated 1.7.00.000 
     196        * @deprecated 2.2.00.000 
    190197        */ 
    191198        function getChildInstances($instanceID = null, $activityID = null) 
    192199        { 
    193                 $WFInstance = &Factory::getInstance('wf_instance'); 
    194                 $preOutput = $WFInstance->getChildren($instanceID, $activityID); 
     200                wf_warn_deprecated_method('wf_instance', 'getChildren'); 
     201                $WFInstance = &Factory::getInstance('wf_instance'); 
     202                $preOutput = $WFInstance->getChildren($instanceID); 
    195203                $output = array(); 
    196204                foreach ($preOutput as $childInstance) 
     
    206214        * @return mixed Uma array contento as propriedades da instância (no formato "nome_da_propriedade" => "valor"). Ou false em caso de erro. 
    207215        * @access public 
    208         * @deprecated 1.7.00.000 
     216        * @deprecated 2.2.00.000 
    209217        */ 
    210218        function getInstanceProperties($instanceID) 
    211219        { 
     220                wf_warn_deprecated_method('wf_instance', 'getProperties'); 
    212221                $WFInstance = &Factory::getInstance('wf_instance'); 
    213222                return $WFInstance->getProperties($instanceID); 
     
    219228        * @return array Propriedades da instância filha. Array no formato "nome_da_propriedade" => "valor". 
    220229        * @access public 
    221         * @deprecated 1.7.00.000 
     230        * @deprecated 2.2.00.000 
    222231        */ 
    223232        function getChildInstanceProperties($instanceID) 
    224233        { 
     234                wf_warn_deprecated_method('wf_instance', 'getProperties'); 
    225235                $WFInstance = &Factory::getInstance('wf_instance'); 
    226236                return $WFInstance->getProperties($instanceID); 
     
    333343        * @return array As instâncias que satisfazem o critério de seleção. 
    334344        * @access public 
    335         * @deprecated 1.7.00.000 
     345        * @deprecated 2.2.00.000 
    336346        */ 
    337347        function getUserInstances($users, $activities = null, $status = null) 
    338348        { 
     349                wf_warn_deprecated_method('wf_instance', 'getByUser'); 
    339350                $WFInstance = &Factory::getInstance('wf_instance'); 
    340351                return $WFInstance->getByUser($users, $activities, $status); 
     
    346357        * @return bool true caso a propriedade tenha sido alterada com sucesso 
    347358        * @access public 
    348         * @deprecated 1.7.00.000 
     359        * @deprecated 2.2.00.000 
    349360        */ 
    350361        function setInstanceProperty($instanceID, $nameProperty, $value) 
    351362        { 
     363                wf_warn_deprecated_method('wf_instance', 'setProperty'); 
    352364                $WFInstance = &Factory::getInstance('wf_instance'); 
    353365                return $WFInstance->setProperty($instanceID, $nameProperty, $value); 
     
    362374        * @return bool true se o usuário tiver acesso à instância (levando em consideração $writeAccess) ou false caso contrário 
    363375        * @access public 
    364         * @deprecated 1.7.00.000 
     376        * @deprecated 2.2.00.000 
    365377        */ 
    366378        function checkUserAccessToInstance($userID, $instanceID, $activityID, $writeAccess = true) 
    367379        { 
     380                wf_warn_deprecated_method('wf_instance', 'checkUserAccess'); 
    368381                $WFInstance = &Factory::getInstance('wf_instance'); 
    369382                return $WFInstance->checkUserAccess($userID, $instanceID, $activityID, $writeAccess); 
  • sandbox/workflow/branches/1015/inc/local/classes/class.wf_instance.php

    r2588 r3061  
    250250 
    251251        /** 
    252         * Busca as instâncias filhas de uma instância 
    253         * Se os parâmetros não forem informados, retorna instâncias filhas das instância atual. 
    254         * @param int $instanceID O ID da instância pai (não obrigatório). 
    255         * @param int $activityID O ID da atividade corrente da instância pai 
    256         * @return array As instâncias filhas do par instância/atividade atual 
    257         * @access public 
    258         */ 
    259         public function getChildren($instanceID = null, $activityID = null) 
     252        * This method gets all children instances of the given instance. 
     253        * If there is no parameter, it gets the children instances of the current instance 
     254        * @param int $instanceID Dad instance's identification. 
     255        * @return array Array with the children instances, or false 
     256        * @access public 
     257        */ 
     258        public function getChildren($instanceID = null) 
    260259        { 
    261260                $output = array(); 
    262261                if (is_null($instanceID)) 
    263262                        $instanceID = $GLOBALS['workflow']['wf_runtime']->instance_id; 
    264                 if (is_null($activityID)) 
    265                         $activityID = $GLOBALS['workflow']['wf_runtime']->activity_id; 
    266  
    267                 /* check instanceID */ 
    268                 if (!$this->checkInstanceAccess($instanceID, $activityID)) 
     263 
     264                /* check instanceID */ 
     265                if (!$this->checkInstanceAccess($instanceID)) 
    269266                        return $output; 
    270267 
    271268                /* build the SQL query */ 
    272                 $query = 'SELECT i.wf_instance_id AS wf_instance_id, ia.wf_activity_id AS wf_activity_id, ia.wf_started AS wf_started, i.wf_name AS wf_name, i.wf_status AS wf_status, ia.wf_user AS wf_user, ir.wf_parent_lock AS wf_parent_lock '; 
    273                 $query .= 'FROM egw_wf_interinstance_relations ir, egw_wf_instances i LEFT JOIN egw_wf_instance_activities ia ON (ia.wf_instance_id = i.wf_instance_id)'; 
    274                 $query .= 'WHERE (ir.wf_child_instance_id = i.wf_instance_id) AND (ir.wf_parent_instance_id = ?) AND (ir.wf_parent_activity_id = ?)'; 
    275  
    276                 $result = $this->db->query($query, array($instanceID, $activityID)); 
     269                $query = 'SELECT i.wf_instance_id AS wf_instance_id, ' . 
     270                                 '       ia.wf_activity_id AS wf_activity_id, ' . 
     271                                 '       i.wf_started AS wf_started, ' . 
     272                                 '       i.wf_name AS wf_name, ' . 
     273                                 '       i.wf_status AS wf_status, ' . 
     274                                 '       ia.wf_user AS wf_user, ' . 
     275                                 '       ir.wf_parent_lock AS wf_parent_lock ' . 
     276                                 ' FROM egw_wf_interinstance_relations ir, egw_wf_instances i ' . 
     277                                 '  LEFT JOIN egw_wf_instance_activities ia ' . 
     278                                 '  ON (ia.wf_instance_id = i.wf_instance_id) ' . 
     279                                 ' WHERE ' . 
     280                                 '  (ir.wf_child_instance_id = i.wf_instance_id) AND (ir.wf_parent_instance_id = ?) '; 
     281 
     282                $result = $this->db->query($query, array($instanceID)); 
    277283                $output = $result->GetArray(-1); 
    278284 
  • sandbox/workflow/branches/1015/inc/local/classes/class.wf_natural.php

    r795 r3061  
    11<?php 
    2         require_once(PHPGW_SERVER_ROOT.SEP.'workflow'.SEP.'inc'.SEP.'natural'.SEP.'class.natural.php'); 
     2/**************************************************************************\ 
     3* eGroupWare                                                               * 
     4* http://www.egroupware.org                                                * 
     5* --------------------------------------------                             * 
     6*  This program is free software; you can redistribute it and/or modify it * 
     7*  under the terms of the GNU General Public License as published by the   * 
     8*  Free Software Foundation; either version 2 of the License, or (at your  * 
     9*  option) any later version.                                              * 
     10\**************************************************************************/ 
     11 
     12require_once(PHPGW_SERVER_ROOT.SEP.'workflow'.SEP.'inc'.SEP.'natural'.SEP.'class.natural.php'); 
     13 
     14/** 
     15 * Mainframe connection to workflow 
     16 * 
     17 * TODO - This class should be removed from here. Its based on a not 
     18 * public protocol, thus cannot be used for everybody. 
     19 * 
     20 * @package Workflow 
     21 * @subpackage local 
     22 * @license http://www.gnu.org/copyleft/gpl.html GPL 
     23 * @author Everton Flávio Rufino Seára 
     24 */ 
     25class wf_natural extends Natural 
     26{ 
    327 
    428        /** 
    5         * Mainframe connection to workflow 
    6         * @author Everton Flávio Rufino Seára 
    7         * @package Workflow 
    8         * @subpackage local 
    9         * @license http://www.gnu.org/copyleft/gpl.html GPL 
    10         **/ 
     29         * @var object Log Object 
     30         * @access private 
     31         */ 
     32        private $logger = null; 
    1133 
    12         class wf_natural extends Natural 
     34        function __construct() 
    1335        { 
     36                parent::Natural(); 
    1437 
    15                 function __construct() 
    16                 { 
    17                         parent::Natural(); 
     38                $natconf = array( 
     39                                        'mainframe_ip'                  => '', 
     40                                        'mainframe_port'                => '', 
     41                                        'mainframe_key'                 => '', 
     42                                        'mainframe_password'    => '', 
     43                                        'mainframe_environment' => '' 
     44                ); 
    1845 
    19                         $natconf = array( 
    20                                                 'mainframe_ip'                  => '', 
    21                                                 'mainframe_port'                => '', 
    22                                                 'mainframe_key'                 => '', 
    23                                                 'mainframe_password'    => '', 
    24                                                 'mainframe_environment' => '' 
    25                         ); 
     46                $nat_conf_values = &Factory::getInstance('workflow_wfruntime')->getConfigValues($natconf); 
    2647 
    27                         $nat_conf_values = $GLOBALS['workflow']['wf_runtime']->getConfigValues($natconf); 
     48                $this->setIPAddress($nat_conf_values['mainframe_ip']); 
     49                $this->setServerPort($nat_conf_values['mainframe_port']); 
     50                $this->setKey($nat_conf_values['mainframe_key']); 
     51                $this->setPassword($nat_conf_values['mainframe_password']); 
     52                $this->setApplication($nat_conf_values['mainframe_environment']); 
    2853 
    29                         $this->setIPAddress($nat_conf_values['mainframe_ip']); 
    30                         $this->setServerPort($nat_conf_values['mainframe_port']); 
    31                         $this->setKey($nat_conf_values['mainframe_key']); 
    32                         $this->setPassword($nat_conf_values['mainframe_password']); 
    33                         $this->setApplication($nat_conf_values['mainframe_environment']); 
     54                $this->logger = &Factory::getInstance('Logger', array('file')); 
     55        } 
     56 
     57        /** 
     58         * This method MUST be called before using execute method 
     59         * It specifies the natural sub-program to be accessed. 
     60         * 
     61         * @param Object $obj Object that specifies natural sub-program properties 
     62         * @return void 
     63         */ 
     64        public function configure($obj) 
     65        { 
     66                $this->obj = $obj; 
     67 
     68                $this->initialize($obj->name); 
     69 
     70                if ($obj->server != NULL){ 
     71                        $this->setIPAddress($obj->server); 
    3472                } 
    35  
    36                 /** 
    37                  * Method to configure the access to mainframe 
    38                  * This method MUST be called before using execute method, else 'false' will be returned 
    39                  * 
    40                  * Only the first and second param are mandatory. 
    41                  * 
    42                  * @param String $subProgram - Name of sub-program 
    43                  * @param String $inputParameter - Input parameters to sub-program 
    44                  * 
    45                  * @param String $ip - IP Address of Mainfram 
    46                  * @param int $port - ServerPort to access the mainframe 
    47                  * @param String $key - Access key (user) 
    48                  * @param String $password - Key (user) password 
    49                  * @param char $environment - Application environment access 'D' (development) or 'P' (production) 
    50  
    51                  */ 
    52  
    53                 public function configure($obj) 
    54                 { 
    55                         $this->obj = $obj; 
    56  
    57                         $this->initialize($obj->name); 
    58  
    59                         if ($obj->server != NULL){ 
    60                                 $this->setIPAddress($obj->server); 
    61                         } 
    62                         if ($obj->port != NULL){ 
    63                                 $this->setServerPort($obj->port); 
    64                         } 
    65                         if ($obj->key != NULL){ 
    66                                 $this->setKey($obj->key); 
    67                         } 
    68                         if ($obj->password != NULL){ 
    69                                 $this->setPassword($obj->password); 
    70                         } 
    71                         if ($obj->environment != NULL){ 
    72                                 $this->setApplication($obj->environment); 
    73                         } 
    74                         if ($obj->logon != NULL){ 
    75                                 $this->setLogon($obj->logon); 
    76                         } 
    77                         if ($obj->system != NULL){ 
    78                                 $this->setSystem($obj->system); 
    79                         } 
    80                         if ($obj->rc != NULL){ 
    81                                 $this->setRC($obj->rc); 
    82                         } 
     73                if ($obj->port != NULL){ 
     74                        $this->setServerPort($obj->port); 
    8375                } 
    84  
    85                 /* 
    86  
    87                 public function configure($subProgram, $inputParameter, $ip = NULL, $port = NULL, 
    88                                                                                 $key = NULL, $password = NULL, $environment = NULL, $logon = NULL, $system = NULL, $rc = NULL) 
    89                 { 
    90                         $this->initialize($subProgram, $inputParameter); 
    91  
    92                         if ($ip != NULL){ 
    93                                 $this->setIPAddress($ip); 
    94                         } 
    95                         if ($port != NULL){ 
    96                                 $this->setServerPort($port); 
    97                         } 
    98                         if ($key != NULL){ 
    99                                 $this->setKey($key); 
    100                         } 
    101                         if ($password != NULL){ 
    102                                 $this->setPassword($password); 
    103                         } 
    104                         if ($environment != NULL){ 
    105                                 $this->setApplication($environment); 
    106                         } 
    107                         if ($logon != NULL){ 
    108                                 $this->setLogon($logon); 
    109                         } 
    110                         if ($system != NULL){ 
    111                                 $this->setSystem($system); 
    112                         } 
    113                         if ($rc != NULL){ 
    114                                 $this->setRC($rc); 
    115                         } 
    116  
     76                if ($obj->key != NULL){ 
     77                        $this->setKey($obj->key); 
    11778                } 
    118  
    119                  */ 
    120  
    121                 /** 
    122                  * Access and retrieve data from mainframe 
    123                  * @return bool 
    124                  */ 
    125                 public function execute($inputParams = "") 
    126                 { 
    127                         return parent::execute($inputParams); 
     79                if ($obj->password != NULL){ 
     80                        $this->setPassword($obj->password); 
     81                } 
     82                if ($obj->environment != NULL){ 
     83                        $this->setApplication($obj->environment); 
     84                } 
     85                if ($obj->logon != NULL){ 
     86                        $this->setLogon($obj->logon); 
     87                } 
     88                if ($obj->system != NULL){ 
     89                        $this->setSystem($obj->system); 
     90                } 
     91                if ($obj->rc != NULL){ 
     92                        $this->setRC($obj->rc); 
    12893                } 
    12994        } 
     95 
     96        /** 
     97         * Method for accessing and retrieving data from mainframe 
     98         * @return bool 
     99         */ 
     100        public function execute($inputParams = "") 
     101        { 
     102                // execute action and log wasted time 
     103                $totalTime = microtime(true); 
     104                $result = parent::execute($inputParams); 
     105                $totalTime = microtime(time) - $totalTime; 
     106                $log = sprintf("WF_NATURAL [subprogram=%s] [time=%ss]", 
     107                                        $this->obj->name, 
     108                                        number_format($totalTime,3) 
     109                                        ); 
     110                $this->logger->debug($log); 
     111                return $result; 
     112        } 
     113} 
    130114?> 
  • sandbox/workflow/branches/1015/inc/local/classes/class.wf_orgchart.php

    r2588 r3061  
    480480                return $output; 
    481481        } 
     482         
     483        /** 
     484         * Return all areas that the employee is a supervisor. 
     485         *  
     486         * Search in the organization for all areas that the employee is a supervisor. 
     487         * @param int $employeeID The ID of employee 
     488         * @return array Array containing all the areas that the employeee is a supervisor. 
     489         * @access public 
     490         */ 
     491        function getSupervisorAreas($employeeID) { 
     492 
     493                if (!$employeeID) { 
     494                        return false; 
     495                } 
     496 
     497                $query = "SELECT  
     498                                                a.area_id 
     499                                        FROM  
     500                                                area a  
     501                                                LEFT OUTER JOIN substituicao s ON ((a.area_id = s.area_id)  
     502                                                AND (CURRENT_DATE BETWEEN s.data_inicio AND s.data_fim))  
     503                                        WHERE  
     504                                                a.titular_funcionario_id = ? OR  
     505                                                s.funcionario_id = ? 
     506                                        GROUP BY 
     507                                                a.area_id"; 
     508                 
     509                $result = $this->db->query($query, array($employeeID,$employeeID)); 
     510                if (!$result) 
     511                        return false; 
     512                 
     513                $output = $result->GetArray(-1); 
     514                return $output; 
     515        } 
    482516 
    483517        /** 
  • sandbox/workflow/branches/1015/inc/local/functions/function.wf_create_object.php

    r795 r3061  
    55 * @return mixed 
    66 * @license http://www.gnu.org/copyleft/gpl.html GPL 
    7  * @deprecated 1.4.00.000 - 08/03/2007 
     7 * @deprecated 2.2.00.000 
    88 * @package Workflow  
    99 * @subpackage local  
     
    1212function wf_create_object($class_name) 
    1313{ 
     14        wf_warn_deprecated_method('Factory', 'getInstance'); 
    1415        $obj = null; 
    1516        $file_name = PHPGW_SERVER_ROOT.SEP.'workflow'.SEP.'inc'.SEP.'local'.SEP.'classes'.SEP.'class.'.$class_name.'.php'; 
  • sandbox/workflow/branches/1015/inc/log/Log.php

    r795 r3061  
    167167        /* If the class exists, return a new instance of it. */ 
    168168        if (Log::_classExists($class)) { 
    169             $obj = &new $class($name, $ident, $conf, $level); 
     169            $obj = new $class($name, $ident, $conf, $level); 
    170170            return $obj; 
    171171        } 
  • sandbox/workflow/branches/1015/inc/log/Log/observer.php

    r795 r3061  
    7979         */ 
    8080        if (class_exists($class)) { 
    81             $object = &new $class($priority, $conf); 
     81            $object = new $class($priority, $conf); 
    8282            return $object; 
    8383        } 
     
    103103            /* Support both new-style and old-style construction. */ 
    104104            if ($newstyle) { 
    105                 $object = &new $class($priority, $conf); 
     105                $object = new $class($priority, $conf); 
    106106            } else { 
    107                 $object = &new $class($priority); 
     107                $object = new $class($priority); 
    108108            } 
    109109            return $object; 
  • sandbox/workflow/branches/1015/inc/smarty/plugins/function.html_options.php

    r795 r3061  
    9696} 
    9797 
     98function smarty_function_html_boxoptions($params, &$smarty) 
     99{ 
     100    require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); 
     101     
     102    $name = null; 
     103    $values = null; 
     104    $options = null; 
     105    $selected = array(); 
     106    $output = null; 
     107     
     108    $extra = ''; 
     109     
     110    foreach($params as $_key => $_val) { 
     111        switch($_key) { 
     112            case 'name': 
     113                $$_key = (string)$_val; 
     114                break; 
     115             
     116            case 'options': 
     117                $$_key = (array)$_val; 
     118                break; 
     119                 
     120            case 'values': 
     121            case 'output': 
     122                $$_key = array_values((array)$_val); 
     123                break; 
     124 
     125            case 'selected': 
     126                $$_key = array_map('strval', array_values((array)$_val)); 
     127                break; 
     128 
     129            default: 
     130                if(!is_array($_val)) { 
     131                    $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; 
     132                } else { 
     133                    $smarty->trigger_error("html_options: extra attribute '$_key' cannot be an array", E_USER_NOTICE); 
     134                } 
     135                break; 
     136        } 
     137    } 
     138 
     139    if (!isset($options) && !isset($values)) 
     140        return ''; /* raise error here? */ 
     141 
     142    $_html_result = ''; 
     143 
     144    if (isset($options)) { 
     145 
     146        foreach ($options as $_key=>$_val) 
     147            $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected); 
     148 
     149    } else { 
     150 
     151        foreach ($values as $_i=>$_key) { 
     152            $_val = isset($output[$_i]) ? $output[$_i] : ''; 
     153            $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected); 
     154        } 
     155 
     156    } 
     157 
     158    if(!empty($name)) { 
     159        $_html_result = '<select name="' . $name . '"' . $extra . ' style="height: 100px;" size="5">' . "\n" . $_html_result . '</select>' . "\n"; 
     160    } 
     161 
     162    return $_html_result; 
     163 
     164} 
    98165function smarty_function_html_options_optoutput($key, $value, $selected) { 
    99166    if(!is_array($value)) { 
  • sandbox/workflow/branches/1015/inc/smarty/wf_plugins/function.wf_select_ldap_users.php

    r2372 r3061  
    2323 */ 
    2424function smarty_function_wf_select_ldap_users($params, &$smarty) 
    25 { 
     25{  
    2626    require_once $smarty->_get_plugin_filepath('function','html_options'); 
    2727        $imagesPath = substr(Factory::getInstance('TemplateServer')->generateImageLink(''), 0, -1); 
     
    3434                'size_input'            => '20', 
    3535                'opt_id'                => 'dn', 
    36                 'opt_name'              => 'cn'); 
     36                'opt_name'              => 'cn', 
     37                'opt_complement'        => ''); 
    3738        $extractParams = array( 
    3839                'name', 
     
    4243                'class_btn', 
    4344                'opt_id', 
    44                 'opt_name'); 
     45                'opt_name', 
     46                'opt_complement'); 
    4547 
    4648        /* verifica se todos os parâmetros obrigatórios foram passados */ 
     
    7880        $output = <<<EOF 
    7981                <input type="text" id="$name_input" name="$name_input" size="$size_input" /> 
    80                 <input type="button" class="$class_btn" value="$value_btn" onclick="search_ldap_users_by_cn(document.getElementById('$name_input').value, '$name', '$opt_id', '$opt_name', $handleExpiredSessions)" /> 
     82                <input type="button" class="$class_btn" value="$value_btn" onclick="search_ldap_users_by_cn(document.getElementById('$name_input').value, '$name', '$opt_id', '$opt_name', $handleExpiredSessions, '$opt_complement')" /> 
    8183                &nbsp;<img id="$name_img" border="0" src="$imagesPath/loading.gif" style="display:none"> 
    82                 <span id="$name_span" style="display:none">&nbsp;&nbsp;&nbsp;&nbsp;<b>Selecione o nome: </b> 
     84                <span id="$name_span" style="display:none"><br><br><b>Selecione um nome abaixo: </b><br><br> 
    8385EOF; 
    8486 
    85         $output .= smarty_function_html_options(array_merge(array( 
     87        $output .= smarty_function_html_boxoptions(array_merge(array( 
    8688                                                                                        'name'    => $name, 
    8789                                                                                        'id'      => $name, 
  • sandbox/workflow/branches/1015/inc/smarty/wf_plugins/function.wf_select_user.php

    r2372 r3061  
    1212 * - email_as_textarea : indica se o campo que receberá os emails deve ser um textarea (valor true) ou input type text (valor false). Este parâmetro só tem validade se get_email for true. 
    1313 * - hide_groups : indica se deve-se omitir os grupos na tela de seleção. 
     14 * - onlyVisibleAccounts : indica se devem ser recuperadas apenas as contas visíveis, ou se as ocultas também devem ser listadas. 
    1415 * - organization : nome da organização que estará previamente selecionada. 
    1516 * - title : texto da tooltip que aparecerá quando o usuário colocar o mouse sobre o ícone para adicionar usuário. 
     
    3536                'hide_organizations' => false, 
    3637                'hide_sectors' => false, 
     38                'onlyVisibleAccounts' => true, 
    3739                'rows'=> 2); 
    3840        $extractParams = array( 
     
    4244                'title', 
    4345                'cols', 
    44                 'rows'); 
     46                'rows', 
     47                'onlyVisibleAccounts'); 
    4548 
    4649        /* verifica se todos os parâmetros obrigatórios foram passados */ 
     
    9396        if ($params['hide_sectors'] == true) 
    9497                $extraParams .= "&hideSectors=1"; 
     98        if (empty($onlyVisibleAccounts) || $onlyVisibleAccounts === 'false') 
     99                $extraParams .= "&onlyVisibleAccounts=false"; 
     100        else 
     101                $extraParams .= "&onlyVisibleAccounts=true"; 
    95102 
    96103        $image = Factory::getInstance('TemplateServer')->generateImageLink('add_user.png'); 
    97104 
    98 $output .= <<<EOF 
    99         <a alt="$title" title="$title" href="javascript:void(0)" onclick="openParticipants('$name', '$extraParams');"><img border="0" alt="" src="$image" /></a> 
     105        $output .= <<<EOF 
     106                <a alt="$title" title="$title" href="javascript:void(0)" onclick="openParticipants('$name', '$extraParams');"><img border="0" alt="" src="$image" /></a> 
    100107EOF; 
    101108        return $output; 
  • sandbox/workflow/branches/1015/inc/smarty/wf_plugins/function.wf_select_users.php

    r2372 r3061  
    88 * - value : usuários e grupos previamente selecionados. Deve estar no formato de matriz, seguindo o seguinte padrão: ::$matriz["u123"]="Nome do usuário 123" ; $matriz["g321"]="Nome do grupo 321" e, assim por diante. 
    99 * - hide_groups : indica se deve-se omitir os grupos na tela de seleção. 
     10 * - onlyVisibleAccounts : indica se devem ser recuperadas apenas as contas visíveis, ou se as ocultas também devem ser listadas. 
    1011 * - organization : nome da organização que estará previamente selecionada. 
    1112 * @param object &$smarty Instância do objeto smarty em uso 
     
    2425                'hide_organizations' => false, 
    2526                'hide_sectors' => false, 
     27                'onlyVisibleAccounts' => true, 
    2628                'value' => array()); 
    2729        $extractParams = array( 
    2830                'name', 
    29                 'value'); 
     31                'value', 
     32                'onlyVisibleAccounts'); 
    3033 
    3134        /* verifica se todos os parâmetros obrigatórios foram passados */ 
     
    5457        if ($params['hide_sectors'] == true) 
    5558                $extraParams .= "&hideSectors=1"; 
     59        if (empty($onlyVisibleAccounts) || $onlyVisibleAccounts === 'false') 
     60                $extraParams .= "&onlyVisibleAccounts=false"; 
     61        else 
     62                $extraParams .= "&onlyVisibleAccounts=true"; 
    5663 
    5764        $output = '<table border="0"><tr><td>'; 
     
    6673        $output .= "</td><td>"; 
    6774        $output .= <<<EOF 
    68                 <a href='javascript:void(0)' onclick="openParticipants(500, 270, '$name', '$extraParams');"><img border="0" src="$imagesPath/add_group.png"></a> 
     75                <a href='javascript:void(0)' onclick="openParticipants(500, 315, '$name', '$extraParams');"><img border="0" src="$imagesPath/add_group.png"></a> 
    6976                <br /> 
    70                 <a href='javascript:void(0)' onclick="openParticipants(500, 270, '$name', '$extraParams');">Adicionar</a> 
     77                <a href='javascript:void(0)' onclick="openParticipants(500, 315, '$name', '$extraParams');">Adicionar</a> 
    7178                <br /><br /> 
    7279                <a href='javascript:void(0)' onclick="delUsers('$name');"><img border="0" src="$imagesPath/delete_group.png"></a> 
  • sandbox/workflow/branches/1015/index.php

    r2372 r3061  
    99*  option) any later version.                                              * 
    1010\**************************************************************************/ 
     11 
     12/* Including common stuff to prepare workflow to run. A session start is needed */ 
     13require_once 'inc/common.inc.php'; 
    1114 
    1215/* if the menuaction variable is set, then let the expresso index deal with it */ 
     
    3841        ); 
    3942        require_once '../header.inc.php'; 
    40         require_once 'inc/common.inc.php'; 
    4143 
    4244        if (isset($_GET['start_tab'])) 
  • sandbox/workflow/branches/1015/js/htmlarea/plugins/UploadImage/popups/ImageEditor/Transform.php

    r795 r3061  
    130130 
    131131        $classname = "Image_Transform_Driver_{$driver}"; 
    132         $obj =& new $classname; 
     132        $obj = new $classname; 
    133133        return $obj; 
    134134    } 
  • sandbox/workflow/branches/1015/js/jscode/participants.js

    r795 r3061  
    11var participantsClone = null; 
     2var chkOnlyVisibleAccountsClone = null; 
    23var searchTimer = null; 
    34var globalSearchEnter = true; 
     
    2324        var params = { 
    2425                organization: $F('organization'), 
     26                onlyVisibleAccounts: $F('onlyVisibleAccounts'), 
    2527                entities: $F('entities'), 
    2628                id: $F('id'), 
     
    3436        var params = { 
    3537                context: $F('sector'), 
     38                onlyVisibleAccounts: $F('onlyVisibleAccounts'), 
    3639                entities: $F('entities'), 
    3740                id: $F('id'), 
     
    4649        setSelectValue($('participants'), data); 
    4750        participantsClone = data; 
     51        if($('onlyVisibleAccounts')) 
     52                chkOnlyVisibleAccountsClone = $('onlyVisibleAccounts').checked; 
    4853} 
    4954 
     
    6368        var reg = new RegExp("<option[^>]*>[^<]*" + searchString + "[^<]*<\/option>", "gi"); 
    6469        setSelectValue($('participants'), participantsClone.match(reg)); 
     70        if($('onlyVisibleAccounts')) 
     71                $('onlyVisibleAccounts').checked = chkOnlyVisibleAccountsClone; 
    6572 
    6673        var participants = $('participants'); 
     
    126133 
    127134                obj = $('participants'); 
    128                 if (obj) 
     135                if (obj){ 
    129136                        participantsClone = obj.innerHTML; 
     137                        if($('onlyVisibleAccounts')) 
     138                                chkOnlyVisibleAccountsClone = $('onlyVisibleAccounts').checked; 
     139                } 
    130140 
    131141                obj = $('exitLink'); 
     
    140150                if (obj) 
    141151                        obj.focus(); 
     152 
     153                obj = $('onlyVisibleAccounts'); 
     154                if (obj) 
     155                        obj.onclick = checkOnlyVisibleAccounts; 
    142156 
    143157                obj = $('useGlobalSearch'); 
     
    149163        }); 
    150164}; 
     165 
     166function checkOnlyVisibleAccounts() 
     167{ 
     168        if(!$('useGlobalSearch').checked) 
     169                getParticipants(); 
     170        else 
     171                toggleFullSearch(); 
     172} 
    151173 
    152174function participantsFilterName(name) 
     
    330352        $('globalSearchWarnings').innerHTML = ''; 
    331353        var params = { 
     354                onlyVisibleAccounts: $F('onlyVisibleAccounts'), 
    332355                searchTerm: $F('search'), 
    333356                entities: $F('entities'), 
     
    341364{ 
    342365        newWidth   = 500; 
    343         newHeight  = 290; 
     366        newHeight  = 315; 
    344367        newScreenX = screen.width - newWidth; 
    345368        newScreenY = 0; 
  • sandbox/workflow/branches/1015/js/jscode/wf_file_upload.js

    r795 r3061  
    149149                }; 
    150150 
     151 
     152 
    151153                // Set row value 
    152154                new_row.innerHTML = element.value + '&nbsp;&nbsp;'; 
     
    160162        }; 
    161163 
     164        this.removeFile = function (me, nome){ 
     165                me.parentNode.parentNode.removeChild(me.parentNode); 
     166                hd = document.getElementById("hd_remover_anexos"); 
     167                hd.value += nome+"; "; 
     168        } 
     169 
    162170}; 
  • sandbox/workflow/branches/1015/js/jscode/wf_select_ldap_users.js

    r795 r3061  
    99 * @param String opt_name Atributo que será atribuído ao name (innerHTML) das options da combo, por padrão é o 'cn' 
    1010 */ 
    11 function search_ldap_users_by_cn(cn, target, opt_id, opt_name, handleExpiredSessions) 
    12 { 
     11function search_ldap_users_by_cn(cn, target, opt_id, opt_name, handleExpiredSessions, opt_complement) 
     12 
     13        // o parâmetro opt_complement foi acrescentado posteriormente a esta função, devido alguns métodos não utilizá-lo é 
     14        // necessário fazer o tratamento do mesmo caso não seja passado. 
     15        if(opt_complement == undefined) 
     16                opt_complement = ''; 
     17 
    1318/* Método que trata o retorno da chamada Ajax. Atribui os valores retornados à combobox */ 
    1419        function result_search_ldap_users_by_cn(data) 
     
    3540                        var container = document.getElementById(data["target"]); 
    3641                        container.innerHTML = ""; 
    37                         if(data['values'].length > 1){ 
     42                        if(data['values'].length >= 1){ 
    3843                                container.disabled = true; 
    3944                                fill_combo_employee(data["target"], data["values"]); 
     
    4449                        } 
    4550                } 
     51 
     52                return false; 
    4653        } 
    4754 
    4855        var url = '$this.bo_utils.search_ldap_users_by_cn'; 
    49         var param = "cn=" + cn + "&target=" + target + "&id=" + opt_id + "&name=" + opt_name; 
     56        var param = "cn=" + cn + "&target=" + target + "&id=" + opt_id + "&name=" + opt_name + "&complement=" + opt_complement; 
    5057 
    5158        document.getElementById(target + "_img").show(); 
  • sandbox/workflow/branches/1015/js/orgchart/organization.js

    r2063 r3061  
    483483                        data[i]['tr_attributes']['class'] = "linha" + i%2; 
    484484                        data[i]['tr_attributes']['className'] = "linha" + i%2; 
    485                         data[i]['funcionario_id_desc'] = '<a href="javascript:void(0)" class="lbOn" onmouseover="getEmployeeInfoTimer(event, ' + data[i]['funcionario_id'] + ', ' + organizationID + '); return false;" onmouseout="hideEmployeeInfo(); return false;" onclick="loadAddEmployeeUI(' + organizationID + ', function(){objEmployee.fillForm(' + dataHash.customInspect() + ')}); $(\'addEmployeeLink\').parentNode.removeChild($(\'addEmployeeLink\')); return false;">' + data[i]['funcionario_id_desc'] + '</a>' + (data[i]['removed'] ? ' <font color="red">(excluído)</font>' : ''); 
     485                        data[i]['funcionario_id_desc'] = '<a href="javascript:void(0)" class="lbOn" onmouseover="getEmployeeInfoTimer(event, ' + data[i]['funcionario_id'] + ', ' + organizationID + '); return false;" onmouseout="hideEmployeeInfo(); return false;" onclick="loadAddEmployeeUI(' + organizationID + ', function(){objEmployee.fillForm(' + dataHash.customInspect() + ')}); $(\'addEmployeeLink\').parentNode.removeChild($(\'addEmployeeLink\')); return false;">' + data[i]['funcionario_id_desc'] + '</a>' + (data[i]['removed'] ? ' <font color="red">(inativo)</font>' : ''); 
    486486                        data[i]['actions'] = '<a href="#" onclick="objEmployee.remove({\'funcionario_id\': ' + data[i]['funcionario_id'] + ', \'organizacao_id\': ' + organizationID + '} , this.parentNode.parentNode); return false;"><img border="0" width="16" height="16" src="workflow/templateFile.php?file=images/button_cancel.png" /></a>'; 
    487487                } 
     
    537537                        data[i]['tr_attributes']['class'] = "linha" + i%2; 
    538538                        data[i]['tr_attributes']['className'] = "linha" + i%2; 
    539                         data[i]['funcionario_id_desc'] = '<a href="javascript:void(0)" class="lbOn" onmouseover="getEmployeeInfoTimer(event, ' + data[i]['funcionario_id'] + ', ' + organizationID + '); return false;" onmouseout="hideEmployeeInfo(); return false;" onclick="loadAddEmployeeUI(' + organizationID + ', function(){objEmployee.fillForm(' + dataHash.customInspect() + ')}); $(\'addEmployeeLink\').parentNode.removeChild($(\'addEmployeeLink\')); return false;">' + data[i]['funcionario_id_desc'] + ' ' + complement + '</a>' + (data[i]['removed'] ? ' <font color="red">(excluído)</font>' : ''); 
     539                        data[i]['funcionario_id_desc'] = '<a href="javascript:void(0)" class="lbOn" onmouseover="getEmployeeInfoTimer(event, ' + data[i]['funcionario_id'] + ', ' + organizationID + '); return false;" onmouseout="hideEmployeeInfo(); return false;" onclick="loadAddEmployeeUI(' + organizationID + ', function(){objEmployee.fillForm(' + dataHash.customInspect() + ')}); $(\'addEmployeeLink\').parentNode.removeChild($(\'addEmployeeLink\')); return false;">' + data[i]['funcionario_id_desc'] + ' ' + complement + '</a>' + (data[i]['removed'] ? ' <font color="red">(inativo)</font>' : ''); 
    540540                        data[i]['actions'] = '<a href="#" onclick="objEmployee.remove({\'funcionario_id\': ' + data[i]['funcionario_id'] + ', \'organizacao_id\': ' + organizationID + '} , this.parentNode.parentNode); return false;"><img border="0" width="16" height="16" src="workflow/templateFile.php?file=images/button_cancel.png" /></a>'; 
    541541                        window.scrollTo(0,0); 
  • sandbox/workflow/branches/1015/js/userinterface/orgchart.js

    r2371 r3061  
    348348                                complement = ''; 
    349349                        if (employees[i]['removed']) 
    350                                 complement += ' <font color="red">(excluído)</font>'; 
     350                                complement += ' <font color="red">(inativo)</font>'; 
    351351                        content += '<tr class="linha'+ i%2 + (useCategories ? ' categoria_' + employees[i]['funcionario_categoria_id'] : '') + '" onmouseover="this.className=\'highlight0\'" onmouseout="this.className=\'linha'+ i%2 + (useCategories ? ' categoria_' + employees[i]['funcionario_categoria_id'] : '') + '\'">'; 
    352352                        content += '<td><a href="javascript:void(0);" onmouseover="getEmployeeInfoTimer(event, ' + employees[i]['funcionario_id'] + '); return false;" onmouseout="hideEmployeeInfo(); return false;">' + employees[i]['cn'] + complement + '</a></td>'; 
  • sandbox/workflow/branches/1015/lib/factory/WorkflowFactory.php

    r2588 r3061  
    6363                $this->registerFileInfo('Thread', 'class.Thread.inc.php', 'inc'); 
    6464                $this->registerFileInfo('Paging', 'class.Paging.inc.php', 'inc'); 
     65                $this->registerFileInfo('Logger', 'class.Logger.inc.php', 'inc'); 
    6566                $this->registerFileInfo('FsUtils', 'class.fsutils.inc.php', 'inc'); 
    6667                $this->registerFileInfo('UserPictureProvider', 'class.UserPictureProvider.inc.php', 'inc'); 
     
    168169 
    169170 
     171                /** 
     172                 * TODO - This is another ATR - Alternative Technical Resource (common known 
     173                 * as workaround) to allow instantiation of "wf" classes. Although these classes 
     174                 * should have not been instanciated by the workflow module, some of them are 
     175                 * instantiated by run_activity during every execution. =( 
     176                 * In a new version of MVC these objects must be created by the Processes. 
     177                 */ 
     178                $this->registerFileInfo('wf_natural', 'class.wf_natural.php', 'inc/local/classes'); 
     179                $this->registerFileInfo('wf_db', 'class.wf_db.php', 'inc/local/classes'); 
     180 
     181 
    170182                /* ok. no more instances of this class.. */ 
    171183                self::$_instantiated = true; 
  • sandbox/workflow/branches/1015/setup/default_records.inc.php

    r2042 r3061  
    5959$GLOBALS['phpgw']->ADOdb->query("INSERT INTO phpgw_config (config_app, config_name, config_value) VALUES(?, ?, ?)", array('workflow', 'log_type_file', 'True')); 
    6060$GLOBALS['phpgw']->ADOdb->query("INSERT INTO phpgw_config (config_app, config_name, config_value) VALUES(?, ?, ?)", array('workflow', 'log_type_firebug', 'True')); 
    61 $GLOBALS['phpgw']->ADOdb->query("INSERT INTO phpgw_config (config_app, config_name, config_value) VALUES(?, ?, ?)", array('workflow', 'log_level', '7')); 
     61$GLOBALS['phpgw']->ADOdb->query("INSERT INTO phpgw_config (config_app, config_name, config_value) VALUES(?, ?, ?)", array('workflow', 'log_level', '0')); 
    6262 
    6363/* connect to the new database */ 
  • sandbox/workflow/branches/1015/setup/setup.inc.php

    r2042 r3061  
    1616        $setup_info['workflow']['app_order']    = 10; 
    1717        $setup_info['workflow']['enable']               = 1; 
    18         $setup_info['workflow']['author']               = 'Ported from tikiwiki, modified by regis_glc alpeb & mbartz<br>Customized to ExpressoLivre by viani, rodrigolira, mariceli, drovetto, carloseduardo, rufino, asaikawa, gbisotto, julianadelgado & rodsouza<br>See changeLog for full names.'; 
    19         $setup_info['workflow']['note']                 = 'Workflow engine'; 
     18        $setup_info['workflow']['author']               = 'See changeLog for complete list of developers.'; 
     19        $setup_info['workflow']['note']                 = 'Workflow Engine'; 
    2020        $setup_info['workflow']['license']              = 'GPL'; 
    2121        $setup_info['workflow']['description']          = 'Workflow Management'; 
     
    5959        $setup_info['workflow']['depends'][] = array( 
    6060                'appname' => 'phpgwapi', 
    61                 'versions' => Array('1.0.0','1.0.1','1.2', '2.0', '2.1') 
     61                'versions' => Array('1.0.0','1.0.1','1.2', '2.0', '2.1', '2.2') 
    6262        ); 
    6363        $setup_info['workflow']['depends'][] = array( 
    6464                'appname' => 'preferences', 
    65                 'versions' => Array('1.0.0', '0.9.13.002', '2.0', '2.1') 
     65                'versions' => Array('1.0.0', '0.9.13.002', '2.0', '2.1', '2.2') 
    6666        ); 
    6767?> 
  • sandbox/workflow/branches/1015/setup/tables_current.inc.php

    r1229 r3061  
    190190                                'fd' => array( 
    191191                                        'wf_parent_instance_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), 
    192                                         'wf_parent_activity_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), 
    193192                                        'wf_child_instance_id'  => array('type' => 'int', 'precision' => '4', 'nullable' => False), 
    194193                                        'wf_parent_lock'                => array('type' => 'int', 'precision' => '2', 'nullable' => True) 
    195194                                ), 
    196                                 'pk' => array('wf_parent_instance_id', 'wf_parent_activity_id', 'wf_child_instance_id'), 
     195                                'pk' => array('wf_parent_instance_id', 'wf_child_instance_id'), 
    197196                                'fk' => array(), 
    198197                                'ix' => array(), 
  • sandbox/workflow/branches/1015/setup/tables_update.inc.php

    r2042 r3061  
    12161216        { 
    12171217                #updating the current version 
     1218                $GLOBALS['setup_info']['workflow']['currentver'] = '2.0.003'; 
     1219                return $GLOBALS['setup_info']['workflow']['currentver']; 
     1220        } 
     1221        $test[] = '2.0.003'; 
     1222        function workflow_upgrade2_0_003() 
     1223        { 
     1224                #updating the current version 
     1225                $GLOBALS['setup_info']['workflow']['currentver'] = '2.0.004'; 
     1226                return $GLOBALS['setup_info']['workflow']['currentver']; 
     1227        } 
     1228        $test[] = '2.0.004'; 
     1229        function workflow_upgrade2_0_004() 
     1230        { 
     1231                #updating the current version 
    12181232                $GLOBALS['setup_info']['workflow']['currentver'] = '2.1.000'; 
    12191233                return $GLOBALS['setup_info']['workflow']['currentver']; 
     
    12241238                if (!$GLOBALS['phpgw_setup']->oProc->m_bDeltaOnly) 
    12251239                { 
     1240                        /* updating log level */ 
     1241                        $values = array('0', 'workflow', 'log_level'); 
     1242                        $GLOBALS['phpgw']->ADOdb->query('UPDATE phpgw_config SET config_value=? WHERE config_app=? AND config_name=?', $values); 
     1243 
    12261244                        $workflowHostInfo = extractDatabaseParameters(); 
    12271245 
     
    12601278                        /* reconnect to the previous database */ 
    12611279                        $GLOBALS['phpgw']->ADOdb->connect($workflowHostInfo['host'], $workflowHostInfo['user'], $workflowHostInfo['password'], $workflowHostInfo['dbname']); 
     1280 
     1281                        /* removing primary key of egw_wf_interinstance_relations */ 
     1282                        $GLOBALS['phpgw']->ADOdb->query('ALTER TABLE egw_wf_interinstance_relations DROP CONSTRAINT egw_wf_interinstance_relations_pkey'); 
     1283 
     1284                        /* removing wf_parent_activity_id column from egw_wf_interinstance_relations table */ 
     1285                        $GLOBALS['phpgw']->ADOdb->query('ALTER TABLE egw_wf_interinstance_relations DROP COLUMN wf_parent_activity_id'); 
     1286 
     1287                        /* adding primary key without the column removed */ 
     1288                        $GLOBALS['phpgw']->ADOdb->query('ALTER TABLE egw_wf_interinstance_relations ADD CONSTRAINT egw_wf_interinstance_relations_pkey PRIMARY KEY (wf_parent_instance_id, wf_child_instance_id)'); 
    12621289                } 
    12631290 
  • sandbox/workflow/branches/1015/templates/default/participants.tpl

    r795 r3061  
    3232                <td colspan="2"> 
    3333                        <p style="text-align: center; font-weight: bold; font-size: 130%;">Busca Global</p> 
     34                </td> 
     35        </tr> 
     36        <tr> 
     37                <td colspan="2"> 
     38                        <label><input type="checkbox" name="onlyVisibleAccounts" id="onlyVisibleAccounts" value="true" {if $onlyVisibleAccounts} checked {/if}/> Exibir apenas contas vis&iacute;veis</label> 
    3439                </td> 
    3540        </tr> 
Note: See TracChangeset for help on using the changeset viewer.