mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 585e3a4d4a | |||
| 554d6f7670 | |||
| a04d2acb86 | |||
| de2aabf00b | |||
| 685fc69e5d |
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class FileCheckJob extends CLI_Controller
|
||||
{
|
||||
/**
|
||||
* Initialize FileCheckJob
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$this->load->model('content/Dms_model', 'DmsModel');
|
||||
$this->_checkFiles();
|
||||
$this->_checkDms();
|
||||
}
|
||||
|
||||
private function _checkDms($dmsIdCounter = 0, $totalFileCounter = 0, $nonExistentFiles = [])
|
||||
{
|
||||
$limit = 100;
|
||||
|
||||
// get dms entries
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT ON (dms_id) dms_id, vers.filename, vers.version
|
||||
FROM
|
||||
campus.tbl_dms
|
||||
LEFT JOIN campus.tbl_dms_version vers USING (dms_id)
|
||||
WHERE
|
||||
dms_id > $dmsIdCounter
|
||||
AND dms_id IN (395281, 395280)
|
||||
ORDER BY
|
||||
dms_id, vers.version DESC
|
||||
LIMIT $limit";
|
||||
|
||||
$result = $this->DmsModel->execReadOnlyQuery($qry);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
echo getError($result);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
echo "\nDMS check finished!";
|
||||
echo "\n----------------------------------";
|
||||
echo "\n$totalFileCounter files checked, ".count($nonExistentFiles)." file(s) exist in DMS, but not in file system:\n";
|
||||
echo implode("\n", $nonExistentFiles)."\n";
|
||||
return;
|
||||
}
|
||||
|
||||
$data = getData($result);
|
||||
|
||||
$dir = DMS_PATH;
|
||||
$dms_id = 0;
|
||||
|
||||
foreach ($data as $dms)
|
||||
{
|
||||
$dms_id = $dms->dms_id;
|
||||
$totalFileCounter++;
|
||||
$fullPath = $dir.$dms->filename;
|
||||
//echo "Checking dms entry with id $dms_id...\n";
|
||||
if (!file_exists($fullPath))
|
||||
{
|
||||
$nonExistentFiles[] = $fullPath;
|
||||
}
|
||||
}
|
||||
|
||||
$this->_checkDms($dms_id, $totalFileCounter, $nonExistentFiles);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
* @return object success or error
|
||||
*/
|
||||
private function _checkFiles()
|
||||
{
|
||||
$missingDms = [];
|
||||
$count = 0;
|
||||
|
||||
$dir = DMS_PATH;
|
||||
|
||||
$it = new RecursiveDirectoryIterator($dir);
|
||||
|
||||
foreach (new RecursiveIteratorIterator($it) as $file) {
|
||||
if($file->isDir()) continue;
|
||||
$filename = $file->getFilename();
|
||||
//echo "Checking $filename...\n";
|
||||
$this->DmsModel->addSelect('dms_id');
|
||||
$this->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id');
|
||||
$result = $this->DmsModel->loadWhere(['filename' => $filename]);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
echo getError($result);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
$missingDms[] = $filename;
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
|
||||
echo "\nFile system check finished!";
|
||||
echo "\n----------------------------------";
|
||||
echo "\n$count files checked, ".count($missingDms)." file(s) exist in file system, but not in database:\n";
|
||||
echo $dir.implode("\n$dir", $missingDms)."\n";
|
||||
}
|
||||
}
|
||||
@@ -417,6 +417,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller
|
||||
$notiz_id = $this->input->post('notiz_id');
|
||||
|
||||
$this->NotizModel->addSelect('campus.tbl_dms_version.*');
|
||||
$this->NotizModel->addSelect($this->NotizModel->escape(base_url('content/notizdokdownload.php?id=')) . ' || public.tbl_notiz_dokument.dms_id AS preview');
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_notiz_dokument', 'ON (public.tbl_notiz_dokument.notiz_id = public.tbl_notiz.notiz_id)');
|
||||
$this->NotizModel->addJoin('campus.tbl_dms_version', 'ON (public.tbl_notiz_dokument.dms_id = campus.tbl_dms_version.dms_id)');
|
||||
|
||||
@@ -198,7 +198,7 @@ html.fs_huge {
|
||||
}
|
||||
|
||||
.tiny-90 div.tox.tox-tinymce {
|
||||
height: 90% !important;
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
/* slim begin */
|
||||
|
||||
@@ -63,7 +63,7 @@ export default {
|
||||
const vm = this;
|
||||
tinymce.init({
|
||||
target: this.$refs.editor.$refs.input, //Important: not selector: to enable multiple import of component
|
||||
//height: 800,
|
||||
height: 700,
|
||||
//plugins: ['lists'],
|
||||
toolbar: 'styleselect | bold italic underline | alignleft aligncenter alignright alignjustify | link',
|
||||
plugins: 'link',
|
||||
@@ -345,7 +345,7 @@ export default {
|
||||
type="textarea"
|
||||
v-model="formData.body"
|
||||
name="body"
|
||||
rows="35"
|
||||
rows="75"
|
||||
cols="75"
|
||||
>
|
||||
</form-input>
|
||||
|
||||
@@ -41761,7 +41761,7 @@ array(
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'abgabetool',
|
||||
'phrase' => 'c4fehlerAktualitaetProjektarbeit ',
|
||||
'phrase' => 'c4fehlerAktualitaetProjektarbeit',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
|
||||
Reference in New Issue
Block a user