Merge origin/ci into ci

This commit is contained in:
paolo
2016-07-29 15:37:15 +02:00
9 changed files with 1099 additions and 337 deletions
+8 -1
View File
@@ -21,6 +21,12 @@ class Migration_Reihungstest extends MigrationLib
"anmeldefrist" => array("type" => "date")
);
$this->addColumn("public", "tbl_reihungstest", $columns);
// Add arbeitsplaetze to public.tbl_ort
$columns = array(
"arbeitsplaetze" => array("type" => "integer", "null" => true)
);
$this->addColumn("public", "tbl_ort", $columns);
// Add rt_stufe and punkte to public.tbl_prestudentstatus
$columns = array(
@@ -129,7 +135,8 @@ class Migration_Reihungstest extends MigrationLib
"type" => "varchar(16)"
),
"uid" => array(
"type" => "varchar(32)"
"type" => "varchar(32)",
"null" => true
)
);
$this->createTable("public", "tbl_rt_ort", $fields);
+26 -31
View File
@@ -68,22 +68,6 @@ foreach($prestudent_ids as $pid)
if(!$prestudent->load($pid))
cleanUpAndDie($p->t('tools/studentWurdeNichtGefunden')."(".$pid.")", $tmpDir);
/*
* Deckblatt
*/
$filename = $tmpDir . "/".uniqid();
$doc = new dokument_export('Bewerberakt');
$doc->addDataArray(array('vorname' => $prestudent->vorname, 'nachname' => $prestudent->nachname),'bewerberakt');
if(!$doc->create('pdf'))
die($doc->errormsg);
// $doc->temp_filename = $filename;
$document = $doc->output(false);
$filename = $tmpDir.'/'.uniqid();
file_put_contents($filename, $document);
$doc->close();
$allDocs[] = $filename;
/*
* Get all Documents
@@ -100,31 +84,29 @@ foreach($prestudent_ids as $pid)
AND prestudent_id='.$db->db_add_param($pid, FHC_INTEGER).';
';
$preDocs = array();
$result = $db->db_query($query);
while($row = $db->db_fetch_object($result))
{
$filename = "";
if($row->dms_id != null)
if($row->inhalt != null)
{
$filename = $tmpDir . "/".uniqid();
$fileData = base64_decode($row->inhalt);
file_put_contents($filename, $fileData);
}
else if($row->dms_id != null)
{
$dms = new dms();
$dms->load($row->dms_id);
$filename = DMS_PATH . $dms->filename;
}
else if($row->inhalt != null)
{
$filename = $tmpDir . "/".uniqid();
$fileData = base64_decode($row->inhalt);
file_put_contents($filename, $fileData);
}
if($filename == "")
continue;
/*
* Determine the filetype
* and convert, if nessecary
@@ -146,18 +128,31 @@ foreach($prestudent_ids as $pid)
{
$fullFilename = $row->titel;
}
else
cleanUpAndDie("falscher typ TODO", $tmpDir);
// only filled, if the file is supported
if($fullFilename != "")
{
$allDocs[] = $fullFilename;
$preDocs[] = $fullFilename;
}
}
}
/*
* Deckblatt
*/
$filename = $tmpDir . "/".uniqid();
$doc = new dokument_export($_GET["vorlage_kurzbz"]);
$doc->addDataArray(array('vorname' => $prestudent->vorname, 'nachname' => $prestudent->nachname),"bewerberakt");
if(!$doc->create('pdf'))
die($doc->errormsg);
$filename = $tmpDir.'/'.uniqid();
file_put_contents($filename, $doc->output(false));
$doc->close();
$allDocs[] = $filename;
$allDocs = array_merge($allDocs, $preDocs);
unset($doc);
}
/*
* generate the merged PDF
+7 -5
View File
@@ -168,7 +168,7 @@ class dokument_export
$contentbuffer = $proc->transformToXml($this->xml_data);
$this->temp_folder = '/tmp/fhcunoconv-'.uniqid();
$this->temp_folder = sys_get_temp_dir().'/fhcunoconv-'.uniqid();
mkdir($this->temp_folder);
chdir($this->temp_folder);
file_put_contents('content.xml', $contentbuffer);
@@ -201,7 +201,8 @@ class dokument_export
if(!$vorlage_found)
$zipfile = DOC_ROOT.'system/vorlage_zip/'.$this->vorlage_file;
$tempname_zip = 'out.zip';
$tempname_zip = $this->temp_folder . '/out.zip';
if(!copy($zipfile, $tempname_zip))
die('copy failed');
@@ -254,8 +255,9 @@ class dokument_export
switch($this->outputformat)
{
case 'pdf':
$this->temp_filename='out.pdf';
$this->temp_filename = $this->temp_folder . '/out.pdf';
exec("unoconv -e IsSkipEmptyPages=false --stdout -f pdf $tempname_zip > ".$this->temp_filename, $out, $ret);
if($ret!=0)
{
$this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte informieren Sie den Administrator';
@@ -341,8 +343,9 @@ class dokument_export
if($this->styles_xsl!='')
unlink('styles.xml');
unlink('out.zip');
unlink($this->temp_filename);
if(file_exists("out.zip"))
unlink('out.zip');
if(count($this->images)>0)
{
@@ -406,7 +409,6 @@ class dokument_export
$command = 'unoconv --format %s --output %s %s';
$command = sprintf($command, $format, $outFile, $inFile);
exec($command, $out, $ret);
if($ret!=0)
{
+1
View File
@@ -0,0 +1 @@
/*! checkboxes.js v1.0.7 | (c) 2013, 2016 Rubens Mariuzzo | http://github.com/rmariuzzo/checkboxes.js/LICENSE */"use strict";!function(a){var b=function(a){this.$context=a};b.prototype.check=function(){this.$context.find(":checkbox").filter(":not(:disabled)").filter(":visible").prop("checked",!0)},b.prototype.uncheck=function(){this.$context.find(":checkbox:visible").filter(":not(:disabled)").prop("checked",!1)},b.prototype.toggle=function(){this.$context.find(":checkbox:visible").filter(":not(:disabled)").each(function(){var b=a(this);b.prop("checked",!b.is(":checked"))})},b.prototype.max=function(a){if(a>0){var b=this;this.$context.on("click.checkboxes.max",":checkbox",function(){b.$context.find(":checked").length===a?b.$context.find(":checkbox:not(:checked)").prop("disabled",!0):b.$context.find(":checkbox:not(:checked)").prop("disabled",!1)})}else this.$context.off("click.checkboxes.max")},b.prototype.range=function(b){if(b){var c=this;this.$context.on("click.checkboxes.range",":checkbox",function(b){var d=a(b.target);if(b.shiftKey&&c.$last){var e=c.$context.find(":checkbox:visible"),f=e.index(c.$last),g=e.index(d),h=Math.min(f,g),i=Math.max(f,g)+1;e.slice(h,i).filter(":not(:disabled)").prop("checked",d.prop("checked"))}c.$last=d})}else this.$context.off("click.checkboxes.range")};var c=a.fn.checkboxes;a.fn.checkboxes=function(c){var d=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=a(this),f=e.data("checkboxes");f||e.data("checkboxes",f=new b(e,"object"==typeof c&&c)),"string"==typeof c&&f[c]&&f[c].apply(f,d)})},a.fn.checkboxes.Constructor=b,a.fn.checkboxes.noConflict=function(){return a.fn.checkboxes=c,this};var d=function(b){var c=a(b.target),d=c.attr("href"),e=a(c.data("context")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=c.data("action");e&&f&&(c.is(":checkbox")||b.preventDefault(),e.checkboxes(f))},e=function(){a("[data-toggle^=checkboxes]").each(function(){var b=a(this),c=b.data();delete c.toggle;for(var d in c)b.checkboxes(d,c[d])})};a(document).on("click.checkboxes.data-api","[data-toggle^=checkboxes]",d),a(document).on("ready.checkboxes.data-api",e)}(window.jQuery);
+1 -1
View File
@@ -44,7 +44,7 @@ class Pdf
}
if(finfo_file($finfo, $f) != "application/pdf")
{
$this->errormsg = "Wrong format: '$f'";
$this->errormsg = "Wrong format(".finfo_file($finfo, $f)."): '$f'";
return false;
}
}
+41 -51
View File
@@ -518,6 +518,45 @@ class reihungstest extends basis_db
return false;
}
}
/**
* Liefert die Personen, die einem Ort des Reihungstests zugeteilt sind
* @param integer $rt_id ID des Reihungstests
* @param string $ort_kurzbz Ort des Reihungstests mit der ID $rt_id
* @return true wenn ok, sonst false
*/
public function getPersonReihungstestOrt($rt_id, $ort_kurzbz)
{
$qry = "SELECT
*
FROM
public.tbl_rt_person
WHERE
tbl_rt_person.rt_id=".$this->db_add_param($rt_id)."
AND tbl_rt_person.ort_kurzbz=".$this->db_add_param($ort_kurzbz);
if($result = $this->db_query($qry))
{
while($row = $this->db_fetch_object($result))
{
$obj = new stdClass();
$obj->rt_id = $row->rt_id;
$obj->person_id = $row->person_id;
$obj->anmeldedatum = $row->anmeldedatum;
$obj->teilgenommen = $this->db_parse_bool($row->teilgenommen);
$obj->ort_kurzbz = $row->ort_kurzbz;
$obj->punkte = $row->punkte;
$this->result[] = $obj;
}
return true;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
public function savePersonReihungstest()
{
@@ -573,21 +612,7 @@ class reihungstest extends basis_db
return false;
}
}
/**
* Liefert die Orte, die einem Reihungstest zugeordnet sind
* @param integer $reihungstest_id ID des Reihungstests, dessen Ort zurueckgegeben werden sollen
@@ -623,42 +648,7 @@ class reihungstest extends basis_db
return false;
}
}
/*
public function getPersonReihungstest($person_id, $rt_id)
{
$qry = "SELECT
*
FROM
public.tbl_rt_person
WHERE
tbl_rt_person.person_id=".$this->db_add_param($person_id)."
AND rt_id=".$this->db_add_param($rt_id);
if($result = $this->db_query($qry))
{
if($row = $this->db_fetch_object($result))
{
$this->rt_id = $row->rt_id;
$this->person_id = $row->person_id;
$this->anmeldedatum = $row->anmeldedatum;
$this->teilgenommen = $this->db_parse_bool($row->teilgenommen);
$this->ort_kurzbz = $row->ort_kurzbz;
$this->punkte = $row->punkte;
return true;
}
else
{
$this->errormsg = 'Eintrag nicht gefunden';
return false;
}
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}*/
/**
* Speichert eine Raumzuteilung zu einem Reihungstesttermin
* Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt
Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

File diff suppressed because it is too large Load Diff