|
@@ -8,7 +8,7 @@
|
|
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
|
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
|
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
|
|
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
|
|
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
|
|
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
|
|
- * Copyright (C) 2011-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
|
|
|
|
|
+ * Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
|
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
|
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
|
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
|
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
|
*
|
|
*
|
|
@@ -46,6 +46,8 @@ $langs->load("admin");
|
|
$langs->load("companies");
|
|
$langs->load("companies");
|
|
$langs->load("resource");
|
|
$langs->load("resource");
|
|
$langs->load("holiday");
|
|
$langs->load("holiday");
|
|
|
|
+$langs->load("accountancy");
|
|
|
|
+$langs->load("hrm");
|
|
|
|
|
|
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
|
|
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
|
|
$confirm=GETPOST('confirm','alpha');
|
|
$confirm=GETPOST('confirm','alpha');
|
|
@@ -78,7 +80,7 @@ $hookmanager->initHooks(array('admin'));
|
|
// Put here declaration of dictionaries properties
|
|
// Put here declaration of dictionaries properties
|
|
|
|
|
|
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
|
|
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
|
|
-$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26);
|
|
|
|
|
|
+$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,33,34,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26,0,31,32,0);
|
|
|
|
|
|
// Name of SQL tables of dictionaries
|
|
// Name of SQL tables of dictionaries
|
|
$tabname=array();
|
|
$tabname=array();
|
|
@@ -112,6 +114,10 @@ $tabname[27]= MAIN_DB_PREFIX."c_stcomm";
|
|
$tabname[28]= MAIN_DB_PREFIX."c_holiday_types";
|
|
$tabname[28]= MAIN_DB_PREFIX."c_holiday_types";
|
|
$tabname[29]= MAIN_DB_PREFIX."c_lead_status";
|
|
$tabname[29]= MAIN_DB_PREFIX."c_lead_status";
|
|
$tabname[30]= MAIN_DB_PREFIX."c_format_cards";
|
|
$tabname[30]= MAIN_DB_PREFIX."c_format_cards";
|
|
|
|
+$tabname[31]= MAIN_DB_PREFIX."accounting_system";
|
|
|
|
+$tabname[32]= MAIN_DB_PREFIX."c_accounting_category";
|
|
|
|
+$tabname[33]= MAIN_DB_PREFIX."c_hrm_department";
|
|
|
|
+$tabname[34]= MAIN_DB_PREFIX."c_hrm_function";
|
|
|
|
|
|
// Dictionary labels
|
|
// Dictionary labels
|
|
$tablib=array();
|
|
$tablib=array();
|
|
@@ -145,6 +151,10 @@ $tablib[27]= "DictionaryProspectStatus";
|
|
$tablib[28]= "DictionaryHolidayTypes";
|
|
$tablib[28]= "DictionaryHolidayTypes";
|
|
$tablib[29]= "DictionaryOpportunityStatus";
|
|
$tablib[29]= "DictionaryOpportunityStatus";
|
|
$tablib[30]= "DictionaryFormatCards";
|
|
$tablib[30]= "DictionaryFormatCards";
|
|
|
|
+$tablib[31]= "DictionaryAccountancysystem";
|
|
|
|
+$tablib[32]= "DictionaryAccountancyCategory";
|
|
|
|
+$tablib[33]= "DictionaryDepartment";
|
|
|
|
+$tablib[34]= "DictionaryFunction";
|
|
|
|
|
|
// Requests to extract data
|
|
// Requests to extract data
|
|
$tabsql=array();
|
|
$tabsql=array();
|
|
@@ -172,12 +182,16 @@ $tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX
|
|
$tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
|
|
$tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
|
|
$tabsql[23]= "SELECT t.rowid as rowid, t.taux, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
|
|
$tabsql[23]= "SELECT t.rowid as rowid, t.taux, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
|
|
$tabsql[24]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource";
|
|
$tabsql[24]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource";
|
|
-$tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position, topic, content, active FROM ".MAIN_DB_PREFIX."c_email_templates";
|
|
|
|
|
|
+$tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position, topic, content, active FROM ".MAIN_DB_PREFIX."c_email_templates WHERE entity IN (".getEntity('email_template',1).")";
|
|
$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
|
$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
|
$tabsql[27]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
|
$tabsql[27]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
|
-$tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
|
|
|
|
|
+$tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
|
$tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
|
|
$tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
|
|
$tabsql[30]= "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards";
|
|
$tabsql[30]= "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards";
|
|
|
|
+$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, c.code as country_code, c.label as country, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_country as c WHERE s.fk_pays=c.rowid and c.active=1";
|
|
|
|
+$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.sens, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1";
|
|
|
|
+$tabsql[33]= "SELECT rowid, pos, code, label, active FROM ".MAIN_DB_PREFIX."c_hrm_department";
|
|
|
|
+$tabsql[34]= "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX."c_hrm_function";
|
|
|
|
|
|
// Criteria to sort dictionaries
|
|
// Criteria to sort dictionaries
|
|
$tabsqlsort=array();
|
|
$tabsqlsort=array();
|
|
@@ -211,6 +225,10 @@ $tabsqlsort[27]="code ASC";
|
|
$tabsqlsort[28]="country ASC, code ASC";
|
|
$tabsqlsort[28]="country ASC, code ASC";
|
|
$tabsqlsort[29]="position ASC";
|
|
$tabsqlsort[29]="position ASC";
|
|
$tabsqlsort[30]="code ASC";
|
|
$tabsqlsort[30]="code ASC";
|
|
|
|
+$tabsqlsort[31]="pcg_version ASC";
|
|
|
|
+$tabsqlsort[32]="position ASC";
|
|
|
|
+$tabsqlsort[33]="code ASC";
|
|
|
|
+$tabsqlsort[34]="code ASC";
|
|
|
|
|
|
// Nom des champs en resultat de select pour affichage du dictionnaire
|
|
// Nom des champs en resultat de select pour affichage du dictionnaire
|
|
$tabfield=array();
|
|
$tabfield=array();
|
|
@@ -238,12 +256,16 @@ $tabfield[21]= "code,label";
|
|
$tabfield[22]= "code,label";
|
|
$tabfield[22]= "code,label";
|
|
$tabfield[23]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note";
|
|
$tabfield[23]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note";
|
|
$tabfield[24]= "code,label";
|
|
$tabfield[24]= "code,label";
|
|
-$tabfield[25]= "label,type_template,position,topic,content";
|
|
|
|
|
|
+$tabfield[25]= "label,type_template,private,position,topic,content";
|
|
$tabfield[26]= "code,label,short_label";
|
|
$tabfield[26]= "code,label,short_label";
|
|
$tabfield[27]= "code,libelle";
|
|
$tabfield[27]= "code,libelle";
|
|
-$tabfield[28]= "code,label,affect,delay,newByMonth,country_id,country";
|
|
|
|
|
|
+$tabfield[28]= "code,label,affect,delay,newbymonth,country_id,country";
|
|
$tabfield[29]= "code,label,percent,position";
|
|
$tabfield[29]= "code,label,percent,position";
|
|
$tabfield[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
|
$tabfield[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
|
|
|
+$tabfield[31]= "pcg_version,country_id,country,label";
|
|
|
|
+$tabfield[32]= "code,label,range_account,sens,category_type,formula,position,country_id,country";
|
|
|
|
+$tabfield[33]= "code,label";
|
|
|
|
+$tabfield[34]= "code,label";
|
|
|
|
|
|
// Nom des champs d'edition pour modification d'un enregistrement
|
|
// Nom des champs d'edition pour modification d'un enregistrement
|
|
$tabfieldvalue=array();
|
|
$tabfieldvalue=array();
|
|
@@ -271,12 +293,16 @@ $tabfieldvalue[21]= "code,label";
|
|
$tabfieldvalue[22]= "code,label";
|
|
$tabfieldvalue[22]= "code,label";
|
|
$tabfieldvalue[23]= "country,taux,accountancy_code_sell,accountancy_code_buy,note";
|
|
$tabfieldvalue[23]= "country,taux,accountancy_code_sell,accountancy_code_buy,note";
|
|
$tabfieldvalue[24]= "code,label";
|
|
$tabfieldvalue[24]= "code,label";
|
|
-$tabfieldvalue[25]= "label,type_template,position,topic,content";
|
|
|
|
|
|
+$tabfieldvalue[25]= "label,type_template,private,position,topic,content";
|
|
$tabfieldvalue[26]= "code,label,short_label";
|
|
$tabfieldvalue[26]= "code,label,short_label";
|
|
$tabfieldvalue[27]= "code,libelle";
|
|
$tabfieldvalue[27]= "code,libelle";
|
|
-$tabfieldvalue[28]= "code,label,affect,delay,newByMonth,country";
|
|
|
|
|
|
+$tabfieldvalue[28]= "code,label,affect,delay,newbymonth,country";
|
|
$tabfieldvalue[29]= "code,label,percent,position";
|
|
$tabfieldvalue[29]= "code,label,percent,position";
|
|
$tabfieldvalue[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
|
$tabfieldvalue[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
|
|
|
+$tabfieldvalue[31]= "pcg_version,country,label";
|
|
|
|
+$tabfieldvalue[32]= "code,label,range_account,sens,category_type,formula,position,country";
|
|
|
|
+$tabfieldvalue[33]= "code,label";
|
|
|
|
+$tabfieldvalue[34]= "code,label";
|
|
|
|
|
|
// Nom des champs dans la table pour insertion d'un enregistrement
|
|
// Nom des champs dans la table pour insertion d'un enregistrement
|
|
$tabfieldinsert=array();
|
|
$tabfieldinsert=array();
|
|
@@ -304,12 +330,16 @@ $tabfieldinsert[21]= "code,label";
|
|
$tabfieldinsert[22]= "code,label";
|
|
$tabfieldinsert[22]= "code,label";
|
|
$tabfieldinsert[23]= "fk_pays,taux,accountancy_code_sell,accountancy_code_buy,note";
|
|
$tabfieldinsert[23]= "fk_pays,taux,accountancy_code_sell,accountancy_code_buy,note";
|
|
$tabfieldinsert[24]= "code,label";
|
|
$tabfieldinsert[24]= "code,label";
|
|
-$tabfieldinsert[25]= "label,type_template,position,topic,content";
|
|
|
|
|
|
+$tabfieldinsert[25]= "label,type_template,private,position,topic,content,entity";
|
|
$tabfieldinsert[26]= "code,label,short_label";
|
|
$tabfieldinsert[26]= "code,label,short_label";
|
|
$tabfieldinsert[27]= "code,libelle";
|
|
$tabfieldinsert[27]= "code,libelle";
|
|
-$tabfieldinsert[28]= "code,label,affect,delay,newByMonth,fk_country";
|
|
|
|
|
|
+$tabfieldinsert[28]= "code,label,affect,delay,newbymonth,fk_country";
|
|
$tabfieldinsert[29]= "code,label,percent,position";
|
|
$tabfieldinsert[29]= "code,label,percent,position";
|
|
$tabfieldinsert[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
|
$tabfieldinsert[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
|
|
|
+$tabfieldinsert[31]= "pcg_version,fk_pays,label";
|
|
|
|
+$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country";
|
|
|
|
+$tabfieldinsert[33]= "code,label";
|
|
|
|
+$tabfieldinsert[34]= "code,label";
|
|
|
|
|
|
// Nom du rowid si le champ n'est pas de type autoincrement
|
|
// Nom du rowid si le champ n'est pas de type autoincrement
|
|
// Example: "" if id field is "rowid" and has autoincrement on
|
|
// Example: "" if id field is "rowid" and has autoincrement on
|
|
@@ -345,6 +375,10 @@ $tabrowid[27]= "id";
|
|
$tabrowid[28]= "";
|
|
$tabrowid[28]= "";
|
|
$tabrowid[29]= "";
|
|
$tabrowid[29]= "";
|
|
$tabrowid[30]= "";
|
|
$tabrowid[30]= "";
|
|
|
|
+$tabrowid[31]= "";
|
|
|
|
+$tabrowid[32]= "";
|
|
|
|
+$tabrowid[33]= "rowid";
|
|
|
|
+$tabrowid[34]= "rowid";
|
|
|
|
|
|
// Condition to show dictionary in setup page
|
|
// Condition to show dictionary in setup page
|
|
$tabcond=array();
|
|
$tabcond=array();
|
|
@@ -378,6 +412,10 @@ $tabcond[27]= ! empty($conf->societe->enabled);
|
|
$tabcond[28]= ! empty($conf->holiday->enabled);
|
|
$tabcond[28]= ! empty($conf->holiday->enabled);
|
|
$tabcond[29]= ! empty($conf->projet->enabled);
|
|
$tabcond[29]= ! empty($conf->projet->enabled);
|
|
$tabcond[30]= ! empty($conf->label->enabled);
|
|
$tabcond[30]= ! empty($conf->label->enabled);
|
|
|
|
+$tabcond[31]= ! empty($conf->accounting->enabled);
|
|
|
|
+$tabcond[32]= ! empty($conf->accounting->enabled);
|
|
|
|
+$tabcond[33]= ! empty($conf->hrm->enabled);
|
|
|
|
+$tabcond[34]= ! empty($conf->hrm->enabled);
|
|
|
|
|
|
// List of help for fields
|
|
// List of help for fields
|
|
$tabhelp=array();
|
|
$tabhelp=array();
|
|
@@ -408,9 +446,13 @@ $tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
$tabhelp[25] = array('topic'=>$langs->trans('SeeSubstitutionVars'),'content'=>$langs->trans('SeeSubstitutionVars'),'type_template'=>$langs->trans("TemplateForElement"),'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"), 'position'=>$langs->trans("PositionIntoComboList"));
|
|
$tabhelp[25] = array('topic'=>$langs->trans('SeeSubstitutionVars'),'content'=>$langs->trans('SeeSubstitutionVars'),'type_template'=>$langs->trans("TemplateForElement"),'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"), 'position'=>$langs->trans("PositionIntoComboList"));
|
|
$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
-$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically"));
|
|
|
|
|
|
+$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[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[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"));
|
|
|
|
+$tabhelp[33] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
|
+$tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
|
|
|
// List of check for fields (NOT USED YET)
|
|
// List of check for fields (NOT USED YET)
|
|
$tabfieldcheck=array();
|
|
$tabfieldcheck=array();
|
|
@@ -444,6 +486,10 @@ $tabfieldcheck[27] = array();
|
|
$tabfieldcheck[28] = array();
|
|
$tabfieldcheck[28] = array();
|
|
$tabfieldcheck[29] = array();
|
|
$tabfieldcheck[29] = array();
|
|
$tabfieldcheck[30] = array();
|
|
$tabfieldcheck[30] = array();
|
|
|
|
+$tabfieldcheck[31] = array();
|
|
|
|
+$tabfieldcheck[32] = array();
|
|
|
|
+$tabfieldcheck[33] = array();
|
|
|
|
+$tabfieldcheck[34] = array();
|
|
|
|
|
|
// Complete all arrays with entries found into modules
|
|
// Complete all arrays with entries found into modules
|
|
complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck);
|
|
complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck);
|
|
@@ -478,6 +524,7 @@ if ($id == 11)
|
|
'propal' => $langs->trans('Proposal'),
|
|
'propal' => $langs->trans('Proposal'),
|
|
'commande' => $langs->trans('Order'),
|
|
'commande' => $langs->trans('Order'),
|
|
'facture' => $langs->trans('Bill'),
|
|
'facture' => $langs->trans('Bill'),
|
|
|
|
+ 'resource' => $langs->trans('Resource'),
|
|
// 'facture_fourn' => $langs->trans('SupplierBill'),
|
|
// 'facture_fourn' => $langs->trans('SupplierBill'),
|
|
'fichinter' => $langs->trans('InterventionCard')
|
|
'fichinter' => $langs->trans('InterventionCard')
|
|
);
|
|
);
|
|
@@ -534,11 +581,12 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|
$ok=1;
|
|
$ok=1;
|
|
foreach ($listfield as $f => $value)
|
|
foreach ($listfield as $f => $value)
|
|
{
|
|
{
|
|
- if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
|
|
|
|
|
|
+ if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancysystem','DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory
|
|
if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
|
|
if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
|
|
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
|
|
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
|
|
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
|
|
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
|
|
if ($value == 'color' && empty($_POST['color'])) continue;
|
|
if ($value == 'color' && empty($_POST['color'])) continue;
|
|
|
|
+ if ($value == 'formula' && empty($_POST['formula'])) continue;
|
|
if ((! isset($_POST[$value]) || $_POST[$value]=='')
|
|
if ((! isset($_POST[$value]) || $_POST[$value]=='')
|
|
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy'))) // Fields that are not mandatory
|
|
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy'))) // Fields that are not mandatory
|
|
)
|
|
)
|
|
@@ -559,6 +607,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|
if ($fieldnamekey == 'unicode') $fieldnamekey = 'Unicode';
|
|
if ($fieldnamekey == 'unicode') $fieldnamekey = 'Unicode';
|
|
if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible';
|
|
if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible';
|
|
if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder';
|
|
if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder';
|
|
|
|
+ if ($fieldnamekey == 'category_type') $fieldnamekey = 'Calculated';
|
|
|
|
|
|
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
|
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
|
}
|
|
}
|
|
@@ -598,7 +647,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|
$ok=0;
|
|
$ok=0;
|
|
setEventMessages($langs->transnoentities("ErrorFieldMustBeANumeric",$langs->transnoentities("Code")), null, 'errors');
|
|
setEventMessages($langs->transnoentities("ErrorFieldMustBeANumeric",$langs->transnoentities("Code")), null, 'errors');
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
// Clean some parameters
|
|
// Clean some parameters
|
|
if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
|
|
if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
|
|
if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
|
|
if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
|
|
@@ -952,6 +1001,10 @@ if ($id)
|
|
if ($fieldlist[$field]=='sortorder') { $valuetoshow=$langs->trans("SortOrder"); }
|
|
if ($fieldlist[$field]=='sortorder') { $valuetoshow=$langs->trans("SortOrder"); }
|
|
if ($fieldlist[$field]=='short_label') { $valuetoshow=$langs->trans("ShortLabel"); }
|
|
if ($fieldlist[$field]=='short_label') { $valuetoshow=$langs->trans("ShortLabel"); }
|
|
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
|
|
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
|
|
|
|
+ if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); }
|
|
|
|
+ if ($fieldlist[$field]=='sens') { $valuetoshow=$langs->trans("Sens"); }
|
|
|
|
+ if ($fieldlist[$field]=='category_type') { $valuetoshow=$langs->trans("Calculated"); }
|
|
|
|
+ if ($fieldlist[$field]=='formula') { $valuetoshow=$langs->trans("Formula"); }
|
|
|
|
|
|
if ($id == 2) // Special cas for state page
|
|
if ($id == 2) // Special cas for state page
|
|
{
|
|
{
|
|
@@ -1119,6 +1172,10 @@ if ($id)
|
|
if ($fieldlist[$field]=='sortorder') { $valuetoshow=$langs->trans("SortOrder"); }
|
|
if ($fieldlist[$field]=='sortorder') { $valuetoshow=$langs->trans("SortOrder"); }
|
|
if ($fieldlist[$field]=='short_label') { $valuetoshow=$langs->trans("ShortLabel"); }
|
|
if ($fieldlist[$field]=='short_label') { $valuetoshow=$langs->trans("ShortLabel"); }
|
|
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
|
|
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
|
|
|
|
+ if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); }
|
|
|
|
+ if ($fieldlist[$field]=='sens') { $valuetoshow=$langs->trans("Sens"); }
|
|
|
|
+ if ($fieldlist[$field]=='category_type') { $valuetoshow=$langs->trans("Calculated"); }
|
|
|
|
+ if ($fieldlist[$field]=='formula') { $valuetoshow=$langs->trans("Formula"); }
|
|
|
|
|
|
// Affiche nom du champ
|
|
// Affiche nom du champ
|
|
if ($showfield)
|
|
if ($showfield)
|
|
@@ -1200,7 +1257,7 @@ if ($id)
|
|
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
|
|
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm' || $fieldlist[$field] == 'deductible') {
|
|
|
|
|
|
+ else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
|
|
$valuetoshow=yn($valuetoshow);
|
|
$valuetoshow=yn($valuetoshow);
|
|
$align="center";
|
|
$align="center";
|
|
}
|
|
}
|
|
@@ -1341,8 +1398,10 @@ if ($id)
|
|
$valuetoshow = length_accountg($valuetoshow);
|
|
$valuetoshow = length_accountg($valuetoshow);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ $class='tddict';
|
|
|
|
+ if ($fieldlist[$field] == 'tracking') $class.=' tdoverflowauto';
|
|
// Show value for field
|
|
// Show value for field
|
|
- if ($showfield) print '<td align="'.$align.'">'.$valuetoshow.'</td>';
|
|
|
|
|
|
+ if ($showfield) print '<!-- '.$fieldlist[$field].' --><td align="'.$align.'" class="'.$class.'">'.$valuetoshow.'</td>';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1359,7 +1418,7 @@ if ($id)
|
|
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $canbedisabled=0; $canbedisabled = 0; }
|
|
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $canbedisabled=0; $canbedisabled = 0; }
|
|
$canbemodified=$iserasable;
|
|
$canbemodified=$iserasable;
|
|
if ($obj->code == 'RECEP') $canbemodified=1;
|
|
if ($obj->code == 'RECEP') $canbemodified=1;
|
|
-
|
|
|
|
|
|
+
|
|
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):'').'&id='.$id.'&';
|
|
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):'').'&id='.$id.'&';
|
|
|
|
|
|
// Favorite
|
|
// Favorite
|
|
@@ -1568,7 +1627,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
|
print 'user<input type="hidden" name="type" value="user">';
|
|
print 'user<input type="hidden" name="type" value="user">';
|
|
print '</td>';
|
|
print '</td>';
|
|
}
|
|
}
|
|
- elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'fdm' || $fieldlist[$field] == 'deductible') {
|
|
|
|
|
|
+ elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'fdm' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
|
|
print '<td>';
|
|
print '<td>';
|
|
print $form->selectyesno($fieldlist[$field],(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''),1);
|
|
print $form->selectyesno($fieldlist[$field],(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''),1);
|
|
print '</td>';
|
|
print '</td>';
|
|
@@ -1642,13 +1701,13 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
|
else
|
|
else
|
|
{
|
|
{
|
|
print '<td>';
|
|
print '<td>';
|
|
- $size='';
|
|
|
|
|
|
+ $size=''; $class='';
|
|
if ($fieldlist[$field]=='code') $size='size="8" ';
|
|
if ($fieldlist[$field]=='code') $size='size="8" ';
|
|
if ($fieldlist[$field]=='position') $size='size="4" ';
|
|
if ($fieldlist[$field]=='position') $size='size="4" ';
|
|
- if ($fieldlist[$field]=='libelle') $size='size="32" ';
|
|
|
|
- if ($fieldlist[$field]=='tracking') $size='size="92" ';
|
|
|
|
- if ($fieldlist[$field]=='sortorder') $size='size="2" ';
|
|
|
|
- print '<input type="text" '.$size.' class="flat" value="'.(isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
|
|
|
|
|
|
+ if ($fieldlist[$field]=='libelle') $size='centpercent';
|
|
|
|
+ if ($fieldlist[$field]=='tracking') $class='centpercent';
|
|
|
|
+ if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $size='size="2" ';
|
|
|
|
+ print '<input type="text" '.$size.' class="flat'.($class?' '.$class:'').'" value="'.(isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
|
|
print '</td>';
|
|
print '</td>';
|
|
}
|
|
}
|
|
}
|
|
}
|