@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | $usercanedit = $user->hasRight('website', 'write'); |
| 356 | -$permissiontoadd = $user->hasRight('website', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
| 356 | +$permissiontoadd = $user->hasRight('website', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
| 357 | 357 | $permissiontodelete = $user->hasRight('website', 'delete'); |
| 358 | 358 | |
| 359 | 359 | |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | if ($sortorder) { |
| 421 | 421 | $backtopage .= '&sortorder='.urlencode($sortorder); |
| 422 | 422 | } |
| 423 | -include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file. |
|
| 423 | +include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file. |
|
| 424 | 424 | |
| 425 | 425 | $backtopage = $savbacktopage; |
| 426 | 426 | //var_dump($backtopage); |
@@ -1183,7 +1183,7 @@ discard block |
||
| 1183 | 1183 | $content = ''; |
| 1184 | 1184 | if (GETPOSTISSET('content')) { |
| 1185 | 1185 | //$content = GETPOST('content', 'restricthtmlallowunvalid'); // @TODO Use a restricthtmlallowunvalidwithphp |
| 1186 | - $content = GETPOST('content', 'none'); // @TODO Use a restricthtmlallowunvalidwithphp |
|
| 1186 | + $content = GETPOST('content', 'none'); // @TODO Use a restricthtmlallowunvalidwithphp |
|
| 1187 | 1187 | |
| 1188 | 1188 | $objectpage->content = make_substitutions($content, $substitutionarray); |
| 1189 | 1189 | } else { |
@@ -1556,7 +1556,7 @@ discard block |
||
| 1556 | 1556 | $error++; |
| 1557 | 1557 | setEventMessages($langs->trans('ErrorFaviconMustBeASquaredImage'), array(), 'errors'); |
| 1558 | 1558 | } |
| 1559 | - if (! $error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) { |
|
| 1559 | + if (!$error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) { |
|
| 1560 | 1560 | $error++; |
| 1561 | 1561 | setEventMessages($langs->trans('ErrorFaviconSize'), array(), 'errors'); |
| 1562 | 1562 | } |
@@ -1568,7 +1568,7 @@ discard block |
||
| 1568 | 1568 | if (!GETPOSTISSET('updateandstay')) { // If we click on "Save And Stay", we don not make the redirect |
| 1569 | 1569 | $action = 'preview'; |
| 1570 | 1570 | if ($backtopage) { |
| 1571 | - $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
| 1571 | + $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
| 1572 | 1572 | header("Location: ".$backtopage); |
| 1573 | 1573 | exit; |
| 1574 | 1574 | } |
@@ -1601,7 +1601,7 @@ discard block |
||
| 1601 | 1601 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
| 1602 | 1602 | |
| 1603 | 1603 | // Security analysis |
| 1604 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
| 1604 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
| 1605 | 1605 | |
| 1606 | 1606 | if (!$errorphpcheck) { |
| 1607 | 1607 | $htmlheadercontent = ''; |
@@ -1639,7 +1639,7 @@ discard block |
||
| 1639 | 1639 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
| 1640 | 1640 | |
| 1641 | 1641 | // Security analysis |
| 1642 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
| 1642 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
| 1643 | 1643 | |
| 1644 | 1644 | if (!$errorphpcheck) { |
| 1645 | 1645 | $csscontent = ''; |
@@ -1682,7 +1682,7 @@ discard block |
||
| 1682 | 1682 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
| 1683 | 1683 | |
| 1684 | 1684 | // Security analysis |
| 1685 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
| 1685 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
| 1686 | 1686 | |
| 1687 | 1687 | if (!$errorphpcheck) { |
| 1688 | 1688 | $jscontent = ''; |
@@ -1720,7 +1720,7 @@ discard block |
||
| 1720 | 1720 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
| 1721 | 1721 | |
| 1722 | 1722 | // Security analysis |
| 1723 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
| 1723 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
| 1724 | 1724 | |
| 1725 | 1725 | if (!$errorphpcheck) { |
| 1726 | 1726 | $robotcontent = ''; |
@@ -1758,7 +1758,7 @@ discard block |
||
| 1758 | 1758 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
| 1759 | 1759 | |
| 1760 | 1760 | // Security analysis |
| 1761 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
| 1761 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
| 1762 | 1762 | |
| 1763 | 1763 | if (!$errorphpcheck) { |
| 1764 | 1764 | $htaccesscontent = ''; |
@@ -1782,7 +1782,7 @@ discard block |
||
| 1782 | 1782 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
| 1783 | 1783 | |
| 1784 | 1784 | // Security analysis |
| 1785 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
| 1785 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
| 1786 | 1786 | |
| 1787 | 1787 | if (!$errorphpcheck) { |
| 1788 | 1788 | $manifestjsoncontent = ''; |
@@ -1821,7 +1821,7 @@ discard block |
||
| 1821 | 1821 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
| 1822 | 1822 | |
| 1823 | 1823 | // Security analysis |
| 1824 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
| 1824 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
| 1825 | 1825 | |
| 1826 | 1826 | if (!$errorphpcheck) { |
| 1827 | 1827 | $readmecontent = ''; |
@@ -1860,7 +1860,7 @@ discard block |
||
| 1860 | 1860 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
| 1861 | 1861 | |
| 1862 | 1862 | // Security analysis |
| 1863 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
| 1863 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
| 1864 | 1864 | |
| 1865 | 1865 | if (!$errorphpcheck) { |
| 1866 | 1866 | $licensecontent = ''; |
@@ -1902,7 +1902,7 @@ discard block |
||
| 1902 | 1902 | if (!GETPOSTISSET('updateandstay')) { // If we click on "Save And Stay", we don not make the redirect |
| 1903 | 1903 | $action = 'preview'; |
| 1904 | 1904 | if ($backtopage) { |
| 1905 | - $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
| 1905 | + $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
| 1906 | 1906 | header("Location: ".$backtopage); |
| 1907 | 1907 | exit; |
| 1908 | 1908 | } |
@@ -1921,7 +1921,7 @@ discard block |
||
| 1921 | 1921 | |
| 1922 | 1922 | $object->fk_default_home = $pageid; |
| 1923 | 1923 | $res = $object->update($user); |
| 1924 | - if (! ($res > 0)) { |
|
| 1924 | + if (!($res > 0)) { |
|
| 1925 | 1925 | $error++; |
| 1926 | 1926 | setEventMessages($object->error, $object->errors, 'errors'); |
| 1927 | 1927 | } |
@@ -2312,7 +2312,7 @@ discard block |
||
| 2312 | 2312 | |
| 2313 | 2313 | $phpfullcodestringold = dolKeepOnlyPhpCode($objectpage->content); |
| 2314 | 2314 | |
| 2315 | - $objectpage->content = GETPOST('PAGE_CONTENT', 'none'); // any HTML content allowed |
|
| 2315 | + $objectpage->content = GETPOST('PAGE_CONTENT', 'none'); // any HTML content allowed |
|
| 2316 | 2316 | |
| 2317 | 2317 | $phpfullcodestring = dolKeepOnlyPhpCode($objectpage->content); |
| 2318 | 2318 | |
@@ -2533,7 +2533,7 @@ discard block |
||
| 2533 | 2533 | $fileofzip = ''; |
| 2534 | 2534 | if (GETPOSTISSET('templateuserfile')) { |
| 2535 | 2535 | // Case we selected one template |
| 2536 | - $fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha'); // $fileofzip will be sanitized later into the importWebSite() |
|
| 2536 | + $fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha'); // $fileofzip will be sanitized later into the importWebSite() |
|
| 2537 | 2537 | } elseif (!empty($_FILES) && is_array($_FILES['userfile'])) { |
| 2538 | 2538 | // Case we upload a new template |
| 2539 | 2539 | if (is_array($_FILES['userfile']['tmp_name'])) { |
@@ -2615,7 +2615,7 @@ discard block |
||
| 2615 | 2615 | if ($website->virtualhost) { |
| 2616 | 2616 | $domainname = $website->virtualhost; |
| 2617 | 2617 | } |
| 2618 | - if (! preg_match('/^http/i', $domainname)) { |
|
| 2618 | + if (!preg_match('/^http/i', $domainname)) { |
|
| 2619 | 2619 | $domainname = 'https://'.$domainname; |
| 2620 | 2620 | } |
| 2621 | 2621 | |
@@ -2681,7 +2681,7 @@ discard block |
||
| 2681 | 2681 | $url->appendChild($lastmod); |
| 2682 | 2682 | // Add suggested frequency for refresh |
| 2683 | 2683 | if (getDolGlobalString('WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ')) { |
| 2684 | - $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
| 2684 | + $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
| 2685 | 2685 | $url->appendChild($changefreq); |
| 2686 | 2686 | } |
| 2687 | 2687 | // Add higher priority for home page |
@@ -2786,7 +2786,7 @@ discard block |
||
| 2786 | 2786 | $url->appendChild($lastmod); |
| 2787 | 2787 | // Add suggested frequency for refresh |
| 2788 | 2788 | if (getDolGlobalString('WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ')) { |
| 2789 | - $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
| 2789 | + $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
| 2790 | 2790 | $url->appendChild($changefreq); |
| 2791 | 2791 | } |
| 2792 | 2792 | |
@@ -3074,11 +3074,11 @@ discard block |
||
| 3074 | 3074 | |
| 3075 | 3075 | // // Export web site |
| 3076 | 3076 | $extraCssClass = getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE') ? 'hideobject' : ''; |
| 3077 | - print '<input type="submit" class="button bordertransp ' . $extraCssClass . '" ' . $disabledexport . ' value="' . dol_escape_htmltag($exportlabel) . '" name="exportsite">'; |
|
| 3077 | + print '<input type="submit" class="button bordertransp '.$extraCssClass.'" '.$disabledexport.' value="'.dol_escape_htmltag($exportlabel).'" name="exportsite">'; |
|
| 3078 | 3078 | |
| 3079 | 3079 | if (getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE')) { |
| 3080 | 3080 | // Overwrite template in sources |
| 3081 | - $overwriteGitUrl = $_SERVER["PHP_SELF"] . '?action=overwritesite&website=' . urlencode($website->ref); |
|
| 3081 | + $overwriteGitUrl = $_SERVER["PHP_SELF"].'?action=overwritesite&website='.urlencode($website->ref); |
|
| 3082 | 3082 | print dolButtonToOpenExportDialog('exportpopup', $langs->trans('ExportOptions'), $langs->trans('ExportSite'), 'exportsite', $overwriteGitUrl, $website); |
| 3083 | 3083 | //print '<a href="'.$_SERVER["PHP_SELF"].'?action=overwritesite&website='.urlencode($website->ref).'" class="button bordertransp hideobject" title="'.dol_escape_htmltag($langs->trans("ExportIntoGIT").". Directory ".getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE')).'">'.dol_escape_htmltag($langs->trans("ExportIntoGIT")).'</a>'; |
| 3084 | 3084 | } |
@@ -3423,7 +3423,7 @@ discard block |
||
| 3423 | 3423 | print '<!-- button EditInLine and ShowSubcontainers -->'."\n"; |
| 3424 | 3424 | print '<div class="websiteselectionsection inline-block">'; |
| 3425 | 3425 | |
| 3426 | - print '<div class="inline-block marginrightonly">'; // Button includes dynamic content |
|
| 3426 | + print '<div class="inline-block marginrightonly">'; // Button includes dynamic content |
|
| 3427 | 3427 | print $langs->trans("ShowSubcontainers"); |
| 3428 | 3428 | if (!getDolGlobalString('WEBSITE_SUBCONTAINERSINLINE')) { |
| 3429 | 3429 | 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>'; |
@@ -3432,7 +3432,7 @@ discard block |
||
| 3432 | 3432 | } |
| 3433 | 3433 | print '</div>'; |
| 3434 | 3434 | |
| 3435 | - print '<div class="inline-block marginrightonly">'; // Button edit inline |
|
| 3435 | + print '<div class="inline-block marginrightonly">'; // Button edit inline |
|
| 3436 | 3436 | |
| 3437 | 3437 | print '<span id="switchckeditorinline">'."\n"; |
| 3438 | 3438 | // Enable CKEditor inline with js on section and div with conteneditable=true |
@@ -3524,15 +3524,15 @@ discard block |
||
| 3524 | 3524 | // Sending data via AJAX |
| 3525 | 3525 | $.ajax({ |
| 3526 | 3526 | type: \'POST\', |
| 3527 | - url: \'' . DOL_URL_ROOT . '/core/ajax/editinline.php\', |
|
| 3527 | + url: \'' . DOL_URL_ROOT.'/core/ajax/editinline.php\', |
|
| 3528 | 3528 | data: { |
| 3529 | 3529 | website_ref: \''.$website->ref.'\', |
| 3530 | - page_id: \'' . $websitepage->id . '\', |
|
| 3530 | + page_id: \'' . $websitepage->id.'\', |
|
| 3531 | 3531 | content: content, |
| 3532 | 3532 | element_id: elementId, |
| 3533 | 3533 | element_type: elementType, |
| 3534 | 3534 | action: \'updatedElementContent\', |
| 3535 | - token: \'' . newToken() . '\' |
|
| 3535 | + token: \'' . newToken().'\' |
|
| 3536 | 3536 | }, |
| 3537 | 3537 | success: function(response) { |
| 3538 | 3538 | console.log(response); |
@@ -3598,7 +3598,7 @@ discard block |
||
| 3598 | 3598 | } else { |
| 3599 | 3599 | $disabled = ''; |
| 3600 | 3600 | $title = ''; |
| 3601 | - $url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref); // action=delete for webpage, deletesite for website |
|
| 3601 | + $url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref); // action=delete for webpage, deletesite for website |
|
| 3602 | 3602 | } |
| 3603 | 3603 | 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>'; |
| 3604 | 3604 | print '</span>'; |
@@ -3818,7 +3818,7 @@ discard block |
||
| 3818 | 3818 | // Clean the php htaccesscontent file to remove php code and get only html part |
| 3819 | 3819 | $htaccesscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP( \?>)?\n*/ims', '', $htaccesscontent); |
| 3820 | 3820 | } else { |
| 3821 | - $htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " |
|
| 3821 | + $htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " |
|
| 3822 | 3822 | } |
| 3823 | 3823 | if (!trim($htaccesscontent)) { |
| 3824 | 3824 | $htaccesscontent .= "# Order allow,deny\n"; |
@@ -3919,7 +3919,7 @@ discard block |
||
| 3919 | 3919 | $maxfilesizearray = getMaxFileSizeArray(); |
| 3920 | 3920 | $maxmin = $maxfilesizearray['maxmin']; |
| 3921 | 3921 | if ($maxmin > 0) { |
| 3922 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 3922 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 3923 | 3923 | } |
| 3924 | 3924 | print '<input type="file" class="flat minwidth300" name="addedfile" id="addedfile"/>'; |
| 3925 | 3925 | |
@@ -4176,7 +4176,7 @@ discard block |
||
| 4176 | 4176 | $maxfilesizearray = getMaxFileSizeArray(); |
| 4177 | 4177 | $maxmin = $maxfilesizearray['maxmin']; |
| 4178 | 4178 | if ($maxmin > 0) { |
| 4179 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 4179 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 4180 | 4180 | } |
| 4181 | 4181 | print '<input class="flat minwidth400" type="file" name="userfile[]" accept=".zip">'; |
| 4182 | 4182 | print '<input type="submit" class="button small" name="buttonsubmitimportfile" value="'.dol_escape_htmltag($langs->trans("Upload")).'">'; |
@@ -4806,7 +4806,7 @@ discard block |
||
| 4806 | 4806 | |
| 4807 | 4807 | |
| 4808 | 4808 | $module = 'medias'; |
| 4809 | - $formalreadyopen = 2; // So the form to submit a new file will not be open another time inside the core/tpl/filemanager.tpl.php |
|
| 4809 | + $formalreadyopen = 2; // So the form to submit a new file will not be open another time inside the core/tpl/filemanager.tpl.php |
|
| 4810 | 4810 | if (empty($url)) { |
| 4811 | 4811 | $url = DOL_URL_ROOT.'/website/index.php'; // Must be an url without param |
| 4812 | 4812 | } |
@@ -5041,8 +5041,8 @@ discard block |
||
| 5041 | 5041 | print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; |
| 5042 | 5042 | print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); |
| 5043 | 5043 | print getTitleFieldOfList("UserCreation", 0, $_SERVER['PHP_SELF'], 'fk_user_creat', '', $param, '', $sortfield, $sortorder, '')."\n"; |
| 5044 | - print getTitleFieldOfList("DateCreation", 0, $_SERVER['PHP_SELF'], 'date_creation', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date creation |
|
| 5045 | - print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif |
|
| 5044 | + print getTitleFieldOfList("DateCreation", 0, $_SERVER['PHP_SELF'], 'date_creation', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date creation |
|
| 5045 | + print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif |
|
| 5046 | 5046 | print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); |
| 5047 | 5047 | // Action column |
| 5048 | 5048 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | if (dol_is_file($filetpl)) { |
| 149 | 149 | if ($backupold) { |
| 150 | 150 | $result = archiveOrBackupFile($filetpl); |
| 151 | - if (! $result) { |
|
| 151 | + if (!$result) { |
|
| 152 | 152 | return false; |
| 153 | 153 | } |
| 154 | 154 | } else { |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | $indexcontent .= " require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n"; |
| 344 | 344 | $indexcontent .= ' redirectToContainer($_GET[\'pageref\'], $_GET[\'pagealiasalt\'], $_GET[\'pageid\']);'."\n"; |
| 345 | 345 | $indexcontent .= "}\n"; |
| 346 | - $indexcontent .= "include_once '".$relpath."/".basename($filetpl)."'\n"; // use .. instead of . |
|
| 346 | + $indexcontent .= "include_once '".$relpath."/".basename($filetpl)."'\n"; // use .. instead of . |
|
| 347 | 347 | $indexcontent .= '// END PHP ?>'."\n"; |
| 348 | 348 | $result = file_put_contents($fileindexsub, $indexcontent); |
| 349 | 349 | if ($result === false) { |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | 'types' => $types, |
| 116 | 116 | 'recursive' => $recursive, |
| 117 | 117 | 'filter' => $filter, |
| 118 | - 'excludefilter' => $exclude_array, // Already converted to array. |
|
| 118 | + 'excludefilter' => $exclude_array, // Already converted to array. |
|
| 119 | 119 | 'sortcriteria' => $sortcriteria, |
| 120 | 120 | 'sortorder' => $sortorder, |
| 121 | 121 | 'loaddate' => $loaddate, |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | $qualified = 1; |
| 151 | 151 | |
| 152 | - $utf8_fullpathfile = "$utf8_path/$utf8_file"; // Temp variable for speed |
|
| 152 | + $utf8_fullpathfile = "$utf8_path/$utf8_file"; // Temp variable for speed |
|
| 153 | 153 | |
| 154 | 154 | // Check if file is qualified |
| 155 | 155 | foreach ($excludefilterarray as $filt) { |
@@ -1122,7 +1122,7 @@ discard block |
||
| 1122 | 1122 | } |
| 1123 | 1123 | |
| 1124 | 1124 | if ($resultecm > 0) { |
| 1125 | - $result = true; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 1125 | + $result = true; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 1126 | 1126 | } else { |
| 1127 | 1127 | $result = false; |
| 1128 | 1128 | } |
@@ -1197,7 +1197,7 @@ discard block |
||
| 1197 | 1197 | } |
| 1198 | 1198 | } |
| 1199 | 1199 | } |
| 1200 | - $result = true; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 1200 | + $result = true; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 1201 | 1201 | } |
| 1202 | 1202 | } |
| 1203 | 1203 | } |
@@ -1409,7 +1409,7 @@ discard block |
||
| 1409 | 1409 | $return = move_uploaded_file($src_file_osencoded, $file_name_osencoded); |
| 1410 | 1410 | if ($return) { |
| 1411 | 1411 | dolChmod($file_name_osencoded); |
| 1412 | - dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=" . getDolGlobalString('MAIN_UMASK'), LOG_DEBUG); |
|
| 1412 | + dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".getDolGlobalString('MAIN_UMASK'), LOG_DEBUG); |
|
| 1413 | 1413 | return $successcode; // Success |
| 1414 | 1414 | } else { |
| 1415 | 1415 | dol_syslog("Files.lib::dol_move_uploaded_file Failed to move ".$src_file." to ".$file_name, LOG_ERR); |
@@ -1922,7 +1922,7 @@ discard block |
||
| 1922 | 1922 | $maxwidthmini = $tmparraysize['maxwidthmini']; |
| 1923 | 1923 | $maxheightmini = $tmparraysize['maxheightmini']; |
| 1924 | 1924 | //$quality = $tmparraysize['quality']; |
| 1925 | - $quality = 50; // For thumbs, we force quality to 50 |
|
| 1925 | + $quality = 50; // For thumbs, we force quality to 50 |
|
| 1926 | 1926 | |
| 1927 | 1927 | // Generate thumbs. |
| 1928 | 1928 | if ($generatethumbs) { |
@@ -2106,7 +2106,7 @@ discard block |
||
| 2106 | 2106 | if (isset($object->table_element)) { |
| 2107 | 2107 | $ecmfile->src_object_type = $object->table_element; |
| 2108 | 2108 | } else { |
| 2109 | - dol_syslog('Error: object ' . get_class($object) . ' has no table_element attribute.'); |
|
| 2109 | + dol_syslog('Error: object '.get_class($object).' has no table_element attribute.'); |
|
| 2110 | 2110 | return -1; |
| 2111 | 2111 | } |
| 2112 | 2112 | if (isset($object->src_object_description)) { |
@@ -2350,9 +2350,9 @@ discard block |
||
| 2350 | 2350 | // Skip directories (they would be added automatically) |
| 2351 | 2351 | if (!$file->isDir()) { |
| 2352 | 2352 | // Get real and relative path for current file |
| 2353 | - $filePath = $file->getPath(); // the full path with filename using the $inputdir root. |
|
| 2353 | + $filePath = $file->getPath(); // the full path with filename using the $inputdir root. |
|
| 2354 | 2354 | $fileName = $file->getFilename(); |
| 2355 | - $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory. |
|
| 2355 | + $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory. |
|
| 2356 | 2356 | |
| 2357 | 2357 | //$relativePath = substr($fileFullRealPath, strlen($rootPath) + 1); |
| 2358 | 2358 | $relativePath = substr(($filePath ? $filePath.'/' : '').$fileName, strlen($rootPath) + 1); |
@@ -2580,9 +2580,9 @@ discard block |
||
| 2580 | 2580 | |
| 2581 | 2581 | try { |
| 2582 | 2582 | if ($mode == 'gz') { |
| 2583 | - $foundhandler = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 2583 | + $foundhandler = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 2584 | 2584 | } elseif ($mode == 'bz') { |
| 2585 | - $foundhandler = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 2585 | + $foundhandler = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 2586 | 2586 | } elseif ($mode == 'zip') { |
| 2587 | 2587 | /*if (defined('ODTPHP_PATHTOPCLZIP')) |
| 2588 | 2588 | { |
@@ -2623,9 +2623,9 @@ discard block |
||
| 2623 | 2623 | // Skip directories (they would be added automatically) |
| 2624 | 2624 | if (!$file->isDir()) { |
| 2625 | 2625 | // Get real and relative path for current file |
| 2626 | - $filePath = $file->getPath(); // the full path with filename using the $inputdir root. |
|
| 2626 | + $filePath = $file->getPath(); // the full path with filename using the $inputdir root. |
|
| 2627 | 2627 | $fileName = $file->getFilename(); |
| 2628 | - $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory. |
|
| 2628 | + $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory. |
|
| 2629 | 2629 | |
| 2630 | 2630 | //$relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($fileFullRealPath, strlen($inputdir) + 1); |
| 2631 | 2631 | $relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr(($filePath ? $filePath.'/' : '').$fileName, strlen($inputdir) + 1); |
@@ -2798,7 +2798,7 @@ discard block |
||
| 2798 | 2798 | $original_file = $conf->mycompany->dir_output.'/'.$original_file; |
| 2799 | 2799 | } elseif ($modulepart == 'userphoto' && !empty($conf->user->dir_output)) { |
| 2800 | 2800 | // Wrapping for users photos (user photos are allowed to any connected users) |
| 2801 | - $accessallowed = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 2801 | + $accessallowed = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 2802 | 2802 | if (preg_match('/^\d+\/photos\//', $original_file)) { |
| 2803 | 2803 | $accessallowed = 1; |
| 2804 | 2804 | } |
@@ -2834,7 +2834,7 @@ discard block |
||
| 2834 | 2834 | $original_file = $conf->mycompany->dir_output.'/logos/'.$original_file; |
| 2835 | 2835 | } elseif ($modulepart == 'memberphoto' && !empty($conf->member->dir_output)) { |
| 2836 | 2836 | // Wrapping for members photos |
| 2837 | - $accessallowed = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 2837 | + $accessallowed = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 2838 | 2838 | if (preg_match('/^\d+\/photos\//', $original_file)) { |
| 2839 | 2839 | $accessallowed = 1; |
| 2840 | 2840 | } |
@@ -3703,7 +3703,7 @@ discard block |
||
| 3703 | 3703 | function archiveOrBackupFile($filetpl, $max_versions = 5, $archivedir = '', $suffix = "v", $moveorcopy = 'move') |
| 3704 | 3704 | { |
| 3705 | 3705 | $base_file_pattern = ($archivedir ? $archivedir : dirname($filetpl)).'/'.basename($filetpl).".".$suffix; |
| 3706 | - $files_in_directory = glob($base_file_pattern . "*"); |
|
| 3706 | + $files_in_directory = glob($base_file_pattern."*"); |
|
| 3707 | 3707 | |
| 3708 | 3708 | // Extract the modification timestamps for each file |
| 3709 | 3709 | $files_with_timestamps = []; |
@@ -3744,7 +3744,7 @@ discard block |
||
| 3744 | 3744 | } |
| 3745 | 3745 | |
| 3746 | 3746 | $timestamp = dol_now('gmt'); |
| 3747 | - $new_backup = $filetpl . ".v" . $timestamp; |
|
| 3747 | + $new_backup = $filetpl.".v".$timestamp; |
|
| 3748 | 3748 | |
| 3749 | 3749 | // Move or copy the original file to the new backup with the timestamp |
| 3750 | 3750 | if ($moveorcopy == 'move') { |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $maxphptoshow = $maxfilesizearray['maxphptoshow']; |
| 157 | 157 | $maxphptoshowparam = $maxfilesizearray['maxphptoshowparam']; |
| 158 | 158 | if ($maxmin > 0) { |
| 159 | - $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 159 | + $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 160 | 160 | } |
| 161 | 161 | $out .= '<input class="flat minwidth400 maxwidth200onsmartphone" type="file"'; |
| 162 | 162 | $out .= ((getDolGlobalString('MAIN_DISABLE_MULTIPLE_FILEUPLOAD') || $disablemulti) ? ' name="userfile"' : ' name="userfile[]" multiple'); |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | } else { |
| 595 | 595 | include_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php'; |
| 596 | 596 | //$modellist = ModeleExports::liste_modeles($this->db); // liste_modeles() does not exists. We are using listOfAvailableExportFormat() method instead that return a different array format. |
| 597 | - $modellist = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 597 | + $modellist = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 598 | 598 | } |
| 599 | 599 | } elseif ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order') { |
| 600 | 600 | if (is_array($genallowed)) { |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | $out .= '<tr class="liste_titre">'; |
| 715 | 715 | $addcolumforpicto = ($delallowed || $printer || $morepicto); |
| 716 | 716 | $colspan = (4 + ($addcolumforpicto ? 1 : 0)); |
| 717 | - $colspanmore = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 717 | + $colspanmore = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 718 | 718 | |
| 719 | 719 | $out .= '<th colspan="'.$colspan.'" class="formdoc liste_titre maxwidthonsmartphone center">'; |
| 720 | 720 | |
@@ -1375,7 +1375,7 @@ discard block |
||
| 1375 | 1375 | $modulepart = basename(dirname($file['path'])); |
| 1376 | 1376 | } |
| 1377 | 1377 | if (empty($relativepath)) { |
| 1378 | - $relativepath = preg_replace('/\/(.+)/', '', $filepath) . '/'; |
|
| 1378 | + $relativepath = preg_replace('/\/(.+)/', '', $filepath).'/'; |
|
| 1379 | 1379 | } |
| 1380 | 1380 | |
| 1381 | 1381 | $editline = 0; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $search_type = GETPOST("search_type", 'alpha'); |
| 78 | 78 | $search_account = GETPOST("search_account", 'int') ? GETPOST("search_account", 'int') : GETPOST("account", 'int'); |
| 79 | 79 | $search_accountancy_code = GETPOST('search_accountancy_code', 'alpha') ? GETPOST('search_accountancy_code', 'alpha') : GETPOST('accountancy_code', 'alpha'); |
| 80 | -$search_bid = GETPOST("search_bid", 'int') ? GETPOST("search_bid", 'int') : GETPOST("bid", 'int'); // Category id |
|
| 80 | +$search_bid = GETPOST("search_bid", 'int') ? GETPOST("search_bid", 'int') : GETPOST("bid", 'int'); // Category id |
|
| 81 | 81 | $search_ref = GETPOST('search_ref', 'alpha'); |
| 82 | 82 | $search_description = GETPOST("search_description", 'alpha'); |
| 83 | 83 | $search_dt_start = dol_mktime(0, 0, 0, GETPOSTINT('search_start_dtmonth'), GETPOSTINT('search_start_dtday'), GETPOSTINT('search_start_dtyear')); |
@@ -150,12 +150,12 @@ discard block |
||
| 150 | 150 | $search_array_options = $extrafields->getOptionalsFromPost('banktransaction', '', 'search_'); |
| 151 | 151 | |
| 152 | 152 | $arrayfields = array( |
| 153 | - 'b.rowid' => array('label' => $langs->trans("Ref"), 'checked' => 1,'position' => 10), |
|
| 154 | - 'b.label' => array('label' => $langs->trans("Description"), 'checked' => 1,'position' => 20), |
|
| 155 | - 'b.dateo' => array('label' => $langs->trans("DateOperationShort"), 'checked' => -1,'position' => 30), |
|
| 156 | - 'b.datev' => array('label' => $langs->trans("DateValueShort"), 'checked' => 1,'position' => 40), |
|
| 157 | - 'type' => array('label' => $langs->trans("Type"), 'checked' => 1,'position' => 50), |
|
| 158 | - 'b.num_chq' => array('label' => $langs->trans("Numero"), 'checked' => 1,'position' => 60), |
|
| 153 | + 'b.rowid' => array('label' => $langs->trans("Ref"), 'checked' => 1, 'position' => 10), |
|
| 154 | + 'b.label' => array('label' => $langs->trans("Description"), 'checked' => 1, 'position' => 20), |
|
| 155 | + 'b.dateo' => array('label' => $langs->trans("DateOperationShort"), 'checked' => -1, 'position' => 30), |
|
| 156 | + 'b.datev' => array('label' => $langs->trans("DateValueShort"), 'checked' => 1, 'position' => 40), |
|
| 157 | + 'type' => array('label' => $langs->trans("Type"), 'checked' => 1, 'position' => 50), |
|
| 158 | + 'b.num_chq' => array('label' => $langs->trans("Numero"), 'checked' => 1, 'position' => 60), |
|
| 159 | 159 | 'bu.label' => array('label' => $langs->trans("ThirdParty").'/'.$langs->trans("User"), 'checked' => 1, 'position' => 70), |
| 160 | 160 | 'ba.ref' => array('label' => $langs->trans("BankAccount"), 'checked' => (($id > 0 || !empty($ref)) ? 0 : 1), 'position' => 80), |
| 161 | 161 | 'b.debit' => array('label' => $langs->trans("Debit"), 'checked' => 1, 'position' => 90), |
@@ -652,20 +652,20 @@ discard block |
||
| 652 | 652 | $sql .= " AND b.rappro = ".((int) $search_conciliated); |
| 653 | 653 | } |
| 654 | 654 | if ($search_fk_bordereau > 0) { |
| 655 | - $sql .= " AND b.fk_bordereau = " . ((int) $search_fk_bordereau); |
|
| 655 | + $sql .= " AND b.fk_bordereau = ".((int) $search_fk_bordereau); |
|
| 656 | 656 | } |
| 657 | 657 | if ($search_thirdparty_user) { |
| 658 | 658 | $sql .= " AND (b.rowid IN "; |
| 659 | 659 | $sql .= " ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX."bank_url AS bu"; |
| 660 | 660 | $sql .= " JOIN ".MAIN_DB_PREFIX."bank AS b2 ON b2.rowid = bu.fk_bank"; |
| 661 | 661 | $sql .= " JOIN ".MAIN_DB_PREFIX."user AS subUser ON (bu.type = 'user' AND bu.url_id = subUser.rowid)"; |
| 662 | - $sql .= " WHERE ". natural_search(array("subUser.firstname", "subUser.lastname"), $search_thirdparty_user, '', 1).")"; |
|
| 662 | + $sql .= " WHERE ".natural_search(array("subUser.firstname", "subUser.lastname"), $search_thirdparty_user, '', 1).")"; |
|
| 663 | 663 | |
| 664 | 664 | $sql .= " OR b.rowid IN "; |
| 665 | 665 | $sql .= " ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX."bank_url AS bu"; |
| 666 | 666 | $sql .= " JOIN ".MAIN_DB_PREFIX."bank AS b2 ON b2.rowid = bu.fk_bank"; |
| 667 | 667 | $sql .= " JOIN ".MAIN_DB_PREFIX."societe AS subSoc ON (bu.type = 'company' AND bu.url_id = subSoc.rowid)"; |
| 668 | - $sql .= " WHERE ". natural_search(array("subSoc.nom"), $search_thirdparty_user, '', 1); |
|
| 668 | + $sql .= " WHERE ".natural_search(array("subSoc.nom"), $search_thirdparty_user, '', 1); |
|
| 669 | 669 | $sql .= "))"; |
| 670 | 670 | } |
| 671 | 671 | if ($search_description) { |
@@ -1085,7 +1085,7 @@ discard block |
||
| 1085 | 1085 | } |
| 1086 | 1086 | |
| 1087 | 1087 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
| 1088 | - $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
| 1088 | + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
| 1089 | 1089 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
| 1090 | 1090 | $selectedfields .= ($action == 'reconcile' ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
| 1091 | 1091 | |
@@ -1442,10 +1442,10 @@ discard block |
||
| 1442 | 1442 | $backgroundcolor = "class='oddeven'"; |
| 1443 | 1443 | } else { |
| 1444 | 1444 | if ($objp->amount < 0) { |
| 1445 | - $color = '#' . getDolGlobalString('BANK_COLORIZE_MOVEMENT_COLOR1', 'fca955'); |
|
| 1445 | + $color = '#'.getDolGlobalString('BANK_COLORIZE_MOVEMENT_COLOR1', 'fca955'); |
|
| 1446 | 1446 | $backgroundcolor = 'style="background: '.$color.';"'; |
| 1447 | 1447 | } else { |
| 1448 | - $color = '#' . getDolGlobalString('BANK_COLORIZE_MOVEMENT_COLOR2', '7fdb86'); |
|
| 1448 | + $color = '#'.getDolGlobalString('BANK_COLORIZE_MOVEMENT_COLOR2', '7fdb86'); |
|
| 1449 | 1449 | $backgroundcolor = 'style="background: '.$color.';"'; |
| 1450 | 1450 | } |
| 1451 | 1451 | } |
@@ -1594,7 +1594,7 @@ discard block |
||
| 1594 | 1594 | } |
| 1595 | 1595 | } |
| 1596 | 1596 | |
| 1597 | - print $labeltoshow; // Already escaped |
|
| 1597 | + print $labeltoshow; // Already escaped |
|
| 1598 | 1598 | |
| 1599 | 1599 | print '</td>'; |
| 1600 | 1600 | if (!$i) { |
@@ -1820,7 +1820,7 @@ discard block |
||
| 1820 | 1820 | |
| 1821 | 1821 | // Fields from hook |
| 1822 | 1822 | $parameters = array('arrayfields' => $arrayfields, 'obj' => $objp, 'i' => $i, 'totalarray' => &$totalarray); |
| 1823 | - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objecttmp); // Note that $action and $objecttmpect may have been modified by hook |
|
| 1823 | + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objecttmp); // Note that $action and $objecttmpect may have been modified by hook |
|
| 1824 | 1824 | print $hookmanager->resPrint; |
| 1825 | 1825 | |
| 1826 | 1826 | // Action edit/delete and select |