Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9.4.0 #2080

Merged
merged 124 commits into from
Jul 25, 2022
Merged

9.4.0 #2080

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
1f3db26
[MediaGallery] fix: progress bar fades out after uploading
Jun 27, 2022
77ac257
[FirePermit] fix: change signatory status after sending email
Jun 29, 2022
731457e
[PreventionPlan] fix: change signatory status after sending email
Jun 29, 2022
5487f33
[ODT] ADD: New version with inherited and shared evaluators, security…
Jul 5, 2022
2293dbc
[AdminConf] add: conf for show shared risk sings and multienty manage…
nicolas-eoxia Jul 5, 2022
61eac8b
[TPL] add: template listings for all risk sign list
nicolas-eoxia Jul 5, 2022
c002cb0
[JS] add: Js action for select all and unlink shared risk sign
nicolas-eoxia Jul 5, 2022
5f735d0
[CSS] add: css on import box for shared risk sign
nicolas-eoxia Jul 5, 2022
19efb7c
[Trad] add: translation for shared risksign
nicolas-eoxia Jul 5, 2022
67bcb68
[Class] add: implementation of tpl listing shared risk sign
nicolas-eoxia Jul 5, 2022
edf1b4d
[Tools] add: import risk sign form wordpress
nicolas-eoxia Jul 5, 2022
b3fb122
[RiskSign] add: change position for dropdown category
nicolas-eoxia Jul 5, 2022
26753d6
[RiskSign] fix: search category error picto
nicolas-eoxia Jul 5, 2022
3e7d8e2
[RiskSign] fix: change button edit risk sign
nicolas-eoxia Jul 5, 2022
a4090e9
[RiskSign] fix: getNomUrl for ref instead of edit button
nicolas-eoxia Jul 5, 2022
e9557b3
[RiskSign] add: getNomUrl
nicolas-eoxia Jul 5, 2022
235d537
[JS] fix: load risksing for create and save action
nicolas-eoxia Jul 5, 2022
bb3c167
[Tools] add: import data migration global and notice info for visibil…
nicolas-eoxia Jul 6, 2022
375db25
Merge remote-tracking branch 'origin/9.4.0' into 9.4.0
nicolas-eoxia Jul 6, 2022
f5b571c
[Tools] add: conf advanced import
nicolas-eoxia Jul 6, 2022
b465d96
[SQL] add: missing cutoff in lesion nature dico
nicolas-eoxia Jul 6, 2022
8ea1f81
[RiskSign] fix: sql need entity filter
nicolas-eoxia Jul 7, 2022
cd80631
[RiskSign] fix: selectfields disable td
nicolas-eoxia Jul 7, 2022
e216250
[RiskSign] fix: filter search for fk element in shared list
nicolas-eoxia Jul 7, 2022
31ba8d6
[ODT] add: New version with id, site, new accident model
Jul 7, 2022
3fcde50
[Trad] fix: error translation
nicolas-eoxia Jul 8, 2022
2d5344a
[RiskAssessmentDocument] add: conf for show task done
nicolas-eoxia Jul 8, 2022
75ed9d7
[ODT] add: rework GP/UT document
nicolas-eoxia Jul 8, 2022
514305f
[ODT] add: more info for task action
nicolas-eoxia Jul 8, 2022
bb39629
[ODT] add: rework info for task action
nicolas-eoxia Jul 11, 2022
b646a05
[Ticket] fix: set extrafields cross entity
Jul 12, 2022
49167e8
[Trad] fix: error translation
nicolas-eoxia Jul 12, 2022
c1cd22f
[RiskSign] add: remove select checkbox for mass actions
nicolas-eoxia Jul 12, 2022
4cce033
[Mod] add: prefix attribute in menu
nicolas-eoxia Jul 12, 2022
0eca4e0
[ODT] add: namePicto after picto for improve order function in spread…
nicolas-eoxia Jul 13, 2022
3de3b33
[Export] add: statut in export for ticket
nicolas-eoxia Jul 13, 2022
e3c0c7b
[Risk] : add move unlink button at right on the list
nicolas-eoxia Jul 13, 2022
ee23c55
[TPL] add: new directory for improve navigation in code files
nicolas-eoxia Jul 13, 2022
6d19316
[Task] add: getNomUrl on extrafield element on task
nicolas-eoxia Jul 14, 2022
4b401a3
[Ticket] add: hook for prefill current datetime
nicolas-eoxia Jul 14, 2022
d2ebd1c
[JS] fix: action checkTaskProgress token issue
nicolas-eoxia Jul 14, 2022
0dafa9c
[RiskAssessmentTask] add: JS action for check task label length
nicolas-eoxia Jul 15, 2022
36c4981
[ODT] add: missing data on GP/UT ODT for evaluator/risksign/accident
nicolas-eoxia Jul 15, 2022
3476460
[Lib] add: change icon for generate document
nicolas-eoxia Jul 15, 2022
a3bc3af
[Hook] fix: missing link css files for ticketcard
nicolas-eoxia Jul 15, 2022
ddb120c
[ODT] fix: error date because tzuser is set on PP and FP
nicolas-eoxia Jul 15, 2022
2ffcdfe
[Risk] fix: url move risk
anaelle152 Jul 15, 2022
3f6a7e5
Merge pull request #2038 from anaelle152/fix_url_move_risk
nicolas-eoxia Jul 15, 2022
31eefe9
[Lib] fix: change again picto for generate button action
nicolas-eoxia Jul 18, 2022
38f2da6
[ODT] add: mise à jour des tableaux, homogénéisation des documents
Jul 18, 2022
fef8d1a
[JS] add: change icon for minizeMenu
nicolas-eoxia Jul 18, 2022
c9f9bed
Merge remote-tracking branch 'origin/9.4.0' into 9.4.0
Jul 18, 2022
1332257
[Translation] fix: warning when task label length exceed 255 characters
Jul 19, 2022
8b9a857
[RiskSign] fix: parent element field title label
Jul 19, 2022
b449db5
[RiskList] fix: order by tasks is now reliable
Jul 19, 2022
ffd44d1
[Evaluator] add: user fast creation button
Jul 19, 2022
0da9694
[RiskList] add: media preview
Jul 19, 2022
da9bb6d
[Tabs] fix: picto path on external tabs
Jul 19, 2022
8eda7be
[DigiriskElement] fix: rights related to digirisk element organizatio…
Jul 19, 2022
68f6c15
[Menu] fix: default standard id
Jul 19, 2022
13fefee
[RiskAssessment] fix: set risk assessment multi entity managed
Jul 19, 2022
4869188
[Ticket] add: conf ticket success message for public interface
Alexandra-copac Jul 20, 2022
24d8aef
[RiskAssessment] fix: multi entity fetch for shared risks
Jul 20, 2022
dcd46e8
[Medias] fix: risk assessment media preview
Jul 20, 2022
4a9c714
Merge pull request #2045 from Alexandra-copac/9.4.0
nicolas-eoxia Jul 20, 2022
79d430d
[RiskList] fix: selected fields compatibility with description and tasks
Jul 20, 2022
846f804
[RiskSign] fix: filter shared risk sign by fk_element
Jul 20, 2022
05172f1
[RiskSign] fix: fk_element filter for inherited & shared risk signs
Jul 20, 2022
b6c5df8
[RiskAssessement] fix: change position for initial in list/view
nicolas-eoxia Jul 20, 2022
f555213
[RiskSign] fix: default selected fields
Jul 20, 2022
a64c14d
Merge remote-tracking branch 'origin/9.4.0' into 9.4.0
Jul 20, 2022
e60f0a2
[Tabs] fix: external tabs label translations
Jul 20, 2022
28aaf04
[ODT] fix: set empty fields to NoData & logical errors
Jul 20, 2022
5801146
[Documents] fix: permission for generate documents
rkerviel Jul 20, 2022
89c9898
Merge pull request #2049 from rkerviel/fix_permission_for_generate_doc
nicolas-eoxia Jul 20, 2022
3b8563e
[Menu] fix: only minimize digirisk menu
Jul 20, 2022
e84c8b2
[CSS] add: page rotation
Jul 20, 2022
703110f
[Accident] add: display date start workstop and date end workstop
nicolas-eoxia Jul 20, 2022
81bbc5c
Merge remote-tracking branch 'origin/9.4.0' into 9.4.0
nicolas-eoxia Jul 20, 2022
cb2b892
[ODT] add: fetch risk signs inherited and shared for GP/UT document
nicolas-eoxia Jul 20, 2022
6ba188c
[Accident] add: return date work on banner
nicolas-eoxia Jul 20, 2022
a38dd68
[Mod] add: new version number
nicolas-eoxia Jul 20, 2022
2d862c0
Update demande-d-am-lioration.md
nicolas-eoxia Jul 20, 2022
725833c
[ODT] add: Mise au format homogène des documents intégration du PAPRI…
Jul 20, 2022
47e559e
[ODT] ADD: Mise en forme odt correctif
lmag Jul 20, 2022
19fd4ad
[Risk] fix: hide shared risks on digiriskelement creation form
Jul 21, 2022
04cd022
[CSS] fix: page rotation
Jul 21, 2022
2498219
[RiskList] fix: select distinct risks
Jul 21, 2022
30d2416
[DigiriskElement] fix: multi entity select digiriskelement list now h…
Jul 21, 2022
ee934a0
[FirePermit] fix: select location no more exclude digiriskelement wit…
Jul 21, 2022
d8f7c56
[PreventionPlan] fix: select location no more exclude digiriskelement…
Jul 21, 2022
5990130
[ODT] add: Update all documents for improve reading the documents
nicolas-eoxia Jul 21, 2022
5e6741b
[Hook] fix: getNomUrl on task view d'ont appear if link element is empty
nicolas-eoxia Jul 21, 2022
1e15203
[ODT] fix: shwo N/A if riskassessment comment is empty for listings r…
nicolas-eoxia Jul 21, 2022
c9ca080
[RiskAssessmentDocument] fix: PAPRIPACT text
Jul 21, 2022
0ade034
[ODT]add: Mise en forme
Jul 21, 2022
a38d5d1
Merge branch '9.4.0' of https://github.com/Evarisk/Digirisk into 9.4.0
Jul 21, 2022
24c16c5
[ODT]fix: categorie risque
Jul 21, 2022
15f2965
[JS] fix: Url error on check task progress action if anchor are set
nicolas-eoxia Jul 21, 2022
bce9666
[MediaGallery] add: error return
Jul 21, 2022
b9e17d2
[PreventionPlan] fix: clone action can't clone ref object det if ther…
nicolas-eoxia Jul 21, 2022
4fe3db7
[Trad] fix: missing trad for security
nicolas-eoxia Jul 21, 2022
08e525e
[CSS] add: media screen option in max-width = 1600px for show box doc…
nicolas-eoxia Jul 21, 2022
7885696
[RiskSign] fix: default selected fields
Jul 21, 2022
67aeba3
[Media] fix: change size of preview button
nicolas-eoxia Jul 21, 2022
84c792e
[RiskList] fix: selectable fields
Jul 21, 2022
bc5ff44
Merge remote-tracking branch 'origin/9.4.0' into 9.4.0
Jul 21, 2022
75f834b
[Risk] fix: shared risk list need to known sourcetype
nicolas-eoxia Jul 21, 2022
8fdd541
[RiskList] fix: default selected fields
Jul 21, 2022
49929f1
[RiskList] add: sort selected fields by position for consistency with…
nicolas-eoxia Jul 21, 2022
9ef0a6a
[ListingRiskPhoto] fix: change cell size for category picto
nicolas-eoxia Jul 21, 2022
d6ae690
[RiskList] fix: set default fields and sort position for selected fields
nicolas-eoxia Jul 21, 2022
d37e46c
[JS] fix: minize menu
nicolas-eoxia Jul 21, 2022
784a2cb
[RiskList] fix: multi tables selected fields
Jul 22, 2022
c5b3632
[RiskSignList] fix: multi table selected fields
Jul 22, 2022
bd948db
[ACCIDENT]add: cerfa accident
Jul 22, 2022
e2296f3
[Translation] fix: ticket success message
Jul 22, 2022
d4cbc2d
[RiskSignList] fix: shared risks sign no more appear on digiriskeleme…
Jul 22, 2022
7ac38e6
[RiskList] fix: show list if there's no shared risk
Jul 25, 2022
e5e3dfb
[Menu] fix: minimize menu
Jul 25, 2022
54f09e4
[Risk] fix: fetch risks ordered by cotation
Jul 25, 2022
02cb645
[Risk] add: todo rework shared risks fetch
Jul 25, 2022
447d838
[Mod] fix: change type for sharings elements
nicolas-eoxia Jul 25, 2022
36d3391
[ReadME] fix: last update date
Jul 25, 2022
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/demande-d-am-lioration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Demande d'amélioration
about: Une idée, des idées pour le projet c'est par ici
title: "[Amélioration]"
labels: Enhancement
labels: Amélioration
assignees: lmag

