31require
'../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/cheque/class/remisecheque.class.php';
47$langs->loadLangs(array(
"admin",
"companies",
"bills",
"other",
"banks"));
53$action =
GETPOST(
'action',
'aZ09');
54$value =
GETPOST(
'value',
'alpha');
58 $conf->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipts_mint.php';
68if ($action ==
'updateMask') {
69 $maskconstchequereceipts =
GETPOST(
'maskconstchequereceipts',
'aZ09');
70 $maskchequereceipts =
GETPOST(
'maskchequereceipts',
'alpha');
74 if ($maskconstchequereceipts && preg_match(
'/_MASK$/', $maskconstchequereceipts)) {
89if ($action ==
'setmod') {
93if ($action ==
'set_BANK_CHEQUERECEIPT_FREE_TEXT') {
94 $freetext =
GETPOST(
'BANK_CHEQUERECEIPT_FREE_TEXT',
'restricthtml');
113$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
114llxHeader(
"", $langs->trans(
"BankSetupModule"),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-chequereceipts');
116$form =
new Form($db);
118$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
119print
load_fiche_titre($langs->trans(
"BankSetupModule"), $linkback,
'title_setup');
122print
dol_get_fiche_head($head,
'checkreceipts', $langs->trans(
"BankSetupModule"), -1,
'account');
128print
load_fiche_titre($langs->trans(
"ChequeReceiptsNumberingModule"),
'',
'');
130print
'<div class="div-table-responsive-no-min">';
131print
'<table class="noborder centpercent">';
132print
'<tr class="liste_titre">';
133print
'<td>'.$langs->trans(
"Name").
'</td>';
134print
'<td>'.$langs->trans(
"Description").
'</td>';
135print
'<td class="nowrap">'.$langs->trans(
"Example").
'</td>';
136print
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
137print
'<td class="center" width="16">'.$langs->trans(
"ShortInfo").
'</td>';
142foreach ($dirmodels as $reldir) {
145 $handle = opendir($dir);
146 if (is_resource($handle)) {
147 while (($file = readdir($handle)) !==
false) {
148 if (!is_dir($dir.$file) || (substr($file, 0, 1) !=
'.' && substr($file, 0, 3) !=
'CVS')) {
150 $name = substr($file, 4,
dol_strlen($file) - 16);
151 $classname = preg_replace(
'/\.php$/',
'', $file);
153 if (!is_file($dir.$filebis)) {
154 $filebis = $file.
"/".$file.
".modules.php";
155 $classname =
"mod_chequereceipt_".$file;
158 preg_match(
'/\-(.*)_(.*)$/', $classname, $reg);
159 if (!empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) {
163 $classname = preg_replace(
'/\-.*$/',
'', $classname);
164 if (!class_exists($classname) && is_readable($dir.$filebis) && (preg_match(
'/mod_/', $filebis) || preg_match(
'/mod_/', $classname)) && substr($filebis,
dol_strlen($filebis) - 3, 3) ==
'php') {
166 require_once $dir.$filebis;
168 $module =
new $classname($db);
169 '@phan-var-force ModeleNumRefChequeReceipts $module';
172 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
175 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
179 if ($module->isEnabled()) {
180 print
'<tr class="oddeven"><td width="100">';
181 print(empty($module->name) ? $name : $module->
name);
184 print $module->info($langs);
189 print
'<td class="nowrap">';
190 $tmp = $module->getExample();
191 if (preg_match(
'/^Error/', $tmp)) {
192 $langs->load(
"errors");
193 print
'<div class="error">'.$langs->trans($tmp).
'</div>';
194 } elseif ($tmp ==
'NotConfigured') {
195 print
'<span class="opacitymedium">'.$langs->trans($tmp).
'</span>';
201 print
'<td class="center">';
202 if (
$conf->global->CHEQUERECEIPTS_ADDON == $file ||
getDolGlobalString(
'CHEQUERECEIPTS_ADDON') .
'.php' == $file) {
203 print
img_picto($langs->trans(
"Activated"),
'switch_on');
205 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setmod&token='.
newToken().
'&value='.preg_replace(
'/\.php$/',
'', $file).
'&label='.urlencode($module->name).
'" alt="'.$langs->trans(
"Default").
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
210 $chequereceipts->initAsSpecimen();
214 $htmltooltip .=
''.$langs->trans(
"Version").
': <b>'.$module->getVersion().
'</b><br>';
215 $nextval = $module->getNextValue($mysoc, $chequereceipts);
216 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
217 $htmltooltip .= $langs->trans(
"NextValue").
': ';
219 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
220 $nextval = $langs->trans($nextval);
222 $htmltooltip .= $nextval.
'<br>';
224 $htmltooltip .= $langs->trans($module->error).
'<br>';
228 print
'<td class="center">';
229 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
232 if (!empty($module->error)) {
260print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
261print
'<input type="hidden" name="token" value="'.newToken().
'">';
262print
'<input type="hidden" name="action" value="set_BANK_CHEQUERECEIPT_FREE_TEXT">';
264print
'<table class="noborder centpercent">';
265print
'<tr class="liste_titre">';
266print
'<td>'.$langs->trans(
"Parameters").
'</td>';
267print
'<td class="center" width="60"> </td>';
268print
'<td width="80"> </td>';
272$substitutionarray[
'__(AnyTranslationKey)__'] = $langs->trans(
"Translation");
273$htmltext =
'<i>'.$langs->trans(
"AvailableVariables").
':<br>';
274foreach ($substitutionarray as $key => $val) {
275 $htmltext .= $key.
'<br>';
279print
'<tr class="oddeven"><td colspan="2">';
280print $form->textwithpicto($langs->trans(
"FreeLegalTextOnChequeReceipts"), $langs->trans(
"AddCRIfTooLong").
'<br><br>'.$htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
281$variablename =
'BANK_CHEQUERECEIPT_FREE_TEXT';
283 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
285 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
287 print $doleditor->Create();
289print
'</td><td class="right">';
290print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'">';
295print
'</table>'.
"\n";
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).
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.
bank_admin_prepare_head($object)
Prepare array with list of tabs.
Class to manage a WYSIWYG editor.
Class to manage cheque delivery receipts.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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'.
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_htmloutput_mesg($mesgstring='', $mesgarray=array(), $style='ok', $keepembedded=0)
Print formatted messages to output (Used to show messages on html output).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0, $include=null)
Return array of possible substitutions for PDF content (without external module substitutions).
$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.