Fix: indent
This commit is contained in:
parent
817e653519
commit
f77911f25f
@ -345,45 +345,45 @@ $elementList = array();
|
||||
$sourceList=array();
|
||||
if ($id == 11)
|
||||
{
|
||||
$langs->load("orders");
|
||||
$langs->load("contracts");
|
||||
$langs->load("projects");
|
||||
$langs->load("propal");
|
||||
$langs->load("bills");
|
||||
$langs->load("interventions");
|
||||
$elementList = array(
|
||||
'commande' => $langs->trans('Order'),
|
||||
'invoice_supplier' => $langs->trans('SupplierBill'),
|
||||
'order_supplier' => $langs->trans('SupplierOrder'),
|
||||
'contrat' => $langs->trans('Contract'),
|
||||
'project' => $langs->trans('Project'),
|
||||
'project_task' => $langs->trans('Task'),
|
||||
'propal' => $langs->trans('Proposal'),
|
||||
'facture' => $langs->trans('Bill'),
|
||||
'facture_fourn' => $langs->trans('SupplierBill'),
|
||||
'fichinter' => $langs->trans('InterventionCard')
|
||||
);
|
||||
if (! empty($conf->global->MAIN_SUPPORT_CONTACT_TYPE_FOR_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty');
|
||||
$sourceList = array(
|
||||
'internal' => $langs->trans('Internal'),
|
||||
'external' => $langs->trans('External')
|
||||
);
|
||||
$langs->load("orders");
|
||||
$langs->load("contracts");
|
||||
$langs->load("projects");
|
||||
$langs->load("propal");
|
||||
$langs->load("bills");
|
||||
$langs->load("interventions");
|
||||
$elementList = array(
|
||||
'commande' => $langs->trans('Order'),
|
||||
'invoice_supplier' => $langs->trans('SupplierBill'),
|
||||
'order_supplier' => $langs->trans('SupplierOrder'),
|
||||
'contrat' => $langs->trans('Contract'),
|
||||
'project' => $langs->trans('Project'),
|
||||
'project_task' => $langs->trans('Task'),
|
||||
'propal' => $langs->trans('Proposal'),
|
||||
'facture' => $langs->trans('Bill'),
|
||||
'facture_fourn' => $langs->trans('SupplierBill'),
|
||||
'fichinter' => $langs->trans('InterventionCard')
|
||||
);
|
||||
if (! empty($conf->global->MAIN_SUPPORT_CONTACT_TYPE_FOR_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty');
|
||||
$sourceList = array(
|
||||
'internal' => $langs->trans('Internal'),
|
||||
'external' => $langs->trans('External')
|
||||
);
|
||||
}
|
||||
|
||||
// Define localtax_typeList (used for dictionnary "c_tva")
|
||||
$localtax_typeList = array();
|
||||
if (GETPOST("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"),
|
||||
"7" => $langs->trans("Yes").' ('.$langs->trans("Type")." 7)" //$langs->trans("AmountOnOrder") // We will enable this later. For the moment, work only of invoice localtype
|
||||
);
|
||||
$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"),
|
||||
"7" => $langs->trans("Yes").' ('.$langs->trans("Type")." 7)" //$langs->trans("AmountOnOrder") // We will enable this later. For the moment, work only of invoice localtype
|
||||
);
|
||||
}
|
||||
$msg='';
|
||||
|
||||
@ -465,14 +465,14 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
// Add new entry
|
||||
$sql = "INSERT INTO ".$tabname[$id]." (";
|
||||
// List of fields
|
||||
if ($tabrowid[$id] &&
|
||||
! in_array($tabrowid[$id],$listfieldinsert)) $sql.= $tabrowid[$id].",";
|
||||
if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert))
|
||||
$sql.= $tabrowid[$id].",";
|
||||
$sql.= $tabfieldinsert[$id];
|
||||
$sql.=",active)";
|
||||
$sql.= " VALUES(";
|
||||
// List of values
|
||||
if ($tabrowid[$id] &&
|
||||
! in_array($tabrowid[$id],$listfieldinsert)) $sql.= $newid.",";
|
||||
if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert))
|
||||
$sql.= $newid.",";
|
||||
$i=0;
|
||||
foreach ($listfieldinsert as $f => $value)
|
||||
{
|
||||
@ -517,7 +517,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
// Modify entry
|
||||
$sql = "UPDATE ".$tabname[$id]." SET ";
|
||||
// Modifie valeur des champs
|
||||
if ($tabrowid[$id] && !in_array($tabrowid[$id],$listfieldmodify))
|
||||
if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldmodify))
|
||||
{
|
||||
$sql.= $tabrowid[$id]."=";
|
||||
$sql.= "'".$db->escape($rowid)."', ";
|
||||
@ -778,7 +778,7 @@ if ($id)
|
||||
print '<td colspan="3" align="right"><input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'"></td>';
|
||||
print "</tr>";
|
||||
|
||||
if ($alabelisused) // Si un des champs est un libelle
|
||||
if (! empty($alabelisused)) // Si un des champs est un libelle
|
||||
{
|
||||
print '<tr><td colspan="'.(count($fieldlist)+2).'">* '.$langs->trans("LabelUsedByDefault").'.</td></tr>';
|
||||
}
|
||||
@ -922,7 +922,7 @@ if ($id)
|
||||
else
|
||||
{
|
||||
$key=$langs->trans("Country".strtoupper($obj->pays_code));
|
||||
$valuetoshow=($key != "Country".strtoupper($obj->pays_code))?$obj->pays_code." - ".$key:$obj->pays;
|
||||
$valuetoshow=($key != "Country".strtoupper($obj->pays_code)?$obj->pays_code." - ".$key:$obj->pays);
|
||||
}
|
||||
}
|
||||
else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm' || $fieldlist[$field] == 'deductible') {
|
||||
@ -935,55 +935,55 @@ if ($id)
|
||||
else if ($fieldlist[$field]=='libelle_facture') {
|
||||
$langs->load("bills");
|
||||
$key=$langs->trans("PaymentCondition".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||
$valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
$valuetoshow=nl2br($valuetoshow);
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_pays') {
|
||||
$key=$langs->trans("Country".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_availability') {
|
||||
$langs->load("propal");
|
||||
$key=$langs->trans("AvailabilityType".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||
$valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_actioncomm') {
|
||||
$key=$langs->trans("Action".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||
$valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
else if (! empty($obj->code_iso) && $fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_currencies') {
|
||||
$key=$langs->trans("Currency".strtoupper($obj->code_iso));
|
||||
$valuetoshow=($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso))?$key:$obj->$fieldlist[$field];
|
||||
$valuetoshow=($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_typent') {
|
||||
$key=$langs->trans(strtoupper($obj->code));
|
||||
$valuetoshow=($key != strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||
$valuetoshow=($key != strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_prospectlevel') {
|
||||
$key=$langs->trans(strtoupper($obj->code));
|
||||
$valuetoshow=($key != strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||
$valuetoshow=($key != strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_civilite') {
|
||||
$key=$langs->trans("Civility".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||
$valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_type_contact') {
|
||||
$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->$fieldlist[$field];
|
||||
$valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_payment_term') {
|
||||
$langs->load("bills");
|
||||
$key=$langs->trans("PaymentConditionShort".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||
$valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_paiement') {
|
||||
$langs->load("bills");
|
||||
$key=$langs->trans("PaymentType".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||
$valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_input_reason') {
|
||||
$key=$langs->trans("DemandReasonType".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||
$valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_input_method') {
|
||||
$langs->load("orders");
|
||||
@ -993,18 +993,18 @@ if ($id)
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_shipment_mode') {
|
||||
$langs->load("sendings");
|
||||
$key=$langs->trans("SendingMethod".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||
$valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field] == 'libelle' && $tabname[$_GET['id']]==MAIN_DB_PREFIX.'c_paper_format')
|
||||
{
|
||||
$key = $langs->trans('PaperFormat'.strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && ($key != 'PaperFormat'.strtoupper($obj->code))) ? $key : $obj->$fieldlist[$field];
|
||||
$valuetoshow = ($obj->code && $key != 'PaperFormat'.strtoupper($obj->code) ? $key : $obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field] == 'libelle' && $tabname[$_GET['id']] == MAIN_DB_PREFIX.'c_type_fees')
|
||||
{
|
||||
$langs->load('trips');
|
||||
$key = $langs->trans(strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && ($key != strtoupper($obj->code))) ? $key : $obj->$fieldlist[$field];
|
||||
$valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') {
|
||||
$showfield=0;
|
||||
@ -1016,7 +1016,7 @@ if ($id)
|
||||
else if (($fieldlist[$field] == 'unit') && ($tabname[$_GET['id']] == MAIN_DB_PREFIX.'c_paper_format'))
|
||||
{
|
||||
$key = $langs->trans('SizeUnit'.strtolower($obj->unit));
|
||||
$valuetoshow = ($obj->code && ($key != 'SizeUnit'.strtolower($obj->unit))) ? $key : $obj->$fieldlist[$field];
|
||||
$valuetoshow = ($obj->code && $key != 'SizeUnit'.strtolower($obj->unit) ? $key : $obj->$fieldlist[$field]);
|
||||
}
|
||||
|
||||
else if ($fieldlist[$field]=='localtax1_type') {
|
||||
@ -1170,109 +1170,110 @@ $db->close();
|
||||
*/
|
||||
function fieldList($fieldlist,$obj='',$tabname='')
|
||||
{
|
||||
global $conf,$langs,$db;
|
||||
global $form;
|
||||
global $region_id;
|
||||
global $elementList,$sourceList,$localtax_typeList;
|
||||
global $conf,$langs,$db;
|
||||
global $form;
|
||||
global $region_id;
|
||||
global $elementList,$sourceList,$localtax_typeList;
|
||||
|
||||
$formadmin = new FormAdmin($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
$formadmin = new FormAdmin($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
if ($fieldlist[$field] == 'pays') {
|
||||
if (in_array('region_id',$fieldlist)) { print '<td> </td>'; continue; } // For region page, we do not show the country input
|
||||
print '<td>';
|
||||
print $form->select_country((! empty($obj->pays_code)?$obj->pays_code:(! empty($obj->pays)?$obj->pays:'')),'pays');
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'pays_id') {
|
||||
$pays_id = (! empty($obj->$fieldlist[$field])) ? $obj->$fieldlist[$field] : 0;
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$pays_id.'">';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'region') {
|
||||
print '<td>';
|
||||
$formcompany->select_region($region_id,'region');
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'region_id') {
|
||||
$region_id = (! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:0);
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$region_id.'">';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'lang') {
|
||||
print '<td>';
|
||||
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT,'lang');
|
||||
print '</td>';
|
||||
}
|
||||
// Le type de l'element (pour les type de contact).'
|
||||
elseif ($fieldlist[$field] == 'element')
|
||||
{
|
||||
print '<td>';
|
||||
print $form->selectarray('element', $elementList,(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:''));
|
||||
print '</td>';
|
||||
}
|
||||
// La source de l'element (pour les type de contact).'
|
||||
elseif ($fieldlist[$field] == 'source')
|
||||
{
|
||||
print '<td>';
|
||||
print $form->selectarray('source', $sourceList,(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:''));
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm")
|
||||
{
|
||||
print '<td>';
|
||||
print 'user<input type="hidden" name="type" value="user">';
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'fdm' || $fieldlist[$field] == 'deductible') {
|
||||
print '<td>';
|
||||
print $form->selectyesno($fieldlist[$field],(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:''),1);
|
||||
print '</td>';
|
||||
}
|
||||
elseif (in_array($fieldlist[$field],array('nbjour','decalage','taux','localtax1','localtax2'))) {
|
||||
$align="left";
|
||||
if (in_array($fieldlist[$field],array('taux','localtax1','localtax2'))) $align="right"; // Fields aligned on right
|
||||
print '<td align="'.$align.'">';
|
||||
print '<input type="text" class="flat" value="'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" size="3" name="'.$fieldlist[$field].'">';
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'libelle_facture') {
|
||||
print '<td><textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'</textarea></td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i',$fieldlist[$field])) {
|
||||
print '<td><input type="text" class="flat" value="'.price((! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'')).'" size="8" name="'.$fieldlist[$field].'"></td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'code' && isset($obj->$fieldlist[$field])) {
|
||||
print '<td><input type="text" class="flat" value="'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" size="10" name="'.$fieldlist[$field].'"></td>';
|
||||
}
|
||||
elseif ($fieldlist[$field]=='unit') {
|
||||
print '<td>';
|
||||
print $form->selectarray('unit', array(
|
||||
'mm' => $langs->trans('SizeUnitmm'),
|
||||
'cm' => $langs->trans('SizeUnitcm'),
|
||||
'point' => $langs->trans('SizeUnitpoint'),
|
||||
'inch' => $langs->trans('SizeUnitinch')
|
||||
), (! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:''), 0, 0, 0);
|
||||
print '</td>';
|
||||
}
|
||||
// Le type de taxe locale
|
||||
elseif ($fieldlist[$field] == 'localtax1_type' || $fieldlist[$field] == 'localtax2_type')
|
||||
{
|
||||
print '<td align="center">';
|
||||
print $form->selectarray($fieldlist[$field], $localtax_typeList,$obj->$fieldlist[$field]);
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>';
|
||||
$size='';
|
||||
if ($fieldlist[$field]=='libelle') $size='size="32" ';
|
||||
if ($fieldlist[$field]=='accountancy_code_sell') $size='size="15" ';
|
||||
if ($fieldlist[$field]=='accountancy_code_buy') $size='size="15" ';
|
||||
print '<input type="text" '.$size.' class="flat" value="'.(isset($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" name="'.$fieldlist[$field].'">';
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
if ($fieldlist[$field] == 'pays') {
|
||||
if (in_array('region_id',$fieldlist)) { print '<td> </td>'; continue; } // For region page, we do not show the country input
|
||||
print '<td>';
|
||||
print $form->select_country((! empty($obj->pays_code)?$obj->pays_code:(! empty($obj->pays)?$obj->pays:'')),'pays');
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'pays_id') {
|
||||
$pays_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$pays_id.'">';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'region') {
|
||||
print '<td>';
|
||||
$formcompany->select_region($region_id,'region');
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'region_id') {
|
||||
$region_id = (! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:0);
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$region_id.'">';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'lang') {
|
||||
print '<td>';
|
||||
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT,'lang');
|
||||
print '</td>';
|
||||
}
|
||||
// Le type de l'element (pour les type de contact)
|
||||
elseif ($fieldlist[$field] == 'element')
|
||||
{
|
||||
print '<td>';
|
||||
print $form->selectarray('element', $elementList,(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:''));
|
||||
print '</td>';
|
||||
}
|
||||
// La source de l'element (pour les type de contact)
|
||||
elseif ($fieldlist[$field] == 'source')
|
||||
{
|
||||
print '<td>';
|
||||
print $form->selectarray('source', $sourceList,(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:''));
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm")
|
||||
{
|
||||
print '<td>';
|
||||
print 'user<input type="hidden" name="type" value="user">';
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'fdm' || $fieldlist[$field] == 'deductible') {
|
||||
print '<td>';
|
||||
print $form->selectyesno($fieldlist[$field],(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:''),1);
|
||||
print '</td>';
|
||||
}
|
||||
elseif (in_array($fieldlist[$field],array('nbjour','decalage','taux','localtax1','localtax2'))) {
|
||||
$align="left";
|
||||
if (in_array($fieldlist[$field],array('taux','localtax1','localtax2'))) $align="right"; // Fields aligned on right
|
||||
print '<td align="'.$align.'">';
|
||||
print '<input type="text" class="flat" value="'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" size="3" name="'.$fieldlist[$field].'">';
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'libelle_facture') {
|
||||
print '<td><textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'</textarea></td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i',$fieldlist[$field])) {
|
||||
print '<td><input type="text" class="flat" value="'.price((! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'')).'" size="8" name="'.$fieldlist[$field].'"></td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'code' && isset($obj->$fieldlist[$field])) {
|
||||
print '<td><input type="text" class="flat" value="'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" size="10" name="'.$fieldlist[$field].'"></td>';
|
||||
}
|
||||
elseif ($fieldlist[$field]=='unit') {
|
||||
print '<td>';
|
||||
$units = array(
|
||||
'mm' => $langs->trans('SizeUnitmm'),
|
||||
'cm' => $langs->trans('SizeUnitcm'),
|
||||
'point' => $langs->trans('SizeUnitpoint'),
|
||||
'inch' => $langs->trans('SizeUnitinch')
|
||||
);
|
||||
print $form->selectarray('unit', $units, (! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:''), 0, 0, 0);
|
||||
print '</td>';
|
||||
}
|
||||
// Le type de taxe locale
|
||||
elseif ($fieldlist[$field] == 'localtax1_type' || $fieldlist[$field] == 'localtax2_type')
|
||||
{
|
||||
print '<td align="center">';
|
||||
print $form->selectarray($fieldlist[$field], $localtax_typeList,$obj->$fieldlist[$field]);
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>';
|
||||
$size='';
|
||||
if ($fieldlist[$field]=='libelle') $size='size="32" ';
|
||||
if ($fieldlist[$field]=='accountancy_code_sell') $size='size="15" ';
|
||||
if ($fieldlist[$field]=='accountancy_code_buy') $size='size="15" ';
|
||||
print '<input type="text" '.$size.' class="flat" value="'.(isset($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" name="'.$fieldlist[$field].'">';
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user