Allow to edit account description in place
[infodrom.org/service.infodrom.org] / src / InfoCon / account / list.wml
index adf4c54..292cbca 100644 (file)
@@ -70,8 +70,12 @@ function filter_account()
     $out .= sprintf ("<tr class=\"t%d\">", $color);
     $out .= sprintf ("<td width=\"10%%\" align=\"right\">%s</td>", $date);
     $out .= sprintf ("<td width=\"10%%\" align=\"center\">%s</td>", $row['category']);
-    $out .= sprintf ("<td width=\"70%%\"><a href=\"edit.php?id=%d%s\" target=\"_new\">%s</a></td>",
-           $row['id'], $add, $descr[0]);
+    if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla/') === false)
+      $out .= sprintf ("<td width=\"70%%\"><a href=\"edit.php?id=%d%s\" target=\"_new\">%s</a></td>",
+                      $row['id'], $add, $descr[0]);
+    else
+      $out .= sprintf ("<td width=\"70%%\"><span route=\"Accounting/EditDescr\" item_id=\"%d\" text=\"%s\">%s</span></td>",
+                      $row['id'], $add, $descr[0]);
     $out .= sprintf ("<td width=\"10%%\" align=\"right\" class=\"%s\">%5.2f</td>",
       $row[$value]>0?"in":"out", $row[$value]);
     $sum += $row[$value];
@@ -156,6 +160,7 @@ $(function(){
     });
     $('body').append('<script type="text/javascript" src="../../jquery.udraggable.js"><\/script>');
     $('body').append('<script type="text/javascript" src="../../jquery.event.ue.js"><\/script>');
+    $('body').append('<script type="text/javascript" src="../../jquery.editable.js"><\/script>');
 });
 
 //+ Jonas Raoni Soares Silva
@@ -202,6 +207,7 @@ function filter_popup()
                             'ajax=1&'+$('#filter_popup form').serialize(),
                             function(data){
                                 $('table.border tbody').html(UTF8.decode(data));
+                                make_editable('table.smallfont tr span');
                             });
                      return false;
                  });
@@ -212,6 +218,7 @@ function filter_popup()
                             function(data){
                                 $('table.border tbody').html(UTF8.decode(data));
                                 $('#filter_popup').hide();
+                                make_editable('table.smallfont tr span');
                             });
                      return false;
                  });