@@ -26,9 +26,9 @@ discard block |
||
| 26 | 26 | * \brief File of class with all html predefined components for WebPortal |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | -require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 30 | -require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; |
|
| 31 | -require_once DOL_DOCUMENT_ROOT . '/webportal/class/html.formwebportal.class.php'; |
|
| 29 | +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 30 | +require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; |
|
| 31 | +require_once DOL_DOCUMENT_ROOT.'/webportal/class/html.formwebportal.class.php'; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Class to manage generation of HTML components |
@@ -135,10 +135,10 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | // load module libraries |
| 138 | - dol_include_once('/webportal/class/webportal' . $elementEn . '.class.php'); |
|
| 138 | + dol_include_once('/webportal/class/webportal'.$elementEn.'.class.php'); |
|
| 139 | 139 | |
| 140 | 140 | // Initialize technical objects |
| 141 | - $objectclass = 'WebPortal' . ucfirst($elementEn); |
|
| 141 | + $objectclass = 'WebPortal'.ucfirst($elementEn); |
|
| 142 | 142 | $object = new $objectclass($this->db); |
| 143 | 143 | |
| 144 | 144 | // set form list |
@@ -148,18 +148,18 @@ discard block |
||
| 148 | 148 | $this->sortfield = GETPOST('sortfield', 'aZ09comma'); |
| 149 | 149 | $this->sortorder = GETPOST('sortorder', 'aZ09comma'); |
| 150 | 150 | $this->page = GETPOSTISSET('page') ? GETPOSTINT('page') : 1; |
| 151 | - $this->titleKey = $objectclass . 'ListTitle'; |
|
| 151 | + $this->titleKey = $objectclass.'ListTitle'; |
|
| 152 | 152 | |
| 153 | 153 | // Initialize array of search criteria |
| 154 | 154 | //$search_all = GETPOST('search_all', 'alphanohtml'); |
| 155 | 155 | $search = array(); |
| 156 | 156 | foreach ($object->fields as $key => $val) { |
| 157 | - if (GETPOST('search_' . $key, 'alpha') !== '') { |
|
| 158 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
| 157 | + if (GETPOST('search_'.$key, 'alpha') !== '') { |
|
| 158 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
| 159 | 159 | } |
| 160 | 160 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 161 | - $postDateStart = GETPOST('search_' . $key . '_dtstart', 'alphanohtml'); |
|
| 162 | - $postDateEnd = GETPOST('search_' . $key . '_dtend', 'alphanohtml'); |
|
| 161 | + $postDateStart = GETPOST('search_'.$key.'_dtstart', 'alphanohtml'); |
|
| 162 | + $postDateEnd = GETPOST('search_'.$key.'_dtend', 'alphanohtml'); |
|
| 163 | 163 | // extract date YYYY-MM-DD for year, month and day |
| 164 | 164 | $dateStartArr = explode('-', $postDateStart); |
| 165 | 165 | $dateEndArr = explode('-', $postDateEnd); |
@@ -167,13 +167,13 @@ discard block |
||
| 167 | 167 | $dateStartYear = (int) $dateStartArr[0]; |
| 168 | 168 | $dateStartMonth = (int) $dateStartArr[1]; |
| 169 | 169 | $dateStartDay = (int) $dateStartArr[2]; |
| 170 | - $search[$key . '_dtstart'] = dol_mktime(0, 0, 0, $dateStartMonth, $dateStartDay, $dateStartYear); |
|
| 170 | + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, $dateStartMonth, $dateStartDay, $dateStartYear); |
|
| 171 | 171 | } |
| 172 | 172 | if (count($dateEndArr) == 3) { |
| 173 | 173 | $dateEndYear = (int) $dateEndArr[0]; |
| 174 | 174 | $dateEndMonth = (int) $dateEndArr[1]; |
| 175 | 175 | $dateEndDay = (int) $dateEndArr[2]; |
| 176 | - $search[$key . '_dtend'] = dol_mktime(23, 59, 59, $dateEndMonth, $dateEndDay, $dateEndYear); |
|
| 176 | + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, $dateEndMonth, $dateEndDay, $dateEndYear); |
|
| 177 | 177 | } |
| 178 | 178 | } |
| 179 | 179 | } |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | // If $val['visible']==0, then we never show the field |
| 189 | 189 | if (!empty($val['visible'])) { |
| 190 | 190 | $visible = (int) dol_eval($val['visible'], 1); |
| 191 | - $arrayfields['t.' . $key] = array( |
|
| 191 | + $arrayfields['t.'.$key] = array( |
|
| 192 | 192 | 'label' => $val['label'], |
| 193 | 193 | 'checked' => (($visible < 0) ? 0 : 1), |
| 194 | 194 | 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), |
@@ -227,8 +227,8 @@ discard block |
||
| 227 | 227 | foreach ($object->fields as $key => $val) { |
| 228 | 228 | $search[$key] = ''; |
| 229 | 229 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 230 | - $search[$key . '_dtstart'] = ''; |
|
| 231 | - $search[$key . '_dtend'] = ''; |
|
| 230 | + $search[$key.'_dtstart'] = ''; |
|
| 231 | + $search[$key.'_dtend'] = ''; |
|
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | 234 | $this->search = $search; |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | $offset = $limit * ($page - 1); |
| 284 | 284 | if (!$sortfield) { |
| 285 | 285 | reset($object->fields); // Reset is required to avoid key() to return null. |
| 286 | - $sortfield = 't.' . key($object->fields); // Set here default search field. By default 1st field in definition. |
|
| 286 | + $sortfield = 't.'.key($object->fields); // Set here default search field. By default 1st field in definition. |
|
| 287 | 287 | } |
| 288 | 288 | if (!$sortorder) { |
| 289 | 289 | $sortorder = 'DESC'; |
@@ -304,18 +304,18 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | $sqlfields = $sql; // $sql fields to remove for count total |
| 306 | 306 | |
| 307 | - $sql .= " FROM " . $this->db->prefix() . $object->table_element . " as t"; |
|
| 307 | + $sql .= " FROM ".$this->db->prefix().$object->table_element." as t"; |
|
| 308 | 308 | // Add table from hooks |
| 309 | 309 | $parameters = array(); |
| 310 | 310 | $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 311 | 311 | $sql .= $hookmanager->resPrint; |
| 312 | 312 | if ($object->ismultientitymanaged == 1) { |
| 313 | - $sql .= " WHERE t.entity IN (" . getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)) . ")"; |
|
| 313 | + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; |
|
| 314 | 314 | } else { |
| 315 | 315 | $sql .= " WHERE 1 = 1"; |
| 316 | 316 | } |
| 317 | 317 | // filter on logged third-party |
| 318 | - $sql .= " AND t.fk_soc = " . ((int) $socid); |
|
| 318 | + $sql .= " AND t.fk_soc = ".((int) $socid); |
|
| 319 | 319 | // discard record with status draft |
| 320 | 320 | $sql .= " AND t.fk_statut <> 0"; |
| 321 | 321 | |
@@ -332,17 +332,17 @@ discard block |
||
| 332 | 332 | $mode_search = 2; |
| 333 | 333 | } |
| 334 | 334 | if ($search[$key] != '') { |
| 335 | - $sql .= natural_search("t." . $this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search)); |
|
| 335 | + $sql .= natural_search("t.".$this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search)); |
|
| 336 | 336 | } |
| 337 | 337 | } else { |
| 338 | 338 | if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { |
| 339 | 339 | $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); |
| 340 | 340 | if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { |
| 341 | 341 | if (preg_match('/_dtstart$/', $key)) { |
| 342 | - $sql .= " AND t." . $this->db->escape($columnName) . " >= '" . $this->db->idate($search[$key]) . "'"; |
|
| 342 | + $sql .= " AND t.".$this->db->escape($columnName)." >= '".$this->db->idate($search[$key])."'"; |
|
| 343 | 343 | } |
| 344 | 344 | if (preg_match('/_dtend$/', $key)) { |
| 345 | - $sql .= " AND t." . $this->db->escape($columnName) . " <= '" . $this->db->idate($search[$key]) . "'"; |
|
| 345 | + $sql .= " AND t.".$this->db->escape($columnName)." <= '".$this->db->idate($search[$key])."'"; |
|
| 346 | 346 | } |
| 347 | 347 | } |
| 348 | 348 | } |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | $nbtotalofrecords = 0; |
| 361 | 361 | if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { |
| 362 | 362 | /* The fast and low memory method to get and count full list converts the sql into a sql count */ |
| 363 | - $sqlforcount = preg_replace('/^' . preg_quote($sqlfields, '/') . '/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); |
|
| 363 | + $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); |
|
| 364 | 364 | $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); |
| 365 | 365 | $resql = $this->db->query($sqlforcount); |
| 366 | 366 | if ($resql) { |
@@ -413,21 +413,21 @@ discard block |
||
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | $param = ''; |
| 416 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
| 417 | - $param .= '&limit=' . $limit; |
|
| 416 | + $param .= '&contextpage='.urlencode($contextpage); |
|
| 417 | + $param .= '&limit='.$limit; |
|
| 418 | 418 | foreach ($search as $key => $val) { |
| 419 | 419 | if (is_array($search[$key])) { |
| 420 | 420 | foreach ($search[$key] as $skey) { |
| 421 | 421 | if ($skey != '') { |
| 422 | - $param .= '&search_' . $key . '[]=' . urlencode($skey); |
|
| 422 | + $param .= '&search_'.$key.'[]='.urlencode($skey); |
|
| 423 | 423 | } |
| 424 | 424 | } |
| 425 | 425 | } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { |
| 426 | - $param .= '&search_' . $key . 'month=' . (GETPOSTINT('search_' . $key . 'month')); |
|
| 427 | - $param .= '&search_' . $key . 'day=' . (GETPOSTINT('search_' . $key . 'day')); |
|
| 428 | - $param .= '&search_' . $key . 'year=' . (GETPOSTINT('search_' . $key . 'year')); |
|
| 426 | + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); |
|
| 427 | + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); |
|
| 428 | + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); |
|
| 429 | 429 | } elseif ($search[$key] != '') { |
| 430 | - $param .= '&search_' . $key . '=' . urlencode($search[$key]); |
|
| 430 | + $param .= '&search_'.$key.'='.urlencode($search[$key]); |
|
| 431 | 431 | } |
| 432 | 432 | } |
| 433 | 433 | // Add $param from hooks |
@@ -436,29 +436,29 @@ discard block |
||
| 436 | 436 | $param .= $hookmanager->resPrint; |
| 437 | 437 | |
| 438 | 438 | $url_file = $context->getControllerUrl($context->controller); |
| 439 | - $html .= '<form method="POST" id="searchFormList" action="' . $url_file . '">' . "\n"; |
|
| 439 | + $html .= '<form method="POST" id="searchFormList" action="'.$url_file.'">'."\n"; |
|
| 440 | 440 | $html .= $context->getFormToken(); |
| 441 | 441 | $html .= '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
| 442 | 442 | $html .= '<input type="hidden" name="action" value="list">'; |
| 443 | - $html .= '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
| 444 | - $html .= '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
| 445 | - $html .= '<input type="hidden" name="page" value="' . $page . '">'; |
|
| 446 | - $html .= '<input type="hidden" name="contextpage" value="' . $contextpage . '">'; |
|
| 443 | + $html .= '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
| 444 | + $html .= '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
| 445 | + $html .= '<input type="hidden" name="page" value="'.$page.'">'; |
|
| 446 | + $html .= '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; |
|
| 447 | 447 | |
| 448 | 448 | // pagination |
| 449 | - $pagination_param = $param . '&sortfield=' . $sortfield . '&sortorder=' . $sortorder; |
|
| 450 | - $html .= '<nav id="webportal-' . $elementEn . '-pagination">'; |
|
| 449 | + $pagination_param = $param.'&sortfield='.$sortfield.'&sortorder='.$sortorder; |
|
| 450 | + $html .= '<nav id="webportal-'.$elementEn.'-pagination">'; |
|
| 451 | 451 | $html .= '<ul>'; |
| 452 | - $html .= '<li><strong>' . $langs->trans($titleKey) . '</strong> (' . $nbtotalofrecords . ')</li>'; |
|
| 452 | + $html .= '<li><strong>'.$langs->trans($titleKey).'</strong> ('.$nbtotalofrecords.')</li>'; |
|
| 453 | 453 | $html .= '</ul>'; |
| 454 | 454 | |
| 455 | 455 | /* Generate pagination list */ |
| 456 | - $html .= static::generatePageListNav($url_file . $pagination_param, $nbpages, $page); |
|
| 456 | + $html .= static::generatePageListNav($url_file.$pagination_param, $nbpages, $page); |
|
| 457 | 457 | |
| 458 | 458 | $html .= '</nav>'; |
| 459 | 459 | |
| 460 | 460 | // table with search filters and column titles |
| 461 | - $html .= '<table id="webportal-' . $elementEn . '-list" responsive="scroll" role="grid">'; |
|
| 461 | + $html .= '<table id="webportal-'.$elementEn.'-list" responsive="scroll" role="grid">'; |
|
| 462 | 462 | // title and desc for table |
| 463 | 463 | //if ($titleKey != '') { |
| 464 | 464 | // $html .= '<caption id="table-collapse-responsive">'; |
@@ -482,22 +482,22 @@ discard block |
||
| 482 | 482 | $html .= '</td>'; |
| 483 | 483 | // } |
| 484 | 484 | foreach ($object->fields as $key => $val) { |
| 485 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 486 | - $html .= '<td data-label="' . $arrayfields['t.' . $key]['label'] . '" data-col="'.dol_escape_htmltag($key).'" >'; |
|
| 485 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 486 | + $html .= '<td data-label="'.$arrayfields['t.'.$key]['label'].'" data-col="'.dol_escape_htmltag($key).'" >'; |
|
| 487 | 487 | if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { |
| 488 | - $html .= $this->form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', ''); |
|
| 488 | + $html .= $this->form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', ''); |
|
| 489 | 489 | } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 490 | - $postDateStart = GETPOST('search_' . $key . '_dtstart', 'alphanohtml'); |
|
| 491 | - $postDateEnd = GETPOST('search_' . $key . '_dtend', 'alphanohtml'); |
|
| 490 | + $postDateStart = GETPOST('search_'.$key.'_dtstart', 'alphanohtml'); |
|
| 491 | + $postDateEnd = GETPOST('search_'.$key.'_dtend', 'alphanohtml'); |
|
| 492 | 492 | |
| 493 | 493 | $html .= '<div class="grid">'; |
| 494 | - $html .= $this->form->inputDate('search_' . $key . '_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From')); |
|
| 494 | + $html .= $this->form->inputDate('search_'.$key.'_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From')); |
|
| 495 | 495 | $html .= '</div>'; |
| 496 | 496 | $html .= '<div class="grid">'; |
| 497 | - $html .= $this->form->inputDate('search_' . $key . '_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to')); |
|
| 497 | + $html .= $this->form->inputDate('search_'.$key.'_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to')); |
|
| 498 | 498 | $html .= '</div>'; |
| 499 | 499 | } else { |
| 500 | - $html .= '<input type="text" name="search_' . $key . '" value="' . dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '') . '">'; |
|
| 500 | + $html .= '<input type="text" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">'; |
|
| 501 | 501 | } |
| 502 | 502 | $html .= '</td>'; |
| 503 | 503 | } |
@@ -508,19 +508,19 @@ discard block |
||
| 508 | 508 | $html .= $hookmanager->resPrint; |
| 509 | 509 | // Remain to pay |
| 510 | 510 | if (!empty($arrayfields['remain_to_pay']['checked'])) { |
| 511 | - $html .= '<td data-label="' . $arrayfields['remain_to_pay']['label'] . '">'; |
|
| 511 | + $html .= '<td data-label="'.$arrayfields['remain_to_pay']['label'].'">'; |
|
| 512 | 512 | $html .= '</td>'; |
| 513 | 513 | } |
| 514 | 514 | // Download link |
| 515 | 515 | if (!empty($arrayfields['download_link']['checked'])) { |
| 516 | - $html .= '<td data-label="' . $arrayfields['download_link']['label'] . '">'; |
|
| 516 | + $html .= '<td data-label="'.$arrayfields['download_link']['label'].'">'; |
|
| 517 | 517 | $html .= '</td>'; |
| 518 | 518 | } |
| 519 | 519 | $html .= '</tr>'; |
| 520 | 520 | // Signature link |
| 521 | 521 | if ($elementEn == "propal" && getDolGlobalString("PROPOSAL_ALLOW_ONLINESIGN") != 0) { |
| 522 | 522 | if (!empty($arrayfields['signature_link']['checked'])) { |
| 523 | - $html .= '<td data-label="' . $arrayfields['signature_link']['label'] . '">'; |
|
| 523 | + $html .= '<td data-label="'.$arrayfields['signature_link']['label'].'">'; |
|
| 524 | 524 | $html .= '</td>'; |
| 525 | 525 | } |
| 526 | 526 | } |
@@ -537,16 +537,16 @@ discard block |
||
| 537 | 537 | $totalarray['nbfield']++; |
| 538 | 538 | // } |
| 539 | 539 | foreach ($object->fields as $key => $val) { |
| 540 | - $tableKey = 't.' . $key; |
|
| 540 | + $tableKey = 't.'.$key; |
|
| 541 | 541 | if (!empty($arrayfields[$tableKey]['checked'])) { |
| 542 | 542 | $tableOrder = ''; |
| 543 | 543 | if (array_key_exists($tableKey, $sortList)) { |
| 544 | 544 | $tableOrder = strtolower($sortList[$tableKey]); |
| 545 | 545 | } |
| 546 | - $url_param = $url_file . '&sortfield=' . $tableKey . '&sortorder=' . ($tableOrder == 'desc' ? 'asc' : 'desc') . $param; |
|
| 547 | - $html .= '<th data-col="'.dol_escape_htmltag($key).'" scope="col"' . ($tableOrder != '' ? ' table-order="' . $tableOrder . '"' : '') . '>'; |
|
| 548 | - $html .= '<a href="' . $url_param . '">'; |
|
| 549 | - $html .= $langs->trans($arrayfields['t.' . $key]['label']); |
|
| 546 | + $url_param = $url_file.'&sortfield='.$tableKey.'&sortorder='.($tableOrder == 'desc' ? 'asc' : 'desc').$param; |
|
| 547 | + $html .= '<th data-col="'.dol_escape_htmltag($key).'" scope="col"'.($tableOrder != '' ? ' table-order="'.$tableOrder.'"' : '').'>'; |
|
| 548 | + $html .= '<a href="'.$url_param.'">'; |
|
| 549 | + $html .= $langs->trans($arrayfields['t.'.$key]['label']); |
|
| 550 | 550 | $html .= '</a>'; |
| 551 | 551 | $html .= '</th>'; |
| 552 | 552 | $totalarray['nbfield']++; |
@@ -627,13 +627,13 @@ discard block |
||
| 627 | 627 | $remaintopay = 0; |
| 628 | 628 | } |
| 629 | 629 | if ($object->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1 && $discount) { |
| 630 | - $remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source=' . $object->id); |
|
| 630 | + $remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source='.$object->id); |
|
| 631 | 631 | $remaintopay = -$remaincreditnote; |
| 632 | 632 | } |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | // Show line of result |
| 636 | - $html .= '<tr data-rowid="' . $object->id . '">'; |
|
| 636 | + $html .= '<tr data-rowid="'.$object->id.'">'; |
|
| 637 | 637 | // if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
| 638 | 638 | $html .= '<td class="nowraponall">'; |
| 639 | 639 | $html .= '</td>'; |
@@ -642,8 +642,8 @@ discard block |
||
| 642 | 642 | } |
| 643 | 643 | // } |
| 644 | 644 | foreach ($object->fields as $key => $val) { |
| 645 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 646 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['t.' . $key]['label'] . '">'; |
|
| 645 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 646 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['t.'.$key]['label'].'">'; |
|
| 647 | 647 | if ($key == 'status' || $key == 'fk_statut') { |
| 648 | 648 | if ($elementEn == 'invoice') { |
| 649 | 649 | // specific to get invoice status (depends on payment) |
@@ -664,21 +664,21 @@ discard block |
||
| 664 | 664 | } |
| 665 | 665 | if (!empty($val['isameasure']) && $val['isameasure'] == 1) { |
| 666 | 666 | if (!$i) { |
| 667 | - $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; |
|
| 667 | + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; |
|
| 668 | 668 | } |
| 669 | 669 | if (!isset($totalarray['val'])) { |
| 670 | 670 | $totalarray['val'] = array(); |
| 671 | 671 | } |
| 672 | - if (!isset($totalarray['val']['t.' . $key])) { |
|
| 673 | - $totalarray['val']['t.' . $key] = 0; |
|
| 672 | + if (!isset($totalarray['val']['t.'.$key])) { |
|
| 673 | + $totalarray['val']['t.'.$key] = 0; |
|
| 674 | 674 | } |
| 675 | - $totalarray['val']['t.' . $key] += $object->$key; |
|
| 675 | + $totalarray['val']['t.'.$key] += $object->$key; |
|
| 676 | 676 | } |
| 677 | 677 | } |
| 678 | 678 | } |
| 679 | 679 | // Remain to pay |
| 680 | 680 | if (!empty($arrayfields['remain_to_pay']['checked'])) { |
| 681 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['remain_to_pay']['label'] . '">'; |
|
| 681 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['remain_to_pay']['label'].'">'; |
|
| 682 | 682 | $html .= $this->form->showOutputFieldForObject($object, $arrayfields['remain_to_pay'], 'remain_to_pay', $remaintopay, ''); |
| 683 | 683 | //$html .= price($remaintopay); |
| 684 | 684 | $html .= '</td>'; |
@@ -689,9 +689,9 @@ discard block |
||
| 689 | 689 | // Download link |
| 690 | 690 | if (!empty($arrayfields['download_link']['checked'])) { |
| 691 | 691 | $element = $object->element; |
| 692 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['download_link']['label'] . '">'; |
|
| 692 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['download_link']['label'].'">'; |
|
| 693 | 693 | $filename = dol_sanitizeFileName($obj->ref); |
| 694 | - $filedir = $conf->{$element}->multidir_output[$obj->element_entity] . '/' . dol_sanitizeFileName($obj->ref); |
|
| 694 | + $filedir = $conf->{$element}->multidir_output[$obj->element_entity].'/'.dol_sanitizeFileName($obj->ref); |
|
| 695 | 695 | $html .= $this->form->getDocumentsLink($element, $filename, $filedir); |
| 696 | 696 | $html .= '</td>'; |
| 697 | 697 | if (!$i) { |
@@ -701,7 +701,7 @@ discard block |
||
| 701 | 701 | // Signature link |
| 702 | 702 | if ($elementEn == "propal" && getDolGlobalString("PROPOSAL_ALLOW_ONLINESIGN") != 0) { |
| 703 | 703 | if (!empty($arrayfields['signature_link']['checked'])) { |
| 704 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['signature_link']['label'] . '">'; |
|
| 704 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['signature_link']['label'].'">'; |
|
| 705 | 705 | if ($object->fk_statut == Propal::STATUS_VALIDATED) { |
| 706 | 706 | $html .= $this->form->getSignatureLink('proposal', $object); |
| 707 | 707 | } |
@@ -740,7 +740,7 @@ discard block |
||
| 740 | 740 | $html .= '</td>'; |
| 741 | 741 | } else { |
| 742 | 742 | if ($i == 1) { |
| 743 | - $html .= '<td>' . $langs->trans("Total") . '</td>'; |
|
| 743 | + $html .= '<td>'.$langs->trans("Total").'</td>'; |
|
| 744 | 744 | } else { |
| 745 | 745 | $html .= '<td></td>'; |
| 746 | 746 | } |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | $colspan++; |
| 758 | 758 | } |
| 759 | 759 | } |
| 760 | - $html .= '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
| 760 | + $html .= '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
| 761 | 761 | } |
| 762 | 762 | |
| 763 | 763 | $html .= '</tbody>'; |
@@ -797,7 +797,7 @@ discard block |
||
| 797 | 797 | $html = '<ul class="pages-nav-list">'; |
| 798 | 798 | |
| 799 | 799 | if ($currentPage > 1) { |
| 800 | - $html .= '<li><a class="pages-nav-list__icon --prev" aria-label="' . dol_escape_htmltag($langs->trans('AriaPrevPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage - 1) . '" ' . ($currentPage <= 1 ? ' disabled' : '') . '></a></li>'; |
|
| 800 | + $html .= '<li><a class="pages-nav-list__icon --prev" aria-label="'.dol_escape_htmltag($langs->trans('AriaPrevPage')).'" href="'.$url.$pSep.'page='.($currentPage - 1).'" '.($currentPage <= 1 ? ' disabled' : '').'></a></li>'; |
|
| 801 | 801 | } |
| 802 | 802 | |
| 803 | 803 | $maxPaginItem = min($nbPages, 5); |
@@ -805,21 +805,21 @@ discard block |
||
| 805 | 805 | $maxPageNum = min($nbPages, $currentPage + 3); |
| 806 | 806 | |
| 807 | 807 | if ($minPageNum > 1) { |
| 808 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage == 1 ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', 1)) . '" href="' . $url . $pSep . 'page=1" >1</a></li>'; |
|
| 808 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage == 1 ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', 1)).'" href="'.$url.$pSep.'page=1" >1</a></li>'; |
|
| 809 | 809 | $html .= '<li>…</li>'; |
| 810 | 810 | } |
| 811 | 811 | |
| 812 | 812 | for ($p = $minPageNum; $p <= $maxPageNum; $p++) { |
| 813 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage === $p ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $p)) . '" href="' . $url . $pSep . 'page=' . $p . '">' . $p . '</a></li>'; |
|
| 813 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage === $p ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $p)).'" href="'.$url.$pSep.'page='.$p.'">'.$p.'</a></li>'; |
|
| 814 | 814 | } |
| 815 | 815 | |
| 816 | 816 | if ($maxPaginItem < $nbPages) { |
| 817 | 817 | $html .= '<li>…</li>'; |
| 818 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage == $nbPages ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)) . '" href="' . $url . $pSep . 'page=' . $nbPages . '">' . $nbPages . '</a></li>'; |
|
| 818 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage == $nbPages ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)).'" href="'.$url.$pSep.'page='.$nbPages.'">'.$nbPages.'</a></li>'; |
|
| 819 | 819 | } |
| 820 | 820 | |
| 821 | 821 | if ($currentPage < $nbPages) { |
| 822 | - $html .= '<li><a class="pages-nav-list__icon --next" aria-label="' . dol_escape_htmltag($langs->trans('AriaNextPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage + 1) . '" ' . ($currentPage >= $nbPages ? ' disabled' : '') . '></a></li>'; |
|
| 822 | + $html .= '<li><a class="pages-nav-list__icon --next" aria-label="'.dol_escape_htmltag($langs->trans('AriaNextPage')).'" href="'.$url.$pSep.'page='.($currentPage + 1).'" '.($currentPage >= $nbPages ? ' disabled' : '').'></a></li>'; |
|
| 823 | 823 | } |
| 824 | 824 | |
| 825 | 825 | $html .= '</ul>'; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * \brief File of class with all html predefined components for WebPortal |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; |
|
| 29 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Class to manage generation of HTML components |
@@ -72,19 +72,19 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | $out = ''; |
| 74 | 74 | if ($label != '') { |
| 75 | - $out .= '<label for="' . $id . '">'; |
|
| 75 | + $out .= '<label for="'.$id.'">'; |
|
| 76 | 76 | } |
| 77 | - $out .= '<input type="' . $type . '"'; |
|
| 78 | - $out .= ($morecss ? ' class="' . $morecss . '"' : ''); |
|
| 77 | + $out .= '<input type="'.$type.'"'; |
|
| 78 | + $out .= ($morecss ? ' class="'.$morecss.'"' : ''); |
|
| 79 | 79 | if ($id != '') { |
| 80 | - $out .= ' id="' . $id . '"'; |
|
| 80 | + $out .= ' id="'.$id.'"'; |
|
| 81 | 81 | } |
| 82 | - $out .= ' name="' . $name . '"'; |
|
| 83 | - $out .= ' value="' . $value . '"'; |
|
| 84 | - $out .= ($moreparam ? ' ' . $moreparam : ''); |
|
| 85 | - $out .= ' />' . $addInputLabel; |
|
| 82 | + $out .= ' name="'.$name.'"'; |
|
| 83 | + $out .= ' value="'.$value.'"'; |
|
| 84 | + $out .= ($moreparam ? ' '.$moreparam : ''); |
|
| 85 | + $out .= ' />'.$addInputLabel; |
|
| 86 | 86 | if ($label != '') { |
| 87 | - $out .= $label . '</label>'; |
|
| 87 | + $out .= $label.'</label>'; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | return $out; |
@@ -108,17 +108,17 @@ discard block |
||
| 108 | 108 | $out .= '<input'; |
| 109 | 109 | if ($placeholder != '' && $value == '') { |
| 110 | 110 | // to show a placeholder on date input |
| 111 | - $out .= ' type="text" placeholder="' . $placeholder . '" onfocus="(this.type=\'date\')"'; |
|
| 111 | + $out .= ' type="text" placeholder="'.$placeholder.'" onfocus="(this.type=\'date\')"'; |
|
| 112 | 112 | } else { |
| 113 | 113 | $out .= ' type="date"'; |
| 114 | 114 | } |
| 115 | - $out .= ($morecss ? ' class="' . $morecss . '"' : ''); |
|
| 115 | + $out .= ($morecss ? ' class="'.$morecss.'"' : ''); |
|
| 116 | 116 | if ($id != '') { |
| 117 | - $out .= ' id="' . $id . '"'; |
|
| 117 | + $out .= ' id="'.$id.'"'; |
|
| 118 | 118 | } |
| 119 | - $out .= ' name="' . $name . '"'; |
|
| 120 | - $out .= ' value="' . $value . '"'; |
|
| 121 | - $out .= ($moreparam ? ' ' . $moreparam : ''); |
|
| 119 | + $out .= ' name="'.$name.'"'; |
|
| 120 | + $out .= ' value="'.$value.'"'; |
|
| 121 | + $out .= ($moreparam ? ' '.$moreparam : ''); |
|
| 122 | 122 | |
| 123 | 123 | $out .= '>'; |
| 124 | 124 | |
@@ -158,16 +158,16 @@ discard block |
||
| 158 | 158 | $out = ''; |
| 159 | 159 | |
| 160 | 160 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
| 161 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '"' . ($disabled ? ' disabled="disabled"' : '') . ' class="' . ($morecss ? ' ' . $morecss : '') . '"'; |
|
| 162 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '"' . ($moreparam ? ' ' . $moreparam : ''); |
|
| 163 | - $out .= '>' . "\n"; |
|
| 161 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'"'.($disabled ? ' disabled="disabled"' : '').' class="'.($morecss ? ' '.$morecss : '').'"'; |
|
| 162 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'"'.($moreparam ? ' '.$moreparam : ''); |
|
| 163 | + $out .= '>'."\n"; |
|
| 164 | 164 | |
| 165 | 165 | if ($show_empty) { |
| 166 | 166 | $textforempty = ' '; |
| 167 | 167 | if (!is_numeric($show_empty)) { |
| 168 | 168 | $textforempty = $show_empty; |
| 169 | 169 | } |
| 170 | - $out .= '<option value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 170 | + $out .= '<option value="'.($show_empty < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | if (is_array($array)) { |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | if ($key_in_label) { |
| 202 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 202 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 203 | 203 | } else { |
| 204 | 204 | $selectOptionValue = dol_escape_htmltag($maxlen ? dol_trunc($value, $maxlen) : $value); |
| 205 | 205 | if ($value == '' || $value == '-') { |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - $out .= '<option value="' . $key . '"'; |
|
| 210 | + $out .= '<option value="'.$key.'"'; |
|
| 211 | 211 | $out .= $disabled; |
| 212 | 212 | if (is_array($id)) { |
| 213 | 213 | if (in_array($key, $id) && !$disabled) { |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | if (is_array($tmpvalue)) { |
| 223 | 223 | foreach ($tmpvalue as $keyforvalue => $valueforvalue) { |
| 224 | 224 | if (preg_match('/^data-/', $keyforvalue)) { |
| 225 | - $out .= ' ' . $keyforvalue . '="' . dol_escape_htmltag($valueforvalue) . '"'; |
|
| 225 | + $out .= ' '.$keyforvalue.'="'.dol_escape_htmltag($valueforvalue).'"'; |
|
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | } |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | */ |
| 253 | 253 | public function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = '', $morecss = '', $allfiles = 0) |
| 254 | 254 | { |
| 255 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 255 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
| 256 | 256 | |
| 257 | 257 | $out = ''; |
| 258 | 258 | |
@@ -268,21 +268,21 @@ discard block |
||
| 268 | 268 | // Get object entity |
| 269 | 269 | if (isModEnabled('multicompany')) { |
| 270 | 270 | $regs = array(); |
| 271 | - preg_match('/\/([0-9]+)\/[^\/]+\/' . preg_quote($modulesubdir, '/') . '$/', $filedir, $regs); |
|
| 271 | + preg_match('/\/([0-9]+)\/[^\/]+\/'.preg_quote($modulesubdir, '/').'$/', $filedir, $regs); |
|
| 272 | 272 | $entity = ((!empty($regs[1]) && $regs[1] > 1) ? $regs[1] : 1); // If entity id not found in $filedir this is entity 1 by default |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | // Get list of files starting with name of ref (Note: files with '^ref\.extension' are generated files, files with '^ref-...' are uploaded files) |
| 276 | 276 | if ($allfiles || getDolGlobalString('MAIN_SHOW_ALL_FILES_ON_DOCUMENT_TOOLTIP')) { |
| 277 | - $filterforfilesearch = '^' . preg_quote(basename($modulesubdir), '/'); |
|
| 277 | + $filterforfilesearch = '^'.preg_quote(basename($modulesubdir), '/'); |
|
| 278 | 278 | } else { |
| 279 | - $filterforfilesearch = '^' . preg_quote(basename($modulesubdir), '/') . '\.'; |
|
| 279 | + $filterforfilesearch = '^'.preg_quote(basename($modulesubdir), '/').'\.'; |
|
| 280 | 280 | } |
| 281 | 281 | $file_list = dol_dir_list($filedir, 'files', 0, $filterforfilesearch, '\.meta$|\.png$'); // We also discard .meta and .png preview |
| 282 | 282 | |
| 283 | 283 | //var_dump($file_list); |
| 284 | 284 | // For ajax treatment |
| 285 | - $out .= '<!-- html.formwebportal::getDocumentsLink -->' . "\n"; |
|
| 285 | + $out .= '<!-- html.formwebportal::getDocumentsLink -->'."\n"; |
|
| 286 | 286 | if (!empty($file_list)) { |
| 287 | 287 | $tmpout = ''; |
| 288 | 288 | |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | $i = 0; |
| 292 | 292 | foreach ($file_list as $file) { |
| 293 | 293 | $i++; |
| 294 | - if ($filter && !preg_match('/' . $filter . '/i', $file["name"])) { |
|
| 294 | + if ($filter && !preg_match('/'.$filter.'/i', $file["name"])) { |
|
| 295 | 295 | continue; // Discard this. It does not match provided filter. |
| 296 | 296 | } |
| 297 | 297 | |
@@ -299,11 +299,11 @@ discard block |
||
| 299 | 299 | // Define relative path for download link (depends on module) |
| 300 | 300 | $relativepath = $file["name"]; // Cas general |
| 301 | 301 | if ($modulesubdir) { |
| 302 | - $relativepath = $modulesubdir . "/" . $file["name"]; // Cas propal, facture... |
|
| 302 | + $relativepath = $modulesubdir."/".$file["name"]; // Cas propal, facture... |
|
| 303 | 303 | } |
| 304 | 304 | // Autre cas |
| 305 | 305 | if ($modulepart == 'donation') { |
| 306 | - $relativepath = get_exdir($modulesubdir, 2, 0, 0, null, 'donation') . $file["name"]; |
|
| 306 | + $relativepath = get_exdir($modulesubdir, 2, 0, 0, null, 'donation').$file["name"]; |
|
| 307 | 307 | } |
| 308 | 308 | if ($modulepart == 'export') { |
| 309 | 309 | $relativepath = $file["name"]; |
@@ -319,8 +319,8 @@ discard block |
||
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | // Download |
| 322 | - $url = $context->getControllerUrl('document') . '&modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($relativepath) . '&soc_id=' . $context->logged_thirdparty->id; |
|
| 323 | - $tmpout .= '<a href="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . ' role="downloadlink"'; |
|
| 322 | + $url = $context->getControllerUrl('document').'&modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($relativepath).'&soc_id='.$context->logged_thirdparty->id; |
|
| 323 | + $tmpout .= '<a href="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').' role="downloadlink"'; |
|
| 324 | 324 | $mime = dol_mimetype($relativepath, '', 0); |
| 325 | 325 | if (preg_match('/text/', $mime)) { |
| 326 | 326 | $tmpout .= ' target="_blank" rel="noopener noreferrer"'; |
@@ -353,10 +353,10 @@ discard block |
||
| 353 | 353 | { |
| 354 | 354 | global $langs; |
| 355 | 355 | require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php'; |
| 356 | - $out = '<!-- html.formwebportal::getSignatureLink -->' . "\n"; |
|
| 356 | + $out = '<!-- html.formwebportal::getSignatureLink -->'."\n"; |
|
| 357 | 357 | $url = getOnlineSignatureUrl(0, $modulepart, $object->ref, 1, $object); |
| 358 | 358 | if (!empty($url)) { |
| 359 | - $out .= '<a target="_blank" rel="noopener noreferrer" href="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . ' role="signaturelink">'; |
|
| 359 | + $out .= '<a target="_blank" rel="noopener noreferrer" href="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').' role="signaturelink">'; |
|
| 360 | 360 | $out .= '<i class="fa fa-file-signature"></i>'; |
| 361 | 361 | $out .= $langs->trans("Sign"); |
| 362 | 362 | $out .= '</a>'; |
@@ -398,9 +398,9 @@ discard block |
||
| 398 | 398 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
| 399 | 399 | $reg = array(); |
| 400 | 400 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
| 401 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 401 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 402 | 402 | } |
| 403 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 403 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 404 | 404 | |
| 405 | 405 | $classname = $InfoFieldList[0]; |
| 406 | 406 | $classpath = $InfoFieldList[1]; |
@@ -423,11 +423,11 @@ discard block |
||
| 423 | 423 | } |
| 424 | 424 | } |
| 425 | 425 | if (!is_object($objecttmp)) { |
| 426 | - dol_syslog('Error bad setup of type for field ' . implode(',', $InfoFieldList), LOG_WARNING); |
|
| 427 | - return 'Error bad setup of type for field ' . implode(',', $InfoFieldList); |
|
| 426 | + dol_syslog('Error bad setup of type for field '.implode(',', $InfoFieldList), LOG_WARNING); |
|
| 427 | + return 'Error bad setup of type for field '.implode(',', $InfoFieldList); |
|
| 428 | 428 | } |
| 429 | 429 | |
| 430 | - dol_syslog(__METHOD__ . ' filter=' . $filter, LOG_DEBUG); |
|
| 430 | + dol_syslog(__METHOD__.' filter='.$filter, LOG_DEBUG); |
|
| 431 | 431 | $out = ''; |
| 432 | 432 | // Immediate load of table record. |
| 433 | 433 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | if ($prefixforautocompletemode == 'societe') { |
| 464 | 464 | $prefixforautocompletemode = 'company'; |
| 465 | 465 | } |
| 466 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 466 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 467 | 467 | |
| 468 | 468 | if (in_array($objecttmp->element, array('adherent_type'))) { |
| 469 | 469 | $fieldstoshow = 't.libelle'; |
@@ -471,11 +471,11 @@ discard block |
||
| 471 | 471 | if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
| 472 | 472 | $tmpfieldstoshow = ''; |
| 473 | 473 | foreach ($objecttmp->fields as $key => $val) { |
| 474 | - if (! (int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 474 | + if (!(int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 475 | 475 | continue; |
| 476 | 476 | } |
| 477 | 477 | if (!empty($val['showoncombobox'])) { |
| 478 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
| 478 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
| 479 | 479 | } |
| 480 | 480 | } |
| 481 | 481 | if ($tmpfieldstoshow) { |
@@ -503,11 +503,11 @@ discard block |
||
| 503 | 503 | $num = 0; |
| 504 | 504 | |
| 505 | 505 | // Search data |
| 506 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; |
|
| 506 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t"; |
|
| 507 | 507 | if (isset($objecttmp->ismultientitymanaged)) { |
| 508 | 508 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 509 | 509 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
| 510 | - $sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0]; |
|
| 510 | + $sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; |
|
| 511 | 511 | } |
| 512 | 512 | } |
| 513 | 513 | |
@@ -526,10 +526,10 @@ discard block |
||
| 526 | 526 | $sql .= " WHERE 1=1"; |
| 527 | 527 | if (isset($objecttmp->ismultientitymanaged)) { |
| 528 | 528 | if ($objecttmp->ismultientitymanaged == 1) { |
| 529 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
| 529 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
| 530 | 530 | } |
| 531 | 531 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 532 | - $sql .= " AND parenttable.entity = t." . $tmparray[0]; |
|
| 532 | + $sql .= " AND parenttable.entity = t.".$tmparray[0]; |
|
| 533 | 533 | } |
| 534 | 534 | } |
| 535 | 535 | if ($searchkey != '') { |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | $errormessage = ''; |
| 541 | 541 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
| 542 | 542 | if ($errormessage) { |
| 543 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
| 543 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
| 544 | 544 | } |
| 545 | 545 | } |
| 546 | 546 | } |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | $resql = $this->db->query($sql); |
| 551 | 551 | if ($resql) { |
| 552 | 552 | // Construct $out and $outarray |
| 553 | - $out .= '<select id="' . $htmlname . '" class="' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
| 553 | + $out .= '<select id="'.$htmlname.'" class="'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
| 554 | 554 | |
| 555 | 555 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
| 556 | 556 | $textifempty = ' '; |
@@ -564,7 +564,7 @@ discard block |
||
| 564 | 564 | } |
| 565 | 565 | } |
| 566 | 566 | if ($showempty) { |
| 567 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
| 567 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
| 568 | 568 | } |
| 569 | 569 | |
| 570 | 570 | $num = $this->db->num_rows($resql); |
@@ -587,9 +587,9 @@ discard block |
||
| 587 | 587 | } |
| 588 | 588 | if (empty($outputmode)) { |
| 589 | 589 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
| 590 | - $out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 590 | + $out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 591 | 591 | } else { |
| 592 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 592 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 593 | 593 | } |
| 594 | 594 | } else { |
| 595 | 595 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | } |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | - $out .= '</select>' . "\n"; |
|
| 605 | + $out .= '</select>'."\n"; |
|
| 606 | 606 | } else { |
| 607 | 607 | dol_print_error($this->db); |
| 608 | 608 | } |
@@ -639,22 +639,22 @@ discard block |
||
| 639 | 639 | $size = !empty($val['size']) ? $val['size'] : 0; |
| 640 | 640 | // see common object class |
| 641 | 641 | if (preg_match('/^(integer|link):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 642 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] . ':' . $reg[5] => 'N'); |
|
| 642 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N'); |
|
| 643 | 643 | $type = 'link'; |
| 644 | 644 | } elseif (preg_match('/^(integer|link):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 645 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N'); |
|
| 645 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N'); |
|
| 646 | 646 | $type = 'link'; |
| 647 | 647 | } elseif (preg_match('/^(integer|link):(.*):(.*)/i', $val['type'], $reg)) { |
| 648 | - $param['options'] = array($reg[2] . ':' . $reg[3] => 'N'); |
|
| 648 | + $param['options'] = array($reg[2].':'.$reg[3] => 'N'); |
|
| 649 | 649 | $type = 'link'; |
| 650 | 650 | } elseif (preg_match('/^(sellist):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 651 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] . ':' . $reg[5] => 'N'); |
|
| 651 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N'); |
|
| 652 | 652 | $type = 'sellist'; |
| 653 | 653 | } elseif (preg_match('/^(sellist):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 654 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N'); |
|
| 654 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N'); |
|
| 655 | 655 | $type = 'sellist'; |
| 656 | 656 | } elseif (preg_match('/^(sellist):(.*):(.*)/i', $val['type'], $reg)) { |
| 657 | - $param['options'] = array($reg[2] . ':' . $reg[3] => 'N'); |
|
| 657 | + $param['options'] = array($reg[2].':'.$reg[3] => 'N'); |
|
| 658 | 658 | $type = 'sellist'; |
| 659 | 659 | } elseif (preg_match('/^varchar\((\d+)\)/', $val['type'], $reg)) { |
| 660 | 660 | $param['options'] = array(); |
@@ -692,7 +692,7 @@ discard block |
||
| 692 | 692 | |
| 693 | 693 | if ($computed) { |
| 694 | 694 | if (!preg_match('/^search_/', $keyprefix)) { |
| 695 | - return '<span>' . $langs->trans("AutomaticallyCalculated") . '</span>'; |
|
| 695 | + return '<span>'.$langs->trans("AutomaticallyCalculated").'</span>'; |
|
| 696 | 696 | } else { |
| 697 | 697 | return ''; |
| 698 | 698 | } |
@@ -703,7 +703,7 @@ discard block |
||
| 703 | 703 | $morecss = $val['css']; |
| 704 | 704 | } |
| 705 | 705 | |
| 706 | - $htmlName = $keyprefix . $key . $keysuffix; |
|
| 706 | + $htmlName = $keyprefix.$key.$keysuffix; |
|
| 707 | 707 | $htmlId = $htmlName; |
| 708 | 708 | //$moreparam .= (!empty($required) ? ' required' : ''); |
| 709 | 709 | switch ($type) { |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | |
| 724 | 724 | if ($type == 'datetime') { |
| 725 | 725 | //$moreparam .= ' step="1"'; to show seconds |
| 726 | - $out .= ' ' . $this->inputType('time', $htmlName.'_time', $valueTime, $htmlId, $morecss, $moreparam); |
|
| 726 | + $out .= ' '.$this->inputType('time', $htmlName.'_time', $valueTime, $htmlId, $morecss, $moreparam); |
|
| 727 | 727 | } |
| 728 | 728 | break; |
| 729 | 729 | |
@@ -733,7 +733,7 @@ discard block |
||
| 733 | 733 | |
| 734 | 734 | case 'text': |
| 735 | 735 | case 'html': |
| 736 | - $moreparam .= ($size > 0 ? ' maxlength="' . $size . '"' : ''); |
|
| 736 | + $moreparam .= ($size > 0 ? ' maxlength="'.$size.'"' : ''); |
|
| 737 | 737 | $out = $this->inputType('text', $htmlName, dol_escape_htmltag($value), $htmlId, $morecss, $moreparam); |
| 738 | 738 | break; |
| 739 | 739 | |
@@ -753,7 +753,7 @@ discard block |
||
| 753 | 753 | if (!empty($value)) { |
| 754 | 754 | $value = price($value); // $value in memory is a php numeric, we format it into user number format. |
| 755 | 755 | } |
| 756 | - $addInputLabel = ' ' . $langs->getCurrencySymbol($conf->currency); |
|
| 756 | + $addInputLabel = ' '.$langs->getCurrencySymbol($conf->currency); |
|
| 757 | 757 | $out = $this->inputType('text', $htmlName, $value, $htmlId, $morecss, $moreparam, '', $addInputLabel); |
| 758 | 758 | break; |
| 759 | 759 | |
@@ -770,14 +770,14 @@ discard block |
||
| 770 | 770 | |
| 771 | 771 | case 'radio': |
| 772 | 772 | foreach ($param['options'] as $keyopt => $valopt) { |
| 773 | - $htmlId = $htmlName . '_' . $keyopt; |
|
| 774 | - $htmlMoreParam = $moreparam . ($value == $keyopt ? ' checked' : ''); |
|
| 775 | - $out .= $this->inputType('radio', $htmlName, $keyopt, $htmlId, $morecss, $htmlMoreParam, $valopt) . '<br>'; |
|
| 773 | + $htmlId = $htmlName.'_'.$keyopt; |
|
| 774 | + $htmlMoreParam = $moreparam.($value == $keyopt ? ' checked' : ''); |
|
| 775 | + $out .= $this->inputType('radio', $htmlName, $keyopt, $htmlId, $morecss, $htmlMoreParam, $valopt).'<br>'; |
|
| 776 | 776 | } |
| 777 | 777 | break; |
| 778 | 778 | |
| 779 | 779 | case 'select': |
| 780 | - $out = '<select class="' . $morecss . '" name="' . $htmlName . '" id="' . $htmlId . '"' . ($moreparam ? ' ' . $moreparam : '') . ' >'; |
|
| 780 | + $out = '<select class="'.$morecss.'" name="'.$htmlName.'" id="'.$htmlId.'"'.($moreparam ? ' '.$moreparam : '').' >'; |
|
| 781 | 781 | if ($default == '' || $notNull != 1) { |
| 782 | 782 | $out .= '<option value="0"> </option>'; |
| 783 | 783 | } |
@@ -788,15 +788,15 @@ discard block |
||
| 788 | 788 | if (strpos($valb, "|") !== false) { |
| 789 | 789 | list($valb, $parent) = explode('|', $valb); |
| 790 | 790 | } |
| 791 | - $out .= '<option value="' . $keyb . '"'; |
|
| 791 | + $out .= '<option value="'.$keyb.'"'; |
|
| 792 | 792 | $out .= (((string) $value == $keyb) ? ' selected' : ''); |
| 793 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
| 794 | - $out .= '>' . $valb . '</option>'; |
|
| 793 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
| 794 | + $out .= '>'.$valb.'</option>'; |
|
| 795 | 795 | } |
| 796 | 796 | $out .= '</select>'; |
| 797 | 797 | break; |
| 798 | 798 | case 'sellist': |
| 799 | - $out = '<select class="' . $morecss . '" name="' . $htmlName . '" id="' . $htmlId . '"' . ($moreparam ? ' ' . $moreparam : '') . '>'; |
|
| 799 | + $out = '<select class="'.$morecss.'" name="'.$htmlName.'" id="'.$htmlId.'"'.($moreparam ? ' '.$moreparam : '').'>'; |
|
| 800 | 800 | |
| 801 | 801 | $param_list = array_keys($param['options']); |
| 802 | 802 | $InfoFieldList = explode(":", $param_list[0]); |
@@ -809,18 +809,18 @@ discard block |
||
| 809 | 809 | // 4 : where clause filter on column or table extrafield, syntax field='value' or extra.field=value |
| 810 | 810 | // 5 : id category type |
| 811 | 811 | // 6 : ids categories list separated by comma for category root |
| 812 | - $keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2] . ' as rowid'); |
|
| 812 | + $keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid'); |
|
| 813 | 813 | |
| 814 | 814 | if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) { |
| 815 | 815 | if (strpos($InfoFieldList[4], 'extra.') !== false) { |
| 816 | - $keyList = 'main.' . $InfoFieldList[2] . ' as rowid'; |
|
| 816 | + $keyList = 'main.'.$InfoFieldList[2].' as rowid'; |
|
| 817 | 817 | } else { |
| 818 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
| 818 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
| 819 | 819 | } |
| 820 | 820 | } |
| 821 | 821 | if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) { |
| 822 | 822 | list($parentName, $parentField) = explode('|', $InfoFieldList[3]); |
| 823 | - $keyList .= ', ' . $parentField; |
|
| 823 | + $keyList .= ', '.$parentField; |
|
| 824 | 824 | } |
| 825 | 825 | |
| 826 | 826 | $filter_categorie = false; |
@@ -838,8 +838,8 @@ discard block |
||
| 838 | 838 | } |
| 839 | 839 | |
| 840 | 840 | $sqlwhere = ''; |
| 841 | - $sql = "SELECT " . $keyList; |
|
| 842 | - $sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0]; |
|
| 841 | + $sql = "SELECT ".$keyList; |
|
| 842 | + $sql .= " FROM ".$this->db->prefix().$InfoFieldList[0]; |
|
| 843 | 843 | if (!empty($InfoFieldList[4])) { |
| 844 | 844 | // can use SELECT request |
| 845 | 845 | if (strpos($InfoFieldList[4], '$SEL$') !== false) { |
@@ -851,24 +851,24 @@ discard block |
||
| 851 | 851 | |
| 852 | 852 | //We have to join on extrafield table |
| 853 | 853 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
| 854 | - $sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra"; |
|
| 855 | - $sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4]; |
|
| 854 | + $sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra"; |
|
| 855 | + $sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4]; |
|
| 856 | 856 | } else { |
| 857 | - $sqlwhere .= " WHERE " . $InfoFieldList[4]; |
|
| 857 | + $sqlwhere .= " WHERE ".$InfoFieldList[4]; |
|
| 858 | 858 | } |
| 859 | 859 | } else { |
| 860 | 860 | $sqlwhere .= ' WHERE 1=1'; |
| 861 | 861 | } |
| 862 | 862 | // Some tables may have field, some other not. For the moment we disable it. |
| 863 | 863 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
| 864 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
| 864 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
| 865 | 865 | } |
| 866 | 866 | $sql .= $sqlwhere; |
| 867 | 867 | //print $sql; |
| 868 | 868 | |
| 869 | - $sql .= ' ORDER BY ' . implode(', ', $fields_label); |
|
| 869 | + $sql .= ' ORDER BY '.implode(', ', $fields_label); |
|
| 870 | 870 | |
| 871 | - dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG); |
|
| 871 | + dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); |
|
| 872 | 872 | $resql = $this->db->query($sql); |
| 873 | 873 | if ($resql) { |
| 874 | 874 | $out .= '<option value="0"> </option>'; |
@@ -884,7 +884,7 @@ discard block |
||
| 884 | 884 | if (count($fields_label) > 1) { |
| 885 | 885 | $notrans = true; |
| 886 | 886 | foreach ($fields_label as $field_toshow) { |
| 887 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
| 887 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
| 888 | 888 | } |
| 889 | 889 | } else { |
| 890 | 890 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -895,12 +895,12 @@ discard block |
||
| 895 | 895 | foreach ($fields_label as $field_toshow) { |
| 896 | 896 | $translabel = $langs->trans($obj->$field_toshow); |
| 897 | 897 | if ($translabel != $obj->$field_toshow) { |
| 898 | - $labeltoshow = dol_trunc($translabel) . ' '; |
|
| 898 | + $labeltoshow = dol_trunc($translabel).' '; |
|
| 899 | 899 | } else { |
| 900 | - $labeltoshow = dol_trunc($obj->$field_toshow) . ' '; |
|
| 900 | + $labeltoshow = dol_trunc($obj->$field_toshow).' '; |
|
| 901 | 901 | } |
| 902 | 902 | } |
| 903 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
| 903 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
| 904 | 904 | } else { |
| 905 | 905 | if (!$notrans) { |
| 906 | 906 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
@@ -914,28 +914,28 @@ discard block |
||
| 914 | 914 | $labeltoshow = '(not defined)'; |
| 915 | 915 | } |
| 916 | 916 | if ($value == $obj->rowid) { |
| 917 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
| 917 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
| 918 | 918 | } |
| 919 | 919 | |
| 920 | 920 | if (!empty($InfoFieldList[3]) && $parentField) { |
| 921 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
| 921 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
| 922 | 922 | $isDependList = 1; |
| 923 | 923 | } |
| 924 | 924 | |
| 925 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 925 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 926 | 926 | $out .= ($value == $obj->rowid ? ' selected' : ''); |
| 927 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
| 928 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 927 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
| 928 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 929 | 929 | } |
| 930 | 930 | |
| 931 | 931 | $i++; |
| 932 | 932 | } |
| 933 | 933 | $this->db->free($resql); |
| 934 | 934 | } else { |
| 935 | - $out .= 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
| 935 | + $out .= 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
| 936 | 936 | } |
| 937 | 937 | } else { |
| 938 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 938 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 939 | 939 | $categorytype = $InfoFieldList[5]; |
| 940 | 940 | if (is_numeric($categorytype)) { |
| 941 | 941 | $categorytype = Categorie::$MAP_ID_TO_CODE[$categorytype]; // For backward compatibility |
@@ -943,9 +943,9 @@ discard block |
||
| 943 | 943 | $data = $this->select_all_categories($categorytype, '', 'parent', 64, $InfoFieldList[6], 1, 1); |
| 944 | 944 | $out .= '<option value="0"> </option>'; |
| 945 | 945 | foreach ($data as $data_key => $data_value) { |
| 946 | - $out .= '<option value="' . $data_key . '"'; |
|
| 946 | + $out .= '<option value="'.$data_key.'"'; |
|
| 947 | 947 | $out .= ($value == $data_key ? ' selected' : ''); |
| 948 | - $out .= '>' . $data_value . '</option>'; |
|
| 948 | + $out .= '>'.$data_value.'</option>'; |
|
| 949 | 949 | } |
| 950 | 950 | } |
| 951 | 951 | $out .= '</select>'; |
@@ -1018,19 +1018,19 @@ discard block |
||
| 1018 | 1018 | } |
| 1019 | 1019 | if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) { |
| 1020 | 1020 | $type = 'link'; |
| 1021 | - $stringforoptions = $reg[1] . ':' . $reg[2]; |
|
| 1021 | + $stringforoptions = $reg[1].':'.$reg[2]; |
|
| 1022 | 1022 | if ($reg[1] == 'User') { |
| 1023 | 1023 | $stringforoptions .= ':-1'; |
| 1024 | 1024 | } |
| 1025 | 1025 | $param['options'] = array($stringforoptions => $stringforoptions); |
| 1026 | 1026 | } elseif (preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 1027 | - $param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N'); |
|
| 1027 | + $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4] => 'N'); |
|
| 1028 | 1028 | $type = 'sellist'; |
| 1029 | 1029 | } elseif (preg_match('/^sellist:(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 1030 | - $param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] => 'N'); |
|
| 1030 | + $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3] => 'N'); |
|
| 1031 | 1031 | $type = 'sellist'; |
| 1032 | 1032 | } elseif (preg_match('/^sellist:(.*):(.*)/i', $val['type'], $reg)) { |
| 1033 | - $param['options'] = array($reg[1] . ':' . $reg[2] => 'N'); |
|
| 1033 | + $param['options'] = array($reg[1].':'.$reg[2] => 'N'); |
|
| 1034 | 1034 | $type = 'sellist'; |
| 1035 | 1035 | } elseif (preg_match('/^chkbxlst:(.*)/i', $val['type'], $reg)) { |
| 1036 | 1036 | $param['options'] = array($reg[1] => 'N'); |
@@ -1083,7 +1083,7 @@ discard block |
||
| 1083 | 1083 | // |
| 1084 | 1084 | } elseif ($type == 'date') { |
| 1085 | 1085 | if (!empty($value)) { |
| 1086 | - $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
| 1086 | + $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
| 1087 | 1087 | } else { |
| 1088 | 1088 | $value = ''; |
| 1089 | 1089 | } |
@@ -1094,7 +1094,7 @@ discard block |
||
| 1094 | 1094 | $value = ''; |
| 1095 | 1095 | } |
| 1096 | 1096 | } elseif ($type == 'duration') { |
| 1097 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 1097 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 1098 | 1098 | if (!is_null($value) && $value !== '') { |
| 1099 | 1099 | $value = convertSecondToTime($value, 'allhourmin'); |
| 1100 | 1100 | } |
@@ -1107,7 +1107,7 @@ discard block |
||
| 1107 | 1107 | if (!empty($value)) { |
| 1108 | 1108 | $checked = ' checked '; |
| 1109 | 1109 | } |
| 1110 | - $value = '<input type="checkbox" ' . $checked . ' ' . ($moreparam ? $moreparam : '') . ' readonly disabled>'; |
|
| 1110 | + $value = '<input type="checkbox" '.$checked.' '.($moreparam ? $moreparam : '').' readonly disabled>'; |
|
| 1111 | 1111 | } elseif ($type == 'mail' || $type == 'email') { |
| 1112 | 1112 | $value = dol_print_email($value, 0, 0, 0, 64, 1, 1); |
| 1113 | 1113 | } elseif ($type == 'url') { |
@@ -1131,7 +1131,7 @@ discard block |
||
| 1131 | 1131 | |
| 1132 | 1132 | if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) { |
| 1133 | 1133 | $selectkey = $InfoFieldList[2]; |
| 1134 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
| 1134 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
| 1135 | 1135 | } |
| 1136 | 1136 | |
| 1137 | 1137 | $fields_label = explode('|', $InfoFieldList[1]); |
@@ -1147,20 +1147,20 @@ discard block |
||
| 1147 | 1147 | } |
| 1148 | 1148 | } |
| 1149 | 1149 | |
| 1150 | - $sql = "SELECT " . $keyList; |
|
| 1151 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
| 1150 | + $sql = "SELECT ".$keyList; |
|
| 1151 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
| 1152 | 1152 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
| 1153 | 1153 | $sql .= ' as main'; |
| 1154 | 1154 | } |
| 1155 | 1155 | if ($selectkey == 'rowid' && empty($value)) { |
| 1156 | - $sql .= " WHERE " . $selectkey . " = 0"; |
|
| 1156 | + $sql .= " WHERE ".$selectkey." = 0"; |
|
| 1157 | 1157 | } elseif ($selectkey == 'rowid') { |
| 1158 | - $sql .= " WHERE " . $selectkey . " = " . ((int) $value); |
|
| 1158 | + $sql .= " WHERE ".$selectkey." = ".((int) $value); |
|
| 1159 | 1159 | } else { |
| 1160 | - $sql .= " WHERE " . $selectkey . " = '" . $this->db->escape($value) . "'"; |
|
| 1160 | + $sql .= " WHERE ".$selectkey." = '".$this->db->escape($value)."'"; |
|
| 1161 | 1161 | } |
| 1162 | 1162 | |
| 1163 | - dol_syslog(__METHOD__ . ' type=sellist', LOG_DEBUG); |
|
| 1163 | + dol_syslog(__METHOD__.' type=sellist', LOG_DEBUG); |
|
| 1164 | 1164 | $resql = $this->db->query($sql); |
| 1165 | 1165 | if ($resql) { |
| 1166 | 1166 | if ($filter_categorie === false) { |
@@ -1179,9 +1179,9 @@ discard block |
||
| 1179 | 1179 | $translabel = $langs->trans($obj->$field_toshow); |
| 1180 | 1180 | } |
| 1181 | 1181 | if ($translabel != $field_toshow) { |
| 1182 | - $value .= dol_trunc($translabel, 18) . ' '; |
|
| 1182 | + $value .= dol_trunc($translabel, 18).' '; |
|
| 1183 | 1183 | } else { |
| 1184 | - $value .= $obj->$field_toshow . ' '; |
|
| 1184 | + $value .= $obj->$field_toshow.' '; |
|
| 1185 | 1185 | } |
| 1186 | 1186 | } |
| 1187 | 1187 | } else { |
@@ -1197,7 +1197,7 @@ discard block |
||
| 1197 | 1197 | } |
| 1198 | 1198 | } |
| 1199 | 1199 | } else { |
| 1200 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 1200 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 1201 | 1201 | |
| 1202 | 1202 | $toprint = array(); |
| 1203 | 1203 | $obj = $this->db->fetch_object($resql); |
@@ -1205,12 +1205,12 @@ discard block |
||
| 1205 | 1205 | $c->fetch($obj->rowid); |
| 1206 | 1206 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 1207 | 1207 | foreach ($ways as $way) { |
| 1208 | - $toprint[] = '<li>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
| 1208 | + $toprint[] = '<li>'.img_object('', 'category').' '.$way.'</li>'; |
|
| 1209 | 1209 | } |
| 1210 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
| 1210 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
| 1211 | 1211 | } |
| 1212 | 1212 | } else { |
| 1213 | - dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING); |
|
| 1213 | + dol_syslog(__METHOD__.' error '.$this->db->lasterror(), LOG_WARNING); |
|
| 1214 | 1214 | } |
| 1215 | 1215 | } elseif ($type == 'radio') { |
| 1216 | 1216 | $value = $param['options'][$value]; |
@@ -1221,11 +1221,11 @@ discard block |
||
| 1221 | 1221 | $toprint = array(); |
| 1222 | 1222 | foreach ($value_arr as $valueval) { |
| 1223 | 1223 | if (!empty($valueval)) { |
| 1224 | - $toprint[] = '<li>' . $param['options'][$valueval] . '</li>'; |
|
| 1224 | + $toprint[] = '<li>'.$param['options'][$valueval].'</li>'; |
|
| 1225 | 1225 | } |
| 1226 | 1226 | } |
| 1227 | 1227 | if (!empty($toprint)) { |
| 1228 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
| 1228 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
| 1229 | 1229 | } |
| 1230 | 1230 | } |
| 1231 | 1231 | } elseif ($type == 'chkbxlst') { |
@@ -1239,7 +1239,7 @@ discard block |
||
| 1239 | 1239 | |
| 1240 | 1240 | if (count($InfoFieldList) >= 3) { |
| 1241 | 1241 | $selectkey = $InfoFieldList[2]; |
| 1242 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
| 1242 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
| 1243 | 1243 | } |
| 1244 | 1244 | |
| 1245 | 1245 | $fields_label = explode('|', $InfoFieldList[1]); |
@@ -1255,15 +1255,15 @@ discard block |
||
| 1255 | 1255 | } |
| 1256 | 1256 | } |
| 1257 | 1257 | |
| 1258 | - $sql = "SELECT " . $keyList; |
|
| 1259 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
| 1258 | + $sql = "SELECT ".$keyList; |
|
| 1259 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
| 1260 | 1260 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
| 1261 | 1261 | $sql .= ' as main'; |
| 1262 | 1262 | } |
| 1263 | 1263 | // $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'"; |
| 1264 | 1264 | // $sql.= ' AND entity = '.$conf->entity; |
| 1265 | 1265 | |
| 1266 | - dol_syslog(__METHOD__ . ' type=chkbxlst', LOG_DEBUG); |
|
| 1266 | + dol_syslog(__METHOD__.' type=chkbxlst', LOG_DEBUG); |
|
| 1267 | 1267 | $resql = $this->db->query($sql); |
| 1268 | 1268 | if ($resql) { |
| 1269 | 1269 | if ($filter_categorie === false) { |
@@ -1280,9 +1280,9 @@ discard block |
||
| 1280 | 1280 | $translabel = $langs->trans($obj->$field_toshow); |
| 1281 | 1281 | } |
| 1282 | 1282 | if ($translabel != $field_toshow) { |
| 1283 | - $toprint[] = '<li>' . dol_trunc($translabel, 18) . '</li>'; |
|
| 1283 | + $toprint[] = '<li>'.dol_trunc($translabel, 18).'</li>'; |
|
| 1284 | 1284 | } else { |
| 1285 | - $toprint[] = '<li>' . $obj->$field_toshow . '</li>'; |
|
| 1285 | + $toprint[] = '<li>'.$obj->$field_toshow.'</li>'; |
|
| 1286 | 1286 | } |
| 1287 | 1287 | } |
| 1288 | 1288 | } else { |
@@ -1291,15 +1291,15 @@ discard block |
||
| 1291 | 1291 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
| 1292 | 1292 | } |
| 1293 | 1293 | if ($translabel != $obj->{$InfoFieldList[1]}) { |
| 1294 | - $toprint[] = '<li>' . dol_trunc($translabel, 18) . '</li>'; |
|
| 1294 | + $toprint[] = '<li>'.dol_trunc($translabel, 18).'</li>'; |
|
| 1295 | 1295 | } else { |
| 1296 | - $toprint[] = '<li>' . $obj->{$InfoFieldList[1]} . '</li>'; |
|
| 1296 | + $toprint[] = '<li>'.$obj->{$InfoFieldList[1]}.'</li>'; |
|
| 1297 | 1297 | } |
| 1298 | 1298 | } |
| 1299 | 1299 | } |
| 1300 | 1300 | } |
| 1301 | 1301 | } else { |
| 1302 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 1302 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 1303 | 1303 | |
| 1304 | 1304 | $toprint = array(); |
| 1305 | 1305 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -1308,14 +1308,14 @@ discard block |
||
| 1308 | 1308 | $c->fetch($obj->rowid); |
| 1309 | 1309 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 1310 | 1310 | foreach ($ways as $way) { |
| 1311 | - $toprint[] = '<li>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
| 1311 | + $toprint[] = '<li>'.img_object('', 'category').' '.$way.'</li>'; |
|
| 1312 | 1312 | } |
| 1313 | 1313 | } |
| 1314 | 1314 | } |
| 1315 | 1315 | } |
| 1316 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
| 1316 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
| 1317 | 1317 | } else { |
| 1318 | - dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING); |
|
| 1318 | + dol_syslog(__METHOD__.' error '.$this->db->lasterror(), LOG_WARNING); |
|
| 1319 | 1319 | } |
| 1320 | 1320 | } elseif ($type == 'link') { |
| 1321 | 1321 | // only if something to display (perf) |
@@ -1342,7 +1342,7 @@ discard block |
||
| 1342 | 1342 | } |
| 1343 | 1343 | } |
| 1344 | 1344 | } else { |
| 1345 | - dol_syslog(__METHOD__ . ' Error bad setup of field', LOG_WARNING); |
|
| 1345 | + dol_syslog(__METHOD__.' Error bad setup of field', LOG_WARNING); |
|
| 1346 | 1346 | return 'Error bad setup of field'; |
| 1347 | 1347 | } |
| 1348 | 1348 | } else { |
@@ -97,8 +97,9 @@ |
||
| 97 | 97 | $main_data_dir = $argv[4]; // override when executing the script in command line |
| 98 | 98 | } |
| 99 | 99 | // In mode 3 the main_url is custom |
| 100 | - if ($force_install_noedit != 3) |
|
| 101 | - $main_url = detect_dolibarr_main_url_root(); |
|
| 100 | + if ($force_install_noedit != 3) { |
|
| 101 | + $main_url = detect_dolibarr_main_url_root(); |
|
| 102 | + } |
|
| 102 | 103 | if (!empty($argv[5])) { |
| 103 | 104 | $main_url = $argv[5]; // override when executing the script in command line |
| 104 | 105 | } |
@@ -230,82 +230,82 @@ discard block |
||
| 230 | 230 | /* END MODULEBUILDER TOPMENU */ |
| 231 | 231 | /* BEGIN MODULEBUILDER LEFTMENU CONFERENCEORBOOTH*/ |
| 232 | 232 | $this->menu[$r++] = array( |
| 233 | - 'fk_menu' => 'fk_mainmenu=project', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
| 234 | - 'type' => 'left', // This is a Left menu entry |
|
| 233 | + 'fk_menu' => 'fk_mainmenu=project', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
| 234 | + 'type' => 'left', // This is a Left menu entry |
|
| 235 | 235 | 'titre' => 'EventOrganizationMenuLeft', |
| 236 | 236 | 'prefix' => img_picto('', 'eventorganization', 'class="paddingright pictofixedwidth"'), |
| 237 | 237 | 'mainmenu' => 'project', |
| 238 | 238 | 'leftmenu' => 'eventorganization', |
| 239 | 239 | 'url' => '', |
| 240 | - 'langs' => 'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
| 240 | + 'langs' => 'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
| 241 | 241 | 'position' => 1000 + $r, |
| 242 | - 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 243 | - 'perms' => '$user->hasRight("eventorganization", "read")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
| 242 | + 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 243 | + 'perms' => '$user->hasRight("eventorganization", "read")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
| 244 | 244 | 'target' => '', |
| 245 | - 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
| 245 | + 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
| 246 | 246 | ); |
| 247 | 247 | $this->menu[$r++] = array( |
| 248 | - 'fk_menu' => 'fk_mainmenu=project,fk_leftmenu=eventorganization', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
| 249 | - 'type' => 'left', // This is a Left menu entry |
|
| 248 | + 'fk_menu' => 'fk_mainmenu=project,fk_leftmenu=eventorganization', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
| 249 | + 'type' => 'left', // This is a Left menu entry |
|
| 250 | 250 | 'titre' => 'New', |
| 251 | 251 | 'url' => '/projet/card.php?leftmenu=projects&action=create&usage_organize_event=1&usage_opportunity=0', |
| 252 | - 'langs' => 'eventorganization@eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
| 252 | + 'langs' => 'eventorganization@eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
| 253 | 253 | 'position' => 1000 + $r, |
| 254 | - 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 255 | - 'perms' => '$user->hasRight("eventorganization", "write")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
| 254 | + 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 255 | + 'perms' => '$user->hasRight("eventorganization", "write")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
| 256 | 256 | 'target' => '', |
| 257 | - 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
| 257 | + 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
| 258 | 258 | ); |
| 259 | 259 | $this->menu[$r++] = array( |
| 260 | - 'fk_menu' => 'fk_mainmenu=project,fk_leftmenu=eventorganization', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
| 261 | - 'type' => 'left', // This is a Left menu entry |
|
| 260 | + 'fk_menu' => 'fk_mainmenu=project,fk_leftmenu=eventorganization', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
| 261 | + 'type' => 'left', // This is a Left menu entry |
|
| 262 | 262 | 'titre' => 'List', |
| 263 | 263 | 'url' => '/projet/list.php?search_usage_event_organization=1&search_status=99&mainmenu=project&contextpage=organizedevents', |
| 264 | - 'langs' => 'eventorganization@eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
| 264 | + 'langs' => 'eventorganization@eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
| 265 | 265 | 'position' => 1000 + $r, |
| 266 | - 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 267 | - 'perms' => '$user->hasRight("eventorganization", "write")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
| 266 | + 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 267 | + 'perms' => '$user->hasRight("eventorganization", "write")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
| 268 | 268 | 'target' => '', |
| 269 | - 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
| 269 | + 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
| 270 | 270 | ); |
| 271 | 271 | $this->menu[$r++] = array( |
| 272 | - 'fk_menu' => 'fk_mainmenu=project', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
| 273 | - 'type' => 'left', // This is a Left menu entry |
|
| 272 | + 'fk_menu' => 'fk_mainmenu=project', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
| 273 | + 'type' => 'left', // This is a Left menu entry |
|
| 274 | 274 | 'titre' => 'ConferenceOrBooth', |
| 275 | 275 | 'prefix' => img_picto('', 'conferenceorbooth', 'class="paddingright pictofixedwidth"'), |
| 276 | 276 | 'mainmenu' => 'project', |
| 277 | 277 | 'leftmenu' => 'eventorganizationconforbooth', |
| 278 | 278 | 'url' => '', |
| 279 | - 'langs' => 'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
| 279 | + 'langs' => 'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
| 280 | 280 | 'position' => 1000 + $r, |
| 281 | - 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 282 | - 'perms' => '$user->hasRight("eventorganization", "read")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
| 281 | + 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 282 | + 'perms' => '$user->hasRight("eventorganization", "read")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
| 283 | 283 | 'target' => '', |
| 284 | - 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
| 284 | + 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
| 285 | 285 | ); |
| 286 | 286 | $this->menu[$r++] = array( |
| 287 | - 'fk_menu' => 'fk_mainmenu=project,fk_leftmenu=eventorganizationconforbooth', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
| 288 | - 'type' => 'left', // This is a Left menu entry |
|
| 287 | + 'fk_menu' => 'fk_mainmenu=project,fk_leftmenu=eventorganizationconforbooth', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
| 288 | + 'type' => 'left', // This is a Left menu entry |
|
| 289 | 289 | 'titre' => 'New', |
| 290 | 290 | 'url' => '/eventorganization/conferenceorbooth_card.php?leftmenu=projects&action=create', |
| 291 | - 'langs' => 'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
| 291 | + 'langs' => 'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
| 292 | 292 | 'position' => 1000 + $r, |
| 293 | - 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 294 | - 'perms' => '$user->hasRight("eventorganization", "write")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
| 293 | + 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 294 | + 'perms' => '$user->hasRight("eventorganization", "write")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
| 295 | 295 | 'target' => '', |
| 296 | - 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
| 296 | + 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
| 297 | 297 | ); |
| 298 | 298 | $this->menu[$r++] = array( |
| 299 | - 'fk_menu' => 'fk_mainmenu=project,fk_leftmenu=eventorganizationconforbooth', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
| 300 | - 'type' => 'left', // This is a Left menu entry |
|
| 299 | + 'fk_menu' => 'fk_mainmenu=project,fk_leftmenu=eventorganizationconforbooth', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
| 300 | + 'type' => 'left', // This is a Left menu entry |
|
| 301 | 301 | 'titre' => 'List', |
| 302 | 302 | 'url' => '/eventorganization/conferenceorbooth_list.php?mainmenu=project', |
| 303 | - 'langs' => 'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
| 303 | + 'langs' => 'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
| 304 | 304 | 'position' => 1000 + $r, |
| 305 | - 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 306 | - 'perms' => '$user->hasRight("eventorganization", "read")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
| 305 | + 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 306 | + 'perms' => '$user->hasRight("eventorganization", "read")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
| 307 | 307 | 'target' => '', |
| 308 | - 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
| 308 | + 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
| 309 | 309 | ); |
| 310 | 310 | /* END MODULEBUILDER LEFTMENU CONFERENCEORBOOTH */ |
| 311 | 311 | |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | /* BEGIN MODULEBUILDER EXPORT CONFERENCEORBOOTHATTENDEES */ |
| 316 | 316 | $langs->load("eventorganization"); |
| 317 | 317 | $this->export_code[$r] = $this->rights_class.'_'.$r; |
| 318 | - $this->export_label[$r] = 'ListOfAttendeesOfEvent'; // Translation key (used only if key ExportDataset_xxx_z not found) |
|
| 318 | + $this->export_label[$r] = 'ListOfAttendeesOfEvent'; // Translation key (used only if key ExportDataset_xxx_z not found) |
|
| 319 | 319 | $this->export_icon[$r] = $this->picto; |
| 320 | 320 | // Define $this->export_fields_array, $this->export_TypeFields_array and $this->export_entities_array |
| 321 | 321 | $keyforclass = 'ConferenceOrBoothAttendee'; |
@@ -323,8 +323,8 @@ discard block |
||
| 323 | 323 | $keyforelement = 'conferenceorboothattendee'; |
| 324 | 324 | include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php'; |
| 325 | 325 | $this->export_entities_array[$r]['t.fk_invoice'] = 'invoice'; |
| 326 | - unset($this->export_fields_array[$r]['t.fk_project']); // Remove field so we can add it at end just after |
|
| 327 | - unset($this->export_fields_array[$r]['t.fk_soc']); // Remove field so we can add it at end just after |
|
| 326 | + unset($this->export_fields_array[$r]['t.fk_project']); // Remove field so we can add it at end just after |
|
| 327 | + unset($this->export_fields_array[$r]['t.fk_soc']); // Remove field so we can add it at end just after |
|
| 328 | 328 | $this->export_fields_array[$r]['t.fk_invoice'] = 'InvoiceId'; |
| 329 | 329 | $this->export_fields_array[$r]['t.fk_project'] = 'ProjectId'; |
| 330 | 330 | $this->export_fields_array[$r]['p.ref'] = 'ProjectRef'; |
@@ -356,16 +356,16 @@ discard block |
||
| 356 | 356 | /* BEGIN MODULEBUILDER EXPORT CONFERENCEORBOOTH */ |
| 357 | 357 | $langs->load("eventorganization"); |
| 358 | 358 | $this->export_code[$r] = $this->rights_class.'_'.$r; |
| 359 | - $this->export_label[$r] = 'ListOfConfOrBoothOfEvent'; // Translation key (used only if key ExportDataset_xxx_z not found) |
|
| 359 | + $this->export_label[$r] = 'ListOfConfOrBoothOfEvent'; // Translation key (used only if key ExportDataset_xxx_z not found) |
|
| 360 | 360 | $this->export_icon[$r] = 'conferenceorbooth'; |
| 361 | 361 | // Define $this->export_fields_array, $this->export_TypeFields_array and $this->export_entities_array |
| 362 | 362 | $keyforclass = 'ConferenceOrBooth'; |
| 363 | 363 | $keyforclassfile = '/eventorganization/class/conferenceorbooth.class.php'; |
| 364 | 364 | $keyforelement = 'conferenceorbooth'; |
| 365 | 365 | include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php'; |
| 366 | - unset($this->export_fields_array[$r]['t.fk_action']); // Remove field so we can add it at end just after |
|
| 367 | - unset($this->export_fields_array[$r]['t.fk_project']); // Remove field so we can add it at end just after |
|
| 368 | - unset($this->export_fields_array[$r]['t.fk_soc']); // Remove field so we can add it at end just after |
|
| 366 | + unset($this->export_fields_array[$r]['t.fk_action']); // Remove field so we can add it at end just after |
|
| 367 | + unset($this->export_fields_array[$r]['t.fk_project']); // Remove field so we can add it at end just after |
|
| 368 | + unset($this->export_fields_array[$r]['t.fk_soc']); // Remove field so we can add it at end just after |
|
| 369 | 369 | $this->export_fields_array[$r]['t.fk_action'] = 'ConferenceOrBoothFormatID'; |
| 370 | 370 | $this->export_fields_array[$r]['ca.code'] = 'ConferenceOrBoothFormatCode'; |
| 371 | 371 | $this->export_fields_array[$r]['ca.libelle'] = 'ConferenceOrBoothFormatLabel'; |
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | if ($mode != "_tmp") { |
| 583 | 583 | // Date document export |
| 584 | 584 | print '<tr>'; |
| 585 | - print '<td class="titlefield">' . $langs->trans("DateExport") . '</td>'; |
|
| 585 | + print '<td class="titlefield">'.$langs->trans("DateExport").'</td>'; |
|
| 586 | 586 | print '<td>'; |
| 587 | 587 | print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' '; |
| 588 | 588 | print '</td>'; |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | |
| 591 | 591 | // Date document validation |
| 592 | 592 | print '<tr>'; |
| 593 | - print '<td class="titlefield">' . $langs->trans("DateValidation") . '</td>'; |
|
| 593 | + print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>'; |
|
| 594 | 594 | print '<td>'; |
| 595 | 595 | print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' '; |
| 596 | 596 | print '</td>'; |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | // Id_import |
| 600 | 600 | if (!empty($object->import_key)) { |
| 601 | 601 | print '<tr>'; |
| 602 | - print '<td class="titlefield">' . $langs->trans("ImportId") . '</td>'; |
|
| 602 | + print '<td class="titlefield">'.$langs->trans("ImportId").'</td>'; |
|
| 603 | 603 | print '<td>'; |
| 604 | 604 | print $object->import_key; |
| 605 | 605 | print '</td>'; |
@@ -609,7 +609,7 @@ discard block |
||
| 609 | 609 | |
| 610 | 610 | // Due date |
| 611 | 611 | print '<tr>'; |
| 612 | - print '<td class="titlefield">' . $langs->trans('DateDue') . '</td>'; |
|
| 612 | + print '<td class="titlefield">'.$langs->trans('DateDue').'</td>'; |
|
| 613 | 613 | print '<td>'; |
| 614 | 614 | print $object->date_lim_reglement ? dol_print_date($object->date_lim_reglement, 'day') : ' '; |
| 615 | 615 | print '</td>'; |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | |
| 666 | 666 | print '<br>'; |
| 667 | 667 | |
| 668 | - $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt |
|
| 668 | + $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt |
|
| 669 | 669 | |
| 670 | 670 | if ($result < 0) { |
| 671 | 671 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -763,14 +763,14 @@ discard block |
||
| 763 | 763 | if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) { |
| 764 | 764 | print $formaccounting->select_auxaccount('', 'subledger_account', 1, 'maxwidth250', '', 'subledger_label'); |
| 765 | 765 | } else { |
| 766 | - print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '">'; |
|
| 766 | + print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">'; |
|
| 767 | 767 | } |
| 768 | - print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">'; |
|
| 768 | + print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">'; |
|
| 769 | 769 | print '</td>'; |
| 770 | - print '<td><input type="text" class="minwidth200" name="label_operation" value="' . dol_escape_htmltag($label_operation) . '"/></td>'; |
|
| 770 | + print '<td><input type="text" class="minwidth200" name="label_operation" value="'.dol_escape_htmltag($label_operation).'"/></td>'; |
|
| 771 | 771 | print '<td class="right"><input type="text" class="right width50" name="debit" value=""/></td>'; |
| 772 | 772 | print '<td class="right"><input type="text" class="right width50" name="credit" value=""/></td>'; |
| 773 | - print '<td class="center"><input type="submit" class="button small" name="save" value="' . $langs->trans("Add") . '"></td>'; |
|
| 773 | + print '<td class="center"><input type="submit" class="button small" name="save" value="'.$langs->trans("Add").'"></td>'; |
|
| 774 | 774 | print "</tr>\n"; |
| 775 | 775 | } |
| 776 | 776 | } else { |
@@ -796,7 +796,7 @@ discard block |
||
| 796 | 796 | print '<td class="center nowraponall">'; |
| 797 | 797 | if ($permissiontoadd) { |
| 798 | 798 | if (empty($line->date_export) && empty($line->date_validation)) { |
| 799 | - print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . ((int) $line->piece_num) . '&mode=' . urlencode((string) $mode) . '&token=' . urlencode(newToken()) . '">'; |
|
| 799 | + print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.((int) $line->piece_num).'&mode='.urlencode((string) $mode).'&token='.urlencode(newToken()).'">'; |
|
| 800 | 800 | print img_edit('', 0, 'class="marginrightonly"'); |
| 801 | 801 | print '</a> '; |
| 802 | 802 | } else { |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | $actiontodelete = 'confirm_delete'; |
| 812 | 812 | } |
| 813 | 813 | |
| 814 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=' . $actiontodelete . '&id=' . $line->id . '&piece_num=' . ((int) $line->piece_num) . '&mode=' . urlencode((string) $mode) . '&token=' . urlencode(newToken()) . '">'; |
|
| 814 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action='.$actiontodelete.'&id='.$line->id.'&piece_num='.((int) $line->piece_num).'&mode='.urlencode((string) $mode).'&token='.urlencode(newToken()).'">'; |
|
| 815 | 815 | print img_delete(); |
| 816 | 816 | print '</a>'; |
| 817 | 817 | } else { |
@@ -57,45 +57,45 @@ discard block |
||
| 57 | 57 | $search_mvt_num = GETPOST('search_mvt_num', 'alpha'); |
| 58 | 58 | $search_doc_type = GETPOST("search_doc_type", 'alpha'); |
| 59 | 59 | $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); |
| 60 | -$search_date_startyear = GETPOSTINT('search_date_startyear'); |
|
| 61 | -$search_date_startmonth = GETPOSTINT('search_date_startmonth'); |
|
| 62 | -$search_date_startday = GETPOSTINT('search_date_startday'); |
|
| 63 | -$search_date_endyear = GETPOSTINT('search_date_endyear'); |
|
| 64 | -$search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
|
| 65 | -$search_date_endday = GETPOSTINT('search_date_endday'); |
|
| 60 | +$search_date_startyear = GETPOSTINT('search_date_startyear'); |
|
| 61 | +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); |
|
| 62 | +$search_date_startday = GETPOSTINT('search_date_startday'); |
|
| 63 | +$search_date_endyear = GETPOSTINT('search_date_endyear'); |
|
| 64 | +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
|
| 65 | +$search_date_endday = GETPOSTINT('search_date_endday'); |
|
| 66 | 66 | $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); |
| 67 | 67 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 68 | 68 | $search_doc_date = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); |
| 69 | -$search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); |
|
| 70 | -$search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); |
|
| 71 | -$search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); |
|
| 72 | -$search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); |
|
| 73 | -$search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); |
|
| 74 | -$search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); |
|
| 69 | +$search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); |
|
| 70 | +$search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); |
|
| 71 | +$search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); |
|
| 72 | +$search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); |
|
| 73 | +$search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); |
|
| 74 | +$search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); |
|
| 75 | 75 | $search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); |
| 76 | 76 | $search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); |
| 77 | -$search_date_modification_startyear = GETPOSTINT('search_date_modification_startyear'); |
|
| 78 | -$search_date_modification_startmonth = GETPOSTINT('search_date_modification_startmonth'); |
|
| 79 | -$search_date_modification_startday = GETPOSTINT('search_date_modification_startday'); |
|
| 80 | -$search_date_modification_endyear = GETPOSTINT('search_date_modification_endyear'); |
|
| 81 | -$search_date_modification_endmonth = GETPOSTINT('search_date_modification_endmonth'); |
|
| 82 | -$search_date_modification_endday = GETPOSTINT('search_date_modification_endday'); |
|
| 77 | +$search_date_modification_startyear = GETPOSTINT('search_date_modification_startyear'); |
|
| 78 | +$search_date_modification_startmonth = GETPOSTINT('search_date_modification_startmonth'); |
|
| 79 | +$search_date_modification_startday = GETPOSTINT('search_date_modification_startday'); |
|
| 80 | +$search_date_modification_endyear = GETPOSTINT('search_date_modification_endyear'); |
|
| 81 | +$search_date_modification_endmonth = GETPOSTINT('search_date_modification_endmonth'); |
|
| 82 | +$search_date_modification_endday = GETPOSTINT('search_date_modification_endday'); |
|
| 83 | 83 | $search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear); |
| 84 | 84 | $search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear); |
| 85 | -$search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); |
|
| 86 | -$search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); |
|
| 87 | -$search_date_export_startday = GETPOSTINT('search_date_export_startday'); |
|
| 88 | -$search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); |
|
| 89 | -$search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); |
|
| 90 | -$search_date_export_endday = GETPOSTINT('search_date_export_endday'); |
|
| 85 | +$search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); |
|
| 86 | +$search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); |
|
| 87 | +$search_date_export_startday = GETPOSTINT('search_date_export_startday'); |
|
| 88 | +$search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); |
|
| 89 | +$search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); |
|
| 90 | +$search_date_export_endday = GETPOSTINT('search_date_export_endday'); |
|
| 91 | 91 | $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); |
| 92 | 92 | $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); |
| 93 | -$search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); |
|
| 94 | -$search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); |
|
| 95 | -$search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); |
|
| 96 | -$search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); |
|
| 97 | -$search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); |
|
| 98 | -$search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); |
|
| 93 | +$search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); |
|
| 94 | +$search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); |
|
| 95 | +$search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); |
|
| 96 | +$search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); |
|
| 97 | +$search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); |
|
| 98 | +$search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); |
|
| 99 | 99 | $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); |
| 100 | 100 | $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); |
| 101 | 101 | // Due date start |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | $search_date_due_start = ''; |
| 316 | 316 | // Due date end |
| 317 | 317 | $search_date_due_end_day = ''; |
| 318 | - $search_date_due_end_month = ''; |
|
| 318 | + $search_date_due_end_month = ''; |
|
| 319 | 319 | $search_date_due_end_year = ''; |
| 320 | 320 | $search_date_due_end = ''; |
| 321 | 321 | $search_debit = ''; |
@@ -564,7 +564,7 @@ discard block |
||
| 564 | 564 | } |
| 565 | 565 | |
| 566 | 566 | if (!$error) { |
| 567 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 567 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 568 | 568 | exit(); |
| 569 | 569 | } |
| 570 | 570 | } elseif ($massaction == 'letteringmanual') { |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | setEventMessages('', $lettering->errors, 'errors'); |
| 575 | 575 | } else { |
| 576 | 576 | setEventMessages($langs->trans('AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs'); |
| 577 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 577 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 578 | 578 | exit(); |
| 579 | 579 | } |
| 580 | 580 | } elseif ($action == 'unletteringauto' && $confirm == "yes") { |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | if (!$error) { |
| 598 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 598 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 599 | 599 | exit(); |
| 600 | 600 | } |
| 601 | 601 | } elseif ($action == 'unletteringmanual' && $confirm == "yes") { |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | setEventMessages('', $lettering->errors, 'errors'); |
| 606 | 606 | } else { |
| 607 | 607 | setEventMessages($langs->trans('AccountancyOneUnletteringModifiedSuccessfully'), array(), 'mesgs'); |
| 608 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 608 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 609 | 609 | exit(); |
| 610 | 610 | } |
| 611 | 611 | } |
@@ -788,10 +788,10 @@ discard block |
||
| 788 | 788 | // List of mass actions available |
| 789 | 789 | $arrayofmassactions = array(); |
| 790 | 790 | if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) { |
| 791 | - $arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringAuto'); |
|
| 792 | - $arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringAuto'); |
|
| 793 | - $arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringManual'); |
|
| 794 | - $arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringManual'); |
|
| 791 | + $arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringAuto'); |
|
| 792 | + $arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringAuto'); |
|
| 793 | + $arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringManual'); |
|
| 794 | + $arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringManual'); |
|
| 795 | 795 | } |
| 796 | 796 | if ($user->hasRight('accounting', 'mouvements', 'supprimer')) { |
| 797 | 797 | $arrayofmassactions['predeletebookkeepingwriting'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); |
@@ -1278,8 +1278,8 @@ discard block |
||
| 1278 | 1278 | $labeltoshow .= $objectstatic->getNomUrl(1); |
| 1279 | 1279 | $labeltoshowalt .= $objectstatic->ref; |
| 1280 | 1280 | $bank_ref = strstr($line->doc_ref, '-'); |
| 1281 | - $labeltoshow .= " " . $bank_ref; |
|
| 1282 | - $labeltoshowalt .= " " . $bank_ref; |
|
| 1281 | + $labeltoshow .= " ".$bank_ref; |
|
| 1282 | + $labeltoshowalt .= " ".$bank_ref; |
|
| 1283 | 1283 | } else { |
| 1284 | 1284 | $labeltoshow .= $line->doc_ref; |
| 1285 | 1285 | $labeltoshowalt .= $line->doc_ref; |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | $search_date_due_start = ''; |
| 282 | 282 | // Due date end |
| 283 | 283 | $search_date_due_end_day = ''; |
| 284 | - $search_date_due_end_month = ''; |
|
| 284 | + $search_date_due_end_month = ''; |
|
| 285 | 285 | $search_date_due_end_year = ''; |
| 286 | 286 | $search_date_due_end = ''; |
| 287 | 287 | $search_lettering_code = ''; |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | } else { |
| 325 | 325 | $filter['t.numero_compte>='] = $search_accountancy_code_start; |
| 326 | 326 | } |
| 327 | - $param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start); |
|
| 327 | + $param .= '&search_accountancy_code_start='.urlencode($search_accountancy_code_start); |
|
| 328 | 328 | } |
| 329 | 329 | if (!empty($search_accountancy_code_end)) { |
| 330 | 330 | if ($type == 'sub') { |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | } else { |
| 333 | 333 | $filter['t.numero_compte<='] = $search_accountancy_code_end; |
| 334 | 334 | } |
| 335 | - $param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end); |
|
| 335 | + $param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end); |
|
| 336 | 336 | } |
| 337 | 337 | if (!empty($search_label_account)) { |
| 338 | 338 | $filter['t.label_compte'] = $search_label_account; |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | if (!$error) { |
| 527 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 527 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 528 | 528 | exit(); |
| 529 | 529 | } |
| 530 | 530 | } elseif ($massaction == 'letteringmanual') { |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | setEventMessages('', $lettering->errors, 'errors'); |
| 535 | 535 | } else { |
| 536 | 536 | setEventMessages($langs->trans($result == 0 ? 'AccountancyNoLetteringModified' : 'AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs'); |
| 537 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 537 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 538 | 538 | exit(); |
| 539 | 539 | } |
| 540 | 540 | } elseif ($type == 'sub' && $massaction == 'letteringpartial') { |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | setEventMessages('', $lettering->errors, 'errors'); |
| 545 | 545 | } else { |
| 546 | 546 | setEventMessages($langs->trans($result == 0 ? 'AccountancyNoLetteringModified' : 'AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs'); |
| 547 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 547 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 548 | 548 | exit(); |
| 549 | 549 | } |
| 550 | 550 | } elseif ($action == 'unletteringauto' && $confirm == "yes") { |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | } |
| 566 | 566 | |
| 567 | 567 | if (!$error) { |
| 568 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 568 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 569 | 569 | exit(); |
| 570 | 570 | } |
| 571 | 571 | } elseif ($action == 'unletteringmanual' && $confirm == "yes") { |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | setEventMessages('', $lettering->errors, 'errors'); |
| 576 | 576 | } else { |
| 577 | 577 | setEventMessages($langs->trans($result == 0 ? 'AccountancyNoUnletteringModified' : 'AccountancyOneUnletteringModifiedSuccessfully'), array(), 'mesgs'); |
| 578 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 578 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 579 | 579 | exit(); |
| 580 | 580 | } |
| 581 | 581 | } |
@@ -682,13 +682,13 @@ discard block |
||
| 682 | 682 | // List of mass actions available |
| 683 | 683 | $arrayofmassactions = array(); |
| 684 | 684 | if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) { |
| 685 | - $arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringAuto'); |
|
| 686 | - $arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringAuto'); |
|
| 687 | - $arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringManual'); |
|
| 685 | + $arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringAuto'); |
|
| 686 | + $arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringAuto'); |
|
| 687 | + $arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringManual'); |
|
| 688 | 688 | if ($type == 'sub') { |
| 689 | - $arrayofmassactions['letteringpartial'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringPartial'); |
|
| 689 | + $arrayofmassactions['letteringpartial'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringPartial'); |
|
| 690 | 690 | } |
| 691 | - $arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringManual'); |
|
| 691 | + $arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringManual'); |
|
| 692 | 692 | } |
| 693 | 693 | if ($user->hasRight('accounting', 'mouvements', 'supprimer')) { |
| 694 | 694 | $arrayofmassactions['predeletebookkeepingwriting'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); |
@@ -721,11 +721,11 @@ discard block |
||
| 721 | 721 | if (empty($reshook)) { |
| 722 | 722 | $newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param); |
| 723 | 723 | if ($type == 'sub') { |
| 724 | - $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 725 | - $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
| 724 | + $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 725 | + $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub&'.$url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
| 726 | 726 | } else { |
| 727 | - $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
| 728 | - $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 727 | + $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
| 728 | + $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub&'.$url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 729 | 729 | } |
| 730 | 730 | $newcardbutton .= dolGetButtonTitleSeparator(); |
| 731 | 731 | $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create'); |
@@ -803,8 +803,8 @@ discard block |
||
| 803 | 803 | } else { |
| 804 | 804 | $stringforfirstkey .= ' CTL +'; |
| 805 | 805 | } |
| 806 | -$moreforfilter .= ' <a id="previous_account" accesskey="p" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>'; |
|
| 807 | -$moreforfilter .= ' <a id="next_account" accesskey="n" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>'; |
|
| 806 | +$moreforfilter .= ' <a id="previous_account" accesskey="p" title="'.$stringforfirstkey.' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>'; |
|
| 807 | +$moreforfilter .= ' <a id="next_account" accesskey="n" title="'.$stringforfirstkey.' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>'; |
|
| 808 | 808 | $moreforfilter .= <<<SCRIPT |
| 809 | 809 | <script type="text/javascript"> |
| 810 | 810 | jQuery(document).ready(function() { |
@@ -1030,7 +1030,7 @@ discard block |
||
| 1030 | 1030 | $totalarray['val'] = array(); |
| 1031 | 1031 | $totalarray['val']['totaldebit'] = 0; |
| 1032 | 1032 | $totalarray['val']['totalcredit'] = 0; |
| 1033 | -$totalarray['val']['totalbalance']=0; |
|
| 1033 | +$totalarray['val']['totalbalance'] = 0; |
|
| 1034 | 1034 | |
| 1035 | 1035 | while ($i < min($num, $limit)) { |
| 1036 | 1036 | $line = $object->lines[$i]; |
@@ -1042,8 +1042,8 @@ discard block |
||
| 1042 | 1042 | } |
| 1043 | 1043 | //if (empty($accountg)) $accountg = '-'; |
| 1044 | 1044 | |
| 1045 | - $colspan = 0; // colspan before field 'label of operation' |
|
| 1046 | - $colspanend = 0; // colspan after debit/credit |
|
| 1045 | + $colspan = 0; // colspan before field 'label of operation' |
|
| 1046 | + $colspanend = 0; // colspan after debit/credit |
|
| 1047 | 1047 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
| 1048 | 1048 | $colspan++; |
| 1049 | 1049 | } |
@@ -1096,9 +1096,9 @@ discard block |
||
| 1096 | 1096 | if (isset($displayed_account_number)) { |
| 1097 | 1097 | print '<tr class="liste_total">'; |
| 1098 | 1098 | if ($type == 'sub') { |
| 1099 | - print '<td class="right" colspan="' . $colspan . '">' . $langs->trans("TotalForAccount") . ' ' . length_accounta($displayed_account_number) . ':</td>'; |
|
| 1099 | + print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.length_accounta($displayed_account_number).':</td>'; |
|
| 1100 | 1100 | } else { |
| 1101 | - print '<td class="right" colspan="' . $colspan . '">' . $langs->trans("TotalForAccount") . ' ' . length_accountg($displayed_account_number) . ':</td>'; |
|
| 1101 | + print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.length_accountg($displayed_account_number).':</td>'; |
|
| 1102 | 1102 | } |
| 1103 | 1103 | print '<td class="nowrap right">'.price(price2num($sous_total_debit, 'MT')).'</td>'; |
| 1104 | 1104 | print '<td class="nowrap right">'.price(price2num($sous_total_credit, 'MT')).'</td>'; |
@@ -1137,9 +1137,9 @@ discard block |
||
| 1137 | 1137 | print length_accounta($line->subledger_account); |
| 1138 | 1138 | } else { |
| 1139 | 1139 | // Should not happen: subledger account must be null or a non empty value |
| 1140 | - print '<span class="error">' . $langs->trans("Unknown"); |
|
| 1140 | + print '<span class="error">'.$langs->trans("Unknown"); |
|
| 1141 | 1141 | if ($line->subledger_label) { |
| 1142 | - print ' (' . $line->subledger_label . ')'; |
|
| 1142 | + print ' ('.$line->subledger_label.')'; |
|
| 1143 | 1143 | $htmltext = 'EmptyStringForSubledgerAccountButSubledgerLabelDefined'; |
| 1144 | 1144 | } else { |
| 1145 | 1145 | $htmltext = 'EmptyStringForSubledgerAccountAndSubledgerLabel'; |
@@ -1149,9 +1149,9 @@ discard block |
||
| 1149 | 1149 | } |
| 1150 | 1150 | } else { |
| 1151 | 1151 | if ($line->numero_compte != "" && $line->numero_compte != '-1') { |
| 1152 | - print length_accountg($line->numero_compte) . ' : ' . $object->get_compte_desc($line->numero_compte); |
|
| 1152 | + print length_accountg($line->numero_compte).' : '.$object->get_compte_desc($line->numero_compte); |
|
| 1153 | 1153 | } else { |
| 1154 | - print '<span class="error">' . $langs->trans("Unknown") . '</span>'; |
|
| 1154 | + print '<span class="error">'.$langs->trans("Unknown").'</span>'; |
|
| 1155 | 1155 | } |
| 1156 | 1156 | } |
| 1157 | 1157 | print '</td>'; |
@@ -1174,7 +1174,7 @@ discard block |
||
| 1174 | 1174 | if (in_array($line->id, $arrayofselected)) { |
| 1175 | 1175 | $selected = 1; |
| 1176 | 1176 | } |
| 1177 | - print '<input id="cb' . $line->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id . '"' . ($selected ? ' checked="checked"' : '') . ' />'; |
|
| 1177 | + print '<input id="cb'.$line->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$line->id.'"'.($selected ? ' checked="checked"' : '').' />'; |
|
| 1178 | 1178 | } |
| 1179 | 1179 | print '</td>'; |
| 1180 | 1180 | if (!$i) { |
@@ -1268,7 +1268,7 @@ discard block |
||
| 1268 | 1268 | } elseif ($line->doc_type == 'bank') { |
| 1269 | 1269 | print $objectstatic->getNomUrl(1); |
| 1270 | 1270 | $bank_ref = strstr($line->doc_ref, '-'); |
| 1271 | - print " " . $bank_ref; |
|
| 1271 | + print " ".$bank_ref; |
|
| 1272 | 1272 | } else { |
| 1273 | 1273 | print $line->doc_ref; |
| 1274 | 1274 | } |
@@ -1381,7 +1381,7 @@ discard block |
||
| 1381 | 1381 | if (in_array($line->id, $arrayofselected)) { |
| 1382 | 1382 | $selected = 1; |
| 1383 | 1383 | } |
| 1384 | - print '<input id="cb' . $line->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id . '"' . ($selected ? ' checked="checked"' : '') . ' />'; |
|
| 1384 | + print '<input id="cb'.$line->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$line->id.'"'.($selected ? ' checked="checked"' : '').' />'; |
|
| 1385 | 1385 | } |
| 1386 | 1386 | print '</td>'; |
| 1387 | 1387 | if (!$i) { |
@@ -307,12 +307,12 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | // Check partial / normal lettering case |
| 309 | 309 | $sql = "SELECT ab.lettering_code, GROUP_CONCAT(DISTINCT ab.rowid SEPARATOR ',') AS bookkeeping_ids"; |
| 310 | - $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab"; |
|
| 311 | - $sql .= " WHERE ab.rowid IN (" . $this->db->sanitize(implode(',', $ids)) . ")"; |
|
| 310 | + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS ab"; |
|
| 311 | + $sql .= " WHERE ab.rowid IN (".$this->db->sanitize(implode(',', $ids)).")"; |
|
| 312 | 312 | $sql .= " GROUP BY ab.lettering_code"; |
| 313 | 313 | $sql .= " ORDER BY ab.lettering_code DESC"; |
| 314 | 314 | |
| 315 | - dol_syslog(__METHOD__ . " - Check partial / normal lettering case", LOG_DEBUG); |
|
| 315 | + dol_syslog(__METHOD__." - Check partial / normal lettering case", LOG_DEBUG); |
|
| 316 | 316 | $resql = $this->db->query($sql); |
| 317 | 317 | if ($resql) { |
| 318 | 318 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -323,16 +323,16 @@ discard block |
||
| 323 | 323 | if (!empty($obj->bookkeeping_ids)) $ids = array_diff($ids, explode(',', $obj->bookkeeping_ids)); |
| 324 | 324 | } elseif (!$partial && preg_match('/^[a-z]+$/', $obj->lettering_code)) { |
| 325 | 325 | // Delete partial lettering code if set normal lettering |
| 326 | - $sql2 = "UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping SET"; |
|
| 326 | + $sql2 = "UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping SET"; |
|
| 327 | 327 | $sql2 .= " lettering_code = NULL"; |
| 328 | 328 | $sql2 .= ", date_lettering = NULL"; |
| 329 | - $sql2 .= " WHERE entity IN (" . getEntity('accountancy') . ")"; |
|
| 330 | - $sql2 .= " AND lettering_code = '" . $this->db->escape($obj->lettering_code) . "'"; |
|
| 329 | + $sql2 .= " WHERE entity IN (".getEntity('accountancy').")"; |
|
| 330 | + $sql2 .= " AND lettering_code = '".$this->db->escape($obj->lettering_code)."'"; |
|
| 331 | 331 | |
| 332 | - dol_syslog(__METHOD__ . " - Remove partial lettering", LOG_DEBUG); |
|
| 332 | + dol_syslog(__METHOD__." - Remove partial lettering", LOG_DEBUG); |
|
| 333 | 333 | $resql2 = $this->db->query($sql2); |
| 334 | 334 | if (!$resql2) { |
| 335 | - $this->errors[] = 'Error' . $this->db->lasterror(); |
|
| 335 | + $this->errors[] = 'Error'.$this->db->lasterror(); |
|
| 336 | 336 | $error++; |
| 337 | 337 | break; |
| 338 | 338 | } |
@@ -340,20 +340,20 @@ discard block |
||
| 340 | 340 | } |
| 341 | 341 | $this->db->free($resql); |
| 342 | 342 | } else { |
| 343 | - $this->errors[] = 'Error' . $this->db->lasterror(); |
|
| 343 | + $this->errors[] = 'Error'.$this->db->lasterror(); |
|
| 344 | 344 | $error++; |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | if (!$error && !empty($ids)) { |
| 348 | 348 | // Get next code |
| 349 | 349 | $sql = "SELECT DISTINCT ab2.lettering_code"; |
| 350 | - $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab"; |
|
| 351 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab2 ON ab2.subledger_account = ab.subledger_account"; |
|
| 352 | - $sql .= " WHERE ab.rowid IN (" . $this->db->sanitize(implode(',', $ids)) . ")"; |
|
| 350 | + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS ab"; |
|
| 351 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_bookkeeping AS ab2 ON ab2.subledger_account = ab.subledger_account"; |
|
| 352 | + $sql .= " WHERE ab.rowid IN (".$this->db->sanitize(implode(',', $ids)).")"; |
|
| 353 | 353 | $sql .= " AND ab2.lettering_code != ''"; |
| 354 | 354 | $sql .= " ORDER BY ab2.lettering_code DESC"; |
| 355 | 355 | |
| 356 | - dol_syslog(__METHOD__ . " - Get next code", LOG_DEBUG); |
|
| 356 | + dol_syslog(__METHOD__." - Get next code", LOG_DEBUG); |
|
| 357 | 357 | $resql = $this->db->query($sql); |
| 358 | 358 | if ($resql) { |
| 359 | 359 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -368,43 +368,43 @@ discard block |
||
| 368 | 368 | } |
| 369 | 369 | $this->db->free($resql); |
| 370 | 370 | } else { |
| 371 | - $this->errors[] = 'Error' . $this->db->lasterror(); |
|
| 371 | + $this->errors[] = 'Error'.$this->db->lasterror(); |
|
| 372 | 372 | $error++; |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | // Test amount integrity |
| 376 | 376 | if (!$error && !$partial) { |
| 377 | - $sql = "SELECT SUM(ABS(debit)) as deb, SUM(ABS(credit)) as cred FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE "; |
|
| 378 | - $sql .= " rowid IN (" . $this->db->sanitize(implode(',', $ids)) . ") AND lettering_code IS NULL AND subledger_account != ''"; |
|
| 377 | + $sql = "SELECT SUM(ABS(debit)) as deb, SUM(ABS(credit)) as cred FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE "; |
|
| 378 | + $sql .= " rowid IN (".$this->db->sanitize(implode(',', $ids)).") AND lettering_code IS NULL AND subledger_account != ''"; |
|
| 379 | 379 | |
| 380 | - dol_syslog(__METHOD__ . " - Test amount integrity", LOG_DEBUG); |
|
| 380 | + dol_syslog(__METHOD__." - Test amount integrity", LOG_DEBUG); |
|
| 381 | 381 | $resql = $this->db->query($sql); |
| 382 | 382 | if ($resql) { |
| 383 | 383 | if ($obj = $this->db->fetch_object($resql)) { |
| 384 | 384 | if (!(round(abs($obj->deb), 2) === round(abs($obj->cred), 2))) { |
| 385 | - $this->errors[] = 'Total not exacts ' . round(abs($obj->deb), 2) . ' vs ' . round(abs($obj->cred), 2); |
|
| 385 | + $this->errors[] = 'Total not exacts '.round(abs($obj->deb), 2).' vs '.round(abs($obj->cred), 2); |
|
| 386 | 386 | $error++; |
| 387 | 387 | } |
| 388 | 388 | } |
| 389 | 389 | $this->db->free($resql); |
| 390 | 390 | } else { |
| 391 | - $this->errors[] = 'Erreur sql' . $this->db->lasterror(); |
|
| 391 | + $this->errors[] = 'Erreur sql'.$this->db->lasterror(); |
|
| 392 | 392 | $error++; |
| 393 | 393 | } |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | // Update lettering code |
| 397 | 397 | if (!$error) { |
| 398 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping SET"; |
|
| 399 | - $sql .= " lettering_code='" . $this->db->escape($letter) . "'"; |
|
| 400 | - $sql .= ", date_lettering = '" . $this->db->idate($now) . "'"; // todo correct date it's false |
|
| 401 | - $sql .= " WHERE rowid IN (" . $this->db->sanitize(implode(',', $ids)) . ") AND lettering_code IS NULL AND subledger_account != ''"; |
|
| 398 | + $sql = "UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping SET"; |
|
| 399 | + $sql .= " lettering_code='".$this->db->escape($letter)."'"; |
|
| 400 | + $sql .= ", date_lettering = '".$this->db->idate($now)."'"; // todo correct date it's false |
|
| 401 | + $sql .= " WHERE rowid IN (".$this->db->sanitize(implode(',', $ids)).") AND lettering_code IS NULL AND subledger_account != ''"; |
|
| 402 | 402 | |
| 403 | - dol_syslog(__METHOD__ . " - Update lettering code", LOG_DEBUG); |
|
| 403 | + dol_syslog(__METHOD__." - Update lettering code", LOG_DEBUG); |
|
| 404 | 404 | $resql = $this->db->query($sql); |
| 405 | 405 | if (!$resql) { |
| 406 | 406 | $error++; |
| 407 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
| 407 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
| 408 | 408 | } else { |
| 409 | 409 | $affected_rows = $this->db->affected_rows($resql); |
| 410 | 410 | } |
@@ -415,8 +415,8 @@ discard block |
||
| 415 | 415 | if ($error) { |
| 416 | 416 | $this->db->rollback(); |
| 417 | 417 | foreach ($this->errors as $errmsg) { |
| 418 | - dol_syslog(get_class($this) . "::update " . $errmsg, LOG_ERR); |
|
| 419 | - $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); |
|
| 418 | + dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); |
|
| 419 | + $this->error .= ($this->error ? ', '.$errmsg : $errmsg); |
|
| 420 | 420 | } |
| 421 | 421 | return -1 * $error; |
| 422 | 422 | } else { |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | */ |
| 470 | 470 | public function bookkeepingLetteringAll($bookkeeping_ids, $unlettering = false) |
| 471 | 471 | { |
| 472 | - dol_syslog(__METHOD__ . " - ", LOG_DEBUG); |
|
| 472 | + dol_syslog(__METHOD__." - ", LOG_DEBUG); |
|
| 473 | 473 | |
| 474 | 474 | $error = 0; |
| 475 | 475 | $errors = array(); |
@@ -595,16 +595,16 @@ discard block |
||
| 595 | 595 | |
| 596 | 596 | // Get all bookkeeping lines |
| 597 | 597 | $sql = "SELECT DISTINCT ab.doc_type, ab.fk_doc"; |
| 598 | - $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab"; |
|
| 599 | - $sql .= " WHERE ab.entity IN (" . getEntity('accountancy') . ")"; |
|
| 598 | + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS ab"; |
|
| 599 | + $sql .= " WHERE ab.entity IN (".getEntity('accountancy').")"; |
|
| 600 | 600 | $sql .= " AND ab.fk_doc > 0"; |
| 601 | 601 | if (!empty($bookkeeping_ids)) { |
| 602 | 602 | // Get all bookkeeping lines of piece number |
| 603 | 603 | $sql .= " AND EXISTS ("; |
| 604 | 604 | $sql .= " SELECT rowid"; |
| 605 | - $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS pn"; |
|
| 606 | - $sql .= " WHERE pn.entity IN (" . getEntity('accountancy') . ")"; |
|
| 607 | - $sql .= " AND pn.rowid IN (" . $this->db->sanitize(implode(',', $bookkeeping_ids)) . ")"; |
|
| 605 | + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS pn"; |
|
| 606 | + $sql .= " WHERE pn.entity IN (".getEntity('accountancy').")"; |
|
| 607 | + $sql .= " AND pn.rowid IN (".$this->db->sanitize(implode(',', $bookkeeping_ids)).")"; |
|
| 608 | 608 | $sql .= " AND pn.piece_num = ab.piece_num"; |
| 609 | 609 | $sql .= " )"; |
| 610 | 610 | } |
@@ -612,10 +612,10 @@ discard block |
||
| 612 | 612 | $sql .= " AND ab.subledger_account != ''"; |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | - dol_syslog(__METHOD__ . " - Get all bookkeeping lines", LOG_DEBUG); |
|
| 615 | + dol_syslog(__METHOD__." - Get all bookkeeping lines", LOG_DEBUG); |
|
| 616 | 616 | $resql = $this->db->query($sql); |
| 617 | 617 | if (!$resql) { |
| 618 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
| 618 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
| 619 | 619 | return -1; |
| 620 | 620 | } |
| 621 | 621 | |
@@ -662,25 +662,25 @@ discard block |
||
| 662 | 662 | |
| 663 | 663 | // Get all bookkeeping lines linked |
| 664 | 664 | $sql = "SELECT DISTINCT ab.rowid, ab.piece_num, ab.debit, ab.credit, ab.lettering_code"; |
| 665 | - $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab"; |
|
| 666 | - $sql .= " WHERE ab.entity IN (" . getEntity('accountancy') . ")"; |
|
| 665 | + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS ab"; |
|
| 666 | + $sql .= " WHERE ab.entity IN (".getEntity('accountancy').")"; |
|
| 667 | 667 | $sql .= " AND ("; |
| 668 | 668 | if (!empty($bank_ids)) { |
| 669 | 669 | $sql .= " EXISTS ("; |
| 670 | 670 | $sql .= " SELECT bpn.rowid"; |
| 671 | - $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS bpn"; |
|
| 672 | - $sql .= " WHERE bpn.entity IN (" . getEntity('accountancy') . ")"; |
|
| 671 | + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS bpn"; |
|
| 672 | + $sql .= " WHERE bpn.entity IN (".getEntity('accountancy').")"; |
|
| 673 | 673 | $sql .= " AND bpn.doc_type = 'bank'"; |
| 674 | - $sql .= " AND bpn.fk_doc IN (" . $this->db->sanitize(implode(',', $bank_ids)) . ")"; |
|
| 674 | + $sql .= " AND bpn.fk_doc IN (".$this->db->sanitize(implode(',', $bank_ids)).")"; |
|
| 675 | 675 | $sql .= " AND bpn.piece_num = ab.piece_num"; |
| 676 | 676 | $sql .= " ) OR "; |
| 677 | 677 | } |
| 678 | 678 | $sql .= " EXISTS ("; |
| 679 | 679 | $sql .= " SELECT dpn.rowid"; |
| 680 | - $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS dpn"; |
|
| 681 | - $sql .= " WHERE dpn.entity IN (" . getEntity('accountancy') . ")"; |
|
| 682 | - $sql .= " AND dpn.doc_type = '" . $this->db->escape($doc_type) . "'"; |
|
| 683 | - $sql .= " AND dpn.fk_doc IN (" . $this->db->sanitize(implode(',', $doc_ids)) . ")"; |
|
| 680 | + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS dpn"; |
|
| 681 | + $sql .= " WHERE dpn.entity IN (".getEntity('accountancy').")"; |
|
| 682 | + $sql .= " AND dpn.doc_type = '".$this->db->escape($doc_type)."'"; |
|
| 683 | + $sql .= " AND dpn.fk_doc IN (".$this->db->sanitize(implode(',', $doc_ids)).")"; |
|
| 684 | 684 | $sql .= " AND dpn.piece_num = ab.piece_num"; |
| 685 | 685 | $sql .= " )"; |
| 686 | 686 | $sql .= ")"; |
@@ -688,10 +688,10 @@ discard block |
||
| 688 | 688 | $sql .= " AND ab.subledger_account != ''"; |
| 689 | 689 | } |
| 690 | 690 | |
| 691 | - dol_syslog(__METHOD__ . " - Get all bookkeeping lines linked", LOG_DEBUG); |
|
| 691 | + dol_syslog(__METHOD__." - Get all bookkeeping lines linked", LOG_DEBUG); |
|
| 692 | 692 | $resql = $this->db->query($sql); |
| 693 | 693 | if (!$resql) { |
| 694 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
| 694 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
| 695 | 695 | return -1; |
| 696 | 696 | } |
| 697 | 697 | |
@@ -724,7 +724,7 @@ discard block |
||
| 724 | 724 | */ |
| 725 | 725 | public function getDocTypeAndFkDocFromBankLines($bank_ids) |
| 726 | 726 | { |
| 727 | - dol_syslog(__METHOD__ . " - bank_ids=".json_encode($bank_ids), LOG_DEBUG); |
|
| 727 | + dol_syslog(__METHOD__." - bank_ids=".json_encode($bank_ids), LOG_DEBUG); |
|
| 728 | 728 | |
| 729 | 729 | // Clean parameters |
| 730 | 730 | $bank_ids = is_array($bank_ids) ? $bank_ids : array(); |
@@ -736,16 +736,16 @@ discard block |
||
| 736 | 736 | $bookkeeping_lines_by_type = array(); |
| 737 | 737 | foreach (self::$doc_type_infos as $doc_type => $doc_type_info) { |
| 738 | 738 | // Get all fk_doc by doc_type from bank ids |
| 739 | - $sql = "SELECT DISTINCT dp." . $this->db->sanitize($doc_type_info['doc_payment_table_fk_doc']) . " AS fk_doc"; |
|
| 740 | - $sql .= " FROM " . MAIN_DB_PREFIX . $this->db->sanitize($doc_type_info['payment_table']) . " AS p"; |
|
| 741 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $this->db->sanitize($doc_type_info['doc_payment_table']) . " AS dp ON dp." . $this->db->sanitize($doc_type_info['doc_payment_table_fk_payment']) . " = p.rowid"; |
|
| 742 | - $sql .= " WHERE p." . $this->db->sanitize($doc_type_info['payment_table_fk_bank']) . " IN (" . $this->db->sanitize(implode(',', $bank_ids)) . ")"; |
|
| 743 | - $sql .= " AND dp." . $this->db->sanitize($doc_type_info['doc_payment_table_fk_doc']) . " > 0"; |
|
| 739 | + $sql = "SELECT DISTINCT dp.".$this->db->sanitize($doc_type_info['doc_payment_table_fk_doc'])." AS fk_doc"; |
|
| 740 | + $sql .= " FROM ".MAIN_DB_PREFIX.$this->db->sanitize($doc_type_info['payment_table'])." AS p"; |
|
| 741 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$this->db->sanitize($doc_type_info['doc_payment_table'])." AS dp ON dp.".$this->db->sanitize($doc_type_info['doc_payment_table_fk_payment'])." = p.rowid"; |
|
| 742 | + $sql .= " WHERE p.".$this->db->sanitize($doc_type_info['payment_table_fk_bank'])." IN (".$this->db->sanitize(implode(',', $bank_ids)).")"; |
|
| 743 | + $sql .= " AND dp.".$this->db->sanitize($doc_type_info['doc_payment_table_fk_doc'])." > 0"; |
|
| 744 | 744 | |
| 745 | - dol_syslog(__METHOD__ . " - Get all fk_doc by doc_type from list of bank ids for '" . $doc_type . "'", LOG_DEBUG); |
|
| 745 | + dol_syslog(__METHOD__." - Get all fk_doc by doc_type from list of bank ids for '".$doc_type."'", LOG_DEBUG); |
|
| 746 | 746 | $resql = $this->db->query($sql); |
| 747 | 747 | if (!$resql) { |
| 748 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
| 748 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
| 749 | 749 | return -1; |
| 750 | 750 | } |
| 751 | 751 | |
@@ -769,7 +769,7 @@ discard block |
||
| 769 | 769 | { |
| 770 | 770 | global $langs; |
| 771 | 771 | |
| 772 | - dol_syslog(__METHOD__ . " - bank_ids=".json_encode($document_ids) . ", doc_type=$doc_type", LOG_DEBUG); |
|
| 772 | + dol_syslog(__METHOD__." - bank_ids=".json_encode($document_ids).", doc_type=$doc_type", LOG_DEBUG); |
|
| 773 | 773 | |
| 774 | 774 | // Clean parameters |
| 775 | 775 | $document_ids = is_array($document_ids) ? $document_ids : array(); |
@@ -791,16 +791,16 @@ discard block |
||
| 791 | 791 | $bank_ids = array(); |
| 792 | 792 | |
| 793 | 793 | // Get all fk_doc by doc_type from bank ids |
| 794 | - $sql = "SELECT DISTINCT p." . $this->db->sanitize($doc_type_info['payment_table_fk_bank']) . " AS fk_doc"; |
|
| 795 | - $sql .= " FROM " . MAIN_DB_PREFIX . $this->db->sanitize($doc_type_info['payment_table']) . " AS p"; |
|
| 796 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $this->db->sanitize($doc_type_info['doc_payment_table']) . " AS dp ON dp." . $this->db->sanitize($doc_type_info['doc_payment_table_fk_payment']) . " = p.rowid"; |
|
| 797 | - $sql .= " WHERE dp." . $this->db->sanitize($doc_type_info['doc_payment_table_fk_doc']) . " IN (" . $this->db->sanitize(implode(',', $document_ids)) . ")"; |
|
| 798 | - $sql .= " AND p." . $this->db->sanitize($doc_type_info['payment_table_fk_bank']) . " > 0"; |
|
| 794 | + $sql = "SELECT DISTINCT p.".$this->db->sanitize($doc_type_info['payment_table_fk_bank'])." AS fk_doc"; |
|
| 795 | + $sql .= " FROM ".MAIN_DB_PREFIX.$this->db->sanitize($doc_type_info['payment_table'])." AS p"; |
|
| 796 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$this->db->sanitize($doc_type_info['doc_payment_table'])." AS dp ON dp.".$this->db->sanitize($doc_type_info['doc_payment_table_fk_payment'])." = p.rowid"; |
|
| 797 | + $sql .= " WHERE dp.".$this->db->sanitize($doc_type_info['doc_payment_table_fk_doc'])." IN (".$this->db->sanitize(implode(',', $document_ids)).")"; |
|
| 798 | + $sql .= " AND p.".$this->db->sanitize($doc_type_info['payment_table_fk_bank'])." > 0"; |
|
| 799 | 799 | |
| 800 | - dol_syslog(__METHOD__ . " - Get all bank ids from list of document ids of a type '" . $doc_type . "'", LOG_DEBUG); |
|
| 800 | + dol_syslog(__METHOD__." - Get all bank ids from list of document ids of a type '".$doc_type."'", LOG_DEBUG); |
|
| 801 | 801 | $resql = $this->db->query($sql); |
| 802 | 802 | if (!$resql) { |
| 803 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
| 803 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
| 804 | 804 | return -1; |
| 805 | 805 | } |
| 806 | 806 | |
@@ -855,26 +855,26 @@ discard block |
||
| 855 | 855 | $sql = "SELECT DISTINCT tl2.fk_link, tl2.fk_doc"; |
| 856 | 856 | $sql .= " FROM ("; |
| 857 | 857 | // @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset |
| 858 | - $sql .= " SELECT DISTINCT " . $this->db->ifsql("tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tl.".$this->db->sanitize($linked_info['fk_link']))." AS fk_link, tl.".$this->db->sanitize($linked_info['fk_doc'])." AS fk_doc"; |
|
| 859 | - $sql .= " FROM " . MAIN_DB_PREFIX .$this->db->sanitize($linked_info['table'])." AS tl"; |
|
| 858 | + $sql .= " SELECT DISTINCT ".$this->db->ifsql("tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tl.".$this->db->sanitize($linked_info['fk_link']))." AS fk_link, tl.".$this->db->sanitize($linked_info['fk_doc'])." AS fk_doc"; |
|
| 859 | + $sql .= " FROM ".MAIN_DB_PREFIX.$this->db->sanitize($linked_info['table'])." AS tl"; |
|
| 860 | 860 | // @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset |
| 861 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $this->db->sanitize($linked_info['table_link_line']) . " AS tll ON tll.".$this->db->sanitize($linked_info['fk_table_link_line']) . " = tl.".$this->db->sanitize($linked_info['fk_line_link']); |
|
| 861 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$this->db->sanitize($linked_info['table_link_line'])." AS tll ON tll.".$this->db->sanitize($linked_info['fk_table_link_line'])." = tl.".$this->db->sanitize($linked_info['fk_line_link']); |
|
| 862 | 862 | $sql .= ") AS tl"; |
| 863 | 863 | $sql .= " LEFT JOIN ("; |
| 864 | 864 | // @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset |
| 865 | - $sql .= " SELECT DISTINCT " . $this->db->ifsql("tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tl.".$this->db->sanitize($linked_info['fk_link']))." AS fk_link, tl.".$this->db->sanitize($linked_info['fk_doc'])." AS fk_doc"; |
|
| 866 | - $sql .= " FROM " . MAIN_DB_PREFIX .$this->db->sanitize($linked_info['table'])." AS tl"; |
|
| 865 | + $sql .= " SELECT DISTINCT ".$this->db->ifsql("tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tl.".$this->db->sanitize($linked_info['fk_link']))." AS fk_link, tl.".$this->db->sanitize($linked_info['fk_doc'])." AS fk_doc"; |
|
| 866 | + $sql .= " FROM ".MAIN_DB_PREFIX.$this->db->sanitize($linked_info['table'])." AS tl"; |
|
| 867 | 867 | // @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset |
| 868 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $this->db->sanitize($linked_info['table_link_line']) . " AS tll ON tll.".$this->db->sanitize($linked_info['fk_table_link_line']) . " = tl.".$this->db->sanitize($linked_info['fk_line_link']); |
|
| 868 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$this->db->sanitize($linked_info['table_link_line'])." AS tll ON tll.".$this->db->sanitize($linked_info['fk_table_link_line'])." = tl.".$this->db->sanitize($linked_info['fk_line_link']); |
|
| 869 | 869 | $sql .= ") AS tl2 ON tl2.fk_link = tl.fk_link"; |
| 870 | - $sql .= " WHERE tl.fk_doc IN (" . $this->db->sanitize(implode(',', $document_ids)) . ")"; |
|
| 870 | + $sql .= " WHERE tl.fk_doc IN (".$this->db->sanitize(implode(',', $document_ids)).")"; |
|
| 871 | 871 | $sql .= " AND tl2.fk_doc IS NOT NULL"; |
| 872 | 872 | } |
| 873 | 873 | |
| 874 | - dol_syslog(__METHOD__ . " - Get document lines", LOG_DEBUG); |
|
| 874 | + dol_syslog(__METHOD__." - Get document lines", LOG_DEBUG); |
|
| 875 | 875 | $resql = $this->db->query($sql); |
| 876 | 876 | if (!$resql) { |
| 877 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
| 877 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
| 878 | 878 | return -1; |
| 879 | 879 | } |
| 880 | 880 | |
@@ -882,7 +882,7 @@ discard block |
||
| 882 | 882 | while ($obj = $this->db->fetch_object($resql)) { |
| 883 | 883 | $current_document_ids[$obj->fk_doc] = $obj->fk_doc; |
| 884 | 884 | |
| 885 | - $link_key = $linked_info['prefix'] . $obj->fk_link; |
|
| 885 | + $link_key = $linked_info['prefix'].$obj->fk_link; |
|
| 886 | 886 | $element_by_link[$link_key][$obj->fk_doc] = $obj->fk_doc; |
| 887 | 887 | $link_by_element[$obj->fk_doc][$link_key] = $link_key; |
| 888 | 888 | if ($is_fk_link_is_also_fk_doc) { |
@@ -316,11 +316,15 @@ |
||
| 316 | 316 | $resql = $this->db->query($sql); |
| 317 | 317 | if ($resql) { |
| 318 | 318 | while ($obj = $this->db->fetch_object($resql)) { |
| 319 | - if (empty($obj->lettering_code)) continue; |
|
| 319 | + if (empty($obj->lettering_code)) { |
|
| 320 | + continue; |
|
| 321 | + } |
|
| 320 | 322 | |
| 321 | 323 | // Remove normal lettering code if set partial lettering |
| 322 | 324 | if ($partial && preg_match('/^[A-Z]+$/', $obj->lettering_code)) { |
| 323 | - if (!empty($obj->bookkeeping_ids)) $ids = array_diff($ids, explode(',', $obj->bookkeeping_ids)); |
|
| 325 | + if (!empty($obj->bookkeeping_ids)) { |
|
| 326 | + $ids = array_diff($ids, explode(',', $obj->bookkeeping_ids)); |
|
| 327 | + } |
|
| 324 | 328 | } elseif (!$partial && preg_match('/^[a-z]+$/', $obj->lettering_code)) { |
| 325 | 329 | // Delete partial lettering code if set normal lettering |
| 326 | 330 | $sql2 = "UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping SET"; |
@@ -73,29 +73,29 @@ |
||
| 73 | 73 | |
| 74 | 74 | if ($filtertype != 1) { |
| 75 | 75 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 76 | - print '<td class="linecoluseunit left">' . $langs->trans('Unit') . '</td>'; |
|
| 76 | + print '<td class="linecoluseunit left">'.$langs->trans('Unit').'</td>'; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | // Qty frozen |
| 80 | - print '<td class="linecolqtyfrozen right">' . $form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . '</td>'; |
|
| 80 | + print '<td class="linecolqtyfrozen right">'.$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")).'</td>'; |
|
| 81 | 81 | |
| 82 | 82 | // Disable stock change |
| 83 | - print '<td class="linecoldisablestockchange right">' . $form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')) . '</td>'; |
|
| 83 | + print '<td class="linecoldisablestockchange right">'.$form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')).'</td>'; |
|
| 84 | 84 | |
| 85 | 85 | // Efficiency |
| 86 | - print '<td class="linecolefficiency right">' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . '</td>'; |
|
| 86 | + print '<td class="linecolefficiency right">'.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).'</td>'; |
|
| 87 | 87 | |
| 88 | 88 | // Cost |
| 89 | 89 | print '<td class="linecolcost right">'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).'</td>'; |
| 90 | 90 | } else { |
| 91 | - print '<td class="linecolunit right">' . $form->textwithpicto($langs->trans('Unit'), '').'</td>'; |
|
| 91 | + print '<td class="linecolunit right">'.$form->textwithpicto($langs->trans('Unit'), '').'</td>'; |
|
| 92 | 92 | |
| 93 | 93 | // Qty frozen |
| 94 | - print '<td class="linecolqtyfrozen right">' .$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . '</td>'; |
|
| 94 | + print '<td class="linecolqtyfrozen right">'.$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")).'</td>'; |
|
| 95 | 95 | |
| 96 | 96 | // Workstation |
| 97 | 97 | if (isModEnabled('workstation')) { |
| 98 | - print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . '</td>'; |
|
| 98 | + print '<td class="linecolworkstation right">'.$form->textwithpicto($langs->trans('DefaultWorkstation'), '').'</td>'; |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | // Cost |