31if (!defined(
'NOTOKENRENEWAL')) {
32 define(
'NOTOKENRENEWAL', 1);
34if (!defined(
'NOREQUIREMENU')) {
35 define(
'NOREQUIREMENU',
'1');
37if (!defined(
'NOREQUIREHTML')) {
38 define(
'NOREQUIREHTML',
'1');
43require
'../../main.inc.php';
51require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/blockedlog.class.php';
57if ((!$user->admin && !$user->hasRight(
'blockedlog',
'read')) || empty(
$conf->blockedlog->enabled)) {
61$langs->loadLangs(array(
"admin",
"bills",
"blockedlog",
"cashdesk",
"companies",
"compta",
"mails",
"members",
"products"));
70print
'<div id="pop-info"><table height="80%" class="border centpercent"><thead>';
71print
'<th width="30%" class="left">'.$langs->trans(
'Field').
'</th><th class="left">'.$langs->trans(
'Label').
'</th><th class="left">'.$langs->trans(
'Value').
'</th></thead>';
74if ($block->fetch($id) > 0) {
75 $objtoshow = $block->object_data;
77 print formatObject($objtoshow,
'', $block->element);
79 print
'Error, failed to get unalterable log with id '.$id;
83print
'</table></div>';
97function formatObject($objtoshow, $prefix, $parentelement =
'')
103 $newobjtoshow = $objtoshow;
106 $arrayoffields = array();
107 if ($prefix ==
'mycompany' || $prefix ==
'thirdparty') {
108 include_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
110 $arrayoffields = $tmpobject->fields;
111 } elseif ($prefix ==
'invoice') {
112 include_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
114 $arrayoffields = $tmpobject->fields;
115 } elseif ($prefix ==
'invoiceline') {
116 include_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/factureligne.class.php';
118 $arrayoffields = $tmpobject->fields;
124 'country_code' =>
'fk_pays',
125 'typent_code' =>
'fk_typent',
126 'forme_juridique_code' =>
'fk_forme_juridique',
129 $otherlabels = array(
131 'module_source' =>
'POSModule',
132 'pos_source' =>
"POSTerminal",
133 'posmodule' =>
'POSModule',
134 'posnumber' =>
'POSTerminal',
135 'pos_print_counter' =>
"NumberOfPrintsIfDocValidated",
136 'email_sent_counter' =>
"NumberOfEmailsSent",
137 'managers' =>
'Managers',
138 'type_code' =>
'PaymentMode',
139 'date_creation' =>
'DateCreation',
140 'datec' =>
'DateCreation',
141 'dateh' =>
'DateSubscription',
142 'datef' =>
'DateEndSubscription',
143 'fk_adherent' =>
'MemberId',
144 'amount' =>
'Amount',
148 'element' =>
'TypeOfEvent',
149 'entity' =>
'Entity',
152 'total_ht' =>
'TotalHT',
153 'total_ttc' =>
'TotalTTC',
154 'total_tva' =>
'TotalVAT',
155 'total_localtax1' =>
'TotalTax2',
156 'total_localtax2' =>
'TotalTax3',
157 'multicurrency_total_ht' =>
'TotalHTShortCurrency',
158 'multicurrency_total_ttc' =>
'TotalTTCShortCurrency',
159 'multicurrency_total_tva' =>
'TotalVATShortCurrency',
160 'tva_tx' =>
'VATRate',
161 'localtax1_tx' =>
'Localtax1Rate',
162 'localtax2_tx' =>
'Localtax2Rate',
163 'vat_src_code' =>
'VATCode',
164 'multicurrency_code' =>
'Currency',
166 'remise_percent' => $langs->transnoentitiesnoconv(
'Discount').
' (%)',
170 'address' =>
'Address',
172 'state_code' =>
'State',
173 'fk_pays' =>
'Country',
174 'fk_typent' =>
'CompanyType',
175 'revenuestamp' =>
'RevenueStamp',
176 'code_client' =>
'CustomerCode',
177 'code_fournisseur' =>
'SupplierCode',
178 'capital' =>
'Capital',
179 'fullname' =>
'Fullname',
180 'period' =>
'Period',
181 'localtax1_assuj' =>
'UseLocalTax1',
182 'localtax2_assuj' =>
'UseLocalTax2',
183 'localtax1_value' =>
'LocalTax1DefaultValue',
184 'localtax2_value' =>
'LocalTax2DefaultValue',
185 'subprice' =>
'UnitPrice',
186 'product_type' =>
'ProductType',
187 'product_label' =>
'ProductLabel',
188 'type' =>
'InvoiceType',
189 'info_bits' =>
'TVA NPR or NOT',
190 'special_code' =>
'Special line (WEEE line, option, id of module...)',
191 'status' =>
'Status',
192 'cash' =>
'PaymentTypeLIQ',
193 'cash_declared' => $langs->transnoentitiesnoconv(
'PaymentTypeLIQ').
' - '.$langs->transnoentitiesnoconv(
"AmuntCountedByUserShort"),
194 'cash_lifetime' => $langs->transnoentitiesnoconv(
'LifetimeAmount', $langs->transnoentitiesnoconv(
'PaymentTypeLIQ')),
195 'card' =>
'PaymentTypeCB',
196 'card_declared' => $langs->transnoentitiesnoconv(
'PaymentTypeCB').
' - '.$langs->transnoentitiesnoconv(
"AmuntCountedByUserShort"),
197 'card_lifetime' => $langs->transnoentitiesnoconv(
'LifetimeAmount', $langs->transnoentitiesnoconv(
'PaymentTypeCB')),
198 'cheque' =>
'PaymentTypeCHQ',
199 'cheque_declared' => $langs->transnoentitiesnoconv(
'PaymentTypeCHQ').
' - '.$langs->transnoentitiesnoconv(
"AmuntCountedByUserShort"),
200 'cheque_lifetime' => $langs->transnoentitiesnoconv(
'LifetimeAmount', $langs->transnoentitiesnoconv(
'PaymentTypeCHQ')),
201 'lifetime_start' =>
'LifetimeStatDate',
202 'total_billed' =>
'Turnover',
203 'total_collected' =>
'TurnoverCollected',
204 'totallifetime_billed' => $langs->transnoentitiesnoconv(
'Turnover').
' - '.$langs->transnoentitiesnoconv(
'LifetimeAmountShort'),
205 'totallifetime_collected' => $langs->transnoentitiesnoconv(
'TurnoverCollected').
' - '.$langs->transnoentitiesnoconv(
'LifetimeAmountShort'),
206 'email_from' =>
'MailFrom',
207 'email_to' =>
'MailTo',
208 'email_msgid' =>
'EmailMsgID',
209 'year_close' =>
'Year',
210 'month_close' =>
'Month',
211 'day_close' =>
'Day',
212 'hour_close' =>
'Hour',
213 'min_close' =>
'Minutes',
214 'sec_close' =>
'Second',
217 if (is_object($newobjtoshow) || is_array($newobjtoshow)) {
219 foreach ($newobjtoshow as $key => $val) {
220 if (!is_object($val) && !is_array($val)) {
226 $types = $arrayoffields[$key][
'type'] ??
'';
227 $labels = (array_key_exists($key, $convertkey) ? ($arrayoffields[$convertkey[$key]][
'label'] ??
'') :
'');
228 $s .=
'<!-- '.$key.
' '.$types.
' '.$labels.
' -->';
229 $s .= ($prefix ? $prefix.
' > ' :
'');
236 if (isset($arrayoffields[$key][
'label'])) {
237 $label = $langs->trans($tmpobject->fields[$key][
'label']);
238 } elseif (!empty($convertkey[$key]) && isset($arrayoffields[$convertkey[$key]][
'label'])) {
239 $label = $langs->trans($tmpobject->fields[$convertkey[$key]][
'label']);
240 } elseif ($prefix ==
'mycompany' || $prefix ==
'thirdparty') {
242 if (preg_match(
'/^idprof(\d+)$/', $key, $reg)) {
243 $countrycode = property_exists($newobjtoshow,
'country_code') ? ($newobjtoshow->country_code ??
'') :
'';
244 $label = $langs->trans(
"ProfId".$reg[1].$countrycode);
247 if (empty($label) && !empty($otherlabels[$key])) {
248 if (preg_match(
'/^invoiceline/', $prefix) && $key ===
'ref') {
249 $label = $langs->trans(
"ProductRef");
251 $label = $langs->trans($otherlabels[$key]);
254 if (empty($label) && array_key_exists($key, $convertkey) && array_key_exists((
string) $convertkey[$key], $otherlabels)) {
255 $label = $langs->trans((
string) $otherlabels[(
string) $convertkey[$key]]);
258 $label = array_key_exists($key, $convertkey) ? $convertkey[$key] :
'';
260 if (!empty($label)) {
261 $s .=
'<span class="opacitymedium">'.$label.
'</span>';
266 if (in_array($key, array(
'type')) && $parentelement ==
'facture') {
268 include_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
270 $tmpinvoice->type = $val;
271 $s .= $tmpinvoice->getLibType(0);
272 } elseif (in_array($key, array(
'date',
'datef'))) {
274 } elseif (in_array($key, array(
'dateh',
'datec',
'date_creation',
'datem',
'tms',
'date_valid',
'datep',
'lifetime_start'))) {
276 } elseif (in_array($key, array(
'tva_assuj',
'localtax1_assuj',
'localtax2_assuj'))) {
278 } elseif (in_array($key, array(
'product_type'))) {
279 $s .= $val ?
'Product' :
'Service';
280 } elseif (in_array($key, array(
282 'tva_tx',
'localtax1_tx',
'localtax2_tx',
'total_ht',
'total_ttc',
'total_tva',
'total_localtax1',
'total_localtax2',
'localtax2',
'localtax2',
'revenuestamp',
283 'multicurrency_total_ht',
'multicurrency_total_tva',
'multicurrency_total_ttc',
'multicurrency_subprice',
285 'cash',
'cheque',
'card',
287 'cash_declared',
'cheque_declared',
'card_declared',
'cash_lifetime',
'cheque_lifetime',
'card_lifetime'
288 )) || (isset($arrayoffields[$key][
'type']) && in_array($arrayoffields[$key][
'type'], array(
'price')))) {
289 $s .=
'<span class="amount">'.price($val, 0, $langs, 1, 0, -2).
'</span>';
290 } elseif (in_array($key, array(
'total_billed',
'total_collected',
'totallifetime_billed',
'totallifetime_collected'))) {
291 $s .=
'<span class="amount">'.$val.
'</span>';
296 } elseif (is_array($val)) {
297 $s .= formatObject($val, ($prefix ? $prefix.
' > ' :
'').$key, $parentelement);
298 } elseif (is_object($val)) {
299 $s .= formatObject($val, ($prefix ? $prefix.
' > ' :
'').$key, $parentelement);
$id
Support class for third parties, contacts, members, users or resources.
Class to manage Blocked Log.
Class to manage invoices.
Class to manage invoice lines.
Class to manage third parties objects (customers, suppliers, prospects...)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.