noalyss
Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
include
class
acc_operation_note.class.php
Go to the documentation of this file.
1
<?php
2
/*
3
* This file is part of NOALYSS.
4
*
5
* NOALYSS is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
9
*
10
* NOALYSS is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with NOALYSS; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
*/
19
20
// Copyright Author Dany De Bontridder danydb@noalyss.eu
21
22
/*!
23
* \file
24
* \brief Manage the note attached to an operation
25
*/
26
27
/*!
28
* \class Acc_Operation_Note
29
* \brief Manage the note attached to an operation
30
*/
31
32
class
Acc_Operation_Note
33
{
34
private
$note
;
35
private
$id
;
36
private
$operation_id
;
//!< jrn.jr_id
37
private
$jrn_note_sql
;
38
39
function
__construct
(
Jrn_Note_SQL
$p_Jrn_Note_SQL)
40
{
41
$this->jrn_note_sql = $p_Jrn_Note_SQL;
42
$this->
id
=$p_Jrn_Note_SQL->n_id;
43
$this->note=$p_Jrn_Note_SQL->n_text;
44
$this->operation_id=$p_Jrn_Note_SQL->jr_id;
45
}
46
47
/**
48
* @return Jrn_Note_SQL
49
*/
50
public
function
getJrnNoteSql
():
Jrn_Note_SQL
51
{
52
return
$this->jrn_note_sql
;
53
}
54
55
/**
56
* @param Jrn_Note_SQL $jrn_note_sql
57
*/
58
public
function
setJrnNoteSql
(
Jrn_Note_SQL
$jrn_note_sql
):
Acc_Operation_Note
59
{
60
$this->jrn_note_sql =
$jrn_note_sql
;
61
return
$this;
62
}
63
64
/**
65
* @param $p_jr_id
66
* @return void
67
*/
68
static
function
build_jrn_id
($p_jr_id) {
69
$cn
=Dossier::connect();
70
$n_id=
$cn
->get_value(
"select n_id from jrn_note where jr_id=$1"
,[$p_jr_id]);
71
if
(
$cn
->count() == 0) {
72
$n_id=-1;
73
}
74
75
return
new
Acc_Operation_Note
(
new
Jrn_Note_SQL
(
$cn
,$n_id));
76
77
}
78
function
save
():
Acc_Operation_Note
79
{
80
$cn
=Dossier::connect();
81
$this->jrn_note_sql->setp(
"jr_id"
,$this->operation_id);
82
$this->jrn_note_sql->setp(
"n_text"
, strip_tags($this->note));
83
84
if
( empty($this->jrn_note_sql->n_text) && $this->id > -1 ) {
85
$this->jrn_note_sql->delete();
86
return
$this;
87
}
88
// forbid the tag script, iframe and A
89
$n
=str_ireplace(
'<script'
,
'<.script'
,$this->note);
90
$n
=str_ireplace(
'<iframe'
,
'<.iframe'
,
$n
);
91
$n
=str_ireplace(
'<a '
,
'<.a'
,
$n
);
92
93
$this->jrn_note_sql->setp(
"n_html"
,
$n
);
94
$this->jrn_note_sql->save();
95
$this->
id
=$this->jrn_note_sql->n_id;
96
return
$this;
97
}
98
function
setNote
($p_note) {
99
$this->note=$p_note;
100
101
return
$this;
102
}
103
function
setOperation_id
($p_jrid) {
104
$this->operation_id=$p_jrid;
105
return
$this;
106
}
107
function
getNote
() {
108
return
$this->note
;
109
}
110
function
getOperation_id
() {
111
return
$this->operation_id
;
112
}
113
function
load
():void
114
{
115
$this->jrn_note_sql->load();
116
$this->operation_id=$this->jrn_note_sql->jr_id;
117
$this->note=$this->jrn_note_sql->n_text;
118
$this->
id
=$this->jrn_note_sql->n_id;
119
}
120
static
function
input
($p_current)
121
{
122
require NOALYSS_TEMPLATE.
'/acc_operation_note-input.php'
;
123
}
124
function
fromPost
()
125
{
126
127
}
128
function
print
()
129
{
130
echo
'<div id="print_note">'
.h($this->note).
'</div>'
;
131
}
132
/**
133
* @brief create a TEXTAREA to show HTML Note
134
* @param type $div_id
135
* @returns ITextarea
136
*/
137
static
function
build_textarea
($div_id)
138
{
139
$inote
=
new
ITextarea
(
'jrn_note'
);
140
$inote
->id=
"{$div_id}_jrn_note"
;
141
$inote
->set_enrichText(
"no-toolbar"
);
142
$inote
->heigh=500;
143
return
$inote
;
144
}
145
}
$cn
$cn
Definition
ajax_anc_accounting.php:30
Acc_Operation_Note
Manage the note attached to an operation.
Definition
acc_operation_note.class.php:33
Acc_Operation_Note\input
static input($p_current)
Definition
acc_operation_note.class.php:120
Acc_Operation_Note\load
load()
Definition
acc_operation_note.class.php:113
Acc_Operation_Note\setJrnNoteSql
setJrnNoteSql(Jrn_Note_SQL $jrn_note_sql)
Definition
acc_operation_note.class.php:58
Acc_Operation_Note\getNote
getNote()
Definition
acc_operation_note.class.php:107
Acc_Operation_Note\$id
$id
Definition
acc_operation_note.class.php:35
Acc_Operation_Note\$note
$note
Definition
acc_operation_note.class.php:34
Acc_Operation_Note\setNote
setNote($p_note)
Definition
acc_operation_note.class.php:98
Acc_Operation_Note\getJrnNoteSql
getJrnNoteSql()
Definition
acc_operation_note.class.php:50
Acc_Operation_Note\build_textarea
static build_textarea($div_id)
create a TEXTAREA to show HTML Note
Definition
acc_operation_note.class.php:137
Acc_Operation_Note\build_jrn_id
static build_jrn_id($p_jr_id)
Definition
acc_operation_note.class.php:68
Acc_Operation_Note\getOperation_id
getOperation_id()
Definition
acc_operation_note.class.php:110
Acc_Operation_Note\$jrn_note_sql
$jrn_note_sql
Definition
acc_operation_note.class.php:37
Acc_Operation_Note\$operation_id
$operation_id
jrn.jr_id
Definition
acc_operation_note.class.php:36
Acc_Operation_Note\__construct
__construct(Jrn_Note_SQL $p_Jrn_Note_SQL)
Definition
acc_operation_note.class.php:39
Acc_Operation_Note\setOperation_id
setOperation_id($p_jrid)
Definition
acc_operation_note.class.php:103
Acc_Operation_Note\print
print()
Definition
acc_operation_note.class.php:128
Acc_Operation_Note\fromPost
fromPost()
Definition
acc_operation_note.class.php:124
Acc_Operation_Note\save
save()
Definition
acc_operation_note.class.php:78
ITextarea
Manage the TEXTAREA html element.
Definition
itextarea.class.php:31
Jrn_Note_SQL
Definition
jrn_note_sql.class.php:34
$n
$n
Definition
compute.php:54
$inote
$inote
Definition
ledger_detail_ach.php:113
Generated on Thu Jan 15 2026 10:14:38 for noalyss by
1.13.2