---
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Informations

Version du module: 9.3.3
Version du module: 9.4.0

Dernière mise à jour: 24/06/2022
Dernière mise à jour: 25/07/2022

Prérequis:
* Dolibarr min version 14.0.0
Expand Down
24 changes: 24 additions & 0 deletions admin/config/digiriskdocuments.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,30 @@
}

print '</table>';

if ($documentType == 'riskassessmentdocument') {
print load_fiche_titre($langs->trans("DigiriskRiskAssessmentDocumentData"), '', '');

print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("Name") . '</td>';
print '<td>' . $langs->trans("Description") . '</td>';
print '<td class="center">' . $langs->trans("Status") . '</td>';
print '</tr>';

print '<tr class="oddeven"><td>';
print $langs->trans('ShowTaskDone');
print "</td><td>";
print $langs->trans('ShowTaskDoneDescription');
print '</td>';

print '<td class="center">';
print ajax_constantonoff('DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_SHOW_TASK_DONE');
print '</td>';
print '</tr>';
print '</table>';
}

print '<hr>';

}
Expand Down
36 changes: 36 additions & 0 deletions admin/config/riskassessmentdocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,42 @@
}
print '</table>';

print load_fiche_titre($langs->trans("DigiriskRiskSignData"), '', '');

print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("Name") . '</td>';
print '<td>' . $langs->trans("Description") . '</td>';
print '<td class="center">' . $langs->trans("Status") . '</td>';
print '</tr>';

print '<tr class="oddeven"><td>';
print $langs->trans('ShowInheritedRiskSigns');
print "</td><td>";
print $langs->trans('ShowInheritedRiskSignsDescription');
print '</td>';

print '<td class="center">';
print ajax_constantonoff('DIGIRISKDOLIBARR_SHOW_INHERITED_RISKSIGNS');
print '</td>';
print '</tr>';

$result = !empty($conf->mc->entities['risksign']) ? strpos($conf->mc->entities['risksign'], $conf->entity) : 0;

if ($conf->multicompany->enabled && !empty($conf->mc->sharings['risksign']) && $result > 0) {
print '<tr class="oddeven"><td>';
print $langs->trans('ShowSharedRiskSigns');
print "</td><td>";
print $langs->trans('ShowSharedRiskSignsDescription');
print '</td>';

print '<td class="center">';
print ajax_constantonoff('DIGIRISKDOLIBARR_SHOW_SHARED_RISKSIGNS');
print '</td>';
print '</tr>';
}
print '</table>';

// Page end
print dol_get_fiche_end();
llxFooter();
Expand Down
11 changes: 11 additions & 0 deletions admin/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,17 @@
print ajax_constantonoff('DIGIRISKDOLIBARR_USE_CAPTCHA');
print '</td>';
print '</tr>';

