@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | // Specify as export : update field date_validated on selected month/year |
88 | 88 | $sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping"; |
89 | 89 | $sql .= " SET date_validated = '".$db->idate($now)."'"; |
90 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
91 | - $sql .= " AND doc_date >= '" . $db->idate($date_start) . "'"; |
|
92 | - $sql .= " AND doc_date <= '" . $db->idate($date_end) . "'"; |
|
90 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
91 | + $sql .= " AND doc_date >= '".$db->idate($date_start)."'"; |
|
92 | + $sql .= " AND doc_date <= '".$db->idate($date_end)."'"; |
|
93 | 93 | $sql .= " AND date_validated IS NULL"; |
94 | 94 | |
95 | 95 | dol_syslog("/accountancy/closure/index.php action=validate_movement_confirm -> Set movements as validated", LOG_DEBUG); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | $title = $langs->trans('Closure'); |
124 | 124 | |
125 | -$help_url ='EN:Module_Double_Entry_Accounting'; |
|
125 | +$help_url = 'EN:Module_Double_Entry_Accounting'; |
|
126 | 126 | |
127 | 127 | llxHeader('', $title, $help_url); |
128 | 128 |
@@ -149,7 +149,7 @@ |
||
149 | 149 | $sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED; |
150 | 150 | $sql .= " AND ("; |
151 | 151 | $sql .= " (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')"; |
152 | -$sql .= " OR"; // For leave over several months |
|
152 | +$sql .= " OR"; // For leave over several months |
|
153 | 153 | $sql .= " (date_format(cp.date_debut, '%Y-%m') < '".$db->escape($year_month)."' AND date_format(cp.date_fin, '%Y-%m') > '".$db->escape($year_month)."') "; |
154 | 154 | $sql .= " )"; |
155 | 155 | if (!empty($search_ref)) { |
@@ -294,20 +294,20 @@ |
||
294 | 294 | $nexY = $pdf->GetY(); |
295 | 295 | } |
296 | 296 | if ($object->length) { |
297 | - $texttoshow = $langs->trans("Length") . ' x ' . $langs->trans("Width") . ' x ' . $langs->trans("Height") . ': ' . ($object->length != '' ? $object->length : '?') . ' x ' . ($object->width != '' ? $object->width : '?') . ' x ' . ($object->height != '' ? $object->height : '?'); |
|
298 | - $texttoshow .= ' ' . measuringUnitString(0, "size", $object->length_units); |
|
297 | + $texttoshow = $langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").': '.($object->length != '' ? $object->length : '?').' x '.($object->width != '' ? $object->width : '?').' x '.($object->height != '' ? $object->height : '?'); |
|
298 | + $texttoshow .= ' '.measuringUnitString(0, "size", $object->length_units); |
|
299 | 299 | $pdf->writeHTMLCell(190, 3, $this->marge_gauche, $nexY, $texttoshow, 0, 1); |
300 | 300 | $nexY = $pdf->GetY(); |
301 | 301 | } |
302 | 302 | if ($object->surface) { |
303 | - $texttoshow = $langs->trans("Surface") . ': ' . dol_htmlentitiesbr($object->surface); |
|
304 | - $texttoshow .= ' ' . measuringUnitString(0, "surface", $object->surface_units); |
|
303 | + $texttoshow = $langs->trans("Surface").': '.dol_htmlentitiesbr($object->surface); |
|
304 | + $texttoshow .= ' '.measuringUnitString(0, "surface", $object->surface_units); |
|
305 | 305 | $pdf->writeHTMLCell(190, 3, $this->marge_gauche, $nexY, $texttoshow, 0, 1); |
306 | 306 | $nexY = $pdf->GetY(); |
307 | 307 | } |
308 | 308 | if ($object->volume) { |
309 | - $texttoshow = $langs->trans("Volume") . ': ' . dol_htmlentitiesbr($object->volume); |
|
310 | - $texttoshow .= ' ' . measuringUnitString(0, "volume", $object->volume_units); |
|
309 | + $texttoshow = $langs->trans("Volume").': '.dol_htmlentitiesbr($object->volume); |
|
310 | + $texttoshow .= ' '.measuringUnitString(0, "volume", $object->volume_units); |
|
311 | 311 | $pdf->writeHTMLCell(190, 3, $this->marge_gauche, $nexY, $texttoshow, 0, 1); |
312 | 312 | $nexY = $pdf->GetY(); |
313 | 313 | } |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | $h = 0; |
38 | 38 | $head = array(); |
39 | 39 | |
40 | - $withProjectUrl=''; |
|
41 | - if ($with_project>0) { |
|
40 | + $withProjectUrl = ''; |
|
41 | + if ($with_project > 0) { |
|
42 | 42 | $withProjectUrl = "&withproject=1"; |
43 | 43 | } |
44 | 44 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $head[$h][2] = 'conferenceorbooth'; |
132 | 132 | // Enable caching of conf or booth count attendees |
133 | 133 | $nbAttendees = 0; |
134 | - $nbConferenceOrBooth= 0; |
|
134 | + $nbConferenceOrBooth = 0; |
|
135 | 135 | require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; |
136 | 136 | $cachekey = 'count_conferenceorbooth_project_'.$object->id; |
137 | 137 | $dataretrieved = dol_getcache($cachekey); |
@@ -139,14 +139,14 @@ discard block |
||
139 | 139 | $nbAttendees = $dataretrieved; |
140 | 140 | } else { |
141 | 141 | require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; |
142 | - $conforbooth=new ConferenceOrBooth($db); |
|
142 | + $conforbooth = new ConferenceOrBooth($db); |
|
143 | 143 | $result = $conforbooth->fetchAll('', '', 0, 0, array('t.fk_project'=>$object->id)); |
144 | - if (!is_array($result) && $result<0) { |
|
144 | + if (!is_array($result) && $result < 0) { |
|
145 | 145 | setEventMessages($conforbooth->error, $conforbooth->errors, 'errors'); |
146 | 146 | } else { |
147 | 147 | $nbConferenceOrBooth = count($result); |
148 | 148 | } |
149 | - dol_setcache($cachekey, $nbConferenceOrBooth, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
149 | + dol_setcache($cachekey, $nbConferenceOrBooth, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
150 | 150 | } |
151 | 151 | if ($nbConferenceOrBooth > 0) { |
152 | 152 | $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbConferenceOrBooth.'</span>'; |
@@ -165,14 +165,14 @@ discard block |
||
165 | 165 | $nbAttendees = $dataretrieved; |
166 | 166 | } else { |
167 | 167 | require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; |
168 | - $attendees=new ConferenceOrBoothAttendee($db); |
|
168 | + $attendees = new ConferenceOrBoothAttendee($db); |
|
169 | 169 | $result = $attendees->fetchAll('', '', 0, 0, array('t.fk_project'=>$object->id)); |
170 | - if (!is_array($result) && $result<0) { |
|
170 | + if (!is_array($result) && $result < 0) { |
|
171 | 171 | setEventMessages($attendees->error, $attendees->errors, 'errors'); |
172 | 172 | } else { |
173 | 173 | $nbAttendees = count($result); |
174 | 174 | } |
175 | - dol_setcache($cachekey, $nbAttendees, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
175 | + dol_setcache($cachekey, $nbAttendees, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
176 | 176 | } |
177 | 177 | if ($nbAttendees > 0) { |
178 | 178 | $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbAttendees.'</span>'; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function getExample() |
78 | 78 | { |
79 | - return $this->prefix.'0-0501-0001'; // TC0-0501-0001 |
|
79 | + return $this->prefix.'0-0501-0001'; // TC0-0501-0001 |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -92,10 +92,10 @@ discard block |
||
92 | 92 | $pryymm = ''; |
93 | 93 | $max = ''; |
94 | 94 | |
95 | - $pos_source = 0; // POS source = Terminal ID |
|
95 | + $pos_source = 0; // POS source = Terminal ID |
|
96 | 96 | |
97 | 97 | // First, we get the max value |
98 | - $posindice = strlen($this->prefix.$pos_source.'-____-') + 1; // So posindice is position after TCX-YYMM- |
|
98 | + $posindice = strlen($this->prefix.$pos_source.'-____-') + 1; // So posindice is position after TCX-YYMM- |
|
99 | 99 | |
100 | 100 | $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; |
101 | 101 | $sql .= " FROM ".MAIN_DB_PREFIX."facture"; |
@@ -135,10 +135,10 @@ discard block |
||
135 | 135 | { |
136 | 136 | global $db; |
137 | 137 | |
138 | - $pos_source = is_object($invoice) && $invoice->pos_source > 0 ? $invoice->pos_source : 0; // POS source = Terminal ID |
|
138 | + $pos_source = is_object($invoice) && $invoice->pos_source > 0 ? $invoice->pos_source : 0; // POS source = Terminal ID |
|
139 | 139 | |
140 | 140 | // First, we get the max value |
141 | - $posindice = strlen($this->prefix.$pos_source.'-____-') + 1; // So posindice is position after TCX-YYMM- |
|
141 | + $posindice = strlen($this->prefix.$pos_source.'-____-') + 1; // So posindice is position after TCX-YYMM- |
|
142 | 142 | $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL |
143 | 143 | $sql .= " FROM ".MAIN_DB_PREFIX."facture"; |
144 | 144 | $sql .= " WHERE ref LIKE '".$db->escape($this->prefix.$pos_source."-____-%")."'"; |
@@ -105,7 +105,7 @@ |
||
105 | 105 | $match = preg_grep('/('.preg_quote($htmlname, '/').'[0-9]+)/', array_keys($_GET)); |
106 | 106 | sort($match); |
107 | 107 | |
108 | - $id = (!empty($match[0]) ? $match[0] : ''); // Take first key found into GET array with matching $htmlname123 |
|
108 | + $id = (!empty($match[0]) ? $match[0] : ''); // Take first key found into GET array with matching $htmlname123 |
|
109 | 109 | |
110 | 110 | // When used from jQuery, the search term is added as GET param "term". |
111 | 111 | $searchkey = (($id && GETPOST($id, 'alpha')) ? GETPOST($id, 'alpha') : (($htmlname && GETPOST($htmlname, 'alpha')) ?GETPOST($htmlname, 'alpha') : '')); |
@@ -53,20 +53,20 @@ discard block |
||
53 | 53 | // Security check |
54 | 54 | if ($user->socid) $socid = $user->socid; |
55 | 55 | |
56 | -$search_ref = GETPOST('search_ref', 'alpha'); |
|
57 | -$search_date_startday = GETPOST('search_date_startday', 'int'); |
|
58 | -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); |
|
59 | -$search_date_startyear = GETPOST('search_date_startyear', 'int'); |
|
56 | +$search_ref = GETPOST('search_ref', 'alpha'); |
|
57 | +$search_date_startday = GETPOST('search_date_startday', 'int'); |
|
58 | +$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); |
|
59 | +$search_date_startyear = GETPOST('search_date_startyear', 'int'); |
|
60 | 60 | $search_date_endday = GETPOST('search_date_endday', 'int'); |
61 | -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); |
|
61 | +$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); |
|
62 | 62 | $search_date_endyear = GETPOST('search_date_endyear', 'int'); |
63 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
63 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
64 | 64 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
65 | 65 | $search_company = GETPOST('search_company', 'alpha'); |
66 | 66 | $search_payment_type = GETPOST('search_payment_type'); |
67 | -$search_cheque_num = GETPOST('search_cheque_num', 'alpha'); |
|
67 | +$search_cheque_num = GETPOST('search_cheque_num', 'alpha'); |
|
68 | 68 | $search_bank_account = GETPOST('search_bank_account', 'int'); |
69 | -$search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x' |
|
69 | +$search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x' |
|
70 | 70 | |
71 | 71 | $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; |
72 | 72 | $sortfield = GETPOST('sortfield', 'aZ09comma'); |
@@ -207,10 +207,10 @@ discard block |
||
207 | 207 | $sql .= natural_search('p.ref', $search_ref); |
208 | 208 | } |
209 | 209 | if ($search_date_start) { |
210 | - $sql .= " AND p.datep >= '" . $db->idate($search_date_start) . "'"; |
|
210 | + $sql .= " AND p.datep >= '".$db->idate($search_date_start)."'"; |
|
211 | 211 | } |
212 | 212 | if ($search_date_end) { |
213 | - $sql .=" AND p.datep <= '" . $db->idate($search_date_end) . "'"; |
|
213 | + $sql .= " AND p.datep <= '".$db->idate($search_date_end)."'"; |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | if ($search_company) { |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | // Put here all includes required by your class file |
29 | 29 | require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; |
30 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skillrank.lib.php'; |
|
30 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skillrank.lib.php'; |
|
31 | 31 | |
32 | 32 | /** |
33 | 33 | * Class for SkillRank |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | /** |
105 | 105 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
106 | 106 | */ |
107 | - public $fields=array( |
|
107 | + public $fields = array( |
|
108 | 108 | 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), |
109 | 109 | 'fk_skill' => array('type'=>'integer:Skill:hrm/class/skill.class.php:1', 'label'=>'Skill', 'enabled'=>'1', 'position'=>3, 'notnull'=>1, 'visible'=>1, 'index'=>1,), |
110 | 110 | 'rankorder' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>'1', 'position'=>4, 'notnull'=>1, 'visible'=>1, 'default' => 0), |
@@ -371,13 +371,13 @@ discard block |
||
371 | 371 | global $user; |
372 | 372 | |
373 | 373 | $this->fk_skill = $currentSkill->fk_skill; |
374 | - $this->rankorder = $currentSkill->rankorder; |
|
374 | + $this->rankorder = $currentSkill->rankorder; |
|
375 | 375 | $this->fk_object = $fk_user; |
376 | 376 | $this->date_creation = dol_now(); |
377 | 377 | $this->fk_user_creat = $user->id; |
378 | 378 | $this->fk_user_modif = $user->id; |
379 | - $this->objecttype = self::SKILLRANK_TYPE_USER; |
|
380 | - $result = $this->create($user); |
|
379 | + $this->objecttype = self::SKILLRANK_TYPE_USER; |
|
380 | + $result = $this->create($user); |
|
381 | 381 | |
382 | 382 | return $result; |
383 | 383 | } |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | { |
109 | 109 | global $db, $conf, $langs; |
110 | 110 | |
111 | - require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; |
|
112 | - require_once DOL_DOCUMENT_ROOT . '/hrm/class/skilldet.class.php'; |
|
111 | + require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php'; |
|
112 | + require_once DOL_DOCUMENT_ROOT.'/hrm/class/skilldet.class.php'; |
|
113 | 113 | |
114 | 114 | // On charge les différentes notes possibles pour la compétence $fk_skill |
115 | 115 | $skilldet = new Skilldet($db); |
116 | 116 | $Lines = $skilldet->fetchAll('ASC', 'rankorder', 0, 0, array('customsql'=>'fk_skill = '.$fk_skill)); |
117 | 117 | |
118 | - if (!is_array($Lines) && $Lines<0) { |
|
118 | + if (!is_array($Lines) && $Lines < 0) { |
|
119 | 119 | setEventMessages($skilldet->error, $skilldet->errors, 'errors'); |
120 | 120 | } |
121 | 121 | if (empty($Lines)) return $langs->trans('SkillHasNoLines'); |
@@ -128,29 +128,29 @@ discard block |
||
128 | 128 | continue; |
129 | 129 | } |
130 | 130 | |
131 | - $ret .= '<span title="' . $line->description . '" class="radio_js_bloc_number ' . $inputname . '_' . $line->fk_skill; |
|
131 | + $ret .= '<span title="'.$line->description.'" class="radio_js_bloc_number '.$inputname.'_'.$line->fk_skill; |
|
132 | 132 | $ret .= $line->rankorder == $selected_rank ? ' selected' : ''; |
133 | - $ret .= '">' . $line->rankorder . '</span>'; |
|
133 | + $ret .= '">'.$line->rankorder.'</span>'; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | if ($mode == 'edit') { |
137 | 137 | $ret .= ' |
138 | - <input type="hidden" id="' . $inputname . '_' . $fk_skill . '" name="' . $inputname . '[' . $fk_skill . ']" value="' . $selected_rank . '"> |
|
138 | + <input type="hidden" id="' . $inputname.'_'.$fk_skill.'" name="'.$inputname.'['.$fk_skill.']" value="'.$selected_rank.'"> |
|
139 | 139 | <script type="text/javascript"> |
140 | 140 | $(document).ready(function(){ |
141 | 141 | $(".radio_js_bloc_number").tooltip(); |
142 | 142 | var error,same; |
143 | - $(".' . $inputname . '_' . $fk_skill . '").on("click",function(){ |
|
143 | + $(".' . $inputname.'_'.$fk_skill.'").on("click",function(){ |
|
144 | 144 | same=false; |
145 | 145 | val = $(this).html(); |
146 | 146 | if($(this).hasClass("selected"))same=true; |
147 | - $(".' . $inputname . '_' . $fk_skill . '").removeClass("selected"); |
|
147 | + $(".' . $inputname.'_'.$fk_skill.'").removeClass("selected"); |
|
148 | 148 | if(same) |
149 | 149 | { |
150 | - $("#' . $inputname . '_' . $fk_skill . '").val(""); |
|
150 | + $("#' . $inputname.'_'.$fk_skill.'").val(""); |
|
151 | 151 | }else { |
152 | 152 | $(this).addClass("selected"); |
153 | - $("#' . $inputname . '_' . $fk_skill . '").val(val); |
|
153 | + $("#' . $inputname.'_'.$fk_skill.'").val(val); |
|
154 | 154 | } |
155 | 155 | }); |
156 | 156 |