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",
"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;
76 print formatObject($objtoshow,
'');
78 print
'Error, failed to get unalterable log with id '.$id;
82print
'</table></div>';
95function formatObject($objtoshow, $prefix)
101 $newobjtoshow = $objtoshow;
104 $arrayoffields = array();
105 if ($prefix ==
'mycompany' || $prefix ==
'thirdparty') {
106 include_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
108 $arrayoffields = $tmpobject->fields;
109 } elseif ($prefix ==
'invoice') {
110 include_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
112 $arrayoffields = $tmpobject->fields;
113 } elseif ($prefix ==
'invoiceline') {
114 include_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/factureligne.class.php';
116 $arrayoffields = $tmpobject->fields;
122 'country_code' =>
'fk_pays',
123 'typent_code' =>
'fk_typent',
124 'forme_juridique_code' =>
'fk_forme_juridique',
127 $otherlabels = array(
128 'module_source' =>
'POSModule',
129 'pos_source' =>
"POSTerminal",
130 'posmodule' =>
'POSModule',
131 'posnumber' =>
'POSTerminal',
132 'pos_print_counter' =>
"NumberOfPrints",
133 'email_sent_counter' =>
"NumberOfEmailsSent",
134 'managers' =>
'Managers',
135 'type_code' =>
'PaymentMode',
136 'date_creation' =>
'DateCreation',
137 'datec' =>
'DateCreation',
138 'dateh' =>
'DateSubscription',
139 'datef' =>
'DateEndSubscription',
140 'fk_adherent' =>
'MemberId',
141 'amount' =>
'Amount',
144 'element' =>
'TypeOfEvent',
145 'entity' =>
'Entity',
148 'total_ht' =>
'TotalHT',
149 'total_ttc' =>
'TotalTTC',
150 'total_tva' =>
'TotalVAT',
151 'total_localtax1' =>
'TotalTax2',
152 'total_localtax2' =>
'TotalTax3',
153 'multicurrency_total_ht' =>
'TotalHTShortCurrency',
154 'multicurrency_total_ttc' =>
'TotalTTCShortCurrency',
155 'multicurrency_total_tva' =>
'TotalVATShortCurrency',
156 'tva_tx' =>
'VatRate',
157 'localtax1_tx' =>
'Localtax1Rate',
158 'localtax2_tx' =>
'Localtax2Rate',
159 'vat_src_code' =>
'VATCode',
160 'multicurrency_code' =>
'Currency',
165 'address' =>
'Address',
167 'state_code' =>
'State',
168 'fk_pays' =>
'Country',
169 'fk_typent' =>
'CompanyType',
170 'revenuestamp' =>
'RevenueStamp',
171 'code_client' =>
'CustomerCode',
172 'code_fournisseur' =>
'SupplierCode',
173 'capital' =>
'Capital',
174 'localtax1_assuj' =>
'UseLocalTax1',
175 'localtax2_assuj' =>
'UseLocalTax2',
176 'localtax1_value' =>
'LocalTax1DefaultValue',
177 'localtax2_value' =>
'LocalTax2DefaultValue',
178 'subprice' =>
'UnitPrice',
179 'product_type' =>
'ProductType',
180 'product_label' =>
'ProductLabel',
181 'type' =>
'InvoiceType',
182 'info_bits' =>
'TVA NPR or NOT',
183 'special_code' =>
'Special line (WEEE line, option, id of module...)',
184 'status' =>
'Status',
185 'cash' =>
'PaymentTypeLIQ',
186 'cash_lifetime' => $langs->transnoentities(
'LifetimeAmount', $langs->transnoentities(
'PaymentTypeLIQ')),
187 'card' =>
'PaymentTypeCB',
188 'card_lifetime' => $langs->transnoentities(
'LifetimeAmount', $langs->transnoentities(
'PaymentTypeCB')),
189 'cheque' =>
'PaymentTypeCHQ',
190 'cheque_lifetime' => $langs->transnoentities(
'LifetimeAmount', $langs->transnoentities(
'PaymentTypeCHQ')),
191 'lifetime_start' =>
'LifetimeStartDate'
194 if (is_object($newobjtoshow) || is_array($newobjtoshow)) {
196 foreach ($newobjtoshow as $key => $val) {
197 if (!is_object($val) && !is_array($val)) {
203 $s .=
'<!-- '.$key.
' '.$arrayoffields[$key][
'type'].
''.$arrayoffields[$convertkey[$key]][
'label'].
' -->';
204 $s .= ($prefix ? $prefix.
' > ' :
'');
211 if (isset($arrayoffields[$key][
'label'])) {
212 $label = $langs->trans($tmpobject->fields[$key][
'label']);
213 } elseif (!empty($convertkey[$key]) && isset($arrayoffields[$convertkey[$key]][
'label'])) {
214 $label = $langs->trans($tmpobject->fields[$convertkey[$key]][
'label']);
215 } elseif ($prefix ==
'mycompany' || $prefix ==
'thirdparty') {
217 if (preg_match(
'/^idprof(\d+)$/', $key, $reg)) {
218 $countrycode = property_exists($newobjtoshow,
'country_code') ? ($newobjtoshow->country_code ??
'') :
'';
219 $label = $langs->trans(
"ProfId".$reg[1].$countrycode);
222 if (empty($label) && !empty($otherlabels[$key])) {
223 $label = $langs->trans($otherlabels[$key]);
225 if (empty($label) && array_key_exists($key, $convertkey) && array_key_exists((
string) $convertkey[$key], $otherlabels)) {
226 $label = $langs->trans((
string) $otherlabels[(
string) $convertkey[$key]]);
229 $label = array_key_exists($key, $convertkey) ? $convertkey[$key] :
'';
231 if (!empty($label)) {
232 $s .=
'<span class="opacitymedium">'.$label.
'</span>';
237 if (in_array($key, array(
'date',
'datef'))) {
239 } elseif (in_array($key, array(
'dateh',
'datec',
'date_creation',
'datem',
'tms',
'date_valid',
'datep'))) {
241 } elseif (in_array($key, array(
'tva_assuj',
'localtax1_assuj',
'localtax2_assuj'))) {
243 } elseif (in_array($key, array(
'product_type'))) {
244 $s .= $val ?
'Product' :
'Service';
245 } elseif (in_array($key, array(
247 'tva_tx',
'localtax1_tx',
'localtax2_tx',
'total_ht',
'total_ttc',
'total_tva',
'total_localtax1',
'total_localtax2',
'localtax2',
'localtax2',
'revenuestamp',
248 'multicurrency_total_ht',
'multicurrency_total_tva',
'multicurrency_total_ttc',
'multicurrency_subprice',
249 'opening',
'cash',
'cheque',
'card',
251 )) || (isset($arrayoffields[$key][
'type']) && in_array($arrayoffields[$key][
'type'], array(
'price')))) {
252 $s .=
'<span class="amount">'.price($val, 0, $langs, 1, 0, -2).
'</span>';
257 } elseif (is_array($val)) {
258 $s .= formatObject($val, ($prefix ? $prefix.
' > ' :
'').$key);
259 } elseif (is_object($val)) {
260 $s .= formatObject($val, ($prefix ? $prefix.
' > ' :
'').$key);
$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.