// Advanced Import
print '<tr class="oddeven"><td>';
print $langs->trans("AdvancedImport");
print '</td><td>';
print $langs->trans('AdvancedImportDescription');
print '</td>';
print '<td class="center">';
print ajax_constantonoff('DIGIRISKDOLIBARR_TOOLS_ADVANCED_IMPORT');
print '</td>';
print '</tr>';
print '</table>';

print load_fiche_titre($langs->trans("MediaData"), '', '');
Expand Down
49 changes: 42 additions & 7 deletions admin/ticket/ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@
}

if ($action == 'generateExtrafields') {
$ret1 = $extra_fields->addExtraField('digiriskdolibarr_ticket_lastname', $langs->trans("LastName"), 'varchar', 2000, 255, 'ticket', 0, 0, '', '', 1, '', 1);
$ret2 = $extra_fields->addExtraField('digiriskdolibarr_ticket_firstname', $langs->transnoentities("FirstName"), 'varchar', 2100, 255, 'ticket', 0, 0, '', '', 1, '', 1);
$ret3 = $extra_fields->addExtraField('digiriskdolibarr_ticket_phone', $langs->transnoentities("Phone"), 'phone', 2200, '', 'ticket', 0, 0, '', '', 1, '', 1);
$ret4 = $extra_fields->addExtraField('digiriskdolibarr_ticket_service', $langs->trans("Service"), 'varchar', 2300, 255, 'ticket', 0, 0, '', '', 1, '', 1);
$ret5 = $extra_fields->addExtraField('digiriskdolibarr_ticket_location', $langs->trans("Location"), 'varchar', 2400, 255, 'ticket', 0, 0, '', '', 1, '', 1);
$ret6 = $extra_fields->addExtraField('digiriskdolibarr_ticket_date', $langs->trans("Date"), 'datetime', 2500, '', 'ticket', 0, 0, '', '', 1, '', 1);
$ret1 = $extra_fields->addExtraField('digiriskdolibarr_ticket_lastname', $langs->trans("LastName"), 'varchar', 2000, 255, 'ticket', 0, 0, '', '', 1, '', 1, '', '', 0);
$ret2 = $extra_fields->addExtraField('digiriskdolibarr_ticket_firstname', $langs->transnoentities("FirstName"), 'varchar', 2100, 255, 'ticket', 0, 0, '', '', 1, '', 1, '', '', 0);
$ret3 = $extra_fields->addExtraField('digiriskdolibarr_ticket_phone', $langs->transnoentities("Phone"), 'phone', 2200, '', 'ticket', 0, 0, '', '', 1, '', 1, '', '', 0);
$ret4 = $extra_fields->addExtraField('digiriskdolibarr_ticket_service', $langs->trans("Service"), 'varchar', 2300, 255, 'ticket', 0, 0, '', '', 1, '', 1, '', '', 0);
$ret5 = $extra_fields->addExtraField('digiriskdolibarr_ticket_location', $langs->trans("Location"), 'varchar', 2400, 255, 'ticket', 0, 0, '', '', 1, '', 1, '', '', 0);
$ret6 = $extra_fields->addExtraField('digiriskdolibarr_ticket_date', $langs->trans("Date"), 'datetime', 2500, '', 'ticket', 0, 0, '', '', 1, '', 1, '', '', 0);
if ($ret1 > 0 && $ret2 > 0 && $ret3 > 0 && $ret4 > 0 && $ret5 > 0 && $ret6 > 0) {
dolibarr_set_const($db, 'DIGIRISKDOLIBARR_TICKET_EXTRAFIELDS', 1, 'integer', 0, '', $conf->entity);
dolibarr_set_const($db, 'DIGIRISKDOLIBARR_TICKET_EXTRAFIELDS', 1, 'integer', 0, '', 0);
setEventMessages($langs->trans('ExtrafieldsCreated'), array());
} else {
setEventMessages($extra_fields->error, null, 'errors');
Expand Down Expand Up @@ -191,6 +191,12 @@
setEventMessages($langs->trans('ChildCategoryLabelSet'), array());
}

if ($action == 'setTicketSuccessMessage') {
$successmessage = GETPOST('DIGIRISKDOLIBARR_TICKET_SUCCESS_MESSAGE');
dolibarr_set_const($db, 'DIGIRISKDOLIBARR_TICKET_SUCCESS_MESSAGE', $successmessage, 'chaine', 0, '', $conf->entity);
setEventMessages($langs->trans('TicketSuccessMessageSet'), array());
}

/*
* View
*/
Expand Down Expand Up @@ -294,6 +300,34 @@
print '</form>';

print '</table>';

print load_fiche_titre($langs->trans("TicketSuccessMessageData"), '', '');

print '<table class="noborder centpercent">';

print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setTicketSuccessMessage">';

print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>' . $langs->trans("Description") . '</td>';
print '<td class="center">' . $langs->trans("Action") . '</td>';
print "</tr>";

// Ticket success message
$successmessage = $langs->trans($conf->global->DIGIRISKDOLIBARR_TICKET_SUCCESS_MESSAGE) ?: $langs->trans('YouMustNotifyYourHierarchy');
print '<tr class="oddeven"><td>'.$langs->trans("TicketSuccessMessage");
print '</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('DIGIRISKDOLIBARR_TICKET_SUCCESS_MESSAGE', $successmessage, '100%', 120, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70);
$doleditor->Create();
print '</td>';
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Save") . '">';
print '</td></tr>';
print '</form>';
print '</table>';

print '</div>';

// Project
Expand Down Expand Up @@ -440,6 +474,7 @@
print '<input type="hidden" name="action" value="generateExtrafields">';
print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';


print '<tr class="oddeven"><td>' . $langs->trans("GenerateExtrafields") . '<sup><a href="https://wiki.dolibarr.org/index.php?title=Module_Digirisk#DigiRisk_-_Registre_de_s.C3.A9curit.C3.A9_et_Tickets" target="_blank" > 4</a></sup></td>';
print '<td class="center">';
print $conf->global->DIGIRISKDOLIBARR_TICKET_EXTRAFIELDS ? $langs->trans('AlreadyGenerated') : $langs->trans('NotCreated');
Expand Down
58 changes: 29 additions & 29 deletions class/accident.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -514,15 +514,15 @@ class AccidentWorkStop extends CommonObjectLine
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array(
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'comment' => "Id"),
'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => 1, 'noteditable' => '1', 'default' => '(PROV)', 'index' => 1, 'searchall' => 1, 'showoncombobox' => '1', 'comment' => "Reference of object"),
'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => '1', 'position' => 30, 'notnull' => 1, 'visible' => 0,),
'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => '1', 'position' => 40, 'notnull' => 1, 'visible' => 0,),
'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => '1', 'position' => 50, 'notnull' => 0, 'visible' => 0,),
'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => '1', 'position' => 60, 'notnull' => 0, 'visible' => 0, 'index' => 0,),
'workstop_days' => array('type' => 'integer', 'label' => 'WorkStopDays', 'enabled' => '1', 'position' => 70, 'notnull' => -1, 'visible' => -1,),
'date_end_workstop' => array('type' => 'datetime', 'label' => 'DateEndWorkStop', 'enabled' => '1', 'position' => 80, 'notnull' => 0, 'visible' => 0,),
'fk_accident' => array('type' => 'integer', 'label' => 'FkAccident', 'enabled' => '1', 'position' => 90, 'notnull' => 1, 'visible' => 0,),
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'comment' => "Id"),
'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => 1, 'noteditable' => '1', 'default' => '(PROV)', 'index' => 1, 'searchall' => 1, 'showoncombobox' => '1', 'comment' => "Reference of object"),
'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => '1', 'position' => 30, 'notnull' => 1, 'visible' => 0,),
'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => '1', 'position' => 40, 'notnull' => 1, 'visible' => 0,),
'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => '1', 'position' => 50, 'notnull' => 0, 'visible' => 0,),
'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => '1', 'position' => 60, 'notnull' => 0, 'visible' => 0, 'index' => 0,),
'workstop_days' => array('type' => 'integer', 'label' => 'WorkStopDays', 'enabled' => '1', 'position' => 70, 'notnull' => -1, 'visible' => -1,),
'date_start_workstop' => array('type' => 'datetime', 'label' => 'DateEndWorkStop', 'enabled' => '1', 'position' => 80, 'notnull' => 0, 'visible' => 0,),
'fk_accident' => array('type' => 'integer', 'label' => 'FkAccident', 'enabled' => '1', 'position' => 90, 'notnull' => 1, 'visible' => 0,),
);

