@@ -35,7 +35,9 @@ discard block |
||
35 | 35 | $action = GETPOST('action', 'alpha'); |
36 | 36 | |
37 | 37 | // Security check |
38 | -if ($user->socid) $socid = $user->socid; |
|
38 | +if ($user->socid) { |
|
39 | + $socid = $user->socid; |
|
40 | +} |
|
39 | 41 | |
40 | 42 | $result = restrictedArea($user, 'stocktransfer', $id, '', 'stocktransfer'); |
41 | 43 | |
@@ -175,7 +177,9 @@ discard block |
||
175 | 177 | $dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl')); |
176 | 178 | foreach ($dirtpls as $reldir) { |
177 | 179 | $res = @include dol_buildpath($reldir.'/contacts.tpl.php'); |
178 | - if ($res) break; |
|
180 | + if ($res) { |
|
181 | + break; |
|
182 | + } |
|
179 | 183 | } |
180 | 184 | } |
181 | 185 |
@@ -131,7 +131,7 @@ |
||
131 | 131 | $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); |
132 | 132 | // Thirdparty |
133 | 133 | if (!empty($object->thirdparty)) { |
134 | - $morehtmlref .= '<br>' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'customer'); |
|
134 | + $morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); |
|
135 | 135 | } |
136 | 136 | // Project |
137 | 137 | if (isModEnabled('project')) { |
@@ -671,11 +671,11 @@ |
||
671 | 671 | $rankToUse = (int) $position; |
672 | 672 | if ($rankToUse != $line->oldcopy->position) { // check if position have a new value |
673 | 673 | foreach ($this->lines as $bl) { |
674 | - if ($bl->position >= $rankToUse AND $bl->position < ($line->oldcopy->position + 1)) { // move rank up |
|
674 | + if ($bl->position >= $rankToUse and $bl->position < ($line->oldcopy->position + 1)) { // move rank up |
|
675 | 675 | $bl->position++; |
676 | 676 | $bl->update($user); |
677 | 677 | } |
678 | - if ($bl->position <= $rankToUse AND $bl->position > ($line->oldcopy->position)) { // move rank down |
|
678 | + if ($bl->position <= $rankToUse and $bl->position > ($line->oldcopy->position)) { // move rank down |
|
679 | 679 | $bl->position--; |
680 | 680 | $bl->update($user); |
681 | 681 | } |
@@ -405,7 +405,6 @@ |
||
405 | 405 | * Load object lines in memory from the database by type of product |
406 | 406 | * |
407 | 407 | * @param int $typeproduct 0 type product, 1 type service |
408 | - |
|
409 | 408 | * @return int <0 if KO, 0 if not found, >0 if OK |
410 | 409 | */ |
411 | 410 | public function fetchLinesbytypeproduct($typeproduct = 0) |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | $sql .= " FROM ".$this->db->prefix().$objectline->table_element." as l"; |
452 | 452 | $sql .= " LEFT JOIN ".$this->db->prefix()."product as p ON p.rowid = l.fk_product"; |
453 | 453 | $sql .= " WHERE l.fk_".$this->db->escape($this->element)." = ".((int) $this->id); |
454 | - $sql .= " AND p.fk_product_type = ". ((int) $typeproduct); |
|
454 | + $sql .= " AND p.fk_product_type = ".((int) $typeproduct); |
|
455 | 455 | if (isset($objectline->fields['position'])) { |
456 | 456 | $sql .= $this->db->order('position', 'ASC'); |
457 | 457 | } |
@@ -1182,7 +1182,7 @@ discard block |
||
1182 | 1182 | $label = $langs->trans("ShowBillOfMaterials"); |
1183 | 1183 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
1184 | 1184 | } |
1185 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
1185 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
1186 | 1186 | $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
1187 | 1187 | } else { |
1188 | 1188 | $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
@@ -1401,7 +1401,7 @@ discard block |
||
1401 | 1401 | $this->unit_cost = 0; |
1402 | 1402 | $this->total_cost = 0; |
1403 | 1403 | |
1404 | - $parameters=array(); |
|
1404 | + $parameters = array(); |
|
1405 | 1405 | $reshook = $hookmanager->executeHooks('calculateCostsBom', $parameters, $this); // Note that $action and $object may have been modified by hook |
1406 | 1406 | |
1407 | 1407 | if ($reshook > 0) { |
@@ -1416,7 +1416,7 @@ discard block |
||
1416 | 1416 | foreach ($this->lines as &$line) { |
1417 | 1417 | $tmpproduct->cost_price = 0; |
1418 | 1418 | $tmpproduct->pmp = 0; |
1419 | - $result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading |
|
1419 | + $result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading |
|
1420 | 1420 | |
1421 | 1421 | if ($tmpproduct->type == $tmpproduct::TYPE_PRODUCT) { |
1422 | 1422 | if (empty($line->fk_bom_child)) { |
@@ -1525,12 +1525,12 @@ discard block |
||
1525 | 1525 | if (!empty($this->lines)) { |
1526 | 1526 | foreach ($this->lines as $line) { |
1527 | 1527 | if (!empty($line->childBom)) { |
1528 | - foreach ($line->childBom as $childBom) $childBom->getNetNeeds($TNetNeeds, $line->qty*$qty); |
|
1528 | + foreach ($line->childBom as $childBom) $childBom->getNetNeeds($TNetNeeds, $line->qty * $qty); |
|
1529 | 1529 | } else { |
1530 | 1530 | if (empty($TNetNeeds[$line->fk_product])) { |
1531 | 1531 | $TNetNeeds[$line->fk_product] = 0; |
1532 | 1532 | } |
1533 | - $TNetNeeds[$line->fk_product] += $line->qty*$qty; |
|
1533 | + $TNetNeeds[$line->fk_product] += $line->qty * $qty; |
|
1534 | 1534 | } |
1535 | 1535 | } |
1536 | 1536 | } |
@@ -1552,9 +1552,9 @@ discard block |
||
1552 | 1552 | foreach ($line->childBom as $childBom) { |
1553 | 1553 | $TNetNeeds[$childBom->id]['bom'] = $childBom; |
1554 | 1554 | $TNetNeeds[$childBom->id]['parentid'] = $this->id; |
1555 | - $TNetNeeds[$childBom->id]['qty'] = $line->qty*$qty; |
|
1555 | + $TNetNeeds[$childBom->id]['qty'] = $line->qty * $qty; |
|
1556 | 1556 | $TNetNeeds[$childBom->id]['level'] = $level; |
1557 | - $childBom->getNetNeedsTree($TNetNeeds, $line->qty*$qty, $level+1); |
|
1557 | + $childBom->getNetNeedsTree($TNetNeeds, $line->qty * $qty, $level + 1); |
|
1558 | 1558 | } |
1559 | 1559 | } else { |
1560 | 1560 | $TNetNeeds[$this->id]['product'][$line->fk_product]['qty'] += $line->qty * $qty; |
@@ -1580,7 +1580,7 @@ discard block |
||
1580 | 1580 | return; |
1581 | 1581 | } |
1582 | 1582 | |
1583 | - if (empty($bom_id)) $bom_id=$this->id; |
|
1583 | + if (empty($bom_id)) $bom_id = $this->id; |
|
1584 | 1584 | |
1585 | 1585 | $sql = 'SELECT l.fk_bom, b.label |
1586 | 1586 | FROM '.MAIN_DB_PREFIX.'bom_bomline l |
@@ -1591,7 +1591,7 @@ discard block |
||
1591 | 1591 | if (!empty($resql)) { |
1592 | 1592 | while ($res = $this->db->fetch_object($resql)) { |
1593 | 1593 | $TParentBom[$res->fk_bom] = $res->fk_bom; |
1594 | - $this->getParentBomTreeRecursive($TParentBom, $res->fk_bom, $level+1); |
|
1594 | + $this->getParentBomTreeRecursive($TParentBom, $res->fk_bom, $level + 1); |
|
1595 | 1595 | } |
1596 | 1596 | } |
1597 | 1597 | } |
@@ -1605,7 +1605,7 @@ discard block |
||
1605 | 1605 | */ |
1606 | 1606 | public function getKanbanView($option = '', $arraydata = null) |
1607 | 1607 | { |
1608 | - global $db,$langs; |
|
1608 | + global $db, $langs; |
|
1609 | 1609 | |
1610 | 1610 | $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); |
1611 | 1611 |
@@ -1460,8 +1460,9 @@ discard block |
||
1460 | 1460 | $workstation = new Workstation($this->db); |
1461 | 1461 | $res = $workstation->fetch($tmpproduct->fk_default_workstation); |
1462 | 1462 | |
1463 | - if ($res > 0) $line->total_cost = price2num($qtyhourforline * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT'); |
|
1464 | - else { |
|
1463 | + if ($res > 0) { |
|
1464 | + $line->total_cost = price2num($qtyhourforline * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT'); |
|
1465 | + } else { |
|
1465 | 1466 | $this->error = $workstation->error; |
1466 | 1467 | return -3; |
1467 | 1468 | } |
@@ -1525,7 +1526,9 @@ discard block |
||
1525 | 1526 | if (!empty($this->lines)) { |
1526 | 1527 | foreach ($this->lines as $line) { |
1527 | 1528 | if (!empty($line->childBom)) { |
1528 | - foreach ($line->childBom as $childBom) $childBom->getNetNeeds($TNetNeeds, $line->qty*$qty); |
|
1529 | + foreach ($line->childBom as $childBom) { |
|
1530 | + $childBom->getNetNeeds($TNetNeeds, $line->qty*$qty); |
|
1531 | + } |
|
1529 | 1532 | } else { |
1530 | 1533 | if (empty($TNetNeeds[$line->fk_product])) { |
1531 | 1534 | $TNetNeeds[$line->fk_product] = 0; |
@@ -1580,7 +1583,9 @@ discard block |
||
1580 | 1583 | return; |
1581 | 1584 | } |
1582 | 1585 | |
1583 | - if (empty($bom_id)) $bom_id=$this->id; |
|
1586 | + if (empty($bom_id)) { |
|
1587 | + $bom_id=$this->id; |
|
1588 | + } |
|
1584 | 1589 | |
1585 | 1590 | $sql = 'SELECT l.fk_bom, b.label |
1586 | 1591 | FROM '.MAIN_DB_PREFIX.'bom_bomline l |
@@ -550,7 +550,7 @@ |
||
550 | 550 | $langs->load($reg[1]); |
551 | 551 | } |
552 | 552 | |
553 | - $labeltoshow = preg_replace('/:.*$/', '', $object->label); |
|
553 | + $labeltoshow = preg_replace('/:.*$/', '', $object->label); |
|
554 | 554 | |
555 | 555 | $morehtmlref = '<div class="refidno">'; |
556 | 556 | $morehtmlref .= $langs->trans($labeltoshow); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | print '<tr class="oddeven value">'; |
279 | 279 | // Param |
280 | 280 | print '<td>'; |
281 | -print img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'); |
|
281 | +print img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'); |
|
282 | 282 | print '</td>'; |
283 | 283 | // Value |
284 | 284 | print '<td class="right">'; // Do not force class=right, or it align also the content of the select box |
@@ -288,13 +288,13 @@ discard block |
||
288 | 288 | |
289 | 289 | if (isModEnabled('societe') && getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT') && getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT') != '-1') { |
290 | 290 | print '<tr class="oddeven">'; |
291 | - print '<td>' . img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnCustomerDeposit") . '</td>'; |
|
291 | + print '<td>'.img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("UseAuxiliaryAccountOnCustomerDeposit").'</td>'; |
|
292 | 292 | if (getDolGlobalInt('ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT')) { |
293 | - print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT&value=0">'; |
|
293 | + print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT&value=0">'; |
|
294 | 294 | print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning'); |
295 | 295 | print '</a></td>'; |
296 | 296 | } else { |
297 | - print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT&value=1">'; |
|
297 | + print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT&value=1">'; |
|
298 | 298 | print img_picto($langs->trans("Disabled"), 'switch_off'); |
299 | 299 | print '</a></td>'; |
300 | 300 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | print '<tr class="oddeven value">'; |
306 | 306 | // Param |
307 | 307 | print '<td>'; |
308 | -print img_picto('', 'supplier_invoice', 'class="pictofixedwidth"') . $langs->trans('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT'); |
|
308 | +print img_picto('', 'supplier_invoice', 'class="pictofixedwidth"').$langs->trans('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT'); |
|
309 | 309 | print '</td>'; |
310 | 310 | // Value |
311 | 311 | print '<td class="right">'; // Do not force class=right, or it align also the content of the select box |
@@ -315,13 +315,13 @@ discard block |
||
315 | 315 | |
316 | 316 | if (isModEnabled('societe') && getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT') && getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT') != '-1') { |
317 | 317 | print '<tr class="oddeven">'; |
318 | - print '<td>' . img_picto('', 'supplier_invoice', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnSupplierDeposit") . '</td>'; |
|
318 | + print '<td>'.img_picto('', 'supplier_invoice', 'class="pictofixedwidth"').$langs->trans("UseAuxiliaryAccountOnSupplierDeposit").'</td>'; |
|
319 | 319 | if (getDolGlobalInt('ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT')) { |
320 | - print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT&value=0">'; |
|
320 | + print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT&value=0">'; |
|
321 | 321 | print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning'); |
322 | 322 | print '</a></td>'; |
323 | 323 | } else { |
324 | - print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT&value=1">'; |
|
324 | + print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT&value=1">'; |
|
325 | 325 | print img_picto($langs->trans("Disabled"), 'switch_off'); |
326 | 326 | print '</a></td>'; |
327 | 327 | } |
@@ -2637,7 +2637,9 @@ discard block |
||
2637 | 2637 | $sql.= ' WHERE cd.fk_contrat = c.rowid'; |
2638 | 2638 | $sql.= " AND date_format(cd.date_fin_validite, '%Y-%m-%d') <= date_format('".$this->db->idate($enddatetoscan)."', '%Y-%m-%d')"; |
2639 | 2639 | $sql.= " AND cd.statut = 4"; |
2640 | - if ($thirdparty_id > 0) $sql.=" AND c.fk_soc = ".((int) $thirdparty_id); |
|
2640 | + if ($thirdparty_id > 0) { |
|
2641 | + $sql.=" AND c.fk_soc = ".((int) $thirdparty_id); |
|
2642 | + } |
|
2641 | 2643 | //print $sql; |
2642 | 2644 | |
2643 | 2645 | $resql = $this->db->query($sql); |
@@ -2682,7 +2684,10 @@ discard block |
||
2682 | 2684 | //dol_sort_array($contract->linkedObjects['facture'], 'date'); |
2683 | 2685 | $someinvoicenotpaid=0; |
2684 | 2686 | foreach ($object->linkedObjects['facture'] as $idinvoice => $invoice) { |
2685 | - if ($invoice->statut == Facture::STATUS_DRAFT) continue; // Draft invoice are not invoice not paid |
|
2687 | + if ($invoice->statut == Facture::STATUS_DRAFT) { |
|
2688 | + continue; |
|
2689 | + } |
|
2690 | + // Draft invoice are not invoice not paid |
|
2686 | 2691 | |
2687 | 2692 | if (empty($invoice->paye)) { |
2688 | 2693 | $someinvoicenotpaid++; |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | if ($contratline->statut != ContratLigne::STATUS_OPEN) { |
396 | 396 | $contratline->context = $this->context; |
397 | 397 | |
398 | - $result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment); // This call trigger LINECONTRACT_ACTIVATE |
|
398 | + $result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment); // This call trigger LINECONTRACT_ACTIVATE |
|
399 | 399 | if ($result < 0) { |
400 | 400 | $error++; |
401 | 401 | $this->error = $contratline->error; |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | // Close lines not already closed |
446 | 446 | if ($contratline->statut != ContratLigne::STATUS_CLOSED) { |
447 | 447 | $contratline->date_end_real = $now; |
448 | - $contratline->date_cloture = $now; // For backward compatibility |
|
448 | + $contratline->date_cloture = $now; // For backward compatibility |
|
449 | 449 | $contratline->fk_user_cloture = $user->id; |
450 | 450 | $contratline->statut = ContratLigne::STATUS_CLOSED; |
451 | 451 | $result = $contratline->close_line($user, $now, $comment, $notrigger); |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | if (!$error) { |
577 | 577 | $this->ref = $num; |
578 | 578 | $this->status = self::STATUS_VALIDATED; |
579 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
579 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
580 | 580 | $this->date_validation = $now; |
581 | 581 | } |
582 | 582 | } else { |
@@ -840,10 +840,10 @@ discard block |
||
840 | 840 | $line->localtax2_tx = $objp->localtax2_tx; |
841 | 841 | $line->localtax1_type = $objp->localtax1_type; |
842 | 842 | $line->localtax2_type = $objp->localtax2_type; |
843 | - $line->subprice = $objp->subprice; |
|
843 | + $line->subprice = $objp->subprice; |
|
844 | 844 | $line->statut = $objp->status; |
845 | 845 | $line->status = $objp->status; |
846 | - $line->remise_percent = $objp->remise_percent; |
|
846 | + $line->remise_percent = $objp->remise_percent; |
|
847 | 847 | $line->price_ht = $objp->price_ht; |
848 | 848 | $line->price = $objp->price_ht; // For backward compatibility |
849 | 849 | $line->total_ht = $objp->total_ht; |
@@ -886,7 +886,7 @@ discard block |
||
886 | 886 | //$line->date_fin_prevue = $this->db->jdate($objp->date_fin_validite); |
887 | 887 | //$line->date_fin_reel = $this->db->jdate($objp->date_cloture); |
888 | 888 | |
889 | - $line->rang = $objp->rang; |
|
889 | + $line->rang = $objp->rang; |
|
890 | 890 | |
891 | 891 | // Retrieve all extrafields for contract line |
892 | 892 | // fetch optionals attributes and labels |
@@ -2030,7 +2030,7 @@ discard block |
||
2030 | 2030 | } |
2031 | 2031 | $datas['customer'] = '<br><b>'.$langs->trans('Customer').':</b> '.$this->thirdparty->getNomUrl(1, '', 0, 1); |
2032 | 2032 | } |
2033 | - $datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '. $this->ref_customer; |
|
2033 | + $datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_customer; |
|
2034 | 2034 | if (!$nofetch) { |
2035 | 2035 | $langs->load('project'); |
2036 | 2036 | if (empty($this->project)) { |
@@ -2103,7 +2103,7 @@ discard block |
||
2103 | 2103 | $label = $langs->trans("ShowContract"); |
2104 | 2104 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
2105 | 2105 | } |
2106 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
2106 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
2107 | 2107 | $linkclose .= $dataparams.' class="'.$classfortooltip.'"'; |
2108 | 2108 | } |
2109 | 2109 | $linkstart = '<a href="'.$url.'"'; |
@@ -2504,7 +2504,7 @@ discard block |
||
2504 | 2504 | global $user; |
2505 | 2505 | |
2506 | 2506 | $ticket = new Ticket($this->db); |
2507 | - $nbTicket = $ticket->fetchAll($user, 'ASC', 't.datec', '', 0, '', array('t.fk_contract' => $this->id)); |
|
2507 | + $nbTicket = $ticket->fetchAll($user, 'ASC', 't.datec', '', 0, '', array('t.fk_contract' => $this->id)); |
|
2508 | 2508 | |
2509 | 2509 | return ($nbTicket < 0 ? $nbTicket : $ticket->lines); |
2510 | 2510 | } |
@@ -2526,7 +2526,7 @@ discard block |
||
2526 | 2526 | global $conf, $langs; |
2527 | 2527 | |
2528 | 2528 | if (!dol_strlen($modele)) { |
2529 | - $modele = ''; // No doc template/generation by default |
|
2529 | + $modele = ''; // No doc template/generation by default |
|
2530 | 2530 | |
2531 | 2531 | if (!empty($this->model_pdf)) { |
2532 | 2532 | $modele = $this->model_pdf; |
@@ -2719,7 +2719,7 @@ discard block |
||
2719 | 2719 | |
2720 | 2720 | $error = 0; |
2721 | 2721 | $this->output = ''; |
2722 | - $this->error=''; |
|
2722 | + $this->error = ''; |
|
2723 | 2723 | |
2724 | 2724 | $contractlineprocessed = array(); |
2725 | 2725 | $contractignored = array(); |
@@ -2728,12 +2728,12 @@ discard block |
||
2728 | 2728 | dol_syslog(__METHOD__, LOG_DEBUG); |
2729 | 2729 | |
2730 | 2730 | $sql = 'SELECT c.rowid, c.ref_customer, cd.rowid as lid, cd.date_fin_validite, p.duration'; |
2731 | - $sql.= ' FROM '.MAIN_DB_PREFIX.'contrat as c, '.MAIN_DB_PREFIX.'contratdet as cd'; |
|
2732 | - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON p.rowid = cd.fk_product'; |
|
2733 | - $sql.= ' WHERE cd.fk_contrat = c.rowid'; |
|
2734 | - $sql.= " AND date_format(cd.date_fin_validite, '%Y-%m-%d') <= date_format('".$this->db->idate($enddatetoscan)."', '%Y-%m-%d')"; |
|
2735 | - $sql.= " AND cd.statut = 4"; |
|
2736 | - if ($thirdparty_id > 0) $sql.=" AND c.fk_soc = ".((int) $thirdparty_id); |
|
2731 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'contrat as c, '.MAIN_DB_PREFIX.'contratdet as cd'; |
|
2732 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON p.rowid = cd.fk_product'; |
|
2733 | + $sql .= ' WHERE cd.fk_contrat = c.rowid'; |
|
2734 | + $sql .= " AND date_format(cd.date_fin_validite, '%Y-%m-%d') <= date_format('".$this->db->idate($enddatetoscan)."', '%Y-%m-%d')"; |
|
2735 | + $sql .= " AND cd.statut = 4"; |
|
2736 | + if ($thirdparty_id > 0) $sql .= " AND c.fk_soc = ".((int) $thirdparty_id); |
|
2737 | 2737 | //print $sql; |
2738 | 2738 | |
2739 | 2739 | $resql = $this->db->query($sql); |
@@ -2742,7 +2742,7 @@ discard block |
||
2742 | 2742 | |
2743 | 2743 | include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
2744 | 2744 | |
2745 | - $i=0; |
|
2745 | + $i = 0; |
|
2746 | 2746 | while ($i < $num) { |
2747 | 2747 | $obj = $this->db->fetch_object($resql); |
2748 | 2748 | if ($obj) { |
@@ -2752,7 +2752,7 @@ discard block |
||
2752 | 2752 | |
2753 | 2753 | // Load contract |
2754 | 2754 | $object = new Contrat($this->db); |
2755 | - $object->fetch($obj->rowid); // fetch also lines |
|
2755 | + $object->fetch($obj->rowid); // fetch also lines |
|
2756 | 2756 | $object->fetch_thirdparty(); |
2757 | 2757 | |
2758 | 2758 | if ($object->id <= 0) { |
@@ -2776,9 +2776,9 @@ discard block |
||
2776 | 2776 | usort($object->linkedObjects['facture'], "cmp"); |
2777 | 2777 | |
2778 | 2778 | //dol_sort_array($contract->linkedObjects['facture'], 'date'); |
2779 | - $someinvoicenotpaid=0; |
|
2779 | + $someinvoicenotpaid = 0; |
|
2780 | 2780 | foreach ($object->linkedObjects['facture'] as $idinvoice => $invoice) { |
2781 | - if ($invoice->statut == Facture::STATUS_DRAFT) continue; // Draft invoice are not invoice not paid |
|
2781 | + if ($invoice->statut == Facture::STATUS_DRAFT) continue; // Draft invoice are not invoice not paid |
|
2782 | 2782 | |
2783 | 2783 | if (empty($invoice->paye)) { |
2784 | 2784 | $someinvoicenotpaid++; |
@@ -2786,7 +2786,7 @@ discard block |
||
2786 | 2786 | } |
2787 | 2787 | if ($someinvoicenotpaid) { |
2788 | 2788 | $this->output .= 'Contract '.$object->ref.' is qualified for renewal but there is '.$someinvoicenotpaid.' invoice(s) unpayed so we cancel renewal'."\n"; |
2789 | - $contractignored[$object->id]=$object->ref; |
|
2789 | + $contractignored[$object->id] = $object->ref; |
|
2790 | 2790 | continue; |
2791 | 2791 | } |
2792 | 2792 | } |
@@ -2794,7 +2794,7 @@ discard block |
||
2794 | 2794 | if ($expirationdate && $expirationdate < $enddatetoscan) { |
2795 | 2795 | dol_syslog("Define the newdate of end of services from expirationdate=".$expirationdate); |
2796 | 2796 | $newdate = $expirationdate; |
2797 | - $protecti=0; //$protecti is to avoid infinite loop |
|
2797 | + $protecti = 0; //$protecti is to avoid infinite loop |
|
2798 | 2798 | while ($newdate < $enddatetoscan && $protecti < 1000) { |
2799 | 2799 | $newdate = dol_time_plus_duree($newdate, $duration_value, $duration_unit); |
2800 | 2800 | $protecti++; |
@@ -2812,39 +2812,39 @@ discard block |
||
2812 | 2812 | $comment = 'Renew date of contract '.$object->ref.' line '.$obj->lid.' by doAutoRenewContracts'; |
2813 | 2813 | |
2814 | 2814 | $sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."contratdet SET date_fin_validite = '".$this->db->idate($newdate)."'"; |
2815 | - $sqlupdate.= ' WHERE rowid = '.((int) $obj->lid); |
|
2815 | + $sqlupdate .= ' WHERE rowid = '.((int) $obj->lid); |
|
2816 | 2816 | $resqlupdate = $this->db->query($sqlupdate); |
2817 | 2817 | if ($resqlupdate) { |
2818 | - $contractlineprocessed[$obj->lid]=$object->ref; |
|
2818 | + $contractlineprocessed[$obj->lid] = $object->ref; |
|
2819 | 2819 | |
2820 | 2820 | $actioncode = 'RENEW_CONTRACT'; |
2821 | 2821 | $now = dol_now(); |
2822 | 2822 | |
2823 | 2823 | // Create an event |
2824 | 2824 | $actioncomm = new ActionComm($this->db); |
2825 | - $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) |
|
2825 | + $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) |
|
2826 | 2826 | $actioncomm->code = 'AC_'.$actioncode; |
2827 | 2827 | $actioncomm->label = $label; |
2828 | 2828 | $actioncomm->datep = $now; |
2829 | 2829 | $actioncomm->datef = $now; |
2830 | - $actioncomm->percentage = -1; // Not applicable |
|
2830 | + $actioncomm->percentage = -1; // Not applicable |
|
2831 | 2831 | $actioncomm->socid = $object->thirdparty->id; |
2832 | - $actioncomm->authorid = $user->id; // User saving action |
|
2833 | - $actioncomm->userownerid = $user->id; // Owner of action |
|
2832 | + $actioncomm->authorid = $user->id; // User saving action |
|
2833 | + $actioncomm->userownerid = $user->id; // Owner of action |
|
2834 | 2834 | $actioncomm->fk_element = $object->id; |
2835 | 2835 | $actioncomm->elementtype = 'contract'; |
2836 | 2836 | $actioncomm->note_private = $comment; |
2837 | 2837 | |
2838 | - $ret = $actioncomm->create($user); // User creating action |
|
2838 | + $ret = $actioncomm->create($user); // User creating action |
|
2839 | 2839 | } else { |
2840 | - $contracterror[$object->id]=$object->ref; |
|
2840 | + $contracterror[$object->id] = $object->ref; |
|
2841 | 2841 | |
2842 | 2842 | $error++; |
2843 | 2843 | $errorforlocaltransaction++; |
2844 | 2844 | $this->error = $this->db->lasterror(); |
2845 | 2845 | } |
2846 | 2846 | |
2847 | - if (! $errorforlocaltransaction) { |
|
2847 | + if (!$errorforlocaltransaction) { |
|
2848 | 2848 | $this->db->commit(); |
2849 | 2849 | } else { |
2850 | 2850 | $this->db->rollback(); |
@@ -2863,9 +2863,9 @@ discard block |
||
2863 | 2863 | $this->error = $this->db->lasterror(); |
2864 | 2864 | } |
2865 | 2865 | |
2866 | - $this->output .= count($contractlineprocessed).' contract line(s) with end date before '.dol_print_date($enddatetoscan, 'day').' were renewed'.(count($contractlineprocessed)>0 ? ' : '.join(',', $contractlineprocessed) : ''); |
|
2866 | + $this->output .= count($contractlineprocessed).' contract line(s) with end date before '.dol_print_date($enddatetoscan, 'day').' were renewed'.(count($contractlineprocessed) > 0 ? ' : '.join(',', $contractlineprocessed) : ''); |
|
2867 | 2867 | |
2868 | - return ($error ? 1: 0); |
|
2868 | + return ($error ? 1 : 0); |
|
2869 | 2869 | } |
2870 | 2870 | |
2871 | 2871 | /** |
@@ -3199,7 +3199,7 @@ discard block |
||
3199 | 3199 | } |
3200 | 3200 | |
3201 | 3201 | $link = '<a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$this->fk_contrat.'"'; |
3202 | - $link .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
3202 | + $link .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
3203 | 3203 | $link .= $dataparams.' class="'.$classfortooltip.'">'; |
3204 | 3204 | $linkend = '</a>'; |
3205 | 3205 |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $disablejs = 0; |
70 | 70 | $disablehead = 0; |
71 | 71 | |
72 | -$head='<link rel="stylesheet" href="css/pos.css.php">'; |
|
72 | +$head = '<link rel="stylesheet" href="css/pos.css.php">'; |
|
73 | 73 | if (getDolGlobalInt('TAKEPOS_COLOR_THEME') == 1) { |
74 | 74 | $head .= '<link rel="stylesheet" href="css/colorful.css">'; |
75 | 75 | } |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | |
678 | 678 | <?php |
679 | 679 | // Add code from hooks |
680 | -$parameters=array(); |
|
680 | +$parameters = array(); |
|
681 | 681 | $hookmanager->executeHooks('completePayment', $parameters, $invoice); |
682 | 682 | print $hookmanager->resPrint; |
683 | 683 | ?> |
@@ -231,7 +231,9 @@ discard block |
||
231 | 231 | $arrayOfValidPaymentModes[] = $obj; |
232 | 232 | } |
233 | 233 | if (!isModEnabled('banque')) { |
234 | - if ($paycode == 'CASH' || $paycode == 'CB') $arrayOfValidPaymentModes[] = $obj; |
|
234 | + if ($paycode == 'CASH' || $paycode == 'CB') { |
|
235 | + $arrayOfValidPaymentModes[] = $obj; |
|
236 | + } |
|
235 | 237 | } |
236 | 238 | } |
237 | 239 | } |
@@ -338,7 +340,9 @@ discard block |
||
338 | 340 | const bodyContent = JSON.stringify({ amount : amount, invoiceid : invoiceid }); |
339 | 341 | <?php |
340 | 342 | $urlpaymentintent = DOL_URL_ROOT.'/stripe/ajax/ajax.php?action=createPaymentIntent&token='.newToken().'&servicestatus='.$servicestatus; |
341 | - if (!empty($stripeacc)) $urlpaymentintent .= '&stripeacc='.$stripeacc; |
|
343 | + if (!empty($stripeacc)) { |
|
344 | + $urlpaymentintent .= '&stripeacc='.$stripeacc; |
|
345 | + } |
|
342 | 346 | ?> |
343 | 347 | return fetch('<?php echo $urlpaymentintent; ?>', { |
344 | 348 | method: "POST", |
@@ -668,7 +672,9 @@ discard block |
||
668 | 672 | |
669 | 673 | $parameters = array(); |
670 | 674 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $invoice, $action); // Note that $action and $object may have been modified by hook |
671 | -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
675 | +if ($reshook < 0) { |
|
676 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
677 | +} |
|
672 | 678 | |
673 | 679 | $class = ($i == 3) ? "calcbutton3" : "calcbutton2"; |
674 | 680 | foreach ($action_buttons as $button) { |
@@ -161,21 +161,21 @@ |
||
161 | 161 | if (isModEnabled('societe')) { |
162 | 162 | print '<tr class="oddeven"><td>'.$langs->trans("LDAPDnContactActive").'</td><td>'; |
163 | 163 | print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_CONTACT_ACTIVE'), 'activecontact', array(Ldap::SYNCHRO_LDAP_TO_DOLIBARR)); |
164 | - print '</td><td><span class="opacitymedium">' . $langs->trans("LDAPDnContactActiveExample") . '</span></td></tr>'; |
|
164 | + print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnContactActiveExample").'</span></td></tr>'; |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | // Synchro member active |
168 | 168 | if (isModEnabled('adherent')) { |
169 | - print '<tr class="oddeven"><td>' . $langs->trans("LDAPDnMemberActive") . '</td><td>'; |
|
169 | + print '<tr class="oddeven"><td>'.$langs->trans("LDAPDnMemberActive").'</td><td>'; |
|
170 | 170 | print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_MEMBER_ACTIVE'), 'activemembers', array(), 2); |
171 | - print '</td><td><span class="opacitymedium">' . $langs->trans("LDAPDnMemberActiveExample") . '</span></td></tr>'; |
|
171 | + print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnMemberActiveExample").'</span></td></tr>'; |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | // Synchro member type active |
175 | 175 | if (isModEnabled('adherent')) { |
176 | - print '<tr class="oddeven"><td>' . $langs->trans("LDAPDnMemberTypeActive") . '</td><td>'; |
|
176 | + print '<tr class="oddeven"><td>'.$langs->trans("LDAPDnMemberTypeActive").'</td><td>'; |
|
177 | 177 | print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_MEMBER_TYPE_ACTIVE'), 'activememberstypes', array(), 2); |
178 | - print '</td><td><span class="opacitymedium">' . $langs->trans("LDAPDnMemberTypeActiveExample") . '</span></td></tr>'; |
|
178 | + print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnMemberTypeActiveExample").'</span></td></tr>'; |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | // Fields from hook |
@@ -348,15 +348,15 @@ discard block |
||
348 | 348 | print '</td><td>'; |
349 | 349 | // SuperAdministrator access only |
350 | 350 | if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
351 | - print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="' . $mainserver . '">'; |
|
352 | - print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="' . $mainserver . '">'; |
|
353 | - print '<span id="smtp_server_mess" class="opacitymedium">' . $langs->trans("SeeLocalSendMailSetup") . '</span>'; |
|
354 | - print ' <span class="opacitymedium smtp_method">' . $langs->trans("SeeLinkToOnlineDocumentation") . '</span>'; |
|
351 | + print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="'.$mainserver.'">'; |
|
352 | + print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="'.$mainserver.'">'; |
|
353 | + print '<span id="smtp_server_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>'; |
|
354 | + print ' <span class="opacitymedium smtp_method">'.$langs->trans("SeeLinkToOnlineDocumentation").'</span>'; |
|
355 | 355 | } else { |
356 | 356 | $text = !empty($mainserver) ? $mainserver : $smtpserver; |
357 | 357 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
358 | 358 | print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); |
359 | - print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="' . $mainserver . '">'; |
|
359 | + print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="'.$mainserver.'">'; |
|
360 | 360 | } |
361 | 361 | print '</td>'; |
362 | 362 | } |
@@ -380,14 +380,14 @@ discard block |
||
380 | 380 | print '</td><td>'; |
381 | 381 | // SuperAdministrator access only |
382 | 382 | if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
383 | - print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="' . $mainport . '">'; |
|
384 | - print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="' . $mainport . '">'; |
|
385 | - print '<span id="smtp_port_mess" class="opacitymedium">' . $langs->trans("SeeLocalSendMailSetup") . '</span>'; |
|
383 | + print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="'.$mainport.'">'; |
|
384 | + print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="'.$mainport.'">'; |
|
385 | + print '<span id="smtp_port_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>'; |
|
386 | 386 | } else { |
387 | 387 | $text = (!empty($mainport) ? $mainport : $smtpport); |
388 | 388 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
389 | 389 | print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); |
390 | - print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" value="' . $mainport . '">'; |
|
390 | + print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" value="'.$mainport.'">'; |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 | print '</td></tr>'; |
@@ -395,14 +395,14 @@ discard block |
||
395 | 395 | // ID |
396 | 396 | if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { |
397 | 397 | $mainstmpid = (!empty($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING) ? $conf->global->MAIN_MAIL_SMTPS_ID_EMAILING : ''); |
398 | - print '<tr class="drag drop oddeven hideifdefault"><td>' . $langs->trans("MAIN_MAIL_SMTPS_ID") . '</td><td>'; |
|
398 | + print '<tr class="drag drop oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>'; |
|
399 | 399 | // SuperAdministrator access only |
400 | 400 | if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
401 | - print '<input class="flat" name="MAIN_MAIL_SMTPS_ID_EMAILING" size="32" value="' . $mainstmpid . '">'; |
|
401 | + print '<input class="flat" name="MAIN_MAIL_SMTPS_ID_EMAILING" size="32" value="'.$mainstmpid.'">'; |
|
402 | 402 | } else { |
403 | 403 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
404 | 404 | print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING, $htmltext, 1, 'superadmin'); |
405 | - print '<input type="hidden" name="MAIN_MAIL_SMTPS_ID_EMAILING" value="' . $mainstmpid . '">'; |
|
405 | + print '<input type="hidden" name="MAIN_MAIL_SMTPS_ID_EMAILING" value="'.$mainstmpid.'">'; |
|
406 | 406 | } |
407 | 407 | print '</td></tr>'; |
408 | 408 | } |
@@ -428,14 +428,14 @@ discard block |
||
428 | 428 | // PW |
429 | 429 | if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { |
430 | 430 | $mainsmtppw = (!empty($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING) ? $conf->global->MAIN_MAIL_SMTPS_PW_EMAILING : ''); |
431 | - print '<tr class="drag drop oddeven smtp_pw hideifdefault"><td>' . $langs->trans("MAIN_MAIL_SMTPS_PW") . '</td><td>'; |
|
431 | + print '<tr class="drag drop oddeven smtp_pw hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_PW").'</td><td>'; |
|
432 | 432 | // SuperAdministrator access only |
433 | 433 | if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
434 | - print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW_EMAILING" size="32" value="' . $mainsmtppw . '">'; |
|
434 | + print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW_EMAILING" size="32" value="'.$mainsmtppw.'">'; |
|
435 | 435 | } else { |
436 | 436 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
437 | 437 | print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING, $htmltext, 1, 'superadmin'); |
438 | - print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW_EMAILING" value="' . $mainsmtppw . '">'; |
|
438 | + print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW_EMAILING" value="'.$mainsmtppw.'">'; |
|
439 | 439 | } |
440 | 440 | print '</td></tr>'; |
441 | 441 | } |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | // AUTH method |
553 | 553 | if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { |
554 | 554 | $authtype = getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING', 'LOGIN'); |
555 | - $text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : '') ; |
|
555 | + $text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : ''); |
|
556 | 556 | print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").'</td><td>'.$text.'</td></tr>'; |
557 | 557 | } |
558 | 558 | |
@@ -641,16 +641,16 @@ discard block |
||
641 | 641 | if (!empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') { |
642 | 642 | if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'mail' || !$linuxlike) { |
643 | 643 | if (function_exists('fsockopen') && $port && $server) { |
644 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=testconnect">' . $langs->trans("DoTestServerAvailability") . '</a>'; |
|
644 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect">'.$langs->trans("DoTestServerAvailability").'</a>'; |
|
645 | 645 | } |
646 | 646 | } else { |
647 | - print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("FeatureNotAvailableOnLinux") . '">' . $langs->trans("DoTestServerAvailability") . '</a>'; |
|
647 | + print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>'; |
|
648 | 648 | } |
649 | 649 | |
650 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=test&mode=init">' . $langs->trans("DoTestSend") . '</a>'; |
|
650 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&mode=init">'.$langs->trans("DoTestSend").'</a>'; |
|
651 | 651 | |
652 | 652 | if (isModEnabled('fckeditor')) { |
653 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=testhtml&mode=init">' . $langs->trans("DoTestSendHTML") . '</a>'; |
|
653 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testhtml&mode=init">'.$langs->trans("DoTestSendHTML").'</a>'; |
|
654 | 654 | } |
655 | 655 | } |
656 | 656 |
@@ -520,7 +520,7 @@ |
||
520 | 520 | // AUTH method |
521 | 521 | if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { |
522 | 522 | $authtype = getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET', 'LOGIN'); |
523 | - $text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : '') ; |
|
523 | + $text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : ''); |
|
524 | 524 | print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").'</td><td>'.$text.'</td></tr>'; |
525 | 525 | } |
526 | 526 |