@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | } |
344 | 344 | |
345 | 345 | $usercanedit = $user->rights->website->write; |
346 | -$permissiontoadd = $user->rights->website->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
346 | +$permissiontoadd = $user->rights->website->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
347 | 347 | $permissiontodelete = $user->hasRight('website', 'delete'); |
348 | 348 | |
349 | 349 | |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | if ($sortorder) { |
410 | 410 | $backtopage .= '&sortorder='.urlencode($sortorder); |
411 | 411 | } |
412 | -include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file. |
|
412 | +include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file. |
|
413 | 413 | |
414 | 414 | $backtopage = $savbacktopage; |
415 | 415 | //var_dump($backtopage); |
@@ -1488,7 +1488,7 @@ discard block |
||
1488 | 1488 | $error++; |
1489 | 1489 | setEventMessages($langs->trans('ErrorFaviconMustBeASquaredImage'), array(), 'errors'); |
1490 | 1490 | } |
1491 | - if (! $error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) { |
|
1491 | + if (!$error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) { |
|
1492 | 1492 | $error++; |
1493 | 1493 | setEventMessages($langs->trans('ErrorFaviconSize'), array(), 'errors'); |
1494 | 1494 | } |
@@ -1500,7 +1500,7 @@ discard block |
||
1500 | 1500 | if (!GETPOSTISSET('updateandstay')) { // If we click on "Save And Stay", we don not make the redirect |
1501 | 1501 | $action = 'preview'; |
1502 | 1502 | if ($backtopage) { |
1503 | - $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1503 | + $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1504 | 1504 | header("Location: ".$backtopage); |
1505 | 1505 | exit; |
1506 | 1506 | } |
@@ -1533,7 +1533,7 @@ discard block |
||
1533 | 1533 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1534 | 1534 | |
1535 | 1535 | // Security analysis |
1536 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1536 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1537 | 1537 | |
1538 | 1538 | if (!$errorphpcheck) { |
1539 | 1539 | $htmlheadercontent = ''; |
@@ -1571,7 +1571,7 @@ discard block |
||
1571 | 1571 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1572 | 1572 | |
1573 | 1573 | // Security analysis |
1574 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1574 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1575 | 1575 | |
1576 | 1576 | if (!$errorphpcheck) { |
1577 | 1577 | $csscontent = ''; |
@@ -1614,7 +1614,7 @@ discard block |
||
1614 | 1614 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1615 | 1615 | |
1616 | 1616 | // Security analysis |
1617 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1617 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1618 | 1618 | |
1619 | 1619 | if (!$errorphpcheck) { |
1620 | 1620 | $jscontent = ''; |
@@ -1652,7 +1652,7 @@ discard block |
||
1652 | 1652 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1653 | 1653 | |
1654 | 1654 | // Security analysis |
1655 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1655 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1656 | 1656 | |
1657 | 1657 | if (!$errorphpcheck) { |
1658 | 1658 | $robotcontent = ''; |
@@ -1690,7 +1690,7 @@ discard block |
||
1690 | 1690 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1691 | 1691 | |
1692 | 1692 | // Security analysis |
1693 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1693 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1694 | 1694 | |
1695 | 1695 | if (!$errorphpcheck) { |
1696 | 1696 | $htaccesscontent = ''; |
@@ -1714,7 +1714,7 @@ discard block |
||
1714 | 1714 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1715 | 1715 | |
1716 | 1716 | // Security analysis |
1717 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1717 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1718 | 1718 | |
1719 | 1719 | if (!$errorphpcheck) { |
1720 | 1720 | $manifestjsoncontent = ''; |
@@ -1752,7 +1752,7 @@ discard block |
||
1752 | 1752 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1753 | 1753 | |
1754 | 1754 | // Security analysis |
1755 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1755 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1756 | 1756 | |
1757 | 1757 | if (!$errorphpcheck) { |
1758 | 1758 | $readmecontent = ''; |
@@ -1790,7 +1790,7 @@ discard block |
||
1790 | 1790 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1791 | 1791 | |
1792 | 1792 | // Security analysis |
1793 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1793 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1794 | 1794 | |
1795 | 1795 | if (!$errorphpcheck) { |
1796 | 1796 | $licensecontent = ''; |
@@ -1832,7 +1832,7 @@ discard block |
||
1832 | 1832 | if (!GETPOSTISSET('updateandstay')) { // If we click on "Save And Stay", we don not make the redirect |
1833 | 1833 | $action = 'preview'; |
1834 | 1834 | if ($backtopage) { |
1835 | - $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1835 | + $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1836 | 1836 | header("Location: ".$backtopage); |
1837 | 1837 | exit; |
1838 | 1838 | } |
@@ -1851,7 +1851,7 @@ discard block |
||
1851 | 1851 | |
1852 | 1852 | $object->fk_default_home = $pageid; |
1853 | 1853 | $res = $object->update($user); |
1854 | - if (! ($res > 0)) { |
|
1854 | + if (!($res > 0)) { |
|
1855 | 1855 | $error++; |
1856 | 1856 | setEventMessages($object->error, $object->errors, 'errors'); |
1857 | 1857 | } |
@@ -2238,7 +2238,7 @@ discard block |
||
2238 | 2238 | |
2239 | 2239 | $phpfullcodestringold = dolKeepOnlyPhpCode($objectpage->content); |
2240 | 2240 | |
2241 | - $objectpage->content = GETPOST('PAGE_CONTENT', 'none'); // any HTML content allowed |
|
2241 | + $objectpage->content = GETPOST('PAGE_CONTENT', 'none'); // any HTML content allowed |
|
2242 | 2242 | |
2243 | 2243 | $phpfullcodestring = dolKeepOnlyPhpCode($objectpage->content); |
2244 | 2244 | |
@@ -2432,7 +2432,7 @@ discard block |
||
2432 | 2432 | $fileofzip = ''; |
2433 | 2433 | if (GETPOSTISSET('templateuserfile')) { |
2434 | 2434 | // Case we selected one template |
2435 | - $fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha'); // $fileofzip will be sanitized later into the importWebSite() |
|
2435 | + $fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha'); // $fileofzip will be sanitized later into the importWebSite() |
|
2436 | 2436 | } elseif (!empty($_FILES) && is_array($_FILES['userfile'])) { |
2437 | 2437 | // Case we upload a new template |
2438 | 2438 | if (is_array($_FILES['userfile']['tmp_name'])) { |
@@ -2511,7 +2511,7 @@ discard block |
||
2511 | 2511 | if ($website->virtualhost) { |
2512 | 2512 | $domainname = $website->virtualhost; |
2513 | 2513 | } |
2514 | - if (! preg_match('/^http/i', $domainname)) { |
|
2514 | + if (!preg_match('/^http/i', $domainname)) { |
|
2515 | 2515 | $domainname = 'https://'.$domainname; |
2516 | 2516 | } |
2517 | 2517 | |
@@ -2577,7 +2577,7 @@ discard block |
||
2577 | 2577 | $url->appendChild($lastmod); |
2578 | 2578 | // Add suggested frequency for refresh |
2579 | 2579 | if (!empty($conf->global->WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ)) { |
2580 | - $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2580 | + $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2581 | 2581 | $url->appendChild($changefreq); |
2582 | 2582 | } |
2583 | 2583 | // Add higher priority for home page |
@@ -2682,7 +2682,7 @@ discard block |
||
2682 | 2682 | $url->appendChild($lastmod); |
2683 | 2683 | // Add suggested frequency for refresh |
2684 | 2684 | if (!empty($conf->global->WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ)) { |
2685 | - $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2685 | + $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2686 | 2686 | $url->appendChild($changefreq); |
2687 | 2687 | } |
2688 | 2688 | |
@@ -2764,7 +2764,7 @@ discard block |
||
2764 | 2764 | |
2765 | 2765 | print "\n"; |
2766 | 2766 | print '<!-- Open form for all page -->'."\n"; |
2767 | -print '<form action="'.$_SERVER["PHP_SELF"].($action == 'file_manager' ? '?uploadform=1': '').'" method="POST" enctype="multipart/form-data" class="websiteformtoolbar">'; |
|
2767 | +print '<form action="'.$_SERVER["PHP_SELF"].($action == 'file_manager' ? '?uploadform=1' : '').'" method="POST" enctype="multipart/form-data" class="websiteformtoolbar">'; |
|
2768 | 2768 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
2769 | 2769 | print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
2770 | 2770 | print '<input type="hidden" name="dol_openinpopup" value="'.$dol_openinpopup.'">'; |
@@ -3266,7 +3266,7 @@ discard block |
||
3266 | 3266 | $formquestion[] = array('type' => 'checkbox', 'tdclass'=>'maxwidth200', 'name' => 'is_a_translation', 'label' => $langs->trans("PageIsANewTranslation"), 'value' => 0, 'morecss'=>'margintoponly'); |
3267 | 3267 | } |
3268 | 3268 | |
3269 | - $value= $formadmin->select_language($preselectedlanguage, 'newlang', 0, null, $textifempty, 0, 0, 'minwidth200', 1, 0, 0, $onlylang, 1); |
|
3269 | + $value = $formadmin->select_language($preselectedlanguage, 'newlang', 0, null, $textifempty, 0, 0, 'minwidth200', 1, 0, 0, $onlylang, 1); |
|
3270 | 3270 | $formquestion[] = array('type' => 'other', 'name' => 'newlang', 'label' => $form->textwithpicto($langs->trans("Language"), $langs->trans("DefineListOfAltLanguagesInWebsiteProperties")), 'value' => $value); |
3271 | 3271 | |
3272 | 3272 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid, $langs->trans('ClonePage'), '', 'confirm_createpagefromclone', $formquestion, 0, 1, 300, 550); |
@@ -3294,7 +3294,7 @@ discard block |
||
3294 | 3294 | print '<!-- button EditInLine and ShowSubcontainers -->'."\n"; |
3295 | 3295 | print '<div class="websiteselectionsection inline-block">'; |
3296 | 3296 | |
3297 | - print '<div class="inline-block marginrightonly">'; // Button include dynamic contant |
|
3297 | + print '<div class="inline-block marginrightonly">'; // Button include dynamic contant |
|
3298 | 3298 | print $langs->trans("ShowSubcontainers"); |
3299 | 3299 | if (empty($conf->global->WEBSITE_SUBCONTAINERSINLINE)) { |
3300 | 3300 | print '<a class="nobordertransp nohoverborder marginleftonlyshort valignmiddle"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=setshowsubcontainers&token='.newToken().'">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', false, 0, 0, '', 'nomarginleft').'</a>'; |
@@ -3303,7 +3303,7 @@ discard block |
||
3303 | 3303 | } |
3304 | 3304 | print '</div>'; |
3305 | 3305 | |
3306 | - print '<div class="inline-block marginrightonly">'; // Button edit inline |
|
3306 | + print '<div class="inline-block marginrightonly">'; // Button edit inline |
|
3307 | 3307 | |
3308 | 3308 | print '<span id="switchckeditorinline">'."\n"; |
3309 | 3309 | // Enable CKEditor inline with js on section and div with conteneditable=true |
@@ -3421,7 +3421,7 @@ discard block |
||
3421 | 3421 | } else { |
3422 | 3422 | $disabled = ''; |
3423 | 3423 | $title = ''; |
3424 | - $url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref); // action=delete for webpage, deletesite for website |
|
3424 | + $url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref); // action=delete for webpage, deletesite for website |
|
3425 | 3425 | } |
3426 | 3426 | print '<a href="'.$url.'" class="button buttonDelete bordertransp'.($disabled ? ' disabled' : '').'"'.$disabled.' title="'.dol_escape_htmltag($title).'">'.img_picto('', 'delete', 'class=""').'<span class="hideonsmartphone paddingleft">'.$langs->trans("Delete").'</span></a>'; |
3427 | 3427 | print '</span>'; |
@@ -3626,7 +3626,7 @@ discard block |
||
3626 | 3626 | // Clean the php htaccesscontent file to remove php code and get only html part |
3627 | 3627 | $htaccesscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $htaccesscontent); |
3628 | 3628 | } else { |
3629 | - $htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " |
|
3629 | + $htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " |
|
3630 | 3630 | } |
3631 | 3631 | if (!trim($htaccesscontent)) { |
3632 | 3632 | $htaccesscontent .= "# Order allow,deny\n"; |
@@ -3728,7 +3728,7 @@ discard block |
||
3728 | 3728 | $maxfilesizearray = getMaxFileSizeArray(); |
3729 | 3729 | $maxmin = $maxfilesizearray['maxmin']; |
3730 | 3730 | if ($maxmin > 0) { |
3731 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
3731 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
3732 | 3732 | } |
3733 | 3733 | print '<input type="file" class="flat minwidth300" name="addedfile" id="addedfile"/>'; |
3734 | 3734 | |
@@ -3984,7 +3984,7 @@ discard block |
||
3984 | 3984 | $maxfilesizearray = getMaxFileSizeArray(); |
3985 | 3985 | $maxmin = $maxfilesizearray['maxmin']; |
3986 | 3986 | if ($maxmin > 0) { |
3987 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
3987 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
3988 | 3988 | } |
3989 | 3989 | print '<input class="flat minwidth400" type="file" name="userfile[]" accept=".zip">'; |
3990 | 3990 | print '<input type="submit" class="button small" name="buttonsubmitimportfile" value="'.dol_escape_htmltag($langs->trans("Upload")).'">'; |
@@ -4503,7 +4503,7 @@ discard block |
||
4503 | 4503 | |
4504 | 4504 | |
4505 | 4505 | $module = 'medias'; |
4506 | - $formalreadyopen = 2; // So the form to submit a new file will not be opened another time inside the core/tpl/filemanager.tpl.php |
|
4506 | + $formalreadyopen = 2; // So the form to submit a new file will not be opened another time inside the core/tpl/filemanager.tpl.php |
|
4507 | 4507 | if (empty($url)) { |
4508 | 4508 | $url = DOL_URL_ROOT.'/website/index.php'; // Must be an url without param |
4509 | 4509 | } |
@@ -4556,7 +4556,7 @@ discard block |
||
4556 | 4556 | |
4557 | 4557 | require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
4558 | 4558 | $poscursor = array('x'=>GETPOST('PAGE_CONTENT_x'), 'y'=>GETPOST('PAGE_CONTENT_y')); |
4559 | - $doleditor=new DolEditor('PAGE_CONTENT', $contentforedit, '', 500, 'Full', '', true, true, true, ROWS_5, '90%', 0, $poscursor); |
|
4559 | + $doleditor = new DolEditor('PAGE_CONTENT', $contentforedit, '', 500, 'Full', '', true, true, true, ROWS_5, '90%', 0, $poscursor); |
|
4560 | 4560 | $doleditor->Create(0, '', false); |
4561 | 4561 | } |
4562 | 4562 | |
@@ -4734,7 +4734,7 @@ discard block |
||
4734 | 4734 | print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF']); |
4735 | 4735 | print getTitleFieldOfList("Language", 0, $_SERVER['PHP_SELF'], 'lang', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; |
4736 | 4736 | print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); |
4737 | - print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif |
|
4737 | + print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif |
|
4738 | 4738 | print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); |
4739 | 4739 | print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; |
4740 | 4740 | print '</tr>'; |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | $this->mode_reglement_id = 0; |
462 | 462 | } |
463 | 463 | $this->status = self::STATUS_DRAFT; |
464 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
464 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
465 | 465 | |
466 | 466 | if (!empty($this->multicurrency_code)) { |
467 | 467 | // Multicurrency (test on $this->multicurrency_tx because we should take the default rate of multicurrency_code only if not using original rate) |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | $this->mode_reglement_id = 0; |
563 | 563 | } |
564 | 564 | $this->status = self::STATUS_DRAFT; |
565 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
565 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
566 | 566 | |
567 | 567 | $this->linked_objects = $_facrec->linkedObjectsIds; |
568 | 568 | // We do not add link to template invoice or next invoice will be linked to all generated invoices |
@@ -807,7 +807,7 @@ discard block |
||
807 | 807 | |
808 | 808 | // Complete vat rate with code |
809 | 809 | $vatrate = $newinvoiceline->tva_tx; |
810 | - if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$newinvoiceline->vat_src_code.')'; |
|
810 | + if ($newinvoiceline->vat_src_code && !preg_match('/\(.*\)/', $vatrate)) $vatrate .= ' ('.$newinvoiceline->vat_src_code.')'; |
|
811 | 811 | |
812 | 812 | $newinvoiceline->fk_parent_line = $fk_parent_line; |
813 | 813 | |
@@ -1037,7 +1037,7 @@ discard block |
||
1037 | 1037 | $buyprice, |
1038 | 1038 | $_facrec->lines[$i]->label, |
1039 | 1039 | empty($_facrec->lines[$i]->array_options) ?null:$_facrec->lines[$i]->array_options, |
1040 | - 100, // situation percent is undefined on recurring invoice lines |
|
1040 | + 100, // situation percent is undefined on recurring invoice lines |
|
1041 | 1041 | '', |
1042 | 1042 | $_facrec->lines[$i]->fk_unit, |
1043 | 1043 | $_facrec->lines[$i]->multicurrency_subprice, |
@@ -1133,7 +1133,7 @@ discard block |
||
1133 | 1133 | |
1134 | 1134 | $facture->fk_facture_source = $this->fk_facture_source; |
1135 | 1135 | $facture->type = $this->type; |
1136 | - $facture->subtype = $this->subtype; |
|
1136 | + $facture->subtype = $this->subtype; |
|
1137 | 1137 | $facture->socid = $this->socid; |
1138 | 1138 | $facture->date = $this->date; |
1139 | 1139 | $facture->date_pointoftax = $this->date_pointoftax; |
@@ -1149,7 +1149,7 @@ discard block |
||
1149 | 1149 | |
1150 | 1150 | $facture->origin = $this->origin; |
1151 | 1151 | $facture->origin_id = $this->origin_id; |
1152 | - $facture->fk_account = $this->fk_account; |
|
1152 | + $facture->fk_account = $this->fk_account; |
|
1153 | 1153 | |
1154 | 1154 | $facture->lines = $this->lines; // Array of lines of invoice |
1155 | 1155 | $facture->situation_counter = $this->situation_counter; |
@@ -1620,7 +1620,7 @@ discard block |
||
1620 | 1620 | { |
1621 | 1621 | global $conf, $langs, $hookmanager, $action; |
1622 | 1622 | |
1623 | - if (! in_array($origin->element, array('propal', 'commande'))) { |
|
1623 | + if (!in_array($origin->element, array('propal', 'commande'))) { |
|
1624 | 1624 | $origin->error = 'ErrorCanOnlyAutomaticallyGenerateADepositFromProposalOrOrder'; |
1625 | 1625 | return null; |
1626 | 1626 | } |
@@ -1630,7 +1630,7 @@ discard block |
||
1630 | 1630 | return null; |
1631 | 1631 | } |
1632 | 1632 | |
1633 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
1633 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
1634 | 1634 | |
1635 | 1635 | if ($date > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { |
1636 | 1636 | $origin->error = 'ErrorDateIsInFuture'; |
@@ -1674,7 +1674,7 @@ discard block |
||
1674 | 1674 | $deposit->pos_source = $origin->pos_source; |
1675 | 1675 | $deposit->model_pdf = 'crabe'; |
1676 | 1676 | |
1677 | - $modelByTypeConfName = 'FACTURE_ADDON_PDF_' . $deposit->type; |
|
1677 | + $modelByTypeConfName = 'FACTURE_ADDON_PDF_'.$deposit->type; |
|
1678 | 1678 | |
1679 | 1679 | if (!empty($conf->global->$modelByTypeConfName)) { |
1680 | 1680 | $deposit->model_pdf = $conf->global->$modelByTypeConfName; |
@@ -1729,10 +1729,10 @@ discard block |
||
1729 | 1729 | continue; |
1730 | 1730 | } |
1731 | 1731 | $TTotalByTva[$line->tva_tx] += $line->total_ttc; |
1732 | - $descriptions[$line->tva_tx] .= '<li>' . (!empty($line->product_ref) ? $line->product_ref . ' - ' : ''); |
|
1733 | - $descriptions[$line->tva_tx] .= (!empty($line->product_label) ? $line->product_label . ' - ' : ''); |
|
1734 | - $descriptions[$line->tva_tx] .= $langs->trans('Qty') . ' : ' . $line->qty; |
|
1735 | - $descriptions[$line->tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($line->total_ht) . '</li>'; |
|
1732 | + $descriptions[$line->tva_tx] .= '<li>'.(!empty($line->product_ref) ? $line->product_ref.' - ' : ''); |
|
1733 | + $descriptions[$line->tva_tx] .= (!empty($line->product_label) ? $line->product_label.' - ' : ''); |
|
1734 | + $descriptions[$line->tva_tx] .= $langs->trans('Qty').' : '.$line->qty; |
|
1735 | + $descriptions[$line->tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($line->total_ht).'</li>'; |
|
1736 | 1736 | } |
1737 | 1737 | |
1738 | 1738 | foreach ($TTotalByTva as $tva => &$total) { |
@@ -1756,10 +1756,10 @@ discard block |
||
1756 | 1756 | $totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ? |
1757 | 1757 | $tva_tx = $lines[$i]->tva_tx; |
1758 | 1758 | $amountdeposit[$tva_tx] += ($lines[$i]->total_ht * $origin->deposit_percent) / 100; |
1759 | - $descriptions[$tva_tx] .= '<li>' . (!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref . ' - ' : ''); |
|
1760 | - $descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label . ' - ' : ''); |
|
1761 | - $descriptions[$tva_tx] .= $langs->trans('Qty') . ' : ' . $lines[$i]->qty; |
|
1762 | - $descriptions[$tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($lines[$i]->total_ht) . '</li>'; |
|
1759 | + $descriptions[$tva_tx] .= '<li>'.(!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref.' - ' : ''); |
|
1760 | + $descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label.' - ' : ''); |
|
1761 | + $descriptions[$tva_tx] .= $langs->trans('Qty').' : '.$lines[$i]->qty; |
|
1762 | + $descriptions[$tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($lines[$i]->total_ht).'</li>'; |
|
1763 | 1763 | } |
1764 | 1764 | |
1765 | 1765 | if ($totalamount == 0) { |
@@ -1774,11 +1774,11 @@ discard block |
||
1774 | 1774 | continue; |
1775 | 1775 | } |
1776 | 1776 | |
1777 | - $descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref; |
|
1777 | + $descline = '(DEPOSIT) ('.$origin->deposit_percent.'%) - '.$origin->ref; |
|
1778 | 1778 | |
1779 | 1779 | // Hidden conf |
1780 | 1780 | if (!empty($conf->global->INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION) && !empty($descriptions[$tva])) { |
1781 | - $descline .= '<ul>' . $descriptions[$tva] . '</ul>'; |
|
1781 | + $descline .= '<ul>'.$descriptions[$tva].'</ul>'; |
|
1782 | 1782 | } |
1783 | 1783 | |
1784 | 1784 | $addlineResult = $deposit->addline( |
@@ -2040,7 +2040,7 @@ discard block |
||
2040 | 2040 | $label = $langs->trans("Invoice"); |
2041 | 2041 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
2042 | 2042 | } |
2043 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
2043 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
2044 | 2044 | $linkclose .= $dataparams.' class="'.$classfortooltip.'"'; |
2045 | 2045 | } |
2046 | 2046 | |
@@ -2151,9 +2151,9 @@ discard block |
||
2151 | 2151 | $this->id = $obj->rowid; |
2152 | 2152 | $this->entity = $obj->entity; |
2153 | 2153 | |
2154 | - $this->ref = $obj->ref; |
|
2155 | - $this->ref_client = $obj->ref_client; |
|
2156 | - $this->ref_customer = $obj->ref_client; |
|
2154 | + $this->ref = $obj->ref; |
|
2155 | + $this->ref_client = $obj->ref_client; |
|
2156 | + $this->ref_customer = $obj->ref_client; |
|
2157 | 2157 | $this->ref_ext = $obj->ref_ext; |
2158 | 2158 | $this->type = $obj->type; |
2159 | 2159 | $this->subtype = $obj->subtype; |
@@ -2179,7 +2179,7 @@ discard block |
||
2179 | 2179 | $this->fk_project = $obj->fk_project; |
2180 | 2180 | $this->project = null; // Clear if another value was already set by fetch_projet |
2181 | 2181 | |
2182 | - $this->statut = $obj->status; // deprecated |
|
2182 | + $this->statut = $obj->status; // deprecated |
|
2183 | 2183 | $this->status = $obj->status; |
2184 | 2184 | |
2185 | 2185 | $this->date_lim_reglement = $this->db->jdate($obj->dlr); |
@@ -2195,7 +2195,7 @@ discard block |
||
2195 | 2195 | $this->fk_fac_rec_source = $obj->fk_fac_rec_source; |
2196 | 2196 | $this->note = $obj->note_private; // deprecated |
2197 | 2197 | $this->note_private = $obj->note_private; |
2198 | - $this->note_public = $obj->note_public; |
|
2198 | + $this->note_public = $obj->note_public; |
|
2199 | 2199 | $this->user_creation_id = $obj->fk_user_author; |
2200 | 2200 | $this->user_validation_id = $obj->fk_user_valid; |
2201 | 2201 | $this->user_modification_id = $obj->fk_user_modif; |
@@ -2311,7 +2311,7 @@ discard block |
||
2311 | 2311 | $line->ref = $objp->product_ref; // Ref product |
2312 | 2312 | $line->product_ref = $objp->product_ref; // Ref product |
2313 | 2313 | $line->libelle = $objp->product_label; // deprecated |
2314 | - $line->product_label = $objp->product_label; // Label product |
|
2314 | + $line->product_label = $objp->product_label; // Label product |
|
2315 | 2315 | $line->product_desc = $objp->product_desc; // Description product |
2316 | 2316 | $line->fk_product_type = $objp->fk_product_type; // Type of product |
2317 | 2317 | $line->qty = $objp->qty; |
@@ -2606,7 +2606,7 @@ discard block |
||
2606 | 2606 | $facligne->rang = 1; |
2607 | 2607 | $linecount = count($this->lines); |
2608 | 2608 | for ($ii = 1; $ii <= $linecount; $ii++) { |
2609 | - $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii+1); |
|
2609 | + $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1); |
|
2610 | 2610 | } |
2611 | 2611 | } |
2612 | 2612 | |
@@ -3182,7 +3182,7 @@ discard block |
||
3182 | 3182 | if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->hasRight('facture', 'creer')) |
3183 | 3183 | || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->hasRight('facture', 'invoice_advance', 'validate'))) { |
3184 | 3184 | $this->error = 'Permission denied'; |
3185 | - dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS=' . getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR); |
|
3185 | + dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS='.getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR); |
|
3186 | 3186 | return -1; |
3187 | 3187 | } |
3188 | 3188 | if (!empty($conf->global-> INVOICE_CHECK_POSTERIOR_DATE)) { |
@@ -3526,7 +3526,7 @@ discard block |
||
3526 | 3526 | // Set new ref and define current status |
3527 | 3527 | if (!$error) { |
3528 | 3528 | $this->ref = $num; |
3529 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
3529 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
3530 | 3530 | $this->status = self::STATUS_VALIDATED; |
3531 | 3531 | $this->date_validation = $now; |
3532 | 3532 | $i = 0; |
@@ -3671,7 +3671,7 @@ discard block |
||
3671 | 3671 | |
3672 | 3672 | if ($error == 0) { |
3673 | 3673 | $old_statut = $this->status; |
3674 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
3674 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
3675 | 3675 | $this->status = self::STATUS_DRAFT; |
3676 | 3676 | |
3677 | 3677 | // Call trigger |
@@ -4002,7 +4002,7 @@ discard block |
||
4002 | 4002 | return -2; |
4003 | 4003 | } |
4004 | 4004 | } else { |
4005 | - $this->errors[]='status of invoice must be Draft to allow use of ->addline()'; |
|
4005 | + $this->errors[] = 'status of invoice must be Draft to allow use of ->addline()'; |
|
4006 | 4006 | dol_syslog(get_class($this)."::addline status of invoice must be Draft to allow use of ->addline()", LOG_ERR); |
4007 | 4007 | return -3; |
4008 | 4008 | } |
@@ -4568,7 +4568,7 @@ discard block |
||
4568 | 4568 | } |
4569 | 4569 | |
4570 | 4570 | if (!empty($addon)) { |
4571 | - dol_syslog("Call getNextNumRef with ".$addonConstName." = " . getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG); |
|
4571 | + dol_syslog("Call getNextNumRef with ".$addonConstName." = ".getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG); |
|
4572 | 4572 | |
4573 | 4573 | $mybool = false; |
4574 | 4574 | |
@@ -5638,14 +5638,14 @@ discard block |
||
5638 | 5638 | if (!empty($paymentmode) && $paymentmode != 'all') { |
5639 | 5639 | $sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp"; |
5640 | 5640 | } |
5641 | - $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
5642 | - $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status |
|
5641 | + $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
5642 | + $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status |
|
5643 | 5643 | if ($datetouse == 'invoicedate') { |
5644 | 5644 | $sql .= " AND f.datef = '".$this->db->idate($tmpidate, 'gmt')."'"; |
5645 | 5645 | } else { |
5646 | 5646 | $sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'"; |
5647 | 5647 | } |
5648 | - $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing) |
|
5648 | + $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing) |
|
5649 | 5649 | if (!empty($paymentmode) && $paymentmode != 'all') { |
5650 | 5650 | $sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'"; |
5651 | 5651 | } |
@@ -5853,7 +5853,7 @@ discard block |
||
5853 | 5853 | $actioncomm->create($user); |
5854 | 5854 | } |
5855 | 5855 | |
5856 | - $this->db->commit(); // We always commit |
|
5856 | + $this->db->commit(); // We always commit |
|
5857 | 5857 | } |
5858 | 5858 | |
5859 | 5859 | if ($errormesg) { |
@@ -5889,7 +5889,7 @@ discard block |
||
5889 | 5889 | // get date of last validated invoices of same type |
5890 | 5890 | $sql = "SELECT datef"; |
5891 | 5891 | $sql .= " FROM ".MAIN_DB_PREFIX."facture"; |
5892 | - $sql .= " WHERE type = " . (int) $this->type ; |
|
5892 | + $sql .= " WHERE type = ".(int) $this->type; |
|
5893 | 5893 | $sql .= " AND date_valid IS NOT NULL"; |
5894 | 5894 | $sql .= " AND entity IN (".getEntity('invoice').")"; |
5895 | 5895 | $sql .= " ORDER BY datef DESC LIMIT 1"; |
@@ -6079,7 +6079,7 @@ discard block |
||
6079 | 6079 | $objp = $this->db->fetch_object($result); |
6080 | 6080 | |
6081 | 6081 | if (!$objp) { |
6082 | - $this->error = 'InvoiceLine with id '. $rowid .' not found sql='.$sql; |
|
6082 | + $this->error = 'InvoiceLine with id '.$rowid.' not found sql='.$sql; |
|
6083 | 6083 | return 0; |
6084 | 6084 | } |
6085 | 6085 |
@@ -1,21 +1,21 @@ |
||
1 | 1 | #!/usr/bin/env php |
2 | 2 | <?php |
3 | 3 | |
4 | -$path = __DIR__ . '/'; |
|
4 | +$path = __DIR__.'/'; |
|
5 | 5 | |
6 | 6 | |
7 | -$res=@include_once $path.'/../htdocs/master.inc.php'; |
|
8 | -$res=@include_once $path.'/../../htdocs/master.inc.php'; |
|
9 | -if (! $res) @include_once '../../master.inc.php'; |
|
10 | -if (! $res) @include_once '../master.inc.php'; |
|
11 | -if (! $res) @include_once './master.inc.php'; |
|
7 | +$res = @include_once $path.'/../htdocs/master.inc.php'; |
|
8 | +$res = @include_once $path.'/../../htdocs/master.inc.php'; |
|
9 | +if (!$res) @include_once '../../master.inc.php'; |
|
10 | +if (!$res) @include_once '../master.inc.php'; |
|
11 | +if (!$res) @include_once './master.inc.php'; |
|
12 | 12 | |
13 | 13 | |
14 | 14 | // Show information |
15 | 15 | print "\n"; |
16 | 16 | print "*** PHP Version : ".PHP_VERSION." - Dolibarr Version : ".DOL_VERSION."\n"; |
17 | 17 | |
18 | -$a="Wéarning: Permanently added '1.2.3.4' (ECDSA) to the list of known hosts.<br> |
|
18 | +$a = "Wéarning: Permanently added '1.2.3.4' (ECDSA) to the list of known hosts.<br> |
|
19 | 19 | receiving file list ... done<br> |
20 | 20 | rsync: send_files failed to open "aaa: Permission denied (13)<br> |
21 | 21 | <br> |
@@ -6,9 +6,15 @@ |
||
6 | 6 | |
7 | 7 | $res=@include_once $path.'/../htdocs/master.inc.php'; |
8 | 8 | $res=@include_once $path.'/../../htdocs/master.inc.php'; |
9 | -if (! $res) @include_once '../../master.inc.php'; |
|
10 | -if (! $res) @include_once '../master.inc.php'; |
|
11 | -if (! $res) @include_once './master.inc.php'; |
|
9 | +if (! $res) { |
|
10 | + @include_once '../../master.inc.php'; |
|
11 | +} |
|
12 | +if (! $res) { |
|
13 | + @include_once '../master.inc.php'; |
|
14 | +} |
|
15 | +if (! $res) { |
|
16 | + @include_once './master.inc.php'; |
|
17 | +} |
|
12 | 18 | |
13 | 19 | |
14 | 20 | // Show information |