noalyss Version-9
module.php
Go to the documentation of this file.
1<?php
2//This file is part of NOALYSS and is under GPL
3//see licence.txt
4?>
5<div id="top">
6 <div id="dossier">
7 <?php echo h(dossier::name())?>
8 </div>
9 <div style="clear:both;"></div>
10 <div class="name">
11
12<?php
13$http=new HttpInput();
14if ( $cn->get_value("select count(*) from profile join profile_user using (p_id)
15 where user_name=$1 and with_calc=true",array($_SESSION[SESSION_KEY.'g_user'])) ==1):
16 echo '<div id="calc">';
17 echo IButton::show_calc();
18echo '</div>';
20
21// show search card
22if ( $cn->get_value("select count(*) from profile join profile_user using (p_id)
23 where user_name=$1 and with_search_card=1",array($_SESSION[SESSION_KEY.'g_user'])) ==1):
24 $search_card=new IText('card_search');
25 $search_card->css_size='97%';
26 $search_card_js=sprintf('onclick="boxsearch_card(\'%d\')"',dossier::id());
27 echo Icon_Action::card( "$('box_search_card').show()");
28 echo '<div id="box_search_card" style="display:none;width:20rem" class="inner_box">';
29 echo HtmlInput::title_box(_("recherche"), "box_search_card","hide");
30 echo _('Recherche de fiche');
31 echo '<p class="info">';
32 echo _("Donnez une partie du nom, prénom, de la description, du poste comptable, du n° de TVA,quick code ... "
33 . " de la fiche" ) ;
34 echo '</p>';
35 echo '<p class="ml-1">';
36 echo $search_card->input();
37 echo '</p>';
38 $create_card_js='onclick="select_card_type({});"';
39 echo '<ul class="aligned-block">';
40
41 echo '<li>'.
42 HtmlInput::button_anchor(_("Chercher"),"javascript:void(0)","",$search_card_js,'button').
43 '</li>';
44
45 echo '<li>'.
46 HtmlInput::button_anchor(_("Créer fiche"),"javascript:void(0)","",$create_card_js,'button').
47 '</li>';
48
49 echo '<li>'.
50 HtmlInput::button_hide("box_search_card").
51 '</li>';
52 echo '</ul>';
53 echo '</div>';
54endif;
55
56
57if ( $cn->get_value("select count(*) from profile join profile_user using (p_id)
58 where user_name=$1 and with_direct_form=true",array($_SESSION[SESSION_KEY.'g_user'])) ==1):
59?>
60 <div id="direct">
61 <form method="get" onsubmit="if (document.getElementById('ac').value.trim() =='') {return false;} else {return true;}">
62 <?php echo $http->request('ac',"string", '')?>
63 <?php echo Dossier::hidden()?>
64 <?php
65
66 $direct=new IText('ac');
67 $direct->style='class="input_text"';
68 $direct->value='';
69 $direct->size=20;
70 echo $direct->input();
72 ?>
73 <div id="ac_choices" class="autocomplete" style="width:150"></div>
74 <?php
75 echo HtmlInput::submit('go',_('Aller'));
76 ?>
77
78 </form>
79 <script>
80
81 try {
82 new Ajax.Autocompleter("ac","ac_choices","direct.php?gDossier=<?php echo $gDossier?>",
83 {paramName:"acs",minChars:1,indicator:null,
84 callback:null,
85 afterUpdateElement:null});} catch (e){$('info_div').innerHTML=e.message;};
86 </script>
87 </div>
88<?php
89endif;?>
90
91 </div>
92
93 <div id="module">
94 <div class="d-none d-md-block">
95 <ul class="nav nav-pills nav-fill flex-row" >
96 <?php
97 foreach ($amodule as $row):
98 $js="";
99 $style="";
100 if ( $row['me_code']=='new_line')
101 {
102 echo '</ul>';
103 echo '<ul class="nav nav-pills nav-fill flex-row" >';
104 continue;
105 }
106 $style="nav-item-module";
107 if ($row['me_code']==$selected_module)
108 {
109 $style='nav-item-active';
110 }
111 if ( $row['me_url']!='')
112 {
113 $url=$row['me_url'];
114 }
115 elseif ($row['me_javascript'] != '')
116 {
117 $url="javascript:void(0)";
118 $js_dossier=noalyss_str_replace('<DOSSIER>', Dossier::id(), $row['me_javascript']);
119 $js=sprintf(' onclick="%s"',$js_dossier);
120 }
121 else
122 {
123 $url="do.php?gDossier=".Dossier::id()."&ac=".$row['me_code'];
124 }
125 ?>
126 <li class="<?php echo $style?>">
127 <a class="nav-link" href="<?php echo $url?>" title="<?php echo _($row['me_description']??''); ?>" <?php echo $js?> ><?php echo gettext($row['me_menu'])?></a>
128 </li>
129 <?php
131 ?>
132 </ul>
133
134 </div>
135 <div class="d-md-none navbar-light" >
136 <button id="showmodule" class="navbar-toggler" onclick="toggleHideShow('navbarToggleExternalContent','showmodule')">
137 <span class="navbar-toggler-icon"></span>
138 </button>
139 <div style="display:none;position:absolute;top:2px;left:2px;z-index:10" id="navbarToggleExternalContent">
140 <ul class="nav nav-pills nav-fill flex-column bg-dark" >
141 <?php
142 foreach ($amodule as $row):
143 $js="";
145
146 $style="nav-item-module";
147 if ( $row['me_code']=='new_line')
148 {
149 continue;
150 }
151 if ($row['me_code']==$selected_module)
152 {
153 $style='nav-item-active';
154 }
155 if ( $row['me_url']!='')
156 {
157 $url=$row['me_url'];
158 }
159 elseif ($row['me_javascript'] != '')
160 {
161 $url="javascript:void(0)";
162 $js_dossier=noalyss_str_replace('<DOSSIER>', Dossier::id(), $row['me_javascript']);
163 $js=sprintf(' onclick="%s"',$js_dossier);
164 }
165 else
166 {
167 $url="do.php?gDossier=".Dossier::id()."&ac=".$row['me_code'];
168 }
169 ?>
170 <li class="<?php echo $style?>">
171 <a class="nav-link" href="<?php echo $url?>" title="<?php echo _($row['me_description']??"")?>" <?php echo $js?> ><?php echo gettext($row['me_menu'])?></a>
172 </li>
173 <?php
175 ?>
176 </ul>
177 </div>
178
179 </div>
180
181</div>
182</div>
183<div style="clear:both;"></div>
span($p_string, $p_extra='')
Definition: ac_common.php:43
noalyss_str_replace($search, $replace, $string)
Definition: ac_common.php:1553
if(isset($tot['tva'][$a]))($tot['tva'][$a])?></td ><?php else endforeach
h( $row[ 'oa_description'])
$url
$from_poste name
$input_from id
Definition: balance.inc.php:63
static id()
return the 'gDossier' value after a check
static hidden()
return a string to set gDossier into a FORM
static button_hide($div_name)
Hide the HTML popup.
static title_box($p_name, $p_div, $p_mod="close", $p_js="", $p_draggable="n", $p_enlarge='n')
Title for boxes, you can customize the symbol thanks symbol with the mode "custom".
static button_anchor($p_label, $p_value, $p_name="", $p_javascript="", $p_class="smallbutton")
create a button with a ref
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
manage the http input (get , post, request) and extract from an array
static show_calc()
Html Input.
Definition: itext.class.php:30
static card($p_js)
$anc_filter title
if( $delta< 0) elseif( $delta==0)
$gDossier
Definition: module.php:71
foreach($amodule as $row) $style
Definition: module.php:144
$direct style
Definition: module.php:67
$create_card_js
Definition: module.php:38
endif
Definition: module.php:19
$search_card_js
Definition: module.php:26