Allow editing of booking texts
[infodrom.org/service.infodrom.org] / src / InfoCon / buch / list.wml
index 422c179..100dc5d 100644 (file)
@@ -1,6 +1,8 @@
 #include <infocon.style>
 
+<future>
 <page func=InfoCon title="Buchhaltung">
+<script type="text/javascript" src="<root_prefix>jquery.editable.js"></script>
 
 <?
   $dbh = pg_pconnect ("<dbhost>", "<dbport>", "<dbname>")
@@ -36,7 +38,7 @@ if ($_POST["submit"] == "List") {
     $where[] = "price < 0.0";
   }
 
-  $query = "SELECT date,billing_date,oid,category,description,price FROM $table ";
+  $query = "SELECT nr,date,billing_date,category,description,price FROM $table ";
   if (count($where) > 0) {
     $query .= " WHERE " . implode ($where, " AND ");
   }
@@ -61,8 +63,8 @@ if ($_POST["submit"] == "List") {
     printf ("<td width=\"10%%\" align=\"right\">%s</td>", $date);
     printf ("<td width=\"10%%\" align=\"right\">%s</td>", $billing_date);
     printf ("<td width=\"10%%\" align=\"center\">%s</td>", $row['category']);
-    printf ("<td width=\"0%%\"><a href=\"edit.php?oid=%d\">%s</a></td>",
-      $row['oid'], $row['description']);
+    printf ("<td width=\"0%%\"><span class=\"edit\" route=\"Sales/EditDescription\" item_id=\"%d\">%s</span></td>",
+      $row['nr'], $row['description']);
     printf ("<td width=\"10%%\" align=\"right\">%5.2f</td>", $row['price']);
     $sum += $row['price'];
     echo ("</tr>");
@@ -239,6 +241,13 @@ function tally ($dbh, $head, $where, $class)
 ?>
 <div style="padding-top: 5px;"></div>
 
+<script type="text/javascript">
+<protect>
+$(function(){
+    make_editable('table.smallfont tr span.edit');
+});
+</protect>
+</script>
 </page>
 
 # Local variables: