Debug v10
This commit is contained in:
parent
eab49d4300
commit
9115df7439
@ -652,6 +652,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder';
|
if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder';
|
||||||
if ($fieldnamekey == 'category_type') $fieldnamekey = 'Calculated';
|
if ($fieldnamekey == 'category_type') $fieldnamekey = 'Calculated';
|
||||||
if ($fieldnamekey == 'revenuestamp_type') $fieldnamekey = 'TypeOfRevenueStamp';
|
if ($fieldnamekey == 'revenuestamp_type') $fieldnamekey = 'TypeOfRevenueStamp';
|
||||||
|
if ($fieldnamekey == 'use_default') $fieldnamekey = 'UseByDefault';
|
||||||
|
|
||||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
||||||
}
|
}
|
||||||
@ -1053,11 +1054,12 @@ if ($id)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine le nom du champ par rapport aux noms possibles
|
// Define field friedly name from its technical name
|
||||||
// dans les dictionnaires de donnees
|
|
||||||
$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='';
|
||||||
|
|
||||||
|
if ($fieldlist[$field]=='pos') { $valuetoshow=$langs->trans("Position"); $class='width100'; }
|
||||||
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
||||||
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
||||||
if ($fieldlist[$field]=='taux') {
|
if ($fieldlist[$field]=='taux') {
|
||||||
@ -1125,6 +1127,7 @@ if ($id)
|
|||||||
if ($fieldlist[$field]=='range_ik') { $valuetoshow=$langs->trans("RangeIk"); }
|
if ($fieldlist[$field]=='range_ik') { $valuetoshow=$langs->trans("RangeIk"); }
|
||||||
if ($fieldlist[$field]=='fk_c_exp_tax_cat') { $valuetoshow=$langs->trans("CarCategory"); }
|
if ($fieldlist[$field]=='fk_c_exp_tax_cat') { $valuetoshow=$langs->trans("CarCategory"); }
|
||||||
if ($fieldlist[$field]=='revenuestamp_type') { $valuetoshow=$langs->trans('TypeOfRevenueStamp'); }
|
if ($fieldlist[$field]=='revenuestamp_type') { $valuetoshow=$langs->trans('TypeOfRevenueStamp'); }
|
||||||
|
if ($fieldlist[$field]=='use_default') { $valuetoshow=$langs->trans('Default'); }
|
||||||
|
|
||||||
if ($id == 2) // Special cas for state page
|
if ($id == 2) // Special cas for state page
|
||||||
{
|
{
|
||||||
@ -1197,8 +1200,10 @@ if ($id)
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from', 'alpha')).'">';
|
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from', 'alpha')).'">';
|
||||||
@ -1221,7 +1226,7 @@ if ($id)
|
|||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
// Title line with search boxes
|
// Title line with search input fields
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
$filterfound=0;
|
$filterfound=0;
|
||||||
foreach ($fieldlist as $field => $value)
|
foreach ($fieldlist as $field => $value)
|
||||||
@ -1276,17 +1281,12 @@ if ($id)
|
|||||||
// dans les dictionnaires de donnees
|
// dans les dictionnaires de donnees
|
||||||
$showfield=1; // By defaut
|
$showfield=1; // By defaut
|
||||||
$align="left";
|
$align="left";
|
||||||
|
$cssprefix='';
|
||||||
$sortable=1;
|
$sortable=1;
|
||||||
$valuetoshow='';
|
|
||||||
/*
|
|
||||||
$tmparray=getLabelOfField($fieldlist[$field]);
|
|
||||||
$showfield=$tmp['showfield'];
|
|
||||||
$valuetoshow=$tmp['valuetoshow'];
|
|
||||||
$align=$tmp['align'];
|
|
||||||
$sortable=$tmp['sortable'];
|
|
||||||
*/
|
|
||||||
$valuetoshow=ucfirst($fieldlist[$field]); // By defaut
|
$valuetoshow=ucfirst($fieldlist[$field]); // By defaut
|
||||||
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||||
|
|
||||||
|
// Special cases
|
||||||
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
||||||
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
||||||
if ($fieldlist[$field]=='taux') {
|
if ($fieldlist[$field]=='taux') {
|
||||||
@ -1304,10 +1304,7 @@ if ($id)
|
|||||||
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
|
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
|
||||||
if ($fieldlist[$field]=='position') { $align='right'; }
|
if ($fieldlist[$field]=='position') { $align='right'; }
|
||||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); }
|
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); }
|
||||||
if ($fieldlist[$field]=='libelle_facture') {
|
if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments"); }
|
||||||
//$valuetoshow=$form->textwithtooltip($langs->trans("LabelOnDocuments"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,''));
|
|
||||||
$valuetoshow=$langs->trans("LabelOnDocuments");
|
|
||||||
}
|
|
||||||
if ($fieldlist[$field]=='country') { $valuetoshow=$langs->trans("Country"); }
|
if ($fieldlist[$field]=='country') { $valuetoshow=$langs->trans("Country"); }
|
||||||
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $align="center"; }
|
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $align="center"; }
|
||||||
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
|
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
|
||||||
@ -1316,7 +1313,6 @@ if ($id)
|
|||||||
if ($fieldlist[$field]=='width' || $fieldlist[$field]=='nx') { $valuetoshow=$langs->trans("Width"); }
|
if ($fieldlist[$field]=='width' || $fieldlist[$field]=='nx') { $valuetoshow=$langs->trans("Width"); }
|
||||||
if ($fieldlist[$field]=='height' || $fieldlist[$field]=='ny') { $valuetoshow=$langs->trans("Height"); }
|
if ($fieldlist[$field]=='height' || $fieldlist[$field]=='ny') { $valuetoshow=$langs->trans("Height"); }
|
||||||
if ($fieldlist[$field]=='unit' || $fieldlist[$field]=='metric') { $valuetoshow=$langs->trans("MeasuringUnit"); }
|
if ($fieldlist[$field]=='unit' || $fieldlist[$field]=='metric') { $valuetoshow=$langs->trans("MeasuringUnit"); }
|
||||||
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; }
|
|
||||||
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
|
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
|
||||||
if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); $sortable=0; }
|
if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); $sortable=0; }
|
||||||
if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); $sortable=0; }
|
if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); $sortable=0; }
|
||||||
@ -1347,11 +1343,14 @@ if ($id)
|
|||||||
if ($fieldlist[$field]=='range_ik') { $valuetoshow=$langs->trans("RangeIk"); }
|
if ($fieldlist[$field]=='range_ik') { $valuetoshow=$langs->trans("RangeIk"); }
|
||||||
if ($fieldlist[$field]=='fk_c_exp_tax_cat') { $valuetoshow=$langs->trans("CarCategory"); }
|
if ($fieldlist[$field]=='fk_c_exp_tax_cat') { $valuetoshow=$langs->trans("CarCategory"); }
|
||||||
if ($fieldlist[$field]=='revenuestamp_type') { $valuetoshow=$langs->trans('TypeOfRevenueStamp'); }
|
if ($fieldlist[$field]=='revenuestamp_type') { $valuetoshow=$langs->trans('TypeOfRevenueStamp'); }
|
||||||
|
if ($fieldlist[$field]=='use_default') { $valuetoshow=$langs->trans('Default'); }
|
||||||
|
|
||||||
// Affiche nom du champ
|
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; }
|
||||||
|
|
||||||
|
// Show field title
|
||||||
if ($showfield)
|
if ($showfield)
|
||||||
{
|
{
|
||||||
print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "align=".$align, $sortfield, $sortorder);
|
print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "align=".$align, $sortfield, $sortorder, $cssprefix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Favorite - Only activated on country dictionary
|
// Favorite - Only activated on country dictionary
|
||||||
@ -1806,7 +1805,6 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||||||
if (in_array('region_id', $fieldlist))
|
if (in_array('region_id', $fieldlist))
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td>';
|
||||||
//print join(',',$fieldlist);
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
continue;
|
continue;
|
||||||
} // For state page, we do not show the country input (we link to region, not country)
|
} // For state page, we do not show the country input (we link to region, not country)
|
||||||
@ -1912,7 +1910,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||||||
print '<td><input type="text" class="flat minwidth75" value="'.price((! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')).'" name="'.$fieldlist[$field].'"></td>';
|
print '<td><input type="text" class="flat minwidth75" value="'.price((! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')).'" name="'.$fieldlist[$field].'"></td>';
|
||||||
}
|
}
|
||||||
elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
|
elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
|
||||||
print '<td class="maxxxx"><input type="text" class="flat minwidth75 maxwidth100" value="'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'"></td>';
|
print '<td><input type="text" class="flat minwidth75 maxwidth100" value="'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'"></td>';
|
||||||
}
|
}
|
||||||
elseif ($fieldlist[$field]=='unit') {
|
elseif ($fieldlist[$field]=='unit') {
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -1972,12 +1970,8 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||||||
|
|
||||||
$classtd=''; $class='';
|
$classtd=''; $class='';
|
||||||
if ($fieldlist[$field]=='code') $classtd='width100';
|
if ($fieldlist[$field]=='code') $classtd='width100';
|
||||||
if ($fieldlist[$field]=='affect') $class='maxwidth50';
|
if (in_array($fieldlist[$field], array('pos', 'use_default', 'affect', 'delay', 'position', 'sortorder', 'sens', 'category_type'))) $class='maxwidth50';
|
||||||
if ($fieldlist[$field]=='delay') $class='maxwidth50';
|
if (in_array($fieldlist[$field], array('libelle', 'label', 'tracking'))) $class='quatrevingtpercent';
|
||||||
if ($fieldlist[$field]=='position') $class='maxwidth50';
|
|
||||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $class='quatrevingtpercent';
|
|
||||||
if ($fieldlist[$field]=='tracking') $class='quatrevingtpercent';
|
|
||||||
if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $class='maxwidth50';
|
|
||||||
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')))
|
||||||
|
|||||||
@ -120,15 +120,16 @@ class modTicket extends DolibarrModules
|
|||||||
}
|
}
|
||||||
$this->dictionaries = array(
|
$this->dictionaries = array(
|
||||||
'langs' => 'ticket',
|
'langs' => 'ticket',
|
||||||
'tabname' => array(MAIN_DB_PREFIX . "c_ticket_type", MAIN_DB_PREFIX . "c_ticket_category", MAIN_DB_PREFIX . "c_ticket_severity"),
|
'tabname' => array(MAIN_DB_PREFIX . "c_ticket_type", MAIN_DB_PREFIX . "c_ticket_severity", MAIN_DB_PREFIX . "c_ticket_category"),
|
||||||
'tablib' => array("TicketDictType", "TicketDictCategory", "TicketDictSeverity"),
|
'tablib' => array("TicketDictType", "TicketDictSeverity", "TicketDictCategory"),
|
||||||
'tabsql' => array('SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_type as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_category as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_severity as f'),
|
'tabsql' => array('SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_type as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_severity as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_category as f'),
|
||||||
'tabsqlsort' => array("pos ASC", "pos ASC", "pos ASC"),
|
'tabsqlsort' => array("pos ASC", "pos ASC", "pos ASC"),
|
||||||
'tabfield' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"),
|
'tabfield' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"),
|
||||||
'tabfieldvalue' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"),
|
'tabfieldvalue' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"),
|
||||||
'tabfieldinsert' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"),
|
'tabfieldinsert' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"),
|
||||||
'tabrowid' => array("rowid", "rowid", "rowid"),
|
'tabrowid' => array("rowid", "rowid", "rowid"),
|
||||||
'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled),
|
'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled),
|
||||||
|
'tabhelp' => array(array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")), array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")), array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1"))),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Boxes
|
// Boxes
|
||||||
|
|||||||
@ -2789,7 +2789,7 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven"><td colspan="'.$nbcols.'" class="opacitymedium">'.$langs->trans("None").'</td><td></td><td></td></tr>';
|
print '<tr class="oddeven"><td colspan="'.$nbcols.'"><span class="opacitymedium">'.$langs->trans("None").'</span></td><td></td><td></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user