noalyss Version-9
ajax_misc.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * NOALYSS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with NOALYSS; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21// Copyright Author Dany De Bontridder danydb@aevalys.eu
22
23/**
24 * \file
25 * \brief this file respond to an ajax request
26 * The parameters are
27 * - gDossier
28 * - $op operation the file has to execute
29 * Part 1
30 * dsp_tva fill a ipopup with a choice of possible VAT
31 * - if code is set then fill the field code
32 * - if compute is set then add event to call clean_tva and compute_ledger
33 @see Acc_Ledger_Sale::input
34 * Part 2
35 * dl : display form to modify, add and delete lettering for a given operation
36 *
37 */
38if ( ! defined('ALLOWED')) define ('ALLOWED',1);
39
40require_once '../include/constant.php';
41
42require_once NOALYSS_INCLUDE."/lib/ac_common.php";
43
44global $http;
45$http=new HttpInput();
46
47/* we ask a dg box for disconnecting */
48if ($http->request('op',"string","") == 'disconnect') {
49 ajax_disconnected("reconnect_bx");
50 return ;
51}
52
53/**
54 * if not connected, session is expired then exit with a message NOCONX
55 */
56if ( ! isset($_SESSION[SESSION_KEY."g_user"])) {
57 echo "NOCONX";
58 die();
59}
60
61mb_internal_encoding("UTF-8");
62
63$var = array( 'op');
65/* check if mandatory parameters are given */
66foreach ($var as $v)
67{
68 if (!isset($_REQUEST [$v]))
69 {
70 echo "$v is not set ";
71 $cont = 1;
72 }
73}
74
75// If not connected to a folder
76if ( ! isset($_REQUEST['gDossier'])) {
77 $gDossier=0;
78}
79
80if ($cont != 0) exit();
81
82extract($_REQUEST, EXTR_SKIP );
83
85//
86// If database id == 0 then we are not connected to a folder
87// but to the administration
88//
89if ($gDossier<>0) {
92 $g_user = new Noalyss_user($cn);
93 $g_user->check(true);
94 if ( $g_user->check_dossier($gDossier, true) == 'X' ) {
95 die(_('Non autorisé'));
96 }
97}
98else
99{
100 // connect to repository
101 $cn=new Database();
102 $g_user = new Noalyss_user($cn);
103 $g_user->check(true);
104}
105
106IDate::set_firstDate($g_user->get_first_week_day());
107
108// For progress bar, for saving time , we check and answer directly
109if ($op == "progressBar") {
110 $task_id=$http->request("task_id");
111 $task=new Progress_Bar($task_id);
112 $task->answer();
113 return;
114}
115
116//-------------------------------------------------------------------------------------------
117// check password
118//-------------------------------------------------------------------------------------------
119if ($op=='password_chk') {
120 $cnt = $http->request("pass");
121 $result=check_password_strength($cnt)['msg'];
122 if (count($result) == 0) {
123 echo json_response(["password" => "ok", "msg" => 0]);
124 } else {
125 $str="";
126 foreach ($result as $item) {$str.=sprintf("<li>%s</li>",$item);}
127 echo json_response(["password" => "nok", "msg" => '<ol>'.$str.'</ol>']);
128
129 }
130 return;
131}
132$html = var_export($_REQUEST, true);
134if ( LOGINPUT)
135 {
136 $file_loginput=fopen($_ENV['TMP'].'/scenario-'.$_SERVER['REQUEST_TIME'].'.php','a+');
137 fwrite ($file_loginput,"<?php \n");
138 fwrite ($file_loginput,'//@description:'.$op."\n");
139 fwrite($file_loginput, '$_GET='.var_export($_GET,true));
140 fwrite($file_loginput,";\n");
141 fwrite($file_loginput, '$_POST='.var_export($_POST,true));
142 fwrite($file_loginput,";\n");
143 fwrite($file_loginput, '$_POST[\'gDossier\']=$gDossierLogInput;');
144 fwrite($file_loginput,"\n");
145 fwrite($file_loginput, '$_GET[\'gDossier\']=$gDossierLogInput;');
146 fwrite($file_loginput,"\n");
147 fwrite($file_loginput,' $_REQUEST=array_merge($_GET,$_POST);');
148 fwrite($file_loginput,"\n");
149 fwrite($file_loginput,"include '".basename(__FILE__)."';\n");
150 fclose($file_loginput);
151 }
152$path = array(
153 // search accounting , detail ...
154 "account"=>"ajax_poste",
155 // display card detail :possible to update or add
156 "card"=>"ajax_card",
157 "ledger"=>"ajax_ledger",
158 // Manage ledger access
159 "ledger_access"=>"ajax_user_security",
160 // Manage user profile
161 "profile"=>"ajax_user_security",
162 // enable or not the security on ledger
163 "user_sec_ledger"=>"ajax_user_security",
164 // enable or not the security on action
165 "user_sec_action"=>"ajax_user_security",
166 // Update in once all the ledgers
167 "ledger_access_all"=>"ajax_user_security",
168 // From the page CFGSEC,set the actions
169 "action_access"=>"ajax_user_security",
170 // From the page CFGSEC,set all the actions
171 "action_access_all"=>"ajax_user_security",
172 "todo_list"=>"ajax_todo_list",
173 // Writing operation History for a card or an accounting
174 "history"=>"ajax_history",
175 "mod_doc"=>"ajax_mod_document",
176 // Periode menu: PERIODE
177 'periode'=>"ajax_periode",
178 "mod_predf"=>"ajax_mod_predf_op",
179 "save_predf"=>"ajax_save_predf_op",
180 "search_action"=>"ajax_search_action",
181 "display_profile"=>"ajax_get_profile",
182 "det_menu"=>"ajax_get_menu_detail",
183 "add_menu"=>"ajax_add_menu",
184 "display_submenu"=>"ajax_display_submenu",
185 "remove_submenu"=>"ajax_remove_submenu",
186 "cardsearch"=>"ajax_boxcard_search",
187 "saldo"=>"ajax_bank_saldo",
188 "upd_receipt"=>"ajax_get_receipt",
189 "up_pay_method"=>"ajax_update_payment",
190 "openancsearch"=>"ajax_anc_search",
191 "resultancsearch"=>"ajax_anc_search",
192 "autoanc"=>"ajax_auto_anc_card",
193 "create_menu"=>"ajax_create_menu",
194 "modify_menu"=>"ajax_mod_menu",
195 "mod_stock_repo"=>"ajax_mod_stock_repo",
196 "view_mod_stock"=>"ajax_view_mod_stock",
197 "fddetail"=>"ajax_fiche_def_detail",
198 "vw_action"=>"ajax_view_action",
199 "minrow"=>"ajax_min_row",
200 "navigator"=>"ajax_navigator",
201 "preference"=>"ajax_preference",
202 "bookmark"=>"ajax_bookmark",
203 // Tag
204 "tag_detail"=>"ajax_tag_detail",
205 "tag_save"=>"ajax_tag_save",
206 "tag_list"=>"ajax_tag_list",
207 "tag_add"=>"ajax_tag_add_action",
208 "tag_remove"=>"ajax_tag_remove_action",
209 "tag_choose"=>"ajax_tag_choose",
210 "tag_activate"=>"ajax_tag_save",
211 // search
212 "search_display_tag"=>"ajax_search_display_tag",
213 "search_add_tag"=>"ajax_search_add_tag",
214 "search_clear_tag"=>"ajax_search_clear_tag",
215 "calendar_zoom"=>"ajax_calendar_zoom",
216 "ledger_show"=>"ajax_ledger_show",
217 //Show the available distribution keys for analytic
218 "anc_key_choice"=>"ajax_anc_key_choice" ,
219 //Clean the detail for analytic
220 "anc_key_clean"=>"ajax_anc_key_clean" ,
221 // Show the activities computed with the selected distribution key
222 "anc_key_compute"=>"ajax_anc_key_compute" ,
223 //From admin, revoke the access to a folder from an user
224 "folder_remove"=>"ajax_admin",
225 //From admin, display a list of folder to which the user has no access
226 "folder_display"=>"ajax_admin",
227 // From admin, grant the access to a folder to an
228 // user
229 "folder_add"=>"ajax_admin",
230 // From admin, display info and propose to drop the folder
231 "folder_drop"=>"ajax_admin",
232 // From admin, display the information of a folder you can
233 // modify
234 "folder_modify"=>"ajax_admin",
235 // From admin, display info and propose to drop the template
236 "modele_drop"=>"ajax_admin",
237 // From admin, display the information of a template you can modify
238 "modele_modify"=>"ajax_admin",
239 // From admin , upgrade Noalyss
240 "upgradeCore"=>"ajax_admin",
241 // From admin , upgrade or install plugin
242 "upgradePlugin"=>"ajax_admin",
243 // From admin , install a template
244 "installTemplate"=>"ajax_admin",
245 // From dashboard, display detail about last operation
246 "action_show"=>"ajax_gestion",
247 // From dashboard, display form for a new event
248 "action_add"=>"ajax_gestion",
249 // Save a event given in the short form
250 "action_save"=>"ajax_gestion",
251 /* display the lettering , callebd from acc_ledger : dsp_letter*/
252 "dl"=>"ajax_display_letter",
253 // Add , delete update anc accounting
254 "anc_accounting"=>"ajax_anc_accounting",
255 // Update name and description
256 "anc_updatedescription"=>"ajax_anc_plan",
257 // Update, insert or delete accounting frmo CFGPCMN
258 "accounting"=>"ajax_accounting",
259 // Show detail of an ANC operation
260 "anc_detail_op"=>"ajax_anc_detail_operation",
261 // show history of an analytic account
262 "history_anc_account"=>"ajax_history_anc_account",
263 // Display the list of filter saved
264 "display_search_filter"=>"ajax_search_filter",
265 // Save search filter
266 "save_filter"=>"ajax_search_filter",
267 // Load a search filter
268 "load_filter"=>"ajax_search_filter",
269 // display a list of filter (alias saved search)
270 "display_list_filter"=>"ajax_search_filter",
271 // display tag for filter
272 'display_filter_tag'=>'ajax_search_filter',
273 // search operation to reconcile
274 'search_op'=>'ajax_search_operation',
275 // delete operation
276 'delete_search_operation'=>'ajax_search_filter',
277 // template category of card
278 'template_cat_card'=>'ajax_template_cat_card',
279 // Attribute for category of card
280 'template_cat_category'=>'ajax_template_cat_category',
281 // From FollowUp , update a comment on a file
282 'update_comment_followUp'=>'ajax_follow_up',
283 // Update a follow up's comment
284 'followup_comment_oneedit'=>'ajax_follow_up',
285 // TVA param
286 "tva_parameter"=>"ajax_tva_parameter",
287 // Currency , add / remove / update currency
288 "CurrencyManage"=>"ajax_currency",
289 // Currency , delete a rate
290 "CurrencyRateDelete"=>"ajax_currency",
291 // payment_method
292 "payment_method"=>"ajax_payment_method",
293 // Display all cards using an accounting
294 "display_all_card"=>"ajax_display_all_card",
295 // update list of predefined operation if ledger changes
296 "up_predef"=>"ajax_update_predef",
297 // cfgaction type of document
298 "cfgaction"=>'ajax_cfgaction',
299 // list options for multiple contact
300 "contact_option_list"=>'ajax_contact_option_list',
301 // Add group of tags
302 'tag_group'=>'ajax_tag_group',
303 // set the group for a tag
304 'tag_set_group'=>"ajax_tag_set_group",
305 // Document_state
306 "document_state"=>"ajax_document_state",
307 // Operations tag add
308 'operation_tag_add'=>"ajax_operation_tag",
309 // Operations tag remove
310 'operation_tag_remove'=>"ajax_operation_tag",
311 // Operations tag select
312 'operation_tag_select'=>"ajax_operation_tag",
313 // add or update forecast_item
314 "forecast_item"=>"ajax_forecast_item",
315 // add or update forecast_category
316 "forecast_category"=>"ajax_forecast_category",
317 // manage forecast
318 "forecast"=>"ajax_forecast",
319 // manage company
320 "company"=>"ajax_company",
321 // report definition
322 "report_definition"=>"ajax_report_definition",
323 // search all card , analytic or accounting
324 "search_account_card"=>"ajax_search_account_card",
325 // Mobile device menu from mobile_device_mtable
326 "mobile_device_menu"=>"ajax_mobile_device_menu",
327 // other_tax
328 "other_tax"=>"ajax_other_tax",
329 //visibility quantity
330 "update_visibility_quantity"=>"ajax_update_visibility_quantity",
331 // detail customer , supplier operation
332 "event_display_detail"=>"ajax_event_display_detail",
333 // update periode in opening operation
334 "operation_exercice+update_periode"=>"ajax_operation_exercice",
335 // modify row in exercice (opening/closing) operation
336 "operation_exercice+modify_row"=>"ajax_operation_exercice",
337 // save row in exercice (opening/closing) operation
338 "operation_exercice+save_row"=>"ajax_operation_exercice",
339 // compute the balance after saving row in exercice (opening/closing) operation
340 "operation_exercice+display_total"=>"ajax_operation_exercice",
341 // delete row in exercice (opening/closing) operation
342 "operation_exercice+delete_row"=>"ajax_operation_exercice",
343 // date in exercice (opening/closing) operation
344 "operation_exercice+date"=>"ajax_operation_exercice",
345 // text in exercice (opening/closing) operation
346 "operation_exercice+text"=>"ajax_operation_exercice",
347 // transfer operation to accountancy
348 'operation_exercice+transfer'=>"ajax_operation_exercice",
349 // view list of followup for a card
350 "view_followup_card"=>"ajax_follow_up",
351 //list filter for followup
352 'list_filter_followup'=>"ajax_follow_up",
353 //delete a filter for followup
354 'delete_filter_followup'=>"ajax_follow_up",
355) ;
356
357if (array_key_exists($op, $path)) {
358 require NOALYSS_INCLUDE.'/ajax/'.$path[$op].".php";
359 return;
360}
361switch ($op)
362{
363 /*
364 * Get the currency rate
365 */
366 case "CurrencyRate":
367 $a_answer=array();
368 $a_answer['status']="NOK";
369 $http=new HttpInput();
370 try
371 {
372 $code=$http->get("p_code");
373 if ( $code==-1) {
374 $a_answer['content']=1;
375 }else {
376 $a_answer['content']=$cn->get_value("select ch_value from v_currency_last_value where currency_id=$1",
377 [$code]);
378 }
379 $a_answer['status']="OK";
380 }
381 catch (Exception $ex)
382 {
383 $a_answer['content']=$ex->getMessage();
384 }
385 $jsson=json_encode($a_answer, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK);
386 header('Content-Type: application/json;charset=utf-8');
387 echo $jsson;
388 return;
389
390
391 break;
392 /*
393 * Get the currency code
394 */
395 case "CurrencyCode":
396 $a_answer=array();
397 $a_answer['status']="NOK";
398 $http=new HttpInput();
399 try
400 {
401 $code=$http->get("p_code");
402 $a_answer['content']=$cn->get_value("select cr_code_iso||' ('||cr_name||')' from v_currency_last_value where currency_id=$1",
403 [$code]);
404 $a_answer['status']="OK";
405 }
406 catch (Exception $ex)
407 {
408 $a_answer['content']=$ex->getMessage();
409 }
410 $jsson=json_encode($a_answer, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK);
411 header('Content-Type: application/json;charset=utf-8');
412 echo $jsson;
413 return;
414
415
416 break;
417 case "periode_change":
418
419 $field=$http->get("field");
420 $type=$http->get("type");
421 $exercice=$http->get("exercice","number");
422 $last=$http->get("last","string",0);
423
424 // if last == 1 then show first and last periode of the
425 // exercice
427 $periode_end=0;
429 if ( $last==1) {
430 list($per_max,$per_min)=$t_periode->get_limit($exercice);
431 $periode_start=$per_max->p_id;
432 $periode_end=$per_min->p_id;
433 }
434
435 $iperiod = new IPeriod($field);
436 $iperiod->id=$field;
437 $iperiod->user = $g_user;
438 $iperiod->cn = $cn;
439 $iperiod->filter_year = true;
440 $iperiod->exercice=$exercice;
441 // For France , propose the first periode
442 if ( $g_parameter->MY_REPORT=='N') {
443 $periode_start=$t_periode->get_first_periode();
444 $iperiod->filter_year = false;
445 }
446 if ( $type=="from")
447 {
448 $iperiod->show_end_date=FALSE;
449 $iperiod->value=$periode_start;
450 } elseif ($type=="to"){
451 $iperiod->show_start_date=FALSE;
452 $iperiod->value=$periode_end;
453
454 } else {
455 throw new Exception(_("Invalide type"));
456 }
457
458 $iperiod->type = ALL;
459 echo $iperiod->input();
460
461 return;
462
463 break;
464 case "pref_exercice":
465 $iperiod = new IPeriod("period");
466 $iperiod->id="setting_period";
467 $iperiod->user = $g_user;
468 $iperiod->cn = $cn;
469 $iperiod->filter_year = true;
470 $iperiod->exercice=$http->get("exercice");
471
472 $iperiod->type = ALL;
473 echo $iperiod->input();
474
475 return;
476 break;
477 case "remove_anc":
478 if ($g_user->check_module('ANCODS') == 0)
479 exit();
480 $oa_group=$http->get("oa","number");
481 $cn->exec_sql("delete from operation_analytique where oa_group=$1", array($oa_group));
482 break;
483 case "rm_stock":
484 if ($g_user->check_module('STOCK') == 0)
485 exit();
486 require_once NOALYSS_INCLUDE.'/constant.security.php';
487 $cn->exec_sql('delete from stock_goods where sg_id=$1', array($s_id));
488 $html = escape_xml($s_id);
489 header('Content-type: text/xml; charset=UTF-8');
490 printf('{"d_id":"%s"}', $s_id);
491 exit();
492 break;
493 //--------------------------------------------------
494 // get the last date of a ledger
495 case 'lastdate':
496 require_once NOALYSS_INCLUDE.'/class/acc_ledger_fin.class.php';
497 $p_jrn=$http->get('p_jrn','number');
499 $html = $ledger->get_last_date();
501 header('Content-type: text/xml; charset=UTF-8');
502 echo <<<EOF
503<?xml version="1.0" encoding="UTF-8"?>
504<data>
505<code>e_date</code>
507</data>
508EOF;
509
510 break;
511 case 'bkname':
512 require_once NOALYSS_INCLUDE.'/class/acc_ledger_fin.class.php';
513 $p_jrn=$http->get('p_jrn','number');
515 $html = $ledger->get_bank_name();
517 header('Content-type: text/xml; charset=UTF-8');
518 echo <<<EOF
519<?xml version="1.0" encoding="UTF-8"?>
520<data>
521<code>bkname</code>
523</data>
524EOF;
525 break;
526 // display new calendar
527 case 'cal':
528 require_once NOALYSS_INCLUDE.'/class/calendar.class.php';
529 /* others report */
530 $cal = new Calendar();
531 $per=$http->get("per","number");
532 $cal->set_periode($per);
533 $notitle=$http->get("notitle", "string",0);
534 $html = "";
535 $html = $cal->display($http->get('t'),$notitle);
537 header('Content-type: text/xml; charset=UTF-8');
538 echo <<<EOF
539<?xml version="1.0" encoding="UTF-8"?>
540<data>
541<code>$html</code>
542</data>
543EOF;
544 break;
545
546
547 case 'dsp_tva':
549 // Filter the VAT
550 $filter=$http->get("filter","string","none");
551 if ( $filter == 'sale') {
552 $Res = $cn->exec_sql("select *
553 from v_tva_rate
554 where
555 tva_sale <> '#'
556 order by tva_rate desc");
557
558 } elseif ($filter == "purchase") {
559
560 $Res = $cn->exec_sql("select *
561 from
562 v_tva_rate
563 where
564 tva_purchase <> '#'
565 order by tva_rate desc");
566 }else {
567
568 $Res = $cn->exec_sql("select * from v_tva_rate
569 order by tva_rate desc");
570 }
572 $r = "";
573 $r.=HtmlInput::title_box(_('Choisissez la TVA'),'tva_select',"close","","y");
574 $r.='<div >';
575 $r.=_('Cherche')." ".HtmlInput::filter_table("tva_select_table",'0,1,2,3' , 1);
576 $r.= '<TABLE class="sortable" style="width:100%" id="tva_select_table">';
577 $r.=th(_('code'));
578 $r.=th(_('Taux'),'class="sorttable_sorted_reverse"');
579 $r.=th(_('Symbole'));
580 $r.=th(_('Explication'));
581
582 for ($i = 0; $i < $Max; $i++)
583 {
585 if (!isset($compute))
586 {
587 if (!isset($code))
588 {
589 $script = "onclick=\"$('$ctl').value='" . $row['tva_id'] . "';removeDiv('tva_select');\"";
590 }
591 else
592 {
593 $script = "onclick=\"$('$ctl').value='" . $row['tva_id'] . "';set_value('$code','" . $row['tva_label'] . "');removeDiv('tva_select');\"";
594 }
595 }
596 else
597 {
598 if (!isset($code))
599 {
600 $script = "onclick=\"$('$ctl').value='" . $row['tva_id'] . "';removeDiv('tva_select');clean_tva('$compute');compute_ledger('$compute');\"";
601 }
602 else
603 {
604 $script = "onclick=\"$('$ctl').value='" . $row['tva_id'] . "';set_value('$code','" . $row['tva_label'] . "');removeDiv('tva_select');clean_tva('$compute');compute_ledger('$compute');\"";
605 }
606 }
607 $set = '<INPUT TYPE="BUTTON" class="button" Value="select" ' . $script . '>';
608 $class=($i%2 == 0)?' class="odd" ':' class="even" ';
609 $r.='<tr'.$class. $script.' style="cursor : pointer">';
610 $r.=td($row['tva_id']);
611 $r.=td($row['tva_rate']);
612 $r.=td($row['tva_label']);
613 $r.=td($row['tva_comment']);
614 $r.='</tr>';
615 }
616 $r.='</TABLE>';
617 $r.=HtmlInput::button_close("tva_select");
618 $r.='</div>';
620
621 header('Content-type: text/xml; charset=UTF-8');
622 echo <<<EOF
623<?xml version="1.0" encoding="UTF-8"?>
624<data>
625<code>$html</code>
626<popup>$popup</popup>
627</data>
628EOF;
629 break;
630 case 'label_tva':
632 if (isNumber($id) == 0)
633 $value = _('tva inconnue');
634 else
635 {
636 $Res = $cn->get_array("select * from tva_rate where tva_id = $1", array($id));
637 if (count($Res) == 0)
638 $value = _('tva inconnue');
639 else
640 $value = $Res[0]['tva_label'];
641 }
642 header('Content-type: text/xml; charset=UTF-8');
643 echo <<<EOF
644<?xml version="1.0" encoding="UTF-8"?>
645<data>
646<code>$code</code>
648</data>
649EOF;
650
651 break;
652
653 case 'add_plugin':
654 $me_code = new IText('me_code');
655 $me_file = new IText('me_file');
656 $me_menu = new IText('me_menu');
657 $me_description = new IText("me_description");
658 $me_parameter = new IText("me_parameter");
659 $new = true;
660 require_once NOALYSS_INCLUDE.'/ajax/ajax_plugin_detail.php';
661 break;
662 case 'mod_plugin':
663 $m = $cn->get_array("select me_code,me_file,me_menu,me_description,me_parameter
664 from menu_ref where me_code=$1", array($me_code));
665 if (empty($m))
666 {
667 echo HtmlInput::title_box(_("Ce plugin n'existe pas "), $ctl,"close","","y");
668 echo "<p>"._("Il y a une erreur, ce plugin n'existe pas").
669 "</p>";
670 exit;
671 }
672 $me_code = new IText('me_code', $m[0] ['me_code']);
673 $me_file = new IText('me_file', $m[0] ['me_file']);
674 $me_menu = new IText('me_menu', $m[0] ['me_menu']);
675 $me_description = new IText("me_description", $m[0] ['me_description']);
676 $me_parameter = new IText("me_parameter", $m[0] ['me_parameter']);
677 $new = false;
678 require_once NOALYSS_INCLUDE.'/ajax/ajax_plugin_detail.php';
679 break;
680 case 'ledger_description':
681 $ajrn=$cn->get_array('select jrn_def_name,jrn_def_description from jrn_def where jrn_def_id=$1',array($l));
682 if ( count($ajrn)==1)
683 {
684 echo '<div>';
685 echo '<h1 >'.$ajrn[0]['jrn_def_name'].'</h1>';
686 if ( noalyss_trim($ajrn[0]['jrn_def_description']) != "") {
687 echo '<p style="border:1px solid;margin-top:0px;padding:1rem">'.$ajrn[0]['jrn_def_description'].'</p>';
688 }
689 echo '</div>';
690 }
691 exit();
692 break;
693 case 'currencyCode':
694 $ledger_id=$http->request('ledger',"number");
695 $code=$cn->get_value("select cr_code_iso from public.currency join jrn_def on (currency.id=jrn_def.currency_id) where jrn_def.jrn_def_id=$1",
696 [$ledger_id]);
697 echo $code;
698 break;
699 case 'up_other_tax':
701 $ledger_id=$http->request('jrn_id','number');
702 $acc_ledger=new Acc_Ledger($cn,$ledger_id);
703 echo $acc_ledger->input_additional_tax();
704 break;
705 default:
706 var_dump($_REQUEST);
707}
isNumber($p_int)
Definition: ac_common.php:215
th($p_string, $p_extra='', $raw='')
Definition: ac_common.php:58
ajax_disconnected($p_div)
Should a dialog box when you are disconnected from an ajax call propose to reload or to connect in an...
Definition: ac_common.php:907
check_password_strength($password)
returns an double array with the error found and code , if the count is 0 then the password is very s...
Definition: ac_common.php:1700
set_language()
set the lang thanks the _SESSION['g_lang'] var.
Definition: ac_common.php:754
td($p_string='', $p_extra='')
surround the string with td
Definition: ac_common.php:83
noalyss_trim($p_string)
Definition: ac_common.php:1545
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
$op
Definition: ajax_admin.php:38
$code
if($notitle==0) $cal
catch(Exception $ex) if( $g_user->check_module( 'CFGCURRENCY')==0) switch($act) $jsson
check if module CFGCURRENCY
$a_answer
catch(Exception $e) $exercice
if( $op=="progressBar") if($op=='password_chk') $html
Definition: ajax_misc.php:132
$cont
Definition: ajax_misc.php:64
global $cn
Definition: ajax_misc.php:84
global $http
Definition: ajax_misc.php:44
global $g_user
Definition: ajax_misc.php:84
$var
Definition: ajax_misc.php:63
global $g_parameter
Definition: ajax_misc.php:84
if(LOGINPUT) $path
Definition: ajax_misc.php:152
$ledger_id
$_REQUEST['ac']
if(! empty( $error)) for($i=0;$i< count($error);$i++)( $last !=$error[$i]) $last
$filter
$ex
Definition: balance.inc.php:45
$_GET['qcode']
$class
the class Acc_Ledger_Fin inherits from Acc_Ledger, this object permit to manage the financial ledger
Display the calendar.
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
contains the class for connecting to Noalyss
static connect()
static button_close($div_name, $class='smallbutton')
close button for the HTML popup
static filter_table($p_table_id, $p_col, $start_row)
filter the rows in a table and keep the colored row in alternance
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".
manage the http input (get , post, request) and extract from an array
static set_firstDate($firstDate)
Generate the form for the periode Data Members.
Html Input.
Definition: itext.class.php:30
Class to manage the company parameter (address, name...)
For the periode tables parm_periode and jrn_periode.
Use one db for tracking progress bar value, the task id must be unique and let you follow the progres...
const ALL
Definition: constant.php:204
$_POST['ac']
Definition: do.php:310
$Res
for($e=0; $e< count($afiche); $e++) exit
$str
Definition: fiche.inc.php:91
$periode_start
Definition: fiche.inc.php:50
$periode_end
Definition: fiche.inc.php:51
$t_periode
escape_xml($p_xml)
When data are transfered thanks ajax in a xml document, the xml can not contains some character,...
json_response($p_answer)
Send header and json object.
if( $delta< 0) elseif( $delta==0)
$script
Definition: popup.php:125