Fixe bilan views index page create and display
authorwww-data <www-data@n3150.home>
Sun, 2 Jan 2022 21:27:32 +0000 (22:27 +0100)
committerwww-data <www-data@n3150.home>
Sun, 2 Jan 2022 21:27:32 +0000 (22:27 +0100)
app/compta/views/bilan_index.php

index ce215c4c69131de7ca0440cf7e3d5442e5a6d8a6..5ca86ff19563defc1d358d0811bd77e5b2cbf990 100644 (file)
@@ -1,7 +1,9 @@
 <?php
+namespace compta\views\bilan; 
 require_once(dirname(__FILE__)."/../pages.php");
 require_once(dirname(__FILE__)."/../api_pcmn.php");
 
+global $XmlComptaBudget;
 $XmlComptaBudget =  <<<XML
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <?xslt-param name='alias' value='/andre/'?>
@@ -61,11 +63,20 @@ XML;
  * @brief Update GUI with the list of 
  * documents available. All decomptes
  */
-class PageBilan extends PageCompta {
+class Index extends \PageCompta
+       implements \IActionResult 
+{
 
-  function __construct($s,$b)
+  function __construct()
   {
-        parent::__construct($s,$b);
+        //$page = new PageBilan($XmlComptaBudget,true);
+        global $XmlComptaBudget;
+        parent::__construct($XmlComptaBudget,true);
+  }
+
+  public function render()
+  {
+      $this->show();
   }
 
   /**
@@ -122,7 +133,7 @@ _EOF;
 _EOF;
 $frag    = "";
         $_cfg = $this->_auth_cfg;
-        $pcmn = new Pcmn( $this->getSession()
+        $pcmn = new \Pcmn( $this->getSession()
                  , $_cfg
          , $this->getSession()->getDb());
        $lst = $pcmn->getBilan(
@@ -141,13 +152,5 @@ $frag    = "";
     }
 
 }
-/* Main entry */
-$page = new PageBilan($XmlComptaBudget,true);
-
-/**
- * Should I make the checks here ? I wonder 
- * if this is required
- */
-$page->show();
 
 ?>