mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-03 03:49:29 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -12,18 +12,21 @@ class DmsLib
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci =& get_instance();
|
||||
|
||||
|
||||
$this->ci->load->model('crm/Akte_model', 'AkteModel');
|
||||
$this->ci->load->model('content/Dms_model', 'DmsModel');
|
||||
$this->ci->load->model('content/DmsVersion_model', 'DmsVersionModel');
|
||||
$this->ci->load->model('content/DmsFS_model', 'DmsFSModel');
|
||||
|
||||
|
||||
// Loads helper message to manage returning messages
|
||||
$this->ci->load->helper('message');
|
||||
}
|
||||
|
||||
/**
|
||||
* read
|
||||
* Read a DMS Document from the Filesystem
|
||||
* @param int $dms_id ID of the Document.
|
||||
* @param int $version The version of the Document (latest if null).
|
||||
* @return object success or error
|
||||
*/
|
||||
public function read($dms_id, $version = null)
|
||||
{
|
||||
@@ -44,7 +47,7 @@ class DmsLib
|
||||
$result = $this->ci->DmsModel->loadWhere(array('dms_id' => $dms_id, 'version' => $version));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$resultFS = $this->ci->DmsFSModel->read($result->retval[0]->filename);
|
||||
@@ -57,20 +60,26 @@ class DmsLib
|
||||
$result = $resultFS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getAktenAcceptedDms
|
||||
* Get all accepted Documents of a Person
|
||||
*
|
||||
* @param int $person_id ID of the person.
|
||||
* @param string $dokument_kurzbz Type of document.
|
||||
* @param bool $no_file If null then loads also the content.
|
||||
* @return object success or error
|
||||
*/
|
||||
public function getAktenAcceptedDms($person_id, $dokument_kurzbz = null, $no_file = null)
|
||||
{
|
||||
$result = $this->ci->AkteModel->getAktenAcceptedDms($person_id, $dokument_kurzbz);
|
||||
|
||||
|
||||
if (hasData($result) && $no_file == null)
|
||||
{
|
||||
for ($i = 0; $i < count($result->retval); $i++)
|
||||
$cnt = count($result->retval);
|
||||
for ($i = 0; $i < $cnt; $i++)
|
||||
{
|
||||
$resultFS = $this->ci->DmsFSModel->read($result->retval[$i]->filename);
|
||||
if (isSuccess($resultFS))
|
||||
@@ -83,12 +92,14 @@ class DmsLib
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* save
|
||||
* Saves a Document
|
||||
* @param object $dms DMS Object ot be saved.
|
||||
* @return object
|
||||
*/
|
||||
public function save($dms)
|
||||
{
|
||||
@@ -142,30 +153,34 @@ class DmsLib
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* delete
|
||||
* Deletes a Akte of a Person
|
||||
* @param int $person_id ID of the person.
|
||||
* @param int $dms_id Id of the Document.
|
||||
* @return object
|
||||
*/
|
||||
public function delete($person_id, $dms_id)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
|
||||
// If the parameters are valid
|
||||
if (is_numeric($person_id) && is_numeric($dms_id))
|
||||
{
|
||||
// Start DB transaction
|
||||
$this->ci->db->trans_start(false);
|
||||
|
||||
|
||||
// Get akte_id from table tbl_akte
|
||||
$result = $this->ci->AkteModel->loadWhere(array('person_id' => $person_id, 'dms_id' => $dms_id));
|
||||
if (isSuccess($result))
|
||||
{
|
||||
// Delete all entries in tbl_akte
|
||||
for ($i = 0; $i < count($result->retval); $i++)
|
||||
$cnt = count($result->retval);
|
||||
for ($i = 0; $i < $cnt; $i++)
|
||||
{
|
||||
$this->ci->AkteModel->delete($result->retval[$i]->akte_id);
|
||||
}
|
||||
|
||||
|
||||
// Get all filenames related to this dms
|
||||
$resultFileNames = $this->ci->DmsVersionModel->loadWhere(array('dms_id' => $dms_id));
|
||||
if (isSuccess($resultFileNames))
|
||||
@@ -179,10 +194,10 @@ class DmsLib
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Transaction complete!
|
||||
$this->ci->db->trans_complete();
|
||||
|
||||
|
||||
// Check if everything went ok during the transaction
|
||||
if ($this->ci->db->trans_status() === false || isError($result))
|
||||
{
|
||||
@@ -194,12 +209,13 @@ class DmsLib
|
||||
$this->ci->db->trans_commit();
|
||||
$result = success('Dms successfully removed from DB');
|
||||
}
|
||||
|
||||
|
||||
// If everything is ok
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$cnt = count($resultFileNames->retval);
|
||||
// Remove all files related to this person and dms
|
||||
for ($i = 0; $i < count($resultFileNames->retval); $i++)
|
||||
for ($i = 0; $i < $cnt; $i++)
|
||||
{
|
||||
$this->ci->DmsFSModel->remove($resultFileNames->retval[$i]->filename);
|
||||
}
|
||||
@@ -209,17 +225,52 @@ class DmsLib
|
||||
{
|
||||
$result = error('Invalid parameters');
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* _saveFileOnInsert
|
||||
* Loads the Content of an akte
|
||||
* @param int $akte_id Id of the akte.
|
||||
* @return object with document content or error
|
||||
*/
|
||||
public function getAkteContent($akte_id)
|
||||
{
|
||||
$akte = $this->ci->AkteModel->load($akte_id);
|
||||
if (hasData($akte))
|
||||
{
|
||||
if ($akte->retval[0]->inhalt != '')
|
||||
{
|
||||
return success(base64_decode($akte->retval[0]->inhalt));
|
||||
}
|
||||
elseif ($akte->retval[0]->dms_id != '')
|
||||
{
|
||||
$dmscontent = $this->read($akte->retval[0]->dms_id);
|
||||
if (isSuccess($dmscontent))
|
||||
{
|
||||
return success(base64_decode($dmscontent->retval[0]->file_content));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return error('No Content available');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return error($akte->retval);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the Content of a DMS in the Filesystem
|
||||
* @param object $dms DMS object to be saved.
|
||||
* @return object
|
||||
*/
|
||||
private function _saveFileOnInsert($dms)
|
||||
{
|
||||
$filename = uniqid().'.'.pathinfo($dms['name'], PATHINFO_EXTENSION);
|
||||
|
||||
|
||||
$result = $this->ci->DmsFSModel->write($filename, $dms['file_content']);
|
||||
if (isSuccess($result))
|
||||
{
|
||||
@@ -230,7 +281,9 @@ class DmsLib
|
||||
}
|
||||
|
||||
/**
|
||||
* _saveFileOnUpdate
|
||||
* Updates the File in the Filesystem
|
||||
* @param object $dms DMS object to update.
|
||||
* @return object
|
||||
*/
|
||||
private function _saveFileOnUpdate($dms)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class DocumentLib
|
||||
{
|
||||
private $unoconv_version;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Gets CI instance
|
||||
$this->ci =& get_instance();
|
||||
|
||||
exec('unoconv --version', $ret_arr);
|
||||
if(isset($ret_arr[0]))
|
||||
$this->unoconv_version = explode(' ', $ret_arr[0])[1];
|
||||
else
|
||||
show_error('Unoconv not found - Please install Unoconv');
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a File to PDF
|
||||
* @param string $filename Full path to the file.
|
||||
* @return success or error object
|
||||
*/
|
||||
public function convertToPDF($filename)
|
||||
{
|
||||
if (!file_exists($filename))
|
||||
return error('Unable to Convert to PDF. File not found:'.$filename);
|
||||
|
||||
$mimetype = mime_content_type($filename);
|
||||
$outFile = sys_get_temp_dir().'/FHC_'.uniqid().'.pdf';
|
||||
|
||||
switch ($mimetype)
|
||||
{
|
||||
case 'image/jpeg':
|
||||
case 'image/jpg':
|
||||
case 'image/pjpeg':
|
||||
$this->_jpegtopdf($filename, $outFile);
|
||||
return success($outFile);
|
||||
case 'application/vnd.oasis.opendocument.spreadsheet':
|
||||
case 'application/msword':
|
||||
case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
|
||||
case 'application/haansoftdocx':
|
||||
case 'application/vnd.ms-word':
|
||||
case 'application/vnd.oasis.opendocument.text':
|
||||
case 'text/plain':
|
||||
$this->convert($filename, $outFile, 'pdf');
|
||||
return success($outFile);
|
||||
case 'application/pdf':
|
||||
return success($filename);
|
||||
default:
|
||||
return error('Unknown Mimetype:'.$mimetype);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Combines multiple single PDFs to one PDF
|
||||
*
|
||||
* @param array $files Array of Files to merge (full path to file).
|
||||
* @param string $outFile Path to the Output File.
|
||||
* @return success or error object
|
||||
*/
|
||||
public function mergePDF($files, $outFile)
|
||||
{
|
||||
$cmd = "gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$outFile ";
|
||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||
|
||||
// add all pdf files to the command
|
||||
foreach ($files as $f)
|
||||
{
|
||||
$cmd .= $f." ";
|
||||
if (!file_exists($f))
|
||||
{
|
||||
return error("File not found: '$f'");
|
||||
}
|
||||
if (finfo_file($finfo, $f) != "application/pdf")
|
||||
{
|
||||
return error("Wrong format(".finfo_file($finfo, $f)."): '$f'");
|
||||
}
|
||||
}
|
||||
|
||||
finfo_close($finfo);
|
||||
|
||||
exec($cmd, $out, $ret);
|
||||
if ($ret != 0)
|
||||
{
|
||||
return error('PDF-zusammenfuegung ist derzeit nicht möglich. Bitte informieren Sie den Administrator');
|
||||
}
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a Document to another format with unoconv
|
||||
*
|
||||
* @param string $inFile File that should be convertet.
|
||||
* @param string $outFile Name of the Output File.
|
||||
* @param string $format Outputformat (PDF, DOC, ...).
|
||||
* @return success or error Object
|
||||
*/
|
||||
public function convert($inFile, $outFile, $format)
|
||||
{
|
||||
if ($this->unoconv_version == '0.6')
|
||||
$command = 'unoconv -f %1$s %3$s > %2$s';
|
||||
else
|
||||
$command = 'unoconv -f %s --output %s %s 2>&1';
|
||||
$command = sprintf($command, $format, $outFile, $inFile);
|
||||
|
||||
exec($command, $out, $ret);
|
||||
|
||||
if ($ret != 0)
|
||||
{
|
||||
return error('Dokumentenkonvertierung ist derzeit nicht möglich. Bitte informieren Sie den Administrator');
|
||||
}
|
||||
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a JPG to PDF
|
||||
*
|
||||
* @param string $filename Path to JPG.
|
||||
* @param string $outfile Path to Output (pdf) File.
|
||||
* @return success or error object
|
||||
*/
|
||||
private function _jpegtopdf($filename, $outfile)
|
||||
{
|
||||
if (!file_exists($filename))
|
||||
return error('File does not exists');
|
||||
|
||||
$size = getimagesize($filename);
|
||||
|
||||
$margin_left_right = 18;
|
||||
$margin_bottom = 18;
|
||||
|
||||
/*
|
||||
* längere Seite ermitteln
|
||||
* Hochformat wenn die Seiten gleich lang sind oder das Bild schmäler ist als die Seitenbreite
|
||||
*/
|
||||
if ($size[0] > $size[1] && $size[0] > 595)
|
||||
{
|
||||
$page_height = 595;
|
||||
$page_width = 842;
|
||||
//Wenn Bild kleiner oder gleich Seitenbreite, dann margin erhoehen
|
||||
if ($size[0] <= $page_width)
|
||||
{
|
||||
$margin_left_right = ($page_width - $size[0]) / 2;
|
||||
$margin_bottom = ($page_height - $size[1]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$page_height = 842;
|
||||
$page_width = 595;
|
||||
//Wenn Bild kleiner oder gleich Seitenbreite, dann margin erhoehen
|
||||
if ($size[0] <= $page_width)
|
||||
{
|
||||
$margin_left_right = ($page_width - $size[0]) / 2;
|
||||
$margin_bottom = ($page_height - $size[1]);
|
||||
}
|
||||
}
|
||||
|
||||
// -r300 = 300 ppi
|
||||
$cmd = 'gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -r100 ';
|
||||
$cmd .= '-o '.$outfile.' viewjpeg.ps -c "('.$filename.') ';
|
||||
$cmd .= '<< /PageSize ['.$page_width.' '.$page_height.'] ';
|
||||
$cmd .= '/.HWMargins ['.$margin_left_right.' '.$margin_bottom.' '.$margin_left_right.' 18] ';
|
||||
$cmd .= '/countspaces { [ exch { dup 32 ne { pop } if } forall ] length } bind def >> ';
|
||||
$cmd .= 'setpagedevice viewJPEG"';
|
||||
|
||||
exec($cmd, $out, $ret);
|
||||
if ($ret != 0)
|
||||
{
|
||||
$this->errormsg = 'jpegToPdf ist derzeit nicht möglich. Bitte informieren Sie den Administrator';
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Regular → Executable
+46
-28
@@ -26,12 +26,12 @@ require_once('../../../include/phrasen.class.php');
|
||||
require_once('../../../include/person.class.php');
|
||||
|
||||
$user = get_uid();
|
||||
$sprache = getSprache();
|
||||
$sprache = getSprache();
|
||||
$p=new phrasen($sprache);
|
||||
|
||||
//$rechte = new benutzerberechtigung();
|
||||
//$rechte->getBerechtigungen($user);
|
||||
|
||||
|
||||
//if(!$rechte->isBerechtigt('basis/service'))
|
||||
// die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
@@ -42,7 +42,7 @@ echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<head>
|
||||
<title>'.$p->t("services/service").'</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../skin/tablesort.css" type="text/css"/>
|
||||
<link rel="stylesheet" href="../../../skin/style.css.php" type="text/css">
|
||||
<link rel="stylesheet" type="text/css" href="../../../skin/jquery-ui-1.9.2.custom.min.css">
|
||||
@@ -50,20 +50,36 @@ echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<script type="text/javascript" src="../../../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/components/jqueryui/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="../../../include/js/jquery.ui.datepicker.translation.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/jquery/sizzle/sizzle.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/jquery/sizzle/sizzle.js"></script>';
|
||||
|
||||
// Load Addons to get Moodle_Path
|
||||
$addon_obj = new addon();
|
||||
if ($addon_obj->loadAddons())
|
||||
{
|
||||
if (count($addon_obj->result) > 0)
|
||||
{
|
||||
foreach ($addon_obj->result as $row)
|
||||
{
|
||||
if (file_exists('../../../addons/'.$row->kurzbz.'/config.inc.php'))
|
||||
include_once('../../../addons/'.$row->kurzbz.'/config.inc.php');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#myTable").tablesorter(
|
||||
{
|
||||
sortList: [[0,0],[1,0]],
|
||||
widgets: [\'zebra\']
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
function ContentPopUp (Adresse)
|
||||
|
||||
function ContentPopUp (Adresse)
|
||||
{
|
||||
Content = window.open(Adresse, "Content", "width=800,height=500,scrollbars=yes");
|
||||
Content.focus();
|
||||
@@ -82,28 +98,29 @@ echo '<SELECT name="oe_kurzbz">
|
||||
<OPTION value="">-- '.$p->t("global/alle").' --</OPTION>';
|
||||
|
||||
$oe = new organisationseinheit();
|
||||
//$oe->getAll();
|
||||
$oe->loadArray($oe->getChilds('Infrastruktur'),'bezeichnung');
|
||||
$oe->getAll();
|
||||
//$oe->loadArray($oe->getChilds('Infrastruktur'),'bezeichnung');
|
||||
foreach($oe->result as $row)
|
||||
{
|
||||
if($row->oe_kurzbz==$oe_kurzbz)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
echo '<OPTION value="'.$row->oe_kurzbz.'" '.$selected.'>'.$row->organisationseinheittyp_kurzbz.' '.$row->bezeichnung.'</OPTION>';
|
||||
$serv_tmp = new service();
|
||||
if($serv_tmp->getServicesOrganisationseinheit($row->oe_kurzbz, true))
|
||||
{
|
||||
if (! empty($serv_tmp->result))
|
||||
echo '<OPTION value="'.$row->oe_kurzbz.'" '.$selected.'>'.$row->organisationseinheittyp_kurzbz.' '.$row->bezeichnung.'</OPTION>';
|
||||
}
|
||||
}
|
||||
echo '</SELECT>
|
||||
<input type="submit" value="'.$p->t("services/filtern").'" />
|
||||
</form>';
|
||||
|
||||
|
||||
if($oe_kurzbz!='')
|
||||
{
|
||||
// Wenn der OE keine Services zugeteilt sind, dann die Services der untergeordneten OE laden
|
||||
if($service->getServicesOrganisationseinheit($oe_kurzbz, true))
|
||||
if (empty($service->result))
|
||||
if(!$service->getSubServicesOrganisationseinheit($oe_kurzbz,'oe_kurzbz,bezeichnung',true))
|
||||
die($service->errormsg);
|
||||
$service->getServicesOrganisationseinheit($oe_kurzbz);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -117,8 +134,6 @@ echo '<table class="tablesorter" id="myTable">
|
||||
<th>'.$p->t("global/bezeichnung").'</th>
|
||||
<th>'.$p->t("services/leistung").'</th>
|
||||
<th>'.$p->t("services/design").'</th>
|
||||
<th>'.$p->t("services/betrieb").'</th>
|
||||
<th>'.$p->t("services/operativ").'</th>
|
||||
<th>'.$p->t("services/details").'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -126,7 +141,7 @@ echo '<table class="tablesorter" id="myTable">
|
||||
|
||||
foreach($service->result as $row)
|
||||
{
|
||||
if ($row->content_id!='')
|
||||
if ($row->content_id != '' || $row->ext_id != '')
|
||||
{
|
||||
$person = new person();
|
||||
$person->getPersonFromBenutzer($row->design_uid);
|
||||
@@ -139,12 +154,15 @@ foreach($service->result as $row)
|
||||
$operativ = $person->nachname.' '.$person->vorname;
|
||||
echo '<tr>';
|
||||
echo '<td>',$row->oe_kurzbz,'</td>';
|
||||
echo '<td>'.($row->content_id!=''?'<a href="../../../cms/content.php?content_id='.$row->content_id.'">'.$row->bezeichnung.'</a>':$row->bezeichnung).'</td>';
|
||||
echo '<td><b>'.$row->bezeichnung.'</b></td>';
|
||||
echo '<td>',$row->beschreibung,'</td>';
|
||||
echo '<td><nobr><a href="../profile/index.php?uid='.$row->design_uid.'">',$design,'</a></nobr></td>';
|
||||
echo '<td><nobr><a href="../profile/index.php?uid='.$row->betrieb_uid.'">',$betrieb,'</a></nobr></td>';
|
||||
echo '<td><nobr><a href="../profile/index.php?uid='.$row->operativ_uid.'">',$operativ,'</a></nobr></td>';
|
||||
echo '<td>'.($row->content_id!=''?'<a href="../../../cms/content.php?content_id='.$row->content_id.'">Details</a>':'').'</td>';
|
||||
//echo '<td><nobr><a href="../profile/index.php?uid='.$row->betrieb_uid.'">',$betrieb,'</a></nobr></td>';
|
||||
//echo '<td><nobr><a href="../profile/index.php?uid='.$row->operativ_uid.'">',$operativ,'</a></nobr></td>';
|
||||
echo '<td>'.($row->content_id!=''?'<a href="../../../cms/content.php?content_id='.$row->content_id.'">Details</a>':'');
|
||||
if (defined("ADDON_MOODLE_PATH"))
|
||||
echo ' '.($row->ext_id!=''?'<a href="'.ADDON_MOODLE_PATH.'course/view.php?id='.$row->ext_id.'" target="_blank">Beschreibung</a>':'');
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
@@ -152,4 +170,4 @@ echo '</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>';
|
||||
?>
|
||||
?>
|
||||
|
||||
Regular → Executable
+5
-3
@@ -200,11 +200,11 @@ class service extends basis_db
|
||||
WHERE tbl_zeitaufzeichnung.uid=".$this->db_add_param($user)."
|
||||
$zeit
|
||||
GROUP BY tbl_service.service_id HAVING COUNT(*) > $anzahl_ereignisse
|
||||
|
||||
|
||||
UNION
|
||||
SELECT tbl_service.*, '0' AS anzahl
|
||||
FROM public.tbl_service
|
||||
|
||||
|
||||
ORDER BY count DESC,bezeichnung,oe_kurzbz";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
@@ -363,12 +363,13 @@ class service extends basis_db
|
||||
|
||||
if($new)
|
||||
{
|
||||
$qry = "BEGIN;INSERT INTO public.tbl_service (bezeichnung, beschreibung, oe_kurzbz, content_id, design_uid, betrieb_uid, operativ_uid)
|
||||
$qry = "BEGIN;INSERT INTO public.tbl_service (bezeichnung, beschreibung, oe_kurzbz, content_id, ext_id, design_uid, betrieb_uid, operativ_uid)
|
||||
VALUES(".
|
||||
$this->db_add_param($this->bezeichnung).','.
|
||||
$this->db_add_param($this->beschreibung).','.
|
||||
$this->db_add_param($this->oe_kurzbz).','.
|
||||
$this->db_add_param($this->content_id).','.
|
||||
$this->db_add_param($this->ext_id).','.
|
||||
$this->db_add_param($this->design_uid).','.
|
||||
$this->db_add_param($this->betrieb_uid).','.
|
||||
$this->db_add_param($this->operativ_uid).');';
|
||||
@@ -380,6 +381,7 @@ class service extends basis_db
|
||||
' beschreibung = '.$this->db_add_param($this->beschreibung).','.
|
||||
' oe_kurzbz = '.$this->db_add_param($this->oe_kurzbz).','.
|
||||
' content_id = '.$this->db_add_param($this->content_id).','.
|
||||
' ext_id = '.$this->db_add_param($this->ext_id).','.
|
||||
' design_uid = '.$this->db_add_param($this->design_uid).','.
|
||||
' betrieb_uid = '.$this->db_add_param($this->betrieb_uid).','.
|
||||
' operativ_uid = '.$this->db_add_param($this->operativ_uid).
|
||||
|
||||
Regular → Executable
+2
-2
@@ -4,7 +4,7 @@ $this->phrasen['services/uebersichtUeberServicesOrganisationseinheiten']='Übers
|
||||
$this->phrasen['services/details']='Details';
|
||||
$this->phrasen['services/filtern']='Filtern';
|
||||
$this->phrasen['services/leistung']='Leistung';
|
||||
$this->phrasen['services/design']='Design';
|
||||
$this->phrasen['services/design']='Verantwortlich';
|
||||
$this->phrasen['services/betrieb']='Betrieb';
|
||||
$this->phrasen['services/operativ']='Operativ';
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -403,7 +403,7 @@ if($result = @$db->db_query("SELECT 1 FROM lehre.tbl_note WHERE anmerkung = 'en'
|
||||
{
|
||||
if($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "INSERT INTO lehre.tbl_note(note, bezeichnung, anmerkung, farbe, positiv, notenwert, aktiv, lehre) VALUES(17, 'entschuldigt', 'en', NULL, TRUE, NULL, TRUE, TRUE);";
|
||||
$qry = "INSERT INTO lehre.tbl_note(bezeichnung, anmerkung, farbe, positiv, notenwert, aktiv, lehre) VALUES('entschuldigt', 'en', NULL, TRUE, NULL, TRUE, TRUE);";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>lehre.tbl_note: '.$db->db_last_error().'</strong><br>';
|
||||
@@ -417,7 +417,7 @@ if($result = @$db->db_query("SELECT 1 FROM lehre.tbl_note WHERE anmerkung = 'ue'
|
||||
{
|
||||
if($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "INSERT INTO lehre.tbl_note(note, bezeichnung, anmerkung, farbe, positiv, notenwert, aktiv, lehre) VALUES(18, 'unentschuldigt', 'ue', NULL, FALSE, NULL, TRUE, TRUE);";
|
||||
$qry = "INSERT INTO lehre.tbl_note(bezeichnung, anmerkung, farbe, positiv, notenwert, aktiv, lehre) VALUES('unentschuldigt', 'ue', NULL, FALSE, NULL, TRUE, TRUE);";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>lehre.tbl_note: '.$db->db_last_error().'</strong><br>';
|
||||
@@ -1069,15 +1069,14 @@ $tabellen=array(
|
||||
"wawi.tbl_betriebsmittelstatus" => array("betriebsmittelstatus_kurzbz","beschreibung"),
|
||||
"wawi.tbl_betriebsmitteltyp" => array("betriebsmitteltyp","beschreibung","anzahl","kaution","typ_code","mastershapename"),
|
||||
"wawi.tbl_budget" => array("geschaeftsjahr_kurzbz","kostenstelle_id","budget"),
|
||||
"wawi.tbl_zahlungstyp" => array("zahlungstyp_kurzbz","bezeichnung","reihenfolge"),
|
||||
"wawi.tbl_konto" => array("konto_id","kontonr","beschreibung","kurzbz","aktiv","person_id","insertamum","insertvon","updateamum","updatevon","ext_id","person_id","hilfe"),
|
||||
"wawi.tbl_zahlungstyp" => array("zahlungstyp_kurzbz","bezeichnung"),
|
||||
"wawi.tbl_konto" => array("konto_id","kontonr","beschreibung","kurzbz","aktiv","person_id","insertamum","insertvon","updateamum","updatevon","ext_id","person_id"),
|
||||
"wawi.tbl_konto_kostenstelle" => array("konto_id","kostenstelle_id","insertamum","insertvon"),
|
||||
"wawi.tbl_kostenstelle" => array("kostenstelle_id","oe_kurzbz","bezeichnung","kurzbz","aktiv","insertamum","insertvon","updateamum","updatevon","ext_id","kostenstelle_nr","deaktiviertvon","deaktiviertamum"),
|
||||
"wawi.tbl_bestellungtag" => array("tag","bestellung_id","insertamum","insertvon"),
|
||||
"wawi.tbl_bestelldetailtag" => array("tag","bestelldetail_id","insertamum","insertvon"),
|
||||
"wawi.tbl_projekt_bestellung" => array("projekt_kurzbz","bestellung_id","anteil"),
|
||||
"wawi.tbl_bestellung" => array("bestellung_id","besteller_uid","kostenstelle_id","konto_id","firma_id","lieferadresse","rechnungsadresse","freigegeben","bestell_nr","titel","bemerkung","liefertermin","updateamum","updatevon","insertamum","insertvon","ext_id","zahlungstyp_kurzbz","zuordnung_uid","zuordnung_raum","zuordnung","auftragsbestaetigung","auslagenersatz","iban","wird_geleast","nicht_bestellen","empfehlung_leasing"),
|
||||
"wawi.tbl_bestellung_angebot" => array("angebot_id","bestellung_id","dms_id"),
|
||||
"wawi.tbl_bestelldetail" => array("bestelldetail_id","bestellung_id","position","menge","verpackungseinheit","beschreibung","artikelnummer","preisprove","mwst","erhalten","sort","text","updateamum","updatevon","insertamum","insertvon"),
|
||||
"wawi.tbl_bestellung_bestellstatus" => array("bestellung_bestellstatus_id","bestellung_id","bestellstatus_kurzbz","uid","oe_kurzbz","datum","insertamum","insertvon","updateamum","updatevon"),
|
||||
"wawi.tbl_bestellstatus" => array("bestellstatus_kurzbz","beschreibung"),
|
||||
|
||||
Regular → Executable
+16
-14
@@ -26,7 +26,7 @@ $user = get_uid();
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
|
||||
if(!$rechte->isBerechtigt('basis/service'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
@@ -37,27 +37,27 @@ echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<head>
|
||||
<title>Service</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../skin/fhcomplete.css" type="text/css">
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">';
|
||||
|
||||
|
||||
include('../../include/meta/jquery.php');
|
||||
include('../../include/meta/jquery-tablesorter.php');
|
||||
|
||||
|
||||
echo'
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#myTable").tablesorter(
|
||||
{
|
||||
sortList: [[3,0],[2,0]],
|
||||
widgets: [\'zebra\'],
|
||||
headers: {8:{sorter:false}}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
function confdel()
|
||||
{
|
||||
return confirm("Wollen Sie diesen Eintrag wirklich löschen?");
|
||||
@@ -73,10 +73,10 @@ if(isset($_GET['action']) && $_GET['action']=='delete')
|
||||
{
|
||||
if(!$rechte->isBerechtigt('basis/service', null, 'suid'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
|
||||
if(!isset($_GET['service_id']))
|
||||
die('Fehlender Parameter ServiceID');
|
||||
|
||||
|
||||
$service = new service();
|
||||
if($service->delete($_GET['service_id']))
|
||||
echo '<span class="ok">Eintrag wurde erfolgreich gelöscht</span>';
|
||||
@@ -100,7 +100,7 @@ foreach($oe->result as $row)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
|
||||
echo '<OPTION value="'.$row->oe_kurzbz.'" '.$selected.'>'.$row->organisationseinheittyp_kurzbz.' '.$row->bezeichnung.'</OPTION>';
|
||||
}
|
||||
echo '</SELECT>
|
||||
@@ -125,6 +125,7 @@ echo '<table class="tablesorter" id="myTable">
|
||||
<th>Beschreibung</th>
|
||||
<th>Organisationseinheit</th>
|
||||
<th>Content_ID</th>
|
||||
<th>Ext_ID</th>
|
||||
<th>Design</th>
|
||||
<th>Betrieb</th>
|
||||
<th>Operativ</th>
|
||||
@@ -141,6 +142,7 @@ foreach($service->result as $row)
|
||||
echo '<td>',$row->beschreibung,'</td>';
|
||||
echo '<td>',$row->oe_kurzbz,'</td>';
|
||||
echo '<td>',$row->content_id,'</td>';
|
||||
echo '<td>',$row->ext_id,'</td>';
|
||||
echo '<td>',$row->design_uid,'</td>';
|
||||
echo '<td>',$row->betrieb_uid,'</td>';
|
||||
echo '<td>',$row->operativ_uid,'</td>';
|
||||
@@ -152,4 +154,4 @@ echo '</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>';
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user