33require
'../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
47$langs->loadLangs(array(
'admin',
'members',
'users'));
51$action =
GETPOST(
'action',
'aZ09');
52$backtopage =
GETPOST(
'backtopage',
'alpha');
53$modulepart =
GETPOST(
'modulepart',
'aZ09');
55$value =
GETPOST(
'value',
'alpha');
56$label =
GETPOST(
'label',
'alpha');
58$scandir =
GETPOST(
'scandir',
'alpha');
61if (empty($user->admin)) {
70include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
74if ($action ==
'set_default') {
77} elseif ($action ==
'del_default') {
80 if (
$conf->global->USER_ADDON_PDF_ODT ==
"$value") {
85} elseif ($action ==
'setdoc') {
90 $conf->global->USER_ADDON_PDF_ODT = $value;
99} elseif ($action ==
'unsetdoc') {
102} elseif (preg_match(
'/set_([a-z0-9_\-]+)/i', $action, $reg)) {
105 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
110} elseif (preg_match(
'/del_([a-z0-9_\-]+)/i', $action, $reg)) {
113 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
118} elseif ($action ==
'sethideinactiveuser') {
120 $status =
GETPOST(
'status',
'alpha');
123 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
135$form =
new Form($db);
137dol_mkdir(DOL_DATA_ROOT.
'/doctemplates/users');
138dol_mkdir(DOL_DATA_ROOT.
'/doctemplates/usergroups');
140$help_url =
'EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios';
141llxHeader(
'', $langs->trans(
"UsersSetup"), $help_url,
'', 0, 0,
'',
'',
'',
'mod-admin page-user');
143$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
144print
load_fiche_titre($langs->trans(
"UsersSetup"), $linkback,
'title_setup');
149print
dol_get_fiche_head($head,
'card', $langs->trans(
"MenuUsersAndGroups"), -1,
'user');
153print
'<div class="div-table-responsive-no-min">';
154print
'<table class="noborder centpercent">';
155print
'<tr class="liste_titre">';
156print
'<td>'.$langs->trans(
"Parameter").
'</td>';
157print
'<td align="center" width="20"> </td>';
158print
'<td align="center" width="100"></td>'.
"\n";
164print
'<tr class="oddeven">';
165print
'<td>'.$langs->trans(
"UserMailRequired").
'</td>';
166print
'<td align="center" width="20"> </td>';
168print
'<td align="center" width="100">';
169if (
$conf->use_javascript_ajax) {
170 print ajax_constantonoff(
'USER_MAIL_REQUIRED');
173 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?action=set_USER_MAIL_REQUIRED&token='.
newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
175 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?action=del_USER_MAIL_REQUIRED&token='.
newToken().
'">'.
img_picto($langs->trans(
"Enabled"),
'on').
'</a>';
182print
'<tr class="oddeven">';
183print
'<td>'.$langs->trans(
"UserHideInactive").
'</td>';
184print
'<td align="center" width="20"> </td>';
186print
'<td align="center" width="100">';
187if (
$conf->use_javascript_ajax) {
188 print ajax_constantonoff(
'USER_HIDE_INACTIVE_IN_COMBOBOX');
191 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?action=set_USER_HIDE_INACTIVE_IN_COMBOBOX&token='.
newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
193 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?action=del_USER_HIDE_INACTIVE_IN_COMBOBOX&token='.
newToken().
'">'.
img_picto($langs->trans(
"Enabled"),
'on').
'</a>';
203$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
208$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
209$sql .=
" WHERE type = '".$db->escape($type).
"'";
210$sql .=
" AND entity = ".$conf->entity;
211$resql = $db->query($sql);
214 $num_rows = $db->num_rows($resql);
215 while ($i < $num_rows) {
216 $array = $db->fetch_array($resql);
217 if (is_array($array)) {
218 array_push($def, $array[0]);
228print
'<div class="div-table-responsive-no-min">';
229print
'<table class="noborder centpercent">';
230print
'<tr class="liste_titre">';
231print
'<td>'.$langs->trans(
"Name").
'</td>';
232print
'<td>'.$langs->trans(
"Description").
'</td>';
233print
'<td align="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
234print
'<td align="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
235print
'<td align="center" width="80">'.$langs->trans(
"ShortInfo").
'</td>';
236print
'<td align="center" width="80">'.$langs->trans(
"Preview").
'</td>';
241foreach ($dirmodels as $reldir) {
242 foreach (array(
'',
'/doc') as $valdir) {
245 $handle = opendir($dir);
246 if (is_resource($handle)) {
248 while (($file = readdir($handle)) !==
false) {
254 foreach ($filelist as $file) {
255 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
256 if (file_exists($dir.
'/'.$file)) {
257 $name = substr($file, 4,
dol_strlen($file) - 16);
258 $classname = substr($file, 0,
dol_strlen($file) - 12);
260 require_once $dir.
'/'.$file;
261 $module =
new $classname($db);
262 '@phan-var-force ModelePDFUser $module';
264 $modulequalified = 1;
265 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
266 $modulequalified = 0;
268 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
269 $modulequalified = 0;
272 if ($modulequalified) {
273 print
'<tr class="oddeven"><td width="100">';
274 print(empty($module->name) ? $name : $module->
name);
276 if (method_exists($module,
'info')) {
277 print $module->info($langs);
279 print $module->description;
284 if (in_array($name, $def)) {
285 print
'<td class="center">'.
"\n";
286 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=del_default&token='.
newToken().
'&value='.urlencode($name).
'">';
287 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
291 print
'<td class="center">'.
"\n";
292 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=set_default&token='.
newToken().
'&value='.urlencode($name).
'&scandir='.urlencode($module->scandir).
'&label='.urlencode($module->name).
'">';
293 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
299 print
'<td class="center">';
302 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=unsetdoc&token='.
newToken().
'&value='.urlencode($name).
'&scandir='.urlencode($module->scandir).
'&label='.urlencode($module->name).
'" alt="'.$langs->trans(
"Default").
'">'.
img_picto($langs->trans(
"Default"),
'on').
'</a>';
304 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=setdoc&token='.
newToken().
'&value='.urlencode($name).
'&scandir='.urlencode($module->scandir).
'&label='.urlencode($module->name).
'" alt="'.$langs->trans(
"Default").
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
309 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
310 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
311 if ($module->type ==
'pdf') {
312 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
314 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
315 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
316 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
319 print
'<td class="center">';
320 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
324 print
'<td class="center">';
325 if ($module->type ==
'pdf') {
326 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
328 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
delDocumentModel($name, $type)
Delete document model used by doc generator.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
$conf db name
Only used if Module[ID]Name translation string is not found.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
user_admin_prepare_head()
Prepare array with list of tabs.