noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
Default_Menu Class Reference

Description of class_default_menu. More...

+ Collaboration diagram for Default_Menu:

Public Member Functions

 __construct ()
 
 get ($p_string)
 
 input_value ()
 
 save ()
 
 set ($p_string, $p_value)
 
 verify ()
 

Private Member Functions

 check_code ($p_string)
 

Private Attributes

 $a_menu_def
 $a_menu_def is an array of Default_Menu_SQL
 
 $code
 Possible values code_follow,code_invoice,code_feenote.
 

Detailed Description

Description of class_default_menu.

Author
dany

Definition at line 28 of file default_menu.class.php.

Constructor & Destructor Documentation

◆ __construct()

Default_Menu::__construct ( )

Definition at line 41 of file default_menu.class.php.

42 {
43 global $cn;
44 $menu = new Default_Menu_SQL($cn);
45 $ret = $menu->seek();
46 for ($i = 0; $i < Database::num_row($ret); $i++)
47 {
48 $tmenu = $menu->next($ret, $i);
49 $idx = $tmenu->getp('md_code');
50 $this->a_menu_def[$idx] = $tmenu->getp('me_code');
51 }
52 $this->code = explode(',', 'code_follow,code_invoice,code_feenote',);
53 }
static num_row($ret)
wrapper for the function pg_num_rows

References $cn, $i, $idx, $menu, $ret, and DatabaseCore\num_row().

+ Here is the call graph for this function:

Member Function Documentation

◆ check_code()

Default_Menu::check_code ( $p_string)
private

Definition at line 72 of file default_menu.class.php.

73 {
74 global $cn;
75 $count = $cn->get_value('select count(*) from v_menu_description_favori where '
76 . 'code = $1', array($p_string));
77 if ($count != 0)
78 {
79 return ;
80 }
81 $count = $cn->get_value('select count(*) from menu_ref where '
82 . 'me_code = $1', array($p_string));
83 if ($count != 0)
84 {
85 return ;
86 }
87 throw new Exception('code_inexistant');
88 }
$count

References $cn, $count, and return.

Referenced by verify().

◆ get()

Default_Menu::get ( $p_string)

Definition at line 106 of file default_menu.class.php.

107 {
108 return $this->a_menu_def[$p_string];
109 }

◆ input_value()

Default_Menu::input_value ( )

Definition at line 55 of file default_menu.class.php.

56 {
57 $code_invoice = new IText('code_invoice', $this->a_menu_def['code_invoice']);
58 $code_follow = new IText('code_follow', $this->a_menu_def['code_follow']);
59 $code_feenote = new IText('code_feenote', $this->a_menu_def['code_feenote']);
60 echo '<div class="form-group">';
61 echo '<div class="form-text">' .'<label for="code_invoice">'._('Code AD pour création facture depuis gestion').
62 "</label>"."</div>". '<div class="form-text">' .$code_invoice->input() . '</div>';
63
64 echo '<div class="form-text">' .'<label for="code_follow">'._('Code AD pour appel gestion').
65 "</label>"."</div>". '<div class="form-text">' .$code_follow->input() . '</div>';
66
67 echo '<div class="form-text">' .'<label for="code_feenote">'._('Code AD pour création note de frais ou facture achat').
68 "</label>"."</div>". '<div class="form-text">' .$code_feenote->input() . '</div>';
69 echo '</div>';
70 }
_("actif, passif,charge,...")

References _.

◆ save()

Default_Menu::save ( )

Definition at line 111 of file default_menu.class.php.

112 {
113 global $cn;
114 try
115 {
116 $this->verify();
117 foreach ($this->a_menu_def as $key => $value)
118 {
119 $cn->exec_sql('update menu_default set me_code=$1 where
120 md_code =$2', array($value,$key));
121 }
122 } catch (Exception $e)
123 {
124 record_log($e);
125 echo $e->getMessage();
126 throw $e;
127 }
128 }
record_log($p_message)
Record an error message into the log file of the server or in the log folder of NOALYSS Record also t...

References $cn, $e, $value, record_log(), and verify().

+ Here is the call graph for this function:

◆ set()

Default_Menu::set ( $p_string,
$p_value )

Definition at line 98 of file default_menu.class.php.

99 {
100 if (in_array($p_string, $this->code) == false)
101 {
102 throw new Exception("code_invalid");
103 }
104 $this->a_menu_def[$p_string] = $p_value;
105 }

◆ verify()

Default_Menu::verify ( )

Definition at line 90 of file default_menu.class.php.

91 {
92 foreach ($this->code as $code)
93 {
94 $this->check_code($this->a_menu_def[$code]);
95 }
96 }
$code
Possible values code_follow,code_invoice,code_feenote.
check_code($p_string)

References $code, and check_code().

Referenced by save().

+ Here is the call graph for this function:

Field Documentation

◆ $a_menu_def

Default_Menu::$a_menu_def
private

$a_menu_def is an array of Default_Menu_SQL

Definition at line 34 of file default_menu.class.php.

◆ $code

Default_Menu::$code
private

Possible values code_follow,code_invoice,code_feenote.

array with the valid code

Definition at line 39 of file default_menu.class.php.

Referenced by verify().


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