Merge pull request #21936 from grandoc/new_branch_29_08_2022
update code
This commit is contained in:
commit
2b8c14e890
@ -124,7 +124,7 @@ class AgendaEvents extends DolibarrApi
|
||||
if (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) {
|
||||
$search_sale = DolibarrApiAccess::$user->id;
|
||||
}
|
||||
if (empty($conf->societe->enabled)) {
|
||||
if (!isModEnabled('societe')) {
|
||||
$search_sale = 0; // If module thirdparty not enabled, sale representative is something that does not exists
|
||||
}
|
||||
|
||||
|
||||
@ -460,7 +460,7 @@ if ($action == 'create') {
|
||||
print $form->selectyesno("public", $public_donation, 1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
if (empty($conf->societe->enabled) || empty($conf->global->DONATION_USE_THIRDPARTIES)) {
|
||||
if (!isModEnabled('societe') || empty($conf->global->DONATION_USE_THIRDPARTIES)) {
|
||||
print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" value="'.dol_escape_htmltag(GETPOST("societe")).'" class="maxwidth200"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" value="'.dol_escape_htmltag(GETPOST("lastname")).'" class="maxwidth200"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" value="'.dol_escape_htmltag(GETPOST("firstname")).'" class="maxwidth200"></td></tr>';
|
||||
|
||||
@ -314,7 +314,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
|
||||
$rowspan++; $sectionauto[] = array('position'=>10, 'level'=>1, 'module'=>'product', 'test'=>(isModEnabled("product") || isModEnabled("service")), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts"));
|
||||
}
|
||||
if (isModEnabled("societe")) {
|
||||
$rowspan++; $sectionauto[] = array('position'=>20, 'level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
|
||||
$rowspan++; $sectionauto[] = array('position'=>20, 'level'=>1, 'module'=>'company', 'test'=>isModEnabled('societe'), 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
|
||||
}
|
||||
if (isModEnabled("propal")) {
|
||||
$rowspan++; $sectionauto[] = array('position'=>30, 'level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
|
||||
|
||||
@ -117,7 +117,7 @@ if (isModEnabled("product") || isModEnabled("service")) {
|
||||
$langs->load("products"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'product', 'test'=>(isModEnabled("product") || isModEnabled("service")), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts"));
|
||||
}
|
||||
if (isModEnabled("societe")) {
|
||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
|
||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'company', 'test'=>isModEnabled('societe'), 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
|
||||
}
|
||||
if (isModEnabled("propal")) {
|
||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
|
||||
|
||||
@ -199,7 +199,7 @@ foreach ($object->fields as $key => $val) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
// Add non object fields to fields for list
|
||||
$arrayfields['s.nom'] = array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>21, 'enabled'=>(empty($conf->societe->enabled) ? 0 : 1));
|
||||
$arrayfields['s.nom'] = array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>21, 'enabled'=>(!isModEnabled('societe') ? 0 : 1));
|
||||
$arrayfields['s.name_alias'] = array('label'=>"AliasNameShort", 'checked'=>0, 'position'=>22);
|
||||
$arrayfields['commercial'] = array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>0, 'position'=>23);
|
||||
$arrayfields['c.assigned'] = array('label'=>$langs->trans("AssignedTo"), 'checked'=>-1, 'position'=>120);
|
||||
|
||||
@ -550,7 +550,7 @@ class Thirdparties extends DolibarrApi
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (empty($conf->societe->enabled)) {
|
||||
if (!isModEnabled('societe')) {
|
||||
throw new RestException(501, 'Module "Thirdparties" needed for this request');
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user