2004-10-19 20:58:50 +02:00
< ? php
2024-07-06 14:32:06 +02:00
/* Copyright ( C ) 2003 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
* Copyright ( C ) 2003 Jean - Louis Bergamo < jlb @ j1b . org >
* Copyright ( C ) 2004 - 2012 Laurent Destailleur < eldy @ users . sourceforge . net >
* Copyright ( C ) 2004 Sebastien Di Cintio < sdicintio @ ressource - toi . org >
* Copyright ( C ) 2004 Benoit Mortier < benoit . mortier @ opensides . be >
* Copyright ( C ) 2005 - 2012 Regis Houssin < regis . houssin @ inodbox . com >
* Copyright ( C ) 2011 - 2012 Juanjo Menent < jmenent @ 2 byte . es >
* Copyright ( C ) 2012 J . Fernando Lagrange < fernando @ demo - tic . org >
* Copyright ( C ) 2015 Jean - François Ferry < jfefe @ aternatik . fr >
2024-11-04 23:53:20 +01:00
* Copyright ( C ) 2020 - 2024 Frédéric France < frederic . france @ free . fr >
2024-07-06 14:32:06 +02:00
* Copyright ( C ) 2023 Waël Almoman < info @ almoman . com >
2025-02-08 01:49:29 +01:00
* Copyright ( C ) 2024 - 2025 MDW < mdeweerd @ users . noreply . github . com >
2024-07-06 14:32:06 +02:00
* Copyright ( C ) 2024 Alexandre Spangaro < alexandre @ inovea - conseil . com >
2003-08-12 18:44:18 +02:00
*
* 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
2013-01-16 15:36:08 +01:00
* the Free Software Foundation ; either version 3 of the License , or
2003-08-12 18:44:18 +02:00
* ( 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
2019-09-23 21:55:30 +02:00
* along with this program . If not , see < https :// www . gnu . org / licenses />.
2003-08-12 18:44:18 +02:00
*/
2004-08-29 14:01:58 +02:00
2005-08-11 20:51:38 +02:00
/**
2021-09-11 09:49:01 +02:00
* \file htdocs / adherents / admin / member . php
2010-07-21 13:57:52 +02:00
* \ingroup member
2010-06-24 20:51:37 +02:00
* \brief Page to setup the module Foundation
2009-04-02 02:34:32 +02:00
*/
2004-08-29 14:01:58 +02:00
2022-09-07 20:08:59 +02:00
// Load Dolibarr environment
2012-08-22 23:24:21 +02:00
require '../../main.inc.php' ;
2012-08-22 23:11:24 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php' ;
2003-08-12 18:44:18 +02:00
2024-11-04 23:53:20 +01:00
/**
* @ var Conf $conf
* @ var DoliDB $db
* @ var HookManager $hookmanager
* @ var Translate $langs
* @ var User $user
*
* @ var array < string , array { name : string , paper - size : string | array { 0 : float , 1 : float }, orientation : string , metric : string , marginLeft : float , marginTop : float , NX : int , NY : int , SpaceX : float , SpaceY : float , width : float , height : float , font - size : float , custom_x : float , custom_y : float } > $_Avery_Labels
*/
2018-09-07 10:40:36 +02:00
// Load translation files required by the page
2020-04-10 10:59:32 +02:00
$langs -> loadLangs ( array ( " admin " , " members " ));
2004-08-29 14:01:58 +02:00
2021-03-01 00:19:52 +01:00
if ( ! $user -> admin ) {
accessforbidden ();
}
2004-08-29 14:01:58 +02:00
2003-08-12 18:44:18 +02:00
2020-11-14 00:48:13 +01:00
$choices = array ( 'yesno' , 'texte' , 'chaine' );
$value = GETPOST ( 'value' , 'alpha' );
$label = GETPOST ( 'label' , 'alpha' );
$scandir = GETPOST ( 'scandir' , 'alpha' );
$type = 'member' ;
2003-08-28 17:41:56 +02:00
2020-09-16 19:39:50 +02:00
$action = GETPOST ( 'action' , 'aZ09' );
2023-10-01 15:23:06 +02:00
$modulepart = GETPOST ( 'modulepart' , 'aZ09' );
2011-09-02 15:15:39 +02:00
2024-08-24 14:25:51 +02:00
$reg = array ();
2024-11-04 23:53:20 +01:00
$error = 0 ;
2024-08-24 14:25:51 +02:00
2004-11-12 15:37:38 +01:00
2012-01-11 18:43:38 +01:00
/*
* Actions
*/
2020-11-14 00:48:13 +01:00
include DOL_DOCUMENT_ROOT . '/core/actions_setmoduleoptions.inc.php' ;
2024-08-17 19:32:52 +02:00
global $conf ;
2020-11-14 00:48:13 +01:00
if ( $action == 'set_default' ) {
$ret = addDocumentModel ( $value , $type , $label , $scandir );
$res = true ;
} elseif ( $action == 'del_default' ) {
$ret = delDocumentModel ( $value , $type );
if ( $ret > 0 ) {
2022-05-16 13:05:17 +02:00
if ( getDolGlobalString ( 'MEMBER_ADDON_PDF_ODT' ) == " $value " ) {
2020-11-14 00:48:13 +01:00
dolibarr_del_const ( $db , 'MEMBER_ADDON_PDF_ODT' , $conf -> entity );
}
}
$res = true ;
} elseif ( $action == 'setdoc' ) {
// Set default model
if ( dolibarr_set_const ( $db , " MEMBER_ADDON_PDF_ODT " , $value , 'chaine' , 0 , '' , $conf -> entity )) {
2021-05-09 16:46:38 +02:00
// The constant that was read ahead of the new set
// we therefore go through a variable to have a consistent display
2020-11-14 00:48:13 +01:00
$conf -> global -> MEMBER_ADDON_PDF_ODT = $value ;
}
2021-05-09 16:46:38 +02:00
// We activate the model
2020-11-14 00:48:13 +01:00
$ret = delDocumentModel ( $value , $type );
if ( $ret > 0 ) {
$ret = addDocumentModel ( $value , $type , $label , $scandir );
}
$res = true ;
} elseif ( preg_match ( '/set_([a-z0-9_\-]+)/i' , $action , $reg )) {
$code = $reg [ 1 ];
if ( dolibarr_set_const ( $db , $code , 1 , 'chaine' , 0 , '' , $conf -> entity ) > 0 ) {
header ( " Location: " . $_SERVER [ " PHP_SELF " ]);
exit ;
} else {
dol_print_error ( $db );
}
} elseif ( preg_match ( '/del_([a-z0-9_\-]+)/i' , $action , $reg )) {
$code = $reg [ 1 ];
if ( dolibarr_del_const ( $db , $code , $conf -> entity ) > 0 ) {
header ( " Location: " . $_SERVER [ " PHP_SELF " ]);
exit ;
} else {
dol_print_error ( $db );
}
2022-10-08 16:00:42 +02:00
} elseif ( $action == 'updatemainoptions' ) {
2020-10-31 14:32:18 +01:00
$db -> begin ();
2023-11-07 18:05:36 +01:00
$res1 = $res2 = $res3 = $res4 = $res5 = $res6 = $res7 = $res8 = $res9 = 0 ;
2020-10-31 14:32:18 +01:00
$res1 = dolibarr_set_const ( $db , 'ADHERENT_LOGIN_NOT_REQUIRED' , GETPOST ( 'ADHERENT_LOGIN_NOT_REQUIRED' , 'alpha' ) ? 0 : 1 , 'chaine' , 0 , '' , $conf -> entity );
$res2 = dolibarr_set_const ( $db , 'ADHERENT_MAIL_REQUIRED' , GETPOST ( 'ADHERENT_MAIL_REQUIRED' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
$res3 = dolibarr_set_const ( $db , 'ADHERENT_DEFAULT_SENDINFOBYMAIL' , GETPOST ( 'ADHERENT_DEFAULT_SENDINFOBYMAIL' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2021-04-19 14:19:32 +02:00
$res3 = dolibarr_set_const ( $db , 'ADHERENT_CREATE_EXTERNAL_USER_LOGIN' , GETPOST ( 'ADHERENT_CREATE_EXTERNAL_USER_LOGIN' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2020-10-31 14:32:18 +01:00
$res4 = dolibarr_set_const ( $db , 'ADHERENT_BANK_USE' , GETPOST ( 'ADHERENT_BANK_USE' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2024-11-28 22:41:20 +01:00
if ( GETPOSTISSET ( 'MEMBER_PUBLIC_ENABLED' )) {
$res7 = dolibarr_set_const ( $db , 'MEMBER_PUBLIC_ENABLED' , GETPOST ( 'MEMBER_PUBLIC_ENABLED' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
}
2023-11-07 18:05:36 +01:00
$res8 = dolibarr_set_const ( $db , 'MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF' , GETPOST ( 'MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
$res9 = dolibarr_set_const ( $db , 'MEMBER_SUBSCRIPTION_START_AFTER' , GETPOST ( 'MEMBER_SUBSCRIPTION_START_AFTER' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2020-10-31 14:32:18 +01:00
// Use vat for invoice creation
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'invoice' )) {
2020-10-31 14:32:18 +01:00
$res4 = dolibarr_set_const ( $db , 'ADHERENT_VAT_FOR_SUBSCRIPTIONS' , GETPOST ( 'ADHERENT_VAT_FOR_SUBSCRIPTIONS' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
$res5 = dolibarr_set_const ( $db , 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS' , GETPOST ( 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-23 20:02:37 +02:00
if ( isModEnabled ( " product " ) || isModEnabled ( " service " )) {
2020-10-31 14:32:18 +01:00
$res6 = dolibarr_set_const ( $db , 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS' , GETPOST ( 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
}
}
2024-11-28 22:41:20 +01:00
if ( $res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0 || $res7 < 0 || $res8 < 0 || $res9 < 0 ) {
2023-07-02 20:27:04 +02:00
setEventMessages ( 'ErrorFailedToSaveData' , null , 'errors' );
2020-10-31 14:32:18 +01:00
$db -> rollback ();
} else {
setEventMessages ( 'RecordModifiedSuccessfully' , null , 'mesgs' );
$db -> commit ();
}
2022-10-08 16:00:42 +02:00
} elseif ( $action == 'updatememberscards' ) {
$db -> begin ();
$res1 = $res2 = $res3 = $res4 = 0 ;
$res1 = dolibarr_set_const ( $db , 'ADHERENT_CARD_TYPE' , GETPOST ( 'ADHERENT_CARD_TYPE' ), 'chaine' , 0 , '' , $conf -> entity );
$res2 = dolibarr_set_const ( $db , 'ADHERENT_CARD_HEADER_TEXT' , GETPOST ( 'ADHERENT_CARD_HEADER_TEXT' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
$res3 = dolibarr_set_const ( $db , 'ADHERENT_CARD_TEXT' , GETPOST ( 'ADHERENT_CARD_TEXT' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
$res3 = dolibarr_set_const ( $db , 'ADHERENT_CARD_TEXT_RIGHT' , GETPOST ( 'ADHERENT_CARD_TEXT_RIGHT' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
$res4 = dolibarr_set_const ( $db , 'ADHERENT_CARD_FOOTER_TEXT' , GETPOST ( 'ADHERENT_CARD_FOOTER_TEXT' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
if ( $res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 ) {
setEventMessages ( 'ErrorFailedToSaveDate' , null , 'errors' );
$db -> rollback ();
} else {
setEventMessages ( 'RecordModifiedSuccessfully' , null , 'mesgs' );
$db -> commit ();
}
} elseif ( $action == 'updatememberstickets' ) {
$db -> begin ();
$res1 = $res2 = 0 ;
$res1 = dolibarr_set_const ( $db , 'ADHERENT_ETIQUETTE_TYPE' , GETPOST ( 'ADHERENT_ETIQUETTE_TYPE' ), 'chaine' , 0 , '' , $conf -> entity );
$res2 = dolibarr_set_const ( $db , 'ADHERENT_ETIQUETTE_TEXT' , GETPOST ( 'ADHERENT_ETIQUETTE_TEXT' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
if ( $res1 < 0 || $res2 < 0 ) {
setEventMessages ( 'ErrorFailedToSaveDate' , null , 'errors' );
$db -> rollback ();
} else {
setEventMessages ( 'RecordModifiedSuccessfully' , null , 'mesgs' );
$db -> commit ();
}
2022-12-21 16:43:38 +01:00
} elseif ( $action == 'setcodemember' ) {
$result = dolibarr_set_const ( $db , " MEMBER_CODEMEMBER_ADDON " , $value , 'chaine' , 0 , '' , $conf -> entity );
if ( $result <= 0 ) {
dol_print_error ( $db );
}
} elseif ( $action == 'update' || $action == 'add' ) {
// Action to update or add a constant
2020-04-10 10:59:32 +02:00
$constname = GETPOST ( 'constname' , 'alpha' );
$constvalue = ( GETPOST ( 'constvalue_' . $constname ) ? GETPOST ( 'constvalue_' . $constname ) : GETPOST ( 'constvalue' ));
2012-01-08 16:58:55 +01:00
2022-10-08 16:00:42 +02:00
2021-03-01 00:19:52 +01:00
if (( $constname == 'ADHERENT_CARD_TYPE' || $constname == 'ADHERENT_ETIQUETTE_TYPE' || $constname == 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS' ) && $constvalue == - 1 ) {
$constvalue = '' ;
}
2020-05-21 09:12:18 +02:00
if ( $constname == 'ADHERENT_LOGIN_NOT_REQUIRED' ) { // Invert choice
2021-03-01 00:19:52 +01:00
if ( $constvalue ) {
$constvalue = 0 ;
} else {
$constvalue = 1 ;
}
2011-11-06 11:11:43 +01:00
}
2012-01-08 16:58:55 +01:00
2024-08-17 19:32:52 +02:00
$consttype = GETPOSTINT ( 'consttype' );
2020-04-10 10:59:32 +02:00
$constnote = GETPOST ( 'constnote' );
2020-11-14 00:48:13 +01:00
$res = dolibarr_set_const ( $db , $constname , $constvalue , $choices [ $consttype ], 0 , $constnote , $conf -> entity );
2012-01-08 16:58:55 +01:00
2021-03-01 00:19:52 +01:00
if ( ! ( $res > 0 )) {
$error ++ ;
}
2012-01-08 16:58:55 +01:00
2020-05-21 09:12:18 +02:00
if ( ! $error ) {
2015-10-23 12:58:30 +02:00
setEventMessages ( $langs -> trans ( " SetupSaved " ), null , 'mesgs' );
2020-05-21 00:47:16 +02:00
} else {
2015-10-23 12:58:30 +02:00
setEventMessages ( $langs -> trans ( " Error " ), null , 'errors' );
2011-11-06 11:11:43 +01:00
}
2003-08-28 17:41:56 +02:00
}
2003-08-12 18:44:18 +02:00
2019-09-19 22:33:26 +02:00
// Action to enable of a submodule of the adherent module
2020-05-21 09:12:18 +02:00
if ( $action == 'set' ) {
2020-10-31 14:32:18 +01:00
$result = dolibarr_set_const ( $db , GETPOST ( 'name' , 'alpha' ), GETPOST ( 'value' ), '' , 0 , '' , $conf -> entity );
if ( $result < 0 ) {
print $db -> error ();
}
2003-08-12 18:44:18 +02:00
}
2019-09-19 22:33:26 +02:00
// Action to disable a submodule of the adherent module
2020-05-21 09:12:18 +02:00
if ( $action == 'unset' ) {
2020-10-31 14:32:18 +01:00
$result = dolibarr_del_const ( $db , GETPOST ( 'name' , 'alpha' ), $conf -> entity );
if ( $result < 0 ) {
print $db -> error ();
}
2003-08-12 18:44:18 +02:00
}
2007-10-04 20:29:29 +02:00
2010-02-11 23:48:10 +01:00
2009-04-02 02:34:32 +02:00
/*
* View
*/
2007-10-07 16:45:42 +02:00
2013-09-06 12:10:09 +02:00
$form = new Form ( $db );
2024-07-06 14:32:06 +02:00
$title = $langs -> trans ( " MembersSetup " );
2021-03-15 15:46:43 +01:00
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder' ;
2003-08-12 18:44:18 +02:00
2024-07-06 14:32:06 +02:00
llxHeader ( '' , $title , $help_url , '' , 0 , 0 , '' , '' , '' , 'mod-member page-admin' );
2009-04-02 02:34:32 +02:00
2003-08-12 18:44:18 +02:00
2020-04-10 10:59:32 +02:00
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs -> trans ( " BackToModuleList " ) . '</a>' ;
2019-01-27 11:55:16 +01:00
print load_fiche_titre ( $langs -> trans ( " MembersSetup " ), $linkback , 'title_setup' );
2011-06-22 17:43:14 +02:00
2012-09-13 11:52:50 +02:00
$head = member_admin_prepare_head ();
2011-06-22 17:43:14 +02:00
2020-10-22 22:50:03 +02:00
print dol_get_fiche_head ( $head , 'general' , $langs -> trans ( " Members " ), - 1 , 'user' );
2017-05-13 13:02:55 +02:00
2022-12-21 16:43:38 +01:00
$dirModMember = array_merge ( array ( '/core/modules/member/' ), $conf -> modules_parts [ 'member' ]);
foreach ( $conf -> modules_parts [ 'models' ] as $mo ) {
//Add more models
$dirModMember [] = $mo . 'core/modules/member/' ;
}
// Module to manage customer/supplier code
print load_fiche_titre ( $langs -> trans ( " MemberCodeChecker " ), '' , '' );
print '<div class="div-table-responsive-no-min">' ;
print '<table class="noborder centpercent">' . " \n " ;
print '<tr class="liste_titre">' . " \n " ;
print ' <td>' . $langs -> trans ( " Name " ) . '</td>' ;
print ' <td>' . $langs -> trans ( " Description " ) . '</td>' ;
print ' <td>' . $langs -> trans ( " Example " ) . '</td>' ;
print ' <td class="center" width="80">' . $langs -> trans ( " Status " ) . '</td>' ;
print ' <td class="center" width="60">' . $langs -> trans ( " ShortInfo " ) . '</td>' ;
print " </tr> \n " ;
$arrayofmodules = array ();
foreach ( $dirModMember as $dirroot ) {
$dir = dol_buildpath ( $dirroot , 0 );
$handle = @ opendir ( $dir );
if ( is_resource ( $handle )) {
// Loop on each module find in opened directory
while (( $file = readdir ( $handle )) !== false ) {
// module filename has to start with mod_member_
if ( substr ( $file , 0 , 11 ) == 'mod_member_' && substr ( $file , - 3 ) == 'php' ) {
$file = substr ( $file , 0 , dol_strlen ( $file ) - 4 );
try {
dol_include_once ( $dirroot . $file . '.php' );
} catch ( Exception $e ) {
dol_syslog ( $e -> getMessage (), LOG_ERR );
continue ;
}
2023-12-04 11:41:14 +01:00
$modCodeMember = new $file ();
2022-12-21 16:43:38 +01:00
// Show modules according to features level
2023-11-27 12:24:18 +01:00
if ( $modCodeMember -> version == 'development' && getDolGlobalInt ( 'MAIN_FEATURES_LEVEL' ) < 2 ) {
2022-12-21 16:43:38 +01:00
continue ;
}
2023-11-27 12:24:18 +01:00
if ( $modCodeMember -> version == 'experimental' && getDolGlobalInt ( 'MAIN_FEATURES_LEVEL' ) < 1 ) {
2022-12-21 16:43:38 +01:00
continue ;
}
$arrayofmodules [ $file ] = $modCodeMember ;
}
}
closedir ( $handle );
}
}
$arrayofmodules = dol_sort_array ( $arrayofmodules , 'position' );
2024-03-24 21:04:19 +01:00
'@phan-var-force array<string,ModeleNumRefMembers> $arrayofmodules' ;
2022-12-21 16:43:38 +01:00
foreach ( $arrayofmodules as $file => $modCodeMember ) {
print '<tr class="oddeven">' . " \n " ;
print '<td width="140">' . $modCodeMember -> name . '</td>' . " \n " ;
print '<td>' . $modCodeMember -> info ( $langs ) . '</td>' . " \n " ;
2024-08-17 19:32:52 +02:00
print '<td class="nowrap">' . $modCodeMember -> getExample () . '</td>' . " \n " ;
2022-12-21 16:43:38 +01:00
if ( getDolGlobalString ( 'MEMBER_CODEMEMBER_ADDON' ) == " $file " ) {
print '<td class="center">' . " \n " ;
print img_picto ( $langs -> trans ( " Activated " ), 'switch_on' );
print " </td> \n " ;
} else {
2024-08-07 03:05:02 +02:00
$disabled = isModEnabled ( 'multicompany' ) && (( is_object ( $mc ) && ! empty ( $mc -> sharings [ 'referent' ]) && $mc -> sharings [ 'referent' ] != $conf -> entity ));
2022-12-21 16:43:38 +01:00
print '<td class="center">' ;
if ( ! $disabled ) {
print '<a class="reposition" href="' . $_SERVER [ 'PHP_SELF' ] . '?action=setcodemember&token=' . newToken () . '&value=' . urlencode ( $file ) . '">' ;
}
print img_picto ( $langs -> trans ( " Disabled " ), 'switch_off' );
if ( ! $disabled ) {
print '</a>' ;
}
print '</td>' ;
}
print '<td class="center">' ;
2024-08-14 01:24:55 +02:00
$s = $modCodeMember -> getToolTip ( $langs , null );
2022-12-21 16:43:38 +01:00
print $form -> textwithpicto ( '' , $s , 1 );
print '</td>' ;
print '</tr>' ;
}
print '</table>' ;
print '</div>' ;
2023-07-02 20:27:04 +02:00
2013-03-06 17:16:26 +01:00
2024-05-03 03:02:04 +02:00
print " <br> " ;
2017-05-13 13:02:55 +02:00
2010-02-07 05:31:19 +01:00
2010-02-13 23:20:32 +01:00
2022-10-13 10:21:34 +02:00
// Document templates for documents generated from member record
2022-10-08 16:00:42 +02:00
2020-11-14 00:48:13 +01:00
$dirmodels = array_merge ( array ( '/' ), ( array ) $conf -> modules_parts [ 'models' ]);
2021-05-09 16:46:38 +02:00
// Defined model definition table
2020-11-14 00:48:13 +01:00
$def = array ();
2022-02-18 13:46:12 +01:00
$sql = " SELECT nom as name " ;
2020-11-14 00:48:13 +01:00
$sql .= " FROM " . MAIN_DB_PREFIX . " document_model " ;
$sql .= " WHERE type = ' " . $db -> escape ( $type ) . " ' " ;
$sql .= " AND entity = " . $conf -> entity ;
$resql = $db -> query ( $sql );
if ( $resql ) {
$i = 0 ;
$num_rows = $db -> num_rows ( $resql );
while ( $i < $num_rows ) {
2022-02-18 13:46:12 +01:00
$obj = $db -> fetch_object ( $resql );
array_push ( $def , $obj -> name );
2020-11-14 00:48:13 +01:00
$i ++ ;
}
} else {
dol_print_error ( $db );
}
2022-02-18 13:46:12 +01:00
2020-11-14 00:48:13 +01:00
print load_fiche_titre ( $langs -> trans ( " MembersDocModules " ), '' , '' );
2021-05-24 19:05:25 +02:00
print '<div class="div-table-responsive-no-min">' ;
2020-11-14 00:48:13 +01:00
print '<table class="noborder centpercent">' ;
print '<tr class="liste_titre">' ;
print '<td>' . $langs -> trans ( " Name " ) . '</td>' ;
print '<td>' . $langs -> trans ( " Description " ) . '</td>' ;
print '<td align="center" width="60">' . $langs -> trans ( " Status " ) . " </td> \n " ;
print '<td align="center" width="60">' . $langs -> trans ( " Default " ) . " </td> \n " ;
print '<td align="center" width="80">' . $langs -> trans ( " ShortInfo " ) . '</td>' ;
print '<td align="center" width="80">' . $langs -> trans ( " Preview " ) . '</td>' ;
print " </tr> \n " ;
clearstatcache ();
foreach ( $dirmodels as $reldir ) {
foreach ( array ( '' , '/doc' ) as $valdir ) {
$dir = dol_buildpath ( $reldir . " core/modules/member " . $valdir );
if ( is_dir ( $dir )) {
$handle = opendir ( $dir );
if ( is_resource ( $handle )) {
2024-03-09 02:43:57 +01:00
$filelist = array ();
2020-11-14 00:48:13 +01:00
while (( $file = readdir ( $handle )) !== false ) {
$filelist [] = $file ;
}
closedir ( $handle );
arsort ( $filelist );
foreach ( $filelist as $file ) {
if ( preg_match ( '/\.class\.php$/i' , $file ) && preg_match ( '/^(pdf_|doc_)/' , $file )) {
if ( file_exists ( $dir . '/' . $file )) {
$name = substr ( $file , 4 , dol_strlen ( $file ) - 14 );
$classname = substr ( $file , 0 , dol_strlen ( $file ) - 10 );
require_once $dir . '/' . $file ;
$module = new $classname ( $db );
2024-08-17 19:32:52 +02:00
'@phan-var-force doc_generic_member_odt|pdf_standard_member $module' ;
2020-11-14 00:48:13 +01:00
$modulequalified = 1 ;
2023-11-27 12:24:18 +01:00
if ( $module -> version == 'development' && getDolGlobalInt ( 'MAIN_FEATURES_LEVEL' ) < 2 ) {
2021-03-01 00:19:52 +01:00
$modulequalified = 0 ;
}
2023-11-27 12:24:18 +01:00
if ( $module -> version == 'experimental' && getDolGlobalInt ( 'MAIN_FEATURES_LEVEL' ) < 1 ) {
2020-11-14 00:48:13 +01:00
$modulequalified = 0 ;
}
if ( $modulequalified ) {
print '<tr class="oddeven"><td width="100">' ;
2023-12-04 11:41:14 +01:00
print ( empty ( $module -> name ) ? $name : $module -> name );
2020-11-14 00:48:13 +01:00
print " </td><td> \n " ;
if ( method_exists ( $module , 'info' )) {
print $module -> info ( $langs );
} else {
print $module -> description ;
}
print '</td>' ;
// Active
if ( in_array ( $name , $def )) {
print '<td class="center">' . " \n " ;
2021-09-19 14:41:46 +02:00
print '<a href="' . $_SERVER [ " PHP_SELF " ] . '?action=del_default&token=' . newToken () . '&value=' . $name . '">' ;
2020-11-14 00:48:13 +01:00
print img_picto ( $langs -> trans ( " Enabled " ), 'switch_on' );
print '</a>' ;
print '</td>' ;
} else {
print '<td class="center">' . " \n " ;
2022-05-18 12:31:09 +02:00
print '<a href="' . $_SERVER [ " PHP_SELF " ] . '?action=set_default&token=' . newToken () . '&value=' . $name . '&scandir=' . ( ! empty ( $module -> scandir ) ? $module -> scandir : '' ) . '&label=' . urlencode ( $module -> name ) . '">' . img_picto ( $langs -> trans ( " Disabled " ), 'switch_off' ) . '</a>' ;
2020-11-14 00:48:13 +01:00
print " </td> " ;
}
2024-01-12 20:58:09 +01:00
// Default
2020-11-14 00:48:13 +01:00
print '<td class="center">' ;
2023-03-31 19:41:29 +02:00
if ( getDolGlobalString ( 'MEMBER_ADDON_PDF_ODT' ) == $name ) {
2020-11-14 00:48:13 +01:00
print img_picto ( $langs -> trans ( " Default " ), 'on' );
} else {
2022-05-18 12:31:09 +02:00
print '<a href="' . $_SERVER [ " PHP_SELF " ] . '?action=setdoc&token=' . newToken () . '&value=' . $name . '&scandir=' . ( ! empty ( $module -> scandir ) ? $module -> scandir : '' ) . '&label=' . urlencode ( $module -> name ) . '" alt="' . $langs -> trans ( " Default " ) . '">' . img_picto ( $langs -> trans ( " Disabled " ), 'off' ) . '</a>' ;
2020-11-14 00:48:13 +01:00
}
print '</td>' ;
// Info
$htmltooltip = '' . $langs -> trans ( " Name " ) . ': ' . $module -> name ;
$htmltooltip .= '<br>' . $langs -> trans ( " Type " ) . ': ' . ( $module -> type ? $module -> type : $langs -> trans ( " Unknown " ));
if ( $module -> type == 'pdf' ) {
$htmltooltip .= '<br>' . $langs -> trans ( " Width " ) . '/' . $langs -> trans ( " Height " ) . ': ' . $module -> page_largeur . '/' . $module -> page_hauteur ;
}
$htmltooltip .= '<br><br><u>' . $langs -> trans ( " FeaturesSupported " ) . ':</u>' ;
2022-05-18 12:31:09 +02:00
$htmltooltip .= '<br>' . $langs -> trans ( " Logo " ) . ': ' . yn ( ! empty ( $module -> option_logo ) ? $module -> option_logo : 0 , 1 , 1 );
$htmltooltip .= '<br>' . $langs -> trans ( " MultiLanguage " ) . ': ' . yn ( ! empty ( $module -> option_multilang ) ? $module -> option_multilang : 0 , 1 , 1 );
2020-11-14 00:48:13 +01:00
print '<td class="center">' ;
2025-02-08 01:49:29 +01:00
print $form -> textwithpicto ( '' , $htmltooltip , 1 , 'info' );
2020-11-14 00:48:13 +01:00
print '</td>' ;
// Preview
print '<td class="center">' ;
2021-03-01 00:19:52 +01:00
if ( $module -> type == 'pdf' ) {
2020-11-14 00:48:13 +01:00
print '<a href="' . $_SERVER [ " PHP_SELF " ] . '?action=specimen&module=' . $name . '">' . img_object ( $langs -> trans ( " Preview " ), 'contract' ) . '</a>' ;
} else {
2025-01-08 17:45:28 +01:00
print img_object ( $langs -> transnoentitiesnoconv ( " PreviewNotAvailable " ), 'generic' );
2020-11-14 00:48:13 +01:00
}
print '</td>' ;
print " </tr> \n " ;
}
}
}
}
}
}
}
}
print '</table>' ;
2021-05-24 19:05:25 +02:00
print '</div>' ;
2022-02-18 13:46:12 +01:00
2024-05-03 03:02:04 +02:00
print '<br>' ;
print '<form action="' . $_SERVER [ " PHP_SELF " ] . '" method="POST">' ;
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
print '<input type="hidden" name="action" value="updatemainoptions">' ;
print '<input type="hidden" name="page_y" value="">' ;
// Main options
print load_fiche_titre ( $langs -> trans ( " MemberMainOptions " ), '' , '' );
print '<div class="div-table-responsive-no-min">' ;
print '<table class="noborder centpercent">' ;
print '<tr class="liste_titre">' ;
print '<td>' . $langs -> trans ( " Description " ) . '</td>' ;
print '<td class="soixantepercent">' . $langs -> trans ( " Value " ) . '</td>' ;
print " </tr> \n " ;
2024-07-20 12:06:05 +02:00
// Delay to start the new membership ([+/-][0-99][Y/m/d], for instance, with "+4m", the subscription will start in 4 month.)
print '<tr class="oddeven drag" id="startfirstdayof"><td>' ;
print $form -> textwithpicto ( $langs -> trans ( " MemberSubscriptionStartAfter " ), $langs -> trans ( " MemberSubscriptionStartAfterDesc " ) . '<br>' . $langs -> trans ( " MemberSubscriptionStartAfterDesc2 " ));
print '</td><td>' ;
print '<input type="text" class="right width50" id="MEMBER_SUBSCRIPTION_START_AFTER" name="MEMBER_SUBSCRIPTION_START_AFTER" value="' . getDolGlobalString ( 'MEMBER_SUBSCRIPTION_START_AFTER' ) . '">' ;
print " </td></tr> \n " ;
2024-05-03 03:02:04 +02:00
// Start date of new membership
$startpoint = array ();
2024-07-20 12:06:05 +02:00
$startpoint [ 0 ] = $langs -> trans ( " NoCorrection " );
2024-05-03 03:02:04 +02:00
$startpoint [ " m " ] = $langs -> trans ( " Month " );
2024-09-23 02:30:06 +02:00
$startpoint [ " 3m " ] = $langs -> trans ( " Quarter " );
2024-05-03 03:02:04 +02:00
$startpoint [ " Y " ] = $langs -> trans ( " Year " );
print '<tr class="oddeven drag" id="startfirstdayof"><td>' ;
print $langs -> trans ( " MemberSubscriptionStartFirstDayOf " );
print '</td><td>' ;
$startfirstdayof = ! getDolGlobalString ( 'MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF' ) ? 0 : getDolGlobalString ( 'MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF' );
print $form -> selectarray ( " MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF " , $startpoint , $startfirstdayof , 0 );
print " </td></tr> \n " ;
// Mail required for members
print '<tr class="oddeven"><td>' . $langs -> trans ( " AdherentMailRequired " ) . '</td><td>' ;
2024-05-29 21:00:58 +02:00
print $form -> selectyesno ( 'ADHERENT_MAIL_REQUIRED' , getDolGlobalInt ( 'ADHERENT_MAIL_REQUIRED' ), 1 , false , 0 , 1 );
2024-05-03 03:02:04 +02:00
print " </td></tr> \n " ;
// Login/Pass required for members
print '<tr class="oddeven"><td>' ;
print $form -> textwithpicto ( $langs -> trans ( " AdherentLoginRequired " ), $langs -> trans ( " AdherentLoginRequiredDesc " ));
print '</td><td>' ;
2024-05-29 21:00:58 +02:00
print $form -> selectyesno ( 'ADHERENT_LOGIN_NOT_REQUIRED' , ( getDolGlobalString ( 'ADHERENT_LOGIN_NOT_REQUIRED' ) ? 0 : 1 ), 1 , false , 0 , 1 );
2024-05-03 03:02:04 +02:00
print " </td></tr> \n " ;
2024-07-20 13:59:26 +02:00
// Create an external user login after an online payment of a membership subscription
// TODO Move this into the validate() method of the member.
print '<tr class="oddeven"><td>' . $langs -> trans ( " MemberCreateAnExternalUserForSubscriptionValidated " ) . '</td><td>' ;
print $form -> selectyesno ( 'ADHERENT_CREATE_EXTERNAL_USER_LOGIN' , getDolGlobalInt ( 'ADHERENT_CREATE_EXTERNAL_USER_LOGIN' ), 1 , false , 0 , 1 );
print " </td></tr> \n " ;
2024-05-03 03:02:04 +02:00
// Send mail information is on by default
print '<tr class="oddeven"><td>' . $langs -> trans ( " MemberSendInformationByMailByDefault " ) . '</td><td>' ;
2024-05-29 21:00:58 +02:00
print $form -> selectyesno ( 'ADHERENT_DEFAULT_SENDINFOBYMAIL' , getDolGlobalInt ( 'ADHERENT_DEFAULT_SENDINFOBYMAIL' ), 1 , false , 0 , 1 );
2024-05-03 03:02:04 +02:00
print " </td></tr> \n " ;
2024-07-20 13:59:26 +02:00
// Publish member information on public annuary
2024-11-28 22:41:20 +01:00
/* Feature disabled by default for security purpose .
$linkofpubliclist = DOL_MAIN_URL_ROOT . '/public/members/public_list.php' . (( isModEnabled ( 'multicompany' )) ? '?entity=' . (( int ) $conf -> entity ) : '' );
print '<tr class="oddeven"><td>' . $langs -> trans ( " Public " , getDolGlobalString ( 'MAIN_INFO_SOCIETE_NOM' ), $linkofpubliclist ) . '</td><td>' ;
print $form -> selectyesno ( 'MEMBER_PUBLIC_ENABLED' , getDolGlobalInt ( 'MEMBER_PUBLIC_ENABLED' ), 1 , false , 0 , 1 );
print " </td></tr> \n " ;
*/
2024-05-03 03:02:04 +02:00
// Allow members to change type on renewal forms
/* To test during next beta
print '<tr class="oddeven"><td>' . $langs -> trans ( " MemberAllowchangeOfType " ) . '</td><td>' ;
print $form -> selectyesno ( 'MEMBER_ALLOW_CHANGE_OF_TYPE' , ( getDolGlobalInt ( 'MEMBER_ALLOW_CHANGE_OF_TYPE' ) ? 0 : 1 ), 1 );
print " </td></tr> \n " ;
*/
// Insert subscription into bank account
print '<tr class="oddeven"><td>' . $langs -> trans ( " MoreActionsOnSubscription " ) . '</td>' ;
$arraychoices = array ( '0' => $langs -> trans ( " None " ));
if ( isModEnabled ( " bank " )) {
$arraychoices [ 'bankdirect' ] = $langs -> trans ( " MoreActionBankDirect " );
}
if ( isModEnabled ( " bank " ) && isModEnabled ( " societe " ) && isModEnabled ( 'invoice' )) {
$arraychoices [ 'invoiceonly' ] = $langs -> trans ( " MoreActionInvoiceOnly " );
}
if ( isModEnabled ( " bank " ) && isModEnabled ( " societe " ) && isModEnabled ( 'invoice' )) {
$arraychoices [ 'bankviainvoice' ] = $langs -> trans ( " MoreActionBankViaInvoice " );
}
print '<td>' ;
print $form -> selectarray ( 'ADHERENT_BANK_USE' , $arraychoices , getDolGlobalString ( 'ADHERENT_BANK_USE' ), 0 );
if ( getDolGlobalString ( 'ADHERENT_BANK_USE' ) == 'bankdirect' || getDolGlobalString ( 'ADHERENT_BANK_USE' ) == 'bankviainvoice' ) {
print '<br><div style="padding-top: 5px;"><span class="opacitymedium">' . $langs -> trans ( " ABankAccountMustBeDefinedOnPaymentModeSetup " ) . '</span></div>' ;
}
print '</td>' ;
print " </tr> \n " ;
// Use vat for invoice creation
if ( isModEnabled ( 'invoice' )) {
print '<tr class="oddeven"><td>' . $langs -> trans ( " VATToUseForSubscriptions " ) . '</td>' ;
if ( isModEnabled ( " bank " )) {
print '<td>' ;
print $form -> selectarray ( 'ADHERENT_VAT_FOR_SUBSCRIPTIONS' , array ( '0' => $langs -> trans ( " NoVatOnSubscription " ), 'defaultforfoundationcountry' => $langs -> trans ( " Default " )), getDolGlobalString ( 'ADHERENT_VAT_FOR_SUBSCRIPTIONS' , '0' ), 0 );
print '</td>' ;
} else {
print '<td class="right">' ;
print $langs -> trans ( " WarningModuleNotActive " , $langs -> transnoentities ( " Module85Name " ));
print '</td>' ;
}
print " </tr> \n " ;
if ( isModEnabled ( " product " ) || isModEnabled ( " service " )) {
print '<tr class="oddeven"><td>' . $langs -> trans ( " ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS " ) . '</td>' ;
print '<td>' ;
$selected = getDolGlobalString ( 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS' );
print img_picto ( '' , 'product' , 'class="pictofixedwidth"' );
2024-05-29 21:00:58 +02:00
$form -> select_produits ( $selected , 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS' , '' , 0 , 0 , 1 , 2 , '' , 0 , [], 0 , 1 , 0 , 'minwidth100 maxwidth500 widthcentpercentminusx' );
2024-05-03 03:02:04 +02:00
print '</td>' ;
}
print " </tr> \n " ;
}
print '</table>' ;
print '</div>' ;
print '<div class="center">' ;
print '<input type="submit" class="button reposition" value="' . $langs -> trans ( " Update " ) . '" name="Button">' ;
print '</div>' ;
print '</form>' ;
print '<br>' ;
2022-02-18 14:14:34 +01:00
2022-10-08 16:00:42 +02:00
2022-10-13 10:21:34 +02:00
// Generation of cards for members
2022-10-08 16:00:42 +02:00
2022-02-18 14:14:34 +01:00
print '<form action="' . $_SERVER [ " PHP_SELF " ] . '" method="POST">' ;
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
2022-10-08 16:00:42 +02:00
print '<input type="hidden" name="action" value="updatememberscards">' ;
2024-05-03 03:02:04 +02:00
print '<input type="hidden" name="page_y" value="">' ;
2022-02-18 13:46:12 +01:00
print load_fiche_titre ( $langs -> trans ( " MembersCards " ), '' , '' );
$helptext = '*' . $langs -> trans ( " FollowingConstantsWillBeSubstituted " ) . '<br>' ;
$helptext .= '__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, ' ;
$helptext .= '__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, ' ;
$helptext .= '__YEAR__, __MONTH__, __DAY__' ;
2022-10-08 16:00:42 +02:00
print '<div class="div-table-responsive-no-min">' ;
print '<table class="noborder centpercent">' ;
print '<tr class="liste_titre">' ;
print '<td>' . $langs -> trans ( " Description " ) . '</td>' ;
2024-05-03 03:02:04 +02:00
print '<td class="soixantepercent">' . $form -> textwithpicto ( $langs -> trans ( " Value " ), $helptext , 1 , 'help' , '' , 0 , 2 , 'idhelptext' ) . '</td>' ;
2022-10-08 16:00:42 +02:00
print " </tr> \n " ;
// Format of cards page
print '<tr class="oddeven"><td>' . $langs -> trans ( " DescADHERENT_CARD_TYPE " ) . '</td><td>' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/format_cards.lib.php' ; // List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php)
$arrayoflabels = array ();
foreach ( array_keys ( $_Avery_Labels ) as $codecards ) {
$arrayoflabels [ $codecards ] = $_Avery_Labels [ $codecards ][ 'name' ];
}
print $form -> selectarray ( 'ADHERENT_CARD_TYPE' , $arrayoflabels , getDolGlobalString ( 'ADHERENT_CARD_TYPE' ) ? getDolGlobalString ( 'ADHERENT_CARD_TYPE' ) : 'CARD' , 1 , 0 , 0 );
print " </td></tr> \n " ;
// Text printed on top of member cards
print '<tr class="oddeven"><td>' . $langs -> trans ( " DescADHERENT_CARD_HEADER_TEXT " ) . '</td><td>' ;
print '<input type="text" class="flat minwidth300" name="ADHERENT_CARD_HEADER_TEXT" value="' . dol_escape_htmltag ( getDolGlobalString ( 'ADHERENT_CARD_HEADER_TEXT' )) . '">' ;
print " </td></tr> \n " ;
// Text printed on member cards (align on left)
print '<tr class="oddeven"><td>' . $langs -> trans ( " DescADHERENT_CARD_TEXT " ) . '</td><td>' ;
print '<textarea class="flat" name="ADHERENT_CARD_TEXT" cols="50" rows="5" wrap="soft">' . " \n " ;
print getDolGlobalString ( 'ADHERENT_CARD_TEXT' );
print '</textarea>' ;
print " </td></tr> \n " ;
// Text printed on member cards (align on right)
print '<tr class="oddeven"><td>' . $langs -> trans ( " DescADHERENT_CARD_TEXT_RIGHT " ) . '</td><td>' ;
print '<textarea class="flat" name="ADHERENT_CARD_TEXT_RIGHT" cols="50" rows="5" wrap="soft">' . " \n " ;
print getDolGlobalString ( 'ADHERENT_CARD_TEXT_RIGHT' );
print '</textarea>' ;
print " </td></tr> \n " ;
// Text printed on bottom of member cards
print '<tr class="oddeven"><td>' . $langs -> trans ( " DescADHERENT_CARD_FOOTER_TEXT " ) . '</td><td>' ;
print '<input type="text" class="flat minwidth300" name="ADHERENT_CARD_FOOTER_TEXT" value="' . dol_escape_htmltag ( getDolGlobalString ( 'ADHERENT_CARD_FOOTER_TEXT' )) . '">' ;
print " </td></tr> \n " ;
print '</table>' ;
print '</div>' ;
print '<div class="center">' ;
2024-05-03 03:02:04 +02:00
print '<input type="submit" class="button reposition" value="' . $langs -> trans ( " Update " ) . '" name="Button">' ;
2022-10-08 16:00:42 +02:00
print '</div>' ;
print '</form>' ;
2022-02-18 13:46:12 +01:00
print '<br>' ;
2024-05-29 21:00:58 +02:00
2022-10-13 10:21:34 +02:00
// Membership address sheet
2022-02-18 13:46:12 +01:00
2022-10-08 16:00:42 +02:00
print '<form action="' . $_SERVER [ " PHP_SELF " ] . '" method="POST">' ;
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
print '<input type="hidden" name="action" value="updatememberstickets">' ;
2024-05-03 03:02:04 +02:00
print '<input type="hidden" name="page_y" value="">' ;
2022-02-18 13:46:12 +01:00
print load_fiche_titre ( $langs -> trans ( " MembersTickets " ), '' , '' );
$helptext = '*' . $langs -> trans ( " FollowingConstantsWillBeSubstituted " ) . '<br>' ;
$helptext .= '__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, ' ;
$helptext .= '__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, ' ;
$helptext .= '__YEAR__, __MONTH__, __DAY__' ;
2022-10-08 16:00:42 +02:00
print '<div class="div-table-responsive-no-min">' ;
print '<table class="noborder centpercent">' ;
print '<tr class="liste_titre">' ;
print '<td>' . $langs -> trans ( " Description " ) . '</td>' ;
2024-05-03 03:02:04 +02:00
print '<td class="soixantepercent">' . $form -> textwithpicto ( $langs -> trans ( " Value " ), $helptext , 1 , 'help' , '' , 0 , 2 , 'idhelptext' ) . '</td>' ;
2022-10-08 16:00:42 +02:00
print " </tr> \n " ;
// Format of labels page
print '<tr class="oddeven"><td>' . $langs -> trans ( " DescADHERENT_ETIQUETTE_TYPE " ) . '</td><td>' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/format_cards.lib.php' ; // List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php)
$arrayoflabels = array ();
foreach ( array_keys ( $_Avery_Labels ) as $codecards ) {
$arrayoflabels [ $codecards ] = $_Avery_Labels [ $codecards ][ 'name' ];
}
print $form -> selectarray ( 'ADHERENT_ETIQUETTE_TYPE' , $arrayoflabels , getDolGlobalString ( 'ADHERENT_ETIQUETTE_TYPE' ) ? getDolGlobalString ( 'ADHERENT_ETIQUETTE_TYPE' ) : 'CARD' , 1 , 0 , 0 );
print " </td></tr> \n " ;
2022-02-18 13:46:12 +01:00
2022-10-08 16:00:42 +02:00
// Text printed on member address sheets
print '<tr class="oddeven"><td>' . $langs -> trans ( " DescADHERENT_ETIQUETTE_TEXT " ) . '</td><td>' ;
print '<textarea class="flat" name="ADHERENT_ETIQUETTE_TEXT" cols="50" rows="5" wrap="soft">' . " \n " ;
print getDolGlobalString ( 'ADHERENT_ETIQUETTE_TEXT' );
print '</textarea>' ;
print " </td></tr> \n " ;
print '</table>' ;
print '</div>' ;
print '<div class="center">' ;
2024-05-03 03:02:04 +02:00
print '<input type="submit" class="button reposition" value="' . $langs -> trans ( " Update " ) . '" name="Button">' ;
2022-10-08 16:00:42 +02:00
print '</div>' ;
print '</form>' ;
print '<br>' ;
2022-02-18 13:46:12 +01:00
2020-11-14 00:48:13 +01:00
print " <br> " ;
2012-04-28 16:37:58 +02:00
2020-10-27 18:19:31 +01:00
print dol_get_fiche_end ();
2011-06-22 17:43:14 +02:00
2018-07-28 14:29:28 +02:00
// End of page
2011-08-27 16:24:16 +02:00
llxFooter ();
2012-01-11 18:43:38 +01:00
$db -> close ();