Skip to content

Commit

Permalink
[Other] add: move file for reorganize digiriskdolibarr module
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Dec 15, 2021
1 parent 0541eb1 commit 30ff8f2
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 39 deletions.
2 changes: 1 addition & 1 deletion core/boxes/box_riskassessmentdocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

include_once DOL_DOCUMENT_ROOT . "/core/boxes/modules_boxes.php";

require_once './class/digiriskdocuments/riskassessmentdocument.class.php';
require_once __DIR__ . '/../../class/digiriskdocuments/riskassessmentdocument.class.php';

/**
* Class to manage the box
Expand Down
18 changes: 9 additions & 9 deletions core/modules/modDigiriskDolibarr.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public function __construct($db)
// Example:
$this->tabs[] = array('data'=>'mycompany_admin:+security:Sécurité:@digiriskdolibarr:1:/custom/digiriskdolibarr/admin/securityconf.php'); // To add a new tab identified by code tabname1
$this->tabs[] = array('data'=>'mycompany_admin:+social:Social:@digiriskdolibarr:1:/custom/digiriskdolibarr/admin/socialconf.php'); // To add a new tab identified by code tabname1
$this->tabs[] = array('data'=>'thirdparty:+openinghours:Horaires:@digiriskdolibarr:1:/custom/digiriskdolibarr/openinghours_card.php?id=__ID__'); // To add a new tab identified by code tabname1
$this->tabs[] = array('data'=>'thirdparty:+openinghours:Horaires:@digiriskdolibarr:1:/custom/digiriskdolibarr/view/openinghours_card.php?id=__ID__'); // To add a new tab identified by code tabname1

// To remove an existing tab identified by code tabname
// Dictionaries
Expand Down Expand Up @@ -715,7 +715,7 @@ public function __construct($db)
'titre'=>'<i class="fas fa-exclamation-triangle"></i> ' . $langs->trans('RiskAssessmentDocument'),
'mainmenu'=>'digiriskdolibarr',
'leftmenu'=>'digiriskstandard',
'url'=>'/digiriskdolibarr/digiriskstandard_card.php?id='.$conf->global->DIGIRISKDOLIBARR_ACTIVE_STANDARD,
'url'=>'/digiriskdolibarr/view/digiriskstandard/digiriskstandard_card.php?id='.$conf->global->DIGIRISKDOLIBARR_ACTIVE_STANDARD,
'langs'=>'digiriskdolibarr@digiriskdolibarr', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>48520+$r,
'enabled'=>'$conf->digiriskdolibarr->enabled', // Define condition to show or hide menu entry. Use '$conf->digiriskdolibarr->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
Expand All @@ -730,7 +730,7 @@ public function __construct($db)
'titre'=>'<i class="fas fa-network-wired"></i> ' . $langs->trans('Arborescence'),
'mainmenu'=>'digiriskdolibarr',
'leftmenu'=>'digiriskstandard',
'url'=>'/digiriskdolibarr/digiriskelement_organization.php',
'url'=>'/digiriskdolibarr/view/digiriskelement/digiriskelement_organization.php',
'langs'=>'digiriskdolibarr@digiriskdolibarr', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>48520+$r,
'enabled'=>'$conf->digiriskdolibarr->enabled', // Define condition to show or hide menu entry. Use '$conf->digiriskdolibarr->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
Expand All @@ -745,7 +745,7 @@ public function __construct($db)
'titre'=>'<i class="fas fa-list"></i> ' . $langs->trans('RiskList'),
'mainmenu'=>'digiriskdolibarr',
'leftmenu'=>'digirisklistingrisk',
'url'=>'/digiriskdolibarr/risk_list.php',
'url'=>'/digiriskdolibarr/view/risk_list.php',
'langs'=>'digiriskdolibarr@digiriskdolibarr', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>48520+$r,
'enabled'=>'$conf->digiriskdolibarr->enabled', // Define condition to show or hide menu entry. Use '$conf->digiriskdolibarr->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
Expand All @@ -760,7 +760,7 @@ public function __construct($db)
'titre'=>'<i class="fas fa-info"></i> ' . $langs->trans('PreventionPlan'),
'mainmenu'=>'digiriskdolibarr',
'leftmenu'=>'digiriskpreventionplan',
'url'=>'/digiriskdolibarr/preventionplan_list.php',
'url'=>'/digiriskdolibarr/view/preventionplan/preventionplan_list.php',
'langs'=>'digiriskdolibarr@digiriskdolibarr', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>48520+$r,
'enabled'=>'$conf->digiriskdolibarr->enabled', // Define condition to show or hide menu entry. Use '$conf->digiriskdolibarr->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
Expand All @@ -775,7 +775,7 @@ public function __construct($db)
'titre'=>'<i class="fas fa-fire-alt"></i> ' . $langs->trans('FirePermit'),
'mainmenu'=>'digiriskdolibarr',
'leftmenu'=>'digiriskfirepermit',
'url'=>'/digiriskdolibarr/firepermit_list.php',
'url'=>'/digiriskdolibarr/view/firepermit/firepermit_list.php',
'langs'=>'digiriskdolibarr@digiriskdolibarr', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>48520+$r,
'enabled'=>'$conf->digiriskdolibarr->enabled', // Define condition to show or hide menu entry. Use '$conf->digiriskdolibarr->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
Expand All @@ -790,7 +790,7 @@ public function __construct($db)
'titre'=>'<i class="fas fa-user-injured"></i> ' . $langs->trans('Accident'),
'mainmenu'=>'digiriskdolibarr',
'leftmenu'=>'digiriskaccident',
'url'=>'/digiriskdolibarr/accident_list.php',
'url'=>'/digiriskdolibarr/view/accident/accident_list.php',
'langs'=>'digiriskdolibarr@digiriskdolibarr', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>48520+$r,
'enabled'=>'$conf->digiriskdolibarr->enabled', // Define condition to show or hide menu entry. Use '$conf->digiriskdolibarr->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
Expand All @@ -805,7 +805,7 @@ public function __construct($db)
'titre'=>'<i class="fas fa-user"></i> ' . $langs->trans('Users'),
'mainmenu'=>'digiriskdolibarr',
'leftmenu'=>'digiriskusers',
'url'=>'/digiriskdolibarr/digiriskusers.php',
'url'=>'/digiriskdolibarr/view/digiriskusers.php',
'langs'=>'digiriskdolibarr@digiriskdolibarr', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>48520+$r,
'enabled'=>'$user->rights->user->user->lire', // Define condition to show or hide menu entry. Use '$conf->digiriskdolibarr->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
Expand Down Expand Up @@ -835,7 +835,7 @@ public function __construct($db)
'titre'=>'<i class="fas fa-wrench"></i> ' . $langs->trans('Tools'),
'mainmenu'=>'digiriskdolibarr',
'leftmenu'=>'digirisktools',
'url'=>'/digiriskdolibarr/digirisktools.php',
'url'=>'/digiriskdolibarr/view/digirisktools.php',
'langs'=>'digiriskdolibarr@digiriskdolibarr', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>48520+$r,
'enabled'=>'$conf->digiriskdolibarr->enabled && $user->admin', // Define condition to show or hide menu entry. Use '$conf->digiriskdolibarr->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
Expand Down
22 changes: 11 additions & 11 deletions digirisktools.php → view/digirisktools.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

/**
* \file digirisktools.php
* \file view/digirisktools.php
* \ingroup digiriskdolibarr
* \brief Tools page of digiriskdolibarr top menu
*/
Expand All @@ -37,16 +37,16 @@

