|
@@ -104,50 +104,50 @@ $taborder = array(9, 15, 30, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5,
|
|
|
|
|
|
// Name of SQL tables of dictionaries
|
|
|
$tabname = array();
|
|
|
-$tabname[1] = MAIN_DB_PREFIX."c_forme_juridique";
|
|
|
-$tabname[2] = MAIN_DB_PREFIX."c_departements";
|
|
|
-$tabname[3] = MAIN_DB_PREFIX."c_regions";
|
|
|
-$tabname[4] = MAIN_DB_PREFIX."c_country";
|
|
|
-$tabname[5] = MAIN_DB_PREFIX."c_civility";
|
|
|
-$tabname[6] = MAIN_DB_PREFIX."c_actioncomm";
|
|
|
-$tabname[7] = MAIN_DB_PREFIX."c_chargesociales";
|
|
|
-$tabname[8] = MAIN_DB_PREFIX."c_typent";
|
|
|
-$tabname[9] = MAIN_DB_PREFIX."c_currencies";
|
|
|
-$tabname[10] = MAIN_DB_PREFIX."c_tva";
|
|
|
-$tabname[11] = MAIN_DB_PREFIX."c_type_contact";
|
|
|
-$tabname[12] = MAIN_DB_PREFIX."c_payment_term";
|
|
|
-$tabname[13] = MAIN_DB_PREFIX."c_paiement";
|
|
|
-$tabname[14] = MAIN_DB_PREFIX."c_ecotaxe";
|
|
|
-$tabname[15] = MAIN_DB_PREFIX."c_paper_format";
|
|
|
-$tabname[16] = MAIN_DB_PREFIX."c_prospectlevel";
|
|
|
-$tabname[17] = MAIN_DB_PREFIX."c_type_fees";
|
|
|
-$tabname[18] = MAIN_DB_PREFIX."c_shipment_mode";
|
|
|
-$tabname[19] = MAIN_DB_PREFIX."c_effectif";
|
|
|
-$tabname[20] = MAIN_DB_PREFIX."c_input_method";
|
|
|
-$tabname[21] = MAIN_DB_PREFIX."c_availability";
|
|
|
-$tabname[22] = MAIN_DB_PREFIX."c_input_reason";
|
|
|
-$tabname[23] = MAIN_DB_PREFIX."c_revenuestamp";
|
|
|
-$tabname[24] = MAIN_DB_PREFIX."c_type_resource";
|
|
|
-$tabname[25] = MAIN_DB_PREFIX."c_type_container";
|
|
|
-//$tabname[26]= MAIN_DB_PREFIX."c_units";
|
|
|
-$tabname[27] = MAIN_DB_PREFIX."c_stcomm";
|
|
|
-$tabname[28] = MAIN_DB_PREFIX."c_holiday_types";
|
|
|
-$tabname[29] = MAIN_DB_PREFIX."c_lead_status";
|
|
|
-$tabname[30] = MAIN_DB_PREFIX."c_format_cards";
|
|
|
-//$tabname[31]= MAIN_DB_PREFIX."accounting_system";
|
|
|
-$tabname[32] = MAIN_DB_PREFIX."c_hrm_public_holiday";
|
|
|
-$tabname[33] = MAIN_DB_PREFIX."c_hrm_department";
|
|
|
-$tabname[34] = MAIN_DB_PREFIX."c_hrm_function";
|
|
|
-$tabname[35] = MAIN_DB_PREFIX."c_exp_tax_cat";
|
|
|
-$tabname[36] = MAIN_DB_PREFIX."c_exp_tax_range";
|
|
|
-$tabname[37] = MAIN_DB_PREFIX."c_units";
|
|
|
-$tabname[38] = MAIN_DB_PREFIX."c_socialnetworks";
|
|
|
-$tabname[39] = MAIN_DB_PREFIX."c_prospectcontactlevel";
|
|
|
-$tabname[40] = MAIN_DB_PREFIX."c_stcommcontact";
|
|
|
-$tabname[41] = MAIN_DB_PREFIX."c_transport_mode";
|
|
|
-$tabname[42] = MAIN_DB_PREFIX."c_product_nature";
|
|
|
-$tabname[43] = MAIN_DB_PREFIX."c_productbatch_qcstatus";
|
|
|
-$tabname[44] = MAIN_DB_PREFIX."c_asset_disposal_type";
|
|
|
+$tabname[1] = "c_forme_juridique";
|
|
|
+$tabname[2] = "c_departements";
|
|
|
+$tabname[3] = "c_regions";
|
|
|
+$tabname[4] = "c_country";
|
|
|
+$tabname[5] = "c_civility";
|
|
|
+$tabname[6] = "c_actioncomm";
|
|
|
+$tabname[7] = "c_chargesociales";
|
|
|
+$tabname[8] = "c_typent";
|
|
|
+$tabname[9] = "c_currencies";
|
|
|
+$tabname[10] = "c_tva";
|
|
|
+$tabname[11] = "c_type_contact";
|
|
|
+$tabname[12] = "c_payment_term";
|
|
|
+$tabname[13] = "c_paiement";
|
|
|
+$tabname[14] = "c_ecotaxe";
|
|
|
+$tabname[15] = "c_paper_format";
|
|
|
+$tabname[16] = "c_prospectlevel";
|
|
|
+$tabname[17] = "c_type_fees";
|
|
|
+$tabname[18] = "c_shipment_mode";
|
|
|
+$tabname[19] = "c_effectif";
|
|
|
+$tabname[20] = "c_input_method";
|
|
|
+$tabname[21] = "c_availability";
|
|
|
+$tabname[22] = "c_input_reason";
|
|
|
+$tabname[23] = "c_revenuestamp";
|
|
|
+$tabname[24] = "c_type_resource";
|
|
|
+$tabname[25] = "c_type_container";
|
|
|
+//$tabname[26]= "c_units";
|
|
|
+$tabname[27] = "c_stcomm";
|
|
|
+$tabname[28] = "c_holiday_types";
|
|
|
+$tabname[29] = "c_lead_status";
|
|
|
+$tabname[30] = "c_format_cards";
|
|
|
+//$tabname[31]= "accounting_system";
|
|
|
+$tabname[32] = "c_hrm_public_holiday";
|
|
|
+$tabname[33] = "c_hrm_department";
|
|
|
+$tabname[34] = "c_hrm_function";
|
|
|
+$tabname[35] = "c_exp_tax_cat";
|
|
|
+$tabname[36] = "c_exp_tax_range";
|
|
|
+$tabname[37] = "c_units";
|
|
|
+$tabname[38] = "c_socialnetworks";
|
|
|
+$tabname[39] = "c_prospectcontactlevel";
|
|
|
+$tabname[40] = "c_stcommcontact";
|
|
|
+$tabname[41] = "c_transport_mode";
|
|
|
+$tabname[42] = "c_product_nature";
|
|
|
+$tabname[43] = "c_productbatch_qcstatus";
|
|
|
+$tabname[44] = "c_asset_disposal_type";
|
|
|
|
|
|
// Dictionary labels
|
|
|
$tablib = array();
|
|
@@ -209,7 +209,7 @@ $tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as
|
|
|
$tabsql[9] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX."c_currencies AS c";
|
|
|
$tabsql[10] = "SELECT t.rowid, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
|
|
|
$tabsql[11] = "SELECT t.rowid as rowid, t.element, t.source, t.code, t.libelle, t.position, t.active FROM ".MAIN_DB_PREFIX."c_type_contact AS t";
|
|
|
-$tabsql[12] = "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM ".MAIN_DB_PREFIX."c_payment_term AS c WHERE c.entity = ".getEntity($tabname[12]);
|
|
|
+$tabsql[12] = "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.deposit_percent, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM ".MAIN_DB_PREFIX."c_payment_term AS c WHERE c.entity = ".getEntity($tabname[12]);
|
|
|
$tabsql[13] = "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_paiement AS c WHERE c.entity = ".getEntity($tabname[13]);
|
|
|
$tabsql[14] = "SELECT e.rowid as rowid, e.code as code, e.label, e.price, e.organization, e.fk_pays as country_id, c.code as country_code, c.label as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_country as c WHERE e.fk_pays=c.rowid and c.active=1";
|
|
|
$tabsql[15] = "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format";
|
|
@@ -265,7 +265,7 @@ $tabsqlsort[17] = "code ASC";
|
|
|
$tabsqlsort[18] = "code ASC, libelle ASC";
|
|
|
$tabsqlsort[19] = "id ASC";
|
|
|
$tabsqlsort[20] = "code ASC, libelle ASC";
|
|
|
-$tabsqlsort[21] = "code ASC, label ASC, position ASC, type_duration ASC, qty ASC";
|
|
|
+$tabsqlsort[21] = "position ASC, type_duration ASC, qty ASC";
|
|
|
$tabsqlsort[22] = "code ASC, label ASC";
|
|
|
$tabsqlsort[23] = "country ASC, taux ASC";
|
|
|
$tabsqlsort[24] = "code ASC, label ASC";
|
|
@@ -303,7 +303,7 @@ $tabfield[8] = "code,libelle,country_id,country".(!empty($conf->global->SOCIETE_
|
|
|
$tabfield[9] = "code,label,unicode";
|
|
|
$tabfield[10] = "country_id,country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
|
|
|
$tabfield[11] = "element,source,code,libelle,position";
|
|
|
-$tabfield[12] = "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder,entity";
|
|
|
+$tabfield[12] = "code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder,entity";
|
|
|
$tabfield[13] = "code,libelle,type,entity";
|
|
|
$tabfield[14] = "code,label,price,organization,country";
|
|
|
$tabfield[15] = "code,libelle,width,height,unit";
|
|
@@ -350,7 +350,7 @@ $tabfieldvalue[8] = "code,libelle,country".(!empty($conf->global->SOCIETE_SORT_O
|
|
|
$tabfieldvalue[9] = "code,label,unicode";
|
|
|
$tabfieldvalue[10] = "country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
|
|
|
$tabfieldvalue[11] = "element,source,code,libelle,position";
|
|
|
-$tabfieldvalue[12] = "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder";
|
|
|
+$tabfieldvalue[12] = "code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder";
|
|
|
$tabfieldvalue[13] = "code,libelle,type";
|
|
|
$tabfieldvalue[14] = "code,label,price,organization,country";
|
|
|
$tabfieldvalue[15] = "code,libelle,width,height,unit";
|
|
@@ -397,7 +397,7 @@ $tabfieldinsert[8] = "code,libelle,fk_country".(!empty($conf->global->SOCIETE_SO
|
|
|
$tabfieldinsert[9] = "code_iso,label,unicode";
|
|
|
$tabfieldinsert[10] = "fk_pays,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
|
|
|
$tabfieldinsert[11] = "element,source,code,libelle,position";
|
|
|
-$tabfieldinsert[12] = "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder,entity";
|
|
|
+$tabfieldinsert[12] = "code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder,entity";
|
|
|
$tabfieldinsert[13] = "code,libelle,type,entity";
|
|
|
$tabfieldinsert[14] = "code,label,price,organization,fk_pays";
|
|
|
$tabfieldinsert[15] = "code,label,width,height,unit";
|
|
@@ -528,112 +528,90 @@ $tabcond[42] = !empty($conf->product->enabled);
|
|
|
$tabcond[43] = !empty($conf->product->enabled) && !empty($conf->productbatch->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2;
|
|
|
$tabcond[44] = !empty($conf->asset->enabled);
|
|
|
|
|
|
-// List of help for fields
|
|
|
+// List of help for fields (no more used, help is defined into tabcomplete)
|
|
|
$tabhelp = array();
|
|
|
-$tabhelp[1] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[2] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[3] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[4] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[5] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[6] = array('code'=>$langs->trans("EnterAnyCode"), 'color'=>$langs->trans("ColorFormat"), 'position'=>$langs->trans("PositionIntoComboList"));
|
|
|
-$tabhelp[7] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[8] = array('code'=>$langs->trans("EnterAnyCode"), 'position'=>$langs->trans("PositionIntoComboList"));
|
|
|
-$tabhelp[9] = array('code'=>$langs->trans("EnterAnyCode"), 'unicode'=>$langs->trans("UnicodeCurrency"));
|
|
|
-$tabhelp[10] = array('code'=>$langs->trans("EnterAnyCode"), 'taux'=>$langs->trans("SellTaxRate"), 'recuperableonly'=>$langs->trans("RecuperableOnly"), 'localtax1_type'=>$langs->trans("LocalTaxDesc"), 'localtax2_type'=>$langs->trans("LocalTaxDesc"));
|
|
|
-$tabhelp[11] = array('code'=>$langs->trans("EnterAnyCode"), 'position'=>$langs->trans("PositionIntoComboList"));
|
|
|
-$tabhelp[12] = array('code'=>$langs->trans("EnterAnyCode"), 'type_cdr'=>$langs->trans("TypeCdr", $langs->transnoentitiesnoconv("NbOfDays"), $langs->transnoentitiesnoconv("Offset"), $langs->transnoentitiesnoconv("NbOfDays"), $langs->transnoentitiesnoconv("Offset")));
|
|
|
-$tabhelp[13] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[14] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[15] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[16] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[17] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[18] = array('code'=>$langs->trans("EnterAnyCode"), 'tracking'=>$langs->trans("UrlTrackingDesc"));
|
|
|
-$tabhelp[19] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[20] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[21] = array('code'=>$langs->trans("EnterAnyCode"), 'position'=>$langs->trans("PositionIntoComboList"));
|
|
|
-$tabhelp[22] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[23] = array('revenuestamp_type'=>'FixedOrPercent');
|
|
|
-$tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[25] = array('code'=>$langs->trans('EnterAnyCode'));
|
|
|
-//$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp"));
|
|
|
-$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"), 'delay'=>$langs->trans("MinimumNoticePeriod"), 'newbymonth'=>$langs->trans("NbAddedAutomatically"));
|
|
|
-$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
|
|
|
-$tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"));
|
|
|
-//$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"), 'dayrule'=>"Keep empty for a date defined with month and day (most common case).<br>Use a keyword like 'easter', 'eastermonday', ... for a date predefined by complex rules.", 'country'=>$langs->trans("CountryIfSpecificToOneCountry"), 'year'=>$langs->trans("ZeroMeansEveryYear"));
|
|
|
-$tabhelp[33] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[35] = array();
|
|
|
-$tabhelp[36] = array('range_ik'=>$langs->trans('PrevRangeToThisRange'));
|
|
|
-$tabhelp[37] = array('code'=>$langs->trans("EnterAnyCode"), 'unit_type' => $langs->trans('Measuringtype_durationDesc'), 'scale' => $langs->trans('MeasuringScaleDesc'));
|
|
|
-$tabhelp[38] = array('code'=>$langs->trans("EnterAnyCode"), 'url' => $langs->trans('UrlSocialNetworksDesc'), 'icon' => $langs->trans('FafaIconSocialNetworksDesc'));
|
|
|
-$tabhelp[39] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[40] = array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp"));
|
|
|
-$tabhelp[41] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[42] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[43] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
-$tabhelp[44] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
|
|
|
// Table to store complete informations (will replace all other table). Key is table name.
|
|
|
$tabcomplete = array(
|
|
|
- 'c_forme_juridique'=>array('picto'=>'company'),
|
|
|
- 'c_departements'=>array('picto'=>'state'),
|
|
|
- 'c_regions'=>array('picto'=>'region'),
|
|
|
- 'c_country'=>array('picto'=>'country'),
|
|
|
- 'c_civility'=>array('picto'=>'contact'),
|
|
|
- 'c_actioncomm'=>array('picto'=>'action'),
|
|
|
- 'c_chargesociales'=>array('picto'=>'bill'),
|
|
|
- 'c_typent'=>array('picto'=>'company'),
|
|
|
- 'c_currencies'=>array('picto'=>'multicurrency'),
|
|
|
- 'c_tva'=>array('picto'=>'bill'),
|
|
|
- 'c_type_contact'=>array('picto'=>'contact'),
|
|
|
- 'c_payment_term'=>array('picto'=>'bill'),
|
|
|
- 'c_paiement'=>array('picto'=>'bill'),
|
|
|
- 'c_ecotaxe'=>array('picto'=>'bill'),
|
|
|
- 'c_paper_format'=>array('picto'=>'generic'),
|
|
|
- 'c_prospectlevel'=>array('picto'=>'company'),
|
|
|
- 'c_type_fees'=>array('picto'=>'trip'),
|
|
|
- 'c_effectif'=>array('picto'=>'company'),
|
|
|
- 'c_input_method'=>array('picto'=>'order'),
|
|
|
- 'c_input_reason'=>array('picto'=>'order'),
|
|
|
- 'c_availability'=>array('picto'=>'shipment'),
|
|
|
- 'c_shipment_mode'=>array('picto'=>'shipment'),
|
|
|
- 'c_revenuestamp'=>array('picto'=>'bill'),
|
|
|
- 'c_type_resource'=>array('picto'=>'resource'),
|
|
|
- 'c_type_container'=>array('picto'=>'website'),
|
|
|
- 'c_stcomm'=>array('picto'=>'company'),
|
|
|
- 'c_holiday_types'=>array('picto'=>'holiday'),
|
|
|
- 'c_lead_status'=>array('picto'=>'project'),
|
|
|
- 'c_format_cards'=>array('picto'=>'generic'),
|
|
|
- 'c_hrm_public_holiday'=>array('picto'=>'holiday'),
|
|
|
- 'c_hrm_department'=>array('picto'=>'hrm'),
|
|
|
- 'c_hrm_function'=>array('picto'=>'hrm'),
|
|
|
- 'c_exp_tax_cat'=>array('picto'=>'expensereport'),
|
|
|
- 'c_exp_tax_range'=>array('picto'=>'expensereport'),
|
|
|
- 'c_units'=>array('picto'=>'product'),
|
|
|
- 'c_socialnetworks'=>array('picto'=>'share-alt'),
|
|
|
- 'c_product_nature'=>array('picto'=>'product'),
|
|
|
- 'c_transport_mode'=>array('picto'=>'incoterm'),
|
|
|
- 'c_prospectcontactlevel'=>array('picto'=>'company'),
|
|
|
- 'c_stcommcontact'=>array('picto'=>'company'),
|
|
|
- 'c_product_nature'=>array('picto'=>'product'),
|
|
|
- 'c_productbatch_qcstatus'=>array('picto'=>'lot'),
|
|
|
- 'c_asset_disposal_type'=>array('picto'=>'asset'),
|
|
|
-
|
|
|
+ 'c_forme_juridique'=>array('picto'=>'company', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_departements'=>array('picto'=>'state', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_regions'=>array('picto'=>'region', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_country'=>array('picto'=>'country', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_civility'=>array('picto'=>'contact', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_actioncomm'=>array('picto'=>'action', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'color'=>$langs->trans("ColorFormat"), 'position'=>$langs->trans("PositionIntoComboList"))),
|
|
|
+ 'c_chargesociales'=>array('picto'=>'bill', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_typent'=>array('picto'=>'company', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'position'=>$langs->trans("PositionIntoComboList"))),
|
|
|
+ 'c_currencies'=>array('picto'=>'multicurrency', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'unicode'=>$langs->trans("UnicodeCurrency"))),
|
|
|
+ 'c_tva'=>array('picto'=>'bill', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'taux'=>$langs->trans("SellTaxRate"), 'recuperableonly'=>$langs->trans("RecuperableOnly"), 'localtax1_type'=>$langs->trans("LocalTaxDesc"), 'localtax2_type'=>$langs->trans("LocalTaxDesc"))),
|
|
|
+ 'c_type_contact'=>array('picto'=>'contact', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'position'=>$langs->trans("PositionIntoComboList"))),
|
|
|
+ 'c_payment_term'=>array('picto'=>'bill', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'type_cdr'=>$langs->trans("TypeCdr", $langs->transnoentitiesnoconv("NbOfDays"), $langs->transnoentitiesnoconv("Offset"), $langs->transnoentitiesnoconv("NbOfDays"), $langs->transnoentitiesnoconv("Offset")))),
|
|
|
+ 'c_paiement'=>array('picto'=>'bill', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_ecotaxe'=>array('picto'=>'bill', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_paper_format'=>array('picto'=>'generic', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_prospectlevel'=>array('picto'=>'company', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_type_fees'=>array('picto'=>'trip', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_shipment_mode'=>array('picto'=>'shipment', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'tracking'=>$langs->trans("UrlTrackingDesc"))),
|
|
|
+ 'c_effectif'=>array('picto'=>'company', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_input_method'=>array('picto'=>'order', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_input_reason'=>array('picto'=>'order', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'position'=>$langs->trans("PositionIntoComboList"))),
|
|
|
+ 'c_availability'=>array('picto'=>'shipment', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_revenuestamp'=>array('picto'=>'bill', 'help'=>array('revenuestamp_type'=>$langs->trans('FixedOrPercent'))),
|
|
|
+ 'c_type_resource'=>array('picto'=>'resource', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_type_container'=>array('picto'=>'website', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_stcomm'=>array('picto'=>'company', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp"))),
|
|
|
+ 'c_holiday_types'=>array('picto'=>'holiday', 'help'=>array('affect'=>$langs->trans("FollowedByACounter"), 'delay'=>$langs->trans("MinimumNoticePeriod"), 'newbymonth'=>$langs->trans("NbAddedAutomatically"))),
|
|
|
+ 'c_lead_status'=>array('picto'=>'project', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"))),
|
|
|
+ 'c_format_cards'=>array('picto'=>'generic', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"))),
|
|
|
+ 'c_hrm_public_holiday'=>array('picto'=>'holiday', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'dayrule'=>"Keep empty for a date defined with month and day (most common case).<br>Use a keyword like 'easter', 'eastermonday', ... for a date predefined by complex rules.", 'country'=>$langs->trans("CountryIfSpecificToOneCountry"), 'year'=>$langs->trans("ZeroMeansEveryYear"))),
|
|
|
+ 'c_hrm_department'=>array('picto'=>'hrm', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_hrm_function'=>array('picto'=>'hrm', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_exp_tax_cat'=>array('picto'=>'expensereport', 'help'=>array()),
|
|
|
+ 'c_exp_tax_range'=>array('picto'=>'expensereport', 'help'=>array('range_ik'=>$langs->trans('PrevRangeToThisRange'))),
|
|
|
+ 'c_units'=>array('picto'=>'product', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'unit_type' => $langs->trans('Measuringtype_durationDesc'), 'scale' => $langs->trans('MeasuringScaleDesc'))),
|
|
|
+ 'c_socialnetworks'=>array('picto'=>'share-alt', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'url' => $langs->trans('UrlSocialNetworksDesc'), 'icon' => $langs->trans('FafaIconSocialNetworksDesc'))),
|
|
|
+ 'c_prospectcontactlevel'=>array('picto'=>'company', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_stcommcontact'=>array('picto'=>'company', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp"))),
|
|
|
+ 'c_transport_mode'=>array('picto'=>'incoterm', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_product_nature'=>array('picto'=>'product', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_productbatch_qcstatus'=>array('picto'=>'lot', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
+ 'c_asset_disposal_type'=>array('picto'=>'asset', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
|
|
);
|
|
|
|
|
|
|
|
|
// Complete all arrays with entries found into modules
|
|
|
complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabcomplete);
|
|
|
|
|
|
+// Complete the table $tabcomplete
|
|
|
+$i = 0;
|
|
|
+foreach ($tabcomplete as $key => $value) {
|
|
|
+ $i++;
|
|
|
+ $tabcomplete[$key]['id'] = $i;
|
|
|
+ $tabcomplete[$key]['cond'] = $tabcond[$i];
|
|
|
+ $tabcomplete[$key]['rowid'] = $tabrowid[$i];
|
|
|
+ $tabcomplete[$key]['fieldinsert'] = $tabfieldinsert[$i];
|
|
|
+ $tabcomplete[$key]['fieldvalue'] = $tabfieldvalue[$i];
|
|
|
+ $tabcomplete[$key]['lib'] = $tablib[$i];
|
|
|
+ $tabcomplete[$key]['sql'] = $tabsql[$i];
|
|
|
+ $tabcomplete[$key]['sqlsort'] = $tabsqlsort[$i];
|
|
|
+ $tabcomplete[$key]['field'] = $tabfield[$i];
|
|
|
+}
|
|
|
+
|
|
|
+$keytable = '';
|
|
|
+if ($id > 0) {
|
|
|
+ $arrayofkeys = array_keys($tabcomplete);
|
|
|
+ $keytable = $arrayofkeys[$id - 1];
|
|
|
+}
|
|
|
+
|
|
|
// Defaut sortorder
|
|
|
if (empty($sortfield)) {
|
|
|
- $tmp1 = explode(',', empty($tabsqlsort[$id]) ? '' : $tabsqlsort[$id]);
|
|
|
+ $tmp1 = explode(',', empty($tabcomplete[$keytable]['sqlsort']) ? '' : $tabcomplete[$keytable]['sqlsort']);
|
|
|
$tmp2 = explode(' ', $tmp1[0]);
|
|
|
$sortfield = preg_replace('/^.*\./', '', $tmp2[0]);
|
|
|
+ $sortorder = $tmp2[1];
|
|
|
+ //var_dump($sortfield);var_dump($sortorder);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
// Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact")
|
|
|
$elementList = array();
|
|
|
$sourceList = array();
|
|
@@ -675,25 +653,22 @@ if ($id == 11) {
|
|
|
}
|
|
|
|
|
|
// Define localtax_typeList (used for dictionary "llx_c_tva")
|
|
|
-$localtax_typeList = array();
|
|
|
-if ($id == 10) {
|
|
|
- $localtax_typeList = array(
|
|
|
- "0" => $langs->trans("No"),
|
|
|
- "1" => $langs->trans("Yes").' ('.$langs->trans("Type")." 1)", //$langs->trans("%ageOnAllWithoutVAT"),
|
|
|
- "2" => $langs->trans("Yes").' ('.$langs->trans("Type")." 2)", //$langs->trans("%ageOnAllBeforeVAT"),
|
|
|
- "3" => $langs->trans("Yes").' ('.$langs->trans("Type")." 3)", //$langs->trans("%ageOnProductsWithoutVAT"),
|
|
|
- "4" => $langs->trans("Yes").' ('.$langs->trans("Type")." 4)", //$langs->trans("%ageOnProductsBeforeVAT"),
|
|
|
- "5" => $langs->trans("Yes").' ('.$langs->trans("Type")." 5)", //$langs->trans("%ageOnServiceWithoutVAT"),
|
|
|
- "6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)" //$langs->trans("%ageOnServiceBeforeVAT"),
|
|
|
- );
|
|
|
-}
|
|
|
-
|
|
|
+$localtax_typeList = array(
|
|
|
+ "0" => $langs->trans("No"),
|
|
|
+ "1" => $langs->trans("Yes").' ('.$langs->trans("Type")." 1)", //$langs->trans("%ageOnAllWithoutVAT"),
|
|
|
+ "2" => $langs->trans("Yes").' ('.$langs->trans("Type")." 2)", //$langs->trans("%ageOnAllBeforeVAT"),
|
|
|
+ "3" => $langs->trans("Yes").' ('.$langs->trans("Type")." 3)", //$langs->trans("%ageOnProductsWithoutVAT"),
|
|
|
+ "4" => $langs->trans("Yes").' ('.$langs->trans("Type")." 4)", //$langs->trans("%ageOnProductsBeforeVAT"),
|
|
|
+ "5" => $langs->trans("Yes").' ('.$langs->trans("Type")." 5)", //$langs->trans("%ageOnServiceWithoutVAT"),
|
|
|
+ "6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)" //$langs->trans("%ageOnServiceBeforeVAT"),
|
|
|
+);
|
|
|
|
|
|
|
|
|
/*
|
|
|
* Actions
|
|
|
*/
|
|
|
|
|
|
+$object = new stdClass();
|
|
|
$parameters = array(
|
|
|
'id' =>$id,
|
|
|
'rowid' =>$rowid,
|
|
@@ -761,7 +736,7 @@ if (empty($reshook)) {
|
|
|
continue; // For a column name 'sortorder', we use the field name 'position'
|
|
|
}
|
|
|
if ((!GETPOSTISSET($value) || GETPOST($value) == '')
|
|
|
- && (!in_array($value, array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking', 'picto')) // Fields that are not mandatory
|
|
|
+ && (!in_array($value, array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking', 'picto', 'deposit_percent')) // Fields that are not mandatory
|
|
|
&& ($id != 10 || ($value != 'code' && $value != 'note')) // Field code and note is not mandatory for dictionary table 10
|
|
|
)
|
|
|
) {
|
|
@@ -774,6 +749,9 @@ if (empty($reshook)) {
|
|
|
if ($fieldnamekey == 'libelle_facture') {
|
|
|
$fieldnamekey = 'LabelOnDocuments';
|
|
|
}
|
|
|
+ if ($fieldnamekey == 'deposit_percent') {
|
|
|
+ $fieldnamekey = 'DepositPercent';
|
|
|
+ }
|
|
|
if ($fieldnamekey == 'nbjour') {
|
|
|
$fieldnamekey = 'NbOfDays';
|
|
|
}
|
|
@@ -817,11 +795,11 @@ if (empty($reshook)) {
|
|
|
$fieldnamekey = 'UseByDefault';
|
|
|
}
|
|
|
|
|
|
- setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
|
|
+ setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
|
|
}
|
|
|
}
|
|
|
// Other checks
|
|
|
- if (GETPOST('actionadd') && $tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && GETPOSTISSET("type") && in_array(GETPOST("type"), array('system', 'systemauto'))) {
|
|
|
+ if (GETPOST('actionadd') && $tabname[$id] == "c_actioncomm" && GETPOSTISSET("type") && in_array(GETPOST("type"), array('system', 'systemauto'))) {
|
|
|
$ok = 0;
|
|
|
setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors');
|
|
|
}
|
|
@@ -869,7 +847,7 @@ if (empty($reshook)) {
|
|
|
if ($tabrowid[$id]) {
|
|
|
// Get free id for insert
|
|
|
$newid = 0;
|
|
|
- $sql = "SELECT max(".$tabrowid[$id].") newid from ".$tabname[$id];
|
|
|
+ $sql = "SELECT MAX(".$tabrowid[$id].") as newid FROM ".MAIN_DB_PREFIX.$tabname[$id];
|
|
|
$result = $db->query($sql);
|
|
|
if ($result) {
|
|
|
$obj = $db->fetch_object($result);
|
|
@@ -880,7 +858,7 @@ if (empty($reshook)) {
|
|
|
}
|
|
|
|
|
|
// Add new entry
|
|
|
- $sql = "INSERT INTO ".$tabname[$id]." (";
|
|
|
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX.$tabname[$id]." (";
|
|
|
// List of fields
|
|
|
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
|
|
|
$sql .= $tabrowid[$id].",";
|
|
@@ -956,7 +934,7 @@ if (empty($reshook)) {
|
|
|
}
|
|
|
|
|
|
// Modify entry
|
|
|
- $sql = "UPDATE ".$tabname[$id]." SET ";
|
|
|
+ $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET ";
|
|
|
// Modifie valeur des champs
|
|
|
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
|
|
|
$sql .= $tabrowid[$id]."=";
|
|
@@ -1011,11 +989,6 @@ if (empty($reshook)) {
|
|
|
setEventMessages($db->error(), null, 'errors');
|
|
|
}
|
|
|
}
|
|
|
- //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
|
|
- }
|
|
|
-
|
|
|
- if (GETPOST('actioncancel')) {
|
|
|
- //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
|
|
}
|
|
|
|
|
|
if ($action == 'confirm_delete' && $confirm == 'yes') { // delete
|
|
@@ -1025,7 +998,7 @@ if (empty($reshook)) {
|
|
|
$rowidcol = "rowid";
|
|
|
}
|
|
|
|
|
|
- $sql = "DELETE FROM ".$tabname[$id]." WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabname[$id]." WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
|
|
|
dol_syslog("delete", LOG_DEBUG);
|
|
|
$result = $db->query($sql);
|
|
@@ -1047,9 +1020,9 @@ if (empty($reshook)) {
|
|
|
}
|
|
|
|
|
|
if ($rowid) {
|
|
|
- $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
+ $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
} elseif ($code) {
|
|
|
- $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
+ $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET active = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
}
|
|
|
|
|
|
$result = $db->query($sql);
|
|
@@ -1067,9 +1040,9 @@ if (empty($reshook)) {
|
|
|
}
|
|
|
|
|
|
if ($rowid) {
|
|
|
- $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
+ $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
} elseif ($code) {
|
|
|
- $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
+ $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET active = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
}
|
|
|
|
|
|
$result = $db->query($sql);
|
|
@@ -1087,9 +1060,9 @@ if (empty($reshook)) {
|
|
|
}
|
|
|
|
|
|
if ($rowid) {
|
|
|
- $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
+ $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
} elseif ($code) {
|
|
|
- $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
+ $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET favorite = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
}
|
|
|
|
|
|
$result = $db->query($sql);
|
|
@@ -1107,9 +1080,9 @@ if (empty($reshook)) {
|
|
|
}
|
|
|
|
|
|
if ($rowid) {
|
|
|
- $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
+ $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
} elseif ($code) {
|
|
|
- $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
+ $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET favorite = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
}
|
|
|
|
|
|
$result = $db->query($sql);
|
|
@@ -1127,9 +1100,9 @@ if (empty($reshook)) {
|
|
|
}
|
|
|
|
|
|
if ($rowid) {
|
|
|
- $sql = "UPDATE ".$tabname[$id]." SET eec = 1 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
+ $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET eec = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
} elseif ($code) {
|
|
|
- $sql = "UPDATE ".$tabname[$id]." SET eec = 1 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
+ $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET eec = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
}
|
|
|
|
|
|
$result = $db->query($sql);
|
|
@@ -1147,9 +1120,9 @@ if (empty($reshook)) {
|
|
|
}
|
|
|
|
|
|
if ($rowid) {
|
|
|
- $sql = "UPDATE ".$tabname[$id]." SET eec = 0 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
+ $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET eec = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
} elseif ($code) {
|
|
|
- $sql = "UPDATE ".$tabname[$id]." SET eec = 0 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
+ $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET eec = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
|
|
}
|
|
|
|
|
|
$result = $db->query($sql);
|
|
@@ -1225,7 +1198,7 @@ if ($action == 'delete') {
|
|
|
/*
|
|
|
* Show a dictionary
|
|
|
*/
|
|
|
-if ($id) {
|
|
|
+if ($id > 0) {
|
|
|
// Complete search values request with sort criteria
|
|
|
$sql = $tabsql[$id];
|
|
|
|
|
@@ -1293,6 +1266,7 @@ if ($id) {
|
|
|
print '<table class="noborder centpercent">';
|
|
|
|
|
|
// Line for title
|
|
|
+ print '<!-- line title to add new entry -->';
|
|
|
$tdsoffields = '<tr class="liste_titre">';
|
|
|
foreach ($fieldlist as $field => $value) {
|
|
|
if ($value == 'entity') {
|
|
@@ -1315,7 +1289,7 @@ if ($id) {
|
|
|
$valuetoshow = $langs->trans("PriceUHT");
|
|
|
}
|
|
|
if ($value == 'taux') {
|
|
|
- if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") {
|
|
|
+ if ($tabname[$id] != "c_revenuestamp") {
|
|
|
$valuetoshow = $langs->trans("Rate");
|
|
|
} else {
|
|
|
$valuetoshow = $langs->trans("Amount");
|
|
@@ -1341,7 +1315,7 @@ if ($id) {
|
|
|
$valuetoshow = $langs->trans("Language");
|
|
|
}
|
|
|
if ($value == 'type') {
|
|
|
- if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") {
|
|
|
+ if ($tabname[$id] == "c_paiement") {
|
|
|
$valuetoshow = $form->textwithtooltip($langs->trans("Type"), $langs->trans("TypePaymentDesc"), 2, 1, img_help(1, ''));
|
|
|
} else {
|
|
|
$valuetoshow = $langs->trans("Type");
|
|
@@ -1356,6 +1330,10 @@ if ($id) {
|
|
|
if ($value == 'libelle_facture') {
|
|
|
$valuetoshow = $form->textwithtooltip($langs->trans("LabelOnDocuments"), $langs->trans("LabelUsedByDefault"), 2, 1, img_help(1, ''));
|
|
|
}
|
|
|
+ if ($value == 'deposit_percent') {
|
|
|
+ $valuetoshow = $langs->trans('DepositPercent');
|
|
|
+ $class = 'right';
|
|
|
+ }
|
|
|
if ($value == 'country') {
|
|
|
if (in_array('region_id', $fieldlist)) {
|
|
|
print '<td> </td>'; continue;
|
|
@@ -1367,12 +1345,14 @@ if ($id) {
|
|
|
}
|
|
|
if ($value == 'nbjour') {
|
|
|
$valuetoshow = $langs->trans("NbOfDays");
|
|
|
+ $class = 'right';
|
|
|
}
|
|
|
if ($value == 'type_cdr') {
|
|
|
$valuetoshow = $langs->trans("AtEndOfMonth"); $class = "center";
|
|
|
}
|
|
|
if ($value == 'decalage') {
|
|
|
$valuetoshow = $langs->trans("Offset");
|
|
|
+ $class = 'right';
|
|
|
}
|
|
|
if ($value == 'width' || $value == 'nx') {
|
|
|
$valuetoshow = $langs->trans("Width");
|
|
@@ -1409,6 +1389,7 @@ if ($id) {
|
|
|
}
|
|
|
if ($value == 'sortorder') {
|
|
|
$valuetoshow = $langs->trans("SortOrder");
|
|
|
+ $class = 'center';
|
|
|
}
|
|
|
if ($value == 'short_label') {
|
|
|
$valuetoshow = $langs->trans("ShortLabel");
|
|
@@ -1505,7 +1486,7 @@ if ($id) {
|
|
|
}
|
|
|
|
|
|
if ($valuetoshow != '') {
|
|
|
- $tdsoffields .= '<td'.($class ? ' class="'.$class.'"' : '').'>';
|
|
|
+ $tdsoffields .= '<th'.($class ? ' class="'.$class.'"' : '').'>';
|
|
|
if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) {
|
|
|
$tdsoffields .= '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
|
|
|
} elseif (!empty($tabhelp[$id][$value])) {
|
|
@@ -1513,29 +1494,29 @@ if ($id) {
|
|
|
} else {
|
|
|
$tdsoffields .= $valuetoshow;
|
|
|
}
|
|
|
- $tdsoffields .= '</td>';
|
|
|
+ $tdsoffields .= '</th>';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if ($id == 4) {
|
|
|
- $tdsoffields .= '<td></td>';
|
|
|
- $tdsoffields .= '<td></td>';
|
|
|
+ $tdsoffields .= '<th></th>';
|
|
|
+ $tdsoffields .= '<th></th>';
|
|
|
}
|
|
|
- $tdsoffields .= '<td>';
|
|
|
+ $tdsoffields .= '<th>';
|
|
|
$tdsoffields .= '<input type="hidden" name="id" value="'.$id.'">';
|
|
|
if (!is_null($withentity)) {
|
|
|
$tdsoffields .= '<input type="hidden" name="entity" value="'.$withentity.'">';
|
|
|
}
|
|
|
- $tdsoffields .= '</td>';
|
|
|
- $tdsoffields .= '<td style="min-width: 26px;"></td>';
|
|
|
- $tdsoffields .= '<td style="min-width: 26px;"></td>';
|
|
|
+ $tdsoffields .= '</th>';
|
|
|
+ $tdsoffields .= '<th style="min-width: 26px;"></th>';
|
|
|
+ $tdsoffields .= '<th style="min-width: 26px;"></th>';
|
|
|
$tdsoffields .= '</tr>';
|
|
|
|
|
|
print $tdsoffields;
|
|
|
|
|
|
|
|
|
// Line to enter new values
|
|
|
- print '<!-- line to add new entry -->';
|
|
|
+ print '<!-- line input to add new entry -->';
|
|
|
print '<tr class="oddeven nodrag nodrop nohover">';
|
|
|
|
|
|
$obj = new stdClass();
|
|
@@ -1606,6 +1587,7 @@ if ($id) {
|
|
|
print '<table class="noborder centpercent">';
|
|
|
|
|
|
// Title line with search input fields
|
|
|
+ print '<!-- line title to search record -->'."\n";
|
|
|
print '<tr class="liste_titre_filter">';
|
|
|
$filterfound = 0;
|
|
|
foreach ($fieldlist as $field => $value) {
|
|
@@ -1650,6 +1632,7 @@ if ($id) {
|
|
|
print '</tr>';
|
|
|
|
|
|
// Title of lines
|
|
|
+ print '<!-- line title of record -->'."\n";
|
|
|
print '<tr class="liste_titre">';
|
|
|
foreach ($fieldlist as $field => $value) {
|
|
|
if ($value == 'entity') {
|
|
@@ -1676,7 +1659,7 @@ if ($id) {
|
|
|
$valuetoshow = $langs->trans("PriceUHT");
|
|
|
}
|
|
|
if ($value == 'taux') {
|
|
|
- if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") {
|
|
|
+ if ($tabname[$id] != "c_revenuestamp") {
|
|
|
$valuetoshow = $langs->trans("Rate");
|
|
|
} else {
|
|
|
$valuetoshow = $langs->trans("Amount");
|
|
@@ -1717,6 +1700,10 @@ if ($id) {
|
|
|
if ($value == 'libelle_facture') {
|
|
|
$valuetoshow = $langs->trans("LabelOnDocuments");
|
|
|
}
|
|
|
+ if ($value == 'deposit_percent') {
|
|
|
+ $valuetoshow = $langs->trans('DepositPercent');
|
|
|
+ $cssprefix = 'right ';
|
|
|
+ }
|
|
|
if ($value == 'country') {
|
|
|
$valuetoshow = $langs->trans("Country");
|
|
|
}
|
|
@@ -1725,12 +1712,14 @@ if ($id) {
|
|
|
}
|
|
|
if ($value == 'nbjour') {
|
|
|
$valuetoshow = $langs->trans("NbOfDays");
|
|
|
+ $cssprefix = 'right ';
|
|
|
}
|
|
|
if ($value == 'type_cdr') {
|
|
|
$valuetoshow = $langs->trans("AtEndOfMonth"); $cssprefix = "center ";
|
|
|
}
|
|
|
if ($value == 'decalage') {
|
|
|
$valuetoshow = $langs->trans("Offset");
|
|
|
+ $cssprefix = 'right ';
|
|
|
}
|
|
|
if ($value == 'width' || $value == 'nx') {
|
|
|
$valuetoshow = $langs->trans("Width");
|
|
@@ -1764,6 +1753,7 @@ if ($id) {
|
|
|
}
|
|
|
if ($value == 'sortorder') {
|
|
|
$valuetoshow = $langs->trans("SortOrder");
|
|
|
+ $cssprefix = 'center ';
|
|
|
}
|
|
|
if ($value == 'short_label') {
|
|
|
$valuetoshow = $langs->trans("ShortLabel");
|
|
@@ -1962,58 +1952,58 @@ if ($id) {
|
|
|
$key = $langs->trans("PaymentCondition".strtoupper($obj->code));
|
|
|
$valuetoshow = ($obj->code && $key != "PaymentCondition".strtoupper($obj->code) ? $key : $obj->{$value});
|
|
|
$valuetoshow = nl2br($valuetoshow);
|
|
|
- } elseif ($value == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_country') {
|
|
|
+ } elseif ($value == 'label' && $tabname[$id] == 'c_country') {
|
|
|
$key = $langs->trans("Country".strtoupper($obj->code));
|
|
|
$valuetoshow = ($obj->code && $key != "Country".strtoupper($obj->code) ? $key : $obj->{$value});
|
|
|
- } elseif ($value == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_availability') {
|
|
|
+ } elseif ($value == 'label' && $tabname[$id] == 'c_availability') {
|
|
|
$langs->load("propal");
|
|
|
$key = $langs->trans("AvailabilityType".strtoupper($obj->code));
|
|
|
$valuetoshow = ($obj->code && $key != "AvailabilityType".strtoupper($obj->code) ? $key : $obj->{$value});
|
|
|
- } elseif ($value == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_actioncomm') {
|
|
|
+ } elseif ($value == 'libelle' && $tabname[$id] == 'c_actioncomm') {
|
|
|
$key = $langs->trans("Action".strtoupper($obj->code));
|
|
|
$valuetoshow = ($obj->code && $key != "Action".strtoupper($obj->code) ? $key : $obj->{$value});
|
|
|
- } elseif (!empty($obj->code_iso) && $value == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_currencies') {
|
|
|
+ } elseif (!empty($obj->code_iso) && $value == 'label' && $tabname[$id] == 'c_currencies') {
|
|
|
$key = $langs->trans("Currency".strtoupper($obj->code_iso));
|
|
|
$valuetoshow = ($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso) ? $key : $obj->{$value});
|
|
|
- } elseif ($value == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_typent') {
|
|
|
+ } elseif ($value == 'libelle' && $tabname[$id] == 'c_typent') {
|
|
|
$key = $langs->trans(strtoupper($obj->code));
|
|
|
$valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->{$value});
|
|
|
- } elseif ($value == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_prospectlevel') {
|
|
|
+ } elseif ($value == 'libelle' && $tabname[$id] == 'c_prospectlevel') {
|
|
|
$key = $langs->trans(strtoupper($obj->code));
|
|
|
$valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->{$value});
|
|
|
- } elseif ($value == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_civility') {
|
|
|
+ } elseif ($value == 'label' && $tabname[$id] == 'c_civility') {
|
|
|
$key = $langs->trans("Civility".strtoupper($obj->code));
|
|
|
$valuetoshow = ($obj->code && $key != "Civility".strtoupper($obj->code) ? $key : $obj->{$value});
|
|
|
- } elseif ($value == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_contact') {
|
|
|
+ } elseif ($value == 'libelle' && $tabname[$id] == 'c_type_contact') {
|
|
|
$langs->load('agenda');
|
|
|
$key = $langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code));
|
|
|
$valuetoshow = ($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code) ? $key : $obj->{$value});
|
|
|
- } elseif ($value == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_payment_term') {
|
|
|
+ } elseif ($value == 'libelle' && $tabname[$id] == 'c_payment_term') {
|
|
|
$langs->load("bills");
|
|
|
$key = $langs->trans("PaymentConditionShort".strtoupper($obj->code));
|
|
|
$valuetoshow = ($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code) ? $key : $obj->{$value});
|
|
|
- } elseif ($value == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_paiement') {
|
|
|
+ } elseif ($value == 'libelle' && $tabname[$id] == 'c_paiement') {
|
|
|
$langs->load("bills");
|
|
|
$key = $langs->trans("PaymentType".strtoupper($obj->code));
|
|
|
$valuetoshow = ($obj->code && $key != "PaymentType".strtoupper($obj->code) ? $key : $obj->{$value});
|
|
|
- } elseif ($value == 'type' && $tabname[$id] == MAIN_DB_PREFIX.'c_paiement') {
|
|
|
+ } elseif ($value == 'type' && $tabname[$id] == 'c_paiement') {
|
|
|
$payment_type_list = array(0=>$langs->trans('PaymentTypeCustomer'), 1=>$langs->trans('PaymentTypeSupplier'), 2=>$langs->trans('PaymentTypeBoth'));
|
|
|
$valuetoshow = $payment_type_list[$valuetoshow];
|
|
|
- } elseif ($value == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_input_reason') {
|
|
|
+ } elseif ($value == 'label' && $tabname[$id] == 'c_input_reason') {
|
|
|
$key = $langs->trans("DemandReasonType".strtoupper($obj->code));
|
|
|
$valuetoshow = ($obj->code && $key != "DemandReasonType".strtoupper($obj->code) ? $key : $obj->{$value});
|
|
|
- } elseif ($value == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_input_method') {
|
|
|
+ } elseif ($value == 'libelle' && $tabname[$id] == 'c_input_method') {
|
|
|
$langs->load("orders");
|
|
|
$key = $langs->trans($obj->code);
|
|
|
$valuetoshow = ($obj->code && $key != $obj->code) ? $key : $obj->{$value};
|
|
|
- } elseif ($value == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_shipment_mode') {
|
|
|
+ } elseif ($value == 'libelle' && $tabname[$id] == 'c_shipment_mode') {
|
|
|
$langs->load("sendings");
|
|
|
$key = $langs->trans("SendingMethod".strtoupper($obj->code));
|
|
|
$valuetoshow = ($obj->code && $key != "SendingMethod".strtoupper($obj->code) ? $key : $obj->{$value});
|
|
|
- } elseif ($value == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_paper_format') {
|
|
|
+ } elseif ($value == 'libelle' && $tabname[$id] == 'c_paper_format') {
|
|
|
$key = $langs->trans('PaperFormat'.strtoupper($obj->code));
|
|
|
$valuetoshow = ($obj->code && $key != 'PaperFormat'.strtoupper($obj->code) ? $key : $obj->{$value});
|
|
|
- } elseif ($value == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees') {
|
|
|
+ } elseif ($value == 'label' && $tabname[$id] == 'c_type_fees') {
|
|
|
$langs->load('trips');
|
|
|
$key = $langs->trans(strtoupper($obj->code));
|
|
|
$valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$value});
|
|
@@ -2021,13 +2011,13 @@ if ($id) {
|
|
|
$showfield = 0;
|
|
|
} elseif ($value == 'unicode') {
|
|
|
$valuetoshow = $langs->getCurrencySymbol($obj->code, 1);
|
|
|
- } elseif ($value == 'label' && $tabname[GETPOST("id", 'int')] == MAIN_DB_PREFIX.'c_units') {
|
|
|
+ } elseif ($value == 'label' && $tabname[GETPOST("id", 'int')] == 'c_units') {
|
|
|
$langs->load("products");
|
|
|
$valuetoshow = $langs->trans($obj->{$value});
|
|
|
- } elseif ($value == 'short_label' && $tabname[GETPOST("id", 'int')] == MAIN_DB_PREFIX.'c_units') {
|
|
|
+ } elseif ($value == 'short_label' && $tabname[GETPOST("id", 'int')] == 'c_units') {
|
|
|
$langs->load("products");
|
|
|
$valuetoshow = $langs->trans($obj->{$value});
|
|
|
- } elseif (($value == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format')) {
|
|
|
+ } elseif (($value == 'unit') && ($tabname[$id] == 'c_paper_format')) {
|
|
|
$key = $langs->trans('SizeUnit'.strtolower($obj->unit));
|
|
|
$valuetoshow = ($obj->code && $key != 'SizeUnit'.strtolower($obj->unit) ? $key : $obj->{$value});
|
|
|
} elseif ($value == 'localtax1' || $value == 'localtax2') {
|
|
@@ -2068,20 +2058,20 @@ if ($id) {
|
|
|
}
|
|
|
} elseif ($value == 'fk_c_exp_tax_cat') {
|
|
|
$tmpid = $valuetoshow;
|
|
|
- $valuetoshow = getDictionaryValue(MAIN_DB_PREFIX.'c_exp_tax_cat', 'label', $tmpid);
|
|
|
+ $valuetoshow = getDictionaryValue('c_exp_tax_cat', 'label', $tmpid);
|
|
|
$valuetoshow = $langs->trans($valuetoshow ? $valuetoshow : $tmpid);
|
|
|
- } elseif ($tabname[$id] == MAIN_DB_PREFIX.'c_exp_tax_cat') {
|
|
|
+ } elseif ($tabname[$id] == 'c_exp_tax_cat') {
|
|
|
$valuetoshow = $langs->trans($valuetoshow);
|
|
|
- } elseif ($value == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_units') {
|
|
|
+ } elseif ($value == 'label' && $tabname[$id] == 'c_units') {
|
|
|
$langs->load('other');
|
|
|
$key = $langs->trans($obj->label);
|
|
|
$valuetoshow = ($obj->label && $key != strtoupper($obj->label) ? $key : $obj->{$value});
|
|
|
} elseif ($value == 'code' && $id == 3) {
|
|
|
$valuetoshow = $obj->state_code;
|
|
|
- } elseif ($value == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_product_nature') {
|
|
|
+ } elseif ($value == 'label' && $tabname[$id] == 'c_product_nature') {
|
|
|
$langs->load("products");
|
|
|
$valuetoshow = $langs->trans($obj->{$value});
|
|
|
- } elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_productbatch_qcstatus') {
|
|
|
+ } elseif ($fieldlist[$field] == 'label' && $tabname[$id] == 'c_productbatch_qcstatus') {
|
|
|
$langs->load("productbatch");
|
|
|
$valuetoshow = $langs->trans($obj->{$value});
|
|
|
} elseif ($value == 'block_if_negative') {
|
|
@@ -2097,13 +2087,13 @@ if ($id) {
|
|
|
if ($value == 'tracking') {
|
|
|
$class .= ' tdoverflowauto';
|
|
|
}
|
|
|
- if (in_array($value, array('pos', 'position'))) {
|
|
|
+ if (in_array($value, array('nbjour', 'decalage', 'pos', 'position', 'deposit_percent'))) {
|
|
|
$class .= ' right';
|
|
|
}
|
|
|
if (in_array($value, array('localtax1_type', 'localtax2_type'))) {
|
|
|
$class .= ' nowrap';
|
|
|
}
|
|
|
- if (in_array($value, array('use_default', 'fk_parent'))) {
|
|
|
+ if (in_array($value, array('use_default', 'fk_parent', 'sortorder'))) {
|
|
|
$class .= ' center';
|
|
|
}
|
|
|
if ($value == 'public') {
|
|
@@ -2147,7 +2137,7 @@ if ($id) {
|
|
|
if (!empty($obj->code) && $obj->code == 'RECEP') {
|
|
|
$canbemodified = 1;
|
|
|
}
|
|
|
- if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm") {
|
|
|
+ if ($tabname[$id] == "c_actioncomm") {
|
|
|
$canbemodified = 1;
|
|
|
}
|
|
|
|
|
@@ -2174,7 +2164,7 @@ if ($id) {
|
|
|
if ($iserasable) {
|
|
|
print '<a class="reposition" href="'.$url.'action='.$acts[$obj->eec].'_eec&token='.newToken().'">'.$actl[$obj->eec].'</a>';
|
|
|
} else {
|
|
|
- print $langs->trans("AlwaysActive");
|
|
|
+ print '<span class="opacitymedium">'.$langs->trans("AlwaysActive").'</span>';
|
|
|
}
|
|
|
print '</td>';
|
|
|
print '<td class="nowrap center">';
|
|
@@ -2182,7 +2172,7 @@ if ($id) {
|
|
|
if ($iserasable) {
|
|
|
print '<a class="reposition" href="'.$url.'action='.$acts[$obj->favorite].'_favorite&token='.newToken().'">'.$actl[$obj->favorite].'</a>';
|
|
|
} else {
|
|
|
- print $langs->trans("AlwaysActive");
|
|
|
+ print '<span class="opacitymedium">'.$langs->trans("AlwaysActive").'</span>';
|
|
|
}
|
|
|
print '</td>';
|
|
|
}
|
|
@@ -2199,7 +2189,7 @@ if ($id) {
|
|
|
} elseif (isset($obj->type) && in_array($obj->type, array('system')) && !empty($obj->active) && $obj->code != 'AC_OTH') {
|
|
|
print $langs->trans("UsedOnlyWithTypeOption");
|
|
|
} else {
|
|
|
- print $langs->trans("AlwaysActive");
|
|
|
+ print '<span class="opacitymedium">'.$langs->trans("AlwaysActive").'</span>';
|
|
|
}
|
|
|
}
|
|
|
print "</td>";
|
|
@@ -2283,7 +2273,7 @@ if ($id) {
|
|
|
print '</a>';
|
|
|
print '</td>';
|
|
|
print '<td class="right">';
|
|
|
- print $form->textwithpicto('', $langs->trans("Table").': '.$tabname[$i]);
|
|
|
+ print $form->textwithpicto('', $langs->trans("Table").': '.MAIN_DB_PREFIX.$tabname[$i]);
|
|
|
print '</td>';
|
|
|
print '</tr>';
|
|
|
$lastlineisempty = false;
|
|
@@ -2333,7 +2323,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- if (in_array($value, array('code', 'libelle', 'type')) && $tabname == MAIN_DB_PREFIX."c_actioncomm" && in_array($obj->type, array('system', 'systemauto'))) {
|
|
|
+ if (in_array($value, array('code', 'libelle', 'type')) && $tabname == "c_actioncomm" && in_array($obj->type, array('system', 'systemauto'))) {
|
|
|
$hidden = (!empty($obj->{$value}) ? $obj->{$value}:'');
|
|
|
print '<td>';
|
|
|
print '<input type="hidden" name="'. $value .'" value="'.$hidden.'">';
|
|
@@ -2369,15 +2359,9 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|
|
print '<td>';
|
|
|
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang');
|
|
|
print '</td>';
|
|
|
- } elseif ($value == 'element') {
|
|
|
- // The type of the element (for contact types)
|
|
|
+ } elseif (in_array($value, array('element', 'source'))) { //Example: the type and source of the element (for contact types)
|
|
|
print '<td>';
|
|
|
- print $form->selectarray('element', $elementList, (!empty($obj->{$value}) ? $obj->{$value}:''));
|
|
|
- print '</td>';
|
|
|
- } elseif ($value == 'source') {
|
|
|
- // The source of the element (for contact types)
|
|
|
- print '<td>';
|
|
|
- print $form->selectarray('source', $sourceList, (!empty($obj->{$value}) ? $obj->{$value}:''));
|
|
|
+ print $form->selectarray($value, $elementList, (!empty($obj->{$value}) ? $obj->{$value}:''));
|
|
|
print '</td>';
|
|
|
} elseif (in_array($value, array('public', 'use_default'))) {
|
|
|
// Fields 0/1 with a combo select Yes/No
|
|
@@ -2389,12 +2373,12 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|
|
print '<td>';
|
|
|
print $form->selectyesno("private", (!empty($obj->{$value}) ? $obj->{$value}:''));
|
|
|
print '</td>';
|
|
|
- } elseif ($value == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm") {
|
|
|
+ } elseif ($value == 'type' && $tabname == "c_actioncomm") {
|
|
|
$type = (!empty($obj->type) ? $obj->type : 'user'); // Check if type is different of 'user' (external module)
|
|
|
print '<td>';
|
|
|
print $type.'<input type="hidden" name="type" value="'.$type.'">';
|
|
|
print '</td>';
|
|
|
- } elseif ($value == 'type' && $tabname == MAIN_DB_PREFIX.'c_paiement') {
|
|
|
+ } elseif ($value == 'type' && $tabname == 'c_paiement') {
|
|
|
print '<td>';
|
|
|
$select_list = array(0=>$langs->trans('PaymentTypeCustomer'), 1=>$langs->trans('PaymentTypeSupplier'), 2=>$langs->trans('PaymentTypeBoth'));
|
|
|
print $form->selectarray($value, $select_list, (!empty($obj->{$value}) ? $obj->{$value}:'2'));
|
|
@@ -2412,7 +2396,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|
|
}
|
|
|
print '</td>';
|
|
|
} elseif (in_array($value, array('nbjour', 'decalage', 'taux', 'localtax1', 'localtax2'))) {
|
|
|
- $class = "left";
|
|
|
+ $class = "right";
|
|
|
if (in_array($value, array('taux', 'localtax1', 'localtax2'))) {
|
|
|
$class = "center"; // Fields aligned on right
|
|
|
}
|
|
@@ -2424,7 +2408,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|
|
$transfound = 0;
|
|
|
$transkey = '';
|
|
|
// Special case for labels
|
|
|
- if ($tabname == MAIN_DB_PREFIX.'c_payment_term') {
|
|
|
+ if ($tabname == 'c_payment_term') {
|
|
|
$langs->load("bills");
|
|
|
$transkey = "PaymentCondition".strtoupper($obj->code);
|
|
|
if ($langs->trans($transkey) != $transkey) {
|
|
@@ -2490,18 +2474,21 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|
|
print '</td>';
|
|
|
} else {
|
|
|
$fieldValue = isset($obj->{$value}) ? $obj->{$value}: '';
|
|
|
+ $classtd = ''; $class = '';
|
|
|
|
|
|
if ($value == 'sortorder') {
|
|
|
$fieldlist[$field] = 'position';
|
|
|
}
|
|
|
|
|
|
- $classtd = ''; $class = '';
|
|
|
if ($fieldlist[$field] == 'code') {
|
|
|
$class = 'maxwidth100';
|
|
|
}
|
|
|
- if (in_array($fieldlist[$field], array('pos', 'position'))) {
|
|
|
+ if (in_array($fieldlist[$field], array('deposit_percent'))) {
|
|
|
$classtd = 'right'; $class = 'maxwidth50 right';
|
|
|
}
|
|
|
+ if (in_array($fieldlist[$field], array('pos', 'position'))) {
|
|
|
+ $classtd = 'center'; $class = 'maxwidth50 center';
|
|
|
+ }
|
|
|
if (in_array($fieldlist[$field], array('dayrule', 'day', 'month', 'year', 'use_default', 'affect', 'delay', 'public', 'sortorder', 'sens', 'category_type', 'fk_parent'))) {
|
|
|
$class = 'maxwidth50 center';
|
|
|
}
|
|
@@ -2522,19 +2509,19 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|
|
$maxlength = '';
|
|
|
if (in_array($fieldlist[$field], array('libelle', 'label'))) {
|
|
|
switch ($tabname) {
|
|
|
- case MAIN_DB_PREFIX . 'c_accounting_category':
|
|
|
- case MAIN_DB_PREFIX . 'c_ecotaxe':
|
|
|
- case MAIN_DB_PREFIX . 'c_email_senderprofile':
|
|
|
- case MAIN_DB_PREFIX . 'c_forme_juridique':
|
|
|
- case MAIN_DB_PREFIX . 'c_holiday_types':
|
|
|
- case MAIN_DB_PREFIX . 'c_payment_term':
|
|
|
- case MAIN_DB_PREFIX . 'c_transport_mode':
|
|
|
+ case 'c_accounting_category':
|
|
|
+ case 'c_ecotaxe':
|
|
|
+ case 'c_email_senderprofile':
|
|
|
+ case 'c_forme_juridique':
|
|
|
+ case 'c_holiday_types':
|
|
|
+ case 'c_payment_term':
|
|
|
+ case 'c_transport_mode':
|
|
|
$maxlength = ' maxlength="255"';
|
|
|
break;
|
|
|
- case MAIN_DB_PREFIX . 'c_email_templates':
|
|
|
+ case 'c_email_templates':
|
|
|
$maxlength = ' maxlength="180"';
|
|
|
break;
|
|
|
- case MAIN_DB_PREFIX . 'c_socialnetworks':
|
|
|
+ case 'c_socialnetworks':
|
|
|
$maxlength = ' maxlength="150"';
|
|
|
break;
|
|
|
default:
|
|
@@ -2547,10 +2534,10 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|
|
$transkey = '';
|
|
|
if (in_array($fieldlist[$field], array('label', 'libelle'))) { // For label
|
|
|
// Special case for labels
|
|
|
- if ($tabname == MAIN_DB_PREFIX.'c_civility' && !empty($obj->code)) {
|
|
|
+ if ($tabname == 'c_civility' && !empty($obj->code)) {
|
|
|
$transkey = "Civility".strtoupper($obj->code);
|
|
|
}
|
|
|
- if ($tabname == MAIN_DB_PREFIX.'c_payment_term' && !empty($obj->code)) {
|
|
|
+ if ($tabname == 'c_payment_term' && !empty($obj->code)) {
|
|
|
$langs->load("bills");
|
|
|
$transkey = "PaymentConditionShort".strtoupper($obj->code);
|
|
|
}
|