Skip to content

Commit

Permalink
add: new configuration for select project
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Mar 31, 2021
1 parent c230834 commit ff56681
Showing 1 changed file with 12 additions and 38 deletions.
50 changes: 12 additions & 38 deletions admin/risk.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,9 @@

require '../../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
require_once DOL_DOCUMENT_ROOT."/custom/digiriskdolibarr/class/digiriskelement.class.php";
require_once '../lib/digiriskdolibarr.lib.php';
require_once DOL_DOCUMENT_ROOT.'/custom/digiriskdolibarr/class/digiriskresources.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';

$action = GETPOST('action', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'adminsocial'; // To manage different context of search
Expand All @@ -45,7 +36,7 @@
if (!$user->admin) accessforbidden();

$error = 0;
$hookmanager->initHooks(array('admincompany', 'globaladmin'));
$hookmanager->initHooks(array('globaladmin'));

global $conf, $db;

Expand Down Expand Up @@ -78,10 +69,7 @@
* View
*/

$form = new Form($db);
$formother = new FormOther($db);

$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }

$help_url = 'FR:Module_DigiriskDolibarr';
$page_name = "DigiriskdolibarrSetup";
Expand All @@ -96,39 +84,25 @@
$head = digiriskdolibarrAdminPrepareHead();
dol_fiche_head($head, 'risk', '', -1, "digiriskdolibarr@digiriskdolibarr");

$countrynotdefined = '<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>';

print '<span class="opacitymedium">'.$langs->trans("DigiriskMenu")."</span><br>\n";
print "<br>\n";

print "\n".'<script type="text/javascript" language="javascript">';
print '$(document).ready(function () {
$("#selectcountry_id").change(function() {
document.form_index.action.value="updateedit";
document.form_index.submit();
});
});';
print '</script>'."\n";

print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="social_form">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';

/*
*** Participation Agreement -- Accords de participation ***
*/

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

print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("TasksManagement").'</th><th>'.$langs->trans("").'</th></tr>'."\n";

// * Terms And Conditions - Modalités *
// Project
if (!empty($conf->projet->enabled))
{
$langs->load("projects");
print '<tr class="oddeven"><td><label for="projectLinked">'.$langs->trans("ProjectLinked").'</label></td><td>';
$numprojet = $formproject->select_projects(0, $conf->global->DIGIRISKDOLIBARR_PROJECT_LINKED, 'projectLinked', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
print '</td></tr>';
}

print '<tr class="oddeven"><td><label for="projectLinked">'.$langs->trans("ProjectLinked").'</label></td><td>';
print $formother->selectProjectTasks('',0, $htmlname = 'projectLinked') ;
print '</td></tr>';
print '</table>';

print '<br><div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print '</div>';
Expand Down

0 comments on commit ff56681

Please sign in to comment.