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

Ticket #950 - Merged 2838:3056 /trunk/workflow em /sandbox/workflow/trunk

Location:
sandbox/workflow/trunk
Files:
32 edited
2 copied

Legend:

Unmodified
Added
Removed
  • sandbox/workflow/trunk/doc/change_log.txt

    r2886 r3060  
    1717pedroerp is Pedro Eugênio Rocha Pedreira 
    1818fabianok is Fabiano Sardenberg Kuss 
     19pereira.jair is Jair Gonçalves Pereira Junior 
     20adeildosantos is Adeildo Fernandes dos Santos 
    1921 
    2022[2.2.000] 
    2123 
     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) 
    2229        #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) 
    2331        #1080 - Modificada string (excluído) para (inativo) quando um registro de usuário no cache não existe mais no ldap. (viani) 
    2432        #1069 - Inclusão de log de tempo de execução de atividades. (gbisotto/rufino) 
  • sandbox/workflow/trunk/inc/class.WorkflowLDAP.inc.php

    r2372 r3060  
    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/trunk/inc/class.basemodel.inc.php

    r795 r3060  
    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/trunk/inc/class.bo_participants.inc.php

    r2372 r3060  
    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/trunk/inc/class.bo_userinterface.inc.php

    r2372 r3060  
    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/trunk/inc/class.bo_utils.inc.php

    r2372 r3060  
    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/trunk/inc/class.so_move_instances.inc.php

    r2466 r3060  
    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/trunk/inc/class.ui_adminactivities.inc.php

    r2372 r3060  
    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/trunk/inc/class.ui_adminroles.inc.php

    r2858 r3060  
    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'])) 
    280280                                                $glabel = '<font color="red">(inativo)</font>'; 
  • sandbox/workflow/trunk/inc/class.ui_participants.inc.php

    r2372 r3060  
    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/trunk/inc/class.workflow_processmanager.inc.php

    r2372 r3060  
    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/trunk/inc/common.inc.php

    r2466 r3060  
    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/trunk/inc/engine/src/API/BaseActivity.php

    r2372 r3060  
    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/trunk/inc/engine/src/API/Instance.php

    r2886 r3060  
    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'); 
     
    515510    $iid=$this->instanceId; 
    516511 
    517     $query = 'insert into '.GALAXIA_TABLE_PREFIX.'instances 
    518       (wf_instance_id, wf_started,wf_ended,wf_status,wf_p_id,wf_owner,wf_properties)  
    519       values(?,?,?,?,?,?,?)'; 
    520  
    521    $this->query($query,array((int)$iid, $now,0,'active',$pid,$user,$this->security_cleanup(Array(),false))); 
    522   
     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 
    523519    // Then add in ".GALAXIA_TABLE_PREFIX."instance_activities an entry for the 
    524520    // activity the user and status running and started now 
    525     $query = 'insert into '.GALAXIA_TABLE_PREFIX.'instance_activities (wf_instance_id,wf_activity_id,wf_user, 
    526             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                (?,?,?,?,?)'; 
    527525    $this->query($query,array((int)$iid,(int)$activityId,$user,(int)$now,'running')); 
    528526 
    529527    if (($this->isChildInstance) && (!is_null($this->parentInstanceId))) 
    530528    { 
    531       $query = 'INSERT INTO '.GALAXIA_TABLE_PREFIX.'interinstance_relations(wf_parent_instance_id, wf_parent_activity_id, wf_child_instance_id, wf_parent_lock) VALUES(?,?,?,?)'; 
    532       $this->query($query,array((int) $this->parentInstanceId, (int) $this->parentActivityId, (int) $iid, (int) (($this->parentLock) ? 1 : 0))); 
    533     } 
    534      
     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 
    535536    //update database with other datas stored in the object 
    536537    return $this->sync(); 
    537538  } 
    538    
     539 
    539540  /** 
    540541   * Sets the name of this instance 
     
    11421143    return $this->__activity_completed; 
    11431144  } 
    1144   
     1145 
    11451146  /** 
    11461147   * This function can be called by the instance object himself (for automatic activities) 
    1147    * or by the WfRuntime object. In interactive activities code users use complete() --without args--  
    1148    * 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. 
    11491150   * In non-interactive activities a call to a complete() will generate errors because the engine 
    11501151   * does it his own way as I said first. 
     
    11621163  { 
    11631164    //$this->db-> 
    1164     $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)); 
    11651166    if ($result->numRows() > 0) 
    11661167      die("Esta instância está aguardando que outras instâncias, das quais depende, sejam finalizadas."); 
     
    11701171    //The complete() is in a transaction, it will be completly done or not at all 
    11711172    $this->db->StartTrans(); 
    1172      
     1173 
    11731174    //lock rows and ensure access is granted 
    11741175    if (!(isset($this->security))) $this->security = &Factory::getInstance('WfSecurity'); 
  • sandbox/workflow/trunk/inc/engine/src/ProcessMonitor/ProcessMonitor.php

    r2372 r3060  
    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/trunk/inc/engine/src/common/WfRuntime.php

    r2858 r3060  
    10891089    $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/trunk/inc/local/classes/class.wf_engine.php

    r2858 r3060  
    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        { 
     200                wf_warn_deprecated_method('wf_instance', 'getChildren'); 
    193201                $WFInstance = &Factory::getInstance('wf_instance'); 
    194202                $preOutput = $WFInstance->getChildren($instanceID); 
     
    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/trunk/inc/local/classes/class.wf_orgchart.php

    r2466 r3060  
    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/trunk/inc/local/functions/function.wf_create_object.php

    r795 r3060  
    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/trunk/inc/log/Log.php

    r795 r3060  
    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/trunk/inc/log/Log/observer.php

    r795 r3060  
    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/trunk/inc/smarty/plugins/function.html_options.php

    r795 r3060  
    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/trunk/inc/smarty/wf_plugins/function.wf_select_ldap_users.php

    r2372 r3060  
    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/trunk/inc/smarty/wf_plugins/function.wf_select_user.php

    r2372 r3060  
    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/trunk/inc/smarty/wf_plugins/function.wf_select_users.php

    r2372 r3060  
    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/trunk/js/htmlarea/plugins/UploadImage/popups/ImageEditor/Transform.php

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

    r795 r3060  
    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/trunk/js/jscode/wf_file_upload.js

    r795 r3060  
    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/trunk/js/jscode/wf_select_ldap_users.js

    r795 r3060  
    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/trunk/setup/tables_current.inc.php

    r1229 r3060  
    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/trunk/setup/tables_update.inc.php

    r2858 r3060  
    12781278                        /* reconnect to the previous database */ 
    12791279                        $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)'); 
    12801289                } 
    12811290 
  • sandbox/workflow/trunk/templates/default/participants.tpl

    r795 r3060  
    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.