require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';

require_once './class/digiriskstandard.class.php';
require_once './class/digiriskelement.class.php';
require_once './class/digiriskelement/groupment.class.php';
require_once './class/digiriskelement/workunit.class.php';
require_once './class/riskanalysis/risk.class.php';
require_once './class/riskanalysis/riskassessment.class.php';
require_once './core/modules/digiriskdolibarr/digiriskelement/groupment/mod_groupment_standard.php';
require_once './core/modules/digiriskdolibarr/digiriskelement/workunit/mod_workunit_standard.php';
require_once './core/modules/digiriskdolibarr/riskanalysis/risk/mod_risk_standard.php';
require_once './core/modules/digiriskdolibarr/riskanalysis/riskassessment/mod_riskassessment_standard.php';
require_once './../class/digiriskstandard.class.php';
require_once './../class/digiriskelement.class.php';
require_once './../class/digiriskelement/groupment.class.php';
require_once './../class/digiriskelement/workunit.class.php';
require_once './../class/riskanalysis/risk.class.php';
require_once './../class/riskanalysis/riskassessment.class.php';
require_once './../core/modules/digiriskdolibarr/digiriskelement/groupment/mod_groupment_standard.php';
require_once './../core/modules/digiriskdolibarr/digiriskelement/workunit/mod_workunit_standard.php';
require_once './../core/modules/digiriskdolibarr/riskanalysis/risk/mod_risk_standard.php';
require_once './../core/modules/digiriskdolibarr/riskanalysis/riskassessment/mod_riskassessment_standard.php';

