From 42df35f1a07ede1033aea8bb179c8100a6c07b12 Mon Sep 17 00:00:00 2001 From: Thomas Hooge Date: Wed, 24 Jun 2026 13:46:03 +0200 Subject: [PATCH] Webgui: ongoing development --- db/mariadb.sql | 6 +- webgui/box.php | 2 + webgui/checklist.php | 4 +- webgui/company.php | 18 +- webgui/dl.php | 27 ++- webgui/documents.php | 83 +++++---- webgui/dropdown.php | 4 +- webgui/equipment.php | 39 +++++ webgui/globals.inc | 229 ++++++++++++------------- webgui/index.php | 2 + webgui/inventory.php | 6 +- webgui/lib/fileutils.inc | 26 ++- webgui/lib/gpc.inc | 112 ++++++++++++ webgui/locale/de_DE.po | 175 +++++++++---------- webgui/locale/de_DE/LC_MESSAGES/yms.mo | Bin 19198 -> 19316 bytes webgui/logout.php | 2 +- webgui/maintenance.php | 22 ++- webgui/manual.php | 9 +- webgui/measurement.php | 4 +- webgui/note.php | 4 +- webgui/projects.php | 39 +++-- webgui/provisions.php | 2 + webgui/search.php | 4 +- webgui/storage.php | 2 + webgui/tag.php | 4 +- webgui/task.php | 4 +- 26 files changed, 536 insertions(+), 293 deletions(-) create mode 100644 webgui/lib/gpc.inc diff --git a/db/mariadb.sql b/db/mariadb.sql index ce37a13..e2c1ed0 100644 --- a/db/mariadb.sql +++ b/db/mariadb.sql @@ -134,7 +134,7 @@ CREATE TABLE equipment ( ecat tinyint(3) DEFAULT NULL, serial varchar(30), supplier smallint(6) DEFAULT NULL, - manufacturer smallint(6) DEFAULT NULL, + manufacturer smallint(6) DEFAULT NULL, // -3: original; -4: own built purchdate date DEFAULT NULL, price decimal(12,2) DEFAULT NULL, weight float(5,2) UNSIGNED DEFAULT NULL, @@ -159,9 +159,7 @@ CREATE TABLE inventory ( PRIMARY KEY (invid), INDEX ix_invname (invname) ); -/* - TODO: unit -> unit1, unit2, unit3 - */ + CREATE TABLE measurement ( mid smallint(6) NOT NULL AUTO_INCREMENT, mtype enum('generic','cable','fuse') NOT NULL default 'generic', diff --git a/webgui/box.php b/webgui/box.php index bf249ec..f2ab367 100644 --- a/webgui/box.php +++ b/webgui/box.php @@ -14,6 +14,8 @@ There can be a difference because not all items have a weight entered */ require 'globals.inc'; +require 'lib/gpc.inc'; + $pagetitle = _('Boxes'); $id = gpc_get_int($_REQUEST, 'id', 0); diff --git a/webgui/checklist.php b/webgui/checklist.php index 746d94d..9f04b7e 100644 --- a/webgui/checklist.php +++ b/webgui/checklist.php @@ -1,12 +1,14 @@ $v) { ?> -
- - -
diff --git a/webgui/dl.php b/webgui/dl.php index b1b12fd..5d5d9f6 100644 --- a/webgui/dl.php +++ b/webgui/dl.php @@ -1,7 +1,7 @@ mimetype == 'image/jpeg') { $orig = imagecreatefromjpeg($file); - $scaled = imagescale($orig, $width * $factor, $height * $factor, IMG_BICUBIC); + $scaled = imagescale($orig, (int)($width * $factor), (int)($height * $factor), IMG_BICUBIC); imagejpeg($scaled, $thumbpath, 85); $file = $thumbpath; $filename = $thumbname; @@ -114,10 +115,26 @@ if (file_exists($file)) { } else { // dynamically create error image header("Content-Type: image/png"); - $im = @imagecreate(110, 20) or die(_("Cannot initialize new GD image stream")); - $bgcolor = imagecolorallocate($im, 0, 0, 0); + $im = @imagecreate(240, 120) or die(_('Cannot initialize new GD image stream')); + $bgcolor = imagecolorallocate($im, 250, 250, 250); $txcolor = imagecolorallocate($im, 233, 14, 91); - imagestring($im, 1, 5, 5, "Resource not found!", $txcolor); + $border = imagecolorallocate($im, 180, 180, 180); + + $text = _('Resource not found!'); + $font = '/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf'; + $size = 12; + + $bbox = imagettfbbox($size, 0, $font, $text); + $textWidth = $bbox[2] - $bbox[0]; + $textHeight = $bbox[1] - $bbox[7]; + + $x = (240 - $textWidth) / 2; + $y = (120 + $textHeight) / 2; + imagettftext($im, $size, 0, $x, $y, $txcolor, $font, $text); + + imagerectangle($im, 0, 0, 239, 119, $border); + + // imagestring($im, 1, 5, 5, _('Resource not found!'), $txcolor); imagepng($im); imagedestroy($im); } diff --git a/webgui/documents.php b/webgui/documents.php index 28b694f..044a93e 100644 --- a/webgui/documents.php +++ b/webgui/documents.php @@ -7,6 +7,7 @@ ******************************************************************************/ require 'globals.inc'; +require 'lib/gpc.inc'; require 'lib/fileutils.inc'; $pagetitle = _('Documents'); @@ -78,6 +79,9 @@ switch ($submit = form_get_action()) { if ($file_type != $file_mimetype) { $g_warning->Add(sprintf(_("Mimetype mismatch: '%s'."), $file_type)); } + + // TODO for images check maximum size and scale down if needed + // ok let's go $file_hash = md5_file($file_tmp); $file_timestamp = date('Y-m-d H:i:s', filemtime($file_tmp)); @@ -140,39 +144,44 @@ switch ($submit = form_get_action()) { case 'delete': // Security token needed! - /*if (gpc_get_string($_POST, 'token', 16) != $_SESSION['token']) { + if (gpc_get_string($_POST, 'token', 16) != $_SESSION['token']) { $g_error->Add(_('Delete prohibited, invalid security token!')); $action = ACT_VIEW; break; } unset($_SESSION['token']); - */ + // get document details $sql = "SELECT doctype, extension FROM document WHERE docid=?"; $sth = $pdo->prepare($sql); $sth->execute([$id]); $doc = $sth->fetch(PDO::FETCH_OBJ); - // clean thumbs $thumbdir = $g_doc_basepath . '/thumbs/'; - $pattern = sprintf('%s-%06d*', $g_doc_typemap[$doctype], $docid); + $pattern = sprintf('%s-%06d*', $g_doc_typemap[$doc->doctype], $id); + $g_success->Add("Remove thumbs: type=$doc->doctype pattern=$pattern"); foreach (glob($thumbdir . $pattern) as $f) { - // unlink($f); + unlink($f); $g_success->Add($f); } - + // remove references + $nref = db_exec_delete('docref', 'docid=?', $id); + if ($nref > 0) { + $g_success->Add(sprintf(_('Removed %d references'), $nref)); + } // remove document - $g_success->Add(_('Deleted document %s'), $docfilename); - // sprintf('%s/%s-%06d.%s', $g_doc_basepath, $dtmap[$row['doctype']], $docid, $row['extension']); - /* + $docfilename = sprintf('%s/%s-%06d.%s', $g_doc_basepath, $g_doc_typemap[$doc->doctype], $id, $doc->extension); + unlink($docfilename); + $g_success->Add(sprintf(_('Deleted document %s'), $docfilename)); + // remove record from database $sth = $pdo->prepare("DELETE FROM document WHERE docid=?"); try { $sth->execute([$id]); } catch (PDOexception $e) { - $g_error->Add(sprintf(_('SQL-Error: %s', $e->getMessage()))); - }*/ - //$action = ACT_DEFAULT; - - $action = ACT_DELETE; + $g_error->Add(sprintf(_('SQL-Error: %s'), $e->getMessage())); + $action = ACT_DELETE; + break; + } + $action = ACT_DEFAULT; break; case 'addref': @@ -266,7 +275,7 @@ WHERE r.reftype='equipment' AND e.vid=:vid */ -// get total recond count for pagination and limit +// get total record count for pagination and limit $sql = "SELECT COUNT(DISTINCT docid) FROM document LEFT OUTER JOIN docref USING (docid)"; if ($where) $sql .= ' WHERE ' . $where; $sth = $pdo->prepare($sql); @@ -402,7 +411,7 @@ echo '

', _('Add Document'), "

\n"; - +
@@ -438,13 +447,12 @@ $sth = $pdo->prepare($sql); $sth->execute([$id]); $document = $sth->fetch(PDO::FETCH_OBJ); - echo '

', _('View Document'), "

\n"; echo '
', "\n"; echo '
', "\n"; echo '', "\n"; -echo '\n"; +echo '\n"; if ($document->doctype == 'picture') { $techname = sprintf('pic-%06d.%s', $document->docid, $document->extension); echo '\n"; + echo ''; + [$width, $height] = getimagesize($g_doc_basepath . '/' . $techname); + echo '"; } elseif (($document->doctype == 'drawing')) { + // TODO preview with popup $techname = sprintf('drw-%06d.%s', $document->docid, $document->extension); echo ''; echo '', "\n"; @@ -559,21 +573,26 @@ foreach ($sth->fetchAll() as $row) { echo '
', _('Document type'),"", $document->doctype, "
', _('Document type'),"", get_enum($document->doctype), "
', _('Preview'), ''; @@ -452,6 +460,7 @@ if ($document->doctype == 'picture') { echo ''; // gallery @@ -473,7 +482,12 @@ if ($document->doctype == 'picture') { // echo ''; echo "
Image extents', $width, 'x', $height, 'px'; + echo "
', _('Drawing'), '', $document->title, '
', "\n"; echo "\n"; echo ""; +echo "\n"; echo '"; echo ""; echo ""; echo "\n"; echo "\n"; +$i = 0; foreach ($references as $ref) { + $i++; echo ""; - echo ""; + echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -721,7 +740,6 @@ if ($document->mimetype == 'application/pdf') { elseif ($action == ACT_DELETE): // ========== VARIANT: delete record ========================================== - $sql = "SELECT docid, doctype, mimetype, filename, extension, title " . "FROM document " . "WHERE docid=?"; @@ -729,17 +747,22 @@ $sth = $pdo->prepare($sql); $sth->execute([$id]); $document = $sth->fetch(PDO::FETCH_OBJ); +$sql = "SELECT COUNT(*) FROM docref WHERE docid=?"; +$sth = $pdo->prepare($sql); +$sth->execute([$id]); +$nref = $sth->fetchColumn(); + echo '

', _('Delete Document'), "

\n"; echo '

', sprintf(_('Record no. %d'), $id), "

\n"; -echo '

Dokument: ', $document->filename, "

"; -echo '

Title: ', $document->title, "

"; +echo '

Dokument: ', $document->filename, "

\n"; +echo '

Title: ', $document->title, "

\n"; +echo '

References: ', $nref, "

\n"; echo '

', _('Deleting a document item is final. There is no way back. Only delete if you are absolute sure.'), "

\n"; $_SESSION['token'] = bin2hex(random_bytes(8)); form_delete_buttons($g_scriptname, $id, $_SESSION['token']); - else: // ========== ERROR UNKNOWN VARIANT =========================================== diff --git a/webgui/dropdown.php b/webgui/dropdown.php index f35dd11..68d262f 100644 --- a/webgui/dropdown.php +++ b/webgui/dropdown.php @@ -1,12 +1,14 @@ 0) { break; } + // scale down if dimensions exceed limits + $img_maxx= $pdo->query("SELECT valint FROM settings WHERE userid=0 AND sno=20")->fetchColumn(); + $img_maxy= $pdo->query("SELECT valint FROM settings WHERE userid=0 AND sno=21")->fetchColumn(); + [$width, $height] = getimagesize($file_tmp); + $factor = min($img_maxx / $width, $img_maxy / $height); + if ($factor < 1) { + $width = (int)($width * $factor); + $height = (int)($height * $factor); + $g_message->add(sprintf(_('Image sacled down to %dx%d'), $width, $height)); + if ($file_mimetype == 'image/jpeg') { + $orig = imagecreatefromjpeg($file_tmp); + $scaled = imagescale($orig, (int)($width * $factor), (int)($height * $factor), IMG_BICUBIC); + imagejpeg($scaled, $file_tmp, 85); + } else if ($file_mimetype == 'image/png') { + $orig = imagecreatefrompng($file_tmp); + if (!$orig) { + $g_error->Add("imagecreatefrompng failed"); + break; + } + $scaled = imagescale($orig, (int)($width * $factor), (int)($height * $factor), IMG_BICUBIC); + if (!$scaled) { + $g_error->Add("imagescale failed"); + break; + } + imagepng($scaled, $file_tmp, 9); + } else { + $g_error->Add(sprintf(_('Internal error: Unknown mimetype %s!'), $file_mimetype)); + break; + } + $file_size = filesize($file_tmp); + } + + // check if storage limit is exceeded + if (dir_get_size($g_doc_basepath) + $file_size > $g_storage_limit * 1024 * 1024) { + $g_error->Add(_('Storage limit exceeded. Image not uploaded!')); + break; + } + $file_hash = md5_file($file_tmp); $file_timestamp = date('Y-m-d H:i:s', filemtime($file_tmp)); diff --git a/webgui/globals.inc b/webgui/globals.inc index 0e43af7..1809257 100644 --- a/webgui/globals.inc +++ b/webgui/globals.inc @@ -71,7 +71,9 @@ if ($g_scriptname != 'login.php') { try { $pdo = new PDO("mysql:host=$g_db_host;dbname=$g_db_schema;charset=utf8mb4", $g_db_username, $g_db_password); } catch (PDOException $e) { - echo '
';
+    echo "\n";
+    echo '';
+    echo '
';
     switch ($e->getCode()) {
         case 2002:
             echo "Unable to connect to database, perhaps host info is wrong.\n";
@@ -87,7 +89,8 @@ try {
         default:
             print_r($e);
     }
-    echo '
'; + echo '
'; + echo ''; exit(1); } $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); @@ -100,7 +103,7 @@ try { echo '
';
         echo 'Settings table not found! Perhaps database is not initialized';
         echo '
'; - exit(1) + exit(1); } } $g_db_scheme_version = $sth->fetchColumn(); @@ -378,6 +381,49 @@ function db_exec_update($table, $params, $pk) { return true; } +function db_exec_delete($table, $condition, $params) { + // WIP untested! + // condition contains the where part of the sql statement + // params are values for placeholders in condition + // returns the number of deleted records + global $pdo; + global $g_error; + // convert params to array if single value is given + if (!is_array($params)) { + $params = [$params]; + } + $sql = "DELETE FROM $table"; + if (!empty($condition)) { + $sql .= ' WHERE ' . $condition; + } + $sth = $pdo->prepare($sql); + try { + $sth->execute($params); + } catch (PDOexception $e) { + $g_error->Add('SQL-Error: '. $e->getMessage()); + $g_error->Add($sql); + $g_error->Add(print_r($params, true)); + return -1; + } + return $sth->rowCount(); +} + +function db_clear_filter($sno) { + global $user; + global $pdo; + $sql = "DELETE FROM settings WHERE userid=? AND sno=?"; + $sth = $pdo->prepare($sql); + try { + $sth->execute([$user->id, $sno]); + } catch (PDOexception $e) { + $g_warning->Add('SQL-Error: '. $e->getMessage()); + $g_warning->Add($sql); + $g_warning->Add('Setting: ', $sno); + return false; + } + return true; +} + function db_save_filter($flt, $sno) { global $user; global $pdo; @@ -400,8 +446,10 @@ function get_enum($enum) { // translate and beautify enums $lookup = array( 'NULL' => _('n/a'), + 'active' => _('Active'), 'bad' => _('Bad'), 'box' => _('Box'), + 'cable' => _('Cable'), 'cat' => _('Catamaran'), 'completed' => _('Completed'), 'closed' => _('Closed'), @@ -414,6 +462,7 @@ function get_enum($enum) { 'estimated' => _('Estimated'), 'finished' => _('Finished'), 'fixed' => _('Fixed'), + 'fuse' => _('Fuse'), 'generic' => _('Generic'), 'good' => _('Good'), 'high' => _('High'), @@ -428,12 +477,14 @@ function get_enum($enum) { 'normal' => _('Normal'), 'ongoing' => _('Ongoing'), 'open' => _('Open'), + 'ordered' => _('Ordered'), 'paused' => _('Paused'), 'pending' => _('Pending'), 'picture' => _('Picture'), 'planned' => _('Planned'), 'precise' => _('Precise'), 'project' => _('Project'), + 'removed' => _('Removed'), 'repairable' => _('Repairable'), 'rough' => _('Rough'), 'storage' => _('Storage'), @@ -629,7 +680,8 @@ function db_get_opt_storage($vid) { global $pdo; global $g_error; $list = array(); - $sql = "SELECT sid, sname FROM storage WHERE vid=? ORDER BY sname"; + // exclude storage type "tank" from list + $sql = "SELECT sid, sname FROM storage WHERE vid=? AND stype<>1 ORDER BY sname"; $sth = $pdo->prepare($sql); try { $sth->execute([$vid]); @@ -713,6 +765,21 @@ function db_get_opt_supp($default=NULL) { return $list; } +function db_get_opt_user($userid, $default=NULL) { + global $pdo; + if (isset($default)) { + $list = $default; + } else { + $list = array(); + } + $sql = "SELECT userid, displayname FROM user WHERE userid>0 ORDER BY displayname"; + $sth = $pdo->query($sql); + foreach ($sth->fetchAll(PDO::FETCH_NUM) as $row) { + $list[$row[0]] = $row[1]; + } + return $list; +} + function db_get_opt_proj($vid, $default=NULL) { global $pdo; global $g_error; @@ -802,10 +869,22 @@ function form_get_action() { return strtolower($submit); } -function form_create_select($fieldname, $label, $optlist, $selval=NULL) { +function form_create_input($fieldname, $label, $value) { + // TODO WIP + echo '
', "\n"; + echo "
\n"; +} + +function form_create_text($fieldname, $label, $value) { + // TODO WIP + echo '
', "\n"; + echo "
\n"; +} + +function form_create_select($fieldname, $label, $optlist, $selval=NULL, $multiple=FALSE) { echo '
', "\n"; echo '\n"; - echo '', "\n"; foreach ($optlist as $k => $v) { echo '
"; } -function filter_create_select($fieldname, $label, $optlist, $selval=NULL) { +function filter_create_select($fieldname, $label, $optlist, $selval=NULL, $multiple=FALSE) { + // - Wenn multiple gesetzt ist, muß selval ein array sein + // ansonsten ein einfacher String + /* if ($multiple) { + if (!is_array($selval)) { + } + } */ + echo '
', "\n"; echo '', "\n"; - echo '\n"; foreach ($optlist as $k => $v) { echo '', "\n"; } echo "\n"; -} - -// ========== GPC FUNCTIONS =================================================== - -function gpc_get_string(&$GPC, $varname, $maxlen = NULL, $default = NULL) { - // TODO Parameter nullval: single value or array of values which considered as null - // Default value for nullval is "-1" - if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) { - return $default; - } - $s = trim($GPC[$varname]); - if (isset($maxlen)) { - return substr($s, 0, $maxlen); - } - return $s; -} - -function gpc_get_int(&$GPC, $varname, $default = NULL) { - if (!isset($GPC[$varname])) { - return $default; - } - return (int)$GPC[$varname]; -} - -function gpc_get_float(&$GPC, $varname, $default = NULL) { - global $g_lconv; - if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) { - return $default; - } - $var = str_replace($g_lconv['thousands_sep'], '', $GPC[$varname]); - if ($g_lconv['decimal_point'] != '.') { - $var = str_replace($g_lconv['decimal_point'], '.', $var); - } - return (double)$var; -} - -function gpc_get_currency(&$GPC, $varname, $default = NULL) { - global $g_lconv; - if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) { - return $default; - } - $var = str_replace($g_lconv['thousands_sep'], '', $GPC[$varname]); - if ($g_lconv['decimal_point'] != '.') { - $var = str_replace($g_lconv['decimal_point'], '.', $var); - } - return (double)$var; -} - -function gpc_get_bool(&$GPC, $varname, $default = FALSE) { - if (!isset($GPC[$varname])) { - return $default; - } - $gpcvar = trim($GPC[$varname]); - if (strcasecmp('off', $gpcvar) == 0 || - strcasecmp('no', $gpcvar) == 0 || - strcasecmp('false', $gpcvar) == 0 || - strcasecmp('no', $gpcvar) == 0 || - strcasecmp('0', $gpcvar) == 0 || - strcasecmp('nein', $gpcvar) == 0) - { - return FALSE; - } - return TRUE; -} - -function gpc_get_date(&$GPC, $varname, $default = NULL) { - // TODO improve - if (!isset($GPC[$varname]) || $GPC[$varname] == '') { - return $default; - } - return $GPC[$varname]; -} - -function gpc_get_datetime(&$GPC, $varname, $default = NULL) { - // TODO improve - if (!isset($GPC[$varname]) || $GPC[$varname] == '') { - return $default; - } - return $GPC[$varname]; -} - -function gpc_get_color(&$GPC, $varname, $default = NULL) { - if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) { - return $default; - } - $color = $GPC[$varname]; - if ((strlen($color) == 7) and (substr($color, 0, 1) == '#')) { - $color = substr($color, 1); - } - if ((strlen($color) != 6) or (! ctype_xdigit($color))) { - return $default; - } - return strtoupper($color); -} - -function gpc_get_enum(&$GPC, $varname, $values, $default = NULL) { - if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) { - return $default; - } - if (! in_array($GPC[$varname], $values)) { - return $default; - } - return $GPC[$varname]; + echo "
"; } // ========== FORMAT FUNCTIONS ================================================ @@ -1162,11 +1153,11 @@ function get_pagination($script, $param, $page, $lastpage, $small=false) { if ($page > 1) { // Go to first page or previous page - $out .= '
  • First
  • '. "\n"; - $out .= '
  • Previous
  • '. "\n"; + $out .= '
  • '. _('First'). '
  • '. "\n"; + $out .= '
  • '. _('Previous'). '
  • '. "\n"; } else { - $out .= '
  • First
  • '. "\n"; - $out .= '
  • Previous
  • '. "\n"; + $out .= '
  • '. _('First'). '
  • '. "\n"; + $out .= '
  • '. _('Previous'). '
  • '. "\n"; } if ($lastpage < 10) { @@ -1181,11 +1172,11 @@ function get_pagination($script, $param, $page, $lastpage, $small=false) { if ($page < $lastpage) { // go to last page or next page - $out .= '
  • Next
  • '. "\n"; - $out .= '
  • Last
  • '. "\n"; + $out .= '
  • '. _('Next'). '
  • '. "\n"; + $out .= '
  • '. _('Last'). '
  • '. "\n"; } else { - $out .= '
  • Next
  • '. "\n"; - $out .= '
  • Last
  • '. "\n"; + $out .= '
  • '. _('Next'). '
  • '. "\n"; + $out .= '
  • '. _('Last'). '
  • '. "\n"; } // idea: small entry to input page number diff --git a/webgui/index.php b/webgui/index.php index c075545..32797bb 100644 --- a/webgui/index.php +++ b/webgui/index.php @@ -7,6 +7,8 @@ ******************************************************************************/ require 'globals.inc'; +require 'lib/gpc.inc'; + $pagetitle = _('Start'); // ========== ACTIONS START =================================================== diff --git a/webgui/inventory.php b/webgui/inventory.php index ffb51a2..4659436 100644 --- a/webgui/inventory.php +++ b/webgui/inventory.php @@ -1,12 +1,14 @@ fetch(PDO::FETCH_OBJ); conttype); -form_create_select('sid', _('Storage'), $opt_storage, $inventory->sid); +form_create_select('sid', _('Storage'), $g_opt_none + $opt_storage, $inventory->sid); form_create_select('boxid', _('Box'), $g_opt_none + $opt_box, $inventory->boxid); ?>
    diff --git a/webgui/lib/fileutils.inc b/webgui/lib/fileutils.inc index e83cfd1..ae0ed33 100644 --- a/webgui/lib/fileutils.inc +++ b/webgui/lib/fileutils.inc @@ -1,7 +1,7 @@ prepare("UPDATE document SET docsize=? WHERE docid=?"); - $sth->execute([$docid, $newsize]); + $sql = "UPDATE document SET docsize=? WHERE docid=?"; + $params = [$newsize, $docid]; + $sth = $pdo->prepare($sql); + try { + $sth->execute($params); + } catch (PDOexception $e) { + $g_error->Add('SQL-Error: '. $e->getMessage()); + $g_error->Add($sql); + $g_error->Add(print_r($params, true)); + } return $newsize; } @@ -23,3 +31,15 @@ function file_get_docname($docid, $doctype, $extension) { global $g_doc_typemap; return sprintf('%s-%06d.%s', $g_doc_typemap[$doctype], $docid, $extension); } + +function dir_get_size($path) { + // gets the size of a directory in bytes recursively + $total = 0; + $iterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS) + ); + foreach ($iterator as $file){ + $total += $file->getSize(); + } + return $total; +} diff --git a/webgui/lib/gpc.inc b/webgui/lib/gpc.inc new file mode 100644 index 0000000..499773d --- /dev/null +++ b/webgui/lib/gpc.inc @@ -0,0 +1,112 @@ +\n" "Language-Team: LANGUAGE \n" @@ -44,24 +44,24 @@ msgstr "Farbe" msgid "Content" msgstr "Inhalt" -#: box.php:94 box.php:175 box.php:198 equipment.php:406 index.php:329 +#: box.php:94 box.php:175 box.php:198 equipment.php:405 index.php:329 #: index.php:345 inventory.php:359 provisions.php:272 msgid "Weight" msgstr "Gewicht" #: box.php:102 box.php:177 company.php:205 company.php:284 documents.php:365 -#: documents.php:573 documents.php:575 equipment.php:328 equipment.php:402 +#: documents.php:573 documents.php:575 equipment.php:327 equipment.php:401 #: equipment.php:492 equipment.php:515 equipment.php:537 inventory.php:253 #: maintenance.php:167 projects.php:197 projects.php:244 provisions.php:193 -#: storage.php:120 storage.php:164 storage.php:248 task.php:220 globals.inc:855 +#: storage.php:120 storage.php:164 storage.php:248 task.php:220 globals.inc:875 msgid "View" msgstr "Ansehen" -#: box.php:111 company.php:212 documents.php:373 equipment.php:338 +#: box.php:111 company.php:212 documents.php:373 equipment.php:337 #: equipment_js.php:243 index.php:286 inventory.php:264 maintenance.php:174 #: maintenance.php:293 projects.php:206 projects.php:250 provisions.php:212 -#: storage.php:132 storage.php:171 task.php:228 task.php:303 globals.inc:856 -#: globals.inc:872 +#: storage.php:132 storage.php:171 task.php:228 task.php:303 globals.inc:876 +#: globals.inc:892 msgid "Edit" msgstr "Bearbeiten" @@ -78,13 +78,13 @@ msgstr "Kiste hinzufügen" #: box.php:135 box.php:176 index.php:369 inventory.php:188 inventory.php:296 #: inventory.php:300 inventory.php:402 provisions.php:250 provisions.php:278 -#: provisions.php:326 storage.php:10 globals.inc:456 +#: provisions.php:326 storage.php:10 globals.inc:457 msgid "Storage" msgstr "Stauraum" #: box.php:149 box.php:179 box.php:251 company.php:195 company.php:270 -#: company.php:407 documents.php:398 documents.php:501 documents.php:713 -#: equipment.php:310 equipment.php:373 equipment.php:411 equipment.php:600 +#: company.php:395 documents.php:398 documents.php:501 documents.php:713 +#: equipment.php:309 equipment.php:372 equipment.php:410 equipment.php:600 #: equipment_js.php:65 index.php:405 index.php:491 inventory.php:363 #: inventory.php:430 maintenance.php:157 maintenance.php:257 #: maintenance.php:327 projects.php:187 projects.php:277 projects.php:301 @@ -92,23 +92,23 @@ msgstr "Stauraum" msgid "Remarks" msgstr "Bemerkungen" -#: box.php:153 company.php:238 company.php:410 documents.php:423 -#: documents.php:716 equipment.php:377 equipment.php:603 equipment_js.php:112 +#: box.php:153 company.php:238 company.php:398 documents.php:423 +#: documents.php:716 equipment.php:376 equipment.php:603 equipment_js.php:112 #: equipment_js.php:279 index.php:409 inventory.php:304 maintenance.php:215 #: measurement.php:237 note.php:156 projects.php:280 projects.php:366 #: provisions.php:252 storage.php:204 storage.php:327 task.php:257 -#: globals.inc:882 globals.inc:889 +#: globals.inc:902 globals.inc:909 msgid "Save" msgstr "Speichern" -#: box.php:154 company.php:239 company.php:411 company.php:437 +#: box.php:154 company.php:239 company.php:399 company.php:425 #: documents.php:424 documents.php:717 dropdown.php:205 dropdown.php:269 -#: equipment.php:378 equipment.php:604 equipment_js.php:113 +#: equipment.php:377 equipment.php:604 equipment_js.php:113 #: equipment_js.php:247 equipment_js.php:280 index.php:410 inventory.php:305 #: maintenance.php:216 measurement.php:238 note.php:157 projects.php:281 #: projects.php:367 provisions.php:253 search.php:34 storage.php:205 -#: storage.php:328 task.php:258 globals.inc:876 globals.inc:883 globals.inc:890 -#: globals.inc:900 +#: storage.php:328 task.php:258 globals.inc:896 globals.inc:903 globals.inc:910 +#: globals.inc:920 msgid "Back" msgstr "Zurück" @@ -120,7 +120,7 @@ msgstr "Kistentyp" msgid "Inventory in box" msgstr "Inventar in der Kiste" -#: box.php:197 index.php:343 inventory.php:10 search.php:78 globals.inc:1259 +#: box.php:197 index.php:343 inventory.php:10 search.php:78 globals.inc:1279 msgid "Inventory" msgstr "Inventar" @@ -141,7 +141,7 @@ msgstr "Kiste bearbeiten" msgid "Weight, kg" msgstr "Gewicht, kg" -#: box.php:265 checklist.php:170 company.php:448 documents.php:746 +#: box.php:265 checklist.php:170 company.php:436 documents.php:746 #: dropdown.php:275 equipment.php:630 equipment_js.php:289 index.php:502 #: inventory.php:458 maintenance.php:343 measurement.php:322 note.php:223 #: projects.php:379 provisions.php:340 settings.php:91 storage.php:354 @@ -176,7 +176,7 @@ msgid "Edit checklist" msgstr "Checkliste bearbeiten" #: checklist.php:153 company.php:193 company.php:234 company.php:257 -#: company.php:330 dropdown.php:178 dropdown.php:224 equipment.php:361 +#: company.php:330 dropdown.php:178 dropdown.php:224 equipment.php:360 #: equipment.php:567 equipment_js.php:97 equipment_js.php:264 index.php:397 #: inventory.php:239 inventory.php:285 inventory.php:388 measurement.php:209 #: measurement.php:256 measurement.php:286 projects.php:183 projects.php:231 @@ -217,30 +217,30 @@ msgstr "Unbekannte Funktion!" msgid "― all ―" msgstr "― alle ―" -#: company.php:177 documents.php:335 equipment.php:289 inventory.php:224 +#: company.php:177 documents.php:335 equipment.php:288 inventory.php:224 #: maintenance.php:109 measurement.php:158 projects.php:171 provisions.php:162 #: tag.php:96 task.php:194 msgid "Apply" msgstr "Anwenden" -#: company.php:177 documents.php:335 equipment.php:289 inventory.php:224 +#: company.php:177 documents.php:335 equipment.php:288 inventory.php:224 #: maintenance.php:109 measurement.php:158 projects.php:171 provisions.php:162 #: tag.php:96 task.php:194 msgid "Go" msgstr "Start" -#: company.php:178 documents.php:336 equipment.php:290 inventory.php:225 +#: company.php:178 documents.php:336 equipment.php:289 inventory.php:225 #: maintenance.php:110 projects.php:172 provisions.php:163 tag.php:97 msgid "Reset filter to defaults" msgstr "Filter auf Standard zurücksetzen" -#: company.php:178 documents.php:336 documents.php:405 equipment.php:290 +#: company.php:178 documents.php:336 documents.php:405 equipment.php:289 #: inventory.php:225 maintenance.php:110 projects.php:172 provisions.php:163 #: tag.php:97 task.php:195 msgid "Clear" msgstr "Löschen" -#: company.php:218 documents.php:379 equipment.php:344 inventory.php:270 +#: company.php:218 documents.php:379 equipment.php:343 inventory.php:270 #, php-format msgid "Records %d to %d of %d" msgstr "Datensätze %d bis %d von %d" @@ -253,7 +253,7 @@ msgstr "Firma hinzufügen" msgid "Company type" msgstr "Firmenart" -#: company.php:258 company.php:334 equipment.php:400 equipment.php:571 +#: company.php:258 company.php:334 equipment.php:399 equipment.php:571 msgid "Short name" msgstr "Kurzbezeichnung" @@ -261,7 +261,7 @@ msgstr "Kurzbezeichnung" msgid "Secondary type" msgstr "Sekundärer Typ" -#: company.php:261 company.php:367 +#: company.php:261 company.php:355 msgid "Street" msgstr "Straße" @@ -269,31 +269,31 @@ msgstr "Straße" msgid "Zip, City" msgstr "PLZ, Ort" -#: company.php:263 company.php:379 +#: company.php:263 company.php:367 msgid "Country" msgstr "Land" -#: company.php:264 company.php:383 +#: company.php:264 company.php:371 msgid "Contact" msgstr "Ansprechparter" -#: company.php:265 company.php:387 +#: company.php:265 company.php:375 msgid "Phone" msgstr "Telefon" -#: company.php:266 company.php:391 +#: company.php:266 company.php:379 msgid "Email" msgstr "Email" -#: company.php:267 company.php:395 +#: company.php:267 company.php:383 msgid "Web" msgstr "Web" -#: company.php:268 company.php:399 +#: company.php:268 company.php:387 msgid "Customer no." msgstr "Kundennr." -#: company.php:269 company.php:403 +#: company.php:269 company.php:391 msgid "Contract no." msgstr "Kontraktnr." @@ -313,29 +313,29 @@ msgstr "Firma bearbeiten" msgid "Secondary company type" msgstr "Sekundärer Firmentyp" -#: company.php:371 +#: company.php:359 msgid "Zip" msgstr "PLZ" -#: company.php:375 +#: company.php:363 msgid "City" msgstr "Stadt" -#: company.php:423 +#: company.php:411 msgid "Delete Company" msgstr "Firma löschen" -#: company.php:424 documents.php:733 equipment.php:619 inventory.php:448 +#: company.php:412 documents.php:733 equipment.php:619 inventory.php:448 #: note.php:214 storage.php:343 #, php-format msgid "Record no. %d" msgstr "Datensatz Nr. %d" -#: company.php:436 +#: company.php:424 msgid "Company can not be deleted as there are equipment-references!" msgstr "Firma kann nicht gelöscht werden da Ausrüstung zugeordnet ist!" -#: company.php:440 +#: company.php:428 msgid "" "Deleting a company is final. There is no way back. Only delete if you are " "absolute sure." @@ -347,7 +347,7 @@ msgstr "" msgid "Cannot initialize new GD image stream" msgstr "Neuer GD Imagestream kann nicht initialisiert werden" -#: documents.php:12 index.php:349 task.php:314 globals.inc:1263 +#: documents.php:12 index.php:349 task.php:314 globals.inc:1283 msgid "Documents" msgstr "Dokumente" @@ -474,11 +474,11 @@ msgstr "Neue Referenz hinzufügen" #: inventory.php:428 maintenance.php:156 maintenance.php:202 #: maintenance.php:251 maintenance.php:325 measurement.php:234 #: measurement.php:265 measurement.php:311 search.php:50 globals.inc:429 -#: globals.inc:1258 +#: globals.inc:1278 msgid "Equipment" msgstr "Ausrüstung" -#: documents.php:660 globals.inc:461 +#: documents.php:660 globals.inc:462 msgid "Vessel" msgstr "Yacht" @@ -530,7 +530,7 @@ msgstr "Gefahr! Nur anpassen wenn klar ist was für Auswirkungen das hat!" msgid "Adding values is usually not critical." msgstr "Hinzufügen von Werten ist normalerweise unkritisch." -#: dropdown.php:147 equipment.php:305 equipment_js.php:61 provisions.php:177 +#: dropdown.php:147 equipment.php:304 equipment_js.php:61 provisions.php:177 #: tag.php:112 tag.php:148 tag.php:170 tag.php:221 msgid "Description" msgstr "Beschreibung" @@ -554,7 +554,7 @@ msgstr "Kurzbez." msgid "Sort" msgstr "Sortierung" -#: dropdown.php:182 equipment.php:282 +#: dropdown.php:182 equipment.php:283 equipment.php:411 msgid "Flags" msgstr "" @@ -563,7 +563,7 @@ msgstr "" msgid "Edit List: %s" msgstr "Liste bearbeiten: %s" -#: dropdown.php:268 equipment_js.php:89 globals.inc:866 +#: dropdown.php:268 equipment_js.php:89 globals.inc:886 msgid "Add" msgstr "Hinzufügen" @@ -589,63 +589,63 @@ msgstr "Keine Dateien zum Hochladen angegeben" msgid "Filetype not allowed for upload:" msgstr "Dateityp nicht zum Hochladen zugelassen:" -#: equipment.php:263 +#: equipment.php:265 msgctxt "male" msgid "― none ―" msgstr "― keiner ―" -#: equipment.php:270 equipment.php:365 equipment.php:410 equipment.php:597 +#: equipment.php:272 equipment.php:364 equipment.php:409 equipment.php:597 #: provisions.php:154 provisions.php:275 provisions.php:315 msgid "Category" msgstr "Kategorie" -#: equipment.php:271 equipment.php:306 equipment.php:366 equipment.php:401 +#: equipment.php:273 equipment.php:305 equipment.php:365 equipment.php:400 #: equipment.php:574 msgid "Manufacturer" msgstr "Hersteller" -#: equipment.php:272 equipment.php:409 equipment.php:596 +#: equipment.php:274 equipment.php:408 equipment.php:596 msgid "Supplier" msgstr "Lieferant" -#: equipment.php:275 +#: equipment.php:277 msgid "Text" msgstr "" -#: equipment.php:307 equipment.php:369 equipment.php:404 equipment.php:576 +#: equipment.php:306 equipment.php:368 equipment.php:403 equipment.php:576 #: equipment_js.php:63 equipment_js.php:105 equipment_js.php:134 #: equipment_js.php:272 index.php:401 index.php:444 msgid "Model" msgstr "Modell" -#: equipment.php:308 equipment.php:405 equipment.php:580 equipment_js.php:64 +#: equipment.php:307 equipment.php:404 equipment.php:580 equipment_js.php:64 #: equipment_js.php:109 equipment_js.php:135 equipment_js.php:276 msgid "Serial" msgstr "Seriennummer" -#: equipment.php:309 +#: equipment.php:308 msgid "Age" msgstr "Alter" -#: equipment.php:321 +#: equipment.php:320 #, php-format msgid "%dm" msgstr "" -#: equipment.php:323 +#: equipment.php:322 #, php-format msgid "%dy" msgstr "" -#: equipment.php:358 equipment_js.php:94 +#: equipment.php:357 equipment_js.php:94 msgid "Add Equipment" msgstr "Ausrüstung hinzufügen" -#: equipment.php:407 inventory.php:360 +#: equipment.php:406 inventory.php:360 msgid "Price" msgstr "Preis" -#: equipment.php:408 equipment.php:592 inventory.php:361 inventory.php:410 +#: equipment.php:407 equipment.php:592 inventory.php:361 inventory.php:410 msgid "Purchase date" msgstr "Kaufdatum" @@ -654,7 +654,6 @@ msgid "Images and documents" msgstr "Bilder und Dokumente" #: equipment.php:459 -#, fuzzy msgid "No referenced documents" msgstr "Keine verknüpften Dokumente" @@ -720,7 +719,7 @@ msgstr "" msgid "Make" msgstr "Marke" -#: equipment_js.php:245 globals.inc:874 globals.inc:899 +#: equipment_js.php:245 globals.inc:894 globals.inc:919 msgid "Delete" msgstr "Löschen" @@ -750,7 +749,7 @@ msgstr "Neues Boot %d ausgewählt" msgid "Yacht data" msgstr "Yachtdaten" -#: index.php:101 globals.inc:460 +#: index.php:101 globals.inc:461 msgid "User" msgstr "Benutzer" @@ -822,7 +821,7 @@ msgstr "Stammdaten" msgid "Selection lists" msgstr "Auswahllisten" -#: index.php:368 inventory.php:243 tag.php:10 globals.inc:907 +#: index.php:368 inventory.php:243 tag.php:10 globals.inc:927 msgid "Tags" msgstr "" @@ -974,7 +973,7 @@ msgstr "" msgid "New login" msgstr "Neue Anmeldung" -#: maintenance.php:10 globals.inc:1261 +#: maintenance.php:10 globals.inc:1281 msgid "Maintenance" msgstr "Wartung" @@ -1023,7 +1022,7 @@ msgstr "Wartung bearbeiten" msgid "Delete Maintenance" msgstr "Wartung löschen" -#: measurement.php:17 globals.inc:459 +#: measurement.php:17 globals.inc:460 msgid "Unknown" msgstr "Unbekannt" @@ -1035,7 +1034,7 @@ msgstr "Präzise" msgid "Normal" msgstr "Normal" -#: measurement.php:20 globals.inc:455 +#: measurement.php:20 globals.inc:456 msgid "Rough" msgstr "Grob" @@ -1165,7 +1164,7 @@ msgstr "" "Löschen einer Notiz ist endgültig. Es gibt keinen Weg zurück. Nur löschen " "wenn Sie sich absolut sicher sind." -#: projects.php:10 globals.inc:1262 +#: projects.php:10 globals.inc:1282 msgid "Projects" msgstr "Projekte" @@ -1198,7 +1197,7 @@ msgid "Assigned tasks" msgstr "Zugeordnete Aufgaben" #: projects.php:316 task.php:10 task.php:205 task.php:253 task.php:278 -#: globals.inc:457 +#: globals.inc:458 msgid "Task" msgstr "Aufgabe" @@ -1222,7 +1221,7 @@ msgstr "Status" msgid "Delete Project" msgstr "Lösche Projekt" -#: provisions.php:10 globals.inc:1260 +#: provisions.php:10 globals.inc:1280 msgid "Provisions" msgstr "Proviant" @@ -1262,7 +1261,7 @@ msgstr "Nettogewicht, kg" msgid "Delete provisions" msgstr "Proviant löschen" -#: search.php:10 search.php:30 globals.inc:1178 +#: search.php:10 search.php:30 globals.inc:1198 msgid "Search" msgstr "Suche" @@ -1609,77 +1608,81 @@ msgid "Planned" msgstr "Geplant" #: globals.inc:454 +msgid "Removed" +msgstr "Entfernt" + +#: globals.inc:455 msgid "Repairable" msgstr "Reparierbar" -#: globals.inc:458 +#: globals.inc:459 msgid "Trimaran" msgstr "" -#: globals.inc:462 +#: globals.inc:463 msgid "waiting" msgstr "wartend" -#: globals.inc:910 +#: globals.inc:930 msgid "Tag assignment" msgstr "Tag-Zuordnung" -#: globals.inc:914 +#: globals.inc:934 msgid "(Separate by comma)" msgstr "(Getrennt mit Komma)" -#: globals.inc:1081 +#: globals.inc:1101 #, php-format msgid "%d B" msgstr "" -#: globals.inc:1083 +#: globals.inc:1103 #, php-format msgid "%.1f kB" msgstr "" -#: globals.inc:1085 +#: globals.inc:1105 #, php-format msgid "%.1f MB" msgstr "" -#: globals.inc:1090 globals.inc:1099 +#: globals.inc:1110 globals.inc:1119 #, php-format msgid "%d Byte" msgstr "" -#: globals.inc:1092 +#: globals.inc:1112 #, php-format msgid "%.1f kByte" msgstr "" -#: globals.inc:1094 +#: globals.inc:1114 #, php-format msgid "%.1f MByte" msgstr "" -#: globals.inc:1101 +#: globals.inc:1121 #, php-format msgid "approx. %.1f kByte" msgstr "ca. %.1f kByte" -#: globals.inc:1103 +#: globals.inc:1123 #, php-format msgid "approx. %.1f MByte" msgstr "ca. %.1f MByte" -#: globals.inc:1206 globals.inc:1209 +#: globals.inc:1226 globals.inc:1229 msgid "First" msgstr "Erster" -#: globals.inc:1207 globals.inc:1210 +#: globals.inc:1227 globals.inc:1230 msgid "Previous" msgstr "Zurück" -#: globals.inc:1225 globals.inc:1228 +#: globals.inc:1245 globals.inc:1248 msgid "Next" msgstr "Vor" -#: globals.inc:1226 globals.inc:1229 +#: globals.inc:1246 globals.inc:1249 msgid "Last" msgstr "Letzter" diff --git a/webgui/locale/de_DE/LC_MESSAGES/yms.mo b/webgui/locale/de_DE/LC_MESSAGES/yms.mo index c2b57ca63768cc0b927440cea65270bdc302eee2..636ce83639ff5e83733e3b8b25cb42cb01884cc4 100644 GIT binary patch delta 7532 zcmZA63w+P@9>?+DTy`HeZsjD` zigS)jAxEWTj!Pn?DHO$`kT@z*q1XHW`>cn@`8^(=J-?st@B91SewWR|t;K#nE%9?t z)vUDG;mGlGoO<|86~{S5d3|lwI?mTr2I6UKfESP^PEdWvQIjwX$2hEo-LNJO!s<8{ z>*6$w!9}S4b|C$@&K?RCsrVQJuoSD|ml%u}uqs}&`ijgVh&&Y4t}bezSX9RyP}ilK zeNp`mvGXG_jC?#+XMAV2ui!Yv7|My2sE#&c2)=_F@BlW$Qq&56LrpxSA)RAQtc(*; zJCu)_$m3T34646ktb{ADqD$cw3Yy_M)IhJJ8oZ5~&`$FcREK4#c9&5TxPj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z*rbY=lAB2DQ>ut9M2X+!HlWKXW8% zVTBls_n_{dfx3SVs{K*aLZ3$6@2;f~Okpc(<-1TFK1Fq?L``@KQ}7J7#U}l|9ps`v z^#SG(45prsns^NA1aC(^Sk7G3qkab&-*vw73eHiiM?)>@<+^}+%OeJOUqtOuN1l(` z$qdvEA2v(P#i*lw#$1gd)YqaGwi)%V?7%4IcPcDV=}YiC8ES$ns7Db#(0dshp$14s z?KsWqnW%m}Q7`Qv)X9xSo#;f=$9Oh|;!~*mS7JTpcb=!9w{wHJ6LkXRsGU@y20n>e zz(w@KYlv@%e-J%Mbim(tNn@i8L6Cb6^+J#SsNd;IxtBz+&DmPq`^vUf>u|NJ*y%Hx&b;=OZT zCSD;{5Tm)d1<{Z=PhD3qp?70A;ZI)gOAa<8bZzu-vaMc2eK6(LL@=?2x?a+&^E-X1 z%p-JV6CLfw_bKaRmPzR9O1>MRKc@~-uZQ%hAF#nEU6L(tuA-siH&3}0D z{gR=N+YNTJ_3^Qof5#F}{w3Lfe!YmZ1Nh-;|VE&)QMixTM4TZe6UnrX#&*Pd;$~t3v65&?=xRluD*To>Otho^8|qr+;nXMh`PE0- zp5%2TQmt_!4zh9=b2APmB8eLb{r2&1;uN8)8_}FG9>+q0-(Y-KZ*oJ4=co-O?jT+y z4iUcjPh&4)k`i3E5sio>Rk+?Dav5L?K1%#bJVhKJbiGbIO@z`%S5FV;BU7v;{zu$O zq!8VSy9u|Fe|8eHiOvj=BZ)=CheWy!nrDWPyNA&K0@Kx>_@3xUd_}xTT)nC(EVs%p zIE^?#vid, [0 => _('*** unassigned ***')]); +$opt_state = db_load_enum('maintenance', 'maintstate', true, true); // ========== ACTIONS START =================================================== @@ -50,6 +53,8 @@ switch ($submit = form_get_action()) { $p[':eid'] = gpc_get_int($_POST, 'eid'); $p[':activities'] = gpc_get_string($_POST, 'activities', 80); $p[':remarks'] = gpc_get_string($_POST, 'remarks', 150); + $p[':series'] = gpc_get_int($_POST, 'series'); + $p[':maintstate'] = gpc_get_string($_POST, 'maintstate'); db_exec_update('maintenance', $p, 'maintid'); $action = ACT_VIEW; break; @@ -87,7 +92,7 @@ $opt_special = array(
    Filter
    - +
    \n"; +echo '\n"; +echo '\n"; echo "
    #' . _('Type') . "" . _('Used by') . "
    ", $ref['reftype'], "", $i; + if ($ref['reftype'] == 'equipment') { + echo ''; + } elseif ($ref['reftype'] == 'company') { + echo ''; + } + echo "", get_enum($ref['reftype']), "", $ref['target'], ""; - if ($ref['reftype'] == 'equipment') { - echo ''; - } elseif ($ref['reftype'] == 'company') { - echo ''; - } echo ''; echo "
    "; echo '', "\n"; @@ -885,9 +971,16 @@ function form_tag_assignment($script, $id, $tags) { echo "
    ', _('Remarks'),"", $maint->remarks, "
    ', _('Series'),"", $maint->series, "
    ', _('State'),"", get_enum($maint->maintstate), "
    \n"; echo '
    '; // Column break @@ -301,12 +308,10 @@ echo '\n"; echo "
    \n"; - - elseif ($action == ACT_EDIT): // ========== VARIANT: edit single record ===================================== -$sql = "SELECT activities, eid, remarks " +$sql = "SELECT activities, eid, remarks, series, maintstate " . "FROM maintenance " . "WHERE maintid=?"; $sth = $pdo->prepare($sql); @@ -327,7 +332,12 @@ echo '

    ', _('Edit Maintenance'), "

    \n"; +
    + + +
    maintstate); form_edit_buttons($g_scriptname, $id); echo "\n"; diff --git a/webgui/manual.php b/webgui/manual.php index 01039c0..d77bf65 100644 --- a/webgui/manual.php +++ b/webgui/manual.php @@ -1,7 +1,7 @@ Yacht Management System -

    Hinweis: Es handelt sich hier um einen Prototyp!

    +

    + +Hinweis: Es handelt sich hier um einen Prototypen! +Einige Funktionen sind noch nicht oder nicht vollständig implementiert. +Rückmeldungen sind immer willkommen!

    Integriertes Handbuch

    @@ -128,6 +132,7 @@ Es handelt sich um die Eingabemöglichkeit in ein einzelnes Textfeld.

    Benutzer

    Benutzer können nicht über die Web-GUI eingerichtet werden.

    +

    Eine Kennwortänderung ist ebenfalls nicht über die Web-GUI möglich.

    Es gibt die Berechtigungsebenen Kapitän (captain), Steuermann (helmsman) und Matrose (sailor). diff --git a/webgui/measurement.php b/webgui/measurement.php index 8c9fc8e..af09d5b 100644 --- a/webgui/measurement.php +++ b/webgui/measurement.php @@ -1,12 +1,14 @@ ". $row['projname'] ."\n"; echo "". $row['startdate'] ."\n"; echo "". $row['duration'] ."\n"; - echo "". $row['projstate'] ."\n"; + echo "". get_enum($row['projstate']) ."\n"; echo "". $row['remarks'] ."\n"; // Edit current record button echo ""; @@ -228,8 +230,8 @@ echo '', "\n"; echo "\n"; echo ""; echo ''; -echo ""; -echo ""; +echo ""; +echo ""; echo "\n"; echo "\n"; @@ -243,8 +245,8 @@ foreach ($res as $row) { echo '\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; // Edit current record button echo "\n"; echo '\n"; echo '\n"; -echo '\n"; +echo '\n"; echo '\n"; echo "
    #" . _('Name') . "" . _('State') . "", _('Name'), "", _('State'), "
    ', $i; echo '', "\n"; echo "". $row['taskname'] ."". $row['taskstate'] ."", $row['taskname'], "", get_enum($row['taskstate']), ""; echo '', "\n"; @@ -297,7 +299,7 @@ echo '
    ', _('Name'),"", $project-> echo '
    ', _('Responsible'),"", $opt_user[$project->responsible], "
    ', _('Start date'),"", $project->startdate, "
    ', _('Duration'),"", $project->duration, "
    ', _('State'),"", $project->projstate, "
    ', _('State'),"", get_enum($project->projstate), "
    ', _('Remarks'),"", nl2br($project->remarks), "
    \n"; @@ -309,21 +311,30 @@ echo "

    ", _('Assigned tasks'), "

    \n"; $sql = "SELECT taskid, taskname FROM task WHERE projid=? ORDER BY taskname"; $sth = $pdo->prepare($sql); $sth->execute([$id]); +$res = $sth->fetchAll(); +if (empty($res)) { + echo "

    ", _('No assigned tasks found.'),"

    \n"; +} else { ?> + -fetchAll() as $row): ?> - - - - - -
    #
    "; + echo "", $i++, ""; + echo "", $row['taskname'], ""; + form_action_buttons('task.php', $row['taskid']); + echo "\n"; +} // endforeach; + echo "\n"; +} // not empty + form_add_button('task.php', $id, 'projid'); elseif ($action == ACT_EDIT): diff --git a/webgui/provisions.php b/webgui/provisions.php index 42b5f35..cd844d1 100644 --- a/webgui/provisions.php +++ b/webgui/provisions.php @@ -7,6 +7,8 @@ ******************************************************************************/ require 'globals.inc'; +require 'lib/gpc.inc'; + $pagetitle=_('Provisions'); $id = gpc_get_int($_REQUEST, 'id', 0); diff --git a/webgui/search.php b/webgui/search.php index 501e6e2..f381b05 100644 --- a/webgui/search.php +++ b/webgui/search.php @@ -1,12 +1,14 @@