2020-08-14 13:36:36 +02:00
< ? php
/**
*
* Class ki skrbi za komunikacijo z GC dokumentnim sistemom
*
*/
/*
* PODTIPI POROČIL
*
* Poročila za vodstvo ( zadeva vodstvo ) - responsible -> AS_FAKULTETA_VODSTVO : 78118 c23 - f23a - 4 c32 - 92 c7 - 695075 d4e0f3
* - poročilo za fakulteto 18512 cb6 - f626 - 4 c04 - aab0 - 9 ed2ed54babd
* - poročilo za program 095 bd968 - d0f3 - 4 f32 - 956e-79653 db35150
* - poročilo splošnih vidikov študijskega procesa ( splošno poročilo ) be0bd3f3 - 3 a9b - 40 cd - a268 - 10 ed3638760c
* - poročilo za doktorski študij ( 2 pdf izpisa ) 01 d8a96b - f5a2 - 481 a - 8 a06 - a50cc4a93ac9
* - poročilo za katedro dc27121d - 700 d - 41 ff - 8 fe4 - 12 d38591bb9a
* - poročilo za habilitacijsko komisijo 666 acaf7 - bfe8 - 4992 - bb62 - dd6611c84f58
* - poročilo za študijske prakse 38 cc004c - faac - 4657 - b827 - b204d22e313e
* - pregledno poročilo fc78571a - 6 f8b - 4 b13 - a01d - 356727 d18329
* - poročilo za predmete 243378 fe - 531 d - 4 d81 - 895e-61 b1ac31646a
* - excel 600 bb813 - c8cb - 4 ca3 - bf88 - 3740 ccfa5ab9
*
* Poročila za izvajalce ( zadeva izvajalec ) - responsible -> AS_FAKULTETA :
* - poročilo za izvajalca a32856de - b1d2 - 4 dd7 - a3fd - ba279d75bdb6
* - poročilo za trende 1 c28d5d5 - 3537 - 4 d1f - 80 af - e96f03a903c7
*/
set_time_limit ( 7200 ); # 120 minut
ini_set ( 'default_socket_timeout' , 1000 );
2020-12-07 09:43:59 +01:00
define ( 'CERT_FOLDER' , " modules/Evalvacija/GC_cert " );
2020-08-14 13:36:36 +02:00
// Produkcijski streznik
2020-12-07 09:43:59 +01:00
define ( 'GC_URL' , " https://gcwserac.uni-lj.si/IntegrationUL/Services/GcService.asmx " );
//define(WSDL_URL, "https://gcwserac.uni-lj.si/IntegrationUL/Services/GcService.asmx?WSDL");
2020-08-14 13:36:36 +02:00
// Direktno produkcijski strežnik za testiranje
2020-12-07 09:43:59 +01:00
//define(GC_URL, "https://193.2.64.32");
2020-08-14 13:36:36 +02:00
// Testni streznik
2020-12-07 09:43:59 +01:00
//define(GC_URL, "https://gcwserac-test.uni-lj.si/IntegrationUL/Services/GcService.asmx");
//define(WSDL_URL, "https://gcwserac-test.uni-lj.si/IntegrationUL/Services/GcService.asmx?WSDL");
2020-08-14 13:36:36 +02:00
class GC {
var $soapClient ; // SOAP client
var $login = 'AnketniSistem' ; // User za login
var $password = 'AnketniSistem' ; // Password za login
2022-03-02 13:04:22 +01:00
//var $year = '2020_2021'; // Letnica za porocilo
var $year = '2021_2022' ; // Letnica za porocilo
2020-08-14 13:36:36 +02:00
var $izvajalec_table = '' ; // Katero tabelo izvajalcev uporabljamo - navadna (eval_izvajalec) ali testna (eval_izvajalec2)
var $pdf_path = '' ; // Pot do pdf-jev, ki jih nalagamo
function __construct (){
global $mysql_database_name ;
global $site_url ;
// Preverjanje ce je na instalaciji vklopljen modul evalvacije (evalvacija je prisotna samo na anketa.uni-lj.si/student)
if ( Common :: checkModule ( 'evalvacija' ) != '1' ){
echo 'Not anketa.uni-lj.si!' ;
exit ();
}
// Nastavimo linke do servica in wsdl-ja
//$wsdl = 'd:/WAMP/www/FDV/admin/survey/modules/Evalvacija/GC_cert/GcService.wsdl';
//$wsdl = WSDL_URL;
//$wsdl = CERT_FOLDER.'/GcService_TEST.wsdl'; // Testni WSDL
$wsdl = CERT_FOLDER . '/GcService.wsdl' ; // Produkcijski WSDL
$endpoint = GC_URL ;
// Nastavimo certifikat
//$certificate = CERT_FOLDER.'/AnketniSistem.pfx';
//$certificate = CERT_FOLDER.'/AnketniSistem2.pem'; // Star - potekel 18.9.2016
//$certificate = CERT_FOLDER.'/AnketniSistemNew.pem'; // Star - veljaven do 20.9.2018
2021-10-29 01:35:03 +02:00
//$certificate = CERT_FOLDER.'/AnketniSistem-07102021.pem'; // Nov - veljaven do 7.10.2021
$certificate = CERT_FOLDER . '/AnketniSistem.pem' ; // Nov - veljaven do 27.10.2024
//$certificate = CERT_FOLDER.'/AnketniSistem222.pem'; // Nov - veljaven do 27.10.2024
//$certificate = CERT_FOLDER.'/AnketniSistem-27102021xxx.pem'; // Nov - veljaven do 27.10.2024
2020-08-14 13:36:36 +02:00
$options = array (
'location' => $endpoint ,
'local_cert' => $certificate ,
//'login' => $this->login,
'passphrase' => $this -> password ,
'trace' => 1 ,
'exceptions' => 1 ,
//'stream_context' => stream_context_create(array('ssl' => array('ciphers'=>'RC4-SHA'))),
//x'cache_wsdl' => WSDL_CACHE_NONE,
//x'connection_timeout' => 1000,
//x'keep_alive' => false,
//'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE,
//'encoding' => 'ISO-8859-1',
'encoding' => 'UTF-8' ,
'soap_version' => SOAP_1_2 ,
'ssl_method' => SOAP_SSL_METHOD_TLS
);
// Ustvarimo SOAP client
try {
$this -> soapClient = new SoapClient ( $wsdl , $options );
}
catch ( Exception $e ){
var_dump ( $e );
}
/* var_dump ( $this -> soapClient -> __getFunctions ());
var_dump ( $this -> soapClient -> __getTypes ());
echo '<pre>' . print_r ( get_defined_vars (), true ) . '</pre>' ; */
}
public function displayGC (){
global $global_user_id ;
global $site_url ;
ini_set ( 'xdebug.var_display_max_depth' , 15 );
ini_set ( 'xdebug.var_display_max_children' , 256 );
ini_set ( 'xdebug.var_display_max_data' , 1024 );
//ini_set('default_socket_timeout', 6000);
echo '<fieldset><legend>GC</legend>' ;
// Nastavimo fakultete
$fakultete = array ();
$sql = sisplet_query ( " SELECT * FROM eval_fakulteta ORDER BY vrstni_red ASC " );
while ( $row = mysqli_fetch_array ( $sql )){
$fakultete [ $row [ 'id' ]] = $row ;
}
/*
2020-10-20 08:49:46 +02:00
* AG 3000043 Akademija za glasbo ( posebni upload )
*
2020-08-14 13:36:36 +02:00
* ALUO 3000042 Akademija za likovno umetnost in oblikovanje
* BF 3000071 Biotehniska fakulteta
* FA 3000025 Fakulteta za arhitekturo
* FDV 3000021 Fakulteta za družbene vede
* FF 3000018 Filozofska fakulteta
* FFA 3000031 Fakulteta za farmacijo
* FGG 3000026 Fakulteta za gradbeništvo in geodezijo
* FMF 3000027 Fakulteta za matematiko in fiziko
* FPP 3000009 Fakulteta za pomorstvo in promet
* FS 3000023 Fakulteta za strojništvo
* FSD 3000006 Fakulteta za socialno delo
* FSP 3000022 Fakulteta za šport
* MF 3000041 Medicinska fakulteta
* NTF 3000029 Naravoslovnotehniška fakulteta
* PEF 3000001 Pedagoska fakulteta
* PF 3000020 Pravna fakulteta
* TEOF 3000050 Teološka fakulteta
* VF 3000037 Veterinarska fakulteta
* ZF 3000011 Zdravstvena fakulteta
*
2020-10-20 08:49:46 +02:00
* FKKT 3000030 Fakulteta za kemijo in kemijsko tehnologijo
* AGRFT 3000044 Akademija za gledališče , radio , film in televizijo - NIMA GC - JA
* FU 3000004 Fakulteta za upravo - NIMA GC - JA
2020-08-14 13:36:36 +02:00
* EF 3000019 Ekonomska fakulteta
* FRI 3000063 Fakulteta za računalništvo in informatiko
* FE 3000064 Fakulteta za elektrotehniko
*/
$report_type_array = array (
'1_1' => 'izvajalci' ,
'1_2' => 'trendi' ,
'2_1' => 'fakulteta' ,
'2_2' => 'programi' ,
'2_3' => 'praksa' ,
2021-10-29 01:35:03 +02:00
'2_4' => 'splosni vidiki' ,
2020-08-14 13:36:36 +02:00
'2_5' => 'katedra' ,
'2_6' => 'excel' ,
'2_7' => 'doktorska' ,
2022-10-27 16:21:23 +02:00
'3_1' => 'habilitacija' ,
2020-08-14 13:36:36 +02:00
'4_1' => 'predmeti'
);
2022-10-27 16:21:23 +02:00
$reports_id = '27102022' ;
$report_type = '4_1' ;
2022-03-02 13:04:22 +01:00
$fak_id = '3000001' ;
2020-08-14 13:36:36 +02:00
$zip_name = '' ;
// Nastavimo pot do pdf-jev
2022-03-02 13:04:22 +01:00
//$this->pdf_path = 'modules/Evalvacija/pdf/unzipped/';
2022-08-03 08:58:58 +02:00
//$this->pdf_path = 'modules/Evalvacija/pdf/unzipped/'.$fakultete[$fak_id]['kratica'].'/';
2022-10-27 16:21:23 +02:00
$this -> pdf_path = 'modules/Evalvacija/pdf/unzipped/' . $fakultete [ $fak_id ][ 'kratica' ] . '/' . $report_type_array [ $report_type ] . '/' ;
//$this->pdf_path = 'modules/Evalvacija/pdf/unzipped/'.$fakultete[$fak_id]['kratica'].'/povzetki/';
2020-08-14 13:36:36 +02:00
echo '<span class="bold">Parametri:</span>' ;
echo '<ul><li>ID: <span class="bold">' . $reports_id . '</span></li>' ;
echo '<li>Tip poročila: <span class="bold">' . $report_type . '</span></li>' ;
echo '<li>ID fakultete: <span class="bold">' . $fak_id . '</span></li>' ;
echo '<li>Kratica fakultete: <span class="bold">' . $fakultete [ $fak_id ][ 'kratica' ] . '</span></li>' ;
echo '<li>Zip name: <span class="bold">' . $zip_name . '</span></li>' ;
echo '<li>Pot do dokumentov: <span class="bold">' . $this -> pdf_path . '</span></li></ul>' ;
// UPLOAD POROCIL
2021-10-29 01:35:03 +02:00
//$this->executeManualUpload($zip_name, $fak_id, $report_type, $reports_id, $unzip=false);
2020-08-14 13:36:36 +02:00
// BRANJE POROCIL - IZVAJALEC
2022-10-27 16:21:23 +02:00
//$response = $this->readFolder($zadeva_id='RezultatiAnket_'.$fak_id.'_14', $fakultete[$fak_id]['kratica']);
2020-08-14 13:36:36 +02:00
// BRANJE POROCIL - FAKULTETA
2022-10-27 16:21:23 +02:00
//$response = $this->readFolder($zadeva_id='RezultatiAnket_'.$fak_id.'_2021_2022', $fakultete[$fak_id]['kratica']);
2020-08-14 13:36:36 +02:00
// BRANJE POROCIL - PREDMETI
2022-10-27 16:21:23 +02:00
//$response = $this->readFolder($zadeva_id='RezultatiAnket_predmeti_'.$fak_id.'_2021_2022', $fakultete[$fak_id]['kratica']);
2020-08-14 13:36:36 +02:00
// BRANJE POROCIL - HABILITACIJA
2022-10-27 16:21:23 +02:00
//$response = $this->readFolder($zadeva_id='RezultatiAnket_habilitacija_'.$fak_id.'_2021_2022', $fakultete[$fak_id]['kratica']);
2020-08-14 13:36:36 +02:00
echo '<pre>' ;
//var_dump($response);
highlight_string ( " <?php \n " . var_export ( $response , true ) . " ?> " );
echo '</pre>' ;
echo '</fieldset>' ;
}
// Izvedemo upload paketa pdf-jev
public function executeManualUpload ( $zip_name , $fak_id , $report_type , $reports_id , $unzip ){
global $global_user_id ;
global $site_url ;
// Razpakiramo zip
if ( $unzip ){
$zip = new ZipArchive ;
$res = $zip -> open ( 'modules/Evalvacija/pdf/' . $zip_name . '.zip' , ZIPARCHIVE :: CREATE );
if ( $res === TRUE ) {
$zip -> extractTo ( 'modules/Evalvacija/pdf/unzipped/' );
$zip -> close ();
}
else {
echo 'Napaka pri unzippu paketa!' ;
echo die ();
}
}
// Dobimo vse podatke o fakulteti
$sqlFakulteta = sisplet_query ( " SELECT * FROM eval_fakulteta WHERE id=' " . $fak_id . " ' " );
$rowFakulteta = mysqli_fetch_array ( $sqlFakulteta );
// Kratica fakultete za šport je v GC drugačna (še stara)
$rowFakulteta [ 'kratica' ] = ( $fak_id == '3000022' ) ? 'FSP' : $rowFakulteta [ 'kratica' ];
// Ustvarimo ustrezno zadevo in izvedemo ustrezen upload
// IZVAJALCI - zadeva IZVAJALEC
if ( $report_type == '1_1' ){
$reports = glob ( $this -> pdf_path . '*' );
// Loop po vseh poročilih
foreach ( $reports as $report ){
if ( is_file ( $report )){
$info_array = explode ( " _ " , basename ( $report , " .pdf " ));
//var_dump($info_array);die();
// Dobimo vse podatke o izvajalcu
$izv_id = $info_array [ 1 ];
$sqlIzvajalec = sisplet_query ( " SELECT * FROM eval_izvajalec " . $this -> izvajalec_table . " WHERE idpedagoga=' " . $fak_id . " _ " . $rowFakulteta [ 'kratica' ] . " _ " . $izv_id . " ' AND fakulteta=' " . $fak_id . " ' " );
// Za PEF je treba dodat se UL - PEFUL
//$sqlIzvajalec = sisplet_query("SELECT * FROM eval_izvajalec".$this->izvajalec_table." WHERE idpedagoga='".$fak_id."_".$rowFakulteta['kratica']."UL_".$izv_id."' AND fakulteta='".$fak_id."'");
if ( mysqli_num_rows ( $sqlIzvajalec ) > 0 ){
// Ce gre za povzetek
if ( $info_array [ 3 ] == 'povzetek' ){
$rowIzvajalec = mysqli_fetch_array ( $sqlIzvajalec );
echo 'Upload POVZETKA za izvajalca - ' . $fak_id . " _ " . $rowFakulteta [ 'kratica' ] . " _ " . $izv_id . ' (' . $rowIzvajalec [ 'ime_pedagoga' ] . ')...<br />' ;
//var_dump($rowIzvajalec);
// Ustvarimo zadevo
$return = $this -> createFolderIzvajalec ( $izv_id , $rowIzvajalec [ 'ime_pedagoga' ], $fak_id , $rowFakulteta [ 'kratica' ]);
// Ustvarimo dokument in pripnemo porocilo
$return2 = $this -> createDocumentIzvajalecPovzetek (
$zadeva_id = 'RezultatiAnket_' . $fak_id . '_' . $izv_id ,
$filename = basename ( $report ),
$filedate = date ( 'd.m.y' ),
$izv_id ,
$rowIzvajalec [ 'ime_pedagoga' ],
$fak_id ,
$rowFakulteta [ 'kratica' ],
$reports_id
);
}
else {
$rowIzvajalec = mysqli_fetch_array ( $sqlIzvajalec );
echo 'Upload za izvajalca - ' . $fak_id . " _ " . $rowFakulteta [ 'kratica' ] . " _ " . $izv_id . ' (' . $rowIzvajalec [ 'ime_pedagoga' ] . ')...<br />' ;
//var_dump($rowIzvajalec);
// Ustvarimo zadevo
$return = $this -> createFolderIzvajalec ( $izv_id , $rowIzvajalec [ 'ime_pedagoga' ], $fak_id , $rowFakulteta [ 'kratica' ]);
// Ustvarimo dokument in pripnemo porocilo
$return2 = $this -> createDocumentIzvajalec (
$zadeva_id = 'RezultatiAnket_' . $fak_id . '_' . $izv_id ,
$filename = basename ( $report ),
$filedate = date ( 'd.m.y' ),
$izv_id ,
$rowIzvajalec [ 'ime_pedagoga' ],
$fak_id ,
$rowFakulteta [ 'kratica' ],
$reports_id
);
}
// Zakljucimo dokument
$return3 = $this -> closeDocument ( $return2 , $rowFakulteta [ 'kratica' ]);
var_dump ( $return );
var_dump ( $return2 );
var_dump ( $return3 );
error_log ( 'Dokoncan upload za izvajalca - ' . $fak_id . " _ " . $rowFakulteta [ 'kratica' ] . " _ " . $izv_id . ' (' . $rowIzvajalec [ 'ime_pedagoga' ] . ')' );
}
else {
echo 'Napaka! Izvajalca ' . $izv_id . ' ni v bazi!<br />' ;
error_log ( 'Napaka! Izvajalca ' . $izv_id . ' ni v bazi!' );
}
}
else {
echo 'Napaka! Poročilo ne obstaja!<br />' ;
}
echo '<br /><br />' ;
}
}
// TRENDI - zadeva IZVAJALEC
elseif ( $report_type == '1_2' ){
$reports = glob ( $this -> pdf_path . '*' );
// Loop po vseh poročilih
foreach ( $reports as $report ){
if ( is_file ( $report )){
$info_array = explode ( " _ " , basename ( $report , " .pdf " ));
//var_dump($info_array);
// Dobimo vse podatke o izvajalcu
//$izv_id = $info_array[2];
$izv_id = $info_array [ 1 ];
$sqlIzvajalec = sisplet_query ( " SELECT * FROM eval_izvajalec " . $this -> izvajalec_table . " WHERE idpedagoga=' " . $fak_id . " _ " . $rowFakulteta [ 'kratica' ] . " _ " . $izv_id . " ' AND fakulteta=' " . $fak_id . " ' " );
// Za PEF je treba dodat se UL - PEFUL
//$sqlIzvajalec = sisplet_query("SELECT * FROM eval_izvajalec".$this->izvajalec_table." WHERE idpedagoga='".$fak_id."_".$rowFakulteta['kratica']."UL_".$izv_id."' AND fakulteta='".$fak_id."'");
if ( mysqli_num_rows ( $sqlIzvajalec ) > 0 ){
$rowIzvajalec = mysqli_fetch_array ( $sqlIzvajalec );
echo 'Upload za izvajalca - TRENDI - ' . $fak_id . " _ " . $rowFakulteta [ 'kratica' ] . " _ " . $izv_id . ' (' . $rowIzvajalec [ 'ime_pedagoga' ] . ')...<br />' ;
//var_dump($rowIzvajalec);
// Ustvarimo zadevo
$return = $this -> createFolderIzvajalec ( $izv_id , $rowIzvajalec [ 'ime_pedagoga' ], $fak_id , $rowFakulteta [ 'kratica' ]);
// Ustvarimo dokument in pripnemo porocilo
$return2 = $this -> createDocumentTrendi (
$zadeva_id = 'RezultatiAnket_' . $fak_id . '_' . $izv_id ,
$filename = basename ( $report ),
$filedate = date ( 'd.m.y' ),
$izv_id ,
$rowIzvajalec [ 'ime_pedagoga' ],
$fak_id ,
$rowFakulteta [ 'kratica' ],
$reports_id
);
// Zakljucimo dokument
$return3 = $this -> closeDocument ( $return2 , $rowFakulteta [ 'kratica' ]);
var_dump ( $return );
var_dump ( $return2 );
var_dump ( $return3 );
error_log ( 'Dokoncan upload za izvajalca - TRENDI - ' . $fak_id . " _ " . $rowFakulteta [ 'kratica' ] . " _ " . $izv_id . ' (' . $rowIzvajalec [ 'ime_pedagoga' ] . ')' );
}
else {
echo 'Napaka! Izvajalca ' . $izv_id . ' ni v bazi!<br />' ;
error_log ( 'Napaka! Izvajalca ' . $izv_id . ' ni v bazi!' );
}
}
else {
echo 'Napaka! Poročilo ne obstaja!<br />' ;
}
echo '<br /><br />' ;
}
}
// FAKULTETA - zadeva VODSTVO
elseif ( $report_type == '2_1' ){
// Ustvarimo zadevo
$return = $this -> createFolderVodstvo ( $fak_id , $rowFakulteta [ 'kratica' ]);
$reports = glob ( $this -> pdf_path . '*' );
// Loop po vseh poročilih
foreach ( $reports as $report ){
if ( is_file ( $report )){
// Ustvarimo dokument in pripnemo porocilo
$return2 = $this -> createDocumentFakulteta (
$zadeva_id = 'RezultatiAnket_' . $fak_id . '_' . $this -> year ,
$filename = basename ( $report ),
$filedate = date ( 'd.m.Y' ),
$fak_id ,
$rowFakulteta [ 'kratica' ],
$reports_id
);
// Zakljucimo dokument
$return3 = $this -> closeDocument ( $return2 , $rowFakulteta [ 'kratica' ]);
var_dump ( $return );
var_dump ( $return2 );
var_dump ( $return3 );
}
else {
echo 'Napaka! Poročilo ne obstaja!<br />' ;
}
}
}
// PROGRAMI - zadeva VODSTVO
elseif ( $report_type == '2_2' ){
// Ustvarimo zadevo
$return = $this -> createFolderVodstvo ( $fak_id , $rowFakulteta [ 'kratica' ]);
$reports = glob ( $this -> pdf_path . '*' );
// Loop po vseh poročilih
foreach ( $reports as $report ){
if ( is_file ( $report )){
$info_array = explode ( " _ " , basename ( $report , " .pdf " ));
//var_dump($info_array);
// Dobimo vse podatke o izvajalcu
$program_id = $info_array [ 1 ];
$sqlProgram = sisplet_query ( " SELECT * FROM eval_program WHERE id=' " . $program_id . " ' " );
$rowProgram = mysqli_fetch_array ( $sqlProgram );
// Zgradimo ime programa (iz stopnje in imena) - da je enolično
if ( $rowProgram [ 'stopnja' ] == '2' )
$stopnja = 'druga' ;
elseif ( $rowProgram [ 'stopnja' ] == '3' )
$stopnja = 'tretja' ;
else
$stopnja = 'prva' ;
$program_ime = $stopnja . ', ' . $rowProgram [ 'program' ];
// Ustvarimo dokument in pripnemo porocilo
$return2 = $this -> createDocumentProgram (
$zadeva_id = 'RezultatiAnket_' . $fak_id . '_' . $this -> year ,
$filename = basename ( $report ),
$filedate = date ( 'd.m.Y' ),
$program_id ,
$program_ime ,
$fak_id ,
$rowFakulteta [ 'kratica' ],
$reports_id
);
// Zakljucimo dokument
$return3 = $this -> closeDocument ( $return2 , $rowFakulteta [ 'kratica' ]);
var_dump ( $return );
var_dump ( $return2 );
var_dump ( $return3 );
}
else {
echo 'Napaka! Poročilo ne obstaja!<br />' ;
}
}
}
// PRAKSA - zadeva VODSTVO
elseif ( $report_type == '2_3' ){
// Ustvarimo zadevo
$return = $this -> createFolderVodstvo ( $fak_id , $rowFakulteta [ 'kratica' ]);
$reports = glob ( $this -> pdf_path . '*' );
// Loop po vseh poročilih
foreach ( $reports as $report ){
if ( is_file ( $report )){
// Ustvarimo dokument in pripnemo porocilo
$return2 = $this -> createDocumentPraksa (
$zadeva_id = 'RezultatiAnket_' . $fak_id . '_' . $this -> year ,
$filename = basename ( $report ),
$filedate = date ( 'd.m.Y' ),
$fak_id ,
$rowFakulteta [ 'kratica' ],
$reports_id
);
// Zakljucimo dokument
$return3 = $this -> closeDocument ( $return2 , $rowFakulteta [ 'kratica' ]);
var_dump ( $return );
var_dump ( $return2 );
var_dump ( $return3 );
}
else {
echo 'Napaka! Poročilo ne obstaja!<br />' ;
}
}
}
// SPLOSNO ZADOVOLJSTVO - zadeva VODSTVO
elseif ( $report_type == '2_4' ){
// Ustvarimo zadevo
$return = $this -> createFolderVodstvo ( $fak_id , $rowFakulteta [ 'kratica' ]);
$reports = glob ( $this -> pdf_path . '*' );
// Loop po vseh poročilih
foreach ( $reports as $report ){
if ( is_file ( $report )){
// Ustvarimo dokument in pripnemo porocilo
$return2 = $this -> createDocumentSplosna (
$zadeva_id = 'RezultatiAnket_' . $fak_id . '_' . $this -> year ,
$filename = basename ( $report ),
$filedate = date ( 'd.m.Y' ),
$fak_id ,
$rowFakulteta [ 'kratica' ],
$reports_id
);
// Zakljucimo dokument
$return3 = $this -> closeDocument ( $return2 , $rowFakulteta [ 'kratica' ]);
var_dump ( $return );
var_dump ( $return2 );
var_dump ( $return3 );
}
else {
echo 'Napaka! Poročilo ne obstaja!<br />' ;
}
}
}
// KATEDRA - zadeva VODSTVO
elseif ( $report_type == '2_5' ){
// Ustvarimo zadevo
$return = $this -> createFolderVodstvo ( $fak_id , $rowFakulteta [ 'kratica' ]);
$reports = glob ( $this -> pdf_path . '*' );
// Loop po vseh poročilih
foreach ( $reports as $report ){
if ( is_file ( $report )){
// Ustvarimo dokument in pripnemo porocilo
$return2 = $this -> createDocumentKatedra (
$zadeva_id = 'RezultatiAnket_' . $fak_id . '_' . $this -> year ,
$filename = basename ( $report ),
$filedate = date ( 'd.m.Y' ),
$fak_id ,
$rowFakulteta [ 'kratica' ],
$reports_id
);
// Zakljucimo dokument
$return3 = $this -> closeDocument ( $return2 , $rowFakulteta [ 'kratica' ]);
var_dump ( $return );
var_dump ( $return2 );
var_dump ( $return3 );
}
else {
echo 'Napaka! Poročilo ne obstaja!<br />' ;
}
}
}
// EXCEL - zadeva VODSTVO
elseif ( $report_type == '2_6' ){
// Ustvarimo zadevo
$return = $this -> createFolderVodstvo ( $fak_id , $rowFakulteta [ 'kratica' ]);
$reports = glob ( $this -> pdf_path . '*' );
// Loop po vseh poročilih
foreach ( $reports as $report ){
if ( is_file ( $report )){
// Ustvarimo dokument in pripnemo porocilo
$return2 = $this -> createDocumentExcel (
$zadeva_id = 'RezultatiAnket_' . $fak_id . '_' . $this -> year ,
$filename = basename ( $report ),
$filedate = date ( 'd.m.Y' ),
$fak_id ,
$rowFakulteta [ 'kratica' ],
$reports_id
);
// Zakljucimo dokument
$return3 = $this -> closeDocument ( $return2 , $rowFakulteta [ 'kratica' ]);
var_dump ( $return );
var_dump ( $return2 );
var_dump ( $return3 );
}
else {
echo 'Napaka! Poročilo ne obstaja!<br />' ;
}
}
}
// DOKTORSKI ŠTUDIJ - zadeva VODSTVO
elseif ( $report_type == '2_7' ){
// Ustvarimo zadevo
$return = $this -> createFolderVodstvo ( $fak_id , $rowFakulteta [ 'kratica' ]);
$reports = glob ( $this -> pdf_path . '*' );
// Loop po vseh poročilih
foreach ( $reports as $report ){
if ( is_file ( $report )){
// Ustvarimo dokument in pripnemo porocilo
$return2 = $this -> createDocumentDoktorska (
$zadeva_id = 'RezultatiAnket_' . $fak_id . '_' . $this -> year ,
$filename = basename ( $report ),
$filedate = date ( 'd.m.Y' ),
$fak_id ,
$rowFakulteta [ 'kratica' ],
$reports_id
);
// Zakljucimo dokument
$return3 = $this -> closeDocument ( $return2 , $rowFakulteta [ 'kratica' ]);
var_dump ( $return );
var_dump ( $return2 );
var_dump ( $return3 );
}
else {
echo 'Napaka! Poročilo ne obstaja!<br />' ;
}
}
}
// HABILITACIJSKA POROCILA - zadeva HABILITACIJA
elseif ( $report_type == '3_1' ){
$reports = glob ( $this -> pdf_path . '*' );
// Ali kreiramo folder (dovolj je samo prvic v letu)
$create_folder = true ;
// Loop po vseh poročilih
foreach ( $reports as $report ){
if ( is_file ( $report )){
$info_array = explode ( " _ " , basename ( $report , " .pdf " ));
//var_dump($info_array);
// Dobimo vse podatke o izvajalcu
$izv_id = $info_array [ 1 ];
$sqlIzvajalec = sisplet_query ( " SELECT * FROM eval_izvajalec " . $this -> izvajalec_table . " WHERE idpedagoga=' " . $fak_id . " _ " . $rowFakulteta [ 'kratica' ] . " _ " . $izv_id . " ' AND fakulteta=' " . $fak_id . " ' " );
// Za PEF je treba dodat se UL - PEFUL
//$sqlIzvajalec = sisplet_query("SELECT * FROM eval_izvajalec".$this->izvajalec_table." WHERE idpedagoga='".$fak_id."_".$rowFakulteta['kratica']."UL_".$izv_id."' AND fakulteta='".$fak_id."'");
if ( mysqli_num_rows ( $sqlIzvajalec ) > 0 ){
$rowIzvajalec = mysqli_fetch_array ( $sqlIzvajalec );
echo 'Upload za izvajalca - HABILITACIJA - ' . $fak_id . " _ " . $rowFakulteta [ 'kratica' ] . " _ " . $izv_id . ' (' . $rowIzvajalec [ 'ime_pedagoga' ] . ')...<br />' ;
//var_dump($rowIzvajalec);
// Ustvarimo zadevo
if ( $create_folder )
$return = $this -> createFolderHabilitacija ( $fak_id , $rowFakulteta [ 'kratica' ]);
// Ustvarimo dokument in pripnemo porocilo
$return2 = $this -> createDocumentHabilitacija (
$zadeva_id = 'RezultatiAnket_habilitacija_' . $fak_id . '_' . $this -> year ,
$filename = basename ( $report ),
$filedate = date ( 'd.m.y' ),
$izv_id ,
$rowIzvajalec [ 'ime_pedagoga' ],
$fak_id ,
$rowFakulteta [ 'kratica' ],
$reports_id
);
// Zakljucimo dokument
$return3 = $this -> closeDocument ( $return2 , $rowFakulteta [ 'kratica' ]);
if ( $create_folder )
var_dump ( $return );
var_dump ( $return2 );
var_dump ( $return3 );
error_log ( 'Dokoncan upload za izvajalca - HABILITACIJA - ' . $fak_id . '_' . $rowFakulteta [ 'kratica' ] . '_' . $izv_id . ' (' . $rowIzvajalec [ 'ime_pedagoga' ] . ')' );
//sleep(10);
}
else {
echo 'Napaka! Izvajalca ' . $izv_id . ' ni v bazi!<br />' ;
error_log ( 'Napaka! Izvajalca ' . $izv_id . ' ni v bazi!' );
}
}
else {
echo 'Napaka! Poročilo ne obstaja!<br />' ;
}
echo '<br /><br />' ;
}
}
// PREDMETI - zadeva PREDMETI
elseif ( $report_type == '4_1' ){
$reports = glob ( $this -> pdf_path . '*' );
// Loop po vseh poročilih
foreach ( $reports as $report ){
if ( is_file ( $report )){
$info_array = explode ( " _ " , basename ( $report , " .pdf " ));
//var_dump($info_array);
// Dobimo vse podatke o predmetu
$predmet_id = $info_array [ 1 ];
$nacin_studija = $info_array [ 2 ];
$sqlPredmet = sisplet_query ( " SELECT * FROM eval_izvajalec " . $this -> izvajalec_table . " WHERE idp=' " . $predmet_id . " ' AND nacin_studija=' " . $nacin_studija . " ' AND fakulteta=' " . $fak_id . " ' " );
if ( mysqli_num_rows ( $sqlPredmet ) > 0 ){
$rowPredmet = mysqli_fetch_array ( $sqlPredmet );
echo 'Upload za predmet - ' . $fak_id . " _ " . $rowFakulteta [ 'kratica' ] . " _ " . $predmet_id . ' (' . $rowPredmet [ 'predmet' ] . ' ' . ( $nacin_studija == '2' ? '(izredni)' : '(redni)' ) . ' )...<br />' ;
//var_dump($rowPredmet);
// Ustvarimo zadevo
$return = $this -> createFolderPredmeti ( $fak_id , $rowFakulteta [ 'kratica' ]);
// Ustvarimo dokument in pripnemo porocilo
$return2 = $this -> createDocumentPredmet (
$zadeva_id = 'RezultatiAnket_predmeti_' . $fak_id . '_' . $this -> year ,
$filename = basename ( $report ),
$filedate = date ( 'd.m.y' ),
$predmet_id . '_' . $nacin_studija ,
$rowPredmet [ 'predmet' ],
$nacin_studija ,
$fak_id ,
$rowFakulteta [ 'kratica' ],
$reports_id
);
// Zakljucimo dokument
$return3 = $this -> closeDocument ( $return2 , $rowFakulteta [ 'kratica' ]);
var_dump ( $return );
var_dump ( $return2 );
var_dump ( $return3 );
error_log ( 'Dokoncan upload za predmet - ' . $fak_id . " _ " . $rowFakulteta [ 'kratica' ] . " _ " . $predmet_id . ' (' . $rowPredmet [ 'predmet' ] . ' ' . ( $nacin_studija == '2' ? '(izredni)' : '(redni)' ) . ' )' );
}
else {
echo 'Napaka! Predmeta ' . $predmet_id . ' ni v bazi!<br />' ;
error_log ( 'Napaka! Predmeta ' . $predmet_id . ' ni v bazi!' );
}
}
else {
echo 'Napaka! Poročilo ne obstaja!<br />' ;
}
echo '<br /><br />' ;
}
}
}
// Ustvari zadevo v GC za izvajalca
public function createFolderIzvajalec ( $izv_id , $izv_ime , $fak_id , $fak_kratica ){
// Nastavimo podatke
$backendID = 'RezultatiAnket_' . $fak_id . '_' . $izv_id ;
$title = 'Rezultati anket - ' . $izv_ime ;
$description = 'Rezultati anket za izvajalca/nosilca - ' . $izv_ime . ' - ' . $fak_kratica ;
// we set folder data
$folderData = array (
'Title' => $title ,
'Description' => $description ,
'ClassificationCode' => '724' ,
'StorageUntil' => '5' ,
'BackendId' => $backendID ,
'Responsible' => 'AS_' . $fak_kratica ,
//'BackupResponsibleList' => array('SignirniZnak1', 'SignirniZnak2'),
//'Shourtcut' => 'HitraOznakaZaUvrščanje',
'OrganizationId' => $fak_kratica
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> CreateFolder ( array ( 'folderData' => $folderData , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
var_dump ( $e );
//echo '<pre>' . print_r(get_defined_vars(), true) . '</pre>';
}
return $backendID ;
}
// Ustvari zadevo v GC za vodstvo
public function createFolderVodstvo ( $fak_id , $fak_kratica ){
// Nastavimo podatke
$backendID = 'RezultatiAnket_' . $fak_id . '_' . $this -> year ;
$title = 'Rezultati anket za vodstvo – ' . str_replace ( '_' , '/' , $this -> year );
$description = 'Rezultati anket za vodstvo in organe članice - ' . $fak_kratica . ' - ' . str_replace ( '_' , '/' , $this -> year );
// we set folder data
$folderData = array (
'Title' => $title ,
'Description' => $description ,
'ClassificationCode' => '724' ,
'StorageUntil' => 'A' ,
'BackendId' => $backendID ,
'Responsible' => 'AS_' . $fak_kratica . '_VODSTVO' ,
//'BackupResponsibleList' => array('SignirniZnak1', 'SignirniZnak2'),
//'Shourtcut' => 'HitraOznakaZaUvrščanje',
'OrganizationId' => $fak_kratica
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> CreateFolder ( array ( 'folderData' => $folderData , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
var_dump ( $e );
//echo '<pre>' . print_r(get_defined_vars(), true) . '</pre>';
}
return $backendID ;
}
// Ustvari zadevo v GC za vodstvo - habilitacijska poročila
public function createFolderHabilitacija ( $fak_id , $fak_kratica ){
// Nastavimo podatke
$backendID = 'RezultatiAnket_habilitacija_' . $fak_id . '_' . $this -> year ;
$title = 'Rezultati anket – habilitacijska poročila - ' . str_replace ( '_' , '/' , $this -> year );
$description = 'Rezultati anket za habilitacijsko komisijo - ' . $fak_kratica . ' - ' . str_replace ( '_' , '/' , $this -> year );
// we set folder data
$folderData = array (
'Title' => $title ,
'Description' => $description ,
'ClassificationCode' => '724' ,
'StorageUntil' => 'A' ,
'BackendId' => $backendID ,
'Responsible' => 'AS_' . $fak_kratica . '_VODSTVO' ,
//'BackupResponsibleList' => array('SignirniZnak1', 'SignirniZnak2'),
//'Shourtcut' => 'HitraOznakaZaUvrščanje',
'OrganizationId' => $fak_kratica
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> CreateFolder ( array ( 'folderData' => $folderData , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
var_dump ( $e );
//echo '<pre>' . print_r(get_defined_vars(), true) . '</pre>';
}
return $backendID ;
}
// Ustvari zadevo v GC za vodstvo - predmeti
public function createFolderPredmeti ( $fak_id , $fak_kratica ){
// Nastavimo podatke
$backendID = 'RezultatiAnket_predmeti_' . $fak_id . '_' . $this -> year ;
$title = 'Rezultati anket – predmeti - ' . str_replace ( '_' , '/' , $this -> year );
$description = 'Rezultati anket po predmetih - ' . $fak_kratica . ' - ' . str_replace ( '_' , '/' , $this -> year );
// we set folder data
$folderData = array (
'Title' => $title ,
'Description' => $description ,
'ClassificationCode' => '724' ,
'StorageUntil' => 'A' ,
'BackendId' => $backendID ,
'Responsible' => 'AS_' . $fak_kratica . '_VODSTVO' ,
//'BackupResponsibleList' => array('SignirniZnak1', 'SignirniZnak2'),
//'Shourtcut' => 'HitraOznakaZaUvrščanje',
'OrganizationId' => $fak_kratica
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> CreateFolder ( array ( 'folderData' => $folderData , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
var_dump ( $e );
//echo '<pre>' . print_r(get_defined_vars(), true) . '</pre>';
}
return $backendID ;
}
// Ustvari nov dokument v zadevi in pripne ustrezen pdf za izvajalca
public function createDocumentIzvajalec ( $zadeva_id , $filename , $filedate , $izv_id , $izv_ime , $fak_id , $fak_kratica , $package_id ){
// Pripravimo pdf za upload
$fh = fopen ( $this -> pdf_path . $filename , " r " );
$str = '' ;
while ( ! feof ( $fh )){
$str .= fread ( $fh , 1024 );
}
/* ob_clean ();
flush (); */
fclose ( $fh );
$file = $str ;
// Nastavimo podatke
$backendID = 'RezultatiAnket_' . $fak_id . '_' . $izv_id . '_' . $this -> year . '_' . $package_id ;
$date = date ( 'c' , strtotime ( $filedate ));
$title = 'Rezultati anket – ' . $izv_ime . ' – ' . str_replace ( '_' , '/' , $this -> year );
$documentData = array (
'GcId' => 0 ,
'BackendId' => $backendID ,
'DocumentDate' => $date ,
'DocumentTitle' => $title ,
//'DocumentType' => '277e8662-5d21-4461-8211-52fb9600b318',
'DocumentType' => '67fb602c-da50-448f-92bc-43d326c1817d' ,
'DocumentSubType' => 'a32856de-b1d2-4dd7-a3fd-ba279d75bdb6' ,
'MainContent' => array (
'Content' => $file ,
'FileName' => $filename
),
'Responsible' => 'AS_' . $fak_kratica ,
//'ReturnWebServiceUrl' => 'http://cypher/IntegrationUL/Services/GcService.asmx',
'SubjectId' => '' ,
'FolderId' => array (
'GcId' => null ,
//'ClassificationId' => '',
'OrganizationId' => $fak_kratica ,
'BackendIdData' => array (
'ItemId' => $zadeva_id ,
'SystemId' => '1ka'
)
),
'OrganizationId' => $fak_kratica
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> CreateDocument ( array ( 'documentData' => $documentData , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
var_dump ( $e );
//echo '<pre>' . print_r(get_defined_vars(), true) . '</pre>';
}
return $backendID ;
}
// Ustvari nov dokument v zadevi in pripne ustrezen pdf za izvajalca
public function createDocumentIzvajalecPovzetek ( $zadeva_id , $filename , $filedate , $izv_id , $izv_ime , $fak_id , $fak_kratica , $package_id ){
// Pripravimo pdf za upload
$fh = fopen ( $this -> pdf_path . $filename , " r " );
$str = '' ;
while ( ! feof ( $fh )){
$str .= fread ( $fh , 1024 );
}
/* ob_clean ();
flush (); */
fclose ( $fh );
$file = $str ;
// Nastavimo podatke
$backendID = 'RezultatiAnket_' . $fak_id . '_' . $izv_id . '_povzetek_' . $this -> year . '_' . $package_id ;
$date = date ( 'c' , strtotime ( $filedate ));
$title = 'Rezultati anket – ' . $izv_ime . ' - povzetek – ' . str_replace ( '_' , '/' , $this -> year );
$documentData = array (
'GcId' => 0 ,
'BackendId' => $backendID ,
'DocumentDate' => $date ,
'DocumentTitle' => $title ,
//'DocumentType' => '277e8662-5d21-4461-8211-52fb9600b318',
'DocumentType' => '67fb602c-da50-448f-92bc-43d326c1817d' ,
'DocumentSubType' => 'a32856de-b1d2-4dd7-a3fd-ba279d75bdb6' ,
'MainContent' => array (
'Content' => $file ,
'FileName' => $filename
),
'Responsible' => 'AS_' . $fak_kratica ,
//'ReturnWebServiceUrl' => 'http://cypher/IntegrationUL/Services/GcService.asmx',
'SubjectId' => '' ,
'FolderId' => array (
'GcId' => null ,
//'ClassificationId' => '',
'OrganizationId' => $fak_kratica ,
'BackendIdData' => array (
'ItemId' => $zadeva_id ,
'SystemId' => '1ka'
)
),
'OrganizationId' => $fak_kratica
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> CreateDocument ( array ( 'documentData' => $documentData , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
var_dump ( $e );
//echo '<pre>' . print_r(get_defined_vars(), true) . '</pre>';
}
return $backendID ;
}
// Ustvari nov dokument v zadevi in pripne ustrezen pdf za izvajalca (TRENDI)
public function createDocumentTrendi ( $zadeva_id , $filename , $filedate , $izv_id , $izv_ime , $fak_id , $fak_kratica , $package_id ){
// Pripravimo pdf za upload
$fh = fopen ( $this -> pdf_path . $filename , " r " );
$str = '' ;
while ( ! feof ( $fh )){
$str .= fread ( $fh , 1024 );
}
/* ob_clean ();
flush (); */
fclose ( $fh );
$file = $str ;
// Nastavimo podatke
$backendID = 'RezultatiAnket_trendi_' . $fak_id . '_' . $izv_id . '_' . $this -> year . '_' . $package_id ;
$date = date ( 'c' , strtotime ( $filedate ));
$title = 'Rezultati anket – trendi - ' . $izv_ime . ' – ' . str_replace ( '_' , '/' , $this -> year );
$documentData = array (
'GcId' => 0 ,
'BackendId' => $backendID ,
'DocumentDate' => $date ,
'DocumentTitle' => $title ,
//'DocumentType' => '277e8662-5d21-4461-8211-52fb9600b318',
'DocumentType' => '67fb602c-da50-448f-92bc-43d326c1817d' ,
'DocumentSubType' => '1c28d5d5-3537-4d1f-80af-e96f03a903c7' ,
'MainContent' => array (
'Content' => $file ,
'FileName' => $filename
),
'Responsible' => 'AS_' . $fak_kratica ,
//'ReturnWebServiceUrl' => 'http://cypher/IntegrationUL/Services/GcService.asmx',
'SubjectId' => '' ,
'FolderId' => array (
'GcId' => null ,
//'ClassificationId' => '',
'OrganizationId' => $fak_kratica ,
'BackendIdData' => array (
'ItemId' => $zadeva_id ,
'SystemId' => '1ka'
)
),
'OrganizationId' => $fak_kratica
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> CreateDocument ( array ( 'documentData' => $documentData , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
var_dump ( $e );
//echo '<pre>' . print_r(get_defined_vars(), true) . '</pre>';
}
return $backendID ;
}
// Ustvari nov dokument v zadevi in pripne ustrezen pdf za program
public function createDocumentProgram ( $zadeva_id , $filename , $filedate , $program_id , $program_ime , $fak_id , $fak_kratica , $package_id ){
// Pripravimo pdf za upload
$fh = fopen ( $this -> pdf_path . $filename , " r " );
$str = '' ;
while ( ! feof ( $fh )){
$str .= fread ( $fh , 1024 );
}
/* ob_clean ();
flush (); */
fclose ( $fh );
$file = $str ;
// Nastavimo podatke
$backendID = 'RezultatiAnket_' . $program_id . '_' . $this -> year . '_' . $package_id ;
date ( 'c' , strtotime ( $filedate ));
$title = 'Rezultati anket - ' . $program_ime . ' – ' . str_replace ( '_' , '/' , $this -> year );
$documentData = array (
// document attachments
/* 'Attachments' => array (
array (
'Content' => fread ( $file , filesize ( $this -> pdf_path . $filename )),
'FileName' => $filename
)
), */
//'BackendId' => substr($filename, 0, -4).'_'.$filedate,
'GcId' => 0 ,
'BackendId' => $backendID ,
'DocumentDate' => $date ,
'DocumentTitle' => $title ,
//'DocumentType' => '277e8662-5d21-4461-8211-52fb9600b318',
'DocumentType' => '67fb602c-da50-448f-92bc-43d326c1817d' ,
'DocumentSubType' => '095bd968-d0f3-4f32-956e-79653db35150' ,
'MainContent' => array (
'Content' => $file ,
'FileName' => $filename
),
'Responsible' => 'AS_' . $fak_kratica . '_VODSTVO' ,
//'ReturnWebServiceUrl' => 'http://cypher/IntegrationUL/Services/GcService.asmx',
'SubjectId' => '' ,
'FolderId' => array (
'GcId' => null ,
//'ClassificationId' => '',
'OrganizationId' => $fak_kratica ,
'BackendIdData' => array (
'ItemId' => $zadeva_id ,
'SystemId' => '1ka'
)
),
'OrganizationId' => $fak_kratica
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> CreateDocument ( array ( 'documentData' => $documentData , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
var_dump ( $e );
//echo '<pre>' . print_r(get_defined_vars(), true) . '</pre>';
}
return $backendID ;
}
// Ustvari nov dokument v zadevi in pripne ustrezen pdf za fakulteto
public function createDocumentFakulteta ( $zadeva_id , $filename , $filedate , $fak_id , $fak_kratica , $package_id ){
// Pripravimo pdf za upload
$fh = fopen ( $this -> pdf_path . $filename , " r " );
$str = '' ;
while ( ! feof ( $fh )){
$str .= fread ( $fh , 1024 );
}
/* ob_clean ();
flush (); */
fclose ( $fh );
$file = $str ;
// Nastavimo podatke
$backendID = 'RezultatiAnket_' . $fak_id . '_' . $this -> year . '_' . $package_id ;
date ( 'c' , strtotime ( $filedate ));
$title = 'Rezultati anket – ' . $fak_kratica . ' – ' . str_replace ( '_' , '/' , $this -> year );
$documentData = array (
// document attachments
/* 'Attachments' => array (
array (
'Content' => fread ( $file , filesize ( $this -> pdf_path . $filename )),
'FileName' => $filename
)
), */
//'BackendId' => substr($filename, 0, -4).'_'.$filedate,
'GcId' => 0 ,
'BackendId' => $backendID ,
'DocumentDate' => $date ,
'DocumentTitle' => $title ,
//'DocumentType' => '277e8662-5d21-4461-8211-52fb9600b318',
'DocumentType' => '67fb602c-da50-448f-92bc-43d326c1817d' ,
'DocumentSubType' => '18512cb6-f626-4c04-aab0-9ed2ed54babd' ,
'MainContent' => array (
'Content' => $file ,
'FileName' => $filename
),
'Responsible' => 'AS_' . $fak_kratica . '_VODSTVO' ,
//'ReturnWebServiceUrl' => 'http://cypher/IntegrationUL/Services/GcService.asmx',
'SubjectId' => '' ,
'FolderId' => array (
'GcId' => null ,
//'ClassificationId' => '',
'OrganizationId' => $fak_kratica ,
'BackendIdData' => array (
'ItemId' => $zadeva_id ,
'SystemId' => '1ka'
)
),
'OrganizationId' => $fak_kratica
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> CreateDocument ( array ( 'documentData' => $documentData , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
//var_dump($e);
echo '<pre>' . print_r ( get_defined_vars (), true ) . '</pre>' ;
}
return $backendID ;
}
// Ustvari nov dokument v zadevi in pripne ustrezen pdf za prakso
public function createDocumentPraksa ( $zadeva_id , $filename , $filedate , $fak_id , $fak_kratica , $package_id ){
// Pripravimo pdf za upload
$fh = fopen ( $this -> pdf_path . $filename , " r " );
$str = '' ;
while ( ! feof ( $fh )){
$str .= fread ( $fh , 1024 );
}
/* ob_clean ();
flush (); */
fclose ( $fh );
$file = $str ;
// Nastavimo podatke
$backendID = 'RezultatiAnket_praksa_' . $fak_id . '_' . $this -> year . '_' . $package_id ;
date ( 'c' , strtotime ( $filedate ));
$title = 'Rezultati anket – praksa - ' . $fak_kratica . ' – ' . str_replace ( '_' , '/' , $this -> year );
$documentData = array (
'GcId' => 0 ,
'BackendId' => $backendID ,
'DocumentDate' => $date ,
'DocumentTitle' => $title ,
'DocumentType' => '67fb602c-da50-448f-92bc-43d326c1817d' ,
'DocumentSubType' => '38cc004c-faac-4657-b827-b204d22e313e' ,
'MainContent' => array (
'Content' => $file ,
'FileName' => $filename
),
'Responsible' => 'AS_' . $fak_kratica . '_VODSTVO' ,
'SubjectId' => '' ,
'FolderId' => array (
'GcId' => null ,
//'ClassificationId' => '',
'OrganizationId' => $fak_kratica ,
'BackendIdData' => array (
'ItemId' => $zadeva_id ,
'SystemId' => '1ka'
)
),
'OrganizationId' => $fak_kratica
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> CreateDocument ( array ( 'documentData' => $documentData , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
//var_dump($e);
echo '<pre>' . print_r ( get_defined_vars (), true ) . '</pre>' ;
}
return $backendID ;
}
// Ustvari nov dokument v zadevi in pripne ustrezen pdf za splosno anketo o zadovoljstvu
public function createDocumentSplosna ( $zadeva_id , $filename , $filedate , $fak_id , $fak_kratica , $package_id ){
// Pripravimo pdf za upload
$fh = fopen ( $this -> pdf_path . $filename , " r " );
$str = '' ;
while ( ! feof ( $fh )){
$str .= fread ( $fh , 8192 );
}
fclose ( $fh );
$file = $str ;
// Nastavimo podatke
$backendID = 'RezultatiAnket_splosnoZadovoljstvo_' . $fak_id . '_' . $this -> year . '_' . $package_id ;
date ( 'c' , strtotime ( $filedate ));
$title = 'Rezultati anket – splošno zadovoljstvo - ' . $fak_kratica . ' – ' . str_replace ( '_' , '/' , $this -> year );
$documentData = array (
'GcId' => 0 ,
'BackendId' => $backendID ,
'DocumentDate' => $date ,
'DocumentTitle' => $title ,
'DocumentType' => '67fb602c-da50-448f-92bc-43d326c1817d' ,
'DocumentSubType' => 'be0bd3f3-3a9b-40cd-a268-10ed3638760c' ,
'MainContent' => array (
'Content' => $file ,
'FileName' => $filename
),
'Responsible' => 'AS_' . $fak_kratica . '_VODSTVO' ,
'SubjectId' => '' ,
'FolderId' => array (
'GcId' => null ,
//'ClassificationId' => '',
'OrganizationId' => $fak_kratica ,
'BackendIdData' => array (
'ItemId' => $zadeva_id ,
'SystemId' => '1ka'
)
),
'OrganizationId' => $fak_kratica
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> CreateDocument ( array ( 'documentData' => $documentData , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
//var_dump($e);
echo '<pre>' . print_r ( get_defined_vars (), true ) . '</pre>' ;
}
return $backendID ;
}
// Ustvari nov dokument v zadevi in pripne ustrezen pdf za katedro
public function createDocumentKatedra ( $zadeva_id , $filename , $filedate , $fak_id , $fak_kratica , $package_id ){
// Nastavimo ime in kratico katedre
$ime_katedre = '' ;
$kratica_katedre = '' ;
// Pripravimo pdf za upload
$fh = fopen ( $this -> pdf_path . $filename , " r " );
$str = '' ;
while ( ! feof ( $fh )){
$str .= fread ( $fh , 8192 );
}
fclose ( $fh );
$file = $str ;
// Nastavimo podatke
$backendID = 'RezultatiAnket_katedra_' . $kratica_katedre . '_' . $this -> year . '_' . $package_id ;
date ( 'c' , strtotime ( $filedate ));
$title = 'Rezultati anket – katedra - ' . $ime_katedre . ' – ' . str_replace ( '_' , '/' , $this -> year );
$documentData = array (
'GcId' => 0 ,
'BackendId' => $backendID ,
'DocumentDate' => $date ,
'DocumentTitle' => $title ,
'DocumentType' => '67fb602c-da50-448f-92bc-43d326c1817d' ,
'DocumentSubType' => 'dc27121d-700d-41ff-8fe4-12d38591bb9a' ,
'MainContent' => array (
'Content' => $file ,
'FileName' => $filename
),
'Responsible' => 'AS_' . $fak_kratica . '_VODSTVO' ,
'SubjectId' => '' ,
'FolderId' => array (
'GcId' => null ,
//'ClassificationId' => '',
'OrganizationId' => $fak_kratica ,
'BackendIdData' => array (
'ItemId' => $zadeva_id ,
'SystemId' => '1ka'
)
),
'OrganizationId' => $fak_kratica
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
// Ce nismo nastavili imena in kratice katedre ne pustimo nalaganja
if ( $ime_katedre == '' || $kratica_katedre == '' ){
echo 'Napaka! Katedra ni nastavljena!' ;
}
else {
try {
$result = $this -> soapClient -> CreateDocument ( array ( 'documentData' => $documentData , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
//var_dump($e);
echo '<pre>' . print_r ( get_defined_vars (), true ) . '</pre>' ;
}
}
return $backendID ;
}
// Ustvari nov dokument v zadevi in pripne ustrezen xls za anketo pred in po
public function createDocumentExcel ( $zadeva_id , $filename , $filedate , $fak_id , $fak_kratica , $package_id ){
// Pripravimo pdf za upload
$fh = fopen ( $this -> pdf_path . $filename , " r " );
$str = '' ;
while ( ! feof ( $fh )){
$str .= fread ( $fh , 1024 );
}
fclose ( $fh );
$file = $str ;
// Nastavimo podatke
$backendID = 'RezultatiAnket_excel_' . $fak_id . '_' . $this -> year . '_' . $package_id ;
date ( 'c' , strtotime ( $filedate ));
$title = 'Rezultati anket - excel rezultati - ' . $fak_kratica . ' - ' . str_replace ( '_' , '/' , $this -> year );
$documentData = array (
'GcId' => 0 ,
'BackendId' => $backendID ,
'DocumentDate' => $date ,
'DocumentTitle' => $title ,
'DocumentType' => '67fb602c-da50-448f-92bc-43d326c1817d' ,
'DocumentSubType' => '600bb813-c8cb-4ca3-bf88-3740ccfa5ab9' ,
'MainContent' => array (
'Content' => $file ,
'FileName' => $filename
),
'Responsible' => 'AS_' . $fak_kratica . '_VODSTVO' ,
'SubjectId' => '' ,
'FolderId' => array (
'GcId' => null ,
//'ClassificationId' => '',
'OrganizationId' => $fak_kratica ,
'BackendIdData' => array (
'ItemId' => $zadeva_id ,
'SystemId' => '1ka'
)
),
'OrganizationId' => $fak_kratica
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> CreateDocument ( array ( 'documentData' => $documentData , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
//var_dump($e);
echo '<pre>' . print_r ( get_defined_vars (), true ) . '</pre>' ;
}
return $backendID ;
}
// Ustvari nov dokument v zadevi in pripne ustrezen pdf za doktorsko anketo
public function createDocumentDoktorska ( $zadeva_id , $filename , $filedate , $fak_id , $fak_kratica , $package_id ){
// Pripravimo pdf za upload
$fh = fopen ( $this -> pdf_path . $filename , " r " );
$str = '' ;
while ( ! feof ( $fh )){
$str .= fread ( $fh , 8192 );
}
fclose ( $fh );
$file = $str ;
// Nastavimo podatke
2021-11-11 12:24:39 +01:00
$backendID = 'RezultatiAnket_doktorskiStudij_' . $fak_id . '_' . $this -> year . '_' . $package_id ;
2020-08-14 13:36:36 +02:00
date ( 'c' , strtotime ( $filedate ));
2021-11-11 12:24:39 +01:00
$title = 'Rezultati anket – doktorski študij - ' . $fak_kratica . ' – ' . str_replace ( '_' , '/' , $this -> year );
2020-08-14 13:36:36 +02:00
$documentData = array (
'GcId' => 0 ,
'BackendId' => $backendID ,
'DocumentDate' => $date ,
'DocumentTitle' => $title ,
'DocumentType' => '67fb602c-da50-448f-92bc-43d326c1817d' ,
'DocumentSubType' => '01d8a96b-f5a2-481a-8a06-a50cc4a93ac9' ,
'MainContent' => array (
'Content' => $file ,
'FileName' => $filename
),
'Responsible' => 'AS_' . $fak_kratica . '_VODSTVO' ,
'SubjectId' => '' ,
'FolderId' => array (
'GcId' => null ,
//'ClassificationId' => '',
'OrganizationId' => $fak_kratica ,
'BackendIdData' => array (
'ItemId' => $zadeva_id ,
'SystemId' => '1ka'
)
),
'OrganizationId' => $fak_kratica
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> CreateDocument ( array ( 'documentData' => $documentData , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
//var_dump($e);
echo '<pre>' . print_r ( get_defined_vars (), true ) . '</pre>' ;
}
return $backendID ;
}
// Ustvari nov dokument v zadevi in pripne ustrezen pdf za izvajalca (Habilitacija)
public function createDocumentHabilitacija ( $zadeva_id , $filename , $filedate , $izv_id , $izv_ime , $fak_id , $fak_kratica , $package_id ){
// Pripravimo pdf za upload
$fh = fopen ( $this -> pdf_path . $filename , " r " );
$str = '' ;
while ( ! feof ( $fh )){
$str .= fread ( $fh , 1024 );
}
fclose ( $fh );
$file = $str ;
// Nastavimo podatke
$backendID = 'RezultatiAnket_habilitacija_' . $fak_id . '_' . $izv_id . '_' . $this -> year . '_' . $package_id ;
$date = date ( 'c' , strtotime ( $filedate ));
$title = 'Rezultati anket – habilitacijsko poročilo - ' . $izv_ime . ' – ' . str_replace ( '_' , '/' , $this -> year );
$documentData = array (
'GcId' => 0 ,
'BackendId' => $backendID ,
'DocumentDate' => $date ,
'DocumentTitle' => $title ,
//'DocumentType' => '277e8662-5d21-4461-8211-52fb9600b318',
'DocumentType' => '67fb602c-da50-448f-92bc-43d326c1817d' ,
'DocumentSubType' => '666acaf7-bfe8-4992-bb62-dd6611c84f58' ,
'MainContent' => array (
'Content' => $file ,
'FileName' => $filename
),
'Responsible' => 'AS_' . $fak_kratica . '_VODSTVO' ,
//'ReturnWebServiceUrl' => 'http://cypher/IntegrationUL/Services/GcService.asmx',
'SubjectId' => '' ,
'FolderId' => array (
'GcId' => null ,
//'ClassificationId' => '',
'OrganizationId' => $fak_kratica ,
'BackendIdData' => array (
'ItemId' => $zadeva_id ,
'SystemId' => '1ka'
)
),
'OrganizationId' => $fak_kratica
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> CreateDocument ( array ( 'documentData' => $documentData , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
var_dump ( $e );
//echo '<pre>' . print_r(get_defined_vars(), true) . '</pre>';
}
return $backendID ;
}
// Ustvari nov dokument v zadevi in pripne ustrezen pdf za predmet
public function createDocumentPredmet ( $zadeva_id , $filename , $filedate , $predmet_id , $predmet_ime , $nacin_studija , $fak_id , $fak_kratica , $package_id ){
// Pripravimo pdf za upload
$fh = fopen ( $this -> pdf_path . $filename , " r " );
$str = '' ;
while ( ! feof ( $fh )){
$str .= fread ( $fh , 1024 );
}
fclose ( $fh );
$file = $str ;
// Nastavimo podatke
$backendID = 'RezultatiAnket_predmet_' . $fak_id . '_' . $predmet_id . '_' . $this -> year . '_' . $package_id ;
$date = date ( 'c' , strtotime ( $filedate ));
$title = 'Rezultati anket – predmet - ' . $predmet_ime . ' ' . ( $nacin_studija == '2' ? '(izredni)' : '(redni)' ) . ' – ' . str_replace ( '_' , '/' , $this -> year );
$documentData = array (
'GcId' => 0 ,
'BackendId' => $backendID ,
'DocumentDate' => $date ,
'DocumentTitle' => $title ,
//'DocumentType' => '277e8662-5d21-4461-8211-52fb9600b318',
'DocumentType' => '67fb602c-da50-448f-92bc-43d326c1817d' ,
'DocumentSubType' => '243378fe-531d-4d81-895e-61b1ac31646a' ,
'MainContent' => array (
'Content' => $file ,
'FileName' => $filename
),
'Responsible' => 'AS_' . $fak_kratica . '_VODSTVO' ,
//'ReturnWebServiceUrl' => 'http://cypher/IntegrationUL/Services/GcService.asmx',
'SubjectId' => '' ,
'FolderId' => array (
'GcId' => null ,
//'ClassificationId' => '',
'OrganizationId' => $fak_kratica ,
'BackendIdData' => array (
'ItemId' => $zadeva_id ,
'SystemId' => '1ka'
)
),
'OrganizationId' => $fak_kratica
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> CreateDocument ( array ( 'documentData' => $documentData , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
var_dump ( $e );
//echo '<pre>' . print_r(get_defined_vars(), true) . '</pre>';
}
return $backendID ;
}
// Zakljuci dokument po ustvarjanju
public function closeDocument ( $document_id , $fak_kratica ){
$documentAction = array (
'GcId' => null ,
//'ClassificationId' => '',
'OrganizationId' => $fak_kratica ,
'BackendIdData' => array (
'ItemId' => $document_id ,
'SystemId' => '1ka'
),
'ActionList' => array ( 'http://www.marg.si/xmlns/BusinessConnect/doc/eArhiv/Osnutek/action/VPripraviZakljuci' )
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> DoActionOnDocument ( array ( 'doActionOnDocumentData' => $documentAction , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
var_dump ( $e );
echo '<pre>' . print_r ( get_defined_vars (), true ) . '</pre>' ;
}
return $result ;
}
// Prebere seznam vseh dokumentov v zadevi
public function readFolder ( $zadeva_id , $fak_kratica ){
$folderRequest = array (
'GcId' => null ,
//'ClassificationId' => '',
'OrganizationId' => $fak_kratica ,
'BackendIdData' => array (
'ItemId' => $zadeva_id ,
'SystemId' => '1ka'
)
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> ReadFolder ( array ( 'requestFolderData' => $folderRequest , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
var_dump ( $e );
echo '<pre>' . print_r ( get_defined_vars (), true ) . '</pre>' ;
}
return $result ;
}
// Pobrise dokument iz zadeve - V DELU
public function deleteFolder ( $doc_id , $fak_kratica ){
$documentRequest = array (
'ActionList' => array (
'http://www.marg.si/xmlns/BusinessConnect/doc/eArhiv/Osnutek/action/ZakljucenReaktiviraj' ,
'http://www.marg.si/xmlns/BusinessConnect/doc/eArhiv/Osnutek/action/Delete'
),
'GcId' => null ,
//'ClassificationId' => '',
'OrganizationId' => $fak_kratica ,
'BackendIdData' => array (
'ItemId' => $doc_id ,
'SystemId' => '1ka'
)
);
// we set system data
$sysData = array (
'SystemId' => '1ka'
);
try {
$result = $this -> soapClient -> DoActionOnDocument ( array ( 'doActionOnDocumentData' => $documentRequest , 'backendSystemData' => $sysData ));
}
catch ( Exception $e ){
var_dump ( $e );
echo '<pre>' . print_r ( get_defined_vars (), true ) . '</pre>' ;
}
return $result ;
}
}