@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | if ($action != '') { |
115 | 115 | if (!$error) { |
116 | 116 | setEventMessage($langs->trans("SetupSaved")); |
117 | - header("Location: " . $_SERVER["PHP_SELF"]); |
|
117 | + header("Location: ".$_SERVER["PHP_SELF"]); |
|
118 | 118 | exit; |
119 | 119 | } else { |
120 | 120 | setEventMessages('', $errors, 'errors'); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | llxHeader(); |
130 | 130 | |
131 | -$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>'; |
|
131 | +$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>'; |
|
132 | 132 | print load_fiche_titre($langs->trans("OpenIDconnectSetup"), $linkback, 'title_setup'); |
133 | 133 | |
134 | 134 | $head = openid_connect_prepare_head(); |
@@ -156,84 +156,84 @@ discard block |
||
156 | 156 | print "</tr>\n"; |
157 | 157 | |
158 | 158 | // MAIN_AUTHENTICATION_OIDC_LOGIN_CLAIM |
159 | -print '<tr class="oddeven">' . "\n"; |
|
159 | +print '<tr class="oddeven">'."\n"; |
|
160 | 160 | print '<td>'.$langs->trans("MainAuthenticationOidcLoginClaimName").'</td>'."\n"; |
161 | 161 | print '<td>'.$langs->trans("MainAuthenticationOidcLoginClaimDesc").'</td>'."\n"; |
162 | -print '<td align="right">' . "\n"; |
|
162 | +print '<td align="right">'."\n"; |
|
163 | 163 | print '<input name="MAIN_AUTHENTICATION_OIDC_LOGIN_CLAIM" id="MAIN_AUTHENTICATION_OIDC_LOGIN_CLAIM" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_AUTHENTICATION_OIDC_LOGIN_CLAIM') ? GETPOST('MAIN_AUTHENTICATION_OIDC_LOGIN_CLAIM', 'nohtml') : (!empty($conf->global->MAIN_AUTHENTICATION_OIDC_LOGIN_CLAIM) ? getDolGlobalString("MAIN_AUTHENTICATION_OIDC_LOGIN_CLAIM") : ''))).'"></td></tr>'; |
164 | -print '</td></tr>' . "\n"; |
|
164 | +print '</td></tr>'."\n"; |
|
165 | 165 | |
166 | 166 | // MAIN_AUTHENTICATION_OIDC_CLIENT_ID |
167 | -print '<tr class="oddeven">' . "\n"; |
|
167 | +print '<tr class="oddeven">'."\n"; |
|
168 | 168 | print '<td>'.$langs->trans("MainAuthenticationOidcClientIdName").'</td>'."\n"; |
169 | 169 | print '<td>'.$langs->trans("MainAuthenticationOidcClientIdDesc").'</td>'."\n"; |
170 | -print '<td align="right">' . "\n"; |
|
170 | +print '<td align="right">'."\n"; |
|
171 | 171 | print '<input name="MAIN_AUTHENTICATION_OIDC_CLIENT_ID" id="MAIN_AUTHENTICATION_OIDC_CLIENT_ID" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_AUTHENTICATION_OIDC_CLIENT_ID') ? GETPOST('MAIN_AUTHENTICATION_OIDC_CLIENT_ID', 'nohtml') : (!empty($conf->global->MAIN_AUTHENTICATION_OIDC_CLIENT_ID) ? getDolGlobalString("MAIN_AUTHENTICATION_OIDC_CLIENT_ID") : ''))).'"></td></tr>'; |
172 | -print '</td></tr>' . "\n"; |
|
172 | +print '</td></tr>'."\n"; |
|
173 | 173 | |
174 | 174 | // MAIN_AUTHENTICATION_OIDC_CLIENT_SECRET |
175 | -print '<tr class="oddeven">' . "\n"; |
|
175 | +print '<tr class="oddeven">'."\n"; |
|
176 | 176 | print '<td>'.$langs->trans("MainAuthenticationOidcClientSecretName").'</td>'."\n"; |
177 | 177 | print '<td>'.$langs->trans("MainAuthenticationOidcClientSecretDesc").'</td>'."\n"; |
178 | -print '<td align="right">' . "\n"; |
|
178 | +print '<td align="right">'."\n"; |
|
179 | 179 | print '<input type="password" name="MAIN_AUTHENTICATION_OIDC_CLIENT_SECRET" id="MAIN_AUTHENTICATION_OIDC_CLIENT_SECRET" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_AUTHENTICATION_OIDC_CLIENT_SECRET') ? GETPOST('MAIN_AUTHENTICATION_OIDC_CLIENT_SECRET', 'nohtml') : (!empty($conf->global->MAIN_AUTHENTICATION_OIDC_CLIENT_SECRET) ? getDolGlobalString("MAIN_AUTHENTICATION_OIDC_CLIENT_SECRET") : ''))).'"></td></tr>'; |
180 | -print '</td></tr>' . "\n"; |
|
180 | +print '</td></tr>'."\n"; |
|
181 | 181 | |
182 | 182 | // MAIN_AUTHENTICATION_OIDC_SCOPES |
183 | -print '<tr class="oddeven">' . "\n"; |
|
183 | +print '<tr class="oddeven">'."\n"; |
|
184 | 184 | print '<td>'.$langs->trans("MainAuthenticationOidcScopesName").'</td>'."\n"; |
185 | 185 | print '<td>'.$langs->trans("MainAuthenticationOidcScopesDesc").'</td>'."\n"; |
186 | -print '<td align="right">' . "\n"; |
|
186 | +print '<td align="right">'."\n"; |
|
187 | 187 | print '<input name="MAIN_AUTHENTICATION_OIDC_SCOPES" id="MAIN_AUTHENTICATION_OIDC_SCOPES" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_AUTHENTICATION_OIDC_SCOPES') ? GETPOST('MAIN_AUTHENTICATION_OIDC_SCOPES', 'nohtml') : (!empty($conf->global->MAIN_AUTHENTICATION_OIDC_SCOPES) ? getDolGlobalString("MAIN_AUTHENTICATION_OIDC_SCOPES") : ''))).'"></td></tr>'; |
188 | -print '</td></tr>' . "\n"; |
|
188 | +print '</td></tr>'."\n"; |
|
189 | 189 | |
190 | 190 | // MAIN_AUTHENTICATION_OIDC_AUTHORIZE_URL |
191 | -print '<tr class="oddeven">' . "\n"; |
|
191 | +print '<tr class="oddeven">'."\n"; |
|
192 | 192 | print '<td>'.$langs->trans("MainAuthenticationOidcAuthorizeUrlName").'</td>'."\n"; |
193 | 193 | print '<td>'.$langs->trans("MainAuthenticationOidcAuthorizeUrlDesc").'</td>'."\n"; |
194 | -print '<td align="right">' . "\n"; |
|
194 | +print '<td align="right">'."\n"; |
|
195 | 195 | print '<input name="MAIN_AUTHENTICATION_OIDC_AUTHORIZE_URL" id="MAIN_AUTHENTICATION_OIDC_AUTHORIZE_URL" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_AUTHENTICATION_OIDC_AUTHORIZE_URL') ? GETPOST('MAIN_AUTHENTICATION_OIDC_AUTHORIZE_URL', 'nohtml') : (!empty($conf->global->MAIN_AUTHENTICATION_OIDC_AUTHORIZE_URL) ? getDolGlobalString("MAIN_AUTHENTICATION_OIDC_AUTHORIZE_URL") : ''))).'"></td></tr>'; |
196 | -print '</td></tr>' . "\n"; |
|
196 | +print '</td></tr>'."\n"; |
|
197 | 197 | |
198 | 198 | // MAIN_AUTHENTICATION_OIDC_TOKEN_URL |
199 | -print '<tr class="oddeven">' . "\n"; |
|
199 | +print '<tr class="oddeven">'."\n"; |
|
200 | 200 | print '<td>'.$langs->trans("MainAuthenticationOidcTokenUrlName").'</td>'."\n"; |
201 | 201 | print '<td>'.$langs->trans("MainAuthenticationOidcTokenUrlDesc").'</td>'."\n"; |
202 | -print '<td align="right">' . "\n"; |
|
202 | +print '<td align="right">'."\n"; |
|
203 | 203 | print '<input name="MAIN_AUTHENTICATION_OIDC_TOKEN_URL" id="MAIN_AUTHENTICATION_OIDC_TOKEN_URL" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_AUTHENTICATION_OIDC_TOKEN_URL') ? GETPOST('MAIN_AUTHENTICATION_OIDC_TOKEN_URL', 'nohtml') : (!empty($conf->global->MAIN_AUTHENTICATION_OIDC_TOKEN_URL) ? getDolGlobalString("MAIN_AUTHENTICATION_OIDC_TOKEN_URL") : ''))).'"></td></tr>'; |
204 | -print '</td></tr>' . "\n"; |
|
204 | +print '</td></tr>'."\n"; |
|
205 | 205 | |
206 | 206 | // MAIN_AUTHENTICATION_OIDC_USERINFO_URL |
207 | -print '<tr class="oddeven">' . "\n"; |
|
207 | +print '<tr class="oddeven">'."\n"; |
|
208 | 208 | print '<td>'.$langs->trans("MainAuthenticationOidcUserinfoUrlName").'</td>'."\n"; |
209 | 209 | print '<td>'.$langs->trans("MainAuthenticationOidcUserinfoUrlDesc").'</td>'."\n"; |
210 | -print '<td align="right">' . "\n"; |
|
210 | +print '<td align="right">'."\n"; |
|
211 | 211 | print '<input name="MAIN_AUTHENTICATION_OIDC_USERINFO_URL" id="MAIN_AUTHENTICATION_OIDC_USERINFO_URL" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_AUTHENTICATION_OIDC_USERINFO_URL') ? GETPOST('MAIN_AUTHENTICATION_OIDC_USERINFO_URL', 'nohtml') : (!empty($conf->global->MAIN_AUTHENTICATION_OIDC_USERINFO_URL) ? getDolGlobalString("MAIN_AUTHENTICATION_OIDC_USERINFO_URL") : ''))).'"></td></tr>'; |
212 | -print '</td></tr>' . "\n"; |
|
212 | +print '</td></tr>'."\n"; |
|
213 | 213 | |
214 | 214 | // MAIN_AUTHENTICATION_OIDC_LOGOUT_URL |
215 | -print '<tr class="oddeven">' . "\n"; |
|
215 | +print '<tr class="oddeven">'."\n"; |
|
216 | 216 | print '<td>'.$langs->trans("MainAuthenticationOidcLogoutUrlName").'</td>'."\n"; |
217 | 217 | print '<td>'.$langs->trans("MainAuthenticationOidcLogoutUrlDesc").'</td>'."\n"; |
218 | -print '<td align="right">' . "\n"; |
|
218 | +print '<td align="right">'."\n"; |
|
219 | 219 | print '<input name="MAIN_AUTHENTICATION_OIDC_LOGOUT_URL" id="MAIN_AUTHENTICATION_OIDC_LOGOUT_URL" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_AUTHENTICATION_OIDC_LOGOUT_URL') ? GETPOST('MAIN_AUTHENTICATION_OIDC_LOGOUT_URL', 'nohtml') : (!empty($conf->global->MAIN_AUTHENTICATION_OIDC_LOGOUT_URL) ? getDolGlobalString("MAIN_AUTHENTICATION_OIDC_LOGOUT_URL") : ''))).'"></td></tr>'; |
220 | -print '</td></tr>' . "\n"; |
|
220 | +print '</td></tr>'."\n"; |
|
221 | 221 | |
222 | 222 | // REDIRECT_URL |
223 | -print '<tr class="oddeven">' . "\n"; |
|
223 | +print '<tr class="oddeven">'."\n"; |
|
224 | 224 | print '<td>'.$langs->trans("MainAuthenticationOidcRedirectUrlName").'</td>'."\n"; |
225 | 225 | print '<td>'.$langs->trans("MainAuthenticationOidcRedirectUrlDesc").'</td>'."\n"; |
226 | -print '<td align="right">' . "\n"; |
|
226 | +print '<td align="right">'."\n"; |
|
227 | 227 | print '<input class="minwidth300" value="'.dol_escape_htmltag(openid_connect_get_redirect_url()).'" disabled></td></tr>'; |
228 | -print '</td></tr>' . "\n"; |
|
228 | +print '</td></tr>'."\n"; |
|
229 | 229 | |
230 | 230 | // LOGOUT_URL |
231 | -print '<tr class="oddeven">' . "\n"; |
|
231 | +print '<tr class="oddeven">'."\n"; |
|
232 | 232 | print '<td>'.$langs->trans("MainAuthenticationOidcLogoutRedirectUrlName").'</td>'."\n"; |
233 | 233 | print '<td>'.$langs->trans("MainAuthenticationOidcLogoutRedirectUrlDesc").'</td>'."\n"; |
234 | -print '<td align="right">' . "\n"; |
|
235 | -print '<input class="minwidth300" value="'.dol_escape_htmltag(getDolGlobalString('MAIN_LOGOUT_GOTO_URL', DOL_MAIN_URL_ROOT . "/index.php")).'" disabled></td></tr>'; |
|
236 | -print '</td></tr>' . "\n"; |
|
234 | +print '<td align="right">'."\n"; |
|
235 | +print '<input class="minwidth300" value="'.dol_escape_htmltag(getDolGlobalString('MAIN_LOGOUT_GOTO_URL', DOL_MAIN_URL_ROOT."/index.php")).'" disabled></td></tr>'; |
|
236 | +print '</td></tr>'."\n"; |
|
237 | 237 | |
238 | 238 | print '</table>'."\n"; |
239 | 239 | print '</div>'; |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | |
554 | 554 | $variants = $object->hasVariants(); |
555 | 555 | |
556 | - $object->load_stock(); // This include the load_virtual_stock() |
|
556 | + $object->load_stock(); // This include the load_virtual_stock() |
|
557 | 557 | |
558 | 558 | $title = $langs->trans('ProductServiceCard'); |
559 | 559 | $helpurl = ''; |
@@ -1061,7 +1061,7 @@ discard block |
||
1061 | 1061 | print '<td colspan="4">'; |
1062 | 1062 | print $entrepotstatic->getNomUrl(1); |
1063 | 1063 | if (!empty($conf->use_javascript_ajax) && isModEnabled('productbatch') && $object->hasbatch()) { |
1064 | - print '<a class="collapse_batch marginleftonly" id="ent' . $entrepotstatic->id . '" href="#">'; |
|
1064 | + print '<a class="collapse_batch marginleftonly" id="ent'.$entrepotstatic->id.'" href="#">'; |
|
1065 | 1065 | print(!getDolGlobalString('STOCK_SHOW_ALL_BATCH_BY_DEFAULT') ? '(+)' : '(-)'); |
1066 | 1066 | print '</a>'; |
1067 | 1067 | } |
@@ -1303,7 +1303,7 @@ discard block |
||
1303 | 1303 | $pse = new ProductStockEntrepot($db); |
1304 | 1304 | $lines = $pse->fetchAll($id); |
1305 | 1305 | |
1306 | - $visibleWarehouseEntities = explode(',', getEntity('stock')); // For MultiCompany compatibility |
|
1306 | + $visibleWarehouseEntities = explode(',', getEntity('stock')); // For MultiCompany compatibility |
|
1307 | 1307 | |
1308 | 1308 | if (!empty($lines)) { |
1309 | 1309 | $var = false; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | /** |
151 | 151 | * @var string |
152 | 152 | */ |
153 | - public $price_formated; // used by takepos/ajax/ajax.php |
|
153 | + public $price_formated; // used by takepos/ajax/ajax.php |
|
154 | 154 | |
155 | 155 | /** |
156 | 156 | * Selling price with tax |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | /** |
163 | 163 | * @var string |
164 | 164 | */ |
165 | - public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
165 | + public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
166 | 166 | |
167 | 167 | /** |
168 | 168 | * Minimum price net |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | /** |
512 | 512 | * @var int|string |
513 | 513 | */ |
514 | - public $weight_units; // scale -3, 0, 3, 6 |
|
514 | + public $weight_units; // scale -3, 0, 3, 6 |
|
515 | 515 | /** |
516 | 516 | * @var float|string |
517 | 517 | */ |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | /** |
520 | 520 | * @var int|string |
521 | 521 | */ |
522 | - public $length_units; // scale -3, 0, 3, 6 |
|
522 | + public $length_units; // scale -3, 0, 3, 6 |
|
523 | 523 | /** |
524 | 524 | * @var float|string |
525 | 525 | */ |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | /** |
528 | 528 | * @var int|string |
529 | 529 | */ |
530 | - public $width_units; // scale -3, 0, 3, 6 |
|
530 | + public $width_units; // scale -3, 0, 3, 6 |
|
531 | 531 | /** |
532 | 532 | * @var float|string|null |
533 | 533 | */ |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | /** |
536 | 536 | * @var int|string|null |
537 | 537 | */ |
538 | - public $height_units; // scale -3, 0, 3, 6 |
|
538 | + public $height_units; // scale -3, 0, 3, 6 |
|
539 | 539 | /** |
540 | 540 | * @var float|string|null |
541 | 541 | */ |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | /** |
544 | 544 | * @var int|string|null |
545 | 545 | */ |
546 | - public $surface_units; // scale -3, 0, 3, 6 |
|
546 | + public $surface_units; // scale -3, 0, 3, 6 |
|
547 | 547 | /** |
548 | 548 | * @var float|string|null |
549 | 549 | */ |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | /** |
552 | 552 | * @var int|string|null |
553 | 553 | */ |
554 | - public $volume_units; // scale -3, 0, 3, 6 |
|
554 | + public $volume_units; // scale -3, 0, 3, 6 |
|
555 | 555 | |
556 | 556 | /** |
557 | 557 | * @var float|string|null |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | /** |
561 | 561 | * @var ?string |
562 | 562 | */ |
563 | - public $net_measure_units; // scale -3, 0, 3, 6 |
|
563 | + public $net_measure_units; // scale -3, 0, 3, 6 |
|
564 | 564 | |
565 | 565 | /** |
566 | 566 | * @var string |
@@ -870,7 +870,7 @@ discard block |
||
870 | 870 | 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000), |
871 | 871 | //'tosell' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), |
872 | 872 | //'tobuy' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), |
873 | - 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), |
|
873 | + 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), |
|
874 | 874 | ); |
875 | 875 | |
876 | 876 | /** |
@@ -1174,9 +1174,9 @@ discard block |
||
1174 | 1174 | |
1175 | 1175 | // update accountancy for this entity |
1176 | 1176 | if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
1177 | - $this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " .((int) $this->id) . " AND entity = " . ((int) $conf->entity)); |
|
1177 | + $this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); |
|
1178 | 1178 | |
1179 | - $sql = "INSERT INTO " . $this->db->prefix() . "product_perentity ("; |
|
1179 | + $sql = "INSERT INTO ".$this->db->prefix()."product_perentity ("; |
|
1180 | 1180 | $sql .= " fk_product"; |
1181 | 1181 | $sql .= ", entity"; |
1182 | 1182 | $sql .= ", accountancy_code_buy"; |
@@ -1187,13 +1187,13 @@ discard block |
||
1187 | 1187 | $sql .= ", accountancy_code_sell_export"; |
1188 | 1188 | $sql .= ") VALUES ("; |
1189 | 1189 | $sql .= $this->id; |
1190 | - $sql .= ", " . ((int) $conf->entity); |
|
1191 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1192 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
1193 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
1194 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1195 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
1196 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
1190 | + $sql .= ", ".((int) $conf->entity); |
|
1191 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1192 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
1193 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
1194 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1195 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
1196 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
1197 | 1197 | $sql .= ")"; |
1198 | 1198 | $result = $this->db->query($sql); |
1199 | 1199 | if (!$result) { |
@@ -1574,12 +1574,12 @@ discard block |
||
1574 | 1574 | $sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'null'); |
1575 | 1575 | $sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'"; |
1576 | 1576 | if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
1577 | - $sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1578 | - $sql .= ", accountancy_code_buy_intra = '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
1579 | - $sql .= ", accountancy_code_buy_export = '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
1580 | - $sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1581 | - $sql .= ", accountancy_code_sell_intra= '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
1582 | - $sql .= ", accountancy_code_sell_export= '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
1577 | + $sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1578 | + $sql .= ", accountancy_code_buy_intra = '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
1579 | + $sql .= ", accountancy_code_buy_export = '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
1580 | + $sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1581 | + $sql .= ", accountancy_code_sell_intra= '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
1582 | + $sql .= ", accountancy_code_sell_export= '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
1583 | 1583 | } |
1584 | 1584 | $sql .= ", desiredstock = ".((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? (float) $this->desiredstock : "null"); |
1585 | 1585 | $sql .= ", cost_price = ".($this->cost_price != '' ? $this->db->escape($this->cost_price) : 'null'); |
@@ -1609,9 +1609,9 @@ discard block |
||
1609 | 1609 | |
1610 | 1610 | // update accountancy for this entity |
1611 | 1611 | if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
1612 | - $this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity)); |
|
1612 | + $this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); |
|
1613 | 1613 | |
1614 | - $sql = "INSERT INTO " . $this->db->prefix() . "product_perentity ("; |
|
1614 | + $sql = "INSERT INTO ".$this->db->prefix()."product_perentity ("; |
|
1615 | 1615 | $sql .= " fk_product"; |
1616 | 1616 | $sql .= ", entity"; |
1617 | 1617 | $sql .= ", accountancy_code_buy"; |
@@ -1622,13 +1622,13 @@ discard block |
||
1622 | 1622 | $sql .= ", accountancy_code_sell_export"; |
1623 | 1623 | $sql .= ") VALUES ("; |
1624 | 1624 | $sql .= ((int) $this->id); |
1625 | - $sql .= ", " . ((int) $conf->entity); |
|
1626 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1627 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
1628 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
1629 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1630 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
1631 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
1625 | + $sql .= ", ".((int) $conf->entity); |
|
1626 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1627 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
1628 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
1629 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1630 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
1631 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
1632 | 1632 | $sql .= ")"; |
1633 | 1633 | $result = $this->db->query($sql); |
1634 | 1634 | if (!$result) { |
@@ -1706,7 +1706,7 @@ discard block |
||
1706 | 1706 | $error++; |
1707 | 1707 | } else { |
1708 | 1708 | // to keep old entries with the new dir |
1709 | - require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php'; |
|
1709 | + require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; |
|
1710 | 1710 | $ecmfiles = new EcmFiles($this->db); |
1711 | 1711 | $ecmfiles->updateAfterRename("produit/".dol_sanitizeFileName($this->oldcopy->ref), "produit/".dol_sanitizeFileName($this->ref)); |
1712 | 1712 | } |
@@ -2004,7 +2004,7 @@ discard block |
||
2004 | 2004 | } |
2005 | 2005 | } elseif (isset($this->multilangs[$key])) { |
2006 | 2006 | if (empty($this->multilangs[$key]["label"])) { |
2007 | - $this->errors[] = $key . ' : ' . $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")); |
|
2007 | + $this->errors[] = $key.' : '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")); |
|
2008 | 2008 | return -1; |
2009 | 2009 | } |
2010 | 2010 | |
@@ -2201,7 +2201,7 @@ discard block |
||
2201 | 2201 | */ |
2202 | 2202 | private function getArrayForPriceCompare($level = 0) |
2203 | 2203 | { |
2204 | - $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly'); |
|
2204 | + $testExit = array('multiprices', 'multiprices_ttc', 'multiprices_base_type', 'multiprices_min', 'multiprices_min_ttc', 'multiprices_tva_tx', 'multiprices_recuperableonly'); |
|
2205 | 2205 | |
2206 | 2206 | foreach ($testExit as $field) { |
2207 | 2207 | if (!isset($this->$field)) { |
@@ -2891,12 +2891,12 @@ discard block |
||
2891 | 2891 | |
2892 | 2892 | // For MultiCompany |
2893 | 2893 | // PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity |
2894 | - $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
2895 | - $separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses. |
|
2894 | + $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
2895 | + $separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses. |
|
2896 | 2896 | $visibleWarehousesEntities = $conf->entity; |
2897 | 2897 | if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) { |
2898 | 2898 | if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) { |
2899 | - $checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); |
|
2899 | + $checkPMPPerEntity = $this->db->query("SELECT pmp FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); |
|
2900 | 2900 | if ($this->db->num_rows($checkPMPPerEntity) > 0) { |
2901 | 2901 | $separatedEntityPMP = true; |
2902 | 2902 | } |
@@ -2904,7 +2904,7 @@ discard block |
||
2904 | 2904 | global $mc; |
2905 | 2905 | $separatedStock = true; |
2906 | 2906 | if (isset($mc->sharings['stock']) && !empty($mc->sharings['stock'])) { |
2907 | - $visibleWarehousesEntities .= "," . implode(",", $mc->sharings['stock']); |
|
2907 | + $visibleWarehousesEntities .= ",".implode(",", $mc->sharings['stock']); |
|
2908 | 2908 | } |
2909 | 2909 | } |
2910 | 2910 | if ($separatedEntityPMP) { |
@@ -2922,10 +2922,10 @@ discard block |
||
2922 | 2922 | } |
2923 | 2923 | $sql .= " FROM ".$this->db->prefix()."product as p"; |
2924 | 2924 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') || $separatedEntityPMP) { |
2925 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
2925 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
2926 | 2926 | } |
2927 | 2927 | if ($separatedStock) { |
2928 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))"; |
|
2928 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))"; |
|
2929 | 2929 | } |
2930 | 2930 | |
2931 | 2931 | if ($id) { |
@@ -3087,15 +3087,15 @@ discard block |
||
3087 | 3087 | $sql .= " WHERE entity IN (".getEntity('productprice').")"; |
3088 | 3088 | $sql .= " AND price_level=".((int) $i); |
3089 | 3089 | $sql .= " AND fk_product = ".((int) $this->id); |
3090 | - $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
3091 | - $sql .= " LIMIT 1"; // Only the first one |
|
3090 | + $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
3091 | + $sql .= " LIMIT 1"; // Only the first one |
|
3092 | 3092 | $resql = $this->db->query($sql); |
3093 | 3093 | if ($resql) { |
3094 | 3094 | $result = $this->db->fetch_array($resql); |
3095 | 3095 | |
3096 | 3096 | $this->multiprices[$i] = $result ? $result["price"] : null; |
3097 | 3097 | $this->multiprices_ttc[$i] = $result ? $result["price_ttc"] : null; |
3098 | - $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
3098 | + $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
3099 | 3099 | $this->multiprices_min_ttc[$i] = $result ? $result["price_min_ttc"] : null; |
3100 | 3100 | $this->multiprices_base_type[$i] = $result ? $result["price_base_type"] : null; |
3101 | 3101 | // Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on |
@@ -3320,7 +3320,7 @@ discard block |
||
3320 | 3320 | $obj = $this->db->fetch_object($result); |
3321 | 3321 | $this->stats_mo['customers_'.$role] = $obj->nb_customers ? $obj->nb_customers : 0; |
3322 | 3322 | $this->stats_mo['nb_'.$role] = $obj->nb ? $obj->nb : 0; |
3323 | - $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
3323 | + $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
3324 | 3324 | } else { |
3325 | 3325 | $this->error = $this->db->error(); |
3326 | 3326 | $error++; |
@@ -4823,7 +4823,7 @@ discard block |
||
4823 | 4823 | //Addition of a product with the highest rank +1 |
4824 | 4824 | $sql = "INSERT INTO ".$this->db->prefix()."product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)"; |
4825 | 4825 | $sql .= " VALUES (".((int) $id_pere).", ".((int) $id_fils).", ".price2num($qty, 'MS').", ".((int) $incdec).", ".((int) $rank).")"; |
4826 | - if (! $this->db->query($sql)) { |
|
4826 | + if (!$this->db->query($sql)) { |
|
4827 | 4827 | dol_print_error($this->db); |
4828 | 4828 | return -1; |
4829 | 4829 | } else { |
@@ -4944,7 +4944,7 @@ discard block |
||
4944 | 4944 | $sql = "UPDATE ".$this->db->prefix()."product_association"; |
4945 | 4945 | $sql .= " SET rang = ".((int) $cpt); |
4946 | 4946 | $sql .= " WHERE rowid = ".((int) $objrank->rowid); |
4947 | - if (! $this->db->query($sql)) { |
|
4947 | + if (!$this->db->query($sql)) { |
|
4948 | 4948 | dol_print_error($this->db); |
4949 | 4949 | return -1; |
4950 | 4950 | } |
@@ -5379,7 +5379,7 @@ discard block |
||
5379 | 5379 | if (isset($this->sousprods) && is_array($this->sousprods)) { |
5380 | 5380 | foreach ($this->sousprods as $prod_name => $desc_product) { |
5381 | 5381 | if (is_array($desc_product)) { |
5382 | - $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res |
|
5382 | + $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res |
|
5383 | 5383 | } |
5384 | 5384 | } |
5385 | 5385 | } |
@@ -5536,7 +5536,7 @@ discard block |
||
5536 | 5536 | $sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens |
5537 | 5537 | $sql .= " ORDER BY pa.rang"; |
5538 | 5538 | |
5539 | - dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG); |
|
5539 | + dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level.' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG); |
|
5540 | 5540 | |
5541 | 5541 | if ($level == 1) { |
5542 | 5542 | $alreadyfound = array($id => 1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediately |
@@ -5601,7 +5601,7 @@ discard block |
||
5601 | 5601 | $parent[$this->label][$keyChild] = $valueChild; |
5602 | 5602 | } |
5603 | 5603 | foreach ($parent as $key => $value) { // key=label, value is array of children |
5604 | - $this->sousprods[$key] = $value; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
5604 | + $this->sousprods[$key] = $value; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
5605 | 5605 | } |
5606 | 5606 | } |
5607 | 5607 | |
@@ -5637,7 +5637,7 @@ discard block |
||
5637 | 5637 | if (!empty($this->entity) && $permissiontoreadproduct) { |
5638 | 5638 | $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80, 0, 0, 0, 0, '1'); |
5639 | 5639 | if ($this->nbphoto > 0) { |
5640 | - $datas['photo'] = '<div class="photointooltip floatright">'."\n" . $tmpphoto . '</div>'; |
|
5640 | + $datas['photo'] = '<div class="photointooltip floatright">'."\n".$tmpphoto.'</div>'; |
|
5641 | 5641 | } |
5642 | 5642 | } |
5643 | 5643 | |
@@ -5647,7 +5647,7 @@ discard block |
||
5647 | 5647 | $datas['picto'] = img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>'; |
5648 | 5648 | } |
5649 | 5649 | if (isset($this->status) && isset($this->status_buy)) { |
5650 | - $datas['status'] = ' '.$this->getLibStatut(5, 0) . ' '.$this->getLibStatut(5, 1); |
|
5650 | + $datas['status'] = ' '.$this->getLibStatut(5, 0).' '.$this->getLibStatut(5, 1); |
|
5651 | 5651 | } |
5652 | 5652 | |
5653 | 5653 | if (!empty($this->ref)) { |
@@ -5697,7 +5697,7 @@ discard block |
||
5697 | 5697 | $labelsurfacevolume .= ($labelsurfacevolume ? " - " : "")."<b>".$langs->trans("Volume").'</b>: '.$this->volume.' '.measuringUnitString(0, 'volume', $this->volume_units); |
5698 | 5698 | } |
5699 | 5699 | if ($labelsurfacevolume) { |
5700 | - $datas['surface'] = "<br>" . $labelsurfacevolume; |
|
5700 | + $datas['surface'] = "<br>".$labelsurfacevolume; |
|
5701 | 5701 | } |
5702 | 5702 | } |
5703 | 5703 | if ($this->isService() && !empty($this->duration_value)) { |
@@ -5739,9 +5739,9 @@ discard block |
||
5739 | 5739 | } |
5740 | 5740 | // show categories for this record only in ajax to not overload lists |
5741 | 5741 | if (isModEnabled('category') && !$nofetch) { |
5742 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
5742 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
5743 | 5743 | $form = new Form($this->db); |
5744 | - $datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); |
|
5744 | + $datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); |
|
5745 | 5745 | } |
5746 | 5746 | } |
5747 | 5747 | |
@@ -6265,7 +6265,7 @@ discard block |
||
6265 | 6265 | if (isModEnabled("supplier_order")) { |
6266 | 6266 | $filterStatus = getDolGlobalString('SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK', '3,4'); |
6267 | 6267 | if (isset($includedraftpoforvirtual)) { |
6268 | - $filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them |
|
6268 | + $filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them |
|
6269 | 6269 | } |
6270 | 6270 | $result = $this->load_stats_commande_fournisseur(0, $filterStatus, 1, $dateofvirtualstock); |
6271 | 6271 | if ($result < 0) { |
@@ -6306,7 +6306,7 @@ discard block |
||
6306 | 6306 | } elseif (getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER')) { |
6307 | 6307 | if (getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER_INCLUDE_DRAFT')) { // By default, draft means "does not exist", so we do not include them by default, except if option is on |
6308 | 6308 | $tmpnewprod = dol_clone($this, 1); |
6309 | - $result = $tmpnewprod->load_stats_commande(0, '0', 1); // Get qty in draft orders |
|
6309 | + $result = $tmpnewprod->load_stats_commande(0, '0', 1); // Get qty in draft orders |
|
6310 | 6310 | $this->stock_theorique += $tmpnewprod->stats_commande['qty']; |
6311 | 6311 | } |
6312 | 6312 | } elseif (getDolGlobalString('STOCK_CALCULATE_ON_BILL') && $weBillOrderOrShipmentReception == 'order') { |
@@ -6323,7 +6323,7 @@ discard block |
||
6323 | 6323 | } elseif (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER')) { // Warning: stock change "on approval", not on validation ! |
6324 | 6324 | if (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER_INCLUDE_DRAFT')) { // By default, draft means "does not exist", so we do not include them by default, except if option is on |
6325 | 6325 | $tmpnewprod = dol_clone($this, 1); |
6326 | - $result = $tmpnewprod->load_stats_commande_fournisseur(0, '0', 1); // Get qty in draft orders |
|
6326 | + $result = $tmpnewprod->load_stats_commande_fournisseur(0, '0', 1); // Get qty in draft orders |
|
6327 | 6327 | $this->stock_theorique += $this->stats_commande_fournisseur['qty']; |
6328 | 6328 | } |
6329 | 6329 | $this->stock_theorique -= $stock_reception_fournisseur; |
@@ -6700,7 +6700,7 @@ discard block |
||
6700 | 6700 | if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) { |
6701 | 6701 | $dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']); |
6702 | 6702 | foreach ($dirsociete as $dirroot) { |
6703 | - $res = dol_include_once($dirroot . getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php'); |
|
6703 | + $res = dol_include_once($dirroot.getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php'); |
|
6704 | 6704 | if ($res) { |
6705 | 6705 | break; |
6706 | 6706 | } |
@@ -98,9 +98,9 @@ discard block |
||
98 | 98 | } else { |
99 | 99 | $permissiontocreate = isModEnabled('website') && $user->hasRight('website', 'write') || isModEnabled('webportal') && $user->hasRight('webportal', 'write'); |
100 | 100 | } |
101 | -$permissionnote = $permissiontocreate; // Used by the include of actions_setnotes.inc.php |
|
102 | -$permissiondellink = $permissiontocreate; // Used by the include of actions_dellink.inc.php |
|
103 | -$permissiontoadd = $permissiontocreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
101 | +$permissionnote = $permissiontocreate; // Used by the include of actions_setnotes.inc.php |
|
102 | +$permissiondellink = $permissiontocreate; // Used by the include of actions_dellink.inc.php |
|
103 | +$permissiontoadd = $permissiontocreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
104 | 104 | |
105 | 105 | // check access from type of site on create, edit, delete (other than view) |
106 | 106 | $site_type_js = ''; |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | print '<table class="border centpercent tableforfield">'."\n"; |
384 | 384 | |
385 | 385 | // Common attributes |
386 | - $keyforbreak='note_private'; // We change column just before this field |
|
386 | + $keyforbreak = 'note_private'; // We change column just before this field |
|
387 | 387 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
388 | 388 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
389 | 389 | include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $backtopage = GETPOST('backtopage', 'alpha'); |
118 | 118 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
119 | 119 | $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); |
120 | -$confirm = GETPOST('confirm', 'alpha'); |
|
120 | +$confirm = GETPOST('confirm', 'alpha'); |
|
121 | 121 | |
122 | 122 | $dol_openinpopup = ''; |
123 | 123 | if (!empty($backtopagejsfields)) { |
@@ -168,12 +168,12 @@ discard block |
||
168 | 168 | } |
169 | 169 | |
170 | 170 | // Permissions |
171 | -$permissiontoread = $user->hasRight('societe', 'lire'); |
|
172 | -$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
171 | +$permissiontoread = $user->hasRight('societe', 'lire'); |
|
172 | +$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
173 | 173 | $permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0); |
174 | -$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php |
|
174 | +$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php |
|
175 | 175 | $permissiondellink = $user->hasRight('societe', 'creer'); // Used by the include of actions_dellink.inc.php |
176 | -$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; |
|
176 | +$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; |
|
177 | 177 | |
178 | 178 | // Security check |
179 | 179 | $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0); |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | |
218 | 218 | if ($action == 'confirm_merge' && $confirm == 'yes' && $permissiontoadd) { |
219 | 219 | $soc_origin_id = GETPOSTINT('soc_origin'); |
220 | - $soc_origin = new Societe($db); // The thirdparty that we will delete |
|
220 | + $soc_origin = new Societe($db); // The thirdparty that we will delete |
|
221 | 221 | |
222 | 222 | if ($soc_origin_id <= 0) { |
223 | 223 | $langs->load('errors'); |
@@ -333,19 +333,19 @@ discard block |
||
333 | 333 | $object->name = dolGetFirstLastname(GETPOST('firstname', 'alphanohtml'), GETPOST('name', 'alphanohtml')); |
334 | 334 | $object->civility_id = GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int |
335 | 335 | // Add non official properties |
336 | - $object->name_bis = GETPOST('name', 'alphanohtml'); |
|
337 | - $object->firstname = GETPOST('firstname', 'alphanohtml'); |
|
336 | + $object->name_bis = GETPOST('name', 'alphanohtml'); |
|
337 | + $object->firstname = GETPOST('firstname', 'alphanohtml'); |
|
338 | 338 | } else { |
339 | - $object->name = GETPOST('name', 'alphanohtml'); |
|
339 | + $object->name = GETPOST('name', 'alphanohtml'); |
|
340 | 340 | } |
341 | 341 | $object->entity = ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity); |
342 | - $object->name_alias = GETPOST('name_alias', 'alphanohtml'); |
|
342 | + $object->name_alias = GETPOST('name_alias', 'alphanohtml'); |
|
343 | 343 | $object->parent = GETPOSTISSET('parent_company_id') ? GETPOSTINT('parent_company_id') : $object->parent; |
344 | 344 | $object->address = GETPOST('address', 'alphanohtml'); |
345 | - $object->zip = GETPOST('zipcode', 'alphanohtml'); |
|
346 | - $object->town = GETPOST('town', 'alphanohtml'); |
|
347 | - $object->country_id = GETPOSTINT('country_id'); |
|
348 | - $object->state_id = GETPOSTINT('state_id'); |
|
345 | + $object->zip = GETPOST('zipcode', 'alphanohtml'); |
|
346 | + $object->town = GETPOST('town', 'alphanohtml'); |
|
347 | + $object->country_id = GETPOSTINT('country_id'); |
|
348 | + $object->state_id = GETPOSTINT('state_id'); |
|
349 | 349 | |
350 | 350 | $object->socialnetworks = array(); |
351 | 351 | if (isModEnabled('socialnetworks')) { |
@@ -357,10 +357,10 @@ discard block |
||
357 | 357 | } |
358 | 358 | |
359 | 359 | $object->phone = GETPOST('phone', 'alpha'); |
360 | - $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
360 | + $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
361 | 361 | $object->fax = GETPOST('fax', 'alpha'); |
362 | 362 | $object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); |
363 | - $object->no_email = GETPOSTINT("no_email"); |
|
363 | + $object->no_email = GETPOSTINT("no_email"); |
|
364 | 364 | $object->url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL)); |
365 | 365 | $object->idprof1 = trim(GETPOST('idprof1', 'alphanohtml')); |
366 | 366 | $object->idprof2 = trim(GETPOST('idprof2', 'alphanohtml')); |
@@ -370,13 +370,13 @@ discard block |
||
370 | 370 | $object->idprof6 = trim(GETPOST('idprof6', 'alphanohtml')); |
371 | 371 | $object->prefix_comm = GETPOST('prefix_comm', 'alphanohtml'); |
372 | 372 | $object->code_client = GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha'); |
373 | - $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); |
|
373 | + $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); |
|
374 | 374 | $object->capital = GETPOSTFLOAT('capital'); |
375 | 375 | $object->barcode = GETPOST('barcode', 'alphanohtml'); |
376 | 376 | |
377 | 377 | $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); |
378 | 378 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
379 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
379 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
380 | 380 | $object->status = GETPOSTINT('status'); |
381 | 381 | |
382 | 382 | // Local Taxes |
@@ -386,9 +386,9 @@ discard block |
||
386 | 386 | $object->localtax1_value = GETPOST('lt1', 'alpha'); |
387 | 387 | $object->localtax2_value = GETPOST('lt2', 'alpha'); |
388 | 388 | |
389 | - $object->forme_juridique_code = GETPOSTINT('forme_juridique_code'); |
|
389 | + $object->forme_juridique_code = GETPOSTINT('forme_juridique_code'); |
|
390 | 390 | $object->effectif_id = GETPOSTINT('effectif_id'); |
391 | - $object->typent_id = GETPOSTINT('typent_id'); |
|
391 | + $object->typent_id = GETPOSTINT('typent_id'); |
|
392 | 392 | |
393 | 393 | $object->typent_code = dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type |
394 | 394 | |
@@ -397,8 +397,8 @@ discard block |
||
397 | 397 | $prospect = (GETPOSTINT('prospect') > 0 ? 2 : 0); |
398 | 398 | $prospectcustomer = $customer + $prospect; |
399 | 399 | |
400 | - $object->client = $prospectcustomer; |
|
401 | - $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); |
|
400 | + $object->client = $prospectcustomer; |
|
401 | + $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); |
|
402 | 402 | |
403 | 403 | if ($action == 'add') { |
404 | 404 | // for prospect, customer or supplier |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | } |
419 | 419 | |
420 | 420 | if ($object->fournisseur > 0) { |
421 | - $object->cond_reglement_supplier_id = $paymentTermId; |
|
421 | + $object->cond_reglement_supplier_id = $paymentTermId; |
|
422 | 422 | |
423 | 423 | $filterPaymentTypeIdArr = array(1, 2, 3); // allow payment type for supplier (filter is "DBIT" in "Form::select_types_paiements()" method) |
424 | 424 | if (!empty($form->cache_types_paiements[$paymentTypeId]) && isset($form->cache_types_paiements[$paymentTypeId]['type']) && in_array($form->cache_types_paiements[$paymentTypeId]['type'], $filterPaymentTypeIdArr)) { |
@@ -428,15 +428,15 @@ discard block |
||
428 | 428 | } |
429 | 429 | } |
430 | 430 | |
431 | - $object->commercial_id = GETPOSTINT('commercial_id'); |
|
432 | - $object->default_lang = GETPOST('default_lang'); |
|
431 | + $object->commercial_id = GETPOSTINT('commercial_id'); |
|
432 | + $object->default_lang = GETPOST('default_lang'); |
|
433 | 433 | |
434 | 434 | // Webservices url/key |
435 | 435 | $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); |
436 | 436 | $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); |
437 | 437 | |
438 | 438 | if (GETPOSTISSET('accountancy_code_sell')) { |
439 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
439 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
440 | 440 | |
441 | 441 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
442 | 442 | $object->accountancy_code_sell = ''; |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | } |
446 | 446 | } |
447 | 447 | if (GETPOSTISSET('accountancy_code_buy')) { |
448 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
448 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
449 | 449 | |
450 | 450 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
451 | 451 | $object->accountancy_code_buy = ''; |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | } else { |
917 | 917 | $db->commit(); |
918 | 918 | $db->close(); |
919 | - header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); |
|
919 | + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); |
|
920 | 920 | exit; |
921 | 921 | } |
922 | 922 | } else { |
@@ -1097,21 +1097,21 @@ discard block |
||
1097 | 1097 | } |
1098 | 1098 | |
1099 | 1099 | $object->phone = GETPOST('phone', 'alpha'); |
1100 | - $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
1100 | + $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
1101 | 1101 | $object->fax = GETPOST('fax', 'alpha'); |
1102 | 1102 | $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); |
1103 | 1103 | $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); |
1104 | - $object->capital = GETPOSTFLOAT('capital'); |
|
1104 | + $object->capital = GETPOSTFLOAT('capital'); |
|
1105 | 1105 | $paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables |
1106 | 1106 | if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) { |
1107 | 1107 | $paymentTermId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
1108 | 1108 | } |
1109 | - $object->cond_reglement_id = $paymentTermId; |
|
1109 | + $object->cond_reglement_id = $paymentTermId; |
|
1110 | 1110 | $paymentTypeId = GETPOSTINT('mode_reglement_id'); // can be set by default values on create page and not already in get or post variables |
1111 | 1111 | if (empty($paymentTypeId) && !GETPOSTISSET('mode_reglement_id')) { |
1112 | 1112 | $paymentTypeId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
1113 | 1113 | } |
1114 | - $object->mode_reglement_id = $paymentTypeId; |
|
1114 | + $object->mode_reglement_id = $paymentTypeId; |
|
1115 | 1115 | $object->barcode = GETPOST('barcode', 'alphanohtml'); |
1116 | 1116 | $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); |
1117 | 1117 | $object->idprof2 = GETPOST('idprof2', 'alphanohtml'); |
@@ -1124,7 +1124,7 @@ discard block |
||
1124 | 1124 | $object->civility_id = GETPOST('civility_id', 'alpha'); |
1125 | 1125 | |
1126 | 1126 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
1127 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
1127 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
1128 | 1128 | $object->status = GETPOSTINT('status'); |
1129 | 1129 | |
1130 | 1130 | //Local Taxes |
@@ -1140,7 +1140,7 @@ discard block |
||
1140 | 1140 | $object->default_lang = GETPOST('default_lang'); |
1141 | 1141 | |
1142 | 1142 | if (GETPOSTISSET('accountancy_code_sell')) { |
1143 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
1143 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
1144 | 1144 | |
1145 | 1145 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
1146 | 1146 | $object->accountancy_code_sell = ''; |
@@ -1149,7 +1149,7 @@ discard block |
||
1149 | 1149 | } |
1150 | 1150 | } |
1151 | 1151 | if (GETPOSTISSET('accountancy_code_buy')) { |
1152 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
1152 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
1153 | 1153 | |
1154 | 1154 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
1155 | 1155 | $object->accountancy_code_buy = ''; |
@@ -1274,7 +1274,7 @@ discard block |
||
1274 | 1274 | |
1275 | 1275 | print '<script type="text/javascript">'; |
1276 | 1276 | print '$(document).ready(function () { |
1277 | - var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1') . '; |
|
1277 | + var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1').'; |
|
1278 | 1278 | |
1279 | 1279 | init_customer_categ(); |
1280 | 1280 | $("#customerprospect").change(function() { |
@@ -1347,7 +1347,7 @@ discard block |
||
1347 | 1347 | print '</td><td'.(getDolGlobalString('SOCIETE_USEPREFIX') ? '' : ' colspan="3"').'>'; |
1348 | 1348 | |
1349 | 1349 | print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus">'; |
1350 | - print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages |
|
1350 | + print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages |
|
1351 | 1351 | // This implementation of the feature to search already existing company has been disabled. It must be implemented by keeping the "input text" and we must call the search ajax societe/ajax/ajaxcompanies.php |
1352 | 1352 | // on a keydown of the input. We should show data about a duplicate found if we found less than 5 answers into a div under the input. |
1353 | 1353 | /* |
@@ -1717,7 +1717,7 @@ discard block |
||
1717 | 1717 | print '<td></td>'; |
1718 | 1718 | print '<td></td>'; |
1719 | 1719 | } |
1720 | - print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>'; |
|
1720 | + print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>'; |
|
1721 | 1721 | print '<td class="individualline" '.(($conf->browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($object->no_email) ? 0 : 1)), 1, false, 1).'</td>'; |
1722 | 1722 | print '</tr>'; |
1723 | 1723 | } |
@@ -1765,7 +1765,7 @@ discard block |
||
1765 | 1765 | // Vat is used |
1766 | 1766 | print '<tr><td><label for="assujtva_value">'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</label></td>'; |
1767 | 1767 | print '<td>'; |
1768 | - print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . (GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"') . ' value="1">'; // Assujeti par default en creation |
|
1768 | + print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.(GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"').' value="1">'; // Assujeti par default en creation |
|
1769 | 1769 | print '</td>'; |
1770 | 1770 | if ($conf->browser->layout == 'phone') { |
1771 | 1771 | print '</tr><tr>'; |
@@ -1806,7 +1806,7 @@ discard block |
||
1806 | 1806 | |
1807 | 1807 | // VAT reverse charge by default |
1808 | 1808 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
1809 | - print '<tr><td><label for="vat_reverse_charge">' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</label></td><td colspan="3">'; |
|
1809 | + print '<tr><td><label for="vat_reverse_charge">'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</label></td><td colspan="3">'; |
|
1810 | 1810 | print '<input type="checkbox" name="vat_reverse_charge" id="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>'; |
1811 | 1811 | print '</td></tr>'; |
1812 | 1812 | } |
@@ -1815,21 +1815,21 @@ discard block |
||
1815 | 1815 | //TODO: Place into a function to control showing by country or study better option |
1816 | 1816 | if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { |
1817 | 1817 | print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>'; |
1818 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">'; |
|
1818 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">'; |
|
1819 | 1819 | print '</td>'; |
1820 | 1820 | if ($conf->browser->layout == 'phone') { |
1821 | 1821 | print '</tr><tr>'; |
1822 | 1822 | } |
1823 | 1823 | print '<td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>'; |
1824 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">'; |
|
1824 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">'; |
|
1825 | 1825 | print '</td></tr>'; |
1826 | 1826 | } elseif ($mysoc->localtax1_assuj == "1") { |
1827 | 1827 | print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td colspan="3">'; |
1828 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">'; |
|
1828 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">'; |
|
1829 | 1829 | print '</td></tr>'; |
1830 | 1830 | } elseif ($mysoc->localtax2_assuj == "1") { |
1831 | 1831 | print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td colspan="3">'; |
1832 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">'; |
|
1832 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">'; |
|
1833 | 1833 | print '</td></tr>'; |
1834 | 1834 | } |
1835 | 1835 | |
@@ -2097,10 +2097,10 @@ discard block |
||
2097 | 2097 | } |
2098 | 2098 | |
2099 | 2099 | $object->phone = GETPOST('phone', 'alpha'); |
2100 | - $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); |
|
2100 | + $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); |
|
2101 | 2101 | $object->fax = GETPOST('fax', 'alpha'); |
2102 | 2102 | $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); |
2103 | - $object->no_email = GETPOSTINT("no_email"); |
|
2103 | + $object->no_email = GETPOSTINT("no_email"); |
|
2104 | 2104 | $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); |
2105 | 2105 | $object->capital = GETPOSTFLOAT('capital'); |
2106 | 2106 | $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); |
@@ -2116,16 +2116,16 @@ discard block |
||
2116 | 2116 | $object->default_lang = GETPOST('default_lang', 'alpha'); |
2117 | 2117 | |
2118 | 2118 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
2119 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
2119 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
2120 | 2120 | $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); |
2121 | - $object->status = GETPOSTINT('status'); |
|
2121 | + $object->status = GETPOSTINT('status'); |
|
2122 | 2122 | |
2123 | 2123 | // Webservices url/key |
2124 | 2124 | $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); |
2125 | 2125 | $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); |
2126 | 2126 | |
2127 | 2127 | if (GETPOSTISSET('accountancy_code_sell')) { |
2128 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
2128 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
2129 | 2129 | |
2130 | 2130 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
2131 | 2131 | $object->accountancy_code_sell = ''; |
@@ -2134,7 +2134,7 @@ discard block |
||
2134 | 2134 | } |
2135 | 2135 | } |
2136 | 2136 | if (GETPOSTISSET('accountancy_code_buy')) { |
2137 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
2137 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
2138 | 2138 | |
2139 | 2139 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
2140 | 2140 | $object->accountancy_code_buy = ''; |
@@ -2216,7 +2216,7 @@ discard block |
||
2216 | 2216 | } |
2217 | 2217 | }); |
2218 | 2218 | |
2219 | - var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . '; |
|
2219 | + var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0').'; |
|
2220 | 2220 | |
2221 | 2221 | init_customer_categ(); |
2222 | 2222 | $("#customerprospect").change(function() { |
@@ -2589,14 +2589,14 @@ discard block |
||
2589 | 2589 | |
2590 | 2590 | // VAT is used |
2591 | 2591 | print '<tr><td>'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</td><td colspan="3">'; |
2592 | - print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . ($object->tva_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
2592 | + print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.($object->tva_assuj ? 'checked="checked"' : '').' value="1">'; |
|
2593 | 2593 | print '</td></tr>'; |
2594 | 2594 | |
2595 | 2595 | // Local Taxes |
2596 | 2596 | //TODO: Place into a function to control showing by country or study better option |
2597 | 2597 | if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { |
2598 | 2598 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td>'; |
2599 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
2599 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">'; |
|
2600 | 2600 | if (!isOnlyOneLocalTax(1)) { |
2601 | 2601 | print '<span class="cblt1"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
2602 | 2602 | $formcompany->select_localtax(1, $object->localtax1_value, "lt1"); |
@@ -2605,7 +2605,7 @@ discard block |
||
2605 | 2605 | print '</td>'; |
2606 | 2606 | print '</tr><tr>'; |
2607 | 2607 | print '<td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td>'; |
2608 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1"></td></tr>'; |
|
2608 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1"></td></tr>'; |
|
2609 | 2609 | if (!isOnlyOneLocalTax(2)) { |
2610 | 2610 | print '<span class="cblt2"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
2611 | 2611 | $formcompany->select_localtax(2, $object->localtax2_value, "lt2"); |
@@ -2614,7 +2614,7 @@ discard block |
||
2614 | 2614 | print '</td></tr>'; |
2615 | 2615 | } elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") { |
2616 | 2616 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td colspan="3">'; |
2617 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
2617 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">'; |
|
2618 | 2618 | if (!isOnlyOneLocalTax(1)) { |
2619 | 2619 | print '<span class="cblt1"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
2620 | 2620 | $formcompany->select_localtax(1, $object->localtax1_value, "lt1"); |
@@ -2623,7 +2623,7 @@ discard block |
||
2623 | 2623 | print '</td></tr>'; |
2624 | 2624 | } elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") { |
2625 | 2625 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td colspan="3">'; |
2626 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
2626 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1">'; |
|
2627 | 2627 | if (!isOnlyOneLocalTax(2)) { |
2628 | 2628 | print '<span class="cblt2"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
2629 | 2629 | $formcompany->select_localtax(2, $object->localtax2_value, "lt2"); |
@@ -2634,7 +2634,7 @@ discard block |
||
2634 | 2634 | |
2635 | 2635 | // VAT reverse charge by default |
2636 | 2636 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
2637 | - print '<tr><td>' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</td><td colspan="3">'; |
|
2637 | + print '<tr><td>'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</td><td colspan="3">'; |
|
2638 | 2638 | print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>'; |
2639 | 2639 | print '</td></tr>'; |
2640 | 2640 | } |
@@ -2803,7 +2803,7 @@ discard block |
||
2803 | 2803 | $maxfilesizearray = getMaxFileSizeArray(); |
2804 | 2804 | $maxmin = $maxfilesizearray['maxmin']; |
2805 | 2805 | if ($maxmin > 0) { |
2806 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
2806 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
2807 | 2807 | } |
2808 | 2808 | print '<input type="file" class="flat" name="photo" id="photoinput">'; |
2809 | 2809 | print '</td></tr>'; |
@@ -3035,7 +3035,7 @@ discard block |
||
3035 | 3035 | print '<tr><td>'; |
3036 | 3036 | print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc')); |
3037 | 3037 | print '</td><td>'; |
3038 | - print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>'; |
|
3038 | + print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>'; |
|
3039 | 3039 | print '</td>'; |
3040 | 3040 | print '</tr>'; |
3041 | 3041 | } |