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

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

File:
1 edited

Legend:

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

    r1446 r3167  
    127127                $this->isAdmin = $_SESSION['phpgw_info']['workflow']['user_is_admin']; 
    128128                $this->acl = &$GLOBALS['ajax']->acl; 
    129                 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBWorkflow()->Link_ID; 
    130                 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBWorkflow()->Link_ID; 
     129                $this->db = &Factory::getInstance('WorkflowObjects')->getDBWorkflow()->Link_ID; 
     130                $this->db = &Factory::getInstance('WorkflowObjects')->getDBWorkflow()->Link_ID; 
    131131                $this->db->SetFetchMode(ADODB_FETCH_ASSOC); 
    132132        } 
     
    699699                $this->_checkAccess($organizationID); 
    700700 
    701                 $supervisors = '{' . implode(', ', $this->db->GetRow('SELECT COALESCE(titular_funcionario_id, -1) AS titular_funcionario_id, COALESCE(substituto_funcionario_id, -1) AS substituto_funcionario_id FROM area WHERE (area_id = ?) AND (organizacao_id = ?)', array($areaID, $organizationID))) . '}'; 
     701                /* gather some info from the area */ 
     702                $areaInfo = $this->db->query('SELECT COALESCE(a.titular_funcionario_id, -1) AS titular_funcionario_id, COALESCE(s.funcionario_id, -1) AS substituto_funcionario_id FROM area a LEFT OUTER JOIN substituicao s ON ((a.area_id = s.area_id) AND (CURRENT_DATE BETWEEN s.data_inicio AND s.data_fim)) WHERE (a.organizacao_id = ?) AND (a.area_id = ?)', array($organizationID, $areaID))->GetArray(-1); 
     703                if (empty($areaInfo)) 
     704                        return false; 
     705                $areaInfo = $areaInfo[0]; 
     706                $supervisors = '{' . implode(', ', $areaInfo) . '}'; 
     707 
    702708                $query = "SELECT funcionario_id, funcionario_status_id, centro_custo_id, localidade_id, organizacao_id, area_id, cargo_id, nivel, funcionario_categoria_id, titulo FROM funcionario WHERE ((area_id = ?) AND (organizacao_id = ?)) OR (funcionario_id = ANY (?))"; 
    703709                $result = $this->db->query($query, array($areaID, $organizationID, $supervisors)); 
     
    705711 
    706712                $output = $result->GetArray(-1); 
    707                 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP'); 
     713                $cachedLDAP = Factory::newInstance('CachedLDAP'); 
    708714                $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP_DATABASE); 
    709715                for ($i = 0; $i < count($output); $i++) 
     
    711717                        $output[$i]['funcionario_id_desc'] = ''; 
    712718                        $output[$i]['uid'] = ''; 
     719 
     720                        if (in_array($output[$i]['funcionario_id'], $areaInfo)) 
     721                                $output[$i]['chief'] = ($output[$i]['funcionario_id'] == $areaInfo['titular_funcionario_id']) ? 1 : 2; 
     722 
    713723                        if (($entry = $cachedLDAP->getEntryByID($output[$i]['funcionario_id']))) 
    714724                        { 
     
    739749                $unifiedResult = array(); 
    740750 
     751                /* FIXME - this piece of code should use the new CacheLdap class */ 
    741752                if (is_numeric($searchTerm)) 
    742753                { 
     
    754765 
    755766                /* search for the $searchTerm in the LDAP */ 
    756                 $ldap = &$GLOBALS['workflow']['workflowObjects']->getLDAP(); 
    757                 $list = @ldap_search($ldap, $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getLDAPContext(), $ldapSearch, array('uidnumber', 'cn', 'uid')); 
     767                $ldap = &Factory::getInstance('WorkflowObjects')->getLDAP(); 
     768                $list = @ldap_search($ldap, Factory::getInstance('WorkflowLDAP')->getLDAPContext(), $ldapSearch, array('uidnumber', 'cn', 'uid')); 
    758769                if ($list === false) 
    759770                        die(serialize("O sistema de busca não pode ser utilizado nesta organização.")); 
     
    763774 
    764775                /* search for the $searchTerm in the DB */ 
    765                 $resultSet = $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID->query($DBSearch, $DBValues)->GetArray(-1); 
     776                $resultSet = Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID->query($DBSearch, $DBValues)->GetArray(-1); 
    766777                foreach ($resultSet as $row) 
    767778                        if (!isset($unifiedResult[$row['uidnumber']])) 
     
    812823                { 
    813824                        $errors = array( 
    814                                 "O funcionário \"" . $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($employeeID) . "\" já pertença à área \"{$row['sigla']}\".", 
     825                                "O funcionário \"" . Factory::getInstance('WorkflowLDAP')->getName($employeeID) . "\" já pertença à área \"{$row['sigla']}\".", 
    815826                                '-----------------', 
    816827                                'Caso você queira colocá-lo na área selecionada, siga o procedimento: faça uma busca por seu nome, clique para editá-lo e, troque pela área desejada.' 
     
    862873                $this->_checkAccess($organizationID); 
    863874 
    864                 $query = 'SELECT sigla FROM area WHERE (? IN (titular_funcionario_id, substituto_funcionario_id, auxiliar_funcionario_id))'; 
     875                $query = 'SELECT DISTINCT(a.sigla) FROM area a LEFT OUTER JOIN substituicao s USING (area_id) WHERE (? IN (a.titular_funcionario_id, s.funcionario_id, a.auxiliar_funcionario_id))'; 
    865876                $areas = array(); 
    866877                $resultSet = $this->db->query($query, $employeeID); 
     
    870881                { 
    871882                        $errors = array( 
    872                                 "O funcionário \"" . $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($employeeID) . "\" é titular, substituto ou auxiliar administrativo das seguintes áreas: " . implode(", ", $areas), 
     883                                "O funcionário \"" . Factory::getInstance('WorkflowLDAP')->getName($employeeID) . "\" é titular, substituto, já participou de substituição ou é auxiliar administrativo das seguintes áreas: " . implode(", ", $areas), 
    873884                                '-----------------', 
    874885                                'Se você quiser excluir este funcionário, precisa removê-lo dos "cargos" que ele possui nas áreas citadas.' 
     
    890901         * @access public 
    891902         */ 
    892         function getArea($organizationID) 
     903        function getArea($organizationID, $areaID = -1) 
    893904        { 
    894905                $this->_checkAccess($organizationID); 
    895906 
    896907                $output = array(); 
    897  
    898                 $query = "SELECT area_id, centro_custo_id, organizacao_id, area_status_id, substituto_funcionario_id, titular_funcionario_id, superior_area_id, sigla, descricao, ativa, auxiliar_funcionario_id FROM area WHERE organizacao_id = ? ORDER BY sigla"; 
    899                 $result = $this->db->query($query, array($organizationID)); 
    900                 $this->_checkError($result); 
    901  
    902                 $ldap = &$GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP'); 
     908                $values = array($organizationID); 
     909 
     910                // if we are looking for a specific area 
     911                $area_condition = ""; 
     912                if (($areaID != -1) && !empty($areaID)) { 
     913                        $area_condition = " AND a.area_id = ? "; 
     914                        $values[]= $areaID; 
     915                } 
     916 
     917                $query = "SELECT a.area_id, a.centro_custo_id, a.organizacao_id, a.area_status_id, a.titular_funcionario_id, a.superior_area_id, a.sigla, a.descricao, a.ativa, a.auxiliar_funcionario_id, s.funcionario_id as substituto_funcionario_id FROM area a LEFT OUTER JOIN substituicao s ON ((a.area_id = s.area_id) AND (CURRENT_DATE BETWEEN s.data_inicio AND s.data_fim)) WHERE organizacao_id = ? " . $area_condition . " ORDER BY sigla"; 
     918                $result = $this->db->query($query, $values); 
     919                $this->_checkError($result); 
     920 
     921                $ldap = &Factory::getInstance('WorkflowLDAP'); 
    903922                while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) 
    904923                { 
     
    958977         * @param int $organizationID O ID da organização. 
    959978         * @param int $areaStatusID O ID do status da área. 
    960          * @param int $backupEmployeeID O ID do funcionário que está substituindo o superior da área. 
    961979         * @param int $supervisorID O ID do funcionário que é superior da área. 
    962980         * @param int $superiorAreaID O ID da área que é superior a que está sendo adicionada (NULL caso não possua área superior). 
     
    968986         * @access public 
    969987         */ 
    970         function addArea($costCenterID, $organizationID, $areaStatusID, $backupEmployeeID, $supervisorID, $superiorAreaID, $acronym, $description, $active, $assistantID) 
    971         { 
    972                 $this->_checkAccess($organizationID); 
    973  
    974                 $checkEmployees = array($backupEmployeeID, $supervisorID, $assistantID); 
     988        function addArea($costCenterID, $organizationID, $areaStatusID, $supervisorID, $superiorAreaID, $acronym, $description, $active, $assistantID) 
     989        { 
     990                $this->_checkAccess($organizationID); 
     991 
     992                $checkEmployees = array($supervisorID, $assistantID); 
    975993                $errors = array(); 
    976994                foreach ($checkEmployees as $checkEmployee) 
     
    981999                        $query = 'SELECT 1 FROM funcionario WHERE (funcionario_id = ?)'; 
    9821000                        if (!$this->db->query($query, $checkEmployee)->fetchRow()) 
    983                                 $errors[] = "O funcionário \"" . $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($checkEmployee) . "\" não está vinculado a uma área."; 
     1001                                $errors[] = "O funcionário \"" . Factory::getInstance('WorkflowLDAP')->getName($checkEmployee) . "\" não está vinculado a uma área."; 
    9841002                } 
    9851003 
     
    9911009                } 
    9921010 
    993                 $query = "INSERT INTO area(centro_custo_id, organizacao_id, area_status_id, substituto_funcionario_id, titular_funcionario_id, superior_area_id, sigla, descricao, ativa, auxiliar_funcionario_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; 
    994                 $result = $this->db->query($query, array($costCenterID, $organizationID, $areaStatusID, $backupEmployeeID, $supervisorID, $superiorAreaID, $acronym, $description, $active, $assistantID)); 
     1011                $query = "INSERT INTO area(centro_custo_id, organizacao_id, area_status_id, titular_funcionario_id, superior_area_id, sigla, descricao, ativa, auxiliar_funcionario_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"; 
     1012                $result = $this->db->query($query, array($costCenterID, $organizationID, $areaStatusID, $supervisorID, $superiorAreaID, $acronym, $description, $active, $assistantID)); 
    9951013                $this->_checkError($result); 
    9961014 
     
    10031021         * @param int $organizationID O ID da organização. 
    10041022         * @param int $areaStatusID O ID do status da área. 
    1005          * @param int $backupEmployeeID O ID do funcionário que está substituindo o superior da área. 
    10061023         * @param int $supervisorID O ID do funcionário que é superior da área. 
    10071024         * @param int $superiorAreaID O ID da área que é superior a que está sendo atualizada (NULL caso não possua área superior). 
     
    10141031         * @access public 
    10151032         */ 
    1016         function updateArea($costCenterID, $organizationID, $areaStatusID, $backupEmployeeID, $supervisorID, $superiorAreaID, $acronym, $description, $active, $assistantID, $areaID) 
    1017         { 
    1018                 $this->_checkAccess($organizationID); 
    1019  
    1020                 $checkEmployees = array($backupEmployeeID, $supervisorID, $assistantID); 
     1033        function updateArea($costCenterID, $organizationID, $areaStatusID, $supervisorID, $superiorAreaID, $acronym, $description, $active, $assistantID, $areaID) 
     1034        { 
     1035                $this->_checkAccess($organizationID); 
     1036 
     1037                $checkEmployees = array($supervisorID, $assistantID); 
    10211038                $errors = array(); 
    10221039                foreach ($checkEmployees as $checkEmployee) 
     
    10271044                        $query = 'SELECT 1 FROM funcionario WHERE (funcionario_id = ?)'; 
    10281045                        if (!$this->db->query($query, $checkEmployee)->fetchRow()) 
    1029                                 $errors[] = "O funcionário \"" . $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($checkEmployee) . "\" não está vinculado a uma área."; 
     1046                                $errors[] = "O funcionário \"" . Factory::getInstance('WorkflowLDAP')->getName($checkEmployee) . "\" não está vinculado a uma área."; 
    10301047                } 
    10311048 
     
    10331050                { 
    10341051                        $errors[] = '-----------------'; 
    1035                         $errors[] = 'Somente funcionários que estão vinculados a alguma área podem ser colocados na posição de titular, substituto ou auxiliar administrativo.'; 
     1052                        $errors[] = 'Somente funcionários que estão vinculados a alguma área podem ser colocados na posição de titular ou auxiliar administrativo.'; 
    10361053                        $this->endExecution($errors); 
    10371054                } 
    10381055 
    1039                 $query = "UPDATE area SET centro_custo_id = ?, organizacao_id = ?, area_status_id = ?, substituto_funcionario_id = ?, titular_funcionario_id = ?, superior_area_id = ?, sigla = ?, descricao = ?, ativa = ?, auxiliar_funcionario_id = ? WHERE (area_id = ?)"; 
    1040                 $result = $this->db->query($query, array($costCenterID, $organizationID, $areaStatusID, $backupEmployeeID, $supervisorID, $superiorAreaID, $acronym, $description, $active, $assistantID, $areaID)); 
     1056                $query = "UPDATE area SET centro_custo_id = ?, organizacao_id = ?, area_status_id = ?, titular_funcionario_id = ?, superior_area_id = ?, sigla = ?, descricao = ?, ativa = ?, auxiliar_funcionario_id = ? WHERE (area_id = ?)"; 
     1057                $result = $this->db->query($query, array($costCenterID, $organizationID, $areaStatusID, $supervisorID, $superiorAreaID, $acronym, $description, $active, $assistantID, $areaID)); 
    10411058                $this->_checkError($result); 
    10421059 
     
    10741091                $this->_checkAccess($organizationID, false, true); 
    10751092 
     1093                /** 
     1094                 * This is so wrong.. We should always use the factory to 
     1095                 * instantiate stuff. Besides, module class should not 
     1096                 * use process classes; the correct is to do the inverse. 
     1097                 */ 
    10761098                require_once dirname(__FILE__) . '/local/classes/class.wf_orgchart.php'; 
    10771099                $orgchart = new wf_orgchart(); 
     
    10791101                $outputInfo = array(); 
    10801102 
    1081                 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP'); 
     1103                $cachedLDAP = Factory::newInstance('CachedLDAP'); 
     1104 
     1105                /* here we need fresh information. Let's access ldap first */ 
    10821106                $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP_DATABASE); 
    10831107                $employeeEntry = $cachedLDAP->getEntryByID($employeeID); 
     
    12431267                ); 
    12441268 
    1245                 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP'); 
     1269                $cachedLDAP = Factory::newInstance('CachedLDAP'); 
    12461270                $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP_DATABASE); 
    12471271                if (!empty($areaInfo['titular_funcionario_id'])) 
     
    13571381                return ( ( $result === false ) ? false : true ); 
    13581382        } 
     1383 
     1384        /** 
     1385         * Validate start and end dates for a substitution 
     1386         * @param int $areaID Area's ID. 
     1387         * @param string $date_start Substitution's start date. 
     1388         * @param string $date_start Substitution's end date. 
     1389         * @return bool 
     1390         * @access private 
     1391         */ 
     1392        function validateSubstitutionDates($areaID, $date_start, $date_end, $substitutionID = -1) 
     1393        { 
     1394                /* TODO 
     1395                * I'm not supose to be here.. (date validations speaking) 
     1396                * move me to some validation class! 
     1397                */  
     1398 
     1399                /* validating dates */ 
     1400                $date_pattern = '/^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/[12][0-9]{3}$/'; 
     1401 
     1402                if (!preg_match($date_pattern, $date_start)) 
     1403                        $this->endExecution("Formato inválido para data de início."); 
     1404                if (!preg_match($date_pattern, $date_end)) 
     1405                        $this->endExecution("Formato inválido para data de término. "); 
     1406 
     1407                $date_start_arr = explode('/', $date_start); 
     1408                $date_end_arr = explode('/', $date_end); 
     1409 
     1410                /* is it a gregorian date? */ 
     1411                if (!checkdate($date_start_arr[1], $date_start_arr[0], $date_start_arr[2])) 
     1412                        $this->endExecution("Data de início inválida."); 
     1413                if (!checkdate($date_end_arr[1], $date_end_arr[0], $date_end_arr[2])) 
     1414                        $this->endExecution("Data de término inválida. "); 
     1415 
     1416                /* is date_end greater then date_start? */ 
     1417                if (mktime(0,0,0, $date_start_arr[1], $date_start_arr[0], $date_start_arr[2]) >= mktime(0,0,0, $date_end_arr[1], $date_end_arr[0], $date_end_arr[2])) 
     1418                        $this->endExecution("A data de término deve ser maior que a data de início."); 
     1419 
     1420                /* preparing dates to database */ 
     1421                $date_start = implode('-', array_reverse($date_start_arr)); 
     1422                $date_end = implode('-', array_reverse($date_end_arr)); 
     1423 
     1424                /* checking if there is a substitution in conflict with these dates */ 
     1425                $query  = "SELECT * FROM substituicao WHERE "; 
     1426                $query .= "     area_id = ? "; 
     1427                $query .= " AND "; 
     1428                $query .= "     substituicao_id != ? "; 
     1429                $query .= " AND "; 
     1430                $query .= "     ("; 
     1431                $query .= "             (? BETWEEN data_inicio AND data_fim) "; 
     1432                $query .= "     OR "; 
     1433                $query .= "             (? BETWEEN data_inicio AND data_fim)"; 
     1434                $query .= "     OR "; 
     1435                $query .= "             (data_inicio BETWEEN ? AND ?)"; 
     1436                $query .= "     ) "; 
     1437 
     1438                // raise an error if there is any record 
     1439                if ($row = $this->db->query($query, array( $areaID, $substitutionID, $date_start, $date_end, $date_start, $date_end ))->fetchRow()) 
     1440                { 
     1441                        $row['data_inicio'] = implode('/', array_reverse(explode('-', $row['data_inicio']))); 
     1442                        $row['data_fim'] = implode('/', array_reverse(explode('-', $row['data_fim']))); 
     1443                        $this->endExecution('Já existe uma substituição no período de '. $row['data_inicio'] . ' a ' . $row['data_fim']); 
     1444                } 
     1445                return true; 
     1446        } 
     1447 
     1448        /** 
     1449         * Add a substitution. 
     1450         * @param int $organizationID Organization's ID. 
     1451         * @param int $areaID Area's ID. 
     1452         * @param int $substituteID Substitute's employee ID. 
     1453         * @param string $date_start Substitution's start date. 
     1454         * @param string $date_start Substitution's end date. 
     1455         * @return bool 
     1456         * @access public 
     1457         */ 
     1458        function addSubstitution( $organizationID, $areaID, $substituteID, $date_start, $date_end ) 
     1459        { 
     1460                $this->_checkAccess( $organizationID ); 
     1461 
     1462                if (!$this->validateSubstitutionDates($areaID, $date_start, $date_end)) 
     1463                        return false; 
     1464 
     1465                /* formating dates */ 
     1466                $date_start = implode('-', array_reverse(explode('/', $date_start))); 
     1467                $date_end = implode('-', array_reverse(explode('/', $date_end))); 
     1468 
     1469                $query = "INSERT INTO substituicao (area_id, funcionario_id, data_inicio, data_fim) VALUES (?, ?, ?, ?)"; 
     1470                $result = $this -> db -> query( $query, array( $areaID, $substituteID, $date_start, $date_end ) ); 
     1471                $this->_checkError( $result ); 
     1472                 
     1473                return ( ( $result === false ) ? false : true ); 
     1474        } 
     1475 
     1476        /** 
     1477         * Update a substitution. 
     1478         * @param int $organizationID Organization's ID. 
     1479         * @param int $areaID Area's ID. 
     1480         * @param int $substituteID Substitute's employee ID. 
     1481         * @param string $date_start Substitution's start date. 
     1482         * @param string $date_start Substitution's end date. 
     1483         * @return bool 
     1484         * @access public 
     1485         */ 
     1486        function updateSubstitution( $organizationID, $areaID, $substituteID, $date_start, $date_end, $substitutionID ) 
     1487        { 
     1488                $this->_checkAccess( $organizationID ); 
     1489 
     1490                if (!$this->validateSubstitutionDates($areaID, $date_start, $date_end, $substitutionID)) 
     1491                        return false; 
     1492 
     1493                /* formating dates */ 
     1494                $date_start = implode('-', array_reverse(explode('/', $date_start))); 
     1495                $date_end = implode('-', array_reverse(explode('/', $date_end))); 
     1496 
     1497                $query = "UPDATE substituicao SET funcionario_id = ?, data_inicio = ?, data_fim = ? WHERE substituicao_id = ?"; 
     1498                $result = $this -> db -> query( $query, array( $substituteID, $date_start, $date_end, $substitutionID ) ); 
     1499                $this->_checkError( $result ); 
     1500                 
     1501                return ( ( $result === false ) ? false : true ); 
     1502        } 
     1503 
     1504        /** 
     1505         * List all the substituions for a given area 
     1506         * @return array List of the substitutions 
     1507         * @access public 
     1508         */ 
     1509        function getSubstitutions( $organizationID, $areaID ) 
     1510        { 
     1511                $this -> _checkAccess( $organizationID ); 
     1512 
     1513                /* we must join area table to get organizacao_id */ 
     1514                $query = "SELECT s.*, a.organizacao_id FROM substituicao s INNER JOIN area a USING(area_id) WHERE area_id = ? ORDER BY data_inicio DESC"; 
     1515                $result = $this -> db -> query( $query, array( $areaID ) ); 
     1516                $this -> _checkError( $result ); 
     1517 
     1518                /* we must query ldap to get full user names. In workflow db we just store uids */ 
     1519                $cachedLDAP = Factory::getInstance('CachedLDAP'); 
     1520 
     1521                $output = $result->GetArray(-1); 
     1522                for ($i = 0; $i < count($output); $i++) { 
     1523                        for ($j = 0; $j < $result->_numOfFields; $j++) 
     1524                                unset($output[$i][$j]); 
     1525 
     1526                        /* including substitute full name */ 
     1527                        $ldap_result = $cachedLDAP->getEntryByID($output[$i]['funcionario_id']); 
     1528                        $output[$i]['substituto_funcionario_id'] = $output[$i]['funcionario_id']; 
     1529                        $output[$i]['substituto_funcionario_id_desc'] = $ldap_result['cn']; 
     1530 
     1531                        /* formating dates */ 
     1532                        $output[$i]['data_inicio'] = implode('/', array_reverse(explode('-', $output[$i]['data_inicio']))); 
     1533                        $output[$i]['data_fim'] = implode('/', array_reverse(explode('-', $output[$i]['data_fim']))); 
     1534                } 
     1535                return $output; 
     1536        } 
     1537 
     1538        /** 
     1539         * Remove a substitution 
     1540         * @param int $organizationID Organization's ID 
     1541         * @param int $telephoneID Substitution's ID 
     1542         * @return bool  
     1543         * @access public 
     1544         */ 
     1545        function removeSubstitution( $organizationID, $substitutionID ) 
     1546        { 
     1547                $this->_checkAccess( $organizationID ); 
     1548 
     1549                $query = "DELETE FROM substituicao WHERE substituicao_id = ?"; 
     1550                $result = $this -> db -> query( $query, array( $substitutionID ) ); 
     1551                $this -> _checkError( $result ); 
     1552 
     1553                return ( ( $result === false ) ? false : true ); 
     1554        } 
    13591555} 
    13601556?> 
Note: See TracChangeset for help on using the changeset viewer.