<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hallo Ivo,</p>
    <p>die onBefore*-Attribute werden als PHP-Anweisungen interpretiert.
      Demnach kann die "date"-Funktion von PHP verwendet werden:</p>
    <p class="MsoNormal"><font face="monospace">      onBeforeSave:
        '$feature->setAttribute(''created_user'', $user);
        $feature->setAttribute(''update_time'', date("c"));'</font></p>
    <p></p>
    <p>Siehe PHP-Dokumentation:
      <a class="moz-txt-link-freetext" href="https://www.php.net/manual/en/function.date.php">https://www.php.net/manual/en/function.date.php</a>, das "c" steht für
      einen Zeitstempel im ISO-8601-Format, der von den meisten
      Datenbanken, definitiv in Postgres, verstanden wird (siehe
      <a class="moz-txt-link-freetext" href="https://www.php.net/manual/en/datetime.format.php">https://www.php.net/manual/en/datetime.format.php</a>).</p>
    <p>Eine mögliche Alternative wäre einen Trigger für die Datenbank zu
      schreiben, der das Datum bei jeder Aktualisierung, egal von
      welcher Anwendung heraus, aktualisiert, wie z.B. hier beschrieben:
      <a class="moz-txt-link-freetext" href="https://stackoverflow.com/a/1036010/2549828">https://stackoverflow.com/a/1036010/2549828</a></p>
    <p>Viel Erfolg!</p>
    <p>Thorsten Hack</p>
    <pre class="moz-signature" cols="72">-- 
**********************************
Where2B Konferenz 2023
14. Dezember 2023 in Bonn und Online
<a class="moz-txt-link-freetext" href="https://where2b-conference.com/">https://where2b-conference.com/</a>
********************************** 

WhereGroup GmbH
Schwimmbadstr. 2
79100 Freiburg
Germany

Tel.: +49 (0)761 / 519 102 - 67
Fax: +49 (0)761 / 519 102 - 11

<a class="moz-txt-link-abbreviated" href="mailto:thorsten.hack@wheregroup.com">thorsten.hack@wheregroup.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.wheregroup.com">www.wheregroup.com</a>
Geschäftsführer:
Olaf Knopp, Peter Stamm 
Amtsgericht Bonn, HRB 9885</pre>
    <p></p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">Am 25.11.23 um 22:24 schrieb
      Geodienstleistungen Ivo Partschefeld via Mapbender_users:<br>
    </div>
    <blockquote type="cite"
      cite="mid:002901da1fe5$d79b9340$86d2b9c0$@geodienstleistung.de">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator"
        content="Microsoft Word 15 (filtered medium)">
      <style>@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-ligatures:standardcontextual;
        mso-fareast-language:EN-US;}span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}div.WordSection1
        {page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hallo,<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">wie kann ich das aktuelle Datum in meine
          Datenbank schreiben, wenn ich im Digitizer speichere?<o:p></o:p></p>
        <p class="MsoNormal">Ich habe folgenden eventBefehl:<o:p></o:p></p>
        <p class="MsoNormal">      onBeforeSave:
          '$feature->setAttribute(''created_user'', $user);'<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Jetzt soll dahinter noch ein Befehl, damit
          ich das aktuelle Datum in die Spalte „Datum“ speichern kann.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">In der Doku beim Datamanager
          (<a class="moz-txt-link-freetext" href="https://doc.mapbender.org/de/elements/editing/datamanager.html">https://doc.mapbender.org/de/elements/editing/datamanager.html</a>)
          finde ich den Hinweis: <o:p></o:p></p>
        <p class="MsoNormal">„text: "'user: ' + data.user_of_last_edit +
          ' Datum:' + data.date_of_creation\n"“<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Keine Ahnung ob ich das nehmen kann.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Oder gibt feste Variablen in Analogie zu
          $user und $userRoles?<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><span
style="font-size:10.5pt;font-family:Consolas;mso-ligatures:none;mso-fareast-language:DE">Viele
            Grüße und Danke<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:10.5pt;font-family:Consolas;mso-ligatures:none;mso-fareast-language:DE">Ivo</span><o:p></o:p></p>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Mapbender_users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Mapbender_users@lists.osgeo.org">Mapbender_users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/mapbender_users">https://lists.osgeo.org/mailman/listinfo/mapbender_users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">
</pre>
  </body>
</html>