@@ -288,7 +288,7 @@ |
||
| 288 | 288 | $mesg[] = $langs->trans("ErrorNoValueForSelectListType"); |
| 289 | 289 | $action = 'edit'; |
| 290 | 290 | } |
| 291 | - if ($type == 'stars' && ($extrasize < 1|| $extrasize > 10)) { |
|
| 291 | + if ($type == 'stars' && ($extrasize < 1 || $extrasize > 10)) { |
|
| 292 | 292 | $error++; |
| 293 | 293 | $langs->load("errors"); |
| 294 | 294 | $mesg[] = $langs->trans("ErrorSizeForStarsType"); |
@@ -118,15 +118,15 @@ discard block |
||
| 118 | 118 | /** |
| 119 | 119 | * @var float |
| 120 | 120 | */ |
| 121 | - public $totalpaid; // duplicate with sumpayed |
|
| 121 | + public $totalpaid; // duplicate with sumpayed |
|
| 122 | 122 | /** |
| 123 | 123 | * @var int|float |
| 124 | 124 | */ |
| 125 | - public $totaldeposits; // duplicate with sumdeposit |
|
| 125 | + public $totaldeposits; // duplicate with sumdeposit |
|
| 126 | 126 | /** |
| 127 | 127 | * @var int|float |
| 128 | 128 | */ |
| 129 | - public $totalcreditnotes; // duplicate with sumcreditnote |
|
| 129 | + public $totalcreditnotes; // duplicate with sumcreditnote |
|
| 130 | 130 | |
| 131 | 131 | /** |
| 132 | 132 | * @var int|float |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | public function getListOfPayments($filtertype = '', $multicurrency = 0, $mode = 0) |
| 499 | 499 | { |
| 500 | 500 | $retarray = array(); |
| 501 | - $this->error = ''; // By default no error, list can be empty. |
|
| 501 | + $this->error = ''; // By default no error, list can be empty. |
|
| 502 | 502 | |
| 503 | 503 | $table = 'paiement_facture'; |
| 504 | 504 | $table2 = 'paiement'; |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | |
| 519 | 519 | // List of payments |
| 520 | 520 | if (empty($mode) || $mode == 1) { |
| 521 | - $sql = "SELECT p.ref, pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, p.num_paiement as num, t.code".$field3 . $field4; |
|
| 521 | + $sql = "SELECT p.ref, pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, p.num_paiement as num, t.code".$field3.$field4; |
|
| 522 | 522 | $sql .= " FROM ".$this->db->prefix().$table." as pf, ".$this->db->prefix().$table2." as p, ".$this->db->prefix()."c_paiement as t"; |
| 523 | 523 | $sql .= " WHERE pf.".$field." = ".((int) $this->id); |
| 524 | 524 | $sql .= " AND pf.".$field2." = p.rowid"; |
@@ -774,12 +774,12 @@ discard block |
||
| 774 | 774 | { |
| 775 | 775 | $subtypeLabel = ''; |
| 776 | 776 | if ($table === 'facture' || $table === 'facture_fourn') { |
| 777 | - $sql = "SELECT s.label FROM " . $this->db->prefix() . $table . " AS f"; |
|
| 778 | - $sql .= " INNER JOIN " . $this->db->prefix() . "c_invoice_subtype AS s ON f.subtype = s.rowid"; |
|
| 777 | + $sql = "SELECT s.label FROM ".$this->db->prefix().$table." AS f"; |
|
| 778 | + $sql .= " INNER JOIN ".$this->db->prefix()."c_invoice_subtype AS s ON f.subtype = s.rowid"; |
|
| 779 | 779 | $sql .= " WHERE f.ref = '".$this->db->escape($this->ref)."'"; |
| 780 | 780 | } elseif ($table === 'facture_rec' || $table === 'facture_fourn_rec') { |
| 781 | - $sql = "SELECT s.label FROM " . $this->db->prefix() . $table . " AS f"; |
|
| 782 | - $sql .= " INNER JOIN " . $this->db->prefix() . "c_invoice_subtype AS s ON f.subtype = s.rowid"; |
|
| 781 | + $sql = "SELECT s.label FROM ".$this->db->prefix().$table." AS f"; |
|
| 782 | + $sql .= " INNER JOIN ".$this->db->prefix()."c_invoice_subtype AS s ON f.subtype = s.rowid"; |
|
| 783 | 783 | $sql .= " WHERE f.titre = '".$this->db->escape($this->title)."'"; |
| 784 | 784 | } else { |
| 785 | 785 | return -1; |
@@ -811,11 +811,11 @@ discard block |
||
| 811 | 811 | $effs = array(); |
| 812 | 812 | |
| 813 | 813 | $sql = "SELECT rowid, code, label as label"; |
| 814 | - $sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype'; |
|
| 814 | + $sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype'; |
|
| 815 | 815 | $sql .= " WHERE active = 1 AND fk_country = ".((int) $mysoc->country_id)." AND entity IN(".getEntity('c_invoice_subtype').")"; |
| 816 | 816 | $sql .= " ORDER by rowid, code"; |
| 817 | 817 | |
| 818 | - dol_syslog(get_class($this) . '::getArrayOfInvoiceSubtypes', LOG_DEBUG); |
|
| 818 | + dol_syslog(get_class($this).'::getArrayOfInvoiceSubtypes', LOG_DEBUG); |
|
| 819 | 819 | $resql = $this->db->query($sql); |
| 820 | 820 | if ($resql) { |
| 821 | 821 | $num = $this->db->num_rows($resql); |
@@ -1207,7 +1207,7 @@ discard block |
||
| 1207 | 1207 | if ($this->status > self::STATUS_DRAFT && $this->paye == 0) { |
| 1208 | 1208 | // Get the default payment mode for BAN payment of the third party |
| 1209 | 1209 | require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; |
| 1210 | - $bac = new CompanyBankAccount($this->db); // Table societe_rib |
|
| 1210 | + $bac = new CompanyBankAccount($this->db); // Table societe_rib |
|
| 1211 | 1211 | $result = $bac->fetch(0, '', $this->socid, 1, 'ban'); |
| 1212 | 1212 | if ($result <= 0 || empty($bac->id)) { |
| 1213 | 1213 | $this->error = $langs->trans("ThirdpartyHasNoDefaultBanAccount"); |
@@ -1221,16 +1221,16 @@ discard block |
||
| 1221 | 1221 | $sql .= " FROM ".$this->db->prefix()."prelevement_demande"; |
| 1222 | 1222 | $sql .= " WHERE rowid = ".((int) $did); |
| 1223 | 1223 | if ($type != 'bank-transfer' && $type != 'credit-transfer') { |
| 1224 | - $sql .= " AND fk_facture = ".((int) $this->id); // Add a protection to not pay another invoice than current one |
|
| 1224 | + $sql .= " AND fk_facture = ".((int) $this->id); // Add a protection to not pay another invoice than current one |
|
| 1225 | 1225 | } |
| 1226 | 1226 | if ($type != 'direct-debit') { |
| 1227 | 1227 | if ($sourcetype == 'salary') { |
| 1228 | - $sql .= " AND fk_salary = ".((int) $this->id); // Add a protection to not pay another salary than current one |
|
| 1228 | + $sql .= " AND fk_salary = ".((int) $this->id); // Add a protection to not pay another salary than current one |
|
| 1229 | 1229 | } else { |
| 1230 | - $sql .= " AND fk_facture_fourn = ".((int) $this->id); // Add a protection to not pay another invoice than current one |
|
| 1230 | + $sql .= " AND fk_facture_fourn = ".((int) $this->id); // Add a protection to not pay another invoice than current one |
|
| 1231 | 1231 | } |
| 1232 | 1232 | } |
| 1233 | - $sql .= " AND traite = 0"; // To not process payment request that were already converted into a direct debit or credit transfer order (Note: fk_prelevement_bons is also empty when traite = 0) |
|
| 1233 | + $sql .= " AND traite = 0"; // To not process payment request that were already converted into a direct debit or credit transfer order (Note: fk_prelevement_bons is also empty when traite = 0) |
|
| 1234 | 1234 | |
| 1235 | 1235 | dol_syslog(get_class($this)."::makeStripeSepaRequest load requests to process", LOG_DEBUG); |
| 1236 | 1236 | $resql = $this->db->query($sql); |
@@ -1246,7 +1246,7 @@ discard block |
||
| 1246 | 1246 | |
| 1247 | 1247 | if (is_numeric($amount) && $amount != 0) { |
| 1248 | 1248 | require_once DOL_DOCUMENT_ROOT.'/societe/class/companypaymentmode.class.php'; |
| 1249 | - $companypaymentmode = new CompanyPaymentMode($this->db); // table societe_rib |
|
| 1249 | + $companypaymentmode = new CompanyPaymentMode($this->db); // table societe_rib |
|
| 1250 | 1250 | $companypaymentmode->fetch($bac->id); |
| 1251 | 1251 | |
| 1252 | 1252 | $this->stripechargedone = 0; |
@@ -1256,11 +1256,11 @@ discard block |
||
| 1256 | 1256 | |
| 1257 | 1257 | $currency = $conf->currency; |
| 1258 | 1258 | |
| 1259 | - $errorforinvoice = 0; // We reset the $errorforinvoice at each invoice loop |
|
| 1259 | + $errorforinvoice = 0; // We reset the $errorforinvoice at each invoice loop |
|
| 1260 | 1260 | |
| 1261 | 1261 | $this->fetch_thirdparty(); |
| 1262 | 1262 | |
| 1263 | - dol_syslog("makeStripeSepaRequest Process payment request amount=".$amount." thirdparty_id=" . $this->thirdparty->id . ", thirdparty_name=" . $this->thirdparty->name . " ban id=" . $bac->id, LOG_DEBUG); |
|
| 1263 | + dol_syslog("makeStripeSepaRequest Process payment request amount=".$amount." thirdparty_id=".$this->thirdparty->id.", thirdparty_name=".$this->thirdparty->name." ban id=".$bac->id, LOG_DEBUG); |
|
| 1264 | 1264 | |
| 1265 | 1265 | //$alreadypayed = $this->getSommePaiement(); |
| 1266 | 1266 | //$amount_credit_notes_included = $this->getSumCreditNotesUsed(); |
@@ -1275,7 +1275,7 @@ discard block |
||
| 1275 | 1275 | $amountstripe *= 100; |
| 1276 | 1276 | } |
| 1277 | 1277 | |
| 1278 | - $fk_bank_account = getDolGlobalInt('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'); // Bank account used for SEPA direct debit or credit transfer. Must be the Stripe account in Dolibarr. |
|
| 1278 | + $fk_bank_account = getDolGlobalInt('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'); // Bank account used for SEPA direct debit or credit transfer. Must be the Stripe account in Dolibarr. |
|
| 1279 | 1279 | if (!($fk_bank_account > 0)) { |
| 1280 | 1280 | $error++; |
| 1281 | 1281 | $errorforinvoice++; |
@@ -1332,44 +1332,44 @@ discard block |
||
| 1332 | 1332 | } |
| 1333 | 1333 | |
| 1334 | 1334 | //var_dump($companypaymentmode); |
| 1335 | - dol_syslog("makeStripeSepaRequest We will try to pay with companypaymentmodeid=" . $companypaymentmode->id . " stripe_card_ref=" . $companypaymentmode->stripe_card_ref . " mode=" . $companypaymentmode->status, LOG_DEBUG); |
|
| 1335 | + dol_syslog("makeStripeSepaRequest We will try to pay with companypaymentmodeid=".$companypaymentmode->id." stripe_card_ref=".$companypaymentmode->stripe_card_ref." mode=".$companypaymentmode->status, LOG_DEBUG); |
|
| 1336 | 1336 | |
| 1337 | 1337 | $thirdparty = new Societe($this->db); |
| 1338 | 1338 | $resultthirdparty = $thirdparty->fetch($this->socid); |
| 1339 | 1339 | |
| 1340 | - include_once DOL_DOCUMENT_ROOT . '/stripe/class/stripe.class.php'; // This include the include of htdocs/stripe/config.php |
|
| 1340 | + include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; // This include the include of htdocs/stripe/config.php |
|
| 1341 | 1341 | // So it inits or erases the $stripearrayofkeysbyenv |
| 1342 | 1342 | $stripe = new Stripe($this->db); |
| 1343 | 1343 | |
| 1344 | 1344 | if (empty($savstripearrayofkeysbyenv)) { |
| 1345 | 1345 | $savstripearrayofkeysbyenv = $stripearrayofkeysbyenv; |
| 1346 | 1346 | } |
| 1347 | - dol_syslog("makeStripeSepaRequest Current Stripe environment is " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']); |
|
| 1347 | + dol_syslog("makeStripeSepaRequest Current Stripe environment is ".$stripearrayofkeysbyenv[$servicestatus]['publishable_key']); |
|
| 1348 | 1348 | dol_syslog("makeStripeSepaRequest Current Saved Stripe environment is ".$savstripearrayofkeysbyenv[$servicestatus]['publishable_key']); |
| 1349 | 1349 | |
| 1350 | 1350 | $foundalternativestripeaccount = ''; |
| 1351 | 1351 | |
| 1352 | 1352 | // Force stripe to another value (by default this value is empty) |
| 1353 | - if (! empty($forcestripe)) { |
|
| 1353 | + if (!empty($forcestripe)) { |
|
| 1354 | 1354 | dol_syslog("makeStripeSepaRequest A dedicated stripe account was forced, so we switch to it."); |
| 1355 | 1355 | |
| 1356 | 1356 | $tmparray = explode('@', $forcestripe); |
| 1357 | - if (! empty($tmparray[1])) { |
|
| 1357 | + if (!empty($tmparray[1])) { |
|
| 1358 | 1358 | $tmparray2 = explode(':', $tmparray[1]); |
| 1359 | - if (! empty($tmparray2[1])) { |
|
| 1359 | + if (!empty($tmparray2[1])) { |
|
| 1360 | 1360 | $stripearrayofkeysbyenv[$servicestatus]["publishable_key"] = $tmparray2[0]; |
| 1361 | 1361 | $stripearrayofkeysbyenv[$servicestatus]["secret_key"] = $tmparray2[1]; |
| 1362 | 1362 | |
| 1363 | 1363 | $stripearrayofkeys = $stripearrayofkeysbyenv[$servicestatus]; |
| 1364 | 1364 | \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); |
| 1365 | 1365 | |
| 1366 | - $foundalternativestripeaccount = $tmparray[0]; // Store the customer id |
|
| 1366 | + $foundalternativestripeaccount = $tmparray[0]; // Store the customer id |
|
| 1367 | 1367 | |
| 1368 | 1368 | dol_syslog("makeStripeSepaRequest We use now customer=".$foundalternativestripeaccount." publishable_key=".$stripearrayofkeys['publishable_key'], LOG_DEBUG); |
| 1369 | 1369 | } |
| 1370 | 1370 | } |
| 1371 | 1371 | |
| 1372 | - if (! $foundalternativestripeaccount) { |
|
| 1372 | + if (!$foundalternativestripeaccount) { |
|
| 1373 | 1373 | $stripearrayofkeysbyenv = $savstripearrayofkeysbyenv; |
| 1374 | 1374 | |
| 1375 | 1375 | $stripearrayofkeys = $savstripearrayofkeysbyenv[$servicestatus]; |
@@ -1384,7 +1384,7 @@ discard block |
||
| 1384 | 1384 | dol_syslog("makeStripeSepaRequest No dedicated Stripe Account requested, so we use global one, so ".$stripearrayofkeys['publishable_key'], LOG_DEBUG); |
| 1385 | 1385 | } |
| 1386 | 1386 | |
| 1387 | - $stripeacc = $stripe->getStripeAccount($service, $this->socid); // Get Stripe OAuth connect account if it exists (no network access here) |
|
| 1387 | + $stripeacc = $stripe->getStripeAccount($service, $this->socid); // Get Stripe OAuth connect account if it exists (no network access here) |
|
| 1388 | 1388 | |
| 1389 | 1389 | if ($foundalternativestripeaccount) { |
| 1390 | 1390 | if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage |
@@ -1394,7 +1394,7 @@ discard block |
||
| 1394 | 1394 | } |
| 1395 | 1395 | } else { |
| 1396 | 1396 | $customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 0); |
| 1397 | - if (empty($customer) && ! empty($stripe->error)) { |
|
| 1397 | + if (empty($customer) && !empty($stripe->error)) { |
|
| 1398 | 1398 | $this->errors[] = $stripe->error; |
| 1399 | 1399 | } |
| 1400 | 1400 | /*if (!empty($customer) && empty($customer->sources)) { |
@@ -1421,15 +1421,15 @@ discard block |
||
| 1421 | 1421 | } |
| 1422 | 1422 | |
| 1423 | 1423 | if ($stripecard) { // Can be src_... (for sepa) or pm_... (new card mode). Note that card_... (old card mode) should not happen here. |
| 1424 | - $FULLTAG = 'DID='.$did.'-INV=' . $this->id . '-CUS=' . $thirdparty->id; |
|
| 1425 | - $description = 'Stripe payment from makeStripeSepaRequest: ' . $FULLTAG . ' did='.$did.' ref=' . $this->ref; |
|
| 1424 | + $FULLTAG = 'DID='.$did.'-INV='.$this->id.'-CUS='.$thirdparty->id; |
|
| 1425 | + $description = 'Stripe payment from makeStripeSepaRequest: '.$FULLTAG.' did='.$did.' ref='.$this->ref; |
|
| 1426 | 1426 | |
| 1427 | 1427 | $stripefailurecode = ''; |
| 1428 | 1428 | $stripefailuremessage = ''; |
| 1429 | 1429 | $stripefailuredeclinecode = ''; |
| 1430 | 1430 | |
| 1431 | 1431 | // Using new SCA method |
| 1432 | - dol_syslog("* Create payment on SEPA " . $stripecard->id . ", amounttopay=" . $amounttopay . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG); |
|
| 1432 | + dol_syslog("* Create payment on SEPA ".$stripecard->id.", amounttopay=".$amounttopay.", amountstripe=".$amountstripe.", FULLTAG=".$FULLTAG, LOG_DEBUG); |
|
| 1433 | 1433 | |
| 1434 | 1434 | // Create payment intent and charge payment (confirmnow = true) |
| 1435 | 1435 | $paymentintent = $stripe->getPaymentIntent($amounttopay, $currency, $FULLTAG, $description, $this, $customer->id, $stripeacc, $servicestatus, 0, 'automatic', true, $stripecard->id, 1, 1, $did); |
@@ -1450,7 +1450,7 @@ discard block |
||
| 1450 | 1450 | $charge->failure_message = $stripe->error; |
| 1451 | 1451 | $charge->failure_declinecode = $stripe->declinecode; |
| 1452 | 1452 | $stripefailurecode = $stripe->code; |
| 1453 | - $stripefailuremessage = 'Action required. Contact the support at ';// . $conf->global->SELLYOURSAAS_MAIN_EMAIL; |
|
| 1453 | + $stripefailuremessage = 'Action required. Contact the support at '; // . $conf->global->SELLYOURSAAS_MAIN_EMAIL; |
|
| 1454 | 1454 | $stripefailuredeclinecode = $stripe->declinecode; |
| 1455 | 1455 | } else { |
| 1456 | 1456 | dol_syslog(var_export($paymentintent, true), LOG_DEBUG); |
@@ -1471,7 +1471,7 @@ discard block |
||
| 1471 | 1471 | |
| 1472 | 1472 | // Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...) |
| 1473 | 1473 | if (empty($charge) || $charge->status == 'failed') { |
| 1474 | - dol_syslog('Failed to charge payment mode ' . $stripecard->id . ' stripefailurecode=' . $stripefailurecode . ' stripefailuremessage=' . $stripefailuremessage . ' stripefailuredeclinecode=' . $stripefailuredeclinecode, LOG_WARNING); |
|
| 1474 | + dol_syslog('Failed to charge payment mode '.$stripecard->id.' stripefailurecode='.$stripefailurecode.' stripefailuremessage='.$stripefailuremessage.' stripefailuredeclinecode='.$stripefailuredeclinecode, LOG_WARNING); |
|
| 1475 | 1475 | |
| 1476 | 1476 | // Save a stripe payment was in error |
| 1477 | 1477 | $this->stripechargeerror++; |
@@ -1484,8 +1484,8 @@ discard block |
||
| 1484 | 1484 | $errauthenticationmessage = $langs->trans("ErrSCAAuthentication"); |
| 1485 | 1485 | $errmsg = $errauthenticationmessage; |
| 1486 | 1486 | } elseif (in_array($stripefailuredeclinecode, ['insufficient_funds', 'generic_decline'])) { |
| 1487 | - $errmsg .= ': ' . $charge->failure_code; |
|
| 1488 | - $errmsg .= ($charge->failure_message ? ' - ' : '') . ' ' . $charge->failure_message; |
|
| 1487 | + $errmsg .= ': '.$charge->failure_code; |
|
| 1488 | + $errmsg .= ($charge->failure_message ? ' - ' : '').' '.$charge->failure_message; |
|
| 1489 | 1489 | if (empty($stripefailurecode)) { |
| 1490 | 1490 | $stripefailurecode = $charge->failure_code; |
| 1491 | 1491 | } |
@@ -1493,8 +1493,8 @@ discard block |
||
| 1493 | 1493 | $stripefailuremessage = $charge->failure_message; |
| 1494 | 1494 | } |
| 1495 | 1495 | } else { |
| 1496 | - $errmsg .= ': failure_code=' . $charge->failure_code; |
|
| 1497 | - $errmsg .= ($charge->failure_message ? ' - ' : '') . ' failure_message=' . $charge->failure_message; |
|
| 1496 | + $errmsg .= ': failure_code='.$charge->failure_code; |
|
| 1497 | + $errmsg .= ($charge->failure_message ? ' - ' : '').' failure_message='.$charge->failure_message; |
|
| 1498 | 1498 | if (empty($stripefailurecode)) { |
| 1499 | 1499 | $stripefailurecode = $charge->failure_code; |
| 1500 | 1500 | } |
@@ -1503,24 +1503,24 @@ discard block |
||
| 1503 | 1503 | } |
| 1504 | 1504 | } |
| 1505 | 1505 | } else { |
| 1506 | - $errmsg .= ': ' . $stripefailurecode . ' - ' . $stripefailuremessage; |
|
| 1507 | - $errmsg .= ($stripefailuredeclinecode ? ' - ' . $stripefailuredeclinecode : ''); |
|
| 1506 | + $errmsg .= ': '.$stripefailurecode.' - '.$stripefailuremessage; |
|
| 1507 | + $errmsg .= ($stripefailuredeclinecode ? ' - '.$stripefailuredeclinecode : ''); |
|
| 1508 | 1508 | } |
| 1509 | 1509 | |
| 1510 | - $description = 'Stripe payment ERROR from makeStripeSepaRequest: ' . $FULLTAG; |
|
| 1511 | - $postactionmessages[] = $errmsg . ' (' . $stripearrayofkeys['publishable_key'] . ')'; |
|
| 1510 | + $description = 'Stripe payment ERROR from makeStripeSepaRequest: '.$FULLTAG; |
|
| 1511 | + $postactionmessages[] = $errmsg.' ('.$stripearrayofkeys['publishable_key'].')'; |
|
| 1512 | 1512 | $this->errors[] = $errmsg; |
| 1513 | 1513 | } else { |
| 1514 | 1514 | dol_syslog('Successfuly request '.$type.' '.$stripecard->id); |
| 1515 | 1515 | |
| 1516 | - $postactionmessages[] = 'Success to request '.$type.' (' . $charge->id . ' with ' . $stripearrayofkeys['publishable_key'] . ')'; |
|
| 1516 | + $postactionmessages[] = 'Success to request '.$type.' ('.$charge->id.' with '.$stripearrayofkeys['publishable_key'].')'; |
|
| 1517 | 1517 | |
| 1518 | 1518 | // Save a stripe payment was done in real life so later we will be able to force a commit on recorded payments |
| 1519 | 1519 | // even if in batch mode (method doTakePaymentStripe), we will always make all action in one transaction with a forced commit. |
| 1520 | 1520 | $this->stripechargedone++; |
| 1521 | 1521 | |
| 1522 | 1522 | // Default description used for label of event. Will be overwrite by another value later. |
| 1523 | - $description = 'Stripe payment request OK (' . $charge->id . ') from makeStripeSepaRequest: ' . $FULLTAG; |
|
| 1523 | + $description = 'Stripe payment request OK ('.$charge->id.') from makeStripeSepaRequest: '.$FULLTAG; |
|
| 1524 | 1524 | } |
| 1525 | 1525 | |
| 1526 | 1526 | $object = $this; |
@@ -1529,8 +1529,8 @@ discard block |
||
| 1529 | 1529 | if (empty($charge) || $charge->status == 'failed') { |
| 1530 | 1530 | $actioncode = 'PAYMENT_STRIPE_KO'; |
| 1531 | 1531 | $extraparams = $stripefailurecode; |
| 1532 | - $extraparams .= (($extraparams && $stripefailuremessage) ? ' - ' : '') . $stripefailuremessage; |
|
| 1533 | - $extraparams .= (($extraparams && $stripefailuredeclinecode) ? ' - ' : '') . $stripefailuredeclinecode; |
|
| 1532 | + $extraparams .= (($extraparams && $stripefailuremessage) ? ' - ' : '').$stripefailuremessage; |
|
| 1533 | + $extraparams .= (($extraparams && $stripefailuredeclinecode) ? ' - ' : '').$stripefailuredeclinecode; |
|
| 1534 | 1534 | } else { |
| 1535 | 1535 | $actioncode = 'PAYMENT_STRIPE_OK'; |
| 1536 | 1536 | $extraparams = ''; |
@@ -1538,13 +1538,13 @@ discard block |
||
| 1538 | 1538 | } else { |
| 1539 | 1539 | $error++; |
| 1540 | 1540 | $errorforinvoice++; |
| 1541 | - dol_syslog("No ban payment method found for this stripe customer " . $customer->id, LOG_WARNING); |
|
| 1542 | - $this->errors[] = 'Failed to get direct debit payment method for stripe customer = ' . $customer->id; |
|
| 1541 | + dol_syslog("No ban payment method found for this stripe customer ".$customer->id, LOG_WARNING); |
|
| 1542 | + $this->errors[] = 'Failed to get direct debit payment method for stripe customer = '.$customer->id; |
|
| 1543 | 1543 | |
| 1544 | 1544 | $description = 'Failed to find or use the payment mode - no ban defined for the thirdparty account'; |
| 1545 | 1545 | $stripefailurecode = 'BADPAYMENTMODE'; |
| 1546 | 1546 | $stripefailuremessage = 'Failed to find or use the payment mode - no ban defined for the thirdparty account'; |
| 1547 | - $postactionmessages[] = $description . ' (' . $stripearrayofkeys['publishable_key'] . ')'; |
|
| 1547 | + $postactionmessages[] = $description.' ('.$stripearrayofkeys['publishable_key'].')'; |
|
| 1548 | 1548 | |
| 1549 | 1549 | $object = $this; |
| 1550 | 1550 | |
@@ -1564,11 +1564,11 @@ discard block |
||
| 1564 | 1564 | } |
| 1565 | 1565 | } else { // Else of the if ($resultthirdparty > 0 && ! empty($customer)) { |
| 1566 | 1566 | if ($resultthirdparty <= 0) { |
| 1567 | - dol_syslog('SellYourSaasUtils Failed to load customer for thirdparty_id = ' . $thirdparty->id, LOG_WARNING); |
|
| 1568 | - $this->errors[] = 'Failed to load Stripe account for thirdparty_id = ' . $thirdparty->id; |
|
| 1567 | + dol_syslog('SellYourSaasUtils Failed to load customer for thirdparty_id = '.$thirdparty->id, LOG_WARNING); |
|
| 1568 | + $this->errors[] = 'Failed to load Stripe account for thirdparty_id = '.$thirdparty->id; |
|
| 1569 | 1569 | } else { // $customer stripe not found |
| 1570 | - dol_syslog('SellYourSaasUtils Failed to get Stripe customer id for thirdparty_id = ' . $thirdparty->id . " in mode " . $servicestatus . " in Stripe env " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key'], LOG_WARNING); |
|
| 1571 | - $this->errors[] = 'Failed to get Stripe account id for thirdparty_id = ' . $thirdparty->id . " in mode " . $servicestatus . " in Stripe env " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']; |
|
| 1570 | + dol_syslog('SellYourSaasUtils Failed to get Stripe customer id for thirdparty_id = '.$thirdparty->id." in mode ".$servicestatus." in Stripe env ".$stripearrayofkeysbyenv[$servicestatus]['publishable_key'], LOG_WARNING); |
|
| 1571 | + $this->errors[] = 'Failed to get Stripe account id for thirdparty_id = '.$thirdparty->id." in mode ".$servicestatus." in Stripe env ".$stripearrayofkeysbyenv[$servicestatus]['publishable_key']; |
|
| 1572 | 1572 | } |
| 1573 | 1573 | $error++; |
| 1574 | 1574 | $errorforinvoice++; |
@@ -1585,24 +1585,24 @@ discard block |
||
| 1585 | 1585 | } |
| 1586 | 1586 | |
| 1587 | 1587 | if ($description) { |
| 1588 | - dol_syslog("* Record event for credit transfer or direct debit request result - " . $description); |
|
| 1588 | + dol_syslog("* Record event for credit transfer or direct debit request result - ".$description); |
|
| 1589 | 1589 | require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; |
| 1590 | 1590 | |
| 1591 | 1591 | // Insert record of payment (success or error) |
| 1592 | 1592 | $actioncomm = new ActionComm($this->db); |
| 1593 | 1593 | |
| 1594 | - $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) |
|
| 1595 | - $actioncomm->code = 'AC_' . $actioncode; |
|
| 1594 | + $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) |
|
| 1595 | + $actioncomm->code = 'AC_'.$actioncode; |
|
| 1596 | 1596 | $actioncomm->label = $description; |
| 1597 | 1597 | $actioncomm->note_private = implode(",\n", $postactionmessages); |
| 1598 | 1598 | $actioncomm->fk_project = $this->fk_project; |
| 1599 | 1599 | $actioncomm->datep = $now; |
| 1600 | 1600 | $actioncomm->datef = $now; |
| 1601 | - $actioncomm->percentage = -1; // Not applicable |
|
| 1601 | + $actioncomm->percentage = -1; // Not applicable |
|
| 1602 | 1602 | $actioncomm->socid = $thirdparty->id; |
| 1603 | 1603 | $actioncomm->contactid = 0; |
| 1604 | - $actioncomm->authorid = $user->id; // User saving action |
|
| 1605 | - $actioncomm->userownerid = $user->id; // Owner of action |
|
| 1604 | + $actioncomm->authorid = $user->id; // User saving action |
|
| 1605 | + $actioncomm->userownerid = $user->id; // Owner of action |
|
| 1606 | 1606 | // Fields when action is a real email (content is already into note) |
| 1607 | 1607 | /*$actioncomm->email_msgid = $object->email_msgid; |
| 1608 | 1608 | $actioncomm->email_from = $object->email_from; |
@@ -1624,14 +1624,14 @@ discard block |
||
| 1624 | 1624 | } catch (Exception $e) { |
| 1625 | 1625 | $error++; |
| 1626 | 1626 | $errorforinvoice++; |
| 1627 | - dol_syslog('Error ' . $e->getMessage(), LOG_ERR); |
|
| 1628 | - $this->errors[] = 'Error ' . $e->getMessage(); |
|
| 1627 | + dol_syslog('Error '.$e->getMessage(), LOG_ERR); |
|
| 1628 | + $this->errors[] = 'Error '.$e->getMessage(); |
|
| 1629 | 1629 | } |
| 1630 | 1630 | } else { // If remain to pay is null |
| 1631 | 1631 | $error++; |
| 1632 | 1632 | $errorforinvoice++; |
| 1633 | - dol_syslog("Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?", LOG_WARNING); |
|
| 1634 | - $this->errors[] = "Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?"; |
|
| 1633 | + dol_syslog("Remain to pay is null for the invoice ".$this->id." ".$this->ref.". Why is the invoice not classified 'Paid' ?", LOG_WARNING); |
|
| 1634 | + $this->errors[] = "Remain to pay is null for the invoice ".$this->id." ".$this->ref.". Why is the invoice not classified 'Paid' ?"; |
|
| 1635 | 1635 | } |
| 1636 | 1636 | } |
| 1637 | 1637 | |
@@ -1738,10 +1738,10 @@ discard block |
||
| 1738 | 1738 | |
| 1739 | 1739 | // Add the standard elements to the QR code |
| 1740 | 1740 | $lines = [ |
| 1741 | - 'BCD', // Service Tag (optional) |
|
| 1742 | - '002', // Version (optional) |
|
| 1743 | - '1', // Character set (optional) |
|
| 1744 | - 'SCT', // Identification (optional) |
|
| 1741 | + 'BCD', // Service Tag (optional) |
|
| 1742 | + '002', // Version (optional) |
|
| 1743 | + '1', // Character set (optional) |
|
| 1744 | + 'SCT', // Identification (optional) |
|
| 1745 | 1745 | ]; |
| 1746 | 1746 | |
| 1747 | 1747 | // Add the bank account information |
@@ -1759,7 +1759,7 @@ discard block |
||
| 1759 | 1759 | } |
| 1760 | 1760 | |
| 1761 | 1761 | // Add the amount and reference |
| 1762 | - $lines[] = 'EUR' . $totalTTCString; // Amount (optional) |
|
| 1762 | + $lines[] = 'EUR'.$totalTTCString; // Amount (optional) |
|
| 1763 | 1763 | $lines[] = ''; // Payment reference (optional) |
| 1764 | 1764 | $lines[] = $this->ref; // Remittance Information (optional) |
| 1765 | 1765 | |
@@ -1815,10 +1815,10 @@ discard block |
||
| 1815 | 1815 | $s .= pack('C1', 3).pack('C1', strlen($datestring)).$datestring; |
| 1816 | 1816 | $s .= pack('C1', 4).pack('C1', strlen($pricewithtaxstring)).$pricewithtaxstring; |
| 1817 | 1817 | $s .= pack('C1', 5).pack('C1', strlen($pricetaxstring)).$pricetaxstring; |
| 1818 | - $s .= ''; // Hash of xml invoice |
|
| 1819 | - $s .= ''; // ecda signature |
|
| 1820 | - $s .= ''; // ecda public key |
|
| 1821 | - $s .= ''; // ecda signature of public key stamp |
|
| 1818 | + $s .= ''; // Hash of xml invoice |
|
| 1819 | + $s .= ''; // ecda signature |
|
| 1820 | + $s .= ''; // ecda public key |
|
| 1821 | + $s .= ''; // ecda signature of public key stamp |
|
| 1822 | 1822 | |
| 1823 | 1823 | $s = base64_encode($s); |
| 1824 | 1824 | |
@@ -1886,8 +1886,8 @@ discard block |
||
| 1886 | 1886 | $s .= "S\n"; |
| 1887 | 1887 | $s .= dol_trunc($bankaccount->proprio, 70, 'right', 'UTF-8', 1)."\n"; |
| 1888 | 1888 | $addresslinearray = explode("\n", $bankaccount->owner_address); |
| 1889 | - $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 |
|
| 1890 | - $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 |
|
| 1889 | + $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 |
|
| 1890 | + $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 |
|
| 1891 | 1891 | /*$s .= dol_trunc($mysoc->zip, 16, 'right', 'UTF-8', 1)."\n"; |
| 1892 | 1892 | $s .= dol_trunc($mysoc->town, 35, 'right', 'UTF-8', 1)."\n"; |
| 1893 | 1893 | $s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1)."\n";*/ |
@@ -1895,8 +1895,8 @@ discard block |
||
| 1895 | 1895 | $s .= "S\n"; |
| 1896 | 1896 | $s .= dol_trunc($mysoc->name, 70, 'right', 'UTF-8', 1)."\n"; |
| 1897 | 1897 | $addresslinearray = explode("\n", $mysoc->address); |
| 1898 | - $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 |
|
| 1899 | - $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 |
|
| 1898 | + $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 |
|
| 1899 | + $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 |
|
| 1900 | 1900 | $s .= dol_trunc($mysoc->zip, 16, 'right', 'UTF-8', 1)."\n"; |
| 1901 | 1901 | $s .= dol_trunc($mysoc->town, 35, 'right', 'UTF-8', 1)."\n"; |
| 1902 | 1902 | $s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1)."\n"; |
@@ -1916,14 +1916,14 @@ discard block |
||
| 1916 | 1916 | $s .= "S\n"; |
| 1917 | 1917 | $s .= dol_trunc($this->thirdparty->name, 70, 'right', 'UTF-8', 1)."\n"; |
| 1918 | 1918 | $addresslinearray = explode("\n", $this->thirdparty->address); |
| 1919 | - $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 |
|
| 1920 | - $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 |
|
| 1919 | + $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 |
|
| 1920 | + $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 |
|
| 1921 | 1921 | $s .= dol_trunc($this->thirdparty->zip, 16, 'right', 'UTF-8', 1)."\n"; |
| 1922 | 1922 | $s .= dol_trunc($this->thirdparty->town, 35, 'right', 'UTF-8', 1)."\n"; |
| 1923 | 1923 | $s .= dol_trunc($this->thirdparty->country_code, 2, 'right', 'UTF-8', 1)."\n"; |
| 1924 | 1924 | // ID of payment |
| 1925 | - $s .= "NON\n"; // NON or QRR |
|
| 1926 | - $s .= "\n"; // QR Code reference if previous field is QRR |
|
| 1925 | + $s .= "NON\n"; // NON or QRR |
|
| 1926 | + $s .= "\n"; // QR Code reference if previous field is QRR |
|
| 1927 | 1927 | // Free text |
| 1928 | 1928 | if ($complementaryinfo) { |
| 1929 | 1929 | $s .= $complementaryinfo."\n"; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | /** |
| 96 | 96 | * @var int|string |
| 97 | 97 | */ |
| 98 | - public $weight_units; // scale -3, 0, 3, 6 |
|
| 98 | + public $weight_units; // scale -3, 0, 3, 6 |
|
| 99 | 99 | /** |
| 100 | 100 | * @var float|string |
| 101 | 101 | */ |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | /** |
| 104 | 104 | * @var int|string |
| 105 | 105 | */ |
| 106 | - public $length_units; // scale -3, 0, 3, 6 |
|
| 106 | + public $length_units; // scale -3, 0, 3, 6 |
|
| 107 | 107 | /** |
| 108 | 108 | * @var float|string |
| 109 | 109 | */ |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | /** |
| 112 | 112 | * @var int|string |
| 113 | 113 | */ |
| 114 | - public $width_units; // scale -3, 0, 3, 6 |
|
| 114 | + public $width_units; // scale -3, 0, 3, 6 |
|
| 115 | 115 | /** |
| 116 | 116 | * @var float|string|null |
| 117 | 117 | */ |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | /** |
| 120 | 120 | * @var int|string|null |
| 121 | 121 | */ |
| 122 | - public $height_units; // scale -3, 0, 3, 6 |
|
| 122 | + public $height_units; // scale -3, 0, 3, 6 |
|
| 123 | 123 | /** |
| 124 | 124 | * @var float|string|null |
| 125 | 125 | */ |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | /** |
| 128 | 128 | * @var int|string|null |
| 129 | 129 | */ |
| 130 | - public $surface_units; // scale -3, 0, 3, 6 |
|
| 130 | + public $surface_units; // scale -3, 0, 3, 6 |
|
| 131 | 131 | /** |
| 132 | 132 | * @var float|string|null |
| 133 | 133 | */ |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | /** |
| 136 | 136 | * @var int|string|null |
| 137 | 137 | */ |
| 138 | - public $volume_units; // scale -3, 0, 3, 6 |
|
| 138 | + public $volume_units; // scale -3, 0, 3, 6 |
|
| 139 | 139 | /** |
| 140 | 140 | * @var ?array<string,array<string,string>> |
| 141 | 141 | */ |
@@ -328,6 +328,6 @@ discard block |
||
| 328 | 328 | */ |
| 329 | 329 | public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') |
| 330 | 330 | { |
| 331 | - return -1; // NOK because nothing done. |
|
| 331 | + return -1; // NOK because nothing done. |
|
| 332 | 332 | } |
| 333 | 333 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) { |
| 124 | 124 | if (!empty($perm)) { |
| 125 | 125 | $tmp = explode(':', $typeofdata); |
| 126 | - $ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">'; |
|
| 126 | + $ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">'; |
|
| 127 | 127 | if ($fieldrequired) { |
| 128 | 128 | $ret .= '<span class="fieldrequired">'; |
| 129 | 129 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | if ($fieldrequired) { |
| 136 | 136 | $ret .= '</span>'; |
| 137 | 137 | } |
| 138 | - $ret .= '</div>' . "\n"; |
|
| 138 | + $ret .= '</div>'."\n"; |
|
| 139 | 139 | } else { |
| 140 | 140 | if ($fieldrequired) { |
| 141 | 141 | $ret .= '<span class="fieldrequired">'; |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | if (empty($notabletag) && $perm) { |
| 174 | 174 | $ret .= '<td class="right">'; |
| 175 | 175 | } |
| 176 | - if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) { |
|
| 177 | - $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>'; |
|
| 176 | + if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) { |
|
| 177 | + $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>'; |
|
| 178 | 178 | } |
| 179 | 179 | if (!empty($notabletag) && $notabletag == 1) { |
| 180 | 180 | if ($text) { |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | } elseif ($reg[1] == 'int') { |
| 242 | 242 | $typeofdata = 'numeric'; |
| 243 | 243 | } else { |
| 244 | - return 'ErrorBadParameter ' . $typeofdata; |
|
| 244 | + return 'ErrorBadParameter '.$typeofdata; |
|
| 245 | 245 | } |
| 246 | 246 | } |
| 247 | 247 | |
@@ -252,13 +252,13 @@ discard block |
||
| 252 | 252 | if ($editaction == '') { |
| 253 | 253 | $editaction = GETPOST('action', 'aZ09'); |
| 254 | 254 | } |
| 255 | - $editmode = ($editaction == 'edit' . $htmlname); |
|
| 255 | + $editmode = ($editaction == 'edit'.$htmlname); |
|
| 256 | 256 | if ($editmode) { // edit mode |
| 257 | 257 | $ret .= "<!-- formeditfieldval -->\n"; |
| 258 | - $ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">'; |
|
| 259 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 260 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 261 | - $ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">'; |
|
| 258 | + $ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">'; |
|
| 259 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 260 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 261 | + $ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">'; |
|
| 262 | 262 | if (empty($notabletag)) { |
| 263 | 263 | $ret .= '<table class="nobordernopadding centpercent">'; |
| 264 | 264 | } |
@@ -267,28 +267,28 @@ discard block |
||
| 267 | 267 | } |
| 268 | 268 | if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) { |
| 269 | 269 | $tmp = explode(':', $typeofdata); |
| 270 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 270 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 271 | 271 | } elseif (preg_match('/^(integer)/', $typeofdata)) { |
| 272 | 272 | $tmp = explode(':', $typeofdata); |
| 273 | 273 | $valuetoshow = price2num($editvalue ? $editvalue : $value, 0); |
| 274 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 274 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 275 | 275 | } elseif (preg_match('/^(numeric|amount)/', $typeofdata)) { |
| 276 | 276 | $tmp = explode(':', $typeofdata); |
| 277 | 277 | $valuetoshow = price2num($editvalue ? $editvalue : $value); |
| 278 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 278 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 279 | 279 | } elseif (preg_match('/^(checkbox)/', $typeofdata)) { |
| 280 | 280 | $tmp = explode(':', $typeofdata); |
| 281 | - $ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>'; |
|
| 281 | + $ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>'; |
|
| 282 | 282 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { // if wysiwyg is enabled $typeofdata = 'ckeditor' |
| 283 | 283 | $tmp = explode(':', $typeofdata); |
| 284 | 284 | $cols = (empty($tmp[2]) ? '' : $tmp[2]); |
| 285 | 285 | $morealt = ''; |
| 286 | 286 | if (preg_match('/%/', $cols)) { |
| 287 | - $morealt = ' style="width: ' . $cols . '"'; |
|
| 287 | + $morealt = ' style="width: '.$cols.'"'; |
|
| 288 | 288 | $cols = ''; |
| 289 | 289 | } |
| 290 | 290 | $valuetoshow = ($editvalue ? $editvalue : $value); |
| 291 | - $ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>'; |
|
| 291 | + $ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>'; |
|
| 292 | 292 | // textarea convert automatically entities chars into simple chars. |
| 293 | 293 | // 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 wysiwyg is off. |
| 294 | 294 | $valuetoshow = str_replace('&', '&', $valuetoshow); |
@@ -298,12 +298,12 @@ discard block |
||
| 298 | 298 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
| 299 | 299 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
| 300 | 300 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
| 301 | - $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 301 | + $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 302 | 302 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
| 303 | 303 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
| 304 | 304 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
| 305 | 305 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
| 306 | - $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 306 | + $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 307 | 307 | } elseif (preg_match('/^select;/', $typeofdata)) { |
| 308 | 308 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
| 309 | 309 | $arraylist = array(); |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | // TODO Not yet implemented. See code for extrafields |
| 318 | 318 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
| 319 | 319 | $tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser |
| 320 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
| 320 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
| 321 | 321 | $doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? 100 : (int) $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 : (int) $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7])); |
| 322 | 322 | $ret .= $doleditor->Create(1); |
| 323 | 323 | } elseif ($typeofdata == 'asis') { |
@@ -332,19 +332,19 @@ discard block |
||
| 332 | 332 | $ret .= '<td>'; |
| 333 | 333 | } |
| 334 | 334 | //else $ret.='<div class="clearboth"></div>'; |
| 335 | - $ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">'; |
|
| 335 | + $ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">'; |
|
| 336 | 336 | if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) { |
| 337 | - $ret .= '<br>' . "\n"; |
|
| 337 | + $ret .= '<br>'."\n"; |
|
| 338 | 338 | } |
| 339 | - $ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 339 | + $ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 340 | 340 | if (empty($notabletag)) { |
| 341 | 341 | $ret .= '</td>'; |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | if (empty($notabletag)) { |
| 345 | - $ret .= '</tr></table>' . "\n"; |
|
| 345 | + $ret .= '</tr></table>'."\n"; |
|
| 346 | 346 | } |
| 347 | - $ret .= '</form>' . "\n"; |
|
| 347 | + $ret .= '</form>'."\n"; |
|
| 348 | 348 | } else { // view mode |
| 349 | 349 | if (preg_match('/^email/', $typeofdata)) { |
| 350 | 350 | $ret .= dol_print_email($value, 0, 0, 0, 0, 1); |
@@ -356,15 +356,15 @@ discard block |
||
| 356 | 356 | $ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : ''); |
| 357 | 357 | } elseif (preg_match('/^checkbox/', $typeofdata)) { |
| 358 | 358 | $tmp = explode(':', $typeofdata); |
| 359 | - $ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>'; |
|
| 359 | + $ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>'; |
|
| 360 | 360 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { |
| 361 | 361 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1)); |
| 362 | 362 | } elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) { // 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring' |
| 363 | 363 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value)); |
| 364 | 364 | } elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') { |
| 365 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>'; |
|
| 365 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>'; |
|
| 366 | 366 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
| 367 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>'; |
|
| 367 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>'; |
|
| 368 | 368 | } elseif (preg_match('/^select;/', $typeofdata)) { |
| 369 | 369 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
| 370 | 370 | $arraylist = array(); |
@@ -375,9 +375,9 @@ discard block |
||
| 375 | 375 | $ret .= $arraylist[$value]; |
| 376 | 376 | if ($htmlname == 'fk_product_type') { |
| 377 | 377 | if ($value == 0) { |
| 378 | - $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
| 378 | + $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
| 379 | 379 | } else { |
| 380 | - $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
| 380 | + $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) { |
| 386 | 386 | $firstline = preg_replace('/<br>.*/', '', $tmpcontent); |
| 387 | 387 | $firstline = preg_replace('/[\n\r].*/', '', $firstline); |
| 388 | - $tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
| 388 | + $tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
| 389 | 389 | } |
| 390 | 390 | // We don't use dol_escape_htmltag to get the html formatting active, but this need we must also |
| 391 | 391 | // clean data from some dangerous html |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | if (empty($moreoptions['valuealreadyhtmlescaped'])) { |
| 395 | 395 | $ret .= dol_escape_htmltag($value); |
| 396 | 396 | } else { |
| 397 | - $ret .= $value; // $value must be already html escaped. |
|
| 397 | + $ret .= $value; // $value must be already html escaped. |
|
| 398 | 398 | } |
| 399 | 399 | } |
| 400 | 400 | |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | |
| 433 | 433 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
| 434 | 434 | if (!is_object($extralanguages)) { |
| 435 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
| 435 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
| 436 | 436 | $extralanguages = new ExtraLanguages($this->db); |
| 437 | 437 | } |
| 438 | 438 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -441,17 +441,17 @@ discard block |
||
| 441 | 441 | return ''; // No extralang field to show |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | - $result .= '<!-- Widget for translation -->' . "\n"; |
|
| 445 | - $result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">'; |
|
| 444 | + $result .= '<!-- Widget for translation -->'."\n"; |
|
| 445 | + $result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">'; |
|
| 446 | 446 | $s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', 0, 0, 0, '', 'fa-15 editfieldlang'); |
| 447 | 447 | $result .= $s; |
| 448 | 448 | $result .= '</div>'; |
| 449 | 449 | |
| 450 | - $result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">'; |
|
| 450 | + $result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">'; |
|
| 451 | 451 | |
| 452 | 452 | $resultforextrlang = ''; |
| 453 | 453 | foreach ($arrayoflangcode as $langcode) { |
| 454 | - $valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : ''; |
|
| 454 | + $valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : ''; |
|
| 455 | 455 | if (empty($valuetoshow)) { |
| 456 | 456 | $object->fetchValuesForExtraLanguages(); |
| 457 | 457 | //var_dump($object->array_languages); |
@@ -463,17 +463,17 @@ discard block |
||
| 463 | 463 | |
| 464 | 464 | // TODO Use the showInputField() method of ExtraLanguages object |
| 465 | 465 | if ($typeofdata == 'textarea') { |
| 466 | - $resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">'; |
|
| 466 | + $resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">'; |
|
| 467 | 467 | $resultforextrlang .= $valuetoshow; |
| 468 | 468 | $resultforextrlang .= '</textarea>'; |
| 469 | 469 | } else { |
| 470 | - $resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">'; |
|
| 470 | + $resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">'; |
|
| 471 | 471 | } |
| 472 | 472 | } |
| 473 | 473 | $result .= $resultforextrlang; |
| 474 | 474 | |
| 475 | 475 | $result .= '</div>'; |
| 476 | - $result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>'; |
|
| 476 | + $result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>'; |
|
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | return $result; |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | if (!empty($tmp[2])) { |
| 537 | 537 | $savemethod = $tmp[2]; |
| 538 | 538 | } |
| 539 | - $out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n"; |
|
| 539 | + $out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n"; |
|
| 540 | 540 | } elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) { |
| 541 | 541 | $tmp = explode(':', $inputType); |
| 542 | 542 | $inputType = $tmp[0]; |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | $savemethod = $tmp[2]; |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | - $out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format |
|
| 550 | + $out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format |
|
| 551 | 551 | } elseif (preg_match('/^(select|autocomplete)/', $inputType)) { |
| 552 | 552 | $tmp = explode(':', $inputType); |
| 553 | 553 | $inputType = $tmp[0]; |
@@ -578,40 +578,40 @@ discard block |
||
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | if (isModEnabled('fckeditor')) { |
| 581 | - $out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n"; |
|
| 581 | + $out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n"; |
|
| 582 | 582 | } else { |
| 583 | 583 | $inputType = 'textarea'; |
| 584 | 584 | } |
| 585 | 585 | } |
| 586 | 586 | |
| 587 | - $out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n"; |
|
| 588 | - $out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n"; |
|
| 589 | - $out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n"; |
|
| 590 | - $out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n"; |
|
| 587 | + $out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n"; |
|
| 588 | + $out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n"; |
|
| 589 | + $out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n"; |
|
| 590 | + $out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n"; |
|
| 591 | 591 | if (!empty($savemethod)) { |
| 592 | - $out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n"; |
|
| 592 | + $out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n"; |
|
| 593 | 593 | } |
| 594 | 594 | if (!empty($ext_element)) { |
| 595 | - $out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n"; |
|
| 595 | + $out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n"; |
|
| 596 | 596 | } |
| 597 | 597 | if (!empty($custommsg)) { |
| 598 | 598 | if (is_array($custommsg)) { |
| 599 | 599 | if (!empty($custommsg['success'])) { |
| 600 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n"; |
|
| 600 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n"; |
|
| 601 | 601 | } |
| 602 | 602 | if (!empty($custommsg['error'])) { |
| 603 | - $out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n"; |
|
| 603 | + $out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n"; |
|
| 604 | 604 | } |
| 605 | 605 | } else { |
| 606 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n"; |
|
| 606 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n"; |
|
| 607 | 607 | } |
| 608 | 608 | } |
| 609 | 609 | if ($inputType == 'textarea') { |
| 610 | - $out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n"; |
|
| 611 | - $out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n"; |
|
| 610 | + $out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n"; |
|
| 611 | + $out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n"; |
|
| 612 | 612 | } |
| 613 | - $out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n"; |
|
| 614 | - $out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n"; |
|
| 613 | + $out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n"; |
|
| 614 | + $out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n"; |
|
| 615 | 615 | } else { |
| 616 | 616 | $out = $value; |
| 617 | 617 | } |
@@ -640,12 +640,12 @@ discard block |
||
| 640 | 640 | public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) |
| 641 | 641 | { |
| 642 | 642 | if ($incbefore) { |
| 643 | - $text = $incbefore . $text; |
|
| 643 | + $text = $incbefore.$text; |
|
| 644 | 644 | } |
| 645 | 645 | if (!$htmltext) { |
| 646 | 646 | return $text; |
| 647 | 647 | } |
| 648 | - $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
| 648 | + $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
| 649 | 649 | |
| 650 | 650 | $tag = 'td'; |
| 651 | 651 | if ($notabs == 2) { |
@@ -659,11 +659,11 @@ discard block |
||
| 659 | 659 | |
| 660 | 660 | $extrastyle = ''; |
| 661 | 661 | if ($direction < 0) { |
| 662 | - $extracss = ($extracss ? $extracss : '') . ($notabs != 3 ? ' inline-block' : ''); |
|
| 662 | + $extracss = ($extracss ? $extracss : '').($notabs != 3 ? ' inline-block' : ''); |
|
| 663 | 663 | $extrastyle = 'padding: 0px; padding-left: 2px;'; |
| 664 | 664 | } |
| 665 | 665 | if ($direction > 0) { |
| 666 | - $extracss = ($extracss ? $extracss : '') . ($notabs != 3 ? ' inline-block' : ''); |
|
| 666 | + $extracss = ($extracss ? $extracss : '').($notabs != 3 ? ' inline-block' : ''); |
|
| 667 | 667 | $extrastyle = 'padding: 0px; padding-right: 2px;'; |
| 668 | 668 | } |
| 669 | 669 | |
@@ -676,53 +676,53 @@ discard block |
||
| 676 | 676 | $htmltext = str_replace('"', '"', $htmltext); |
| 677 | 677 | } else { |
| 678 | 678 | $classfortooltip = 'classfortooltiponclick'; |
| 679 | - $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>'; |
|
| 679 | + $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>'; |
|
| 680 | 680 | } |
| 681 | 681 | if ($tooltipon == 2 || $tooltipon == 3) { |
| 682 | - $paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"'; |
|
| 682 | + $paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"'; |
|
| 683 | 683 | if ($tooltiptrigger == '') { |
| 684 | - $paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip |
|
| 684 | + $paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip |
|
| 685 | 685 | } else { |
| 686 | - $paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"'; |
|
| 686 | + $paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"'; |
|
| 687 | 687 | } |
| 688 | 688 | } else { |
| 689 | - $paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag |
|
| 689 | + $paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag |
|
| 690 | 690 | } |
| 691 | 691 | if ($tooltipon == 1 || $tooltipon == 3) { |
| 692 | - $paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" '; |
|
| 692 | + $paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" '; |
|
| 693 | 693 | if ($tooltiptrigger == '') { |
| 694 | - $paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip |
|
| 694 | + $paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip |
|
| 695 | 695 | } else { |
| 696 | - $paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"'; |
|
| 696 | + $paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"'; |
|
| 697 | 697 | } |
| 698 | 698 | } else { |
| 699 | - $paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag |
|
| 699 | + $paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag |
|
| 700 | 700 | } |
| 701 | 701 | if (empty($notabs)) { |
| 702 | 702 | $s .= '<table class="nobordernopadding"><tr style="height: auto;">'; |
| 703 | 703 | } elseif ($notabs == 2) { |
| 704 | - $s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">'; |
|
| 704 | + $s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">'; |
|
| 705 | 705 | } |
| 706 | 706 | // Define value if value is before |
| 707 | 707 | if ($direction < 0) { |
| 708 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
| 708 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
| 709 | 709 | if ($tag == 'td') { |
| 710 | 710 | $s .= ' class="valigntop" width="14"'; |
| 711 | 711 | } |
| 712 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
| 712 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
| 713 | 713 | } |
| 714 | 714 | // Use another method to help avoid having a space in value in order to use this value with jquery |
| 715 | 715 | // Define label |
| 716 | 716 | if ((string) $text != '') { |
| 717 | - $s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>'; |
|
| 717 | + $s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>'; |
|
| 718 | 718 | } |
| 719 | 719 | // Define value if value is after |
| 720 | 720 | if ($direction > 0) { |
| 721 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
| 721 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
| 722 | 722 | if ($tag == 'td') { |
| 723 | 723 | $s .= ' class="valignmiddle" width="14"'; |
| 724 | 724 | } |
| 725 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
| 725 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
| 726 | 726 | } |
| 727 | 727 | if (empty($notabs)) { |
| 728 | 728 | $s .= '</tr></table>'; |
@@ -829,7 +829,7 @@ discard block |
||
| 829 | 829 | |
| 830 | 830 | $disabled = 0; |
| 831 | 831 | $ret = '<div class="centpercent center">'; |
| 832 | - $ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>'; |
|
| 832 | + $ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>'; |
|
| 833 | 833 | |
| 834 | 834 | // 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. |
| 835 | 835 | $parameters = array(); |
@@ -840,10 +840,10 @@ discard block |
||
| 840 | 840 | return; |
| 841 | 841 | } |
| 842 | 842 | if (empty($reshook)) { |
| 843 | - $ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>'; |
|
| 843 | + $ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>'; |
|
| 844 | 844 | if (is_array($arrayofaction)) { |
| 845 | 845 | foreach ($arrayofaction as $code => $label) { |
| 846 | - $ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>'; |
|
| 846 | + $ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>'; |
|
| 847 | 847 | } |
| 848 | 848 | } |
| 849 | 849 | } |
@@ -852,17 +852,17 @@ discard block |
||
| 852 | 852 | $ret .= '</select>'; |
| 853 | 853 | |
| 854 | 854 | if (empty($conf->dol_optimize_smallscreen)) { |
| 855 | - $ret .= ajax_combobox('.' . $name . 'select'); |
|
| 855 | + $ret .= ajax_combobox('.'.$name.'select'); |
|
| 856 | 856 | } |
| 857 | 857 | |
| 858 | 858 | // 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 |
| 859 | 859 | $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. |
| 860 | - $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")) . '">'; |
|
| 860 | + $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")).'">'; |
|
| 861 | 861 | $ret .= '</div>'; |
| 862 | 862 | |
| 863 | 863 | if (!empty($conf->use_javascript_ajax)) { |
| 864 | 864 | $ret .= '<!-- JS CODE TO ENABLE mass action select --> |
| 865 | - <script nonce="' . getNonce() . '"> |
|
| 865 | + <script nonce="' . getNonce().'"> |
|
| 866 | 866 | 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 */ |
| 867 | 867 | { |
| 868 | 868 | atleastoneselected=0; |
@@ -873,11 +873,11 @@ discard block |
||
| 873 | 873 | |
| 874 | 874 | console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected); |
| 875 | 875 | |
| 876 | - if (atleastoneselected || ' . $alwaysvisible . ') |
|
| 876 | + if (atleastoneselected || ' . $alwaysvisible.') |
|
| 877 | 877 | { |
| 878 | 878 | jQuery("."+name).show(); |
| 879 | - ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . ' |
|
| 880 | - ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . ' |
|
| 879 | + ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').' |
|
| 880 | + ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').' |
|
| 881 | 881 | } |
| 882 | 882 | else |
| 883 | 883 | { |
@@ -887,26 +887,26 @@ discard block |
||
| 887 | 887 | } |
| 888 | 888 | |
| 889 | 889 | jQuery(document).ready(function () { |
| 890 | - initCheckForSelect(0, "' . $name . '", "' . $cssclass . '"); |
|
| 891 | - jQuery(".' . $cssclass . '").click(function() { |
|
| 892 | - initCheckForSelect(1, "' . $name . '", "' . $cssclass . '"); |
|
| 890 | + initCheckForSelect(0, "' . $name.'", "'.$cssclass.'"); |
|
| 891 | + jQuery(".' . $cssclass.'").click(function() { |
|
| 892 | + initCheckForSelect(1, "' . $name.'", "'.$cssclass.'"); |
|
| 893 | 893 | }); |
| 894 | - jQuery(".' . $name . 'select").change(function() { |
|
| 894 | + jQuery(".' . $name.'select").change(function() { |
|
| 895 | 895 | var massaction = $( this ).val(); |
| 896 | 896 | var urlform = $( this ).closest("form").attr("action").replace("#show_files",""); |
| 897 | 897 | if (massaction == "builddoc") { |
| 898 | 898 | urlform = urlform + "#show_files"; |
| 899 | 899 | } |
| 900 | 900 | $( this ).closest("form").attr("action", urlform); |
| 901 | - console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform); |
|
| 901 | + console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform); |
|
| 902 | 902 | /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */ |
| 903 | 903 | if ($(this).val() != \'0\') { |
| 904 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', false); |
|
| 905 | - jQuery(".' . $name . 'other").hide(); /* To disable if another div was open */ |
|
| 906 | - jQuery(".' . $name . '"+massaction).show(); |
|
| 904 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', false); |
|
| 905 | + jQuery(".' . $name.'other").hide(); /* To disable if another div was open */ |
|
| 906 | + jQuery(".' . $name.'"+massaction).show(); |
|
| 907 | 907 | } else { |
| 908 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', true); |
|
| 909 | - jQuery(".' . $name . 'other").hide(); /* To disable any div open */ |
|
| 908 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', true); |
|
| 909 | + jQuery(".' . $name.'other").hide(); /* To disable any div open */ |
|
| 910 | 910 | } |
| 911 | 911 | }); |
| 912 | 912 | }); |
@@ -949,14 +949,14 @@ discard block |
||
| 949 | 949 | $atleastonefavorite = 0; |
| 950 | 950 | |
| 951 | 951 | $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec"; |
| 952 | - $sql .= " FROM " . $this->db->prefix() . "c_country"; |
|
| 952 | + $sql .= " FROM ".$this->db->prefix()."c_country"; |
|
| 953 | 953 | $sql .= " WHERE active > 0"; |
| 954 | 954 | //$sql.= " ORDER BY code ASC"; |
| 955 | 955 | |
| 956 | - dol_syslog(get_class($this) . "::select_country", LOG_DEBUG); |
|
| 956 | + dol_syslog(get_class($this)."::select_country", LOG_DEBUG); |
|
| 957 | 957 | $resql = $this->db->query($sql); |
| 958 | 958 | if ($resql) { |
| 959 | - $out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
| 959 | + $out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>'; |
|
| 960 | 960 | $num = $this->db->num_rows($resql); |
| 961 | 961 | $i = 0; |
| 962 | 962 | if ($num) { |
@@ -966,7 +966,7 @@ discard block |
||
| 966 | 966 | $countryArray[$i]['rowid'] = $obj->rowid; |
| 967 | 967 | $countryArray[$i]['code_iso'] = $obj->code_iso; |
| 968 | 968 | $countryArray[$i]['code_iso3'] = $obj->code_iso3; |
| 969 | - $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 : '')); |
|
| 969 | + $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 : '')); |
|
| 970 | 970 | $countryArray[$i]['favorite'] = $obj->favorite; |
| 971 | 971 | $countryArray[$i]['eec'] = $obj->eec; |
| 972 | 972 | $favorite[$i] = $obj->favorite; |
@@ -984,20 +984,20 @@ discard block |
||
| 984 | 984 | |
| 985 | 985 | if ($showempty) { |
| 986 | 986 | if (is_numeric($showempty)) { |
| 987 | - $out .= '<option value=""> </option>' . "\n"; |
|
| 987 | + $out .= '<option value=""> </option>'."\n"; |
|
| 988 | 988 | } else { |
| 989 | - $out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n"; |
|
| 989 | + $out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n"; |
|
| 990 | 990 | } |
| 991 | 991 | } |
| 992 | 992 | |
| 993 | 993 | if ($addspecialentries) { // Add dedicated entries for groups of countries |
| 994 | 994 | //if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>'; |
| 995 | - $out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
| 996 | - $out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>'; |
|
| 995 | + $out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
| 996 | + $out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>'; |
|
| 997 | 997 | if ($mysoc->isInEEC()) { |
| 998 | - $out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
| 998 | + $out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
| 999 | 999 | } |
| 1000 | - $out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>'; |
|
| 1000 | + $out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>'; |
|
| 1001 | 1001 | $out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>'; |
| 1002 | 1002 | } |
| 1003 | 1003 | |
@@ -1025,20 +1025,20 @@ discard block |
||
| 1025 | 1025 | $labeltoshow .= ' '; |
| 1026 | 1026 | } |
| 1027 | 1027 | if ($row['code_iso']) { |
| 1028 | - $labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>'; |
|
| 1028 | + $labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>'; |
|
| 1029 | 1029 | if (empty($hideflags)) { |
| 1030 | 1030 | $tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1); |
| 1031 | - $labeltoshow = $tmpflag . ' ' . $labeltoshow; |
|
| 1031 | + $labeltoshow = $tmpflag.' '.$labeltoshow; |
|
| 1032 | 1032 | } |
| 1033 | 1033 | } |
| 1034 | 1034 | |
| 1035 | 1035 | if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) { |
| 1036 | - $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']) . '">'; |
|
| 1036 | + $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']).'">'; |
|
| 1037 | 1037 | } else { |
| 1038 | - $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']) . '">'; |
|
| 1038 | + $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']).'">'; |
|
| 1039 | 1039 | } |
| 1040 | 1040 | $out .= $labeltoshow; |
| 1041 | - $out .= '</option>' . "\n"; |
|
| 1041 | + $out .= '</option>'."\n"; |
|
| 1042 | 1042 | } |
| 1043 | 1043 | } |
| 1044 | 1044 | $out .= '</select>'; |
@@ -1047,8 +1047,8 @@ discard block |
||
| 1047 | 1047 | } |
| 1048 | 1048 | |
| 1049 | 1049 | // Make select dynamic |
| 1050 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1051 | - $out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve'); |
|
| 1050 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1051 | + $out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve'); |
|
| 1052 | 1052 | |
| 1053 | 1053 | return $out; |
| 1054 | 1054 | } |
@@ -1080,25 +1080,25 @@ discard block |
||
| 1080 | 1080 | $incotermArray = array(); |
| 1081 | 1081 | |
| 1082 | 1082 | $sql = "SELECT rowid, code"; |
| 1083 | - $sql .= " FROM " . $this->db->prefix() . "c_incoterms"; |
|
| 1083 | + $sql .= " FROM ".$this->db->prefix()."c_incoterms"; |
|
| 1084 | 1084 | $sql .= " WHERE active > 0"; |
| 1085 | 1085 | $sql .= " ORDER BY code ASC"; |
| 1086 | 1086 | |
| 1087 | - dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG); |
|
| 1087 | + dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG); |
|
| 1088 | 1088 | $resql = $this->db->query($sql); |
| 1089 | 1089 | if ($resql) { |
| 1090 | 1090 | if ($conf->use_javascript_ajax && !$forcecombo) { |
| 1091 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1091 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1092 | 1092 | $out .= ajax_combobox($htmlname, $events); |
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | 1095 | if (!empty($page)) { |
| 1096 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 1096 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 1097 | 1097 | $out .= '<input type="hidden" name="action" value="set_incoterms">'; |
| 1098 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1098 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1099 | 1099 | } |
| 1100 | 1100 | |
| 1101 | - $out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
| 1101 | + $out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>'; |
|
| 1102 | 1102 | $out .= '<option value="0"> </option>'; |
| 1103 | 1103 | $num = $this->db->num_rows($resql); |
| 1104 | 1104 | $i = 0; |
@@ -1112,9 +1112,9 @@ discard block |
||
| 1112 | 1112 | |
| 1113 | 1113 | foreach ($incotermArray as $row) { |
| 1114 | 1114 | if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) { |
| 1115 | - $out .= '<option value="' . $row['rowid'] . '" selected>'; |
|
| 1115 | + $out .= '<option value="'.$row['rowid'].'" selected>'; |
|
| 1116 | 1116 | } else { |
| 1117 | - $out .= '<option value="' . $row['rowid'] . '">'; |
|
| 1117 | + $out .= '<option value="'.$row['rowid'].'">'; |
|
| 1118 | 1118 | } |
| 1119 | 1119 | |
| 1120 | 1120 | if ($row['code']) { |
@@ -1128,13 +1128,13 @@ discard block |
||
| 1128 | 1128 | $out .= ajax_combobox($htmlname); |
| 1129 | 1129 | |
| 1130 | 1130 | if ($conf->use_javascript_ajax && empty($disableautocomplete)) { |
| 1131 | - $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n"; |
|
| 1131 | + $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n"; |
|
| 1132 | 1132 | $moreattrib .= ' autocomplete="off"'; |
| 1133 | 1133 | } |
| 1134 | - $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n"; |
|
| 1134 | + $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n"; |
|
| 1135 | 1135 | |
| 1136 | 1136 | if (!empty($page)) { |
| 1137 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>'; |
|
| 1137 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>'; |
|
| 1138 | 1138 | } |
| 1139 | 1139 | } else { |
| 1140 | 1140 | dol_print_error($this->db); |
@@ -1166,9 +1166,9 @@ discard block |
||
| 1166 | 1166 | if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service")) |
| 1167 | 1167 | || (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) { |
| 1168 | 1168 | if (empty($hidetext)) { |
| 1169 | - print $langs->trans("Type") . ': '; |
|
| 1169 | + print $langs->trans("Type").': '; |
|
| 1170 | 1170 | } |
| 1171 | - print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 1171 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 1172 | 1172 | if ($showempty) { |
| 1173 | 1173 | print '<option value="-1"'; |
| 1174 | 1174 | if ($selected == -1) { |
@@ -1187,28 +1187,28 @@ discard block |
||
| 1187 | 1187 | if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) { |
| 1188 | 1188 | print ' selected'; |
| 1189 | 1189 | } |
| 1190 | - print '>' . $langs->trans("Product"); |
|
| 1190 | + print '>'.$langs->trans("Product"); |
|
| 1191 | 1191 | |
| 1192 | 1192 | print '<option value="1"'; |
| 1193 | 1193 | if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) { |
| 1194 | 1194 | print ' selected'; |
| 1195 | 1195 | } |
| 1196 | - print '>' . $langs->trans("Service"); |
|
| 1196 | + print '>'.$langs->trans("Service"); |
|
| 1197 | 1197 | |
| 1198 | 1198 | print '</select>'; |
| 1199 | - print ajax_combobox('select_' . $htmlname); |
|
| 1199 | + print ajax_combobox('select_'.$htmlname); |
|
| 1200 | 1200 | //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); |
| 1201 | 1201 | } |
| 1202 | 1202 | if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) { |
| 1203 | 1203 | print $langs->trans("Service"); |
| 1204 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; |
|
| 1204 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; |
|
| 1205 | 1205 | } |
| 1206 | 1206 | if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) { |
| 1207 | 1207 | print $langs->trans("Product"); |
| 1208 | - print '<input type="hidden" name="' . $htmlname . '" value="0">'; |
|
| 1208 | + print '<input type="hidden" name="'.$htmlname.'" value="0">'; |
|
| 1209 | 1209 | } |
| 1210 | 1210 | if ($forceall < 0) { // This should happened only for contracts when both predefined product and service are disabled. |
| 1211 | - 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 |
|
| 1211 | + 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 |
|
| 1212 | 1212 | } |
| 1213 | 1213 | } |
| 1214 | 1214 | |
@@ -1234,7 +1234,7 @@ discard block |
||
| 1234 | 1234 | $langs->load("trips"); |
| 1235 | 1235 | |
| 1236 | 1236 | $sql = "SELECT c.code, c.label"; |
| 1237 | - $sql .= " FROM " . $this->db->prefix() . "c_type_fees as c"; |
|
| 1237 | + $sql .= " FROM ".$this->db->prefix()."c_type_fees as c"; |
|
| 1238 | 1238 | $sql .= " WHERE active > 0"; |
| 1239 | 1239 | |
| 1240 | 1240 | $resql = $this->db->query($sql); |
@@ -1275,11 +1275,11 @@ discard block |
||
| 1275 | 1275 | // phpcs:enable |
| 1276 | 1276 | global $user, $langs; |
| 1277 | 1277 | |
| 1278 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 1278 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 1279 | 1279 | |
| 1280 | 1280 | $this->load_cache_types_fees(); |
| 1281 | 1281 | |
| 1282 | - print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">'; |
|
| 1282 | + print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">'; |
|
| 1283 | 1283 | if ($showempty) { |
| 1284 | 1284 | print '<option value="-1"'; |
| 1285 | 1285 | if ($selected == -1) { |
@@ -1289,7 +1289,7 @@ discard block |
||
| 1289 | 1289 | } |
| 1290 | 1290 | |
| 1291 | 1291 | foreach ($this->cache_types_fees as $key => $value) { |
| 1292 | - print '<option value="' . $key . '"'; |
|
| 1292 | + print '<option value="'.$key.'"'; |
|
| 1293 | 1293 | if ($key == $selected) { |
| 1294 | 1294 | print ' selected'; |
| 1295 | 1295 | } |
@@ -1341,12 +1341,12 @@ discard block |
||
| 1341 | 1341 | $ajaxoptions = array(); |
| 1342 | 1342 | } |
| 1343 | 1343 | |
| 1344 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1344 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1345 | 1345 | |
| 1346 | 1346 | // No immediate load of all database |
| 1347 | 1347 | $placeholder = ''; |
| 1348 | 1348 | if ($selected && empty($selected_input_value)) { |
| 1349 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 1349 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 1350 | 1350 | $societetmp = new Societe($this->db); |
| 1351 | 1351 | $societetmp->fetch($selected); |
| 1352 | 1352 | $selected_input_value = $societetmp->name; |
@@ -1354,11 +1354,11 @@ discard block |
||
| 1354 | 1354 | } |
| 1355 | 1355 | |
| 1356 | 1356 | // mode 1 |
| 1357 | - $urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($excludeids) ? '' : '&excludeids=' . implode(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode((string) ($showtype)) : '') . ($showcode ? '&showcode=' . urlencode((string) ($showcode)) : ''); |
|
| 1357 | + $urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($excludeids) ? '' : '&excludeids='.implode(',', $excludeids)).($showtype ? '&showtype='.urlencode((string) ($showtype)) : '').($showcode ? '&showcode='.urlencode((string) ($showcode)) : ''); |
|
| 1358 | 1358 | |
| 1359 | 1359 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 1360 | 1360 | if (empty($hidelabel)) { |
| 1361 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 1361 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 1362 | 1362 | } elseif ($hidelabel == 1 && !is_numeric($showempty)) { |
| 1363 | 1363 | $placeholder = $showempty; |
| 1364 | 1364 | } elseif ($hidelabel > 1) { |
@@ -1367,7 +1367,7 @@ discard block |
||
| 1367 | 1367 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 1368 | 1368 | } |
| 1369 | 1369 | } |
| 1370 | - $out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 1370 | + $out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 1371 | 1371 | if ($hidelabel == 3) { |
| 1372 | 1372 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 1373 | 1373 | } |
@@ -1429,12 +1429,12 @@ discard block |
||
| 1429 | 1429 | $events = array(); |
| 1430 | 1430 | } |
| 1431 | 1431 | |
| 1432 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1432 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1433 | 1433 | |
| 1434 | 1434 | // No immediate load of all database |
| 1435 | 1435 | $placeholder = ''; |
| 1436 | 1436 | if ($selected && empty($selected_input_value)) { |
| 1437 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 1437 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 1438 | 1438 | $contacttmp = new Contact($this->db); |
| 1439 | 1439 | $contacttmp->fetch($selected); |
| 1440 | 1440 | $selected_input_value = $contacttmp->getFullName($langs); |
@@ -1445,11 +1445,11 @@ discard block |
||
| 1445 | 1445 | } |
| 1446 | 1446 | |
| 1447 | 1447 | // mode 1 |
| 1448 | - $urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($exclude) ? '' : '&exclude=' . urlencode($exclude)) . ($showsoc ? '&showsoc=' . urlencode((string) ($showsoc)) : ''); |
|
| 1448 | + $urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($exclude) ? '' : '&exclude='.urlencode($exclude)).($showsoc ? '&showsoc='.urlencode((string) ($showsoc)) : ''); |
|
| 1449 | 1449 | |
| 1450 | 1450 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 1451 | 1451 | |
| 1452 | - $out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('CONTACT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 1452 | + $out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('CONTACT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 1453 | 1453 | |
| 1454 | 1454 | $out .= ajax_event($htmlname, $events); |
| 1455 | 1455 | |
@@ -1546,30 +1546,30 @@ discard block |
||
| 1546 | 1546 | $sql .= ", s.address, s.zip, s.town"; |
| 1547 | 1547 | $sql .= ", dictp.code as country_code"; |
| 1548 | 1548 | } |
| 1549 | - $sql .= " FROM " . $this->db->prefix() . "societe as s"; |
|
| 1549 | + $sql .= " FROM ".$this->db->prefix()."societe as s"; |
|
| 1550 | 1550 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
| 1551 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 1551 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 1552 | 1552 | } |
| 1553 | 1553 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 1554 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
| 1554 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
| 1555 | 1555 | } |
| 1556 | - $sql .= " WHERE s.entity IN (" . getEntity('societe') . ")"; |
|
| 1556 | + $sql .= " WHERE s.entity IN (".getEntity('societe').")"; |
|
| 1557 | 1557 | if (!empty($user->socid)) { |
| 1558 | - $sql .= " AND s.rowid = " . ((int) $user->socid); |
|
| 1558 | + $sql .= " AND s.rowid = ".((int) $user->socid); |
|
| 1559 | 1559 | } |
| 1560 | 1560 | if ($filter) { |
| 1561 | 1561 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
| 1562 | 1562 | // if not, by testSqlAndScriptInject() only. |
| 1563 | - $sql .= " AND (" . $filter . ")"; |
|
| 1563 | + $sql .= " AND (".$filter.")"; |
|
| 1564 | 1564 | } |
| 1565 | 1565 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 1566 | - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
| 1566 | + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
| 1567 | 1567 | } |
| 1568 | 1568 | if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) { |
| 1569 | 1569 | $sql .= " AND s.status <> 0"; |
| 1570 | 1570 | } |
| 1571 | 1571 | if (!empty($excludeids)) { |
| 1572 | - $sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")"; |
|
| 1572 | + $sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")"; |
|
| 1573 | 1573 | } |
| 1574 | 1574 | // Add where from hooks |
| 1575 | 1575 | $parameters = array(); |
@@ -1589,17 +1589,17 @@ discard block |
||
| 1589 | 1589 | if ($i > 0) { |
| 1590 | 1590 | $sql .= " AND "; |
| 1591 | 1591 | } |
| 1592 | - $sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
| 1592 | + $sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
| 1593 | 1593 | $i++; |
| 1594 | 1594 | } |
| 1595 | 1595 | if (count($search_crit) > 1) { |
| 1596 | 1596 | $sql .= ")"; |
| 1597 | 1597 | } |
| 1598 | 1598 | if (isModEnabled('barcode')) { |
| 1599 | - $sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1599 | + $sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1600 | 1600 | } |
| 1601 | - $sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1602 | - $sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1601 | + $sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1602 | + $sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1603 | 1603 | $sql .= ")"; |
| 1604 | 1604 | } |
| 1605 | 1605 | $sql .= $this->db->order("nom", "ASC"); |
@@ -1610,7 +1610,7 @@ discard block |
||
| 1610 | 1610 | $resql = $this->db->query($sql); |
| 1611 | 1611 | if ($resql) { |
| 1612 | 1612 | // Construct $out and $outarray |
| 1613 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n"; |
|
| 1613 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n"; |
|
| 1614 | 1614 | |
| 1615 | 1615 | $textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : ''); |
| 1616 | 1616 | if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) { |
@@ -1623,7 +1623,7 @@ discard block |
||
| 1623 | 1623 | } |
| 1624 | 1624 | } |
| 1625 | 1625 | if ($showempty) { |
| 1626 | - $out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : ' ') . '</span>') . '">' . $textifempty . '</option>' . "\n"; |
|
| 1626 | + $out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : ' ').'</span>').'">'.$textifempty.'</option>'."\n"; |
|
| 1627 | 1627 | } |
| 1628 | 1628 | |
| 1629 | 1629 | $companytemp = new Societe($this->db); |
@@ -1636,18 +1636,18 @@ discard block |
||
| 1636 | 1636 | $label = ''; |
| 1637 | 1637 | if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) { |
| 1638 | 1638 | if (($obj->client) && (!empty($obj->code_client))) { |
| 1639 | - $label = $obj->code_client . ' - '; |
|
| 1639 | + $label = $obj->code_client.' - '; |
|
| 1640 | 1640 | } |
| 1641 | 1641 | if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) { |
| 1642 | - $label .= $obj->code_fournisseur . ' - '; |
|
| 1642 | + $label .= $obj->code_fournisseur.' - '; |
|
| 1643 | 1643 | } |
| 1644 | - $label .= ' ' . $obj->name; |
|
| 1644 | + $label .= ' '.$obj->name; |
|
| 1645 | 1645 | } else { |
| 1646 | 1646 | $label = $obj->name; |
| 1647 | 1647 | } |
| 1648 | 1648 | |
| 1649 | 1649 | if (!empty($obj->name_alias)) { |
| 1650 | - $label .= ' (' . $obj->name_alias . ')'; |
|
| 1650 | + $label .= ' ('.$obj->name_alias.')'; |
|
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | 1653 | if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) { |
@@ -1662,7 +1662,7 @@ discard block |
||
| 1662 | 1662 | $companytemp->fournisseur = $obj->fournisseur; |
| 1663 | 1663 | $tmptype = $companytemp->getTypeUrl(1, '', 0, 'span'); |
| 1664 | 1664 | if ($tmptype) { |
| 1665 | - $labelhtml .= ' ' . $tmptype; |
|
| 1665 | + $labelhtml .= ' '.$tmptype; |
|
| 1666 | 1666 | } |
| 1667 | 1667 | |
| 1668 | 1668 | if ($obj->client || $obj->fournisseur) { |
@@ -1672,10 +1672,10 @@ discard block |
||
| 1672 | 1672 | $label .= $langs->trans("Customer"); |
| 1673 | 1673 | } |
| 1674 | 1674 | if ($obj->client == 2 || $obj->client == 3) { |
| 1675 | - $label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect"); |
|
| 1675 | + $label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect"); |
|
| 1676 | 1676 | } |
| 1677 | 1677 | if ($obj->fournisseur) { |
| 1678 | - $label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier"); |
|
| 1678 | + $label .= ($obj->client ? ', ' : '').$langs->trans("Supplier"); |
|
| 1679 | 1679 | } |
| 1680 | 1680 | if ($obj->client || $obj->fournisseur) { |
| 1681 | 1681 | $label .= ')'; |
@@ -1683,9 +1683,9 @@ discard block |
||
| 1683 | 1683 | } |
| 1684 | 1684 | |
| 1685 | 1685 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
| 1686 | - $s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : ''); |
|
| 1686 | + $s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : ''); |
|
| 1687 | 1687 | if (!empty($obj->country_code)) { |
| 1688 | - $s .= ', ' . $langs->trans('Country' . $obj->country_code); |
|
| 1688 | + $s .= ', '.$langs->trans('Country'.$obj->country_code); |
|
| 1689 | 1689 | } |
| 1690 | 1690 | $label .= $s; |
| 1691 | 1691 | $labelhtml .= $s; |
@@ -1693,9 +1693,9 @@ discard block |
||
| 1693 | 1693 | |
| 1694 | 1694 | if (empty($outputmode)) { |
| 1695 | 1695 | if (in_array($obj->rowid, $selected)) { |
| 1696 | - $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>'; |
|
| 1696 | + $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>'; |
|
| 1697 | 1697 | } else { |
| 1698 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 1698 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 1699 | 1699 | } |
| 1700 | 1700 | } else { |
| 1701 | 1701 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml)); |
@@ -1707,9 +1707,9 @@ discard block |
||
| 1707 | 1707 | } |
| 1708 | 1708 | } |
| 1709 | 1709 | } |
| 1710 | - $out .= '</select>' . "\n"; |
|
| 1710 | + $out .= '</select>'."\n"; |
|
| 1711 | 1711 | if (!$forcecombo) { |
| 1712 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1712 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1713 | 1713 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("COMPANY_USE_SEARCH_TO_SELECT")); |
| 1714 | 1714 | } |
| 1715 | 1715 | } else { |
@@ -1798,7 +1798,7 @@ discard block |
||
| 1798 | 1798 | } |
| 1799 | 1799 | |
| 1800 | 1800 | if (!is_object($hookmanager)) { |
| 1801 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
| 1801 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
| 1802 | 1802 | $hookmanager = new HookManager($this->db); |
| 1803 | 1803 | } |
| 1804 | 1804 | |
@@ -1807,13 +1807,13 @@ discard block |
||
| 1807 | 1807 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
| 1808 | 1808 | $sql .= ", s.nom as company, s.town AS company_town"; |
| 1809 | 1809 | } |
| 1810 | - $sql .= " FROM " . $this->db->prefix() . "socpeople as sp"; |
|
| 1810 | + $sql .= " FROM ".$this->db->prefix()."socpeople as sp"; |
|
| 1811 | 1811 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
| 1812 | - $sql .= " LEFT OUTER JOIN " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc"; |
|
| 1812 | + $sql .= " LEFT OUTER JOIN ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc"; |
|
| 1813 | 1813 | } |
| 1814 | - $sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")"; |
|
| 1814 | + $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
|
| 1815 | 1815 | if ($socid > 0 || $socid == -1) { |
| 1816 | - $sql .= " AND sp.fk_soc = " . ((int) $socid); |
|
| 1816 | + $sql .= " AND sp.fk_soc = ".((int) $socid); |
|
| 1817 | 1817 | } |
| 1818 | 1818 | if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) { |
| 1819 | 1819 | $sql .= " AND sp.statut <> 0"; |
@@ -1821,7 +1821,7 @@ discard block |
||
| 1821 | 1821 | if ($filter) { |
| 1822 | 1822 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
| 1823 | 1823 | // if not, by testSqlAndScriptInject() only. |
| 1824 | - $sql .= " AND (" . $filter . ")"; |
|
| 1824 | + $sql .= " AND (".$filter.")"; |
|
| 1825 | 1825 | } |
| 1826 | 1826 | // Add where from hooks |
| 1827 | 1827 | $parameters = array(); |
@@ -1829,30 +1829,30 @@ discard block |
||
| 1829 | 1829 | $sql .= $hookmanager->resPrint; |
| 1830 | 1830 | $sql .= " ORDER BY sp.lastname ASC"; |
| 1831 | 1831 | |
| 1832 | - dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG); |
|
| 1832 | + dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG); |
|
| 1833 | 1833 | $resql = $this->db->query($sql); |
| 1834 | 1834 | if ($resql) { |
| 1835 | 1835 | $num = $this->db->num_rows($resql); |
| 1836 | 1836 | |
| 1837 | 1837 | if ($htmlname != 'none' && !$options_only) { |
| 1838 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>'; |
|
| 1838 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>'; |
|
| 1839 | 1839 | } |
| 1840 | 1840 | |
| 1841 | 1841 | if ($showempty && !is_numeric($showempty)) { |
| 1842 | 1842 | $textforempty = $showempty; |
| 1843 | - $out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>'; |
|
| 1843 | + $out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>'; |
|
| 1844 | 1844 | } else { |
| 1845 | 1845 | if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) { |
| 1846 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '> </option>'; |
|
| 1846 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'> </option>'; |
|
| 1847 | 1847 | } |
| 1848 | 1848 | if ($showempty == 2) { |
| 1849 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>'; |
|
| 1849 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>'; |
|
| 1850 | 1850 | } |
| 1851 | 1851 | } |
| 1852 | 1852 | |
| 1853 | 1853 | $i = 0; |
| 1854 | 1854 | if ($num) { |
| 1855 | - include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 1855 | + include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 1856 | 1856 | $contactstatic = new Contact($this->db); |
| 1857 | 1857 | |
| 1858 | 1858 | while ($i < $num) { |
@@ -1888,7 +1888,7 @@ discard block |
||
| 1888 | 1888 | } |
| 1889 | 1889 | $extendedInfos = implode(' - ', $extendedInfos); |
| 1890 | 1890 | if (!empty($extendedInfos)) { |
| 1891 | - $extendedInfos = ' - ' . $extendedInfos; |
|
| 1891 | + $extendedInfos = ' - '.$extendedInfos; |
|
| 1892 | 1892 | } |
| 1893 | 1893 | } |
| 1894 | 1894 | |
@@ -1906,35 +1906,35 @@ discard block |
||
| 1906 | 1906 | $disabled = 1; |
| 1907 | 1907 | } |
| 1908 | 1908 | if (!empty($selected) && in_array($obj->rowid, $selected)) { |
| 1909 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 1909 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 1910 | 1910 | if ($disabled) { |
| 1911 | 1911 | $out .= ' disabled'; |
| 1912 | 1912 | } |
| 1913 | 1913 | $out .= ' selected>'; |
| 1914 | 1914 | |
| 1915 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1915 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1916 | 1916 | if ($showfunction && $obj->poste) { |
| 1917 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
| 1917 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
| 1918 | 1918 | } |
| 1919 | 1919 | if (($showsoc > 0) && $obj->company) { |
| 1920 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
| 1920 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
| 1921 | 1921 | } |
| 1922 | 1922 | |
| 1923 | 1923 | $out .= $tmplabel; |
| 1924 | 1924 | $out .= '</option>'; |
| 1925 | 1925 | } else { |
| 1926 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 1926 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 1927 | 1927 | if ($disabled) { |
| 1928 | 1928 | $out .= ' disabled'; |
| 1929 | 1929 | } |
| 1930 | 1930 | $out .= '>'; |
| 1931 | 1931 | |
| 1932 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1932 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1933 | 1933 | if ($showfunction && $obj->poste) { |
| 1934 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
| 1934 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
| 1935 | 1935 | } |
| 1936 | 1936 | if (($showsoc > 0) && $obj->company) { |
| 1937 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
| 1937 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
| 1938 | 1938 | } |
| 1939 | 1939 | |
| 1940 | 1940 | $out .= $tmplabel; |
@@ -1942,12 +1942,12 @@ discard block |
||
| 1942 | 1942 | } |
| 1943 | 1943 | } else { |
| 1944 | 1944 | if (in_array($obj->rowid, $selected)) { |
| 1945 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1945 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1946 | 1946 | if ($showfunction && $obj->poste) { |
| 1947 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
| 1947 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
| 1948 | 1948 | } |
| 1949 | 1949 | if (($showsoc > 0) && $obj->company) { |
| 1950 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
| 1950 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
| 1951 | 1951 | } |
| 1952 | 1952 | |
| 1953 | 1953 | $out .= $tmplabel; |
@@ -1962,7 +1962,7 @@ discard block |
||
| 1962 | 1962 | } |
| 1963 | 1963 | } else { |
| 1964 | 1964 | $labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst'); |
| 1965 | - $out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">'; |
|
| 1965 | + $out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">'; |
|
| 1966 | 1966 | $out .= $labeltoshow; |
| 1967 | 1967 | $out .= '</option>'; |
| 1968 | 1968 | } |
@@ -1983,7 +1983,7 @@ discard block |
||
| 1983 | 1983 | } |
| 1984 | 1984 | |
| 1985 | 1985 | if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) { |
| 1986 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1986 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1987 | 1987 | $out .= ajax_combobox($htmlid, $events, getDolGlobalInt("CONTACT_USE_SEARCH_TO_SELECT")); |
| 1988 | 1988 | } |
| 1989 | 1989 | |
@@ -2022,18 +2022,18 @@ discard block |
||
| 2022 | 2022 | // On recherche les remises |
| 2023 | 2023 | $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; |
| 2024 | 2024 | $sql .= " re.description, re.fk_facture_source"; |
| 2025 | - $sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re"; |
|
| 2026 | - $sql .= " WHERE re.fk_soc = " . (int) $socid; |
|
| 2027 | - $sql .= " AND re.entity = " . $conf->entity; |
|
| 2025 | + $sql .= " FROM ".$this->db->prefix()."societe_remise_except as re"; |
|
| 2026 | + $sql .= " WHERE re.fk_soc = ".(int) $socid; |
|
| 2027 | + $sql .= " AND re.entity = ".$conf->entity; |
|
| 2028 | 2028 | if ($filter) { |
| 2029 | - $sql .= " AND " . $filter; |
|
| 2029 | + $sql .= " AND ".$filter; |
|
| 2030 | 2030 | } |
| 2031 | 2031 | $sql .= " ORDER BY re.description ASC"; |
| 2032 | 2032 | |
| 2033 | - dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG); |
|
| 2033 | + dol_syslog(get_class($this)."::select_remises", LOG_DEBUG); |
|
| 2034 | 2034 | $resql = $this->db->query($sql); |
| 2035 | 2035 | if ($resql) { |
| 2036 | - print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">'; |
|
| 2036 | + print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">'; |
|
| 2037 | 2037 | $num = $this->db->num_rows($resql); |
| 2038 | 2038 | |
| 2039 | 2039 | $qualifiedlines = $num; |
@@ -2071,16 +2071,16 @@ discard block |
||
| 2071 | 2071 | if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) { |
| 2072 | 2072 | $tmpfac = new Facture($this->db); |
| 2073 | 2073 | if ($tmpfac->fetch($obj->fk_facture_source) > 0) { |
| 2074 | - $desc = $desc . ' - ' . $tmpfac->ref; |
|
| 2074 | + $desc = $desc.' - '.$tmpfac->ref; |
|
| 2075 | 2075 | } |
| 2076 | 2076 | } |
| 2077 | 2077 | |
| 2078 | - print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>'; |
|
| 2078 | + print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>'; |
|
| 2079 | 2079 | $i++; |
| 2080 | 2080 | } |
| 2081 | 2081 | } |
| 2082 | 2082 | print '</select>'; |
| 2083 | - print ajax_combobox('select_' . $htmlname); |
|
| 2083 | + print ajax_combobox('select_'.$htmlname); |
|
| 2084 | 2084 | |
| 2085 | 2085 | return $qualifiedlines; |
| 2086 | 2086 | } else { |
@@ -2189,14 +2189,14 @@ discard block |
||
| 2189 | 2189 | if ($showlabelofentity) { |
| 2190 | 2190 | $sql .= ", e.label"; |
| 2191 | 2191 | } |
| 2192 | - $sql .= " FROM " . $this->db->prefix() . "user as u"; |
|
| 2192 | + $sql .= " FROM ".$this->db->prefix()."user as u"; |
|
| 2193 | 2193 | if ($showlabelofentity) { |
| 2194 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity"; |
|
| 2194 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity"; |
|
| 2195 | 2195 | } |
| 2196 | 2196 | // Condition here should be the same than into societe->getSalesRepresentatives(). |
| 2197 | 2197 | if ($userissuperadminentityone && $force_entity != 'default') { |
| 2198 | 2198 | if (!empty($force_entity)) { |
| 2199 | - $sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")"; |
|
| 2199 | + $sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")"; |
|
| 2200 | 2200 | } else { |
| 2201 | 2201 | $sql .= " WHERE u.entity IS NOT NULL"; |
| 2202 | 2202 | } |
@@ -2204,18 +2204,18 @@ discard block |
||
| 2204 | 2204 | if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) { |
| 2205 | 2205 | $sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))"; |
| 2206 | 2206 | } else { |
| 2207 | - $sql .= " WHERE u.entity IN (" . getEntity('user') . ")"; |
|
| 2207 | + $sql .= " WHERE u.entity IN (".getEntity('user').")"; |
|
| 2208 | 2208 | } |
| 2209 | 2209 | } |
| 2210 | 2210 | |
| 2211 | 2211 | if (!empty($user->socid)) { |
| 2212 | - $sql .= " AND u.fk_soc = " . ((int) $user->socid); |
|
| 2212 | + $sql .= " AND u.fk_soc = ".((int) $user->socid); |
|
| 2213 | 2213 | } |
| 2214 | 2214 | if (is_array($exclude) && $excludeUsers) { |
| 2215 | - $sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")"; |
|
| 2215 | + $sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")"; |
|
| 2216 | 2216 | } |
| 2217 | 2217 | if ($includeUsers) { |
| 2218 | - $sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")"; |
|
| 2218 | + $sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")"; |
|
| 2219 | 2219 | } |
| 2220 | 2220 | if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) { |
| 2221 | 2221 | $sql .= " AND u.statut <> 0"; |
@@ -2227,7 +2227,7 @@ discard block |
||
| 2227 | 2227 | $sql .= " AND u.fk_soc IS NULL"; |
| 2228 | 2228 | } |
| 2229 | 2229 | if (!empty($morefilter)) { |
| 2230 | - $sql .= " " . $morefilter; |
|
| 2230 | + $sql .= " ".$morefilter; |
|
| 2231 | 2231 | } |
| 2232 | 2232 | |
| 2233 | 2233 | //Add hook to filter on user (for example on usergroup define in custom modules) |
@@ -2242,7 +2242,7 @@ discard block |
||
| 2242 | 2242 | $sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC"; |
| 2243 | 2243 | } |
| 2244 | 2244 | |
| 2245 | - dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG); |
|
| 2245 | + dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); |
|
| 2246 | 2246 | |
| 2247 | 2247 | $resql = $this->db->query($sql); |
| 2248 | 2248 | if ($resql) { |
@@ -2250,7 +2250,7 @@ discard block |
||
| 2250 | 2250 | $i = 0; |
| 2251 | 2251 | if ($num) { |
| 2252 | 2252 | // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined |
| 2253 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
| 2253 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
| 2254 | 2254 | if ($show_empty && !$multiple) { |
| 2255 | 2255 | $textforempty = ' '; |
| 2256 | 2256 | if (!empty($conf->use_javascript_ajax)) { |
@@ -2259,7 +2259,7 @@ discard block |
||
| 2259 | 2259 | if (!is_numeric($show_empty)) { |
| 2260 | 2260 | $textforempty = $show_empty; |
| 2261 | 2261 | } |
| 2262 | - $out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 2262 | + $out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 2263 | 2263 | |
| 2264 | 2264 | $outarray[($show_empty < 0 ? $show_empty : -1)] = $textforempty; |
| 2265 | 2265 | $outarray2[($show_empty < 0 ? $show_empty : -1)] = array( |
@@ -2271,13 +2271,13 @@ discard block |
||
| 2271 | 2271 | ); |
| 2272 | 2272 | } |
| 2273 | 2273 | if ($show_every) { |
| 2274 | - $out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n"; |
|
| 2274 | + $out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n"; |
|
| 2275 | 2275 | |
| 2276 | - $outarray[-2] = '-- ' . $langs->trans("Everybody") . ' --'; |
|
| 2276 | + $outarray[-2] = '-- '.$langs->trans("Everybody").' --'; |
|
| 2277 | 2277 | $outarray2[-2] = array( |
| 2278 | 2278 | 'id' => -2, |
| 2279 | - 'label' => '-- ' . $langs->trans("Everybody") . ' --', |
|
| 2280 | - 'labelhtml' => '-- ' . $langs->trans("Everybody") . ' --', |
|
| 2279 | + 'label' => '-- '.$langs->trans("Everybody").' --', |
|
| 2280 | + 'labelhtml' => '-- '.$langs->trans("Everybody").' --', |
|
| 2281 | 2281 | 'color' => '', |
| 2282 | 2282 | 'picto' => '' |
| 2283 | 2283 | ); |
@@ -2328,21 +2328,21 @@ discard block |
||
| 2328 | 2328 | } |
| 2329 | 2329 | if ($showstatus >= 0) { |
| 2330 | 2330 | if ($obj->status == 1 && $showstatus == 1) { |
| 2331 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled'); |
|
| 2332 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled'); |
|
| 2331 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); |
|
| 2332 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled'); |
|
| 2333 | 2333 | } |
| 2334 | 2334 | if ($obj->status == 0 && $showstatus == 1) { |
| 2335 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled'); |
|
| 2336 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled'); |
|
| 2335 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); |
|
| 2336 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled'); |
|
| 2337 | 2337 | } |
| 2338 | 2338 | } |
| 2339 | 2339 | if ($showlabelofentity) { |
| 2340 | 2340 | if (empty($obj->entity)) { |
| 2341 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities"); |
|
| 2342 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities"); |
|
| 2341 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); |
|
| 2342 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities"); |
|
| 2343 | 2343 | } else { |
| 2344 | 2344 | if ($obj->entity != $conf->entity) { |
| 2345 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2345 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2346 | 2346 | $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
| 2347 | 2347 | } |
| 2348 | 2348 | } |
@@ -2351,13 +2351,13 @@ discard block |
||
| 2351 | 2351 | $moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : ''); |
| 2352 | 2352 | if (!empty($disableline) && $disableline != '1') { |
| 2353 | 2353 | // Add text from $enableonlytext parameter |
| 2354 | - $moreinfo .= ' - ' . $disableline; |
|
| 2355 | - $moreinfohtml .= ' - ' . $disableline; |
|
| 2354 | + $moreinfo .= ' - '.$disableline; |
|
| 2355 | + $moreinfohtml .= ' - '.$disableline; |
|
| 2356 | 2356 | } |
| 2357 | 2357 | $labeltoshow .= $moreinfo; |
| 2358 | 2358 | $labeltoshowhtml .= $moreinfohtml; |
| 2359 | 2359 | |
| 2360 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 2360 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 2361 | 2361 | if (!empty($disableline)) { |
| 2362 | 2362 | $out .= ' disabled'; |
| 2363 | 2363 | } |
@@ -2366,7 +2366,7 @@ discard block |
||
| 2366 | 2366 | } |
| 2367 | 2367 | $out .= ' data-html="'; |
| 2368 | 2368 | |
| 2369 | - $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' '; |
|
| 2369 | + $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; |
|
| 2370 | 2370 | if ($showstatus >= 0 && $obj->status == 0) { |
| 2371 | 2371 | $outhtml .= '<strike class="opacitymediumxxx">'; |
| 2372 | 2372 | } |
@@ -2381,7 +2381,7 @@ discard block |
||
| 2381 | 2381 | $out .= $labeltoshow; |
| 2382 | 2382 | $out .= '</option>'; |
| 2383 | 2383 | |
| 2384 | - $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo; |
|
| 2384 | + $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo; |
|
| 2385 | 2385 | $outarray2[$userstatic->id] = array( |
| 2386 | 2386 | 'id' => $userstatic->id, |
| 2387 | 2387 | 'label' => $labeltoshow, |
@@ -2393,14 +2393,14 @@ discard block |
||
| 2393 | 2393 | $i++; |
| 2394 | 2394 | } |
| 2395 | 2395 | } else { |
| 2396 | - $out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>'; |
|
| 2397 | - $out .= '<option value="">' . $langs->trans("None") . '</option>'; |
|
| 2396 | + $out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>'; |
|
| 2397 | + $out .= '<option value="">'.$langs->trans("None").'</option>'; |
|
| 2398 | 2398 | } |
| 2399 | 2399 | $out .= '</select>'; |
| 2400 | 2400 | |
| 2401 | 2401 | if ($num && !$forcecombo) { |
| 2402 | 2402 | // Enhance with select2 |
| 2403 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2403 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2404 | 2404 | $out .= ajax_combobox($htmlname); |
| 2405 | 2405 | } |
| 2406 | 2406 | } else { |
@@ -2476,16 +2476,16 @@ discard block |
||
| 2476 | 2476 | $out .= $userstatic->getNomUrl(-1); |
| 2477 | 2477 | if ($i == 0) { |
| 2478 | 2478 | $ownerid = $value['id']; |
| 2479 | - $out .= ' (' . $langs->trans("Owner") . ')'; |
|
| 2479 | + $out .= ' ('.$langs->trans("Owner").')'; |
|
| 2480 | 2480 | } |
| 2481 | 2481 | if ($nbassignetouser > 1 && $action != 'view') { |
| 2482 | - $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 . '">'; |
|
| 2482 | + $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.'">'; |
|
| 2483 | 2483 | } |
| 2484 | 2484 | // Show my availability |
| 2485 | 2485 | if ($showproperties) { |
| 2486 | 2486 | if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) { |
| 2487 | 2487 | $out .= '<div class="myavailability inline-block">'; |
| 2488 | - $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>'; |
|
| 2488 | + $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>'; |
|
| 2489 | 2489 | $out .= '</div>'; |
| 2490 | 2490 | } |
| 2491 | 2491 | } |
@@ -2502,15 +2502,15 @@ discard block |
||
| 2502 | 2502 | // Method with no ajax |
| 2503 | 2503 | if ($action != 'view') { |
| 2504 | 2504 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">'; |
| 2505 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2505 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2506 | 2506 | $out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });'; |
| 2507 | 2507 | $out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());'; |
| 2508 | - $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }'; |
|
| 2509 | - $out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }'; |
|
| 2508 | + $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }'; |
|
| 2509 | + $out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }'; |
|
| 2510 | 2510 | $out .= '});'; |
| 2511 | 2511 | $out .= '})</script>'; |
| 2512 | 2512 | $out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
| 2513 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
| 2513 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
| 2514 | 2514 | $out .= '<br>'; |
| 2515 | 2515 | } |
| 2516 | 2516 | |
@@ -2569,13 +2569,13 @@ discard block |
||
| 2569 | 2569 | $resourcestatic->fetch($value['id']); |
| 2570 | 2570 | $out .= $resourcestatic->getNomUrl(-1); |
| 2571 | 2571 | if ($nbassignetoresource > 1 && $action != 'view') { |
| 2572 | - $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 . '">'; |
|
| 2572 | + $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.'">'; |
|
| 2573 | 2573 | } |
| 2574 | 2574 | // Show my availability |
| 2575 | 2575 | if ($showproperties) { |
| 2576 | 2576 | if (is_array($listofresourceid) && count($listofresourceid)) { |
| 2577 | 2577 | $out .= '<div class="myavailability inline-block">'; |
| 2578 | - $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>'; |
|
| 2578 | + $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>'; |
|
| 2579 | 2579 | $out .= '</div>'; |
| 2580 | 2580 | } |
| 2581 | 2581 | } |
@@ -2592,11 +2592,11 @@ discard block |
||
| 2592 | 2592 | // Method with no ajax |
| 2593 | 2593 | if ($action != 'view') { |
| 2594 | 2594 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">'; |
| 2595 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2595 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2596 | 2596 | $out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });'; |
| 2597 | 2597 | $out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());'; |
| 2598 | - $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }'; |
|
| 2599 | - $out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }'; |
|
| 2598 | + $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }'; |
|
| 2599 | + $out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }'; |
|
| 2600 | 2600 | $out .= '});'; |
| 2601 | 2601 | $out .= '})</script>'; |
| 2602 | 2602 | |
@@ -2604,7 +2604,7 @@ discard block |
||
| 2604 | 2604 | $out .= img_picto('', 'resource', 'class="pictofixedwidth"'); |
| 2605 | 2605 | $out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, array(), 2, 0); |
| 2606 | 2606 | //$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
| 2607 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
| 2607 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
| 2608 | 2608 | $out .= '<br>'; |
| 2609 | 2609 | } |
| 2610 | 2610 | |
@@ -2668,7 +2668,7 @@ discard block |
||
| 2668 | 2668 | $placeholder = ''; |
| 2669 | 2669 | |
| 2670 | 2670 | if ($selected && empty($selected_input_value)) { |
| 2671 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2671 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2672 | 2672 | $producttmpselect = new Product($this->db); |
| 2673 | 2673 | $producttmpselect->fetch($selected); |
| 2674 | 2674 | $selected_input_value = $producttmpselect->ref; |
@@ -2683,20 +2683,20 @@ discard block |
||
| 2683 | 2683 | } |
| 2684 | 2684 | } |
| 2685 | 2685 | // mode=1 means customers products |
| 2686 | - $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; |
|
| 2686 | + $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; |
|
| 2687 | 2687 | if ((int) $warehouseId > 0) { |
| 2688 | - $urloption .= '&warehouseid=' . (int) $warehouseId; |
|
| 2688 | + $urloption .= '&warehouseid='.(int) $warehouseId; |
|
| 2689 | 2689 | } |
| 2690 | - $out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions); |
|
| 2690 | + $out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions); |
|
| 2691 | 2691 | |
| 2692 | 2692 | if (isModEnabled('variants') && is_array($selected_combinations)) { |
| 2693 | 2693 | // Code to automatically insert with javascript the select of attributes under the select of product |
| 2694 | 2694 | // when a parent of variant has been selected. |
| 2695 | 2695 | $out .= ' |
| 2696 | 2696 | <!-- script to auto show attributes select tags if a variant was selected --> |
| 2697 | - <script nonce="' . getNonce() . '"> |
|
| 2697 | + <script nonce="' . getNonce().'"> |
|
| 2698 | 2698 | // auto show attributes fields |
| 2699 | - selected = ' . json_encode($selected_combinations) . '; |
|
| 2699 | + selected = ' . json_encode($selected_combinations).'; |
|
| 2700 | 2700 | combvalues = {}; |
| 2701 | 2701 | |
| 2702 | 2702 | jQuery(document).ready(function () { |
@@ -2707,7 +2707,7 @@ discard block |
||
| 2707 | 2707 | } |
| 2708 | 2708 | }); |
| 2709 | 2709 | |
| 2710 | - jQuery("input#' . $htmlname . '").change(function () { |
|
| 2710 | + jQuery("input#' . $htmlname.'").change(function () { |
|
| 2711 | 2711 | |
| 2712 | 2712 | if (!jQuery(this).val()) { |
| 2713 | 2713 | jQuery(\'div#attributes_box\').empty(); |
@@ -2716,7 +2716,7 @@ discard block |
||
| 2716 | 2716 | |
| 2717 | 2717 | console.log("A change has started. We get variants fields to inject html select"); |
| 2718 | 2718 | |
| 2719 | - jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", { |
|
| 2719 | + jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", { |
|
| 2720 | 2720 | id: jQuery(this).val() |
| 2721 | 2721 | }, function (data) { |
| 2722 | 2722 | jQuery(\'div#attributes_box\').empty(); |
@@ -2759,21 +2759,21 @@ discard block |
||
| 2759 | 2759 | }) |
| 2760 | 2760 | }); |
| 2761 | 2761 | |
| 2762 | - ' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . ' |
|
| 2762 | + ' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').' |
|
| 2763 | 2763 | }); |
| 2764 | 2764 | </script> |
| 2765 | 2765 | '; |
| 2766 | 2766 | } |
| 2767 | 2767 | |
| 2768 | 2768 | if (empty($hidelabel)) { |
| 2769 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 2769 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 2770 | 2770 | } elseif ($hidelabel > 1) { |
| 2771 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 2771 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 2772 | 2772 | if ($hidelabel == 2) { |
| 2773 | 2773 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 2774 | 2774 | } |
| 2775 | 2775 | } |
| 2776 | - $out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 2776 | + $out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 2777 | 2777 | if ($hidelabel == 3) { |
| 2778 | 2778 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 2779 | 2779 | } |
@@ -2810,33 +2810,33 @@ discard block |
||
| 2810 | 2810 | // phpcs:enable |
| 2811 | 2811 | global $db; |
| 2812 | 2812 | |
| 2813 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2813 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2814 | 2814 | |
| 2815 | 2815 | $error = 0; |
| 2816 | 2816 | $out = ''; |
| 2817 | 2817 | |
| 2818 | 2818 | if (!$forcecombo) { |
| 2819 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2819 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2820 | 2820 | $events = array(); |
| 2821 | 2821 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
| 2822 | 2822 | } |
| 2823 | 2823 | |
| 2824 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 2824 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 2825 | 2825 | |
| 2826 | 2826 | $sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product'; |
| 2827 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b'; |
|
| 2828 | - $sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')'; |
|
| 2827 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b'; |
|
| 2828 | + $sql .= ' WHERE b.entity IN ('.getEntity('bom').')'; |
|
| 2829 | 2829 | if (!empty($status)) { |
| 2830 | - $sql .= ' AND status = ' . (int) $status; |
|
| 2830 | + $sql .= ' AND status = '.(int) $status; |
|
| 2831 | 2831 | } |
| 2832 | 2832 | if (!empty($type)) { |
| 2833 | - $sql .= ' AND bomtype = ' . (int) $type; |
|
| 2833 | + $sql .= ' AND bomtype = '.(int) $type; |
|
| 2834 | 2834 | } |
| 2835 | 2835 | if (!empty($TProducts)) { |
| 2836 | - $sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')'; |
|
| 2836 | + $sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')'; |
|
| 2837 | 2837 | } |
| 2838 | 2838 | if (!empty($limit)) { |
| 2839 | - $sql .= ' LIMIT ' . (int) $limit; |
|
| 2839 | + $sql .= ' LIMIT '.(int) $limit; |
|
| 2840 | 2840 | } |
| 2841 | 2841 | $resql = $db->query($sql); |
| 2842 | 2842 | if ($resql) { |
@@ -2850,11 +2850,11 @@ discard block |
||
| 2850 | 2850 | while ($obj = $db->fetch_object($resql)) { |
| 2851 | 2851 | $product = new Product($db); |
| 2852 | 2852 | $res = $product->fetch($obj->fk_product); |
| 2853 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 2853 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 2854 | 2854 | if ($obj->rowid == $selected) { |
| 2855 | 2855 | $out .= 'selected'; |
| 2856 | 2856 | } |
| 2857 | - $out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>'; |
|
| 2857 | + $out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>'; |
|
| 2858 | 2858 | } |
| 2859 | 2859 | } else { |
| 2860 | 2860 | $error++; |
@@ -2912,7 +2912,7 @@ discard block |
||
| 2912 | 2912 | |
| 2913 | 2913 | $warehouseStatusArray = array(); |
| 2914 | 2914 | if (!empty($warehouseStatus)) { |
| 2915 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
| 2915 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
| 2916 | 2916 | if (preg_match('/warehouseclosed/', $warehouseStatus)) { |
| 2917 | 2917 | $warehouseStatusArray[] = Entrepot::STATUS_CLOSED; |
| 2918 | 2918 | } |
@@ -2926,9 +2926,9 @@ discard block |
||
| 2926 | 2926 | |
| 2927 | 2927 | $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"; |
| 2928 | 2928 | if (count($warehouseStatusArray)) { |
| 2929 | - $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 |
|
| 2929 | + $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 |
|
| 2930 | 2930 | } else { |
| 2931 | - $selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock"; |
|
| 2931 | + $selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock"; |
|
| 2932 | 2932 | } |
| 2933 | 2933 | |
| 2934 | 2934 | $sql = "SELECT "; |
@@ -2944,9 +2944,9 @@ discard block |
||
| 2944 | 2944 | |
| 2945 | 2945 | if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) { |
| 2946 | 2946 | //Product category |
| 2947 | - $sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie |
|
| 2948 | - FROM " . $this->db->prefix() . "categorie_product |
|
| 2949 | - WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid |
|
| 2947 | + $sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie |
|
| 2948 | + FROM " . $this->db->prefix()."categorie_product |
|
| 2949 | + WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid |
|
| 2950 | 2950 | LIMIT 1 |
| 2951 | 2951 | ) AS categorie_product_id "; |
| 2952 | 2952 | } |
@@ -2972,15 +2972,15 @@ discard block |
||
| 2972 | 2972 | } |
| 2973 | 2973 | // Price by quantity |
| 2974 | 2974 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2975 | - $sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; |
|
| 2975 | + $sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; |
|
| 2976 | 2976 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2977 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 2977 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 2978 | 2978 | } |
| 2979 | 2979 | $sql .= " ORDER BY date_price"; |
| 2980 | 2980 | $sql .= " DESC LIMIT 1) as price_rowid"; |
| 2981 | - $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 |
|
| 2981 | + $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 |
|
| 2982 | 2982 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2983 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 2983 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 2984 | 2984 | } |
| 2985 | 2985 | $sql .= " ORDER BY date_price"; |
| 2986 | 2986 | $sql .= " DESC LIMIT 1) as price_by_qty"; |
@@ -2990,7 +2990,7 @@ discard block |
||
| 2990 | 2990 | $sql .= " FROM ".$this->db->prefix()."product as p"; |
| 2991 | 2991 | |
| 2992 | 2992 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_FORCE_INDEX')) { |
| 2993 | - $sql .= " USE INDEX (" . $this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')) . ")"; |
|
| 2993 | + $sql .= " USE INDEX (".$this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')).")"; |
|
| 2994 | 2994 | } |
| 2995 | 2995 | |
| 2996 | 2996 | // Add from (left join) from hooks |
@@ -2999,53 +2999,53 @@ discard block |
||
| 2999 | 2999 | $sql .= $hookmanager->resPrint; |
| 3000 | 3000 | |
| 3001 | 3001 | if (count($warehouseStatusArray)) { |
| 3002 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid"; |
|
| 3003 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")"; |
|
| 3004 | - $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. |
|
| 3002 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid"; |
|
| 3003 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")"; |
|
| 3004 | + $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. |
|
| 3005 | 3005 | } |
| 3006 | 3006 | |
| 3007 | 3007 | // include search in supplier ref |
| 3008 | 3008 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
| 3009 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 3009 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 3010 | 3010 | } |
| 3011 | 3011 | |
| 3012 | 3012 | //Price by customer |
| 3013 | 3013 | if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) { |
| 3014 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid"; |
|
| 3014 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid"; |
|
| 3015 | 3015 | } |
| 3016 | 3016 | // Units |
| 3017 | 3017 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3018 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
| 3018 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
| 3019 | 3019 | } |
| 3020 | 3020 | // Multilang : we add translation |
| 3021 | 3021 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 3022 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid "; |
|
| 3022 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid "; |
|
| 3023 | 3023 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) { |
| 3024 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 3024 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 3025 | 3025 | $soc = new Societe($this->db); |
| 3026 | 3026 | $result = $soc->fetch($socid); |
| 3027 | 3027 | if ($result > 0 && !empty($soc->default_lang)) { |
| 3028 | - $sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'"; |
|
| 3028 | + $sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'"; |
|
| 3029 | 3029 | } else { |
| 3030 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
| 3030 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
| 3031 | 3031 | } |
| 3032 | 3032 | } else { |
| 3033 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
| 3033 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
| 3034 | 3034 | } |
| 3035 | 3035 | } |
| 3036 | 3036 | |
| 3037 | 3037 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
| 3038 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
| 3038 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
| 3039 | 3039 | } |
| 3040 | 3040 | |
| 3041 | - $sql .= ' WHERE p.entity IN (' . getEntity('product') . ')'; |
|
| 3041 | + $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; |
|
| 3042 | 3042 | |
| 3043 | 3043 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
| 3044 | 3044 | $sql .= " AND pac.rowid IS NULL"; |
| 3045 | 3045 | } |
| 3046 | 3046 | |
| 3047 | 3047 | if ($finished == 0) { |
| 3048 | - $sql .= " AND p.finished = " . ((int) $finished); |
|
| 3048 | + $sql .= " AND p.finished = ".((int) $finished); |
|
| 3049 | 3049 | } elseif ($finished == 1) { |
| 3050 | 3050 | $sql .= " AND p.finished = ".((int) $finished); |
| 3051 | 3051 | } |
@@ -3053,11 +3053,11 @@ discard block |
||
| 3053 | 3053 | $sql .= " AND p.tosell = ".((int) $status); |
| 3054 | 3054 | } |
| 3055 | 3055 | if ($status_purchase >= 0) { |
| 3056 | - $sql .= " AND p.tobuy = " . ((int) $status_purchase); |
|
| 3056 | + $sql .= " AND p.tobuy = ".((int) $status_purchase); |
|
| 3057 | 3057 | } |
| 3058 | 3058 | // Filter by product type |
| 3059 | 3059 | if (strval($filtertype) != '') { |
| 3060 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
| 3060 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
| 3061 | 3061 | } elseif (!isModEnabled('product')) { // when product module is disabled, show services only |
| 3062 | 3062 | $sql .= " AND p.fk_product_type = 1"; |
| 3063 | 3063 | } elseif (!isModEnabled('service')) { // when service module is disabled, show products only |
@@ -3065,7 +3065,7 @@ discard block |
||
| 3065 | 3065 | } |
| 3066 | 3066 | |
| 3067 | 3067 | if ((int) $warehouseId > 0) { |
| 3068 | - $sql .= " AND EXISTS (SELECT psw.fk_product FROM " . $this->db->prefix() . "product_stock as psw WHERE psw.reel>0 AND psw.fk_entrepot=".(int) $warehouseId." AND psw.fk_product = p.rowid)"; |
|
| 3068 | + $sql .= " AND EXISTS (SELECT psw.fk_product FROM ".$this->db->prefix()."product_stock as psw WHERE psw.reel>0 AND psw.fk_entrepot=".(int) $warehouseId." AND psw.fk_product = p.rowid)"; |
|
| 3069 | 3069 | } |
| 3070 | 3070 | |
| 3071 | 3071 | // Add where from hooks |
@@ -3086,21 +3086,21 @@ discard block |
||
| 3086 | 3086 | if ($i > 0) { |
| 3087 | 3087 | $sql .= " AND "; |
| 3088 | 3088 | } |
| 3089 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3089 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3090 | 3090 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 3091 | - $sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3091 | + $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3092 | 3092 | } |
| 3093 | 3093 | if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) { |
| 3094 | - $sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3094 | + $sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3095 | 3095 | } |
| 3096 | 3096 | if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) { |
| 3097 | - $sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3097 | + $sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3098 | 3098 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 3099 | - $sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3099 | + $sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3100 | 3100 | } |
| 3101 | 3101 | } |
| 3102 | 3102 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
| 3103 | - $sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3103 | + $sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3104 | 3104 | } |
| 3105 | 3105 | $sql .= ")"; |
| 3106 | 3106 | $i++; |
@@ -3109,12 +3109,12 @@ discard block |
||
| 3109 | 3109 | $sql .= ")"; |
| 3110 | 3110 | } |
| 3111 | 3111 | if (isModEnabled('barcode')) { |
| 3112 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3112 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3113 | 3113 | } |
| 3114 | 3114 | $sql .= ')'; |
| 3115 | 3115 | } |
| 3116 | 3116 | if (count($warehouseStatusArray)) { |
| 3117 | - $sql .= " GROUP BY " . $selectFields; |
|
| 3117 | + $sql .= " GROUP BY ".$selectFields; |
|
| 3118 | 3118 | } |
| 3119 | 3119 | |
| 3120 | 3120 | //Sort by category |
@@ -3129,23 +3129,23 @@ discard block |
||
| 3129 | 3129 | $sql .= $this->db->plimit($limit, 0); |
| 3130 | 3130 | |
| 3131 | 3131 | // Build output string |
| 3132 | - dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG); |
|
| 3132 | + dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG); |
|
| 3133 | 3133 | $result = $this->db->query($sql); |
| 3134 | 3134 | if ($result) { |
| 3135 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 3136 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3137 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 3135 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 3136 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3137 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 3138 | 3138 | |
| 3139 | 3139 | $num = $this->db->num_rows($result); |
| 3140 | 3140 | |
| 3141 | 3141 | $events = array(); |
| 3142 | 3142 | |
| 3143 | 3143 | if (!$forcecombo) { |
| 3144 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 3144 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 3145 | 3145 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
| 3146 | 3146 | } |
| 3147 | 3147 | |
| 3148 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 3148 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 3149 | 3149 | |
| 3150 | 3150 | $textifempty = ''; |
| 3151 | 3151 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -3162,7 +3162,7 @@ discard block |
||
| 3162 | 3162 | } |
| 3163 | 3163 | } |
| 3164 | 3164 | if ($showempty) { |
| 3165 | - $out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : ' ') . '</option>'; |
|
| 3165 | + $out .= '<option value="-1" selected>'.($textifempty ? $textifempty : ' ').'</option>'; |
|
| 3166 | 3166 | } |
| 3167 | 3167 | |
| 3168 | 3168 | $i = 0; |
@@ -3173,11 +3173,11 @@ discard block |
||
| 3173 | 3173 | |
| 3174 | 3174 | if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('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 |
| 3175 | 3175 | $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type"; |
| 3176 | - $sql .= " FROM " . $this->db->prefix() . "product_price_by_qty"; |
|
| 3177 | - $sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid); |
|
| 3176 | + $sql .= " FROM ".$this->db->prefix()."product_price_by_qty"; |
|
| 3177 | + $sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid); |
|
| 3178 | 3178 | $sql .= " ORDER BY quantity ASC"; |
| 3179 | 3179 | |
| 3180 | - dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG); |
|
| 3180 | + dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG); |
|
| 3181 | 3181 | $result2 = $this->db->query($sql); |
| 3182 | 3182 | if ($result2) { |
| 3183 | 3183 | $nb_prices = $this->db->num_rows($result2); |
@@ -3215,7 +3215,7 @@ discard block |
||
| 3215 | 3215 | $price_product = new Product($this->db); |
| 3216 | 3216 | $price_product->fetch($objp->rowid, '', '', 1); |
| 3217 | 3217 | |
| 3218 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3218 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3219 | 3219 | $priceparser = new PriceParser($this->db); |
| 3220 | 3220 | $price_result = $priceparser->parseProduct($price_product); |
| 3221 | 3221 | if ($price_result >= 0) { |
@@ -3301,7 +3301,7 @@ discard block |
||
| 3301 | 3301 | $label = $objp->label_translated; |
| 3302 | 3302 | } |
| 3303 | 3303 | if (!empty($filterkey) && $filterkey != '') { |
| 3304 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
| 3304 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
| 3305 | 3305 | } |
| 3306 | 3306 | |
| 3307 | 3307 | $outkey = $objp->rowid; |
@@ -3322,32 +3322,32 @@ discard block |
||
| 3322 | 3322 | $outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : ''; |
| 3323 | 3323 | |
| 3324 | 3324 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3325 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 3325 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 3326 | 3326 | } |
| 3327 | 3327 | |
| 3328 | 3328 | // Units |
| 3329 | 3329 | $outvalUnits = ''; |
| 3330 | 3330 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3331 | 3331 | if (!empty($objp->unit_short)) { |
| 3332 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
| 3332 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
| 3333 | 3333 | } |
| 3334 | 3334 | } |
| 3335 | 3335 | if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) { |
| 3336 | 3336 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
| 3337 | 3337 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
| 3338 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3338 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3339 | 3339 | } |
| 3340 | 3340 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
| 3341 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
| 3342 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3341 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
| 3342 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3343 | 3343 | } |
| 3344 | 3344 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
| 3345 | 3345 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
| 3346 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3346 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3347 | 3347 | } |
| 3348 | 3348 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
| 3349 | 3349 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
| 3350 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3350 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3351 | 3351 | } |
| 3352 | 3352 | } |
| 3353 | 3353 | if ($outdurationvalue && $outdurationunit) { |
@@ -3359,7 +3359,7 @@ discard block |
||
| 3359 | 3359 | 'y' => $langs->trans('Year') |
| 3360 | 3360 | ); |
| 3361 | 3361 | if (isset($da[$outdurationunit])) { |
| 3362 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
| 3362 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
| 3363 | 3363 | } |
| 3364 | 3364 | } |
| 3365 | 3365 | |
@@ -3379,31 +3379,31 @@ discard block |
||
| 3379 | 3379 | $labeltoshow = ''; |
| 3380 | 3380 | $labeltoshow .= $objp->ref; |
| 3381 | 3381 | if (!empty($objp->custref)) { |
| 3382 | - $labeltoshow .= ' (' . $objp->custref . ')'; |
|
| 3382 | + $labeltoshow .= ' ('.$objp->custref.')'; |
|
| 3383 | 3383 | } |
| 3384 | 3384 | if ($outbarcode) { |
| 3385 | - $labeltoshow .= ' (' . $outbarcode . ')'; |
|
| 3385 | + $labeltoshow .= ' ('.$outbarcode.')'; |
|
| 3386 | 3386 | } |
| 3387 | - $labeltoshow .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3387 | + $labeltoshow .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3388 | 3388 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3389 | - $labeltoshow .= ' (' . getCountry($outorigin, '1') . ')'; |
|
| 3389 | + $labeltoshow .= ' ('.getCountry($outorigin, '1').')'; |
|
| 3390 | 3390 | } |
| 3391 | 3391 | |
| 3392 | 3392 | // Set $labltoshowhtml |
| 3393 | 3393 | $labeltoshowhtml = ''; |
| 3394 | 3394 | $labeltoshowhtml .= $objp->ref; |
| 3395 | 3395 | if (!empty($objp->custref)) { |
| 3396 | - $labeltoshowhtml .= ' (' . $objp->custref . ')'; |
|
| 3396 | + $labeltoshowhtml .= ' ('.$objp->custref.')'; |
|
| 3397 | 3397 | } |
| 3398 | 3398 | if (!empty($filterkey) && $filterkey != '') { |
| 3399 | - $labeltoshowhtml = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $labeltoshowhtml, 1); |
|
| 3399 | + $labeltoshowhtml = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $labeltoshowhtml, 1); |
|
| 3400 | 3400 | } |
| 3401 | 3401 | if ($outbarcode) { |
| 3402 | - $labeltoshowhtml .= ' (' . $outbarcode . ')'; |
|
| 3402 | + $labeltoshowhtml .= ' ('.$outbarcode.')'; |
|
| 3403 | 3403 | } |
| 3404 | - $labeltoshowhtml .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3404 | + $labeltoshowhtml .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3405 | 3405 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3406 | - $labeltoshowhtml .= ' (' . getCountry($outorigin, '1') . ')'; |
|
| 3406 | + $labeltoshowhtml .= ' ('.getCountry($outorigin, '1').')'; |
|
| 3407 | 3407 | } |
| 3408 | 3408 | |
| 3409 | 3409 | // Stock |
@@ -3411,14 +3411,14 @@ discard block |
||
| 3411 | 3411 | $labeltoshowhtmlstock = ''; |
| 3412 | 3412 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
| 3413 | 3413 | if ($user->hasRight('stock', 'lire')) { |
| 3414 | - $labeltoshowstock .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 3414 | + $labeltoshowstock .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 3415 | 3415 | |
| 3416 | 3416 | if ($objp->stock > 0) { |
| 3417 | 3417 | $labeltoshowhtmlstock .= ' - <span class="product_line_stock_ok">'; |
| 3418 | 3418 | } elseif ($objp->stock <= 0) { |
| 3419 | 3419 | $labeltoshowhtmlstock .= ' - <span class="product_line_stock_too_low">'; |
| 3420 | 3420 | } |
| 3421 | - $labeltoshowhtmlstock .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 3421 | + $labeltoshowhtmlstock .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 3422 | 3422 | $labeltoshowhtmlstock .= '</span>'; |
| 3423 | 3423 | |
| 3424 | 3424 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
@@ -3429,9 +3429,9 @@ discard block |
||
| 3429 | 3429 | $tmpproduct->load_virtual_stock(); |
| 3430 | 3430 | $virtualstock = $tmpproduct->stock_theorique; |
| 3431 | 3431 | |
| 3432 | - $labeltoshowstock .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
| 3432 | + $labeltoshowstock .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
| 3433 | 3433 | |
| 3434 | - $labeltoshowhtmlstock .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
| 3434 | + $labeltoshowhtmlstock .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
| 3435 | 3435 | if ($virtualstock > 0) { |
| 3436 | 3436 | $labeltoshowhtmlstock .= '<span class="product_line_stock_ok">'; |
| 3437 | 3437 | } elseif ($virtualstock <= 0) { |
@@ -3452,35 +3452,35 @@ discard block |
||
| 3452 | 3452 | // If we need a particular price level (from 1 to n) |
| 3453 | 3453 | if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES'))) { |
| 3454 | 3454 | $sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code"; |
| 3455 | - $sql .= " FROM " . $this->db->prefix() . "product_price"; |
|
| 3456 | - $sql .= " WHERE fk_product = " . ((int) $objp->rowid); |
|
| 3457 | - $sql .= " AND entity IN (" . getEntity('productprice') . ")"; |
|
| 3458 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 3455 | + $sql .= " FROM ".$this->db->prefix()."product_price"; |
|
| 3456 | + $sql .= " WHERE fk_product = ".((int) $objp->rowid); |
|
| 3457 | + $sql .= " AND entity IN (".getEntity('productprice').")"; |
|
| 3458 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 3459 | 3459 | $sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid. |
| 3460 | 3460 | $sql .= " LIMIT 1"; |
| 3461 | 3461 | |
| 3462 | - dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG); |
|
| 3462 | + dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG); |
|
| 3463 | 3463 | $result2 = $this->db->query($sql); |
| 3464 | 3464 | if ($result2) { |
| 3465 | 3465 | $objp2 = $this->db->fetch_object($result2); |
| 3466 | 3466 | if ($objp2) { |
| 3467 | 3467 | $found = 1; |
| 3468 | 3468 | if ($objp2->price_base_type == 'HT') { |
| 3469 | - $labeltoshowprice .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3470 | - $labeltoshowhtmlprice .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3469 | + $labeltoshowprice .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3470 | + $labeltoshowhtmlprice .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3471 | 3471 | } else { |
| 3472 | - $labeltoshowprice .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3473 | - $labeltoshowhtmlprice .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3472 | + $labeltoshowprice .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3473 | + $labeltoshowhtmlprice .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3474 | 3474 | } |
| 3475 | 3475 | $outprice_ht = price($objp2->price); |
| 3476 | 3476 | $outprice_ttc = price($objp2->price_ttc); |
| 3477 | 3477 | $outpricebasetype = $objp2->price_base_type; |
| 3478 | 3478 | if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { // using this option is a bug. kept for backward compatibility |
| 3479 | - $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
| 3480 | - $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
| 3479 | + $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
| 3480 | + $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
| 3481 | 3481 | } else { |
| 3482 | - $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
| 3483 | - $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
| 3482 | + $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
| 3483 | + $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
| 3484 | 3484 | } |
| 3485 | 3485 | } |
| 3486 | 3486 | } else { |
@@ -3494,13 +3494,13 @@ discard block |
||
| 3494 | 3494 | $outqty = $objp->quantity; |
| 3495 | 3495 | $outdiscount = $objp->remise_percent; |
| 3496 | 3496 | if ($objp->quantity == 1) { |
| 3497 | - $labeltoshowprice .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3498 | - $labeltoshowhtmlprice .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3497 | + $labeltoshowprice .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3498 | + $labeltoshowhtmlprice .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3499 | 3499 | $labeltoshowprice .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
| 3500 | 3500 | $labeltoshowhtmlprice .= $langs->transnoentities("Unit"); |
| 3501 | 3501 | } else { |
| 3502 | - $labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3503 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3502 | + $labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3503 | + $labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3504 | 3504 | $labeltoshowprice .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
| 3505 | 3505 | $labeltoshowhtmlprice .= $langs->transnoentities("Units"); |
| 3506 | 3506 | } |
@@ -3508,16 +3508,16 @@ discard block |
||
| 3508 | 3508 | $outprice_ht = price($objp->unitprice); |
| 3509 | 3509 | $outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100))); |
| 3510 | 3510 | $outpricebasetype = $objp->price_base_type; |
| 3511 | - $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 |
|
| 3512 | - $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 |
|
| 3511 | + $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 |
|
| 3512 | + $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 |
|
| 3513 | 3513 | } |
| 3514 | 3514 | if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) { |
| 3515 | - $labeltoshowprice .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3516 | - $labeltoshowhtmlprice .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3515 | + $labeltoshowprice .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3516 | + $labeltoshowhtmlprice .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3517 | 3517 | } |
| 3518 | 3518 | if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) { |
| 3519 | - $labeltoshowprice .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3520 | - $labeltoshowhtmlprice .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3519 | + $labeltoshowprice .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3520 | + $labeltoshowhtmlprice .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3521 | 3521 | } |
| 3522 | 3522 | |
| 3523 | 3523 | // Price by customer |
@@ -3526,11 +3526,11 @@ discard block |
||
| 3526 | 3526 | $found = 1; |
| 3527 | 3527 | |
| 3528 | 3528 | if ($objp->custprice_base_type == 'HT') { |
| 3529 | - $labeltoshowprice .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3530 | - $labeltoshowhtmlprice .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3529 | + $labeltoshowprice .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3530 | + $labeltoshowhtmlprice .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3531 | 3531 | } else { |
| 3532 | - $labeltoshowprice .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3533 | - $labeltoshowhtmlprice .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3532 | + $labeltoshowprice .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3533 | + $labeltoshowhtmlprice .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3534 | 3534 | } |
| 3535 | 3535 | |
| 3536 | 3536 | $outprice_ht = price($objp->custprice); |
@@ -3544,11 +3544,11 @@ discard block |
||
| 3544 | 3544 | // If level no defined or multiprice not found, we used the default price |
| 3545 | 3545 | if (empty($hidepriceinlabel) && !$found) { |
| 3546 | 3546 | if ($objp->price_base_type == 'HT') { |
| 3547 | - $labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3548 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3547 | + $labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3548 | + $labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3549 | 3549 | } else { |
| 3550 | - $labeltoshowprice .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3551 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3550 | + $labeltoshowprice .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3551 | + $labeltoshowhtmlprice .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3552 | 3552 | } |
| 3553 | 3553 | $outprice_ht = price($objp->price); |
| 3554 | 3554 | $outprice_ttc = price($objp->price_ttc); |
@@ -3558,14 +3558,14 @@ discard block |
||
| 3558 | 3558 | } |
| 3559 | 3559 | |
| 3560 | 3560 | // Build options |
| 3561 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 3561 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 3562 | 3562 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 3563 | 3563 | if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) { |
| 3564 | - $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 . '"'; |
|
| 3564 | + $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.'"'; |
|
| 3565 | 3565 | } |
| 3566 | 3566 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) { |
| 3567 | - $opt .= ' data-labeltrans="' . $outlabel_translated . '"'; |
|
| 3568 | - $opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"'; |
|
| 3567 | + $opt .= ' data-labeltrans="'.$outlabel_translated.'"'; |
|
| 3568 | + $opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"'; |
|
| 3569 | 3569 | } |
| 3570 | 3570 | |
| 3571 | 3571 | if ($stocktag == 1) { |
@@ -3660,7 +3660,7 @@ discard block |
||
| 3660 | 3660 | $selected_input_value = ''; |
| 3661 | 3661 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) { |
| 3662 | 3662 | if ($selected > 0) { |
| 3663 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 3663 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 3664 | 3664 | $producttmpselect = new Product($this->db); |
| 3665 | 3665 | $producttmpselect->fetch($selected); |
| 3666 | 3666 | $selected_input_value = $producttmpselect->ref; |
@@ -3668,10 +3668,10 @@ discard block |
||
| 3668 | 3668 | } |
| 3669 | 3669 | |
| 3670 | 3670 | // mode=2 means suppliers products |
| 3671 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice; |
|
| 3672 | - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions); |
|
| 3671 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; |
|
| 3672 | + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions); |
|
| 3673 | 3673 | |
| 3674 | - print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="'.$morecss.'" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>'; |
|
| 3674 | + print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>'; |
|
| 3675 | 3675 | } else { |
| 3676 | 3676 | print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); |
| 3677 | 3677 | } |
@@ -3729,25 +3729,25 @@ discard block |
||
| 3729 | 3729 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3730 | 3730 | $sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units"; |
| 3731 | 3731 | } |
| 3732 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
| 3733 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )"; |
|
| 3732 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
| 3733 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )"; |
|
| 3734 | 3734 | if ($socid > 0) { |
| 3735 | - $sql .= " AND pfp.fk_soc = " . ((int) $socid); |
|
| 3735 | + $sql .= " AND pfp.fk_soc = ".((int) $socid); |
|
| 3736 | 3736 | } |
| 3737 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3737 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3738 | 3738 | // Units |
| 3739 | 3739 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3740 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
| 3740 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
| 3741 | 3741 | } |
| 3742 | - $sql .= " WHERE p.entity IN (" . getEntity('product') . ")"; |
|
| 3742 | + $sql .= " WHERE p.entity IN (".getEntity('product').")"; |
|
| 3743 | 3743 | if ($statut != -1) { |
| 3744 | - $sql .= " AND p.tobuy = " . ((int) $statut); |
|
| 3744 | + $sql .= " AND p.tobuy = ".((int) $statut); |
|
| 3745 | 3745 | } |
| 3746 | 3746 | if (strval($filtertype) != '') { |
| 3747 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
| 3747 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
| 3748 | 3748 | } |
| 3749 | 3749 | if (!empty($filtre)) { |
| 3750 | - $sql .= " " . $filtre; |
|
| 3750 | + $sql .= " ".$filtre; |
|
| 3751 | 3751 | } |
| 3752 | 3752 | // Add where from hooks |
| 3753 | 3753 | $parameters = array(); |
@@ -3767,9 +3767,9 @@ discard block |
||
| 3767 | 3767 | if ($i > 0) { |
| 3768 | 3768 | $sql .= " AND "; |
| 3769 | 3769 | } |
| 3770 | - $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) . "%'"; |
|
| 3770 | + $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)."%'"; |
|
| 3771 | 3771 | if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) { |
| 3772 | - $sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3772 | + $sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3773 | 3773 | } |
| 3774 | 3774 | $sql .= ")"; |
| 3775 | 3775 | $i++; |
@@ -3778,8 +3778,8 @@ discard block |
||
| 3778 | 3778 | $sql .= ")"; |
| 3779 | 3779 | } |
| 3780 | 3780 | if (isModEnabled('barcode')) { |
| 3781 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3782 | - $sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3781 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3782 | + $sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3783 | 3783 | } |
| 3784 | 3784 | $sql .= ')'; |
| 3785 | 3785 | } |
@@ -3788,20 +3788,20 @@ discard block |
||
| 3788 | 3788 | |
| 3789 | 3789 | // Build output string |
| 3790 | 3790 | |
| 3791 | - dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG); |
|
| 3791 | + dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG); |
|
| 3792 | 3792 | $result = $this->db->query($sql); |
| 3793 | 3793 | if ($result) { |
| 3794 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3795 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 3794 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3795 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 3796 | 3796 | |
| 3797 | 3797 | $num = $this->db->num_rows($result); |
| 3798 | 3798 | |
| 3799 | 3799 | //$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax |
| 3800 | - $out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 3800 | + $out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 3801 | 3801 | if (!$selected) { |
| 3802 | - $out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
| 3802 | + $out .= '<option value="-1" selected>'.($placeholder ? $placeholder : ' ').'</option>'; |
|
| 3803 | 3803 | } else { |
| 3804 | - $out .= '<option value="-1">' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
| 3804 | + $out .= '<option value="-1">'.($placeholder ? $placeholder : ' ').'</option>'; |
|
| 3805 | 3805 | } |
| 3806 | 3806 | |
| 3807 | 3807 | $i = 0; |
@@ -3816,7 +3816,7 @@ discard block |
||
| 3816 | 3816 | |
| 3817 | 3817 | $outkey = $objp->idprodfournprice; // id in table of price |
| 3818 | 3818 | if (!$outkey && $alsoproductwithnosupplierprice) { |
| 3819 | - $outkey = 'idprod_' . $objp->rowid; // id of product |
|
| 3819 | + $outkey = 'idprod_'.$objp->rowid; // id of product |
|
| 3820 | 3820 | } |
| 3821 | 3821 | |
| 3822 | 3822 | $outref = $objp->ref; |
@@ -3831,23 +3831,23 @@ discard block |
||
| 3831 | 3831 | $outvalUnits = ''; |
| 3832 | 3832 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3833 | 3833 | if (!empty($objp->unit_short)) { |
| 3834 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
| 3834 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
| 3835 | 3835 | } |
| 3836 | 3836 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
| 3837 | 3837 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
| 3838 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3838 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3839 | 3839 | } |
| 3840 | 3840 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
| 3841 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
| 3842 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3841 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
| 3842 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3843 | 3843 | } |
| 3844 | 3844 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
| 3845 | 3845 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
| 3846 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3846 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3847 | 3847 | } |
| 3848 | 3848 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
| 3849 | 3849 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
| 3850 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3850 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3851 | 3851 | } |
| 3852 | 3852 | if ($outdurationvalue && $outdurationunit) { |
| 3853 | 3853 | $da = array( |
@@ -3858,22 +3858,22 @@ discard block |
||
| 3858 | 3858 | 'y' => $langs->trans('Year') |
| 3859 | 3859 | ); |
| 3860 | 3860 | if (isset($da[$outdurationunit])) { |
| 3861 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
| 3861 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
| 3862 | 3862 | } |
| 3863 | 3863 | } |
| 3864 | 3864 | } |
| 3865 | 3865 | |
| 3866 | 3866 | $objRef = $objp->ref; |
| 3867 | 3867 | if ($filterkey && $filterkey != '') { |
| 3868 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3868 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3869 | 3869 | } |
| 3870 | 3870 | $objRefFourn = $objp->ref_fourn; |
| 3871 | 3871 | if ($filterkey && $filterkey != '') { |
| 3872 | - $objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
| 3872 | + $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
| 3873 | 3873 | } |
| 3874 | 3874 | $label = $objp->label; |
| 3875 | 3875 | if ($filterkey && $filterkey != '') { |
| 3876 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
| 3876 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
| 3877 | 3877 | } |
| 3878 | 3878 | |
| 3879 | 3879 | switch ($objp->fk_product_type) { |
@@ -3896,21 +3896,21 @@ discard block |
||
| 3896 | 3896 | |
| 3897 | 3897 | $optlabel .= $objp->ref; |
| 3898 | 3898 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
| 3899 | - $optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>'; |
|
| 3899 | + $optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>'; |
|
| 3900 | 3900 | } |
| 3901 | 3901 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
| 3902 | - $optlabel .= ' (' . $outbarcode . ')'; |
|
| 3902 | + $optlabel .= ' ('.$outbarcode.')'; |
|
| 3903 | 3903 | } |
| 3904 | - $optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3904 | + $optlabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3905 | 3905 | |
| 3906 | 3906 | $outvallabel = $objRef; |
| 3907 | 3907 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
| 3908 | - $outvallabel .= ' (' . $objRefFourn . ')'; |
|
| 3908 | + $outvallabel .= ' ('.$objRefFourn.')'; |
|
| 3909 | 3909 | } |
| 3910 | 3910 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
| 3911 | - $outvallabel .= ' (' . $outbarcode . ')'; |
|
| 3911 | + $outvallabel .= ' ('.$outbarcode.')'; |
|
| 3912 | 3912 | } |
| 3913 | - $outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3913 | + $outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3914 | 3914 | |
| 3915 | 3915 | // Units |
| 3916 | 3916 | $optlabel .= $outvalUnits; |
@@ -3927,7 +3927,7 @@ discard block |
||
| 3927 | 3927 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
| 3928 | 3928 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
| 3929 | 3929 | |
| 3930 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3930 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3931 | 3931 | $priceparser = new PriceParser($this->db); |
| 3932 | 3932 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
| 3933 | 3933 | if ($price_result >= 0) { |
@@ -3938,57 +3938,57 @@ discard block |
||
| 3938 | 3938 | } |
| 3939 | 3939 | } |
| 3940 | 3940 | if ($objp->quantity == 1) { |
| 3941 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3942 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3941 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3942 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3943 | 3943 | $optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
| 3944 | 3944 | $outvallabel .= $langs->transnoentities("Unit"); |
| 3945 | 3945 | } else { |
| 3946 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3947 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3948 | - $optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
| 3949 | - $outvallabel .= ' ' . $langs->transnoentities("Units"); |
|
| 3946 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3947 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3948 | + $optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
| 3949 | + $outvallabel .= ' '.$langs->transnoentities("Units"); |
|
| 3950 | 3950 | } |
| 3951 | 3951 | |
| 3952 | 3952 | if ($objp->quantity > 1) { |
| 3953 | - $optlabel .= " (" . price($objp->unitprice * (getDolGlobalString('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 |
|
| 3954 | - $outvallabel .= " (" . price($objp->unitprice * (getDolGlobalString('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 |
|
| 3953 | + $optlabel .= " (".price($objp->unitprice * (getDolGlobalString('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 |
|
| 3954 | + $outvallabel .= " (".price($objp->unitprice * (getDolGlobalString('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 |
|
| 3955 | 3955 | } |
| 3956 | 3956 | if ($objp->remise_percent >= 1) { |
| 3957 | - $optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3958 | - $outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3957 | + $optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3958 | + $outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3959 | 3959 | } |
| 3960 | 3960 | if ($objp->duration) { |
| 3961 | - $optlabel .= " - " . $objp->duration; |
|
| 3962 | - $outvallabel .= " - " . $objp->duration; |
|
| 3961 | + $optlabel .= " - ".$objp->duration; |
|
| 3962 | + $outvallabel .= " - ".$objp->duration; |
|
| 3963 | 3963 | } |
| 3964 | 3964 | if (!$socid) { |
| 3965 | - $optlabel .= " - " . dol_trunc($objp->name, 8); |
|
| 3966 | - $outvallabel .= " - " . dol_trunc($objp->name, 8); |
|
| 3965 | + $optlabel .= " - ".dol_trunc($objp->name, 8); |
|
| 3966 | + $outvallabel .= " - ".dol_trunc($objp->name, 8); |
|
| 3967 | 3967 | } |
| 3968 | 3968 | if ($objp->supplier_reputation) { |
| 3969 | 3969 | //TODO dictionary |
| 3970 | 3970 | $reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier')); |
| 3971 | 3971 | |
| 3972 | - $optlabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
| 3973 | - $outvallabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
| 3972 | + $optlabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
| 3973 | + $outvallabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
| 3974 | 3974 | } |
| 3975 | 3975 | } else { |
| 3976 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
| 3977 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3976 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
| 3977 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3978 | 3978 | } |
| 3979 | 3979 | |
| 3980 | 3980 | if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
| 3981 | 3981 | $novirtualstock = ($showstockinlist == 2); |
| 3982 | 3982 | |
| 3983 | 3983 | if ($user->hasRight('stock', 'lire')) { |
| 3984 | - $outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 3984 | + $outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 3985 | 3985 | |
| 3986 | 3986 | if ($objp->stock > 0) { |
| 3987 | 3987 | $optlabel .= ' - <span class="product_line_stock_ok">'; |
| 3988 | 3988 | } elseif ($objp->stock <= 0) { |
| 3989 | 3989 | $optlabel .= ' - <span class="product_line_stock_too_low">'; |
| 3990 | 3990 | } |
| 3991 | - $optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS')); |
|
| 3991 | + $optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS')); |
|
| 3992 | 3992 | $optlabel .= '</span>'; |
| 3993 | 3993 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
| 3994 | 3994 | $langs->load("stocks"); |
@@ -3998,9 +3998,9 @@ discard block |
||
| 3998 | 3998 | $tmpproduct->load_virtual_stock(); |
| 3999 | 3999 | $virtualstock = $tmpproduct->stock_theorique; |
| 4000 | 4000 | |
| 4001 | - $outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
| 4001 | + $outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
| 4002 | 4002 | |
| 4003 | - $optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
| 4003 | + $optlabel .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
| 4004 | 4004 | if ($virtualstock > 0) { |
| 4005 | 4005 | $optlabel .= '<span class="product_line_stock_ok">'; |
| 4006 | 4006 | } elseif ($virtualstock <= 0) { |
@@ -4014,7 +4014,7 @@ discard block |
||
| 4014 | 4014 | } |
| 4015 | 4015 | } |
| 4016 | 4016 | |
| 4017 | - $optstart = '<option value="' . $outkey . '"'; |
|
| 4017 | + $optstart = '<option value="'.$outkey.'"'; |
|
| 4018 | 4018 | if ($selected && $selected == $objp->idprodfournprice) { |
| 4019 | 4019 | $optstart .= ' selected'; |
| 4020 | 4020 | } |
@@ -4023,31 +4023,31 @@ discard block |
||
| 4023 | 4023 | } |
| 4024 | 4024 | |
| 4025 | 4025 | if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { |
| 4026 | - $optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"'; |
|
| 4027 | - $optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"'; |
|
| 4028 | - $optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"'; |
|
| 4029 | - $optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"'; |
|
| 4030 | - $optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"'; |
|
| 4031 | - $optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"'; |
|
| 4032 | - $optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"'; |
|
| 4033 | - $optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"'; |
|
| 4034 | - $optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"'; |
|
| 4035 | - $optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"'; |
|
| 4026 | + $optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"'; |
|
| 4027 | + $optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"'; |
|
| 4028 | + $optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"'; |
|
| 4029 | + $optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"'; |
|
| 4030 | + $optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"'; |
|
| 4031 | + $optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"'; |
|
| 4032 | + $optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"'; |
|
| 4033 | + $optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"'; |
|
| 4034 | + $optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"'; |
|
| 4035 | + $optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"'; |
|
| 4036 | 4036 | if (isModEnabled('multicurrency')) { |
| 4037 | - $optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"'; |
|
| 4038 | - $optstart .= ' data-multicurrency-up="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"'; |
|
| 4037 | + $optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"'; |
|
| 4038 | + $optstart .= ' data-multicurrency-up="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"'; |
|
| 4039 | 4039 | } |
| 4040 | 4040 | } |
| 4041 | - $optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"'; |
|
| 4041 | + $optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; |
|
| 4042 | 4042 | |
| 4043 | 4043 | $outarrayentry = array( |
| 4044 | 4044 | 'key' => $outkey, |
| 4045 | 4045 | 'value' => $outref, |
| 4046 | 4046 | 'label' => $outvallabel, |
| 4047 | 4047 | 'qty' => $outqty, |
| 4048 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 4049 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 4050 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 4048 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 4049 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 4050 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 4051 | 4051 | 'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2), |
| 4052 | 4052 | 'tva_tx' => price2num($objp->tva_tx), |
| 4053 | 4053 | 'default_vat_code' => $objp->default_vat_code, |
@@ -4078,17 +4078,17 @@ discard block |
||
| 4078 | 4078 | // Add new entry |
| 4079 | 4079 | // "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 |
| 4080 | 4080 | // "label" value of json key array is used by jQuery automatically as text for combo box |
| 4081 | - $out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n"; |
|
| 4081 | + $out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n"; |
|
| 4082 | 4082 | $outarraypush = array( |
| 4083 | 4083 | 'key' => $outkey, |
| 4084 | 4084 | 'value' => $outref, |
| 4085 | 4085 | 'label' => $outvallabel, |
| 4086 | 4086 | 'qty' => $outqty, |
| 4087 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 4087 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 4088 | 4088 | 'price_qty_ht_locale' => price($objp->fprice), |
| 4089 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 4089 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 4090 | 4090 | 'price_unit_ht_locale' => price($objp->unitprice), |
| 4091 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 4091 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 4092 | 4092 | 'tva_tx_formated' => price($objp->tva_tx), |
| 4093 | 4093 | 'tva_tx' => price2num($objp->tva_tx), |
| 4094 | 4094 | 'default_vat_code' => $objp->default_vat_code, |
@@ -4121,7 +4121,7 @@ discard block |
||
| 4121 | 4121 | |
| 4122 | 4122 | $this->db->free($result); |
| 4123 | 4123 | |
| 4124 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 4124 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 4125 | 4125 | $out .= ajax_combobox($htmlname); |
| 4126 | 4126 | } else { |
| 4127 | 4127 | dol_print_error($this->db); |
@@ -4153,43 +4153,43 @@ discard block |
||
| 4153 | 4153 | $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,"; |
| 4154 | 4154 | $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,"; |
| 4155 | 4155 | $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name"; |
| 4156 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
| 4157 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 4158 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
| 4159 | - $sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")"; |
|
| 4156 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
| 4157 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 4158 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
| 4159 | + $sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")"; |
|
| 4160 | 4160 | $sql .= " AND p.tobuy = 1"; |
| 4161 | 4161 | $sql .= " AND s.fournisseur = 1"; |
| 4162 | - $sql .= " AND p.rowid = " . ((int) $productid); |
|
| 4162 | + $sql .= " AND p.rowid = ".((int) $productid); |
|
| 4163 | 4163 | if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) { |
| 4164 | 4164 | $sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; |
| 4165 | 4165 | } else { |
| 4166 | 4166 | $sql .= " ORDER BY pfp.unitprice ASC"; |
| 4167 | 4167 | } |
| 4168 | 4168 | |
| 4169 | - dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG); |
|
| 4169 | + dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG); |
|
| 4170 | 4170 | $result = $this->db->query($sql); |
| 4171 | 4171 | |
| 4172 | 4172 | if ($result) { |
| 4173 | 4173 | $num = $this->db->num_rows($result); |
| 4174 | 4174 | |
| 4175 | - $form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4175 | + $form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4176 | 4176 | |
| 4177 | 4177 | if (!$num) { |
| 4178 | - $form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>'; |
|
| 4178 | + $form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>'; |
|
| 4179 | 4179 | } else { |
| 4180 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 4180 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 4181 | 4181 | $form .= '<option value="0"> </option>'; |
| 4182 | 4182 | |
| 4183 | 4183 | $i = 0; |
| 4184 | 4184 | while ($i < $num) { |
| 4185 | 4185 | $objp = $this->db->fetch_object($result); |
| 4186 | 4186 | |
| 4187 | - $opt = '<option value="' . $objp->idprodfournprice . '"'; |
|
| 4187 | + $opt = '<option value="'.$objp->idprodfournprice.'"'; |
|
| 4188 | 4188 | //if there is only one supplier, preselect it |
| 4189 | 4189 | if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) { |
| 4190 | 4190 | $opt .= ' selected'; |
| 4191 | 4191 | } |
| 4192 | - $opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - '; |
|
| 4192 | + $opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - '; |
|
| 4193 | 4193 | |
| 4194 | 4194 | if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) { |
| 4195 | 4195 | $prod_supplier = new ProductFournisseur($this->db); |
@@ -4199,7 +4199,7 @@ discard block |
||
| 4199 | 4199 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
| 4200 | 4200 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
| 4201 | 4201 | |
| 4202 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 4202 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 4203 | 4203 | $priceparser = new PriceParser($this->db); |
| 4204 | 4204 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
| 4205 | 4205 | if ($price_result >= 0) { |
@@ -4210,10 +4210,10 @@ discard block |
||
| 4210 | 4210 | } |
| 4211 | 4211 | } |
| 4212 | 4212 | if ($objp->quantity == 1) { |
| 4213 | - $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 4213 | + $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 4214 | 4214 | } |
| 4215 | 4215 | |
| 4216 | - $opt .= $objp->quantity . ' '; |
|
| 4216 | + $opt .= $objp->quantity.' '; |
|
| 4217 | 4217 | |
| 4218 | 4218 | if ($objp->quantity == 1) { |
| 4219 | 4219 | $opt .= $langs->trans("Unit"); |
@@ -4222,10 +4222,10 @@ discard block |
||
| 4222 | 4222 | } |
| 4223 | 4223 | if ($objp->quantity > 1) { |
| 4224 | 4224 | $opt .= " - "; |
| 4225 | - $opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit"); |
|
| 4225 | + $opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit"); |
|
| 4226 | 4226 | } |
| 4227 | 4227 | if ($objp->duration) { |
| 4228 | - $opt .= " - " . $objp->duration; |
|
| 4228 | + $opt .= " - ".$objp->duration; |
|
| 4229 | 4229 | } |
| 4230 | 4230 | $opt .= "</option>\n"; |
| 4231 | 4231 | |
@@ -4263,8 +4263,8 @@ discard block |
||
| 4263 | 4263 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 4264 | 4264 | |
| 4265 | 4265 | $sql = "SELECT rowid, code, libelle as label, deposit_percent"; |
| 4266 | - $sql .= " FROM " . $this->db->prefix() . 'c_payment_term'; |
|
| 4267 | - $sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")"; |
|
| 4266 | + $sql .= " FROM ".$this->db->prefix().'c_payment_term'; |
|
| 4267 | + $sql .= " WHERE entity IN (".getEntity('c_payment_term').")"; |
|
| 4268 | 4268 | $sql .= " AND active > 0"; |
| 4269 | 4269 | $sql .= " ORDER BY sortorder"; |
| 4270 | 4270 | |
@@ -4276,7 +4276,7 @@ discard block |
||
| 4276 | 4276 | $obj = $this->db->fetch_object($resql); |
| 4277 | 4277 | |
| 4278 | 4278 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4279 | - $label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4279 | + $label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4280 | 4280 | $this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code; |
| 4281 | 4281 | $this->cache_conditions_paiements[$obj->rowid]['label'] = $label; |
| 4282 | 4282 | $this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent; |
@@ -4304,7 +4304,7 @@ discard block |
||
| 4304 | 4304 | // phpcs:enable |
| 4305 | 4305 | global $langs; |
| 4306 | 4306 | |
| 4307 | - $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
| 4307 | + $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
| 4308 | 4308 | if ($num > 0) { |
| 4309 | 4309 | return 0; // Cache already loaded |
| 4310 | 4310 | } |
@@ -4314,7 +4314,7 @@ discard block |
||
| 4314 | 4314 | $langs->load('propal'); |
| 4315 | 4315 | |
| 4316 | 4316 | $sql = "SELECT rowid, code, label, position"; |
| 4317 | - $sql .= " FROM " . $this->db->prefix() . 'c_availability'; |
|
| 4317 | + $sql .= " FROM ".$this->db->prefix().'c_availability'; |
|
| 4318 | 4318 | $sql .= " WHERE active > 0"; |
| 4319 | 4319 | |
| 4320 | 4320 | $resql = $this->db->query($sql); |
@@ -4325,7 +4325,7 @@ discard block |
||
| 4325 | 4325 | $obj = $this->db->fetch_object($resql); |
| 4326 | 4326 | |
| 4327 | 4327 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4328 | - $label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4328 | + $label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4329 | 4329 | $this->cache_availability[$obj->rowid]['code'] = $obj->code; |
| 4330 | 4330 | $this->cache_availability[$obj->rowid]['label'] = $label; |
| 4331 | 4331 | $this->cache_availability[$obj->rowid]['position'] = $obj->position; |
@@ -4357,17 +4357,17 @@ discard block |
||
| 4357 | 4357 | |
| 4358 | 4358 | $this->load_cache_availability(); |
| 4359 | 4359 | |
| 4360 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 4360 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 4361 | 4361 | |
| 4362 | - print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4362 | + print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4363 | 4363 | if ($addempty) { |
| 4364 | 4364 | print '<option value="0"> </option>'; |
| 4365 | 4365 | } |
| 4366 | 4366 | foreach ($this->cache_availability as $id => $arrayavailability) { |
| 4367 | 4367 | if ($selected == $id) { |
| 4368 | - print '<option value="' . $id . '" selected>'; |
|
| 4368 | + print '<option value="'.$id.'" selected>'; |
|
| 4369 | 4369 | } else { |
| 4370 | - print '<option value="' . $id . '">'; |
|
| 4370 | + print '<option value="'.$id.'">'; |
|
| 4371 | 4371 | } |
| 4372 | 4372 | print dol_escape_htmltag($arrayavailability['label']); |
| 4373 | 4373 | print '</option>'; |
@@ -4388,13 +4388,13 @@ discard block |
||
| 4388 | 4388 | { |
| 4389 | 4389 | global $langs; |
| 4390 | 4390 | |
| 4391 | - $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
| 4391 | + $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
| 4392 | 4392 | if ($num > 0) { |
| 4393 | 4393 | return 0; // Cache already loaded |
| 4394 | 4394 | } |
| 4395 | 4395 | |
| 4396 | 4396 | $sql = "SELECT rowid, code, label"; |
| 4397 | - $sql .= " FROM " . $this->db->prefix() . 'c_input_reason'; |
|
| 4397 | + $sql .= " FROM ".$this->db->prefix().'c_input_reason'; |
|
| 4398 | 4398 | $sql .= " WHERE active > 0"; |
| 4399 | 4399 | |
| 4400 | 4400 | $resql = $this->db->query($sql); |
@@ -4407,8 +4407,8 @@ discard block |
||
| 4407 | 4407 | |
| 4408 | 4408 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4409 | 4409 | $label = ($obj->label != '-' ? $obj->label : ''); |
| 4410 | - if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) { |
|
| 4411 | - $label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
| 4410 | + if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) { |
|
| 4411 | + $label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
| 4412 | 4412 | } |
| 4413 | 4413 | if ($langs->trans($obj->code) != $obj->code) { |
| 4414 | 4414 | $label = $langs->trans($obj->code); // So translation key SRC_XXX will work |
@@ -4448,9 +4448,9 @@ discard block |
||
| 4448 | 4448 | |
| 4449 | 4449 | $this->loadCacheInputReason(); |
| 4450 | 4450 | |
| 4451 | - print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4451 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4452 | 4452 | if ($addempty) { |
| 4453 | - print '<option value="0"' . (empty($selected) ? ' selected' : '') . '> </option>'; |
|
| 4453 | + print '<option value="0"'.(empty($selected) ? ' selected' : '').'> </option>'; |
|
| 4454 | 4454 | } |
| 4455 | 4455 | foreach ($this->cache_demand_reason as $id => $arraydemandreason) { |
| 4456 | 4456 | if ($arraydemandreason['code'] == $exclude) { |
@@ -4458,9 +4458,9 @@ discard block |
||
| 4458 | 4458 | } |
| 4459 | 4459 | |
| 4460 | 4460 | if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) { |
| 4461 | - print '<option value="' . $arraydemandreason['id'] . '" selected>'; |
|
| 4461 | + print '<option value="'.$arraydemandreason['id'].'" selected>'; |
|
| 4462 | 4462 | } else { |
| 4463 | - print '<option value="' . $arraydemandreason['id'] . '">'; |
|
| 4463 | + print '<option value="'.$arraydemandreason['id'].'">'; |
|
| 4464 | 4464 | } |
| 4465 | 4465 | $label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason |
| 4466 | 4466 | print $langs->trans($label); |
@@ -4470,7 +4470,7 @@ discard block |
||
| 4470 | 4470 | if ($user->admin && empty($notooltip)) { |
| 4471 | 4471 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4472 | 4472 | } |
| 4473 | - print ajax_combobox('select_' . $htmlname); |
|
| 4473 | + print ajax_combobox('select_'.$htmlname); |
|
| 4474 | 4474 | } |
| 4475 | 4475 | |
| 4476 | 4476 | // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
@@ -4485,7 +4485,7 @@ discard block |
||
| 4485 | 4485 | // phpcs:enable |
| 4486 | 4486 | global $langs; |
| 4487 | 4487 | |
| 4488 | - $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
| 4488 | + $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
| 4489 | 4489 | if ($num > 0) { |
| 4490 | 4490 | return $num; // Cache already loaded |
| 4491 | 4491 | } |
@@ -4495,8 +4495,8 @@ discard block |
||
| 4495 | 4495 | $this->cache_types_paiements = array(); |
| 4496 | 4496 | |
| 4497 | 4497 | $sql = "SELECT id, code, libelle as label, type, active"; |
| 4498 | - $sql .= " FROM " . $this->db->prefix() . "c_paiement"; |
|
| 4499 | - $sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")"; |
|
| 4498 | + $sql .= " FROM ".$this->db->prefix()."c_paiement"; |
|
| 4499 | + $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; |
|
| 4500 | 4500 | |
| 4501 | 4501 | $resql = $this->db->query($sql); |
| 4502 | 4502 | if ($resql) { |
@@ -4506,7 +4506,7 @@ discard block |
||
| 4506 | 4506 | $obj = $this->db->fetch_object($resql); |
| 4507 | 4507 | |
| 4508 | 4508 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4509 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4509 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4510 | 4510 | $this->cache_types_paiements[$obj->id]['id'] = $obj->id; |
| 4511 | 4511 | $this->cache_types_paiements[$obj->id]['code'] = $obj->code; |
| 4512 | 4512 | $this->cache_types_paiements[$obj->id]['label'] = $label; |
@@ -4578,17 +4578,17 @@ discard block |
||
| 4578 | 4578 | global $langs, $user, $conf; |
| 4579 | 4579 | |
| 4580 | 4580 | $out = ''; |
| 4581 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 4581 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 4582 | 4582 | |
| 4583 | 4583 | $this->load_cache_conditions_paiements(); |
| 4584 | 4584 | |
| 4585 | 4585 | // Set default value if not already set by caller |
| 4586 | 4586 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) { |
| 4587 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
| 4587 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
| 4588 | 4588 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
| 4589 | 4589 | } |
| 4590 | 4590 | |
| 4591 | - $out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4591 | + $out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4592 | 4592 | if ($addempty) { |
| 4593 | 4593 | $out .= '<option value="0"> </option>'; |
| 4594 | 4594 | } |
@@ -4602,9 +4602,9 @@ discard block |
||
| 4602 | 4602 | |
| 4603 | 4603 | if ($selected == $id) { |
| 4604 | 4604 | $selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent']; |
| 4605 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>'; |
|
| 4605 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>'; |
|
| 4606 | 4606 | } else { |
| 4607 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">'; |
|
| 4607 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">'; |
|
| 4608 | 4608 | } |
| 4609 | 4609 | $label = $arrayconditions['label']; |
| 4610 | 4610 | |
@@ -4622,21 +4622,21 @@ discard block |
||
| 4622 | 4622 | $out .= ajax_combobox($htmlname); |
| 4623 | 4623 | |
| 4624 | 4624 | if ($deposit_percent >= 0) { |
| 4625 | - $out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>'; |
|
| 4626 | - $out .= $langs->trans('DepositPercent') . ' : '; |
|
| 4627 | - $out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />'; |
|
| 4625 | + $out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>'; |
|
| 4626 | + $out .= $langs->trans('DepositPercent').' : '; |
|
| 4627 | + $out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />'; |
|
| 4628 | 4628 | $out .= '</span>'; |
| 4629 | 4629 | $out .= ' |
| 4630 | - <script nonce="' . getNonce() . '"> |
|
| 4630 | + <script nonce="' . getNonce().'"> |
|
| 4631 | 4631 | $(document).ready(function () { |
| 4632 | - $("#' . $htmlname . '").change(function () { |
|
| 4632 | + $("#' . $htmlname.'").change(function () { |
|
| 4633 | 4633 | let $selected = $(this).find("option:selected"); |
| 4634 | 4634 | let depositPercent = $selected.attr("data-deposit_percent"); |
| 4635 | 4635 | |
| 4636 | 4636 | if (depositPercent.length > 0) { |
| 4637 | - $("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent); |
|
| 4637 | + $("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent); |
|
| 4638 | 4638 | } else { |
| 4639 | - $("#' . $htmlname . '_deposit_percent_container").hide(); |
|
| 4639 | + $("#' . $htmlname.'_deposit_percent_container").hide(); |
|
| 4640 | 4640 | } |
| 4641 | 4641 | |
| 4642 | 4642 | return true; |
@@ -4674,7 +4674,7 @@ discard block |
||
| 4674 | 4674 | |
| 4675 | 4675 | $out = ''; |
| 4676 | 4676 | |
| 4677 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG); |
|
| 4677 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); |
|
| 4678 | 4678 | |
| 4679 | 4679 | $filterarray = array(); |
| 4680 | 4680 | if ($filtertype == 'CRDT') { |
@@ -4689,11 +4689,11 @@ discard block |
||
| 4689 | 4689 | |
| 4690 | 4690 | // Set default value if not already set by caller |
| 4691 | 4691 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) { |
| 4692 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
| 4692 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
| 4693 | 4693 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
| 4694 | 4694 | } |
| 4695 | 4695 | |
| 4696 | - $out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4696 | + $out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4697 | 4697 | if ($empty) { |
| 4698 | 4698 | $out .= '<option value=""> </option>'; |
| 4699 | 4699 | } |
@@ -4714,13 +4714,13 @@ discard block |
||
| 4714 | 4714 | } |
| 4715 | 4715 | |
| 4716 | 4716 | if ($format == 0) { |
| 4717 | - $out .= '<option value="' . $id . '"'; |
|
| 4717 | + $out .= '<option value="'.$id.'"'; |
|
| 4718 | 4718 | } elseif ($format == 1) { |
| 4719 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
| 4719 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
| 4720 | 4720 | } elseif ($format == 2) { |
| 4721 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
| 4721 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
| 4722 | 4722 | } elseif ($format == 3) { |
| 4723 | - $out .= '<option value="' . $id . '"'; |
|
| 4723 | + $out .= '<option value="'.$id.'"'; |
|
| 4724 | 4724 | } |
| 4725 | 4725 | // Print attribute selected or not |
| 4726 | 4726 | if ($format == 1 || $format == 2) { |
@@ -4750,7 +4750,7 @@ discard block |
||
| 4750 | 4750 | if ($user->admin && !$noadmininfo) { |
| 4751 | 4751 | $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4752 | 4752 | } |
| 4753 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 4753 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 4754 | 4754 | |
| 4755 | 4755 | if (empty($nooutput)) { |
| 4756 | 4756 | print $out; |
@@ -4772,22 +4772,22 @@ discard block |
||
| 4772 | 4772 | { |
| 4773 | 4773 | global $langs; |
| 4774 | 4774 | |
| 4775 | - $return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4775 | + $return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4776 | 4776 | $options = array( |
| 4777 | 4777 | 'HT' => $langs->trans("HT"), |
| 4778 | 4778 | 'TTC' => $langs->trans("TTC") |
| 4779 | 4779 | ); |
| 4780 | 4780 | foreach ($options as $id => $value) { |
| 4781 | 4781 | if ($selected == $id) { |
| 4782 | - $return .= '<option value="' . $id . '" selected>' . $value; |
|
| 4782 | + $return .= '<option value="'.$id.'" selected>'.$value; |
|
| 4783 | 4783 | } else { |
| 4784 | - $return .= '<option value="' . $id . '">' . $value; |
|
| 4784 | + $return .= '<option value="'.$id.'">'.$value; |
|
| 4785 | 4785 | } |
| 4786 | 4786 | $return .= '</option>'; |
| 4787 | 4787 | } |
| 4788 | 4788 | $return .= '</select>'; |
| 4789 | 4789 | if ($addjscombo) { |
| 4790 | - $return .= ajax_combobox('select_' . $htmlname); |
|
| 4790 | + $return .= ajax_combobox('select_'.$htmlname); |
|
| 4791 | 4791 | } |
| 4792 | 4792 | |
| 4793 | 4793 | return $return; |
@@ -4805,7 +4805,7 @@ discard block |
||
| 4805 | 4805 | // phpcs:enable |
| 4806 | 4806 | global $langs; |
| 4807 | 4807 | |
| 4808 | - $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
| 4808 | + $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
| 4809 | 4809 | if ($num > 0) { |
| 4810 | 4810 | return $num; // Cache already loaded |
| 4811 | 4811 | } |
@@ -4815,8 +4815,8 @@ discard block |
||
| 4815 | 4815 | $this->cache_transport_mode = array(); |
| 4816 | 4816 | |
| 4817 | 4817 | $sql = "SELECT rowid, code, label, active"; |
| 4818 | - $sql .= " FROM " . $this->db->prefix() . "c_transport_mode"; |
|
| 4819 | - $sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")"; |
|
| 4818 | + $sql .= " FROM ".$this->db->prefix()."c_transport_mode"; |
|
| 4819 | + $sql .= " WHERE entity IN (".getEntity('c_transport_mode').")"; |
|
| 4820 | 4820 | |
| 4821 | 4821 | $resql = $this->db->query($sql); |
| 4822 | 4822 | if ($resql) { |
@@ -4826,7 +4826,7 @@ discard block |
||
| 4826 | 4826 | $obj = $this->db->fetch_object($resql); |
| 4827 | 4827 | |
| 4828 | 4828 | // If traduction exist, we use it else we take the default label |
| 4829 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4829 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4830 | 4830 | $this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid; |
| 4831 | 4831 | $this->cache_transport_mode[$obj->rowid]['code'] = $obj->code; |
| 4832 | 4832 | $this->cache_transport_mode[$obj->rowid]['label'] = $label; |
@@ -4860,11 +4860,11 @@ discard block |
||
| 4860 | 4860 | { |
| 4861 | 4861 | global $langs, $user; |
| 4862 | 4862 | |
| 4863 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG); |
|
| 4863 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG); |
|
| 4864 | 4864 | |
| 4865 | 4865 | $this->load_cache_transport_mode(); |
| 4866 | 4866 | |
| 4867 | - print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4867 | + print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4868 | 4868 | if ($empty) { |
| 4869 | 4869 | print '<option value=""> </option>'; |
| 4870 | 4870 | } |
@@ -4880,13 +4880,13 @@ discard block |
||
| 4880 | 4880 | } |
| 4881 | 4881 | |
| 4882 | 4882 | if ($format == 0) { |
| 4883 | - print '<option value="' . $id . '"'; |
|
| 4883 | + print '<option value="'.$id.'"'; |
|
| 4884 | 4884 | } elseif ($format == 1) { |
| 4885 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
| 4885 | + print '<option value="'.$arraytypes['code'].'"'; |
|
| 4886 | 4886 | } elseif ($format == 2) { |
| 4887 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
| 4887 | + print '<option value="'.$arraytypes['code'].'"'; |
|
| 4888 | 4888 | } elseif ($format == 3) { |
| 4889 | - print '<option value="' . $id . '"'; |
|
| 4889 | + print '<option value="'.$id.'"'; |
|
| 4890 | 4890 | } |
| 4891 | 4891 | // If text is selected, we compare with code, else with id |
| 4892 | 4892 | if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) { |
@@ -4934,31 +4934,31 @@ discard block |
||
| 4934 | 4934 | $langs->load("deliveries"); |
| 4935 | 4935 | |
| 4936 | 4936 | $sql = "SELECT rowid, code, libelle as label"; |
| 4937 | - $sql .= " FROM " . $this->db->prefix() . "c_shipment_mode"; |
|
| 4937 | + $sql .= " FROM ".$this->db->prefix()."c_shipment_mode"; |
|
| 4938 | 4938 | $sql .= " WHERE active > 0"; |
| 4939 | 4939 | if ($filtre) { |
| 4940 | - $sql .= " AND " . $filtre; |
|
| 4940 | + $sql .= " AND ".$filtre; |
|
| 4941 | 4941 | } |
| 4942 | 4942 | $sql .= " ORDER BY libelle ASC"; |
| 4943 | 4943 | |
| 4944 | - dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG); |
|
| 4944 | + dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG); |
|
| 4945 | 4945 | $result = $this->db->query($sql); |
| 4946 | 4946 | if ($result) { |
| 4947 | 4947 | $num = $this->db->num_rows($result); |
| 4948 | 4948 | $i = 0; |
| 4949 | 4949 | if ($num) { |
| 4950 | - print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 4950 | + print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 4951 | 4951 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 4952 | 4952 | print '<option value="-1"> </option>'; |
| 4953 | 4953 | } |
| 4954 | 4954 | while ($i < $num) { |
| 4955 | 4955 | $obj = $this->db->fetch_object($result); |
| 4956 | 4956 | if ($selected == $obj->rowid) { |
| 4957 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 4957 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 4958 | 4958 | } else { |
| 4959 | - print '<option value="' . $obj->rowid . '">'; |
|
| 4959 | + print '<option value="'.$obj->rowid.'">'; |
|
| 4960 | 4960 | } |
| 4961 | - print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label; |
|
| 4961 | + print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label; |
|
| 4962 | 4962 | print '</option>'; |
| 4963 | 4963 | $i++; |
| 4964 | 4964 | } |
@@ -4967,7 +4967,7 @@ discard block |
||
| 4967 | 4967 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4968 | 4968 | } |
| 4969 | 4969 | |
| 4970 | - print ajax_combobox('select' . $htmlname); |
|
| 4970 | + print ajax_combobox('select'.$htmlname); |
|
| 4971 | 4971 | } else { |
| 4972 | 4972 | print $langs->trans("NoShippingMethodDefined"); |
| 4973 | 4973 | } |
@@ -4992,16 +4992,16 @@ discard block |
||
| 4992 | 4992 | $langs->load("deliveries"); |
| 4993 | 4993 | |
| 4994 | 4994 | if ($htmlname != "none") { |
| 4995 | - print '<form method="POST" action="' . $page . '">'; |
|
| 4995 | + print '<form method="POST" action="'.$page.'">'; |
|
| 4996 | 4996 | print '<input type="hidden" name="action" value="setshippingmethod">'; |
| 4997 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 4997 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 4998 | 4998 | $this->selectShippingMethod($selected, $htmlname, '', $addempty); |
| 4999 | - print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 4999 | + print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5000 | 5000 | print '</form>'; |
| 5001 | 5001 | } else { |
| 5002 | 5002 | if ($selected) { |
| 5003 | 5003 | $code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code'); |
| 5004 | - print $langs->trans("SendingMethod" . strtoupper($code)); |
|
| 5004 | + print $langs->trans("SendingMethod".strtoupper($code)); |
|
| 5005 | 5005 | } else { |
| 5006 | 5006 | print " "; |
| 5007 | 5007 | } |
@@ -5024,10 +5024,10 @@ discard block |
||
| 5024 | 5024 | |
| 5025 | 5025 | $opt = '<option value="" selected></option>'; |
| 5026 | 5026 | $sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc"; |
| 5027 | - $sql .= ' FROM ' . $this->db->prefix() . 'facture'; |
|
| 5028 | - $sql .= ' WHERE entity IN (' . getEntity('invoice') . ')'; |
|
| 5027 | + $sql .= ' FROM '.$this->db->prefix().'facture'; |
|
| 5028 | + $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; |
|
| 5029 | 5029 | $sql .= ' AND situation_counter >= 1'; |
| 5030 | - $sql .= ' AND fk_soc = ' . (int) $socid; |
|
| 5030 | + $sql .= ' AND fk_soc = '.(int) $socid; |
|
| 5031 | 5031 | $sql .= ' AND type <> 2'; |
| 5032 | 5032 | $sql .= ' ORDER by situation_cycle_ref, situation_counter desc'; |
| 5033 | 5033 | $resql = $this->db->query($sql); |
@@ -5045,19 +5045,19 @@ discard block |
||
| 5045 | 5045 | //Not prov? |
| 5046 | 5046 | if (substr($obj->ref, 1, 4) != 'PROV') { |
| 5047 | 5047 | if ($selected == $obj->rowid) { |
| 5048 | - $opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>'; |
|
| 5048 | + $opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>'; |
|
| 5049 | 5049 | } else { |
| 5050 | - $opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>'; |
|
| 5050 | + $opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>'; |
|
| 5051 | 5051 | } |
| 5052 | 5052 | } |
| 5053 | 5053 | } |
| 5054 | 5054 | } |
| 5055 | 5055 | } |
| 5056 | 5056 | } else { |
| 5057 | - dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR); |
|
| 5057 | + dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR); |
|
| 5058 | 5058 | } |
| 5059 | 5059 | if ($opt == '<option value ="" selected></option>') { |
| 5060 | - $opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>'; |
|
| 5060 | + $opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>'; |
|
| 5061 | 5061 | } |
| 5062 | 5062 | return $opt; |
| 5063 | 5063 | } |
@@ -5077,12 +5077,12 @@ discard block |
||
| 5077 | 5077 | |
| 5078 | 5078 | $langs->load('products'); |
| 5079 | 5079 | |
| 5080 | - $return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 5080 | + $return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 5081 | 5081 | |
| 5082 | - $sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units"; |
|
| 5082 | + $sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units"; |
|
| 5083 | 5083 | $sql .= ' WHERE active > 0'; |
| 5084 | 5084 | if (!empty($unit_type)) { |
| 5085 | - $sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'"; |
|
| 5085 | + $sql .= " AND unit_type = '".$this->db->escape($unit_type)."'"; |
|
| 5086 | 5086 | } |
| 5087 | 5087 | $sql .= " ORDER BY sortorder"; |
| 5088 | 5088 | |
@@ -5094,14 +5094,14 @@ discard block |
||
| 5094 | 5094 | |
| 5095 | 5095 | while ($res = $this->db->fetch_object($resql)) { |
| 5096 | 5096 | $unitLabel = $res->label; |
| 5097 | - if (!empty($langs->tab_translate['unit' . $res->code])) { // check if Translation is available before |
|
| 5098 | - $unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label; |
|
| 5097 | + if (!empty($langs->tab_translate['unit'.$res->code])) { // check if Translation is available before |
|
| 5098 | + $unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label; |
|
| 5099 | 5099 | } |
| 5100 | 5100 | |
| 5101 | 5101 | if ($selected == $res->rowid) { |
| 5102 | - $return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>'; |
|
| 5102 | + $return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>'; |
|
| 5103 | 5103 | } else { |
| 5104 | - $return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>'; |
|
| 5104 | + $return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>'; |
|
| 5105 | 5105 | } |
| 5106 | 5106 | } |
| 5107 | 5107 | $return .= '</select>'; |
@@ -5136,29 +5136,29 @@ discard block |
||
| 5136 | 5136 | $num = 0; |
| 5137 | 5137 | |
| 5138 | 5138 | $sql = "SELECT rowid, label, bank, clos as status, currency_code"; |
| 5139 | - $sql .= " FROM " . $this->db->prefix() . "bank_account"; |
|
| 5140 | - $sql .= " WHERE entity IN (" . getEntity('bank_account') . ")"; |
|
| 5139 | + $sql .= " FROM ".$this->db->prefix()."bank_account"; |
|
| 5140 | + $sql .= " WHERE entity IN (".getEntity('bank_account').")"; |
|
| 5141 | 5141 | if ($status != 2) { |
| 5142 | - $sql .= " AND clos = " . (int) $status; |
|
| 5142 | + $sql .= " AND clos = ".(int) $status; |
|
| 5143 | 5143 | } |
| 5144 | 5144 | if ($filtre) { // TODO Support USF |
| 5145 | - $sql .= " AND " . $filtre; |
|
| 5145 | + $sql .= " AND ".$filtre; |
|
| 5146 | 5146 | } |
| 5147 | 5147 | $sql .= " ORDER BY label"; |
| 5148 | 5148 | |
| 5149 | - dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG); |
|
| 5149 | + dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG); |
|
| 5150 | 5150 | $result = $this->db->query($sql); |
| 5151 | 5151 | if ($result) { |
| 5152 | 5152 | $num = $this->db->num_rows($result); |
| 5153 | 5153 | $i = 0; |
| 5154 | 5154 | |
| 5155 | - $out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 5155 | + $out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 5156 | 5156 | |
| 5157 | 5157 | if ($num == 0) { |
| 5158 | 5158 | if ($status == 0) { |
| 5159 | - $out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoActiveBankAccountDefined") . '</span>'; |
|
| 5159 | + $out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoActiveBankAccountDefined").'</span>'; |
|
| 5160 | 5160 | } else { |
| 5161 | - $out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoBankAccountFound") . '</span>'; |
|
| 5161 | + $out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoBankAccountFound").'</span>'; |
|
| 5162 | 5162 | } |
| 5163 | 5163 | } else { |
| 5164 | 5164 | if (!empty($useempty) && !is_numeric($useempty)) { |
@@ -5171,22 +5171,22 @@ discard block |
||
| 5171 | 5171 | while ($i < $num) { |
| 5172 | 5172 | $obj = $this->db->fetch_object($result); |
| 5173 | 5173 | if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) { |
| 5174 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>'; |
|
| 5174 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>'; |
|
| 5175 | 5175 | } else { |
| 5176 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">'; |
|
| 5176 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">'; |
|
| 5177 | 5177 | } |
| 5178 | 5178 | $out .= trim($obj->label); |
| 5179 | 5179 | if ($showcurrency) { |
| 5180 | - $out .= ' (' . $obj->currency_code . ')'; |
|
| 5180 | + $out .= ' ('.$obj->currency_code.')'; |
|
| 5181 | 5181 | } |
| 5182 | 5182 | if ($status == 2 && $obj->status == 1) { |
| 5183 | - $out .= ' (' . $langs->trans("Closed") . ')'; |
|
| 5183 | + $out .= ' ('.$langs->trans("Closed").')'; |
|
| 5184 | 5184 | } |
| 5185 | 5185 | $out .= '</option>'; |
| 5186 | 5186 | $i++; |
| 5187 | 5187 | } |
| 5188 | 5188 | $out .= "</select>"; |
| 5189 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 5189 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 5190 | 5190 | } else { |
| 5191 | 5191 | dol_print_error($this->db); |
| 5192 | 5192 | } |
@@ -5220,23 +5220,23 @@ discard block |
||
| 5220 | 5220 | $num = 0; |
| 5221 | 5221 | |
| 5222 | 5222 | $sql = "SELECT rowid, name, fk_country, status, entity"; |
| 5223 | - $sql .= " FROM " . $this->db->prefix() . "establishment"; |
|
| 5223 | + $sql .= " FROM ".$this->db->prefix()."establishment"; |
|
| 5224 | 5224 | $sql .= " WHERE 1=1"; |
| 5225 | 5225 | if ($status != 2) { |
| 5226 | - $sql .= " AND status = " . (int) $status; |
|
| 5226 | + $sql .= " AND status = ".(int) $status; |
|
| 5227 | 5227 | } |
| 5228 | 5228 | if ($filtre) { // TODO Support USF |
| 5229 | - $sql .= " AND " . $filtre; |
|
| 5229 | + $sql .= " AND ".$filtre; |
|
| 5230 | 5230 | } |
| 5231 | 5231 | $sql .= " ORDER BY name"; |
| 5232 | 5232 | |
| 5233 | - dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG); |
|
| 5233 | + dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG); |
|
| 5234 | 5234 | $result = $this->db->query($sql); |
| 5235 | 5235 | if ($result) { |
| 5236 | 5236 | $num = $this->db->num_rows($result); |
| 5237 | 5237 | $i = 0; |
| 5238 | 5238 | if ($num) { |
| 5239 | - print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 5239 | + print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 5240 | 5240 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 5241 | 5241 | print '<option value="-1"> </option>'; |
| 5242 | 5242 | } |
@@ -5244,13 +5244,13 @@ discard block |
||
| 5244 | 5244 | while ($i < $num) { |
| 5245 | 5245 | $obj = $this->db->fetch_object($result); |
| 5246 | 5246 | if ($selected == $obj->rowid) { |
| 5247 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 5247 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 5248 | 5248 | } else { |
| 5249 | - print '<option value="' . $obj->rowid . '">'; |
|
| 5249 | + print '<option value="'.$obj->rowid.'">'; |
|
| 5250 | 5250 | } |
| 5251 | 5251 | print trim($obj->name); |
| 5252 | 5252 | if ($status == 2 && $obj->status == 1) { |
| 5253 | - print ' (' . $langs->trans("Closed") . ')'; |
|
| 5253 | + print ' ('.$langs->trans("Closed").')'; |
|
| 5254 | 5254 | } |
| 5255 | 5255 | print '</option>'; |
| 5256 | 5256 | $i++; |
@@ -5258,9 +5258,9 @@ discard block |
||
| 5258 | 5258 | print "</select>"; |
| 5259 | 5259 | } else { |
| 5260 | 5260 | if ($status == 0) { |
| 5261 | - print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>'; |
|
| 5261 | + print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>'; |
|
| 5262 | 5262 | } else { |
| 5263 | - print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>'; |
|
| 5263 | + print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>'; |
|
| 5264 | 5264 | } |
| 5265 | 5265 | } |
| 5266 | 5266 | |
@@ -5284,20 +5284,20 @@ discard block |
||
| 5284 | 5284 | { |
| 5285 | 5285 | global $langs; |
| 5286 | 5286 | if ($htmlname != "none") { |
| 5287 | - print '<form method="POST" action="' . $page . '">'; |
|
| 5287 | + print '<form method="POST" action="'.$page.'">'; |
|
| 5288 | 5288 | print '<input type="hidden" name="action" value="setbankaccount">'; |
| 5289 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5289 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5290 | 5290 | print img_picto('', 'bank_account', 'class="pictofixedwidth"'); |
| 5291 | 5291 | $nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty); |
| 5292 | 5292 | if ($nbaccountfound > 0) { |
| 5293 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5293 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5294 | 5294 | } |
| 5295 | 5295 | print '</form>'; |
| 5296 | 5296 | } else { |
| 5297 | 5297 | $langs->load('banks'); |
| 5298 | 5298 | |
| 5299 | 5299 | if ($selected) { |
| 5300 | - require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
| 5300 | + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
| 5301 | 5301 | $bankstatic = new Account($this->db); |
| 5302 | 5302 | $result = $bankstatic->fetch($selected); |
| 5303 | 5303 | if ($result) { |
@@ -5336,11 +5336,11 @@ discard block |
||
| 5336 | 5336 | global $conf, $langs; |
| 5337 | 5337 | $langs->load("categories"); |
| 5338 | 5338 | |
| 5339 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 5339 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 5340 | 5340 | |
| 5341 | 5341 | // For backward compatibility |
| 5342 | 5342 | if (is_numeric($type)) { |
| 5343 | - dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
| 5343 | + dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
| 5344 | 5344 | } |
| 5345 | 5345 | |
| 5346 | 5346 | if ($type === Categorie::TYPE_BANK_LINE) { |
@@ -5348,8 +5348,8 @@ discard block |
||
| 5348 | 5348 | $cat = new Categorie($this->db); |
| 5349 | 5349 | $cate_arbo = array(); |
| 5350 | 5350 | $sql = "SELECT c.label, c.rowid"; |
| 5351 | - $sql .= " FROM " . $this->db->prefix() . "categorie as c"; |
|
| 5352 | - $sql .= " WHERE entity = " . $conf->entity . " AND type = " . ((int) $cat->getMapId()[$type]); |
|
| 5351 | + $sql .= " FROM ".$this->db->prefix()."categorie as c"; |
|
| 5352 | + $sql .= " WHERE entity = ".$conf->entity." AND type = ".((int) $cat->getMapId()[$type]); |
|
| 5353 | 5353 | $sql .= " ORDER BY c.label"; |
| 5354 | 5354 | $result = $this->db->query($sql); |
| 5355 | 5355 | if ($result) { |
@@ -5375,12 +5375,12 @@ discard block |
||
| 5375 | 5375 | $outarrayrichhtml = array(); |
| 5376 | 5376 | |
| 5377 | 5377 | |
| 5378 | - $output = '<select class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 5378 | + $output = '<select class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 5379 | 5379 | if (is_array($cate_arbo)) { |
| 5380 | 5380 | $num = count($cate_arbo); |
| 5381 | 5381 | |
| 5382 | 5382 | if (!$num) { |
| 5383 | - $output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>'; |
|
| 5383 | + $output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>'; |
|
| 5384 | 5384 | } else { |
| 5385 | 5385 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 5386 | 5386 | $output .= '<option value="-1"> </option>'; |
@@ -5392,15 +5392,15 @@ discard block |
||
| 5392 | 5392 | $add = ''; |
| 5393 | 5393 | } |
| 5394 | 5394 | |
| 5395 | - $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"'); |
|
| 5395 | + $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"'); |
|
| 5396 | 5396 | $labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
| 5397 | 5397 | |
| 5398 | 5398 | $outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel']; |
| 5399 | 5399 | |
| 5400 | 5400 | $outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow; |
| 5401 | 5401 | |
| 5402 | - $output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"'; |
|
| 5403 | - $output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"'; |
|
| 5402 | + $output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"'; |
|
| 5403 | + $output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"'; |
|
| 5404 | 5404 | $output .= '>'; |
| 5405 | 5405 | $output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
| 5406 | 5406 | $output .= '</option>'; |
@@ -5446,7 +5446,7 @@ discard block |
||
| 5446 | 5446 | public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500) |
| 5447 | 5447 | { |
| 5448 | 5448 | // phpcs:enable |
| 5449 | - dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
| 5449 | + dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
| 5450 | 5450 | print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width); |
| 5451 | 5451 | } |
| 5452 | 5452 | |
@@ -5481,7 +5481,7 @@ discard block |
||
| 5481 | 5481 | { |
| 5482 | 5482 | global $langs, $conf; |
| 5483 | 5483 | |
| 5484 | - $more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->'; |
|
| 5484 | + $more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->'; |
|
| 5485 | 5485 | $formconfirm = ''; |
| 5486 | 5486 | $inputok = array(); |
| 5487 | 5487 | $inputko = array(); |
@@ -5505,27 +5505,27 @@ discard block |
||
| 5505 | 5505 | foreach ($formquestion as $key => $input) { |
| 5506 | 5506 | if (is_array($input) && !empty($input)) { |
| 5507 | 5507 | if ($input['type'] == 'hidden') { |
| 5508 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
| 5509 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
| 5508 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
| 5509 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
| 5510 | 5510 | |
| 5511 | - $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"; |
|
| 5511 | + $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"; |
|
| 5512 | 5512 | } |
| 5513 | 5513 | } |
| 5514 | 5514 | } |
| 5515 | 5515 | |
| 5516 | 5516 | // Now add questions |
| 5517 | 5517 | $moreonecolumn = ''; |
| 5518 | - $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n"; |
|
| 5518 | + $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n"; |
|
| 5519 | 5519 | foreach ($formquestion as $key => $input) { |
| 5520 | 5520 | if (is_array($input) && !empty($input)) { |
| 5521 | - $size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : ''); // deprecated. Use morecss instead. |
|
| 5522 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
| 5523 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
| 5521 | + $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead. |
|
| 5522 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
| 5523 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
| 5524 | 5524 | |
| 5525 | 5525 | if ($input['type'] == 'text') { |
| 5526 | - $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"; |
|
| 5526 | + $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"; |
|
| 5527 | 5527 | } elseif ($input['type'] == 'password') { |
| 5528 | - $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"; |
|
| 5528 | + $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"; |
|
| 5529 | 5529 | } elseif ($input['type'] == 'textarea') { |
| 5530 | 5530 | /*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">'; |
| 5531 | 5531 | $more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>'; |
@@ -5533,8 +5533,8 @@ discard block |
||
| 5533 | 5533 | $more .= '</textarea>'; |
| 5534 | 5534 | $more .= '</div></div>'."\n";*/ |
| 5535 | 5535 | $moreonecolumn .= '<div class="margintoponly">'; |
| 5536 | - $moreonecolumn .= $input['label'] . '<br>'; |
|
| 5537 | - $moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>'; |
|
| 5536 | + $moreonecolumn .= $input['label'].'<br>'; |
|
| 5537 | + $moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>'; |
|
| 5538 | 5538 | $moreonecolumn .= $input['value']; |
| 5539 | 5539 | $moreonecolumn .= '</textarea>'; |
| 5540 | 5540 | $moreonecolumn .= '</div>'; |
@@ -5551,20 +5551,20 @@ discard block |
||
| 5551 | 5551 | $disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0; |
| 5552 | 5552 | $sort = isset($input['select_sort']) ? $input['select_sort'] : ''; |
| 5553 | 5553 | |
| 5554 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">'; |
|
| 5554 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
|
| 5555 | 5555 | if (!empty($input['label'])) { |
| 5556 | - $more .= $input['label'] . '</div><div class="tagtd left">'; |
|
| 5556 | + $more .= $input['label'].'</div><div class="tagtd left">'; |
|
| 5557 | 5557 | } |
| 5558 | 5558 | if ($input['type'] == 'select') { |
| 5559 | 5559 | $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); |
| 5560 | 5560 | } else { |
| 5561 | 5561 | $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); |
| 5562 | 5562 | } |
| 5563 | - $more .= '</div></div>' . "\n"; |
|
| 5563 | + $more .= '</div></div>'."\n"; |
|
| 5564 | 5564 | } elseif ($input['type'] == 'checkbox') { |
| 5565 | 5565 | $more .= '<div class="tagtr">'; |
| 5566 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">'; |
|
| 5567 | - $more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr; |
|
| 5566 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">'; |
|
| 5567 | + $more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr; |
|
| 5568 | 5568 | if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') { |
| 5569 | 5569 | $more .= ' checked'; |
| 5570 | 5570 | } |
@@ -5575,19 +5575,19 @@ discard block |
||
| 5575 | 5575 | $more .= ' disabled'; |
| 5576 | 5576 | } |
| 5577 | 5577 | $more .= ' /></div>'; |
| 5578 | - $more .= '</div>' . "\n"; |
|
| 5578 | + $more .= '</div>'."\n"; |
|
| 5579 | 5579 | } elseif ($input['type'] == 'radio') { |
| 5580 | 5580 | $i = 0; |
| 5581 | 5581 | foreach ($input['values'] as $selkey => $selval) { |
| 5582 | 5582 | $more .= '<div class="tagtr">'; |
| 5583 | 5583 | if (isset($input['label'])) { |
| 5584 | 5584 | if ($i == 0) { |
| 5585 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
| 5585 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
| 5586 | 5586 | } else { |
| 5587 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '"> </div>'; |
|
| 5587 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'"> </div>'; |
|
| 5588 | 5588 | } |
| 5589 | 5589 | } |
| 5590 | - $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; |
|
| 5590 | + $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; |
|
| 5591 | 5591 | if (!empty($input['disabled'])) { |
| 5592 | 5592 | $more .= ' disabled'; |
| 5593 | 5593 | } |
@@ -5595,12 +5595,12 @@ discard block |
||
| 5595 | 5595 | $more .= ' checked="checked"'; |
| 5596 | 5596 | } |
| 5597 | 5597 | $more .= ' /> '; |
| 5598 | - $more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>'; |
|
| 5599 | - $more .= '</div></div>' . "\n"; |
|
| 5598 | + $more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>'; |
|
| 5599 | + $more .= '</div></div>'."\n"; |
|
| 5600 | 5600 | $i++; |
| 5601 | 5601 | } |
| 5602 | 5602 | } elseif ($input['type'] == 'date' || $input['type'] == 'datetime') { |
| 5603 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
| 5603 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
| 5604 | 5604 | $more .= '<div class="tagtd">'; |
| 5605 | 5605 | $addnowlink = (empty($input['datenow']) ? 0 : 1); |
| 5606 | 5606 | $h = $m = 0; |
@@ -5618,24 +5618,24 @@ discard block |
||
| 5618 | 5618 | } elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not |
| 5619 | 5619 | $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
| 5620 | 5620 | if (!empty($input['label'])) { |
| 5621 | - $more .= $input['label'] . '</div><div class="tagtd">'; |
|
| 5621 | + $more .= $input['label'].'</div><div class="tagtd">'; |
|
| 5622 | 5622 | } |
| 5623 | 5623 | $more .= $input['value']; |
| 5624 | - $more .= '</div></div>' . "\n"; |
|
| 5624 | + $more .= '</div></div>'."\n"; |
|
| 5625 | 5625 | } elseif ($input['type'] == 'onecolumn') { |
| 5626 | 5626 | $moreonecolumn .= '<div class="margintoponly">'; |
| 5627 | 5627 | $moreonecolumn .= $input['value']; |
| 5628 | - $moreonecolumn .= '</div>' . "\n"; |
|
| 5628 | + $moreonecolumn .= '</div>'."\n"; |
|
| 5629 | 5629 | } elseif ($input['type'] == 'hidden') { |
| 5630 | 5630 | // Do nothing more, already added by a previous loop |
| 5631 | 5631 | } elseif ($input['type'] == 'separator') { |
| 5632 | 5632 | $more .= '<br>'; |
| 5633 | 5633 | } else { |
| 5634 | - $more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type'; |
|
| 5634 | + $more .= 'Error type '.$input['type'].' for the confirm box is not a supported type'; |
|
| 5635 | 5635 | } |
| 5636 | 5636 | } |
| 5637 | 5637 | } |
| 5638 | - $more .= '</div>' . "\n"; |
|
| 5638 | + $more .= '</div>'."\n"; |
|
| 5639 | 5639 | $more .= $moreonecolumn; |
| 5640 | 5640 | } |
| 5641 | 5641 | |
@@ -5657,10 +5657,10 @@ discard block |
||
| 5657 | 5657 | $button = $useajax; |
| 5658 | 5658 | $useajax = 1; |
| 5659 | 5659 | $autoOpen = false; |
| 5660 | - $dialogconfirm .= '-' . $button; |
|
| 5660 | + $dialogconfirm .= '-'.$button; |
|
| 5661 | 5661 | } |
| 5662 | - $pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes'; |
|
| 5663 | - $pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : ''); |
|
| 5662 | + $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes'; |
|
| 5663 | + $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : ''); |
|
| 5664 | 5664 | |
| 5665 | 5665 | // Add input fields into list of fields to read during submit (inputok and inputko) |
| 5666 | 5666 | if (is_array($formquestion)) { |
@@ -5683,24 +5683,24 @@ discard block |
||
| 5683 | 5683 | } |
| 5684 | 5684 | |
| 5685 | 5685 | // Show JQuery confirm box. |
| 5686 | - $formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">'; |
|
| 5686 | + $formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">'; |
|
| 5687 | 5687 | if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) { |
| 5688 | - $formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n"; |
|
| 5688 | + $formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n"; |
|
| 5689 | 5689 | } |
| 5690 | 5690 | if (!empty($more)) { |
| 5691 | - $formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n"; |
|
| 5691 | + $formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n"; |
|
| 5692 | 5692 | } |
| 5693 | - $formconfirm .= ($question ? '<div class="confirmmessage">' . img_help(0, '') . ' ' . $question . '</div>' : ''); |
|
| 5694 | - $formconfirm .= '</div>' . "\n"; |
|
| 5693 | + $formconfirm .= ($question ? '<div class="confirmmessage">'.img_help(0, '').' '.$question.'</div>' : ''); |
|
| 5694 | + $formconfirm .= '</div>'."\n"; |
|
| 5695 | 5695 | |
| 5696 | - $formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n"; |
|
| 5697 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
| 5696 | + $formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n"; |
|
| 5697 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
| 5698 | 5698 | $formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n"; |
| 5699 | 5699 | $formconfirm .= 'jQuery(document).ready(function() { |
| 5700 | 5700 | $(function() { |
| 5701 | - $( "#' . $dialogconfirm . '" ).dialog( |
|
| 5701 | + $( "#' . $dialogconfirm.'" ).dialog( |
|
| 5702 | 5702 | { |
| 5703 | - autoOpen: ' . ($autoOpen ? "true" : "false") . ','; |
|
| 5703 | + autoOpen: ' . ($autoOpen ? "true" : "false").','; |
|
| 5704 | 5704 | if ($newselectedchoice == 'no') { |
| 5705 | 5705 | $formconfirm .= ' |
| 5706 | 5706 | open: function() { |
@@ -5710,24 +5710,24 @@ discard block |
||
| 5710 | 5710 | |
| 5711 | 5711 | $jsforcursor = ''; |
| 5712 | 5712 | if ($useajax == 1) { |
| 5713 | - $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n"; |
|
| 5714 | - $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n"; |
|
| 5713 | + $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n"; |
|
| 5714 | + $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n"; |
|
| 5715 | 5715 | } |
| 5716 | 5716 | |
| 5717 | 5717 | $postconfirmas = 'GET'; |
| 5718 | 5718 | |
| 5719 | 5719 | $formconfirm .= ' |
| 5720 | 5720 | resizable: false, |
| 5721 | - height: "' . $height . '", |
|
| 5722 | - width: "' . $width . '", |
|
| 5721 | + height: "' . $height.'", |
|
| 5722 | + width: "' . $width.'", |
|
| 5723 | 5723 | modal: true, |
| 5724 | 5724 | closeOnEscape: false, |
| 5725 | 5725 | buttons: { |
| 5726 | - "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() { |
|
| 5727 | - var options = "token=' . urlencode(newToken()) . '"; |
|
| 5728 | - var inputok = ' . json_encode($inputok) . '; /* List of fields into form */ |
|
| 5729 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
| 5730 | - var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '"; |
|
| 5726 | + "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() { |
|
| 5727 | + var options = "token=' . urlencode(newToken()).'"; |
|
| 5728 | + var inputok = ' . json_encode($inputok).'; /* List of fields into form */ |
|
| 5729 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
| 5730 | + var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; |
|
| 5731 | 5731 | |
| 5732 | 5732 | if (inputok.length > 0) { |
| 5733 | 5733 | $.each(inputok, function(i, inputname) { |
@@ -5761,11 +5761,11 @@ discard block |
||
| 5761 | 5761 | } |
| 5762 | 5762 | $(this).dialog("close"); |
| 5763 | 5763 | }, |
| 5764 | - "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() { |
|
| 5765 | - var options = "token=' . urlencode(newToken()) . '"; |
|
| 5766 | - var inputko = ' . json_encode($inputko) . '; /* List of fields into form */ |
|
| 5767 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
| 5768 | - var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '"; |
|
| 5764 | + "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() { |
|
| 5765 | + var options = "token=' . urlencode(newToken()).'"; |
|
| 5766 | + var inputko = ' . json_encode($inputko).'; /* List of fields into form */ |
|
| 5767 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
| 5768 | + var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'"; |
|
| 5769 | 5769 | if (inputko.length > 0) { |
| 5770 | 5770 | $.each(inputko, function(i, inputname) { |
| 5771 | 5771 | var more = ""; |
@@ -5797,10 +5797,10 @@ discard block |
||
| 5797 | 5797 | } |
| 5798 | 5798 | ); |
| 5799 | 5799 | |
| 5800 | - var button = "' . $button . '"; |
|
| 5800 | + var button = "' . $button.'"; |
|
| 5801 | 5801 | if (button.length > 0) { |
| 5802 | 5802 | $( "#" + button ).click(function() { |
| 5803 | - $("#' . $dialogconfirm . '").dialog("open"); |
|
| 5803 | + $("#' . $dialogconfirm.'").dialog("open"); |
|
| 5804 | 5804 | }); |
| 5805 | 5805 | } |
| 5806 | 5806 | }); |
@@ -5808,44 +5808,44 @@ discard block |
||
| 5808 | 5808 | </script>'; |
| 5809 | 5809 | $formconfirm .= "<!-- end ajax formconfirm -->\n"; |
| 5810 | 5810 | } else { |
| 5811 | - $formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n"; |
|
| 5811 | + $formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n"; |
|
| 5812 | 5812 | |
| 5813 | 5813 | if (empty($disableformtag)) { |
| 5814 | - $formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftnoright">' . "\n"; |
|
| 5814 | + $formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftnoright">'."\n"; |
|
| 5815 | 5815 | } |
| 5816 | 5816 | |
| 5817 | - $formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n"; |
|
| 5818 | - $formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n"; |
|
| 5817 | + $formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n"; |
|
| 5818 | + $formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n"; |
|
| 5819 | 5819 | |
| 5820 | - $formconfirm .= '<table class="valid centpercent">' . "\n"; |
|
| 5820 | + $formconfirm .= '<table class="valid centpercent">'."\n"; |
|
| 5821 | 5821 | |
| 5822 | 5822 | // Line title |
| 5823 | 5823 | $formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">'; |
| 5824 | - $formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title; |
|
| 5825 | - $formconfirm .= '</td></tr>' . "\n"; |
|
| 5824 | + $formconfirm .= img_picto('', 'pictoconfirm').' '.$title; |
|
| 5825 | + $formconfirm .= '</td></tr>'."\n"; |
|
| 5826 | 5826 | |
| 5827 | 5827 | // Line text |
| 5828 | 5828 | if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) { |
| 5829 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n"; |
|
| 5829 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n"; |
|
| 5830 | 5830 | } |
| 5831 | 5831 | |
| 5832 | 5832 | // Line form fields |
| 5833 | 5833 | if ($more) { |
| 5834 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n"; |
|
| 5834 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n"; |
|
| 5835 | 5835 | $formconfirm .= $more; |
| 5836 | - $formconfirm .= '</td></tr>' . "\n"; |
|
| 5836 | + $formconfirm .= '</td></tr>'."\n"; |
|
| 5837 | 5837 | } |
| 5838 | 5838 | |
| 5839 | 5839 | // Line with question |
| 5840 | 5840 | $formconfirm .= '<tr class="valid">'; |
| 5841 | - $formconfirm .= '<td class="valid">' . $question . '</td>'; |
|
| 5841 | + $formconfirm .= '<td class="valid">'.$question.'</td>'; |
|
| 5842 | 5842 | $formconfirm .= '<td class="valid center">'; |
| 5843 | 5843 | $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno); |
| 5844 | - $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">'; |
|
| 5844 | + $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">'; |
|
| 5845 | 5845 | $formconfirm .= '</td>'; |
| 5846 | - $formconfirm .= '</tr>' . "\n"; |
|
| 5846 | + $formconfirm .= '</tr>'."\n"; |
|
| 5847 | 5847 | |
| 5848 | - $formconfirm .= '</table>' . "\n"; |
|
| 5848 | + $formconfirm .= '</table>'."\n"; |
|
| 5849 | 5849 | |
| 5850 | 5850 | if (empty($disableformtag)) { |
| 5851 | 5851 | $formconfirm .= "</form>\n"; |
@@ -5854,7 +5854,7 @@ discard block |
||
| 5854 | 5854 | |
| 5855 | 5855 | if (!empty($conf->use_javascript_ajax)) { |
| 5856 | 5856 | $formconfirm .= '<!-- code to disable button to avoid double clic -->'; |
| 5857 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
| 5857 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
| 5858 | 5858 | $formconfirm .= ' |
| 5859 | 5859 | $(document).ready(function () { |
| 5860 | 5860 | $(".confirmvalidatebutton").on("click", function() { |
@@ -5866,7 +5866,7 @@ discard block |
||
| 5866 | 5866 | }); |
| 5867 | 5867 | }); |
| 5868 | 5868 | '; |
| 5869 | - $formconfirm .= '</script>' . "\n"; |
|
| 5869 | + $formconfirm .= '</script>'."\n"; |
|
| 5870 | 5870 | } |
| 5871 | 5871 | |
| 5872 | 5872 | $formconfirm .= "<!-- end formconfirm -->\n"; |
@@ -5898,8 +5898,8 @@ discard block |
||
| 5898 | 5898 | // phpcs:enable |
| 5899 | 5899 | global $langs; |
| 5900 | 5900 | |
| 5901 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 5902 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 5901 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 5902 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 5903 | 5903 | |
| 5904 | 5904 | $out = ''; |
| 5905 | 5905 | |
@@ -5907,11 +5907,11 @@ discard block |
||
| 5907 | 5907 | |
| 5908 | 5908 | $langs->load("project"); |
| 5909 | 5909 | if ($htmlname != "none") { |
| 5910 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 5910 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 5911 | 5911 | $out .= '<input type="hidden" name="action" value="classin">'; |
| 5912 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5912 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5913 | 5913 | $out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss); |
| 5914 | - $out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5914 | + $out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5915 | 5915 | $out .= '</form>'; |
| 5916 | 5916 | } else { |
| 5917 | 5917 | $out .= '<span class="project_head_block">'; |
@@ -5920,7 +5920,7 @@ discard block |
||
| 5920 | 5920 | $projet->fetch($selected); |
| 5921 | 5921 | $out .= $projet->getNomUrl(0, '', 1); |
| 5922 | 5922 | } else { |
| 5923 | - $out .= '<span class="opacitymedium">' . $textifnoproject . '</span>'; |
|
| 5923 | + $out .= '<span class="opacitymedium">'.$textifnoproject.'</span>'; |
|
| 5924 | 5924 | } |
| 5925 | 5925 | $out .= '</span>'; |
| 5926 | 5926 | } |
@@ -5957,14 +5957,14 @@ discard block |
||
| 5957 | 5957 | $out = ''; |
| 5958 | 5958 | |
| 5959 | 5959 | if ($htmlname != "none") { |
| 5960 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
| 5960 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
| 5961 | 5961 | $out .= '<input type="hidden" name="action" value="setconditions">'; |
| 5962 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5962 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5963 | 5963 | if ($type) { |
| 5964 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 5964 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 5965 | 5965 | } |
| 5966 | 5966 | $out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); |
| 5967 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5967 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5968 | 5968 | $out .= '</form>'; |
| 5969 | 5969 | } else { |
| 5970 | 5970 | if ($selected) { |
@@ -6009,12 +6009,12 @@ discard block |
||
| 6009 | 6009 | // phpcs:enable |
| 6010 | 6010 | global $langs; |
| 6011 | 6011 | if ($htmlname != "none") { |
| 6012 | - print '<form method="post" action="' . $page . '">'; |
|
| 6012 | + print '<form method="post" action="'.$page.'">'; |
|
| 6013 | 6013 | print '<input type="hidden" name="action" value="setavailability">'; |
| 6014 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6014 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6015 | 6015 | $this->selectAvailabilityDelay($selected, $htmlname, '', $addempty); |
| 6016 | - print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 6017 | - print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">'; |
|
| 6016 | + print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 6017 | + print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">'; |
|
| 6018 | 6018 | print '</form>'; |
| 6019 | 6019 | } else { |
| 6020 | 6020 | if ($selected) { |
@@ -6040,11 +6040,11 @@ discard block |
||
| 6040 | 6040 | { |
| 6041 | 6041 | global $langs; |
| 6042 | 6042 | if ($htmlname != "none") { |
| 6043 | - print '<form method="post" action="' . $page . '">'; |
|
| 6043 | + print '<form method="post" action="'.$page.'">'; |
|
| 6044 | 6044 | print '<input type="hidden" name="action" value="setdemandreason">'; |
| 6045 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6045 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6046 | 6046 | $this->selectInputReason($selected, $htmlname, '-1', $addempty); |
| 6047 | - print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 6047 | + print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 6048 | 6048 | print '</form>'; |
| 6049 | 6049 | } else { |
| 6050 | 6050 | if ($selected) { |
@@ -6084,17 +6084,17 @@ discard block |
||
| 6084 | 6084 | $ret = ''; |
| 6085 | 6085 | |
| 6086 | 6086 | if ($htmlname != "none") { |
| 6087 | - $ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
| 6088 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 6089 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6087 | + $ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
| 6088 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 6089 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6090 | 6090 | if ($type) { |
| 6091 | - $ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 6091 | + $ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 6092 | 6092 | } |
| 6093 | 6093 | $ret .= '<table class="nobordernopadding">'; |
| 6094 | 6094 | $ret .= '<tr><td>'; |
| 6095 | - $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0); |
|
| 6095 | + $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0); |
|
| 6096 | 6096 | $ret .= '</td>'; |
| 6097 | - $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 6097 | + $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
| 6098 | 6098 | $ret .= '</tr></table></form>'; |
| 6099 | 6099 | } else { |
| 6100 | 6100 | if ($displayhour) { |
@@ -6129,15 +6129,15 @@ discard block |
||
| 6129 | 6129 | global $langs; |
| 6130 | 6130 | |
| 6131 | 6131 | if ($htmlname != "none") { |
| 6132 | - print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
| 6133 | - print '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 6134 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6132 | + print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
| 6133 | + print '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 6134 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6135 | 6135 | print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include); |
| 6136 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6136 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6137 | 6137 | print '</form>'; |
| 6138 | 6138 | } else { |
| 6139 | 6139 | if ($selected) { |
| 6140 | - require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
| 6140 | + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
| 6141 | 6141 | $theuser = new User($this->db); |
| 6142 | 6142 | $theuser->fetch($selected); |
| 6143 | 6143 | print $theuser->getNomUrl(1); |
@@ -6170,14 +6170,14 @@ discard block |
||
| 6170 | 6170 | |
| 6171 | 6171 | $out = ''; |
| 6172 | 6172 | if ($htmlname != "none") { |
| 6173 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
| 6173 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
| 6174 | 6174 | $out .= '<input type="hidden" name="action" value="setmode">'; |
| 6175 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6175 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6176 | 6176 | if ($type) { |
| 6177 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 6177 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 6178 | 6178 | } |
| 6179 | 6179 | $out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); |
| 6180 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6180 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6181 | 6181 | $out .= '</form>'; |
| 6182 | 6182 | } else { |
| 6183 | 6183 | if ($selected) { |
@@ -6210,11 +6210,11 @@ discard block |
||
| 6210 | 6210 | { |
| 6211 | 6211 | global $langs; |
| 6212 | 6212 | if ($htmlname != "none") { |
| 6213 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6213 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6214 | 6214 | print '<input type="hidden" name="action" value="settransportmode">'; |
| 6215 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6215 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6216 | 6216 | $this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active); |
| 6217 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6217 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6218 | 6218 | print '</form>'; |
| 6219 | 6219 | } else { |
| 6220 | 6220 | if ($selected) { |
@@ -6241,14 +6241,14 @@ discard block |
||
| 6241 | 6241 | // phpcs:enable |
| 6242 | 6242 | global $langs; |
| 6243 | 6243 | if ($htmlname != "none") { |
| 6244 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6244 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6245 | 6245 | print '<input type="hidden" name="action" value="setmulticurrencycode">'; |
| 6246 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6246 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6247 | 6247 | print $this->selectMultiCurrency($selected, $htmlname, 0); |
| 6248 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6248 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6249 | 6249 | print '</form>'; |
| 6250 | 6250 | } else { |
| 6251 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 6251 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 6252 | 6252 | print !empty($selected) ? currency_name($selected, 1) : ' '; |
| 6253 | 6253 | } |
| 6254 | 6254 | } |
@@ -6270,22 +6270,22 @@ discard block |
||
| 6270 | 6270 | global $langs, $mysoc, $conf; |
| 6271 | 6271 | |
| 6272 | 6272 | if ($htmlname != "none") { |
| 6273 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6273 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6274 | 6274 | print '<input type="hidden" name="action" value="setmulticurrencyrate">'; |
| 6275 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6276 | - print '<input type="text" class="maxwidth75" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> '; |
|
| 6275 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6276 | + print '<input type="text" class="maxwidth75" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> '; |
|
| 6277 | 6277 | print '<select name="calculation_mode" id="calculation_mode">'; |
| 6278 | - print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>'; |
|
| 6279 | - print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>'; |
|
| 6278 | + print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>'; |
|
| 6279 | + print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>'; |
|
| 6280 | 6280 | print '</select> '; |
| 6281 | 6281 | print ajax_combobox("calculation_mode"); |
| 6282 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6282 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6283 | 6283 | print '</form>'; |
| 6284 | 6284 | } else { |
| 6285 | 6285 | if (!empty($rate)) { |
| 6286 | 6286 | print price($rate, 1, $langs, 0, 0); |
| 6287 | 6287 | if ($currency && $rate != 1) { |
| 6288 | - print ' <span class="opacitymedium">(' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')</span>'; |
|
| 6288 | + print ' <span class="opacitymedium">('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')</span>'; |
|
| 6289 | 6289 | } |
| 6290 | 6290 | } else { |
| 6291 | 6291 | print 1; |
@@ -6316,9 +6316,9 @@ discard block |
||
| 6316 | 6316 | // phpcs:enable |
| 6317 | 6317 | global $conf, $langs; |
| 6318 | 6318 | if ($htmlname != "none") { |
| 6319 | - print '<form method="post" action="' . $page . '">'; |
|
| 6319 | + print '<form method="post" action="'.$page.'">'; |
|
| 6320 | 6320 | print '<input type="hidden" name="action" value="setabsolutediscount">'; |
| 6321 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6321 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6322 | 6322 | print '<div class="inline-block">'; |
| 6323 | 6323 | if (!empty($discount_type)) { |
| 6324 | 6324 | if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) { |
@@ -6356,24 +6356,24 @@ discard block |
||
| 6356 | 6356 | print '</div>'; |
| 6357 | 6357 | if (empty($hidelist)) { |
| 6358 | 6358 | print '<div class="inline-block" style="padding-right: 10px">'; |
| 6359 | - $newfilter = 'discount_type=' . intval($discount_type); |
|
| 6359 | + $newfilter = 'discount_type='.intval($discount_type); |
|
| 6360 | 6360 | if (!empty($discount_type)) { |
| 6361 | 6361 | $newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available |
| 6362 | 6362 | } else { |
| 6363 | 6363 | $newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available |
| 6364 | 6364 | } |
| 6365 | 6365 | if ($filter) { |
| 6366 | - $newfilter .= ' AND (' . $filter . ')'; |
|
| 6366 | + $newfilter .= ' AND ('.$filter.')'; |
|
| 6367 | 6367 | } |
| 6368 | 6368 | // output the combo of discounts |
| 6369 | 6369 | $nbqualifiedlines = $this->select_remises((string) $selected, $htmlname, $newfilter, $socid, $maxvalue); |
| 6370 | 6370 | if ($nbqualifiedlines > 0) { |
| 6371 | - print ' <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"'; |
|
| 6371 | + print ' <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"'; |
|
| 6372 | 6372 | if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") { |
| 6373 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
| 6373 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
| 6374 | 6374 | } |
| 6375 | 6375 | if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") { |
| 6376 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
| 6376 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
| 6377 | 6377 | } |
| 6378 | 6378 | |
| 6379 | 6379 | print '>'; |
@@ -6413,23 +6413,23 @@ discard block |
||
| 6413 | 6413 | global $langs; |
| 6414 | 6414 | |
| 6415 | 6415 | if ($htmlname != "none") { |
| 6416 | - print '<form method="post" action="' . $page . '">'; |
|
| 6416 | + print '<form method="post" action="'.$page.'">'; |
|
| 6417 | 6417 | print '<input type="hidden" name="action" value="set_contact">'; |
| 6418 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6418 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6419 | 6419 | print '<table class="nobordernopadding">'; |
| 6420 | 6420 | print '<tr><td>'; |
| 6421 | 6421 | print $this->selectcontacts($societe->id, $selected, $htmlname); |
| 6422 | 6422 | $num = $this->num; |
| 6423 | 6423 | if ($num == 0) { |
| 6424 | 6424 | $addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); |
| 6425 | - print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>'; |
|
| 6425 | + print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$addcontact.'</a>'; |
|
| 6426 | 6426 | } |
| 6427 | 6427 | print '</td>'; |
| 6428 | - print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 6428 | + print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
| 6429 | 6429 | print '</tr></table></form>'; |
| 6430 | 6430 | } else { |
| 6431 | 6431 | if ($selected) { |
| 6432 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 6432 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 6433 | 6433 | $contact = new Contact($this->db); |
| 6434 | 6434 | $contact->fetch($selected); |
| 6435 | 6435 | print $contact->getFullName($langs); |
@@ -6464,20 +6464,20 @@ discard block |
||
| 6464 | 6464 | |
| 6465 | 6465 | $out = ''; |
| 6466 | 6466 | if ($htmlname != "none") { |
| 6467 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 6467 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 6468 | 6468 | $out .= '<input type="hidden" name="action" value="set_thirdparty">'; |
| 6469 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6469 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6470 | 6470 | $out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids); |
| 6471 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6471 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6472 | 6472 | $out .= '</form>'; |
| 6473 | 6473 | } else { |
| 6474 | 6474 | if ($selected) { |
| 6475 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 6475 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 6476 | 6476 | $soc = new Societe($this->db); |
| 6477 | 6477 | $soc->fetch($selected); |
| 6478 | 6478 | $out .= $soc->getNomUrl(0, ''); |
| 6479 | 6479 | } else { |
| 6480 | - $out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>'; |
|
| 6480 | + $out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>'; |
|
| 6481 | 6481 | } |
| 6482 | 6482 | } |
| 6483 | 6483 | |
@@ -6527,22 +6527,22 @@ discard block |
||
| 6527 | 6527 | $selected = 'EUR'; // Pour compatibilite |
| 6528 | 6528 | } |
| 6529 | 6529 | |
| 6530 | - $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 6530 | + $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 6531 | 6531 | if ($useempty) { |
| 6532 | 6532 | $out .= '<option value="-1" selected></option>'; |
| 6533 | 6533 | } |
| 6534 | 6534 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
| 6535 | 6535 | $labeltoshow = $currency['label']; |
| 6536 | 6536 | if ($mode == 1) { |
| 6537 | - $labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>'; |
|
| 6537 | + $labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>'; |
|
| 6538 | 6538 | } else { |
| 6539 | - $labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>'; |
|
| 6539 | + $labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>'; |
|
| 6540 | 6540 | } |
| 6541 | 6541 | |
| 6542 | 6542 | if ($selected && $selected == $code_iso) { |
| 6543 | - $out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
| 6543 | + $out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
| 6544 | 6544 | } else { |
| 6545 | - $out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
| 6545 | + $out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
| 6546 | 6546 | } |
| 6547 | 6547 | $out .= $labeltoshow; |
| 6548 | 6548 | $out .= '</option>'; |
@@ -6553,7 +6553,7 @@ discard block |
||
| 6553 | 6553 | } |
| 6554 | 6554 | |
| 6555 | 6555 | // Make select dynamic |
| 6556 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 6556 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 6557 | 6557 | $out .= ajax_combobox($htmlname); |
| 6558 | 6558 | |
| 6559 | 6559 | return $out; |
@@ -6579,10 +6579,10 @@ discard block |
||
| 6579 | 6579 | |
| 6580 | 6580 | $TCurrency = array(); |
| 6581 | 6581 | |
| 6582 | - $sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency"; |
|
| 6583 | - $sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')"; |
|
| 6582 | + $sql = "SELECT code FROM ".$this->db->prefix()."multicurrency"; |
|
| 6583 | + $sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')"; |
|
| 6584 | 6584 | if ($filter) { |
| 6585 | - $sql .= " AND " . $filter; |
|
| 6585 | + $sql .= " AND ".$filter; |
|
| 6586 | 6586 | } |
| 6587 | 6587 | $resql = $this->db->query($sql); |
| 6588 | 6588 | if ($resql) { |
@@ -6592,7 +6592,7 @@ discard block |
||
| 6592 | 6592 | } |
| 6593 | 6593 | |
| 6594 | 6594 | $out = ''; |
| 6595 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 6595 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 6596 | 6596 | if ($useempty) { |
| 6597 | 6597 | $out .= '<option value=""> </option>'; |
| 6598 | 6598 | } |
@@ -6604,13 +6604,13 @@ discard block |
||
| 6604 | 6604 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
| 6605 | 6605 | if (isset($TCurrency[$code_iso])) { |
| 6606 | 6606 | if (!empty($selected) && $selected == $code_iso) { |
| 6607 | - $out .= '<option value="' . $code_iso . '" selected="selected">'; |
|
| 6607 | + $out .= '<option value="'.$code_iso.'" selected="selected">'; |
|
| 6608 | 6608 | } else { |
| 6609 | - $out .= '<option value="' . $code_iso . '">'; |
|
| 6609 | + $out .= '<option value="'.$code_iso.'">'; |
|
| 6610 | 6610 | } |
| 6611 | 6611 | |
| 6612 | 6612 | $out .= $currency['label']; |
| 6613 | - $out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')'; |
|
| 6613 | + $out .= ' ('.$langs->getCurrencySymbol($code_iso).')'; |
|
| 6614 | 6614 | $out .= '</option>'; |
| 6615 | 6615 | } |
| 6616 | 6616 | } |
@@ -6619,7 +6619,7 @@ discard block |
||
| 6619 | 6619 | $out .= '</select>'; |
| 6620 | 6620 | |
| 6621 | 6621 | // Make select dynamic |
| 6622 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 6622 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 6623 | 6623 | $out .= ajax_combobox($htmlname); |
| 6624 | 6624 | |
| 6625 | 6625 | return $out; |
@@ -6650,7 +6650,7 @@ discard block |
||
| 6650 | 6650 | $sql .= " WHERE t.fk_pays = c.rowid"; |
| 6651 | 6651 | $sql .= " AND t.active > 0"; |
| 6652 | 6652 | $sql .= " AND t.entity IN (".getEntity('c_tva').")"; |
| 6653 | - $sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")"; |
|
| 6653 | + $sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")"; |
|
| 6654 | 6654 | $sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC"; |
| 6655 | 6655 | |
| 6656 | 6656 | $resql = $this->db->query($sql); |
@@ -6662,30 +6662,30 @@ discard block |
||
| 6662 | 6662 | |
| 6663 | 6663 | $tmparray = array(); |
| 6664 | 6664 | $tmparray['rowid'] = $obj->rowid; |
| 6665 | - $tmparray['type_vat'] = $obj->type_vat; |
|
| 6666 | - $tmparray['code'] = $obj->code; |
|
| 6665 | + $tmparray['type_vat'] = $obj->type_vat; |
|
| 6666 | + $tmparray['code'] = $obj->code; |
|
| 6667 | 6667 | $tmparray['txtva'] = $obj->taux; |
| 6668 | - $tmparray['nprtva'] = $obj->recuperableonly; |
|
| 6668 | + $tmparray['nprtva'] = $obj->recuperableonly; |
|
| 6669 | 6669 | $tmparray['localtax1'] = $obj->localtax1; |
| 6670 | 6670 | $tmparray['localtax1_type'] = $obj->localtax1_type; |
| 6671 | 6671 | $tmparray['localtax2'] = $obj->localtax2; |
| 6672 | 6672 | $tmparray['localtax2_type'] = $obj->localtax1_type; |
| 6673 | - $tmparray['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or * |
|
| 6674 | - $tmparray['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 |
|
| 6673 | + $tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or * |
|
| 6674 | + $tmparray['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 |
|
| 6675 | 6675 | $positiverates = ''; |
| 6676 | 6676 | if ($obj->taux) { |
| 6677 | - $positiverates .= ($positiverates ? '/' : '') . $obj->taux; |
|
| 6677 | + $positiverates .= ($positiverates ? '/' : '').$obj->taux; |
|
| 6678 | 6678 | } |
| 6679 | 6679 | if ($obj->localtax1) { |
| 6680 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax1; |
|
| 6680 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax1; |
|
| 6681 | 6681 | } |
| 6682 | 6682 | if ($obj->localtax2) { |
| 6683 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax2; |
|
| 6683 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax2; |
|
| 6684 | 6684 | } |
| 6685 | 6685 | if (empty($positiverates)) { |
| 6686 | 6686 | $positiverates = '0'; |
| 6687 | 6687 | } |
| 6688 | - $tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
| 6688 | + $tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
| 6689 | 6689 | |
| 6690 | 6690 | $this->cache_vatrates[$obj->rowid] = $tmparray; |
| 6691 | 6691 | } |
@@ -6705,7 +6705,7 @@ discard block |
||
| 6705 | 6705 | return -1; |
| 6706 | 6706 | } |
| 6707 | 6707 | } else { |
| 6708 | - $this->error = '<span class="error">' . $this->db->error() . '</span>'; |
|
| 6708 | + $this->error = '<span class="error">'.$this->db->error().'</span>'; |
|
| 6709 | 6709 | return -2; |
| 6710 | 6710 | } |
| 6711 | 6711 | } |
@@ -6758,9 +6758,9 @@ discard block |
||
| 6758 | 6758 | // Check parameters |
| 6759 | 6759 | if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) { |
| 6760 | 6760 | if ($societe_vendeuse->id == $mysoc->id) { |
| 6761 | - $return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>'; |
|
| 6761 | + $return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>'; |
|
| 6762 | 6762 | } else { |
| 6763 | - $return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>'; |
|
| 6763 | + $return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>'; |
|
| 6764 | 6764 | } |
| 6765 | 6765 | return $return; |
| 6766 | 6766 | } |
@@ -6772,12 +6772,12 @@ discard block |
||
| 6772 | 6772 | // Define list of countries to use to search VAT rates to show |
| 6773 | 6773 | // First we defined code_country to use to find list |
| 6774 | 6774 | if (is_object($societe_vendeuse)) { |
| 6775 | - $code_country = "'" . $societe_vendeuse->country_code . "'"; |
|
| 6775 | + $code_country = "'".$societe_vendeuse->country_code."'"; |
|
| 6776 | 6776 | } else { |
| 6777 | - $code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente |
|
| 6777 | + $code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente |
|
| 6778 | 6778 | } |
| 6779 | 6779 | if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on |
| 6780 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 6780 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 6781 | 6781 | // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries |
| 6782 | 6782 | // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country |
| 6783 | 6783 | $selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); |
@@ -6787,27 +6787,27 @@ discard block |
||
| 6787 | 6787 | if ($type == 1) { // We know product is a service |
| 6788 | 6788 | switch ($selectVatComboMode) { |
| 6789 | 6789 | case '1': |
| 6790 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6790 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6791 | 6791 | break; |
| 6792 | 6792 | case '2': |
| 6793 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
| 6793 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
| 6794 | 6794 | break; |
| 6795 | 6795 | } |
| 6796 | 6796 | } |
| 6797 | 6797 | } elseif (!$idprod) { // We don't know type of product |
| 6798 | 6798 | switch ($selectVatComboMode) { |
| 6799 | 6799 | case '1': |
| 6800 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6800 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6801 | 6801 | break; |
| 6802 | 6802 | case '2': |
| 6803 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
| 6803 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
| 6804 | 6804 | break; |
| 6805 | 6805 | } |
| 6806 | 6806 | } else { |
| 6807 | 6807 | $prodstatic = new Product($this->db); |
| 6808 | 6808 | $prodstatic->fetch($idprod); |
| 6809 | 6809 | if ($prodstatic->type == Product::TYPE_SERVICE) { // We know product is a service |
| 6810 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6810 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6811 | 6811 | } |
| 6812 | 6812 | } |
| 6813 | 6813 | } |
@@ -6869,13 +6869,13 @@ discard block |
||
| 6869 | 6869 | // Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead |
| 6870 | 6870 | // of using supplier invoices (this is a very bad idea !) |
| 6871 | 6871 | if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) { |
| 6872 | - $title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"'; |
|
| 6872 | + $title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"'; |
|
| 6873 | 6873 | $disabled = true; |
| 6874 | 6874 | } |
| 6875 | 6875 | } |
| 6876 | 6876 | |
| 6877 | 6877 | if (!$options_only) { |
| 6878 | - $return .= '<select class="flat minwidth75imp maxwidth100 right" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>'; |
|
| 6878 | + $return .= '<select class="flat minwidth75imp maxwidth100 right" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>'; |
|
| 6879 | 6879 | } |
| 6880 | 6880 | |
| 6881 | 6881 | $selectedfound = false; |
@@ -6889,13 +6889,13 @@ discard block |
||
| 6889 | 6889 | $key = $rate['txtva']; |
| 6890 | 6890 | $key .= $rate['nprtva'] ? '*' : ''; |
| 6891 | 6891 | if ($mode > 0 && $rate['code']) { |
| 6892 | - $key .= ' (' . $rate['code'] . ')'; |
|
| 6892 | + $key .= ' ('.$rate['code'].')'; |
|
| 6893 | 6893 | } |
| 6894 | 6894 | if ($mode < 0) { |
| 6895 | 6895 | $key = $rate['rowid']; |
| 6896 | 6896 | } |
| 6897 | 6897 | |
| 6898 | - $return .= '<option value="' . $key . '"'; |
|
| 6898 | + $return .= '<option value="'.$key.'"'; |
|
| 6899 | 6899 | if (!$selectedfound) { |
| 6900 | 6900 | if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag |
| 6901 | 6901 | if ($defaultcode == $rate['code']) { |
@@ -6966,7 +6966,7 @@ discard block |
||
| 6966 | 6966 | 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 = 0, $addplusone = '', $adddateof = '') |
| 6967 | 6967 | { |
| 6968 | 6968 | // phpcs:enable |
| 6969 | - dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
| 6969 | + dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
| 6970 | 6970 | $retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof); |
| 6971 | 6971 | if (!empty($nooutput)) { |
| 6972 | 6972 | return $retstring; |
@@ -6995,11 +6995,11 @@ discard block |
||
| 6995 | 6995 | { |
| 6996 | 6996 | global $langs; |
| 6997 | 6997 | |
| 6998 | - $ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
| 6998 | + $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
| 6999 | 6999 | if ($forcenewline) { |
| 7000 | 7000 | $ret .= '<br>'; |
| 7001 | 7001 | } |
| 7002 | - $ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
| 7002 | + $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
| 7003 | 7003 | return $ret; |
| 7004 | 7004 | } |
| 7005 | 7005 | |
@@ -7065,7 +7065,7 @@ discard block |
||
| 7065 | 7065 | $orig_set_time = $set_time; |
| 7066 | 7066 | |
| 7067 | 7067 | if ($set_time === '' && $emptydate == 0) { |
| 7068 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 7068 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 7069 | 7069 | if ($gm == 'tzuser' || $gm == 'tzuserrel') { |
| 7070 | 7070 | $set_time = dol_now($gm); |
| 7071 | 7071 | } else { |
@@ -7137,38 +7137,38 @@ discard block |
||
| 7137 | 7137 | // Calendrier popup version eldy |
| 7138 | 7138 | if ($usecalendar == "eldy") { |
| 7139 | 7139 | // Input area to enter date manually |
| 7140 | - $retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate center" maxlength="11" value="' . $formated_date . '"'; |
|
| 7140 | + $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"'; |
|
| 7141 | 7141 | $retstring .= ($disabled ? ' disabled' : ''); |
| 7142 | - $retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 7142 | + $retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 7143 | 7143 | $retstring .= ' autocomplete="off">'; |
| 7144 | 7144 | |
| 7145 | 7145 | // Icon calendar |
| 7146 | 7146 | $retstringbuttom = ''; |
| 7147 | 7147 | if (!$disabled) { |
| 7148 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"'; |
|
| 7149 | - $base = DOL_URL_ROOT . '/core/'; |
|
| 7150 | - $retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"'; |
|
| 7151 | - $retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 7148 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"'; |
|
| 7149 | + $base = DOL_URL_ROOT.'/core/'; |
|
| 7150 | + $retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"'; |
|
| 7151 | + $retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 7152 | 7152 | } else { |
| 7153 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 7153 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 7154 | 7154 | } |
| 7155 | - $retstring = $retstringbuttom . $retstring; |
|
| 7155 | + $retstring = $retstringbuttom.$retstring; |
|
| 7156 | 7156 | |
| 7157 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
| 7158 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
| 7159 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
| 7157 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
| 7158 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
| 7159 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
| 7160 | 7160 | } elseif ($usecalendar == 'jquery' || $usecalendar == 'html') { |
| 7161 | 7161 | if (!$disabled && $usecalendar != 'html') { |
| 7162 | 7162 | // Output javascript for datepicker |
| 7163 | 7163 | $minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (idate('Y') - 100)); |
| 7164 | 7164 | $maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (idate('Y') + 100)); |
| 7165 | 7165 | |
| 7166 | - $retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">'; |
|
| 7167 | - $retstring .= "$(function(){ $('#" . $prefix . "').datepicker({ |
|
| 7168 | - dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "', |
|
| 7166 | + $retstring .= '<script nonce="'.getNonce().'" type="text/javascript">'; |
|
| 7167 | + $retstring .= "$(function(){ $('#".$prefix."').datepicker({ |
|
| 7168 | + dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."', |
|
| 7169 | 7169 | autoclose: true, |
| 7170 | 7170 | todayHighlight: true, |
| 7171 | - yearRange: '" . $minYear . ":" . $maxYear . "',"; |
|
| 7171 | + yearRange: '" . $minYear.":".$maxYear."',"; |
|
| 7172 | 7172 | if (!empty($conf->dol_use_jmobile)) { |
| 7173 | 7173 | $retstring .= " |
| 7174 | 7174 | beforeShow: function (input, datePicker) { |
@@ -7183,7 +7183,7 @@ discard block |
||
| 7183 | 7183 | if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) { |
| 7184 | 7184 | $retstring .= " |
| 7185 | 7185 | showOn: 'button', /* both has problem with autocompletion */ |
| 7186 | - buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png', |
|
| 7186 | + buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png', |
|
| 7187 | 7187 | buttonImageOnly: true"; |
| 7188 | 7188 | } |
| 7189 | 7189 | $retstring .= " |
@@ -7195,46 +7195,46 @@ discard block |
||
| 7195 | 7195 | $retstring .= '<div class="nowraponall inline-block divfordateinput">'; |
| 7196 | 7196 | $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"'; |
| 7197 | 7197 | $retstring .= ($disabled ? ' disabled' : ''); |
| 7198 | - $retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : ''); |
|
| 7199 | - $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 7198 | + $retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : ''); |
|
| 7199 | + $retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 7200 | 7200 | $retstring .= ' autocomplete="off">'; |
| 7201 | 7201 | |
| 7202 | 7202 | // Icone calendrier |
| 7203 | 7203 | if ($disabled) { |
| 7204 | - $retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 7205 | - $retstring = $retstringbutton . $retstring; |
|
| 7204 | + $retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 7205 | + $retstring = $retstringbutton.$retstring; |
|
| 7206 | 7206 | } |
| 7207 | 7207 | |
| 7208 | 7208 | $retstring .= '</div>'; |
| 7209 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
| 7210 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
| 7211 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
| 7209 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
| 7210 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
| 7211 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
| 7212 | 7212 | } else { |
| 7213 | 7213 | $retstring .= "Bad value of MAIN_POPUP_CALENDAR"; |
| 7214 | 7214 | } |
| 7215 | 7215 | } else { |
| 7216 | 7216 | // Show date with combo selects |
| 7217 | 7217 | // Day |
| 7218 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">'; |
|
| 7218 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">'; |
|
| 7219 | 7219 | |
| 7220 | 7220 | if ($emptydate || $set_time == -1) { |
| 7221 | 7221 | $retstring .= '<option value="0" selected> </option>'; |
| 7222 | 7222 | } |
| 7223 | 7223 | |
| 7224 | 7224 | for ($day = 1; $day <= 31; $day++) { |
| 7225 | - $retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>'; |
|
| 7225 | + $retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>'; |
|
| 7226 | 7226 | } |
| 7227 | 7227 | |
| 7228 | 7228 | $retstring .= "</select>"; |
| 7229 | 7229 | |
| 7230 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">'; |
|
| 7230 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">'; |
|
| 7231 | 7231 | if ($emptydate || $set_time == -1) { |
| 7232 | 7232 | $retstring .= '<option value="0" selected> </option>'; |
| 7233 | 7233 | } |
| 7234 | 7234 | |
| 7235 | 7235 | // Month |
| 7236 | 7236 | for ($month = 1; $month <= 12; $month++) { |
| 7237 | - $retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>'; |
|
| 7237 | + $retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>'; |
|
| 7238 | 7238 | $retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b"); |
| 7239 | 7239 | $retstring .= "</option>"; |
| 7240 | 7240 | } |
@@ -7242,13 +7242,13 @@ discard block |
||
| 7242 | 7242 | |
| 7243 | 7243 | // Year |
| 7244 | 7244 | if ($emptydate || $set_time == -1) { |
| 7245 | - $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 . '">'; |
|
| 7245 | + $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.'">'; |
|
| 7246 | 7246 | } else { |
| 7247 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">'; |
|
| 7247 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">'; |
|
| 7248 | 7248 | |
| 7249 | 7249 | $syear = (int) $syear; |
| 7250 | 7250 | for ($year = $syear - 10; $year < (int) $syear + 10; $year++) { |
| 7251 | - $retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>'; |
|
| 7251 | + $retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>'; |
|
| 7252 | 7252 | } |
| 7253 | 7253 | $retstring .= "</select>\n"; |
| 7254 | 7254 | } |
@@ -7272,15 +7272,15 @@ discard block |
||
| 7272 | 7272 | } |
| 7273 | 7273 | } |
| 7274 | 7274 | // Show hour |
| 7275 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">'; |
|
| 7275 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">'; |
|
| 7276 | 7276 | if ($emptyhours) { |
| 7277 | 7277 | $retstring .= '<option value="-1"> </option>'; |
| 7278 | 7278 | } |
| 7279 | 7279 | for ($hour = $hourstart; $hour < $hourend; $hour++) { |
| 7280 | 7280 | if (strlen($hour) < 2) { |
| 7281 | - $hour = "0" . $hour; |
|
| 7281 | + $hour = "0".$hour; |
|
| 7282 | 7282 | } |
| 7283 | - $retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour; |
|
| 7283 | + $retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour; |
|
| 7284 | 7284 | //$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H'); |
| 7285 | 7285 | $retstring .= '</option>'; |
| 7286 | 7286 | } |
@@ -7293,17 +7293,17 @@ discard block |
||
| 7293 | 7293 | |
| 7294 | 7294 | if ($m) { |
| 7295 | 7295 | // Show minutes |
| 7296 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">'; |
|
| 7296 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">'; |
|
| 7297 | 7297 | if ($emptyhours) { |
| 7298 | 7298 | $retstring .= '<option value="-1"> </option>'; |
| 7299 | 7299 | } |
| 7300 | 7300 | for ($min = 0; $min < 60; $min += $stepminutes) { |
| 7301 | 7301 | $min_str = sprintf("%02d", $min); |
| 7302 | - $retstring .= '<option value="' . $min_str . '"' . (($min_str == $smin) ? ' selected' : '') . '>' . $min_str . '</option>'; |
|
| 7302 | + $retstring .= '<option value="'.$min_str.'"'.(($min_str == $smin) ? ' selected' : '').'>'.$min_str.'</option>'; |
|
| 7303 | 7303 | } |
| 7304 | 7304 | $retstring .= '</select>'; |
| 7305 | 7305 | |
| 7306 | - $retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">'; |
|
| 7306 | + $retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">'; |
|
| 7307 | 7307 | } |
| 7308 | 7308 | |
| 7309 | 7309 | if ($d && $h) { |
@@ -7326,10 +7326,10 @@ discard block |
||
| 7326 | 7326 | |
| 7327 | 7327 | // Generate the date part, depending on the use or not of the javascript calendar |
| 7328 | 7328 | if ($addnowlink == 1) { // server time expressed in user time setup |
| 7329 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
| 7330 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7331 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7332 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7329 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
| 7330 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7331 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7332 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7333 | 7333 | } elseif ($addnowlink == 2) { |
| 7334 | 7334 | /* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix. |
| 7335 | 7335 | * This break application for foreign languages. |
@@ -7338,10 +7338,10 @@ discard block |
||
| 7338 | 7338 | $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);'; |
| 7339 | 7339 | $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());'; |
| 7340 | 7340 | */ |
| 7341 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
| 7342 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7343 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7344 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7341 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
| 7342 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7343 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7344 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7345 | 7345 | } |
| 7346 | 7346 | /*if ($usecalendar == "eldy") |
| 7347 | 7347 | { |
@@ -7361,11 +7361,11 @@ discard block |
||
| 7361 | 7361 | } |
| 7362 | 7362 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); '; |
| 7363 | 7363 | if ($addnowlink == 1) { |
| 7364 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
| 7365 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
| 7364 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
| 7365 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
| 7366 | 7366 | } elseif ($addnowlink == 2) { |
| 7367 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());'; |
|
| 7368 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
| 7367 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());'; |
|
| 7368 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
| 7369 | 7369 | } |
| 7370 | 7370 | |
| 7371 | 7371 | if ($fullday) { |
@@ -7379,11 +7379,11 @@ discard block |
||
| 7379 | 7379 | } |
| 7380 | 7380 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); '; |
| 7381 | 7381 | if ($addnowlink == 1) { |
| 7382 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
| 7383 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
| 7382 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
| 7383 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
| 7384 | 7384 | } elseif ($addnowlink == 2) { |
| 7385 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());'; |
|
| 7386 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
| 7385 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());'; |
|
| 7386 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
| 7387 | 7387 | } |
| 7388 | 7388 | if ($fullday) { |
| 7389 | 7389 | $reset_scripts .= ' } '; |
@@ -7391,7 +7391,7 @@ discard block |
||
| 7391 | 7391 | } |
| 7392 | 7392 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
| 7393 | 7393 | if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
| 7394 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">'; |
|
| 7394 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">'; |
|
| 7395 | 7395 | $retstring .= $langs->trans("Now"); |
| 7396 | 7396 | $retstring .= '</button> '; |
| 7397 | 7397 | } |
@@ -7403,16 +7403,16 @@ discard block |
||
| 7403 | 7403 | $reset_scripts = ""; |
| 7404 | 7404 | |
| 7405 | 7405 | // Generate the date part, depending on the use or not of the javascript calendar |
| 7406 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');'; |
|
| 7407 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7408 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7409 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7406 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');'; |
|
| 7407 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7408 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7409 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7410 | 7410 | // Update the hour part |
| 7411 | 7411 | if ($h) { |
| 7412 | 7412 | if ($fullday) { |
| 7413 | 7413 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
| 7414 | 7414 | } |
| 7415 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
| 7415 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
| 7416 | 7416 | if ($fullday) { |
| 7417 | 7417 | $reset_scripts .= ' } '; |
| 7418 | 7418 | } |
@@ -7422,14 +7422,14 @@ discard block |
||
| 7422 | 7422 | if ($fullday) { |
| 7423 | 7423 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
| 7424 | 7424 | } |
| 7425 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
| 7425 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
| 7426 | 7426 | if ($fullday) { |
| 7427 | 7427 | $reset_scripts .= ' } '; |
| 7428 | 7428 | } |
| 7429 | 7429 | } |
| 7430 | 7430 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
| 7431 | 7431 | if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) { |
| 7432 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">'; |
|
| 7432 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">'; |
|
| 7433 | 7433 | $retstring .= $langs->trans("DateStartPlusOne"); |
| 7434 | 7434 | $retstring .= '</button> '; |
| 7435 | 7435 | } |
@@ -7487,17 +7487,17 @@ discard block |
||
| 7487 | 7487 | unset($TDurationTypes[$value]); |
| 7488 | 7488 | } |
| 7489 | 7489 | |
| 7490 | - $retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">'; |
|
| 7490 | + $retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">'; |
|
| 7491 | 7491 | foreach ($TDurationTypes as $key => $typeduration) { |
| 7492 | - $retstring .= '<option value="' . $key . '"'; |
|
| 7492 | + $retstring .= '<option value="'.$key.'"'; |
|
| 7493 | 7493 | if ($key == $selected) { |
| 7494 | 7494 | $retstring .= " selected"; |
| 7495 | 7495 | } |
| 7496 | - $retstring .= ">" . $typeduration . "</option>"; |
|
| 7496 | + $retstring .= ">".$typeduration."</option>"; |
|
| 7497 | 7497 | } |
| 7498 | 7498 | $retstring .= "</select>"; |
| 7499 | 7499 | |
| 7500 | - $retstring .= ajax_combobox('select_' . $prefix . 'type_duration'); |
|
| 7500 | + $retstring .= ajax_combobox('select_'.$prefix.'type_duration'); |
|
| 7501 | 7501 | |
| 7502 | 7502 | return $retstring; |
| 7503 | 7503 | } |
@@ -7529,30 +7529,30 @@ discard block |
||
| 7529 | 7529 | |
| 7530 | 7530 | // Hours |
| 7531 | 7531 | if ($iSecond != '') { |
| 7532 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 7532 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 7533 | 7533 | |
| 7534 | 7534 | $hourSelected = convertSecondToTime($iSecond, 'allhour'); |
| 7535 | 7535 | $minSelected = convertSecondToTime($iSecond, 'min'); |
| 7536 | 7536 | } |
| 7537 | 7537 | |
| 7538 | 7538 | if ($typehour == 'select') { |
| 7539 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>'; |
|
| 7539 | + $retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>'; |
|
| 7540 | 7540 | for ($hour = 0; $hour < 25; $hour++) { // For a duration, we allow 24 hours |
| 7541 | - $retstring .= '<option value="' . $hour . '"'; |
|
| 7541 | + $retstring .= '<option value="'.$hour.'"'; |
|
| 7542 | 7542 | if (is_numeric($hourSelected) && $hourSelected == $hour) { |
| 7543 | 7543 | $retstring .= " selected"; |
| 7544 | 7544 | } |
| 7545 | - $retstring .= ">" . $hour . "</option>"; |
|
| 7545 | + $retstring .= ">".$hour."</option>"; |
|
| 7546 | 7546 | } |
| 7547 | 7547 | $retstring .= "</select>"; |
| 7548 | 7548 | } elseif ($typehour == 'text' || $typehour == 'textselect') { |
| 7549 | - $retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">'; |
|
| 7549 | + $retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">'; |
|
| 7550 | 7550 | } else { |
| 7551 | 7551 | return 'BadValueForParameterTypeHour'; |
| 7552 | 7552 | } |
| 7553 | 7553 | |
| 7554 | 7554 | if ($typehour != 'text') { |
| 7555 | - $retstring .= ' ' . $langs->trans('HourShort'); |
|
| 7555 | + $retstring .= ' '.$langs->trans('HourShort'); |
|
| 7556 | 7556 | } else { |
| 7557 | 7557 | $retstring .= '<span class="">:</span>'; |
| 7558 | 7558 | } |
@@ -7567,21 +7567,21 @@ discard block |
||
| 7567 | 7567 | } |
| 7568 | 7568 | |
| 7569 | 7569 | if ($typehour == 'select' || $typehour == 'textselect') { |
| 7570 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>'; |
|
| 7570 | + $retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>'; |
|
| 7571 | 7571 | for ($min = 0; $min <= 55; $min += 5) { |
| 7572 | - $retstring .= '<option value="' . $min . '"'; |
|
| 7572 | + $retstring .= '<option value="'.$min.'"'; |
|
| 7573 | 7573 | if (is_numeric($minSelected) && $minSelected == $min) { |
| 7574 | 7574 | $retstring .= ' selected'; |
| 7575 | 7575 | } |
| 7576 | - $retstring .= '>' . $min . '</option>'; |
|
| 7576 | + $retstring .= '>'.$min.'</option>'; |
|
| 7577 | 7577 | } |
| 7578 | 7578 | $retstring .= "</select>"; |
| 7579 | 7579 | } elseif ($typehour == 'text') { |
| 7580 | - $retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">'; |
|
| 7580 | + $retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">'; |
|
| 7581 | 7581 | } |
| 7582 | 7582 | |
| 7583 | 7583 | if ($typehour != 'text') { |
| 7584 | - $retstring .= ' ' . $langs->trans('MinuteShort'); |
|
| 7584 | + $retstring .= ' '.$langs->trans('MinuteShort'); |
|
| 7585 | 7585 | } |
| 7586 | 7586 | |
| 7587 | 7587 | $retstring .= "</span>"; |
@@ -7629,7 +7629,7 @@ discard block |
||
| 7629 | 7629 | $placeholder = ''; |
| 7630 | 7630 | |
| 7631 | 7631 | if ($selected && empty($selected_input_value)) { |
| 7632 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
| 7632 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
| 7633 | 7633 | $tickettmpselect = new Ticket($this->db); |
| 7634 | 7634 | $tickettmpselect->fetch($selected); |
| 7635 | 7635 | $selected_input_value = $tickettmpselect->ref; |
@@ -7637,17 +7637,17 @@ discard block |
||
| 7637 | 7637 | } |
| 7638 | 7638 | |
| 7639 | 7639 | $urloption = ''; |
| 7640 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7640 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7641 | 7641 | |
| 7642 | 7642 | if (empty($hidelabel)) { |
| 7643 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7643 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7644 | 7644 | } elseif ($hidelabel > 1) { |
| 7645 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7645 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7646 | 7646 | if ($hidelabel == 2) { |
| 7647 | 7647 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7648 | 7648 | } |
| 7649 | 7649 | } |
| 7650 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 7650 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 7651 | 7651 | if ($hidelabel == 3) { |
| 7652 | 7652 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7653 | 7653 | } |
@@ -7691,8 +7691,8 @@ discard block |
||
| 7691 | 7691 | |
| 7692 | 7692 | $sql = "SELECT "; |
| 7693 | 7693 | $sql .= $selectFields; |
| 7694 | - $sql .= " FROM " . $this->db->prefix() . "ticket as p"; |
|
| 7695 | - $sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')'; |
|
| 7694 | + $sql .= " FROM ".$this->db->prefix()."ticket as p"; |
|
| 7695 | + $sql .= ' WHERE p.entity IN ('.getEntity('ticket').')'; |
|
| 7696 | 7696 | |
| 7697 | 7697 | // Add criteria on ref/label |
| 7698 | 7698 | if ($filterkey != '') { |
@@ -7708,7 +7708,7 @@ discard block |
||
| 7708 | 7708 | if ($i > 0) { |
| 7709 | 7709 | $sql .= " AND "; |
| 7710 | 7710 | } |
| 7711 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7711 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7712 | 7712 | $sql .= ")"; |
| 7713 | 7713 | $i++; |
| 7714 | 7714 | } |
@@ -7721,22 +7721,22 @@ discard block |
||
| 7721 | 7721 | $sql .= $this->db->plimit($limit, 0); |
| 7722 | 7722 | |
| 7723 | 7723 | // Build output string |
| 7724 | - dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG); |
|
| 7724 | + dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG); |
|
| 7725 | 7725 | $result = $this->db->query($sql); |
| 7726 | 7726 | if ($result) { |
| 7727 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
| 7728 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php'; |
|
| 7727 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
| 7728 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php'; |
|
| 7729 | 7729 | |
| 7730 | 7730 | $num = $this->db->num_rows($result); |
| 7731 | 7731 | |
| 7732 | 7732 | $events = array(); |
| 7733 | 7733 | |
| 7734 | 7734 | if (!$forcecombo) { |
| 7735 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7735 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7736 | 7736 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt('TICKET_USE_SEARCH_TO_SELECT')); |
| 7737 | 7737 | } |
| 7738 | 7738 | |
| 7739 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7739 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7740 | 7740 | |
| 7741 | 7741 | $textifempty = ''; |
| 7742 | 7742 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7753,7 +7753,7 @@ discard block |
||
| 7753 | 7753 | } |
| 7754 | 7754 | } |
| 7755 | 7755 | if ($showempty) { |
| 7756 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
| 7756 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
| 7757 | 7757 | } |
| 7758 | 7758 | |
| 7759 | 7759 | $i = 0; |
@@ -7807,13 +7807,13 @@ discard block |
||
| 7807 | 7807 | $outkey = $objp->rowid; |
| 7808 | 7808 | $outref = $objp->ref; |
| 7809 | 7809 | |
| 7810 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 7810 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 7811 | 7811 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 7812 | 7812 | $opt .= '>'; |
| 7813 | 7813 | $opt .= $objp->ref; |
| 7814 | 7814 | $objRef = $objp->ref; |
| 7815 | 7815 | if (!empty($filterkey) && $filterkey != '') { |
| 7816 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7816 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7817 | 7817 | } |
| 7818 | 7818 | |
| 7819 | 7819 | $opt .= "</option>\n"; |
@@ -7854,7 +7854,7 @@ discard block |
||
| 7854 | 7854 | $placeholder = ''; |
| 7855 | 7855 | |
| 7856 | 7856 | if ($selected && empty($selected_input_value)) { |
| 7857 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 7857 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 7858 | 7858 | $projecttmpselect = new Project($this->db); |
| 7859 | 7859 | $projecttmpselect->fetch($selected); |
| 7860 | 7860 | $selected_input_value = $projecttmpselect->ref; |
@@ -7862,17 +7862,17 @@ discard block |
||
| 7862 | 7862 | } |
| 7863 | 7863 | |
| 7864 | 7864 | $urloption = ''; |
| 7865 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7865 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7866 | 7866 | |
| 7867 | 7867 | if (empty($hidelabel)) { |
| 7868 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7868 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7869 | 7869 | } elseif ($hidelabel > 1) { |
| 7870 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7870 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7871 | 7871 | if ($hidelabel == 2) { |
| 7872 | 7872 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7873 | 7873 | } |
| 7874 | 7874 | } |
| 7875 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 7875 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 7876 | 7876 | if ($hidelabel == 3) { |
| 7877 | 7877 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7878 | 7878 | } |
@@ -7915,8 +7915,8 @@ discard block |
||
| 7915 | 7915 | |
| 7916 | 7916 | $sql = "SELECT "; |
| 7917 | 7917 | $sql .= $selectFields; |
| 7918 | - $sql .= " FROM " . $this->db->prefix() . "projet as p"; |
|
| 7919 | - $sql .= ' WHERE p.entity IN (' . getEntity('project') . ')'; |
|
| 7918 | + $sql .= " FROM ".$this->db->prefix()."projet as p"; |
|
| 7919 | + $sql .= ' WHERE p.entity IN ('.getEntity('project').')'; |
|
| 7920 | 7920 | |
| 7921 | 7921 | // Add criteria on ref/label |
| 7922 | 7922 | if ($filterkey != '') { |
@@ -7932,7 +7932,7 @@ discard block |
||
| 7932 | 7932 | if ($i > 0) { |
| 7933 | 7933 | $sql .= " AND "; |
| 7934 | 7934 | } |
| 7935 | - $sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7935 | + $sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7936 | 7936 | $sql .= ""; |
| 7937 | 7937 | $i++; |
| 7938 | 7938 | } |
@@ -7945,22 +7945,22 @@ discard block |
||
| 7945 | 7945 | $sql .= $this->db->plimit($limit, 0); |
| 7946 | 7946 | |
| 7947 | 7947 | // Build output string |
| 7948 | - dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG); |
|
| 7948 | + dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG); |
|
| 7949 | 7949 | $result = $this->db->query($sql); |
| 7950 | 7950 | if ($result) { |
| 7951 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 7952 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 7951 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 7952 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 7953 | 7953 | |
| 7954 | 7954 | $num = $this->db->num_rows($result); |
| 7955 | 7955 | |
| 7956 | 7956 | $events = array(); |
| 7957 | 7957 | |
| 7958 | 7958 | if (!$forcecombo) { |
| 7959 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7959 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7960 | 7960 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt('PROJECT_USE_SEARCH_TO_SELECT')); |
| 7961 | 7961 | } |
| 7962 | 7962 | |
| 7963 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7963 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7964 | 7964 | |
| 7965 | 7965 | $textifempty = ''; |
| 7966 | 7966 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7977,7 +7977,7 @@ discard block |
||
| 7977 | 7977 | } |
| 7978 | 7978 | } |
| 7979 | 7979 | if ($showempty) { |
| 7980 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
| 7980 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
| 7981 | 7981 | } |
| 7982 | 7982 | |
| 7983 | 7983 | $i = 0; |
@@ -8035,13 +8035,13 @@ discard block |
||
| 8035 | 8035 | $outlabel = $objp->label; |
| 8036 | 8036 | $outtype = $objp->fk_product_type; |
| 8037 | 8037 | |
| 8038 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 8038 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 8039 | 8039 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 8040 | 8040 | $opt .= '>'; |
| 8041 | 8041 | $opt .= $objp->ref; |
| 8042 | 8042 | $objRef = $objp->ref; |
| 8043 | 8043 | if (!empty($filterkey) && $filterkey != '') { |
| 8044 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 8044 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 8045 | 8045 | } |
| 8046 | 8046 | |
| 8047 | 8047 | $opt .= "</option>\n"; |
@@ -8083,7 +8083,7 @@ discard block |
||
| 8083 | 8083 | $placeholder = ''; |
| 8084 | 8084 | |
| 8085 | 8085 | if ($selected && empty($selected_input_value)) { |
| 8086 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 8086 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 8087 | 8087 | $adherenttmpselect = new Adherent($this->db); |
| 8088 | 8088 | $adherenttmpselect->fetch($selected); |
| 8089 | 8089 | $selected_input_value = $adherenttmpselect->ref; |
@@ -8092,17 +8092,17 @@ discard block |
||
| 8092 | 8092 | |
| 8093 | 8093 | $urloption = ''; |
| 8094 | 8094 | |
| 8095 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 8095 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 8096 | 8096 | |
| 8097 | 8097 | if (empty($hidelabel)) { |
| 8098 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 8098 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 8099 | 8099 | } elseif ($hidelabel > 1) { |
| 8100 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 8100 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 8101 | 8101 | if ($hidelabel == 2) { |
| 8102 | 8102 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 8103 | 8103 | } |
| 8104 | 8104 | } |
| 8105 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 8105 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 8106 | 8106 | if ($hidelabel == 3) { |
| 8107 | 8107 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 8108 | 8108 | } |
@@ -8147,8 +8147,8 @@ discard block |
||
| 8147 | 8147 | |
| 8148 | 8148 | $sql = "SELECT "; |
| 8149 | 8149 | $sql .= $selectFields; |
| 8150 | - $sql .= " FROM " . $this->db->prefix() . "adherent as p"; |
|
| 8151 | - $sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')'; |
|
| 8150 | + $sql .= " FROM ".$this->db->prefix()."adherent as p"; |
|
| 8151 | + $sql .= ' WHERE p.entity IN ('.getEntity('adherent').')'; |
|
| 8152 | 8152 | |
| 8153 | 8153 | // Add criteria on ref/label |
| 8154 | 8154 | if ($filterkey != '') { |
@@ -8164,8 +8164,8 @@ discard block |
||
| 8164 | 8164 | if ($i > 0) { |
| 8165 | 8165 | $sql .= " AND "; |
| 8166 | 8166 | } |
| 8167 | - $sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 8168 | - $sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
| 8167 | + $sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 8168 | + $sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
| 8169 | 8169 | $i++; |
| 8170 | 8170 | } |
| 8171 | 8171 | if (count($search_crit) > 1) { |
@@ -8174,27 +8174,27 @@ discard block |
||
| 8174 | 8174 | $sql .= ')'; |
| 8175 | 8175 | } |
| 8176 | 8176 | if ($status != -1) { |
| 8177 | - $sql .= ' AND statut = ' . ((int) $status); |
|
| 8177 | + $sql .= ' AND statut = '.((int) $status); |
|
| 8178 | 8178 | } |
| 8179 | 8179 | $sql .= $this->db->plimit($limit, 0); |
| 8180 | 8180 | |
| 8181 | 8181 | // Build output string |
| 8182 | - dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG); |
|
| 8182 | + dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG); |
|
| 8183 | 8183 | $result = $this->db->query($sql); |
| 8184 | 8184 | if ($result) { |
| 8185 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 8186 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php'; |
|
| 8185 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 8186 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; |
|
| 8187 | 8187 | |
| 8188 | 8188 | $num = $this->db->num_rows($result); |
| 8189 | 8189 | |
| 8190 | 8190 | $events = array(); |
| 8191 | 8191 | |
| 8192 | 8192 | if (!$forcecombo) { |
| 8193 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8193 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8194 | 8194 | $out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : ''); |
| 8195 | 8195 | } |
| 8196 | 8196 | |
| 8197 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 8197 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 8198 | 8198 | |
| 8199 | 8199 | $textifempty = ''; |
| 8200 | 8200 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -8211,7 +8211,7 @@ discard block |
||
| 8211 | 8211 | } |
| 8212 | 8212 | } |
| 8213 | 8213 | if ($showempty) { |
| 8214 | - $out .= '<option value="-1" selected>' . $textifempty . '</option>'; |
|
| 8214 | + $out .= '<option value="-1" selected>'.$textifempty.'</option>'; |
|
| 8215 | 8215 | } |
| 8216 | 8216 | |
| 8217 | 8217 | $i = 0; |
@@ -8267,11 +8267,11 @@ discard block |
||
| 8267 | 8267 | $outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname); |
| 8268 | 8268 | $outtype = $objp->fk_adherent_type; |
| 8269 | 8269 | |
| 8270 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 8270 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 8271 | 8271 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 8272 | 8272 | $opt .= '>'; |
| 8273 | 8273 | if (!empty($filterkey) && $filterkey != '') { |
| 8274 | - $outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1); |
|
| 8274 | + $outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1); |
|
| 8275 | 8275 | } |
| 8276 | 8276 | $opt .= $outlabel; |
| 8277 | 8277 | $opt .= "</option>\n"; |
@@ -8326,8 +8326,8 @@ discard block |
||
| 8326 | 8326 | $objecttmp = null; |
| 8327 | 8327 | $InfoFieldList = array(); |
| 8328 | 8328 | $classname = ''; |
| 8329 | - $filter = ''; // Ensure filter has value (for static analysis) |
|
| 8330 | - $sortfield = ''; // Ensure filter has value (for static analysis) |
|
| 8329 | + $filter = ''; // Ensure filter has value (for static analysis) |
|
| 8330 | + $sortfield = ''; // Ensure filter has value (for static analysis) |
|
| 8331 | 8331 | |
| 8332 | 8332 | if ($objectfield) { // We must retrieve the objectdesc from the field or extrafield |
| 8333 | 8333 | // Example: $objectfield = 'product:options_package' or 'myobject@mymodule:options_myfield' |
@@ -8371,9 +8371,9 @@ discard block |
||
| 8371 | 8371 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
| 8372 | 8372 | $reg = array(); |
| 8373 | 8373 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
| 8374 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 8374 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 8375 | 8375 | } |
| 8376 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 8376 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 8377 | 8377 | |
| 8378 | 8378 | $classname = $InfoFieldList[0]; |
| 8379 | 8379 | $classpath = empty($InfoFieldList[1]) ? '' : $InfoFieldList[1]; |
@@ -8404,8 +8404,8 @@ discard block |
||
| 8404 | 8404 | ); |
| 8405 | 8405 | |
| 8406 | 8406 | if (!is_object($objecttmp)) { |
| 8407 | - dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING); |
|
| 8408 | - return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc; |
|
| 8407 | + dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING); |
|
| 8408 | + return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc; |
|
| 8409 | 8409 | } |
| 8410 | 8410 | '@phan-var-force CommonObject $objecttmp'; |
| 8411 | 8411 | |
@@ -8417,9 +8417,9 @@ discard block |
||
| 8417 | 8417 | if ($prefixforautocompletemode == 'product') { |
| 8418 | 8418 | $prefixforautocompletemode = 'produit'; |
| 8419 | 8419 | } |
| 8420 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8420 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8421 | 8421 | |
| 8422 | - dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG); |
|
| 8422 | + dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG); |
|
| 8423 | 8423 | |
| 8424 | 8424 | // Generate the combo HTML component |
| 8425 | 8425 | $out = ''; |
@@ -8448,13 +8448,13 @@ discard block |
||
| 8448 | 8448 | } |
| 8449 | 8449 | |
| 8450 | 8450 | // Set url and param to call to get json of the search results |
| 8451 | - $urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php'; |
|
| 8452 | - $urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : ''); |
|
| 8451 | + $urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php'; |
|
| 8452 | + $urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : ''); |
|
| 8453 | 8453 | |
| 8454 | 8454 | // Activate the auto complete using ajax call. |
| 8455 | 8455 | $out .= ajax_autocompleter((string) $preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalInt($confkeyforautocompletemode), 0); |
| 8456 | 8456 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 8457 | - $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) . '"' : '') . ' />'; |
|
| 8457 | + $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).'"' : '').' />'; |
|
| 8458 | 8458 | } else { |
| 8459 | 8459 | // Immediate load of table record. |
| 8460 | 8460 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -8494,16 +8494,16 @@ discard block |
||
| 8494 | 8494 | if ($prefixforautocompletemode == 'societe') { |
| 8495 | 8495 | $prefixforautocompletemode = 'company'; |
| 8496 | 8496 | } |
| 8497 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8497 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8498 | 8498 | |
| 8499 | 8499 | if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
| 8500 | 8500 | $tmpfieldstoshow = ''; |
| 8501 | 8501 | foreach ($objecttmp->fields as $key => $val) { |
| 8502 | - if (! (int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 8502 | + if (!(int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 8503 | 8503 | continue; |
| 8504 | 8504 | } |
| 8505 | 8505 | if (!empty($val['showoncombobox'])) { |
| 8506 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
| 8506 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
| 8507 | 8507 | } |
| 8508 | 8508 | } |
| 8509 | 8509 | if ($tmpfieldstoshow) { |
@@ -8531,18 +8531,18 @@ discard block |
||
| 8531 | 8531 | $num = 0; |
| 8532 | 8532 | |
| 8533 | 8533 | // Search data |
| 8534 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; |
|
| 8534 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t"; |
|
| 8535 | 8535 | if (!empty($objecttmp->isextrafieldmanaged)) { |
| 8536 | - $sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object"; |
|
| 8536 | + $sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object"; |
|
| 8537 | 8537 | } |
| 8538 | 8538 | if (isset($objecttmp->ismultientitymanaged)) { |
| 8539 | 8539 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 8540 | 8540 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
| 8541 | - $sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0]; |
|
| 8541 | + $sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; |
|
| 8542 | 8542 | } |
| 8543 | 8543 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
| 8544 | 8544 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 8545 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
| 8545 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
| 8546 | 8546 | } |
| 8547 | 8547 | } |
| 8548 | 8548 | } |
@@ -8562,21 +8562,21 @@ discard block |
||
| 8562 | 8562 | $sql .= " WHERE 1=1"; |
| 8563 | 8563 | if (isset($objecttmp->ismultientitymanaged)) { |
| 8564 | 8564 | if ($objecttmp->ismultientitymanaged == 1) { |
| 8565 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
| 8565 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
| 8566 | 8566 | } |
| 8567 | 8567 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 8568 | - $sql .= " AND parenttable.entity = t." . $tmparray[0]; |
|
| 8568 | + $sql .= " AND parenttable.entity = t.".$tmparray[0]; |
|
| 8569 | 8569 | } |
| 8570 | 8570 | if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { |
| 8571 | 8571 | if ($objecttmp->element == 'societe') { |
| 8572 | - $sql .= " AND t.rowid = " . ((int) $user->socid); |
|
| 8572 | + $sql .= " AND t.rowid = ".((int) $user->socid); |
|
| 8573 | 8573 | } else { |
| 8574 | - $sql .= " AND t.fk_soc = " . ((int) $user->socid); |
|
| 8574 | + $sql .= " AND t.fk_soc = ".((int) $user->socid); |
|
| 8575 | 8575 | } |
| 8576 | 8576 | } |
| 8577 | 8577 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
| 8578 | 8578 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 8579 | - $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
| 8579 | + $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
| 8580 | 8580 | } |
| 8581 | 8581 | } |
| 8582 | 8582 | } |
@@ -8588,7 +8588,7 @@ discard block |
||
| 8588 | 8588 | $errormessage = ''; |
| 8589 | 8589 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
| 8590 | 8590 | if ($errormessage) { |
| 8591 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
| 8591 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
| 8592 | 8592 | } |
| 8593 | 8593 | } |
| 8594 | 8594 | } |
@@ -8600,7 +8600,7 @@ discard block |
||
| 8600 | 8600 | $resql = $this->db->query($sql); |
| 8601 | 8601 | if ($resql) { |
| 8602 | 8602 | // Construct $out and $outarray |
| 8603 | - $out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
| 8603 | + $out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
| 8604 | 8604 | |
| 8605 | 8605 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
| 8606 | 8606 | $textifempty = ' '; |
@@ -8614,7 +8614,7 @@ discard block |
||
| 8614 | 8614 | } |
| 8615 | 8615 | } |
| 8616 | 8616 | if ($showempty) { |
| 8617 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
| 8617 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
| 8618 | 8618 | } |
| 8619 | 8619 | |
| 8620 | 8620 | $num = $this->db->num_rows($resql); |
@@ -8637,9 +8637,9 @@ discard block |
||
| 8637 | 8637 | } |
| 8638 | 8638 | if (empty($outputmode)) { |
| 8639 | 8639 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
| 8640 | - $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>'; |
|
| 8640 | + $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>'; |
|
| 8641 | 8641 | } else { |
| 8642 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 8642 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 8643 | 8643 | } |
| 8644 | 8644 | } else { |
| 8645 | 8645 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -8652,10 +8652,10 @@ discard block |
||
| 8652 | 8652 | } |
| 8653 | 8653 | } |
| 8654 | 8654 | |
| 8655 | - $out .= '</select>' . "\n"; |
|
| 8655 | + $out .= '</select>'."\n"; |
|
| 8656 | 8656 | |
| 8657 | 8657 | if (!$forcecombo) { |
| 8658 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8658 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8659 | 8659 | $out .= ajax_combobox($htmlname, array(), getDolGlobalInt($confkeyforautocompletemode, 0)); |
| 8660 | 8660 | } |
| 8661 | 8661 | } else { |
@@ -8719,8 +8719,8 @@ discard block |
||
| 8719 | 8719 | } |
| 8720 | 8720 | } |
| 8721 | 8721 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
| 8722 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"'; |
|
| 8723 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : ''); |
|
| 8722 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"'; |
|
| 8723 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : ''); |
|
| 8724 | 8724 | $out .= '>'."\n"; |
| 8725 | 8725 | |
| 8726 | 8726 | if ($show_empty) { |
@@ -8731,7 +8731,7 @@ discard block |
||
| 8731 | 8731 | if (!is_numeric($show_empty)) { |
| 8732 | 8732 | $textforempty = $show_empty; |
| 8733 | 8733 | } |
| 8734 | - $out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 8734 | + $out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 8735 | 8735 | } |
| 8736 | 8736 | if (is_array($array)) { |
| 8737 | 8737 | // Translate |
@@ -8756,7 +8756,7 @@ discard block |
||
| 8756 | 8756 | $value = $tmpvalue['label']; |
| 8757 | 8757 | //$valuehtml = empty($tmpvalue['data-html']) ? $value : $tmpvalue['data-html']; |
| 8758 | 8758 | $disabled = empty($tmpvalue['disabled']) ? '' : ' disabled'; |
| 8759 | - $style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"'; |
|
| 8759 | + $style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"'; |
|
| 8760 | 8760 | } else { |
| 8761 | 8761 | $value = $tmpvalue; |
| 8762 | 8762 | //$valuehtml = $tmpvalue; |
@@ -8772,9 +8772,9 @@ discard block |
||
| 8772 | 8772 | } |
| 8773 | 8773 | if ($key_in_label) { |
| 8774 | 8774 | if (empty($nohtmlescape)) { |
| 8775 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 8775 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 8776 | 8776 | } else { |
| 8777 | - $selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
| 8777 | + $selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
| 8778 | 8778 | } |
| 8779 | 8779 | } else { |
| 8780 | 8780 | if (empty($nohtmlescape)) { |
@@ -8786,8 +8786,8 @@ discard block |
||
| 8786 | 8786 | $selectOptionValue = ' '; |
| 8787 | 8787 | } |
| 8788 | 8788 | } |
| 8789 | - $out .= '<option value="' . $key . '"'; |
|
| 8790 | - $out .= $style . $disabled; |
|
| 8789 | + $out .= '<option value="'.$key.'"'; |
|
| 8790 | + $out .= $style.$disabled; |
|
| 8791 | 8791 | if (is_array($id)) { |
| 8792 | 8792 | if (in_array($key, $id) && !$disabled) { |
| 8793 | 8793 | $out .= ' selected'; // To preselect a value |
@@ -8799,7 +8799,7 @@ discard block |
||
| 8799 | 8799 | } |
| 8800 | 8800 | } |
| 8801 | 8801 | if (!empty($nohtmlescape)) { // deprecated. Use instead the key 'data-html' into input $array, managed at next step to use HTML content. |
| 8802 | - $out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"'; |
|
| 8802 | + $out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"'; |
|
| 8803 | 8803 | } |
| 8804 | 8804 | |
| 8805 | 8805 | if (is_array($tmpvalue)) { |
@@ -8822,7 +8822,7 @@ discard block |
||
| 8822 | 8822 | // Add code for jquery to use multiselect |
| 8823 | 8823 | if ($addjscombo && $jsbeautify) { |
| 8824 | 8824 | // Enhance with select2 |
| 8825 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8825 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8826 | 8826 | $out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss); |
| 8827 | 8827 | } |
| 8828 | 8828 | |
@@ -8850,28 +8850,28 @@ discard block |
||
| 8850 | 8850 | public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) |
| 8851 | 8851 | { |
| 8852 | 8852 | global $conf, $langs; |
| 8853 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8853 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8854 | 8854 | |
| 8855 | 8855 | // TODO Use an internal dolibarr component instead of select2 |
| 8856 | 8856 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8857 | 8857 | return ''; |
| 8858 | 8858 | } |
| 8859 | 8859 | |
| 8860 | - $out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>'; |
|
| 8860 | + $out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>'; |
|
| 8861 | 8861 | |
| 8862 | 8862 | $outdelayed = ''; |
| 8863 | 8863 | if (!empty($conf->use_javascript_ajax)) { |
| 8864 | 8864 | $tmpplugin = 'select2'; |
| 8865 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
| 8866 | - <script nonce="' . getNonce() . '"> |
|
| 8865 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
| 8866 | + <script nonce="' . getNonce().'"> |
|
| 8867 | 8867 | $(document).ready(function () { |
| 8868 | 8868 | |
| 8869 | - ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . ' |
|
| 8869 | + ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').' |
|
| 8870 | 8870 | |
| 8871 | - $(".' . $htmlname . '").select2({ |
|
| 8871 | + $(".' . $htmlname.'").select2({ |
|
| 8872 | 8872 | ajax: { |
| 8873 | 8873 | dir: "ltr", |
| 8874 | - url: "' . $url . '", |
|
| 8874 | + url: "' . $url.'", |
|
| 8875 | 8875 | dataType: \'json\', |
| 8876 | 8876 | delay: 250, |
| 8877 | 8877 | data: function (params) { |
@@ -8898,9 +8898,9 @@ discard block |
||
| 8898 | 8898 | }, |
| 8899 | 8899 | language: select2arrayoflanguage, |
| 8900 | 8900 | containerCssClass: \':all:\', /* Line to add class from the original SELECT propagated to the new <span class="select2-selection...> tag */ |
| 8901 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
| 8901 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
| 8902 | 8902 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
| 8903 | - minimumInputLength: ' . ((int) $minimumInputLength) . ', |
|
| 8903 | + minimumInputLength: ' . ((int) $minimumInputLength).', |
|
| 8904 | 8904 | formatResult: function (result, container, query, escapeMarkup) { |
| 8905 | 8905 | return escapeMarkup(result.text); |
| 8906 | 8906 | }, |
@@ -8908,10 +8908,10 @@ discard block |
||
| 8908 | 8908 | |
| 8909 | 8909 | ' . ($callurlonselect ? ' |
| 8910 | 8910 | /* Code to execute a GET when we select a value */ |
| 8911 | - $(".' . $htmlname . '").change(function() { |
|
| 8912 | - var selected = $(".' . $htmlname . '").val(); |
|
| 8911 | + $(".' . $htmlname.'").change(function() { |
|
| 8912 | + var selected = $(".' . $htmlname.'").val(); |
|
| 8913 | 8913 | console.log("We select in selectArrayAjax the entry "+selected) |
| 8914 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
| 8914 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
| 8915 | 8915 | $.each( saveRemoteData, function( key, value ) { |
| 8916 | 8916 | if (key == selected) |
| 8917 | 8917 | { |
@@ -8919,7 +8919,7 @@ discard block |
||
| 8919 | 8919 | location.assign(value.url); |
| 8920 | 8920 | } |
| 8921 | 8921 | }); |
| 8922 | - });' : '') . ' |
|
| 8922 | + });' : '').' |
|
| 8923 | 8923 | |
| 8924 | 8924 | }); |
| 8925 | 8925 | </script>'; |
@@ -8955,14 +8955,14 @@ discard block |
||
| 8955 | 8955 | public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '') |
| 8956 | 8956 | { |
| 8957 | 8957 | global $conf, $langs; |
| 8958 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8958 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8959 | 8959 | |
| 8960 | 8960 | // TODO Use an internal dolibarr component instead of select2 |
| 8961 | 8961 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8962 | 8962 | return ''; |
| 8963 | 8963 | } |
| 8964 | 8964 | |
| 8965 | - $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
| 8965 | + $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
| 8966 | 8966 | |
| 8967 | 8967 | $formattedarrayresult = array(); |
| 8968 | 8968 | |
@@ -8977,20 +8977,20 @@ discard block |
||
| 8977 | 8977 | $outdelayed = ''; |
| 8978 | 8978 | if (!empty($conf->use_javascript_ajax)) { |
| 8979 | 8979 | $tmpplugin = 'select2'; |
| 8980 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
| 8981 | - <script nonce="' . getNonce() . '"> |
|
| 8980 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
| 8981 | + <script nonce="' . getNonce().'"> |
|
| 8982 | 8982 | $(document).ready(function () { |
| 8983 | - var data = ' . json_encode($formattedarrayresult) . '; |
|
| 8983 | + var data = ' . json_encode($formattedarrayresult).'; |
|
| 8984 | 8984 | |
| 8985 | - ' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . ' |
|
| 8985 | + ' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').' |
|
| 8986 | 8986 | |
| 8987 | - $(".' . $htmlname . '").select2({ |
|
| 8987 | + $(".' . $htmlname.'").select2({ |
|
| 8988 | 8988 | data: data, |
| 8989 | 8989 | language: select2arrayoflanguage, |
| 8990 | 8990 | containerCssClass: \':all:\', /* Line to add class from the original SELECT propagated to the new <span class="select2-selection...> tag */ |
| 8991 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
| 8991 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
| 8992 | 8992 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
| 8993 | - minimumInputLength: ' . $minimumInputLength . ', |
|
| 8993 | + minimumInputLength: ' . $minimumInputLength.', |
|
| 8994 | 8994 | formatResult: function (result, container, query, escapeMarkup) { |
| 8995 | 8995 | return escapeMarkup(result.text); |
| 8996 | 8996 | }, |
@@ -9029,11 +9029,11 @@ discard block |
||
| 9029 | 9029 | |
| 9030 | 9030 | ' . ($callurlonselect ? ' |
| 9031 | 9031 | /* Code to execute a GET when we select a value */ |
| 9032 | - $(".' . $htmlname . '").change(function() { |
|
| 9033 | - var selected = $(".' . $htmlname . '").val(); |
|
| 9032 | + $(".' . $htmlname.'").change(function() { |
|
| 9033 | + var selected = $(".' . $htmlname.'").val(); |
|
| 9034 | 9034 | console.log("We select "+selected) |
| 9035 | 9035 | |
| 9036 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
| 9036 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
| 9037 | 9037 | $.each( saveRemoteData, function( key, value ) { |
| 9038 | 9038 | if (key == selected) |
| 9039 | 9039 | { |
@@ -9041,7 +9041,7 @@ discard block |
||
| 9041 | 9041 | location.assign(value.url); |
| 9042 | 9042 | } |
| 9043 | 9043 | }); |
| 9044 | - });' : '') . ' |
|
| 9044 | + });' : '').' |
|
| 9045 | 9045 | |
| 9046 | 9046 | }); |
| 9047 | 9047 | </script>'; |
@@ -9090,7 +9090,7 @@ discard block |
||
| 9090 | 9090 | $useenhancedmultiselect = 0; |
| 9091 | 9091 | if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) { |
| 9092 | 9092 | if ($addjscombo) { |
| 9093 | - $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
| 9093 | + $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
| 9094 | 9094 | } |
| 9095 | 9095 | } |
| 9096 | 9096 | |
@@ -9099,7 +9099,7 @@ discard block |
||
| 9099 | 9099 | // submitted to nothing. |
| 9100 | 9100 | $out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">'; |
| 9101 | 9101 | // Output select component |
| 9102 | - $out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', (string) $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n"; |
|
| 9102 | + $out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', (string) $width) ? $width : $width.'px').'"' : '').'>'."\n"; |
|
| 9103 | 9103 | if (is_array($array) && !empty($array)) { |
| 9104 | 9104 | if ($value_as_key) { |
| 9105 | 9105 | $array = array_combine($array, $array); |
@@ -9120,33 +9120,33 @@ discard block |
||
| 9120 | 9120 | $tmplabelhtml = empty($value['labelhtml']) ? (empty($value['data-html']) ? '' : $value['data-html']) : $value['labelhtml']; |
| 9121 | 9121 | } |
| 9122 | 9122 | $newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue); |
| 9123 | - $newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval); |
|
| 9123 | + $newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval); |
|
| 9124 | 9124 | |
| 9125 | - $out .= '<option value="' . $tmpkey . '"'; |
|
| 9125 | + $out .= '<option value="'.$tmpkey.'"'; |
|
| 9126 | 9126 | if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) { |
| 9127 | 9127 | $out .= ' selected'; |
| 9128 | 9128 | } |
| 9129 | 9129 | if (!empty($tmplabelhtml)) { |
| 9130 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
| 9130 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
| 9131 | 9131 | } else { |
| 9132 | - $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval; |
|
| 9133 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
| 9132 | + $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval; |
|
| 9133 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
| 9134 | 9134 | } |
| 9135 | 9135 | $out .= '>'; |
| 9136 | 9136 | $out .= dol_htmlentitiesbr($newval); |
| 9137 | - $out .= '</option>' . "\n"; |
|
| 9137 | + $out .= '</option>'."\n"; |
|
| 9138 | 9138 | } |
| 9139 | 9139 | } |
| 9140 | 9140 | } |
| 9141 | - $out .= '</select>' . "\n"; |
|
| 9141 | + $out .= '</select>'."\n"; |
|
| 9142 | 9142 | |
| 9143 | 9143 | // Add code for jquery to use multiselect |
| 9144 | 9144 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 9145 | - $out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->'; |
|
| 9146 | - $out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n"; |
|
| 9145 | + $out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->'; |
|
| 9146 | + $out .= "\n".'<script nonce="'.getNonce().'">'."\n"; |
|
| 9147 | 9147 | if ($addjscombo == 1) { |
| 9148 | 9148 | $tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; |
| 9149 | - $out .= 'function formatResult(record, container) {' . "\n"; |
|
| 9149 | + $out .= 'function formatResult(record, container) {'."\n"; |
|
| 9150 | 9150 | // If property data-html set, we decode html entities and use this. |
| 9151 | 9151 | // Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option. |
| 9152 | 9152 | $out .= ' if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {'; |
@@ -9154,26 +9154,26 @@ discard block |
||
| 9154 | 9154 | $out .= ' return htmlEntityDecodeJs($(record.element).attr("data-html"));'; |
| 9155 | 9155 | $out .= ' }'."\n"; |
| 9156 | 9156 | $out .= ' return record.text;'; |
| 9157 | - $out .= '}' . "\n"; |
|
| 9158 | - $out .= 'function formatSelection(record) {' . "\n"; |
|
| 9157 | + $out .= '}'."\n"; |
|
| 9158 | + $out .= 'function formatSelection(record) {'."\n"; |
|
| 9159 | 9159 | if ($elemtype == 'category') { |
| 9160 | - $out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
| 9160 | + $out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
| 9161 | 9161 | } else { |
| 9162 | 9162 | $out .= 'return record.text;'; |
| 9163 | 9163 | } |
| 9164 | - $out .= '}' . "\n"; |
|
| 9164 | + $out .= '}'."\n"; |
|
| 9165 | 9165 | $out .= '$(document).ready(function () { |
| 9166 | - $(\'#' . $htmlname . '\').' . $tmpplugin . '({'; |
|
| 9166 | + $(\'#' . $htmlname.'\').'.$tmpplugin.'({'; |
|
| 9167 | 9167 | if ($placeholder) { |
| 9168 | 9168 | $out .= ' |
| 9169 | 9169 | placeholder: { |
| 9170 | 9170 | id: \'-1\', |
| 9171 | - text: \'' . dol_escape_js($placeholder) . '\' |
|
| 9171 | + text: \'' . dol_escape_js($placeholder).'\' |
|
| 9172 | 9172 | },'; |
| 9173 | 9173 | } |
| 9174 | 9174 | $out .= ' dir: \'ltr\', |
| 9175 | 9175 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */ |
| 9176 | - dropdownCssClass: \'' . $morecss . '\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */ |
|
| 9176 | + dropdownCssClass: \'' . $morecss.'\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */ |
|
| 9177 | 9177 | // Specify format function for dropdown item |
| 9178 | 9178 | formatResult: formatResult, |
| 9179 | 9179 | templateResult: formatResult, /* For 4.0 */ |
@@ -9185,21 +9185,21 @@ discard block |
||
| 9185 | 9185 | |
| 9186 | 9186 | /* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set |
| 9187 | 9187 | the size only if component is not hidden by default on load */ |
| 9188 | - $(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\'); |
|
| 9188 | + $(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\'); |
|
| 9189 | 9189 | });' . "\n"; |
| 9190 | 9190 | } elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) { |
| 9191 | 9191 | // Add other js lib |
| 9192 | 9192 | // TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin |
| 9193 | 9193 | // ... |
| 9194 | - $out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');'; |
|
| 9194 | + $out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');'; |
|
| 9195 | 9195 | $out .= '$(document).ready(function () { |
| 9196 | - $(\'#' . $htmlname . '\').multiSelect({ |
|
| 9196 | + $(\'#' . $htmlname.'\').multiSelect({ |
|
| 9197 | 9197 | containerHTML: \'<div class="multi-select-container">\', |
| 9198 | 9198 | menuHTML: \'<div class="multi-select-menu">\', |
| 9199 | - buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\', |
|
| 9199 | + buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\', |
|
| 9200 | 9200 | menuItemHTML: \'<label class="multi-select-menuitem">\', |
| 9201 | 9201 | activeClass: \'multi-select-container--open\', |
| 9202 | - noneText: \'' . $placeholder . '\' |
|
| 9202 | + noneText: \'' . $placeholder.'\' |
|
| 9203 | 9203 | }); |
| 9204 | 9204 | })'; |
| 9205 | 9205 | } |
@@ -9232,7 +9232,7 @@ discard block |
||
| 9232 | 9232 | return ''; |
| 9233 | 9233 | } |
| 9234 | 9234 | |
| 9235 | - $tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show |
|
| 9235 | + $tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show |
|
| 9236 | 9236 | |
| 9237 | 9237 | if (!empty($user->conf->$tmpvar)) { // A list of fields was already customized for user |
| 9238 | 9238 | $tmparray = explode(',', $user->conf->$tmpvar); |
@@ -9275,19 +9275,19 @@ discard block |
||
| 9275 | 9275 | } |
| 9276 | 9276 | |
| 9277 | 9277 | // Note: $val['checked'] <> 0 means we must show the field into the combo list @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset |
| 9278 | - $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>'; |
|
| 9279 | - $listcheckedstring .= (empty($val['checked']) ? '' : $key . ','); |
|
| 9278 | + $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>'; |
|
| 9279 | + $listcheckedstring .= (empty($val['checked']) ? '' : $key.','); |
|
| 9280 | 9280 | } |
| 9281 | 9281 | } |
| 9282 | 9282 | |
| 9283 | - $out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' --> |
|
| 9283 | + $out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' --> |
|
| 9284 | 9284 | |
| 9285 | 9285 | <dl class="dropdown"> |
| 9286 | 9286 | <dt> |
| 9287 | - <a href="#' . $htmlname . '"> |
|
| 9288 | - ' . img_picto('', 'list') . ' |
|
| 9287 | + <a href="#' . $htmlname.'"> |
|
| 9288 | + ' . img_picto('', 'list').' |
|
| 9289 | 9289 | </a> |
| 9290 | - <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '"> |
|
| 9290 | + <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'"> |
|
| 9291 | 9291 | </dt> |
| 9292 | 9292 | <dd class="dropdowndd"> |
| 9293 | 9293 | <div class="multiselectcheckbox'.$htmlname.'"> |
@@ -9299,19 +9299,19 @@ discard block |
||
| 9299 | 9299 | </dd> |
| 9300 | 9300 | </dl> |
| 9301 | 9301 | |
| 9302 | - <script nonce="' . getNonce() . '" type="text/javascript"> |
|
| 9302 | + <script nonce="' . getNonce().'" type="text/javascript"> |
|
| 9303 | 9303 | jQuery(document).ready(function () { |
| 9304 | - $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () { |
|
| 9304 | + $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () { |
|
| 9305 | 9305 | console.log("A new field was added/removed, we edit field input[name=formfilteraction]"); |
| 9306 | 9306 | |
| 9307 | 9307 | $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\'); // Update field so we know we changed something on selected fields after POST |
| 9308 | 9308 | |
| 9309 | 9309 | var title = $(this).val() + ","; |
| 9310 | 9310 | if ($(this).is(\':checked\')) { |
| 9311 | - $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val()); |
|
| 9311 | + $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val()); |
|
| 9312 | 9312 | } |
| 9313 | 9313 | else { |
| 9314 | - $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') ) |
|
| 9314 | + $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') ) |
|
| 9315 | 9315 | } |
| 9316 | 9316 | // Now, we submit page |
| 9317 | 9317 | //$(this).parents(\'form:first\').submit(); |
@@ -9342,7 +9342,7 @@ discard block |
||
| 9342 | 9342 | */ |
| 9343 | 9343 | public function showCategories($id, $type, $rendermode = 0, $nolink = 0) |
| 9344 | 9344 | { |
| 9345 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 9345 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 9346 | 9346 | |
| 9347 | 9347 | $cat = new Categorie($this->db); |
| 9348 | 9348 | $categories = $cat->containing($id, $type); |
@@ -9352,13 +9352,13 @@ discard block |
||
| 9352 | 9352 | foreach ($categories as $c) { |
| 9353 | 9353 | $ways = $c->print_all_ways(' >> ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 9354 | 9354 | foreach ($ways as $way) { |
| 9355 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
| 9355 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
| 9356 | 9356 | } |
| 9357 | 9357 | } |
| 9358 | 9358 | if (empty($toprint)) { |
| 9359 | 9359 | return ''; |
| 9360 | 9360 | } else { |
| 9361 | - return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
| 9361 | + return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
| 9362 | 9362 | } |
| 9363 | 9363 | } |
| 9364 | 9364 | |
@@ -9407,15 +9407,15 @@ discard block |
||
| 9407 | 9407 | |
| 9408 | 9408 | |
| 9409 | 9409 | print '<div class="div-table-responsive-no-min">'; |
| 9410 | - print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '" data-elementid="' . $object->id . '" >'; |
|
| 9410 | + print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'" data-elementid="'.$object->id.'" >'; |
|
| 9411 | 9411 | |
| 9412 | 9412 | print '<tr class="liste_titre">'; |
| 9413 | - print '<td>' . $langs->trans("Type") . '</td>'; |
|
| 9414 | - print '<td>' . $langs->trans("Ref") . '</td>'; |
|
| 9413 | + print '<td>'.$langs->trans("Type").'</td>'; |
|
| 9414 | + print '<td>'.$langs->trans("Ref").'</td>'; |
|
| 9415 | 9415 | print '<td class="center"></td>'; |
| 9416 | - print '<td class="center">' . $langs->trans("Date") . '</td>'; |
|
| 9417 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
| 9418 | - print '<td class="right">' . $langs->trans("Status") . '</td>'; |
|
| 9416 | + print '<td class="center">'.$langs->trans("Date").'</td>'; |
|
| 9417 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
| 9418 | + print '<td class="right">'.$langs->trans("Status").'</td>'; |
|
| 9419 | 9419 | print '<td></td>'; |
| 9420 | 9420 | print '</tr>'; |
| 9421 | 9421 | |
@@ -9434,13 +9434,13 @@ discard block |
||
| 9434 | 9434 | if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) { |
| 9435 | 9435 | $element = $regs[1]; |
| 9436 | 9436 | $subelement = $regs[2]; |
| 9437 | - $tplpath = $element . '/' . $subelement; |
|
| 9437 | + $tplpath = $element.'/'.$subelement; |
|
| 9438 | 9438 | } |
| 9439 | 9439 | $tplname = 'linkedobjectblock'; |
| 9440 | 9440 | |
| 9441 | 9441 | // To work with non standard path |
| 9442 | 9442 | if ($objecttype == 'facture') { |
| 9443 | - $tplpath = 'compta/' . $element; |
|
| 9443 | + $tplpath = 'compta/'.$element; |
|
| 9444 | 9444 | if (!isModEnabled('invoice')) { |
| 9445 | 9445 | continue; // Do not show if module disabled |
| 9446 | 9446 | } |
@@ -9451,7 +9451,7 @@ discard block |
||
| 9451 | 9451 | continue; // Do not show if module disabled |
| 9452 | 9452 | } |
| 9453 | 9453 | } elseif ($objecttype == 'propal') { |
| 9454 | - $tplpath = 'comm/' . $element; |
|
| 9454 | + $tplpath = 'comm/'.$element; |
|
| 9455 | 9455 | if (!isModEnabled('propal')) { |
| 9456 | 9456 | continue; // Do not show if module disabled |
| 9457 | 9457 | } |
@@ -9504,7 +9504,7 @@ discard block |
||
| 9504 | 9504 | $linkedObjectBlock = $objects; |
| 9505 | 9505 | |
| 9506 | 9506 | // Output template part (modules that overwrite templates must declare this into descriptor) |
| 9507 | - $dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl')); |
|
| 9507 | + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl')); |
|
| 9508 | 9508 | foreach ($dirtpls as $reldir) { |
| 9509 | 9509 | $reldir = rtrim($reldir, '/'); |
| 9510 | 9510 | if ($nboftypesoutput == ($nbofdifferenttypes - 1)) { // No more type to show after |
@@ -9512,7 +9512,7 @@ discard block |
||
| 9512 | 9512 | $noMoreLinkedObjectBlockAfter = 1; |
| 9513 | 9513 | } |
| 9514 | 9514 | |
| 9515 | - $res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php'); |
|
| 9515 | + $res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); |
|
| 9516 | 9516 | if ($res) { |
| 9517 | 9517 | $nboftypesoutput++; |
| 9518 | 9518 | break; |
@@ -9521,7 +9521,7 @@ discard block |
||
| 9521 | 9521 | } |
| 9522 | 9522 | |
| 9523 | 9523 | if (!$nboftypesoutput) { |
| 9524 | - print '<tr><td colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
| 9524 | + print '<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
| 9525 | 9525 | } |
| 9526 | 9526 | |
| 9527 | 9527 | print '</table>'; |
@@ -9564,14 +9564,14 @@ discard block |
||
| 9564 | 9564 | if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) { |
| 9565 | 9565 | $listofidcompanytoscan = $object->thirdparty->id; |
| 9566 | 9566 | if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) { |
| 9567 | - $listofidcompanytoscan .= ',' . $object->thirdparty->parent; |
|
| 9567 | + $listofidcompanytoscan .= ','.$object->thirdparty->parent; |
|
| 9568 | 9568 | } |
| 9569 | 9569 | if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) { |
| 9570 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 9570 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 9571 | 9571 | $tmpproject = new Project($this->db); |
| 9572 | 9572 | $tmpproject->fetch($object->fk_project); |
| 9573 | 9573 | if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) { |
| 9574 | - $listofidcompanytoscan .= ',' . $tmpproject->socid; |
|
| 9574 | + $listofidcompanytoscan .= ','.$tmpproject->socid; |
|
| 9575 | 9575 | } |
| 9576 | 9576 | unset($tmpproject); |
| 9577 | 9577 | } |
@@ -9581,63 +9581,63 @@ discard block |
||
| 9581 | 9581 | 'enabled' => isModEnabled('propal'), |
| 9582 | 9582 | 'perms' => 1, |
| 9583 | 9583 | 'label' => 'LinkToProposal', |
| 9584 | - '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') . ')'), |
|
| 9584 | + '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').')'), |
|
| 9585 | 9585 | 'shipping' => array( |
| 9586 | 9586 | 'enabled' => isModEnabled('shipping'), |
| 9587 | 9587 | 'perms' => 1, |
| 9588 | 9588 | 'label' => 'LinkToExpedition', |
| 9589 | - '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') . ')'), |
|
| 9589 | + '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').')'), |
|
| 9590 | 9590 | 'order' => array( |
| 9591 | 9591 | 'enabled' => isModEnabled('order'), |
| 9592 | 9592 | 'perms' => 1, |
| 9593 | 9593 | 'label' => 'LinkToOrder', |
| 9594 | - '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') . ')'), |
|
| 9594 | + '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').')'), |
|
| 9595 | 9595 | 'invoice' => array( |
| 9596 | 9596 | 'enabled' => isModEnabled('invoice'), |
| 9597 | 9597 | 'perms' => 1, |
| 9598 | 9598 | 'label' => 'LinkToInvoice', |
| 9599 | - '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') . ')'), |
|
| 9599 | + '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').')'), |
|
| 9600 | 9600 | 'invoice_template' => array( |
| 9601 | 9601 | 'enabled' => isModEnabled('invoice'), |
| 9602 | 9602 | 'perms' => 1, |
| 9603 | 9603 | 'label' => 'LinkToTemplateInvoice', |
| 9604 | - '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') . ')'), |
|
| 9604 | + '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').')'), |
|
| 9605 | 9605 | 'contrat' => array( |
| 9606 | 9606 | 'enabled' => isModEnabled('contract'), |
| 9607 | 9607 | 'perms' => 1, |
| 9608 | 9608 | 'label' => 'LinkToContract', |
| 9609 | 9609 | '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 |
| 9610 | - 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' |
|
| 9610 | + 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' |
|
| 9611 | 9611 | ), |
| 9612 | 9612 | 'fichinter' => array( |
| 9613 | 9613 | 'enabled' => isModEnabled('intervention'), |
| 9614 | 9614 | 'perms' => 1, |
| 9615 | 9615 | 'label' => 'LinkToIntervention', |
| 9616 | - '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') . ')'), |
|
| 9616 | + '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').')'), |
|
| 9617 | 9617 | 'supplier_proposal' => array( |
| 9618 | 9618 | 'enabled' => isModEnabled('supplier_proposal'), |
| 9619 | 9619 | 'perms' => 1, |
| 9620 | 9620 | 'label' => 'LinkToSupplierProposal', |
| 9621 | - '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') . ')'), |
|
| 9621 | + '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').')'), |
|
| 9622 | 9622 | 'order_supplier' => array( |
| 9623 | 9623 | 'enabled' => isModEnabled("supplier_order"), |
| 9624 | 9624 | 'perms' => 1, |
| 9625 | 9625 | 'label' => 'LinkToSupplierOrder', |
| 9626 | - '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') . ')'), |
|
| 9626 | + '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').')'), |
|
| 9627 | 9627 | 'invoice_supplier' => array( |
| 9628 | 9628 | 'enabled' => isModEnabled("supplier_invoice"), |
| 9629 | 9629 | 'perms' => 1, 'label' => 'LinkToSupplierInvoice', |
| 9630 | - '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') . ')'), |
|
| 9630 | + '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').')'), |
|
| 9631 | 9631 | 'ticket' => array( |
| 9632 | 9632 | 'enabled' => isModEnabled('ticket'), |
| 9633 | 9633 | 'perms' => 1, |
| 9634 | 9634 | 'label' => 'LinkToTicket', |
| 9635 | - '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') . ')'), |
|
| 9635 | + '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').')'), |
|
| 9636 | 9636 | 'mo' => array( |
| 9637 | 9637 | 'enabled' => isModEnabled('mrp'), |
| 9638 | 9638 | 'perms' => 1, |
| 9639 | 9639 | 'label' => 'LinkToMo', |
| 9640 | - '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') . ')') |
|
| 9640 | + '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').')') |
|
| 9641 | 9641 | ); |
| 9642 | 9642 | } |
| 9643 | 9643 | |
@@ -9675,23 +9675,23 @@ discard block |
||
| 9675 | 9675 | } |
| 9676 | 9676 | |
| 9677 | 9677 | if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) { |
| 9678 | - $htmltoenteralink .= '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>'; |
|
| 9678 | + $htmltoenteralink .= '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>'; |
|
| 9679 | 9679 | |
| 9680 | 9680 | // Section for free ref input |
| 9681 | 9681 | if (!getDolGlobalString('MAIN_HIDE_LINK_BY_REF_IN_LINKTO')) { |
| 9682 | 9682 | $htmltoenteralink .= '<br>'."\n"; |
| 9683 | 9683 | $htmltoenteralink .= '<!-- form to add a link from anywhere -->'."\n"; |
| 9684 | - $htmltoenteralink .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">'; |
|
| 9685 | - $htmltoenteralink .= '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 9684 | + $htmltoenteralink .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">'; |
|
| 9685 | + $htmltoenteralink .= '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 9686 | 9686 | $htmltoenteralink .= '<input type="hidden" name="action" value="addlinkbyref">'; |
| 9687 | - $htmltoenteralink .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 9688 | - $htmltoenteralink .= '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
| 9687 | + $htmltoenteralink .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 9688 | + $htmltoenteralink .= '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
| 9689 | 9689 | $htmltoenteralink .= '<table class="noborder">'; |
| 9690 | 9690 | $htmltoenteralink .= '<tr>'; |
| 9691 | 9691 | //print '<td>' . $langs->trans("Ref") . '</td>'; |
| 9692 | - $htmltoenteralink .= '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '"> '; |
|
| 9693 | - $htmltoenteralink .= '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '"> '; |
|
| 9694 | - $htmltoenteralink .= '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>'; |
|
| 9692 | + $htmltoenteralink .= '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'"> '; |
|
| 9693 | + $htmltoenteralink .= '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'"> '; |
|
| 9694 | + $htmltoenteralink .= '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>'; |
|
| 9695 | 9695 | $htmltoenteralink .= '</tr>'; |
| 9696 | 9696 | $htmltoenteralink .= '</table>'; |
| 9697 | 9697 | $htmltoenteralink .= '</form>'; |
@@ -9708,47 +9708,47 @@ discard block |
||
| 9708 | 9708 | // Section for free predefined list |
| 9709 | 9709 | $htmltoenteralink .= '<br>'; |
| 9710 | 9710 | $htmltoenteralink .= '<!-- form to add a link from object to same thirdparty -->'."\n"; |
| 9711 | - $htmltoenteralink .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">'; |
|
| 9711 | + $htmltoenteralink .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">'; |
|
| 9712 | 9712 | $htmltoenteralink .= '<input type="hidden" name="action" value="addlink">'; |
| 9713 | - $htmltoenteralink .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 9714 | - $htmltoenteralink .= '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 9715 | - $htmltoenteralink .= '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
| 9713 | + $htmltoenteralink .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 9714 | + $htmltoenteralink .= '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 9715 | + $htmltoenteralink .= '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
| 9716 | 9716 | $htmltoenteralink .= '<table class="noborder">'; |
| 9717 | 9717 | $htmltoenteralink .= '<tr class="liste_titre">'; |
| 9718 | 9718 | $htmltoenteralink .= '<td class="nowrap"></td>'; |
| 9719 | - $htmltoenteralink .= '<td>' . $langs->trans("Ref") . '</td>'; |
|
| 9720 | - $htmltoenteralink .= '<td>' . $langs->trans("RefCustomer") . '</td>'; |
|
| 9721 | - $htmltoenteralink .= '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
| 9722 | - $htmltoenteralink .= '<td>' . $langs->trans("Company") . '</td>'; |
|
| 9719 | + $htmltoenteralink .= '<td>'.$langs->trans("Ref").'</td>'; |
|
| 9720 | + $htmltoenteralink .= '<td>'.$langs->trans("RefCustomer").'</td>'; |
|
| 9721 | + $htmltoenteralink .= '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
| 9722 | + $htmltoenteralink .= '<td>'.$langs->trans("Company").'</td>'; |
|
| 9723 | 9723 | $htmltoenteralink .= '</tr>'; |
| 9724 | 9724 | while ($i < $num) { |
| 9725 | 9725 | $objp = $this->db->fetch_object($resqllist); |
| 9726 | 9726 | |
| 9727 | 9727 | $htmltoenteralink .= '<tr class="oddeven">'; |
| 9728 | 9728 | $htmltoenteralink .= '<td>'; |
| 9729 | - $htmltoenteralink .= '<input type="checkbox" name="idtolinkto[' . $key . '_' . $objp->rowid . ']" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">'; |
|
| 9729 | + $htmltoenteralink .= '<input type="checkbox" name="idtolinkto['.$key.'_'.$objp->rowid.']" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">'; |
|
| 9730 | 9730 | $htmltoenteralink .= '</td>'; |
| 9731 | - $htmltoenteralink .= '<td><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>'; |
|
| 9732 | - $htmltoenteralink .= '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>'; |
|
| 9731 | + $htmltoenteralink .= '<td><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>'; |
|
| 9732 | + $htmltoenteralink .= '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>'; |
|
| 9733 | 9733 | $htmltoenteralink .= '<td class="right">'; |
| 9734 | 9734 | if ($possiblelink['label'] == 'LinkToContract') { |
| 9735 | - $htmltoenteralink .= $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' '; |
|
| 9735 | + $htmltoenteralink .= $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; |
|
| 9736 | 9736 | } |
| 9737 | - $htmltoenteralink .= '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>'; |
|
| 9737 | + $htmltoenteralink .= '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>'; |
|
| 9738 | 9738 | $htmltoenteralink .= '</td>'; |
| 9739 | - $htmltoenteralink .= '<td>' . $objp->name . '</td>'; |
|
| 9739 | + $htmltoenteralink .= '<td>'.$objp->name.'</td>'; |
|
| 9740 | 9740 | $htmltoenteralink .= '</tr>'; |
| 9741 | 9741 | $i++; |
| 9742 | 9742 | } |
| 9743 | 9743 | $htmltoenteralink .= '</table>'; |
| 9744 | 9744 | $htmltoenteralink .= '<div class="center">'; |
| 9745 | 9745 | if ($num) { |
| 9746 | - $htmltoenteralink .= '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">'; |
|
| 9746 | + $htmltoenteralink .= '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">'; |
|
| 9747 | 9747 | } |
| 9748 | 9748 | if (empty($conf->use_javascript_ajax)) { |
| 9749 | - $htmltoenteralink .= '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
| 9749 | + $htmltoenteralink .= '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
| 9750 | 9750 | } else { |
| 9751 | - $htmltoenteralink .= '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
| 9751 | + $htmltoenteralink .= '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
| 9752 | 9752 | } |
| 9753 | 9753 | $htmltoenteralink .= '</form>'; |
| 9754 | 9754 | } |
@@ -9762,10 +9762,10 @@ discard block |
||
| 9762 | 9762 | |
| 9763 | 9763 | // Complete the list for the combo box |
| 9764 | 9764 | if ($num > 0 || !getDolGlobalString('MAIN_HIDE_LINK_BY_REF_IN_LINKTO')) { |
| 9765 | - $linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>'; |
|
| 9765 | + $linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>'; |
|
| 9766 | 9766 | // } else $linktoelem.=$langs->trans($possiblelink['label']); |
| 9767 | 9767 | } else { |
| 9768 | - $linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>'; |
|
| 9768 | + $linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>'; |
|
| 9769 | 9769 | } |
| 9770 | 9770 | } |
| 9771 | 9771 | } |
@@ -9775,11 +9775,11 @@ discard block |
||
| 9775 | 9775 | <dl class="dropdown" id="linktoobjectname"> |
| 9776 | 9776 | '; |
| 9777 | 9777 | if (!empty($conf->use_javascript_ajax)) { |
| 9778 | - $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>'; |
|
| 9778 | + $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>'; |
|
| 9779 | 9779 | } |
| 9780 | 9780 | $linktoelem .= '<dd> |
| 9781 | 9781 | <div class="multiselectlinkto"> |
| 9782 | - <ul class="ulselectedfields">' . $linktoelemlist . ' |
|
| 9782 | + <ul class="ulselectedfields">' . $linktoelemlist.' |
|
| 9783 | 9783 | </ul> |
| 9784 | 9784 | </div> |
| 9785 | 9785 | </dd> |
@@ -9790,7 +9790,7 @@ discard block |
||
| 9790 | 9790 | |
| 9791 | 9791 | if (!empty($conf->use_javascript_ajax)) { |
| 9792 | 9792 | print '<!-- Add js to show linkto box --> |
| 9793 | - <script nonce="' . getNonce() . '"> |
|
| 9793 | + <script nonce="' . getNonce().'"> |
|
| 9794 | 9794 | jQuery(document).ready(function() { |
| 9795 | 9795 | jQuery(".linkto").click(function() { |
| 9796 | 9796 | console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list"); |
@@ -9837,19 +9837,19 @@ discard block |
||
| 9837 | 9837 | |
| 9838 | 9838 | $disabled = ($disabled ? ' disabled' : ''); |
| 9839 | 9839 | |
| 9840 | - $resultyesno = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n"; |
|
| 9840 | + $resultyesno = '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n"; |
|
| 9841 | 9841 | if ($useempty) { |
| 9842 | - $resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '> </option>' . "\n"; |
|
| 9842 | + $resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'> </option>'."\n"; |
|
| 9843 | 9843 | } |
| 9844 | 9844 | if (("$value" == 'yes') || ($value == 1)) { |
| 9845 | - $resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
| 9846 | - $resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n"; |
|
| 9845 | + $resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n"; |
|
| 9846 | + $resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n"; |
|
| 9847 | 9847 | } else { |
| 9848 | 9848 | $selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected'); |
| 9849 | - $resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
| 9850 | - $resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n"; |
|
| 9849 | + $resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n"; |
|
| 9850 | + $resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n"; |
|
| 9851 | 9851 | } |
| 9852 | - $resultyesno .= '</select>' . "\n"; |
|
| 9852 | + $resultyesno .= '</select>'."\n"; |
|
| 9853 | 9853 | |
| 9854 | 9854 | if ($addjscombo) { |
| 9855 | 9855 | $resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss); |
@@ -9873,12 +9873,12 @@ discard block |
||
| 9873 | 9873 | { |
| 9874 | 9874 | // phpcs:enable |
| 9875 | 9875 | $sql = "SELECT rowid, label"; |
| 9876 | - $sql .= " FROM " . $this->db->prefix() . "export_model"; |
|
| 9877 | - $sql .= " WHERE type = '" . $this->db->escape($type) . "'"; |
|
| 9876 | + $sql .= " FROM ".$this->db->prefix()."export_model"; |
|
| 9877 | + $sql .= " WHERE type = '".$this->db->escape($type)."'"; |
|
| 9878 | 9878 | $sql .= " ORDER BY rowid"; |
| 9879 | 9879 | $result = $this->db->query($sql); |
| 9880 | 9880 | if ($result) { |
| 9881 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 9881 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 9882 | 9882 | if ($useempty) { |
| 9883 | 9883 | print '<option value="-1"> </option>'; |
| 9884 | 9884 | } |
@@ -9888,9 +9888,9 @@ discard block |
||
| 9888 | 9888 | while ($i < $num) { |
| 9889 | 9889 | $obj = $this->db->fetch_object($result); |
| 9890 | 9890 | if ($selected == $obj->rowid) { |
| 9891 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 9891 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 9892 | 9892 | } else { |
| 9893 | - print '<option value="' . $obj->rowid . '">'; |
|
| 9893 | + print '<option value="'.$obj->rowid.'">'; |
|
| 9894 | 9894 | } |
| 9895 | 9895 | print $obj->label; |
| 9896 | 9896 | print '</option>'; |
@@ -9981,8 +9981,8 @@ discard block |
||
| 9981 | 9981 | $stringforfirstkey .= ' CTL +'; |
| 9982 | 9982 | } |
| 9983 | 9983 | |
| 9984 | - $previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" 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>'; |
|
| 9985 | - $next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" 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>'; |
|
| 9984 | + $previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" 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>'; |
|
| 9985 | + $next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" 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>'; |
|
| 9986 | 9986 | } |
| 9987 | 9987 | |
| 9988 | 9988 | //print "xx".$previous_ref."x".$next_ref; |
@@ -9990,18 +9990,18 @@ discard block |
||
| 9990 | 9990 | |
| 9991 | 9991 | // Right part of banner |
| 9992 | 9992 | if ($morehtmlright) { |
| 9993 | - $ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>'; |
|
| 9993 | + $ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>'; |
|
| 9994 | 9994 | } |
| 9995 | 9995 | |
| 9996 | 9996 | if ($previous_ref || $next_ref || $morehtml) { |
| 9997 | 9997 | $ret .= '<div class="pagination paginationref"><ul class="right">'; |
| 9998 | 9998 | } |
| 9999 | 9999 | if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) { |
| 10000 | - $ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>'; |
|
| 10000 | + $ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>'; |
|
| 10001 | 10001 | } |
| 10002 | 10002 | if ($shownav && ($previous_ref || $next_ref)) { |
| 10003 | - $ret .= '<li class="pagination">' . $previous_ref . '</li>'; |
|
| 10004 | - $ret .= '<li class="pagination">' . $next_ref . '</li>'; |
|
| 10003 | + $ret .= '<li class="pagination">'.$previous_ref.'</li>'; |
|
| 10004 | + $ret .= '<li class="pagination">'.$next_ref.'</li>'; |
|
| 10005 | 10005 | } |
| 10006 | 10006 | if ($previous_ref || $next_ref || $morehtml) { |
| 10007 | 10007 | $ret .= '</ul></div>'; |
@@ -10016,7 +10016,7 @@ discard block |
||
| 10016 | 10016 | $morehtmlstatus = $hookmanager->resPrint; |
| 10017 | 10017 | } |
| 10018 | 10018 | if ($morehtmlstatus) { |
| 10019 | - $ret .= '<div class="statusref">' . $morehtmlstatus . '</div>'; |
|
| 10019 | + $ret .= '<div class="statusref">'.$morehtmlstatus.'</div>'; |
|
| 10020 | 10020 | } |
| 10021 | 10021 | |
| 10022 | 10022 | $parameters = array(); |
@@ -10030,14 +10030,14 @@ discard block |
||
| 10030 | 10030 | // Left part of banner |
| 10031 | 10031 | if ($morehtmlleft) { |
| 10032 | 10032 | if ($conf->browser->layout == 'phone') { |
| 10033 | - $ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>'; |
|
| 10033 | + $ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>'; |
|
| 10034 | 10034 | } else { |
| 10035 | - $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>'; |
|
| 10035 | + $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>'; |
|
| 10036 | 10036 | } |
| 10037 | 10037 | } |
| 10038 | 10038 | |
| 10039 | 10039 | //if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>'; |
| 10040 | - $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">'; |
|
| 10040 | + $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">'; |
|
| 10041 | 10041 | |
| 10042 | 10042 | // For thirdparty, contact, user, member, the ref is the id, so we show something else |
| 10043 | 10043 | if ($object->element == 'societe') { |
@@ -10051,7 +10051,7 @@ discard block |
||
| 10051 | 10051 | |
| 10052 | 10052 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
| 10053 | 10053 | if (!is_object($extralanguages)) { |
| 10054 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
| 10054 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
| 10055 | 10055 | $extralanguages = new ExtraLanguages($this->db); |
| 10056 | 10056 | } |
| 10057 | 10057 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -10066,29 +10066,29 @@ discard block |
||
| 10066 | 10066 | if ($object->array_languages['name'][$extralangcode]) { |
| 10067 | 10067 | $htmltext .= $object->array_languages['name'][$extralangcode]; |
| 10068 | 10068 | } else { |
| 10069 | - $htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>'; |
|
| 10069 | + $htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>'; |
|
| 10070 | 10070 | } |
| 10071 | 10071 | } |
| 10072 | - $ret .= '<!-- Show translations of name -->' . "\n"; |
|
| 10072 | + $ret .= '<!-- Show translations of name -->'."\n"; |
|
| 10073 | 10073 | $ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft'); |
| 10074 | 10074 | } |
| 10075 | 10075 | } |
| 10076 | 10076 | } elseif ($object->element == 'member') { |
| 10077 | 10077 | '@phan-var-force Adherent $object'; |
| 10078 | - $ret .= $object->ref . '<br>'; |
|
| 10078 | + $ret .= $object->ref.'<br>'; |
|
| 10079 | 10079 | $fullname = $object->getFullName($langs); |
| 10080 | 10080 | if ($object->morphy == 'mor' && $object->societe) { |
| 10081 | - $ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''); |
|
| 10081 | + $ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : ''); |
|
| 10082 | 10082 | } else { |
| 10083 | - $ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : ''); |
|
| 10083 | + $ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : ''); |
|
| 10084 | 10084 | } |
| 10085 | 10085 | } elseif (in_array($object->element, array('contact', 'user'))) { |
| 10086 | - $ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt; |
|
| 10086 | + $ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt; |
|
| 10087 | 10087 | } elseif ($object->element == 'usergroup') { |
| 10088 | 10088 | $ret .= dol_htmlentities($object->name); |
| 10089 | 10089 | } elseif (in_array($object->element, array('action', 'agenda'))) { |
| 10090 | 10090 | '@phan-var-force ActionComm $object'; |
| 10091 | - $ret .= $object->ref . '<br>' . $object->label; |
|
| 10091 | + $ret .= $object->ref.'<br>'.$object->label; |
|
| 10092 | 10092 | } elseif (in_array($object->element, array('adherent_type'))) { |
| 10093 | 10093 | $ret .= $object->label; |
| 10094 | 10094 | } elseif ($object->element == 'ecm_directories') { |
@@ -10141,9 +10141,9 @@ discard block |
||
| 10141 | 10141 | } |
| 10142 | 10142 | |
| 10143 | 10143 | // Barcode image @phan-suppress-next-line PhanUndeclaredProperty |
| 10144 | - $url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code); |
|
| 10145 | - $out = '<!-- url barcode = ' . $url . ' -->'; |
|
| 10146 | - $out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>'; |
|
| 10144 | + $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code); |
|
| 10145 | + $out = '<!-- url barcode = '.$url.' -->'; |
|
| 10146 | + $out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>'; |
|
| 10147 | 10147 | |
| 10148 | 10148 | return $out; |
| 10149 | 10149 | } |
@@ -10170,7 +10170,7 @@ discard block |
||
| 10170 | 10170 | global $conf, $langs; |
| 10171 | 10171 | |
| 10172 | 10172 | $entity = (empty($object->entity) ? $conf->entity : $object->entity); |
| 10173 | - $id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid) |
|
| 10173 | + $id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid) |
|
| 10174 | 10174 | |
| 10175 | 10175 | $dir = ''; |
| 10176 | 10176 | $file = ''; |
@@ -10183,28 +10183,28 @@ discard block |
||
| 10183 | 10183 | if (!empty($object->logo)) { |
| 10184 | 10184 | if (dolIsAllowedForPreview($object->logo)) { |
| 10185 | 10185 | if ((string) $imagesize == 'mini') { |
| 10186 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
| 10186 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
| 10187 | 10187 | } elseif ((string) $imagesize == 'small') { |
| 10188 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small'); |
|
| 10188 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small'); |
|
| 10189 | 10189 | } else { |
| 10190 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
| 10190 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
| 10191 | 10191 | } |
| 10192 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
| 10192 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
| 10193 | 10193 | } |
| 10194 | 10194 | } |
| 10195 | 10195 | $email = $object->email; |
| 10196 | 10196 | } elseif ($modulepart == 'contact') { |
| 10197 | - $dir = $conf->societe->multidir_output[$entity] . '/contact'; |
|
| 10197 | + $dir = $conf->societe->multidir_output[$entity].'/contact'; |
|
| 10198 | 10198 | if (!empty($object->photo)) { |
| 10199 | 10199 | if (dolIsAllowedForPreview($object->photo)) { |
| 10200 | 10200 | if ((string) $imagesize == 'mini') { |
| 10201 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 10201 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 10202 | 10202 | } elseif ((string) $imagesize == 'small') { |
| 10203 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 10203 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 10204 | 10204 | } else { |
| 10205 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
| 10205 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
| 10206 | 10206 | } |
| 10207 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
| 10207 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
| 10208 | 10208 | } |
| 10209 | 10209 | } |
| 10210 | 10210 | $email = $object->email; |
@@ -10214,17 +10214,17 @@ discard block |
||
| 10214 | 10214 | if (!empty($object->photo)) { |
| 10215 | 10215 | if (dolIsAllowedForPreview($object->photo)) { |
| 10216 | 10216 | if ((string) $imagesize == 'mini') { |
| 10217 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 10217 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 10218 | 10218 | } elseif ((string) $imagesize == 'small') { |
| 10219 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 10219 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 10220 | 10220 | } else { |
| 10221 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
| 10221 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
| 10222 | 10222 | } |
| 10223 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
| 10223 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
| 10224 | 10224 | } |
| 10225 | 10225 | } |
| 10226 | 10226 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
| 10227 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 10227 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 10228 | 10228 | } |
| 10229 | 10229 | $email = $object->email; |
| 10230 | 10230 | $capture = 'user'; |
@@ -10233,17 +10233,17 @@ discard block |
||
| 10233 | 10233 | if (!empty($object->photo)) { |
| 10234 | 10234 | if (dolIsAllowedForPreview($object->photo)) { |
| 10235 | 10235 | if ((string) $imagesize == 'mini') { |
| 10236 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 10236 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 10237 | 10237 | } elseif ((string) $imagesize == 'small') { |
| 10238 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 10238 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 10239 | 10239 | } else { |
| 10240 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
| 10240 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
| 10241 | 10241 | } |
| 10242 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
| 10242 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
| 10243 | 10243 | } |
| 10244 | 10244 | } |
| 10245 | 10245 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
| 10246 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 10246 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 10247 | 10247 | } |
| 10248 | 10248 | $email = $object->email; |
| 10249 | 10249 | $capture = 'user'; |
@@ -10269,35 +10269,35 @@ discard block |
||
| 10269 | 10269 | $ret = ''; |
| 10270 | 10270 | |
| 10271 | 10271 | if ($dir) { |
| 10272 | - if ($file && file_exists($dir . "/" . $file)) { |
|
| 10272 | + if ($file && file_exists($dir."/".$file)) { |
|
| 10273 | 10273 | if ($addlinktofullsize) { |
| 10274 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
| 10274 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
| 10275 | 10275 | if ($urladvanced) { |
| 10276 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
| 10276 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
| 10277 | 10277 | } else { |
| 10278 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
| 10278 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
| 10279 | 10279 | } |
| 10280 | 10280 | } |
| 10281 | - $ret .= '<img alt="" 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 . '">'; |
|
| 10281 | + $ret .= '<img alt="" 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.'">'; |
|
| 10282 | 10282 | if ($addlinktofullsize) { |
| 10283 | 10283 | $ret .= '</a>'; |
| 10284 | 10284 | } |
| 10285 | - } elseif ($altfile && file_exists($dir . "/" . $altfile)) { |
|
| 10285 | + } elseif ($altfile && file_exists($dir."/".$altfile)) { |
|
| 10286 | 10286 | if ($addlinktofullsize) { |
| 10287 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
| 10287 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
| 10288 | 10288 | if ($urladvanced) { |
| 10289 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
| 10289 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
| 10290 | 10290 | } else { |
| 10291 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
| 10291 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
| 10292 | 10292 | } |
| 10293 | 10293 | } |
| 10294 | - $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 . '">'; |
|
| 10294 | + $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.'">'; |
|
| 10295 | 10295 | if ($addlinktofullsize) { |
| 10296 | 10296 | $ret .= '</a>'; |
| 10297 | 10297 | } |
| 10298 | 10298 | } else { |
| 10299 | 10299 | $nophoto = '/public/theme/common/nophoto.png'; |
| 10300 | - $defaultimg = 'identicon'; // For gravatar |
|
| 10300 | + $defaultimg = 'identicon'; // For gravatar |
|
| 10301 | 10301 | if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) { // For modules that need a special image when photo not found |
| 10302 | 10302 | if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor') !== false)) { |
| 10303 | 10303 | $nophoto = 'company'; |
@@ -10315,13 +10315,13 @@ discard block |
||
| 10315 | 10315 | if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) { |
| 10316 | 10316 | // see https://gravatar.com/site/implement/images/php/ |
| 10317 | 10317 | $ret .= '<!-- Put link to gravatar -->'; |
| 10318 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" title="' . $email . ' Gravatar avatar" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="https://www.gravatar.com/avatar/' . dol_hash(strtolower(trim($email)), 'sha256', 1) . '?s=' . $width . '&d=' . $defaultimg . '">'; // gravatar need md5 hash |
|
| 10318 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)), 'sha256', 1).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash |
|
| 10319 | 10319 | } else { |
| 10320 | 10320 | if ($nophoto == 'company') { |
| 10321 | - $ret .= '<div class="divforspanimg valignmiddle center photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>'; |
|
| 10321 | + $ret .= '<div class="divforspanimg valignmiddle center photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>'; |
|
| 10322 | 10322 | //$ret .= '<div class="difforspanimgright"></div>'; |
| 10323 | 10323 | } else { |
| 10324 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">'; |
|
| 10324 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">'; |
|
| 10325 | 10325 | } |
| 10326 | 10326 | } |
| 10327 | 10327 | } |
@@ -10332,15 +10332,15 @@ discard block |
||
| 10332 | 10332 | } |
| 10333 | 10333 | $ret .= '<table class="nobordernopadding centpercent">'; |
| 10334 | 10334 | if ($object->photo) { |
| 10335 | - $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>'; |
|
| 10335 | + $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>'; |
|
| 10336 | 10336 | } |
| 10337 | 10337 | $ret .= '<tr><td class="tdoverflow">'; |
| 10338 | 10338 | $maxfilesizearray = getMaxFileSizeArray(); |
| 10339 | 10339 | $maxmin = $maxfilesizearray['maxmin']; |
| 10340 | 10340 | if ($maxmin > 0) { |
| 10341 | - $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 10341 | + $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 10342 | 10342 | } |
| 10343 | - $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>'; |
|
| 10343 | + $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>'; |
|
| 10344 | 10344 | $ret .= '</td></tr>'; |
| 10345 | 10345 | $ret .= '</table>'; |
| 10346 | 10346 | } |
@@ -10394,38 +10394,38 @@ discard block |
||
| 10394 | 10394 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 10395 | 10395 | $sql .= ", e.label"; |
| 10396 | 10396 | } |
| 10397 | - $sql .= " FROM " . $this->db->prefix() . "usergroup as ug "; |
|
| 10397 | + $sql .= " FROM ".$this->db->prefix()."usergroup as ug "; |
|
| 10398 | 10398 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 10399 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity"; |
|
| 10399 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity"; |
|
| 10400 | 10400 | if ($force_entity) { |
| 10401 | - $sql .= " WHERE ug.entity IN (0, " . $force_entity . ")"; |
|
| 10401 | + $sql .= " WHERE ug.entity IN (0, ".$force_entity.")"; |
|
| 10402 | 10402 | } else { |
| 10403 | 10403 | $sql .= " WHERE ug.entity IS NOT NULL"; |
| 10404 | 10404 | } |
| 10405 | 10405 | } else { |
| 10406 | - $sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")"; |
|
| 10406 | + $sql .= " WHERE ug.entity IN (0, ".$conf->entity.")"; |
|
| 10407 | 10407 | } |
| 10408 | 10408 | if (is_array($exclude) && $excludeGroups) { |
| 10409 | - $sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")"; |
|
| 10409 | + $sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")"; |
|
| 10410 | 10410 | } |
| 10411 | 10411 | if (is_array($include) && $includeGroups) { |
| 10412 | - $sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")"; |
|
| 10412 | + $sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")"; |
|
| 10413 | 10413 | } |
| 10414 | 10414 | $sql .= " ORDER BY ug.nom ASC"; |
| 10415 | 10415 | |
| 10416 | - dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG); |
|
| 10416 | + dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG); |
|
| 10417 | 10417 | $resql = $this->db->query($sql); |
| 10418 | 10418 | if ($resql) { |
| 10419 | 10419 | // Enhance with select2 |
| 10420 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10420 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10421 | 10421 | |
| 10422 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
| 10422 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
| 10423 | 10423 | |
| 10424 | 10424 | $num = $this->db->num_rows($resql); |
| 10425 | 10425 | $i = 0; |
| 10426 | 10426 | if ($num) { |
| 10427 | 10427 | if ($show_empty && !$multiple) { |
| 10428 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '> </option>' . "\n"; |
|
| 10428 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'> </option>'."\n"; |
|
| 10429 | 10429 | } |
| 10430 | 10430 | |
| 10431 | 10431 | while ($i < $num) { |
@@ -10438,11 +10438,11 @@ discard block |
||
| 10438 | 10438 | $label = $obj->name; |
| 10439 | 10439 | $labelhtml = $obj->name; |
| 10440 | 10440 | if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) { |
| 10441 | - $label .= " (" . $obj->label . ")"; |
|
| 10442 | - $labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>'; |
|
| 10441 | + $label .= " (".$obj->label.")"; |
|
| 10442 | + $labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>'; |
|
| 10443 | 10443 | } |
| 10444 | 10444 | |
| 10445 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 10445 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 10446 | 10446 | if ($disableline) { |
| 10447 | 10447 | $out .= ' disabled'; |
| 10448 | 10448 | } |
@@ -10458,9 +10458,9 @@ discard block |
||
| 10458 | 10458 | } |
| 10459 | 10459 | } else { |
| 10460 | 10460 | if ($show_empty) { |
| 10461 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n"; |
|
| 10461 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n"; |
|
| 10462 | 10462 | } |
| 10463 | - $out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>'; |
|
| 10463 | + $out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>'; |
|
| 10464 | 10464 | } |
| 10465 | 10465 | $out .= '</select>'; |
| 10466 | 10466 | |
@@ -10504,25 +10504,25 @@ discard block |
||
| 10504 | 10504 | $out = ''; |
| 10505 | 10505 | |
| 10506 | 10506 | if (!empty($conf->use_javascript_ajax)) { |
| 10507 | - $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>'; |
|
| 10507 | + $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>'; |
|
| 10508 | 10508 | } |
| 10509 | - $out .= '<script nonce="' . getNonce() . '"> |
|
| 10509 | + $out .= '<script nonce="'.getNonce().'"> |
|
| 10510 | 10510 | $(document).ready(function() { |
| 10511 | - $("#' . $cssclass . 's").click(function() { |
|
| 10511 | + $("#' . $cssclass.'s").click(function() { |
|
| 10512 | 10512 | if($(this).is(\':checked\')){ |
| 10513 | - console.log("We check all ' . $cssclass . ' and trigger the change method"); |
|
| 10514 | - $(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\'); |
|
| 10513 | + console.log("We check all ' . $cssclass.' and trigger the change method"); |
|
| 10514 | + $(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\'); |
|
| 10515 | 10515 | } |
| 10516 | 10516 | else |
| 10517 | 10517 | { |
| 10518 | 10518 | console.log("We uncheck all"); |
| 10519 | - $(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\'); |
|
| 10519 | + $(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\'); |
|
| 10520 | 10520 | }' . "\n"; |
| 10521 | 10521 | if ($calljsfunction) { |
| 10522 | - $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
| 10522 | + $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
| 10523 | 10523 | } |
| 10524 | 10524 | $out .= ' }); |
| 10525 | - $(".' . $cssclass . '").change(function() { |
|
| 10525 | + $(".' . $cssclass.'").change(function() { |
|
| 10526 | 10526 | $(this).closest("tr").toggleClass("highlight", this.checked); |
| 10527 | 10527 | }); |
| 10528 | 10528 | }); |
@@ -10567,67 +10567,67 @@ discard block |
||
| 10567 | 10567 | global $langs, $user; |
| 10568 | 10568 | |
| 10569 | 10569 | $out = ''; |
| 10570 | - $sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1"; |
|
| 10571 | - $sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")"; |
|
| 10570 | + $sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1"; |
|
| 10571 | + $sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")"; |
|
| 10572 | 10572 | if (!empty($excludeid)) { |
| 10573 | - $sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")"; |
|
| 10573 | + $sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")"; |
|
| 10574 | 10574 | } |
| 10575 | 10575 | $sql .= " ORDER BY label"; |
| 10576 | 10576 | |
| 10577 | 10577 | $resql = $this->db->query($sql); |
| 10578 | 10578 | if ($resql) { |
| 10579 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">'; |
|
| 10579 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">'; |
|
| 10580 | 10580 | if ($useempty) { |
| 10581 | 10581 | $out .= '<option value="0"> </option>'; |
| 10582 | 10582 | } |
| 10583 | 10583 | |
| 10584 | 10584 | while ($obj = $this->db->fetch_object($resql)) { |
| 10585 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>'; |
|
| 10585 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>'; |
|
| 10586 | 10586 | } |
| 10587 | 10587 | $out .= '</select>'; |
| 10588 | - $out .= ajax_combobox('select_' . $htmlname); |
|
| 10588 | + $out .= ajax_combobox('select_'.$htmlname); |
|
| 10589 | 10589 | |
| 10590 | 10590 | if (!empty($htmlname) && $user->admin && $info_admin) { |
| 10591 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 10591 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 10592 | 10592 | } |
| 10593 | 10593 | |
| 10594 | 10594 | if (!empty($target)) { |
| 10595 | - $sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
| 10595 | + $sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
| 10596 | 10596 | $resql = $this->db->query($sql); |
| 10597 | 10597 | if ($resql) { |
| 10598 | 10598 | if ($this->db->num_rows($resql) > 0) { |
| 10599 | 10599 | $obj = $this->db->fetch_object($resql); |
| 10600 | - $out .= '<script nonce="' . getNonce() . '"> |
|
| 10600 | + $out .= '<script nonce="'.getNonce().'"> |
|
| 10601 | 10601 | $(function() { |
| 10602 | - $("select[name=' . $target . ']").on("change", function() { |
|
| 10602 | + $("select[name=' . $target.']").on("change", function() { |
|
| 10603 | 10603 | var current_val = $(this).val(); |
| 10604 | - if (current_val == ' . $obj->id . ') {'; |
|
| 10604 | + if (current_val == ' . $obj->id.') {'; |
|
| 10605 | 10605 | if (!empty($default_selected) || !empty($selected)) { |
| 10606 | - $out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");'; |
|
| 10606 | + $out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");'; |
|
| 10607 | 10607 | } |
| 10608 | 10608 | |
| 10609 | 10609 | $out .= ' |
| 10610 | - $("select[name=' . $htmlname . ']").change(); |
|
| 10610 | + $("select[name=' . $htmlname.']").change(); |
|
| 10611 | 10611 | } |
| 10612 | 10612 | }); |
| 10613 | 10613 | |
| 10614 | - $("select[name=' . $htmlname . ']").change(function() { |
|
| 10614 | + $("select[name=' . $htmlname.']").change(function() { |
|
| 10615 | 10615 | |
| 10616 | - if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') { |
|
| 10616 | + if ($("select[name=' . $target.']").val() == '.$obj->id.') { |
|
| 10617 | 10617 | // get price of kilometer to fill the unit price |
| 10618 | 10618 | $.ajax({ |
| 10619 | 10619 | method: "POST", |
| 10620 | 10620 | dataType: "json", |
| 10621 | - data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' }, |
|
| 10622 | - url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '", |
|
| 10621 | + data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' }, |
|
| 10622 | + url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'", |
|
| 10623 | 10623 | }).done(function( data, textStatus, jqXHR ) { |
| 10624 | 10624 | console.log(data); |
| 10625 | 10625 | if (typeof data.up != "undefined") { |
| 10626 | 10626 | $("input[name=value_unit]").val(data.up); |
| 10627 | - $("select[name=' . $htmlname . ']").attr("title", data.title); |
|
| 10627 | + $("select[name=' . $htmlname.']").attr("title", data.title); |
|
| 10628 | 10628 | } else { |
| 10629 | 10629 | $("input[name=value_unit]").val(""); |
| 10630 | - $("select[name=' . $htmlname . ']").attr("title", ""); |
|
| 10630 | + $("select[name=' . $htmlname.']").attr("title", ""); |
|
| 10631 | 10631 | } |
| 10632 | 10632 | }); |
| 10633 | 10633 | } |
@@ -10657,18 +10657,18 @@ discard block |
||
| 10657 | 10657 | global $conf, $langs; |
| 10658 | 10658 | |
| 10659 | 10659 | $out = ''; |
| 10660 | - $sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range"; |
|
| 10661 | - $sql .= " WHERE entity = " . $conf->entity . " AND active = 1"; |
|
| 10660 | + $sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range"; |
|
| 10661 | + $sql .= " WHERE entity = ".$conf->entity." AND active = 1"; |
|
| 10662 | 10662 | |
| 10663 | 10663 | $resql = $this->db->query($sql); |
| 10664 | 10664 | if ($resql) { |
| 10665 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
| 10665 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
| 10666 | 10666 | if ($useempty) { |
| 10667 | 10667 | $out .= '<option value="0"></option>'; |
| 10668 | 10668 | } |
| 10669 | 10669 | |
| 10670 | 10670 | while ($obj = $this->db->fetch_object($resql)) { |
| 10671 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>'; |
|
| 10671 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>'; |
|
| 10672 | 10672 | } |
| 10673 | 10673 | $out .= '</select>'; |
| 10674 | 10674 | } else { |
@@ -10699,12 +10699,12 @@ discard block |
||
| 10699 | 10699 | |
| 10700 | 10700 | $resql = $this->db->query($sql); |
| 10701 | 10701 | if ($resql) { |
| 10702 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
| 10702 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
| 10703 | 10703 | if ($useempty) { |
| 10704 | 10704 | $out .= '<option value="0"></option>'; |
| 10705 | 10705 | } |
| 10706 | 10706 | if ($allchoice) { |
| 10707 | - $out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>'; |
|
| 10707 | + $out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>'; |
|
| 10708 | 10708 | } |
| 10709 | 10709 | |
| 10710 | 10710 | $field = 'code'; |
@@ -10714,7 +10714,7 @@ discard block |
||
| 10714 | 10714 | |
| 10715 | 10715 | while ($obj = $this->db->fetch_object($resql)) { |
| 10716 | 10716 | $key = $langs->trans($obj->code); |
| 10717 | - $out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>'; |
|
| 10717 | + $out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>'; |
|
| 10718 | 10718 | } |
| 10719 | 10719 | $out .= '</select>'; |
| 10720 | 10720 | |
@@ -10748,7 +10748,7 @@ discard block |
||
| 10748 | 10748 | { |
| 10749 | 10749 | global $user, $conf, $langs; |
| 10750 | 10750 | |
| 10751 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 10751 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 10752 | 10752 | |
| 10753 | 10753 | if (is_null($usertofilter)) { |
| 10754 | 10754 | $usertofilter = $user; |
@@ -10772,10 +10772,10 @@ discard block |
||
| 10772 | 10772 | $sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref, |
| 10773 | 10773 | p.title, p.fk_soc, p.fk_statut, p.public,"; |
| 10774 | 10774 | $sql .= ' s.nom as name'; |
| 10775 | - $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
|
| 10776 | - $sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,'; |
|
| 10777 | - $sql .= ' ' . $this->db->prefix() . 'facture as f'; |
|
| 10778 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
| 10775 | + $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
| 10776 | + $sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,'; |
|
| 10777 | + $sql .= ' '.$this->db->prefix().'facture as f'; |
|
| 10778 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
| 10779 | 10779 | $sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement |
| 10780 | 10780 | //if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
| 10781 | 10781 | //if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
@@ -10786,14 +10786,14 @@ discard block |
||
| 10786 | 10786 | if ($resql) { |
| 10787 | 10787 | // Use select2 selector |
| 10788 | 10788 | if (!empty($conf->use_javascript_ajax)) { |
| 10789 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10789 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10790 | 10790 | $comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus); |
| 10791 | 10791 | $out .= $comboenhancement; |
| 10792 | 10792 | $morecss = 'minwidth200imp maxwidth500'; |
| 10793 | 10793 | } |
| 10794 | 10794 | |
| 10795 | 10795 | if (empty($option_only)) { |
| 10796 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 10796 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 10797 | 10797 | } |
| 10798 | 10798 | if (!empty($show_empty)) { |
| 10799 | 10799 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10823,33 +10823,33 @@ discard block |
||
| 10823 | 10823 | if ($showproject == 'all') { |
| 10824 | 10824 | $labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref |
| 10825 | 10825 | if ($obj->name) { |
| 10826 | - $labeltoshow .= ' - ' . $obj->name; // Soc name |
|
| 10826 | + $labeltoshow .= ' - '.$obj->name; // Soc name |
|
| 10827 | 10827 | } |
| 10828 | 10828 | |
| 10829 | 10829 | $disabled = 0; |
| 10830 | 10830 | if ($obj->fk_statut == Project::STATUS_DRAFT) { |
| 10831 | 10831 | $disabled = 1; |
| 10832 | - $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
| 10832 | + $labeltoshow .= ' - '.$langs->trans("Draft"); |
|
| 10833 | 10833 | } elseif ($obj->fk_statut == Project::STATUS_CLOSED) { |
| 10834 | 10834 | if ($discard_closed == 2) { |
| 10835 | 10835 | $disabled = 1; |
| 10836 | 10836 | } |
| 10837 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
| 10837 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
| 10838 | 10838 | } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
| 10839 | 10839 | $disabled = 1; |
| 10840 | - $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
| 10840 | + $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
|
| 10841 | 10841 | } |
| 10842 | 10842 | } |
| 10843 | 10843 | |
| 10844 | 10844 | if (!empty($selected) && $selected == $obj->rowid) { |
| 10845 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
| 10845 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
| 10846 | 10846 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
| 10847 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 10847 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 10848 | 10848 | } else { |
| 10849 | 10849 | if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
| 10850 | 10850 | $resultat = ''; |
| 10851 | 10851 | } else { |
| 10852 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
| 10852 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
| 10853 | 10853 | if ($disabled) { |
| 10854 | 10854 | $resultat .= ' disabled'; |
| 10855 | 10855 | } |
@@ -10901,22 +10901,22 @@ discard block |
||
| 10901 | 10901 | |
| 10902 | 10902 | $sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc'; |
| 10903 | 10903 | //$sql.= ', el.fk_source'; |
| 10904 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f'; |
|
| 10905 | - $sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")"; |
|
| 10904 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f'; |
|
| 10905 | + $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; |
|
| 10906 | 10906 | $sql .= " ORDER BY f.titre ASC"; |
| 10907 | 10907 | |
| 10908 | 10908 | $resql = $this->db->query($sql); |
| 10909 | 10909 | if ($resql) { |
| 10910 | 10910 | // Use select2 selector |
| 10911 | 10911 | if (!empty($conf->use_javascript_ajax)) { |
| 10912 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10912 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10913 | 10913 | $comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus); |
| 10914 | 10914 | $out .= $comboenhancement; |
| 10915 | 10915 | $morecss = 'minwidth200imp maxwidth500'; |
| 10916 | 10916 | } |
| 10917 | 10917 | |
| 10918 | 10918 | if (empty($option_only)) { |
| 10919 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 10919 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 10920 | 10920 | } |
| 10921 | 10921 | if (!empty($show_empty)) { |
| 10922 | 10922 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10935,19 +10935,19 @@ discard block |
||
| 10935 | 10935 | $disabled = 0; |
| 10936 | 10936 | if (!empty($obj->suspended)) { |
| 10937 | 10937 | $disabled = 1; |
| 10938 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
| 10938 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
| 10939 | 10939 | } |
| 10940 | 10940 | |
| 10941 | 10941 | |
| 10942 | 10942 | if (!empty($selected) && $selected == $obj->rowid) { |
| 10943 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
| 10943 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
| 10944 | 10944 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
| 10945 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 10945 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 10946 | 10946 | } else { |
| 10947 | 10947 | if ($disabled && ($selected != $obj->rowid)) { |
| 10948 | 10948 | $resultat = ''; |
| 10949 | 10949 | } else { |
| 10950 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
| 10950 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
| 10951 | 10951 | if ($disabled) { |
| 10952 | 10952 | $resultat .= ' disabled'; |
| 10953 | 10953 | } |
@@ -10987,14 +10987,14 @@ discard block |
||
| 10987 | 10987 | global $langs; |
| 10988 | 10988 | |
| 10989 | 10989 | if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) { // If $search_component_params_hidden does not start and end with () |
| 10990 | - $search_component_params_hidden = '(' . $search_component_params_hidden . ')'; |
|
| 10990 | + $search_component_params_hidden = '('.$search_component_params_hidden.')'; |
|
| 10991 | 10991 | } |
| 10992 | 10992 | |
| 10993 | 10993 | $ret = ''; |
| 10994 | 10994 | |
| 10995 | 10995 | $ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">'; |
| 10996 | 10996 | $ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">'; |
| 10997 | - $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>'; |
|
| 10997 | + $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>'; |
|
| 10998 | 10998 | $ret .= '</a>'; |
| 10999 | 10999 | |
| 11000 | 11000 | $ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">'; |
@@ -11038,29 +11038,29 @@ discard block |
||
| 11038 | 11038 | $ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">'; |
| 11039 | 11039 | } |
| 11040 | 11040 | $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%')) -->"; |
| 11041 | - $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">'; |
|
| 11041 | + $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">'; |
|
| 11042 | 11042 | // $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->"; |
| 11043 | 11043 | |
| 11044 | 11044 | // For compatibility with forms that show themself the search criteria in addition of this component, we output these fields |
| 11045 | 11045 | foreach ($arrayofcriterias as $criteria) { |
| 11046 | 11046 | foreach ($criteria as $criteriafamilykey => $criteriafamilyval) { |
| 11047 | - if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
| 11047 | + if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
| 11048 | 11048 | continue; |
| 11049 | 11049 | } |
| 11050 | 11050 | if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) { |
| 11051 | 11051 | continue; |
| 11052 | 11052 | } |
| 11053 | 11053 | if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) { |
| 11054 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">'; |
|
| 11055 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">'; |
|
| 11056 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">'; |
|
| 11057 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">'; |
|
| 11058 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">'; |
|
| 11059 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">'; |
|
| 11060 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">'; |
|
| 11061 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">'; |
|
| 11054 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">'; |
|
| 11055 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">'; |
|
| 11056 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">'; |
|
| 11057 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">'; |
|
| 11058 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">'; |
|
| 11059 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">'; |
|
| 11060 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">'; |
|
| 11061 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">'; |
|
| 11062 | 11062 | } else { |
| 11063 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">'; |
|
| 11063 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">'; |
|
| 11064 | 11064 | } |
| 11065 | 11065 | } |
| 11066 | 11066 | } |
@@ -11068,7 +11068,7 @@ discard block |
||
| 11068 | 11068 | $ret .= '</div>'; |
| 11069 | 11069 | |
| 11070 | 11070 | $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"; |
| 11071 | - $ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
| 11071 | + $ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
| 11072 | 11072 | |
| 11073 | 11073 | $ret .= '</div>'; |
| 11074 | 11074 | $ret .= '</div>'; |
@@ -11142,7 +11142,7 @@ discard block |
||
| 11142 | 11142 | |
| 11143 | 11143 | $TModels = array(); |
| 11144 | 11144 | |
| 11145 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
| 11145 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
| 11146 | 11146 | $formmail = new FormMail($this->db); |
| 11147 | 11147 | $result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs); |
| 11148 | 11148 | |
@@ -11155,17 +11155,17 @@ discard block |
||
| 11155 | 11155 | } |
| 11156 | 11156 | } |
| 11157 | 11157 | |
| 11158 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">'; |
|
| 11158 | + $retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">'; |
|
| 11159 | 11159 | |
| 11160 | 11160 | foreach ($TModels as $id_model => $label_model) { |
| 11161 | - $retstring .= '<option value="' . $id_model . '"'; |
|
| 11162 | - $retstring .= ">" . $label_model . "</option>"; |
|
| 11161 | + $retstring .= '<option value="'.$id_model.'"'; |
|
| 11162 | + $retstring .= ">".$label_model."</option>"; |
|
| 11163 | 11163 | } |
| 11164 | 11164 | |
| 11165 | 11165 | $retstring .= "</select>"; |
| 11166 | 11166 | |
| 11167 | 11167 | if ($addjscombo) { |
| 11168 | - $retstring .= ajax_combobox('select_' . $prefix . 'model_mail'); |
|
| 11168 | + $retstring .= ajax_combobox('select_'.$prefix.'model_mail'); |
|
| 11169 | 11169 | } |
| 11170 | 11170 | |
| 11171 | 11171 | return $retstring; |
@@ -11216,16 +11216,16 @@ discard block |
||
| 11216 | 11216 | |
| 11217 | 11217 | foreach ($buttons as $button) { |
| 11218 | 11218 | $addclass = empty($button['addclass']) ? '' : $button['addclass']; |
| 11219 | - $retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">'; |
|
| 11219 | + $retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">'; |
|
| 11220 | 11220 | } |
| 11221 | 11221 | $retstring .= $withoutdiv ? '' : '</div>'; |
| 11222 | 11222 | |
| 11223 | 11223 | if ($dol_openinpopup) { |
| 11224 | - $retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . dol_escape_htmltag($dol_openinpopup) . ' context, so we enable the close of dialog on cancel -->' . "\n"; |
|
| 11225 | - $retstring .= '<script nonce="' . getNonce() . '">'; |
|
| 11224 | + $retstring .= '<!-- buttons are shown into a $dol_openinpopup='.dol_escape_htmltag($dol_openinpopup).' context, so we enable the close of dialog on cancel -->'."\n"; |
|
| 11225 | + $retstring .= '<script nonce="'.getNonce().'">'; |
|
| 11226 | 11226 | $retstring .= 'jQuery(".button-cancel").click(function(e) { |
| 11227 | - e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup) . '\'); |
|
| 11228 | - window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup) . '\').dialog(\'close\'); |
|
| 11227 | + e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup).'\'); |
|
| 11228 | + window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup).'\').dialog(\'close\'); |
|
| 11229 | 11229 | });'; |
| 11230 | 11230 | $retstring .= '</script>'; |
| 11231 | 11231 | } |
@@ -11254,7 +11254,7 @@ discard block |
||
| 11254 | 11254 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 11255 | 11255 | |
| 11256 | 11256 | $sql = "SELECT rowid, code, label as label"; |
| 11257 | - $sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype'; |
|
| 11257 | + $sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype'; |
|
| 11258 | 11258 | $sql .= " WHERE active = 1"; |
| 11259 | 11259 | |
| 11260 | 11260 | $resql = $this->db->query($sql); |
@@ -11265,7 +11265,7 @@ discard block |
||
| 11265 | 11265 | $obj = $this->db->fetch_object($resql); |
| 11266 | 11266 | |
| 11267 | 11267 | // If translation exists, we use it, otherwise we take the default wording |
| 11268 | - $label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
| 11268 | + $label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
| 11269 | 11269 | $this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid; |
| 11270 | 11270 | $this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code; |
| 11271 | 11271 | $this->cache_invoice_subtype[$obj->rowid]['label'] = $label; |
@@ -11297,18 +11297,18 @@ discard block |
||
| 11297 | 11297 | global $langs, $user; |
| 11298 | 11298 | |
| 11299 | 11299 | $out = ''; |
| 11300 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 11300 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 11301 | 11301 | |
| 11302 | 11302 | $this->load_cache_invoice_subtype(); |
| 11303 | 11303 | |
| 11304 | - $out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 11304 | + $out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 11305 | 11305 | if ($addempty) { |
| 11306 | 11306 | $out .= '<option value="0"> </option>'; |
| 11307 | 11307 | } |
| 11308 | 11308 | |
| 11309 | 11309 | foreach ($this->cache_invoice_subtype as $rowid => $subtype) { |
| 11310 | 11310 | $label = $subtype['label']; |
| 11311 | - $out .= '<option value="' . $subtype['rowid'] . '"'; |
|
| 11311 | + $out .= '<option value="'.$subtype['rowid'].'"'; |
|
| 11312 | 11312 | if ($selected == $subtype['rowid']) { |
| 11313 | 11313 | $out .= ' selected="selected"'; |
| 11314 | 11314 | } |
@@ -243,11 +243,11 @@ discard block |
||
| 243 | 243 | /** |
| 244 | 244 | * @var float |
| 245 | 245 | */ |
| 246 | - public $posxpicture; // For picture |
|
| 246 | + public $posxpicture; // For picture |
|
| 247 | 247 | /** |
| 248 | 248 | * @var float |
| 249 | 249 | */ |
| 250 | - public $posxdesc; // For description |
|
| 250 | + public $posxdesc; // For description |
|
| 251 | 251 | /** |
| 252 | 252 | * @var float |
| 253 | 253 | */ |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | // phpcs:enable |
| 326 | 326 | global $conf, $extrafields; |
| 327 | 327 | |
| 328 | - $logotouse = $conf->user->dir_output . '/' . get_exdir(0, 0, 0, 0, $user, 'user') . 'photos/' . getImageFileNameForSize($user->photo, '_small'); |
|
| 328 | + $logotouse = $conf->user->dir_output.'/'.get_exdir(0, 0, 0, 0, $user, 'user').'photos/'.getImageFileNameForSize($user->photo, '_small'); |
|
| 329 | 329 | |
| 330 | 330 | $array_user = array( |
| 331 | 331 | 'myuser_lastname' => $user->lastname, |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | 'myuser_email' => $user->email, |
| 346 | 346 | 'myuser_logo' => $logotouse, |
| 347 | 347 | 'myuser_job' => $user->job, |
| 348 | - 'myuser_web' => '', // url not exist in $user object |
|
| 348 | + 'myuser_web' => '', // url not exist in $user object |
|
| 349 | 349 | 'myuser_birth' => dol_print_date($user->birth, 'day', 'gmt'), |
| 350 | 350 | 'myuser_dateemployment' => dol_print_date($user->dateemployment, 'day', 'tzuser'), |
| 351 | 351 | 'myuser_dateemploymentend' => dol_print_date($user->dateemploymentend, 'day', 'tzuser'), |
@@ -674,16 +674,16 @@ discard block |
||
| 674 | 674 | $date = (isset($object->element) && $object->element == 'contrat' && isset($object->date_contrat)) ? $object->date_contrat : (isset($object->date) ? $object->date : null); |
| 675 | 675 | |
| 676 | 676 | if ($object instanceof CommandeFournisseur) { |
| 677 | - $object->date_validation = $object->date_valid; |
|
| 677 | + $object->date_validation = $object->date_valid; |
|
| 678 | 678 | $object->date_commande = $object->date; |
| 679 | 679 | } |
| 680 | 680 | $resarray = array( |
| 681 | 681 | $array_key.'_id' => $object->id, |
| 682 | 682 | $array_key.'_ref' => (property_exists($object, 'ref') ? $object->ref : ''), |
| 683 | - $array_key.'_label' => (property_exists($object, 'label') ? $object->label : ''), // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 683 | + $array_key.'_label' => (property_exists($object, 'label') ? $object->label : ''), // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 684 | 684 | $array_key.'_ref_ext' => (property_exists($object, 'ref_ext') ? $object->ref_ext : ''), |
| 685 | 685 | $array_key.'_ref_customer' => (!empty($object->ref_client) ? $object->ref_client : (empty($object->ref_customer) ? '' : $object->ref_customer)), |
| 686 | - $array_key.'_ref_supplier' => (!empty($object->ref_fournisseur) ? $object->ref_fournisseur : (empty($object->ref_supplier) ? '' : $object->ref_supplier)), // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 686 | + $array_key.'_ref_supplier' => (!empty($object->ref_fournisseur) ? $object->ref_fournisseur : (empty($object->ref_supplier) ? '' : $object->ref_supplier)), // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 687 | 687 | $array_key.'_source_invoice_ref' => ((empty($invoice_source) || empty($invoice_source->ref)) ? '' : $invoice_source->ref), |
| 688 | 688 | // Dates |
| 689 | 689 | $array_key.'_hour' => dol_print_date($date, 'hour'), |
@@ -691,7 +691,7 @@ discard block |
||
| 691 | 691 | $array_key.'_date_rfc' => dol_print_date($date, 'dayrfc'), |
| 692 | 692 | $array_key.'_date_limit' => (!empty($object->date_lim_reglement) ? dol_print_date($object->date_lim_reglement, 'day') : ''), |
| 693 | 693 | $array_key.'_date_limit_rfc' => (!empty($object->date_lim_reglement) ? dol_print_date($object->date_lim_reglement, 'dayrfc') : ''), |
| 694 | - $array_key.'_date_end' => (!empty($object->fin_validite) ? dol_print_date($object->fin_validite, 'day') : ''), // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 694 | + $array_key.'_date_end' => (!empty($object->fin_validite) ? dol_print_date($object->fin_validite, 'day') : ''), // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 695 | 695 | $array_key.'_date_creation' => dol_print_date($object->date_creation, 'day'), |
| 696 | 696 | $array_key.'_date_modification' => (!empty($object->date_modification) ? dol_print_date($object->date_modification, 'day') : ''), |
| 697 | 697 | $array_key.'_date_validation' => (!empty($object->date_validation) ? dol_print_date($object->date_validation, 'dayhour') : ''), |
@@ -707,13 +707,13 @@ discard block |
||
| 707 | 707 | $array_key.'_incoterms' => (method_exists($object, 'display_incoterms') ? $object->display_incoterms() : ''), |
| 708 | 708 | |
| 709 | 709 | $array_key.'_total_ht_locale' => price($object->total_ht, 0, $outputlangs), |
| 710 | - $array_key.'_total_vat_locale' => (!empty($object->total_vat) ? price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)), // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 710 | + $array_key.'_total_vat_locale' => (!empty($object->total_vat) ? price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)), // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 711 | 711 | $array_key.'_total_localtax1_locale' => price($object->total_localtax1, 0, $outputlangs), |
| 712 | 712 | $array_key.'_total_localtax2_locale' => price($object->total_localtax2, 0, $outputlangs), |
| 713 | 713 | $array_key.'_total_ttc_locale' => price($object->total_ttc, 0, $outputlangs), |
| 714 | 714 | |
| 715 | 715 | $array_key.'_total_ht' => price2num($object->total_ht), |
| 716 | - $array_key.'_total_vat' => (!empty($object->total_vat) ? price2num($object->total_vat) : price2num($object->total_tva)), // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 716 | + $array_key.'_total_vat' => (!empty($object->total_vat) ? price2num($object->total_vat) : price2num($object->total_tva)), // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 717 | 717 | $array_key.'_total_localtax1' => price2num($object->total_localtax1), |
| 718 | 718 | $array_key.'_total_localtax2' => price2num($object->total_localtax2), |
| 719 | 719 | $array_key.'_total_ttc' => price2num($object->total_ttc), |
@@ -1691,7 +1691,7 @@ discard block |
||
| 1691 | 1691 | * @param stdClass $b |
| 1692 | 1692 | * @return int<-1,1> |
| 1693 | 1693 | */ |
| 1694 | - static function ($a, $b) { |
|
| 1694 | + static function($a, $b) { |
|
| 1695 | 1695 | return ($a->rank > $b->rank) ? 1 : -1; |
| 1696 | 1696 | } |
| 1697 | 1697 | ); |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | $help_url = ''; |
| 91 | 91 | |
| 92 | 92 | // URL http://mydolibarr/core/search_page?dol_use_jmobile=1 can be used for tests |
| 93 | -$head = '<!-- Upload file -->'."\n"; // This is used by DoliDroid to know page is a search page |
|
| 93 | +$head = '<!-- Upload file -->'."\n"; // This is used by DoliDroid to know page is a search page |
|
| 94 | 94 | $arrayofjs = array(); |
| 95 | 95 | $arrayofcss = array(); |
| 96 | 96 | |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | |
| 641 | 641 | if (is_array($cpt)) { |
| 642 | 642 | foreach ($cpt as $cptcursor) { |
| 643 | - if (! is_null($cptcursor)) { |
|
| 643 | + if (!is_null($cptcursor)) { |
|
| 644 | 644 | if ($listofaccount) { |
| 645 | 645 | $listofaccount .= ","; |
| 646 | 646 | } |
@@ -789,7 +789,7 @@ discard block |
||
| 789 | 789 | |
| 790 | 790 | $sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type, c.sens"; |
| 791 | 791 | $sql .= " FROM ".$this->db->prefix().$this->table_element." as c"; |
| 792 | - $sql .= " WHERE c.active = " . (int) $active; |
|
| 792 | + $sql .= " WHERE c.active = ".(int) $active; |
|
| 793 | 793 | $sql .= " AND c.entity = ".$conf->entity; |
| 794 | 794 | if ($categorytype >= 0) { |
| 795 | 795 | $sql .= " AND c.category_type = 1"; |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | // Put here code to add control on parameters values |
| 277 | 277 | |
| 278 | 278 | // Insert request |
| 279 | - $sql = "INSERT INTO " . $this->db->prefix() . $this->table_element . " ("; |
|
| 279 | + $sql = "INSERT INTO ".$this->db->prefix().$this->table_element." ("; |
|
| 280 | 280 | $sql .= "datec"; |
| 281 | 281 | $sql .= ", entity"; |
| 282 | 282 | $sql .= ", fk_pcg_version"; |
@@ -310,11 +310,11 @@ discard block |
||
| 310 | 310 | $resql = $this->db->query($sql); |
| 311 | 311 | if (!$resql) { |
| 312 | 312 | $error++; |
| 313 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
| 313 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | if (!$error) { |
| 317 | - $this->id = $this->db->last_insert_id($this->db->prefix() . $this->table_element); |
|
| 317 | + $this->id = $this->db->last_insert_id($this->db->prefix().$this->table_element); |
|
| 318 | 318 | |
| 319 | 319 | // Uncomment this and change MYOBJECT to your own tag if you |
| 320 | 320 | // want this action to call a trigger. |
@@ -330,8 +330,8 @@ discard block |
||
| 330 | 330 | // Commit or rollback |
| 331 | 331 | if ($error) { |
| 332 | 332 | foreach ($this->errors as $errmsg) { |
| 333 | - dol_syslog(get_class($this) . "::create " . $errmsg, LOG_ERR); |
|
| 334 | - $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); |
|
| 333 | + dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); |
|
| 334 | + $this->error .= ($this->error ? ', '.$errmsg : $errmsg); |
|
| 335 | 335 | } |
| 336 | 336 | $this->db->rollback(); |
| 337 | 337 | return -1 * $error; |
@@ -356,18 +356,18 @@ discard block |
||
| 356 | 356 | |
| 357 | 357 | $this->db->begin(); |
| 358 | 358 | |
| 359 | - $sql = "UPDATE " . $this->db->prefix() . $this->table_element; |
|
| 360 | - $sql .= " SET fk_pcg_version = " . ($this->fk_pcg_version ? "'" . $this->db->escape($this->fk_pcg_version) . "'" : "null"); |
|
| 361 | - $sql .= " , pcg_type = " . ($this->pcg_type ? "'" . $this->db->escape($this->pcg_type) . "'" : "null"); |
|
| 362 | - $sql .= " , account_number = '" . $this->db->escape($this->account_number) . "'"; |
|
| 363 | - $sql .= " , account_parent = " . (int) $this->account_parent; |
|
| 364 | - $sql .= " , label = " . ($this->label ? "'" . $this->db->escape($this->label) . "'" : "''"); |
|
| 365 | - $sql .= " , labelshort = " . ($this->labelshort ? "'" . $this->db->escape($this->labelshort) . "'" : "''"); |
|
| 366 | - $sql .= " , fk_accounting_category = " . (empty($this->account_category) ? 0 : (int) $this->account_category); |
|
| 367 | - $sql .= " , fk_user_modif = " . ((int) $user->id); |
|
| 368 | - $sql .= " , active = " . (int) $this->active; |
|
| 369 | - $sql .= " , reconcilable = " . (int) $this->reconcilable; |
|
| 370 | - $sql .= " WHERE rowid = " . ((int) $this->id); |
|
| 359 | + $sql = "UPDATE ".$this->db->prefix().$this->table_element; |
|
| 360 | + $sql .= " SET fk_pcg_version = ".($this->fk_pcg_version ? "'".$this->db->escape($this->fk_pcg_version)."'" : "null"); |
|
| 361 | + $sql .= " , pcg_type = ".($this->pcg_type ? "'".$this->db->escape($this->pcg_type)."'" : "null"); |
|
| 362 | + $sql .= " , account_number = '".$this->db->escape($this->account_number)."'"; |
|
| 363 | + $sql .= " , account_parent = ".(int) $this->account_parent; |
|
| 364 | + $sql .= " , label = ".($this->label ? "'".$this->db->escape($this->label)."'" : "''"); |
|
| 365 | + $sql .= " , labelshort = ".($this->labelshort ? "'".$this->db->escape($this->labelshort)."'" : "''"); |
|
| 366 | + $sql .= " , fk_accounting_category = ".(empty($this->account_category) ? 0 : (int) $this->account_category); |
|
| 367 | + $sql .= " , fk_user_modif = ".((int) $user->id); |
|
| 368 | + $sql .= " , active = ".(int) $this->active; |
|
| 369 | + $sql .= " , reconcilable = ".(int) $this->reconcilable; |
|
| 370 | + $sql .= " WHERE rowid = ".((int) $this->id); |
|
| 371 | 371 | |
| 372 | 372 | dol_syslog(get_class($this)."::update", LOG_DEBUG); |
| 373 | 373 | $result = $this->db->query($sql); |
@@ -437,22 +437,22 @@ discard block |
||
| 437 | 437 | $this->db->begin(); |
| 438 | 438 | |
| 439 | 439 | if (!$error) { |
| 440 | - $sql = "DELETE FROM " . $this->db->prefix() . $this->table_element; |
|
| 441 | - $sql .= " WHERE rowid=" . ((int) $this->id); |
|
| 440 | + $sql = "DELETE FROM ".$this->db->prefix().$this->table_element; |
|
| 441 | + $sql .= " WHERE rowid=".((int) $this->id); |
|
| 442 | 442 | |
| 443 | - dol_syslog(get_class($this) . "::delete sql=" . $sql); |
|
| 443 | + dol_syslog(get_class($this)."::delete sql=".$sql); |
|
| 444 | 444 | $resql = $this->db->query($sql); |
| 445 | 445 | if (!$resql) { |
| 446 | 446 | $error++; |
| 447 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
| 447 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
| 448 | 448 | } |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | // Commit or rollback |
| 452 | 452 | if ($error) { |
| 453 | 453 | foreach ($this->errors as $errmsg) { |
| 454 | - dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR); |
|
| 455 | - $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); |
|
| 454 | + dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); |
|
| 455 | + $this->error .= ($this->error ? ', '.$errmsg : $errmsg); |
|
| 456 | 456 | } |
| 457 | 457 | $this->db->rollback(); |
| 458 | 458 | return -1 * $error; |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0, $option = '') |
| 482 | 482 | { |
| 483 | 483 | global $langs, $conf, $hookmanager; |
| 484 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; |
|
| 484 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; |
|
| 485 | 485 | |
| 486 | 486 | if (!empty($conf->dol_no_mouse_hover)) { |
| 487 | 487 | $notooltip = 1; // Force disable tooltips |
@@ -492,13 +492,13 @@ discard block |
||
| 492 | 492 | $url = ''; |
| 493 | 493 | $labelurl = ''; |
| 494 | 494 | if (empty($option) || $option == 'ledger') { |
| 495 | - $url = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . urlencode((isset($this->account_number) ? $this->account_number : '')) . '&search_accountancy_code_end=' . urlencode((isset($this->account_number) ? $this->account_number : '')); |
|
| 495 | + $url = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start='.urlencode((isset($this->account_number) ? $this->account_number : '')).'&search_accountancy_code_end='.urlencode((isset($this->account_number) ? $this->account_number : '')); |
|
| 496 | 496 | $labelurl = $langs->trans("ShowAccountingAccountInLedger"); |
| 497 | 497 | } elseif ($option == 'journals') { |
| 498 | - $url = DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?search_accountancy_code_start=' . urlencode($this->account_number) . '&search_accountancy_code_end=' . urlencode($this->account_number); |
|
| 498 | + $url = DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number); |
|
| 499 | 499 | $labelurl = $langs->trans("ShowAccountingAccountInJournals"); |
| 500 | 500 | } elseif ($option == 'accountcard') { |
| 501 | - $url = DOL_URL_ROOT . '/accountancy/admin/card.php?id=' . urlencode((string) ($this->id)); |
|
| 501 | + $url = DOL_URL_ROOT.'/accountancy/admin/card.php?id='.urlencode((string) ($this->id)); |
|
| 502 | 502 | $labelurl = $langs->trans("ShowAccountingAccount"); |
| 503 | 503 | } |
| 504 | 504 | |
@@ -520,29 +520,29 @@ discard block |
||
| 520 | 520 | $labeltoshow = $this->labelshort; |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | - $label = '<u>' . $labelurl . '</u>'; |
|
| 523 | + $label = '<u>'.$labelurl.'</u>'; |
|
| 524 | 524 | if (!empty($this->account_number)) { |
| 525 | - $label .= '<br><b>' . $langs->trans('AccountAccounting') . ':</b> ' . length_accountg($this->account_number); |
|
| 525 | + $label .= '<br><b>'.$langs->trans('AccountAccounting').':</b> '.length_accountg($this->account_number); |
|
| 526 | 526 | } |
| 527 | 527 | if (!empty($labeltoshow)) { |
| 528 | - $label .= '<br><b>' . $langs->trans('Label') . ':</b> ' . $labeltoshow; |
|
| 528 | + $label .= '<br><b>'.$langs->trans('Label').':</b> '.$labeltoshow; |
|
| 529 | 529 | } |
| 530 | 530 | if ($moretitle) { |
| 531 | - $label .= ' - ' . $moretitle; |
|
| 531 | + $label .= ' - '.$moretitle; |
|
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | $linkclose = ''; |
| 535 | 535 | if (empty($notooltip)) { |
| 536 | 536 | if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
| 537 | 537 | $label = $labelurl; |
| 538 | - $linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"'; |
|
| 538 | + $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
|
| 539 | 539 | } |
| 540 | - $linkclose .= ' title="' . dol_escape_htmltag($label, 1) . '"'; |
|
| 540 | + $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; |
|
| 541 | 541 | $linkclose .= ' class="classfortooltip"'; |
| 542 | 542 | } |
| 543 | 543 | |
| 544 | - $linkstart = '<a href="' . $url . '"'; |
|
| 545 | - $linkstart .= $linkclose . '>'; |
|
| 544 | + $linkstart = '<a href="'.$url.'"'; |
|
| 545 | + $linkstart .= $linkclose.'>'; |
|
| 546 | 546 | $linkend = '</a>'; |
| 547 | 547 | |
| 548 | 548 | if ($nourl) { |
@@ -553,20 +553,20 @@ discard block |
||
| 553 | 553 | |
| 554 | 554 | $label_link = length_accountg($this->account_number); |
| 555 | 555 | if ($withlabel) { |
| 556 | - $label_link .= ' - ' . ($nourl ? '<span class="opacitymedium">' : '') . $labeltoshow . ($nourl ? '</span>' : ''); |
|
| 556 | + $label_link .= ' - '.($nourl ? '<span class="opacitymedium">' : '').$labeltoshow.($nourl ? '</span>' : ''); |
|
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | if ($withpicto) { |
| 560 | - $result .= ($linkstart . img_object(($notooltip ? '' : $label), $picto, ($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1) . $linkend); |
|
| 560 | + $result .= ($linkstart.img_object(($notooltip ? '' : $label), $picto, ($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1).$linkend); |
|
| 561 | 561 | } |
| 562 | 562 | if ($withpicto && $withpicto != 2) { |
| 563 | 563 | $result .= ' '; |
| 564 | 564 | } |
| 565 | 565 | if ($withpicto != 2) { |
| 566 | - $result .= $linkstart . $label_link . $linkend; |
|
| 566 | + $result .= $linkstart.$label_link.$linkend; |
|
| 567 | 567 | } |
| 568 | 568 | global $action; |
| 569 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
| 569 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
| 570 | 570 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
| 571 | 571 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 572 | 572 | if ($reshook > 0) { |
@@ -586,10 +586,10 @@ discard block |
||
| 586 | 586 | public function info($id) |
| 587 | 587 | { |
| 588 | 588 | $sql = 'SELECT a.rowid, a.datec, a.fk_user_author, a.fk_user_modif, a.tms as date_modification'; |
| 589 | - $sql .= ' FROM ' . $this->db->prefix() . $this->table_element . ' as a'; |
|
| 590 | - $sql .= ' WHERE a.rowid = ' . ((int) $id); |
|
| 589 | + $sql .= ' FROM '.$this->db->prefix().$this->table_element.' as a'; |
|
| 590 | + $sql .= ' WHERE a.rowid = '.((int) $id); |
|
| 591 | 591 | |
| 592 | - dol_syslog(get_class($this) . '::info sql=' . $sql); |
|
| 592 | + dol_syslog(get_class($this).'::info sql='.$sql); |
|
| 593 | 593 | $resql = $this->db->query($sql); |
| 594 | 594 | |
| 595 | 595 | if ($resql) { |
@@ -742,10 +742,10 @@ discard block |
||
| 742 | 742 | $hookmanager->initHooks(array('accountancyBindingCalculation')); |
| 743 | 743 | |
| 744 | 744 | // Execute hook accountancyBindingCalculation |
| 745 | - $parameters = array('buyer' => $buyer, 'seller' => $seller, 'product' => $product, 'facture' => $facture, 'factureDet' => $factureDet ,'accountingAccount' => $accountingAccount, 0 => $type); |
|
| 745 | + $parameters = array('buyer' => $buyer, 'seller' => $seller, 'product' => $product, 'facture' => $facture, 'factureDet' => $factureDet, 'accountingAccount' => $accountingAccount, 0 => $type); |
|
| 746 | 746 | $reshook = $hookmanager->executeHooks('accountancyBindingCalculation', $parameters); // Note that $action and $object may have been modified by some hooks |
| 747 | 747 | |
| 748 | - $result = -1; // Init for static analysis |
|
| 748 | + $result = -1; // Init for static analysis |
|
| 749 | 749 | if (empty($reshook)) { |
| 750 | 750 | $const_name = ''; |
| 751 | 751 | if ($type == 'customer') { |
@@ -754,50 +754,50 @@ discard block |
||
| 754 | 754 | $const_name = "BUY"; |
| 755 | 755 | } |
| 756 | 756 | |
| 757 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 757 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 758 | 758 | $isBuyerInEEC = isInEEC($buyer); |
| 759 | 759 | $isSellerInEEC = isInEEC($seller); |
| 760 | - $code_l = ''; // Default value for generic product/service |
|
| 761 | - $code_p = ''; // Value for the product/service in parameter ($product) |
|
| 762 | - $code_t = ''; // Default value of product account for the thirdparty |
|
| 760 | + $code_l = ''; // Default value for generic product/service |
|
| 761 | + $code_p = ''; // Value for the product/service in parameter ($product) |
|
| 762 | + $code_t = ''; // Default value of product account for the thirdparty |
|
| 763 | 763 | $suggestedid = ''; |
| 764 | 764 | |
| 765 | 765 | // Level 1 (define $code_l): Search suggested default account for product/service |
| 766 | 766 | $suggestedaccountingaccountbydefaultfor = ''; |
| 767 | 767 | if ($factureDet->product_type == 1) { |
| 768 | 768 | if ($buyer->country_code == $seller->country_code || empty($buyer->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) |
| 769 | - $code_l = getDolGlobalString('ACCOUNTING_SERVICE_' . $const_name . '_ACCOUNT'); |
|
| 769 | + $code_l = getDolGlobalString('ACCOUNTING_SERVICE_'.$const_name.'_ACCOUNT'); |
|
| 770 | 770 | $suggestedaccountingaccountbydefaultfor = ''; |
| 771 | 771 | } else { |
| 772 | 772 | if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0) { // European intravat sale, but with a VAT |
| 773 | - $code_l = getDolGlobalString('ACCOUNTING_SERVICE_' . $const_name . '_ACCOUNT'); |
|
| 773 | + $code_l = getDolGlobalString('ACCOUNTING_SERVICE_'.$const_name.'_ACCOUNT'); |
|
| 774 | 774 | } elseif ($isSellerInEEC && $isBuyerInEEC && empty($buyer->tva_intra)) { // European intravat sale, without VAT intra community number |
| 775 | - $code_l = getDolGlobalString('ACCOUNTING_SERVICE_' . $const_name . '_ACCOUNT'); |
|
| 775 | + $code_l = getDolGlobalString('ACCOUNTING_SERVICE_'.$const_name.'_ACCOUNT'); |
|
| 776 | 776 | $suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber'; |
| 777 | 777 | } elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale |
| 778 | - $code_l = getDolGlobalString('ACCOUNTING_SERVICE_' . $const_name . '_INTRA_ACCOUNT'); |
|
| 778 | + $code_l = getDolGlobalString('ACCOUNTING_SERVICE_'.$const_name.'_INTRA_ACCOUNT'); |
|
| 779 | 779 | $suggestedaccountingaccountbydefaultfor = 'eec'; |
| 780 | 780 | } else { // Foreign sale |
| 781 | - $code_l = getDolGlobalString('ACCOUNTING_SERVICE_' . $const_name . '_EXPORT_ACCOUNT'); |
|
| 781 | + $code_l = getDolGlobalString('ACCOUNTING_SERVICE_'.$const_name.'_EXPORT_ACCOUNT'); |
|
| 782 | 782 | $suggestedaccountingaccountbydefaultfor = 'export'; |
| 783 | 783 | } |
| 784 | 784 | } |
| 785 | 785 | } elseif ($factureDet->product_type == 0) { |
| 786 | 786 | if ($buyer->country_code == $seller->country_code || empty($buyer->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) |
| 787 | - $code_l = getDolGlobalString('ACCOUNTING_PRODUCT_' . $const_name . '_ACCOUNT'); |
|
| 787 | + $code_l = getDolGlobalString('ACCOUNTING_PRODUCT_'.$const_name.'_ACCOUNT'); |
|
| 788 | 788 | $suggestedaccountingaccountbydefaultfor = ''; |
| 789 | 789 | } else { |
| 790 | 790 | if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0) { // European intravat sale, but with a VAT |
| 791 | - $code_l = getDolGlobalString('ACCOUNTING_PRODUCT_' . $const_name . '_ACCOUNT'); |
|
| 791 | + $code_l = getDolGlobalString('ACCOUNTING_PRODUCT_'.$const_name.'_ACCOUNT'); |
|
| 792 | 792 | $suggestedaccountingaccountbydefaultfor = 'eecwithvat'; |
| 793 | 793 | } elseif ($isSellerInEEC && $isBuyerInEEC && empty($buyer->tva_intra)) { // European intravat sale, without VAT intra community number |
| 794 | - $code_l = getDolGlobalString('ACCOUNTING_PRODUCT_' . $const_name . '_ACCOUNT'); |
|
| 794 | + $code_l = getDolGlobalString('ACCOUNTING_PRODUCT_'.$const_name.'_ACCOUNT'); |
|
| 795 | 795 | $suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber'; |
| 796 | 796 | } elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale |
| 797 | - $code_l = getDolGlobalString('ACCOUNTING_PRODUCT_' . $const_name . '_INTRA_ACCOUNT'); |
|
| 797 | + $code_l = getDolGlobalString('ACCOUNTING_PRODUCT_'.$const_name.'_INTRA_ACCOUNT'); |
|
| 798 | 798 | $suggestedaccountingaccountbydefaultfor = 'eec'; |
| 799 | 799 | } else { |
| 800 | - $code_l = getDolGlobalString('ACCOUNTING_PRODUCT_' . $const_name . '_EXPORT_ACCOUNT'); |
|
| 800 | + $code_l = getDolGlobalString('ACCOUNTING_PRODUCT_'.$const_name.'_EXPORT_ACCOUNT'); |
|
| 801 | 801 | $suggestedaccountingaccountbydefaultfor = 'export'; |
| 802 | 802 | } |
| 803 | 803 | } |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | } |
| 872 | 872 | |
| 873 | 873 | // Manage Deposit |
| 874 | - if (getDolGlobalString('ACCOUNTING_ACCOUNT_' . strtoupper($type) . '_DEPOSIT')) { |
|
| 874 | + if (getDolGlobalString('ACCOUNTING_ACCOUNT_'.strtoupper($type).'_DEPOSIT')) { |
|
| 875 | 875 | if ($factureDet->desc == "(DEPOSIT)" || $facture->type == $facture::TYPE_DEPOSIT) { |
| 876 | 876 | $accountdeposittoventilated = new self($this->db); |
| 877 | 877 | if ($type == 'customer') { |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | if (empty($this->piece_num)) { |
| 369 | 369 | $sqlnum = "SELECT MAX(piece_num)+1 as maxpiecenum"; |
| 370 | 370 | $sqlnum .= " FROM ".$this->db->prefix().$this->table_element; |
| 371 | - $sqlnum .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 371 | + $sqlnum .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 372 | 372 | |
| 373 | 373 | $resqlnum = $this->db->query($sqlnum); |
| 374 | 374 | if ($resqlnum) { |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | // Call triggers |
| 467 | - if (! $error && ! $notrigger) { |
|
| 467 | + if (!$error && !$notrigger) { |
|
| 468 | 468 | $result = $this->call_trigger('BOOKKEEPING_CREATE', $user); |
| 469 | 469 | if ($result < 0) { |
| 470 | 470 | $error++; |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); |
| 549 | 549 | |
| 550 | 550 | global $action; |
| 551 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
| 551 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
| 552 | 552 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
| 553 | 553 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 554 | 554 | if ($reshook > 0) { |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | if (!$error) { |
| 716 | 716 | $this->id = $this->db->last_insert_id($this->db->prefix().$this->table_element.$mode); |
| 717 | 717 | // Call triggers |
| 718 | - if (! $notrigger) { |
|
| 718 | + if (!$notrigger) { |
|
| 719 | 719 | $result = $this->call_trigger('BOOKKEEPING_CREATE', $user); |
| 720 | 720 | if ($result < 0) { |
| 721 | 721 | $error++; |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | $sql .= " t.date_validated as date_validation"; |
| 781 | 781 | $sql .= ' FROM '.$this->db->prefix().$this->table_element.$mode.' as t'; |
| 782 | 782 | $sql .= ' WHERE 1 = 1'; |
| 783 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 783 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 784 | 784 | if (null !== $ref) { |
| 785 | 785 | $sql .= " AND t.rowid = ".((int) $ref); |
| 786 | 786 | } else { |
@@ -952,7 +952,7 @@ discard block |
||
| 952 | 952 | } |
| 953 | 953 | } |
| 954 | 954 | $sql .= ' FROM '.$this->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(" ".$this->db->sanitize($filtermode)." ", $sqlwhere); |
| 958 | 958 | } |
@@ -1087,7 +1087,7 @@ discard block |
||
| 1087 | 1087 | $sql .= " t.date_validated as date_validation"; |
| 1088 | 1088 | $sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t'; |
| 1089 | 1089 | |
| 1090 | - $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1090 | + $sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1091 | 1091 | if ($showAlreadyExportMovements == 0) { |
| 1092 | 1092 | $sql .= " AND t.date_export IS NULL"; |
| 1093 | 1093 | } |
@@ -1255,7 +1255,7 @@ discard block |
||
| 1255 | 1255 | $sql .= " SUM(t.debit) as debit,"; |
| 1256 | 1256 | $sql .= " SUM(t.credit) as credit"; |
| 1257 | 1257 | $sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t'; |
| 1258 | - $sql .= ' WHERE entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1258 | + $sql .= ' WHERE entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1259 | 1259 | |
| 1260 | 1260 | // Manage filter |
| 1261 | 1261 | if (is_array($filter)) { |
@@ -1483,7 +1483,7 @@ discard block |
||
| 1483 | 1483 | } |
| 1484 | 1484 | |
| 1485 | 1485 | // Call triggers |
| 1486 | - if (! $error && ! $notrigger) { |
|
| 1486 | + if (!$error && !$notrigger) { |
|
| 1487 | 1487 | $result = $this->call_trigger('BOOKKEEPING_MODIFY', $user); |
| 1488 | 1488 | if ($result < 0) { |
| 1489 | 1489 | $error++; |
@@ -1576,7 +1576,7 @@ discard block |
||
| 1576 | 1576 | $this->db->begin(); |
| 1577 | 1577 | |
| 1578 | 1578 | // Call triggers |
| 1579 | - if (! $error && ! $notrigger) { |
|
| 1579 | + if (!$error && !$notrigger) { |
|
| 1580 | 1580 | $result = $this->call_trigger('BOOKKEEPING_DELETE', $user); |
| 1581 | 1581 | if ($result < 0) { |
| 1582 | 1582 | $error++; |
@@ -1679,7 +1679,7 @@ discard block |
||
| 1679 | 1679 | if (!empty($journal)) { |
| 1680 | 1680 | $sql .= " AND code_journal = '".$this->db->escape($journal)."'"; |
| 1681 | 1681 | } |
| 1682 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1682 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1683 | 1683 | // Exclusion of validated entries at the time of deletion |
| 1684 | 1684 | $sql .= " AND date_validated IS NULL"; |
| 1685 | 1685 | $sql .= $sql_filter; |
@@ -1726,8 +1726,8 @@ discard block |
||
| 1726 | 1726 | $sql = "DELETE"; |
| 1727 | 1727 | $sql .= " FROM ".$this->db->prefix().$this->table_element.$mode; |
| 1728 | 1728 | $sql .= " WHERE piece_num = ".(int) $piecenum; |
| 1729 | - $sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion |
|
| 1730 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1729 | + $sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion |
|
| 1730 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1731 | 1731 | $sql .= $sql_filter; |
| 1732 | 1732 | |
| 1733 | 1733 | $resql = $this->db->query($sql); |
@@ -1855,7 +1855,7 @@ discard block |
||
| 1855 | 1855 | } |
| 1856 | 1856 | $sql .= " FROM ".$this->db->prefix().$this->table_element.$mode; |
| 1857 | 1857 | $sql .= " WHERE piece_num = ".((int) $piecenum); |
| 1858 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1858 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1859 | 1859 | |
| 1860 | 1860 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 1861 | 1861 | $result = $this->db->query($sql); |
@@ -1896,7 +1896,7 @@ discard block |
||
| 1896 | 1896 | global $conf; |
| 1897 | 1897 | |
| 1898 | 1898 | $sql = "SELECT MAX(piece_num)+1 as max FROM ".$this->db->prefix().$this->table_element.$mode; |
| 1899 | - $sql .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1899 | + $sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1900 | 1900 | |
| 1901 | 1901 | dol_syslog(get_class($this)."::getNextNumMvt", LOG_DEBUG); |
| 1902 | 1902 | |
@@ -1940,7 +1940,7 @@ discard block |
||
| 1940 | 1940 | } |
| 1941 | 1941 | $sql .= " FROM ".$this->db->prefix().$this->table_element.$mode; |
| 1942 | 1942 | $sql .= " WHERE piece_num = ".((int) $piecenum); |
| 1943 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1943 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 1944 | 1944 | |
| 1945 | 1945 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 1946 | 1946 | $result = $this->db->query($sql); |
@@ -2005,7 +2005,7 @@ discard block |
||
| 2005 | 2005 | $sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num,"; |
| 2006 | 2006 | $sql .= " date_validated as date_validation"; |
| 2007 | 2007 | $sql .= " FROM ".$this->db->prefix().$this->table_element; |
| 2008 | - $sql .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2008 | + $sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2009 | 2009 | |
| 2010 | 2010 | dol_syslog(get_class($this)."::export_bookkeeping", LOG_DEBUG); |
| 2011 | 2011 | |
@@ -2083,7 +2083,7 @@ discard block |
||
| 2083 | 2083 | |
| 2084 | 2084 | if (!$error) { |
| 2085 | 2085 | // Delete if there is an empty line |
| 2086 | - $sql = 'DELETE FROM '.$this->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"; |
|
| 2086 | + $sql = 'DELETE FROM '.$this->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"; |
|
| 2087 | 2087 | $resql = $this->db->query($sql); |
| 2088 | 2088 | if (!$resql) { |
| 2089 | 2089 | $error++; |
@@ -2101,7 +2101,7 @@ discard block |
||
| 2101 | 2101 | $sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,'; |
| 2102 | 2102 | $sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; |
| 2103 | 2103 | $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, '.((int) $next_piecenum).", '".$this->db->idate($now)."'"; |
| 2104 | - $sql .= ' FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND numero_compte IS NOT NULL AND entity = ' .((int) $conf->entity); |
|
| 2104 | + $sql .= ' FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND numero_compte IS NOT NULL AND entity = '.((int) $conf->entity); |
|
| 2105 | 2105 | $sql .= $sql_filter; |
| 2106 | 2106 | $resql = $this->db->query($sql); |
| 2107 | 2107 | if (!$resql) { |
@@ -2112,7 +2112,7 @@ discard block |
||
| 2112 | 2112 | } |
| 2113 | 2113 | |
| 2114 | 2114 | if (!$error) { |
| 2115 | - $sql = 'DELETE FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); |
|
| 2115 | + $sql = 'DELETE FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity); |
|
| 2116 | 2116 | $resql = $this->db->query($sql); |
| 2117 | 2117 | if (!$resql) { |
| 2118 | 2118 | $error++; |
@@ -2122,7 +2122,7 @@ discard block |
||
| 2122 | 2122 | } |
| 2123 | 2123 | } elseif ($direction == 1) { |
| 2124 | 2124 | if (!$error) { |
| 2125 | - $sql = 'DELETE FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); |
|
| 2125 | + $sql = 'DELETE FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity); |
|
| 2126 | 2126 | $resql = $this->db->query($sql); |
| 2127 | 2127 | if (!$resql) { |
| 2128 | 2128 | $error++; |
@@ -2140,7 +2140,7 @@ discard block |
||
| 2140 | 2140 | $sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,'; |
| 2141 | 2141 | $sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; |
| 2142 | 2142 | $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num'; |
| 2143 | - $sql .= ' FROM '.$this->db->prefix().$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); |
|
| 2143 | + $sql .= ' FROM '.$this->db->prefix().$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity); |
|
| 2144 | 2144 | $sql .= $sql_filter; |
| 2145 | 2145 | $resql = $this->db->query($sql); |
| 2146 | 2146 | if (!$resql) { |
@@ -2151,7 +2151,7 @@ discard block |
||
| 2151 | 2151 | } |
| 2152 | 2152 | |
| 2153 | 2153 | if (!$error) { |
| 2154 | - $sql = 'DELETE FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); |
|
| 2154 | + $sql = 'DELETE FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity); |
|
| 2155 | 2155 | $sql .= $sql_filter; |
| 2156 | 2156 | $resql = $this->db->query($sql); |
| 2157 | 2157 | if (!$resql) { |
@@ -2208,7 +2208,7 @@ discard block |
||
| 2208 | 2208 | $sql .= " AND aa.active = 1"; |
| 2209 | 2209 | $sql .= " INNER JOIN ".$this->db->prefix()."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; |
| 2210 | 2210 | $sql .= " AND asy.rowid = ".((int) $pcgver); |
| 2211 | - $sql .= " AND ab.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2211 | + $sql .= " AND ab.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2212 | 2212 | $sql .= " ORDER BY account_number ASC"; |
| 2213 | 2213 | |
| 2214 | 2214 | dol_syslog(get_class($this)."::select_account", LOG_DEBUG); |
@@ -2272,7 +2272,7 @@ discard block |
||
| 2272 | 2272 | $sql .= " LEFT JOIN ".$this->db->prefix()."accounting_account as parent ON aa.account_parent = parent.rowid AND parent.active = 1"; |
| 2273 | 2273 | $sql .= " LEFT JOIN ".$this->db->prefix()."accounting_account as root ON parent.account_parent = root.rowid AND root.active = 1"; |
| 2274 | 2274 | $sql .= " WHERE aa.account_number = '".$this->db->escape($account)."'"; |
| 2275 | - $sql .= " AND aa.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2275 | + $sql .= " AND aa.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2276 | 2276 | |
| 2277 | 2277 | dol_syslog(get_class($this)."::select_account", LOG_DEBUG); |
| 2278 | 2278 | $resql = $this->db->query($sql); |
@@ -2312,7 +2312,7 @@ discard block |
||
| 2312 | 2312 | $sql .= " AND asy.rowid = ".((int) $pcgver); |
| 2313 | 2313 | $sql .= " AND aa.active = 1"; |
| 2314 | 2314 | $sql .= " LEFT JOIN ".$this->db->prefix()."c_accounting_category as cat ON aa.fk_accounting_category = cat.rowid"; |
| 2315 | - $sql .= " WHERE aa.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2315 | + $sql .= " WHERE aa.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2316 | 2316 | |
| 2317 | 2317 | dol_syslog(get_class($this)."::select_account", LOG_DEBUG); |
| 2318 | 2318 | $resql = $this->db->query($sql); |
@@ -2345,7 +2345,7 @@ discard block |
||
| 2345 | 2345 | global $conf; |
| 2346 | 2346 | |
| 2347 | 2347 | $alias = trim($alias); |
| 2348 | - $alias = !empty($alias) && strpos($alias, '.') === false ? $alias . "." : $alias; |
|
| 2348 | + $alias = !empty($alias) && strpos($alias, '.') === false ? $alias."." : $alias; |
|
| 2349 | 2349 | |
| 2350 | 2350 | if (!isset(self::$can_modify_bookkeeping_sql_cached[$alias]) || $force) { |
| 2351 | 2351 | $result = $this->loadFiscalPeriods($force, 'active'); |
@@ -2358,10 +2358,10 @@ discard block |
||
| 2358 | 2358 | $i = 0; |
| 2359 | 2359 | foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) { |
| 2360 | 2360 | $sql_list[$i] = "("; |
| 2361 | - $sql_list[$i] .= "'".$this->db->idate($fiscal_period['date_start']) . "' <= ".$this->db->sanitize($alias)."doc_date"; |
|
| 2361 | + $sql_list[$i] .= "'".$this->db->idate($fiscal_period['date_start'])."' <= ".$this->db->sanitize($alias)."doc_date"; |
|
| 2362 | 2362 | if (!empty($fiscal_period['date_end'])) { |
| 2363 | 2363 | $sql_list[$i] .= " AND "; |
| 2364 | - $sql_list[$i] .= $this->db->sanitize($alias)."doc_date <= '" . $this->db->idate($fiscal_period['date_end'])."'"; |
|
| 2364 | + $sql_list[$i] .= $this->db->sanitize($alias)."doc_date <= '".$this->db->idate($fiscal_period['date_end'])."'"; |
|
| 2365 | 2365 | } |
| 2366 | 2366 | $sql_list[$i] .= ")"; |
| 2367 | 2367 | $i++; |
@@ -2450,17 +2450,17 @@ discard block |
||
| 2450 | 2450 | // Avoid trunc with dot in accountancy for the compatibility with another accounting software |
| 2451 | 2451 | $accountingLabelOperation = dol_trunc($thirdpartyname, $truncThirdpartyName, 'right', 'UTF-8', 1); |
| 2452 | 2452 | if (!empty($reference)) { |
| 2453 | - $accountingLabelOperation .= ' - '. $reference; |
|
| 2453 | + $accountingLabelOperation .= ' - '.$reference; |
|
| 2454 | 2454 | } |
| 2455 | 2455 | if (!empty($labelaccount)) { |
| 2456 | - $accountingLabelOperation .= ' - '. $labelaccount; |
|
| 2456 | + $accountingLabelOperation .= ' - '.$labelaccount; |
|
| 2457 | 2457 | } |
| 2458 | 2458 | } elseif (getDolGlobalString('ACCOUNTING_LABEL_OPERATION_ON_TRANSFER') == 1) { |
| 2459 | 2459 | $truncThirdpartyName = 32; |
| 2460 | 2460 | // Avoid trunc with dot in accountancy for the compatibility with another accounting software |
| 2461 | 2461 | $accountingLabelOperation = dol_trunc($thirdpartyname, $truncThirdpartyName, 'right', 'UTF-8', 1); |
| 2462 | 2462 | if (!empty($reference)) { |
| 2463 | - $accountingLabelOperation .= ' - '. $reference; |
|
| 2463 | + $accountingLabelOperation .= ' - '.$reference; |
|
| 2464 | 2464 | } |
| 2465 | 2465 | } elseif (getDolGlobalString('ACCOUNTING_LABEL_OPERATION_ON_TRANSFER') == 2) { |
| 2466 | 2466 | $truncThirdpartyName = 64; |
@@ -2530,8 +2530,8 @@ discard block |
||
| 2530 | 2530 | if ($mode == 'active') { |
| 2531 | 2531 | if (!isset($conf->cache['active_fiscal_period_cached']) || $force) { |
| 2532 | 2532 | $sql = "SELECT date_start, date_end"; |
| 2533 | - $sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear"; |
|
| 2534 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
| 2533 | + $sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear"; |
|
| 2534 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
| 2535 | 2535 | $sql .= " AND statut = 0"; |
| 2536 | 2536 | |
| 2537 | 2537 | $resql = $this->db->query($sql); |
@@ -2553,8 +2553,8 @@ discard block |
||
| 2553 | 2553 | if ($mode == 'closed') { |
| 2554 | 2554 | if (!isset($conf->cache['closed_fiscal_period_cached']) || $force) { |
| 2555 | 2555 | $sql = "SELECT date_start, date_end"; |
| 2556 | - $sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear"; |
|
| 2557 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
| 2556 | + $sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear"; |
|
| 2557 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
| 2558 | 2558 | $sql .= " AND statut = 1"; |
| 2559 | 2559 | |
| 2560 | 2560 | $resql = $this->db->query($sql); |
@@ -2589,10 +2589,10 @@ discard block |
||
| 2589 | 2589 | $list = array(); |
| 2590 | 2590 | |
| 2591 | 2591 | $sql = "SELECT rowid, label, date_start, date_end, statut"; |
| 2592 | - $sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear"; |
|
| 2593 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
| 2592 | + $sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear"; |
|
| 2593 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
| 2594 | 2594 | if (!empty($filter)) { |
| 2595 | - $sql .= " AND (" . $this->db->sanitize($filter, 1, 1, 1) . ')'; |
|
| 2595 | + $sql .= " AND (".$this->db->sanitize($filter, 1, 1, 1).')'; |
|
| 2596 | 2596 | } |
| 2597 | 2597 | $sql .= $this->db->order('date_start', 'ASC'); |
| 2598 | 2598 | |
@@ -2629,13 +2629,13 @@ discard block |
||
| 2629 | 2629 | |
| 2630 | 2630 | $sql = "SELECT YEAR(b.doc_date) as year"; |
| 2631 | 2631 | for ($i = 1; $i <= 12; $i++) { |
| 2632 | - $sql .= ", SUM(".$this->db->ifsql("MONTH(b.doc_date) = ".((int) $i), "1", "0") . ") AS month".((int) $i); |
|
| 2632 | + $sql .= ", SUM(".$this->db->ifsql("MONTH(b.doc_date) = ".((int) $i), "1", "0").") AS month".((int) $i); |
|
| 2633 | 2633 | } |
| 2634 | 2634 | $sql .= ", COUNT(b.rowid) as total"; |
| 2635 | - $sql .= " FROM " . $this->db->prefix() . $this->table_element . " as b"; |
|
| 2636 | - $sql .= " WHERE b.doc_date >= '" . $this->db->idate($date_start) . "'"; |
|
| 2637 | - $sql .= " AND b.doc_date <= '" . $this->db->idate($date_end) . "'"; |
|
| 2638 | - $sql .= " AND b.entity IN (" . getEntity('bookkeeping', 0) . ")"; // We don't share object for accountancy |
|
| 2635 | + $sql .= " FROM ".$this->db->prefix().$this->table_element." as b"; |
|
| 2636 | + $sql .= " WHERE b.doc_date >= '".$this->db->idate($date_start)."'"; |
|
| 2637 | + $sql .= " AND b.doc_date <= '".$this->db->idate($date_end)."'"; |
|
| 2638 | + $sql .= " AND b.entity IN (".getEntity('bookkeeping', 0).")"; // We don't share object for accountancy |
|
| 2639 | 2639 | |
| 2640 | 2640 | // Get count for each month into the fiscal period |
| 2641 | 2641 | if (getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) { |
@@ -2665,7 +2665,7 @@ discard block |
||
| 2665 | 2665 | 'total' => (int) $obj->total, |
| 2666 | 2666 | ); |
| 2667 | 2667 | for ($i = 1; $i <= 12; $i++) { |
| 2668 | - $year_list['count'][$i] = (int) $obj->{'month' . $i}; |
|
| 2668 | + $year_list['count'][$i] = (int) $obj->{'month'.$i}; |
|
| 2669 | 2669 | } |
| 2670 | 2670 | |
| 2671 | 2671 | $list[] = $year_list; |
@@ -2693,11 +2693,11 @@ discard block |
||
| 2693 | 2693 | $now = dol_now(); |
| 2694 | 2694 | |
| 2695 | 2695 | // Specify as export : update field date_validated on selected month/year |
| 2696 | - $sql = " UPDATE " . $this->db->prefix() . $this->table_element; |
|
| 2697 | - $sql .= " SET date_validated = '" . $this->db->idate($now) . "'"; |
|
| 2698 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
| 2699 | - $sql .= " AND DATE(doc_date) >= '" . $this->db->idate($date_start) . "'"; |
|
| 2700 | - $sql .= " AND DATE(doc_date) <= '" . $this->db->idate($date_end) . "'"; |
|
| 2696 | + $sql = " UPDATE ".$this->db->prefix().$this->table_element; |
|
| 2697 | + $sql .= " SET date_validated = '".$this->db->idate($now)."'"; |
|
| 2698 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
| 2699 | + $sql .= " AND DATE(doc_date) >= '".$this->db->idate($date_start)."'"; |
|
| 2700 | + $sql .= " AND DATE(doc_date) <= '".$this->db->idate($date_end)."'"; |
|
| 2701 | 2701 | $sql .= " AND date_validated IS NULL"; |
| 2702 | 2702 | |
| 2703 | 2703 | dol_syslog(__METHOD__, LOG_DEBUG); |
@@ -2730,27 +2730,27 @@ discard block |
||
| 2730 | 2730 | |
| 2731 | 2731 | $pcg_type_filter = array(); |
| 2732 | 2732 | foreach ($accounting_groups_used_for_income_statement as $item) { |
| 2733 | - $pcg_type_filter[] = "'" . $this->db->escape($item) . "'"; |
|
| 2733 | + $pcg_type_filter[] = "'".$this->db->escape($item)."'"; |
|
| 2734 | 2734 | } |
| 2735 | 2735 | |
| 2736 | 2736 | $sql = 'SELECT'; |
| 2737 | 2737 | $sql .= " t.numero_compte,"; |
| 2738 | 2738 | $sql .= " aa.pcg_type,"; |
| 2739 | 2739 | $sql .= " (SUM(t.credit) - SUM(t.debit)) as accounting_result"; |
| 2740 | - $sql .= ' FROM ' . $this->db->prefix() . $this->table_element . ' as t'; |
|
| 2741 | - $sql .= ' LEFT JOIN ' . $this->db->prefix() . 'accounting_account as aa ON aa.account_number = t.numero_compte'; |
|
| 2742 | - $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2743 | - $sql .= " AND aa.entity = " . ((int) $conf->entity); |
|
| 2744 | - $sql .= ' AND aa.fk_pcg_version IN (SELECT pcg_version FROM ' . $this->db->prefix() . 'accounting_system WHERE rowid = ' . ((int) getDolGlobalInt('CHARTOFACCOUNTS')) . ')'; |
|
| 2745 | - $sql .= ' AND aa.pcg_type IN (' . $this->db->sanitize(implode(',', $pcg_type_filter), 1) . ')'; |
|
| 2746 | - $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($date_start) . "'"; |
|
| 2747 | - $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($date_end) . "'"; |
|
| 2740 | + $sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t'; |
|
| 2741 | + $sql .= ' LEFT JOIN '.$this->db->prefix().'accounting_account as aa ON aa.account_number = t.numero_compte'; |
|
| 2742 | + $sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2743 | + $sql .= " AND aa.entity = ".((int) $conf->entity); |
|
| 2744 | + $sql .= ' AND aa.fk_pcg_version IN (SELECT pcg_version FROM '.$this->db->prefix().'accounting_system WHERE rowid = '.((int) getDolGlobalInt('CHARTOFACCOUNTS')).')'; |
|
| 2745 | + $sql .= ' AND aa.pcg_type IN ('.$this->db->sanitize(implode(',', $pcg_type_filter), 1).')'; |
|
| 2746 | + $sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($date_start)."'"; |
|
| 2747 | + $sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($date_end)."'"; |
|
| 2748 | 2748 | $sql .= ' GROUP BY t.numero_compte, aa.pcg_type'; |
| 2749 | 2749 | |
| 2750 | 2750 | $resql = $this->db->query($sql); |
| 2751 | 2751 | if (!$resql) { |
| 2752 | - $this->errors[] = 'Error ' . $this->db->lasterror(); |
|
| 2753 | - dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); |
|
| 2752 | + $this->errors[] = 'Error '.$this->db->lasterror(); |
|
| 2753 | + dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR); |
|
| 2754 | 2754 | } else { |
| 2755 | 2755 | while ($obj = $this->db->fetch_object($resql)) { |
| 2756 | 2756 | $income_statement_amount += $obj->accounting_result; |
@@ -2789,7 +2789,7 @@ discard block |
||
| 2789 | 2789 | return -1; |
| 2790 | 2790 | } elseif (empty($fiscal_period->id)) { |
| 2791 | 2791 | $langs->loadLangs(array('errors', 'compta')); |
| 2792 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $fiscal_period_id . ')'; |
|
| 2792 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$fiscal_period_id.')'; |
|
| 2793 | 2793 | return -1; |
| 2794 | 2794 | } |
| 2795 | 2795 | |
@@ -2808,7 +2808,7 @@ discard block |
||
| 2808 | 2808 | return -1; |
| 2809 | 2809 | } elseif (empty($new_fiscal_period->id)) { |
| 2810 | 2810 | $langs->loadLangs(array('errors', 'compta')); |
| 2811 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $new_fiscal_period_id . ')'; |
|
| 2811 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$new_fiscal_period_id.')'; |
|
| 2812 | 2812 | return -1; |
| 2813 | 2813 | } |
| 2814 | 2814 | |
@@ -2828,7 +2828,7 @@ discard block |
||
| 2828 | 2828 | $journal_id = max(0, getDolGlobalString('ACCOUNTING_CLOSURE_DEFAULT_JOURNAL')); |
| 2829 | 2829 | if (empty($journal_id)) { |
| 2830 | 2830 | $langs->loadLangs(array('errors', 'accountancy')); |
| 2831 | - $this->errors[] = $langs->trans('ErrorBadParameters') . ' - ' . $langs->trans('Codejournal') . ' (' . $langs->trans('AccountingJournalType9') . ')'; |
|
| 2831 | + $this->errors[] = $langs->trans('ErrorBadParameters').' - '.$langs->trans('Codejournal').' ('.$langs->trans('AccountingJournalType9').')'; |
|
| 2832 | 2832 | $error++; |
| 2833 | 2833 | } |
| 2834 | 2834 | |
@@ -2842,7 +2842,7 @@ discard block |
||
| 2842 | 2842 | $error++; |
| 2843 | 2843 | } elseif ($result == 0) { |
| 2844 | 2844 | $langs->loadLangs(array('errors', 'accountancy')); |
| 2845 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('Codejournal') . ' (' . $langs->trans('AccountingJournalType9') . ')'; |
|
| 2845 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('Codejournal').' ('.$langs->trans('AccountingJournalType9').')'; |
|
| 2846 | 2846 | $error++; |
| 2847 | 2847 | } |
| 2848 | 2848 | } else { |
@@ -2856,7 +2856,7 @@ discard block |
||
| 2856 | 2856 | $pcg_type_filter = array(); |
| 2857 | 2857 | $tmp = array_merge($accounting_groups_used_for_balance_sheet_account, $accounting_groups_used_for_income_statement); |
| 2858 | 2858 | foreach ($tmp as $item) { |
| 2859 | - $pcg_type_filter[] = "'" . $this->db->escape($item) . "'"; |
|
| 2859 | + $pcg_type_filter[] = "'".$this->db->escape($item)."'"; |
|
| 2860 | 2860 | } |
| 2861 | 2861 | |
| 2862 | 2862 | $sql = 'SELECT'; |
@@ -2868,14 +2868,14 @@ discard block |
||
| 2868 | 2868 | } |
| 2869 | 2869 | $sql .= " aa.pcg_type,"; |
| 2870 | 2870 | $sql .= " (SUM(t.credit) - SUM(t.debit)) as opening_balance"; |
| 2871 | - $sql .= ' FROM ' . $this->db->prefix() . $this->table_element . ' as t'; |
|
| 2872 | - $sql .= ' LEFT JOIN ' . $this->db->prefix() . 'accounting_account as aa ON aa.account_number = t.numero_compte'; |
|
| 2873 | - $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2874 | - $sql .= " AND aa.entity = ". ((int) $conf->entity); |
|
| 2871 | + $sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t'; |
|
| 2872 | + $sql .= ' LEFT JOIN '.$this->db->prefix().'accounting_account as aa ON aa.account_number = t.numero_compte'; |
|
| 2873 | + $sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 2874 | + $sql .= " AND aa.entity = ".((int) $conf->entity); |
|
| 2875 | 2875 | $sql .= ' AND aa.fk_pcg_version IN (SELECT pcg_version FROM '.$this->db->prefix().'accounting_system WHERE rowid = '.((int) getDolGlobalInt('CHARTOFACCOUNTS')).')'; |
| 2876 | - $sql .= ' AND aa.pcg_type IN (' . $this->db->sanitize(implode(',', $pcg_type_filter), 1) . ')'; |
|
| 2877 | - $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($fiscal_period->date_start) . "'"; |
|
| 2878 | - $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($fiscal_period->date_end) . "'"; |
|
| 2876 | + $sql .= ' AND aa.pcg_type IN ('.$this->db->sanitize(implode(',', $pcg_type_filter), 1).')'; |
|
| 2877 | + $sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($fiscal_period->date_start)."'"; |
|
| 2878 | + $sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($fiscal_period->date_end)."'"; |
|
| 2879 | 2879 | $sql .= ' GROUP BY t.numero_compte, t.label_compte, aa.pcg_type'; |
| 2880 | 2880 | if ($separate_auxiliary_account) { |
| 2881 | 2881 | $sql .= ' ,t.subledger_account, t.subledger_label'; |
@@ -2884,8 +2884,8 @@ discard block |
||
| 2884 | 2884 | |
| 2885 | 2885 | $resql = $this->db->query($sql); |
| 2886 | 2886 | if (!$resql) { |
| 2887 | - $this->errors[] = 'Error ' . $this->db->lasterror(); |
|
| 2888 | - dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); |
|
| 2887 | + $this->errors[] = 'Error '.$this->db->lasterror(); |
|
| 2888 | + dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR); |
|
| 2889 | 2889 | |
| 2890 | 2890 | $error++; |
| 2891 | 2891 | } else { |
@@ -3027,7 +3027,7 @@ discard block |
||
| 3027 | 3027 | return -1; |
| 3028 | 3028 | } elseif (empty($fiscal_period->id)) { |
| 3029 | 3029 | $langs->loadLangs(array('errors', 'compta')); |
| 3030 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $fiscal_period_id . ')'; |
|
| 3030 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$fiscal_period_id.')'; |
|
| 3031 | 3031 | return -1; |
| 3032 | 3032 | } |
| 3033 | 3033 | |
@@ -3046,7 +3046,7 @@ discard block |
||
| 3046 | 3046 | return -1; |
| 3047 | 3047 | } elseif (empty($new_fiscal_period->id)) { |
| 3048 | 3048 | $langs->loadLangs(array('errors', 'compta')); |
| 3049 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $new_fiscal_period_id . ')'; |
|
| 3049 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$new_fiscal_period_id.')'; |
|
| 3050 | 3050 | return -1; |
| 3051 | 3051 | } |
| 3052 | 3052 | |
@@ -3066,7 +3066,7 @@ discard block |
||
| 3066 | 3066 | return -1; |
| 3067 | 3067 | } elseif ($result == 0) { |
| 3068 | 3068 | $langs->loadLangs(array('errors', 'accountancy')); |
| 3069 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('InventoryJournal'); |
|
| 3069 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('InventoryJournal'); |
|
| 3070 | 3070 | return -1; |
| 3071 | 3071 | } |
| 3072 | 3072 | |
@@ -3074,18 +3074,18 @@ discard block |
||
| 3074 | 3074 | $this->db->begin(); |
| 3075 | 3075 | |
| 3076 | 3076 | $sql = 'SELECT t.rowid'; |
| 3077 | - $sql .= ' FROM ' . $this->db->prefix() . $this->table_element . ' as t'; |
|
| 3078 | - $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 3079 | - $sql .= " AND code_journal = '" . $this->db->escape($inventory_journal->code) . "'"; |
|
| 3080 | - $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($date_start) . "'"; |
|
| 3081 | - $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($date_end) . "'"; |
|
| 3082 | - $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($fiscal_period->date_start) . "'"; |
|
| 3083 | - $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($fiscal_period->date_end) . "'"; |
|
| 3077 | + $sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t'; |
|
| 3078 | + $sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
| 3079 | + $sql .= " AND code_journal = '".$this->db->escape($inventory_journal->code)."'"; |
|
| 3080 | + $sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($date_start)."'"; |
|
| 3081 | + $sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($date_end)."'"; |
|
| 3082 | + $sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($fiscal_period->date_start)."'"; |
|
| 3083 | + $sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($fiscal_period->date_end)."'"; |
|
| 3084 | 3084 | |
| 3085 | 3085 | $resql = $this->db->query($sql); |
| 3086 | 3086 | if (!$resql) { |
| 3087 | - $this->errors[] = 'Error ' . $this->db->lasterror(); |
|
| 3088 | - dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); |
|
| 3087 | + $this->errors[] = 'Error '.$this->db->lasterror(); |
|
| 3088 | + dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR); |
|
| 3089 | 3089 | |
| 3090 | 3090 | $error++; |
| 3091 | 3091 | } else { |
@@ -3100,7 +3100,7 @@ discard block |
||
| 3100 | 3100 | break; |
| 3101 | 3101 | } elseif ($result == 0) { |
| 3102 | 3102 | $langs->loadLangs(array('errors', 'accountancy')); |
| 3103 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('LineId') . ': ' . $obj->rowid; |
|
| 3103 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('LineId').': '.$obj->rowid; |
|
| 3104 | 3104 | $error++; |
| 3105 | 3105 | break; |
| 3106 | 3106 | } |