diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index d669270b565..1c93b247dfc 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -65,6 +65,7 @@ $search_filter = GETPOST("search_filter", 'alpha'); $search_status = GETPOST("search_status", 'intcomma'); $catid = GETPOST("catid", 'int'); $optioncss = GETPOST('optioncss', 'alpha'); +$socid = GETPOST('socid', 'int'); $filter = GETPOST("filter", 'alpha'); if ($filter) { diff --git a/htdocs/core/class/html.formintervention.class.php b/htdocs/core/class/html.formintervention.class.php index 7058e80b1d7..b9564c6aa52 100644 --- a/htdocs/core/class/html.formintervention.class.php +++ b/htdocs/core/class/html.formintervention.class.php @@ -57,10 +57,11 @@ class FormIntervention * @param int $selected Id intervention preselected * @param string $htmlname Nom de la zone html * @param int $maxlength Maximum length of label - * @param int $showempty Show empty line + * @param int $showempty Show empty line ('1' or string to show for empty line) + * @param int $draftonly Show only drafts intervention * @return int Nbre of project if OK, <0 if KO */ - public function select_interventions($socid = -1, $selected = '', $htmlname = 'interventionid', $maxlength = 16, $showempty = 1) + public function select_interventions($socid = -1, $selected = '', $htmlname = 'interventionid', $maxlength = 16, $showempty = 1, $draftonly = false) { // phpcs:enable global $db, $user, $conf, $langs; @@ -80,13 +81,17 @@ class FormIntervention $sql .= " AND f.fk_soc = ".((int) $socid); } } + if ($draftonly) $sql .= " AND f.fk_statut = 0"; dol_syslog(get_class($this)."::select_intervention", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $out .= ''; } elseif ($massaction == 'generateinvoice' && $user->rights->facture->lire) { print ''; + } elseif ($massaction == 'generateinter' && $user->rights->ficheinter->lire) { + print ''; } else { print ''; } @@ -1026,6 +1108,36 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print ''; $massaction = ''; } + } elseif ($massaction == 'generateinter') { + // Form to convert time spent into invoice + print ''; + + if ($projectstatic->thirdparty->id > 0) { + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; + print $langs->trans('InterToUse'); + print ''; + $forminter = new FormIntervention($db); + print $forminter->select_interventions($projectstatic->thirdparty->id, '', 'interid', 24, $langs->trans('NewInter'), true); + print '
'; + + print '
'; + print '
'; + print ' '; + print ''; + print '
'; + print '
'; + } else { + print '
'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'
'; + print '
'; + print ''; + print '
'; + $massaction = ''; + } } /* diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index f5a4392a0c0..14901dc8a9c 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -185,6 +185,7 @@ $thirdpartygraph .= ''; $thirdpartygraph .= ''; $thirdpartygraph .= ''; +$thirdpartycateggraph = ''; if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_THIRDPARTIES)) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $elementtype = 'societe';