noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
Noalyss\Widget\Mini_Report Class Reference

display simple report in a widget on the DASHBOARD More...

+ Inheritance diagram for Noalyss\Widget\Mini_Report:
+ Collaboration diagram for Noalyss\Widget\Mini_Report:

Public Member Functions

 display ()
 show the simple report from USER_WIDGET.WD_PARAMETER
 
 display_parameter ()
 Display the parameter of the form.
 
 input_parameter ()
 select the simple report (FORM_DEFINITION) to display
 
- Public Member Functions inherited from Noalyss\Widget\Widget
 __construct (protected int $user_widget_id=0, protected string $widget_code="", protected $db=null)
 
 button_zoom ()
 compute the button ZOOM to put in the title
 
 close_div ()
 
 get_div_domid ()
 compute the DIV ID
 
 get_parameter ()
 get the parameter of the widget and returns an array
 
 get_user_widget_id ()
 
 get_widget_code ()
 
 input ($flnumber=true)
 display a description of the widget and allow to save it for the current user, call input_param function of the widget if it exists
 
 make_form ($html_input)
 open a form with the DOMID "widget_code"_param, it appears once only for each widget in the dialog box for adding widget to the dashboard
 
 open_div ()
 output the DIV HTML with class and id for the widget
 
 set_user_widget_id (int $user_widget_id)
 
 set_widget_code (string $widget_code)
 
 title ( $title)
 display the title and the icon for zooming
 

Additional Inherited Members

- Static Public Member Functions inherited from Noalyss\Widget\Widget
static ajax_display (Widget $widget)
 display a box and fills it with the content of an ajax calls , the ajax calls Widget::display
 
static build_user_widget ($user_widget_id, $widget_code)
 Build a widget thank the user_widget_id (SQL :PK : USER_WIDGET.UW_ID) and $widget_code.
 
static display_available ()
 @brier display activated widgets
 
static get_enabled_widget ()
 returns an array of widget for the connected user, ordered
 
static save ($array)
 save widget order from an array
 
static scanfolder ()
 scan folder to find install.php file , include them if the code is not in DB
 
static select_available ()
 show all the widget that can be added
 

Detailed Description

display simple report in a widget on the DASHBOARD

Note
this widget is included in Noalyss Core and a part of the code (javascript + css + ajax) are still included in NOALYSS Code, this code should move here and will be part of a "cleansing code" process

Definition at line 37 of file mini_report.php.

Member Function Documentation

◆ display()

Noalyss\Widget\Mini_Report::display ( )

show the simple report from USER_WIDGET.WD_PARAMETER

Returns
void
Exceptions

Exception

Reimplemented from Noalyss\Widget\Widget.

Definition at line 44 of file mini_report.php.

45 {
46 global $g_user, $cn;
47
48 $param = $this->db->get_value("select uw_parameter from user_widget where uw_id=$1",[$this->user_widget_id]);
49 parse_str($param, $aReport);
50 $report=$aReport['simple_report'];
51 $rapport = new \Acc_Report($cn, $report);
52
53 if ($rapport->exist() == false) {
54 $report = 0;
55 }
56 $this->open_div();
57 if ($report != 0) {
58 $report_id=$this->get_div_domid();
59 ?>
60 <?php echo $this->title($rapport->get_name()) ;?>
61
62 <?php
63 $exercice = $g_user->get_exercice();
64 if ($exercice == 0) {
65 alert(_('Aucune periode par defaut'));
66 } else {
67 $a=$g_user->get_periode();
68 $result = $rapport->get_row($a, $a, 'periode');
69 $ix = 0;
70 if (!empty ($result) && count($result) > 0) {
71 echo '<table class="result">';
72 foreach ($result as $row) {
73 $ix++;
74 $class = ($ix % 2 == 0) ? ' class="even" ' : ' class="odd" ';
75 echo '<tr ' . $class . '>';
76
77 echo '<td> ' . $row['desc'] . '</td>';
78 $style = 'style="text-align:right;"';
79 if ($row['montant'] < 0) {
80 $style = 'style="color:red;text-align:right;"';
81 }
82 echo "<td $style>" . nbm($row['montant']) . "</td>";
83 echo '</tr>';
84 }
85 echo '</table>';
86 } else {
87 echo _('Aucun résultat');
88 }
89 }
90 }
91 $this->close_div();
92 }
nbm($p_number, $p_dec=2)
format the number with a sep.
alert($p_msg, $buffer=false)
alert in javascript
global $g_user
if no group available , then stop
catch(Exception $e) $exercice
_("actif, passif,charge,...")
$anc_filter title
$report
$SecUser db

References $a, $class, $cn, $exercice, $g_user, $ix, $report, $result, $row, $style, _, alert(), Noalyss\Widget\Widget\close_div(), db, Noalyss\Widget\Widget\get_div_domid(), nbm(), Noalyss\Widget\Widget\open_div(), and title.

+ Here is the call graph for this function:

◆ display_parameter()

Noalyss\Widget\Mini_Report::display_parameter ( )

Display the parameter of the form.

Returns
void

Reimplemented from Noalyss\Widget\Widget.

Definition at line 111 of file mini_report.php.

111 {
112 $aParam= $this->get_parameter();
113 $name = $this->db->get_value("select fr_label from form_definition where fr_id=$1",[$aParam['simple_report']]);
114 echo " ";
115 echo span(_("Rapport") ." ".h($name),'class="widget_param"');
116
117
118 }
span($p_string, $p_extra='')
Definition ac_common.php:43
h( $row[ 'oa_description'])

References $name, _, db, Noalyss\Widget\Widget\get_parameter(), h, and span().

+ Here is the call graph for this function:

◆ input_parameter()

Noalyss\Widget\Mini_Report::input_parameter ( )

select the simple report (FORM_DEFINITION) to display

See also
Widget::make_form()
Returns
void

Reimplemented from Noalyss\Widget\Widget.

Definition at line 99 of file mini_report.php.

99 {
100
101 $select=new \ISelect('simple_report');
102 $select->value=$this->db->make_array("select fr_id, fr_label from form_definition order by 2");
103
104 $this->make_form($select->input());
105 }

References $select, db, and Noalyss\Widget\Widget\make_form().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: