@@ -164,14 +164,14 @@ discard block |
||
164 | 164 | } else { |
165 | 165 | // Else it's separated key/value and coma list |
166 | 166 | foreach ($parameters_array as $param_ligne) { |
167 | - if (strpos($param_ligne, ',')!==false) { |
|
167 | + if (strpos($param_ligne, ',') !== false) { |
|
168 | 168 | list($key, $value) = explode(',', $param_ligne); |
169 | 169 | if (!array_key_exists('options', $params)) { |
170 | 170 | $params['options'] = array(); |
171 | 171 | } |
172 | 172 | } else { |
173 | - $key=$param_ligne; |
|
174 | - $value=null; |
|
173 | + $key = $param_ligne; |
|
174 | + $value = null; |
|
175 | 175 | } |
176 | 176 | $params['options'][$key] = $value; |
177 | 177 | } |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | $resql = $db->query($sql); |
449 | 449 | if ($resql) { |
450 | 450 | $num_rows = $db->num_rows($resql); |
451 | - $i=0; |
|
451 | + $i = 0; |
|
452 | 452 | while ($i < $num_rows) { |
453 | 453 | $objtmp = $db->fetch_object($resql); |
454 | 454 | $id = $objtmp->rowid; |
@@ -256,12 +256,12 @@ discard block |
||
256 | 256 | 'p.tobatch'=>array('label'=>"ManageLotSerial", 'checked'=>0, 'enabled'=>(isModEnabled('productbatch')), 'position'=>60), |
257 | 257 | 'p.fk_country'=>array('label'=>"Country", 'checked'=>0, 'position'=>100), |
258 | 258 | 'p.fk_state'=>array('label'=>"State", 'checked'=>0, 'position'=>101), |
259 | - $alias_product_perentity . '.accountancy_code_sell'=>array('label'=>"ProductAccountancySellCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>400), |
|
260 | - $alias_product_perentity . '.accountancy_code_sell_intra'=>array('label'=>"ProductAccountancySellIntraCode", 'checked'=>0, 'enabled'=>$isInEEC && empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>401), |
|
261 | - $alias_product_perentity . '.accountancy_code_sell_export'=>array('label'=>"ProductAccountancySellExportCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>402), |
|
262 | - $alias_product_perentity . '.accountancy_code_buy'=>array('label'=>"ProductAccountancyBuyCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>403), |
|
263 | - $alias_product_perentity . '.accountancy_code_buy_intra'=>array('label'=>"ProductAccountancyBuyIntraCode", 'checked'=>0, 'enabled'=>$isInEEC && empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>404), |
|
264 | - $alias_product_perentity . '.accountancy_code_buy_export'=>array('label'=>"ProductAccountancyBuyExportCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>405), |
|
259 | + $alias_product_perentity.'.accountancy_code_sell'=>array('label'=>"ProductAccountancySellCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>400), |
|
260 | + $alias_product_perentity.'.accountancy_code_sell_intra'=>array('label'=>"ProductAccountancySellIntraCode", 'checked'=>0, 'enabled'=>$isInEEC && empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>401), |
|
261 | + $alias_product_perentity.'.accountancy_code_sell_export'=>array('label'=>"ProductAccountancySellExportCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>402), |
|
262 | + $alias_product_perentity.'.accountancy_code_buy'=>array('label'=>"ProductAccountancyBuyCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>403), |
|
263 | + $alias_product_perentity.'.accountancy_code_buy_intra'=>array('label'=>"ProductAccountancyBuyIntraCode", 'checked'=>0, 'enabled'=>$isInEEC && empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>404), |
|
264 | + $alias_product_perentity.'.accountancy_code_buy_export'=>array('label'=>"ProductAccountancyBuyExportCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>405), |
|
265 | 265 | 'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), |
266 | 266 | 'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), |
267 | 267 | 'p.tosell'=>array('label'=>$langs->transnoentitiesnoconv("Status").' ('.$langs->transnoentitiesnoconv("Sell").')', 'checked'=>1, 'position'=>1000), |
@@ -468,10 +468,10 @@ discard block |
||
468 | 468 | |
469 | 469 | $sql .= ' FROM '.MAIN_DB_PREFIX.'product as p'; |
470 | 470 | if (isModEnabled('workstation')) { |
471 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "workstation_workstation as ws ON (p.fk_default_workstation = ws.rowid)"; |
|
471 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."workstation_workstation as ws ON (p.fk_default_workstation = ws.rowid)"; |
|
472 | 472 | } |
473 | 473 | if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { |
474 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
474 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
475 | 475 | } |
476 | 476 | if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { |
477 | 477 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields as ef on (p.rowid = ef.fk_object)"; |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | if ($searchCategoryProductOperator == 0) { |
562 | 562 | $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; |
563 | 563 | } else { |
564 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); |
|
564 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProduct); |
|
565 | 565 | } |
566 | 566 | } |
567 | 567 | } |
@@ -591,22 +591,22 @@ discard block |
||
591 | 591 | $sql .= " AND p.finished = ".((int) $search_finished); |
592 | 592 | } |
593 | 593 | if ($search_accountancy_code_sell) { |
594 | - $sql .= natural_search($alias_product_perentity . '.accountancy_code_sell', clean_account($search_accountancy_code_sell)); |
|
594 | + $sql .= natural_search($alias_product_perentity.'.accountancy_code_sell', clean_account($search_accountancy_code_sell)); |
|
595 | 595 | } |
596 | 596 | if ($search_accountancy_code_sell_intra) { |
597 | - $sql .= natural_search($alias_product_perentity . '.accountancy_code_sell_intra', clean_account($search_accountancy_code_sell_intra)); |
|
597 | + $sql .= natural_search($alias_product_perentity.'.accountancy_code_sell_intra', clean_account($search_accountancy_code_sell_intra)); |
|
598 | 598 | } |
599 | 599 | if ($search_accountancy_code_sell_export) { |
600 | - $sql .= natural_search($alias_product_perentity . '.accountancy_code_sell_export', clean_account($search_accountancy_code_sell_export)); |
|
600 | + $sql .= natural_search($alias_product_perentity.'.accountancy_code_sell_export', clean_account($search_accountancy_code_sell_export)); |
|
601 | 601 | } |
602 | 602 | if ($search_accountancy_code_buy) { |
603 | - $sql .= natural_search($alias_product_perentity . '.accountancy_code_buy', clean_account($search_accountancy_code_buy)); |
|
603 | + $sql .= natural_search($alias_product_perentity.'.accountancy_code_buy', clean_account($search_accountancy_code_buy)); |
|
604 | 604 | } |
605 | 605 | if ($search_accountancy_code_buy_intra) { |
606 | - $sql .= natural_search($alias_product_perentity . '.accountancy_code_buy_intra', clean_account($search_accountancy_code_buy_intra)); |
|
606 | + $sql .= natural_search($alias_product_perentity.'.accountancy_code_buy_intra', clean_account($search_accountancy_code_buy_intra)); |
|
607 | 607 | } |
608 | 608 | if ($search_accountancy_code_buy_export) { |
609 | - $sql .= natural_search($alias_product_perentity . '.accountancy_code_buy_export', clean_account($search_accountancy_code_buy_export)); |
|
609 | + $sql .= natural_search($alias_product_perentity.'.accountancy_code_buy_export', clean_account($search_accountancy_code_buy_export)); |
|
610 | 610 | } |
611 | 611 | if (!empty($conf->global->PRODUCT_USE_UNITS) && $search_units) { |
612 | 612 | $sql .= natural_search('cu.rowid', $search_units); |
@@ -831,7 +831,7 @@ discard block |
||
831 | 831 | if (isModEnabled('category') && $user->hasRight($rightskey, 'creer')) { |
832 | 832 | $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); |
833 | 833 | } |
834 | -if (in_array($massaction, array('presend', 'predelete','preaffecttag', 'edit_extrafields', 'preupdateprice'))) { |
|
834 | +if (in_array($massaction, array('presend', 'predelete', 'preaffecttag', 'edit_extrafields', 'preupdateprice'))) { |
|
835 | 835 | $arrayofmassactions = array(); |
836 | 836 | } |
837 | 837 | $massactionbutton = $form->selectMassAction('', $arrayofmassactions); |
@@ -1181,23 +1181,23 @@ discard block |
||
1181 | 1181 | print '</td>'; |
1182 | 1182 | } |
1183 | 1183 | // Accountancy code sell |
1184 | -if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell']['checked'])) { |
|
1184 | +if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_sell']['checked'])) { |
|
1185 | 1185 | print '<td class="liste_titre"><input class="flat maxwidth75" type="text" name="search_accountancy_code_sell" value="'.dol_escape_htmltag($search_accountancy_code_sell).'"></td>'; |
1186 | 1186 | } |
1187 | -if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_intra']['checked'])) { |
|
1187 | +if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_sell_intra']['checked'])) { |
|
1188 | 1188 | print '<td class="liste_titre"><input class="flat maxwidth75" type="text" name="search_accountancy_code_sell_intra" value="'.dol_escape_htmltag($search_accountancy_code_sell_intra).'"></td>'; |
1189 | 1189 | } |
1190 | -if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_export']['checked'])) { |
|
1190 | +if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_sell_export']['checked'])) { |
|
1191 | 1191 | print '<td class="liste_titre"><input class="flat maxwidth75" type="text" name="search_accountancy_code_sell_export" value="'.dol_escape_htmltag($search_accountancy_code_sell_export).'"></td>'; |
1192 | 1192 | } |
1193 | 1193 | // Accountancy code buy |
1194 | -if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy']['checked'])) { |
|
1194 | +if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_buy']['checked'])) { |
|
1195 | 1195 | print '<td class="liste_titre"><input class="flat maxwidth75" type="text" name="search_accountancy_code_buy" value="'.dol_escape_htmltag($search_accountancy_code_buy).'"></td>'; |
1196 | 1196 | } |
1197 | -if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_intra']['checked'])) { |
|
1197 | +if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_buy_intra']['checked'])) { |
|
1198 | 1198 | print '<td class="liste_titre"><input class="flat maxwidth75" type="text" name="search_accountancy_code_buy_intra" value="'.dol_escape_htmltag($search_accountancy_code_buy_intra).'"></td>'; |
1199 | 1199 | } |
1200 | -if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_export']['checked'])) { |
|
1200 | +if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_buy_export']['checked'])) { |
|
1201 | 1201 | print '<td class="liste_titre"><input class="flat maxwidth75" type="text" name="search_accountancy_code_buy_export" value="'.dol_escape_htmltag($search_accountancy_code_buy_export).'"></td>'; |
1202 | 1202 | } |
1203 | 1203 | // Extra fields |
@@ -1405,28 +1405,28 @@ discard block |
||
1405 | 1405 | print_liste_field_titre($arrayfields['p.fk_state']['label'], $_SERVER["PHP_SELF"], "p.fk_state", "", $param, '', $sortfield, $sortorder); |
1406 | 1406 | $totalarray['nbfield']++; |
1407 | 1407 | } |
1408 | -if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell']['checked'])) { |
|
1409 | - print_liste_field_titre($arrayfields[$alias_product_perentity . '.accountancy_code_sell']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity . ".accountancy_code_sell", "", $param, '', $sortfield, $sortorder); |
|
1408 | +if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_sell']['checked'])) { |
|
1409 | + print_liste_field_titre($arrayfields[$alias_product_perentity.'.accountancy_code_sell']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity.".accountancy_code_sell", "", $param, '', $sortfield, $sortorder); |
|
1410 | 1410 | $totalarray['nbfield']++; |
1411 | 1411 | } |
1412 | -if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_intra']['checked'])) { |
|
1413 | - print_liste_field_titre($arrayfields[$alias_product_perentity . '.accountancy_code_sell_intra']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity . ".accountancy_code_sell_intra", "", $param, '', $sortfield, $sortorder); |
|
1412 | +if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_sell_intra']['checked'])) { |
|
1413 | + print_liste_field_titre($arrayfields[$alias_product_perentity.'.accountancy_code_sell_intra']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity.".accountancy_code_sell_intra", "", $param, '', $sortfield, $sortorder); |
|
1414 | 1414 | $totalarray['nbfield']++; |
1415 | 1415 | } |
1416 | -if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_export']['checked'])) { |
|
1417 | - print_liste_field_titre($arrayfields[$alias_product_perentity . '.accountancy_code_sell_export']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity . ".accountancy_code_sell_export", "", $param, '', $sortfield, $sortorder); |
|
1416 | +if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_sell_export']['checked'])) { |
|
1417 | + print_liste_field_titre($arrayfields[$alias_product_perentity.'.accountancy_code_sell_export']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity.".accountancy_code_sell_export", "", $param, '', $sortfield, $sortorder); |
|
1418 | 1418 | $totalarray['nbfield']++; |
1419 | 1419 | } |
1420 | -if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy']['checked'])) { |
|
1421 | - print_liste_field_titre($arrayfields[$alias_product_perentity . '.accountancy_code_buy']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity . ".accountancy_code_buy", "", $param, '', $sortfield, $sortorder); |
|
1420 | +if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_buy']['checked'])) { |
|
1421 | + print_liste_field_titre($arrayfields[$alias_product_perentity.'.accountancy_code_buy']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity.".accountancy_code_buy", "", $param, '', $sortfield, $sortorder); |
|
1422 | 1422 | $totalarray['nbfield']++; |
1423 | 1423 | } |
1424 | -if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_intra']['checked'])) { |
|
1425 | - print_liste_field_titre($arrayfields[$alias_product_perentity . '.accountancy_code_buy_intra']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity . ".accountancy_code_buy_intra", "", $param, '', $sortfield, $sortorder); |
|
1424 | +if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_buy_intra']['checked'])) { |
|
1425 | + print_liste_field_titre($arrayfields[$alias_product_perentity.'.accountancy_code_buy_intra']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity.".accountancy_code_buy_intra", "", $param, '', $sortfield, $sortorder); |
|
1426 | 1426 | $totalarray['nbfield']++; |
1427 | 1427 | } |
1428 | -if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_export']['checked'])) { |
|
1429 | - print_liste_field_titre($arrayfields[$alias_product_perentity . '.accountancy_code_buy_export']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity . ".accountancy_code_buy_export", "", $param, '', $sortfield, $sortorder); |
|
1428 | +if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_buy_export']['checked'])) { |
|
1429 | + print_liste_field_titre($arrayfields[$alias_product_perentity.'.accountancy_code_buy_export']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity.".accountancy_code_buy_export", "", $param, '', $sortfield, $sortorder); |
|
1430 | 1430 | $totalarray['nbfield']++; |
1431 | 1431 | } |
1432 | 1432 | // Extra fields |
@@ -1545,9 +1545,9 @@ discard block |
||
1545 | 1545 | |
1546 | 1546 | $object = $product_static; |
1547 | 1547 | |
1548 | - $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('product', 'product_advance', 'read_prices'):$user->hasRight('product', 'lire'); |
|
1548 | + $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('product', 'product_advance', 'read_prices') : $user->hasRight('product', 'lire'); |
|
1549 | 1549 | if ($product_static->isService()) { |
1550 | - $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'lire'); |
|
1550 | + $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('service', 'service_advance', 'read_prices') : $user->hasRight('service', 'lire'); |
|
1551 | 1551 | } |
1552 | 1552 | |
1553 | 1553 | if ($mode == 'kanban') { |
@@ -1628,7 +1628,7 @@ discard block |
||
1628 | 1628 | } |
1629 | 1629 | } |
1630 | 1630 | |
1631 | - print '<td class="center">' . $product_thumbnail_html . '</td>'; |
|
1631 | + print '<td class="center">'.$product_thumbnail_html.'</td>'; |
|
1632 | 1632 | if (!$i) { |
1633 | 1633 | $totalarray['nbfield']++; |
1634 | 1634 | } |
@@ -1697,7 +1697,7 @@ discard block |
||
1697 | 1697 | if (!empty($conf->cache['product'][$obj->fk_product_parent])) { |
1698 | 1698 | $product_parent_static = $conf->cache['product'][$obj->fk_product_parent]; |
1699 | 1699 | } else { |
1700 | - $product_parent_static= new Product($db); |
|
1700 | + $product_parent_static = new Product($db); |
|
1701 | 1701 | $product_parent_static->fetch($obj->fk_product_parent); |
1702 | 1702 | $conf->cache['product'][$obj->fk_product_parent] = $product_parent_static; |
1703 | 1703 | } |
@@ -1885,10 +1885,10 @@ discard block |
||
1885 | 1885 | |
1886 | 1886 | // Multiprices |
1887 | 1887 | if (!empty($conf->global->PRODUIT_MULTIPRICES)) { |
1888 | - if (! isset($productpricescache)) { |
|
1889 | - $productpricescache=array(); |
|
1888 | + if (!isset($productpricescache)) { |
|
1889 | + $productpricescache = array(); |
|
1890 | 1890 | } |
1891 | - if (! isset($productpricescache[$obj->rowid])) { |
|
1891 | + if (!isset($productpricescache[$obj->rowid])) { |
|
1892 | 1892 | $productpricescache[$obj->rowid] = array(); |
1893 | 1893 | } |
1894 | 1894 | |
@@ -2086,38 +2086,38 @@ discard block |
||
2086 | 2086 | } |
2087 | 2087 | } |
2088 | 2088 | // Accountancy code sell |
2089 | - if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell']['checked'])) { |
|
2089 | + if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_sell']['checked'])) { |
|
2090 | 2090 | print '<td>'.length_accountg($product_static->accountancy_code_sell).'</td>'; |
2091 | 2091 | if (!$i) { |
2092 | 2092 | $totalarray['nbfield']++; |
2093 | 2093 | } |
2094 | 2094 | } |
2095 | - if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_intra']['checked'])) { |
|
2095 | + if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_sell_intra']['checked'])) { |
|
2096 | 2096 | print '<td>'.length_accountg($product_static->accountancy_code_sell_intra).'</td>'; |
2097 | 2097 | if (!$i) { |
2098 | 2098 | $totalarray['nbfield']++; |
2099 | 2099 | } |
2100 | 2100 | } |
2101 | - if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_export']['checked'])) { |
|
2101 | + if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_sell_export']['checked'])) { |
|
2102 | 2102 | print '<td>'.length_accountg($product_static->accountancy_code_sell_export).'</td>'; |
2103 | 2103 | if (!$i) { |
2104 | 2104 | $totalarray['nbfield']++; |
2105 | 2105 | } |
2106 | 2106 | } |
2107 | 2107 | // Accountancy code buy |
2108 | - if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy']['checked'])) { |
|
2108 | + if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_buy']['checked'])) { |
|
2109 | 2109 | print '<td>'.length_accountg($product_static->accountancy_code_buy).'</td>'; |
2110 | 2110 | if (!$i) { |
2111 | 2111 | $totalarray['nbfield']++; |
2112 | 2112 | } |
2113 | 2113 | } |
2114 | - if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_intra']['checked'])) { |
|
2114 | + if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_buy_intra']['checked'])) { |
|
2115 | 2115 | print '<td>'.length_accountg($product_static->accountancy_code_buy_intra).'</td>'; |
2116 | 2116 | if (!$i) { |
2117 | 2117 | $totalarray['nbfield']++; |
2118 | 2118 | } |
2119 | 2119 | } |
2120 | - if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_export']['checked'])) { |
|
2120 | + if (!empty($arrayfields[$alias_product_perentity.'.accountancy_code_buy_export']['checked'])) { |
|
2121 | 2121 | print '<td>'.length_accountg($product_static->accountancy_code_buy_export).'</td>'; |
2122 | 2122 | if (!$i) { |
2123 | 2123 | $totalarray['nbfield']++; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | /** |
106 | 106 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
107 | 107 | */ |
108 | - public $fields=array( |
|
108 | + public $fields = array( |
|
109 | 109 | 'id_sondage' => array('type'=>'varchar(16)', 'label'=>'Idsondage', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>-1,), |
110 | 110 | 'commentaires' => array('type'=>'mediumtext', 'label'=>'Commentaires', 'enabled'=>'1', 'position'=>15, 'notnull'=>0, 'visible'=>-1,), |
111 | 111 | 'mail_admin' => array('type'=>'varchar(128)', 'label'=>'Mailadmin', 'enabled'=>'1', 'position'=>20, 'notnull'=>0, 'visible'=>-1,), |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | $label = $langs->trans("ShowMyObject"); |
528 | 528 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
529 | 529 | } |
530 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
530 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
531 | 531 | $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
532 | 532 | } else { |
533 | 533 | $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
@@ -79,18 +79,18 @@ discard block |
||
79 | 79 | |
80 | 80 | |
81 | 81 | $id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('orderid', 'int')); |
82 | -$ref = GETPOST('ref', 'alpha'); |
|
83 | -$socid = GETPOST('socid', 'int'); |
|
84 | -$action = GETPOST('action', 'aZ09'); |
|
85 | -$cancel = GETPOST('cancel', 'alpha'); |
|
86 | -$confirm = GETPOST('confirm', 'alpha'); |
|
82 | +$ref = GETPOST('ref', 'alpha'); |
|
83 | +$socid = GETPOST('socid', 'int'); |
|
84 | +$action = GETPOST('action', 'aZ09'); |
|
85 | +$cancel = GETPOST('cancel', 'alpha'); |
|
86 | +$confirm = GETPOST('confirm', 'alpha'); |
|
87 | 87 | $backtopage = GETPOST('backtopage', 'alpha'); |
88 | 88 | |
89 | -$lineid = GETPOST('lineid', 'int'); |
|
90 | -$contactid = GETPOST('contactid', 'int'); |
|
91 | -$projectid = GETPOST('projectid', 'int'); |
|
92 | -$origin = GETPOST('origin', 'alpha'); |
|
93 | -$originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility |
|
89 | +$lineid = GETPOST('lineid', 'int'); |
|
90 | +$contactid = GETPOST('contactid', 'int'); |
|
91 | +$projectid = GETPOST('projectid', 'int'); |
|
92 | +$origin = GETPOST('origin', 'alpha'); |
|
93 | +$originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility |
|
94 | 94 | $rank = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1; |
95 | 95 | |
96 | 96 | |
@@ -115,26 +115,26 @@ discard block |
||
115 | 115 | $extrafields->fetch_name_optionals_label($object->table_element); |
116 | 116 | |
117 | 117 | // Load object |
118 | -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once |
|
118 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once |
|
119 | 119 | |
120 | 120 | // Permissions / Rights |
121 | -$usercanread = $user->hasRight("commande", "lire"); |
|
122 | -$usercancreate = $user->hasRight("commande", "creer"); |
|
123 | -$usercandelete = $user->hasRight("commande", "supprimer"); |
|
121 | +$usercanread = $user->hasRight("commande", "lire"); |
|
122 | +$usercancreate = $user->hasRight("commande", "creer"); |
|
123 | +$usercandelete = $user->hasRight("commande", "supprimer"); |
|
124 | 124 | |
125 | 125 | // Advanced permissions |
126 | -$usercanclose = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'close'))); |
|
127 | -$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'validate'))); |
|
128 | -$usercancancel = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'annuler'))); |
|
129 | -$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('commande', 'order_advance', 'send')); |
|
130 | -$usercangeneretedoc = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('commande', 'order_advance', 'generetedoc')); |
|
126 | +$usercanclose = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'close'))); |
|
127 | +$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'validate'))); |
|
128 | +$usercancancel = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'annuler'))); |
|
129 | +$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('commande', 'order_advance', 'send')); |
|
130 | +$usercangeneretedoc = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('commande', 'order_advance', 'generetedoc')); |
|
131 | 131 | |
132 | 132 | $usermustrespectpricemin = ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)); |
133 | 133 | $usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer')); |
134 | 134 | |
135 | -$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php |
|
136 | -$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php |
|
137 | -$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
135 | +$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php |
|
136 | +$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php |
|
137 | +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
138 | 138 | |
139 | 139 | |
140 | 140 | $error = 0; |
@@ -177,11 +177,11 @@ discard block |
||
177 | 177 | $action = ''; |
178 | 178 | } |
179 | 179 | |
180 | - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once |
|
180 | + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once |
|
181 | 181 | |
182 | - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once |
|
182 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once |
|
183 | 183 | |
184 | - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once |
|
184 | + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once |
|
185 | 185 | |
186 | 186 | // Action clone object |
187 | 187 | if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) { |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | $pu_ht = ''; |
667 | 667 | $pu_ttc = ''; |
668 | 668 | $pu_ht_devise = ''; |
669 | - $pu_ttc_devise = ''; |
|
669 | + $pu_ttc_devise = ''; |
|
670 | 670 | |
671 | 671 | if (GETPOST('price_ht') !== '') { |
672 | 672 | $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); |
@@ -808,8 +808,8 @@ discard block |
||
808 | 808 | if (count($prodcustprice->lines) > 0) { |
809 | 809 | $pu_ht = price($prodcustprice->lines[0]->price); |
810 | 810 | $pu_ttc = price($prodcustprice->lines[0]->price_ttc); |
811 | - $price_min = price($prodcustprice->lines[0]->price_min); |
|
812 | - $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
811 | + $price_min = price($prodcustprice->lines[0]->price_min); |
|
812 | + $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
813 | 813 | $price_base_type = $prodcustprice->lines[0]->price_base_type; |
814 | 814 | $tva_tx = $prodcustprice->lines[0]->tva_tx; |
815 | 815 | if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) { |
@@ -908,8 +908,8 @@ discard block |
||
908 | 908 | } |
909 | 909 | |
910 | 910 | //If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time |
911 | - if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) { |
|
912 | - $product_desc=''; |
|
911 | + if ($product_desc == $desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) { |
|
912 | + $product_desc = ''; |
|
913 | 913 | } |
914 | 914 | |
915 | 915 | if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) { |
@@ -1305,7 +1305,7 @@ discard block |
||
1305 | 1305 | GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms) |
1306 | 1306 | && isModEnabled('facture') && !empty($user->rights->facture->creer) |
1307 | 1307 | ) { |
1308 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
1308 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
1309 | 1309 | |
1310 | 1310 | $date = dol_mktime(0, 0, 0, GETPOST('datefmonth', 'int'), GETPOST('datefday', 'int'), GETPOST('datefyear', 'int')); |
1311 | 1311 | $forceFields = array(); |
@@ -1318,7 +1318,7 @@ discard block |
||
1318 | 1318 | |
1319 | 1319 | if ($deposit) { |
1320 | 1320 | setEventMessage('DepositGenerated'); |
1321 | - $locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id; |
|
1321 | + $locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id; |
|
1322 | 1322 | } else { |
1323 | 1323 | $error++; |
1324 | 1324 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -1326,7 +1326,7 @@ discard block |
||
1326 | 1326 | } |
1327 | 1327 | |
1328 | 1328 | // Define output language |
1329 | - if (! $error) { |
|
1329 | + if (!$error) { |
|
1330 | 1330 | $db->commit(); |
1331 | 1331 | |
1332 | 1332 | if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { |
@@ -1354,7 +1354,7 @@ discard block |
||
1354 | 1354 | } |
1355 | 1355 | |
1356 | 1356 | if ($locationTarget) { |
1357 | - header('Location: ' . $locationTarget); |
|
1357 | + header('Location: '.$locationTarget); |
|
1358 | 1358 | exit; |
1359 | 1359 | } |
1360 | 1360 | } else { |
@@ -1547,7 +1547,7 @@ discard block |
||
1547 | 1547 | include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; |
1548 | 1548 | |
1549 | 1549 | // Actions to build doc |
1550 | - $upload_dir = !empty($conf->commande->multidir_output[$object->entity])?$conf->commande->multidir_output[$object->entity]:$conf->commande->dir_output; |
|
1550 | + $upload_dir = !empty($conf->commande->multidir_output[$object->entity]) ? $conf->commande->multidir_output[$object->entity] : $conf->commande->dir_output; |
|
1551 | 1551 | $permissiontoadd = $usercancreate; |
1552 | 1552 | include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; |
1553 | 1553 | |
@@ -1780,7 +1780,7 @@ discard block |
||
1780 | 1780 | print '<form name="crea_commande" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
1781 | 1781 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
1782 | 1782 | print '<input type="hidden" name="action" value="add">'; |
1783 | - print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
1783 | + print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
1784 | 1784 | print '<input type="hidden" name="remise_percent" value="'.$soc->remise_percent.'">'; |
1785 | 1785 | print '<input type="hidden" name="origin" value="'.$origin.'">'; |
1786 | 1786 | print '<input type="hidden" name="originid" value="'.$originid.'">'; |
@@ -1842,7 +1842,7 @@ discard block |
||
1842 | 1842 | // Contacts (ask contact only if thirdparty already defined). |
1843 | 1843 | print "<tr><td>".$langs->trans("DefaultContact").'</td><td>'; |
1844 | 1844 | print img_picto('', 'contact', 'class="pictofixedwidth"'); |
1845 | - print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, !empty($srccontactslist)?$srccontactslist:"", '', 1, 'maxwidth200 widthcentpercentminusx'); |
|
1845 | + print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, !empty($srccontactslist) ? $srccontactslist : "", '', 1, 'maxwidth200 widthcentpercentminusx'); |
|
1846 | 1846 | print '</td></tr>'; |
1847 | 1847 | |
1848 | 1848 | // Ligne info remises tiers |
@@ -1911,14 +1911,14 @@ discard block |
||
1911 | 1911 | require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; |
1912 | 1912 | $formproduct = new FormProduct($db); |
1913 | 1913 | print '<tr><td>'.$langs->trans('Warehouse').'</td><td>'; |
1914 | - print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses((GETPOSTISSET('warehouse_id')?GETPOST('warehouse_id'):$warehouse_id), 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx'); |
|
1914 | + print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses((GETPOSTISSET('warehouse_id') ?GETPOST('warehouse_id') : $warehouse_id), 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx'); |
|
1915 | 1915 | print '</td></tr>'; |
1916 | 1916 | } |
1917 | 1917 | |
1918 | 1918 | // Source / Channel - What trigger creation |
1919 | 1919 | print '<tr><td>'.$langs->trans('Channel').'</td><td>'; |
1920 | 1920 | print img_picto('', 'question', 'class="pictofixedwidth"'); |
1921 | - $form->selectInputReason((GETPOSTISSET('demand_reason_id')?GETPOST('demand_reason_id'):$demand_reason_id), 'demand_reason_id', '', 1, 'maxwidth200 widthcentpercentminusx'); |
|
1921 | + $form->selectInputReason((GETPOSTISSET('demand_reason_id') ?GETPOST('demand_reason_id') : $demand_reason_id), 'demand_reason_id', '', 1, 'maxwidth200 widthcentpercentminusx'); |
|
1922 | 1922 | print '</td></tr>'; |
1923 | 1923 | |
1924 | 1924 | // TODO How record was recorded OrderMode (llx_c_input_method) |
@@ -1928,7 +1928,7 @@ discard block |
||
1928 | 1928 | $langs->load("projects"); |
1929 | 1929 | print '<tr>'; |
1930 | 1930 | print '<td>'.$langs->trans("Project").'</td><td>'; |
1931 | - print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (GETPOSTISSET('projectid')?GETPOST('projectid'):$projectid), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); |
|
1931 | + print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (GETPOSTISSET('projectid') ?GETPOST('projectid') : $projectid), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); |
|
1932 | 1932 | print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>'; |
1933 | 1933 | print '</td>'; |
1934 | 1934 | print '</tr>'; |
@@ -1953,7 +1953,7 @@ discard block |
||
1953 | 1953 | // Other attributes |
1954 | 1954 | $parameters = array(); |
1955 | 1955 | if (!empty($origin) && !empty($originid) && is_object($objectsrc)) { |
1956 | - $parameters['objectsrc'] = $objectsrc; |
|
1956 | + $parameters['objectsrc'] = $objectsrc; |
|
1957 | 1957 | } |
1958 | 1958 | $parameters['socid'] = $socid; |
1959 | 1959 | |
@@ -1988,7 +1988,7 @@ discard block |
||
1988 | 1988 | print '<tr>'; |
1989 | 1989 | print '<td>'.$form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0).'</td>'; |
1990 | 1990 | print '<td class="maxwidthonsmartphone">'; |
1991 | - print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency((GETPOSTISSET('multicurrency_code')?GETPOST('multicurrency_code'):$currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx'); |
|
1991 | + print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ?GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx'); |
|
1992 | 1992 | print '</td></tr>'; |
1993 | 1993 | } |
1994 | 1994 | |
@@ -2169,14 +2169,14 @@ discard block |
||
2169 | 2169 | $nbMandated = 0; |
2170 | 2170 | foreach ($object->lines as $line) { |
2171 | 2171 | $res = $line->fetch_product(); |
2172 | - if ($res > 0 ) { |
|
2173 | - if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )) { |
|
2172 | + if ($res > 0) { |
|
2173 | + if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) { |
|
2174 | 2174 | $nbMandated++; |
2175 | 2175 | break; |
2176 | 2176 | } |
2177 | 2177 | } |
2178 | 2178 | } |
2179 | - if ($nbMandated > 0 ) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>'; |
|
2179 | + if ($nbMandated > 0) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>'; |
|
2180 | 2180 | |
2181 | 2181 | if (getDolGlobalInt('SALE_ORDER_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) { |
2182 | 2182 | // This is a hidden option: |
@@ -2186,7 +2186,7 @@ discard block |
||
2186 | 2186 | $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); |
2187 | 2187 | |
2188 | 2188 | if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && !empty($user->rights->facture->creer)) { |
2189 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
2189 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
2190 | 2190 | |
2191 | 2191 | $object->fetchObjectLinked(); |
2192 | 2192 | |
@@ -2716,55 +2716,55 @@ discard block |
||
2716 | 2716 | |
2717 | 2717 | $alert = ''; |
2718 | 2718 | if (!empty($conf->global->ORDER_MANAGE_MIN_AMOUNT) && $object->total_ht < $object->thirdparty->order_min_amount) { |
2719 | - $alert = ' ' . img_warning($langs->trans('OrderMinAmount') . ': ' . price($object->thirdparty->order_min_amount)); |
|
2719 | + $alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount)); |
|
2720 | 2720 | } |
2721 | 2721 | |
2722 | 2722 | print '<tr>'; |
2723 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
2724 | - print '<td class="nowrap amountcard right">' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
2723 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
2724 | + print '<td class="nowrap amountcard right">'.price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
2725 | 2725 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2726 | 2726 | // Multicurrency Amount HT |
2727 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2727 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
2728 | 2728 | } |
2729 | 2729 | print '</tr>'; |
2730 | 2730 | |
2731 | 2731 | print '<tr>'; |
2732 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>'; |
|
2733 | - print '<td class="nowrap amountcard right">' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
2732 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>'; |
|
2733 | + print '<td class="nowrap amountcard right">'.price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
2734 | 2734 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2735 | 2735 | // Multicurrency Amount VAT |
2736 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2736 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
2737 | 2737 | } |
2738 | 2738 | print '</tr>'; |
2739 | 2739 | |
2740 | 2740 | // Amount Local Taxes |
2741 | 2741 | if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { |
2742 | 2742 | print '<tr>'; |
2743 | - print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
2744 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
2743 | + print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
2744 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
2745 | 2745 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2746 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2746 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
2747 | 2747 | } |
2748 | 2748 | print '</tr>'; |
2749 | 2749 | |
2750 | 2750 | // Amount Local Taxes |
2751 | 2751 | if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { |
2752 | 2752 | print '<tr>'; |
2753 | - print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
2754 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
2753 | + print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
2754 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
2755 | 2755 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2756 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2756 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
2757 | 2757 | } |
2758 | 2758 | print '</tr>'; |
2759 | 2759 | } |
2760 | 2760 | } |
2761 | 2761 | |
2762 | 2762 | print '<tr>'; |
2763 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
2764 | - print '<td class="valuefield nowrap right amountcard">' . price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency) . '</td>'; |
|
2763 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
2764 | + print '<td class="valuefield nowrap right amountcard">'.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</td>'; |
|
2765 | 2765 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2766 | 2766 | // Multicurrency Amount TTC |
2767 | - print '<td class="valuefield nowrap right amountcard">' . price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2767 | + print '<td class="valuefield nowrap right amountcard">'.price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
2768 | 2768 | } |
2769 | 2769 | print '</tr>'."\n"; |
2770 | 2770 | |
@@ -2874,7 +2874,7 @@ discard block |
||
2874 | 2874 | if ($usercansend) { |
2875 | 2875 | print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); |
2876 | 2876 | } else { |
2877 | - print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF']. '#', '', false); |
|
2877 | + print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'].'#', '', false); |
|
2878 | 2878 | } |
2879 | 2879 | } |
2880 | 2880 | } |
@@ -2939,7 +2939,7 @@ discard block |
||
2939 | 2939 | }*/ |
2940 | 2940 | } else { |
2941 | 2941 | $langs->load("errors"); |
2942 | - print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
2942 | + print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
2943 | 2943 | } |
2944 | 2944 | } |
2945 | 2945 | |
@@ -2987,7 +2987,7 @@ discard block |
||
2987 | 2987 | if ($numshipping == 0) { |
2988 | 2988 | print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, ''); |
2989 | 2989 | } else { |
2990 | - print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
2990 | + print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
2991 | 2991 | } |
2992 | 2992 | } |
2993 | 2993 | } |
@@ -400,8 +400,8 @@ discard block |
||
400 | 400 | /** |
401 | 401 | * Shipment on process |
402 | 402 | */ |
403 | - const STATUS_SHIPMENTONPROCESS = 2; // We set this status when a shipment is validated |
|
404 | - const STATUS_ACCEPTED = 2; // For backward compatibility. Use key STATUS_SHIPMENTONPROCESS instead. |
|
403 | + const STATUS_SHIPMENTONPROCESS = 2; // We set this status when a shipment is validated |
|
404 | + const STATUS_ACCEPTED = 2; // For backward compatibility. Use key STATUS_SHIPMENTONPROCESS instead. |
|
405 | 405 | |
406 | 406 | /** |
407 | 407 | * Closed (Sent, billed or not) |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | // Set new ref and current status |
610 | 610 | if (!$error) { |
611 | 611 | $this->ref = $num; |
612 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
612 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
613 | 613 | $this->status = self::STATUS_VALIDATED; |
614 | 614 | } |
615 | 615 | |
@@ -989,7 +989,7 @@ discard block |
||
989 | 989 | $sql .= ", ".(!empty($this->shipping_method_id) && $this->shipping_method_id > 0 ? ((int) $this->shipping_method_id) : 'NULL'); |
990 | 990 | $sql .= ", ".(!empty($this->warehouse_id) && $this->warehouse_id > 0 ? ((int) $this->warehouse_id) : 'NULL'); |
991 | 991 | $sql .= ", ".($this->remise_absolue > 0 ? $this->db->escape($this->remise_absolue) : 'NULL'); |
992 | - $sql .= ", ".($this->remise_percent > 0 ? $this->db->escape($this->remise_percent) : 0); // TODO deprecated |
|
992 | + $sql .= ", ".($this->remise_percent > 0 ? $this->db->escape($this->remise_percent) : 0); // TODO deprecated |
|
993 | 993 | $sql .= ", ".(int) $this->fk_incoterms; |
994 | 994 | $sql .= ", '".$this->db->escape($this->location_incoterms)."'"; |
995 | 995 | $sql .= ", ".setEntity($this); |
@@ -1233,7 +1233,7 @@ discard block |
||
1233 | 1233 | if ($objsoc->fetch($socid) > 0) { |
1234 | 1234 | $this->socid = $objsoc->id; |
1235 | 1235 | $this->cond_reglement_id = (!empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); |
1236 | - $this->deposit_percent = (!empty($objsoc->deposit_percent) ? $objsoc->deposit_percent : null); |
|
1236 | + $this->deposit_percent = (!empty($objsoc->deposit_percent) ? $objsoc->deposit_percent : null); |
|
1237 | 1237 | $this->mode_reglement_id = (!empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); |
1238 | 1238 | $this->fk_project = 0; |
1239 | 1239 | $this->fk_delivery_address = 0; |
@@ -1248,7 +1248,7 @@ discard block |
||
1248 | 1248 | |
1249 | 1249 | // Clear fields |
1250 | 1250 | $this->user_author_id = $user->id; |
1251 | - $this->user_valid = 0; // deprecated |
|
1251 | + $this->user_valid = 0; // deprecated |
|
1252 | 1252 | $this->user_validation_id = 0; |
1253 | 1253 | $this->date = dol_now(); |
1254 | 1254 | $this->date_commande = dol_now(); |
@@ -1358,7 +1358,7 @@ discard block |
||
1358 | 1358 | $line->fk_parent_line = $object->lines[$i]->fk_parent_line; |
1359 | 1359 | $line->fk_unit = $object->lines[$i]->fk_unit; |
1360 | 1360 | |
1361 | - $line->date_start = $object->lines[$i]->date_start; |
|
1361 | + $line->date_start = $object->lines[$i]->date_start; |
|
1362 | 1362 | $line->date_end = $object->lines[$i]->date_end; |
1363 | 1363 | |
1364 | 1364 | $line->fk_fournprice = $object->lines[$i]->fk_fournprice; |
@@ -1927,7 +1927,7 @@ discard block |
||
1927 | 1927 | $this->user_author_id = $obj->fk_user_author; |
1928 | 1928 | $this->user_creation_id = $obj->fk_user_author; |
1929 | 1929 | $this->user_validation_id = $obj->fk_user_valid; |
1930 | - $this->user_valid = $obj->fk_user_valid; // deprecated |
|
1930 | + $this->user_valid = $obj->fk_user_valid; // deprecated |
|
1931 | 1931 | $this->user_modification_id = $obj->fk_user_modif; |
1932 | 1932 | $this->user_modification = $obj->fk_user_modif; |
1933 | 1933 | $this->total_ht = $obj->total_ht; |
@@ -1941,7 +1941,7 @@ discard block |
||
1941 | 1941 | $this->date_validation = $this->db->jdate($obj->date_valid); |
1942 | 1942 | $this->date_modification = $this->db->jdate($obj->tms); |
1943 | 1943 | $this->remise = $obj->remise; |
1944 | - $this->remise_percent = $obj->remise_percent; // TODO deprecated |
|
1944 | + $this->remise_percent = $obj->remise_percent; // TODO deprecated |
|
1945 | 1945 | $this->remise_absolue = $obj->remise_absolue; |
1946 | 1946 | $this->source = $obj->source; |
1947 | 1947 | $this->billed = $obj->billed; |
@@ -3594,15 +3594,15 @@ discard block |
||
3594 | 3594 | //$sql.= " AND c.fk_statut IN (1,2,3) AND c.facture = 0"; |
3595 | 3595 | if ($mode == 'toship') { |
3596 | 3596 | // An order to ship is an open order (validated or in progress) |
3597 | - $sql .= " AND c.fk_statut IN (" . self::STATUS_VALIDATED . "," . self::STATUS_SHIPMENTONPROCESS . ")"; |
|
3597 | + $sql .= " AND c.fk_statut IN (".self::STATUS_VALIDATED.",".self::STATUS_SHIPMENTONPROCESS.")"; |
|
3598 | 3598 | } |
3599 | 3599 | if ($mode == 'tobill') { |
3600 | 3600 | // An order to bill is an order not already billed |
3601 | - $sql .= " AND c.fk_statut IN (" . self::STATUS_VALIDATED . "," . self::STATUS_SHIPMENTONPROCESS . ", " . self::STATUS_CLOSED . ") AND c.facture = 0"; |
|
3601 | + $sql .= " AND c.fk_statut IN (".self::STATUS_VALIDATED.",".self::STATUS_SHIPMENTONPROCESS.", ".self::STATUS_CLOSED.") AND c.facture = 0"; |
|
3602 | 3602 | } |
3603 | 3603 | if ($mode == 'shippedtobill') { |
3604 | 3604 | // An order shipped and to bill is a delivered order not already billed |
3605 | - $sql .= " AND c.fk_statut IN (" . self::STATUS_CLOSED . ") AND c.facture = 0"; |
|
3605 | + $sql .= " AND c.fk_statut IN (".self::STATUS_CLOSED.") AND c.facture = 0"; |
|
3606 | 3606 | } |
3607 | 3607 | if ($user->socid) { |
3608 | 3608 | $sql .= " AND c.fk_soc = ".((int) $user->socid); |
@@ -3887,7 +3887,7 @@ discard block |
||
3887 | 3887 | $label = $langs->trans("Order"); |
3888 | 3888 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
3889 | 3889 | } |
3890 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
3890 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
3891 | 3891 | $linkclose .= $dataparams.' class="'.$classfortooltip.'"'; |
3892 | 3892 | |
3893 | 3893 | $target_value = array('_self', '_blank', '_parent', '_top'); |
@@ -3929,7 +3929,7 @@ discard block |
||
3929 | 3929 | } |
3930 | 3930 | |
3931 | 3931 | global $action; |
3932 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
3932 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
3933 | 3933 | $parameters = array('id'=>$this->id, 'getnomurl' => &$result); |
3934 | 3934 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
3935 | 3935 | if ($reshook > 0) { |
@@ -4332,7 +4332,7 @@ discard block |
||
4332 | 4332 | $objp = $this->db->fetch_object($result); |
4333 | 4333 | |
4334 | 4334 | if (!$objp) { |
4335 | - $this->error = 'OrderLine with id '. $rowid .' not found sql='.$sql; |
|
4335 | + $this->error = 'OrderLine with id '.$rowid.' not found sql='.$sql; |
|
4336 | 4336 | return 0; |
4337 | 4337 | } |
4338 | 4338 |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | // Members |
97 | 97 | $tmpentry = array( |
98 | 98 | 'enabled' => isModEnabled('adherent'), |
99 | - 'perms' => $user->hasRight('adherent', 'lire'), |
|
99 | + 'perms' => $user->hasRight('adherent', 'lire'), |
|
100 | 100 | 'module' => 'adherent' |
101 | 101 | ); |
102 | 102 | $menu_arr[] = array( |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | ) |
126 | 126 | || (isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) |
127 | 127 | ), |
128 | - 'perms'=> ($user->hasRight('societe', 'lire') || $user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), |
|
128 | + 'perms'=> ($user->hasRight('societe', 'lire') || $user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), |
|
129 | 129 | 'module'=>'societe|fournisseur' |
130 | 130 | ); |
131 | 131 | $menu_arr[] = array( |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | // Products-Services |
151 | 151 | $tmpentry = array( |
152 | 152 | 'enabled'=> (isModEnabled('product') || isModEnabled('service') || isModEnabled('expedition')), |
153 | - 'perms'=> ($user->hasRight('product', 'read') || $user->hasRight('service', 'read') || $user->hasRight('expedition', 'lire')), |
|
153 | + 'perms'=> ($user->hasRight('product', 'read') || $user->hasRight('service', 'read') || $user->hasRight('expedition', 'lire')), |
|
154 | 154 | 'module'=>'product|service' |
155 | 155 | ); |
156 | 156 | $menu_arr[] = array( |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | // MRP - GPAO |
178 | 178 | $tmpentry = array( |
179 | 179 | 'enabled'=>(isModEnabled('bom') || isModEnabled('mrp')), |
180 | - 'perms'=>($user->hasRight('bom', 'read') || $user->hasRight('mrp', 'read')), |
|
180 | + 'perms'=>($user->hasRight('bom', 'read') || $user->hasRight('mrp', 'read')), |
|
181 | 181 | 'module'=>'bom|mrp' |
182 | 182 | ); |
183 | 183 | $menu_arr[] = array( |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | // Projects |
203 | 203 | $tmpentry = array( |
204 | 204 | 'enabled'=> (isModEnabled('projet') ? 1 : 0), |
205 | - 'perms'=> ($user->hasRight('projet', 'lire') ? 1 : 0), |
|
205 | + 'perms'=> ($user->hasRight('projet', 'lire') ? 1 : 0), |
|
206 | 206 | 'module'=>'projet' |
207 | 207 | ); |
208 | 208 | |
@@ -247,25 +247,25 @@ discard block |
||
247 | 247 | || isModEnabled('contrat') |
248 | 248 | || isModEnabled('ficheinter') |
249 | 249 | ) ? 1 : 0, |
250 | - 'perms'=>($user->hasRight('propal', 'read') |
|
251 | - || $user->hasRight('commande', 'lire') |
|
252 | - || $user->hasRight('supplier_proposal', 'lire') |
|
253 | - || $user->hasRight('fournisseur', 'lire') |
|
254 | - || $user->hasRight('fournisseur', 'commande', 'lire') |
|
255 | - || $user->hasRight('supplier_order', 'lire') |
|
256 | - || $user->hasRight('contrat', 'lire') |
|
257 | - || $user->hasRight('ficheinter', 'lire') |
|
250 | + 'perms'=>($user->hasRight('propal', 'read') |
|
251 | + || $user->hasRight('commande', 'lire') |
|
252 | + || $user->hasRight('supplier_proposal', 'lire') |
|
253 | + || $user->hasRight('fournisseur', 'lire') |
|
254 | + || $user->hasRight('fournisseur', 'commande', 'lire') |
|
255 | + || $user->hasRight('supplier_order', 'lire') |
|
256 | + || $user->hasRight('contrat', 'lire') |
|
257 | + || $user->hasRight('ficheinter', 'lire') |
|
258 | 258 | ), |
259 | 259 | 'module'=>'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter' |
260 | 260 | ); |
261 | 261 | |
262 | - $onlysupplierorder = $user->hasRight('fournisseur', 'commande', 'lire') && |
|
263 | - !$user->hasRight('propal', 'lire') && |
|
264 | - !$user->hasRight('commande', 'lire') && |
|
265 | - !$user->hasRight('supplier_order', 'lire') && |
|
266 | - !$user->hasRight('supplier_proposal', 'lire') && |
|
267 | - !$user->hasRight('contrat', 'lire') && |
|
268 | - !$user->hasRight('ficheinter', 'lire'); |
|
262 | + $onlysupplierorder = $user->hasRight('fournisseur', 'commande', 'lire') && |
|
263 | + !$user->hasRight('propal', 'lire') && |
|
264 | + !$user->hasRight('commande', 'lire') && |
|
265 | + !$user->hasRight('supplier_order', 'lire') && |
|
266 | + !$user->hasRight('supplier_proposal', 'lire') && |
|
267 | + !$user->hasRight('contrat', 'lire') && |
|
268 | + !$user->hasRight('ficheinter', 'lire'); |
|
269 | 269 | |
270 | 270 | $menu_arr[] = array( |
271 | 271 | 'name' => 'Commercial', |
@@ -296,9 +296,9 @@ discard block |
||
296 | 296 | isModEnabled('loan') || |
297 | 297 | isModEnabled('margins') |
298 | 298 | ) ? 1 : 0, |
299 | - 'perms'=>($user->hasRight('facture', 'lire') || $user->hasRight('don', 'contact', 'lire') |
|
300 | - || $user->hasRight('tax', 'charges', 'lire') || $user->hasRight('salaries', 'read') |
|
301 | - || $user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('loan', 'read') || $user->hasRight('margins', 'liretous')), |
|
299 | + 'perms'=>($user->hasRight('facture', 'lire') || $user->hasRight('don', 'contact', 'lire') |
|
300 | + || $user->hasRight('tax', 'charges', 'lire') || $user->hasRight('salaries', 'read') |
|
301 | + || $user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('loan', 'read') || $user->hasRight('margins', 'liretous')), |
|
302 | 302 | 'module'=>'facture|supplier_invoice|don|tax|salaries|loan' |
303 | 303 | ); |
304 | 304 | $menu_arr[] = array( |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | // Bank |
324 | 324 | $tmpentry = array( |
325 | 325 | 'enabled'=>(isModEnabled('banque') || isModEnabled('prelevement')), |
326 | - 'perms'=>($user->hasRight('banque', 'lire') || $user->hasRight('prelevement', 'lire') || $user->hasRight('paymentbybanktransfer', 'read')), |
|
326 | + 'perms'=>($user->hasRight('banque', 'lire') || $user->hasRight('prelevement', 'lire') || $user->hasRight('paymentbybanktransfer', 'read')), |
|
327 | 327 | 'module'=>'banque|prelevement|paymentbybanktransfer' |
328 | 328 | ); |
329 | 329 | $menu_arr[] = array( |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | // Accounting |
349 | 349 | $tmpentry = array( |
350 | 350 | 'enabled'=>(isModEnabled('comptabilite') || isModEnabled('accounting') || isModEnabled('asset') || isModEnabled('intracommreport')), |
351 | - 'perms'=>($user->hasRight('compta', 'resultat', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire') || $user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('asset', 'read') || $user->hasRight('intracommreport', 'read')), |
|
351 | + 'perms'=>($user->hasRight('compta', 'resultat', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire') || $user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('asset', 'read') || $user->hasRight('intracommreport', 'read')), |
|
352 | 352 | 'module'=>'comptabilite|accounting|asset|intracommreport' |
353 | 353 | ); |
354 | 354 | $menu_arr[] = array( |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | // HRM |
374 | 374 | $tmpentry = array( |
375 | 375 | 'enabled'=>(isModEnabled('hrm') || (isModEnabled('holiday')) || isModEnabled('deplacement') || isModEnabled('expensereport') || isModEnabled('recruitment')), |
376 | - 'perms'=>($user->hasRight('user', 'user', 'lire') || $user->hasRight('holiday', 'read') || $user->hasRight('deplacement', 'lire') || $user->hasRight('expensereport', 'lire') || $user->hasRight('recruitment', 'recruitmentjobposition', 'read')), |
|
376 | + 'perms'=>($user->hasRight('user', 'user', 'lire') || $user->hasRight('holiday', 'read') || $user->hasRight('deplacement', 'lire') || $user->hasRight('expensereport', 'lire') || $user->hasRight('recruitment', 'recruitmentjobposition', 'read')), |
|
377 | 377 | 'module'=>'hrm|holiday|deplacement|expensereport|recruitment' |
378 | 378 | ); |
379 | 379 | |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | // Tickets and Knowledge base |
400 | 400 | $tmpentry = array( |
401 | 401 | 'enabled'=>(isModEnabled('ticket') || isModEnabled('knowledgemanagement')), |
402 | - 'perms'=>($user->hasRight('ticket', 'read') || $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')), |
|
402 | + 'perms'=>($user->hasRight('ticket', 'read') || $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')), |
|
403 | 403 | 'module'=>'ticket|knowledgemanagement' |
404 | 404 | ); |
405 | 405 | $link = ''; |
@@ -1182,17 +1182,17 @@ discard block |
||
1182 | 1182 | $newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, $user->hasRight('user', 'user', 'read'), '', $mainmenu, 'users', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); |
1183 | 1183 | if ($user->hasRight('user', 'user', 'read')) { |
1184 | 1184 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "users") { |
1185 | - $newmenu->add("", $langs->trans("Users"), 1, $user->hasRight('user', 'user', 'lire') || $user->admin); |
|
1185 | + $newmenu->add("", $langs->trans("Users"), 1, $user->hasRight('user', 'user', 'lire') || $user->admin); |
|
1186 | 1186 | $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->hasRight("user", "user", "write") || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)), '', 'home'); |
1187 | - $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin); |
|
1188 | - $newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin); |
|
1187 | + $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin); |
|
1188 | + $newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin); |
|
1189 | 1189 | if (isModEnabled('categorie')) { |
1190 | 1190 | $langs->load("categories"); |
1191 | - $newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
1191 | + $newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
1192 | 1192 | } |
1193 | - $newmenu->add("", $langs->trans("Groups"), 1, ($user->hasRight('user', 'user', 'lire') || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))); |
|
1193 | + $newmenu->add("", $langs->trans("Groups"), 1, ($user->hasRight('user', 'user', 'lire') || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))); |
|
1194 | 1194 | $newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->hasRight("user", "group_advance", "create") : $user->hasRight("user", "user", "create")) || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))); |
1195 | - $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->hasRight('user', 'group_advance', 'read') : $user->hasRight('user', 'user', 'lire')) || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))); |
|
1195 | + $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->hasRight('user', 'group_advance', 'read') : $user->hasRight('user', 'user', 'lire')) || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))); |
|
1196 | 1196 | } |
1197 | 1197 | } |
1198 | 1198 | } |
@@ -1216,9 +1216,9 @@ discard block |
||
1216 | 1216 | // Societes |
1217 | 1217 | if (isModEnabled('societe')) { |
1218 | 1218 | $langs->load("companies"); |
1219 | - $newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->hasRight('societe', 'lire'), '', $mainmenu, 'thirdparties', 0, '', '', '', img_picto('', 'company', 'class="paddingright pictofixedwidth"')); |
|
1219 | + $newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->hasRight('societe', 'lire'), '', $mainmenu, 'thirdparties', 0, '', '', '', img_picto('', 'company', 'class="paddingright pictofixedwidth"')); |
|
1220 | 1220 | |
1221 | - if ($user->hasRight('societe', 'creer')) { |
|
1221 | + if ($user->hasRight('societe', 'creer')) { |
|
1222 | 1222 | $newmenu->add("/societe/card.php?action=create", $langs->trans("MenuNewThirdParty"), 1); |
1223 | 1223 | if (!$conf->use_javascript_ajax) { |
1224 | 1224 | $newmenu->add("/societe/card.php?action=create&private=1", $langs->trans("MenuNewPrivateIndividual"), 1); |
@@ -1231,7 +1231,7 @@ discard block |
||
1231 | 1231 | // Prospects |
1232 | 1232 | if (isModEnabled('societe') && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { |
1233 | 1233 | $langs->load("commercial"); |
1234 | - $newmenu->add("/societe/list.php?type=p&leftmenu=prospects", $langs->trans("ListProspectsShort"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'prospects'); |
|
1234 | + $newmenu->add("/societe/list.php?type=p&leftmenu=prospects", $langs->trans("ListProspectsShort"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'prospects'); |
|
1235 | 1235 | /* no more required, there is a filter that can do more |
1236 | 1236 | if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->hasRight('societe', 'lire')); |
1237 | 1237 | if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->hasRight('societe', 'lire')); |
@@ -1239,22 +1239,22 @@ discard block |
||
1239 | 1239 | if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=2", $langs->trans("LastProspectContactInProcess"), 2, $user->hasRight('societe', 'lire')); |
1240 | 1240 | if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->hasRight('societe', 'lire')); |
1241 | 1241 | */ |
1242 | - $newmenu->add("/societe/card.php?leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 3, $user->hasRight('societe', 'creer')); |
|
1242 | + $newmenu->add("/societe/card.php?leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 3, $user->hasRight('societe', 'creer')); |
|
1243 | 1243 | } |
1244 | 1244 | |
1245 | 1245 | // Customers/Prospects |
1246 | 1246 | if (isModEnabled('societe') && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { |
1247 | 1247 | $langs->load("commercial"); |
1248 | - $newmenu->add("/societe/list.php?type=c&leftmenu=customers", $langs->trans("ListCustomersShort"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'customers'); |
|
1248 | + $newmenu->add("/societe/list.php?type=c&leftmenu=customers", $langs->trans("ListCustomersShort"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'customers'); |
|
1249 | 1249 | |
1250 | - $newmenu->add("/societe/card.php?leftmenu=customers&action=create&type=c", $langs->trans("MenuNewCustomer"), 3, $user->hasRight('societe', 'creer')); |
|
1250 | + $newmenu->add("/societe/card.php?leftmenu=customers&action=create&type=c", $langs->trans("MenuNewCustomer"), 3, $user->hasRight('societe', 'creer')); |
|
1251 | 1251 | } |
1252 | 1252 | |
1253 | 1253 | // Suppliers |
1254 | 1254 | if (isModEnabled('societe') && (isModEnabled('supplier_order') || isModEnabled('supplier_invoice') || isModEnabled('supplier_proposal'))) { |
1255 | 1255 | $langs->load("suppliers"); |
1256 | - $newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 2, ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), '', $mainmenu, 'suppliers'); |
|
1257 | - $newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->hasRight('societe', 'creer') && ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire'))); |
|
1256 | + $newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 2, ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), '', $mainmenu, 'suppliers'); |
|
1257 | + $newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->hasRight('societe', 'creer') && ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire'))); |
|
1258 | 1258 | } |
1259 | 1259 | |
1260 | 1260 | // Categories |
@@ -1269,36 +1269,36 @@ discard block |
||
1269 | 1269 | if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { |
1270 | 1270 | $menutoshow = $langs->trans("ProspectsCategoriesShort"); |
1271 | 1271 | } |
1272 | - $newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
1272 | + $newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
1273 | 1273 | } |
1274 | 1274 | // Categories suppliers |
1275 | 1275 | if (isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { |
1276 | - $newmenu->add("/categories/index.php?leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->hasRight('categorie', 'lire')); |
|
1276 | + $newmenu->add("/categories/index.php?leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->hasRight('categorie', 'lire')); |
|
1277 | 1277 | } |
1278 | 1278 | } |
1279 | 1279 | |
1280 | 1280 | // Contacts |
1281 | - $newmenu->add("/societe/index.php?leftmenu=thirdparties", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->hasRight('societe', 'contact', 'lire'), '', $mainmenu, 'contacts', 0, '', '', '', img_picto('', 'contact', 'class="paddingright pictofixedwidth"')); |
|
1281 | + $newmenu->add("/societe/index.php?leftmenu=thirdparties", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->hasRight('societe', 'contact', 'lire'), '', $mainmenu, 'contacts', 0, '', '', '', img_picto('', 'contact', 'class="paddingright pictofixedwidth"')); |
|
1282 | 1282 | |
1283 | - $newmenu->add("/contact/card.php?leftmenu=contacts&action=create", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->hasRight('societe', 'contact', 'creer')); |
|
1284 | - $newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->hasRight('societe', 'contact', 'lire')); |
|
1283 | + $newmenu->add("/contact/card.php?leftmenu=contacts&action=create", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->hasRight('societe', 'contact', 'creer')); |
|
1284 | + $newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->hasRight('societe', 'contact', 'lire')); |
|
1285 | 1285 | if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { |
1286 | - $newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->hasRight('societe', 'contact', 'lire')); |
|
1286 | + $newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->hasRight('societe', 'contact', 'lire')); |
|
1287 | 1287 | } |
1288 | 1288 | if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { |
1289 | - $newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->hasRight('societe', 'contact', 'lire')); |
|
1289 | + $newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->hasRight('societe', 'contact', 'lire')); |
|
1290 | 1290 | } |
1291 | 1291 | if (isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { |
1292 | - $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->hasRight('fournisseur', 'lire')); |
|
1292 | + $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->hasRight('fournisseur', 'lire')); |
|
1293 | 1293 | } |
1294 | - $newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->hasRight('societe', 'contact', 'lire')); |
|
1294 | + $newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->hasRight('societe', 'contact', 'lire')); |
|
1295 | 1295 | //$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->hasRight('societe', 'contact', 'lire')); |
1296 | 1296 | |
1297 | 1297 | // Categories |
1298 | 1298 | if (isModEnabled('categorie')) { |
1299 | 1299 | $langs->load("categories"); |
1300 | 1300 | // Categories Contact |
1301 | - $newmenu->add("/categories/index.php?leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
1301 | + $newmenu->add("/categories/index.php?leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
1302 | 1302 | } |
1303 | 1303 | } |
1304 | 1304 | } |
@@ -1323,101 +1323,101 @@ discard block |
||
1323 | 1323 | // Customer proposal |
1324 | 1324 | if (isModEnabled('propal')) { |
1325 | 1325 | $langs->load("propal"); |
1326 | - $newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->hasRight('propal', 'read'), '', $mainmenu, 'propals', 100, '', '', '', img_picto('', 'propal', 'class="paddingright pictofixedwidth"')); |
|
1327 | - $newmenu->add("/comm/propal/card.php?action=create&leftmenu=propals", $langs->trans("NewPropal"), 1, $user->hasRight('propal', 'write')); |
|
1328 | - $newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->hasRight('propal', 'read')); |
|
1326 | + $newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->hasRight('propal', 'read'), '', $mainmenu, 'propals', 100, '', '', '', img_picto('', 'propal', 'class="paddingright pictofixedwidth"')); |
|
1327 | + $newmenu->add("/comm/propal/card.php?action=create&leftmenu=propals", $langs->trans("NewPropal"), 1, $user->hasRight('propal', 'write')); |
|
1328 | + $newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->hasRight('propal', 'read')); |
|
1329 | 1329 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "propals") { |
1330 | - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=0", $langs->trans("PropalsDraft"), 2, $user->hasRight('propal', 'read')); |
|
1331 | - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=1", $langs->trans("PropalsOpened"), 2, $user->hasRight('propal', 'read')); |
|
1332 | - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2", $langs->trans("PropalStatusSigned"), 2, $user->hasRight('propal', 'read')); |
|
1333 | - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=3", $langs->trans("PropalStatusNotSigned"), 2, $user->hasRight('propal', 'read')); |
|
1334 | - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=4", $langs->trans("PropalStatusBilled"), 2, $user->hasRight('propal', 'read')); |
|
1330 | + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=0", $langs->trans("PropalsDraft"), 2, $user->hasRight('propal', 'read')); |
|
1331 | + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=1", $langs->trans("PropalsOpened"), 2, $user->hasRight('propal', 'read')); |
|
1332 | + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2", $langs->trans("PropalStatusSigned"), 2, $user->hasRight('propal', 'read')); |
|
1333 | + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=3", $langs->trans("PropalStatusNotSigned"), 2, $user->hasRight('propal', 'read')); |
|
1334 | + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=4", $langs->trans("PropalStatusBilled"), 2, $user->hasRight('propal', 'read')); |
|
1335 | 1335 | //$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->hasRight('propal', 'read')); |
1336 | 1336 | } |
1337 | - $newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->hasRight('propal', 'read')); |
|
1337 | + $newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->hasRight('propal', 'read')); |
|
1338 | 1338 | } |
1339 | 1339 | |
1340 | 1340 | // Customers orders |
1341 | 1341 | if (isModEnabled('commande')) { |
1342 | 1342 | $langs->load("orders"); |
1343 | - $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 200, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); |
|
1344 | - $newmenu->add("/commande/card.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->hasRight('commande', 'creer')); |
|
1345 | - $newmenu->add("/commande/list.php?leftmenu=orders", $langs->trans("List"), 1, $user->hasRight('commande', 'lire')); |
|
1343 | + $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 200, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); |
|
1344 | + $newmenu->add("/commande/card.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->hasRight('commande', 'creer')); |
|
1345 | + $newmenu->add("/commande/list.php?leftmenu=orders", $langs->trans("List"), 1, $user->hasRight('commande', 'lire')); |
|
1346 | 1346 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders") { |
1347 | - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=0", $langs->trans("StatusOrderDraftShort"), 2, $user->hasRight('commande', 'lire')); |
|
1348 | - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=1", $langs->trans("StatusOrderValidated"), 2, $user->hasRight('commande', 'lire')); |
|
1347 | + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=0", $langs->trans("StatusOrderDraftShort"), 2, $user->hasRight('commande', 'lire')); |
|
1348 | + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=1", $langs->trans("StatusOrderValidated"), 2, $user->hasRight('commande', 'lire')); |
|
1349 | 1349 | if (isModEnabled('expedition')) { |
1350 | - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=2", $langs->trans("StatusOrderSentShort"), 2, $user->hasRight('commande', 'lire')); |
|
1350 | + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=2", $langs->trans("StatusOrderSentShort"), 2, $user->hasRight('commande', 'lire')); |
|
1351 | 1351 | } |
1352 | - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=3", $langs->trans("StatusOrderDelivered"), 2, $user->hasRight('commande', 'lire')); |
|
1352 | + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=3", $langs->trans("StatusOrderDelivered"), 2, $user->hasRight('commande', 'lire')); |
|
1353 | 1353 | //$newmenu->add("/commande/list.php?leftmenu=orders&search_status=4", $langs->trans("StatusOrderProcessed"), 2, $user->hasRight('commande', 'lire')); |
1354 | - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->hasRight('commande', 'lire')); |
|
1354 | + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->hasRight('commande', 'lire')); |
|
1355 | 1355 | } |
1356 | 1356 | if ($conf->global->MAIN_FEATURES_LEVEL >= 2 && empty($user->socid)) { |
1357 | - $newmenu->add("/commande/list_det.php?leftmenu=orders", $langs->trans("ListOrderLigne"), 1, $user->hasRight('commande', 'lire')); |
|
1357 | + $newmenu->add("/commande/list_det.php?leftmenu=orders", $langs->trans("ListOrderLigne"), 1, $user->hasRight('commande', 'lire')); |
|
1358 | 1358 | } |
1359 | - $newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->hasRight('commande', 'lire')); |
|
1359 | + $newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->hasRight('commande', 'lire')); |
|
1360 | 1360 | } |
1361 | 1361 | |
1362 | 1362 | // Supplier proposal |
1363 | 1363 | if (isModEnabled('supplier_proposal')) { |
1364 | 1364 | $langs->load("supplier_proposal"); |
1365 | - $newmenu->add("/supplier_proposal/index.php?leftmenu=propals_supplier", $langs->trans("SupplierProposalsShort"), 0, $user->hasRight('supplier_proposal', 'lire'), '', $mainmenu, 'propals_supplier', 300, '', '', '', img_picto('', 'supplier_proposal', 'class="paddingright pictofixedwidth"')); |
|
1366 | - $newmenu->add("/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals", $langs->trans("SupplierProposalNew"), 1, $user->hasRight('supplier_proposal', 'creer')); |
|
1367 | - $newmenu->add("/supplier_proposal/list.php?leftmenu=supplier_proposals", $langs->trans("List"), 1, $user->hasRight('supplier_proposal', 'lire')); |
|
1368 | - $newmenu->add("/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier", $langs->trans("Statistics"), 1, $user->hasRight('supplier_proposal', 'lire')); |
|
1365 | + $newmenu->add("/supplier_proposal/index.php?leftmenu=propals_supplier", $langs->trans("SupplierProposalsShort"), 0, $user->hasRight('supplier_proposal', 'lire'), '', $mainmenu, 'propals_supplier', 300, '', '', '', img_picto('', 'supplier_proposal', 'class="paddingright pictofixedwidth"')); |
|
1366 | + $newmenu->add("/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals", $langs->trans("SupplierProposalNew"), 1, $user->hasRight('supplier_proposal', 'creer')); |
|
1367 | + $newmenu->add("/supplier_proposal/list.php?leftmenu=supplier_proposals", $langs->trans("List"), 1, $user->hasRight('supplier_proposal', 'lire')); |
|
1368 | + $newmenu->add("/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier", $langs->trans("Statistics"), 1, $user->hasRight('supplier_proposal', 'lire')); |
|
1369 | 1369 | } |
1370 | 1370 | |
1371 | 1371 | // Suppliers orders |
1372 | 1372 | if (isModEnabled('supplier_order')) { |
1373 | 1373 | $langs->load("orders"); |
1374 | - $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->hasRight('fournisseur', 'commande', 'lire'), '', $mainmenu, 'orders_suppliers', 400, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); |
|
1375 | - $newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewSupplierOrderShort"), 1, $user->hasRight('fournisseur', 'commande', 'creer')); |
|
1376 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1374 | + $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->hasRight('fournisseur', 'commande', 'lire'), '', $mainmenu, 'orders_suppliers', 400, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); |
|
1375 | + $newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewSupplierOrderShort"), 1, $user->hasRight('fournisseur', 'commande', 'creer')); |
|
1376 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1377 | 1377 | |
1378 | 1378 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders_suppliers") { |
1379 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans("StatusSupplierOrderDraftShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1379 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans("StatusSupplierOrderDraftShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1380 | 1380 | if (empty($conf->global->SUPPLIER_ORDER_HIDE_VALIDATED)) { |
1381 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans("StatusSupplierOrderValidated"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1381 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans("StatusSupplierOrderValidated"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1382 | 1382 | } |
1383 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans("StatusSupplierOrderApprovedShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1384 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=3", $langs->trans("StatusSupplierOrderOnProcessShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1385 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans("StatusSupplierOrderReceivedPartiallyShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1386 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=5", $langs->trans("StatusSupplierOrderReceivedAll"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1387 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusSupplierOrderCanceled"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1388 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusSupplierOrderRefused"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1383 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans("StatusSupplierOrderApprovedShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1384 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=3", $langs->trans("StatusSupplierOrderOnProcessShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1385 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans("StatusSupplierOrderReceivedPartiallyShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1386 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=5", $langs->trans("StatusSupplierOrderReceivedAll"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1387 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusSupplierOrderCanceled"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1388 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusSupplierOrderRefused"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1389 | 1389 | } |
1390 | 1390 | // Billed is another field. We should add instead a dedicated filter on list. if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&billed=1", $langs->trans("Billed"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
1391 | 1391 | |
1392 | 1392 | |
1393 | - $newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1393 | + $newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1394 | 1394 | } |
1395 | 1395 | |
1396 | 1396 | // Contrat |
1397 | 1397 | if (isModEnabled('contrat')) { |
1398 | 1398 | $langs->load("contracts"); |
1399 | - $newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->hasRight('contrat', 'lire'), '', $mainmenu, 'contracts', 2000, '', '', '', img_picto('', 'contract', 'class="paddingright pictofixedwidth"')); |
|
1400 | - $newmenu->add("/contrat/card.php?action=create&leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->hasRight('contrat', 'creer')); |
|
1401 | - $newmenu->add("/contrat/list.php?leftmenu=contracts", $langs->trans("List"), 1, $user->hasRight('contrat', 'lire')); |
|
1402 | - $newmenu->add("/contrat/services_list.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->hasRight('contrat', 'lire')); |
|
1399 | + $newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->hasRight('contrat', 'lire'), '', $mainmenu, 'contracts', 2000, '', '', '', img_picto('', 'contract', 'class="paddingright pictofixedwidth"')); |
|
1400 | + $newmenu->add("/contrat/card.php?action=create&leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->hasRight('contrat', 'creer')); |
|
1401 | + $newmenu->add("/contrat/list.php?leftmenu=contracts", $langs->trans("List"), 1, $user->hasRight('contrat', 'lire')); |
|
1402 | + $newmenu->add("/contrat/services_list.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->hasRight('contrat', 'lire')); |
|
1403 | 1403 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "contracts") { |
1404 | - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=0", $langs->trans("MenuInactiveServices"), 2, $user->hasRight('contrat', 'lire')); |
|
1405 | - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=4", $langs->trans("MenuRunningServices"), 2, $user->hasRight('contrat', 'lire')); |
|
1406 | - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->hasRight('contrat', 'lire')); |
|
1407 | - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=5", $langs->trans("MenuClosedServices"), 2, $user->hasRight('contrat', 'lire')); |
|
1404 | + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=0", $langs->trans("MenuInactiveServices"), 2, $user->hasRight('contrat', 'lire')); |
|
1405 | + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=4", $langs->trans("MenuRunningServices"), 2, $user->hasRight('contrat', 'lire')); |
|
1406 | + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->hasRight('contrat', 'lire')); |
|
1407 | + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=5", $langs->trans("MenuClosedServices"), 2, $user->hasRight('contrat', 'lire')); |
|
1408 | 1408 | } |
1409 | 1409 | } |
1410 | 1410 | |
1411 | 1411 | // Interventions |
1412 | 1412 | if (isModEnabled('ficheinter')) { |
1413 | 1413 | $langs->load("interventions"); |
1414 | - $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->hasRight('ficheinter', 'lire'), '', $mainmenu, 'ficheinter', 2200, '', '', '', img_picto('', 'intervention', 'class="paddingright pictofixedwidth"')); |
|
1415 | - $newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->hasRight('ficheinter', 'creer'), '', '', '', 201); |
|
1416 | - $newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->hasRight('ficheinter', 'lire'), '', '', '', 202); |
|
1414 | + $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->hasRight('ficheinter', 'lire'), '', $mainmenu, 'ficheinter', 2200, '', '', '', img_picto('', 'intervention', 'class="paddingright pictofixedwidth"')); |
|
1415 | + $newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->hasRight('ficheinter', 'creer'), '', '', '', 201); |
|
1416 | + $newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->hasRight('ficheinter', 'lire'), '', '', '', 202); |
|
1417 | 1417 | if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { |
1418 | - $newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ListOfTemplates"), 1, $user->hasRight('ficheinter', 'lire'), '', '', '', 203); |
|
1418 | + $newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ListOfTemplates"), 1, $user->hasRight('ficheinter', 'lire'), '', '', '', 203); |
|
1419 | 1419 | } |
1420 | - $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->hasRight('ficheinter', 'lire')); |
|
1420 | + $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->hasRight('ficheinter', 'lire')); |
|
1421 | 1421 | } |
1422 | 1422 | } |
1423 | 1423 | } |
@@ -1442,59 +1442,59 @@ discard block |
||
1442 | 1442 | // Customers invoices |
1443 | 1443 | if (isModEnabled('facture')) { |
1444 | 1444 | $langs->load("bills"); |
1445 | - $newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills', 0, '', '', '', img_picto('', 'bill', 'class="paddingright pictofixedwidth"')); |
|
1446 | - $newmenu->add("/compta/facture/card.php?action=create", $langs->trans("NewBill"), 1, $user->hasRight('facture', 'creer')); |
|
1447 | - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills", $langs->trans("List"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_list'); |
|
1445 | + $newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills', 0, '', '', '', img_picto('', 'bill', 'class="paddingright pictofixedwidth"')); |
|
1446 | + $newmenu->add("/compta/facture/card.php?action=create", $langs->trans("NewBill"), 1, $user->hasRight('facture', 'creer')); |
|
1447 | + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills", $langs->trans("List"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_list'); |
|
1448 | 1448 | |
1449 | 1449 | if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills(|_draft|_notpaid|_paid|_canceled)$/', $leftmenu)) { |
1450 | - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->hasRight('facture', 'lire')); |
|
1451 | - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->hasRight('facture', 'lire')); |
|
1452 | - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->hasRight('facture', 'lire')); |
|
1453 | - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3", $langs->trans("BillShortStatusCanceled"), 2, $user->hasRight('facture', 'lire')); |
|
1450 | + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->hasRight('facture', 'lire')); |
|
1451 | + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->hasRight('facture', 'lire')); |
|
1452 | + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->hasRight('facture', 'lire')); |
|
1453 | + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3", $langs->trans("BillShortStatusCanceled"), 2, $user->hasRight('facture', 'lire')); |
|
1454 | 1454 | } |
1455 | - $newmenu->add("/compta/facture/invoicetemplate_list.php?leftmenu=customers_bills_templates", $langs->trans("ListOfTemplates"), 1, $user->hasRight('facture', 'creer'), '', $mainmenu, 'customers_bills_templates'); // No need to see recurring invoices, if user has no permission to create invoice. |
|
1455 | + $newmenu->add("/compta/facture/invoicetemplate_list.php?leftmenu=customers_bills_templates", $langs->trans("ListOfTemplates"), 1, $user->hasRight('facture', 'creer'), '', $mainmenu, 'customers_bills_templates'); // No need to see recurring invoices, if user has no permission to create invoice. |
|
1456 | 1456 | |
1457 | - $newmenu->add("/compta/paiement/list.php?leftmenu=customers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment'); |
|
1457 | + $newmenu->add("/compta/paiement/list.php?leftmenu=customers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment'); |
|
1458 | 1458 | |
1459 | 1459 | if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { |
1460 | - $newmenu->add("/compta/paiement/tovalidate.php?leftmenu=customers_bills_tovalid", $langs->trans("MenuToValid"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customer_bills_tovalid'); |
|
1460 | + $newmenu->add("/compta/paiement/tovalidate.php?leftmenu=customers_bills_tovalid", $langs->trans("MenuToValid"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customer_bills_tovalid'); |
|
1461 | 1461 | } |
1462 | 1462 | if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills/', $leftmenu)) { |
1463 | - $newmenu->add("/compta/paiement/rapport.php?leftmenu=customers_bills_payment_report", $langs->trans("Reportings"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment_report'); |
|
1463 | + $newmenu->add("/compta/paiement/rapport.php?leftmenu=customers_bills_payment_report", $langs->trans("Reportings"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment_report'); |
|
1464 | 1464 | } |
1465 | 1465 | |
1466 | - $newmenu->add("/compta/facture/stats/index.php?leftmenu=customers_bills_stats", $langs->trans("Statistics"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_stats'); |
|
1466 | + $newmenu->add("/compta/facture/stats/index.php?leftmenu=customers_bills_stats", $langs->trans("Statistics"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_stats'); |
|
1467 | 1467 | } |
1468 | 1468 | |
1469 | 1469 | // Suppliers invoices |
1470 | 1470 | if (isModEnabled('societe') && isModEnabled('supplier_invoice')) { |
1471 | 1471 | $langs->load("bills"); |
1472 | - $newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills', 0, '', '', '', img_picto('', 'supplier_invoice', 'class="paddingright pictofixedwidth"')); |
|
1473 | - $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, ($user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer')), '', $mainmenu, 'suppliers_bills_create'); |
|
1474 | - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_list'); |
|
1472 | + $newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills', 0, '', '', '', img_picto('', 'supplier_invoice', 'class="paddingright pictofixedwidth"')); |
|
1473 | + $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, ($user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer')), '', $mainmenu, 'suppliers_bills_create'); |
|
1474 | + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_list'); |
|
1475 | 1475 | |
1476 | 1476 | if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) { |
1477 | - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_draft'); |
|
1478 | - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_notpaid'); |
|
1479 | - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_paid'); |
|
1477 | + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_draft'); |
|
1478 | + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_notpaid'); |
|
1479 | + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_paid'); |
|
1480 | 1480 | } |
1481 | 1481 | |
1482 | - $newmenu->add("/fourn/facture/list-rec.php?leftmenu=supplierinvoicestemplate_list", $langs->trans("ListOfTemplates"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'supplierinvoicestemplate_list'); |
|
1482 | + $newmenu->add("/fourn/facture/list-rec.php?leftmenu=supplierinvoicestemplate_list", $langs->trans("ListOfTemplates"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'supplierinvoicestemplate_list'); |
|
1483 | 1483 | |
1484 | - $newmenu->add("/fourn/paiement/list.php?leftmenu=suppliers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_payment'); |
|
1484 | + $newmenu->add("/fourn/paiement/list.php?leftmenu=suppliers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_payment'); |
|
1485 | 1485 | |
1486 | 1486 | if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) { |
1487 | - $newmenu->add("/fourn/facture/rapport.php?leftmenu=suppliers_bills_payment_report", $langs->trans("Reportings"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_payment_report'); |
|
1487 | + $newmenu->add("/fourn/facture/rapport.php?leftmenu=suppliers_bills_payment_report", $langs->trans("Reportings"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_payment_report'); |
|
1488 | 1488 | } |
1489 | 1489 | |
1490 | - $newmenu->add("/compta/facture/stats/index.php?mode=supplier&leftmenu=suppliers_bills_stats", $langs->trans("Statistics"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_stats'); |
|
1490 | + $newmenu->add("/compta/facture/stats/index.php?mode=supplier&leftmenu=suppliers_bills_stats", $langs->trans("Statistics"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_stats'); |
|
1491 | 1491 | } |
1492 | 1492 | |
1493 | 1493 | // Orders |
1494 | 1494 | if (isModEnabled('commande')) { |
1495 | 1495 | $langs->load("orders"); |
1496 | 1496 | if (isModEnabled('facture')) { |
1497 | - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); |
|
1497 | + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); |
|
1498 | 1498 | } |
1499 | 1499 | //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande', 'lire')); |
1500 | 1500 | } |
@@ -1503,7 +1503,7 @@ discard block |
||
1503 | 1503 | if (isModEnabled('supplier_invoice')) { |
1504 | 1504 | if (!empty($conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE)) { |
1505 | 1505 | $langs->load("supplier"); |
1506 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); |
|
1506 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); |
|
1507 | 1507 | //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande', 'lire')); |
1508 | 1508 | } |
1509 | 1509 | } |
@@ -1512,58 +1512,58 @@ discard block |
||
1512 | 1512 | // Donations |
1513 | 1513 | if (isModEnabled('don')) { |
1514 | 1514 | $langs->load("donations"); |
1515 | - $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing", $langs->trans("Donations"), 0, $user->hasRight('don', 'lire'), '', $mainmenu, 'donations', 0, '', '', '', img_picto('', 'donation', 'class="paddingright pictofixedwidth"')); |
|
1515 | + $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing", $langs->trans("Donations"), 0, $user->hasRight('don', 'lire'), '', $mainmenu, 'donations', 0, '', '', '', img_picto('', 'donation', 'class="paddingright pictofixedwidth"')); |
|
1516 | 1516 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "donations") { |
1517 | - $newmenu->add("/don/card.php?leftmenu=donations&action=create", $langs->trans("NewDonation"), 1, $user->hasRight('don', 'creer')); |
|
1518 | - $newmenu->add("/don/list.php?leftmenu=donations", $langs->trans("List"), 1, $user->hasRight('don', 'lire')); |
|
1517 | + $newmenu->add("/don/card.php?leftmenu=donations&action=create", $langs->trans("NewDonation"), 1, $user->hasRight('don', 'creer')); |
|
1518 | + $newmenu->add("/don/list.php?leftmenu=donations", $langs->trans("List"), 1, $user->hasRight('don', 'lire')); |
|
1519 | 1519 | } |
1520 | 1520 | // if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",$langs->trans("Statistics"), 1, $user->hasRight('don', 'lire')); |
1521 | 1521 | } |
1522 | 1522 | |
1523 | 1523 | // Taxes and social contributions |
1524 | 1524 | if (isModEnabled('tax')) { |
1525 | - $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $user->hasRight('tax', 'charges', 'lire'), '', $mainmenu, 'tax', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1525 | + $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $user->hasRight('tax', 'charges', 'lire'), '', $mainmenu, 'tax', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1526 | 1526 | |
1527 | - $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->hasRight('tax', 'charges', 'lire')); |
|
1527 | + $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->hasRight('tax', 'charges', 'lire')); |
|
1528 | 1528 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i', $leftmenu)) { |
1529 | - $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create", $langs->trans("MenuNewSocialContribution"), 2, $user->hasRight('tax', 'charges', 'creer')); |
|
1530 | - $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1531 | - $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing", $langs->trans("Payments"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1529 | + $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create", $langs->trans("MenuNewSocialContribution"), 2, $user->hasRight('tax', 'charges', 'creer')); |
|
1530 | + $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1531 | + $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing", $langs->trans("Payments"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1532 | 1532 | } |
1533 | 1533 | // VAT |
1534 | 1534 | if (empty($conf->global->TAX_DISABLE_VAT_MENUS)) { |
1535 | 1535 | global $mysoc; |
1536 | 1536 | |
1537 | - $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing", $langs->transcountry("VAT", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire'), '', $mainmenu, 'tax_vat'); |
|
1537 | + $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing", $langs->transcountry("VAT", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire'), '', $mainmenu, 'tax_vat'); |
|
1538 | 1538 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i', $leftmenu)) { |
1539 | - $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer')); |
|
1540 | - $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1541 | - $newmenu->add("/compta/tva/payments.php?mode=tvaonly&leftmenu=tax_vat", $langs->trans("Payments"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1542 | - $newmenu->add("/compta/tva/index.php?leftmenu=tax_vat", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1543 | - $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1544 | - $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1539 | + $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer')); |
|
1540 | + $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1541 | + $newmenu->add("/compta/tva/payments.php?mode=tvaonly&leftmenu=tax_vat", $langs->trans("Payments"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1542 | + $newmenu->add("/compta/tva/index.php?leftmenu=tax_vat", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1543 | + $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1544 | + $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1545 | 1545 | } |
1546 | 1546 | |
1547 | 1547 | //Local Taxes 1 |
1548 | 1548 | if ($mysoc->useLocalTax(1) && (isset($mysoc->localtax1_assuj) && $mysoc->localtax1_assuj == "1")) { |
1549 | - $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1", $langs->transcountry("LT1", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire')); |
|
1549 | + $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1", $langs->transcountry("LT1", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire')); |
|
1550 | 1550 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i', $leftmenu)) { |
1551 | - $newmenu->add("/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&localTaxType=1", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer')); |
|
1552 | - $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1553 | - $newmenu->add("/compta/localtax/index.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1554 | - $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1555 | - $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1551 | + $newmenu->add("/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&localTaxType=1", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer')); |
|
1552 | + $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1553 | + $newmenu->add("/compta/localtax/index.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1554 | + $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1555 | + $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1556 | 1556 | } |
1557 | 1557 | } |
1558 | 1558 | //Local Taxes 2 |
1559 | 1559 | if ($mysoc->useLocalTax(2) && (isset($mysoc->localtax2_assuj) && $mysoc->localtax2_assuj == "1")) { |
1560 | - $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2", $langs->transcountry("LT2", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire')); |
|
1560 | + $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2", $langs->transcountry("LT2", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire')); |
|
1561 | 1561 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i', $leftmenu)) { |
1562 | - $newmenu->add("/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&localTaxType=2", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer')); |
|
1563 | - $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1564 | - $newmenu->add("/compta/localtax/index.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1565 | - $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1566 | - $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1562 | + $newmenu->add("/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&localTaxType=2", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer')); |
|
1563 | + $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1564 | + $newmenu->add("/compta/localtax/index.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1565 | + $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1566 | + $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1567 | 1567 | } |
1568 | 1568 | } |
1569 | 1569 | } |
@@ -1572,21 +1572,21 @@ discard block |
||
1572 | 1572 | // Salaries |
1573 | 1573 | if (isModEnabled('salaries')) { |
1574 | 1574 | $langs->load("salaries"); |
1575 | - $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 0, $user->hasRight('salaries', 'read'), '', $mainmenu, 'tax_salary', 0, '', '', '', img_picto('', 'salary', 'class="paddingright pictofixedwidth"')); |
|
1575 | + $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 0, $user->hasRight('salaries', 'read'), '', $mainmenu, 'tax_salary', 0, '', '', '', img_picto('', 'salary', 'class="paddingright pictofixedwidth"')); |
|
1576 | 1576 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i', $leftmenu)) { |
1577 | - $newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("New"), 1, $user->hasRight('salaries', 'write')); |
|
1578 | - $newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("List"), 1, $user->hasRight('salaries', 'read')); |
|
1579 | - $newmenu->add("/salaries/payments.php?leftmenu=tax_salary", $langs->trans("Payments"), 1, $user->hasRight('salaries', 'read')); |
|
1580 | - $newmenu->add("/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 1, $user->hasRight('salaries', 'read')); |
|
1577 | + $newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("New"), 1, $user->hasRight('salaries', 'write')); |
|
1578 | + $newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("List"), 1, $user->hasRight('salaries', 'read')); |
|
1579 | + $newmenu->add("/salaries/payments.php?leftmenu=tax_salary", $langs->trans("Payments"), 1, $user->hasRight('salaries', 'read')); |
|
1580 | + $newmenu->add("/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 1, $user->hasRight('salaries', 'read')); |
|
1581 | 1581 | } |
1582 | 1582 | } |
1583 | 1583 | |
1584 | 1584 | // Loan |
1585 | 1585 | if (isModEnabled('loan')) { |
1586 | 1586 | $langs->load("loan"); |
1587 | - $newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 0, $user->hasRight('loan', 'read'), '', $mainmenu, 'tax_loan', 0, '', '', '', img_picto('', 'loan', 'class="paddingright pictofixedwidth"')); |
|
1587 | + $newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 0, $user->hasRight('loan', 'read'), '', $mainmenu, 'tax_loan', 0, '', '', '', img_picto('', 'loan', 'class="paddingright pictofixedwidth"')); |
|
1588 | 1588 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i', $leftmenu)) { |
1589 | - $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 1, $user->hasRight('loan', 'write')); |
|
1589 | + $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 1, $user->hasRight('loan', 'write')); |
|
1590 | 1590 | //$newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->hasRight('loan', 'read')); |
1591 | 1591 | } |
1592 | 1592 | } |
@@ -1594,10 +1594,10 @@ discard block |
||
1594 | 1594 | // Various payment |
1595 | 1595 | if (isModEnabled('banque') && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) { |
1596 | 1596 | $langs->load("banks"); |
1597 | - $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'tax_various', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1597 | + $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'tax_various', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1598 | 1598 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i', $leftmenu)) { |
1599 | - $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans("New"), 1, $user->hasRight('banque', 'modifier')); |
|
1600 | - $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans("List"), 1, $user->hasRight('banque', 'lire')); |
|
1599 | + $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans("New"), 1, $user->hasRight('banque', 'modifier')); |
|
1600 | + $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans("List"), 1, $user->hasRight('banque', 'lire')); |
|
1601 | 1601 | } |
1602 | 1602 | } |
1603 | 1603 | } |
@@ -1627,71 +1627,71 @@ discard block |
||
1627 | 1627 | //$newmenu->add("/accountancy/index.php?leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy'); |
1628 | 1628 | |
1629 | 1629 | // Configuration |
1630 | - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 0, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin', 1, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); |
|
1630 | + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 0, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin', 1, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); |
|
1631 | 1631 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/', $leftmenu)) { |
1632 | 1632 | global $mysoc; |
1633 | - $newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_general', 10); |
|
1633 | + $newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_general', 10); |
|
1634 | 1634 | |
1635 | 1635 | // Fiscal year - Not really yet used. In a future will lock some periods. |
1636 | 1636 | if ($conf->global->MAIN_FEATURES_LEVEL > 1) { |
1637 | - $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 1, $user->hasRight('accounting', 'fiscalyear', 'write'), '', $mainmenu, 'fiscalyear', 20); |
|
1637 | + $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 1, $user->hasRight('accounting', 'fiscalyear', 'write'), '', $mainmenu, 'fiscalyear', 20); |
|
1638 | 1638 | } |
1639 | 1639 | |
1640 | - $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_journal', 30); |
|
1641 | - $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chartmodel', 40); |
|
1642 | - $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41); |
|
1643 | - $newmenu->add("/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ChartOfSubaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41); |
|
1644 | - $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 60); |
|
1640 | + $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_journal', 30); |
|
1641 | + $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chartmodel', 40); |
|
1642 | + $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41); |
|
1643 | + $newmenu->add("/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ChartOfSubaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41); |
|
1644 | + $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 60); |
|
1645 | 1645 | if (isModEnabled('banque')) { |
1646 | - $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_bank', 70); |
|
1646 | + $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_bank', 70); |
|
1647 | 1647 | } |
1648 | 1648 | if (isModEnabled('facture') || isModEnabled('supplier_invoice')) { |
1649 | - $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 80); |
|
1649 | + $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 80); |
|
1650 | 1650 | } |
1651 | 1651 | if (isModEnabled('tax')) { |
1652 | - $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 90); |
|
1652 | + $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 90); |
|
1653 | 1653 | } |
1654 | 1654 | if (isModEnabled('expensereport')) { |
1655 | - $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 100); |
|
1655 | + $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 100); |
|
1656 | 1656 | } |
1657 | - $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_product', 110); |
|
1657 | + $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_product', 110); |
|
1658 | 1658 | if ($conf->global->MAIN_FEATURES_LEVEL > 1) { |
1659 | - $newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_closure', 120); |
|
1659 | + $newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_closure', 120); |
|
1660 | 1660 | } |
1661 | - $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 125); |
|
1662 | - $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_export', 130); |
|
1661 | + $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 125); |
|
1662 | + $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_export', 130); |
|
1663 | 1663 | } |
1664 | 1664 | |
1665 | 1665 | // Transfer in accounting |
1666 | - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_transfer", $langs->trans("TransferInAccounting"), 0, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'transfer', 1, '', '', '', img_picto('', 'long-arrow-alt-right', 'class="paddingright pictofixedwidth"')); |
|
1666 | + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_transfer", $langs->trans("TransferInAccounting"), 0, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'transfer', 1, '', '', '', img_picto('', 'long-arrow-alt-right', 'class="paddingright pictofixedwidth"')); |
|
1667 | 1667 | |
1668 | 1668 | // Binding |
1669 | 1669 | // $newmenu->add("", $langs->trans("Binding"), 0, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch'); |
1670 | 1670 | if (isModEnabled('facture') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { |
1671 | - $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_customer'); |
|
1671 | + $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_customer'); |
|
1672 | 1672 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/', $leftmenu)) { |
1673 | - $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1674 | - $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1673 | + $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1674 | + $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1675 | 1675 | } |
1676 | 1676 | } |
1677 | 1677 | if (isModEnabled('supplier_invoice') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { |
1678 | - $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", $langs->trans("SuppliersVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_supplier'); |
|
1678 | + $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", $langs->trans("SuppliersVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_supplier'); |
|
1679 | 1679 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/', $leftmenu)) { |
1680 | - $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1681 | - $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1680 | + $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1681 | + $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1682 | 1682 | } |
1683 | 1683 | } |
1684 | 1684 | if (isModEnabled('expensereport') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { |
1685 | - $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_expensereport'); |
|
1685 | + $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_expensereport'); |
|
1686 | 1686 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/', $leftmenu)) { |
1687 | - $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1688 | - $newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1687 | + $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1688 | + $newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1689 | 1689 | } |
1690 | 1690 | } |
1691 | 1691 | |
1692 | 1692 | // Journals |
1693 | - if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { |
|
1694 | - $newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'accountancy_journal'); |
|
1693 | + if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { |
|
1694 | + $newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'accountancy_journal'); |
|
1695 | 1695 | |
1696 | 1696 | // Multi journal |
1697 | 1697 | $sql = "SELECT rowid, code, label, nature"; |
@@ -1727,7 +1727,7 @@ discard block |
||
1727 | 1727 | $nature = "expensereports"; |
1728 | 1728 | } |
1729 | 1729 | if ($objp->nature == 1 && isModEnabled('asset')) { |
1730 | - $nature = "various"; // Warning: The page /accountancy/journal/variousjournal.php is bugged. It read tables that does not exists. |
|
1730 | + $nature = "various"; // Warning: The page /accountancy/journal/variousjournal.php is bugged. It read tables that does not exists. |
|
1731 | 1731 | } |
1732 | 1732 | if ($objp->nature == 8) { |
1733 | 1733 | $nature = "inventory"; |
@@ -1751,16 +1751,16 @@ discard block |
||
1751 | 1751 | $journallabel = '<span class="opacitymedium">('.$langs->trans($objp->label).')</span>'; // Label of bank account in llx_accounting_journal |
1752 | 1752 | } |
1753 | 1753 | |
1754 | - $key = $langs->trans("AccountingJournalType".$objp->nature); // $objp->nature is 1, 2, 3 ... |
|
1755 | - $transferlabel = (($objp->nature && $key != "AccountingJournalType".$objp->nature) ? $key.($journallabelwithoutspan != $key ? ' '.$journallabel : ''): $journallabel); |
|
1754 | + $key = $langs->trans("AccountingJournalType".$objp->nature); // $objp->nature is 1, 2, 3 ... |
|
1755 | + $transferlabel = (($objp->nature && $key != "AccountingJournalType".$objp->nature) ? $key.($journallabelwithoutspan != $key ? ' '.$journallabel : '') : $journallabel); |
|
1756 | 1756 | |
1757 | - $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $transferlabel, 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1757 | + $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $transferlabel, 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1758 | 1758 | } |
1759 | 1759 | $i++; |
1760 | 1760 | } |
1761 | 1761 | } else { |
1762 | 1762 | // Should not happend. Entries are added |
1763 | - $newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1763 | + $newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1764 | 1764 | } |
1765 | 1765 | } else { |
1766 | 1766 | dol_print_error($db); |
@@ -1770,48 +1770,48 @@ discard block |
||
1770 | 1770 | |
1771 | 1771 | // Files |
1772 | 1772 | if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) { |
1773 | - $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1773 | + $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1774 | 1774 | } |
1775 | 1775 | |
1776 | 1776 | |
1777 | 1777 | // Accounting |
1778 | - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); |
|
1778 | + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); |
|
1779 | 1779 | |
1780 | 1780 | // General Ledger |
1781 | - $newmenu->add("/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Bookkeeping"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1781 | + $newmenu->add("/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Bookkeeping"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1782 | 1782 | |
1783 | 1783 | // Journals |
1784 | - $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Journals"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1784 | + $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Journals"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1785 | 1785 | |
1786 | 1786 | // Account Balance |
1787 | - $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1787 | + $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1788 | 1788 | |
1789 | 1789 | // Export accountancy |
1790 | - $newmenu->add("/accountancy/bookkeeping/export.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("MenuExportAccountancy"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1790 | + $newmenu->add("/accountancy/bookkeeping/export.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("MenuExportAccountancy"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1791 | 1791 | |
1792 | 1792 | // Closure |
1793 | - $newmenu->add("/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure", $langs->trans("MenuAccountancyClosure"), 1, $user->hasRight('accounting', 'fiscalyear', 'write'), '', $mainmenu, 'closure'); |
|
1793 | + $newmenu->add("/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure", $langs->trans("MenuAccountancyClosure"), 1, $user->hasRight('accounting', 'fiscalyear', 'write'), '', $mainmenu, 'closure'); |
|
1794 | 1794 | |
1795 | 1795 | // Reports |
1796 | - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'ca'); |
|
1796 | + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'ca'); |
|
1797 | 1797 | |
1798 | 1798 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { |
1799 | - $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report", $langs->trans("MenuReportInOut"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1800 | - $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report", $langs->trans("ByPredefinedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1801 | - $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1799 | + $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report", $langs->trans("MenuReportInOut"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1800 | + $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report", $langs->trans("ByPredefinedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1801 | + $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1802 | 1802 | } |
1803 | 1803 | |
1804 | 1804 | $modecompta = 'CREANCES-DETTES'; |
1805 | - if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { |
|
1805 | + if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { |
|
1806 | 1806 | $modecompta = 'BOOKKEEPING'; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED |
1807 | 1807 | } |
1808 | 1808 | if ($modecompta) { |
1809 | 1809 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { |
1810 | - $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1811 | - $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1812 | - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1813 | - $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1814 | - $newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1810 | + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1811 | + $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1812 | + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1813 | + $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1814 | + $newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1815 | 1815 | } |
1816 | 1816 | } |
1817 | 1817 | |
@@ -1819,34 +1819,34 @@ discard block |
||
1819 | 1819 | //if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED |
1820 | 1820 | if ($modecompta) { |
1821 | 1821 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { |
1822 | - $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1823 | - $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1824 | - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1822 | + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1823 | + $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1824 | + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1825 | 1825 | //$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"),3,$user->hasRight('accounting', 'comptarapport', 'lire')); |
1826 | 1826 | //$newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"),3,$user->hasRight('accounting', 'comptarapport', 'lire')); |
1827 | 1827 | } |
1828 | 1828 | } |
1829 | 1829 | |
1830 | 1830 | $modecompta = 'CREANCES-DETTES'; |
1831 | - if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { |
|
1831 | + if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { |
|
1832 | 1832 | $modecompta = 'BOOKKEEPING'; // Not yet implemented. |
1833 | 1833 | } |
1834 | 1834 | if ($modecompta && isModEnabled('supplier_invoice')) { |
1835 | 1835 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { |
1836 | - $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1837 | - $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1838 | - $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1836 | + $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1837 | + $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1838 | + $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1839 | 1839 | } |
1840 | 1840 | } |
1841 | 1841 | |
1842 | 1842 | $modecompta = 'RECETTES-DEPENSES'; |
1843 | - if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { |
|
1843 | + if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { |
|
1844 | 1844 | $modecompta = 'BOOKKEEPINGCOLLECTED'; // Not yet implemented. |
1845 | 1845 | } |
1846 | 1846 | if ($modecompta && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice'))) { |
1847 | 1847 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { |
1848 | - $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1849 | - $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1848 | + $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1849 | + $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1850 | 1850 | } |
1851 | 1851 | } |
1852 | 1852 | } |
@@ -1855,15 +1855,15 @@ discard block |
||
1855 | 1855 | if (isModEnabled('comptabilite')) { |
1856 | 1856 | // Files |
1857 | 1857 | if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) { |
1858 | - $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->hasRight('compta', 'resultat', 'lire'), '', $mainmenu, 'files', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); |
|
1858 | + $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->hasRight('compta', 'resultat', 'lire'), '', $mainmenu, 'files', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); |
|
1859 | 1859 | } |
1860 | 1860 | |
1861 | 1861 | // Bilan, resultats |
1862 | - $newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->hasRight('compta', 'resultat', 'lire'), '', $mainmenu, 'ca', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); |
|
1862 | + $newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->hasRight('compta', 'resultat', 'lire'), '', $mainmenu, 'ca', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); |
|
1863 | 1863 | |
1864 | 1864 | if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) { |
1865 | - $newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->hasRight('compta', 'resultat', 'lire')); |
|
1866 | - $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1865 | + $newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->hasRight('compta', 'resultat', 'lire')); |
|
1866 | + $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1867 | 1867 | /* On verra ca avec module compabilite expert |
1868 | 1868 | $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->hasRight('compta', 'resultat', 'lire')); |
1869 | 1869 | $newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->hasRight('compta', 'resultat', 'lire')); |
@@ -1878,22 +1878,22 @@ discard block |
||
1878 | 1878 | */ |
1879 | 1879 | |
1880 | 1880 | $modecompta = 'CREANCES-DETTES'; |
1881 | - $newmenu->add("/compta/stats/index.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 1, $user->hasRight('compta', 'resultat', 'lire')); |
|
1882 | - $newmenu->add("/compta/stats/casoc.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1883 | - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1884 | - $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1885 | - $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1881 | + $newmenu->add("/compta/stats/index.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 1, $user->hasRight('compta', 'resultat', 'lire')); |
|
1882 | + $newmenu->add("/compta/stats/casoc.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1883 | + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1884 | + $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1885 | + $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1886 | 1886 | |
1887 | 1887 | $modecompta = 'RECETTES-DEPENSES'; |
1888 | - $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 1, $user->hasRight('compta', 'resultat', 'lire')); |
|
1889 | - $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1890 | - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1888 | + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 1, $user->hasRight('compta', 'resultat', 'lire')); |
|
1889 | + $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1890 | + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1891 | 1891 | |
1892 | 1892 | //Achats |
1893 | 1893 | $modecompta = 'CREANCES-DETTES'; |
1894 | - $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 1, $user->hasRight('compta', 'resultat', 'lire')); |
|
1895 | - $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1896 | - $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1894 | + $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 1, $user->hasRight('compta', 'resultat', 'lire')); |
|
1895 | + $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1896 | + $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1897 | 1897 | |
1898 | 1898 | /* |
1899 | 1899 | $modecompta = 'RECETTES-DEPENSES'; |
@@ -1903,31 +1903,31 @@ discard block |
||
1903 | 1903 | */ |
1904 | 1904 | |
1905 | 1905 | // Journals |
1906 | - $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->hasRight('compta', 'resultat', 'lire'), '', '', '', 50); |
|
1907 | - $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->hasRight('compta', 'resultat', 'lire'), '', '', '', 51); |
|
1906 | + $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->hasRight('compta', 'resultat', 'lire'), '', '', '', 50); |
|
1907 | + $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->hasRight('compta', 'resultat', 'lire'), '', '', '', 51); |
|
1908 | 1908 | } |
1909 | 1909 | //if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journals"),1,$user->hasRight('compta', 'resultat', 'lire')||$user->hasRight('accounting', 'comptarapport', 'lire')); |
1910 | 1910 | } |
1911 | 1911 | |
1912 | 1912 | // Intracomm report |
1913 | 1913 | if (isModEnabled('intracommreport')) { |
1914 | - $newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReport"), 0, $user->hasRight('intracommreport', 'read'), '', $mainmenu, 'intracommreport', 60, '', '', '', img_picto('', 'intracommreport', 'class="paddingright pictofixedwidth"')); |
|
1914 | + $newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReport"), 0, $user->hasRight('intracommreport', 'read'), '', $mainmenu, 'intracommreport', 60, '', '', '', img_picto('', 'intracommreport', 'class="paddingright pictofixedwidth"')); |
|
1915 | 1915 | if ($usemenuhider || empty($leftmenu) || preg_match('/intracommreport/', $leftmenu)) { |
1916 | 1916 | // DEB / DES |
1917 | - $newmenu->add("/intracommreport/card.php?action=create&leftmenu=intracommreport", $langs->trans("MenuIntracommReportNew"), 1, $user->hasRight('intracommreport', 'write'), '', $mainmenu, 'intracommreport', 1); |
|
1918 | - $newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReportList"), 1, $user->hasRight('intracommreport', 'read'), '', $mainmenu, 'intracommreport', 1); |
|
1917 | + $newmenu->add("/intracommreport/card.php?action=create&leftmenu=intracommreport", $langs->trans("MenuIntracommReportNew"), 1, $user->hasRight('intracommreport', 'write'), '', $mainmenu, 'intracommreport', 1); |
|
1918 | + $newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReportList"), 1, $user->hasRight('intracommreport', 'read'), '', $mainmenu, 'intracommreport', 1); |
|
1919 | 1919 | } |
1920 | 1920 | } |
1921 | 1921 | |
1922 | 1922 | // Assets |
1923 | 1923 | if (isModEnabled('asset')) { |
1924 | - $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->hasRight('asset', 'read'), '', $mainmenu, 'asset', 100, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1925 | - $newmenu->add("/asset/card.php?leftmenu=asset&action=create", $langs->trans("MenuNewAsset"), 1, $user->hasRight('asset', 'write')); |
|
1926 | - $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->hasRight('asset', 'read')); |
|
1927 | - $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuAssetModels"), 1, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read')), '', $mainmenu, 'asset_model'); |
|
1924 | + $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->hasRight('asset', 'read'), '', $mainmenu, 'asset', 100, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1925 | + $newmenu->add("/asset/card.php?leftmenu=asset&action=create", $langs->trans("MenuNewAsset"), 1, $user->hasRight('asset', 'write')); |
|
1926 | + $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->hasRight('asset', 'read')); |
|
1927 | + $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuAssetModels"), 1, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read')), '', $mainmenu, 'asset_model'); |
|
1928 | 1928 | if ($usemenuhider || empty($leftmenu) || preg_match('/asset_model/', $leftmenu)) { |
1929 | - $newmenu->add("/asset/model/card.php?leftmenu=asset_model&action=create", $langs->trans("MenuNewAssetModel"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'write'))); |
|
1930 | - $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuListAssetModels"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read'))); |
|
1929 | + $newmenu->add("/asset/model/card.php?leftmenu=asset_model&action=create", $langs->trans("MenuNewAssetModel"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'write'))); |
|
1930 | + $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuListAssetModels"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read'))); |
|
1931 | 1931 | } |
1932 | 1932 | } |
1933 | 1933 | } |
@@ -1953,62 +1953,62 @@ discard block |
||
1953 | 1953 | |
1954 | 1954 | // Bank-Cash account |
1955 | 1955 | if (isModEnabled('banque')) { |
1956 | - $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'bank', 0, '', '', '', img_picto('', 'bank_account', 'class="paddingright pictofixedwidth"')); |
|
1956 | + $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'bank', 0, '', '', '', img_picto('', 'bank_account', 'class="paddingright pictofixedwidth"')); |
|
1957 | 1957 | |
1958 | - $newmenu->add("/compta/bank/card.php?action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->hasRight('banque', 'configurer')); |
|
1959 | - $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('banque', 'lire'), '', $mainmenu, 'bank'); |
|
1960 | - $newmenu->add("/compta/bank/bankentries_list.php", $langs->trans("ListTransactions"), 1, $user->hasRight('banque', 'lire')); |
|
1961 | - $newmenu->add("/compta/bank/budget.php", $langs->trans("ListTransactionsByCategory"), 1, $user->hasRight('banque', 'lire')); |
|
1958 | + $newmenu->add("/compta/bank/card.php?action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->hasRight('banque', 'configurer')); |
|
1959 | + $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('banque', 'lire'), '', $mainmenu, 'bank'); |
|
1960 | + $newmenu->add("/compta/bank/bankentries_list.php", $langs->trans("ListTransactions"), 1, $user->hasRight('banque', 'lire')); |
|
1961 | + $newmenu->add("/compta/bank/budget.php", $langs->trans("ListTransactionsByCategory"), 1, $user->hasRight('banque', 'lire')); |
|
1962 | 1962 | |
1963 | - $newmenu->add("/compta/bank/transfer.php", $langs->trans("MenuBankInternalTransfer"), 1, $user->hasRight('banque', 'transfer')); |
|
1963 | + $newmenu->add("/compta/bank/transfer.php", $langs->trans("MenuBankInternalTransfer"), 1, $user->hasRight('banque', 'transfer')); |
|
1964 | 1964 | } |
1965 | 1965 | |
1966 | 1966 | if (isModEnabled('categorie')) { |
1967 | 1967 | $langs->load("categories"); |
1968 | - $newmenu->add("/categories/index.php?type=5", $langs->trans("Rubriques"), 1, $user->hasRight('categorie', 'creer'), '', $mainmenu, 'tags'); |
|
1969 | - $newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->hasRight('banque', 'configurer'), '', $mainmenu, 'tags'); |
|
1968 | + $newmenu->add("/categories/index.php?type=5", $langs->trans("Rubriques"), 1, $user->hasRight('categorie', 'creer'), '', $mainmenu, 'tags'); |
|
1969 | + $newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->hasRight('banque', 'configurer'), '', $mainmenu, 'tags'); |
|
1970 | 1970 | } |
1971 | 1971 | |
1972 | 1972 | // Direct debit order |
1973 | 1973 | if (isModEnabled('prelevement')) { |
1974 | - $newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank", $langs->trans("PaymentByDirectDebit"), 0, $user->hasRight('prelevement', 'bons', 'lire'), '', $mainmenu, 'withdraw', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1974 | + $newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank", $langs->trans("PaymentByDirectDebit"), 0, $user->hasRight('prelevement', 'bons', 'lire'), '', $mainmenu, 'withdraw', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1975 | 1975 | |
1976 | 1976 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "withdraw") { |
1977 | - $newmenu->add("/compta/prelevement/create.php?mainmenu=bank", $langs->trans("NewStandingOrder"), 1, $user->hasRight('prelevement', 'bons', 'creer')); |
|
1977 | + $newmenu->add("/compta/prelevement/create.php?mainmenu=bank", $langs->trans("NewStandingOrder"), 1, $user->hasRight('prelevement', 'bons', 'creer')); |
|
1978 | 1978 | |
1979 | - $newmenu->add("/compta/prelevement/orders_list.php?mainmenu=bank", $langs->trans("WithdrawalsReceipts"), 1, $user->hasRight('prelevement', 'bons', 'lire')); |
|
1980 | - $newmenu->add("/compta/prelevement/list.php?mainmenu=bank", $langs->trans("WithdrawalsLines"), 1, $user->hasRight('prelevement', 'bons', 'lire')); |
|
1981 | - $newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->hasRight('prelevement', 'bons', 'lire')); |
|
1982 | - $newmenu->add("/compta/prelevement/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->hasRight('prelevement', 'bons', 'lire')); |
|
1979 | + $newmenu->add("/compta/prelevement/orders_list.php?mainmenu=bank", $langs->trans("WithdrawalsReceipts"), 1, $user->hasRight('prelevement', 'bons', 'lire')); |
|
1980 | + $newmenu->add("/compta/prelevement/list.php?mainmenu=bank", $langs->trans("WithdrawalsLines"), 1, $user->hasRight('prelevement', 'bons', 'lire')); |
|
1981 | + $newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->hasRight('prelevement', 'bons', 'lire')); |
|
1982 | + $newmenu->add("/compta/prelevement/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->hasRight('prelevement', 'bons', 'lire')); |
|
1983 | 1983 | } |
1984 | 1984 | } |
1985 | 1985 | |
1986 | 1986 | // Bank transfer order |
1987 | 1987 | if (isModEnabled('paymentbybanktransfer')) { |
1988 | - $newmenu->add("/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&mainmenu=bank", $langs->trans("PaymentByBankTransfer"), 0, $user->hasRight('paymentbybanktransfer', 'read'), '', $mainmenu, 'banktransfer', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1988 | + $newmenu->add("/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&mainmenu=bank", $langs->trans("PaymentByBankTransfer"), 0, $user->hasRight('paymentbybanktransfer', 'read'), '', $mainmenu, 'banktransfer', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1989 | 1989 | |
1990 | 1990 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "banktransfer") { |
1991 | - $newmenu->add("/compta/prelevement/create.php?type=bank-transfer&mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->hasRight('paymentbybanktransfer', 'create')); |
|
1991 | + $newmenu->add("/compta/prelevement/create.php?type=bank-transfer&mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->hasRight('paymentbybanktransfer', 'create')); |
|
1992 | 1992 | |
1993 | - $newmenu->add("/compta/prelevement/orders_list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->hasRight('paymentbybanktransfer', 'read')); |
|
1994 | - $newmenu->add("/compta/prelevement/list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->hasRight('paymentbybanktransfer', 'read')); |
|
1995 | - $newmenu->add("/compta/prelevement/rejets.php?type=bank-transfer&mainmenu=bank", $langs->trans("Rejects"), 1, $user->hasRight('paymentbybanktransfer', 'read')); |
|
1996 | - $newmenu->add("/compta/prelevement/stats.php?type=bank-transfer&mainmenu=bank", $langs->trans("Statistics"), 1, $user->hasRight('paymentbybanktransfer', 'read')); |
|
1993 | + $newmenu->add("/compta/prelevement/orders_list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->hasRight('paymentbybanktransfer', 'read')); |
|
1994 | + $newmenu->add("/compta/prelevement/list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->hasRight('paymentbybanktransfer', 'read')); |
|
1995 | + $newmenu->add("/compta/prelevement/rejets.php?type=bank-transfer&mainmenu=bank", $langs->trans("Rejects"), 1, $user->hasRight('paymentbybanktransfer', 'read')); |
|
1996 | + $newmenu->add("/compta/prelevement/stats.php?type=bank-transfer&mainmenu=bank", $langs->trans("Statistics"), 1, $user->hasRight('paymentbybanktransfer', 'read')); |
|
1997 | 1997 | } |
1998 | 1998 | } |
1999 | 1999 | |
2000 | 2000 | // Management of checks |
2001 | 2001 | if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled('banque') && (isModEnabled('facture') || !empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))) { |
2002 | - $newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->hasRight('banque', 'cheque'), '', $mainmenu, 'checks', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
2002 | + $newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->hasRight('banque', 'cheque'), '', $mainmenu, 'checks', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
2003 | 2003 | if (preg_match('/checks/', $leftmenu)) { |
2004 | - $newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->hasRight('banque', 'cheque')); |
|
2005 | - $newmenu->add("/compta/paiement/cheque/list.php?leftmenu=checks_bis&mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('banque', 'cheque')); |
|
2004 | + $newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->hasRight('banque', 'cheque')); |
|
2005 | + $newmenu->add("/compta/paiement/cheque/list.php?leftmenu=checks_bis&mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('banque', 'cheque')); |
|
2006 | 2006 | } |
2007 | 2007 | } |
2008 | 2008 | |
2009 | 2009 | // Cash Control |
2010 | 2010 | if (isModEnabled('takepos') || isModEnabled('cashdesk')) { |
2011 | - $permtomakecashfence = ($user->hasRight('cashdesk', 'run')|| $user->hasRight('takepos', 'run')); |
|
2011 | + $permtomakecashfence = ($user->hasRight('cashdesk', 'run') || $user->hasRight('takepos', 'run')); |
|
2012 | 2012 | $newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list", $langs->trans("POS"), 0, $permtomakecashfence, '', $mainmenu, 'cashcontrol', 0, '', '', '', img_picto('', 'pos', 'class="pictofixedwidth"')); |
2013 | 2013 | $newmenu->add("/compta/cashcontrol/cashcontrol_card.php?action=create", $langs->trans("NewCashFence"), 1, $permtomakecashfence); |
2014 | 2014 | $newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list", $langs->trans("List"), 1, $permtomakecashfence); |
@@ -2033,47 +2033,47 @@ discard block |
||
2033 | 2033 | if ($mainmenu == 'products') { |
2034 | 2034 | // Products |
2035 | 2035 | if (isModEnabled('product')) { |
2036 | - $newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->hasRight('product', 'read'), '', $mainmenu, 'product', 0, '', '', '', img_picto('', 'product', 'class="pictofixedwidth"')); |
|
2037 | - $newmenu->add("/product/card.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->hasRight('product', 'creer')); |
|
2038 | - $newmenu->add("/product/list.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->hasRight('product', 'read')); |
|
2036 | + $newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->hasRight('product', 'read'), '', $mainmenu, 'product', 0, '', '', '', img_picto('', 'product', 'class="pictofixedwidth"')); |
|
2037 | + $newmenu->add("/product/card.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->hasRight('product', 'creer')); |
|
2038 | + $newmenu->add("/product/list.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->hasRight('product', 'read')); |
|
2039 | 2039 | if (isModEnabled('stock')) { |
2040 | - $newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); |
|
2040 | + $newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); |
|
2041 | 2041 | } |
2042 | 2042 | if (isModEnabled('productbatch')) { |
2043 | 2043 | $langs->load("stocks"); |
2044 | - $newmenu->add("/product/reassortlot.php?type=0&search_subjecttolotserial=1", $langs->trans("StocksByLotSerial"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); |
|
2045 | - $newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); |
|
2044 | + $newmenu->add("/product/reassortlot.php?type=0&search_subjecttolotserial=1", $langs->trans("StocksByLotSerial"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); |
|
2045 | + $newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); |
|
2046 | 2046 | } |
2047 | 2047 | if (isModEnabled('variants')) { |
2048 | - $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('product', 'read')); |
|
2048 | + $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('product', 'read')); |
|
2049 | 2049 | } |
2050 | 2050 | if (isModEnabled('propal') || isModEnabled('commande') || isModEnabled('facture') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { |
2051 | - $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->hasRight('product', 'read')); |
|
2051 | + $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->hasRight('product', 'read')); |
|
2052 | 2052 | } |
2053 | 2053 | |
2054 | 2054 | // Categories |
2055 | 2055 | if (isModEnabled('categorie')) { |
2056 | 2056 | $langs->load("categories"); |
2057 | - $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
2057 | + $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
2058 | 2058 | //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->hasRight('categorie', 'lire')); |
2059 | 2059 | } |
2060 | 2060 | } |
2061 | 2061 | |
2062 | 2062 | // Services |
2063 | 2063 | if (isModEnabled('service')) { |
2064 | - $newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->hasRight('service', 'read'), '', $mainmenu, 'service', 0, '', '', '', img_picto('', 'service', 'class="pictofixedwidth"')); |
|
2065 | - $newmenu->add("/product/card.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->hasRight('service', 'creer')); |
|
2066 | - $newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->hasRight('service', 'read')); |
|
2064 | + $newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->hasRight('service', 'read'), '', $mainmenu, 'service', 0, '', '', '', img_picto('', 'service', 'class="pictofixedwidth"')); |
|
2065 | + $newmenu->add("/product/card.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->hasRight('service', 'creer')); |
|
2066 | + $newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->hasRight('service', 'read')); |
|
2067 | 2067 | if (isModEnabled('variants')) { |
2068 | - $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('service', 'read')); |
|
2068 | + $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('service', 'read')); |
|
2069 | 2069 | } |
2070 | 2070 | if (isModEnabled('propal') || isModEnabled('commande') || isModEnabled('facture') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { |
2071 | - $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->hasRight('service', 'read')); |
|
2071 | + $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->hasRight('service', 'read')); |
|
2072 | 2072 | } |
2073 | 2073 | // Categories |
2074 | 2074 | if (isModEnabled('categorie')) { |
2075 | 2075 | $langs->load("categories"); |
2076 | - $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
2076 | + $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
2077 | 2077 | //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->hasRight('categorie', 'lire')); |
2078 | 2078 | } |
2079 | 2079 | } |
@@ -2083,41 +2083,41 @@ discard block |
||
2083 | 2083 | $langs->load("stocks"); |
2084 | 2084 | $newmenu->add("/product/stock/index.php?leftmenu=stock", $langs->trans("Warehouses"), 0, $user->hasRight('stock', 'lire'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'stock', 'class="pictofixedwidth"')); |
2085 | 2085 | $newmenu->add("/product/stock/card.php?action=create", $langs->trans("MenuNewWarehouse"), 1, $user->hasRight('stock', 'creer')); |
2086 | - $newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->hasRight('stock', 'lire')); |
|
2086 | + $newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->hasRight('stock', 'lire')); |
|
2087 | 2087 | $newmenu->add("/product/stock/movement_list.php", $langs->trans("Movements"), 1, $user->hasRight('stock', 'mouvement', 'lire')); |
2088 | 2088 | |
2089 | 2089 | $newmenu->add("/product/stock/massstockmove.php?init=1", $langs->trans("MassStockTransferShort"), 1, $user->hasRight('stock', 'mouvement', 'creer')); |
2090 | 2090 | if (isModEnabled('supplier_order')) { |
2091 | - $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->hasRight('stock', 'mouvement', 'creer') && $user->hasRight('fournisseur', 'lire')); |
|
2091 | + $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->hasRight('stock', 'mouvement', 'creer') && $user->hasRight('fournisseur', 'lire')); |
|
2092 | 2092 | } |
2093 | 2093 | $newmenu->add("/product/stock/stockatdate.php", $langs->trans("StockAtDate"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); |
2094 | 2094 | |
2095 | 2095 | // Categories for warehouses |
2096 | 2096 | if (isModEnabled('categorie')) { |
2097 | - $newmenu->add("/categories/index.php?leftmenu=stock&type=9", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
2097 | + $newmenu->add("/categories/index.php?leftmenu=stock&type=9", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
2098 | 2098 | } |
2099 | 2099 | } |
2100 | 2100 | |
2101 | 2101 | if (isModEnabled('stocktransfer')) { |
2102 | - $newmenu->add('/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans("ModuleStockTransferName"), 0, $user->hasRight('stocktransfer', 'stocktransfer', 'read'), '', $mainmenu, 'stocktransfer', 0, '', '', '', img_picto('', 'stock', 'class="pictofixedwidth"')); |
|
2103 | - $newmenu->add('/product/stock/stocktransfer/stocktransfer_card.php?action=create', $langs->trans('StockTransferNew'), 1, $user->hasRight('stocktransfer', 'stocktransfer', 'write')); |
|
2104 | - $newmenu->add('/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans('List'), 1, $user->hasRight('stocktransfer', 'stocktransfer', 'read')); |
|
2102 | + $newmenu->add('/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans("ModuleStockTransferName"), 0, $user->hasRight('stocktransfer', 'stocktransfer', 'read'), '', $mainmenu, 'stocktransfer', 0, '', '', '', img_picto('', 'stock', 'class="pictofixedwidth"')); |
|
2103 | + $newmenu->add('/product/stock/stocktransfer/stocktransfer_card.php?action=create', $langs->trans('StockTransferNew'), 1, $user->hasRight('stocktransfer', 'stocktransfer', 'write')); |
|
2104 | + $newmenu->add('/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans('List'), 1, $user->hasRight('stocktransfer', 'stocktransfer', 'read')); |
|
2105 | 2105 | } |
2106 | 2106 | |
2107 | 2107 | // Inventory |
2108 | 2108 | if (isModEnabled('stock')) { |
2109 | 2109 | $langs->load("stocks"); |
2110 | 2110 | if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { |
2111 | - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->hasRight('stock', 'lire'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); |
|
2111 | + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->hasRight('stock', 'lire'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); |
|
2112 | 2112 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { |
2113 | - $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->hasRight('stock', 'creer')); |
|
2114 | - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->hasRight('stock', 'lire')); |
|
2113 | + $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->hasRight('stock', 'creer')); |
|
2114 | + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->hasRight('stock', 'lire')); |
|
2115 | 2115 | } |
2116 | 2116 | } else { |
2117 | - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->hasRight('stock', 'inventory_advance', 'read'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); |
|
2117 | + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->hasRight('stock', 'inventory_advance', 'read'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); |
|
2118 | 2118 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { |
2119 | - $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->hasRight('stock', 'inventory_advance', 'write')); |
|
2120 | - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->hasRight('stock', 'inventory_advance', 'read')); |
|
2119 | + $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->hasRight('stock', 'inventory_advance', 'write')); |
|
2120 | + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->hasRight('stock', 'inventory_advance', 'read')); |
|
2121 | 2121 | } |
2122 | 2122 | } |
2123 | 2123 | } |
@@ -2125,33 +2125,33 @@ discard block |
||
2125 | 2125 | // Shipments |
2126 | 2126 | if (isModEnabled('expedition')) { |
2127 | 2127 | $langs->load("sendings"); |
2128 | - $newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->hasRight('expedition', 'lire'), '', $mainmenu, 'sendings', 0, '', '', '', img_picto('', 'shipment', 'class="pictofixedwidth"')); |
|
2129 | - $newmenu->add("/expedition/card.php?action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->hasRight('expedition', 'creer')); |
|
2130 | - $newmenu->add("/expedition/list.php?leftmenu=sendings", $langs->trans("List"), 1, $user->hasRight('expedition', 'lire')); |
|
2128 | + $newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->hasRight('expedition', 'lire'), '', $mainmenu, 'sendings', 0, '', '', '', img_picto('', 'shipment', 'class="pictofixedwidth"')); |
|
2129 | + $newmenu->add("/expedition/card.php?action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->hasRight('expedition', 'creer')); |
|
2130 | + $newmenu->add("/expedition/list.php?leftmenu=sendings", $langs->trans("List"), 1, $user->hasRight('expedition', 'lire')); |
|
2131 | 2131 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "sendings") { |
2132 | - $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=0", $langs->trans("StatusSendingDraftShort"), 2, $user->hasRight('expedition', 'lire')); |
|
2133 | - $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=1", $langs->trans("StatusSendingValidatedShort"), 2, $user->hasRight('expedition', 'lire')); |
|
2134 | - $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->hasRight('expedition', 'lire')); |
|
2132 | + $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=0", $langs->trans("StatusSendingDraftShort"), 2, $user->hasRight('expedition', 'lire')); |
|
2133 | + $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=1", $langs->trans("StatusSendingValidatedShort"), 2, $user->hasRight('expedition', 'lire')); |
|
2134 | + $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->hasRight('expedition', 'lire')); |
|
2135 | 2135 | } |
2136 | - $newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->hasRight('expedition', 'lire')); |
|
2136 | + $newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->hasRight('expedition', 'lire')); |
|
2137 | 2137 | } |
2138 | 2138 | |
2139 | 2139 | // Receptions |
2140 | 2140 | if (isModEnabled('reception')) { |
2141 | 2141 | $langs->load("receptions"); |
2142 | - $newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->hasRight('reception', 'lire'), '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="pictofixedwidth"')); |
|
2143 | - $newmenu->add("/reception/card.php?action=create2&leftmenu=receptions", $langs->trans("NewReception"), 1, $user->hasRight('reception', 'creer')); |
|
2144 | - $newmenu->add("/reception/list.php?leftmenu=receptions", $langs->trans("List"), 1, $user->hasRight('reception', 'lire')); |
|
2142 | + $newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->hasRight('reception', 'lire'), '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="pictofixedwidth"')); |
|
2143 | + $newmenu->add("/reception/card.php?action=create2&leftmenu=receptions", $langs->trans("NewReception"), 1, $user->hasRight('reception', 'creer')); |
|
2144 | + $newmenu->add("/reception/list.php?leftmenu=receptions", $langs->trans("List"), 1, $user->hasRight('reception', 'lire')); |
|
2145 | 2145 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") { |
2146 | - $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=0", $langs->trans("StatusReceptionDraftShort"), 2, $user->hasRight('reception', 'lire')); |
|
2146 | + $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=0", $langs->trans("StatusReceptionDraftShort"), 2, $user->hasRight('reception', 'lire')); |
|
2147 | 2147 | } |
2148 | 2148 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") { |
2149 | - $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=1", $langs->trans("StatusReceptionValidatedShort"), 2, $user->hasRight('reception', 'lire')); |
|
2149 | + $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=1", $langs->trans("StatusReceptionValidatedShort"), 2, $user->hasRight('reception', 'lire')); |
|
2150 | 2150 | } |
2151 | 2151 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") { |
2152 | - $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=2", $langs->trans("StatusReceptionProcessedShort"), 2, $user->hasRight('reception', 'lire')); |
|
2152 | + $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=2", $langs->trans("StatusReceptionProcessedShort"), 2, $user->hasRight('reception', 'lire')); |
|
2153 | 2153 | } |
2154 | - $newmenu->add("/reception/stats/index.php?leftmenu=receptions", $langs->trans("Statistics"), 1, $user->hasRight('reception', 'lire')); |
|
2154 | + $newmenu->add("/reception/stats/index.php?leftmenu=receptions", $langs->trans("Statistics"), 1, $user->hasRight('reception', 'lire')); |
|
2155 | 2155 | } |
2156 | 2156 | } |
2157 | 2157 | } |
@@ -2175,17 +2175,17 @@ discard block |
||
2175 | 2175 | if (isModEnabled('bom') || isModEnabled('mrp')) { |
2176 | 2176 | $langs->load("mrp"); |
2177 | 2177 | |
2178 | - $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->hasRight('bom', 'read'), '', $mainmenu, 'bom', 0, '', '', '', img_picto('', 'bom', 'class="paddingright pictofixedwidth"')); |
|
2179 | - $newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->hasRight('bom', 'write'), '', $mainmenu, 'bom'); |
|
2180 | - $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->hasRight('bom', 'read'), '', $mainmenu, 'bom'); |
|
2178 | + $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->hasRight('bom', 'read'), '', $mainmenu, 'bom', 0, '', '', '', img_picto('', 'bom', 'class="paddingright pictofixedwidth"')); |
|
2179 | + $newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->hasRight('bom', 'write'), '', $mainmenu, 'bom'); |
|
2180 | + $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->hasRight('bom', 'read'), '', $mainmenu, 'bom'); |
|
2181 | 2181 | } |
2182 | 2182 | |
2183 | 2183 | if (isModEnabled('mrp')) { |
2184 | 2184 | $langs->load("mrp"); |
2185 | 2185 | |
2186 | - $newmenu->add("", $langs->trans("MenuMRP"), 0, $user->hasRight('mrp', 'read'), '', $mainmenu, 'mrp', 0, '', '', '', img_picto('', 'mrp', 'class="paddingright pictofixedwidth"')); |
|
2187 | - $newmenu->add("/mrp/mo_card.php?leftmenu=mo&action=create", $langs->trans("NewMO"), 1, $user->hasRight('mrp', 'write'), '', $mainmenu, ''); |
|
2188 | - $newmenu->add("/mrp/mo_list.php?leftmenu=mo", $langs->trans("List"), 1, $user->hasRight('mrp', 'read'), '', $mainmenu, ''); |
|
2186 | + $newmenu->add("", $langs->trans("MenuMRP"), 0, $user->hasRight('mrp', 'read'), '', $mainmenu, 'mrp', 0, '', '', '', img_picto('', 'mrp', 'class="paddingright pictofixedwidth"')); |
|
2187 | + $newmenu->add("/mrp/mo_card.php?leftmenu=mo&action=create", $langs->trans("NewMO"), 1, $user->hasRight('mrp', 'write'), '', $mainmenu, ''); |
|
2188 | + $newmenu->add("/mrp/mo_list.php?leftmenu=mo", $langs->trans("List"), 1, $user->hasRight('mrp', 'read'), '', $mainmenu, ''); |
|
2189 | 2189 | } |
2190 | 2190 | } |
2191 | 2191 | } |
@@ -2212,7 +2212,7 @@ discard block |
||
2212 | 2212 | |
2213 | 2213 | $tmpentry = array( |
2214 | 2214 | 'enabled'=>isModEnabled('projet'), |
2215 | - 'perms'=>$user->hasRight('projet', 'lire'), |
|
2215 | + 'perms'=>$user->hasRight('projet', 'lire'), |
|
2216 | 2216 | 'module'=>'projet' |
2217 | 2217 | ); |
2218 | 2218 | $listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); |
@@ -2230,8 +2230,8 @@ discard block |
||
2230 | 2230 | } |
2231 | 2231 | |
2232 | 2232 | // Project assigned to user |
2233 | - $newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'projects', 0, '', '', '', img_picto('', 'project', 'class="paddingright pictofixedwidth"')); |
|
2234 | - $newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->hasRight('projet', 'creer')); |
|
2233 | + $newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'projects', 0, '', '', '', img_picto('', 'project', 'class="paddingright pictofixedwidth"')); |
|
2234 | + $newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->hasRight('projet', 'creer')); |
|
2235 | 2235 | |
2236 | 2236 | if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { |
2237 | 2237 | $newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : '').'&search_status=99', $langs->trans("List"), 1, $showmode, '', 'project', 'list'); |
@@ -2243,23 +2243,23 @@ discard block |
||
2243 | 2243 | $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99', $langs->trans("List"), 2, $showmode); |
2244 | 2244 | } |
2245 | 2245 | |
2246 | - $newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire')); |
|
2246 | + $newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire')); |
|
2247 | 2247 | |
2248 | 2248 | // Categories |
2249 | 2249 | if (isModEnabled('categorie')) { |
2250 | 2250 | $langs->load("categories"); |
2251 | - $newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
2251 | + $newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
2252 | 2252 | } |
2253 | 2253 | |
2254 | 2254 | if (empty($conf->global->PROJECT_HIDE_TASKS)) { |
2255 | 2255 | // Project affected to user |
2256 | - $newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'tasks', 0, '', '', '', img_picto('', 'projecttask', 'class="paddingright pictofixedwidth"')); |
|
2257 | - $newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->hasRight('projet', 'creer')); |
|
2258 | - $newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire')); |
|
2259 | - $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire')); |
|
2256 | + $newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'tasks', 0, '', '', '', img_picto('', 'projecttask', 'class="paddingright pictofixedwidth"')); |
|
2257 | + $newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->hasRight('projet', 'creer')); |
|
2258 | + $newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire')); |
|
2259 | + $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire')); |
|
2260 | 2260 | |
2261 | - $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); |
|
2262 | - $newmenu->add("/projet/tasks/time.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire')); |
|
2261 | + $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); |
|
2262 | + $newmenu->add("/projet/tasks/time.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire')); |
|
2263 | 2263 | } |
2264 | 2264 | } |
2265 | 2265 | } |
@@ -2317,47 +2317,47 @@ discard block |
||
2317 | 2317 | // Load translation files required by the page |
2318 | 2318 | $langs->loadLangs(array("holiday", "trips")); |
2319 | 2319 | |
2320 | - $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("CPTitreMenu"), 0, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday', 0, '', '', '', img_picto('', 'holiday', 'class="paddingright pictofixedwidth"')); |
|
2321 | - $newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("New"), 1, $user->hasRight('holiday', 'write'), '', $mainmenu); |
|
2322 | - $newmenu->add("/holiday/card_group.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("NewHolidayForGroup"), 1, ($user->hasRight('holiday', 'writeall') && $user->hasRight('holiday', 'readall')), '', $mainmenu, 'holiday_sm'); |
|
2323 | - $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("List"), 1, $user->hasRight('holiday', 'read'), '', $mainmenu); |
|
2320 | + $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("CPTitreMenu"), 0, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday', 0, '', '', '', img_picto('', 'holiday', 'class="paddingright pictofixedwidth"')); |
|
2321 | + $newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("New"), 1, $user->hasRight('holiday', 'write'), '', $mainmenu); |
|
2322 | + $newmenu->add("/holiday/card_group.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("NewHolidayForGroup"), 1, ($user->hasRight('holiday', 'writeall') && $user->hasRight('holiday', 'readall')), '', $mainmenu, 'holiday_sm'); |
|
2323 | + $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("List"), 1, $user->hasRight('holiday', 'read'), '', $mainmenu); |
|
2324 | 2324 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "holiday") { |
2325 | - $newmenu->add("/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=holiday", $langs->trans("DraftCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2326 | - $newmenu->add("/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=holiday", $langs->trans("ToReviewCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2327 | - $newmenu->add("/holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=holiday", $langs->trans("ApprovedCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2328 | - $newmenu->add("/holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=holiday", $langs->trans("CancelCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2329 | - $newmenu->add("/holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=holiday", $langs->trans("RefuseCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2325 | + $newmenu->add("/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=holiday", $langs->trans("DraftCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2326 | + $newmenu->add("/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=holiday", $langs->trans("ToReviewCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2327 | + $newmenu->add("/holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=holiday", $langs->trans("ApprovedCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2328 | + $newmenu->add("/holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=holiday", $langs->trans("CancelCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2329 | + $newmenu->add("/holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=holiday", $langs->trans("RefuseCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2330 | 2330 | } |
2331 | - $newmenu->add("/holiday/define_holiday.php?mainmenu=hrm", $langs->trans("MenuConfCP"), 1, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2332 | - $newmenu->add("/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuReportMonth"), 1, $user->hasRight('holiday', 'readall'), '', $mainmenu, 'holiday_sm'); |
|
2333 | - $newmenu->add("/holiday/view_log.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuLogCP"), 1, $user->hasRight('holiday', 'define_holiday'), '', $mainmenu, 'holiday_sm'); |
|
2331 | + $newmenu->add("/holiday/define_holiday.php?mainmenu=hrm", $langs->trans("MenuConfCP"), 1, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2332 | + $newmenu->add("/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuReportMonth"), 1, $user->hasRight('holiday', 'readall'), '', $mainmenu, 'holiday_sm'); |
|
2333 | + $newmenu->add("/holiday/view_log.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuLogCP"), 1, $user->hasRight('holiday', 'define_holiday'), '', $mainmenu, 'holiday_sm'); |
|
2334 | 2334 | } |
2335 | 2335 | |
2336 | 2336 | // Trips and expenses (old module) |
2337 | 2337 | if (isModEnabled('deplacement')) { |
2338 | 2338 | $langs->load("trips"); |
2339 | - $newmenu->add("/compta/deplacement/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('deplacement', 'lire'), '', $mainmenu, 'tripsandexpenses', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"')); |
|
2340 | - $newmenu->add("/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("New"), 1, $user->hasRight('deplacement', 'creer')); |
|
2341 | - $newmenu->add("/compta/deplacement/list.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("List"), 1, $user->hasRight('deplacement', 'lire')); |
|
2342 | - $newmenu->add("/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('deplacement', 'lire')); |
|
2339 | + $newmenu->add("/compta/deplacement/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('deplacement', 'lire'), '', $mainmenu, 'tripsandexpenses', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"')); |
|
2340 | + $newmenu->add("/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("New"), 1, $user->hasRight('deplacement', 'creer')); |
|
2341 | + $newmenu->add("/compta/deplacement/list.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("List"), 1, $user->hasRight('deplacement', 'lire')); |
|
2342 | + $newmenu->add("/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('deplacement', 'lire')); |
|
2343 | 2343 | } |
2344 | 2344 | |
2345 | 2345 | // Expense report |
2346 | 2346 | if (isModEnabled('expensereport')) { |
2347 | 2347 | $langs->loadLangs(array("trips", "bills")); |
2348 | - $newmenu->add("/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('expensereport', 'lire'), '', $mainmenu, 'expensereport', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"')); |
|
2349 | - $newmenu->add("/expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans("New"), 1, $user->hasRight('expensereport', 'creer')); |
|
2350 | - $newmenu->add("/expensereport/list.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("List"), 1, $user->hasRight('expensereport', 'lire')); |
|
2348 | + $newmenu->add("/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('expensereport', 'lire'), '', $mainmenu, 'expensereport', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"')); |
|
2349 | + $newmenu->add("/expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans("New"), 1, $user->hasRight('expensereport', 'creer')); |
|
2350 | + $newmenu->add("/expensereport/list.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("List"), 1, $user->hasRight('expensereport', 'lire')); |
|
2351 | 2351 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "expensereport") { |
2352 | - $newmenu->add("/expensereport/list.php?search_status=0&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Draft"), 2, $user->hasRight('expensereport', 'lire')); |
|
2353 | - $newmenu->add("/expensereport/list.php?search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Validated"), 2, $user->hasRight('expensereport', 'lire')); |
|
2354 | - $newmenu->add("/expensereport/list.php?search_status=5&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Approved"), 2, $user->hasRight('expensereport', 'lire')); |
|
2355 | - $newmenu->add("/expensereport/list.php?search_status=6&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Paid"), 2, $user->hasRight('expensereport', 'lire')); |
|
2356 | - $newmenu->add("/expensereport/list.php?search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Canceled"), 2, $user->hasRight('expensereport', 'lire')); |
|
2357 | - $newmenu->add("/expensereport/list.php?search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Refused"), 2, $user->hasRight('expensereport', 'lire')); |
|
2352 | + $newmenu->add("/expensereport/list.php?search_status=0&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Draft"), 2, $user->hasRight('expensereport', 'lire')); |
|
2353 | + $newmenu->add("/expensereport/list.php?search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Validated"), 2, $user->hasRight('expensereport', 'lire')); |
|
2354 | + $newmenu->add("/expensereport/list.php?search_status=5&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Approved"), 2, $user->hasRight('expensereport', 'lire')); |
|
2355 | + $newmenu->add("/expensereport/list.php?search_status=6&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Paid"), 2, $user->hasRight('expensereport', 'lire')); |
|
2356 | + $newmenu->add("/expensereport/list.php?search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Canceled"), 2, $user->hasRight('expensereport', 'lire')); |
|
2357 | + $newmenu->add("/expensereport/list.php?search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Refused"), 2, $user->hasRight('expensereport', 'lire')); |
|
2358 | 2358 | } |
2359 | - $newmenu->add("/expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm", $langs->trans("Payments"), 1, $user->hasRight('expensereport', 'lire')); |
|
2360 | - $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('expensereport', 'lire')); |
|
2359 | + $newmenu->add("/expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm", $langs->trans("Payments"), 1, $user->hasRight('expensereport', 'lire')); |
|
2360 | + $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('expensereport', 'lire')); |
|
2361 | 2361 | } |
2362 | 2362 | |
2363 | 2363 | if (isModEnabled('projet')) { |
@@ -2366,7 +2366,7 @@ discard block |
||
2366 | 2366 | |
2367 | 2367 | $search_project_user = GETPOST('search_project_user', 'int'); |
2368 | 2368 | |
2369 | - $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); |
|
2369 | + $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); |
|
2370 | 2370 | } |
2371 | 2371 | } |
2372 | 2372 | } |
@@ -2394,22 +2394,22 @@ discard block |
||
2394 | 2394 | } |
2395 | 2395 | |
2396 | 2396 | if (isModEnabled('mailing')) { |
2397 | - $newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->hasRight('mailing', 'lire'), '', $mainmenu, 'mailing', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"')); |
|
2398 | - $newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->hasRight('mailing', 'creer')); |
|
2399 | - $newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->hasRight('mailing', 'lire')); |
|
2397 | + $newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->hasRight('mailing', 'lire'), '', $mainmenu, 'mailing', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"')); |
|
2398 | + $newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->hasRight('mailing', 'creer')); |
|
2399 | + $newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->hasRight('mailing', 'lire')); |
|
2400 | 2400 | } |
2401 | 2401 | |
2402 | 2402 | if (isModEnabled('export')) { |
2403 | 2403 | $langs->load("exports"); |
2404 | - $newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->hasRight('export', 'lire'), '', $mainmenu, 'export', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); |
|
2405 | - $newmenu->add("/exports/export.php?leftmenu=export", $langs->trans("NewExport"), 1, $user->hasRight('export', 'creer')); |
|
2404 | + $newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->hasRight('export', 'lire'), '', $mainmenu, 'export', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); |
|
2405 | + $newmenu->add("/exports/export.php?leftmenu=export", $langs->trans("NewExport"), 1, $user->hasRight('export', 'creer')); |
|
2406 | 2406 | //$newmenu->add("/exports/export.php?leftmenu=export",$langs->trans("List"),1, $user->hasRight('export', 'lire')); |
2407 | 2407 | } |
2408 | 2408 | |
2409 | 2409 | if (isModEnabled('import')) { |
2410 | 2410 | $langs->load("exports"); |
2411 | - $newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->hasRight('import', 'run'), '', $mainmenu, 'import', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); |
|
2412 | - $newmenu->add("/imports/import.php?leftmenu=import", $langs->trans("NewImport"), 1, $user->hasRight('import', 'run')); |
|
2411 | + $newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->hasRight('import', 'run'), '', $mainmenu, 'import', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); |
|
2412 | + $newmenu->add("/imports/import.php?leftmenu=import", $langs->trans("NewImport"), 1, $user->hasRight('import', 'run')); |
|
2413 | 2413 | } |
2414 | 2414 | } |
2415 | 2415 | } |
@@ -2447,7 +2447,7 @@ discard block |
||
2447 | 2447 | |
2448 | 2448 | $newmenu->add("/adherents/cartes/carte.php?leftmenu=export", $langs->trans("MembersCards"), 1, $user->hasRight('adherent', 'export')); |
2449 | 2449 | if (!empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && ($usemenuhider || empty($leftmenu) || $leftmenu == 'none' || $leftmenu == "members" || $leftmenu == "export")) { |
2450 | - $newmenu->add("/adherents/htpasswd.php?leftmenu=export", $langs->trans("Filehtpasswd"), 1, $user->hasRight('adherent', 'export')); |
|
2450 | + $newmenu->add("/adherents/htpasswd.php?leftmenu=export", $langs->trans("Filehtpasswd"), 1, $user->hasRight('adherent', 'export')); |
|
2451 | 2451 | } |
2452 | 2452 | |
2453 | 2453 | if (isModEnabled('categorie')) { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !preg_match('/^select;/', $typeofdata)) { |
118 | 118 | if (!empty($perm)) { |
119 | 119 | $tmp = explode(':', $typeofdata); |
120 | - $ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">'; |
|
120 | + $ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">'; |
|
121 | 121 | if ($fieldrequired) { |
122 | 122 | $ret .= '<span class="fieldrequired">'; |
123 | 123 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | if ($fieldrequired) { |
130 | 130 | $ret .= '</span>'; |
131 | 131 | } |
132 | - $ret .= '</div>' . "\n"; |
|
132 | + $ret .= '</div>'."\n"; |
|
133 | 133 | } else { |
134 | 134 | if ($fieldrequired) { |
135 | 135 | $ret .= '<span class="fieldrequired">'; |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | if (empty($notabletag) && $perm) { |
168 | 168 | $ret .= '<td class="right">'; |
169 | 169 | } |
170 | - if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) { |
|
171 | - $ret .= '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=edit' . $htmlname . '&token=' . newToken() . '&' . $paramid . '=' . $object->id . $moreparam . '">' . img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)) . '</a>'; |
|
170 | + if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) { |
|
171 | + $ret .= '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&token='.newToken().'&'.$paramid.'='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>'; |
|
172 | 172 | } |
173 | 173 | if (!empty($notabletag) && $notabletag == 1) { |
174 | 174 | if ($text) { |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | } elseif ($reg[1] == 'int') { |
236 | 236 | $typeofdata = 'numeric'; |
237 | 237 | } else { |
238 | - return 'ErrorBadParameter ' . $typeofdata; |
|
238 | + return 'ErrorBadParameter '.$typeofdata; |
|
239 | 239 | } |
240 | 240 | } |
241 | 241 | |
@@ -246,13 +246,13 @@ discard block |
||
246 | 246 | if ($editaction == '') { |
247 | 247 | $editaction = GETPOST('action', 'aZ09'); |
248 | 248 | } |
249 | - $editmode = ($editaction == 'edit' . $htmlname); |
|
249 | + $editmode = ($editaction == 'edit'.$htmlname); |
|
250 | 250 | if ($editmode) { // edit mode |
251 | 251 | $ret .= "\n"; |
252 | - $ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">'; |
|
253 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
254 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
255 | - $ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">'; |
|
252 | + $ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">'; |
|
253 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
254 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
255 | + $ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">'; |
|
256 | 256 | if (empty($notabletag)) { |
257 | 257 | $ret .= '<table class="nobordernopadding centpercent">'; |
258 | 258 | } |
@@ -261,28 +261,28 @@ discard block |
||
261 | 261 | } |
262 | 262 | if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) { |
263 | 263 | $tmp = explode(':', $typeofdata); |
264 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
264 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
265 | 265 | } elseif (preg_match('/^(integer)/', $typeofdata)) { |
266 | 266 | $tmp = explode(':', $typeofdata); |
267 | 267 | $valuetoshow = price2num($editvalue ? $editvalue : $value, 0); |
268 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
268 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
269 | 269 | } elseif (preg_match('/^(numeric|amount)/', $typeofdata)) { |
270 | 270 | $tmp = explode(':', $typeofdata); |
271 | 271 | $valuetoshow = price2num($editvalue ? $editvalue : $value); |
272 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
272 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
273 | 273 | } elseif (preg_match('/^(checkbox)/', $typeofdata)) { |
274 | 274 | $tmp = explode(':', $typeofdata); |
275 | - $ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>'; |
|
275 | + $ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>'; |
|
276 | 276 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { // if wysiwyg is enabled $typeofdata = 'ckeditor' |
277 | 277 | $tmp = explode(':', $typeofdata); |
278 | 278 | $cols = (empty($tmp[2]) ? '' : $tmp[2]); |
279 | 279 | $morealt = ''; |
280 | 280 | if (preg_match('/%/', $cols)) { |
281 | - $morealt = ' style="width: ' . $cols . '"'; |
|
281 | + $morealt = ' style="width: '.$cols.'"'; |
|
282 | 282 | $cols = ''; |
283 | 283 | } |
284 | 284 | $valuetoshow = ($editvalue ? $editvalue : $value); |
285 | - $ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>'; |
|
285 | + $ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>'; |
|
286 | 286 | // textarea convert automatically entities chars into simple chars. |
287 | 287 | // So we convert & into & so a string like 'a < <b>b</b><br>é<br><script>alert('X');<script>' stay a correct html and is not converted by textarea component when wysiwig is off. |
288 | 288 | $valuetoshow = str_replace('&', '&', $valuetoshow); |
@@ -292,12 +292,12 @@ discard block |
||
292 | 292 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
293 | 293 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
294 | 294 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
295 | - $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
295 | + $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
296 | 296 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
297 | 297 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
298 | 298 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
299 | 299 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
300 | - $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
300 | + $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
301 | 301 | } elseif (preg_match('/^select;/', $typeofdata)) { |
302 | 302 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
303 | 303 | $arraylist = array(); |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | // TODO Not yet implemented. See code for extrafields |
312 | 312 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
313 | 313 | $tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser |
314 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
314 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
315 | 315 | $doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? '100' : $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? 0 : $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? '20' : $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7])); |
316 | 316 | $ret .= $doleditor->Create(1); |
317 | 317 | } elseif ($typeofdata == 'asis') { |
@@ -326,19 +326,19 @@ discard block |
||
326 | 326 | $ret .= '<td>'; |
327 | 327 | } |
328 | 328 | //else $ret.='<div class="clearboth"></div>'; |
329 | - $ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">'; |
|
329 | + $ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">'; |
|
330 | 330 | if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) { |
331 | - $ret .= '<br>' . "\n"; |
|
331 | + $ret .= '<br>'."\n"; |
|
332 | 332 | } |
333 | - $ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
333 | + $ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
334 | 334 | if (empty($notabletag)) { |
335 | 335 | $ret .= '</td>'; |
336 | 336 | } |
337 | 337 | |
338 | 338 | if (empty($notabletag)) { |
339 | - $ret .= '</tr></table>' . "\n"; |
|
339 | + $ret .= '</tr></table>'."\n"; |
|
340 | 340 | } |
341 | - $ret .= '</form>' . "\n"; |
|
341 | + $ret .= '</form>'."\n"; |
|
342 | 342 | } else { // view mode |
343 | 343 | if (preg_match('/^email/', $typeofdata)) { |
344 | 344 | $ret .= dol_print_email($value, 0, 0, 0, 0, 1); |
@@ -350,15 +350,15 @@ discard block |
||
350 | 350 | $ret .= ($value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : ''); |
351 | 351 | } elseif (preg_match('/^checkbox/', $typeofdata)) { |
352 | 352 | $tmp = explode(':', $typeofdata); |
353 | - $ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>'; |
|
353 | + $ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>'; |
|
354 | 354 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { |
355 | 355 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1)); |
356 | 356 | } elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) { // 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring' |
357 | 357 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value)); |
358 | 358 | } elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') { |
359 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>'; |
|
359 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>'; |
|
360 | 360 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
361 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>'; |
|
361 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>'; |
|
362 | 362 | } elseif (preg_match('/^select;/', $typeofdata)) { |
363 | 363 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
364 | 364 | $arraylist = array(); |
@@ -369,9 +369,9 @@ discard block |
||
369 | 369 | $ret .= $arraylist[$value]; |
370 | 370 | if ($htmlname == 'fk_product_type') { |
371 | 371 | if ($value == 0) { |
372 | - $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
372 | + $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
373 | 373 | } else { |
374 | - $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
374 | + $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
375 | 375 | } |
376 | 376 | } |
377 | 377 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { |
380 | 380 | $firstline = preg_replace('/<br>.*/', '', $tmpcontent); |
381 | 381 | $firstline = preg_replace('/[\n\r].*/', '', $firstline); |
382 | - $tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
382 | + $tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
383 | 383 | } |
384 | 384 | // We dont use dol_escape_htmltag to get the html formating active, but this need we must also |
385 | 385 | // clean data from some dangerous html |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | if (empty($moreoptions['valuealreadyhtmlescaped'])) { |
389 | 389 | $ret .= dol_escape_htmltag($value); |
390 | 390 | } else { |
391 | - $ret .= $value; // $value must be already html escaped. |
|
391 | + $ret .= $value; // $value must be already html escaped. |
|
392 | 392 | } |
393 | 393 | } |
394 | 394 | |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | |
427 | 427 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
428 | 428 | if (!is_object($extralanguages)) { |
429 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
429 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
430 | 430 | $extralanguages = new ExtraLanguages($this->db); |
431 | 431 | } |
432 | 432 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -435,17 +435,17 @@ discard block |
||
435 | 435 | return ''; // No extralang field to show |
436 | 436 | } |
437 | 437 | |
438 | - $result .= '<!-- Widget for translation -->' . "\n"; |
|
439 | - $result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">'; |
|
438 | + $result .= '<!-- Widget for translation -->'."\n"; |
|
439 | + $result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">'; |
|
440 | 440 | $s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang'); |
441 | 441 | $result .= $s; |
442 | 442 | $result .= '</div>'; |
443 | 443 | |
444 | - $result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">'; |
|
444 | + $result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">'; |
|
445 | 445 | |
446 | 446 | $resultforextrlang = ''; |
447 | 447 | foreach ($arrayoflangcode as $langcode) { |
448 | - $valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : ''; |
|
448 | + $valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : ''; |
|
449 | 449 | if (empty($valuetoshow)) { |
450 | 450 | $object->fetchValuesForExtraLanguages(); |
451 | 451 | //var_dump($object->array_languages); |
@@ -457,17 +457,17 @@ discard block |
||
457 | 457 | |
458 | 458 | // TODO Use the showInputField() method of ExtraLanguages object |
459 | 459 | if ($typeofdata == 'textarea') { |
460 | - $resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">'; |
|
460 | + $resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">'; |
|
461 | 461 | $resultforextrlang .= $valuetoshow; |
462 | 462 | $resultforextrlang .= '</textarea>'; |
463 | 463 | } else { |
464 | - $resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">'; |
|
464 | + $resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">'; |
|
465 | 465 | } |
466 | 466 | } |
467 | 467 | $result .= $resultforextrlang; |
468 | 468 | |
469 | 469 | $result .= '</div>'; |
470 | - $result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>'; |
|
470 | + $result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>'; |
|
471 | 471 | } |
472 | 472 | |
473 | 473 | return $result; |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | if (!empty($tmp[2])) { |
533 | 533 | $savemethod = $tmp[2]; |
534 | 534 | } |
535 | - $out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n"; |
|
535 | + $out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n"; |
|
536 | 536 | } elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) { |
537 | 537 | $tmp = explode(':', $inputType); |
538 | 538 | $inputType = $tmp[0]; |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | $savemethod = $tmp[2]; |
544 | 544 | } |
545 | 545 | |
546 | - $out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format |
|
546 | + $out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format |
|
547 | 547 | } elseif (preg_match('/^(select|autocomplete)/', $inputType)) { |
548 | 548 | $tmp = explode(':', $inputType); |
549 | 549 | $inputType = $tmp[0]; |
@@ -574,40 +574,40 @@ discard block |
||
574 | 574 | } |
575 | 575 | |
576 | 576 | if (isModEnabled('fckeditor')) { |
577 | - $out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n"; |
|
577 | + $out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n"; |
|
578 | 578 | } else { |
579 | 579 | $inputType = 'textarea'; |
580 | 580 | } |
581 | 581 | } |
582 | 582 | |
583 | - $out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n"; |
|
584 | - $out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n"; |
|
585 | - $out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n"; |
|
586 | - $out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n"; |
|
583 | + $out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n"; |
|
584 | + $out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n"; |
|
585 | + $out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n"; |
|
586 | + $out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n"; |
|
587 | 587 | if (!empty($savemethod)) { |
588 | - $out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n"; |
|
588 | + $out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n"; |
|
589 | 589 | } |
590 | 590 | if (!empty($ext_element)) { |
591 | - $out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n"; |
|
591 | + $out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n"; |
|
592 | 592 | } |
593 | 593 | if (!empty($custommsg)) { |
594 | 594 | if (is_array($custommsg)) { |
595 | 595 | if (!empty($custommsg['success'])) { |
596 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n"; |
|
596 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n"; |
|
597 | 597 | } |
598 | 598 | if (!empty($custommsg['error'])) { |
599 | - $out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n"; |
|
599 | + $out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n"; |
|
600 | 600 | } |
601 | 601 | } else { |
602 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n"; |
|
602 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n"; |
|
603 | 603 | } |
604 | 604 | } |
605 | 605 | if ($inputType == 'textarea') { |
606 | - $out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n"; |
|
607 | - $out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n"; |
|
606 | + $out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n"; |
|
607 | + $out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n"; |
|
608 | 608 | } |
609 | - $out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n"; |
|
610 | - $out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n"; |
|
609 | + $out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n"; |
|
610 | + $out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n"; |
|
611 | 611 | } else { |
612 | 612 | $out = $value; |
613 | 613 | } |
@@ -636,12 +636,12 @@ discard block |
||
636 | 636 | public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) |
637 | 637 | { |
638 | 638 | if ($incbefore) { |
639 | - $text = $incbefore . $text; |
|
639 | + $text = $incbefore.$text; |
|
640 | 640 | } |
641 | 641 | if (!$htmltext) { |
642 | 642 | return $text; |
643 | 643 | } |
644 | - $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
644 | + $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
645 | 645 | |
646 | 646 | $tag = 'td'; |
647 | 647 | if ($notabs == 2) { |
@@ -655,11 +655,11 @@ discard block |
||
655 | 655 | |
656 | 656 | $extrastyle = ''; |
657 | 657 | if ($direction < 0) { |
658 | - $extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : ''); |
|
658 | + $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); |
|
659 | 659 | $extrastyle = 'padding: 0px; padding-left: 3px;'; |
660 | 660 | } |
661 | 661 | if ($direction > 0) { |
662 | - $extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : ''); |
|
662 | + $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); |
|
663 | 663 | $extrastyle = 'padding: 0px; padding-right: 3px;'; |
664 | 664 | } |
665 | 665 | |
@@ -672,53 +672,53 @@ discard block |
||
672 | 672 | $htmltext = str_replace('"', '"', $htmltext); |
673 | 673 | } else { |
674 | 674 | $classfortooltip = 'classfortooltiponclick'; |
675 | - $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>'; |
|
675 | + $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>'; |
|
676 | 676 | } |
677 | 677 | if ($tooltipon == 2 || $tooltipon == 3) { |
678 | - $paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"'; |
|
678 | + $paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"'; |
|
679 | 679 | if ($tooltiptrigger == '') { |
680 | - $paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribut to put on img tag to store tooltip |
|
680 | + $paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on img tag to store tooltip |
|
681 | 681 | } else { |
682 | - $paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"'; |
|
682 | + $paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"'; |
|
683 | 683 | } |
684 | 684 | } else { |
685 | - $paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribut to put on td text tag |
|
685 | + $paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut to put on td text tag |
|
686 | 686 | } |
687 | 687 | if ($tooltipon == 1 || $tooltipon == 3) { |
688 | - $paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" '; |
|
688 | + $paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" '; |
|
689 | 689 | if ($tooltiptrigger == '') { |
690 | - $paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribut to put on td tag to store tooltip |
|
690 | + $paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on td tag to store tooltip |
|
691 | 691 | } else { |
692 | - $paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"'; |
|
692 | + $paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"'; |
|
693 | 693 | } |
694 | 694 | } else { |
695 | - $paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribut to put on td text tag |
|
695 | + $paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut to put on td text tag |
|
696 | 696 | } |
697 | 697 | if (empty($notabs)) { |
698 | 698 | $s .= '<table class="nobordernopadding"><tr style="height: auto;">'; |
699 | 699 | } elseif ($notabs == 2) { |
700 | - $s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">'; |
|
700 | + $s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">'; |
|
701 | 701 | } |
702 | 702 | // Define value if value is before |
703 | 703 | if ($direction < 0) { |
704 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
704 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
705 | 705 | if ($tag == 'td') { |
706 | 706 | $s .= ' class="valigntop" width="14"'; |
707 | 707 | } |
708 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
708 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
709 | 709 | } |
710 | 710 | // Use another method to help avoid having a space in value in order to use this value with jquery |
711 | 711 | // Define label |
712 | 712 | if ((string) $text != '') { |
713 | - $s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>'; |
|
713 | + $s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>'; |
|
714 | 714 | } |
715 | 715 | // Define value if value is after |
716 | 716 | if ($direction > 0) { |
717 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
717 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
718 | 718 | if ($tag == 'td') { |
719 | 719 | $s .= ' class="valignmiddle" width="14"'; |
720 | 720 | } |
721 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
721 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
722 | 722 | } |
723 | 723 | if (empty($notabs)) { |
724 | 724 | $s .= '</tr></table>'; |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | |
824 | 824 | $disabled = 0; |
825 | 825 | $ret = '<div class="centpercent center">'; |
826 | - $ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>'; |
|
826 | + $ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>'; |
|
827 | 827 | |
828 | 828 | // Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks. |
829 | 829 | $parameters = array(); |
@@ -833,9 +833,9 @@ discard block |
||
833 | 833 | return; |
834 | 834 | } |
835 | 835 | if (empty($reshook)) { |
836 | - $ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>'; |
|
836 | + $ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>'; |
|
837 | 837 | foreach ($arrayofaction as $code => $label) { |
838 | - $ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>'; |
|
838 | + $ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>'; |
|
839 | 839 | } |
840 | 840 | } |
841 | 841 | $ret .= $hookmanager->resPrint; |
@@ -843,17 +843,17 @@ discard block |
||
843 | 843 | $ret .= '</select>'; |
844 | 844 | |
845 | 845 | if (empty($conf->dol_optimize_smallscreen)) { |
846 | - $ret .= ajax_combobox('.' . $name . 'select'); |
|
846 | + $ret .= ajax_combobox('.'.$name.'select'); |
|
847 | 847 | } |
848 | 848 | |
849 | 849 | // Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button |
850 | 850 | $ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER. |
851 | - $ret .= '<input type="submit" disabled name="confirmmassaction"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display: none"') . ' class="reposition button smallpaddingimp' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'confirmed" value="' . dol_escape_htmltag($langs->trans("Confirm")) . '">'; |
|
851 | + $ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="reposition button smallpaddingimp'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">'; |
|
852 | 852 | $ret .= '</div>'; |
853 | 853 | |
854 | 854 | if (!empty($conf->use_javascript_ajax)) { |
855 | 855 | $ret .= '<!-- JS CODE TO ENABLE mass action select --> |
856 | - <script nonce="' . getNonce() . '"> |
|
856 | + <script nonce="' . getNonce().'"> |
|
857 | 857 | function initCheckForSelect(mode, name, cssclass) /* mode is 0 during init of page or click all, 1 when we click on 1 checkboxi, "name" refers to the class of the massaction button, "cssclass" to the class of the checkfor select boxes */ |
858 | 858 | { |
859 | 859 | atleastoneselected=0; |
@@ -864,11 +864,11 @@ discard block |
||
864 | 864 | |
865 | 865 | console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected); |
866 | 866 | |
867 | - if (atleastoneselected || ' . $alwaysvisible . ') |
|
867 | + if (atleastoneselected || ' . $alwaysvisible.') |
|
868 | 868 | { |
869 | 869 | jQuery("."+name).show(); |
870 | - ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . ' |
|
871 | - ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . ' |
|
870 | + ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').' |
|
871 | + ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').' |
|
872 | 872 | } |
873 | 873 | else |
874 | 874 | { |
@@ -878,11 +878,11 @@ discard block |
||
878 | 878 | } |
879 | 879 | |
880 | 880 | jQuery(document).ready(function () { |
881 | - initCheckForSelect(0, "' . $name . '", "' . $cssclass . '"); |
|
882 | - jQuery(".' . $cssclass . '").click(function() { |
|
883 | - initCheckForSelect(1, "' . $name . '", "' . $cssclass . '"); |
|
881 | + initCheckForSelect(0, "' . $name.'", "'.$cssclass.'"); |
|
882 | + jQuery(".' . $cssclass.'").click(function() { |
|
883 | + initCheckForSelect(1, "' . $name.'", "'.$cssclass.'"); |
|
884 | 884 | }); |
885 | - jQuery(".' . $name . 'select").change(function() { |
|
885 | + jQuery(".' . $name.'select").change(function() { |
|
886 | 886 | var massaction = $( this ).val(); |
887 | 887 | var urlform = $( this ).closest("form").attr("action").replace("#show_files",""); |
888 | 888 | if (massaction == "builddoc") |
@@ -890,18 +890,18 @@ discard block |
||
890 | 890 | urlform = urlform + "#show_files"; |
891 | 891 | } |
892 | 892 | $( this ).closest("form").attr("action", urlform); |
893 | - console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform); |
|
893 | + console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform); |
|
894 | 894 | /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */ |
895 | 895 | if ($(this).val() != \'0\') |
896 | 896 | { |
897 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', false); |
|
898 | - jQuery(".' . $name . 'other").hide(); /* To disable if another div was open */ |
|
899 | - jQuery(".' . $name . '"+massaction).show(); |
|
897 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', false); |
|
898 | + jQuery(".' . $name.'other").hide(); /* To disable if another div was open */ |
|
899 | + jQuery(".' . $name.'"+massaction).show(); |
|
900 | 900 | } |
901 | 901 | else |
902 | 902 | { |
903 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', true); |
|
904 | - jQuery(".' . $name . 'other").hide(); /* To disable any div open */ |
|
903 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', true); |
|
904 | + jQuery(".' . $name.'other").hide(); /* To disable any div open */ |
|
905 | 905 | } |
906 | 906 | }); |
907 | 907 | }); |
@@ -944,14 +944,14 @@ discard block |
||
944 | 944 | $atleastonefavorite = 0; |
945 | 945 | |
946 | 946 | $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec"; |
947 | - $sql .= " FROM " . $this->db->prefix() . "c_country"; |
|
947 | + $sql .= " FROM ".$this->db->prefix()."c_country"; |
|
948 | 948 | $sql .= " WHERE active > 0"; |
949 | 949 | //$sql.= " ORDER BY code ASC"; |
950 | 950 | |
951 | - dol_syslog(get_class($this) . "::select_country", LOG_DEBUG); |
|
951 | + dol_syslog(get_class($this)."::select_country", LOG_DEBUG); |
|
952 | 952 | $resql = $this->db->query($sql); |
953 | 953 | if ($resql) { |
954 | - $out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
954 | + $out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>'; |
|
955 | 955 | $num = $this->db->num_rows($resql); |
956 | 956 | $i = 0; |
957 | 957 | if ($num) { |
@@ -961,7 +961,7 @@ discard block |
||
961 | 961 | $countryArray[$i]['rowid'] = $obj->rowid; |
962 | 962 | $countryArray[$i]['code_iso'] = $obj->code_iso; |
963 | 963 | $countryArray[$i]['code_iso3'] = $obj->code_iso3; |
964 | - $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); |
|
964 | + $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); |
|
965 | 965 | $countryArray[$i]['favorite'] = $obj->favorite; |
966 | 966 | $countryArray[$i]['eec'] = $obj->eec; |
967 | 967 | $favorite[$i] = $obj->favorite; |
@@ -979,20 +979,20 @@ discard block |
||
979 | 979 | |
980 | 980 | if ($showempty) { |
981 | 981 | if (is_numeric($showempty)) { |
982 | - $out .= '<option value=""> </option>' . "\n"; |
|
982 | + $out .= '<option value=""> </option>'."\n"; |
|
983 | 983 | } else { |
984 | - $out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n"; |
|
984 | + $out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n"; |
|
985 | 985 | } |
986 | 986 | } |
987 | 987 | |
988 | 988 | if ($addspecialentries) { // Add dedicated entries for groups of countries |
989 | 989 | //if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>'; |
990 | - $out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
991 | - $out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>'; |
|
990 | + $out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
991 | + $out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>'; |
|
992 | 992 | if ($mysoc->isInEEC()) { |
993 | - $out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
993 | + $out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
994 | 994 | } |
995 | - $out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>'; |
|
995 | + $out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>'; |
|
996 | 996 | $out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>'; |
997 | 997 | } |
998 | 998 | |
@@ -1020,20 +1020,20 @@ discard block |
||
1020 | 1020 | $labeltoshow .= ' '; |
1021 | 1021 | } |
1022 | 1022 | if ($row['code_iso']) { |
1023 | - $labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>'; |
|
1023 | + $labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>'; |
|
1024 | 1024 | if (empty($hideflags)) { |
1025 | 1025 | $tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1); |
1026 | - $labeltoshow = $tmpflag . ' ' . $labeltoshow; |
|
1026 | + $labeltoshow = $tmpflag.' '.$labeltoshow; |
|
1027 | 1027 | } |
1028 | 1028 | } |
1029 | 1029 | |
1030 | 1030 | if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) { |
1031 | - $out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">'; |
|
1031 | + $out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" selected data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">'; |
|
1032 | 1032 | } else { |
1033 | - $out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">'; |
|
1033 | + $out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">'; |
|
1034 | 1034 | } |
1035 | 1035 | $out .= $labeltoshow; |
1036 | - $out .= '</option>' . "\n"; |
|
1036 | + $out .= '</option>'."\n"; |
|
1037 | 1037 | } |
1038 | 1038 | } |
1039 | 1039 | $out .= '</select>'; |
@@ -1042,8 +1042,8 @@ discard block |
||
1042 | 1042 | } |
1043 | 1043 | |
1044 | 1044 | // Make select dynamic |
1045 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1046 | - $out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve'); |
|
1045 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1046 | + $out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve'); |
|
1047 | 1047 | |
1048 | 1048 | return $out; |
1049 | 1049 | } |
@@ -1075,25 +1075,25 @@ discard block |
||
1075 | 1075 | $incotermArray = array(); |
1076 | 1076 | |
1077 | 1077 | $sql = "SELECT rowid, code"; |
1078 | - $sql .= " FROM " . $this->db->prefix() . "c_incoterms"; |
|
1078 | + $sql .= " FROM ".$this->db->prefix()."c_incoterms"; |
|
1079 | 1079 | $sql .= " WHERE active > 0"; |
1080 | 1080 | $sql .= " ORDER BY code ASC"; |
1081 | 1081 | |
1082 | - dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG); |
|
1082 | + dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG); |
|
1083 | 1083 | $resql = $this->db->query($sql); |
1084 | 1084 | if ($resql) { |
1085 | 1085 | if ($conf->use_javascript_ajax && !$forcecombo) { |
1086 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1086 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1087 | 1087 | $out .= ajax_combobox($htmlname, $events); |
1088 | 1088 | } |
1089 | 1089 | |
1090 | 1090 | if (!empty($page)) { |
1091 | - $out .= '<form method="post" action="' . $page . '">'; |
|
1091 | + $out .= '<form method="post" action="'.$page.'">'; |
|
1092 | 1092 | $out .= '<input type="hidden" name="action" value="set_incoterms">'; |
1093 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
1093 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1094 | 1094 | } |
1095 | 1095 | |
1096 | - $out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
1096 | + $out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>'; |
|
1097 | 1097 | $out .= '<option value="0"> </option>'; |
1098 | 1098 | $num = $this->db->num_rows($resql); |
1099 | 1099 | $i = 0; |
@@ -1107,9 +1107,9 @@ discard block |
||
1107 | 1107 | |
1108 | 1108 | foreach ($incotermArray as $row) { |
1109 | 1109 | if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) { |
1110 | - $out .= '<option value="' . $row['rowid'] . '" selected>'; |
|
1110 | + $out .= '<option value="'.$row['rowid'].'" selected>'; |
|
1111 | 1111 | } else { |
1112 | - $out .= '<option value="' . $row['rowid'] . '">'; |
|
1112 | + $out .= '<option value="'.$row['rowid'].'">'; |
|
1113 | 1113 | } |
1114 | 1114 | |
1115 | 1115 | if ($row['code']) { |
@@ -1122,13 +1122,13 @@ discard block |
||
1122 | 1122 | $out .= '</select>'; |
1123 | 1123 | |
1124 | 1124 | if ($conf->use_javascript_ajax && empty($disableautocomplete)) { |
1125 | - $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n"; |
|
1125 | + $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n"; |
|
1126 | 1126 | $moreattrib .= ' autocomplete="off"'; |
1127 | 1127 | } |
1128 | - $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n"; |
|
1128 | + $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n"; |
|
1129 | 1129 | |
1130 | 1130 | if (!empty($page)) { |
1131 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>'; |
|
1131 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>'; |
|
1132 | 1132 | } |
1133 | 1133 | } else { |
1134 | 1134 | dol_print_error($this->db); |
@@ -1159,9 +1159,9 @@ discard block |
||
1159 | 1159 | if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service")) |
1160 | 1160 | || (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) { |
1161 | 1161 | if (empty($hidetext)) { |
1162 | - print $langs->trans("Type") . ': '; |
|
1162 | + print $langs->trans("Type").': '; |
|
1163 | 1163 | } |
1164 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
1164 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
1165 | 1165 | if ($showempty) { |
1166 | 1166 | print '<option value="-1"'; |
1167 | 1167 | if ($selected == -1) { |
@@ -1174,28 +1174,28 @@ discard block |
||
1174 | 1174 | if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) { |
1175 | 1175 | print ' selected'; |
1176 | 1176 | } |
1177 | - print '>' . $langs->trans("Product"); |
|
1177 | + print '>'.$langs->trans("Product"); |
|
1178 | 1178 | |
1179 | 1179 | print '<option value="1"'; |
1180 | 1180 | if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) { |
1181 | 1181 | print ' selected'; |
1182 | 1182 | } |
1183 | - print '>' . $langs->trans("Service"); |
|
1183 | + print '>'.$langs->trans("Service"); |
|
1184 | 1184 | |
1185 | 1185 | print '</select>'; |
1186 | - print ajax_combobox('select_' . $htmlname); |
|
1186 | + print ajax_combobox('select_'.$htmlname); |
|
1187 | 1187 | //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); |
1188 | 1188 | } |
1189 | 1189 | if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) { |
1190 | 1190 | print $langs->trans("Service"); |
1191 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; |
|
1191 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; |
|
1192 | 1192 | } |
1193 | 1193 | if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) { |
1194 | 1194 | print $langs->trans("Product"); |
1195 | - print '<input type="hidden" name="' . $htmlname . '" value="0">'; |
|
1195 | + print '<input type="hidden" name="'.$htmlname.'" value="0">'; |
|
1196 | 1196 | } |
1197 | 1197 | if ($forceall < 0) { // This should happened only for contracts when both predefined product and service are disabled. |
1198 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1 |
|
1198 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1 |
|
1199 | 1199 | } |
1200 | 1200 | } |
1201 | 1201 | |
@@ -1221,7 +1221,7 @@ discard block |
||
1221 | 1221 | $langs->load("trips"); |
1222 | 1222 | |
1223 | 1223 | $sql = "SELECT c.code, c.label"; |
1224 | - $sql .= " FROM " . $this->db->prefix() . "c_type_fees as c"; |
|
1224 | + $sql .= " FROM ".$this->db->prefix()."c_type_fees as c"; |
|
1225 | 1225 | $sql .= " WHERE active > 0"; |
1226 | 1226 | |
1227 | 1227 | $resql = $this->db->query($sql); |
@@ -1262,11 +1262,11 @@ discard block |
||
1262 | 1262 | // phpcs:enable |
1263 | 1263 | global $user, $langs; |
1264 | 1264 | |
1265 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
1265 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
1266 | 1266 | |
1267 | 1267 | $this->load_cache_types_fees(); |
1268 | 1268 | |
1269 | - print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">'; |
|
1269 | + print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">'; |
|
1270 | 1270 | if ($showempty) { |
1271 | 1271 | print '<option value="-1"'; |
1272 | 1272 | if ($selected == -1) { |
@@ -1276,7 +1276,7 @@ discard block |
||
1276 | 1276 | } |
1277 | 1277 | |
1278 | 1278 | foreach ($this->cache_types_fees as $key => $value) { |
1279 | - print '<option value="' . $key . '"'; |
|
1279 | + print '<option value="'.$key.'"'; |
|
1280 | 1280 | if ($key == $selected) { |
1281 | 1281 | print ' selected'; |
1282 | 1282 | } |
@@ -1327,12 +1327,12 @@ discard block |
||
1327 | 1327 | $ajaxoptions = array(); |
1328 | 1328 | } |
1329 | 1329 | |
1330 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1330 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1331 | 1331 | |
1332 | 1332 | // No immediate load of all database |
1333 | 1333 | $placeholder = ''; |
1334 | 1334 | if ($selected && empty($selected_input_value)) { |
1335 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
1335 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
1336 | 1336 | $societetmp = new Societe($this->db); |
1337 | 1337 | $societetmp->fetch($selected); |
1338 | 1338 | $selected_input_value = $societetmp->name; |
@@ -1340,25 +1340,25 @@ discard block |
||
1340 | 1340 | } |
1341 | 1341 | |
1342 | 1342 | // mode 1 |
1343 | - $urloption = 'htmlname=' . urlencode(str_replace('.', '_', $htmlname)) . '&outjson=1&filter=' . urlencode($filter) . (empty($excludeids) ? '' : '&excludeids=' . join(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode($showtype) : '') . ($showcode ? '&showcode=' . urlencode($showcode) : ''); |
|
1343 | + $urloption = 'htmlname='.urlencode(str_replace('.', '_', $htmlname)).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '').($showcode ? '&showcode='.urlencode($showcode) : ''); |
|
1344 | 1344 | |
1345 | 1345 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
1346 | 1346 | if (empty($hidelabel)) { |
1347 | - print $langs->trans("RefOrLabel") . ' : '; |
|
1347 | + print $langs->trans("RefOrLabel").' : '; |
|
1348 | 1348 | } elseif ($hidelabel > 1) { |
1349 | 1349 | $placeholder = $langs->trans("RefOrLabel"); |
1350 | 1350 | if ($hidelabel == 2) { |
1351 | 1351 | $out .= img_picto($langs->trans("Search"), 'search'); |
1352 | 1352 | } |
1353 | 1353 | } |
1354 | - $out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />'; |
|
1354 | + $out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; |
|
1355 | 1355 | if ($hidelabel == 3) { |
1356 | 1356 | $out .= img_picto($langs->trans("Search"), 'search'); |
1357 | 1357 | } |
1358 | 1358 | |
1359 | 1359 | $out .= ajax_event($htmlname, $events); |
1360 | 1360 | |
1361 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
1361 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
1362 | 1362 | } else { |
1363 | 1363 | // Immediate load of all database |
1364 | 1364 | $out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids, $showcode); |
@@ -1442,30 +1442,30 @@ discard block |
||
1442 | 1442 | $sql .= ", s.address, s.zip, s.town"; |
1443 | 1443 | $sql .= ", dictp.code as country_code"; |
1444 | 1444 | } |
1445 | - $sql .= " FROM " . $this->db->prefix() . "societe as s"; |
|
1445 | + $sql .= " FROM ".$this->db->prefix()."societe as s"; |
|
1446 | 1446 | if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { |
1447 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
1447 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
1448 | 1448 | } |
1449 | 1449 | if (empty($user->rights->societe->client->voir) && !$user->socid) { |
1450 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
1450 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
1451 | 1451 | } |
1452 | - $sql .= " WHERE s.entity IN (" . getEntity('societe') . ")"; |
|
1452 | + $sql .= " WHERE s.entity IN (".getEntity('societe').")"; |
|
1453 | 1453 | if (!empty($user->socid)) { |
1454 | - $sql .= " AND s.rowid = " . ((int) $user->socid); |
|
1454 | + $sql .= " AND s.rowid = ".((int) $user->socid); |
|
1455 | 1455 | } |
1456 | 1456 | if ($filter) { |
1457 | 1457 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
1458 | 1458 | // if not, by testSqlAndScriptInject() only. |
1459 | - $sql .= " AND (" . $filter . ")"; |
|
1459 | + $sql .= " AND (".$filter.")"; |
|
1460 | 1460 | } |
1461 | 1461 | if (empty($user->rights->societe->client->voir) && !$user->socid) { |
1462 | - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
1462 | + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
1463 | 1463 | } |
1464 | 1464 | if (!empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) { |
1465 | 1465 | $sql .= " AND s.status <> 0"; |
1466 | 1466 | } |
1467 | 1467 | if (!empty($excludeids)) { |
1468 | - $sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(join(',', $excludeids)) . ")"; |
|
1468 | + $sql .= " AND s.rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")"; |
|
1469 | 1469 | } |
1470 | 1470 | // Add where from hooks |
1471 | 1471 | $parameters = array(); |
@@ -1485,17 +1485,17 @@ discard block |
||
1485 | 1485 | if ($i > 0) { |
1486 | 1486 | $sql .= " AND "; |
1487 | 1487 | } |
1488 | - $sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
1488 | + $sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
1489 | 1489 | $i++; |
1490 | 1490 | } |
1491 | 1491 | if (count($scrit) > 1) { |
1492 | 1492 | $sql .= ")"; |
1493 | 1493 | } |
1494 | 1494 | if (isModEnabled('barcode')) { |
1495 | - $sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
1495 | + $sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
1496 | 1496 | } |
1497 | - $sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
1498 | - $sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
1497 | + $sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
1498 | + $sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
1499 | 1499 | $sql .= ")"; |
1500 | 1500 | } |
1501 | 1501 | $sql .= $this->db->order("nom", "ASC"); |
@@ -1506,12 +1506,12 @@ discard block |
||
1506 | 1506 | $resql = $this->db->query($sql); |
1507 | 1507 | if ($resql) { |
1508 | 1508 | if (!$forcecombo) { |
1509 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1509 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1510 | 1510 | $out .= ajax_combobox($htmlname, $events, getDolGlobalString("COMPANY_USE_SEARCH_TO_SELECT")); |
1511 | 1511 | } |
1512 | 1512 | |
1513 | 1513 | // Construct $out and $outarray |
1514 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n"; |
|
1514 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n"; |
|
1515 | 1515 | |
1516 | 1516 | $textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : ''); |
1517 | 1517 | if (!empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { |
@@ -1524,7 +1524,7 @@ discard block |
||
1524 | 1524 | } |
1525 | 1525 | } |
1526 | 1526 | if ($showempty) { |
1527 | - $out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : ' ') . '</span>') . '">' . $textifempty . '</option>' . "\n"; |
|
1527 | + $out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : ' ').'</span>').'">'.$textifempty.'</option>'."\n"; |
|
1528 | 1528 | } |
1529 | 1529 | |
1530 | 1530 | $companytemp = new Societe($this->db); |
@@ -1537,18 +1537,18 @@ discard block |
||
1537 | 1537 | $label = ''; |
1538 | 1538 | if ($showcode || !empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { |
1539 | 1539 | if (($obj->client) && (!empty($obj->code_client))) { |
1540 | - $label = $obj->code_client . ' - '; |
|
1540 | + $label = $obj->code_client.' - '; |
|
1541 | 1541 | } |
1542 | 1542 | if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) { |
1543 | - $label .= $obj->code_fournisseur . ' - '; |
|
1543 | + $label .= $obj->code_fournisseur.' - '; |
|
1544 | 1544 | } |
1545 | - $label .= ' ' . $obj->name; |
|
1545 | + $label .= ' '.$obj->name; |
|
1546 | 1546 | } else { |
1547 | 1547 | $label = $obj->name; |
1548 | 1548 | } |
1549 | 1549 | |
1550 | 1550 | if (!empty($obj->name_alias)) { |
1551 | - $label .= ' (' . $obj->name_alias . ')'; |
|
1551 | + $label .= ' ('.$obj->name_alias.')'; |
|
1552 | 1552 | } |
1553 | 1553 | |
1554 | 1554 | if (!empty($conf->global->SOCIETE_SHOW_VAT_IN_LIST) && !empty($obj->tva_intra)) { |
@@ -1563,7 +1563,7 @@ discard block |
||
1563 | 1563 | $companytemp->fournisseur = $obj->fournisseur; |
1564 | 1564 | $tmptype = $companytemp->getTypeUrl(1, '', 0, 'span'); |
1565 | 1565 | if ($tmptype) { |
1566 | - $labelhtml .= ' ' . $tmptype; |
|
1566 | + $labelhtml .= ' '.$tmptype; |
|
1567 | 1567 | } |
1568 | 1568 | |
1569 | 1569 | if ($obj->client || $obj->fournisseur) { |
@@ -1573,10 +1573,10 @@ discard block |
||
1573 | 1573 | $label .= $langs->trans("Customer"); |
1574 | 1574 | } |
1575 | 1575 | if ($obj->client == 2 || $obj->client == 3) { |
1576 | - $label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect"); |
|
1576 | + $label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect"); |
|
1577 | 1577 | } |
1578 | 1578 | if ($obj->fournisseur) { |
1579 | - $label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier"); |
|
1579 | + $label .= ($obj->client ? ', ' : '').$langs->trans("Supplier"); |
|
1580 | 1580 | } |
1581 | 1581 | if ($obj->client || $obj->fournisseur) { |
1582 | 1582 | $label .= ')'; |
@@ -1584,9 +1584,9 @@ discard block |
||
1584 | 1584 | } |
1585 | 1585 | |
1586 | 1586 | if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { |
1587 | - $s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : ''); |
|
1587 | + $s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : ''); |
|
1588 | 1588 | if (!empty($obj->country_code)) { |
1589 | - $s .= ', ' . $langs->trans('Country' . $obj->country_code); |
|
1589 | + $s .= ', '.$langs->trans('Country'.$obj->country_code); |
|
1590 | 1590 | } |
1591 | 1591 | $label .= $s; |
1592 | 1592 | $labelhtml .= $s; |
@@ -1594,9 +1594,9 @@ discard block |
||
1594 | 1594 | |
1595 | 1595 | if (empty($outputmode)) { |
1596 | 1596 | if (in_array($obj->rowid, $selected)) { |
1597 | - $out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
1597 | + $out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
1598 | 1598 | } else { |
1599 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
1599 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
1600 | 1600 | } |
1601 | 1601 | } else { |
1602 | 1602 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml)); |
@@ -1608,7 +1608,7 @@ discard block |
||
1608 | 1608 | } |
1609 | 1609 | } |
1610 | 1610 | } |
1611 | - $out .= '</select>' . "\n"; |
|
1611 | + $out .= '</select>'."\n"; |
|
1612 | 1612 | } else { |
1613 | 1613 | dol_print_error($this->db); |
1614 | 1614 | } |
@@ -1642,18 +1642,18 @@ discard block |
||
1642 | 1642 | // On recherche les remises |
1643 | 1643 | $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; |
1644 | 1644 | $sql .= " re.description, re.fk_facture_source"; |
1645 | - $sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re"; |
|
1646 | - $sql .= " WHERE re.fk_soc = " . (int) $socid; |
|
1647 | - $sql .= " AND re.entity = " . $conf->entity; |
|
1645 | + $sql .= " FROM ".$this->db->prefix()."societe_remise_except as re"; |
|
1646 | + $sql .= " WHERE re.fk_soc = ".(int) $socid; |
|
1647 | + $sql .= " AND re.entity = ".$conf->entity; |
|
1648 | 1648 | if ($filter) { |
1649 | - $sql .= " AND " . $filter; |
|
1649 | + $sql .= " AND ".$filter; |
|
1650 | 1650 | } |
1651 | 1651 | $sql .= " ORDER BY re.description ASC"; |
1652 | 1652 | |
1653 | - dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG); |
|
1653 | + dol_syslog(get_class($this)."::select_remises", LOG_DEBUG); |
|
1654 | 1654 | $resql = $this->db->query($sql); |
1655 | 1655 | if ($resql) { |
1656 | - print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">'; |
|
1656 | + print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">'; |
|
1657 | 1657 | $num = $this->db->num_rows($resql); |
1658 | 1658 | |
1659 | 1659 | $qualifiedlines = $num; |
@@ -1691,16 +1691,16 @@ discard block |
||
1691 | 1691 | if (!empty($conf->global->MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST) && !empty($obj->fk_facture_source)) { |
1692 | 1692 | $tmpfac = new Facture($this->db); |
1693 | 1693 | if ($tmpfac->fetch($obj->fk_facture_source) > 0) { |
1694 | - $desc = $desc . ' - ' . $tmpfac->ref; |
|
1694 | + $desc = $desc.' - '.$tmpfac->ref; |
|
1695 | 1695 | } |
1696 | 1696 | } |
1697 | 1697 | |
1698 | - print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>'; |
|
1698 | + print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>'; |
|
1699 | 1699 | $i++; |
1700 | 1700 | } |
1701 | 1701 | } |
1702 | 1702 | print '</select>'; |
1703 | - print ajax_combobox('select_' . $htmlname); |
|
1703 | + print ajax_combobox('select_'.$htmlname); |
|
1704 | 1704 | |
1705 | 1705 | return $qualifiedlines; |
1706 | 1706 | } else { |
@@ -1781,7 +1781,7 @@ discard block |
||
1781 | 1781 | $out = ''; |
1782 | 1782 | |
1783 | 1783 | if (!is_object($hookmanager)) { |
1784 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
1784 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
1785 | 1785 | $hookmanager = new HookManager($this->db); |
1786 | 1786 | } |
1787 | 1787 | |
@@ -1790,13 +1790,13 @@ discard block |
||
1790 | 1790 | if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) { |
1791 | 1791 | $sql .= ", s.nom as company, s.town AS company_town"; |
1792 | 1792 | } |
1793 | - $sql .= " FROM " . $this->db->prefix() . "socpeople as sp"; |
|
1793 | + $sql .= " FROM ".$this->db->prefix()."socpeople as sp"; |
|
1794 | 1794 | if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) { |
1795 | - $sql .= " LEFT OUTER JOIN " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc"; |
|
1795 | + $sql .= " LEFT OUTER JOIN ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc"; |
|
1796 | 1796 | } |
1797 | - $sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")"; |
|
1797 | + $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
|
1798 | 1798 | if ($socid > 0 || $socid == -1) { |
1799 | - $sql .= " AND sp.fk_soc = " . ((int) $socid); |
|
1799 | + $sql .= " AND sp.fk_soc = ".((int) $socid); |
|
1800 | 1800 | } |
1801 | 1801 | if (!empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) { |
1802 | 1802 | $sql .= " AND sp.statut <> 0"; |
@@ -1807,30 +1807,30 @@ discard block |
||
1807 | 1807 | $sql .= $hookmanager->resPrint; |
1808 | 1808 | $sql .= " ORDER BY sp.lastname ASC"; |
1809 | 1809 | |
1810 | - dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG); |
|
1810 | + dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG); |
|
1811 | 1811 | $resql = $this->db->query($sql); |
1812 | 1812 | if ($resql) { |
1813 | 1813 | $num = $this->db->num_rows($resql); |
1814 | 1814 | |
1815 | 1815 | if ($htmlname != 'none' && !$options_only) { |
1816 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>'; |
|
1816 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>'; |
|
1817 | 1817 | } |
1818 | 1818 | |
1819 | 1819 | if ($showempty && !is_numeric($showempty)) { |
1820 | 1820 | $textforempty = $showempty; |
1821 | - $out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>'; |
|
1821 | + $out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>'; |
|
1822 | 1822 | } else { |
1823 | 1823 | if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) { |
1824 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '> </option>'; |
|
1824 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'> </option>'; |
|
1825 | 1825 | } |
1826 | 1826 | if ($showempty == 2) { |
1827 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>'; |
|
1827 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>'; |
|
1828 | 1828 | } |
1829 | 1829 | } |
1830 | 1830 | |
1831 | 1831 | $i = 0; |
1832 | 1832 | if ($num) { |
1833 | - include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
1833 | + include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
1834 | 1834 | $contactstatic = new Contact($this->db); |
1835 | 1835 | |
1836 | 1836 | while ($i < $num) { |
@@ -1866,7 +1866,7 @@ discard block |
||
1866 | 1866 | } |
1867 | 1867 | $extendedInfos = implode(' - ', $extendedInfos); |
1868 | 1868 | if (!empty($extendedInfos)) { |
1869 | - $extendedInfos = ' - ' . $extendedInfos; |
|
1869 | + $extendedInfos = ' - '.$extendedInfos; |
|
1870 | 1870 | } |
1871 | 1871 | } |
1872 | 1872 | |
@@ -1883,42 +1883,42 @@ discard block |
||
1883 | 1883 | $disabled = 1; |
1884 | 1884 | } |
1885 | 1885 | if (!empty($selected) && in_array($obj->rowid, $selected)) { |
1886 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
1886 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
1887 | 1887 | if ($disabled) { |
1888 | 1888 | $out .= ' disabled'; |
1889 | 1889 | } |
1890 | 1890 | $out .= ' selected>'; |
1891 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
1891 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
1892 | 1892 | if ($showfunction && $obj->poste) { |
1893 | - $out .= ' (' . $obj->poste . ')'; |
|
1893 | + $out .= ' ('.$obj->poste.')'; |
|
1894 | 1894 | } |
1895 | 1895 | if (($showsoc > 0) && $obj->company) { |
1896 | - $out .= ' - (' . $obj->company . ')'; |
|
1896 | + $out .= ' - ('.$obj->company.')'; |
|
1897 | 1897 | } |
1898 | 1898 | $out .= '</option>'; |
1899 | 1899 | } else { |
1900 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
1900 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
1901 | 1901 | if ($disabled) { |
1902 | 1902 | $out .= ' disabled'; |
1903 | 1903 | } |
1904 | 1904 | $out .= '>'; |
1905 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
1905 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
1906 | 1906 | if ($showfunction && $obj->poste) { |
1907 | - $out .= ' (' . $obj->poste . ')'; |
|
1907 | + $out .= ' ('.$obj->poste.')'; |
|
1908 | 1908 | } |
1909 | 1909 | if (($showsoc > 0) && $obj->company) { |
1910 | - $out .= ' - (' . $obj->company . ')'; |
|
1910 | + $out .= ' - ('.$obj->company.')'; |
|
1911 | 1911 | } |
1912 | 1912 | $out .= '</option>'; |
1913 | 1913 | } |
1914 | 1914 | } else { |
1915 | 1915 | if (in_array($obj->rowid, $selected)) { |
1916 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
1916 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
1917 | 1917 | if ($showfunction && $obj->poste) { |
1918 | - $out .= ' (' . $obj->poste . ')'; |
|
1918 | + $out .= ' ('.$obj->poste.')'; |
|
1919 | 1919 | } |
1920 | 1920 | if (($showsoc > 0) && $obj->company) { |
1921 | - $out .= ' - (' . $obj->company . ')'; |
|
1921 | + $out .= ' - ('.$obj->company.')'; |
|
1922 | 1922 | } |
1923 | 1923 | } |
1924 | 1924 | } |
@@ -1927,7 +1927,7 @@ discard block |
||
1927 | 1927 | } |
1928 | 1928 | } else { |
1929 | 1929 | $labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst'); |
1930 | - $out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">'; |
|
1930 | + $out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">'; |
|
1931 | 1931 | $out .= $labeltoshow; |
1932 | 1932 | $out .= '</option>'; |
1933 | 1933 | } |
@@ -1948,7 +1948,7 @@ discard block |
||
1948 | 1948 | } |
1949 | 1949 | |
1950 | 1950 | if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) { |
1951 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1951 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1952 | 1952 | $out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT")); |
1953 | 1953 | } |
1954 | 1954 | |
@@ -2053,37 +2053,37 @@ discard block |
||
2053 | 2053 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
2054 | 2054 | $sql .= ", e.label"; |
2055 | 2055 | } |
2056 | - $sql .= " FROM " . $this->db->prefix() . "user as u"; |
|
2056 | + $sql .= " FROM ".$this->db->prefix()."user as u"; |
|
2057 | 2057 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
2058 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity"; |
|
2058 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity"; |
|
2059 | 2059 | if ($force_entity) { |
2060 | - $sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")"; |
|
2060 | + $sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")"; |
|
2061 | 2061 | } else { |
2062 | 2062 | $sql .= " WHERE u.entity IS NOT NULL"; |
2063 | 2063 | } |
2064 | 2064 | } else { |
2065 | 2065 | if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { |
2066 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "usergroup_user as ug"; |
|
2066 | + $sql .= " LEFT JOIN ".$this->db->prefix()."usergroup_user as ug"; |
|
2067 | 2067 | $sql .= " ON ug.fk_user = u.rowid"; |
2068 | - $sql .= " WHERE ug.entity = " . (int) $conf->entity; |
|
2068 | + $sql .= " WHERE ug.entity = ".(int) $conf->entity; |
|
2069 | 2069 | } else { |
2070 | - $sql .= " WHERE u.entity IN (0, " . ((int) $conf->entity) . ")"; |
|
2070 | + $sql .= " WHERE u.entity IN (0, ".((int) $conf->entity).")"; |
|
2071 | 2071 | } |
2072 | 2072 | } |
2073 | 2073 | if (!empty($user->socid)) { |
2074 | - $sql .= " AND u.fk_soc = " . ((int) $user->socid); |
|
2074 | + $sql .= " AND u.fk_soc = ".((int) $user->socid); |
|
2075 | 2075 | } |
2076 | 2076 | if (is_array($exclude) && $excludeUsers) { |
2077 | - $sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")"; |
|
2077 | + $sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")"; |
|
2078 | 2078 | } |
2079 | 2079 | if ($includeUsers) { |
2080 | - $sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")"; |
|
2080 | + $sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")"; |
|
2081 | 2081 | } |
2082 | 2082 | if (!empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX) || $notdisabled) { |
2083 | 2083 | $sql .= " AND u.statut <> 0"; |
2084 | 2084 | } |
2085 | 2085 | if (!empty($morefilter)) { |
2086 | - $sql .= " " . $morefilter; |
|
2086 | + $sql .= " ".$morefilter; |
|
2087 | 2087 | } |
2088 | 2088 | |
2089 | 2089 | //Add hook to filter on user (for exemple on usergroup define in custom modules) |
@@ -2098,7 +2098,7 @@ discard block |
||
2098 | 2098 | $sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC"; |
2099 | 2099 | } |
2100 | 2100 | |
2101 | - dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG); |
|
2101 | + dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); |
|
2102 | 2102 | |
2103 | 2103 | $resql = $this->db->query($sql); |
2104 | 2104 | if ($resql) { |
@@ -2106,7 +2106,7 @@ discard block |
||
2106 | 2106 | $i = 0; |
2107 | 2107 | if ($num) { |
2108 | 2108 | // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined |
2109 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
2109 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
2110 | 2110 | if ($show_empty && !$multiple) { |
2111 | 2111 | $textforempty = ' '; |
2112 | 2112 | if (!empty($conf->use_javascript_ajax)) { |
@@ -2115,10 +2115,10 @@ discard block |
||
2115 | 2115 | if (!is_numeric($show_empty)) { |
2116 | 2116 | $textforempty = $show_empty; |
2117 | 2117 | } |
2118 | - $out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
2118 | + $out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
2119 | 2119 | } |
2120 | 2120 | if ($show_every) { |
2121 | - $out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n"; |
|
2121 | + $out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n"; |
|
2122 | 2122 | } |
2123 | 2123 | |
2124 | 2124 | $userstatic = new User($this->db); |
@@ -2165,22 +2165,22 @@ discard block |
||
2165 | 2165 | } |
2166 | 2166 | if ($showstatus >= 0) { |
2167 | 2167 | if ($obj->status == 1 && $showstatus == 1) { |
2168 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled'); |
|
2169 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled'); |
|
2168 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); |
|
2169 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled'); |
|
2170 | 2170 | } |
2171 | 2171 | if ($obj->status == 0 && $showstatus == 1) { |
2172 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled'); |
|
2173 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled'); |
|
2172 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); |
|
2173 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled'); |
|
2174 | 2174 | } |
2175 | 2175 | } |
2176 | 2176 | if (isModEnabled('multicompany') && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity) { |
2177 | 2177 | if (!$obj->entity) { |
2178 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities"); |
|
2179 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities"); |
|
2178 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); |
|
2179 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities"); |
|
2180 | 2180 | } else { |
2181 | 2181 | if ($obj->entity != $conf->entity) { |
2182 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
2183 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
2182 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
2183 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
2184 | 2184 | } |
2185 | 2185 | } |
2186 | 2186 | } |
@@ -2188,13 +2188,13 @@ discard block |
||
2188 | 2188 | $moreinfohtml .= ($moreinfohtml ? ')</span>' : ''); |
2189 | 2189 | if ($disableline && $disableline != '1') { |
2190 | 2190 | // Add text from $enableonlytext parameter |
2191 | - $moreinfo .= ' - ' . $disableline; |
|
2192 | - $moreinfohtml .= ' - ' . $disableline; |
|
2191 | + $moreinfo .= ' - '.$disableline; |
|
2192 | + $moreinfohtml .= ' - '.$disableline; |
|
2193 | 2193 | } |
2194 | 2194 | $labeltoshow .= $moreinfo; |
2195 | 2195 | $labeltoshowhtml .= $moreinfohtml; |
2196 | 2196 | |
2197 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
2197 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
2198 | 2198 | if ($disableline) { |
2199 | 2199 | $out .= ' disabled'; |
2200 | 2200 | } |
@@ -2202,7 +2202,7 @@ discard block |
||
2202 | 2202 | $out .= ' selected'; |
2203 | 2203 | } |
2204 | 2204 | $out .= ' data-html="'; |
2205 | - $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' '; |
|
2205 | + $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; |
|
2206 | 2206 | if ($showstatus >= 0 && $obj->status == 0) { |
2207 | 2207 | $outhtml .= '<strike class="opacitymediumxxx">'; |
2208 | 2208 | } |
@@ -2215,7 +2215,7 @@ discard block |
||
2215 | 2215 | $out .= $labeltoshow; |
2216 | 2216 | $out .= '</option>'; |
2217 | 2217 | |
2218 | - $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo; |
|
2218 | + $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo; |
|
2219 | 2219 | $outarray2[$userstatic->id] = array( |
2220 | 2220 | 'id'=>$userstatic->id, |
2221 | 2221 | 'label'=>$labeltoshow, |
@@ -2227,14 +2227,14 @@ discard block |
||
2227 | 2227 | $i++; |
2228 | 2228 | } |
2229 | 2229 | } else { |
2230 | - $out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>'; |
|
2231 | - $out .= '<option value="">' . $langs->trans("None") . '</option>'; |
|
2230 | + $out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>'; |
|
2231 | + $out .= '<option value="">'.$langs->trans("None").'</option>'; |
|
2232 | 2232 | } |
2233 | 2233 | $out .= '</select>'; |
2234 | 2234 | |
2235 | 2235 | if ($num && !$forcecombo) { |
2236 | 2236 | // Enhance with select2 |
2237 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
2237 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
2238 | 2238 | $out .= ajax_combobox($htmlname); |
2239 | 2239 | } |
2240 | 2240 | } else { |
@@ -2306,16 +2306,16 @@ discard block |
||
2306 | 2306 | $out .= $userstatic->getNomUrl(-1); |
2307 | 2307 | if ($i == 0) { |
2308 | 2308 | $ownerid = $value['id']; |
2309 | - $out .= ' (' . $langs->trans("Owner") . ')'; |
|
2309 | + $out .= ' ('.$langs->trans("Owner").')'; |
|
2310 | 2310 | } |
2311 | 2311 | if ($nbassignetouser > 1 && $action != 'view') { |
2312 | - $out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $userstatic->id . '" class="removedassigned reposition" id="removedassigned_' . $userstatic->id . '" name="removedassigned_' . $userstatic->id . '">'; |
|
2312 | + $out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$userstatic->id.'" class="removedassigned reposition" id="removedassigned_'.$userstatic->id.'" name="removedassigned_'.$userstatic->id.'">'; |
|
2313 | 2313 | } |
2314 | 2314 | // Show my availability |
2315 | 2315 | if ($showproperties) { |
2316 | 2316 | if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) { |
2317 | 2317 | $out .= '<div class="myavailability inline-block">'; |
2318 | - $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">' . $langs->trans("Availability") . ':</span> </span><input id="transparency" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofuserid[$ownerid]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>'; |
|
2318 | + $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">'.$langs->trans("Availability").':</span> </span><input id="transparency" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofuserid[$ownerid]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>'; |
|
2319 | 2319 | $out .= '</div>'; |
2320 | 2320 | } |
2321 | 2321 | } |
@@ -2332,15 +2332,15 @@ discard block |
||
2332 | 2332 | // Method with no ajax |
2333 | 2333 | if ($action != 'view') { |
2334 | 2334 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">'; |
2335 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
2335 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
2336 | 2336 | $out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });'; |
2337 | 2337 | $out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());'; |
2338 | - $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }'; |
|
2339 | - $out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }'; |
|
2338 | + $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }'; |
|
2339 | + $out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }'; |
|
2340 | 2340 | $out .= '});'; |
2341 | 2341 | $out .= '})</script>'; |
2342 | 2342 | $out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
2343 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
2343 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
2344 | 2344 | $out .= '<br>'; |
2345 | 2345 | } |
2346 | 2346 | |
@@ -2402,7 +2402,7 @@ discard block |
||
2402 | 2402 | $placeholder = ''; |
2403 | 2403 | |
2404 | 2404 | if ($selected && empty($selected_input_value)) { |
2405 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
2405 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
2406 | 2406 | $producttmpselect = new Product($this->db); |
2407 | 2407 | $producttmpselect->fetch($selected); |
2408 | 2408 | $selected_input_value = $producttmpselect->ref; |
@@ -2417,17 +2417,17 @@ discard block |
||
2417 | 2417 | } |
2418 | 2418 | } |
2419 | 2419 | // mode=1 means customers products |
2420 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=1&status=' . $status . '&status_purchase=' . $status_purchase . '&finished=' . $finished . '&hidepriceinlabel=' . $hidepriceinlabel . '&warehousestatus=' . $warehouseStatus; |
|
2421 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
2420 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&status_purchase='.$status_purchase.'&finished='.$finished.'&hidepriceinlabel='.$hidepriceinlabel.'&warehousestatus='.$warehouseStatus; |
|
2421 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
2422 | 2422 | |
2423 | 2423 | if (isModEnabled('variants') && is_array($selected_combinations)) { |
2424 | 2424 | // Code to automatically insert with javascript the select of attributes under the select of product |
2425 | 2425 | // when a parent of variant has been selected. |
2426 | 2426 | $out .= ' |
2427 | 2427 | <!-- script to auto show attributes select tags if a variant was selected --> |
2428 | - <script nonce="' . getNonce() . '"> |
|
2428 | + <script nonce="' . getNonce().'"> |
|
2429 | 2429 | // auto show attributes fields |
2430 | - selected = ' . json_encode($selected_combinations) . '; |
|
2430 | + selected = ' . json_encode($selected_combinations).'; |
|
2431 | 2431 | combvalues = {}; |
2432 | 2432 | |
2433 | 2433 | jQuery(document).ready(function () { |
@@ -2438,7 +2438,7 @@ discard block |
||
2438 | 2438 | } |
2439 | 2439 | }); |
2440 | 2440 | |
2441 | - jQuery("input#' . $htmlname . '").change(function () { |
|
2441 | + jQuery("input#' . $htmlname.'").change(function () { |
|
2442 | 2442 | |
2443 | 2443 | if (!jQuery(this).val()) { |
2444 | 2444 | jQuery(\'div#attributes_box\').empty(); |
@@ -2447,7 +2447,7 @@ discard block |
||
2447 | 2447 | |
2448 | 2448 | console.log("A change has started. We get variants fields to inject html select"); |
2449 | 2449 | |
2450 | - jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", { |
|
2450 | + jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", { |
|
2451 | 2451 | id: jQuery(this).val() |
2452 | 2452 | }, function (data) { |
2453 | 2453 | jQuery(\'div#attributes_box\').empty(); |
@@ -2490,21 +2490,21 @@ discard block |
||
2490 | 2490 | }) |
2491 | 2491 | }); |
2492 | 2492 | |
2493 | - ' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . ' |
|
2493 | + ' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').' |
|
2494 | 2494 | }); |
2495 | 2495 | </script> |
2496 | 2496 | '; |
2497 | 2497 | } |
2498 | 2498 | |
2499 | 2499 | if (empty($hidelabel)) { |
2500 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
2500 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
2501 | 2501 | } elseif ($hidelabel > 1) { |
2502 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
2502 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
2503 | 2503 | if ($hidelabel == 2) { |
2504 | 2504 | $out .= img_picto($langs->trans("Search"), 'search'); |
2505 | 2505 | } |
2506 | 2506 | } |
2507 | - $out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />'; |
|
2507 | + $out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; |
|
2508 | 2508 | if ($hidelabel == 3) { |
2509 | 2509 | $out .= img_picto($langs->trans("Search"), 'search'); |
2510 | 2510 | } |
@@ -2541,26 +2541,26 @@ discard block |
||
2541 | 2541 | // phpcs:enable |
2542 | 2542 | global $conf, $user, $langs, $db; |
2543 | 2543 | |
2544 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
2544 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
2545 | 2545 | |
2546 | 2546 | $error = 0; |
2547 | 2547 | $out = ''; |
2548 | 2548 | |
2549 | 2549 | if (!$forcecombo) { |
2550 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
2550 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
2551 | 2551 | $events = array(); |
2552 | 2552 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
2553 | 2553 | } |
2554 | 2554 | |
2555 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
2555 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
2556 | 2556 | |
2557 | 2557 | $sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product'; |
2558 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b'; |
|
2559 | - $sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')'; |
|
2560 | - if (!empty($status)) $sql .= ' AND status = ' . (int) $status; |
|
2561 | - if (!empty($type)) $sql .= ' AND bomtype = ' . (int) $type; |
|
2562 | - if (!empty($TProducts)) $sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')'; |
|
2563 | - if (!empty($limit)) $sql .= ' LIMIT ' . (int) $limit; |
|
2558 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b'; |
|
2559 | + $sql .= ' WHERE b.entity IN ('.getEntity('bom').')'; |
|
2560 | + if (!empty($status)) $sql .= ' AND status = '.(int) $status; |
|
2561 | + if (!empty($type)) $sql .= ' AND bomtype = '.(int) $type; |
|
2562 | + if (!empty($TProducts)) $sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')'; |
|
2563 | + if (!empty($limit)) $sql .= ' LIMIT '.(int) $limit; |
|
2564 | 2564 | $resql = $db->query($sql); |
2565 | 2565 | if ($resql) { |
2566 | 2566 | if ($showempty) { |
@@ -2571,9 +2571,9 @@ discard block |
||
2571 | 2571 | while ($obj = $db->fetch_object($resql)) { |
2572 | 2572 | $product = new Product($db); |
2573 | 2573 | $res = $product->fetch($obj->fk_product); |
2574 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
2574 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
2575 | 2575 | if ($obj->rowid == $selected) $out .= 'selected'; |
2576 | - $out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>'; |
|
2576 | + $out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>'; |
|
2577 | 2577 | } |
2578 | 2578 | } else { |
2579 | 2579 | $error++; |
@@ -2630,7 +2630,7 @@ discard block |
||
2630 | 2630 | |
2631 | 2631 | $warehouseStatusArray = array(); |
2632 | 2632 | if (!empty($warehouseStatus)) { |
2633 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
2633 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
2634 | 2634 | if (preg_match('/warehouseclosed/', $warehouseStatus)) { |
2635 | 2635 | $warehouseStatusArray[] = Entrepot::STATUS_CLOSED; |
2636 | 2636 | } |
@@ -2644,9 +2644,9 @@ discard block |
||
2644 | 2644 | |
2645 | 2645 | $selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_country, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.default_vat_code, p.duration, p.fk_price_expression"; |
2646 | 2646 | if (count($warehouseStatusArray)) { |
2647 | - $selectFieldsGrouped = ", sum(" . $this->db->ifsql("e.statut IS NULL", "0", "ps.reel") . ") as stock"; // e.statut is null if there is no record in stock |
|
2647 | + $selectFieldsGrouped = ", sum(".$this->db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock |
|
2648 | 2648 | } else { |
2649 | - $selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock"; |
|
2649 | + $selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock"; |
|
2650 | 2650 | } |
2651 | 2651 | |
2652 | 2652 | $sql = "SELECT "; |
@@ -2662,9 +2662,9 @@ discard block |
||
2662 | 2662 | |
2663 | 2663 | if (!empty($conf->global->PRODUCT_SORT_BY_CATEGORY)) { |
2664 | 2664 | //Product category |
2665 | - $sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie |
|
2666 | - FROM " . $this->db->prefix() . "categorie_product |
|
2667 | - WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid |
|
2665 | + $sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie |
|
2666 | + FROM " . $this->db->prefix()."categorie_product |
|
2667 | + WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid |
|
2668 | 2668 | LIMIT 1 |
2669 | 2669 | ) AS categorie_product_id "; |
2670 | 2670 | } |
@@ -2690,15 +2690,15 @@ discard block |
||
2690 | 2690 | } |
2691 | 2691 | // Price by quantity |
2692 | 2692 | if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { |
2693 | - $sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; |
|
2693 | + $sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; |
|
2694 | 2694 | if ($price_level >= 1 && !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { |
2695 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
2695 | + $sql .= " AND price_level = ".((int) $price_level); |
|
2696 | 2696 | } |
2697 | 2697 | $sql .= " ORDER BY date_price"; |
2698 | 2698 | $sql .= " DESC LIMIT 1) as price_rowid"; |
2699 | - $sql .= ", (SELECT pp.price_by_qty FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable |
|
2699 | + $sql .= ", (SELECT pp.price_by_qty FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable |
|
2700 | 2700 | if ($price_level >= 1 && !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { |
2701 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
2701 | + $sql .= " AND price_level = ".((int) $price_level); |
|
2702 | 2702 | } |
2703 | 2703 | $sql .= " ORDER BY date_price"; |
2704 | 2704 | $sql .= " DESC LIMIT 1) as price_by_qty"; |
@@ -2712,67 +2712,67 @@ discard block |
||
2712 | 2712 | $sql .= $hookmanager->resPrint; |
2713 | 2713 | |
2714 | 2714 | if (count($warehouseStatusArray)) { |
2715 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid"; |
|
2716 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")"; |
|
2717 | - $sql .= ' AND e.statut IN (' . $this->db->sanitize($this->db->escape(implode(',', $warehouseStatusArray))) . ')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0. |
|
2715 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid"; |
|
2716 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")"; |
|
2717 | + $sql .= ' AND e.statut IN ('.$this->db->sanitize($this->db->escape(implode(',', $warehouseStatusArray))).')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0. |
|
2718 | 2718 | } |
2719 | 2719 | |
2720 | 2720 | // include search in supplier ref |
2721 | 2721 | if (!empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF)) { |
2722 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
2722 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
2723 | 2723 | } |
2724 | 2724 | |
2725 | 2725 | //Price by customer |
2726 | 2726 | if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { |
2727 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid"; |
|
2727 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid"; |
|
2728 | 2728 | } |
2729 | 2729 | // Units |
2730 | 2730 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
2731 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
2731 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
2732 | 2732 | } |
2733 | 2733 | // Multilang : we add translation |
2734 | 2734 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
2735 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid "; |
|
2735 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid "; |
|
2736 | 2736 | if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && !empty($socid)) { |
2737 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
2737 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
2738 | 2738 | $soc = new Societe($this->db); |
2739 | 2739 | $result = $soc->fetch($socid); |
2740 | 2740 | if ($result > 0 && !empty($soc->default_lang)) { |
2741 | - $sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'"; |
|
2741 | + $sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'"; |
|
2742 | 2742 | } else { |
2743 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
2743 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
2744 | 2744 | } |
2745 | 2745 | } else { |
2746 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
2746 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
2747 | 2747 | } |
2748 | 2748 | } |
2749 | 2749 | |
2750 | 2750 | if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) { |
2751 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
2751 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
2752 | 2752 | } |
2753 | 2753 | |
2754 | - $sql .= ' WHERE p.entity IN (' . getEntity('product') . ')'; |
|
2754 | + $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; |
|
2755 | 2755 | |
2756 | 2756 | if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) { |
2757 | 2757 | $sql .= " AND pac.rowid IS NULL"; |
2758 | 2758 | } |
2759 | 2759 | |
2760 | 2760 | if ($finished == 0) { |
2761 | - $sql .= " AND p.finished = " . ((int) $finished); |
|
2761 | + $sql .= " AND p.finished = ".((int) $finished); |
|
2762 | 2762 | } elseif ($finished == 1) { |
2763 | - $sql .= " AND p.finished = " . ((int) $finished); |
|
2763 | + $sql .= " AND p.finished = ".((int) $finished); |
|
2764 | 2764 | if ($status >= 0) { |
2765 | - $sql .= " AND p.tosell = " . ((int) $status); |
|
2765 | + $sql .= " AND p.tosell = ".((int) $status); |
|
2766 | 2766 | } |
2767 | 2767 | } elseif ($status >= 0) { |
2768 | - $sql .= " AND p.tosell = " . ((int) $status); |
|
2768 | + $sql .= " AND p.tosell = ".((int) $status); |
|
2769 | 2769 | } |
2770 | 2770 | if ($status_purchase >= 0) { |
2771 | - $sql .= " AND p.tobuy = " . ((int) $status_purchase); |
|
2771 | + $sql .= " AND p.tobuy = ".((int) $status_purchase); |
|
2772 | 2772 | } |
2773 | 2773 | // Filter by product type |
2774 | 2774 | if (strval($filtertype) != '') { |
2775 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
2775 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
2776 | 2776 | } elseif (!isModEnabled('product')) { // when product module is disabled, show services only |
2777 | 2777 | $sql .= " AND p.fk_product_type = 1"; |
2778 | 2778 | } elseif (!isModEnabled('service')) { // when service module is disabled, show products only |
@@ -2796,21 +2796,21 @@ discard block |
||
2796 | 2796 | if ($i > 0) { |
2797 | 2797 | $sql .= " AND "; |
2798 | 2798 | } |
2799 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2799 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
2800 | 2800 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
2801 | - $sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2801 | + $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
2802 | 2802 | } |
2803 | 2803 | if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { |
2804 | - $sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2804 | + $sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
2805 | 2805 | } |
2806 | 2806 | if (!empty($conf->global->PRODUCT_AJAX_SEARCH_ON_DESCRIPTION)) { |
2807 | - $sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2807 | + $sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
2808 | 2808 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
2809 | - $sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2809 | + $sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
2810 | 2810 | } |
2811 | 2811 | } |
2812 | 2812 | if (!empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF)) { |
2813 | - $sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2813 | + $sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
2814 | 2814 | } |
2815 | 2815 | $sql .= ")"; |
2816 | 2816 | $i++; |
@@ -2819,12 +2819,12 @@ discard block |
||
2819 | 2819 | $sql .= ")"; |
2820 | 2820 | } |
2821 | 2821 | if (isModEnabled('barcode')) { |
2822 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
2822 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
2823 | 2823 | } |
2824 | 2824 | $sql .= ')'; |
2825 | 2825 | } |
2826 | 2826 | if (count($warehouseStatusArray)) { |
2827 | - $sql .= " GROUP BY " . $selectFields; |
|
2827 | + $sql .= " GROUP BY ".$selectFields; |
|
2828 | 2828 | } |
2829 | 2829 | |
2830 | 2830 | //Sort by category |
@@ -2839,23 +2839,23 @@ discard block |
||
2839 | 2839 | $sql .= $this->db->plimit($limit, 0); |
2840 | 2840 | |
2841 | 2841 | // Build output string |
2842 | - dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG); |
|
2842 | + dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG); |
|
2843 | 2843 | $result = $this->db->query($sql); |
2844 | 2844 | if ($result) { |
2845 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
2846 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
2847 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
2845 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
2846 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
2847 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
2848 | 2848 | |
2849 | 2849 | $num = $this->db->num_rows($result); |
2850 | 2850 | |
2851 | 2851 | $events = null; |
2852 | 2852 | |
2853 | 2853 | if (!$forcecombo) { |
2854 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
2854 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
2855 | 2855 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
2856 | 2856 | } |
2857 | 2857 | |
2858 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
2858 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
2859 | 2859 | |
2860 | 2860 | $textifempty = ''; |
2861 | 2861 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -2872,7 +2872,7 @@ discard block |
||
2872 | 2872 | } |
2873 | 2873 | } |
2874 | 2874 | if ($showempty) { |
2875 | - $out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : ' ') . '</option>'; |
|
2875 | + $out .= '<option value="-1" selected>'.($textifempty ? $textifempty : ' ').'</option>'; |
|
2876 | 2876 | } |
2877 | 2877 | |
2878 | 2878 | $i = 0; |
@@ -2883,11 +2883,11 @@ discard block |
||
2883 | 2883 | |
2884 | 2884 | if ((!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && !empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product |
2885 | 2885 | $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type"; |
2886 | - $sql .= " FROM " . $this->db->prefix() . "product_price_by_qty"; |
|
2887 | - $sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid); |
|
2886 | + $sql .= " FROM ".$this->db->prefix()."product_price_by_qty"; |
|
2887 | + $sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid); |
|
2888 | 2888 | $sql .= " ORDER BY quantity ASC"; |
2889 | 2889 | |
2890 | - dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG); |
|
2890 | + dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG); |
|
2891 | 2891 | $result2 = $this->db->query($sql); |
2892 | 2892 | if ($result2) { |
2893 | 2893 | $nb_prices = $this->db->num_rows($result2); |
@@ -2925,7 +2925,7 @@ discard block |
||
2925 | 2925 | $price_product = new Product($this->db); |
2926 | 2926 | $price_product->fetch($objp->rowid, '', '', 1); |
2927 | 2927 | |
2928 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
2928 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
2929 | 2929 | $priceparser = new PriceParser($this->db); |
2930 | 2930 | $price_result = $priceparser->parseProduct($price_product); |
2931 | 2931 | if ($price_result >= 0) { |
@@ -3009,7 +3009,7 @@ discard block |
||
3009 | 3009 | $label = $objp->label_translated; |
3010 | 3010 | } |
3011 | 3011 | if (!empty($filterkey) && $filterkey != '') { |
3012 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
3012 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
3013 | 3013 | } |
3014 | 3014 | |
3015 | 3015 | $outkey = $objp->rowid; |
@@ -3030,32 +3030,32 @@ discard block |
||
3030 | 3030 | $outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : ''; |
3031 | 3031 | |
3032 | 3032 | if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) { |
3033 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
3033 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
3034 | 3034 | } |
3035 | 3035 | |
3036 | 3036 | // Units |
3037 | 3037 | $outvalUnits = ''; |
3038 | 3038 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3039 | 3039 | if (!empty($objp->unit_short)) { |
3040 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
3040 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
3041 | 3041 | } |
3042 | 3042 | } |
3043 | 3043 | if (!empty($conf->global->PRODUCT_SHOW_DIMENSIONS_IN_COMBO)) { |
3044 | 3044 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
3045 | 3045 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
3046 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3046 | + $outvalUnits .= ' - '.$unitToShow; |
|
3047 | 3047 | } |
3048 | 3048 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
3049 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
3050 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3049 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
3050 | + $outvalUnits .= ' - '.$unitToShow; |
|
3051 | 3051 | } |
3052 | 3052 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
3053 | 3053 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
3054 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3054 | + $outvalUnits .= ' - '.$unitToShow; |
|
3055 | 3055 | } |
3056 | 3056 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
3057 | 3057 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
3058 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3058 | + $outvalUnits .= ' - '.$unitToShow; |
|
3059 | 3059 | } |
3060 | 3060 | } |
3061 | 3061 | if ($outdurationvalue && $outdurationunit) { |
@@ -3067,14 +3067,14 @@ discard block |
||
3067 | 3067 | 'y' => $langs->trans('Year') |
3068 | 3068 | ); |
3069 | 3069 | if (isset($da[$outdurationunit])) { |
3070 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
3070 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
3071 | 3071 | } |
3072 | 3072 | } |
3073 | 3073 | |
3074 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
3074 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
3075 | 3075 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
3076 | 3076 | if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) { |
3077 | - $opt .= ' pbq="' . $objp->price_by_qty_rowid . '" data-pbq="' . $objp->price_by_qty_rowid . '" data-pbqup="' . $objp->price_by_qty_unitprice . '" data-pbqbase="' . $objp->price_by_qty_price_base_type . '" data-pbqqty="' . $objp->price_by_qty_quantity . '" data-pbqpercent="' . $objp->price_by_qty_remise_percent . '"'; |
|
3077 | + $opt .= ' pbq="'.$objp->price_by_qty_rowid.'" data-pbq="'.$objp->price_by_qty_rowid.'" data-pbqup="'.$objp->price_by_qty_unitprice.'" data-pbqbase="'.$objp->price_by_qty_price_base_type.'" data-pbqqty="'.$objp->price_by_qty_quantity.'" data-pbqpercent="'.$objp->price_by_qty_remise_percent.'"'; |
|
3078 | 3078 | } |
3079 | 3079 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { |
3080 | 3080 | if (!empty($user->rights->stock->lire)) { |
@@ -3086,36 +3086,36 @@ discard block |
||
3086 | 3086 | } |
3087 | 3087 | } |
3088 | 3088 | if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { |
3089 | - $opt .= ' data-labeltrans="' . $outlabel_translated . '"'; |
|
3090 | - $opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"'; |
|
3089 | + $opt .= ' data-labeltrans="'.$outlabel_translated.'"'; |
|
3090 | + $opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"'; |
|
3091 | 3091 | } |
3092 | 3092 | $opt .= '>'; |
3093 | 3093 | $opt .= $objp->ref; |
3094 | 3094 | if (!empty($objp->custref)) { |
3095 | - $opt .= ' (' . $objp->custref . ')'; |
|
3095 | + $opt .= ' ('.$objp->custref.')'; |
|
3096 | 3096 | } |
3097 | 3097 | if ($outbarcode) { |
3098 | - $opt .= ' (' . $outbarcode . ')'; |
|
3098 | + $opt .= ' ('.$outbarcode.')'; |
|
3099 | 3099 | } |
3100 | - $opt .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3100 | + $opt .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
3101 | 3101 | if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) { |
3102 | - $opt .= ' (' . getCountry($outorigin, 1) . ')'; |
|
3102 | + $opt .= ' ('.getCountry($outorigin, 1).')'; |
|
3103 | 3103 | } |
3104 | 3104 | |
3105 | 3105 | $objRef = $objp->ref; |
3106 | 3106 | if (!empty($objp->custref)) { |
3107 | - $objRef .= ' (' . $objp->custref . ')'; |
|
3107 | + $objRef .= ' ('.$objp->custref.')'; |
|
3108 | 3108 | } |
3109 | 3109 | if (!empty($filterkey) && $filterkey != '') { |
3110 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
3110 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
3111 | 3111 | } |
3112 | 3112 | $outval .= $objRef; |
3113 | 3113 | if ($outbarcode) { |
3114 | - $outval .= ' (' . $outbarcode . ')'; |
|
3114 | + $outval .= ' ('.$outbarcode.')'; |
|
3115 | 3115 | } |
3116 | - $outval .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3116 | + $outval .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
3117 | 3117 | if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) { |
3118 | - $outval .= ' (' . getCountry($outorigin, 1) . ')'; |
|
3118 | + $outval .= ' ('.getCountry($outorigin, 1).')'; |
|
3119 | 3119 | } |
3120 | 3120 | |
3121 | 3121 | // Units |
@@ -3128,35 +3128,35 @@ discard block |
||
3128 | 3128 | // If we need a particular price level (from 1 to n) |
3129 | 3129 | if (empty($hidepriceinlabel) && $price_level >= 1 && (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { |
3130 | 3130 | $sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code"; |
3131 | - $sql .= " FROM " . $this->db->prefix() . "product_price"; |
|
3132 | - $sql .= " WHERE fk_product = " . ((int) $objp->rowid); |
|
3133 | - $sql .= " AND entity IN (" . getEntity('productprice') . ")"; |
|
3134 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
3131 | + $sql .= " FROM ".$this->db->prefix()."product_price"; |
|
3132 | + $sql .= " WHERE fk_product = ".((int) $objp->rowid); |
|
3133 | + $sql .= " AND entity IN (".getEntity('productprice').")"; |
|
3134 | + $sql .= " AND price_level = ".((int) $price_level); |
|
3135 | 3135 | $sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid. |
3136 | 3136 | $sql .= " LIMIT 1"; |
3137 | 3137 | |
3138 | - dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG); |
|
3138 | + dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG); |
|
3139 | 3139 | $result2 = $this->db->query($sql); |
3140 | 3140 | if ($result2) { |
3141 | 3141 | $objp2 = $this->db->fetch_object($result2); |
3142 | 3142 | if ($objp2) { |
3143 | 3143 | $found = 1; |
3144 | 3144 | if ($objp2->price_base_type == 'HT') { |
3145 | - $opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
3146 | - $outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
3145 | + $opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
3146 | + $outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
3147 | 3147 | } else { |
3148 | - $opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
3149 | - $outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
3148 | + $opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
3149 | + $outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
3150 | 3150 | } |
3151 | 3151 | $outprice_ht = price($objp2->price); |
3152 | 3152 | $outprice_ttc = price($objp2->price_ttc); |
3153 | 3153 | $outpricebasetype = $objp2->price_base_type; |
3154 | 3154 | if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) { // using this option is a bug. kept for backward compatibility |
3155 | - $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
3156 | - $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
3155 | + $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
3156 | + $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
3157 | 3157 | } else { |
3158 | - $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
3159 | - $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
3158 | + $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
3159 | + $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
3160 | 3160 | } |
3161 | 3161 | } |
3162 | 3162 | } else { |
@@ -3170,13 +3170,13 @@ discard block |
||
3170 | 3170 | $outqty = $objp->quantity; |
3171 | 3171 | $outdiscount = $objp->remise_percent; |
3172 | 3172 | if ($objp->quantity == 1) { |
3173 | - $opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3174 | - $outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3173 | + $opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3174 | + $outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3175 | 3175 | $opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
3176 | 3176 | $outval .= $langs->transnoentities("Unit"); |
3177 | 3177 | } else { |
3178 | - $opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3179 | - $outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3178 | + $opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3179 | + $outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3180 | 3180 | $opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
3181 | 3181 | $outval .= $langs->transnoentities("Units"); |
3182 | 3182 | } |
@@ -3184,16 +3184,16 @@ discard block |
||
3184 | 3184 | $outprice_ht = price($objp->unitprice); |
3185 | 3185 | $outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100))); |
3186 | 3186 | $outpricebasetype = $objp->price_base_type; |
3187 | - $outtva_tx = $objp->tva_tx; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
3188 | - $outdefault_vat_code = $objp->default_vat_code; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
3187 | + $outtva_tx = $objp->tva_tx; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
3188 | + $outdefault_vat_code = $objp->default_vat_code; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
3189 | 3189 | } |
3190 | 3190 | if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) { |
3191 | - $opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
3192 | - $outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
3191 | + $opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
3192 | + $outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
3193 | 3193 | } |
3194 | 3194 | if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) { |
3195 | - $opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3196 | - $outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3195 | + $opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3196 | + $outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3197 | 3197 | } |
3198 | 3198 | |
3199 | 3199 | // Price by customer |
@@ -3202,11 +3202,11 @@ discard block |
||
3202 | 3202 | $found = 1; |
3203 | 3203 | |
3204 | 3204 | if ($objp->custprice_base_type == 'HT') { |
3205 | - $opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
3206 | - $outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
3205 | + $opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
3206 | + $outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
3207 | 3207 | } else { |
3208 | - $opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
3209 | - $outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
3208 | + $opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
3209 | + $outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
3210 | 3210 | } |
3211 | 3211 | |
3212 | 3212 | $outprice_ht = price($objp->custprice); |
@@ -3220,11 +3220,11 @@ discard block |
||
3220 | 3220 | // If level no defined or multiprice not found, we used the default price |
3221 | 3221 | if (empty($hidepriceinlabel) && !$found) { |
3222 | 3222 | if ($objp->price_base_type == 'HT') { |
3223 | - $opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
3224 | - $outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
3223 | + $opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
3224 | + $outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
3225 | 3225 | } else { |
3226 | - $opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
3227 | - $outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
3226 | + $opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
3227 | + $outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
3228 | 3228 | } |
3229 | 3229 | $outprice_ht = price($objp->price); |
3230 | 3230 | $outprice_ttc = price($objp->price_ttc); |
@@ -3235,14 +3235,14 @@ discard block |
||
3235 | 3235 | |
3236 | 3236 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { |
3237 | 3237 | if (!empty($user->rights->stock->lire)) { |
3238 | - $opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
3238 | + $opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
3239 | 3239 | |
3240 | 3240 | if ($objp->stock > 0) { |
3241 | 3241 | $outval .= ' - <span class="product_line_stock_ok">'; |
3242 | 3242 | } elseif ($objp->stock <= 0) { |
3243 | 3243 | $outval .= ' - <span class="product_line_stock_too_low">'; |
3244 | 3244 | } |
3245 | - $outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
3245 | + $outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
3246 | 3246 | $outval .= '</span>'; |
3247 | 3247 | if (empty($novirtualstock) && !empty($conf->global->STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO)) { // Warning, this option may slow down combo list generation |
3248 | 3248 | $langs->load("stocks"); |
@@ -3252,9 +3252,9 @@ discard block |
||
3252 | 3252 | $tmpproduct->load_virtual_stock(); |
3253 | 3253 | $virtualstock = $tmpproduct->stock_theorique; |
3254 | 3254 | |
3255 | - $opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
3255 | + $opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
3256 | 3256 | |
3257 | - $outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
3257 | + $outval .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
3258 | 3258 | if ($virtualstock > 0) { |
3259 | 3259 | $outval .= '<span class="product_line_stock_ok">'; |
3260 | 3260 | } elseif ($virtualstock <= 0) { |
@@ -3332,7 +3332,7 @@ discard block |
||
3332 | 3332 | $selected_input_value = ''; |
3333 | 3333 | if (!empty($conf->use_javascript_ajax) && !empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) { |
3334 | 3334 | if ($selected > 0) { |
3335 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
3335 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
3336 | 3336 | $producttmpselect = new Product($this->db); |
3337 | 3337 | $producttmpselect->fetch($selected); |
3338 | 3338 | $selected_input_value = $producttmpselect->ref; |
@@ -3340,10 +3340,10 @@ discard block |
||
3340 | 3340 | } |
3341 | 3341 | |
3342 | 3342 | // mode=2 means suppliers products |
3343 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice; |
|
3344 | - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
3343 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; |
|
3344 | + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
3345 | 3345 | |
3346 | - print ($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>'; |
|
3346 | + print ($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>'; |
|
3347 | 3347 | } else { |
3348 | 3348 | print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); |
3349 | 3349 | } |
@@ -3403,25 +3403,25 @@ discard block |
||
3403 | 3403 | if (isModEnabled('barcode')) { |
3404 | 3404 | $sql .= ", pfp.barcode"; |
3405 | 3405 | } |
3406 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
3407 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )"; |
|
3406 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
3407 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )"; |
|
3408 | 3408 | if ($socid > 0) { |
3409 | - $sql .= " AND pfp.fk_soc = " . ((int) $socid); |
|
3409 | + $sql .= " AND pfp.fk_soc = ".((int) $socid); |
|
3410 | 3410 | } |
3411 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
3411 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
3412 | 3412 | // Units |
3413 | 3413 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3414 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
3414 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
3415 | 3415 | } |
3416 | - $sql .= " WHERE p.entity IN (" . getEntity('product') . ")"; |
|
3416 | + $sql .= " WHERE p.entity IN (".getEntity('product').")"; |
|
3417 | 3417 | if ($statut != -1) { |
3418 | - $sql .= " AND p.tobuy = " . ((int) $statut); |
|
3418 | + $sql .= " AND p.tobuy = ".((int) $statut); |
|
3419 | 3419 | } |
3420 | 3420 | if (strval($filtertype) != '') { |
3421 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
3421 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
3422 | 3422 | } |
3423 | 3423 | if (!empty($filtre)) { |
3424 | - $sql .= " " . $filtre; |
|
3424 | + $sql .= " ".$filtre; |
|
3425 | 3425 | } |
3426 | 3426 | // Add where from hooks |
3427 | 3427 | $parameters = array(); |
@@ -3441,9 +3441,9 @@ discard block |
||
3441 | 3441 | if ($i > 0) { |
3442 | 3442 | $sql .= " AND "; |
3443 | 3443 | } |
3444 | - $sql .= "(pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3444 | + $sql .= "(pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%' OR p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3445 | 3445 | if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) { |
3446 | - $sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3446 | + $sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3447 | 3447 | } |
3448 | 3448 | $sql .= ")"; |
3449 | 3449 | $i++; |
@@ -3452,8 +3452,8 @@ discard block |
||
3452 | 3452 | $sql .= ")"; |
3453 | 3453 | } |
3454 | 3454 | if (isModEnabled('barcode')) { |
3455 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
3456 | - $sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
3455 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
3456 | + $sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
3457 | 3457 | } |
3458 | 3458 | $sql .= ')'; |
3459 | 3459 | } |
@@ -3462,20 +3462,20 @@ discard block |
||
3462 | 3462 | |
3463 | 3463 | // Build output string |
3464 | 3464 | |
3465 | - dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG); |
|
3465 | + dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG); |
|
3466 | 3466 | $result = $this->db->query($sql); |
3467 | 3467 | if ($result) { |
3468 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3469 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
3468 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3469 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
3470 | 3470 | |
3471 | 3471 | $num = $this->db->num_rows($result); |
3472 | 3472 | |
3473 | 3473 | //$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax |
3474 | - $out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
3474 | + $out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
3475 | 3475 | if (!$selected) { |
3476 | - $out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
3476 | + $out .= '<option value="-1" selected>'.($placeholder ? $placeholder : ' ').'</option>'; |
|
3477 | 3477 | } else { |
3478 | - $out .= '<option value="-1">' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
3478 | + $out .= '<option value="-1">'.($placeholder ? $placeholder : ' ').'</option>'; |
|
3479 | 3479 | } |
3480 | 3480 | |
3481 | 3481 | $i = 0; |
@@ -3490,7 +3490,7 @@ discard block |
||
3490 | 3490 | |
3491 | 3491 | $outkey = $objp->idprodfournprice; // id in table of price |
3492 | 3492 | if (!$outkey && $alsoproductwithnosupplierprice) { |
3493 | - $outkey = 'idprod_' . $objp->rowid; // id of product |
|
3493 | + $outkey = 'idprod_'.$objp->rowid; // id of product |
|
3494 | 3494 | } |
3495 | 3495 | |
3496 | 3496 | $outref = $objp->ref; |
@@ -3505,23 +3505,23 @@ discard block |
||
3505 | 3505 | $outvalUnits = ''; |
3506 | 3506 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3507 | 3507 | if (!empty($objp->unit_short)) { |
3508 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
3508 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
3509 | 3509 | } |
3510 | 3510 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
3511 | 3511 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
3512 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3512 | + $outvalUnits .= ' - '.$unitToShow; |
|
3513 | 3513 | } |
3514 | 3514 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
3515 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
3516 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3515 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
3516 | + $outvalUnits .= ' - '.$unitToShow; |
|
3517 | 3517 | } |
3518 | 3518 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
3519 | 3519 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
3520 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3520 | + $outvalUnits .= ' - '.$unitToShow; |
|
3521 | 3521 | } |
3522 | 3522 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
3523 | 3523 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
3524 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3524 | + $outvalUnits .= ' - '.$unitToShow; |
|
3525 | 3525 | } |
3526 | 3526 | if ($outdurationvalue && $outdurationunit) { |
3527 | 3527 | $da = array( |
@@ -3532,22 +3532,22 @@ discard block |
||
3532 | 3532 | 'y' => $langs->trans('Year') |
3533 | 3533 | ); |
3534 | 3534 | if (isset($da[$outdurationunit])) { |
3535 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
3535 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
3536 | 3536 | } |
3537 | 3537 | } |
3538 | 3538 | } |
3539 | 3539 | |
3540 | 3540 | $objRef = $objp->ref; |
3541 | 3541 | if ($filterkey && $filterkey != '') { |
3542 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
3542 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
3543 | 3543 | } |
3544 | 3544 | $objRefFourn = $objp->ref_fourn; |
3545 | 3545 | if ($filterkey && $filterkey != '') { |
3546 | - $objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
3546 | + $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
3547 | 3547 | } |
3548 | 3548 | $label = $objp->label; |
3549 | 3549 | if ($filterkey && $filterkey != '') { |
3550 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
3550 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
3551 | 3551 | } |
3552 | 3552 | |
3553 | 3553 | switch ($objp->fk_product_type) { |
@@ -3570,21 +3570,21 @@ discard block |
||
3570 | 3570 | |
3571 | 3571 | $optlabel .= $objp->ref; |
3572 | 3572 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
3573 | - $optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>'; |
|
3573 | + $optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>'; |
|
3574 | 3574 | } |
3575 | 3575 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
3576 | - $optlabel .= ' (' . $outbarcode . ')'; |
|
3576 | + $optlabel .= ' ('.$outbarcode.')'; |
|
3577 | 3577 | } |
3578 | - $optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3578 | + $optlabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
3579 | 3579 | |
3580 | 3580 | $outvallabel = $objRef; |
3581 | 3581 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
3582 | - $outvallabel .= ' (' . $objRefFourn . ')'; |
|
3582 | + $outvallabel .= ' ('.$objRefFourn.')'; |
|
3583 | 3583 | } |
3584 | 3584 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
3585 | - $outvallabel .= ' (' . $outbarcode . ')'; |
|
3585 | + $outvallabel .= ' ('.$outbarcode.')'; |
|
3586 | 3586 | } |
3587 | - $outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3587 | + $outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
3588 | 3588 | |
3589 | 3589 | // Units |
3590 | 3590 | $optlabel .= $outvalUnits; |
@@ -3601,7 +3601,7 @@ discard block |
||
3601 | 3601 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
3602 | 3602 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
3603 | 3603 | |
3604 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3604 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3605 | 3605 | $priceparser = new PriceParser($this->db); |
3606 | 3606 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
3607 | 3607 | if ($price_result >= 0) { |
@@ -3612,48 +3612,48 @@ discard block |
||
3612 | 3612 | } |
3613 | 3613 | } |
3614 | 3614 | if ($objp->quantity == 1) { |
3615 | - $optlabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3616 | - $outvallabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3615 | + $optlabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3616 | + $outvallabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3617 | 3617 | $optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
3618 | 3618 | $outvallabel .= $langs->transnoentities("Unit"); |
3619 | 3619 | } else { |
3620 | - $optlabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3621 | - $outvallabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3622 | - $optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
3623 | - $outvallabel .= ' ' . $langs->transnoentities("Units"); |
|
3620 | + $optlabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3621 | + $outvallabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3622 | + $optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
3623 | + $outvallabel .= ' '.$langs->transnoentities("Units"); |
|
3624 | 3624 | } |
3625 | 3625 | |
3626 | 3626 | if ($objp->quantity > 1) { |
3627 | - $optlabel .= " (" . price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
3628 | - $outvallabel .= " (" . price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
3627 | + $optlabel .= " (".price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
3628 | + $outvallabel .= " (".price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
3629 | 3629 | } |
3630 | 3630 | if ($objp->remise_percent >= 1) { |
3631 | - $optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3632 | - $outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3631 | + $optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3632 | + $outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3633 | 3633 | } |
3634 | 3634 | if ($objp->duration) { |
3635 | - $optlabel .= " - " . $objp->duration; |
|
3636 | - $outvallabel .= " - " . $objp->duration; |
|
3635 | + $optlabel .= " - ".$objp->duration; |
|
3636 | + $outvallabel .= " - ".$objp->duration; |
|
3637 | 3637 | } |
3638 | 3638 | if (!$socid) { |
3639 | - $optlabel .= " - " . dol_trunc($objp->name, 8); |
|
3640 | - $outvallabel .= " - " . dol_trunc($objp->name, 8); |
|
3639 | + $optlabel .= " - ".dol_trunc($objp->name, 8); |
|
3640 | + $outvallabel .= " - ".dol_trunc($objp->name, 8); |
|
3641 | 3641 | } |
3642 | 3642 | if ($objp->supplier_reputation) { |
3643 | 3643 | //TODO dictionary |
3644 | 3644 | $reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier')); |
3645 | 3645 | |
3646 | - $optlabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
3647 | - $outvallabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
3646 | + $optlabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
3647 | + $outvallabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
3648 | 3648 | } |
3649 | 3649 | } else { |
3650 | 3650 | if (empty($alsoproductwithnosupplierprice)) { // No supplier price defined for couple product/supplier |
3651 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
3652 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
3651 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
3652 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
3653 | 3653 | } else // No supplier price defined for product, even on other suppliers |
3654 | 3654 | { |
3655 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
3656 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
3655 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
3656 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
3657 | 3657 | } |
3658 | 3658 | } |
3659 | 3659 | |
@@ -3661,14 +3661,14 @@ discard block |
||
3661 | 3661 | $novirtualstock = ($showstockinlist == 2); |
3662 | 3662 | |
3663 | 3663 | if (!empty($user->rights->stock->lire)) { |
3664 | - $outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
3664 | + $outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
3665 | 3665 | |
3666 | 3666 | if ($objp->stock > 0) { |
3667 | 3667 | $optlabel .= ' - <span class="product_line_stock_ok">'; |
3668 | 3668 | } elseif ($objp->stock <= 0) { |
3669 | 3669 | $optlabel .= ' - <span class="product_line_stock_too_low">'; |
3670 | 3670 | } |
3671 | - $optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS')); |
|
3671 | + $optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS')); |
|
3672 | 3672 | $optlabel .= '</span>'; |
3673 | 3673 | if (empty($novirtualstock) && !empty($conf->global->STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO)) { // Warning, this option may slow down combo list generation |
3674 | 3674 | $langs->load("stocks"); |
@@ -3678,9 +3678,9 @@ discard block |
||
3678 | 3678 | $tmpproduct->load_virtual_stock(); |
3679 | 3679 | $virtualstock = $tmpproduct->stock_theorique; |
3680 | 3680 | |
3681 | - $outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
3681 | + $outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
3682 | 3682 | |
3683 | - $optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
3683 | + $optlabel .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
3684 | 3684 | if ($virtualstock > 0) { |
3685 | 3685 | $optlabel .= '<span class="product_line_stock_ok">'; |
3686 | 3686 | } elseif ($virtualstock <= 0) { |
@@ -3694,7 +3694,7 @@ discard block |
||
3694 | 3694 | } |
3695 | 3695 | } |
3696 | 3696 | |
3697 | - $optstart = '<option value="' . $outkey . '"'; |
|
3697 | + $optstart = '<option value="'.$outkey.'"'; |
|
3698 | 3698 | if ($selected && $selected == $objp->idprodfournprice) { |
3699 | 3699 | $optstart .= ' selected'; |
3700 | 3700 | } |
@@ -3703,26 +3703,26 @@ discard block |
||
3703 | 3703 | } |
3704 | 3704 | |
3705 | 3705 | if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { |
3706 | - $optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"'; |
|
3707 | - $optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"'; |
|
3708 | - $optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"'; |
|
3709 | - $optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"'; |
|
3710 | - $optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"'; |
|
3711 | - $optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"'; |
|
3712 | - $optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"'; |
|
3713 | - $optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"'; |
|
3714 | - $optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"'; |
|
3715 | - } |
|
3716 | - $optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"'; |
|
3706 | + $optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"'; |
|
3707 | + $optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"'; |
|
3708 | + $optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"'; |
|
3709 | + $optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"'; |
|
3710 | + $optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"'; |
|
3711 | + $optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"'; |
|
3712 | + $optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"'; |
|
3713 | + $optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"'; |
|
3714 | + $optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"'; |
|
3715 | + } |
|
3716 | + $optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; |
|
3717 | 3717 | |
3718 | 3718 | $outarrayentry = array( |
3719 | 3719 | 'key' => $outkey, |
3720 | 3720 | 'value' => $outref, |
3721 | 3721 | 'label' => $outvallabel, |
3722 | 3722 | 'qty' => $outqty, |
3723 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
3724 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
3725 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
3723 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
3724 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
3725 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
3726 | 3726 | 'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2), |
3727 | 3727 | 'tva_tx' => price2num($objp->tva_tx), |
3728 | 3728 | 'default_vat_code' => $objp->default_vat_code, |
@@ -3747,18 +3747,18 @@ discard block |
||
3747 | 3747 | // Add new entry |
3748 | 3748 | // "key" value of json key array is used by jQuery automatically as selected value. Example: 'type' = product or service, 'price_ht' = unit price without tax |
3749 | 3749 | // "label" value of json key array is used by jQuery automatically as text for combo box |
3750 | - $out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n"; |
|
3750 | + $out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n"; |
|
3751 | 3751 | array_push( |
3752 | 3752 | $outarray, |
3753 | 3753 | array('key' => $outkey, |
3754 | 3754 | 'value' => $outref, |
3755 | 3755 | 'label' => $outvallabel, |
3756 | 3756 | 'qty' => $outqty, |
3757 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
3757 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
3758 | 3758 | 'price_qty_ht_locale' => price($objp->fprice), |
3759 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
3759 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
3760 | 3760 | 'price_unit_ht_locale' => price($objp->unitprice), |
3761 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
3761 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
3762 | 3762 | 'tva_tx_formated' => price($objp->tva_tx), |
3763 | 3763 | 'tva_tx' => price2num($objp->tva_tx), |
3764 | 3764 | 'default_vat_code' => $objp->default_vat_code, |
@@ -3785,7 +3785,7 @@ discard block |
||
3785 | 3785 | |
3786 | 3786 | $this->db->free($result); |
3787 | 3787 | |
3788 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
3788 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
3789 | 3789 | $out .= ajax_combobox($htmlname); |
3790 | 3790 | } else { |
3791 | 3791 | dol_print_error($this->db); |
@@ -3817,43 +3817,43 @@ discard block |
||
3817 | 3817 | $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,"; |
3818 | 3818 | $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,"; |
3819 | 3819 | $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name"; |
3820 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
3821 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
3822 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
3823 | - $sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")"; |
|
3820 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
3821 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
3822 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
3823 | + $sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")"; |
|
3824 | 3824 | $sql .= " AND p.tobuy = 1"; |
3825 | 3825 | $sql .= " AND s.fournisseur = 1"; |
3826 | - $sql .= " AND p.rowid = " . ((int) $productid); |
|
3826 | + $sql .= " AND p.rowid = ".((int) $productid); |
|
3827 | 3827 | if (empty($conf->global->PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED)) { |
3828 | 3828 | $sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; |
3829 | 3829 | } else { |
3830 | 3830 | $sql .= " ORDER BY pfp.unitprice ASC"; |
3831 | 3831 | } |
3832 | 3832 | |
3833 | - dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG); |
|
3833 | + dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG); |
|
3834 | 3834 | $result = $this->db->query($sql); |
3835 | 3835 | |
3836 | 3836 | if ($result) { |
3837 | 3837 | $num = $this->db->num_rows($result); |
3838 | 3838 | |
3839 | - $form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
3839 | + $form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
3840 | 3840 | |
3841 | 3841 | if (!$num) { |
3842 | - $form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>'; |
|
3842 | + $form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>'; |
|
3843 | 3843 | } else { |
3844 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3844 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3845 | 3845 | $form .= '<option value="0"> </option>'; |
3846 | 3846 | |
3847 | 3847 | $i = 0; |
3848 | 3848 | while ($i < $num) { |
3849 | 3849 | $objp = $this->db->fetch_object($result); |
3850 | 3850 | |
3851 | - $opt = '<option value="' . $objp->idprodfournprice . '"'; |
|
3851 | + $opt = '<option value="'.$objp->idprodfournprice.'"'; |
|
3852 | 3852 | //if there is only one supplier, preselect it |
3853 | 3853 | if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && !empty($conf->global->PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED))) { |
3854 | 3854 | $opt .= ' selected'; |
3855 | 3855 | } |
3856 | - $opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - '; |
|
3856 | + $opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - '; |
|
3857 | 3857 | |
3858 | 3858 | if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) { |
3859 | 3859 | $prod_supplier = new ProductFournisseur($this->db); |
@@ -3863,7 +3863,7 @@ discard block |
||
3863 | 3863 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
3864 | 3864 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
3865 | 3865 | |
3866 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3866 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3867 | 3867 | $priceparser = new PriceParser($this->db); |
3868 | 3868 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
3869 | 3869 | if ($price_result >= 0) { |
@@ -3874,10 +3874,10 @@ discard block |
||
3874 | 3874 | } |
3875 | 3875 | } |
3876 | 3876 | if ($objp->quantity == 1) { |
3877 | - $opt .= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3877 | + $opt .= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3878 | 3878 | } |
3879 | 3879 | |
3880 | - $opt .= $objp->quantity . ' '; |
|
3880 | + $opt .= $objp->quantity.' '; |
|
3881 | 3881 | |
3882 | 3882 | if ($objp->quantity == 1) { |
3883 | 3883 | $opt .= $langs->trans("Unit"); |
@@ -3886,10 +3886,10 @@ discard block |
||
3886 | 3886 | } |
3887 | 3887 | if ($objp->quantity > 1) { |
3888 | 3888 | $opt .= " - "; |
3889 | - $opt .= price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit"); |
|
3889 | + $opt .= price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit"); |
|
3890 | 3890 | } |
3891 | 3891 | if ($objp->duration) { |
3892 | - $opt .= " - " . $objp->duration; |
|
3892 | + $opt .= " - ".$objp->duration; |
|
3893 | 3893 | } |
3894 | 3894 | $opt .= "</option>\n"; |
3895 | 3895 | |
@@ -3923,14 +3923,14 @@ discard block |
||
3923 | 3923 | // phpcs:enable |
3924 | 3924 | // looking for users |
3925 | 3925 | $sql = "SELECT a.rowid, a.label"; |
3926 | - $sql .= " FROM " . $this->db->prefix() . "societe_address as a"; |
|
3927 | - $sql .= " WHERE a.fk_soc = " . ((int) $socid); |
|
3926 | + $sql .= " FROM ".$this->db->prefix()."societe_address as a"; |
|
3927 | + $sql .= " WHERE a.fk_soc = ".((int) $socid); |
|
3928 | 3928 | $sql .= " ORDER BY a.label ASC"; |
3929 | 3929 | |
3930 | - dol_syslog(get_class($this) . "::select_address", LOG_DEBUG); |
|
3930 | + dol_syslog(get_class($this)."::select_address", LOG_DEBUG); |
|
3931 | 3931 | $resql = $this->db->query($sql); |
3932 | 3932 | if ($resql) { |
3933 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
3933 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
3934 | 3934 | if ($showempty) { |
3935 | 3935 | print '<option value="0"> </option>'; |
3936 | 3936 | } |
@@ -3941,9 +3941,9 @@ discard block |
||
3941 | 3941 | $obj = $this->db->fetch_object($resql); |
3942 | 3942 | |
3943 | 3943 | if ($selected && $selected == $obj->rowid) { |
3944 | - print '<option value="' . $obj->rowid . '" selected>' . $obj->label . '</option>'; |
|
3944 | + print '<option value="'.$obj->rowid.'" selected>'.$obj->label.'</option>'; |
|
3945 | 3945 | } else { |
3946 | - print '<option value="' . $obj->rowid . '">' . $obj->label . '</option>'; |
|
3946 | + print '<option value="'.$obj->rowid.'">'.$obj->label.'</option>'; |
|
3947 | 3947 | } |
3948 | 3948 | $i++; |
3949 | 3949 | } |
@@ -3976,8 +3976,8 @@ discard block |
||
3976 | 3976 | dol_syslog(__METHOD__, LOG_DEBUG); |
3977 | 3977 | |
3978 | 3978 | $sql = "SELECT rowid, code, libelle as label, deposit_percent"; |
3979 | - $sql .= " FROM " . $this->db->prefix() . 'c_payment_term'; |
|
3980 | - $sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")"; |
|
3979 | + $sql .= " FROM ".$this->db->prefix().'c_payment_term'; |
|
3980 | + $sql .= " WHERE entity IN (".getEntity('c_payment_term').")"; |
|
3981 | 3981 | $sql .= " AND active > 0"; |
3982 | 3982 | $sql .= " ORDER BY sortorder"; |
3983 | 3983 | |
@@ -3989,7 +3989,7 @@ discard block |
||
3989 | 3989 | $obj = $this->db->fetch_object($resql); |
3990 | 3990 | |
3991 | 3991 | // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut |
3992 | - $label = ($langs->trans("PaymentConditionShort" . $obj->code) != ("PaymentConditionShort" . $obj->code) ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
3992 | + $label = ($langs->trans("PaymentConditionShort".$obj->code) != ("PaymentConditionShort".$obj->code) ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
3993 | 3993 | $this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code; |
3994 | 3994 | $this->cache_conditions_paiements[$obj->rowid]['label'] = $label; |
3995 | 3995 | $this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent; |
@@ -4017,7 +4017,7 @@ discard block |
||
4017 | 4017 | // phpcs:enable |
4018 | 4018 | global $langs; |
4019 | 4019 | |
4020 | - $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
4020 | + $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
4021 | 4021 | if ($num > 0) { |
4022 | 4022 | return 0; // Cache already loaded |
4023 | 4023 | } |
@@ -4027,7 +4027,7 @@ discard block |
||
4027 | 4027 | $langs->load('propal'); |
4028 | 4028 | |
4029 | 4029 | $sql = "SELECT rowid, code, label, position"; |
4030 | - $sql .= " FROM " . $this->db->prefix() . 'c_availability'; |
|
4030 | + $sql .= " FROM ".$this->db->prefix().'c_availability'; |
|
4031 | 4031 | $sql .= " WHERE active > 0"; |
4032 | 4032 | |
4033 | 4033 | $resql = $this->db->query($sql); |
@@ -4038,7 +4038,7 @@ discard block |
||
4038 | 4038 | $obj = $this->db->fetch_object($resql); |
4039 | 4039 | |
4040 | 4040 | // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut |
4041 | - $label = ($langs->trans("AvailabilityType" . $obj->code) != ("AvailabilityType" . $obj->code) ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4041 | + $label = ($langs->trans("AvailabilityType".$obj->code) != ("AvailabilityType".$obj->code) ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4042 | 4042 | $this->cache_availability[$obj->rowid]['code'] = $obj->code; |
4043 | 4043 | $this->cache_availability[$obj->rowid]['label'] = $label; |
4044 | 4044 | $this->cache_availability[$obj->rowid]['position'] = $obj->position; |
@@ -4070,17 +4070,17 @@ discard block |
||
4070 | 4070 | |
4071 | 4071 | $this->load_cache_availability(); |
4072 | 4072 | |
4073 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
4073 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
4074 | 4074 | |
4075 | - print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4075 | + print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
4076 | 4076 | if ($addempty) { |
4077 | 4077 | print '<option value="0"> </option>'; |
4078 | 4078 | } |
4079 | 4079 | foreach ($this->cache_availability as $id => $arrayavailability) { |
4080 | 4080 | if ($selected == $id) { |
4081 | - print '<option value="' . $id . '" selected>'; |
|
4081 | + print '<option value="'.$id.'" selected>'; |
|
4082 | 4082 | } else { |
4083 | - print '<option value="' . $id . '">'; |
|
4083 | + print '<option value="'.$id.'">'; |
|
4084 | 4084 | } |
4085 | 4085 | print dol_escape_htmltag($arrayavailability['label']); |
4086 | 4086 | print '</option>'; |
@@ -4101,13 +4101,13 @@ discard block |
||
4101 | 4101 | { |
4102 | 4102 | global $langs; |
4103 | 4103 | |
4104 | - $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
4104 | + $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
4105 | 4105 | if ($num > 0) { |
4106 | 4106 | return 0; // Cache already loaded |
4107 | 4107 | } |
4108 | 4108 | |
4109 | 4109 | $sql = "SELECT rowid, code, label"; |
4110 | - $sql .= " FROM " . $this->db->prefix() . 'c_input_reason'; |
|
4110 | + $sql .= " FROM ".$this->db->prefix().'c_input_reason'; |
|
4111 | 4111 | $sql .= " WHERE active > 0"; |
4112 | 4112 | |
4113 | 4113 | $resql = $this->db->query($sql); |
@@ -4120,8 +4120,8 @@ discard block |
||
4120 | 4120 | |
4121 | 4121 | // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut |
4122 | 4122 | $label = ($obj->label != '-' ? $obj->label : ''); |
4123 | - if ($langs->trans("DemandReasonType" . $obj->code) != ("DemandReasonType" . $obj->code)) { |
|
4124 | - $label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
4123 | + if ($langs->trans("DemandReasonType".$obj->code) != ("DemandReasonType".$obj->code)) { |
|
4124 | + $label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
4125 | 4125 | } |
4126 | 4126 | if ($langs->trans($obj->code) != $obj->code) { |
4127 | 4127 | $label = $langs->trans($obj->code); // So translation key SRC_XXX will work |
@@ -4161,9 +4161,9 @@ discard block |
||
4161 | 4161 | |
4162 | 4162 | $this->loadCacheInputReason(); |
4163 | 4163 | |
4164 | - print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
4164 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
4165 | 4165 | if ($addempty) { |
4166 | - print '<option value="0"' . (empty($selected) ? ' selected' : '') . '> </option>'; |
|
4166 | + print '<option value="0"'.(empty($selected) ? ' selected' : '').'> </option>'; |
|
4167 | 4167 | } |
4168 | 4168 | foreach ($this->cache_demand_reason as $id => $arraydemandreason) { |
4169 | 4169 | if ($arraydemandreason['code'] == $exclude) { |
@@ -4171,9 +4171,9 @@ discard block |
||
4171 | 4171 | } |
4172 | 4172 | |
4173 | 4173 | if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) { |
4174 | - print '<option value="' . $arraydemandreason['id'] . '" selected>'; |
|
4174 | + print '<option value="'.$arraydemandreason['id'].'" selected>'; |
|
4175 | 4175 | } else { |
4176 | - print '<option value="' . $arraydemandreason['id'] . '">'; |
|
4176 | + print '<option value="'.$arraydemandreason['id'].'">'; |
|
4177 | 4177 | } |
4178 | 4178 | $label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason |
4179 | 4179 | print $langs->trans($label); |
@@ -4183,7 +4183,7 @@ discard block |
||
4183 | 4183 | if ($user->admin && empty($notooltip)) { |
4184 | 4184 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
4185 | 4185 | } |
4186 | - print ajax_combobox('select_' . $htmlname); |
|
4186 | + print ajax_combobox('select_'.$htmlname); |
|
4187 | 4187 | } |
4188 | 4188 | |
4189 | 4189 | // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
@@ -4198,7 +4198,7 @@ discard block |
||
4198 | 4198 | // phpcs:enable |
4199 | 4199 | global $langs; |
4200 | 4200 | |
4201 | - $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
4201 | + $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
4202 | 4202 | if ($num > 0) { |
4203 | 4203 | return $num; // Cache already loaded |
4204 | 4204 | } |
@@ -4208,8 +4208,8 @@ discard block |
||
4208 | 4208 | $this->cache_types_paiements = array(); |
4209 | 4209 | |
4210 | 4210 | $sql = "SELECT id, code, libelle as label, type, active"; |
4211 | - $sql .= " FROM " . $this->db->prefix() . "c_paiement"; |
|
4212 | - $sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")"; |
|
4211 | + $sql .= " FROM ".$this->db->prefix()."c_paiement"; |
|
4212 | + $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; |
|
4213 | 4213 | |
4214 | 4214 | $resql = $this->db->query($sql); |
4215 | 4215 | if ($resql) { |
@@ -4219,7 +4219,7 @@ discard block |
||
4219 | 4219 | $obj = $this->db->fetch_object($resql); |
4220 | 4220 | |
4221 | 4221 | // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut |
4222 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != ("PaymentTypeShort" . $obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4222 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != ("PaymentTypeShort".$obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4223 | 4223 | $this->cache_types_paiements[$obj->id]['id'] = $obj->id; |
4224 | 4224 | $this->cache_types_paiements[$obj->id]['code'] = $obj->code; |
4225 | 4225 | $this->cache_types_paiements[$obj->id]['label'] = $label; |
@@ -4285,17 +4285,17 @@ discard block |
||
4285 | 4285 | global $langs, $user, $conf; |
4286 | 4286 | |
4287 | 4287 | $out = ''; |
4288 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
4288 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
4289 | 4289 | |
4290 | 4290 | $this->load_cache_conditions_paiements(); |
4291 | 4291 | |
4292 | 4292 | // Set default value if not already set by caller |
4293 | 4293 | if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID)) { |
4294 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
4294 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
4295 | 4295 | $selected = $conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID; |
4296 | 4296 | } |
4297 | 4297 | |
4298 | - $out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4298 | + $out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
4299 | 4299 | if ($addempty) { |
4300 | 4300 | $out .= '<option value="0"> </option>'; |
4301 | 4301 | } |
@@ -4309,9 +4309,9 @@ discard block |
||
4309 | 4309 | |
4310 | 4310 | if ($selected == $id) { |
4311 | 4311 | $selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent']; |
4312 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>'; |
|
4312 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>'; |
|
4313 | 4313 | } else { |
4314 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">'; |
|
4314 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">'; |
|
4315 | 4315 | } |
4316 | 4316 | $label = $arrayconditions['label']; |
4317 | 4317 | |
@@ -4329,21 +4329,21 @@ discard block |
||
4329 | 4329 | $out .= ajax_combobox($htmlname); |
4330 | 4330 | |
4331 | 4331 | if ($deposit_percent >= 0) { |
4332 | - $out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>'; |
|
4333 | - $out .= $langs->trans('DepositPercent') . ' : '; |
|
4334 | - $out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />'; |
|
4332 | + $out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>'; |
|
4333 | + $out .= $langs->trans('DepositPercent').' : '; |
|
4334 | + $out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />'; |
|
4335 | 4335 | $out .= '</span>'; |
4336 | 4336 | $out .= ' |
4337 | - <script nonce="' . getNonce() . '"> |
|
4337 | + <script nonce="' . getNonce().'"> |
|
4338 | 4338 | $(document).ready(function () { |
4339 | - $("#' . $htmlname . '").change(function () { |
|
4339 | + $("#' . $htmlname.'").change(function () { |
|
4340 | 4340 | let $selected = $(this).find("option:selected"); |
4341 | 4341 | let depositPercent = $selected.attr("data-deposit_percent"); |
4342 | 4342 | |
4343 | 4343 | if (depositPercent.length > 0) { |
4344 | - $("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent); |
|
4344 | + $("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent); |
|
4345 | 4345 | } else { |
4346 | - $("#' . $htmlname . '_deposit_percent_container").hide(); |
|
4346 | + $("#' . $htmlname.'_deposit_percent_container").hide(); |
|
4347 | 4347 | } |
4348 | 4348 | |
4349 | 4349 | return true; |
@@ -4381,7 +4381,7 @@ discard block |
||
4381 | 4381 | |
4382 | 4382 | $out = ''; |
4383 | 4383 | |
4384 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG); |
|
4384 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); |
|
4385 | 4385 | |
4386 | 4386 | $filterarray = array(); |
4387 | 4387 | if ($filtertype == 'CRDT') { |
@@ -4396,11 +4396,11 @@ discard block |
||
4396 | 4396 | |
4397 | 4397 | // Set default value if not already set by caller |
4398 | 4398 | if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID)) { |
4399 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
4399 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
4400 | 4400 | $selected = $conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID; |
4401 | 4401 | } |
4402 | 4402 | |
4403 | - $out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4403 | + $out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
4404 | 4404 | if ($empty) { |
4405 | 4405 | $out .= '<option value=""> </option>'; |
4406 | 4406 | } |
@@ -4421,13 +4421,13 @@ discard block |
||
4421 | 4421 | } |
4422 | 4422 | |
4423 | 4423 | if ($format == 0) { |
4424 | - $out .= '<option value="' . $id . '"'; |
|
4424 | + $out .= '<option value="'.$id.'"'; |
|
4425 | 4425 | } elseif ($format == 1) { |
4426 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
4426 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
4427 | 4427 | } elseif ($format == 2) { |
4428 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
4428 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
4429 | 4429 | } elseif ($format == 3) { |
4430 | - $out .= '<option value="' . $id . '"'; |
|
4430 | + $out .= '<option value="'.$id.'"'; |
|
4431 | 4431 | } |
4432 | 4432 | // Print attribute selected or not |
4433 | 4433 | if ($format == 1 || $format == 2) { |
@@ -4457,7 +4457,7 @@ discard block |
||
4457 | 4457 | if ($user->admin && !$noadmininfo) { |
4458 | 4458 | $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
4459 | 4459 | } |
4460 | - $out .= ajax_combobox('select' . $htmlname); |
|
4460 | + $out .= ajax_combobox('select'.$htmlname); |
|
4461 | 4461 | |
4462 | 4462 | if (empty($nooutput)) { |
4463 | 4463 | print $out; |
@@ -4479,22 +4479,22 @@ discard block |
||
4479 | 4479 | { |
4480 | 4480 | global $langs; |
4481 | 4481 | |
4482 | - $return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
4482 | + $return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
4483 | 4483 | $options = array( |
4484 | 4484 | 'HT' => $langs->trans("HT"), |
4485 | 4485 | 'TTC' => $langs->trans("TTC") |
4486 | 4486 | ); |
4487 | 4487 | foreach ($options as $id => $value) { |
4488 | 4488 | if ($selected == $id) { |
4489 | - $return .= '<option value="' . $id . '" selected>' . $value; |
|
4489 | + $return .= '<option value="'.$id.'" selected>'.$value; |
|
4490 | 4490 | } else { |
4491 | - $return .= '<option value="' . $id . '">' . $value; |
|
4491 | + $return .= '<option value="'.$id.'">'.$value; |
|
4492 | 4492 | } |
4493 | 4493 | $return .= '</option>'; |
4494 | 4494 | } |
4495 | 4495 | $return .= '</select>'; |
4496 | 4496 | if ($addjscombo) { |
4497 | - $return .= ajax_combobox('select_' . $htmlname); |
|
4497 | + $return .= ajax_combobox('select_'.$htmlname); |
|
4498 | 4498 | } |
4499 | 4499 | |
4500 | 4500 | return $return; |
@@ -4512,7 +4512,7 @@ discard block |
||
4512 | 4512 | // phpcs:enable |
4513 | 4513 | global $langs; |
4514 | 4514 | |
4515 | - $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
4515 | + $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
4516 | 4516 | if ($num > 0) { |
4517 | 4517 | return $num; // Cache already loaded |
4518 | 4518 | } |
@@ -4522,8 +4522,8 @@ discard block |
||
4522 | 4522 | $this->cache_transport_mode = array(); |
4523 | 4523 | |
4524 | 4524 | $sql = "SELECT rowid, code, label, active"; |
4525 | - $sql .= " FROM " . $this->db->prefix() . "c_transport_mode"; |
|
4526 | - $sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")"; |
|
4525 | + $sql .= " FROM ".$this->db->prefix()."c_transport_mode"; |
|
4526 | + $sql .= " WHERE entity IN (".getEntity('c_transport_mode').")"; |
|
4527 | 4527 | |
4528 | 4528 | $resql = $this->db->query($sql); |
4529 | 4529 | if ($resql) { |
@@ -4533,7 +4533,7 @@ discard block |
||
4533 | 4533 | $obj = $this->db->fetch_object($resql); |
4534 | 4534 | |
4535 | 4535 | // If traduction exist, we use it else we take the default label |
4536 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != ("PaymentTypeShort" . $obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4536 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != ("PaymentTypeShort".$obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4537 | 4537 | $this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid; |
4538 | 4538 | $this->cache_transport_mode[$obj->rowid]['code'] = $obj->code; |
4539 | 4539 | $this->cache_transport_mode[$obj->rowid]['label'] = $label; |
@@ -4567,11 +4567,11 @@ discard block |
||
4567 | 4567 | { |
4568 | 4568 | global $langs, $user; |
4569 | 4569 | |
4570 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG); |
|
4570 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG); |
|
4571 | 4571 | |
4572 | 4572 | $this->load_cache_transport_mode(); |
4573 | 4573 | |
4574 | - print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4574 | + print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
4575 | 4575 | if ($empty) { |
4576 | 4576 | print '<option value=""> </option>'; |
4577 | 4577 | } |
@@ -4587,13 +4587,13 @@ discard block |
||
4587 | 4587 | } |
4588 | 4588 | |
4589 | 4589 | if ($format == 0) { |
4590 | - print '<option value="' . $id . '"'; |
|
4590 | + print '<option value="'.$id.'"'; |
|
4591 | 4591 | } elseif ($format == 1) { |
4592 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
4592 | + print '<option value="'.$arraytypes['code'].'"'; |
|
4593 | 4593 | } elseif ($format == 2) { |
4594 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
4594 | + print '<option value="'.$arraytypes['code'].'"'; |
|
4595 | 4595 | } elseif ($format == 3) { |
4596 | - print '<option value="' . $id . '"'; |
|
4596 | + print '<option value="'.$id.'"'; |
|
4597 | 4597 | } |
4598 | 4598 | // If text is selected, we compare with code, else with id |
4599 | 4599 | if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) { |
@@ -4641,31 +4641,31 @@ discard block |
||
4641 | 4641 | $langs->load("deliveries"); |
4642 | 4642 | |
4643 | 4643 | $sql = "SELECT rowid, code, libelle as label"; |
4644 | - $sql .= " FROM " . $this->db->prefix() . "c_shipment_mode"; |
|
4644 | + $sql .= " FROM ".$this->db->prefix()."c_shipment_mode"; |
|
4645 | 4645 | $sql .= " WHERE active > 0"; |
4646 | 4646 | if ($filtre) { |
4647 | - $sql .= " AND " . $filtre; |
|
4647 | + $sql .= " AND ".$filtre; |
|
4648 | 4648 | } |
4649 | 4649 | $sql .= " ORDER BY libelle ASC"; |
4650 | 4650 | |
4651 | - dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG); |
|
4651 | + dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG); |
|
4652 | 4652 | $result = $this->db->query($sql); |
4653 | 4653 | if ($result) { |
4654 | 4654 | $num = $this->db->num_rows($result); |
4655 | 4655 | $i = 0; |
4656 | 4656 | if ($num) { |
4657 | - print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
4657 | + print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
4658 | 4658 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
4659 | 4659 | print '<option value="-1"> </option>'; |
4660 | 4660 | } |
4661 | 4661 | while ($i < $num) { |
4662 | 4662 | $obj = $this->db->fetch_object($result); |
4663 | 4663 | if ($selected == $obj->rowid) { |
4664 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
4664 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
4665 | 4665 | } else { |
4666 | - print '<option value="' . $obj->rowid . '">'; |
|
4666 | + print '<option value="'.$obj->rowid.'">'; |
|
4667 | 4667 | } |
4668 | - print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label; |
|
4668 | + print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label; |
|
4669 | 4669 | print '</option>'; |
4670 | 4670 | $i++; |
4671 | 4671 | } |
@@ -4674,7 +4674,7 @@ discard block |
||
4674 | 4674 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
4675 | 4675 | } |
4676 | 4676 | |
4677 | - print ajax_combobox('select' . $htmlname); |
|
4677 | + print ajax_combobox('select'.$htmlname); |
|
4678 | 4678 | } else { |
4679 | 4679 | print $langs->trans("NoShippingMethodDefined"); |
4680 | 4680 | } |
@@ -4699,16 +4699,16 @@ discard block |
||
4699 | 4699 | $langs->load("deliveries"); |
4700 | 4700 | |
4701 | 4701 | if ($htmlname != "none") { |
4702 | - print '<form method="POST" action="' . $page . '">'; |
|
4702 | + print '<form method="POST" action="'.$page.'">'; |
|
4703 | 4703 | print '<input type="hidden" name="action" value="setshippingmethod">'; |
4704 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
4704 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
4705 | 4705 | $this->selectShippingMethod($selected, $htmlname, '', $addempty); |
4706 | - print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
4706 | + print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
4707 | 4707 | print '</form>'; |
4708 | 4708 | } else { |
4709 | 4709 | if ($selected) { |
4710 | 4710 | $code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code'); |
4711 | - print $langs->trans("SendingMethod" . strtoupper($code)); |
|
4711 | + print $langs->trans("SendingMethod".strtoupper($code)); |
|
4712 | 4712 | } else { |
4713 | 4713 | print " "; |
4714 | 4714 | } |
@@ -4731,10 +4731,10 @@ discard block |
||
4731 | 4731 | |
4732 | 4732 | $opt = '<option value="" selected></option>'; |
4733 | 4733 | $sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc"; |
4734 | - $sql .= ' FROM ' . $this->db->prefix() . 'facture'; |
|
4735 | - $sql .= ' WHERE entity IN (' . getEntity('invoice') . ')'; |
|
4734 | + $sql .= ' FROM '.$this->db->prefix().'facture'; |
|
4735 | + $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; |
|
4736 | 4736 | $sql .= ' AND situation_counter >= 1'; |
4737 | - $sql .= ' AND fk_soc = ' . (int) $socid; |
|
4737 | + $sql .= ' AND fk_soc = '.(int) $socid; |
|
4738 | 4738 | $sql .= ' AND type <> 2'; |
4739 | 4739 | $sql .= ' ORDER by situation_cycle_ref, situation_counter desc'; |
4740 | 4740 | $resql = $this->db->query($sql); |
@@ -4752,19 +4752,19 @@ discard block |
||
4752 | 4752 | //Not prov? |
4753 | 4753 | if (substr($obj->ref, 1, 4) != 'PROV') { |
4754 | 4754 | if ($selected == $obj->rowid) { |
4755 | - $opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>'; |
|
4755 | + $opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>'; |
|
4756 | 4756 | } else { |
4757 | - $opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>'; |
|
4757 | + $opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>'; |
|
4758 | 4758 | } |
4759 | 4759 | } |
4760 | 4760 | } |
4761 | 4761 | } |
4762 | 4762 | } |
4763 | 4763 | } else { |
4764 | - dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR); |
|
4764 | + dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR); |
|
4765 | 4765 | } |
4766 | 4766 | if ($opt == '<option value ="" selected></option>') { |
4767 | - $opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>'; |
|
4767 | + $opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>'; |
|
4768 | 4768 | } |
4769 | 4769 | return $opt; |
4770 | 4770 | } |
@@ -4784,12 +4784,12 @@ discard block |
||
4784 | 4784 | |
4785 | 4785 | $langs->load('products'); |
4786 | 4786 | |
4787 | - $return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
4787 | + $return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
4788 | 4788 | |
4789 | - $sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units"; |
|
4789 | + $sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units"; |
|
4790 | 4790 | $sql .= ' WHERE active > 0'; |
4791 | 4791 | if (!empty($unit_type)) { |
4792 | - $sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'"; |
|
4792 | + $sql .= " AND unit_type = '".$this->db->escape($unit_type)."'"; |
|
4793 | 4793 | } |
4794 | 4794 | $sql .= " ORDER BY sortorder"; |
4795 | 4795 | |
@@ -4801,14 +4801,14 @@ discard block |
||
4801 | 4801 | |
4802 | 4802 | while ($res = $this->db->fetch_object($resql)) { |
4803 | 4803 | $unitLabel = $res->label; |
4804 | - if (!empty($langs->tab_translate['unit' . $res->code])) { // check if Translation is available before |
|
4805 | - $unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label; |
|
4804 | + if (!empty($langs->tab_translate['unit'.$res->code])) { // check if Translation is available before |
|
4805 | + $unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label; |
|
4806 | 4806 | } |
4807 | 4807 | |
4808 | 4808 | if ($selected == $res->rowid) { |
4809 | - $return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>'; |
|
4809 | + $return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>'; |
|
4810 | 4810 | } else { |
4811 | - $return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>'; |
|
4811 | + $return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>'; |
|
4812 | 4812 | } |
4813 | 4813 | } |
4814 | 4814 | $return .= '</select>'; |
@@ -4843,23 +4843,23 @@ discard block |
||
4843 | 4843 | $num = 0; |
4844 | 4844 | |
4845 | 4845 | $sql = "SELECT rowid, label, bank, clos as status, currency_code"; |
4846 | - $sql .= " FROM " . $this->db->prefix() . "bank_account"; |
|
4847 | - $sql .= " WHERE entity IN (" . getEntity('bank_account') . ")"; |
|
4846 | + $sql .= " FROM ".$this->db->prefix()."bank_account"; |
|
4847 | + $sql .= " WHERE entity IN (".getEntity('bank_account').")"; |
|
4848 | 4848 | if ($status != 2) { |
4849 | - $sql .= " AND clos = " . (int) $status; |
|
4849 | + $sql .= " AND clos = ".(int) $status; |
|
4850 | 4850 | } |
4851 | 4851 | if ($filtre) { |
4852 | - $sql .= " AND " . $filtre; |
|
4852 | + $sql .= " AND ".$filtre; |
|
4853 | 4853 | } |
4854 | 4854 | $sql .= " ORDER BY label"; |
4855 | 4855 | |
4856 | - dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG); |
|
4856 | + dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG); |
|
4857 | 4857 | $result = $this->db->query($sql); |
4858 | 4858 | if ($result) { |
4859 | 4859 | $num = $this->db->num_rows($result); |
4860 | 4860 | $i = 0; |
4861 | 4861 | if ($num) { |
4862 | - $out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
4862 | + $out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
4863 | 4863 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
4864 | 4864 | $out .= '<option value="-1"> </option>'; |
4865 | 4865 | } |
@@ -4867,27 +4867,27 @@ discard block |
||
4867 | 4867 | while ($i < $num) { |
4868 | 4868 | $obj = $this->db->fetch_object($result); |
4869 | 4869 | if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) { |
4870 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>'; |
|
4870 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>'; |
|
4871 | 4871 | } else { |
4872 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">'; |
|
4872 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">'; |
|
4873 | 4873 | } |
4874 | 4874 | $out .= trim($obj->label); |
4875 | 4875 | if ($showcurrency) { |
4876 | - $out .= ' (' . $obj->currency_code . ')'; |
|
4876 | + $out .= ' ('.$obj->currency_code.')'; |
|
4877 | 4877 | } |
4878 | 4878 | if ($status == 2 && $obj->status == 1) { |
4879 | - $out .= ' (' . $langs->trans("Closed") . ')'; |
|
4879 | + $out .= ' ('.$langs->trans("Closed").')'; |
|
4880 | 4880 | } |
4881 | 4881 | $out .= '</option>'; |
4882 | 4882 | $i++; |
4883 | 4883 | } |
4884 | 4884 | $out .= "</select>"; |
4885 | - $out .= ajax_combobox('select' . $htmlname); |
|
4885 | + $out .= ajax_combobox('select'.$htmlname); |
|
4886 | 4886 | } else { |
4887 | 4887 | if ($status == 0) { |
4888 | - $out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>'; |
|
4888 | + $out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>'; |
|
4889 | 4889 | } else { |
4890 | - $out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>'; |
|
4890 | + $out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>'; |
|
4891 | 4891 | } |
4892 | 4892 | } |
4893 | 4893 | } else { |
@@ -4923,23 +4923,23 @@ discard block |
||
4923 | 4923 | $num = 0; |
4924 | 4924 | |
4925 | 4925 | $sql = "SELECT rowid, name, fk_country, status, entity"; |
4926 | - $sql .= " FROM " . $this->db->prefix() . "establishment"; |
|
4926 | + $sql .= " FROM ".$this->db->prefix()."establishment"; |
|
4927 | 4927 | $sql .= " WHERE 1=1"; |
4928 | 4928 | if ($status != 2) { |
4929 | - $sql .= " AND status = " . (int) $status; |
|
4929 | + $sql .= " AND status = ".(int) $status; |
|
4930 | 4930 | } |
4931 | 4931 | if ($filtre) { |
4932 | - $sql .= " AND " . $filtre; |
|
4932 | + $sql .= " AND ".$filtre; |
|
4933 | 4933 | } |
4934 | 4934 | $sql .= " ORDER BY name"; |
4935 | 4935 | |
4936 | - dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG); |
|
4936 | + dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG); |
|
4937 | 4937 | $result = $this->db->query($sql); |
4938 | 4938 | if ($result) { |
4939 | 4939 | $num = $this->db->num_rows($result); |
4940 | 4940 | $i = 0; |
4941 | 4941 | if ($num) { |
4942 | - print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
4942 | + print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
4943 | 4943 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
4944 | 4944 | print '<option value="-1"> </option>'; |
4945 | 4945 | } |
@@ -4947,13 +4947,13 @@ discard block |
||
4947 | 4947 | while ($i < $num) { |
4948 | 4948 | $obj = $this->db->fetch_object($result); |
4949 | 4949 | if ($selected == $obj->rowid) { |
4950 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
4950 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
4951 | 4951 | } else { |
4952 | - print '<option value="' . $obj->rowid . '">'; |
|
4952 | + print '<option value="'.$obj->rowid.'">'; |
|
4953 | 4953 | } |
4954 | 4954 | print trim($obj->name); |
4955 | 4955 | if ($status == 2 && $obj->status == 1) { |
4956 | - print ' (' . $langs->trans("Closed") . ')'; |
|
4956 | + print ' ('.$langs->trans("Closed").')'; |
|
4957 | 4957 | } |
4958 | 4958 | print '</option>'; |
4959 | 4959 | $i++; |
@@ -4961,9 +4961,9 @@ discard block |
||
4961 | 4961 | print "</select>"; |
4962 | 4962 | } else { |
4963 | 4963 | if ($status == 0) { |
4964 | - print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>'; |
|
4964 | + print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>'; |
|
4965 | 4965 | } else { |
4966 | - print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>'; |
|
4966 | + print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>'; |
|
4967 | 4967 | } |
4968 | 4968 | } |
4969 | 4969 | |
@@ -4987,20 +4987,20 @@ discard block |
||
4987 | 4987 | { |
4988 | 4988 | global $langs; |
4989 | 4989 | if ($htmlname != "none") { |
4990 | - print '<form method="POST" action="' . $page . '">'; |
|
4990 | + print '<form method="POST" action="'.$page.'">'; |
|
4991 | 4991 | print '<input type="hidden" name="action" value="setbankaccount">'; |
4992 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
4992 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
4993 | 4993 | print img_picto('', 'bank_account', 'class="pictofixedwidth"'); |
4994 | 4994 | $nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty); |
4995 | 4995 | if ($nbaccountfound > 0) { |
4996 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
4996 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
4997 | 4997 | } |
4998 | 4998 | print '</form>'; |
4999 | 4999 | } else { |
5000 | 5000 | $langs->load('banks'); |
5001 | 5001 | |
5002 | 5002 | if ($selected) { |
5003 | - require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
5003 | + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
5004 | 5004 | $bankstatic = new Account($this->db); |
5005 | 5005 | $result = $bankstatic->fetch($selected); |
5006 | 5006 | if ($result) { |
@@ -5038,19 +5038,19 @@ discard block |
||
5038 | 5038 | global $conf, $langs; |
5039 | 5039 | $langs->load("categories"); |
5040 | 5040 | |
5041 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
5041 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
5042 | 5042 | |
5043 | 5043 | // For backward compatibility |
5044 | 5044 | if (is_numeric($type)) { |
5045 | - dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
5045 | + dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
5046 | 5046 | } |
5047 | 5047 | |
5048 | 5048 | if ($type === Categorie::TYPE_BANK_LINE) { |
5049 | 5049 | // TODO Move this into common category feature |
5050 | 5050 | $cate_arbo = array(); |
5051 | 5051 | $sql = "SELECT c.label, c.rowid"; |
5052 | - $sql .= " FROM " . $this->db->prefix() . "bank_categ as c"; |
|
5053 | - $sql .= " WHERE entity = " . $conf->entity; |
|
5052 | + $sql .= " FROM ".$this->db->prefix()."bank_categ as c"; |
|
5053 | + $sql .= " WHERE entity = ".$conf->entity; |
|
5054 | 5054 | $sql .= " ORDER BY c.label"; |
5055 | 5055 | $result = $this->db->query($sql); |
5056 | 5056 | if ($result) { |
@@ -5074,10 +5074,10 @@ discard block |
||
5074 | 5074 | |
5075 | 5075 | $outarray = array(); |
5076 | 5076 | |
5077 | - $output = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
5077 | + $output = '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
5078 | 5078 | if (is_array($cate_arbo)) { |
5079 | 5079 | if (!count($cate_arbo)) { |
5080 | - $output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>'; |
|
5080 | + $output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>'; |
|
5081 | 5081 | } else { |
5082 | 5082 | $output .= '<option value="-1"> </option>'; |
5083 | 5083 | foreach ($cate_arbo as $key => $value) { |
@@ -5086,8 +5086,8 @@ discard block |
||
5086 | 5086 | } else { |
5087 | 5087 | $add = ''; |
5088 | 5088 | } |
5089 | - $output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"'; |
|
5090 | - $output .= ' data-html="' . dol_escape_htmltag(img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"') . dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle')) . '"'; |
|
5089 | + $output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"'; |
|
5090 | + $output .= ' data-html="'.dol_escape_htmltag(img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"').dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle')).'"'; |
|
5091 | 5091 | $output .= '>'; |
5092 | 5092 | $output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
5093 | 5093 | $output .= '</option>'; |
@@ -5128,7 +5128,7 @@ discard block |
||
5128 | 5128 | public function form_confirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = "", $useajax = 0, $height = 170, $width = 500) |
5129 | 5129 | { |
5130 | 5130 | // phpcs:enable |
5131 | - dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
5131 | + dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
5132 | 5132 | print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width); |
5133 | 5133 | } |
5134 | 5134 | |
@@ -5163,7 +5163,7 @@ discard block |
||
5163 | 5163 | { |
5164 | 5164 | global $langs, $conf; |
5165 | 5165 | |
5166 | - $more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->'; |
|
5166 | + $more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->'; |
|
5167 | 5167 | $formconfirm = ''; |
5168 | 5168 | $inputok = array(); |
5169 | 5169 | $inputko = array(); |
@@ -5187,27 +5187,27 @@ discard block |
||
5187 | 5187 | foreach ($formquestion as $key => $input) { |
5188 | 5188 | if (is_array($input) && !empty($input)) { |
5189 | 5189 | if ($input['type'] == 'hidden') { |
5190 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
5191 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
5190 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
5191 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
5192 | 5192 | |
5193 | - $more .= '<input type="hidden" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '" value="' . dol_escape_htmltag($input['value']) . '" class="' . $morecss . '"' . $moreattr . '>' . "\n"; |
|
5193 | + $more .= '<input type="hidden" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'" value="'.dol_escape_htmltag($input['value']).'" class="'.$morecss.'"'.$moreattr.'>'."\n"; |
|
5194 | 5194 | } |
5195 | 5195 | } |
5196 | 5196 | } |
5197 | 5197 | |
5198 | 5198 | // Now add questions |
5199 | 5199 | $moreonecolumn = ''; |
5200 | - $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n"; |
|
5200 | + $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n"; |
|
5201 | 5201 | foreach ($formquestion as $key => $input) { |
5202 | 5202 | if (is_array($input) && !empty($input)) { |
5203 | - $size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : ''); // deprecated. Use morecss instead. |
|
5204 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
5205 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
5203 | + $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead. |
|
5204 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
5205 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
5206 | 5206 | |
5207 | 5207 | if ($input['type'] == 'text') { |
5208 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div><div class="tagtd"><input type="text" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $size . ' value="' . (empty($input['value']) ? '' : $input['value']) . '"' . $moreattr . ' /></div></div>' . "\n"; |
|
5208 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n"; |
|
5209 | 5209 | } elseif ($input['type'] == 'password') { |
5210 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div><div class="tagtd"><input type="password" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $size . ' value="' . (empty($input['value']) ? '' : $input['value']) . '"' . $moreattr . ' /></div></div>' . "\n"; |
|
5210 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n"; |
|
5211 | 5211 | } elseif ($input['type'] == 'textarea') { |
5212 | 5212 | /*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">'; |
5213 | 5213 | $more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>'; |
@@ -5215,8 +5215,8 @@ discard block |
||
5215 | 5215 | $more .= '</textarea>'; |
5216 | 5216 | $more .= '</div></div>'."\n";*/ |
5217 | 5217 | $moreonecolumn .= '<div class="margintoponly">'; |
5218 | - $moreonecolumn .= $input['label'] . '<br>'; |
|
5219 | - $moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>'; |
|
5218 | + $moreonecolumn .= $input['label'].'<br>'; |
|
5219 | + $moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>'; |
|
5220 | 5220 | $moreonecolumn .= $input['value']; |
5221 | 5221 | $moreonecolumn .= '</textarea>'; |
5222 | 5222 | $moreonecolumn .= '</div>'; |
@@ -5233,20 +5233,20 @@ discard block |
||
5233 | 5233 | $disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0; |
5234 | 5234 | $sort = isset($input['select_sort']) ? $input['select_sort'] : ''; |
5235 | 5235 | |
5236 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">'; |
|
5236 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
|
5237 | 5237 | if (!empty($input['label'])) { |
5238 | - $more .= $input['label'] . '</div><div class="tagtd left">'; |
|
5238 | + $more .= $input['label'].'</div><div class="tagtd left">'; |
|
5239 | 5239 | } |
5240 | 5240 | if ($input['type'] == 'select') { |
5241 | 5241 | $more .= $this->selectarray($input['name'], $input['values'], isset($input['default']) ? $input['default'] : '-1', $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss); |
5242 | 5242 | } else { |
5243 | 5243 | $more .= $this->multiselectarray($input['name'], $input['values'], is_array($input['default']) ? $input['default'] : [$input['default']], $key_in_label, $value_as_key, $morecss, $translate, $maxlen, $moreattr); |
5244 | 5244 | } |
5245 | - $more .= '</div></div>' . "\n"; |
|
5245 | + $more .= '</div></div>'."\n"; |
|
5246 | 5246 | } elseif ($input['type'] == 'checkbox') { |
5247 | 5247 | $more .= '<div class="tagtr">'; |
5248 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">'; |
|
5249 | - $more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr; |
|
5248 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">'; |
|
5249 | + $more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr; |
|
5250 | 5250 | if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') { |
5251 | 5251 | $more .= ' checked'; |
5252 | 5252 | } |
@@ -5257,19 +5257,19 @@ discard block |
||
5257 | 5257 | $more .= ' disabled'; |
5258 | 5258 | } |
5259 | 5259 | $more .= ' /></div>'; |
5260 | - $more .= '</div>' . "\n"; |
|
5260 | + $more .= '</div>'."\n"; |
|
5261 | 5261 | } elseif ($input['type'] == 'radio') { |
5262 | 5262 | $i = 0; |
5263 | 5263 | foreach ($input['values'] as $selkey => $selval) { |
5264 | 5264 | $more .= '<div class="tagtr">'; |
5265 | 5265 | if (isset($input['label'])) { |
5266 | 5266 | if ($i == 0) { |
5267 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
5267 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
5268 | 5268 | } else { |
5269 | - $more .= '<div clas="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '"> </div>'; |
|
5269 | + $more .= '<div clas="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'"> </div>'; |
|
5270 | 5270 | } |
5271 | 5271 | } |
5272 | - $more .= '<div class="tagtd' . ($i == 0 ? ' tdtop' : '') . '"><input type="radio" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name'] . $selkey) . '" name="' . dol_escape_htmltag($input['name']) . '" value="' . $selkey . '"' . $moreattr; |
|
5272 | + $more .= '<div class="tagtd'.($i == 0 ? ' tdtop' : '').'"><input type="radio" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name'].$selkey).'" name="'.dol_escape_htmltag($input['name']).'" value="'.$selkey.'"'.$moreattr; |
|
5273 | 5273 | if (!empty($input['disabled'])) { |
5274 | 5274 | $more .= ' disabled'; |
5275 | 5275 | } |
@@ -5277,12 +5277,12 @@ discard block |
||
5277 | 5277 | $more .= ' checked="checked"'; |
5278 | 5278 | } |
5279 | 5279 | $more .= ' /> '; |
5280 | - $more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>'; |
|
5281 | - $more .= '</div></div>' . "\n"; |
|
5280 | + $more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>'; |
|
5281 | + $more .= '</div></div>'."\n"; |
|
5282 | 5282 | $i++; |
5283 | 5283 | } |
5284 | 5284 | } elseif ($input['type'] == 'date' || $input['type'] == 'datetime') { |
5285 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
5285 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
5286 | 5286 | $more .= '<div class="tagtd">'; |
5287 | 5287 | $addnowlink = (empty($input['datenow']) ? 0 : 1); |
5288 | 5288 | $h = $m = 0; |
@@ -5300,24 +5300,24 @@ discard block |
||
5300 | 5300 | } elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not |
5301 | 5301 | $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
5302 | 5302 | if (!empty($input['label'])) { |
5303 | - $more .= $input['label'] . '</div><div class="tagtd">'; |
|
5303 | + $more .= $input['label'].'</div><div class="tagtd">'; |
|
5304 | 5304 | } |
5305 | 5305 | $more .= $input['value']; |
5306 | - $more .= '</div></div>' . "\n"; |
|
5306 | + $more .= '</div></div>'."\n"; |
|
5307 | 5307 | } elseif ($input['type'] == 'onecolumn') { |
5308 | 5308 | $moreonecolumn .= '<div class="margintoponly">'; |
5309 | 5309 | $moreonecolumn .= $input['value']; |
5310 | - $moreonecolumn .= '</div>' . "\n"; |
|
5310 | + $moreonecolumn .= '</div>'."\n"; |
|
5311 | 5311 | } elseif ($input['type'] == 'hidden') { |
5312 | 5312 | // Do nothing more, already added by a previous loop |
5313 | 5313 | } elseif ($input['type'] == 'separator') { |
5314 | 5314 | $more .= '<br>'; |
5315 | 5315 | } else { |
5316 | - $more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type'; |
|
5316 | + $more .= 'Error type '.$input['type'].' for the confirm box is not a supported type'; |
|
5317 | 5317 | } |
5318 | 5318 | } |
5319 | 5319 | } |
5320 | - $more .= '</div>' . "\n"; |
|
5320 | + $more .= '</div>'."\n"; |
|
5321 | 5321 | $more .= $moreonecolumn; |
5322 | 5322 | } |
5323 | 5323 | |
@@ -5339,10 +5339,10 @@ discard block |
||
5339 | 5339 | $button = $useajax; |
5340 | 5340 | $useajax = 1; |
5341 | 5341 | $autoOpen = false; |
5342 | - $dialogconfirm .= '-' . $button; |
|
5342 | + $dialogconfirm .= '-'.$button; |
|
5343 | 5343 | } |
5344 | - $pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes'; |
|
5345 | - $pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : ''); |
|
5344 | + $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes'; |
|
5345 | + $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : ''); |
|
5346 | 5346 | |
5347 | 5347 | // Add input fields into list of fields to read during submit (inputok and inputko) |
5348 | 5348 | if (is_array($formquestion)) { |
@@ -5364,24 +5364,24 @@ discard block |
||
5364 | 5364 | } |
5365 | 5365 | |
5366 | 5366 | // Show JQuery confirm box. |
5367 | - $formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">'; |
|
5367 | + $formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">'; |
|
5368 | 5368 | if (is_array($formquestion) && !empty($formquestion['text'])) { |
5369 | - $formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n"; |
|
5369 | + $formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n"; |
|
5370 | 5370 | } |
5371 | 5371 | if (!empty($more)) { |
5372 | - $formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n"; |
|
5372 | + $formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n"; |
|
5373 | 5373 | } |
5374 | - $formconfirm .= ($question ? '<div class="confirmmessage">' . img_help('', '') . ' ' . $question . '</div>' : ''); |
|
5375 | - $formconfirm .= '</div>' . "\n"; |
|
5374 | + $formconfirm .= ($question ? '<div class="confirmmessage">'.img_help('', '').' '.$question.'</div>' : ''); |
|
5375 | + $formconfirm .= '</div>'."\n"; |
|
5376 | 5376 | |
5377 | - $formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n"; |
|
5378 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
5377 | + $formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n"; |
|
5378 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
5379 | 5379 | $formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n"; |
5380 | 5380 | $formconfirm .= 'jQuery(document).ready(function() { |
5381 | 5381 | $(function() { |
5382 | - $( "#' . $dialogconfirm . '" ).dialog( |
|
5382 | + $( "#' . $dialogconfirm.'" ).dialog( |
|
5383 | 5383 | { |
5384 | - autoOpen: ' . ($autoOpen ? "true" : "false") . ','; |
|
5384 | + autoOpen: ' . ($autoOpen ? "true" : "false").','; |
|
5385 | 5385 | if ($newselectedchoice == 'no') { |
5386 | 5386 | $formconfirm .= ' |
5387 | 5387 | open: function() { |
@@ -5391,24 +5391,24 @@ discard block |
||
5391 | 5391 | |
5392 | 5392 | $jsforcursor = ''; |
5393 | 5393 | if ($useajax == 1) { |
5394 | - $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n"; |
|
5395 | - $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n"; |
|
5394 | + $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n"; |
|
5395 | + $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n"; |
|
5396 | 5396 | } |
5397 | 5397 | |
5398 | 5398 | $postconfirmas = 'GET'; |
5399 | 5399 | |
5400 | 5400 | $formconfirm .= ' |
5401 | 5401 | resizable: false, |
5402 | - height: "' . $height . '", |
|
5403 | - width: "' . $width . '", |
|
5402 | + height: "' . $height.'", |
|
5403 | + width: "' . $width.'", |
|
5404 | 5404 | modal: true, |
5405 | 5405 | closeOnEscape: false, |
5406 | 5406 | buttons: { |
5407 | - "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() { |
|
5408 | - var options = "token=' . urlencode(newToken()) . '"; |
|
5409 | - var inputok = ' . json_encode($inputok) . '; /* List of fields into form */ |
|
5410 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
5411 | - var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '"; |
|
5407 | + "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() { |
|
5408 | + var options = "token=' . urlencode(newToken()).'"; |
|
5409 | + var inputok = ' . json_encode($inputok).'; /* List of fields into form */ |
|
5410 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
5411 | + var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; |
|
5412 | 5412 | |
5413 | 5413 | if (inputok.length > 0) { |
5414 | 5414 | $.each(inputok, function(i, inputname) { |
@@ -5442,11 +5442,11 @@ discard block |
||
5442 | 5442 | } |
5443 | 5443 | $(this).dialog("close"); |
5444 | 5444 | }, |
5445 | - "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() { |
|
5446 | - var options = "token=' . urlencode(newToken()) . '"; |
|
5447 | - var inputko = ' . json_encode($inputko) . '; /* List of fields into form */ |
|
5448 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
5449 | - var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '"; |
|
5445 | + "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() { |
|
5446 | + var options = "token=' . urlencode(newToken()).'"; |
|
5447 | + var inputko = ' . json_encode($inputko).'; /* List of fields into form */ |
|
5448 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
5449 | + var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'"; |
|
5450 | 5450 | if (inputko.length > 0) { |
5451 | 5451 | $.each(inputko, function(i, inputname) { |
5452 | 5452 | var more = ""; |
@@ -5478,10 +5478,10 @@ discard block |
||
5478 | 5478 | } |
5479 | 5479 | ); |
5480 | 5480 | |
5481 | - var button = "' . $button . '"; |
|
5481 | + var button = "' . $button.'"; |
|
5482 | 5482 | if (button.length > 0) { |
5483 | 5483 | $( "#" + button ).click(function() { |
5484 | - $("#' . $dialogconfirm . '").dialog("open"); |
|
5484 | + $("#' . $dialogconfirm.'").dialog("open"); |
|
5485 | 5485 | }); |
5486 | 5486 | } |
5487 | 5487 | }); |
@@ -5489,44 +5489,44 @@ discard block |
||
5489 | 5489 | </script>'; |
5490 | 5490 | $formconfirm .= "<!-- end ajax formconfirm -->\n"; |
5491 | 5491 | } else { |
5492 | - $formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n"; |
|
5492 | + $formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n"; |
|
5493 | 5493 | |
5494 | 5494 | if (empty($disableformtag)) { |
5495 | - $formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n"; |
|
5495 | + $formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n"; |
|
5496 | 5496 | } |
5497 | 5497 | |
5498 | - $formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n"; |
|
5499 | - $formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n"; |
|
5498 | + $formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n"; |
|
5499 | + $formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n"; |
|
5500 | 5500 | |
5501 | - $formconfirm .= '<table class="valid centpercent">' . "\n"; |
|
5501 | + $formconfirm .= '<table class="valid centpercent">'."\n"; |
|
5502 | 5502 | |
5503 | 5503 | // Line title |
5504 | 5504 | $formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">'; |
5505 | - $formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title; |
|
5506 | - $formconfirm .= '</td></tr>' . "\n"; |
|
5505 | + $formconfirm .= img_picto('', 'pictoconfirm').' '.$title; |
|
5506 | + $formconfirm .= '</td></tr>'."\n"; |
|
5507 | 5507 | |
5508 | 5508 | // Line text |
5509 | 5509 | if (is_array($formquestion) && !empty($formquestion['text'])) { |
5510 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n"; |
|
5510 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n"; |
|
5511 | 5511 | } |
5512 | 5512 | |
5513 | 5513 | // Line form fields |
5514 | 5514 | if ($more) { |
5515 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n"; |
|
5515 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n"; |
|
5516 | 5516 | $formconfirm .= $more; |
5517 | - $formconfirm .= '</td></tr>' . "\n"; |
|
5517 | + $formconfirm .= '</td></tr>'."\n"; |
|
5518 | 5518 | } |
5519 | 5519 | |
5520 | 5520 | // Line with question |
5521 | 5521 | $formconfirm .= '<tr class="valid">'; |
5522 | - $formconfirm .= '<td class="valid">' . $question . '</td>'; |
|
5522 | + $formconfirm .= '<td class="valid">'.$question.'</td>'; |
|
5523 | 5523 | $formconfirm .= '<td class="valid center">'; |
5524 | 5524 | $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno); |
5525 | - $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">'; |
|
5525 | + $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">'; |
|
5526 | 5526 | $formconfirm .= '</td>'; |
5527 | - $formconfirm .= '</tr>' . "\n"; |
|
5527 | + $formconfirm .= '</tr>'."\n"; |
|
5528 | 5528 | |
5529 | - $formconfirm .= '</table>' . "\n"; |
|
5529 | + $formconfirm .= '</table>'."\n"; |
|
5530 | 5530 | |
5531 | 5531 | if (empty($disableformtag)) { |
5532 | 5532 | $formconfirm .= "</form>\n"; |
@@ -5535,7 +5535,7 @@ discard block |
||
5535 | 5535 | |
5536 | 5536 | if (!empty($conf->use_javascript_ajax)) { |
5537 | 5537 | $formconfirm .= '<!-- code to disable button to avoid double clic -->'; |
5538 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
5538 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
5539 | 5539 | $formconfirm .= ' |
5540 | 5540 | $(document).ready(function () { |
5541 | 5541 | $(".confirmvalidatebutton").on("click", function() { |
@@ -5547,7 +5547,7 @@ discard block |
||
5547 | 5547 | }); |
5548 | 5548 | }); |
5549 | 5549 | '; |
5550 | - $formconfirm .= '</script>' . "\n"; |
|
5550 | + $formconfirm .= '</script>'."\n"; |
|
5551 | 5551 | } |
5552 | 5552 | |
5553 | 5553 | $formconfirm .= "<!-- end formconfirm -->\n"; |
@@ -5579,8 +5579,8 @@ discard block |
||
5579 | 5579 | // phpcs:enable |
5580 | 5580 | global $langs; |
5581 | 5581 | |
5582 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
5583 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
5582 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
5583 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
5584 | 5584 | |
5585 | 5585 | $out = ''; |
5586 | 5586 | |
@@ -5588,11 +5588,11 @@ discard block |
||
5588 | 5588 | |
5589 | 5589 | $langs->load("project"); |
5590 | 5590 | if ($htmlname != "none") { |
5591 | - $out .= '<form method="post" action="' . $page . '">'; |
|
5591 | + $out .= '<form method="post" action="'.$page.'">'; |
|
5592 | 5592 | $out .= '<input type="hidden" name="action" value="classin">'; |
5593 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5593 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5594 | 5594 | $out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss); |
5595 | - $out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
5595 | + $out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
5596 | 5596 | $out .= '</form>'; |
5597 | 5597 | } else { |
5598 | 5598 | $out .= '<span class="project_head_block">'; |
@@ -5601,7 +5601,7 @@ discard block |
||
5601 | 5601 | $projet->fetch($selected); |
5602 | 5602 | $out .= $projet->getNomUrl(0, '', 1); |
5603 | 5603 | } else { |
5604 | - $out .= '<span class="opacitymedium">' . $textifnoproject . '</span>'; |
|
5604 | + $out .= '<span class="opacitymedium">'.$textifnoproject.'</span>'; |
|
5605 | 5605 | } |
5606 | 5606 | $out .= '</span>'; |
5607 | 5607 | } |
@@ -5638,14 +5638,14 @@ discard block |
||
5638 | 5638 | $out = ''; |
5639 | 5639 | |
5640 | 5640 | if ($htmlname != "none") { |
5641 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
5641 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
5642 | 5642 | $out .= '<input type="hidden" name="action" value="setconditions">'; |
5643 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5643 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5644 | 5644 | if ($type) { |
5645 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
5645 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
5646 | 5646 | } |
5647 | 5647 | $out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); |
5648 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
5648 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
5649 | 5649 | $out .= '</form>'; |
5650 | 5650 | } else { |
5651 | 5651 | if ($selected) { |
@@ -5690,12 +5690,12 @@ discard block |
||
5690 | 5690 | // phpcs:enable |
5691 | 5691 | global $langs; |
5692 | 5692 | if ($htmlname != "none") { |
5693 | - print '<form method="post" action="' . $page . '">'; |
|
5693 | + print '<form method="post" action="'.$page.'">'; |
|
5694 | 5694 | print '<input type="hidden" name="action" value="setavailability">'; |
5695 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5695 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5696 | 5696 | $this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty); |
5697 | - print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
5698 | - print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">'; |
|
5697 | + print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
5698 | + print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">'; |
|
5699 | 5699 | print '</form>'; |
5700 | 5700 | } else { |
5701 | 5701 | if ($selected) { |
@@ -5721,11 +5721,11 @@ discard block |
||
5721 | 5721 | { |
5722 | 5722 | global $langs; |
5723 | 5723 | if ($htmlname != "none") { |
5724 | - print '<form method="post" action="' . $page . '">'; |
|
5724 | + print '<form method="post" action="'.$page.'">'; |
|
5725 | 5725 | print '<input type="hidden" name="action" value="setdemandreason">'; |
5726 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5726 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5727 | 5727 | $this->selectInputReason($selected, $htmlname, -1, $addempty); |
5728 | - print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
5728 | + print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
5729 | 5729 | print '</form>'; |
5730 | 5730 | } else { |
5731 | 5731 | if ($selected) { |
@@ -5765,17 +5765,17 @@ discard block |
||
5765 | 5765 | $ret = ''; |
5766 | 5766 | |
5767 | 5767 | if ($htmlname != "none") { |
5768 | - $ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
5769 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
5770 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5768 | + $ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
5769 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
5770 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5771 | 5771 | if ($type) { |
5772 | - $ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
5772 | + $ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
5773 | 5773 | } |
5774 | 5774 | $ret .= '<table class="nobordernopadding">'; |
5775 | 5775 | $ret .= '<tr><td>'; |
5776 | - $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0); |
|
5776 | + $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0); |
|
5777 | 5777 | $ret .= '</td>'; |
5778 | - $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
5778 | + $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
5779 | 5779 | $ret .= '</tr></table></form>'; |
5780 | 5780 | } else { |
5781 | 5781 | if ($displayhour) { |
@@ -5810,15 +5810,15 @@ discard block |
||
5810 | 5810 | global $langs; |
5811 | 5811 | |
5812 | 5812 | if ($htmlname != "none") { |
5813 | - print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
5814 | - print '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
5815 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5813 | + print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
5814 | + print '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
5815 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5816 | 5816 | print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include); |
5817 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
5817 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
5818 | 5818 | print '</form>'; |
5819 | 5819 | } else { |
5820 | 5820 | if ($selected) { |
5821 | - require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
5821 | + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
5822 | 5822 | $theuser = new User($this->db); |
5823 | 5823 | $theuser->fetch($selected); |
5824 | 5824 | print $theuser->getNomUrl(1); |
@@ -5851,14 +5851,14 @@ discard block |
||
5851 | 5851 | |
5852 | 5852 | $out = ''; |
5853 | 5853 | if ($htmlname != "none") { |
5854 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
5854 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
5855 | 5855 | $out .= '<input type="hidden" name="action" value="setmode">'; |
5856 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5856 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5857 | 5857 | if ($type) { |
5858 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
5858 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
5859 | 5859 | } |
5860 | 5860 | $out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); |
5861 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
5861 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
5862 | 5862 | $out .= '</form>'; |
5863 | 5863 | } else { |
5864 | 5864 | if ($selected) { |
@@ -5891,11 +5891,11 @@ discard block |
||
5891 | 5891 | { |
5892 | 5892 | global $langs; |
5893 | 5893 | if ($htmlname != "none") { |
5894 | - print '<form method="POST" action="' . $page . '">'; |
|
5894 | + print '<form method="POST" action="'.$page.'">'; |
|
5895 | 5895 | print '<input type="hidden" name="action" value="settransportmode">'; |
5896 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5896 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5897 | 5897 | $this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active); |
5898 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
5898 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
5899 | 5899 | print '</form>'; |
5900 | 5900 | } else { |
5901 | 5901 | if ($selected) { |
@@ -5922,11 +5922,11 @@ discard block |
||
5922 | 5922 | // phpcs:enable |
5923 | 5923 | global $langs; |
5924 | 5924 | if ($htmlname != "none") { |
5925 | - print '<form method="POST" action="' . $page . '">'; |
|
5925 | + print '<form method="POST" action="'.$page.'">'; |
|
5926 | 5926 | print '<input type="hidden" name="action" value="setmulticurrencycode">'; |
5927 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5927 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5928 | 5928 | print $this->selectMultiCurrency($selected, $htmlname, 0); |
5929 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
5929 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
5930 | 5930 | print '</form>'; |
5931 | 5931 | } else { |
5932 | 5932 | dol_include_once('/core/lib/company.lib.php'); |
@@ -5951,21 +5951,21 @@ discard block |
||
5951 | 5951 | global $langs, $mysoc, $conf; |
5952 | 5952 | |
5953 | 5953 | if ($htmlname != "none") { |
5954 | - print '<form method="POST" action="' . $page . '">'; |
|
5954 | + print '<form method="POST" action="'.$page.'">'; |
|
5955 | 5955 | print '<input type="hidden" name="action" value="setmulticurrencyrate">'; |
5956 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5957 | - print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> '; |
|
5956 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5957 | + print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> '; |
|
5958 | 5958 | print '<select name="calculation_mode">'; |
5959 | - print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>'; |
|
5960 | - print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>'; |
|
5959 | + print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>'; |
|
5960 | + print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>'; |
|
5961 | 5961 | print '</select> '; |
5962 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
5962 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
5963 | 5963 | print '</form>'; |
5964 | 5964 | } else { |
5965 | 5965 | if (!empty($rate)) { |
5966 | 5966 | print price($rate, 1, $langs, 1, 0); |
5967 | 5967 | if ($currency && $rate != 1) { |
5968 | - print ' (' . price($rate, 1, $langs, 1, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')'; |
|
5968 | + print ' ('.price($rate, 1, $langs, 1, 0).' '.$currency.' = 1 '.$conf->currency.')'; |
|
5969 | 5969 | } |
5970 | 5970 | } else { |
5971 | 5971 | print 1; |
@@ -5996,9 +5996,9 @@ discard block |
||
5996 | 5996 | // phpcs:enable |
5997 | 5997 | global $conf, $langs; |
5998 | 5998 | if ($htmlname != "none") { |
5999 | - print '<form method="post" action="' . $page . '">'; |
|
5999 | + print '<form method="post" action="'.$page.'">'; |
|
6000 | 6000 | print '<input type="hidden" name="action" value="setabsolutediscount">'; |
6001 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6001 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6002 | 6002 | print '<div class="inline-block">'; |
6003 | 6003 | if (!empty($discount_type)) { |
6004 | 6004 | if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { |
@@ -6036,24 +6036,24 @@ discard block |
||
6036 | 6036 | print '</div>'; |
6037 | 6037 | if (empty($hidelist)) { |
6038 | 6038 | print '<div class="inline-block" style="padding-right: 10px">'; |
6039 | - $newfilter = 'discount_type=' . intval($discount_type); |
|
6039 | + $newfilter = 'discount_type='.intval($discount_type); |
|
6040 | 6040 | if (!empty($discount_type)) { |
6041 | 6041 | $newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available |
6042 | 6042 | } else { |
6043 | 6043 | $newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available |
6044 | 6044 | } |
6045 | 6045 | if ($filter) { |
6046 | - $newfilter .= ' AND (' . $filter . ')'; |
|
6046 | + $newfilter .= ' AND ('.$filter.')'; |
|
6047 | 6047 | } |
6048 | 6048 | // output the combo of discounts |
6049 | 6049 | $nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue); |
6050 | 6050 | if ($nbqualifiedlines > 0) { |
6051 | - print ' <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"'; |
|
6051 | + print ' <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"'; |
|
6052 | 6052 | if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") { |
6053 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
6053 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
6054 | 6054 | } |
6055 | 6055 | if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") { |
6056 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
6056 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
6057 | 6057 | } |
6058 | 6058 | |
6059 | 6059 | print '>'; |
@@ -6093,23 +6093,23 @@ discard block |
||
6093 | 6093 | global $langs, $conf; |
6094 | 6094 | |
6095 | 6095 | if ($htmlname != "none") { |
6096 | - print '<form method="post" action="' . $page . '">'; |
|
6096 | + print '<form method="post" action="'.$page.'">'; |
|
6097 | 6097 | print '<input type="hidden" name="action" value="set_contact">'; |
6098 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6098 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6099 | 6099 | print '<table class="nobordernopadding">'; |
6100 | 6100 | print '<tr><td>'; |
6101 | 6101 | print $this->selectcontacts($societe->id, $selected, $htmlname); |
6102 | 6102 | $num = $this->num; |
6103 | 6103 | if ($num == 0) { |
6104 | 6104 | $addcontact = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); |
6105 | - print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>'; |
|
6105 | + print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$addcontact.'</a>'; |
|
6106 | 6106 | } |
6107 | 6107 | print '</td>'; |
6108 | - print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
6108 | + print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
6109 | 6109 | print '</tr></table></form>'; |
6110 | 6110 | } else { |
6111 | 6111 | if ($selected) { |
6112 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
6112 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
6113 | 6113 | $contact = new Contact($this->db); |
6114 | 6114 | $contact->fetch($selected); |
6115 | 6115 | print $contact->getFullName($langs); |
@@ -6144,20 +6144,20 @@ discard block |
||
6144 | 6144 | |
6145 | 6145 | $out = ''; |
6146 | 6146 | if ($htmlname != "none") { |
6147 | - $out .= '<form method="post" action="' . $page . '">'; |
|
6147 | + $out .= '<form method="post" action="'.$page.'">'; |
|
6148 | 6148 | $out .= '<input type="hidden" name="action" value="set_thirdparty">'; |
6149 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6149 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6150 | 6150 | $out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids); |
6151 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6151 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
6152 | 6152 | $out .= '</form>'; |
6153 | 6153 | } else { |
6154 | 6154 | if ($selected) { |
6155 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
6155 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
6156 | 6156 | $soc = new Societe($this->db); |
6157 | 6157 | $soc->fetch($selected); |
6158 | 6158 | $out .= $soc->getNomUrl(0, ''); |
6159 | 6159 | } else { |
6160 | - $out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>'; |
|
6160 | + $out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>'; |
|
6161 | 6161 | } |
6162 | 6162 | } |
6163 | 6163 | |
@@ -6207,22 +6207,22 @@ discard block |
||
6207 | 6207 | $selected = 'EUR'; // Pour compatibilite |
6208 | 6208 | } |
6209 | 6209 | |
6210 | - $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
6210 | + $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
6211 | 6211 | if ($useempty) { |
6212 | 6212 | $out .= '<option value="-1" selected></option>'; |
6213 | 6213 | } |
6214 | 6214 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
6215 | 6215 | $labeltoshow = $currency['label']; |
6216 | 6216 | if ($mode == 1) { |
6217 | - $labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>'; |
|
6217 | + $labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>'; |
|
6218 | 6218 | } else { |
6219 | - $labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>'; |
|
6219 | + $labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>'; |
|
6220 | 6220 | } |
6221 | 6221 | |
6222 | 6222 | if ($selected && $selected == $code_iso) { |
6223 | - $out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
6223 | + $out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
6224 | 6224 | } else { |
6225 | - $out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
6225 | + $out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
6226 | 6226 | } |
6227 | 6227 | $out .= $labeltoshow; |
6228 | 6228 | $out .= '</option>'; |
@@ -6233,7 +6233,7 @@ discard block |
||
6233 | 6233 | } |
6234 | 6234 | |
6235 | 6235 | // Make select dynamic |
6236 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
6236 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
6237 | 6237 | $out .= ajax_combobox($htmlname); |
6238 | 6238 | |
6239 | 6239 | return $out; |
@@ -6259,10 +6259,10 @@ discard block |
||
6259 | 6259 | |
6260 | 6260 | $TCurrency = array(); |
6261 | 6261 | |
6262 | - $sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency"; |
|
6263 | - $sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')"; |
|
6262 | + $sql = "SELECT code FROM ".$this->db->prefix()."multicurrency"; |
|
6263 | + $sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')"; |
|
6264 | 6264 | if ($filter) { |
6265 | - $sql .= " AND " . $filter; |
|
6265 | + $sql .= " AND ".$filter; |
|
6266 | 6266 | } |
6267 | 6267 | $resql = $this->db->query($sql); |
6268 | 6268 | if ($resql) { |
@@ -6272,7 +6272,7 @@ discard block |
||
6272 | 6272 | } |
6273 | 6273 | |
6274 | 6274 | $out = ''; |
6275 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
6275 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
6276 | 6276 | if ($useempty) { |
6277 | 6277 | $out .= '<option value=""> </option>'; |
6278 | 6278 | } |
@@ -6284,13 +6284,13 @@ discard block |
||
6284 | 6284 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
6285 | 6285 | if (isset($TCurrency[$code_iso])) { |
6286 | 6286 | if (!empty($selected) && $selected == $code_iso) { |
6287 | - $out .= '<option value="' . $code_iso . '" selected="selected">'; |
|
6287 | + $out .= '<option value="'.$code_iso.'" selected="selected">'; |
|
6288 | 6288 | } else { |
6289 | - $out .= '<option value="' . $code_iso . '">'; |
|
6289 | + $out .= '<option value="'.$code_iso.'">'; |
|
6290 | 6290 | } |
6291 | 6291 | |
6292 | 6292 | $out .= $currency['label']; |
6293 | - $out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')'; |
|
6293 | + $out .= ' ('.$langs->getCurrencySymbol($code_iso).')'; |
|
6294 | 6294 | $out .= '</option>'; |
6295 | 6295 | } |
6296 | 6296 | } |
@@ -6299,7 +6299,7 @@ discard block |
||
6299 | 6299 | $out .= '</select>'; |
6300 | 6300 | |
6301 | 6301 | // Make select dynamic |
6302 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
6302 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
6303 | 6303 | $out .= ajax_combobox($htmlname); |
6304 | 6304 | |
6305 | 6305 | return $out; |
@@ -6326,11 +6326,11 @@ discard block |
||
6326 | 6326 | dol_syslog(__METHOD__, LOG_DEBUG); |
6327 | 6327 | |
6328 | 6328 | $sql = "SELECT DISTINCT t.rowid, t.code, t.taux, t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.recuperableonly"; |
6329 | - $sql .= " FROM " . $this->db->prefix() . "c_tva as t, " . $this->db->prefix() . "c_country as c"; |
|
6329 | + $sql .= " FROM ".$this->db->prefix()."c_tva as t, ".$this->db->prefix()."c_country as c"; |
|
6330 | 6330 | $sql .= " WHERE t.fk_pays = c.rowid"; |
6331 | 6331 | $sql .= " AND t.active > 0"; |
6332 | 6332 | $sql .= " AND t.entity IN (".getEntity('c_tva').")"; |
6333 | - $sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")"; |
|
6333 | + $sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")"; |
|
6334 | 6334 | $sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC"; |
6335 | 6335 | |
6336 | 6336 | $resql = $this->db->query($sql); |
@@ -6348,22 +6348,22 @@ discard block |
||
6348 | 6348 | $this->cache_vatrates[$i]['localtax2'] = $obj->localtax2; |
6349 | 6349 | $this->cache_vatrates[$i]['localtax2_type'] = $obj->localtax1_type; |
6350 | 6350 | |
6351 | - $this->cache_vatrates[$i]['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or * |
|
6352 | - $this->cache_vatrates[$i]['labelallrates'] = $obj->taux . '/' . ($obj->localtax1 ? $obj->localtax1 : '0') . '/' . ($obj->localtax2 ? $obj->localtax2 : '0') . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
6351 | + $this->cache_vatrates[$i]['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or * |
|
6352 | + $this->cache_vatrates[$i]['labelallrates'] = $obj->taux.'/'.($obj->localtax1 ? $obj->localtax1 : '0').'/'.($obj->localtax2 ? $obj->localtax2 : '0').($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
6353 | 6353 | $positiverates = ''; |
6354 | 6354 | if ($obj->taux) { |
6355 | - $positiverates .= ($positiverates ? '/' : '') . $obj->taux; |
|
6355 | + $positiverates .= ($positiverates ? '/' : '').$obj->taux; |
|
6356 | 6356 | } |
6357 | 6357 | if ($obj->localtax1) { |
6358 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax1; |
|
6358 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax1; |
|
6359 | 6359 | } |
6360 | 6360 | if ($obj->localtax2) { |
6361 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax2; |
|
6361 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax2; |
|
6362 | 6362 | } |
6363 | 6363 | if (empty($positiverates)) { |
6364 | 6364 | $positiverates = '0'; |
6365 | 6365 | } |
6366 | - $this->cache_vatrates[$i]['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
6366 | + $this->cache_vatrates[$i]['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
6367 | 6367 | } |
6368 | 6368 | |
6369 | 6369 | return $num; |
@@ -6381,7 +6381,7 @@ discard block |
||
6381 | 6381 | return -1; |
6382 | 6382 | } |
6383 | 6383 | } else { |
6384 | - $this->error = '<span class="error">' . $this->db->error() . '</span>'; |
|
6384 | + $this->error = '<span class="error">'.$this->db->error().'</span>'; |
|
6385 | 6385 | return -2; |
6386 | 6386 | } |
6387 | 6387 | } |
@@ -6433,9 +6433,9 @@ discard block |
||
6433 | 6433 | // Check parameters |
6434 | 6434 | if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) { |
6435 | 6435 | if ($societe_vendeuse->id == $mysoc->id) { |
6436 | - $return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>'; |
|
6436 | + $return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>'; |
|
6437 | 6437 | } else { |
6438 | - $return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>'; |
|
6438 | + $return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>'; |
|
6439 | 6439 | } |
6440 | 6440 | return $return; |
6441 | 6441 | } |
@@ -6447,25 +6447,25 @@ discard block |
||
6447 | 6447 | // Define list of countries to use to search VAT rates to show |
6448 | 6448 | // First we defined code_country to use to find list |
6449 | 6449 | if (is_object($societe_vendeuse)) { |
6450 | - $code_country = "'" . $societe_vendeuse->country_code . "'"; |
|
6450 | + $code_country = "'".$societe_vendeuse->country_code."'"; |
|
6451 | 6451 | } else { |
6452 | - $code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente |
|
6452 | + $code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente |
|
6453 | 6453 | } |
6454 | 6454 | if (!empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) { // If option to have vat for end customer for services is on |
6455 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
6455 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
6456 | 6456 | if (!isInEEC($societe_vendeuse) && (!is_object($societe_acheteuse) || (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()))) { |
6457 | 6457 | // We also add the buyer country code |
6458 | 6458 | if (is_numeric($type)) { |
6459 | 6459 | if ($type == 1) { // We know product is a service |
6460 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
6460 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
6461 | 6461 | } |
6462 | 6462 | } elseif (!$idprod) { // We don't know type of product |
6463 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
6463 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
6464 | 6464 | } else { |
6465 | 6465 | $prodstatic = new Product($this->db); |
6466 | 6466 | $prodstatic->fetch($idprod); |
6467 | 6467 | if ($prodstatic->type == Product::TYPE_SERVICE) { // We know product is a service |
6468 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
6468 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
6469 | 6469 | } |
6470 | 6470 | } |
6471 | 6471 | } |
@@ -6517,13 +6517,13 @@ discard block |
||
6517 | 6517 | // Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead |
6518 | 6518 | // of using supplier invoices (this is a very bad idea !) |
6519 | 6519 | if (empty($conf->global->EXPENSEREPORT_OVERRIDE_VAT)) { |
6520 | - $title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"'; |
|
6520 | + $title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"'; |
|
6521 | 6521 | $disabled = true; |
6522 | 6522 | } |
6523 | 6523 | } |
6524 | 6524 | |
6525 | 6525 | if (!$options_only) { |
6526 | - $return .= '<select class="flat minwidth50imp maxwidth100" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>'; |
|
6526 | + $return .= '<select class="flat minwidth50imp maxwidth100" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>'; |
|
6527 | 6527 | } |
6528 | 6528 | |
6529 | 6529 | $selectedfound = false; |
@@ -6537,13 +6537,13 @@ discard block |
||
6537 | 6537 | $key = $rate['txtva']; |
6538 | 6538 | $key .= $rate['nprtva'] ? '*' : ''; |
6539 | 6539 | if ($mode > 0 && $rate['code']) { |
6540 | - $key .= ' (' . $rate['code'] . ')'; |
|
6540 | + $key .= ' ('.$rate['code'].')'; |
|
6541 | 6541 | } |
6542 | 6542 | if ($mode < 0) { |
6543 | 6543 | $key = $rate['rowid']; |
6544 | 6544 | } |
6545 | 6545 | |
6546 | - $return .= '<option value="' . $key . '"'; |
|
6546 | + $return .= '<option value="'.$key.'"'; |
|
6547 | 6547 | if (!$selectedfound) { |
6548 | 6548 | if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag |
6549 | 6549 | if ($defaultcode == $rate['code']) { |
@@ -6614,7 +6614,7 @@ discard block |
||
6614 | 6614 | public function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '') |
6615 | 6615 | { |
6616 | 6616 | // phpcs:enable |
6617 | - dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
6617 | + dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
6618 | 6618 | $retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof); |
6619 | 6619 | if (!empty($nooutput)) { |
6620 | 6620 | return $retstring; |
@@ -6643,11 +6643,11 @@ discard block |
||
6643 | 6643 | { |
6644 | 6644 | global $langs; |
6645 | 6645 | |
6646 | - $ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
6646 | + $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
6647 | 6647 | if ($forcenewline) { |
6648 | 6648 | $ret .= '<br>'; |
6649 | 6649 | } |
6650 | - $ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
6650 | + $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
6651 | 6651 | return $ret; |
6652 | 6652 | } |
6653 | 6653 | |
@@ -6713,7 +6713,7 @@ discard block |
||
6713 | 6713 | $orig_set_time = $set_time; |
6714 | 6714 | |
6715 | 6715 | if ($set_time === '' && $emptydate == 0) { |
6716 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
6716 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
6717 | 6717 | if ($gm == 'tzuser' || $gm == 'tzuserrel') { |
6718 | 6718 | $set_time = dol_now($gm); |
6719 | 6719 | } else { |
@@ -6781,38 +6781,38 @@ discard block |
||
6781 | 6781 | // Calendrier popup version eldy |
6782 | 6782 | if ($usecalendar == "eldy") { |
6783 | 6783 | // Input area to enter date manually |
6784 | - $retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"'; |
|
6784 | + $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"'; |
|
6785 | 6785 | $retstring .= ($disabled ? ' disabled' : ''); |
6786 | - $retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
6786 | + $retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
6787 | 6787 | $retstring .= '>'; |
6788 | 6788 | |
6789 | 6789 | // Icon calendar |
6790 | 6790 | $retstringbuttom = ''; |
6791 | 6791 | if (!$disabled) { |
6792 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"'; |
|
6793 | - $base = DOL_URL_ROOT . '/core/'; |
|
6794 | - $retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"'; |
|
6795 | - $retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
6792 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"'; |
|
6793 | + $base = DOL_URL_ROOT.'/core/'; |
|
6794 | + $retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"'; |
|
6795 | + $retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>'; |
|
6796 | 6796 | } else { |
6797 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
6797 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
6798 | 6798 | } |
6799 | - $retstring = $retstringbuttom . $retstring; |
|
6799 | + $retstring = $retstringbuttom.$retstring; |
|
6800 | 6800 | |
6801 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
6802 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
6803 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
6801 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
6802 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
6803 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
6804 | 6804 | } elseif ($usecalendar == 'jquery') { |
6805 | 6805 | if (!$disabled) { |
6806 | 6806 | // Output javascript for datepicker |
6807 | 6807 | $minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (date('Y') - 100)); |
6808 | 6808 | $maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (date('Y') + 100)); |
6809 | 6809 | |
6810 | - $retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">'; |
|
6811 | - $retstring .= "$(function(){ $('#" . $prefix . "').datepicker({ |
|
6812 | - dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "', |
|
6810 | + $retstring .= '<script nonce="'.getNonce().'" type="text/javascript">'; |
|
6811 | + $retstring .= "$(function(){ $('#".$prefix."').datepicker({ |
|
6812 | + dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."', |
|
6813 | 6813 | autoclose: true, |
6814 | 6814 | todayHighlight: true, |
6815 | - yearRange: '" . $minYear . ":" . $maxYear . "',"; |
|
6815 | + yearRange: '" . $minYear.":".$maxYear."',"; |
|
6816 | 6816 | if (!empty($conf->dol_use_jmobile)) { |
6817 | 6817 | $retstring .= " |
6818 | 6818 | beforeShow: function (input, datePicker) { |
@@ -6827,7 +6827,7 @@ discard block |
||
6827 | 6827 | if (empty($conf->global->MAIN_POPUP_CALENDAR_ON_FOCUS)) { |
6828 | 6828 | $retstring .= " |
6829 | 6829 | showOn: 'button', /* both has problem with autocompletion */ |
6830 | - buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png', |
|
6830 | + buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png', |
|
6831 | 6831 | buttonImageOnly: true"; |
6832 | 6832 | } |
6833 | 6833 | $retstring .= " |
@@ -6839,8 +6839,8 @@ discard block |
||
6839 | 6839 | $retstring .= '<div class="nowraponall inline-block divfordateinput">'; |
6840 | 6840 | $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"'; |
6841 | 6841 | $retstring .= ($disabled ? ' disabled' : ''); |
6842 | - $retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : ''); |
|
6843 | - $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
6842 | + $retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : ''); |
|
6843 | + $retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
6844 | 6844 | $retstring .= '>'; |
6845 | 6845 | |
6846 | 6846 | // Icone calendrier |
@@ -6855,40 +6855,40 @@ discard block |
||
6855 | 6855 | $retstring.='});'; |
6856 | 6856 | $retstring.="</script>";*/ |
6857 | 6857 | } else { |
6858 | - $retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
6859 | - $retsring = $retstringbutton . $retstring; |
|
6858 | + $retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
6859 | + $retsring = $retstringbutton.$retstring; |
|
6860 | 6860 | } |
6861 | 6861 | |
6862 | 6862 | $retstring .= '</div>'; |
6863 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
6864 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
6865 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
6863 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
6864 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
6865 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
6866 | 6866 | } else { |
6867 | 6867 | $retstring .= "Bad value of MAIN_POPUP_CALENDAR"; |
6868 | 6868 | } |
6869 | 6869 | } else { |
6870 | 6870 | // Show date with combo selects |
6871 | 6871 | // Day |
6872 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">'; |
|
6872 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">'; |
|
6873 | 6873 | |
6874 | 6874 | if ($emptydate || $set_time == -1) { |
6875 | 6875 | $retstring .= '<option value="0" selected> </option>'; |
6876 | 6876 | } |
6877 | 6877 | |
6878 | 6878 | for ($day = 1; $day <= 31; $day++) { |
6879 | - $retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>'; |
|
6879 | + $retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>'; |
|
6880 | 6880 | } |
6881 | 6881 | |
6882 | 6882 | $retstring .= "</select>"; |
6883 | 6883 | |
6884 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">'; |
|
6884 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">'; |
|
6885 | 6885 | if ($emptydate || $set_time == -1) { |
6886 | 6886 | $retstring .= '<option value="0" selected> </option>'; |
6887 | 6887 | } |
6888 | 6888 | |
6889 | 6889 | // Month |
6890 | 6890 | for ($month = 1; $month <= 12; $month++) { |
6891 | - $retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>'; |
|
6891 | + $retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>'; |
|
6892 | 6892 | $retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b"); |
6893 | 6893 | $retstring .= "</option>"; |
6894 | 6894 | } |
@@ -6896,12 +6896,12 @@ discard block |
||
6896 | 6896 | |
6897 | 6897 | // Year |
6898 | 6898 | if ($emptydate || $set_time == -1) { |
6899 | - $retstring .= '<input' . ($disabled ? ' disabled' : '') . ' placeholder="' . dol_escape_htmltag($langs->trans("Year")) . '" class="flat maxwidth50imp valignmiddle" type="number" min="0" max="3000" maxlength="4" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">'; |
|
6899 | + $retstring .= '<input'.($disabled ? ' disabled' : '').' placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" class="flat maxwidth50imp valignmiddle" type="number" min="0" max="3000" maxlength="4" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'; |
|
6900 | 6900 | } else { |
6901 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">'; |
|
6901 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">'; |
|
6902 | 6902 | |
6903 | 6903 | for ($year = $syear - 10; $year < $syear + 10; $year++) { |
6904 | - $retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>'; |
|
6904 | + $retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>'; |
|
6905 | 6905 | } |
6906 | 6906 | $retstring .= "</select>\n"; |
6907 | 6907 | } |
@@ -6925,15 +6925,15 @@ discard block |
||
6925 | 6925 | } |
6926 | 6926 | } |
6927 | 6927 | // Show hour |
6928 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">'; |
|
6928 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">'; |
|
6929 | 6929 | if ($emptyhours) { |
6930 | 6930 | $retstring .= '<option value="-1"> </option>'; |
6931 | 6931 | } |
6932 | 6932 | for ($hour = $hourstart; $hour < $hourend; $hour++) { |
6933 | 6933 | if (strlen($hour) < 2) { |
6934 | - $hour = "0" . $hour; |
|
6934 | + $hour = "0".$hour; |
|
6935 | 6935 | } |
6936 | - $retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour; |
|
6936 | + $retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour; |
|
6937 | 6937 | //$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H'); |
6938 | 6938 | $retstring .= '</option>'; |
6939 | 6939 | } |
@@ -6946,19 +6946,19 @@ discard block |
||
6946 | 6946 | |
6947 | 6947 | if ($m) { |
6948 | 6948 | // Show minutes |
6949 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">'; |
|
6949 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">'; |
|
6950 | 6950 | if ($emptyhours) { |
6951 | 6951 | $retstring .= '<option value="-1"> </option>'; |
6952 | 6952 | } |
6953 | 6953 | for ($min = 0; $min < 60; $min += $stepminutes) { |
6954 | 6954 | if (strlen($min) < 2) { |
6955 | - $min = "0" . $min; |
|
6955 | + $min = "0".$min; |
|
6956 | 6956 | } |
6957 | - $retstring .= '<option value="' . $min . '"' . (($min == $smin) ? ' selected' : '') . '>' . $min . (empty($conf->dol_optimize_smallscreen) ? '' : '') . '</option>'; |
|
6957 | + $retstring .= '<option value="'.$min.'"'.(($min == $smin) ? ' selected' : '').'>'.$min.(empty($conf->dol_optimize_smallscreen) ? '' : '').'</option>'; |
|
6958 | 6958 | } |
6959 | 6959 | $retstring .= '</select>'; |
6960 | 6960 | |
6961 | - $retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">'; |
|
6961 | + $retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">'; |
|
6962 | 6962 | } |
6963 | 6963 | |
6964 | 6964 | if ($d && $h) { |
@@ -6981,10 +6981,10 @@ discard block |
||
6981 | 6981 | |
6982 | 6982 | // Generate the date part, depending on the use or not of the javascript calendar |
6983 | 6983 | if ($addnowlink == 1) { // server time expressed in user time setup |
6984 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
6985 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
6986 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
6987 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
6984 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
6985 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
6986 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
6987 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
6988 | 6988 | } elseif ($addnowlink == 2) { |
6989 | 6989 | /* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix. |
6990 | 6990 | * This break application for foreign languages. |
@@ -6993,10 +6993,10 @@ discard block |
||
6993 | 6993 | $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);'; |
6994 | 6994 | $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());'; |
6995 | 6995 | */ |
6996 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
6997 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
6998 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
6999 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
6996 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
6997 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
6998 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
6999 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
7000 | 7000 | } |
7001 | 7001 | /*if ($usecalendar == "eldy") |
7002 | 7002 | { |
@@ -7016,11 +7016,11 @@ discard block |
||
7016 | 7016 | } |
7017 | 7017 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); '; |
7018 | 7018 | if ($addnowlink == 1) { |
7019 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
7020 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
7019 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
7020 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
7021 | 7021 | } elseif ($addnowlink == 2) { |
7022 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());'; |
|
7023 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
7022 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());'; |
|
7023 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
7024 | 7024 | } |
7025 | 7025 | |
7026 | 7026 | if ($fullday) { |
@@ -7034,11 +7034,11 @@ discard block |
||
7034 | 7034 | } |
7035 | 7035 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); '; |
7036 | 7036 | if ($addnowlink == 1) { |
7037 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
7038 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
7037 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
7038 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
7039 | 7039 | } elseif ($addnowlink == 2) { |
7040 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());'; |
|
7041 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
7040 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());'; |
|
7041 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
7042 | 7042 | } |
7043 | 7043 | if ($fullday) { |
7044 | 7044 | $reset_scripts .= ' } '; |
@@ -7046,7 +7046,7 @@ discard block |
||
7046 | 7046 | } |
7047 | 7047 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
7048 | 7048 | if ($reset_scripts && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { |
7049 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">'; |
|
7049 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">'; |
|
7050 | 7050 | $retstring .= $langs->trans("Now"); |
7051 | 7051 | $retstring .= '</button> '; |
7052 | 7052 | } |
@@ -7058,16 +7058,16 @@ discard block |
||
7058 | 7058 | $reset_scripts = ""; |
7059 | 7059 | |
7060 | 7060 | // Generate the date part, depending on the use or not of the javascript calendar |
7061 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');'; |
|
7062 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
7063 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
7064 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
7061 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');'; |
|
7062 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
7063 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
7064 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
7065 | 7065 | // Update the hour part |
7066 | 7066 | if ($h) { |
7067 | 7067 | if ($fullday) { |
7068 | 7068 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
7069 | 7069 | } |
7070 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
7070 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
7071 | 7071 | if ($fullday) { |
7072 | 7072 | $reset_scripts .= ' } '; |
7073 | 7073 | } |
@@ -7077,14 +7077,14 @@ discard block |
||
7077 | 7077 | if ($fullday) { |
7078 | 7078 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
7079 | 7079 | } |
7080 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
7080 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
7081 | 7081 | if ($fullday) { |
7082 | 7082 | $reset_scripts .= ' } '; |
7083 | 7083 | } |
7084 | 7084 | } |
7085 | 7085 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
7086 | 7086 | if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) { |
7087 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">'; |
|
7087 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">'; |
|
7088 | 7088 | $retstring .= $langs->trans("DateStartPlusOne"); |
7089 | 7089 | $retstring .= '</button> '; |
7090 | 7090 | } |
@@ -7142,17 +7142,17 @@ discard block |
||
7142 | 7142 | unset($TDurationTypes[$value]); |
7143 | 7143 | } |
7144 | 7144 | |
7145 | - $retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">'; |
|
7145 | + $retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">'; |
|
7146 | 7146 | foreach ($TDurationTypes as $key => $typeduration) { |
7147 | - $retstring .= '<option value="' . $key . '"'; |
|
7147 | + $retstring .= '<option value="'.$key.'"'; |
|
7148 | 7148 | if ($key == $selected) { |
7149 | 7149 | $retstring .= " selected"; |
7150 | 7150 | } |
7151 | - $retstring .= ">" . $typeduration . "</option>"; |
|
7151 | + $retstring .= ">".$typeduration."</option>"; |
|
7152 | 7152 | } |
7153 | 7153 | $retstring .= "</select>"; |
7154 | 7154 | |
7155 | - $retstring .= ajax_combobox('select_' . $prefix . 'type_duration'); |
|
7155 | + $retstring .= ajax_combobox('select_'.$prefix.'type_duration'); |
|
7156 | 7156 | |
7157 | 7157 | return $retstring; |
7158 | 7158 | } |
@@ -7184,30 +7184,30 @@ discard block |
||
7184 | 7184 | |
7185 | 7185 | // Hours |
7186 | 7186 | if ($iSecond != '') { |
7187 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
7187 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
7188 | 7188 | |
7189 | 7189 | $hourSelected = convertSecondToTime($iSecond, 'allhour'); |
7190 | 7190 | $minSelected = convertSecondToTime($iSecond, 'min'); |
7191 | 7191 | } |
7192 | 7192 | |
7193 | 7193 | if ($typehour == 'select') { |
7194 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>'; |
|
7194 | + $retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>'; |
|
7195 | 7195 | for ($hour = 0; $hour < 25; $hour++) { // For a duration, we allow 24 hours |
7196 | - $retstring .= '<option value="' . $hour . '"'; |
|
7196 | + $retstring .= '<option value="'.$hour.'"'; |
|
7197 | 7197 | if (is_numeric($hourSelected) && $hourSelected == $hour) { |
7198 | 7198 | $retstring .= " selected"; |
7199 | 7199 | } |
7200 | - $retstring .= ">" . $hour . "</option>"; |
|
7200 | + $retstring .= ">".$hour."</option>"; |
|
7201 | 7201 | } |
7202 | 7202 | $retstring .= "</select>"; |
7203 | 7203 | } elseif ($typehour == 'text' || $typehour == 'textselect') { |
7204 | - $retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">'; |
|
7204 | + $retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">'; |
|
7205 | 7205 | } else { |
7206 | 7206 | return 'BadValueForParameterTypeHour'; |
7207 | 7207 | } |
7208 | 7208 | |
7209 | 7209 | if ($typehour != 'text') { |
7210 | - $retstring .= ' ' . $langs->trans('HourShort'); |
|
7210 | + $retstring .= ' '.$langs->trans('HourShort'); |
|
7211 | 7211 | } else { |
7212 | 7212 | $retstring .= '<span class="">:</span>'; |
7213 | 7213 | } |
@@ -7222,21 +7222,21 @@ discard block |
||
7222 | 7222 | } |
7223 | 7223 | |
7224 | 7224 | if ($typehour == 'select' || $typehour == 'textselect') { |
7225 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>'; |
|
7225 | + $retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>'; |
|
7226 | 7226 | for ($min = 0; $min <= 55; $min = $min + 5) { |
7227 | - $retstring .= '<option value="' . $min . '"'; |
|
7227 | + $retstring .= '<option value="'.$min.'"'; |
|
7228 | 7228 | if (is_numeric($minSelected) && $minSelected == $min) { |
7229 | 7229 | $retstring .= ' selected'; |
7230 | 7230 | } |
7231 | - $retstring .= '>' . $min . '</option>'; |
|
7231 | + $retstring .= '>'.$min.'</option>'; |
|
7232 | 7232 | } |
7233 | 7233 | $retstring .= "</select>"; |
7234 | 7234 | } elseif ($typehour == 'text') { |
7235 | - $retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">'; |
|
7235 | + $retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">'; |
|
7236 | 7236 | } |
7237 | 7237 | |
7238 | 7238 | if ($typehour != 'text') { |
7239 | - $retstring .= ' ' . $langs->trans('MinuteShort'); |
|
7239 | + $retstring .= ' '.$langs->trans('MinuteShort'); |
|
7240 | 7240 | } |
7241 | 7241 | |
7242 | 7242 | $retstring .= "</span>"; |
@@ -7282,7 +7282,7 @@ discard block |
||
7282 | 7282 | $placeholder = ''; |
7283 | 7283 | |
7284 | 7284 | if ($selected && empty($selected_input_value)) { |
7285 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
7285 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
7286 | 7286 | $tickettmpselect = new Ticket($this->db); |
7287 | 7287 | $tickettmpselect->fetch($selected); |
7288 | 7288 | $selected_input_value = $tickettmpselect->ref; |
@@ -7290,16 +7290,16 @@ discard block |
||
7290 | 7290 | } |
7291 | 7291 | |
7292 | 7292 | $urloption = ''; |
7293 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7293 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7294 | 7294 | |
7295 | - if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : '; |
|
7295 | + if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : '; |
|
7296 | 7296 | elseif ($hidelabel > 1) { |
7297 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
7297 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
7298 | 7298 | if ($hidelabel == 2) { |
7299 | 7299 | $out .= img_picto($langs->trans("Search"), 'search'); |
7300 | 7300 | } |
7301 | 7301 | } |
7302 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />'; |
|
7302 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; |
|
7303 | 7303 | if ($hidelabel == 3) { |
7304 | 7304 | $out .= img_picto($langs->trans("Search"), 'search'); |
7305 | 7305 | } |
@@ -7343,8 +7343,8 @@ discard block |
||
7343 | 7343 | |
7344 | 7344 | $sql = "SELECT "; |
7345 | 7345 | $sql .= $selectFields; |
7346 | - $sql .= " FROM " . $this->db->prefix() . "ticket as p"; |
|
7347 | - $sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')'; |
|
7346 | + $sql .= " FROM ".$this->db->prefix()."ticket as p"; |
|
7347 | + $sql .= ' WHERE p.entity IN ('.getEntity('ticket').')'; |
|
7348 | 7348 | |
7349 | 7349 | // Add criteria on ref/label |
7350 | 7350 | if ($filterkey != '') { |
@@ -7356,7 +7356,7 @@ discard block |
||
7356 | 7356 | if (count($scrit) > 1) $sql .= "("; |
7357 | 7357 | foreach ($scrit as $crit) { |
7358 | 7358 | if ($i > 0) $sql .= " AND "; |
7359 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
7359 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
7360 | 7360 | $sql .= ")"; |
7361 | 7361 | $i++; |
7362 | 7362 | } |
@@ -7367,22 +7367,22 @@ discard block |
||
7367 | 7367 | $sql .= $this->db->plimit($limit, 0); |
7368 | 7368 | |
7369 | 7369 | // Build output string |
7370 | - dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG); |
|
7370 | + dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG); |
|
7371 | 7371 | $result = $this->db->query($sql); |
7372 | 7372 | if ($result) { |
7373 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
7374 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php'; |
|
7373 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
7374 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php'; |
|
7375 | 7375 | |
7376 | 7376 | $num = $this->db->num_rows($result); |
7377 | 7377 | |
7378 | 7378 | $events = null; |
7379 | 7379 | |
7380 | 7380 | if (!$forcecombo) { |
7381 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
7381 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
7382 | 7382 | $out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT); |
7383 | 7383 | } |
7384 | 7384 | |
7385 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
7385 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
7386 | 7386 | |
7387 | 7387 | $textifempty = ''; |
7388 | 7388 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7393,7 +7393,7 @@ discard block |
||
7393 | 7393 | } else { |
7394 | 7394 | if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty); |
7395 | 7395 | } |
7396 | - if ($showempty) $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
7396 | + if ($showempty) $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
7397 | 7397 | |
7398 | 7398 | $i = 0; |
7399 | 7399 | while ($num && $i < $num) { |
@@ -7447,12 +7447,12 @@ discard block |
||
7447 | 7447 | $outref = $objp->ref; |
7448 | 7448 | $outtype = $objp->fk_product_type; |
7449 | 7449 | |
7450 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
7450 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
7451 | 7451 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
7452 | 7452 | $opt .= '>'; |
7453 | 7453 | $opt .= $objp->ref; |
7454 | 7454 | $objRef = $objp->ref; |
7455 | - if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
7455 | + if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
7456 | 7456 | |
7457 | 7457 | $opt .= "</option>\n"; |
7458 | 7458 | $optJson = array('key' => $outkey, 'value' => $outref, 'type' => $outtype); |
@@ -7490,7 +7490,7 @@ discard block |
||
7490 | 7490 | $placeholder = ''; |
7491 | 7491 | |
7492 | 7492 | if ($selected && empty($selected_input_value)) { |
7493 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
7493 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
7494 | 7494 | $projecttmpselect = new Project($this->db); |
7495 | 7495 | $projecttmpselect->fetch($selected); |
7496 | 7496 | $selected_input_value = $projecttmpselect->ref; |
@@ -7498,16 +7498,16 @@ discard block |
||
7498 | 7498 | } |
7499 | 7499 | |
7500 | 7500 | $urloption = ''; |
7501 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7501 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7502 | 7502 | |
7503 | - if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : '; |
|
7503 | + if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : '; |
|
7504 | 7504 | elseif ($hidelabel > 1) { |
7505 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
7505 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
7506 | 7506 | if ($hidelabel == 2) { |
7507 | 7507 | $out .= img_picto($langs->trans("Search"), 'search'); |
7508 | 7508 | } |
7509 | 7509 | } |
7510 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />'; |
|
7510 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; |
|
7511 | 7511 | if ($hidelabel == 3) { |
7512 | 7512 | $out .= img_picto($langs->trans("Search"), 'search'); |
7513 | 7513 | } |
@@ -7550,8 +7550,8 @@ discard block |
||
7550 | 7550 | |
7551 | 7551 | $sql = "SELECT "; |
7552 | 7552 | $sql .= $selectFields; |
7553 | - $sql .= " FROM " . $this->db->prefix() . "projet as p"; |
|
7554 | - $sql .= ' WHERE p.entity IN (' . getEntity('project') . ')'; |
|
7553 | + $sql .= " FROM ".$this->db->prefix()."projet as p"; |
|
7554 | + $sql .= ' WHERE p.entity IN ('.getEntity('project').')'; |
|
7555 | 7555 | |
7556 | 7556 | // Add criteria on ref/label |
7557 | 7557 | if ($filterkey != '') { |
@@ -7563,7 +7563,7 @@ discard block |
||
7563 | 7563 | if (count($scrit) > 1) $sql .= "("; |
7564 | 7564 | foreach ($scrit as $crit) { |
7565 | 7565 | if ($i > 0) $sql .= " AND "; |
7566 | - $sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
7566 | + $sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
7567 | 7567 | $sql .= ""; |
7568 | 7568 | $i++; |
7569 | 7569 | } |
@@ -7574,22 +7574,22 @@ discard block |
||
7574 | 7574 | $sql .= $this->db->plimit($limit, 0); |
7575 | 7575 | |
7576 | 7576 | // Build output string |
7577 | - dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG); |
|
7577 | + dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG); |
|
7578 | 7578 | $result = $this->db->query($sql); |
7579 | 7579 | if ($result) { |
7580 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
7581 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
7580 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
7581 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
7582 | 7582 | |
7583 | 7583 | $num = $this->db->num_rows($result); |
7584 | 7584 | |
7585 | 7585 | $events = null; |
7586 | 7586 | |
7587 | 7587 | if (!$forcecombo) { |
7588 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
7588 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
7589 | 7589 | $out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT); |
7590 | 7590 | } |
7591 | 7591 | |
7592 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
7592 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
7593 | 7593 | |
7594 | 7594 | $textifempty = ''; |
7595 | 7595 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7600,7 +7600,7 @@ discard block |
||
7600 | 7600 | } else { |
7601 | 7601 | if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty); |
7602 | 7602 | } |
7603 | - if ($showempty) $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
7603 | + if ($showempty) $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
7604 | 7604 | |
7605 | 7605 | $i = 0; |
7606 | 7606 | while ($num && $i < $num) { |
@@ -7657,12 +7657,12 @@ discard block |
||
7657 | 7657 | $outlabel = $objp->label; |
7658 | 7658 | $outtype = $objp->fk_product_type; |
7659 | 7659 | |
7660 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
7660 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
7661 | 7661 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
7662 | 7662 | $opt .= '>'; |
7663 | 7663 | $opt .= $objp->ref; |
7664 | 7664 | $objRef = $objp->ref; |
7665 | - if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
7665 | + if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
7666 | 7666 | |
7667 | 7667 | $opt .= "</option>\n"; |
7668 | 7668 | $optJson = array('key' => $outkey, 'value' => $outref, 'type' => $outtype); |
@@ -7702,7 +7702,7 @@ discard block |
||
7702 | 7702 | $urloption = ''; |
7703 | 7703 | |
7704 | 7704 | if ($selected && empty($selected_input_value)) { |
7705 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
7705 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
7706 | 7706 | $adherenttmpselect = new Adherent($this->db); |
7707 | 7707 | $adherenttmpselect->fetch($selected); |
7708 | 7708 | $selected_input_value = $adherenttmpselect->ref; |
@@ -7711,16 +7711,16 @@ discard block |
||
7711 | 7711 | |
7712 | 7712 | $urloption = ''; |
7713 | 7713 | |
7714 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7714 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7715 | 7715 | |
7716 | - if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : '; |
|
7716 | + if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : '; |
|
7717 | 7717 | elseif ($hidelabel > 1) { |
7718 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
7718 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
7719 | 7719 | if ($hidelabel == 2) { |
7720 | 7720 | $out .= img_picto($langs->trans("Search"), 'search'); |
7721 | 7721 | } |
7722 | 7722 | } |
7723 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />'; |
|
7723 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; |
|
7724 | 7724 | if ($hidelabel == 3) { |
7725 | 7725 | $out .= img_picto($langs->trans("Search"), 'search'); |
7726 | 7726 | } |
@@ -7765,8 +7765,8 @@ discard block |
||
7765 | 7765 | |
7766 | 7766 | $sql = "SELECT "; |
7767 | 7767 | $sql .= $selectFields; |
7768 | - $sql .= " FROM " . $this->db->prefix() . "adherent as p"; |
|
7769 | - $sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')'; |
|
7768 | + $sql .= " FROM ".$this->db->prefix()."adherent as p"; |
|
7769 | + $sql .= ' WHERE p.entity IN ('.getEntity('adherent').')'; |
|
7770 | 7770 | |
7771 | 7771 | // Add criteria on ref/label |
7772 | 7772 | if ($filterkey != '') { |
@@ -7778,35 +7778,35 @@ discard block |
||
7778 | 7778 | if (count($scrit) > 1) $sql .= "("; |
7779 | 7779 | foreach ($scrit as $crit) { |
7780 | 7780 | if ($i > 0) $sql .= " AND "; |
7781 | - $sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
7782 | - $sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
7781 | + $sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
7782 | + $sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
7783 | 7783 | $i++; |
7784 | 7784 | } |
7785 | 7785 | if (count($scrit) > 1) $sql .= ")"; |
7786 | 7786 | $sql .= ')'; |
7787 | 7787 | } |
7788 | 7788 | if ($status != -1) { |
7789 | - $sql .= ' AND statut = ' . ((int) $status); |
|
7789 | + $sql .= ' AND statut = '.((int) $status); |
|
7790 | 7790 | } |
7791 | 7791 | $sql .= $this->db->plimit($limit, 0); |
7792 | 7792 | |
7793 | 7793 | // Build output string |
7794 | - dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG); |
|
7794 | + dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG); |
|
7795 | 7795 | $result = $this->db->query($sql); |
7796 | 7796 | if ($result) { |
7797 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
7798 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php'; |
|
7797 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
7798 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; |
|
7799 | 7799 | |
7800 | 7800 | $num = $this->db->num_rows($result); |
7801 | 7801 | |
7802 | 7802 | $events = null; |
7803 | 7803 | |
7804 | 7804 | if (!$forcecombo) { |
7805 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
7805 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
7806 | 7806 | $out .= ajax_combobox($htmlname, $events, !empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT) ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : ''); |
7807 | 7807 | } |
7808 | 7808 | |
7809 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
7809 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
7810 | 7810 | |
7811 | 7811 | $textifempty = ''; |
7812 | 7812 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7818,7 +7818,7 @@ discard block |
||
7818 | 7818 | if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty); |
7819 | 7819 | } |
7820 | 7820 | if ($showempty) { |
7821 | - $out .= '<option value="-1" selected>' . $textifempty . '</option>'; |
|
7821 | + $out .= '<option value="-1" selected>'.$textifempty.'</option>'; |
|
7822 | 7822 | } |
7823 | 7823 | |
7824 | 7824 | $i = 0; |
@@ -7874,11 +7874,11 @@ discard block |
||
7874 | 7874 | $outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname); |
7875 | 7875 | $outtype = $objp->fk_adherent_type; |
7876 | 7876 | |
7877 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
7877 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
7878 | 7878 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
7879 | 7879 | $opt .= '>'; |
7880 | 7880 | if (!empty($filterkey) && $filterkey != '') { |
7881 | - $outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1); |
|
7881 | + $outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1); |
|
7882 | 7882 | } |
7883 | 7883 | $opt .= $outlabel; |
7884 | 7884 | $opt .= "</option>\n"; |
@@ -7919,9 +7919,9 @@ discard block |
||
7919 | 7919 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
7920 | 7920 | $reg = array(); |
7921 | 7921 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
7922 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
7922 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
7923 | 7923 | } |
7924 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
7924 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
7925 | 7925 | |
7926 | 7926 | $classname = $InfoFieldList[0]; |
7927 | 7927 | $classpath = $InfoFieldList[1]; |
@@ -7945,8 +7945,8 @@ discard block |
||
7945 | 7945 | } |
7946 | 7946 | } |
7947 | 7947 | if (!is_object($objecttmp)) { |
7948 | - dol_syslog('Error bad setup of type for field ' . join(',', $InfoFieldList), LOG_WARNING); |
|
7949 | - return 'Error bad setup of type for field ' . join(',', $InfoFieldList); |
|
7948 | + dol_syslog('Error bad setup of type for field '.join(',', $InfoFieldList), LOG_WARNING); |
|
7949 | + return 'Error bad setup of type for field '.join(',', $InfoFieldList); |
|
7950 | 7950 | } |
7951 | 7951 | |
7952 | 7952 | //var_dump($filter); |
@@ -7957,9 +7957,9 @@ discard block |
||
7957 | 7957 | if ($prefixforautocompletemode == 'product') { |
7958 | 7958 | $prefixforautocompletemode = 'produit'; |
7959 | 7959 | } |
7960 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
7960 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
7961 | 7961 | |
7962 | - dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG); |
|
7962 | + dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG); |
|
7963 | 7963 | $out = ''; |
7964 | 7964 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString($confkeyforautocompletemode) && !$forcecombo) { |
7965 | 7965 | // No immediate load of all database |
@@ -7970,15 +7970,15 @@ discard block |
||
7970 | 7970 | //unset($objecttmp); |
7971 | 7971 | } |
7972 | 7972 | |
7973 | - $objectdesc = $classname . ':' . $classpath . ':' . $addcreatebuttonornot . ':' . $filter; |
|
7974 | - $urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php'; |
|
7973 | + $objectdesc = $classname.':'.$classpath.':'.$addcreatebuttonornot.':'.$filter; |
|
7974 | + $urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php'; |
|
7975 | 7975 | |
7976 | 7976 | // No immediate load of all database |
7977 | - $urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdesc) . '&filter=' . urlencode($filter) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : ''); |
|
7977 | + $urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdesc).'&filter='.urlencode($filter).($sortfield ? '&sortfield='.urlencode($sortfield) : ''); |
|
7978 | 7978 | // Activate the auto complete using ajax call. |
7979 | 7979 | $out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array()); |
7980 | 7980 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
7981 | - $out .= '<input type="text" class="' . $morecss . '"' . ($disabled ? ' disabled="disabled"' : '') . ' name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' />'; |
|
7981 | + $out .= '<input type="text" class="'.$morecss.'"'.($disabled ? ' disabled="disabled"' : '').' name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' />'; |
|
7982 | 7982 | } else { |
7983 | 7983 | // Immediate load of table record. |
7984 | 7984 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -8018,7 +8018,7 @@ discard block |
||
8018 | 8018 | if ($prefixforautocompletemode == 'societe') { |
8019 | 8019 | $prefixforautocompletemode = 'company'; |
8020 | 8020 | } |
8021 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
8021 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
8022 | 8022 | |
8023 | 8023 | if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
8024 | 8024 | $tmpfieldstoshow = ''; |
@@ -8027,7 +8027,7 @@ discard block |
||
8027 | 8027 | continue; |
8028 | 8028 | } |
8029 | 8029 | if (!empty($val['showoncombobox'])) { |
8030 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
8030 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
8031 | 8031 | } |
8032 | 8032 | } |
8033 | 8033 | if ($tmpfieldstoshow) { |
@@ -8055,18 +8055,18 @@ discard block |
||
8055 | 8055 | $num = 0; |
8056 | 8056 | |
8057 | 8057 | // Search data |
8058 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; |
|
8058 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t"; |
|
8059 | 8059 | if (!empty($objecttmp->isextrafieldmanaged)) { |
8060 | - $sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object"; |
|
8060 | + $sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object"; |
|
8061 | 8061 | } |
8062 | 8062 | if (isset($objecttmp->ismultientitymanaged)) { |
8063 | 8063 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
8064 | 8064 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
8065 | - $sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0]; |
|
8065 | + $sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; |
|
8066 | 8066 | } |
8067 | 8067 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
8068 | 8068 | if (empty($user->rights->societe->client->voir) && !$user->socid) { |
8069 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
8069 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
8070 | 8070 | } |
8071 | 8071 | } |
8072 | 8072 | } |
@@ -8086,21 +8086,21 @@ discard block |
||
8086 | 8086 | $sql .= " WHERE 1=1"; |
8087 | 8087 | if (isset($objecttmp->ismultientitymanaged)) { |
8088 | 8088 | if ($objecttmp->ismultientitymanaged == 1) { |
8089 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
8089 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
8090 | 8090 | } |
8091 | 8091 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
8092 | - $sql .= " AND parenttable.entity = t." . $tmparray[0]; |
|
8092 | + $sql .= " AND parenttable.entity = t.".$tmparray[0]; |
|
8093 | 8093 | } |
8094 | 8094 | if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { |
8095 | 8095 | if ($objecttmp->element == 'societe') { |
8096 | - $sql .= " AND t.rowid = " . ((int) $user->socid); |
|
8096 | + $sql .= " AND t.rowid = ".((int) $user->socid); |
|
8097 | 8097 | } else { |
8098 | - $sql .= " AND t.fk_soc = " . ((int) $user->socid); |
|
8098 | + $sql .= " AND t.fk_soc = ".((int) $user->socid); |
|
8099 | 8099 | } |
8100 | 8100 | } |
8101 | 8101 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
8102 | 8102 | if (empty($user->rights->societe->client->voir) && !$user->socid) { |
8103 | - $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
8103 | + $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
8104 | 8104 | } |
8105 | 8105 | } |
8106 | 8106 | } |
@@ -8112,7 +8112,7 @@ discard block |
||
8112 | 8112 | $errormessage = ''; |
8113 | 8113 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
8114 | 8114 | if ($errormessage) { |
8115 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
8115 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
8116 | 8116 | } |
8117 | 8117 | } |
8118 | 8118 | } |
@@ -8124,7 +8124,7 @@ discard block |
||
8124 | 8124 | $resql = $this->db->query($sql); |
8125 | 8125 | if ($resql) { |
8126 | 8126 | // Construct $out and $outarray |
8127 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
8127 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
8128 | 8128 | |
8129 | 8129 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
8130 | 8130 | $textifempty = ' '; |
@@ -8138,7 +8138,7 @@ discard block |
||
8138 | 8138 | } |
8139 | 8139 | } |
8140 | 8140 | if ($showempty) { |
8141 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
8141 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
8142 | 8142 | } |
8143 | 8143 | |
8144 | 8144 | $num = $this->db->num_rows($resql); |
@@ -8161,9 +8161,9 @@ discard block |
||
8161 | 8161 | } |
8162 | 8162 | if (empty($outputmode)) { |
8163 | 8163 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
8164 | - $out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
8164 | + $out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
8165 | 8165 | } else { |
8166 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
8166 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
8167 | 8167 | } |
8168 | 8168 | } else { |
8169 | 8169 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -8176,10 +8176,10 @@ discard block |
||
8176 | 8176 | } |
8177 | 8177 | } |
8178 | 8178 | |
8179 | - $out .= '</select>' . "\n"; |
|
8179 | + $out .= '</select>'."\n"; |
|
8180 | 8180 | |
8181 | 8181 | if (!$forcecombo) { |
8182 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
8182 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
8183 | 8183 | $out .= ajax_combobox($htmlname, null, (!empty($conf->global->$confkeyforautocompletemode) ? $conf->global->$confkeyforautocompletemode : 0)); |
8184 | 8184 | } |
8185 | 8185 | } else { |
@@ -8241,8 +8241,8 @@ discard block |
||
8241 | 8241 | } |
8242 | 8242 | } |
8243 | 8243 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
8244 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"'; |
|
8245 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : ''); |
|
8244 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"'; |
|
8245 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : ''); |
|
8246 | 8246 | $out .= '>'."\n"; |
8247 | 8247 | |
8248 | 8248 | if ($show_empty) { |
@@ -8253,7 +8253,7 @@ discard block |
||
8253 | 8253 | if (!is_numeric($show_empty)) { |
8254 | 8254 | $textforempty = $show_empty; |
8255 | 8255 | } |
8256 | - $out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
8256 | + $out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
8257 | 8257 | } |
8258 | 8258 | if (is_array($array)) { |
8259 | 8259 | // Translate |
@@ -8276,7 +8276,7 @@ discard block |
||
8276 | 8276 | if (is_array($tmpvalue)) { |
8277 | 8277 | $value = $tmpvalue['label']; |
8278 | 8278 | $disabled = empty($tmpvalue['disabled']) ? '' : ' disabled'; |
8279 | - $style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"'; |
|
8279 | + $style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"'; |
|
8280 | 8280 | } else { |
8281 | 8281 | $value = $tmpvalue; |
8282 | 8282 | $disabled = ''; |
@@ -8291,9 +8291,9 @@ discard block |
||
8291 | 8291 | } |
8292 | 8292 | if ($key_in_label) { |
8293 | 8293 | if (empty($nohtmlescape)) { |
8294 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
8294 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
8295 | 8295 | } else { |
8296 | - $selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
8296 | + $selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
8297 | 8297 | } |
8298 | 8298 | } else { |
8299 | 8299 | if (empty($nohtmlescape)) { |
@@ -8305,8 +8305,8 @@ discard block |
||
8305 | 8305 | $selectOptionValue = ' '; |
8306 | 8306 | } |
8307 | 8307 | } |
8308 | - $out .= '<option value="' . $key . '"'; |
|
8309 | - $out .= $style . $disabled; |
|
8308 | + $out .= '<option value="'.$key.'"'; |
|
8309 | + $out .= $style.$disabled; |
|
8310 | 8310 | if (is_array($id)) { |
8311 | 8311 | if (in_array($key, $id) && !$disabled) { |
8312 | 8312 | $out .= ' selected'; // To preselect a value |
@@ -8318,7 +8318,7 @@ discard block |
||
8318 | 8318 | } |
8319 | 8319 | } |
8320 | 8320 | if ($nohtmlescape) { |
8321 | - $out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"'; |
|
8321 | + $out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"'; |
|
8322 | 8322 | } |
8323 | 8323 | if (is_array($tmpvalue)) { |
8324 | 8324 | foreach ($tmpvalue as $keyforvalue => $valueforvalue) { |
@@ -8336,7 +8336,7 @@ discard block |
||
8336 | 8336 | // Add code for jquery to use multiselect |
8337 | 8337 | if ($addjscombo && $jsbeautify) { |
8338 | 8338 | // Enhance with select2 |
8339 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
8339 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
8340 | 8340 | $out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss); |
8341 | 8341 | } |
8342 | 8342 | |
@@ -8368,28 +8368,28 @@ discard block |
||
8368 | 8368 | public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) |
8369 | 8369 | { |
8370 | 8370 | global $conf, $langs; |
8371 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
8371 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
8372 | 8372 | |
8373 | 8373 | // TODO Use an internal dolibarr component instead of select2 |
8374 | 8374 | if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
8375 | 8375 | return ''; |
8376 | 8376 | } |
8377 | 8377 | |
8378 | - $out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>'; |
|
8378 | + $out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>'; |
|
8379 | 8379 | |
8380 | 8380 | $outdelayed = ''; |
8381 | 8381 | if (!empty($conf->use_javascript_ajax)) { |
8382 | 8382 | $tmpplugin = 'select2'; |
8383 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
8384 | - <script nonce="' . getNonce() . '"> |
|
8383 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
8384 | + <script nonce="' . getNonce().'"> |
|
8385 | 8385 | $(document).ready(function () { |
8386 | 8386 | |
8387 | - ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . ' |
|
8387 | + ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').' |
|
8388 | 8388 | |
8389 | - $(".' . $htmlname . '").select2({ |
|
8389 | + $(".' . $htmlname.'").select2({ |
|
8390 | 8390 | ajax: { |
8391 | 8391 | dir: "ltr", |
8392 | - url: "' . $url . '", |
|
8392 | + url: "' . $url.'", |
|
8393 | 8393 | dataType: \'json\', |
8394 | 8394 | delay: 250, |
8395 | 8395 | data: function (params) { |
@@ -8416,9 +8416,9 @@ discard block |
||
8416 | 8416 | }, |
8417 | 8417 | language: select2arrayoflanguage, |
8418 | 8418 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
8419 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
8419 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
8420 | 8420 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
8421 | - minimumInputLength: ' . ((int) $minimumInputLength) . ', |
|
8421 | + minimumInputLength: ' . ((int) $minimumInputLength).', |
|
8422 | 8422 | formatResult: function (result, container, query, escapeMarkup) { |
8423 | 8423 | return escapeMarkup(result.text); |
8424 | 8424 | }, |
@@ -8426,10 +8426,10 @@ discard block |
||
8426 | 8426 | |
8427 | 8427 | ' . ($callurlonselect ? ' |
8428 | 8428 | /* Code to execute a GET when we select a value */ |
8429 | - $(".' . $htmlname . '").change(function() { |
|
8430 | - var selected = $(".' . $htmlname . '").val(); |
|
8429 | + $(".' . $htmlname.'").change(function() { |
|
8430 | + var selected = $(".' . $htmlname.'").val(); |
|
8431 | 8431 | console.log("We select in selectArrayAjax the entry "+selected) |
8432 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
8432 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
8433 | 8433 | $.each( saveRemoteData, function( key, value ) { |
8434 | 8434 | if (key == selected) |
8435 | 8435 | { |
@@ -8437,7 +8437,7 @@ discard block |
||
8437 | 8437 | location.assign(value.url); |
8438 | 8438 | } |
8439 | 8439 | }); |
8440 | - });' : '') . ' |
|
8440 | + });' : '').' |
|
8441 | 8441 | |
8442 | 8442 | }); |
8443 | 8443 | </script>'; |
@@ -8473,14 +8473,14 @@ discard block |
||
8473 | 8473 | public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '') |
8474 | 8474 | { |
8475 | 8475 | global $conf, $langs; |
8476 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
8476 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
8477 | 8477 | |
8478 | 8478 | // TODO Use an internal dolibarr component instead of select2 |
8479 | 8479 | if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
8480 | 8480 | return ''; |
8481 | 8481 | } |
8482 | 8482 | |
8483 | - $out = '<select type="text"'.($textfortitle? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
8483 | + $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
8484 | 8484 | |
8485 | 8485 | $formattedarrayresult = array(); |
8486 | 8486 | |
@@ -8495,20 +8495,20 @@ discard block |
||
8495 | 8495 | $outdelayed = ''; |
8496 | 8496 | if (!empty($conf->use_javascript_ajax)) { |
8497 | 8497 | $tmpplugin = 'select2'; |
8498 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
8499 | - <script nonce="' . getNonce() . '"> |
|
8498 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
8499 | + <script nonce="' . getNonce().'"> |
|
8500 | 8500 | $(document).ready(function () { |
8501 | - var data = ' . json_encode($formattedarrayresult) . '; |
|
8501 | + var data = ' . json_encode($formattedarrayresult).'; |
|
8502 | 8502 | |
8503 | - ' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . ' |
|
8503 | + ' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').' |
|
8504 | 8504 | |
8505 | - $(".' . $htmlname . '").select2({ |
|
8505 | + $(".' . $htmlname.'").select2({ |
|
8506 | 8506 | data: data, |
8507 | 8507 | language: select2arrayoflanguage, |
8508 | 8508 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
8509 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
8509 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
8510 | 8510 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
8511 | - minimumInputLength: ' . $minimumInputLength . ', |
|
8511 | + minimumInputLength: ' . $minimumInputLength.', |
|
8512 | 8512 | formatResult: function (result, container, query, escapeMarkup) { |
8513 | 8513 | return escapeMarkup(result.text); |
8514 | 8514 | }, |
@@ -8547,11 +8547,11 @@ discard block |
||
8547 | 8547 | |
8548 | 8548 | ' . ($callurlonselect ? ' |
8549 | 8549 | /* Code to execute a GET when we select a value */ |
8550 | - $(".' . $htmlname . '").change(function() { |
|
8551 | - var selected = $(".' . $htmlname . '").val(); |
|
8550 | + $(".' . $htmlname.'").change(function() { |
|
8551 | + var selected = $(".' . $htmlname.'").val(); |
|
8552 | 8552 | console.log("We select "+selected) |
8553 | 8553 | |
8554 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
8554 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
8555 | 8555 | $.each( saveRemoteData, function( key, value ) { |
8556 | 8556 | if (key == selected) |
8557 | 8557 | { |
@@ -8559,7 +8559,7 @@ discard block |
||
8559 | 8559 | location.assign(value.url); |
8560 | 8560 | } |
8561 | 8561 | }); |
8562 | - });' : '') . ' |
|
8562 | + });' : '').' |
|
8563 | 8563 | |
8564 | 8564 | }); |
8565 | 8565 | </script>'; |
@@ -8611,7 +8611,7 @@ discard block |
||
8611 | 8611 | } |
8612 | 8612 | |
8613 | 8613 | // Output select component |
8614 | - $out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n"; |
|
8614 | + $out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', $width) ? $width : $width.'px').'"' : '').'>'."\n"; |
|
8615 | 8615 | if (is_array($array) && !empty($array)) { |
8616 | 8616 | if ($value_as_key) { |
8617 | 8617 | $array = array_combine($array, $array); |
@@ -8632,57 +8632,57 @@ discard block |
||
8632 | 8632 | $tmplabelhtml = !empty($value['labelhtml']) ? $value['labelhtml'] : ''; |
8633 | 8633 | } |
8634 | 8634 | $newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue); |
8635 | - $newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval); |
|
8635 | + $newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval); |
|
8636 | 8636 | |
8637 | - $out .= '<option value="' . $tmpkey . '"'; |
|
8637 | + $out .= '<option value="'.$tmpkey.'"'; |
|
8638 | 8638 | if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) { |
8639 | 8639 | $out .= ' selected'; |
8640 | 8640 | } |
8641 | 8641 | if (!empty($tmplabelhtml)) { |
8642 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
8642 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
8643 | 8643 | } else { |
8644 | - $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval; |
|
8645 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
8644 | + $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval; |
|
8645 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
8646 | 8646 | } |
8647 | 8647 | $out .= '>'; |
8648 | 8648 | $out .= dol_htmlentitiesbr($newval); |
8649 | - $out .= '</option>' . "\n"; |
|
8649 | + $out .= '</option>'."\n"; |
|
8650 | 8650 | } |
8651 | 8651 | } |
8652 | 8652 | } |
8653 | - $out .= '</select>' . "\n"; |
|
8653 | + $out .= '</select>'."\n"; |
|
8654 | 8654 | |
8655 | 8655 | // Add code for jquery to use multiselect |
8656 | 8656 | if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) { |
8657 | - $out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->'; |
|
8658 | - $out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n"; |
|
8657 | + $out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->'; |
|
8658 | + $out .= "\n".'<script nonce="'.getNonce().'">'."\n"; |
|
8659 | 8659 | if ($addjscombo == 1) { |
8660 | 8660 | $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; |
8661 | - $out .= 'function formatResult(record, container) {' . "\n"; |
|
8661 | + $out .= 'function formatResult(record, container) {'."\n"; |
|
8662 | 8662 | // If property html set, we decode html entities and use this. |
8663 | 8663 | // Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option. |
8664 | 8664 | $out .= ' if ($(record.element).attr("data-html") != undefined) { return htmlEntityDecodeJs($(record.element).attr("data-html")); }'."\n"; |
8665 | 8665 | $out .= ' return record.text;'; |
8666 | - $out .= '}' . "\n"; |
|
8667 | - $out .= 'function formatSelection(record) {' . "\n"; |
|
8666 | + $out .= '}'."\n"; |
|
8667 | + $out .= 'function formatSelection(record) {'."\n"; |
|
8668 | 8668 | if ($elemtype == 'category') { |
8669 | - $out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
8669 | + $out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
8670 | 8670 | } else { |
8671 | 8671 | $out .= 'return record.text;'; |
8672 | 8672 | } |
8673 | - $out .= '}' . "\n"; |
|
8673 | + $out .= '}'."\n"; |
|
8674 | 8674 | $out .= '$(document).ready(function () { |
8675 | - $(\'#' . $htmlname . '\').' . $tmpplugin . '({'; |
|
8675 | + $(\'#' . $htmlname.'\').'.$tmpplugin.'({'; |
|
8676 | 8676 | if ($placeholder) { |
8677 | 8677 | $out .= ' |
8678 | 8678 | placeholder: { |
8679 | 8679 | id: \'-1\', |
8680 | - text: \'' . dol_escape_js($placeholder) . '\' |
|
8680 | + text: \'' . dol_escape_js($placeholder).'\' |
|
8681 | 8681 | },'; |
8682 | 8682 | } |
8683 | 8683 | $out .= ' dir: \'ltr\', |
8684 | 8684 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */ |
8685 | - dropdownCssClass: \'' . $morecss . '\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */ |
|
8685 | + dropdownCssClass: \'' . $morecss.'\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */ |
|
8686 | 8686 | // Specify format function for dropdown item |
8687 | 8687 | formatResult: formatResult, |
8688 | 8688 | templateResult: formatResult, /* For 4.0 */ |
@@ -8694,21 +8694,21 @@ discard block |
||
8694 | 8694 | |
8695 | 8695 | /* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set |
8696 | 8696 | the size only if component is not hidden by default on load */ |
8697 | - $(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\'); |
|
8697 | + $(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\'); |
|
8698 | 8698 | });' . "\n"; |
8699 | 8699 | } elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) { |
8700 | 8700 | // Add other js lib |
8701 | 8701 | // TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin |
8702 | 8702 | // ... |
8703 | - $out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');'; |
|
8703 | + $out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');'; |
|
8704 | 8704 | $out .= '$(document).ready(function () { |
8705 | - $(\'#' . $htmlname . '\').multiSelect({ |
|
8705 | + $(\'#' . $htmlname.'\').multiSelect({ |
|
8706 | 8706 | containerHTML: \'<div class="multi-select-container">\', |
8707 | 8707 | menuHTML: \'<div class="multi-select-menu">\', |
8708 | - buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\', |
|
8708 | + buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\', |
|
8709 | 8709 | menuItemHTML: \'<label class="multi-select-menuitem">\', |
8710 | 8710 | activeClass: \'multi-select-container--open\', |
8711 | - noneText: \'' . $placeholder . '\' |
|
8711 | + noneText: \'' . $placeholder.'\' |
|
8712 | 8712 | }); |
8713 | 8713 | })'; |
8714 | 8714 | } |
@@ -8740,7 +8740,7 @@ discard block |
||
8740 | 8740 | return ''; |
8741 | 8741 | } |
8742 | 8742 | |
8743 | - $tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show |
|
8743 | + $tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show |
|
8744 | 8744 | |
8745 | 8745 | if (!empty($user->conf->$tmpvar)) { // A list of fields was already customized for user |
8746 | 8746 | $tmparray = explode(',', $user->conf->$tmpvar); |
@@ -8783,19 +8783,19 @@ discard block |
||
8783 | 8783 | } |
8784 | 8784 | |
8785 | 8785 | // Note: $val['checked'] <> 0 means we must show the field into the combo list |
8786 | - $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>'; |
|
8787 | - $listcheckedstring .= (empty($val['checked']) ? '' : $key . ','); |
|
8786 | + $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>'; |
|
8787 | + $listcheckedstring .= (empty($val['checked']) ? '' : $key.','); |
|
8788 | 8788 | } |
8789 | 8789 | } |
8790 | 8790 | |
8791 | - $out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' --> |
|
8791 | + $out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' --> |
|
8792 | 8792 | |
8793 | 8793 | <dl class="dropdown"> |
8794 | 8794 | <dt> |
8795 | - <a href="#' . $htmlname . '"> |
|
8796 | - ' . img_picto('', 'list') . ' |
|
8795 | + <a href="#' . $htmlname.'"> |
|
8796 | + ' . img_picto('', 'list').' |
|
8797 | 8797 | </a> |
8798 | - <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '"> |
|
8798 | + <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'"> |
|
8799 | 8799 | </dt> |
8800 | 8800 | <dd class="dropdowndd"> |
8801 | 8801 | <div class="multiselectcheckbox'.$htmlname.'"> |
@@ -8807,19 +8807,19 @@ discard block |
||
8807 | 8807 | </dd> |
8808 | 8808 | </dl> |
8809 | 8809 | |
8810 | - <script nonce="' . getNonce() . '" type="text/javascript"> |
|
8810 | + <script nonce="' . getNonce().'" type="text/javascript"> |
|
8811 | 8811 | jQuery(document).ready(function () { |
8812 | - $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () { |
|
8812 | + $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () { |
|
8813 | 8813 | console.log("A new field was added/removed, we edit field input[name=formfilteraction]"); |
8814 | 8814 | |
8815 | 8815 | $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\'); // Update field so we know we changed something on selected fields after POST |
8816 | 8816 | |
8817 | 8817 | var title = $(this).val() + ","; |
8818 | 8818 | if ($(this).is(\':checked\')) { |
8819 | - $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val()); |
|
8819 | + $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val()); |
|
8820 | 8820 | } |
8821 | 8821 | else { |
8822 | - $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') ) |
|
8822 | + $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') ) |
|
8823 | 8823 | } |
8824 | 8824 | // Now, we submit page |
8825 | 8825 | //$(this).parents(\'form:first\').submit(); |
@@ -8850,7 +8850,7 @@ discard block |
||
8850 | 8850 | */ |
8851 | 8851 | public function showCategories($id, $type, $rendermode = 0, $nolink = 0) |
8852 | 8852 | { |
8853 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
8853 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
8854 | 8854 | |
8855 | 8855 | $cat = new Categorie($this->db); |
8856 | 8856 | $categories = $cat->containing($id, $type); |
@@ -8860,10 +8860,10 @@ discard block |
||
8860 | 8860 | foreach ($categories as $c) { |
8861 | 8861 | $ways = $c->print_all_ways(' >> ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text |
8862 | 8862 | foreach ($ways as $way) { |
8863 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
8863 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
8864 | 8864 | } |
8865 | 8865 | } |
8866 | - return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
8866 | + return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
8867 | 8867 | } |
8868 | 8868 | |
8869 | 8869 | if ($rendermode == 0) { |
@@ -8911,15 +8911,15 @@ discard block |
||
8911 | 8911 | |
8912 | 8912 | |
8913 | 8913 | print '<div class="div-table-responsive-no-min">'; |
8914 | - print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '" data-elementid="' . $object->id . '" >'; |
|
8914 | + print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'" data-elementid="'.$object->id.'" >'; |
|
8915 | 8915 | |
8916 | 8916 | print '<tr class="liste_titre">'; |
8917 | - print '<td>' . $langs->trans("Type") . '</td>'; |
|
8918 | - print '<td>' . $langs->trans("Ref") . '</td>'; |
|
8917 | + print '<td>'.$langs->trans("Type").'</td>'; |
|
8918 | + print '<td>'.$langs->trans("Ref").'</td>'; |
|
8919 | 8919 | print '<td class="center"></td>'; |
8920 | - print '<td class="center">' . $langs->trans("Date") . '</td>'; |
|
8921 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
8922 | - print '<td class="right">' . $langs->trans("Status") . '</td>'; |
|
8920 | + print '<td class="center">'.$langs->trans("Date").'</td>'; |
|
8921 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
8922 | + print '<td class="right">'.$langs->trans("Status").'</td>'; |
|
8923 | 8923 | print '<td></td>'; |
8924 | 8924 | print '</tr>'; |
8925 | 8925 | |
@@ -8938,13 +8938,13 @@ discard block |
||
8938 | 8938 | if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) { |
8939 | 8939 | $element = $regs[1]; |
8940 | 8940 | $subelement = $regs[2]; |
8941 | - $tplpath = $element . '/' . $subelement; |
|
8941 | + $tplpath = $element.'/'.$subelement; |
|
8942 | 8942 | } |
8943 | 8943 | $tplname = 'linkedobjectblock'; |
8944 | 8944 | |
8945 | 8945 | // To work with non standard path |
8946 | 8946 | if ($objecttype == 'facture') { |
8947 | - $tplpath = 'compta/' . $element; |
|
8947 | + $tplpath = 'compta/'.$element; |
|
8948 | 8948 | if (!isModEnabled('facture')) { |
8949 | 8949 | continue; // Do not show if module disabled |
8950 | 8950 | } |
@@ -8955,7 +8955,7 @@ discard block |
||
8955 | 8955 | continue; // Do not show if module disabled |
8956 | 8956 | } |
8957 | 8957 | } elseif ($objecttype == 'propal') { |
8958 | - $tplpath = 'comm/' . $element; |
|
8958 | + $tplpath = 'comm/'.$element; |
|
8959 | 8959 | if (!isModEnabled('propal')) { |
8960 | 8960 | continue; // Do not show if module disabled |
8961 | 8961 | } |
@@ -9006,14 +9006,14 @@ discard block |
||
9006 | 9006 | $linkedObjectBlock = $objects; |
9007 | 9007 | |
9008 | 9008 | // Output template part (modules that overwrite templates must declare this into descriptor) |
9009 | - $dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl')); |
|
9009 | + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl')); |
|
9010 | 9010 | foreach ($dirtpls as $reldir) { |
9011 | 9011 | if ($nboftypesoutput == ($nbofdifferenttypes - 1)) { // No more type to show after |
9012 | 9012 | global $noMoreLinkedObjectBlockAfter; |
9013 | 9013 | $noMoreLinkedObjectBlockAfter = 1; |
9014 | 9014 | } |
9015 | 9015 | |
9016 | - $res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php'); |
|
9016 | + $res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); |
|
9017 | 9017 | if ($res) { |
9018 | 9018 | $nboftypesoutput++; |
9019 | 9019 | break; |
@@ -9022,7 +9022,7 @@ discard block |
||
9022 | 9022 | } |
9023 | 9023 | |
9024 | 9024 | if (!$nboftypesoutput) { |
9025 | - print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
9025 | + print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
9026 | 9026 | } |
9027 | 9027 | |
9028 | 9028 | print '</table>'; |
@@ -9062,14 +9062,14 @@ discard block |
||
9062 | 9062 | if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) { |
9063 | 9063 | $listofidcompanytoscan = $object->thirdparty->id; |
9064 | 9064 | if (($object->thirdparty->parent > 0) && !empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) { |
9065 | - $listofidcompanytoscan .= ',' . $object->thirdparty->parent; |
|
9065 | + $listofidcompanytoscan .= ','.$object->thirdparty->parent; |
|
9066 | 9066 | } |
9067 | 9067 | if (($object->fk_project > 0) && !empty($conf->global->THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO)) { |
9068 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
9068 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
9069 | 9069 | $tmpproject = new Project($this->db); |
9070 | 9070 | $tmpproject->fetch($object->fk_project); |
9071 | 9071 | if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) { |
9072 | - $listofidcompanytoscan .= ',' . $tmpproject->socid; |
|
9072 | + $listofidcompanytoscan .= ','.$tmpproject->socid; |
|
9073 | 9073 | } |
9074 | 9074 | unset($tmpproject); |
9075 | 9075 | } |
@@ -9079,63 +9079,63 @@ discard block |
||
9079 | 9079 | 'enabled' => isModEnabled('propal'), |
9080 | 9080 | 'perms' => 1, |
9081 | 9081 | 'label' => 'LinkToProposal', |
9082 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('propal') . ')'), |
|
9082 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('propal').')'), |
|
9083 | 9083 | 'shipping' => array( |
9084 | 9084 | 'enabled' => isModEnabled('expedition'), |
9085 | 9085 | 'perms' => 1, |
9086 | 9086 | 'label' => 'LinkToExpedition', |
9087 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('shipping') . ')'), |
|
9087 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('shipping').')'), |
|
9088 | 9088 | 'order' => array( |
9089 | 9089 | 'enabled' => isModEnabled('commande'), |
9090 | 9090 | 'perms' => 1, |
9091 | 9091 | 'label' => 'LinkToOrder', |
9092 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande') . ')'), |
|
9092 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande').')'), |
|
9093 | 9093 | 'invoice' => array( |
9094 | 9094 | 'enabled' => isModEnabled('facture'), |
9095 | 9095 | 'perms' => 1, |
9096 | 9096 | 'label' => 'LinkToInvoice', |
9097 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'), |
|
9097 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), |
|
9098 | 9098 | 'invoice_template' => array( |
9099 | 9099 | 'enabled' => isModEnabled('facture'), |
9100 | 9100 | 'perms' => 1, |
9101 | 9101 | 'label' => 'LinkToTemplateInvoice', |
9102 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'), |
|
9102 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), |
|
9103 | 9103 | 'contrat' => array( |
9104 | 9104 | 'enabled' => isModEnabled('contrat'), |
9105 | 9105 | 'perms' => 1, |
9106 | 9106 | 'label' => 'LinkToContract', |
9107 | 9107 | 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht |
9108 | - FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "contrat as t, " . $this->db->prefix() . "contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('contract') . ') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier' |
|
9108 | + FROM " . $this->db->prefix()."societe as s, ".$this->db->prefix()."contrat as t, ".$this->db->prefix()."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier' |
|
9109 | 9109 | ), |
9110 | 9110 | 'fichinter' => array( |
9111 | 9111 | 'enabled' => isModEnabled('ficheinter'), |
9112 | 9112 | 'perms' => 1, |
9113 | 9113 | 'label' => 'LinkToIntervention', |
9114 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('intervention') . ')'), |
|
9114 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'), |
|
9115 | 9115 | 'supplier_proposal' => array( |
9116 | 9116 | 'enabled' => (isModEnabled('supplier_proposal') ? $conf->supplier_proposal->enabled : 0), |
9117 | 9117 | 'perms' => 1, |
9118 | 9118 | 'label' => 'LinkToSupplierProposal', |
9119 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('supplier_proposal') . ')'), |
|
9119 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), |
|
9120 | 9120 | 'order_supplier' => array( |
9121 | 9121 | 'enabled' => (isModEnabled("supplier_order") ? $conf->supplier_order->enabled : 0), |
9122 | 9122 | 'perms' => 1, |
9123 | 9123 | 'label' => 'LinkToSupplierOrder', |
9124 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande_fournisseur') . ')'), |
|
9124 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), |
|
9125 | 9125 | 'invoice_supplier' => array( |
9126 | 9126 | 'enabled' => (isModEnabled("supplier_invoice") ? $conf->supplier_invoice->enabled : 0), |
9127 | 9127 | 'perms' => 1, 'label' => 'LinkToSupplierInvoice', |
9128 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('facture_fourn') . ')'), |
|
9128 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('facture_fourn').')'), |
|
9129 | 9129 | 'ticket' => array( |
9130 | 9130 | 'enabled' => isModEnabled('ticket'), |
9131 | 9131 | 'perms' => 1, |
9132 | 9132 | 'label' => 'LinkToTicket', |
9133 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('ticket') . ')'), |
|
9133 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')'), |
|
9134 | 9134 | 'mo' => array( |
9135 | 9135 | 'enabled' => isModEnabled('mrp'), |
9136 | 9136 | 'perms' => 1, |
9137 | 9137 | 'label' => 'LinkToMo', |
9138 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM " . $this->db->prefix() . "societe as s INNER JOIN " . $this->db->prefix() . "mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('mo') . ')') |
|
9138 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM ".$this->db->prefix()."societe as s INNER JOIN ".$this->db->prefix()."mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('mo').')') |
|
9139 | 9139 | ); |
9140 | 9140 | } |
9141 | 9141 | |
@@ -9170,22 +9170,22 @@ discard block |
||
9170 | 9170 | } |
9171 | 9171 | |
9172 | 9172 | if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) { |
9173 | - print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>'; |
|
9173 | + print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>'; |
|
9174 | 9174 | |
9175 | 9175 | if (!empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) { |
9176 | 9176 | print '<br>'."\n"; |
9177 | 9177 | print '<!-- form to add a link from anywhere -->'."\n"; |
9178 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">'; |
|
9179 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
9178 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">'; |
|
9179 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
9180 | 9180 | print '<input type="hidden" name="action" value="addlinkbyref">'; |
9181 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
9182 | - print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
9181 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
9182 | + print '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
9183 | 9183 | print '<table class="noborder">'; |
9184 | 9184 | print '<tr>'; |
9185 | 9185 | //print '<td>' . $langs->trans("Ref") . '</td>'; |
9186 | - print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '"> '; |
|
9187 | - print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '"> '; |
|
9188 | - print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>'; |
|
9186 | + print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'"> '; |
|
9187 | + print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'"> '; |
|
9188 | + print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>'; |
|
9189 | 9189 | print '</tr>'; |
9190 | 9190 | print '</table>'; |
9191 | 9191 | print '</form>'; |
@@ -9200,48 +9200,48 @@ discard block |
||
9200 | 9200 | |
9201 | 9201 | print '<br>'; |
9202 | 9202 | print '<!-- form to add a link from object to same thirdparty -->'."\n"; |
9203 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">'; |
|
9203 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">'; |
|
9204 | 9204 | print '<input type="hidden" name="action" value="addlink">'; |
9205 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
9206 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
9207 | - print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
9205 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
9206 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
9207 | + print '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
9208 | 9208 | print '<table class="noborder">'; |
9209 | 9209 | print '<tr class="liste_titre">'; |
9210 | 9210 | print '<td class="nowrap"></td>'; |
9211 | - print '<td class="center">' . $langs->trans("Ref") . '</td>'; |
|
9212 | - print '<td class="left">' . $langs->trans("RefCustomer") . '</td>'; |
|
9213 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
9214 | - print '<td class="left">' . $langs->trans("Company") . '</td>'; |
|
9211 | + print '<td class="center">'.$langs->trans("Ref").'</td>'; |
|
9212 | + print '<td class="left">'.$langs->trans("RefCustomer").'</td>'; |
|
9213 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
9214 | + print '<td class="left">'.$langs->trans("Company").'</td>'; |
|
9215 | 9215 | print '</tr>'; |
9216 | 9216 | while ($i < $num) { |
9217 | 9217 | $objp = $this->db->fetch_object($resqllist); |
9218 | 9218 | |
9219 | 9219 | print '<tr class="oddeven">'; |
9220 | 9220 | print '<td class="left">'; |
9221 | - print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">'; |
|
9221 | + print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">'; |
|
9222 | 9222 | print '</td>'; |
9223 | - print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>'; |
|
9224 | - print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>'; |
|
9223 | + print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>'; |
|
9224 | + print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>'; |
|
9225 | 9225 | print '<td class="right">'; |
9226 | 9226 | if ($possiblelink['label'] == 'LinkToContract') { |
9227 | 9227 | $form = new Form($this->db); |
9228 | - print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' '; |
|
9228 | + print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; |
|
9229 | 9229 | } |
9230 | - print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>'; |
|
9230 | + print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>'; |
|
9231 | 9231 | print '</td>'; |
9232 | - print '<td>' . $objp->name . '</td>'; |
|
9232 | + print '<td>'.$objp->name.'</td>'; |
|
9233 | 9233 | print '</tr>'; |
9234 | 9234 | $i++; |
9235 | 9235 | } |
9236 | 9236 | print '</table>'; |
9237 | 9237 | print '<div class="center">'; |
9238 | 9238 | if ($num) { |
9239 | - print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">'; |
|
9239 | + print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">'; |
|
9240 | 9240 | } |
9241 | 9241 | if (empty($conf->use_javascript_ajax)) { |
9242 | - print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
9242 | + print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
9243 | 9243 | } else { |
9244 | - print '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
9244 | + print '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
9245 | 9245 | } |
9246 | 9246 | print '</form>'; |
9247 | 9247 | $this->db->free($resqllist); |
@@ -9252,10 +9252,10 @@ discard block |
||
9252 | 9252 | |
9253 | 9253 | //$linktoelem.=($linktoelem?' ':''); |
9254 | 9254 | if ($num > 0 || !empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) { |
9255 | - $linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>'; |
|
9255 | + $linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>'; |
|
9256 | 9256 | // } else $linktoelem.=$langs->trans($possiblelink['label']); |
9257 | 9257 | } else { |
9258 | - $linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>'; |
|
9258 | + $linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>'; |
|
9259 | 9259 | } |
9260 | 9260 | } |
9261 | 9261 | } |
@@ -9265,11 +9265,11 @@ discard block |
||
9265 | 9265 | <dl class="dropdown" id="linktoobjectname"> |
9266 | 9266 | '; |
9267 | 9267 | if (!empty($conf->use_javascript_ajax)) { |
9268 | - $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>'; |
|
9268 | + $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>'; |
|
9269 | 9269 | } |
9270 | 9270 | $linktoelem .= '<dd> |
9271 | 9271 | <div class="multiselectlinkto"> |
9272 | - <ul class="ulselectedfields">' . $linktoelemlist . ' |
|
9272 | + <ul class="ulselectedfields">' . $linktoelemlist.' |
|
9273 | 9273 | </ul> |
9274 | 9274 | </div> |
9275 | 9275 | </dd> |
@@ -9280,7 +9280,7 @@ discard block |
||
9280 | 9280 | |
9281 | 9281 | if (!empty($conf->use_javascript_ajax)) { |
9282 | 9282 | print '<!-- Add js to show linkto box --> |
9283 | - <script nonce="' . getNonce() . '"> |
|
9283 | + <script nonce="' . getNonce().'"> |
|
9284 | 9284 | jQuery(document).ready(function() { |
9285 | 9285 | jQuery(".linkto").click(function() { |
9286 | 9286 | console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list"); |
@@ -9321,19 +9321,19 @@ discard block |
||
9321 | 9321 | |
9322 | 9322 | $disabled = ($disabled ? ' disabled' : ''); |
9323 | 9323 | |
9324 | - $resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n"; |
|
9324 | + $resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n"; |
|
9325 | 9325 | if ($useempty) { |
9326 | - $resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '> </option>' . "\n"; |
|
9326 | + $resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'> </option>'."\n"; |
|
9327 | 9327 | } |
9328 | 9328 | if (("$value" == 'yes') || ($value == 1)) { |
9329 | - $resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
9330 | - $resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n"; |
|
9329 | + $resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n"; |
|
9330 | + $resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n"; |
|
9331 | 9331 | } else { |
9332 | 9332 | $selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected'); |
9333 | - $resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
9334 | - $resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n"; |
|
9333 | + $resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n"; |
|
9334 | + $resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n"; |
|
9335 | 9335 | } |
9336 | - $resultyesno .= '</select>' . "\n"; |
|
9336 | + $resultyesno .= '</select>'."\n"; |
|
9337 | 9337 | |
9338 | 9338 | if ($addjscombo) { |
9339 | 9339 | $resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss); |
@@ -9357,12 +9357,12 @@ discard block |
||
9357 | 9357 | { |
9358 | 9358 | // phpcs:enable |
9359 | 9359 | $sql = "SELECT rowid, label"; |
9360 | - $sql .= " FROM " . $this->db->prefix() . "export_model"; |
|
9361 | - $sql .= " WHERE type = '" . $this->db->escape($type) . "'"; |
|
9360 | + $sql .= " FROM ".$this->db->prefix()."export_model"; |
|
9361 | + $sql .= " WHERE type = '".$this->db->escape($type)."'"; |
|
9362 | 9362 | $sql .= " ORDER BY rowid"; |
9363 | 9363 | $result = $this->db->query($sql); |
9364 | 9364 | if ($result) { |
9365 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
9365 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
9366 | 9366 | if ($useempty) { |
9367 | 9367 | print '<option value="-1"> </option>'; |
9368 | 9368 | } |
@@ -9372,9 +9372,9 @@ discard block |
||
9372 | 9372 | while ($i < $num) { |
9373 | 9373 | $obj = $this->db->fetch_object($result); |
9374 | 9374 | if ($selected == $obj->rowid) { |
9375 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
9375 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
9376 | 9376 | } else { |
9377 | - print '<option value="' . $obj->rowid . '">'; |
|
9377 | + print '<option value="'.$obj->rowid.'">'; |
|
9378 | 9378 | } |
9379 | 9379 | print $obj->label; |
9380 | 9380 | print '</option>'; |
@@ -9464,8 +9464,8 @@ discard block |
||
9464 | 9464 | $stringforfirstkey .= ' CTL +'; |
9465 | 9465 | } |
9466 | 9466 | |
9467 | - $previous_ref = $object->ref_previous ? '<a accesskey="p" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_previous) . $moreparam . '"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>'; |
|
9468 | - $next_ref = $object->ref_next ? '<a accesskey="n" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_next) . $moreparam . '"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>'; |
|
9467 | + $previous_ref = $object->ref_previous ? '<a accesskey="p" title="'.$stringforfirstkey.' p" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>'; |
|
9468 | + $next_ref = $object->ref_next ? '<a accesskey="n" title="'.$stringforfirstkey.' n" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>'; |
|
9469 | 9469 | } |
9470 | 9470 | |
9471 | 9471 | //print "xx".$previous_ref."x".$next_ref; |
@@ -9473,18 +9473,18 @@ discard block |
||
9473 | 9473 | |
9474 | 9474 | // Right part of banner |
9475 | 9475 | if ($morehtmlright) { |
9476 | - $ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>'; |
|
9476 | + $ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>'; |
|
9477 | 9477 | } |
9478 | 9478 | |
9479 | 9479 | if ($previous_ref || $next_ref || $morehtml) { |
9480 | 9480 | $ret .= '<div class="pagination paginationref"><ul class="right">'; |
9481 | 9481 | } |
9482 | 9482 | if ($morehtml) { |
9483 | - $ret .= '<li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>'; |
|
9483 | + $ret .= '<li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>'; |
|
9484 | 9484 | } |
9485 | 9485 | if ($shownav && ($previous_ref || $next_ref)) { |
9486 | - $ret .= '<li class="pagination">' . $previous_ref . '</li>'; |
|
9487 | - $ret .= '<li class="pagination">' . $next_ref . '</li>'; |
|
9486 | + $ret .= '<li class="pagination">'.$previous_ref.'</li>'; |
|
9487 | + $ret .= '<li class="pagination">'.$next_ref.'</li>'; |
|
9488 | 9488 | } |
9489 | 9489 | if ($previous_ref || $next_ref || $morehtml) { |
9490 | 9490 | $ret .= '</ul></div>'; |
@@ -9499,7 +9499,7 @@ discard block |
||
9499 | 9499 | $morehtmlstatus = $hookmanager->resPrint; |
9500 | 9500 | } |
9501 | 9501 | if ($morehtmlstatus) { |
9502 | - $ret .= '<div class="statusref">' . $morehtmlstatus . '</div>'; |
|
9502 | + $ret .= '<div class="statusref">'.$morehtmlstatus.'</div>'; |
|
9503 | 9503 | } |
9504 | 9504 | |
9505 | 9505 | $parameters = array(); |
@@ -9513,14 +9513,14 @@ discard block |
||
9513 | 9513 | // Left part of banner |
9514 | 9514 | if ($morehtmlleft) { |
9515 | 9515 | if ($conf->browser->layout == 'phone') { |
9516 | - $ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>'; |
|
9516 | + $ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>'; |
|
9517 | 9517 | } else { |
9518 | - $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>'; |
|
9518 | + $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>'; |
|
9519 | 9519 | } |
9520 | 9520 | } |
9521 | 9521 | |
9522 | 9522 | //if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>'; |
9523 | - $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">'; |
|
9523 | + $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">'; |
|
9524 | 9524 | |
9525 | 9525 | // For thirdparty, contact, user, member, the ref is the id, so we show something else |
9526 | 9526 | if ($object->element == 'societe') { |
@@ -9534,7 +9534,7 @@ discard block |
||
9534 | 9534 | |
9535 | 9535 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
9536 | 9536 | if (!is_object($extralanguages)) { |
9537 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
9537 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
9538 | 9538 | $extralanguages = new ExtraLanguages($this->db); |
9539 | 9539 | } |
9540 | 9540 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -9549,27 +9549,27 @@ discard block |
||
9549 | 9549 | if ($object->array_languages['name'][$extralangcode]) { |
9550 | 9550 | $htmltext .= $object->array_languages['name'][$extralangcode]; |
9551 | 9551 | } else { |
9552 | - $htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>'; |
|
9552 | + $htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>'; |
|
9553 | 9553 | } |
9554 | 9554 | } |
9555 | - $ret .= '<!-- Show translations of name -->' . "\n"; |
|
9555 | + $ret .= '<!-- Show translations of name -->'."\n"; |
|
9556 | 9556 | $ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft'); |
9557 | 9557 | } |
9558 | 9558 | } |
9559 | 9559 | } elseif ($object->element == 'member') { |
9560 | - $ret .= $object->ref . '<br>'; |
|
9560 | + $ret .= $object->ref.'<br>'; |
|
9561 | 9561 | $fullname = $object->getFullName($langs); |
9562 | 9562 | if ($object->morphy == 'mor' && $object->societe) { |
9563 | - $ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''); |
|
9563 | + $ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : ''); |
|
9564 | 9564 | } else { |
9565 | - $ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : ''); |
|
9565 | + $ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : ''); |
|
9566 | 9566 | } |
9567 | 9567 | } elseif (in_array($object->element, array('contact', 'user'))) { |
9568 | - $ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt; |
|
9568 | + $ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt; |
|
9569 | 9569 | } elseif ($object->element == 'usergroup') { |
9570 | 9570 | $ret .= dol_htmlentities($object->name); |
9571 | 9571 | } elseif (in_array($object->element, array('action', 'agenda'))) { |
9572 | - $ret .= $object->ref . '<br>' . $object->label; |
|
9572 | + $ret .= $object->ref.'<br>'.$object->label; |
|
9573 | 9573 | } elseif (in_array($object->element, array('adherent_type'))) { |
9574 | 9574 | $ret .= $object->label; |
9575 | 9575 | } elseif ($object->element == 'ecm_directories') { |
@@ -9621,9 +9621,9 @@ discard block |
||
9621 | 9621 | } |
9622 | 9622 | |
9623 | 9623 | // Barcode image |
9624 | - $url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code); |
|
9625 | - $out = '<!-- url barcode = ' . $url . ' -->'; |
|
9626 | - $out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>'; |
|
9624 | + $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code); |
|
9625 | + $out = '<!-- url barcode = '.$url.' -->'; |
|
9626 | + $out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>'; |
|
9627 | 9627 | |
9628 | 9628 | return $out; |
9629 | 9629 | } |
@@ -9663,28 +9663,28 @@ discard block |
||
9663 | 9663 | if (!empty($object->logo)) { |
9664 | 9664 | if (dolIsAllowedForPreview($object->logo)) { |
9665 | 9665 | if ((string) $imagesize == 'mini') { |
9666 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
9666 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
9667 | 9667 | } elseif ((string) $imagesize == 'small') { |
9668 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small'); |
|
9668 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small'); |
|
9669 | 9669 | } else { |
9670 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
9670 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
9671 | 9671 | } |
9672 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
9672 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
9673 | 9673 | } |
9674 | 9674 | } |
9675 | 9675 | $email = $object->email; |
9676 | 9676 | } elseif ($modulepart == 'contact') { |
9677 | - $dir = $conf->societe->multidir_output[$entity] . '/contact'; |
|
9677 | + $dir = $conf->societe->multidir_output[$entity].'/contact'; |
|
9678 | 9678 | if (!empty($object->photo)) { |
9679 | 9679 | if (dolIsAllowedForPreview($object->photo)) { |
9680 | 9680 | if ((string) $imagesize == 'mini') { |
9681 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
9681 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
9682 | 9682 | } elseif ((string) $imagesize == 'small') { |
9683 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
9683 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
9684 | 9684 | } else { |
9685 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
9685 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
9686 | 9686 | } |
9687 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
9687 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
9688 | 9688 | } |
9689 | 9689 | } |
9690 | 9690 | $email = $object->email; |
@@ -9694,17 +9694,17 @@ discard block |
||
9694 | 9694 | if (!empty($object->photo)) { |
9695 | 9695 | if (dolIsAllowedForPreview($object->photo)) { |
9696 | 9696 | if ((string) $imagesize == 'mini') { |
9697 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
9697 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
9698 | 9698 | } elseif ((string) $imagesize == 'small') { |
9699 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
9699 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
9700 | 9700 | } else { |
9701 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
9701 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
9702 | 9702 | } |
9703 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
9703 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
9704 | 9704 | } |
9705 | 9705 | } |
9706 | 9706 | if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) { |
9707 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
9707 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
9708 | 9708 | } |
9709 | 9709 | $email = $object->email; |
9710 | 9710 | $capture = 'user'; |
@@ -9713,17 +9713,17 @@ discard block |
||
9713 | 9713 | if (!empty($object->photo)) { |
9714 | 9714 | if (dolIsAllowedForPreview($object->photo)) { |
9715 | 9715 | if ((string) $imagesize == 'mini') { |
9716 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
9716 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
9717 | 9717 | } elseif ((string) $imagesize == 'small') { |
9718 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
9718 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
9719 | 9719 | } else { |
9720 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
9720 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
9721 | 9721 | } |
9722 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
9722 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
9723 | 9723 | } |
9724 | 9724 | } |
9725 | 9725 | if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) { |
9726 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
9726 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
9727 | 9727 | } |
9728 | 9728 | $email = $object->email; |
9729 | 9729 | $capture = 'user'; |
@@ -9733,17 +9733,17 @@ discard block |
||
9733 | 9733 | if (!empty($object->photo)) { |
9734 | 9734 | if (dolIsAllowedForPreview($object->photo)) { |
9735 | 9735 | if ((string) $imagesize == 'mini') { |
9736 | - $file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
9736 | + $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
9737 | 9737 | } elseif ((string) $imagesize == 'small') { |
9738 | - $file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
9738 | + $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
9739 | 9739 | } else { |
9740 | - $file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo; |
|
9740 | + $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; |
|
9741 | 9741 | } |
9742 | - $originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo; |
|
9742 | + $originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; |
|
9743 | 9743 | } |
9744 | 9744 | } |
9745 | 9745 | if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) { |
9746 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
9746 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
9747 | 9747 | } |
9748 | 9748 | $email = $object->email; |
9749 | 9749 | } |
@@ -9753,35 +9753,35 @@ discard block |
||
9753 | 9753 | } |
9754 | 9754 | |
9755 | 9755 | if ($dir) { |
9756 | - if ($file && file_exists($dir . "/" . $file)) { |
|
9756 | + if ($file && file_exists($dir."/".$file)) { |
|
9757 | 9757 | if ($addlinktofullsize) { |
9758 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
9758 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
9759 | 9759 | if ($urladvanced) { |
9760 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
9760 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
9761 | 9761 | } else { |
9762 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
9762 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
9763 | 9763 | } |
9764 | 9764 | } |
9765 | - $ret .= '<img alt="Photo" class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . ' photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($file) . '&cache=' . $cache . '">'; |
|
9765 | + $ret .= '<img alt="Photo" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">'; |
|
9766 | 9766 | if ($addlinktofullsize) { |
9767 | 9767 | $ret .= '</a>'; |
9768 | 9768 | } |
9769 | - } elseif ($altfile && file_exists($dir . "/" . $altfile)) { |
|
9769 | + } elseif ($altfile && file_exists($dir."/".$altfile)) { |
|
9770 | 9770 | if ($addlinktofullsize) { |
9771 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
9771 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
9772 | 9772 | if ($urladvanced) { |
9773 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
9773 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
9774 | 9774 | } else { |
9775 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
9775 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
9776 | 9776 | } |
9777 | 9777 | } |
9778 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="Photo alt" id="photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" class="' . $cssclass . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($altfile) . '&cache=' . $cache . '">'; |
|
9778 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="Photo alt" id="photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" class="'.$cssclass.'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($altfile).'&cache='.$cache.'">'; |
|
9779 | 9779 | if ($addlinktofullsize) { |
9780 | 9780 | $ret .= '</a>'; |
9781 | 9781 | } |
9782 | 9782 | } else { |
9783 | 9783 | $nophoto = '/public/theme/common/nophoto.png'; |
9784 | - $defaultimg = 'identicon'; // For gravatar |
|
9784 | + $defaultimg = 'identicon'; // For gravatar |
|
9785 | 9785 | if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) { // For modules that need a special image when photo not found |
9786 | 9786 | if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor')) !== false) { |
9787 | 9787 | $nophoto = 'company'; |
@@ -9799,13 +9799,13 @@ discard block |
||
9799 | 9799 | if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) { |
9800 | 9800 | // see https://gravatar.com/site/implement/images/php/ |
9801 | 9801 | $ret .= '<!-- Put link to gravatar -->'; |
9802 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" title="' . $email . ' Gravatar avatar" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="https://www.gravatar.com/avatar/' . md5(strtolower(trim($email))) . '?s=' . $width . '&d=' . $defaultimg . '">'; // gravatar need md5 hash |
|
9802 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.md5(strtolower(trim($email))).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash |
|
9803 | 9803 | } else { |
9804 | 9804 | if ($nophoto == 'company') { |
9805 | - $ret .= '<div class="divforspanimg photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>'; |
|
9805 | + $ret .= '<div class="divforspanimg photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>'; |
|
9806 | 9806 | $ret .= '<div class="difforspanimgright"></div>'; |
9807 | 9807 | } else { |
9808 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">'; |
|
9808 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">'; |
|
9809 | 9809 | } |
9810 | 9810 | } |
9811 | 9811 | } |
@@ -9816,20 +9816,20 @@ discard block |
||
9816 | 9816 | } |
9817 | 9817 | $ret .= '<table class="nobordernopadding centpercent">'; |
9818 | 9818 | if ($object->photo) { |
9819 | - $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>'; |
|
9819 | + $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>'; |
|
9820 | 9820 | } |
9821 | 9821 | $ret .= '<tr><td class="tdoverflow">'; |
9822 | 9822 | $maxfilesizearray = getMaxFileSizeArray(); |
9823 | 9823 | $maxmin = $maxfilesizearray['maxmin']; |
9824 | 9824 | if ($maxmin > 0) { |
9825 | - $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
9825 | + $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
9826 | 9826 | } |
9827 | - $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>'; |
|
9827 | + $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>'; |
|
9828 | 9828 | $ret .= '</td></tr>'; |
9829 | 9829 | $ret .= '</table>'; |
9830 | 9830 | } |
9831 | 9831 | } else { |
9832 | - dol_print_error('', 'Call of showphoto with wrong parameters modulepart=' . $modulepart); |
|
9832 | + dol_print_error('', 'Call of showphoto with wrong parameters modulepart='.$modulepart); |
|
9833 | 9833 | } |
9834 | 9834 | |
9835 | 9835 | return $ret; |
@@ -9880,38 +9880,38 @@ discard block |
||
9880 | 9880 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
9881 | 9881 | $sql .= ", e.label"; |
9882 | 9882 | } |
9883 | - $sql .= " FROM " . $this->db->prefix() . "usergroup as ug "; |
|
9883 | + $sql .= " FROM ".$this->db->prefix()."usergroup as ug "; |
|
9884 | 9884 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
9885 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity"; |
|
9885 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity"; |
|
9886 | 9886 | if ($force_entity) { |
9887 | - $sql .= " WHERE ug.entity IN (0, " . $force_entity . ")"; |
|
9887 | + $sql .= " WHERE ug.entity IN (0, ".$force_entity.")"; |
|
9888 | 9888 | } else { |
9889 | 9889 | $sql .= " WHERE ug.entity IS NOT NULL"; |
9890 | 9890 | } |
9891 | 9891 | } else { |
9892 | - $sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")"; |
|
9892 | + $sql .= " WHERE ug.entity IN (0, ".$conf->entity.")"; |
|
9893 | 9893 | } |
9894 | 9894 | if (is_array($exclude) && $excludeGroups) { |
9895 | - $sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")"; |
|
9895 | + $sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")"; |
|
9896 | 9896 | } |
9897 | 9897 | if (is_array($include) && $includeGroups) { |
9898 | - $sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")"; |
|
9898 | + $sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")"; |
|
9899 | 9899 | } |
9900 | 9900 | $sql .= " ORDER BY ug.nom ASC"; |
9901 | 9901 | |
9902 | - dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG); |
|
9902 | + dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG); |
|
9903 | 9903 | $resql = $this->db->query($sql); |
9904 | 9904 | if ($resql) { |
9905 | 9905 | // Enhance with select2 |
9906 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
9906 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
9907 | 9907 | |
9908 | - $out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
9908 | + $out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
9909 | 9909 | |
9910 | 9910 | $num = $this->db->num_rows($resql); |
9911 | 9911 | $i = 0; |
9912 | 9912 | if ($num) { |
9913 | 9913 | if ($show_empty && !$multiple) { |
9914 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '> </option>' . "\n"; |
|
9914 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'> </option>'."\n"; |
|
9915 | 9915 | } |
9916 | 9916 | |
9917 | 9917 | while ($i < $num) { |
@@ -9921,7 +9921,7 @@ discard block |
||
9921 | 9921 | $disableline = 1; |
9922 | 9922 | } |
9923 | 9923 | |
9924 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
9924 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
9925 | 9925 | if ($disableline) { |
9926 | 9926 | $out .= ' disabled'; |
9927 | 9927 | } |
@@ -9932,7 +9932,7 @@ discard block |
||
9932 | 9932 | |
9933 | 9933 | $out .= $obj->name; |
9934 | 9934 | if (isModEnabled('multicompany') && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1) { |
9935 | - $out .= " (" . $obj->label . ")"; |
|
9935 | + $out .= " (".$obj->label.")"; |
|
9936 | 9936 | } |
9937 | 9937 | |
9938 | 9938 | $out .= '</option>'; |
@@ -9940,9 +9940,9 @@ discard block |
||
9940 | 9940 | } |
9941 | 9941 | } else { |
9942 | 9942 | if ($show_empty) { |
9943 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n"; |
|
9943 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n"; |
|
9944 | 9944 | } |
9945 | - $out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>'; |
|
9945 | + $out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>'; |
|
9946 | 9946 | } |
9947 | 9947 | $out .= '</select>'; |
9948 | 9948 | |
@@ -9991,25 +9991,25 @@ discard block |
||
9991 | 9991 | $out = ''; |
9992 | 9992 | |
9993 | 9993 | if (!empty($conf->use_javascript_ajax)) { |
9994 | - $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>'; |
|
9994 | + $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>'; |
|
9995 | 9995 | } |
9996 | - $out .= '<script nonce="' . getNonce() . '"> |
|
9996 | + $out .= '<script nonce="'.getNonce().'"> |
|
9997 | 9997 | $(document).ready(function() { |
9998 | - $("#' . $cssclass . 's").click(function() { |
|
9998 | + $("#' . $cssclass.'s").click(function() { |
|
9999 | 9999 | if($(this).is(\':checked\')){ |
10000 | - console.log("We check all ' . $cssclass . ' and trigger the change method"); |
|
10001 | - $(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\'); |
|
10000 | + console.log("We check all ' . $cssclass.' and trigger the change method"); |
|
10001 | + $(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\'); |
|
10002 | 10002 | } |
10003 | 10003 | else |
10004 | 10004 | { |
10005 | 10005 | console.log("We uncheck all"); |
10006 | - $(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\'); |
|
10006 | + $(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\'); |
|
10007 | 10007 | }' . "\n"; |
10008 | 10008 | if ($calljsfunction) { |
10009 | - $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
10009 | + $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
10010 | 10010 | } |
10011 | 10011 | $out .= ' }); |
10012 | - $(".' . $cssclass . '").change(function() { |
|
10012 | + $(".' . $cssclass.'").change(function() { |
|
10013 | 10013 | $(this).closest("tr").toggleClass("highlight", this.checked); |
10014 | 10014 | }); |
10015 | 10015 | }); |
@@ -10054,67 +10054,67 @@ discard block |
||
10054 | 10054 | global $langs, $user; |
10055 | 10055 | |
10056 | 10056 | $out = ''; |
10057 | - $sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1"; |
|
10058 | - $sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")"; |
|
10057 | + $sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1"; |
|
10058 | + $sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")"; |
|
10059 | 10059 | if (!empty($excludeid)) { |
10060 | - $sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")"; |
|
10060 | + $sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")"; |
|
10061 | 10061 | } |
10062 | 10062 | $sql .= " ORDER BY label"; |
10063 | 10063 | |
10064 | 10064 | $resql = $this->db->query($sql); |
10065 | 10065 | if ($resql) { |
10066 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">'; |
|
10066 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">'; |
|
10067 | 10067 | if ($useempty) { |
10068 | 10068 | $out .= '<option value="0"> </option>'; |
10069 | 10069 | } |
10070 | 10070 | |
10071 | 10071 | while ($obj = $this->db->fetch_object($resql)) { |
10072 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>'; |
|
10072 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>'; |
|
10073 | 10073 | } |
10074 | 10074 | $out .= '</select>'; |
10075 | - $out .= ajax_combobox('select_' . $htmlname); |
|
10075 | + $out .= ajax_combobox('select_'.$htmlname); |
|
10076 | 10076 | |
10077 | 10077 | if (!empty($htmlname) && $user->admin && $info_admin) { |
10078 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
10078 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
10079 | 10079 | } |
10080 | 10080 | |
10081 | 10081 | if (!empty($target)) { |
10082 | - $sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
10082 | + $sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
10083 | 10083 | $resql = $this->db->query($sql); |
10084 | 10084 | if ($resql) { |
10085 | 10085 | if ($this->db->num_rows($resql) > 0) { |
10086 | 10086 | $obj = $this->db->fetch_object($resql); |
10087 | - $out .= '<script nonce="' . getNonce() . '"> |
|
10087 | + $out .= '<script nonce="'.getNonce().'"> |
|
10088 | 10088 | $(function() { |
10089 | - $("select[name=' . $target . ']").on("change", function() { |
|
10089 | + $("select[name=' . $target.']").on("change", function() { |
|
10090 | 10090 | var current_val = $(this).val(); |
10091 | - if (current_val == ' . $obj->id . ') {'; |
|
10091 | + if (current_val == ' . $obj->id.') {'; |
|
10092 | 10092 | if (!empty($default_selected) || !empty($selected)) { |
10093 | - $out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");'; |
|
10093 | + $out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");'; |
|
10094 | 10094 | } |
10095 | 10095 | |
10096 | 10096 | $out .= ' |
10097 | - $("select[name=' . $htmlname . ']").change(); |
|
10097 | + $("select[name=' . $htmlname.']").change(); |
|
10098 | 10098 | } |
10099 | 10099 | }); |
10100 | 10100 | |
10101 | - $("select[name=' . $htmlname . ']").change(function() { |
|
10101 | + $("select[name=' . $htmlname.']").change(function() { |
|
10102 | 10102 | |
10103 | - if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') { |
|
10103 | + if ($("select[name=' . $target.']").val() == '.$obj->id.') { |
|
10104 | 10104 | // get price of kilometer to fill the unit price |
10105 | 10105 | $.ajax({ |
10106 | 10106 | method: "POST", |
10107 | 10107 | dataType: "json", |
10108 | - data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' }, |
|
10109 | - url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . join('&', $params)) . '", |
|
10108 | + data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' }, |
|
10109 | + url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.join('&', $params)).'", |
|
10110 | 10110 | }).done(function( data, textStatus, jqXHR ) { |
10111 | 10111 | console.log(data); |
10112 | 10112 | if (typeof data.up != "undefined") { |
10113 | 10113 | $("input[name=value_unit]").val(data.up); |
10114 | - $("select[name=' . $htmlname . ']").attr("title", data.title); |
|
10114 | + $("select[name=' . $htmlname.']").attr("title", data.title); |
|
10115 | 10115 | } else { |
10116 | 10116 | $("input[name=value_unit]").val(""); |
10117 | - $("select[name=' . $htmlname . ']").attr("title", ""); |
|
10117 | + $("select[name=' . $htmlname.']").attr("title", ""); |
|
10118 | 10118 | } |
10119 | 10119 | }); |
10120 | 10120 | } |
@@ -10144,18 +10144,18 @@ discard block |
||
10144 | 10144 | global $conf, $langs; |
10145 | 10145 | |
10146 | 10146 | $out = ''; |
10147 | - $sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range"; |
|
10148 | - $sql .= " WHERE entity = " . $conf->entity . " AND active = 1"; |
|
10147 | + $sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range"; |
|
10148 | + $sql .= " WHERE entity = ".$conf->entity." AND active = 1"; |
|
10149 | 10149 | |
10150 | 10150 | $resql = $this->db->query($sql); |
10151 | 10151 | if ($resql) { |
10152 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
10152 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
10153 | 10153 | if ($useempty) { |
10154 | 10154 | $out .= '<option value="0"></option>'; |
10155 | 10155 | } |
10156 | 10156 | |
10157 | 10157 | while ($obj = $this->db->fetch_object($resql)) { |
10158 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>'; |
|
10158 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>'; |
|
10159 | 10159 | } |
10160 | 10160 | $out .= '</select>'; |
10161 | 10161 | } else { |
@@ -10180,17 +10180,17 @@ discard block |
||
10180 | 10180 | global $langs; |
10181 | 10181 | |
10182 | 10182 | $out = ''; |
10183 | - $sql = "SELECT id, code, label FROM " . $this->db->prefix() . "c_type_fees"; |
|
10183 | + $sql = "SELECT id, code, label FROM ".$this->db->prefix()."c_type_fees"; |
|
10184 | 10184 | $sql .= " WHERE active = 1"; |
10185 | 10185 | |
10186 | 10186 | $resql = $this->db->query($sql); |
10187 | 10187 | if ($resql) { |
10188 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
10188 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
10189 | 10189 | if ($useempty) { |
10190 | 10190 | $out .= '<option value="0"></option>'; |
10191 | 10191 | } |
10192 | 10192 | if ($allchoice) { |
10193 | - $out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>'; |
|
10193 | + $out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>'; |
|
10194 | 10194 | } |
10195 | 10195 | |
10196 | 10196 | $field = 'code'; |
@@ -10200,7 +10200,7 @@ discard block |
||
10200 | 10200 | |
10201 | 10201 | while ($obj = $this->db->fetch_object($resql)) { |
10202 | 10202 | $key = $langs->trans($obj->code); |
10203 | - $out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>'; |
|
10203 | + $out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>'; |
|
10204 | 10204 | } |
10205 | 10205 | $out .= '</select>'; |
10206 | 10206 | } else { |
@@ -10232,7 +10232,7 @@ discard block |
||
10232 | 10232 | { |
10233 | 10233 | global $user, $conf, $langs; |
10234 | 10234 | |
10235 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
10235 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
10236 | 10236 | |
10237 | 10237 | if (is_null($usertofilter)) { |
10238 | 10238 | $usertofilter = $user; |
@@ -10256,10 +10256,10 @@ discard block |
||
10256 | 10256 | $sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref, |
10257 | 10257 | p.title, p.fk_soc, p.fk_statut, p.public,"; |
10258 | 10258 | $sql .= ' s.nom as name'; |
10259 | - $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
|
10260 | - $sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,'; |
|
10261 | - $sql .= ' ' . $this->db->prefix() . 'facture as f'; |
|
10262 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
10259 | + $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
10260 | + $sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,'; |
|
10261 | + $sql .= ' '.$this->db->prefix().'facture as f'; |
|
10262 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
10263 | 10263 | $sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement |
10264 | 10264 | //if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
10265 | 10265 | //if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
@@ -10270,14 +10270,14 @@ discard block |
||
10270 | 10270 | if ($resql) { |
10271 | 10271 | // Use select2 selector |
10272 | 10272 | if (!empty($conf->use_javascript_ajax)) { |
10273 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
10273 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
10274 | 10274 | $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); |
10275 | 10275 | $out .= $comboenhancement; |
10276 | 10276 | $morecss = 'minwidth200imp maxwidth500'; |
10277 | 10277 | } |
10278 | 10278 | |
10279 | 10279 | if (empty($option_only)) { |
10280 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
10280 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
10281 | 10281 | } |
10282 | 10282 | if (!empty($show_empty)) { |
10283 | 10283 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10307,33 +10307,33 @@ discard block |
||
10307 | 10307 | if ($showproject == 'all') { |
10308 | 10308 | $labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref |
10309 | 10309 | if ($obj->name) { |
10310 | - $labeltoshow .= ' - ' . $obj->name; // Soc name |
|
10310 | + $labeltoshow .= ' - '.$obj->name; // Soc name |
|
10311 | 10311 | } |
10312 | 10312 | |
10313 | 10313 | $disabled = 0; |
10314 | 10314 | if ($obj->fk_statut == Project::STATUS_DRAFT) { |
10315 | 10315 | $disabled = 1; |
10316 | - $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
10316 | + $labeltoshow .= ' - '.$langs->trans("Draft"); |
|
10317 | 10317 | } elseif ($obj->fk_statut == Project::STATUS_CLOSED) { |
10318 | 10318 | if ($discard_closed == 2) { |
10319 | 10319 | $disabled = 1; |
10320 | 10320 | } |
10321 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
10321 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
10322 | 10322 | } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
10323 | 10323 | $disabled = 1; |
10324 | - $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
10324 | + $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
|
10325 | 10325 | } |
10326 | 10326 | } |
10327 | 10327 | |
10328 | 10328 | if (!empty($selected) && $selected == $obj->rowid) { |
10329 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
10329 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
10330 | 10330 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
10331 | - $out .= '>' . $labeltoshow . '</option>'; |
|
10331 | + $out .= '>'.$labeltoshow.'</option>'; |
|
10332 | 10332 | } else { |
10333 | 10333 | if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
10334 | 10334 | $resultat = ''; |
10335 | 10335 | } else { |
10336 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
10336 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
10337 | 10337 | if ($disabled) { |
10338 | 10338 | $resultat .= ' disabled'; |
10339 | 10339 | } |
@@ -10385,22 +10385,22 @@ discard block |
||
10385 | 10385 | |
10386 | 10386 | $sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc'; |
10387 | 10387 | //$sql.= ', el.fk_source'; |
10388 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f'; |
|
10389 | - $sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")"; |
|
10388 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f'; |
|
10389 | + $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; |
|
10390 | 10390 | $sql .= " ORDER BY f.titre ASC"; |
10391 | 10391 | |
10392 | 10392 | $resql = $this->db->query($sql); |
10393 | 10393 | if ($resql) { |
10394 | 10394 | // Use select2 selector |
10395 | 10395 | if (!empty($conf->use_javascript_ajax)) { |
10396 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
10396 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
10397 | 10397 | $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); |
10398 | 10398 | $out .= $comboenhancement; |
10399 | 10399 | $morecss = 'minwidth200imp maxwidth500'; |
10400 | 10400 | } |
10401 | 10401 | |
10402 | 10402 | if (empty($option_only)) { |
10403 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
10403 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
10404 | 10404 | } |
10405 | 10405 | if (!empty($show_empty)) { |
10406 | 10406 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10419,19 +10419,19 @@ discard block |
||
10419 | 10419 | $disabled = 0; |
10420 | 10420 | if (!empty($obj->suspended)) { |
10421 | 10421 | $disabled = 1; |
10422 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
10422 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
10423 | 10423 | } |
10424 | 10424 | |
10425 | 10425 | |
10426 | 10426 | if (!empty($selected) && $selected == $obj->rowid) { |
10427 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
10427 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
10428 | 10428 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
10429 | - $out .= '>' . $labeltoshow . '</option>'; |
|
10429 | + $out .= '>'.$labeltoshow.'</option>'; |
|
10430 | 10430 | } else { |
10431 | 10431 | if ($disabled && ($selected != $obj->rowid)) { |
10432 | 10432 | $resultat = ''; |
10433 | 10433 | } else { |
10434 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
10434 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
10435 | 10435 | if ($disabled) { |
10436 | 10436 | $resultat .= ' disabled'; |
10437 | 10437 | } |
@@ -10471,14 +10471,14 @@ discard block |
||
10471 | 10471 | global $langs; |
10472 | 10472 | |
10473 | 10473 | if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) { // If $search_component_params_hidden does not start and end with () |
10474 | - $search_component_params_hidden = '(' . $search_component_params_hidden . ')'; |
|
10474 | + $search_component_params_hidden = '('.$search_component_params_hidden.')'; |
|
10475 | 10475 | } |
10476 | 10476 | |
10477 | 10477 | $ret = ''; |
10478 | 10478 | |
10479 | 10479 | $ret .= '<div class="divadvancedsearchfieldcomp inline-block">'; |
10480 | 10480 | $ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">'; |
10481 | - $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>'; |
|
10481 | + $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>'; |
|
10482 | 10482 | $ret .= '</a>'; |
10483 | 10483 | |
10484 | 10484 | $ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">'; |
@@ -10504,13 +10504,13 @@ discard block |
||
10504 | 10504 | } |
10505 | 10505 | |
10506 | 10506 | if ($countparenthesis == 0) { |
10507 | - $char2 = dol_substr($search_component_params_hidden, $i+1, 1); |
|
10508 | - $char3 = dol_substr($search_component_params_hidden, $i+2, 1); |
|
10507 | + $char2 = dol_substr($search_component_params_hidden, $i + 1, 1); |
|
10508 | + $char3 = dol_substr($search_component_params_hidden, $i + 2, 1); |
|
10509 | 10509 | if ($char == 'A' && $char2 == 'N' && $char3 == 'D') { |
10510 | 10510 | // We found a AND |
10511 | 10511 | $arrayofandtags[] = trim($s); |
10512 | 10512 | $s = ''; |
10513 | - $i+=2; |
|
10513 | + $i += 2; |
|
10514 | 10514 | } else { |
10515 | 10515 | $s .= $char; |
10516 | 10516 | } |
@@ -10534,8 +10534,8 @@ discard block |
||
10534 | 10534 | include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
10535 | 10535 | $searchtags = removeGlobalParenthesis($searchtags); |
10536 | 10536 | |
10537 | - $ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey+1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">'; |
|
10538 | - $ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey+1).'">x</span> '; |
|
10537 | + $ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey + 1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">'; |
|
10538 | + $ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey + 1).'">x</span> '; |
|
10539 | 10539 | $ret .= dol_escape_htmltag($searchtags); |
10540 | 10540 | $ret .= '</span>'; |
10541 | 10541 | } |
@@ -10552,29 +10552,29 @@ discard block |
||
10552 | 10552 | $ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">'; |
10553 | 10553 | } |
10554 | 10554 | $ret .= "<!-- We store the full Universal Search String into this field. For example: (t.ref:like:'SO-%') AND ((t.ref:like:'CO-%') OR (t.ref:like:'AA%')) -->"; |
10555 | - $ret .= '<input type="hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">'; |
|
10555 | + $ret .= '<input type="hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">'; |
|
10556 | 10556 | // $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->"; |
10557 | 10557 | |
10558 | 10558 | // For compatibility with forms that show themself the search criteria in addition of this component, we output these fields |
10559 | 10559 | foreach ($arrayofcriterias as $criterias) { |
10560 | 10560 | foreach ($criterias as $criteriafamilykey => $criteriafamilyval) { |
10561 | - if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
10561 | + if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
10562 | 10562 | continue; |
10563 | 10563 | } |
10564 | 10564 | if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) { |
10565 | 10565 | continue; |
10566 | 10566 | } |
10567 | 10567 | if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) { |
10568 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">'; |
|
10569 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">'; |
|
10570 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">'; |
|
10571 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">'; |
|
10572 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">'; |
|
10573 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">'; |
|
10574 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">'; |
|
10575 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">'; |
|
10568 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">'; |
|
10569 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">'; |
|
10570 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">'; |
|
10571 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">'; |
|
10572 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">'; |
|
10573 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">'; |
|
10574 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">'; |
|
10575 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">'; |
|
10576 | 10576 | } else { |
10577 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">'; |
|
10577 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">'; |
|
10578 | 10578 | } |
10579 | 10579 | } |
10580 | 10580 | } |
@@ -10582,7 +10582,7 @@ discard block |
||
10582 | 10582 | $ret .= '</div>'; |
10583 | 10583 | |
10584 | 10584 | $ret .= "<!-- Field to enter a generic filter string: t.ref:like:'SO-%', t.date_creation:<:'20160101', t.date_creation:<:'2016-01-01 12:30:00', t.nature:is:NULL, t.field2:isnot:NULL -->\n"; |
10585 | - $ret .= '<input type="text" placeholder="' . $langs->trans("Search") . '" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
10585 | + $ret .= '<input type="text" placeholder="'.$langs->trans("Search").'" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
10586 | 10586 | |
10587 | 10587 | $ret .= '</div>'; |
10588 | 10588 | $ret .= '</div>'; |
@@ -10618,7 +10618,7 @@ discard block |
||
10618 | 10618 | |
10619 | 10619 | $TModels = array(); |
10620 | 10620 | |
10621 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
10621 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
10622 | 10622 | $formmail = new FormMail($this->db); |
10623 | 10623 | $result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs); |
10624 | 10624 | |
@@ -10631,17 +10631,17 @@ discard block |
||
10631 | 10631 | } |
10632 | 10632 | } |
10633 | 10633 | |
10634 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">'; |
|
10634 | + $retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">'; |
|
10635 | 10635 | |
10636 | 10636 | foreach ($TModels as $id_model => $label_model) { |
10637 | - $retstring .= '<option value="' . $id_model . '"'; |
|
10638 | - $retstring .= ">" . $label_model . "</option>"; |
|
10637 | + $retstring .= '<option value="'.$id_model.'"'; |
|
10638 | + $retstring .= ">".$label_model."</option>"; |
|
10639 | 10639 | } |
10640 | 10640 | |
10641 | 10641 | $retstring .= "</select>"; |
10642 | 10642 | |
10643 | 10643 | if ($addjscombo) { |
10644 | - $retstring .= ajax_combobox('select_' . $prefix . 'model_mail'); |
|
10644 | + $retstring .= ajax_combobox('select_'.$prefix.'model_mail'); |
|
10645 | 10645 | } |
10646 | 10646 | |
10647 | 10647 | return $retstring; |
@@ -10692,16 +10692,16 @@ discard block |
||
10692 | 10692 | |
10693 | 10693 | foreach ($buttons as $button) { |
10694 | 10694 | $addclass = empty($button['addclass']) ? '' : $button['addclass']; |
10695 | - $retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">'; |
|
10695 | + $retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">'; |
|
10696 | 10696 | } |
10697 | 10697 | $retstring .= $withoutdiv ? '' : '</div>'; |
10698 | 10698 | |
10699 | 10699 | if ($dol_openinpopup) { |
10700 | - $retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n"; |
|
10701 | - $retstring .= '<script nonce="' . getNonce() . '">'; |
|
10700 | + $retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n"; |
|
10701 | + $retstring .= '<script nonce="'.getNonce().'">'; |
|
10702 | 10702 | $retstring .= 'jQuery(".button-cancel").click(function(e) { |
10703 | - e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\'); |
|
10704 | - window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\'); |
|
10703 | + e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\'); |
|
10704 | + window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\'); |
|
10705 | 10705 | });'; |
10706 | 10706 | $retstring .= '</script>'; |
10707 | 10707 | } |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | $num = $this->db->num_rows($resql); |
235 | 235 | |
236 | 236 | if (empty($conf->partnership->enabled)) { |
237 | - $num = 0; // Force empty list if category module is not enabled |
|
237 | + $num = 0; // Force empty list if category module is not enabled |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | if ($num) { |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | // filter_status_thirdparties |
260 | 260 | include_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; |
261 | 261 | $tmppartnership = new Partnership($this->db); |
262 | - $dummy = $tmppartnership->getLibStatut(0); // We call this only to have $tmppartnership->labelStatus loaded |
|
262 | + $dummy = $tmppartnership->getLibStatut(0); // We call this only to have $tmppartnership->labelStatus loaded |
|
263 | 263 | |
264 | 264 | $s .= $form->selectarray('filter_status_partnership', $tmppartnership->labelStatus, GETPOST('filter_status_partnership'), $langs->trans("Status")); |
265 | 265 |
@@ -30,14 +30,14 @@ discard block |
||
30 | 30 | |
31 | 31 | // Load Dolibarr environment |
32 | 32 | require '../../main.inc.php'; |
33 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
34 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; |
|
35 | -require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
37 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
38 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
|
39 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
40 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
38 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
39 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
40 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php'; |
|
41 | 41 | |
42 | 42 | // Load translation files required by the page |
43 | 43 | $langsLoad = array('projects', 'bills', 'orders', 'companies'); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
165 | 165 | } |
166 | 166 | |
167 | -include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
167 | +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
|
168 | 168 | |
169 | 169 | // Purge search criteria |
170 | 170 | if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers |
@@ -354,10 +354,10 @@ discard block |
||
354 | 354 | } |
355 | 355 | |
356 | 356 | if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) { |
357 | - $object->fetchTimeSpent(GETPOST('lineid', 'int')); // load properties like $object->timespent_xxx |
|
357 | + $object->fetchTimeSpent(GETPOST('lineid', 'int')); // load properties like $object->timespent_xxx |
|
358 | 358 | |
359 | 359 | if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
360 | - $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
360 | + $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
361 | 361 | |
362 | 362 | if ($result < 0) { |
363 | 363 | $langs->load("errors"); |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | if (count($tasksarray) > 0) { |
378 | 378 | $id = $tasksarray[0]->id; |
379 | 379 | } else { |
380 | - header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode)); |
|
380 | + header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); |
|
381 | 381 | exit; |
382 | 382 | } |
383 | 383 | } |
@@ -414,9 +414,9 @@ discard block |
||
414 | 414 | if (!($projectstatic->thirdparty->id > 0)) { |
415 | 415 | setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors'); |
416 | 416 | } else { |
417 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
418 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
419 | - include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
417 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
418 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
419 | + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
420 | 420 | |
421 | 421 | $tmpinvoice = new Facture($db); |
422 | 422 | $tmptimespent = new Task($db); |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | $arrayoftasks = array(); |
482 | 482 | foreach ($toselect as $key => $value) { |
483 | 483 | // Get userid, timepent |
484 | - $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
484 | + $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
485 | 485 | $arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
486 | 486 | $arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
487 | 487 | } |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | } |
554 | 554 | |
555 | 555 | // Add lines |
556 | - $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0)); |
|
556 | + $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0)); |
|
557 | 557 | if ($lineid < 0) { |
558 | 558 | $error++; |
559 | 559 | setEventMessages(null, $tmpinvoice->errors, 'errors'); |
@@ -586,16 +586,16 @@ discard block |
||
586 | 586 | |
587 | 587 | $arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration; |
588 | 588 | $arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm; |
589 | - $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username; |
|
589 | + $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username; |
|
590 | 590 | $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note); |
591 | 591 | |
592 | 592 | if (!empty($withdetail)) { |
593 | 593 | if (!empty($object->timespent_withhour)) { |
594 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour)); |
|
594 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour)); |
|
595 | 595 | } else { |
596 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date)); |
|
596 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date)); |
|
597 | 597 | } |
598 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration") . ': ' . convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY)); |
|
598 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration").': '.convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY)); |
|
599 | 599 | } |
600 | 600 | $arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user; |
601 | 601 | $arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product; |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | $arrayoftasks = array(); |
674 | 674 | foreach ($toselect as $key => $value) { |
675 | 675 | // Get userid, timepent |
676 | - $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object) |
|
676 | + $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object) |
|
677 | 677 | // $object->id is now the task id |
678 | 678 | $arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
679 | 679 | $arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | // Add lines |
750 | 750 | $date_start = ''; |
751 | 751 | $date_end = ''; |
752 | - $lineName = $ftask->ref . ' - ' . $ftask->label; |
|
752 | + $lineName = $ftask->ref.' - '.$ftask->label; |
|
753 | 753 | $lineid = $tmpinvoice->addline($lineName, $pu_ht_for_task, price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1, -1, 0, '', 0, 0, null, $pa_ht); |
754 | 754 | if ($lineid < 0) { |
755 | 755 | $error++; |
@@ -759,8 +759,8 @@ discard block |
||
759 | 759 | |
760 | 760 | if (!$error) { |
761 | 761 | // Update lineid into line of timespent |
762 | - $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id); |
|
763 | - $sql .= ' WHERE rowid IN (' . $db->sanitize(join(',', $toselect)) . ')'; |
|
762 | + $sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id); |
|
763 | + $sql .= ' WHERE rowid IN ('.$db->sanitize(join(',', $toselect)).')'; |
|
764 | 764 | $result = $db->query($sql); |
765 | 765 | if (!$result) { |
766 | 766 | $error++; |
@@ -796,12 +796,12 @@ discard block |
||
796 | 796 | if (!($projectstatic->thirdparty->id > 0)) { |
797 | 797 | setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors'); |
798 | 798 | } else { |
799 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
800 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
801 | - include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
799 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
800 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
801 | + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
802 | 802 | |
803 | 803 | |
804 | - require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php'; |
|
804 | + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; |
|
805 | 805 | $tmpinter = new Fichinter($db); |
806 | 806 | $tmptimespent = new Task($db); |
807 | 807 | $fuser = new User($db); |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | $tmpinter->socid = $projectstatic->thirdparty->id; |
814 | 814 | $tmpinter->date = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); |
815 | 815 | $tmpinter->fk_project = $projectstatic->id; |
816 | - $tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : ''); |
|
816 | + $tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : ''); |
|
817 | 817 | |
818 | 818 | if ($interToUse) { |
819 | 819 | $tmpinter->fetch($interToUse); |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | $qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); |
847 | 847 | |
848 | 848 | // Add lines |
849 | - $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), $value['date'], $value['timespent']); |
|
849 | + $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), $value['date'], $value['timespent']); |
|
850 | 850 | } |
851 | 851 | } |
852 | 852 | |
@@ -877,9 +877,9 @@ discard block |
||
877 | 877 | //$result = $projectstatic->fetch($object->fk_project); |
878 | 878 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
879 | 879 | |
880 | -$title = $object->ref . ' - ' . $langs->trans("TimeSpent"); |
|
880 | +$title = $object->ref.' - '.$langs->trans("TimeSpent"); |
|
881 | 881 | if (!empty($withproject)) { |
882 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : ''); |
|
882 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
883 | 883 | } |
884 | 884 | $help_url = ''; |
885 | 885 | |
@@ -928,13 +928,13 @@ discard block |
||
928 | 928 | |
929 | 929 | $param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : ''); |
930 | 930 | if ($search_user) { |
931 | - $param .= '&search_user=' . ((int) $search_user); |
|
931 | + $param .= '&search_user='.((int) $search_user); |
|
932 | 932 | } |
933 | 933 | if ($search_month) { |
934 | - $param .= '&search_month=' . ((int) $search_month); |
|
934 | + $param .= '&search_month='.((int) $search_month); |
|
935 | 935 | } |
936 | 936 | if ($search_year) { |
937 | - $param .= '&search_year=' . ((int) $search_year); |
|
937 | + $param .= '&search_year='.((int) $search_year); |
|
938 | 938 | } |
939 | 939 | |
940 | 940 | // Project card |
@@ -946,14 +946,14 @@ discard block |
||
946 | 946 | $morehtmlref .= $projectstatic->title; |
947 | 947 | // Thirdparty |
948 | 948 | if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { |
949 | - $morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
949 | + $morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
950 | 950 | } |
951 | 951 | $morehtmlref .= '</div>'; |
952 | 952 | |
953 | 953 | // Define a complementary filter for search of next/prev ref. |
954 | 954 | if (empty($user->rights->projet->all->lire)) { |
955 | 955 | $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); |
956 | - $projectstatic->next_prev_filter = "rowid IN (" . $db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0') . ")"; |
|
956 | + $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")"; |
|
957 | 957 | } |
958 | 958 | |
959 | 959 | dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); |
@@ -971,25 +971,25 @@ discard block |
||
971 | 971 | print '</td>'; |
972 | 972 | print '<td>'; |
973 | 973 | if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { |
974 | - print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> '; |
|
974 | + print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> '; |
|
975 | 975 | $htmltext = $langs->trans("ProjectFollowOpportunity"); |
976 | 976 | print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); |
977 | 977 | print '<br>'; |
978 | 978 | } |
979 | 979 | if (empty($conf->global->PROJECT_HIDE_TASKS)) { |
980 | - print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> '; |
|
980 | + print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> '; |
|
981 | 981 | $htmltext = $langs->trans("ProjectFollowTasks"); |
982 | 982 | print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); |
983 | 983 | print '<br>'; |
984 | 984 | } |
985 | 985 | if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { |
986 | - print '<input type="checkbox" disabled name="usage_bill_time"' . (GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')) . '"> '; |
|
986 | + print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')).'"> '; |
|
987 | 987 | $htmltext = $langs->trans("ProjectBillTimeDescription"); |
988 | 988 | print $form->textwithpicto($langs->trans("BillTime"), $htmltext); |
989 | 989 | print '<br>'; |
990 | 990 | } |
991 | 991 | if (isModEnabled('eventorganization')) { |
992 | - print '<input type="checkbox" disabled name="usage_organize_event"' . (GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')) . '"> '; |
|
992 | + print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> '; |
|
993 | 993 | $htmltext = $langs->trans("EventOrganizationDescriptionLong"); |
994 | 994 | print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); |
995 | 995 | } |
@@ -997,7 +997,7 @@ discard block |
||
997 | 997 | } |
998 | 998 | |
999 | 999 | // Visibility |
1000 | - print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>'; |
|
1000 | + print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>'; |
|
1001 | 1001 | if ($projectstatic->public) { |
1002 | 1002 | print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); |
1003 | 1003 | print $langs->trans('SharedProject'); |
@@ -1008,14 +1008,14 @@ discard block |
||
1008 | 1008 | print '</td></tr>'; |
1009 | 1009 | |
1010 | 1010 | // Budget |
1011 | - print '<tr><td>' . $langs->trans("Budget") . '</td><td>'; |
|
1011 | + print '<tr><td>'.$langs->trans("Budget").'</td><td>'; |
|
1012 | 1012 | if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { |
1013 | - print '<span class="amount">' . price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency) . '</span>'; |
|
1013 | + print '<span class="amount">'.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).'</span>'; |
|
1014 | 1014 | } |
1015 | 1015 | print '</td></tr>'; |
1016 | 1016 | |
1017 | 1017 | // Date start - end project |
1018 | - print '<tr><td>' . $langs->trans("Dates") . '</td><td>'; |
|
1018 | + print '<tr><td>'.$langs->trans("Dates").'</td><td>'; |
|
1019 | 1019 | $start = dol_print_date($projectstatic->date_start, 'day'); |
1020 | 1020 | print ($start ? $start : '?'); |
1021 | 1021 | $end = dol_print_date($projectstatic->date_end, 'day'); |
@@ -1030,7 +1030,7 @@ discard block |
||
1030 | 1030 | $cols = 2; |
1031 | 1031 | $savobject = $object; |
1032 | 1032 | $object = $projectstatic; |
1033 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
1033 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
1034 | 1034 | $object = $savobject; |
1035 | 1035 | |
1036 | 1036 | print '</table>'; |
@@ -1048,7 +1048,7 @@ discard block |
||
1048 | 1048 | |
1049 | 1049 | // Categories |
1050 | 1050 | if (isModEnabled('categorie')) { |
1051 | - print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>'; |
|
1051 | + print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; |
|
1052 | 1052 | print $form->showCategories($projectstatic->id, 'project', 1); |
1053 | 1053 | print "</td></tr>"; |
1054 | 1054 | } |
@@ -1077,12 +1077,12 @@ discard block |
||
1077 | 1077 | |
1078 | 1078 | if (!empty($projectidforalltimes)) { |
1079 | 1079 | // We are on tab 'Time Spent' of project |
1080 | - $backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : ''); |
|
1081 | - $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
1080 | + $backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : ''); |
|
1081 | + $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
1082 | 1082 | } else { |
1083 | 1083 | // We are on tab 'Time Spent' of task |
1084 | - $backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : ''); |
|
1085 | - $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
1084 | + $backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : ''); |
|
1085 | + $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
1086 | 1086 | } |
1087 | 1087 | } else { |
1088 | 1088 | $linktocreatetimeBtnStatus = -2; |
@@ -1127,19 +1127,19 @@ discard block |
||
1127 | 1127 | print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); |
1128 | 1128 | |
1129 | 1129 | if ($action == 'deleteline') { |
1130 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOST("lineid", 'int') . ($withproject ? '&withproject=1' : ''); |
|
1130 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOST("lineid", 'int').($withproject ? '&withproject=1' : ''); |
|
1131 | 1131 | print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
1132 | 1132 | } |
1133 | 1133 | |
1134 | 1134 | $param = ($withproject ? '&withproject=1' : ''); |
1135 | - $param .= ($param ? '&' : '') . 'id=' . $object->id; // ID of task |
|
1136 | - $linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : ''; |
|
1135 | + $param .= ($param ? '&' : '').'id='.$object->id; // ID of task |
|
1136 | + $linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : ''; |
|
1137 | 1137 | |
1138 | 1138 | if (!GETPOST('withproject') || empty($projectstatic->id)) { |
1139 | 1139 | $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); |
1140 | - $object->next_prev_filter = "fk_projet IN (" . $db->sanitize($projectsListId) . ")"; |
|
1140 | + $object->next_prev_filter = "fk_projet IN (".$db->sanitize($projectsListId).")"; |
|
1141 | 1141 | } else { |
1142 | - $object->next_prev_filter = "fk_projet = " . ((int) $projectstatic->id); |
|
1142 | + $object->next_prev_filter = "fk_projet = ".((int) $projectstatic->id); |
|
1143 | 1143 | } |
1144 | 1144 | |
1145 | 1145 | $morehtmlref = ''; |
@@ -1147,12 +1147,12 @@ discard block |
||
1147 | 1147 | // Project |
1148 | 1148 | if (empty($withproject)) { |
1149 | 1149 | $morehtmlref .= '<div class="refidno">'; |
1150 | - $morehtmlref .= $langs->trans("Project") . ': '; |
|
1150 | + $morehtmlref .= $langs->trans("Project").': '; |
|
1151 | 1151 | $morehtmlref .= $projectstatic->getNomUrl(1); |
1152 | 1152 | $morehtmlref .= '<br>'; |
1153 | 1153 | |
1154 | 1154 | // Third party |
1155 | - $morehtmlref .= $langs->trans("ThirdParty") . ': '; |
|
1155 | + $morehtmlref .= $langs->trans("ThirdParty").': '; |
|
1156 | 1156 | if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) { |
1157 | 1157 | $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); |
1158 | 1158 | } |
@@ -1168,7 +1168,7 @@ discard block |
||
1168 | 1168 | print '<table class="border centpercent tableforfield">'; |
1169 | 1169 | |
1170 | 1170 | // Task parent |
1171 | - print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>'; |
|
1171 | + print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>'; |
|
1172 | 1172 | if ($object->fk_task_parent > 0) { |
1173 | 1173 | $tasktmp = new Task($db); |
1174 | 1174 | $tasktmp->fetch($object->fk_task_parent); |
@@ -1177,7 +1177,7 @@ discard block |
||
1177 | 1177 | print '</td></tr>'; |
1178 | 1178 | |
1179 | 1179 | // Date start - Date end task |
1180 | - print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>'; |
|
1180 | + print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>'; |
|
1181 | 1181 | $start = dol_print_date($object->date_start, 'dayhour'); |
1182 | 1182 | print ($start ? $start : '?'); |
1183 | 1183 | $end = dol_print_date($object->date_end, 'dayhour'); |
@@ -1189,7 +1189,7 @@ discard block |
||
1189 | 1189 | print '</td></tr>'; |
1190 | 1190 | |
1191 | 1191 | // Planned workload |
1192 | - print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>'; |
|
1192 | + print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>'; |
|
1193 | 1193 | if ($object->planned_workload) { |
1194 | 1194 | print convertSecondToTime($object->planned_workload, 'allhourmin'); |
1195 | 1195 | } |
@@ -1204,21 +1204,21 @@ discard block |
||
1204 | 1204 | print '<table class="border tableforfield centpercent">'; |
1205 | 1205 | |
1206 | 1206 | // Progress declared |
1207 | - print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>'; |
|
1208 | - print $object->progress != '' ? $object->progress . ' %' : ''; |
|
1207 | + print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>'; |
|
1208 | + print $object->progress != '' ? $object->progress.' %' : ''; |
|
1209 | 1209 | print '</td></tr>'; |
1210 | 1210 | |
1211 | 1211 | // Progress calculated |
1212 | - print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>'; |
|
1212 | + print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>'; |
|
1213 | 1213 | if ($object->planned_workload) { |
1214 | 1214 | $tmparray = $object->getSummaryOfTimeSpent(); |
1215 | 1215 | if ($tmparray['total_duration'] > 0) { |
1216 | - print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %'; |
|
1216 | + print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %'; |
|
1217 | 1217 | } else { |
1218 | 1218 | print '0 %'; |
1219 | 1219 | } |
1220 | 1220 | } else { |
1221 | - print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>'; |
|
1221 | + print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>'; |
|
1222 | 1222 | } |
1223 | 1223 | print '</td>'; |
1224 | 1224 | |
@@ -1234,7 +1234,7 @@ discard block |
||
1234 | 1234 | print dol_get_fiche_end(); |
1235 | 1235 | } else { |
1236 | 1236 | if ($action == 'deleteline') { |
1237 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOST("lineid", 'int') . ($withproject ? '&withproject=1' : ''); |
|
1237 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOST("lineid", 'int').($withproject ? '&withproject=1' : ''); |
|
1238 | 1238 | print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
1239 | 1239 | } |
1240 | 1240 | } |
@@ -1248,7 +1248,7 @@ discard block |
||
1248 | 1248 | |
1249 | 1249 | if ($action == 'deleteline' && !empty($projectidforalltimes)) { |
1250 | 1250 | // We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task |
1251 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOST('lineid', 'int') . ($withproject ? '&withproject=1' : '') . "&contextpage=" . urlencode($contextpage); |
|
1251 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($projectstatic->id > 0 ? 'projectid='.$projectstatic->id : ($object->id > 0 ? "id=".$object->id : '')).'&lineid='.GETPOST('lineid', 'int').($withproject ? '&withproject=1' : '')."&contextpage=".urlencode($contextpage); |
|
1252 | 1252 | $formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
1253 | 1253 | } |
1254 | 1254 | |
@@ -1267,10 +1267,10 @@ discard block |
||
1267 | 1267 | // Definition of fields for list |
1268 | 1268 | $arrayfields = array(); |
1269 | 1269 | $arrayfields['t.element_date'] = array('label'=>$langs->trans("Date"), 'checked'=>1); |
1270 | - $arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1','checked'=>1); |
|
1270 | + $arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1', 'checked'=>1); |
|
1271 | 1271 | $arrayfields['s.name_alias'] = array('label'=>$langs->trans("AliasNameShort"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1'); |
1272 | 1272 | if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task |
1273 | - if (! empty($allprojectforuser)) { |
|
1273 | + if (!empty($allprojectforuser)) { |
|
1274 | 1274 | $arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1]; |
1275 | 1275 | $arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1]; |
1276 | 1276 | } |
@@ -1286,82 +1286,82 @@ discard block |
||
1286 | 1286 | $arrayfields['value'] = array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>isModEnabled("salaries")); |
1287 | 1287 | $arrayfields['valuebilled'] = array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>(((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time)); |
1288 | 1288 | // Extra fields |
1289 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
1289 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
1290 | 1290 | |
1291 | 1291 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
1292 | 1292 | |
1293 | 1293 | $param = ''; |
1294 | 1294 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
1295 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
1295 | + $param .= '&contextpage='.urlencode($contextpage); |
|
1296 | 1296 | } |
1297 | 1297 | if ($limit > 0 && $limit != $conf->liste_limit) { |
1298 | 1298 | $param .= '&limit='.((int) $limit); |
1299 | 1299 | } |
1300 | 1300 | if ($search_month > 0) { |
1301 | - $param .= '&search_month=' . urlencode($search_month); |
|
1301 | + $param .= '&search_month='.urlencode($search_month); |
|
1302 | 1302 | } |
1303 | 1303 | if ($search_year > 0) { |
1304 | - $param .= '&search_year=' . urlencode($search_year); |
|
1304 | + $param .= '&search_year='.urlencode($search_year); |
|
1305 | 1305 | } |
1306 | 1306 | if (!empty($search_user)) { // We keep param if -1 because default value is forced to user id if not set |
1307 | 1307 | $param .= '&search_user='.urlencode($search_user); |
1308 | 1308 | } |
1309 | 1309 | if ($search_task_ref != '') { |
1310 | - $param .= '&search_task_ref=' . urlencode($search_task_ref); |
|
1310 | + $param .= '&search_task_ref='.urlencode($search_task_ref); |
|
1311 | 1311 | } |
1312 | 1312 | if ($search_company != '') { |
1313 | - $param .= '&$search_company=' . urlencode($search_company); |
|
1313 | + $param .= '&$search_company='.urlencode($search_company); |
|
1314 | 1314 | } |
1315 | 1315 | if ($search_company_alias != '') { |
1316 | - $param .= '&$search_company_alias=' . urlencode($search_company_alias); |
|
1316 | + $param .= '&$search_company_alias='.urlencode($search_company_alias); |
|
1317 | 1317 | } |
1318 | 1318 | if ($search_project_ref != '') { |
1319 | - $param .= '&$search_project_ref=' . urlencode($search_project_ref); |
|
1319 | + $param .= '&$search_project_ref='.urlencode($search_project_ref); |
|
1320 | 1320 | } |
1321 | 1321 | if ($search_project_label != '') { |
1322 | - $param .= '&$search_project_label=' . urlencode($search_project_label); |
|
1322 | + $param .= '&$search_project_label='.urlencode($search_project_label); |
|
1323 | 1323 | } |
1324 | 1324 | if ($search_task_label != '') { |
1325 | - $param .= '&search_task_label=' . urlencode($search_task_label); |
|
1325 | + $param .= '&search_task_label='.urlencode($search_task_label); |
|
1326 | 1326 | } |
1327 | 1327 | if ($search_note != '') { |
1328 | - $param .= '&search_note=' . urlencode($search_note); |
|
1328 | + $param .= '&search_note='.urlencode($search_note); |
|
1329 | 1329 | } |
1330 | 1330 | if ($search_duration != '') { |
1331 | - $param .= '&search_field2=' . urlencode($search_duration); |
|
1331 | + $param .= '&search_field2='.urlencode($search_duration); |
|
1332 | 1332 | } |
1333 | 1333 | if ($optioncss != '') { |
1334 | - $param .= '&optioncss=' . urlencode($optioncss); |
|
1334 | + $param .= '&optioncss='.urlencode($optioncss); |
|
1335 | 1335 | } |
1336 | 1336 | if ($search_date_startday) { |
1337 | - $param .= '&search_date_startday=' . urlencode($search_date_startday); |
|
1337 | + $param .= '&search_date_startday='.urlencode($search_date_startday); |
|
1338 | 1338 | } |
1339 | 1339 | if ($search_date_startmonth) { |
1340 | - $param .= '&search_date_startmonth=' . urlencode($search_date_startmonth); |
|
1340 | + $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); |
|
1341 | 1341 | } |
1342 | 1342 | if ($search_date_startyear) { |
1343 | - $param .= '&search_date_startyear=' . urlencode($search_date_startyear); |
|
1343 | + $param .= '&search_date_startyear='.urlencode($search_date_startyear); |
|
1344 | 1344 | } |
1345 | 1345 | if ($search_date_endday) { |
1346 | - $param .= '&search_date_endday=' . urlencode($search_date_endday); |
|
1346 | + $param .= '&search_date_endday='.urlencode($search_date_endday); |
|
1347 | 1347 | } |
1348 | 1348 | if ($search_date_endmonth) { |
1349 | - $param .= '&search_date_endmonth=' . urlencode($search_date_endmonth); |
|
1349 | + $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); |
|
1350 | 1350 | } |
1351 | 1351 | if ($search_date_endyear) { |
1352 | - $param .= '&search_date_endyear=' . urlencode($search_date_endyear); |
|
1352 | + $param .= '&search_date_endyear='.urlencode($search_date_endyear); |
|
1353 | 1353 | } |
1354 | 1354 | if ($search_timespent_starthour) { |
1355 | - $param .= '&search_timespent_duration_starthour=' . urlencode($search_timespent_starthour); |
|
1355 | + $param .= '&search_timespent_duration_starthour='.urlencode($search_timespent_starthour); |
|
1356 | 1356 | } |
1357 | 1357 | if ($search_timespent_startmin) { |
1358 | - $param .= '&search_timespent_duration_startmin=' . urlencode($search_timespent_startmin); |
|
1358 | + $param .= '&search_timespent_duration_startmin='.urlencode($search_timespent_startmin); |
|
1359 | 1359 | } |
1360 | 1360 | if ($search_timespent_endhour) { |
1361 | - $param .= '&search_timespent_duration_endhour=' . urlencode($search_timespent_endhour); |
|
1361 | + $param .= '&search_timespent_duration_endhour='.urlencode($search_timespent_endhour); |
|
1362 | 1362 | } |
1363 | 1363 | if ($search_timespent_endmin) { |
1364 | - $param .= '&search_timespent_duration_endmin=' . urlencode($search_timespent_endmin); |
|
1364 | + $param .= '&search_timespent_duration_endmin='.urlencode($search_timespent_endmin); |
|
1365 | 1365 | } |
1366 | 1366 | |
1367 | 1367 | /* |
@@ -1369,24 +1369,24 @@ discard block |
||
1369 | 1369 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
1370 | 1370 | */ |
1371 | 1371 | if ($id) { |
1372 | - $param .= '&id=' . urlencode($id); |
|
1372 | + $param .= '&id='.urlencode($id); |
|
1373 | 1373 | } |
1374 | 1374 | if ($projectid) { |
1375 | - $param .= '&projectid=' . urlencode($projectid); |
|
1375 | + $param .= '&projectid='.urlencode($projectid); |
|
1376 | 1376 | } |
1377 | 1377 | if ($withproject) { |
1378 | - $param .= '&withproject=' . urlencode($withproject); |
|
1378 | + $param .= '&withproject='.urlencode($withproject); |
|
1379 | 1379 | } |
1380 | 1380 | // Add $param from hooks |
1381 | 1381 | $parameters = array(); |
1382 | 1382 | $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook |
1383 | 1383 | $param .= $hookmanager->resPrint; |
1384 | 1384 | |
1385 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
1385 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
1386 | 1386 | if ($optioncss != '') { |
1387 | - print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
1387 | + print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
|
1388 | 1388 | } |
1389 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
1389 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1390 | 1390 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
1391 | 1391 | if ($action == 'editline') { |
1392 | 1392 | print '<input type="hidden" name="action" value="updateline">'; |
@@ -1401,13 +1401,13 @@ discard block |
||
1401 | 1401 | } else { |
1402 | 1402 | print '<input type="hidden" name="action" value="list">'; |
1403 | 1403 | } |
1404 | - print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
1405 | - print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
1404 | + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
1405 | + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
1406 | 1406 | |
1407 | - print '<input type="hidden" name="id" value="' . $id . '">'; |
|
1408 | - print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">'; |
|
1409 | - print '<input type="hidden" name="withproject" value="' . $withproject . '">'; |
|
1410 | - print '<input type="hidden" name="tab" value="' . $tab . '">'; |
|
1407 | + print '<input type="hidden" name="id" value="'.$id.'">'; |
|
1408 | + print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">'; |
|
1409 | + print '<input type="hidden" name="withproject" value="'.$withproject.'">'; |
|
1410 | + print '<input type="hidden" name="tab" value="'.$tab.'">'; |
|
1411 | 1411 | print '<input type="hidden" name="page_y" value="">'; |
1412 | 1412 | |
1413 | 1413 | // Form to convert time spent into invoice |
@@ -1434,7 +1434,7 @@ discard block |
||
1434 | 1434 | 'onelineperperiod' => 'OneLinePerTimeSpentLine', |
1435 | 1435 | ); |
1436 | 1436 | print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1); |
1437 | - print "\n" . '<script type="text/javascript">'; |
|
1437 | + print "\n".'<script type="text/javascript">'; |
|
1438 | 1438 | print ' |
1439 | 1439 | $(document).ready(function () { |
1440 | 1440 | setDetailVisibility(); |
@@ -1451,8 +1451,8 @@ discard block |
||
1451 | 1451 | } |
1452 | 1452 | }); |
1453 | 1453 | '; |
1454 | - print '</script>' . "\n"; |
|
1455 | - print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>'; |
|
1454 | + print '</script>'."\n"; |
|
1455 | + print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>'; |
|
1456 | 1456 | print '</td>'; |
1457 | 1457 | print '</tr>'; |
1458 | 1458 | |
@@ -1487,14 +1487,14 @@ discard block |
||
1487 | 1487 | |
1488 | 1488 | print '<br>'; |
1489 | 1489 | print '<div class="center">'; |
1490 | - print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '"> '; |
|
1491 | - print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
1490 | + print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'"> '; |
|
1491 | + print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
1492 | 1492 | print '</div>'; |
1493 | 1493 | print '<br>'; |
1494 | 1494 | } else { |
1495 | - print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>'; |
|
1495 | + print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>'; |
|
1496 | 1496 | print '<div class="center">'; |
1497 | - print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
1497 | + print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
1498 | 1498 | print '</div>'; |
1499 | 1499 | $massaction = ''; |
1500 | 1500 | } |
@@ -1507,7 +1507,7 @@ discard block |
||
1507 | 1507 | print '<table class="noborder centpercent">'; |
1508 | 1508 | print '<tr>'; |
1509 | 1509 | print '<td class="titlefield">'; |
1510 | - print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse'); |
|
1510 | + print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse'); |
|
1511 | 1511 | print '</td>'; |
1512 | 1512 | print '<td>'; |
1513 | 1513 | $forminter = new FormIntervention($db); |
@@ -1517,14 +1517,14 @@ discard block |
||
1517 | 1517 | print '</table>'; |
1518 | 1518 | |
1519 | 1519 | print '<div class="center">'; |
1520 | - print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '"> '; |
|
1521 | - print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
1520 | + print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'"> '; |
|
1521 | + print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
1522 | 1522 | print '</div>'; |
1523 | 1523 | print '<br>'; |
1524 | 1524 | } else { |
1525 | - print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>'; |
|
1525 | + print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>'; |
|
1526 | 1526 | print '<div class="center">'; |
1527 | - print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
1527 | + print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
1528 | 1528 | print '</div>'; |
1529 | 1529 | $massaction = ''; |
1530 | 1530 | } |
@@ -1585,13 +1585,13 @@ discard block |
||
1585 | 1585 | $sql .= " AND t.fk_element =".((int) $object->id); |
1586 | 1586 | } elseif (!empty($projectidforalltimes)) { |
1587 | 1587 | // Limit on one project |
1588 | - $sql .= " AND pt.fk_projet IN (" . $db->sanitize($projectidforalltimes) . ")"; |
|
1588 | + $sql .= " AND pt.fk_projet IN (".$db->sanitize($projectidforalltimes).")"; |
|
1589 | 1589 | } elseif (!empty($allprojectforuser)) { |
1590 | 1590 | // Limit on on user |
1591 | 1591 | if (empty($search_user)) { |
1592 | 1592 | $search_user = $user->id; |
1593 | 1593 | } |
1594 | - if ($search_user > 0) $sql .= " AND t.fk_user = " . ((int) $search_user); |
|
1594 | + if ($search_user > 0) $sql .= " AND t.fk_user = ".((int) $search_user); |
|
1595 | 1595 | } |
1596 | 1596 | |
1597 | 1597 | if ($search_note) { |
@@ -1643,13 +1643,13 @@ discard block |
||
1643 | 1643 | if ($search_timespent_starthour || $search_timespent_startmin) { |
1644 | 1644 | $timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds |
1645 | 1645 | $timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds |
1646 | - $sql .= " AND t.element_duration >= " . $timespent_duration_start; |
|
1646 | + $sql .= " AND t.element_duration >= ".$timespent_duration_start; |
|
1647 | 1647 | } |
1648 | 1648 | |
1649 | 1649 | if ($search_timespent_endhour || $search_timespent_endmin) { |
1650 | 1650 | $timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds |
1651 | 1651 | $timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds |
1652 | - $sql .= " AND t.element_duration <= " . $timespent_duration_end; |
|
1652 | + $sql .= " AND t.element_duration <= ".$timespent_duration_end; |
|
1653 | 1653 | } |
1654 | 1654 | } |
1655 | 1655 | |
@@ -1697,13 +1697,13 @@ discard block |
||
1697 | 1697 | |
1698 | 1698 | if ($num >= 0) { |
1699 | 1699 | if (!empty($projectidforalltimes)) { |
1700 | - print '<!-- List of time spent for project -->' . "\n"; |
|
1700 | + print '<!-- List of time spent for project -->'."\n"; |
|
1701 | 1701 | |
1702 | 1702 | $title = $langs->trans("ListTaskTimeUserProject"); |
1703 | 1703 | |
1704 | 1704 | print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1); |
1705 | 1705 | } else { |
1706 | - print '<!-- List of time spent -->' . "\n"; |
|
1706 | + print '<!-- List of time spent -->'."\n"; |
|
1707 | 1707 | |
1708 | 1708 | $title = $langs->trans("ListTaskTimeForTask"); |
1709 | 1709 | |
@@ -1725,26 +1725,26 @@ discard block |
||
1725 | 1725 | * Form to add a new line of time spent |
1726 | 1726 | */ |
1727 | 1727 | if ($action == 'createtime' && $user->hasRight('projet', 'time')) { |
1728 | - print '<!-- table to add time spent -->' . "\n"; |
|
1728 | + print '<!-- table to add time spent -->'."\n"; |
|
1729 | 1729 | if (!empty($id)) { |
1730 | - print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
1730 | + print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
1731 | 1731 | } |
1732 | 1732 | |
1733 | 1733 | print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table |
1734 | 1734 | print '<table class="noborder nohover centpercent">'; |
1735 | 1735 | |
1736 | 1736 | print '<tr class="liste_titre">'; |
1737 | - print '<td>' . $langs->trans("Date") . '</td>'; |
|
1737 | + print '<td>'.$langs->trans("Date").'</td>'; |
|
1738 | 1738 | if (!empty($allprojectforuser)) { |
1739 | - print '<td>' . $langs->trans("Project") . '</td>'; |
|
1739 | + print '<td>'.$langs->trans("Project").'</td>'; |
|
1740 | 1740 | } |
1741 | 1741 | if (empty($id)) { |
1742 | - print '<td>' . $langs->trans("Task") . '</td>'; |
|
1742 | + print '<td>'.$langs->trans("Task").'</td>'; |
|
1743 | 1743 | } |
1744 | - print '<td>' . $langs->trans("By") . '</td>'; |
|
1745 | - print '<td>' . $langs->trans("Note") . '</td>'; |
|
1746 | - print '<td>' . $langs->trans("NewTimeSpent") . '</td>'; |
|
1747 | - print '<td>' . $langs->trans("ProgressDeclared") . '</td>'; |
|
1744 | + print '<td>'.$langs->trans("By").'</td>'; |
|
1745 | + print '<td>'.$langs->trans("Note").'</td>'; |
|
1746 | + print '<td>'.$langs->trans("NewTimeSpent").'</td>'; |
|
1747 | + print '<td>'.$langs->trans("ProgressDeclared").'</td>'; |
|
1748 | 1748 | if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { |
1749 | 1749 | print '<td></td>'; |
1750 | 1750 | |
@@ -1798,14 +1798,14 @@ discard block |
||
1798 | 1798 | print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200'); |
1799 | 1799 | } else { |
1800 | 1800 | if ($nboftasks) { |
1801 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
1801 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime'); |
|
1802 | 1802 | } |
1803 | 1803 | } |
1804 | 1804 | print '</td>'; |
1805 | 1805 | |
1806 | 1806 | // Note |
1807 | 1807 | print '<td>'; |
1808 | - print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>'; |
|
1808 | + print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>'; |
|
1809 | 1809 | print '</td>'; |
1810 | 1810 | |
1811 | 1811 | // Duration - Time spent |
@@ -1873,7 +1873,7 @@ discard block |
||
1873 | 1873 | $selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
1874 | 1874 | |
1875 | 1875 | print '<div class="div-table-responsive">'; |
1876 | - print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
|
1876 | + print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; |
|
1877 | 1877 | |
1878 | 1878 | // Fields title search |
1879 | 1879 | // -------------------------------------------------------------------- |
@@ -1898,20 +1898,20 @@ discard block |
||
1898 | 1898 | } |
1899 | 1899 | // Thirdparty |
1900 | 1900 | if (!empty($arrayfields['p.fk_soc']['checked'])) { |
1901 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>'; |
|
1901 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>'; |
|
1902 | 1902 | } |
1903 | 1903 | |
1904 | 1904 | // Thirdparty alias |
1905 | 1905 | if (!empty($arrayfields['s.name_alias']['checked'])) { |
1906 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>'; |
|
1906 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>'; |
|
1907 | 1907 | } |
1908 | 1908 | |
1909 | 1909 | if (!empty($allprojectforuser)) { |
1910 | 1910 | if (!empty($arrayfields['p.project_ref']['checked'])) { |
1911 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>'; |
|
1911 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>'; |
|
1912 | 1912 | } |
1913 | 1913 | if (!empty($arrayfields['p.project_label']['checked'])) { |
1914 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>'; |
|
1914 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>'; |
|
1915 | 1915 | } |
1916 | 1916 | } |
1917 | 1917 | // Task |
@@ -1929,7 +1929,7 @@ discard block |
||
1929 | 1929 | } |
1930 | 1930 | // Note |
1931 | 1931 | if (!empty($arrayfields['t.note']['checked'])) { |
1932 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>'; |
|
1932 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>'; |
|
1933 | 1933 | } |
1934 | 1934 | // Duration |
1935 | 1935 | if (!empty($arrayfields['t.element_duration']['checked'])) { |
@@ -1940,7 +1940,7 @@ discard block |
||
1940 | 1940 | if ($search_timespent_starthour || $search_timespent_startmin) { |
1941 | 1941 | $durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60); |
1942 | 1942 | } |
1943 | - print '<div class="nowraponall">' . $langs->trans('from') . ' '; |
|
1943 | + print '<div class="nowraponall">'.$langs->trans('from').' '; |
|
1944 | 1944 | print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1); |
1945 | 1945 | print '</div>'; |
1946 | 1946 | |
@@ -1948,7 +1948,7 @@ discard block |
||
1948 | 1948 | if ($search_timespent_endhour || $search_timespent_endmin) { |
1949 | 1949 | $durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60); |
1950 | 1950 | } |
1951 | - print '<div class="nowraponall">' . $langs->trans('at') . ' '; |
|
1951 | + print '<div class="nowraponall">'.$langs->trans('at').' '; |
|
1952 | 1952 | print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1); |
1953 | 1953 | print '</div>'; |
1954 | 1954 | |
@@ -1964,7 +1964,7 @@ discard block |
||
1964 | 1964 | } |
1965 | 1965 | // Value billed |
1966 | 1966 | if (!empty($arrayfields['valuebilled']['checked'])) { |
1967 | - print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>'; |
|
1967 | + print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>'; |
|
1968 | 1968 | } |
1969 | 1969 | |
1970 | 1970 | /* |
@@ -1982,7 +1982,7 @@ discard block |
||
1982 | 1982 | print $searchpicto; |
1983 | 1983 | print '</td>'; |
1984 | 1984 | } |
1985 | - print '</tr>' . "\n"; |
|
1985 | + print '</tr>'."\n"; |
|
1986 | 1986 | |
1987 | 1987 | $totalarray = array(); |
1988 | 1988 | $totalarray['nbfield'] = 0; |
@@ -2092,7 +2092,7 @@ discard block |
||
2092 | 2092 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
2093 | 2093 | print '<td class="center nowraponall">'; |
2094 | 2094 | if (($action == 'editline' || $action == 'splitline') && GETPOST('lineid', 'int') == $task_time->rowid) { |
2095 | - print '<input type="hidden" name="lineid" value="' . GETPOST('lineid', 'int') . '">'; |
|
2095 | + print '<input type="hidden" name="lineid" value="'.GETPOST('lineid', 'int').'">'; |
|
2096 | 2096 | print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">'; |
2097 | 2097 | print '<br>'; |
2098 | 2098 | print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
@@ -2100,7 +2100,7 @@ discard block |
||
2100 | 2100 | if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
2101 | 2101 | if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { |
2102 | 2102 | print ' '; |
2103 | - print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">'; |
|
2103 | + print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; |
|
2104 | 2104 | print img_split('', 'class="pictofixedwidth"'); |
2105 | 2105 | print '</a>'; |
2106 | 2106 | } |
@@ -2119,7 +2119,7 @@ discard block |
||
2119 | 2119 | $selected = 1; |
2120 | 2120 | } |
2121 | 2121 | print ' '; |
2122 | - print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
2122 | + print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
2123 | 2123 | } |
2124 | 2124 | } |
2125 | 2125 | } |
@@ -2237,7 +2237,7 @@ discard block |
||
2237 | 2237 | } |
2238 | 2238 | } |
2239 | 2239 | } elseif ($action !== 'createtime') { |
2240 | - print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
2240 | + print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
2241 | 2241 | } |
2242 | 2242 | |
2243 | 2243 | // Task label |
@@ -2267,7 +2267,7 @@ discard block |
||
2267 | 2267 | print img_object('', 'user', 'class="hideonsmartphone"'); |
2268 | 2268 | print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'maxwidth200'); |
2269 | 2269 | } else { |
2270 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2270 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2271 | 2271 | } |
2272 | 2272 | } else { |
2273 | 2273 | $userstatic->id = $task_time->fk_user; |
@@ -2287,7 +2287,7 @@ discard block |
||
2287 | 2287 | if (!empty($arrayfields['t.note']['checked'])) { |
2288 | 2288 | if ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2289 | 2289 | print '<td class="small">'; |
2290 | - print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2290 | + print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2291 | 2291 | print '</td>'; |
2292 | 2292 | } else { |
2293 | 2293 | print '<td class="small tdoverflowmax150 classfortooltip" title="'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($task_time->note)).'">'; |
@@ -2298,7 +2298,7 @@ discard block |
||
2298 | 2298 | $totalarray['nbfield']++; |
2299 | 2299 | } |
2300 | 2300 | } elseif ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2301 | - print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2301 | + print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2302 | 2302 | } |
2303 | 2303 | |
2304 | 2304 | // Time spent |
@@ -2358,7 +2358,7 @@ discard block |
||
2358 | 2358 | $value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1); |
2359 | 2359 | |
2360 | 2360 | print '<td class="nowraponall right">'; |
2361 | - print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">'; |
|
2361 | + print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">'; |
|
2362 | 2362 | print price($value, 1, $langs, 1, -1, -1, $conf->currency); |
2363 | 2363 | print '</span>'; |
2364 | 2364 | print '</td>'; |
@@ -2391,7 +2391,7 @@ discard block |
||
2391 | 2391 | if ($task_time->invoice_id) { |
2392 | 2392 | $result = $tmpinvoice->fetch($task_time->invoice_id); |
2393 | 2393 | if ($result > 0) { |
2394 | - if ($action=='editline' && $_GET['lineid'] == $task_time->rowid) { |
|
2394 | + if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { |
|
2395 | 2395 | print $formproject->selectInvoiceAndLine($task_time->invoice_id, $task_time->invoice_line_id, 'invoiceid', 'invoicelineid', 'maxwidth500', array('p.rowid'=>$projectstatic->id)); |
2396 | 2396 | } else { |
2397 | 2397 | print $tmpinvoice->getNomUrl(1); |
@@ -2409,7 +2409,7 @@ discard block |
||
2409 | 2409 | print $langs->trans("No"); |
2410 | 2410 | } |
2411 | 2411 | } else { |
2412 | - print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>'; |
|
2412 | + print '<span class="opacitymedium">'.$langs->trans("NA").'</span>'; |
|
2413 | 2413 | } |
2414 | 2414 | } |
2415 | 2415 | print '</td>'; |
@@ -2440,7 +2440,7 @@ discard block |
||
2440 | 2440 | if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
2441 | 2441 | if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { |
2442 | 2442 | print ' '; |
2443 | - print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">'; |
|
2443 | + print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; |
|
2444 | 2444 | print img_split('', 'class="pictofixedwidth"'); |
2445 | 2445 | print '</a>'; |
2446 | 2446 | } |
@@ -2459,7 +2459,7 @@ discard block |
||
2459 | 2459 | $selected = 1; |
2460 | 2460 | } |
2461 | 2461 | print ' '; |
2462 | - print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
2462 | + print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
2463 | 2463 | } |
2464 | 2464 | } |
2465 | 2465 | } |
@@ -2549,7 +2549,7 @@ discard block |
||
2549 | 2549 | print img_object('', 'user', 'class="hideonsmartphone"'); |
2550 | 2550 | print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask); |
2551 | 2551 | } else { |
2552 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2552 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2553 | 2553 | } |
2554 | 2554 | } else { |
2555 | 2555 | $userstatic->id = $task_time->fk_user; |
@@ -2566,13 +2566,13 @@ discard block |
||
2566 | 2566 | if (!empty($arrayfields['t.note']['checked'])) { |
2567 | 2567 | print '<td class="tdoverflowmax300">'; |
2568 | 2568 | if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2569 | - print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2569 | + print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2570 | 2570 | } else { |
2571 | 2571 | print dol_nl2br($task_time->note); |
2572 | 2572 | } |
2573 | 2573 | print '</td>'; |
2574 | 2574 | } elseif ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2575 | - print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_1 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2575 | + print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_1.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2576 | 2576 | } |
2577 | 2577 | |
2578 | 2578 | // Time spent |
@@ -2705,7 +2705,7 @@ discard block |
||
2705 | 2705 | print img_object('', 'user', 'class="hideonsmartphone"'); |
2706 | 2706 | print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask); |
2707 | 2707 | } else { |
2708 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2708 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2709 | 2709 | } |
2710 | 2710 | } else { |
2711 | 2711 | $userstatic->id = $task_time->fk_user; |
@@ -2722,13 +2722,13 @@ discard block |
||
2722 | 2722 | if (!empty($arrayfields['t.note']['checked'])) { |
2723 | 2723 | print '<td class="small tdoverflowmax300"">'; |
2724 | 2724 | if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2725 | - print '<textarea name="timespent_note_line_2" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2725 | + print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2726 | 2726 | } else { |
2727 | 2727 | print dol_nl2br($task_time->note); |
2728 | 2728 | } |
2729 | 2729 | print '</td>'; |
2730 | 2730 | } elseif ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2731 | - print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2731 | + print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2732 | 2732 | } |
2733 | 2733 | |
2734 | 2734 | // Time spent |
@@ -2800,14 +2800,14 @@ discard block |
||
2800 | 2800 | $i++; |
2801 | 2801 | if ($i == 1) { |
2802 | 2802 | if ($num < $limit && empty($offset)) { |
2803 | - print '<td class="left">' . $langs->trans("Total") . '</td>'; |
|
2803 | + print '<td class="left">'.$langs->trans("Total").'</td>'; |
|
2804 | 2804 | } else { |
2805 | 2805 | print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>'; |
2806 | 2806 | } |
2807 | 2807 | } elseif ($totalarray['totaldurationfield'] == $i) { |
2808 | - print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>'; |
|
2808 | + print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>'; |
|
2809 | 2809 | } elseif ($totalarray['totalvaluefield'] == $i) { |
2810 | - print '<td class="right">' . price($totalarray['totalvalue']) . '</td>'; |
|
2810 | + print '<td class="right">'.price($totalarray['totalvalue']).'</td>'; |
|
2811 | 2811 | //} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>'; |
2812 | 2812 | } else { |
2813 | 2813 | print '<td></td>'; |
@@ -2823,8 +2823,8 @@ discard block |
||
2823 | 2823 | $totalnboffields++; |
2824 | 2824 | } |
2825 | 2825 | } |
2826 | - print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">'; |
|
2827 | - print '<span class="opacitymedium">' . $langs->trans("None") . '</span>'; |
|
2826 | + print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">'; |
|
2827 | + print '<span class="opacitymedium">'.$langs->trans("None").'</span>'; |
|
2828 | 2828 | print '</td></tr>'; |
2829 | 2829 | } |
2830 | 2830 |