Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bd353ed
Handle bordereaudoc actions and email
mapiolca Dec 1, 2025
3ee88bd
Améliorer l'affichage et l'édition de la fiche bordereaudoc
mapiolca Dec 1, 2025
cc71091
Add action toolbar to bordereaudoc card
mapiolca Dec 1, 2025
0dcffae
Add recipient management to bordereaudoc card
mapiolca Dec 1, 2025
395d900
Add document handling for bordereaudoc
mapiolca Dec 1, 2025
33baa2d
Add PDF model and email content for bordereaudoc
mapiolca Dec 1, 2025
5a1a620
Add bordereaudoc list routing and menu updates
mapiolca Dec 1, 2025
831f01a
Enhance bordereaudoc list filters and metrics
mapiolca Dec 1, 2025
67901de
Add mass actions to bordereaudoc list
mapiolca Dec 1, 2025
8ede446
Align module descriptor for bordereaudoc
mapiolca Dec 1, 2025
ec9757d
Update bordereaudoc translations
mapiolca Dec 1, 2025
3ad740f
Align bordereaudoc front pages and downloads
mapiolca Dec 1, 2025
77d6acb
Corriger l'usage du statut et les erreurs de liste
mapiolca Dec 1, 2025
6166b2a
Supprimer l'appel dol_print_footer absent
mapiolca Dec 1, 2025
e11e9a9
Corriger l'appel create du bordereau
mapiolca Dec 1, 2025
3eb757b
Ajouter la méthode fetch au bordereaudoc
mapiolca Dec 1, 2025
aa66444
Assainir le fetch de bordereau
mapiolca Dec 1, 2025
2afb920
Corriger le modulepart pour les documents bordereaudoc
mapiolca Dec 1, 2025
5ec2c72
Register bordereaudoc model directory
mapiolca Dec 1, 2025
05cb019
Load bordereaudoc PDF base class
mapiolca Dec 1, 2025
3657fcd
Add status labels for bordereaudoc
mapiolca Dec 1, 2025
68d3630
Fix bordereaudoc module model includes
mapiolca Dec 1, 2025
096cc31
Gracefully handle missing document preheader
mapiolca Dec 1, 2025
5567764
Add update helper for bordereaudoc
mapiolca Dec 1, 2025
8c73a10
Add generateDocument implementation for bordereaudoc
mapiolca Dec 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions admin/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
// Libraries
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
require_once '../lib/diffusionplans.lib.php';
require_once '../class/diffusion.class.php';
require_once '../class/bordereaudoc.class.php';


/**
Expand All @@ -84,7 +84,7 @@
$value = GETPOST('value', 'alpha');
$label = GETPOST('label', 'alpha');
$scandir = GETPOST('scan_dir', 'alpha');
$type = 'diffusion';
$type = 'bordereaudoc';

$error = 0;
$setupnotempty = 0;
Expand Down Expand Up @@ -197,7 +197,7 @@
$moduledir = 'diffusionplans';
$myTmpObjects = array();
// TODO Scan list of objects to fill this array
$myTmpObjects['diffusion'] = array('label' => 'Diffusion', 'includerefgeneration' => 1, 'includedocgeneration' => 1, 'class' => 'Diffusion');
$myTmpObjects['bordereaudoc'] = array('label' => 'Bordereaudoc', 'includerefgeneration' => 1, 'includedocgeneration' => 1, 'class' => 'Bordereaudoc');

$tmpobjectkey = GETPOST('object', 'aZ09');
if ($tmpobjectkey && !array_key_exists($tmpobjectkey, $myTmpObjects)) {
Expand Down Expand Up @@ -237,15 +237,15 @@

$className = $myTmpObjects[$tmpobjectkey]['class'];
$tmpobject = new $className($db);
'@phan-var-force Diffusion $tmpobject';
'@phan-var-force Bordereaudoc $tmpobject';
$tmpobject->initAsSpecimen();

// Search template files
$file = '';
$className = '';
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$file = dol_buildpath($reldir."core/modules/diffusionplans/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
$file = dol_buildpath($reldir."core/modules/bordereaudoc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
if (file_exists($file)) {
$className = "pdf_".$modele."_".strtolower($tmpobjectkey);
break;
Expand Down Expand Up @@ -432,7 +432,7 @@

$className = $myTmpObjectArray['class'];
$mytmpinstance = new $className($db);
'@phan-var-force Diffusion $mytmpinstance';
'@phan-var-force Bordereaudoc $mytmpinstance';
$mytmpinstance->initAsSpecimen();

// Info
Expand Down
147 changes: 147 additions & 0 deletions bordereaudoc_agenda.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<?php
/* Copyright (C) 2025 Pierre ARDOIN <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/**
* \file bordereaudoc_agenda.php
* \ingroup diffusionplans
* \brief Tab of events for Bordereaudoc.
*/

