noalyss Version-9
document_option.class.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/**
23 * @file
24 * @brief in follow-up , you have action which can be set with different options depending of the type of documents like
25 * invoicing, meeting, ...
26 */
27
28/**
29 * @class Document_Option
30 * @brief in follow-up , you have action which can be set with different options depending of the type of documents like
31 * invoicing, meeting, ...
32 */
34{
35
36 /**
37 * returns true if the operation_detail is enable, otherwise false
38 *
39 * @param int $p_document_type Document_Type.dt_id
40 * @return boolean
41 */
42 static function is_enable_operation_detail($p_document_type)
43 {
44 $display_operation=false;
46 if ($cn->get_value("select do_enable from document_option where document_type_id=$1 and do_code = $2",
47 [$p_document_type, 'detail_operation'])=='1')
48 {
49 $display_operation=true;
50 }
51 return $display_operation;
52 }
53 /**
54 * returns true if comment are available otherwise false
55 *
56 * @param int $p_document_type Document_Type.dt_id
57 * @return boolean
58 */
59 static function is_enable_comment($p_document_type)
60 {
61 $display_operation=false;
63 if ($cn->get_value("select do_enable from document_option where document_type_id=$1 and do_code = $2",
64 [$p_document_type, 'followup_comment'])=='1')
65 {
66 $display_operation=true;
67 }
68 return $display_operation;
69 }
70 /**
71 * returns option from the operation_detail
72 *
73 * @param int $p_document_type Document_Type.dt_id
74 * @return string
75 */
76 static function option_operation_detail($p_document_type)
77 {
79 $option_operation = $cn->get_value("select do_option from document_option where document_type_id=$1 "
80 . " and do_code = $2",
81 [$p_document_type, 'detail_operation']);
82 return $option_operation;
83 }
84
85 /**
86 * returns true if the operation_detail is enable, otherwise false
87 *
88 * @param int $p_document_type Document_Type.dt_id
89 * @return boolean
90 */
91 static function is_enable_contact_multiple($p_document_type)
92 {
93 $return=false;
95 if ($cn->get_value("select do_enable from document_option where document_type_id=$1 and do_code = $2",
96 [$p_document_type, 'contact_multiple'])=='1')
97 {
98 $return=true;
99 }
100 return $return;
101 }
102
103 /**
104 * returns true if the operation_detail is enable, otherwise false
105 *
106 * @param int $p_document_type Document_Type.dt_id
107 * @return boolean
108 */
109 static function is_enable_make_invoice($p_document_type)
110 {
111 $return=false;
113 if ($cn->get_value("select do_enable from document_option where document_type_id=$1 and do_code = $2",
114 [$p_document_type, 'make_invoice'])=='1')
115 {
116 $return=true;
117 }
118 return $return;
119 }
120 /**
121 * returns true if the operation_detail is enable, otherwise false
122 *
123 * @param int $p_document_type Document_Type.dt_id
124 * @return boolean
125 */
126 static function is_enable_make_feenote($p_document_type)
127 {
128 $return=false;
130 if ($cn->get_value("select do_enable from document_option where document_type_id=$1 and do_code = $2",
131 [$p_document_type, 'make_feenote'])=='1')
132 {
133 $return=true;
134 }
135 return $return;
136 }
137 /**
138 * Returns true if we can add a comment , or false if it is not possible
139 * @param integer $p_id is the action_gestion.ag_id
140 */
141 static function can_add_comment($p_id) {
143 $document_type=$cn->get_value("select ag_type from action_gestion where ag_id=$1",[$p_id]);
145 // If comment are disable, only the first one is authorized as event description
146 $cnt=$cn->get_value("select count(*) from action_gestion_comment where ag_id=$1",[$p_id]);
147 if ($cnt == 0 ) return true;
148 return false;
149
150 }
151
152 /**
153 * returns option from the operation_detail
154 *
155 * @param int $p_document_type Document_Type.dt_id
156 * @return string ONE_EDIT or SOME_FIXED
157 */
158 static function option_comment($p_document_type)
159 {
161 $option_operation = $cn->get_value("select do_option from document_option where document_type_id=$1 "
162 . " and do_code = $2",
163 [$p_document_type, 'followup_comment']);
164 return $option_operation;
165 }
166
167 /**
168 * returns true if it is possible to edit the description , otherwise false
169 *
170 * @param int $p_document_type Document_Type.dt_id
171 * @return boolean
172 */
173 static function is_enable_editable_description($p_document_type)
174 {
175 $return=false;
177 if ($cn->get_value("select do_enable from document_option where document_type_id=$1 and do_code = $2",
178 [$p_document_type, 'editable_description'])=='1')
179 {
180 $return=true;
181 }
182 return $return;
183 }
184
185 /**
186 * returns true there is a videoconf enable
187 *
188 * @param int $p_document_type Document_Type.dt_id
189 * @return boolean
190 */
191 static function is_enable_video_conf ($p_document_type)
192 {
193 $return=false;
195 if ($cn->get_value("select do_enable from document_option where document_type_id=$1 and do_code = $2",
196 [$p_document_type, 'videoconf_server'])=='1')
197 {
198 $return=true;
199 }
200 return $return;
201 }
202
203 /**
204 * returns the videoconf server
205 *
206 * @param int $p_document_type Document_Type.dt_id
207 * @return string with url to videoconf server
208 */
209 static function option_video_conf($p_document_type)
210 {
212 $option_operation = $cn->get_value("select do_option from document_option where document_type_id=$1 "
213 . " and do_code = $2",
214 [$p_document_type, 'videoconf_server']);
215 return $option_operation;
216 }
217
218}
in follow-up , you have action which can be set with different options depending of the type of docum...
static is_enable_make_feenote($p_document_type)
returns true if the operation_detail is enable, otherwise false
static is_enable_editable_description($p_document_type)
returns true if it is possible to edit the description , otherwise false
static is_enable_make_invoice($p_document_type)
returns true if the operation_detail is enable, otherwise false
static can_add_comment($p_id)
Returns true if we can add a comment , or false if it is not possible.
static option_video_conf($p_document_type)
returns the videoconf server
static is_enable_video_conf($p_document_type)
returns true there is a videoconf enable
static is_enable_contact_multiple($p_document_type)
returns true if the operation_detail is enable, otherwise false
static option_operation_detail($p_document_type)
returns option from the operation_detail
static option_comment($p_document_type)
returns option from the operation_detail
static is_enable_comment($p_document_type)
returns true if comment are available otherwise false
static is_enable_operation_detail($p_document_type)
returns true if the operation_detail is enable, otherwise false
static connect()
$document_type[]