Description of class_default_menu.
More...
Description of class_default_menu.
- Author
- dany
Definition at line 28 of file default_menu.class.php.
◆ __construct()
Default_Menu::__construct |
( |
| ) |
|
Definition at line 41 of file default_menu.class.php.
42 {
47 {
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().
◆ check_code()
Default_Menu::check_code |
( |
|
$p_string | ) |
|
|
private |
Definition at line 72 of file default_menu.class.php.
73 {
75 $count =
$cn->get_value(
'select count(*) from v_menu_description_favori where '
76 . 'code = $1', array($p_string));
78 {
79 throw new Exception('code_inexistant');
80 }
81 }
References $cn, and $count.
Referenced by verify().
◆ get()
Default_Menu::get |
( |
|
$p_string | ) |
|
◆ 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 }
◆ save()
Definition at line 104 of file default_menu.class.php.
105 {
107 try
108 {
110 foreach ($this->code as $key =>
$value)
111 {
112 $cn->exec_sql(
'update menu_default set me_code=$1 where
114 }
115 }
catch (Exception
$e)
116 {
118 echo
$e->getMessage();
120 }
121 }
record_log($p_message)
Record an error message into the log file of the server.
References $cn, $e, $value, record_log(), and verify().
◆ set()
Default_Menu::set |
( |
|
$p_string, |
|
|
|
$p_value |
|
) |
| |
Definition at line 91 of file default_menu.class.php.
92 {
93 if (in_array($p_string, $this->code) == false)
94 {
95 throw new Exception("code_invalid");
96 }
97 $this->a_menu_def[$p_string] = $p_value;
98 }
◆ test_me()
static Default_Menu::test_me |
( |
| ) |
|
|
static |
Definition at line 123 of file default_menu.class.php.
124 {
126
127 echo
h2(
'Constructor',
'');
130 if (count(
$a->a_menu_def) != 2)
132 else
134 echo
h2(
"input_value",
"");
138 try {
139 echo
h2(
'Verify must failed');
140 $a->set(
'code_follow',
'MEMNU/MEMEM/');
142 }
catch (Exception
$e) {
144 }
145 echo
h2(
'Verify must succeed');
146 try {
147 $a->set(
'code_follow',
'GESTION/FOLLOW');
150 }
catch (Exception
$e)
151 {
153 }
157 echo ( assert(
$a->get(
'code_follow')==
'GESTION/FOLLOW') )?
$g_succeed.$a->get(
'code_follow'):
$g_failed.$a->get(
'code_follow');
158 echo ( assert(
$a->get(
'code_invoice')==
'COMPTA/VENMENU/VEN') )?
$g_succeed.$a->get(
'code_invoice'):
$g_failed.$a->get(
'code_invoice');
159 echo
$a->get(
'code_invoice');
160 }
h2($p_string, $p_class="", $raw="")
global $g_user
if no group available , then stop
References $a, $cn, $e, $g_failed, $g_succeed, $g_user, and h2().
◆ verify()
◆ $a_menu_def
Default_Menu::$a_menu_def |
|
private |
◆ $code
The documentation for this class was generated from the following file: