@@ -57,45 +57,45 @@ discard block |
||
| 57 | 57 | $search_mvt_num = GETPOST('search_mvt_num', 'alpha'); |
| 58 | 58 | $search_doc_type = GETPOST("search_doc_type", 'alpha'); |
| 59 | 59 | $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); |
| 60 | -$search_date_startyear = GETPOSTINT('search_date_startyear'); |
|
| 61 | -$search_date_startmonth = GETPOSTINT('search_date_startmonth'); |
|
| 62 | -$search_date_startday = GETPOSTINT('search_date_startday'); |
|
| 63 | -$search_date_endyear = GETPOSTINT('search_date_endyear'); |
|
| 64 | -$search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
|
| 65 | -$search_date_endday = GETPOSTINT('search_date_endday'); |
|
| 60 | +$search_date_startyear = GETPOSTINT('search_date_startyear'); |
|
| 61 | +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); |
|
| 62 | +$search_date_startday = GETPOSTINT('search_date_startday'); |
|
| 63 | +$search_date_endyear = GETPOSTINT('search_date_endyear'); |
|
| 64 | +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
|
| 65 | +$search_date_endday = GETPOSTINT('search_date_endday'); |
|
| 66 | 66 | $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); |
| 67 | 67 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 68 | 68 | $search_doc_date = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); |
| 69 | -$search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); |
|
| 70 | -$search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); |
|
| 71 | -$search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); |
|
| 72 | -$search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); |
|
| 73 | -$search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); |
|
| 74 | -$search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); |
|
| 69 | +$search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); |
|
| 70 | +$search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); |
|
| 71 | +$search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); |
|
| 72 | +$search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); |
|
| 73 | +$search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); |
|
| 74 | +$search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); |
|
| 75 | 75 | $search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); |
| 76 | 76 | $search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); |
| 77 | -$search_date_modification_startyear = GETPOSTINT('search_date_modification_startyear'); |
|
| 78 | -$search_date_modification_startmonth = GETPOSTINT('search_date_modification_startmonth'); |
|
| 79 | -$search_date_modification_startday = GETPOSTINT('search_date_modification_startday'); |
|
| 80 | -$search_date_modification_endyear = GETPOSTINT('search_date_modification_endyear'); |
|
| 81 | -$search_date_modification_endmonth = GETPOSTINT('search_date_modification_endmonth'); |
|
| 82 | -$search_date_modification_endday = GETPOSTINT('search_date_modification_endday'); |
|
| 77 | +$search_date_modification_startyear = GETPOSTINT('search_date_modification_startyear'); |
|
| 78 | +$search_date_modification_startmonth = GETPOSTINT('search_date_modification_startmonth'); |
|
| 79 | +$search_date_modification_startday = GETPOSTINT('search_date_modification_startday'); |
|
| 80 | +$search_date_modification_endyear = GETPOSTINT('search_date_modification_endyear'); |
|
| 81 | +$search_date_modification_endmonth = GETPOSTINT('search_date_modification_endmonth'); |
|
| 82 | +$search_date_modification_endday = GETPOSTINT('search_date_modification_endday'); |
|
| 83 | 83 | $search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear); |
| 84 | 84 | $search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear); |
| 85 | -$search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); |
|
| 86 | -$search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); |
|
| 87 | -$search_date_export_startday = GETPOSTINT('search_date_export_startday'); |
|
| 88 | -$search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); |
|
| 89 | -$search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); |
|
| 90 | -$search_date_export_endday = GETPOSTINT('search_date_export_endday'); |
|
| 85 | +$search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); |
|
| 86 | +$search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); |
|
| 87 | +$search_date_export_startday = GETPOSTINT('search_date_export_startday'); |
|
| 88 | +$search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); |
|
| 89 | +$search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); |
|
| 90 | +$search_date_export_endday = GETPOSTINT('search_date_export_endday'); |
|
| 91 | 91 | $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); |
| 92 | 92 | $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); |
| 93 | -$search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); |
|
| 94 | -$search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); |
|
| 95 | -$search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); |
|
| 96 | -$search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); |
|
| 97 | -$search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); |
|
| 98 | -$search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); |
|
| 93 | +$search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); |
|
| 94 | +$search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); |
|
| 95 | +$search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); |
|
| 96 | +$search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); |
|
| 97 | +$search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); |
|
| 98 | +$search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); |
|
| 99 | 99 | $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); |
| 100 | 100 | $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); |
| 101 | 101 | // Due date start |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | $search_date_due_start = ''; |
| 318 | 318 | // Due date end |
| 319 | 319 | $search_date_due_end_day = ''; |
| 320 | - $search_date_due_end_month = ''; |
|
| 320 | + $search_date_due_end_month = ''; |
|
| 321 | 321 | $search_date_due_end_year = ''; |
| 322 | 322 | $search_date_due_end = ''; |
| 323 | 323 | $search_debit = ''; |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | } |
| 567 | 567 | |
| 568 | 568 | if (!$error) { |
| 569 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 569 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 570 | 570 | exit(); |
| 571 | 571 | } |
| 572 | 572 | } elseif ($massaction == 'letteringmanual' && $permissiontoadd) { |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | setEventMessages('', $lettering->errors, 'errors'); |
| 577 | 577 | } else { |
| 578 | 578 | setEventMessages($langs->trans('AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs'); |
| 579 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 579 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 580 | 580 | exit(); |
| 581 | 581 | } |
| 582 | 582 | } elseif ($action == 'unletteringauto' && $confirm == "yes" && $permissiontoadd) { |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | } |
| 598 | 598 | |
| 599 | 599 | if (!$error) { |
| 600 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 600 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 601 | 601 | exit(); |
| 602 | 602 | } |
| 603 | 603 | } elseif ($action == 'unletteringmanual' && $confirm == "yes" && $permissiontoadd) { |
@@ -607,7 +607,7 @@ discard block |
||
| 607 | 607 | setEventMessages('', $lettering->errors, 'errors'); |
| 608 | 608 | } else { |
| 609 | 609 | setEventMessages($langs->trans('AccountancyOneUnletteringModifiedSuccessfully'), array(), 'mesgs'); |
| 610 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 610 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 611 | 611 | exit(); |
| 612 | 612 | } |
| 613 | 613 | } |
@@ -790,10 +790,10 @@ discard block |
||
| 790 | 790 | // List of mass actions available |
| 791 | 791 | $arrayofmassactions = array(); |
| 792 | 792 | if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) { |
| 793 | - $arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringAuto'); |
|
| 794 | - $arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringAuto'); |
|
| 795 | - $arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringManual'); |
|
| 796 | - $arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringManual'); |
|
| 793 | + $arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringAuto'); |
|
| 794 | + $arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringAuto'); |
|
| 795 | + $arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringManual'); |
|
| 796 | + $arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringManual'); |
|
| 797 | 797 | } |
| 798 | 798 | if ($user->hasRight('accounting', 'mouvements', 'supprimer')) { |
| 799 | 799 | $arrayofmassactions['predeletebookkeepingwriting'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); |
@@ -1214,7 +1214,7 @@ discard block |
||
| 1214 | 1214 | } |
| 1215 | 1215 | |
| 1216 | 1216 | // Document ref |
| 1217 | - $modulepart = ''; // may be used by include*.tpl.php |
|
| 1217 | + $modulepart = ''; // may be used by include*.tpl.php |
|
| 1218 | 1218 | if (!empty($arrayfields['t.doc_ref']['checked'])) { |
| 1219 | 1219 | $objectstatic = null; |
| 1220 | 1220 | |
@@ -1282,8 +1282,8 @@ discard block |
||
| 1282 | 1282 | $labeltoshow .= $objectstatic->getNomUrl(1); |
| 1283 | 1283 | $labeltoshowalt .= $objectstatic->ref; |
| 1284 | 1284 | $bank_ref = strstr($line->doc_ref, '-'); |
| 1285 | - $labeltoshow .= " " . $bank_ref; |
|
| 1286 | - $labeltoshowalt .= " " . $bank_ref; |
|
| 1285 | + $labeltoshow .= " ".$bank_ref; |
|
| 1286 | + $labeltoshowalt .= " ".$bank_ref; |
|
| 1287 | 1287 | } else { |
| 1288 | 1288 | $labeltoshow .= $line->doc_ref; |
| 1289 | 1289 | $labeltoshowalt .= $line->doc_ref; |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * \remarks To run this script as CLI: phpunit filename.php |
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | -global $conf,$user,$langs,$db; |
|
| 28 | +global $conf, $user, $langs, $db; |
|
| 29 | 29 | //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver |
| 30 | 30 | //require_once 'PHPUnit/Autoload.php'; |
| 31 | 31 | require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; |
@@ -33,35 +33,35 @@ discard block |
||
| 33 | 33 | require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php'; |
| 34 | 34 | require_once dirname(__FILE__).'/CommonClassTest.class.php'; |
| 35 | 35 | |
| 36 | -if (! defined('NOREQUIREUSER')) { |
|
| 36 | +if (!defined('NOREQUIREUSER')) { |
|
| 37 | 37 | define('NOREQUIREUSER', '1'); |
| 38 | 38 | } |
| 39 | -if (! defined('NOREQUIREDB')) { |
|
| 39 | +if (!defined('NOREQUIREDB')) { |
|
| 40 | 40 | define('NOREQUIREDB', '1'); |
| 41 | 41 | } |
| 42 | -if (! defined('NOREQUIRESOC')) { |
|
| 42 | +if (!defined('NOREQUIRESOC')) { |
|
| 43 | 43 | define('NOREQUIRESOC', '1'); |
| 44 | 44 | } |
| 45 | -if (! defined('NOREQUIRETRAN')) { |
|
| 45 | +if (!defined('NOREQUIRETRAN')) { |
|
| 46 | 46 | define('NOREQUIRETRAN', '1'); |
| 47 | 47 | } |
| 48 | -if (! defined('NOCSRFCHECK')) { |
|
| 48 | +if (!defined('NOCSRFCHECK')) { |
|
| 49 | 49 | define('NOCSRFCHECK', '1'); |
| 50 | 50 | } |
| 51 | -if (! defined('NOTOKENRENEWAL')) { |
|
| 51 | +if (!defined('NOTOKENRENEWAL')) { |
|
| 52 | 52 | define('NOTOKENRENEWAL', '1'); |
| 53 | 53 | } |
| 54 | -if (! defined('NOREQUIREMENU')) { |
|
| 54 | +if (!defined('NOREQUIREMENU')) { |
|
| 55 | 55 | define('NOREQUIREMENU', '1'); // If there is no menu to show |
| 56 | 56 | } |
| 57 | -if (! defined('NOREQUIREHTML')) { |
|
| 57 | +if (!defined('NOREQUIREHTML')) { |
|
| 58 | 58 | define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php |
| 59 | 59 | } |
| 60 | -if (! defined('NOREQUIREAJAX')) { |
|
| 60 | +if (!defined('NOREQUIREAJAX')) { |
|
| 61 | 61 | define('NOREQUIREAJAX', '1'); |
| 62 | 62 | } |
| 63 | -if (! defined("NOLOGIN")) { |
|
| 64 | - define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) |
|
| 63 | +if (!defined("NOLOGIN")) { |
|
| 64 | + define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | if (empty($user->id)) { |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | )); |
| 112 | 112 | */ |
| 113 | - return array_map(function ($value) { |
|
| 113 | + return array_map(function($value) { |
|
| 114 | 114 | return array($value); |
| 115 | 115 | }, $filesarray); |
| 116 | 116 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | || preg_match('/modules\/(import|mailings|printing)\//', $file['relativename']) |
| 144 | 144 | || in_array($file['name'], array('modules_boxes.php', 'TraceableDB.php'))) { |
| 145 | 145 | // Check Class files |
| 146 | - if (! in_array($file['name'], array( |
|
| 146 | + if (!in_array($file['name'], array( |
|
| 147 | 147 | 'api.class.php', |
| 148 | 148 | 'commonobject.class.php', |
| 149 | 149 | 'conf.class.php', |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | //exit; |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - if (preg_match('/\.class\.php$/', $file['relativename']) && ! in_array($file['relativename'], array( |
|
| 170 | + if (preg_match('/\.class\.php$/', $file['relativename']) && !in_array($file['relativename'], array( |
|
| 171 | 171 | 'adherents/class/adherent.class.php', |
| 172 | 172 | 'adherents/canvas/actions_adherentcard_common.class.php', |
| 173 | 173 | 'contact/canvas/actions_contactcard_common.class.php', |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | } else { |
| 213 | 213 | // Check Include files |
| 214 | - if (! in_array($file['name'], array( |
|
| 214 | + if (!in_array($file['name'], array( |
|
| 215 | 215 | 'objectline_view.tpl.php', |
| 216 | 216 | 'extrafieldsinexport.inc.php', |
| 217 | 217 | 'extrafieldsinimport.inc.php', |
@@ -372,9 +372,9 @@ discard block |
||
| 372 | 372 | $found = ""; |
| 373 | 373 | preg_match_all('/(sql|SET|WHERE|where|INSERT|insert|VALUES|LIKE).+\s*\'"\s*\.\s*\$(.......)/', $filecontent, $matches, PREG_SET_ORDER); |
| 374 | 374 | foreach ($matches as $key => $val) { |
| 375 | - if (! in_array($val[2], array('this->d', 'this->e', 'db->esc', 'dbs->es', 'dbs->id', 'mydb->e', 'dbsessi', 'db->ida', 'escaped', 'exclude', 'include'))) { |
|
| 375 | + if (!in_array($val[2], array('this->d', 'this->e', 'db->esc', 'dbs->es', 'dbs->id', 'mydb->e', 'dbsessi', 'db->ida', 'escaped', 'exclude', 'include'))) { |
|
| 376 | 376 | $found = $val[0]; |
| 377 | - $ok = false; // This will generate error |
|
| 377 | + $ok = false; // This will generate error |
|
| 378 | 378 | break; |
| 379 | 379 | } |
| 380 | 380 | //if ($reg[0] != 'db') $ok=false; |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | $found = ""; |
| 390 | 390 | preg_match_all('/(\$sql|SET\s|WHERE\s|INSERT\s|VALUES\s|VALUES\().+\s*\'\s*\.\s*\$(.........)/', $filecontent, $matches, PREG_SET_ORDER); |
| 391 | 391 | foreach ($matches as $key => $val) { |
| 392 | - if (! in_array($val[2], array('this->db-', 'db->prefi', 'db->sanit', 'dbs->pref', 'dbs->sani', 'conf->ent', 'key : \'\')', 'key])."\')', 'excludefi', 'regexstri', ''))) { |
|
| 392 | + if (!in_array($val[2], array('this->db-', 'db->prefi', 'db->sanit', 'dbs->pref', 'dbs->sani', 'conf->ent', 'key : \'\')', 'key])."\')', 'excludefi', 'regexstri', ''))) { |
|
| 393 | 393 | $found = $val[0]; |
| 394 | 394 | $ok = false; |
| 395 | 395 | var_dump($matches); |
@@ -803,7 +803,7 @@ discard block |
||
| 803 | 803 | { |
| 804 | 804 | return preg_replace_callback( |
| 805 | 805 | '{(//.*?$)|(/\*.*?\*/)}ms', |
| 806 | - static function ($match) { |
|
| 806 | + static function($match) { |
|
| 807 | 807 | if (isset($match[2])) { |
| 808 | 808 | // Count the number of newline characters in the comment |
| 809 | 809 | $num_newlines = substr_count($match[0], "\n"); |