@@ -259,7 +259,7 @@ |
||
259 | 259 | |
260 | 260 | print_barre_liste($langs->trans("ActionsOnMyObject").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>': ''), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1); |
261 | 261 | */ |
262 | - $titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>': ''); |
|
262 | + $titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); |
|
263 | 263 | print load_fiche_titre($titlelist, '', ''); |
264 | 264 | |
265 | 265 | // List of all actions |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | // Default sort order (if not yet defined by previous GETPOST) |
80 | 80 | if (!$sortfield) { |
81 | - reset($object->fields); // Reset is required to avoid key() to return null. |
|
81 | + reset($object->fields); // Reset is required to avoid key() to return null. |
|
82 | 82 | $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. |
83 | 83 | } |
84 | 84 | if (!$sortorder) { |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | // Output page |
373 | 373 | // -------------------------------------------------------------------- |
374 | 374 | |
375 | -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
375 | +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
376 | 376 | |
377 | 377 | // Example : Adding jquery code |
378 | 378 | // print '<script type="text/javascript"> |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'rowid' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
597 | 597 | $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
598 | 598 | } |
599 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
599 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
600 | 600 | if (!empty($arrayfields['t.'.$key]['checked'])) { |
601 | 601 | print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n"; |
602 | 602 | $totalarray['nbfield']++; |
@@ -149,7 +149,9 @@ discard block |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | // Security check (enable the most restrictive one) |
152 | -if ($user->socid > 0) accessforbidden(); |
|
152 | +if ($user->socid > 0) { |
|
153 | + accessforbidden(); |
|
154 | +} |
|
153 | 155 | //if ($user->socid > 0) accessforbidden(); |
154 | 156 | //$socid = 0; if ($user->socid > 0) $socid = $user->socid; |
155 | 157 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
@@ -157,7 +159,9 @@ discard block |
||
157 | 159 | if (!isModEnabled('bookcal')) { |
158 | 160 | accessforbidden('Module bookcal not enabled'); |
159 | 161 | } |
160 | -if (!$permissiontoread) accessforbidden(); |
|
162 | +if (!$permissiontoread) { |
|
163 | + accessforbidden(); |
|
164 | +} |
|
161 | 165 | |
162 | 166 | |
163 | 167 | /* |
@@ -311,7 +311,7 @@ |
||
311 | 311 | |
312 | 312 | print_barre_liste($langs->trans("ActionsOnMyObject").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>': ''), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1); |
313 | 313 | */ |
314 | - $titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>': ''); |
|
314 | + $titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); |
|
315 | 315 | print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0); |
316 | 316 | |
317 | 317 | // List of all actions |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | /** |
113 | 113 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
114 | 114 | */ |
115 | - public $fields=array( |
|
115 | + public $fields = array( |
|
116 | 116 | 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), |
117 | 117 | 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>20, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>"BookcalLabelAvailabilityHelp", 'showoncombobox'=>'2', 'validate'=>'1',), |
118 | 118 | 'fk_bookcal_calendar' => array('type'=>'integer:Calendar:bookcal/class/calendar.class.php:1', 'label'=>'Calendar', 'enabled'=>'1', 'position'=>25, 'notnull'=>1, 'visible'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150'), |
@@ -938,7 +938,7 @@ discard block |
||
938 | 938 | $this->date_creation = $this->db->jdate($obj->datec); |
939 | 939 | $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); |
940 | 940 | if (!empty($obj->datev)) { |
941 | - $this->date_validation = empty($obj->datev) ? '' : $this->db->jdate($obj->datev); |
|
941 | + $this->date_validation = empty($obj->datev) ? '' : $this->db->jdate($obj->datev); |
|
942 | 942 | } |
943 | 943 | } |
944 | 944 | |
@@ -1002,7 +1002,7 @@ discard block |
||
1002 | 1002 | if (!empty($conf->global->BOOKCAL_AVAILABILITIES_ADDON)) { |
1003 | 1003 | $mybool = false; |
1004 | 1004 | |
1005 | - $file = getDolGlobalString('BOOKCAL_AVAILABILITIES_ADDON') . ".php"; |
|
1005 | + $file = getDolGlobalString('BOOKCAL_AVAILABILITIES_ADDON').".php"; |
|
1006 | 1006 | $classname = $conf->global->BOOKCAL_AVAILABILITIES_ADDON; |
1007 | 1007 | |
1008 | 1008 | // Include file with class |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | /** |
114 | 114 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
115 | 115 | */ |
116 | - public $fields=array( |
|
116 | + public $fields = array( |
|
117 | 117 | 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'right', 'comment'=>"Id"), |
118 | 118 | 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'validate'=>'1', 'comment'=>"Reference of object", 'css'=>'width100'), |
119 | 119 | 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'alwayseditable'=>'1', 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>"Help text", 'showoncombobox'=>'2', 'validate'=>'1',), |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | $label = $langs->trans("ShowCalendar"); |
774 | 774 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
775 | 775 | } |
776 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
776 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
777 | 777 | $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
778 | 778 | } else { |
779 | 779 | $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
@@ -964,7 +964,7 @@ discard block |
||
964 | 964 | $this->date_creation = $this->db->jdate($obj->datec); |
965 | 965 | $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); |
966 | 966 | if (!empty($obj->datev)) { |
967 | - $this->date_validation = empty($obj->datev) ? '' : $this->db->jdate($obj->datev); |
|
967 | + $this->date_validation = empty($obj->datev) ? '' : $this->db->jdate($obj->datev); |
|
968 | 968 | } |
969 | 969 | } |
970 | 970 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | abstract class DoliDB implements Database |
31 | 31 | { |
32 | 32 | /** @var string Force subclass to implement VERSIONMIN */ |
33 | - const VERSIONMIN=self::VERSIONMIN; |
|
33 | + const VERSIONMIN = self::VERSIONMIN; |
|
34 | 34 | /** @var bool|resource|mysqli|SQLite3|PgSql\Connection Database handler */ |
35 | 35 | public $db; |
36 | 36 | /** @var string Database type */ |
@@ -124,10 +124,10 @@ discard block |
||
124 | 124 | public function regexpsql($subject, $pattern, $sqlstring = false) |
125 | 125 | { |
126 | 126 | if ($sqlstring) { |
127 | - return "(". $subject ." REGEXP '" . $pattern . "')"; |
|
127 | + return "(".$subject." REGEXP '".$pattern."')"; |
|
128 | 128 | } |
129 | 129 | |
130 | - return "('". $subject ."' REGEXP '" . $pattern . "')"; |
|
130 | + return "('".$subject."' REGEXP '".$pattern."')"; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
691 | 691 | include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; |
692 | 692 | |
693 | - $content=''; |
|
693 | + $content = ''; |
|
694 | 694 | $pathoffile = $this->getDescLongReadmeFound(); |
695 | 695 | |
696 | 696 | if ($pathoffile) { // Mostly for external modules |
@@ -1456,7 +1456,7 @@ discard block |
||
1456 | 1456 | |
1457 | 1457 | $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes_def"; |
1458 | 1458 | $sql .= " WHERE file = '".$this->db->escape($file)."'"; |
1459 | - $sql .= " AND entity = ".$conf->entity; // Do not use getEntity here, we want to delete only in current company |
|
1459 | + $sql .= " AND entity = ".$conf->entity; // Do not use getEntity here, we want to delete only in current company |
|
1460 | 1460 | |
1461 | 1461 | dol_syslog(get_class($this)."::delete_boxes", LOG_DEBUG); |
1462 | 1462 | $resql = $this->db->query($sql); |
@@ -1868,7 +1868,7 @@ discard block |
||
1868 | 1868 | |
1869 | 1869 | // If the module is active |
1870 | 1870 | foreach ($this->rights as $key => $value) { |
1871 | - $r_id = $this->rights[$key][0]; // permission id in llx_rights_def (not unique because primary key is couple id-entity) |
|
1871 | + $r_id = $this->rights[$key][0]; // permission id in llx_rights_def (not unique because primary key is couple id-entity) |
|
1872 | 1872 | $r_desc = $this->rights[$key][1]; |
1873 | 1873 | $r_type = isset($this->rights[$key][2]) ? $this->rights[$key][2] : ''; |
1874 | 1874 | $r_def = empty($this->rights[$key][3]) ? 0 : $this->rights[$key][3]; |
@@ -2463,36 +2463,36 @@ discard block |
||
2463 | 2463 | } |
2464 | 2464 | |
2465 | 2465 | if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) { |
2466 | - $versionTitle = $langs->trans("Version").' '.$this->getVersion(1); |
|
2466 | + $versionTitle = $langs->trans("Version").' '.$this->getVersion(1); |
|
2467 | 2467 | if ($this->needUpdate) { |
2468 | - $versionTitle.= '<br>'.$langs->trans('ModuleUpdateAvailable').' : '.$this->lastVersion; |
|
2468 | + $versionTitle .= '<br>'.$langs->trans('ModuleUpdateAvailable').' : '.$this->lastVersion; |
|
2469 | 2469 | } |
2470 | 2470 | |
2471 | - $return .= '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').' classfortooltip" title="'.dol_escape_js($versionTitle).'" >'; |
|
2472 | - $return .= $this->getVersion(1); |
|
2473 | - $return .= '</span>'; |
|
2471 | + $return .= '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').' classfortooltip" title="'.dol_escape_js($versionTitle).'" >'; |
|
2472 | + $return .= $this->getVersion(1); |
|
2473 | + $return .= '</span>'; |
|
2474 | 2474 | } |
2475 | 2475 | |
2476 | - $return .= '</div> |
|
2476 | + $return .= '</div> |
|
2477 | 2477 | <div class="info-box-content info-box-text-module'.(!getDolGlobalString($const_name) ? '' : ' info-box-module-enabled'.($versiontrans ? ' info-box-content-warning' : '')).'"> |
2478 | 2478 | <span class="info-box-title">'.$this->getName().'</span> |
2479 | 2479 | <span class="info-box-desc twolinesmax opacitymedium" title="'.dol_escape_htmltag($this->getDesc()).'">'.nl2br($this->getDesc()).'</span>'; |
2480 | 2480 | |
2481 | - $return .= '<div class="valignmiddle inline-block info-box-more">'; |
|
2481 | + $return .= '<div class="valignmiddle inline-block info-box-more">'; |
|
2482 | 2482 | //if ($versiontrans) print img_warning($langs->trans("Version").' '.$this->getVersion(1)).' '; |
2483 | - $return .= '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.((int) $this->numero).'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule").' - ' : '').$langs->trans("ClickToShowDescription"), $imginfo).'</a>'; |
|
2484 | - $return .= '</div><br>'; |
|
2485 | - |
|
2486 | - $return .= '<div class="valignmiddle inline-block info-box-actions">'; |
|
2487 | - $return .= '<div class="valignmiddle inline-block info-box-setup">'; |
|
2488 | - $return .= $codetoconfig; |
|
2489 | - $return .= '</div>'; |
|
2490 | - $return .= '<div class="valignmiddle inline-block marginleftonly marginrightonly">'; |
|
2491 | - $return .= $codeenabledisable; |
|
2492 | - $return .= '</div>'; |
|
2493 | - $return .= '</div>'; |
|
2494 | - |
|
2495 | - $return .= ' |
|
2483 | + $return .= '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.((int) $this->numero).'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule").' - ' : '').$langs->trans("ClickToShowDescription"), $imginfo).'</a>'; |
|
2484 | + $return .= '</div><br>'; |
|
2485 | + |
|
2486 | + $return .= '<div class="valignmiddle inline-block info-box-actions">'; |
|
2487 | + $return .= '<div class="valignmiddle inline-block info-box-setup">'; |
|
2488 | + $return .= $codetoconfig; |
|
2489 | + $return .= '</div>'; |
|
2490 | + $return .= '<div class="valignmiddle inline-block marginleftonly marginrightonly">'; |
|
2491 | + $return .= $codeenabledisable; |
|
2492 | + $return .= '</div>'; |
|
2493 | + $return .= '</div>'; |
|
2494 | + |
|
2495 | + $return .= ' |
|
2496 | 2496 | </div><!-- /.info-box-content --> |
2497 | 2497 | </div><!-- /.info-box --> |
2498 | 2498 | </div>'; |
@@ -2511,7 +2511,7 @@ discard block |
||
2511 | 2511 | { |
2512 | 2512 | require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; |
2513 | 2513 | if (!empty($this->url_last_version)) { |
2514 | - $lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only |
|
2514 | + $lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only |
|
2515 | 2515 | if (isset($lastVersion['content']) && strlen($lastVersion['content']) < 30) { |
2516 | 2516 | // Security warning : be careful with remote data content, the module editor could be hacked (or evil) so limit to a-z A-Z 0-9 _ . - |
2517 | 2517 | $this->lastVersion = preg_replace("/[^a-zA-Z0-9_\.\-]+/", "", $lastVersion['content']); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * \remarks To run this script as CLI: phpunit filename.php |
24 | 24 | */ |
25 | 25 | |
26 | -global $conf,$user,$langs,$db; |
|
26 | +global $conf, $user, $langs, $db; |
|
27 | 27 | |
28 | 28 | require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; |
29 | 29 | require_once dirname(__FILE__).'/../../htdocs/societe/class/societe.class.php'; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $user->fetch(1); |
36 | 36 | $user->getrights(); |
37 | 37 | } |
38 | -$conf->global->MAIN_DISABLE_ALL_MAILS=1; |
|
38 | +$conf->global->MAIN_DISABLE_ALL_MAILS = 1; |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * Class for PHPUnit tests |
@@ -63,11 +63,11 @@ discard block |
||
63 | 63 | parent::__construct($name); |
64 | 64 | |
65 | 65 | //$this->sharedFixture |
66 | - global $conf,$user,$langs,$db; |
|
67 | - $this->savconf=$conf; |
|
68 | - $this->savuser=$user; |
|
69 | - $this->savlangs=$langs; |
|
70 | - $this->savdb=$db; |
|
66 | + global $conf, $user, $langs, $db; |
|
67 | + $this->savconf = $conf; |
|
68 | + $this->savuser = $user; |
|
69 | + $this->savlangs = $langs; |
|
70 | + $this->savdb = $db; |
|
71 | 71 | |
72 | 72 | print __METHOD__." db->type=".$db->type." user->id=".$user->id; |
73 | 73 | //print " - db ".$db->db; |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public static function setUpBeforeClass(): void |
83 | 83 | { |
84 | - global $conf,$user,$langs,$db; |
|
84 | + global $conf, $user, $langs, $db; |
|
85 | 85 | |
86 | - $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. |
|
86 | + $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. |
|
87 | 87 | |
88 | 88 | print __METHOD__."\n"; |
89 | 89 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public static function tearDownAfterClass(): void |
97 | 97 | { |
98 | - global $conf,$user,$langs,$db; |
|
98 | + global $conf, $user, $langs, $db; |
|
99 | 99 | $db->rollback(); |
100 | 100 | |
101 | 101 | print __METHOD__."\n"; |
@@ -108,11 +108,11 @@ discard block |
||
108 | 108 | */ |
109 | 109 | protected function setUp(): void |
110 | 110 | { |
111 | - global $conf,$user,$langs,$db; |
|
112 | - $conf=$this->savconf; |
|
113 | - $user=$this->savuser; |
|
114 | - $langs=$this->savlangs; |
|
115 | - $db=$this->savdb; |
|
111 | + global $conf, $user, $langs, $db; |
|
112 | + $conf = $this->savconf; |
|
113 | + $user = $this->savuser; |
|
114 | + $langs = $this->savlangs; |
|
115 | + $db = $this->savdb; |
|
116 | 116 | |
117 | 117 | print __METHOD__."\n"; |
118 | 118 | } |
@@ -134,11 +134,11 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function testReceptionCreate() |
136 | 136 | { |
137 | - global $conf,$user,$langs,$db; |
|
138 | - $conf=$this->savconf; |
|
139 | - $user=$this->savuser; |
|
140 | - $langs=$this->savlangs; |
|
141 | - $db=$this->savdb; |
|
137 | + global $conf, $user, $langs, $db; |
|
138 | + $conf = $this->savconf; |
|
139 | + $user = $this->savuser; |
|
140 | + $langs = $this->savlangs; |
|
141 | + $db = $this->savdb; |
|
142 | 142 | |
143 | 143 | $soc = new Societe($db); |
144 | 144 | $soc->name = "ReceptionTest Unittest"; |