|
|
|
@@ -88,7 +88,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,33,34,0,6,0,29,0,7,24,28,17,35,36,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,37,0,25,0);
|
|
|
|
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,32,33,34,0,6,0,29,0,7,24,28,17,35,36,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,37,0,25,0);
|
|
|
|
|
|
|
|
|
|
|
|
// Name of SQL tables of dictionaries
|
|
|
|
// Name of SQL tables of dictionaries
|
|
|
|
$tabname=array();
|
|
|
|
$tabname=array();
|
|
|
|
@@ -123,9 +123,10 @@ $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[31]= MAIN_DB_PREFIX."accounting_system";
|
|
|
|
//$tabname[32]= MAIN_DB_PREFIX."c_accounting_category";
|
|
|
|
$tabname[32]= MAIN_DB_PREFIX."c_hrm_public_holiday";
|
|
|
|
$tabname[33]= MAIN_DB_PREFIX."c_hrm_department";
|
|
|
|
$tabname[33]= MAIN_DB_PREFIX."c_hrm_department";
|
|
|
|
$tabname[34]= MAIN_DB_PREFIX."c_hrm_function";
|
|
|
|
$tabname[34]= MAIN_DB_PREFIX."c_hrm_function";
|
|
|
|
|
|
|
|
|
|
|
|
$tabname[35]= MAIN_DB_PREFIX."c_exp_tax_cat";
|
|
|
|
$tabname[35]= MAIN_DB_PREFIX."c_exp_tax_cat";
|
|
|
|
$tabname[36]= MAIN_DB_PREFIX."c_exp_tax_range";
|
|
|
|
$tabname[36]= MAIN_DB_PREFIX."c_exp_tax_range";
|
|
|
|
$tabname[37]= MAIN_DB_PREFIX."c_units";
|
|
|
|
$tabname[37]= MAIN_DB_PREFIX."c_units";
|
|
|
|
@@ -163,7 +164,7 @@ $tablib[28]= "DictionaryHolidayTypes";
|
|
|
|
$tablib[29]= "DictionaryOpportunityStatus";
|
|
|
|
$tablib[29]= "DictionaryOpportunityStatus";
|
|
|
|
$tablib[30]= "DictionaryFormatCards";
|
|
|
|
$tablib[30]= "DictionaryFormatCards";
|
|
|
|
//$tablib[31]= "DictionaryAccountancysystem";
|
|
|
|
//$tablib[31]= "DictionaryAccountancysystem";
|
|
|
|
//$tablib[32]= "DictionaryAccountancyCategory";
|
|
|
|
$tablib[32]= "DictionaryPublicHolidays";
|
|
|
|
$tablib[33]= "DictionaryDepartment";
|
|
|
|
$tablib[33]= "DictionaryDepartment";
|
|
|
|
$tablib[34]= "DictionaryFunction";
|
|
|
|
$tablib[34]= "DictionaryFunction";
|
|
|
|
$tablib[35]= "DictionaryExpenseTaxCat";
|
|
|
|
$tablib[35]= "DictionaryExpenseTaxCat";
|
|
|
|
@@ -203,7 +204,7 @@ $tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.new
|
|
|
|
$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.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s";
|
|
|
|
//$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s";
|
|
|
|
//$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[32]= "SELECT a.id as rowid, a.entity, a.code, a.fk_country as country_id, c.code as country_code, c.label as country, a.day, a.month, a.year, a.active FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday as a LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON 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[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";
|
|
|
|
$tabsql[34]= "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX."c_hrm_function";
|
|
|
|
$tabsql[35]= "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c";
|
|
|
|
$tabsql[35]= "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c";
|
|
|
|
@@ -243,7 +244,7 @@ $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[31]="pcg_version ASC";
|
|
|
|
//$tabsqlsort[32]="position ASC";
|
|
|
|
$tabsqlsort[32]="year ASC, month ASC, day ASC";
|
|
|
|
$tabsqlsort[33]="code ASC";
|
|
|
|
$tabsqlsort[33]="code ASC";
|
|
|
|
$tabsqlsort[34]="code ASC";
|
|
|
|
$tabsqlsort[34]="code ASC";
|
|
|
|
$tabsqlsort[35]="c.label ASC";
|
|
|
|
$tabsqlsort[35]="c.label ASC";
|
|
|
|
@@ -283,7 +284,7 @@ $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,label";
|
|
|
|
//$tabfield[31]= "pcg_version,label";
|
|
|
|
//$tabfield[32]= "code,label,range_account,sens,category_type,formula,position,country_id,country";
|
|
|
|
$tabfield[32]= "code,year,month,day,country_id,country";
|
|
|
|
$tabfield[33]= "code,label";
|
|
|
|
$tabfield[33]= "code,label";
|
|
|
|
$tabfield[34]= "code,label";
|
|
|
|
$tabfield[34]= "code,label";
|
|
|
|
$tabfield[35]= "label";
|
|
|
|
$tabfield[35]= "label";
|
|
|
|
@@ -323,7 +324,7 @@ $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,label";
|
|
|
|
//$tabfieldvalue[31]= "pcg_version,label";
|
|
|
|
//$tabfieldvalue[32]= "code,label,range_account,sens,category_type,formula,position,country";
|
|
|
|
$tabfieldvalue[32]= "code,day,month,year,country";
|
|
|
|
$tabfieldvalue[33]= "code,label";
|
|
|
|
$tabfieldvalue[33]= "code,label";
|
|
|
|
$tabfieldvalue[34]= "code,label";
|
|
|
|
$tabfieldvalue[34]= "code,label";
|
|
|
|
$tabfieldvalue[35]= "label";
|
|
|
|
$tabfieldvalue[35]= "label";
|
|
|
|
@@ -364,15 +365,16 @@ $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,label";
|
|
|
|
//$tabfieldinsert[31]= "pcg_version,label";
|
|
|
|
//$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country";
|
|
|
|
//$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country";
|
|
|
|
|
|
|
|
$tabfieldinsert[32]= "code,day,month,year,fk_country";
|
|
|
|
$tabfieldinsert[33]= "code,label";
|
|
|
|
$tabfieldinsert[33]= "code,label";
|
|
|
|
$tabfieldinsert[34]= "code,label";
|
|
|
|
$tabfieldinsert[34]= "code,label";
|
|
|
|
$tabfieldinsert[35]= "label";
|
|
|
|
$tabfieldinsert[35]= "label";
|
|
|
|
$tabfieldinsert[36]= "range_ik,fk_c_exp_tax_cat";
|
|
|
|
$tabfieldinsert[36]= "range_ik,fk_c_exp_tax_cat";
|
|
|
|
$tabfieldinsert[37]= "code,label,short_label,unit_type,scale";
|
|
|
|
$tabfieldinsert[37]= "code,label,short_label,unit_type,scale";
|
|
|
|
|
|
|
|
|
|
|
|
// Rowid name if the field is not autoincrement type
|
|
|
|
// Rowid name of field depending if field is autoincrement on or off..
|
|
|
|
// Example: "" if id field is "rowid" and has autoincrement on
|
|
|
|
// Use "" if id field is "rowid" and has autoincrement on
|
|
|
|
// "nameoffield" if id field is not "rowid" or has not autoincrement on
|
|
|
|
// Use "nameoffield" if id field is not "rowid" or has not autoincrement on
|
|
|
|
$tabrowid=array();
|
|
|
|
$tabrowid=array();
|
|
|
|
$tabrowid[1] = "";
|
|
|
|
$tabrowid[1] = "";
|
|
|
|
$tabrowid[2] = "";
|
|
|
|
$tabrowid[2] = "";
|
|
|
|
@@ -405,7 +407,7 @@ $tabrowid[28]= "";
|
|
|
|
$tabrowid[29]= "";
|
|
|
|
$tabrowid[29]= "";
|
|
|
|
$tabrowid[30]= "";
|
|
|
|
$tabrowid[30]= "";
|
|
|
|
//$tabrowid[31]= "";
|
|
|
|
//$tabrowid[31]= "";
|
|
|
|
//$tabrowid[32]= "";
|
|
|
|
$tabrowid[32]= "id";
|
|
|
|
$tabrowid[33]= "rowid";
|
|
|
|
$tabrowid[33]= "rowid";
|
|
|
|
$tabrowid[34]= "rowid";
|
|
|
|
$tabrowid[34]= "rowid";
|
|
|
|
$tabrowid[35]= "";
|
|
|
|
$tabrowid[35]= "";
|
|
|
|
@@ -445,7 +447,7 @@ $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[31]= ! empty($conf->accounting->enabled);
|
|
|
|
//$tabcond[32]= ! empty($conf->accounting->enabled);
|
|
|
|
$tabcond[32]= (! empty($conf->holiday->enabled) || ! empty($conf->hrm->enabled));
|
|
|
|
$tabcond[33]= ! empty($conf->hrm->enabled);
|
|
|
|
$tabcond[33]= ! empty($conf->hrm->enabled);
|
|
|
|
$tabcond[34]= ! empty($conf->hrm->enabled);
|
|
|
|
$tabcond[34]= ! empty($conf->hrm->enabled);
|
|
|
|
$tabcond[35]= ! empty($conf->expensereport->enabled);
|
|
|
|
$tabcond[35]= ! empty($conf->expensereport->enabled);
|
|
|
|
@@ -485,12 +487,12 @@ $tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$lan
|
|
|
|
$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[31] = array('pcg_version'=>$langs->trans("EnterAnyCode"));
|
|
|
|
//$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
|
$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"), 'daterule'=>"Use 'date'", 'country'=>$langs->trans("EnterACountryOnlyIfSpecificToOneCountry"), 'year'=>$langs->trans("ZeroMeansEveryYear"));
|
|
|
|
$tabhelp[33] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
|
$tabhelp[33] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
|
$tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
|
$tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
|
$tabhelp[35]= array();
|
|
|
|
$tabhelp[35] = array();
|
|
|
|
$tabhelp[36]= array('range_ik'=>$langs->trans('PrevRangeToThisRange'));
|
|
|
|
$tabhelp[36] = array('range_ik'=>$langs->trans('PrevRangeToThisRange'));
|
|
|
|
$tabhelp[37]= array('code'=>$langs->trans("EnterAnyCode"));
|
|
|
|
$tabhelp[37] = 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();
|
|
|
|
@@ -525,12 +527,12 @@ $tabfieldcheck[28] = array();
|
|
|
|
$tabfieldcheck[29] = array();
|
|
|
|
$tabfieldcheck[29] = array();
|
|
|
|
$tabfieldcheck[30] = array();
|
|
|
|
$tabfieldcheck[30] = array();
|
|
|
|
//$tabfieldcheck[31] = array();
|
|
|
|
//$tabfieldcheck[31] = array();
|
|
|
|
//$tabfieldcheck[32] = array();
|
|
|
|
$tabfieldcheck[32] = array();
|
|
|
|
$tabfieldcheck[33] = array();
|
|
|
|
$tabfieldcheck[33] = array();
|
|
|
|
$tabfieldcheck[34] = array();
|
|
|
|
$tabfieldcheck[34] = array();
|
|
|
|
$tabfieldcheck[35]= array();
|
|
|
|
$tabfieldcheck[35] = array();
|
|
|
|
$tabfieldcheck[36]= array();
|
|
|
|
$tabfieldcheck[36] = array();
|
|
|
|
$tabfieldcheck[37]= array();
|
|
|
|
$tabfieldcheck[37] = 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);
|
|
|
|
@@ -621,8 +623,10 @@ 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','DictionaryAccountancysystem','DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory
|
|
|
|
// Discard check of mandatory fields for country for some tables
|
|
|
|
if ($value == 'country' && in_array($tablib[$id], array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
|
|
|
|
if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryPublicHolidays','DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancysystem','DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory
|
|
|
|
|
|
|
|
if ($value == 'country' && in_array($tablib[$id], array('DictionaryPublicHolidays','DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
|
|
|
|
|
|
|
|
// Discard check of mandatory fiedls for other fields
|
|
|
|
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;
|
|
|
|
@@ -992,8 +996,10 @@ if ($id)
|
|
|
|
|
|
|
|
|
|
|
|
if (! preg_match('/ WHERE /', $sql)) $sql.= " WHERE 1 = 1";
|
|
|
|
if (! preg_match('/ WHERE /', $sql)) $sql.= " WHERE 1 = 1";
|
|
|
|
if ($search_country_id > 0) $sql.= " AND c.rowid = ".$search_country_id;
|
|
|
|
if ($search_country_id > 0) $sql.= " AND c.rowid = ".$search_country_id;
|
|
|
|
if ($search_code != '' && $id != 9) $sql.= natural_search("code", $search_code);
|
|
|
|
|
|
|
|
if ($search_code != '' && $id == 9) $sql.= natural_search("code_iso", $search_code);
|
|
|
|
if ($search_code != '' && $id == 9) $sql.= natural_search("code_iso", $search_code);
|
|
|
|
|
|
|
|
elseif ($search_code != '' && $id == 28) $sql.= natural_search("h.code", $search_code);
|
|
|
|
|
|
|
|
elseif ($search_code != '' && $id == 32) $sql.= natural_search("a.code", $search_code);
|
|
|
|
|
|
|
|
elseif ($search_code != '' && $id != 9) $sql.= natural_search("code", $search_code);
|
|
|
|
|
|
|
|
|
|
|
|
if ($sortfield)
|
|
|
|
if ($sortfield)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -1053,7 +1059,7 @@ if ($id)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Define field friedly name from its technical name
|
|
|
|
// Define field friendly name from its technical name
|
|
|
|
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
|
|
|
|
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
|
|
|
|
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
|
|
|
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
|
|
|
$class='';
|
|
|
|
$class='';
|
|
|
|
@@ -1156,7 +1162,8 @@ if ($id)
|
|
|
|
print '</tr>';
|
|
|
|
print '</tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Line to enter new values
|
|
|
|
// Line to enter new values
|
|
|
|
print '<!-- line to add new entry --><tr class="oddeven nodrag nodrop nohover">';
|
|
|
|
print '<!-- line to add new entry -->';
|
|
|
|
|
|
|
|
print '<tr class="oddeven nodrag nodrop nohover">';
|
|
|
|
|
|
|
|
|
|
|
|
$obj = new stdClass();
|
|
|
|
$obj = new stdClass();
|
|
|
|
// If data was already input, we define them in obj to populate input fields.
|
|
|
|
// If data was already input, we define them in obj to populate input fields.
|
|
|
|
@@ -1632,10 +1639,10 @@ if ($id)
|
|
|
|
if ($obj->code == 'RECEP') $canbemodified=1;
|
|
|
|
if ($obj->code == 'RECEP') $canbemodified=1;
|
|
|
|
if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm") $canbemodified=1;
|
|
|
|
if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm") $canbemodified=1;
|
|
|
|
|
|
|
|
|
|
|
|
// Url
|
|
|
|
// Build Url. The table is id=, the id of line is rowid=
|
|
|
|
$rowidcol=$tabrowid[$id];
|
|
|
|
$rowidcol=$tabrowid[$id];
|
|
|
|
// If rowidcol not defined
|
|
|
|
// If rowidcol not defined
|
|
|
|
if (empty($rowidcol) || in_array($id, array(6,7,8,13,17,19,27))) $rowidcol='rowid';
|
|
|
|
if (empty($rowidcol) || in_array($id, array(6,7,8,13,17,19,27,32))) $rowidcol='rowid';
|
|
|
|
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((! empty($obj->{$rowidcol}) || $obj->{$rowidcol} == '0')?$obj->{$rowidcol}:(! empty($obj->code)?urlencode($obj->code):'')).'&code='.(! empty($obj->code)?urlencode($obj->code):'');
|
|
|
|
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((! empty($obj->{$rowidcol}) || $obj->{$rowidcol} == '0')?$obj->{$rowidcol}:(! empty($obj->code)?urlencode($obj->code):'')).'&code='.(! empty($obj->code)?urlencode($obj->code):'');
|
|
|
|
if (! empty($param)) $url .= '&'.$param;
|
|
|
|
if (! empty($param)) $url .= '&'.$param;
|
|
|
|
if (! is_null($withentity)) $url .= '&entity='.$withentity;
|
|
|
|
if (! is_null($withentity)) $url .= '&entity='.$withentity;
|
|
|
|
@@ -1971,7 +1978,6 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
$fieldValue = isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'';
|
|
|
|
$fieldValue = isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'';
|
|
|
|
|
|
|
|
|
|
|
|
if ($fieldlist[$field]=='sortorder')
|
|
|
|
if ($fieldlist[$field]=='sortorder')
|
|
|
|
@@ -1981,11 +1987,11 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|
|
|
|
|
|
|
|
|
|
|
$classtd=''; $class='';
|
|
|
|
$classtd=''; $class='';
|
|
|
|
if ($fieldlist[$field]=='code') $class='maxwidth100';
|
|
|
|
if ($fieldlist[$field]=='code') $class='maxwidth100';
|
|
|
|
if (in_array($fieldlist[$field], array('pos', 'use_default', 'affect', 'delay', 'position', 'sortorder', 'sens', 'category_type'))) $class='maxwidth50';
|
|
|
|
if (in_array($fieldlist[$field], array('dayrule', 'day', 'month', 'year', 'pos', 'use_default', 'affect', 'delay', 'position', 'sortorder', 'sens', 'category_type'))) $class='maxwidth50';
|
|
|
|
if (in_array($fieldlist[$field], array('libelle', 'label', 'tracking'))) $class='quatrevingtpercent';
|
|
|
|
if (in_array($fieldlist[$field], array('libelle', 'label', 'tracking'))) $class='quatrevingtpercent';
|
|
|
|
print '<td class="'.$classtd.'">';
|
|
|
|
print '<td class="'.$classtd.'">';
|
|
|
|
$transfound=0;
|
|
|
|
$transfound=0;
|
|
|
|
if (in_array($fieldlist[$field], array('label','libelle')))
|
|
|
|
if (in_array($fieldlist[$field], array('label','libelle'))) // For label
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$transkey='';
|
|
|
|
$transkey='';
|
|
|
|
// Special case for labels
|
|
|
|
// Special case for labels
|
|
|
|
|