FIX If thirdparty module not enabled, we must hide thirdparty info.

This commit is contained in:
Laurent Destailleur 2016-03-25 19:42:14 +01:00
parent b42dbe5b37
commit 08e506874a
2 changed files with 26 additions and 20 deletions

View File

@ -462,10 +462,12 @@ if ($action == 'create' && $user->rights->projet->creer)
print '<tr><td><span class="fieldrequired">'.$langs->trans("Label").'</span></td><td><input size="80" type="text" name="title" value="'.GETPOST("title").'"></td></tr>'; print '<tr><td><span class="fieldrequired">'.$langs->trans("Label").'</span></td><td><input size="80" type="text" name="title" value="'.GETPOST("title").'"></td></tr>';
// Thirdparty // Thirdparty
if ($conf->societe->enabled)
{
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>'; print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
$filteronlist=''; $filteronlist='';
if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST; if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
$text=$form->select_thirdparty_list(GETPOST('socid','int'),'socid',$filteronlist,'SelectThirdParty',1); $text=$form->select_thirdparty_list(GETPOST('socid','int'), 'socid', $filteronlist, 'SelectThirdParty', 1, 0, array(), '', 0, 0, 'minwidth300');
if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile)) if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile))
{ {
$texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty"); $texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty");
@ -474,6 +476,7 @@ if ($action == 'create' && $user->rights->projet->creer)
else print $text; else print $text;
print ' <a href="'.DOL_URL_ROOT.'/societe/soc.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>'; print ' <a href="'.DOL_URL_ROOT.'/societe/soc.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print '</td></tr>'; print '</td></tr>';
}
// Status // Status
if ($status != '') if ($status != '')
@ -657,13 +660,16 @@ else
print '<td><input size="80" name="title" value="'.$object->title.'"></td></tr>'; print '<td><input size="80" name="title" value="'.$object->title.'"></td></tr>';
// Thirdparty // Thirdparty
if ($conf->societe->enabled)
{
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>'; print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
$filteronlist=''; $filteronlist='';
if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST; if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
$text=$form->select_thirdparty_list($object->thirdparty->id, 'socid', $filteronlist, 1, 1); $text=$form->select_thirdparty_list($object->thirdparty->id, 'socid', $filteronlist, 'SelectThirdParty', 1, 0, array(), '', 0, 0, 'minwidth300');
$texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty"); $texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty");
print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1, 0, '', '', 2); print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1, 0, '', '', 2);
print '</td></tr>'; print '</td></tr>';
}
// Visibility // Visibility
print '<tr><td>'.$langs->trans("Visibility").'</td><td>'; print '<tr><td>'.$langs->trans("Visibility").'</td><td>';

View File

@ -113,7 +113,7 @@ if (empty($user->socid)) $fieldstosearchall["p.note_private"]="NotePrivate";
$arrayfields=array( $arrayfields=array(
'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), 'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
'p.title'=>array('label'=>$langs->trans("Label"), 'checked'=>1), 'p.title'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1), 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'enabled'=>$conf->societe->enabled),
'commercial'=>array('label'=>$langs->trans("SalesRepresentative"), 'checked'=>1), 'commercial'=>array('label'=>$langs->trans("SalesRepresentative"), 'checked'=>1),
'p.dateo'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>100), 'p.dateo'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>100),
'p.datee'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1, 'position'=>101), 'p.datee'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1, 'position'=>101),