Zmiany pomiędzy wersją 41 and wersją 42 dla DeployerGuide/Developer

Pokaż
Ignoruj:
Data i czas:
12/11/14 13:46:19 (9 years temu)
Autor:
MK (IP: 213.227.67.33)
Komentarz:

--

Legend:

Bez zmian
Dodane
Usunięte
Zmienione
  • DeployerGuide/Developer

    v41 v42  
    551551SysContext::$usr_info['usr_id'] 
    552552}}} 
     553 
     554== Zmiana statusu dla wpisu w rejestrze == 
     555 
     556{{{ 
     557require_once(MOD_PATH.'CRegisters/beans/CRegisterEntry.inc'); 
     558 
     559$id____ = id wpisu w rejestrze; 
     560$tpstid = id statusu; 
     561 
     562$bean = new CRegisterEntry($id____); 
     563 
     564// tego ifa z zawartością można usunąć jeżeli bezwarunkowo chcemy zmienić status.. czyli bez sprawdzania uprawnień 
     565if ($bean->get('tpstid')) { 
     566        $res = $this->db->select('types_of_processes_states', 'status,tpstnm', 'tpstid='.$bean->get('tpstid'), FALSE, PGSQL_ASSOC); 
     567        if (is_array($res)) { 
     568                $res = $res[0]; 
     569                $stat = $res['status']; 
     570                $desc = $res['tpstnm']; 
     571 
     572                $can_change = ((($stat !== 'FINAL') && ($stat !== 'ACCEPTED')) || UserRights::checkSysAcc('bswfms.extras.privilages.status_change')); 
     573                if (!$can_change) { 
     574                        if (($stat === 'ACCEPTED') && $bean->get('stcuid')) { 
     575                                if (!($can_change = UserRights::checkUsrAcc($bean->get('stcuid')))) { 
     576                                        throw new UserRightsException(NULL, NULL, sprintf(Translator::translate('Zmianę statusu %s może dokonać osoba, która go ustawiła, jej przełożony lub inna osoba posiadająca prawo do stanowiska ustawiającego status.'), $desc)); 
     577                                } 
     578                        } 
     579                } 
     580                if (!$can_change) { 
     581                        throw new UserRightsException(NULL, NULL, sprintf(Translator::translate('Zmianę statusu %s może dokonać osoba posiadająca odpowiedni przywilej.'), $desc)); 
     582                } 
     583        } 
     584} 
     585 
     586$bean->set('tpstid', $tpstid); 
     587$bean->save(); 
     588}}}