', "\n";
+echo '
', "\n";
$sql = "SELECT d.docid, d.doctype, d.title "
. "FROM docref AS r INNER JOIN document AS d using (docid) "
@@ -468,13 +479,19 @@ $res = $sth->fetchAll();
$doccount = 0;
foreach ($res as $row) {
$doccount += 1;
+ echo '
';
if ($row['doctype'] == 'picture') {
echo '
';
// echo '
';
- echo '
';
+ echo '
';
echo "\n";
+ // additionally direct download and go to document details page
+ echo '
';
+ echo '
';
+ echo '
';
+ echo '
';
} elseif ($row['doctype'] == 'drawing') {
- echo "
Drawing: ", $row['title'], "
";
+ echo "
Drawing:
", $row['title'], "
";
echo '';
echo '
';
echo "";
@@ -485,7 +502,7 @@ foreach ($res as $row) {
// echo $row['title'];
echo "\n";
} elseif ($row['doctype'] == 'manual') {
- echo "
Manual: ";
+ echo "
Manual:
";
echo '';
echo $row['title'];
echo "
\n";
@@ -493,6 +510,7 @@ foreach ($res as $row) {
// unknown document type
echo "
Unknown document type:", $row['doctype'], "\n";
}
+ echo "
\n";
}
if ($doccount == 0) {
echo _('No referenced documents'), "\n";
@@ -581,6 +599,24 @@ if ($sth->rowCount() > 0) {
echo '
', _('No spare parts found.'), "
\n";
}
+
+// Document preview
+?>
+
+ ':' . $value, $pk);
+ $fields = array_diff_key($params, array_flip($pkparams));
+ $where = join(' AND ', array_map(fn($s) => "$s=:$s", $pk));
+ }
+ } else {
+ $fields = $params;
+ unset($fields[':'.$pk]);
+ $where = "$pk=:$pk";
+ }
+ $fieldlist = join(',', array_map(fn($s) => ltrim($s, ':') . '=' . $s, array_keys($fields)));
+ $sql = "UPDATE $table SET $fieldlist WHERE $where";
$sth = $pdo->prepare($sql);
try {
$sth->execute($params);
@@ -503,6 +520,7 @@ function db_load_enum($table, $column, $lookup=false, $as_dict=false, $check_nul
// if lookup is true the name lookup and translaton is applied
// if as_dict is true the enum value is returned as the array key
// if check_null is true the nullable-check is applied and returned
+ // works also for set datatype
global $pdo;
$sql = "SELECT TRIM(TRAILING ')' FROM SUBSTRING(column_type,6)), is_nullable "
. "FROM information_schema.columns "
@@ -903,6 +921,7 @@ function form_create_checks($fieldname, $label, $optlist, $selected) {
echo "
\n";
}
+// TODO DEPRECATED for touch multiple adjacent buttuns are not well suited.
function form_action_buttons($script, $id) {
echo "
";
echo '', "\n";
@@ -980,7 +999,7 @@ function filter_create_select($fieldname, $label, $optlist, $selval=NULL, $multi
} */
echo '', "\n";
echo ' ', "\n";
- echo '
|