@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | if ($object->dao->close($user)) { |
171 | 171 | setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs'); |
172 | 172 | |
173 | - $url = 'view.php?action=view_ticket&track_id='.GETPOST('track_id', 'alpha').(!empty($entity) && !empty($conf->multicompany->enabled)?'&entity='.$entity:''); |
|
173 | + $url = 'view.php?action=view_ticket&track_id='.GETPOST('track_id', 'alpha').(!empty($entity) && !empty($conf->multicompany->enabled) ? '&entity='.$entity : ''); |
|
174 | 174 | header("Location: ".$url); |
175 | 175 | exit; |
176 | 176 | } else { |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | if ($display_ticket) { |
235 | 235 | // Confirmation close |
236 | 236 | if ($action == 'close') { |
237 | - print $form->formconfirm($_SERVER["PHP_SELF"]."?track_id=".$track_id.(!empty($entity) && !empty($conf->multicompany->enabled)?'&entity='.$entity:''), $langs->trans("CloseATicket"), $langs->trans("ConfirmCloseAticket"), "confirm_public_close", '', '', 1); |
|
237 | + print $form->formconfirm($_SERVER["PHP_SELF"]."?track_id=".$track_id.(!empty($entity) && !empty($conf->multicompany->enabled) ? '&entity='.$entity : ''), $langs->trans("CloseATicket"), $langs->trans("ConfirmCloseAticket"), "confirm_public_close", '', '', 1); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | print '<div id="form_view_ticket" class="margintoponly">'; |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | $formticket->id = $object->dao->id; |
348 | 348 | |
349 | 349 | $formticket->param = array('track_id' => $object->dao->track_id, 'fk_user_create' => '-1', |
350 | - 'returnurl' => DOL_URL_ROOT.'/public/ticket/view.php'.(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:'')); |
|
350 | + 'returnurl' => DOL_URL_ROOT.'/public/ticket/view.php'.(!empty($entity) && !empty($conf->multicompany->enabled) ? '?entity='.$entity : '')); |
|
351 | 351 | |
352 | 352 | $formticket->withfile = 2; |
353 | 353 | $formticket->withcancel = 1; |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | } |
357 | 357 | |
358 | 358 | if ($action != 'presend') { |
359 | - print '<form method="post" id="form_view_ticket_list" name="form_view_ticket_list" action="'.DOL_URL_ROOT.'/public/ticket/list.php'.(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:'').'">'; |
|
359 | + print '<form method="post" id="form_view_ticket_list" name="form_view_ticket_list" action="'.DOL_URL_ROOT.'/public/ticket/list.php'.(!empty($entity) && !empty($conf->multicompany->enabled) ? '?entity='.$entity : '').'">'; |
|
360 | 360 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
361 | 361 | print '<input type="hidden" name="action" value="view_ticketlist">'; |
362 | 362 | print '<input type="hidden" name="track_id" value="'.$object->dao->track_id.'">'; |
@@ -371,11 +371,11 @@ discard block |
||
371 | 371 | |
372 | 372 | if ($object->dao->fk_statut < Ticket::STATUS_CLOSED) { |
373 | 373 | // New message |
374 | - print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=presend&mode=init&track_id='.$object->dao->track_id.(!empty($entity) && !empty($conf->multicompany->enabled)?'&entity='.$entity:'').'">'.$langs->trans('AddMessage').'</a></div>'; |
|
374 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=presend&mode=init&track_id='.$object->dao->track_id.(!empty($entity) && !empty($conf->multicompany->enabled) ? '&entity='.$entity : '').'">'.$langs->trans('AddMessage').'</a></div>'; |
|
375 | 375 | |
376 | 376 | // Close ticket |
377 | 377 | if ($object->dao->fk_statut >= Ticket::STATUS_NOT_READ && $object->dao->fk_statut < Ticket::STATUS_CLOSED) { |
378 | - print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=close&track_id='.$object->dao->track_id.(!empty($entity) && !empty($conf->multicompany->enabled)?'&entity='.$entity:'').'">'.$langs->trans('CloseTicket').'</a></div>'; |
|
378 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=close&track_id='.$object->dao->track_id.(!empty($entity) && !empty($conf->multicompany->enabled) ? '&entity='.$entity : '').'">'.$langs->trans('CloseTicket').'</a></div>'; |
|
379 | 379 | } |
380 | 380 | } |
381 | 381 | |
@@ -386,13 +386,13 @@ discard block |
||
386 | 386 | print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'conversation'); |
387 | 387 | $object->viewTicketMessages(false, true, $object->dao); |
388 | 388 | } else { |
389 | - print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?track_id='.$object->dao->track_id.(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:'').'" rel="nofollow noopener">'.$langs->trans('Back').'</a></div>'; |
|
389 | + print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?track_id='.$object->dao->track_id.(!empty($entity) && !empty($conf->multicompany->enabled) ? '?entity='.$entity : '').'" rel="nofollow noopener">'.$langs->trans('Back').'</a></div>'; |
|
390 | 390 | } |
391 | 391 | } else { |
392 | 392 | print '<div class="center opacitymedium margintoponly marginbottomonly">'.$langs->trans("TicketPublicMsgViewLogIn").'</div>'; |
393 | 393 | |
394 | 394 | print '<div id="form_view_ticket">'; |
395 | - print '<form method="post" name="form_view_ticket" action="'.$_SERVER['PHP_SELF'].(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:'').'">'; |
|
395 | + print '<form method="post" name="form_view_ticket" action="'.$_SERVER['PHP_SELF'].(!empty($entity) && !empty($conf->multicompany->enabled) ? '?entity='.$entity : '').'">'; |
|
396 | 396 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
397 | 397 | print '<input type="hidden" name="action" value="view_ticket">'; |
398 | 398 |
@@ -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') : '')); |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | $langs->loadLangs(array("mrp", "other")); |
39 | 39 | |
40 | 40 | // Get parameters |
41 | -$id = GETPOST('id', 'int'); |
|
41 | +$id = GETPOST('id', 'int'); |
|
42 | 42 | $ref = GETPOST('ref', 'alpha'); |
43 | -$action = GETPOST('action', 'aZ09'); |
|
43 | +$action = GETPOST('action', 'aZ09'); |
|
44 | 44 | $cancel = GETPOST('cancel', 'aZ09'); |
45 | 45 | $backtopage = GETPOST('backtopage', 'alpha'); |
46 | 46 | |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | } |
55 | 55 | $search_agenda_label = GETPOST('search_agenda_label'); |
56 | 56 | |
57 | -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; |
|
57 | +$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; |
|
58 | 58 | $sortfield = GETPOST('sortfield', 'aZ09comma'); |
59 | 59 | $sortorder = GETPOST('sortorder', 'aZ09comma'); |
60 | -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); |
|
60 | +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); |
|
61 | 61 | if (empty($page) || $page == -1) { |
62 | 62 | $page = 0; |
63 | 63 | } // If $page is not defined, or '' or -1 |
@@ -52,7 +52,7 @@ |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | // Get parameters |
55 | -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; |
|
55 | +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; |
|
56 | 56 | $sortfield = GETPOST('sortfield', 'aZ09comma'); |
57 | 57 | $sortorder = GETPOST('sortorder', 'aZ09comma'); |
58 | 58 | $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); |
@@ -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) { |
@@ -158,20 +158,20 @@ discard block |
||
158 | 158 | $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; |
159 | 159 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; |
160 | 160 | if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { |
161 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); |
|
161 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); |
|
162 | 162 | } |
163 | 163 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays "; |
164 | 164 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn_det as l ON f.rowid = l.fk_facture_fourn"; |
165 | 165 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product"; |
166 | 166 | if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { |
167 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
167 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
168 | 168 | } |
169 | 169 | $alias_societe_perentity = empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED) ? "s" : "spe"; |
170 | 170 | $alias_product_perentity = empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? "p" : "ppe"; |
171 | - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON " . $alias_product_perentity . ".accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity; |
|
172 | - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_buy_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity; |
|
173 | - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_buy_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity; |
|
174 | - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; |
|
171 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON ".$alias_product_perentity.".accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity; |
|
172 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON ".$alias_product_perentity.".accountancy_code_buy_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity; |
|
173 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON ".$alias_product_perentity.".accountancy_code_buy_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity; |
|
174 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON ".$alias_societe_perentity.".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; |
|
175 | 175 | $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0 AND l.product_type <= 2 AND f.entity = ".((int) $conf->entity); |
176 | 176 | if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) { |
177 | 177 | $sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'"; |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $thirdpartystatic->email = $objp->email; |
212 | 212 | $thirdpartystatic->country_code = $objp->country_code; |
213 | 213 | $thirdpartystatic->tva_intra = $objp->tva_intra; |
214 | - $thirdpartystatic->code_compta_product = $objp->company_code_buy; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
214 | + $thirdpartystatic->code_compta_product = $objp->company_code_buy; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
215 | 215 | |
216 | 216 | $product_static->ref = $objp->product_ref; |
217 | 217 | $product_static->id = $objp->product_id; |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $suggestedid = 0; |
252 | 252 | |
253 | 253 | $return = $accountingAccount->getAccountingCodeToBind($mysoc, $thirdpartystatic, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'supplier'); |
254 | - if (!is_array($return) && $return<0) { |
|
254 | + if (!is_array($return) && $return < 0) { |
|
255 | 255 | setEventMessage($accountingAccount->error, 'errors'); |
256 | 256 | } else { |
257 | 257 | $suggestedid = $return['suggestedid']; |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $db->rollback(); |
293 | 293 | } else { |
294 | 294 | $db->commit(); |
295 | - setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone, $notpossible), null, 'mesgs'); |
|
295 | + setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone, $notpossible), null, 'mesgs'); |
|
296 | 296 | } |
297 | 297 | } |
298 | 298 |
@@ -153,27 +153,27 @@ discard block |
||
153 | 153 | $sql .= " co.code as country_code, co.label as country_label,"; |
154 | 154 | $sql .= " s.tva_intra,"; |
155 | 155 | if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { |
156 | - $sql .= " spe.accountancy_code_sell as company_code_sell"; // accounting code for product but stored on thirdparty |
|
156 | + $sql .= " spe.accountancy_code_sell as company_code_sell"; // accounting code for product but stored on thirdparty |
|
157 | 157 | } else { |
158 | - $sql .= " s.accountancy_code_sell as company_code_sell"; // accounting code for product but stored on thirdparty |
|
158 | + $sql .= " s.accountancy_code_sell as company_code_sell"; // accounting code for product but stored on thirdparty |
|
159 | 159 | } |
160 | 160 | $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; |
161 | 161 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; |
162 | 162 | if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { |
163 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); |
|
163 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); |
|
164 | 164 | } |
165 | 165 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays "; |
166 | - $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facturedet as l ON f.rowid = l.fk_facture"; // the main table |
|
166 | + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facturedet as l ON f.rowid = l.fk_facture"; // the main table |
|
167 | 167 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product"; |
168 | 168 | if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { |
169 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
169 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
170 | 170 | } |
171 | 171 | $alias_societe_perentity = empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED) ? "s" : "spe"; |
172 | 172 | $alias_product_perentity = empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? "p" : "ppe"; |
173 | - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON " . $alias_product_perentity . ".accountancy_code_sell = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity; |
|
174 | - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_sell_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity; |
|
175 | - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity; |
|
176 | - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_sell = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; |
|
173 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON ".$alias_product_perentity.".accountancy_code_sell = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity; |
|
174 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON ".$alias_product_perentity.".accountancy_code_sell_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity; |
|
175 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON ".$alias_product_perentity.".accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity; |
|
176 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON ".$alias_societe_perentity.".accountancy_code_sell = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; |
|
177 | 177 | $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0 AND l.product_type <= 2 AND f.entity = ".((int) $conf->entity); |
178 | 178 | if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) { |
179 | 179 | $sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'"; |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $thirdpartystatic->email = $objp->email; |
216 | 216 | $thirdpartystatic->country_code = $objp->country_code; |
217 | 217 | $thirdpartystatic->tva_intra = $objp->tva_intra; |
218 | - $thirdpartystatic->code_compta_product = $objp->company_code_sell; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
218 | + $thirdpartystatic->code_compta_product = $objp->company_code_sell; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
219 | 219 | |
220 | 220 | $product_static->ref = $objp->product_ref; |
221 | 221 | $product_static->id = $objp->product_id; |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | |
255 | 255 | $suggestedid = 0; |
256 | 256 | |
257 | - $return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'customer'); |
|
257 | + $return = $accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'customer'); |
|
258 | 258 | if (!is_array($return) && $return < 0) { |
259 | 259 | setEventMessage($accountingAccount->error, 'errors'); |
260 | 260 | } else { |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | $db->rollback(); |
297 | 297 | } else { |
298 | 298 | $db->commit(); |
299 | - setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone, $notpossible), null, 'mesgs'); |
|
299 | + setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone, $notpossible), null, 'mesgs'); |
|
300 | 300 | } |
301 | 301 | } |
302 | 302 |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $search_date_endday = GETPOST('search_date_endday', 'int'); |
58 | 58 | $search_date_endmonth = GETPOST('search_date_endmonth', 'int'); |
59 | 59 | $search_date_endyear = GETPOST('search_date_endyear', 'int'); |
60 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
60 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
61 | 61 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
62 | 62 | $search_date_limit_startday = GETPOST('search_date_limit_startday', 'int'); |
63 | 63 | $search_date_limit_startmonth = GETPOST('search_date_limit_startmonth', 'int'); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $search_project_ref = GETPOST('search_project_ref', 'alpha'); |
71 | 71 | $search_users = GETPOST('search_users'); |
72 | 72 | $search_type = GETPOST('search_type', 'int'); |
73 | -$search_account = GETPOST('search_account', 'int'); |
|
73 | +$search_account = GETPOST('search_account', 'int'); |
|
74 | 74 | |
75 | 75 | $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; |
76 | 76 | $sortfield = GETPOST('sortfield', 'aZ09comma'); |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | require_once '../main.inc.php'; |
37 | 37 | require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; |
38 | 38 | require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
39 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; |
|
40 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
41 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; |
|
42 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; |
|
43 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm.lib.php'; |
|
39 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php'; |
|
40 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
41 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/evaluation.class.php'; |
|
42 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php'; |
|
43 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm.lib.php'; |
|
44 | 44 | |
45 | 45 | $permissiontoread = $user->rights->hrm->evaluation->read || $user->rights->hrm->compare_advance->read; |
46 | 46 | $permissiontoadd = 0; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | </tr> |
139 | 139 | <tr> |
140 | 140 | <td><?php |
141 | - echo $langs->trans('OrJobToCompare') . '</td><td>'; |
|
141 | + echo $langs->trans('OrJobToCompare').'</td><td>'; |
|
142 | 142 | $j = new Job($db); |
143 | 143 | $jobs = $j->fetchAll(); |
144 | 144 | $TJobs = array(); |
@@ -221,8 +221,8 @@ discard block |
||
221 | 221 | $job->fetch($fk_job); |
222 | 222 | $userlist2 = '<ul> |
223 | 223 | <li> |
224 | - <h3>' . $job->label . '</h3> |
|
225 | - <p>' . $job->description . '</p> |
|
224 | + <h3>' . $job->label.'</h3> |
|
225 | + <p>' . $job->description.'</p> |
|
226 | 226 | </li> |
227 | 227 | </ul>'; |
228 | 228 | } else { |
@@ -236,10 +236,10 @@ discard block |
||
236 | 236 | |
237 | 237 | echo '</td>'; |
238 | 238 | |
239 | - echo '<td id="" style="width:20%" valign="top">' . skillList($TMergedSkills) . '</td>'; |
|
240 | - echo '<td id="" style="width:5%" valign="top">' . rate($TMergedSkills, 'rate1') . '</td>'; |
|
241 | - echo '<td id="" style="width:10%" valign="top">' . diff($TMergedSkills) . '</td>'; |
|
242 | - echo '<td id="" style="width:5%" valign="top">' . rate($TMergedSkills, 'rate2') . '</td>'; |
|
239 | + echo '<td id="" style="width:20%" valign="top">'.skillList($TMergedSkills).'</td>'; |
|
240 | + echo '<td id="" style="width:5%" valign="top">'.rate($TMergedSkills, 'rate1').'</td>'; |
|
241 | + echo '<td id="" style="width:10%" valign="top">'.diff($TMergedSkills).'</td>'; |
|
242 | + echo '<td id="" style="width:5%" valign="top">'.rate($TMergedSkills, 'rate2').'</td>'; |
|
243 | 243 | |
244 | 244 | echo '<td id="list-user-right" style="width:30%" valign="top">'; |
245 | 245 | |
@@ -288,8 +288,8 @@ discard block |
||
288 | 288 | elseif ($sk->rate2 < $sk->rate1) $class .= ' veryhappy'; |
289 | 289 | elseif ($sk->rate2 > $sk->rate1) $class .= ' sad'; |
290 | 290 | |
291 | - $out .= '<li fk_skill="' . $id . '" class="' . $class . '" style="text-align:center;"> |
|
292 | - <span class="' . $class . '"> </span> |
|
291 | + $out .= '<li fk_skill="'.$id.'" class="'.$class.'" style="text-align:center;"> |
|
292 | + <span class="' . $class.'"> </span> |
|
293 | 293 | </li>'; |
294 | 294 | } |
295 | 295 | |
@@ -324,8 +324,8 @@ discard block |
||
324 | 324 | if ($field === 'rate2' && $fk_job > 0) $trad = $langs->trans('RequiredRank'); |
325 | 325 | else $trad = $langs->trans('HighestRank'); |
326 | 326 | |
327 | - $out .= '<li fk_skill="' . $id . '" style="text-align:center;"> |
|
328 | - <p><span class="' . $class . ' classfortooltip" title="' . $trad . '">' . $note . '</span>' . ($how_many > 0 ? '<span class="bubble classfortooltip" title="' . $langs->trans('HowManyUserWithThisMaxNote') . '">' . $how_many . '</span>' : '') . '</p> |
|
327 | + $out .= '<li fk_skill="'.$id.'" style="text-align:center;"> |
|
328 | + <p><span class="' . $class.' classfortooltip" title="'.$trad.'">'.$note.'</span>'.($how_many > 0 ? '<span class="bubble classfortooltip" title="'.$langs->trans('HowManyUserWithThisMaxNote').'">'.$how_many.'</span>' : '').'</p> |
|
329 | 329 | </li>'; |
330 | 330 | } |
331 | 331 | |
@@ -346,9 +346,9 @@ discard block |
||
346 | 346 | $out = '<ul class="competence">'; |
347 | 347 | |
348 | 348 | foreach ($TMergedSkills as $id => &$sk) { |
349 | - $out .= '<li fk_skill="' . $id . '"> |
|
350 | - <h3>' . $sk->label . '</h3> |
|
351 | - <p>' . $sk->description . '</p> |
|
349 | + $out .= '<li fk_skill="'.$id.'"> |
|
350 | + <h3>' . $sk->label.'</h3> |
|
351 | + <p>' . $sk->description.'</p> |
|
352 | 352 | </li>'; |
353 | 353 | } |
354 | 354 | |
@@ -402,18 +402,18 @@ discard block |
||
402 | 402 | |
403 | 403 | $out = ''; |
404 | 404 | if ($fk_usergroup > 0) { |
405 | - $list = $namelist . '_excluded_id'; |
|
405 | + $list = $namelist.'_excluded_id'; |
|
406 | 406 | |
407 | 407 | $excludedIdsList = GETPOST($list); |
408 | 408 | |
409 | 409 | |
410 | - $sql = "SELECT DISTINCT u.rowid FROM " . MAIN_DB_PREFIX . "user u |
|
411 | - LEFT JOIN " . MAIN_DB_PREFIX . "usergroup_user as ugu ON (u.rowid = ugu.fk_user) |
|
410 | + $sql = "SELECT DISTINCT u.rowid FROM ".MAIN_DB_PREFIX."user u |
|
411 | + LEFT JOIN " . MAIN_DB_PREFIX."usergroup_user as ugu ON (u.rowid = ugu.fk_user) |
|
412 | 412 | WHERE u.statut > 0 |
413 | 413 | AND ugu.fk_usergroup=" . ((int) $fk_usergroup); |
414 | 414 | |
415 | 415 | $res = $db->query($sql); |
416 | - $out .= '<ul name="' . $namelist . '">'; |
|
416 | + $out .= '<ul name="'.$namelist.'">'; |
|
417 | 417 | |
418 | 418 | $TExcludedId = explode(',', $excludedIdsList); |
419 | 419 | |
@@ -445,17 +445,17 @@ discard block |
||
445 | 445 | $evaluation = $static_eval->getLastEvaluationForUser($user->id); |
446 | 446 | |
447 | 447 | if (!empty($evaluation) && !empty($evaluation->date_eval)) { |
448 | - $desc .= $langs->trans('DateLastEval') . ' : ' . dol_print_date($evaluation->date_eval); |
|
448 | + $desc .= $langs->trans('DateLastEval').' : '.dol_print_date($evaluation->date_eval); |
|
449 | 449 | } else { |
450 | 450 | $desc .= $langs->trans('NoEval'); |
451 | 451 | } |
452 | 452 | |
453 | - if (!empty($user->array_options['options_DDA'])) $desc .= '<br>' . $langs->trans('Anciennete') . ' : ' . dol_print_date(strtotime($user->array_options['options_DDA'])); |
|
453 | + if (!empty($user->array_options['options_DDA'])) $desc .= '<br>'.$langs->trans('Anciennete').' : '.dol_print_date(strtotime($user->array_options['options_DDA'])); |
|
454 | 454 | |
455 | - $out .= '<li fk_user="' . $user->id . '" class="' . $class . '"> |
|
456 | - ' . $form->showphoto('userphoto', $user, 0, 0, 0, 'photoref', 'small', 1, 0, 1) . ' |
|
457 | - <h3>' . $name . '</h3> |
|
458 | - <p>' . $desc . '</p> |
|
455 | + $out .= '<li fk_user="'.$user->id.'" class="'.$class.'"> |
|
456 | + ' . $form->showphoto('userphoto', $user, 0, 0, 0, 'photoref', 'small', 1, 0, 1).' |
|
457 | + <h3>' . $name.'</h3> |
|
458 | + <p>' . $desc.'</p> |
|
459 | 459 | </li>'; |
460 | 460 | } |
461 | 461 | |
@@ -481,12 +481,12 @@ discard block |
||
481 | 481 | if (empty($TUser)) return array(); |
482 | 482 | |
483 | 483 | $sql = 'SELECT sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill, '; |
484 | - $sql.= ' MAX(sr.rankorder) as "rankorder"'; |
|
485 | - $sql.= ' FROM '.MAIN_DB_PREFIX.'hrm_skill sk'; |
|
486 | - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'hrm_skillrank sr ON (sk.rowid = sr.fk_skill)'; |
|
487 | - $sql.= " WHERE sr.objecttype = '".SkillRank::SKILLRANK_TYPE_USER."'"; |
|
488 | - $sql.= ' AND sr.fk_object IN ('.$db->sanitize(implode(',', $TUser)).')'; |
|
489 | - $sql.= " GROUP BY sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill "; // group par competence |
|
484 | + $sql .= ' MAX(sr.rankorder) as "rankorder"'; |
|
485 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'hrm_skill sk'; |
|
486 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'hrm_skillrank sr ON (sk.rowid = sr.fk_skill)'; |
|
487 | + $sql .= " WHERE sr.objecttype = '".SkillRank::SKILLRANK_TYPE_USER."'"; |
|
488 | + $sql .= ' AND sr.fk_object IN ('.$db->sanitize(implode(',', $TUser)).')'; |
|
489 | + $sql .= " GROUP BY sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill "; // group par competence |
|
490 | 490 | |
491 | 491 | $resql = $db->query($sql); |
492 | 492 | $Tab = array(); |
@@ -494,12 +494,12 @@ discard block |
||
494 | 494 | if ($resql) { |
495 | 495 | //For each skill, we count the number of times that the max score has been reached within a given group |
496 | 496 | $num = 0; |
497 | - while ($obj = $db->fetch_object($resql) ) { |
|
497 | + while ($obj = $db->fetch_object($resql)) { |
|
498 | 498 | $sql1 = "SELECT count(*) as how_many_max FROM ".MAIN_DB_PREFIX."hrm_skillrank sr"; |
499 | - $sql1.=" WHERE sr.rankorder = ".((int) $obj->rankorder); |
|
500 | - $sql1.=" AND sr.objecttype = '".Skillrank::SKILLRANK_TYPE_USER."'"; |
|
501 | - $sql1.=" AND sr.fk_skill = ".((int) $obj->fk_skill); |
|
502 | - $sql1.=" AND sr.fk_object IN (".$db->sanitize(implode(',', $TUser)).")"; |
|
499 | + $sql1 .= " WHERE sr.rankorder = ".((int) $obj->rankorder); |
|
500 | + $sql1 .= " AND sr.objecttype = '".Skillrank::SKILLRANK_TYPE_USER."'"; |
|
501 | + $sql1 .= " AND sr.fk_skill = ".((int) $obj->fk_skill); |
|
502 | + $sql1 .= " AND sr.fk_object IN (".$db->sanitize(implode(',', $TUser)).")"; |
|
503 | 503 | $resql1 = $db->query($sql1); |
504 | 504 | |
505 | 505 | $objMax = $db->fetch_object($resql1); |
@@ -536,12 +536,12 @@ discard block |
||
536 | 536 | if (empty($fk_job)) return array(); |
537 | 537 | |
538 | 538 | $sql = 'SELECT sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill, '; |
539 | - $sql.= ' MAX(sr.rankorder) as "rankorder"'; |
|
540 | - $sql.=' FROM '.MAIN_DB_PREFIX.'hrm_skill sk'; |
|
541 | - $sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'hrm_skillrank sr ON (sk.rowid = sr.fk_skill)'; |
|
542 | - $sql.=" WHERE sr.objecttype = '".SkillRank::SKILLRANK_TYPE_JOB."'"; |
|
543 | - $sql.=' AND sr.fk_object = '.((int) $fk_job); |
|
544 | - $sql.=' GROUP BY sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill '; // group par competence*/ |
|
539 | + $sql .= ' MAX(sr.rankorder) as "rankorder"'; |
|
540 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'hrm_skill sk'; |
|
541 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'hrm_skillrank sr ON (sk.rowid = sr.fk_skill)'; |
|
542 | + $sql .= " WHERE sr.objecttype = '".SkillRank::SKILLRANK_TYPE_JOB."'"; |
|
543 | + $sql .= ' AND sr.fk_object = '.((int) $fk_job); |
|
544 | + $sql .= ' GROUP BY sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill '; // group par competence*/ |
|
545 | 545 | |
546 | 546 | $resql = $db->query($sql); |
547 | 547 | $Tab = array(); |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | |
550 | 550 | if ($resql) { |
551 | 551 | $num = 0; |
552 | - while ($obj = $db->fetch_object($resql) ) { |
|
552 | + while ($obj = $db->fetch_object($resql)) { |
|
553 | 553 | $Tab[$num] = new stdClass(); |
554 | 554 | $Tab[$num]->fk_skill = $obj->fk_skill; |
555 | 555 | $Tab[$num]->label = $obj->label; |