// Load Dolibarr environment
$res = 0;
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
}
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
$tmp2 = realpath(__FILE__);
$i = strlen($tmp) - 1;
$j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
$i--;
$j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
}
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
$res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
}
if (!$res && file_exists("../main.inc.php")) {
$res = @include "../main.inc.php";
}
if (!$res && file_exists("../../main.inc.php")) {
$res = @include "../../main.inc.php";
}
if (!$res && file_exists("../../../main.inc.php")) {
$res = @include "../../../main.inc.php";
}
if (!$res) {
die("Include of main fails");
}

require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
dol_include_once('/diffusionplans/class/bordereaudoc.class.php');
dol_include_once('/diffusionplans/lib/diffusionplans_bordereaudoc.lib.php');

// Load translation files required by the page
$langs->loadLangs(array('diffusionplans@diffusionplans', 'other'));

// Get parameters
$id = GETPOSTINT('id');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bordereaudocagenda';

$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page');
if (empty($page) || $page == -1) {
$page = 0;
}
$offset = $limit * $page;
if (!$sortorder) {
$sortorder = 'DESC';
}
if (!$sortfield) {
$sortfield = 'a.datep';
}

// Initialize objects
$object = new Bordereaudoc($db);
$form = new Form($db);
$hookmanager->initHooks(array('bordereaudocagenda', 'globalcard'));

// Permissions
$permissiontoread = $user->hasRight('diffusionplans', 'bordereaudoc', 'read');
$permissiontoadd = $user->hasRight('agenda', 'myactions', 'create');

if (!$permissiontoread) {
accessforbidden();
}

// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php';
if (empty($object->id)) {
accessforbidden();
}

$backtopage = $backtopage ?: dol_buildpath('/diffusionplans/bordereaudoc_card.php', 1).'?id='.$object->id;
$param = '?id='.$object->id;

// Actions
$object->fetch_thirdparty();
$permissiontoreadnote = $permissiontoread;
$permissiontodeletenote = $permissiontoadd;
include DOL_DOCUMENT_ROOT.'/core/actions_agenda.inc.php';

// View
$help_url = '';
$title = $langs->trans('Agenda');
llxHeader('', $title, $help_url);

$head = bordereaudocPrepareHead($object);
print dol_get_fiche_head($head, 'agenda', $langs->trans('Bordereaudoc'), -1, $object->picto);

dol_banner_tab($object, 'ref', $backtopage, ($user->socid ? 0 : 1), 'ref', 'fk_project');

print '<div class="fichecenter">';
print '<div class="fichehalfleft">';

$morehtmlright = '';
$morehtmlcenter = $langs->trans('Project').': ';
if (!empty($object->fk_project)) {
$projectstatic = new Project($db);
$projectstatic->fetch($object->fk_project);
$morehtmlcenter .= $projectstatic->getNomUrl(1);
} else {
$morehtmlcenter .= $langs->trans('None');
}

include DOL_DOCUMENT_ROOT.'/core/tpl/agenda_view.tpl.php';

print '</div>';
print '</div>';

print dol_get_fiche_end();

// Footer
llxFooter();
$db->close();
Loading