Merge remote-tracking branch 'upstream/develop' into 9.0_accountancy
@ -42,6 +42,21 @@ $page = GETPOST("page");
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
if (GETPOST("exportcsv",'alpha')) $action = 'export_csv';
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
$page = GETPOST('page','int');
|
||||
if (empty($page) || $page == -1 || GETPOST('button_search','alpha') || GETPOST('button_removefilter','alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
//if (! $sortfield) $sortfield="p.date_fin";
|
||||
//if (! $sortorder) $sortorder="DESC";
|
||||
|
||||
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
|
||||
|
||||
@ -54,14 +69,6 @@ if ($search_accountancy_code_end == - 1) {
|
||||
$search_accountancy_code_end = '';
|
||||
}
|
||||
|
||||
if (GETPOST("exportcsv",'alpha')) $action = 'export_csv';
|
||||
|
||||
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||
if (empty($page) || $page < 0) { $page = 0; }
|
||||
|
||||
$offset = $limit * $page;
|
||||
|
||||
$object = new BookKeeping($db);
|
||||
|
||||
$formaccounting = new FormAccounting($db);
|
||||
@ -97,23 +104,27 @@ if ($sortorder == "")
|
||||
if ($sortfield == "")
|
||||
$sortfield = "t.numero_compte";
|
||||
|
||||
$options = '';
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||
|
||||
$filter = array ();
|
||||
if (! empty($search_date_start)) {
|
||||
$filter['t.doc_date>='] = $search_date_start;
|
||||
$options .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int');
|
||||
$param .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int');
|
||||
}
|
||||
if (! empty($search_date_end)) {
|
||||
$filter['t.doc_date<='] = $search_date_end;
|
||||
$options .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int');
|
||||
$param .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int');
|
||||
}
|
||||
if (! empty($search_accountancy_code_start)) {
|
||||
$filter['t.numero_compte>='] = $search_accountancy_code_start;
|
||||
$options .= '&search_accountancy_code_start=' . $search_accountancy_code_start;
|
||||
$param .= '&search_accountancy_code_start=' . $search_accountancy_code_start;
|
||||
}
|
||||
if (! empty($search_accountancy_code_end)) {
|
||||
$filter['t.numero_compte<='] = $search_accountancy_code_end;
|
||||
$options .= '&search_accountancy_code_end=' . $search_accountancy_code_end;
|
||||
$param .= '&search_accountancy_code_end=' . $search_accountancy_code_end;
|
||||
}
|
||||
|
||||
|
||||
@ -130,8 +141,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
||||
$filter = array();
|
||||
}
|
||||
|
||||
if ($action == 'export_csv') {
|
||||
|
||||
if ($action == 'export_csv')
|
||||
{
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
|
||||
$filename = 'balance';
|
||||
@ -193,7 +204,8 @@ if ($action != 'export_csv')
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
$button = '<input type="submit" name="exportcsv" class="butAction" value="' . $langs->trans("Export") . ' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, $button, $result, $result, 'title_accountancy', 0);
|
||||
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
@ -231,12 +243,12 @@ if ($action != 'export_csv')
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
$total_debit = 0;
|
||||
@ -262,7 +274,7 @@ if ($action != 'export_csv')
|
||||
{
|
||||
// Affiche un Sous-Total par compte comptable
|
||||
if ($displayed_account != "") {
|
||||
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap" align="right">' . price($sous_total_debit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit - $sous_total_debit) . '</td>';
|
||||
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap" align="right">' . price($sous_total_debit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit) . '</td><td class="nowrap" align="right">' . price(price2num($sous_total_credit - $sous_total_debit)) . '</td>';
|
||||
print "<td> </td>\n";
|
||||
print '</tr>';
|
||||
}
|
||||
@ -293,11 +305,11 @@ if ($action != 'export_csv')
|
||||
$sous_total_credit += $line->credit;
|
||||
}
|
||||
|
||||
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap" align="right">' . price($sous_total_debit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit - $sous_total_debit) . '</td>';
|
||||
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap" align="right">' . price($sous_total_debit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit) . '</td><td class="nowrap" align="right">' . price(price2num($sous_total_credit - $sous_total_debit)) . '</td>';
|
||||
print "<td> </td>\n";
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("AccountBalance") . ':</td><td class="nowrap" align="right">' . price($total_debit) . '</td><td class="nowrap" align="right">' . price($total_credit) . '</td><td class="nowrap" align="right">' . price($total_credit - $total_debit) . '</td>';
|
||||
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("AccountBalance") . ':</td><td class="nowrap" align="right">' . price($total_debit) . '</td><td class="nowrap" align="right">' . price($total_credit) . '</td><td class="nowrap" align="right">' . price(price2num($total_credit - $total_debit)) . '</td>';
|
||||
print "<td> </td>\n";
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -651,19 +651,39 @@ class AccountancyExport
|
||||
*/
|
||||
public function exportFEC($objectLines)
|
||||
{
|
||||
$separator = ';';
|
||||
$separator = "\t";
|
||||
$end_line = "\n";
|
||||
|
||||
print "JournalCode" . $separator;
|
||||
print "JournalLib" . $separator;
|
||||
print "EcritureNum" . $separator;
|
||||
print "EcritureDate" . $separator;
|
||||
print "CompteNum" . $separator;
|
||||
print "CompteLib" . $separator;
|
||||
print "CompAuxNum" . $separator;
|
||||
print "CompAuxLib" . $separator;
|
||||
print "PieceRef" . $separator;
|
||||
print "PieceDate" . $separator;
|
||||
print "EcritureLib" . $separator;
|
||||
print "Debit" . $separator;
|
||||
print "Credit" . $separator;
|
||||
print "EcritureLet" . $separator;
|
||||
print "DateLet" . $separator;
|
||||
print "ValidDate" . $separator;
|
||||
print "Montantdevise" . $separator;
|
||||
print "Idevise";
|
||||
print $end_line;
|
||||
|
||||
foreach ( $objectLines as $line ) {
|
||||
$date_creation = dol_print_date($line->date_creation, '%d%m%Y');
|
||||
$date_doc = dol_print_date($line->doc_date, '%d%m%Y');
|
||||
$date_valid = dol_print_date($line->date_validated, '%d%m%Y');
|
||||
|
||||
// FEC:JournalCode
|
||||
print $line->code_journal;
|
||||
print $line->code_journal . $separator;
|
||||
|
||||
// FEC:JournalLib
|
||||
print $line->journal_label;
|
||||
print $line->journal_label . $separator;
|
||||
|
||||
// FEC:EcritureNum
|
||||
print $line->piece_num . $separator;
|
||||
@ -693,10 +713,10 @@ class AccountancyExport
|
||||
print $line->label_operation . $separator;
|
||||
|
||||
// FEC:Debit
|
||||
print price($line->debit) . $separator;
|
||||
print price2num($line->debit) . $separator;
|
||||
|
||||
// FEC:Credit
|
||||
print price($line->credit) . $separator;
|
||||
print price2num($line->credit) . $separator;
|
||||
|
||||
// FEC:EcritureLet
|
||||
print $line->lettering_code . $separator;
|
||||
|
||||
@ -1016,16 +1016,21 @@ class BookKeeping extends CommonObject
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($resql)
|
||||
{
|
||||
$num = $this->db->num_rows($resql);
|
||||
|
||||
while ( $obj = $this->db->fetch_object($resql) ) {
|
||||
$i = 0;
|
||||
while (($obj = $this->db->fetch_object($resql)) && ($i < min($limit, $num)))
|
||||
{
|
||||
$line = new BookKeepingLine();
|
||||
|
||||
$line->numero_compte = $obj->numero_compte;
|
||||
$line->debit = $obj->debit;
|
||||
$line->credit = $obj->credit;
|
||||
$this->lines[] = $line;
|
||||
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
|
||||
@ -146,9 +146,12 @@ if ($conf->accounting->enabled)
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
if (! empty($conf->expensereport->enabled) || ! empty($conf->deplacement->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
}
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
/* Copyright (C) 2015-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
*
|
||||
* 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
|
||||
@ -27,11 +27,21 @@ $code = $conf->global->MAIN_INFO_ACCOUNTANT_CODE;
|
||||
$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC;
|
||||
$format = $conf->global->ACCOUNTING_EXPORT_FORMAT;
|
||||
$nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME;
|
||||
$siren = $conf->global->MAIN_INFO_SIREN;
|
||||
|
||||
$date_export = "_" . dol_print_date(dol_now(), '%Y%m%d%H%M%S');
|
||||
$endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d');
|
||||
|
||||
header('Content-Type: text/csv');
|
||||
|
||||
$completefilename = ($code?$code . "_":"") . ($prefix?$prefix . "_":"") . $filename . ($nodateexport?"":$date_export) . "." . $format;
|
||||
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == "11") // Specific filename for FEC model export
|
||||
{
|
||||
$completefilename = $siren . "FEC" . $search_date_end . $endaccountingperiod . "." . $format;
|
||||
}
|
||||
else
|
||||
{
|
||||
$completefilename = ($code?$code . "_":"") . ($prefix?$prefix . "_":"") . $filename . ($nodateexport?"":$date_export) . "." . $format;
|
||||
}
|
||||
|
||||
header('Content-Disposition: attachment;filename=' . $completefilename);
|
||||
|
||||
@ -238,6 +238,32 @@ if ($action == 'setforcedate')
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setDefaultPDFModulesByType')
|
||||
{
|
||||
$invoicetypemodels = GETPOST('invoicetypemodels');
|
||||
|
||||
if(!empty($invoicetypemodels) && is_array($invoicetypemodels))
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
foreach ($invoicetypemodels as $type => $value)
|
||||
{
|
||||
$res = dolibarr_set_const($db, 'FACTURE_ADDON_PDF_'.intval($type),$value,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@ -465,6 +491,8 @@ print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
$activatedModels = array();
|
||||
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
foreach (array('','/doc') as $valdir)
|
||||
@ -580,6 +608,47 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf
|
||||
{
|
||||
/*
|
||||
* Document templates generators
|
||||
*/
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("BillsPDFModulesAccordindToInvoiceType"),'','');
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'#default-pdf-modules-by-type-table" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
|
||||
print '<input type="hidden" name="action" value="setDefaultPDFModulesByType" >';
|
||||
print '<table id="default-pdf-modules-by-type-table" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$listtype=array(
|
||||
Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"),
|
||||
Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"),
|
||||
Facture::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"),
|
||||
Facture::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"),
|
||||
);
|
||||
if (! empty($conf->global->INVOICE_USE_SITUATION))
|
||||
{
|
||||
$listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation");
|
||||
}
|
||||
|
||||
foreach ($listtype as $type => $trans)
|
||||
{
|
||||
$thisTypeConfName = 'FACTURE_ADDON_PDF_'.$type;
|
||||
$current = !empty($conf->global->{$thisTypeConfName})?$conf->global->{$thisTypeConfName}:$conf->global->FACTURE_ADDON_PDF;
|
||||
print '<tr >';
|
||||
print '<td>'.$trans.'</td>';
|
||||
print '<td colspan="2" >'.$form->selectarray('invoicetypemodels['.$type.']', ModelePDFFactures::liste_modeles($db), $current,0,0, 0).'</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print "</form>";
|
||||
}
|
||||
|
||||
/*
|
||||
* Modes de reglement
|
||||
@ -662,6 +731,7 @@ if ($resql)
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
$row = $db->fetch_row($resql);
|
||||
|
||||
print '<option value="'.$row[0].'"';
|
||||
|
||||
@ -64,7 +64,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
||||
print load_fiche_titre($langs->trans("AssetsSetup"),$linkback,'title_setup');
|
||||
|
||||
|
||||
$head = AssetsAdminPrepareHead();
|
||||
$head = asset_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes', $langs->trans("Assets"), -1, 'generic');
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
||||
print load_fiche_titre($langs->trans("AssetsSetup"),$linkback,'title_setup');
|
||||
|
||||
|
||||
$head = AssetsAdminPrepareHead();
|
||||
$head = asset_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes_type', $langs->trans("Assets"), -1, 'generic');
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
||||
print load_fiche_titre($langs->trans("AssetsSetup"),$linkback,'title_setup');
|
||||
|
||||
|
||||
$head = AssetsAdminPrepareHead();
|
||||
$head = asset_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'settings', $langs->trans("Assets"), -1, 'generic');
|
||||
|
||||
|
||||
@ -203,7 +203,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
{
|
||||
$res = $object->fetch_optionals($object->id, $extralabels);
|
||||
|
||||
$head = AssetsPrepareHead($object);
|
||||
$head = asset_prepare_head($object);
|
||||
dol_fiche_head($head, 'card', $langs->trans("Asset"), -1, 'generic');
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
@ -95,7 +95,7 @@ if ($object->id)
|
||||
* Show tabs
|
||||
*/
|
||||
if (! empty($conf->notification->enabled)) $langs->load("mails");
|
||||
$head = AssetsPrepareHead($object);
|
||||
$head = asset_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'document', $langs->trans("Asset"), -1, 'generic');
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ $form = new Form($db);
|
||||
|
||||
$object->info($id);
|
||||
|
||||
$head = AssetsPrepareHead($object);
|
||||
$head = asset_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'info', $langs->trans("Asset"), -1, 'generic');
|
||||
|
||||
|
||||
@ -78,7 +78,7 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$head = AssetsPrepareHead($object);
|
||||
$head = asset_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'note', $langs->trans("Asset"), -1, 'generic');
|
||||
|
||||
|
||||
@ -348,13 +348,13 @@ if (empty($reshook))
|
||||
// If we select proposal to clone during creation (when option PROPAL_CLONE_ON_CREATE_PAGE is on)
|
||||
if (GETPOST('createmode') == 'copy' && GETPOST('copie_propal'))
|
||||
{
|
||||
if ($object->fetch(GETPOST('copie_propal')) > 0) {
|
||||
if ($object->fetch(GETPOST('copie_propal','int')) > 0) {
|
||||
$object->ref = GETPOST('ref');
|
||||
$object->datep = $datep;
|
||||
$object->date_livraison = $date_delivery;
|
||||
$object->availability_id = GETPOST('availability_id');
|
||||
$object->demand_reason_id = GETPOST('demand_reason_id');
|
||||
$object->fk_delivery_address = GETPOST('fk_address');
|
||||
$object->fk_delivery_address = GETPOST('fk_address','int');
|
||||
$object->shipping_method_id = GETPOST('shipping_method_id', 'int');
|
||||
$object->duree_validite = $duration;
|
||||
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
||||
@ -362,9 +362,9 @@ if (empty($reshook))
|
||||
$object->fk_account = GETPOST('fk_account', 'int');
|
||||
$object->remise_percent = GETPOST('remise_percent');
|
||||
$object->remise_absolue = GETPOST('remise_absolue');
|
||||
$object->socid = GETPOST('socid');
|
||||
$object->contactid = GETPOST('contactid');
|
||||
$object->fk_project = GETPOST('projectid');
|
||||
$object->socid = GETPOST('socid','int');
|
||||
$object->contactid = GETPOST('contactid','int');
|
||||
$object->fk_project = GETPOST('projectid','int');
|
||||
$object->modelpdf = GETPOST('model');
|
||||
$object->author = $user->id; // deprecated
|
||||
$object->note_private = GETPOST('note_private','none');
|
||||
@ -391,8 +391,8 @@ if (empty($reshook))
|
||||
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
||||
$object->fk_account = GETPOST('fk_account', 'int');
|
||||
$object->contactid = GETPOST('contactid');
|
||||
$object->fk_project = GETPOST('projectid');
|
||||
$object->contactid = GETPOST('contactid','int');
|
||||
$object->fk_project = GETPOST('projectid','int');
|
||||
$object->modelpdf = GETPOST('model');
|
||||
$object->author = $user->id; // deprecated
|
||||
$object->note_private = GETPOST('note_private','none');
|
||||
@ -566,6 +566,16 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($conf->global->PROPOSAL_AUTO_ADD_AUTHOR_AS_CONTACT))
|
||||
{
|
||||
$result = $object->add_contact($user->id, 'SALESREPFOLL', 'internal');
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFailedToAddUserAsContact"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
@ -2877,7 +2877,8 @@ if ($action == 'create')
|
||||
// Standard invoice
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
$tmp='<input type="radio" id="radio_standard" name="type" value="0"' . (GETPOST('type') == 0 ? ' checked' : '') . '> ';
|
||||
$desc = $form->textwithpicto($tmp.$langs->trans("InvoiceStandardAsk"), $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', '', 0, 3);
|
||||
$tmp = $tmp.'<label for="radio_standard" >'.$langs->trans("InvoiceStandardAsk").'</label>';
|
||||
$desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', '', 0, 3);
|
||||
print $desc;
|
||||
print '</div></div>';
|
||||
|
||||
@ -2896,7 +2897,8 @@ if ($action == 'create')
|
||||
});
|
||||
</script>';
|
||||
|
||||
$desc = $form->textwithpicto($tmp.$langs->trans("InvoiceDeposit"), $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3);
|
||||
$tmp = $tmp.'<label for="radio_deposit" >'.$langs->trans("InvoiceDeposit").'</label>';
|
||||
$desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3);
|
||||
print '<table class="nobordernopadding"><tr><td>';
|
||||
print $desc;
|
||||
print '</td>';
|
||||
@ -2920,8 +2922,9 @@ if ($action == 'create')
|
||||
{
|
||||
// First situation invoice
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
$tmp='<input type="radio" name="type" value="5"' . (GETPOST('type') == 5 ? ' checked' : '') . '> ';
|
||||
$desc = $form->textwithpicto($tmp.$langs->trans("InvoiceFirstSituationAsk"), $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3);
|
||||
$tmp='<input id="radio_situation invoice" type="radio" name="type" value="5"' . (GETPOST('type') == 5 ? ' checked' : '') . '> ';
|
||||
$tmp = $tmp.'<label for="radio_situation invoice" >'.$langs->trans("InvoiceFirstSituationAsk").'</label>';
|
||||
$desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3);
|
||||
print $desc;
|
||||
print '</div></div>';
|
||||
|
||||
@ -2931,7 +2934,7 @@ if ($action == 'create')
|
||||
$tmp='<input type="radio" name="type" value="5"' . (GETPOST('type') == 5 && GETPOST('originid') ? ' checked' : '');
|
||||
if ($opt == ('<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>') || (GETPOST('origin') && GETPOST('origin') != 'facture' && GETPOST('origin') != 'commande')) $tmp.=' disabled';
|
||||
$tmp.= '> ';
|
||||
$text = $tmp.$langs->trans("InvoiceSituationAsk") . ' ';
|
||||
$text = '<label>'.$tmp.$langs->trans("InvoiceSituationAsk") . '</label> ';
|
||||
$text .= '<select class="flat" id="situations" name="situations">';
|
||||
$text .= $opt;
|
||||
$text .= '</select>';
|
||||
@ -2955,7 +2958,7 @@ if ($action == 'create')
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
$text = $tmp.$langs->trans("InvoiceReplacementAsk") . ' ';
|
||||
$text = '<label>'.$tmp.$langs->trans("InvoiceReplacementAsk") . '</label>';
|
||||
$text .= '<select class="flat" name="fac_replacement" id="fac_replacement"';
|
||||
if (! $options)
|
||||
$text .= ' disabled';
|
||||
@ -2976,13 +2979,14 @@ if ($action == 'create')
|
||||
{
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
$tmp='<input type="radio" name="type" id="radio_replacement" value="0" disabled> ';
|
||||
$text = $tmp.$langs->trans("InvoiceReplacement") . ' ';
|
||||
$text = '<label>'.$tmp.$langs->trans("InvoiceReplacement") . '</label> ';
|
||||
$text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') ';
|
||||
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceReplacementDesc"), 1, 'help', '', 0, 3);
|
||||
print $desc;
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (empty($origin))
|
||||
{
|
||||
if ($socid > 0)
|
||||
@ -3009,7 +3013,7 @@ if ($action == 'create')
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
$text = $tmp.$langs->transnoentities("InvoiceAvoirAsk") . ' ';
|
||||
$text = '<label>'.$tmp.$langs->transnoentities("InvoiceAvoirAsk") . '</label> ';
|
||||
// $text.='<input type="text" value="">';
|
||||
$text .= '<select class="flat valignmiddle" name="fac_avoir" id="fac_avoir"';
|
||||
if (! $optionsav)
|
||||
@ -3038,7 +3042,7 @@ if ($action == 'create')
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
if (empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE)) $tmp='<input type="radio" name="type" id="radio_creditnote" value="0" disabled> ';
|
||||
else $tmp='<input type="radio" name="type" id="radio_creditnote" value="2" > ';
|
||||
$text = $tmp.$langs->trans("InvoiceAvoir") . ' ';
|
||||
$text = '<label>'.$tmp.$langs->trans("InvoiceAvoir") . '</label> ';
|
||||
$text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') ';
|
||||
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3);
|
||||
print $desc;
|
||||
@ -3049,7 +3053,7 @@ if ($action == 'create')
|
||||
// Template invoice
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
$tmp='<input type="radio" name="type" id="radio_template" value="0" disabled> ';
|
||||
$text = $tmp.$langs->trans("RepeatableInvoice") . ' ';
|
||||
$text = '<label>'.$tmp.$langs->trans("RepeatableInvoice") . '</label> ';
|
||||
//$text.= '('.$langs->trans("YouMustCreateStandardInvoiceFirst").') ';
|
||||
$desc = $form->textwithpicto($text, $langs->transnoentities("YouMustCreateStandardInvoiceFirstDesc"), 1, 'help', '', 0, 3);
|
||||
print $desc;
|
||||
@ -3057,6 +3061,41 @@ if ($action == 'create')
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf
|
||||
{
|
||||
// Add auto select default document model
|
||||
$listtType=array(Facture::TYPE_STANDARD,Facture::TYPE_REPLACEMENT,Facture::TYPE_CREDIT_NOTE,Facture::TYPE_DEPOSIT,Facture::TYPE_SITUATION);
|
||||
$jsListType='';
|
||||
foreach ($listtType as $type)
|
||||
{
|
||||
$thisTypeConfName = 'FACTURE_ADDON_PDF_'.$type;
|
||||
$curent = !empty($conf->global->{$thisTypeConfName})?$conf->global->{$thisTypeConfName}:$conf->global->FACTURE_ADDON_PDF;
|
||||
$jsListType.=(!empty($jsListType)?',':'').'"'.$type.'":"'.$curent.'"';
|
||||
}
|
||||
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
$(document).ready(function() {
|
||||
var listType = {'.$jsListType.'};
|
||||
$("[name=\'type\'").change(function() {
|
||||
if($( this ).prop("checked"))
|
||||
{
|
||||
if(($( this ).val() in listType))
|
||||
{
|
||||
$("#model").val(listType[$( this ).val()]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#model").val("'.$conf->global->FACTURE_ADDON_PDF.'");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
if ($socid > 0)
|
||||
@ -3147,7 +3186,14 @@ if ($action == 'create')
|
||||
print '<td colspan="2">';
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php';
|
||||
$liste = ModelePDFFactures::liste_modeles($db);
|
||||
print $form->selectarray('model', $liste, $conf->global->FACTURE_ADDON_PDF);
|
||||
if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)){ // Hidden conf
|
||||
$paramkey='FACTURE_ADDON_PDF_'.$object->type;
|
||||
$curent = !empty($conf->global->$paramkey)?$conf->global->$paramkey:$conf->global->FACTURE_ADDON_PDF;
|
||||
}
|
||||
else{
|
||||
$curent = $conf->global->FACTURE_ADDON_PDF;
|
||||
}
|
||||
print $form->selectarray('model', $liste, $curent);
|
||||
print "</td></tr>";
|
||||
|
||||
// Multicurrency
|
||||
|
||||
@ -4107,7 +4107,7 @@ class Facture extends CommonInvoice
|
||||
* @param int $hidedetails Hide details of lines
|
||||
* @param int $hidedesc Hide description
|
||||
* @param int $hideref Hide ref
|
||||
* @param null|array $moreparams Array to provide more information
|
||||
* @param null|array $moreparams Array to provide more information
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
|
||||
@ -4116,12 +4116,15 @@ class Facture extends CommonInvoice
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
if (! dol_strlen($modele)) {
|
||||
|
||||
if (! dol_strlen($modele))
|
||||
{
|
||||
$modele = 'crabe';
|
||||
$thisTypeConfName = 'FACTURE_ADDON_PDF_'.$this->type;
|
||||
|
||||
if ($this->modelpdf) {
|
||||
$modele = $this->modelpdf;
|
||||
} elseif (! empty($conf->global->$thisTypeConfName)) {
|
||||
$modele = $conf->global->$thisTypeConfName;
|
||||
} elseif (! empty($conf->global->FACTURE_ADDON_PDF)) {
|
||||
$modele = $conf->global->FACTURE_ADDON_PDF;
|
||||
}
|
||||
|
||||
@ -284,8 +284,9 @@ class Utils
|
||||
}
|
||||
|
||||
$errormsg='';
|
||||
$handle = '';
|
||||
|
||||
// Debut appel methode execution
|
||||
// Start call method to execute dump
|
||||
$fullcommandcrypted=$command." ".$paramcrypted." 2>&1";
|
||||
$fullcommandclear=$command." ".$paramclear." 2>&1";
|
||||
if ($compression == 'none') $handle = fopen($outputfile, 'w');
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
*
|
||||
* @return array head array with tabs
|
||||
*/
|
||||
function AssetsAdminPrepareHead()
|
||||
function asset_admin_prepare_head()
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
@ -70,7 +70,7 @@ function AssetsAdminPrepareHead()
|
||||
*
|
||||
* @return array head array with tabs
|
||||
*/
|
||||
function AssetsPrepareHead()
|
||||
function asset_prepare_head()
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
|
||||
@ -307,7 +307,7 @@ function includeContainer($containerref)
|
||||
{
|
||||
global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $weblangs; // Very important. Required to have var available when running inluded containers.
|
||||
global $includehtmlcontentopened;
|
||||
global $websitekey;
|
||||
global $websitekey, $websitepagefile;
|
||||
|
||||
$MAXLEVEL=20;
|
||||
|
||||
@ -607,7 +607,7 @@ function dolSavePageContent($filetpl, $object, $objectpage)
|
||||
|
||||
$tplcontent ='';
|
||||
$tplcontent.= "<?php // BEGIN PHP\n";
|
||||
$tplcontent.= '$websitekey=basename(dirname(__FILE__));'."\n";
|
||||
$tplcontent.= '$websitekey=basename(dirname(__FILE__)); if (empty($websitepagefile)) $websitepagefile=__FILE__;'."\n";
|
||||
$tplcontent.= "if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once './master.inc.php'; } // Not already loaded"."\n";
|
||||
$tplcontent.= "require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n";
|
||||
$tplcontent.= "require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n";
|
||||
@ -624,6 +624,7 @@ function dolSavePageContent($filetpl, $object, $objectpage)
|
||||
$tplcontent.= '<meta name="title" content="'.dol_string_nohtmltag($objectpage->title, 0, 'UTF-8').'" />'."\n";
|
||||
$tplcontent.= '<meta name="description" content="'.dol_string_nohtmltag($objectpage->description, 0, 'UTF-8').'" />'."\n";
|
||||
$tplcontent.= '<meta name="generator" content="'.DOL_APPLICATION_TITLE.' '.DOL_VERSION.' (https://www.dolibarr.org)" />'."\n";
|
||||
$tplcontent.= '<link href="/'.$objectpage->pageurl.'.php" rel="canonical" />'."\n";
|
||||
$tplcontent.= '<!-- Include link to CSS file -->'."\n";
|
||||
$tplcontent.= '<link rel="stylesheet" href="styles.css.php?website=<?php echo $websitekey; ?>" type="text/css" />'."\n";
|
||||
$tplcontent.= '<!-- Include HTML header from common file -->'."\n";
|
||||
@ -672,7 +673,7 @@ function dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper)
|
||||
dol_delete_file($fileindex);
|
||||
$indexcontent = '<?php'."\n";
|
||||
$indexcontent.= "// BEGIN PHP File generated to provide an index.php as Home Page or alias redirector - DO NOT MODIFY - It is just a generated wrapper.\n";
|
||||
$indexcontent.= '$websitekey=basename(dirname(__FILE__));'."\n";
|
||||
$indexcontent.= '$websitekey=basename(dirname(__FILE__)); if (empty($websitepagefile)) $websitepagefile=__FILE__;'."\n";
|
||||
$indexcontent.= "if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once './master.inc.php'; } // Load master if not already loaded\n";
|
||||
$indexcontent.= 'if (! empty($_GET[\'pageref\']) || ! empty($_GET[\'pagealiasalt\']) || ! empty($_GET[\'pageid\'])) {'."\n";
|
||||
$indexcontent.= " require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n";
|
||||
|
||||
@ -18,12 +18,12 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup datapolicies Module datapolicies
|
||||
* \brief datapolicies module descriptor.
|
||||
* \defgroup datapolicy Module datapolicy
|
||||
* \brief datapolicy module descriptor.
|
||||
*
|
||||
* \file htdocs/datapolicies/core/modules/modGdpr.class.php
|
||||
* \ingroup datapolicies
|
||||
* \brief Description and activation file for module DATAPOLICIES
|
||||
* \file htdocs/datapolicy/core/modules/modDataPolicy.class.php
|
||||
* \ingroup datapolicy
|
||||
* \brief Description and activation file for module DATAPOLICY
|
||||
*/
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/modules/DolibarrModules.class.php';
|
||||
|
||||
@ -33,9 +33,9 @@ include_once DOL_DOCUMENT_ROOT . '/core/modules/DolibarrModules.class.php';
|
||||
// so we ignore the Squiz.Classes.ValidClassName.NotCamelCaps rule.
|
||||
// @codingStandardsIgnoreStart
|
||||
/**
|
||||
* Description and activation class for module datapolicies
|
||||
* Description and activation class for module datapolicy
|
||||
*/
|
||||
class modDataPolicies extends DolibarrModules {
|
||||
class modDataPolicy extends DolibarrModules {
|
||||
|
||||
// @codingStandardsIgnoreEnd
|
||||
/**
|
||||
@ -53,7 +53,7 @@ class modDataPolicies extends DolibarrModules {
|
||||
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
|
||||
$this->numero = 4100;
|
||||
// Key text used to identify module (for permissions, menus, etc...)
|
||||
$this->rights_class = 'datapolicies';
|
||||
$this->rights_class = 'datapolicy';
|
||||
|
||||
// Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...'
|
||||
// It is used to group modules by family in module setup page
|
||||
@ -62,16 +62,16 @@ class modDataPolicies extends DolibarrModules {
|
||||
$this->module_position = '70';
|
||||
// Gives the possibility to the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
|
||||
//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
|
||||
// Module label (no space allowed), used if translation string 'ModuledatapoliciesName' not found (MyModue is name of module).
|
||||
// Module label (no space allowed), used if translation string 'ModuledatapolicyName' not found (MyModue is name of module).
|
||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||
// Module description, used if translation string 'ModuledatapoliciesDesc' not found (MyModue is name of module).
|
||||
$this->description = "Module to manage Data policies (for compliance with GDPR in Europe or other Data policies rules)";
|
||||
// Module description, used if translation string 'ModuledatapolicyDesc' not found (MyModue is name of module).
|
||||
$this->description = "Module to manage Data policy (for compliance with GDPR in Europe or other Data policy rules)";
|
||||
// Used only if file README.md and README-LL.md not found.
|
||||
$this->descriptionlong = "";
|
||||
|
||||
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
|
||||
$this->version = 'development';
|
||||
// Key used in llx_const table to save module status enabled/disabled (where datapolicies is value of property name of module in uppercase)
|
||||
// Key used in llx_const table to save module status enabled/disabled (where datapolicy is value of property name of module in uppercase)
|
||||
$this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
|
||||
// Name of image file used for this module.
|
||||
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
|
||||
@ -79,9 +79,9 @@ class modDataPolicies extends DolibarrModules {
|
||||
$this->picto = 'generic';
|
||||
|
||||
// Defined all module parts (triggers, login, substitutions, menus, css, etc...)
|
||||
// for default path (eg: /datapolicies/core/xxxxx) (0=disable, 1=enable)
|
||||
// for specific path of parts (eg: /datapolicies/core/modules/barcode)
|
||||
// for specific css file (eg: /datapolicies/css/datapolicies.css.php)
|
||||
// for default path (eg: /datapolicy/core/xxxxx) (0=disable, 1=enable)
|
||||
// for specific path of parts (eg: /datapolicy/core/modules/barcode)
|
||||
// for specific css file (eg: /datapolicy/css/datapolicy.css.php)
|
||||
$this->module_parts = array(
|
||||
'triggers' => 0, // Set this to 1 if module has its own trigger directory (core/triggers)
|
||||
'login' => 0, // Set this to 1 if module has its own login method file (core/login)
|
||||
@ -95,41 +95,41 @@ class modDataPolicies extends DolibarrModules {
|
||||
);
|
||||
|
||||
// Data directories to create when module is enabled.
|
||||
// Example: this->dirs = array("/datapolicies/temp","/datapolicies/subdir");
|
||||
$this->dirs = array("/datapolicies/temp");
|
||||
// Example: this->dirs = array("/datapolicy/temp","/datapolicy/subdir");
|
||||
$this->dirs = array("/datapolicy/temp");
|
||||
|
||||
// Config pages. Put here list of php page, stored into datapolicies/admin directory, to use to setup module.
|
||||
$this->config_page_url = array("setup.php@datapolicies");
|
||||
// Config pages. Put here list of php page, stored into datapolicy/admin directory, to use to setup module.
|
||||
$this->config_page_url = array("setup.php@datapolicy");
|
||||
|
||||
// Dependencies
|
||||
$this->hidden = false; // A condition to hide module
|
||||
$this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
|
||||
$this->requiredby = array(); // List of module ids to disable if this one is disabled
|
||||
$this->conflictwith = array(); // List of module class names as string this module is in conflict with
|
||||
$this->langfiles = array("datapolicies@datapolicies");
|
||||
$this->langfiles = array("datapolicy@datapolicy");
|
||||
$this->phpmin = array(5, 3); // Minimum version of PHP required by module
|
||||
$this->need_dolibarr_version = array(4, 0); // Minimum version of Dolibarr required by module
|
||||
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
||||
$this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
||||
//$this->automatic_activation = array('FR'=>'datapoliciesWasAutomaticallyActivatedBecauseOfYourCountryChoice');
|
||||
//$this->automatic_activation = array('FR'=>'datapolicyWasAutomaticallyActivatedBecauseOfYourCountryChoice');
|
||||
//$this->always_enabled = true; // If true, can't be disabled
|
||||
// Constants
|
||||
// List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
|
||||
// Example: $this->const=array(0=>array('datapolicies_MYNEWCONST1','chaine','myvalue','This is a constant to add',1),
|
||||
// 1=>array('datapolicies_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1)
|
||||
// Example: $this->const=array(0=>array('datapolicy_MYNEWCONST1','chaine','myvalue','This is a constant to add',1),
|
||||
// 1=>array('datapolicy_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1)
|
||||
// );
|
||||
$this->const = array(
|
||||
array('DATAPOLICIES_TIERS_CLIENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICIES_TIERS_PROSPECT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICIES_TIERS_PROSPECT_CLIENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICIES_TIERS_NIPROSPECT_NICLIENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICIES_TIERS_FOURNISSEUR', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICIES_CONTACT_CLIENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICIES_CONTACT_PROSPECT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICIES_CONTACT_PROSPECT_CLIENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICIES_CONTACT_NIPROSPECT_NICLIENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICIES_CONTACT_FOURNISSEUR', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICIES_ADHERENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICY_TIERS_CLIENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICY_TIERS_PROSPECT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICY_TIERS_PROSPECT_CLIENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICY_TIERS_NIPROSPECT_NICLIENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICY_TIERS_FOURNISSEUR', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICY_CONTACT_CLIENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICY_CONTACT_PROSPECT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICY_CONTACT_PROSPECT_CLIENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICY_CONTACT_FOURNISSEUR', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
array('DATAPOLICY_ADHERENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
);
|
||||
|
||||
$country = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY);
|
||||
@ -140,17 +140,17 @@ class modDataPolicies extends DolibarrModules {
|
||||
'fr_FR:ParentCompany'=>'Maison mère ou revendeur'
|
||||
) */
|
||||
|
||||
if (!isset($conf->datapolicies) || !isset($conf->datapolicies->enabled)) {
|
||||
$conf->datapolicies = new stdClass();
|
||||
$conf->datapolicies->enabled = 0;
|
||||
if (!isset($conf->datapolicy) || !isset($conf->datapolicy->enabled)) {
|
||||
$conf->datapolicy = new stdClass();
|
||||
$conf->datapolicy->enabled = 0;
|
||||
}
|
||||
|
||||
|
||||
// Array to add new pages in new tabs
|
||||
$this->tabs = array();
|
||||
// Example:
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@datapolicies:$user->rights->datapolicies->read:/datapolicies/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@datapolicies:$user->rights->othermodule->read:/datapolicies/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@datapolicy:$user->rights->datapolicy->read:/datapolicy/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@datapolicy:$user->rights->othermodule->read:/datapolicy/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
|
||||
// $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
|
||||
//
|
||||
// Where objecttype can be
|
||||
@ -177,7 +177,7 @@ class modDataPolicies extends DolibarrModules {
|
||||
$this->dictionaries = array();
|
||||
/* Example:
|
||||
$this->dictionaries=array(
|
||||
'langs'=>'mylangfile@datapolicies',
|
||||
'langs'=>'mylangfile@datapolicy',
|
||||
'tabname'=>array(MAIN_DB_PREFIX."table1",MAIN_DB_PREFIX."table2",MAIN_DB_PREFIX."table3"), // List of tables we want to see into dictonnary editor
|
||||
'tablib'=>array("Table1","Table2","Table3"), // Label of tables
|
||||
'tabsql'=>array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table1 as f','SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table2 as f','SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table3 as f'), // Request to select fields
|
||||
@ -186,21 +186,21 @@ class modDataPolicies extends DolibarrModules {
|
||||
'tabfieldvalue'=>array("code,label","code,label","code,label"), // List of fields (list of fields to edit a record)
|
||||
'tabfieldinsert'=>array("code,label","code,label","code,label"), // List of fields (list of fields for insert)
|
||||
'tabrowid'=>array("rowid","rowid","rowid"), // Name of columns with primary key (try to always name it 'rowid')
|
||||
'tabcond'=>array($conf->datapolicies->enabled,$conf->datapolicies->enabled,$conf->datapolicies->enabled) // Condition to show each dictionary
|
||||
'tabcond'=>array($conf->datapolicy->enabled,$conf->datapolicy->enabled,$conf->datapolicy->enabled) // Condition to show each dictionary
|
||||
);
|
||||
*/
|
||||
|
||||
|
||||
// Boxes/Widgets
|
||||
// Add here list of php file(s) stored in datapolicies/core/boxes that contains class to show a widget.
|
||||
// Add here list of php file(s) stored in datapolicy/core/boxes that contains class to show a widget.
|
||||
$this->boxes = array();
|
||||
|
||||
|
||||
// Cronjobs (List of cron jobs entries to add when module is enabled)
|
||||
// unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week
|
||||
$this->cronjobs = array(
|
||||
0 => array('label' => 'DATAPOLICIES Cron', 'jobtype' => 'method', 'class' => '/datapolicies/class/datapoliciesCron.class.php', 'objectname' => 'RgpdCron', 'method' => 'exec', 'parameters' => '', 'comment' => 'Comment', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 1, 'test' => true),
|
||||
1 => array('label' => 'DATAPOLICIES Mailing', 'jobtype' => 'method', 'class' => '/datapolicies/class/datapoliciesCron.class.php', 'objectname' => 'RgpdCron', 'method' => 'sendMailing', 'parameters' => '', 'comment' => 'Comment', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 0, 'test' => true)
|
||||
0 => array('label' => 'DATAPOLICY Cron', 'jobtype' => 'method', 'class' => '/datapolicy/class/datapolicyCron.class.php', 'objectname' => 'RgpdCron', 'method' => 'exec', 'parameters' => '', 'comment' => 'Comment', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 1, 'test' => true),
|
||||
1 => array('label' => 'DATAPOLICY Mailing', 'jobtype' => 'method', 'class' => '/datapolicy/class/datapolicyCron.class.php', 'objectname' => 'RgpdCron', 'method' => 'sendMailing', 'parameters' => '', 'comment' => 'Comment', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 0, 'test' => true)
|
||||
);
|
||||
// Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true),
|
||||
// 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true)
|
||||
@ -224,7 +224,7 @@ class modDataPolicies extends DolibarrModules {
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$this->_load_tables('/datapolicies/sql/');
|
||||
$this->_load_tables('/datapolicy/sql/');
|
||||
|
||||
// Create extrafields
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
|
||||
@ -232,28 +232,28 @@ class modDataPolicies extends DolibarrModules {
|
||||
|
||||
|
||||
// Extrafield contact
|
||||
//$result1=$extrafields->addExtraField('datapolicies_separate', "DATAPOLICIES_BLOCKCHECKBOX", 'separate', 100, 1, 'thirdparty', 0, 0, '', '', 1, '', '1', 0, '', '', 'datapolicies@datapolicies', '$conf->datapolicies->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicies_consentement', $langs->trans("DATAPOLICIES_consentement"), 'boolean', 101, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicies@datapolicies', '$conf->datapolicies->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicies_opposition_traitement', $langs->trans("DATAPOLICIES_opposition_traitement"), 'boolean', 102, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicies@datapolicies', '$conf->datapolicies->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicies_opposition_prospection', $langs->trans("DATAPOLICIES_opposition_prospection"), 'boolean', 103, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicies@datapolicies', '$conf->datapolicies->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicies_date', $langs->trans("DATAPOLICIES_date"), 'date', 104, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0);
|
||||
$result1 = $extrafields->addExtraField('datapolicies_send', $langs->trans("DATAPOLICIES_send"), 'date', 105, 3, 'thirdparty', 0, 0, '', '', 0, '', '0', 0);
|
||||
//$result1=$extrafields->addExtraField('datapolicy_separate', "DATAPOLICY_BLOCKCHECKBOX", 'separate', 100, 1, 'thirdparty', 0, 0, '', '', 1, '', '1', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicy_consentement', $langs->trans("DATAPOLICY_consentement"), 'boolean', 101, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicy_opposition_traitement', $langs->trans("DATAPOLICY_opposition_traitement"), 'boolean', 102, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicy_opposition_prospection', $langs->trans("DATAPOLICY_opposition_prospection"), 'boolean', 103, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicy_date', $langs->trans("DATAPOLICY_date"), 'date', 104, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0);
|
||||
$result1 = $extrafields->addExtraField('datapolicy_send', $langs->trans("DATAPOLICY_send"), 'date', 105, 3, 'thirdparty', 0, 0, '', '', 0, '', '0', 0);
|
||||
|
||||
// Extrafield Tiers
|
||||
//$result1=$extrafields->addExtraField('datapolicies_separate', "DATAPOLICIES_BLOCKCHECKBOX", 'separate', 100, 1, 'contact', 0, 0, '', '', 1, '', '1', 0, '', '', 'datapolicies@datapolicies', '$conf->datapolicies->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicies_consentement', $langs->trans("DATAPOLICIES_consentement"), 'boolean', 101, 3, 'contact', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicies@datapolicies', '$conf->datapolicies->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicies_opposition_traitement', $langs->trans("DATAPOLICIES_opposition_traitement"), 'boolean', 102, 3, 'contact', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicies@datapolicies', '$conf->datapolicies->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicies_opposition_prospection', $langs->trans("DATAPOLICIES_opposition_prospection"), 'boolean', 103, 3, 'contact', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicies@datapolicies', '$conf->datapolicies->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicies_date', $langs->trans("DATAPOLICIES_date"), 'date', 104, 3, 'contact', 0, 0, '', '', 1, '', '3', 0);
|
||||
$result1 = $extrafields->addExtraField('datapolicies_send', $langs->trans("DATAPOLICIES_send"), 'date', 105, 3, 'contact', 0, 0, '', '', 0, '', '0', 0);
|
||||
//$result1=$extrafields->addExtraField('datapolicy_separate', "DATAPOLICY_BLOCKCHECKBOX", 'separate', 100, 1, 'contact', 0, 0, '', '', 1, '', '1', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicy_consentement', $langs->trans("DATAPOLICY_consentement"), 'boolean', 101, 3, 'contact', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicy_opposition_traitement', $langs->trans("DATAPOLICY_opposition_traitement"), 'boolean', 102, 3, 'contact', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicy_opposition_prospection', $langs->trans("DATAPOLICY_opposition_prospection"), 'boolean', 103, 3, 'contact', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicy_date', $langs->trans("DATAPOLICY_date"), 'date', 104, 3, 'contact', 0, 0, '', '', 1, '', '3', 0);
|
||||
$result1 = $extrafields->addExtraField('datapolicy_send', $langs->trans("DATAPOLICY_send"), 'date', 105, 3, 'contact', 0, 0, '', '', 0, '', '0', 0);
|
||||
|
||||
// Extrafield Adherent
|
||||
//$result1=$extrafields->addExtraField('datapolicies_separate', "DATAPOLICIES_BLOCKCHECKBOX", 'separate', 100, 1, 'adherent', 0, 0, '', '', 1, '', '1', 0, '', '', 'datapolicies@datapolicies', '$conf->datapolicies->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicies_consentement', $langs->trans("DATAPOLICIES_consentement"), 'boolean', 101, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicies@datapolicies', '$conf->datapolicies->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicies_opposition_traitement', $langs->trans("DATAPOLICIES_opposition_traitement"), 'boolean', 102, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicies@datapolicies', '$conf->datapolicies->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicies_opposition_prospection', $langs->trans("DATAPOLICIES_opposition_prospection"), 'boolean', 103, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicies@datapolicies', '$conf->datapolicies->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicies_date', $langs->trans("DATAPOLICIES_date"), 'date', 104, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0);
|
||||
$result1 = $extrafields->addExtraField('datapolicies_send', $langs->trans("DATAPOLICIES_send"), 'date', 105, 3, 'adherent', 0, 0, '', '', 0, '', '0', 0);
|
||||
//$result1=$extrafields->addExtraField('datapolicy_separate', "DATAPOLICY_BLOCKCHECKBOX", 'separate', 100, 1, 'adherent', 0, 0, '', '', 1, '', '1', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicy_consentement', $langs->trans("DATAPOLICY_consentement"), 'boolean', 101, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicy_opposition_traitement', $langs->trans("DATAPOLICY_opposition_traitement"), 'boolean', 102, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicy_opposition_prospection', $langs->trans("DATAPOLICY_opposition_prospection"), 'boolean', 103, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
||||
$result1 = $extrafields->addExtraField('datapolicy_date', $langs->trans("DATAPOLICY_date"), 'date', 104, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0);
|
||||
$result1 = $extrafields->addExtraField('datapolicy_send', $langs->trans("DATAPOLICY_send"), 'date', 105, 3, 'adherent', 0, 0, '', '', 0, '', '0', 0);
|
||||
|
||||
$sql = array();
|
||||
|
||||
@ -199,12 +199,12 @@ if ($permission) {
|
||||
if ($tab[$i]['source']=='internal')
|
||||
{
|
||||
$userstatic->fetch($tab[$i]['id']);
|
||||
echo $userstatic->getNomUrl(-1);
|
||||
echo $userstatic->getNomUrl(-1, '', 0, 0, 0, 0, '', 'valignmiddle');
|
||||
}
|
||||
if ($tab[$i]['source']=='external')
|
||||
{
|
||||
$contactstatic->fetch($tab[$i]['id']);
|
||||
echo $contactstatic->getNomUrl(1);
|
||||
echo $contactstatic->getNomUrl(1, '', 0, 0, 0, 0, '', 'valignmiddle');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
/**
|
||||
* \file htdocs/core/website.inc.php
|
||||
* \brief Common file loaded by all website pages (after master.inc.php). It set the new object $weblangs, using parameter 'l'.
|
||||
* This file is included in top of all container pages.
|
||||
* The global variable $websitekey must be defined.
|
||||
*/
|
||||
|
||||
@ -32,8 +33,61 @@ if (! is_object($website))
|
||||
}
|
||||
if (! is_object($weblangs))
|
||||
{
|
||||
$weblangs = dol_clone($langs);
|
||||
$weblangs = dol_clone($langs); // TODO Use an object lang from a language set into $website object instead of backoffice
|
||||
}
|
||||
|
||||
// A lang was forced, so we change weblangs init
|
||||
if (GETPOST('l','aZ09')) $weblangs->setDefaultLang(GETPOST('l','aZ09'));
|
||||
// A lang was forced, so we check to find if we must make a redirect on translation page
|
||||
if ($_SERVER['PHP_SELF'] != DOL_URL_ROOT.'/website/index.php') // If we browsing page using Dolibarr server or a Native web server
|
||||
{
|
||||
//print_r(get_defined_constants(true));exit;
|
||||
if (GETPOST('l','aZ09'))
|
||||
{
|
||||
if (! $pageid && ! empty($websitepagefile))
|
||||
{
|
||||
$pageid = str_replace(array('.tpl.php', 'page'), array('', ''), basename($websitepagefile));
|
||||
}
|
||||
if ($pageid > 0)
|
||||
{
|
||||
// Load tmppage if we have $websitepagefile defined
|
||||
include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
|
||||
$tmppage=new WebsitePage($db);
|
||||
$tmppage->fetch($pageid);
|
||||
|
||||
$sql ="SELECT wp.rowid, wp.lang, wp.pageurl, wp.fk_page";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."website_page as wp";
|
||||
$sql.=" WHERE wp.fk_website = ".$website->id;
|
||||
$sql.=" AND (wp.fk_page = ".$pageid." OR wp.rowid = ".$pageid;
|
||||
if ($tmppage->fk_page > 0) $sql.=" OR wp.fk_page = ".$tmppage->fk_page." OR wp.rowid = ".$tmppage->fk_page;
|
||||
$sql.=")";
|
||||
$sql.= " AND wp.lang = '".$db->escape(GETPOST('l','aZ09'))."'";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj)
|
||||
{
|
||||
$newpageid = $obj->rowid;
|
||||
if ($newpageid != $pageid) // To avoid to make a redirect on same page (infinite loop)
|
||||
{
|
||||
if (defined('USEDOLIBARRSERVER')) {
|
||||
header("Location: ".DOL_URL_ROOT.'/public/website/index.php?website='.$websitekey.'&pageid='.$newpageid.'.php&l='.GETPOST('l','aZ09'));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$newpageref = $obj->pageurl;
|
||||
header("Location: ".$newpageref.'.php?l='.GETPOST('l','aZ09'));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Load websitepage class
|
||||
include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
|
||||
|
||||
@ -1,93 +0,0 @@
|
||||
# Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
#
|
||||
# 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
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (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
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Module label 'ModulergpdName'
|
||||
ModulergpdName = GDPR
|
||||
# Module description 'ModulergpdDesc'
|
||||
ModulergpdDesc = Conformity with the GDPR
|
||||
|
||||
#
|
||||
# Page d'administration
|
||||
#
|
||||
rgpdSetup = Module Setup
|
||||
Settings_DATAPOLICIES = Settings of DATAPOLICIES module
|
||||
rgpdSetupPage = According to <a href="http://www.privacy-regulation.eu/en/5.htm" target="_blank">Article 5</a> of the GDPR, personal data must be kept for a period not exceeding that necessary for the purposes for which they were processed, except for archival purposes.
|
||||
The deletion will be done automatically after a certain duration without event (the duration which you will have indicated below).
|
||||
NB_MONTHS = %s months
|
||||
ONE_YEAR = 1 year
|
||||
NB_YEARS = %s years
|
||||
DATAPOLICIES_TIERS_CLIENT = Customer
|
||||
DATAPOLICIES_TIERS_PROSPECT = Prospect
|
||||
DATAPOLICIES_TIERS_PROSPECT_CLIENT = Prospect/Customer
|
||||
DATAPOLICIES_TIERS_NIPROSPECT_NICLIENT = Nor prospect/Nor customer
|
||||
DATAPOLICIES_TIERS_FOURNISSEUR = Supplier
|
||||
DATAPOLICIES_CONTACT_CLIENT = Customer
|
||||
DATAPOLICIES_CONTACT_PROSPECT = Prospect
|
||||
DATAPOLICIES_CONTACT_PROSPECT_CLIENT = Prospect/Customer
|
||||
DATAPOLICIES_CONTACT_NIPROSPECT_NICLIENT = Nor prospect/Nor customer
|
||||
DATAPOLICIES_CONTACT_FOURNISSEUR = Supplier
|
||||
DATAPOLICIES_ADHERENT = Member
|
||||
DATAPOLICIES_Tooltip_SETUP = Type of contact - Indicate your choices for each type.
|
||||
DATAPOLICIESMail=Emails Setup
|
||||
DATAPOLICIESSUBJECTMAIL=Subject of email
|
||||
DATAPOLICIESCONTENTMAIL=Content of the email
|
||||
DATAPOLICIESSUBSITUTION=You can use the following variables in your email (LINKACCEPT allows to create a link recording the agreement of the person, LINKREFUSED makes it possible to record the refusal of the person):
|
||||
DATAPOLICIESACCEPT=Message after agreement
|
||||
DATAPOLICIESREFUSE=Message after desagreement
|
||||
SendAgreementText=You can send a GDPR email to all your relevant contacts (who have not yet received an email and for which you have not registered anything about their GDPR agreement). To do this, use the following button.
|
||||
SendAgreement=Send emails
|
||||
AllAgreementSend = All emails have been sent
|
||||
TXTLINKDATAPOLICIESACCEPT= Text for the link "agreement"
|
||||
TXTLINKDATAPOLICIESREFUSE= Text for the link "desagreement"
|
||||
|
||||
|
||||
#
|
||||
# Extrafield
|
||||
#
|
||||
DATAPOLICIES_BLOCKCHECKBOX = GDPR : Processing of personal data
|
||||
DATAPOLICIES_consentement = Consent obtained for the processing of personal data
|
||||
DATAPOLICIES_opposition_traitement = Opposes the processing of his personal data
|
||||
DATAPOLICIES_opposition_prospection = Opposes the processing of his personal data for the purposes of prospecting
|
||||
|
||||
#
|
||||
# Popup
|
||||
#
|
||||
DATAPOLICIES_POPUP_ANONYME_TITLE = Anonymize a thirdparty
|
||||
DATAPOLICIES_POPUP_ANONYME_TEXTE = You can not delete this contact from Dolibarr because there are related items. In accordance with the GDPR, you will make all this data anonymous to respect your obligations. Would you like to continue ?
|
||||
|
||||
#
|
||||
# Bouton portabilité
|
||||
#
|
||||
DATAPOLICIES_PORTABILITE = Portability GDPR
|
||||
DATAPOLICIES_PORTABILITE_TITLE = Export of personal data
|
||||
DATAPOLICIES_PORTABILITE_CONFIRMATION = You want to export the personal data of this contact. Are you sure ?
|
||||
|
||||
#
|
||||
# Note ajoutés lors d'une anonymisation
|
||||
#
|
||||
ANONYMISER_AT = Anonymised the %s
|
||||
|
||||
#V2
|
||||
DATAPOLICIESReturn=GDPR Validation
|
||||
DATAPOLICIES_date = Date of agreement/desagreement GDPR
|
||||
DATAPOLICIES_send = Date sending agreement email
|
||||
DATAPOLICIESReturn = GDPR Return
|
||||
DATAPOLICIES_SEND = Send GDPR email
|
||||
MailSent = Email has been sent
|
||||
|
||||
#ERROR
|
||||
ErrorSubjectIsRequired= Error : The subject of email is required. Indicate it in the module setup
|
||||
=Due to a technical problem, we were unable to register your choice. We apologize for that. Contact us to send us your choice.
|
||||
NUMBER_MONTH_BEFORE_DELETION = Number of month before deletion
|
||||
@ -1,97 +0,0 @@
|
||||
# Copyright (C) 2018 INOVEA CONSEil info@inovea-conseil.com
|
||||
#
|
||||
# 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
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (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
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#
|
||||
# Générique
|
||||
#
|
||||
|
||||
# Module label 'ModulergpdName'
|
||||
ModulergpdName = DATAPOLICIES
|
||||
# Module description 'ModulergpdDesc'
|
||||
Module432452Desc = Module de mise en conformité avec le DATAPOLICIES
|
||||
|
||||
#
|
||||
# Page d'administration
|
||||
#
|
||||
rgpdSetup = Configuration du module DATAPOLICIES
|
||||
Settings_DATAPOLICIES = Paramétrage du module DATAPOLICIES
|
||||
rgpdSetupPage = Selon <a href="http://www.privacy-regulation.eu/fr/5.htm" target="_blank">l’article 5</a> du DATAPOLICIES, les données à caractère personnel doivent être conservées pendant une durée n’excédant pas celle nécessaire au regard des finalités pour lesquelles elles ont été traitées, à l’exception de fins archivistiques. La suppression se fera automatiquement après une certaine durée sans évènement (la durée que vous aurez indiquée ci-dessous).
|
||||
NB_MONTHS = %s mois
|
||||
ONE_YEAR = 1 an
|
||||
NB_YEARS = %s ans
|
||||
DATAPOLICIES_TIERS_CLIENT = Client
|
||||
DATAPOLICIES_TIERS_PROSPECT = Prospect
|
||||
DATAPOLICIES_TIERS_PROSPECT_CLIENT = Prospect/Client
|
||||
DATAPOLICIES_TIERS_NIPROSPECT_NICLIENT = Ni prospect / Ni client
|
||||
DATAPOLICIES_TIERS_FOURNISSEUR = Fournisseur
|
||||
DATAPOLICIES_CONTACT_CLIENT = Client
|
||||
DATAPOLICIES_CONTACT_PROSPECT = Prospect
|
||||
DATAPOLICIES_CONTACT_PROSPECT_CLIENT = Prospect/Client
|
||||
DATAPOLICIES_CONTACT_NIPROSPECT_NICLIENT = Ni prospect / Ni client
|
||||
DATAPOLICIES_CONTACT_FOURNISSEUR = Fournisseur
|
||||
DATAPOLICIES_ADHERENT = Adhérent
|
||||
DATAPOLICIES_Tooltip_SETUP = Type du contact - Indiquez vos choix pour chaque type.
|
||||
DATAPOLICIESMail=Paramétrage des emails
|
||||
DATAPOLICIESSUBJECTMAIL=Objet du mail
|
||||
DATAPOLICIESCONTENTMAIL=Contenu du mail
|
||||
DATAPOLICIESSUBSITUTION=Vous pouvez utiliser les variables suivantes dans votre email (LINKACCEPT permet de créer un lien enregistrant l'acceptation de la personne, LINKREFUSED permet d'enregistrer le refus de la personne) :
|
||||
DATAPOLICIESACCEPT=Message suite acceptation
|
||||
DATAPOLICIESREFUSE=Message suite opposition
|
||||
SendAgreementText=Vous pouvez envoyer un email DATAPOLICIES à tous vos contacts concernés (qui n'ont pas encore reçus de mail et pour lesquels vous n'avez rien enregistré concernant leur accord/désaccord DATAPOLICIES). Pour cela, utilisez le bouton suivant.
|
||||
SendAgreement=Envoyer les emails
|
||||
AllAgreementSend = Tous les e-mails de consentement ont été envoyés
|
||||
TXTLINKDATAPOLICIESACCEPT= Texte du lien d'acceptation
|
||||
TXTLINKDATAPOLICIESREFUSE= Texte du lien d'opposition
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Extrafield
|
||||
#
|
||||
DATAPOLICIES_BLOCKCHECKBOX = DATAPOLICIES : Traitement des données à caractère personnel
|
||||
DATAPOLICIES_consentement = Consentement recueilli pour le traitement des données à caractère personnel le concernant
|
||||
DATAPOLICIES_opposition_traitement = S’oppose au traitement de ses données à caractère personnel
|
||||
DATAPOLICIES_opposition_prospection = S’oppose au traitement de ses données à caractère personnel à des fins de prospection
|
||||
|
||||
#
|
||||
# Popup
|
||||
#
|
||||
DATAPOLICIES_POPUP_ANONYME_TITLE = Anonymiser un tiers
|
||||
DATAPOLICIES_POPUP_ANONYME_TEXTE = Vous ne pouvez pas supprimer ce contact de Dolibarr car des éléments y sont liés. Conformément au DATAPOLICIES, vous allez rendre toutes ces données anonymes afin de respecter vos obligations. Souhaitez-vous continuer ?
|
||||
|
||||
#
|
||||
# Bouton portabilité
|
||||
#
|
||||
DATAPOLICIES_PORTABILITE = Portabilité DATAPOLICIES
|
||||
DATAPOLICIES_PORTABILITE_TITLE = Export des données à caractère personnel
|
||||
DATAPOLICIES_PORTABILITE_CONFIRMATION = Vous souhaitez exporter les données à caractère personnel de ce contact. Etes-vous sûr ?
|
||||
|
||||
#
|
||||
# Note ajoutés lors d'une anonymisation
|
||||
#
|
||||
ANONYMISER_AT = Anonymisé le %s
|
||||
|
||||
#V2
|
||||
DATAPOLICIESReturn=Validation DATAPOLICIES
|
||||
DATAPOLICIES_date=Date d'accord/opposition au traitement
|
||||
DATAPOLICIES_send=Date envoi consentement
|
||||
DATAPOLICIESReturn=Retour DATAPOLICIES
|
||||
DATAPOLICIES_SEND=Envoyer l'email de consentement
|
||||
MailSent=L'email a bien été envoyé
|
||||
|
||||
#ERROR
|
||||
ErrorSubjectIsRequired=Erreur : vous n'avez pas indiqué l'objet de l'email dans la configuration
|
||||
=Suite à un problème technique, nous n'avons pas pu enregistrer votre choix. Nous nous en excusons. Contactez-nous pour nous transmettre votre choix.
|
||||
NUMBER_MONTH_BEFORE_DELETION = Nombre de mois avant suppression des données
|
||||
@ -1,80 +0,0 @@
|
||||
# Copyright (C) 2018 INOVEA CONSEIl info@inovea-conseil.com - Thanks to Claudio Aschieri
|
||||
#
|
||||
# # Module label 'ModulergpdName'
|
||||
ModulergpdName = GDPR
|
||||
# Module description 'ModulergpdDesc'
|
||||
ModulergpdDesc = Conformità con GDPR
|
||||
Module432452Name=GDPR
|
||||
Module432452Desc=Conformità con GDPR (Regolamento Generale sulla protezione di dati)
|
||||
|
||||
#
|
||||
# Page d'administration
|
||||
#
|
||||
rgpdSetup = Module Setup
|
||||
Settings_DATAPOLICIES = Configurazione modulo GDPR
|
||||
rgpdSetupPage = In accordo con <a href="http://www.privacy-regulation.eu/it/5.htm" target="_blank">l'art 5 del GDPR </a> i dati personali devono essere conservati per un periodo di tempo che .... ed eliminati se non sono più utili agli scopi per cui sono stati processati.
|
||||
NB_MONTHS = %s mesi
|
||||
ONE_YEAR = 1 anno
|
||||
NB_YEARS = %s anni
|
||||
DATAPOLICIES_TIERS_CLIENT = Cliente
|
||||
DATAPOLICIES_TIERS_PROSPECT = Fornitore
|
||||
DATAPOLICIES_TIERS_PROSPECT_CLIENT = Potenziale Cliente / Cliente
|
||||
DATAPOLICIES_TIERS_NIPROSPECT_NICLIENT = Nè potenziale cliente / Nè cliente
|
||||
DATAPOLICIES_TIERS_FOURNISSEUR = Fornitore
|
||||
DATAPOLICIES_CONTACT_CLIENT = Cliente
|
||||
DATAPOLICIES_CONTACT_PROSPECT = Potenziale cliente
|
||||
DATAPOLICIES_CONTACT_PROSPECT_CLIENT = Potenziale Cliente / Cliente
|
||||
DATAPOLICIES_CONTACT_NIPROSPECT_NICLIENT = Nè potenziale cliente / Nè cliente
|
||||
DATAPOLICIES_CONTACT_FOURNISSEUR = Fornitore
|
||||
DATAPOLICIES_ADHERENT = Membri
|
||||
DATAPOLICIES_Tooltip_SETUP = Tipo di contatto - Indica la scelta per ogni tipologia
|
||||
DATAPOLICIESMail=Configurazione Email
|
||||
DATAPOLICIESSUBJECTMAIL=Subject dell'e-mail
|
||||
DATAPOLICIESCONTENTMAIL=Contenuto dell'e-mail
|
||||
DATAPOLICIESSUBSITUTION=Puoi utilizzare le seguenti variabili nella tua email (LINKACCEPT consente di creare un link per registrare l'accettazione della persona, LINKREFUSED consente di registrare il rifiuto della persona):
|
||||
DATAPOLICIESACCEPT= Messaggio dopo il consenso
|
||||
DATAPOLICIESREFUSE=Messaggio dopo il rifiuto
|
||||
SendAgreementText=Puoi inviare un'email GDPR a tutti i tuoi contatti rilevanti (che non hanno ancora ricevuto un'e-mail e per i quali non hai registrato nulla sul loro accordo GDPR). Per fare ciò, utilizzare il seguente pulsante.
|
||||
SendAgreement=Invia emails
|
||||
AllAgreementSend = Tutte le email sono state inviate
|
||||
TXTLINKDATAPOLICIESACCEPT= Testo per il link "Consenso"
|
||||
TXTLINKDATAPOLICIESREFUSE= Testo per il link "Consenso negato"
|
||||
|
||||
#
|
||||
# Extrafield
|
||||
#
|
||||
DATAPOLICIES_BLOCKCHECKBOX = GDPR : Trattamento dei dati personali
|
||||
DATAPOLICIES_consentement = Consenso ottenuto al Trattamento dei dati personali
|
||||
DATAPOLICIES_opposition_traitement = Consenso negato al trattamento dei dati personali
|
||||
DATAPOLICIES_opposition_prospection = Consenso negato al trattamento dei dati personali a fini commerciali
|
||||
|
||||
#
|
||||
# Popup
|
||||
#
|
||||
DATAPOLICIES_POPUP_ANONYME_TITLE = Anonimizza un soggetto terzo
|
||||
DATAPOLICIES_POPUP_ANONYME_TEXTE = Impossibile eliminare questo contatto da Dolibarr perchè vi sono elementi collegati. In conformità con il GDPR, renderai tutti questi dati anonimi per rispettare i tuoi obblighi. Vuoi continuare?
|
||||
|
||||
|
||||
#
|
||||
# Bouton portabilité
|
||||
#
|
||||
DATAPOLICIES_PORTABILITE = Portabilità GDPR
|
||||
DATAPOLICIES_PORTABILITE_TITLE = Esporta i dati personali
|
||||
DATAPOLICIES_PORTABILITE_CONFIRMATION = Vuoi davvero esportare i dati personali di questo contatto?
|
||||
|
||||
#
|
||||
# Note ajoutée lors d'une anonymisation
|
||||
#
|
||||
ANONYMISER_AT = Anonimizzato il %s
|
||||
|
||||
#V2
|
||||
DATAPOLICIESReturn=GDPR Validazione
|
||||
DATAPOLICIES_date = Data di accordo / disaccordo GDPR
|
||||
DATAPOLICIES_send = Data di invio del consenso (e-mail)
|
||||
DATAPOLICIESReturn = GDPR ritorno
|
||||
DATAPOLICIES_SEND = Inviare GDPR e-mail
|
||||
MailSent=L'email è stata inviata
|
||||
|
||||
#ERROR
|
||||
ErrorSubjectIsRequired= Errore: L'oggetto della mail è obbligatorio. Inserisci l'oggetto nella configurazione del modulo.
|
||||
=A causa di un problema tecnico, non siamo stati in grado di registrare la tua scelta. Ci scusiamo per questo. Contattaci per inviarci la tua scelta.
|
||||
@ -17,21 +17,21 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file datapolicies/admin/setup.php
|
||||
* \ingroup datapolicies
|
||||
* \brief datapolicies setup page.
|
||||
* \file datapolicy/admin/setup.php
|
||||
* \ingroup datapolicy
|
||||
* \brief datapolicy setup page.
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php";
|
||||
require_once '../lib/datapolicies.lib.php';
|
||||
require_once '../lib/datapolicy.lib.php';
|
||||
//require_once "../class/myclass.class.php";
|
||||
|
||||
// Translations
|
||||
$langs->load('admin');
|
||||
$langs->load('companies');
|
||||
$langs->load('members');
|
||||
$langs->load('datapolicies@datapolicies');
|
||||
$langs->load('datapolicy@datapolicy');
|
||||
|
||||
// Access control
|
||||
if (! $user->admin) accessforbidden();
|
||||
@ -41,17 +41,17 @@ $action = GETPOST('action', 'alpha');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
|
||||
$arrayofparameters=array(
|
||||
'DATAPOLICIES_TIERS_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_TIERS_PROSPECT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_TIERS_PROSPECT_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_TIERS_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_TIERS_FOURNISSEUR'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_CONTACT_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_CONTACT_PROSPECT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_CONTACT_PROSPECT_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_CONTACT_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_ADHERENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_TIERS_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_TIERS_PROSPECT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_TIERS_PROSPECT_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_TIERS_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_TIERS_FOURNISSEUR'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_CONTACT_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_CONTACT_PROSPECT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_CONTACT_PROSPECT_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_ADHERENT'=>array('css'=>'minwidth200'),
|
||||
);
|
||||
|
||||
|
||||
@ -81,26 +81,26 @@ if (DOL_VERSION < '7' && $action == 'update') {
|
||||
|
||||
$arrayofparameters=array(
|
||||
'ThirdParty' => array(
|
||||
'DATAPOLICIES_TIERS_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_TIERS_PROSPECT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_TIERS_PROSPECT_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_TIERS_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_TIERS_FOURNISSEUR'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_TIERS_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_TIERS_PROSPECT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_TIERS_PROSPECT_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_TIERS_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_TIERS_FOURNISSEUR'=>array('css'=>'minwidth200'),
|
||||
),
|
||||
'Contact' => array(
|
||||
'DATAPOLICIES_CONTACT_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_CONTACT_PROSPECT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_CONTACT_PROSPECT_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_CONTACT_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICIES_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_CONTACT_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_CONTACT_PROSPECT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_CONTACT_PROSPECT_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200'),
|
||||
),
|
||||
'Member' => array(
|
||||
'DATAPOLICIES_ADHERENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_ADHERENT'=>array('css'=>'minwidth200'),
|
||||
)
|
||||
);
|
||||
|
||||
$valTab = array(
|
||||
'' => $langs->trans('None'),
|
||||
'' => $langs->trans('Never'),
|
||||
'6' => $langs->trans('NB_MONTHS', 6),
|
||||
'12' => $langs->trans('ONE_YEAR'),
|
||||
'24' => $langs->trans('NB_YEARS', 2),
|
||||
@ -108,6 +108,8 @@ $valTab = array(
|
||||
'48' => $langs->trans('NB_YEARS', 4),
|
||||
'60' => $langs->trans('NB_YEARS', 5),
|
||||
'120' => $langs->trans('NB_YEARS', 10),
|
||||
'180' => $langs->trans('NB_YEARS', 15),
|
||||
'240' => $langs->trans('NB_YEARS', 20),
|
||||
);
|
||||
|
||||
|
||||
@ -115,20 +117,20 @@ $valTab = array(
|
||||
* View
|
||||
*/
|
||||
|
||||
$page_name = "datapoliciesSetup";
|
||||
$page_name = "datapolicySetup";
|
||||
llxHeader('', $langs->trans($page_name));
|
||||
|
||||
// Subheader
|
||||
$linkback = '<a href="'.($backtopage?$backtopage:DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
|
||||
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback, 'object_datapolicies@datapolicies');
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback, 'object_datapolicy@datapolicy');
|
||||
|
||||
// Configuration header
|
||||
$head = datapoliciesAdminPrepareHead();
|
||||
dol_fiche_head($head, 'settings', '', -1, "datapolicies@datapolicies");
|
||||
$head = datapolicyAdminPrepareHead();
|
||||
dol_fiche_head($head, 'settings', '', -1, "datapolicy@datapolicy");
|
||||
|
||||
// Setup page goes here
|
||||
echo $langs->trans("datapoliciesSetupPage");
|
||||
echo '<span class="opacitymedium">'.$langs->trans("datapolicySetupPage").'</span><br><br>';
|
||||
|
||||
|
||||
if ($action == 'edit')
|
||||
@ -180,7 +182,7 @@ else
|
||||
foreach($tab as $key => $val)
|
||||
{
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans($key),$langs->trans('DATAPOLICIES_Tooltip_SETUP'));
|
||||
print $form->textwithpicto($langs->trans($key),$langs->trans('DATAPOLICY_Tooltip_SETUP'));
|
||||
print '</td><td>' . ($conf->global->$key == '' ? $langs->trans('None') : $valTab[$conf->global->$key]) . '</td></tr>';
|
||||
}
|
||||
|
||||
@ -22,10 +22,10 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php";
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formadmin.class.php';
|
||||
require_once '../lib/datapolicies.lib.php';
|
||||
require_once '../lib/datapolicy.lib.php';
|
||||
|
||||
// Translations
|
||||
$langs->loadLangs(array('admin', 'companies', 'members', 'datapolicies'));
|
||||
$langs->loadLangs(array('admin', 'companies', 'members', 'datapolicy'));
|
||||
|
||||
|
||||
// Parameters
|
||||
@ -78,17 +78,17 @@ if ($action == 'setvalue' && $user->admin) {
|
||||
* View
|
||||
*/
|
||||
|
||||
$page_name = "datapoliciesSetup";
|
||||
$page_name = "datapolicySetup";
|
||||
llxHeader('', $langs->trans($page_name));
|
||||
|
||||
// Subheader
|
||||
$linkback = '<a href="' . ($backtopage ? $backtopage : DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1') . '">' . $langs->trans("BackToModuleList") . '</a>';
|
||||
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback, 'object_datapolicies@datapolicies');
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback, 'object_datapolicy@datapolicy');
|
||||
|
||||
// Configuration header
|
||||
$head = datapoliciesAdminPrepareHead();
|
||||
dol_fiche_head($head, 'settings', '', -1, "datapolicies@datapolicies");
|
||||
$head = datapolicyAdminPrepareHead();
|
||||
dol_fiche_head($head, 'settings', '', -1, "datapolicy@datapolicy");
|
||||
|
||||
|
||||
|
||||
@ -161,7 +161,7 @@ dol_fiche_end();
|
||||
print '<br><br>';
|
||||
|
||||
print $langs->trans('SendAgreementText');
|
||||
print '<a class="button" href="'.dol_buildpath('/datapolicies/mailing.php').'">'.$langs->trans('SendAgreement').'</a>';
|
||||
print '<a class="button" href="'.dol_buildpath('/datapolicy/mailing.php').'">'.$langs->trans('SendAgreement').'</a>';
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -17,15 +17,15 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file datapolicies/class/actions_datapolicies.class.php
|
||||
* \ingroup datapolicies
|
||||
* \file datapolicy/class/actions_datapolicy.class.php
|
||||
* \ingroup datapolicy
|
||||
* \brief Example hook overload.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class ActionsDatapolicies
|
||||
* Class ActionsDatapolicy
|
||||
*/
|
||||
class ActionsDatapolicies
|
||||
class ActionsDatapolicy
|
||||
{
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
@ -91,7 +91,7 @@ class ActionsDatapolicies
|
||||
public function doActions($parameters, &$object, &$action, $hookmanager)
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
$langs->load('datapolicies@datapolicies');
|
||||
$langs->load('datapolicy@datapolicy');
|
||||
$error = 0; // Error counter
|
||||
|
||||
if (GETPOST('socid') && $parameters['currentcontext'] == 'thirdpartycard') {
|
||||
@ -129,9 +129,9 @@ class ActionsDatapolicies
|
||||
header('Location:' . $_SERVER["PHP_SELF"] . "?socid=" . $object->id);
|
||||
}
|
||||
}
|
||||
} elseif ($parameters['currentcontext'] == 'thirdpartycard' && $action == 'datapolicies_portabilite') {
|
||||
} elseif ($parameters['currentcontext'] == 'thirdpartycard' && $action == 'datapolicy_portabilite') {
|
||||
header('Content-Type: application/csv');
|
||||
header('Content-Disposition: attachment; filename=datapolicies_portabilite.csv');
|
||||
header('Content-Disposition: attachment; filename=datapolicy_portabilite.csv');
|
||||
header('Pragma: no-cache');
|
||||
$object->fetch(GETPOST('socid'));
|
||||
echo 'Name;Fistname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;' . PHP_EOL;
|
||||
@ -152,9 +152,9 @@ class ActionsDatapolicies
|
||||
echo $object->skype . ';';
|
||||
echo ';';
|
||||
exit;
|
||||
} elseif ($parameters['currentcontext'] == 'membercard' && $action == 'datapolicies_portabilite') {
|
||||
} elseif ($parameters['currentcontext'] == 'membercard' && $action == 'datapolicy_portabilite') {
|
||||
header('Content-Type: application/csv');
|
||||
header('Content-Disposition: attachment; filename=datapolicies_portabilite.csv');
|
||||
header('Content-Disposition: attachment; filename=datapolicy_portabilite.csv');
|
||||
header('Pragma: no-cache');
|
||||
$soc = $object->fetch_thirdparty();
|
||||
|
||||
@ -176,10 +176,10 @@ class ActionsDatapolicies
|
||||
echo $object->skype . ';';
|
||||
echo dol_print_date($object->birth) . ';';
|
||||
exit;
|
||||
} elseif ($parameters['currentcontext'] == 'contactcard' && $action == 'datapolicies_portabilite') {
|
||||
} elseif ($parameters['currentcontext'] == 'contactcard' && $action == 'datapolicy_portabilite') {
|
||||
$object->fetch(GETPOST('id'));
|
||||
header('Content-Type: application/csv');
|
||||
header('Content-Disposition: attachment; filename=datapolicies_portabilite.csv');
|
||||
header('Content-Disposition: attachment; filename=datapolicy_portabilite.csv');
|
||||
header('Pragma: no-cache');
|
||||
$soc = $object->fetch_thirdparty();
|
||||
echo 'Name;Fistname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;' . PHP_EOL;
|
||||
@ -200,23 +200,23 @@ class ActionsDatapolicies
|
||||
echo $object->jabberid . ';';
|
||||
echo dol_print_date($object->birth) . ';';
|
||||
exit;
|
||||
} elseif ($parameters['currentcontext'] == 'contactcard' && $action == 'send_datapolicies') {
|
||||
} elseif ($parameters['currentcontext'] == 'contactcard' && $action == 'send_datapolicy') {
|
||||
$object->fetch(GETPOST('id'));
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/datapolicies/class/datapolicies.class.php';
|
||||
DataPolicies::sendMailDataPoliciesContact($object);
|
||||
require_once DOL_DOCUMENT_ROOT . '/datapolicy/class/datapolicy.class.php';
|
||||
DataPolicy::sendMailDataPolicyContact($object);
|
||||
}
|
||||
elseif ($parameters['currentcontext'] == 'membercard' && $action == 'send_datapolicies') {
|
||||
elseif ($parameters['currentcontext'] == 'membercard' && $action == 'send_datapolicy') {
|
||||
$object->fetch(GETPOST('id'));
|
||||
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/datapolicies/class/datapolicies.class.php';
|
||||
DataPolicies::sendMailDataPoliciesAdherent($object);
|
||||
} elseif ($parameters['currentcontext'] == 'thirdpartycard' && $action == 'send_datapolicies') {
|
||||
require_once DOL_DOCUMENT_ROOT . '/datapolicy/class/datapolicy.class.php';
|
||||
DataPolicy::sendMailDataPolicyAdherent($object);
|
||||
} elseif ($parameters['currentcontext'] == 'thirdpartycard' && $action == 'send_datapolicy') {
|
||||
$object->fetch(GETPOST('socid'));
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/datapolicies/class/datapolicies.class.php';
|
||||
DataPolicies::sendMailDataPoliciesCompany($object);
|
||||
require_once DOL_DOCUMENT_ROOT . '/datapolicy/class/datapolicy.class.php';
|
||||
DataPolicy::sendMailDataPolicyCompany($object);
|
||||
}
|
||||
|
||||
|
||||
@ -280,7 +280,7 @@ class ActionsDatapolicies
|
||||
|
||||
/* print_r($parameters); print_r($object); echo "action: " . $action; */
|
||||
if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) { // do something only for the context 'somecontext1' or 'somecontext2'
|
||||
$this->resprints = '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>' . $langs->trans("datapoliciesMassAction") . '</option>';
|
||||
$this->resprints = '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>' . $langs->trans("datapolicyMassAction") . '</option>';
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@ -361,18 +361,18 @@ class ActionsDatapolicies
|
||||
function addMoreActionsButtons($parameters, &$object, &$action, $hookmanager)
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
$langs->load('datapolicies@datapolicies');
|
||||
$langs->load('datapolicy@datapolicy');
|
||||
|
||||
if (! empty($conf->global->DATAPOLICIES_ENABLE_EMAILS))
|
||||
{
|
||||
$dialog = '<div id="dialogdatapolicies" style="display:none;" title="' . $langs->trans('DATAPOLICIES_PORTABILITE_TITLE') . '">';
|
||||
$dialog = '<div id="dialogdatapolicy" style="display:none;" title="' . $langs->trans('DATAPOLICIES_PORTABILITE_TITLE') . '">';
|
||||
$dialog .= '<div class="confirmmessage">' . img_help('', '') . ' ' . $langs->trans('DATAPOLICIES_PORTABILITE_CONFIRMATION') . '</div>';
|
||||
$dialog .= "</div>";
|
||||
$dialog .= '<script>
|
||||
$( function() {
|
||||
$("#rpgpdbtn").on("click", function(){
|
||||
var href = $(this).attr("href");
|
||||
$( "#dialogdatapolicies" ).dialog({
|
||||
$( "#dialogdatapolicy" ).dialog({
|
||||
modal: true,
|
||||
buttons: {
|
||||
"OK": function() {
|
||||
@ -392,18 +392,18 @@ class ActionsDatapolicies
|
||||
</script>';
|
||||
echo $dialog;
|
||||
if ($parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) {
|
||||
echo '<div class="inline-block divButAction"><a target="_blank" id="rpgpdbtn" class="butAction" href="' . $_SERVER["PHP_SELF"] . "?socid=" . $object->id . '&action=datapolicies_portabilite" title="' . $langs->trans('DATAPOLICIES_PORTABILITE_TITLE') . '">' . $langs->trans("DATAPOLICIES_PORTABILITE") . '</a></div>';
|
||||
echo '<div class="inline-block divButAction"><a target="_blank" id="rpgpdbtn" class="butAction" href="' . $_SERVER["PHP_SELF"] . "?socid=" . $object->id . '&action=datapolicy_portabilite" title="' . $langs->trans('DATAPOLICIES_PORTABILITE_TITLE') . '">' . $langs->trans("DATAPOLICIES_PORTABILITE") . '</a></div>';
|
||||
} elseif ($parameters['currentcontext'] == 'membercard') {
|
||||
echo '<div class="inline-block divButAction"><a target="_blank" id="rpgpdbtn" class="butAction" href="' . $_SERVER["PHP_SELF"] . "?rowid=" . $object->id . '&action=datapolicies_portabilite" title="' . $langs->trans('DATAPOLICIES_PORTABILITE_TITLE') . '">' . $langs->trans("DATAPOLICIES_PORTABILITE") . '</a></div>';
|
||||
echo '<div class="inline-block divButAction"><a target="_blank" id="rpgpdbtn" class="butAction" href="' . $_SERVER["PHP_SELF"] . "?rowid=" . $object->id . '&action=datapolicy_portabilite" title="' . $langs->trans('DATAPOLICIES_PORTABILITE_TITLE') . '">' . $langs->trans("DATAPOLICIES_PORTABILITE") . '</a></div>';
|
||||
} elseif ($parameters['currentcontext'] == 'contactcard') {
|
||||
echo '<div class="inline-block divButAction"><a target="_blank" id="rpgpdbtn" class="butAction" href="' . $_SERVER["PHP_SELF"] . "?id=" . $object->id . '&action=datapolicies_portabilite" title="' . $langs->trans('DATAPOLICIES_PORTABILITE_TITLE') . '">' . $langs->trans("DATAPOLICIES_PORTABILITE") . '</a></div>';
|
||||
echo '<div class="inline-block divButAction"><a target="_blank" id="rpgpdbtn" class="butAction" href="' . $_SERVER["PHP_SELF"] . "?id=" . $object->id . '&action=datapolicy_portabilite" title="' . $langs->trans('DATAPOLICIES_PORTABILITE_TITLE') . '">' . $langs->trans("DATAPOLICIES_PORTABILITE") . '</a></div>';
|
||||
}
|
||||
if (!empty($object->mail) && empty($object->array_options['options_datapolicies_send']) && $parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) {
|
||||
echo '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . "?socid=" . $object->id . '&action=send_datapolicies" title="' . $langs->trans('DATAPOLICIES_SEND') . '">' . $langs->trans("DATAPOLICIES_SEND") . '</a></div>';
|
||||
} elseif (!empty($object->mail) && empty($object->array_options['options_datapolicies_send']) && $parameters['currentcontext'] == 'membercard') {
|
||||
echo '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . "?rowid=" . $object->id . '&action=send_datapolicies" title="' . $langs->trans('DATAPOLICIES_SEND') . '">' . $langs->trans("DATAPOLICIES_SEND") . '</a></div>';
|
||||
} elseif (!empty($object->mail) && empty($object->array_options['options_datapolicies_send']) && $parameters['currentcontext'] == 'contactcard') {
|
||||
echo '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . "?id=" . $object->id . '&action=send_datapolicies" title="' . $langs->trans('DATAPOLICIES_SEND') . '">' . $langs->trans("DATAPOLICIES_SEND") . '</a></div>';
|
||||
if (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) {
|
||||
echo '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . "?socid=" . $object->id . '&action=send_datapolicy" title="' . $langs->trans('DATAPOLICIES_SEND') . '">' . $langs->trans("DATAPOLICIES_SEND") . '</a></div>';
|
||||
} elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'membercard') {
|
||||
echo '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . "?rowid=" . $object->id . '&action=send_datapolicy" title="' . $langs->trans('DATAPOLICIES_SEND') . '">' . $langs->trans("DATAPOLICIES_SEND") . '</a></div>';
|
||||
} elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'contactcard') {
|
||||
echo '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . "?id=" . $object->id . '&action=send_datapolicy" title="' . $langs->trans('DATAPOLICIES_SEND') . '">' . $langs->trans("DATAPOLICIES_SEND") . '</a></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -425,11 +425,11 @@ class ActionsDatapolicies
|
||||
if ($parameters['currentcontext'] == 'thirdpartycard') {
|
||||
if (GETPOST('action') == 'create' || GETPOST('action') == 'edit' || GETPOST('action') == '') {
|
||||
$jsscript .= '<script>';
|
||||
$jsscript .= "var elementToHide = 'tr.societe_extras_datapolicies_consentement, tr.societe_extras_datapolicies_opposition_traitement, tr.societe_extras_datapolicies_opposition_prospection';" . PHP_EOL;
|
||||
$jsscript .= "var elementToHide = 'tr.societe_extras_datapolicy_consentement, tr.societe_extras_datapolicy_opposition_traitement, tr.societe_extras_datapolicy_opposition_prospection';" . PHP_EOL;
|
||||
$jsscript .= "var forme_juridique = [" . PHP_EOL;
|
||||
$jsscript .= "11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005" . PHP_EOL;
|
||||
$jsscript .= "];" . PHP_EOL;
|
||||
$jsscript .= "function hideRgPD() { if ($('#typent_id').val() == 8 || forme_juridique.indexOf(parseInt($('#forme_juridique_code').val())) > -1) { console.log(elementToHide); $('tr.societe_extras_datapolicies_consentement, tr.societe_extras_datapolicies_opposition_traitement, tr.societe_extras_datapolicies_opposition_prospection').show(); } else { $('tr.societe_extras_datapolicies_consentement, tr.societe_extras_datapolicies_opposition_traitement, tr.societe_extras_datapolicies_opposition_prospection').hide(); }}" . PHP_EOL;
|
||||
$jsscript .= "function hideRgPD() { if ($('#typent_id').val() == 8 || forme_juridique.indexOf(parseInt($('#forme_juridique_code').val())) > -1) { console.log(elementToHide); $('tr.societe_extras_datapolicy_consentement, tr.societe_extras_datapolicy_opposition_traitement, tr.societe_extras_datapolicy_opposition_prospection').show(); } else { $('tr.societe_extras_datapolicy_consentement, tr.societe_extras_datapolicy_opposition_traitement, tr.societe_extras_datapolicy_opposition_prospection').hide(); }}" . PHP_EOL;
|
||||
$jsscript .= "hideRgPD();" . PHP_EOL;
|
||||
$jsscript .= "$('#forme_juridique_code, #typent_id').change(function(){ hideRgPD(); });" . PHP_EOL;
|
||||
$jsscript .= '</script>';
|
||||
@ -457,7 +457,7 @@ class ActionsDatapolicies
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
|
||||
$jsscript .= '<script>';
|
||||
$jsscript .= "var elementToHide = 'td.societe_extras_datapolicies_opposition_traitement, td.societe_extras_datapolicies_opposition_prospection, td.societe_extras_datapolicies_consentement';" . PHP_EOL;
|
||||
$jsscript .= "var elementToHide = 'td.societe_extras_datapolicy_opposition_traitement, td.societe_extras_datapolicy_opposition_prospection, td.societe_extras_datapolicy_consentement';" . PHP_EOL;
|
||||
$jsscript .= "$(elementToHide).parent('tr').hide();" . PHP_EOL;
|
||||
$jsscript .= '</script>';
|
||||
}
|
||||
@ -465,8 +465,8 @@ class ActionsDatapolicies
|
||||
} elseif ($parameters['currentcontext'] == 'contactcard') {
|
||||
if (GETPOST('action') == 'create' || GETPOST('action') == 'edit') {
|
||||
$jsscript .= '<script>';
|
||||
$jsscript .= "$('#options_datapolicies_opposition_traitement, #options_datapolicies_opposition_prospection, input[name=\"options_datapolicies_opposition_traitement\"], input[name=\"options_datapolicies_opposition_prospection\"]').change(function(){
|
||||
if($('#options_datapolicies_opposition_traitement').prop('checked') == true || $('input[name=options_datapolicies_opposition_traitement]').prop('checked') || $('#options_datapolicies_opposition_prospection').prop('checked') || $('input[name=options_datapolicies_opposition_prospection]').prop('checked')) {
|
||||
$jsscript .= "$('#options_datapolicy_opposition_traitement, #options_datapolicy_opposition_prospection, input[name=\"options_datapolicy_opposition_traitement\"], input[name=\"options_datapolicy_opposition_prospection\"]').change(function(){
|
||||
if($('#options_datapolicy_opposition_traitement').prop('checked') == true || $('input[name=options_datapolicy_opposition_traitement]').prop('checked') || $('#options_datapolicy_opposition_prospection').prop('checked') || $('input[name=options_datapolicy_opposition_prospection]').prop('checked')) {
|
||||
$('#no_email').val(1);
|
||||
}
|
||||
});";
|
||||
@ -16,9 +16,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file datapolicies/class/datapolicies.class.php
|
||||
* \ingroup datapolicies
|
||||
* \brief Class to manage feature of Data Policies module.
|
||||
* \file datapolicy/class/datapolicy.class.php
|
||||
* \ingroup datapolicy
|
||||
* \brief Class to manage feature of Data Policy module.
|
||||
*/
|
||||
include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
@ -26,9 +26,9 @@ include_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Class DataPolicies
|
||||
* Class DataPolicy
|
||||
*/
|
||||
Class DataPolicies extends Contact
|
||||
Class DataPolicy extends Contact
|
||||
{
|
||||
/**
|
||||
* getAllContactNotInformed
|
||||
@ -45,8 +45,8 @@ Class DataPolicies extends Contact
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "socpeople as c";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as s ON c.fk_soc = s.rowid";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "socpeople_extrafields as spe ON spe.fk_object = c.rowid";
|
||||
$sql .= " WHERE (c.statut=1 AND c.no_email=0 AND (spe.datapolicies_consentement=0 OR spe.datapolicies_consentement IS NULL) AND (spe.datapolicies_opposition_traitement=0 OR spe.datapolicies_opposition_traitement IS NULL) AND (spe.datapolicies_opposition_prospection=0 OR spe.datapolicies_opposition_prospection IS NULL))";
|
||||
$sql .= " AND spe.datapolicies_send IS NULL";
|
||||
$sql .= " WHERE (c.statut=1 AND c.no_email=0 AND (spe.datapolicy_consentement=0 OR spe.datapolicy_consentement IS NULL) AND (spe.datapolicy_opposition_traitement=0 OR spe.datapolicy_opposition_traitement IS NULL) AND (spe.datapolicy_opposition_prospection=0 OR spe.datapolicy_opposition_prospection IS NULL))";
|
||||
$sql .= " AND spe.datapolicy_send IS NULL";
|
||||
$sql .= " AND c.entity=" . $conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
@ -57,7 +57,7 @@ Class DataPolicies extends Contact
|
||||
$contact = new Contact($db);
|
||||
$contact->fetch($obj->rowid);
|
||||
|
||||
DataPolicies::sendMailDataPoliciesContact($contact);
|
||||
DataPolicy::sendMailDataPolicyContact($contact);
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
@ -80,8 +80,8 @@ Class DataPolicies extends Contact
|
||||
$sql = "SELECT s.rowid";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_extrafields as se ON se.fk_object = s.rowid";
|
||||
$sql .= " WHERE s.statut=0 AND (se.datapolicies_consentement=0 OR se.datapolicies_consentement IS NULL) AND (se.datapolicies_opposition_traitement=0 OR se.datapolicies_opposition_traitement IS NULL) AND (se.datapolicies_opposition_prospection=0 OR se.datapolicies_opposition_prospection IS NULL)";
|
||||
$sql .= " AND se.datapolicies_send IS NULL";
|
||||
$sql .= " WHERE s.statut=0 AND (se.datapolicy_consentement=0 OR se.datapolicy_consentement IS NULL) AND (se.datapolicy_opposition_traitement=0 OR se.datapolicy_opposition_traitement IS NULL) AND (se.datapolicy_opposition_prospection=0 OR se.datapolicy_opposition_prospection IS NULL)";
|
||||
$sql .= " AND se.datapolicy_send IS NULL";
|
||||
$sql .= " AND s.entity=" . $conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
@ -92,7 +92,7 @@ Class DataPolicies extends Contact
|
||||
$societe = new Societe($db);
|
||||
$societe->fetch($obj->rowid);
|
||||
|
||||
DataPolicies::sendMailDataPoliciesCompany($societe);
|
||||
DataPolicy::sendMailDataPolicyCompany($societe);
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
@ -115,8 +115,8 @@ Class DataPolicies extends Contact
|
||||
$sql = "SELECT a.rowid";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "adherent as a";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "adherent_extrafields as ae ON ae.fk_object = a.rowid";
|
||||
$sql .= " WHERE a.statut=0 AND (ae.datapolicies_consentement=0 OR ae.datapolicies_consentement IS NULL) AND (ae.datapolicies_opposition_traitement=0 OR ae.datapolicies_opposition_traitement IS NULL) AND (ae.datapolicies_opposition_prospection=0 OR ae.datapolicies_opposition_prospection IS NULL)";
|
||||
$sql .= " AND ae.datapolicies_send IS NULL";
|
||||
$sql .= " WHERE a.statut=0 AND (ae.datapolicy_consentement=0 OR ae.datapolicy_consentement IS NULL) AND (ae.datapolicy_opposition_traitement=0 OR ae.datapolicy_opposition_traitement IS NULL) AND (ae.datapolicy_opposition_prospection=0 OR ae.datapolicy_opposition_prospection IS NULL)";
|
||||
$sql .= " AND ae.datapolicy_send IS NULL";
|
||||
$sql .= " AND a.entity=" . $conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
@ -127,7 +127,7 @@ Class DataPolicies extends Contact
|
||||
$adherent = new Adherent($db);
|
||||
$adherent->fetch($obj->rowid);
|
||||
|
||||
DataPolicies::sendMailDataPoliciesAdherent($adherent);
|
||||
DataPolicy::sendMailDataPolicyAdherent($adherent);
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
@ -137,19 +137,19 @@ Class DataPolicies extends Contact
|
||||
}
|
||||
|
||||
/**
|
||||
* sendMailDataPoliciesContact
|
||||
* sendMailDataPolicyContact
|
||||
*
|
||||
* @param mixed $contact Contact
|
||||
* @return void
|
||||
*/
|
||||
function sendMailDataPoliciesContact($contact)
|
||||
function sendMailDataPolicyContact($contact)
|
||||
{
|
||||
global $langs, $conf, $db, $user;
|
||||
|
||||
$error = 0;
|
||||
|
||||
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
|
||||
$replyto = $from;
|
||||
|
||||
$sendto = $contact->email;
|
||||
$code= md5($contact->email);
|
||||
if (!empty($contact->default_lang)) {
|
||||
@ -171,8 +171,8 @@ Class DataPolicies extends Contact
|
||||
$deliveryreceipt = 0;
|
||||
|
||||
$substitutionarray = array(
|
||||
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicies/public/index.php?action=1&c='.$contact->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linka.'</a>',
|
||||
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicies/public/index.php?action=2&c='.$contact->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linkr.'</a>',
|
||||
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&c='.$contact->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linka.'</a>',
|
||||
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&c='.$contact->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linkr.'</a>',
|
||||
'__FIRSTNAME__' => $contact->firstname,
|
||||
'__NAME__' => $contact->lastname,
|
||||
'__CIVILITY__' => $contact->civility,
|
||||
@ -202,7 +202,7 @@ Class DataPolicies extends Contact
|
||||
if (!$error) {
|
||||
|
||||
$resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "<br>";
|
||||
$contact->array_options['options_datapolicies_send'] = date('Y-m-d', time());
|
||||
$contact->array_options['options_datapolicy_send'] = date('Y-m-d', time());
|
||||
$contact->update($contact->id);
|
||||
|
||||
} else {
|
||||
@ -213,19 +213,19 @@ Class DataPolicies extends Contact
|
||||
}
|
||||
|
||||
/**
|
||||
* sendMailDataPoliciesCompany
|
||||
* sendMailDataPolicyCompany
|
||||
*
|
||||
* @param Societe $societe Object societe
|
||||
* @return void
|
||||
*/
|
||||
function sendMailDataPoliciesCompany($societe)
|
||||
function sendMailDataPolicyCompany($societe)
|
||||
{
|
||||
global $langs, $conf, $db, $user;
|
||||
|
||||
$error = 0;
|
||||
|
||||
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
|
||||
$replyto = $from;
|
||||
|
||||
$sendto = $societe->email;
|
||||
|
||||
$code= md5($societe->email);
|
||||
@ -248,8 +248,8 @@ Class DataPolicies extends Contact
|
||||
$deliveryreceipt = 0;
|
||||
|
||||
$substitutionarray = array(
|
||||
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicies/public/index.php?action=1&s='.$societe->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linka.'</a>',
|
||||
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicies/public/index.php?action=2&s='.$societe->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linkr.'</a>',
|
||||
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&s='.$societe->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linka.'</a>',
|
||||
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&s='.$societe->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linkr.'</a>',
|
||||
);
|
||||
$subject = make_substitutions($subject, $substitutionarray);
|
||||
$message = make_substitutions($message, $substitutionarray);
|
||||
@ -275,7 +275,7 @@ Class DataPolicies extends Contact
|
||||
|
||||
if (!$error) {
|
||||
$resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "<br>";
|
||||
$societe->array_options['options_datapolicies_send'] = date('Y-m-d', time());
|
||||
$societe->array_options['options_datapolicy_send'] = date('Y-m-d', time());
|
||||
$societe->update($societe->id);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
@ -285,19 +285,19 @@ Class DataPolicies extends Contact
|
||||
}
|
||||
|
||||
/**
|
||||
* sendMailDataPoliciesAdherent
|
||||
* sendMailDataPolicyAdherent
|
||||
*
|
||||
* @param Adherent $adherent Member
|
||||
* @return void
|
||||
*/
|
||||
function sendMailDataPoliciesAdherent($adherent)
|
||||
function sendMailDataPolicyAdherent($adherent)
|
||||
{
|
||||
global $langs, $conf, $db, $user;
|
||||
|
||||
$error = 0;
|
||||
|
||||
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
|
||||
$replyto = $from;
|
||||
|
||||
$sendto = $adherent->email;
|
||||
|
||||
$code= md5($adherent->email);
|
||||
@ -318,8 +318,8 @@ Class DataPolicies extends Contact
|
||||
$deliveryreceipt = 0;
|
||||
|
||||
$substitutionarray = array(
|
||||
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicies/public/index.php?action=1&a='.$adherent->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linka.'</a>',
|
||||
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicies/public/index.php?action=2&a='.$adherent->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linkr.'</a>',
|
||||
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&a='.$adherent->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linka.'</a>',
|
||||
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&a='.$adherent->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linkr.'</a>',
|
||||
);
|
||||
$subject = make_substitutions($subject, $substitutionarray);
|
||||
$message = make_substitutions($message, $substitutionarray);
|
||||
@ -346,7 +346,7 @@ Class DataPolicies extends Contact
|
||||
|
||||
if (!$error) {
|
||||
$resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "<br>";
|
||||
$adherent->array_options['options_datapolicies_send'] = date('Y-m-d', time());
|
||||
$adherent->array_options['options_datapolicy_send'] = date('Y-m-d', time());
|
||||
$adherent->update($user);
|
||||
|
||||
} else {
|
||||
@ -17,15 +17,15 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file datapolicies/class/datapoliciescron.class.php
|
||||
* \ingroup datapolicies
|
||||
* \file datapolicy/class/datapolicycron.class.php
|
||||
* \ingroup datapolicy
|
||||
* \brief Example hook overload.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class DataPoliciesCron
|
||||
* Class DataPolicyCron
|
||||
*/
|
||||
class DataPoliciesCron
|
||||
class DataPolicyCron
|
||||
{
|
||||
/**
|
||||
* Function exec
|
||||
@ -36,7 +36,7 @@ class DataPoliciesCron
|
||||
{
|
||||
global $conf, $db, $langs, $user;
|
||||
|
||||
$langs->load('datapolicies@datapolicies');
|
||||
$langs->load('datapolicy@datapolicy');
|
||||
|
||||
// FIXME Removed hardcoded values of id
|
||||
$arrayofparameters=array(
|
||||
@ -510,11 +510,11 @@ class DataPoliciesCron
|
||||
{
|
||||
global $conf, $db, $langs, $user;
|
||||
|
||||
$langs->load('datapolicies@datapolicies');
|
||||
$langs->load('datapolicy@datapolicy');
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/datapolicies/class/datapolicies.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/datapolicy/class/datapolicy.class.php';
|
||||
|
||||
$contacts = new DataPolicies($db);
|
||||
$contacts = new DataPolicy($db);
|
||||
$contacts->getAllContactNotInformed();
|
||||
$contacts->getAllCompaniesNotInformed();
|
||||
$contacts->getAllAdherentsNotInformed();
|
||||
|
Before Width: | Height: | Size: 683 B After Width: | Height: | Size: 683 B |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 764 B After Width: | Height: | Size: 764 B |
92
htdocs/datapolicy/langs/en_US/datapolicy.lang
Normal file
@ -0,0 +1,92 @@
|
||||
# Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
#
|
||||
# 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
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (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
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Module label 'ModuledatapolicyName'
|
||||
Module4100Name = Data Privacy Policy
|
||||
# Module description 'ModuledatapolicyDesc'
|
||||
Module4100Desc = Module to manage Data Privacy (Conformity with the GDPR)
|
||||
|
||||
#
|
||||
# Page d'administration
|
||||
#
|
||||
datapolicySetup = Module Data Privacy Policy Setup
|
||||
Deletion = Deletion of data
|
||||
datapolicySetupPage = Depending of laws of your countries (Example <a href="http://www.privacy-regulation.eu/en/5.htm" target="_blank">Article 5</a> of the GDPR), personal data must be kept for a period not exceeding that necessary for the purposes for which they were collected, except for archival purposes.<br>The deletion will be done automatically after a certain duration without event (the duration which you will have indicated below).
|
||||
NB_MONTHS = %s months
|
||||
ONE_YEAR = 1 year
|
||||
NB_YEARS = %s years
|
||||
DATAPOLICY_TIERS_CLIENT = Customer
|
||||
DATAPOLICY_TIERS_PROSPECT = Prospect
|
||||
DATAPOLICY_TIERS_PROSPECT_CLIENT = Prospect/Customer
|
||||
DATAPOLICY_TIERS_NIPROSPECT_NICLIENT = Nor prospect/Nor customer
|
||||
DATAPOLICY_TIERS_FOURNISSEUR = Supplier
|
||||
DATAPOLICY_CONTACT_CLIENT = Customer
|
||||
DATAPOLICY_CONTACT_PROSPECT = Prospect
|
||||
DATAPOLICY_CONTACT_PROSPECT_CLIENT = Prospect/Customer
|
||||
DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT = Nor prospect/Nor customer
|
||||
DATAPOLICY_CONTACT_FOURNISSEUR = Supplier
|
||||
DATAPOLICY_ADHERENT = Member
|
||||
DATAPOLICY_Tooltip_SETUP = Type of contact - Indicate your choices for each type.
|
||||
DATAPOLICYMail=Emails Setup
|
||||
DATAPOLICYSUBJECTMAIL=Subject of email
|
||||
DATAPOLICYCONTENTMAIL=Content of the email
|
||||
DATAPOLICYSUBSITUTION=You can use the following variables in your email (LINKACCEPT allows to create a link recording the agreement of the person, LINKREFUSED makes it possible to record the refusal of the person):
|
||||
DATAPOLICYACCEPT=Message after agreement
|
||||
DATAPOLICYREFUSE=Message after desagreement
|
||||
SendAgreementText=You can send a GDPR email to all your relevant contacts (who have not yet received an email and for which you have not registered anything about their GDPR agreement). To do this, use the following button.
|
||||
SendAgreement=Send emails
|
||||
AllAgreementSend = All emails have been sent
|
||||
TXTLINKDATAPOLICYACCEPT= Text for the link "agreement"
|
||||
TXTLINKDATAPOLICYREFUSE= Text for the link "desagreement"
|
||||
|
||||
|
||||
#
|
||||
# Extrafield
|
||||
#
|
||||
DATAPOLICY_BLOCKCHECKBOX = GDPR : Processing of personal data
|
||||
DATAPOLICY_consentement = Consent obtained for the processing of personal data
|
||||
DATAPOLICY_opposition_traitement = Opposes the processing of his personal data
|
||||
DATAPOLICY_opposition_prospection = Opposes the processing of his personal data for the purposes of prospecting
|
||||
|
||||
#
|
||||
# Popup
|
||||
#
|
||||
DATAPOLICY_POPUP_ANONYME_TITLE = Anonymize a thirdparty
|
||||
DATAPOLICY_POPUP_ANONYME_TEXTE = You can not delete this contact from Dolibarr because there are related items. In accordance with the GDPR, you will make all this data anonymous to respect your obligations. Would you like to continue ?
|
||||
|
||||
#
|
||||
# Bouton portabilité
|
||||
#
|
||||
DATAPOLICY_PORTABILITE = Portability GDPR
|
||||
DATAPOLICY_PORTABILITE_TITLE = Export of personal data
|
||||
DATAPOLICY_PORTABILITE_CONFIRMATION = You want to export the personal data of this contact. Are you sure ?
|
||||
|
||||
#
|
||||
# Note ajoutés lors d'une anonymisation
|
||||
#
|
||||
ANONYMISER_AT = Anonymised the %s
|
||||
|
||||
#V2
|
||||
DATAPOLICYReturn=GDPR Validation
|
||||
DATAPOLICY_date = Date of agreement/desagreement GDPR
|
||||
DATAPOLICY_send = Date sending agreement email
|
||||
DATAPOLICYReturn = GDPR Return
|
||||
DATAPOLICY_SEND = Send GDPR email
|
||||
MailSent = Email has been sent
|
||||
|
||||
#ERROR
|
||||
ErrorSubjectIsRequired= Error : The subject of email is required. Indicate it in the module setup
|
||||
=Due to a technical problem, we were unable to register your choice. We apologize for that. Contact us to send us your choice.
|
||||
NUMBER_MONTH_BEFORE_DELETION = Number of month before deletion
|
||||
97
htdocs/datapolicy/langs/fr_FR/datapolicy.lang
Normal file
@ -0,0 +1,97 @@
|
||||
# Copyright (C) 2018 INOVEA CONSEil info@inovea-conseil.com
|
||||
#
|
||||
# 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
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (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
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#
|
||||
# Générique
|
||||
#
|
||||
|
||||
# Module label 'ModuledatapolicyName'
|
||||
Module4100Name = Protection des Données
|
||||
# Module description 'ModuledatapolicyDesc'
|
||||
Module4100Desc = Module de gestion de la protection des données (RGPD)
|
||||
|
||||
#
|
||||
# Page d'administration
|
||||
#
|
||||
datapolicySetup = Configuration du module Protection des données
|
||||
Settings_DATAPOLICY = Paramétrage du module Protection des données
|
||||
datapolicySetupPage = Selon la loi de votre pays (Exemple <a href="http://www.privacy-regulation.eu/fr/5.htm" target="_blank">l’article 5</a> du RGPD), les données à caractère personnel doivent être conservées pendant une durée n’excédant pas celle nécessaire au regard des finalités pour lesquelles elles ont été traitées, à l’exception de fins archivistiques. La suppression se fera automatiquement après une certaine durée sans évènement (la durée que vous aurez indiquée ci-dessous).
|
||||
NB_MONTHS = %s mois
|
||||
ONE_YEAR = 1 an
|
||||
NB_YEARS = %s ans
|
||||
DATAPOLICY_TIERS_CLIENT = Client
|
||||
DATAPOLICY_TIERS_PROSPECT = Prospect
|
||||
DATAPOLICY_TIERS_PROSPECT_CLIENT = Prospect/Client
|
||||
DATAPOLICY_TIERS_NIPROSPECT_NICLIENT = Ni prospect / Ni client
|
||||
DATAPOLICY_TIERS_FOURNISSEUR = Fournisseur
|
||||
DATAPOLICY_CONTACT_CLIENT = Client
|
||||
DATAPOLICY_CONTACT_PROSPECT = Prospect
|
||||
DATAPOLICY_CONTACT_PROSPECT_CLIENT = Prospect/Client
|
||||
DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT = Ni prospect / Ni client
|
||||
DATAPOLICY_CONTACT_FOURNISSEUR = Fournisseur
|
||||
DATAPOLICY_ADHERENT = Adhérent
|
||||
DATAPOLICY_Tooltip_SETUP = Type du contact - Indiquez vos choix pour chaque type.
|
||||
DATAPOLICYMail=Paramétrage des emails
|
||||
DATAPOLICYSUBJECTMAIL=Objet du mail
|
||||
DATAPOLICYCONTENTMAIL=Contenu du mail
|
||||
DATAPOLICYSUBSITUTION=Vous pouvez utiliser les variables suivantes dans votre email (LINKACCEPT permet de créer un lien enregistrant l'acceptation de la personne, LINKREFUSED permet d'enregistrer le refus de la personne) :
|
||||
DATAPOLICYACCEPT=Message suite acceptation
|
||||
DATAPOLICYREFUSE=Message suite opposition
|
||||
SendAgreementText=Vous pouvez envoyer un email DATAPOLICY à tous vos contacts concernés (qui n'ont pas encore reçus de mail et pour lesquels vous n'avez rien enregistré concernant leur accord/désaccord DATAPOLICY). Pour cela, utilisez le bouton suivant.
|
||||
SendAgreement=Envoyer les emails
|
||||
AllAgreementSend = Tous les e-mails de consentement ont été envoyés
|
||||
TXTLINKDATAPOLICYACCEPT= Texte du lien d'acceptation
|
||||
TXTLINKDATAPOLICYREFUSE= Texte du lien d'opposition
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Extrafield
|
||||
#
|
||||
DATAPOLICY_BLOCKCHECKBOX = DATAPOLICY : Traitement des données à caractère personnel
|
||||
DATAPOLICY_consentement = Consentement recueilli pour le traitement des données à caractère personnel le concernant
|
||||
DATAPOLICY_opposition_traitement = S’oppose au traitement de ses données à caractère personnel
|
||||
DATAPOLICY_opposition_prospection = S’oppose au traitement de ses données à caractère personnel à des fins de prospection
|
||||
|
||||
#
|
||||
# Popup
|
||||
#
|
||||
DATAPOLICY_POPUP_ANONYME_TITLE = Anonymiser un tiers
|
||||
DATAPOLICY_POPUP_ANONYME_TEXTE = Vous ne pouvez pas supprimer ce contact de Dolibarr car des éléments y sont liés. Conformément au DATAPOLICY, vous allez rendre toutes ces données anonymes afin de respecter vos obligations. Souhaitez-vous continuer ?
|
||||
|
||||
#
|
||||
# Bouton portabilité
|
||||
#
|
||||
DATAPOLICY_PORTABILITE = Portabilité DATAPOLICY
|
||||
DATAPOLICY_PORTABILITE_TITLE = Export des données à caractère personnel
|
||||
DATAPOLICY_PORTABILITE_CONFIRMATION = Vous souhaitez exporter les données à caractère personnel de ce contact. Etes-vous sûr ?
|
||||
|
||||
#
|
||||
# Note ajoutés lors d'une anonymisation
|
||||
#
|
||||
ANONYMISER_AT = Anonymisé le %s
|
||||
|
||||
#V2
|
||||
DATAPOLICYReturn=Validation DATAPOLICY
|
||||
DATAPOLICY_date=Date d'accord/opposition au traitement
|
||||
DATAPOLICY_send=Date envoi consentement
|
||||
DATAPOLICYReturn=Retour DATAPOLICY
|
||||
DATAPOLICY_SEND=Envoyer l'email de consentement
|
||||
MailSent=L'email a bien été envoyé
|
||||
|
||||
#ERROR
|
||||
ErrorSubjectIsRequired=Erreur : vous n'avez pas indiqué l'objet de l'email dans la configuration
|
||||
=Suite à un problème technique, nous n'avons pas pu enregistrer votre choix. Nous nous en excusons. Contactez-nous pour nous transmettre votre choix.
|
||||
NUMBER_MONTH_BEFORE_DELETION = Nombre de mois avant suppression des données
|
||||
78
htdocs/datapolicy/langs/it_IT/datapolicy.lang
Normal file
@ -0,0 +1,78 @@
|
||||
# Copyright (C) 2018 INOVEA CONSEIl info@inovea-conseil.com - Thanks to Claudio Aschieri
|
||||
#
|
||||
# # Module label 'ModuledatapolicyName'
|
||||
Module4100Name = Data Policy
|
||||
# Module description 'ModuledatapolicyDesc'
|
||||
Module4100Desc = Conformità con GDPR
|
||||
|
||||
#
|
||||
# Page d'administration
|
||||
#
|
||||
datapolicySetup = Module Setup
|
||||
Settings_DATAPOLICY = Configurazione modulo GDPR
|
||||
datapolicySetupPage = In accordo con <a href="http://www.privacy-regulation.eu/it/5.htm" target="_blank">l'art 5 del GDPR </a> i dati personali devono essere conservati per un periodo di tempo che .... ed eliminati se non sono più utili agli scopi per cui sono stati processati.
|
||||
NB_MONTHS = %s mesi
|
||||
ONE_YEAR = 1 anno
|
||||
NB_YEARS = %s anni
|
||||
DATAPOLICY_TIERS_CLIENT = Cliente
|
||||
DATAPOLICY_TIERS_PROSPECT = Fornitore
|
||||
DATAPOLICY_TIERS_PROSPECT_CLIENT = Potenziale Cliente / Cliente
|
||||
DATAPOLICY_TIERS_NIPROSPECT_NICLIENT = Nè potenziale cliente / Nè cliente
|
||||
DATAPOLICY_TIERS_FOURNISSEUR = Fornitore
|
||||
DATAPOLICY_CONTACT_CLIENT = Cliente
|
||||
DATAPOLICY_CONTACT_PROSPECT = Potenziale cliente
|
||||
DATAPOLICY_CONTACT_PROSPECT_CLIENT = Potenziale Cliente / Cliente
|
||||
DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT = Nè potenziale cliente / Nè cliente
|
||||
DATAPOLICY_CONTACT_FOURNISSEUR = Fornitore
|
||||
DATAPOLICY_ADHERENT = Membri
|
||||
DATAPOLICY_Tooltip_SETUP = Tipo di contatto - Indica la scelta per ogni tipologia
|
||||
DATAPOLICYMail=Configurazione Email
|
||||
DATAPOLICYSUBJECTMAIL=Subject dell'e-mail
|
||||
DATAPOLICYCONTENTMAIL=Contenuto dell'e-mail
|
||||
DATAPOLICYSUBSITUTION=Puoi utilizzare le seguenti variabili nella tua email (LINKACCEPT consente di creare un link per registrare l'accettazione della persona, LINKREFUSED consente di registrare il rifiuto della persona):
|
||||
DATAPOLICYACCEPT= Messaggio dopo il consenso
|
||||
DATAPOLICYREFUSE=Messaggio dopo il rifiuto
|
||||
SendAgreementText=Puoi inviare un'email GDPR a tutti i tuoi contatti rilevanti (che non hanno ancora ricevuto un'e-mail e per i quali non hai registrato nulla sul loro accordo GDPR). Per fare ciò, utilizzare il seguente pulsante.
|
||||
SendAgreement=Invia emails
|
||||
AllAgreementSend = Tutte le email sono state inviate
|
||||
TXTLINKDATAPOLICYACCEPT= Testo per il link "Consenso"
|
||||
TXTLINKDATAPOLICYREFUSE= Testo per il link "Consenso negato"
|
||||
|
||||
#
|
||||
# Extrafield
|
||||
#
|
||||
DATAPOLICY_BLOCKCHECKBOX = GDPR : Trattamento dei dati personali
|
||||
DATAPOLICY_consentement = Consenso ottenuto al Trattamento dei dati personali
|
||||
DATAPOLICY_opposition_traitement = Consenso negato al trattamento dei dati personali
|
||||
DATAPOLICY_opposition_prospection = Consenso negato al trattamento dei dati personali a fini commerciali
|
||||
|
||||
#
|
||||
# Popup
|
||||
#
|
||||
DATAPOLICY_POPUP_ANONYME_TITLE = Anonimizza un soggetto terzo
|
||||
DATAPOLICY_POPUP_ANONYME_TEXTE = Impossibile eliminare questo contatto da Dolibarr perchè vi sono elementi collegati. In conformità con il GDPR, renderai tutti questi dati anonimi per rispettare i tuoi obblighi. Vuoi continuare?
|
||||
|
||||
|
||||
#
|
||||
# Bouton portabilité
|
||||
#
|
||||
DATAPOLICY_PORTABILITE = Portabilità GDPR
|
||||
DATAPOLICY_PORTABILITE_TITLE = Esporta i dati personali
|
||||
DATAPOLICY_PORTABILITE_CONFIRMATION = Vuoi davvero esportare i dati personali di questo contatto?
|
||||
|
||||
#
|
||||
# Note ajoutée lors d'une anonymisation
|
||||
#
|
||||
ANONYMISER_AT = Anonimizzato il %s
|
||||
|
||||
#V2
|
||||
DATAPOLICYReturn=GDPR Validazione
|
||||
DATAPOLICY_date = Data di accordo / disaccordo GDPR
|
||||
DATAPOLICY_send = Data di invio del consenso (e-mail)
|
||||
DATAPOLICYReturn = GDPR ritorno
|
||||
DATAPOLICY_SEND = Inviare GDPR e-mail
|
||||
MailSent=L'email è stata inviata
|
||||
|
||||
#ERROR
|
||||
ErrorSubjectIsRequired= Errore: L'oggetto della mail è obbligatorio. Inserisci l'oggetto nella configurazione del modulo.
|
||||
=A causa di un problema tecnico, non siamo stati in grado di registrare la tua scelta. Ci scusiamo per questo. Contattaci per inviarci la tua scelta.
|
||||
@ -16,9 +16,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file datapolicies/lib/datapolicies.lib.php
|
||||
* \ingroup datapolicies
|
||||
* \brief Library files with common functions for datapolicies
|
||||
* \file datapolicy/lib/datapolicy.lib.php
|
||||
* \ingroup datapolicy
|
||||
* \brief Library files with common functions for datapolicy
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -26,29 +26,29 @@
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function datapoliciesAdminPrepareHead()
|
||||
function datapolicyAdminPrepareHead()
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
$langs->load("datapolicies@datapolicies");
|
||||
$langs->load("datapolicy@datapolicy");
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/datapolicies/admin/setup.php", 1);
|
||||
$head[$h][1] = $langs->trans("Settings_DATAPOLICIES");
|
||||
$head[$h][0] = dol_buildpath("/datapolicy/admin/setup.php", 1);
|
||||
$head[$h][1] = $langs->trans("Deletion");
|
||||
$head[$h][2] = 'settings';
|
||||
$h++;
|
||||
|
||||
if (! empty($conf->global->DATAPOLICIES_ENABLE_EMAILS))
|
||||
{
|
||||
$head[$h][0] = dol_buildpath("/datapolicies/admin/setupmail.php", 1);
|
||||
$head[$h][0] = dol_buildpath("/datapolicy/admin/setupmail.php", 1);
|
||||
$head[$h][1] = $langs->trans("DATAPOLICIESMail");
|
||||
$head[$h][2] = 'settings';
|
||||
$h++;
|
||||
}
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'datapolicies');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'datapolicy');
|
||||
|
||||
return $head;
|
||||
}
|
||||
@ -16,26 +16,26 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file datapolicies/mailing.php
|
||||
* \ingroup datapolicies
|
||||
* \brief datapolicies mailing page.
|
||||
* \file datapolicy/mailing.php
|
||||
* \ingroup datapolicy
|
||||
* \brief datapolicy mailing page.
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
dol_include_once('/contact/class/contact.class.php');
|
||||
dol_include_once('/datapolicies/class/datapolicies.class.php');
|
||||
dol_include_once('/datapolicy/class/datapolicy.class.php');
|
||||
|
||||
$idcontact = GETPOST('idc');
|
||||
|
||||
if(!empty($idcontact)){
|
||||
$contact = new Contact($db);
|
||||
$contact->fetch($idcontact);
|
||||
DataPolicies::sendMailDataPoliciesContact($contact);
|
||||
DataPolicy::sendMailDataPolicyContact($contact);
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
$contacts = new DataPolicies($db);
|
||||
$contacts = new DataPolicy($db);
|
||||
$contacts->getAllContactNotInformed();
|
||||
$contacts->getAllCompaniesNotInformed();
|
||||
$contacts->getAllAdherentsNotInformed();
|
||||
@ -17,9 +17,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file datapolicies/admin/setup.php
|
||||
* \ingroup datapolicies
|
||||
* \brief datapolicies setup page.
|
||||
* \file datapolicy/admin/setup.php
|
||||
* \ingroup datapolicy
|
||||
* \brief datapolicy setup page.
|
||||
*/
|
||||
|
||||
if (!defined('NOLOGIN'))
|
||||
@ -34,7 +34,7 @@ dol_include_once('/contact/class/contact.class.php');
|
||||
dol_include_once('/societe/class/societe.class.php');
|
||||
dol_include_once('/adherents/class/adherent.class.php');
|
||||
dol_include_once('/user/class/user.class.php');
|
||||
dol_include_once('/datapolicies/class/datapolicies.class.php');
|
||||
dol_include_once('/datapolicy/class/datapolicy.class.php');
|
||||
|
||||
$idc = GETPOST('c', 'int');
|
||||
$ids = GETPOST('s', 'int');
|
||||
@ -45,7 +45,7 @@ $code = GETPOST('key', 'alpha');
|
||||
|
||||
$acc = "DATAPOLICIESACCEPT_" . $lang;
|
||||
$ref = "DATAPOLICIESREFUSE_" . $lang;
|
||||
$langs->load('datapolicies@datapolicies',0,0,$lang);
|
||||
$langs->load('datapolicy@datapolicy',0,0,$lang);
|
||||
|
||||
if (empty($action) || (empty($idc) && empty($ids) && empty($ida))) {
|
||||
return 0;
|
||||
@ -56,18 +56,18 @@ if (empty($action) || (empty($idc) && empty($ids) && empty($ida))) {
|
||||
if ($check != $code) {
|
||||
$return = $langs->trans('ErrorEmailDATAPOLICIES');
|
||||
} elseif ($action == 1) {
|
||||
$contact->array_options['options_datapolicies_consentement'] = 1;
|
||||
$contact->array_options['options_datapolicies_opposition_traitement'] = 0;
|
||||
$contact->array_options['options_datapolicies_opposition_prospection'] = 0;
|
||||
$contact->array_options['options_datapolicies_date'] = date('Y-m-d', time());
|
||||
$contact->array_options['options_datapolicy_consentement'] = 1;
|
||||
$contact->array_options['options_datapolicy_opposition_traitement'] = 0;
|
||||
$contact->array_options['options_datapolicy_opposition_prospection'] = 0;
|
||||
$contact->array_options['options_datapolicy_date'] = date('Y-m-d', time());
|
||||
|
||||
$return = $conf->global->$acc;
|
||||
} elseif ($action == 2) {
|
||||
$contact->no_email = 1;
|
||||
$contact->array_options['options_datapolicies_consentement'] = 0;
|
||||
$contact->array_options['options_datapolicies_opposition_traitement'] = 1;
|
||||
$contact->array_options['options_datapolicies_opposition_prospection'] = 1;
|
||||
$contact->array_options['options_datapolicies_date'] = date('Y-m-d', time());
|
||||
$contact->array_options['options_datapolicy_consentement'] = 0;
|
||||
$contact->array_options['options_datapolicy_opposition_traitement'] = 1;
|
||||
$contact->array_options['options_datapolicy_opposition_prospection'] = 1;
|
||||
$contact->array_options['options_datapolicy_date'] = date('Y-m-d', time());
|
||||
|
||||
$return = $conf->global->$ref;
|
||||
}
|
||||
@ -79,16 +79,16 @@ if (empty($action) || (empty($idc) && empty($ids) && empty($ida))) {
|
||||
if ($check != $code) {
|
||||
$return = $langs->trans('ErrorEmailDATAPOLICIES');
|
||||
} elseif ($action == 1) {
|
||||
$societe->array_options['options_datapolicies_consentement'] = 1;
|
||||
$societe->array_options['options_datapolicies_opposition_traitement'] = 0;
|
||||
$societe->array_options['options_datapolicies_opposition_prospection'] = 0;
|
||||
$societe->array_options['options_datapolicies_date'] = date('Y-m-d', time());
|
||||
$societe->array_options['options_datapolicy_consentement'] = 1;
|
||||
$societe->array_options['options_datapolicy_opposition_traitement'] = 0;
|
||||
$societe->array_options['options_datapolicy_opposition_prospection'] = 0;
|
||||
$societe->array_options['options_datapolicy_date'] = date('Y-m-d', time());
|
||||
$return = $conf->global->$acc;
|
||||
} elseif ($action == 2) {
|
||||
$societe->array_options['options_datapolicies_consentement'] = 0;
|
||||
$societe->array_options['options_datapolicies_opposition_traitement'] = 1;
|
||||
$societe->array_options['options_datapolicies_opposition_prospection'] = 1;
|
||||
$societe->array_options['options_datapolicies_date'] = date('Y-m-d', time());
|
||||
$societe->array_options['options_datapolicy_consentement'] = 0;
|
||||
$societe->array_options['options_datapolicy_opposition_traitement'] = 1;
|
||||
$societe->array_options['options_datapolicy_opposition_prospection'] = 1;
|
||||
$societe->array_options['options_datapolicy_date'] = date('Y-m-d', time());
|
||||
|
||||
$return = $conf->global->$ref;
|
||||
}
|
||||
@ -100,16 +100,16 @@ if (empty($action) || (empty($idc) && empty($ids) && empty($ida))) {
|
||||
if ($check != $code) {
|
||||
$return = $langs->trans('ErrorEmailDATAPOLICIES');
|
||||
} elseif ($action == 1) {
|
||||
$adherent->array_options['options_datapolicies_consentement'] = 1;
|
||||
$adherent->array_options['options_datapolicies_opposition_traitement'] = 0;
|
||||
$adherent->array_options['options_datapolicies_opposition_prospection'] = 0;
|
||||
//$adherent->array_options['options_datapolicies_date'] = date('Y-m-d', time());
|
||||
$adherent->array_options['options_datapolicy_consentement'] = 1;
|
||||
$adherent->array_options['options_datapolicy_opposition_traitement'] = 0;
|
||||
$adherent->array_options['options_datapolicy_opposition_prospection'] = 0;
|
||||
//$adherent->array_options['options_datapolicy_date'] = date('Y-m-d', time());
|
||||
$return = $conf->global->$acc;
|
||||
} elseif ($action == 2) {
|
||||
$adherent->array_options['options_datapolicies_consentement'] = 0;
|
||||
$adherent->array_options['options_datapolicies_opposition_traitement'] = 1;
|
||||
$adherent->array_options['options_datapolicies_opposition_prospection'] = 1;
|
||||
//$adherent->array_options['options_datapolicies_date'] = date('Y-m-d', time());
|
||||
$adherent->array_options['options_datapolicy_consentement'] = 0;
|
||||
$adherent->array_options['options_datapolicy_opposition_traitement'] = 1;
|
||||
$adherent->array_options['options_datapolicy_opposition_prospection'] = 1;
|
||||
//$adherent->array_options['options_datapolicy_date'] = date('Y-m-d', time());
|
||||
|
||||
$return = $conf->global->$ref;
|
||||
}
|
||||
@ -229,7 +229,7 @@ DoNotStoreClearPassword=Do no store clear passwords in database but store only e
|
||||
MainDbPasswordFileConfEncrypted=Database password encrypted in conf.php (Activated recommended)
|
||||
InstrucToEncodePass=To have password encoded into the <b>conf.php</b> file, replace the line <br><b>$dolibarr_main_db_pass="...";</b><br>by<br><b>$dolibarr_main_db_pass="crypted:%s";</b>
|
||||
InstrucToClearPass=To have password decoded (clear) into the <b>conf.php</b> file, replace the line <br><b>$dolibarr_main_db_pass="crypted:...";</b><br>by<br><b>$dolibarr_main_db_pass="%s";</b>
|
||||
ProtectAndEncryptPdfFiles=Protection of generated PDF files NOT recommended, breaks mass PDF generation)
|
||||
ProtectAndEncryptPdfFiles=Protection of generated PDF files NOT recommended (breaks mass PDF generation)
|
||||
ProtectAndEncryptPdfFilesDesc=Protection of a PDF document keeps it available to read and print with any PDF browser. However, editing and copying is not possible anymore. Note that using this feature makes building of a global merged PDFs not working.
|
||||
Feature=Feature
|
||||
DolibarrLicense=License
|
||||
@ -1225,6 +1225,7 @@ WebCalUrlForVCalExport=An export link to <b>%s</b> format is available at follow
|
||||
BillsSetup=Invoices module setup
|
||||
BillsNumberingModule=Invoices and credit notes numbering model
|
||||
BillsPDFModules=Invoice documents models
|
||||
BillsPDFModulesAccordindToInvoiceType=Invoice documents models according to invoice type
|
||||
PaymentsPDFModules=Payment documents models
|
||||
CreditNote=Credit note
|
||||
CreditNotes=Credit notes
|
||||
@ -1802,7 +1803,7 @@ EnterCalculationRuleIfPreviousFieldIsYes=Enter calculation rule if previous fiel
|
||||
SeveralLangugeVariatFound=Several language variants found
|
||||
COMPANY_AQUARIUM_REMOVE_SPECIAL=Remove special characters
|
||||
COMPANY_AQUARIUM_CLEAN_REGEX=Regex filter to clean value (COMPANY_AQUARIUM_CLEAN_REGEX)
|
||||
GDPRContact=Privacy Policies or GDPR contact
|
||||
GDPRContact=Data Protection Officer (DPO, Data Privacy or GDPR contact)
|
||||
GDPRContactDesc=If you store data about European companies/citizen, you can store the contact who is responsible for the General Data Protection Regulation here
|
||||
HelpOnTooltip=Help text to show on tooltip
|
||||
HelpOnTooltipDesc=Put text or a translation key here for the text to show on a tooltip when this field appears in a form
|
||||
|
||||
@ -91,3 +91,5 @@ ExternalURLMustStartWithHttp=External URL must start with http:// or https://
|
||||
ZipOfWebsitePackageToImport=Zip file of website package
|
||||
ShowSubcontainers=Show included containers
|
||||
InternalURLOfPage=Internal URL of page
|
||||
ThisPageIsTranslationOf=This page/container is translation of
|
||||
ThisPageHasTranslationPages=This page/container has translation
|
||||
@ -299,7 +299,7 @@ class Product extends CommonObject
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see ref_supplier
|
||||
* @see $ref_supplier
|
||||
*/
|
||||
public $ref_fourn;
|
||||
public $ref_supplier;
|
||||
@ -3282,7 +3282,7 @@ class Product extends CommonObject
|
||||
*
|
||||
* @param int $fromId Id product source
|
||||
* @param int $toId Id product target
|
||||
* @return nt < 0 if KO, > 0 if OK
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
*/
|
||||
function clone_price($fromId, $toId)
|
||||
{
|
||||
@ -4005,7 +4005,7 @@ class Product extends CommonObject
|
||||
* 'warehouseclosed' = Load stock from closed warehouses only,
|
||||
* 'warehouseinternal' = Load stock from warehouses for internal correction/transfer only
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
* @see load_virtual_stock, getBatchInfo
|
||||
* @see load_virtual_stock(), loadBatchInfo()
|
||||
*/
|
||||
function load_stock($option='')
|
||||
{
|
||||
@ -4074,68 +4074,80 @@ class Product extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load value ->stock_theorique of a product. Property this->id must be defined.
|
||||
* This function need a lot of load. If you use it on list, use a cache to execute it one for each product id.
|
||||
*
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
* @see load_stock, getBatchInfo
|
||||
* @see load_stock(), loadBatchInfo()
|
||||
*/
|
||||
function load_virtual_stock()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
function load_virtual_stock()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $hookmanager, $action;
|
||||
|
||||
$stock_commande_client=0;
|
||||
$stock_commande_fournisseur=0;
|
||||
$stock_sending_client=0;
|
||||
$stock_reception_fournisseur=0;
|
||||
$stock_commande_client=0;
|
||||
$stock_commande_fournisseur=0;
|
||||
$stock_sending_client=0;
|
||||
$stock_reception_fournisseur=0;
|
||||
|
||||
if (! empty($conf->commande->enabled))
|
||||
{
|
||||
$result=$this->load_stats_commande(0,'1,2', 1);
|
||||
if ($result < 0) dol_print_error($this->db,$this->error);
|
||||
$stock_commande_client=$this->stats_commande['qty'];
|
||||
}
|
||||
if (! empty($conf->expedition->enabled))
|
||||
{
|
||||
$result=$this->load_stats_sending(0,'1,2', 1);
|
||||
if ($result < 0) dol_print_error($this->db,$this->error);
|
||||
$stock_sending_client=$this->stats_expedition['qty'];
|
||||
}
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
$result=$this->load_stats_commande_fournisseur(0,'1,2,3,4', 1);
|
||||
if ($result < 0) dol_print_error($this->db,$this->error);
|
||||
$stock_commande_fournisseur=$this->stats_commande_fournisseur['qty'];
|
||||
if (! empty($conf->commande->enabled))
|
||||
{
|
||||
$result=$this->load_stats_commande(0,'1,2', 1);
|
||||
if ($result < 0) dol_print_error($this->db,$this->error);
|
||||
$stock_commande_client=$this->stats_commande['qty'];
|
||||
}
|
||||
if (! empty($conf->expedition->enabled))
|
||||
{
|
||||
$result=$this->load_stats_sending(0,'1,2', 1);
|
||||
if ($result < 0) dol_print_error($this->db,$this->error);
|
||||
$stock_sending_client=$this->stats_expedition['qty'];
|
||||
}
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
$result=$this->load_stats_commande_fournisseur(0,'1,2,3,4', 1);
|
||||
if ($result < 0) dol_print_error($this->db,$this->error);
|
||||
$stock_commande_fournisseur=$this->stats_commande_fournisseur['qty'];
|
||||
|
||||
$result=$this->load_stats_reception(0,'4', 1);
|
||||
if ($result < 0) dol_print_error($this->db,$this->error);
|
||||
$stock_reception_fournisseur=$this->stats_reception['qty'];
|
||||
}
|
||||
$result=$this->load_stats_reception(0,'4', 1);
|
||||
if ($result < 0) dol_print_error($this->db,$this->error);
|
||||
$stock_reception_fournisseur=$this->stats_reception['qty'];
|
||||
}
|
||||
|
||||
// Stock decrease mode
|
||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
|
||||
$this->stock_theorique=$this->stock_reel-$stock_commande_client+$stock_sending_client;
|
||||
}
|
||||
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)) {
|
||||
$this->stock_theorique=$this->stock_reel;
|
||||
}
|
||||
if (! empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
|
||||
$this->stock_theorique=$this->stock_reel-$stock_commande_client;
|
||||
}
|
||||
// Stock Increase mode
|
||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
|
||||
$this->stock_theorique+=$stock_commande_fournisseur-$stock_reception_fournisseur;
|
||||
}
|
||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) {
|
||||
$this->stock_theorique-=$stock_reception_fournisseur;
|
||||
}
|
||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) {
|
||||
$this->stock_theorique+=$stock_commande_fournisseur-$stock_reception_fournisseur;
|
||||
}
|
||||
}
|
||||
// Stock decrease mode
|
||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
|
||||
$this->stock_theorique=$this->stock_reel-$stock_commande_client+$stock_sending_client;
|
||||
}
|
||||
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)) {
|
||||
$this->stock_theorique=$this->stock_reel;
|
||||
}
|
||||
if (! empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
|
||||
$this->stock_theorique=$this->stock_reel-$stock_commande_client;
|
||||
}
|
||||
// Stock Increase mode
|
||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
|
||||
$this->stock_theorique+=$stock_commande_fournisseur-$stock_reception_fournisseur;
|
||||
}
|
||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) {
|
||||
$this->stock_theorique-=$stock_reception_fournisseur;
|
||||
}
|
||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) {
|
||||
$this->stock_theorique+=$stock_commande_fournisseur-$stock_reception_fournisseur;
|
||||
}
|
||||
|
||||
if (! is_object($hookmanager)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('productdao'));
|
||||
$parameters=array('id'=>$this->id);
|
||||
// Note that $action and $object may have been modified by some hooks
|
||||
$reshook=$hookmanager->executeHooks('loadvirtualstock', $parameters, $this, $action);
|
||||
if ($reshook > 0) $this->stock_theorique = $hookmanager->resArray['stock_theorique'];
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -4143,7 +4155,7 @@ class Product extends CommonObject
|
||||
*
|
||||
* @param string $batch Lot/serial number
|
||||
* @return array Array with record into product_batch
|
||||
* @see load_stock, load_virtual_stock
|
||||
* @see load_stock(), load_virtual_stock()
|
||||
*/
|
||||
function loadBatchInfo($batch)
|
||||
{
|
||||
@ -4739,51 +4751,51 @@ class Product extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load information for tab info
|
||||
*
|
||||
* @param int $id Id of thirdparty to load
|
||||
* @return void
|
||||
*/
|
||||
function info($id)
|
||||
{
|
||||
$sql = "SELECT p.rowid, p.ref, p.datec as date_creation, p.tms as date_modification,";
|
||||
$sql.= " p.fk_user_author, p.fk_user_modif";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as p";
|
||||
$sql.= " WHERE p.rowid = ".$id;
|
||||
/**
|
||||
* Load information for tab info
|
||||
*
|
||||
* @param int $id Id of thirdparty to load
|
||||
* @return void
|
||||
*/
|
||||
function info($id)
|
||||
{
|
||||
$sql = "SELECT p.rowid, p.ref, p.datec as date_creation, p.tms as date_modification,";
|
||||
$sql.= " p.fk_user_author, p.fk_user_modif";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as p";
|
||||
$sql.= " WHERE p.rowid = ".$id;
|
||||
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($this->db->num_rows($result))
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
|
||||
if ($obj->fk_user_author) {
|
||||
$cuser = new User($this->db);
|
||||
$cuser->fetch($obj->fk_user_author);
|
||||
$this->user_creation = $cuser;
|
||||
}
|
||||
|
||||
if ($obj->fk_user_modif) {
|
||||
$muser = new User($this->db);
|
||||
$muser->fetch($obj->fk_user_modif);
|
||||
$this->user_modification = $muser;
|
||||
}
|
||||
|
||||
$this->ref = $obj->ref;
|
||||
$this->date_creation = $this->db->jdate($obj->date_creation);
|
||||
$this->date_modification = $this->db->jdate($obj->date_modification);
|
||||
}
|
||||
|
||||
$this->db->free($result);
|
||||
|
||||
}
|
||||
else
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($this->db->num_rows($result))
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
|
||||
if ($obj->fk_user_author) {
|
||||
$cuser = new User($this->db);
|
||||
$cuser->fetch($obj->fk_user_author);
|
||||
$this->user_creation = $cuser;
|
||||
}
|
||||
|
||||
if ($obj->fk_user_modif) {
|
||||
$muser = new User($this->db);
|
||||
$muser->fetch($obj->fk_user_modif);
|
||||
$this->user_modification = $muser;
|
||||
}
|
||||
|
||||
$this->ref = $obj->ref;
|
||||
$this->date_creation = $this->db->jdate($obj->date_creation);
|
||||
$this->date_modification = $this->db->jdate($obj->date_modification);
|
||||
}
|
||||
|
||||
$this->db->free($result);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -765,7 +765,7 @@ elseif ($object->id > 0)
|
||||
|
||||
// Label
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
|
||||
print '<td><input class="quatrevingtpercent" name="title" value="'.$object->title.'"></td></tr>';
|
||||
print '<td><input class="quatrevingtpercent" name="title" value="'.dol_escape_htmltag($object->title).'"></td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Status").'</td><td>';
|
||||
|
||||
@ -18,8 +18,7 @@
|
||||
/**
|
||||
* \file htdocs/public/website/index.php
|
||||
* \ingroup website
|
||||
* \brief Page to output pages
|
||||
* \author Laurent Destailleur
|
||||
* \brief Wrapper to output pages when website is powered by Dolibarr instead of a native web server
|
||||
*/
|
||||
|
||||
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); // Disables token renewal
|
||||
@ -59,88 +58,91 @@ $accessallowed = 1;
|
||||
$type='';
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
if (empty($pageid))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
|
||||
|
||||
$object=new Website($db);
|
||||
$object->fetch(0, $websitekey);
|
||||
|
||||
if (empty($object->id))
|
||||
{
|
||||
if (empty($pageid))
|
||||
{
|
||||
// Return header 404
|
||||
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found", true, 404);
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/public/error-404.php';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$objectpage=new WebsitePage($db);
|
||||
|
||||
if ($pageref)
|
||||
{
|
||||
$result=$objectpage->fetch(0, $object->id, $pageref);
|
||||
if ($result > 0)
|
||||
{
|
||||
$pageid = $objectpage->id;
|
||||
}
|
||||
elseif($result == 0)
|
||||
{
|
||||
// Page not found from ref=pageurl, we try using alternative alias
|
||||
$result=$objectpage->fetch(0, $object->id, null, $pageref);
|
||||
if ($result > 0)
|
||||
{
|
||||
$pageid = $objectpage->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($object->fk_default_home > 0)
|
||||
{
|
||||
$result=$objectpage->fetch($object->fk_default_home);
|
||||
if ($result > 0)
|
||||
{
|
||||
$pageid = $objectpage->id;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($pageid))
|
||||
{
|
||||
$array=$objectpage->fetchAll($object->id);
|
||||
if (is_array($array) && count($array) > 0)
|
||||
{
|
||||
$firstrep=reset($array);
|
||||
$pageid=$firstrep->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty($pageid))
|
||||
{
|
||||
// Return header 404
|
||||
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found", true, 404);
|
||||
|
||||
$langs->load("website");
|
||||
|
||||
if (! GETPOSTISSET('pageref')) print $langs->trans("PreviewOfSiteNotYetAvailable", $websitekey);
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/public/error-404.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
$appli=constant('DOL_APPLICATION_TITLE');
|
||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
//print 'Directory with '.$appli.' websites.<br>';
|
||||
|
||||
if (empty($pageid))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
|
||||
|
||||
$object=new Website($db);
|
||||
$object->fetch(0, $websitekey);
|
||||
|
||||
if (empty($object->id))
|
||||
{
|
||||
if (empty($pageid))
|
||||
{
|
||||
// Return header 404
|
||||
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found", true, 404);
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/public/error-404.php';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$objectpage=new WebsitePage($db);
|
||||
|
||||
if ($pageref)
|
||||
{
|
||||
$result=$objectpage->fetch(0, $object->id, $pageref);
|
||||
if ($result > 0)
|
||||
{
|
||||
$pageid = $objectpage->id;
|
||||
}
|
||||
elseif($result == 0)
|
||||
{
|
||||
// Page not found from ref=pageurl, we try using alternative alias
|
||||
$result=$objectpage->fetch(0, $object->id, null, $pageref);
|
||||
if ($result > 0)
|
||||
{
|
||||
$pageid = $objectpage->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($object->fk_default_home > 0)
|
||||
{
|
||||
$result=$objectpage->fetch($object->fk_default_home);
|
||||
if ($result > 0)
|
||||
{
|
||||
$pageid = $objectpage->id;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($pageid))
|
||||
{
|
||||
$array=$objectpage->fetchAll($object->id);
|
||||
if (is_array($array) && count($array) > 0)
|
||||
{
|
||||
$firstrep=reset($array);
|
||||
$pageid=$firstrep->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty($pageid))
|
||||
{
|
||||
// Return header 404
|
||||
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found", true, 404);
|
||||
|
||||
$langs->load("website");
|
||||
|
||||
if (! GETPOSTISSET('pageref')) print $langs->trans("PreviewOfSiteNotYetAvailable", $websitekey);
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/public/error-404.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
// Security: Delete string ../ into $original_file
|
||||
global $dolibarr_main_data_root;
|
||||
|
||||
@ -1079,20 +1079,72 @@ class Website extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Component to select language (Full CSS Only)
|
||||
* Component to select language inside a container (Full CSS Only)
|
||||
*
|
||||
* @param array $languagecodes Language codes array. Example: array('en_US','fr_FR','de_DE','es_ES')
|
||||
* @param Translate $weblangs Language Object
|
||||
* @param string $morecss More CSS class on component
|
||||
* @param string $htmlname Suffix for HTML name
|
||||
* @return string HTML select component
|
||||
* @param array|string $languagecodes 'auto' to show all languages available for page, or language codes array like array('en_US','fr_FR','de_DE','es_ES')
|
||||
* @param Translate $weblangs Language Object
|
||||
* @param string $morecss More CSS class on component
|
||||
* @param string $htmlname Suffix for HTML name
|
||||
* @return string HTML select component
|
||||
*/
|
||||
public function componentSelectLang($languagecodes, $weblangs, $morecss='', $htmlname='')
|
||||
{
|
||||
global $websitepagefile, $website;
|
||||
|
||||
if (! is_object($weblangs)) return 'ERROR componentSelectLang called with parameter $weblangs not defined';
|
||||
|
||||
$languagecodeselected = $weblangs->defaultlang;
|
||||
// Load tmppage if we have $websitepagefile defined
|
||||
$tmppage=new WebsitePage($this->db);
|
||||
|
||||
$pageid = 0;
|
||||
if (! empty($websitepagefile))
|
||||
{
|
||||
$pageid = str_replace(array('.tpl.php', 'page'), array('', ''), basename($websitepagefile));
|
||||
if ($pageid > 0)
|
||||
{
|
||||
$tmppage->fetch($pageid);
|
||||
}
|
||||
}
|
||||
|
||||
// Fill with existing translation, nothing if none
|
||||
if (! is_array($languagecodes) && $pageid > 0)
|
||||
{
|
||||
$languagecodes = array();
|
||||
|
||||
$sql ="SELECT wp.rowid, wp.lang, wp.pageurl, wp.fk_page";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."website_page as wp";
|
||||
$sql.=" WHERE wp.fk_website = ".$website->id;
|
||||
$sql.=" AND (wp.fk_page = ".$pageid." OR wp.rowid = ".$pageid;
|
||||
if ($tmppage->fk_page > 0) $sql.=" OR wp.fk_page = ".$tmppage->fk_page." OR wp.rowid = ".$tmppage->fk_page;
|
||||
$sql.=")";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($obj = $this->db->fetch_object($resql))
|
||||
{
|
||||
$newlang = $obj->lang;
|
||||
if ($obj->rowid == $pageid) $newlang = $obj->lang;
|
||||
if (! in_array($newlang, $languagecodes)) $languagecodes[]=$newlang;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Now $languagecodes is always an array
|
||||
|
||||
$languagecodeselected= $weblangs->defaultlang; // Because we must init with a value, but real value is the lang of main parent container
|
||||
if (! empty($websitepagefile))
|
||||
{
|
||||
$pageid = str_replace(array('.tpl.php', 'page'), array('', ''), basename($websitepagefile));
|
||||
if ($pageid > 0)
|
||||
{
|
||||
|
||||
$languagecodeselected=$tmppage->lang;
|
||||
if (! in_array($tmppage->lang, $languagecodes)) $languagecodes[]=$tmppage->lang; // We add language code of page into combo list
|
||||
}
|
||||
}
|
||||
|
||||
$weblangs->load('languages');
|
||||
//var_dump($weblangs->defaultlang);
|
||||
|
||||
$url = $_SERVER["REQUEST_URI"];
|
||||
$url = preg_replace('/(\?|&)l=([a-zA-Z_]*)/', '', $url); // We remove param l from url
|
||||
@ -1103,7 +1155,8 @@ class Website extends CommonObject
|
||||
$MAXHEIGHT = 4 * $HEIGHTOPTION;
|
||||
$nboflanguage = count($languagecodes);
|
||||
|
||||
$out.='<!-- componentSelectLang'.$htmlname.' -->'."\n";
|
||||
$out ='<!-- componentSelectLang'.$htmlname.' -->'."\n";
|
||||
|
||||
$out.= '<style>';
|
||||
$out.= '.componentSelectLang'.$htmlname.':hover { height: '.min($MAXHEIGHT, ($HEIGHTOPTION * $nboflanguage)).'px; overflow-x: hidden; overflow-y: '.((($HEIGHTOPTION * $nboflanguage) > $MAXHEIGHT) ? ' scroll' : 'hidden').'; }'."\n";
|
||||
$out.= '.componentSelectLang'.$htmlname.' li { line-height: '.$HEIGHTOPTION.'px; }'."\n";
|
||||
|
||||
@ -193,8 +193,11 @@ class WebsitePage extends CommonObject
|
||||
|
||||
$this->fk_website = $obj->fk_website;
|
||||
$this->type_container = $obj->type_container;
|
||||
|
||||
$this->pageurl = $obj->pageurl;
|
||||
$this->ref = $obj->pageurl;
|
||||
$this->aliasalt = preg_replace('/,+$/', '', preg_replace('/^,+/', '', $obj->aliasalt));
|
||||
|
||||
$this->title = $obj->title;
|
||||
$this->description = $obj->description;
|
||||
$this->keywords = $obj->keywords;
|
||||
|
||||
@ -459,6 +459,7 @@ if ($action == 'addcontainer')
|
||||
//$objectpage->htmlheader = preg_replace('/<meta name="msvalidate.01[^>]*>\n*/ims', '', $objectpage->htmlheader);
|
||||
$objectpage->htmlheader = preg_replace('/<title>[^<]*<\/title>\n*/ims', '', $objectpage->htmlheader);
|
||||
$objectpage->htmlheader = preg_replace('/<link[^>]*rel="shortcut[^>]*>\n/ims', '', $objectpage->htmlheader);
|
||||
$objectpage->htmlheader = preg_replace('/<link[^>]*rel="canonical[^>]*>\n/ims', '', $objectpage->htmlheader);
|
||||
|
||||
// Now loop to fetch JS
|
||||
$tmp = $objectpage->htmlheader;
|
||||
@ -1749,7 +1750,7 @@ if (count($object->records) > 0) // There is at least one web site
|
||||
|
||||
$htmltext = $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint, $dataroot);
|
||||
$htmltext.='<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT);
|
||||
$htmltext.='<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT);
|
||||
$htmltext.='<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website<br>'.DOL_DATA_ROOT.'/medias');
|
||||
print '<a class="websitebuttonsitepreview" id="previewsite" href="'.$urlwithroot.'/public/website/index.php?website='.$websitekey.'" target="tab'.$websitekey.'" alt="'.dol_escape_htmltag($htmltext).'">';
|
||||
print $form->textwithpicto('', $htmltext, 1, 'preview');
|
||||
print '</a>';
|
||||
@ -1760,7 +1761,7 @@ if (count($object->records) > 0) // There is at least one web site
|
||||
$htmltext =$langs->trans("SetHereVirtualHost", $dataroot);
|
||||
$htmltext.='<br>';
|
||||
$htmltext.='<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT);
|
||||
$htmltext.='<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT);
|
||||
$htmltext.='<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website<br>'.DOL_DATA_ROOT.'/medias');
|
||||
$htmltext.='<br>';
|
||||
$htmltext.='<br>';
|
||||
$htmltext.=$langs->trans("YouCanAlsoTestWithPHPS", $dataroot);
|
||||
@ -1782,7 +1783,7 @@ if (count($object->records) > 0) // There is at least one web site
|
||||
$htmltext = $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext?$urlext:'<span class="error">'.$langs->trans("VirtualHostUrlNotDefined").'</span>');
|
||||
$htmltext.='<br>';
|
||||
$htmltext.='<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT);
|
||||
$htmltext.='<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT);
|
||||
$htmltext.='<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website<br>'.DOL_DATA_ROOT.'/medias');
|
||||
print '<a class="websitebuttonsitepreview'.($urlext?'':' websitebuttonsitepreviewdisabled cursornotallowed').'" id="previewsiteext" href="'.$urlext.'" target="tab'.$websitekey.'ext" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext)).'">';
|
||||
print $form->textwithpicto('', $htmltext, 1, 'preview_ext');
|
||||
print '</a>';
|
||||
@ -1926,10 +1927,11 @@ if (count($object->records) > 0) // There is at least one web site
|
||||
// Create an array for form
|
||||
$preselectedlanguage = GETPOST('newlang', 'az09') ? GETPOST('newlang', 'az09') : ($objectpage->lang ? $objectpage->lang : $langs->defaultlang);
|
||||
$formquestion = array(
|
||||
array('type' => 'text', 'tdclass'=>'maxwidth200', 'name' => 'pageurl', 'label'=> $langs->trans("WEBSITE_PAGENAME"), 'value'=> 'copy_of_'.$objectpage->pageurl),
|
||||
array('type' => 'hidden', 'name' => 'sourcepageurl', 'value'=> $objectpage->pageurl),
|
||||
array('type' => 'checkbox', 'tdclass'=>'maxwidth200', 'name' => 'is_a_translation', 'label' => $langs->trans("PageIsANewTranslation"), 'value' => 0),
|
||||
array('type' => 'other','name' => 'newlang', 'label' => $langs->trans("Language"), 'value' => $formadmin->select_language($preselectedlanguage, 'newlang', 0, null, 1, 0, 0, 'minwidth200', 0, 1)),
|
||||
array('type' => 'other','name' => 'newwebsite', 'label' => $langs->trans("WebSite"), 'value' => $formwebsite->selectWebsite($object->id, 'newwebsite', 0)),
|
||||
array('type' => 'text', 'tdclass'=>'maxwidth200 fieldrequired', 'name' => 'pageurl', 'label'=> $langs->trans("WEBSITE_PAGENAME"), 'value'=> 'copy_of_'.$objectpage->pageurl),
|
||||
);
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?website='.$object->ref.'&pageid=' . $pageid, $langs->trans('ClonePage'), '', 'confirm_createpagefromclone', $formquestion, 0, 1, 300, 550);
|
||||
@ -1943,6 +1945,7 @@ if (count($object->records) > 0) // There is at least one web site
|
||||
|
||||
print '<input type="submit" class="button nobordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditHTMLSource")).'" name="editsource">';
|
||||
|
||||
print '<!-- button EditInLine and ShowSubcontainers -->'."\n";
|
||||
print '<div class="websiteselectionsection inline-block">';
|
||||
print '<div class="inline-block">';
|
||||
print $langs->trans("EditInLine");
|
||||
@ -1966,12 +1969,12 @@ if (count($object->records) > 0) // There is at least one web site
|
||||
print '</div>';
|
||||
print '<div class="inline-block">';
|
||||
print $langs->trans("ShowSubcontainers");
|
||||
if ($websitepage->grabbed_from)
|
||||
/*if ($websitepage->grabbed_from)
|
||||
{
|
||||
print '<a class="button nobordertransp opacitymedium nohoverborder"'.$disabled.' href="#" disabled="disabled" title="'.dol_escape_htmltag($langs->trans("OnlyEditionOfSourceForGrabbedContent")).'">'.img_picto($langs->trans("OnlyEditionOfSourceForGrabbedContent"),'switch_off','',false,0,0,'','nomarginleft').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
{*/
|
||||
if (empty($conf->global->WEBSITE_SUBCONTAINERSINLINE))
|
||||
{
|
||||
print '<a class="button nobordertransp nohoverborder"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=setshowsubcontainers">'.img_picto($langs->trans("ShowSubContainersOff"),'switch_off','',false,0,0,'','nomarginleft').'</a>';
|
||||
@ -1980,7 +1983,7 @@ if (count($object->records) > 0) // There is at least one web site
|
||||
{
|
||||
print '<a class="button nobordertransp nohoverborder"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=unsetshowsubcontainers">'.img_picto($langs->trans("ShowSubContainersOn"),'switch_on','',false,0,0,'','nomarginleft').'</a>';
|
||||
}
|
||||
}
|
||||
/*}*/
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
@ -2002,7 +2005,7 @@ if (count($object->records) > 0) // There is at least one web site
|
||||
|
||||
$htmltext = $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage, $dataroot);
|
||||
$htmltext.='<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT);
|
||||
$htmltext.='<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT);
|
||||
$htmltext.='<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website<br>'.DOL_DATA_ROOT.'/medias');
|
||||
|
||||
print '<a class="websitebuttonsitepreview" id="previewpage" href="'.$realpage.'&nocache='.dol_now().'" class="button" target="tab'.$websitekey.'" alt="'.dol_escape_htmltag($htmltext).'">';
|
||||
print $form->textwithpicto('', $htmltext, 1, 'preview');
|
||||
@ -2320,7 +2323,7 @@ if ($action == 'createsite')
|
||||
$htmltext = $langs->trans("SetHereVirtualHost", DOL_DATA_ROOT.'/website/<i>websiteref</i>');
|
||||
$htmltext.='<br>';
|
||||
$htmltext.='<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT);
|
||||
$htmltext.='<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT);
|
||||
$htmltext.='<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website<br>'.DOL_DATA_ROOT.'/medias');
|
||||
|
||||
print $form->textwithpicto($langs->trans('Virtualhost'), $htmltext, 1, 'help', '', 0, 2, 'tooltipvirtual');
|
||||
print '</td><td>';
|
||||
@ -2517,6 +2520,53 @@ if ($action == 'editmeta' || $action == 'createcontainer')
|
||||
print $formadmin->select_language($pagelang?$pagelang:$langs->defaultlang, 'WEBSITE_LANG', 0, null, '1');
|
||||
print '</td></tr>';
|
||||
|
||||
if ($action != 'createcontainer')
|
||||
{
|
||||
// Translation of
|
||||
if ($objectpage->fk_page > 0)
|
||||
{
|
||||
print '<tr><td>';
|
||||
print $langs->trans('ThisPageIsTranslationOf');
|
||||
print '</td><td>';
|
||||
$sourcepage=new WebsitePage($db);
|
||||
$result = $sourcepage->fetch($objectpage->fk_page);
|
||||
if ($result == 0) // not found, we can reset value
|
||||
{
|
||||
|
||||
}
|
||||
elseif ($result > 0)
|
||||
{
|
||||
print $sourcepage->getNomUrl(1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Has translation pages
|
||||
$sql='SELECT rowid, lang from '.MAIN_DB_PREFIX.'website_page where fk_page = '.$objectpage->id;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num_rows = $db->num_rows($resql);
|
||||
if ($num_rows > 0)
|
||||
{
|
||||
print '<tr><td>';
|
||||
print $langs->trans('ThisPageHasTranslationPages');
|
||||
print '</td><td>';
|
||||
$i=0;
|
||||
while ($obj = $db->fetch_object($resql))
|
||||
{
|
||||
$tmppage=new WebsitePage($db);
|
||||
$tmppage->fetch($obj->rowid);
|
||||
if ($i > 0) print ' - ';
|
||||
print $tmppage->getNomUrl(1).' ('.$tmppage->lang.')';
|
||||
$i++;
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
}
|
||||
|
||||
print '<tr><td class="titlefieldcreate">';
|
||||
$htmlhelp=$langs->trans("WEBSITE_ALIASALTDesc");
|
||||
print $form->textwithpicto($langs->trans('WEBSITE_ALIASALT'), $htmlhelp, 1, 'help', '', 0, 2, 'htmlheadertooltip');
|
||||
|
||||