diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index ba2643a04b8..75d3be10444 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -736,11 +736,11 @@ if ($id) { if ($tabname[$id] == MAIN_DB_PREFIX.'c_email_templates' && $action == 'edit') { - fieldList($fieldlist,$obj,$tabname[$id],'hide'); + fieldListAccountModel($fieldlist,$obj,$tabname[$id],'hide'); } else { - fieldList($fieldlist,$obj,$tabname[$id],'add'); + fieldListAccountModel($fieldlist,$obj,$tabname[$id],'add'); } } @@ -928,7 +928,7 @@ if ($id) $reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; - if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit'); + if (empty($reshook)) fieldListAccountModel($fieldlist,$obj,$tabname[$id],'edit'); print ' '; print ' '; @@ -1252,7 +1252,7 @@ $db->close(); * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered * @return void */ -function fieldList($fieldlist, $obj='', $tabname='', $context='') +function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='') { global $conf,$langs,$db; global $form; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index bfd90b6909b..126c3fe0f62 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1039,6 +1039,11 @@ if ($id > 0) if (empty($reshook)) { + if ($object->status != 1) + { + print '
'.$langs->trans("ThirdPartyIsClosed").'
'; + } + if (! empty($conf->propal->enabled) && $user->rights->propal->creer && $object->status==1) { $langs->load("propal"); @@ -1072,16 +1077,12 @@ if ($id > 0) print '
'.$langs->trans("AddTrip").'
'; } - if (! empty($conf->facture->enabled)) + if (! empty($conf->facture->enabled) && $object->status==1) { if (empty($user->rights->facture->creer)) { print '
'.$langs->trans("AddBill").'
'; } - else if ($object->status != 1) - { - print '
'.$langs->trans("AddBill").'
'; - } else { $langs->load("bills"); @@ -1101,7 +1102,7 @@ if ($id > 0) } // Add action - if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) + if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status==1) { if ($user->rights->agenda->myactions->create) { diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 29d2a421b2b..f731fac1684 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -708,32 +708,37 @@ if ($object->id > 0) // modified by hook if (empty($reshook)) { - if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->creer) + if ($object->status != 1) + { + print '
'.$langs->trans("ThirdPartyIsClosed").'
'; + } + + if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->creer && $object->status==1) { $langs->load("supplier_proposal"); print ''.$langs->trans("AddSupplierProposal").''; } - if ($user->rights->fournisseur->commande->creer) + if ($user->rights->fournisseur->commande->creer && $object->status==1) { $langs->load("orders"); print ''.$langs->trans("AddOrder").''; } - if ($user->rights->fournisseur->facture->creer) + if ($user->rights->fournisseur->facture->creer && $object->status==1) { $langs->load("bills"); print ''.$langs->trans("AddBill").''; } - if ($user->rights->fournisseur->facture->creer) + if ($user->rights->fournisseur->facture->creer && $object->status==1) { if (! empty($orders2invoice) && $orders2invoice > 0) print '
'.$langs->trans("CreateInvoiceForThisCustomer").'
'; else print '
'.$langs->trans("CreateInvoiceForThisCustomer").'
'; } // Add action - if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) + if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status==1) { if ($user->rights->agenda->myactions->create) { @@ -750,29 +755,29 @@ if ($object->id > 0) print '
'; - if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB)) - { - print '
'; - // List of contacts - show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); - } + if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB)) + { + print '
'; + // List of contacts + show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); + } - // Addresses list - if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB)) - { - $result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); - } + // Addresses list + if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB)) + { + $result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); + } - if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) - { - print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); + if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) + { + print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); - // List of todo actions - show_actions_todo($conf,$langs,$db,$object); + // List of todo actions + show_actions_todo($conf,$langs,$db,$object); - // List of done actions - show_actions_done($conf,$langs,$db,$object); - } + // List of done actions + show_actions_done($conf,$langs,$db,$object); + } } else {