noalyss
Version-9
include
ajax
ajax_contact_option_list.php
Go to the documentation of this file.
1
<?php
2
3
/*
4
* This file is part of NOALYSS.
5
*
6
* PhpCompta 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
* PhpCompta 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 PhpCompta; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
*/
20
// Copyright (2002-2020) Author Dany De Bontridder <danydb@noalyss.eu>
21
22
if
(!defined(
'ALLOWED'
))
23
die(
'Appel direct ne sont pas permis'
);
24
25
/**
26
* @file
27
* @brief add option for contact
28
* @see contact_option_list
29
* @see action_document_type_mtable::input()
30
*/
31
try
32
{
33
$contact_option_id=
$http
->request(
"p_id"
);
34
$ctl_id
=
$http
->request(
"ctl"
);
35
$action
=
$http
->request(
"action"
);
36
}
37
catch
(Exception
$ex
)
38
{
39
record_log
(__FILE__.
" no p_id"
);
40
return
;
41
}
42
$cn
=
Dossier::connect
();
43
44
// document_option id from document_option where do_code='contact_multiple' and document_type_id=p_id
45
$obj
=
new
Contact_option_ref_SQL
(
$cn
);
46
47
$contact_mtable
=
new
Contact_Option_Ref_MTable
(
$obj
);
48
49
$contact_mtable
->set_callback(
"ajax_misc.php"
);
50
$contact_mtable
->set_object_name(
"s_contact_option"
);
51
$contact_mtable
->set_dialog_box(
"db_contact_option"
);
52
$contact_mtable
->add_json_param(
"op"
,
"contact_option_list"
);
53
$contact_mtable
->set_object_name(
$ctl
);
54
$contact_mtable
->set_pk($contact_option_id);
55
56
if
(
$action
==
"input"
) {
57
$contact_mtable
->send_header();
58
echo
$contact_mtable
->ajax_input()->saveXML();
59
}
elseif
(
$action
==
"save"
) {
60
$contact_mtable
->send_header();
61
62
echo
$contact_mtable
->ajax_save()->saveXML();
63
}
elseif
(
$action
==
"delete"
) {
64
$contact_mtable
->send_header();
65
$contact_mtable
->ajax_delete();
66
}
record_log
record_log($p_message)
Record an error message into the log file of the server.
Definition:
ac_common.php:1342
$http
$http
Definition:
action.common.inc.php:33
$ctl
$ctl
Definition:
ajax_action_remove_concerned.php:53
$cn
catch(Exception $ex) $cn
Definition:
ajax_contact_option_list.php:42
$obj
$obj
Definition:
ajax_contact_option_list.php:45
$contact_mtable
$contact_mtable
Definition:
ajax_contact_option_list.php:47
$action
$action
Definition:
ajax_contact_option_list.php:35
$ctl_id
$ctl_id
Definition:
ajax_contact_option_list.php:34
$ex
$ex
Definition:
balance.inc.php:45
Contact_Option_Ref_MTable
Manage the Options for the Card_Multiple in the Follow Up.
Definition:
contact_option_ref_mtable.class.php:34
Contact_option_ref_SQL
abstract of the table public.contact_option_ref
Definition:
contact_option_ref_sql.class.php:35
Dossier\connect
static connect()
Definition:
dossier.class.php:295
elseif
if( $delta< 0) elseif( $delta==0)
Definition:
letter_prop.php:166