@@ -37,7 +37,9 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | // Load translation files required by the page |
| 39 | 39 | $langs->loadLangs(array("stocks", "other", "productbatch", "companies")); |
| 40 | - if (isModEnabled('incoterm')) $langs->load('incoterm'); |
|
| 40 | + if (isModEnabled('incoterm')) { |
|
| 41 | + $langs->load('incoterm'); |
|
| 42 | + } |
|
| 41 | 43 | |
| 42 | 44 | // Get parameters |
| 43 | 45 | $id = GETPOST('id', 'int'); |
@@ -72,10 +74,14 @@ discard block |
||
| 72 | 74 | $search_all = trim(GETPOST("search_all", 'alpha')); |
| 73 | 75 | $search = array(); |
| 74 | 76 | foreach ($object->fields as $key => $val) { |
| 75 | - if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
| 76 | -} |
|
| 77 | + if (GETPOST('search_'.$key, 'alpha')) { |
|
| 78 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
| 79 | + } |
|
| 80 | + } |
|
| 77 | 81 | |
| 78 | -if (empty($action) && empty($id) && empty($ref)) $action = 'view'; |
|
| 82 | +if (empty($action) && empty($id) && empty($ref)) { |
|
| 83 | + $action = 'view'; |
|
| 84 | +} |
|
| 79 | 85 | |
| 80 | 86 | // Load object |
| 81 | 87 | include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
@@ -94,7 +100,9 @@ discard block |
||
| 94 | 100 | //$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0); |
| 95 | 101 | //$result = restrictedArea($user, 'stocktransfer', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); |
| 96 | 102 | |
| 97 | -if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); |
|
| 103 | +if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) { |
|
| 104 | + accessforbidden(); |
|
| 105 | +} |
|
| 98 | 106 | |
| 99 | 107 | |
| 100 | 108 | /* |
@@ -107,7 +115,9 @@ discard block |
||
| 107 | 115 | |
| 108 | 116 | $parameters = array(); |
| 109 | 117 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
| 110 | -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 118 | +if ($reshook < 0) { |
|
| 119 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 120 | +} |
|
| 111 | 121 | |
| 112 | 122 | if (empty($reshook)) { |
| 113 | 123 | $error = 0; |
@@ -116,8 +126,11 @@ discard block |
||
| 116 | 126 | |
| 117 | 127 | if (empty($backtopage) || ($cancel && empty($id))) { |
| 118 | 128 | if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { |
| 119 | - if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) $backtopage = $backurlforlist; |
|
| 120 | - else $backtopage = dol_buildpath('/product/stock/stocktransfer/stocktransfer_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); |
|
| 129 | + if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
|
| 130 | + $backtopage = $backurlforlist; |
|
| 131 | + } else { |
|
| 132 | + $backtopage = dol_buildpath('/product/stock/stocktransfer/stocktransfer_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); |
|
| 133 | + } |
|
| 121 | 134 | } |
| 122 | 135 | } |
| 123 | 136 | $triggermodname = 'STOCKTRANSFER_STOCKTRANSFER_MODIFY'; // Name of trigger action code to execute when we modify record |
@@ -184,7 +197,9 @@ discard block |
||
| 184 | 197 | if (empty($error)) { |
| 185 | 198 | $line = new StockTransferLine($db); |
| 186 | 199 | $records = $line->fetchAll('', '', 0, 0, array('customsql'=>' fk_stocktransfer = '.((int) $id).' AND fk_product = '.((int) $fk_product).' AND fk_warehouse_source = '.((int) $fk_warehouse_source).' AND fk_warehouse_destination = '.((int) $fk_warehouse_destination).' AND ('.(empty($batch) ? 'batch = "" or batch IS NULL' : "batch = '".$db->escape($batch)."'" ).')')); |
| 187 | - if (!empty($records[key($records)])) $line = $records[key($records)]; |
|
| 200 | + if (!empty($records[key($records)])) { |
|
| 201 | + $line = $records[key($records)]; |
|
| 202 | + } |
|
| 188 | 203 | $line->fk_stocktransfer = $id; |
| 189 | 204 | $line->qty += $qty; |
| 190 | 205 | $line->fk_warehouse_source = $fk_warehouse_source; |
@@ -193,8 +208,9 @@ discard block |
||
| 193 | 208 | $line->batch = $batch; |
| 194 | 209 | |
| 195 | 210 | $line->pmp = $prod->pmp; |
| 196 | - if ($line->id > 0) $line->update($user); |
|
| 197 | - else { |
|
| 211 | + if ($line->id > 0) { |
|
| 212 | + $line->update($user); |
|
| 213 | + } else { |
|
| 198 | 214 | $line->rang = (is_array($object->lines) || $object->lines instanceof Countable) ? count($object->lines) + 1 : 1; |
| 199 | 215 | $line->create($user); |
| 200 | 216 | } |
@@ -257,10 +273,15 @@ discard block |
||
| 257 | 273 | $db->begin(); |
| 258 | 274 | foreach ($lines as $line) { |
| 259 | 275 | $res = $line->doStockMovement($label, $code_inv, $line->fk_warehouse_source); |
| 260 | - if ($res <= 0) $error++; |
|
| 276 | + if ($res <= 0) { |
|
| 277 | + $error++; |
|
| 278 | + } |
|
| 279 | + } |
|
| 280 | + if (empty($error)) { |
|
| 281 | + $db->commit(); |
|
| 282 | + } else { |
|
| 283 | + $db->rollback(); |
|
| 261 | 284 | } |
| 262 | - if (empty($error)) $db->commit(); |
|
| 263 | - else $db->rollback(); |
|
| 264 | 285 | } |
| 265 | 286 | if (empty($error)) { |
| 266 | 287 | $object->setStatut($object::STATUS_TRANSFERED, $id); |
@@ -278,10 +299,15 @@ discard block |
||
| 278 | 299 | $db->begin(); |
| 279 | 300 | foreach ($lines as $line) { |
| 280 | 301 | $res = $line->doStockMovement($label, $code_inv, $line->fk_warehouse_source, 0); |
| 281 | - if ($res <= 0) $error++; |
|
| 302 | + if ($res <= 0) { |
|
| 303 | + $error++; |
|
| 304 | + } |
|
| 305 | + } |
|
| 306 | + if (empty($error)) { |
|
| 307 | + $db->commit(); |
|
| 308 | + } else { |
|
| 309 | + $db->rollback(); |
|
| 282 | 310 | } |
| 283 | - if (empty($error)) $db->commit(); |
|
| 284 | - else $db->rollback(); |
|
| 285 | 311 | } |
| 286 | 312 | if (empty($error)) { |
| 287 | 313 | $object->setStatut($object::STATUS_VALIDATED, $id); |
@@ -299,10 +325,15 @@ discard block |
||
| 299 | 325 | $db->begin(); |
| 300 | 326 | foreach ($lines as $line) { |
| 301 | 327 | $res = $line->doStockMovement($label, $code_inv, $line->fk_warehouse_destination, 0); |
| 302 | - if ($res <= 0) $error++; |
|
| 328 | + if ($res <= 0) { |
|
| 329 | + $error++; |
|
| 330 | + } |
|
| 331 | + } |
|
| 332 | + if (empty($error)) { |
|
| 333 | + $db->commit(); |
|
| 334 | + } else { |
|
| 335 | + $db->rollback(); |
|
| 303 | 336 | } |
| 304 | - if (empty($error)) $db->commit(); |
|
| 305 | - else $db->rollback(); |
|
| 306 | 337 | } |
| 307 | 338 | if (empty($error)) { |
| 308 | 339 | $object->setStatut($object::STATUS_CLOSED, $id); |
@@ -320,10 +351,15 @@ discard block |
||
| 320 | 351 | $db->begin(); |
| 321 | 352 | foreach ($lines as $line) { |
| 322 | 353 | $res = $line->doStockMovement($label, $code_inv, $line->fk_warehouse_destination); |
| 323 | - if ($res <= 0) $error++; |
|
| 354 | + if ($res <= 0) { |
|
| 355 | + $error++; |
|
| 356 | + } |
|
| 357 | + } |
|
| 358 | + if (empty($error)) { |
|
| 359 | + $db->commit(); |
|
| 360 | + } else { |
|
| 361 | + $db->rollback(); |
|
| 324 | 362 | } |
| 325 | - if (empty($error)) $db->commit(); |
|
| 326 | - else $db->rollback(); |
|
| 327 | 363 | } |
| 328 | 364 | if (empty($error)) { |
| 329 | 365 | $object->setStatut($object::STATUS_TRANSFERED, $id); |
@@ -368,7 +404,9 @@ discard block |
||
| 368 | 404 | // Affichage alerte date prévue de départ si transfert concerné |
| 369 | 405 | $date_prevue_depart = $object->date_prevue_depart; |
| 370 | 406 | $date_prevue_depart_plus_delai = $date_prevue_depart; |
| 371 | -if ($object->lead_time_for_warning > 0) $date_prevue_depart_plus_delai = strtotime(date('Y-m-d', $date_prevue_depart) . ' + '.$object->lead_time_for_warning.' day'); |
|
| 407 | +if ($object->lead_time_for_warning > 0) { |
|
| 408 | + $date_prevue_depart_plus_delai = strtotime(date('Y-m-d', $date_prevue_depart) . ' + '.$object->lead_time_for_warning.' day'); |
|
| 409 | +} |
|
| 372 | 410 | if (!empty($date_prevue_depart) && $date_prevue_depart_plus_delai < strtotime(date('Y-m-d'))) { |
| 373 | 411 | print "$('.valuefield.fieldname_date_prevue_depart').append('"; |
| 374 | 412 | print img_warning($langs->trans('Alert').' - '.$langs->trans('Late')); |
@@ -386,8 +424,12 @@ discard block |
||
| 386 | 424 | print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
| 387 | 425 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
| 388 | 426 | print '<input type="hidden" name="action" value="add">'; |
| 389 | - if ($backtopage) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 390 | - if ($backtopageforcancel) print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
| 427 | + if ($backtopage) { |
|
| 428 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 429 | + } |
|
| 430 | + if ($backtopageforcancel) { |
|
| 431 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
| 432 | + } |
|
| 391 | 433 | |
| 392 | 434 | print dol_get_fiche_head(array(), ''); |
| 393 | 435 | |
@@ -443,8 +485,12 @@ discard block |
||
| 443 | 485 | print '<input type="hidden" name="token" value="' . newToken() . '">'; |
| 444 | 486 | print '<input type="hidden" name="action" value="update">'; |
| 445 | 487 | print '<input type="hidden" name="id" value="' . $object->id . '">'; |
| 446 | - if ($backtopage) print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 447 | - if ($backtopageforcancel) print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
| 488 | + if ($backtopage) { |
|
| 489 | + print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 490 | + } |
|
| 491 | + if ($backtopageforcancel) { |
|
| 492 | + print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
| 493 | + } |
|
| 448 | 494 | |
| 449 | 495 | print dol_get_fiche_head(); |
| 450 | 496 | |
@@ -545,8 +591,11 @@ discard block |
||
| 545 | 591 | // Call Hook formConfirm |
| 546 | 592 | $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); |
| 547 | 593 | $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 548 | - if (empty($reshook)) $formconfirm .= $hookmanager->resPrint; |
|
| 549 | - elseif ($reshook > 0) $formconfirm = $hookmanager->resPrint; |
|
| 594 | + if (empty($reshook)) { |
|
| 595 | + $formconfirm .= $hookmanager->resPrint; |
|
| 596 | + } elseif ($reshook > 0) { |
|
| 597 | + $formconfirm = $hookmanager->resPrint; |
|
| 598 | + } |
|
| 550 | 599 | |
| 551 | 600 | // Print form confirm |
| 552 | 601 | print $formconfirm; |
@@ -616,8 +665,11 @@ discard block |
||
| 616 | 665 | print '<table width="100%" class="nobordernopadding"><tr><td>'; |
| 617 | 666 | print $langs->trans('IncotermLabel'); |
| 618 | 667 | print '<td><td class="right">'; |
| 619 | - if ($permissiontoadd && $action != 'editincoterm') print '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=editincoterm">'.img_edit().'</a>'; |
|
| 620 | - else print ' '; |
|
| 668 | + if ($permissiontoadd && $action != 'editincoterm') { |
|
| 669 | + print '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=editincoterm">'.img_edit().'</a>'; |
|
| 670 | + } else { |
|
| 671 | + print ' '; |
|
| 672 | + } |
|
| 621 | 673 | print '</td></tr></table>'; |
| 622 | 674 | print '</td>'; |
| 623 | 675 | print '<td>'; |
@@ -706,7 +758,9 @@ discard block |
||
| 706 | 758 | <input type="hidden" name="mode" value=""> |
| 707 | 759 | <input type="hidden" name="id" value="' . $object->id.'"> |
| 708 | 760 | '; |
| 709 | - if ($lineid > 0) print '<input type="hidden" name="lineid" value="'.$lineid.'" />'; |
|
| 761 | + if ($lineid > 0) { |
|
| 762 | + print '<input type="hidden" name="lineid" value="'.$lineid.'" />'; |
|
| 763 | + } |
|
| 710 | 764 | print '<table id="tablelines" class="liste centpercent">'; |
| 711 | 765 | //print '<div class="tagtable centpercent">'; |
| 712 | 766 | |
@@ -753,32 +807,47 @@ discard block |
||
| 753 | 807 | |
| 754 | 808 | print '<tr id="row-'.$line->id.'" class="drag drop oddeven" '.$domData.'>'; |
| 755 | 809 | print '<td class="titlefield">'; |
| 756 | - if ($action === 'editline' && $line->id == $lineid) $form->select_produits($line->fk_product, 'fk_product', $filtertype, $limit, 0, -1, 2, '', 0, array(), 0, 0, 0, 'minwidth200imp maxwidth300', 1); |
|
| 757 | - else print $productstatic->getNomUrl(1).' - '.$productstatic->label; |
|
| 810 | + if ($action === 'editline' && $line->id == $lineid) { |
|
| 811 | + $form->select_produits($line->fk_product, 'fk_product', $filtertype, $limit, 0, -1, 2, '', 0, array(), 0, 0, 0, 'minwidth200imp maxwidth300', 1); |
|
| 812 | + } else { |
|
| 813 | + print $productstatic->getNomUrl(1).' - '.$productstatic->label; |
|
| 814 | + } |
|
| 758 | 815 | print '</td>'; |
| 759 | 816 | if (isModEnabled('productbatch')) { |
| 760 | 817 | print '<td>'; |
| 761 | - if ($action === 'editline' && $line->id == $lineid) print '<input type="text" value="'.$line->batch.'" name="batch" class="flat maxwidth50"/>'; |
|
| 762 | - else { |
|
| 818 | + if ($action === 'editline' && $line->id == $lineid) { |
|
| 819 | + print '<input type="text" value="'.$line->batch.'" name="batch" class="flat maxwidth50"/>'; |
|
| 820 | + } else { |
|
| 763 | 821 | $productlot = new Productlot($db); |
| 764 | 822 | if ($productlot->fetch(0, $line->fk_product, $line->batch) > 0) { |
| 765 | 823 | print $productlot->getNomUrl(1); |
| 766 | - } elseif (!empty($line->batch)) print $line->batch.' '.img_warning($langs->trans('BatchNotFound')); |
|
| 824 | + } elseif (!empty($line->batch)) { |
|
| 825 | + print $line->batch.' '.img_warning($langs->trans('BatchNotFound')); |
|
| 826 | + } |
|
| 767 | 827 | } |
| 768 | 828 | print '</td>'; |
| 769 | 829 | } |
| 770 | 830 | |
| 771 | 831 | print '<td>'; |
| 772 | 832 | |
| 773 | - if ($action === 'editline' && $line->id == $lineid) print $formproduct->selectWarehouses($line->fk_warehouse_source, 'fk_warehouse_source', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp maxwidth200', $TExcludedWarehouseSource); |
|
| 774 | - else print $warehousestatics->getNomUrl(1); |
|
| 833 | + if ($action === 'editline' && $line->id == $lineid) { |
|
| 834 | + print $formproduct->selectWarehouses($line->fk_warehouse_source, 'fk_warehouse_source', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp maxwidth200', $TExcludedWarehouseSource); |
|
| 835 | + } else { |
|
| 836 | + print $warehousestatics->getNomUrl(1); |
|
| 837 | + } |
|
| 775 | 838 | print '</td>'; |
| 776 | 839 | print '<td>'; |
| 777 | - if ($action === 'editline' && $line->id == $lineid) print $formproduct->selectWarehouses($line->fk_warehouse_destination, 'fk_warehouse_destination', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp maxwidth200', $TExcludedWarehouseDestination); |
|
| 778 | - else print $warehousestatict->getNomUrl(1); |
|
| 840 | + if ($action === 'editline' && $line->id == $lineid) { |
|
| 841 | + print $formproduct->selectWarehouses($line->fk_warehouse_destination, 'fk_warehouse_destination', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp maxwidth200', $TExcludedWarehouseDestination); |
|
| 842 | + } else { |
|
| 843 | + print $warehousestatict->getNomUrl(1); |
|
| 844 | + } |
|
| 779 | 845 | print '</td>'; |
| 780 | - if ($action === 'editline' && $line->id == $lineid) print '<td class="center"><input type="text" class="flat maxwidth50" name="qty" value="'.$line->qty.'"></td>'; |
|
| 781 | - else print '<td class="center">'.$line->qty.'</td>'; |
|
| 846 | + if ($action === 'editline' && $line->id == $lineid) { |
|
| 847 | + print '<td class="center"><input type="text" class="flat maxwidth50" name="qty" value="'.$line->qty.'"></td>'; |
|
| 848 | + } else { |
|
| 849 | + print '<td class="center">'.$line->qty.'</td>'; |
|
| 850 | + } |
|
| 782 | 851 | |
| 783 | 852 | if ($conf->global->PRODUCT_USE_UNITS) { |
| 784 | 853 | print '<td class="linecoluseunit nowrap left">'; |
@@ -840,7 +909,9 @@ discard block |
||
| 840 | 909 | // Product |
| 841 | 910 | print '<td class="titlefield">'; |
| 842 | 911 | $filtertype = 0; |
| 843 | - if (!empty($conf->global->STOCK_SUPPORTS_SERVICES)) $filtertype = ''; |
|
| 912 | + if (!empty($conf->global->STOCK_SUPPORTS_SERVICES)) { |
|
| 913 | + $filtertype = ''; |
|
| 914 | + } |
|
| 844 | 915 | if ($conf->global->PRODUIT_LIMIT_SIZE <= 0) { |
| 845 | 916 | $limit = ''; |
| 846 | 917 | } else { |
@@ -864,7 +935,9 @@ discard block |
||
| 864 | 935 | $source_ent = new Entrepot($db); |
| 865 | 936 | $source_ent->fetch($object->fk_warehouse_source); |
| 866 | 937 | foreach ($formproduct->cache_warehouses as $TDataCacheWarehouse) { |
| 867 | - if (strpos($TDataCacheWarehouse['full_label'], $source_ent->label) === false) $TExcludedWarehouseSource[] = $TDataCacheWarehouse['id']; |
|
| 938 | + if (strpos($TDataCacheWarehouse['full_label'], $source_ent->label) === false) { |
|
| 939 | + $TExcludedWarehouseSource[] = $TDataCacheWarehouse['id']; |
|
| 940 | + } |
|
| 868 | 941 | } |
| 869 | 942 | } |
| 870 | 943 | |
@@ -874,7 +947,9 @@ discard block |
||
| 874 | 947 | $dest_ent = new Entrepot($db); |
| 875 | 948 | $dest_ent->fetch($object->fk_warehouse_destination); |
| 876 | 949 | foreach ($formproduct->cache_warehouses as $TDataCacheWarehouse) { |
| 877 | - if (strpos($TDataCacheWarehouse['full_label'], $dest_ent->label) === false) $TExcludedWarehouseDestination[] = $TDataCacheWarehouse['id']; |
|
| 950 | + if (strpos($TDataCacheWarehouse['full_label'], $dest_ent->label) === false) { |
|
| 951 | + $TExcludedWarehouseDestination[] = $TDataCacheWarehouse['id']; |
|
| 952 | + } |
|
| 878 | 953 | } |
| 879 | 954 | } |
| 880 | 955 | |
@@ -919,7 +994,9 @@ discard block |
||
| 919 | 994 | print '<div class="tabsAction">'."\n"; |
| 920 | 995 | $parameters = array(); |
| 921 | 996 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 922 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 997 | + if ($reshook < 0) { |
|
| 998 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 999 | + } |
|
| 923 | 1000 | |
| 924 | 1001 | if (empty($reshook)) { |
| 925 | 1002 | // Send |
@@ -1043,7 +1120,9 @@ discard block |
||
| 1043 | 1120 | } |
| 1044 | 1121 | |
| 1045 | 1122 | //Select mail models is same action as presend |
| 1046 | - if (GETPOST('modelselected')) $action = 'presend'; |
|
| 1123 | + if (GETPOST('modelselected')) { |
|
| 1124 | + $action = 'presend'; |
|
| 1125 | + } |
|
| 1047 | 1126 | |
| 1048 | 1127 | // Presend form |
| 1049 | 1128 | $modelmail = 'stocktransfer'; |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !preg_match('/^select;/', $typeofdata)) { |
| 120 | 120 | if (!empty($perm)) { |
| 121 | 121 | $tmp = explode(':', $typeofdata); |
| 122 | - $ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">'; |
|
| 122 | + $ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">'; |
|
| 123 | 123 | if ($fieldrequired) { |
| 124 | 124 | $ret .= '<span class="fieldrequired">'; |
| 125 | 125 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | if ($fieldrequired) { |
| 132 | 132 | $ret .= '</span>'; |
| 133 | 133 | } |
| 134 | - $ret .= '</div>' . "\n"; |
|
| 134 | + $ret .= '</div>'."\n"; |
|
| 135 | 135 | } else { |
| 136 | 136 | if ($fieldrequired) { |
| 137 | 137 | $ret .= '<span class="fieldrequired">'; |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | if (empty($notabletag) && $perm) { |
| 170 | 170 | $ret .= '<td class="right">'; |
| 171 | 171 | } |
| 172 | - if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) { |
|
| 173 | - $ret .= '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=edit' . $htmlname . '&token=' . newToken() . '&' . $paramid . '=' . $object->id . $moreparam . '">' . img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)) . '</a>'; |
|
| 172 | + if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) { |
|
| 173 | + $ret .= '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&token='.newToken().'&'.$paramid.'='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>'; |
|
| 174 | 174 | } |
| 175 | 175 | if (!empty($notabletag) && $notabletag == 1) { |
| 176 | 176 | if ($text) { |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | } elseif ($reg[1] == 'int') { |
| 238 | 238 | $typeofdata = 'numeric'; |
| 239 | 239 | } else { |
| 240 | - return 'ErrorBadParameter ' . $typeofdata; |
|
| 240 | + return 'ErrorBadParameter '.$typeofdata; |
|
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | |
@@ -248,13 +248,13 @@ discard block |
||
| 248 | 248 | if ($editaction == '') { |
| 249 | 249 | $editaction = GETPOST('action', 'aZ09'); |
| 250 | 250 | } |
| 251 | - $editmode = ($editaction == 'edit' . $htmlname); |
|
| 251 | + $editmode = ($editaction == 'edit'.$htmlname); |
|
| 252 | 252 | if ($editmode) { // edit mode |
| 253 | 253 | $ret .= "\n"; |
| 254 | - $ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">'; |
|
| 255 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 256 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 257 | - $ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">'; |
|
| 254 | + $ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">'; |
|
| 255 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 256 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 257 | + $ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">'; |
|
| 258 | 258 | if (empty($notabletag)) { |
| 259 | 259 | $ret .= '<table class="nobordernopadding centpercent">'; |
| 260 | 260 | } |
@@ -263,28 +263,28 @@ discard block |
||
| 263 | 263 | } |
| 264 | 264 | if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) { |
| 265 | 265 | $tmp = explode(':', $typeofdata); |
| 266 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 266 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 267 | 267 | } elseif (preg_match('/^(integer)/', $typeofdata)) { |
| 268 | 268 | $tmp = explode(':', $typeofdata); |
| 269 | 269 | $valuetoshow = price2num($editvalue ? $editvalue : $value, 0); |
| 270 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 270 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 271 | 271 | } elseif (preg_match('/^(numeric|amount)/', $typeofdata)) { |
| 272 | 272 | $tmp = explode(':', $typeofdata); |
| 273 | 273 | $valuetoshow = price2num($editvalue ? $editvalue : $value); |
| 274 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 274 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 275 | 275 | } elseif (preg_match('/^(checkbox)/', $typeofdata)) { |
| 276 | 276 | $tmp = explode(':', $typeofdata); |
| 277 | - $ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>'; |
|
| 277 | + $ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>'; |
|
| 278 | 278 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { // if wysiwyg is enabled $typeofdata = 'ckeditor' |
| 279 | 279 | $tmp = explode(':', $typeofdata); |
| 280 | 280 | $cols = (empty($tmp[2]) ? '' : $tmp[2]); |
| 281 | 281 | $morealt = ''; |
| 282 | 282 | if (preg_match('/%/', $cols)) { |
| 283 | - $morealt = ' style="width: ' . $cols . '"'; |
|
| 283 | + $morealt = ' style="width: '.$cols.'"'; |
|
| 284 | 284 | $cols = ''; |
| 285 | 285 | } |
| 286 | 286 | $valuetoshow = ($editvalue ? $editvalue : $value); |
| 287 | - $ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>'; |
|
| 287 | + $ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>'; |
|
| 288 | 288 | // textarea convert automatically entities chars into simple chars. |
| 289 | 289 | // So we convert & into & so a string like 'a < <b>b</b><br>é<br><script>alert('X');<script>' stay a correct html and is not converted by textarea component when wysiwig is off. |
| 290 | 290 | $valuetoshow = str_replace('&', '&', $valuetoshow); |
@@ -294,12 +294,12 @@ discard block |
||
| 294 | 294 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
| 295 | 295 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
| 296 | 296 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
| 297 | - $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 297 | + $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 298 | 298 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
| 299 | 299 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
| 300 | 300 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
| 301 | 301 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
| 302 | - $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 302 | + $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 303 | 303 | } elseif (preg_match('/^select;/', $typeofdata)) { |
| 304 | 304 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
| 305 | 305 | $arraylist = array(); |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | // TODO Not yet implemented. See code for extrafields |
| 314 | 314 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
| 315 | 315 | $tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser |
| 316 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
| 316 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
| 317 | 317 | $doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? '100' : $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? 0 : $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? '20' : $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7])); |
| 318 | 318 | $ret .= $doleditor->Create(1); |
| 319 | 319 | } elseif ($typeofdata == 'asis') { |
@@ -328,19 +328,19 @@ discard block |
||
| 328 | 328 | $ret .= '<td>'; |
| 329 | 329 | } |
| 330 | 330 | //else $ret.='<div class="clearboth"></div>'; |
| 331 | - $ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">'; |
|
| 331 | + $ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">'; |
|
| 332 | 332 | if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) { |
| 333 | - $ret .= '<br>' . "\n"; |
|
| 333 | + $ret .= '<br>'."\n"; |
|
| 334 | 334 | } |
| 335 | - $ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 335 | + $ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 336 | 336 | if (empty($notabletag)) { |
| 337 | 337 | $ret .= '</td>'; |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | if (empty($notabletag)) { |
| 341 | - $ret .= '</tr></table>' . "\n"; |
|
| 341 | + $ret .= '</tr></table>'."\n"; |
|
| 342 | 342 | } |
| 343 | - $ret .= '</form>' . "\n"; |
|
| 343 | + $ret .= '</form>'."\n"; |
|
| 344 | 344 | } else { // view mode |
| 345 | 345 | if (preg_match('/^email/', $typeofdata)) { |
| 346 | 346 | $ret .= dol_print_email($value, 0, 0, 0, 0, 1); |
@@ -352,15 +352,15 @@ discard block |
||
| 352 | 352 | $ret .= ($value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : ''); |
| 353 | 353 | } elseif (preg_match('/^checkbox/', $typeofdata)) { |
| 354 | 354 | $tmp = explode(':', $typeofdata); |
| 355 | - $ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>'; |
|
| 355 | + $ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>'; |
|
| 356 | 356 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { |
| 357 | 357 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1)); |
| 358 | 358 | } elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) { // 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring' |
| 359 | 359 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value)); |
| 360 | 360 | } elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') { |
| 361 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>'; |
|
| 361 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>'; |
|
| 362 | 362 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
| 363 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>'; |
|
| 363 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>'; |
|
| 364 | 364 | } elseif (preg_match('/^select;/', $typeofdata)) { |
| 365 | 365 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
| 366 | 366 | $arraylist = array(); |
@@ -371,9 +371,9 @@ discard block |
||
| 371 | 371 | $ret .= $arraylist[$value]; |
| 372 | 372 | if ($htmlname == 'fk_product_type') { |
| 373 | 373 | if ($value == 0) { |
| 374 | - $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
| 374 | + $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
| 375 | 375 | } else { |
| 376 | - $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
| 376 | + $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { |
| 382 | 382 | $firstline = preg_replace('/<br>.*/', '', $tmpcontent); |
| 383 | 383 | $firstline = preg_replace('/[\n\r].*/', '', $firstline); |
| 384 | - $tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
| 384 | + $tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
| 385 | 385 | } |
| 386 | 386 | // We dont use dol_escape_htmltag to get the html formating active, but this need we must also |
| 387 | 387 | // clean data from some dangerous html |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | if (empty($moreoptions['valuealreadyhtmlescaped'])) { |
| 391 | 391 | $ret .= dol_escape_htmltag($value); |
| 392 | 392 | } else { |
| 393 | - $ret .= $value; // $value must be already html escaped. |
|
| 393 | + $ret .= $value; // $value must be already html escaped. |
|
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | |
| 429 | 429 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
| 430 | 430 | if (!is_object($extralanguages)) { |
| 431 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
| 431 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
| 432 | 432 | $extralanguages = new ExtraLanguages($this->db); |
| 433 | 433 | } |
| 434 | 434 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -437,17 +437,17 @@ discard block |
||
| 437 | 437 | return ''; // No extralang field to show |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | - $result .= '<!-- Widget for translation -->' . "\n"; |
|
| 441 | - $result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">'; |
|
| 440 | + $result .= '<!-- Widget for translation -->'."\n"; |
|
| 441 | + $result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">'; |
|
| 442 | 442 | $s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang'); |
| 443 | 443 | $result .= $s; |
| 444 | 444 | $result .= '</div>'; |
| 445 | 445 | |
| 446 | - $result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">'; |
|
| 446 | + $result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">'; |
|
| 447 | 447 | |
| 448 | 448 | $resultforextrlang = ''; |
| 449 | 449 | foreach ($arrayoflangcode as $langcode) { |
| 450 | - $valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : ''; |
|
| 450 | + $valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : ''; |
|
| 451 | 451 | if (empty($valuetoshow)) { |
| 452 | 452 | $object->fetchValuesForExtraLanguages(); |
| 453 | 453 | //var_dump($object->array_languages); |
@@ -459,17 +459,17 @@ discard block |
||
| 459 | 459 | |
| 460 | 460 | // TODO Use the showInputField() method of ExtraLanguages object |
| 461 | 461 | if ($typeofdata == 'textarea') { |
| 462 | - $resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">'; |
|
| 462 | + $resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">'; |
|
| 463 | 463 | $resultforextrlang .= $valuetoshow; |
| 464 | 464 | $resultforextrlang .= '</textarea>'; |
| 465 | 465 | } else { |
| 466 | - $resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">'; |
|
| 466 | + $resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">'; |
|
| 467 | 467 | } |
| 468 | 468 | } |
| 469 | 469 | $result .= $resultforextrlang; |
| 470 | 470 | |
| 471 | 471 | $result .= '</div>'; |
| 472 | - $result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>'; |
|
| 472 | + $result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>'; |
|
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | return $result; |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | if (!empty($tmp[2])) { |
| 535 | 535 | $savemethod = $tmp[2]; |
| 536 | 536 | } |
| 537 | - $out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n"; |
|
| 537 | + $out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n"; |
|
| 538 | 538 | } elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) { |
| 539 | 539 | $tmp = explode(':', $inputType); |
| 540 | 540 | $inputType = $tmp[0]; |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | $savemethod = $tmp[2]; |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | - $out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format |
|
| 548 | + $out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format |
|
| 549 | 549 | } elseif (preg_match('/^(select|autocomplete)/', $inputType)) { |
| 550 | 550 | $tmp = explode(':', $inputType); |
| 551 | 551 | $inputType = $tmp[0]; |
@@ -576,40 +576,40 @@ discard block |
||
| 576 | 576 | } |
| 577 | 577 | |
| 578 | 578 | if (isModEnabled('fckeditor')) { |
| 579 | - $out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n"; |
|
| 579 | + $out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n"; |
|
| 580 | 580 | } else { |
| 581 | 581 | $inputType = 'textarea'; |
| 582 | 582 | } |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | - $out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n"; |
|
| 586 | - $out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n"; |
|
| 587 | - $out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n"; |
|
| 588 | - $out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n"; |
|
| 585 | + $out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n"; |
|
| 586 | + $out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n"; |
|
| 587 | + $out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n"; |
|
| 588 | + $out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n"; |
|
| 589 | 589 | if (!empty($savemethod)) { |
| 590 | - $out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n"; |
|
| 590 | + $out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n"; |
|
| 591 | 591 | } |
| 592 | 592 | if (!empty($ext_element)) { |
| 593 | - $out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n"; |
|
| 593 | + $out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n"; |
|
| 594 | 594 | } |
| 595 | 595 | if (!empty($custommsg)) { |
| 596 | 596 | if (is_array($custommsg)) { |
| 597 | 597 | if (!empty($custommsg['success'])) { |
| 598 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n"; |
|
| 598 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n"; |
|
| 599 | 599 | } |
| 600 | 600 | if (!empty($custommsg['error'])) { |
| 601 | - $out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n"; |
|
| 601 | + $out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n"; |
|
| 602 | 602 | } |
| 603 | 603 | } else { |
| 604 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n"; |
|
| 604 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n"; |
|
| 605 | 605 | } |
| 606 | 606 | } |
| 607 | 607 | if ($inputType == 'textarea') { |
| 608 | - $out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n"; |
|
| 609 | - $out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n"; |
|
| 608 | + $out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n"; |
|
| 609 | + $out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n"; |
|
| 610 | 610 | } |
| 611 | - $out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n"; |
|
| 612 | - $out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n"; |
|
| 611 | + $out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n"; |
|
| 612 | + $out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n"; |
|
| 613 | 613 | } else { |
| 614 | 614 | $out = $value; |
| 615 | 615 | } |
@@ -638,12 +638,12 @@ discard block |
||
| 638 | 638 | public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) |
| 639 | 639 | { |
| 640 | 640 | if ($incbefore) { |
| 641 | - $text = $incbefore . $text; |
|
| 641 | + $text = $incbefore.$text; |
|
| 642 | 642 | } |
| 643 | 643 | if (!$htmltext) { |
| 644 | 644 | return $text; |
| 645 | 645 | } |
| 646 | - $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
| 646 | + $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
| 647 | 647 | |
| 648 | 648 | $tag = 'td'; |
| 649 | 649 | if ($notabs == 2) { |
@@ -657,11 +657,11 @@ discard block |
||
| 657 | 657 | |
| 658 | 658 | $extrastyle = ''; |
| 659 | 659 | if ($direction < 0) { |
| 660 | - $extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : ''); |
|
| 660 | + $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); |
|
| 661 | 661 | $extrastyle = 'padding: 0px; padding-left: 3px;'; |
| 662 | 662 | } |
| 663 | 663 | if ($direction > 0) { |
| 664 | - $extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : ''); |
|
| 664 | + $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); |
|
| 665 | 665 | $extrastyle = 'padding: 0px; padding-right: 3px;'; |
| 666 | 666 | } |
| 667 | 667 | |
@@ -674,53 +674,53 @@ discard block |
||
| 674 | 674 | $htmltext = str_replace('"', '"', $htmltext); |
| 675 | 675 | } else { |
| 676 | 676 | $classfortooltip = 'classfortooltiponclick'; |
| 677 | - $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>'; |
|
| 677 | + $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>'; |
|
| 678 | 678 | } |
| 679 | 679 | if ($tooltipon == 2 || $tooltipon == 3) { |
| 680 | - $paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"'; |
|
| 680 | + $paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"'; |
|
| 681 | 681 | if ($tooltiptrigger == '') { |
| 682 | - $paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribut to put on img tag to store tooltip |
|
| 682 | + $paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on img tag to store tooltip |
|
| 683 | 683 | } else { |
| 684 | - $paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"'; |
|
| 684 | + $paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"'; |
|
| 685 | 685 | } |
| 686 | 686 | } else { |
| 687 | - $paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribut to put on td text tag |
|
| 687 | + $paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut to put on td text tag |
|
| 688 | 688 | } |
| 689 | 689 | if ($tooltipon == 1 || $tooltipon == 3) { |
| 690 | - $paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" '; |
|
| 690 | + $paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" '; |
|
| 691 | 691 | if ($tooltiptrigger == '') { |
| 692 | - $paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribut to put on td tag to store tooltip |
|
| 692 | + $paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on td tag to store tooltip |
|
| 693 | 693 | } else { |
| 694 | - $paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"'; |
|
| 694 | + $paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"'; |
|
| 695 | 695 | } |
| 696 | 696 | } else { |
| 697 | - $paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribut to put on td text tag |
|
| 697 | + $paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut to put on td text tag |
|
| 698 | 698 | } |
| 699 | 699 | if (empty($notabs)) { |
| 700 | 700 | $s .= '<table class="nobordernopadding"><tr style="height: auto;">'; |
| 701 | 701 | } elseif ($notabs == 2) { |
| 702 | - $s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">'; |
|
| 702 | + $s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">'; |
|
| 703 | 703 | } |
| 704 | 704 | // Define value if value is before |
| 705 | 705 | if ($direction < 0) { |
| 706 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
| 706 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
| 707 | 707 | if ($tag == 'td') { |
| 708 | 708 | $s .= ' class="valigntop" width="14"'; |
| 709 | 709 | } |
| 710 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
| 710 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
| 711 | 711 | } |
| 712 | 712 | // Use another method to help avoid having a space in value in order to use this value with jquery |
| 713 | 713 | // Define label |
| 714 | 714 | if ((string) $text != '') { |
| 715 | - $s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>'; |
|
| 715 | + $s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>'; |
|
| 716 | 716 | } |
| 717 | 717 | // Define value if value is after |
| 718 | 718 | if ($direction > 0) { |
| 719 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
| 719 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
| 720 | 720 | if ($tag == 'td') { |
| 721 | 721 | $s .= ' class="valignmiddle" width="14"'; |
| 722 | 722 | } |
| 723 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
| 723 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
| 724 | 724 | } |
| 725 | 725 | if (empty($notabs)) { |
| 726 | 726 | $s .= '</tr></table>'; |
@@ -825,7 +825,7 @@ discard block |
||
| 825 | 825 | |
| 826 | 826 | $disabled = 0; |
| 827 | 827 | $ret = '<div class="centpercent center">'; |
| 828 | - $ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>'; |
|
| 828 | + $ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>'; |
|
| 829 | 829 | |
| 830 | 830 | // Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks. |
| 831 | 831 | $parameters = array(); |
@@ -835,9 +835,9 @@ discard block |
||
| 835 | 835 | return; |
| 836 | 836 | } |
| 837 | 837 | if (empty($reshook)) { |
| 838 | - $ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>'; |
|
| 838 | + $ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>'; |
|
| 839 | 839 | foreach ($arrayofaction as $code => $label) { |
| 840 | - $ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>'; |
|
| 840 | + $ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>'; |
|
| 841 | 841 | } |
| 842 | 842 | } |
| 843 | 843 | $ret .= $hookmanager->resPrint; |
@@ -845,17 +845,17 @@ discard block |
||
| 845 | 845 | $ret .= '</select>'; |
| 846 | 846 | |
| 847 | 847 | if (empty($conf->dol_optimize_smallscreen)) { |
| 848 | - $ret .= ajax_combobox('.' . $name . 'select'); |
|
| 848 | + $ret .= ajax_combobox('.'.$name.'select'); |
|
| 849 | 849 | } |
| 850 | 850 | |
| 851 | 851 | // Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button |
| 852 | 852 | $ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER. |
| 853 | - $ret .= '<input type="submit" disabled name="confirmmassaction"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display: none"') . ' class="reposition button smallpaddingimp' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'confirmed" value="' . dol_escape_htmltag($langs->trans("Confirm")) . '">'; |
|
| 853 | + $ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="reposition button smallpaddingimp'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">'; |
|
| 854 | 854 | $ret .= '</div>'; |
| 855 | 855 | |
| 856 | 856 | if (!empty($conf->use_javascript_ajax)) { |
| 857 | 857 | $ret .= '<!-- JS CODE TO ENABLE mass action select --> |
| 858 | - <script nonce="' . getNonce() . '"> |
|
| 858 | + <script nonce="' . getNonce().'"> |
|
| 859 | 859 | function initCheckForSelect(mode, name, cssclass) /* mode is 0 during init of page or click all, 1 when we click on 1 checkboxi, "name" refers to the class of the massaction button, "cssclass" to the class of the checkfor select boxes */ |
| 860 | 860 | { |
| 861 | 861 | atleastoneselected=0; |
@@ -866,11 +866,11 @@ discard block |
||
| 866 | 866 | |
| 867 | 867 | console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected); |
| 868 | 868 | |
| 869 | - if (atleastoneselected || ' . $alwaysvisible . ') |
|
| 869 | + if (atleastoneselected || ' . $alwaysvisible.') |
|
| 870 | 870 | { |
| 871 | 871 | jQuery("."+name).show(); |
| 872 | - ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . ' |
|
| 873 | - ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . ' |
|
| 872 | + ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').' |
|
| 873 | + ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').' |
|
| 874 | 874 | } |
| 875 | 875 | else |
| 876 | 876 | { |
@@ -880,11 +880,11 @@ discard block |
||
| 880 | 880 | } |
| 881 | 881 | |
| 882 | 882 | jQuery(document).ready(function () { |
| 883 | - initCheckForSelect(0, "' . $name . '", "' . $cssclass . '"); |
|
| 884 | - jQuery(".' . $cssclass . '").click(function() { |
|
| 885 | - initCheckForSelect(1, "' . $name . '", "' . $cssclass . '"); |
|
| 883 | + initCheckForSelect(0, "' . $name.'", "'.$cssclass.'"); |
|
| 884 | + jQuery(".' . $cssclass.'").click(function() { |
|
| 885 | + initCheckForSelect(1, "' . $name.'", "'.$cssclass.'"); |
|
| 886 | 886 | }); |
| 887 | - jQuery(".' . $name . 'select").change(function() { |
|
| 887 | + jQuery(".' . $name.'select").change(function() { |
|
| 888 | 888 | var massaction = $( this ).val(); |
| 889 | 889 | var urlform = $( this ).closest("form").attr("action").replace("#show_files",""); |
| 890 | 890 | if (massaction == "builddoc") |
@@ -892,18 +892,18 @@ discard block |
||
| 892 | 892 | urlform = urlform + "#show_files"; |
| 893 | 893 | } |
| 894 | 894 | $( this ).closest("form").attr("action", urlform); |
| 895 | - console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform); |
|
| 895 | + console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform); |
|
| 896 | 896 | /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */ |
| 897 | 897 | if ($(this).val() != \'0\') |
| 898 | 898 | { |
| 899 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', false); |
|
| 900 | - jQuery(".' . $name . 'other").hide(); /* To disable if another div was open */ |
|
| 901 | - jQuery(".' . $name . '"+massaction).show(); |
|
| 899 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', false); |
|
| 900 | + jQuery(".' . $name.'other").hide(); /* To disable if another div was open */ |
|
| 901 | + jQuery(".' . $name.'"+massaction).show(); |
|
| 902 | 902 | } |
| 903 | 903 | else |
| 904 | 904 | { |
| 905 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', true); |
|
| 906 | - jQuery(".' . $name . 'other").hide(); /* To disable any div open */ |
|
| 905 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', true); |
|
| 906 | + jQuery(".' . $name.'other").hide(); /* To disable any div open */ |
|
| 907 | 907 | } |
| 908 | 908 | }); |
| 909 | 909 | }); |
@@ -946,14 +946,14 @@ discard block |
||
| 946 | 946 | $atleastonefavorite = 0; |
| 947 | 947 | |
| 948 | 948 | $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec"; |
| 949 | - $sql .= " FROM " . $this->db->prefix() . "c_country"; |
|
| 949 | + $sql .= " FROM ".$this->db->prefix()."c_country"; |
|
| 950 | 950 | $sql .= " WHERE active > 0"; |
| 951 | 951 | //$sql.= " ORDER BY code ASC"; |
| 952 | 952 | |
| 953 | - dol_syslog(get_class($this) . "::select_country", LOG_DEBUG); |
|
| 953 | + dol_syslog(get_class($this)."::select_country", LOG_DEBUG); |
|
| 954 | 954 | $resql = $this->db->query($sql); |
| 955 | 955 | if ($resql) { |
| 956 | - $out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
| 956 | + $out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>'; |
|
| 957 | 957 | $num = $this->db->num_rows($resql); |
| 958 | 958 | $i = 0; |
| 959 | 959 | if ($num) { |
@@ -963,7 +963,7 @@ discard block |
||
| 963 | 963 | $countryArray[$i]['rowid'] = $obj->rowid; |
| 964 | 964 | $countryArray[$i]['code_iso'] = $obj->code_iso; |
| 965 | 965 | $countryArray[$i]['code_iso3'] = $obj->code_iso3; |
| 966 | - $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); |
|
| 966 | + $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); |
|
| 967 | 967 | $countryArray[$i]['favorite'] = $obj->favorite; |
| 968 | 968 | $countryArray[$i]['eec'] = $obj->eec; |
| 969 | 969 | $favorite[$i] = $obj->favorite; |
@@ -981,20 +981,20 @@ discard block |
||
| 981 | 981 | |
| 982 | 982 | if ($showempty) { |
| 983 | 983 | if (is_numeric($showempty)) { |
| 984 | - $out .= '<option value=""> </option>' . "\n"; |
|
| 984 | + $out .= '<option value=""> </option>'."\n"; |
|
| 985 | 985 | } else { |
| 986 | - $out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n"; |
|
| 986 | + $out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n"; |
|
| 987 | 987 | } |
| 988 | 988 | } |
| 989 | 989 | |
| 990 | 990 | if ($addspecialentries) { // Add dedicated entries for groups of countries |
| 991 | 991 | //if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>'; |
| 992 | - $out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
| 993 | - $out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>'; |
|
| 992 | + $out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
| 993 | + $out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>'; |
|
| 994 | 994 | if ($mysoc->isInEEC()) { |
| 995 | - $out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
| 995 | + $out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
| 996 | 996 | } |
| 997 | - $out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>'; |
|
| 997 | + $out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>'; |
|
| 998 | 998 | $out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>'; |
| 999 | 999 | } |
| 1000 | 1000 | |
@@ -1022,20 +1022,20 @@ discard block |
||
| 1022 | 1022 | $labeltoshow .= ' '; |
| 1023 | 1023 | } |
| 1024 | 1024 | if ($row['code_iso']) { |
| 1025 | - $labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>'; |
|
| 1025 | + $labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>'; |
|
| 1026 | 1026 | if (empty($hideflags)) { |
| 1027 | 1027 | $tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1); |
| 1028 | - $labeltoshow = $tmpflag . ' ' . $labeltoshow; |
|
| 1028 | + $labeltoshow = $tmpflag.' '.$labeltoshow; |
|
| 1029 | 1029 | } |
| 1030 | 1030 | } |
| 1031 | 1031 | |
| 1032 | 1032 | if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) { |
| 1033 | - $out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">'; |
|
| 1033 | + $out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" selected data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">'; |
|
| 1034 | 1034 | } else { |
| 1035 | - $out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">'; |
|
| 1035 | + $out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">'; |
|
| 1036 | 1036 | } |
| 1037 | 1037 | $out .= $labeltoshow; |
| 1038 | - $out .= '</option>' . "\n"; |
|
| 1038 | + $out .= '</option>'."\n"; |
|
| 1039 | 1039 | } |
| 1040 | 1040 | } |
| 1041 | 1041 | $out .= '</select>'; |
@@ -1044,8 +1044,8 @@ discard block |
||
| 1044 | 1044 | } |
| 1045 | 1045 | |
| 1046 | 1046 | // Make select dynamic |
| 1047 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1048 | - $out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve'); |
|
| 1047 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1048 | + $out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve'); |
|
| 1049 | 1049 | |
| 1050 | 1050 | return $out; |
| 1051 | 1051 | } |
@@ -1077,25 +1077,25 @@ discard block |
||
| 1077 | 1077 | $incotermArray = array(); |
| 1078 | 1078 | |
| 1079 | 1079 | $sql = "SELECT rowid, code"; |
| 1080 | - $sql .= " FROM " . $this->db->prefix() . "c_incoterms"; |
|
| 1080 | + $sql .= " FROM ".$this->db->prefix()."c_incoterms"; |
|
| 1081 | 1081 | $sql .= " WHERE active > 0"; |
| 1082 | 1082 | $sql .= " ORDER BY code ASC"; |
| 1083 | 1083 | |
| 1084 | - dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG); |
|
| 1084 | + dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG); |
|
| 1085 | 1085 | $resql = $this->db->query($sql); |
| 1086 | 1086 | if ($resql) { |
| 1087 | 1087 | if ($conf->use_javascript_ajax && !$forcecombo) { |
| 1088 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1088 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1089 | 1089 | $out .= ajax_combobox($htmlname, $events); |
| 1090 | 1090 | } |
| 1091 | 1091 | |
| 1092 | 1092 | if (!empty($page)) { |
| 1093 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 1093 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 1094 | 1094 | $out .= '<input type="hidden" name="action" value="set_incoterms">'; |
| 1095 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1095 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1096 | 1096 | } |
| 1097 | 1097 | |
| 1098 | - $out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
| 1098 | + $out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>'; |
|
| 1099 | 1099 | $out .= '<option value="0"> </option>'; |
| 1100 | 1100 | $num = $this->db->num_rows($resql); |
| 1101 | 1101 | $i = 0; |
@@ -1109,9 +1109,9 @@ discard block |
||
| 1109 | 1109 | |
| 1110 | 1110 | foreach ($incotermArray as $row) { |
| 1111 | 1111 | if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) { |
| 1112 | - $out .= '<option value="' . $row['rowid'] . '" selected>'; |
|
| 1112 | + $out .= '<option value="'.$row['rowid'].'" selected>'; |
|
| 1113 | 1113 | } else { |
| 1114 | - $out .= '<option value="' . $row['rowid'] . '">'; |
|
| 1114 | + $out .= '<option value="'.$row['rowid'].'">'; |
|
| 1115 | 1115 | } |
| 1116 | 1116 | |
| 1117 | 1117 | if ($row['code']) { |
@@ -1124,13 +1124,13 @@ discard block |
||
| 1124 | 1124 | $out .= '</select>'; |
| 1125 | 1125 | |
| 1126 | 1126 | if ($conf->use_javascript_ajax && empty($disableautocomplete)) { |
| 1127 | - $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n"; |
|
| 1127 | + $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n"; |
|
| 1128 | 1128 | $moreattrib .= ' autocomplete="off"'; |
| 1129 | 1129 | } |
| 1130 | - $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n"; |
|
| 1130 | + $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n"; |
|
| 1131 | 1131 | |
| 1132 | 1132 | if (!empty($page)) { |
| 1133 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>'; |
|
| 1133 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>'; |
|
| 1134 | 1134 | } |
| 1135 | 1135 | } else { |
| 1136 | 1136 | dol_print_error($this->db); |
@@ -1161,9 +1161,9 @@ discard block |
||
| 1161 | 1161 | if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service")) |
| 1162 | 1162 | || (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) { |
| 1163 | 1163 | if (empty($hidetext)) { |
| 1164 | - print $langs->trans("Type") . ': '; |
|
| 1164 | + print $langs->trans("Type").': '; |
|
| 1165 | 1165 | } |
| 1166 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 1166 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 1167 | 1167 | if ($showempty) { |
| 1168 | 1168 | print '<option value="-1"'; |
| 1169 | 1169 | if ($selected == -1) { |
@@ -1176,28 +1176,28 @@ discard block |
||
| 1176 | 1176 | if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) { |
| 1177 | 1177 | print ' selected'; |
| 1178 | 1178 | } |
| 1179 | - print '>' . $langs->trans("Product"); |
|
| 1179 | + print '>'.$langs->trans("Product"); |
|
| 1180 | 1180 | |
| 1181 | 1181 | print '<option value="1"'; |
| 1182 | 1182 | if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) { |
| 1183 | 1183 | print ' selected'; |
| 1184 | 1184 | } |
| 1185 | - print '>' . $langs->trans("Service"); |
|
| 1185 | + print '>'.$langs->trans("Service"); |
|
| 1186 | 1186 | |
| 1187 | 1187 | print '</select>'; |
| 1188 | - print ajax_combobox('select_' . $htmlname); |
|
| 1188 | + print ajax_combobox('select_'.$htmlname); |
|
| 1189 | 1189 | //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); |
| 1190 | 1190 | } |
| 1191 | 1191 | if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) { |
| 1192 | 1192 | print $langs->trans("Service"); |
| 1193 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; |
|
| 1193 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; |
|
| 1194 | 1194 | } |
| 1195 | 1195 | if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) { |
| 1196 | 1196 | print $langs->trans("Product"); |
| 1197 | - print '<input type="hidden" name="' . $htmlname . '" value="0">'; |
|
| 1197 | + print '<input type="hidden" name="'.$htmlname.'" value="0">'; |
|
| 1198 | 1198 | } |
| 1199 | 1199 | if ($forceall < 0) { // This should happened only for contracts when both predefined product and service are disabled. |
| 1200 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1 |
|
| 1200 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1 |
|
| 1201 | 1201 | } |
| 1202 | 1202 | } |
| 1203 | 1203 | |
@@ -1223,7 +1223,7 @@ discard block |
||
| 1223 | 1223 | $langs->load("trips"); |
| 1224 | 1224 | |
| 1225 | 1225 | $sql = "SELECT c.code, c.label"; |
| 1226 | - $sql .= " FROM " . $this->db->prefix() . "c_type_fees as c"; |
|
| 1226 | + $sql .= " FROM ".$this->db->prefix()."c_type_fees as c"; |
|
| 1227 | 1227 | $sql .= " WHERE active > 0"; |
| 1228 | 1228 | |
| 1229 | 1229 | $resql = $this->db->query($sql); |
@@ -1264,11 +1264,11 @@ discard block |
||
| 1264 | 1264 | // phpcs:enable |
| 1265 | 1265 | global $user, $langs; |
| 1266 | 1266 | |
| 1267 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 1267 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 1268 | 1268 | |
| 1269 | 1269 | $this->load_cache_types_fees(); |
| 1270 | 1270 | |
| 1271 | - print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">'; |
|
| 1271 | + print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">'; |
|
| 1272 | 1272 | if ($showempty) { |
| 1273 | 1273 | print '<option value="-1"'; |
| 1274 | 1274 | if ($selected == -1) { |
@@ -1278,7 +1278,7 @@ discard block |
||
| 1278 | 1278 | } |
| 1279 | 1279 | |
| 1280 | 1280 | foreach ($this->cache_types_fees as $key => $value) { |
| 1281 | - print '<option value="' . $key . '"'; |
|
| 1281 | + print '<option value="'.$key.'"'; |
|
| 1282 | 1282 | if ($key == $selected) { |
| 1283 | 1283 | print ' selected'; |
| 1284 | 1284 | } |
@@ -1329,12 +1329,12 @@ discard block |
||
| 1329 | 1329 | $ajaxoptions = array(); |
| 1330 | 1330 | } |
| 1331 | 1331 | |
| 1332 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1332 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1333 | 1333 | |
| 1334 | 1334 | // No immediate load of all database |
| 1335 | 1335 | $placeholder = ''; |
| 1336 | 1336 | if ($selected && empty($selected_input_value)) { |
| 1337 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 1337 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 1338 | 1338 | $societetmp = new Societe($this->db); |
| 1339 | 1339 | $societetmp->fetch($selected); |
| 1340 | 1340 | $selected_input_value = $societetmp->name; |
@@ -1342,25 +1342,25 @@ discard block |
||
| 1342 | 1342 | } |
| 1343 | 1343 | |
| 1344 | 1344 | // mode 1 |
| 1345 | - $urloption = 'htmlname=' . urlencode(str_replace('.', '_', $htmlname)) . '&outjson=1&filter=' . urlencode($filter) . (empty($excludeids) ? '' : '&excludeids=' . join(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode($showtype) : '') . ($showcode ? '&showcode=' . urlencode($showcode) : ''); |
|
| 1345 | + $urloption = 'htmlname='.urlencode(str_replace('.', '_', $htmlname)).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '').($showcode ? '&showcode='.urlencode($showcode) : ''); |
|
| 1346 | 1346 | |
| 1347 | 1347 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 1348 | 1348 | if (empty($hidelabel)) { |
| 1349 | - print $langs->trans("RefOrLabel") . ' : '; |
|
| 1349 | + print $langs->trans("RefOrLabel").' : '; |
|
| 1350 | 1350 | } elseif ($hidelabel > 1) { |
| 1351 | 1351 | $placeholder = $langs->trans("RefOrLabel"); |
| 1352 | 1352 | if ($hidelabel == 2) { |
| 1353 | 1353 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 1354 | 1354 | } |
| 1355 | 1355 | } |
| 1356 | - $out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />'; |
|
| 1356 | + $out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; |
|
| 1357 | 1357 | if ($hidelabel == 3) { |
| 1358 | 1358 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 1359 | 1359 | } |
| 1360 | 1360 | |
| 1361 | 1361 | $out .= ajax_event($htmlname, $events); |
| 1362 | 1362 | |
| 1363 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
| 1363 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
| 1364 | 1364 | } else { |
| 1365 | 1365 | // Immediate load of all database |
| 1366 | 1366 | $out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids, $showcode); |
@@ -1444,30 +1444,30 @@ discard block |
||
| 1444 | 1444 | $sql .= ", s.address, s.zip, s.town"; |
| 1445 | 1445 | $sql .= ", dictp.code as country_code"; |
| 1446 | 1446 | } |
| 1447 | - $sql .= " FROM " . $this->db->prefix() . "societe as s"; |
|
| 1447 | + $sql .= " FROM ".$this->db->prefix()."societe as s"; |
|
| 1448 | 1448 | if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { |
| 1449 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 1449 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 1450 | 1450 | } |
| 1451 | 1451 | if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) { |
| 1452 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
| 1452 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
| 1453 | 1453 | } |
| 1454 | - $sql .= " WHERE s.entity IN (" . getEntity('societe') . ")"; |
|
| 1454 | + $sql .= " WHERE s.entity IN (".getEntity('societe').")"; |
|
| 1455 | 1455 | if (!empty($user->socid)) { |
| 1456 | - $sql .= " AND s.rowid = " . ((int) $user->socid); |
|
| 1456 | + $sql .= " AND s.rowid = ".((int) $user->socid); |
|
| 1457 | 1457 | } |
| 1458 | 1458 | if ($filter) { |
| 1459 | 1459 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
| 1460 | 1460 | // if not, by testSqlAndScriptInject() only. |
| 1461 | - $sql .= " AND (" . $filter . ")"; |
|
| 1461 | + $sql .= " AND (".$filter.")"; |
|
| 1462 | 1462 | } |
| 1463 | 1463 | if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) { |
| 1464 | - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
| 1464 | + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
| 1465 | 1465 | } |
| 1466 | 1466 | if (!empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) { |
| 1467 | 1467 | $sql .= " AND s.status <> 0"; |
| 1468 | 1468 | } |
| 1469 | 1469 | if (!empty($excludeids)) { |
| 1470 | - $sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(join(',', $excludeids)) . ")"; |
|
| 1470 | + $sql .= " AND s.rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")"; |
|
| 1471 | 1471 | } |
| 1472 | 1472 | // Add where from hooks |
| 1473 | 1473 | $parameters = array(); |
@@ -1487,17 +1487,17 @@ discard block |
||
| 1487 | 1487 | if ($i > 0) { |
| 1488 | 1488 | $sql .= " AND "; |
| 1489 | 1489 | } |
| 1490 | - $sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
| 1490 | + $sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
| 1491 | 1491 | $i++; |
| 1492 | 1492 | } |
| 1493 | 1493 | if (count($scrit) > 1) { |
| 1494 | 1494 | $sql .= ")"; |
| 1495 | 1495 | } |
| 1496 | 1496 | if (isModEnabled('barcode')) { |
| 1497 | - $sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1497 | + $sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1498 | 1498 | } |
| 1499 | - $sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1500 | - $sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1499 | + $sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1500 | + $sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1501 | 1501 | $sql .= ")"; |
| 1502 | 1502 | } |
| 1503 | 1503 | $sql .= $this->db->order("nom", "ASC"); |
@@ -1508,12 +1508,12 @@ discard block |
||
| 1508 | 1508 | $resql = $this->db->query($sql); |
| 1509 | 1509 | if ($resql) { |
| 1510 | 1510 | if (!$forcecombo) { |
| 1511 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1511 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1512 | 1512 | $out .= ajax_combobox($htmlname, $events, getDolGlobalString("COMPANY_USE_SEARCH_TO_SELECT")); |
| 1513 | 1513 | } |
| 1514 | 1514 | |
| 1515 | 1515 | // Construct $out and $outarray |
| 1516 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n"; |
|
| 1516 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n"; |
|
| 1517 | 1517 | |
| 1518 | 1518 | $textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : ''); |
| 1519 | 1519 | if (!empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { |
@@ -1526,7 +1526,7 @@ discard block |
||
| 1526 | 1526 | } |
| 1527 | 1527 | } |
| 1528 | 1528 | if ($showempty) { |
| 1529 | - $out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : ' ') . '</span>') . '">' . $textifempty . '</option>' . "\n"; |
|
| 1529 | + $out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : ' ').'</span>').'">'.$textifempty.'</option>'."\n"; |
|
| 1530 | 1530 | } |
| 1531 | 1531 | |
| 1532 | 1532 | $companytemp = new Societe($this->db); |
@@ -1539,18 +1539,18 @@ discard block |
||
| 1539 | 1539 | $label = ''; |
| 1540 | 1540 | if ($showcode || !empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { |
| 1541 | 1541 | if (($obj->client) && (!empty($obj->code_client))) { |
| 1542 | - $label = $obj->code_client . ' - '; |
|
| 1542 | + $label = $obj->code_client.' - '; |
|
| 1543 | 1543 | } |
| 1544 | 1544 | if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) { |
| 1545 | - $label .= $obj->code_fournisseur . ' - '; |
|
| 1545 | + $label .= $obj->code_fournisseur.' - '; |
|
| 1546 | 1546 | } |
| 1547 | - $label .= ' ' . $obj->name; |
|
| 1547 | + $label .= ' '.$obj->name; |
|
| 1548 | 1548 | } else { |
| 1549 | 1549 | $label = $obj->name; |
| 1550 | 1550 | } |
| 1551 | 1551 | |
| 1552 | 1552 | if (!empty($obj->name_alias)) { |
| 1553 | - $label .= ' (' . $obj->name_alias . ')'; |
|
| 1553 | + $label .= ' ('.$obj->name_alias.')'; |
|
| 1554 | 1554 | } |
| 1555 | 1555 | |
| 1556 | 1556 | if (!empty($conf->global->SOCIETE_SHOW_VAT_IN_LIST) && !empty($obj->tva_intra)) { |
@@ -1565,7 +1565,7 @@ discard block |
||
| 1565 | 1565 | $companytemp->fournisseur = $obj->fournisseur; |
| 1566 | 1566 | $tmptype = $companytemp->getTypeUrl(1, '', 0, 'span'); |
| 1567 | 1567 | if ($tmptype) { |
| 1568 | - $labelhtml .= ' ' . $tmptype; |
|
| 1568 | + $labelhtml .= ' '.$tmptype; |
|
| 1569 | 1569 | } |
| 1570 | 1570 | |
| 1571 | 1571 | if ($obj->client || $obj->fournisseur) { |
@@ -1575,10 +1575,10 @@ discard block |
||
| 1575 | 1575 | $label .= $langs->trans("Customer"); |
| 1576 | 1576 | } |
| 1577 | 1577 | if ($obj->client == 2 || $obj->client == 3) { |
| 1578 | - $label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect"); |
|
| 1578 | + $label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect"); |
|
| 1579 | 1579 | } |
| 1580 | 1580 | if ($obj->fournisseur) { |
| 1581 | - $label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier"); |
|
| 1581 | + $label .= ($obj->client ? ', ' : '').$langs->trans("Supplier"); |
|
| 1582 | 1582 | } |
| 1583 | 1583 | if ($obj->client || $obj->fournisseur) { |
| 1584 | 1584 | $label .= ')'; |
@@ -1586,9 +1586,9 @@ discard block |
||
| 1586 | 1586 | } |
| 1587 | 1587 | |
| 1588 | 1588 | if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { |
| 1589 | - $s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : ''); |
|
| 1589 | + $s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : ''); |
|
| 1590 | 1590 | if (!empty($obj->country_code)) { |
| 1591 | - $s .= ', ' . $langs->trans('Country' . $obj->country_code); |
|
| 1591 | + $s .= ', '.$langs->trans('Country'.$obj->country_code); |
|
| 1592 | 1592 | } |
| 1593 | 1593 | $label .= $s; |
| 1594 | 1594 | $labelhtml .= $s; |
@@ -1596,9 +1596,9 @@ discard block |
||
| 1596 | 1596 | |
| 1597 | 1597 | if (empty($outputmode)) { |
| 1598 | 1598 | if (in_array($obj->rowid, $selected)) { |
| 1599 | - $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>'; |
|
| 1599 | + $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>'; |
|
| 1600 | 1600 | } else { |
| 1601 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 1601 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 1602 | 1602 | } |
| 1603 | 1603 | } else { |
| 1604 | 1604 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml)); |
@@ -1610,7 +1610,7 @@ discard block |
||
| 1610 | 1610 | } |
| 1611 | 1611 | } |
| 1612 | 1612 | } |
| 1613 | - $out .= '</select>' . "\n"; |
|
| 1613 | + $out .= '</select>'."\n"; |
|
| 1614 | 1614 | } else { |
| 1615 | 1615 | dol_print_error($this->db); |
| 1616 | 1616 | } |
@@ -1644,18 +1644,18 @@ discard block |
||
| 1644 | 1644 | // On recherche les remises |
| 1645 | 1645 | $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; |
| 1646 | 1646 | $sql .= " re.description, re.fk_facture_source"; |
| 1647 | - $sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re"; |
|
| 1648 | - $sql .= " WHERE re.fk_soc = " . (int) $socid; |
|
| 1649 | - $sql .= " AND re.entity = " . $conf->entity; |
|
| 1647 | + $sql .= " FROM ".$this->db->prefix()."societe_remise_except as re"; |
|
| 1648 | + $sql .= " WHERE re.fk_soc = ".(int) $socid; |
|
| 1649 | + $sql .= " AND re.entity = ".$conf->entity; |
|
| 1650 | 1650 | if ($filter) { |
| 1651 | - $sql .= " AND " . $filter; |
|
| 1651 | + $sql .= " AND ".$filter; |
|
| 1652 | 1652 | } |
| 1653 | 1653 | $sql .= " ORDER BY re.description ASC"; |
| 1654 | 1654 | |
| 1655 | - dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG); |
|
| 1655 | + dol_syslog(get_class($this)."::select_remises", LOG_DEBUG); |
|
| 1656 | 1656 | $resql = $this->db->query($sql); |
| 1657 | 1657 | if ($resql) { |
| 1658 | - print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">'; |
|
| 1658 | + print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">'; |
|
| 1659 | 1659 | $num = $this->db->num_rows($resql); |
| 1660 | 1660 | |
| 1661 | 1661 | $qualifiedlines = $num; |
@@ -1693,16 +1693,16 @@ discard block |
||
| 1693 | 1693 | if (!empty($conf->global->MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST) && !empty($obj->fk_facture_source)) { |
| 1694 | 1694 | $tmpfac = new Facture($this->db); |
| 1695 | 1695 | if ($tmpfac->fetch($obj->fk_facture_source) > 0) { |
| 1696 | - $desc = $desc . ' - ' . $tmpfac->ref; |
|
| 1696 | + $desc = $desc.' - '.$tmpfac->ref; |
|
| 1697 | 1697 | } |
| 1698 | 1698 | } |
| 1699 | 1699 | |
| 1700 | - print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>'; |
|
| 1700 | + print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>'; |
|
| 1701 | 1701 | $i++; |
| 1702 | 1702 | } |
| 1703 | 1703 | } |
| 1704 | 1704 | print '</select>'; |
| 1705 | - print ajax_combobox('select_' . $htmlname); |
|
| 1705 | + print ajax_combobox('select_'.$htmlname); |
|
| 1706 | 1706 | |
| 1707 | 1707 | return $qualifiedlines; |
| 1708 | 1708 | } else { |
@@ -1783,7 +1783,7 @@ discard block |
||
| 1783 | 1783 | $out = ''; |
| 1784 | 1784 | |
| 1785 | 1785 | if (!is_object($hookmanager)) { |
| 1786 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
| 1786 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
| 1787 | 1787 | $hookmanager = new HookManager($this->db); |
| 1788 | 1788 | } |
| 1789 | 1789 | |
@@ -1792,13 +1792,13 @@ discard block |
||
| 1792 | 1792 | if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) { |
| 1793 | 1793 | $sql .= ", s.nom as company, s.town AS company_town"; |
| 1794 | 1794 | } |
| 1795 | - $sql .= " FROM " . $this->db->prefix() . "socpeople as sp"; |
|
| 1795 | + $sql .= " FROM ".$this->db->prefix()."socpeople as sp"; |
|
| 1796 | 1796 | if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) { |
| 1797 | - $sql .= " LEFT OUTER JOIN " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc"; |
|
| 1797 | + $sql .= " LEFT OUTER JOIN ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc"; |
|
| 1798 | 1798 | } |
| 1799 | - $sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")"; |
|
| 1799 | + $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
|
| 1800 | 1800 | if ($socid > 0 || $socid == -1) { |
| 1801 | - $sql .= " AND sp.fk_soc = " . ((int) $socid); |
|
| 1801 | + $sql .= " AND sp.fk_soc = ".((int) $socid); |
|
| 1802 | 1802 | } |
| 1803 | 1803 | if (!empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) { |
| 1804 | 1804 | $sql .= " AND sp.statut <> 0"; |
@@ -1809,30 +1809,30 @@ discard block |
||
| 1809 | 1809 | $sql .= $hookmanager->resPrint; |
| 1810 | 1810 | $sql .= " ORDER BY sp.lastname ASC"; |
| 1811 | 1811 | |
| 1812 | - dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG); |
|
| 1812 | + dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG); |
|
| 1813 | 1813 | $resql = $this->db->query($sql); |
| 1814 | 1814 | if ($resql) { |
| 1815 | 1815 | $num = $this->db->num_rows($resql); |
| 1816 | 1816 | |
| 1817 | 1817 | if ($htmlname != 'none' && !$options_only) { |
| 1818 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>'; |
|
| 1818 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>'; |
|
| 1819 | 1819 | } |
| 1820 | 1820 | |
| 1821 | 1821 | if ($showempty && !is_numeric($showempty)) { |
| 1822 | 1822 | $textforempty = $showempty; |
| 1823 | - $out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>'; |
|
| 1823 | + $out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>'; |
|
| 1824 | 1824 | } else { |
| 1825 | 1825 | if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) { |
| 1826 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '> </option>'; |
|
| 1826 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'> </option>'; |
|
| 1827 | 1827 | } |
| 1828 | 1828 | if ($showempty == 2) { |
| 1829 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>'; |
|
| 1829 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>'; |
|
| 1830 | 1830 | } |
| 1831 | 1831 | } |
| 1832 | 1832 | |
| 1833 | 1833 | $i = 0; |
| 1834 | 1834 | if ($num) { |
| 1835 | - include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 1835 | + include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 1836 | 1836 | $contactstatic = new Contact($this->db); |
| 1837 | 1837 | |
| 1838 | 1838 | while ($i < $num) { |
@@ -1868,7 +1868,7 @@ discard block |
||
| 1868 | 1868 | } |
| 1869 | 1869 | $extendedInfos = implode(' - ', $extendedInfos); |
| 1870 | 1870 | if (!empty($extendedInfos)) { |
| 1871 | - $extendedInfos = ' - ' . $extendedInfos; |
|
| 1871 | + $extendedInfos = ' - '.$extendedInfos; |
|
| 1872 | 1872 | } |
| 1873 | 1873 | } |
| 1874 | 1874 | |
@@ -1885,42 +1885,42 @@ discard block |
||
| 1885 | 1885 | $disabled = 1; |
| 1886 | 1886 | } |
| 1887 | 1887 | if (!empty($selected) && in_array($obj->rowid, $selected)) { |
| 1888 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 1888 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 1889 | 1889 | if ($disabled) { |
| 1890 | 1890 | $out .= ' disabled'; |
| 1891 | 1891 | } |
| 1892 | 1892 | $out .= ' selected>'; |
| 1893 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1893 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1894 | 1894 | if ($showfunction && $obj->poste) { |
| 1895 | - $out .= ' (' . $obj->poste . ')'; |
|
| 1895 | + $out .= ' ('.$obj->poste.')'; |
|
| 1896 | 1896 | } |
| 1897 | 1897 | if (($showsoc > 0) && $obj->company) { |
| 1898 | - $out .= ' - (' . $obj->company . ')'; |
|
| 1898 | + $out .= ' - ('.$obj->company.')'; |
|
| 1899 | 1899 | } |
| 1900 | 1900 | $out .= '</option>'; |
| 1901 | 1901 | } else { |
| 1902 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 1902 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 1903 | 1903 | if ($disabled) { |
| 1904 | 1904 | $out .= ' disabled'; |
| 1905 | 1905 | } |
| 1906 | 1906 | $out .= '>'; |
| 1907 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1907 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1908 | 1908 | if ($showfunction && $obj->poste) { |
| 1909 | - $out .= ' (' . $obj->poste . ')'; |
|
| 1909 | + $out .= ' ('.$obj->poste.')'; |
|
| 1910 | 1910 | } |
| 1911 | 1911 | if (($showsoc > 0) && $obj->company) { |
| 1912 | - $out .= ' - (' . $obj->company . ')'; |
|
| 1912 | + $out .= ' - ('.$obj->company.')'; |
|
| 1913 | 1913 | } |
| 1914 | 1914 | $out .= '</option>'; |
| 1915 | 1915 | } |
| 1916 | 1916 | } else { |
| 1917 | 1917 | if (in_array($obj->rowid, $selected)) { |
| 1918 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1918 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1919 | 1919 | if ($showfunction && $obj->poste) { |
| 1920 | - $out .= ' (' . $obj->poste . ')'; |
|
| 1920 | + $out .= ' ('.$obj->poste.')'; |
|
| 1921 | 1921 | } |
| 1922 | 1922 | if (($showsoc > 0) && $obj->company) { |
| 1923 | - $out .= ' - (' . $obj->company . ')'; |
|
| 1923 | + $out .= ' - ('.$obj->company.')'; |
|
| 1924 | 1924 | } |
| 1925 | 1925 | } |
| 1926 | 1926 | } |
@@ -1929,7 +1929,7 @@ discard block |
||
| 1929 | 1929 | } |
| 1930 | 1930 | } else { |
| 1931 | 1931 | $labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst'); |
| 1932 | - $out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">'; |
|
| 1932 | + $out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">'; |
|
| 1933 | 1933 | $out .= $labeltoshow; |
| 1934 | 1934 | $out .= '</option>'; |
| 1935 | 1935 | } |
@@ -1950,7 +1950,7 @@ discard block |
||
| 1950 | 1950 | } |
| 1951 | 1951 | |
| 1952 | 1952 | if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) { |
| 1953 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1953 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1954 | 1954 | $out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT")); |
| 1955 | 1955 | } |
| 1956 | 1956 | |
@@ -2055,11 +2055,11 @@ discard block |
||
| 2055 | 2055 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 2056 | 2056 | $sql .= ", e.label"; |
| 2057 | 2057 | } |
| 2058 | - $sql .= " FROM " . $this->db->prefix() . "user as u"; |
|
| 2058 | + $sql .= " FROM ".$this->db->prefix()."user as u"; |
|
| 2059 | 2059 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 2060 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity"; |
|
| 2060 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity"; |
|
| 2061 | 2061 | if (!empty($force_entity)) { |
| 2062 | - $sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")"; |
|
| 2062 | + $sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")"; |
|
| 2063 | 2063 | } else { |
| 2064 | 2064 | $sql .= " WHERE u.entity IS NOT NULL"; |
| 2065 | 2065 | } |
@@ -2067,23 +2067,23 @@ discard block |
||
| 2067 | 2067 | if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) { |
| 2068 | 2068 | $sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))"; |
| 2069 | 2069 | } else { |
| 2070 | - $sql .= " WHERE u.entity IN (" . getEntity('user') . ")"; |
|
| 2070 | + $sql .= " WHERE u.entity IN (".getEntity('user').")"; |
|
| 2071 | 2071 | } |
| 2072 | 2072 | } |
| 2073 | 2073 | if (!empty($user->socid)) { |
| 2074 | - $sql .= " AND u.fk_soc = " . ((int) $user->socid); |
|
| 2074 | + $sql .= " AND u.fk_soc = ".((int) $user->socid); |
|
| 2075 | 2075 | } |
| 2076 | 2076 | if (is_array($exclude) && $excludeUsers) { |
| 2077 | - $sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")"; |
|
| 2077 | + $sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")"; |
|
| 2078 | 2078 | } |
| 2079 | 2079 | if ($includeUsers) { |
| 2080 | - $sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")"; |
|
| 2080 | + $sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")"; |
|
| 2081 | 2081 | } |
| 2082 | 2082 | if (!empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX) || $notdisabled) { |
| 2083 | 2083 | $sql .= " AND u.statut <> 0"; |
| 2084 | 2084 | } |
| 2085 | 2085 | if (!empty($morefilter)) { |
| 2086 | - $sql .= " " . $morefilter; |
|
| 2086 | + $sql .= " ".$morefilter; |
|
| 2087 | 2087 | } |
| 2088 | 2088 | |
| 2089 | 2089 | //Add hook to filter on user (for exemple on usergroup define in custom modules) |
@@ -2098,7 +2098,7 @@ discard block |
||
| 2098 | 2098 | $sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC"; |
| 2099 | 2099 | } |
| 2100 | 2100 | |
| 2101 | - dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG); |
|
| 2101 | + dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); |
|
| 2102 | 2102 | |
| 2103 | 2103 | $resql = $this->db->query($sql); |
| 2104 | 2104 | if ($resql) { |
@@ -2106,7 +2106,7 @@ discard block |
||
| 2106 | 2106 | $i = 0; |
| 2107 | 2107 | if ($num) { |
| 2108 | 2108 | // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined |
| 2109 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
| 2109 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
| 2110 | 2110 | if ($show_empty && !$multiple) { |
| 2111 | 2111 | $textforempty = ' '; |
| 2112 | 2112 | if (!empty($conf->use_javascript_ajax)) { |
@@ -2115,10 +2115,10 @@ discard block |
||
| 2115 | 2115 | if (!is_numeric($show_empty)) { |
| 2116 | 2116 | $textforempty = $show_empty; |
| 2117 | 2117 | } |
| 2118 | - $out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 2118 | + $out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 2119 | 2119 | } |
| 2120 | 2120 | if ($show_every) { |
| 2121 | - $out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n"; |
|
| 2121 | + $out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n"; |
|
| 2122 | 2122 | } |
| 2123 | 2123 | |
| 2124 | 2124 | $userstatic = new User($this->db); |
@@ -2165,22 +2165,22 @@ discard block |
||
| 2165 | 2165 | } |
| 2166 | 2166 | if ($showstatus >= 0) { |
| 2167 | 2167 | if ($obj->status == 1 && $showstatus == 1) { |
| 2168 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled'); |
|
| 2169 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled'); |
|
| 2168 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); |
|
| 2169 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled'); |
|
| 2170 | 2170 | } |
| 2171 | 2171 | if ($obj->status == 0 && $showstatus == 1) { |
| 2172 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled'); |
|
| 2173 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled'); |
|
| 2172 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); |
|
| 2173 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled'); |
|
| 2174 | 2174 | } |
| 2175 | 2175 | } |
| 2176 | 2176 | if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && !empty($user->admin) && empty($user->entity)) { |
| 2177 | 2177 | if (empty($obj->entity)) { |
| 2178 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities"); |
|
| 2179 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities"); |
|
| 2178 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); |
|
| 2179 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities"); |
|
| 2180 | 2180 | } else { |
| 2181 | 2181 | if ($obj->entity != $conf->entity) { |
| 2182 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2183 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2182 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2183 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2184 | 2184 | } |
| 2185 | 2185 | } |
| 2186 | 2186 | } |
@@ -2188,13 +2188,13 @@ discard block |
||
| 2188 | 2188 | $moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : ''); |
| 2189 | 2189 | if (!empty($disableline) && $disableline != '1') { |
| 2190 | 2190 | // Add text from $enableonlytext parameter |
| 2191 | - $moreinfo .= ' - ' . $disableline; |
|
| 2192 | - $moreinfohtml .= ' - ' . $disableline; |
|
| 2191 | + $moreinfo .= ' - '.$disableline; |
|
| 2192 | + $moreinfohtml .= ' - '.$disableline; |
|
| 2193 | 2193 | } |
| 2194 | 2194 | $labeltoshow .= $moreinfo; |
| 2195 | 2195 | $labeltoshowhtml .= $moreinfohtml; |
| 2196 | 2196 | |
| 2197 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 2197 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 2198 | 2198 | if (!empty($disableline)) { |
| 2199 | 2199 | $out .= ' disabled'; |
| 2200 | 2200 | } |
@@ -2202,7 +2202,7 @@ discard block |
||
| 2202 | 2202 | $out .= ' selected'; |
| 2203 | 2203 | } |
| 2204 | 2204 | $out .= ' data-html="'; |
| 2205 | - $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' '; |
|
| 2205 | + $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; |
|
| 2206 | 2206 | if ($showstatus >= 0 && $obj->status == 0) { |
| 2207 | 2207 | $outhtml .= '<strike class="opacitymediumxxx">'; |
| 2208 | 2208 | } |
@@ -2215,7 +2215,7 @@ discard block |
||
| 2215 | 2215 | $out .= $labeltoshow; |
| 2216 | 2216 | $out .= '</option>'; |
| 2217 | 2217 | |
| 2218 | - $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo; |
|
| 2218 | + $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo; |
|
| 2219 | 2219 | $outarray2[$userstatic->id] = array( |
| 2220 | 2220 | 'id'=>$userstatic->id, |
| 2221 | 2221 | 'label'=>$labeltoshow, |
@@ -2227,14 +2227,14 @@ discard block |
||
| 2227 | 2227 | $i++; |
| 2228 | 2228 | } |
| 2229 | 2229 | } else { |
| 2230 | - $out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>'; |
|
| 2231 | - $out .= '<option value="">' . $langs->trans("None") . '</option>'; |
|
| 2230 | + $out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>'; |
|
| 2231 | + $out .= '<option value="">'.$langs->trans("None").'</option>'; |
|
| 2232 | 2232 | } |
| 2233 | 2233 | $out .= '</select>'; |
| 2234 | 2234 | |
| 2235 | 2235 | if ($num && !$forcecombo) { |
| 2236 | 2236 | // Enhance with select2 |
| 2237 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2237 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2238 | 2238 | $out .= ajax_combobox($htmlname); |
| 2239 | 2239 | } |
| 2240 | 2240 | } else { |
@@ -2304,16 +2304,16 @@ discard block |
||
| 2304 | 2304 | $out .= $userstatic->getNomUrl(-1); |
| 2305 | 2305 | if ($i == 0) { |
| 2306 | 2306 | $ownerid = $value['id']; |
| 2307 | - $out .= ' (' . $langs->trans("Owner") . ')'; |
|
| 2307 | + $out .= ' ('.$langs->trans("Owner").')'; |
|
| 2308 | 2308 | } |
| 2309 | 2309 | if ($nbassignetouser > 1 && $action != 'view') { |
| 2310 | - $out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $userstatic->id . '" class="removedassigned reposition" id="removedassigned_' . $userstatic->id . '" name="removedassigned_' . $userstatic->id . '">'; |
|
| 2310 | + $out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$userstatic->id.'" class="removedassigned reposition" id="removedassigned_'.$userstatic->id.'" name="removedassigned_'.$userstatic->id.'">'; |
|
| 2311 | 2311 | } |
| 2312 | 2312 | // Show my availability |
| 2313 | 2313 | if ($showproperties) { |
| 2314 | 2314 | if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) { |
| 2315 | 2315 | $out .= '<div class="myavailability inline-block">'; |
| 2316 | - $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">' . $langs->trans("Availability") . ':</span> </span><input id="transparency" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofuserid[$ownerid]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>'; |
|
| 2316 | + $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">'.$langs->trans("Availability").':</span> </span><input id="transparency" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofuserid[$ownerid]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>'; |
|
| 2317 | 2317 | $out .= '</div>'; |
| 2318 | 2318 | } |
| 2319 | 2319 | } |
@@ -2330,15 +2330,15 @@ discard block |
||
| 2330 | 2330 | // Method with no ajax |
| 2331 | 2331 | if ($action != 'view') { |
| 2332 | 2332 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">'; |
| 2333 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2333 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2334 | 2334 | $out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });'; |
| 2335 | 2335 | $out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());'; |
| 2336 | - $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }'; |
|
| 2337 | - $out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }'; |
|
| 2336 | + $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }'; |
|
| 2337 | + $out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }'; |
|
| 2338 | 2338 | $out .= '});'; |
| 2339 | 2339 | $out .= '})</script>'; |
| 2340 | 2340 | $out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
| 2341 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
| 2341 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
| 2342 | 2342 | $out .= '<br>'; |
| 2343 | 2343 | } |
| 2344 | 2344 | |
@@ -2393,13 +2393,13 @@ discard block |
||
| 2393 | 2393 | $resourcestatic->fetch($value['id']); |
| 2394 | 2394 | $out .= $resourcestatic->getNomUrl(-1); |
| 2395 | 2395 | if ($nbassignetoresource > 1 && $action != 'view') { |
| 2396 | - $out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $resourcestatic->id . '" class="removedassigned reposition" id="removedassignedresource_' . $resourcestatic->id . '" name="removedassignedresource_' . $resourcestatic->id . '">'; |
|
| 2396 | + $out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$resourcestatic->id.'" class="removedassigned reposition" id="removedassignedresource_'.$resourcestatic->id.'" name="removedassignedresource_'.$resourcestatic->id.'">'; |
|
| 2397 | 2397 | } |
| 2398 | 2398 | // Show my availability |
| 2399 | 2399 | if ($showproperties) { |
| 2400 | 2400 | if (is_array($listofresourceid) && count($listofresourceid)) { |
| 2401 | 2401 | $out .= '<div class="myavailability inline-block">'; |
| 2402 | - $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">' . $langs->trans("Availability") . ':</span> </span><input id="transparencyresource" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofresourceid[$value['id']]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>'; |
|
| 2402 | + $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">'.$langs->trans("Availability").':</span> </span><input id="transparencyresource" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofresourceid[$value['id']]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>'; |
|
| 2403 | 2403 | $out .= '</div>'; |
| 2404 | 2404 | } |
| 2405 | 2405 | } |
@@ -2416,11 +2416,11 @@ discard block |
||
| 2416 | 2416 | // Method with no ajax |
| 2417 | 2417 | if ($action != 'view') { |
| 2418 | 2418 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">'; |
| 2419 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2419 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2420 | 2420 | $out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });'; |
| 2421 | 2421 | $out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());'; |
| 2422 | - $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }'; |
|
| 2423 | - $out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }'; |
|
| 2422 | + $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }'; |
|
| 2423 | + $out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }'; |
|
| 2424 | 2424 | $out .= '});'; |
| 2425 | 2425 | $out .= '})</script>'; |
| 2426 | 2426 | |
@@ -2428,7 +2428,7 @@ discard block |
||
| 2428 | 2428 | $out .= img_picto('', 'resource', 'class="pictofixedwidth"'); |
| 2429 | 2429 | $out .= $formresources->select_resource_list('', $htmlname, '', 1, 1, 0, $events, '', 2, null); |
| 2430 | 2430 | //$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
| 2431 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
| 2431 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
| 2432 | 2432 | $out .= '<br>'; |
| 2433 | 2433 | } |
| 2434 | 2434 | |
@@ -2489,7 +2489,7 @@ discard block |
||
| 2489 | 2489 | $placeholder = ''; |
| 2490 | 2490 | |
| 2491 | 2491 | if ($selected && empty($selected_input_value)) { |
| 2492 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2492 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2493 | 2493 | $producttmpselect = new Product($this->db); |
| 2494 | 2494 | $producttmpselect->fetch($selected); |
| 2495 | 2495 | $selected_input_value = $producttmpselect->ref; |
@@ -2504,17 +2504,17 @@ discard block |
||
| 2504 | 2504 | } |
| 2505 | 2505 | } |
| 2506 | 2506 | // mode=1 means customers products |
| 2507 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=1&status=' . $status . '&status_purchase=' . $status_purchase . '&finished=' . $finished . '&hidepriceinlabel=' . $hidepriceinlabel . '&warehousestatus=' . $warehouseStatus; |
|
| 2508 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 2507 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&status_purchase='.$status_purchase.'&finished='.$finished.'&hidepriceinlabel='.$hidepriceinlabel.'&warehousestatus='.$warehouseStatus; |
|
| 2508 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 2509 | 2509 | |
| 2510 | 2510 | if (isModEnabled('variants') && is_array($selected_combinations)) { |
| 2511 | 2511 | // Code to automatically insert with javascript the select of attributes under the select of product |
| 2512 | 2512 | // when a parent of variant has been selected. |
| 2513 | 2513 | $out .= ' |
| 2514 | 2514 | <!-- script to auto show attributes select tags if a variant was selected --> |
| 2515 | - <script nonce="' . getNonce() . '"> |
|
| 2515 | + <script nonce="' . getNonce().'"> |
|
| 2516 | 2516 | // auto show attributes fields |
| 2517 | - selected = ' . json_encode($selected_combinations) . '; |
|
| 2517 | + selected = ' . json_encode($selected_combinations).'; |
|
| 2518 | 2518 | combvalues = {}; |
| 2519 | 2519 | |
| 2520 | 2520 | jQuery(document).ready(function () { |
@@ -2525,7 +2525,7 @@ discard block |
||
| 2525 | 2525 | } |
| 2526 | 2526 | }); |
| 2527 | 2527 | |
| 2528 | - jQuery("input#' . $htmlname . '").change(function () { |
|
| 2528 | + jQuery("input#' . $htmlname.'").change(function () { |
|
| 2529 | 2529 | |
| 2530 | 2530 | if (!jQuery(this).val()) { |
| 2531 | 2531 | jQuery(\'div#attributes_box\').empty(); |
@@ -2534,7 +2534,7 @@ discard block |
||
| 2534 | 2534 | |
| 2535 | 2535 | console.log("A change has started. We get variants fields to inject html select"); |
| 2536 | 2536 | |
| 2537 | - jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", { |
|
| 2537 | + jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", { |
|
| 2538 | 2538 | id: jQuery(this).val() |
| 2539 | 2539 | }, function (data) { |
| 2540 | 2540 | jQuery(\'div#attributes_box\').empty(); |
@@ -2577,21 +2577,21 @@ discard block |
||
| 2577 | 2577 | }) |
| 2578 | 2578 | }); |
| 2579 | 2579 | |
| 2580 | - ' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . ' |
|
| 2580 | + ' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').' |
|
| 2581 | 2581 | }); |
| 2582 | 2582 | </script> |
| 2583 | 2583 | '; |
| 2584 | 2584 | } |
| 2585 | 2585 | |
| 2586 | 2586 | if (empty($hidelabel)) { |
| 2587 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 2587 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 2588 | 2588 | } elseif ($hidelabel > 1) { |
| 2589 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 2589 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 2590 | 2590 | if ($hidelabel == 2) { |
| 2591 | 2591 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 2592 | 2592 | } |
| 2593 | 2593 | } |
| 2594 | - $out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />'; |
|
| 2594 | + $out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; |
|
| 2595 | 2595 | if ($hidelabel == 3) { |
| 2596 | 2596 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 2597 | 2597 | } |
@@ -2628,26 +2628,26 @@ discard block |
||
| 2628 | 2628 | // phpcs:enable |
| 2629 | 2629 | global $conf, $user, $langs, $db; |
| 2630 | 2630 | |
| 2631 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2631 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2632 | 2632 | |
| 2633 | 2633 | $error = 0; |
| 2634 | 2634 | $out = ''; |
| 2635 | 2635 | |
| 2636 | 2636 | if (!$forcecombo) { |
| 2637 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2637 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2638 | 2638 | $events = array(); |
| 2639 | 2639 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
| 2640 | 2640 | } |
| 2641 | 2641 | |
| 2642 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 2642 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 2643 | 2643 | |
| 2644 | 2644 | $sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product'; |
| 2645 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b'; |
|
| 2646 | - $sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')'; |
|
| 2647 | - if (!empty($status)) $sql .= ' AND status = ' . (int) $status; |
|
| 2648 | - if (!empty($type)) $sql .= ' AND bomtype = ' . (int) $type; |
|
| 2649 | - if (!empty($TProducts)) $sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')'; |
|
| 2650 | - if (!empty($limit)) $sql .= ' LIMIT ' . (int) $limit; |
|
| 2645 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b'; |
|
| 2646 | + $sql .= ' WHERE b.entity IN ('.getEntity('bom').')'; |
|
| 2647 | + if (!empty($status)) $sql .= ' AND status = '.(int) $status; |
|
| 2648 | + if (!empty($type)) $sql .= ' AND bomtype = '.(int) $type; |
|
| 2649 | + if (!empty($TProducts)) $sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')'; |
|
| 2650 | + if (!empty($limit)) $sql .= ' LIMIT '.(int) $limit; |
|
| 2651 | 2651 | $resql = $db->query($sql); |
| 2652 | 2652 | if ($resql) { |
| 2653 | 2653 | if ($showempty) { |
@@ -2658,9 +2658,9 @@ discard block |
||
| 2658 | 2658 | while ($obj = $db->fetch_object($resql)) { |
| 2659 | 2659 | $product = new Product($db); |
| 2660 | 2660 | $res = $product->fetch($obj->fk_product); |
| 2661 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 2661 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 2662 | 2662 | if ($obj->rowid == $selected) $out .= 'selected'; |
| 2663 | - $out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>'; |
|
| 2663 | + $out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>'; |
|
| 2664 | 2664 | } |
| 2665 | 2665 | } else { |
| 2666 | 2666 | $error++; |
@@ -2717,7 +2717,7 @@ discard block |
||
| 2717 | 2717 | |
| 2718 | 2718 | $warehouseStatusArray = array(); |
| 2719 | 2719 | if (!empty($warehouseStatus)) { |
| 2720 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
| 2720 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
| 2721 | 2721 | if (preg_match('/warehouseclosed/', $warehouseStatus)) { |
| 2722 | 2722 | $warehouseStatusArray[] = Entrepot::STATUS_CLOSED; |
| 2723 | 2723 | } |
@@ -2731,9 +2731,9 @@ discard block |
||
| 2731 | 2731 | |
| 2732 | 2732 | $selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_country, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.default_vat_code, p.duration, p.fk_price_expression"; |
| 2733 | 2733 | if (count($warehouseStatusArray)) { |
| 2734 | - $selectFieldsGrouped = ", sum(" . $this->db->ifsql("e.statut IS NULL", "0", "ps.reel") . ") as stock"; // e.statut is null if there is no record in stock |
|
| 2734 | + $selectFieldsGrouped = ", sum(".$this->db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock |
|
| 2735 | 2735 | } else { |
| 2736 | - $selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock"; |
|
| 2736 | + $selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock"; |
|
| 2737 | 2737 | } |
| 2738 | 2738 | |
| 2739 | 2739 | $sql = "SELECT "; |
@@ -2749,9 +2749,9 @@ discard block |
||
| 2749 | 2749 | |
| 2750 | 2750 | if (!empty($conf->global->PRODUCT_SORT_BY_CATEGORY)) { |
| 2751 | 2751 | //Product category |
| 2752 | - $sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie |
|
| 2753 | - FROM " . $this->db->prefix() . "categorie_product |
|
| 2754 | - WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid |
|
| 2752 | + $sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie |
|
| 2753 | + FROM " . $this->db->prefix()."categorie_product |
|
| 2754 | + WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid |
|
| 2755 | 2755 | LIMIT 1 |
| 2756 | 2756 | ) AS categorie_product_id "; |
| 2757 | 2757 | } |
@@ -2777,15 +2777,15 @@ discard block |
||
| 2777 | 2777 | } |
| 2778 | 2778 | // Price by quantity |
| 2779 | 2779 | if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { |
| 2780 | - $sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; |
|
| 2780 | + $sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; |
|
| 2781 | 2781 | if ($price_level >= 1 && !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { |
| 2782 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 2782 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 2783 | 2783 | } |
| 2784 | 2784 | $sql .= " ORDER BY date_price"; |
| 2785 | 2785 | $sql .= " DESC LIMIT 1) as price_rowid"; |
| 2786 | - $sql .= ", (SELECT pp.price_by_qty FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable |
|
| 2786 | + $sql .= ", (SELECT pp.price_by_qty FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable |
|
| 2787 | 2787 | if ($price_level >= 1 && !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { |
| 2788 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 2788 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 2789 | 2789 | } |
| 2790 | 2790 | $sql .= " ORDER BY date_price"; |
| 2791 | 2791 | $sql .= " DESC LIMIT 1) as price_by_qty"; |
@@ -2799,67 +2799,67 @@ discard block |
||
| 2799 | 2799 | $sql .= $hookmanager->resPrint; |
| 2800 | 2800 | |
| 2801 | 2801 | if (count($warehouseStatusArray)) { |
| 2802 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid"; |
|
| 2803 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")"; |
|
| 2804 | - $sql .= ' AND e.statut IN (' . $this->db->sanitize($this->db->escape(implode(',', $warehouseStatusArray))) . ')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0. |
|
| 2802 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid"; |
|
| 2803 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")"; |
|
| 2804 | + $sql .= ' AND e.statut IN ('.$this->db->sanitize($this->db->escape(implode(',', $warehouseStatusArray))).')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0. |
|
| 2805 | 2805 | } |
| 2806 | 2806 | |
| 2807 | 2807 | // include search in supplier ref |
| 2808 | 2808 | if (!empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF)) { |
| 2809 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 2809 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 2810 | 2810 | } |
| 2811 | 2811 | |
| 2812 | 2812 | //Price by customer |
| 2813 | 2813 | if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { |
| 2814 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid"; |
|
| 2814 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid"; |
|
| 2815 | 2815 | } |
| 2816 | 2816 | // Units |
| 2817 | 2817 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 2818 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
| 2818 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
| 2819 | 2819 | } |
| 2820 | 2820 | // Multilang : we add translation |
| 2821 | 2821 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 2822 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid "; |
|
| 2822 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid "; |
|
| 2823 | 2823 | if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && !empty($socid)) { |
| 2824 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 2824 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 2825 | 2825 | $soc = new Societe($this->db); |
| 2826 | 2826 | $result = $soc->fetch($socid); |
| 2827 | 2827 | if ($result > 0 && !empty($soc->default_lang)) { |
| 2828 | - $sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'"; |
|
| 2828 | + $sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'"; |
|
| 2829 | 2829 | } else { |
| 2830 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
| 2830 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
| 2831 | 2831 | } |
| 2832 | 2832 | } else { |
| 2833 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
| 2833 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
| 2834 | 2834 | } |
| 2835 | 2835 | } |
| 2836 | 2836 | |
| 2837 | 2837 | if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) { |
| 2838 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
| 2838 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
| 2839 | 2839 | } |
| 2840 | 2840 | |
| 2841 | - $sql .= ' WHERE p.entity IN (' . getEntity('product') . ')'; |
|
| 2841 | + $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; |
|
| 2842 | 2842 | |
| 2843 | 2843 | if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) { |
| 2844 | 2844 | $sql .= " AND pac.rowid IS NULL"; |
| 2845 | 2845 | } |
| 2846 | 2846 | |
| 2847 | 2847 | if ($finished == 0) { |
| 2848 | - $sql .= " AND p.finished = " . ((int) $finished); |
|
| 2848 | + $sql .= " AND p.finished = ".((int) $finished); |
|
| 2849 | 2849 | } elseif ($finished == 1) { |
| 2850 | - $sql .= " AND p.finished = " . ((int) $finished); |
|
| 2850 | + $sql .= " AND p.finished = ".((int) $finished); |
|
| 2851 | 2851 | if ($status >= 0) { |
| 2852 | - $sql .= " AND p.tosell = " . ((int) $status); |
|
| 2852 | + $sql .= " AND p.tosell = ".((int) $status); |
|
| 2853 | 2853 | } |
| 2854 | 2854 | } elseif ($status >= 0) { |
| 2855 | - $sql .= " AND p.tosell = " . ((int) $status); |
|
| 2855 | + $sql .= " AND p.tosell = ".((int) $status); |
|
| 2856 | 2856 | } |
| 2857 | 2857 | if ($status_purchase >= 0) { |
| 2858 | - $sql .= " AND p.tobuy = " . ((int) $status_purchase); |
|
| 2858 | + $sql .= " AND p.tobuy = ".((int) $status_purchase); |
|
| 2859 | 2859 | } |
| 2860 | 2860 | // Filter by product type |
| 2861 | 2861 | if (strval($filtertype) != '') { |
| 2862 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
| 2862 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
| 2863 | 2863 | } elseif (!isModEnabled('product')) { // when product module is disabled, show services only |
| 2864 | 2864 | $sql .= " AND p.fk_product_type = 1"; |
| 2865 | 2865 | } elseif (!isModEnabled('service')) { // when service module is disabled, show products only |
@@ -2883,21 +2883,21 @@ discard block |
||
| 2883 | 2883 | if ($i > 0) { |
| 2884 | 2884 | $sql .= " AND "; |
| 2885 | 2885 | } |
| 2886 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2886 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2887 | 2887 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 2888 | - $sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2888 | + $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2889 | 2889 | } |
| 2890 | 2890 | if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { |
| 2891 | - $sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2891 | + $sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2892 | 2892 | } |
| 2893 | 2893 | if (!empty($conf->global->PRODUCT_AJAX_SEARCH_ON_DESCRIPTION)) { |
| 2894 | - $sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2894 | + $sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2895 | 2895 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 2896 | - $sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2896 | + $sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2897 | 2897 | } |
| 2898 | 2898 | } |
| 2899 | 2899 | if (!empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF)) { |
| 2900 | - $sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2900 | + $sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2901 | 2901 | } |
| 2902 | 2902 | $sql .= ")"; |
| 2903 | 2903 | $i++; |
@@ -2906,12 +2906,12 @@ discard block |
||
| 2906 | 2906 | $sql .= ")"; |
| 2907 | 2907 | } |
| 2908 | 2908 | if (isModEnabled('barcode')) { |
| 2909 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 2909 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 2910 | 2910 | } |
| 2911 | 2911 | $sql .= ')'; |
| 2912 | 2912 | } |
| 2913 | 2913 | if (count($warehouseStatusArray)) { |
| 2914 | - $sql .= " GROUP BY " . $selectFields; |
|
| 2914 | + $sql .= " GROUP BY ".$selectFields; |
|
| 2915 | 2915 | } |
| 2916 | 2916 | |
| 2917 | 2917 | //Sort by category |
@@ -2926,23 +2926,23 @@ discard block |
||
| 2926 | 2926 | $sql .= $this->db->plimit($limit, 0); |
| 2927 | 2927 | |
| 2928 | 2928 | // Build output string |
| 2929 | - dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG); |
|
| 2929 | + dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG); |
|
| 2930 | 2930 | $result = $this->db->query($sql); |
| 2931 | 2931 | if ($result) { |
| 2932 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2933 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 2934 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 2932 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2933 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 2934 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 2935 | 2935 | |
| 2936 | 2936 | $num = $this->db->num_rows($result); |
| 2937 | 2937 | |
| 2938 | 2938 | $events = null; |
| 2939 | 2939 | |
| 2940 | 2940 | if (!$forcecombo) { |
| 2941 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2941 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2942 | 2942 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
| 2943 | 2943 | } |
| 2944 | 2944 | |
| 2945 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 2945 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 2946 | 2946 | |
| 2947 | 2947 | $textifempty = ''; |
| 2948 | 2948 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -2959,7 +2959,7 @@ discard block |
||
| 2959 | 2959 | } |
| 2960 | 2960 | } |
| 2961 | 2961 | if ($showempty) { |
| 2962 | - $out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : ' ') . '</option>'; |
|
| 2962 | + $out .= '<option value="-1" selected>'.($textifempty ? $textifempty : ' ').'</option>'; |
|
| 2963 | 2963 | } |
| 2964 | 2964 | |
| 2965 | 2965 | $i = 0; |
@@ -2970,11 +2970,11 @@ discard block |
||
| 2970 | 2970 | |
| 2971 | 2971 | if ((!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && !empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product |
| 2972 | 2972 | $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type"; |
| 2973 | - $sql .= " FROM " . $this->db->prefix() . "product_price_by_qty"; |
|
| 2974 | - $sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid); |
|
| 2973 | + $sql .= " FROM ".$this->db->prefix()."product_price_by_qty"; |
|
| 2974 | + $sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid); |
|
| 2975 | 2975 | $sql .= " ORDER BY quantity ASC"; |
| 2976 | 2976 | |
| 2977 | - dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG); |
|
| 2977 | + dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG); |
|
| 2978 | 2978 | $result2 = $this->db->query($sql); |
| 2979 | 2979 | if ($result2) { |
| 2980 | 2980 | $nb_prices = $this->db->num_rows($result2); |
@@ -3012,7 +3012,7 @@ discard block |
||
| 3012 | 3012 | $price_product = new Product($this->db); |
| 3013 | 3013 | $price_product->fetch($objp->rowid, '', '', 1); |
| 3014 | 3014 | |
| 3015 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3015 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3016 | 3016 | $priceparser = new PriceParser($this->db); |
| 3017 | 3017 | $price_result = $priceparser->parseProduct($price_product); |
| 3018 | 3018 | if ($price_result >= 0) { |
@@ -3096,7 +3096,7 @@ discard block |
||
| 3096 | 3096 | $label = $objp->label_translated; |
| 3097 | 3097 | } |
| 3098 | 3098 | if (!empty($filterkey) && $filterkey != '') { |
| 3099 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
| 3099 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
| 3100 | 3100 | } |
| 3101 | 3101 | |
| 3102 | 3102 | $outkey = $objp->rowid; |
@@ -3117,32 +3117,32 @@ discard block |
||
| 3117 | 3117 | $outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : ''; |
| 3118 | 3118 | |
| 3119 | 3119 | if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) { |
| 3120 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 3120 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 3121 | 3121 | } |
| 3122 | 3122 | |
| 3123 | 3123 | // Units |
| 3124 | 3124 | $outvalUnits = ''; |
| 3125 | 3125 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3126 | 3126 | if (!empty($objp->unit_short)) { |
| 3127 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
| 3127 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
| 3128 | 3128 | } |
| 3129 | 3129 | } |
| 3130 | 3130 | if (!empty($conf->global->PRODUCT_SHOW_DIMENSIONS_IN_COMBO)) { |
| 3131 | 3131 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
| 3132 | 3132 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
| 3133 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3133 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3134 | 3134 | } |
| 3135 | 3135 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
| 3136 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
| 3137 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3136 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
| 3137 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3138 | 3138 | } |
| 3139 | 3139 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
| 3140 | 3140 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
| 3141 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3141 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3142 | 3142 | } |
| 3143 | 3143 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
| 3144 | 3144 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
| 3145 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3145 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3146 | 3146 | } |
| 3147 | 3147 | } |
| 3148 | 3148 | if ($outdurationvalue && $outdurationunit) { |
@@ -3154,14 +3154,14 @@ discard block |
||
| 3154 | 3154 | 'y' => $langs->trans('Year') |
| 3155 | 3155 | ); |
| 3156 | 3156 | if (isset($da[$outdurationunit])) { |
| 3157 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
| 3157 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
| 3158 | 3158 | } |
| 3159 | 3159 | } |
| 3160 | 3160 | |
| 3161 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 3161 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 3162 | 3162 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 3163 | 3163 | if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) { |
| 3164 | - $opt .= ' pbq="' . $objp->price_by_qty_rowid . '" data-pbq="' . $objp->price_by_qty_rowid . '" data-pbqup="' . $objp->price_by_qty_unitprice . '" data-pbqbase="' . $objp->price_by_qty_price_base_type . '" data-pbqqty="' . $objp->price_by_qty_quantity . '" data-pbqpercent="' . $objp->price_by_qty_remise_percent . '"'; |
|
| 3164 | + $opt .= ' pbq="'.$objp->price_by_qty_rowid.'" data-pbq="'.$objp->price_by_qty_rowid.'" data-pbqup="'.$objp->price_by_qty_unitprice.'" data-pbqbase="'.$objp->price_by_qty_price_base_type.'" data-pbqqty="'.$objp->price_by_qty_quantity.'" data-pbqpercent="'.$objp->price_by_qty_remise_percent.'"'; |
|
| 3165 | 3165 | } |
| 3166 | 3166 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { |
| 3167 | 3167 | if ($user->hasRight('stock', 'lire')) { |
@@ -3173,36 +3173,36 @@ discard block |
||
| 3173 | 3173 | } |
| 3174 | 3174 | } |
| 3175 | 3175 | if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { |
| 3176 | - $opt .= ' data-labeltrans="' . $outlabel_translated . '"'; |
|
| 3177 | - $opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"'; |
|
| 3176 | + $opt .= ' data-labeltrans="'.$outlabel_translated.'"'; |
|
| 3177 | + $opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"'; |
|
| 3178 | 3178 | } |
| 3179 | 3179 | $opt .= '>'; |
| 3180 | 3180 | $opt .= $objp->ref; |
| 3181 | 3181 | if (!empty($objp->custref)) { |
| 3182 | - $opt .= ' (' . $objp->custref . ')'; |
|
| 3182 | + $opt .= ' ('.$objp->custref.')'; |
|
| 3183 | 3183 | } |
| 3184 | 3184 | if ($outbarcode) { |
| 3185 | - $opt .= ' (' . $outbarcode . ')'; |
|
| 3185 | + $opt .= ' ('.$outbarcode.')'; |
|
| 3186 | 3186 | } |
| 3187 | - $opt .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3187 | + $opt .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3188 | 3188 | if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) { |
| 3189 | - $opt .= ' (' . getCountry($outorigin, 1) . ')'; |
|
| 3189 | + $opt .= ' ('.getCountry($outorigin, 1).')'; |
|
| 3190 | 3190 | } |
| 3191 | 3191 | |
| 3192 | 3192 | $objRef = $objp->ref; |
| 3193 | 3193 | if (!empty($objp->custref)) { |
| 3194 | - $objRef .= ' (' . $objp->custref . ')'; |
|
| 3194 | + $objRef .= ' ('.$objp->custref.')'; |
|
| 3195 | 3195 | } |
| 3196 | 3196 | if (!empty($filterkey) && $filterkey != '') { |
| 3197 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3197 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3198 | 3198 | } |
| 3199 | 3199 | $outval .= $objRef; |
| 3200 | 3200 | if ($outbarcode) { |
| 3201 | - $outval .= ' (' . $outbarcode . ')'; |
|
| 3201 | + $outval .= ' ('.$outbarcode.')'; |
|
| 3202 | 3202 | } |
| 3203 | - $outval .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3203 | + $outval .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3204 | 3204 | if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) { |
| 3205 | - $outval .= ' (' . getCountry($outorigin, 1) . ')'; |
|
| 3205 | + $outval .= ' ('.getCountry($outorigin, 1).')'; |
|
| 3206 | 3206 | } |
| 3207 | 3207 | |
| 3208 | 3208 | // Units |
@@ -3215,35 +3215,35 @@ discard block |
||
| 3215 | 3215 | // If we need a particular price level (from 1 to n) |
| 3216 | 3216 | if (empty($hidepriceinlabel) && $price_level >= 1 && (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { |
| 3217 | 3217 | $sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code"; |
| 3218 | - $sql .= " FROM " . $this->db->prefix() . "product_price"; |
|
| 3219 | - $sql .= " WHERE fk_product = " . ((int) $objp->rowid); |
|
| 3220 | - $sql .= " AND entity IN (" . getEntity('productprice') . ")"; |
|
| 3221 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 3218 | + $sql .= " FROM ".$this->db->prefix()."product_price"; |
|
| 3219 | + $sql .= " WHERE fk_product = ".((int) $objp->rowid); |
|
| 3220 | + $sql .= " AND entity IN (".getEntity('productprice').")"; |
|
| 3221 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 3222 | 3222 | $sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid. |
| 3223 | 3223 | $sql .= " LIMIT 1"; |
| 3224 | 3224 | |
| 3225 | - dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG); |
|
| 3225 | + dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG); |
|
| 3226 | 3226 | $result2 = $this->db->query($sql); |
| 3227 | 3227 | if ($result2) { |
| 3228 | 3228 | $objp2 = $this->db->fetch_object($result2); |
| 3229 | 3229 | if ($objp2) { |
| 3230 | 3230 | $found = 1; |
| 3231 | 3231 | if ($objp2->price_base_type == 'HT') { |
| 3232 | - $opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3233 | - $outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3232 | + $opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3233 | + $outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3234 | 3234 | } else { |
| 3235 | - $opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3236 | - $outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3235 | + $opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3236 | + $outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3237 | 3237 | } |
| 3238 | 3238 | $outprice_ht = price($objp2->price); |
| 3239 | 3239 | $outprice_ttc = price($objp2->price_ttc); |
| 3240 | 3240 | $outpricebasetype = $objp2->price_base_type; |
| 3241 | 3241 | if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) { // using this option is a bug. kept for backward compatibility |
| 3242 | - $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
| 3243 | - $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
| 3242 | + $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
| 3243 | + $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
| 3244 | 3244 | } else { |
| 3245 | - $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
| 3246 | - $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
| 3245 | + $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
| 3246 | + $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
| 3247 | 3247 | } |
| 3248 | 3248 | } |
| 3249 | 3249 | } else { |
@@ -3257,13 +3257,13 @@ discard block |
||
| 3257 | 3257 | $outqty = $objp->quantity; |
| 3258 | 3258 | $outdiscount = $objp->remise_percent; |
| 3259 | 3259 | if ($objp->quantity == 1) { |
| 3260 | - $opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3261 | - $outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3260 | + $opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3261 | + $outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3262 | 3262 | $opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
| 3263 | 3263 | $outval .= $langs->transnoentities("Unit"); |
| 3264 | 3264 | } else { |
| 3265 | - $opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3266 | - $outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3265 | + $opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3266 | + $outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3267 | 3267 | $opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
| 3268 | 3268 | $outval .= $langs->transnoentities("Units"); |
| 3269 | 3269 | } |
@@ -3271,16 +3271,16 @@ discard block |
||
| 3271 | 3271 | $outprice_ht = price($objp->unitprice); |
| 3272 | 3272 | $outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100))); |
| 3273 | 3273 | $outpricebasetype = $objp->price_base_type; |
| 3274 | - $outtva_tx = $objp->tva_tx; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
| 3275 | - $outdefault_vat_code = $objp->default_vat_code; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
| 3274 | + $outtva_tx = $objp->tva_tx; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
| 3275 | + $outdefault_vat_code = $objp->default_vat_code; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
| 3276 | 3276 | } |
| 3277 | 3277 | if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) { |
| 3278 | - $opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3279 | - $outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3278 | + $opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3279 | + $outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3280 | 3280 | } |
| 3281 | 3281 | if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) { |
| 3282 | - $opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3283 | - $outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3282 | + $opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3283 | + $outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3284 | 3284 | } |
| 3285 | 3285 | |
| 3286 | 3286 | // Price by customer |
@@ -3289,11 +3289,11 @@ discard block |
||
| 3289 | 3289 | $found = 1; |
| 3290 | 3290 | |
| 3291 | 3291 | if ($objp->custprice_base_type == 'HT') { |
| 3292 | - $opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3293 | - $outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3292 | + $opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3293 | + $outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3294 | 3294 | } else { |
| 3295 | - $opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3296 | - $outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3295 | + $opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3296 | + $outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3297 | 3297 | } |
| 3298 | 3298 | |
| 3299 | 3299 | $outprice_ht = price($objp->custprice); |
@@ -3307,11 +3307,11 @@ discard block |
||
| 3307 | 3307 | // If level no defined or multiprice not found, we used the default price |
| 3308 | 3308 | if (empty($hidepriceinlabel) && !$found) { |
| 3309 | 3309 | if ($objp->price_base_type == 'HT') { |
| 3310 | - $opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3311 | - $outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3310 | + $opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3311 | + $outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3312 | 3312 | } else { |
| 3313 | - $opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3314 | - $outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3313 | + $opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3314 | + $outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3315 | 3315 | } |
| 3316 | 3316 | $outprice_ht = price($objp->price); |
| 3317 | 3317 | $outprice_ttc = price($objp->price_ttc); |
@@ -3322,14 +3322,14 @@ discard block |
||
| 3322 | 3322 | |
| 3323 | 3323 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { |
| 3324 | 3324 | if ($user->hasRight('stock', 'lire')) { |
| 3325 | - $opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
| 3325 | + $opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
| 3326 | 3326 | |
| 3327 | 3327 | if ($objp->stock > 0) { |
| 3328 | 3328 | $outval .= ' - <span class="product_line_stock_ok">'; |
| 3329 | 3329 | } elseif ($objp->stock <= 0) { |
| 3330 | 3330 | $outval .= ' - <span class="product_line_stock_too_low">'; |
| 3331 | 3331 | } |
| 3332 | - $outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
| 3332 | + $outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
| 3333 | 3333 | $outval .= '</span>'; |
| 3334 | 3334 | if (empty($novirtualstock) && !empty($conf->global->STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO)) { // Warning, this option may slow down combo list generation |
| 3335 | 3335 | $langs->load("stocks"); |
@@ -3339,9 +3339,9 @@ discard block |
||
| 3339 | 3339 | $tmpproduct->load_virtual_stock(); |
| 3340 | 3340 | $virtualstock = $tmpproduct->stock_theorique; |
| 3341 | 3341 | |
| 3342 | - $opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
| 3342 | + $opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
| 3343 | 3343 | |
| 3344 | - $outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
| 3344 | + $outval .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
| 3345 | 3345 | if ($virtualstock > 0) { |
| 3346 | 3346 | $outval .= '<span class="product_line_stock_ok">'; |
| 3347 | 3347 | } elseif ($virtualstock <= 0) { |
@@ -3419,7 +3419,7 @@ discard block |
||
| 3419 | 3419 | $selected_input_value = ''; |
| 3420 | 3420 | if (!empty($conf->use_javascript_ajax) && !empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) { |
| 3421 | 3421 | if ($selected > 0) { |
| 3422 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 3422 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 3423 | 3423 | $producttmpselect = new Product($this->db); |
| 3424 | 3424 | $producttmpselect->fetch($selected); |
| 3425 | 3425 | $selected_input_value = $producttmpselect->ref; |
@@ -3427,10 +3427,10 @@ discard block |
||
| 3427 | 3427 | } |
| 3428 | 3428 | |
| 3429 | 3429 | // mode=2 means suppliers products |
| 3430 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice; |
|
| 3431 | - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
| 3430 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; |
|
| 3431 | + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
| 3432 | 3432 | |
| 3433 | - print ($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>'; |
|
| 3433 | + print ($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>'; |
|
| 3434 | 3434 | } else { |
| 3435 | 3435 | print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); |
| 3436 | 3436 | } |
@@ -3490,25 +3490,25 @@ discard block |
||
| 3490 | 3490 | if (isModEnabled('barcode')) { |
| 3491 | 3491 | $sql .= ", pfp.barcode"; |
| 3492 | 3492 | } |
| 3493 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
| 3494 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )"; |
|
| 3493 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
| 3494 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )"; |
|
| 3495 | 3495 | if ($socid > 0) { |
| 3496 | - $sql .= " AND pfp.fk_soc = " . ((int) $socid); |
|
| 3496 | + $sql .= " AND pfp.fk_soc = ".((int) $socid); |
|
| 3497 | 3497 | } |
| 3498 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3498 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3499 | 3499 | // Units |
| 3500 | 3500 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3501 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
| 3501 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
| 3502 | 3502 | } |
| 3503 | - $sql .= " WHERE p.entity IN (" . getEntity('product') . ")"; |
|
| 3503 | + $sql .= " WHERE p.entity IN (".getEntity('product').")"; |
|
| 3504 | 3504 | if ($statut != -1) { |
| 3505 | - $sql .= " AND p.tobuy = " . ((int) $statut); |
|
| 3505 | + $sql .= " AND p.tobuy = ".((int) $statut); |
|
| 3506 | 3506 | } |
| 3507 | 3507 | if (strval($filtertype) != '') { |
| 3508 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
| 3508 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
| 3509 | 3509 | } |
| 3510 | 3510 | if (!empty($filtre)) { |
| 3511 | - $sql .= " " . $filtre; |
|
| 3511 | + $sql .= " ".$filtre; |
|
| 3512 | 3512 | } |
| 3513 | 3513 | // Add where from hooks |
| 3514 | 3514 | $parameters = array(); |
@@ -3528,9 +3528,9 @@ discard block |
||
| 3528 | 3528 | if ($i > 0) { |
| 3529 | 3529 | $sql .= " AND "; |
| 3530 | 3530 | } |
| 3531 | - $sql .= "(pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3531 | + $sql .= "(pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%' OR p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3532 | 3532 | if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) { |
| 3533 | - $sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3533 | + $sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3534 | 3534 | } |
| 3535 | 3535 | $sql .= ")"; |
| 3536 | 3536 | $i++; |
@@ -3539,8 +3539,8 @@ discard block |
||
| 3539 | 3539 | $sql .= ")"; |
| 3540 | 3540 | } |
| 3541 | 3541 | if (isModEnabled('barcode')) { |
| 3542 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3543 | - $sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3542 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3543 | + $sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3544 | 3544 | } |
| 3545 | 3545 | $sql .= ')'; |
| 3546 | 3546 | } |
@@ -3549,20 +3549,20 @@ discard block |
||
| 3549 | 3549 | |
| 3550 | 3550 | // Build output string |
| 3551 | 3551 | |
| 3552 | - dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG); |
|
| 3552 | + dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG); |
|
| 3553 | 3553 | $result = $this->db->query($sql); |
| 3554 | 3554 | if ($result) { |
| 3555 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3556 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 3555 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3556 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 3557 | 3557 | |
| 3558 | 3558 | $num = $this->db->num_rows($result); |
| 3559 | 3559 | |
| 3560 | 3560 | //$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax |
| 3561 | - $out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 3561 | + $out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 3562 | 3562 | if (!$selected) { |
| 3563 | - $out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
| 3563 | + $out .= '<option value="-1" selected>'.($placeholder ? $placeholder : ' ').'</option>'; |
|
| 3564 | 3564 | } else { |
| 3565 | - $out .= '<option value="-1">' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
| 3565 | + $out .= '<option value="-1">'.($placeholder ? $placeholder : ' ').'</option>'; |
|
| 3566 | 3566 | } |
| 3567 | 3567 | |
| 3568 | 3568 | $i = 0; |
@@ -3577,7 +3577,7 @@ discard block |
||
| 3577 | 3577 | |
| 3578 | 3578 | $outkey = $objp->idprodfournprice; // id in table of price |
| 3579 | 3579 | if (!$outkey && $alsoproductwithnosupplierprice) { |
| 3580 | - $outkey = 'idprod_' . $objp->rowid; // id of product |
|
| 3580 | + $outkey = 'idprod_'.$objp->rowid; // id of product |
|
| 3581 | 3581 | } |
| 3582 | 3582 | |
| 3583 | 3583 | $outref = $objp->ref; |
@@ -3592,23 +3592,23 @@ discard block |
||
| 3592 | 3592 | $outvalUnits = ''; |
| 3593 | 3593 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3594 | 3594 | if (!empty($objp->unit_short)) { |
| 3595 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
| 3595 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
| 3596 | 3596 | } |
| 3597 | 3597 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
| 3598 | 3598 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
| 3599 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3599 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3600 | 3600 | } |
| 3601 | 3601 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
| 3602 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
| 3603 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3602 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
| 3603 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3604 | 3604 | } |
| 3605 | 3605 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
| 3606 | 3606 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
| 3607 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3607 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3608 | 3608 | } |
| 3609 | 3609 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
| 3610 | 3610 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
| 3611 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3611 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3612 | 3612 | } |
| 3613 | 3613 | if ($outdurationvalue && $outdurationunit) { |
| 3614 | 3614 | $da = array( |
@@ -3619,22 +3619,22 @@ discard block |
||
| 3619 | 3619 | 'y' => $langs->trans('Year') |
| 3620 | 3620 | ); |
| 3621 | 3621 | if (isset($da[$outdurationunit])) { |
| 3622 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
| 3622 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
| 3623 | 3623 | } |
| 3624 | 3624 | } |
| 3625 | 3625 | } |
| 3626 | 3626 | |
| 3627 | 3627 | $objRef = $objp->ref; |
| 3628 | 3628 | if ($filterkey && $filterkey != '') { |
| 3629 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3629 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3630 | 3630 | } |
| 3631 | 3631 | $objRefFourn = $objp->ref_fourn; |
| 3632 | 3632 | if ($filterkey && $filterkey != '') { |
| 3633 | - $objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
| 3633 | + $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
| 3634 | 3634 | } |
| 3635 | 3635 | $label = $objp->label; |
| 3636 | 3636 | if ($filterkey && $filterkey != '') { |
| 3637 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
| 3637 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
| 3638 | 3638 | } |
| 3639 | 3639 | |
| 3640 | 3640 | switch ($objp->fk_product_type) { |
@@ -3657,21 +3657,21 @@ discard block |
||
| 3657 | 3657 | |
| 3658 | 3658 | $optlabel .= $objp->ref; |
| 3659 | 3659 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
| 3660 | - $optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>'; |
|
| 3660 | + $optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>'; |
|
| 3661 | 3661 | } |
| 3662 | 3662 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
| 3663 | - $optlabel .= ' (' . $outbarcode . ')'; |
|
| 3663 | + $optlabel .= ' ('.$outbarcode.')'; |
|
| 3664 | 3664 | } |
| 3665 | - $optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3665 | + $optlabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3666 | 3666 | |
| 3667 | 3667 | $outvallabel = $objRef; |
| 3668 | 3668 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
| 3669 | - $outvallabel .= ' (' . $objRefFourn . ')'; |
|
| 3669 | + $outvallabel .= ' ('.$objRefFourn.')'; |
|
| 3670 | 3670 | } |
| 3671 | 3671 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
| 3672 | - $outvallabel .= ' (' . $outbarcode . ')'; |
|
| 3672 | + $outvallabel .= ' ('.$outbarcode.')'; |
|
| 3673 | 3673 | } |
| 3674 | - $outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3674 | + $outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3675 | 3675 | |
| 3676 | 3676 | // Units |
| 3677 | 3677 | $optlabel .= $outvalUnits; |
@@ -3688,7 +3688,7 @@ discard block |
||
| 3688 | 3688 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
| 3689 | 3689 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
| 3690 | 3690 | |
| 3691 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3691 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3692 | 3692 | $priceparser = new PriceParser($this->db); |
| 3693 | 3693 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
| 3694 | 3694 | if ($price_result >= 0) { |
@@ -3699,48 +3699,48 @@ discard block |
||
| 3699 | 3699 | } |
| 3700 | 3700 | } |
| 3701 | 3701 | if ($objp->quantity == 1) { |
| 3702 | - $optlabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3703 | - $outvallabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3702 | + $optlabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3703 | + $outvallabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3704 | 3704 | $optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
| 3705 | 3705 | $outvallabel .= $langs->transnoentities("Unit"); |
| 3706 | 3706 | } else { |
| 3707 | - $optlabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3708 | - $outvallabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3709 | - $optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
| 3710 | - $outvallabel .= ' ' . $langs->transnoentities("Units"); |
|
| 3707 | + $optlabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3708 | + $outvallabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3709 | + $optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
| 3710 | + $outvallabel .= ' '.$langs->transnoentities("Units"); |
|
| 3711 | 3711 | } |
| 3712 | 3712 | |
| 3713 | 3713 | if ($objp->quantity > 1) { |
| 3714 | - $optlabel .= " (" . price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3715 | - $outvallabel .= " (" . price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3714 | + $optlabel .= " (".price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3715 | + $outvallabel .= " (".price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3716 | 3716 | } |
| 3717 | 3717 | if ($objp->remise_percent >= 1) { |
| 3718 | - $optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3719 | - $outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3718 | + $optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3719 | + $outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3720 | 3720 | } |
| 3721 | 3721 | if ($objp->duration) { |
| 3722 | - $optlabel .= " - " . $objp->duration; |
|
| 3723 | - $outvallabel .= " - " . $objp->duration; |
|
| 3722 | + $optlabel .= " - ".$objp->duration; |
|
| 3723 | + $outvallabel .= " - ".$objp->duration; |
|
| 3724 | 3724 | } |
| 3725 | 3725 | if (!$socid) { |
| 3726 | - $optlabel .= " - " . dol_trunc($objp->name, 8); |
|
| 3727 | - $outvallabel .= " - " . dol_trunc($objp->name, 8); |
|
| 3726 | + $optlabel .= " - ".dol_trunc($objp->name, 8); |
|
| 3727 | + $outvallabel .= " - ".dol_trunc($objp->name, 8); |
|
| 3728 | 3728 | } |
| 3729 | 3729 | if ($objp->supplier_reputation) { |
| 3730 | 3730 | //TODO dictionary |
| 3731 | 3731 | $reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier')); |
| 3732 | 3732 | |
| 3733 | - $optlabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
| 3734 | - $outvallabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
| 3733 | + $optlabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
| 3734 | + $outvallabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
| 3735 | 3735 | } |
| 3736 | 3736 | } else { |
| 3737 | 3737 | if (empty($alsoproductwithnosupplierprice)) { // No supplier price defined for couple product/supplier |
| 3738 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
| 3739 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3738 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
| 3739 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3740 | 3740 | } else // No supplier price defined for product, even on other suppliers |
| 3741 | 3741 | { |
| 3742 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
| 3743 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3742 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
| 3743 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3744 | 3744 | } |
| 3745 | 3745 | } |
| 3746 | 3746 | |
@@ -3748,14 +3748,14 @@ discard block |
||
| 3748 | 3748 | $novirtualstock = ($showstockinlist == 2); |
| 3749 | 3749 | |
| 3750 | 3750 | if ($user->hasRight('stock', 'lire')) { |
| 3751 | - $outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
| 3751 | + $outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
| 3752 | 3752 | |
| 3753 | 3753 | if ($objp->stock > 0) { |
| 3754 | 3754 | $optlabel .= ' - <span class="product_line_stock_ok">'; |
| 3755 | 3755 | } elseif ($objp->stock <= 0) { |
| 3756 | 3756 | $optlabel .= ' - <span class="product_line_stock_too_low">'; |
| 3757 | 3757 | } |
| 3758 | - $optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS')); |
|
| 3758 | + $optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS')); |
|
| 3759 | 3759 | $optlabel .= '</span>'; |
| 3760 | 3760 | if (empty($novirtualstock) && !empty($conf->global->STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO)) { // Warning, this option may slow down combo list generation |
| 3761 | 3761 | $langs->load("stocks"); |
@@ -3765,9 +3765,9 @@ discard block |
||
| 3765 | 3765 | $tmpproduct->load_virtual_stock(); |
| 3766 | 3766 | $virtualstock = $tmpproduct->stock_theorique; |
| 3767 | 3767 | |
| 3768 | - $outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
| 3768 | + $outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
| 3769 | 3769 | |
| 3770 | - $optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
| 3770 | + $optlabel .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
| 3771 | 3771 | if ($virtualstock > 0) { |
| 3772 | 3772 | $optlabel .= '<span class="product_line_stock_ok">'; |
| 3773 | 3773 | } elseif ($virtualstock <= 0) { |
@@ -3781,7 +3781,7 @@ discard block |
||
| 3781 | 3781 | } |
| 3782 | 3782 | } |
| 3783 | 3783 | |
| 3784 | - $optstart = '<option value="' . $outkey . '"'; |
|
| 3784 | + $optstart = '<option value="'.$outkey.'"'; |
|
| 3785 | 3785 | if ($selected && $selected == $objp->idprodfournprice) { |
| 3786 | 3786 | $optstart .= ' selected'; |
| 3787 | 3787 | } |
@@ -3790,27 +3790,27 @@ discard block |
||
| 3790 | 3790 | } |
| 3791 | 3791 | |
| 3792 | 3792 | if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { |
| 3793 | - $optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"'; |
|
| 3794 | - $optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"'; |
|
| 3795 | - $optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"'; |
|
| 3796 | - $optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"'; |
|
| 3797 | - $optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"'; |
|
| 3798 | - $optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"'; |
|
| 3799 | - $optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"'; |
|
| 3800 | - $optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"'; |
|
| 3801 | - $optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"'; |
|
| 3802 | - $optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"'; |
|
| 3803 | - } |
|
| 3804 | - $optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"'; |
|
| 3793 | + $optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"'; |
|
| 3794 | + $optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"'; |
|
| 3795 | + $optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"'; |
|
| 3796 | + $optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"'; |
|
| 3797 | + $optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"'; |
|
| 3798 | + $optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"'; |
|
| 3799 | + $optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"'; |
|
| 3800 | + $optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"'; |
|
| 3801 | + $optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"'; |
|
| 3802 | + $optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"'; |
|
| 3803 | + } |
|
| 3804 | + $optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; |
|
| 3805 | 3805 | |
| 3806 | 3806 | $outarrayentry = array( |
| 3807 | 3807 | 'key' => $outkey, |
| 3808 | 3808 | 'value' => $outref, |
| 3809 | 3809 | 'label' => $outvallabel, |
| 3810 | 3810 | 'qty' => $outqty, |
| 3811 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 3812 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 3813 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 3811 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 3812 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 3813 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 3814 | 3814 | 'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2), |
| 3815 | 3815 | 'tva_tx' => price2num($objp->tva_tx), |
| 3816 | 3816 | 'default_vat_code' => $objp->default_vat_code, |
@@ -3835,18 +3835,18 @@ discard block |
||
| 3835 | 3835 | // Add new entry |
| 3836 | 3836 | // "key" value of json key array is used by jQuery automatically as selected value. Example: 'type' = product or service, 'price_ht' = unit price without tax |
| 3837 | 3837 | // "label" value of json key array is used by jQuery automatically as text for combo box |
| 3838 | - $out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n"; |
|
| 3838 | + $out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n"; |
|
| 3839 | 3839 | array_push( |
| 3840 | 3840 | $outarray, |
| 3841 | 3841 | array('key' => $outkey, |
| 3842 | 3842 | 'value' => $outref, |
| 3843 | 3843 | 'label' => $outvallabel, |
| 3844 | 3844 | 'qty' => $outqty, |
| 3845 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 3845 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 3846 | 3846 | 'price_qty_ht_locale' => price($objp->fprice), |
| 3847 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 3847 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 3848 | 3848 | 'price_unit_ht_locale' => price($objp->unitprice), |
| 3849 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 3849 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 3850 | 3850 | 'tva_tx_formated' => price($objp->tva_tx), |
| 3851 | 3851 | 'tva_tx' => price2num($objp->tva_tx), |
| 3852 | 3852 | 'default_vat_code' => $objp->default_vat_code, |
@@ -3873,7 +3873,7 @@ discard block |
||
| 3873 | 3873 | |
| 3874 | 3874 | $this->db->free($result); |
| 3875 | 3875 | |
| 3876 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 3876 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 3877 | 3877 | $out .= ajax_combobox($htmlname); |
| 3878 | 3878 | } else { |
| 3879 | 3879 | dol_print_error($this->db); |
@@ -3905,43 +3905,43 @@ discard block |
||
| 3905 | 3905 | $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,"; |
| 3906 | 3906 | $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,"; |
| 3907 | 3907 | $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name"; |
| 3908 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
| 3909 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 3910 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3911 | - $sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")"; |
|
| 3908 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
| 3909 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 3910 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3911 | + $sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")"; |
|
| 3912 | 3912 | $sql .= " AND p.tobuy = 1"; |
| 3913 | 3913 | $sql .= " AND s.fournisseur = 1"; |
| 3914 | - $sql .= " AND p.rowid = " . ((int) $productid); |
|
| 3914 | + $sql .= " AND p.rowid = ".((int) $productid); |
|
| 3915 | 3915 | if (empty($conf->global->PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED)) { |
| 3916 | 3916 | $sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; |
| 3917 | 3917 | } else { |
| 3918 | 3918 | $sql .= " ORDER BY pfp.unitprice ASC"; |
| 3919 | 3919 | } |
| 3920 | 3920 | |
| 3921 | - dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG); |
|
| 3921 | + dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG); |
|
| 3922 | 3922 | $result = $this->db->query($sql); |
| 3923 | 3923 | |
| 3924 | 3924 | if ($result) { |
| 3925 | 3925 | $num = $this->db->num_rows($result); |
| 3926 | 3926 | |
| 3927 | - $form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 3927 | + $form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 3928 | 3928 | |
| 3929 | 3929 | if (!$num) { |
| 3930 | - $form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>'; |
|
| 3930 | + $form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>'; |
|
| 3931 | 3931 | } else { |
| 3932 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3932 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3933 | 3933 | $form .= '<option value="0"> </option>'; |
| 3934 | 3934 | |
| 3935 | 3935 | $i = 0; |
| 3936 | 3936 | while ($i < $num) { |
| 3937 | 3937 | $objp = $this->db->fetch_object($result); |
| 3938 | 3938 | |
| 3939 | - $opt = '<option value="' . $objp->idprodfournprice . '"'; |
|
| 3939 | + $opt = '<option value="'.$objp->idprodfournprice.'"'; |
|
| 3940 | 3940 | //if there is only one supplier, preselect it |
| 3941 | 3941 | if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && !empty($conf->global->PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED))) { |
| 3942 | 3942 | $opt .= ' selected'; |
| 3943 | 3943 | } |
| 3944 | - $opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - '; |
|
| 3944 | + $opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - '; |
|
| 3945 | 3945 | |
| 3946 | 3946 | if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) { |
| 3947 | 3947 | $prod_supplier = new ProductFournisseur($this->db); |
@@ -3951,7 +3951,7 @@ discard block |
||
| 3951 | 3951 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
| 3952 | 3952 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
| 3953 | 3953 | |
| 3954 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3954 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3955 | 3955 | $priceparser = new PriceParser($this->db); |
| 3956 | 3956 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
| 3957 | 3957 | if ($price_result >= 0) { |
@@ -3962,10 +3962,10 @@ discard block |
||
| 3962 | 3962 | } |
| 3963 | 3963 | } |
| 3964 | 3964 | if ($objp->quantity == 1) { |
| 3965 | - $opt .= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3965 | + $opt .= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3966 | 3966 | } |
| 3967 | 3967 | |
| 3968 | - $opt .= $objp->quantity . ' '; |
|
| 3968 | + $opt .= $objp->quantity.' '; |
|
| 3969 | 3969 | |
| 3970 | 3970 | if ($objp->quantity == 1) { |
| 3971 | 3971 | $opt .= $langs->trans("Unit"); |
@@ -3974,10 +3974,10 @@ discard block |
||
| 3974 | 3974 | } |
| 3975 | 3975 | if ($objp->quantity > 1) { |
| 3976 | 3976 | $opt .= " - "; |
| 3977 | - $opt .= price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit"); |
|
| 3977 | + $opt .= price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit"); |
|
| 3978 | 3978 | } |
| 3979 | 3979 | if ($objp->duration) { |
| 3980 | - $opt .= " - " . $objp->duration; |
|
| 3980 | + $opt .= " - ".$objp->duration; |
|
| 3981 | 3981 | } |
| 3982 | 3982 | $opt .= "</option>\n"; |
| 3983 | 3983 | |
@@ -4015,8 +4015,8 @@ discard block |
||
| 4015 | 4015 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 4016 | 4016 | |
| 4017 | 4017 | $sql = "SELECT rowid, code, libelle as label, deposit_percent"; |
| 4018 | - $sql .= " FROM " . $this->db->prefix() . 'c_payment_term'; |
|
| 4019 | - $sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")"; |
|
| 4018 | + $sql .= " FROM ".$this->db->prefix().'c_payment_term'; |
|
| 4019 | + $sql .= " WHERE entity IN (".getEntity('c_payment_term').")"; |
|
| 4020 | 4020 | $sql .= " AND active > 0"; |
| 4021 | 4021 | $sql .= " ORDER BY sortorder"; |
| 4022 | 4022 | |
@@ -4028,7 +4028,7 @@ discard block |
||
| 4028 | 4028 | $obj = $this->db->fetch_object($resql); |
| 4029 | 4029 | |
| 4030 | 4030 | // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut |
| 4031 | - $label = ($langs->trans("PaymentConditionShort" . $obj->code) != ("PaymentConditionShort" . $obj->code) ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4031 | + $label = ($langs->trans("PaymentConditionShort".$obj->code) != ("PaymentConditionShort".$obj->code) ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4032 | 4032 | $this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code; |
| 4033 | 4033 | $this->cache_conditions_paiements[$obj->rowid]['label'] = $label; |
| 4034 | 4034 | $this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent; |
@@ -4056,7 +4056,7 @@ discard block |
||
| 4056 | 4056 | // phpcs:enable |
| 4057 | 4057 | global $langs; |
| 4058 | 4058 | |
| 4059 | - $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
| 4059 | + $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
| 4060 | 4060 | if ($num > 0) { |
| 4061 | 4061 | return 0; // Cache already loaded |
| 4062 | 4062 | } |
@@ -4066,7 +4066,7 @@ discard block |
||
| 4066 | 4066 | $langs->load('propal'); |
| 4067 | 4067 | |
| 4068 | 4068 | $sql = "SELECT rowid, code, label, position"; |
| 4069 | - $sql .= " FROM " . $this->db->prefix() . 'c_availability'; |
|
| 4069 | + $sql .= " FROM ".$this->db->prefix().'c_availability'; |
|
| 4070 | 4070 | $sql .= " WHERE active > 0"; |
| 4071 | 4071 | |
| 4072 | 4072 | $resql = $this->db->query($sql); |
@@ -4077,7 +4077,7 @@ discard block |
||
| 4077 | 4077 | $obj = $this->db->fetch_object($resql); |
| 4078 | 4078 | |
| 4079 | 4079 | // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut |
| 4080 | - $label = ($langs->trans("AvailabilityType" . $obj->code) != ("AvailabilityType" . $obj->code) ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4080 | + $label = ($langs->trans("AvailabilityType".$obj->code) != ("AvailabilityType".$obj->code) ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4081 | 4081 | $this->cache_availability[$obj->rowid]['code'] = $obj->code; |
| 4082 | 4082 | $this->cache_availability[$obj->rowid]['label'] = $label; |
| 4083 | 4083 | $this->cache_availability[$obj->rowid]['position'] = $obj->position; |
@@ -4109,17 +4109,17 @@ discard block |
||
| 4109 | 4109 | |
| 4110 | 4110 | $this->load_cache_availability(); |
| 4111 | 4111 | |
| 4112 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 4112 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 4113 | 4113 | |
| 4114 | - print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4114 | + print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4115 | 4115 | if ($addempty) { |
| 4116 | 4116 | print '<option value="0"> </option>'; |
| 4117 | 4117 | } |
| 4118 | 4118 | foreach ($this->cache_availability as $id => $arrayavailability) { |
| 4119 | 4119 | if ($selected == $id) { |
| 4120 | - print '<option value="' . $id . '" selected>'; |
|
| 4120 | + print '<option value="'.$id.'" selected>'; |
|
| 4121 | 4121 | } else { |
| 4122 | - print '<option value="' . $id . '">'; |
|
| 4122 | + print '<option value="'.$id.'">'; |
|
| 4123 | 4123 | } |
| 4124 | 4124 | print dol_escape_htmltag($arrayavailability['label']); |
| 4125 | 4125 | print '</option>'; |
@@ -4140,13 +4140,13 @@ discard block |
||
| 4140 | 4140 | { |
| 4141 | 4141 | global $langs; |
| 4142 | 4142 | |
| 4143 | - $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
| 4143 | + $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
| 4144 | 4144 | if ($num > 0) { |
| 4145 | 4145 | return 0; // Cache already loaded |
| 4146 | 4146 | } |
| 4147 | 4147 | |
| 4148 | 4148 | $sql = "SELECT rowid, code, label"; |
| 4149 | - $sql .= " FROM " . $this->db->prefix() . 'c_input_reason'; |
|
| 4149 | + $sql .= " FROM ".$this->db->prefix().'c_input_reason'; |
|
| 4150 | 4150 | $sql .= " WHERE active > 0"; |
| 4151 | 4151 | |
| 4152 | 4152 | $resql = $this->db->query($sql); |
@@ -4159,8 +4159,8 @@ discard block |
||
| 4159 | 4159 | |
| 4160 | 4160 | // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut |
| 4161 | 4161 | $label = ($obj->label != '-' ? $obj->label : ''); |
| 4162 | - if ($langs->trans("DemandReasonType" . $obj->code) != ("DemandReasonType" . $obj->code)) { |
|
| 4163 | - $label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
| 4162 | + if ($langs->trans("DemandReasonType".$obj->code) != ("DemandReasonType".$obj->code)) { |
|
| 4163 | + $label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
| 4164 | 4164 | } |
| 4165 | 4165 | if ($langs->trans($obj->code) != $obj->code) { |
| 4166 | 4166 | $label = $langs->trans($obj->code); // So translation key SRC_XXX will work |
@@ -4200,9 +4200,9 @@ discard block |
||
| 4200 | 4200 | |
| 4201 | 4201 | $this->loadCacheInputReason(); |
| 4202 | 4202 | |
| 4203 | - print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4203 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4204 | 4204 | if ($addempty) { |
| 4205 | - print '<option value="0"' . (empty($selected) ? ' selected' : '') . '> </option>'; |
|
| 4205 | + print '<option value="0"'.(empty($selected) ? ' selected' : '').'> </option>'; |
|
| 4206 | 4206 | } |
| 4207 | 4207 | foreach ($this->cache_demand_reason as $id => $arraydemandreason) { |
| 4208 | 4208 | if ($arraydemandreason['code'] == $exclude) { |
@@ -4210,9 +4210,9 @@ discard block |
||
| 4210 | 4210 | } |
| 4211 | 4211 | |
| 4212 | 4212 | if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) { |
| 4213 | - print '<option value="' . $arraydemandreason['id'] . '" selected>'; |
|
| 4213 | + print '<option value="'.$arraydemandreason['id'].'" selected>'; |
|
| 4214 | 4214 | } else { |
| 4215 | - print '<option value="' . $arraydemandreason['id'] . '">'; |
|
| 4215 | + print '<option value="'.$arraydemandreason['id'].'">'; |
|
| 4216 | 4216 | } |
| 4217 | 4217 | $label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason |
| 4218 | 4218 | print $langs->trans($label); |
@@ -4222,7 +4222,7 @@ discard block |
||
| 4222 | 4222 | if ($user->admin && empty($notooltip)) { |
| 4223 | 4223 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4224 | 4224 | } |
| 4225 | - print ajax_combobox('select_' . $htmlname); |
|
| 4225 | + print ajax_combobox('select_'.$htmlname); |
|
| 4226 | 4226 | } |
| 4227 | 4227 | |
| 4228 | 4228 | // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
@@ -4237,7 +4237,7 @@ discard block |
||
| 4237 | 4237 | // phpcs:enable |
| 4238 | 4238 | global $langs; |
| 4239 | 4239 | |
| 4240 | - $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
| 4240 | + $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
| 4241 | 4241 | if ($num > 0) { |
| 4242 | 4242 | return $num; // Cache already loaded |
| 4243 | 4243 | } |
@@ -4247,8 +4247,8 @@ discard block |
||
| 4247 | 4247 | $this->cache_types_paiements = array(); |
| 4248 | 4248 | |
| 4249 | 4249 | $sql = "SELECT id, code, libelle as label, type, active"; |
| 4250 | - $sql .= " FROM " . $this->db->prefix() . "c_paiement"; |
|
| 4251 | - $sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")"; |
|
| 4250 | + $sql .= " FROM ".$this->db->prefix()."c_paiement"; |
|
| 4251 | + $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; |
|
| 4252 | 4252 | |
| 4253 | 4253 | $resql = $this->db->query($sql); |
| 4254 | 4254 | if ($resql) { |
@@ -4258,7 +4258,7 @@ discard block |
||
| 4258 | 4258 | $obj = $this->db->fetch_object($resql); |
| 4259 | 4259 | |
| 4260 | 4260 | // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut |
| 4261 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != ("PaymentTypeShort" . $obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4261 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != ("PaymentTypeShort".$obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4262 | 4262 | $this->cache_types_paiements[$obj->id]['id'] = $obj->id; |
| 4263 | 4263 | $this->cache_types_paiements[$obj->id]['code'] = $obj->code; |
| 4264 | 4264 | $this->cache_types_paiements[$obj->id]['label'] = $label; |
@@ -4324,17 +4324,17 @@ discard block |
||
| 4324 | 4324 | global $langs, $user, $conf; |
| 4325 | 4325 | |
| 4326 | 4326 | $out = ''; |
| 4327 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 4327 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 4328 | 4328 | |
| 4329 | 4329 | $this->load_cache_conditions_paiements(); |
| 4330 | 4330 | |
| 4331 | 4331 | // Set default value if not already set by caller |
| 4332 | 4332 | if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID)) { |
| 4333 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
| 4333 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
| 4334 | 4334 | $selected = $conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID; |
| 4335 | 4335 | } |
| 4336 | 4336 | |
| 4337 | - $out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4337 | + $out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4338 | 4338 | if ($addempty) { |
| 4339 | 4339 | $out .= '<option value="0"> </option>'; |
| 4340 | 4340 | } |
@@ -4348,9 +4348,9 @@ discard block |
||
| 4348 | 4348 | |
| 4349 | 4349 | if ($selected == $id) { |
| 4350 | 4350 | $selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent']; |
| 4351 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>'; |
|
| 4351 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>'; |
|
| 4352 | 4352 | } else { |
| 4353 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">'; |
|
| 4353 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">'; |
|
| 4354 | 4354 | } |
| 4355 | 4355 | $label = $arrayconditions['label']; |
| 4356 | 4356 | |
@@ -4368,21 +4368,21 @@ discard block |
||
| 4368 | 4368 | $out .= ajax_combobox($htmlname); |
| 4369 | 4369 | |
| 4370 | 4370 | if ($deposit_percent >= 0) { |
| 4371 | - $out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>'; |
|
| 4372 | - $out .= $langs->trans('DepositPercent') . ' : '; |
|
| 4373 | - $out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />'; |
|
| 4371 | + $out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>'; |
|
| 4372 | + $out .= $langs->trans('DepositPercent').' : '; |
|
| 4373 | + $out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />'; |
|
| 4374 | 4374 | $out .= '</span>'; |
| 4375 | 4375 | $out .= ' |
| 4376 | - <script nonce="' . getNonce() . '"> |
|
| 4376 | + <script nonce="' . getNonce().'"> |
|
| 4377 | 4377 | $(document).ready(function () { |
| 4378 | - $("#' . $htmlname . '").change(function () { |
|
| 4378 | + $("#' . $htmlname.'").change(function () { |
|
| 4379 | 4379 | let $selected = $(this).find("option:selected"); |
| 4380 | 4380 | let depositPercent = $selected.attr("data-deposit_percent"); |
| 4381 | 4381 | |
| 4382 | 4382 | if (depositPercent.length > 0) { |
| 4383 | - $("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent); |
|
| 4383 | + $("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent); |
|
| 4384 | 4384 | } else { |
| 4385 | - $("#' . $htmlname . '_deposit_percent_container").hide(); |
|
| 4385 | + $("#' . $htmlname.'_deposit_percent_container").hide(); |
|
| 4386 | 4386 | } |
| 4387 | 4387 | |
| 4388 | 4388 | return true; |
@@ -4420,7 +4420,7 @@ discard block |
||
| 4420 | 4420 | |
| 4421 | 4421 | $out = ''; |
| 4422 | 4422 | |
| 4423 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG); |
|
| 4423 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); |
|
| 4424 | 4424 | |
| 4425 | 4425 | $filterarray = array(); |
| 4426 | 4426 | if ($filtertype == 'CRDT') { |
@@ -4435,11 +4435,11 @@ discard block |
||
| 4435 | 4435 | |
| 4436 | 4436 | // Set default value if not already set by caller |
| 4437 | 4437 | if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID)) { |
| 4438 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
| 4438 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
| 4439 | 4439 | $selected = $conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID; |
| 4440 | 4440 | } |
| 4441 | 4441 | |
| 4442 | - $out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4442 | + $out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4443 | 4443 | if ($empty) { |
| 4444 | 4444 | $out .= '<option value=""> </option>'; |
| 4445 | 4445 | } |
@@ -4460,13 +4460,13 @@ discard block |
||
| 4460 | 4460 | } |
| 4461 | 4461 | |
| 4462 | 4462 | if ($format == 0) { |
| 4463 | - $out .= '<option value="' . $id . '"'; |
|
| 4463 | + $out .= '<option value="'.$id.'"'; |
|
| 4464 | 4464 | } elseif ($format == 1) { |
| 4465 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
| 4465 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
| 4466 | 4466 | } elseif ($format == 2) { |
| 4467 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
| 4467 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
| 4468 | 4468 | } elseif ($format == 3) { |
| 4469 | - $out .= '<option value="' . $id . '"'; |
|
| 4469 | + $out .= '<option value="'.$id.'"'; |
|
| 4470 | 4470 | } |
| 4471 | 4471 | // Print attribute selected or not |
| 4472 | 4472 | if ($format == 1 || $format == 2) { |
@@ -4496,7 +4496,7 @@ discard block |
||
| 4496 | 4496 | if ($user->admin && !$noadmininfo) { |
| 4497 | 4497 | $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4498 | 4498 | } |
| 4499 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 4499 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 4500 | 4500 | |
| 4501 | 4501 | if (empty($nooutput)) { |
| 4502 | 4502 | print $out; |
@@ -4518,22 +4518,22 @@ discard block |
||
| 4518 | 4518 | { |
| 4519 | 4519 | global $langs; |
| 4520 | 4520 | |
| 4521 | - $return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4521 | + $return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4522 | 4522 | $options = array( |
| 4523 | 4523 | 'HT' => $langs->trans("HT"), |
| 4524 | 4524 | 'TTC' => $langs->trans("TTC") |
| 4525 | 4525 | ); |
| 4526 | 4526 | foreach ($options as $id => $value) { |
| 4527 | 4527 | if ($selected == $id) { |
| 4528 | - $return .= '<option value="' . $id . '" selected>' . $value; |
|
| 4528 | + $return .= '<option value="'.$id.'" selected>'.$value; |
|
| 4529 | 4529 | } else { |
| 4530 | - $return .= '<option value="' . $id . '">' . $value; |
|
| 4530 | + $return .= '<option value="'.$id.'">'.$value; |
|
| 4531 | 4531 | } |
| 4532 | 4532 | $return .= '</option>'; |
| 4533 | 4533 | } |
| 4534 | 4534 | $return .= '</select>'; |
| 4535 | 4535 | if ($addjscombo) { |
| 4536 | - $return .= ajax_combobox('select_' . $htmlname); |
|
| 4536 | + $return .= ajax_combobox('select_'.$htmlname); |
|
| 4537 | 4537 | } |
| 4538 | 4538 | |
| 4539 | 4539 | return $return; |
@@ -4551,7 +4551,7 @@ discard block |
||
| 4551 | 4551 | // phpcs:enable |
| 4552 | 4552 | global $langs; |
| 4553 | 4553 | |
| 4554 | - $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
| 4554 | + $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
| 4555 | 4555 | if ($num > 0) { |
| 4556 | 4556 | return $num; // Cache already loaded |
| 4557 | 4557 | } |
@@ -4561,8 +4561,8 @@ discard block |
||
| 4561 | 4561 | $this->cache_transport_mode = array(); |
| 4562 | 4562 | |
| 4563 | 4563 | $sql = "SELECT rowid, code, label, active"; |
| 4564 | - $sql .= " FROM " . $this->db->prefix() . "c_transport_mode"; |
|
| 4565 | - $sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")"; |
|
| 4564 | + $sql .= " FROM ".$this->db->prefix()."c_transport_mode"; |
|
| 4565 | + $sql .= " WHERE entity IN (".getEntity('c_transport_mode').")"; |
|
| 4566 | 4566 | |
| 4567 | 4567 | $resql = $this->db->query($sql); |
| 4568 | 4568 | if ($resql) { |
@@ -4572,7 +4572,7 @@ discard block |
||
| 4572 | 4572 | $obj = $this->db->fetch_object($resql); |
| 4573 | 4573 | |
| 4574 | 4574 | // If traduction exist, we use it else we take the default label |
| 4575 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != ("PaymentTypeShort" . $obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4575 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != ("PaymentTypeShort".$obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4576 | 4576 | $this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid; |
| 4577 | 4577 | $this->cache_transport_mode[$obj->rowid]['code'] = $obj->code; |
| 4578 | 4578 | $this->cache_transport_mode[$obj->rowid]['label'] = $label; |
@@ -4606,11 +4606,11 @@ discard block |
||
| 4606 | 4606 | { |
| 4607 | 4607 | global $langs, $user; |
| 4608 | 4608 | |
| 4609 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG); |
|
| 4609 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG); |
|
| 4610 | 4610 | |
| 4611 | 4611 | $this->load_cache_transport_mode(); |
| 4612 | 4612 | |
| 4613 | - print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4613 | + print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4614 | 4614 | if ($empty) { |
| 4615 | 4615 | print '<option value=""> </option>'; |
| 4616 | 4616 | } |
@@ -4626,13 +4626,13 @@ discard block |
||
| 4626 | 4626 | } |
| 4627 | 4627 | |
| 4628 | 4628 | if ($format == 0) { |
| 4629 | - print '<option value="' . $id . '"'; |
|
| 4629 | + print '<option value="'.$id.'"'; |
|
| 4630 | 4630 | } elseif ($format == 1) { |
| 4631 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
| 4631 | + print '<option value="'.$arraytypes['code'].'"'; |
|
| 4632 | 4632 | } elseif ($format == 2) { |
| 4633 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
| 4633 | + print '<option value="'.$arraytypes['code'].'"'; |
|
| 4634 | 4634 | } elseif ($format == 3) { |
| 4635 | - print '<option value="' . $id . '"'; |
|
| 4635 | + print '<option value="'.$id.'"'; |
|
| 4636 | 4636 | } |
| 4637 | 4637 | // If text is selected, we compare with code, else with id |
| 4638 | 4638 | if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) { |
@@ -4680,31 +4680,31 @@ discard block |
||
| 4680 | 4680 | $langs->load("deliveries"); |
| 4681 | 4681 | |
| 4682 | 4682 | $sql = "SELECT rowid, code, libelle as label"; |
| 4683 | - $sql .= " FROM " . $this->db->prefix() . "c_shipment_mode"; |
|
| 4683 | + $sql .= " FROM ".$this->db->prefix()."c_shipment_mode"; |
|
| 4684 | 4684 | $sql .= " WHERE active > 0"; |
| 4685 | 4685 | if ($filtre) { |
| 4686 | - $sql .= " AND " . $filtre; |
|
| 4686 | + $sql .= " AND ".$filtre; |
|
| 4687 | 4687 | } |
| 4688 | 4688 | $sql .= " ORDER BY libelle ASC"; |
| 4689 | 4689 | |
| 4690 | - dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG); |
|
| 4690 | + dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG); |
|
| 4691 | 4691 | $result = $this->db->query($sql); |
| 4692 | 4692 | if ($result) { |
| 4693 | 4693 | $num = $this->db->num_rows($result); |
| 4694 | 4694 | $i = 0; |
| 4695 | 4695 | if ($num) { |
| 4696 | - print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 4696 | + print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 4697 | 4697 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 4698 | 4698 | print '<option value="-1"> </option>'; |
| 4699 | 4699 | } |
| 4700 | 4700 | while ($i < $num) { |
| 4701 | 4701 | $obj = $this->db->fetch_object($result); |
| 4702 | 4702 | if ($selected == $obj->rowid) { |
| 4703 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 4703 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 4704 | 4704 | } else { |
| 4705 | - print '<option value="' . $obj->rowid . '">'; |
|
| 4705 | + print '<option value="'.$obj->rowid.'">'; |
|
| 4706 | 4706 | } |
| 4707 | - print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label; |
|
| 4707 | + print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label; |
|
| 4708 | 4708 | print '</option>'; |
| 4709 | 4709 | $i++; |
| 4710 | 4710 | } |
@@ -4713,7 +4713,7 @@ discard block |
||
| 4713 | 4713 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4714 | 4714 | } |
| 4715 | 4715 | |
| 4716 | - print ajax_combobox('select' . $htmlname); |
|
| 4716 | + print ajax_combobox('select'.$htmlname); |
|
| 4717 | 4717 | } else { |
| 4718 | 4718 | print $langs->trans("NoShippingMethodDefined"); |
| 4719 | 4719 | } |
@@ -4738,16 +4738,16 @@ discard block |
||
| 4738 | 4738 | $langs->load("deliveries"); |
| 4739 | 4739 | |
| 4740 | 4740 | if ($htmlname != "none") { |
| 4741 | - print '<form method="POST" action="' . $page . '">'; |
|
| 4741 | + print '<form method="POST" action="'.$page.'">'; |
|
| 4742 | 4742 | print '<input type="hidden" name="action" value="setshippingmethod">'; |
| 4743 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 4743 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 4744 | 4744 | $this->selectShippingMethod($selected, $htmlname, '', $addempty); |
| 4745 | - print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 4745 | + print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 4746 | 4746 | print '</form>'; |
| 4747 | 4747 | } else { |
| 4748 | 4748 | if ($selected) { |
| 4749 | 4749 | $code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code'); |
| 4750 | - print $langs->trans("SendingMethod" . strtoupper($code)); |
|
| 4750 | + print $langs->trans("SendingMethod".strtoupper($code)); |
|
| 4751 | 4751 | } else { |
| 4752 | 4752 | print " "; |
| 4753 | 4753 | } |
@@ -4770,10 +4770,10 @@ discard block |
||
| 4770 | 4770 | |
| 4771 | 4771 | $opt = '<option value="" selected></option>'; |
| 4772 | 4772 | $sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc"; |
| 4773 | - $sql .= ' FROM ' . $this->db->prefix() . 'facture'; |
|
| 4774 | - $sql .= ' WHERE entity IN (' . getEntity('invoice') . ')'; |
|
| 4773 | + $sql .= ' FROM '.$this->db->prefix().'facture'; |
|
| 4774 | + $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; |
|
| 4775 | 4775 | $sql .= ' AND situation_counter >= 1'; |
| 4776 | - $sql .= ' AND fk_soc = ' . (int) $socid; |
|
| 4776 | + $sql .= ' AND fk_soc = '.(int) $socid; |
|
| 4777 | 4777 | $sql .= ' AND type <> 2'; |
| 4778 | 4778 | $sql .= ' ORDER by situation_cycle_ref, situation_counter desc'; |
| 4779 | 4779 | $resql = $this->db->query($sql); |
@@ -4791,19 +4791,19 @@ discard block |
||
| 4791 | 4791 | //Not prov? |
| 4792 | 4792 | if (substr($obj->ref, 1, 4) != 'PROV') { |
| 4793 | 4793 | if ($selected == $obj->rowid) { |
| 4794 | - $opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>'; |
|
| 4794 | + $opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>'; |
|
| 4795 | 4795 | } else { |
| 4796 | - $opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>'; |
|
| 4796 | + $opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>'; |
|
| 4797 | 4797 | } |
| 4798 | 4798 | } |
| 4799 | 4799 | } |
| 4800 | 4800 | } |
| 4801 | 4801 | } |
| 4802 | 4802 | } else { |
| 4803 | - dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR); |
|
| 4803 | + dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR); |
|
| 4804 | 4804 | } |
| 4805 | 4805 | if ($opt == '<option value ="" selected></option>') { |
| 4806 | - $opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>'; |
|
| 4806 | + $opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>'; |
|
| 4807 | 4807 | } |
| 4808 | 4808 | return $opt; |
| 4809 | 4809 | } |
@@ -4823,12 +4823,12 @@ discard block |
||
| 4823 | 4823 | |
| 4824 | 4824 | $langs->load('products'); |
| 4825 | 4825 | |
| 4826 | - $return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4826 | + $return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4827 | 4827 | |
| 4828 | - $sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units"; |
|
| 4828 | + $sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units"; |
|
| 4829 | 4829 | $sql .= ' WHERE active > 0'; |
| 4830 | 4830 | if (!empty($unit_type)) { |
| 4831 | - $sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'"; |
|
| 4831 | + $sql .= " AND unit_type = '".$this->db->escape($unit_type)."'"; |
|
| 4832 | 4832 | } |
| 4833 | 4833 | $sql .= " ORDER BY sortorder"; |
| 4834 | 4834 | |
@@ -4840,14 +4840,14 @@ discard block |
||
| 4840 | 4840 | |
| 4841 | 4841 | while ($res = $this->db->fetch_object($resql)) { |
| 4842 | 4842 | $unitLabel = $res->label; |
| 4843 | - if (!empty($langs->tab_translate['unit' . $res->code])) { // check if Translation is available before |
|
| 4844 | - $unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label; |
|
| 4843 | + if (!empty($langs->tab_translate['unit'.$res->code])) { // check if Translation is available before |
|
| 4844 | + $unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label; |
|
| 4845 | 4845 | } |
| 4846 | 4846 | |
| 4847 | 4847 | if ($selected == $res->rowid) { |
| 4848 | - $return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>'; |
|
| 4848 | + $return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>'; |
|
| 4849 | 4849 | } else { |
| 4850 | - $return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>'; |
|
| 4850 | + $return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>'; |
|
| 4851 | 4851 | } |
| 4852 | 4852 | } |
| 4853 | 4853 | $return .= '</select>'; |
@@ -4882,23 +4882,23 @@ discard block |
||
| 4882 | 4882 | $num = 0; |
| 4883 | 4883 | |
| 4884 | 4884 | $sql = "SELECT rowid, label, bank, clos as status, currency_code"; |
| 4885 | - $sql .= " FROM " . $this->db->prefix() . "bank_account"; |
|
| 4886 | - $sql .= " WHERE entity IN (" . getEntity('bank_account') . ")"; |
|
| 4885 | + $sql .= " FROM ".$this->db->prefix()."bank_account"; |
|
| 4886 | + $sql .= " WHERE entity IN (".getEntity('bank_account').")"; |
|
| 4887 | 4887 | if ($status != 2) { |
| 4888 | - $sql .= " AND clos = " . (int) $status; |
|
| 4888 | + $sql .= " AND clos = ".(int) $status; |
|
| 4889 | 4889 | } |
| 4890 | 4890 | if ($filtre) { |
| 4891 | - $sql .= " AND " . $filtre; |
|
| 4891 | + $sql .= " AND ".$filtre; |
|
| 4892 | 4892 | } |
| 4893 | 4893 | $sql .= " ORDER BY label"; |
| 4894 | 4894 | |
| 4895 | - dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG); |
|
| 4895 | + dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG); |
|
| 4896 | 4896 | $result = $this->db->query($sql); |
| 4897 | 4897 | if ($result) { |
| 4898 | 4898 | $num = $this->db->num_rows($result); |
| 4899 | 4899 | $i = 0; |
| 4900 | 4900 | if ($num) { |
| 4901 | - $out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 4901 | + $out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 4902 | 4902 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 4903 | 4903 | $out .= '<option value="-1"> </option>'; |
| 4904 | 4904 | } |
@@ -4906,27 +4906,27 @@ discard block |
||
| 4906 | 4906 | while ($i < $num) { |
| 4907 | 4907 | $obj = $this->db->fetch_object($result); |
| 4908 | 4908 | if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) { |
| 4909 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>'; |
|
| 4909 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>'; |
|
| 4910 | 4910 | } else { |
| 4911 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">'; |
|
| 4911 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">'; |
|
| 4912 | 4912 | } |
| 4913 | 4913 | $out .= trim($obj->label); |
| 4914 | 4914 | if ($showcurrency) { |
| 4915 | - $out .= ' (' . $obj->currency_code . ')'; |
|
| 4915 | + $out .= ' ('.$obj->currency_code.')'; |
|
| 4916 | 4916 | } |
| 4917 | 4917 | if ($status == 2 && $obj->status == 1) { |
| 4918 | - $out .= ' (' . $langs->trans("Closed") . ')'; |
|
| 4918 | + $out .= ' ('.$langs->trans("Closed").')'; |
|
| 4919 | 4919 | } |
| 4920 | 4920 | $out .= '</option>'; |
| 4921 | 4921 | $i++; |
| 4922 | 4922 | } |
| 4923 | 4923 | $out .= "</select>"; |
| 4924 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 4924 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 4925 | 4925 | } else { |
| 4926 | 4926 | if ($status == 0) { |
| 4927 | - $out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>'; |
|
| 4927 | + $out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>'; |
|
| 4928 | 4928 | } else { |
| 4929 | - $out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>'; |
|
| 4929 | + $out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>'; |
|
| 4930 | 4930 | } |
| 4931 | 4931 | } |
| 4932 | 4932 | } else { |
@@ -4962,23 +4962,23 @@ discard block |
||
| 4962 | 4962 | $num = 0; |
| 4963 | 4963 | |
| 4964 | 4964 | $sql = "SELECT rowid, name, fk_country, status, entity"; |
| 4965 | - $sql .= " FROM " . $this->db->prefix() . "establishment"; |
|
| 4965 | + $sql .= " FROM ".$this->db->prefix()."establishment"; |
|
| 4966 | 4966 | $sql .= " WHERE 1=1"; |
| 4967 | 4967 | if ($status != 2) { |
| 4968 | - $sql .= " AND status = " . (int) $status; |
|
| 4968 | + $sql .= " AND status = ".(int) $status; |
|
| 4969 | 4969 | } |
| 4970 | 4970 | if ($filtre) { |
| 4971 | - $sql .= " AND " . $filtre; |
|
| 4971 | + $sql .= " AND ".$filtre; |
|
| 4972 | 4972 | } |
| 4973 | 4973 | $sql .= " ORDER BY name"; |
| 4974 | 4974 | |
| 4975 | - dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG); |
|
| 4975 | + dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG); |
|
| 4976 | 4976 | $result = $this->db->query($sql); |
| 4977 | 4977 | if ($result) { |
| 4978 | 4978 | $num = $this->db->num_rows($result); |
| 4979 | 4979 | $i = 0; |
| 4980 | 4980 | if ($num) { |
| 4981 | - print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 4981 | + print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 4982 | 4982 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 4983 | 4983 | print '<option value="-1"> </option>'; |
| 4984 | 4984 | } |
@@ -4986,13 +4986,13 @@ discard block |
||
| 4986 | 4986 | while ($i < $num) { |
| 4987 | 4987 | $obj = $this->db->fetch_object($result); |
| 4988 | 4988 | if ($selected == $obj->rowid) { |
| 4989 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 4989 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 4990 | 4990 | } else { |
| 4991 | - print '<option value="' . $obj->rowid . '">'; |
|
| 4991 | + print '<option value="'.$obj->rowid.'">'; |
|
| 4992 | 4992 | } |
| 4993 | 4993 | print trim($obj->name); |
| 4994 | 4994 | if ($status == 2 && $obj->status == 1) { |
| 4995 | - print ' (' . $langs->trans("Closed") . ')'; |
|
| 4995 | + print ' ('.$langs->trans("Closed").')'; |
|
| 4996 | 4996 | } |
| 4997 | 4997 | print '</option>'; |
| 4998 | 4998 | $i++; |
@@ -5000,9 +5000,9 @@ discard block |
||
| 5000 | 5000 | print "</select>"; |
| 5001 | 5001 | } else { |
| 5002 | 5002 | if ($status == 0) { |
| 5003 | - print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>'; |
|
| 5003 | + print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>'; |
|
| 5004 | 5004 | } else { |
| 5005 | - print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>'; |
|
| 5005 | + print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>'; |
|
| 5006 | 5006 | } |
| 5007 | 5007 | } |
| 5008 | 5008 | |
@@ -5026,20 +5026,20 @@ discard block |
||
| 5026 | 5026 | { |
| 5027 | 5027 | global $langs; |
| 5028 | 5028 | if ($htmlname != "none") { |
| 5029 | - print '<form method="POST" action="' . $page . '">'; |
|
| 5029 | + print '<form method="POST" action="'.$page.'">'; |
|
| 5030 | 5030 | print '<input type="hidden" name="action" value="setbankaccount">'; |
| 5031 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5031 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5032 | 5032 | print img_picto('', 'bank_account', 'class="pictofixedwidth"'); |
| 5033 | 5033 | $nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty); |
| 5034 | 5034 | if ($nbaccountfound > 0) { |
| 5035 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5035 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5036 | 5036 | } |
| 5037 | 5037 | print '</form>'; |
| 5038 | 5038 | } else { |
| 5039 | 5039 | $langs->load('banks'); |
| 5040 | 5040 | |
| 5041 | 5041 | if ($selected) { |
| 5042 | - require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
| 5042 | + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
| 5043 | 5043 | $bankstatic = new Account($this->db); |
| 5044 | 5044 | $result = $bankstatic->fetch($selected); |
| 5045 | 5045 | if ($result) { |
@@ -5077,19 +5077,19 @@ discard block |
||
| 5077 | 5077 | global $conf, $langs; |
| 5078 | 5078 | $langs->load("categories"); |
| 5079 | 5079 | |
| 5080 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 5080 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 5081 | 5081 | |
| 5082 | 5082 | // For backward compatibility |
| 5083 | 5083 | if (is_numeric($type)) { |
| 5084 | - dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
| 5084 | + dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
| 5085 | 5085 | } |
| 5086 | 5086 | |
| 5087 | 5087 | if ($type === Categorie::TYPE_BANK_LINE) { |
| 5088 | 5088 | // TODO Move this into common category feature |
| 5089 | 5089 | $cate_arbo = array(); |
| 5090 | 5090 | $sql = "SELECT c.label, c.rowid"; |
| 5091 | - $sql .= " FROM " . $this->db->prefix() . "bank_categ as c"; |
|
| 5092 | - $sql .= " WHERE entity = " . $conf->entity; |
|
| 5091 | + $sql .= " FROM ".$this->db->prefix()."bank_categ as c"; |
|
| 5092 | + $sql .= " WHERE entity = ".$conf->entity; |
|
| 5093 | 5093 | $sql .= " ORDER BY c.label"; |
| 5094 | 5094 | $result = $this->db->query($sql); |
| 5095 | 5095 | if ($result) { |
@@ -5114,10 +5114,10 @@ discard block |
||
| 5114 | 5114 | $outarray = array(); |
| 5115 | 5115 | $outarrayrichhtml = array(); |
| 5116 | 5116 | |
| 5117 | - $output = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 5117 | + $output = '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 5118 | 5118 | if (is_array($cate_arbo)) { |
| 5119 | 5119 | if (!count($cate_arbo)) { |
| 5120 | - $output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>'; |
|
| 5120 | + $output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>'; |
|
| 5121 | 5121 | } else { |
| 5122 | 5122 | $output .= '<option value="-1"> </option>'; |
| 5123 | 5123 | foreach ($cate_arbo as $key => $value) { |
@@ -5127,15 +5127,15 @@ discard block |
||
| 5127 | 5127 | $add = ''; |
| 5128 | 5128 | } |
| 5129 | 5129 | |
| 5130 | - $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"'); |
|
| 5130 | + $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"'); |
|
| 5131 | 5131 | $labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
| 5132 | 5132 | |
| 5133 | 5133 | $outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel']; |
| 5134 | 5134 | |
| 5135 | 5135 | $outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow; |
| 5136 | 5136 | |
| 5137 | - $output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"'; |
|
| 5138 | - $output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"'; |
|
| 5137 | + $output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"'; |
|
| 5138 | + $output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"'; |
|
| 5139 | 5139 | $output .= '>'; |
| 5140 | 5140 | $output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
| 5141 | 5141 | $output .= '</option>'; |
@@ -5176,7 +5176,7 @@ discard block |
||
| 5176 | 5176 | public function form_confirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = "", $useajax = 0, $height = 170, $width = 500) |
| 5177 | 5177 | { |
| 5178 | 5178 | // phpcs:enable |
| 5179 | - dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
| 5179 | + dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
| 5180 | 5180 | print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width); |
| 5181 | 5181 | } |
| 5182 | 5182 | |
@@ -5211,7 +5211,7 @@ discard block |
||
| 5211 | 5211 | { |
| 5212 | 5212 | global $langs, $conf; |
| 5213 | 5213 | |
| 5214 | - $more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->'; |
|
| 5214 | + $more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->'; |
|
| 5215 | 5215 | $formconfirm = ''; |
| 5216 | 5216 | $inputok = array(); |
| 5217 | 5217 | $inputko = array(); |
@@ -5235,27 +5235,27 @@ discard block |
||
| 5235 | 5235 | foreach ($formquestion as $key => $input) { |
| 5236 | 5236 | if (is_array($input) && !empty($input)) { |
| 5237 | 5237 | if ($input['type'] == 'hidden') { |
| 5238 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
| 5239 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
| 5238 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
| 5239 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
| 5240 | 5240 | |
| 5241 | - $more .= '<input type="hidden" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '" value="' . dol_escape_htmltag($input['value']) . '" class="' . $morecss . '"' . $moreattr . '>' . "\n"; |
|
| 5241 | + $more .= '<input type="hidden" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'" value="'.dol_escape_htmltag($input['value']).'" class="'.$morecss.'"'.$moreattr.'>'."\n"; |
|
| 5242 | 5242 | } |
| 5243 | 5243 | } |
| 5244 | 5244 | } |
| 5245 | 5245 | |
| 5246 | 5246 | // Now add questions |
| 5247 | 5247 | $moreonecolumn = ''; |
| 5248 | - $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n"; |
|
| 5248 | + $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n"; |
|
| 5249 | 5249 | foreach ($formquestion as $key => $input) { |
| 5250 | 5250 | if (is_array($input) && !empty($input)) { |
| 5251 | - $size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : ''); // deprecated. Use morecss instead. |
|
| 5252 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
| 5253 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
| 5251 | + $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead. |
|
| 5252 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
| 5253 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
| 5254 | 5254 | |
| 5255 | 5255 | if ($input['type'] == 'text') { |
| 5256 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div><div class="tagtd"><input type="text" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $size . ' value="' . (empty($input['value']) ? '' : $input['value']) . '"' . $moreattr . ' /></div></div>' . "\n"; |
|
| 5256 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n"; |
|
| 5257 | 5257 | } elseif ($input['type'] == 'password') { |
| 5258 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div><div class="tagtd"><input type="password" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $size . ' value="' . (empty($input['value']) ? '' : $input['value']) . '"' . $moreattr . ' /></div></div>' . "\n"; |
|
| 5258 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n"; |
|
| 5259 | 5259 | } elseif ($input['type'] == 'textarea') { |
| 5260 | 5260 | /*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">'; |
| 5261 | 5261 | $more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>'; |
@@ -5263,8 +5263,8 @@ discard block |
||
| 5263 | 5263 | $more .= '</textarea>'; |
| 5264 | 5264 | $more .= '</div></div>'."\n";*/ |
| 5265 | 5265 | $moreonecolumn .= '<div class="margintoponly">'; |
| 5266 | - $moreonecolumn .= $input['label'] . '<br>'; |
|
| 5267 | - $moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>'; |
|
| 5266 | + $moreonecolumn .= $input['label'].'<br>'; |
|
| 5267 | + $moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>'; |
|
| 5268 | 5268 | $moreonecolumn .= $input['value']; |
| 5269 | 5269 | $moreonecolumn .= '</textarea>'; |
| 5270 | 5270 | $moreonecolumn .= '</div>'; |
@@ -5281,20 +5281,20 @@ discard block |
||
| 5281 | 5281 | $disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0; |
| 5282 | 5282 | $sort = isset($input['select_sort']) ? $input['select_sort'] : ''; |
| 5283 | 5283 | |
| 5284 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">'; |
|
| 5284 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
|
| 5285 | 5285 | if (!empty($input['label'])) { |
| 5286 | - $more .= $input['label'] . '</div><div class="tagtd left">'; |
|
| 5286 | + $more .= $input['label'].'</div><div class="tagtd left">'; |
|
| 5287 | 5287 | } |
| 5288 | 5288 | if ($input['type'] == 'select') { |
| 5289 | 5289 | $more .= $this->selectarray($input['name'], $input['values'], isset($input['default']) ? $input['default'] : '-1', $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss); |
| 5290 | 5290 | } else { |
| 5291 | 5291 | $more .= $this->multiselectarray($input['name'], $input['values'], is_array($input['default']) ? $input['default'] : [$input['default']], $key_in_label, $value_as_key, $morecss, $translate, $maxlen, $moreattr); |
| 5292 | 5292 | } |
| 5293 | - $more .= '</div></div>' . "\n"; |
|
| 5293 | + $more .= '</div></div>'."\n"; |
|
| 5294 | 5294 | } elseif ($input['type'] == 'checkbox') { |
| 5295 | 5295 | $more .= '<div class="tagtr">'; |
| 5296 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">'; |
|
| 5297 | - $more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr; |
|
| 5296 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">'; |
|
| 5297 | + $more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr; |
|
| 5298 | 5298 | if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') { |
| 5299 | 5299 | $more .= ' checked'; |
| 5300 | 5300 | } |
@@ -5305,19 +5305,19 @@ discard block |
||
| 5305 | 5305 | $more .= ' disabled'; |
| 5306 | 5306 | } |
| 5307 | 5307 | $more .= ' /></div>'; |
| 5308 | - $more .= '</div>' . "\n"; |
|
| 5308 | + $more .= '</div>'."\n"; |
|
| 5309 | 5309 | } elseif ($input['type'] == 'radio') { |
| 5310 | 5310 | $i = 0; |
| 5311 | 5311 | foreach ($input['values'] as $selkey => $selval) { |
| 5312 | 5312 | $more .= '<div class="tagtr">'; |
| 5313 | 5313 | if (isset($input['label'])) { |
| 5314 | 5314 | if ($i == 0) { |
| 5315 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
| 5315 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
| 5316 | 5316 | } else { |
| 5317 | - $more .= '<div clas="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '"> </div>'; |
|
| 5317 | + $more .= '<div clas="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'"> </div>'; |
|
| 5318 | 5318 | } |
| 5319 | 5319 | } |
| 5320 | - $more .= '<div class="tagtd' . ($i == 0 ? ' tdtop' : '') . '"><input type="radio" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name'] . $selkey) . '" name="' . dol_escape_htmltag($input['name']) . '" value="' . $selkey . '"' . $moreattr; |
|
| 5320 | + $more .= '<div class="tagtd'.($i == 0 ? ' tdtop' : '').'"><input type="radio" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name'].$selkey).'" name="'.dol_escape_htmltag($input['name']).'" value="'.$selkey.'"'.$moreattr; |
|
| 5321 | 5321 | if (!empty($input['disabled'])) { |
| 5322 | 5322 | $more .= ' disabled'; |
| 5323 | 5323 | } |
@@ -5325,12 +5325,12 @@ discard block |
||
| 5325 | 5325 | $more .= ' checked="checked"'; |
| 5326 | 5326 | } |
| 5327 | 5327 | $more .= ' /> '; |
| 5328 | - $more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>'; |
|
| 5329 | - $more .= '</div></div>' . "\n"; |
|
| 5328 | + $more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>'; |
|
| 5329 | + $more .= '</div></div>'."\n"; |
|
| 5330 | 5330 | $i++; |
| 5331 | 5331 | } |
| 5332 | 5332 | } elseif ($input['type'] == 'date' || $input['type'] == 'datetime') { |
| 5333 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
| 5333 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
| 5334 | 5334 | $more .= '<div class="tagtd">'; |
| 5335 | 5335 | $addnowlink = (empty($input['datenow']) ? 0 : 1); |
| 5336 | 5336 | $h = $m = 0; |
@@ -5348,24 +5348,24 @@ discard block |
||
| 5348 | 5348 | } elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not |
| 5349 | 5349 | $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
| 5350 | 5350 | if (!empty($input['label'])) { |
| 5351 | - $more .= $input['label'] . '</div><div class="tagtd">'; |
|
| 5351 | + $more .= $input['label'].'</div><div class="tagtd">'; |
|
| 5352 | 5352 | } |
| 5353 | 5353 | $more .= $input['value']; |
| 5354 | - $more .= '</div></div>' . "\n"; |
|
| 5354 | + $more .= '</div></div>'."\n"; |
|
| 5355 | 5355 | } elseif ($input['type'] == 'onecolumn') { |
| 5356 | 5356 | $moreonecolumn .= '<div class="margintoponly">'; |
| 5357 | 5357 | $moreonecolumn .= $input['value']; |
| 5358 | - $moreonecolumn .= '</div>' . "\n"; |
|
| 5358 | + $moreonecolumn .= '</div>'."\n"; |
|
| 5359 | 5359 | } elseif ($input['type'] == 'hidden') { |
| 5360 | 5360 | // Do nothing more, already added by a previous loop |
| 5361 | 5361 | } elseif ($input['type'] == 'separator') { |
| 5362 | 5362 | $more .= '<br>'; |
| 5363 | 5363 | } else { |
| 5364 | - $more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type'; |
|
| 5364 | + $more .= 'Error type '.$input['type'].' for the confirm box is not a supported type'; |
|
| 5365 | 5365 | } |
| 5366 | 5366 | } |
| 5367 | 5367 | } |
| 5368 | - $more .= '</div>' . "\n"; |
|
| 5368 | + $more .= '</div>'."\n"; |
|
| 5369 | 5369 | $more .= $moreonecolumn; |
| 5370 | 5370 | } |
| 5371 | 5371 | |
@@ -5387,10 +5387,10 @@ discard block |
||
| 5387 | 5387 | $button = $useajax; |
| 5388 | 5388 | $useajax = 1; |
| 5389 | 5389 | $autoOpen = false; |
| 5390 | - $dialogconfirm .= '-' . $button; |
|
| 5390 | + $dialogconfirm .= '-'.$button; |
|
| 5391 | 5391 | } |
| 5392 | - $pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes'; |
|
| 5393 | - $pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : ''); |
|
| 5392 | + $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes'; |
|
| 5393 | + $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : ''); |
|
| 5394 | 5394 | |
| 5395 | 5395 | // Add input fields into list of fields to read during submit (inputok and inputko) |
| 5396 | 5396 | if (is_array($formquestion)) { |
@@ -5412,24 +5412,24 @@ discard block |
||
| 5412 | 5412 | } |
| 5413 | 5413 | |
| 5414 | 5414 | // Show JQuery confirm box. |
| 5415 | - $formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">'; |
|
| 5415 | + $formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">'; |
|
| 5416 | 5416 | if (is_array($formquestion) && !empty($formquestion['text'])) { |
| 5417 | - $formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n"; |
|
| 5417 | + $formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n"; |
|
| 5418 | 5418 | } |
| 5419 | 5419 | if (!empty($more)) { |
| 5420 | - $formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n"; |
|
| 5420 | + $formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n"; |
|
| 5421 | 5421 | } |
| 5422 | - $formconfirm .= ($question ? '<div class="confirmmessage">' . img_help('', '') . ' ' . $question . '</div>' : ''); |
|
| 5423 | - $formconfirm .= '</div>' . "\n"; |
|
| 5422 | + $formconfirm .= ($question ? '<div class="confirmmessage">'.img_help('', '').' '.$question.'</div>' : ''); |
|
| 5423 | + $formconfirm .= '</div>'."\n"; |
|
| 5424 | 5424 | |
| 5425 | - $formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n"; |
|
| 5426 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
| 5425 | + $formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n"; |
|
| 5426 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
| 5427 | 5427 | $formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n"; |
| 5428 | 5428 | $formconfirm .= 'jQuery(document).ready(function() { |
| 5429 | 5429 | $(function() { |
| 5430 | - $( "#' . $dialogconfirm . '" ).dialog( |
|
| 5430 | + $( "#' . $dialogconfirm.'" ).dialog( |
|
| 5431 | 5431 | { |
| 5432 | - autoOpen: ' . ($autoOpen ? "true" : "false") . ','; |
|
| 5432 | + autoOpen: ' . ($autoOpen ? "true" : "false").','; |
|
| 5433 | 5433 | if ($newselectedchoice == 'no') { |
| 5434 | 5434 | $formconfirm .= ' |
| 5435 | 5435 | open: function() { |
@@ -5439,24 +5439,24 @@ discard block |
||
| 5439 | 5439 | |
| 5440 | 5440 | $jsforcursor = ''; |
| 5441 | 5441 | if ($useajax == 1) { |
| 5442 | - $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n"; |
|
| 5443 | - $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n"; |
|
| 5442 | + $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n"; |
|
| 5443 | + $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n"; |
|
| 5444 | 5444 | } |
| 5445 | 5445 | |
| 5446 | 5446 | $postconfirmas = 'GET'; |
| 5447 | 5447 | |
| 5448 | 5448 | $formconfirm .= ' |
| 5449 | 5449 | resizable: false, |
| 5450 | - height: "' . $height . '", |
|
| 5451 | - width: "' . $width . '", |
|
| 5450 | + height: "' . $height.'", |
|
| 5451 | + width: "' . $width.'", |
|
| 5452 | 5452 | modal: true, |
| 5453 | 5453 | closeOnEscape: false, |
| 5454 | 5454 | buttons: { |
| 5455 | - "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() { |
|
| 5456 | - var options = "token=' . urlencode(newToken()) . '"; |
|
| 5457 | - var inputok = ' . json_encode($inputok) . '; /* List of fields into form */ |
|
| 5458 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
| 5459 | - var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '"; |
|
| 5455 | + "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() { |
|
| 5456 | + var options = "token=' . urlencode(newToken()).'"; |
|
| 5457 | + var inputok = ' . json_encode($inputok).'; /* List of fields into form */ |
|
| 5458 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
| 5459 | + var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; |
|
| 5460 | 5460 | |
| 5461 | 5461 | if (inputok.length > 0) { |
| 5462 | 5462 | $.each(inputok, function(i, inputname) { |
@@ -5490,11 +5490,11 @@ discard block |
||
| 5490 | 5490 | } |
| 5491 | 5491 | $(this).dialog("close"); |
| 5492 | 5492 | }, |
| 5493 | - "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() { |
|
| 5494 | - var options = "token=' . urlencode(newToken()) . '"; |
|
| 5495 | - var inputko = ' . json_encode($inputko) . '; /* List of fields into form */ |
|
| 5496 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
| 5497 | - var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '"; |
|
| 5493 | + "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() { |
|
| 5494 | + var options = "token=' . urlencode(newToken()).'"; |
|
| 5495 | + var inputko = ' . json_encode($inputko).'; /* List of fields into form */ |
|
| 5496 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
| 5497 | + var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'"; |
|
| 5498 | 5498 | if (inputko.length > 0) { |
| 5499 | 5499 | $.each(inputko, function(i, inputname) { |
| 5500 | 5500 | var more = ""; |
@@ -5526,10 +5526,10 @@ discard block |
||
| 5526 | 5526 | } |
| 5527 | 5527 | ); |
| 5528 | 5528 | |
| 5529 | - var button = "' . $button . '"; |
|
| 5529 | + var button = "' . $button.'"; |
|
| 5530 | 5530 | if (button.length > 0) { |
| 5531 | 5531 | $( "#" + button ).click(function() { |
| 5532 | - $("#' . $dialogconfirm . '").dialog("open"); |
|
| 5532 | + $("#' . $dialogconfirm.'").dialog("open"); |
|
| 5533 | 5533 | }); |
| 5534 | 5534 | } |
| 5535 | 5535 | }); |
@@ -5537,44 +5537,44 @@ discard block |
||
| 5537 | 5537 | </script>'; |
| 5538 | 5538 | $formconfirm .= "<!-- end ajax formconfirm -->\n"; |
| 5539 | 5539 | } else { |
| 5540 | - $formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n"; |
|
| 5540 | + $formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n"; |
|
| 5541 | 5541 | |
| 5542 | 5542 | if (empty($disableformtag)) { |
| 5543 | - $formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n"; |
|
| 5543 | + $formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n"; |
|
| 5544 | 5544 | } |
| 5545 | 5545 | |
| 5546 | - $formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n"; |
|
| 5547 | - $formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n"; |
|
| 5546 | + $formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n"; |
|
| 5547 | + $formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n"; |
|
| 5548 | 5548 | |
| 5549 | - $formconfirm .= '<table class="valid centpercent">' . "\n"; |
|
| 5549 | + $formconfirm .= '<table class="valid centpercent">'."\n"; |
|
| 5550 | 5550 | |
| 5551 | 5551 | // Line title |
| 5552 | 5552 | $formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">'; |
| 5553 | - $formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title; |
|
| 5554 | - $formconfirm .= '</td></tr>' . "\n"; |
|
| 5553 | + $formconfirm .= img_picto('', 'pictoconfirm').' '.$title; |
|
| 5554 | + $formconfirm .= '</td></tr>'."\n"; |
|
| 5555 | 5555 | |
| 5556 | 5556 | // Line text |
| 5557 | 5557 | if (is_array($formquestion) && !empty($formquestion['text'])) { |
| 5558 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n"; |
|
| 5558 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n"; |
|
| 5559 | 5559 | } |
| 5560 | 5560 | |
| 5561 | 5561 | // Line form fields |
| 5562 | 5562 | if ($more) { |
| 5563 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n"; |
|
| 5563 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n"; |
|
| 5564 | 5564 | $formconfirm .= $more; |
| 5565 | - $formconfirm .= '</td></tr>' . "\n"; |
|
| 5565 | + $formconfirm .= '</td></tr>'."\n"; |
|
| 5566 | 5566 | } |
| 5567 | 5567 | |
| 5568 | 5568 | // Line with question |
| 5569 | 5569 | $formconfirm .= '<tr class="valid">'; |
| 5570 | - $formconfirm .= '<td class="valid">' . $question . '</td>'; |
|
| 5570 | + $formconfirm .= '<td class="valid">'.$question.'</td>'; |
|
| 5571 | 5571 | $formconfirm .= '<td class="valid center">'; |
| 5572 | 5572 | $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno); |
| 5573 | - $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">'; |
|
| 5573 | + $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">'; |
|
| 5574 | 5574 | $formconfirm .= '</td>'; |
| 5575 | - $formconfirm .= '</tr>' . "\n"; |
|
| 5575 | + $formconfirm .= '</tr>'."\n"; |
|
| 5576 | 5576 | |
| 5577 | - $formconfirm .= '</table>' . "\n"; |
|
| 5577 | + $formconfirm .= '</table>'."\n"; |
|
| 5578 | 5578 | |
| 5579 | 5579 | if (empty($disableformtag)) { |
| 5580 | 5580 | $formconfirm .= "</form>\n"; |
@@ -5583,7 +5583,7 @@ discard block |
||
| 5583 | 5583 | |
| 5584 | 5584 | if (!empty($conf->use_javascript_ajax)) { |
| 5585 | 5585 | $formconfirm .= '<!-- code to disable button to avoid double clic -->'; |
| 5586 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
| 5586 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
| 5587 | 5587 | $formconfirm .= ' |
| 5588 | 5588 | $(document).ready(function () { |
| 5589 | 5589 | $(".confirmvalidatebutton").on("click", function() { |
@@ -5595,7 +5595,7 @@ discard block |
||
| 5595 | 5595 | }); |
| 5596 | 5596 | }); |
| 5597 | 5597 | '; |
| 5598 | - $formconfirm .= '</script>' . "\n"; |
|
| 5598 | + $formconfirm .= '</script>'."\n"; |
|
| 5599 | 5599 | } |
| 5600 | 5600 | |
| 5601 | 5601 | $formconfirm .= "<!-- end formconfirm -->\n"; |
@@ -5627,8 +5627,8 @@ discard block |
||
| 5627 | 5627 | // phpcs:enable |
| 5628 | 5628 | global $langs; |
| 5629 | 5629 | |
| 5630 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 5631 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 5630 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 5631 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 5632 | 5632 | |
| 5633 | 5633 | $out = ''; |
| 5634 | 5634 | |
@@ -5636,11 +5636,11 @@ discard block |
||
| 5636 | 5636 | |
| 5637 | 5637 | $langs->load("project"); |
| 5638 | 5638 | if ($htmlname != "none") { |
| 5639 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 5639 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 5640 | 5640 | $out .= '<input type="hidden" name="action" value="classin">'; |
| 5641 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5641 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5642 | 5642 | $out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss); |
| 5643 | - $out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5643 | + $out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5644 | 5644 | $out .= '</form>'; |
| 5645 | 5645 | } else { |
| 5646 | 5646 | $out .= '<span class="project_head_block">'; |
@@ -5649,7 +5649,7 @@ discard block |
||
| 5649 | 5649 | $projet->fetch($selected); |
| 5650 | 5650 | $out .= $projet->getNomUrl(0, '', 1); |
| 5651 | 5651 | } else { |
| 5652 | - $out .= '<span class="opacitymedium">' . $textifnoproject . '</span>'; |
|
| 5652 | + $out .= '<span class="opacitymedium">'.$textifnoproject.'</span>'; |
|
| 5653 | 5653 | } |
| 5654 | 5654 | $out .= '</span>'; |
| 5655 | 5655 | } |
@@ -5686,14 +5686,14 @@ discard block |
||
| 5686 | 5686 | $out = ''; |
| 5687 | 5687 | |
| 5688 | 5688 | if ($htmlname != "none") { |
| 5689 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
| 5689 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
| 5690 | 5690 | $out .= '<input type="hidden" name="action" value="setconditions">'; |
| 5691 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5691 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5692 | 5692 | if ($type) { |
| 5693 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 5693 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 5694 | 5694 | } |
| 5695 | 5695 | $out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); |
| 5696 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5696 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5697 | 5697 | $out .= '</form>'; |
| 5698 | 5698 | } else { |
| 5699 | 5699 | if ($selected) { |
@@ -5738,12 +5738,12 @@ discard block |
||
| 5738 | 5738 | // phpcs:enable |
| 5739 | 5739 | global $langs; |
| 5740 | 5740 | if ($htmlname != "none") { |
| 5741 | - print '<form method="post" action="' . $page . '">'; |
|
| 5741 | + print '<form method="post" action="'.$page.'">'; |
|
| 5742 | 5742 | print '<input type="hidden" name="action" value="setavailability">'; |
| 5743 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5743 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5744 | 5744 | $this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty); |
| 5745 | - print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5746 | - print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">'; |
|
| 5745 | + print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5746 | + print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">'; |
|
| 5747 | 5747 | print '</form>'; |
| 5748 | 5748 | } else { |
| 5749 | 5749 | if ($selected) { |
@@ -5769,11 +5769,11 @@ discard block |
||
| 5769 | 5769 | { |
| 5770 | 5770 | global $langs; |
| 5771 | 5771 | if ($htmlname != "none") { |
| 5772 | - print '<form method="post" action="' . $page . '">'; |
|
| 5772 | + print '<form method="post" action="'.$page.'">'; |
|
| 5773 | 5773 | print '<input type="hidden" name="action" value="setdemandreason">'; |
| 5774 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5774 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5775 | 5775 | $this->selectInputReason($selected, $htmlname, -1, $addempty); |
| 5776 | - print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5776 | + print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5777 | 5777 | print '</form>'; |
| 5778 | 5778 | } else { |
| 5779 | 5779 | if ($selected) { |
@@ -5813,17 +5813,17 @@ discard block |
||
| 5813 | 5813 | $ret = ''; |
| 5814 | 5814 | |
| 5815 | 5815 | if ($htmlname != "none") { |
| 5816 | - $ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
| 5817 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 5818 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5816 | + $ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
| 5817 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 5818 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5819 | 5819 | if ($type) { |
| 5820 | - $ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 5820 | + $ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 5821 | 5821 | } |
| 5822 | 5822 | $ret .= '<table class="nobordernopadding">'; |
| 5823 | 5823 | $ret .= '<tr><td>'; |
| 5824 | - $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0); |
|
| 5824 | + $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0); |
|
| 5825 | 5825 | $ret .= '</td>'; |
| 5826 | - $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 5826 | + $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
| 5827 | 5827 | $ret .= '</tr></table></form>'; |
| 5828 | 5828 | } else { |
| 5829 | 5829 | if ($displayhour) { |
@@ -5858,15 +5858,15 @@ discard block |
||
| 5858 | 5858 | global $langs; |
| 5859 | 5859 | |
| 5860 | 5860 | if ($htmlname != "none") { |
| 5861 | - print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
| 5862 | - print '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 5863 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5861 | + print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
| 5862 | + print '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 5863 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5864 | 5864 | print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include); |
| 5865 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5865 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5866 | 5866 | print '</form>'; |
| 5867 | 5867 | } else { |
| 5868 | 5868 | if ($selected) { |
| 5869 | - require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
| 5869 | + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
| 5870 | 5870 | $theuser = new User($this->db); |
| 5871 | 5871 | $theuser->fetch($selected); |
| 5872 | 5872 | print $theuser->getNomUrl(1); |
@@ -5899,14 +5899,14 @@ discard block |
||
| 5899 | 5899 | |
| 5900 | 5900 | $out = ''; |
| 5901 | 5901 | if ($htmlname != "none") { |
| 5902 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
| 5902 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
| 5903 | 5903 | $out .= '<input type="hidden" name="action" value="setmode">'; |
| 5904 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5904 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5905 | 5905 | if ($type) { |
| 5906 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 5906 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 5907 | 5907 | } |
| 5908 | 5908 | $out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); |
| 5909 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5909 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5910 | 5910 | $out .= '</form>'; |
| 5911 | 5911 | } else { |
| 5912 | 5912 | if ($selected) { |
@@ -5939,11 +5939,11 @@ discard block |
||
| 5939 | 5939 | { |
| 5940 | 5940 | global $langs; |
| 5941 | 5941 | if ($htmlname != "none") { |
| 5942 | - print '<form method="POST" action="' . $page . '">'; |
|
| 5942 | + print '<form method="POST" action="'.$page.'">'; |
|
| 5943 | 5943 | print '<input type="hidden" name="action" value="settransportmode">'; |
| 5944 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5944 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5945 | 5945 | $this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active); |
| 5946 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5946 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5947 | 5947 | print '</form>'; |
| 5948 | 5948 | } else { |
| 5949 | 5949 | if ($selected) { |
@@ -5970,11 +5970,11 @@ discard block |
||
| 5970 | 5970 | // phpcs:enable |
| 5971 | 5971 | global $langs; |
| 5972 | 5972 | if ($htmlname != "none") { |
| 5973 | - print '<form method="POST" action="' . $page . '">'; |
|
| 5973 | + print '<form method="POST" action="'.$page.'">'; |
|
| 5974 | 5974 | print '<input type="hidden" name="action" value="setmulticurrencycode">'; |
| 5975 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5975 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5976 | 5976 | print $this->selectMultiCurrency($selected, $htmlname, 0); |
| 5977 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5977 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5978 | 5978 | print '</form>'; |
| 5979 | 5979 | } else { |
| 5980 | 5980 | dol_include_once('/core/lib/company.lib.php'); |
@@ -5999,21 +5999,21 @@ discard block |
||
| 5999 | 5999 | global $langs, $mysoc, $conf; |
| 6000 | 6000 | |
| 6001 | 6001 | if ($htmlname != "none") { |
| 6002 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6002 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6003 | 6003 | print '<input type="hidden" name="action" value="setmulticurrencyrate">'; |
| 6004 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6005 | - print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> '; |
|
| 6004 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6005 | + print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> '; |
|
| 6006 | 6006 | print '<select name="calculation_mode">'; |
| 6007 | - print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>'; |
|
| 6008 | - print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>'; |
|
| 6007 | + print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>'; |
|
| 6008 | + print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>'; |
|
| 6009 | 6009 | print '</select> '; |
| 6010 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6010 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6011 | 6011 | print '</form>'; |
| 6012 | 6012 | } else { |
| 6013 | 6013 | if (!empty($rate)) { |
| 6014 | 6014 | print price($rate, 1, $langs, 1, 0); |
| 6015 | 6015 | if ($currency && $rate != 1) { |
| 6016 | - print ' (' . price($rate, 1, $langs, 1, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')'; |
|
| 6016 | + print ' ('.price($rate, 1, $langs, 1, 0).' '.$currency.' = 1 '.$conf->currency.')'; |
|
| 6017 | 6017 | } |
| 6018 | 6018 | } else { |
| 6019 | 6019 | print 1; |
@@ -6044,9 +6044,9 @@ discard block |
||
| 6044 | 6044 | // phpcs:enable |
| 6045 | 6045 | global $conf, $langs; |
| 6046 | 6046 | if ($htmlname != "none") { |
| 6047 | - print '<form method="post" action="' . $page . '">'; |
|
| 6047 | + print '<form method="post" action="'.$page.'">'; |
|
| 6048 | 6048 | print '<input type="hidden" name="action" value="setabsolutediscount">'; |
| 6049 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6049 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6050 | 6050 | print '<div class="inline-block">'; |
| 6051 | 6051 | if (!empty($discount_type)) { |
| 6052 | 6052 | if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { |
@@ -6084,24 +6084,24 @@ discard block |
||
| 6084 | 6084 | print '</div>'; |
| 6085 | 6085 | if (empty($hidelist)) { |
| 6086 | 6086 | print '<div class="inline-block" style="padding-right: 10px">'; |
| 6087 | - $newfilter = 'discount_type=' . intval($discount_type); |
|
| 6087 | + $newfilter = 'discount_type='.intval($discount_type); |
|
| 6088 | 6088 | if (!empty($discount_type)) { |
| 6089 | 6089 | $newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available |
| 6090 | 6090 | } else { |
| 6091 | 6091 | $newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available |
| 6092 | 6092 | } |
| 6093 | 6093 | if ($filter) { |
| 6094 | - $newfilter .= ' AND (' . $filter . ')'; |
|
| 6094 | + $newfilter .= ' AND ('.$filter.')'; |
|
| 6095 | 6095 | } |
| 6096 | 6096 | // output the combo of discounts |
| 6097 | 6097 | $nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue); |
| 6098 | 6098 | if ($nbqualifiedlines > 0) { |
| 6099 | - print ' <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"'; |
|
| 6099 | + print ' <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"'; |
|
| 6100 | 6100 | if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") { |
| 6101 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
| 6101 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
| 6102 | 6102 | } |
| 6103 | 6103 | if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") { |
| 6104 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
| 6104 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
| 6105 | 6105 | } |
| 6106 | 6106 | |
| 6107 | 6107 | print '>'; |
@@ -6141,23 +6141,23 @@ discard block |
||
| 6141 | 6141 | global $langs, $conf; |
| 6142 | 6142 | |
| 6143 | 6143 | if ($htmlname != "none") { |
| 6144 | - print '<form method="post" action="' . $page . '">'; |
|
| 6144 | + print '<form method="post" action="'.$page.'">'; |
|
| 6145 | 6145 | print '<input type="hidden" name="action" value="set_contact">'; |
| 6146 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6146 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6147 | 6147 | print '<table class="nobordernopadding">'; |
| 6148 | 6148 | print '<tr><td>'; |
| 6149 | 6149 | print $this->selectcontacts($societe->id, $selected, $htmlname); |
| 6150 | 6150 | $num = $this->num; |
| 6151 | 6151 | if ($num == 0) { |
| 6152 | 6152 | $addcontact = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); |
| 6153 | - print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>'; |
|
| 6153 | + print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$addcontact.'</a>'; |
|
| 6154 | 6154 | } |
| 6155 | 6155 | print '</td>'; |
| 6156 | - print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 6156 | + print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
| 6157 | 6157 | print '</tr></table></form>'; |
| 6158 | 6158 | } else { |
| 6159 | 6159 | if ($selected) { |
| 6160 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 6160 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 6161 | 6161 | $contact = new Contact($this->db); |
| 6162 | 6162 | $contact->fetch($selected); |
| 6163 | 6163 | print $contact->getFullName($langs); |
@@ -6192,20 +6192,20 @@ discard block |
||
| 6192 | 6192 | |
| 6193 | 6193 | $out = ''; |
| 6194 | 6194 | if ($htmlname != "none") { |
| 6195 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 6195 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 6196 | 6196 | $out .= '<input type="hidden" name="action" value="set_thirdparty">'; |
| 6197 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6197 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6198 | 6198 | $out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids); |
| 6199 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6199 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6200 | 6200 | $out .= '</form>'; |
| 6201 | 6201 | } else { |
| 6202 | 6202 | if ($selected) { |
| 6203 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 6203 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 6204 | 6204 | $soc = new Societe($this->db); |
| 6205 | 6205 | $soc->fetch($selected); |
| 6206 | 6206 | $out .= $soc->getNomUrl(0, ''); |
| 6207 | 6207 | } else { |
| 6208 | - $out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>'; |
|
| 6208 | + $out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>'; |
|
| 6209 | 6209 | } |
| 6210 | 6210 | } |
| 6211 | 6211 | |
@@ -6255,22 +6255,22 @@ discard block |
||
| 6255 | 6255 | $selected = 'EUR'; // Pour compatibilite |
| 6256 | 6256 | } |
| 6257 | 6257 | |
| 6258 | - $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 6258 | + $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 6259 | 6259 | if ($useempty) { |
| 6260 | 6260 | $out .= '<option value="-1" selected></option>'; |
| 6261 | 6261 | } |
| 6262 | 6262 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
| 6263 | 6263 | $labeltoshow = $currency['label']; |
| 6264 | 6264 | if ($mode == 1) { |
| 6265 | - $labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>'; |
|
| 6265 | + $labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>'; |
|
| 6266 | 6266 | } else { |
| 6267 | - $labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>'; |
|
| 6267 | + $labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>'; |
|
| 6268 | 6268 | } |
| 6269 | 6269 | |
| 6270 | 6270 | if ($selected && $selected == $code_iso) { |
| 6271 | - $out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
| 6271 | + $out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
| 6272 | 6272 | } else { |
| 6273 | - $out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
| 6273 | + $out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
| 6274 | 6274 | } |
| 6275 | 6275 | $out .= $labeltoshow; |
| 6276 | 6276 | $out .= '</option>'; |
@@ -6281,7 +6281,7 @@ discard block |
||
| 6281 | 6281 | } |
| 6282 | 6282 | |
| 6283 | 6283 | // Make select dynamic |
| 6284 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 6284 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 6285 | 6285 | $out .= ajax_combobox($htmlname); |
| 6286 | 6286 | |
| 6287 | 6287 | return $out; |
@@ -6307,10 +6307,10 @@ discard block |
||
| 6307 | 6307 | |
| 6308 | 6308 | $TCurrency = array(); |
| 6309 | 6309 | |
| 6310 | - $sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency"; |
|
| 6311 | - $sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')"; |
|
| 6310 | + $sql = "SELECT code FROM ".$this->db->prefix()."multicurrency"; |
|
| 6311 | + $sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')"; |
|
| 6312 | 6312 | if ($filter) { |
| 6313 | - $sql .= " AND " . $filter; |
|
| 6313 | + $sql .= " AND ".$filter; |
|
| 6314 | 6314 | } |
| 6315 | 6315 | $resql = $this->db->query($sql); |
| 6316 | 6316 | if ($resql) { |
@@ -6320,7 +6320,7 @@ discard block |
||
| 6320 | 6320 | } |
| 6321 | 6321 | |
| 6322 | 6322 | $out = ''; |
| 6323 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 6323 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 6324 | 6324 | if ($useempty) { |
| 6325 | 6325 | $out .= '<option value=""> </option>'; |
| 6326 | 6326 | } |
@@ -6332,13 +6332,13 @@ discard block |
||
| 6332 | 6332 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
| 6333 | 6333 | if (isset($TCurrency[$code_iso])) { |
| 6334 | 6334 | if (!empty($selected) && $selected == $code_iso) { |
| 6335 | - $out .= '<option value="' . $code_iso . '" selected="selected">'; |
|
| 6335 | + $out .= '<option value="'.$code_iso.'" selected="selected">'; |
|
| 6336 | 6336 | } else { |
| 6337 | - $out .= '<option value="' . $code_iso . '">'; |
|
| 6337 | + $out .= '<option value="'.$code_iso.'">'; |
|
| 6338 | 6338 | } |
| 6339 | 6339 | |
| 6340 | 6340 | $out .= $currency['label']; |
| 6341 | - $out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')'; |
|
| 6341 | + $out .= ' ('.$langs->getCurrencySymbol($code_iso).')'; |
|
| 6342 | 6342 | $out .= '</option>'; |
| 6343 | 6343 | } |
| 6344 | 6344 | } |
@@ -6347,7 +6347,7 @@ discard block |
||
| 6347 | 6347 | $out .= '</select>'; |
| 6348 | 6348 | |
| 6349 | 6349 | // Make select dynamic |
| 6350 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 6350 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 6351 | 6351 | $out .= ajax_combobox($htmlname); |
| 6352 | 6352 | |
| 6353 | 6353 | return $out; |
@@ -6374,11 +6374,11 @@ discard block |
||
| 6374 | 6374 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 6375 | 6375 | |
| 6376 | 6376 | $sql = "SELECT DISTINCT t.rowid, t.code, t.taux, t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.recuperableonly"; |
| 6377 | - $sql .= " FROM " . $this->db->prefix() . "c_tva as t, " . $this->db->prefix() . "c_country as c"; |
|
| 6377 | + $sql .= " FROM ".$this->db->prefix()."c_tva as t, ".$this->db->prefix()."c_country as c"; |
|
| 6378 | 6378 | $sql .= " WHERE t.fk_pays = c.rowid"; |
| 6379 | 6379 | $sql .= " AND t.active > 0"; |
| 6380 | 6380 | $sql .= " AND t.entity IN (".getEntity('c_tva').")"; |
| 6381 | - $sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")"; |
|
| 6381 | + $sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")"; |
|
| 6382 | 6382 | $sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC"; |
| 6383 | 6383 | |
| 6384 | 6384 | $resql = $this->db->query($sql); |
@@ -6396,22 +6396,22 @@ discard block |
||
| 6396 | 6396 | $this->cache_vatrates[$i]['localtax2'] = $obj->localtax2; |
| 6397 | 6397 | $this->cache_vatrates[$i]['localtax2_type'] = $obj->localtax1_type; |
| 6398 | 6398 | |
| 6399 | - $this->cache_vatrates[$i]['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or * |
|
| 6400 | - $this->cache_vatrates[$i]['labelallrates'] = $obj->taux . '/' . ($obj->localtax1 ? $obj->localtax1 : '0') . '/' . ($obj->localtax2 ? $obj->localtax2 : '0') . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
| 6399 | + $this->cache_vatrates[$i]['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or * |
|
| 6400 | + $this->cache_vatrates[$i]['labelallrates'] = $obj->taux.'/'.($obj->localtax1 ? $obj->localtax1 : '0').'/'.($obj->localtax2 ? $obj->localtax2 : '0').($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
| 6401 | 6401 | $positiverates = ''; |
| 6402 | 6402 | if ($obj->taux) { |
| 6403 | - $positiverates .= ($positiverates ? '/' : '') . $obj->taux; |
|
| 6403 | + $positiverates .= ($positiverates ? '/' : '').$obj->taux; |
|
| 6404 | 6404 | } |
| 6405 | 6405 | if ($obj->localtax1) { |
| 6406 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax1; |
|
| 6406 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax1; |
|
| 6407 | 6407 | } |
| 6408 | 6408 | if ($obj->localtax2) { |
| 6409 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax2; |
|
| 6409 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax2; |
|
| 6410 | 6410 | } |
| 6411 | 6411 | if (empty($positiverates)) { |
| 6412 | 6412 | $positiverates = '0'; |
| 6413 | 6413 | } |
| 6414 | - $this->cache_vatrates[$i]['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
| 6414 | + $this->cache_vatrates[$i]['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
| 6415 | 6415 | } |
| 6416 | 6416 | |
| 6417 | 6417 | return $num; |
@@ -6429,7 +6429,7 @@ discard block |
||
| 6429 | 6429 | return -1; |
| 6430 | 6430 | } |
| 6431 | 6431 | } else { |
| 6432 | - $this->error = '<span class="error">' . $this->db->error() . '</span>'; |
|
| 6432 | + $this->error = '<span class="error">'.$this->db->error().'</span>'; |
|
| 6433 | 6433 | return -2; |
| 6434 | 6434 | } |
| 6435 | 6435 | } |
@@ -6481,9 +6481,9 @@ discard block |
||
| 6481 | 6481 | // Check parameters |
| 6482 | 6482 | if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) { |
| 6483 | 6483 | if ($societe_vendeuse->id == $mysoc->id) { |
| 6484 | - $return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>'; |
|
| 6484 | + $return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>'; |
|
| 6485 | 6485 | } else { |
| 6486 | - $return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>'; |
|
| 6486 | + $return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>'; |
|
| 6487 | 6487 | } |
| 6488 | 6488 | return $return; |
| 6489 | 6489 | } |
@@ -6495,25 +6495,25 @@ discard block |
||
| 6495 | 6495 | // Define list of countries to use to search VAT rates to show |
| 6496 | 6496 | // First we defined code_country to use to find list |
| 6497 | 6497 | if (is_object($societe_vendeuse)) { |
| 6498 | - $code_country = "'" . $societe_vendeuse->country_code . "'"; |
|
| 6498 | + $code_country = "'".$societe_vendeuse->country_code."'"; |
|
| 6499 | 6499 | } else { |
| 6500 | - $code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente |
|
| 6500 | + $code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente |
|
| 6501 | 6501 | } |
| 6502 | 6502 | if (!empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) { // If option to have vat for end customer for services is on |
| 6503 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 6503 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 6504 | 6504 | if (!isInEEC($societe_vendeuse) && (!is_object($societe_acheteuse) || (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()))) { |
| 6505 | 6505 | // We also add the buyer country code |
| 6506 | 6506 | if (is_numeric($type)) { |
| 6507 | 6507 | if ($type == 1) { // We know product is a service |
| 6508 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6508 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6509 | 6509 | } |
| 6510 | 6510 | } elseif (!$idprod) { // We don't know type of product |
| 6511 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6511 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6512 | 6512 | } else { |
| 6513 | 6513 | $prodstatic = new Product($this->db); |
| 6514 | 6514 | $prodstatic->fetch($idprod); |
| 6515 | 6515 | if ($prodstatic->type == Product::TYPE_SERVICE) { // We know product is a service |
| 6516 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6516 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6517 | 6517 | } |
| 6518 | 6518 | } |
| 6519 | 6519 | } |
@@ -6565,13 +6565,13 @@ discard block |
||
| 6565 | 6565 | // Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead |
| 6566 | 6566 | // of using supplier invoices (this is a very bad idea !) |
| 6567 | 6567 | if (empty($conf->global->EXPENSEREPORT_OVERRIDE_VAT)) { |
| 6568 | - $title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"'; |
|
| 6568 | + $title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"'; |
|
| 6569 | 6569 | $disabled = true; |
| 6570 | 6570 | } |
| 6571 | 6571 | } |
| 6572 | 6572 | |
| 6573 | 6573 | if (!$options_only) { |
| 6574 | - $return .= '<select class="flat minwidth50imp maxwidth100" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>'; |
|
| 6574 | + $return .= '<select class="flat minwidth50imp maxwidth100" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>'; |
|
| 6575 | 6575 | } |
| 6576 | 6576 | |
| 6577 | 6577 | $selectedfound = false; |
@@ -6585,13 +6585,13 @@ discard block |
||
| 6585 | 6585 | $key = $rate['txtva']; |
| 6586 | 6586 | $key .= $rate['nprtva'] ? '*' : ''; |
| 6587 | 6587 | if ($mode > 0 && $rate['code']) { |
| 6588 | - $key .= ' (' . $rate['code'] . ')'; |
|
| 6588 | + $key .= ' ('.$rate['code'].')'; |
|
| 6589 | 6589 | } |
| 6590 | 6590 | if ($mode < 0) { |
| 6591 | 6591 | $key = $rate['rowid']; |
| 6592 | 6592 | } |
| 6593 | 6593 | |
| 6594 | - $return .= '<option value="' . $key . '"'; |
|
| 6594 | + $return .= '<option value="'.$key.'"'; |
|
| 6595 | 6595 | if (!$selectedfound) { |
| 6596 | 6596 | if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag |
| 6597 | 6597 | if ($defaultcode == $rate['code']) { |
@@ -6662,7 +6662,7 @@ discard block |
||
| 6662 | 6662 | public function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '') |
| 6663 | 6663 | { |
| 6664 | 6664 | // phpcs:enable |
| 6665 | - dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
| 6665 | + dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
| 6666 | 6666 | $retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof); |
| 6667 | 6667 | if (!empty($nooutput)) { |
| 6668 | 6668 | return $retstring; |
@@ -6691,11 +6691,11 @@ discard block |
||
| 6691 | 6691 | { |
| 6692 | 6692 | global $langs; |
| 6693 | 6693 | |
| 6694 | - $ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
| 6694 | + $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
| 6695 | 6695 | if ($forcenewline) { |
| 6696 | 6696 | $ret .= '<br>'; |
| 6697 | 6697 | } |
| 6698 | - $ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
| 6698 | + $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
| 6699 | 6699 | return $ret; |
| 6700 | 6700 | } |
| 6701 | 6701 | |
@@ -6761,7 +6761,7 @@ discard block |
||
| 6761 | 6761 | $orig_set_time = $set_time; |
| 6762 | 6762 | |
| 6763 | 6763 | if ($set_time === '' && $emptydate == 0) { |
| 6764 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 6764 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 6765 | 6765 | if ($gm == 'tzuser' || $gm == 'tzuserrel') { |
| 6766 | 6766 | $set_time = dol_now($gm); |
| 6767 | 6767 | } else { |
@@ -6829,38 +6829,38 @@ discard block |
||
| 6829 | 6829 | // Calendrier popup version eldy |
| 6830 | 6830 | if ($usecalendar == "eldy") { |
| 6831 | 6831 | // Input area to enter date manually |
| 6832 | - $retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"'; |
|
| 6832 | + $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"'; |
|
| 6833 | 6833 | $retstring .= ($disabled ? ' disabled' : ''); |
| 6834 | - $retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 6834 | + $retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 6835 | 6835 | $retstring .= '>'; |
| 6836 | 6836 | |
| 6837 | 6837 | // Icon calendar |
| 6838 | 6838 | $retstringbuttom = ''; |
| 6839 | 6839 | if (!$disabled) { |
| 6840 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"'; |
|
| 6841 | - $base = DOL_URL_ROOT . '/core/'; |
|
| 6842 | - $retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"'; |
|
| 6843 | - $retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 6840 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"'; |
|
| 6841 | + $base = DOL_URL_ROOT.'/core/'; |
|
| 6842 | + $retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"'; |
|
| 6843 | + $retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 6844 | 6844 | } else { |
| 6845 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 6845 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 6846 | 6846 | } |
| 6847 | - $retstring = $retstringbuttom . $retstring; |
|
| 6847 | + $retstring = $retstringbuttom.$retstring; |
|
| 6848 | 6848 | |
| 6849 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
| 6850 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
| 6851 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
| 6849 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
| 6850 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
| 6851 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
| 6852 | 6852 | } elseif ($usecalendar == 'jquery') { |
| 6853 | 6853 | if (!$disabled) { |
| 6854 | 6854 | // Output javascript for datepicker |
| 6855 | 6855 | $minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (date('Y') - 100)); |
| 6856 | 6856 | $maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (date('Y') + 100)); |
| 6857 | 6857 | |
| 6858 | - $retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">'; |
|
| 6859 | - $retstring .= "$(function(){ $('#" . $prefix . "').datepicker({ |
|
| 6860 | - dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "', |
|
| 6858 | + $retstring .= '<script nonce="'.getNonce().'" type="text/javascript">'; |
|
| 6859 | + $retstring .= "$(function(){ $('#".$prefix."').datepicker({ |
|
| 6860 | + dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."', |
|
| 6861 | 6861 | autoclose: true, |
| 6862 | 6862 | todayHighlight: true, |
| 6863 | - yearRange: '" . $minYear . ":" . $maxYear . "',"; |
|
| 6863 | + yearRange: '" . $minYear.":".$maxYear."',"; |
|
| 6864 | 6864 | if (!empty($conf->dol_use_jmobile)) { |
| 6865 | 6865 | $retstring .= " |
| 6866 | 6866 | beforeShow: function (input, datePicker) { |
@@ -6875,7 +6875,7 @@ discard block |
||
| 6875 | 6875 | if (empty($conf->global->MAIN_POPUP_CALENDAR_ON_FOCUS)) { |
| 6876 | 6876 | $retstring .= " |
| 6877 | 6877 | showOn: 'button', /* both has problem with autocompletion */ |
| 6878 | - buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png', |
|
| 6878 | + buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png', |
|
| 6879 | 6879 | buttonImageOnly: true"; |
| 6880 | 6880 | } |
| 6881 | 6881 | $retstring .= " |
@@ -6887,8 +6887,8 @@ discard block |
||
| 6887 | 6887 | $retstring .= '<div class="nowraponall inline-block divfordateinput">'; |
| 6888 | 6888 | $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"'; |
| 6889 | 6889 | $retstring .= ($disabled ? ' disabled' : ''); |
| 6890 | - $retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : ''); |
|
| 6891 | - $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 6890 | + $retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : ''); |
|
| 6891 | + $retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 6892 | 6892 | $retstring .= '>'; |
| 6893 | 6893 | |
| 6894 | 6894 | // Icone calendrier |
@@ -6903,40 +6903,40 @@ discard block |
||
| 6903 | 6903 | $retstring.='});'; |
| 6904 | 6904 | $retstring.="</script>";*/ |
| 6905 | 6905 | } else { |
| 6906 | - $retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 6907 | - $retsring = $retstringbutton . $retstring; |
|
| 6906 | + $retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 6907 | + $retsring = $retstringbutton.$retstring; |
|
| 6908 | 6908 | } |
| 6909 | 6909 | |
| 6910 | 6910 | $retstring .= '</div>'; |
| 6911 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
| 6912 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
| 6913 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
| 6911 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
| 6912 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
| 6913 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
| 6914 | 6914 | } else { |
| 6915 | 6915 | $retstring .= "Bad value of MAIN_POPUP_CALENDAR"; |
| 6916 | 6916 | } |
| 6917 | 6917 | } else { |
| 6918 | 6918 | // Show date with combo selects |
| 6919 | 6919 | // Day |
| 6920 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">'; |
|
| 6920 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">'; |
|
| 6921 | 6921 | |
| 6922 | 6922 | if ($emptydate || $set_time == -1) { |
| 6923 | 6923 | $retstring .= '<option value="0" selected> </option>'; |
| 6924 | 6924 | } |
| 6925 | 6925 | |
| 6926 | 6926 | for ($day = 1; $day <= 31; $day++) { |
| 6927 | - $retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>'; |
|
| 6927 | + $retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>'; |
|
| 6928 | 6928 | } |
| 6929 | 6929 | |
| 6930 | 6930 | $retstring .= "</select>"; |
| 6931 | 6931 | |
| 6932 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">'; |
|
| 6932 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">'; |
|
| 6933 | 6933 | if ($emptydate || $set_time == -1) { |
| 6934 | 6934 | $retstring .= '<option value="0" selected> </option>'; |
| 6935 | 6935 | } |
| 6936 | 6936 | |
| 6937 | 6937 | // Month |
| 6938 | 6938 | for ($month = 1; $month <= 12; $month++) { |
| 6939 | - $retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>'; |
|
| 6939 | + $retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>'; |
|
| 6940 | 6940 | $retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b"); |
| 6941 | 6941 | $retstring .= "</option>"; |
| 6942 | 6942 | } |
@@ -6944,12 +6944,12 @@ discard block |
||
| 6944 | 6944 | |
| 6945 | 6945 | // Year |
| 6946 | 6946 | if ($emptydate || $set_time == -1) { |
| 6947 | - $retstring .= '<input' . ($disabled ? ' disabled' : '') . ' placeholder="' . dol_escape_htmltag($langs->trans("Year")) . '" class="flat maxwidth50imp valignmiddle" type="number" min="0" max="3000" maxlength="4" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">'; |
|
| 6947 | + $retstring .= '<input'.($disabled ? ' disabled' : '').' placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" class="flat maxwidth50imp valignmiddle" type="number" min="0" max="3000" maxlength="4" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'; |
|
| 6948 | 6948 | } else { |
| 6949 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">'; |
|
| 6949 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">'; |
|
| 6950 | 6950 | |
| 6951 | 6951 | for ($year = $syear - 10; $year < $syear + 10; $year++) { |
| 6952 | - $retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>'; |
|
| 6952 | + $retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>'; |
|
| 6953 | 6953 | } |
| 6954 | 6954 | $retstring .= "</select>\n"; |
| 6955 | 6955 | } |
@@ -6973,15 +6973,15 @@ discard block |
||
| 6973 | 6973 | } |
| 6974 | 6974 | } |
| 6975 | 6975 | // Show hour |
| 6976 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">'; |
|
| 6976 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">'; |
|
| 6977 | 6977 | if ($emptyhours) { |
| 6978 | 6978 | $retstring .= '<option value="-1"> </option>'; |
| 6979 | 6979 | } |
| 6980 | 6980 | for ($hour = $hourstart; $hour < $hourend; $hour++) { |
| 6981 | 6981 | if (strlen($hour) < 2) { |
| 6982 | - $hour = "0" . $hour; |
|
| 6982 | + $hour = "0".$hour; |
|
| 6983 | 6983 | } |
| 6984 | - $retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour; |
|
| 6984 | + $retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour; |
|
| 6985 | 6985 | //$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H'); |
| 6986 | 6986 | $retstring .= '</option>'; |
| 6987 | 6987 | } |
@@ -6994,19 +6994,19 @@ discard block |
||
| 6994 | 6994 | |
| 6995 | 6995 | if ($m) { |
| 6996 | 6996 | // Show minutes |
| 6997 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">'; |
|
| 6997 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">'; |
|
| 6998 | 6998 | if ($emptyhours) { |
| 6999 | 6999 | $retstring .= '<option value="-1"> </option>'; |
| 7000 | 7000 | } |
| 7001 | 7001 | for ($min = 0; $min < 60; $min += $stepminutes) { |
| 7002 | 7002 | if (strlen($min) < 2) { |
| 7003 | - $min = "0" . $min; |
|
| 7003 | + $min = "0".$min; |
|
| 7004 | 7004 | } |
| 7005 | - $retstring .= '<option value="' . $min . '"' . (($min == $smin) ? ' selected' : '') . '>' . $min . (empty($conf->dol_optimize_smallscreen) ? '' : '') . '</option>'; |
|
| 7005 | + $retstring .= '<option value="'.$min.'"'.(($min == $smin) ? ' selected' : '').'>'.$min.(empty($conf->dol_optimize_smallscreen) ? '' : '').'</option>'; |
|
| 7006 | 7006 | } |
| 7007 | 7007 | $retstring .= '</select>'; |
| 7008 | 7008 | |
| 7009 | - $retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">'; |
|
| 7009 | + $retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">'; |
|
| 7010 | 7010 | } |
| 7011 | 7011 | |
| 7012 | 7012 | if ($d && $h) { |
@@ -7029,10 +7029,10 @@ discard block |
||
| 7029 | 7029 | |
| 7030 | 7030 | // Generate the date part, depending on the use or not of the javascript calendar |
| 7031 | 7031 | if ($addnowlink == 1) { // server time expressed in user time setup |
| 7032 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
| 7033 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7034 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7035 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7032 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
| 7033 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7034 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7035 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7036 | 7036 | } elseif ($addnowlink == 2) { |
| 7037 | 7037 | /* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix. |
| 7038 | 7038 | * This break application for foreign languages. |
@@ -7041,10 +7041,10 @@ discard block |
||
| 7041 | 7041 | $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);'; |
| 7042 | 7042 | $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());'; |
| 7043 | 7043 | */ |
| 7044 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
| 7045 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7046 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7047 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7044 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
| 7045 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7046 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7047 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7048 | 7048 | } |
| 7049 | 7049 | /*if ($usecalendar == "eldy") |
| 7050 | 7050 | { |
@@ -7064,11 +7064,11 @@ discard block |
||
| 7064 | 7064 | } |
| 7065 | 7065 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); '; |
| 7066 | 7066 | if ($addnowlink == 1) { |
| 7067 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
| 7068 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
| 7067 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
| 7068 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
| 7069 | 7069 | } elseif ($addnowlink == 2) { |
| 7070 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());'; |
|
| 7071 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
| 7070 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());'; |
|
| 7071 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
| 7072 | 7072 | } |
| 7073 | 7073 | |
| 7074 | 7074 | if ($fullday) { |
@@ -7082,11 +7082,11 @@ discard block |
||
| 7082 | 7082 | } |
| 7083 | 7083 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); '; |
| 7084 | 7084 | if ($addnowlink == 1) { |
| 7085 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
| 7086 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
| 7085 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
| 7086 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
| 7087 | 7087 | } elseif ($addnowlink == 2) { |
| 7088 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());'; |
|
| 7089 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
| 7088 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());'; |
|
| 7089 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
| 7090 | 7090 | } |
| 7091 | 7091 | if ($fullday) { |
| 7092 | 7092 | $reset_scripts .= ' } '; |
@@ -7094,7 +7094,7 @@ discard block |
||
| 7094 | 7094 | } |
| 7095 | 7095 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
| 7096 | 7096 | if ($reset_scripts && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { |
| 7097 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">'; |
|
| 7097 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">'; |
|
| 7098 | 7098 | $retstring .= $langs->trans("Now"); |
| 7099 | 7099 | $retstring .= '</button> '; |
| 7100 | 7100 | } |
@@ -7106,16 +7106,16 @@ discard block |
||
| 7106 | 7106 | $reset_scripts = ""; |
| 7107 | 7107 | |
| 7108 | 7108 | // Generate the date part, depending on the use or not of the javascript calendar |
| 7109 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');'; |
|
| 7110 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7111 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7112 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7109 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');'; |
|
| 7110 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7111 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7112 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7113 | 7113 | // Update the hour part |
| 7114 | 7114 | if ($h) { |
| 7115 | 7115 | if ($fullday) { |
| 7116 | 7116 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
| 7117 | 7117 | } |
| 7118 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
| 7118 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
| 7119 | 7119 | if ($fullday) { |
| 7120 | 7120 | $reset_scripts .= ' } '; |
| 7121 | 7121 | } |
@@ -7125,14 +7125,14 @@ discard block |
||
| 7125 | 7125 | if ($fullday) { |
| 7126 | 7126 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
| 7127 | 7127 | } |
| 7128 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
| 7128 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
| 7129 | 7129 | if ($fullday) { |
| 7130 | 7130 | $reset_scripts .= ' } '; |
| 7131 | 7131 | } |
| 7132 | 7132 | } |
| 7133 | 7133 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
| 7134 | 7134 | if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) { |
| 7135 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">'; |
|
| 7135 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">'; |
|
| 7136 | 7136 | $retstring .= $langs->trans("DateStartPlusOne"); |
| 7137 | 7137 | $retstring .= '</button> '; |
| 7138 | 7138 | } |
@@ -7190,17 +7190,17 @@ discard block |
||
| 7190 | 7190 | unset($TDurationTypes[$value]); |
| 7191 | 7191 | } |
| 7192 | 7192 | |
| 7193 | - $retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">'; |
|
| 7193 | + $retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">'; |
|
| 7194 | 7194 | foreach ($TDurationTypes as $key => $typeduration) { |
| 7195 | - $retstring .= '<option value="' . $key . '"'; |
|
| 7195 | + $retstring .= '<option value="'.$key.'"'; |
|
| 7196 | 7196 | if ($key == $selected) { |
| 7197 | 7197 | $retstring .= " selected"; |
| 7198 | 7198 | } |
| 7199 | - $retstring .= ">" . $typeduration . "</option>"; |
|
| 7199 | + $retstring .= ">".$typeduration."</option>"; |
|
| 7200 | 7200 | } |
| 7201 | 7201 | $retstring .= "</select>"; |
| 7202 | 7202 | |
| 7203 | - $retstring .= ajax_combobox('select_' . $prefix . 'type_duration'); |
|
| 7203 | + $retstring .= ajax_combobox('select_'.$prefix.'type_duration'); |
|
| 7204 | 7204 | |
| 7205 | 7205 | return $retstring; |
| 7206 | 7206 | } |
@@ -7232,30 +7232,30 @@ discard block |
||
| 7232 | 7232 | |
| 7233 | 7233 | // Hours |
| 7234 | 7234 | if ($iSecond != '') { |
| 7235 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 7235 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 7236 | 7236 | |
| 7237 | 7237 | $hourSelected = convertSecondToTime($iSecond, 'allhour'); |
| 7238 | 7238 | $minSelected = convertSecondToTime($iSecond, 'min'); |
| 7239 | 7239 | } |
| 7240 | 7240 | |
| 7241 | 7241 | if ($typehour == 'select') { |
| 7242 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>'; |
|
| 7242 | + $retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>'; |
|
| 7243 | 7243 | for ($hour = 0; $hour < 25; $hour++) { // For a duration, we allow 24 hours |
| 7244 | - $retstring .= '<option value="' . $hour . '"'; |
|
| 7244 | + $retstring .= '<option value="'.$hour.'"'; |
|
| 7245 | 7245 | if (is_numeric($hourSelected) && $hourSelected == $hour) { |
| 7246 | 7246 | $retstring .= " selected"; |
| 7247 | 7247 | } |
| 7248 | - $retstring .= ">" . $hour . "</option>"; |
|
| 7248 | + $retstring .= ">".$hour."</option>"; |
|
| 7249 | 7249 | } |
| 7250 | 7250 | $retstring .= "</select>"; |
| 7251 | 7251 | } elseif ($typehour == 'text' || $typehour == 'textselect') { |
| 7252 | - $retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">'; |
|
| 7252 | + $retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">'; |
|
| 7253 | 7253 | } else { |
| 7254 | 7254 | return 'BadValueForParameterTypeHour'; |
| 7255 | 7255 | } |
| 7256 | 7256 | |
| 7257 | 7257 | if ($typehour != 'text') { |
| 7258 | - $retstring .= ' ' . $langs->trans('HourShort'); |
|
| 7258 | + $retstring .= ' '.$langs->trans('HourShort'); |
|
| 7259 | 7259 | } else { |
| 7260 | 7260 | $retstring .= '<span class="">:</span>'; |
| 7261 | 7261 | } |
@@ -7270,21 +7270,21 @@ discard block |
||
| 7270 | 7270 | } |
| 7271 | 7271 | |
| 7272 | 7272 | if ($typehour == 'select' || $typehour == 'textselect') { |
| 7273 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>'; |
|
| 7273 | + $retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>'; |
|
| 7274 | 7274 | for ($min = 0; $min <= 55; $min = $min + 5) { |
| 7275 | - $retstring .= '<option value="' . $min . '"'; |
|
| 7275 | + $retstring .= '<option value="'.$min.'"'; |
|
| 7276 | 7276 | if (is_numeric($minSelected) && $minSelected == $min) { |
| 7277 | 7277 | $retstring .= ' selected'; |
| 7278 | 7278 | } |
| 7279 | - $retstring .= '>' . $min . '</option>'; |
|
| 7279 | + $retstring .= '>'.$min.'</option>'; |
|
| 7280 | 7280 | } |
| 7281 | 7281 | $retstring .= "</select>"; |
| 7282 | 7282 | } elseif ($typehour == 'text') { |
| 7283 | - $retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">'; |
|
| 7283 | + $retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">'; |
|
| 7284 | 7284 | } |
| 7285 | 7285 | |
| 7286 | 7286 | if ($typehour != 'text') { |
| 7287 | - $retstring .= ' ' . $langs->trans('MinuteShort'); |
|
| 7287 | + $retstring .= ' '.$langs->trans('MinuteShort'); |
|
| 7288 | 7288 | } |
| 7289 | 7289 | |
| 7290 | 7290 | $retstring .= "</span>"; |
@@ -7330,7 +7330,7 @@ discard block |
||
| 7330 | 7330 | $placeholder = ''; |
| 7331 | 7331 | |
| 7332 | 7332 | if ($selected && empty($selected_input_value)) { |
| 7333 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
| 7333 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
| 7334 | 7334 | $tickettmpselect = new Ticket($this->db); |
| 7335 | 7335 | $tickettmpselect->fetch($selected); |
| 7336 | 7336 | $selected_input_value = $tickettmpselect->ref; |
@@ -7338,16 +7338,16 @@ discard block |
||
| 7338 | 7338 | } |
| 7339 | 7339 | |
| 7340 | 7340 | $urloption = ''; |
| 7341 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7341 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7342 | 7342 | |
| 7343 | - if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7343 | + if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7344 | 7344 | elseif ($hidelabel > 1) { |
| 7345 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7345 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7346 | 7346 | if ($hidelabel == 2) { |
| 7347 | 7347 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7348 | 7348 | } |
| 7349 | 7349 | } |
| 7350 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />'; |
|
| 7350 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; |
|
| 7351 | 7351 | if ($hidelabel == 3) { |
| 7352 | 7352 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7353 | 7353 | } |
@@ -7391,8 +7391,8 @@ discard block |
||
| 7391 | 7391 | |
| 7392 | 7392 | $sql = "SELECT "; |
| 7393 | 7393 | $sql .= $selectFields; |
| 7394 | - $sql .= " FROM " . $this->db->prefix() . "ticket as p"; |
|
| 7395 | - $sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')'; |
|
| 7394 | + $sql .= " FROM ".$this->db->prefix()."ticket as p"; |
|
| 7395 | + $sql .= ' WHERE p.entity IN ('.getEntity('ticket').')'; |
|
| 7396 | 7396 | |
| 7397 | 7397 | // Add criteria on ref/label |
| 7398 | 7398 | if ($filterkey != '') { |
@@ -7404,7 +7404,7 @@ discard block |
||
| 7404 | 7404 | if (count($scrit) > 1) $sql .= "("; |
| 7405 | 7405 | foreach ($scrit as $crit) { |
| 7406 | 7406 | if ($i > 0) $sql .= " AND "; |
| 7407 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7407 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7408 | 7408 | $sql .= ")"; |
| 7409 | 7409 | $i++; |
| 7410 | 7410 | } |
@@ -7415,22 +7415,22 @@ discard block |
||
| 7415 | 7415 | $sql .= $this->db->plimit($limit, 0); |
| 7416 | 7416 | |
| 7417 | 7417 | // Build output string |
| 7418 | - dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG); |
|
| 7418 | + dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG); |
|
| 7419 | 7419 | $result = $this->db->query($sql); |
| 7420 | 7420 | if ($result) { |
| 7421 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
| 7422 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php'; |
|
| 7421 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
| 7422 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php'; |
|
| 7423 | 7423 | |
| 7424 | 7424 | $num = $this->db->num_rows($result); |
| 7425 | 7425 | |
| 7426 | 7426 | $events = null; |
| 7427 | 7427 | |
| 7428 | 7428 | if (!$forcecombo) { |
| 7429 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7429 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7430 | 7430 | $out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT); |
| 7431 | 7431 | } |
| 7432 | 7432 | |
| 7433 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7433 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7434 | 7434 | |
| 7435 | 7435 | $textifempty = ''; |
| 7436 | 7436 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7441,7 +7441,7 @@ discard block |
||
| 7441 | 7441 | } else { |
| 7442 | 7442 | if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty); |
| 7443 | 7443 | } |
| 7444 | - if ($showempty) $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
| 7444 | + if ($showempty) $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
| 7445 | 7445 | |
| 7446 | 7446 | $i = 0; |
| 7447 | 7447 | while ($num && $i < $num) { |
@@ -7495,12 +7495,12 @@ discard block |
||
| 7495 | 7495 | $outref = $objp->ref; |
| 7496 | 7496 | $outtype = $objp->fk_product_type; |
| 7497 | 7497 | |
| 7498 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 7498 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 7499 | 7499 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 7500 | 7500 | $opt .= '>'; |
| 7501 | 7501 | $opt .= $objp->ref; |
| 7502 | 7502 | $objRef = $objp->ref; |
| 7503 | - if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7503 | + if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7504 | 7504 | |
| 7505 | 7505 | $opt .= "</option>\n"; |
| 7506 | 7506 | $optJson = array('key' => $outkey, 'value' => $outref, 'type' => $outtype); |
@@ -7538,7 +7538,7 @@ discard block |
||
| 7538 | 7538 | $placeholder = ''; |
| 7539 | 7539 | |
| 7540 | 7540 | if ($selected && empty($selected_input_value)) { |
| 7541 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 7541 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 7542 | 7542 | $projecttmpselect = new Project($this->db); |
| 7543 | 7543 | $projecttmpselect->fetch($selected); |
| 7544 | 7544 | $selected_input_value = $projecttmpselect->ref; |
@@ -7546,16 +7546,16 @@ discard block |
||
| 7546 | 7546 | } |
| 7547 | 7547 | |
| 7548 | 7548 | $urloption = ''; |
| 7549 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7549 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7550 | 7550 | |
| 7551 | - if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7551 | + if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7552 | 7552 | elseif ($hidelabel > 1) { |
| 7553 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7553 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7554 | 7554 | if ($hidelabel == 2) { |
| 7555 | 7555 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7556 | 7556 | } |
| 7557 | 7557 | } |
| 7558 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />'; |
|
| 7558 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; |
|
| 7559 | 7559 | if ($hidelabel == 3) { |
| 7560 | 7560 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7561 | 7561 | } |
@@ -7598,8 +7598,8 @@ discard block |
||
| 7598 | 7598 | |
| 7599 | 7599 | $sql = "SELECT "; |
| 7600 | 7600 | $sql .= $selectFields; |
| 7601 | - $sql .= " FROM " . $this->db->prefix() . "projet as p"; |
|
| 7602 | - $sql .= ' WHERE p.entity IN (' . getEntity('project') . ')'; |
|
| 7601 | + $sql .= " FROM ".$this->db->prefix()."projet as p"; |
|
| 7602 | + $sql .= ' WHERE p.entity IN ('.getEntity('project').')'; |
|
| 7603 | 7603 | |
| 7604 | 7604 | // Add criteria on ref/label |
| 7605 | 7605 | if ($filterkey != '') { |
@@ -7611,7 +7611,7 @@ discard block |
||
| 7611 | 7611 | if (count($scrit) > 1) $sql .= "("; |
| 7612 | 7612 | foreach ($scrit as $crit) { |
| 7613 | 7613 | if ($i > 0) $sql .= " AND "; |
| 7614 | - $sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7614 | + $sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7615 | 7615 | $sql .= ""; |
| 7616 | 7616 | $i++; |
| 7617 | 7617 | } |
@@ -7622,22 +7622,22 @@ discard block |
||
| 7622 | 7622 | $sql .= $this->db->plimit($limit, 0); |
| 7623 | 7623 | |
| 7624 | 7624 | // Build output string |
| 7625 | - dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG); |
|
| 7625 | + dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG); |
|
| 7626 | 7626 | $result = $this->db->query($sql); |
| 7627 | 7627 | if ($result) { |
| 7628 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 7629 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 7628 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 7629 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 7630 | 7630 | |
| 7631 | 7631 | $num = $this->db->num_rows($result); |
| 7632 | 7632 | |
| 7633 | 7633 | $events = null; |
| 7634 | 7634 | |
| 7635 | 7635 | if (!$forcecombo) { |
| 7636 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7636 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7637 | 7637 | $out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT); |
| 7638 | 7638 | } |
| 7639 | 7639 | |
| 7640 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7640 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7641 | 7641 | |
| 7642 | 7642 | $textifempty = ''; |
| 7643 | 7643 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7648,7 +7648,7 @@ discard block |
||
| 7648 | 7648 | } else { |
| 7649 | 7649 | if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty); |
| 7650 | 7650 | } |
| 7651 | - if ($showempty) $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
| 7651 | + if ($showempty) $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
| 7652 | 7652 | |
| 7653 | 7653 | $i = 0; |
| 7654 | 7654 | while ($num && $i < $num) { |
@@ -7705,12 +7705,12 @@ discard block |
||
| 7705 | 7705 | $outlabel = $objp->label; |
| 7706 | 7706 | $outtype = $objp->fk_product_type; |
| 7707 | 7707 | |
| 7708 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 7708 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 7709 | 7709 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 7710 | 7710 | $opt .= '>'; |
| 7711 | 7711 | $opt .= $objp->ref; |
| 7712 | 7712 | $objRef = $objp->ref; |
| 7713 | - if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7713 | + if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7714 | 7714 | |
| 7715 | 7715 | $opt .= "</option>\n"; |
| 7716 | 7716 | $optJson = array('key' => $outkey, 'value' => $outref, 'type' => $outtype); |
@@ -7750,7 +7750,7 @@ discard block |
||
| 7750 | 7750 | $urloption = ''; |
| 7751 | 7751 | |
| 7752 | 7752 | if ($selected && empty($selected_input_value)) { |
| 7753 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 7753 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 7754 | 7754 | $adherenttmpselect = new Adherent($this->db); |
| 7755 | 7755 | $adherenttmpselect->fetch($selected); |
| 7756 | 7756 | $selected_input_value = $adherenttmpselect->ref; |
@@ -7759,16 +7759,16 @@ discard block |
||
| 7759 | 7759 | |
| 7760 | 7760 | $urloption = ''; |
| 7761 | 7761 | |
| 7762 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7762 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7763 | 7763 | |
| 7764 | - if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7764 | + if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7765 | 7765 | elseif ($hidelabel > 1) { |
| 7766 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7766 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7767 | 7767 | if ($hidelabel == 2) { |
| 7768 | 7768 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7769 | 7769 | } |
| 7770 | 7770 | } |
| 7771 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />'; |
|
| 7771 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; |
|
| 7772 | 7772 | if ($hidelabel == 3) { |
| 7773 | 7773 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7774 | 7774 | } |
@@ -7813,8 +7813,8 @@ discard block |
||
| 7813 | 7813 | |
| 7814 | 7814 | $sql = "SELECT "; |
| 7815 | 7815 | $sql .= $selectFields; |
| 7816 | - $sql .= " FROM " . $this->db->prefix() . "adherent as p"; |
|
| 7817 | - $sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')'; |
|
| 7816 | + $sql .= " FROM ".$this->db->prefix()."adherent as p"; |
|
| 7817 | + $sql .= ' WHERE p.entity IN ('.getEntity('adherent').')'; |
|
| 7818 | 7818 | |
| 7819 | 7819 | // Add criteria on ref/label |
| 7820 | 7820 | if ($filterkey != '') { |
@@ -7826,35 +7826,35 @@ discard block |
||
| 7826 | 7826 | if (count($scrit) > 1) $sql .= "("; |
| 7827 | 7827 | foreach ($scrit as $crit) { |
| 7828 | 7828 | if ($i > 0) $sql .= " AND "; |
| 7829 | - $sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7830 | - $sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
| 7829 | + $sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7830 | + $sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
| 7831 | 7831 | $i++; |
| 7832 | 7832 | } |
| 7833 | 7833 | if (count($scrit) > 1) $sql .= ")"; |
| 7834 | 7834 | $sql .= ')'; |
| 7835 | 7835 | } |
| 7836 | 7836 | if ($status != -1) { |
| 7837 | - $sql .= ' AND statut = ' . ((int) $status); |
|
| 7837 | + $sql .= ' AND statut = '.((int) $status); |
|
| 7838 | 7838 | } |
| 7839 | 7839 | $sql .= $this->db->plimit($limit, 0); |
| 7840 | 7840 | |
| 7841 | 7841 | // Build output string |
| 7842 | - dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG); |
|
| 7842 | + dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG); |
|
| 7843 | 7843 | $result = $this->db->query($sql); |
| 7844 | 7844 | if ($result) { |
| 7845 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 7846 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php'; |
|
| 7845 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 7846 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; |
|
| 7847 | 7847 | |
| 7848 | 7848 | $num = $this->db->num_rows($result); |
| 7849 | 7849 | |
| 7850 | 7850 | $events = null; |
| 7851 | 7851 | |
| 7852 | 7852 | if (!$forcecombo) { |
| 7853 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7853 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7854 | 7854 | $out .= ajax_combobox($htmlname, $events, !empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT) ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : ''); |
| 7855 | 7855 | } |
| 7856 | 7856 | |
| 7857 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7857 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7858 | 7858 | |
| 7859 | 7859 | $textifempty = ''; |
| 7860 | 7860 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7866,7 +7866,7 @@ discard block |
||
| 7866 | 7866 | if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty); |
| 7867 | 7867 | } |
| 7868 | 7868 | if ($showempty) { |
| 7869 | - $out .= '<option value="-1" selected>' . $textifempty . '</option>'; |
|
| 7869 | + $out .= '<option value="-1" selected>'.$textifempty.'</option>'; |
|
| 7870 | 7870 | } |
| 7871 | 7871 | |
| 7872 | 7872 | $i = 0; |
@@ -7922,11 +7922,11 @@ discard block |
||
| 7922 | 7922 | $outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname); |
| 7923 | 7923 | $outtype = $objp->fk_adherent_type; |
| 7924 | 7924 | |
| 7925 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 7925 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 7926 | 7926 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 7927 | 7927 | $opt .= '>'; |
| 7928 | 7928 | if (!empty($filterkey) && $filterkey != '') { |
| 7929 | - $outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1); |
|
| 7929 | + $outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1); |
|
| 7930 | 7930 | } |
| 7931 | 7931 | $opt .= $outlabel; |
| 7932 | 7932 | $opt .= "</option>\n"; |
@@ -7967,9 +7967,9 @@ discard block |
||
| 7967 | 7967 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
| 7968 | 7968 | $reg = array(); |
| 7969 | 7969 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
| 7970 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 7970 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 7971 | 7971 | } |
| 7972 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 7972 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 7973 | 7973 | |
| 7974 | 7974 | $classname = $InfoFieldList[0]; |
| 7975 | 7975 | $classpath = $InfoFieldList[1]; |
@@ -7993,8 +7993,8 @@ discard block |
||
| 7993 | 7993 | } |
| 7994 | 7994 | } |
| 7995 | 7995 | if (!is_object($objecttmp)) { |
| 7996 | - dol_syslog('Error bad setup of type for field ' . join(',', $InfoFieldList), LOG_WARNING); |
|
| 7997 | - return 'Error bad setup of type for field ' . join(',', $InfoFieldList); |
|
| 7996 | + dol_syslog('Error bad setup of type for field '.join(',', $InfoFieldList), LOG_WARNING); |
|
| 7997 | + return 'Error bad setup of type for field '.join(',', $InfoFieldList); |
|
| 7998 | 7998 | } |
| 7999 | 7999 | |
| 8000 | 8000 | //var_dump($filter); |
@@ -8005,9 +8005,9 @@ discard block |
||
| 8005 | 8005 | if ($prefixforautocompletemode == 'product') { |
| 8006 | 8006 | $prefixforautocompletemode = 'produit'; |
| 8007 | 8007 | } |
| 8008 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8008 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8009 | 8009 | |
| 8010 | - dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG); |
|
| 8010 | + dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG); |
|
| 8011 | 8011 | $out = ''; |
| 8012 | 8012 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString($confkeyforautocompletemode) && !$forcecombo) { |
| 8013 | 8013 | // No immediate load of all database |
@@ -8018,15 +8018,15 @@ discard block |
||
| 8018 | 8018 | //unset($objecttmp); |
| 8019 | 8019 | } |
| 8020 | 8020 | |
| 8021 | - $objectdesc = $classname . ':' . $classpath . ':' . $addcreatebuttonornot . ':' . $filter; |
|
| 8022 | - $urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php'; |
|
| 8021 | + $objectdesc = $classname.':'.$classpath.':'.$addcreatebuttonornot.':'.$filter; |
|
| 8022 | + $urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php'; |
|
| 8023 | 8023 | |
| 8024 | 8024 | // No immediate load of all database |
| 8025 | - $urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdesc) . '&filter=' . urlencode($filter) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : ''); |
|
| 8025 | + $urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdesc).'&filter='.urlencode($filter).($sortfield ? '&sortfield='.urlencode($sortfield) : ''); |
|
| 8026 | 8026 | // Activate the auto complete using ajax call. |
| 8027 | 8027 | $out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array()); |
| 8028 | 8028 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 8029 | - $out .= '<input type="text" class="' . $morecss . '"' . ($disabled ? ' disabled="disabled"' : '') . ' name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' />'; |
|
| 8029 | + $out .= '<input type="text" class="'.$morecss.'"'.($disabled ? ' disabled="disabled"' : '').' name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' />'; |
|
| 8030 | 8030 | } else { |
| 8031 | 8031 | // Immediate load of table record. |
| 8032 | 8032 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -8066,7 +8066,7 @@ discard block |
||
| 8066 | 8066 | if ($prefixforautocompletemode == 'societe') { |
| 8067 | 8067 | $prefixforautocompletemode = 'company'; |
| 8068 | 8068 | } |
| 8069 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8069 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8070 | 8070 | |
| 8071 | 8071 | if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
| 8072 | 8072 | $tmpfieldstoshow = ''; |
@@ -8075,7 +8075,7 @@ discard block |
||
| 8075 | 8075 | continue; |
| 8076 | 8076 | } |
| 8077 | 8077 | if (!empty($val['showoncombobox'])) { |
| 8078 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
| 8078 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
| 8079 | 8079 | } |
| 8080 | 8080 | } |
| 8081 | 8081 | if ($tmpfieldstoshow) { |
@@ -8103,18 +8103,18 @@ discard block |
||
| 8103 | 8103 | $num = 0; |
| 8104 | 8104 | |
| 8105 | 8105 | // Search data |
| 8106 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; |
|
| 8106 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t"; |
|
| 8107 | 8107 | if (!empty($objecttmp->isextrafieldmanaged)) { |
| 8108 | - $sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object"; |
|
| 8108 | + $sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object"; |
|
| 8109 | 8109 | } |
| 8110 | 8110 | if (isset($objecttmp->ismultientitymanaged)) { |
| 8111 | 8111 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 8112 | 8112 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
| 8113 | - $sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0]; |
|
| 8113 | + $sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; |
|
| 8114 | 8114 | } |
| 8115 | 8115 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
| 8116 | 8116 | if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) { |
| 8117 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
| 8117 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
| 8118 | 8118 | } |
| 8119 | 8119 | } |
| 8120 | 8120 | } |
@@ -8134,21 +8134,21 @@ discard block |
||
| 8134 | 8134 | $sql .= " WHERE 1=1"; |
| 8135 | 8135 | if (isset($objecttmp->ismultientitymanaged)) { |
| 8136 | 8136 | if ($objecttmp->ismultientitymanaged == 1) { |
| 8137 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
| 8137 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
| 8138 | 8138 | } |
| 8139 | 8139 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 8140 | - $sql .= " AND parenttable.entity = t." . $tmparray[0]; |
|
| 8140 | + $sql .= " AND parenttable.entity = t.".$tmparray[0]; |
|
| 8141 | 8141 | } |
| 8142 | 8142 | if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { |
| 8143 | 8143 | if ($objecttmp->element == 'societe') { |
| 8144 | - $sql .= " AND t.rowid = " . ((int) $user->socid); |
|
| 8144 | + $sql .= " AND t.rowid = ".((int) $user->socid); |
|
| 8145 | 8145 | } else { |
| 8146 | - $sql .= " AND t.fk_soc = " . ((int) $user->socid); |
|
| 8146 | + $sql .= " AND t.fk_soc = ".((int) $user->socid); |
|
| 8147 | 8147 | } |
| 8148 | 8148 | } |
| 8149 | 8149 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
| 8150 | 8150 | if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) { |
| 8151 | - $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
| 8151 | + $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
| 8152 | 8152 | } |
| 8153 | 8153 | } |
| 8154 | 8154 | } |
@@ -8160,7 +8160,7 @@ discard block |
||
| 8160 | 8160 | $errormessage = ''; |
| 8161 | 8161 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
| 8162 | 8162 | if ($errormessage) { |
| 8163 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
| 8163 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
| 8164 | 8164 | } |
| 8165 | 8165 | } |
| 8166 | 8166 | } |
@@ -8172,7 +8172,7 @@ discard block |
||
| 8172 | 8172 | $resql = $this->db->query($sql); |
| 8173 | 8173 | if ($resql) { |
| 8174 | 8174 | // Construct $out and $outarray |
| 8175 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
| 8175 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
| 8176 | 8176 | |
| 8177 | 8177 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
| 8178 | 8178 | $textifempty = ' '; |
@@ -8186,7 +8186,7 @@ discard block |
||
| 8186 | 8186 | } |
| 8187 | 8187 | } |
| 8188 | 8188 | if ($showempty) { |
| 8189 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
| 8189 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
| 8190 | 8190 | } |
| 8191 | 8191 | |
| 8192 | 8192 | $num = $this->db->num_rows($resql); |
@@ -8209,9 +8209,9 @@ discard block |
||
| 8209 | 8209 | } |
| 8210 | 8210 | if (empty($outputmode)) { |
| 8211 | 8211 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
| 8212 | - $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>'; |
|
| 8212 | + $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>'; |
|
| 8213 | 8213 | } else { |
| 8214 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 8214 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 8215 | 8215 | } |
| 8216 | 8216 | } else { |
| 8217 | 8217 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -8224,10 +8224,10 @@ discard block |
||
| 8224 | 8224 | } |
| 8225 | 8225 | } |
| 8226 | 8226 | |
| 8227 | - $out .= '</select>' . "\n"; |
|
| 8227 | + $out .= '</select>'."\n"; |
|
| 8228 | 8228 | |
| 8229 | 8229 | if (!$forcecombo) { |
| 8230 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8230 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8231 | 8231 | $out .= ajax_combobox($htmlname, null, (!empty($conf->global->$confkeyforautocompletemode) ? $conf->global->$confkeyforautocompletemode : 0)); |
| 8232 | 8232 | } |
| 8233 | 8233 | } else { |
@@ -8289,8 +8289,8 @@ discard block |
||
| 8289 | 8289 | } |
| 8290 | 8290 | } |
| 8291 | 8291 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
| 8292 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"'; |
|
| 8293 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : ''); |
|
| 8292 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"'; |
|
| 8293 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : ''); |
|
| 8294 | 8294 | $out .= '>'."\n"; |
| 8295 | 8295 | |
| 8296 | 8296 | if ($show_empty) { |
@@ -8301,7 +8301,7 @@ discard block |
||
| 8301 | 8301 | if (!is_numeric($show_empty)) { |
| 8302 | 8302 | $textforempty = $show_empty; |
| 8303 | 8303 | } |
| 8304 | - $out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 8304 | + $out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 8305 | 8305 | } |
| 8306 | 8306 | if (is_array($array)) { |
| 8307 | 8307 | // Translate |
@@ -8324,7 +8324,7 @@ discard block |
||
| 8324 | 8324 | if (is_array($tmpvalue)) { |
| 8325 | 8325 | $value = $tmpvalue['label']; |
| 8326 | 8326 | $disabled = empty($tmpvalue['disabled']) ? '' : ' disabled'; |
| 8327 | - $style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"'; |
|
| 8327 | + $style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"'; |
|
| 8328 | 8328 | } else { |
| 8329 | 8329 | $value = $tmpvalue; |
| 8330 | 8330 | $disabled = ''; |
@@ -8339,9 +8339,9 @@ discard block |
||
| 8339 | 8339 | } |
| 8340 | 8340 | if ($key_in_label) { |
| 8341 | 8341 | if (empty($nohtmlescape)) { |
| 8342 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 8342 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 8343 | 8343 | } else { |
| 8344 | - $selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
| 8344 | + $selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
| 8345 | 8345 | } |
| 8346 | 8346 | } else { |
| 8347 | 8347 | if (empty($nohtmlescape)) { |
@@ -8353,8 +8353,8 @@ discard block |
||
| 8353 | 8353 | $selectOptionValue = ' '; |
| 8354 | 8354 | } |
| 8355 | 8355 | } |
| 8356 | - $out .= '<option value="' . $key . '"'; |
|
| 8357 | - $out .= $style . $disabled; |
|
| 8356 | + $out .= '<option value="'.$key.'"'; |
|
| 8357 | + $out .= $style.$disabled; |
|
| 8358 | 8358 | if (is_array($id)) { |
| 8359 | 8359 | if (in_array($key, $id) && !$disabled) { |
| 8360 | 8360 | $out .= ' selected'; // To preselect a value |
@@ -8366,7 +8366,7 @@ discard block |
||
| 8366 | 8366 | } |
| 8367 | 8367 | } |
| 8368 | 8368 | if ($nohtmlescape) { |
| 8369 | - $out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"'; |
|
| 8369 | + $out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"'; |
|
| 8370 | 8370 | } |
| 8371 | 8371 | if (is_array($tmpvalue)) { |
| 8372 | 8372 | foreach ($tmpvalue as $keyforvalue => $valueforvalue) { |
@@ -8384,7 +8384,7 @@ discard block |
||
| 8384 | 8384 | // Add code for jquery to use multiselect |
| 8385 | 8385 | if ($addjscombo && $jsbeautify) { |
| 8386 | 8386 | // Enhance with select2 |
| 8387 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8387 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8388 | 8388 | $out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss); |
| 8389 | 8389 | } |
| 8390 | 8390 | |
@@ -8416,28 +8416,28 @@ discard block |
||
| 8416 | 8416 | public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) |
| 8417 | 8417 | { |
| 8418 | 8418 | global $conf, $langs; |
| 8419 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8419 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8420 | 8420 | |
| 8421 | 8421 | // TODO Use an internal dolibarr component instead of select2 |
| 8422 | 8422 | if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8423 | 8423 | return ''; |
| 8424 | 8424 | } |
| 8425 | 8425 | |
| 8426 | - $out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>'; |
|
| 8426 | + $out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>'; |
|
| 8427 | 8427 | |
| 8428 | 8428 | $outdelayed = ''; |
| 8429 | 8429 | if (!empty($conf->use_javascript_ajax)) { |
| 8430 | 8430 | $tmpplugin = 'select2'; |
| 8431 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
| 8432 | - <script nonce="' . getNonce() . '"> |
|
| 8431 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
| 8432 | + <script nonce="' . getNonce().'"> |
|
| 8433 | 8433 | $(document).ready(function () { |
| 8434 | 8434 | |
| 8435 | - ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . ' |
|
| 8435 | + ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').' |
|
| 8436 | 8436 | |
| 8437 | - $(".' . $htmlname . '").select2({ |
|
| 8437 | + $(".' . $htmlname.'").select2({ |
|
| 8438 | 8438 | ajax: { |
| 8439 | 8439 | dir: "ltr", |
| 8440 | - url: "' . $url . '", |
|
| 8440 | + url: "' . $url.'", |
|
| 8441 | 8441 | dataType: \'json\', |
| 8442 | 8442 | delay: 250, |
| 8443 | 8443 | data: function (params) { |
@@ -8464,9 +8464,9 @@ discard block |
||
| 8464 | 8464 | }, |
| 8465 | 8465 | language: select2arrayoflanguage, |
| 8466 | 8466 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
| 8467 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
| 8467 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
| 8468 | 8468 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
| 8469 | - minimumInputLength: ' . ((int) $minimumInputLength) . ', |
|
| 8469 | + minimumInputLength: ' . ((int) $minimumInputLength).', |
|
| 8470 | 8470 | formatResult: function (result, container, query, escapeMarkup) { |
| 8471 | 8471 | return escapeMarkup(result.text); |
| 8472 | 8472 | }, |
@@ -8474,10 +8474,10 @@ discard block |
||
| 8474 | 8474 | |
| 8475 | 8475 | ' . ($callurlonselect ? ' |
| 8476 | 8476 | /* Code to execute a GET when we select a value */ |
| 8477 | - $(".' . $htmlname . '").change(function() { |
|
| 8478 | - var selected = $(".' . $htmlname . '").val(); |
|
| 8477 | + $(".' . $htmlname.'").change(function() { |
|
| 8478 | + var selected = $(".' . $htmlname.'").val(); |
|
| 8479 | 8479 | console.log("We select in selectArrayAjax the entry "+selected) |
| 8480 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
| 8480 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
| 8481 | 8481 | $.each( saveRemoteData, function( key, value ) { |
| 8482 | 8482 | if (key == selected) |
| 8483 | 8483 | { |
@@ -8485,7 +8485,7 @@ discard block |
||
| 8485 | 8485 | location.assign(value.url); |
| 8486 | 8486 | } |
| 8487 | 8487 | }); |
| 8488 | - });' : '') . ' |
|
| 8488 | + });' : '').' |
|
| 8489 | 8489 | |
| 8490 | 8490 | }); |
| 8491 | 8491 | </script>'; |
@@ -8521,14 +8521,14 @@ discard block |
||
| 8521 | 8521 | public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '') |
| 8522 | 8522 | { |
| 8523 | 8523 | global $conf, $langs; |
| 8524 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8524 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8525 | 8525 | |
| 8526 | 8526 | // TODO Use an internal dolibarr component instead of select2 |
| 8527 | 8527 | if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8528 | 8528 | return ''; |
| 8529 | 8529 | } |
| 8530 | 8530 | |
| 8531 | - $out = '<select type="text"'.($textfortitle? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
| 8531 | + $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
| 8532 | 8532 | |
| 8533 | 8533 | $formattedarrayresult = array(); |
| 8534 | 8534 | |
@@ -8543,20 +8543,20 @@ discard block |
||
| 8543 | 8543 | $outdelayed = ''; |
| 8544 | 8544 | if (!empty($conf->use_javascript_ajax)) { |
| 8545 | 8545 | $tmpplugin = 'select2'; |
| 8546 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
| 8547 | - <script nonce="' . getNonce() . '"> |
|
| 8546 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
| 8547 | + <script nonce="' . getNonce().'"> |
|
| 8548 | 8548 | $(document).ready(function () { |
| 8549 | - var data = ' . json_encode($formattedarrayresult) . '; |
|
| 8549 | + var data = ' . json_encode($formattedarrayresult).'; |
|
| 8550 | 8550 | |
| 8551 | - ' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . ' |
|
| 8551 | + ' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').' |
|
| 8552 | 8552 | |
| 8553 | - $(".' . $htmlname . '").select2({ |
|
| 8553 | + $(".' . $htmlname.'").select2({ |
|
| 8554 | 8554 | data: data, |
| 8555 | 8555 | language: select2arrayoflanguage, |
| 8556 | 8556 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
| 8557 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
| 8557 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
| 8558 | 8558 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
| 8559 | - minimumInputLength: ' . $minimumInputLength . ', |
|
| 8559 | + minimumInputLength: ' . $minimumInputLength.', |
|
| 8560 | 8560 | formatResult: function (result, container, query, escapeMarkup) { |
| 8561 | 8561 | return escapeMarkup(result.text); |
| 8562 | 8562 | }, |
@@ -8595,11 +8595,11 @@ discard block |
||
| 8595 | 8595 | |
| 8596 | 8596 | ' . ($callurlonselect ? ' |
| 8597 | 8597 | /* Code to execute a GET when we select a value */ |
| 8598 | - $(".' . $htmlname . '").change(function() { |
|
| 8599 | - var selected = $(".' . $htmlname . '").val(); |
|
| 8598 | + $(".' . $htmlname.'").change(function() { |
|
| 8599 | + var selected = $(".' . $htmlname.'").val(); |
|
| 8600 | 8600 | console.log("We select "+selected) |
| 8601 | 8601 | |
| 8602 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
| 8602 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
| 8603 | 8603 | $.each( saveRemoteData, function( key, value ) { |
| 8604 | 8604 | if (key == selected) |
| 8605 | 8605 | { |
@@ -8607,7 +8607,7 @@ discard block |
||
| 8607 | 8607 | location.assign(value.url); |
| 8608 | 8608 | } |
| 8609 | 8609 | }); |
| 8610 | - });' : '') . ' |
|
| 8610 | + });' : '').' |
|
| 8611 | 8611 | |
| 8612 | 8612 | }); |
| 8613 | 8613 | </script>'; |
@@ -8659,7 +8659,7 @@ discard block |
||
| 8659 | 8659 | } |
| 8660 | 8660 | |
| 8661 | 8661 | // Output select component |
| 8662 | - $out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n"; |
|
| 8662 | + $out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', $width) ? $width : $width.'px').'"' : '').'>'."\n"; |
|
| 8663 | 8663 | if (is_array($array) && !empty($array)) { |
| 8664 | 8664 | if ($value_as_key) { |
| 8665 | 8665 | $array = array_combine($array, $array); |
@@ -8680,57 +8680,57 @@ discard block |
||
| 8680 | 8680 | $tmplabelhtml = !empty($value['labelhtml']) ? $value['labelhtml'] : ''; |
| 8681 | 8681 | } |
| 8682 | 8682 | $newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue); |
| 8683 | - $newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval); |
|
| 8683 | + $newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval); |
|
| 8684 | 8684 | |
| 8685 | - $out .= '<option value="' . $tmpkey . '"'; |
|
| 8685 | + $out .= '<option value="'.$tmpkey.'"'; |
|
| 8686 | 8686 | if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) { |
| 8687 | 8687 | $out .= ' selected'; |
| 8688 | 8688 | } |
| 8689 | 8689 | if (!empty($tmplabelhtml)) { |
| 8690 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
| 8690 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
| 8691 | 8691 | } else { |
| 8692 | - $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval; |
|
| 8693 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
| 8692 | + $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval; |
|
| 8693 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
| 8694 | 8694 | } |
| 8695 | 8695 | $out .= '>'; |
| 8696 | 8696 | $out .= dol_htmlentitiesbr($newval); |
| 8697 | - $out .= '</option>' . "\n"; |
|
| 8697 | + $out .= '</option>'."\n"; |
|
| 8698 | 8698 | } |
| 8699 | 8699 | } |
| 8700 | 8700 | } |
| 8701 | - $out .= '</select>' . "\n"; |
|
| 8701 | + $out .= '</select>'."\n"; |
|
| 8702 | 8702 | |
| 8703 | 8703 | // Add code for jquery to use multiselect |
| 8704 | 8704 | if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8705 | - $out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->'; |
|
| 8706 | - $out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n"; |
|
| 8705 | + $out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->'; |
|
| 8706 | + $out .= "\n".'<script nonce="'.getNonce().'">'."\n"; |
|
| 8707 | 8707 | if ($addjscombo == 1) { |
| 8708 | 8708 | $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; |
| 8709 | - $out .= 'function formatResult(record, container) {' . "\n"; |
|
| 8709 | + $out .= 'function formatResult(record, container) {'."\n"; |
|
| 8710 | 8710 | // If property html set, we decode html entities and use this. |
| 8711 | 8711 | // Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option. |
| 8712 | 8712 | $out .= ' if ($(record.element).attr("data-html") != undefined) { return htmlEntityDecodeJs($(record.element).attr("data-html")); }'."\n"; |
| 8713 | 8713 | $out .= ' return record.text;'; |
| 8714 | - $out .= '}' . "\n"; |
|
| 8715 | - $out .= 'function formatSelection(record) {' . "\n"; |
|
| 8714 | + $out .= '}'."\n"; |
|
| 8715 | + $out .= 'function formatSelection(record) {'."\n"; |
|
| 8716 | 8716 | if ($elemtype == 'category') { |
| 8717 | - $out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
| 8717 | + $out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
| 8718 | 8718 | } else { |
| 8719 | 8719 | $out .= 'return record.text;'; |
| 8720 | 8720 | } |
| 8721 | - $out .= '}' . "\n"; |
|
| 8721 | + $out .= '}'."\n"; |
|
| 8722 | 8722 | $out .= '$(document).ready(function () { |
| 8723 | - $(\'#' . $htmlname . '\').' . $tmpplugin . '({'; |
|
| 8723 | + $(\'#' . $htmlname.'\').'.$tmpplugin.'({'; |
|
| 8724 | 8724 | if ($placeholder) { |
| 8725 | 8725 | $out .= ' |
| 8726 | 8726 | placeholder: { |
| 8727 | 8727 | id: \'-1\', |
| 8728 | - text: \'' . dol_escape_js($placeholder) . '\' |
|
| 8728 | + text: \'' . dol_escape_js($placeholder).'\' |
|
| 8729 | 8729 | },'; |
| 8730 | 8730 | } |
| 8731 | 8731 | $out .= ' dir: \'ltr\', |
| 8732 | 8732 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */ |
| 8733 | - dropdownCssClass: \'' . $morecss . '\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */ |
|
| 8733 | + dropdownCssClass: \'' . $morecss.'\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */ |
|
| 8734 | 8734 | // Specify format function for dropdown item |
| 8735 | 8735 | formatResult: formatResult, |
| 8736 | 8736 | templateResult: formatResult, /* For 4.0 */ |
@@ -8742,21 +8742,21 @@ discard block |
||
| 8742 | 8742 | |
| 8743 | 8743 | /* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set |
| 8744 | 8744 | the size only if component is not hidden by default on load */ |
| 8745 | - $(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\'); |
|
| 8745 | + $(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\'); |
|
| 8746 | 8746 | });' . "\n"; |
| 8747 | 8747 | } elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) { |
| 8748 | 8748 | // Add other js lib |
| 8749 | 8749 | // TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin |
| 8750 | 8750 | // ... |
| 8751 | - $out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');'; |
|
| 8751 | + $out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');'; |
|
| 8752 | 8752 | $out .= '$(document).ready(function () { |
| 8753 | - $(\'#' . $htmlname . '\').multiSelect({ |
|
| 8753 | + $(\'#' . $htmlname.'\').multiSelect({ |
|
| 8754 | 8754 | containerHTML: \'<div class="multi-select-container">\', |
| 8755 | 8755 | menuHTML: \'<div class="multi-select-menu">\', |
| 8756 | - buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\', |
|
| 8756 | + buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\', |
|
| 8757 | 8757 | menuItemHTML: \'<label class="multi-select-menuitem">\', |
| 8758 | 8758 | activeClass: \'multi-select-container--open\', |
| 8759 | - noneText: \'' . $placeholder . '\' |
|
| 8759 | + noneText: \'' . $placeholder.'\' |
|
| 8760 | 8760 | }); |
| 8761 | 8761 | })'; |
| 8762 | 8762 | } |
@@ -8788,7 +8788,7 @@ discard block |
||
| 8788 | 8788 | return ''; |
| 8789 | 8789 | } |
| 8790 | 8790 | |
| 8791 | - $tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show |
|
| 8791 | + $tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show |
|
| 8792 | 8792 | |
| 8793 | 8793 | if (!empty($user->conf->$tmpvar)) { // A list of fields was already customized for user |
| 8794 | 8794 | $tmparray = explode(',', $user->conf->$tmpvar); |
@@ -8831,19 +8831,19 @@ discard block |
||
| 8831 | 8831 | } |
| 8832 | 8832 | |
| 8833 | 8833 | // Note: $val['checked'] <> 0 means we must show the field into the combo list |
| 8834 | - $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>'; |
|
| 8835 | - $listcheckedstring .= (empty($val['checked']) ? '' : $key . ','); |
|
| 8834 | + $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>'; |
|
| 8835 | + $listcheckedstring .= (empty($val['checked']) ? '' : $key.','); |
|
| 8836 | 8836 | } |
| 8837 | 8837 | } |
| 8838 | 8838 | |
| 8839 | - $out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' --> |
|
| 8839 | + $out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' --> |
|
| 8840 | 8840 | |
| 8841 | 8841 | <dl class="dropdown"> |
| 8842 | 8842 | <dt> |
| 8843 | - <a href="#' . $htmlname . '"> |
|
| 8844 | - ' . img_picto('', 'list') . ' |
|
| 8843 | + <a href="#' . $htmlname.'"> |
|
| 8844 | + ' . img_picto('', 'list').' |
|
| 8845 | 8845 | </a> |
| 8846 | - <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '"> |
|
| 8846 | + <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'"> |
|
| 8847 | 8847 | </dt> |
| 8848 | 8848 | <dd class="dropdowndd"> |
| 8849 | 8849 | <div class="multiselectcheckbox'.$htmlname.'"> |
@@ -8855,19 +8855,19 @@ discard block |
||
| 8855 | 8855 | </dd> |
| 8856 | 8856 | </dl> |
| 8857 | 8857 | |
| 8858 | - <script nonce="' . getNonce() . '" type="text/javascript"> |
|
| 8858 | + <script nonce="' . getNonce().'" type="text/javascript"> |
|
| 8859 | 8859 | jQuery(document).ready(function () { |
| 8860 | - $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () { |
|
| 8860 | + $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () { |
|
| 8861 | 8861 | console.log("A new field was added/removed, we edit field input[name=formfilteraction]"); |
| 8862 | 8862 | |
| 8863 | 8863 | $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\'); // Update field so we know we changed something on selected fields after POST |
| 8864 | 8864 | |
| 8865 | 8865 | var title = $(this).val() + ","; |
| 8866 | 8866 | if ($(this).is(\':checked\')) { |
| 8867 | - $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val()); |
|
| 8867 | + $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val()); |
|
| 8868 | 8868 | } |
| 8869 | 8869 | else { |
| 8870 | - $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') ) |
|
| 8870 | + $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') ) |
|
| 8871 | 8871 | } |
| 8872 | 8872 | // Now, we submit page |
| 8873 | 8873 | //$(this).parents(\'form:first\').submit(); |
@@ -8898,7 +8898,7 @@ discard block |
||
| 8898 | 8898 | */ |
| 8899 | 8899 | public function showCategories($id, $type, $rendermode = 0, $nolink = 0) |
| 8900 | 8900 | { |
| 8901 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 8901 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 8902 | 8902 | |
| 8903 | 8903 | $cat = new Categorie($this->db); |
| 8904 | 8904 | $categories = $cat->containing($id, $type); |
@@ -8908,10 +8908,10 @@ discard block |
||
| 8908 | 8908 | foreach ($categories as $c) { |
| 8909 | 8909 | $ways = $c->print_all_ways(' >> ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text |
| 8910 | 8910 | foreach ($ways as $way) { |
| 8911 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
| 8911 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
| 8912 | 8912 | } |
| 8913 | 8913 | } |
| 8914 | - return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
| 8914 | + return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
| 8915 | 8915 | } |
| 8916 | 8916 | |
| 8917 | 8917 | if ($rendermode == 0) { |
@@ -8959,15 +8959,15 @@ discard block |
||
| 8959 | 8959 | |
| 8960 | 8960 | |
| 8961 | 8961 | print '<div class="div-table-responsive-no-min">'; |
| 8962 | - print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '" data-elementid="' . $object->id . '" >'; |
|
| 8962 | + print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'" data-elementid="'.$object->id.'" >'; |
|
| 8963 | 8963 | |
| 8964 | 8964 | print '<tr class="liste_titre">'; |
| 8965 | - print '<td>' . $langs->trans("Type") . '</td>'; |
|
| 8966 | - print '<td>' . $langs->trans("Ref") . '</td>'; |
|
| 8965 | + print '<td>'.$langs->trans("Type").'</td>'; |
|
| 8966 | + print '<td>'.$langs->trans("Ref").'</td>'; |
|
| 8967 | 8967 | print '<td class="center"></td>'; |
| 8968 | - print '<td class="center">' . $langs->trans("Date") . '</td>'; |
|
| 8969 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
| 8970 | - print '<td class="right">' . $langs->trans("Status") . '</td>'; |
|
| 8968 | + print '<td class="center">'.$langs->trans("Date").'</td>'; |
|
| 8969 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
| 8970 | + print '<td class="right">'.$langs->trans("Status").'</td>'; |
|
| 8971 | 8971 | print '<td></td>'; |
| 8972 | 8972 | print '</tr>'; |
| 8973 | 8973 | |
@@ -8986,13 +8986,13 @@ discard block |
||
| 8986 | 8986 | if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) { |
| 8987 | 8987 | $element = $regs[1]; |
| 8988 | 8988 | $subelement = $regs[2]; |
| 8989 | - $tplpath = $element . '/' . $subelement; |
|
| 8989 | + $tplpath = $element.'/'.$subelement; |
|
| 8990 | 8990 | } |
| 8991 | 8991 | $tplname = 'linkedobjectblock'; |
| 8992 | 8992 | |
| 8993 | 8993 | // To work with non standard path |
| 8994 | 8994 | if ($objecttype == 'facture') { |
| 8995 | - $tplpath = 'compta/' . $element; |
|
| 8995 | + $tplpath = 'compta/'.$element; |
|
| 8996 | 8996 | if (!isModEnabled('facture')) { |
| 8997 | 8997 | continue; // Do not show if module disabled |
| 8998 | 8998 | } |
@@ -9003,7 +9003,7 @@ discard block |
||
| 9003 | 9003 | continue; // Do not show if module disabled |
| 9004 | 9004 | } |
| 9005 | 9005 | } elseif ($objecttype == 'propal') { |
| 9006 | - $tplpath = 'comm/' . $element; |
|
| 9006 | + $tplpath = 'comm/'.$element; |
|
| 9007 | 9007 | if (!isModEnabled('propal')) { |
| 9008 | 9008 | continue; // Do not show if module disabled |
| 9009 | 9009 | } |
@@ -9054,14 +9054,14 @@ discard block |
||
| 9054 | 9054 | $linkedObjectBlock = $objects; |
| 9055 | 9055 | |
| 9056 | 9056 | // Output template part (modules that overwrite templates must declare this into descriptor) |
| 9057 | - $dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl')); |
|
| 9057 | + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl')); |
|
| 9058 | 9058 | foreach ($dirtpls as $reldir) { |
| 9059 | 9059 | if ($nboftypesoutput == ($nbofdifferenttypes - 1)) { // No more type to show after |
| 9060 | 9060 | global $noMoreLinkedObjectBlockAfter; |
| 9061 | 9061 | $noMoreLinkedObjectBlockAfter = 1; |
| 9062 | 9062 | } |
| 9063 | 9063 | |
| 9064 | - $res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php'); |
|
| 9064 | + $res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); |
|
| 9065 | 9065 | if ($res) { |
| 9066 | 9066 | $nboftypesoutput++; |
| 9067 | 9067 | break; |
@@ -9070,7 +9070,7 @@ discard block |
||
| 9070 | 9070 | } |
| 9071 | 9071 | |
| 9072 | 9072 | if (!$nboftypesoutput) { |
| 9073 | - print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
| 9073 | + print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
| 9074 | 9074 | } |
| 9075 | 9075 | |
| 9076 | 9076 | print '</table>'; |
@@ -9110,14 +9110,14 @@ discard block |
||
| 9110 | 9110 | if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) { |
| 9111 | 9111 | $listofidcompanytoscan = $object->thirdparty->id; |
| 9112 | 9112 | if (($object->thirdparty->parent > 0) && !empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) { |
| 9113 | - $listofidcompanytoscan .= ',' . $object->thirdparty->parent; |
|
| 9113 | + $listofidcompanytoscan .= ','.$object->thirdparty->parent; |
|
| 9114 | 9114 | } |
| 9115 | 9115 | if (($object->fk_project > 0) && !empty($conf->global->THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO)) { |
| 9116 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 9116 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 9117 | 9117 | $tmpproject = new Project($this->db); |
| 9118 | 9118 | $tmpproject->fetch($object->fk_project); |
| 9119 | 9119 | if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) { |
| 9120 | - $listofidcompanytoscan .= ',' . $tmpproject->socid; |
|
| 9120 | + $listofidcompanytoscan .= ','.$tmpproject->socid; |
|
| 9121 | 9121 | } |
| 9122 | 9122 | unset($tmpproject); |
| 9123 | 9123 | } |
@@ -9127,63 +9127,63 @@ discard block |
||
| 9127 | 9127 | 'enabled' => isModEnabled('propal'), |
| 9128 | 9128 | 'perms' => 1, |
| 9129 | 9129 | 'label' => 'LinkToProposal', |
| 9130 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('propal') . ')'), |
|
| 9130 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('propal').')'), |
|
| 9131 | 9131 | 'shipping' => array( |
| 9132 | 9132 | 'enabled' => isModEnabled('expedition'), |
| 9133 | 9133 | 'perms' => 1, |
| 9134 | 9134 | 'label' => 'LinkToExpedition', |
| 9135 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('shipping') . ')'), |
|
| 9135 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('shipping').')'), |
|
| 9136 | 9136 | 'order' => array( |
| 9137 | 9137 | 'enabled' => isModEnabled('commande'), |
| 9138 | 9138 | 'perms' => 1, |
| 9139 | 9139 | 'label' => 'LinkToOrder', |
| 9140 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande') . ')'), |
|
| 9140 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande').')'), |
|
| 9141 | 9141 | 'invoice' => array( |
| 9142 | 9142 | 'enabled' => isModEnabled('facture'), |
| 9143 | 9143 | 'perms' => 1, |
| 9144 | 9144 | 'label' => 'LinkToInvoice', |
| 9145 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'), |
|
| 9145 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), |
|
| 9146 | 9146 | 'invoice_template' => array( |
| 9147 | 9147 | 'enabled' => isModEnabled('facture'), |
| 9148 | 9148 | 'perms' => 1, |
| 9149 | 9149 | 'label' => 'LinkToTemplateInvoice', |
| 9150 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'), |
|
| 9150 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), |
|
| 9151 | 9151 | 'contrat' => array( |
| 9152 | 9152 | 'enabled' => isModEnabled('contrat'), |
| 9153 | 9153 | 'perms' => 1, |
| 9154 | 9154 | 'label' => 'LinkToContract', |
| 9155 | 9155 | 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht |
| 9156 | - FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "contrat as t, " . $this->db->prefix() . "contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('contract') . ') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier' |
|
| 9156 | + FROM " . $this->db->prefix()."societe as s, ".$this->db->prefix()."contrat as t, ".$this->db->prefix()."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier' |
|
| 9157 | 9157 | ), |
| 9158 | 9158 | 'fichinter' => array( |
| 9159 | 9159 | 'enabled' => isModEnabled('ficheinter'), |
| 9160 | 9160 | 'perms' => 1, |
| 9161 | 9161 | 'label' => 'LinkToIntervention', |
| 9162 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('intervention') . ')'), |
|
| 9162 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'), |
|
| 9163 | 9163 | 'supplier_proposal' => array( |
| 9164 | 9164 | 'enabled' => isModEnabled('supplier_proposal'), |
| 9165 | 9165 | 'perms' => 1, |
| 9166 | 9166 | 'label' => 'LinkToSupplierProposal', |
| 9167 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('supplier_proposal') . ')'), |
|
| 9167 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), |
|
| 9168 | 9168 | 'order_supplier' => array( |
| 9169 | 9169 | 'enabled' => isModEnabled("supplier_order"), |
| 9170 | 9170 | 'perms' => 1, |
| 9171 | 9171 | 'label' => 'LinkToSupplierOrder', |
| 9172 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande_fournisseur') . ')'), |
|
| 9172 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), |
|
| 9173 | 9173 | 'invoice_supplier' => array( |
| 9174 | 9174 | 'enabled' => isModEnabled("supplier_invoice"), |
| 9175 | 9175 | 'perms' => 1, 'label' => 'LinkToSupplierInvoice', |
| 9176 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('facture_fourn') . ')'), |
|
| 9176 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('facture_fourn').')'), |
|
| 9177 | 9177 | 'ticket' => array( |
| 9178 | 9178 | 'enabled' => isModEnabled('ticket'), |
| 9179 | 9179 | 'perms' => 1, |
| 9180 | 9180 | 'label' => 'LinkToTicket', |
| 9181 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('ticket') . ')'), |
|
| 9181 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')'), |
|
| 9182 | 9182 | 'mo' => array( |
| 9183 | 9183 | 'enabled' => isModEnabled('mrp'), |
| 9184 | 9184 | 'perms' => 1, |
| 9185 | 9185 | 'label' => 'LinkToMo', |
| 9186 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM " . $this->db->prefix() . "societe as s INNER JOIN " . $this->db->prefix() . "mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('mo') . ')') |
|
| 9186 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM ".$this->db->prefix()."societe as s INNER JOIN ".$this->db->prefix()."mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('mo').')') |
|
| 9187 | 9187 | ); |
| 9188 | 9188 | } |
| 9189 | 9189 | |
@@ -9218,22 +9218,22 @@ discard block |
||
| 9218 | 9218 | } |
| 9219 | 9219 | |
| 9220 | 9220 | if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) { |
| 9221 | - print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>'; |
|
| 9221 | + print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>'; |
|
| 9222 | 9222 | |
| 9223 | 9223 | if (!empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) { |
| 9224 | 9224 | print '<br>'."\n"; |
| 9225 | 9225 | print '<!-- form to add a link from anywhere -->'."\n"; |
| 9226 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">'; |
|
| 9227 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 9226 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">'; |
|
| 9227 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 9228 | 9228 | print '<input type="hidden" name="action" value="addlinkbyref">'; |
| 9229 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 9230 | - print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
| 9229 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 9230 | + print '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
| 9231 | 9231 | print '<table class="noborder">'; |
| 9232 | 9232 | print '<tr>'; |
| 9233 | 9233 | //print '<td>' . $langs->trans("Ref") . '</td>'; |
| 9234 | - print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '"> '; |
|
| 9235 | - print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '"> '; |
|
| 9236 | - print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>'; |
|
| 9234 | + print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'"> '; |
|
| 9235 | + print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'"> '; |
|
| 9236 | + print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>'; |
|
| 9237 | 9237 | print '</tr>'; |
| 9238 | 9238 | print '</table>'; |
| 9239 | 9239 | print '</form>'; |
@@ -9248,48 +9248,48 @@ discard block |
||
| 9248 | 9248 | |
| 9249 | 9249 | print '<br>'; |
| 9250 | 9250 | print '<!-- form to add a link from object to same thirdparty -->'."\n"; |
| 9251 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">'; |
|
| 9251 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">'; |
|
| 9252 | 9252 | print '<input type="hidden" name="action" value="addlink">'; |
| 9253 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 9254 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 9255 | - print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
| 9253 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 9254 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 9255 | + print '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
| 9256 | 9256 | print '<table class="noborder">'; |
| 9257 | 9257 | print '<tr class="liste_titre">'; |
| 9258 | 9258 | print '<td class="nowrap"></td>'; |
| 9259 | - print '<td class="center">' . $langs->trans("Ref") . '</td>'; |
|
| 9260 | - print '<td class="left">' . $langs->trans("RefCustomer") . '</td>'; |
|
| 9261 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
| 9262 | - print '<td class="left">' . $langs->trans("Company") . '</td>'; |
|
| 9259 | + print '<td class="center">'.$langs->trans("Ref").'</td>'; |
|
| 9260 | + print '<td class="left">'.$langs->trans("RefCustomer").'</td>'; |
|
| 9261 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
| 9262 | + print '<td class="left">'.$langs->trans("Company").'</td>'; |
|
| 9263 | 9263 | print '</tr>'; |
| 9264 | 9264 | while ($i < $num) { |
| 9265 | 9265 | $objp = $this->db->fetch_object($resqllist); |
| 9266 | 9266 | |
| 9267 | 9267 | print '<tr class="oddeven">'; |
| 9268 | 9268 | print '<td class="left">'; |
| 9269 | - print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">'; |
|
| 9269 | + print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">'; |
|
| 9270 | 9270 | print '</td>'; |
| 9271 | - print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>'; |
|
| 9272 | - print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>'; |
|
| 9271 | + print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>'; |
|
| 9272 | + print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>'; |
|
| 9273 | 9273 | print '<td class="right">'; |
| 9274 | 9274 | if ($possiblelink['label'] == 'LinkToContract') { |
| 9275 | 9275 | $form = new Form($this->db); |
| 9276 | - print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' '; |
|
| 9276 | + print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; |
|
| 9277 | 9277 | } |
| 9278 | - print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>'; |
|
| 9278 | + print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>'; |
|
| 9279 | 9279 | print '</td>'; |
| 9280 | - print '<td>' . $objp->name . '</td>'; |
|
| 9280 | + print '<td>'.$objp->name.'</td>'; |
|
| 9281 | 9281 | print '</tr>'; |
| 9282 | 9282 | $i++; |
| 9283 | 9283 | } |
| 9284 | 9284 | print '</table>'; |
| 9285 | 9285 | print '<div class="center">'; |
| 9286 | 9286 | if ($num) { |
| 9287 | - print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">'; |
|
| 9287 | + print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">'; |
|
| 9288 | 9288 | } |
| 9289 | 9289 | if (empty($conf->use_javascript_ajax)) { |
| 9290 | - print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
| 9290 | + print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
| 9291 | 9291 | } else { |
| 9292 | - print '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
| 9292 | + print '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
| 9293 | 9293 | } |
| 9294 | 9294 | print '</form>'; |
| 9295 | 9295 | $this->db->free($resqllist); |
@@ -9300,10 +9300,10 @@ discard block |
||
| 9300 | 9300 | |
| 9301 | 9301 | //$linktoelem.=($linktoelem?' ':''); |
| 9302 | 9302 | if ($num > 0 || !empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) { |
| 9303 | - $linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>'; |
|
| 9303 | + $linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>'; |
|
| 9304 | 9304 | // } else $linktoelem.=$langs->trans($possiblelink['label']); |
| 9305 | 9305 | } else { |
| 9306 | - $linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>'; |
|
| 9306 | + $linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>'; |
|
| 9307 | 9307 | } |
| 9308 | 9308 | } |
| 9309 | 9309 | } |
@@ -9313,11 +9313,11 @@ discard block |
||
| 9313 | 9313 | <dl class="dropdown" id="linktoobjectname"> |
| 9314 | 9314 | '; |
| 9315 | 9315 | if (!empty($conf->use_javascript_ajax)) { |
| 9316 | - $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>'; |
|
| 9316 | + $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>'; |
|
| 9317 | 9317 | } |
| 9318 | 9318 | $linktoelem .= '<dd> |
| 9319 | 9319 | <div class="multiselectlinkto"> |
| 9320 | - <ul class="ulselectedfields">' . $linktoelemlist . ' |
|
| 9320 | + <ul class="ulselectedfields">' . $linktoelemlist.' |
|
| 9321 | 9321 | </ul> |
| 9322 | 9322 | </div> |
| 9323 | 9323 | </dd> |
@@ -9328,7 +9328,7 @@ discard block |
||
| 9328 | 9328 | |
| 9329 | 9329 | if (!empty($conf->use_javascript_ajax)) { |
| 9330 | 9330 | print '<!-- Add js to show linkto box --> |
| 9331 | - <script nonce="' . getNonce() . '"> |
|
| 9331 | + <script nonce="' . getNonce().'"> |
|
| 9332 | 9332 | jQuery(document).ready(function() { |
| 9333 | 9333 | jQuery(".linkto").click(function() { |
| 9334 | 9334 | console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list"); |
@@ -9369,19 +9369,19 @@ discard block |
||
| 9369 | 9369 | |
| 9370 | 9370 | $disabled = ($disabled ? ' disabled' : ''); |
| 9371 | 9371 | |
| 9372 | - $resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n"; |
|
| 9372 | + $resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n"; |
|
| 9373 | 9373 | if ($useempty) { |
| 9374 | - $resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '> </option>' . "\n"; |
|
| 9374 | + $resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'> </option>'."\n"; |
|
| 9375 | 9375 | } |
| 9376 | 9376 | if (("$value" == 'yes') || ($value == 1)) { |
| 9377 | - $resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
| 9378 | - $resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n"; |
|
| 9377 | + $resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n"; |
|
| 9378 | + $resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n"; |
|
| 9379 | 9379 | } else { |
| 9380 | 9380 | $selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected'); |
| 9381 | - $resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
| 9382 | - $resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n"; |
|
| 9381 | + $resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n"; |
|
| 9382 | + $resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n"; |
|
| 9383 | 9383 | } |
| 9384 | - $resultyesno .= '</select>' . "\n"; |
|
| 9384 | + $resultyesno .= '</select>'."\n"; |
|
| 9385 | 9385 | |
| 9386 | 9386 | if ($addjscombo) { |
| 9387 | 9387 | $resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss); |
@@ -9405,12 +9405,12 @@ discard block |
||
| 9405 | 9405 | { |
| 9406 | 9406 | // phpcs:enable |
| 9407 | 9407 | $sql = "SELECT rowid, label"; |
| 9408 | - $sql .= " FROM " . $this->db->prefix() . "export_model"; |
|
| 9409 | - $sql .= " WHERE type = '" . $this->db->escape($type) . "'"; |
|
| 9408 | + $sql .= " FROM ".$this->db->prefix()."export_model"; |
|
| 9409 | + $sql .= " WHERE type = '".$this->db->escape($type)."'"; |
|
| 9410 | 9410 | $sql .= " ORDER BY rowid"; |
| 9411 | 9411 | $result = $this->db->query($sql); |
| 9412 | 9412 | if ($result) { |
| 9413 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 9413 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 9414 | 9414 | if ($useempty) { |
| 9415 | 9415 | print '<option value="-1"> </option>'; |
| 9416 | 9416 | } |
@@ -9420,9 +9420,9 @@ discard block |
||
| 9420 | 9420 | while ($i < $num) { |
| 9421 | 9421 | $obj = $this->db->fetch_object($result); |
| 9422 | 9422 | if ($selected == $obj->rowid) { |
| 9423 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 9423 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 9424 | 9424 | } else { |
| 9425 | - print '<option value="' . $obj->rowid . '">'; |
|
| 9425 | + print '<option value="'.$obj->rowid.'">'; |
|
| 9426 | 9426 | } |
| 9427 | 9427 | print $obj->label; |
| 9428 | 9428 | print '</option>'; |
@@ -9512,8 +9512,8 @@ discard block |
||
| 9512 | 9512 | $stringforfirstkey .= ' CTL +'; |
| 9513 | 9513 | } |
| 9514 | 9514 | |
| 9515 | - $previous_ref = $object->ref_previous ? '<a accesskey="p" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_previous) . $moreparam . '"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>'; |
|
| 9516 | - $next_ref = $object->ref_next ? '<a accesskey="n" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_next) . $moreparam . '"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>'; |
|
| 9515 | + $previous_ref = $object->ref_previous ? '<a accesskey="p" title="'.$stringforfirstkey.' p" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>'; |
|
| 9516 | + $next_ref = $object->ref_next ? '<a accesskey="n" title="'.$stringforfirstkey.' n" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>'; |
|
| 9517 | 9517 | } |
| 9518 | 9518 | |
| 9519 | 9519 | //print "xx".$previous_ref."x".$next_ref; |
@@ -9521,18 +9521,18 @@ discard block |
||
| 9521 | 9521 | |
| 9522 | 9522 | // Right part of banner |
| 9523 | 9523 | if ($morehtmlright) { |
| 9524 | - $ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>'; |
|
| 9524 | + $ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>'; |
|
| 9525 | 9525 | } |
| 9526 | 9526 | |
| 9527 | 9527 | if ($previous_ref || $next_ref || $morehtml) { |
| 9528 | 9528 | $ret .= '<div class="pagination paginationref"><ul class="right">'; |
| 9529 | 9529 | } |
| 9530 | 9530 | if ($morehtml) { |
| 9531 | - $ret .= '<li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>'; |
|
| 9531 | + $ret .= '<li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>'; |
|
| 9532 | 9532 | } |
| 9533 | 9533 | if ($shownav && ($previous_ref || $next_ref)) { |
| 9534 | - $ret .= '<li class="pagination">' . $previous_ref . '</li>'; |
|
| 9535 | - $ret .= '<li class="pagination">' . $next_ref . '</li>'; |
|
| 9534 | + $ret .= '<li class="pagination">'.$previous_ref.'</li>'; |
|
| 9535 | + $ret .= '<li class="pagination">'.$next_ref.'</li>'; |
|
| 9536 | 9536 | } |
| 9537 | 9537 | if ($previous_ref || $next_ref || $morehtml) { |
| 9538 | 9538 | $ret .= '</ul></div>'; |
@@ -9547,7 +9547,7 @@ discard block |
||
| 9547 | 9547 | $morehtmlstatus = $hookmanager->resPrint; |
| 9548 | 9548 | } |
| 9549 | 9549 | if ($morehtmlstatus) { |
| 9550 | - $ret .= '<div class="statusref">' . $morehtmlstatus . '</div>'; |
|
| 9550 | + $ret .= '<div class="statusref">'.$morehtmlstatus.'</div>'; |
|
| 9551 | 9551 | } |
| 9552 | 9552 | |
| 9553 | 9553 | $parameters = array(); |
@@ -9561,14 +9561,14 @@ discard block |
||
| 9561 | 9561 | // Left part of banner |
| 9562 | 9562 | if ($morehtmlleft) { |
| 9563 | 9563 | if ($conf->browser->layout == 'phone') { |
| 9564 | - $ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>'; |
|
| 9564 | + $ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>'; |
|
| 9565 | 9565 | } else { |
| 9566 | - $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>'; |
|
| 9566 | + $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>'; |
|
| 9567 | 9567 | } |
| 9568 | 9568 | } |
| 9569 | 9569 | |
| 9570 | 9570 | //if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>'; |
| 9571 | - $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">'; |
|
| 9571 | + $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">'; |
|
| 9572 | 9572 | |
| 9573 | 9573 | // For thirdparty, contact, user, member, the ref is the id, so we show something else |
| 9574 | 9574 | if ($object->element == 'societe') { |
@@ -9582,7 +9582,7 @@ discard block |
||
| 9582 | 9582 | |
| 9583 | 9583 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
| 9584 | 9584 | if (!is_object($extralanguages)) { |
| 9585 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
| 9585 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
| 9586 | 9586 | $extralanguages = new ExtraLanguages($this->db); |
| 9587 | 9587 | } |
| 9588 | 9588 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -9597,27 +9597,27 @@ discard block |
||
| 9597 | 9597 | if ($object->array_languages['name'][$extralangcode]) { |
| 9598 | 9598 | $htmltext .= $object->array_languages['name'][$extralangcode]; |
| 9599 | 9599 | } else { |
| 9600 | - $htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>'; |
|
| 9600 | + $htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>'; |
|
| 9601 | 9601 | } |
| 9602 | 9602 | } |
| 9603 | - $ret .= '<!-- Show translations of name -->' . "\n"; |
|
| 9603 | + $ret .= '<!-- Show translations of name -->'."\n"; |
|
| 9604 | 9604 | $ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft'); |
| 9605 | 9605 | } |
| 9606 | 9606 | } |
| 9607 | 9607 | } elseif ($object->element == 'member') { |
| 9608 | - $ret .= $object->ref . '<br>'; |
|
| 9608 | + $ret .= $object->ref.'<br>'; |
|
| 9609 | 9609 | $fullname = $object->getFullName($langs); |
| 9610 | 9610 | if ($object->morphy == 'mor' && $object->societe) { |
| 9611 | - $ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''); |
|
| 9611 | + $ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : ''); |
|
| 9612 | 9612 | } else { |
| 9613 | - $ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : ''); |
|
| 9613 | + $ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : ''); |
|
| 9614 | 9614 | } |
| 9615 | 9615 | } elseif (in_array($object->element, array('contact', 'user'))) { |
| 9616 | - $ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt; |
|
| 9616 | + $ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt; |
|
| 9617 | 9617 | } elseif ($object->element == 'usergroup') { |
| 9618 | 9618 | $ret .= dol_htmlentities($object->name); |
| 9619 | 9619 | } elseif (in_array($object->element, array('action', 'agenda'))) { |
| 9620 | - $ret .= $object->ref . '<br>' . $object->label; |
|
| 9620 | + $ret .= $object->ref.'<br>'.$object->label; |
|
| 9621 | 9621 | } elseif (in_array($object->element, array('adherent_type'))) { |
| 9622 | 9622 | $ret .= $object->label; |
| 9623 | 9623 | } elseif ($object->element == 'ecm_directories') { |
@@ -9669,9 +9669,9 @@ discard block |
||
| 9669 | 9669 | } |
| 9670 | 9670 | |
| 9671 | 9671 | // Barcode image |
| 9672 | - $url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code); |
|
| 9673 | - $out = '<!-- url barcode = ' . $url . ' -->'; |
|
| 9674 | - $out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>'; |
|
| 9672 | + $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code); |
|
| 9673 | + $out = '<!-- url barcode = '.$url.' -->'; |
|
| 9674 | + $out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>'; |
|
| 9675 | 9675 | |
| 9676 | 9676 | return $out; |
| 9677 | 9677 | } |
@@ -9711,28 +9711,28 @@ discard block |
||
| 9711 | 9711 | if (!empty($object->logo)) { |
| 9712 | 9712 | if (dolIsAllowedForPreview($object->logo)) { |
| 9713 | 9713 | if ((string) $imagesize == 'mini') { |
| 9714 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
| 9714 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
| 9715 | 9715 | } elseif ((string) $imagesize == 'small') { |
| 9716 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small'); |
|
| 9716 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small'); |
|
| 9717 | 9717 | } else { |
| 9718 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
| 9718 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
| 9719 | 9719 | } |
| 9720 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
| 9720 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
| 9721 | 9721 | } |
| 9722 | 9722 | } |
| 9723 | 9723 | $email = $object->email; |
| 9724 | 9724 | } elseif ($modulepart == 'contact') { |
| 9725 | - $dir = $conf->societe->multidir_output[$entity] . '/contact'; |
|
| 9725 | + $dir = $conf->societe->multidir_output[$entity].'/contact'; |
|
| 9726 | 9726 | if (!empty($object->photo)) { |
| 9727 | 9727 | if (dolIsAllowedForPreview($object->photo)) { |
| 9728 | 9728 | if ((string) $imagesize == 'mini') { |
| 9729 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 9729 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 9730 | 9730 | } elseif ((string) $imagesize == 'small') { |
| 9731 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 9731 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 9732 | 9732 | } else { |
| 9733 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
| 9733 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
| 9734 | 9734 | } |
| 9735 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
| 9735 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
| 9736 | 9736 | } |
| 9737 | 9737 | } |
| 9738 | 9738 | $email = $object->email; |
@@ -9742,17 +9742,17 @@ discard block |
||
| 9742 | 9742 | if (!empty($object->photo)) { |
| 9743 | 9743 | if (dolIsAllowedForPreview($object->photo)) { |
| 9744 | 9744 | if ((string) $imagesize == 'mini') { |
| 9745 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 9745 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 9746 | 9746 | } elseif ((string) $imagesize == 'small') { |
| 9747 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 9747 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 9748 | 9748 | } else { |
| 9749 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
| 9749 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
| 9750 | 9750 | } |
| 9751 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
| 9751 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
| 9752 | 9752 | } |
| 9753 | 9753 | } |
| 9754 | 9754 | if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) { |
| 9755 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 9755 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 9756 | 9756 | } |
| 9757 | 9757 | $email = $object->email; |
| 9758 | 9758 | $capture = 'user'; |
@@ -9761,17 +9761,17 @@ discard block |
||
| 9761 | 9761 | if (!empty($object->photo)) { |
| 9762 | 9762 | if (dolIsAllowedForPreview($object->photo)) { |
| 9763 | 9763 | if ((string) $imagesize == 'mini') { |
| 9764 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 9764 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 9765 | 9765 | } elseif ((string) $imagesize == 'small') { |
| 9766 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 9766 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 9767 | 9767 | } else { |
| 9768 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
| 9768 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
| 9769 | 9769 | } |
| 9770 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
| 9770 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
| 9771 | 9771 | } |
| 9772 | 9772 | } |
| 9773 | 9773 | if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) { |
| 9774 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 9774 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 9775 | 9775 | } |
| 9776 | 9776 | $email = $object->email; |
| 9777 | 9777 | $capture = 'user'; |
@@ -9781,17 +9781,17 @@ discard block |
||
| 9781 | 9781 | if (!empty($object->photo)) { |
| 9782 | 9782 | if (dolIsAllowedForPreview($object->photo)) { |
| 9783 | 9783 | if ((string) $imagesize == 'mini') { |
| 9784 | - $file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 9784 | + $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 9785 | 9785 | } elseif ((string) $imagesize == 'small') { |
| 9786 | - $file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 9786 | + $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 9787 | 9787 | } else { |
| 9788 | - $file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo; |
|
| 9788 | + $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; |
|
| 9789 | 9789 | } |
| 9790 | - $originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo; |
|
| 9790 | + $originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; |
|
| 9791 | 9791 | } |
| 9792 | 9792 | } |
| 9793 | 9793 | if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) { |
| 9794 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 9794 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 9795 | 9795 | } |
| 9796 | 9796 | $email = $object->email; |
| 9797 | 9797 | } |
@@ -9801,35 +9801,35 @@ discard block |
||
| 9801 | 9801 | } |
| 9802 | 9802 | |
| 9803 | 9803 | if ($dir) { |
| 9804 | - if ($file && file_exists($dir . "/" . $file)) { |
|
| 9804 | + if ($file && file_exists($dir."/".$file)) { |
|
| 9805 | 9805 | if ($addlinktofullsize) { |
| 9806 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
| 9806 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
| 9807 | 9807 | if ($urladvanced) { |
| 9808 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
| 9808 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
| 9809 | 9809 | } else { |
| 9810 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
| 9810 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
| 9811 | 9811 | } |
| 9812 | 9812 | } |
| 9813 | - $ret .= '<img alt="Photo" class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . ' photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($file) . '&cache=' . $cache . '">'; |
|
| 9813 | + $ret .= '<img alt="Photo" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">'; |
|
| 9814 | 9814 | if ($addlinktofullsize) { |
| 9815 | 9815 | $ret .= '</a>'; |
| 9816 | 9816 | } |
| 9817 | - } elseif ($altfile && file_exists($dir . "/" . $altfile)) { |
|
| 9817 | + } elseif ($altfile && file_exists($dir."/".$altfile)) { |
|
| 9818 | 9818 | if ($addlinktofullsize) { |
| 9819 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
| 9819 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
| 9820 | 9820 | if ($urladvanced) { |
| 9821 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
| 9821 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
| 9822 | 9822 | } else { |
| 9823 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
| 9823 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
| 9824 | 9824 | } |
| 9825 | 9825 | } |
| 9826 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="Photo alt" id="photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" class="' . $cssclass . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($altfile) . '&cache=' . $cache . '">'; |
|
| 9826 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="Photo alt" id="photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" class="'.$cssclass.'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($altfile).'&cache='.$cache.'">'; |
|
| 9827 | 9827 | if ($addlinktofullsize) { |
| 9828 | 9828 | $ret .= '</a>'; |
| 9829 | 9829 | } |
| 9830 | 9830 | } else { |
| 9831 | 9831 | $nophoto = '/public/theme/common/nophoto.png'; |
| 9832 | - $defaultimg = 'identicon'; // For gravatar |
|
| 9832 | + $defaultimg = 'identicon'; // For gravatar |
|
| 9833 | 9833 | if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) { // For modules that need a special image when photo not found |
| 9834 | 9834 | if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor')) !== false) { |
| 9835 | 9835 | $nophoto = 'company'; |
@@ -9847,13 +9847,13 @@ discard block |
||
| 9847 | 9847 | if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) { |
| 9848 | 9848 | // see https://gravatar.com/site/implement/images/php/ |
| 9849 | 9849 | $ret .= '<!-- Put link to gravatar -->'; |
| 9850 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" title="' . $email . ' Gravatar avatar" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="https://www.gravatar.com/avatar/' . md5(strtolower(trim($email))) . '?s=' . $width . '&d=' . $defaultimg . '">'; // gravatar need md5 hash |
|
| 9850 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.md5(strtolower(trim($email))).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash |
|
| 9851 | 9851 | } else { |
| 9852 | 9852 | if ($nophoto == 'company') { |
| 9853 | - $ret .= '<div class="divforspanimg photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>'; |
|
| 9853 | + $ret .= '<div class="divforspanimg photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>'; |
|
| 9854 | 9854 | $ret .= '<div class="difforspanimgright"></div>'; |
| 9855 | 9855 | } else { |
| 9856 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">'; |
|
| 9856 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">'; |
|
| 9857 | 9857 | } |
| 9858 | 9858 | } |
| 9859 | 9859 | } |
@@ -9864,15 +9864,15 @@ discard block |
||
| 9864 | 9864 | } |
| 9865 | 9865 | $ret .= '<table class="nobordernopadding centpercent">'; |
| 9866 | 9866 | if ($object->photo) { |
| 9867 | - $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>'; |
|
| 9867 | + $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>'; |
|
| 9868 | 9868 | } |
| 9869 | 9869 | $ret .= '<tr><td class="tdoverflow">'; |
| 9870 | 9870 | $maxfilesizearray = getMaxFileSizeArray(); |
| 9871 | 9871 | $maxmin = $maxfilesizearray['maxmin']; |
| 9872 | 9872 | if ($maxmin > 0) { |
| 9873 | - $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 9873 | + $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 9874 | 9874 | } |
| 9875 | - $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>'; |
|
| 9875 | + $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>'; |
|
| 9876 | 9876 | $ret .= '</td></tr>'; |
| 9877 | 9877 | $ret .= '</table>'; |
| 9878 | 9878 | } |
@@ -9926,38 +9926,38 @@ discard block |
||
| 9926 | 9926 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 9927 | 9927 | $sql .= ", e.label"; |
| 9928 | 9928 | } |
| 9929 | - $sql .= " FROM " . $this->db->prefix() . "usergroup as ug "; |
|
| 9929 | + $sql .= " FROM ".$this->db->prefix()."usergroup as ug "; |
|
| 9930 | 9930 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 9931 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity"; |
|
| 9931 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity"; |
|
| 9932 | 9932 | if ($force_entity) { |
| 9933 | - $sql .= " WHERE ug.entity IN (0, " . $force_entity . ")"; |
|
| 9933 | + $sql .= " WHERE ug.entity IN (0, ".$force_entity.")"; |
|
| 9934 | 9934 | } else { |
| 9935 | 9935 | $sql .= " WHERE ug.entity IS NOT NULL"; |
| 9936 | 9936 | } |
| 9937 | 9937 | } else { |
| 9938 | - $sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")"; |
|
| 9938 | + $sql .= " WHERE ug.entity IN (0, ".$conf->entity.")"; |
|
| 9939 | 9939 | } |
| 9940 | 9940 | if (is_array($exclude) && $excludeGroups) { |
| 9941 | - $sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")"; |
|
| 9941 | + $sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")"; |
|
| 9942 | 9942 | } |
| 9943 | 9943 | if (is_array($include) && $includeGroups) { |
| 9944 | - $sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")"; |
|
| 9944 | + $sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")"; |
|
| 9945 | 9945 | } |
| 9946 | 9946 | $sql .= " ORDER BY ug.nom ASC"; |
| 9947 | 9947 | |
| 9948 | - dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG); |
|
| 9948 | + dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG); |
|
| 9949 | 9949 | $resql = $this->db->query($sql); |
| 9950 | 9950 | if ($resql) { |
| 9951 | 9951 | // Enhance with select2 |
| 9952 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 9952 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 9953 | 9953 | |
| 9954 | - $out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
| 9954 | + $out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
| 9955 | 9955 | |
| 9956 | 9956 | $num = $this->db->num_rows($resql); |
| 9957 | 9957 | $i = 0; |
| 9958 | 9958 | if ($num) { |
| 9959 | 9959 | if ($show_empty && !$multiple) { |
| 9960 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '> </option>' . "\n"; |
|
| 9960 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'> </option>'."\n"; |
|
| 9961 | 9961 | } |
| 9962 | 9962 | |
| 9963 | 9963 | while ($i < $num) { |
@@ -9967,7 +9967,7 @@ discard block |
||
| 9967 | 9967 | $disableline = 1; |
| 9968 | 9968 | } |
| 9969 | 9969 | |
| 9970 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 9970 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 9971 | 9971 | if ($disableline) { |
| 9972 | 9972 | $out .= ' disabled'; |
| 9973 | 9973 | } |
@@ -9978,7 +9978,7 @@ discard block |
||
| 9978 | 9978 | |
| 9979 | 9979 | $out .= $obj->name; |
| 9980 | 9980 | if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) { |
| 9981 | - $out .= " (" . $obj->label . ")"; |
|
| 9981 | + $out .= " (".$obj->label.")"; |
|
| 9982 | 9982 | } |
| 9983 | 9983 | |
| 9984 | 9984 | $out .= '</option>'; |
@@ -9986,9 +9986,9 @@ discard block |
||
| 9986 | 9986 | } |
| 9987 | 9987 | } else { |
| 9988 | 9988 | if ($show_empty) { |
| 9989 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n"; |
|
| 9989 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n"; |
|
| 9990 | 9990 | } |
| 9991 | - $out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>'; |
|
| 9991 | + $out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>'; |
|
| 9992 | 9992 | } |
| 9993 | 9993 | $out .= '</select>'; |
| 9994 | 9994 | |
@@ -10037,25 +10037,25 @@ discard block |
||
| 10037 | 10037 | $out = ''; |
| 10038 | 10038 | |
| 10039 | 10039 | if (!empty($conf->use_javascript_ajax)) { |
| 10040 | - $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>'; |
|
| 10040 | + $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>'; |
|
| 10041 | 10041 | } |
| 10042 | - $out .= '<script nonce="' . getNonce() . '"> |
|
| 10042 | + $out .= '<script nonce="'.getNonce().'"> |
|
| 10043 | 10043 | $(document).ready(function() { |
| 10044 | - $("#' . $cssclass . 's").click(function() { |
|
| 10044 | + $("#' . $cssclass.'s").click(function() { |
|
| 10045 | 10045 | if($(this).is(\':checked\')){ |
| 10046 | - console.log("We check all ' . $cssclass . ' and trigger the change method"); |
|
| 10047 | - $(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\'); |
|
| 10046 | + console.log("We check all ' . $cssclass.' and trigger the change method"); |
|
| 10047 | + $(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\'); |
|
| 10048 | 10048 | } |
| 10049 | 10049 | else |
| 10050 | 10050 | { |
| 10051 | 10051 | console.log("We uncheck all"); |
| 10052 | - $(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\'); |
|
| 10052 | + $(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\'); |
|
| 10053 | 10053 | }' . "\n"; |
| 10054 | 10054 | if ($calljsfunction) { |
| 10055 | - $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
| 10055 | + $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
| 10056 | 10056 | } |
| 10057 | 10057 | $out .= ' }); |
| 10058 | - $(".' . $cssclass . '").change(function() { |
|
| 10058 | + $(".' . $cssclass.'").change(function() { |
|
| 10059 | 10059 | $(this).closest("tr").toggleClass("highlight", this.checked); |
| 10060 | 10060 | }); |
| 10061 | 10061 | }); |
@@ -10100,67 +10100,67 @@ discard block |
||
| 10100 | 10100 | global $langs, $user; |
| 10101 | 10101 | |
| 10102 | 10102 | $out = ''; |
| 10103 | - $sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1"; |
|
| 10104 | - $sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")"; |
|
| 10103 | + $sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1"; |
|
| 10104 | + $sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")"; |
|
| 10105 | 10105 | if (!empty($excludeid)) { |
| 10106 | - $sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")"; |
|
| 10106 | + $sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")"; |
|
| 10107 | 10107 | } |
| 10108 | 10108 | $sql .= " ORDER BY label"; |
| 10109 | 10109 | |
| 10110 | 10110 | $resql = $this->db->query($sql); |
| 10111 | 10111 | if ($resql) { |
| 10112 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">'; |
|
| 10112 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">'; |
|
| 10113 | 10113 | if ($useempty) { |
| 10114 | 10114 | $out .= '<option value="0"> </option>'; |
| 10115 | 10115 | } |
| 10116 | 10116 | |
| 10117 | 10117 | while ($obj = $this->db->fetch_object($resql)) { |
| 10118 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>'; |
|
| 10118 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>'; |
|
| 10119 | 10119 | } |
| 10120 | 10120 | $out .= '</select>'; |
| 10121 | - $out .= ajax_combobox('select_' . $htmlname); |
|
| 10121 | + $out .= ajax_combobox('select_'.$htmlname); |
|
| 10122 | 10122 | |
| 10123 | 10123 | if (!empty($htmlname) && $user->admin && $info_admin) { |
| 10124 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 10124 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 10125 | 10125 | } |
| 10126 | 10126 | |
| 10127 | 10127 | if (!empty($target)) { |
| 10128 | - $sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
| 10128 | + $sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
| 10129 | 10129 | $resql = $this->db->query($sql); |
| 10130 | 10130 | if ($resql) { |
| 10131 | 10131 | if ($this->db->num_rows($resql) > 0) { |
| 10132 | 10132 | $obj = $this->db->fetch_object($resql); |
| 10133 | - $out .= '<script nonce="' . getNonce() . '"> |
|
| 10133 | + $out .= '<script nonce="'.getNonce().'"> |
|
| 10134 | 10134 | $(function() { |
| 10135 | - $("select[name=' . $target . ']").on("change", function() { |
|
| 10135 | + $("select[name=' . $target.']").on("change", function() { |
|
| 10136 | 10136 | var current_val = $(this).val(); |
| 10137 | - if (current_val == ' . $obj->id . ') {'; |
|
| 10137 | + if (current_val == ' . $obj->id.') {'; |
|
| 10138 | 10138 | if (!empty($default_selected) || !empty($selected)) { |
| 10139 | - $out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");'; |
|
| 10139 | + $out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");'; |
|
| 10140 | 10140 | } |
| 10141 | 10141 | |
| 10142 | 10142 | $out .= ' |
| 10143 | - $("select[name=' . $htmlname . ']").change(); |
|
| 10143 | + $("select[name=' . $htmlname.']").change(); |
|
| 10144 | 10144 | } |
| 10145 | 10145 | }); |
| 10146 | 10146 | |
| 10147 | - $("select[name=' . $htmlname . ']").change(function() { |
|
| 10147 | + $("select[name=' . $htmlname.']").change(function() { |
|
| 10148 | 10148 | |
| 10149 | - if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') { |
|
| 10149 | + if ($("select[name=' . $target.']").val() == '.$obj->id.') { |
|
| 10150 | 10150 | // get price of kilometer to fill the unit price |
| 10151 | 10151 | $.ajax({ |
| 10152 | 10152 | method: "POST", |
| 10153 | 10153 | dataType: "json", |
| 10154 | - data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' }, |
|
| 10155 | - url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . join('&', $params)) . '", |
|
| 10154 | + data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' }, |
|
| 10155 | + url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.join('&', $params)).'", |
|
| 10156 | 10156 | }).done(function( data, textStatus, jqXHR ) { |
| 10157 | 10157 | console.log(data); |
| 10158 | 10158 | if (typeof data.up != "undefined") { |
| 10159 | 10159 | $("input[name=value_unit]").val(data.up); |
| 10160 | - $("select[name=' . $htmlname . ']").attr("title", data.title); |
|
| 10160 | + $("select[name=' . $htmlname.']").attr("title", data.title); |
|
| 10161 | 10161 | } else { |
| 10162 | 10162 | $("input[name=value_unit]").val(""); |
| 10163 | - $("select[name=' . $htmlname . ']").attr("title", ""); |
|
| 10163 | + $("select[name=' . $htmlname.']").attr("title", ""); |
|
| 10164 | 10164 | } |
| 10165 | 10165 | }); |
| 10166 | 10166 | } |
@@ -10190,18 +10190,18 @@ discard block |
||
| 10190 | 10190 | global $conf, $langs; |
| 10191 | 10191 | |
| 10192 | 10192 | $out = ''; |
| 10193 | - $sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range"; |
|
| 10194 | - $sql .= " WHERE entity = " . $conf->entity . " AND active = 1"; |
|
| 10193 | + $sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range"; |
|
| 10194 | + $sql .= " WHERE entity = ".$conf->entity." AND active = 1"; |
|
| 10195 | 10195 | |
| 10196 | 10196 | $resql = $this->db->query($sql); |
| 10197 | 10197 | if ($resql) { |
| 10198 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
| 10198 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
| 10199 | 10199 | if ($useempty) { |
| 10200 | 10200 | $out .= '<option value="0"></option>'; |
| 10201 | 10201 | } |
| 10202 | 10202 | |
| 10203 | 10203 | while ($obj = $this->db->fetch_object($resql)) { |
| 10204 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>'; |
|
| 10204 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>'; |
|
| 10205 | 10205 | } |
| 10206 | 10206 | $out .= '</select>'; |
| 10207 | 10207 | } else { |
@@ -10226,17 +10226,17 @@ discard block |
||
| 10226 | 10226 | global $langs; |
| 10227 | 10227 | |
| 10228 | 10228 | $out = ''; |
| 10229 | - $sql = "SELECT id, code, label FROM " . $this->db->prefix() . "c_type_fees"; |
|
| 10229 | + $sql = "SELECT id, code, label FROM ".$this->db->prefix()."c_type_fees"; |
|
| 10230 | 10230 | $sql .= " WHERE active = 1"; |
| 10231 | 10231 | |
| 10232 | 10232 | $resql = $this->db->query($sql); |
| 10233 | 10233 | if ($resql) { |
| 10234 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
| 10234 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
| 10235 | 10235 | if ($useempty) { |
| 10236 | 10236 | $out .= '<option value="0"></option>'; |
| 10237 | 10237 | } |
| 10238 | 10238 | if ($allchoice) { |
| 10239 | - $out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>'; |
|
| 10239 | + $out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>'; |
|
| 10240 | 10240 | } |
| 10241 | 10241 | |
| 10242 | 10242 | $field = 'code'; |
@@ -10246,7 +10246,7 @@ discard block |
||
| 10246 | 10246 | |
| 10247 | 10247 | while ($obj = $this->db->fetch_object($resql)) { |
| 10248 | 10248 | $key = $langs->trans($obj->code); |
| 10249 | - $out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>'; |
|
| 10249 | + $out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>'; |
|
| 10250 | 10250 | } |
| 10251 | 10251 | $out .= '</select>'; |
| 10252 | 10252 | } else { |
@@ -10278,7 +10278,7 @@ discard block |
||
| 10278 | 10278 | { |
| 10279 | 10279 | global $user, $conf, $langs; |
| 10280 | 10280 | |
| 10281 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 10281 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 10282 | 10282 | |
| 10283 | 10283 | if (is_null($usertofilter)) { |
| 10284 | 10284 | $usertofilter = $user; |
@@ -10302,10 +10302,10 @@ discard block |
||
| 10302 | 10302 | $sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref, |
| 10303 | 10303 | p.title, p.fk_soc, p.fk_statut, p.public,"; |
| 10304 | 10304 | $sql .= ' s.nom as name'; |
| 10305 | - $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
|
| 10306 | - $sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,'; |
|
| 10307 | - $sql .= ' ' . $this->db->prefix() . 'facture as f'; |
|
| 10308 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
| 10305 | + $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
| 10306 | + $sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,'; |
|
| 10307 | + $sql .= ' '.$this->db->prefix().'facture as f'; |
|
| 10308 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
| 10309 | 10309 | $sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement |
| 10310 | 10310 | //if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
| 10311 | 10311 | //if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
@@ -10316,14 +10316,14 @@ discard block |
||
| 10316 | 10316 | if ($resql) { |
| 10317 | 10317 | // Use select2 selector |
| 10318 | 10318 | if (!empty($conf->use_javascript_ajax)) { |
| 10319 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10319 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10320 | 10320 | $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); |
| 10321 | 10321 | $out .= $comboenhancement; |
| 10322 | 10322 | $morecss = 'minwidth200imp maxwidth500'; |
| 10323 | 10323 | } |
| 10324 | 10324 | |
| 10325 | 10325 | if (empty($option_only)) { |
| 10326 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 10326 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 10327 | 10327 | } |
| 10328 | 10328 | if (!empty($show_empty)) { |
| 10329 | 10329 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10353,33 +10353,33 @@ discard block |
||
| 10353 | 10353 | if ($showproject == 'all') { |
| 10354 | 10354 | $labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref |
| 10355 | 10355 | if ($obj->name) { |
| 10356 | - $labeltoshow .= ' - ' . $obj->name; // Soc name |
|
| 10356 | + $labeltoshow .= ' - '.$obj->name; // Soc name |
|
| 10357 | 10357 | } |
| 10358 | 10358 | |
| 10359 | 10359 | $disabled = 0; |
| 10360 | 10360 | if ($obj->fk_statut == Project::STATUS_DRAFT) { |
| 10361 | 10361 | $disabled = 1; |
| 10362 | - $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
| 10362 | + $labeltoshow .= ' - '.$langs->trans("Draft"); |
|
| 10363 | 10363 | } elseif ($obj->fk_statut == Project::STATUS_CLOSED) { |
| 10364 | 10364 | if ($discard_closed == 2) { |
| 10365 | 10365 | $disabled = 1; |
| 10366 | 10366 | } |
| 10367 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
| 10367 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
| 10368 | 10368 | } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
| 10369 | 10369 | $disabled = 1; |
| 10370 | - $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
| 10370 | + $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
|
| 10371 | 10371 | } |
| 10372 | 10372 | } |
| 10373 | 10373 | |
| 10374 | 10374 | if (!empty($selected) && $selected == $obj->rowid) { |
| 10375 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
| 10375 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
| 10376 | 10376 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
| 10377 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 10377 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 10378 | 10378 | } else { |
| 10379 | 10379 | if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
| 10380 | 10380 | $resultat = ''; |
| 10381 | 10381 | } else { |
| 10382 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
| 10382 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
| 10383 | 10383 | if ($disabled) { |
| 10384 | 10384 | $resultat .= ' disabled'; |
| 10385 | 10385 | } |
@@ -10431,22 +10431,22 @@ discard block |
||
| 10431 | 10431 | |
| 10432 | 10432 | $sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc'; |
| 10433 | 10433 | //$sql.= ', el.fk_source'; |
| 10434 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f'; |
|
| 10435 | - $sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")"; |
|
| 10434 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f'; |
|
| 10435 | + $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; |
|
| 10436 | 10436 | $sql .= " ORDER BY f.titre ASC"; |
| 10437 | 10437 | |
| 10438 | 10438 | $resql = $this->db->query($sql); |
| 10439 | 10439 | if ($resql) { |
| 10440 | 10440 | // Use select2 selector |
| 10441 | 10441 | if (!empty($conf->use_javascript_ajax)) { |
| 10442 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10442 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10443 | 10443 | $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); |
| 10444 | 10444 | $out .= $comboenhancement; |
| 10445 | 10445 | $morecss = 'minwidth200imp maxwidth500'; |
| 10446 | 10446 | } |
| 10447 | 10447 | |
| 10448 | 10448 | if (empty($option_only)) { |
| 10449 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 10449 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 10450 | 10450 | } |
| 10451 | 10451 | if (!empty($show_empty)) { |
| 10452 | 10452 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10465,19 +10465,19 @@ discard block |
||
| 10465 | 10465 | $disabled = 0; |
| 10466 | 10466 | if (!empty($obj->suspended)) { |
| 10467 | 10467 | $disabled = 1; |
| 10468 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
| 10468 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
| 10469 | 10469 | } |
| 10470 | 10470 | |
| 10471 | 10471 | |
| 10472 | 10472 | if (!empty($selected) && $selected == $obj->rowid) { |
| 10473 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
| 10473 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
| 10474 | 10474 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
| 10475 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 10475 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 10476 | 10476 | } else { |
| 10477 | 10477 | if ($disabled && ($selected != $obj->rowid)) { |
| 10478 | 10478 | $resultat = ''; |
| 10479 | 10479 | } else { |
| 10480 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
| 10480 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
| 10481 | 10481 | if ($disabled) { |
| 10482 | 10482 | $resultat .= ' disabled'; |
| 10483 | 10483 | } |
@@ -10517,14 +10517,14 @@ discard block |
||
| 10517 | 10517 | global $langs; |
| 10518 | 10518 | |
| 10519 | 10519 | if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) { // If $search_component_params_hidden does not start and end with () |
| 10520 | - $search_component_params_hidden = '(' . $search_component_params_hidden . ')'; |
|
| 10520 | + $search_component_params_hidden = '('.$search_component_params_hidden.')'; |
|
| 10521 | 10521 | } |
| 10522 | 10522 | |
| 10523 | 10523 | $ret = ''; |
| 10524 | 10524 | |
| 10525 | 10525 | $ret .= '<div class="divadvancedsearchfieldcomp inline-block">'; |
| 10526 | 10526 | $ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">'; |
| 10527 | - $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>'; |
|
| 10527 | + $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>'; |
|
| 10528 | 10528 | $ret .= '</a>'; |
| 10529 | 10529 | |
| 10530 | 10530 | $ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">'; |
@@ -10550,13 +10550,13 @@ discard block |
||
| 10550 | 10550 | } |
| 10551 | 10551 | |
| 10552 | 10552 | if ($countparenthesis == 0) { |
| 10553 | - $char2 = dol_substr($search_component_params_hidden, $i+1, 1); |
|
| 10554 | - $char3 = dol_substr($search_component_params_hidden, $i+2, 1); |
|
| 10553 | + $char2 = dol_substr($search_component_params_hidden, $i + 1, 1); |
|
| 10554 | + $char3 = dol_substr($search_component_params_hidden, $i + 2, 1); |
|
| 10555 | 10555 | if ($char == 'A' && $char2 == 'N' && $char3 == 'D') { |
| 10556 | 10556 | // We found a AND |
| 10557 | 10557 | $arrayofandtags[] = trim($s); |
| 10558 | 10558 | $s = ''; |
| 10559 | - $i+=2; |
|
| 10559 | + $i += 2; |
|
| 10560 | 10560 | } else { |
| 10561 | 10561 | $s .= $char; |
| 10562 | 10562 | } |
@@ -10580,8 +10580,8 @@ discard block |
||
| 10580 | 10580 | include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
| 10581 | 10581 | $searchtags = removeGlobalParenthesis($searchtags); |
| 10582 | 10582 | |
| 10583 | - $ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey+1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">'; |
|
| 10584 | - $ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey+1).'">x</span> '; |
|
| 10583 | + $ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey + 1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">'; |
|
| 10584 | + $ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey + 1).'">x</span> '; |
|
| 10585 | 10585 | $ret .= dol_escape_htmltag($searchtags); |
| 10586 | 10586 | $ret .= '</span>'; |
| 10587 | 10587 | } |
@@ -10598,29 +10598,29 @@ discard block |
||
| 10598 | 10598 | $ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">'; |
| 10599 | 10599 | } |
| 10600 | 10600 | $ret .= "<!-- We store the full Universal Search String into this field. For example: (t.ref:like:'SO-%') AND ((t.ref:like:'CO-%') OR (t.ref:like:'AA%')) -->"; |
| 10601 | - $ret .= '<input type="hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">'; |
|
| 10601 | + $ret .= '<input type="hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">'; |
|
| 10602 | 10602 | // $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->"; |
| 10603 | 10603 | |
| 10604 | 10604 | // For compatibility with forms that show themself the search criteria in addition of this component, we output these fields |
| 10605 | 10605 | foreach ($arrayofcriterias as $criterias) { |
| 10606 | 10606 | foreach ($criterias as $criteriafamilykey => $criteriafamilyval) { |
| 10607 | - if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
| 10607 | + if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
| 10608 | 10608 | continue; |
| 10609 | 10609 | } |
| 10610 | 10610 | if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) { |
| 10611 | 10611 | continue; |
| 10612 | 10612 | } |
| 10613 | 10613 | if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) { |
| 10614 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">'; |
|
| 10615 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">'; |
|
| 10616 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">'; |
|
| 10617 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">'; |
|
| 10618 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">'; |
|
| 10619 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">'; |
|
| 10620 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">'; |
|
| 10621 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">'; |
|
| 10614 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">'; |
|
| 10615 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">'; |
|
| 10616 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">'; |
|
| 10617 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">'; |
|
| 10618 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">'; |
|
| 10619 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">'; |
|
| 10620 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">'; |
|
| 10621 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">'; |
|
| 10622 | 10622 | } else { |
| 10623 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">'; |
|
| 10623 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">'; |
|
| 10624 | 10624 | } |
| 10625 | 10625 | } |
| 10626 | 10626 | } |
@@ -10628,7 +10628,7 @@ discard block |
||
| 10628 | 10628 | $ret .= '</div>'; |
| 10629 | 10629 | |
| 10630 | 10630 | $ret .= "<!-- Field to enter a generic filter string: t.ref:like:'SO-%', t.date_creation:<:'20160101', t.date_creation:<:'2016-01-01 12:30:00', t.nature:is:NULL, t.field2:isnot:NULL -->\n"; |
| 10631 | - $ret .= '<input type="text" placeholder="' . $langs->trans("Search") . '" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
| 10631 | + $ret .= '<input type="text" placeholder="'.$langs->trans("Search").'" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
| 10632 | 10632 | |
| 10633 | 10633 | $ret .= '</div>'; |
| 10634 | 10634 | $ret .= '</div>'; |
@@ -10664,7 +10664,7 @@ discard block |
||
| 10664 | 10664 | |
| 10665 | 10665 | $TModels = array(); |
| 10666 | 10666 | |
| 10667 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
| 10667 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
| 10668 | 10668 | $formmail = new FormMail($this->db); |
| 10669 | 10669 | $result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs); |
| 10670 | 10670 | |
@@ -10677,17 +10677,17 @@ discard block |
||
| 10677 | 10677 | } |
| 10678 | 10678 | } |
| 10679 | 10679 | |
| 10680 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">'; |
|
| 10680 | + $retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">'; |
|
| 10681 | 10681 | |
| 10682 | 10682 | foreach ($TModels as $id_model => $label_model) { |
| 10683 | - $retstring .= '<option value="' . $id_model . '"'; |
|
| 10684 | - $retstring .= ">" . $label_model . "</option>"; |
|
| 10683 | + $retstring .= '<option value="'.$id_model.'"'; |
|
| 10684 | + $retstring .= ">".$label_model."</option>"; |
|
| 10685 | 10685 | } |
| 10686 | 10686 | |
| 10687 | 10687 | $retstring .= "</select>"; |
| 10688 | 10688 | |
| 10689 | 10689 | if ($addjscombo) { |
| 10690 | - $retstring .= ajax_combobox('select_' . $prefix . 'model_mail'); |
|
| 10690 | + $retstring .= ajax_combobox('select_'.$prefix.'model_mail'); |
|
| 10691 | 10691 | } |
| 10692 | 10692 | |
| 10693 | 10693 | return $retstring; |
@@ -10738,16 +10738,16 @@ discard block |
||
| 10738 | 10738 | |
| 10739 | 10739 | foreach ($buttons as $button) { |
| 10740 | 10740 | $addclass = empty($button['addclass']) ? '' : $button['addclass']; |
| 10741 | - $retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">'; |
|
| 10741 | + $retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">'; |
|
| 10742 | 10742 | } |
| 10743 | 10743 | $retstring .= $withoutdiv ? '' : '</div>'; |
| 10744 | 10744 | |
| 10745 | 10745 | if ($dol_openinpopup) { |
| 10746 | - $retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n"; |
|
| 10747 | - $retstring .= '<script nonce="' . getNonce() . '">'; |
|
| 10746 | + $retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n"; |
|
| 10747 | + $retstring .= '<script nonce="'.getNonce().'">'; |
|
| 10748 | 10748 | $retstring .= 'jQuery(".button-cancel").click(function(e) { |
| 10749 | - e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\'); |
|
| 10750 | - window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\'); |
|
| 10749 | + e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\'); |
|
| 10750 | + window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\'); |
|
| 10751 | 10751 | });'; |
| 10752 | 10752 | $retstring .= '</script>'; |
| 10753 | 10753 | } |
@@ -10776,7 +10776,7 @@ discard block |
||
| 10776 | 10776 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 10777 | 10777 | |
| 10778 | 10778 | $sql = "SELECT rowid, code, label as label"; |
| 10779 | - $sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype'; |
|
| 10779 | + $sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype'; |
|
| 10780 | 10780 | $sql .= " WHERE active = 1"; |
| 10781 | 10781 | |
| 10782 | 10782 | $resql = $this->db->query($sql); |
@@ -10787,7 +10787,7 @@ discard block |
||
| 10787 | 10787 | $obj = $this->db->fetch_object($resql); |
| 10788 | 10788 | |
| 10789 | 10789 | // If translation exists, we use it, otherwise we take the default wording |
| 10790 | - $label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != ("InvoiceSubtype" . $obj->rowid)) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
| 10790 | + $label = ($langs->trans("InvoiceSubtype".$obj->rowid) != ("InvoiceSubtype".$obj->rowid)) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
| 10791 | 10791 | $this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid; |
| 10792 | 10792 | $this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code; |
| 10793 | 10793 | $this->cache_invoice_subtype[$obj->rowid]['label'] = $label; |
@@ -10819,18 +10819,18 @@ discard block |
||
| 10819 | 10819 | global $langs, $user; |
| 10820 | 10820 | |
| 10821 | 10821 | $out = ''; |
| 10822 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 10822 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 10823 | 10823 | |
| 10824 | 10824 | $this->load_cache_invoice_subtype(); |
| 10825 | 10825 | |
| 10826 | - $out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 10826 | + $out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 10827 | 10827 | if ($addempty) { |
| 10828 | 10828 | $out .= '<option value="0"> </option>'; |
| 10829 | 10829 | } |
| 10830 | 10830 | |
| 10831 | 10831 | foreach ($this->cache_invoice_subtype as $rowid => $subtype) { |
| 10832 | 10832 | $label = $subtype['label']; |
| 10833 | - $out .= '<option value="' . $subtype['rowid'] . '"'; |
|
| 10833 | + $out .= '<option value="'.$subtype['rowid'].'"'; |
|
| 10834 | 10834 | if ($selected == $subtype['rowid']) { |
| 10835 | 10835 | $out .= ' selected="selected"'; |
| 10836 | 10836 | } |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | if (empty($this->piece_num)) { |
| 372 | 372 | $sqlnum = "SELECT MAX(piece_num)+1 as maxpiecenum"; |
| 373 | 373 | $sqlnum .= " FROM ".MAIN_DB_PREFIX.$this->table_element; |
| 374 | - $sqlnum .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 374 | + $sqlnum .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 375 | 375 | |
| 376 | 376 | $resqlnum = $this->db->query($sqlnum); |
| 377 | 377 | if ($resqlnum) { |
@@ -553,7 +553,7 @@ discard block |
||
| 553 | 553 | //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); |
| 554 | 554 | |
| 555 | 555 | global $action; |
| 556 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
| 556 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
| 557 | 557 | $parameters = array('id'=>$this->id, 'getnomurl' => &$result); |
| 558 | 558 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 559 | 559 | if ($reshook > 0) { |
@@ -801,7 +801,7 @@ discard block |
||
| 801 | 801 | $sql .= " t.date_validated as date_validation"; |
| 802 | 802 | $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.$mode.' as t'; |
| 803 | 803 | $sql .= ' WHERE 1 = 1'; |
| 804 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 804 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 805 | 805 | if (null !== $ref) { |
| 806 | 806 | $sql .= " AND t.rowid = ".((int) $ref); |
| 807 | 807 | } else { |
@@ -952,7 +952,7 @@ discard block |
||
| 952 | 952 | } |
| 953 | 953 | } |
| 954 | 954 | $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; |
| 955 | - $sql .= ' WHERE entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 955 | + $sql .= ' WHERE entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 956 | 956 | if (count($sqlwhere) > 0) { |
| 957 | 957 | $sql .= " AND ".implode(" ".$filtermode." ", $sqlwhere); |
| 958 | 958 | } |
@@ -1119,7 +1119,7 @@ discard block |
||
| 1119 | 1119 | } |
| 1120 | 1120 | } |
| 1121 | 1121 | } |
| 1122 | - $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1122 | + $sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1123 | 1123 | if ($showAlreadyExportMovements == 0) { |
| 1124 | 1124 | $sql .= " AND t.date_export IS NULL"; |
| 1125 | 1125 | } |
@@ -1245,7 +1245,7 @@ discard block |
||
| 1245 | 1245 | } |
| 1246 | 1246 | } |
| 1247 | 1247 | } |
| 1248 | - $sql .= ' WHERE entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1248 | + $sql .= ' WHERE entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1249 | 1249 | if (count($sqlwhere) > 0) { |
| 1250 | 1250 | $sql .= " AND ".implode(" ".$filtermode." ", $sqlwhere); |
| 1251 | 1251 | } |
@@ -1623,7 +1623,7 @@ discard block |
||
| 1623 | 1623 | if (!empty($journal)) { |
| 1624 | 1624 | $sql .= " AND code_journal = '".$this->db->escape($journal)."'"; |
| 1625 | 1625 | } |
| 1626 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1626 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1627 | 1627 | // Exclusion of validated entries at the time of deletion |
| 1628 | 1628 | $sql .= " AND date_validated IS NULL"; |
| 1629 | 1629 | $sql .= $sql_filter; |
@@ -1668,8 +1668,8 @@ discard block |
||
| 1668 | 1668 | $sql = "DELETE"; |
| 1669 | 1669 | $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; |
| 1670 | 1670 | $sql .= " WHERE piece_num = ".(int) $piecenum; |
| 1671 | - $sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion |
|
| 1672 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1671 | + $sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion |
|
| 1672 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1673 | 1673 | $sql .= $sql_filter; |
| 1674 | 1674 | |
| 1675 | 1675 | $resql = $this->db->query($sql); |
@@ -1792,7 +1792,7 @@ discard block |
||
| 1792 | 1792 | } |
| 1793 | 1793 | $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; |
| 1794 | 1794 | $sql .= " WHERE piece_num = ".((int) $piecenum); |
| 1795 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1795 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1796 | 1796 | |
| 1797 | 1797 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 1798 | 1798 | $result = $this->db->query($sql); |
@@ -1831,7 +1831,7 @@ discard block |
||
| 1831 | 1831 | global $conf; |
| 1832 | 1832 | |
| 1833 | 1833 | $sql = "SELECT MAX(piece_num)+1 as max FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; |
| 1834 | - $sql .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1834 | + $sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1835 | 1835 | |
| 1836 | 1836 | dol_syslog(get_class($this)."::getNextNumMvt", LOG_DEBUG); |
| 1837 | 1837 | |
@@ -1875,7 +1875,7 @@ discard block |
||
| 1875 | 1875 | } |
| 1876 | 1876 | $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; |
| 1877 | 1877 | $sql .= " WHERE piece_num = ".((int) $piecenum); |
| 1878 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1878 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1879 | 1879 | |
| 1880 | 1880 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 1881 | 1881 | $result = $this->db->query($sql); |
@@ -1940,7 +1940,7 @@ discard block |
||
| 1940 | 1940 | $sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num,"; |
| 1941 | 1941 | $sql .= " date_validated as date_validation"; |
| 1942 | 1942 | $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; |
| 1943 | - $sql .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1943 | + $sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1944 | 1944 | |
| 1945 | 1945 | dol_syslog(get_class($this)."::export_bookkeeping", LOG_DEBUG); |
| 1946 | 1946 | |
@@ -2017,7 +2017,7 @@ discard block |
||
| 2017 | 2017 | |
| 2018 | 2018 | if (!$error) { |
| 2019 | 2019 | // Delete if there is an empty line |
| 2020 | - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity)." AND numero_compte IS NULL AND debit = 0 AND credit = 0"; |
|
| 2020 | + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity)." AND numero_compte IS NULL AND debit = 0 AND credit = 0"; |
|
| 2021 | 2021 | $resql = $this->db->query($sql); |
| 2022 | 2022 | if (!$resql) { |
| 2023 | 2023 | $error++; |
@@ -2035,7 +2035,7 @@ discard block |
||
| 2035 | 2035 | $sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,'; |
| 2036 | 2036 | $sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; |
| 2037 | 2037 | $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, '.((int) $next_piecenum).", '".$this->db->idate($now)."'"; |
| 2038 | - $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND numero_compte IS NOT NULL AND entity = ' .((int) $conf->entity); |
|
| 2038 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND numero_compte IS NOT NULL AND entity = '.((int) $conf->entity); |
|
| 2039 | 2039 | $sql .= $sql_filter; |
| 2040 | 2040 | $resql = $this->db->query($sql); |
| 2041 | 2041 | if (!$resql) { |
@@ -2046,7 +2046,7 @@ discard block |
||
| 2046 | 2046 | } |
| 2047 | 2047 | |
| 2048 | 2048 | if (!$error) { |
| 2049 | - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); |
|
| 2049 | + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity); |
|
| 2050 | 2050 | $resql = $this->db->query($sql); |
| 2051 | 2051 | if (!$resql) { |
| 2052 | 2052 | $error++; |
@@ -2056,7 +2056,7 @@ discard block |
||
| 2056 | 2056 | } |
| 2057 | 2057 | } elseif ($direction == 1) { |
| 2058 | 2058 | if (!$error) { |
| 2059 | - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); |
|
| 2059 | + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity); |
|
| 2060 | 2060 | $resql = $this->db->query($sql); |
| 2061 | 2061 | if (!$resql) { |
| 2062 | 2062 | $error++; |
@@ -2074,7 +2074,7 @@ discard block |
||
| 2074 | 2074 | $sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,'; |
| 2075 | 2075 | $sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; |
| 2076 | 2076 | $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num'; |
| 2077 | - $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); |
|
| 2077 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity); |
|
| 2078 | 2078 | $sql .= $sql_filter; |
| 2079 | 2079 | $resql = $this->db->query($sql); |
| 2080 | 2080 | if (!$resql) { |
@@ -2085,7 +2085,7 @@ discard block |
||
| 2085 | 2085 | } |
| 2086 | 2086 | |
| 2087 | 2087 | if (!$error) { |
| 2088 | - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); |
|
| 2088 | + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity); |
|
| 2089 | 2089 | $sql .= $sql_filter; |
| 2090 | 2090 | $resql = $this->db->query($sql); |
| 2091 | 2091 | if (!$resql) { |
@@ -2142,7 +2142,7 @@ discard block |
||
| 2142 | 2142 | $sql .= " AND aa.active = 1"; |
| 2143 | 2143 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; |
| 2144 | 2144 | $sql .= " AND asy.rowid = ".((int) $pcgver); |
| 2145 | - $sql .= " AND ab.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2145 | + $sql .= " AND ab.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2146 | 2146 | $sql .= " ORDER BY account_number ASC"; |
| 2147 | 2147 | |
| 2148 | 2148 | dol_syslog(get_class($this)."::select_account", LOG_DEBUG); |
@@ -2206,7 +2206,7 @@ discard block |
||
| 2206 | 2206 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as parent ON aa.account_parent = parent.rowid AND parent.active = 1"; |
| 2207 | 2207 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as root ON parent.account_parent = root.rowid AND root.active = 1"; |
| 2208 | 2208 | $sql .= " WHERE aa.account_number = '".$this->db->escape($account)."'"; |
| 2209 | - $sql .= " AND aa.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2209 | + $sql .= " AND aa.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2210 | 2210 | |
| 2211 | 2211 | dol_syslog(get_class($this)."::select_account", LOG_DEBUG); |
| 2212 | 2212 | $resql = $this->db->query($sql); |
@@ -2246,7 +2246,7 @@ discard block |
||
| 2246 | 2246 | $sql .= " AND asy.rowid = ".((int) $pcgver); |
| 2247 | 2247 | $sql .= " AND aa.active = 1"; |
| 2248 | 2248 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_accounting_category as cat ON aa.fk_accounting_category = cat.rowid"; |
| 2249 | - $sql .= " WHERE aa.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2249 | + $sql .= " WHERE aa.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2250 | 2250 | |
| 2251 | 2251 | dol_syslog(get_class($this)."::select_account", LOG_DEBUG); |
| 2252 | 2252 | $resql = $this->db->query($sql); |
@@ -2279,7 +2279,7 @@ discard block |
||
| 2279 | 2279 | global $conf; |
| 2280 | 2280 | |
| 2281 | 2281 | $alias = trim($alias); |
| 2282 | - $alias = !empty($alias) && strpos($alias, '.') < 0 ? $alias . "." : $alias; |
|
| 2282 | + $alias = !empty($alias) && strpos($alias, '.') < 0 ? $alias."." : $alias; |
|
| 2283 | 2283 | |
| 2284 | 2284 | if (!isset(self::$can_modify_bookkeeping_sql_cached[$alias]) || $force) { |
| 2285 | 2285 | $result = $this->loadFiscalPeriods($force, 'active'); |
@@ -2290,10 +2290,10 @@ discard block |
||
| 2290 | 2290 | $sql_list = array(); |
| 2291 | 2291 | if (!empty($conf->cache['active_fiscal_period_cached']) && is_array($conf->cache['active_fiscal_period_cached'])) { |
| 2292 | 2292 | foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) { |
| 2293 | - $sql_list[] = "('" . $this->db->idate($fiscal_period['date_start']) . "' <= {$alias}doc_date AND {$alias}doc_date <= '" . $this->db->idate($fiscal_period['date_end']) . "')"; |
|
| 2293 | + $sql_list[] = "('".$this->db->idate($fiscal_period['date_start'])."' <= {$alias}doc_date AND {$alias}doc_date <= '".$this->db->idate($fiscal_period['date_end'])."')"; |
|
| 2294 | 2294 | } |
| 2295 | 2295 | } |
| 2296 | - self::$can_modify_bookkeeping_sql_cached[$alias] = !empty($sql_list) ? ' AND (' . implode(' OR ', $sql_list) . ')' : ''; |
|
| 2296 | + self::$can_modify_bookkeeping_sql_cached[$alias] = !empty($sql_list) ? ' AND ('.implode(' OR ', $sql_list).')' : ''; |
|
| 2297 | 2297 | } |
| 2298 | 2298 | |
| 2299 | 2299 | return self::$can_modify_bookkeeping_sql_cached[$alias]; |
@@ -2413,8 +2413,8 @@ discard block |
||
| 2413 | 2413 | if ($mode == 'active') { |
| 2414 | 2414 | if (!isset($conf->cache['active_fiscal_period_cached']) || $force) { |
| 2415 | 2415 | $sql = "SELECT date_start, date_end"; |
| 2416 | - $sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear"; |
|
| 2417 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
| 2416 | + $sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear"; |
|
| 2417 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
| 2418 | 2418 | $sql .= " AND statut = 0"; |
| 2419 | 2419 | |
| 2420 | 2420 | $resql = $this->db->query($sql); |
@@ -2436,8 +2436,8 @@ discard block |
||
| 2436 | 2436 | if ($mode == 'closed') { |
| 2437 | 2437 | if (!isset($conf->cache['closed_fiscal_period_cached']) || $force) { |
| 2438 | 2438 | $sql = "SELECT date_start, date_end"; |
| 2439 | - $sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear"; |
|
| 2440 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
| 2439 | + $sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear"; |
|
| 2440 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
| 2441 | 2441 | $sql .= " AND statut = 1"; |
| 2442 | 2442 | |
| 2443 | 2443 | $resql = $this->db->query($sql); |
@@ -2472,9 +2472,9 @@ discard block |
||
| 2472 | 2472 | $list = array(); |
| 2473 | 2473 | |
| 2474 | 2474 | $sql = "SELECT rowid, label, date_start, date_end, statut"; |
| 2475 | - $sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear"; |
|
| 2476 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
| 2477 | - if (!empty($filter)) $sql .= " AND (" . $filter . ')'; |
|
| 2475 | + $sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear"; |
|
| 2476 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
| 2477 | + if (!empty($filter)) $sql .= " AND (".$filter.')'; |
|
| 2478 | 2478 | $sql .= $this->db->order('date_start', 'ASC'); |
| 2479 | 2479 | |
| 2480 | 2480 | $resql = $this->db->query($sql); |
@@ -2510,13 +2510,13 @@ discard block |
||
| 2510 | 2510 | |
| 2511 | 2511 | $sql = "SELECT YEAR(b.doc_date) as year"; |
| 2512 | 2512 | for ($i = 1; $i <= 12; $i++) { |
| 2513 | - $sql .= ", SUM(" . $this->db->ifsql("MONTH(b.doc_date)=" . $i, "1", "0") . ") AS month" . $i; |
|
| 2513 | + $sql .= ", SUM(".$this->db->ifsql("MONTH(b.doc_date)=".$i, "1", "0").") AS month".$i; |
|
| 2514 | 2514 | } |
| 2515 | 2515 | $sql .= ", COUNT(b.rowid) as total"; |
| 2516 | - $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as b"; |
|
| 2517 | - $sql .= " WHERE b.doc_date >= '" . $this->db->idate($date_start) . "'"; |
|
| 2518 | - $sql .= " AND b.doc_date <= '" . $this->db->idate($date_end) . "'"; |
|
| 2519 | - $sql .= " AND b.entity IN (" . getEntity('bookkeeping', 0) . ")"; // We don't share object for accountancy |
|
| 2516 | + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b"; |
|
| 2517 | + $sql .= " WHERE b.doc_date >= '".$this->db->idate($date_start)."'"; |
|
| 2518 | + $sql .= " AND b.doc_date <= '".$this->db->idate($date_end)."'"; |
|
| 2519 | + $sql .= " AND b.entity IN (".getEntity('bookkeeping', 0).")"; // We don't share object for accountancy |
|
| 2520 | 2520 | |
| 2521 | 2521 | // Get count for each month into the fiscal period |
| 2522 | 2522 | if (getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) { |
@@ -2546,7 +2546,7 @@ discard block |
||
| 2546 | 2546 | 'total' => (int) $obj->total, |
| 2547 | 2547 | ); |
| 2548 | 2548 | for ($i = 1; $i <= 12; $i++) { |
| 2549 | - $year_list['count'][$i] = (int) $obj->{'month' . $i}; |
|
| 2549 | + $year_list['count'][$i] = (int) $obj->{'month'.$i}; |
|
| 2550 | 2550 | } |
| 2551 | 2551 | |
| 2552 | 2552 | $list[] = $year_list; |
@@ -2574,11 +2574,11 @@ discard block |
||
| 2574 | 2574 | $now = dol_now(); |
| 2575 | 2575 | |
| 2576 | 2576 | // Specify as export : update field date_validated on selected month/year |
| 2577 | - $sql = " UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping"; |
|
| 2578 | - $sql .= " SET date_validated = '" . $this->db->idate($now) . "'"; |
|
| 2579 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
| 2580 | - $sql .= " AND DATE(doc_date) >= '" . $this->db->idate($date_start) . "'"; |
|
| 2581 | - $sql .= " AND DATE(doc_date) <= '" . $this->db->idate($date_end) . "'"; |
|
| 2577 | + $sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping"; |
|
| 2578 | + $sql .= " SET date_validated = '".$this->db->idate($now)."'"; |
|
| 2579 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
| 2580 | + $sql .= " AND DATE(doc_date) >= '".$this->db->idate($date_start)."'"; |
|
| 2581 | + $sql .= " AND DATE(doc_date) <= '".$this->db->idate($date_end)."'"; |
|
| 2582 | 2582 | $sql .= " AND date_validated IS NULL"; |
| 2583 | 2583 | |
| 2584 | 2584 | dol_syslog(__METHOD__, LOG_DEBUG); |
@@ -2619,7 +2619,7 @@ discard block |
||
| 2619 | 2619 | return -1; |
| 2620 | 2620 | } elseif (empty($fiscal_period->id)) { |
| 2621 | 2621 | $langs->loadLangs(array('errors', 'compta')); |
| 2622 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $fiscal_period_id . ')'; |
|
| 2622 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$fiscal_period_id.')'; |
|
| 2623 | 2623 | return -1; |
| 2624 | 2624 | } |
| 2625 | 2625 | |
@@ -2638,7 +2638,7 @@ discard block |
||
| 2638 | 2638 | return -1; |
| 2639 | 2639 | } elseif (empty($new_fiscal_period->id)) { |
| 2640 | 2640 | $langs->loadLangs(array('errors', 'compta')); |
| 2641 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $new_fiscal_period_id . ')'; |
|
| 2641 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$new_fiscal_period_id.')'; |
|
| 2642 | 2642 | return -1; |
| 2643 | 2643 | } |
| 2644 | 2644 | |
@@ -2658,7 +2658,7 @@ discard block |
||
| 2658 | 2658 | $journal_id = max(0, getDolGlobalString('ACCOUNTING_CLOSURE_DEFAULT_JOURNAL')); |
| 2659 | 2659 | if (empty($journal_id)) { |
| 2660 | 2660 | $langs->loadLangs(array('errors', 'accountancy')); |
| 2661 | - $this->errors[] = $langs->trans('ErrorBadParameters') . ' - ' . $langs->trans('Codejournal') . ' (' . $langs->trans('AccountingJournalType9') . ')'; |
|
| 2661 | + $this->errors[] = $langs->trans('ErrorBadParameters').' - '.$langs->trans('Codejournal').' ('.$langs->trans('AccountingJournalType9').')'; |
|
| 2662 | 2662 | $error++; |
| 2663 | 2663 | } |
| 2664 | 2664 | |
@@ -2672,7 +2672,7 @@ discard block |
||
| 2672 | 2672 | $error++; |
| 2673 | 2673 | } elseif ($result == 0) { |
| 2674 | 2674 | $langs->loadLangs(array('errors', 'accountancy')); |
| 2675 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('Codejournal') . ' (' . $langs->trans('AccountingJournalType9') . ')'; |
|
| 2675 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('Codejournal').' ('.$langs->trans('AccountingJournalType9').')'; |
|
| 2676 | 2676 | $error++; |
| 2677 | 2677 | } |
| 2678 | 2678 | } |
@@ -2684,7 +2684,7 @@ discard block |
||
| 2684 | 2684 | $pcg_type_filter = array(); |
| 2685 | 2685 | $tmp = array_merge($accounting_groups_used_for_balance_sheet_account, $accounting_groups_used_for_income_statement); |
| 2686 | 2686 | foreach ($tmp as $item) { |
| 2687 | - $pcg_type_filter[] = "'" . $this->db->escape($item) . "'"; |
|
| 2687 | + $pcg_type_filter[] = "'".$this->db->escape($item)."'"; |
|
| 2688 | 2688 | } |
| 2689 | 2689 | |
| 2690 | 2690 | $sql = 'SELECT'; |
@@ -2696,14 +2696,14 @@ discard block |
||
| 2696 | 2696 | } |
| 2697 | 2697 | $sql .= " aa.pcg_type,"; |
| 2698 | 2698 | $sql .= " (SUM(t.credit) - SUM(t.debit)) as opening_balance"; |
| 2699 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
|
| 2700 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'accounting_account as aa ON aa.account_number = t.numero_compte'; |
|
| 2701 | - $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2702 | - $sql .= " AND aa.entity = ". ((int) $conf->entity); |
|
| 2699 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; |
|
| 2700 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'accounting_account as aa ON aa.account_number = t.numero_compte'; |
|
| 2701 | + $sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2702 | + $sql .= " AND aa.entity = ".((int) $conf->entity); |
|
| 2703 | 2703 | $sql .= ' AND aa.fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid = '.((int) getDolGlobalInt('CHARTOFACCOUNTS')).')'; |
| 2704 | - $sql .= ' AND aa.pcg_type IN (' . $this->db->sanitize(implode(',', $pcg_type_filter), 1) . ')'; |
|
| 2705 | - $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($fiscal_period->date_start) . "'"; |
|
| 2706 | - $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($fiscal_period->date_end) . "'"; |
|
| 2704 | + $sql .= ' AND aa.pcg_type IN ('.$this->db->sanitize(implode(',', $pcg_type_filter), 1).')'; |
|
| 2705 | + $sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($fiscal_period->date_start)."'"; |
|
| 2706 | + $sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($fiscal_period->date_end)."'"; |
|
| 2707 | 2707 | $sql .= ' GROUP BY t.numero_compte, t.label_compte, aa.pcg_type'; |
| 2708 | 2708 | if ($separate_auxiliary_account) { |
| 2709 | 2709 | $sql .= ' ,t.subledger_account, t.subledger_label'; |
@@ -2712,8 +2712,8 @@ discard block |
||
| 2712 | 2712 | |
| 2713 | 2713 | $resql = $this->db->query($sql); |
| 2714 | 2714 | if (!$resql) { |
| 2715 | - $this->errors[] = 'Error ' . $this->db->lasterror(); |
|
| 2716 | - dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); |
|
| 2715 | + $this->errors[] = 'Error '.$this->db->lasterror(); |
|
| 2716 | + dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR); |
|
| 2717 | 2717 | |
| 2718 | 2718 | $error++; |
| 2719 | 2719 | } else { |
@@ -2855,7 +2855,7 @@ discard block |
||
| 2855 | 2855 | return -1; |
| 2856 | 2856 | } elseif (empty($fiscal_period->id)) { |
| 2857 | 2857 | $langs->loadLangs(array('errors', 'compta')); |
| 2858 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $fiscal_period_id . ')'; |
|
| 2858 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$fiscal_period_id.')'; |
|
| 2859 | 2859 | return -1; |
| 2860 | 2860 | } |
| 2861 | 2861 | |
@@ -2874,7 +2874,7 @@ discard block |
||
| 2874 | 2874 | return -1; |
| 2875 | 2875 | } elseif (empty($new_fiscal_period->id)) { |
| 2876 | 2876 | $langs->loadLangs(array('errors', 'compta')); |
| 2877 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $new_fiscal_period_id . ')'; |
|
| 2877 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$new_fiscal_period_id.')'; |
|
| 2878 | 2878 | return -1; |
| 2879 | 2879 | } |
| 2880 | 2880 | |
@@ -2894,7 +2894,7 @@ discard block |
||
| 2894 | 2894 | return -1; |
| 2895 | 2895 | } elseif ($result == 0) { |
| 2896 | 2896 | $langs->loadLangs(array('errors', 'accountancy')); |
| 2897 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('InventoryJournal'); |
|
| 2897 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('InventoryJournal'); |
|
| 2898 | 2898 | return -1; |
| 2899 | 2899 | } |
| 2900 | 2900 | |
@@ -2902,18 +2902,18 @@ discard block |
||
| 2902 | 2902 | $this->db->begin(); |
| 2903 | 2903 | |
| 2904 | 2904 | $sql = 'SELECT t.rowid'; |
| 2905 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
|
| 2906 | - $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2907 | - $sql .= " AND code_journal = '" . $this->db->escape($inventory_journal->code) . "'"; |
|
| 2908 | - $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($date_start) . "'"; |
|
| 2909 | - $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($date_end) . "'"; |
|
| 2910 | - $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($fiscal_period->date_start) . "'"; |
|
| 2911 | - $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($fiscal_period->date_end) . "'"; |
|
| 2905 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; |
|
| 2906 | + $sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2907 | + $sql .= " AND code_journal = '".$this->db->escape($inventory_journal->code)."'"; |
|
| 2908 | + $sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($date_start)."'"; |
|
| 2909 | + $sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($date_end)."'"; |
|
| 2910 | + $sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($fiscal_period->date_start)."'"; |
|
| 2911 | + $sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($fiscal_period->date_end)."'"; |
|
| 2912 | 2912 | |
| 2913 | 2913 | $resql = $this->db->query($sql); |
| 2914 | 2914 | if (!$resql) { |
| 2915 | - $this->errors[] = 'Error ' . $this->db->lasterror(); |
|
| 2916 | - dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); |
|
| 2915 | + $this->errors[] = 'Error '.$this->db->lasterror(); |
|
| 2916 | + dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR); |
|
| 2917 | 2917 | |
| 2918 | 2918 | $error++; |
| 2919 | 2919 | } else { |
@@ -2928,7 +2928,7 @@ discard block |
||
| 2928 | 2928 | break; |
| 2929 | 2929 | } elseif ($result == 0) { |
| 2930 | 2930 | $langs->loadLangs(array('errors', 'accountancy')); |
| 2931 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('LineId') . ': ' . $obj->rowid; |
|
| 2931 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('LineId').': '.$obj->rowid; |
|
| 2932 | 2932 | $error++; |
| 2933 | 2933 | break; |
| 2934 | 2934 | } |