@@ -459,8 +459,12 @@ discard block |
||
459 | 459 | |
460 | 460 | |
461 | 461 | $creator_info = $langs->trans("CaseFollowedBy").' '.$tmpuser->getFullName($langs); |
462 | - if ($tmpuser->email) $creator_info .= ', '.$langs->trans("EMail").': '.$tmpuser->email; |
|
463 | - if ($tmpuser->office_phone) $creator_info .= ', '.$langs->trans("Phone").': '.$tmpuser->office_phone; |
|
462 | + if ($tmpuser->email) { |
|
463 | + $creator_info .= ', '.$langs->trans("EMail").': '.$tmpuser->email; |
|
464 | + } |
|
465 | + if ($tmpuser->office_phone) { |
|
466 | + $creator_info .= ', '.$langs->trans("Phone").': '.$tmpuser->office_phone; |
|
467 | + } |
|
464 | 468 | |
465 | 469 | $notetoshow = dol_concatdesc($notetoshow, $creator_info); |
466 | 470 | } |
@@ -1439,7 +1443,9 @@ discard block |
||
1439 | 1443 | global $conf, $langs; |
1440 | 1444 | |
1441 | 1445 | $ltrdirection = 'L'; |
1442 | - if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; |
|
1446 | + if ($outputlangs->trans("DIRECTION") == 'rtl') { |
|
1447 | + $ltrdirection = 'R'; |
|
1448 | + } |
|
1443 | 1449 | |
1444 | 1450 | // Load traductions files required by page |
1445 | 1451 | $outputlangs->loadLangs(array("main", "propal", "companies", "bills")); |
@@ -908,7 +908,7 @@ discard block |
||
908 | 908 | $pdf->SetXY($this->marge_gauche, $posy); |
909 | 909 | $titre = $outputlangs->transnoentities("DateDeliveryPlanned").':'; |
910 | 910 | $pdf->MultiCell(80, 4, $titre, 0, 'L'); |
911 | - $pdf->SetFont('', '', $default_font_size -$diffsizetitle); |
|
911 | + $pdf->SetFont('', '', $default_font_size - $diffsizetitle); |
|
912 | 912 | $pdf->SetXY($posxval, $posy); |
913 | 913 | $dlp = dol_print_date($object->delivery_date, $displaydate, false, $outputlangs, true); |
914 | 914 | $pdf->MultiCell(80, 4, $dlp, 0, 'L'); |
@@ -1663,7 +1663,7 @@ discard block |
||
1663 | 1663 | |
1664 | 1664 | $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); |
1665 | 1665 | |
1666 | - $mode = 'target'; |
|
1666 | + $mode = 'target'; |
|
1667 | 1667 | $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); |
1668 | 1668 | |
1669 | 1669 | // Show recipient |
@@ -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>'; |
@@ -856,7 +856,9 @@ |
||
856 | 856 | |
857 | 857 | $statusType = 'status'.$status; |
858 | 858 | //if ($status == self::STATUS_DISABLED) $statusType = 'status6'; |
859 | - if ($status == self::STATUS_ENABLED) $statusType = 'status4'; |
|
859 | + if ($status == self::STATUS_ENABLED) { |
|
860 | + $statusType = 'status4'; |
|
861 | + } |
|
860 | 862 | |
861 | 863 | return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); |
862 | 864 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | /** |
98 | 98 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
99 | 99 | */ |
100 | - public $fields=array( |
|
100 | + public $fields = array( |
|
101 | 101 | 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), |
102 | 102 | 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>1, 'noteditable'=>'0', 'default'=>'', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"), |
103 | 103 | 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax125', 'showoncombobox'=>'2',), |
@@ -110,14 +110,14 @@ discard block |
||
110 | 110 | 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,), |
111 | 111 | 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>512, 'notnull'=>-1, 'visible'=>-2,), |
112 | 112 | 'nb_operators_required' => array('type'=>'integer', 'label'=>'NbOperatorsRequired', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>1,), |
113 | - 'thm_operator_estimated' => array('type'=>'double', 'help'=>'THMOperatorEstimatedHelp','label'=>'THMOperatorEstimated', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>1, 'css'=>'right'), |
|
113 | + 'thm_operator_estimated' => array('type'=>'double', 'help'=>'THMOperatorEstimatedHelp', 'label'=>'THMOperatorEstimated', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>1, 'css'=>'right'), |
|
114 | 114 | 'thm_machine_estimated' => array('type'=>'double', 'help'=>'THMMachineEstimatedHelp', 'label'=>'THMMachineEstimated', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>1, 'css'=>'right'), |
115 | 115 | 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'default'=>1, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Disabled', '1'=>'Enabled'),), |
116 | 116 | ); |
117 | 117 | public $rowid; |
118 | 118 | public $ref; |
119 | 119 | public $label; |
120 | - public $type; // HUMAN, MACHINE, ... |
|
120 | + public $type; // HUMAN, MACHINE, ... |
|
121 | 121 | |
122 | 122 | public $date_creation; |
123 | 123 | public $tms; |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | // Usergroups |
457 | 457 | $groups = GETPOST('groups', 'array:int'); |
458 | 458 | WorkstationUserGroup::deleteAllGroupsOfWorkstation($this->id); |
459 | - $this->usergroups=array(); |
|
459 | + $this->usergroups = array(); |
|
460 | 460 | |
461 | 461 | foreach ($groups as $id_group) { |
462 | 462 | $ws_usergroup = new WorkstationUserGroup($this->db); |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | // Resources |
470 | 470 | $resources = GETPOST('resources', 'array:int'); |
471 | 471 | WorkstationResource::deleteAllResourcesOfWorkstation($this->id); |
472 | - $this->resources=array(); |
|
472 | + $this->resources = array(); |
|
473 | 473 | if (!empty($resources)) { |
474 | 474 | foreach ($resources as $id_resource) { |
475 | 475 | $ws_resource = new WorkstationResource($this->db); |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | $label = $langs->trans("ShowWorkstation"); |
637 | 637 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
638 | 638 | } |
639 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
639 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
640 | 640 | $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
641 | 641 | } else { |
642 | 642 | $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
@@ -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') : '')); |
@@ -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 | } |
@@ -240,7 +240,9 @@ |
||
240 | 240 | if (empty($nocommentremoval)) { |
241 | 241 | $buf = preg_replace('/([,;ERLT\)])\s*--.*$/i', '\1', $buf); //remove comment from a line that not start with -- before add it to the buffer |
242 | 242 | } |
243 | - if ($buffer) $buffer .= ' '; |
|
243 | + if ($buffer) { |
|
244 | + $buffer .= ' '; |
|
245 | + } |
|
244 | 246 | $buffer .= trim($buf); |
245 | 247 | } |
246 | 248 |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | if ($sql) { |
329 | 329 | // Test if th SQL is allowed SQL |
330 | 330 | if ($onlysqltoimportwebsite) { |
331 | - $newsql = str_replace(array("\'"), '__BACKSLASHQUOTE__', $sql); // Replace the \' char |
|
331 | + $newsql = str_replace(array("\'"), '__BACKSLASHQUOTE__', $sql); // Replace the \' char |
|
332 | 332 | |
333 | 333 | // Remove all strings contents including the ' so we can analyse SQL instruction only later |
334 | 334 | $l = strlen($newsql); |
@@ -1230,7 +1230,7 @@ discard block |
||
1230 | 1230 | |
1231 | 1231 | if (!count($ret['errors'])) { |
1232 | 1232 | $ret['nbmodules']++; |
1233 | - $ret['nbperms'] += (is_array($objMod->rights)?count($objMod->rights):0); |
|
1233 | + $ret['nbperms'] += (is_array($objMod->rights) ?count($objMod->rights) : 0); |
|
1234 | 1234 | } |
1235 | 1235 | |
1236 | 1236 | return $ret; |
@@ -1870,7 +1870,7 @@ discard block |
||
1870 | 1870 | global $conf, $langs; |
1871 | 1871 | |
1872 | 1872 | $text = $langs->trans("OnlyFollowingModulesAreOpenedToExternalUsers"); |
1873 | - $listofmodules = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); // List of modules qualified for external user management |
|
1873 | + $listofmodules = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); // List of modules qualified for external user management |
|
1874 | 1874 | |
1875 | 1875 | $i = 0; |
1876 | 1876 | if (!empty($modules)) { |
@@ -373,7 +373,7 @@ |
||
373 | 373 | $caction = new CActionComm($this->db); |
374 | 374 | |
375 | 375 | // Suggest a list with manual events or all auto events |
376 | - $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot, '', 0); // If we use param 'all' instead of 'code', there is no group by include in answer but the key 'type' of answer array contains the key for the group by. |
|
376 | + $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot, '', 0); // If we use param 'all' instead of 'code', there is no group by include in answer but the key 'type' of answer array contains the key for the group by. |
|
377 | 377 | if (empty($multiselect)) { |
378 | 378 | // Add empty line at start only if no multiselect |
379 | 379 | array_unshift($arraylist, ' '); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | //Calcul total qty and amount for global if full scan list |
130 | 130 | $total_qty_toconsume = 0; |
131 | 131 | $total_qty_toproduce = 0; |
132 | - $product_cache=array(); |
|
132 | + $product_cache = array(); |
|
133 | 133 | $bom_data_result = array(); |
134 | 134 | |
135 | 135 | //Qauntity to produce |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | } |
180 | 180 | $bomtmp->fk_product = $objp->fk_product; |
181 | 181 | $bom_data_result[$objp->rowid]['link'] = $bomtmp->getNomUrl(1, 'production'); |
182 | - $bom_data_result[$objp->rowid]['product'] = (array_key_exists($objp->fk_product, $product_cache)? $product_cache[$objp->fk_product]->getNomUrl(1): ''); |
|
182 | + $bom_data_result[$objp->rowid]['product'] = (array_key_exists($objp->fk_product, $product_cache) ? $product_cache[$objp->fk_product]->getNomUrl(1) : ''); |
|
183 | 183 | $bom_data_result[$objp->rowid]['qty_toproduce'] += ($objp->qty_toproduce > 0 ? $objp->qty_toproduce : 0); |
184 | 184 | $bom_data_result[$objp->rowid]['qty_toconsume'] = 0; |
185 | 185 | $bom_data_result[$objp->rowid]['date_valid'] = dol_print_date($db->jdate($objp->date_valid), 'dayhour'); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | |
243 | 243 | if (!array_key_exists($objp->rowid, $bom_data_result)) { |
244 | 244 | $bom_data_result[$objp->rowid]['link'] = $bomtmp->getNomUrl(1, 'production'); |
245 | - $bom_data_result[$objp->rowid]['product'] = (array_key_exists($objp->fk_product, $product_cache)? $product_cache[$objp->fk_product]->getNomUrl(1): ''); |
|
245 | + $bom_data_result[$objp->rowid]['product'] = (array_key_exists($objp->fk_product, $product_cache) ? $product_cache[$objp->fk_product]->getNomUrl(1) : ''); |
|
246 | 246 | $bom_data_result[$objp->rowid]['qty_toproduce'] = 0; |
247 | 247 | $bom_data_result[$objp->rowid]['qty_toconsume'] += ($objp->qty_toconsume > 0 ? $objp->qty_toconsume : 0); |
248 | 248 | $bom_data_result[$objp->rowid]['date_valid'] = dol_print_date($db->jdate($objp->date_valid), 'dayhour'); |