Passed
Pull Request — master (#2)
by
unknown
26:19
created
dolibarr/htdocs/core/modules/reception/mod_reception_beryl.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -21,17 +21,17 @@  discard block
 block discarded – undo
21 21
  *  \ingroup    reception
22 22
  *  \brief      File of class to manage shipments numbering rules Beryl
23 23
  */
24
-require_once DOL_DOCUMENT_ROOT .'/core/modules/reception/modules_reception.php';
24
+require_once DOL_DOCUMENT_ROOT.'/core/modules/reception/modules_reception.php';
25 25
 
26 26
 /**
27 27
  *	Class to manage reception numbering rules Beryl
28 28
  */
29 29
 class mod_reception_beryl extends ModelNumRefReception
30 30
 {
31
-	var $version='dolibarr';
32
-	var $prefix='RCP';
33
-	var $error='';
34
-	var $nom='Beryl';
31
+	var $version = 'dolibarr';
32
+	var $prefix = 'RCP';
33
+	var $error = '';
34
+	var $nom = 'Beryl';
35 35
 
36 36
 
37 37
 	/**
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     function info()
43 43
     {
44 44
     	global $langs;
45
-      	return $langs->trans("SimpleNumRefModelDesc",$this->prefix);
45
+      	return $langs->trans("SimpleNumRefModelDesc", $this->prefix);
46 46
     }
47 47
 
48 48
 
@@ -64,26 +64,26 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	function canBeActivated()
66 66
 	{
67
-		global $conf,$langs,$db;
67
+		global $conf, $langs, $db;
68 68
 
69
-		$coyymm=''; $max='';
69
+		$coyymm = ''; $max = '';
70 70
 
71
-		$posindice=8;
71
+		$posindice = 8;
72 72
 		$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
73
-		$sql.= " FROM ".MAIN_DB_PREFIX."reception";
74
-		$sql.= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
75
-		$sql.= " AND entity = ".$conf->entity;
73
+		$sql .= " FROM ".MAIN_DB_PREFIX."reception";
74
+		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
75
+		$sql .= " AND entity = ".$conf->entity;
76 76
 
77
-		$resql=$db->query($sql);
77
+		$resql = $db->query($sql);
78 78
 		if ($resql)
79 79
 		{
80 80
 			$row = $db->fetch_row($resql);
81
-			if ($row) { $coyymm = substr($row[0],0,6); $max=$row[0]; }
81
+			if ($row) { $coyymm = substr($row[0], 0, 6); $max = $row[0]; }
82 82
 		}
83
-		if ($coyymm && ! preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i',$coyymm))
83
+		if ($coyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm))
84 84
 		{
85 85
 			$langs->load("errors");
86
-			$this->error=$langs->trans('ErrorNumRefModel', $max);
86
+			$this->error = $langs->trans('ErrorNumRefModel', $max);
87 87
 			return false;
88 88
 		}
89 89
 
@@ -97,22 +97,22 @@  discard block
 block discarded – undo
97 97
 	 *	@param	Object		$shipment	Shipment object
98 98
 	 *	@return string      			Value if OK, 0 if KO
99 99
 	 */
100
-	function getNextValue($objsoc,$shipment)
100
+	function getNextValue($objsoc, $shipment)
101 101
 	{
102
-		global $db,$conf;
102
+		global $db, $conf;
103 103
 
104
-		$posindice=9;
104
+		$posindice = 9;
105 105
 		$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
106
-		$sql.= " FROM ".MAIN_DB_PREFIX."reception";
107
-		$sql.= " WHERE ref like '".$db->escape($this->prefix)."____-%'";
108
-		$sql.= " AND entity = ".$conf->entity;
106
+		$sql .= " FROM ".MAIN_DB_PREFIX."reception";
107
+		$sql .= " WHERE ref like '".$db->escape($this->prefix)."____-%'";
108
+		$sql .= " AND entity = ".$conf->entity;
109 109
 
110
-		$resql=$db->query($sql);
110
+		$resql = $db->query($sql);
111 111
 		if ($resql)
112 112
 		{
113 113
 			$obj = $db->fetch_object($resql);
114 114
 			if ($obj) $max = intval($obj->max);
115
-			else $max=0;
115
+			else $max = 0;
116 116
 		}
117 117
 		else
118 118
 		{
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
 			return -1;
121 121
 		}
122 122
 
123
-		$date=time();
124
-		$yymm = strftime("%y%m",$date);
123
+		$date = time();
124
+		$yymm = strftime("%y%m", $date);
125 125
 
126
-		if ($max >= (pow(10, 4) - 1)) $num=$max+1;	// If counter > 9999, we do not format on 4 chars, we take number as it is
127
-		else $num = sprintf("%04s",$max+1);
126
+		if ($max >= (pow(10, 4) - 1)) $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
127
+		else $num = sprintf("%04s", $max + 1);
128 128
 
129 129
 		dol_syslog("mod_reception_beryl::getNextValue return ".$this->prefix.$yymm."-".$num);
130 130
 		return $this->prefix.$yymm."-".$num;
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
 	 *	@param	Object		$objforref	Shipment object
139 139
 	 *	@return string      			Next free value
140 140
 	 */
141
-	function reception_get_num($objsoc,$objforref)
141
+	function reception_get_num($objsoc, $objforref)
142 142
 	{
143 143
 		// phpcs:enable
144
-		return $this->getNextValue($objsoc,$objforref);
144
+		return $this->getNextValue($objsoc, $objforref);
145 145
 	}
146 146
 }
147 147
\ No newline at end of file
Please login to merge, or discard this patch.
dolibarr/htdocs/core/modules/reception/modules_reception.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
  */
30 30
 abstract class ModelePdfReception extends CommonDocGenerator
31 31
 {
32
-    var $error='';
32
+    var $error = '';
33 33
 
34 34
 
35 35
     // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
@@ -40,16 +40,16 @@  discard block
 block discarded – undo
40 40
      *  @param  integer	$maxfilenamelength  Max length of value to show
41 41
      *  @return	array						List of templates
42 42
 	 */
43
-	static function liste_modeles($db,$maxfilenamelength=0)
43
+	static function liste_modeles($db, $maxfilenamelength = 0)
44 44
 	{
45 45
 		// phpcs:enable
46 46
 		global $conf;
47 47
 
48
-		$type='reception';
49
-		$liste=array();
48
+		$type = 'reception';
49
+		$liste = array();
50 50
 
51 51
 		include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
52
-		$liste=getListOfModels($db,$type,$maxfilenamelength);
52
+		$liste = getListOfModels($db, $type, $maxfilenamelength);
53 53
 
54 54
 		return $liste;
55 55
 	}
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
  */
62 62
 abstract class ModelNumRefReception
63 63
 {
64
-	var $error='';
64
+	var $error = '';
65 65
 
66 66
 	/** Return if a model can be used or not
67 67
 	 *
Please login to merge, or discard this patch.
dolibarr/htdocs/core/modules/reception/mod_reception_moonstone.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -22,14 +22,14 @@  discard block
 block discarded – undo
22 22
  *  \brief      File of class to manage reception numbering rules Moonstone
23 23
  */
24 24
 
25
-require_once DOL_DOCUMENT_ROOT .'/core/modules/reception/modules_reception.php';
25
+require_once DOL_DOCUMENT_ROOT.'/core/modules/reception/modules_reception.php';
26 26
 
27 27
 /**
28 28
  *	Class to manage reception numbering rules Moonstone
29 29
  */
30 30
 class mod_reception_moonstone extends ModelNumRefReception
31 31
 {
32
-	var $version='dolibarr';
32
+	var $version = 'dolibarr';
33 33
 	var $error = '';
34 34
 	var $nom = 'Moonstone';
35 35
 
@@ -40,31 +40,31 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	function info()
42 42
     {
43
-    	global $conf,$langs;
43
+    	global $conf, $langs;
44 44
 
45 45
 		$langs->load("bills");
46 46
 
47 47
 		$form = new Form($this->db);
48 48
 
49 49
 		$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
50
-		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
51
-		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
52
-		$texte.= '<input type="hidden" name="action" value="updateMask">';
53
-		$texte.= '<input type="hidden" name="maskconstreception" value="RECEPTION_MOONSTONE_MASK">';
54
-		$texte.= '<table class="nobordernopadding" width="100%">';
55
-
56
-		$tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("Reception"),$langs->transnoentities("Reception"));
57
-		$tooltip.=$langs->trans("GenericMaskCodes2");
58
-		$tooltip.=$langs->trans("GenericMaskCodes3");
59
-		$tooltip.=$langs->trans("GenericMaskCodes4a",$langs->transnoentities("Reception"),$langs->transnoentities("Reception"));
60
-		$tooltip.=$langs->trans("GenericMaskCodes5");
61
-
62
-		$texte.= '<tr><td>'.$langs->trans("Mask").':</td>';
63
-		$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskreception" value="'.$conf->global->RECEPTION_MOONSTONE_MASK.'">',$tooltip,1,1).'</td>';
64
-		$texte.= '<td align="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
65
-		$texte.= '</tr>';
66
-		$texte.= '</table>';
67
-		$texte.= '</form>';
50
+		$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
51
+		$texte .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
52
+		$texte .= '<input type="hidden" name="action" value="updateMask">';
53
+		$texte .= '<input type="hidden" name="maskconstreception" value="RECEPTION_MOONSTONE_MASK">';
54
+		$texte .= '<table class="nobordernopadding" width="100%">';
55
+
56
+		$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Reception"), $langs->transnoentities("Reception"));
57
+		$tooltip .= $langs->trans("GenericMaskCodes2");
58
+		$tooltip .= $langs->trans("GenericMaskCodes3");
59
+		$tooltip .= $langs->trans("GenericMaskCodes4a", $langs->transnoentities("Reception"), $langs->transnoentities("Reception"));
60
+		$tooltip .= $langs->trans("GenericMaskCodes5");
61
+
62
+		$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
63
+		$texte .= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskreception" value="'.$conf->global->RECEPTION_MOONSTONE_MASK.'">', $tooltip, 1, 1).'</td>';
64
+		$texte .= '<td align="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
65
+		$texte .= '</tr>';
66
+		$texte .= '</table>';
67
+		$texte .= '</form>';
68 68
 
69 69
 		return $texte;
70 70
     }
@@ -76,17 +76,17 @@  discard block
 block discarded – undo
76 76
 	 */
77 77
     function getExample()
78 78
     {
79
-     	global $conf,$langs,$mysoc;
79
+     	global $conf, $langs, $mysoc;
80 80
 
81
-    	$old_code_client=$mysoc->code_client;
82
-    	$old_code_type=$mysoc->typent_code;
83
-    	$mysoc->code_client='CCCCCCCCCC';
84
-    	$mysoc->typent_code='TTTTTTTTTT';
85
-     	$numExample = $this->getNextValue($mysoc,'');
86
-		$mysoc->code_client=$old_code_client;
87
-		$mysoc->typent_code=$old_code_type;
81
+    	$old_code_client = $mysoc->code_client;
82
+    	$old_code_type = $mysoc->typent_code;
83
+    	$mysoc->code_client = 'CCCCCCCCCC';
84
+    	$mysoc->typent_code = 'TTTTTTTTTT';
85
+     	$numExample = $this->getNextValue($mysoc, '');
86
+		$mysoc->code_client = $old_code_client;
87
+		$mysoc->typent_code = $old_code_type;
88 88
 
89
-		if (! $numExample)
89
+		if (!$numExample)
90 90
 		{
91 91
 			$numExample = $langs->trans('NotConfigured');
92 92
 		}
@@ -100,23 +100,23 @@  discard block
 block discarded – undo
100 100
 	 *	@param	Object		$reception	Reception object
101 101
 	 *	@return string      			Value if OK, 0 if KO
102 102
 	 */
103
-    function getNextValue($objsoc,$reception)
103
+    function getNextValue($objsoc, $reception)
104 104
     {
105
-		global $db,$conf;
105
+		global $db, $conf;
106 106
 
107
-		require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php';
107
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
108 108
 
109
-		$mask=$conf->global->RECEPTION_MOONSTONE_MASK;
109
+		$mask = $conf->global->RECEPTION_MOONSTONE_MASK;
110 110
 
111
-		if (! $mask)
111
+		if (!$mask)
112 112
 		{
113
-			$this->error='NotConfigured';
113
+			$this->error = 'NotConfigured';
114 114
 			return 0;
115 115
 		}
116 116
 
117 117
 		$date = $reception->date_reception;
118 118
 
119
-		$numFinal=get_next_value($db,$mask,'reception','ref','',$objsoc,$date);
119
+		$numFinal = get_next_value($db, $mask, 'reception', 'ref', '', $objsoc, $date);
120 120
 
121 121
 		return  $numFinal;
122 122
 	}
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
 	 *	@param	Object		$objforref	Reception object
130 130
 	 *	@return string      			Next free value
131 131
 	 */
132
-	function reception_get_num($objsoc,$objforref)
132
+	function reception_get_num($objsoc, $objforref)
133 133
 	{
134 134
 		// phpcs:enable
135
-		return $this->getNextValue($objsoc,$objforref);
135
+		return $this->getNextValue($objsoc, $objforref);
136 136
 	}
137 137
 }
138 138
\ No newline at end of file
Please login to merge, or discard this patch.
dolibarr/htdocs/core/modules/payment/mod_payment_ant.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  * \brief      File containing class for numbering module Ant
23 23
  */
24 24
 
25
-require_once DOL_DOCUMENT_ROOT .'/core/modules/payment/modules_payment.php';
25
+require_once DOL_DOCUMENT_ROOT.'/core/modules/payment/modules_payment.php';
26 26
 
27 27
 
28 28
 /**
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      * Dolibarr version of the loaded document
35 35
      * @public string
36 36
      */
37
-	public $version = 'dolibarr';		// 'development', 'experimental', 'dolibarr'
37
+	public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
38 38
 
39 39
 	/**
40 40
 	 * @var string Error message
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
 	 * @deprecated
47 47
 	 * @see name
48 48
 	 */
49
-	public $nom='Ant';
49
+	public $nom = 'Ant';
50 50
 
51 51
 	/**
52 52
 	 * @var string model name
53 53
 	 */
54
-	public $name='Ant';
54
+	public $name = 'Ant';
55 55
 
56 56
 
57 57
     /**
@@ -68,28 +68,28 @@  discard block
 block discarded – undo
68 68
 		$form = new Form($this->db);
69 69
 
70 70
 		$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
71
-		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
72
-		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
73
-		$texte.= '<input type="hidden" name="action" value="updateMask">';
74
-		$texte.= '<input type="hidden" name="maskconstpayment" value="PAYMENT_ANT_MASK">';
75
-		$texte.= '<table class="nobordernopadding" width="100%">';
76
-
77
-		$tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("Order"),$langs->transnoentities("Order"));
78
-		$tooltip.=$langs->trans("GenericMaskCodes2");
79
-		$tooltip.=$langs->trans("GenericMaskCodes3");
80
-		$tooltip.=$langs->trans("GenericMaskCodes4a",$langs->transnoentities("Order"),$langs->transnoentities("Order"));
81
-		$tooltip.=$langs->trans("GenericMaskCodes5");
71
+		$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
72
+		$texte .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
73
+		$texte .= '<input type="hidden" name="action" value="updateMask">';
74
+		$texte .= '<input type="hidden" name="maskconstpayment" value="PAYMENT_ANT_MASK">';
75
+		$texte .= '<table class="nobordernopadding" width="100%">';
76
+
77
+		$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Order"), $langs->transnoentities("Order"));
78
+		$tooltip .= $langs->trans("GenericMaskCodes2");
79
+		$tooltip .= $langs->trans("GenericMaskCodes3");
80
+		$tooltip .= $langs->trans("GenericMaskCodes4a", $langs->transnoentities("Order"), $langs->transnoentities("Order"));
81
+		$tooltip .= $langs->trans("GenericMaskCodes5");
82 82
 
83 83
 		// Parametrage du prefix
84
-		$texte.= '<tr><td>'.$langs->trans("Mask").':</td>';
85
-		$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskpayment" value="'.$conf->global->PAYMENT_ANT_MASK.'">',$tooltip,1,1).'</td>';
84
+		$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
85
+		$texte .= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskpayment" value="'.$conf->global->PAYMENT_ANT_MASK.'">', $tooltip, 1, 1).'</td>';
86 86
 
87
-		$texte.= '<td align="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
87
+		$texte .= '<td align="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
88 88
 
89
-		$texte.= '</tr>';
89
+		$texte .= '</tr>';
90 90
 
91
-		$texte.= '</table>';
92
-		$texte.= '</form>';
91
+		$texte .= '</table>';
92
+		$texte .= '</form>';
93 93
 
94 94
 		return $texte;
95 95
     }
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
      */
102 102
     function getExample()
103 103
     {
104
-     	global $conf,$langs,$mysoc;
104
+     	global $conf, $langs, $mysoc;
105 105
 
106
-    	$old_code_client=$mysoc->code_client;
107
-    	$mysoc->code_client='CCCCCCCCCC';
108
-     	$numExample = $this->getNextValue($mysoc,'');
109
-		$mysoc->code_client=$old_code_client;
106
+    	$old_code_client = $mysoc->code_client;
107
+    	$mysoc->code_client = 'CCCCCCCCCC';
108
+     	$numExample = $this->getNextValue($mysoc, '');
109
+		$mysoc->code_client = $old_code_client;
110 110
 
111
-		if (! $numExample)
111
+		if (!$numExample)
112 112
 		{
113 113
 			$numExample = $langs->trans('NotConfigured');
114 114
 		}
@@ -122,22 +122,22 @@  discard block
 block discarded – undo
122 122
 	 *  @param  Object		$object		Object we need next value for
123 123
 	 *  @return string      			Value if KO, <0 if KO
124 124
 	 */
125
-    function getNextValue($objsoc,$object)
125
+    function getNextValue($objsoc, $object)
126 126
     {
127
-		global $db,$conf;
127
+		global $db, $conf;
128 128
 
129
-		require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php';
129
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
130 130
 
131 131
 		// We get cursor rule
132
-		$mask=$conf->global->PAYMENT_ANT_MASK;
132
+		$mask = $conf->global->PAYMENT_ANT_MASK;
133 133
 
134
-		if (! $mask)
134
+		if (!$mask)
135 135
 		{
136
-			$this->error='NotConfigured';
136
+			$this->error = 'NotConfigured';
137 137
 			return 0;
138 138
 		}
139 139
 
140
-		$numFinal=get_next_value($db,$mask,'paiement','ref','',$objsoc,$object->datepaye);
140
+		$numFinal = get_next_value($db, $mask, 'paiement', 'ref', '', $objsoc, $object->datepaye);
141 141
 
142 142
 		return  $numFinal;
143 143
 	}
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
 	 * 	@param	string		$objforref	Object for number to search
152 152
 	 *  @return string      			Next free value
153 153
      */
154
-    function commande_get_num($objsoc,$objforref)
154
+    function commande_get_num($objsoc, $objforref)
155 155
     {
156 156
         // phpcs:enable
157
-        return $this->getNextValue($objsoc,$objforref);
157
+        return $this->getNextValue($objsoc, $objforref);
158 158
     }
159 159
 }
Please login to merge, or discard this patch.
dolibarr/htdocs/core/modules/payment/mod_payment_cicada.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  * \brief      File containing class for numbering module Cicada
23 23
  */
24 24
 
25
-require_once DOL_DOCUMENT_ROOT .'/core/modules/payment/modules_payment.php';
25
+require_once DOL_DOCUMENT_ROOT.'/core/modules/payment/modules_payment.php';
26 26
 
27 27
 /**
28 28
  *	Class to manage customer payment numbering rules Cicada
@@ -33,26 +33,26 @@  discard block
 block discarded – undo
33 33
      * Dolibarr version of the loaded document
34 34
      * @public string
35 35
      */
36
-	public $version = 'dolibarr';		// 'development', 'experimental', 'dolibarr'
36
+	public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
37 37
 
38
-	public $prefix='PAY';
38
+	public $prefix = 'PAY';
39 39
 
40 40
 	/**
41 41
 	 * @var string Error code (or message)
42 42
 	 */
43
-	public $error='';
43
+	public $error = '';
44 44
 
45 45
 	/**
46 46
 	 * @var string Nom du modele
47 47
 	 * @deprecated
48 48
 	 * @see name
49 49
 	 */
50
-	public $nom='Cicada';
50
+	public $nom = 'Cicada';
51 51
 
52 52
 	/**
53 53
 	 * @var string model name
54 54
 	 */
55
-	public $name='Cicada';
55
+	public $name = 'Cicada';
56 56
 
57 57
 
58 58
     /**
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     function info()
64 64
     {
65 65
     	global $langs;
66
-      	return $langs->trans("SimpleNumRefModelDesc",$this->prefix);
66
+      	return $langs->trans("SimpleNumRefModelDesc", $this->prefix);
67 67
     }
68 68
 
69 69
 
@@ -86,26 +86,26 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	function canBeActivated()
88 88
 	{
89
-		global $conf,$langs,$db;
89
+		global $conf, $langs, $db;
90 90
 
91
-		$payyymm=''; $max='';
91
+		$payyymm = ''; $max = '';
92 92
 
93
-		$posindice=9;
93
+		$posindice = 9;
94 94
 		$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
95
-		$sql.= " FROM ".MAIN_DB_PREFIX."paiement";
96
-		$sql.= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
97
-		$sql.= " AND entity = ".$conf->entity;
95
+		$sql .= " FROM ".MAIN_DB_PREFIX."paiement";
96
+		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
97
+		$sql .= " AND entity = ".$conf->entity;
98 98
 
99
-		$resql=$db->query($sql);
99
+		$resql = $db->query($sql);
100 100
 		if ($resql)
101 101
 		{
102 102
 			$row = $db->fetch_row($resql);
103
-			if ($row) { $payyymm = substr($row[0],0,6); $max=$row[0]; }
103
+			if ($row) { $payyymm = substr($row[0], 0, 6); $max = $row[0]; }
104 104
 		}
105
-		if ($payyymm && ! preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i',$payyymm))
105
+		if ($payyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $payyymm))
106 106
 		{
107 107
 			$langs->load("errors");
108
-			$this->error=$langs->trans('ErrorNumRefModel', $max);
108
+			$this->error = $langs->trans('ErrorNumRefModel', $max);
109 109
 			return false;
110 110
 		}
111 111
 
@@ -119,23 +119,23 @@  discard block
 block discarded – undo
119 119
 	 *  @param  Object		$object		Object we need next value for
120 120
 	 *  @return string      			Value if KO, <0 if KO
121 121
 	 */
122
-	function getNextValue($objsoc,$object)
122
+	function getNextValue($objsoc, $object)
123 123
 	{
124
-		global $db,$conf;
124
+		global $db, $conf;
125 125
 
126 126
 		// D'abord on recupere la valeur max
127
-		$posindice=9;
127
+		$posindice = 9;
128 128
 		$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
129
-		$sql.= " FROM ".MAIN_DB_PREFIX."paiement";
130
-		$sql.= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
131
-		$sql.= " AND entity = ".$conf->entity;
129
+		$sql .= " FROM ".MAIN_DB_PREFIX."paiement";
130
+		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
131
+		$sql .= " AND entity = ".$conf->entity;
132 132
 
133
-		$resql=$db->query($sql);
133
+		$resql = $db->query($sql);
134 134
 		if ($resql)
135 135
 		{
136 136
 			$obj = $db->fetch_object($resql);
137 137
 			if ($obj) $max = intval($obj->max);
138
-			else $max=0;
138
+			else $max = 0;
139 139
 		}
140 140
 		else
141 141
 		{
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
 		}
145 145
 
146 146
 		//$date=time();
147
-		$date=$object->datepaye;
148
-		$yymm = strftime("%y%m",$date);
147
+		$date = $object->datepaye;
148
+		$yymm = strftime("%y%m", $date);
149 149
 
150
-    	if ($max >= (pow(10, 4) - 1)) $num=$max+1;	// If counter > 9999, we do not format on 4 chars, we take number as it is
151
-    	else $num = sprintf("%04s",$max+1);
150
+    	if ($max >= (pow(10, 4) - 1)) $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
151
+    	else $num = sprintf("%04s", $max + 1);
152 152
 
153 153
 		dol_syslog(__METHOD__." return ".$this->prefix.$yymm."-".$num);
154 154
 		return $this->prefix.$yymm."-".$num;
@@ -163,9 +163,9 @@  discard block
 block discarded – undo
163 163
 	 *  @param	string		$objforref	Object for number to search
164 164
 	 *  @return string      			Next free value
165 165
 	 */
166
-	function payment_get_num($objsoc,$objforref)
166
+	function payment_get_num($objsoc, $objforref)
167 167
 	{
168 168
         // phpcs:enable
169
-		return $this->getNextValue($objsoc,$objforref);
169
+		return $this->getNextValue($objsoc, $objforref);
170 170
 	}
171 171
 }
Please login to merge, or discard this patch.
dolibarr/htdocs/core/modules/payment/modules_payment.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	/**
27 27
 	 * @var string Error code (or message)
28 28
 	 */
29
-	public $error='';
29
+	public $error = '';
30 30
 
31 31
 	/**
32 32
 	 *	Return if a module can be used or not
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 *	@param	Object		$object		Object we need next value for
80 80
 	 *	@return	string      Valeur
81 81
 	 */
82
-	function getNextValue($objsoc,$object)
82
+	function getNextValue($objsoc, $object)
83 83
 	{
84 84
 		global $langs;
85 85
 		return $langs->trans("NotAvailable");
Please login to merge, or discard this patch.
dolibarr/htdocs/core/modules/modDon.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  *	\brief      Description and activation file for module Donation
27 27
  */
28 28
 
29
-include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
29
+include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
30 30
 
31 31
 
32 32
 /**
@@ -47,14 +47,14 @@  discard block
 block discarded – undo
47 47
 
48 48
 		$this->family = "financial";
49 49
 		// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
50
-		$this->name = preg_replace('/^mod/i','',get_class($this));
50
+		$this->name = preg_replace('/^mod/i', '', get_class($this));
51 51
 		$this->description = "Gestion des dons";
52 52
 		// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
53 53
 		$this->version = 'dolibarr';
54 54
 		$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
55 55
 		// Name of png file (without png) used for this module.
56 56
 		// Png file must be in theme/yourtheme/img directory under name object_pictovalue.png.
57
-		$this->picto='bill';
57
+		$this->picto = 'bill';
58 58
 
59 59
 		// Data directories to create when module is enabled
60 60
 		$this->dirs = array("/don/temp");
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
 		// Constants
70 70
 		$this->const = array();
71
-		$r=0;
71
+		$r = 0;
72 72
 
73 73
 		$this->const[$r][0] = "DON_ADDON_MODEL";
74 74
 		$this->const[$r][1] = "chaine";
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
 		// Menus
141 141
 		//-------
142
-		$this->menu = 1;        // This module add menu entries. They are coded into menu manager.
142
+		$this->menu = 1; // This module add menu entries. They are coded into menu manager.
143 143
 	}
144 144
 
145 145
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      *      @param      string	$options    Options when enabling module ('', 'noboxes')
152 152
 	 *      @return     int             	1 if OK, 0 if KO
153 153
 	 */
154
-	function init($options='')
154
+	function init($options = '')
155 155
 	{
156 156
 		global $conf;
157 157
 
@@ -160,6 +160,6 @@  discard block
 block discarded – undo
160 160
 			 "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','donation',".$conf->entity.")",
161 161
 		);
162 162
 
163
-		return $this->_init($sql,$options);
163
+		return $this->_init($sql, $options);
164 164
 	}
165 165
 }
166 166
\ No newline at end of file
Please login to merge, or discard this patch.
dolibarr/htdocs/core/modules/modAsset.class.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
  *  \ingroup    asset
25 25
  *  \brief      Description and activation file for module Assets
26 26
  */
27
-include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
27
+include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
28 28
 
29 29
 
30 30
 /**
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
 	 */
40 40
 	public function __construct($db)
41 41
 	{
42
-		global $langs,$conf;
42
+		global $langs, $conf;
43 43
 
44 44
 		$this->db = $db;
45 45
 
46 46
 		// Id for module (must be unique).
47 47
 		// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
48
-		$this->numero = 51000;		// TODO Go on page https://wiki.dolibarr.org/index.php/List_of_modules_id to reserve id number for your module
48
+		$this->numero = 51000; // TODO Go on page https://wiki.dolibarr.org/index.php/List_of_modules_id to reserve id number for your module
49 49
 		// Key text used to identify module (for permissions, menus, etc...)
50 50
 		$this->rights_class = 'asset';
51 51
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 		//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
59 59
 
60 60
 		// Module label (no space allowed), used if translation string 'ModuleAssetsName' not found (MyModue is name of module).
61
-		$this->name = preg_replace('/^mod/i','',get_class($this));
61
+		$this->name = preg_replace('/^mod/i', '', get_class($this));
62 62
 		// Module description, used if translation string 'ModuleAssetsDesc' not found (MyModue is name of module).
63 63
 		$this->description = "Assets module";
64 64
 		// Used only if file README.md and README-LL.md not found.
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 		// Name of image file used for this module.
72 72
 		// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
73 73
 		// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
74
-		$this->picto='generic';
74
+		$this->picto = 'generic';
75 75
 
76 76
 		// Defined all module parts (triggers, login, substitutions, menus, css, etc...)
77 77
 		// for default path (eg: /asset/core/xxxxx) (0=disable, 1=enable)
@@ -87,15 +87,15 @@  discard block
 block discarded – undo
87 87
 		$this->config_page_url = array("setup.php@asset");
88 88
 
89 89
 		// Dependencies
90
-		$this->hidden = false;			// A condition to hide module
91
-		$this->depends = array();		// List of module class names as string that must be enabled if this module is enabled
92
-		$this->requiredby = array();	// List of module ids to disable if this one is disabled
93
-		$this->conflictwith = array();	// List of module class names as string this module is in conflict with
90
+		$this->hidden = false; // A condition to hide module
91
+		$this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
92
+		$this->requiredby = array(); // List of module ids to disable if this one is disabled
93
+		$this->conflictwith = array(); // List of module class names as string this module is in conflict with
94 94
 		$this->langfiles = array("assets");
95
-		$this->phpmin = array(5,4);					// Minimum version of PHP required by module
96
-		$this->need_dolibarr_version = array(7,0);	// Minimum version of Dolibarr required by module
97
-		$this->warnings_activation = array();                     // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
98
-		$this->warnings_activation_ext = array();                 // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
95
+		$this->phpmin = array(5, 4); // Minimum version of PHP required by module
96
+		$this->need_dolibarr_version = array(7, 0); // Minimum version of Dolibarr required by module
97
+		$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
98
+		$this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
99 99
 		//$this->automatic_activation = array('FR'=>'AssetsWasAutomaticallyActivatedBecauseOfYourCountryChoice');
100 100
 		//$this->always_enabled = true;								// If true, can't be disabled
101 101
 
@@ -109,10 +109,10 @@  discard block
 block discarded – undo
109 109
 		);
110 110
 
111 111
 
112
-		if (! isset($conf->asset) || ! isset($conf->asset->enabled))
112
+		if (!isset($conf->asset) || !isset($conf->asset->enabled))
113 113
 		{
114
-			$conf->asset=new stdClass();
115
-			$conf->asset->enabled=0;
114
+			$conf->asset = new stdClass();
115
+			$conf->asset->enabled = 0;
116 116
 		}
117 117
 
118 118
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
 
148 148
 		// Dictionaries
149
-		$this->dictionaries=array();
149
+		$this->dictionaries = array();
150 150
 		/* Example:
151 151
 		$this->dictionaries=array(
152 152
 			'langs'=>'mylangfile@assets',
@@ -183,40 +183,40 @@  discard block
 block discarded – undo
183 183
 
184 184
 
185 185
 		// Permissions
186
-		$this->rights = array();		// Permission array used by this module
186
+		$this->rights = array(); // Permission array used by this module
187 187
 
188
-		$r=0;
189
-		$this->rights[$r][0] = $this->numero + $r;	// Permission id (must not be already used)
190
-		$this->rights[$r][1] = 'Read assets';		// Permission label
191
-		$this->rights[$r][3] = 1; 					// Permission by default for new user (0/1)
192
-		$this->rights[$r][4] = 'read';				// In php code, permission will be checked by test if ($user->rights->asset->level1->level2)
193
-		$this->rights[$r][5] = '';					// In php code, permission will be checked by test if ($user->rights->asset->level1->level2)
188
+		$r = 0;
189
+		$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
190
+		$this->rights[$r][1] = 'Read assets'; // Permission label
191
+		$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
192
+		$this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->asset->level1->level2)
193
+		$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->asset->level1->level2)
194 194
 
195 195
 		$r++;
196
-		$this->rights[$r][0] = $this->numero + $r;	// Permission id (must not be already used)
197
-		$this->rights[$r][1] = 'Create/Update assets';	// Permission label
198
-		$this->rights[$r][3] = 1; 					// Permission by default for new user (0/1)
199
-		$this->rights[$r][4] = 'write';				// In php code, permission will be checked by test if ($user->rights->asset->level1->level2)
200
-		$this->rights[$r][5] = '';					// In php code, permission will be checked by test if ($user->rights->asset->level1->level2)
196
+		$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
197
+		$this->rights[$r][1] = 'Create/Update assets'; // Permission label
198
+		$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
199
+		$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->asset->level1->level2)
200
+		$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->asset->level1->level2)
201 201
 
202 202
 		$r++;
203
-		$this->rights[$r][0] = $this->numero + $r;	// Permission id (must not be already used)
204
-		$this->rights[$r][1] = 'Delete assets';		// Permission label
205
-		$this->rights[$r][3] = 1; 					// Permission by default for new user (0/1)
206
-		$this->rights[$r][4] = 'delete';			// In php code, permission will be checked by test if ($user->rights->asset->level1->level2)
207
-		$this->rights[$r][5] = '';					// In php code, permission will be checked by test if ($user->rights->asset->level1->level2)
203
+		$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
204
+		$this->rights[$r][1] = 'Delete assets'; // Permission label
205
+		$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
206
+		$this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->asset->level1->level2)
207
+		$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->asset->level1->level2)
208 208
 
209 209
 
210 210
 		// Main menu entries
211
-		$this->menu = array();			// List of menus to add
212
-		$r=0;
211
+		$this->menu = array(); // List of menus to add
212
+		$r = 0;
213 213
 
214 214
 		// Add here entries to declare new menus
215
-		$this->menu = 1;        // This module add menu entries. They are coded into menu manager.
215
+		$this->menu = 1; // This module add menu entries. They are coded into menu manager.
216 216
 
217 217
 		// Exports
218 218
 		//--------
219
-		$r=1;
219
+		$r = 1;
220 220
 
221 221
 		// $this->export_code[$r]          Code unique identifiant l'export (tous modules confondus)
222 222
 		// $this->export_label[$r]         Libelle par defaut si traduction de cle "ExportXXX" non trouvee (XXX = Code)
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 	 *	@param      string	$options    Options when enabling module ('', 'noboxes')
321 321
 	 *	@return     int             	1 if OK, 0 if KO
322 322
 	 */
323
-	function init($options='')
323
+	function init($options = '')
324 324
 	{
325 325
 		global $conf;
326 326
 
@@ -329,6 +329,6 @@  discard block
 block discarded – undo
329 329
 
330 330
 		$sql = array();
331 331
 
332
-		return $this->_init($sql,$options);
332
+		return $this->_init($sql, $options);
333 333
 	}
334 334
 }
Please login to merge, or discard this patch.
dolibarr/htdocs/core/modules/modWebServicesClient.class.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  *       \ingroup    webservices
23 23
  *       \brief      File to describe client for supplier webservices module
24 24
  */
25
-include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
25
+include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
26 26
 
27 27
 /**
28 28
  *	Class to describe a sync supplier web services module
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
42 42
 
43 43
         $this->family = "interface";
44 44
         // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
45
-        $this->name = preg_replace('/^mod/i','',get_class($this));
45
+        $this->name = preg_replace('/^mod/i', '', get_class($this));
46 46
         $this->description = "Enable the web service client to call external supplier web services";
47 47
 		// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
48 48
         $this->version = 'experimental';
49 49
         // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
50 50
         $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
51 51
         // Name of image file used for this module.
52
-        $this->picto='technic';
52
+        $this->picto = 'technic';
53 53
 
54 54
         // Data directories to create when module is enabled
55 55
         $this->dirs = array();
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
         //$this->config_page_url = array();
59 59
 
60 60
         // Dependencies
61
-        $this->hidden = false;			// A condition to hide module
62
-		$this->depends = array();		// List of module class names as string that must be enabled if this module is enabled
63
-		$this->requiredby = array();	// List of module ids to disable if this one is disabled
64
-		$this->conflictwith = array();	// List of module class names as string this module is in conflict with
65
-		$this->phpmin = array(5,4);		// Minimum version of PHP required by module
61
+        $this->hidden = false; // A condition to hide module
62
+		$this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
63
+		$this->requiredby = array(); // List of module ids to disable if this one is disabled
64
+		$this->conflictwith = array(); // List of module class names as string this module is in conflict with
65
+		$this->phpmin = array(5, 4); // Minimum version of PHP required by module
66 66
         $this->langfiles = array("other");
67 67
 
68 68
         // Constants
@@ -77,6 +77,6 @@  discard block
 block discarded – undo
77 77
         // Permissions
78 78
         $this->rights = array();
79 79
         $this->rights_class = 'syncsupplierwebservices';
80
-        $r=0;
80
+        $r = 0;
81 81
     }
82 82
 }
Please login to merge, or discard this patch.