30 require
'../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
36 $langs->loadLangs(array(
"admin",
"members",
"users"));
41 $action =
GETPOST(
'action',
'aZ09');
42 $value =
GETPOST(
'value',
'alpha');
49 include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
51 if ($action ==
'set_default')
55 } elseif ($action ==
'del_default')
60 if ($conf->global->USERGROUP_ADDON_PDF_ODT ==
"$value")
dolibarr_del_const($db,
'USERGROUP_ADDON_PDF_ODT', $conf->entity);
66 elseif ($action ==
'setdoc')
68 if (
dolibarr_set_const($db,
"USERGROUP_ADDON_PDF_ODT", $value,
'chaine', 0,
'', $conf->entity))
72 $conf->global->USERGROUP_ADDON_PDF_ODT = $value;
82 } elseif (preg_match(
'/set_([a-z0-9_\-]+)/i', $action, $reg))
87 header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
92 } elseif (preg_match(
'/del_([a-z0-9_\-]+)/i', $action, $reg))
97 header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
107 $help_url =
'EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios';
108 llxHeader(
'', $langs->trans(
"UsersSetup"), $help_url);
110 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
119 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
121 $form =
new Form($db);
126 $sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
127 $sql .=
" WHERE type = '".$db->escape($type).
"'";
128 $sql .=
" AND entity = ".$conf->entity;
129 $resql = $db->query($sql);
133 $num_rows = $db->num_rows(
$resql);
134 while ($i < $num_rows)
136 $array = $db->fetch_array(
$resql);
137 array_push($def, $array[0]);
146 print '<table class="noborder centpercent">';
147 print
'<tr class="liste_titre">';
148 print
'<td>'.$langs->trans(
"Name").
'</td>';
149 print
'<td>'.$langs->trans(
"Description").
'</td>';
150 print
'<td align="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
151 print
'<td align="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
152 print
'<td align="center" width="80">'.$langs->trans(
"ShortInfo").
'</td>';
153 print
'<td align="center" width="80">'.$langs->trans(
"Preview").
'</td>';
158 foreach ($dirmodels as $reldir)
160 foreach (array(
'',
'/doc') as $valdir)
162 $dir =
dol_buildpath($reldir.
"core/modules/usergroup".$valdir);
165 $handle = opendir($dir);
166 if (is_resource($handle))
168 while (($file = readdir($handle)) !==
false)
175 foreach ($filelist as $file)
177 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file))
179 if (file_exists($dir.
'/'.$file))
181 $name = substr($file, 4,
dol_strlen($file) - 16);
182 $classname = substr($file, 0,
dol_strlen($file) - 12);
184 require_once $dir.
'/'.$file;
185 $module =
new $classname($db);
187 $modulequalified = 1;
188 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0;
189 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
191 if ($modulequalified)
193 print
'<tr class="oddeven"><td width="100">';
194 print (empty($module->name) ? $name : $module->name);
196 if (method_exists($module,
'info')) print $module->info($langs);
197 else print $module->description;
201 if (in_array($name, $def))
203 print
'<td class="center">'.
"\n";
204 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=del_default&token='.
newToken().
'&value='.$name.
'">';
205 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
209 print
'<td class="center">'.
"\n";
210 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=set_default&token='.
newToken().
'&value='.$name.
'&scandir='.$module->scandir.
'&label='.urlencode($module->name).
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
215 print
'<td class="center">';
216 if ($conf->global->USERGROUP_ADDON_PDF == $name)
218 print
img_picto($langs->trans(
"Default"),
'on');
220 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=setdoc&token='.
newToken().
'&value='.$name.
'&scandir='.$module->scandir.
'&label='.urlencode($module->name).
'" alt="'.$langs->trans(
"Default").
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
225 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
226 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
227 if ($module->type ==
'pdf')
229 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
231 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
232 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
233 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
236 print
'<td class="center">';
237 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
241 print
'<td class="center">';
242 if ($module->type ==
'pdf')
244 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
246 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
delDocumentModel($name, $type)
Delete document model used by doc generator.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
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).
addDocumentModel($name, $type, $label= '', $description= '')
Add document model used by doc generator.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
dolibarr_del_const($db, $name, $entity=1)
Effacement d'une constante dans la base de donnees.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
user_admin_prepare_head()
Prepare array with list of tabs.