global $conf, $db, $langs, $user;

Expand Down
4 changes: 2 additions & 2 deletions digiriskusers.php → view/digiriskusers.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

/**
* \file digiriskusers.php
* \file view/digiriskusers.php
* \ingroup digiriskdolibarr
* \brief Page to view Users
*/
Expand Down Expand Up @@ -443,7 +443,7 @@
exit;
}

require_once './lib/digiriskdolibarr_function.lib.php';
require_once './../lib/digiriskdolibarr_function.lib.php';

$title = $langs->trans("ListOfUsers");
$help_url = '';
Expand Down
2 changes: 2 additions & 0 deletions view/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
//Silence is golden apple
6 changes: 3 additions & 3 deletions openinghours_card.php → view/openinghours_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

/**
* \file openinghours_card.php
* \file view/openinghours_card.php
* \ingroup digiriskdolibarr
* \brief Page to view Opening Hours
*/
Expand All @@ -38,7 +38,7 @@
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';

require_once './class/openinghours.class.php';
require_once './../class/openinghours.class.php';

$langs->loadLangs(array("digiriskdolibarr@digiriskdolibarr"));

Expand Down Expand Up @@ -136,7 +136,7 @@
print '<span class="opacitymedium">'.$langs->trans("ThirdPartyOpeningHours")."</span>\n";

//Show common fields
require_once __DIR__ . '/core/tpl/digiriskdolibarr_openinghours_view.tpl.php';
require_once __DIR__ . '/../core/tpl/digiriskdolibarr_openinghours_view.tpl.php';

print dol_get_fiche_end();
// End of page
Expand Down
26 changes: 13 additions & 13 deletions risk_list.php → view/risk_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

/**
* \file risk_list.php
* \file view/risk_list.php
* \ingroup digiriskdolibarr
* \brief List page for risk
*/
Expand Down Expand Up @@ -44,14 +44,14 @@
require_once DOL_DOCUMENT_ROOT.'/core/modules/project/mod_project_simple.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/project/task/mod_task_simple.php';

require_once './class/digiriskelement.class.php';
require_once './class/digiriskstandard.class.php';
require_once './class/riskanalysis/risk.class.php';
require_once './class/riskanalysis/riskassessment.class.php';
require_once './core/modules/digiriskdolibarr/riskanalysis/risk/mod_risk_standard.php';
require_once './core/modules/digiriskdolibarr/riskanalysis/riskassessment/mod_riskassessment_standard.php';
require_once './lib/digiriskdolibarr_digiriskstandard.lib.php';
require_once './lib/digiriskdolibarr_function.lib.php';
require_once './../class/digiriskelement.class.php';
require_once './../class/digiriskstandard.class.php';
require_once './../class/riskanalysis/risk.class.php';
require_once './../class/riskanalysis/riskassessment.class.php';
require_once './../core/modules/digiriskdolibarr/riskanalysis/risk/mod_risk_standard.php';
require_once './../core/modules/digiriskdolibarr/riskanalysis/riskassessment/mod_riskassessment_standard.php';
require_once './../lib/digiriskdolibarr_digiriskstandard.lib.php';
require_once './../lib/digiriskdolibarr_function.lib.php';

global $langs, $user, $conf, $db, $hookmanager;
$permtoupload = $user->rights->ecm->upload;
Expand Down Expand Up @@ -173,9 +173,9 @@

$error = 0;

$backtopage = dol_buildpath('/digiriskdolibarr/risk_list.php', 1);
$backtopage = dol_buildpath('/digiriskdolibarr/view/risk_list.php', 1);

require_once './core/tpl/digiriskdolibarr_risk_actions.tpl.php';
require_once './../core/tpl/digiriskdolibarr_risk_actions.tpl.php';

}

Expand All @@ -195,8 +195,8 @@
// Object card
// ------------------------------------------------------------
$allRisks = 1;
require_once './core/tpl/digiriskdolibarr_medias_gallery_modal.tpl.php';
require_once './core/tpl/digiriskdolibarr_risklist_view.tpl.php';
require_once './../core/tpl/digiriskdolibarr_medias_gallery_modal.tpl.php';
require_once './../core/tpl/digiriskdolibarr_risklist_view.tpl.php';

// End of page
llxFooter();
Expand Down

0 comments on commit 30ff8f2

Please sign in to comment.