@@ -21,7 +21,7 @@ |
||
| 21 | 21 | * \brief Popup screen to validate VAT |
| 22 | 22 | */ |
| 23 | 23 | |
| 24 | -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) |
|
| 24 | +if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) |
|
| 25 | 25 | |
| 26 | 26 | require "../../main.inc.php"; |
| 27 | 27 | require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
@@ -21,7 +21,10 @@ |
||
| 21 | 21 | * \brief Popup screen to validate VAT |
| 22 | 22 | */ |
| 23 | 23 | |
| 24 | -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) |
|
| 24 | +if (! defined('NOTOKENRENEWAL')) { |
|
| 25 | + define('NOTOKENRENEWAL', '1'); |
|
| 26 | +} |
|
| 27 | +// Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) |
|
| 25 | 28 | |
| 26 | 29 | require "../../main.inc.php"; |
| 27 | 30 | require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
@@ -820,7 +820,9 @@ |
||
| 820 | 820 | } |
| 821 | 821 | |
| 822 | 822 | $statusType = 'status'.$status; |
| 823 | - if ($status == self::STATUS_VALIDATED) $statusType = 'status4'; |
|
| 823 | + if ($status == self::STATUS_VALIDATED) { |
|
| 824 | + $statusType = 'status4'; |
|
| 825 | + } |
|
| 824 | 826 | if ($status == self::STATUS_CANCELED) { |
| 825 | 827 | $statusType = 'status6'; |
| 826 | 828 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | /** |
| 100 | 100 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
| 101 | 101 | */ |
| 102 | - public $fields=array( |
|
| 102 | + public $fields = array( |
|
| 103 | 103 | 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), |
| 104 | 104 | 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'visible'=>5, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", "csslist"=>"nowraponall", "showoncombobox"=>1), |
| 105 | 105 | 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>20, 'index'=>1), |
@@ -743,12 +743,12 @@ discard block |
||
| 743 | 743 | $datas['label'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref; |
| 744 | 744 | $datas['question'] = '<br><b>'.$langs->trans('Question').':</b> '.$this->question; |
| 745 | 745 | $labellang = ($this->lang ? $langs->trans('Language_'.$this->lang) : ''); |
| 746 | - $datas['lang'] = '<br><b>'.$langs->trans('Language').':</b> ' . picto_from_langcode($this->lang, 'class="paddingrightonly saturatemedium opacitylow"') . $labellang; |
|
| 746 | + $datas['lang'] = '<br><b>'.$langs->trans('Language').':</b> '.picto_from_langcode($this->lang, 'class="paddingrightonly saturatemedium opacitylow"').$labellang; |
|
| 747 | 747 | // show categories for this record only in ajax to not overload lists |
| 748 | 748 | if (isModEnabled('categorie') && !$nofetch) { |
| 749 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 749 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 750 | 750 | $form = new Form($this->db); |
| 751 | - $datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_KNOWLEDGEMANAGEMENT, 1); |
|
| 751 | + $datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_KNOWLEDGEMANAGEMENT, 1); |
|
| 752 | 752 | } |
| 753 | 753 | |
| 754 | 754 | return $datas; |
@@ -809,7 +809,7 @@ discard block |
||
| 809 | 809 | $label = $langs->trans("ShowKnowledgeRecord"); |
| 810 | 810 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
| 811 | 811 | } |
| 812 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
| 812 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
| 813 | 813 | $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
| 814 | 814 | } else { |
| 815 | 815 | $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
@@ -1002,7 +1002,7 @@ discard block |
||
| 1002 | 1002 | if (getDolGlobalString('KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON')) { |
| 1003 | 1003 | $mybool = false; |
| 1004 | 1004 | |
| 1005 | - $file = getDolGlobalString('KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON') . ".php"; |
|
| 1005 | + $file = getDolGlobalString('KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON').".php"; |
|
| 1006 | 1006 | $classname = $conf->global->KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON; |
| 1007 | 1007 | |
| 1008 | 1008 | // Include file with class |
@@ -26,7 +26,9 @@ discard block |
||
| 26 | 26 | define('NOSTYLECHECK', 1); |
| 27 | 27 | define('USEDOLIBARREDITOR', 1); |
| 28 | 28 | define('FORCE_CKEDITOR', 1); // We need CKEditor, even if module is off. |
| 29 | -if (!defined('DISABLE_JS_GRAHP')) define('DISABLE_JS_GRAPH', 1); |
|
| 29 | +if (!defined('DISABLE_JS_GRAHP')) { |
|
| 30 | + define('DISABLE_JS_GRAPH', 1); |
|
| 31 | +} |
|
| 30 | 32 | |
| 31 | 33 | //header('X-XSS-Protection:0'); // Disable XSS filtering protection of some browsers (note: use of Content-Security-Policy is more efficient). Disabled as deprecated. |
| 32 | 34 | |
@@ -592,7 +594,9 @@ discard block |
||
| 592 | 594 | $arrayotherlang = explode(',', GETPOST('WEBSITE_OTHERLANG', 'alphanohtml')); |
| 593 | 595 | foreach ($arrayotherlang as $key => $val) { |
| 594 | 596 | // It possible we have empty val here if postparam WEBSITE_OTHERLANG is empty or set like this : 'en,,sv' or 'en,sv,' |
| 595 | - if (empty(trim($val))) continue; |
|
| 597 | + if (empty(trim($val))) { |
|
| 598 | + continue; |
|
| 599 | + } |
|
| 596 | 600 | $arrayotherlang[$key] = substr(trim($val), 0, 2); // Kept short language code only |
| 597 | 601 | } |
| 598 | 602 | |
@@ -1336,7 +1340,9 @@ discard block |
||
| 1336 | 1340 | $arrayotherlang = explode(',', GETPOST('WEBSITE_OTHERLANG', 'alphanohtml')); |
| 1337 | 1341 | foreach ($arrayotherlang as $key => $val) { |
| 1338 | 1342 | // It possible we have empty val here if postparam WEBSITE_OTHERLANG is empty or set like this : 'en,,sv' or 'en,sv,' |
| 1339 | - if (empty(trim($val))) continue; |
|
| 1343 | + if (empty(trim($val))) { |
|
| 1344 | + continue; |
|
| 1345 | + } |
|
| 1340 | 1346 | $arrayotherlang[$key] = substr(trim($val), 0, 2); // Kept short language code only |
| 1341 | 1347 | } |
| 1342 | 1348 | |
@@ -1793,7 +1799,9 @@ discard block |
||
| 1793 | 1799 | // Under certain conditions $sublang can be an empty string |
| 1794 | 1800 | // ($object->otherlang with empty string or with string like this 'en,,sv') |
| 1795 | 1801 | // if is the case we try to re-delete the main alias file. Avoid it. |
| 1796 | - if (empty(trim($sublang))) continue; |
|
| 1802 | + if (empty(trim($sublang))) { |
|
| 1803 | + continue; |
|
| 1804 | + } |
|
| 1797 | 1805 | $fileoldaliassub = $dirname.'/'.$sublang.'/'.$filename; |
| 1798 | 1806 | dol_delete_file($fileoldaliassub); |
| 1799 | 1807 | } |
@@ -1816,7 +1824,9 @@ discard block |
||
| 1816 | 1824 | // Under certain conditions $ sublang can be an empty string |
| 1817 | 1825 | // ($object->otherlang with empty string or with string like this 'en,,sv') |
| 1818 | 1826 | // if is the case we try to re-delete the main alias file. Avoid it. |
| 1819 | - if (empty(trim($sublang))) continue; |
|
| 1827 | + if (empty(trim($sublang))) { |
|
| 1828 | + continue; |
|
| 1829 | + } |
|
| 1820 | 1830 | $fileoldaliassub = $dirname.'/'.$sublang.'/'.$filename; |
| 1821 | 1831 | dol_delete_file($fileoldaliassub); |
| 1822 | 1832 | } |
@@ -2903,7 +2913,9 @@ discard block |
||
| 2903 | 2913 | $onlylang[$website->lang] = $website->lang.' ('.$langs->trans("Default").')'; |
| 2904 | 2914 | } |
| 2905 | 2915 | foreach (explode(',', $website->otherlang) as $langkey) { |
| 2906 | - if (empty(trim($langkey))) continue; |
|
| 2916 | + if (empty(trim($langkey))) { |
|
| 2917 | + continue; |
|
| 2918 | + } |
|
| 2907 | 2919 | $onlylang[$langkey] = $langkey; |
| 2908 | 2920 | } |
| 2909 | 2921 | $textifempty = $langs->trans("Default"); |
@@ -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 (getDolGlobalString('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 (getDolGlobalString('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 (!getDolGlobalString('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>'; |
@@ -1984,9 +1984,12 @@ |
||
| 1984 | 1984 | |
| 1985 | 1985 | $parameters = array(); |
| 1986 | 1986 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 1987 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 1988 | - if (empty($reshook)) |
|
| 1989 | - $object->formAddObjectLine(1, $mysoc, $soc); |
|
| 1987 | + if ($reshook < 0) { |
|
| 1988 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 1989 | + } |
|
| 1990 | + if (empty($reshook)) { |
|
| 1991 | + $object->formAddObjectLine(1, $mysoc, $soc); |
|
| 1992 | + } |
|
| 1990 | 1993 | } |
| 1991 | 1994 | |
| 1992 | 1995 | print '</table>'; |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $permissionnote = $user->hasRight('contrat', 'creer'); // Used by the include of actions_setnotes.inc.php |
| 101 | 101 | $permissiondellink = $user->hasRight('contrat', 'creer'); // Used by the include of actions_dellink.inc.php |
| 102 | 102 | $permissiontodelete = ($user->hasRight('contrat', 'creer') && $object->statut == $object::STATUS_DRAFT) || $user->hasRight('contrat', 'supprimer'); |
| 103 | -$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
| 103 | +$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
| 104 | 104 | $permissiontoedit = $permissiontoadd; |
| 105 | 105 | $permissiontoactivate = $user->hasRight('contrat', 'activer'); |
| 106 | 106 | $error = 0; |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once |
| 145 | 145 | |
| 146 | - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once |
|
| 146 | + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once |
|
| 147 | 147 | |
| 148 | 148 | if ($action == 'confirm_active' && $confirm == 'yes' && $permissiontoactivate) { |
| 149 | 149 | $date_start = ''; |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | $lines[$i]->pa_ht, |
| 371 | 371 | $array_options, |
| 372 | 372 | $lines[$i]->fk_unit, |
| 373 | - $num+1 |
|
| 373 | + $num + 1 |
|
| 374 | 374 | ); |
| 375 | 375 | |
| 376 | 376 | if ($result < 0) { |
@@ -520,8 +520,8 @@ discard block |
||
| 520 | 520 | $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); |
| 521 | 521 | if ($result) { |
| 522 | 522 | if (count($prodcustprice->lines) > 0) { |
| 523 | - $price_min = price($prodcustprice->lines[0]->price_min); |
|
| 524 | - $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
| 523 | + $price_min = price($prodcustprice->lines[0]->price_min); |
|
| 524 | + $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
| 525 | 525 | /*$tva_tx = $prodcustprice->lines[0]->tva_tx; |
| 526 | 526 | if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) { |
| 527 | 527 | $tva_tx .= ' ('.$prodcustprice->lines[0]->default_vat_code.')'; |
@@ -755,7 +755,7 @@ discard block |
||
| 755 | 755 | // update price_ht with discount |
| 756 | 756 | // TODO Use object->updateline instead objedtline->update |
| 757 | 757 | |
| 758 | - $price_ht = price2num(GETPOST('elprice'), 'MU'); |
|
| 758 | + $price_ht = price2num(GETPOST('elprice'), 'MU'); |
|
| 759 | 759 | $remise_percent = price2num(GETPOST('elremise_percent'), 2); |
| 760 | 760 | if ($remise_percent > 0) { |
| 761 | 761 | $remise = round(($price_ht * $remise_percent / 100), 2); |
@@ -861,7 +861,7 @@ discard block |
||
| 861 | 861 | } elseif ($action == 'confirm_activate' && $confirm == 'yes' && $user->hasRight('contrat', 'creer')) { |
| 862 | 862 | $date_start = dol_mktime(12, 0, 0, GETPOST('d_startmonth'), GETPOST('d_startday'), GETPOST('d_startyear')); |
| 863 | 863 | $date_end = dol_mktime(12, 0, 0, GETPOST('d_endmonth'), GETPOST('d_endday'), GETPOST('d_endyear')); |
| 864 | - $comment = GETPOST('comment', 'alpha'); |
|
| 864 | + $comment = GETPOST('comment', 'alpha'); |
|
| 865 | 865 | $result = $object->activateAll($user, $date_start, 0, $comment, $date_end); |
| 866 | 866 | if ($result < 0) { |
| 867 | 867 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -997,7 +997,7 @@ discard block |
||
| 997 | 997 | include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; |
| 998 | 998 | |
| 999 | 999 | // Actions to build doc |
| 1000 | - $upload_dir = $conf->contrat->multidir_output[!empty($object->entity)?$object->entity:$conf->entity]; |
|
| 1000 | + $upload_dir = $conf->contrat->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]; |
|
| 1001 | 1001 | include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; |
| 1002 | 1002 | |
| 1003 | 1003 | // Actions to send emails |
@@ -1395,7 +1395,7 @@ discard block |
||
| 1395 | 1395 | $morehtmlref .= '<div class="refidno">'; |
| 1396 | 1396 | // Ref customer |
| 1397 | 1397 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 1); |
| 1398 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1, 'getFormatedCustomerRef'); |
|
| 1398 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1, 'getFormatedCustomerRef'); |
|
| 1399 | 1399 | // Ref supplier |
| 1400 | 1400 | $morehtmlref .= '<br>'; |
| 1401 | 1401 | $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 1); |
@@ -1489,7 +1489,7 @@ discard block |
||
| 1489 | 1489 | } |
| 1490 | 1490 | |
| 1491 | 1491 | |
| 1492 | - $arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error |
|
| 1492 | + $arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error |
|
| 1493 | 1493 | |
| 1494 | 1494 | /* |
| 1495 | 1495 | * Lines of contracts |
@@ -118,7 +118,9 @@ |
||
| 118 | 118 | |
| 119 | 119 | if ($year) { |
| 120 | 120 | if (is_dir($dir.'/'.$year)) { |
| 121 | - if (!empty($year_dirs)) print '<br>'; |
|
| 121 | + if (!empty($year_dirs)) { |
|
| 122 | + print '<br>'; |
|
| 123 | + } |
|
| 122 | 124 | print '<br>'; |
| 123 | 125 | print '<table width="100%" class="noborder">'; |
| 124 | 126 | print '<tr class="liste_titre">'; |
@@ -1623,9 +1623,13 @@ |
||
| 1623 | 1623 | |
| 1624 | 1624 | $parameters = array(); |
| 1625 | 1625 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 1626 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 1627 | - if (empty($reshook)) |
|
| 1628 | - $object->formAddObjectLine(0, $mysoc, $object->thirdparty); // No date selector for template invoice |
|
| 1626 | + if ($reshook < 0) { |
|
| 1627 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 1628 | + } |
|
| 1629 | + if (empty($reshook)) { |
|
| 1630 | + $object->formAddObjectLine(0, $mysoc, $object->thirdparty); |
|
| 1631 | + } |
|
| 1632 | + // No date selector for template invoice |
|
| 1629 | 1633 | } |
| 1630 | 1634 | } |
| 1631 | 1635 | |
@@ -779,7 +779,7 @@ discard block |
||
| 779 | 779 | // Define special_code for special lines |
| 780 | 780 | $special_code = GETPOST('special_code', 'int'); |
| 781 | 781 | if ($special_code == 3) { |
| 782 | - $special_code = 0; // Options should not exists on invoices |
|
| 782 | + $special_code = 0; // Options should not exists on invoices |
|
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | /*$line = new FactureLigne($db); |
@@ -1626,10 +1626,10 @@ discard block |
||
| 1626 | 1626 | |
| 1627 | 1627 | // Lines |
| 1628 | 1628 | print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">'; |
| 1629 | - print '<input type="hidden" name="token" value="' . newToken().'">'; |
|
| 1630 | - print '<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">'; |
|
| 1629 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1630 | + print '<input type="hidden" name="action" value="'.(($action != 'editline') ? 'addline' : 'updateline').'">'; |
|
| 1631 | 1631 | print '<input type="hidden" name="mode" value="">'; |
| 1632 | - print '<input type="hidden" name="id" value="' . $object->id.'">'; |
|
| 1632 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 1633 | 1633 | print '<input type="hidden" name="page_y" value="">'; |
| 1634 | 1634 | |
| 1635 | 1635 | if (!empty($conf->use_javascript_ajax) && $object->statut == 0) { |
@@ -1681,16 +1681,16 @@ discard block |
||
| 1681 | 1681 | if (empty($object->suspended)) { |
| 1682 | 1682 | if ($user->hasRight('facture', 'creer')) { |
| 1683 | 1683 | if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { |
| 1684 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("MaxGenerationReached")) . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
| 1684 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("MaxGenerationReached")).'">'.$langs->trans("CreateBill").'</a></div>'; |
|
| 1685 | 1685 | } else { |
| 1686 | 1686 | if (empty($object->frequency) || $object->date_when <= $nowlasthour) { |
| 1687 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/compta/facture/card.php?action=create&socid=' . $object->thirdparty->id . '&fac_rec=' . $object->id . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
| 1687 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&socid='.$object->thirdparty->id.'&fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>'; |
|
| 1688 | 1688 | } else { |
| 1689 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("DateIsNotEnough")) . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
| 1689 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("DateIsNotEnough")).'">'.$langs->trans("CreateBill").'</a></div>'; |
|
| 1690 | 1690 | } |
| 1691 | 1691 | } |
| 1692 | 1692 | } else { |
| 1693 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">' . $langs->trans("CreateBill") . '</a></div>'; |
|
| 1693 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateBill").'</a></div>'; |
|
| 1694 | 1694 | } |
| 1695 | 1695 | } |
| 1696 | 1696 | |
@@ -1703,7 +1703,7 @@ discard block |
||
| 1703 | 1703 | } |
| 1704 | 1704 | |
| 1705 | 1705 | // Delete |
| 1706 | - print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&token=' . newToken(), 'delete', $user->hasRight('facture', 'supprimer')); |
|
| 1706 | + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->hasRight('facture', 'supprimer')); |
|
| 1707 | 1707 | } |
| 1708 | 1708 | print '</div>'; |
| 1709 | 1709 | |
@@ -598,9 +598,12 @@ |
||
| 598 | 598 | |
| 599 | 599 | $parameters = array(); |
| 600 | 600 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 601 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 602 | - if (empty($reshook)) |
|
| 603 | - $object->formAddObjectLine(1, $mysoc, $soc); |
|
| 601 | + if ($reshook < 0) { |
|
| 602 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 603 | + } |
|
| 604 | + if (empty($reshook)) { |
|
| 605 | + $object->formAddObjectLine(1, $mysoc, $soc); |
|
| 606 | + } |
|
| 604 | 607 | } |
| 605 | 608 | } |
| 606 | 609 | |
@@ -85,14 +85,14 @@ discard block |
||
| 85 | 85 | // Get parameters |
| 86 | 86 | $id = GETPOST('id', 'int'); |
| 87 | 87 | $ref = GETPOST('ref', 'alpha'); |
| 88 | -$lineid = GETPOST('lineid', 'int'); |
|
| 88 | +$lineid = GETPOST('lineid', 'int'); |
|
| 89 | 89 | |
| 90 | 90 | $action = GETPOST('action', 'aZ09'); |
| 91 | 91 | $confirm = GETPOST('confirm', 'alpha'); |
| 92 | 92 | $cancel = GETPOST('cancel', 'aZ09'); |
| 93 | 93 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search |
| 94 | -$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
| 95 | -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 94 | +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
| 95 | +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 96 | 96 | $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); |
| 97 | 97 | $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); |
| 98 | 98 | |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | |
| 544 | 544 | // Clone |
| 545 | 545 | if ($permissiontoadd) { |
| 546 | - print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid)?'&socid='.$object->socid:'').'&action=clone&token='.newToken(), '', $permissiontoadd); |
|
| 546 | + print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid) ? '&socid='.$object->socid : '').'&action=clone&token='.newToken(), '', $permissiontoadd); |
|
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | /* |
@@ -1615,7 +1615,9 @@ |
||
| 1615 | 1615 | global $conf, $langs; |
| 1616 | 1616 | |
| 1617 | 1617 | $ltrdirection = 'L'; |
| 1618 | - if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; |
|
| 1618 | + if ($outputlangs->trans("DIRECTION") == 'rtl') { |
|
| 1619 | + $ltrdirection = 'R'; |
|
| 1620 | + } |
|
| 1619 | 1621 | |
| 1620 | 1622 | // Load traductions files required by page |
| 1621 | 1623 | $outputlangs->loadLangs(array("main", "bills", "propal", "companies")); |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | if (!empty($conf->mycompany->multidir_output[$object->entity])) { |
| 330 | 330 | $logodir = $conf->mycompany->multidir_output[$object->entity]; |
| 331 | 331 | } |
| 332 | - $pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
| 332 | + $pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
| 333 | 333 | $tplidx = $pdf->importPage(1); |
| 334 | 334 | } |
| 335 | 335 | |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | // $pdf->GetY() here can't be used. It is bottom of the second addresse box but first one may be higher |
| 443 | 443 | |
| 444 | 444 | // $tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks) |
| 445 | - $tab_top = 90 + $top_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
| 445 | + $tab_top = 90 + $top_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
| 446 | 446 | $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); |
| 447 | 447 | |
| 448 | 448 | // You can add more thing under header here, if you increase $extra_under_address_shift too. |
@@ -771,7 +771,7 @@ discard block |
||
| 771 | 771 | if (!isset($this->tva[$vatrate])) { |
| 772 | 772 | $this->tva[$vatrate] = 0; |
| 773 | 773 | } |
| 774 | - $this->tva[$vatrate] += $tvaligne; // ->tva is abandonned, we use now ->tva_array that is more complete |
|
| 774 | + $this->tva[$vatrate] += $tvaligne; // ->tva is abandonned, we use now ->tva_array that is more complete |
|
| 775 | 775 | $vatcode = $object->lines[$i]->vat_src_code; |
| 776 | 776 | if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { |
| 777 | 777 | $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; |
@@ -1132,7 +1132,7 @@ discard block |
||
| 1132 | 1132 | } |
| 1133 | 1133 | |
| 1134 | 1134 | $posxval = 52; |
| 1135 | - $posxend = 110; // End of x for text on left side |
|
| 1135 | + $posxend = 110; // End of x for text on left side |
|
| 1136 | 1136 | if ($this->page_largeur < 210) { // To work with US executive format |
| 1137 | 1137 | $posxend -= 10; |
| 1138 | 1138 | } |
@@ -1150,7 +1150,7 @@ discard block |
||
| 1150 | 1150 | $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); |
| 1151 | 1151 | $pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L'); |
| 1152 | 1152 | |
| 1153 | - $posy = $pdf->GetY() + 3; // We need spaces for 2 lines payment conditions |
|
| 1153 | + $posy = $pdf->GetY() + 3; // We need spaces for 2 lines payment conditions |
|
| 1154 | 1154 | } |
| 1155 | 1155 | |
| 1156 | 1156 | // Show category of operations |
@@ -1162,7 +1162,7 @@ discard block |
||
| 1162 | 1162 | |
| 1163 | 1163 | $pdf->SetFont('', '', $default_font_size - 2); |
| 1164 | 1164 | $pdf->SetXY($posxval, $posy); |
| 1165 | - $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
| 1165 | + $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
| 1166 | 1166 | $pdf->MultiCell($posxend - $posxval, 4, $categoryOfOperationLabel, 0, 'L'); |
| 1167 | 1167 | |
| 1168 | 1168 | $posy = $pdf->GetY() + 3; // for 2 lines |
@@ -1206,7 +1206,7 @@ discard block |
||
| 1206 | 1206 | require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; |
| 1207 | 1207 | $bac = new CompanyBankAccount($this->db); |
| 1208 | 1208 | $bac->fetch(0, $object->thirdparty->id); |
| 1209 | - $iban= $bac->iban.(($bac->iban && $bac->bic) ? ' / ' : '').$bac->bic; |
|
| 1209 | + $iban = $bac->iban.(($bac->iban && $bac->bic) ? ' / ' : '').$bac->bic; |
|
| 1210 | 1210 | $lib_mode_reg .= ' '.$outputlangs->trans("PaymentTypePREdetails", dol_trunc($iban, 6, 'right', 'UTF-8', 1)); |
| 1211 | 1211 | } |
| 1212 | 1212 | $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); |
@@ -1692,7 +1692,7 @@ discard block |
||
| 1692 | 1692 | if (empty($hidetop)) { |
| 1693 | 1693 | // Show category of operations |
| 1694 | 1694 | if (getDolGlobalInt('INVOICE_CATEGORY_OF_OPERATION') == 1 && $this->categoryOfOperation >= 0) { |
| 1695 | - $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations") . ' : ' . $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
| 1695 | + $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations").' : '.$outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
| 1696 | 1696 | $pdf->SetXY($this->marge_gauche, $tab_top - 4); |
| 1697 | 1697 | $pdf->MultiCell(($pdf->GetStringWidth($categoryOfOperations)) + 4, 2, $categoryOfOperations); |
| 1698 | 1698 | } |
@@ -1860,7 +1860,7 @@ discard block |
||
| 1860 | 1860 | } |
| 1861 | 1861 | if ($this->situationinvoice) { |
| 1862 | 1862 | $langs->loadLangs(array("other")); |
| 1863 | - $title = $outputlangs->transnoentities("PDFInvoiceSituation") . " " . $outputlangs->transnoentities("NumberingShort") . $object->situation_counter . " -"; |
|
| 1863 | + $title = $outputlangs->transnoentities("PDFInvoiceSituation")." ".$outputlangs->transnoentities("NumberingShort").$object->situation_counter." -"; |
|
| 1864 | 1864 | } |
| 1865 | 1865 | if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) { |
| 1866 | 1866 | $title .= ' - '; |
@@ -2086,7 +2086,7 @@ discard block |
||
| 2086 | 2086 | |
| 2087 | 2087 | $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); |
| 2088 | 2088 | |
| 2089 | - $mode = 'target'; |
|
| 2089 | + $mode = 'target'; |
|
| 2090 | 2090 | $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); |
| 2091 | 2091 | |
| 2092 | 2092 | // Show recipient |
@@ -2130,11 +2130,11 @@ discard block |
||
| 2130 | 2130 | $contactshipping = $object->fetch_Contact($idaddressshipping[0]); |
| 2131 | 2131 | $companystatic = new Societe($this->db); |
| 2132 | 2132 | $companystatic->fetch($object->contact->fk_soc); |
| 2133 | - $carac_client_name_shipping=pdfBuildThirdpartyName($object->contact, $outputlangs); |
|
| 2133 | + $carac_client_name_shipping = pdfBuildThirdpartyName($object->contact, $outputlangs); |
|
| 2134 | 2134 | $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $companystatic, $object->contact, $usecontact, 'target', $object); |
| 2135 | 2135 | } else { |
| 2136 | - $carac_client_name_shipping=pdfBuildThirdpartyName($object->thirdparty, $outputlangs); |
|
| 2137 | - $carac_client_shipping=pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'target', $object); |
|
| 2136 | + $carac_client_name_shipping = pdfBuildThirdpartyName($object->thirdparty, $outputlangs); |
|
| 2137 | + $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'target', $object); |
|
| 2138 | 2138 | } |
| 2139 | 2139 | if (!empty($carac_client_shipping)) { |
| 2140 | 2140 | $posy += $hautcadre; |
@@ -2153,7 +2153,7 @@ discard block |
||
| 2153 | 2153 | $posy = $pdf->getY(); |
| 2154 | 2154 | |
| 2155 | 2155 | // Show shipping information |
| 2156 | - $pdf->SetXY($posx+2, $posy); |
|
| 2156 | + $pdf->SetXY($posx + 2, $posy); |
|
| 2157 | 2157 | $pdf->SetFont('', '', $default_font_size - 1); |
| 2158 | 2158 | $pdf->MultiCell($widthrecbox - 2, 2, $carac_client_shipping, '', 'L'); |
| 2159 | 2159 | $top_shift += $hautcadre; |
@@ -469,7 +469,7 @@ |
||
| 469 | 469 | $object->fetch($obj->rowid); |
| 470 | 470 | $object->id = $obj->rowid; |
| 471 | 471 | |
| 472 | - $action = 'anonymize'; // TODO Offer also action "delete" in setup of module |
|
| 472 | + $action = 'anonymize'; // TODO Offer also action "delete" in setup of module |
|
| 473 | 473 | |
| 474 | 474 | if ($action == 'anonymize') { |
| 475 | 475 | if ($object->isObjectUsed($obj->rowid) == 0) { // If object to clean is used |