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