From 5d2d0384f819af7d5755d6e4d7deeff1048e274b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Jul 2022 17:05:02 +0200 Subject: [PATCH] Debug v16 --- htdocs/admin/dict.php | 46 ++++++++++--------- .../modules/modEventOrganization.class.php | 2 +- .../conferenceorbooth_card.php | 3 ++ .../conferenceorboothattendee_list.php | 2 +- ...ventorganization_conferenceorbooth.lib.php | 12 ++--- htdocs/projet/card.php | 21 ++++++--- htdocs/public/project/suggestbooth.php | 6 +-- htdocs/public/project/suggestconference.php | 6 +-- 8 files changed, 56 insertions(+), 42 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 38fbfec8c87..dd29ee1cde3 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -622,34 +622,33 @@ $sourceList = array(); if ($id == 11) { $elementList = array( '' => '', - 'societe' => $langs->trans('ThirdParty'), + 'agenda' => img_picto('', 'action', 'class="pictofixedwidth"').$langs->trans('Agenda'), + 'dolresource' => img_picto('', 'resource', 'class="pictofixedwidth"').$langs->trans('Resource'), + 'societe' => img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans('ThirdParty'), // 'proposal' => $langs->trans('Proposal'), // 'order' => $langs->trans('Order'), // 'invoice' => $langs->trans('Bill'), - 'supplier_proposal' => $langs->trans('SupplierProposal'), - 'order_supplier' => $langs->trans('SupplierOrder'), - 'invoice_supplier' => $langs->trans('SupplierBill'), // 'intervention' => $langs->trans('InterventionCard'), // 'contract' => $langs->trans('Contract'), - 'project' => $langs->trans('Project'), - 'project_task' => $langs->trans('Task'), - 'ticket' => $langs->trans('Ticket'), - 'agenda' => $langs->trans('Agenda'), - 'dolresource' => $langs->trans('Resource'), - // old deprecated - 'propal' => $langs->trans('Proposal'), - 'commande' => $langs->trans('Order'), - 'facture' => $langs->trans('Bill'), - 'fichinter' => $langs->trans('InterventionCard'), - 'contrat' => $langs->trans('Contract'), + 'project' => img_picto('', 'project', 'class="pictofixedwidth"').$langs->trans('Project'), + 'project_task' => img_picto('', 'projecttask', 'class="pictofixedwidth"').$langs->trans('Task'), + 'propal' => img_picto('', 'propal', 'class="pictofixedwidth"').$langs->trans('Proposal'), + 'commande' => img_picto('', 'order', 'class="pictofixedwidth"').$langs->trans('Order'), + 'facture' => img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans('Bill'), + 'fichinter' => img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterventionCard'), + 'contrat' => img_picto('', 'contract', 'class="pictofixedwidth"').$langs->trans('Contract'), + 'ticket' => img_picto('', 'ticket', 'class="pictofixedwidth"').$langs->trans('Ticket'), + 'supplier_proposal' => img_picto('', 'supplier_proposal', 'class="pictofixedwidth"').$langs->trans('SupplierProposal'), + 'order_supplier' => img_picto('', 'supplier_order', 'class="pictofixedwidth"').$langs->trans('SupplierOrder'), + 'invoice_supplier' => img_picto('', 'supplier_invoice', 'class="pictofixedwidth"').$langs->trans('SupplierBill'), ); - if (!empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) { - $elementList["societe"] = $langs->trans('ThirdParty'); + if (!empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2) { + $elementList['conferenceorbooth'] = img_picto('', 'eventorganization', 'class="pictofixedwidth"').$langs->trans('ConferenceOrBooth'); } complete_elementList_with_modules($elementList); - asort($elementList); + //asort($elementList); $sourceList = array( 'internal' => $langs->trans('Internal'), 'external' => $langs->trans('External') @@ -1202,7 +1201,6 @@ if (GETPOST('from')) { if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'rowid='.urlencode($rowid).'&code='.urlencode($code).$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } -//var_dump($elementList); /* @@ -1960,7 +1958,7 @@ if ($id > 0) { $valuetoshow = price($valuetoshow); } if ($value == 'private') { - $valuetoshow = yn($elementList[$valuetoshow]); + $valuetoshow = yn($valuetoshow); } elseif ($value == 'libelle_facture') { $langs->load("bills"); $key = $langs->trans("PaymentCondition".strtoupper($obj->code)); @@ -2376,8 +2374,14 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang'); print ''; } elseif (in_array($value, array('element', 'source'))) { // Example: the type and source of the element (for contact types) + $tmparray = array(); + if ($value == 'element') { + $tmparray = $elementList; + } else { + $tmparray = $sourceList; + } print ''; - print $form->selectarray($value, $elementList, (!empty($obj->{$value}) ? $obj->{$value}:'')); + print $form->selectarray($value, $tmparray, (!empty($obj->{$value}) ? $obj->{$value}:''), 0, 0, 0, '', 0, 0, 0, '', 'maxwidth250'); print ''; } elseif (in_array($value, array('public', 'use_default'))) { // Fields 0/1 with a combo select Yes/No diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php index 5dd212b355d..a7a6c048a4d 100644 --- a/htdocs/core/modules/modEventOrganization.class.php +++ b/htdocs/core/modules/modEventOrganization.class.php @@ -258,7 +258,7 @@ class modEventOrganization extends DolibarrModules 'fk_menu'=>'fk_mainmenu=project,fk_leftmenu=eventorganization', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Left menu entry 'titre'=>'New', - 'url'=>'/projet/card.php?leftmenu=projects&action=create&usage_organize_event=1', + 'url'=>'/projet/card.php?leftmenu=projects&action=create&usage_organize_event=1&usage_opportunity=0', 'langs'=>'eventorganization@eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>1000+$r, 'enabled'=>'$conf->eventorganization->enabled', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 0d5991bb0ac..ac64a16602f 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -185,7 +185,9 @@ if (!empty($withproject)) { // Tabs for project $tab = 'eventorganisation'; $withProjectUrl = "&withproject=1"; + $head = project_prepare_head($projectstatic); + print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', ''); $param = ($mode == 'mine' ? '&mode=mine' : ''); @@ -468,6 +470,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $res = $object->fetch_optionals(); $head = conferenceorboothPrepareHead($object, $withproject); + print dol_get_fiche_head($head, 'card', $langs->trans("ConferenceOrBooth"), -1, $object->picto); $formconfirm = ''; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 972e546255f..c1626f7bbf3 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -947,7 +947,7 @@ if ($num == 0) { $colspan++; } } - print ''.$langs->trans("NoRecordFound").''; + print ''.$langs->trans("NoRecordFound").''; } diff --git a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php index 6a76a14a38c..8d0f442e900 100644 --- a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php +++ b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php @@ -47,12 +47,12 @@ function conferenceorboothPrepareHead($object, $with_project = 0) $head[$h][2] = 'card'; $h++; - /* - $head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_contact.php?id='.$object->id.$withProjectUrl; - $head[$h][1] = $langs->trans("ContactsAddresses"); - $head[$h][2] = 'contact'; - $h++; - */ + if (!empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2) { + $head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_contact.php?id='.$object->id.$withProjectUrl; + $head[$h][1] = $langs->trans("ContactsAddresses"); + $head[$h][2] = 'contact'; + $h++; + } /* $head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php?conforboothid='.$object->id.$withProjectUrl; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 1e9fd292c69..aabf14e8655 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -563,7 +563,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; print ''; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print ' '; + print ' '; $htmltext = $langs->trans("ProjectFollowOpportunity"); print ''; print ''; print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print ' '; + print ' '; $htmltext = $langs->trans("ProjectFollowTasks"); print ''; print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print ' '; + print ' '; $htmltext = $langs->trans("ProjectBillTimeDescription"); print ''; print '
'; } if (!empty($conf->eventorganization->enabled)) { - print ' '; + print ' '; $htmltext = $langs->trans("EventOrganizationDescriptionLong"); print ''; } @@ -734,7 +738,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; - // Change probability from status + // Change probability from status or role of project print ''; print '
'; diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index cb1b1089b0c..52193e4fcd4 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -101,7 +101,7 @@ $extrafields = new ExtraFields($db); $user->loadDefaultValues(); $cactioncomm = new CActionComm($db); -$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, "module='booth@eventorganization'"); +$arrayofconfboothtype = $cactioncomm->liste_array('', 'id', '', 0, "module='booth@eventorganization'"); // Security check if (empty($conf->eventorganization->enabled)) { @@ -612,8 +612,8 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print ''; } // Type of event -print ''.$langs->trans("EventType").'*'."\n"; -print ''.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).''; +print ''.$langs->trans("Format").'*'."\n"; +print ''.Form::selectarray('eventtype', $arrayofconfboothtype, $eventtype, 1).''; // Label print ''.$langs->trans("LabelOfBooth").'*'."\n"; print ''."\n"; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index ca34a05253d..05cc8e61a82 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -102,7 +102,7 @@ $extrafields = new ExtraFields($db); $user->loadDefaultValues(); $cactioncomm = new CActionComm($db); -$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, "module='conference@eventorganization'"); +$arrayofconfboothtype = $cactioncomm->liste_array('', 'id', '', 0, "module='conference@eventorganization'"); // Security check if (empty($conf->eventorganization->enabled)) { @@ -546,8 +546,8 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print ''; } // Type of event -print ''.$langs->trans("EventType").'*'."\n"; -print ''.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).''; +print ''.$langs->trans("Format").'*'."\n"; +print ''.Form::selectarray('eventtype', $arrayofconfboothtype, $eventtype, 1).''; // Label print ''.$langs->trans("LabelOfconference").'*'."\n"; print ''."\n";