Chore: Verschiebe Git-Repository in das Hauptverzeichnis und richte .gitignore ein
This commit is contained in:
commit
96d0545193
502 files changed
+176027
No files matched your search
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
|
||||
class StandardsEinzeln
|
||||
{
|
||||
/**
|
||||
* @param mixed $id
|
||||
* @param mixed $projektid
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function load($projektid)
|
||||
{
|
||||
DbFunction::$debug = 0;
|
||||
|
||||
$arr = DbFunction::select('tx_gutachten_projektestandards', '*', ['pid' => $projektid, 'ORDER' => 'pos']);
|
||||
|
||||
if (0 == \count($arr)) {
|
||||
$arr = Standards::standards();
|
||||
|
||||
foreach ($arr as $key => $value) {
|
||||
unset($value['id']);
|
||||
unset($value['textart']);
|
||||
$value['pid'] = $projektid;
|
||||
$value_array = [];
|
||||
$value_array = $value;
|
||||
|
||||
DbFunction::secureInsert('tx_gutachten_projektestandards', $value_array);
|
||||
}
|
||||
|
||||
$arr = DbFunction::select('tx_gutachten_projektestandards', '*', ['pid' => $projektid, 'ORDER' => 'pos']);
|
||||
}
|
||||
|
||||
$sum = \count($arr);
|
||||
$value_array = [];
|
||||
foreach ($arr as $key => $value) {
|
||||
$arr[$key]['all'] = $sum;
|
||||
$arr[$key]['id'] = (int) $value['id'];
|
||||
if ($value['pos'] == 0) {
|
||||
$value_array['pos'] = $key+1;
|
||||
DbFunction::secureUpdate('tx_gutachten_projektestandards', $value_array, ['id' => $value['id']]);
|
||||
$arr[$key]['pos'] = (int) $key+1;;
|
||||
} else {
|
||||
$arr[$key]['pos'] = (int) $value['pos'];
|
||||
}
|
||||
$arr[$key]['hat_platzhalter'] = false !== strpos($value['txt'], '###') ? 1 : 0;
|
||||
$arr[$key]['neueseite'] = (int) $value['neueseite'];
|
||||
$arr[$key]['textart'] = ucwords($value['textart']);
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user