add dolBuildUrl with examples of use (#35549)

* add dol_buildurl with examples of use

* add dol_buildurl with examples of use

* add dol_buildurl with examples of use

* add dol_buildurl with examples of use

* wip

* wip

* add more example

* add more example

* add more example

* add more example

* add more example

* add more example

* add more example

* add example

* add example

* add example

* add example

* add example

* stay in the same area even we are on other area in other tab

* stay in the same area even we are on other area in other tab

* stay in the same area even we are on other area in other tab

* stay in the same area even we are on other area in other tab

* stay in the same area even we are on other area in other tab

* stay in the same area even we are on other area in other tab

* stay in the same area even we are on other area in other tab

* stay in the same area even we are on other area in other tab

* stay in the same area even we are on other area in other tab

* stay in the same area even we are on other area in other tab

* stay in the same area even we are on other area in other tab

* clean code

* clean code

* clean code

* clean code

* clean code

* clean code

* clean code

* add example

* add example

* add example

* add example

* add example

* add example

add example

add example

add example

add example

* add example

* add example

add example

add example

add example

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* clean code

* clean code

* clean code

* clean code

* clean code

* clean code

* clean code

* clean code

* clean code

* clean code

* fix

* wip

* wip

* clean code
This commit is contained in:
Frédéric FRANCE
2025-10-06 18:17:02 +02:00
committed by GitHub
parent 10deeef770
commit 2078610328
38 changed files with 558 additions and 484 deletions

View File

@@ -42,13 +42,13 @@ function myobjectPrepareHead($object)
$h = 0;
$head = array();
$head[$h][0] = dol_buildpath("/mymodule/myobject_card.php", 1).'?id='.$object->id;
$head[$h][0] = dolBuildUrl(dol_buildpath("/mymodule/myobject_card.php", 1), ['id' => $object->id]);
$head[$h][1] = $langs->trans("MyObject");
$head[$h][2] = 'card';
$h++;
if ($showtabofpagecontact) {
$head[$h][0] = dol_buildpath("/mymodule/myobject_contact.php", 1).'?id='.$object->id;
$head[$h][0] = dolBuildUrl(dol_buildpath("/mymodule/myobject_contact.php", 1), ['id' => $object->id]);
$head[$h][1] = $langs->trans("Contacts");
$head[$h][2] = 'contact';
$h++;
@@ -63,7 +63,7 @@ function myobjectPrepareHead($object)
if (!empty($object->note_public)) {
$nbNote++;
}
$head[$h][0] = dol_buildpath('/mymodule/myobject_note.php', 1).'?id='.$object->id;
$head[$h][0] = dolBuildUrl(dol_buildpath('/mymodule/myobject_note.php', 1), ['id' => $object->id]);
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) {
$head[$h][1] .= (!getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
@@ -79,7 +79,7 @@ function myobjectPrepareHead($object)
$upload_dir = $conf->mymodule->dir_output."/myobject/".dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
$nbLinks = Link::count($db, $object->element, $object->id);
$head[$h][0] = dol_buildpath("/mymodule/myobject_document.php", 1).'?id='.$object->id;
$head[$h][0] = dolBuildUrl(dol_buildpath("/mymodule/myobject_document.php", 1), ['id' => $object->id]);
$head[$h][1] = $langs->trans('Documents');
if (($nbFiles + $nbLinks) > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
@@ -89,7 +89,7 @@ function myobjectPrepareHead($object)
}
if ($showtabofpageagenda) {
$head[$h][0] = dol_buildpath("/mymodule/myobject_agenda.php", 1).'?id='.$object->id;
$head[$h][0] = dolBuildUrl(dol_buildpath("/mymodule/myobject_agenda.php", 1), ['id' => $object->id]);
$head[$h][1] = $langs->trans("Events");
$head[$h][2] = 'agenda';
$h++;