diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index b2ef8e8854b..b32b630af0b 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -29,6 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $hookmanager = new HookManager($db); @@ -40,7 +41,24 @@ $langs->loadLangs(array("companies", "members")); // Security check $result = restrictedArea($user, 'adherent'); +if (!isset($form) || !is_object($form)) { + $form = new Form($db); +} +// Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb) +$resultboxes = FormOther::getBoxesArea($user, "2"); +if (GETPOST('addbox')) { + // Add box (when submit is done from a form when ajax disabled) + require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; + $zone = GETPOST('areacode', 'aZ09'); + $userid = GETPOST('userid', 'int'); + $boxorder = GETPOST('boxorder', 'aZ09'); + $boxorder .= GETPOST('boxcombo', 'aZ09'); + $result = InfoBox::saveboxorder($db, $zone, $boxorder, $userid); + if ($result > 0) { + setEventMessages($langs->trans("BoxAdded"), null); + } +} /* * View @@ -52,7 +70,7 @@ $staticmember = new Adherent($db); $statictype = new AdherentType($db); $subscriptionstatic = new Subscription($db); -print load_fiche_titre($langs->trans("MembersArea"), '', 'members'); +print load_fiche_titre($langs->trans("MembersArea"), $resultboxes['selectboxlist'], 'members'); $Adherents = array(); $AdherentsAValider = array(); @@ -85,9 +103,15 @@ if ($result) { $adhtype->label = $objp->label; $AdherentType[$objp->rowid] = $adhtype; - if ($objp->statut == -1) { $MemberToValidate[$objp->rowid] = $objp->somme; } - if ($objp->statut == 1) { $MembersValidated[$objp->rowid] = $objp->somme; } - if ($objp->statut == 0) { $MembersResiliated[$objp->rowid] = $objp->somme; } + if ($objp->statut == -1) { + $MemberToValidate[$objp->rowid] = $objp->somme; + } + if ($objp->statut == 1) { + $MembersValidated[$objp->rowid] = $objp->somme; + } + if ($objp->statut == 0) { + $MembersResiliated[$objp->rowid] = $objp->somme; + } $i++; } @@ -136,10 +160,14 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is usel print '
| '.$langs->trans("Search").' | |||
| '.$langs->trans("Search").' | |||
| : | '; - if ($i == 0) print ' | '; + if ($i == 0) { + print ' | '; + } print ' |
| ... | "; @@ -449,6 +477,42 @@ print ""; print ''; +// boxes +print ''; + +print ''.$langs->trans("DolibarrWorkBoard").' ';
if ($showweather) {
if ($totallate > 0) {
- $text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate",
- $totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')).')';
+ $text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv(
+ "NActionsLate",
+ $totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')
+ ).')';
} else {
$text = $langs->transnoentitiesnoconv("NoItemLate");
}
@@ -670,17 +674,17 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
$globalStatsKey = $groupElement['globalStatsKey'];
$groupElement['globalStats'] = array();
- if (is_array($keys) && in_array($globalStatsKey, $keys))
- {
+ if (is_array($keys) && in_array($globalStatsKey, $keys)) {
// get key index of stats used in $includes, $classes, $keys, $icons, $titres, $links
$keyIndex = array_search($globalStatsKey, $keys);
$classe = $classes[$keyIndex];
- if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe]))
- {
+ if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe])) {
$groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey] ? $boardloaded[$classe]->nb[$globalStatsKey] : 0;
$nbTotal = doubleval($groupElement['globalStats']['total']);
- if ($nbTotal >= 10000) { $nbTotal = round($nbTotal / 1000, 2).'k'; }
+ if ($nbTotal >= 10000) {
+ $nbTotal = round($nbTotal / 1000, 2).'k';
+ }
$groupElement['globalStats']['text'] = $langs->trans('Total').' : '.$langs->trans($titres[$keyIndex]).' ('.$groupElement['globalStats']['total'].')';
$groupElement['globalStats']['total'] = $nbTotal;
$groupElement['globalStats']['link'] = $links[$keyIndex];
@@ -767,8 +771,10 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
$text = '';
if ($totallate > 0) {
- $text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate",
- $totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')).')';
+ $text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv(
+ "NActionsLate",
+ $totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')
+ ).')';
} else {
$text = $langs->transnoentitiesnoconv("NoItemLate");
}
@@ -783,16 +789,24 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
$weatherDashBoard .= ' '.$langs->trans('GlobalOpenedElemView').' '."\n";
if ($totallatePercentage > 0 && !empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) {
- $weatherDashBoard .= ' '.$langs->transnoentitiesnoconv("NActionsLate",
- price($totallatePercentage).'%').''."\n";
- $weatherDashBoard .= ' '.$langs->trans('NActionsLate',
- $totalLateNumber).''."\n";
+ $weatherDashBoard .= ' '.$langs->transnoentitiesnoconv(
+ "NActionsLate",
+ price($totallatePercentage).'%'
+ ).''."\n";
+ $weatherDashBoard .= ' '.$langs->trans(
+ 'NActionsLate',
+ $totalLateNumber
+ ).''."\n";
} else {
- $weatherDashBoard .= ' '.$langs->transnoentitiesnoconv("NActionsLate",
- $totalLateNumber).''."\n";
+ $weatherDashBoard .= ' '.$langs->transnoentitiesnoconv(
+ "NActionsLate",
+ $totalLateNumber
+ ).''."\n";
if ($totallatePercentage > 0) {
- $weatherDashBoard .= ' '.$langs->trans('NActionsLate',
- price($totallatePercentage).'%').''."\n";
+ $weatherDashBoard .= ' '.$langs->trans(
+ 'NActionsLate',
+ price($totallatePercentage).'%'
+ ).''."\n";
}
}
@@ -840,8 +854,11 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
$boxwork .= ' | ||
|---|---|---|---|