public $rowid;
Expand All @@ -532,7 +532,7 @@ class AccidentWorkStop extends CommonObjectLine
public $tms;
public $status;
public $workstop_days;
public $date_end_workstop;
public $date_start_workstop;
public $fk_accident;

/**
Expand Down Expand Up @@ -560,7 +560,7 @@ public function fetch($rowid)
{
global $db;

$sql = 'SELECT t.rowid, t.ref, t.date_creation, t.status, t.workstop_days, t.date_end_workstop, t.fk_accident';
$sql = 'SELECT t.rowid, t.ref, t.date_creation, t.status, t.workstop_days, t.date_start_workstop, t.fk_accident';
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'digiriskdolibarr_accident_workstop as t';
$sql .= ' WHERE t.rowid = ' . $rowid;
$sql .= ' AND entity IN (' . getEntity($this->table_element) . ')';
Expand All @@ -569,13 +569,13 @@ public function fetch($rowid)
if ($result) {
$objp = $db->fetch_object($result);

$this->id = $objp->rowid;
$this->ref = $objp->ref;
$this->date_creation = $objp->date_creation;
$this->status = $objp->status;
$this->workstop_days = $objp->workstop_days;
$this->date_end_workstop = $objp->date_end_workstop;
$this->fk_accident = $objp->fk_accident;
$this->id = $objp->rowid;
$this->ref = $objp->ref;
$this->date_creation = $objp->date_creation;
$this->status = $objp->status;
$this->workstop_days = $objp->workstop_days;
$this->date_start_workstop = $objp->date_start_workstop;
$this->fk_accident = $objp->fk_accident;

$db->free($result);

Expand All @@ -596,7 +596,7 @@ public function fetch($rowid)
public function fetchFromParent($parent_id = 0, $limit = 0)
{
global $db;
$sql = 'SELECT t.rowid, t.ref, t.date_creation, t.status, t.workstop_days, t.date_end_workstop';
$sql = 'SELECT t.rowid, t.ref, t.date_creation, t.status, t.workstop_days, t.date_start_workstop';
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'digiriskdolibarr_accident_workstop as t';
if ($parent_id > 0) {
$sql .= ' WHERE t.fk_accident = ' . $parent_id;
Expand All @@ -617,13 +617,13 @@ public function fetchFromParent($parent_id = 0, $limit = 0)

$record = new self($db);

$record->id = $obj->rowid;
$record->ref = $obj->ref;
$record->date_creation = $obj->date_creation;
$record->status = $obj->status;
$record->workstop_days = $obj->workstop_days;
$record->date_end_workstop = $obj->date_end_workstop;
$record->fk_accident = $obj->fk_accident;
$record->id = $obj->rowid;
$record->ref = $obj->ref;
$record->date_creation = $obj->date_creation;
$record->status = $obj->status;
$record->workstop_days = $obj->workstop_days;
$record->date_start_workstop = $obj->date_start_workstop;
$record->fk_accident = $obj->fk_accident;

$records[$record->id] = $record;

Expand Down Expand Up @@ -656,15 +656,15 @@ public function insert(User $user, $notrigger = false)

// Insertion dans base de la ligne
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . 'digiriskdolibarr_accident_workstop';
$sql .= ' (ref, entity, date_creation, status, workstop_days, date_end_workstop, fk_accident';
$sql .= ' (ref, entity, date_creation, status, workstop_days, date_start_workstop, fk_accident';
$sql .= ')';
$sql .= " VALUES (";
$sql .= "'" . $db->escape($this->ref) . "'" . ", ";
$sql .= $this->entity . ", ";
$sql .= "'" . $db->escape($db->idate($now)) . "'" . ", ";
$sql .= $this->status . ", ";
$sql .= $this->workstop_days . ", ";
$sql .= "'" . $db->escape($db->idate($this->date_end_workstop)) . "'" . ", ";
$sql .= "'" . $db->escape($db->idate($this->date_start_workstop)) . "'" . ", ";
$sql .= $this->fk_accident;

$sql .= ')';
Expand Down Expand Up @@ -708,7 +708,7 @@ public function update($user = '', $notrigger = false)
$sql .= " ref='" . $db->escape($this->ref) . "',";
$sql .= " status=" . $this->status . ",";
$sql .= " workstop_days=" . $this->workstop_days . ",";
$sql .= " date_end_workstop='" . $db->escape($db->idate($this->date_end_workstop)) . "',";
$sql .= " date_start_workstop='" . $db->escape($db->idate($this->date_start_workstop)) . "',";
$sql .= " fk_accident=" . $db->escape($this->fk_accident);
$sql .= " WHERE rowid = " . $this->id;

Expand Down
46 changes: 46 additions & 0 deletions class/actions_changeselectedfields.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/* Copyright (C) 2014 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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/>.
* or see https://www.gnu.org/
*/

/**
* \file htdocs/core/actions_changeselectedfields.inc.php
* \brief Code for actions when we change list of fields on a list page
*/


// $action must be defined
// $db must be defined
// $conf must be defined
// $object must be defined (object is loaded in this file with fetch)

// Save selection
if (GETPOST('formfilteraction', 'alphanohtml') == 'listafterchangingselectedfields') {
$tabparam = array();

$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;

if (GETPOST($selectedfields_label)) {
$tabparam["MAIN_SELECTEDFIELDS_".$varpage] = GETPOST($selectedfields_label);
}

include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';

$result = dol_set_user_param($db, $conf, $user, $tabparam);

//$action='list';
//var_dump($tabparam);exit;
}
Loading