@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | |
501 | 501 | // Add fields from hooks - ListFrom |
502 | 502 | $parameters = array(); |
503 | -$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
|
503 | +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
|
504 | 504 | $sql .= $hookmanager->resPrint; |
505 | 505 | $sql .= ' WHERE p.entity IN ('.getEntity('contact').')'; |
506 | 506 | if (empty($user->rights->societe->client->voir) && !$socid) { //restriction |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | if ($searchCategoryContactOperator == 0) { |
544 | 544 | $searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX."categorie_contact as ck WHERE p.rowid = ck.fk_socpeople AND ck.fk_categorie = ".((int) $searchCategoryContact).")"; |
545 | 545 | } else { |
546 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact); |
|
546 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryContact); |
|
547 | 547 | } |
548 | 548 | } |
549 | 549 | } |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | if ($searchCategoryCustomerOperator == 0) { |
576 | 576 | $searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategoryCustomer).")"; |
577 | 577 | } else { |
578 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); |
|
578 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryCustomer); |
|
579 | 579 | } |
580 | 580 | } |
581 | 581 | } |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | if ($searchCategorySupplierOperator == 0) { |
608 | 608 | $searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategorySupplier).")"; |
609 | 609 | } else { |
610 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier); |
|
610 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategorySupplier); |
|
611 | 611 | } |
612 | 612 | } |
613 | 613 | } |
@@ -897,7 +897,7 @@ discard block |
||
897 | 897 | if (count($search_roles) > 0) { |
898 | 898 | $param .= implode('&search_roles[]=', $search_roles); |
899 | 899 | } |
900 | -if ($search_birthday_start) { |
|
900 | +if ($search_birthday_start) { |
|
901 | 901 | $param .= '&search_birthday_start='.urlencode(dol_print_date($search_birthday_start, '%d')).'&search_birthday_startmonth='.urlencode(dol_print_date($search_birthday_start, '%m')).'&search_birthday_startyear='.urlencode(dol_print_date($search_birthday_start, '%Y')); |
902 | 902 | } |
903 | 903 | if ($search_birthday_end) { |
@@ -918,7 +918,7 @@ discard block |
||
918 | 918 | if (isModEnabled('category') && $user->hasRight('societe', 'creer')) { |
919 | 919 | $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); |
920 | 920 | } |
921 | -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) { |
|
921 | +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) { |
|
922 | 922 | $arrayofmassactions = array(); |
923 | 923 | } |
924 | 924 | if ($contextpage != 'poslist') $massactionbutton = $form->selectMassAction('', $arrayofmassactions); |
@@ -946,7 +946,7 @@ discard block |
||
946 | 946 | if ($contextpage != 'poslist') { |
947 | 947 | $newcardbutton .= dolGetButtonTitle($langs->trans('NewContactAddress'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create', '', $permissiontoadd); |
948 | 948 | } elseif ($user->hasRight('societe', 'contact', 'creer')) { |
949 | - $url = DOL_URL_ROOT . '/contact/card.php?action=create&type=t&contextpage=poslist&optioncss=print&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?token=' . newToken() . 'type=t&contextpage=poslist&nomassaction=1&optioncss=print&place='.$place); |
|
949 | + $url = DOL_URL_ROOT.'/contact/card.php?action=create&type=t&contextpage=poslist&optioncss=print&backtopage='.urlencode($_SERVER["PHP_SELF"].'?token='.newToken().'type=t&contextpage=poslist&nomassaction=1&optioncss=print&place='.$place); |
|
950 | 950 | $label = 'MenuNewCustomer'; |
951 | 951 | $newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', $url); |
952 | 952 | } |
@@ -270,22 +270,22 @@ discard block |
||
270 | 270 | // Edit .sql file |
271 | 271 | if ($moduletype == 'internal') { |
272 | 272 | $pathoffiletoeditsrc = '/../install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql'; |
273 | - if (! dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
273 | + if (!dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
274 | 274 | $pathoffiletoeditsrc = '/../install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($objectname).'-'.strtolower($module).'.sql'; |
275 | - if (! dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
275 | + if (!dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
276 | 276 | $pathoffiletoeditsrc = '/../install/mysql/tables/llx_'.strtolower($module).'-'.strtolower($module).'.sql'; |
277 | - if (! dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
277 | + if (!dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
278 | 278 | $pathoffiletoeditsrc = '/../install/mysql/tables/llx_'.strtolower($module).'.sql'; |
279 | 279 | } |
280 | 280 | } |
281 | 281 | } |
282 | 282 | } else { |
283 | 283 | $pathoffiletoeditsrc = '/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql'; |
284 | - if (! dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
284 | + if (!dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
285 | 285 | $pathoffiletoeditsrc = '/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'-'.strtolower($module).'.sql'; |
286 | - if (! dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
286 | + if (!dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
287 | 287 | $pathoffiletoeditsrc = '/sql/llx_'.strtolower($module).'-'.strtolower($module).'.sql'; |
288 | - if (! dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
288 | + if (!dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
289 | 289 | $pathoffiletoeditsrc = '/sql/llx_'.strtolower($module).'.sql'; |
290 | 290 | } |
291 | 291 | } |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | $objects[$fileobj['fullname']] = $objectnameloop; |
443 | 443 | } |
444 | 444 | } |
445 | - if (count($objects)>0) { |
|
445 | + if (count($objects) > 0) { |
|
446 | 446 | return $objects; |
447 | 447 | } |
448 | 448 | |
@@ -552,12 +552,12 @@ discard block |
||
552 | 552 | } |
553 | 553 | } |
554 | 554 | } elseif ($action == -2 && !empty($objectname) && !empty($module)) { |
555 | - $key= null; |
|
555 | + $key = null; |
|
556 | 556 | $right = null; |
557 | 557 | $objectOfRights = array(); |
558 | 558 | //check if object already declared in rights file |
559 | 559 | foreach ($permissions as $right) { |
560 | - $objectOfRights[]= $right[4]; |
|
560 | + $objectOfRights[] = $right[4]; |
|
561 | 561 | } |
562 | 562 | if (in_array(strtolower($objectname), $objectOfRights)) { |
563 | 563 | $error++; |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | if (!$error) { |
585 | 585 | // prepare permissions array |
586 | 586 | $count_perms = count($permissions); |
587 | - for ($i = 0;$i<$count_perms;$i++) { |
|
587 | + for ($i = 0; $i < $count_perms; $i++) { |
|
588 | 588 | $permissions[$i][0] = "\$this->rights[\$r][0] = \$this->numero . sprintf('%02d', \$r + 1)"; |
589 | 589 | $permissions[$i][1] = "\$this->rights[\$r][1] = '".$permissions[$i][1]."'"; |
590 | 590 | $permissions[$i][4] = "\$this->rights[\$r][4] = '".$permissions[$i][4]."'"; |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | |
605 | 605 | |
606 | 606 | // parcourir les objets |
607 | - $o=0; |
|
607 | + $o = 0; |
|
608 | 608 | foreach ($permissions as &$object) { |
609 | 609 | // récupérer la permission de l'objet |
610 | 610 | $p = 1; |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | { |
700 | 700 | |
701 | 701 | // stock all properties in array |
702 | - $attributesUnique = array ('type','label', 'enabled', 'position', 'notnull', 'visible', 'noteditable', 'index', 'default' , 'foreignkey', 'arrayofkeyval', 'alwayseditable','validate', 'searchall','comment', 'isameasure', 'css', 'cssview','csslist', 'help', 'showoncombobox','picto' ); |
|
702 | + $attributesUnique = array('type', 'label', 'enabled', 'position', 'notnull', 'visible', 'noteditable', 'index', 'default', 'foreignkey', 'arrayofkeyval', 'alwayseditable', 'validate', 'searchall', 'comment', 'isameasure', 'css', 'cssview', 'csslist', 'help', 'showoncombobox', 'picto'); |
|
703 | 703 | |
704 | 704 | $start = "public \$fields=array("; |
705 | 705 | $end = ");"; |
@@ -729,7 +729,7 @@ discard block |
||
729 | 729 | foreach ($attributesUnique as $attUnique) { |
730 | 730 | $table .= "|".$attUnique; |
731 | 731 | } |
732 | - $table .="\n"; |
|
732 | + $table .= "\n"; |
|
733 | 733 | $valuesModif = array(); |
734 | 734 | foreach ($keys as $string) { |
735 | 735 | $string = trim($string, "'"); |
@@ -769,8 +769,8 @@ discard block |
||
769 | 769 | $valuesModif[$attUnique] = $values[$attUnique]; |
770 | 770 | } |
771 | 771 | } |
772 | - $table .= "|*" . $field[0] . "*|"; |
|
773 | - $table .= implode("|", $valuesModif) . "\n"; |
|
772 | + $table .= "|*".$field[0]."*|"; |
|
773 | + $table .= implode("|", $valuesModif)."\n"; |
|
774 | 774 | } |
775 | 775 | |
776 | 776 | // end table |
@@ -779,7 +779,7 @@ discard block |
||
779 | 779 | |
780 | 780 | //write in file |
781 | 781 | $writeInFile = dolReplaceInFile($destfile, array('== DATA SPECIFICATIONS' => $table)); |
782 | - if ($writeInFile<0) { |
|
782 | + if ($writeInFile < 0) { |
|
783 | 783 | return -1; |
784 | 784 | } |
785 | 785 | return 1; |
@@ -801,13 +801,13 @@ discard block |
||
801 | 801 | |
802 | 802 | $str = file_get_contents($file); |
803 | 803 | |
804 | - $search = '/' . preg_quote($start, '/') . '(.*?)' . preg_quote($end, '/') . '/s'; |
|
804 | + $search = '/'.preg_quote($start, '/').'(.*?)'.preg_quote($end, '/').'/s'; |
|
805 | 805 | $new_contents = preg_replace($search, '', $str); |
806 | 806 | file_put_contents($file, $new_contents); |
807 | 807 | |
808 | 808 | //perms If Exist |
809 | 809 | $perms = "|*".strtolower($objectname)."*|"; |
810 | - $search_pattern_perms = '/' . preg_quote($perms, '/') . '.*?\n/'; |
|
810 | + $search_pattern_perms = '/'.preg_quote($perms, '/').'.*?\n/'; |
|
811 | 811 | $new_contents = preg_replace($search_pattern_perms, '', $new_contents); |
812 | 812 | file_put_contents($file, $new_contents); |
813 | 813 | } |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | $string = "[options='header',grid=rows,width=60%,caption=Organisation]\n"; |
865 | 865 | $string .= "|===\n"; |
866 | 866 | // header for table |
867 | - $header = array($langs->trans('Objects'),$langs->trans('Permission')); |
|
867 | + $header = array($langs->trans('Objects'), $langs->trans('Permission')); |
|
868 | 868 | foreach ($header as $h) { |
869 | 869 | $string .= "|".$h; |
870 | 870 | } |
@@ -891,7 +891,7 @@ discard block |
||
891 | 891 | foreach ($permissions as $key => $element) { |
892 | 892 | $element = str_replace(" '", '', $element); |
893 | 893 | $element = trim($element, "'"); |
894 | - $permsN[] = substr($element, strpos($element, "=")+1); |
|
894 | + $permsN[] = substr($element, strpos($element, "=") + 1); |
|
895 | 895 | } |
896 | 896 | array_pop($permsN); |
897 | 897 | |
@@ -921,7 +921,7 @@ discard block |
||
921 | 921 | // end table |
922 | 922 | $string .= "\n|===\n"; |
923 | 923 | $write = dolReplaceInFile($destfile, array('__DATA_PERMISSIONS__'=> $string)); |
924 | - if ($write<0) { |
|
924 | + if ($write < 0) { |
|
925 | 925 | return -1; |
926 | 926 | } |
927 | 927 | return 1; |
@@ -950,26 +950,26 @@ discard block |
||
950 | 950 | if (strpos($lineContent, $varcomented) !== false) { |
951 | 951 | $lineContent = ''; |
952 | 952 | foreach ($objects as $object) { |
953 | - $lineContent .= "\t * @var ".$object." \$".strtolower($object)." {@type ".$object."}". PHP_EOL; |
|
953 | + $lineContent .= "\t * @var ".$object." \$".strtolower($object)." {@type ".$object."}".PHP_EOL; |
|
954 | 954 | } |
955 | 955 | //var_dump($lineContent);exit; |
956 | 956 | } |
957 | 957 | if (strpos($lineContent, $props) !== false) { |
958 | 958 | $lineContent = ''; |
959 | 959 | foreach ($objects as $object) { |
960 | - $lineContent .= "\tpublic \$".strtolower($object).";". PHP_EOL; |
|
960 | + $lineContent .= "\tpublic \$".strtolower($object).";".PHP_EOL; |
|
961 | 961 | } |
962 | 962 | } |
963 | 963 | if (strpos($lineContent, $constructObj) !== false) { |
964 | 964 | $lineContent = ''; |
965 | 965 | foreach ($objects as $object) { |
966 | - $lineContent .= "\t\t\$this->".strtolower($object)." = new ".$object."(\$this->db);". PHP_EOL; |
|
966 | + $lineContent .= "\t\t\$this->".strtolower($object)." = new ".$object."(\$this->db);".PHP_EOL; |
|
967 | 967 | } |
968 | 968 | } |
969 | 969 | if (strpos($lineContent, $includeClass) !== false) { |
970 | 970 | $lineContent = ''; |
971 | 971 | foreach ($objects as $object) { |
972 | - $lineContent .= "dol_include_once('/".strtolower($modulename)."/class/".strtolower($object).".class.php');". PHP_EOL; |
|
972 | + $lineContent .= "dol_include_once('/".strtolower($modulename)."/class/".strtolower($object).".class.php');".PHP_EOL; |
|
973 | 973 | } |
974 | 974 | } |
975 | 975 | } |
@@ -979,10 +979,10 @@ discard block |
||
979 | 979 | //add methods for each object |
980 | 980 | $allContent = getFromFile($file, '/*begin methods CRUD*/', '/*end methods CRUD*/'); |
981 | 981 | foreach ($objects as $object) { |
982 | - $contentReplaced =str_replace(["myobject","MyObject"], [strtolower($object),$object], $allContent); |
|
982 | + $contentReplaced = str_replace(["myobject", "MyObject"], [strtolower($object), $object], $allContent); |
|
983 | 983 | dolReplaceInFile($file, array('/*end methods CRUD*/' => '/*CRUD FOR '.strtoupper($object).'*/'."\n".$contentReplaced."\n\t".'/*END CRUD FOR '.strtoupper($object).'*/'."\n\t".'/*end methods CRUD*/')); |
984 | 984 | } |
985 | - dolReplaceInFile($file, array($allContent => '','MyModule' => ucfirst($modulename))); |
|
985 | + dolReplaceInFile($file, array($allContent => '', 'MyModule' => ucfirst($modulename))); |
|
986 | 986 | return 1; |
987 | 987 | } |
988 | 988 | |
@@ -1043,7 +1043,7 @@ discard block |
||
1043 | 1043 | */ |
1044 | 1044 | function reWriteAllMenus($file, $menus, $menuWantTo, $key, $action) |
1045 | 1045 | { |
1046 | - $errors =0; |
|
1046 | + $errors = 0; |
|
1047 | 1047 | $counter = 0; |
1048 | 1048 | if (!file_exists($file)) { |
1049 | 1049 | return -1; |
@@ -1056,7 +1056,7 @@ discard block |
||
1056 | 1056 | array_push($menus, $menuWantTo); |
1057 | 1057 | } elseif ($action == 2 && !empty($key) && !empty($menuWantTo)) { |
1058 | 1058 | // update right from permissions array |
1059 | - $urlCounter=0; |
|
1059 | + $urlCounter = 0; |
|
1060 | 1060 | // check if the values already exists |
1061 | 1061 | foreach ($menus as $index => $menu) { |
1062 | 1062 | if ($index !== $key) { |
@@ -1104,20 +1104,20 @@ discard block |
||
1104 | 1104 | $next_val = empty($menus[$index + 1]) ? null : $menus[$index + 1]; |
1105 | 1105 | |
1106 | 1106 | $str_menu .= $start."\n"; |
1107 | - $str_menu.= "\t\t\$this->menu[\$r++]=array(\n"; |
|
1108 | - $str_menu.= "\t\t\t 'fk_menu' =>'".$menu['fk_menu']."',\n"; |
|
1109 | - $str_menu.= "\t\t\t 'type' =>'".$menu['type']."',\n"; |
|
1110 | - $str_menu.= "\t\t\t 'titre' =>'".$menu['titre']."',\n"; |
|
1111 | - $str_menu.= "\t\t\t 'mainmenu' =>'".$menu['mainmenu']."',\n"; |
|
1112 | - $str_menu.= "\t\t\t 'leftmenu' =>'".$menu['leftmenu']."',\n"; |
|
1113 | - $str_menu.= "\t\t\t 'url' =>'".$menu['url']."',\n"; |
|
1114 | - $str_menu.= "\t\t\t 'langs' =>'".$menu['langs']."',\n"; |
|
1115 | - $str_menu.= "\t\t\t 'position' =>".$menu['position'].",\n"; |
|
1116 | - $str_menu.= "\t\t\t 'enabled' =>'".$menu['enabled']."',\n"; |
|
1117 | - $str_menu.= "\t\t\t 'perms' =>'".$menu['perms']."',\n"; |
|
1118 | - $str_menu.= "\t\t\t 'target' =>'".$menu['target']."',\n"; |
|
1119 | - $str_menu.= "\t\t\t 'user' =>".$menu['user'].",\n"; |
|
1120 | - $str_menu.= "\t\t);\n"; |
|
1107 | + $str_menu .= "\t\t\$this->menu[\$r++]=array(\n"; |
|
1108 | + $str_menu .= "\t\t\t 'fk_menu' =>'".$menu['fk_menu']."',\n"; |
|
1109 | + $str_menu .= "\t\t\t 'type' =>'".$menu['type']."',\n"; |
|
1110 | + $str_menu .= "\t\t\t 'titre' =>'".$menu['titre']."',\n"; |
|
1111 | + $str_menu .= "\t\t\t 'mainmenu' =>'".$menu['mainmenu']."',\n"; |
|
1112 | + $str_menu .= "\t\t\t 'leftmenu' =>'".$menu['leftmenu']."',\n"; |
|
1113 | + $str_menu .= "\t\t\t 'url' =>'".$menu['url']."',\n"; |
|
1114 | + $str_menu .= "\t\t\t 'langs' =>'".$menu['langs']."',\n"; |
|
1115 | + $str_menu .= "\t\t\t 'position' =>".$menu['position'].",\n"; |
|
1116 | + $str_menu .= "\t\t\t 'enabled' =>'".$menu['enabled']."',\n"; |
|
1117 | + $str_menu .= "\t\t\t 'perms' =>'".$menu['perms']."',\n"; |
|
1118 | + $str_menu .= "\t\t\t 'target' =>'".$menu['target']."',\n"; |
|
1119 | + $str_menu .= "\t\t\t 'user' =>".$menu['user'].",\n"; |
|
1120 | + $str_menu .= "\t\t);\n"; |
|
1121 | 1121 | |
1122 | 1122 | if (is_null($next_val) || $val_actuel['leftmenu'] !== $next_val['leftmenu']) { |
1123 | 1123 | $str_menu .= $end."\n"; |
@@ -1154,21 +1154,21 @@ discard block |
||
1154 | 1154 | $dicData .= "\t\t\t'$key'=>"; |
1155 | 1155 | |
1156 | 1156 | if ($key === 'tabcond') { |
1157 | - $conditions = array_map(function ($val) use ($module) { |
|
1157 | + $conditions = array_map(function($val) use ($module) { |
|
1158 | 1158 | return ($val === true || $val === false) ? "isModEnabled('$module')" : $val; |
1159 | 1159 | }, $value); |
1160 | - $dicData .= "array(" . implode(",", $conditions) . ")"; |
|
1160 | + $dicData .= "array(".implode(",", $conditions).")"; |
|
1161 | 1161 | } elseif ($key === 'tabhelp') { |
1162 | 1162 | $helpItems = array(); |
1163 | 1163 | foreach ($value as $key => $helpValue) { |
1164 | 1164 | $helpItems[] = "array('code'=>\$langs->trans('".$helpValue['code']."'), 'field2' => 'field2tooltip')"; |
1165 | 1165 | } |
1166 | - $dicData .= "array(" . implode(",", $helpItems) . ")"; |
|
1166 | + $dicData .= "array(".implode(",", $helpItems).")"; |
|
1167 | 1167 | } else { |
1168 | 1168 | if (is_array($value)) { |
1169 | - $dicData .= "array(" . implode(",", array_map(function ($val) { |
|
1169 | + $dicData .= "array(".implode(",", array_map(function($val) { |
|
1170 | 1170 | return "'$val'"; |
1171 | - }, $value)) . ")"; |
|
1171 | + }, $value)).")"; |
|
1172 | 1172 | } else { |
1173 | 1173 | $dicData .= "'$value'"; |
1174 | 1174 | } |
@@ -1234,7 +1234,7 @@ discard block |
||
1234 | 1234 | } |
1235 | 1235 | } |
1236 | 1236 | // check if tablename exist in Database and create it if not |
1237 | - $query = "SHOW TABLES LIKE '" . MAIN_DB_PREFIX.strtolower($namedic) . "'"; |
|
1237 | + $query = "SHOW TABLES LIKE '".MAIN_DB_PREFIX.strtolower($namedic)."'"; |
|
1238 | 1238 | $checkTable = $db->query($query); |
1239 | 1239 | if ($checkTable && $db->num_rows($checkTable) > 0) { |
1240 | 1240 | setEventMessages($langs->trans("ErrorTableExist", $namedic), null, 'errors'); |
@@ -1343,9 +1343,9 @@ discard block |
||
1343 | 1343 | |
1344 | 1344 | foreach ($allFilesAndDirs as $item) { |
1345 | 1345 | if ($item != '.' && $item != '..') { |
1346 | - if ($type == 1 && is_file($path . DIRECTORY_SEPARATOR . $item) && strpos($item, '.back') === false) { |
|
1346 | + if ($type == 1 && is_file($path.DIRECTORY_SEPARATOR.$item) && strpos($item, '.back') === false) { |
|
1347 | 1347 | $count++; |
1348 | - } elseif ($type == 2 && is_dir($path . DIRECTORY_SEPARATOR . $item)) { |
|
1348 | + } elseif ($type == 2 && is_dir($path.DIRECTORY_SEPARATOR.$item)) { |
|
1349 | 1349 | $count++; |
1350 | 1350 | } |
1351 | 1351 | } |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>'; |
308 | 308 | |
309 | 309 | // SuperAdministrator access only |
310 | - if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
|
310 | + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
|
311 | 311 | print $form->selectarray('MAIN_MAIL_SENDMODE_TICKET', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_TICKET); |
312 | 312 | } else { |
313 | 313 | $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET')]; |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | } |
317 | 317 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
318 | 318 | print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); |
319 | - print '<input type="hidden" name="MAIN_MAIL_SENDMODE_TICKET" value="' . getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET').'">'; |
|
319 | + print '<input type="hidden" name="MAIN_MAIL_SENDMODE_TICKET" value="'.getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET').'">'; |
|
320 | 320 | } |
321 | 321 | print '</td></tr>'; |
322 | 322 | |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { |
438 | 438 | print '<tr class="oddeven smtp_oauth_service hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>'; |
439 | 439 | // SuperAdministrator access only |
440 | - if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
|
440 | + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
|
441 | 441 | print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET); |
442 | 442 | } else { |
443 | 443 | $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET')]; |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | } |
447 | 447 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
448 | 448 | print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); |
449 | - print '<input type="hidden" name="MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET" value="' . getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET').'">'; |
|
449 | + print '<input type="hidden" name="MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET" value="'.getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET').'">'; |
|
450 | 450 | } |
451 | 451 | print '</td></tr>'; |
452 | 452 | } |
@@ -526,13 +526,13 @@ discard block |
||
526 | 526 | // AUTH method |
527 | 527 | if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { |
528 | 528 | $authtype = getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET', 'LOGIN'); |
529 | - $text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : '') ; |
|
529 | + $text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : ''); |
|
530 | 530 | print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").'</td><td>'.$text.'</td></tr>'; |
531 | 531 | } |
532 | 532 | |
533 | 533 | // SMTPS ID |
534 | 534 | if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer'))) { |
535 | - print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>' . getDolGlobalString('MAIN_MAIL_SMTPS_ID_TICKET').'</td></tr>'; |
|
535 | + print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>'.getDolGlobalString('MAIN_MAIL_SMTPS_ID_TICKET').'</td></tr>'; |
|
536 | 536 | } |
537 | 537 | |
538 | 538 | // SMTPS PW |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | } |
328 | 328 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
329 | 329 | print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); |
330 | - print '<input type="hidden" name="MAIN_MAIL_SENDMODE_EMAILING" value="' . getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING').'">'; |
|
330 | + print '<input type="hidden" name="MAIN_MAIL_SENDMODE_EMAILING" value="'.getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING').'">'; |
|
331 | 331 | } |
332 | 332 | print '</td></tr>'; |
333 | 333 | |
@@ -352,15 +352,15 @@ discard block |
||
352 | 352 | print '</td><td>'; |
353 | 353 | // SuperAdministrator access only |
354 | 354 | if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
355 | - print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="' . $mainserver . '">'; |
|
356 | - print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="' . $mainserver . '">'; |
|
357 | - print '<span id="smtp_server_mess" class="opacitymedium">' . $langs->trans("SeeLocalSendMailSetup") . '</span>'; |
|
358 | - print ' <span class="opacitymedium smtp_method">' . $langs->trans("SeeLinkToOnlineDocumentation") . '</span>'; |
|
355 | + print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="'.$mainserver.'">'; |
|
356 | + print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="'.$mainserver.'">'; |
|
357 | + print '<span id="smtp_server_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>'; |
|
358 | + print ' <span class="opacitymedium smtp_method">'.$langs->trans("SeeLinkToOnlineDocumentation").'</span>'; |
|
359 | 359 | } else { |
360 | 360 | $text = !empty($mainserver) ? $mainserver : $smtpserver; |
361 | 361 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
362 | 362 | print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); |
363 | - print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="' . $mainserver . '">'; |
|
363 | + print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="'.$mainserver.'">'; |
|
364 | 364 | } |
365 | 365 | print '</td>'; |
366 | 366 | } |
@@ -384,14 +384,14 @@ discard block |
||
384 | 384 | print '</td><td>'; |
385 | 385 | // SuperAdministrator access only |
386 | 386 | if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
387 | - print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="' . $mainport . '">'; |
|
388 | - print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="' . $mainport . '">'; |
|
389 | - print '<span id="smtp_port_mess" class="opacitymedium">' . $langs->trans("SeeLocalSendMailSetup") . '</span>'; |
|
387 | + print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="'.$mainport.'">'; |
|
388 | + print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="'.$mainport.'">'; |
|
389 | + print '<span id="smtp_port_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>'; |
|
390 | 390 | } else { |
391 | 391 | $text = (!empty($mainport) ? $mainport : $smtpport); |
392 | 392 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
393 | 393 | print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); |
394 | - print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" value="' . $mainport . '">'; |
|
394 | + print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" value="'.$mainport.'">'; |
|
395 | 395 | } |
396 | 396 | } |
397 | 397 | print '</td></tr>'; |
@@ -418,14 +418,14 @@ discard block |
||
418 | 418 | // ID |
419 | 419 | if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { |
420 | 420 | $mainstmpid = (!empty($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING) ? $conf->global->MAIN_MAIL_SMTPS_ID_EMAILING : ''); |
421 | - print '<tr class="drag drop oddeven hideifdefault"><td>' . $langs->trans("MAIN_MAIL_SMTPS_ID") . '</td><td>'; |
|
421 | + print '<tr class="drag drop oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>'; |
|
422 | 422 | // SuperAdministrator access only |
423 | 423 | if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
424 | - print '<input class="flat" name="MAIN_MAIL_SMTPS_ID_EMAILING" size="32" value="' . $mainstmpid . '">'; |
|
424 | + print '<input class="flat" name="MAIN_MAIL_SMTPS_ID_EMAILING" size="32" value="'.$mainstmpid.'">'; |
|
425 | 425 | } else { |
426 | 426 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
427 | 427 | print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING, $htmltext, 1, 'superadmin'); |
428 | - print '<input type="hidden" name="MAIN_MAIL_SMTPS_ID_EMAILING" value="' . $mainstmpid . '">'; |
|
428 | + print '<input type="hidden" name="MAIN_MAIL_SMTPS_ID_EMAILING" value="'.$mainstmpid.'">'; |
|
429 | 429 | } |
430 | 430 | print '</td></tr>'; |
431 | 431 | } |
@@ -433,14 +433,14 @@ discard block |
||
433 | 433 | // PW |
434 | 434 | if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { |
435 | 435 | $mainsmtppw = (!empty($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING) ? $conf->global->MAIN_MAIL_SMTPS_PW_EMAILING : ''); |
436 | - print '<tr class="drag drop oddeven smtp_pw hideifdefault"><td>' . $langs->trans("MAIN_MAIL_SMTPS_PW") . '</td><td>'; |
|
436 | + print '<tr class="drag drop oddeven smtp_pw hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_PW").'</td><td>'; |
|
437 | 437 | // SuperAdministrator access only |
438 | 438 | if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
439 | - print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW_EMAILING" size="32" value="' . $mainsmtppw . '">'; |
|
439 | + print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW_EMAILING" size="32" value="'.$mainsmtppw.'">'; |
|
440 | 440 | } else { |
441 | 441 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
442 | 442 | print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING, $htmltext, 1, 'superadmin'); |
443 | - print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW_EMAILING" value="' . $mainsmtppw . '">'; |
|
443 | + print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW_EMAILING" value="'.$mainsmtppw.'">'; |
|
444 | 444 | } |
445 | 445 | print '</td></tr>'; |
446 | 446 | } |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | print '<tr class="oddeven smtp_oauth_service hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>'; |
451 | 451 | |
452 | 452 | // SuperAdministrator access only |
453 | - if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
|
453 | + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
|
454 | 454 | print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING); |
455 | 455 | } else { |
456 | 456 | $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING')]; |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | } |
460 | 460 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
461 | 461 | print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); |
462 | - print '<input type="hidden" name="MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING" value="' . getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING').'">'; |
|
462 | + print '<input type="hidden" name="MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING" value="'.getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING').'">'; |
|
463 | 463 | } |
464 | 464 | print '</td></tr>'; |
465 | 465 | } |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | // AUTH method |
553 | 553 | if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { |
554 | 554 | $authtype = getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING', 'LOGIN'); |
555 | - $text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : '') ; |
|
555 | + $text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : ''); |
|
556 | 556 | print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").'</td><td>'.$text.'</td></tr>'; |
557 | 557 | } |
558 | 558 | |
@@ -646,16 +646,16 @@ discard block |
||
646 | 646 | if (!empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') { |
647 | 647 | if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'mail' || !$linuxlike) { |
648 | 648 | if (function_exists('fsockopen') && $port && $server) { |
649 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=testconnect">' . $langs->trans("DoTestServerAvailability") . '</a>'; |
|
649 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect">'.$langs->trans("DoTestServerAvailability").'</a>'; |
|
650 | 650 | } |
651 | 651 | } else { |
652 | - print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("FeatureNotAvailableOnLinux") . '">' . $langs->trans("DoTestServerAvailability") . '</a>'; |
|
652 | + print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>'; |
|
653 | 653 | } |
654 | 654 | |
655 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=test&mode=init">' . $langs->trans("DoTestSend") . '</a>'; |
|
655 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&mode=init">'.$langs->trans("DoTestSend").'</a>'; |
|
656 | 656 | |
657 | 657 | if (isModEnabled('fckeditor')) { |
658 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=testhtml&mode=init">' . $langs->trans("DoTestSendHTML") . '</a>'; |
|
658 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testhtml&mode=init">'.$langs->trans("DoTestSendHTML").'</a>'; |
|
659 | 659 | } |
660 | 660 | } |
661 | 661 |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>'; |
384 | 384 | |
385 | 385 | // SuperAdministrator access only |
386 | - if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
|
386 | + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
|
387 | 387 | print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail')); |
388 | 388 | } else { |
389 | 389 | $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE')]; |
@@ -502,11 +502,11 @@ discard block |
||
502 | 502 | print '</td><td>'; |
503 | 503 | // SuperAdministrator access only |
504 | 504 | if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
505 | - print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW" size="32" value="' . htmlspecialchars($mainsmtppw, ENT_COMPAT, 'UTF-8') . '" autocomplete="off">'; |
|
505 | + print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW" size="32" value="'.htmlspecialchars($mainsmtppw, ENT_COMPAT, 'UTF-8').'" autocomplete="off">'; |
|
506 | 506 | } else { |
507 | 507 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
508 | 508 | print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW, $htmltext, 1, 'superadmin'); |
509 | - print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW" value="' . htmlspecialchars($mainsmtppw, ENT_COMPAT, 'UTF-8') . '">'; |
|
509 | + print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW" value="'.htmlspecialchars($mainsmtppw, ENT_COMPAT, 'UTF-8').'">'; |
|
510 | 510 | } |
511 | 511 | print '</td></tr>'; |
512 | 512 | } |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | print '<tr class="oddeven smtp_oauth_service"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>'; |
517 | 517 | |
518 | 518 | // SuperAdministrator access only |
519 | - if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
|
519 | + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
|
520 | 520 | print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE); |
521 | 521 | } else { |
522 | 522 | $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE')]; |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | } |
526 | 526 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
527 | 527 | print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); |
528 | - print '<input type="hidden" name="MAIN_MAIL_SMTPS_OAUTH_SERVICE" value="' . getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE').'">'; |
|
528 | + print '<input type="hidden" name="MAIN_MAIL_SMTPS_OAUTH_SERVICE" value="'.getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE').'">'; |
|
529 | 529 | } |
530 | 530 | print '</td></tr>'; |
531 | 531 | } |
@@ -717,13 +717,13 @@ discard block |
||
717 | 717 | // AUTH method |
718 | 718 | if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) { |
719 | 719 | $authtype = getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE', 'LOGIN'); |
720 | - $text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : '') ; |
|
720 | + $text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : ''); |
|
721 | 721 | print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").'</td><td>'.$text.'</td></tr>'; |
722 | 722 | } |
723 | 723 | |
724 | 724 | // SMTPS ID |
725 | 725 | if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) { |
726 | - print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>' . getDolGlobalString('MAIN_MAIL_SMTPS_ID').'</td></tr>'; |
|
726 | + print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>'.getDolGlobalString('MAIN_MAIL_SMTPS_ID').'</td></tr>'; |
|
727 | 727 | } |
728 | 728 | |
729 | 729 | // SMTPS PW |
@@ -832,7 +832,7 @@ discard block |
||
832 | 832 | // From |
833 | 833 | $help = img_help(1, $langs->trans("EMailHelpMsgSPFDKIM")); |
834 | 834 | print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).' '.$help.'</td>'; |
835 | - print '<td>' . getDolGlobalString('MAIN_MAIL_EMAIL_FROM'); |
|
835 | + print '<td>'.getDolGlobalString('MAIN_MAIL_EMAIL_FROM'); |
|
836 | 836 | if (empty($conf->global->MAIN_MAIL_EMAIL_FROM)) { |
837 | 837 | print img_warning($langs->trans("Mandatory")); |
838 | 838 | } elseif (!isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) { |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | $when = $beginning ? 1 : 0; |
89 | 89 | |
90 | 90 | if ($rate == 0) { |
91 | - return - ($future_value + $present_value) / $periods; |
|
91 | + return -($future_value + $present_value) / $periods; |
|
92 | 92 | } |
93 | 93 | |
94 | - return - ($future_value + ($present_value * \pow(1 + $rate, $periods))) |
|
94 | + return -($future_value + ($present_value * \pow(1 + $rate, $periods))) |
|
95 | 95 | / |
96 | 96 | ((1 + $rate * $when) / $rate * (\pow(1 + $rate, $periods) - 1)); |
97 | 97 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $when = $beginning ? 1 : 0; |
252 | 252 | |
253 | 253 | if ($rate == 0) { |
254 | - return - ($present_value + $future_value) / $payment; |
|
254 | + return -($present_value + $future_value) / $payment; |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | $initial = $payment * (1.0 + $rate * $when); |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | { |
500 | 500 | $when = $beginning ? 1 : 0; |
501 | 501 | |
502 | - $func = function ($x, $periods, $payment, $present_value, $future_value, $when) { |
|
502 | + $func = function($x, $periods, $payment, $present_value, $future_value, $when) { |
|
503 | 503 | return $future_value + $present_value * (1 + $x) ** $periods + $payment * (1 + $x * $when) / $x * ((1 + $x) ** $periods - 1); |
504 | 504 | }; |
505 | 505 | |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | */ |
534 | 534 | public static function irr(array $values, float $initial_guess = 0.1): float |
535 | 535 | { |
536 | - $func = function ($x, $values) { |
|
536 | + $func = function($x, $values) { |
|
537 | 537 | return Finance::npv($x, $values); |
538 | 538 | }; |
539 | 539 | |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | } |
632 | 632 | } |
633 | 633 | |
634 | - $nonzero = function ($x) { |
|
634 | + $nonzero = function($x) { |
|
635 | 635 | return $x != 0; |
636 | 636 | }; |
637 | 637 | |
@@ -764,7 +764,7 @@ discard block |
||
764 | 764 | } |
765 | 765 | } |
766 | 766 | |
767 | - $nonzero = function ($x) { |
|
767 | + $nonzero = function($x) { |
|
768 | 768 | return $x != 0; |
769 | 769 | }; |
770 | 770 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | |
41 | 41 | do { |
42 | 42 | $args1[$position] = $guess + $tol; // load the initial guess into the arguments |
43 | - $args[$position] = $guess; // load the initial guess into the arguments |
|
43 | + $args[$position] = $guess; // load the initial guess into the arguments |
|
44 | 44 | $y = $function(...$args); |
45 | 45 | $y_at_xplusdelx = $function(...$args1); |
46 | 46 | $slope = ($y_at_xplusdelx - $y) / $tol; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php'; |
93 | 93 | |
94 | -call_user_func(function () { |
|
94 | +call_user_func(function() { |
|
95 | 95 | $loader = Luracast\Restler\AutoLoader::instance(); |
96 | 96 | spl_autoload_register($loader); |
97 | 97 | return $loader; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | // Enable and test if module Api is enabled |
115 | -if (!isModEnabled('api') ) { |
|
115 | +if (!isModEnabled('api')) { |
|
116 | 116 | $langs->load("admin"); |
117 | 117 | dol_syslog("Call of Dolibarr API interfaces with module API REST are disabled"); |
118 | 118 | print $langs->trans("WarningModuleNotActive", 'Api').'.<br><br>'; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | // If MAIN_API_DEBUG is set to 1, we save logs into file "dolibarr_api.log" |
170 | 170 | if (!empty($conf->global->MAIN_API_DEBUG)) { |
171 | 171 | $r = $api->r; |
172 | - $r->onCall(function () use ($r) { |
|
172 | + $r->onCall(function() use ($r) { |
|
173 | 173 | // Don't log Luracast Restler Explorer recources calls |
174 | 174 | //if (!preg_match('/^explorer/', $r->url)) { |
175 | 175 | // 'method' => $api->r->requestMethod, |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | } |
355 | 355 | } |
356 | 356 | |
357 | - if (! $endpointisallowed) { |
|
357 | + if (!$endpointisallowed) { |
|
358 | 358 | dol_syslog('The API with endpoint /'.$classfile.' is forbidden by config API_ENDPOINT_RULES', LOG_WARNING); |
359 | 359 | print 'The API with endpoint /'.$classfile.' is forbidden by config API_ENDPOINT_RULES'; |
360 | 360 | header('HTTP/1.1 501 API is forbidden by API_ENDPOINT_RULES'); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | require_once '../../main.inc.php'; |
28 | 28 | |
29 | 29 | // Enable and test if module Api is enabled |
30 | -if (!isModEnabled('api') ) { |
|
30 | +if (!isModEnabled('api')) { |
|
31 | 31 | $langs->load("admin"); |
32 | 32 | dol_syslog("Call of Dolibarr API interfaces with module API REST are disabled"); |
33 | 33 | print $langs->trans("WarningModuleNotActive", 'Api').'.<br><br>'; |